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