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