@burdenoff/microfe-billing 2026.625.4 → 2026.626.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +192 -187
  2. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonCreatePage.js +322 -317
  4. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
  5. package/dist/billing/modules/addons/pages/AddonDetailPage.js +190 -185
  6. package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
  7. package/dist/billing/modules/addons/pages/AddonEditPage.js +297 -292
  8. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
  9. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +60 -75
  10. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
  11. package/dist/billing/modules/addons/pages/AddonsListPage.js +86 -101
  12. package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
  13. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +124 -121
  14. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  15. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +103 -111
  16. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
  17. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +196 -160
  18. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  19. package/dist/billing/modules/billing/pages/InvoicesListPage.js +58 -73
  20. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  21. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +65 -75
  22. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
  23. package/dist/billing/modules/billing/pages/RefundsPage.js +399 -399
  24. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  25. package/dist/billing/modules/billing/pages/TransactionsPage.js +49 -48
  26. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  27. package/dist/billing/modules/billing/pages/UserRefundsPage.js +144 -151
  28. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  29. package/dist/billing/modules/checkout/pages/CheckoutPage.js +430 -425
  30. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  31. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +121 -93
  32. package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
  33. package/dist/billing/modules/coupons/pages/CouponsListPage.js +154 -152
  34. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  35. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +467 -462
  36. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
  37. package/dist/billing/modules/coupons/pages/EditCouponPage.js +294 -286
  38. package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
  39. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +123 -117
  40. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
  41. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +43 -42
  42. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
  43. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +192 -207
  44. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  45. package/dist/billing/modules/credits/pages/CreditsPage.js +40 -56
  46. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
  47. package/dist/billing/modules/dashboard/pages/OverviewPage.js +128 -121
  48. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  49. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +165 -180
  50. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  51. package/dist/billing/modules/earnings/pages/EarningsPage.js +103 -100
  52. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  53. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +175 -175
  54. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  55. package/dist/billing/modules/earnings/pages/PayoutsPage.js +96 -96
  56. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  57. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +42 -40
  58. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
  59. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +45 -38
  60. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
  61. package/dist/billing/modules/plans/pages/PlanCreatePage.js +339 -334
  62. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
  63. package/dist/billing/modules/plans/pages/PlanDetailPage.js +80 -74
  64. package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
  65. package/dist/billing/modules/plans/pages/PlanEditPage.js +342 -337
  66. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  67. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +38 -53
  68. package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
  69. package/dist/billing/modules/plans/pages/PlansListPage.js +60 -75
  70. package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
  71. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +242 -237
  72. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
  73. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +29 -39
  74. package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -1
  75. package/dist/billing/modules/quota/pages/QuotaPage.js +1 -0
  76. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +299 -294
  77. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
  78. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +191 -186
  79. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -1
  80. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +308 -303
  81. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
  82. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +57 -78
  83. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -1
  84. package/dist/billing/modules/settings/pages/SettingsPage.js +79 -78
  85. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  86. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +15 -13
  87. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  88. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +338 -299
  89. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  90. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +82 -103
  91. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
  92. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +59 -54
  93. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  94. package/dist/billing/modules/usage/pages/UsagePage.js +172 -215
  95. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  96. package/package.json +2 -2
@@ -17,24 +17,25 @@ import { useEffect as f, useState as p } from "react";
17
17
  import { useParams as m } from "react-router-dom";
18
18
  import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
19
19
  import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
20
+ import { PagePurpose as y } from "@burdenoff/fe-libs/ui";
20
21
  //#region src/billing/modules/addons/pages/AddonEditPage.tsx
21
- var y = () => {
22
- let { t: y } = v(), b = (e, t) => {
23
- let n = y(e);
22
+ var b = () => {
23
+ let { t: b } = v(), x = (e, t) => {
24
+ let n = b(e);
24
25
  return n === e ? t : n;
25
- }, { addonId: x } = m(), S = c(), C = s(), { addon: w, isLoading: T, error: E, refetch: D } = l(x), { quotas: O, isLoading: k } = d({ onlyActive: !0 }), { updateAddon: A, isUpdating: j } = u(), [M, N] = p(""), [P, F] = p(""), [I, L] = p("USD"), [R, z] = p(i.MONTHLY), [B, V] = p(!0), [H, U] = p([]), [W, G] = p([]), [K, q] = p(null), [J, Y] = p(!1);
26
+ }, { addonId: S } = m(), C = c(), w = s(), { addon: T, isLoading: E, error: D, refetch: O } = l(S), { quotas: k, isLoading: A } = d({ onlyActive: !0 }), { updateAddon: j, isUpdating: M } = u(), [N, P] = p(""), [F, I] = p(""), [L, R] = p("USD"), [z, B] = p(i.MONTHLY), [V, H] = p(!0), [U, W] = p([]), [G, K] = p([]), [q, J] = p(null), [Y, X] = p(!1);
26
27
  if (f(() => {
27
- if (w) {
28
- if (N(w.name ?? ""), F(String(w.price ?? "")), L(w.currency ?? "USD"), z(w.duration ?? i.MONTHLY), V(w.isActive ?? !0), w.currencyPrices && typeof w.currencyPrices == "object") {
29
- let e = w.currencyPrices;
30
- G(Object.entries(e).filter(([, e]) => typeof e == "number").map(([e, t]) => ({
28
+ if (T) {
29
+ if (P(T.name ?? ""), I(String(T.price ?? "")), R(T.currency ?? "USD"), B(T.duration ?? i.MONTHLY), H(T.isActive ?? !0), T.currencyPrices && typeof T.currencyPrices == "object") {
30
+ let e = T.currencyPrices;
31
+ K(Object.entries(e).filter(([, e]) => typeof e == "number").map(([e, t]) => ({
31
32
  currency: e,
32
33
  amount: t
33
34
  })));
34
35
  }
35
- if (w.features && w.features.length > 0) {
36
+ if (T.features && T.features.length > 0) {
36
37
  let e = [], t = /* @__PURE__ */ new Map();
37
- for (let e of w.features) if (e.quota?.id) {
38
+ for (let e of T.features) if (e.quota?.id) {
38
39
  let n = e.quota.id, r = o(e);
39
40
  t.set(n, (t.get(n) ?? 0) + r);
40
41
  }
@@ -42,11 +43,11 @@ var y = () => {
42
43
  quotaId: n,
43
44
  quantity: r
44
45
  });
45
- U(e);
46
+ W(e);
46
47
  }
47
48
  }
48
- }, [w]), !C.canManageAddons) return /* @__PURE__ */ g(e, { message: b("billing.addons.noEditPermission", "You don't have permission to edit addons.") });
49
- if (T || k) return /* @__PURE__ */ _("div", {
49
+ }, [T]), !w.canManageAddons) return /* @__PURE__ */ g(e, { message: x("billing.addons.noEditPermission", "You don't have permission to edit addons.") });
50
+ if (E || A) return /* @__PURE__ */ _("div", {
50
51
  className: "space-y-6 p-6",
51
52
  children: [/* @__PURE__ */ g("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ g("div", {
52
53
  className: "max-w-2xl space-y-4",
@@ -59,320 +60,324 @@ var y = () => {
59
60
  ].map((e) => /* @__PURE__ */ g("div", { className: "h-16 bg-bg-sunken animate-pulse rounded" }, e))
60
61
  })]
61
62
  });
62
- if (E && a(E)) return /* @__PURE__ */ g("div", {
63
+ if (D && a(D)) return /* @__PURE__ */ g("div", {
63
64
  className: "p-6",
64
65
  children: /* @__PURE__ */ g(n, {
65
- title: b("billing.addons.serverUnavailable", "Server Unavailable"),
66
- message: b("billing.addons.serverUnavailableLoadAddon", "Unable to load addon. The server might be down or experiencing issues."),
67
- onRetry: () => D(),
66
+ title: x("billing.addons.serverUnavailable", "Server Unavailable"),
67
+ message: x("billing.addons.serverUnavailableLoadAddon", "Unable to load addon. The server might be down or experiencing issues."),
68
+ onRetry: () => O(),
68
69
  showRetry: !0
69
70
  })
70
71
  });
71
- if (!w) return /* @__PURE__ */ g("div", {
72
+ if (!T) return /* @__PURE__ */ g("div", {
72
73
  className: "flex items-center justify-center h-full min-h-[400px]",
73
74
  children: /* @__PURE__ */ _("div", {
74
75
  className: "text-center space-y-4",
75
76
  children: [/* @__PURE__ */ g("h2", {
76
77
  className: "text-lg font-semibold text-text-primary",
77
- children: b("billing.addons.addonNotFound", "Addon not found")
78
+ children: x("billing.addons.addonNotFound", "Addon not found")
78
79
  }), /* @__PURE__ */ g("button", {
79
80
  type: "button",
80
- onClick: () => S("/addons"),
81
+ onClick: () => C("/addons"),
81
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",
82
83
  children: "Back to Addons"
83
84
  })]
84
85
  })
85
86
  });
86
- let X = () => {
87
- U([{
87
+ let Z = () => {
88
+ W([{
88
89
  quotaId: "",
89
90
  quantity: 1
90
- }, ...H]);
91
- }, Z = (e) => {
92
- U(H.filter((t, n) => n !== e));
93
- }, Q = (e, t, n) => {
94
- let r = [...H];
95
- t === "quotaId" ? r[e].quotaId = n : r[e].quantity = Number(n), U(r);
91
+ }, ...U]);
92
+ }, Q = (e) => {
93
+ W(U.filter((t, n) => n !== e));
94
+ }, $ = (e, t, n) => {
95
+ let r = [...U];
96
+ t === "quotaId" ? r[e].quotaId = n : r[e].quantity = Number(n), W(r);
96
97
  };
97
98
  return /* @__PURE__ */ _("div", {
98
99
  className: "space-y-6 p-6",
99
- children: [/* @__PURE__ */ g(t, {
100
- title: `Edit Addon: ${w.name}`,
101
- description: b("billing.addons.editAddonDesc", "Update the addon details and quota allocations")
102
- }), /* @__PURE__ */ _("form", {
103
- onSubmit: async (e) => {
104
- if (e.preventDefault(), q(null), Y(!1), !M.trim()) {
105
- q("Addon name is required");
106
- return;
107
- }
108
- if (!P || isNaN(Number(P)) || Number(P) < 0) {
109
- q("Valid price is required");
110
- return;
111
- }
112
- if (H.length === 0) {
113
- q("At least one quota is required");
114
- return;
115
- }
116
- if (H.filter((e) => e.quotaId === "").length > 0) {
117
- q("Please select a quota for all allocations");
118
- return;
119
- }
120
- let t = {
121
- id: x,
122
- name: M.trim(),
123
- price: Number(P),
124
- currency: I,
125
- duration: R,
126
- isActive: B,
127
- quotas: H.map((e) => ({
128
- quotaId: e.quotaId,
129
- quantity: e.quantity
130
- })),
131
- ...W.length > 0 ? { currencyPriceOverrides: W } : {}
132
- };
133
- try {
134
- await A(t), Y(!0), setTimeout(() => S(`/addons/${x}`), 1500);
135
- } catch (e) {
136
- q(e instanceof Error ? e.message : "Failed to update addon");
137
- }
138
- },
139
- className: "space-y-6",
140
- children: [
141
- K && /* @__PURE__ */ g("div", {
142
- className: "p-4 bg-status-error-bg-subtle border border-border-subtle rounded-lg",
143
- children: /* @__PURE__ */ g("p", {
144
- className: "text-sm text-status-error-text",
145
- children: K
146
- })
147
- }),
148
- J && /* @__PURE__ */ g("div", {
149
- className: "p-4 bg-status-success-bg-subtle border border-border-subtle rounded-lg",
150
- children: /* @__PURE__ */ g("p", {
151
- className: "text-sm text-status-success-text",
152
- children: b("billing.addons.updateSuccess", "Addon updated successfully! Redirecting...")
153
- })
154
- }),
155
- /* @__PURE__ */ _("div", {
156
- className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
157
- children: [/* @__PURE__ */ _("div", {
158
- className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
159
- children: [/* @__PURE__ */ g("div", {
160
- className: "p-4 border-b border-border-subtle bg-bg-sunken/30",
161
- children: /* @__PURE__ */ g("h2", {
162
- className: "font-semibold text-text-primary",
163
- children: b("billing.addons.basicInfo", "Basic Information")
164
- })
165
- }), /* @__PURE__ */ _("div", {
166
- className: "p-4 space-y-4",
167
- children: [
168
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
169
- htmlFor: "name",
170
- className: "block text-sm font-medium text-text-primary mb-1",
171
- children: [b("billing.addons.addonNameLabel", "Addon Name"), " *"]
172
- }), /* @__PURE__ */ g("input", {
173
- id: "name",
174
- type: "text",
175
- value: M,
176
- onChange: (e) => N(e.target.value),
177
- 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)]",
178
- placeholder: b("billing.addons.addonNamePlaceholder", "e.g., Extra Storage"),
179
- required: !0
180
- })] }),
181
- /* @__PURE__ */ _("div", {
182
- className: "grid grid-cols-2 gap-4",
183
- children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
184
- htmlFor: "price",
100
+ children: [
101
+ /* @__PURE__ */ g(t, {
102
+ title: `Edit Addon: ${T.name}`,
103
+ description: x("billing.addons.editAddonDesc", "Update the addon details and quota allocations")
104
+ }),
105
+ /* @__PURE__ */ g(y, { children: x("billing.addons.editPurpose", "Update this add-on's price, currency overrides and the quotas it grants. Changes affect new purchases; existing add-on subscriptions keep what they already bought.") }),
106
+ /* @__PURE__ */ _("form", {
107
+ onSubmit: async (e) => {
108
+ if (e.preventDefault(), J(null), X(!1), !N.trim()) {
109
+ J("Addon name is required");
110
+ return;
111
+ }
112
+ if (!F || isNaN(Number(F)) || Number(F) < 0) {
113
+ J("Valid price is required");
114
+ return;
115
+ }
116
+ if (U.length === 0) {
117
+ J("At least one quota is required");
118
+ return;
119
+ }
120
+ if (U.filter((e) => e.quotaId === "").length > 0) {
121
+ J("Please select a quota for all allocations");
122
+ return;
123
+ }
124
+ let t = {
125
+ id: S,
126
+ name: N.trim(),
127
+ price: Number(F),
128
+ currency: L,
129
+ duration: z,
130
+ isActive: V,
131
+ quotas: U.map((e) => ({
132
+ quotaId: e.quotaId,
133
+ quantity: e.quantity
134
+ })),
135
+ ...G.length > 0 ? { currencyPriceOverrides: G } : {}
136
+ };
137
+ try {
138
+ await j(t), X(!0), setTimeout(() => C(`/addons/${S}`), 1500);
139
+ } catch (e) {
140
+ J(e instanceof Error ? e.message : "Failed to update addon");
141
+ }
142
+ },
143
+ className: "space-y-6",
144
+ children: [
145
+ q && /* @__PURE__ */ g("div", {
146
+ className: "p-4 bg-status-error-bg-subtle border border-border-subtle rounded-lg",
147
+ children: /* @__PURE__ */ g("p", {
148
+ className: "text-sm text-status-error-text",
149
+ children: q
150
+ })
151
+ }),
152
+ Y && /* @__PURE__ */ g("div", {
153
+ className: "p-4 bg-status-success-bg-subtle border border-border-subtle rounded-lg",
154
+ children: /* @__PURE__ */ g("p", {
155
+ className: "text-sm text-status-success-text",
156
+ children: x("billing.addons.updateSuccess", "Addon updated successfully! Redirecting...")
157
+ })
158
+ }),
159
+ /* @__PURE__ */ _("div", {
160
+ className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
161
+ children: [/* @__PURE__ */ _("div", {
162
+ className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
163
+ children: [/* @__PURE__ */ g("div", {
164
+ className: "p-4 border-b border-border-subtle bg-bg-sunken/30",
165
+ children: /* @__PURE__ */ g("h2", {
166
+ className: "font-semibold text-text-primary",
167
+ children: x("billing.addons.basicInfo", "Basic Information")
168
+ })
169
+ }), /* @__PURE__ */ _("div", {
170
+ className: "p-4 space-y-4",
171
+ children: [
172
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
173
+ htmlFor: "name",
185
174
  className: "block text-sm font-medium text-text-primary mb-1",
186
- children: [b("billing.addons.priceLabel", "Price"), " *"]
175
+ children: [x("billing.addons.addonNameLabel", "Addon Name"), " *"]
187
176
  }), /* @__PURE__ */ g("input", {
188
- id: "price",
189
- type: "number",
190
- step: "0.01",
191
- min: "0",
192
- value: P,
193
- onChange: (e) => F(e.target.value),
177
+ id: "name",
178
+ type: "text",
179
+ value: N,
180
+ onChange: (e) => P(e.target.value),
194
181
  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)]",
195
- placeholder: "9.99",
182
+ placeholder: x("billing.addons.addonNamePlaceholder", "e.g., Extra Storage"),
196
183
  required: !0
197
- })] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
198
- htmlFor: "currency",
184
+ })] }),
185
+ /* @__PURE__ */ _("div", {
186
+ className: "grid grid-cols-2 gap-4",
187
+ children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
188
+ htmlFor: "price",
189
+ className: "block text-sm font-medium text-text-primary mb-1",
190
+ children: [x("billing.addons.priceLabel", "Price"), " *"]
191
+ }), /* @__PURE__ */ g("input", {
192
+ id: "price",
193
+ type: "number",
194
+ step: "0.01",
195
+ min: "0",
196
+ value: F,
197
+ onChange: (e) => I(e.target.value),
198
+ 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)]",
199
+ placeholder: "9.99",
200
+ required: !0
201
+ })] }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
202
+ htmlFor: "currency",
203
+ className: "block text-sm font-medium text-text-primary mb-1",
204
+ children: [x("billing.addons.currencyLabel", "Currency"), " *"]
205
+ }), /* @__PURE__ */ _("select", {
206
+ id: "currency",
207
+ value: L,
208
+ onChange: (e) => R(e.target.value),
209
+ 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)]",
210
+ children: [
211
+ /* @__PURE__ */ g("option", {
212
+ value: "USD",
213
+ children: "USD ($)"
214
+ }),
215
+ /* @__PURE__ */ g("option", {
216
+ value: "EUR",
217
+ children: "EUR"
218
+ }),
219
+ /* @__PURE__ */ g("option", {
220
+ value: "GBP",
221
+ children: "GBP"
222
+ }),
223
+ /* @__PURE__ */ g("option", {
224
+ value: "INR",
225
+ children: "INR"
226
+ }),
227
+ /* @__PURE__ */ g("option", {
228
+ value: "AUD",
229
+ children: "AUD"
230
+ }),
231
+ /* @__PURE__ */ g("option", {
232
+ value: "CAD",
233
+ children: "CAD"
234
+ }),
235
+ /* @__PURE__ */ g("option", {
236
+ value: "JPY",
237
+ children: "JPY"
238
+ }),
239
+ /* @__PURE__ */ g("option", {
240
+ value: "SGD",
241
+ children: "SGD"
242
+ })
243
+ ]
244
+ })] })]
245
+ }),
246
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
247
+ htmlFor: "duration",
199
248
  className: "block text-sm font-medium text-text-primary mb-1",
200
- children: [b("billing.addons.currencyLabel", "Currency"), " *"]
249
+ children: [x("billing.addons.billingPeriodLabel", "Billing Period"), " *"]
201
250
  }), /* @__PURE__ */ _("select", {
202
- id: "currency",
203
- value: I,
204
- onChange: (e) => L(e.target.value),
251
+ id: "duration",
252
+ value: z,
253
+ onChange: (e) => B(e.target.value),
205
254
  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)]",
206
- children: [
207
- /* @__PURE__ */ g("option", {
208
- value: "USD",
209
- children: "USD ($)"
210
- }),
211
- /* @__PURE__ */ g("option", {
212
- value: "EUR",
213
- children: "EUR"
214
- }),
215
- /* @__PURE__ */ g("option", {
216
- value: "GBP",
217
- children: "GBP"
218
- }),
219
- /* @__PURE__ */ g("option", {
220
- value: "INR",
221
- children: "INR"
222
- }),
223
- /* @__PURE__ */ g("option", {
224
- value: "AUD",
225
- children: "AUD"
226
- }),
227
- /* @__PURE__ */ g("option", {
228
- value: "CAD",
229
- children: "CAD"
230
- }),
231
- /* @__PURE__ */ g("option", {
232
- value: "JPY",
233
- children: "JPY"
234
- }),
235
- /* @__PURE__ */ g("option", {
236
- value: "SGD",
237
- children: "SGD"
238
- })
239
- ]
240
- })] })]
241
- }),
242
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
243
- htmlFor: "duration",
244
- className: "block text-sm font-medium text-text-primary mb-1",
245
- children: [b("billing.addons.billingPeriodLabel", "Billing Period"), " *"]
246
- }), /* @__PURE__ */ _("select", {
247
- id: "duration",
248
- value: R,
249
- onChange: (e) => z(e.target.value),
250
- 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)]",
251
- children: [/* @__PURE__ */ g("option", {
252
- value: i.MONTHLY,
253
- children: "Monthly"
254
- }), /* @__PURE__ */ g("option", {
255
- value: i.YEARLY,
256
- children: "Yearly"
257
- })]
258
- })] }),
259
- /* @__PURE__ */ _("div", {
260
- className: "flex items-center gap-3",
261
- children: [/* @__PURE__ */ g("input", {
262
- id: "isActive",
263
- type: "checkbox",
264
- checked: B,
265
- onChange: (e) => V(e.target.checked),
266
- className: "size-4 rounded border-border-subtle text-text-link focus:ring-[var(--color-focus-ring)]"
267
- }), /* @__PURE__ */ g("label", {
268
- htmlFor: "isActive",
269
- className: "text-sm font-medium text-text-primary",
270
- children: b("billing.addons.addonIsActive", "Addon is active")
271
- })]
272
- })
273
- ]
274
- })]
275
- }), /* @__PURE__ */ _("div", {
276
- className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
277
- children: [/* @__PURE__ */ _("div", {
278
- className: "p-4 border-b border-border-subtle bg-bg-sunken/30 flex items-center justify-between",
279
- children: [/* @__PURE__ */ g("h2", {
280
- className: "font-semibold text-text-primary",
281
- children: b("billing.addons.quotaAllocations", "Quota Allocations")
282
- }), /* @__PURE__ */ g("button", {
283
- type: "button",
284
- onClick: X,
285
- className: "px-3 py-1 text-sm font-medium text-text-link hover:bg-[var(--color-accent-soft)] rounded-md transition-colors",
286
- children: "+ Add Quota"
287
- })]
288
- }), /* @__PURE__ */ g("div", {
289
- className: "p-4 space-y-3",
290
- children: H.length === 0 ? /* @__PURE__ */ g("p", {
291
- className: "text-sm text-text-muted",
292
- children: b("billing.addons.noQuotasAllocated", "No quotas allocated. Click \"Add Quota\" to add one.")
293
- }) : H.map((e, t) => {
294
- let n = O.find((t) => t.id === e.quotaId), r = n?.limits?.type ?? "unknown";
295
- return /* @__PURE__ */ _("div", {
296
- className: "p-3 border border-border-subtle rounded-lg bg-bg-sunken/20 space-y-3",
297
- children: [/* @__PURE__ */ _("div", {
255
+ children: [/* @__PURE__ */ g("option", {
256
+ value: i.MONTHLY,
257
+ children: "Monthly"
258
+ }), /* @__PURE__ */ g("option", {
259
+ value: i.YEARLY,
260
+ children: "Yearly"
261
+ })]
262
+ })] }),
263
+ /* @__PURE__ */ _("div", {
298
264
  className: "flex items-center gap-3",
299
- children: [/* @__PURE__ */ _("select", {
300
- value: e.quotaId,
301
- onChange: (e) => Q(t, "quotaId", e.target.value),
302
- className: `flex-1 px-3 py-2 border border-border-subtle rounded-input bg-bg-surface focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] ${e.quotaId === "" ? "text-text-muted" : "text-text-primary"}`,
303
- children: [/* @__PURE__ */ g("option", {
304
- value: "",
305
- disabled: !0,
306
- children: b("billing.addons.selectQuota", "Select a quota...")
307
- }), O.map((e) => /* @__PURE__ */ g("option", {
308
- value: e.id,
309
- children: e.name
310
- }, e.id))]
311
- }), /* @__PURE__ */ g("button", {
312
- type: "button",
313
- onClick: () => Z(t),
314
- className: "p-2 text-status-error-text hover:bg-status-error-bg-subtle rounded-md transition-colors",
315
- title: "Remove quota",
316
- children: /* @__PURE__ */ g("svg", {
317
- className: "size-5",
318
- fill: "none",
319
- viewBox: "0 0 24 24",
320
- stroke: "currentColor",
321
- children: /* @__PURE__ */ g("path", {
322
- strokeLinecap: "round",
323
- strokeLinejoin: "round",
324
- strokeWidth: 2,
325
- d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"
265
+ children: [/* @__PURE__ */ g("input", {
266
+ id: "isActive",
267
+ type: "checkbox",
268
+ checked: V,
269
+ onChange: (e) => H(e.target.checked),
270
+ className: "size-4 rounded border-border-subtle text-text-link focus:ring-[var(--color-focus-ring)]"
271
+ }), /* @__PURE__ */ g("label", {
272
+ htmlFor: "isActive",
273
+ className: "text-sm font-medium text-text-primary",
274
+ children: x("billing.addons.addonIsActive", "Addon is active")
275
+ })]
276
+ })
277
+ ]
278
+ })]
279
+ }), /* @__PURE__ */ _("div", {
280
+ className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
281
+ children: [/* @__PURE__ */ _("div", {
282
+ className: "p-4 border-b border-border-subtle bg-bg-sunken/30 flex items-center justify-between",
283
+ children: [/* @__PURE__ */ g("h2", {
284
+ className: "font-semibold text-text-primary",
285
+ children: x("billing.addons.quotaAllocations", "Quota Allocations")
286
+ }), /* @__PURE__ */ g("button", {
287
+ type: "button",
288
+ onClick: Z,
289
+ className: "px-3 py-1 text-sm font-medium text-text-link hover:bg-[var(--color-accent-soft)] rounded-md transition-colors",
290
+ children: "+ Add Quota"
291
+ })]
292
+ }), /* @__PURE__ */ g("div", {
293
+ className: "p-4 space-y-3",
294
+ children: U.length === 0 ? /* @__PURE__ */ g("p", {
295
+ className: "text-sm text-text-muted",
296
+ children: x("billing.addons.noQuotasAllocated", "No quotas allocated. Click \"Add Quota\" to add one.")
297
+ }) : U.map((e, t) => {
298
+ let n = k.find((t) => t.id === e.quotaId), r = n?.limits?.type ?? "unknown";
299
+ return /* @__PURE__ */ _("div", {
300
+ className: "p-3 border border-border-subtle rounded-lg bg-bg-sunken/20 space-y-3",
301
+ children: [/* @__PURE__ */ _("div", {
302
+ className: "flex items-center gap-3",
303
+ children: [/* @__PURE__ */ _("select", {
304
+ value: e.quotaId,
305
+ onChange: (e) => $(t, "quotaId", e.target.value),
306
+ className: `flex-1 px-3 py-2 border border-border-subtle rounded-input bg-bg-surface focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] ${e.quotaId === "" ? "text-text-muted" : "text-text-primary"}`,
307
+ children: [/* @__PURE__ */ g("option", {
308
+ value: "",
309
+ disabled: !0,
310
+ children: x("billing.addons.selectQuota", "Select a quota...")
311
+ }), k.map((e) => /* @__PURE__ */ g("option", {
312
+ value: e.id,
313
+ children: e.name
314
+ }, e.id))]
315
+ }), /* @__PURE__ */ g("button", {
316
+ type: "button",
317
+ onClick: () => Q(t),
318
+ className: "p-2 text-status-error-text hover:bg-status-error-bg-subtle rounded-md transition-colors",
319
+ title: "Remove quota",
320
+ children: /* @__PURE__ */ g("svg", {
321
+ className: "size-5",
322
+ fill: "none",
323
+ viewBox: "0 0 24 24",
324
+ stroke: "currentColor",
325
+ children: /* @__PURE__ */ g("path", {
326
+ strokeLinecap: "round",
327
+ strokeLinejoin: "round",
328
+ strokeWidth: 2,
329
+ d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"
330
+ })
326
331
  })
332
+ })]
333
+ }), n && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
334
+ className: "flex items-center justify-between text-sm",
335
+ children: /* @__PURE__ */ _("span", {
336
+ className: "capitalize text-text-muted",
337
+ children: ["Type: ", r]
327
338
  })
328
- })]
329
- }), n && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
330
- className: "flex items-center justify-between text-sm",
331
- children: /* @__PURE__ */ _("span", {
332
- className: "capitalize text-text-muted",
333
- children: ["Type: ", r]
334
- })
335
- }), /* @__PURE__ */ _("div", {
336
- className: "flex items-center gap-2",
337
- children: [/* @__PURE__ */ _("label", {
338
- className: "text-sm text-text-muted",
339
- children: [b("billing.addons.limit", "Limit"), ":"]
340
- }), /* @__PURE__ */ g("input", {
341
- type: "number",
342
- min: "1",
343
- value: e.quantity,
344
- onChange: (e) => Q(t, "quantity", e.target.value),
345
- className: "w-36 px-3 py-1.5 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-center"
346
- })]
347
- })] })]
348
- }, t);
349
- })
339
+ }), /* @__PURE__ */ _("div", {
340
+ className: "flex items-center gap-2",
341
+ children: [/* @__PURE__ */ _("label", {
342
+ className: "text-sm text-text-muted",
343
+ children: [x("billing.addons.limit", "Limit"), ":"]
344
+ }), /* @__PURE__ */ g("input", {
345
+ type: "number",
346
+ min: "1",
347
+ value: e.quantity,
348
+ onChange: (e) => $(t, "quantity", e.target.value),
349
+ className: "w-36 px-3 py-1.5 border border-border-subtle rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] text-center"
350
+ })]
351
+ })] })]
352
+ }, t);
353
+ })
354
+ })]
350
355
  })]
351
- })]
352
- }),
353
- /* @__PURE__ */ g(r, {
354
- overrides: W,
355
- onChange: G
356
- }),
357
- /* @__PURE__ */ _("div", {
358
- className: "flex items-center gap-3 pt-4",
359
- children: [/* @__PURE__ */ g("button", {
360
- type: "submit",
361
- disabled: j,
362
- 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",
363
- children: j ? b("billing.addons.saving", "Saving...") : b("billing.addons.saveChanges", "Save Changes")
364
- }), /* @__PURE__ */ g("button", {
365
- type: "button",
366
- onClick: () => S(`/addons/${x}`),
367
- className: "px-6 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
368
- children: "Cancel"
369
- })]
370
- })
371
- ]
372
- })]
356
+ }),
357
+ /* @__PURE__ */ g(r, {
358
+ overrides: G,
359
+ onChange: K
360
+ }),
361
+ /* @__PURE__ */ _("div", {
362
+ className: "flex items-center gap-3 pt-4",
363
+ children: [/* @__PURE__ */ g("button", {
364
+ type: "submit",
365
+ disabled: M,
366
+ 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",
367
+ children: M ? x("billing.addons.saving", "Saving...") : x("billing.addons.saveChanges", "Save Changes")
368
+ }), /* @__PURE__ */ g("button", {
369
+ type: "button",
370
+ onClick: () => C(`/addons/${S}`),
371
+ className: "px-6 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
372
+ children: "Cancel"
373
+ })]
374
+ })
375
+ ]
376
+ })
377
+ ]
373
378
  });
374
379
  };
375
380
  //#endregion
376
- export { y as AddonEditPage };
381
+ export { b as AddonEditPage };
377
382
 
378
383
  //# sourceMappingURL=AddonEditPage.js.map