@burdenoff/microfe-billing 2026.1113.2 → 2026.1113.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/billing/BillingRoot.js +83 -77
  2. package/dist/billing/BillingRoot.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +78 -78
  4. package/dist/billing/modules/addons/pages/AddonCreatePage.js +70 -70
  5. package/dist/billing/modules/addons/pages/AddonDetailPage.js +72 -72
  6. package/dist/billing/modules/addons/pages/AddonEditPage.js +79 -79
  7. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +224 -224
  8. package/dist/billing/modules/addons/pages/AddonsListPage.js +186 -186
  9. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +168 -168
  10. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  11. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +88 -88
  12. package/dist/billing/modules/billing/hooks/index.js +5 -5
  13. package/dist/billing/modules/billing/hooks/useInvoices.js +39 -20
  14. package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
  15. package/dist/billing/modules/billing/index.js +14 -14
  16. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +92 -92
  17. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +160 -160
  18. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  19. package/dist/billing/modules/billing/pages/InvoicesListPage.js +100 -100
  20. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +105 -105
  21. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +37 -37
  22. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +41 -41
  23. package/dist/billing/modules/billing/pages/RefundsPage.js +334 -334
  24. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  25. package/dist/billing/modules/billing/pages/TransactionsPage.js +174 -174
  26. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  27. package/dist/billing/modules/billing/pages/UserRefundsPage.js +24 -24
  28. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  29. package/dist/billing/modules/checkout/components/OrderSummary.js +71 -71
  30. package/dist/billing/modules/checkout/pages/CheckoutPage.js +646 -625
  31. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  32. package/dist/billing/modules/checkout/utils/checkoutOptions.d.ts +23 -0
  33. package/dist/billing/modules/checkout/utils/checkoutOptions.js +8 -0
  34. package/dist/billing/modules/checkout/utils/checkoutOptions.js.map +1 -0
  35. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +112 -112
  36. package/dist/billing/modules/coupons/pages/CouponsListPage.js +118 -118
  37. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  38. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +119 -119
  39. package/dist/billing/modules/coupons/pages/EditCouponPage.js +82 -82
  40. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +30 -30
  41. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +77 -77
  42. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +187 -164
  43. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  44. package/dist/billing/modules/credits/pages/CreditsPage.js +67 -67
  45. package/dist/billing/modules/dashboard/pages/OverviewPage.js +594 -442
  46. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  47. package/dist/billing/modules/dashboard/utils/overviewSummary.d.ts +46 -0
  48. package/dist/billing/modules/dashboard/utils/overviewSummary.js +37 -0
  49. package/dist/billing/modules/dashboard/utils/overviewSummary.js.map +1 -0
  50. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +199 -199
  51. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  52. package/dist/billing/modules/earnings/components/PayoutDestinationList.d.ts +15 -0
  53. package/dist/billing/modules/earnings/components/PayoutDestinationList.js +66 -0
  54. package/dist/billing/modules/earnings/components/PayoutDestinationList.js.map +1 -0
  55. package/dist/billing/modules/earnings/components/PayoutErrorNotice.d.ts +7 -0
  56. package/dist/billing/modules/earnings/components/PayoutErrorNotice.js +19 -0
  57. package/dist/billing/modules/earnings/components/PayoutErrorNotice.js.map +1 -0
  58. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +64 -64
  59. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +122 -122
  60. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
  61. package/dist/billing/modules/earnings/pages/EarningsPage.js +123 -110
  62. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  63. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +178 -178
  64. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  65. package/dist/billing/modules/earnings/pages/PayoutsPage.js +215 -157
  66. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  67. package/dist/billing/modules/earnings/utils/payoutDestination.d.ts +20 -0
  68. package/dist/billing/modules/earnings/utils/payoutDestination.js +27 -0
  69. package/dist/billing/modules/earnings/utils/payoutDestination.js.map +1 -0
  70. package/dist/billing/modules/earnings/utils/plainPayoutError.d.ts +10 -0
  71. package/dist/billing/modules/earnings/utils/plainPayoutError.js +50 -0
  72. package/dist/billing/modules/earnings/utils/plainPayoutError.js.map +1 -0
  73. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +54 -54
  74. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +94 -94
  75. package/dist/billing/modules/plans/pages/PlanCreatePage.js +73 -73
  76. package/dist/billing/modules/plans/pages/PlanDetailPage.js +96 -96
  77. package/dist/billing/modules/plans/pages/PlanEditPage.js +16 -16
  78. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  79. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +100 -100
  80. package/dist/billing/modules/plans/pages/PlansListPage.js +88 -88
  81. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +60 -60
  82. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +37 -37
  83. package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js +62 -62
  84. package/dist/billing/modules/quota/pages/QuotaPage.js +1 -1
  85. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +69 -69
  86. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +76 -76
  87. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +80 -80
  88. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +95 -95
  89. package/dist/billing/modules/settings/pages/SettingsPage.js +134 -134
  90. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  91. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +62 -62
  92. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  93. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +36 -36
  94. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +534 -410
  95. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  96. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +111 -111
  97. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +166 -160
  98. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  99. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.d.ts +30 -0
  100. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js +20 -0
  101. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js.map +1 -0
  102. package/dist/billing/modules/subscriptions/utils/upgradeAccess.d.ts +10 -0
  103. package/dist/billing/modules/subscriptions/utils/upgradeAccess.js +7 -0
  104. package/dist/billing/modules/subscriptions/utils/upgradeAccess.js.map +1 -0
  105. package/dist/billing/modules/usage/pages/UsagePage.js +722 -591
  106. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  107. package/dist/billing/modules/usage/utils/usageHealth.d.ts +63 -0
  108. package/dist/billing/modules/usage/utils/usageHealth.js +43 -0
  109. package/dist/billing/modules/usage/utils/usageHealth.js.map +1 -0
  110. package/dist/billing/shared/components/EmptyState.js +3 -3
  111. package/dist/billing/shared/components/MoneyActionDialog.js +12 -12
  112. package/dist/billing/shared/ui/MetricCard.js +13 -13
  113. package/dist/billing/shared/utils/format.js +16 -4
  114. package/dist/billing/shared/utils/format.js.map +1 -1
  115. package/dist/billing/shared/utils/index.js +8 -8
  116. package/dist/generated/global-operations.js +294 -286
  117. package/dist/generated/global-operations.js.map +1 -1
  118. package/package.json +2 -2
@@ -7,21 +7,23 @@ import { useBilling as a } from "../../../providers/BillingProvider.js";
7
7
  import { useBillingAccountSelection as o } from "../../../hooks/useBillingAccountSelection.js";
8
8
  import "../hooks/index.js";
9
9
  import { useBillingPermissions as s } from "../../../hooks/useBillingPermissions.js";
10
- import { useGetDefaultBillingAccountDashboardQuery as c, useGetPlanQuery as ee } from "../../../../generated/global-operations.js";
11
- import { useMyWorkspaces as te, useWorkspaceQuotaOverview as l } from "../../usage/hooks/useUsage.js";
12
- import { formatBytes as u, formatCurrency as d, formatDate as f, formatPercentage as p, formatPlanDuration as m, formatSubscriptionStatus as ne } from "../../../shared/utils/format.js";
13
- import { getQuotaProgressColor as h, getSubscriptionStatusColor as re } from "../../../shared/utils/status.js";
10
+ import { useIsFluidgridsVariant as c } from "../../../hooks/useBillingVariant.js";
11
+ import { cancelSubjectName as ee, resolveDetailActions as te, summaryDateKind as ne } from "../utils/subscriptionDetailView.js";
12
+ import { useGetDefaultBillingAccountDashboardQuery as re, useGetPlanQuery as ie } from "../../../../generated/global-operations.js";
13
+ import { useMyWorkspaces as ae, useWorkspaceQuotaOverview as l } from "../../usage/hooks/useUsage.js";
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";
14
16
  import "../../../shared/ui/index.js";
15
17
  import { withBillingAccountId as g } from "../../../shared/utils/navigation.js";
16
- import { PricingModel as _ } from "../../../shared/types/graphql.js";
17
- import { useSubscription as ie, useSubscriptionMutations as ae } from "../hooks/useSubscriptions.js";
18
- import { ManageSeatsModal as oe } from "../components/ManageSeatsModal.js";
19
- import { WorkspaceQuotaAssignmentModal as se, isWorkspaceScopedQuota as v } from "../../checkout/components/WorkspaceQuotaAssignmentModal.js";
20
- import { useState as y } from "react";
21
- import { useParams as ce } from "react-router";
22
- import { Fragment as le, jsx as b, jsxs as x } from "react/jsx-runtime";
23
- import { useI18n as ue } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
24
- import { CTAOverflowMenu as de, EmphasisPanel as fe, NextSteps as pe, PagePurpose as me } from "@burdenoff/fe-libs/ui";
18
+ import { useSubscription as ce, useSubscriptionMutations as le } from "../hooks/useSubscriptions.js";
19
+ import { PricingModel as ue } from "../../../shared/types/graphql.js";
20
+ import { ManageSeatsModal as de } from "../components/ManageSeatsModal.js";
21
+ import { WorkspaceQuotaAssignmentModal as fe, isWorkspaceScopedQuota as pe } from "../../checkout/components/WorkspaceQuotaAssignmentModal.js";
22
+ import { useState as _ } from "react";
23
+ import { CTAOverflowMenu as me, EmphasisPanel as he, NextSteps as ge, OptionalFields as _e, PagePurpose as ve, ShowTechnicalDetails as v } from "@burdenoff/fe-libs/ui";
24
+ import { useParams as ye } from "react-router";
25
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
26
+ import { useI18n as be } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
25
27
  // src/billing/modules/subscriptions/pages/SubscriptionDetailPage.tsx
26
28
  function S(e, t) {
27
29
  if (t?.displayName && typeof t.displayName == "string") return t.displayName;
@@ -33,34 +35,34 @@ function C(e) {
33
35
  return e === "DAILY" ? "Resets daily" : e === "MONTHLY" ? "Resets monthly" : "";
34
36
  }
35
37
  var w = () => {
36
- let { t: u } = ue(), p = (e, t) => {
38
+ let { t: u } = be(), p = (e, t) => {
37
39
  let n = u(e);
38
40
  return n === e ? t : n;
39
- }, { subscriptionId: h } = ce(), S = e(), { emit: C } = i(), { orgId: w } = a(), T = s(), { selectedAccountId: be } = o({
41
+ }, { subscriptionId: h } = ye(), S = e(), { emit: C } = i(), { orgId: w } = a(), T = s(), E = c(), { selectedAccountId: Ee } = o({
40
42
  orgId: w,
41
43
  syncFromUrl: !0,
42
44
  urlParamName: "billingAccountId"
43
- }), { data: xe } = c({ fetchPolicy: "cache-first" }), E = be ?? xe?.getDefaultBillingAccount?.id ?? void 0, { subscription: D, isLoading: Se, error: O, refetch: k } = ie(h, E), { cancelSubscription: Ce, isCanceling: A, updateSubscriptionSeats: we, isUpdatingSeats: Te } = ae(), { workspaceId: j } = a(), { overview: Ee, refetch: De } = l(j ?? void 0), M = (D?.activatedWorkspaceIds ?? []).find((e) => e !== j), { overview: Oe } = l(M), { workspaces: N } = te(), P = N.length > 0 ? N : j ? [{
44
- id: j,
45
+ }), { data: De } = re({ fetchPolicy: "cache-first" }), D = Ee ?? De?.getDefaultBillingAccount?.id ?? void 0, { subscription: O, isLoading: Oe, error: k, refetch: A } = ce(h, D), { cancelSubscription: ke, isCanceling: j, updateSubscriptionSeats: Ae, isUpdatingSeats: je } = le(), { workspaceId: M } = a(), { overview: Me, refetch: Ne } = l(M ?? void 0), N = (O?.activatedWorkspaceIds ?? []).find((e) => e !== M), { overview: Pe } = l(N), { workspaces: Fe } = ae(), P = Fe.length > 0 ? Fe : M ? [{
46
+ id: M,
45
47
  name: "Current workspace"
46
- }] : [], { data: ke } = ee({
47
- variables: { id: D?.plan?.id ?? "" },
48
- skip: !D?.plan?.id,
48
+ }] : [], { data: Ie } = ie({
49
+ variables: { id: O?.plan?.id ?? "" },
50
+ skip: !O?.plan?.id,
49
51
  fetchPolicy: "cache-first"
50
- }), [Ae, F] = y(!1), [je, I] = y(!1), [Me, L] = y(!1), [R, z] = y(""), [B, V] = y(null), Ne = async () => {
51
- if (D) {
52
+ }), [Le, F] = _(!1), [Re, I] = _(!1), [ze, L] = _(!1), [R, z] = _(""), [B, V] = _(null), Be = async () => {
53
+ if (O) {
52
54
  V(null);
53
55
  try {
54
- await Ce({
55
- billingAccountId: E ?? D.billingAccountId,
56
- subscriptionId: D.id,
56
+ await ke({
57
+ billingAccountId: D ?? O.billingAccountId,
58
+ subscriptionId: O.id,
57
59
  reason: R || "User requested cancellation"
58
60
  }), C("billing.subscription.cancelled", {
59
61
  route: "/billing/subscriptions",
60
- entityId: D.id,
62
+ entityId: O.id,
61
63
  source: "subscription-detail",
62
64
  reason: R || "User requested cancellation"
63
- }), F(!1), z(""), await k();
65
+ }), F(!1), z(""), await A();
64
66
  } catch (e) {
65
67
  V(e instanceof Error ? e.message : "Failed to cancel subscription");
66
68
  }
@@ -97,7 +99,7 @@ var w = () => {
97
99
  ]
98
100
  })
99
101
  });
100
- if (Se) return /* @__PURE__ */ x("div", {
102
+ if (Oe) return /* @__PURE__ */ x("div", {
101
103
  className: "space-y-6 px-6 lg:px-8 py-6",
102
104
  children: [/* @__PURE__ */ x("div", {
103
105
  className: "flex items-center gap-4",
@@ -113,7 +115,7 @@ var w = () => {
113
115
  })
114
116
  })]
115
117
  });
116
- if (O || !D) return /* @__PURE__ */ b("div", {
118
+ if (k || !O) return /* @__PURE__ */ b("div", {
117
119
  className: "flex items-center justify-center h-full min-h-[400px]",
118
120
  children: /* @__PURE__ */ x("div", {
119
121
  className: "text-center space-y-4",
@@ -139,18 +141,18 @@ var w = () => {
139
141
  }),
140
142
  /* @__PURE__ */ b("p", {
141
143
  className: "text-sm text-text-secondary",
142
- children: O?.message || "The subscription you are looking for does not exist."
144
+ children: k?.message || "The subscription you are looking for does not exist."
143
145
  }),
144
146
  /* @__PURE__ */ b("button", {
145
147
  type: "button",
146
- onClick: () => S(g("/subscriptions", E)),
148
+ onClick: () => S(g("/subscriptions", D)),
147
149
  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",
148
150
  children: "Back to Subscriptions"
149
151
  })
150
152
  ]
151
153
  })
152
154
  });
153
- let H = D.plan, U = (D.quotas || []).filter((e) => !v(e.name)), W = D.addonSubscriptions || [], G = D.transactions || [], K = D.history || [], Pe = re(D.status), q = D.status === "active", J = [...Ee, ...Oe].filter((e) => e.assignment.subscriptionId === D.id && e.assignment.isActive), Y = j ? (D.activatedWorkspaceIds?.includes(j) ?? !1) || J.length > 0 : !1, X = D.activatedWorkspaceIds?.length ?? 0, Z = H?.maxWorkspaces ?? 1, Q = !Y && X >= Z, Fe = (ke?.getPlan?.features ?? []).filter((e) => e != null).filter((e) => e.quota?.name && v(e.quota.name)).map((e) => {
155
+ let H = O.plan, U = (O.quotas || []).filter((e) => !pe(e.name)), W = O.addonSubscriptions || [], G = O.transactions || [], K = O.history || [], Ve = se(O.status), q = O.status === "active", J = [...Me, ...Pe].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, He = (Ie?.getPlan?.features ?? []).filter((e) => e != null).filter((e) => e.quota?.name && pe(e.quota.name)).map((e) => {
154
156
  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;
155
157
  return {
156
158
  quotaName: e.quota.name,
@@ -160,14 +162,14 @@ var w = () => {
160
162
  resetPeriod: "NEVER",
161
163
  quotaMode: e.quota?.quotaType === "POOLED" ? "pooled" : "dedicated"
162
164
  };
163
- }), Ie = new Date(D.endDate), Le = new Date(D.startDate), Re = /* @__PURE__ */ new Date(), ze = Math.ceil((Ie.getTime() - Le.getTime()) / 864e5), $ = Math.max(0, Math.ceil((Ie.getTime() - Re.getTime()) / 864e5)), Be = Math.round((ze - $) / ze * 100), Ve = [
165
+ }), Ue = new Date(O.endDate), We = new Date(O.startDate), Ge = /* @__PURE__ */ new Date(), Ke = Math.ceil((Ue.getTime() - We.getTime()) / 864e5), qe = Math.max(0, Math.ceil((Ue.getTime() - Ge.getTime()) / 864e5)), Je = Math.round((Ke - qe) / Ke * 100), Ye = [
164
166
  ...q && T.canUpdateSubscription ? [{
165
167
  id: "change-plan",
166
168
  label: "Review or change your plan",
167
169
  description: "Upgrade, downgrade, or compare what each tier includes.",
168
- onClick: () => S(g(`/subscriptions/${D.id}/upgrade`, E ?? D.billingAccountId))
170
+ onClick: () => S(g(`/subscriptions/${O.id}/upgrade`, D ?? O.billingAccountId))
169
171
  }] : [],
170
- ...q && j && !Y && !Q ? [{
172
+ ...q && M && !Y && !Q ? [{
171
173
  id: "activate-workspace",
172
174
  label: "Activate quotas for your workspace",
173
175
  description: "Turn on the workspace-scoped limits included in this plan.",
@@ -177,15 +179,422 @@ var w = () => {
177
179
  id: "track-usage",
178
180
  label: "Track your usage",
179
181
  description: "See how much of your included quota you have consumed.",
180
- onClick: () => S(g("/usage", E ?? D.billingAccountId))
182
+ onClick: () => S(g("/usage", D ?? O.billingAccountId))
181
183
  },
182
184
  {
183
185
  id: "view-invoices",
184
186
  label: "Review invoices & payments",
185
187
  description: "Check what has been billed for this subscription.",
186
- onClick: () => S(g("/invoices", E ?? D.billingAccountId))
188
+ onClick: () => S(g("/invoices", D ?? O.billingAccountId))
187
189
  }
188
- ];
190
+ ], Xe = /* @__PURE__ */ x(t, {
191
+ className: "overflow-hidden",
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
+ });
189
598
  return /* @__PURE__ */ x("div", {
190
599
  className: "space-y-6 px-6 lg:px-8 py-6",
191
600
  children: [
@@ -196,7 +605,7 @@ var w = () => {
196
605
  children: [/* @__PURE__ */ b("button", {
197
606
  type: "button",
198
607
  "aria-label": "Back to subscriptions",
199
- onClick: () => S(g("/subscriptions", E)),
608
+ onClick: () => S(g("/subscriptions", D)),
200
609
  className: "p-2 -ml-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken rounded-button transition-colors duration-200",
201
610
  children: /* @__PURE__ */ b("svg", {
202
611
  className: "size-5",
@@ -217,395 +626,107 @@ var w = () => {
217
626
  className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
218
627
  children: H?.name || "Subscription"
219
628
  }), /* @__PURE__ */ b(n, {
220
- status: Pe,
629
+ status: Ve,
221
630
  dot: !0,
222
631
  pulse: q,
223
- children: ne(D.status)
632
+ children: oe(O.status)
224
633
  })]
225
634
  }),
226
635
  /* @__PURE__ */ b("p", {
227
636
  className: "text-sm text-text-secondary mt-1",
228
- children: H?.pricingModel === _.PER_SEAT && H.pricePerSeat ? `${d(H.pricePerSeat, H.currency)} / seat / ${m(H.duration)} · ${D.seatCount ?? H.minSeats ?? 1} seats = ${d(H.pricePerSeat * (D.seatCount ?? H.minSeats ?? 1), H.currency)} / ${m(H.duration)}` : H ? `${d(H.price, H.currency)} / ${m(H.duration)}` : "Unknown plan"
637
+ children: H?.pricingModel === ue.PER_SEAT && H.pricePerSeat ? `${d(H.pricePerSeat, H.currency)} / seat / ${m(H.duration)} · ${O.seatCount ?? H.minSeats ?? 1} seats = ${d(H.pricePerSeat * (O.seatCount ?? H.minSeats ?? 1), H.currency)} / ${m(H.duration)}` : H ? `${d(H.price, H.currency)} / ${m(H.duration)}` : "Unknown plan"
229
638
  }),
230
- /* @__PURE__ */ b(me, {
639
+ /* @__PURE__ */ b(ve, {
231
640
  className: "mt-3",
232
641
  children: p("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.")
233
642
  })
234
643
  ] })]
235
644
  }), /* @__PURE__ */ x("div", {
236
645
  className: "flex items-center gap-2",
237
- children: [/* @__PURE__ */ b(de, {
238
- primary: q && T.canUpdateSubscription ? {
239
- label: "Change Plan",
240
- onSelect: () => S(g(`/subscriptions/${D.id}/upgrade`, E ?? D.billingAccountId))
241
- } : void 0,
242
- actions: [...q && T.canUpdateSubscription && H?.pricingModel === _.PER_SEAT ? [{
243
- label: "Manage Seats",
244
- onSelect: () => I(!0)
245
- }] : [], ...q && T.canCancelSubscription && !D.canceledAt ? [{
246
- label: A ? "Canceling…" : "Cancel Subscription",
247
- onSelect: () => F(!0),
248
- disabled: A,
249
- intent: "destructive"
250
- }] : []]
251
- }), D.canceledAt && /* @__PURE__ */ b("span", {
252
- className: "px-4 py-2 text-sm font-medium text-status-warning-text bg-status-warning-bg-subtle rounded-button",
253
- children: "Cancellation Scheduled"
254
- })]
646
+ children: [
647
+ /* @__PURE__ */ b(me, {
648
+ primary: $.showChangePlan ? {
649
+ label: E ? p("billing.subscription.changePlan", "Change plan") : "Change Plan",
650
+ onSelect: () => S(g(`/subscriptions/${O.id}/upgrade`, D ?? O.billingAccountId))
651
+ } : void 0,
652
+ actions: [...$.menuManageSeats ? [{
653
+ label: "Manage Seats",
654
+ onSelect: () => I(!0)
655
+ }] : [], ...$.menuCancel ? [{
656
+ label: j ? "Canceling…" : "Cancel Subscription",
657
+ onSelect: () => F(!0),
658
+ disabled: j,
659
+ intent: "destructive"
660
+ }] : []]
661
+ }),
662
+ $.visibleCancel && /* @__PURE__ */ b("button", {
663
+ type: "button",
664
+ onClick: () => F(!0),
665
+ disabled: j,
666
+ className: "px-3 py-2 text-sm font-medium text-status-error-text hover:bg-bg-sunken rounded-button transition-colors duration-200 disabled:opacity-50",
667
+ children: j ? p("billing.subscription.canceling", "Canceling…") : p("billing.subscription.cancel", "Cancel subscription")
668
+ }),
669
+ O.canceledAt && /* @__PURE__ */ b("span", {
670
+ className: "px-4 py-2 text-sm font-medium text-status-warning-text bg-status-warning-bg-subtle rounded-button",
671
+ children: "Cancellation Scheduled"
672
+ })
673
+ ]
255
674
  })]
256
675
  }),
257
676
  /* @__PURE__ */ x("div", {
258
- className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
677
+ className: E ? "space-y-6" : "grid grid-cols-1 lg:grid-cols-3 gap-6",
259
678
  children: [/* @__PURE__ */ x("div", {
260
- className: "lg:col-span-2 space-y-6",
261
- children: [
262
- q && /* @__PURE__ */ x(fe, {
263
- className: "p-5",
264
- children: [/* @__PURE__ */ x("div", {
265
- className: "flex items-center justify-between mb-4",
266
- children: [/* @__PURE__ */ b("h2", {
267
- className: "text-base font-semibold text-text-primary",
268
- children: "Current Period"
269
- }), /* @__PURE__ */ x("span", {
270
- className: "text-sm text-text-secondary tabular-nums",
271
- children: [$, " days remaining"]
272
- })]
273
- }), /* @__PURE__ */ x("div", {
274
- className: "space-y-2",
275
- children: [/* @__PURE__ */ b(r, {
276
- value: Be,
277
- status: "primary",
278
- size: "md",
279
- "aria-label": "Billing period progress"
280
- }), /* @__PURE__ */ x("div", {
281
- className: "flex items-center justify-between text-sm text-text-secondary",
282
- children: [/* @__PURE__ */ b("span", { children: f(D.startDate, "short") }), /* @__PURE__ */ b("span", { children: f(D.endDate, "short") })]
283
- })]
284
- })]
285
- }),
286
- /* @__PURE__ */ x(t, {
287
- className: "overflow-hidden",
288
- children: [/* @__PURE__ */ x("div", {
289
- className: "p-5 border-b border-border-subtle",
290
- children: [/* @__PURE__ */ x("h2", {
291
- className: "text-base font-semibold text-text-primary",
292
- children: ["Plan Quotas", U.length > 0 && /* @__PURE__ */ x("span", {
293
- className: "ml-2 text-sm font-normal text-text-muted tabular-nums",
294
- children: [
295
- "(",
296
- U.length,
297
- ")"
298
- ]
299
- })]
300
- }), /* @__PURE__ */ b("p", {
301
- className: "text-sm text-text-secondary mt-0.5",
302
- children: "Limits included in your plan"
303
- })]
304
- }), /* @__PURE__ */ b("div", {
305
- className: "p-5",
306
- children: U.length === 0 ? /* @__PURE__ */ b("p", {
307
- className: "text-sm text-text-secondary",
308
- children: "No quotas assigned to this subscription."
309
- }) : /* @__PURE__ */ b("div", {
310
- className: "space-y-3",
311
- children: U.map((e) => /* @__PURE__ */ b(he, { quota: e }, e.id))
312
- })
679
+ className: E ? "space-y-6" : "lg:col-span-2 space-y-6",
680
+ children: [q && /* @__PURE__ */ x(he, {
681
+ className: "p-5",
682
+ children: [/* @__PURE__ */ x("div", {
683
+ className: "flex items-center justify-between mb-4",
684
+ children: [/* @__PURE__ */ b("h2", {
685
+ className: "text-base font-semibold text-text-primary",
686
+ children: "Current Period"
687
+ }), /* @__PURE__ */ x("span", {
688
+ className: "text-sm text-text-secondary tabular-nums",
689
+ children: [qe, " days remaining"]
313
690
  })]
314
- }),
315
- q && j && /* @__PURE__ */ x(t, {
316
- className: "overflow-hidden",
317
- children: [
318
- /* @__PURE__ */ x("div", {
319
- className: "p-5 border-b border-border-subtle flex items-center justify-between gap-4",
320
- children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("h2", {
321
- className: "text-base font-semibold text-text-primary",
322
- children: "Workspace Quotas"
323
- }), /* @__PURE__ */ b("p", {
324
- className: "text-sm text-text-secondary mt-0.5",
325
- children: "Active limits for your workspace"
326
- })] }), Y ? /* @__PURE__ */ b(n, {
327
- status: "success",
328
- dot: !0,
329
- children: "Active"
330
- }) : Q ? /* @__PURE__ */ b(n, {
331
- status: "warning",
332
- dot: !0,
333
- children: "At workspace limit"
334
- }) : /* @__PURE__ */ b("button", {
335
- type: "button",
336
- onClick: () => L(!0),
337
- 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",
338
- children: "Activate for Workspace"
339
- })]
340
- }),
341
- /* @__PURE__ */ b("div", {
342
- className: "p-5",
343
- children: Y ? J.length > 0 ? /* @__PURE__ */ b("div", {
344
- className: "space-y-3",
345
- children: J.map((e) => /* @__PURE__ */ b(ge, { item: e }, e.assignment.id))
346
- }) : /* @__PURE__ */ x("p", {
347
- className: "text-sm text-text-secondary",
348
- children: [
349
- "Quotas are activated on workspace",
350
- " ",
351
- /* @__PURE__ */ b("span", {
352
- className: "font-mono text-xs text-text-primary bg-bg-sunken/60 rounded px-1.5 py-0.5",
353
- children: j
354
- }),
355
- ". Usage data will appear here once quotas are consumed."
356
- ]
357
- }) : Q ? /* @__PURE__ */ x("div", {
358
- className: "flex items-start gap-3",
359
- children: [/* @__PURE__ */ b("div", {
360
- className: "size-8 rounded-full bg-status-warning-bg-subtle flex items-center justify-center shrink-0 mt-0.5",
361
- children: /* @__PURE__ */ b("svg", {
362
- className: "size-4 text-status-warning-text",
363
- fill: "none",
364
- viewBox: "0 0 24 24",
365
- stroke: "currentColor",
366
- children: /* @__PURE__ */ b("path", {
367
- strokeLinecap: "round",
368
- strokeLinejoin: "round",
369
- strokeWidth: 2,
370
- 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"
371
- })
372
- })
373
- }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
374
- className: "text-sm font-medium text-text-primary",
375
- children: "Already active on another workspace"
376
- }), /* @__PURE__ */ x("p", {
377
- className: "text-sm text-text-secondary mt-0.5",
378
- children: [
379
- H?.name ?? "This plan",
380
- " can be activated for",
381
- " ",
382
- Z === 1 ? "only 1 workspace" : `at most ${Z} workspaces`,
383
- ", and",
384
- " ",
385
- X === 1 ? "it" : `${X} of them`,
386
- " ",
387
- M && /* @__PURE__ */ x(le, { children: [
388
- "(",
389
- /* @__PURE__ */ b("span", {
390
- className: "font-mono text-xs bg-bg-sunken/60 rounded px-1.5 py-0.5",
391
- children: P.find((e) => e.id === M)?.name ?? M
392
- }),
393
- ")",
394
- " "
395
- ] }),
396
- X === 1 ? "is" : "are",
397
- " already using it. Switch to that workspace to see its quotas, or remove it there to free up the slot for this one."
398
- ]
399
- })] })]
400
- }) : /* @__PURE__ */ x("div", {
401
- className: "flex items-start gap-3",
402
- children: [/* @__PURE__ */ b("div", {
403
- className: "size-8 rounded-full bg-status-warning-bg-subtle flex items-center justify-center shrink-0 mt-0.5",
404
- children: /* @__PURE__ */ b("svg", {
405
- className: "size-4 text-status-warning-text",
406
- fill: "none",
407
- viewBox: "0 0 24 24",
408
- stroke: "currentColor",
409
- children: /* @__PURE__ */ b("path", {
410
- strokeLinecap: "round",
411
- strokeLinejoin: "round",
412
- strokeWidth: 2,
413
- 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"
414
- })
415
- })
416
- }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
417
- className: "text-sm font-medium text-text-primary",
418
- children: "Workspace quotas not activated yet"
419
- }), /* @__PURE__ */ x("p", {
420
- className: "text-sm text-text-secondary mt-0.5",
421
- children: [
422
- "Click",
423
- " ",
424
- /* @__PURE__ */ b("button", {
425
- type: "button",
426
- onClick: () => L(!0),
427
- className: "text-text-link hover:underline font-medium",
428
- children: "Activate for Workspace"
429
- }),
430
- " ",
431
- "to enable the workspace-scoped limits included in this plan."
432
- ]
433
- })] })]
434
- })
435
- }),
436
- Me && /* @__PURE__ */ b(se, {
437
- billingAccountId: E ?? D.billingAccountId,
438
- subscriptionId: D.id,
439
- quotas: Fe,
440
- workspaces: P,
441
- currentWorkspaceId: j,
442
- onAssigned: () => {
443
- L(!1), k(), De();
444
- },
445
- onSkip: () => L(!1)
446
- })
447
- ]
448
- }),
449
- W.length > 0 && /* @__PURE__ */ x(t, {
450
- className: "overflow-hidden",
451
- children: [/* @__PURE__ */ b("div", {
452
- className: "p-5 border-b border-border-subtle",
453
- children: /* @__PURE__ */ x("h2", {
454
- className: "text-base font-semibold text-text-primary",
455
- children: [
456
- "Addons",
457
- " ",
458
- /* @__PURE__ */ x("span", {
459
- className: "text-sm font-normal text-text-muted tabular-nums",
460
- children: [
461
- "(",
462
- W.length,
463
- ")"
464
- ]
465
- })
466
- ]
467
- })
468
- }), /* @__PURE__ */ b("div", {
469
- className: "p-5",
470
- children: /* @__PURE__ */ b("div", {
471
- className: "space-y-3",
472
- children: W.map((e) => /* @__PURE__ */ b(_e, { addonSubscription: e }, e.id))
473
- })
691
+ }), /* @__PURE__ */ x("div", {
692
+ className: "space-y-2",
693
+ children: [/* @__PURE__ */ b(r, {
694
+ value: Je,
695
+ status: "primary",
696
+ size: "md",
697
+ "aria-label": "Billing period progress"
698
+ }), /* @__PURE__ */ x("div", {
699
+ className: "flex items-center justify-between text-sm text-text-secondary",
700
+ children: [/* @__PURE__ */ b("span", { children: f(O.startDate, "short") }), /* @__PURE__ */ b("span", { children: f(O.endDate, "short") })]
474
701
  })]
475
- }),
476
- G.length > 0 && /* @__PURE__ */ x(t, {
477
- className: "overflow-hidden",
478
- children: [
479
- /* @__PURE__ */ b("div", {
480
- className: "p-5 border-b border-border-subtle",
481
- children: /* @__PURE__ */ b("h2", {
482
- className: "text-base font-semibold text-text-primary",
483
- children: "Recent Transactions"
484
- })
485
- }),
486
- /* @__PURE__ */ b("div", {
487
- className: "divide-y divide-border-subtle",
488
- children: G.slice(0, 5).map((e) => /* @__PURE__ */ b(ve, { transaction: e }, e.id))
489
- }),
490
- G.length > 5 && /* @__PURE__ */ b("div", {
491
- className: "p-4 text-center border-t border-border-subtle",
492
- children: /* @__PURE__ */ b("button", {
493
- type: "button",
494
- className: "text-sm text-text-link hover:underline",
495
- children: "View all transactions"
496
- })
497
- })
498
- ]
499
- })
500
- ]
501
- }), /* @__PURE__ */ x("div", {
702
+ })]
703
+ }), E ? /* @__PURE__ */ x(y, { children: [at, ot] }) : /* @__PURE__ */ x(y, { children: [
704
+ Xe,
705
+ Ze,
706
+ Qe,
707
+ $e
708
+ ] })]
709
+ }), !E && /* @__PURE__ */ x("div", {
502
710
  className: "space-y-6 lg:sticky lg:top-6 lg:self-start",
503
711
  children: [
504
- /* @__PURE__ */ b(pe, {
505
- storageKey: "billing-subscription-detail",
506
- steps: Ve
507
- }),
508
- /* @__PURE__ */ x(t, {
509
- className: "overflow-hidden",
510
- children: [/* @__PURE__ */ b("div", {
511
- className: "p-5 border-b border-border-subtle",
512
- children: /* @__PURE__ */ b("h2", {
513
- className: "text-base font-semibold text-text-primary",
514
- children: "Details"
515
- })
516
- }), /* @__PURE__ */ x("div", {
517
- className: "p-5 space-y-4",
518
- children: [
519
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
520
- className: "text-sm text-text-secondary",
521
- children: "Subscription ID"
522
- }), /* @__PURE__ */ b("p", {
523
- className: "font-mono text-sm text-text-primary mt-0.5 break-all",
524
- children: D.id
525
- })] }),
526
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
527
- className: "text-sm text-text-secondary",
528
- children: "Plan"
529
- }), /* @__PURE__ */ b("p", {
530
- className: "text-sm text-text-primary mt-0.5",
531
- children: H?.name || "Unknown"
532
- })] }),
533
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
534
- className: "text-sm text-text-secondary",
535
- children: "Billing Account"
536
- }), /* @__PURE__ */ b("p", {
537
- className: "text-sm text-text-primary mt-0.5",
538
- children: D.billingAccount?.name || "Unknown"
539
- })] }),
540
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
541
- className: "text-sm text-text-secondary",
542
- children: "Start Date"
543
- }), /* @__PURE__ */ b("p", {
544
- className: "text-sm text-text-primary mt-0.5",
545
- children: f(D.startDate)
546
- })] }),
547
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
548
- className: "text-sm text-text-secondary",
549
- children: "End Date"
550
- }), /* @__PURE__ */ b("p", {
551
- className: "text-sm text-text-primary mt-0.5",
552
- children: f(D.endDate)
553
- })] }),
554
- D.nextBillingDate && /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
555
- className: "text-sm text-text-secondary",
556
- children: "Next Billing"
557
- }), /* @__PURE__ */ b("p", {
558
- className: "text-sm text-text-primary mt-0.5",
559
- children: f(D.nextBillingDate)
560
- })] }),
561
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
562
- className: "text-sm text-text-secondary",
563
- children: "Auto Renewal"
564
- }), /* @__PURE__ */ b("p", {
565
- className: "text-sm text-text-primary mt-0.5",
566
- children: D.autoRenewal ? "Enabled" : "Disabled"
567
- })] }),
568
- D.paymentGateway && /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
569
- className: "text-sm text-text-secondary",
570
- children: "Payment Gateway"
571
- }), /* @__PURE__ */ b("p", {
572
- className: "text-sm text-text-primary mt-0.5 capitalize",
573
- children: D.paymentGateway
574
- })] })
575
- ]
576
- })]
577
- }),
578
- K.length > 0 && /* @__PURE__ */ x(t, {
579
- className: "overflow-hidden",
580
- children: [/* @__PURE__ */ b("div", {
581
- className: "p-5 border-b border-border-subtle",
582
- children: /* @__PURE__ */ b("h2", {
583
- className: "text-base font-semibold text-text-primary",
584
- children: "History"
585
- })
586
- }), /* @__PURE__ */ b("div", {
587
- className: "p-5",
588
- children: /* @__PURE__ */ b("div", {
589
- className: "space-y-3",
590
- children: K.slice(0, 5).map((e) => /* @__PURE__ */ b(ye, { item: e }, e.id))
591
- })
592
- })]
593
- })
712
+ et,
713
+ tt,
714
+ nt
594
715
  ]
595
716
  })]
596
717
  }),
597
- je && D && /* @__PURE__ */ b(oe, {
598
- subscription: D,
718
+ Re && O && /* @__PURE__ */ b(de, {
719
+ subscription: O,
599
720
  onClose: () => I(!1),
600
721
  onConfirm: async (e) => {
601
- await we({
602
- subscriptionId: D.id,
722
+ await Ae({
723
+ subscriptionId: O.id,
603
724
  seatCount: e
604
- }), await k();
725
+ }), await A();
605
726
  },
606
- isLoading: Te
727
+ isLoading: je
607
728
  }),
608
- Ae && /* @__PURE__ */ x("div", {
729
+ Le && /* @__PURE__ */ x("div", {
609
730
  className: "fixed inset-0 z-50 flex items-center justify-center",
610
731
  children: [/* @__PURE__ */ b("div", {
611
732
  className: "absolute inset-0 bg-overlay-scrim",
@@ -619,16 +740,19 @@ var w = () => {
619
740
  /* @__PURE__ */ b("h3", {
620
741
  id: "cancel-subscription-title",
621
742
  className: "text-lg font-semibold text-text-primary mb-2",
622
- children: "Cancel Subscription"
743
+ children: E ? p("billing.subscription.cancelTitle", "Cancel {plan}?").replace("{plan}", rt ?? p("billing.subscription.thisSubscription", "this subscription")) : "Cancel Subscription"
623
744
  }),
624
- /* @__PURE__ */ x("p", {
745
+ E ? /* @__PURE__ */ b("p", {
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", {
625
749
  className: "text-sm text-text-secondary mb-4",
626
750
  children: [
627
751
  "Are you sure you want to cancel this subscription? Your subscription will remain active until",
628
752
  " ",
629
753
  /* @__PURE__ */ b("span", {
630
754
  className: "font-medium text-text-primary",
631
- children: f(D.endDate)
755
+ children: f(O.endDate)
632
756
  }),
633
757
  ", but will not renew automatically."
634
758
  ]
@@ -664,10 +788,10 @@ var w = () => {
664
788
  children: "Keep Subscription"
665
789
  }), /* @__PURE__ */ b("button", {
666
790
  type: "button",
667
- onClick: Ne,
668
- disabled: A,
791
+ onClick: Be,
792
+ disabled: j,
669
793
  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",
670
- children: A ? "Canceling..." : "Confirm Cancellation"
794
+ children: j ? "Canceling..." : "Confirm Cancellation"
671
795
  })]
672
796
  })
673
797
  ]
@@ -675,7 +799,7 @@ var w = () => {
675
799
  })
676
800
  ]
677
801
  });
678
- }, he = ({ quota: e }) => {
802
+ }, xe = ({ quota: e }) => {
679
803
  let t = e.context, n = S(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";
680
804
  return /* @__PURE__ */ x("div", {
681
805
  className: "p-4 rounded-card border border-border-seam bg-bg-surface",
@@ -722,7 +846,7 @@ var w = () => {
722
846
  })
723
847
  ]
724
848
  });
725
- }, ge = ({ item: e }) => {
849
+ }, Se = ({ item: e }) => {
726
850
  let { assignment: t, effectiveUsed: n, usagePercentage: r } = e, i = S(t.quotaName), a = !t.noLimit && t.limit !== null, o = t.limit ?? 0, s = t.quotaName.includes("bytes") || t.quotaName.includes("storage"), c = C(t.resetPeriod);
727
851
  return /* @__PURE__ */ x("div", {
728
852
  className: "p-4 rounded-card border border-border-seam bg-bg-surface",
@@ -763,7 +887,7 @@ var w = () => {
763
887
  })
764
888
  ]
765
889
  });
766
- }, _e = ({ addonSubscription: e }) => {
890
+ }, Ce = ({ addonSubscription: e }) => {
767
891
  let t = e.addon;
768
892
  return /* @__PURE__ */ x("div", {
769
893
  className: "flex items-center justify-between p-3 rounded-card border border-border-seam bg-bg-sunken",
@@ -778,7 +902,7 @@ var w = () => {
778
902
  children: d(t.price * e.quantity, t.currency)
779
903
  })]
780
904
  });
781
- }, ve = ({ transaction: e }) => /* @__PURE__ */ x("div", {
905
+ }, we = ({ transaction: e }) => /* @__PURE__ */ x("div", {
782
906
  className: "flex items-center justify-between px-5 py-4 hover:bg-bg-sunken transition-colors",
783
907
  children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
784
908
  className: "font-medium text-text-primary capitalize",
@@ -796,7 +920,7 @@ var w = () => {
796
920
  children: e.status
797
921
  })]
798
922
  })]
799
- }), ye = ({ item: e }) => /* @__PURE__ */ x("div", {
923
+ }), Te = ({ item: e }) => /* @__PURE__ */ x("div", {
800
924
  className: "flex items-start gap-3",
801
925
  children: [/* @__PURE__ */ b("div", { className: "size-2 rounded-full bg-text-muted mt-2 shrink-0" }), /* @__PURE__ */ x("div", { children: [
802
926
  /* @__PURE__ */ x("p", {