@burdenoff/microfe-billing 2026.625.3 → 2026.625.5

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 (98) hide show
  1. package/dist/billing/lib/native-purchases.js +2 -44
  2. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +192 -187
  3. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
  4. package/dist/billing/modules/addons/pages/AddonCreatePage.js +322 -317
  5. package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
  6. package/dist/billing/modules/addons/pages/AddonDetailPage.js +190 -185
  7. package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
  8. package/dist/billing/modules/addons/pages/AddonEditPage.js +297 -292
  9. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
  10. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +60 -75
  11. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
  12. package/dist/billing/modules/addons/pages/AddonsListPage.js +86 -101
  13. package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
  14. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +124 -121
  15. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  16. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +103 -111
  17. package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
  18. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +196 -160
  19. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  20. package/dist/billing/modules/billing/pages/InvoicesListPage.js +58 -73
  21. package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
  22. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +65 -75
  23. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
  24. package/dist/billing/modules/billing/pages/RefundsPage.js +399 -399
  25. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  26. package/dist/billing/modules/billing/pages/TransactionsPage.js +49 -48
  27. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  28. package/dist/billing/modules/billing/pages/UserRefundsPage.js +144 -151
  29. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  30. package/dist/billing/modules/checkout/pages/CheckoutPage.js +430 -425
  31. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  32. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +121 -93
  33. package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
  34. package/dist/billing/modules/coupons/pages/CouponsListPage.js +154 -152
  35. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  36. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +467 -462
  37. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
  38. package/dist/billing/modules/coupons/pages/EditCouponPage.js +294 -286
  39. package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
  40. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +123 -117
  41. package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
  42. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +43 -42
  43. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
  44. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +192 -207
  45. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
  46. package/dist/billing/modules/credits/pages/CreditsPage.js +40 -56
  47. package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
  48. package/dist/billing/modules/dashboard/pages/OverviewPage.js +128 -121
  49. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  50. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +165 -180
  51. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  52. package/dist/billing/modules/earnings/pages/EarningsPage.js +103 -100
  53. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  54. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +175 -175
  55. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  56. package/dist/billing/modules/earnings/pages/PayoutsPage.js +96 -96
  57. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  58. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +42 -40
  59. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
  60. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +45 -38
  61. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
  62. package/dist/billing/modules/plans/pages/PlanCreatePage.js +339 -334
  63. package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
  64. package/dist/billing/modules/plans/pages/PlanDetailPage.js +80 -74
  65. package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
  66. package/dist/billing/modules/plans/pages/PlanEditPage.js +342 -337
  67. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  68. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +38 -53
  69. package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
  70. package/dist/billing/modules/plans/pages/PlansListPage.js +60 -75
  71. package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
  72. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +242 -237
  73. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
  74. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +29 -39
  75. package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -1
  76. package/dist/billing/modules/quota/pages/QuotaPage.js +1 -0
  77. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +299 -294
  78. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
  79. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +191 -186
  80. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -1
  81. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +308 -303
  82. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
  83. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +57 -78
  84. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -1
  85. package/dist/billing/modules/settings/pages/SettingsPage.js +79 -78
  86. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  87. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +15 -13
  88. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  89. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +338 -299
  90. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  91. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +82 -103
  92. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
  93. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +59 -54
  94. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  95. package/dist/billing/modules/usage/pages/UsagePage.js +172 -215
  96. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  97. package/package.json +2 -2
  98. package/dist/billing/lib/native-purchases.js.map +0 -1
@@ -12,14 +12,15 @@ import "../../plans/hooks/index.js";
12
12
  import { useState as c } from "react";
13
13
  import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
14
14
  import { useI18n as f } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
+ import { PagePurpose as p } from "@burdenoff/fe-libs/ui";
15
16
  //#region src/billing/modules/addons/pages/AddonCreatePage.tsx
16
- var p = () => {
17
- let { t: p } = f(), m = (e, t) => {
18
- let n = p(e);
17
+ var m = () => {
18
+ let { t: m } = f(), h = (e, t) => {
19
+ let n = m(e);
19
20
  return n === e ? t : n;
20
- }, h = a(), g = i(), { quotas: _, isLoading: v } = s({ onlyActive: !0 }), { createAddon: y, isCreating: b } = o(), [x, S] = c(""), [C, w] = c(""), [T, E] = c("USD"), [D, O] = c(r.MONTHLY), [k, A] = c(""), [j, M] = c([]), [N, P] = c([]), [F, I] = c(null), [L, R] = c(!1);
21
- if (!g.canManageAddons) return /* @__PURE__ */ u(e, { message: m("billing.addons.noCreatePermission", "You don't have permission to create addons.") });
22
- if (v) return /* @__PURE__ */ d("div", {
21
+ }, g = a(), _ = i(), { quotas: v, isLoading: y } = s({ onlyActive: !0 }), { createAddon: b, isCreating: x } = o(), [S, C] = c(""), [w, T] = c(""), [E, D] = c("USD"), [O, k] = c(r.MONTHLY), [A, j] = c(""), [M, N] = c([]), [P, F] = c([]), [I, L] = c(null), [R, z] = c(!1);
22
+ if (!_.canManageAddons) return /* @__PURE__ */ u(e, { message: h("billing.addons.noCreatePermission", "You don't have permission to create addons.") });
23
+ if (y) return /* @__PURE__ */ d("div", {
23
24
  className: "space-y-6 p-6",
24
25
  children: [/* @__PURE__ */ u("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ u("div", {
25
26
  className: "max-w-2xl space-y-4",
@@ -32,338 +33,342 @@ var p = () => {
32
33
  ].map((e) => /* @__PURE__ */ u("div", { className: "h-16 bg-bg-sunken animate-pulse rounded" }, e))
33
34
  })]
34
35
  });
35
- let z = () => {
36
- M([{
36
+ let B = () => {
37
+ N([{
37
38
  quotaId: "",
38
39
  quantity: 1
39
- }, ...j]);
40
- }, B = (e) => {
41
- M(j.filter((t, n) => n !== e));
42
- }, V = (e, t, n) => {
43
- let r = [...j];
44
- t === "quotaId" ? r[e].quotaId = n : r[e].quantity = Number(n), M(r);
40
+ }, ...M]);
41
+ }, V = (e) => {
42
+ N(M.filter((t, n) => n !== e));
43
+ }, H = (e, t, n) => {
44
+ let r = [...M];
45
+ t === "quotaId" ? r[e].quotaId = n : r[e].quantity = Number(n), N(r);
45
46
  };
46
47
  return /* @__PURE__ */ d("div", {
47
48
  className: "space-y-6 p-6",
48
- children: [/* @__PURE__ */ u(t, {
49
- title: m("billing.addons.createNewAddon", "Create New Addon"),
50
- description: m("billing.addons.createNewAddonDesc", "Set up a new addon with quotas")
51
- }), /* @__PURE__ */ d("form", {
52
- onSubmit: async (e) => {
53
- if (e.preventDefault(), I(null), R(!1), !x.trim()) {
54
- I("Addon name is required");
55
- return;
56
- }
57
- if (!C || isNaN(Number(C)) || Number(C) < 0) {
58
- I("Valid price is required");
59
- return;
60
- }
61
- if (!k.trim()) {
62
- I("Product ID is required");
63
- return;
64
- }
65
- if (j.length === 0) {
66
- I("At least one quota is required");
67
- return;
68
- }
69
- if (j.filter((e) => e.quotaId === "").length > 0) {
70
- I("Please select a quota for all allocations");
71
- return;
72
- }
73
- let t = {
74
- name: x.trim(),
75
- price: Number(C),
76
- currency: T,
77
- duration: D,
78
- productId: k.trim(),
79
- quotas: j.map((e) => ({
80
- quotaId: e.quotaId,
81
- quantity: e.quantity
82
- })),
83
- ...N.length > 0 ? { currencyPriceOverrides: N } : {}
84
- };
85
- try {
86
- await y(t), R(!0), setTimeout(() => h("/addons"), 1500);
87
- } catch (e) {
88
- I(e instanceof Error ? e.message : "Failed to create addon");
89
- }
90
- },
91
- className: "space-y-6",
92
- children: [
93
- F && /* @__PURE__ */ u("div", {
94
- className: "p-4 bg-status-error-bg-subtle border border-border-subtle rounded-lg",
95
- children: /* @__PURE__ */ u("p", {
96
- className: "text-sm text-status-error-text",
97
- children: F
98
- })
99
- }),
100
- L && /* @__PURE__ */ u("div", {
101
- className: "p-4 bg-status-success-bg-subtle border border-border-subtle rounded-lg",
102
- children: /* @__PURE__ */ u("p", {
103
- className: "text-sm text-status-success-text",
104
- children: m("billing.addons.createSuccess", "Addon created successfully! Redirecting...")
105
- })
106
- }),
107
- /* @__PURE__ */ d("div", {
108
- className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
109
- children: [/* @__PURE__ */ d("div", {
110
- className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
111
- children: [/* @__PURE__ */ u("div", {
112
- className: "p-4 border-b border-border-subtle bg-bg-sunken/30",
113
- children: /* @__PURE__ */ u("h2", {
114
- className: "font-semibold text-text-primary",
115
- children: m("billing.addons.basicInfo", "Basic Information")
116
- })
117
- }), /* @__PURE__ */ d("div", {
118
- className: "p-4 space-y-4",
119
- children: [
120
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
121
- htmlFor: "name",
122
- className: "block text-sm font-medium text-text-primary mb-1",
123
- children: [m("billing.addons.addonNameLabel", "Addon Name"), " *"]
124
- }), /* @__PURE__ */ u("input", {
125
- id: "name",
126
- type: "text",
127
- value: x,
128
- onChange: (e) => S(e.target.value),
129
- 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)]",
130
- placeholder: m("billing.addons.addonNamePlaceholder", "e.g., Extra Storage"),
131
- required: !0
132
- })] }),
133
- /* @__PURE__ */ d("div", { children: [
134
- /* @__PURE__ */ d("label", {
135
- htmlFor: "productId",
49
+ children: [
50
+ /* @__PURE__ */ u(t, {
51
+ title: h("billing.addons.createNewAddon", "Create New Addon"),
52
+ description: h("billing.addons.createNewAddonDesc", "Set up a new addon with quotas")
53
+ }),
54
+ /* @__PURE__ */ u(p, { children: h("billing.addons.createPurpose", "Create an add-on that customers can buy on top of a subscription — extra seats, storage, usage credits and so on. Set its price (with optional per-currency overrides) and the quotas it grants, then make it available to purchase.") }),
55
+ /* @__PURE__ */ d("form", {
56
+ onSubmit: async (e) => {
57
+ if (e.preventDefault(), L(null), z(!1), !S.trim()) {
58
+ L("Addon name is required");
59
+ return;
60
+ }
61
+ if (!w || isNaN(Number(w)) || Number(w) < 0) {
62
+ L("Valid price is required");
63
+ return;
64
+ }
65
+ if (!A.trim()) {
66
+ L("Product ID is required");
67
+ return;
68
+ }
69
+ if (M.length === 0) {
70
+ L("At least one quota is required");
71
+ return;
72
+ }
73
+ if (M.filter((e) => e.quotaId === "").length > 0) {
74
+ L("Please select a quota for all allocations");
75
+ return;
76
+ }
77
+ let t = {
78
+ name: S.trim(),
79
+ price: Number(w),
80
+ currency: E,
81
+ duration: O,
82
+ productId: A.trim(),
83
+ quotas: M.map((e) => ({
84
+ quotaId: e.quotaId,
85
+ quantity: e.quantity
86
+ })),
87
+ ...P.length > 0 ? { currencyPriceOverrides: P } : {}
88
+ };
89
+ try {
90
+ await b(t), z(!0), setTimeout(() => g("/addons"), 1500);
91
+ } catch (e) {
92
+ L(e instanceof Error ? e.message : "Failed to create addon");
93
+ }
94
+ },
95
+ className: "space-y-6",
96
+ children: [
97
+ I && /* @__PURE__ */ u("div", {
98
+ className: "p-4 bg-status-error-bg-subtle border border-border-subtle rounded-lg",
99
+ children: /* @__PURE__ */ u("p", {
100
+ className: "text-sm text-status-error-text",
101
+ children: I
102
+ })
103
+ }),
104
+ R && /* @__PURE__ */ u("div", {
105
+ className: "p-4 bg-status-success-bg-subtle border border-border-subtle rounded-lg",
106
+ children: /* @__PURE__ */ u("p", {
107
+ className: "text-sm text-status-success-text",
108
+ children: h("billing.addons.createSuccess", "Addon created successfully! Redirecting...")
109
+ })
110
+ }),
111
+ /* @__PURE__ */ d("div", {
112
+ className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
113
+ children: [/* @__PURE__ */ d("div", {
114
+ className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
115
+ children: [/* @__PURE__ */ u("div", {
116
+ className: "p-4 border-b border-border-subtle bg-bg-sunken/30",
117
+ children: /* @__PURE__ */ u("h2", {
118
+ className: "font-semibold text-text-primary",
119
+ children: h("billing.addons.basicInfo", "Basic Information")
120
+ })
121
+ }), /* @__PURE__ */ d("div", {
122
+ className: "p-4 space-y-4",
123
+ children: [
124
+ /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
125
+ htmlFor: "name",
136
126
  className: "block text-sm font-medium text-text-primary mb-1",
137
- children: [m("billing.addons.productId", "Product ID"), " *"]
138
- }),
139
- /* @__PURE__ */ u("input", {
140
- id: "productId",
127
+ children: [h("billing.addons.addonNameLabel", "Addon Name"), " *"]
128
+ }), /* @__PURE__ */ u("input", {
129
+ id: "name",
141
130
  type: "text",
142
- value: k,
143
- onChange: (e) => A(e.target.value),
131
+ value: S,
132
+ onChange: (e) => C(e.target.value),
144
133
  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)]",
145
- placeholder: m("billing.addons.productIdPlaceholder", "e.g., prod_abc123"),
134
+ placeholder: h("billing.addons.addonNamePlaceholder", "e.g., Extra Storage"),
146
135
  required: !0
136
+ })] }),
137
+ /* @__PURE__ */ d("div", { children: [
138
+ /* @__PURE__ */ d("label", {
139
+ htmlFor: "productId",
140
+ className: "block text-sm font-medium text-text-primary mb-1",
141
+ children: [h("billing.addons.productId", "Product ID"), " *"]
142
+ }),
143
+ /* @__PURE__ */ u("input", {
144
+ id: "productId",
145
+ type: "text",
146
+ value: A,
147
+ onChange: (e) => j(e.target.value),
148
+ 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)]",
149
+ placeholder: h("billing.addons.productIdPlaceholder", "e.g., prod_abc123"),
150
+ required: !0
151
+ }),
152
+ /* @__PURE__ */ u("p", {
153
+ className: "text-xs text-text-muted mt-1",
154
+ children: h("billing.addons.productIdDesc", "The product this addon belongs to")
155
+ })
156
+ ] }),
157
+ /* @__PURE__ */ d("div", {
158
+ className: "grid grid-cols-2 gap-4",
159
+ children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
160
+ htmlFor: "price",
161
+ className: "block text-sm font-medium text-text-primary mb-1",
162
+ children: [h("billing.addons.priceLabel", "Price"), " *"]
163
+ }), /* @__PURE__ */ u("input", {
164
+ id: "price",
165
+ type: "number",
166
+ step: "0.01",
167
+ min: "0",
168
+ value: w,
169
+ onChange: (e) => T(e.target.value),
170
+ 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)]",
171
+ placeholder: "9.99",
172
+ required: !0
173
+ })] }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
174
+ htmlFor: "currency",
175
+ className: "block text-sm font-medium text-text-primary mb-1",
176
+ children: [h("billing.addons.currencyLabel", "Currency"), " *"]
177
+ }), /* @__PURE__ */ d("select", {
178
+ id: "currency",
179
+ value: E,
180
+ onChange: (e) => D(e.target.value),
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)]",
182
+ children: [
183
+ /* @__PURE__ */ u("option", {
184
+ value: "USD",
185
+ children: "USD ($)"
186
+ }),
187
+ /* @__PURE__ */ u("option", {
188
+ value: "EUR",
189
+ children: "EUR"
190
+ }),
191
+ /* @__PURE__ */ u("option", {
192
+ value: "GBP",
193
+ children: "GBP"
194
+ }),
195
+ /* @__PURE__ */ u("option", {
196
+ value: "INR",
197
+ children: "INR"
198
+ }),
199
+ /* @__PURE__ */ u("option", {
200
+ value: "AUD",
201
+ children: "AUD"
202
+ }),
203
+ /* @__PURE__ */ u("option", {
204
+ value: "CAD",
205
+ children: "CAD"
206
+ }),
207
+ /* @__PURE__ */ u("option", {
208
+ value: "JPY",
209
+ children: "JPY"
210
+ }),
211
+ /* @__PURE__ */ u("option", {
212
+ value: "SGD",
213
+ children: "SGD"
214
+ })
215
+ ]
216
+ })] })]
147
217
  }),
148
- /* @__PURE__ */ u("p", {
149
- className: "text-xs text-text-muted mt-1",
150
- children: m("billing.addons.productIdDesc", "The product this addon belongs to")
151
- })
152
- ] }),
153
- /* @__PURE__ */ d("div", {
154
- className: "grid grid-cols-2 gap-4",
155
- children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
156
- htmlFor: "price",
218
+ /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
219
+ htmlFor: "duration",
157
220
  className: "block text-sm font-medium text-text-primary mb-1",
158
- children: [m("billing.addons.priceLabel", "Price"), " *"]
159
- }), /* @__PURE__ */ u("input", {
160
- id: "price",
161
- type: "number",
162
- step: "0.01",
163
- min: "0",
164
- value: C,
165
- onChange: (e) => w(e.target.value),
166
- 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)]",
167
- placeholder: "9.99",
168
- required: !0
169
- })] }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
170
- htmlFor: "currency",
171
- className: "block text-sm font-medium text-text-primary mb-1",
172
- children: [m("billing.addons.currencyLabel", "Currency"), " *"]
221
+ children: [h("billing.addons.billingPeriodLabel", "Billing Period"), " *"]
173
222
  }), /* @__PURE__ */ d("select", {
174
- id: "currency",
175
- value: T,
176
- onChange: (e) => E(e.target.value),
223
+ id: "duration",
224
+ value: O,
225
+ onChange: (e) => k(e.target.value),
177
226
  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
- children: [
179
- /* @__PURE__ */ u("option", {
180
- value: "USD",
181
- children: "USD ($)"
182
- }),
183
- /* @__PURE__ */ u("option", {
184
- value: "EUR",
185
- children: "EUR"
186
- }),
187
- /* @__PURE__ */ u("option", {
188
- value: "GBP",
189
- children: "GBP"
190
- }),
191
- /* @__PURE__ */ u("option", {
192
- value: "INR",
193
- children: "INR"
194
- }),
195
- /* @__PURE__ */ u("option", {
196
- value: "AUD",
197
- children: "AUD"
198
- }),
199
- /* @__PURE__ */ u("option", {
200
- value: "CAD",
201
- children: "CAD"
202
- }),
203
- /* @__PURE__ */ u("option", {
204
- value: "JPY",
205
- children: "JPY"
206
- }),
207
- /* @__PURE__ */ u("option", {
208
- value: "SGD",
209
- children: "SGD"
210
- })
211
- ]
212
- })] })]
213
- }),
214
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
215
- htmlFor: "duration",
216
- className: "block text-sm font-medium text-text-primary mb-1",
217
- children: [m("billing.addons.billingPeriodLabel", "Billing Period"), " *"]
218
- }), /* @__PURE__ */ d("select", {
219
- id: "duration",
220
- value: D,
221
- onChange: (e) => O(e.target.value),
222
- 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)]",
223
- children: [/* @__PURE__ */ u("option", {
224
- value: r.MONTHLY,
225
- children: "Monthly"
226
- }), /* @__PURE__ */ u("option", {
227
- value: r.YEARLY,
228
- children: "Yearly"
229
- })]
230
- })] })
231
- ]
232
- })]
233
- }), /* @__PURE__ */ d("div", {
234
- className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
235
- children: [/* @__PURE__ */ d("div", {
236
- className: "p-4 border-b border-border-subtle bg-bg-sunken/30 flex items-center justify-between",
237
- children: [/* @__PURE__ */ d("h2", {
238
- className: "font-semibold text-text-primary",
239
- children: [m("billing.addons.quotaAllocations", "Quota Allocations"), " *"]
240
- }), /* @__PURE__ */ u("button", {
241
- type: "button",
242
- onClick: z,
243
- disabled: _.length === 0,
244
- className: "px-3 py-1 text-sm font-medium text-text-link hover:bg-[var(--color-accent-soft)] rounded-md transition-colors disabled:opacity-50",
245
- children: "+ Add Quota"
246
- })]
247
- }), /* @__PURE__ */ u("div", {
248
- className: "p-4 space-y-3",
249
- children: _.length === 0 ? /* @__PURE__ */ u("p", {
250
- className: "text-sm text-text-muted",
251
- children: m("billing.addons.noQuotasAvailable", "No quotas available. Please create quotas first.")
252
- }) : j.length === 0 ? /* @__PURE__ */ u("p", {
253
- className: "text-sm text-text-muted",
254
- children: m("billing.addons.noQuotasAllocated", "No quotas allocated. Click \"Add Quota\" to add one.")
255
- }) : j.map((e, t) => {
256
- let n = _.find((t) => t.id === e.quotaId), r = n?.limits, i = r?.value ?? 0, a = r?.type ?? "unknown", o = i * e.quantity;
257
- return /* @__PURE__ */ d("div", {
258
- className: "p-3 border border-border-subtle rounded-lg bg-bg-sunken/20 space-y-3",
259
- children: [/* @__PURE__ */ d("div", {
260
- className: "flex items-center gap-3",
261
- children: [/* @__PURE__ */ d("select", {
262
- value: e.quotaId,
263
- onChange: (e) => V(t, "quotaId", e.target.value),
264
- 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"}`,
265
- children: [/* @__PURE__ */ u("option", {
266
- value: "",
267
- disabled: !0,
268
- children: m("billing.addons.selectQuota", "Select a quota...")
269
- }), _.map((e) => /* @__PURE__ */ u("option", {
270
- value: e.id,
271
- children: e.name
272
- }, e.id))]
273
- }), /* @__PURE__ */ u("button", {
274
- type: "button",
275
- onClick: () => B(t),
276
- className: "p-2 text-status-error-text hover:bg-status-error-bg-subtle rounded-md transition-colors",
277
- title: "Remove quota",
278
- children: /* @__PURE__ */ u("svg", {
279
- className: "size-5",
280
- fill: "none",
281
- viewBox: "0 0 24 24",
282
- stroke: "currentColor",
283
- children: /* @__PURE__ */ u("path", {
284
- strokeLinecap: "round",
285
- strokeLinejoin: "round",
286
- strokeWidth: 2,
287
- 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"
288
- })
289
- })
227
+ children: [/* @__PURE__ */ u("option", {
228
+ value: r.MONTHLY,
229
+ children: "Monthly"
230
+ }), /* @__PURE__ */ u("option", {
231
+ value: r.YEARLY,
232
+ children: "Yearly"
290
233
  })]
291
- }), n && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", {
292
- className: "flex items-center justify-between text-sm",
293
- children: /* @__PURE__ */ d("div", {
294
- className: "text-text-muted",
295
- children: [
296
- /* @__PURE__ */ d("span", {
297
- className: "capitalize",
298
- children: ["Type: ", a]
299
- }),
300
- /* @__PURE__ */ u("span", {
301
- className: "mx-2",
302
- children: ""
303
- }),
304
- /* @__PURE__ */ d("span", { children: [
305
- "Value per unit:",
306
- " ",
307
- /* @__PURE__ */ u("span", {
308
- className: "font-medium text-text-primary",
309
- children: i.toLocaleString()
310
- })
311
- ] })
312
- ]
313
- })
314
- }), /* @__PURE__ */ d("div", {
315
- className: "flex items-center gap-4",
234
+ })] })
235
+ ]
236
+ })]
237
+ }), /* @__PURE__ */ d("div", {
238
+ className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
239
+ children: [/* @__PURE__ */ d("div", {
240
+ className: "p-4 border-b border-border-subtle bg-bg-sunken/30 flex items-center justify-between",
241
+ children: [/* @__PURE__ */ d("h2", {
242
+ className: "font-semibold text-text-primary",
243
+ children: [h("billing.addons.quotaAllocations", "Quota Allocations"), " *"]
244
+ }), /* @__PURE__ */ u("button", {
245
+ type: "button",
246
+ onClick: B,
247
+ disabled: v.length === 0,
248
+ className: "px-3 py-1 text-sm font-medium text-text-link hover:bg-[var(--color-accent-soft)] rounded-md transition-colors disabled:opacity-50",
249
+ children: "+ Add Quota"
250
+ })]
251
+ }), /* @__PURE__ */ u("div", {
252
+ className: "p-4 space-y-3",
253
+ children: v.length === 0 ? /* @__PURE__ */ u("p", {
254
+ className: "text-sm text-text-muted",
255
+ children: h("billing.addons.noQuotasAvailable", "No quotas available. Please create quotas first.")
256
+ }) : M.length === 0 ? /* @__PURE__ */ u("p", {
257
+ className: "text-sm text-text-muted",
258
+ children: h("billing.addons.noQuotasAllocated", "No quotas allocated. Click \"Add Quota\" to add one.")
259
+ }) : M.map((e, t) => {
260
+ let n = v.find((t) => t.id === e.quotaId), r = n?.limits, i = r?.value ?? 0, a = r?.type ?? "unknown", o = i * e.quantity;
261
+ return /* @__PURE__ */ d("div", {
262
+ className: "p-3 border border-border-subtle rounded-lg bg-bg-sunken/20 space-y-3",
316
263
  children: [/* @__PURE__ */ d("div", {
317
- className: "flex items-center gap-2",
318
- children: [/* @__PURE__ */ d("label", {
319
- className: "text-sm text-text-muted",
320
- children: [m("billing.addons.quantity", "Quantity"), ":"]
321
- }), /* @__PURE__ */ u("input", {
322
- type: "number",
323
- min: "1",
324
- value: e.quantity,
325
- onChange: (e) => V(t, "quantity", e.target.value),
326
- className: "w-24 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"
264
+ className: "flex items-center gap-3",
265
+ children: [/* @__PURE__ */ d("select", {
266
+ value: e.quotaId,
267
+ onChange: (e) => H(t, "quotaId", e.target.value),
268
+ 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"}`,
269
+ children: [/* @__PURE__ */ u("option", {
270
+ value: "",
271
+ disabled: !0,
272
+ children: h("billing.addons.selectQuota", "Select a quota...")
273
+ }), v.map((e) => /* @__PURE__ */ u("option", {
274
+ value: e.id,
275
+ children: e.name
276
+ }, e.id))]
277
+ }), /* @__PURE__ */ u("button", {
278
+ type: "button",
279
+ onClick: () => V(t),
280
+ className: "p-2 text-status-error-text hover:bg-status-error-bg-subtle rounded-md transition-colors",
281
+ title: "Remove quota",
282
+ children: /* @__PURE__ */ u("svg", {
283
+ className: "size-5",
284
+ fill: "none",
285
+ viewBox: "0 0 24 24",
286
+ stroke: "currentColor",
287
+ children: /* @__PURE__ */ u("path", {
288
+ strokeLinecap: "round",
289
+ strokeLinejoin: "round",
290
+ strokeWidth: 2,
291
+ 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"
292
+ })
293
+ })
327
294
  })]
328
- }), /* @__PURE__ */ d("div", {
329
- className: "flex items-center gap-2 text-sm",
330
- children: [/* @__PURE__ */ u("span", {
295
+ }), n && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", {
296
+ className: "flex items-center justify-between text-sm",
297
+ children: /* @__PURE__ */ d("div", {
331
298
  className: "text-text-muted",
332
- children: "="
333
- }), /* @__PURE__ */ d("span", {
334
- className: "font-semibold text-status-success-text",
335
- children: [o.toLocaleString(), " total"]
299
+ children: [
300
+ /* @__PURE__ */ d("span", {
301
+ className: "capitalize",
302
+ children: ["Type: ", a]
303
+ }),
304
+ /* @__PURE__ */ u("span", {
305
+ className: "mx-2",
306
+ children: "•"
307
+ }),
308
+ /* @__PURE__ */ d("span", { children: [
309
+ "Value per unit:",
310
+ " ",
311
+ /* @__PURE__ */ u("span", {
312
+ className: "font-medium text-text-primary",
313
+ children: i.toLocaleString()
314
+ })
315
+ ] })
316
+ ]
317
+ })
318
+ }), /* @__PURE__ */ d("div", {
319
+ className: "flex items-center gap-4",
320
+ children: [/* @__PURE__ */ d("div", {
321
+ className: "flex items-center gap-2",
322
+ children: [/* @__PURE__ */ d("label", {
323
+ className: "text-sm text-text-muted",
324
+ children: [h("billing.addons.quantity", "Quantity"), ":"]
325
+ }), /* @__PURE__ */ u("input", {
326
+ type: "number",
327
+ min: "1",
328
+ value: e.quantity,
329
+ onChange: (e) => H(t, "quantity", e.target.value),
330
+ className: "w-24 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"
331
+ })]
332
+ }), /* @__PURE__ */ d("div", {
333
+ className: "flex items-center gap-2 text-sm",
334
+ children: [/* @__PURE__ */ u("span", {
335
+ className: "text-text-muted",
336
+ children: "="
337
+ }), /* @__PURE__ */ d("span", {
338
+ className: "font-semibold text-status-success-text",
339
+ children: [o.toLocaleString(), " total"]
340
+ })]
336
341
  })]
337
- })]
338
- })] })]
339
- }, t);
340
- })
342
+ })] })]
343
+ }, t);
344
+ })
345
+ })]
341
346
  })]
342
- })]
343
- }),
344
- /* @__PURE__ */ u(n, {
345
- overrides: N,
346
- onChange: P
347
- }),
348
- /* @__PURE__ */ d("div", {
349
- className: "flex items-center gap-3 pt-4",
350
- children: [/* @__PURE__ */ u("button", {
351
- type: "submit",
352
- disabled: b || _.length === 0,
353
- 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",
354
- children: b ? m("billing.addons.creating", "Creating...") : m("billing.addons.createAddonBtn", "Create Addon")
355
- }), /* @__PURE__ */ u("button", {
356
- type: "button",
357
- onClick: () => h("/addons"),
358
- className: "px-6 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
359
- children: "Cancel"
360
- })]
361
- })
362
- ]
363
- })]
347
+ }),
348
+ /* @__PURE__ */ u(n, {
349
+ overrides: P,
350
+ onChange: F
351
+ }),
352
+ /* @__PURE__ */ d("div", {
353
+ className: "flex items-center gap-3 pt-4",
354
+ children: [/* @__PURE__ */ u("button", {
355
+ type: "submit",
356
+ disabled: x || v.length === 0,
357
+ 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",
358
+ children: x ? h("billing.addons.creating", "Creating...") : h("billing.addons.createAddonBtn", "Create Addon")
359
+ }), /* @__PURE__ */ u("button", {
360
+ type: "button",
361
+ onClick: () => g("/addons"),
362
+ className: "px-6 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
363
+ children: "Cancel"
364
+ })]
365
+ })
366
+ ]
367
+ })
368
+ ]
364
369
  });
365
370
  };
366
371
  //#endregion
367
- export { p as AddonCreatePage };
372
+ export { m as AddonCreatePage };
368
373
 
369
374
  //# sourceMappingURL=AddonCreatePage.js.map