@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.
Files changed (23) hide show
  1. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +125 -150
  2. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  3. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +146 -153
  4. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  5. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +164 -179
  6. package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
  7. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +1 -1
  8. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
  9. package/dist/billing/modules/earnings/pages/EarningsPage.js +229 -291
  10. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  11. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +69 -74
  12. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  13. package/dist/billing/modules/earnings/pages/PayoutsPage.js +142 -148
  14. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  15. package/dist/billing/modules/settings/pages/SettingsPage.js +125 -117
  16. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  17. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +78 -66
  18. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  19. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +68 -83
  20. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js.map +1 -1
  21. package/dist/billing/shared/ui/MetricCard.js +1 -1
  22. package/dist/billing/shared/ui/MetricCard.js.map +1 -1
  23. 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 { OptionalFields as u } from "@burdenoff/fe-libs/ui";
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 d = () => {
15
+ var ve = () => {
16
16
  if (!(typeof window > "u")) return new URLSearchParams(window.location.search).get("billingAccountId") || void 0;
17
- }, f = () => {
18
- let { t: f } = l(), p = (e, t) => {
19
- let n = f(e);
17
+ }, d = () => {
18
+ let { t: d } = l(), f = (e, t) => {
19
+ let n = d(e);
20
20
  return n === e ? t : n;
21
- }, m = ne(), { apiGatewayUrl: h, authToken: g, orgId: _ } = e(), { emit: v } = ee(), [y, b] = a(d), [x, S] = a(!1), [C, w] = a(!1), [T, E] = a(!1), [D, O] = a(null), [ue, k] = a(!1), [de, A] = a(!1), [fe, j] = a(!1), [M, N] = a({
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: P, loading: F, refetch: I } = ae({}), L = i(() => P?.getBillingAccountsByOrg || [], [P?.getBillingAccountsByOrg]), { data: R, loading: z, refetch: B } = oe({}), V = R?.getDefaultBillingAccount || null, { data: pe, loading: H, refetch: U } = ie({
29
- variables: { id: y },
30
- skip: !y
31
- }), W = pe?.getBillingAccount || null, [G] = ce(), [K] = se(), q = i(() => {
32
- if (y) {
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 = L.find((e) => e.id === y);
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 V;
38
+ return B;
39
39
  }, [
40
- y,
40
+ v,
41
41
  W,
42
- L,
42
+ R,
43
43
  H,
44
- V
45
- ]), me = F || z || y && H;
44
+ B
45
+ ]), we = xe || Ce || v && H;
46
46
  le(() => {
47
- q && N({
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 he = (e) => {
57
- b(e.id), S(!1), k(!1), O(null);
56
+ let Te = (e) => {
57
+ y(e.id), x(!1), k(!1), O(null);
58
58
  }, J = (e, t) => {
59
- N((n) => ({
59
+ F((n) => ({
60
60
  ...n,
61
61
  [e]: t
62
62
  })), k(!1), O(null);
63
- }, Y = i(() => L.find((e) => e.isDefault) || null, [L]), ge = i(() => q ? M.name !== (q.name || "") || M.email !== (q.email || "") || M.billingEmail !== (q.billingEmail || "") || M.currency !== (q.currency || "USD") || M.taxId !== (q.taxId || "") || M.isDefault !== (q.isDefault || !1) : !1, [M, q]), X = M.isDefault && !q?.isDefault, Z = X && Y && Y.id !== q?.id, Q = r(async () => {
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
- w(!0), O(null), k(!1), A(!1), j(!1);
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: M.name,
70
- email: M.email,
71
- billingEmail: M.billingEmail || null,
72
- currency: M.currency,
73
- taxId: M.taxId || null
74
- } } }), v("billing.billing_account.updated", {
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
- }), v("billing.billing_account.updated", {
81
+ }), _("billing.billing_account.updated", {
82
82
  route: "/billing/settings",
83
83
  entityId: q.id,
84
84
  source: "settings.default"
85
- })), y ? await U() : await B(), k(!0), setTimeout(() => k(!1), 3e3);
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
- w(!1);
89
+ C(!1);
90
90
  }
91
91
  }
92
92
  }, [
93
93
  q?.id,
94
- M,
94
+ P,
95
95
  X,
96
96
  G,
97
97
  K,
98
- y,
98
+ v,
99
99
  U,
100
- B,
101
- v
102
- ]), $ = r(() => {
103
- q?.id && (Z ? (j(!0), A(!0)) : Q());
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
- ]), _e = r(async () => {
109
- if (!q?.id || !q.isActive) return;
110
- let e = L.find((e) => e.id !== q.id && e.isActive);
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: h,
116
- authToken: g,
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 ? e?.id ?? null : null
120
+ replacementDefaultBillingAccountId: q.isDefault ? $?.id ?? null : null
123
121
  }
124
- }), v("billing.billing_account.archived", {
122
+ }), _("billing.billing_account.archived", {
125
123
  route: "/billing/settings",
126
124
  entityId: q.id,
127
125
  source: "settings"
128
- }), await Promise.all([I(), B()]), b(e?.id), k(!0), setTimeout(() => k(!1), 3e3);
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
- E(!1);
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
- I,
142
- B,
143
- v
140
+ z,
141
+ _
144
142
  ]);
145
- return m.canManageBillingAccount ? me && !q ? /* @__PURE__ */ c("div", {
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: p("billing.settings.billingSettings", "Billing Settings"),
160
- description: p("billing.settings.description", "Manage your billing account configuration")
157
+ title: f("billing.settings.billingSettings", "Billing Settings"),
158
+ description: f("billing.settings.description", "Manage your billing account configuration")
161
159
  }),
162
- L.length > 1 && /* @__PURE__ */ c("div", {
160
+ R.length > 1 && /* @__PURE__ */ c("div", {
163
161
  className: "relative",
164
162
  children: [/* @__PURE__ */ c("button", {
165
163
  type: "button",
166
- onClick: () => S(!x),
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 || p("billing.settings.selectAccount", "Select Account")
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 ${x ? "rotate-180" : ""}`,
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
- }), x && /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", {
204
+ }), b && /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", {
207
205
  className: "fixed inset-0 z-10",
208
- onClick: () => S(!1)
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: L.map((e) => /* @__PURE__ */ c("button", {
209
+ children: R.map((e) => /* @__PURE__ */ c("button", {
212
210
  type: "button",
213
- onClick: () => he(e),
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: p("billing.settings.accountInfo", "Account Information")
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: p("billing.settings.accountInfoDescription", "Update your billing contact details and tax information")
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
- }), p("billing.settings.defaultAccount", "Default Account")]
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: p("billing.settings.status", "Status")
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 ? p("billing.settings.active", "Active") : p("billing.settings.inactive", "Inactive")
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: p("billing.settings.creditBalance", "Credit Balance")
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: p("billing.settings.accountId", "Account ID")
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: p("billing.settings.created", "Created")
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() : p("billing.settings.notAvailable", "N/A")
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: p("billing.settings.contactDetails", "Contact Details")
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
- p("billing.settings.accountName", "Account Name"),
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: M.name,
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
- p("billing.settings.email", "Email"),
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: M.email,
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(u, {
361
- title: p("billing.settings.advancedTitle", "Advanced settings"),
362
- description: p("billing.settings.advancedDescription", "Billing email override, currency, and tax identification."),
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: p("billing.settings.billingEmail", "Billing Email")
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: M.billingEmail,
373
+ value: P.billingEmail,
376
374
  onChange: (e) => J("billingEmail", e.target.value),
377
- placeholder: p("billing.settings.billingEmailPlaceholder", "Optional - defaults to account email"),
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: p("billing.settings.billingEmailHelp", "Invoices will be sent to this email if provided")
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: p("billing.settings.currency", "Currency")
386
+ children: f("billing.settings.currency", "Currency")
389
387
  }), /* @__PURE__ */ c("select", {
390
388
  id: "billing-account-currency",
391
- value: M.currency,
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: p("billing.settings.taxId", "Tax ID / VAT Number")
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: M.taxId,
422
+ value: P.taxId,
425
423
  onChange: (e) => J("taxId", e.target.value),
426
- placeholder: p("billing.settings.taxIdPlaceholder", "Enter your tax identification number"),
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: p("billing.settings.taxIdHelp", "Used for invoices and tax compliance (e.g., GST, VAT number)")
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 && L.length > 1 && /* @__PURE__ */ s("div", {
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: M.isDefault,
448
- onChange: (e) => N((t) => ({
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: p("billing.settings.setDefault", "Set as default billing account")
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 ? p("billing.settings.currentDefaultDescription", "This is currently your default billing account") : p("billing.settings.makePrimaryDescription", "Make this your primary billing account for new subscriptions")
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: [ue && /* @__PURE__ */ c("div", {
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
- }), p("billing.settings.saveSuccess", "Changes saved successfully")]
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: [m.canArchiveBillingAccount && q?.isActive ? /* @__PURE__ */ s("button", {
501
+ children: [p.canArchiveBillingAccount && q?.isActive ? /* @__PURE__ */ s("button", {
504
502
  type: "button",
505
- onClick: _e,
506
- disabled: C || T,
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: T ? "Archiving..." : "Archive Account"
506
+ children: w ? "Archiving..." : "Archive Account"
509
507
  }) : null, /* @__PURE__ */ c("button", {
510
508
  type: "button",
511
- onClick: $,
512
- disabled: !ge || C || T || !M.name || !M.email,
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: [C && /* @__PURE__ */ c("svg", {
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
- }), C ? "Saving..." : "Save Changes"]
528
+ }), S ? "Saving..." : "Save Changes"]
531
529
  })]
532
530
  })]
533
531
  })
534
532
  ]
535
533
  })]
536
534
  }),
537
- de && fe && /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", {
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
- C || (A(!1), j(!1), N((e) => ({
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
- A(!1), j(!1), N((e) => ({
596
+ j(!1), N(!1), F((e) => ({
599
597
  ...e,
600
598
  isDefault: q?.isDefault || !1
601
599
  }));
602
600
  },
603
- disabled: C,
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: C,
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: [C && /* @__PURE__ */ c("svg", {
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
- }), C ? "Saving..." : "Save Changes"]
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 { f as SettingsPage };
645
+ export { d as SettingsPage };
638
646
 
639
647
  //# sourceMappingURL=SettingsPage.js.map