@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
@@ -5,10 +5,10 @@ import { formatCurrency as n, formatPlanDuration as r, formatPlanDurationLabel a
5
5
  import { usePlan as o, usePlanMutations as s } from "../hooks/usePlans.js";
6
6
  import { getPlanFeatureQuantity as c, getPlanFeatureUnit as l, getQuotaDisplayName as u } from "../../../shared/utils/planFeatureQuantity.js";
7
7
  import { useMemo as d } from "react";
8
- import { useParams as f } from "react-router";
9
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
10
- import { useI18n as g } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
11
- import { EmphasisPanel as _, PagePurpose as v } from "@burdenoff/fe-libs/ui";
8
+ import { EmphasisPanel as f, PagePurpose as p } from "@burdenoff/fe-libs/ui";
9
+ import { useParams as m } from "react-router";
10
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
11
+ import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
12
  // src/billing/modules/plans/pages/PlanDetailPage.tsx
13
13
  function y(e) {
14
14
  let t = /* @__PURE__ */ new Map();
@@ -28,45 +28,45 @@ function y(e) {
28
28
  return Array.from(t.values());
29
29
  }
30
30
  var b = () => {
31
- let { t: c } = g(), l = (e, t) => {
31
+ let { t: c } = v(), l = (e, t) => {
32
32
  let n = c(e);
33
33
  return n === e ? t : n;
34
- }, { planId: u } = f(), b = e(), x = t(), { plan: S, isLoading: C, error: w, refetch: T } = o(u), { togglePlan: E, isToggling: D } = s(), O = d(() => y(S?.features || []), [S?.features]);
35
- return x.canViewPlans ? C ? /* @__PURE__ */ h("div", {
34
+ }, { planId: u } = m(), b = e(), x = t(), { plan: S, isLoading: C, error: w, refetch: T } = o(u), { togglePlan: E, isToggling: D } = s(), O = d(() => y(S?.features || []), [S?.features]);
35
+ return x.canViewPlans ? C ? /* @__PURE__ */ _("div", {
36
36
  className: "space-y-6 p-6",
37
- children: [/* @__PURE__ */ h("div", {
37
+ children: [/* @__PURE__ */ _("div", {
38
38
  className: "flex items-center gap-4",
39
- children: [/* @__PURE__ */ m("div", { className: "size-10 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ m("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" })]
40
- }), /* @__PURE__ */ h("div", {
39
+ children: [/* @__PURE__ */ g("div", { className: "size-10 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ g("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" })]
40
+ }), /* @__PURE__ */ _("div", {
41
41
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
42
- children: [/* @__PURE__ */ m("div", {
42
+ children: [/* @__PURE__ */ g("div", {
43
43
  className: "lg:col-span-2 space-y-6",
44
- children: /* @__PURE__ */ h("div", {
44
+ children: /* @__PURE__ */ _("div", {
45
45
  className: "border border-border-subtle rounded-lg p-6 space-y-4",
46
46
  children: [
47
- /* @__PURE__ */ m("div", { className: "h-6 w-32 bg-bg-sunken animate-pulse rounded" }),
48
- /* @__PURE__ */ m("div", { className: "h-4 w-full bg-bg-sunken animate-pulse rounded" }),
49
- /* @__PURE__ */ m("div", { className: "h-4 w-3/4 bg-bg-sunken animate-pulse rounded" })
47
+ /* @__PURE__ */ g("div", { className: "h-6 w-32 bg-bg-sunken animate-pulse rounded" }),
48
+ /* @__PURE__ */ g("div", { className: "h-4 w-full bg-bg-sunken animate-pulse rounded" }),
49
+ /* @__PURE__ */ g("div", { className: "h-4 w-3/4 bg-bg-sunken animate-pulse rounded" })
50
50
  ]
51
51
  })
52
- }), /* @__PURE__ */ h("div", {
52
+ }), /* @__PURE__ */ _("div", {
53
53
  className: "border border-border-subtle rounded-lg p-6 space-y-4",
54
- children: [/* @__PURE__ */ m("div", { className: "h-6 w-24 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ m("div", { className: "h-10 w-full bg-bg-sunken animate-pulse rounded" })]
54
+ children: [/* @__PURE__ */ g("div", { className: "h-6 w-24 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ g("div", { className: "h-10 w-full bg-bg-sunken animate-pulse rounded" })]
55
55
  })]
56
56
  })]
57
- }) : w || !S ? /* @__PURE__ */ m("div", {
57
+ }) : w || !S ? /* @__PURE__ */ g("div", {
58
58
  className: "flex items-center justify-center h-full min-h-[400px]",
59
- children: /* @__PURE__ */ h("div", {
59
+ children: /* @__PURE__ */ _("div", {
60
60
  className: "text-center space-y-4",
61
61
  children: [
62
- /* @__PURE__ */ m("div", {
62
+ /* @__PURE__ */ g("div", {
63
63
  className: "size-12 mx-auto rounded-full bg-status-error-bg-subtle flex items-center justify-center",
64
- children: /* @__PURE__ */ m("svg", {
64
+ children: /* @__PURE__ */ g("svg", {
65
65
  className: "size-6 text-status-error-text",
66
66
  fill: "none",
67
67
  viewBox: "0 0 24 24",
68
68
  stroke: "currentColor",
69
- children: /* @__PURE__ */ m("path", {
69
+ children: /* @__PURE__ */ g("path", {
70
70
  strokeLinecap: "round",
71
71
  strokeLinejoin: "round",
72
72
  strokeWidth: 2,
@@ -74,15 +74,15 @@ var b = () => {
74
74
  })
75
75
  })
76
76
  }),
77
- /* @__PURE__ */ m("h2", {
77
+ /* @__PURE__ */ g("h2", {
78
78
  className: "text-lg font-semibold text-text-primary",
79
79
  children: l("billing.plans.planNotFound", "Plan not found")
80
80
  }),
81
- /* @__PURE__ */ m("p", {
81
+ /* @__PURE__ */ g("p", {
82
82
  className: "text-sm text-text-muted",
83
83
  children: w?.message || l("billing.plans.planNotFoundMessage", "The plan you are looking for does not exist.")
84
84
  }),
85
- /* @__PURE__ */ m("button", {
85
+ /* @__PURE__ */ g("button", {
86
86
  type: "button",
87
87
  onClick: () => b("/plans"),
88
88
  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",
@@ -90,61 +90,61 @@ var b = () => {
90
90
  })
91
91
  ]
92
92
  })
93
- }) : /* @__PURE__ */ h("div", {
93
+ }) : /* @__PURE__ */ _("div", {
94
94
  className: "space-y-6 p-6",
95
- children: [/* @__PURE__ */ h("div", {
95
+ children: [/* @__PURE__ */ _("div", {
96
96
  className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
97
- children: [/* @__PURE__ */ h("div", {
97
+ children: [/* @__PURE__ */ _("div", {
98
98
  className: "flex items-start gap-4",
99
- children: [/* @__PURE__ */ m("button", {
99
+ children: [/* @__PURE__ */ g("button", {
100
100
  type: "button",
101
101
  onClick: () => b("/plans"),
102
102
  className: "p-2 -ml-2 text-text-muted hover:text-text-primary hover:bg-bg-sunken rounded-md transition-colors",
103
- children: /* @__PURE__ */ m("svg", {
103
+ children: /* @__PURE__ */ g("svg", {
104
104
  className: "size-5",
105
105
  fill: "none",
106
106
  viewBox: "0 0 24 24",
107
107
  stroke: "currentColor",
108
- children: /* @__PURE__ */ m("path", {
108
+ children: /* @__PURE__ */ g("path", {
109
109
  strokeLinecap: "round",
110
110
  strokeLinejoin: "round",
111
111
  strokeWidth: 2,
112
112
  d: "M15 19l-7-7 7-7"
113
113
  })
114
114
  })
115
- }), /* @__PURE__ */ h("div", { children: [
116
- /* @__PURE__ */ h("div", {
115
+ }), /* @__PURE__ */ _("div", { children: [
116
+ /* @__PURE__ */ _("div", {
117
117
  className: "flex items-center gap-3",
118
- children: [/* @__PURE__ */ m("h1", {
118
+ children: [/* @__PURE__ */ g("h1", {
119
119
  className: "text-2xl md:text-3xl font-semibold tracking-tight text-text-primary",
120
120
  children: S.name
121
- }), /* @__PURE__ */ m("span", {
121
+ }), /* @__PURE__ */ g("span", {
122
122
  className: `px-2 py-1 text-xs font-medium rounded ${S.isActive ? "bg-status-success-bg-subtle text-status-success-text" : "bg-bg-sunken text-text-muted"}`,
123
123
  children: S.isActive ? "Active" : "Inactive"
124
124
  })]
125
125
  }),
126
- /* @__PURE__ */ h("p", {
126
+ /* @__PURE__ */ _("p", {
127
127
  className: "text-sm text-text-muted mt-1",
128
128
  children: [i(S.duration), " billing plan"]
129
129
  }),
130
- /* @__PURE__ */ m(v, {
130
+ /* @__PURE__ */ g(p, {
131
131
  className: "mt-3",
132
132
  children: l("billing.plans.detailPurpose", "A full breakdown of this plan — its price, billing period and every quota and feature it grants. Use it to decide whether the plan fits before subscribing, or (as an admin) to edit or activate it.")
133
133
  })
134
134
  ] })]
135
- }), /* @__PURE__ */ h("div", {
135
+ }), /* @__PURE__ */ _("div", {
136
136
  className: "flex items-center gap-2",
137
- children: [x.canCreateSubscription && S.isActive && /* @__PURE__ */ m("button", {
137
+ children: [x.canCreateSubscription && S.isActive && /* @__PURE__ */ g("button", {
138
138
  type: "button",
139
139
  onClick: () => b(`/checkout/${S.id}`),
140
140
  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",
141
141
  children: "Subscribe to Plan"
142
- }), x.canManagePlans && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("button", {
142
+ }), x.canManagePlans && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("button", {
143
143
  type: "button",
144
144
  onClick: () => b(`/plans/${S.id}/edit`),
145
145
  className: "px-4 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
146
146
  children: "Edit Plan"
147
- }), /* @__PURE__ */ m("button", {
147
+ }), /* @__PURE__ */ g("button", {
148
148
  type: "button",
149
149
  onClick: async () => {
150
150
  if (x.canManagePlans) try {
@@ -158,28 +158,28 @@ var b = () => {
158
158
  children: D ? l("billing.plans.processing", "Processing...") : S.isActive ? l("billing.plans.deactivate", "Deactivate") : l("billing.plans.activate", "Activate")
159
159
  })] })]
160
160
  })]
161
- }), /* @__PURE__ */ h("div", {
161
+ }), /* @__PURE__ */ _("div", {
162
162
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
163
- children: [/* @__PURE__ */ h("div", {
163
+ children: [/* @__PURE__ */ _("div", {
164
164
  className: "lg:col-span-2 space-y-6",
165
- children: [/* @__PURE__ */ h(_, {
165
+ children: [/* @__PURE__ */ _(f, {
166
166
  className: "p-6",
167
167
  children: [
168
- /* @__PURE__ */ m("h2", {
168
+ /* @__PURE__ */ g("h2", {
169
169
  className: "text-lg font-semibold text-text-primary mb-4",
170
170
  children: l("billing.plans.pricing", "Pricing")
171
171
  }),
172
- /* @__PURE__ */ h("div", {
172
+ /* @__PURE__ */ _("div", {
173
173
  className: "flex items-baseline gap-1",
174
- children: [/* @__PURE__ */ m("span", {
174
+ children: [/* @__PURE__ */ g("span", {
175
175
  className: "text-4xl font-bold text-text-primary",
176
176
  children: n(S.price, S.currency)
177
- }), /* @__PURE__ */ h("span", {
177
+ }), /* @__PURE__ */ _("span", {
178
178
  className: "text-lg text-text-muted",
179
179
  children: ["/ ", r(S.duration)]
180
180
  })]
181
181
  }),
182
- /* @__PURE__ */ h("p", {
182
+ /* @__PURE__ */ _("p", {
183
183
  className: "text-sm text-text-muted mt-2",
184
184
  children: [
185
185
  l("billing.plans.billed", "Billed"),
@@ -188,11 +188,11 @@ var b = () => {
188
188
  ]
189
189
  })
190
190
  ]
191
- }), /* @__PURE__ */ h("div", {
191
+ }), /* @__PURE__ */ _("div", {
192
192
  className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)]",
193
- children: [/* @__PURE__ */ m("div", {
193
+ children: [/* @__PURE__ */ g("div", {
194
194
  className: "p-6 border-b border-border-subtle bg-bg-sunken/30",
195
- children: /* @__PURE__ */ h("h2", {
195
+ children: /* @__PURE__ */ _("h2", {
196
196
  className: "text-lg font-semibold text-text-primary",
197
197
  children: [
198
198
  l("billing.plans.featuresAndQuotas", "Features & Quotas"),
@@ -201,46 +201,46 @@ var b = () => {
201
201
  ")"
202
202
  ]
203
203
  })
204
- }), /* @__PURE__ */ m("div", {
204
+ }), /* @__PURE__ */ g("div", {
205
205
  className: "p-6",
206
- children: O.length === 0 ? /* @__PURE__ */ m("p", {
206
+ children: O.length === 0 ? /* @__PURE__ */ g("p", {
207
207
  className: "text-sm text-text-muted",
208
208
  children: l("billing.plans.noFeatures", "No features configured for this plan.")
209
- }) : /* @__PURE__ */ m("ul", {
209
+ }) : /* @__PURE__ */ g("ul", {
210
210
  className: "space-y-3",
211
- children: O.map((e) => /* @__PURE__ */ h("li", {
211
+ children: O.map((e) => /* @__PURE__ */ _("li", {
212
212
  className: "flex items-start gap-3 p-3 rounded-lg bg-bg-sunken/30",
213
- children: [/* @__PURE__ */ m("div", {
213
+ children: [/* @__PURE__ */ g("div", {
214
214
  className: "size-8 rounded-full bg-status-success-bg-subtle flex items-center justify-center shrink-0",
215
- children: /* @__PURE__ */ m("svg", {
215
+ children: /* @__PURE__ */ g("svg", {
216
216
  className: "size-4 text-status-success-text",
217
217
  fill: "none",
218
218
  viewBox: "0 0 24 24",
219
219
  stroke: "currentColor",
220
- children: /* @__PURE__ */ m("path", {
220
+ children: /* @__PURE__ */ g("path", {
221
221
  strokeLinecap: "round",
222
222
  strokeLinejoin: "round",
223
223
  strokeWidth: 2,
224
224
  d: "M5 13l4 4L19 7"
225
225
  })
226
226
  })
227
- }), /* @__PURE__ */ h("div", {
227
+ }), /* @__PURE__ */ _("div", {
228
228
  className: "flex-1",
229
- children: [/* @__PURE__ */ h("div", {
229
+ children: [/* @__PURE__ */ _("div", {
230
230
  className: "flex items-center justify-between",
231
- children: [/* @__PURE__ */ m("p", {
231
+ children: [/* @__PURE__ */ g("p", {
232
232
  className: "font-medium text-text-primary",
233
233
  children: e.name
234
- }), /* @__PURE__ */ m("span", {
234
+ }), /* @__PURE__ */ g("span", {
235
235
  className: "font-semibold text-text-primary",
236
236
  children: a(e.totalValue, e.unit)
237
237
  })]
238
- }), /* @__PURE__ */ h("div", {
238
+ }), /* @__PURE__ */ _("div", {
239
239
  className: "flex items-center gap-2 mt-1",
240
- children: [/* @__PURE__ */ h("span", {
240
+ children: [/* @__PURE__ */ _("span", {
241
241
  className: "text-sm text-text-muted capitalize",
242
242
  children: ["Type: ", e.limitType]
243
- }), e.quotaType && /* @__PURE__ */ m("span", {
243
+ }), e.quotaType && /* @__PURE__ */ g("span", {
244
244
  className: "px-2 py-0.5 text-xs font-medium bg-bg-sunken text-text-muted rounded",
245
245
  children: e.quotaType
246
246
  })]
@@ -250,40 +250,40 @@ var b = () => {
250
250
  })
251
251
  })]
252
252
  })]
253
- }), /* @__PURE__ */ h("div", {
253
+ }), /* @__PURE__ */ _("div", {
254
254
  className: "space-y-6",
255
- children: [/* @__PURE__ */ h("div", {
255
+ children: [/* @__PURE__ */ _("div", {
256
256
  className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)]",
257
- children: [/* @__PURE__ */ m("div", {
257
+ children: [/* @__PURE__ */ g("div", {
258
258
  className: "p-6 border-b border-border-subtle bg-bg-sunken/30",
259
- children: /* @__PURE__ */ m("h2", {
259
+ children: /* @__PURE__ */ g("h2", {
260
260
  className: "text-lg font-semibold text-text-primary",
261
261
  children: l("billing.plans.planDetails", "Plan Details")
262
262
  })
263
- }), /* @__PURE__ */ h("div", {
263
+ }), /* @__PURE__ */ _("div", {
264
264
  className: "p-6 space-y-4",
265
265
  children: [
266
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
266
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
267
267
  className: "text-sm text-text-muted",
268
268
  children: l("billing.plans.planName", "Plan Name")
269
- }), /* @__PURE__ */ m("p", {
269
+ }), /* @__PURE__ */ g("p", {
270
270
  className: "text-sm font-medium text-text-primary mt-0.5",
271
271
  children: S.name
272
272
  })] }),
273
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
273
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
274
274
  className: "text-sm text-text-muted",
275
275
  children: l("billing.plans.status", "Status")
276
- }), /* @__PURE__ */ m("p", {
276
+ }), /* @__PURE__ */ g("p", {
277
277
  className: "text-sm text-text-primary mt-0.5",
278
- children: /* @__PURE__ */ m("span", {
278
+ children: /* @__PURE__ */ g("span", {
279
279
  className: `inline-flex items-center px-2 py-0.5 text-xs font-medium rounded ${S.isActive ? "bg-status-success-bg-subtle text-status-success-text" : "bg-bg-sunken text-text-muted"}`,
280
280
  children: S.isActive ? "Active" : "Inactive"
281
281
  })
282
282
  })] }),
283
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
283
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
284
284
  className: "text-sm text-text-muted",
285
285
  children: l("billing.plans.price", "Price")
286
- }), /* @__PURE__ */ h("p", {
286
+ }), /* @__PURE__ */ _("p", {
287
287
  className: "text-sm font-medium text-text-primary mt-0.5",
288
288
  children: [
289
289
  n(S.price, S.currency),
@@ -291,38 +291,38 @@ var b = () => {
291
291
  r(S.duration)
292
292
  ]
293
293
  })] }),
294
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
294
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
295
295
  className: "text-sm text-text-muted",
296
296
  children: l("billing.plans.currency", "Currency")
297
- }), /* @__PURE__ */ m("p", {
297
+ }), /* @__PURE__ */ g("p", {
298
298
  className: "text-sm text-text-primary mt-0.5",
299
299
  children: S.currency
300
300
  })] }),
301
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
301
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
302
302
  className: "text-sm text-text-muted",
303
303
  children: l("billing.plans.billingPeriod", "Billing Period")
304
- }), /* @__PURE__ */ m("p", {
304
+ }), /* @__PURE__ */ g("p", {
305
305
  className: "text-sm text-text-primary mt-0.5",
306
306
  children: i(S.duration)
307
307
  })] })
308
308
  ]
309
309
  })]
310
- }), /* @__PURE__ */ h("div", {
310
+ }), /* @__PURE__ */ _("div", {
311
311
  className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)]",
312
- children: [/* @__PURE__ */ m("div", {
312
+ children: [/* @__PURE__ */ g("div", {
313
313
  className: "p-6 border-b border-border-subtle bg-bg-sunken/30",
314
- children: /* @__PURE__ */ m("h2", {
314
+ children: /* @__PURE__ */ g("h2", {
315
315
  className: "text-lg font-semibold text-text-primary",
316
316
  children: l("billing.plans.statistics", "Statistics")
317
317
  })
318
- }), /* @__PURE__ */ m("div", {
318
+ }), /* @__PURE__ */ g("div", {
319
319
  className: "p-6 space-y-4",
320
- children: /* @__PURE__ */ h("div", {
320
+ children: /* @__PURE__ */ _("div", {
321
321
  className: "flex items-center justify-between",
322
- children: [/* @__PURE__ */ m("p", {
322
+ children: [/* @__PURE__ */ g("p", {
323
323
  className: "text-sm text-text-muted",
324
324
  children: l("billing.plans.uniqueQuotas", "Unique Quotas")
325
- }), /* @__PURE__ */ m("p", {
325
+ }), /* @__PURE__ */ g("p", {
326
326
  className: "font-semibold text-text-primary",
327
327
  children: O.length
328
328
  })]
@@ -331,19 +331,19 @@ var b = () => {
331
331
  })]
332
332
  })]
333
333
  })]
334
- }) : /* @__PURE__ */ m("div", {
334
+ }) : /* @__PURE__ */ g("div", {
335
335
  className: "flex items-center justify-center h-full min-h-[400px]",
336
- children: /* @__PURE__ */ h("div", {
336
+ children: /* @__PURE__ */ _("div", {
337
337
  className: "text-center space-y-2",
338
338
  children: [
339
- /* @__PURE__ */ m("div", {
339
+ /* @__PURE__ */ g("div", {
340
340
  className: "size-12 mx-auto rounded-full bg-bg-sunken flex items-center justify-center",
341
- children: /* @__PURE__ */ m("svg", {
341
+ children: /* @__PURE__ */ g("svg", {
342
342
  className: "size-6 text-text-muted",
343
343
  fill: "none",
344
344
  viewBox: "0 0 24 24",
345
345
  stroke: "currentColor",
346
- children: /* @__PURE__ */ m("path", {
346
+ children: /* @__PURE__ */ g("path", {
347
347
  strokeLinecap: "round",
348
348
  strokeLinejoin: "round",
349
349
  strokeWidth: 2,
@@ -351,11 +351,11 @@ var b = () => {
351
351
  })
352
352
  })
353
353
  }),
354
- /* @__PURE__ */ m("h2", {
354
+ /* @__PURE__ */ g("h2", {
355
355
  className: "text-lg font-semibold text-text-primary",
356
356
  children: l("billing.accessDenied.title", "Access Denied")
357
357
  }),
358
- /* @__PURE__ */ m("p", {
358
+ /* @__PURE__ */ g("p", {
359
359
  className: "text-sm text-text-muted max-w-sm",
360
360
  children: l("billing.plans.noViewPlanPermission", "You don't have permission to view this plan.")
361
361
  })
@@ -6,27 +6,27 @@ import { useBillingNavigate as ee } from "../../../hooks/useBillingNavigate.js";
6
6
  import "../hooks/index.js";
7
7
  import { isServerError as i } from "../../../shared/utils/error.js";
8
8
  import { getPlanFeatureQuantity as a } from "../../../shared/utils/planFeatureQuantity.js";
9
- import { useBillingPermissions as o } from "../../../hooks/useBillingPermissions.js";
9
+ import { useBillingPermissions as te } from "../../../hooks/useBillingPermissions.js";
10
10
  import "../../../shared/components/index.js";
11
11
  import "../../../shared/utils/index.js";
12
- import { usePlan as s, usePlanMutations as c } from "../hooks/usePlans.js";
13
- import { useQuotas as l } from "../hooks/useQuotas.js";
14
- import { PlanDuration as u } from "../../../shared/types/graphql.js";
15
- import { getChangedCurrencyPriceOverrides as d } from "../utils/currencyPriceOverrides.js";
16
- import { useEffect as f, useState as p } from "react";
12
+ import { usePlan as o, usePlanMutations as s } from "../hooks/usePlans.js";
13
+ import { useQuotas as c } from "../hooks/useQuotas.js";
14
+ import { PlanDuration as l } from "../../../shared/types/graphql.js";
15
+ import { getChangedCurrencyPriceOverrides as u } from "../utils/currencyPriceOverrides.js";
16
+ import { useEffect as d, useState as f } from "react";
17
+ import { PagePurpose as p } from "@burdenoff/fe-libs/ui";
17
18
  import { useParams as m } from "react-router";
18
19
  import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
19
- import { useI18n as te } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
20
- import { PagePurpose as v } from "@burdenoff/fe-libs/ui";
20
+ import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
21
21
  // src/billing/modules/plans/pages/PlanEditPage.tsx
22
22
  var y = () => {
23
- let { t: y } = te(), b = (e, t) => {
23
+ let { t: y } = v(), b = (e, t) => {
24
24
  let n = y(e);
25
25
  return n === e ? t : n;
26
- }, { planId: x } = m(), S = ee(), C = o(), { plan: w, isLoading: T, error: E, refetch: D } = s(x), { quotas: O, isLoading: k } = l({ onlyActive: !0 }), { updatePlan: A, isUpdating: j } = c(), [M, N] = p(""), [ne, P] = p(""), [F, I] = p("USD"), [L, R] = p(u.MONTHLY), [z, B] = p(!0), [V, H] = p(!0), [U, W] = p([]), [G, K] = p([]), [q, J] = p([]), [Y, X] = p(null), [Z, Q] = p(!1);
27
- if (f(() => {
26
+ }, { planId: x } = m(), S = ee(), C = te(), { plan: w, isLoading: T, error: E, refetch: D } = o(x), { quotas: O, isLoading: k } = c({ onlyActive: !0 }), { updatePlan: A, isUpdating: j } = s(), [M, N] = f(""), [ne, P] = f(""), [F, I] = f("USD"), [L, R] = f(l.MONTHLY), [z, B] = f(!0), [V, H] = f(!0), [U, W] = f([]), [G, K] = f([]), [q, J] = f([]), [Y, X] = f(null), [Z, Q] = f(!1);
27
+ if (d(() => {
28
28
  if (w) {
29
- if (N(w.name ?? ""), P(String(w.price ?? "")), I(w.currency ?? "USD"), R(w.duration ?? u.MONTHLY), B(w.isActive ?? !0), H(w.isPurchasable ?? !0), w.currencyPrices && typeof w.currencyPrices == "object") {
29
+ if (N(w.name ?? ""), P(String(w.price ?? "")), I(w.currency ?? "USD"), R(w.duration ?? l.MONTHLY), B(w.isActive ?? !0), H(w.isPurchasable ?? !0), w.currencyPrices && typeof w.currencyPrices == "object") {
30
30
  let e = w.currencyPrices, t = Object.entries(e).filter(([, e]) => typeof e == "number").map(([e, t]) => ({
31
31
  currency: e,
32
32
  amount: t
@@ -102,7 +102,7 @@ var y = () => {
102
102
  title: `Edit Plan: ${w.name}`,
103
103
  description: b("billing.plans.editPlanDesc", "Update the plan details and quota allocations")
104
104
  }),
105
- /* @__PURE__ */ g(v, { children: b("billing.plans.editPurpose", "Update this plan's price, currency/seat pricing and the quotas it grants. Changes apply to new subscriptions; existing subscribers keep the terms they signed up with until they renew or change plans.") }),
105
+ /* @__PURE__ */ g(p, { children: b("billing.plans.editPurpose", "Update this plan's price, currency/seat pricing and the quotas it grants. Changes apply to new subscriptions; existing subscribers keep the terms they signed up with until they renew or change plans.") }),
106
106
  /* @__PURE__ */ _("form", {
107
107
  onSubmit: async (e) => {
108
108
  if (e.preventDefault(), X(null), Q(!1), !M.trim()) {
@@ -126,7 +126,7 @@ var y = () => {
126
126
  quotaId: e.quotaId,
127
127
  quantity: e.quantity
128
128
  })),
129
- ...d(q, G).length > 0 ? { currencyPriceOverrides: d(q, G) } : {}
129
+ ...u(q, G).length > 0 ? { currencyPriceOverrides: u(q, G) } : {}
130
130
  };
131
131
  try {
132
132
  await A(t), Q(!0), setTimeout(() => S(`/plans/${x}`), 1500);
@@ -252,10 +252,10 @@ var y = () => {
252
252
  title: "Billing period cannot be changed on an existing plan. Create a new plan instead.",
253
253
  className: "w-full disabled:opacity-60 disabled:cursor-not-allowed px-3 py-2 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
254
254
  children: [/* @__PURE__ */ g("option", {
255
- value: u.MONTHLY,
255
+ value: l.MONTHLY,
256
256
  children: "Monthly"
257
257
  }), /* @__PURE__ */ g("option", {
258
- value: u.YEARLY,
258
+ value: l.YEARLY,
259
259
  children: "Yearly"
260
260
  })]
261
261
  })] }),