@burdenoff/microfe-billing 2026.624.3 → 2026.625.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.js +1 -1
- package/dist/billing/BillingAdminRoutes.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonCreatePage.js +2 -2
- package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonDetailPage.js +4 -4
- package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.js +2 -2
- package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.js +1 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +98 -99
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js +88 -85
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +6 -6
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +2 -2
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundsPage.js +360 -370
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +2 -2
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/checkout/components/BillingAccountSelector.js +1 -1
- package/dist/billing/modules/checkout/components/BillingAccountSelector.js.map +1 -1
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js +1 -1
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js.map +1 -1
- package/dist/billing/modules/checkout/components/SubscriptionSelector.js +1 -1
- package/dist/billing/modules/checkout/components/SubscriptionSelector.js.map +1 -1
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js +2 -2
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +102 -104
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponsListPage.js +5 -5
- package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js +1 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +1 -1
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +29 -28
- package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js +2 -2
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js.map +1 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js +1 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js.map +1 -1
- package/dist/billing/modules/dashboard/components/BillingAccountCard.js +3 -3
- package/dist/billing/modules/dashboard/components/BillingAccountCard.js.map +1 -1
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +2 -2
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -1
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js +1 -1
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js.map +1 -1
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js +1 -1
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js.map +1 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +139 -142
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js +6 -6
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +4 -4
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +1 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +142 -133
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanCreatePage.js +2 -2
- package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanDetailPage.js +4 -4
- package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.js +2 -2
- package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +4 -4
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansListPage.js +2 -2
- package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +4 -4
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js +2 -2
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +2 -2
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +5 -5
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +2 -2
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +259 -265
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +7 -7
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
- package/dist/billing/modules/usage/pages/UsagePage.js +13 -13
- package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
- package/dist/billing/shared/ui/Card.js +1 -1
- package/dist/billing/shared/ui/Card.js.map +1 -1
- package/dist/billing/shared/ui/MetricCard.js +28 -21
- package/dist/billing/shared/ui/MetricCard.js.map +1 -1
- package/package.json +2 -2
|
@@ -22,121 +22,122 @@ import { useAddonCartStore as me } from "../../addons/store/addonCartStore.js";
|
|
|
22
22
|
import { FloatingCartDrawer as he } from "../../addons/components/FloatingCartDrawer.js";
|
|
23
23
|
import { withBillingAccountId as i } from "../../../shared/utils/navigation.js";
|
|
24
24
|
import { useCallback as a, useEffect as o, useState as s } from "react";
|
|
25
|
-
import { Activity as ge, ArrowRight as _e, Building2 as c, Check as
|
|
25
|
+
import { Activity as ge, ArrowRight as _e, Building2 as c, Check as l, ChevronDown as u, Coins as ve, Crown as ye, Loader2 as be, Plus as xe, Receipt as Se, RefreshCw as d, Sparkles as Ce, Wallet as f } from "lucide-react";
|
|
26
26
|
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
27
27
|
import { useI18n as we } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
28
|
+
import { Button as Te, CTAOverflowMenu as Ee, EmphasisPanel as De } from "@burdenoff/fe-libs/ui";
|
|
28
29
|
//#region src/billing/modules/dashboard/pages/OverviewPage.tsx
|
|
29
30
|
var g = () => {
|
|
30
31
|
let { t: g } = we(), _ = (e, t) => {
|
|
31
32
|
let n = g(e);
|
|
32
33
|
return n === e ? t : n;
|
|
33
|
-
}, { navigate: v, basePath: y, orgId: b, productId:
|
|
34
|
-
|
|
35
|
-
}, [b]), { addToCart:
|
|
34
|
+
}, { navigate: v, basePath: y, orgId: b, productId: Oe } = e(), x = oe(), { emit: S } = ne(), [C, ke] = s(() => re(b)), [w, T] = s(!1), [E, D] = s(null), [O, k] = s(!1), [Ae, A] = s(!1), [j, M] = s(0), [N, P] = s(!1), { billingAccounts: F, currentAccount: I, paymentMethods: L, activeSubscriptions: R, hasActiveSubscription: z, recommendedAddons: je, isLoading: B, error: V, refetchAll: H } = ce(C, Oe), U = I?.id, Me = B, W = a((e) => {
|
|
35
|
+
ke(e), ie(b, e);
|
|
36
|
+
}, [b]), { addToCart: G, isInCart: K, getCartItem: q, updateQuantity: J, removeFromCart: Y } = me(), { createBillingAccount: Ne, setBillingAddress: X, setDefaultPaymentMethod: Pe, deletePaymentMethod: Fe, isCreatingAccount: Ie } = se();
|
|
36
37
|
o(() => {
|
|
37
|
-
|
|
38
|
-
}, [
|
|
39
|
-
C &&
|
|
38
|
+
M(0), P(!1);
|
|
39
|
+
}, [U, R.length]), o(() => {
|
|
40
|
+
C && F.length > 0 && (F.some((e) => e.id === C) || W(null));
|
|
40
41
|
}, [
|
|
41
|
-
|
|
42
|
+
F,
|
|
42
43
|
C,
|
|
43
|
-
|
|
44
|
+
W
|
|
44
45
|
]), o(() => {
|
|
45
|
-
!C &&
|
|
46
|
+
!C && F.length > 0 && W((F.find((e) => e.isDefault) ?? F[0]).id);
|
|
46
47
|
}, [
|
|
47
|
-
|
|
48
|
+
F,
|
|
48
49
|
C,
|
|
49
|
-
|
|
50
|
+
W
|
|
50
51
|
]);
|
|
51
|
-
let Z =
|
|
52
|
+
let Z = R[j] || R[0] || null, Q = a((e) => {
|
|
52
53
|
let t = e;
|
|
53
54
|
y && y !== "/" && (t = `${y.endsWith("/") ? y.slice(0, -1) : y}${e.startsWith("/") ? e : `/${e}`}`), v(t);
|
|
54
|
-
}, [v, y]),
|
|
55
|
+
}, [v, y]), Le = a(async (e, t) => {
|
|
55
56
|
D(null);
|
|
56
57
|
try {
|
|
57
|
-
let n = await
|
|
58
|
-
t && n.id && await
|
|
58
|
+
let n = await Ne(e);
|
|
59
|
+
t && n.id && await X({
|
|
59
60
|
billingAccountId: n.id,
|
|
60
61
|
...t
|
|
61
|
-
}), T(!1),
|
|
62
|
+
}), T(!1), W(n.id), S("billing.billing_account.created", {
|
|
62
63
|
route: "/billing/overview",
|
|
63
64
|
entityId: n.id,
|
|
64
65
|
source: "overview"
|
|
65
|
-
}), await
|
|
66
|
+
}), await H();
|
|
66
67
|
} catch (e) {
|
|
67
68
|
D(e instanceof Error ? e.message : "Failed to create billing account");
|
|
68
69
|
}
|
|
69
70
|
}, [
|
|
70
|
-
|
|
71
|
+
Ne,
|
|
71
72
|
S,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
]),
|
|
73
|
+
H,
|
|
74
|
+
X,
|
|
75
|
+
W
|
|
76
|
+
]), Re = a(() => {
|
|
76
77
|
A(!0);
|
|
77
78
|
}, []), $ = a(async () => {
|
|
78
|
-
await
|
|
79
|
-
}, [
|
|
79
|
+
await H();
|
|
80
|
+
}, [H]), ze = a(async () => {
|
|
80
81
|
S("billing.payment_method.added", {
|
|
81
82
|
route: "/billing/overview",
|
|
82
|
-
entityId:
|
|
83
|
+
entityId: U,
|
|
83
84
|
source: "overview"
|
|
84
85
|
}), await $();
|
|
85
86
|
}, [
|
|
86
|
-
|
|
87
|
+
U,
|
|
87
88
|
S,
|
|
88
89
|
$
|
|
89
|
-
]),
|
|
90
|
-
|
|
90
|
+
]), Be = a(async (e) => {
|
|
91
|
+
U && (await Pe(e, U), S("billing.payment_method.default_set", {
|
|
91
92
|
route: "/billing/overview",
|
|
92
93
|
entityId: e,
|
|
93
94
|
source: "overview"
|
|
94
95
|
}), await $());
|
|
95
96
|
}, [
|
|
96
|
-
|
|
97
|
+
U,
|
|
97
98
|
S,
|
|
98
|
-
|
|
99
|
+
Pe,
|
|
99
100
|
$
|
|
100
|
-
]),
|
|
101
|
-
|
|
101
|
+
]), Ve = a(async (e) => {
|
|
102
|
+
U && (await Fe(e, U), S("billing.payment_method.deleted", {
|
|
102
103
|
route: "/billing/overview",
|
|
103
104
|
entityId: e,
|
|
104
105
|
source: "overview"
|
|
105
106
|
}), await $());
|
|
106
107
|
}, [
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
U,
|
|
109
|
+
Fe,
|
|
109
110
|
S,
|
|
110
111
|
$
|
|
111
|
-
]),
|
|
112
|
-
|
|
113
|
-
}, [
|
|
114
|
-
await
|
|
115
|
-
}, [
|
|
116
|
-
|
|
117
|
-
}, [
|
|
118
|
-
t <= 0 ?
|
|
119
|
-
}, [
|
|
120
|
-
|
|
121
|
-
}, [
|
|
122
|
-
return x.canViewBillingAccount ?
|
|
112
|
+
]), He = a((e) => {
|
|
113
|
+
W(e.id), k(!1);
|
|
114
|
+
}, [W]), Ue = a(async () => {
|
|
115
|
+
await H();
|
|
116
|
+
}, [H]), We = a((e) => {
|
|
117
|
+
G(e);
|
|
118
|
+
}, [G]), Ge = a((e) => K(e), [K]), Ke = a((e) => q(e)?.quantity || 0, [q]), qe = a((e, t) => {
|
|
119
|
+
t <= 0 ? Y(e) : J(e, t);
|
|
120
|
+
}, [J, Y]), Je = a((e) => {
|
|
121
|
+
Y(e);
|
|
122
|
+
}, [Y]);
|
|
123
|
+
return x.canViewBillingAccount ? V && ae(V) && !B ? /* @__PURE__ */ m("div", {
|
|
123
124
|
className: "p-6",
|
|
124
125
|
children: /* @__PURE__ */ m(te, {
|
|
125
126
|
title: "Server Unavailable",
|
|
126
127
|
message: "Unable to load billing overview. The server might be down or experiencing issues.",
|
|
127
|
-
onRetry:
|
|
128
|
+
onRetry: Ue,
|
|
128
129
|
showRetry: !0
|
|
129
130
|
})
|
|
130
|
-
}) :
|
|
131
|
+
}) : B && !I ? /* @__PURE__ */ m("div", {
|
|
131
132
|
className: "flex items-center justify-center min-h-[400px]",
|
|
132
133
|
children: /* @__PURE__ */ h("div", {
|
|
133
134
|
className: "flex flex-col items-center gap-3",
|
|
134
|
-
children: [/* @__PURE__ */ m(
|
|
135
|
+
children: [/* @__PURE__ */ m(be, { className: "size-8 animate-spin text-text-link" }), /* @__PURE__ */ m("p", {
|
|
135
136
|
className: "text-sm text-text-secondary",
|
|
136
137
|
children: _("billing.overview.loadingInfo", "Loading billing information...")
|
|
137
138
|
})]
|
|
138
139
|
})
|
|
139
|
-
}) : !
|
|
140
|
+
}) : !B && F.length === 0 ? /* @__PURE__ */ h("div", {
|
|
140
141
|
className: "px-6 lg:px-8 py-6",
|
|
141
142
|
children: [
|
|
142
143
|
/* @__PURE__ */ h("header", {
|
|
@@ -157,7 +158,7 @@ var g = () => {
|
|
|
157
158
|
type: "button",
|
|
158
159
|
onClick: () => T(!0),
|
|
159
160
|
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-action-primary-text bg-action-primary-bg rounded-button hover:bg-action-primary-bgHover transition-colors duration-200",
|
|
160
|
-
children: [/* @__PURE__ */ m(
|
|
161
|
+
children: [/* @__PURE__ */ m(xe, { className: "size-4" }), _("billing.overview.createBillingAccount", "Create Billing Account")]
|
|
161
162
|
}) : void 0
|
|
162
163
|
}),
|
|
163
164
|
/* @__PURE__ */ m(r, {
|
|
@@ -165,8 +166,8 @@ var g = () => {
|
|
|
165
166
|
onClose: () => {
|
|
166
167
|
T(!1), D(null);
|
|
167
168
|
},
|
|
168
|
-
onSubmit:
|
|
169
|
-
isSubmitting:
|
|
169
|
+
onSubmit: Le,
|
|
170
|
+
isSubmitting: Ie,
|
|
170
171
|
error: E
|
|
171
172
|
})
|
|
172
173
|
]
|
|
@@ -181,32 +182,28 @@ var g = () => {
|
|
|
181
182
|
}), /* @__PURE__ */ m("p", {
|
|
182
183
|
className: "text-sm text-text-secondary mt-1",
|
|
183
184
|
children: _("billing.overview.description", "Manage your billing accounts, subscriptions, and payment methods")
|
|
184
|
-
})] }), /* @__PURE__ */
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
className: "hidden sm:inline",
|
|
198
|
-
children: _("billing.overview.newAccount", "New Account")
|
|
199
|
-
})]
|
|
200
|
-
})]
|
|
185
|
+
})] }), /* @__PURE__ */ m(Ee, {
|
|
186
|
+
primary: x.canManageBillingAccount && F.length > 0 ? {
|
|
187
|
+
label: _("billing.overview.newAccount", "New Account"),
|
|
188
|
+
onSelect: () => T(!0),
|
|
189
|
+
icon: /* @__PURE__ */ m(xe, { className: "size-4" })
|
|
190
|
+
} : void 0,
|
|
191
|
+
actions: [{
|
|
192
|
+
label: _("billing.overview.refresh", "Refresh"),
|
|
193
|
+
onSelect: () => {
|
|
194
|
+
Ue();
|
|
195
|
+
},
|
|
196
|
+
icon: /* @__PURE__ */ m(d, { className: `size-4 ${B ? "animate-spin" : ""}` })
|
|
197
|
+
}]
|
|
201
198
|
})]
|
|
202
199
|
}),
|
|
203
|
-
|
|
200
|
+
F.length > 1 && /* @__PURE__ */ h("div", {
|
|
204
201
|
className: "relative",
|
|
205
202
|
"data-tour": "billing-overview-account-selector",
|
|
206
203
|
children: [/* @__PURE__ */ h("button", {
|
|
207
204
|
type: "button",
|
|
208
205
|
onClick: () => k(!O),
|
|
209
|
-
className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border-
|
|
206
|
+
className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border-seam rounded-card bg-bg-surface hover:bg-bg-sunken hover:border-border-strong transition-all duration-200",
|
|
210
207
|
children: [/* @__PURE__ */ h("div", {
|
|
211
208
|
className: "flex items-center gap-3",
|
|
212
209
|
children: [/* @__PURE__ */ m("div", {
|
|
@@ -216,21 +213,21 @@ var g = () => {
|
|
|
216
213
|
className: "text-left",
|
|
217
214
|
children: [/* @__PURE__ */ m("p", {
|
|
218
215
|
className: "text-sm font-medium text-text-primary",
|
|
219
|
-
children:
|
|
216
|
+
children: I?.name || _("billing.overview.selectAccount", "Select Account")
|
|
220
217
|
}), /* @__PURE__ */ m("p", {
|
|
221
218
|
className: "text-xs text-text-secondary",
|
|
222
|
-
children:
|
|
219
|
+
children: I?.email
|
|
223
220
|
})]
|
|
224
221
|
})]
|
|
225
|
-
}), /* @__PURE__ */ m(
|
|
222
|
+
}), /* @__PURE__ */ m(u, { className: `size-4 text-text-muted transition-transform ${O ? "rotate-180" : ""}` })]
|
|
226
223
|
}), O && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
|
|
227
224
|
className: "fixed inset-0 z-10",
|
|
228
225
|
onClick: () => k(!1)
|
|
229
226
|
}), /* @__PURE__ */ m("div", {
|
|
230
|
-
className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-bg-elevated border border-border-
|
|
231
|
-
children:
|
|
227
|
+
className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-bg-elevated border border-border-seam rounded-card shadow-elevation-3 z-20 py-1 max-h-60 overflow-y-auto",
|
|
228
|
+
children: F.map((e) => /* @__PURE__ */ h("button", {
|
|
232
229
|
type: "button",
|
|
233
|
-
onClick: () =>
|
|
230
|
+
onClick: () => He(e),
|
|
234
231
|
className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
|
|
235
232
|
children: [/* @__PURE__ */ h("div", {
|
|
236
233
|
className: "flex items-center gap-3 min-w-0",
|
|
@@ -247,32 +244,32 @@ var g = () => {
|
|
|
247
244
|
children: e.email
|
|
248
245
|
})]
|
|
249
246
|
})]
|
|
250
|
-
}),
|
|
247
|
+
}), I?.id === e.id && /* @__PURE__ */ m(l, { className: "size-4 text-text-link flex-shrink-0" })]
|
|
251
248
|
}, e.id))
|
|
252
249
|
})] })]
|
|
253
250
|
}),
|
|
254
|
-
|
|
251
|
+
I && /* @__PURE__ */ h("div", {
|
|
255
252
|
className: "grid grid-cols-1 xs:grid-cols-2 sm:grid-cols-4 gap-3 sm:gap-4",
|
|
256
253
|
"data-tour": "billing-overview-stats-row",
|
|
257
254
|
children: [
|
|
258
255
|
/* @__PURE__ */ m(n, {
|
|
259
256
|
label: _("billing.overview.stats.creditBalance", "Credit Balance"),
|
|
260
|
-
value: `${(
|
|
257
|
+
value: `${(I.creditAmount || 0).toLocaleString()} Credits`,
|
|
261
258
|
icon: /* @__PURE__ */ m(f, { className: "size-5" })
|
|
262
259
|
}),
|
|
263
260
|
/* @__PURE__ */ m(n, {
|
|
264
261
|
label: _("billing.overview.stats.activePlans", "Active Plans"),
|
|
265
|
-
value:
|
|
262
|
+
value: R.length > 0 ? R.length === 1 ? R[0]?.plan?.name || "1 Plan" : `${R.length} ${_("billing.overview.stats.plansSuffix", "Plans")}` : _("billing.overview.stats.none", "None"),
|
|
266
263
|
icon: /* @__PURE__ */ m(d, { className: "size-5" })
|
|
267
264
|
}),
|
|
268
265
|
/* @__PURE__ */ m(n, {
|
|
269
266
|
label: _("billing.overview.stats.paymentMethods", "Payment Methods"),
|
|
270
|
-
value:
|
|
267
|
+
value: L.length,
|
|
271
268
|
icon: /* @__PURE__ */ m(c, { className: "size-5" })
|
|
272
269
|
}),
|
|
273
270
|
/* @__PURE__ */ m(n, {
|
|
274
271
|
label: _("billing.overview.stats.paymentCurrency", "Payment Currency"),
|
|
275
|
-
value:
|
|
272
|
+
value: I.currency || "USD",
|
|
276
273
|
icon: /* @__PURE__ */ m(c, { className: "size-5" })
|
|
277
274
|
})
|
|
278
275
|
]
|
|
@@ -282,27 +279,27 @@ var g = () => {
|
|
|
282
279
|
children: [/* @__PURE__ */ h("div", {
|
|
283
280
|
className: "lg:col-span-2 space-y-6",
|
|
284
281
|
children: [
|
|
285
|
-
|
|
282
|
+
I && /* @__PURE__ */ m(le, {
|
|
286
283
|
dataTour: "billing-overview-billing-account-card",
|
|
287
|
-
account:
|
|
288
|
-
isDefault:
|
|
289
|
-
onEdit: () =>
|
|
290
|
-
onViewTransactions: () => Q(`/transactions/${
|
|
291
|
-
onViewCreditTransactions: () => Q(`/creditTransactions/${
|
|
284
|
+
account: I,
|
|
285
|
+
isDefault: I.isDefault ?? !1,
|
|
286
|
+
onEdit: () => I && Q(`/settings?billingAccountId=${I.id}`),
|
|
287
|
+
onViewTransactions: () => Q(`/transactions/${I.id}`),
|
|
288
|
+
onViewCreditTransactions: () => Q(`/creditTransactions/${I.id}`)
|
|
292
289
|
}),
|
|
293
290
|
/* @__PURE__ */ h("div", {
|
|
294
291
|
className: "space-y-3",
|
|
295
|
-
children: [
|
|
292
|
+
children: [R.length > 1 && /* @__PURE__ */ h("div", {
|
|
296
293
|
className: "relative",
|
|
297
294
|
children: [/* @__PURE__ */ h("button", {
|
|
298
295
|
type: "button",
|
|
299
|
-
onClick: () =>
|
|
300
|
-
className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border-
|
|
296
|
+
onClick: () => P(!N),
|
|
297
|
+
className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border-seam rounded-card bg-bg-surface hover:bg-bg-sunken hover:border-border-strong transition-all duration-200",
|
|
301
298
|
children: [/* @__PURE__ */ h("div", {
|
|
302
299
|
className: "flex items-center gap-3",
|
|
303
300
|
children: [/* @__PURE__ */ m("div", {
|
|
304
301
|
className: "size-9 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center",
|
|
305
|
-
children: /* @__PURE__ */ m(
|
|
302
|
+
children: /* @__PURE__ */ m(ye, { className: "size-4 text-text-link" })
|
|
306
303
|
}), /* @__PURE__ */ h("div", {
|
|
307
304
|
className: "text-left",
|
|
308
305
|
children: [/* @__PURE__ */ h("p", {
|
|
@@ -318,29 +315,29 @@ var g = () => {
|
|
|
318
315
|
}), /* @__PURE__ */ h("p", {
|
|
319
316
|
className: "text-xs text-text-secondary",
|
|
320
317
|
children: [
|
|
321
|
-
|
|
318
|
+
R.length,
|
|
322
319
|
" ",
|
|
323
320
|
_("billing.overview.activeSubscriptions", "active subscriptions")
|
|
324
321
|
]
|
|
325
322
|
})]
|
|
326
323
|
})]
|
|
327
|
-
}), /* @__PURE__ */ m(
|
|
328
|
-
}),
|
|
324
|
+
}), /* @__PURE__ */ m(u, { className: `size-4 text-text-muted transition-transform ${N ? "rotate-180" : ""}` })]
|
|
325
|
+
}), N && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
|
|
329
326
|
className: "fixed inset-0 z-10",
|
|
330
|
-
onClick: () =>
|
|
327
|
+
onClick: () => P(!1)
|
|
331
328
|
}), /* @__PURE__ */ m("div", {
|
|
332
|
-
className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-bg-elevated border border-border-
|
|
333
|
-
children:
|
|
329
|
+
className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-bg-elevated border border-border-seam rounded-card shadow-elevation-3 z-20 py-1 max-h-60 overflow-y-auto",
|
|
330
|
+
children: R.map((e, t) => /* @__PURE__ */ h("button", {
|
|
334
331
|
type: "button",
|
|
335
332
|
onClick: () => {
|
|
336
|
-
|
|
333
|
+
M(t), P(!1);
|
|
337
334
|
},
|
|
338
335
|
className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
|
|
339
336
|
children: [/* @__PURE__ */ h("div", {
|
|
340
337
|
className: "flex items-center gap-3 min-w-0",
|
|
341
338
|
children: [/* @__PURE__ */ m("div", {
|
|
342
339
|
className: "size-9 rounded-lg bg-bg-sunken flex items-center justify-center flex-shrink-0",
|
|
343
|
-
children: /* @__PURE__ */ m(
|
|
340
|
+
children: /* @__PURE__ */ m(ye, { className: "size-4 text-text-secondary" })
|
|
344
341
|
}), /* @__PURE__ */ h("div", {
|
|
345
342
|
className: "text-left min-w-0",
|
|
346
343
|
children: [/* @__PURE__ */ m("p", {
|
|
@@ -358,32 +355,32 @@ var g = () => {
|
|
|
358
355
|
]
|
|
359
356
|
})]
|
|
360
357
|
})]
|
|
361
|
-
}),
|
|
358
|
+
}), j === t && /* @__PURE__ */ m(l, { className: "size-4 text-text-link flex-shrink-0" })]
|
|
362
359
|
}, e.id))
|
|
363
360
|
})] })]
|
|
364
361
|
}), /* @__PURE__ */ m(de, {
|
|
365
362
|
dataTour: "billing-overview-active-subscription-card",
|
|
366
363
|
subscription: Z,
|
|
367
|
-
onViewDetails: () => Z && Q(i(`/subscriptions/${Z.id}`, Z.billingAccountId ??
|
|
368
|
-
onUpgrade: () => Z && Q(i(`/subscriptions/${Z.id}/upgrade`, Z.billingAccountId ??
|
|
369
|
-
onManage: () =>
|
|
364
|
+
onViewDetails: () => Z && Q(i(`/subscriptions/${Z.id}`, Z.billingAccountId ?? I?.id)),
|
|
365
|
+
onUpgrade: () => Z && Q(i(`/subscriptions/${Z.id}/upgrade`, Z.billingAccountId ?? I?.id)),
|
|
366
|
+
onManage: () => I && Q(`/subscriptions?billingAccountId=${I.id}`),
|
|
370
367
|
onPurchasePlan: () => Q("/plans")
|
|
371
368
|
})]
|
|
372
369
|
}),
|
|
373
|
-
|
|
370
|
+
I && /* @__PURE__ */ m(ue, {
|
|
374
371
|
dataTour: "billing-overview-payment-methods-section",
|
|
375
|
-
paymentMethods:
|
|
376
|
-
billingAccountId:
|
|
377
|
-
onAddPaymentMethod:
|
|
378
|
-
onSetDefault:
|
|
379
|
-
onDelete:
|
|
380
|
-
isLoading:
|
|
372
|
+
paymentMethods: L,
|
|
373
|
+
billingAccountId: I.id,
|
|
374
|
+
onAddPaymentMethod: Re,
|
|
375
|
+
onSetDefault: Be,
|
|
376
|
+
onDelete: Ve,
|
|
377
|
+
isLoading: B
|
|
381
378
|
})
|
|
382
379
|
]
|
|
383
380
|
}), /* @__PURE__ */ h("div", {
|
|
384
381
|
className: "space-y-6",
|
|
385
382
|
children: [/* @__PURE__ */ h("section", {
|
|
386
|
-
className: "border border-border-
|
|
383
|
+
className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 p-5",
|
|
387
384
|
"data-tour": "billing-overview-quick-actions",
|
|
388
385
|
children: [/* @__PURE__ */ m("h3", {
|
|
389
386
|
className: "font-semibold text-text-primary mb-4",
|
|
@@ -393,8 +390,8 @@ var g = () => {
|
|
|
393
390
|
children: [
|
|
394
391
|
/* @__PURE__ */ h("button", {
|
|
395
392
|
type: "button",
|
|
396
|
-
onClick: () =>
|
|
397
|
-
disabled: !
|
|
393
|
+
onClick: () => I && Q(`/transactions/${I.id}`),
|
|
394
|
+
disabled: !I,
|
|
398
395
|
className: "w-full flex items-center gap-3 px-3 py-2.5 text-sm text-left text-text-primary hover:bg-bg-sunken rounded-button transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
399
396
|
children: [/* @__PURE__ */ m("div", {
|
|
400
397
|
className: "size-9 rounded-lg bg-status-info-bg-subtle flex items-center justify-center",
|
|
@@ -403,8 +400,8 @@ var g = () => {
|
|
|
403
400
|
}),
|
|
404
401
|
/* @__PURE__ */ h("button", {
|
|
405
402
|
type: "button",
|
|
406
|
-
onClick: () =>
|
|
407
|
-
disabled: !
|
|
403
|
+
onClick: () => I && Q(`/creditTransactions/${I.id}`),
|
|
404
|
+
disabled: !I,
|
|
408
405
|
className: "w-full flex items-center gap-3 px-3 py-2.5 text-sm text-left text-text-primary hover:bg-bg-sunken rounded-button transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
409
406
|
children: [/* @__PURE__ */ m("div", {
|
|
410
407
|
className: "size-9 rounded-lg bg-status-warning-bg-subtle flex items-center justify-center",
|
|
@@ -417,13 +414,13 @@ var g = () => {
|
|
|
417
414
|
className: "w-full flex items-center gap-3 px-3 py-2.5 text-sm text-left text-text-primary hover:bg-bg-sunken rounded-button transition-colors",
|
|
418
415
|
children: [/* @__PURE__ */ m("div", {
|
|
419
416
|
className: "size-9 rounded-lg bg-status-success-bg-subtle flex items-center justify-center",
|
|
420
|
-
children: /* @__PURE__ */ m(
|
|
417
|
+
children: /* @__PURE__ */ m(ve, { className: "size-4 text-status-success-text" })
|
|
421
418
|
}), "Purchase Credits"]
|
|
422
419
|
}),
|
|
423
420
|
/* @__PURE__ */ h("button", {
|
|
424
421
|
type: "button",
|
|
425
|
-
onClick: () =>
|
|
426
|
-
disabled: !
|
|
422
|
+
onClick: () => I && Q(`/usage?billingAccountId=${I.id}`),
|
|
423
|
+
disabled: !I,
|
|
427
424
|
className: "w-full flex items-center gap-3 px-3 py-2.5 text-sm text-left text-text-primary hover:bg-bg-sunken rounded-button transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
428
425
|
children: [/* @__PURE__ */ m("div", {
|
|
429
426
|
className: "size-9 rounded-lg bg-[var(--color-accent-soft)] flex items-center justify-center",
|
|
@@ -432,8 +429,8 @@ var g = () => {
|
|
|
432
429
|
})
|
|
433
430
|
]
|
|
434
431
|
})]
|
|
435
|
-
}), !
|
|
436
|
-
className: "
|
|
432
|
+
}), !z && /* @__PURE__ */ h(De, {
|
|
433
|
+
className: "p-5",
|
|
437
434
|
children: [/* @__PURE__ */ h("div", {
|
|
438
435
|
className: "flex items-start gap-3 mb-4",
|
|
439
436
|
children: [/* @__PURE__ */ m("div", {
|
|
@@ -446,10 +443,10 @@ var g = () => {
|
|
|
446
443
|
className: "text-sm text-text-secondary mt-1",
|
|
447
444
|
children: "Choose a plan that fits your needs to unlock all features"
|
|
448
445
|
})] })]
|
|
449
|
-
}), /* @__PURE__ */ h(
|
|
446
|
+
}), /* @__PURE__ */ h(Te, {
|
|
450
447
|
type: "button",
|
|
451
448
|
onClick: () => Q("/plans"),
|
|
452
|
-
className: "w-full
|
|
449
|
+
className: "w-full",
|
|
453
450
|
children: ["Browse Plans", /* @__PURE__ */ m(_e, { className: "size-4" })]
|
|
454
451
|
})]
|
|
455
452
|
})]
|
|
@@ -457,18 +454,18 @@ var g = () => {
|
|
|
457
454
|
}),
|
|
458
455
|
/* @__PURE__ */ m(fe, {
|
|
459
456
|
dataTour: "billing-overview-recommended-addons",
|
|
460
|
-
addons:
|
|
461
|
-
hasSubscription:
|
|
457
|
+
addons: je,
|
|
458
|
+
hasSubscription: z,
|
|
462
459
|
onViewAddon: (e) => Q(`/addons/${e}`),
|
|
463
460
|
onPurchaseAddon: (e) => Q(`/addons/${e}?action=purchase`),
|
|
464
461
|
onViewAllAddons: () => Q("/addons"),
|
|
465
|
-
onAddToCart:
|
|
466
|
-
isInCart:
|
|
467
|
-
getCartQuantity:
|
|
468
|
-
onUpdateQuantity:
|
|
469
|
-
onRemoveFromCart:
|
|
462
|
+
onAddToCart: We,
|
|
463
|
+
isInCart: Ge,
|
|
464
|
+
getCartQuantity: Ke,
|
|
465
|
+
onUpdateQuantity: qe,
|
|
466
|
+
onRemoveFromCart: Je,
|
|
470
467
|
maxAddons: 3,
|
|
471
|
-
isLoading:
|
|
468
|
+
isLoading: Me
|
|
472
469
|
}),
|
|
473
470
|
/* @__PURE__ */ m(he, {}),
|
|
474
471
|
/* @__PURE__ */ m(r, {
|
|
@@ -476,17 +473,17 @@ var g = () => {
|
|
|
476
473
|
onClose: () => {
|
|
477
474
|
T(!1), D(null);
|
|
478
475
|
},
|
|
479
|
-
onSubmit:
|
|
480
|
-
isSubmitting:
|
|
476
|
+
onSubmit: Le,
|
|
477
|
+
isSubmitting: Ie,
|
|
481
478
|
error: E
|
|
482
479
|
}),
|
|
483
|
-
|
|
484
|
-
isOpen:
|
|
480
|
+
I && /* @__PURE__ */ m(pe, {
|
|
481
|
+
isOpen: Ae,
|
|
485
482
|
onClose: () => A(!1),
|
|
486
|
-
billingAccountId:
|
|
487
|
-
currency:
|
|
488
|
-
country:
|
|
489
|
-
onSuccess:
|
|
483
|
+
billingAccountId: I.id,
|
|
484
|
+
currency: I.currency,
|
|
485
|
+
country: I.billingAddresses?.[0]?.country,
|
|
486
|
+
onSuccess: ze
|
|
490
487
|
})
|
|
491
488
|
]
|
|
492
489
|
}) : /* @__PURE__ */ m(t, { message: "You don't have permission to view billing information." });
|