@burdenoff/microfe-billing 2026.1113.1 → 2026.1113.3

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 (109) hide show
  1. package/dist/billing/BillingRoot.js +83 -77
  2. package/dist/billing/BillingRoot.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +78 -78
  4. package/dist/billing/modules/addons/pages/AddonCreatePage.js +70 -70
  5. package/dist/billing/modules/addons/pages/AddonDetailPage.js +72 -72
  6. package/dist/billing/modules/addons/pages/AddonEditPage.js +79 -79
  7. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +224 -224
  8. package/dist/billing/modules/addons/pages/AddonsListPage.js +186 -186
  9. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +168 -168
  10. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  11. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +88 -88
  12. package/dist/billing/modules/billing/hooks/index.js +5 -5
  13. package/dist/billing/modules/billing/hooks/useInvoices.js +39 -20
  14. package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
  15. package/dist/billing/modules/billing/index.js +14 -14
  16. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +92 -92
  17. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +160 -160
  18. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  19. package/dist/billing/modules/billing/pages/InvoicesListPage.js +100 -100
  20. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +105 -105
  21. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +37 -37
  22. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +41 -41
  23. package/dist/billing/modules/billing/pages/RefundsPage.js +334 -334
  24. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  25. package/dist/billing/modules/billing/pages/TransactionsPage.js +174 -174
  26. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  27. package/dist/billing/modules/billing/pages/UserRefundsPage.js +24 -24
  28. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  29. package/dist/billing/modules/checkout/components/OrderSummary.js +71 -71
  30. package/dist/billing/modules/checkout/pages/CheckoutPage.js +646 -625
  31. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  32. package/dist/billing/modules/checkout/utils/checkoutOptions.d.ts +23 -0
  33. package/dist/billing/modules/checkout/utils/checkoutOptions.js +8 -0
  34. package/dist/billing/modules/checkout/utils/checkoutOptions.js.map +1 -0
  35. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +112 -112
  36. package/dist/billing/modules/coupons/pages/CouponsListPage.js +118 -118
  37. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  38. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +119 -119
  39. package/dist/billing/modules/coupons/pages/EditCouponPage.js +82 -82
  40. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +30 -30
  41. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +77 -77
  42. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +144 -144
  43. package/dist/billing/modules/credits/pages/CreditsPage.js +67 -67
  44. package/dist/billing/modules/dashboard/pages/OverviewPage.js +594 -442
  45. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  46. package/dist/billing/modules/dashboard/utils/overviewSummary.d.ts +46 -0
  47. package/dist/billing/modules/dashboard/utils/overviewSummary.js +37 -0
  48. package/dist/billing/modules/dashboard/utils/overviewSummary.js.map +1 -0
  49. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +199 -199
  50. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  51. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +64 -64
  52. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +122 -122
  53. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
  54. package/dist/billing/modules/earnings/pages/EarningsPage.js +102 -102
  55. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  56. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +178 -178
  57. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  58. package/dist/billing/modules/earnings/pages/PayoutsPage.js +107 -107
  59. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  60. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +54 -54
  61. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +94 -94
  62. package/dist/billing/modules/plans/pages/PlanCreatePage.js +73 -73
  63. package/dist/billing/modules/plans/pages/PlanDetailPage.js +96 -96
  64. package/dist/billing/modules/plans/pages/PlanEditPage.js +16 -16
  65. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  66. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +143 -143
  67. package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
  68. package/dist/billing/modules/plans/pages/PlansListPage.js +88 -88
  69. package/dist/billing/modules/plans/utils/planAction.d.ts +9 -0
  70. package/dist/billing/modules/plans/utils/planAction.js +4 -1
  71. package/dist/billing/modules/plans/utils/planAction.js.map +1 -1
  72. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +60 -60
  73. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +37 -37
  74. package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js +62 -62
  75. package/dist/billing/modules/quota/pages/QuotaPage.js +1 -1
  76. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +69 -69
  77. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +76 -76
  78. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +80 -80
  79. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +95 -95
  80. package/dist/billing/modules/settings/pages/SettingsPage.js +134 -134
  81. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  82. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +62 -62
  83. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  84. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +36 -36
  85. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +534 -410
  86. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  87. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +111 -111
  88. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +166 -160
  89. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  90. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.d.ts +30 -0
  91. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js +20 -0
  92. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js.map +1 -0
  93. package/dist/billing/modules/subscriptions/utils/upgradeAccess.d.ts +10 -0
  94. package/dist/billing/modules/subscriptions/utils/upgradeAccess.js +7 -0
  95. package/dist/billing/modules/subscriptions/utils/upgradeAccess.js.map +1 -0
  96. package/dist/billing/modules/usage/pages/UsagePage.js +722 -591
  97. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  98. package/dist/billing/modules/usage/utils/usageHealth.d.ts +63 -0
  99. package/dist/billing/modules/usage/utils/usageHealth.js +43 -0
  100. package/dist/billing/modules/usage/utils/usageHealth.js.map +1 -0
  101. package/dist/billing/shared/components/EmptyState.js +3 -3
  102. package/dist/billing/shared/components/MoneyActionDialog.js +12 -12
  103. package/dist/billing/shared/ui/MetricCard.js +13 -13
  104. package/dist/billing/shared/utils/format.js +16 -4
  105. package/dist/billing/shared/utils/format.js.map +1 -1
  106. package/dist/billing/shared/utils/index.js +8 -8
  107. package/dist/generated/global-operations.js +294 -286
  108. package/dist/generated/global-operations.js.map +1 -1
  109. package/package.json +2 -2
@@ -5,16 +5,18 @@ import "../hooks/index.js";
5
5
  import { useBillingPermissions as r } from "../../../hooks/useBillingPermissions.js";
6
6
  import { formatCurrency as i, formatPlanDuration as a } from "../../../shared/utils/format.js";
7
7
  import { useGetAllPlansQuery as o, useGetDefaultBillingAccountDashboardQuery as s } from "../../../../generated/global-operations.js";
8
- import { useSubscription as c } from "../hooks/useSubscriptions.js";
9
- import { withBillingAccountId as l } from "../../../shared/utils/navigation.js";
10
- import { useMemo as u, useState as d } from "react";
11
- import { AlertCircle as f, ArrowLeft as p, ArrowRight as m, CheckCircle as h, ChevronDown as g, ChevronUp as _, Infinity as v, Loader2 as y, Package as b, Sparkles as x } from "lucide-react";
12
- import { useParams as S } from "react-router";
13
- import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
14
- import { useI18n as E } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
- import { PagePurpose as D } from "@burdenoff/fe-libs/ui";
8
+ import { withBillingAccountId as c } from "../../../shared/utils/navigation.js";
9
+ import { useSubscription as ee } from "../hooks/useSubscriptions.js";
10
+ import { useIsFluidgridsVariant as l } from "../../../hooks/useBillingVariant.js";
11
+ import { resolveUpgradeAccess as u } from "../utils/upgradeAccess.js";
12
+ import { useMemo as d, useState as f } from "react";
13
+ import { AccessGate as p, PagePurpose as m } from "@burdenoff/fe-libs/ui";
14
+ import { AlertCircle as h, ArrowLeft as g, ArrowRight as _, CheckCircle as v, ChevronDown as y, ChevronUp as b, Infinity as x, Loader2 as S, Package as C, Sparkles as w } from "lucide-react";
15
+ import { useParams as T } from "react-router";
16
+ import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
17
+ import { useI18n as k } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
16
18
  // src/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.tsx
17
- var O = (e) => typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "number" ? e === -1 || e === Infinity ? "Unlimited" : e >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${(e / 1e3).toFixed(1)}K` : e.toLocaleString() : String(e), k = (e) => e.replace(/_/g, " ").replace(/([A-Z])/g, " $1").replace(/^./, (e) => e.toUpperCase()).trim(), A = (e) => {
19
+ var A = (e) => typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "number" ? e === -1 || e === Infinity ? "Unlimited" : e >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${(e / 1e3).toFixed(1)}K` : e.toLocaleString() : String(e), j = (e) => e.replace(/_/g, " ").replace(/([A-Z])/g, " $1").replace(/^./, (e) => e.toUpperCase()).trim(), M = (e) => {
18
20
  let t = /* @__PURE__ */ new Map();
19
21
  for (let n of e) {
20
22
  let e = n.quotaId || n.quota?.id;
@@ -39,58 +41,58 @@ var O = (e) => typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "number" ?
39
41
  });
40
42
  }
41
43
  return Array.from(t.values());
42
- }, j = ({ features: e, isExpanded: t, onToggle: n, variant: r = "available" }) => {
43
- let i = u(() => A(e), [e]), a = i.length;
44
- return a === 0 ? /* @__PURE__ */ w("p", {
44
+ }, N = ({ features: e, isExpanded: t, onToggle: n, variant: r = "available" }) => {
45
+ let i = d(() => M(e), [e]), a = i.length;
46
+ return a === 0 ? /* @__PURE__ */ D("p", {
45
47
  className: "text-xs text-text-secondary italic",
46
48
  children: "No features defined"
47
- }) : /* @__PURE__ */ T("div", {
49
+ }) : /* @__PURE__ */ O("div", {
48
50
  className: "mt-2",
49
- children: [/* @__PURE__ */ T("button", {
51
+ children: [/* @__PURE__ */ O("button", {
50
52
  type: "button",
51
53
  onClick: (e) => {
52
54
  e.stopPropagation(), n();
53
55
  },
54
56
  className: `flex items-center gap-1.5 text-xs font-medium transition-colors ${r === "current" ? "text-text-secondary hover:text-text-primary" : "text-text-link hover:text-text-link"}`,
55
57
  children: [
56
- /* @__PURE__ */ w(x, { className: "size-3" }),
57
- /* @__PURE__ */ T("span", { children: [
58
+ /* @__PURE__ */ D(w, { className: "size-3" }),
59
+ /* @__PURE__ */ O("span", { children: [
58
60
  a,
59
61
  " feature",
60
62
  a === 1 ? "" : "s"
61
63
  ] }),
62
- w(t ? _ : g, { className: "size-3" })
64
+ D(t ? b : y, { className: "size-3" })
63
65
  ]
64
- }), t && /* @__PURE__ */ w("div", {
66
+ }), t && /* @__PURE__ */ D("div", {
65
67
  className: `mt-2 space-y-2 ${r === "current" ? "pl-0" : "pl-1"}`,
66
68
  children: i.map((e) => {
67
69
  let t = e.quota;
68
70
  if (!t) return null;
69
71
  let n = t.limits || {}, i = Object.entries(n);
70
- return /* @__PURE__ */ T("div", {
72
+ return /* @__PURE__ */ O("div", {
71
73
  className: `rounded-button p-2 ${r === "current" ? "bg-bg-sunken" : "bg-[var(--color-accent-soft)]"}`,
72
74
  children: [
73
- /* @__PURE__ */ w("p", {
75
+ /* @__PURE__ */ D("p", {
74
76
  className: "text-xs font-medium text-text-primary",
75
77
  children: t.name
76
78
  }),
77
- i.length > 0 && /* @__PURE__ */ w("div", {
79
+ i.length > 0 && /* @__PURE__ */ D("div", {
78
80
  className: "mt-1 flex flex-wrap gap-x-3 gap-y-1",
79
- children: i.map(([e, t]) => /* @__PURE__ */ T("div", {
81
+ children: i.map(([e, t]) => /* @__PURE__ */ O("div", {
80
82
  className: "flex items-center gap-1 text-xs text-text-secondary",
81
- children: [/* @__PURE__ */ T("span", {
83
+ children: [/* @__PURE__ */ O("span", {
82
84
  className: "opacity-70",
83
- children: [k(e), ":"]
84
- }), /* @__PURE__ */ w("span", {
85
+ children: [j(e), ":"]
86
+ }), /* @__PURE__ */ D("span", {
85
87
  className: "font-medium text-text-primary flex items-center gap-0.5",
86
- children: t === -1 || t === Infinity ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(v, { className: "size-3" }), /* @__PURE__ */ w("span", {
88
+ children: t === -1 || t === Infinity ? /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(x, { className: "size-3" }), /* @__PURE__ */ D("span", {
87
89
  className: "sr-only",
88
90
  children: "Unlimited"
89
- })] }) : O(t)
91
+ })] }) : A(t)
90
92
  })]
91
93
  }, e))
92
94
  }),
93
- t.reusable && /* @__PURE__ */ w("span", {
95
+ t.reusable && /* @__PURE__ */ D("span", {
94
96
  className: "inline-block mt-1 text-[10px] px-1.5 py-0.5 rounded bg-status-success-bg-subtle text-status-success-text",
95
97
  children: "Reusable"
96
98
  })
@@ -99,234 +101,238 @@ var O = (e) => typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "number" ?
99
101
  })
100
102
  })]
101
103
  });
102
- }, M = () => {
103
- let { t: g } = E(), _ = (e, t) => {
104
- let n = g(e);
104
+ }, P = () => {
105
+ let { t: y } = k(), b = (e, t) => {
106
+ let n = y(e);
105
107
  return n === e ? t : n;
106
- }, { subscriptionId: v } = S(), x = e(), { orgId: C } = t(), O = r(), { selectedAccountId: k } = n({
107
- orgId: C,
108
+ }, { subscriptionId: x } = T(), w = e(), { orgId: E } = t(), A = r(), j = l(), { selectedAccountId: P } = n({
109
+ orgId: E,
108
110
  syncFromUrl: !0,
109
111
  urlParamName: "billingAccountId"
110
- }), { data: M } = s({ fetchPolicy: "cache-first" }), N = k ?? M?.getDefaultBillingAccount?.id ?? void 0, { subscription: P, isLoading: F } = c(v, N), { data: I, loading: L } = o(), [R, z] = d(null), [B, V] = d({}), H = u(() => I?.getAllPlans || [], [I]), U = u(() => {
111
- let e = P?.planId;
112
- return H.find((t) => t.id === e) || null;
113
- }, [H, P?.planId]), W = u(() => {
114
- let e = P?.planId, t = P?.plan?.productID;
115
- return H.filter((n) => n.id === e || !n.isActive || n.isPurchasable === !1 || n.price === 0 ? !1 : !t || n.productID === t).sort((e, t) => e.price - t.price);
116
- }, [H, P]), G = u(() => W.find((e) => e.id === R) || null, [W, R]), K = G !== null && G.price < (P?.plan?.price ?? 0), q = (e) => {
117
- V((t) => ({
112
+ }), { data: F } = s({ fetchPolicy: "cache-first" }), I = P ?? F?.getDefaultBillingAccount?.id ?? void 0, { subscription: L, isLoading: R } = ee(x, I), { data: z, loading: B } = o(), [V, H] = f(null), [U, W] = f({}), G = d(() => z?.getAllPlans || [], [z]), K = d(() => {
113
+ let e = L?.planId;
114
+ return G.find((t) => t.id === e) || null;
115
+ }, [G, L?.planId]), q = d(() => {
116
+ let e = L?.planId, t = L?.plan?.productID;
117
+ return G.filter((n) => n.id === e || !n.isActive || n.isPurchasable === !1 || n.price === 0 ? !1 : !t || n.productID === t).sort((e, t) => e.price - t.price);
118
+ }, [G, L]), J = d(() => q.find((e) => e.id === V) || null, [q, V]), Y = J !== null && J.price < (L?.plan?.price ?? 0), X = (e) => {
119
+ W((t) => ({
118
120
  ...t,
119
121
  [e]: !t[e]
120
122
  }));
121
- }, J = () => {
122
- if (!P || !G) return;
123
- let e = P.plan?.price ?? 0, t = G.price < e;
124
- x(`/checkout/${G.id}`, { state: {
123
+ }, Z = () => {
124
+ if (!L || !J) return;
125
+ let e = L.plan?.price ?? 0, t = J.price < e;
126
+ w(`/checkout/${J.id}`, { state: {
125
127
  purchaseType: "PLAN",
126
- ...t ? { downgradeFromSubscriptionId: P.id } : { upgradeFromSubscriptionId: P.id },
127
- currentPlanName: P.plan?.name,
128
- billingAccountId: P.billingAccountId
128
+ ...t ? { downgradeFromSubscriptionId: L.id } : { upgradeFromSubscriptionId: L.id },
129
+ currentPlanName: L.plan?.name,
130
+ billingAccountId: L.billingAccountId
129
131
  } });
130
- };
131
- if (!O.canUpdateSubscription) return /* @__PURE__ */ w("div", {
132
+ }, Q = u(j, A.canCreateSubscription);
133
+ if (Q === "gate") return /* @__PURE__ */ D(p, {
134
+ message: b("billing.subscriptions.upgradeNeedAccess", "You need access to change this plan"),
135
+ granterHint: b("billing.subscriptions.upgradeNeedAccessHint", "Ask a billing admin of this organization to give you access.")
136
+ });
137
+ if (Q === "denied") return /* @__PURE__ */ D("div", {
132
138
  className: "flex items-center justify-center h-full min-h-[400px]",
133
- children: /* @__PURE__ */ T("div", {
139
+ children: /* @__PURE__ */ O("div", {
134
140
  className: "text-center space-y-2",
135
141
  children: [
136
- /* @__PURE__ */ w("div", {
142
+ /* @__PURE__ */ D("div", {
137
143
  className: "size-12 mx-auto rounded-full bg-bg-sunken flex items-center justify-center",
138
- children: /* @__PURE__ */ w(f, { className: "size-6 text-text-secondary" })
144
+ children: /* @__PURE__ */ D(h, { className: "size-6 text-text-secondary" })
139
145
  }),
140
- /* @__PURE__ */ w("h2", {
146
+ /* @__PURE__ */ D("h2", {
141
147
  className: "text-lg font-semibold text-text-primary",
142
148
  children: "Access Denied"
143
149
  }),
144
- /* @__PURE__ */ w("p", {
150
+ /* @__PURE__ */ D("p", {
145
151
  className: "text-sm text-text-secondary max-w-sm",
146
152
  children: "You don't have permission to change subscriptions."
147
153
  })
148
154
  ]
149
155
  })
150
156
  });
151
- if (F || L) return /* @__PURE__ */ w("div", {
157
+ if (R || B) return /* @__PURE__ */ D("div", {
152
158
  className: "flex items-center justify-center min-h-[400px]",
153
- children: /* @__PURE__ */ T("div", {
159
+ children: /* @__PURE__ */ O("div", {
154
160
  className: "text-center space-y-4",
155
- children: [/* @__PURE__ */ w(y, { className: "size-8 animate-spin mx-auto text-text-link" }), /* @__PURE__ */ w("p", {
161
+ children: [/* @__PURE__ */ D(S, { className: "size-8 animate-spin mx-auto text-text-link" }), /* @__PURE__ */ D("p", {
156
162
  className: "text-text-secondary",
157
163
  children: "Loading plans…"
158
164
  })]
159
165
  })
160
166
  });
161
- if (!P) return /* @__PURE__ */ w("div", {
167
+ if (!L) return /* @__PURE__ */ D("div", {
162
168
  className: "flex items-center justify-center h-full min-h-[400px]",
163
- children: /* @__PURE__ */ T("div", {
169
+ children: /* @__PURE__ */ O("div", {
164
170
  className: "text-center space-y-4",
165
171
  children: [
166
- /* @__PURE__ */ w(f, { className: "size-12 mx-auto text-status-error-text" }),
167
- /* @__PURE__ */ w("h2", {
172
+ /* @__PURE__ */ D(h, { className: "size-12 mx-auto text-status-error-text" }),
173
+ /* @__PURE__ */ D("h2", {
168
174
  className: "text-lg font-semibold text-text-primary",
169
175
  children: "Subscription not found"
170
176
  }),
171
- /* @__PURE__ */ w("button", {
177
+ /* @__PURE__ */ D("button", {
172
178
  type: "button",
173
- onClick: () => x(l("/subscriptions", N)),
179
+ onClick: () => w(c("/subscriptions", I)),
174
180
  className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button",
175
- children: _("billing.subscriptions.backToSubscriptions", "Back to Subscriptions")
181
+ children: b("billing.subscriptions.backToSubscriptions", "Back to Subscriptions")
176
182
  })
177
183
  ]
178
184
  })
179
185
  });
180
- if (P.status !== "active") return /* @__PURE__ */ T("div", {
186
+ if (L.status !== "active") return /* @__PURE__ */ O("div", {
181
187
  className: "max-w-2xl mx-auto p-6 space-y-6",
182
- children: [/* @__PURE__ */ T("button", {
188
+ children: [/* @__PURE__ */ O("button", {
183
189
  type: "button",
184
- onClick: () => x(l(`/subscriptions/${v}`, N)),
190
+ onClick: () => w(c(`/subscriptions/${x}`, I)),
185
191
  className: "flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary",
186
- children: [/* @__PURE__ */ w(p, { className: "size-4" }), _("billing.subscriptions.backToSubscription", "Back to Subscription")]
187
- }), /* @__PURE__ */ T("div", {
192
+ children: [/* @__PURE__ */ D(g, { className: "size-4" }), b("billing.subscriptions.backToSubscription", "Back to Subscription")]
193
+ }), /* @__PURE__ */ O("div", {
188
194
  className: "text-center space-y-4 py-12",
189
195
  children: [
190
- /* @__PURE__ */ w(f, { className: "size-12 mx-auto text-status-warning-text" }),
191
- /* @__PURE__ */ w("h2", {
196
+ /* @__PURE__ */ D(h, { className: "size-12 mx-auto text-status-warning-text" }),
197
+ /* @__PURE__ */ D("h2", {
192
198
  className: "text-lg font-semibold text-text-primary",
193
- children: _("billing.subscriptions.cannotChangePlan", "Cannot Change Plan")
199
+ children: b("billing.subscriptions.cannotChangePlan", "Cannot Change Plan")
194
200
  }),
195
- /* @__PURE__ */ w("p", {
201
+ /* @__PURE__ */ D("p", {
196
202
  className: "text-sm text-text-secondary max-w-md mx-auto",
197
- children: _("billing.subscriptions.notActiveMessage", "This subscription is no longer active. You can only change plans for active subscriptions.")
203
+ children: b("billing.subscriptions.notActiveMessage", "This subscription is no longer active. You can only change plans for active subscriptions.")
198
204
  }),
199
- /* @__PURE__ */ w("button", {
205
+ /* @__PURE__ */ D("button", {
200
206
  type: "button",
201
- onClick: () => x(l("/subscriptions", N)),
207
+ onClick: () => w(c("/subscriptions", I)),
202
208
  className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button",
203
- children: _("billing.subscriptions.viewAll", "View All Subscriptions")
209
+ children: b("billing.subscriptions.viewAll", "View All Subscriptions")
204
210
  })
205
211
  ]
206
212
  })]
207
213
  });
208
- if (W.length === 0) return /* @__PURE__ */ T("div", {
214
+ if (q.length === 0) return /* @__PURE__ */ O("div", {
209
215
  className: "max-w-2xl mx-auto p-6 space-y-6",
210
- children: [/* @__PURE__ */ T("button", {
216
+ children: [/* @__PURE__ */ O("button", {
211
217
  type: "button",
212
- onClick: () => x(l(`/subscriptions/${v}`, N)),
218
+ onClick: () => w(c(`/subscriptions/${x}`, I)),
213
219
  className: "flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary",
214
- children: [/* @__PURE__ */ w(p, { className: "size-4" }), _("billing.subscriptions.backToSubscription", "Back to Subscription")]
215
- }), /* @__PURE__ */ T("div", {
220
+ children: [/* @__PURE__ */ D(g, { className: "size-4" }), b("billing.subscriptions.backToSubscription", "Back to Subscription")]
221
+ }), /* @__PURE__ */ O("div", {
216
222
  className: "text-center space-y-4 py-12",
217
223
  children: [
218
- /* @__PURE__ */ w(b, { className: "size-12 mx-auto text-text-secondary" }),
219
- /* @__PURE__ */ w("h2", {
224
+ /* @__PURE__ */ D(C, { className: "size-12 mx-auto text-text-secondary" }),
225
+ /* @__PURE__ */ D("h2", {
220
226
  className: "text-lg font-semibold text-text-primary",
221
- children: _("billing.subscriptions.noPlansAvailable", "No Other Plans Available")
227
+ children: b("billing.subscriptions.noPlansAvailable", "No Other Plans Available")
222
228
  }),
223
- /* @__PURE__ */ w("p", {
229
+ /* @__PURE__ */ D("p", {
224
230
  className: "text-sm text-text-secondary max-w-md mx-auto",
225
- children: _("billing.subscriptions.noPlansMessage", "There are no other active plans available for this product.")
231
+ children: b("billing.subscriptions.noPlansMessage", "There are no other active plans available for this product.")
226
232
  })
227
233
  ]
228
234
  })]
229
235
  });
230
- let Y = U?.features || [];
231
- return /* @__PURE__ */ T("div", {
236
+ let $ = K?.features || [];
237
+ return /* @__PURE__ */ O("div", {
232
238
  className: "max-w-3xl mx-auto p-6 space-y-6",
233
239
  children: [
234
- /* @__PURE__ */ T("div", { children: [
235
- /* @__PURE__ */ T("button", {
240
+ /* @__PURE__ */ O("div", { children: [
241
+ /* @__PURE__ */ O("button", {
236
242
  type: "button",
237
- onClick: () => x(l(`/subscriptions/${v}`, N)),
243
+ onClick: () => w(c(`/subscriptions/${x}`, I)),
238
244
  className: "flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary mb-4",
239
- children: [/* @__PURE__ */ w(p, { className: "size-4" }), _("billing.subscriptions.backToSubscription", "Back to Subscription")]
245
+ children: [/* @__PURE__ */ D(g, { className: "size-4" }), b("billing.subscriptions.backToSubscription", "Back to Subscription")]
240
246
  }),
241
- /* @__PURE__ */ w("h1", {
247
+ /* @__PURE__ */ D("h1", {
242
248
  className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
243
- children: _("billing.subscriptions.changeYourPlan", "Change Your Plan")
249
+ children: b("billing.subscriptions.changeYourPlan", "Change Your Plan")
244
250
  }),
245
- /* @__PURE__ */ T("p", {
251
+ /* @__PURE__ */ O("p", {
246
252
  className: "text-text-secondary mt-1",
247
253
  children: [
248
254
  "Switch from ",
249
- /* @__PURE__ */ w("span", {
255
+ /* @__PURE__ */ D("span", {
250
256
  className: "font-medium",
251
- children: P.plan?.name
257
+ children: L.plan?.name
252
258
  }),
253
259
  " to a different plan"
254
260
  ]
255
261
  }),
256
- /* @__PURE__ */ w(D, {
262
+ /* @__PURE__ */ D(m, {
257
263
  className: "mt-3",
258
- children: _("billing.subscriptions.upgradePurpose", "Move this subscription to a different plan — upgrade for more capacity or downgrade to save. Compare what each plan includes and see how the change affects your billing before you confirm.")
264
+ children: b("billing.subscriptions.upgradePurpose", "Move this subscription to a different plan — upgrade for more capacity or downgrade to save. Compare what each plan includes and see how the change affects your billing before you confirm.")
259
265
  })
260
266
  ] }),
261
- /* @__PURE__ */ w("div", {
267
+ /* @__PURE__ */ D("div", {
262
268
  className: "bg-bg-sunken border border-border-subtle rounded-lg p-4",
263
- children: /* @__PURE__ */ T("div", {
269
+ children: /* @__PURE__ */ O("div", {
264
270
  className: "flex items-start justify-between",
265
- children: [/* @__PURE__ */ T("div", {
271
+ children: [/* @__PURE__ */ O("div", {
266
272
  className: "flex-1",
267
273
  children: [
268
- /* @__PURE__ */ w("p", {
274
+ /* @__PURE__ */ D("p", {
269
275
  className: "text-sm text-text-secondary",
270
276
  children: "Current Plan"
271
277
  }),
272
- /* @__PURE__ */ w("p", {
278
+ /* @__PURE__ */ D("p", {
273
279
  className: "font-semibold text-text-primary",
274
- children: P.plan?.name
280
+ children: L.plan?.name
275
281
  }),
276
- /* @__PURE__ */ w(j, {
277
- features: Y,
278
- isExpanded: B.current || !1,
279
- onToggle: () => q("current"),
282
+ /* @__PURE__ */ D(N, {
283
+ features: $,
284
+ isExpanded: U.current || !1,
285
+ onToggle: () => X("current"),
280
286
  variant: "current"
281
287
  })
282
288
  ]
283
- }), /* @__PURE__ */ T("div", {
289
+ }), /* @__PURE__ */ O("div", {
284
290
  className: "text-right shrink-0 ml-4",
285
- children: [/* @__PURE__ */ w("p", {
291
+ children: [/* @__PURE__ */ D("p", {
286
292
  className: "text-sm text-text-secondary",
287
293
  children: "Price"
288
- }), /* @__PURE__ */ T("p", {
294
+ }), /* @__PURE__ */ O("p", {
289
295
  className: "font-semibold text-text-primary",
290
- children: [i(P.plan?.price || 0, P.plan?.currency || "USD"), /* @__PURE__ */ T("span", {
296
+ children: [i(L.plan?.price || 0, L.plan?.currency || "USD"), /* @__PURE__ */ O("span", {
291
297
  className: "text-sm font-normal text-text-secondary",
292
298
  children: [
293
299
  " ",
294
300
  "/ ",
295
- a(P.plan?.duration || "monthly")
301
+ a(L.plan?.duration || "monthly")
296
302
  ]
297
303
  })]
298
304
  })]
299
305
  })]
300
306
  })
301
307
  }),
302
- /* @__PURE__ */ T("div", {
308
+ /* @__PURE__ */ O("div", {
303
309
  className: "space-y-3",
304
- children: [/* @__PURE__ */ w("h2", {
310
+ children: [/* @__PURE__ */ D("h2", {
305
311
  className: "text-lg font-semibold text-text-primary",
306
312
  children: "Select New Plan"
307
- }), /* @__PURE__ */ w("div", {
313
+ }), /* @__PURE__ */ D("div", {
308
314
  className: "grid gap-3",
309
- children: W.map((e) => {
310
- let t = e.price - (P.plan?.price || 0), n = R === e.id, r = e.features || [], o = B[e.id] || !1;
311
- return /* @__PURE__ */ T("div", {
315
+ children: q.map((e) => {
316
+ let t = e.price - (L.plan?.price || 0), n = V === e.id, r = e.features || [], o = U[e.id] || !1;
317
+ return /* @__PURE__ */ O("div", {
312
318
  className: `rounded-lg border transition-all ${n ? "border-border-strong bg-[var(--color-accent-soft)] ring-2 ring-[var(--color-focus-ring)]" : "border-border-subtle bg-bg-surface hover:border-border-strong"}`,
313
- children: [/* @__PURE__ */ w("button", {
319
+ children: [/* @__PURE__ */ D("button", {
314
320
  type: "button",
315
- onClick: () => z(e.id),
321
+ onClick: () => H(e.id),
316
322
  className: "w-full p-4 text-left",
317
- children: /* @__PURE__ */ T("div", {
323
+ children: /* @__PURE__ */ O("div", {
318
324
  className: "flex items-start justify-between",
319
- children: [/* @__PURE__ */ T("div", {
325
+ children: [/* @__PURE__ */ O("div", {
320
326
  className: "flex items-start gap-3",
321
- children: [/* @__PURE__ */ w("div", {
327
+ children: [/* @__PURE__ */ D("div", {
322
328
  className: `size-5 mt-0.5 rounded-full border-2 flex items-center justify-center shrink-0 ${n ? "border-border-strong bg-action-primary-bg" : "border-border-default"}`,
323
- children: n && /* @__PURE__ */ w(h, { className: "size-3 text-action-primary-text" })
324
- }), /* @__PURE__ */ T("div", {
329
+ children: n && /* @__PURE__ */ D(v, { className: "size-3 text-action-primary-text" })
330
+ }), /* @__PURE__ */ O("div", {
325
331
  className: "flex-1",
326
- children: [/* @__PURE__ */ w("p", {
332
+ children: [/* @__PURE__ */ D("p", {
327
333
  className: "font-semibold text-text-primary",
328
334
  children: e.name
329
- }), t !== 0 && /* @__PURE__ */ T("p", {
335
+ }), t !== 0 && /* @__PURE__ */ O("p", {
330
336
  className: `text-sm ${t > 0 ? "text-status-warning-text" : "text-status-success-text"}`,
331
337
  children: [
332
338
  t > 0 ? "+" : "",
@@ -337,23 +343,23 @@ var O = (e) => typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "number" ?
337
343
  ]
338
344
  })]
339
345
  })]
340
- }), /* @__PURE__ */ T("div", {
346
+ }), /* @__PURE__ */ O("div", {
341
347
  className: "text-right shrink-0 ml-4",
342
- children: [/* @__PURE__ */ w("p", {
348
+ children: [/* @__PURE__ */ D("p", {
343
349
  className: "font-bold text-text-primary",
344
350
  children: i(e.price, e.currency)
345
- }), /* @__PURE__ */ T("p", {
351
+ }), /* @__PURE__ */ O("p", {
346
352
  className: "text-sm text-text-secondary",
347
353
  children: ["/ ", a(e.duration)]
348
354
  })]
349
355
  })]
350
356
  })
351
- }), /* @__PURE__ */ w("div", {
357
+ }), /* @__PURE__ */ D("div", {
352
358
  className: "px-4 pb-4 pt-0 ml-8",
353
- children: /* @__PURE__ */ w(j, {
359
+ children: /* @__PURE__ */ D(N, {
354
360
  features: r,
355
361
  isExpanded: o,
356
- onToggle: () => q(e.id),
362
+ onToggle: () => X(e.id),
357
363
  variant: "available"
358
364
  })
359
365
  })]
@@ -361,26 +367,26 @@ var O = (e) => typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "number" ?
361
367
  })
362
368
  })]
363
369
  }),
364
- G && (() => {
365
- let e = A(Y).length, t = A(G.features || []).length;
366
- return /* @__PURE__ */ T("div", {
370
+ J && (() => {
371
+ let e = M($).length, t = M(J.features || []).length;
372
+ return /* @__PURE__ */ O("div", {
367
373
  className: "bg-bg-surface border border-border-subtle rounded-lg p-4 space-y-4",
368
374
  children: [
369
- /* @__PURE__ */ T("div", {
375
+ /* @__PURE__ */ O("div", {
370
376
  className: "flex items-center justify-center gap-4 py-2",
371
377
  children: [
372
- /* @__PURE__ */ T("div", {
378
+ /* @__PURE__ */ O("div", {
373
379
  className: "text-center",
374
380
  children: [
375
- /* @__PURE__ */ w("p", {
381
+ /* @__PURE__ */ D("p", {
376
382
  className: "text-xs text-text-secondary",
377
383
  children: "From"
378
384
  }),
379
- /* @__PURE__ */ w("p", {
385
+ /* @__PURE__ */ D("p", {
380
386
  className: "font-medium text-text-primary",
381
- children: P.plan?.name
387
+ children: L.plan?.name
382
388
  }),
383
- /* @__PURE__ */ T("p", {
389
+ /* @__PURE__ */ O("p", {
384
390
  className: "text-xs text-text-secondary",
385
391
  children: [
386
392
  e,
@@ -390,19 +396,19 @@ var O = (e) => typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "number" ?
390
396
  })
391
397
  ]
392
398
  }),
393
- /* @__PURE__ */ w(m, { className: "size-5 text-text-secondary" }),
394
- /* @__PURE__ */ T("div", {
399
+ /* @__PURE__ */ D(_, { className: "size-5 text-text-secondary" }),
400
+ /* @__PURE__ */ O("div", {
395
401
  className: "text-center",
396
402
  children: [
397
- /* @__PURE__ */ w("p", {
403
+ /* @__PURE__ */ D("p", {
398
404
  className: "text-xs text-text-secondary",
399
405
  children: "To"
400
406
  }),
401
- /* @__PURE__ */ w("p", {
407
+ /* @__PURE__ */ D("p", {
402
408
  className: "font-medium text-text-link",
403
- children: G.name
409
+ children: J.name
404
410
  }),
405
- /* @__PURE__ */ T("p", {
411
+ /* @__PURE__ */ O("p", {
406
412
  className: "text-xs text-text-secondary",
407
413
  children: [
408
414
  t,
@@ -414,22 +420,22 @@ var O = (e) => typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "number" ?
414
420
  })
415
421
  ]
416
422
  }),
417
- /* @__PURE__ */ w("p", {
423
+ /* @__PURE__ */ D("p", {
418
424
  className: "text-sm text-text-secondary text-center",
419
425
  children: "You'll be taken to checkout to select payment method and complete the change."
420
426
  }),
421
- /* @__PURE__ */ T("div", {
427
+ /* @__PURE__ */ O("div", {
422
428
  className: "flex items-center justify-end gap-3 pt-2 border-t border-border-subtle",
423
- children: [/* @__PURE__ */ w("button", {
429
+ children: [/* @__PURE__ */ D("button", {
424
430
  type: "button",
425
- onClick: () => x(l(`/subscriptions/${v}`, N)),
431
+ onClick: () => w(c(`/subscriptions/${x}`, I)),
426
432
  className: "px-4 py-2 text-sm font-medium text-text-secondary hover:text-text-primary",
427
433
  children: "Cancel"
428
- }), /* @__PURE__ */ w("button", {
434
+ }), /* @__PURE__ */ D("button", {
429
435
  type: "button",
430
- onClick: J,
436
+ onClick: Z,
431
437
  className: "px-6 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors",
432
- children: K ? "Downgrade Plan" : "Upgrade Plan"
438
+ children: Y ? "Downgrade Plan" : "Upgrade Plan"
433
439
  })]
434
440
  })
435
441
  ]
@@ -438,6 +444,6 @@ var O = (e) => typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "number" ?
438
444
  ]
439
445
  });
440
446
  };
441
- export { M as UpgradeSubscriptionPage };
447
+ export { P as UpgradeSubscriptionPage };
442
448
 
443
449
  //# sourceMappingURL=UpgradeSubscriptionPage.js.map