@burdenoff/microfe-billing 2026.624.1 → 2026.624.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/modules/affiliate/pages/AffiliateDashboardPage.js +125 -150
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +146 -153
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +164 -179
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js +1 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +229 -291
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +69 -74
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +142 -148
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/SettingsPage.js +125 -117
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +78 -66
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +68 -83
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js.map +1 -1
- package/dist/billing/shared/ui/MetricCard.js +1 -1
- package/dist/billing/shared/ui/MetricCard.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,41 +10,41 @@ import { ArchiveBillingAccountSettingsDocument as re, useGetBillingAccountSettin
|
|
|
10
10
|
import { useCallback as r, useEffect as le, useMemo as i, useState as a } from "react";
|
|
11
11
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
12
12
|
import { useI18n as l } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
13
|
-
import {
|
|
13
|
+
import { AlertDialog as u, AlertDialogAction as ue, AlertDialogCancel as de, AlertDialogContent as fe, AlertDialogDescription as pe, AlertDialogFooter as me, AlertDialogHeader as he, AlertDialogTitle as ge, OptionalFields as _e } from "@burdenoff/fe-libs/ui";
|
|
14
14
|
//#region src/billing/modules/settings/pages/SettingsPage.tsx
|
|
15
|
-
var
|
|
15
|
+
var ve = () => {
|
|
16
16
|
if (!(typeof window > "u")) return new URLSearchParams(window.location.search).get("billingAccountId") || void 0;
|
|
17
|
-
},
|
|
18
|
-
let { t:
|
|
19
|
-
let n =
|
|
17
|
+
}, d = () => {
|
|
18
|
+
let { t: d } = l(), f = (e, t) => {
|
|
19
|
+
let n = d(e);
|
|
20
20
|
return n === e ? t : n;
|
|
21
|
-
},
|
|
21
|
+
}, p = ne(), { apiGatewayUrl: m, authToken: h, orgId: g } = e(), { emit: _ } = ee(), [v, y] = a(ve), [b, x] = a(!1), [S, C] = a(!1), [w, T] = a(!1), [ye, E] = a(!1), [D, O] = a(null), [be, k] = a(!1), [A, j] = a(!1), [M, N] = a(!1), [P, F] = a({
|
|
22
22
|
name: "",
|
|
23
23
|
email: "",
|
|
24
24
|
billingEmail: "",
|
|
25
25
|
currency: "USD",
|
|
26
26
|
taxId: "",
|
|
27
27
|
isDefault: !1
|
|
28
|
-
}), { data:
|
|
29
|
-
variables: { id:
|
|
30
|
-
skip: !
|
|
31
|
-
}), W =
|
|
32
|
-
if (
|
|
28
|
+
}), { data: I, loading: xe, refetch: L } = ae({}), R = i(() => I?.getBillingAccountsByOrg || [], [I?.getBillingAccountsByOrg]), { data: Se, loading: Ce, refetch: z } = oe({}), B = Se?.getDefaultBillingAccount || null, { data: V, loading: H, refetch: U } = ie({
|
|
29
|
+
variables: { id: v },
|
|
30
|
+
skip: !v
|
|
31
|
+
}), W = V?.getBillingAccount || null, [G] = ce(), [K] = se(), q = i(() => {
|
|
32
|
+
if (v) {
|
|
33
33
|
if (W) return W;
|
|
34
|
-
let e =
|
|
34
|
+
let e = R.find((e) => e.id === v);
|
|
35
35
|
if (e) return e;
|
|
36
36
|
if (H) return null;
|
|
37
37
|
}
|
|
38
|
-
return
|
|
38
|
+
return B;
|
|
39
39
|
}, [
|
|
40
|
-
|
|
40
|
+
v,
|
|
41
41
|
W,
|
|
42
|
-
|
|
42
|
+
R,
|
|
43
43
|
H,
|
|
44
|
-
|
|
45
|
-
]),
|
|
44
|
+
B
|
|
45
|
+
]), we = xe || Ce || v && H;
|
|
46
46
|
le(() => {
|
|
47
|
-
q &&
|
|
47
|
+
q && F({
|
|
48
48
|
name: q.name || "",
|
|
49
49
|
email: q.email || "",
|
|
50
50
|
billingEmail: q.billingEmail || "",
|
|
@@ -53,96 +53,94 @@ var d = () => {
|
|
|
53
53
|
isDefault: q.isDefault || !1
|
|
54
54
|
});
|
|
55
55
|
}, [q]);
|
|
56
|
-
let
|
|
57
|
-
|
|
56
|
+
let Te = (e) => {
|
|
57
|
+
y(e.id), x(!1), k(!1), O(null);
|
|
58
58
|
}, J = (e, t) => {
|
|
59
|
-
|
|
59
|
+
F((n) => ({
|
|
60
60
|
...n,
|
|
61
61
|
[e]: t
|
|
62
62
|
})), k(!1), O(null);
|
|
63
|
-
}, Y = i(() =>
|
|
63
|
+
}, Y = i(() => R.find((e) => e.isDefault) || null, [R]), Ee = i(() => q ? P.name !== (q.name || "") || P.email !== (q.email || "") || P.billingEmail !== (q.billingEmail || "") || P.currency !== (q.currency || "USD") || P.taxId !== (q.taxId || "") || P.isDefault !== (q.isDefault || !1) : !1, [P, q]), X = P.isDefault && !q?.isDefault, Z = X && Y && Y.id !== q?.id, Q = r(async () => {
|
|
64
64
|
if (q?.id) {
|
|
65
|
-
|
|
65
|
+
C(!0), O(null), k(!1), j(!1), N(!1);
|
|
66
66
|
try {
|
|
67
67
|
await G({ variables: { input: {
|
|
68
68
|
id: q.id,
|
|
69
|
-
name:
|
|
70
|
-
email:
|
|
71
|
-
billingEmail:
|
|
72
|
-
currency:
|
|
73
|
-
taxId:
|
|
74
|
-
} } }),
|
|
69
|
+
name: P.name,
|
|
70
|
+
email: P.email,
|
|
71
|
+
billingEmail: P.billingEmail || null,
|
|
72
|
+
currency: P.currency,
|
|
73
|
+
taxId: P.taxId || null
|
|
74
|
+
} } }), _("billing.billing_account.updated", {
|
|
75
75
|
route: "/billing/settings",
|
|
76
76
|
entityId: q.id,
|
|
77
77
|
source: "settings"
|
|
78
78
|
}), X && (await K({
|
|
79
79
|
variables: { id: q.id },
|
|
80
80
|
refetchQueries: ["GetBillingAccountsByTenant", "GetDefaultBillingAccount"]
|
|
81
|
-
}),
|
|
81
|
+
}), _("billing.billing_account.updated", {
|
|
82
82
|
route: "/billing/settings",
|
|
83
83
|
entityId: q.id,
|
|
84
84
|
source: "settings.default"
|
|
85
|
-
})),
|
|
85
|
+
})), v ? await U() : await z(), k(!0), setTimeout(() => k(!1), 3e3);
|
|
86
86
|
} catch (e) {
|
|
87
87
|
O(e instanceof Error ? e.message : "Failed to save changes");
|
|
88
88
|
} finally {
|
|
89
|
-
|
|
89
|
+
C(!1);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}, [
|
|
93
93
|
q?.id,
|
|
94
|
-
|
|
94
|
+
P,
|
|
95
95
|
X,
|
|
96
96
|
G,
|
|
97
97
|
K,
|
|
98
|
-
|
|
98
|
+
v,
|
|
99
99
|
U,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
]),
|
|
103
|
-
q?.id && (Z ? (
|
|
100
|
+
z,
|
|
101
|
+
_
|
|
102
|
+
]), De = r(() => {
|
|
103
|
+
q?.id && (Z ? (N(!0), j(!0)) : Q());
|
|
104
104
|
}, [
|
|
105
105
|
q?.id,
|
|
106
106
|
Z,
|
|
107
107
|
Q
|
|
108
|
-
]),
|
|
109
|
-
if (!q?.id || !q.isActive)
|
|
110
|
-
|
|
111
|
-
if (window.confirm(q.isDefault ? `Archive ${q.name}? ${e ? `${e.name} will become the default account.` : "No replacement default account is available."}` : `Archive ${q.name}?`)) {
|
|
112
|
-
E(!0), O(null), k(!1);
|
|
108
|
+
]), $ = i(() => q ? R.find((e) => e.id !== q.id && e.isActive) : void 0, [q, R]), Oe = q ? q.isDefault ? `Archive ${q.name}? ${$ ? `${$.name} will become the default account.` : "No replacement default account is available."}` : `Archive ${q.name}?` : "", ke = r(async () => {
|
|
109
|
+
if (!(!q?.id || !q.isActive)) {
|
|
110
|
+
T(!0), O(null), k(!1);
|
|
113
111
|
try {
|
|
114
112
|
await te({
|
|
115
|
-
apiGatewayUrl:
|
|
116
|
-
authToken:
|
|
117
|
-
orgId:
|
|
113
|
+
apiGatewayUrl: m,
|
|
114
|
+
authToken: h,
|
|
115
|
+
orgId: g,
|
|
118
116
|
query: re,
|
|
119
117
|
variables: {
|
|
120
118
|
id: q.id,
|
|
121
119
|
reason: "Archived from billing settings",
|
|
122
|
-
replacementDefaultBillingAccountId: q.isDefault ?
|
|
120
|
+
replacementDefaultBillingAccountId: q.isDefault ? $?.id ?? null : null
|
|
123
121
|
}
|
|
124
|
-
}),
|
|
122
|
+
}), _("billing.billing_account.archived", {
|
|
125
123
|
route: "/billing/settings",
|
|
126
124
|
entityId: q.id,
|
|
127
125
|
source: "settings"
|
|
128
|
-
}), await Promise.all([
|
|
126
|
+
}), await Promise.all([L(), z()]), y($?.id), k(!0), setTimeout(() => k(!1), 3e3);
|
|
129
127
|
} catch (e) {
|
|
130
128
|
O(e instanceof Error ? e.message : "Failed to archive billing account");
|
|
131
129
|
} finally {
|
|
132
|
-
|
|
130
|
+
T(!1);
|
|
133
131
|
}
|
|
134
132
|
}
|
|
135
133
|
}, [
|
|
134
|
+
m,
|
|
136
135
|
h,
|
|
137
|
-
g,
|
|
138
136
|
q,
|
|
137
|
+
$,
|
|
138
|
+
g,
|
|
139
139
|
L,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
B,
|
|
143
|
-
v
|
|
140
|
+
z,
|
|
141
|
+
_
|
|
144
142
|
]);
|
|
145
|
-
return
|
|
143
|
+
return p.canManageBillingAccount ? we && !q ? /* @__PURE__ */ c("div", {
|
|
146
144
|
className: "space-y-6 p-6",
|
|
147
145
|
children: [/* @__PURE__ */ s("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ s("div", {
|
|
148
146
|
className: "border border-border-subtle rounded-lg p-6 space-y-4",
|
|
@@ -156,14 +154,14 @@ var d = () => {
|
|
|
156
154
|
className: "space-y-6 p-6",
|
|
157
155
|
children: [
|
|
158
156
|
/* @__PURE__ */ s(n, {
|
|
159
|
-
title:
|
|
160
|
-
description:
|
|
157
|
+
title: f("billing.settings.billingSettings", "Billing Settings"),
|
|
158
|
+
description: f("billing.settings.description", "Manage your billing account configuration")
|
|
161
159
|
}),
|
|
162
|
-
|
|
160
|
+
R.length > 1 && /* @__PURE__ */ c("div", {
|
|
163
161
|
className: "relative",
|
|
164
162
|
children: [/* @__PURE__ */ c("button", {
|
|
165
163
|
type: "button",
|
|
166
|
-
onClick: () =>
|
|
164
|
+
onClick: () => x(!b),
|
|
167
165
|
className: "w-full sm:w-auto flex items-center justify-between gap-3 px-4 py-3 border border-border-subtle rounded-lg bg-bg-surface hover:bg-bg-sunken/50 transition-colors",
|
|
168
166
|
children: [/* @__PURE__ */ c("div", {
|
|
169
167
|
className: "flex items-center gap-3",
|
|
@@ -185,14 +183,14 @@ var d = () => {
|
|
|
185
183
|
className: "text-left",
|
|
186
184
|
children: [/* @__PURE__ */ s("p", {
|
|
187
185
|
className: "text-sm font-medium text-text-primary",
|
|
188
|
-
children: q?.name ||
|
|
186
|
+
children: q?.name || f("billing.settings.selectAccount", "Select Account")
|
|
189
187
|
}), /* @__PURE__ */ s("p", {
|
|
190
188
|
className: "text-xs text-text-secondary",
|
|
191
189
|
children: q?.email
|
|
192
190
|
})]
|
|
193
191
|
})]
|
|
194
192
|
}), /* @__PURE__ */ s("svg", {
|
|
195
|
-
className: `size-4 text-text-secondary transition-transform ${
|
|
193
|
+
className: `size-4 text-text-secondary transition-transform ${b ? "rotate-180" : ""}`,
|
|
196
194
|
fill: "none",
|
|
197
195
|
viewBox: "0 0 24 24",
|
|
198
196
|
stroke: "currentColor",
|
|
@@ -203,14 +201,14 @@ var d = () => {
|
|
|
203
201
|
d: "M19 9l-7 7-7-7"
|
|
204
202
|
})
|
|
205
203
|
})]
|
|
206
|
-
}),
|
|
204
|
+
}), b && /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", {
|
|
207
205
|
className: "fixed inset-0 z-10",
|
|
208
|
-
onClick: () =>
|
|
206
|
+
onClick: () => x(!1)
|
|
209
207
|
}), /* @__PURE__ */ s("div", {
|
|
210
208
|
className: "absolute top-full left-0 right-0 sm:right-auto mt-1 w-full sm:w-80 bg-popover border border-border-subtle rounded-lg shadow-lg z-20 py-1 max-h-60 overflow-y-auto",
|
|
211
|
-
children:
|
|
209
|
+
children: R.map((e) => /* @__PURE__ */ c("button", {
|
|
212
210
|
type: "button",
|
|
213
|
-
onClick: () =>
|
|
211
|
+
onClick: () => Te(e),
|
|
214
212
|
className: "w-full flex items-center justify-between gap-3 px-4 py-3 hover:bg-bg-sunken transition-colors",
|
|
215
213
|
children: [/* @__PURE__ */ c("div", {
|
|
216
214
|
className: "flex items-center gap-3 min-w-0",
|
|
@@ -261,10 +259,10 @@ var d = () => {
|
|
|
261
259
|
className: "flex items-center justify-between",
|
|
262
260
|
children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("h2", {
|
|
263
261
|
className: "text-lg font-semibold text-text-primary",
|
|
264
|
-
children:
|
|
262
|
+
children: f("billing.settings.accountInfo", "Account Information")
|
|
265
263
|
}), /* @__PURE__ */ s("p", {
|
|
266
264
|
className: "text-sm text-text-secondary mt-1",
|
|
267
|
-
children:
|
|
265
|
+
children: f("billing.settings.accountInfoDescription", "Update your billing contact details and tax information")
|
|
268
266
|
})] }), q?.isDefault && /* @__PURE__ */ c("span", {
|
|
269
267
|
className: "inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium bg-action-primary-bg/10 text-primary rounded-full",
|
|
270
268
|
children: [/* @__PURE__ */ s("svg", {
|
|
@@ -276,7 +274,7 @@ var d = () => {
|
|
|
276
274
|
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
|
|
277
275
|
clipRule: "evenodd"
|
|
278
276
|
})
|
|
279
|
-
}),
|
|
277
|
+
}), f("billing.settings.defaultAccount", "Default Account")]
|
|
280
278
|
})]
|
|
281
279
|
})
|
|
282
280
|
}), /* @__PURE__ */ c("div", {
|
|
@@ -287,21 +285,21 @@ var d = () => {
|
|
|
287
285
|
children: [
|
|
288
286
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("p", {
|
|
289
287
|
className: "text-text-secondary",
|
|
290
|
-
children:
|
|
288
|
+
children: f("billing.settings.status", "Status")
|
|
291
289
|
}), /* @__PURE__ */ s("p", {
|
|
292
290
|
className: `font-medium ${q.isActive ? "text-status-success-text" : "text-status-error-text"}`,
|
|
293
|
-
children: q.isActive ?
|
|
291
|
+
children: q.isActive ? f("billing.settings.active", "Active") : f("billing.settings.inactive", "Inactive")
|
|
294
292
|
})] }),
|
|
295
293
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("p", {
|
|
296
294
|
className: "text-text-secondary",
|
|
297
|
-
children:
|
|
295
|
+
children: f("billing.settings.creditBalance", "Credit Balance")
|
|
298
296
|
}), /* @__PURE__ */ c("p", {
|
|
299
297
|
className: "font-medium text-text-primary",
|
|
300
298
|
children: [(q.creditAmount || 0).toLocaleString(), " Credits"]
|
|
301
299
|
})] }),
|
|
302
300
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("p", {
|
|
303
301
|
className: "text-text-secondary",
|
|
304
|
-
children:
|
|
302
|
+
children: f("billing.settings.accountId", "Account ID")
|
|
305
303
|
}), /* @__PURE__ */ s("p", {
|
|
306
304
|
className: "font-mono text-xs text-text-primary truncate",
|
|
307
305
|
title: q.id,
|
|
@@ -309,23 +307,23 @@ var d = () => {
|
|
|
309
307
|
})] }),
|
|
310
308
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("p", {
|
|
311
309
|
className: "text-text-secondary",
|
|
312
|
-
children:
|
|
310
|
+
children: f("billing.settings.created", "Created")
|
|
313
311
|
}), /* @__PURE__ */ s("p", {
|
|
314
312
|
className: "font-medium text-text-primary",
|
|
315
|
-
children: q.createdAt ? new Date(q.createdAt).toLocaleDateString() :
|
|
313
|
+
children: q.createdAt ? new Date(q.createdAt).toLocaleDateString() : f("billing.settings.notAvailable", "N/A")
|
|
316
314
|
})] })
|
|
317
315
|
]
|
|
318
316
|
}),
|
|
319
317
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("h3", {
|
|
320
318
|
className: "text-sm font-medium text-text-primary mb-4",
|
|
321
|
-
children:
|
|
319
|
+
children: f("billing.settings.contactDetails", "Contact Details")
|
|
322
320
|
}), /* @__PURE__ */ c("div", {
|
|
323
321
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
324
322
|
children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ c("label", {
|
|
325
323
|
htmlFor: "billing-account-name",
|
|
326
324
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
327
325
|
children: [
|
|
328
|
-
|
|
326
|
+
f("billing.settings.accountName", "Account Name"),
|
|
329
327
|
" ",
|
|
330
328
|
/* @__PURE__ */ s("span", {
|
|
331
329
|
className: "text-status-error-text",
|
|
@@ -335,14 +333,14 @@ var d = () => {
|
|
|
335
333
|
}), /* @__PURE__ */ s("input", {
|
|
336
334
|
id: "billing-account-name",
|
|
337
335
|
type: "text",
|
|
338
|
-
value:
|
|
336
|
+
value: P.name,
|
|
339
337
|
onChange: (e) => J("name", e.target.value),
|
|
340
338
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
341
339
|
})] }), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ c("label", {
|
|
342
340
|
htmlFor: "billing-account-email",
|
|
343
341
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
344
342
|
children: [
|
|
345
|
-
|
|
343
|
+
f("billing.settings.email", "Email"),
|
|
346
344
|
" ",
|
|
347
345
|
/* @__PURE__ */ s("span", {
|
|
348
346
|
className: "text-status-error-text",
|
|
@@ -352,14 +350,14 @@ var d = () => {
|
|
|
352
350
|
}), /* @__PURE__ */ s("input", {
|
|
353
351
|
id: "billing-account-email",
|
|
354
352
|
type: "email",
|
|
355
|
-
value:
|
|
353
|
+
value: P.email,
|
|
356
354
|
onChange: (e) => J("email", e.target.value),
|
|
357
355
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
358
356
|
})] })]
|
|
359
357
|
})] }),
|
|
360
|
-
/* @__PURE__ */ s(
|
|
361
|
-
title:
|
|
362
|
-
description:
|
|
358
|
+
/* @__PURE__ */ s(_e, {
|
|
359
|
+
title: f("billing.settings.advancedTitle", "Advanced settings"),
|
|
360
|
+
description: f("billing.settings.advancedDescription", "Billing email override, currency, and tax identification."),
|
|
363
361
|
children: /* @__PURE__ */ c("div", {
|
|
364
362
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
365
363
|
children: [
|
|
@@ -367,28 +365,28 @@ var d = () => {
|
|
|
367
365
|
/* @__PURE__ */ s("label", {
|
|
368
366
|
htmlFor: "billing-account-billing-email",
|
|
369
367
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
370
|
-
children:
|
|
368
|
+
children: f("billing.settings.billingEmail", "Billing Email")
|
|
371
369
|
}),
|
|
372
370
|
/* @__PURE__ */ s("input", {
|
|
373
371
|
id: "billing-account-billing-email",
|
|
374
372
|
type: "email",
|
|
375
|
-
value:
|
|
373
|
+
value: P.billingEmail,
|
|
376
374
|
onChange: (e) => J("billingEmail", e.target.value),
|
|
377
|
-
placeholder:
|
|
375
|
+
placeholder: f("billing.settings.billingEmailPlaceholder", "Optional - defaults to account email"),
|
|
378
376
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
379
377
|
}),
|
|
380
378
|
/* @__PURE__ */ s("p", {
|
|
381
379
|
className: "text-xs text-text-secondary mt-1",
|
|
382
|
-
children:
|
|
380
|
+
children: f("billing.settings.billingEmailHelp", "Invoices will be sent to this email if provided")
|
|
383
381
|
})
|
|
384
382
|
] }),
|
|
385
383
|
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
|
|
386
384
|
htmlFor: "billing-account-currency",
|
|
387
385
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
388
|
-
children:
|
|
386
|
+
children: f("billing.settings.currency", "Currency")
|
|
389
387
|
}), /* @__PURE__ */ c("select", {
|
|
390
388
|
id: "billing-account-currency",
|
|
391
|
-
value:
|
|
389
|
+
value: P.currency,
|
|
392
390
|
onChange: (e) => J("currency", e.target.value),
|
|
393
391
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",
|
|
394
392
|
children: [
|
|
@@ -416,26 +414,26 @@ var d = () => {
|
|
|
416
414
|
/* @__PURE__ */ s("label", {
|
|
417
415
|
htmlFor: "billing-account-tax-id",
|
|
418
416
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
419
|
-
children:
|
|
417
|
+
children: f("billing.settings.taxId", "Tax ID / VAT Number")
|
|
420
418
|
}),
|
|
421
419
|
/* @__PURE__ */ s("input", {
|
|
422
420
|
id: "billing-account-tax-id",
|
|
423
421
|
type: "text",
|
|
424
|
-
value:
|
|
422
|
+
value: P.taxId,
|
|
425
423
|
onChange: (e) => J("taxId", e.target.value),
|
|
426
|
-
placeholder:
|
|
424
|
+
placeholder: f("billing.settings.taxIdPlaceholder", "Enter your tax identification number"),
|
|
427
425
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-md bg-bg-surface text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"
|
|
428
426
|
}),
|
|
429
427
|
/* @__PURE__ */ s("p", {
|
|
430
428
|
className: "text-xs text-text-secondary mt-1",
|
|
431
|
-
children:
|
|
429
|
+
children: f("billing.settings.taxIdHelp", "Used for invoices and tax compliance (e.g., GST, VAT number)")
|
|
432
430
|
})
|
|
433
431
|
]
|
|
434
432
|
})
|
|
435
433
|
]
|
|
436
434
|
})
|
|
437
435
|
}),
|
|
438
|
-
q?.isActive &&
|
|
436
|
+
q?.isActive && R.length > 1 && /* @__PURE__ */ s("div", {
|
|
439
437
|
className: "pt-4 border-t border-border-subtle",
|
|
440
438
|
children: /* @__PURE__ */ c("div", {
|
|
441
439
|
className: "flex items-start gap-3",
|
|
@@ -444,8 +442,8 @@ var d = () => {
|
|
|
444
442
|
children: /* @__PURE__ */ s("input", {
|
|
445
443
|
type: "checkbox",
|
|
446
444
|
id: "isDefault",
|
|
447
|
-
checked:
|
|
448
|
-
onChange: (e) =>
|
|
445
|
+
checked: P.isDefault,
|
|
446
|
+
onChange: (e) => F((t) => ({
|
|
449
447
|
...t,
|
|
450
448
|
isDefault: e.target.checked
|
|
451
449
|
})),
|
|
@@ -457,10 +455,10 @@ var d = () => {
|
|
|
457
455
|
children: [/* @__PURE__ */ s("label", {
|
|
458
456
|
htmlFor: "isDefault",
|
|
459
457
|
className: "text-sm font-medium text-text-primary cursor-pointer",
|
|
460
|
-
children:
|
|
458
|
+
children: f("billing.settings.setDefault", "Set as default billing account")
|
|
461
459
|
}), /* @__PURE__ */ s("p", {
|
|
462
460
|
className: "text-xs text-text-secondary mt-0.5",
|
|
463
|
-
children: q?.isDefault ?
|
|
461
|
+
children: q?.isDefault ? f("billing.settings.currentDefaultDescription", "This is currently your default billing account") : f("billing.settings.makePrimaryDescription", "Make this your primary billing account for new subscriptions")
|
|
464
462
|
})]
|
|
465
463
|
})]
|
|
466
464
|
})
|
|
@@ -469,7 +467,7 @@ var d = () => {
|
|
|
469
467
|
className: "pt-4 border-t border-border-subtle flex items-center justify-between",
|
|
470
468
|
children: [/* @__PURE__ */ c("div", {
|
|
471
469
|
className: "flex items-center gap-2",
|
|
472
|
-
children: [
|
|
470
|
+
children: [be && /* @__PURE__ */ c("div", {
|
|
473
471
|
className: "flex items-center gap-2 text-sm text-status-success-text",
|
|
474
472
|
children: [/* @__PURE__ */ s("svg", {
|
|
475
473
|
className: "size-4",
|
|
@@ -482,7 +480,7 @@ var d = () => {
|
|
|
482
480
|
strokeWidth: 2,
|
|
483
481
|
d: "M5 13l4 4L19 7"
|
|
484
482
|
})
|
|
485
|
-
}),
|
|
483
|
+
}), f("billing.settings.saveSuccess", "Changes saved successfully")]
|
|
486
484
|
}), D && /* @__PURE__ */ c("div", {
|
|
487
485
|
className: "flex items-center gap-2 text-sm text-status-error-text",
|
|
488
486
|
children: [/* @__PURE__ */ s("svg", {
|
|
@@ -500,18 +498,18 @@ var d = () => {
|
|
|
500
498
|
})]
|
|
501
499
|
}), /* @__PURE__ */ c("div", {
|
|
502
500
|
className: "flex items-center gap-3",
|
|
503
|
-
children: [
|
|
501
|
+
children: [p.canArchiveBillingAccount && q?.isActive ? /* @__PURE__ */ s("button", {
|
|
504
502
|
type: "button",
|
|
505
|
-
onClick:
|
|
506
|
-
disabled:
|
|
503
|
+
onClick: () => E(!0),
|
|
504
|
+
disabled: S || w,
|
|
507
505
|
className: "px-4 py-2 text-sm font-medium border border-border-subtle text-status-error-text rounded-md hover:bg-status-error-bg-subtle disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
508
|
-
children:
|
|
506
|
+
children: w ? "Archiving..." : "Archive Account"
|
|
509
507
|
}) : null, /* @__PURE__ */ c("button", {
|
|
510
508
|
type: "button",
|
|
511
|
-
onClick:
|
|
512
|
-
disabled: !
|
|
509
|
+
onClick: De,
|
|
510
|
+
disabled: !Ee || S || w || !P.name || !P.email,
|
|
513
511
|
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center gap-2",
|
|
514
|
-
children: [
|
|
512
|
+
children: [S && /* @__PURE__ */ c("svg", {
|
|
515
513
|
className: "size-4 animate-spin",
|
|
516
514
|
fill: "none",
|
|
517
515
|
viewBox: "0 0 24 24",
|
|
@@ -527,17 +525,17 @@ var d = () => {
|
|
|
527
525
|
fill: "currentColor",
|
|
528
526
|
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
529
527
|
})]
|
|
530
|
-
}),
|
|
528
|
+
}), S ? "Saving..." : "Save Changes"]
|
|
531
529
|
})]
|
|
532
530
|
})]
|
|
533
531
|
})
|
|
534
532
|
]
|
|
535
533
|
})]
|
|
536
534
|
}),
|
|
537
|
-
|
|
535
|
+
A && M && /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", {
|
|
538
536
|
className: "fixed inset-0 bg-overlay-scrim z-40",
|
|
539
537
|
onClick: () => {
|
|
540
|
-
|
|
538
|
+
S || (j(!1), N(!1), F((e) => ({
|
|
541
539
|
...e,
|
|
542
540
|
isDefault: q?.isDefault || !1
|
|
543
541
|
})));
|
|
@@ -595,20 +593,20 @@ var d = () => {
|
|
|
595
593
|
children: [/* @__PURE__ */ s("button", {
|
|
596
594
|
type: "button",
|
|
597
595
|
onClick: () => {
|
|
598
|
-
|
|
596
|
+
j(!1), N(!1), F((e) => ({
|
|
599
597
|
...e,
|
|
600
598
|
isDefault: q?.isDefault || !1
|
|
601
599
|
}));
|
|
602
600
|
},
|
|
603
|
-
disabled:
|
|
601
|
+
disabled: S,
|
|
604
602
|
className: "px-4 py-2 text-sm font-medium text-text-primary border border-border-subtle rounded-md hover:bg-bg-sunken transition-colors disabled:opacity-50",
|
|
605
603
|
children: "Cancel"
|
|
606
604
|
}), /* @__PURE__ */ c("button", {
|
|
607
605
|
type: "button",
|
|
608
606
|
onClick: Q,
|
|
609
|
-
disabled:
|
|
607
|
+
disabled: S,
|
|
610
608
|
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg/90 disabled:opacity-50 transition-colors flex items-center gap-2",
|
|
611
|
-
children: [
|
|
609
|
+
children: [S && /* @__PURE__ */ c("svg", {
|
|
612
610
|
className: "size-4 animate-spin",
|
|
613
611
|
fill: "none",
|
|
614
612
|
viewBox: "0 0 24 24",
|
|
@@ -624,16 +622,26 @@ var d = () => {
|
|
|
624
622
|
fill: "currentColor",
|
|
625
623
|
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
626
624
|
})]
|
|
627
|
-
}),
|
|
625
|
+
}), S ? "Saving..." : "Save Changes"]
|
|
628
626
|
})]
|
|
629
627
|
})
|
|
630
628
|
]
|
|
631
629
|
})
|
|
632
|
-
})] })
|
|
630
|
+
})] }),
|
|
631
|
+
/* @__PURE__ */ s(u, {
|
|
632
|
+
open: ye,
|
|
633
|
+
onOpenChange: E,
|
|
634
|
+
children: /* @__PURE__ */ c(fe, { children: [/* @__PURE__ */ c(he, { children: [/* @__PURE__ */ s(ge, { children: "Archive billing account?" }), /* @__PURE__ */ s(pe, { children: Oe })] }), /* @__PURE__ */ c(me, { children: [/* @__PURE__ */ s(de, { children: "Cancel" }), /* @__PURE__ */ s(ue, {
|
|
635
|
+
onClick: () => {
|
|
636
|
+
E(!1), ke();
|
|
637
|
+
},
|
|
638
|
+
children: "Archive Account"
|
|
639
|
+
})] })] })
|
|
640
|
+
})
|
|
633
641
|
]
|
|
634
642
|
}) : /* @__PURE__ */ s(t, { message: "You don't have permission to manage billing settings." });
|
|
635
643
|
};
|
|
636
644
|
//#endregion
|
|
637
|
-
export {
|
|
645
|
+
export { d as SettingsPage };
|
|
638
646
|
|
|
639
647
|
//# sourceMappingURL=SettingsPage.js.map
|