@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.
- package/dist/billing/BillingRoot.js +83 -77
- package/dist/billing/BillingRoot.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +78 -78
- package/dist/billing/modules/addons/pages/AddonCreatePage.js +70 -70
- package/dist/billing/modules/addons/pages/AddonDetailPage.js +72 -72
- package/dist/billing/modules/addons/pages/AddonEditPage.js +79 -79
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +224 -224
- package/dist/billing/modules/addons/pages/AddonsListPage.js +186 -186
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +168 -168
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js +88 -88
- package/dist/billing/modules/billing/hooks/index.js +5 -5
- package/dist/billing/modules/billing/hooks/useInvoices.js +39 -20
- package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
- package/dist/billing/modules/billing/index.js +14 -14
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +92 -92
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +160 -160
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +100 -100
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +105 -105
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +37 -37
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +41 -41
- package/dist/billing/modules/billing/pages/RefundsPage.js +334 -334
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +174 -174
- package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +24 -24
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/checkout/components/OrderSummary.js +71 -71
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +646 -625
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/checkout/utils/checkoutOptions.d.ts +23 -0
- package/dist/billing/modules/checkout/utils/checkoutOptions.js +8 -0
- package/dist/billing/modules/checkout/utils/checkoutOptions.js.map +1 -0
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +112 -112
- package/dist/billing/modules/coupons/pages/CouponsListPage.js +118 -118
- package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js +119 -119
- package/dist/billing/modules/coupons/pages/EditCouponPage.js +82 -82
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js +30 -30
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +77 -77
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +144 -144
- package/dist/billing/modules/credits/pages/CreditsPage.js +67 -67
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +594 -442
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/dashboard/utils/overviewSummary.d.ts +46 -0
- package/dist/billing/modules/dashboard/utils/overviewSummary.js +37 -0
- package/dist/billing/modules/dashboard/utils/overviewSummary.js.map +1 -0
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js +199 -199
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +64 -64
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +122 -122
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +102 -102
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +178 -178
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +107 -107
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +54 -54
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +94 -94
- package/dist/billing/modules/plans/pages/PlanCreatePage.js +73 -73
- package/dist/billing/modules/plans/pages/PlanDetailPage.js +96 -96
- package/dist/billing/modules/plans/pages/PlanEditPage.js +16 -16
- package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +143 -143
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansListPage.js +88 -88
- package/dist/billing/modules/plans/utils/planAction.d.ts +9 -0
- package/dist/billing/modules/plans/utils/planAction.js +4 -1
- package/dist/billing/modules/plans/utils/planAction.js.map +1 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +60 -60
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js +37 -37
- package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js +62 -62
- package/dist/billing/modules/quota/pages/QuotaPage.js +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +69 -69
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +76 -76
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +80 -80
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +95 -95
- package/dist/billing/modules/settings/pages/SettingsPage.js +134 -134
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +62 -62
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +36 -36
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +534 -410
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +111 -111
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +166 -160
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.d.ts +30 -0
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js +20 -0
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js.map +1 -0
- package/dist/billing/modules/subscriptions/utils/upgradeAccess.d.ts +10 -0
- package/dist/billing/modules/subscriptions/utils/upgradeAccess.js +7 -0
- package/dist/billing/modules/subscriptions/utils/upgradeAccess.js.map +1 -0
- package/dist/billing/modules/usage/pages/UsagePage.js +722 -591
- package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
- package/dist/billing/modules/usage/utils/usageHealth.d.ts +63 -0
- package/dist/billing/modules/usage/utils/usageHealth.js +43 -0
- package/dist/billing/modules/usage/utils/usageHealth.js.map +1 -0
- package/dist/billing/shared/components/EmptyState.js +3 -3
- package/dist/billing/shared/components/MoneyActionDialog.js +12 -12
- package/dist/billing/shared/ui/MetricCard.js +13 -13
- package/dist/billing/shared/utils/format.js +16 -4
- package/dist/billing/shared/utils/format.js.map +1 -1
- package/dist/billing/shared/utils/index.js +8 -8
- package/dist/generated/global-operations.js +294 -286
- package/dist/generated/global-operations.js.map +1 -1
- 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 {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
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
|
|
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
|
-
},
|
|
43
|
-
let i =
|
|
44
|
-
return a === 0 ? /* @__PURE__ */
|
|
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__ */
|
|
49
|
+
}) : /* @__PURE__ */ O("div", {
|
|
48
50
|
className: "mt-2",
|
|
49
|
-
children: [/* @__PURE__ */
|
|
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
|
|
57
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
64
|
+
D(t ? b : y, { className: "size-3" })
|
|
63
65
|
]
|
|
64
|
-
}), t && /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
83
|
+
children: [/* @__PURE__ */ O("span", {
|
|
82
84
|
className: "opacity-70",
|
|
83
|
-
children: [
|
|
84
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
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
|
-
})] }) :
|
|
91
|
+
})] }) : A(t)
|
|
90
92
|
})]
|
|
91
93
|
}, e))
|
|
92
94
|
}),
|
|
93
|
-
t.reusable && /* @__PURE__ */
|
|
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
|
-
},
|
|
103
|
-
let { t:
|
|
104
|
-
let n =
|
|
104
|
+
}, P = () => {
|
|
105
|
+
let { t: y } = k(), b = (e, t) => {
|
|
106
|
+
let n = y(e);
|
|
105
107
|
return n === e ? t : n;
|
|
106
|
-
}, { subscriptionId:
|
|
107
|
-
orgId:
|
|
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:
|
|
111
|
-
let e =
|
|
112
|
-
return
|
|
113
|
-
}, [
|
|
114
|
-
let e =
|
|
115
|
-
return
|
|
116
|
-
}, [
|
|
117
|
-
|
|
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
|
-
},
|
|
122
|
-
if (!
|
|
123
|
-
let e =
|
|
124
|
-
|
|
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:
|
|
127
|
-
currentPlanName:
|
|
128
|
-
billingAccountId:
|
|
128
|
+
...t ? { downgradeFromSubscriptionId: L.id } : { upgradeFromSubscriptionId: L.id },
|
|
129
|
+
currentPlanName: L.plan?.name,
|
|
130
|
+
billingAccountId: L.billingAccountId
|
|
129
131
|
} });
|
|
130
|
-
};
|
|
131
|
-
if (
|
|
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__ */
|
|
139
|
+
children: /* @__PURE__ */ O("div", {
|
|
134
140
|
className: "text-center space-y-2",
|
|
135
141
|
children: [
|
|
136
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ D("div", {
|
|
137
143
|
className: "size-12 mx-auto rounded-full bg-bg-sunken flex items-center justify-center",
|
|
138
|
-
children: /* @__PURE__ */
|
|
144
|
+
children: /* @__PURE__ */ D(h, { className: "size-6 text-text-secondary" })
|
|
139
145
|
}),
|
|
140
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ D("h2", {
|
|
141
147
|
className: "text-lg font-semibold text-text-primary",
|
|
142
148
|
children: "Access Denied"
|
|
143
149
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
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 (
|
|
157
|
+
if (R || B) return /* @__PURE__ */ D("div", {
|
|
152
158
|
className: "flex items-center justify-center min-h-[400px]",
|
|
153
|
-
children: /* @__PURE__ */
|
|
159
|
+
children: /* @__PURE__ */ O("div", {
|
|
154
160
|
className: "text-center space-y-4",
|
|
155
|
-
children: [/* @__PURE__ */
|
|
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 (!
|
|
167
|
+
if (!L) return /* @__PURE__ */ D("div", {
|
|
162
168
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
163
|
-
children: /* @__PURE__ */
|
|
169
|
+
children: /* @__PURE__ */ O("div", {
|
|
164
170
|
className: "text-center space-y-4",
|
|
165
171
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
/* @__PURE__ */
|
|
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__ */
|
|
177
|
+
/* @__PURE__ */ D("button", {
|
|
172
178
|
type: "button",
|
|
173
|
-
onClick: () =>
|
|
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:
|
|
181
|
+
children: b("billing.subscriptions.backToSubscriptions", "Back to Subscriptions")
|
|
176
182
|
})
|
|
177
183
|
]
|
|
178
184
|
})
|
|
179
185
|
});
|
|
180
|
-
if (
|
|
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__ */
|
|
188
|
+
children: [/* @__PURE__ */ O("button", {
|
|
183
189
|
type: "button",
|
|
184
|
-
onClick: () =>
|
|
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__ */
|
|
187
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
191
|
-
/* @__PURE__ */
|
|
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:
|
|
199
|
+
children: b("billing.subscriptions.cannotChangePlan", "Cannot Change Plan")
|
|
194
200
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ D("p", {
|
|
196
202
|
className: "text-sm text-text-secondary max-w-md mx-auto",
|
|
197
|
-
children:
|
|
203
|
+
children: b("billing.subscriptions.notActiveMessage", "This subscription is no longer active. You can only change plans for active subscriptions.")
|
|
198
204
|
}),
|
|
199
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ D("button", {
|
|
200
206
|
type: "button",
|
|
201
|
-
onClick: () =>
|
|
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:
|
|
209
|
+
children: b("billing.subscriptions.viewAll", "View All Subscriptions")
|
|
204
210
|
})
|
|
205
211
|
]
|
|
206
212
|
})]
|
|
207
213
|
});
|
|
208
|
-
if (
|
|
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__ */
|
|
216
|
+
children: [/* @__PURE__ */ O("button", {
|
|
211
217
|
type: "button",
|
|
212
|
-
onClick: () =>
|
|
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__ */
|
|
215
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
219
|
-
/* @__PURE__ */
|
|
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:
|
|
227
|
+
children: b("billing.subscriptions.noPlansAvailable", "No Other Plans Available")
|
|
222
228
|
}),
|
|
223
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ D("p", {
|
|
224
230
|
className: "text-sm text-text-secondary max-w-md mx-auto",
|
|
225
|
-
children:
|
|
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
|
|
231
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
235
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ O("div", { children: [
|
|
241
|
+
/* @__PURE__ */ O("button", {
|
|
236
242
|
type: "button",
|
|
237
|
-
onClick: () =>
|
|
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__ */
|
|
245
|
+
children: [/* @__PURE__ */ D(g, { className: "size-4" }), b("billing.subscriptions.backToSubscription", "Back to Subscription")]
|
|
240
246
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ D("h1", {
|
|
242
248
|
className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
|
|
243
|
-
children:
|
|
249
|
+
children: b("billing.subscriptions.changeYourPlan", "Change Your Plan")
|
|
244
250
|
}),
|
|
245
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ O("p", {
|
|
246
252
|
className: "text-text-secondary mt-1",
|
|
247
253
|
children: [
|
|
248
254
|
"Switch from ",
|
|
249
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ D("span", {
|
|
250
256
|
className: "font-medium",
|
|
251
|
-
children:
|
|
257
|
+
children: L.plan?.name
|
|
252
258
|
}),
|
|
253
259
|
" to a different plan"
|
|
254
260
|
]
|
|
255
261
|
}),
|
|
256
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ D(m, {
|
|
257
263
|
className: "mt-3",
|
|
258
|
-
children:
|
|
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__ */
|
|
267
|
+
/* @__PURE__ */ D("div", {
|
|
262
268
|
className: "bg-bg-sunken border border-border-subtle rounded-lg p-4",
|
|
263
|
-
children: /* @__PURE__ */
|
|
269
|
+
children: /* @__PURE__ */ O("div", {
|
|
264
270
|
className: "flex items-start justify-between",
|
|
265
|
-
children: [/* @__PURE__ */
|
|
271
|
+
children: [/* @__PURE__ */ O("div", {
|
|
266
272
|
className: "flex-1",
|
|
267
273
|
children: [
|
|
268
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ D("p", {
|
|
269
275
|
className: "text-sm text-text-secondary",
|
|
270
276
|
children: "Current Plan"
|
|
271
277
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ D("p", {
|
|
273
279
|
className: "font-semibold text-text-primary",
|
|
274
|
-
children:
|
|
280
|
+
children: L.plan?.name
|
|
275
281
|
}),
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
features:
|
|
278
|
-
isExpanded:
|
|
279
|
-
onToggle: () =>
|
|
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__ */
|
|
289
|
+
}), /* @__PURE__ */ O("div", {
|
|
284
290
|
className: "text-right shrink-0 ml-4",
|
|
285
|
-
children: [/* @__PURE__ */
|
|
291
|
+
children: [/* @__PURE__ */ D("p", {
|
|
286
292
|
className: "text-sm text-text-secondary",
|
|
287
293
|
children: "Price"
|
|
288
|
-
}), /* @__PURE__ */
|
|
294
|
+
}), /* @__PURE__ */ O("p", {
|
|
289
295
|
className: "font-semibold text-text-primary",
|
|
290
|
-
children: [i(
|
|
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(
|
|
301
|
+
a(L.plan?.duration || "monthly")
|
|
296
302
|
]
|
|
297
303
|
})]
|
|
298
304
|
})]
|
|
299
305
|
})]
|
|
300
306
|
})
|
|
301
307
|
}),
|
|
302
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ O("div", {
|
|
303
309
|
className: "space-y-3",
|
|
304
|
-
children: [/* @__PURE__ */
|
|
310
|
+
children: [/* @__PURE__ */ D("h2", {
|
|
305
311
|
className: "text-lg font-semibold text-text-primary",
|
|
306
312
|
children: "Select New Plan"
|
|
307
|
-
}), /* @__PURE__ */
|
|
313
|
+
}), /* @__PURE__ */ D("div", {
|
|
308
314
|
className: "grid gap-3",
|
|
309
|
-
children:
|
|
310
|
-
let t = e.price - (
|
|
311
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
319
|
+
children: [/* @__PURE__ */ D("button", {
|
|
314
320
|
type: "button",
|
|
315
|
-
onClick: () =>
|
|
321
|
+
onClick: () => H(e.id),
|
|
316
322
|
className: "w-full p-4 text-left",
|
|
317
|
-
children: /* @__PURE__ */
|
|
323
|
+
children: /* @__PURE__ */ O("div", {
|
|
318
324
|
className: "flex items-start justify-between",
|
|
319
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ O("div", {
|
|
320
326
|
className: "flex items-start gap-3",
|
|
321
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
324
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
332
|
+
children: [/* @__PURE__ */ D("p", {
|
|
327
333
|
className: "font-semibold text-text-primary",
|
|
328
334
|
children: e.name
|
|
329
|
-
}), t !== 0 && /* @__PURE__ */
|
|
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__ */
|
|
346
|
+
}), /* @__PURE__ */ O("div", {
|
|
341
347
|
className: "text-right shrink-0 ml-4",
|
|
342
|
-
children: [/* @__PURE__ */
|
|
348
|
+
children: [/* @__PURE__ */ D("p", {
|
|
343
349
|
className: "font-bold text-text-primary",
|
|
344
350
|
children: i(e.price, e.currency)
|
|
345
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
357
|
+
}), /* @__PURE__ */ D("div", {
|
|
352
358
|
className: "px-4 pb-4 pt-0 ml-8",
|
|
353
|
-
children: /* @__PURE__ */
|
|
359
|
+
children: /* @__PURE__ */ D(N, {
|
|
354
360
|
features: r,
|
|
355
361
|
isExpanded: o,
|
|
356
|
-
onToggle: () =>
|
|
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
|
-
|
|
365
|
-
let e =
|
|
366
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
375
|
+
/* @__PURE__ */ O("div", {
|
|
370
376
|
className: "flex items-center justify-center gap-4 py-2",
|
|
371
377
|
children: [
|
|
372
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ O("div", {
|
|
373
379
|
className: "text-center",
|
|
374
380
|
children: [
|
|
375
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ D("p", {
|
|
376
382
|
className: "text-xs text-text-secondary",
|
|
377
383
|
children: "From"
|
|
378
384
|
}),
|
|
379
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ D("p", {
|
|
380
386
|
className: "font-medium text-text-primary",
|
|
381
|
-
children:
|
|
387
|
+
children: L.plan?.name
|
|
382
388
|
}),
|
|
383
|
-
/* @__PURE__ */
|
|
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__ */
|
|
394
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ D(_, { className: "size-5 text-text-secondary" }),
|
|
400
|
+
/* @__PURE__ */ O("div", {
|
|
395
401
|
className: "text-center",
|
|
396
402
|
children: [
|
|
397
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ D("p", {
|
|
398
404
|
className: "text-xs text-text-secondary",
|
|
399
405
|
children: "To"
|
|
400
406
|
}),
|
|
401
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ D("p", {
|
|
402
408
|
className: "font-medium text-text-link",
|
|
403
|
-
children:
|
|
409
|
+
children: J.name
|
|
404
410
|
}),
|
|
405
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
427
|
+
/* @__PURE__ */ O("div", {
|
|
422
428
|
className: "flex items-center justify-end gap-3 pt-2 border-t border-border-subtle",
|
|
423
|
-
children: [/* @__PURE__ */
|
|
429
|
+
children: [/* @__PURE__ */ D("button", {
|
|
424
430
|
type: "button",
|
|
425
|
-
onClick: () =>
|
|
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__ */
|
|
434
|
+
}), /* @__PURE__ */ D("button", {
|
|
429
435
|
type: "button",
|
|
430
|
-
onClick:
|
|
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:
|
|
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 {
|
|
447
|
+
export { P as UpgradeSubscriptionPage };
|
|
442
448
|
|
|
443
449
|
//# sourceMappingURL=UpgradeSubscriptionPage.js.map
|