@burdenoff/microfe-billing 2026.1101.1 → 2026.1108.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billing/BillingAdminRoutes.d.ts +1 -2
- package/dist/billing/BillingAdminRoutes.js +11 -12
- package/dist/billing/BillingAdminRoutes.js.map +1 -1
- package/dist/billing/BillingRoot.d.ts +0 -1
- package/dist/billing/BillingRoot.js +10 -9
- package/dist/billing/BillingRoot.js.map +1 -1
- package/dist/billing/BillingUserRoutes.d.ts +1 -2
- package/dist/billing/BillingUserRoutes.js +13 -14
- package/dist/billing/BillingUserRoutes.js.map +1 -1
- package/dist/billing/hooks/useBillingAccountSelection.d.ts +0 -1
- package/dist/billing/hooks/useBillingAccountSelection.js +7 -5
- package/dist/billing/hooks/useBillingAccountSelection.js.map +1 -1
- package/dist/billing/hooks/useBillingEventEmitter.d.ts +0 -1
- package/dist/billing/hooks/useBillingEventEmitter.js +1 -2
- package/dist/billing/hooks/useBillingEventEmitter.js.map +1 -1
- package/dist/billing/hooks/useBillingNavigate.d.ts +0 -1
- package/dist/billing/hooks/useBillingNavigate.js +1 -2
- package/dist/billing/hooks/useBillingNavigate.js.map +1 -1
- package/dist/billing/hooks/useBillingPermissions.d.ts +0 -1
- package/dist/billing/hooks/useBillingPermissions.js +2 -3
- package/dist/billing/hooks/useBillingPermissions.js.map +1 -1
- package/dist/billing/hooks/useDefaultBillingCurrency.d.ts +0 -1
- package/dist/billing/hooks/useDefaultBillingCurrency.js +1 -2
- package/dist/billing/hooks/useDefaultBillingCurrency.js.map +1 -1
- package/dist/billing/hooks/useProducts.d.ts +0 -1
- package/dist/billing/hooks/useProducts.js +1 -2
- package/dist/billing/hooks/useProducts.js.map +1 -1
- package/dist/billing/index.d.ts +0 -1
- package/dist/billing/lib/native-purchases.d.ts +0 -1
- package/dist/billing/lib/native-purchases.js +1 -2
- package/dist/billing/lib/native-purchases.js.map +1 -1
- package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts +0 -1
- package/dist/billing/modules/addons/components/FloatingCartDrawer.js +4 -5
- package/dist/billing/modules/addons/components/FloatingCartDrawer.js.map +1 -1
- package/dist/billing/modules/addons/hooks/index.d.ts +0 -1
- package/dist/billing/modules/addons/hooks/index.js +3 -2
- package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.d.ts +0 -1
- package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.js +1 -2
- package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.js.map +1 -1
- package/dist/billing/modules/addons/hooks/useAddons.d.ts +0 -1
- package/dist/billing/modules/addons/hooks/useAddons.js +1 -2
- package/dist/billing/modules/addons/hooks/useAddons.js.map +1 -1
- package/dist/billing/modules/addons/index.d.ts +0 -1
- package/dist/billing/modules/addons/index.js +10 -10
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +15 -16
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonCreatePage.js +11 -12
- package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonDetailPage.js +16 -17
- package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.js +16 -17
- package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +111 -106
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.js +105 -100
- package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/index.d.ts +0 -1
- package/dist/billing/modules/addons/pages/index.js +7 -6
- package/dist/billing/modules/addons/store/addonCartStore.d.ts +0 -1
- package/dist/billing/modules/addons/store/addonCartStore.js +2 -7
- package/dist/billing/modules/addons/store/addonCartStore.js.map +1 -1
- package/dist/billing/modules/affiliate/api.d.ts +0 -1
- package/dist/billing/modules/affiliate/api.js +1 -2
- package/dist/billing/modules/affiliate/api.js.map +1 -1
- package/dist/billing/modules/affiliate/index.d.ts +0 -1
- package/dist/billing/modules/affiliate/index.js +1 -2
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts +0 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +29 -28
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/analytics/index.d.ts +0 -1
- package/dist/billing/modules/analytics/index.js +1 -2
- package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts +0 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js +8 -9
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
- package/dist/billing/modules/analytics/pages/index.d.ts +0 -1
- package/dist/billing/modules/analytics/pages/index.js +1 -1
- package/dist/billing/modules/billing/hooks/index.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/index.js +5 -4
- package/dist/billing/modules/billing/hooks/useInvoices.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/useInvoices.js +1 -2
- package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
- package/dist/billing/modules/billing/hooks/useOrderCallbacks.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/useOrderCallbacks.js +1 -2
- package/dist/billing/modules/billing/hooks/useOrderCallbacks.js.map +1 -1
- package/dist/billing/modules/billing/hooks/usePayments.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/useRefunds.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/useRefunds.js +1 -2
- package/dist/billing/modules/billing/hooks/useRefunds.js.map +1 -1
- package/dist/billing/modules/billing/hooks/useTransactions.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/useTransactions.js +30 -31
- package/dist/billing/modules/billing/hooks/useTransactions.js.map +1 -1
- package/dist/billing/modules/billing/index.d.ts +0 -1
- package/dist/billing/modules/billing/index.js +15 -15
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +11 -12
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +53 -59
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +81 -87
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +11 -12
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +51 -54
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +33 -34
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/RefundsPage.js +92 -93
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +38 -39
- package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +24 -30
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/index.d.ts +0 -1
- package/dist/billing/modules/billing/pages/index.js +10 -9
- package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts +0 -1
- package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/BillingAccountSelector.js +1 -2
- package/dist/billing/modules/checkout/components/BillingAccountSelector.js.map +1 -1
- package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts +0 -1
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.d.ts +0 -1
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js +1 -2
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js.map +1 -1
- package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts +0 -1
- package/dist/billing/modules/checkout/components/CreditsAmountInput.js +1 -2
- package/dist/billing/modules/checkout/components/CreditsAmountInput.js.map +1 -1
- package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts +0 -1
- package/dist/billing/modules/checkout/components/CurrencySelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts +0 -1
- package/dist/billing/modules/checkout/components/NativeCheckoutView.js +1 -2
- package/dist/billing/modules/checkout/components/NativeCheckoutView.js.map +1 -1
- package/dist/billing/modules/checkout/components/OrderSummary.d.ts +0 -1
- package/dist/billing/modules/checkout/components/OrderSummary.js +35 -32
- package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -1
- package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts +0 -1
- package/dist/billing/modules/checkout/components/PromoCodeInput.js +1 -2
- package/dist/billing/modules/checkout/components/PromoCodeInput.js.map +1 -1
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts +0 -1
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js +1 -2
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js.map +1 -1
- package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts +0 -1
- package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js +1 -2
- package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js.map +1 -1
- package/dist/billing/modules/checkout/components/StoreShippingSection.d.ts +0 -1
- package/dist/billing/modules/checkout/components/StoreShippingSection.js +5 -3
- package/dist/billing/modules/checkout/components/StoreShippingSection.js.map +1 -1
- package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts +0 -1
- package/dist/billing/modules/checkout/components/StripePaymentForm.js +35 -41
- package/dist/billing/modules/checkout/components/StripePaymentForm.js.map +1 -1
- package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/SubscriptionSelector.js +1 -2
- package/dist/billing/modules/checkout/components/SubscriptionSelector.js.map +1 -1
- package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js +1 -2
- package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js.map +1 -1
- package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.d.ts +0 -1
- package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.js +5 -6
- package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.js.map +1 -1
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.d.ts +0 -1
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js +7 -8
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js.map +1 -1
- package/dist/billing/modules/checkout/components/index.d.ts +0 -1
- package/dist/billing/modules/checkout/components/index.js +12 -11
- package/dist/billing/modules/checkout/hooks/index.d.ts +0 -1
- package/dist/billing/modules/checkout/hooks/index.js +5 -4
- package/dist/billing/modules/checkout/hooks/useCheckout.d.ts +0 -1
- package/dist/billing/modules/checkout/hooks/useCheckout.js +182 -195
- package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts +0 -1
- package/dist/billing/modules/checkout/hooks/useNativeCheckout.js +33 -32
- package/dist/billing/modules/checkout/hooks/useNativeCheckout.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts +0 -1
- package/dist/billing/modules/checkout/hooks/usePaymentProviders.js +1 -2
- package/dist/billing/modules/checkout/hooks/usePaymentProviders.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts +0 -1
- package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js +1 -2
- package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/useStoreShipping.d.ts +4 -8
- package/dist/billing/modules/checkout/hooks/useStoreShipping.js +1 -2
- package/dist/billing/modules/checkout/hooks/useStoreShipping.js.map +1 -1
- package/dist/billing/modules/checkout/index.d.ts +0 -1
- package/dist/billing/modules/checkout/index.js +19 -19
- package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts +0 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +730 -732
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/checkout/pages/index.d.ts +0 -1
- package/dist/billing/modules/checkout/pages/index.js +1 -1
- package/dist/billing/modules/checkout/types/index.d.ts +0 -1
- package/dist/billing/modules/checkout/utils/storeOrder.d.ts +0 -1
- package/dist/billing/modules/checkout/utils/storeOrder.js +0 -1
- package/dist/billing/modules/checkout/utils/storeOrder.js.map +1 -1
- package/dist/billing/modules/coupons/index.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +5 -6
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/CouponsListPage.js +15 -13
- package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js +12 -10
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/EditCouponPage.js +7 -11
- package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/index.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/index.js +5 -4
- package/dist/billing/modules/credits/hooks/index.d.ts +0 -1
- package/dist/billing/modules/credits/hooks/useCredits.d.ts +0 -1
- package/dist/billing/modules/credits/hooks/useCredits.js +20 -21
- package/dist/billing/modules/credits/hooks/useCredits.js.map +1 -1
- package/dist/billing/modules/credits/index.d.ts +0 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts +0 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js +19 -24
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts +0 -1
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +26 -27
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts +0 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +54 -52
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.d.ts +0 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +37 -38
- package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/index.d.ts +0 -1
- package/dist/billing/modules/credits/pages/index.js +5 -4
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js +2 -3
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js.map +1 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js +35 -43
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js.map +1 -1
- package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/BillingAccountCard.js +1 -2
- package/dist/billing/modules/dashboard/components/BillingAccountCard.js.map +1 -1
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +1 -2
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -1
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js +2 -5
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js.map +1 -1
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js +1 -2
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js.map +1 -1
- package/dist/billing/modules/dashboard/components/index.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/index.js +7 -6
- package/dist/billing/modules/dashboard/hooks/index.d.ts +0 -1
- package/dist/billing/modules/dashboard/hooks/index.js +3 -2
- package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts +0 -1
- package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js +2 -3
- package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js.map +1 -1
- package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts +0 -1
- package/dist/billing/modules/dashboard/hooks/useDashboard.js +2 -3
- package/dist/billing/modules/dashboard/hooks/useDashboard.js.map +1 -1
- package/dist/billing/modules/dashboard/index.d.ts +0 -1
- package/dist/billing/modules/dashboard/index.js +11 -10
- package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts +0 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +266 -264
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/dashboard/pages/index.d.ts +0 -1
- package/dist/billing/modules/dashboard/pages/index.js +1 -1
- package/dist/billing/modules/discounts/index.d.ts +0 -1
- package/dist/billing/modules/discounts/index.js +1 -2
- package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts +0 -1
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js +169 -176
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
- package/dist/billing/modules/discounts/pages/index.d.ts +0 -1
- package/dist/billing/modules/discounts/pages/index.js +1 -1
- package/dist/billing/modules/earnings/api.d.ts +1 -2
- package/dist/billing/modules/earnings/api.js +67 -68
- package/dist/billing/modules/earnings/api.js.map +1 -1
- package/dist/billing/modules/earnings/index.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +17 -17
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +188 -189
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +111 -111
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +29 -30
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +203 -166
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/earnings/payoutAccountStatus.d.ts +27 -0
- package/dist/billing/modules/earnings/payoutAccountStatus.js +46 -0
- package/dist/billing/modules/earnings/payoutAccountStatus.js.map +1 -0
- package/dist/billing/modules/plans/constants/enterprise.d.ts +0 -1
- package/dist/billing/modules/plans/constants/enterprise.js +1 -2
- package/dist/billing/modules/plans/constants/enterprise.js.map +1 -1
- package/dist/billing/modules/plans/constants/featuredQuotas.d.ts +0 -1
- package/dist/billing/modules/plans/constants/featuredQuotas.js +1 -2
- package/dist/billing/modules/plans/constants/featuredQuotas.js.map +1 -1
- package/dist/billing/modules/plans/hooks/index.d.ts +0 -1
- package/dist/billing/modules/plans/hooks/index.js +3 -2
- package/dist/billing/modules/plans/hooks/usePlans.d.ts +0 -1
- package/dist/billing/modules/plans/hooks/usePlans.js +1 -2
- package/dist/billing/modules/plans/hooks/usePlans.js.map +1 -1
- package/dist/billing/modules/plans/hooks/useQuotas.d.ts +0 -1
- package/dist/billing/modules/plans/hooks/useQuotas.js +1 -2
- package/dist/billing/modules/plans/hooks/useQuotas.js.map +1 -1
- package/dist/billing/modules/plans/index.d.ts +0 -1
- package/dist/billing/modules/plans/index.js +11 -11
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +12 -15
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +38 -39
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlanCreatePage.js +10 -11
- package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlanDetailPage.js +40 -41
- package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.js +15 -16
- package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +18 -19
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansListPage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlansListPage.js +100 -101
- package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/index.d.ts +0 -1
- package/dist/billing/modules/plans/pages/index.js +8 -7
- package/dist/billing/modules/plans/utils/currencyPriceOverrides.d.ts +0 -1
- package/dist/billing/modules/plans/utils/currencyPriceOverrides.js +1 -2
- package/dist/billing/modules/plans/utils/currencyPriceOverrides.js.map +1 -1
- package/dist/billing/modules/plans/utils/planSelector.d.ts +0 -1
- package/dist/billing/modules/plans/utils/planSelector.js +1 -2
- package/dist/billing/modules/plans/utils/planSelector.js.map +1 -1
- package/dist/billing/modules/promotions/index.d.ts +0 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.d.ts +0 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +5 -6
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/PromotionsListPage.d.ts +0 -1
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js +5 -6
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/index.d.ts +0 -1
- package/dist/billing/modules/promotions/pages/index.js +3 -2
- package/dist/billing/modules/quota/hooks/index.d.ts +0 -1
- package/dist/billing/modules/quota/hooks/index.js +1 -1
- package/dist/billing/modules/quota/hooks/useQuota.d.ts +0 -1
- package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts +0 -1
- package/dist/billing/modules/quota/hooks/useQuotaTemplates.js +1 -2
- package/dist/billing/modules/quota/hooks/useQuotaTemplates.js.map +1 -1
- package/dist/billing/modules/quota/index.d.ts +0 -1
- package/dist/billing/modules/quota/index.js +8 -8
- package/dist/billing/modules/quota/pages/QuotaAssignFreePage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js +12 -15
- package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaPage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaPage.js +3 -3
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +13 -14
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +9 -10
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +12 -13
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +16 -17
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/index.d.ts +0 -1
- package/dist/billing/modules/quota/pages/index.js +6 -5
- package/dist/billing/modules/quota/utils/quotaSelector.d.ts +0 -1
- package/dist/billing/modules/quota/utils/quotaSelector.js +1 -2
- package/dist/billing/modules/quota/utils/quotaSelector.js.map +1 -1
- package/dist/billing/modules/settings/index.d.ts +0 -1
- package/dist/billing/modules/settings/pages/SettingsPage.d.ts +0 -1
- package/dist/billing/modules/settings/pages/SettingsPage.js +12 -13
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts +0 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +32 -32
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/index.d.ts +0 -1
- package/dist/billing/modules/settings/pages/index.js +3 -2
- package/dist/billing/modules/store/graphql/index.d.ts +0 -1
- package/dist/billing/modules/store/index.d.ts +0 -1
- package/dist/billing/modules/store/index.js +1 -2
- package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts +0 -1
- package/dist/billing/modules/store/pages/StoreCheckoutPage.js +1 -2
- package/dist/billing/modules/store/pages/StoreCheckoutPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts +0 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +9 -11
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js.map +1 -1
- package/dist/billing/modules/subscriptions/hooks/index.d.ts +0 -1
- package/dist/billing/modules/subscriptions/hooks/index.js +1 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts +0 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +1 -2
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -1
- package/dist/billing/modules/subscriptions/index.d.ts +0 -1
- package/dist/billing/modules/subscriptions/index.js +6 -6
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts +0 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +311 -312
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts +0 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +61 -62
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts +0 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +30 -31
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/index.d.ts +0 -1
- package/dist/billing/modules/subscriptions/pages/index.js +4 -3
- package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.d.ts +0 -1
- package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js +17 -18
- package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js.map +1 -1
- package/dist/billing/modules/usage/hooks/index.d.ts +0 -1
- package/dist/billing/modules/usage/hooks/useUsage.d.ts +0 -1
- package/dist/billing/modules/usage/hooks/useUsage.js +72 -73
- package/dist/billing/modules/usage/hooks/useUsage.js.map +1 -1
- package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.d.ts +0 -1
- package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.js +12 -13
- package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.js.map +1 -1
- package/dist/billing/modules/usage/index.d.ts +0 -1
- package/dist/billing/modules/usage/index.js +1 -2
- package/dist/billing/modules/usage/pages/UsagePage.d.ts +0 -1
- package/dist/billing/modules/usage/pages/UsagePage.js +229 -227
- package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
- package/dist/billing/modules/usage/pages/index.d.ts +0 -1
- package/dist/billing/modules/usage/pages/index.js +1 -1
- package/dist/billing/modules/usage/utils/aiSpend.d.ts +0 -1
- package/dist/billing/modules/usage/utils/aiSpend.js +2 -3
- package/dist/billing/modules/usage/utils/aiSpend.js.map +1 -1
- package/dist/billing/providers/BillingProvider.d.ts +0 -1
- package/dist/billing/providers/BillingProvider.js +3 -4
- package/dist/billing/providers/BillingProvider.js.map +1 -1
- package/dist/billing/shared/components/AccessDenied.d.ts +0 -1
- package/dist/billing/shared/components/AccessDenied.js +1 -2
- package/dist/billing/shared/components/AccessDenied.js.map +1 -1
- package/dist/billing/shared/components/ActorIdentity.d.ts +0 -1
- package/dist/billing/shared/components/ActorIdentity.js +2 -3
- package/dist/billing/shared/components/ActorIdentity.js.map +1 -1
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts +0 -1
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js +1 -2
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js.map +1 -1
- package/dist/billing/shared/components/EmptyState.d.ts +0 -1
- package/dist/billing/shared/components/EmptyState.js +1 -2
- package/dist/billing/shared/components/EmptyState.js.map +1 -1
- package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts +0 -1
- package/dist/billing/shared/components/PageHeader.d.ts +0 -1
- package/dist/billing/shared/components/PageHeader.js +1 -2
- package/dist/billing/shared/components/PageHeader.js.map +1 -1
- package/dist/billing/shared/components/PushPermissionNudge.d.ts +0 -1
- package/dist/billing/shared/components/PushPermissionNudge.js +2 -3
- package/dist/billing/shared/components/PushPermissionNudge.js.map +1 -1
- package/dist/billing/shared/components/ServerError.d.ts +0 -1
- package/dist/billing/shared/components/ServerError.js +1 -2
- package/dist/billing/shared/components/ServerError.js.map +1 -1
- package/dist/billing/shared/components/StatCard.d.ts +0 -1
- package/dist/billing/shared/components/StatCard.js +1 -2
- package/dist/billing/shared/components/StatCard.js.map +1 -1
- package/dist/billing/shared/components/index.d.ts +0 -1
- package/dist/billing/shared/components/index.js +8 -7
- package/dist/billing/shared/hooks/index.d.ts +0 -1
- package/dist/billing/shared/hooks/index.js +1 -1
- package/dist/billing/shared/hooks/useActorProfiles.d.ts +0 -1
- package/dist/billing/shared/hooks/useActorProfiles.js +4 -8
- package/dist/billing/shared/hooks/useActorProfiles.js.map +1 -1
- package/dist/billing/shared/hooks/useTr.d.ts +0 -1
- package/dist/billing/shared/hooks/useTr.js +1 -2
- package/dist/billing/shared/hooks/useTr.js.map +1 -1
- package/dist/billing/shared/index.d.ts +0 -1
- package/dist/billing/shared/types/graphql.d.ts +0 -1
- package/dist/billing/shared/types/graphql.js +1 -2
- package/dist/billing/shared/types/graphql.js.map +1 -1
- package/dist/billing/shared/types/index.d.ts +0 -1
- package/dist/billing/shared/ui/Card.d.ts +1 -2
- package/dist/billing/shared/ui/Card.js +1 -2
- package/dist/billing/shared/ui/Card.js.map +1 -1
- package/dist/billing/shared/ui/MetricCard.d.ts +1 -2
- package/dist/billing/shared/ui/MetricCard.js +1 -2
- package/dist/billing/shared/ui/MetricCard.js.map +1 -1
- package/dist/billing/shared/ui/ProgressBar.d.ts +1 -2
- package/dist/billing/shared/ui/ProgressBar.js +1 -2
- package/dist/billing/shared/ui/ProgressBar.js.map +1 -1
- package/dist/billing/shared/ui/SectionHeader.d.ts +1 -2
- package/dist/billing/shared/ui/StatusPill.d.ts +1 -2
- package/dist/billing/shared/ui/StatusPill.js +1 -2
- package/dist/billing/shared/ui/StatusPill.js.map +1 -1
- package/dist/billing/shared/ui/index.d.ts +0 -1
- package/dist/billing/shared/ui/index.js +5 -4
- package/dist/billing/shared/utils/directActivityGraphql.d.ts +0 -1
- package/dist/billing/shared/utils/directBillingGraphql.d.ts +0 -1
- package/dist/billing/shared/utils/directBillingGraphql.js +1 -2
- package/dist/billing/shared/utils/directBillingGraphql.js.map +1 -1
- package/dist/billing/shared/utils/error.d.ts +0 -1
- package/dist/billing/shared/utils/error.js +1 -2
- package/dist/billing/shared/utils/error.js.map +1 -1
- package/dist/billing/shared/utils/format.d.ts +0 -1
- package/dist/billing/shared/utils/format.js +1 -2
- package/dist/billing/shared/utils/format.js.map +1 -1
- package/dist/billing/shared/utils/gatewayGraphql.d.ts +0 -1
- package/dist/billing/shared/utils/gatewayGraphql.js +2 -3
- package/dist/billing/shared/utils/gatewayGraphql.js.map +1 -1
- package/dist/billing/shared/utils/index.d.ts +0 -1
- package/dist/billing/shared/utils/index.js +9 -8
- package/dist/billing/shared/utils/navigation.d.ts +0 -1
- package/dist/billing/shared/utils/navigation.js +1 -2
- package/dist/billing/shared/utils/navigation.js.map +1 -1
- package/dist/billing/shared/utils/paymentTheme.d.ts +0 -1
- package/dist/billing/shared/utils/paymentTheme.js +2 -3
- package/dist/billing/shared/utils/paymentTheme.js.map +1 -1
- package/dist/billing/shared/utils/planFeatureQuantity.d.ts +0 -1
- package/dist/billing/shared/utils/planFeatureQuantity.js +2 -3
- package/dist/billing/shared/utils/planFeatureQuantity.js.map +1 -1
- package/dist/billing/shared/utils/status.d.ts +0 -1
- package/dist/billing/shared/utils/status.js +24 -25
- package/dist/billing/shared/utils/status.js.map +1 -1
- package/dist/billing/shared/utils/tokens.d.ts +0 -1
- package/dist/billing/shared/utils/tokens.js +1 -2
- package/dist/billing/shared/utils/tokens.js.map +1 -1
- package/dist/billing/translations/en.d.ts +0 -1
- package/dist/billing/types/index.d.ts +0 -1
- package/dist/dev/main.d.ts +0 -1
- package/dist/generated/global-operations.d.ts +3253 -3206
- package/dist/generated/global-operations.js +446 -422
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +2 -22
- package/dist/generated/global-types.js +1 -2
- package/dist/generated/global-types.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +76 -47
- package/dist/generated/wspace-operations.js +2 -3
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +4 -24
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -2
- package/dist/node_modules/@capacitor/core/dist/index.js +12 -14
- package/dist/node_modules/@capacitor/core/dist/index.js.map +1 -1
- package/dist/node_modules/sonner/dist/index.js +75 -69
- package/dist/node_modules/sonner/dist/index.js.map +1 -1
- package/dist/utils/nativeBridge.d.ts +0 -1
- package/dist/utils/nativeBridge.js +1 -2
- package/package.json +65 -54
- package/dist/billing/BillingAdminRoutes.d.ts.map +0 -1
- package/dist/billing/BillingRoot.d.ts.map +0 -1
- package/dist/billing/BillingUserRoutes.d.ts.map +0 -1
- package/dist/billing/hooks/useBillingAccountSelection.d.ts.map +0 -1
- package/dist/billing/hooks/useBillingEventEmitter.d.ts.map +0 -1
- package/dist/billing/hooks/useBillingNavigate.d.ts.map +0 -1
- package/dist/billing/hooks/useBillingPermissions.d.ts.map +0 -1
- package/dist/billing/hooks/useDefaultBillingCurrency.d.ts.map +0 -1
- package/dist/billing/hooks/useProducts.d.ts.map +0 -1
- package/dist/billing/index.d.ts.map +0 -1
- package/dist/billing/lib/native-purchases.d.ts.map +0 -1
- package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts.map +0 -1
- package/dist/billing/modules/addons/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.d.ts.map +0 -1
- package/dist/billing/modules/addons/hooks/useAddons.d.ts.map +0 -1
- package/dist/billing/modules/addons/index.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/addons/store/addonCartStore.d.ts.map +0 -1
- package/dist/billing/modules/affiliate/api.d.ts.map +0 -1
- package/dist/billing/modules/affiliate/index.d.ts.map +0 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts.map +0 -1
- package/dist/billing/modules/analytics/index.d.ts.map +0 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts.map +0 -1
- package/dist/billing/modules/analytics/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/useInvoices.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/useOrderCallbacks.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/usePayments.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/useRefunds.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/useTransactions.d.ts.map +0 -1
- package/dist/billing/modules/billing/index.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/RefundsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CurrencySelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/OrderSummary.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/StoreShippingSection.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/useCheckout.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/useStoreShipping.d.ts.map +0 -1
- package/dist/billing/modules/checkout/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts.map +0 -1
- package/dist/billing/modules/checkout/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/types/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/utils/storeOrder.d.ts.map +0 -1
- package/dist/billing/modules/coupons/index.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/credits/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/credits/hooks/useCredits.d.ts.map +0 -1
- package/dist/billing/modules/credits/index.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/CreditsPage.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/index.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/index.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/discounts/index.d.ts.map +0 -1
- package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts.map +0 -1
- package/dist/billing/modules/discounts/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/earnings/api.d.ts.map +0 -1
- package/dist/billing/modules/earnings/index.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/constants/enterprise.d.ts.map +0 -1
- package/dist/billing/modules/plans/constants/featuredQuotas.d.ts.map +0 -1
- package/dist/billing/modules/plans/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/plans/hooks/usePlans.d.ts.map +0 -1
- package/dist/billing/modules/plans/hooks/useQuotas.d.ts.map +0 -1
- package/dist/billing/modules/plans/index.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlansListPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/plans/utils/currencyPriceOverrides.d.ts.map +0 -1
- package/dist/billing/modules/plans/utils/planSelector.d.ts.map +0 -1
- package/dist/billing/modules/promotions/index.d.ts.map +0 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.d.ts.map +0 -1
- package/dist/billing/modules/promotions/pages/PromotionsListPage.d.ts.map +0 -1
- package/dist/billing/modules/promotions/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/quota/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/quota/hooks/useQuota.d.ts.map +0 -1
- package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts.map +0 -1
- package/dist/billing/modules/quota/index.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaAssignFreePage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaPage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/quota/utils/quotaSelector.d.ts.map +0 -1
- package/dist/billing/modules/settings/index.d.ts.map +0 -1
- package/dist/billing/modules/settings/pages/SettingsPage.d.ts.map +0 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts.map +0 -1
- package/dist/billing/modules/settings/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/store/graphql/index.d.ts.map +0 -1
- package/dist/billing/modules/store/index.d.ts.map +0 -1
- package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/index.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.d.ts.map +0 -1
- package/dist/billing/modules/usage/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/usage/hooks/useUsage.d.ts.map +0 -1
- package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.d.ts.map +0 -1
- package/dist/billing/modules/usage/index.d.ts.map +0 -1
- package/dist/billing/modules/usage/pages/UsagePage.d.ts.map +0 -1
- package/dist/billing/modules/usage/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/usage/utils/aiSpend.d.ts.map +0 -1
- package/dist/billing/providers/BillingProvider.d.ts.map +0 -1
- package/dist/billing/shared/components/AccessDenied.d.ts.map +0 -1
- package/dist/billing/shared/components/ActorIdentity.d.ts.map +0 -1
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts.map +0 -1
- package/dist/billing/shared/components/EmptyState.d.ts.map +0 -1
- package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts.map +0 -1
- package/dist/billing/shared/components/PageHeader.d.ts.map +0 -1
- package/dist/billing/shared/components/PushPermissionNudge.d.ts.map +0 -1
- package/dist/billing/shared/components/ServerError.d.ts.map +0 -1
- package/dist/billing/shared/components/StatCard.d.ts.map +0 -1
- package/dist/billing/shared/components/index.d.ts.map +0 -1
- package/dist/billing/shared/hooks/index.d.ts.map +0 -1
- package/dist/billing/shared/hooks/useActorProfiles.d.ts.map +0 -1
- package/dist/billing/shared/hooks/useTr.d.ts.map +0 -1
- package/dist/billing/shared/index.d.ts.map +0 -1
- package/dist/billing/shared/types/graphql.d.ts.map +0 -1
- package/dist/billing/shared/types/index.d.ts.map +0 -1
- package/dist/billing/shared/ui/Card.d.ts.map +0 -1
- package/dist/billing/shared/ui/MetricCard.d.ts.map +0 -1
- package/dist/billing/shared/ui/ProgressBar.d.ts.map +0 -1
- package/dist/billing/shared/ui/SectionHeader.d.ts.map +0 -1
- package/dist/billing/shared/ui/StatusPill.d.ts.map +0 -1
- package/dist/billing/shared/ui/index.d.ts.map +0 -1
- package/dist/billing/shared/utils/directActivityGraphql.d.ts.map +0 -1
- package/dist/billing/shared/utils/directBillingGraphql.d.ts.map +0 -1
- package/dist/billing/shared/utils/error.d.ts.map +0 -1
- package/dist/billing/shared/utils/format.d.ts.map +0 -1
- package/dist/billing/shared/utils/gatewayGraphql.d.ts.map +0 -1
- package/dist/billing/shared/utils/index.d.ts.map +0 -1
- package/dist/billing/shared/utils/navigation.d.ts.map +0 -1
- package/dist/billing/shared/utils/paymentTheme.d.ts.map +0 -1
- package/dist/billing/shared/utils/planFeatureQuantity.d.ts.map +0 -1
- package/dist/billing/shared/utils/status.d.ts.map +0 -1
- package/dist/billing/shared/utils/tokens.d.ts.map +0 -1
- package/dist/billing/translations/en.d.ts.map +0 -1
- package/dist/billing/types/index.d.ts.map +0 -1
- package/dist/dev/main.d.ts.map +0 -1
- package/dist/generated/global-operations.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/utils/nativeBridge.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiSpend.js","names":[],"sources":["../../../../../src/billing/modules/usage/utils/aiSpend.ts"],"sourcesContent":["/**\n * Workspace AI spend in US dollars (BOFF-10273).\n *\n * wspace-prompts-svc keeps an AI ledger row for every platform-key AI call, with\n * its cost in USD micro-dollars. `promptUsageBreakdownV2` sums that ledger for the\n * workspace in the request context, and reports money as a decimal string of\n * micro-dollars because integer money does not drift in a rollup and a total can\n * exceed a GraphQL Int. These helpers keep the value as a BigInt until the last\n * step and then render dollars, so the usage page shows what AI cost the\n * workspace rather than only how many credits it used.\n */\n\nexport type AiSpendWindow = 'month' | '30d' | '7d';\n\nexport const AI_SPEND_WINDOWS: ReadonlyArray<{ value: AiSpendWindow; label: string }> = [\n { value: 'month', label: 'This month' },\n { value: '30d', label: 'Last 30 days' },\n { value: '7d', label: 'Last 7 days' },\n];\n\nconst MICRO_PER_USD = 1_000_000n;\nconst DAY_MS = 86_400_000;\n\n/** Parse a micro-dollar decimal string; anything missing or malformed reads as zero. */\nexport function parseMicroUsd(value: string | null | undefined): bigint {\n if (!value || !/^-?\\d+$/.test(value)) return 0n;\n return BigInt(value);\n}\n\n/**\n * Render micro-dollars as USD. Amounts under one cent keep four decimals so a\n * workspace that spent USD 0.0042 does not read as zero, and anything above\n * zero but under USD 0.0001 reads as \"<$0.0001\".\n */\nexport function formatMicroUsd(value: string | bigint | null | undefined): string {\n const micro = typeof value === 'bigint' ? value : parseMicroUsd(value);\n const negative = micro < 0n;\n const abs = negative ? -micro : micro;\n const sign = negative ? '-' : '';\n if (abs > 0n && abs < 100n) return `${negative ? '>-' : '<'}$0.0001`;\n if (abs > 0n && abs < 10_000n) {\n const whole = abs / MICRO_PER_USD;\n const fraction = ((abs % MICRO_PER_USD) / 100n).toString().padStart(4, '0');\n return `${sign}$${whole.toString()}.${fraction}`;\n }\n const cents = (abs + 5_000n) / 10_000n;\n const dollars = cents / 100n;\n const rest = (cents % 100n).toString().padStart(2, '0');\n return `${sign}$${dollars.toLocaleString('en-US')}.${rest}`;\n}\n\n/**\n * The [from, to) range for a window. `to` is the start of the next UTC minute,\n * so renders inside one minute share an Apollo cache key; \"month\" starts at\n * 00:00 UTC on the first of the current UTC month, matching how the AI credit\n * quota resets.\n */\nexport function aiSpendRange(\n window: AiSpendWindow,\n now: Date = new Date()\n): { from: string; to: string } {\n const end = new Date(now.getTime());\n end.setUTCSeconds(0, 0);\n end.setUTCMinutes(end.getUTCMinutes() + 1);\n let start: Date;\n if (window === 'month') {\n start = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1));\n } else {\n const days = window === '7d' ? 7 : 30;\n start = new Date(end.getTime() - days * DAY_MS);\n }\n return { from: start.toISOString(), to: end.toISOString() };\n}\n\n/** The money part of one breakdown row, as the gateway returns it. */\nexport interface AiSpendBreakdownRowInput {\n productKey: string | null;\n attempts: string;\n costMicroUsd: {\n knownSubtotal: string | null;\n knownAttempts: string;\n missingAttempts: string;\n };\n}\n\nexport interface AiSpendProductRow {\n productKey: string;\n attempts: number;\n /** Calls whose ledger row carries no cost (for example bring-your-own-key calls). */\n unpricedAttempts: number;\n costMicroUsd: bigint;\n}\n\nexport interface AiSpendSummary {\n totalMicroUsd: bigint;\n attempts: number;\n unpricedAttempts: number;\n products: AiSpendProductRow[];\n}\n\nfunction toCount(value: string | null | undefined): number {\n if (!value || !/^\\d+$/.test(value)) return 0;\n const parsed = Number(value);\n return Number.isSafeInteger(parsed) ? parsed : Number.MAX_SAFE_INTEGER;\n}\n\n/**\n * Fold a per-product breakdown into the panel's model: the workspace total and\n * one row per product, highest cost first (ties by name so the order is stable).\n */\nexport function summarizeAiSpend(rows: ReadonlyArray<AiSpendBreakdownRowInput>): AiSpendSummary {\n const products: AiSpendProductRow[] = rows.map((row) => ({\n productKey: row.productKey && row.productKey.trim() ? row.productKey : 'unattributed',\n attempts: toCount(row.attempts),\n unpricedAttempts: toCount(row.costMicroUsd.missingAttempts),\n costMicroUsd: parseMicroUsd(row.costMicroUsd.knownSubtotal),\n }));\n products.sort((a, b) => {\n if (a.costMicroUsd !== b.costMicroUsd) return a.costMicroUsd > b.costMicroUsd ? -1 : 1;\n return a.productKey.localeCompare(b.productKey);\n });\n return {\n totalMicroUsd: products.reduce((sum, row) => sum + row.costMicroUsd, 0n),\n attempts: products.reduce((sum, row) => sum + row.attempts, 0),\n unpricedAttempts: products.reduce((sum, row) => sum + row.unpricedAttempts, 0),\n products,\n };\n}\n\n/** A product key as a readable label: \"coolandlovely\" -> \"Coolandlovely\", \"ai_studio\" -> \"Ai Studio\". */\nexport function formatProductKey(productKey: string): string {\n if (productKey === 'unattributed') return 'Unattributed';\n return productKey\n .split(/[-_.]/)\n .filter(Boolean)\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(' ');\n}\n\ninterface ErrorWithGraphQLDetails {\n message?: string;\n errors?: ReadonlyArray<{ message?: string; extensions?: Record<string, unknown> }>;\n graphQLErrors?: ReadonlyArray<{ message?: string; extensions?: Record<string, unknown> }>;\n}\n\n/**\n * True when the gateway refused the query because the caller lacks permission\n * to read the workspace's AI ledger. The panel then stays hidden instead of\n * showing an error to members who were never meant to see spend.\n */\nexport function isAiSpendPermissionError(error: unknown): boolean {\n if (!error || typeof error !== 'object') return false;\n const details = error as ErrorWithGraphQLDetails;\n const entries = [...(details.errors ?? []), ...(details.graphQLErrors ?? [])];\n if (\n entries.some((entry) => {\n const code = entry.extensions?.code;\n return code === 'FORBIDDEN' || code === 'UNAUTHENTICATED';\n })\n ) {\n return true;\n }\n const messages = [details.message ?? '', ...entries.map((entry) => entry.message ?? '')]\n .join(' ')\n .toLowerCase();\n return (\n messages.includes('forbidden') ||\n messages.includes('permission denied') ||\n messages.includes('not authorized') ||\n messages.includes('missing permission')\n );\n}\n"],"mappings":";AAcA,
|
|
1
|
+
{"version":3,"file":"aiSpend.js","names":["AI_SPEND_WINDOWS","MICRO_PER_USD","DAY_MS","parseMicroUsd","value","formatMicroUsd","micro","negative","abs","sign","whole","fraction","cents","dollars","rest","aiSpendRange","end","now","start","window","days","toCount","parsed","summarizeAiSpend","products","rows","row","a","b","sum","formatProductKey","productKey","part","isAiSpendPermissionError","error","details","entries","code","entry","messages"],"sources":["../../../../../src/billing/modules/usage/utils/aiSpend.ts"],"sourcesContent":["/**\n * Workspace AI spend in US dollars (BOFF-10273).\n *\n * wspace-prompts-svc keeps an AI ledger row for every platform-key AI call, with\n * its cost in USD micro-dollars. `promptUsageBreakdownV2` sums that ledger for the\n * workspace in the request context, and reports money as a decimal string of\n * micro-dollars because integer money does not drift in a rollup and a total can\n * exceed a GraphQL Int. These helpers keep the value as a BigInt until the last\n * step and then render dollars, so the usage page shows what AI cost the\n * workspace rather than only how many credits it used.\n */\n\nexport type AiSpendWindow = 'month' | '30d' | '7d';\n\nexport const AI_SPEND_WINDOWS: ReadonlyArray<{ value: AiSpendWindow; label: string }> = [\n { value: 'month', label: 'This month' },\n { value: '30d', label: 'Last 30 days' },\n { value: '7d', label: 'Last 7 days' },\n];\n\nconst MICRO_PER_USD = 1_000_000n;\nconst DAY_MS = 86_400_000;\n\n/** Parse a micro-dollar decimal string; anything missing or malformed reads as zero. */\nexport function parseMicroUsd(value: string | null | undefined): bigint {\n if (!value || !/^-?\\d+$/.test(value)) return 0n;\n return BigInt(value);\n}\n\n/**\n * Render micro-dollars as USD. Amounts under one cent keep four decimals so a\n * workspace that spent USD 0.0042 does not read as zero, and anything above\n * zero but under USD 0.0001 reads as \"<$0.0001\".\n */\nexport function formatMicroUsd(value: string | bigint | null | undefined): string {\n const micro = typeof value === 'bigint' ? value : parseMicroUsd(value);\n const negative = micro < 0n;\n const abs = negative ? -micro : micro;\n const sign = negative ? '-' : '';\n if (abs > 0n && abs < 100n) return `${negative ? '>-' : '<'}$0.0001`;\n if (abs > 0n && abs < 10_000n) {\n const whole = abs / MICRO_PER_USD;\n const fraction = ((abs % MICRO_PER_USD) / 100n).toString().padStart(4, '0');\n return `${sign}$${whole.toString()}.${fraction}`;\n }\n const cents = (abs + 5_000n) / 10_000n;\n const dollars = cents / 100n;\n const rest = (cents % 100n).toString().padStart(2, '0');\n return `${sign}$${dollars.toLocaleString('en-US')}.${rest}`;\n}\n\n/**\n * The [from, to) range for a window. `to` is the start of the next UTC minute,\n * so renders inside one minute share an Apollo cache key; \"month\" starts at\n * 00:00 UTC on the first of the current UTC month, matching how the AI credit\n * quota resets.\n */\nexport function aiSpendRange(\n window: AiSpendWindow,\n now: Date = new Date()\n): { from: string; to: string } {\n const end = new Date(now.getTime());\n end.setUTCSeconds(0, 0);\n end.setUTCMinutes(end.getUTCMinutes() + 1);\n let start: Date;\n if (window === 'month') {\n start = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1));\n } else {\n const days = window === '7d' ? 7 : 30;\n start = new Date(end.getTime() - days * DAY_MS);\n }\n return { from: start.toISOString(), to: end.toISOString() };\n}\n\n/** The money part of one breakdown row, as the gateway returns it. */\nexport interface AiSpendBreakdownRowInput {\n productKey: string | null;\n attempts: string;\n costMicroUsd: {\n knownSubtotal: string | null;\n knownAttempts: string;\n missingAttempts: string;\n };\n}\n\nexport interface AiSpendProductRow {\n productKey: string;\n attempts: number;\n /** Calls whose ledger row carries no cost (for example bring-your-own-key calls). */\n unpricedAttempts: number;\n costMicroUsd: bigint;\n}\n\nexport interface AiSpendSummary {\n totalMicroUsd: bigint;\n attempts: number;\n unpricedAttempts: number;\n products: AiSpendProductRow[];\n}\n\nfunction toCount(value: string | null | undefined): number {\n if (!value || !/^\\d+$/.test(value)) return 0;\n const parsed = Number(value);\n return Number.isSafeInteger(parsed) ? parsed : Number.MAX_SAFE_INTEGER;\n}\n\n/**\n * Fold a per-product breakdown into the panel's model: the workspace total and\n * one row per product, highest cost first (ties by name so the order is stable).\n */\nexport function summarizeAiSpend(rows: ReadonlyArray<AiSpendBreakdownRowInput>): AiSpendSummary {\n const products: AiSpendProductRow[] = rows.map((row) => ({\n productKey: row.productKey && row.productKey.trim() ? row.productKey : 'unattributed',\n attempts: toCount(row.attempts),\n unpricedAttempts: toCount(row.costMicroUsd.missingAttempts),\n costMicroUsd: parseMicroUsd(row.costMicroUsd.knownSubtotal),\n }));\n products.sort((a, b) => {\n if (a.costMicroUsd !== b.costMicroUsd) return a.costMicroUsd > b.costMicroUsd ? -1 : 1;\n return a.productKey.localeCompare(b.productKey);\n });\n return {\n totalMicroUsd: products.reduce((sum, row) => sum + row.costMicroUsd, 0n),\n attempts: products.reduce((sum, row) => sum + row.attempts, 0),\n unpricedAttempts: products.reduce((sum, row) => sum + row.unpricedAttempts, 0),\n products,\n };\n}\n\n/** A product key as a readable label: \"coolandlovely\" -> \"Coolandlovely\", \"ai_studio\" -> \"Ai Studio\". */\nexport function formatProductKey(productKey: string): string {\n if (productKey === 'unattributed') return 'Unattributed';\n return productKey\n .split(/[-_.]/)\n .filter(Boolean)\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(' ');\n}\n\ninterface ErrorWithGraphQLDetails {\n message?: string;\n errors?: ReadonlyArray<{ message?: string; extensions?: Record<string, unknown> }>;\n graphQLErrors?: ReadonlyArray<{ message?: string; extensions?: Record<string, unknown> }>;\n}\n\n/**\n * True when the gateway refused the query because the caller lacks permission\n * to read the workspace's AI ledger. The panel then stays hidden instead of\n * showing an error to members who were never meant to see spend.\n */\nexport function isAiSpendPermissionError(error: unknown): boolean {\n if (!error || typeof error !== 'object') return false;\n const details = error as ErrorWithGraphQLDetails;\n const entries = [...(details.errors ?? []), ...(details.graphQLErrors ?? [])];\n if (\n entries.some((entry) => {\n const code = entry.extensions?.code;\n return code === 'FORBIDDEN' || code === 'UNAUTHENTICATED';\n })\n ) {\n return true;\n }\n const messages = [details.message ?? '', ...entries.map((entry) => entry.message ?? '')]\n .join(' ')\n .toLowerCase();\n return (\n messages.includes('forbidden') ||\n messages.includes('permission denied') ||\n messages.includes('not authorized') ||\n messages.includes('missing permission')\n );\n}\n"],"mappings":";AAcA,IAAaA,IAA2E;CACtF;EAAE,OAAO;EAAS,OAAO;CAAa;CACtC;EAAE,OAAO;EAAO,OAAO;CAAe;CACtC;EAAE,OAAO;EAAM,OAAO;CAAc;AACtC,GAEMC,IAAgB,UAChBC,IAAS;AAGf,SAAgBC,EAAc,GAA0C;CAEtE,OADI,CAACC,KAAS,CAAC,UAAU,KAAKA,CAAK,IAAU,KACtC,OAAOA,CAAK;AACrB;AAOA,SAAgBC,EAAe,GAAmD;CAChF,IAAMC,IAAQ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I,GAAGC,EAAQ,KAAK,MAAUE,EAAM,WAAW,EAAE,CAAC,CAAC,CACrF,KAAK,GAAG,CAAC,CACT,YAAY;CACf,OACEC,EAAS,SAAS,WAAW,KAC7BA,EAAS,SAAS,mBAAmB,KACrCA,EAAS,SAAS,gBAAgB,KAClCA,EAAS,SAAS,oBAAoB;AAE1C"}
|
|
@@ -17,4 +17,3 @@ export declare const useBilling: () => BillingRootProps;
|
|
|
17
17
|
* so we don't create another one. When standalone (no basePath), use MemoryRouter.
|
|
18
18
|
*/
|
|
19
19
|
export declare const BillingProvider: FC<PropsWithChildren<BillingRootProps>>;
|
|
20
|
-
//# sourceMappingURL=BillingProvider.d.ts.map
|
|
@@ -3,7 +3,7 @@ import { createContext as t, useContext as n, useEffect as r } from "react";
|
|
|
3
3
|
import { MemoryRouter as i } from "react-router";
|
|
4
4
|
import { PermissionProvider as a } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
5
5
|
import { jsx as o } from "react/jsx-runtime";
|
|
6
|
-
|
|
6
|
+
// src/billing/providers/BillingProvider.tsx
|
|
7
7
|
var s = "burdenoff:nativeIapTransaction", c = t(null), l = () => {
|
|
8
8
|
let e = n(c);
|
|
9
9
|
if (!e) throw Error("useBilling must be used within BillingProvider");
|
|
@@ -11,7 +11,7 @@ var s = "burdenoff:nativeIapTransaction", c = t(null), l = () => {
|
|
|
11
11
|
}, u = ({ children: t, basePath: n, navigate: l, currentUser: u, workspaceId: d, orgId: f, productId: p, plansDocsUrl: m, apiGatewayUrl: h, authToken: g, stripePublishableKey: _, razorpayKey: v, onSubscriptionCreate: y, onSubscriptionUpdate: b, onPaymentProcess: x, registerNavItems: S, registerFooterItems: C }) => {
|
|
12
12
|
r(() => {
|
|
13
13
|
e((e) => {
|
|
14
|
-
typeof window
|
|
14
|
+
typeof window < "u" && window.dispatchEvent(new CustomEvent(s, { detail: e }));
|
|
15
15
|
});
|
|
16
16
|
}, []);
|
|
17
17
|
let w = {
|
|
@@ -41,7 +41,6 @@ var s = "burdenoff:nativeIapTransaction", c = t(null), l = () => {
|
|
|
41
41
|
});
|
|
42
42
|
return n ? T : /* @__PURE__ */ o(i, { children: T });
|
|
43
43
|
};
|
|
44
|
-
|
|
45
|
-
export { u as BillingProvider, l as useBilling };
|
|
44
|
+
export { u as BillingProvider, s as NATIVE_IAP_TRANSACTION_EVENT, l as useBilling };
|
|
46
45
|
|
|
47
46
|
//# sourceMappingURL=BillingProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BillingProvider.js","names":[],"sources":["../../../src/billing/providers/BillingProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useEffect } from 'react';\nimport { MemoryRouter } from 'react-router';\nimport { PermissionProvider } from '@burdenoff/fe-libs/shared/providers/shell';\nimport type { BillingRootProps } from '../types';\nimport { installNativeIAP, type NativeTransaction } from '../lib/native-purchases';\n\n/** Dispatched when the background StoreKit 2/Play Billing listener observes a\n * transaction (renewal, restore, or an interrupted purchase resumed on launch).\n * Background transactions are reconciled authoritatively server-side via the\n * Apple/Google webhooks; this just lets mounted UI react (e.g. refresh entitlements). */\nexport const NATIVE_IAP_TRANSACTION_EVENT = 'burdenoff:nativeIapTransaction';\n\n/**\n * Context value for Billing microfrontend\n */\ntype BillingContextValue = BillingRootProps;\n\nconst BillingContext = createContext<BillingContextValue | null>(null);\n\n/**\n * Hook to access Billing context\n */\nexport const useBilling = () => {\n const context = useContext(BillingContext);\n if (!context) {\n throw new Error('useBilling must be used within BillingProvider');\n }\n return context;\n};\n\n/**\n * Provider component for Billing microfrontend\n * Sets up routing and context\n *\n * When integrated into a shell (basePath provided), the shell already has a router\n * so we don't create another one. When standalone (no basePath), use MemoryRouter.\n */\nexport const BillingProvider: FC<PropsWithChildren<BillingRootProps>> = ({\n children,\n basePath,\n navigate,\n currentUser,\n workspaceId,\n orgId,\n productId,\n plansDocsUrl,\n apiGatewayUrl,\n authToken,\n stripePublishableKey,\n razorpayKey,\n onSubscriptionCreate,\n onSubscriptionUpdate,\n onPaymentProcess,\n registerNavItems,\n registerFooterItems,\n}) => {\n // Register the native IAP background listener once billing context (and\n // therefore the signed-in user) is known. No-op on web. See `NATIVE_IAP_TRANSACTION_EVENT`.\n useEffect(() => {\n void installNativeIAP((transaction: NativeTransaction) => {\n if (typeof window === 'undefined') return;\n window.dispatchEvent(\n new CustomEvent<NativeTransaction>(NATIVE_IAP_TRANSACTION_EVENT, { detail: transaction })\n );\n });\n }, []);\n\n const contextValue: BillingContextValue = {\n basePath,\n navigate,\n currentUser,\n workspaceId,\n orgId,\n productId,\n plansDocsUrl,\n apiGatewayUrl,\n authToken,\n stripePublishableKey,\n razorpayKey,\n onSubscriptionCreate,\n onSubscriptionUpdate,\n onPaymentProcess,\n registerNavItems,\n registerFooterItems,\n };\n\n const content = (\n <BillingContext.Provider value={contextValue}>\n <PermissionProvider scopeId={orgId} gateway=\"global\">\n {children}\n </PermissionProvider>\n </BillingContext.Provider>\n );\n\n // When integrated into a shell (basePath provided), the shell already has a router\n // so we don't create another one. When standalone (no basePath), use MemoryRouter.\n if (basePath) {\n return content;\n }\n\n // Standalone mode: create MemoryRouter for independent operation\n return <MemoryRouter>{content}</MemoryRouter>;\n};\n"],"mappings":";;;;;;AAWA,
|
|
1
|
+
{"version":3,"file":"BillingProvider.js","names":["NATIVE_IAP_TRANSACTION_EVENT","BillingContext","createContext","useBilling","context","useContext","BillingProvider","transaction","contextValue","content","PermissionProvider","orgId","basePath","MemoryRouter"],"sources":["../../../src/billing/providers/BillingProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useEffect } from 'react';\nimport { MemoryRouter } from 'react-router';\nimport { PermissionProvider } from '@burdenoff/fe-libs/shared/providers/shell';\nimport type { BillingRootProps } from '../types';\nimport { installNativeIAP, type NativeTransaction } from '../lib/native-purchases';\n\n/** Dispatched when the background StoreKit 2/Play Billing listener observes a\n * transaction (renewal, restore, or an interrupted purchase resumed on launch).\n * Background transactions are reconciled authoritatively server-side via the\n * Apple/Google webhooks; this just lets mounted UI react (e.g. refresh entitlements). */\nexport const NATIVE_IAP_TRANSACTION_EVENT = 'burdenoff:nativeIapTransaction';\n\n/**\n * Context value for Billing microfrontend\n */\ntype BillingContextValue = BillingRootProps;\n\nconst BillingContext = createContext<BillingContextValue | null>(null);\n\n/**\n * Hook to access Billing context\n */\nexport const useBilling = () => {\n const context = useContext(BillingContext);\n if (!context) {\n throw new Error('useBilling must be used within BillingProvider');\n }\n return context;\n};\n\n/**\n * Provider component for Billing microfrontend\n * Sets up routing and context\n *\n * When integrated into a shell (basePath provided), the shell already has a router\n * so we don't create another one. When standalone (no basePath), use MemoryRouter.\n */\nexport const BillingProvider: FC<PropsWithChildren<BillingRootProps>> = ({\n children,\n basePath,\n navigate,\n currentUser,\n workspaceId,\n orgId,\n productId,\n plansDocsUrl,\n apiGatewayUrl,\n authToken,\n stripePublishableKey,\n razorpayKey,\n onSubscriptionCreate,\n onSubscriptionUpdate,\n onPaymentProcess,\n registerNavItems,\n registerFooterItems,\n}) => {\n // Register the native IAP background listener once billing context (and\n // therefore the signed-in user) is known. No-op on web. See `NATIVE_IAP_TRANSACTION_EVENT`.\n useEffect(() => {\n void installNativeIAP((transaction: NativeTransaction) => {\n if (typeof window === 'undefined') return;\n window.dispatchEvent(\n new CustomEvent<NativeTransaction>(NATIVE_IAP_TRANSACTION_EVENT, { detail: transaction })\n );\n });\n }, []);\n\n const contextValue: BillingContextValue = {\n basePath,\n navigate,\n currentUser,\n workspaceId,\n orgId,\n productId,\n plansDocsUrl,\n apiGatewayUrl,\n authToken,\n stripePublishableKey,\n razorpayKey,\n onSubscriptionCreate,\n onSubscriptionUpdate,\n onPaymentProcess,\n registerNavItems,\n registerFooterItems,\n };\n\n const content = (\n <BillingContext.Provider value={contextValue}>\n <PermissionProvider scopeId={orgId} gateway=\"global\">\n {children}\n </PermissionProvider>\n </BillingContext.Provider>\n );\n\n // When integrated into a shell (basePath provided), the shell already has a router\n // so we don't create another one. When standalone (no basePath), use MemoryRouter.\n if (basePath) {\n return content;\n }\n\n // Standalone mode: create MemoryRouter for independent operation\n return <MemoryRouter>{content}</MemoryRouter>;\n};\n"],"mappings":";;;;;;AAWA,IAAaA,IAA+B,kCAOtCC,IAAiBC,EAA0C,IAAI,GAKxDC,UAAmB;CAC9B,IAAMC,IAAUC,EAAWJ,CAAc;CACzC,IAAI,CAACG,GACH,MAAU,MAAM,gDAAgD;CAElE,OAAOA;AACT,GASaE,KAA4D,EACvE,aACA,aACA,aACA,gBACA,gBACA,UACA,cACA,iBACA,kBACA,cACA,yBACA,gBACA,yBACA,yBACA,qBACA,qBACA,6BACI;CAGJ,QAAgB;EACd,GAAuB,MAAmC;GACxD,AAAI,OAAO,SAAW,OACtB,OAAO,cACL,IAAI,YAA+BN,GAA8B,EAAE,QAAQO,EAAY,CAAC,CAC1F;EACF,CAAC;CACH,GAAG,CAAC,CAAC;CAEL,IAAMC,IAAoC;EACxC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,GAEMC,IACJ,kBAACR,EAAe,UAAhB;EAAyB,OAAOO;EAC9B,UAAA,kBAACE,GAAD;GAAoB,SAASC;GAAO,SAAQ;GACzC;EACiB,CAAA;CACG,CAAA;CAU3B,OALIC,IACKH,IAIF,kBAACI,GAAD,EAAA,UAAeJ,EAAsB,CAAA;AAC9C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTr as e } from "../hooks/useTr.js";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/billing/shared/components/AccessDenied.tsx
|
|
4
4
|
var r = ({ message: r }) => {
|
|
5
5
|
let i = e(), a = r ?? i("billing.accessDenied.defaultMessage", "You don't have permission to access this page.");
|
|
6
6
|
return /* @__PURE__ */ t("div", {
|
|
@@ -35,7 +35,6 @@ var r = ({ message: r }) => {
|
|
|
35
35
|
})
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
|
-
//#endregion
|
|
39
38
|
export { r as AccessDenied };
|
|
40
39
|
|
|
41
40
|
//# sourceMappingURL=AccessDenied.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessDenied.js","names":[],"sources":["../../../../src/billing/shared/components/AccessDenied.tsx"],"sourcesContent":["/**\n * Shared Access Denied Component\n * Displays when user lacks permission to view a page\n */\n\nimport type { FC } from 'react';\nimport { useTr } from '../hooks/useTr';\n\ninterface AccessDeniedProps {\n message?: string;\n}\n\nexport const AccessDenied: FC<AccessDeniedProps> = ({ message }) => {\n const tr = useTr();\n\n const displayMessage =\n message ??\n tr('billing.accessDenied.defaultMessage', \"You don't have permission to access this page.\");\n\n return (\n <div className=\"flex items-center justify-center h-full min-h-[400px]\">\n <div className=\"text-center space-y-2\">\n <div className=\"size-12 mx-auto rounded-full bg-bg-sunken flex items-center justify-center\">\n <svg\n className=\"size-6 text-text-secondary\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z\"\n />\n </svg>\n </div>\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('billing.accessDenied.title', 'Access Denied')}\n </h2>\n <p className=\"text-sm text-text-secondary max-w-sm\">{displayMessage}</p>\n </div>\n </div>\n );\n};\n"],"mappings":";;;AAYA,
|
|
1
|
+
{"version":3,"file":"AccessDenied.js","names":["AccessDenied","tr","useTr","displayMessage","message"],"sources":["../../../../src/billing/shared/components/AccessDenied.tsx"],"sourcesContent":["/**\n * Shared Access Denied Component\n * Displays when user lacks permission to view a page\n */\n\nimport type { FC } from 'react';\nimport { useTr } from '../hooks/useTr';\n\ninterface AccessDeniedProps {\n message?: string;\n}\n\nexport const AccessDenied: FC<AccessDeniedProps> = ({ message }) => {\n const tr = useTr();\n\n const displayMessage =\n message ??\n tr('billing.accessDenied.defaultMessage', \"You don't have permission to access this page.\");\n\n return (\n <div className=\"flex items-center justify-center h-full min-h-[400px]\">\n <div className=\"text-center space-y-2\">\n <div className=\"size-12 mx-auto rounded-full bg-bg-sunken flex items-center justify-center\">\n <svg\n className=\"size-6 text-text-secondary\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z\"\n />\n </svg>\n </div>\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {tr('billing.accessDenied.title', 'Access Denied')}\n </h2>\n <p className=\"text-sm text-text-secondary max-w-sm\">{displayMessage}</p>\n </div>\n </div>\n );\n};\n"],"mappings":";;;AAYA,IAAaA,KAAuC,EAAE,iBAAc;CAClE,IAAMC,IAAKC,EAAM,GAEXC,IACJC,KACAH,EAAG,uCAAuC,gDAAgD;CAE5F,OACE,kBAAC,OAAD;EAAK,WAAU;EACb,UAAA,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACE,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA,kBAAC,OAAD;MACE,WAAU;MACV,MAAK;MACL,SAAQ;MACR,QAAO;MAEP,UAAA,kBAAC,QAAD;OACE,eAAc;OACd,gBAAe;OACf,aAAa;OACb,GAAE;MACH,CAAA;KACE,CAAA;IACF,CAAA;IACL,kBAAC,MAAD;KAAI,WAAU;KACX,UAAAA,EAAG,8BAA8B,eAAe;IAC/C,CAAA;IACJ,kBAAC,KAAD;KAAG,WAAU;KAAwC,UAAAE;IAAkB,CAAA;GACpE;;CACF,CAAA;AAET"}
|
|
@@ -2,7 +2,7 @@ import { useTr as e } from "../hooks/useTr.js";
|
|
|
2
2
|
import { useState as t } from "react";
|
|
3
3
|
import { Check as n, Copy as r, User2 as i } from "lucide-react";
|
|
4
4
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/billing/shared/components/ActorIdentity.tsx
|
|
6
6
|
function s(e) {
|
|
7
7
|
let t = e.trim();
|
|
8
8
|
if (!t) return "?";
|
|
@@ -11,7 +11,7 @@ function s(e) {
|
|
|
11
11
|
}
|
|
12
12
|
var c = ({ profile: c, variant: l = "cell" }) => {
|
|
13
13
|
let u = e(), [d, f] = t(!1), p = () => {
|
|
14
|
-
typeof navigator
|
|
14
|
+
typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(c.actorId).then(() => {
|
|
15
15
|
f(!0), setTimeout(() => f(!1), 1500);
|
|
16
16
|
});
|
|
17
17
|
}, m = l === "chip", h = l === "inline";
|
|
@@ -62,7 +62,6 @@ var c = ({ profile: c, variant: l = "cell" }) => {
|
|
|
62
62
|
]
|
|
63
63
|
});
|
|
64
64
|
};
|
|
65
|
-
//#endregion
|
|
66
65
|
export { c as ActorIdentity };
|
|
67
66
|
|
|
68
67
|
//# sourceMappingURL=ActorIdentity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActorIdentity.js","names":[],"sources":["../../../../src/billing/shared/components/ActorIdentity.tsx"],"sourcesContent":["import { useState, type FC } from 'react';\nimport { Check, Copy, User2 } from 'lucide-react';\nimport { useTr } from '../hooks/useTr';\nimport type { ActorProfile } from '../hooks/useActorProfiles';\n\ninterface ActorIdentityProps {\n profile: ActorProfile;\n variant?: 'cell' | 'inline' | 'chip';\n}\n\nfunction initials(displayName: string): string {\n const cleaned = displayName.trim();\n if (!cleaned) return '?';\n const parts = cleaned.split(/\\s+/).filter(Boolean);\n if (parts.length === 1) return parts[0].charAt(0).toUpperCase();\n return (parts[0].charAt(0) + parts[parts.length - 1].charAt(0)).toUpperCase();\n}\n\nexport const ActorIdentity: FC<ActorIdentityProps> = ({ profile, variant = 'cell' }) => {\n const tr = useTr();\n const [copied, setCopied] = useState(false);\n\n const onCopy = () => {\n if (typeof navigator === 'undefined' || !navigator.clipboard) return;\n void navigator.clipboard.writeText(profile.actorId).then(() => {\n setCopied(true);\n setTimeout(() => setCopied(false), 1500);\n });\n };\n\n const isChip = variant === 'chip';\n const isInline = variant === 'inline';\n\n return (\n <div\n className={\n isChip\n ? 'inline-flex items-center gap-2 rounded-full border border-border-subtle bg-bg-sunken/40 px-2 py-1'\n : isInline\n ? 'inline-flex items-center gap-2'\n : 'flex items-center gap-3'\n }\n >\n <div\n className={\n isChip\n ? 'flex size-6 items-center justify-center rounded-full bg-action-primary-bg/10 text-[10px] font-semibold text-primary'\n : 'flex size-9 items-center justify-center rounded-full bg-action-primary-bg/10 text-xs font-semibold text-primary'\n }\n aria-hidden=\"true\"\n >\n {profile.avatarUrl ? (\n <img src={profile.avatarUrl} alt=\"\" className=\"size-full rounded-full object-cover\" />\n ) : profile.resolved ? (\n initials(profile.displayName)\n ) : (\n <User2 className=\"size-4\" aria-hidden=\"true\" />\n )}\n </div>\n <div className=\"min-w-0 flex-1\">\n <p\n className={\n isChip\n ? 'text-xs font-medium text-text-primary'\n : 'truncate text-sm font-medium text-text-primary'\n }\n >\n {profile.displayName}\n </p>\n {!isChip ? (\n <p className=\"truncate text-xs text-text-secondary\">\n {profile.email ?? profile.secondaryLabel}\n </p>\n ) : null}\n </div>\n {!isChip && !isInline ? (\n <details className=\"group\">\n <summary className=\"cursor-pointer text-[10px] uppercase tracking-wider text-text-secondary hover:text-text-primary\">\n {tr('billing.common.id', 'ID')}\n </summary>\n <div className=\"mt-1 flex items-center gap-2 rounded-md border border-border-subtle bg-bg-surface px-2 py-1\">\n <span className=\"font-mono text-[11px] text-text-secondary\">{profile.actorId}</span>\n <button\n type=\"button\"\n onClick={onCopy}\n className=\"text-text-secondary transition hover:text-text-primary\"\n aria-label={tr('billing.common.copyActorId', 'Copy actor ID')}\n >\n {copied ? <Check className=\"size-3.5\" /> : <Copy className=\"size-3.5\" />}\n </button>\n </div>\n </details>\n ) : null}\n </div>\n );\n};\n"],"mappings":";;;;;AAUA,
|
|
1
|
+
{"version":3,"file":"ActorIdentity.js","names":["initials","cleaned","displayName","parts","ActorIdentity","tr","useTr","copied","setCopied","useState","onCopy","profile","isChip","variant","isInline","User2","jsx","Check","Copy"],"sources":["../../../../src/billing/shared/components/ActorIdentity.tsx"],"sourcesContent":["import { useState, type FC } from 'react';\nimport { Check, Copy, User2 } from 'lucide-react';\nimport { useTr } from '../hooks/useTr';\nimport type { ActorProfile } from '../hooks/useActorProfiles';\n\ninterface ActorIdentityProps {\n profile: ActorProfile;\n variant?: 'cell' | 'inline' | 'chip';\n}\n\nfunction initials(displayName: string): string {\n const cleaned = displayName.trim();\n if (!cleaned) return '?';\n const parts = cleaned.split(/\\s+/).filter(Boolean);\n if (parts.length === 1) return parts[0].charAt(0).toUpperCase();\n return (parts[0].charAt(0) + parts[parts.length - 1].charAt(0)).toUpperCase();\n}\n\nexport const ActorIdentity: FC<ActorIdentityProps> = ({ profile, variant = 'cell' }) => {\n const tr = useTr();\n const [copied, setCopied] = useState(false);\n\n const onCopy = () => {\n if (typeof navigator === 'undefined' || !navigator.clipboard) return;\n void navigator.clipboard.writeText(profile.actorId).then(() => {\n setCopied(true);\n setTimeout(() => setCopied(false), 1500);\n });\n };\n\n const isChip = variant === 'chip';\n const isInline = variant === 'inline';\n\n return (\n <div\n className={\n isChip\n ? 'inline-flex items-center gap-2 rounded-full border border-border-subtle bg-bg-sunken/40 px-2 py-1'\n : isInline\n ? 'inline-flex items-center gap-2'\n : 'flex items-center gap-3'\n }\n >\n <div\n className={\n isChip\n ? 'flex size-6 items-center justify-center rounded-full bg-action-primary-bg/10 text-[10px] font-semibold text-primary'\n : 'flex size-9 items-center justify-center rounded-full bg-action-primary-bg/10 text-xs font-semibold text-primary'\n }\n aria-hidden=\"true\"\n >\n {profile.avatarUrl ? (\n <img src={profile.avatarUrl} alt=\"\" className=\"size-full rounded-full object-cover\" />\n ) : profile.resolved ? (\n initials(profile.displayName)\n ) : (\n <User2 className=\"size-4\" aria-hidden=\"true\" />\n )}\n </div>\n <div className=\"min-w-0 flex-1\">\n <p\n className={\n isChip\n ? 'text-xs font-medium text-text-primary'\n : 'truncate text-sm font-medium text-text-primary'\n }\n >\n {profile.displayName}\n </p>\n {!isChip ? (\n <p className=\"truncate text-xs text-text-secondary\">\n {profile.email ?? profile.secondaryLabel}\n </p>\n ) : null}\n </div>\n {!isChip && !isInline ? (\n <details className=\"group\">\n <summary className=\"cursor-pointer text-[10px] uppercase tracking-wider text-text-secondary hover:text-text-primary\">\n {tr('billing.common.id', 'ID')}\n </summary>\n <div className=\"mt-1 flex items-center gap-2 rounded-md border border-border-subtle bg-bg-surface px-2 py-1\">\n <span className=\"font-mono text-[11px] text-text-secondary\">{profile.actorId}</span>\n <button\n type=\"button\"\n onClick={onCopy}\n className=\"text-text-secondary transition hover:text-text-primary\"\n aria-label={tr('billing.common.copyActorId', 'Copy actor ID')}\n >\n {copied ? <Check className=\"size-3.5\" /> : <Copy className=\"size-3.5\" />}\n </button>\n </div>\n </details>\n ) : null}\n </div>\n );\n};\n"],"mappings":";;;;;AAUA,SAASA,EAAS,GAA6B;CAC7C,IAAMC,IAAUC,EAAY,KAAK;CACjC,IAAI,CAACD,GAAS,OAAO;CACrB,IAAME,IAAQF,EAAQ,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO;CAEjD,OADIE,EAAM,WAAW,IAAUA,EAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,KACtDA,EAAM,EAAE,CAAC,OAAO,CAAC,IAAIA,EAAMA,EAAM,SAAS,EAAE,CAAC,OAAO,CAAC,EAAA,CAAG,YAAY;AAC9E;AAEA,IAAaC,KAAyC,EAAE,YAAS,aAAU,aAAa;CACtF,IAAMC,IAAKC,EAAM,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AA;GACP,CAAA,IAAA;EACD;;AAET"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState as e } from "react";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/billing/shared/components/CurrencyPriceOverridesEditor.tsx
|
|
4
4
|
var r = [
|
|
5
5
|
{
|
|
6
6
|
code: "EUR",
|
|
@@ -228,7 +228,6 @@ var r = [
|
|
|
228
228
|
})]
|
|
229
229
|
});
|
|
230
230
|
};
|
|
231
|
-
//#endregion
|
|
232
231
|
export { i as CurrencyPriceOverridesEditor };
|
|
233
232
|
|
|
234
233
|
//# sourceMappingURL=CurrencyPriceOverridesEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrencyPriceOverridesEditor.js","names":[],"sources":["../../../../src/billing/shared/components/CurrencyPriceOverridesEditor.tsx"],"sourcesContent":["import { useState, type FC } from 'react';\n\nimport type { CurrencyPriceOverrideInput } from '../types';\n\ninterface CurrencyPriceOverridesEditorProps {\n overrides: CurrencyPriceOverrideInput[];\n onChange: (overrides: CurrencyPriceOverrideInput[]) => void;\n showPerSeatAmount?: boolean;\n}\n\nconst PRICING_CURRENCIES: { code: string; name: string; symbol: string }[] = [\n { code: 'EUR', name: 'Euro', symbol: '€' },\n { code: 'GBP', name: 'British Pound', symbol: '£' },\n { code: 'INR', name: 'Indian Rupee', symbol: '₹' },\n { code: 'AUD', name: 'Australian Dollar', symbol: 'A$' },\n { code: 'CAD', name: 'Canadian Dollar', symbol: 'C$' },\n { code: 'SGD', name: 'Singapore Dollar', symbol: 'S$' },\n { code: 'JPY', name: 'Japanese Yen', symbol: '¥' },\n { code: 'MXN', name: 'Mexican Peso', symbol: 'MX$' },\n { code: 'BRL', name: 'Brazilian Real', symbol: 'R$' },\n { code: 'CHF', name: 'Swiss Franc', symbol: 'Fr' },\n { code: 'CNY', name: 'Chinese Yuan', symbol: '¥' },\n { code: 'HKD', name: 'Hong Kong Dollar', symbol: 'HK$' },\n { code: 'NZD', name: 'New Zealand Dollar', symbol: 'NZ$' },\n { code: 'SEK', name: 'Swedish Krona', symbol: 'kr' },\n { code: 'KRW', name: 'South Korean Won', symbol: '₩' },\n { code: 'NOK', name: 'Norwegian Krone', symbol: 'kr' },\n { code: 'DKK', name: 'Danish Krone', symbol: 'kr' },\n { code: 'PLN', name: 'Polish Złoty', symbol: 'zł' },\n { code: 'THB', name: 'Thai Baht', symbol: '฿' },\n { code: 'MYR', name: 'Malaysian Ringgit', symbol: 'RM' },\n];\n\nexport const CurrencyPriceOverridesEditor: FC<CurrencyPriceOverridesEditorProps> = ({\n overrides,\n onChange,\n showPerSeatAmount = false,\n}) => {\n const [isExpanded, setIsExpanded] = useState(false);\n\n const getOverride = (currency: string): CurrencyPriceOverrideInput | undefined =>\n overrides.find((o) => o.currency === currency);\n\n const handleAmountChange = (currency: string, value: string) => {\n const trimmed = value.trim();\n const existing = overrides.filter((o) => o.currency !== currency);\n\n if (trimmed === '') {\n onChange(existing);\n return;\n }\n\n const amount = parseFloat(trimmed);\n if (isNaN(amount) || amount < 0) return;\n\n const currentOverride = getOverride(currency);\n onChange([\n ...existing,\n {\n currency,\n amount,\n ...(currentOverride?.perSeatAmount !== undefined\n ? { perSeatAmount: currentOverride.perSeatAmount }\n : {}),\n },\n ]);\n };\n\n const handlePerSeatChange = (currency: string, value: string) => {\n const trimmed = value.trim();\n const existing = overrides.filter((o) => o.currency !== currency);\n const currentOverride = getOverride(currency);\n\n if (!currentOverride) return;\n\n if (trimmed === '') {\n onChange([...existing, { currency, amount: currentOverride.amount }]);\n return;\n }\n\n const perSeatAmount = parseFloat(trimmed);\n if (isNaN(perSeatAmount) || perSeatAmount < 0) return;\n\n onChange([...existing, { ...currentOverride, perSeatAmount }]);\n };\n\n const overrideCount = overrides.length;\n\n return (\n <div className=\"border border-border-subtle rounded-lg bg-bg-surface overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => setIsExpanded((v) => !v)}\n className=\"w-full p-4 border-b border-border-subtle bg-bg-sunken/30 flex items-center justify-between hover:bg-bg-sunken/50 transition-colors\"\n >\n <div className=\"flex items-center gap-2\">\n <h2 className=\"font-semibold text-text-primary\">Currency Price Overrides</h2>\n {overrideCount > 0 && (\n <span className=\"px-2 py-0.5 text-xs font-medium bg-action-primary-bg/10 text-primary rounded-full\">\n {overrideCount} set\n </span>\n )}\n </div>\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <span>\n {isExpanded ? 'Hide' : 'Show'} (leave blank to use auto-calculated exchange rates)\n </span>\n <svg\n className={`w-4 h-4 transition-transform ${isExpanded ? 'rotate-180' : ''}`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M19 9l-7 7-7-7\" />\n </svg>\n </div>\n </button>\n\n {isExpanded && (\n <div className=\"p-4\">\n <p className=\"text-xs text-text-secondary mb-4\">\n Set a specific price for any currency. Leave a field empty to auto-calculate from the\n USD base price using live exchange rates.\n </p>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3\">\n {PRICING_CURRENCIES.map(({ code, name, symbol }) => {\n const override = getOverride(code);\n return (\n <div key={code} className=\"space-y-1\">\n <label className=\"flex items-center gap-1 text-xs font-medium text-text-primary\">\n <span className=\"text-text-secondary\">{symbol}</span>\n <span>{code}</span>\n <span className=\"text-text-secondary font-normal truncate\">({name})</span>\n </label>\n <div className={showPerSeatAmount ? 'flex gap-1' : ''}>\n <input\n type=\"number\"\n step=\"0.01\"\n min=\"0\"\n value={override?.amount ?? ''}\n onChange={(e) => handleAmountChange(code, e.target.value)}\n placeholder=\"auto\"\n className={`px-2 py-1.5 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary focus:outline-none focus:ring-1 focus:ring-primary placeholder:text-text-secondary ${\n showPerSeatAmount ? 'flex-1 min-w-0' : 'w-full'\n } ${override?.amount !== undefined ? 'border-primary/50' : ''}`}\n />\n {showPerSeatAmount && (\n <input\n type=\"number\"\n step=\"0.01\"\n min=\"0\"\n value={override?.perSeatAmount ?? ''}\n onChange={(e) => handlePerSeatChange(code, e.target.value)}\n placeholder=\"/seat\"\n disabled={!override}\n title=\"Per-seat amount (requires flat amount to be set first)\"\n className=\"flex-1 min-w-0 px-2 py-1.5 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary focus:outline-none focus:ring-1 focus:ring-primary placeholder:text-text-secondary disabled:opacity-40\"\n />\n )}\n </div>\n </div>\n );\n })}\n </div>\n {overrideCount > 0 && (\n <button\n type=\"button\"\n onClick={() => onChange([])}\n className=\"mt-4 text-xs text-status-error-text hover:underline\"\n >\n Clear all overrides\n </button>\n )}\n </div>\n )}\n </div>\n );\n};\n"],"mappings":";;;AAUA,IAAM,IAAuE;CAC3E;EAAE,MAAM;EAAO,MAAM;EAAQ,QAAQ;CAAI;CACzC;EAAE,MAAM;EAAO,MAAM;EAAiB,QAAQ;CAAI;CAClD;EAAE,MAAM;EAAO,MAAM;EAAgB,QAAQ;CAAI;CACjD;EAAE,MAAM;EAAO,MAAM;EAAqB,QAAQ;CAAK;CACvD;EAAE,MAAM;EAAO,MAAM;EAAmB,QAAQ;CAAK;CACrD;EAAE,MAAM;EAAO,MAAM;EAAoB,QAAQ;CAAK;CACtD;EAAE,MAAM;EAAO,MAAM;EAAgB,QAAQ;CAAI;CACjD;EAAE,MAAM;EAAO,MAAM;EAAgB,QAAQ;CAAM;CACnD;EAAE,MAAM;EAAO,MAAM;EAAkB,QAAQ;CAAK;CACpD;EAAE,MAAM;EAAO,MAAM;EAAe,QAAQ;CAAK;CACjD;EAAE,MAAM;EAAO,MAAM;EAAgB,QAAQ;CAAI;CACjD;EAAE,MAAM;EAAO,MAAM;EAAoB,QAAQ;CAAM;CACvD;EAAE,MAAM;EAAO,MAAM;EAAsB,QAAQ;CAAM;CACzD;EAAE,MAAM;EAAO,MAA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GAAU,UAAU;SAC3B,WAAW,MAAM,EAAmB,GAAM,EAAE,OAAO,KAAK;SACxD,aAAY;SACZ,WAAW,iLACT,IAAoB,mBAAmB,SACxC,GAAG,GAAU,WAAW,KAAA,IAAkC,KAAtB;QACtC,CAAA,GACA,KACC,kBAAC,SAAD;SACE,MAAK;SACL,MAAK;SACL,KAAI;SACJ,OAAO,GAAU,iBAAiB;SAClC,WAAW,MAAM,EAAoB,GAAM,EAAE,OAAO,KAAK;SACzD,aAAY;SACZ,UAAU,CAAC;SACX,OAAM;SACN,WAAU;QACX,CAAA,CAEA;SACF;SAhCK,CAgCL;KAET,CAAC;IACE,CAAA;IACJ,IAAgB,KACf,kBAAC,UAAD;KACE,MAAK;KACL,eAAe,EAAS,CAAC,CAAC;KAC1B,WAAU;eACX;IAEO,CAAA;GAEP;IAEJ;;AAET"}
|
|
1
|
+
{"version":3,"file":"CurrencyPriceOverridesEditor.js","names":["PRICING_CURRENCIES","CurrencyPriceOverridesEditor","isExpanded","setIsExpanded","useState","getOverride","overrides","o","currency","handleAmountChange","trimmed","value","existing","amount","currentOverride","handlePerSeatChange","perSeatAmount","onChange","overrideCount","v","override","code","symbol","name","showPerSeatAmount","e"],"sources":["../../../../src/billing/shared/components/CurrencyPriceOverridesEditor.tsx"],"sourcesContent":["import { useState, type FC } from 'react';\n\nimport type { CurrencyPriceOverrideInput } from '../types';\n\ninterface CurrencyPriceOverridesEditorProps {\n overrides: CurrencyPriceOverrideInput[];\n onChange: (overrides: CurrencyPriceOverrideInput[]) => void;\n showPerSeatAmount?: boolean;\n}\n\nconst PRICING_CURRENCIES: { code: string; name: string; symbol: string }[] = [\n { code: 'EUR', name: 'Euro', symbol: '€' },\n { code: 'GBP', name: 'British Pound', symbol: '£' },\n { code: 'INR', name: 'Indian Rupee', symbol: '₹' },\n { code: 'AUD', name: 'Australian Dollar', symbol: 'A$' },\n { code: 'CAD', name: 'Canadian Dollar', symbol: 'C$' },\n { code: 'SGD', name: 'Singapore Dollar', symbol: 'S$' },\n { code: 'JPY', name: 'Japanese Yen', symbol: '¥' },\n { code: 'MXN', name: 'Mexican Peso', symbol: 'MX$' },\n { code: 'BRL', name: 'Brazilian Real', symbol: 'R$' },\n { code: 'CHF', name: 'Swiss Franc', symbol: 'Fr' },\n { code: 'CNY', name: 'Chinese Yuan', symbol: '¥' },\n { code: 'HKD', name: 'Hong Kong Dollar', symbol: 'HK$' },\n { code: 'NZD', name: 'New Zealand Dollar', symbol: 'NZ$' },\n { code: 'SEK', name: 'Swedish Krona', symbol: 'kr' },\n { code: 'KRW', name: 'South Korean Won', symbol: '₩' },\n { code: 'NOK', name: 'Norwegian Krone', symbol: 'kr' },\n { code: 'DKK', name: 'Danish Krone', symbol: 'kr' },\n { code: 'PLN', name: 'Polish Złoty', symbol: 'zł' },\n { code: 'THB', name: 'Thai Baht', symbol: '฿' },\n { code: 'MYR', name: 'Malaysian Ringgit', symbol: 'RM' },\n];\n\nexport const CurrencyPriceOverridesEditor: FC<CurrencyPriceOverridesEditorProps> = ({\n overrides,\n onChange,\n showPerSeatAmount = false,\n}) => {\n const [isExpanded, setIsExpanded] = useState(false);\n\n const getOverride = (currency: string): CurrencyPriceOverrideInput | undefined =>\n overrides.find((o) => o.currency === currency);\n\n const handleAmountChange = (currency: string, value: string) => {\n const trimmed = value.trim();\n const existing = overrides.filter((o) => o.currency !== currency);\n\n if (trimmed === '') {\n onChange(existing);\n return;\n }\n\n const amount = parseFloat(trimmed);\n if (isNaN(amount) || amount < 0) return;\n\n const currentOverride = getOverride(currency);\n onChange([\n ...existing,\n {\n currency,\n amount,\n ...(currentOverride?.perSeatAmount !== undefined\n ? { perSeatAmount: currentOverride.perSeatAmount }\n : {}),\n },\n ]);\n };\n\n const handlePerSeatChange = (currency: string, value: string) => {\n const trimmed = value.trim();\n const existing = overrides.filter((o) => o.currency !== currency);\n const currentOverride = getOverride(currency);\n\n if (!currentOverride) return;\n\n if (trimmed === '') {\n onChange([...existing, { currency, amount: currentOverride.amount }]);\n return;\n }\n\n const perSeatAmount = parseFloat(trimmed);\n if (isNaN(perSeatAmount) || perSeatAmount < 0) return;\n\n onChange([...existing, { ...currentOverride, perSeatAmount }]);\n };\n\n const overrideCount = overrides.length;\n\n return (\n <div className=\"border border-border-subtle rounded-lg bg-bg-surface overflow-hidden\">\n <button\n type=\"button\"\n onClick={() => setIsExpanded((v) => !v)}\n className=\"w-full p-4 border-b border-border-subtle bg-bg-sunken/30 flex items-center justify-between hover:bg-bg-sunken/50 transition-colors\"\n >\n <div className=\"flex items-center gap-2\">\n <h2 className=\"font-semibold text-text-primary\">Currency Price Overrides</h2>\n {overrideCount > 0 && (\n <span className=\"px-2 py-0.5 text-xs font-medium bg-action-primary-bg/10 text-primary rounded-full\">\n {overrideCount} set\n </span>\n )}\n </div>\n <div className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <span>\n {isExpanded ? 'Hide' : 'Show'} (leave blank to use auto-calculated exchange rates)\n </span>\n <svg\n className={`w-4 h-4 transition-transform ${isExpanded ? 'rotate-180' : ''}`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M19 9l-7 7-7-7\" />\n </svg>\n </div>\n </button>\n\n {isExpanded && (\n <div className=\"p-4\">\n <p className=\"text-xs text-text-secondary mb-4\">\n Set a specific price for any currency. Leave a field empty to auto-calculate from the\n USD base price using live exchange rates.\n </p>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3\">\n {PRICING_CURRENCIES.map(({ code, name, symbol }) => {\n const override = getOverride(code);\n return (\n <div key={code} className=\"space-y-1\">\n <label className=\"flex items-center gap-1 text-xs font-medium text-text-primary\">\n <span className=\"text-text-secondary\">{symbol}</span>\n <span>{code}</span>\n <span className=\"text-text-secondary font-normal truncate\">({name})</span>\n </label>\n <div className={showPerSeatAmount ? 'flex gap-1' : ''}>\n <input\n type=\"number\"\n step=\"0.01\"\n min=\"0\"\n value={override?.amount ?? ''}\n onChange={(e) => handleAmountChange(code, e.target.value)}\n placeholder=\"auto\"\n className={`px-2 py-1.5 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary focus:outline-none focus:ring-1 focus:ring-primary placeholder:text-text-secondary ${\n showPerSeatAmount ? 'flex-1 min-w-0' : 'w-full'\n } ${override?.amount !== undefined ? 'border-primary/50' : ''}`}\n />\n {showPerSeatAmount && (\n <input\n type=\"number\"\n step=\"0.01\"\n min=\"0\"\n value={override?.perSeatAmount ?? ''}\n onChange={(e) => handlePerSeatChange(code, e.target.value)}\n placeholder=\"/seat\"\n disabled={!override}\n title=\"Per-seat amount (requires flat amount to be set first)\"\n className=\"flex-1 min-w-0 px-2 py-1.5 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary focus:outline-none focus:ring-1 focus:ring-primary placeholder:text-text-secondary disabled:opacity-40\"\n />\n )}\n </div>\n </div>\n );\n })}\n </div>\n {overrideCount > 0 && (\n <button\n type=\"button\"\n onClick={() => onChange([])}\n className=\"mt-4 text-xs text-status-error-text hover:underline\"\n >\n Clear all overrides\n </button>\n )}\n </div>\n )}\n </div>\n );\n};\n"],"mappings":";;;AAUA,IAAMA,IAAuE;CAC3E;EAAE,MAAM;EAAO,MAAM;EAAQ,QAAQ;CAAI;CACzC;EAAE,MAAM;EAAO,MAAM;EAAiB,QAAQ;CAAI;CAClD;EAAE,MAAM;EAAO,MAAM;EAAgB,QAAQ;CAAI;CACjD;EAAE,MAAM;EAAO,MAAM;EAAqB,QAAQ;CAAK;CACvD;EAAE,MAAM;EAAO,MAAM;EAAmB,QAAQ;CAAK;CACrD;EAAE,MAAM;EAAO,MAAM;EAAoB,QAAQ;CAAK;CACtD;EAAE,MAAM;EAAO,MAAM;EAAgB,QAAQ;CAAI;CACjD;EAAE,MAAM;EAAO,MAAM;EAAgB,QAAQ;CAAM;CACnD;EAAE,MAAM;EAAO,MAAM;EAAkB,QAAQ;CA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AAM,SAAM,gBAAa;MAClD,IAAMoB,IAAWf,EAAYgB,CAAI;MACjC,OACE,kBAAC,OAAD;OAAgB,WAAU;OAA1B,UAAA,CACE,kBAAC,SAAD;QAAO,WAAU;QAAjB,UAAA;SACE,kBAAC,QAAD;UAAM,WAAU;UAAuB,UAAAC;SAAa,CAAA;SACpD,kBAAC,QAAD,EAAA,UAAOD,EAAW,CAAA;SAClB,kBAAC,QAAD;UAAM,WAAU;UAAhB,UAAA;WAA2D;WAAEE;WAAK;UAAO;;QACpE;OACP,CAAA,GAAA,kBAAC,OAAD;QAAK,WAAWC,IAAoB,eAAe;QAAnD,UAAA,CACE,kBAAC,SAAD;SACE,MAAK;SACL,MAAK;SACL,KAAI;SACJ,OAAOJ,GAAU,UAAU;SAC3B,WAAW,MAAMX,EAAmBY,GAAMI,EAAE,OAAO,KAAK;SACxD,aAAY;SACZ,WAAW,iLACTD,IAAoB,mBAAmB,SACxC,GAAGJ,GAAU,WAAW,KAAA,IAAkC,KAAtB;QACtC,CAAA,GACAI,KACC,kBAAC,SAAD;SACE,MAAK;SACL,MAAK;SACL,KAAI;SACJ,OAAOJ,GAAU,iBAAiB;SAClC,WAAW,MAAML,EAAoBM,GAAMI,EAAE,OAAO,KAAK;SACzD,aAAY;SACZ,UAAU,CAACL;SACX,OAAM;SACN,WAAU;QACX,CAAA,CAEA;OACF,CAAA,CAAA;MAhCK,GAAAC,CAgCL;KAET,CAAC;IACE,CAAA;IACJH,IAAgB,KACf,kBAAC,UAAD;KACE,MAAK;KACL,eAAeD,EAAS,CAAC,CAAC;KAC1B,WAAU;KACX,UAAA;IAEO,CAAA;GAEP;EAEJ,CAAA,CAAA;;AAET"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { EmptyState as t } from "@burdenoff/fe-libs/ui";
|
|
3
|
-
|
|
3
|
+
// src/billing/shared/components/EmptyState.tsx
|
|
4
4
|
var n = ({ icon: n, title: r, description: i, action: a }) => /* @__PURE__ */ e(t, {
|
|
5
5
|
icon: n,
|
|
6
6
|
title: r,
|
|
7
7
|
description: i,
|
|
8
8
|
action: a
|
|
9
9
|
});
|
|
10
|
-
//#endregion
|
|
11
10
|
export { n as EmptyState };
|
|
12
11
|
|
|
13
12
|
//# sourceMappingURL=EmptyState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.js","names":[],"sources":["../../../../src/billing/shared/components/EmptyState.tsx"],"sourcesContent":["/**\n * Shared Empty State Component\n *\n * Local wrapper around `EmptyState` from `@burdenoff/fe-libs/ui`.\n * Keeps the existing microfe-billing call sites stable while routing all\n * empty-state rendering through the canonical primitive.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { EmptyState as CanonicalEmptyState } from '@burdenoff/fe-libs/ui';\n\ninterface EmptyStateProps {\n icon?: ReactNode;\n title: string;\n description?: string;\n action?: ReactNode;\n}\n\nexport const EmptyState: FC<EmptyStateProps> = ({ icon, title, description, action }) => {\n return (\n <CanonicalEmptyState icon={icon} title={title} description={description} action={action} />\n );\n};\n"],"mappings":";;;AAkBA,
|
|
1
|
+
{"version":3,"file":"EmptyState.js","names":["EmptyState","CanonicalEmptyState","EmptyState$1","EmptyState"],"sources":["../../../../src/billing/shared/components/EmptyState.tsx"],"sourcesContent":["/**\n * Shared Empty State Component\n *\n * Local wrapper around `EmptyState` from `@burdenoff/fe-libs/ui`.\n * Keeps the existing microfe-billing call sites stable while routing all\n * empty-state rendering through the canonical primitive.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { EmptyState as CanonicalEmptyState } from '@burdenoff/fe-libs/ui';\n\ninterface EmptyStateProps {\n icon?: ReactNode;\n title: string;\n description?: string;\n action?: ReactNode;\n}\n\nexport const EmptyState: FC<EmptyStateProps> = ({ icon, title, description, action }) => {\n return (\n <CanonicalEmptyState icon={icon} title={title} description={description} action={action} />\n );\n};\n"],"mappings":";;;AAkBA,IAAaA,KAAmC,EAAE,SAAM,UAAO,gBAAa,gBAExE,kBAACC,GAAD;CAA2B;CAAa;CAAoB;CAAqB;AAAS,CAAA"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { PageHeader as t } from "@burdenoff/fe-libs/chrome";
|
|
3
|
-
|
|
3
|
+
// src/billing/shared/components/PageHeader.tsx
|
|
4
4
|
var n = ({ title: n, description: r, actions: i, icon: a }) => /* @__PURE__ */ e(t, {
|
|
5
5
|
title: n,
|
|
6
6
|
description: r,
|
|
7
7
|
actions: i,
|
|
8
8
|
icon: a
|
|
9
9
|
});
|
|
10
|
-
//#endregion
|
|
11
10
|
export { n as PageHeader };
|
|
12
11
|
|
|
13
12
|
//# sourceMappingURL=PageHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader.js","names":[],"sources":["../../../../src/billing/shared/components/PageHeader.tsx"],"sourcesContent":["/**\n * Shared Page Header Component\n *\n * Local wrapper around `PageHeader` from `@burdenoff/fe-libs/chrome`.\n * Routes all billing page headers through the canonical primitive so they\n * inherit responsive layout, breadcrumb support, and one-primary-action\n * styling from the design system.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { PageHeader as CanonicalPageHeader } from '@burdenoff/fe-libs/chrome';\n\ninterface PageHeaderProps {\n title: string;\n description?: string;\n actions?: ReactNode;\n icon?: ReactNode;\n}\n\nexport const PageHeader: FC<PageHeaderProps> = ({ title, description, actions, icon }) => {\n return (\n <CanonicalPageHeader title={title} description={description} actions={actions} icon={icon} />\n );\n};\n"],"mappings":";;;AAmBA,
|
|
1
|
+
{"version":3,"file":"PageHeader.js","names":["PageHeader","CanonicalPageHeader","PageHeader$1","PageHeader"],"sources":["../../../../src/billing/shared/components/PageHeader.tsx"],"sourcesContent":["/**\n * Shared Page Header Component\n *\n * Local wrapper around `PageHeader` from `@burdenoff/fe-libs/chrome`.\n * Routes all billing page headers through the canonical primitive so they\n * inherit responsive layout, breadcrumb support, and one-primary-action\n * styling from the design system.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { PageHeader as CanonicalPageHeader } from '@burdenoff/fe-libs/chrome';\n\ninterface PageHeaderProps {\n title: string;\n description?: string;\n actions?: ReactNode;\n icon?: ReactNode;\n}\n\nexport const PageHeader: FC<PageHeaderProps> = ({ title, description, actions, icon }) => {\n return (\n <CanonicalPageHeader title={title} description={description} actions={actions} icon={icon} />\n );\n};\n"],"mappings":";;;AAmBA,IAAaA,KAAmC,EAAE,UAAO,gBAAa,YAAS,cAE3E,kBAACC,GAAD;CAA4B;CAAoB;CAAsB;CAAe;AAAO,CAAA"}
|
|
@@ -3,11 +3,11 @@ import { useState as t } from "react";
|
|
|
3
3
|
import { Bell as n, X as r } from "lucide-react";
|
|
4
4
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
import { getPushOptInController as o, recordPushPermissionPromptDismissed as s } from "@burdenoff/fe-libs/shared/native";
|
|
6
|
-
|
|
6
|
+
// src/billing/shared/components/PushPermissionNudge.tsx
|
|
7
7
|
var c = ({ onDismiss: c }) => {
|
|
8
8
|
let l = e(), [u, d] = t(!1), f = async () => {
|
|
9
9
|
let e = o();
|
|
10
|
-
if (
|
|
10
|
+
if (e && !u) {
|
|
11
11
|
d(!0);
|
|
12
12
|
try {
|
|
13
13
|
await e.enable();
|
|
@@ -67,7 +67,6 @@ var c = ({ onDismiss: c }) => {
|
|
|
67
67
|
})
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
|
-
//#endregion
|
|
71
70
|
export { c as PushPermissionNudge };
|
|
72
71
|
|
|
73
72
|
//# sourceMappingURL=PushPermissionNudge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PushPermissionNudge.js","names":[],"sources":["../../../../src/billing/shared/components/PushPermissionNudge.tsx"],"sourcesContent":["/**\n * Push Permission Nudge\n *\n * A one-time, contextual ask for push permission shown right after a\n * meaningful action (e.g. creating a billing account) rather than hidden\n * behind the notification-centre bell, which many users never open.\n *\n * Still respects the one-shot-prompt rule fe-libs enforces everywhere else:\n * it only renders when `shouldPromptForPushPermission()` says permission has\n * never been asked and the nudge was never dismissed before, and it never\n * re-prompts itself — `enable()`/dismissal both make it disappear for good\n * on this device.\n */\nimport { useState, type FC } from 'react';\nimport { Bell, X } from 'lucide-react';\nimport {\n getPushOptInController,\n recordPushPermissionPromptDismissed,\n} from '@burdenoff/fe-libs/shared/native';\nimport { useTr } from '../hooks/useTr';\n\ninterface PushPermissionNudgeProps {\n onDismiss: () => void;\n}\n\nexport const PushPermissionNudge: FC<PushPermissionNudgeProps> = ({ onDismiss }) => {\n const tr = useTr();\n const [enabling, setEnabling] = useState(false);\n\n const handleEnable = async () => {\n const controller = getPushOptInController();\n if (!controller || enabling) return;\n setEnabling(true);\n try {\n await controller.enable();\n } finally {\n setEnabling(false);\n onDismiss();\n }\n };\n\n const handleDismiss = () => {\n recordPushPermissionPromptDismissed();\n onDismiss();\n };\n\n return (\n <div\n role=\"status\"\n className=\"fixed bottom-6 right-6 z-50 w-full max-w-sm bg-bg-surface border border-border-subtle rounded-card shadow-elevation-3 p-4\"\n >\n <div className=\"flex items-start gap-3\">\n <div className=\"size-9 rounded-full bg-bg-sunken flex items-center justify-center shrink-0\">\n <Bell className=\"size-4 text-text-secondary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-medium text-text-primary\">\n {tr('billing.pushNudge.title', 'Stay on top of your account')}\n </p>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr(\n 'billing.pushNudge.body',\n \"Turn on notifications and we'll let you know about billing updates like this one.\"\n )}\n </p>\n <div className=\"mt-3 flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={handleEnable}\n disabled={enabling}\n className=\"px-3 py-1.5 text-sm font-medium text-action-primary-text bg-action-primary-bg rounded-button hover:bg-action-primary-bgHover transition-colors duration-200 disabled:opacity-60\"\n >\n {enabling\n ? tr('billing.pushNudge.enabling', 'Enabling…')\n : tr('billing.pushNudge.enable', 'Enable notifications')}\n </button>\n <button\n type=\"button\"\n onClick={handleDismiss}\n className=\"px-3 py-1.5 text-sm font-medium text-text-secondary hover:bg-bg-sunken rounded-button transition-colors duration-200\"\n >\n {tr('billing.pushNudge.notNow', 'Not now')}\n </button>\n </div>\n </div>\n <button\n type=\"button\"\n onClick={handleDismiss}\n aria-label={tr('billing.pushNudge.close', 'Close')}\n className=\"p-1 text-text-secondary hover:bg-bg-sunken rounded-button transition-colors duration-200 shrink-0\"\n >\n <X className=\"size-4\" />\n </button>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;AAyBA,
|
|
1
|
+
{"version":3,"file":"PushPermissionNudge.js","names":["PushPermissionNudge","tr","useTr","enabling","setEnabling","useState","handleEnable","controller","getPushOptInController","onDismiss","handleDismiss","recordPushPermissionPromptDismissed","Bell","X"],"sources":["../../../../src/billing/shared/components/PushPermissionNudge.tsx"],"sourcesContent":["/**\n * Push Permission Nudge\n *\n * A one-time, contextual ask for push permission shown right after a\n * meaningful action (e.g. creating a billing account) rather than hidden\n * behind the notification-centre bell, which many users never open.\n *\n * Still respects the one-shot-prompt rule fe-libs enforces everywhere else:\n * it only renders when `shouldPromptForPushPermission()` says permission has\n * never been asked and the nudge was never dismissed before, and it never\n * re-prompts itself — `enable()`/dismissal both make it disappear for good\n * on this device.\n */\nimport { useState, type FC } from 'react';\nimport { Bell, X } from 'lucide-react';\nimport {\n getPushOptInController,\n recordPushPermissionPromptDismissed,\n} from '@burdenoff/fe-libs/shared/native';\nimport { useTr } from '../hooks/useTr';\n\ninterface PushPermissionNudgeProps {\n onDismiss: () => void;\n}\n\nexport const PushPermissionNudge: FC<PushPermissionNudgeProps> = ({ onDismiss }) => {\n const tr = useTr();\n const [enabling, setEnabling] = useState(false);\n\n const handleEnable = async () => {\n const controller = getPushOptInController();\n if (!controller || enabling) return;\n setEnabling(true);\n try {\n await controller.enable();\n } finally {\n setEnabling(false);\n onDismiss();\n }\n };\n\n const handleDismiss = () => {\n recordPushPermissionPromptDismissed();\n onDismiss();\n };\n\n return (\n <div\n role=\"status\"\n className=\"fixed bottom-6 right-6 z-50 w-full max-w-sm bg-bg-surface border border-border-subtle rounded-card shadow-elevation-3 p-4\"\n >\n <div className=\"flex items-start gap-3\">\n <div className=\"size-9 rounded-full bg-bg-sunken flex items-center justify-center shrink-0\">\n <Bell className=\"size-4 text-text-secondary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-medium text-text-primary\">\n {tr('billing.pushNudge.title', 'Stay on top of your account')}\n </p>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr(\n 'billing.pushNudge.body',\n \"Turn on notifications and we'll let you know about billing updates like this one.\"\n )}\n </p>\n <div className=\"mt-3 flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={handleEnable}\n disabled={enabling}\n className=\"px-3 py-1.5 text-sm font-medium text-action-primary-text bg-action-primary-bg rounded-button hover:bg-action-primary-bgHover transition-colors duration-200 disabled:opacity-60\"\n >\n {enabling\n ? tr('billing.pushNudge.enabling', 'Enabling…')\n : tr('billing.pushNudge.enable', 'Enable notifications')}\n </button>\n <button\n type=\"button\"\n onClick={handleDismiss}\n className=\"px-3 py-1.5 text-sm font-medium text-text-secondary hover:bg-bg-sunken rounded-button transition-colors duration-200\"\n >\n {tr('billing.pushNudge.notNow', 'Not now')}\n </button>\n </div>\n </div>\n <button\n type=\"button\"\n onClick={handleDismiss}\n aria-label={tr('billing.pushNudge.close', 'Close')}\n className=\"p-1 text-text-secondary hover:bg-bg-sunken rounded-button transition-colors duration-200 shrink-0\"\n >\n <X className=\"size-4\" />\n </button>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;AAyBA,IAAaA,KAAqD,EAAE,mBAAgB;CAClF,IAAMC,IAAKC,EAAM,GACX,CAACC,GAAUC,KAAeC,EAAS,EAAK,GAExCC,IAAe,YAAY;EAC/B,IAAMC,IAAaC,EAAuB;EAC1C,IAAKD,KAAc,IACnB;KAAY,EAAI;GAChB,IAAI;IACF,MAAMA,EAAW,OAAO;GAC1B,UAAU;IAER,AADAH,EAAY,EAAK,GACjBK,EAAU;GACZ;EANgB;CAOlB,GAEMC,UAAsB;EAE1B,AADAC,EAAoC,GACpCF,EAAU;CACZ;CAEA,OACE,kBAAC,OAAD;EACE,MAAK;EACL,WAAU;EAEV,UAAA,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACE,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA,kBAACG,GAAD,EAAM,WAAU,6BAA8B,CAAA;IAC3C,CAAA;IACL,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA;MACE,kBAAC,KAAD;OAAG,WAAU;OACV,UAAAX,EAAG,2BAA2B,6BAA6B;MAC3D,CAAA;MACH,kBAAC,KAAD;OAAG,WAAU;OACV,UAAAA,EACC,0BACA,mFACF;MACC,CAAA;MACH,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC,UAAD;QACE,MAAK;QACL,SAASK;QACT,UAAUH;QACV,WAAU;QAET,UAAAA,IACGF,EAAG,8BAA8B,WAAW,IAC5CA,EAAG,4BAA4B,sBAAsB;OACnD,CAAA,GACR,kBAAC,UAAD;QACE,MAAK;QACL,SAASS;QACT,WAAU;QAET,UAAAT,EAAG,4BAA4B,SAAS;OACnC,CAAA,CACL;;KACF;;IACL,kBAAC,UAAD;KACE,MAAK;KACL,SAASS;KACT,cAAYT,EAAG,2BAA2B,OAAO;KACjD,WAAU;KAEV,UAAA,kBAACY,GAAD,EAAG,WAAU,SAAU,CAAA;IACjB,CAAA;GACL;;CACF,CAAA;AAET"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useTr as e } from "../hooks/useTr.js";
|
|
2
2
|
import { statusTokens as t } from "../utils/tokens.js";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/billing/shared/components/ServerError.tsx
|
|
5
5
|
var i = ({ title: i, message: a, onRetry: o, showRetry: s = !0 }) => {
|
|
6
6
|
let c = e(), l = i ?? c("billing.serverError.title", "Server Unavailable"), u = a ?? c("billing.serverError.message", "We're having trouble connecting to the server. Please try again later."), d = t.error;
|
|
7
7
|
return /* @__PURE__ */ n("div", {
|
|
@@ -67,7 +67,6 @@ var i = ({ title: i, message: a, onRetry: o, showRetry: s = !0 }) => {
|
|
|
67
67
|
})
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
|
-
//#endregion
|
|
71
70
|
export { i as ServerError };
|
|
72
71
|
|
|
73
72
|
//# sourceMappingURL=ServerError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerError.js","names":[],"sources":["../../../../src/billing/shared/components/ServerError.tsx"],"sourcesContent":["/**\n * Shared Server Error Component\n * Displays when backend server is unavailable or returns 500 errors\n */\n\nimport type { FC } from 'react';\nimport { useTr } from '../hooks/useTr';\nimport { statusTokens } from '../utils/tokens';\n\ninterface ServerErrorProps {\n title?: string;\n message?: string;\n onRetry?: () => void;\n showRetry?: boolean;\n}\n\nexport const ServerError: FC<ServerErrorProps> = ({\n title,\n message,\n onRetry,\n showRetry = true,\n}) => {\n const tr = useTr();\n\n const displayTitle = title ?? tr('billing.serverError.title', 'Server Unavailable');\n const displayMessage =\n message ??\n tr(\n 'billing.serverError.message',\n \"We're having trouble connecting to the server. Please try again later.\"\n );\n const errorTokens = statusTokens.error;\n\n return (\n <div className=\"flex items-center justify-center h-full min-h-[400px]\">\n <div className=\"text-center space-y-4 max-w-md\">\n {/* Server Icon */}\n <div\n className={`size-16 mx-auto rounded-full ${errorTokens.bg} flex items-center justify-center`}\n >\n <svg\n className={`size-8 ${errorTokens.icon}`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={1.5}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M5.25 14.25h13.5m-13.5 0a3 3 0 01-3-3m3 3a3 3 0 100 6h13.5a3 3 0 100-6m-16.5-3a3 3 0 013-3h13.5a3 3 0 013 3m-19.5 0a4.5 4.5 0 01.9-2.7L5.737 5.1a3.375 3.375 0 012.7-1.35h7.126c1.062 0 2.062.5 2.7 1.35l2.587 3.45a4.5 4.5 0 01.9 2.7m0 0a3 3 0 01-3 3m0 3h.008v.008h-.008v-.008zm0-6h.008v.008h-.008v-.008zm-3 6h.008v.008h-.008v-.008zm0-6h.008v.008h-.008v-.008z\"\n />\n </svg>\n </div>\n\n {/* Error Title */}\n <h2 className=\"text-xl font-semibold text-text-primary\">{displayTitle}</h2>\n\n {/* Error Message */}\n <p className=\"text-sm text-text-secondary\">{displayMessage}</p>\n\n {/* Status Indicator */}\n <div\n className={`inline-flex items-center gap-2 px-3 py-1.5 ${errorTokens.bg} rounded-full`}\n >\n <span className={`size-2 rounded-full ${errorTokens.dot} animate-pulse`} />\n <span className={`text-xs font-medium ${errorTokens.text}`}>\n {tr('billing.serverError.statusOffline', 'Server Status: Offline')}\n </span>\n </div>\n\n {/* Retry Button */}\n {showRetry && onRetry && (\n <div className=\"pt-2\">\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-action-primary-text bg-action-primary-bg hover:bg-action-primary-bgHover rounded-button transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2\"\n >\n <svg\n className=\"size-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={2}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99\"\n />\n </svg>\n {tr('billing.serverError.tryAgain', 'Try Again')}\n </button>\n </div>\n )}\n\n {/* Additional Help */}\n <p className=\"text-xs text-text-muted pt-4\">\n {tr(\n 'billing.serverError.persistHelp',\n 'If this issue persists, please contact support or check the system status page.'\n )}\n </p>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;AAgBA,
|
|
1
|
+
{"version":3,"file":"ServerError.js","names":["ServerError","tr","useTr","displayTitle","title","displayMessage","message","errorTokens","statusTokens","showRetry","onRetry"],"sources":["../../../../src/billing/shared/components/ServerError.tsx"],"sourcesContent":["/**\n * Shared Server Error Component\n * Displays when backend server is unavailable or returns 500 errors\n */\n\nimport type { FC } from 'react';\nimport { useTr } from '../hooks/useTr';\nimport { statusTokens } from '../utils/tokens';\n\ninterface ServerErrorProps {\n title?: string;\n message?: string;\n onRetry?: () => void;\n showRetry?: boolean;\n}\n\nexport const ServerError: FC<ServerErrorProps> = ({\n title,\n message,\n onRetry,\n showRetry = true,\n}) => {\n const tr = useTr();\n\n const displayTitle = title ?? tr('billing.serverError.title', 'Server Unavailable');\n const displayMessage =\n message ??\n tr(\n 'billing.serverError.message',\n \"We're having trouble connecting to the server. Please try again later.\"\n );\n const errorTokens = statusTokens.error;\n\n return (\n <div className=\"flex items-center justify-center h-full min-h-[400px]\">\n <div className=\"text-center space-y-4 max-w-md\">\n {/* Server Icon */}\n <div\n className={`size-16 mx-auto rounded-full ${errorTokens.bg} flex items-center justify-center`}\n >\n <svg\n className={`size-8 ${errorTokens.icon}`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={1.5}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M5.25 14.25h13.5m-13.5 0a3 3 0 01-3-3m3 3a3 3 0 100 6h13.5a3 3 0 100-6m-16.5-3a3 3 0 013-3h13.5a3 3 0 013 3m-19.5 0a4.5 4.5 0 01.9-2.7L5.737 5.1a3.375 3.375 0 012.7-1.35h7.126c1.062 0 2.062.5 2.7 1.35l2.587 3.45a4.5 4.5 0 01.9 2.7m0 0a3 3 0 01-3 3m0 3h.008v.008h-.008v-.008zm0-6h.008v.008h-.008v-.008zm-3 6h.008v.008h-.008v-.008zm0-6h.008v.008h-.008v-.008z\"\n />\n </svg>\n </div>\n\n {/* Error Title */}\n <h2 className=\"text-xl font-semibold text-text-primary\">{displayTitle}</h2>\n\n {/* Error Message */}\n <p className=\"text-sm text-text-secondary\">{displayMessage}</p>\n\n {/* Status Indicator */}\n <div\n className={`inline-flex items-center gap-2 px-3 py-1.5 ${errorTokens.bg} rounded-full`}\n >\n <span className={`size-2 rounded-full ${errorTokens.dot} animate-pulse`} />\n <span className={`text-xs font-medium ${errorTokens.text}`}>\n {tr('billing.serverError.statusOffline', 'Server Status: Offline')}\n </span>\n </div>\n\n {/* Retry Button */}\n {showRetry && onRetry && (\n <div className=\"pt-2\">\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-action-primary-text bg-action-primary-bg hover:bg-action-primary-bgHover rounded-button transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] focus-visible:ring-offset-2\"\n >\n <svg\n className=\"size-4\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={2}\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99\"\n />\n </svg>\n {tr('billing.serverError.tryAgain', 'Try Again')}\n </button>\n </div>\n )}\n\n {/* Additional Help */}\n <p className=\"text-xs text-text-muted pt-4\">\n {tr(\n 'billing.serverError.persistHelp',\n 'If this issue persists, please contact support or check the system status page.'\n )}\n </p>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;AAgBA,IAAaA,KAAqC,EAChD,UACA,YACA,YACA,eAAY,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 -1,7 +1,7 @@
|
|
|
1
1
|
import { MetricCard as e } from "../ui/MetricCard.js";
|
|
2
2
|
import "../ui/index.js";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/billing/shared/components/StatCard.tsx
|
|
5
5
|
var n = ({ label: n, value: r, icon: i, trend: a, className: o = "" }) => /* @__PURE__ */ t(e, {
|
|
6
6
|
label: n,
|
|
7
7
|
value: r,
|
|
@@ -9,7 +9,6 @@ var n = ({ label: n, value: r, icon: i, trend: a, className: o = "" }) => /* @__
|
|
|
9
9
|
trend: a,
|
|
10
10
|
className: o
|
|
11
11
|
});
|
|
12
|
-
//#endregion
|
|
13
12
|
export { n as StatCard };
|
|
14
13
|
|
|
15
14
|
//# sourceMappingURL=StatCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatCard.js","names":[],"sources":["../../../../src/billing/shared/components/StatCard.tsx"],"sourcesContent":["/**\n * Shared Stat Card Component\n * Displays a metric with label and value\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { MetricCard } from '../ui';\n\ninterface StatCardProps {\n label: string;\n value: string | number;\n icon?: ReactNode;\n trend?: {\n value: number;\n isPositive: boolean;\n };\n className?: string;\n}\n\nexport const StatCard: FC<StatCardProps> = ({ label, value, icon, trend, className = '' }) => {\n return <MetricCard label={label} value={value} icon={icon} trend={trend} className={className} />;\n};\n"],"mappings":";;;;AAmBA,
|
|
1
|
+
{"version":3,"file":"StatCard.js","names":["StatCard","MetricCard"],"sources":["../../../../src/billing/shared/components/StatCard.tsx"],"sourcesContent":["/**\n * Shared Stat Card Component\n * Displays a metric with label and value\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { MetricCard } from '../ui';\n\ninterface StatCardProps {\n label: string;\n value: string | number;\n icon?: ReactNode;\n trend?: {\n value: number;\n isPositive: boolean;\n };\n className?: string;\n}\n\nexport const StatCard: FC<StatCardProps> = ({ label, value, icon, trend, className = '' }) => {\n return <MetricCard label={label} value={value} icon={icon} trend={trend} className={className} />;\n};\n"],"mappings":";;;;AAmBA,IAAaA,KAA+B,EAAE,UAAO,UAAO,SAAM,UAAO,eAAY,SAC5E,kBAACC,GAAD;CAAmB;CAAc;CAAa;CAAa;CAAkB;AAAY,CAAA"}
|
|
@@ -10,4 +10,3 @@ export { GeoPricingOverridesEditor } from './GeoPricingOverridesEditor';
|
|
|
10
10
|
export { CurrencyPriceOverridesEditor } from './CurrencyPriceOverridesEditor';
|
|
11
11
|
export { ActorIdentity } from './ActorIdentity';
|
|
12
12
|
export { PushPermissionNudge } from './PushPermissionNudge';
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import "./AccessDenied.js";
|
|
2
|
-
import "./PageHeader.js";
|
|
3
|
-
import "./StatCard.js";
|
|
4
|
-
import "./EmptyState.js";
|
|
5
|
-
import "./ServerError.js";
|
|
1
|
+
import { AccessDenied as e } from "./AccessDenied.js";
|
|
2
|
+
import { PageHeader as t } from "./PageHeader.js";
|
|
3
|
+
import { StatCard as n } from "./StatCard.js";
|
|
4
|
+
import { EmptyState as r } from "./EmptyState.js";
|
|
5
|
+
import { ServerError as i } from "./ServerError.js";
|
|
6
6
|
import "./GeoPricingOverridesEditor.js";
|
|
7
|
-
import "./CurrencyPriceOverridesEditor.js";
|
|
8
|
-
import "./ActorIdentity.js";
|
|
7
|
+
import { CurrencyPriceOverridesEditor as a } from "./CurrencyPriceOverridesEditor.js";
|
|
8
|
+
import { ActorIdentity as o } from "./ActorIdentity.js";
|
|
9
9
|
import "./PushPermissionNudge.js";
|
|
10
|
+
export { e as AccessDenied, o as ActorIdentity, a as CurrencyPriceOverridesEditor, r as EmptyState, t as PageHeader, i as ServerError, n as StatCard };
|
|
@@ -2,7 +2,7 @@ import { useBilling as e } from "../../providers/BillingProvider.js";
|
|
|
2
2
|
import { directBillingGraphqlRequest as t } from "../utils/directBillingGraphql.js";
|
|
3
3
|
import "../utils/index.js";
|
|
4
4
|
import { useEffect as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
5
|
-
|
|
5
|
+
// src/billing/shared/hooks/useActorProfiles.ts
|
|
6
6
|
var o = "\n query ActorProfileUser($id: ID!) {\n user(id: $id) {\n id\n email\n firstName\n lastName\n name\n username\n avatar\n }\n }\n";
|
|
7
7
|
function s(e) {
|
|
8
8
|
return e.length <= 12 ? e : `${e.slice(0, 8)}…${e.slice(-4)}`;
|
|
@@ -25,14 +25,11 @@ function l(e) {
|
|
|
25
25
|
resolved: !1
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
var u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), f =
|
|
28
|
+
var u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), f = 3e5, p = /* @__PURE__ */ new Map();
|
|
29
29
|
function m(e) {
|
|
30
30
|
let t = p.get(e);
|
|
31
|
-
if (!t || t < Date.now())
|
|
32
|
-
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
return u.get(e);
|
|
31
|
+
if (!t || t < Date.now()) u.delete(e), p.delete(e);
|
|
32
|
+
else return u.get(e);
|
|
36
33
|
}
|
|
37
34
|
function h(e) {
|
|
38
35
|
u.set(e.actorId, e), p.set(e.actorId, Date.now() + f);
|
|
@@ -107,7 +104,6 @@ function g(c) {
|
|
|
107
104
|
p
|
|
108
105
|
]), g;
|
|
109
106
|
}
|
|
110
|
-
//#endregion
|
|
111
107
|
export { g as useActorProfiles };
|
|
112
108
|
|
|
113
109
|
//# sourceMappingURL=useActorProfiles.js.map
|