@burdenoff/microfe-billing 2026.1116.1 → 2026.1119.2

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 (62) hide show
  1. package/dist/billing/modules/addons/pages/AddonCreatePage.js +143 -143
  2. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonEditPage.js +170 -170
  4. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
  5. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +148 -148
  6. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
  7. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +115 -115
  8. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js.map +1 -1
  9. package/dist/billing/modules/billing/pages/InvoicesListPage.js +136 -136
  10. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  11. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +129 -129
  12. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js.map +1 -1
  13. package/dist/billing/modules/billing/pages/RefundsPage.js +325 -325
  14. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  15. package/dist/billing/modules/billing/pages/UserRefundsPage.js +149 -149
  16. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  17. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js +99 -98
  18. package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js.map +1 -1
  19. package/dist/billing/modules/checkout/components/StoreShippingSection.js +125 -124
  20. package/dist/billing/modules/checkout/components/StoreShippingSection.js.map +1 -1
  21. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js +61 -60
  22. package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js.map +1 -1
  23. package/dist/billing/modules/coupons/pages/CouponsListPage.js +177 -177
  24. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  25. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +231 -231
  26. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
  27. package/dist/billing/modules/coupons/pages/EditCouponPage.js +139 -139
  28. package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
  29. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +54 -54
  30. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
  31. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +65 -65
  32. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  33. package/dist/billing/modules/credits/pages/CreditsPage.js +95 -95
  34. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
  35. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +232 -231
  36. package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -1
  37. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +328 -328
  38. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  39. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +57 -57
  40. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
  41. package/dist/billing/modules/earnings/pages/EarningsPage.js +53 -53
  42. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  43. package/dist/billing/modules/earnings/pages/PayoutsPage.js +100 -100
  44. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  45. package/dist/billing/modules/plans/pages/PlanCreatePage.js +150 -150
  46. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
  47. package/dist/billing/modules/plans/pages/PlanEditPage.js +125 -125
  48. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  49. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +113 -113
  50. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
  51. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +132 -132
  52. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
  53. package/dist/billing/modules/settings/pages/SettingsPage.js +101 -101
  54. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  55. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +125 -125
  56. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  57. package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js +51 -50
  58. package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js.map +1 -1
  59. package/dist/billing/modules/usage/pages/UsagePage.js +107 -107
  60. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  61. package/dist/billing/shared/components/GeoPricingOverridesEditor.js +1 -0
  62. package/package.json +2 -2
@@ -2,31 +2,31 @@ import { AccessDenied as e } from "../../../shared/components/AccessDenied.js";
2
2
  import { PageHeader as t } from "../../../shared/components/PageHeader.js";
3
3
  import { ServerError as n } from "../../../shared/components/ServerError.js";
4
4
  import { CurrencyPriceOverridesEditor as r } from "../../../shared/components/CurrencyPriceOverridesEditor.js";
5
- import { useBillingNavigate as ee } from "../../../hooks/useBillingNavigate.js";
5
+ import { useBillingNavigate as i } from "../../../hooks/useBillingNavigate.js";
6
6
  import "../hooks/index.js";
7
- import { useBillingPermissions as i } from "../../../hooks/useBillingPermissions.js";
8
- import { isServerError as a } from "../../../shared/utils/error.js";
9
- import { getPlanFeatureQuantity as te } from "../../../shared/utils/planFeatureQuantity.js";
7
+ import { useBillingPermissions as a } from "../../../hooks/useBillingPermissions.js";
8
+ import { isServerError as o } from "../../../shared/utils/error.js";
9
+ import { getPlanFeatureQuantity as s } from "../../../shared/utils/planFeatureQuantity.js";
10
10
  import "../../../shared/components/index.js";
11
11
  import "../../../shared/utils/index.js";
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";
18
- import { useParams as m } from "react-router";
19
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
20
- import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
+ import { usePlan as c, usePlanMutations as l } from "../hooks/usePlans.js";
13
+ import { useQuotas as u } from "../hooks/useQuotas.js";
14
+ import { PlanDuration as d } from "../../../shared/types/graphql.js";
15
+ import { getChangedCurrencyPriceOverrides as f } from "../utils/currencyPriceOverrides.js";
16
+ import { useEffect as p, useState as m } from "react";
17
+ import { PagePurpose as ee, ThemedSelect as h } from "@burdenoff/fe-libs/ui";
18
+ import { useParams as te } from "react-router";
19
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
20
+ import { useI18n as y } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
21
21
  // src/billing/modules/plans/pages/PlanEditPage.tsx
22
- var y = () => {
23
- let { t: y } = v(), b = (e, t) => {
24
- let n = y(e);
22
+ var b = () => {
23
+ let { t: b } = y(), x = (e, t) => {
24
+ let n = b(e);
25
25
  return n === e ? t : n;
26
- }, { planId: x } = m(), S = ee(), C = i(), { 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(() => {
26
+ }, { planId: S } = te(), C = i(), ne = a(), { plan: w, isLoading: T, error: E, refetch: D } = c(S), { quotas: O, isLoading: k } = u({ onlyActive: !0 }), { updatePlan: A, isUpdating: j } = l(), [M, N] = m(""), [re, P] = m(""), [F, I] = m("USD"), [L, R] = m(d.MONTHLY), [z, B] = m(!0), [V, H] = m(!0), [U, W] = m([]), [G, K] = m([]), [q, J] = m([]), [Y, X] = m(null), [Z, Q] = m(!1);
27
+ if (p(() => {
28
28
  if (w) {
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") {
29
+ if (N(w.name ?? ""), P(String(w.price ?? "")), I(w.currency ?? "USD"), R(w.duration ?? d.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
@@ -36,7 +36,7 @@ var y = () => {
36
36
  if (w.features && w.features.length > 0) {
37
37
  let e = [], t = /* @__PURE__ */ new Map();
38
38
  for (let e of w.features) if (e.quota?.id) {
39
- let n = e.quota.id, r = te(e) || 1;
39
+ let n = e.quota.id, r = s(e) || 1;
40
40
  t.set(n, r);
41
41
  }
42
42
  for (let [n, r] of t) e.push({
@@ -46,10 +46,10 @@ var y = () => {
46
46
  W(e);
47
47
  }
48
48
  }
49
- }, [w]), !C.canManagePlans) return /* @__PURE__ */ g(e, { message: b("billing.plans.noEditPermission", "You don't have permission to edit plans.") });
50
- if (T || k) return /* @__PURE__ */ _("div", {
49
+ }, [w]), !ne.canManagePlans) return /* @__PURE__ */ _(e, { message: x("billing.plans.noEditPermission", "You don't have permission to edit plans.") });
50
+ if (T || k) return /* @__PURE__ */ v("div", {
51
51
  className: "space-y-6 p-6",
52
- children: [/* @__PURE__ */ g("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ g("div", {
52
+ children: [/* @__PURE__ */ _("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ _("div", {
53
53
  className: "max-w-2xl space-y-4",
54
54
  children: [
55
55
  1,
@@ -57,53 +57,53 @@ var y = () => {
57
57
  3,
58
58
  4,
59
59
  5
60
- ].map((e) => /* @__PURE__ */ g("div", { className: "h-16 bg-bg-sunken animate-pulse rounded" }, e))
60
+ ].map((e) => /* @__PURE__ */ _("div", { className: "h-16 bg-bg-sunken animate-pulse rounded" }, e))
61
61
  })]
62
62
  });
63
- if (E && a(E)) return /* @__PURE__ */ g("div", {
63
+ if (E && o(E)) return /* @__PURE__ */ _("div", {
64
64
  className: "p-6",
65
- children: /* @__PURE__ */ g(n, {
66
- title: b("billing.plans.serverUnavailable", "Server Unavailable"),
67
- message: b("billing.plans.serverUnavailableLoadPlan", "Unable to load plan. The server might be down or experiencing issues."),
65
+ children: /* @__PURE__ */ _(n, {
66
+ title: x("billing.plans.serverUnavailable", "Server Unavailable"),
67
+ message: x("billing.plans.serverUnavailableLoadPlan", "Unable to load plan. The server might be down or experiencing issues."),
68
68
  onRetry: () => D(),
69
69
  showRetry: !0
70
70
  })
71
71
  });
72
- if (!w) return /* @__PURE__ */ g("div", {
72
+ if (!w) return /* @__PURE__ */ _("div", {
73
73
  className: "flex items-center justify-center h-full min-h-[400px]",
74
- children: /* @__PURE__ */ _("div", {
74
+ children: /* @__PURE__ */ v("div", {
75
75
  className: "text-center space-y-4",
76
- children: [/* @__PURE__ */ g("h2", {
76
+ children: [/* @__PURE__ */ _("h2", {
77
77
  className: "text-lg font-semibold text-text-primary",
78
- children: b("billing.plans.planNotFound", "Plan not found")
79
- }), /* @__PURE__ */ g("button", {
78
+ children: x("billing.plans.planNotFound", "Plan not found")
79
+ }), /* @__PURE__ */ _("button", {
80
80
  type: "button",
81
- onClick: () => S("/plans"),
81
+ onClick: () => C("/plans"),
82
82
  className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover",
83
83
  children: "Back to Plans"
84
84
  })]
85
85
  })
86
86
  });
87
- let re = () => {
87
+ let ie = () => {
88
88
  W([{
89
89
  quotaId: "",
90
90
  quantity: 1
91
91
  }, ...U]);
92
- }, ie = (e) => {
92
+ }, ae = (e) => {
93
93
  W(U.filter((t, n) => n !== e));
94
94
  }, $ = (e, t, n) => {
95
95
  let r = [...U];
96
96
  t === "quotaId" ? r[e].quotaId = n : r[e].quantity = Number(n), W(r);
97
97
  };
98
- return /* @__PURE__ */ _("div", {
98
+ return /* @__PURE__ */ v("div", {
99
99
  className: "space-y-6 p-6",
100
100
  children: [
101
- /* @__PURE__ */ g(t, {
101
+ /* @__PURE__ */ _(t, {
102
102
  title: `Edit Plan: ${w.name}`,
103
- description: b("billing.plans.editPlanDesc", "Update the plan details and quota allocations")
103
+ description: x("billing.plans.editPlanDesc", "Update the plan details and quota allocations")
104
104
  }),
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
- /* @__PURE__ */ _("form", {
105
+ /* @__PURE__ */ _(ee, { children: x("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
+ /* @__PURE__ */ v("form", {
107
107
  onSubmit: async (e) => {
108
108
  if (e.preventDefault(), X(null), Q(!1), !M.trim()) {
109
109
  X("Plan name is required");
@@ -118,7 +118,7 @@ var y = () => {
118
118
  return;
119
119
  }
120
120
  let t = {
121
- id: x,
121
+ id: S,
122
122
  name: M.trim(),
123
123
  isActive: z,
124
124
  isPurchasable: V,
@@ -126,78 +126,78 @@ var y = () => {
126
126
  quotaId: e.quotaId,
127
127
  quantity: e.quantity
128
128
  })),
129
- ...u(q, G).length > 0 ? { currencyPriceOverrides: u(q, G) } : {}
129
+ ...f(q, G).length > 0 ? { currencyPriceOverrides: f(q, G) } : {}
130
130
  };
131
131
  try {
132
- await A(t), Q(!0), setTimeout(() => S(`/plans/${x}`), 1500);
132
+ await A(t), Q(!0), setTimeout(() => C(`/plans/${S}`), 1500);
133
133
  } catch (e) {
134
134
  X(e instanceof Error ? e.message : "Failed to update plan");
135
135
  }
136
136
  },
137
137
  className: "space-y-6",
138
138
  children: [
139
- Y && /* @__PURE__ */ g("div", {
139
+ Y && /* @__PURE__ */ _("div", {
140
140
  className: "p-4 bg-status-error-bg-subtle border border-border-subtle rounded-lg",
141
- children: /* @__PURE__ */ g("p", {
141
+ children: /* @__PURE__ */ _("p", {
142
142
  className: "text-sm text-status-error-text",
143
143
  children: Y
144
144
  })
145
145
  }),
146
- Z && /* @__PURE__ */ g("div", {
146
+ Z && /* @__PURE__ */ _("div", {
147
147
  className: "p-4 bg-status-success-bg-subtle border border-border-subtle rounded-lg",
148
- children: /* @__PURE__ */ g("p", {
148
+ children: /* @__PURE__ */ _("p", {
149
149
  className: "text-sm text-status-success-text",
150
- children: b("billing.plans.updateSuccess", "Plan updated successfully! Redirecting...")
150
+ children: x("billing.plans.updateSuccess", "Plan updated successfully! Redirecting...")
151
151
  })
152
152
  }),
153
- /* @__PURE__ */ _("div", {
153
+ /* @__PURE__ */ v("div", {
154
154
  className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
155
- children: [/* @__PURE__ */ _("div", {
155
+ children: [/* @__PURE__ */ v("div", {
156
156
  className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
157
- children: [/* @__PURE__ */ g("div", {
157
+ children: [/* @__PURE__ */ _("div", {
158
158
  className: "p-4 border-b border-border-subtle bg-bg-sunken/30",
159
- children: /* @__PURE__ */ g("h2", {
159
+ children: /* @__PURE__ */ _("h2", {
160
160
  className: "font-semibold text-text-primary",
161
- children: b("billing.plans.basicInfo", "Basic Information")
161
+ children: x("billing.plans.basicInfo", "Basic Information")
162
162
  })
163
- }), /* @__PURE__ */ _("div", {
163
+ }), /* @__PURE__ */ v("div", {
164
164
  className: "p-4 space-y-4",
165
165
  children: [
166
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
166
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
167
167
  htmlFor: "name",
168
168
  className: "block text-sm font-medium text-text-primary mb-1",
169
- children: [b("billing.plans.planNameLabel", "Plan Name"), " *"]
170
- }), /* @__PURE__ */ g("input", {
169
+ children: [x("billing.plans.planNameLabel", "Plan Name"), " *"]
170
+ }), /* @__PURE__ */ _("input", {
171
171
  id: "name",
172
172
  type: "text",
173
173
  value: M,
174
174
  onChange: (e) => N(e.target.value),
175
175
  className: "w-full 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)]",
176
- placeholder: b("billing.plans.planNamePlaceholder", "e.g., Pro Plan"),
176
+ placeholder: x("billing.plans.planNamePlaceholder", "e.g., Pro Plan"),
177
177
  required: !0
178
178
  })] }),
179
- /* @__PURE__ */ _("div", {
179
+ /* @__PURE__ */ v("div", {
180
180
  className: "grid grid-cols-2 gap-4",
181
- children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
181
+ children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
182
182
  htmlFor: "price",
183
183
  className: "block text-sm font-medium text-text-primary mb-1",
184
- children: [b("billing.plans.priceLabel", "Price"), " *"]
185
- }), /* @__PURE__ */ g("input", {
184
+ children: [x("billing.plans.priceLabel", "Price"), " *"]
185
+ }), /* @__PURE__ */ _("input", {
186
186
  id: "price",
187
187
  type: "number",
188
188
  step: "0.01",
189
189
  min: "0",
190
- value: ne,
190
+ value: re,
191
191
  onChange: (e) => P(e.target.value),
192
192
  disabled: !0,
193
193
  title: "Price cannot be changed on an existing plan. Create a new plan instead.",
194
194
  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)]",
195
195
  placeholder: "49.99"
196
- })] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
196
+ })] }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
197
197
  htmlFor: "currency",
198
198
  className: "block text-sm font-medium text-text-primary mb-1",
199
- children: [b("billing.plans.currencyLabel", "Currency"), " *"]
200
- }), /* @__PURE__ */ _("select", {
199
+ children: [x("billing.plans.currencyLabel", "Currency"), " *"]
200
+ }), /* @__PURE__ */ v(h, {
201
201
  id: "currency",
202
202
  value: F,
203
203
  onChange: (e) => I(e.target.value),
@@ -205,140 +205,140 @@ var y = () => {
205
205
  title: "Currency cannot be changed on an existing plan. Create a new plan instead.",
206
206
  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",
207
207
  children: [
208
- /* @__PURE__ */ g("option", {
208
+ /* @__PURE__ */ _("option", {
209
209
  value: "USD",
210
210
  children: "USD ($)"
211
211
  }),
212
- /* @__PURE__ */ g("option", {
212
+ /* @__PURE__ */ _("option", {
213
213
  value: "EUR",
214
214
  children: "EUR"
215
215
  }),
216
- /* @__PURE__ */ g("option", {
216
+ /* @__PURE__ */ _("option", {
217
217
  value: "GBP",
218
218
  children: "GBP"
219
219
  }),
220
- /* @__PURE__ */ g("option", {
220
+ /* @__PURE__ */ _("option", {
221
221
  value: "INR",
222
222
  children: "INR"
223
223
  }),
224
- /* @__PURE__ */ g("option", {
224
+ /* @__PURE__ */ _("option", {
225
225
  value: "AUD",
226
226
  children: "AUD"
227
227
  }),
228
- /* @__PURE__ */ g("option", {
228
+ /* @__PURE__ */ _("option", {
229
229
  value: "CAD",
230
230
  children: "CAD"
231
231
  }),
232
- /* @__PURE__ */ g("option", {
232
+ /* @__PURE__ */ _("option", {
233
233
  value: "JPY",
234
234
  children: "JPY"
235
235
  }),
236
- /* @__PURE__ */ g("option", {
236
+ /* @__PURE__ */ _("option", {
237
237
  value: "SGD",
238
238
  children: "SGD"
239
239
  })
240
240
  ]
241
241
  })] })]
242
242
  }),
243
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
243
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
244
244
  htmlFor: "duration",
245
245
  className: "block text-sm font-medium text-text-primary mb-1",
246
- children: [b("billing.plans.billingPeriodLabel", "Billing Period"), " *"]
247
- }), /* @__PURE__ */ _("select", {
246
+ children: [x("billing.plans.billingPeriodLabel", "Billing Period"), " *"]
247
+ }), /* @__PURE__ */ v(h, {
248
248
  id: "duration",
249
249
  value: L,
250
250
  onChange: (e) => R(e.target.value),
251
251
  disabled: !0,
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
- children: [/* @__PURE__ */ g("option", {
255
- value: l.MONTHLY,
254
+ children: [/* @__PURE__ */ _("option", {
255
+ value: d.MONTHLY,
256
256
  children: "Monthly"
257
- }), /* @__PURE__ */ g("option", {
258
- value: l.YEARLY,
257
+ }), /* @__PURE__ */ _("option", {
258
+ value: d.YEARLY,
259
259
  children: "Yearly"
260
260
  })]
261
261
  })] }),
262
- /* @__PURE__ */ _("div", {
262
+ /* @__PURE__ */ v("div", {
263
263
  className: "flex items-center gap-3",
264
- children: [/* @__PURE__ */ g("input", {
264
+ children: [/* @__PURE__ */ _("input", {
265
265
  id: "isActive",
266
266
  type: "checkbox",
267
267
  checked: z,
268
268
  onChange: (e) => B(e.target.checked),
269
269
  className: "size-4 rounded border-border-subtle text-text-link focus:ring-[var(--color-focus-ring)]"
270
- }), /* @__PURE__ */ g("label", {
270
+ }), /* @__PURE__ */ _("label", {
271
271
  htmlFor: "isActive",
272
272
  className: "text-sm font-medium text-text-primary",
273
- children: b("billing.plans.planIsActive", "Plan is active")
273
+ children: x("billing.plans.planIsActive", "Plan is active")
274
274
  })]
275
275
  }),
276
- /* @__PURE__ */ _("div", {
276
+ /* @__PURE__ */ v("div", {
277
277
  className: "flex items-start justify-between gap-4 pt-1",
278
- children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
278
+ children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
279
279
  className: "text-sm font-medium text-text-primary",
280
- children: b("billing.plans.isPurchasableLabel", "Publicly purchasable")
281
- }), /* @__PURE__ */ g("p", {
280
+ children: x("billing.plans.isPurchasableLabel", "Publicly purchasable")
281
+ }), /* @__PURE__ */ _("p", {
282
282
  className: "text-xs text-text-muted mt-0.5",
283
- children: V ? b("billing.plans.isPurchasableOn", "Visible on pricing page — users can subscribe directly.") : b("billing.plans.isPurchasableOff", "Internal / custom plan — hidden from pricing page, assign via API only.")
284
- })] }), /* @__PURE__ */ g("button", {
283
+ children: V ? x("billing.plans.isPurchasableOn", "Visible on pricing page — users can subscribe directly.") : x("billing.plans.isPurchasableOff", "Internal / custom plan — hidden from pricing page, assign via API only.")
284
+ })] }), /* @__PURE__ */ _("button", {
285
285
  type: "button",
286
286
  role: "switch",
287
287
  "aria-checked": V,
288
288
  onClick: () => H((e) => !e),
289
289
  className: `relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] focus:ring-offset-2 ${V ? "bg-action-primary-bg" : "bg-text-muted/30"}`,
290
- children: /* @__PURE__ */ g("span", { className: `inline-block h-5 w-5 transform rounded-full bg-bg-surface shadow transition-transform ${V ? "translate-x-5" : "translate-x-0"}` })
290
+ children: /* @__PURE__ */ _("span", { className: `inline-block h-5 w-5 transform rounded-full bg-bg-surface shadow transition-transform ${V ? "translate-x-5" : "translate-x-0"}` })
291
291
  })]
292
292
  })
293
293
  ]
294
294
  })]
295
- }), /* @__PURE__ */ _("div", {
295
+ }), /* @__PURE__ */ v("div", {
296
296
  className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
297
- children: [/* @__PURE__ */ _("div", {
297
+ children: [/* @__PURE__ */ v("div", {
298
298
  className: "p-4 border-b border-border-subtle bg-bg-sunken/30 flex items-center justify-between",
299
- children: [/* @__PURE__ */ g("h2", {
299
+ children: [/* @__PURE__ */ _("h2", {
300
300
  className: "font-semibold text-text-primary",
301
- children: b("billing.plans.quotaAllocations", "Quota Allocations")
302
- }), /* @__PURE__ */ g("button", {
301
+ children: x("billing.plans.quotaAllocations", "Quota Allocations")
302
+ }), /* @__PURE__ */ _("button", {
303
303
  type: "button",
304
- onClick: re,
304
+ onClick: ie,
305
305
  className: "px-3 py-1 text-sm font-medium text-text-link hover:bg-[var(--color-accent-soft)] rounded-md transition-colors",
306
306
  children: "+ Add Quota"
307
307
  })]
308
- }), /* @__PURE__ */ g("div", {
308
+ }), /* @__PURE__ */ _("div", {
309
309
  className: "p-4 space-y-3",
310
- children: U.length === 0 ? /* @__PURE__ */ g("p", {
310
+ children: U.length === 0 ? /* @__PURE__ */ _("p", {
311
311
  className: "text-sm text-text-muted",
312
- children: b("billing.plans.noQuotasAllocated", "No quotas allocated. Click \"Add Quota\" to add one.")
312
+ children: x("billing.plans.noQuotasAllocated", "No quotas allocated. Click \"Add Quota\" to add one.")
313
313
  }) : U.map((e, t) => {
314
314
  let n = O.find((t) => t.id === e.quotaId), r = n?.limits?.type ?? "unknown";
315
- return /* @__PURE__ */ _("div", {
315
+ return /* @__PURE__ */ v("div", {
316
316
  className: "p-3 border border-border-subtle rounded-lg bg-bg-sunken/20 space-y-3",
317
- children: [/* @__PURE__ */ _("div", {
317
+ children: [/* @__PURE__ */ v("div", {
318
318
  className: "flex items-center gap-3",
319
- children: [/* @__PURE__ */ _("select", {
319
+ children: [/* @__PURE__ */ v(h, {
320
320
  value: e.quotaId,
321
321
  onChange: (e) => $(t, "quotaId", e.target.value),
322
322
  className: `flex-1 px-3 py-2 border border-border-subtle rounded-input bg-bg-surface scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] ${e.quotaId === "" ? "text-text-muted" : "text-text-primary"}`,
323
- children: [/* @__PURE__ */ g("option", {
323
+ children: [/* @__PURE__ */ _("option", {
324
324
  value: "",
325
325
  disabled: !0,
326
- children: b("billing.plans.selectQuota", "Select a quota...")
327
- }), O.map((e) => /* @__PURE__ */ g("option", {
326
+ children: x("billing.plans.selectQuota", "Select a quota...")
327
+ }), O.map((e) => /* @__PURE__ */ _("option", {
328
328
  value: e.id,
329
329
  children: e.name
330
330
  }, e.id))]
331
- }), /* @__PURE__ */ g("button", {
331
+ }), /* @__PURE__ */ _("button", {
332
332
  type: "button",
333
- onClick: () => ie(t),
333
+ onClick: () => ae(t),
334
334
  className: "p-2 text-status-error-text hover:bg-status-error-bg-subtle rounded-md transition-colors",
335
335
  title: "Remove quota",
336
- children: /* @__PURE__ */ g("svg", {
336
+ children: /* @__PURE__ */ _("svg", {
337
337
  className: "size-5",
338
338
  fill: "none",
339
339
  viewBox: "0 0 24 24",
340
340
  stroke: "currentColor",
341
- children: /* @__PURE__ */ g("path", {
341
+ children: /* @__PURE__ */ _("path", {
342
342
  strokeLinecap: "round",
343
343
  strokeLinejoin: "round",
344
344
  strokeWidth: 2,
@@ -346,18 +346,18 @@ var y = () => {
346
346
  })
347
347
  })
348
348
  })]
349
- }), n && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
349
+ }), n && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", {
350
350
  className: "flex items-center justify-between text-sm",
351
- children: /* @__PURE__ */ _("span", {
351
+ children: /* @__PURE__ */ v("span", {
352
352
  className: "capitalize text-text-muted",
353
353
  children: ["Type: ", r]
354
354
  })
355
- }), /* @__PURE__ */ _("div", {
355
+ }), /* @__PURE__ */ v("div", {
356
356
  className: "flex items-center gap-2",
357
- children: [/* @__PURE__ */ _("label", {
357
+ children: [/* @__PURE__ */ v("label", {
358
358
  className: "text-sm text-text-muted",
359
- children: [b("billing.plans.limit", "Limit"), ":"]
360
- }), /* @__PURE__ */ g("input", {
359
+ children: [x("billing.plans.limit", "Limit"), ":"]
360
+ }), /* @__PURE__ */ _("input", {
361
361
  type: "number",
362
362
  min: "1",
363
363
  value: e.quantity,
@@ -370,20 +370,20 @@ var y = () => {
370
370
  })]
371
371
  })]
372
372
  }),
373
- /* @__PURE__ */ g(r, {
373
+ /* @__PURE__ */ _(r, {
374
374
  overrides: G,
375
375
  onChange: K
376
376
  }),
377
- /* @__PURE__ */ _("div", {
377
+ /* @__PURE__ */ v("div", {
378
378
  className: "flex items-center gap-3 pt-4",
379
- children: [/* @__PURE__ */ g("button", {
379
+ children: [/* @__PURE__ */ _("button", {
380
380
  type: "submit",
381
381
  disabled: j,
382
382
  className: "px-6 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover transition-colors disabled:opacity-50",
383
- children: j ? b("billing.plans.saving", "Saving...") : b("billing.plans.saveChanges", "Save Changes")
384
- }), /* @__PURE__ */ g("button", {
383
+ children: j ? x("billing.plans.saving", "Saving...") : x("billing.plans.saveChanges", "Save Changes")
384
+ }), /* @__PURE__ */ _("button", {
385
385
  type: "button",
386
- onClick: () => S(`/plans/${x}`),
386
+ onClick: () => C(`/plans/${S}`),
387
387
  className: "px-6 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
388
388
  children: "Cancel"
389
389
  })]
@@ -393,6 +393,6 @@ var y = () => {
393
393
  ]
394
394
  });
395
395
  };
396
- export { y as PlanEditPage };
396
+ export { b as PlanEditPage };
397
397
 
398
398
  //# sourceMappingURL=PlanEditPage.js.map