@burdenoff/microfe-billing 2026.1113.4 → 2026.1114.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/addons/pages/AddonsBrowsePage.js +293 -291
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +25 -24
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js +25 -24
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
- package/dist/billing/modules/billing/hooks/index.js +5 -5
- package/dist/billing/modules/billing/hooks/useInvoices.js +20 -39
- 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/InvoicesListPage.js +92 -89
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +2 -2
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +140 -140
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +16 -15
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +164 -137
- package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +444 -594
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +20 -20
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +1 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +32 -32
- package/dist/billing/modules/settings/pages/SettingsPage.js +4 -4
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +577 -640
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/shared/components/HeaderActions.d.ts +10 -0
- package/dist/billing/shared/components/HeaderActions.js +33 -0
- package/dist/billing/shared/components/HeaderActions.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/utils/format.js +4 -16
- 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 +286 -294
- package/dist/generated/global-operations.js.map +1 -1
- package/package.json +1 -1
- package/dist/billing/modules/dashboard/utils/overviewSummary.d.ts +0 -46
- package/dist/billing/modules/dashboard/utils/overviewSummary.js +0 -37
- package/dist/billing/modules/dashboard/utils/overviewSummary.js.map +0 -1
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.d.ts +0 -30
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js +0 -20
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js.map +0 -1
|
@@ -4,83 +4,93 @@ import { StatusPill as n } from "../../../shared/ui/StatusPill.js";
|
|
|
4
4
|
import { ProgressBar as r } from "../../../shared/ui/ProgressBar.js";
|
|
5
5
|
import { useBillingEventEmitter as i } from "../../../hooks/useBillingEventEmitter.js";
|
|
6
6
|
import { useBilling as a } from "../../../providers/BillingProvider.js";
|
|
7
|
-
import {
|
|
7
|
+
import { HeaderActions as o } from "../../../shared/components/HeaderActions.js";
|
|
8
|
+
import { useBillingAccountSelection as s } from "../../../hooks/useBillingAccountSelection.js";
|
|
8
9
|
import "../hooks/index.js";
|
|
9
|
-
import { useBillingPermissions as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { formatBytes as u, formatCurrency as d, formatDate as f, formatPercentage as p, formatPlanDuration as m, formatSubscriptionStatus as oe } from "../../../shared/utils/format.js";
|
|
15
|
-
import { getQuotaProgressColor as h, getSubscriptionStatusColor as se } from "../../../shared/utils/status.js";
|
|
10
|
+
import { useBillingPermissions as c } from "../../../hooks/useBillingPermissions.js";
|
|
11
|
+
import { useGetDefaultBillingAccountDashboardQuery as ee, useGetPlanQuery as te } from "../../../../generated/global-operations.js";
|
|
12
|
+
import { useMyWorkspaces as ne, useWorkspaceQuotaOverview as re } from "../../usage/hooks/useUsage.js";
|
|
13
|
+
import { formatBytes as l, formatCurrency as u, formatDate as d, formatPercentage as f, formatPlanDuration as p, formatSubscriptionStatus as ie } from "../../../shared/utils/format.js";
|
|
14
|
+
import { getQuotaProgressColor as m, getSubscriptionStatusColor as ae } from "../../../shared/utils/status.js";
|
|
16
15
|
import "../../../shared/ui/index.js";
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
16
|
+
import "../../../shared/components/index.js";
|
|
17
|
+
import { useIsFluidgridsVariant as oe } from "../../../hooks/useBillingVariant.js";
|
|
18
|
+
import { withBillingAccountId as h } from "../../../shared/utils/navigation.js";
|
|
19
|
+
import { PricingModel as g } from "../../../shared/types/graphql.js";
|
|
20
|
+
import { useSubscription as se, useSubscriptionMutations as ce } from "../hooks/useSubscriptions.js";
|
|
21
|
+
import { ManageSeatsModal as le } from "../components/ManageSeatsModal.js";
|
|
22
|
+
import { WorkspaceQuotaAssignmentModal as ue, isWorkspaceScopedQuota as _ } from "../../checkout/components/WorkspaceQuotaAssignmentModal.js";
|
|
23
|
+
import { useState as v } from "react";
|
|
24
|
+
import { EmphasisPanel as de, NextSteps as fe, PagePurpose as pe } from "@burdenoff/fe-libs/ui";
|
|
25
|
+
import { useParams as me } from "react-router";
|
|
26
|
+
import { Fragment as he, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
27
|
+
import { useI18n as ge } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
27
28
|
// src/billing/modules/subscriptions/pages/SubscriptionDetailPage.tsx
|
|
28
|
-
function
|
|
29
|
+
function x(e, t) {
|
|
29
30
|
if (t?.displayName && typeof t.displayName == "string") return t.displayName;
|
|
30
31
|
if (t?.label && typeof t.label == "string") return t.label;
|
|
31
32
|
let n = e.split(".");
|
|
32
33
|
return (n.length > 1 ? n.slice(1) : n).map((e) => e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase())).join(" ");
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
+
function S(e) {
|
|
35
36
|
return e === "DAILY" ? "Resets daily" : e === "MONTHLY" ? "Resets monthly" : "";
|
|
36
37
|
}
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
var C = ({ label: e, children: t }) => /* @__PURE__ */ b("div", {
|
|
39
|
+
className: "flex items-center justify-between gap-4 py-3",
|
|
40
|
+
children: [/* @__PURE__ */ y("dt", {
|
|
41
|
+
className: "text-sm text-text-secondary",
|
|
42
|
+
children: e
|
|
43
|
+
}), /* @__PURE__ */ y("dd", {
|
|
44
|
+
className: "text-sm font-medium text-text-primary text-right",
|
|
45
|
+
children: t
|
|
46
|
+
})]
|
|
47
|
+
}), w = () => {
|
|
48
|
+
let { t: l } = ge(), f = (e, t) => {
|
|
49
|
+
let n = l(e);
|
|
40
50
|
return n === e ? t : n;
|
|
41
|
-
}, { subscriptionId:
|
|
51
|
+
}, { subscriptionId: m } = me(), x = e(), { emit: S } = i(), { orgId: w } = a(), T = c(), E = oe(), { selectedAccountId: Se } = s({
|
|
42
52
|
orgId: w,
|
|
43
53
|
syncFromUrl: !0,
|
|
44
54
|
urlParamName: "billingAccountId"
|
|
45
|
-
}), { data:
|
|
55
|
+
}), { data: Ce } = ee({ fetchPolicy: "cache-first" }), D = Se ?? Ce?.getDefaultBillingAccount?.id ?? void 0, { subscription: O, isLoading: we, error: k, refetch: A } = se(m, D), { cancelSubscription: Te, isCanceling: j, updateSubscriptionSeats: Ee, isUpdatingSeats: De } = ce(), { workspaceId: M } = a(), { overview: Oe, refetch: ke } = re(M ?? void 0), N = (O?.activatedWorkspaceIds ?? []).find((e) => e !== M), { overview: Ae } = re(N), { workspaces: P } = ne(), F = P.length > 0 ? P : M ? [{
|
|
46
56
|
id: M,
|
|
47
57
|
name: "Current workspace"
|
|
48
|
-
}] : [], { data:
|
|
58
|
+
}] : [], { data: je } = te({
|
|
49
59
|
variables: { id: O?.plan?.id ?? "" },
|
|
50
60
|
skip: !O?.plan?.id,
|
|
51
61
|
fetchPolicy: "cache-first"
|
|
52
|
-
}), [
|
|
62
|
+
}), [Me, I] = v(!1), [Ne, L] = v(!1), [Pe, R] = v(!1), [z, B] = v(""), [Fe, V] = v(null), Ie = async () => {
|
|
53
63
|
if (O) {
|
|
54
64
|
V(null);
|
|
55
65
|
try {
|
|
56
|
-
await
|
|
66
|
+
await Te({
|
|
57
67
|
billingAccountId: D ?? O.billingAccountId,
|
|
58
68
|
subscriptionId: O.id,
|
|
59
|
-
reason:
|
|
60
|
-
}),
|
|
69
|
+
reason: z || "User requested cancellation"
|
|
70
|
+
}), S("billing.subscription.cancelled", {
|
|
61
71
|
route: "/billing/subscriptions",
|
|
62
72
|
entityId: O.id,
|
|
63
73
|
source: "subscription-detail",
|
|
64
|
-
reason:
|
|
65
|
-
}),
|
|
74
|
+
reason: z || "User requested cancellation"
|
|
75
|
+
}), I(!1), B(""), await A();
|
|
66
76
|
} catch (e) {
|
|
67
77
|
V(e instanceof Error ? e.message : "Failed to cancel subscription");
|
|
68
78
|
}
|
|
69
79
|
}
|
|
70
80
|
};
|
|
71
|
-
if (!T.canViewSubscriptions) return /* @__PURE__ */
|
|
81
|
+
if (!T.canViewSubscriptions) return /* @__PURE__ */ y("div", {
|
|
72
82
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
73
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ b("div", {
|
|
74
84
|
className: "text-center space-y-2",
|
|
75
85
|
children: [
|
|
76
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ y("div", {
|
|
77
87
|
className: "size-12 mx-auto rounded-full bg-[var(--color-accent-soft)] flex items-center justify-center",
|
|
78
|
-
children: /* @__PURE__ */
|
|
88
|
+
children: /* @__PURE__ */ y("svg", {
|
|
79
89
|
className: "size-6 text-text-secondary",
|
|
80
90
|
fill: "none",
|
|
81
91
|
viewBox: "0 0 24 24",
|
|
82
92
|
stroke: "currentColor",
|
|
83
|
-
children: /* @__PURE__ */
|
|
93
|
+
children: /* @__PURE__ */ y("path", {
|
|
84
94
|
strokeLinecap: "round",
|
|
85
95
|
strokeLinejoin: "round",
|
|
86
96
|
strokeWidth: 2,
|
|
@@ -88,46 +98,46 @@ var w = () => {
|
|
|
88
98
|
})
|
|
89
99
|
})
|
|
90
100
|
}),
|
|
91
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ y("h2", {
|
|
92
102
|
className: "text-lg font-semibold text-text-primary",
|
|
93
103
|
children: "Access Denied"
|
|
94
104
|
}),
|
|
95
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ y("p", {
|
|
96
106
|
className: "text-sm text-text-secondary max-w-sm",
|
|
97
107
|
children: "You don't have permission to view this subscription."
|
|
98
108
|
})
|
|
99
109
|
]
|
|
100
110
|
})
|
|
101
111
|
});
|
|
102
|
-
if (
|
|
112
|
+
if (we) return /* @__PURE__ */ b("div", {
|
|
103
113
|
className: "space-y-6 px-6 lg:px-8 py-6",
|
|
104
|
-
children: [/* @__PURE__ */
|
|
114
|
+
children: [/* @__PURE__ */ b("div", {
|
|
105
115
|
className: "flex items-center gap-4",
|
|
106
|
-
children: [/* @__PURE__ */
|
|
107
|
-
}), /* @__PURE__ */
|
|
116
|
+
children: [/* @__PURE__ */ y("div", { className: "size-10 bg-bg-sunken animate-pulse rounded-button" }), /* @__PURE__ */ y("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" })]
|
|
117
|
+
}), /* @__PURE__ */ y("div", {
|
|
108
118
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
109
|
-
children: /* @__PURE__ */
|
|
119
|
+
children: /* @__PURE__ */ y("div", {
|
|
110
120
|
className: "lg:col-span-2 space-y-6",
|
|
111
|
-
children: /* @__PURE__ */
|
|
121
|
+
children: /* @__PURE__ */ b("div", {
|
|
112
122
|
className: "border border-border-seam rounded-card bg-bg-surface shadow-elevation-1 p-5 space-y-4",
|
|
113
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ y("div", { className: "h-6 w-32 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ y("div", { className: "h-4 w-full bg-bg-sunken animate-pulse rounded" })]
|
|
114
124
|
})
|
|
115
125
|
})
|
|
116
126
|
})]
|
|
117
127
|
});
|
|
118
|
-
if (k || !O) return /* @__PURE__ */
|
|
128
|
+
if (k || !O) return /* @__PURE__ */ y("div", {
|
|
119
129
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
120
|
-
children: /* @__PURE__ */
|
|
130
|
+
children: /* @__PURE__ */ b("div", {
|
|
121
131
|
className: "text-center space-y-4",
|
|
122
132
|
children: [
|
|
123
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ y("div", {
|
|
124
134
|
className: "size-12 mx-auto rounded-full bg-status-error-bg-subtle flex items-center justify-center",
|
|
125
|
-
children: /* @__PURE__ */
|
|
135
|
+
children: /* @__PURE__ */ y("svg", {
|
|
126
136
|
className: "size-6 text-status-error-text",
|
|
127
137
|
fill: "none",
|
|
128
138
|
viewBox: "0 0 24 24",
|
|
129
139
|
stroke: "currentColor",
|
|
130
|
-
children: /* @__PURE__ */
|
|
140
|
+
children: /* @__PURE__ */ y("path", {
|
|
131
141
|
strokeLinecap: "round",
|
|
132
142
|
strokeLinejoin: "round",
|
|
133
143
|
strokeWidth: 2,
|
|
@@ -135,24 +145,24 @@ var w = () => {
|
|
|
135
145
|
})
|
|
136
146
|
})
|
|
137
147
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ y("h2", {
|
|
139
149
|
className: "text-lg font-semibold text-text-primary",
|
|
140
|
-
children:
|
|
150
|
+
children: f("billing.subscriptions.notFound", "Subscription not found")
|
|
141
151
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ y("p", {
|
|
143
153
|
className: "text-sm text-text-secondary",
|
|
144
154
|
children: k?.message || "The subscription you are looking for does not exist."
|
|
145
155
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ y("button", {
|
|
147
157
|
type: "button",
|
|
148
|
-
onClick: () =>
|
|
158
|
+
onClick: () => x(h("/subscriptions", D)),
|
|
149
159
|
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200",
|
|
150
160
|
children: "Back to Subscriptions"
|
|
151
161
|
})
|
|
152
162
|
]
|
|
153
163
|
})
|
|
154
164
|
});
|
|
155
|
-
let H = O.plan, U = (O.quotas || []).filter((e) => !
|
|
165
|
+
let H = O.plan, U = (O.quotas || []).filter((e) => !_(e.name)), W = O.addonSubscriptions || [], G = O.transactions || [], K = O.history || [], Le = ae(O.status), q = O.status === "active", J = [...Oe, ...Ae].filter((e) => e.assignment.subscriptionId === O.id && e.assignment.isActive), Y = M ? (O.activatedWorkspaceIds?.includes(M) ?? !1) || J.length > 0 : !1, X = O.activatedWorkspaceIds?.length ?? 0, Z = H?.maxWorkspaces ?? 1, Q = !Y && X >= Z, Re = (je?.getPlan?.features ?? []).filter((e) => e != null).filter((e) => e.quota?.name && _(e.quota.name)).map((e) => {
|
|
156
166
|
let t = e.quota?.limits, n = t && "type" in t ? String(t.type) : "number", r = e.context && "quantity" in e.context ? Number(e.context.quantity) : null, i = t && "value" in t ? Number(t.value) : null, a = r ?? i;
|
|
157
167
|
return {
|
|
158
168
|
quotaName: e.quota.name,
|
|
@@ -162,633 +172,560 @@ var w = () => {
|
|
|
162
172
|
resetPeriod: "NEVER",
|
|
163
173
|
quotaMode: e.quota?.quotaType === "POOLED" ? "pooled" : "dedicated"
|
|
164
174
|
};
|
|
165
|
-
}),
|
|
175
|
+
}), ze = new Date(O.endDate), Be = new Date(O.startDate), Ve = /* @__PURE__ */ new Date(), He = Math.ceil((ze.getTime() - Be.getTime()) / 864e5), $ = Math.max(0, Math.ceil((ze.getTime() - Ve.getTime()) / 864e5)), Ue = Math.round((He - $) / He * 100), We = [
|
|
166
176
|
...q && T.canUpdateSubscription ? [{
|
|
167
177
|
id: "change-plan",
|
|
168
178
|
label: "Review or change your plan",
|
|
169
179
|
description: "Upgrade, downgrade, or compare what each tier includes.",
|
|
170
|
-
onClick: () =>
|
|
180
|
+
onClick: () => x(h(`/subscriptions/${O.id}/upgrade`, D ?? O.billingAccountId))
|
|
171
181
|
}] : [],
|
|
172
182
|
...q && M && !Y && !Q ? [{
|
|
173
183
|
id: "activate-workspace",
|
|
174
184
|
label: "Activate quotas for your workspace",
|
|
175
185
|
description: "Turn on the workspace-scoped limits included in this plan.",
|
|
176
|
-
onClick: () =>
|
|
186
|
+
onClick: () => R(!0)
|
|
177
187
|
}] : [],
|
|
178
188
|
{
|
|
179
189
|
id: "track-usage",
|
|
180
190
|
label: "Track your usage",
|
|
181
191
|
description: "See how much of your included quota you have consumed.",
|
|
182
|
-
onClick: () =>
|
|
192
|
+
onClick: () => x(h("/usage", D ?? O.billingAccountId))
|
|
183
193
|
},
|
|
184
194
|
{
|
|
185
195
|
id: "view-invoices",
|
|
186
196
|
label: "Review invoices & payments",
|
|
187
197
|
description: "Check what has been billed for this subscription.",
|
|
188
|
-
onClick: () =>
|
|
198
|
+
onClick: () => x(h("/invoices", D ?? O.billingAccountId))
|
|
189
199
|
}
|
|
190
|
-
]
|
|
191
|
-
|
|
192
|
-
children: [/* @__PURE__ */ x("div", {
|
|
193
|
-
className: "p-5 border-b border-border-subtle",
|
|
194
|
-
children: [/* @__PURE__ */ x("h2", {
|
|
195
|
-
className: "text-base font-semibold text-text-primary",
|
|
196
|
-
children: ["Plan Quotas", U.length > 0 && /* @__PURE__ */ x("span", {
|
|
197
|
-
className: "ml-2 text-sm font-normal text-text-muted tabular-nums",
|
|
198
|
-
children: [
|
|
199
|
-
"(",
|
|
200
|
-
U.length,
|
|
201
|
-
")"
|
|
202
|
-
]
|
|
203
|
-
})]
|
|
204
|
-
}), /* @__PURE__ */ b("p", {
|
|
205
|
-
className: "text-sm text-text-secondary mt-0.5",
|
|
206
|
-
children: "Limits included in your plan"
|
|
207
|
-
})]
|
|
208
|
-
}), /* @__PURE__ */ b("div", {
|
|
209
|
-
className: "p-5",
|
|
210
|
-
children: U.length === 0 ? /* @__PURE__ */ b("p", {
|
|
211
|
-
className: "text-sm text-text-secondary",
|
|
212
|
-
children: "No quotas assigned to this subscription."
|
|
213
|
-
}) : /* @__PURE__ */ b("div", {
|
|
214
|
-
className: "space-y-3",
|
|
215
|
-
children: U.map((e) => /* @__PURE__ */ b(xe, { quota: e }, e.id))
|
|
216
|
-
})
|
|
217
|
-
})]
|
|
218
|
-
}), Ze = q && M && /* @__PURE__ */ x(t, {
|
|
219
|
-
className: "overflow-hidden",
|
|
220
|
-
children: [
|
|
221
|
-
/* @__PURE__ */ x("div", {
|
|
222
|
-
className: "p-5 border-b border-border-subtle flex items-center justify-between gap-4",
|
|
223
|
-
children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("h2", {
|
|
224
|
-
className: "text-base font-semibold text-text-primary",
|
|
225
|
-
children: "Workspace Quotas"
|
|
226
|
-
}), /* @__PURE__ */ b("p", {
|
|
227
|
-
className: "text-sm text-text-secondary mt-0.5",
|
|
228
|
-
children: "Active limits for your workspace"
|
|
229
|
-
})] }), Y ? /* @__PURE__ */ b(n, {
|
|
230
|
-
status: "success",
|
|
231
|
-
dot: !0,
|
|
232
|
-
children: "Active"
|
|
233
|
-
}) : Q ? /* @__PURE__ */ b(n, {
|
|
234
|
-
status: "warning",
|
|
235
|
-
dot: !0,
|
|
236
|
-
children: "At workspace limit"
|
|
237
|
-
}) : /* @__PURE__ */ b("button", {
|
|
238
|
-
type: "button",
|
|
239
|
-
onClick: () => L(!0),
|
|
240
|
-
className: "px-3 py-1.5 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200",
|
|
241
|
-
children: "Activate for Workspace"
|
|
242
|
-
})]
|
|
243
|
-
}),
|
|
244
|
-
/* @__PURE__ */ b("div", {
|
|
245
|
-
className: "p-5",
|
|
246
|
-
children: Y ? J.length > 0 ? /* @__PURE__ */ b("div", {
|
|
247
|
-
className: "space-y-3",
|
|
248
|
-
children: J.map((e) => /* @__PURE__ */ b(Se, { item: e }, e.assignment.id))
|
|
249
|
-
}) : /* @__PURE__ */ x("p", {
|
|
250
|
-
className: "text-sm text-text-secondary",
|
|
251
|
-
children: [
|
|
252
|
-
"Quotas are activated on workspace",
|
|
253
|
-
" ",
|
|
254
|
-
/* @__PURE__ */ b("span", {
|
|
255
|
-
className: "font-mono text-xs text-text-primary bg-bg-sunken/60 rounded px-1.5 py-0.5",
|
|
256
|
-
children: M
|
|
257
|
-
}),
|
|
258
|
-
". Usage data will appear here once quotas are consumed."
|
|
259
|
-
]
|
|
260
|
-
}) : Q ? /* @__PURE__ */ x("div", {
|
|
261
|
-
className: "flex items-start gap-3",
|
|
262
|
-
children: [/* @__PURE__ */ b("div", {
|
|
263
|
-
className: "size-8 rounded-full bg-status-warning-bg-subtle flex items-center justify-center shrink-0 mt-0.5",
|
|
264
|
-
children: /* @__PURE__ */ b("svg", {
|
|
265
|
-
className: "size-4 text-status-warning-text",
|
|
266
|
-
fill: "none",
|
|
267
|
-
viewBox: "0 0 24 24",
|
|
268
|
-
stroke: "currentColor",
|
|
269
|
-
children: /* @__PURE__ */ b("path", {
|
|
270
|
-
strokeLinecap: "round",
|
|
271
|
-
strokeLinejoin: "round",
|
|
272
|
-
strokeWidth: 2,
|
|
273
|
-
d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
|
274
|
-
})
|
|
275
|
-
})
|
|
276
|
-
}), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
277
|
-
className: "text-sm font-medium text-text-primary",
|
|
278
|
-
children: "Already active on another workspace"
|
|
279
|
-
}), /* @__PURE__ */ x("p", {
|
|
280
|
-
className: "text-sm text-text-secondary mt-0.5",
|
|
281
|
-
children: [
|
|
282
|
-
H?.name ?? "This plan",
|
|
283
|
-
" can be activated for",
|
|
284
|
-
" ",
|
|
285
|
-
Z === 1 ? "only 1 workspace" : `at most ${Z} workspaces`,
|
|
286
|
-
", and ",
|
|
287
|
-
X === 1 ? "it" : `${X} of them`,
|
|
288
|
-
" ",
|
|
289
|
-
N && /* @__PURE__ */ x(y, { children: [
|
|
290
|
-
"(",
|
|
291
|
-
/* @__PURE__ */ b("span", {
|
|
292
|
-
className: "font-mono text-xs bg-bg-sunken/60 rounded px-1.5 py-0.5",
|
|
293
|
-
children: P.find((e) => e.id === N)?.name ?? N
|
|
294
|
-
}),
|
|
295
|
-
")",
|
|
296
|
-
" "
|
|
297
|
-
] }),
|
|
298
|
-
X === 1 ? "is" : "are",
|
|
299
|
-
" already using it. Switch to that workspace to see its quotas, or remove it there to free up the slot for this one."
|
|
300
|
-
]
|
|
301
|
-
})] })]
|
|
302
|
-
}) : /* @__PURE__ */ x("div", {
|
|
303
|
-
className: "flex items-start gap-3",
|
|
304
|
-
children: [/* @__PURE__ */ b("div", {
|
|
305
|
-
className: "size-8 rounded-full bg-status-warning-bg-subtle flex items-center justify-center shrink-0 mt-0.5",
|
|
306
|
-
children: /* @__PURE__ */ b("svg", {
|
|
307
|
-
className: "size-4 text-status-warning-text",
|
|
308
|
-
fill: "none",
|
|
309
|
-
viewBox: "0 0 24 24",
|
|
310
|
-
stroke: "currentColor",
|
|
311
|
-
children: /* @__PURE__ */ b("path", {
|
|
312
|
-
strokeLinecap: "round",
|
|
313
|
-
strokeLinejoin: "round",
|
|
314
|
-
strokeWidth: 2,
|
|
315
|
-
d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
|
316
|
-
})
|
|
317
|
-
})
|
|
318
|
-
}), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
319
|
-
className: "text-sm font-medium text-text-primary",
|
|
320
|
-
children: "Workspace quotas not activated yet"
|
|
321
|
-
}), /* @__PURE__ */ x("p", {
|
|
322
|
-
className: "text-sm text-text-secondary mt-0.5",
|
|
323
|
-
children: [
|
|
324
|
-
"Click",
|
|
325
|
-
" ",
|
|
326
|
-
/* @__PURE__ */ b("button", {
|
|
327
|
-
type: "button",
|
|
328
|
-
onClick: () => L(!0),
|
|
329
|
-
className: "text-text-link hover:underline font-medium",
|
|
330
|
-
children: "Activate for Workspace"
|
|
331
|
-
}),
|
|
332
|
-
" ",
|
|
333
|
-
"to enable the workspace-scoped limits included in this plan."
|
|
334
|
-
]
|
|
335
|
-
})] })]
|
|
336
|
-
})
|
|
337
|
-
}),
|
|
338
|
-
ze && /* @__PURE__ */ b(fe, {
|
|
339
|
-
billingAccountId: D ?? O.billingAccountId,
|
|
340
|
-
subscriptionId: O.id,
|
|
341
|
-
quotas: He,
|
|
342
|
-
workspaces: P,
|
|
343
|
-
currentWorkspaceId: M,
|
|
344
|
-
onAssigned: () => {
|
|
345
|
-
L(!1), A(), Ne();
|
|
346
|
-
},
|
|
347
|
-
onSkip: () => L(!1)
|
|
348
|
-
})
|
|
349
|
-
]
|
|
350
|
-
}), Qe = W.length > 0 && /* @__PURE__ */ x(t, {
|
|
351
|
-
className: "overflow-hidden",
|
|
352
|
-
children: [/* @__PURE__ */ b("div", {
|
|
353
|
-
className: "p-5 border-b border-border-subtle",
|
|
354
|
-
children: /* @__PURE__ */ x("h2", {
|
|
355
|
-
className: "text-base font-semibold text-text-primary",
|
|
356
|
-
children: [
|
|
357
|
-
"Addons",
|
|
358
|
-
" ",
|
|
359
|
-
/* @__PURE__ */ x("span", {
|
|
360
|
-
className: "text-sm font-normal text-text-muted tabular-nums",
|
|
361
|
-
children: [
|
|
362
|
-
"(",
|
|
363
|
-
W.length,
|
|
364
|
-
")"
|
|
365
|
-
]
|
|
366
|
-
})
|
|
367
|
-
]
|
|
368
|
-
})
|
|
369
|
-
}), /* @__PURE__ */ b("div", {
|
|
370
|
-
className: "p-5",
|
|
371
|
-
children: /* @__PURE__ */ b("div", {
|
|
372
|
-
className: "space-y-3",
|
|
373
|
-
children: W.map((e) => /* @__PURE__ */ b(Ce, { addonSubscription: e }, e.id))
|
|
374
|
-
})
|
|
375
|
-
})]
|
|
376
|
-
}), $e = G.length > 0 && /* @__PURE__ */ x(t, {
|
|
377
|
-
className: "overflow-hidden",
|
|
378
|
-
children: [
|
|
379
|
-
/* @__PURE__ */ b("div", {
|
|
380
|
-
className: "p-5 border-b border-border-subtle",
|
|
381
|
-
children: /* @__PURE__ */ b("h2", {
|
|
382
|
-
className: "text-base font-semibold text-text-primary",
|
|
383
|
-
children: "Recent Transactions"
|
|
384
|
-
})
|
|
385
|
-
}),
|
|
386
|
-
/* @__PURE__ */ b("div", {
|
|
387
|
-
className: "divide-y divide-border-subtle",
|
|
388
|
-
children: G.slice(0, 5).map((e) => /* @__PURE__ */ b(we, { transaction: e }, e.id))
|
|
389
|
-
}),
|
|
390
|
-
G.length > 5 && /* @__PURE__ */ b("div", {
|
|
391
|
-
className: "p-4 text-center border-t border-border-subtle",
|
|
392
|
-
children: /* @__PURE__ */ b("button", {
|
|
393
|
-
type: "button",
|
|
394
|
-
className: "text-sm text-text-link hover:underline",
|
|
395
|
-
children: "View all transactions"
|
|
396
|
-
})
|
|
397
|
-
})
|
|
398
|
-
]
|
|
399
|
-
}), et = /* @__PURE__ */ b(ge, {
|
|
400
|
-
storageKey: "billing-subscription-detail",
|
|
401
|
-
steps: Ye
|
|
402
|
-
}), tt = /* @__PURE__ */ x(t, {
|
|
403
|
-
className: "overflow-hidden",
|
|
404
|
-
children: [/* @__PURE__ */ b("div", {
|
|
405
|
-
className: "p-5 border-b border-border-subtle",
|
|
406
|
-
children: /* @__PURE__ */ b("h2", {
|
|
407
|
-
className: "text-base font-semibold text-text-primary",
|
|
408
|
-
children: "Details"
|
|
409
|
-
})
|
|
410
|
-
}), /* @__PURE__ */ x("div", {
|
|
411
|
-
className: "p-5 space-y-4",
|
|
412
|
-
children: [
|
|
413
|
-
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
414
|
-
className: "text-sm text-text-secondary",
|
|
415
|
-
children: "Subscription ID"
|
|
416
|
-
}), /* @__PURE__ */ b("p", {
|
|
417
|
-
className: "font-mono text-sm text-text-primary mt-0.5 break-all",
|
|
418
|
-
children: O.id
|
|
419
|
-
})] }),
|
|
420
|
-
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
421
|
-
className: "text-sm text-text-secondary",
|
|
422
|
-
children: "Plan"
|
|
423
|
-
}), /* @__PURE__ */ b("p", {
|
|
424
|
-
className: "text-sm text-text-primary mt-0.5",
|
|
425
|
-
children: H?.name || "Unknown"
|
|
426
|
-
})] }),
|
|
427
|
-
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
428
|
-
className: "text-sm text-text-secondary",
|
|
429
|
-
children: "Billing Account"
|
|
430
|
-
}), /* @__PURE__ */ b("p", {
|
|
431
|
-
className: "text-sm text-text-primary mt-0.5",
|
|
432
|
-
children: O.billingAccount?.name || "Unknown"
|
|
433
|
-
})] }),
|
|
434
|
-
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
435
|
-
className: "text-sm text-text-secondary",
|
|
436
|
-
children: "Start Date"
|
|
437
|
-
}), /* @__PURE__ */ b("p", {
|
|
438
|
-
className: "text-sm text-text-primary mt-0.5",
|
|
439
|
-
children: f(O.startDate)
|
|
440
|
-
})] }),
|
|
441
|
-
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
442
|
-
className: "text-sm text-text-secondary",
|
|
443
|
-
children: "End Date"
|
|
444
|
-
}), /* @__PURE__ */ b("p", {
|
|
445
|
-
className: "text-sm text-text-primary mt-0.5",
|
|
446
|
-
children: f(O.endDate)
|
|
447
|
-
})] }),
|
|
448
|
-
O.nextBillingDate && /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
449
|
-
className: "text-sm text-text-secondary",
|
|
450
|
-
children: "Next Billing"
|
|
451
|
-
}), /* @__PURE__ */ b("p", {
|
|
452
|
-
className: "text-sm text-text-primary mt-0.5",
|
|
453
|
-
children: f(O.nextBillingDate)
|
|
454
|
-
})] }),
|
|
455
|
-
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
456
|
-
className: "text-sm text-text-secondary",
|
|
457
|
-
children: "Auto Renewal"
|
|
458
|
-
}), /* @__PURE__ */ b("p", {
|
|
459
|
-
className: "text-sm text-text-primary mt-0.5",
|
|
460
|
-
children: O.autoRenewal ? "Enabled" : "Disabled"
|
|
461
|
-
})] }),
|
|
462
|
-
O.paymentGateway && /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
463
|
-
className: "text-sm text-text-secondary",
|
|
464
|
-
children: "Payment Gateway"
|
|
465
|
-
}), /* @__PURE__ */ b("p", {
|
|
466
|
-
className: "text-sm text-text-primary mt-0.5 capitalize",
|
|
467
|
-
children: O.paymentGateway
|
|
468
|
-
})] })
|
|
469
|
-
]
|
|
470
|
-
})]
|
|
471
|
-
}), nt = K.length > 0 && /* @__PURE__ */ x(t, {
|
|
472
|
-
className: "overflow-hidden",
|
|
473
|
-
children: [/* @__PURE__ */ b("div", {
|
|
474
|
-
className: "p-5 border-b border-border-subtle",
|
|
475
|
-
children: /* @__PURE__ */ b("h2", {
|
|
476
|
-
className: "text-base font-semibold text-text-primary",
|
|
477
|
-
children: "History"
|
|
478
|
-
})
|
|
479
|
-
}), /* @__PURE__ */ b("div", {
|
|
480
|
-
className: "p-5",
|
|
481
|
-
children: /* @__PURE__ */ b("div", {
|
|
482
|
-
className: "space-y-3",
|
|
483
|
-
children: K.slice(0, 5).map((e) => /* @__PURE__ */ b(Te, { item: e }, e.id))
|
|
484
|
-
})
|
|
485
|
-
})]
|
|
486
|
-
}), $ = te({
|
|
487
|
-
isFluidgrids: E,
|
|
488
|
-
isActive: q,
|
|
489
|
-
canUpdate: T.canUpdateSubscription,
|
|
490
|
-
canCancel: T.canCancelSubscription,
|
|
491
|
-
cancellationScheduled: !!O.canceledAt,
|
|
492
|
-
perSeatPlan: H?.pricingModel === ue.PER_SEAT
|
|
493
|
-
}), rt = ee(H?.name), it = p("billing.subscription.moreOptions", "More options"), at = /* @__PURE__ */ x(t, {
|
|
494
|
-
className: "overflow-hidden",
|
|
495
|
-
children: [/* @__PURE__ */ b("div", {
|
|
496
|
-
className: "p-5 border-b border-border-subtle",
|
|
497
|
-
children: /* @__PURE__ */ b("h2", {
|
|
498
|
-
className: "text-base font-semibold text-text-primary",
|
|
499
|
-
children: p("billing.subscription.summary", "Summary")
|
|
500
|
-
})
|
|
501
|
-
}), /* @__PURE__ */ x("div", {
|
|
502
|
-
className: "p-5 grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
503
|
-
children: [
|
|
504
|
-
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
505
|
-
className: "text-sm text-text-secondary",
|
|
506
|
-
children: p("billing.subscription.plan", "Plan")
|
|
507
|
-
}), /* @__PURE__ */ b("p", {
|
|
508
|
-
className: "text-sm text-text-primary mt-0.5",
|
|
509
|
-
children: H?.name || "Unknown"
|
|
510
|
-
})] }),
|
|
511
|
-
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
512
|
-
className: "text-sm text-text-secondary",
|
|
513
|
-
children: p("billing.subscription.status", "Status")
|
|
514
|
-
}), /* @__PURE__ */ b("p", {
|
|
515
|
-
className: "text-sm text-text-primary mt-0.5",
|
|
516
|
-
children: oe(O.status)
|
|
517
|
-
})] }),
|
|
518
|
-
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
519
|
-
className: "text-sm text-text-secondary",
|
|
520
|
-
children: ne(O.nextBillingDate) === "nextBilling" ? p("billing.subscription.nextBill", "Next bill") : O.canceledAt ? p("billing.subscription.endsOn", "Ends on") : p("billing.subscription.renewsOn", "Renews on")
|
|
521
|
-
}), /* @__PURE__ */ b("p", {
|
|
522
|
-
className: "text-sm text-text-primary mt-0.5",
|
|
523
|
-
children: f(O.nextBillingDate ?? O.endDate)
|
|
524
|
-
})] }),
|
|
525
|
-
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
526
|
-
className: "text-sm text-text-secondary",
|
|
527
|
-
children: p("billing.subscription.autoRenewal", "Auto renewal")
|
|
528
|
-
}), /* @__PURE__ */ b("p", {
|
|
529
|
-
className: "text-sm text-text-primary mt-0.5",
|
|
530
|
-
children: O.autoRenewal ? p("billing.subscription.enabled", "Enabled") : p("billing.subscription.disabled", "Disabled")
|
|
531
|
-
})] })
|
|
532
|
-
]
|
|
533
|
-
})]
|
|
534
|
-
}), ot = /* @__PURE__ */ b(_e, {
|
|
535
|
-
storageKey: "billing.subscription.more",
|
|
536
|
-
label: it,
|
|
537
|
-
children: /* @__PURE__ */ x("div", {
|
|
538
|
-
className: "space-y-6",
|
|
539
|
-
children: [
|
|
540
|
-
/* @__PURE__ */ b(t, {
|
|
541
|
-
className: "overflow-hidden",
|
|
542
|
-
children: /* @__PURE__ */ x("div", {
|
|
543
|
-
className: "p-5 space-y-4",
|
|
544
|
-
children: [
|
|
545
|
-
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
546
|
-
className: "text-sm text-text-secondary",
|
|
547
|
-
children: p("billing.subscription.id", "Subscription ID")
|
|
548
|
-
}), /* @__PURE__ */ b(v, {
|
|
549
|
-
copyable: !0,
|
|
550
|
-
children: O.id
|
|
551
|
-
})] }),
|
|
552
|
-
O.paymentGateway && /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
553
|
-
className: "text-sm text-text-secondary",
|
|
554
|
-
children: p("billing.subscription.gateway", "Payment gateway")
|
|
555
|
-
}), /* @__PURE__ */ b(v, {
|
|
556
|
-
copyable: !0,
|
|
557
|
-
children: O.paymentGateway
|
|
558
|
-
})] }),
|
|
559
|
-
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
560
|
-
className: "text-sm text-text-secondary",
|
|
561
|
-
children: p("billing.subscription.billingAccount", "Billing account")
|
|
562
|
-
}), /* @__PURE__ */ b("p", {
|
|
563
|
-
className: "text-sm text-text-primary mt-0.5",
|
|
564
|
-
children: O.billingAccount?.name || "Unknown"
|
|
565
|
-
})] }),
|
|
566
|
-
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
567
|
-
className: "text-sm text-text-secondary",
|
|
568
|
-
children: p("billing.subscription.startDate", "Start date")
|
|
569
|
-
}), /* @__PURE__ */ b("p", {
|
|
570
|
-
className: "text-sm text-text-primary mt-0.5",
|
|
571
|
-
children: f(O.startDate)
|
|
572
|
-
})] }),
|
|
573
|
-
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
574
|
-
className: "text-sm text-text-secondary",
|
|
575
|
-
children: p("billing.subscription.endDate", "End date")
|
|
576
|
-
}), /* @__PURE__ */ b("p", {
|
|
577
|
-
className: "text-sm text-text-primary mt-0.5",
|
|
578
|
-
children: f(O.endDate)
|
|
579
|
-
})] }),
|
|
580
|
-
$.foldManageSeats && /* @__PURE__ */ b("button", {
|
|
581
|
-
type: "button",
|
|
582
|
-
onClick: () => I(!0),
|
|
583
|
-
className: "px-3 py-1.5 text-sm font-medium border border-border-subtle rounded-button text-text-primary hover:bg-bg-sunken transition-colors duration-200",
|
|
584
|
-
children: p("billing.subscription.manageSeats", "Manage seats")
|
|
585
|
-
})
|
|
586
|
-
]
|
|
587
|
-
})
|
|
588
|
-
}),
|
|
589
|
-
Xe,
|
|
590
|
-
Ze,
|
|
591
|
-
Qe,
|
|
592
|
-
$e,
|
|
593
|
-
nt,
|
|
594
|
-
et
|
|
595
|
-
]
|
|
596
|
-
})
|
|
597
|
-
});
|
|
598
|
-
return /* @__PURE__ */ x("div", {
|
|
200
|
+
];
|
|
201
|
+
return /* @__PURE__ */ b("div", {
|
|
599
202
|
className: "space-y-6 px-6 lg:px-8 py-6",
|
|
600
203
|
children: [
|
|
601
|
-
/* @__PURE__ */
|
|
602
|
-
className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
|
|
603
|
-
children: [/* @__PURE__ */
|
|
604
|
-
className: "flex items-start gap-4",
|
|
605
|
-
children: [/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ b("div", {
|
|
205
|
+
className: E ? "flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between" : "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
|
|
206
|
+
children: [/* @__PURE__ */ b("div", {
|
|
207
|
+
className: E ? "flex min-w-0 items-start gap-4" : "flex items-start gap-4",
|
|
208
|
+
children: [/* @__PURE__ */ y("button", {
|
|
606
209
|
type: "button",
|
|
607
210
|
"aria-label": "Back to subscriptions",
|
|
608
|
-
onClick: () =>
|
|
211
|
+
onClick: () => x(h("/subscriptions", D)),
|
|
609
212
|
className: "p-2 -ml-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken rounded-button transition-colors duration-200",
|
|
610
|
-
children: /* @__PURE__ */
|
|
213
|
+
children: /* @__PURE__ */ y("svg", {
|
|
611
214
|
className: "size-5",
|
|
612
215
|
fill: "none",
|
|
613
216
|
viewBox: "0 0 24 24",
|
|
614
217
|
stroke: "currentColor",
|
|
615
|
-
children: /* @__PURE__ */
|
|
218
|
+
children: /* @__PURE__ */ y("path", {
|
|
616
219
|
strokeLinecap: "round",
|
|
617
220
|
strokeLinejoin: "round",
|
|
618
221
|
strokeWidth: 2,
|
|
619
222
|
d: "M15 19l-7-7 7-7"
|
|
620
223
|
})
|
|
621
224
|
})
|
|
622
|
-
}), /* @__PURE__ */
|
|
623
|
-
/* @__PURE__ */
|
|
225
|
+
}), /* @__PURE__ */ b("div", { children: [
|
|
226
|
+
/* @__PURE__ */ b("div", {
|
|
624
227
|
className: "flex items-center gap-3 flex-wrap",
|
|
625
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ y("h1", {
|
|
626
229
|
className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
|
|
627
230
|
children: H?.name || "Subscription"
|
|
628
|
-
}), /* @__PURE__ */
|
|
629
|
-
status:
|
|
231
|
+
}), /* @__PURE__ */ y(n, {
|
|
232
|
+
status: Le,
|
|
630
233
|
dot: !0,
|
|
631
234
|
pulse: q,
|
|
632
|
-
children:
|
|
235
|
+
children: ie(O.status)
|
|
633
236
|
})]
|
|
634
237
|
}),
|
|
635
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ y("p", {
|
|
636
239
|
className: "text-sm text-text-secondary mt-1",
|
|
637
|
-
children: H?.pricingModel ===
|
|
240
|
+
children: H?.pricingModel === g.PER_SEAT && H.pricePerSeat ? `${u(H.pricePerSeat, H.currency)} / seat / ${p(H.duration)} · ${O.seatCount ?? H.minSeats ?? 1} seats = ${u(H.pricePerSeat * (O.seatCount ?? H.minSeats ?? 1), H.currency)} / ${p(H.duration)}` : H ? `${u(H.price, H.currency)} / ${p(H.duration)}` : "Unknown plan"
|
|
638
241
|
}),
|
|
639
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ y(pe, {
|
|
640
243
|
className: "mt-3",
|
|
641
|
-
children:
|
|
244
|
+
children: f("billing.subscriptions.detailPurpose", "Everything about this subscription in one view — its billing period, the quotas and add-ons it includes, recent charges and its full status history. Use it to track what you are getting, activate workspace quotas, change your plan, or cancel.")
|
|
642
245
|
})
|
|
643
246
|
] })]
|
|
644
|
-
}), /* @__PURE__ */
|
|
645
|
-
className: "flex items-center gap-2",
|
|
646
|
-
children: [
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
onSelect: () => F(!0),
|
|
658
|
-
disabled: j,
|
|
659
|
-
intent: "destructive"
|
|
660
|
-
}] : []]
|
|
661
|
-
}),
|
|
662
|
-
$.visibleCancel && /* @__PURE__ */ b("button", {
|
|
663
|
-
type: "button",
|
|
664
|
-
onClick: () => F(!0),
|
|
247
|
+
}), /* @__PURE__ */ b("div", {
|
|
248
|
+
className: E ? "flex flex-wrap items-center gap-2 lg:shrink-0 lg:justify-end" : "flex items-center gap-2",
|
|
249
|
+
children: [/* @__PURE__ */ y(o, {
|
|
250
|
+
primary: q && T.canUpdateSubscription ? {
|
|
251
|
+
label: "Change Plan",
|
|
252
|
+
onSelect: () => x(h(`/subscriptions/${O.id}/upgrade`, D ?? O.billingAccountId))
|
|
253
|
+
} : void 0,
|
|
254
|
+
actions: [...q && T.canUpdateSubscription && H?.pricingModel === g.PER_SEAT ? [{
|
|
255
|
+
label: "Manage Seats",
|
|
256
|
+
onSelect: () => L(!0)
|
|
257
|
+
}] : [], ...q && T.canCancelSubscription && !O.canceledAt ? [{
|
|
258
|
+
label: j ? "Canceling…" : "Cancel Subscription",
|
|
259
|
+
onSelect: () => I(!0),
|
|
665
260
|
disabled: j,
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
})
|
|
673
|
-
]
|
|
261
|
+
intent: "destructive"
|
|
262
|
+
}] : []]
|
|
263
|
+
}), O.canceledAt && /* @__PURE__ */ y("span", {
|
|
264
|
+
className: "px-4 py-2 text-sm font-medium text-status-warning-text bg-status-warning-bg-subtle rounded-button",
|
|
265
|
+
children: "Cancellation Scheduled"
|
|
266
|
+
})]
|
|
674
267
|
})]
|
|
675
268
|
}),
|
|
676
|
-
/* @__PURE__ */
|
|
677
|
-
className:
|
|
678
|
-
children: [/* @__PURE__ */
|
|
679
|
-
className:
|
|
680
|
-
children: [
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
269
|
+
/* @__PURE__ */ b("div", {
|
|
270
|
+
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
271
|
+
children: [/* @__PURE__ */ b("div", {
|
|
272
|
+
className: "lg:col-span-2 space-y-6",
|
|
273
|
+
children: [
|
|
274
|
+
q && /* @__PURE__ */ b(de, {
|
|
275
|
+
className: "p-5",
|
|
276
|
+
children: [/* @__PURE__ */ b("div", {
|
|
277
|
+
className: "flex items-center justify-between mb-4",
|
|
278
|
+
children: [/* @__PURE__ */ y("h2", {
|
|
279
|
+
className: "text-base font-semibold text-text-primary",
|
|
280
|
+
children: "Current Period"
|
|
281
|
+
}), /* @__PURE__ */ b("span", {
|
|
282
|
+
className: "text-sm text-text-secondary tabular-nums",
|
|
283
|
+
children: [$, " days remaining"]
|
|
284
|
+
})]
|
|
285
|
+
}), /* @__PURE__ */ b("div", {
|
|
286
|
+
className: "space-y-2",
|
|
287
|
+
children: [/* @__PURE__ */ y(r, {
|
|
288
|
+
value: Ue,
|
|
289
|
+
status: "primary",
|
|
290
|
+
size: "md",
|
|
291
|
+
"aria-label": "Billing period progress"
|
|
292
|
+
}), /* @__PURE__ */ b("div", {
|
|
293
|
+
className: "flex items-center justify-between text-sm text-text-secondary",
|
|
294
|
+
children: [/* @__PURE__ */ y("span", { children: d(O.startDate, "short") }), /* @__PURE__ */ y("span", { children: d(O.endDate, "short") })]
|
|
295
|
+
})]
|
|
690
296
|
})]
|
|
691
|
-
}),
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
297
|
+
}),
|
|
298
|
+
/* @__PURE__ */ b(t, {
|
|
299
|
+
className: "overflow-hidden",
|
|
300
|
+
children: [/* @__PURE__ */ b("div", {
|
|
301
|
+
className: "p-5 border-b border-border-subtle",
|
|
302
|
+
children: [/* @__PURE__ */ b("h2", {
|
|
303
|
+
className: "text-base font-semibold text-text-primary",
|
|
304
|
+
children: ["Plan Quotas", U.length > 0 && /* @__PURE__ */ b("span", {
|
|
305
|
+
className: "ml-2 text-sm font-normal text-text-muted tabular-nums",
|
|
306
|
+
children: [
|
|
307
|
+
"(",
|
|
308
|
+
U.length,
|
|
309
|
+
")"
|
|
310
|
+
]
|
|
311
|
+
})]
|
|
312
|
+
}), /* @__PURE__ */ y("p", {
|
|
313
|
+
className: "text-sm text-text-secondary mt-0.5",
|
|
314
|
+
children: "Limits included in your plan"
|
|
315
|
+
})]
|
|
316
|
+
}), /* @__PURE__ */ y("div", {
|
|
317
|
+
className: "p-5",
|
|
318
|
+
children: U.length === 0 ? /* @__PURE__ */ y("p", {
|
|
319
|
+
className: "text-sm text-text-secondary",
|
|
320
|
+
children: "No quotas assigned to this subscription."
|
|
321
|
+
}) : /* @__PURE__ */ y("div", {
|
|
322
|
+
className: "space-y-3",
|
|
323
|
+
children: U.map((e) => /* @__PURE__ */ y(_e, { quota: e }, e.id))
|
|
324
|
+
})
|
|
701
325
|
})]
|
|
702
|
-
})
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
326
|
+
}),
|
|
327
|
+
q && M && /* @__PURE__ */ b(t, {
|
|
328
|
+
className: "overflow-hidden",
|
|
329
|
+
children: [
|
|
330
|
+
/* @__PURE__ */ b("div", {
|
|
331
|
+
className: "p-5 border-b border-border-subtle flex items-center justify-between gap-4",
|
|
332
|
+
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h2", {
|
|
333
|
+
className: "text-base font-semibold text-text-primary",
|
|
334
|
+
children: "Workspace Quotas"
|
|
335
|
+
}), /* @__PURE__ */ y("p", {
|
|
336
|
+
className: "text-sm text-text-secondary mt-0.5",
|
|
337
|
+
children: "Active limits for your workspace"
|
|
338
|
+
})] }), Y ? /* @__PURE__ */ y(n, {
|
|
339
|
+
status: "success",
|
|
340
|
+
dot: !0,
|
|
341
|
+
children: "Active"
|
|
342
|
+
}) : Q ? /* @__PURE__ */ y(n, {
|
|
343
|
+
status: "warning",
|
|
344
|
+
dot: !0,
|
|
345
|
+
children: "At workspace limit"
|
|
346
|
+
}) : /* @__PURE__ */ y("button", {
|
|
347
|
+
type: "button",
|
|
348
|
+
onClick: () => R(!0),
|
|
349
|
+
className: "px-3 py-1.5 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors duration-200",
|
|
350
|
+
children: "Activate for Workspace"
|
|
351
|
+
})]
|
|
352
|
+
}),
|
|
353
|
+
/* @__PURE__ */ y("div", {
|
|
354
|
+
className: "p-5",
|
|
355
|
+
children: Y ? J.length > 0 ? /* @__PURE__ */ y("div", {
|
|
356
|
+
className: "space-y-3",
|
|
357
|
+
children: J.map((e) => /* @__PURE__ */ y(ve, { item: e }, e.assignment.id))
|
|
358
|
+
}) : /* @__PURE__ */ b("p", {
|
|
359
|
+
className: "text-sm text-text-secondary",
|
|
360
|
+
children: [
|
|
361
|
+
"Quotas are activated on workspace",
|
|
362
|
+
" ",
|
|
363
|
+
/* @__PURE__ */ y("span", {
|
|
364
|
+
className: "font-mono text-xs text-text-primary bg-bg-sunken/60 rounded px-1.5 py-0.5",
|
|
365
|
+
children: M
|
|
366
|
+
}),
|
|
367
|
+
". Usage data will appear here once quotas are consumed."
|
|
368
|
+
]
|
|
369
|
+
}) : Q ? /* @__PURE__ */ b("div", {
|
|
370
|
+
className: "flex items-start gap-3",
|
|
371
|
+
children: [/* @__PURE__ */ y("div", {
|
|
372
|
+
className: "size-8 rounded-full bg-status-warning-bg-subtle flex items-center justify-center shrink-0 mt-0.5",
|
|
373
|
+
children: /* @__PURE__ */ y("svg", {
|
|
374
|
+
className: "size-4 text-status-warning-text",
|
|
375
|
+
fill: "none",
|
|
376
|
+
viewBox: "0 0 24 24",
|
|
377
|
+
stroke: "currentColor",
|
|
378
|
+
children: /* @__PURE__ */ y("path", {
|
|
379
|
+
strokeLinecap: "round",
|
|
380
|
+
strokeLinejoin: "round",
|
|
381
|
+
strokeWidth: 2,
|
|
382
|
+
d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
|
383
|
+
})
|
|
384
|
+
})
|
|
385
|
+
}), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
386
|
+
className: "text-sm font-medium text-text-primary",
|
|
387
|
+
children: "Already active on another workspace"
|
|
388
|
+
}), /* @__PURE__ */ b("p", {
|
|
389
|
+
className: "text-sm text-text-secondary mt-0.5",
|
|
390
|
+
children: [
|
|
391
|
+
H?.name ?? "This plan",
|
|
392
|
+
" can be activated for",
|
|
393
|
+
" ",
|
|
394
|
+
Z === 1 ? "only 1 workspace" : `at most ${Z} workspaces`,
|
|
395
|
+
", and",
|
|
396
|
+
" ",
|
|
397
|
+
X === 1 ? "it" : `${X} of them`,
|
|
398
|
+
" ",
|
|
399
|
+
N && /* @__PURE__ */ b(he, { children: [
|
|
400
|
+
"(",
|
|
401
|
+
/* @__PURE__ */ y("span", {
|
|
402
|
+
className: "font-mono text-xs bg-bg-sunken/60 rounded px-1.5 py-0.5",
|
|
403
|
+
children: F.find((e) => e.id === N)?.name ?? N
|
|
404
|
+
}),
|
|
405
|
+
")",
|
|
406
|
+
" "
|
|
407
|
+
] }),
|
|
408
|
+
X === 1 ? "is" : "are",
|
|
409
|
+
" already using it. Switch to that workspace to see its quotas, or remove it there to free up the slot for this one."
|
|
410
|
+
]
|
|
411
|
+
})] })]
|
|
412
|
+
}) : /* @__PURE__ */ b("div", {
|
|
413
|
+
className: "flex items-start gap-3",
|
|
414
|
+
children: [/* @__PURE__ */ y("div", {
|
|
415
|
+
className: "size-8 rounded-full bg-status-warning-bg-subtle flex items-center justify-center shrink-0 mt-0.5",
|
|
416
|
+
children: /* @__PURE__ */ y("svg", {
|
|
417
|
+
className: "size-4 text-status-warning-text",
|
|
418
|
+
fill: "none",
|
|
419
|
+
viewBox: "0 0 24 24",
|
|
420
|
+
stroke: "currentColor",
|
|
421
|
+
children: /* @__PURE__ */ y("path", {
|
|
422
|
+
strokeLinecap: "round",
|
|
423
|
+
strokeLinejoin: "round",
|
|
424
|
+
strokeWidth: 2,
|
|
425
|
+
d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
|
426
|
+
})
|
|
427
|
+
})
|
|
428
|
+
}), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
429
|
+
className: "text-sm font-medium text-text-primary",
|
|
430
|
+
children: "Workspace quotas not activated yet"
|
|
431
|
+
}), /* @__PURE__ */ b("p", {
|
|
432
|
+
className: "text-sm text-text-secondary mt-0.5",
|
|
433
|
+
children: [
|
|
434
|
+
"Click",
|
|
435
|
+
" ",
|
|
436
|
+
/* @__PURE__ */ y("button", {
|
|
437
|
+
type: "button",
|
|
438
|
+
onClick: () => R(!0),
|
|
439
|
+
className: "text-text-link hover:underline font-medium",
|
|
440
|
+
children: "Activate for Workspace"
|
|
441
|
+
}),
|
|
442
|
+
" ",
|
|
443
|
+
"to enable the workspace-scoped limits included in this plan."
|
|
444
|
+
]
|
|
445
|
+
})] })]
|
|
446
|
+
})
|
|
447
|
+
}),
|
|
448
|
+
Pe && /* @__PURE__ */ y(ue, {
|
|
449
|
+
billingAccountId: D ?? O.billingAccountId,
|
|
450
|
+
subscriptionId: O.id,
|
|
451
|
+
quotas: Re,
|
|
452
|
+
workspaces: F,
|
|
453
|
+
currentWorkspaceId: M,
|
|
454
|
+
onAssigned: () => {
|
|
455
|
+
R(!1), A(), ke();
|
|
456
|
+
},
|
|
457
|
+
onSkip: () => R(!1)
|
|
458
|
+
})
|
|
459
|
+
]
|
|
460
|
+
}),
|
|
461
|
+
W.length > 0 && /* @__PURE__ */ b(t, {
|
|
462
|
+
className: "overflow-hidden",
|
|
463
|
+
children: [/* @__PURE__ */ y("div", {
|
|
464
|
+
className: "p-5 border-b border-border-subtle",
|
|
465
|
+
children: /* @__PURE__ */ b("h2", {
|
|
466
|
+
className: "text-base font-semibold text-text-primary",
|
|
467
|
+
children: [
|
|
468
|
+
"Addons",
|
|
469
|
+
" ",
|
|
470
|
+
/* @__PURE__ */ b("span", {
|
|
471
|
+
className: "text-sm font-normal text-text-muted tabular-nums",
|
|
472
|
+
children: [
|
|
473
|
+
"(",
|
|
474
|
+
W.length,
|
|
475
|
+
")"
|
|
476
|
+
]
|
|
477
|
+
})
|
|
478
|
+
]
|
|
479
|
+
})
|
|
480
|
+
}), /* @__PURE__ */ y("div", {
|
|
481
|
+
className: "p-5",
|
|
482
|
+
children: /* @__PURE__ */ y("div", {
|
|
483
|
+
className: "space-y-3",
|
|
484
|
+
children: W.map((e) => /* @__PURE__ */ y(ye, { addonSubscription: e }, e.id))
|
|
485
|
+
})
|
|
486
|
+
})]
|
|
487
|
+
}),
|
|
488
|
+
G.length > 0 && /* @__PURE__ */ b(t, {
|
|
489
|
+
className: "overflow-hidden",
|
|
490
|
+
children: [
|
|
491
|
+
/* @__PURE__ */ y("div", {
|
|
492
|
+
className: "p-5 border-b border-border-subtle",
|
|
493
|
+
children: /* @__PURE__ */ y("h2", {
|
|
494
|
+
className: "text-base font-semibold text-text-primary",
|
|
495
|
+
children: "Recent Transactions"
|
|
496
|
+
})
|
|
497
|
+
}),
|
|
498
|
+
/* @__PURE__ */ y("div", {
|
|
499
|
+
className: "divide-y divide-border-subtle",
|
|
500
|
+
children: G.slice(0, 5).map((e) => /* @__PURE__ */ y(be, { transaction: e }, e.id))
|
|
501
|
+
}),
|
|
502
|
+
G.length > 5 && /* @__PURE__ */ y("div", {
|
|
503
|
+
className: "p-4 text-center border-t border-border-subtle",
|
|
504
|
+
children: /* @__PURE__ */ y("button", {
|
|
505
|
+
type: "button",
|
|
506
|
+
className: "text-sm text-text-link hover:underline",
|
|
507
|
+
children: "View all transactions"
|
|
508
|
+
})
|
|
509
|
+
})
|
|
510
|
+
]
|
|
511
|
+
})
|
|
512
|
+
]
|
|
513
|
+
}), /* @__PURE__ */ b("div", {
|
|
710
514
|
className: "space-y-6 lg:sticky lg:top-6 lg:self-start",
|
|
711
515
|
children: [
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
516
|
+
/* @__PURE__ */ y(fe, {
|
|
517
|
+
storageKey: "billing-subscription-detail",
|
|
518
|
+
steps: We
|
|
519
|
+
}),
|
|
520
|
+
/* @__PURE__ */ b(t, {
|
|
521
|
+
className: "overflow-hidden",
|
|
522
|
+
children: [/* @__PURE__ */ y("div", {
|
|
523
|
+
className: "p-5 border-b border-border-subtle",
|
|
524
|
+
children: /* @__PURE__ */ y("h2", {
|
|
525
|
+
className: "text-base font-semibold text-text-primary",
|
|
526
|
+
children: "Details"
|
|
527
|
+
})
|
|
528
|
+
}), E ? /* @__PURE__ */ b("dl", {
|
|
529
|
+
className: "divide-y divide-border-subtle px-5",
|
|
530
|
+
children: [
|
|
531
|
+
/* @__PURE__ */ y(C, {
|
|
532
|
+
label: "Plan",
|
|
533
|
+
children: H?.name || "Unknown"
|
|
534
|
+
}),
|
|
535
|
+
/* @__PURE__ */ y(C, {
|
|
536
|
+
label: "Billing account",
|
|
537
|
+
children: O.billingAccount?.name || "Unknown"
|
|
538
|
+
}),
|
|
539
|
+
/* @__PURE__ */ b(C, {
|
|
540
|
+
label: "Period",
|
|
541
|
+
children: [
|
|
542
|
+
d(O.startDate),
|
|
543
|
+
" – ",
|
|
544
|
+
d(O.endDate)
|
|
545
|
+
]
|
|
546
|
+
}),
|
|
547
|
+
O.nextBillingDate && /* @__PURE__ */ y(C, {
|
|
548
|
+
label: "Next billing",
|
|
549
|
+
children: d(O.nextBillingDate)
|
|
550
|
+
}),
|
|
551
|
+
/* @__PURE__ */ y(C, {
|
|
552
|
+
label: "Auto renewal",
|
|
553
|
+
children: /* @__PURE__ */ y(n, {
|
|
554
|
+
status: O.autoRenewal ? "success" : "neutral",
|
|
555
|
+
dot: !0,
|
|
556
|
+
children: O.autoRenewal ? "On" : "Off"
|
|
557
|
+
})
|
|
558
|
+
}),
|
|
559
|
+
O.paymentGateway && /* @__PURE__ */ y(C, {
|
|
560
|
+
label: "Payment gateway",
|
|
561
|
+
children: /* @__PURE__ */ y("span", {
|
|
562
|
+
className: "capitalize",
|
|
563
|
+
children: O.paymentGateway
|
|
564
|
+
})
|
|
565
|
+
}),
|
|
566
|
+
/* @__PURE__ */ b("div", {
|
|
567
|
+
className: "py-3",
|
|
568
|
+
children: [/* @__PURE__ */ y("dt", {
|
|
569
|
+
className: "text-xs text-text-muted",
|
|
570
|
+
children: "Subscription ID"
|
|
571
|
+
}), /* @__PURE__ */ y("dd", {
|
|
572
|
+
className: "font-mono text-xs text-text-secondary mt-1 break-all",
|
|
573
|
+
children: O.id
|
|
574
|
+
})]
|
|
575
|
+
})
|
|
576
|
+
]
|
|
577
|
+
}) : /* @__PURE__ */ b("div", {
|
|
578
|
+
className: "p-5 space-y-4",
|
|
579
|
+
children: [
|
|
580
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
581
|
+
className: "text-sm text-text-secondary",
|
|
582
|
+
children: "Subscription ID"
|
|
583
|
+
}), /* @__PURE__ */ y("p", {
|
|
584
|
+
className: "font-mono text-sm text-text-primary mt-0.5 break-all",
|
|
585
|
+
children: O.id
|
|
586
|
+
})] }),
|
|
587
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
588
|
+
className: "text-sm text-text-secondary",
|
|
589
|
+
children: "Plan"
|
|
590
|
+
}), /* @__PURE__ */ y("p", {
|
|
591
|
+
className: "text-sm text-text-primary mt-0.5",
|
|
592
|
+
children: H?.name || "Unknown"
|
|
593
|
+
})] }),
|
|
594
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
595
|
+
className: "text-sm text-text-secondary",
|
|
596
|
+
children: "Billing Account"
|
|
597
|
+
}), /* @__PURE__ */ y("p", {
|
|
598
|
+
className: "text-sm text-text-primary mt-0.5",
|
|
599
|
+
children: O.billingAccount?.name || "Unknown"
|
|
600
|
+
})] }),
|
|
601
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
602
|
+
className: "text-sm text-text-secondary",
|
|
603
|
+
children: "Start Date"
|
|
604
|
+
}), /* @__PURE__ */ y("p", {
|
|
605
|
+
className: "text-sm text-text-primary mt-0.5",
|
|
606
|
+
children: d(O.startDate)
|
|
607
|
+
})] }),
|
|
608
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
609
|
+
className: "text-sm text-text-secondary",
|
|
610
|
+
children: "End Date"
|
|
611
|
+
}), /* @__PURE__ */ y("p", {
|
|
612
|
+
className: "text-sm text-text-primary mt-0.5",
|
|
613
|
+
children: d(O.endDate)
|
|
614
|
+
})] }),
|
|
615
|
+
O.nextBillingDate && /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
616
|
+
className: "text-sm text-text-secondary",
|
|
617
|
+
children: "Next Billing"
|
|
618
|
+
}), /* @__PURE__ */ y("p", {
|
|
619
|
+
className: "text-sm text-text-primary mt-0.5",
|
|
620
|
+
children: d(O.nextBillingDate)
|
|
621
|
+
})] }),
|
|
622
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
623
|
+
className: "text-sm text-text-secondary",
|
|
624
|
+
children: "Auto Renewal"
|
|
625
|
+
}), /* @__PURE__ */ y("p", {
|
|
626
|
+
className: "text-sm text-text-primary mt-0.5",
|
|
627
|
+
children: O.autoRenewal ? "Enabled" : "Disabled"
|
|
628
|
+
})] }),
|
|
629
|
+
O.paymentGateway && /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
630
|
+
className: "text-sm text-text-secondary",
|
|
631
|
+
children: "Payment Gateway"
|
|
632
|
+
}), /* @__PURE__ */ y("p", {
|
|
633
|
+
className: "text-sm text-text-primary mt-0.5 capitalize",
|
|
634
|
+
children: O.paymentGateway
|
|
635
|
+
})] })
|
|
636
|
+
]
|
|
637
|
+
})]
|
|
638
|
+
}),
|
|
639
|
+
K.length > 0 && /* @__PURE__ */ b(t, {
|
|
640
|
+
className: "overflow-hidden",
|
|
641
|
+
children: [/* @__PURE__ */ y("div", {
|
|
642
|
+
className: "p-5 border-b border-border-subtle",
|
|
643
|
+
children: /* @__PURE__ */ y("h2", {
|
|
644
|
+
className: "text-base font-semibold text-text-primary",
|
|
645
|
+
children: "History"
|
|
646
|
+
})
|
|
647
|
+
}), /* @__PURE__ */ y("div", {
|
|
648
|
+
className: "p-5",
|
|
649
|
+
children: /* @__PURE__ */ y("div", {
|
|
650
|
+
className: "space-y-3",
|
|
651
|
+
children: K.slice(0, 5).map((e) => /* @__PURE__ */ y(xe, { item: e }, e.id))
|
|
652
|
+
})
|
|
653
|
+
})]
|
|
654
|
+
})
|
|
715
655
|
]
|
|
716
656
|
})]
|
|
717
657
|
}),
|
|
718
|
-
|
|
658
|
+
Ne && O && /* @__PURE__ */ y(le, {
|
|
719
659
|
subscription: O,
|
|
720
|
-
onClose: () =>
|
|
660
|
+
onClose: () => L(!1),
|
|
721
661
|
onConfirm: async (e) => {
|
|
722
|
-
await
|
|
662
|
+
await Ee({
|
|
723
663
|
subscriptionId: O.id,
|
|
724
664
|
seatCount: e
|
|
725
665
|
}), await A();
|
|
726
666
|
},
|
|
727
|
-
isLoading:
|
|
667
|
+
isLoading: De
|
|
728
668
|
}),
|
|
729
|
-
|
|
669
|
+
Me && /* @__PURE__ */ b("div", {
|
|
730
670
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
731
|
-
children: [/* @__PURE__ */
|
|
671
|
+
children: [/* @__PURE__ */ y("div", {
|
|
732
672
|
className: "absolute inset-0 bg-overlay-scrim",
|
|
733
|
-
onClick: () =>
|
|
734
|
-
}), /* @__PURE__ */
|
|
673
|
+
onClick: () => I(!1)
|
|
674
|
+
}), /* @__PURE__ */ b("div", {
|
|
735
675
|
className: "relative bg-bg-elevated border border-border-seam rounded-card shadow-[var(--shadow-elevation-4)] w-full max-w-md mx-4 p-6",
|
|
736
676
|
role: "dialog",
|
|
737
677
|
"aria-modal": "true",
|
|
738
678
|
"aria-labelledby": "cancel-subscription-title",
|
|
739
679
|
children: [
|
|
740
|
-
/* @__PURE__ */
|
|
680
|
+
/* @__PURE__ */ y("h3", {
|
|
741
681
|
id: "cancel-subscription-title",
|
|
742
682
|
className: "text-lg font-semibold text-text-primary mb-2",
|
|
743
|
-
children: E ?
|
|
683
|
+
children: E && H?.name ? `Cancel ${H.name}?` : "Cancel Subscription"
|
|
744
684
|
}),
|
|
745
|
-
|
|
746
|
-
className: "text-sm text-text-secondary mb-4",
|
|
747
|
-
children: p("billing.subscription.cancelEffect", "Your {plan} subscription stays active until {date} and will not renew after that.").replace("{plan}", rt ?? p("billing.subscription.thisSubscription", "this subscription")).replace("{date}", f(O.endDate))
|
|
748
|
-
}) : /* @__PURE__ */ x("p", {
|
|
685
|
+
/* @__PURE__ */ b("p", {
|
|
749
686
|
className: "text-sm text-text-secondary mb-4",
|
|
750
687
|
children: [
|
|
751
|
-
"Are you sure you want to cancel this subscription? Your subscription will remain active until",
|
|
688
|
+
E ? "You keep access until" : "Are you sure you want to cancel this subscription? Your subscription will remain active until",
|
|
752
689
|
" ",
|
|
753
|
-
/* @__PURE__ */
|
|
690
|
+
/* @__PURE__ */ y("span", {
|
|
754
691
|
className: "font-medium text-text-primary",
|
|
755
|
-
children:
|
|
692
|
+
children: d(O.endDate)
|
|
756
693
|
}),
|
|
757
|
-
", but will not renew automatically."
|
|
694
|
+
E ? ". It will not renew automatically." : ", but will not renew automatically."
|
|
758
695
|
]
|
|
759
696
|
}),
|
|
760
|
-
/* @__PURE__ */
|
|
697
|
+
/* @__PURE__ */ b("div", {
|
|
761
698
|
className: "mb-4",
|
|
762
|
-
children: [/* @__PURE__ */
|
|
699
|
+
children: [/* @__PURE__ */ y("label", {
|
|
763
700
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
764
701
|
children: "Reason for cancellation (optional)"
|
|
765
|
-
}), /* @__PURE__ */
|
|
766
|
-
value:
|
|
767
|
-
onChange: (e) =>
|
|
702
|
+
}), /* @__PURE__ */ y("textarea", {
|
|
703
|
+
value: z,
|
|
704
|
+
onChange: (e) => B(e.target.value),
|
|
768
705
|
placeholder: "Please share why you're canceling...",
|
|
769
706
|
className: "w-full px-3 py-2 text-sm border border-border-subtle rounded-input bg-bg-surface text-text-primary placeholder:text-text-placeholder focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:border-transparent resize-none",
|
|
770
707
|
rows: 3
|
|
771
708
|
})]
|
|
772
709
|
}),
|
|
773
|
-
|
|
710
|
+
Fe && /* @__PURE__ */ y("div", {
|
|
774
711
|
className: "mb-4 p-3 bg-status-error-bg-subtle border border-status-error-border rounded-card",
|
|
775
|
-
children: /* @__PURE__ */
|
|
712
|
+
children: /* @__PURE__ */ y("p", {
|
|
776
713
|
className: "text-sm text-status-error-text",
|
|
777
|
-
children:
|
|
714
|
+
children: Fe
|
|
778
715
|
})
|
|
779
716
|
}),
|
|
780
|
-
/* @__PURE__ */
|
|
717
|
+
/* @__PURE__ */ b("div", {
|
|
781
718
|
className: "flex items-center justify-end gap-3",
|
|
782
|
-
children: [/* @__PURE__ */
|
|
719
|
+
children: [/* @__PURE__ */ y("button", {
|
|
783
720
|
type: "button",
|
|
784
721
|
onClick: () => {
|
|
785
|
-
|
|
722
|
+
I(!1), B(""), V(null);
|
|
786
723
|
},
|
|
787
724
|
className: "px-4 py-2 text-sm font-medium text-text-secondary hover:text-text-primary transition-colors",
|
|
788
725
|
children: "Keep Subscription"
|
|
789
|
-
}), /* @__PURE__ */
|
|
726
|
+
}), /* @__PURE__ */ y("button", {
|
|
790
727
|
type: "button",
|
|
791
|
-
onClick:
|
|
728
|
+
onClick: Ie,
|
|
792
729
|
disabled: j,
|
|
793
730
|
className: "px-4 py-2 text-sm font-medium bg-action-danger-bg text-action-danger-text rounded-button hover:bg-action-danger-bgHover transition-colors duration-200 disabled:opacity-50",
|
|
794
731
|
children: j ? "Canceling..." : "Confirm Cancellation"
|
|
@@ -799,151 +736,151 @@ var w = () => {
|
|
|
799
736
|
})
|
|
800
737
|
]
|
|
801
738
|
});
|
|
802
|
-
},
|
|
803
|
-
let t = e.context, n =
|
|
804
|
-
return /* @__PURE__ */
|
|
739
|
+
}, _e = ({ quota: e }) => {
|
|
740
|
+
let t = e.context, n = x(e.name, t), r = t?.description && typeof t.description == "string" ? t.description : null, i = e.limits?.value ?? 0, a = e.currentUsageSum ?? 0, o = i > 0 ? Math.min(100, a / i * 100) : 0, s = e.name.includes("bytes") || e.name.includes("storage"), c = e.quotaType === "POOLED";
|
|
741
|
+
return /* @__PURE__ */ b("div", {
|
|
805
742
|
className: "p-4 rounded-card border border-border-seam bg-bg-surface",
|
|
806
743
|
children: [
|
|
807
|
-
/* @__PURE__ */
|
|
744
|
+
/* @__PURE__ */ b("div", {
|
|
808
745
|
className: "flex items-start justify-between gap-4 mb-2",
|
|
809
|
-
children: [/* @__PURE__ */
|
|
746
|
+
children: [/* @__PURE__ */ b("div", {
|
|
810
747
|
className: "min-w-0",
|
|
811
|
-
children: [/* @__PURE__ */
|
|
748
|
+
children: [/* @__PURE__ */ y("p", {
|
|
812
749
|
className: "font-medium text-text-primary truncate",
|
|
813
750
|
children: n
|
|
814
|
-
}), r && /* @__PURE__ */
|
|
751
|
+
}), r && /* @__PURE__ */ y("p", {
|
|
815
752
|
className: "text-xs text-text-secondary mt-0.5 line-clamp-2",
|
|
816
753
|
children: r
|
|
817
754
|
})]
|
|
818
|
-
}), /* @__PURE__ */
|
|
755
|
+
}), /* @__PURE__ */ b("span", {
|
|
819
756
|
className: "text-sm font-medium text-text-primary shrink-0 tabular-nums",
|
|
820
757
|
children: [
|
|
821
|
-
s ?
|
|
758
|
+
s ? l(a) : a.toLocaleString(),
|
|
822
759
|
" / ",
|
|
823
|
-
i > 0 ? s ?
|
|
760
|
+
i > 0 ? s ? l(i) : i.toLocaleString() : "∞"
|
|
824
761
|
]
|
|
825
762
|
})]
|
|
826
763
|
}),
|
|
827
|
-
i > 0 && /* @__PURE__ */
|
|
764
|
+
i > 0 && /* @__PURE__ */ y("div", {
|
|
828
765
|
className: "h-1.5 rounded-full bg-bg-sunken overflow-hidden mb-2",
|
|
829
|
-
children: /* @__PURE__ */
|
|
830
|
-
className: `h-full rounded-full transition-all duration-300 ${
|
|
766
|
+
children: /* @__PURE__ */ y("div", {
|
|
767
|
+
className: `h-full rounded-full transition-all duration-300 ${m(o)}`,
|
|
831
768
|
style: { width: `${o}%` }
|
|
832
769
|
})
|
|
833
770
|
}),
|
|
834
|
-
/* @__PURE__ */
|
|
771
|
+
/* @__PURE__ */ b("div", {
|
|
835
772
|
className: "flex items-center justify-between text-xs text-text-secondary",
|
|
836
|
-
children: [/* @__PURE__ */
|
|
773
|
+
children: [/* @__PURE__ */ y("span", {
|
|
837
774
|
className: "px-1.5 py-0.5 rounded bg-bg-sunken font-medium",
|
|
838
775
|
children: c ? "Shared" : "Per Workspace"
|
|
839
|
-
}), /* @__PURE__ */
|
|
776
|
+
}), /* @__PURE__ */ b("div", {
|
|
840
777
|
className: "flex items-center gap-3",
|
|
841
|
-
children: [e.endtime && /* @__PURE__ */
|
|
778
|
+
children: [e.endtime && /* @__PURE__ */ b("span", { children: ["Expires ", d(e.endtime, "short")] }), i > 0 && /* @__PURE__ */ b("span", {
|
|
842
779
|
className: o >= 90 ? "text-status-error-text font-medium" : o >= 70 ? "text-status-warning-text font-medium" : "",
|
|
843
|
-
children: [
|
|
780
|
+
children: [f(o), " used"]
|
|
844
781
|
})]
|
|
845
782
|
})]
|
|
846
783
|
})
|
|
847
784
|
]
|
|
848
785
|
});
|
|
849
|
-
},
|
|
850
|
-
let { assignment: t, effectiveUsed: n, usagePercentage: r } = e, i =
|
|
851
|
-
return /* @__PURE__ */
|
|
786
|
+
}, ve = ({ item: e }) => {
|
|
787
|
+
let { assignment: t, effectiveUsed: n, usagePercentage: r } = e, i = x(t.quotaName), a = !t.noLimit && t.limit !== null, o = t.limit ?? 0, s = t.quotaName.includes("bytes") || t.quotaName.includes("storage"), c = S(t.resetPeriod);
|
|
788
|
+
return /* @__PURE__ */ b("div", {
|
|
852
789
|
className: "p-4 rounded-card border border-border-seam bg-bg-surface",
|
|
853
790
|
children: [
|
|
854
|
-
/* @__PURE__ */
|
|
791
|
+
/* @__PURE__ */ b("div", {
|
|
855
792
|
className: "flex items-start justify-between gap-4 mb-2",
|
|
856
|
-
children: [/* @__PURE__ */
|
|
793
|
+
children: [/* @__PURE__ */ b("div", {
|
|
857
794
|
className: "min-w-0",
|
|
858
|
-
children: [/* @__PURE__ */
|
|
795
|
+
children: [/* @__PURE__ */ y("p", {
|
|
859
796
|
className: "font-medium text-text-primary truncate",
|
|
860
797
|
children: i
|
|
861
|
-
}), /* @__PURE__ */
|
|
798
|
+
}), /* @__PURE__ */ b("p", {
|
|
862
799
|
className: "text-xs text-text-secondary mt-0.5",
|
|
863
800
|
children: [t.quotaMode === "pooled" ? "Pooled across workspaces" : "Dedicated", c && ` · ${c}`]
|
|
864
801
|
})]
|
|
865
|
-
}), /* @__PURE__ */
|
|
802
|
+
}), /* @__PURE__ */ b("span", {
|
|
866
803
|
className: "text-sm font-medium text-text-primary shrink-0 tabular-nums",
|
|
867
804
|
children: [
|
|
868
|
-
s ?
|
|
805
|
+
s ? l(n) : n.toLocaleString(),
|
|
869
806
|
" / ",
|
|
870
|
-
t.noLimit ? "∞" : a ? s ?
|
|
807
|
+
t.noLimit ? "∞" : a ? s ? l(o) : o.toLocaleString() : "∞"
|
|
871
808
|
]
|
|
872
809
|
})]
|
|
873
810
|
}),
|
|
874
|
-
a && /* @__PURE__ */
|
|
811
|
+
a && /* @__PURE__ */ y("div", {
|
|
875
812
|
className: "h-1.5 rounded-full bg-bg-sunken overflow-hidden mb-2",
|
|
876
|
-
children: /* @__PURE__ */
|
|
877
|
-
className: `h-full rounded-full transition-all duration-300 ${
|
|
813
|
+
children: /* @__PURE__ */ y("div", {
|
|
814
|
+
className: `h-full rounded-full transition-all duration-300 ${m(r)}`,
|
|
878
815
|
style: { width: `${Math.min(100, r)}%` }
|
|
879
816
|
})
|
|
880
817
|
}),
|
|
881
|
-
/* @__PURE__ */
|
|
818
|
+
/* @__PURE__ */ b("div", {
|
|
882
819
|
className: "flex items-center justify-between text-xs text-text-secondary",
|
|
883
|
-
children: [/* @__PURE__ */
|
|
820
|
+
children: [/* @__PURE__ */ b("span", { children: ["Since ", d(t.createdAt, "short")] }), a && /* @__PURE__ */ b("span", {
|
|
884
821
|
className: r >= 90 ? "text-status-error-text font-medium" : r >= 70 ? "text-status-warning-text font-medium" : "",
|
|
885
|
-
children: [
|
|
822
|
+
children: [f(r), " used"]
|
|
886
823
|
})]
|
|
887
824
|
})
|
|
888
825
|
]
|
|
889
826
|
});
|
|
890
|
-
},
|
|
827
|
+
}, ye = ({ addonSubscription: e }) => {
|
|
891
828
|
let t = e.addon;
|
|
892
|
-
return /* @__PURE__ */
|
|
829
|
+
return /* @__PURE__ */ b("div", {
|
|
893
830
|
className: "flex items-center justify-between p-3 rounded-card border border-border-seam bg-bg-sunken",
|
|
894
|
-
children: [/* @__PURE__ */
|
|
831
|
+
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
895
832
|
className: "font-medium text-text-primary",
|
|
896
833
|
children: t?.name || "Unknown Addon"
|
|
897
|
-
}), /* @__PURE__ */
|
|
834
|
+
}), /* @__PURE__ */ b("p", {
|
|
898
835
|
className: "text-sm text-text-secondary",
|
|
899
836
|
children: ["Qty: ", e.quantity]
|
|
900
|
-
})] }), t && /* @__PURE__ */
|
|
837
|
+
})] }), t && /* @__PURE__ */ y("p", {
|
|
901
838
|
className: "text-sm font-medium text-text-primary tabular-nums",
|
|
902
|
-
children:
|
|
839
|
+
children: u(t.price * e.quantity, t.currency)
|
|
903
840
|
})]
|
|
904
841
|
});
|
|
905
|
-
},
|
|
842
|
+
}, be = ({ transaction: e }) => /* @__PURE__ */ b("div", {
|
|
906
843
|
className: "flex items-center justify-between px-5 py-4 hover:bg-bg-sunken transition-colors",
|
|
907
|
-
children: [/* @__PURE__ */
|
|
844
|
+
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
908
845
|
className: "font-medium text-text-primary capitalize",
|
|
909
846
|
children: e.type
|
|
910
|
-
}), /* @__PURE__ */
|
|
847
|
+
}), /* @__PURE__ */ y("p", {
|
|
911
848
|
className: "text-sm text-text-secondary",
|
|
912
|
-
children:
|
|
913
|
-
})] }), /* @__PURE__ */
|
|
849
|
+
children: d(e.createdAt, "short")
|
|
850
|
+
})] }), /* @__PURE__ */ b("div", {
|
|
914
851
|
className: "text-right",
|
|
915
|
-
children: [/* @__PURE__ */
|
|
852
|
+
children: [/* @__PURE__ */ b("p", {
|
|
916
853
|
className: `font-medium tabular-nums ${e.type === "refund" ? "text-status-error-text" : "text-text-primary"}`,
|
|
917
|
-
children: [e.type === "refund" ? "-" : "",
|
|
918
|
-
}), /* @__PURE__ */
|
|
854
|
+
children: [e.type === "refund" ? "-" : "", u(e.amount, e.currency)]
|
|
855
|
+
}), /* @__PURE__ */ y("p", {
|
|
919
856
|
className: "text-sm text-text-secondary capitalize",
|
|
920
857
|
children: e.status
|
|
921
858
|
})]
|
|
922
859
|
})]
|
|
923
|
-
}),
|
|
860
|
+
}), xe = ({ item: e }) => /* @__PURE__ */ b("div", {
|
|
924
861
|
className: "flex items-start gap-3",
|
|
925
|
-
children: [/* @__PURE__ */
|
|
926
|
-
/* @__PURE__ */
|
|
862
|
+
children: [/* @__PURE__ */ y("div", { className: "size-2 rounded-full bg-text-muted mt-2 shrink-0" }), /* @__PURE__ */ b("div", { children: [
|
|
863
|
+
/* @__PURE__ */ b("p", {
|
|
927
864
|
className: "text-sm text-text-primary",
|
|
928
865
|
children: [
|
|
929
|
-
/* @__PURE__ */
|
|
866
|
+
/* @__PURE__ */ y("span", {
|
|
930
867
|
className: "capitalize",
|
|
931
868
|
children: e.fromStatus
|
|
932
869
|
}),
|
|
933
870
|
" → ",
|
|
934
|
-
/* @__PURE__ */
|
|
871
|
+
/* @__PURE__ */ y("span", {
|
|
935
872
|
className: "capitalize font-medium",
|
|
936
873
|
children: e.toStatus
|
|
937
874
|
})
|
|
938
875
|
]
|
|
939
876
|
}),
|
|
940
|
-
e.reason && /* @__PURE__ */
|
|
877
|
+
e.reason && /* @__PURE__ */ y("p", {
|
|
941
878
|
className: "text-xs text-text-secondary mt-0.5",
|
|
942
879
|
children: e.reason
|
|
943
880
|
}),
|
|
944
|
-
/* @__PURE__ */
|
|
881
|
+
/* @__PURE__ */ y("p", {
|
|
945
882
|
className: "text-xs text-text-secondary mt-0.5",
|
|
946
|
-
children:
|
|
883
|
+
children: d(e.createdAt, "short")
|
|
947
884
|
})
|
|
948
885
|
] })]
|
|
949
886
|
});
|