@burdenoff/microfe-billing 2026.1113.2 → 2026.1113.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/billing/BillingRoot.js +83 -77
  2. package/dist/billing/BillingRoot.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +78 -78
  4. package/dist/billing/modules/addons/pages/AddonCreatePage.js +70 -70
  5. package/dist/billing/modules/addons/pages/AddonDetailPage.js +72 -72
  6. package/dist/billing/modules/addons/pages/AddonEditPage.js +79 -79
  7. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +224 -224
  8. package/dist/billing/modules/addons/pages/AddonsListPage.js +186 -186
  9. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +168 -168
  10. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  11. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +88 -88
  12. package/dist/billing/modules/billing/hooks/index.js +5 -5
  13. package/dist/billing/modules/billing/hooks/useInvoices.js +39 -20
  14. package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
  15. package/dist/billing/modules/billing/index.js +14 -14
  16. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +92 -92
  17. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +160 -160
  18. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  19. package/dist/billing/modules/billing/pages/InvoicesListPage.js +100 -100
  20. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +105 -105
  21. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +37 -37
  22. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +41 -41
  23. package/dist/billing/modules/billing/pages/RefundsPage.js +334 -334
  24. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  25. package/dist/billing/modules/billing/pages/TransactionsPage.js +174 -174
  26. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  27. package/dist/billing/modules/billing/pages/UserRefundsPage.js +24 -24
  28. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  29. package/dist/billing/modules/checkout/components/OrderSummary.js +71 -71
  30. package/dist/billing/modules/checkout/pages/CheckoutPage.js +646 -625
  31. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  32. package/dist/billing/modules/checkout/utils/checkoutOptions.d.ts +23 -0
  33. package/dist/billing/modules/checkout/utils/checkoutOptions.js +8 -0
  34. package/dist/billing/modules/checkout/utils/checkoutOptions.js.map +1 -0
  35. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +112 -112
  36. package/dist/billing/modules/coupons/pages/CouponsListPage.js +118 -118
  37. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  38. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +119 -119
  39. package/dist/billing/modules/coupons/pages/EditCouponPage.js +82 -82
  40. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +30 -30
  41. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +77 -77
  42. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +144 -144
  43. package/dist/billing/modules/credits/pages/CreditsPage.js +67 -67
  44. package/dist/billing/modules/dashboard/pages/OverviewPage.js +594 -442
  45. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  46. package/dist/billing/modules/dashboard/utils/overviewSummary.d.ts +46 -0
  47. package/dist/billing/modules/dashboard/utils/overviewSummary.js +37 -0
  48. package/dist/billing/modules/dashboard/utils/overviewSummary.js.map +1 -0
  49. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +199 -199
  50. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  51. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +64 -64
  52. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +122 -122
  53. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
  54. package/dist/billing/modules/earnings/pages/EarningsPage.js +102 -102
  55. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  56. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +178 -178
  57. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  58. package/dist/billing/modules/earnings/pages/PayoutsPage.js +107 -107
  59. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  60. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +54 -54
  61. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +94 -94
  62. package/dist/billing/modules/plans/pages/PlanCreatePage.js +73 -73
  63. package/dist/billing/modules/plans/pages/PlanDetailPage.js +96 -96
  64. package/dist/billing/modules/plans/pages/PlanEditPage.js +16 -16
  65. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  66. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +100 -100
  67. package/dist/billing/modules/plans/pages/PlansListPage.js +88 -88
  68. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +60 -60
  69. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +37 -37
  70. package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js +62 -62
  71. package/dist/billing/modules/quota/pages/QuotaPage.js +1 -1
  72. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +69 -69
  73. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +76 -76
  74. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +80 -80
  75. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +95 -95
  76. package/dist/billing/modules/settings/pages/SettingsPage.js +134 -134
  77. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  78. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +62 -62
  79. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  80. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +36 -36
  81. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +534 -410
  82. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  83. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +111 -111
  84. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +166 -160
  85. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  86. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.d.ts +30 -0
  87. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js +20 -0
  88. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js.map +1 -0
  89. package/dist/billing/modules/subscriptions/utils/upgradeAccess.d.ts +10 -0
  90. package/dist/billing/modules/subscriptions/utils/upgradeAccess.js +7 -0
  91. package/dist/billing/modules/subscriptions/utils/upgradeAccess.js.map +1 -0
  92. package/dist/billing/modules/usage/pages/UsagePage.js +722 -591
  93. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  94. package/dist/billing/modules/usage/utils/usageHealth.d.ts +63 -0
  95. package/dist/billing/modules/usage/utils/usageHealth.js +43 -0
  96. package/dist/billing/modules/usage/utils/usageHealth.js.map +1 -0
  97. package/dist/billing/shared/components/EmptyState.js +3 -3
  98. package/dist/billing/shared/components/MoneyActionDialog.js +12 -12
  99. package/dist/billing/shared/ui/MetricCard.js +13 -13
  100. package/dist/billing/shared/utils/format.js +16 -4
  101. package/dist/billing/shared/utils/format.js.map +1 -1
  102. package/dist/billing/shared/utils/index.js +8 -8
  103. package/dist/generated/global-operations.js +294 -286
  104. package/dist/generated/global-operations.js.map +1 -1
  105. package/package.json +2 -2
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Checkout "More options" (BOFF-11860). Under the FluidGrids variant the seat
3
+ * count, promo code and auto-renew sit together in one fold. A fold must never
4
+ * hide a choice that was already made, so this says which of them differ from
5
+ * their defaults and the fold's summary line names them.
6
+ */
7
+ export type CheckoutOptionKey = 'seats' | 'promo' | 'autoRenew';
8
+ export interface CheckoutOptionState {
9
+ /** Seats chosen. Only a per-seat plan has this option. */
10
+ seatCount: number;
11
+ /** The plan's minimum seats, which is where the count starts. */
12
+ minSeats: number;
13
+ /** True when this purchase has the seat option at all (a per-seat plan). */
14
+ hasSeatOption: boolean;
15
+ /** A promo code is applied and discounting. */
16
+ promoApplied: boolean;
17
+ /** Auto-renew is switched on (it starts off). */
18
+ autoRenew: boolean;
19
+ /** True when this purchase offers auto-renew (a plan, paid by card). */
20
+ hasAutoRenewOption: boolean;
21
+ }
22
+ /** The options inside the fold that differ from their defaults, in display order. */
23
+ export declare function customisedCheckoutOptions(state: CheckoutOptionState): CheckoutOptionKey[];
@@ -0,0 +1,8 @@
1
+ // src/billing/modules/checkout/utils/checkoutOptions.ts
2
+ function e(e) {
3
+ let t = [];
4
+ return e.hasSeatOption && e.seatCount !== e.minSeats && t.push("seats"), e.promoApplied && t.push("promo"), e.hasAutoRenewOption && e.autoRenew && t.push("autoRenew"), t;
5
+ }
6
+ export { e as customisedCheckoutOptions };
7
+
8
+ //# sourceMappingURL=checkoutOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkoutOptions.js","names":["customisedCheckoutOptions","changed","state"],"sources":["../../../../../src/billing/modules/checkout/utils/checkoutOptions.ts"],"sourcesContent":["/**\n * Checkout \"More options\" (BOFF-11860). Under the FluidGrids variant the seat\n * count, promo code and auto-renew sit together in one fold. A fold must never\n * hide a choice that was already made, so this says which of them differ from\n * their defaults and the fold's summary line names them.\n */\nexport type CheckoutOptionKey = 'seats' | 'promo' | 'autoRenew';\n\nexport interface CheckoutOptionState {\n /** Seats chosen. Only a per-seat plan has this option. */\n seatCount: number;\n /** The plan's minimum seats, which is where the count starts. */\n minSeats: number;\n /** True when this purchase has the seat option at all (a per-seat plan). */\n hasSeatOption: boolean;\n /** A promo code is applied and discounting. */\n promoApplied: boolean;\n /** Auto-renew is switched on (it starts off). */\n autoRenew: boolean;\n /** True when this purchase offers auto-renew (a plan, paid by card). */\n hasAutoRenewOption: boolean;\n}\n\n/** The options inside the fold that differ from their defaults, in display order. */\nexport function customisedCheckoutOptions(state: CheckoutOptionState): CheckoutOptionKey[] {\n const changed: CheckoutOptionKey[] = [];\n if (state.hasSeatOption && state.seatCount !== state.minSeats) changed.push('seats');\n if (state.promoApplied) changed.push('promo');\n if (state.hasAutoRenewOption && state.autoRenew) changed.push('autoRenew');\n return changed;\n}\n"],"mappings":";AAwBA,SAAgBA,EAA0B,GAAiD;CACzF,IAAMC,IAA+B,CAAC;CAItC,OAHIC,EAAM,iBAAiBA,EAAM,cAAcA,EAAM,YAAUD,EAAQ,KAAK,OAAO,GAC/EC,EAAM,gBAAcD,EAAQ,KAAK,OAAO,GACxCC,EAAM,sBAAsBA,EAAM,aAAWD,EAAQ,KAAK,WAAW,GAClEA;AACT"}
@@ -6,17 +6,17 @@ import "../../../shared/components/index.js";
6
6
  import { useGetCouponLazyQuery as i, useGetCouponUsageHistoryQuery as a } from "../../../../generated/global-operations.js";
7
7
  import { CouponStatus as o } from "../../../../generated/global-types.js";
8
8
  import { useEffect as s, useState as c } from "react";
9
- import { ArrowLeft as l, BarChart2 as u, Calendar as d, ChevronLeft as f, ChevronRight as p, Edit as m, History as h, Package as g, Tag as _, Users as v } from "lucide-react";
10
- import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
11
- import { useI18n as S } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
- import { CTAOverflowMenu as C, NextSteps as w, PagePurpose as T, ResponsiveTable as E } from "@burdenoff/fe-libs/ui";
9
+ import { CTAOverflowMenu as l, NextSteps as u, PagePurpose as d, ResponsiveTable as f } from "@burdenoff/fe-libs/ui";
10
+ import { ArrowLeft as p, BarChart2 as m, Calendar as h, ChevronLeft as g, ChevronRight as _, Edit as v, History as y, Package as b, Tag as x, Users as S } from "lucide-react";
11
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
12
+ import { useI18n as E } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
13
13
  // src/billing/modules/coupons/pages/CouponDetailPage.tsx
14
14
  var D = [
15
15
  {
16
16
  key: "userId",
17
17
  header: "User ID",
18
18
  priority: "primary",
19
- cell: (e) => /* @__PURE__ */ x("span", {
19
+ cell: (e) => /* @__PURE__ */ T("span", {
20
20
  className: "font-mono",
21
21
  children: [e.userId.slice(0, 12), "…"]
22
22
  })
@@ -24,17 +24,17 @@ var D = [
24
24
  {
25
25
  key: "transaction",
26
26
  header: "Transaction",
27
- cell: (e) => e.transactionId ? /* @__PURE__ */ x("span", {
27
+ cell: (e) => e.transactionId ? /* @__PURE__ */ T("span", {
28
28
  className: "font-mono text-xs text-text-link",
29
29
  children: [e.transactionId.slice(0, 12), "…"]
30
- }) : e.orderId ? /* @__PURE__ */ x("span", {
30
+ }) : e.orderId ? /* @__PURE__ */ T("span", {
31
31
  className: "text-xs text-text-muted",
32
32
  children: [
33
33
  "Order: ",
34
34
  e.orderId.slice(0, 12),
35
35
  "…"
36
36
  ]
37
- }) : /* @__PURE__ */ b("span", {
37
+ }) : /* @__PURE__ */ w("span", {
38
38
  className: "text-text-muted",
39
39
  children: ", "
40
40
  })
@@ -42,7 +42,7 @@ var D = [
42
42
  {
43
43
  key: "original",
44
44
  header: "Original",
45
- cell: (e) => /* @__PURE__ */ x("span", {
45
+ cell: (e) => /* @__PURE__ */ T("span", {
46
46
  className: "tabular-nums",
47
47
  children: [
48
48
  e.originalAmount.toFixed(2),
@@ -54,7 +54,7 @@ var D = [
54
54
  {
55
55
  key: "discount",
56
56
  header: "Discount",
57
- cell: (e) => /* @__PURE__ */ x("span", {
57
+ cell: (e) => /* @__PURE__ */ T("span", {
58
58
  className: "tabular-nums text-status-success-text font-medium",
59
59
  children: [
60
60
  "-",
@@ -67,7 +67,7 @@ var D = [
67
67
  {
68
68
  key: "final",
69
69
  header: "Final",
70
- cell: (e) => /* @__PURE__ */ x("span", {
70
+ cell: (e) => /* @__PURE__ */ T("span", {
71
71
  className: "tabular-nums font-medium",
72
72
  children: [
73
73
  e.finalAmount.toFixed(2),
@@ -104,25 +104,25 @@ function O({ status: e }) {
104
104
  label: e,
105
105
  className: "bg-bg-sunken text-text-muted"
106
106
  };
107
- return /* @__PURE__ */ b("span", {
107
+ return /* @__PURE__ */ w("span", {
108
108
  className: `inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium border ${n}`,
109
109
  children: t
110
110
  });
111
111
  }
112
112
  function k({ label: e, value: t }) {
113
- return /* @__PURE__ */ x("div", {
113
+ return /* @__PURE__ */ T("div", {
114
114
  className: "flex items-start gap-2 py-3 border-b border-border-subtle last:border-0",
115
- children: [/* @__PURE__ */ b("span", {
115
+ children: [/* @__PURE__ */ w("span", {
116
116
  className: "text-sm text-text-muted w-44 shrink-0",
117
117
  children: e
118
- }), /* @__PURE__ */ b("span", {
118
+ }), /* @__PURE__ */ w("span", {
119
119
  className: "text-sm text-text-primary font-medium flex-1",
120
120
  children: t ?? "—"
121
121
  })]
122
122
  });
123
123
  }
124
124
  var A = () => {
125
- let { t: o } = S(), A = (e, t) => {
125
+ let { t: o } = E(), A = (e, t) => {
126
126
  let n = o(e);
127
127
  return n === e ? t : n;
128
128
  }, j = n(), M = r(), N = window.location.pathname.split("/").filter(Boolean).slice(-1)[0], [P, F] = c("details"), [I, L] = c(0), [R, { data: z, loading: B, error: V }] = i(), { data: H, loading: U } = a({
@@ -135,35 +135,35 @@ var A = () => {
135
135
  });
136
136
  if (s(() => {
137
137
  N && R({ variables: { id: N } });
138
- }, [N, R]), !M.canManageDiscounts) return /* @__PURE__ */ b(e, { message: "You don't have permission to view coupon details." });
139
- if (B) return /* @__PURE__ */ x("div", {
138
+ }, [N, R]), !M.canManageDiscounts) return /* @__PURE__ */ w(e, { message: "You don't have permission to view coupon details." });
139
+ if (B) return /* @__PURE__ */ T("div", {
140
140
  className: "p-8",
141
- children: [/* @__PURE__ */ b(t, {
141
+ children: [/* @__PURE__ */ w(t, {
142
142
  title: A("billing.coupons.detailTitle", "Coupon Details"),
143
143
  description: "Loading...",
144
- actions: /* @__PURE__ */ x("button", {
144
+ actions: /* @__PURE__ */ T("button", {
145
145
  type: "button",
146
146
  onClick: () => j("/coupons"),
147
147
  className: "px-4 py-2 rounded-lg border border-border-subtle text-text-primary hover:bg-bg-sunken flex items-center gap-2",
148
- children: [/* @__PURE__ */ b(l, { className: "size-4" }), "Back"]
148
+ children: [/* @__PURE__ */ w(p, { className: "size-4" }), "Back"]
149
149
  })
150
- }), /* @__PURE__ */ b("div", {
150
+ }), /* @__PURE__ */ w("div", {
151
151
  className: "flex items-center justify-center h-64",
152
- children: /* @__PURE__ */ b("div", { className: "size-8 animate-spin rounded-full border-4 border-action-primary-bg border-t-transparent" })
152
+ children: /* @__PURE__ */ w("div", { className: "size-8 animate-spin rounded-full border-4 border-action-primary-bg border-t-transparent" })
153
153
  })]
154
154
  });
155
- if (V || !z?.getCoupon) return /* @__PURE__ */ x("div", {
155
+ if (V || !z?.getCoupon) return /* @__PURE__ */ T("div", {
156
156
  className: "p-8",
157
- children: [/* @__PURE__ */ b(t, {
157
+ children: [/* @__PURE__ */ w(t, {
158
158
  title: "Coupon Details",
159
159
  description: "Coupon not found",
160
- actions: /* @__PURE__ */ x("button", {
160
+ actions: /* @__PURE__ */ T("button", {
161
161
  type: "button",
162
162
  onClick: () => j("/coupons"),
163
163
  className: "px-4 py-2 rounded-lg border border-border-subtle text-text-primary hover:bg-bg-sunken flex items-center gap-2",
164
- children: [/* @__PURE__ */ b(l, { className: "size-4" }), "Back"]
164
+ children: [/* @__PURE__ */ w(p, { className: "size-4" }), "Back"]
165
165
  })
166
- }), /* @__PURE__ */ b("div", {
166
+ }), /* @__PURE__ */ w("div", {
167
167
  className: "flex items-center justify-center h-64 text-status-error-text text-sm",
168
168
  children: V ? `Error: ${V.message}` : "Coupon not found"
169
169
  })]
@@ -192,55 +192,55 @@ var A = () => {
192
192
  month: "short",
193
193
  day: "numeric"
194
194
  }) : null, J = () => W.type === "PERCENTAGE" ? `${W.value}%` : `${W.value}${W.currency ? ` ${W.currency}` : ""}`;
195
- return /* @__PURE__ */ x("div", {
195
+ return /* @__PURE__ */ T("div", {
196
196
  className: "p-8",
197
197
  children: [
198
- /* @__PURE__ */ b(t, {
198
+ /* @__PURE__ */ w(t, {
199
199
  title: W.name || W.code,
200
200
  description: W.description || `Coupon code: ${W.code}`,
201
- actions: /* @__PURE__ */ b(C, {
201
+ actions: /* @__PURE__ */ w(l, {
202
202
  primary: {
203
203
  label: "Edit",
204
204
  onSelect: () => j(`/coupons/${W.id}/edit`),
205
- icon: /* @__PURE__ */ b(m, { className: "size-4" })
205
+ icon: /* @__PURE__ */ w(v, { className: "size-4" })
206
206
  },
207
207
  actions: [{
208
208
  label: "Back to coupons",
209
209
  onSelect: () => j("/coupons"),
210
- icon: /* @__PURE__ */ b(l, { className: "size-4" })
210
+ icon: /* @__PURE__ */ w(p, { className: "size-4" })
211
211
  }]
212
212
  })
213
213
  }),
214
- /* @__PURE__ */ b(T, {
214
+ /* @__PURE__ */ w(d, {
215
215
  className: "mt-2",
216
216
  children: "Everything about this coupon — its discount, validity window, usage limits and the full redemption history. Use it to check how it is performing, edit its terms, or stop it being redeemed."
217
217
  }),
218
- /* @__PURE__ */ b(w, {
218
+ /* @__PURE__ */ w(u, {
219
219
  storageKey: "billing-coupon-detail",
220
220
  steps: K,
221
221
  className: "mt-4"
222
222
  }),
223
- /* @__PURE__ */ b("div", {
223
+ /* @__PURE__ */ w("div", {
224
224
  className: "mt-6 border-b border-border-subtle flex gap-1",
225
- children: ["details", "usage"].map((e) => /* @__PURE__ */ x("button", {
225
+ children: ["details", "usage"].map((e) => /* @__PURE__ */ T("button", {
226
226
  type: "button",
227
227
  onClick: () => F(e),
228
228
  className: `flex items-center gap-2 px-4 py-2.5 text-sm font-medium border-b-2 -mb-px transition-colors ${P === e ? "border-action-primary-bg text-text-primary" : "border-transparent text-text-muted hover:text-text-primary"}`,
229
- children: [b(e === "details" ? _ : h, { className: "size-4" }), e === "details" ? "Details" : `Usage History${H ? ` (${H.getCouponUsageHistory.total})` : ""}`]
229
+ children: [w(e === "details" ? x : y, { className: "size-4" }), e === "details" ? "Details" : `Usage History${H ? ` (${H.getCouponUsageHistory.total})` : ""}`]
230
230
  }, e))
231
231
  }),
232
- P === "usage" && /* @__PURE__ */ b("div", {
232
+ P === "usage" && /* @__PURE__ */ w("div", {
233
233
  className: "mt-6 bg-bg-surface border border-border-subtle rounded-lg overflow-hidden",
234
- children: U ? /* @__PURE__ */ b("div", {
234
+ children: U ? /* @__PURE__ */ w("div", {
235
235
  className: "flex items-center justify-center h-40",
236
- children: /* @__PURE__ */ b("div", { className: "size-6 animate-spin rounded-full border-4 border-action-primary-bg border-t-transparent" })
237
- }) : H?.getCouponUsageHistory.usages.length ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(E, {
236
+ children: /* @__PURE__ */ w("div", { className: "size-6 animate-spin rounded-full border-4 border-action-primary-bg border-t-transparent" })
237
+ }) : H?.getCouponUsageHistory.usages.length ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(f, {
238
238
  data: H.getCouponUsageHistory.usages,
239
239
  rowKey: (e) => e.id,
240
240
  columns: D
241
- }), (H.getCouponUsageHistory.total ?? 0) > 20 && /* @__PURE__ */ x("div", {
241
+ }), (H.getCouponUsageHistory.total ?? 0) > 20 && /* @__PURE__ */ T("div", {
242
242
  className: "flex items-center justify-between p-4 border-t border-border-subtle",
243
- children: [/* @__PURE__ */ x("p", {
243
+ children: [/* @__PURE__ */ T("p", {
244
244
  className: "text-sm text-text-muted",
245
245
  children: [
246
246
  I * 20 + 1,
@@ -250,104 +250,104 @@ var A = () => {
250
250
  "of ",
251
251
  H.getCouponUsageHistory.total
252
252
  ]
253
- }), /* @__PURE__ */ x("div", {
253
+ }), /* @__PURE__ */ T("div", {
254
254
  className: "flex items-center gap-2",
255
- children: [/* @__PURE__ */ b("button", {
255
+ children: [/* @__PURE__ */ w("button", {
256
256
  type: "button",
257
257
  onClick: () => L((e) => Math.max(0, e - 1)),
258
258
  disabled: I === 0,
259
259
  className: "p-1.5 rounded border border-border-subtle hover:bg-bg-sunken disabled:opacity-40",
260
- children: /* @__PURE__ */ b(f, { className: "size-4" })
261
- }), /* @__PURE__ */ b("button", {
260
+ children: /* @__PURE__ */ w(g, { className: "size-4" })
261
+ }), /* @__PURE__ */ w("button", {
262
262
  type: "button",
263
263
  onClick: () => L((e) => e + 1),
264
264
  disabled: !H.getCouponUsageHistory.hasMore,
265
265
  className: "p-1.5 rounded border border-border-subtle hover:bg-bg-sunken disabled:opacity-40",
266
- children: /* @__PURE__ */ b(p, { className: "size-4" })
266
+ children: /* @__PURE__ */ w(_, { className: "size-4" })
267
267
  })]
268
268
  })]
269
- })] }) : /* @__PURE__ */ b("div", {
269
+ })] }) : /* @__PURE__ */ w("div", {
270
270
  className: "p-8 text-center text-sm text-text-muted",
271
271
  children: "No usage recorded for this coupon yet."
272
272
  })
273
273
  }),
274
- P === "details" && /* @__PURE__ */ x("div", {
274
+ P === "details" && /* @__PURE__ */ T("div", {
275
275
  className: "mt-8 grid grid-cols-1 lg:grid-cols-3 gap-6",
276
276
  children: [
277
- /* @__PURE__ */ x("div", {
277
+ /* @__PURE__ */ T("div", {
278
278
  className: "lg:col-span-3 grid grid-cols-2 sm:grid-cols-4 gap-4",
279
279
  children: [
280
- /* @__PURE__ */ x("div", {
280
+ /* @__PURE__ */ T("div", {
281
281
  className: "bg-bg-surface border border-border-subtle rounded-lg p-4",
282
- children: [/* @__PURE__ */ x("div", {
282
+ children: [/* @__PURE__ */ T("div", {
283
283
  className: "flex items-center gap-2 text-text-muted mb-1",
284
- children: [/* @__PURE__ */ b(_, { className: "size-4" }), /* @__PURE__ */ b("span", {
284
+ children: [/* @__PURE__ */ w(x, { className: "size-4" }), /* @__PURE__ */ w("span", {
285
285
  className: "text-xs font-medium uppercase tracking-wide",
286
286
  children: "Code"
287
287
  })]
288
- }), /* @__PURE__ */ b("p", {
288
+ }), /* @__PURE__ */ w("p", {
289
289
  className: "text-lg font-mono font-bold text-text-primary",
290
290
  children: W.code
291
291
  })]
292
292
  }),
293
- /* @__PURE__ */ x("div", {
293
+ /* @__PURE__ */ T("div", {
294
294
  className: "bg-bg-surface border border-border-subtle rounded-lg p-4",
295
295
  children: [
296
- /* @__PURE__ */ x("div", {
296
+ /* @__PURE__ */ T("div", {
297
297
  className: "flex items-center gap-2 text-text-muted mb-1",
298
- children: [/* @__PURE__ */ b(u, { className: "size-4" }), /* @__PURE__ */ b("span", {
298
+ children: [/* @__PURE__ */ w(m, { className: "size-4" }), /* @__PURE__ */ w("span", {
299
299
  className: "text-xs font-medium uppercase tracking-wide",
300
300
  children: "Discount"
301
301
  })]
302
302
  }),
303
- /* @__PURE__ */ b("p", {
303
+ /* @__PURE__ */ w("p", {
304
304
  className: "text-lg font-bold text-text-primary",
305
305
  children: J()
306
306
  }),
307
- /* @__PURE__ */ b("p", {
307
+ /* @__PURE__ */ w("p", {
308
308
  className: "text-xs text-text-muted capitalize",
309
309
  children: W.type.replace("_", " ").toLowerCase()
310
310
  })
311
311
  ]
312
312
  }),
313
- /* @__PURE__ */ x("div", {
313
+ /* @__PURE__ */ T("div", {
314
314
  className: "bg-bg-surface border border-border-subtle rounded-lg p-4",
315
315
  children: [
316
- /* @__PURE__ */ x("div", {
316
+ /* @__PURE__ */ T("div", {
317
317
  className: "flex items-center gap-2 text-text-muted mb-1",
318
- children: [/* @__PURE__ */ b(v, { className: "size-4" }), /* @__PURE__ */ b("span", {
318
+ children: [/* @__PURE__ */ w(S, { className: "size-4" }), /* @__PURE__ */ w("span", {
319
319
  className: "text-xs font-medium uppercase tracking-wide",
320
320
  children: "Usage"
321
321
  })]
322
322
  }),
323
- /* @__PURE__ */ x("p", {
323
+ /* @__PURE__ */ T("p", {
324
324
  className: "text-lg font-bold text-text-primary",
325
325
  children: [W.currentUses, W.maxTotalUses ? ` / ${W.maxTotalUses}` : ""]
326
326
  }),
327
- G !== null && /* @__PURE__ */ b("div", {
327
+ G !== null && /* @__PURE__ */ w("div", {
328
328
  className: "mt-1.5 h-1.5 w-full bg-bg-sunken rounded-full overflow-hidden",
329
- children: /* @__PURE__ */ b("div", {
329
+ children: /* @__PURE__ */ w("div", {
330
330
  className: "h-full bg-action-primary-bg rounded-full",
331
331
  style: { width: `${Math.min(G, 100)}%` }
332
332
  })
333
333
  })
334
334
  ]
335
335
  }),
336
- /* @__PURE__ */ x("div", {
336
+ /* @__PURE__ */ T("div", {
337
337
  className: "bg-bg-surface border border-border-subtle rounded-lg p-4",
338
338
  children: [
339
- /* @__PURE__ */ x("div", {
339
+ /* @__PURE__ */ T("div", {
340
340
  className: "flex items-center gap-2 text-text-muted mb-1",
341
- children: [/* @__PURE__ */ b(d, { className: "size-4" }), /* @__PURE__ */ b("span", {
341
+ children: [/* @__PURE__ */ w(h, { className: "size-4" }), /* @__PURE__ */ w("span", {
342
342
  className: "text-xs font-medium uppercase tracking-wide",
343
343
  children: "Status"
344
344
  })]
345
345
  }),
346
- /* @__PURE__ */ b("div", {
346
+ /* @__PURE__ */ w("div", {
347
347
  className: "mt-1",
348
- children: /* @__PURE__ */ b(O, { status: W.status })
348
+ children: /* @__PURE__ */ w(O, { status: W.status })
349
349
  }),
350
- W.validUntil && /* @__PURE__ */ x("p", {
350
+ W.validUntil && /* @__PURE__ */ T("p", {
351
351
  className: "text-xs text-text-muted mt-1",
352
352
  children: ["Expires ", q(W.validUntil)]
353
353
  })
@@ -355,148 +355,148 @@ var A = () => {
355
355
  })
356
356
  ]
357
357
  }),
358
- /* @__PURE__ */ x("div", {
358
+ /* @__PURE__ */ T("div", {
359
359
  className: "lg:col-span-2 space-y-4",
360
- children: [/* @__PURE__ */ x("div", {
360
+ children: [/* @__PURE__ */ T("div", {
361
361
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6",
362
362
  children: [
363
- /* @__PURE__ */ b("h3", {
363
+ /* @__PURE__ */ w("h3", {
364
364
  className: "text-sm font-semibold text-text-primary uppercase tracking-wide mb-2",
365
365
  children: "Coupon Details"
366
366
  }),
367
- /* @__PURE__ */ b(k, {
367
+ /* @__PURE__ */ w(k, {
368
368
  label: "Code",
369
- value: /* @__PURE__ */ b("span", {
369
+ value: /* @__PURE__ */ w("span", {
370
370
  className: "font-mono",
371
371
  children: W.code
372
372
  })
373
373
  }),
374
- /* @__PURE__ */ b(k, {
374
+ /* @__PURE__ */ w(k, {
375
375
  label: "Name",
376
376
  value: W.name
377
377
  }),
378
- /* @__PURE__ */ b(k, {
378
+ /* @__PURE__ */ w(k, {
379
379
  label: "Description",
380
380
  value: W.description
381
381
  }),
382
- /* @__PURE__ */ b(k, {
382
+ /* @__PURE__ */ w(k, {
383
383
  label: "Type",
384
384
  value: W.type.replace("_", " ").toLowerCase()
385
385
  }),
386
- /* @__PURE__ */ b(k, {
386
+ /* @__PURE__ */ w(k, {
387
387
  label: "Value",
388
388
  value: J()
389
389
  }),
390
- /* @__PURE__ */ b(k, {
390
+ /* @__PURE__ */ w(k, {
391
391
  label: "Scope",
392
392
  value: W.scope
393
393
  }),
394
- /* @__PURE__ */ b(k, {
394
+ /* @__PURE__ */ w(k, {
395
395
  label: "Status",
396
- value: /* @__PURE__ */ b(O, { status: W.status })
396
+ value: /* @__PURE__ */ w(O, { status: W.status })
397
397
  })
398
398
  ]
399
- }), /* @__PURE__ */ x("div", {
399
+ }), /* @__PURE__ */ T("div", {
400
400
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6",
401
401
  children: [
402
- /* @__PURE__ */ b("h3", {
402
+ /* @__PURE__ */ w("h3", {
403
403
  className: "text-sm font-semibold text-text-primary uppercase tracking-wide mb-2",
404
404
  children: "Restrictions"
405
405
  }),
406
- /* @__PURE__ */ b(k, {
406
+ /* @__PURE__ */ w(k, {
407
407
  label: "Min Purchase Amount",
408
408
  value: W.minPurchaseAmount == null ? null : `${W.minPurchaseAmount}${W.currency ? ` ${W.currency}` : ""}`
409
409
  }),
410
- /* @__PURE__ */ b(k, {
410
+ /* @__PURE__ */ w(k, {
411
411
  label: "Max Discount Amount",
412
412
  value: W.maxDiscountAmount == null ? null : `${W.maxDiscountAmount}${W.currency ? ` ${W.currency}` : ""}`
413
413
  }),
414
- /* @__PURE__ */ b(k, {
414
+ /* @__PURE__ */ w(k, {
415
415
  label: "Max Uses Per User",
416
416
  value: W.maxUsesPerUser
417
417
  }),
418
- /* @__PURE__ */ b(k, {
418
+ /* @__PURE__ */ w(k, {
419
419
  label: "Restricted Users",
420
- value: W.restrictedToUserIds?.length ? /* @__PURE__ */ b("span", {
420
+ value: W.restrictedToUserIds?.length ? /* @__PURE__ */ w("span", {
421
421
  className: "font-mono text-xs break-all",
422
422
  children: W.restrictedToUserIds.join(", ")
423
423
  }) : "No restrictions"
424
424
  }),
425
- /* @__PURE__ */ b(k, {
425
+ /* @__PURE__ */ w(k, {
426
426
  label: "Applicable Products",
427
427
  value: W.applicableProducts?.length ? W.applicableProducts.join(", ") : "All products"
428
428
  }),
429
- /* @__PURE__ */ b(k, {
429
+ /* @__PURE__ */ w(k, {
430
430
  label: "Applicable Product Slugs",
431
431
  value: W.applicableProductIds?.length ? W.applicableProductIds.join(", ") : "All products"
432
432
  }),
433
- /* @__PURE__ */ b(k, {
433
+ /* @__PURE__ */ w(k, {
434
434
  label: "Applicable Purchase Types",
435
435
  value: W.applicableEntityTypes?.length ? W.applicableEntityTypes.join(", ") : "Plan, add-on, and store purchases"
436
436
  }),
437
- /* @__PURE__ */ b(k, {
437
+ /* @__PURE__ */ w(k, {
438
438
  label: "Excluded Products",
439
439
  value: W.excludedProducts?.length ? W.excludedProducts.join(", ") : "None"
440
440
  })
441
441
  ]
442
442
  })]
443
443
  }),
444
- /* @__PURE__ */ x("div", {
444
+ /* @__PURE__ */ T("div", {
445
445
  className: "space-y-4",
446
446
  children: [
447
- /* @__PURE__ */ x("div", {
447
+ /* @__PURE__ */ T("div", {
448
448
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6",
449
449
  children: [
450
- /* @__PURE__ */ b("h3", {
450
+ /* @__PURE__ */ w("h3", {
451
451
  className: "text-sm font-semibold text-text-primary uppercase tracking-wide mb-2",
452
452
  children: "Validity"
453
453
  }),
454
- /* @__PURE__ */ b(k, {
454
+ /* @__PURE__ */ w(k, {
455
455
  label: "Valid From",
456
456
  value: q(W.validFrom)
457
457
  }),
458
- /* @__PURE__ */ b(k, {
458
+ /* @__PURE__ */ w(k, {
459
459
  label: "Valid Until",
460
460
  value: q(W.validUntil) ?? "No expiry"
461
461
  })
462
462
  ]
463
463
  }),
464
- W.campaignId && /* @__PURE__ */ x("div", {
464
+ W.campaignId && /* @__PURE__ */ T("div", {
465
465
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6",
466
466
  children: [
467
- /* @__PURE__ */ b("h3", {
467
+ /* @__PURE__ */ w("h3", {
468
468
  className: "text-sm font-semibold text-text-primary uppercase tracking-wide mb-2",
469
469
  children: "Campaign"
470
470
  }),
471
- /* @__PURE__ */ b(k, {
471
+ /* @__PURE__ */ w(k, {
472
472
  label: "Campaign ID",
473
- value: /* @__PURE__ */ b("span", {
473
+ value: /* @__PURE__ */ w("span", {
474
474
  className: "font-mono text-xs",
475
475
  children: W.campaignId
476
476
  })
477
477
  }),
478
- /* @__PURE__ */ b(k, {
478
+ /* @__PURE__ */ w(k, {
479
479
  label: "Campaign Name",
480
480
  value: W.campaignName
481
481
  })
482
482
  ]
483
483
  }),
484
- /* @__PURE__ */ x("div", {
484
+ /* @__PURE__ */ T("div", {
485
485
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6",
486
486
  children: [
487
- /* @__PURE__ */ x("h3", {
487
+ /* @__PURE__ */ T("h3", {
488
488
  className: "text-sm font-semibold text-text-primary uppercase tracking-wide mb-2",
489
- children: [/* @__PURE__ */ b(g, { className: "size-4 inline mr-1" }), "Audit"]
489
+ children: [/* @__PURE__ */ w(b, { className: "size-4 inline mr-1" }), "Audit"]
490
490
  }),
491
- /* @__PURE__ */ b(k, {
491
+ /* @__PURE__ */ w(k, {
492
492
  label: "Created",
493
493
  value: q(W.createdAt)
494
494
  }),
495
- /* @__PURE__ */ b(k, {
495
+ /* @__PURE__ */ w(k, {
496
496
  label: "Last Updated",
497
497
  value: q(W.updatedAt)
498
498
  }),
499
- /* @__PURE__ */ b(k, {
499
+ /* @__PURE__ */ w(k, {
500
500
  label: "Created By",
501
501
  value: W.createdBy ?? null
502
502
  })