@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
|
@@ -2,54 +2,54 @@ import { AccessDenied as e } from "../../../shared/components/AccessDenied.js";
|
|
|
2
2
|
import { PageHeader as t } from "../../../shared/components/PageHeader.js";
|
|
3
3
|
import { ServerError as n } from "../../../shared/components/ServerError.js";
|
|
4
4
|
import { CurrencyPriceOverridesEditor as r } from "../../../shared/components/CurrencyPriceOverridesEditor.js";
|
|
5
|
-
import { useBillingNavigate as
|
|
5
|
+
import { useBillingNavigate as i } from "../../../hooks/useBillingNavigate.js";
|
|
6
6
|
import "../hooks/index.js";
|
|
7
7
|
import "../../plans/hooks/index.js";
|
|
8
|
-
import { isServerError as
|
|
9
|
-
import { useBillingPermissions as
|
|
8
|
+
import { isServerError as a } from "../../../shared/utils/error.js";
|
|
9
|
+
import { useBillingPermissions as o } from "../../../hooks/useBillingPermissions.js";
|
|
10
10
|
import "../../../shared/components/index.js";
|
|
11
11
|
import "../../../shared/utils/index.js";
|
|
12
|
-
import { useAddon as
|
|
13
|
-
import { getPlanFeatureQuantity as
|
|
14
|
-
import { useQuotas as
|
|
15
|
-
import { PlanDuration as
|
|
16
|
-
import { useEffect as
|
|
17
|
-
import { PagePurpose as p } from "@burdenoff/fe-libs/ui";
|
|
18
|
-
import { useParams as
|
|
19
|
-
import { Fragment as
|
|
20
|
-
import { useI18n as
|
|
12
|
+
import { useAddon as s, useAddonMutations as c } from "../hooks/useAddons.js";
|
|
13
|
+
import { getPlanFeatureQuantity as l } from "../../../shared/utils/planFeatureQuantity.js";
|
|
14
|
+
import { useQuotas as u } from "../../plans/hooks/useQuotas.js";
|
|
15
|
+
import { PlanDuration as d } from "../../../shared/types/graphql.js";
|
|
16
|
+
import { useEffect as ee, useState as f } from "react";
|
|
17
|
+
import { PagePurpose as p, ThemedSelect as m } from "@burdenoff/fe-libs/ui";
|
|
18
|
+
import { useParams as h } from "react-router";
|
|
19
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
20
|
+
import { useI18n as y } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
21
21
|
// src/billing/modules/addons/pages/AddonEditPage.tsx
|
|
22
|
-
var
|
|
23
|
-
let { t:
|
|
24
|
-
let n =
|
|
22
|
+
var b = () => {
|
|
23
|
+
let { t: b } = y(), x = (e, t) => {
|
|
24
|
+
let n = b(e);
|
|
25
25
|
return n === e ? t : n;
|
|
26
|
-
}, { addonId:
|
|
27
|
-
if (
|
|
28
|
-
if (
|
|
29
|
-
if (
|
|
30
|
-
let e =
|
|
31
|
-
|
|
26
|
+
}, { addonId: S } = h(), C = i(), w = o(), { addon: T, isLoading: E, error: D, refetch: O } = s(S), { quotas: k, isLoading: A } = u({ onlyActive: !0 }), { updateAddon: j, isUpdating: M } = c(), [N, P] = f(""), [F, I] = f(""), [L, R] = f("USD"), [z, B] = f(d.MONTHLY), [V, H] = f(!0), [U, W] = f(!0), [G, K] = f([]), [q, J] = f([]), [Y, X] = f(null), [Z, Q] = f(!1);
|
|
27
|
+
if (ee(() => {
|
|
28
|
+
if (T) {
|
|
29
|
+
if (P(T.name ?? ""), I(String(T.price ?? "")), R(T.currency ?? "USD"), B(T.duration ?? d.MONTHLY), H(T.isActive ?? !0), W(T.requiresPaidSubscription ?? !0), T.currencyPrices && typeof T.currencyPrices == "object") {
|
|
30
|
+
let e = T.currencyPrices;
|
|
31
|
+
J(Object.entries(e).filter(([, e]) => typeof e == "number").map(([e, t]) => ({
|
|
32
32
|
currency: e,
|
|
33
33
|
amount: t
|
|
34
34
|
})));
|
|
35
35
|
}
|
|
36
|
-
if (
|
|
36
|
+
if (T.features && T.features.length > 0) {
|
|
37
37
|
let e = [], t = /* @__PURE__ */ new Map();
|
|
38
|
-
for (let e of
|
|
39
|
-
let n = e.quota.id, r =
|
|
38
|
+
for (let e of T.features) if (e.quota?.id) {
|
|
39
|
+
let n = e.quota.id, r = l(e);
|
|
40
40
|
t.set(n, (t.get(n) ?? 0) + r);
|
|
41
41
|
}
|
|
42
42
|
for (let [n, r] of t) e.push({
|
|
43
43
|
quotaId: n,
|
|
44
44
|
quantity: r
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
K(e);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
}, [
|
|
50
|
-
if (
|
|
49
|
+
}, [T]), !w.canManageAddons) return /* @__PURE__ */ _(e, { message: x("billing.addons.noEditPermission", "You don't have permission to edit addons.") });
|
|
50
|
+
if (E || A) return /* @__PURE__ */ v("div", {
|
|
51
51
|
className: "space-y-6 p-6",
|
|
52
|
-
children: [/* @__PURE__ */
|
|
52
|
+
children: [/* @__PURE__ */ _("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }), /* @__PURE__ */ _("div", {
|
|
53
53
|
className: "max-w-2xl space-y-4",
|
|
54
54
|
children: [
|
|
55
55
|
1,
|
|
@@ -57,293 +57,293 @@ var y = () => {
|
|
|
57
57
|
3,
|
|
58
58
|
4,
|
|
59
59
|
5
|
|
60
|
-
].map((e) => /* @__PURE__ */
|
|
60
|
+
].map((e) => /* @__PURE__ */ _("div", { className: "h-16 bg-bg-sunken animate-pulse rounded" }, e))
|
|
61
61
|
})]
|
|
62
62
|
});
|
|
63
|
-
if (
|
|
63
|
+
if (D && a(D)) return /* @__PURE__ */ _("div", {
|
|
64
64
|
className: "p-6",
|
|
65
|
-
children: /* @__PURE__ */
|
|
66
|
-
title:
|
|
67
|
-
message:
|
|
68
|
-
onRetry: () =>
|
|
65
|
+
children: /* @__PURE__ */ _(n, {
|
|
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(),
|
|
69
69
|
showRetry: !0
|
|
70
70
|
})
|
|
71
71
|
});
|
|
72
|
-
if (!
|
|
72
|
+
if (!T) return /* @__PURE__ */ _("div", {
|
|
73
73
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
74
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ v("div", {
|
|
75
75
|
className: "text-center space-y-4",
|
|
76
|
-
children: [/* @__PURE__ */
|
|
76
|
+
children: [/* @__PURE__ */ _("h2", {
|
|
77
77
|
className: "text-lg font-semibold text-text-primary",
|
|
78
|
-
children:
|
|
79
|
-
}), /* @__PURE__ */
|
|
78
|
+
children: x("billing.addons.addonNotFound", "Addon not found")
|
|
79
|
+
}), /* @__PURE__ */ _("button", {
|
|
80
80
|
type: "button",
|
|
81
|
-
onClick: () =>
|
|
81
|
+
onClick: () => C("/addons"),
|
|
82
82
|
className: "px-4 py-2 text-sm font-medium bg-action-primary-bg text-action-primary-text rounded-button hover:bg-action-primary-bgHover",
|
|
83
83
|
children: "Back to Addons"
|
|
84
84
|
})]
|
|
85
85
|
})
|
|
86
86
|
});
|
|
87
|
-
let
|
|
88
|
-
|
|
87
|
+
let te = () => {
|
|
88
|
+
K([{
|
|
89
89
|
quotaId: "",
|
|
90
90
|
quantity: 1
|
|
91
|
-
}, ...
|
|
92
|
-
},
|
|
93
|
-
G
|
|
91
|
+
}, ...G]);
|
|
92
|
+
}, ne = (e) => {
|
|
93
|
+
K(G.filter((t, n) => n !== e));
|
|
94
94
|
}, $ = (e, t, n) => {
|
|
95
|
-
let r = [...
|
|
96
|
-
t === "quotaId" ? r[e].quotaId = n : r[e].quantity = Number(n),
|
|
95
|
+
let r = [...G];
|
|
96
|
+
t === "quotaId" ? r[e].quotaId = n : r[e].quantity = Number(n), K(r);
|
|
97
97
|
};
|
|
98
|
-
return /* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ v("div", {
|
|
99
99
|
className: "space-y-6 p-6",
|
|
100
100
|
children: [
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
title: `Edit Addon: ${
|
|
103
|
-
description:
|
|
101
|
+
/* @__PURE__ */ _(t, {
|
|
102
|
+
title: `Edit Addon: ${T.name}`,
|
|
103
|
+
description: x("billing.addons.editAddonDesc", "Update the addon details and quota allocations")
|
|
104
104
|
}),
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ _(p, { 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__ */ v("form", {
|
|
107
107
|
onSubmit: async (e) => {
|
|
108
|
-
if (e.preventDefault(),
|
|
109
|
-
|
|
108
|
+
if (e.preventDefault(), X(null), Q(!1), !N.trim()) {
|
|
109
|
+
X("Addon name is required");
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
|
-
if (!
|
|
113
|
-
|
|
112
|
+
if (!F || isNaN(Number(F)) || Number(F) < 0) {
|
|
113
|
+
X("Valid price is required");
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
if (
|
|
117
|
-
|
|
116
|
+
if (G.length === 0) {
|
|
117
|
+
X("At least one quota is required");
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
if (
|
|
121
|
-
|
|
120
|
+
if (G.filter((e) => e.quotaId === "").length > 0) {
|
|
121
|
+
X("Please select a quota for all allocations");
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
124
|
let t = {
|
|
125
|
-
id:
|
|
126
|
-
name:
|
|
127
|
-
price: Number(
|
|
128
|
-
currency:
|
|
129
|
-
duration:
|
|
130
|
-
isActive:
|
|
131
|
-
requiresPaidSubscription:
|
|
132
|
-
quotas:
|
|
125
|
+
id: S,
|
|
126
|
+
name: N.trim(),
|
|
127
|
+
price: Number(F),
|
|
128
|
+
currency: L,
|
|
129
|
+
duration: z,
|
|
130
|
+
isActive: V,
|
|
131
|
+
requiresPaidSubscription: U,
|
|
132
|
+
quotas: G.map((e) => ({
|
|
133
133
|
quotaId: e.quotaId,
|
|
134
134
|
quantity: e.quantity
|
|
135
135
|
})),
|
|
136
|
-
...
|
|
136
|
+
...q.length > 0 ? { currencyPriceOverrides: q } : {}
|
|
137
137
|
};
|
|
138
138
|
try {
|
|
139
|
-
await
|
|
139
|
+
await j(t), Q(!0), setTimeout(() => C(`/addons/${S}`), 1500);
|
|
140
140
|
} catch (e) {
|
|
141
|
-
|
|
141
|
+
X(e instanceof Error ? e.message : "Failed to update addon");
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
144
|
className: "space-y-6",
|
|
145
145
|
children: [
|
|
146
|
-
|
|
146
|
+
Y && /* @__PURE__ */ _("div", {
|
|
147
147
|
className: "p-4 bg-status-error-bg-subtle border border-border-subtle rounded-lg",
|
|
148
|
-
children: /* @__PURE__ */
|
|
148
|
+
children: /* @__PURE__ */ _("p", {
|
|
149
149
|
className: "text-sm text-status-error-text",
|
|
150
|
-
children:
|
|
150
|
+
children: Y
|
|
151
151
|
})
|
|
152
152
|
}),
|
|
153
|
-
|
|
153
|
+
Z && /* @__PURE__ */ _("div", {
|
|
154
154
|
className: "p-4 bg-status-success-bg-subtle border border-border-subtle rounded-lg",
|
|
155
|
-
children: /* @__PURE__ */
|
|
155
|
+
children: /* @__PURE__ */ _("p", {
|
|
156
156
|
className: "text-sm text-status-success-text",
|
|
157
|
-
children:
|
|
157
|
+
children: x("billing.addons.updateSuccess", "Addon updated successfully! Redirecting...")
|
|
158
158
|
})
|
|
159
159
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ v("div", {
|
|
161
161
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ v("div", {
|
|
163
163
|
className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
|
|
164
|
-
children: [/* @__PURE__ */
|
|
164
|
+
children: [/* @__PURE__ */ _("div", {
|
|
165
165
|
className: "p-4 border-b border-border-subtle bg-bg-sunken/30",
|
|
166
|
-
children: /* @__PURE__ */
|
|
166
|
+
children: /* @__PURE__ */ _("h2", {
|
|
167
167
|
className: "font-semibold text-text-primary",
|
|
168
|
-
children:
|
|
168
|
+
children: x("billing.addons.basicInfo", "Basic Information")
|
|
169
169
|
})
|
|
170
|
-
}), /* @__PURE__ */
|
|
170
|
+
}), /* @__PURE__ */ v("div", {
|
|
171
171
|
className: "p-4 space-y-4",
|
|
172
172
|
children: [
|
|
173
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
|
|
174
174
|
htmlFor: "name",
|
|
175
175
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
176
|
-
children: [
|
|
177
|
-
}), /* @__PURE__ */
|
|
176
|
+
children: [x("billing.addons.addonNameLabel", "Addon Name"), " *"]
|
|
177
|
+
}), /* @__PURE__ */ _("input", {
|
|
178
178
|
id: "name",
|
|
179
179
|
type: "text",
|
|
180
|
-
value:
|
|
181
|
-
onChange: (e) =>
|
|
180
|
+
value: N,
|
|
181
|
+
onChange: (e) => P(e.target.value),
|
|
182
182
|
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)]",
|
|
183
|
-
placeholder:
|
|
183
|
+
placeholder: x("billing.addons.addonNamePlaceholder", "e.g., Extra Storage"),
|
|
184
184
|
required: !0
|
|
185
185
|
})] }),
|
|
186
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ v("div", {
|
|
187
187
|
className: "grid grid-cols-2 gap-4",
|
|
188
|
-
children: [/* @__PURE__ */
|
|
188
|
+
children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
|
|
189
189
|
htmlFor: "price",
|
|
190
190
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
191
|
-
children: [
|
|
192
|
-
}), /* @__PURE__ */
|
|
191
|
+
children: [x("billing.addons.priceLabel", "Price"), " *"]
|
|
192
|
+
}), /* @__PURE__ */ _("input", {
|
|
193
193
|
id: "price",
|
|
194
194
|
type: "number",
|
|
195
195
|
step: "0.01",
|
|
196
196
|
min: "0",
|
|
197
|
-
value:
|
|
198
|
-
onChange: (e) =>
|
|
197
|
+
value: F,
|
|
198
|
+
onChange: (e) => I(e.target.value),
|
|
199
199
|
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)]",
|
|
200
200
|
placeholder: "9.99",
|
|
201
201
|
required: !0
|
|
202
|
-
})] }), /* @__PURE__ */
|
|
202
|
+
})] }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
|
|
203
203
|
htmlFor: "currency",
|
|
204
204
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
205
|
-
children: [
|
|
206
|
-
}), /* @__PURE__ */
|
|
205
|
+
children: [x("billing.addons.currencyLabel", "Currency"), " *"]
|
|
206
|
+
}), /* @__PURE__ */ v(m, {
|
|
207
207
|
id: "currency",
|
|
208
|
-
value:
|
|
209
|
-
onChange: (e) =>
|
|
208
|
+
value: L,
|
|
209
|
+
onChange: (e) => R(e.target.value),
|
|
210
210
|
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",
|
|
211
211
|
children: [
|
|
212
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ _("option", {
|
|
213
213
|
value: "USD",
|
|
214
214
|
children: "USD ($)"
|
|
215
215
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ _("option", {
|
|
217
217
|
value: "EUR",
|
|
218
218
|
children: "EUR"
|
|
219
219
|
}),
|
|
220
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ _("option", {
|
|
221
221
|
value: "GBP",
|
|
222
222
|
children: "GBP"
|
|
223
223
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ _("option", {
|
|
225
225
|
value: "INR",
|
|
226
226
|
children: "INR"
|
|
227
227
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ _("option", {
|
|
229
229
|
value: "AUD",
|
|
230
230
|
children: "AUD"
|
|
231
231
|
}),
|
|
232
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ _("option", {
|
|
233
233
|
value: "CAD",
|
|
234
234
|
children: "CAD"
|
|
235
235
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ _("option", {
|
|
237
237
|
value: "JPY",
|
|
238
238
|
children: "JPY"
|
|
239
239
|
}),
|
|
240
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ _("option", {
|
|
241
241
|
value: "SGD",
|
|
242
242
|
children: "SGD"
|
|
243
243
|
})
|
|
244
244
|
]
|
|
245
245
|
})] })]
|
|
246
246
|
}),
|
|
247
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
|
|
248
248
|
htmlFor: "duration",
|
|
249
249
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
250
|
-
children: [
|
|
251
|
-
}), /* @__PURE__ */
|
|
250
|
+
children: [x("billing.addons.billingPeriodLabel", "Billing Period"), " *"]
|
|
251
|
+
}), /* @__PURE__ */ v(m, {
|
|
252
252
|
id: "duration",
|
|
253
|
-
value:
|
|
254
|
-
onChange: (e) =>
|
|
253
|
+
value: z,
|
|
254
|
+
onChange: (e) => B(e.target.value),
|
|
255
255
|
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",
|
|
256
|
-
children: [/* @__PURE__ */
|
|
257
|
-
value:
|
|
256
|
+
children: [/* @__PURE__ */ _("option", {
|
|
257
|
+
value: d.MONTHLY,
|
|
258
258
|
children: "Monthly"
|
|
259
|
-
}), /* @__PURE__ */
|
|
260
|
-
value:
|
|
259
|
+
}), /* @__PURE__ */ _("option", {
|
|
260
|
+
value: d.YEARLY,
|
|
261
261
|
children: "Yearly"
|
|
262
262
|
})]
|
|
263
263
|
})] }),
|
|
264
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ v("div", {
|
|
265
265
|
className: "flex items-center gap-3",
|
|
266
|
-
children: [/* @__PURE__ */
|
|
266
|
+
children: [/* @__PURE__ */ _("input", {
|
|
267
267
|
id: "isActive",
|
|
268
268
|
type: "checkbox",
|
|
269
|
-
checked:
|
|
270
|
-
onChange: (e) =>
|
|
269
|
+
checked: V,
|
|
270
|
+
onChange: (e) => H(e.target.checked),
|
|
271
271
|
className: "size-4 rounded border-border-subtle text-text-link focus:ring-[var(--color-focus-ring)]"
|
|
272
|
-
}), /* @__PURE__ */
|
|
272
|
+
}), /* @__PURE__ */ _("label", {
|
|
273
273
|
htmlFor: "isActive",
|
|
274
274
|
className: "text-sm font-medium text-text-primary",
|
|
275
|
-
children:
|
|
275
|
+
children: x("billing.addons.addonIsActive", "Addon is active")
|
|
276
276
|
})]
|
|
277
277
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ v("div", {
|
|
279
279
|
className: "flex items-start gap-3",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
280
|
+
children: [/* @__PURE__ */ _("input", {
|
|
281
281
|
id: "requiresPaidSubscription",
|
|
282
282
|
type: "checkbox",
|
|
283
|
-
checked:
|
|
284
|
-
onChange: (e) =>
|
|
283
|
+
checked: U,
|
|
284
|
+
onChange: (e) => W(e.target.checked),
|
|
285
285
|
className: "mt-0.5 size-4 rounded border-border-subtle text-text-link focus:ring-[var(--color-focus-ring)]"
|
|
286
|
-
}), /* @__PURE__ */
|
|
286
|
+
}), /* @__PURE__ */ v("label", {
|
|
287
287
|
htmlFor: "requiresPaidSubscription",
|
|
288
288
|
className: "text-sm text-text-primary",
|
|
289
|
-
children: [/* @__PURE__ */
|
|
289
|
+
children: [/* @__PURE__ */ _("span", {
|
|
290
290
|
className: "font-medium",
|
|
291
|
-
children:
|
|
292
|
-
}), /* @__PURE__ */
|
|
291
|
+
children: x("billing.addons.requiresPaidSubscription", "Requires a paid subscription")
|
|
292
|
+
}), /* @__PURE__ */ _("span", {
|
|
293
293
|
className: "block text-text-secondary",
|
|
294
|
-
children:
|
|
294
|
+
children: x("billing.addons.requiresPaidSubscriptionDesc", "Free-plan workspaces cannot buy this add-on. Clear it only for items sold to Free users on purpose, such as credit packs or fees.")
|
|
295
295
|
})]
|
|
296
296
|
})]
|
|
297
297
|
})
|
|
298
298
|
]
|
|
299
299
|
})]
|
|
300
|
-
}), /* @__PURE__ */
|
|
300
|
+
}), /* @__PURE__ */ v("div", {
|
|
301
301
|
className: "border border-border-seam rounded-card bg-bg-surface overflow-hidden shadow-[var(--shadow-elevation-1)] h-fit",
|
|
302
|
-
children: [/* @__PURE__ */
|
|
302
|
+
children: [/* @__PURE__ */ v("div", {
|
|
303
303
|
className: "p-4 border-b border-border-subtle bg-bg-sunken/30 flex items-center justify-between",
|
|
304
|
-
children: [/* @__PURE__ */
|
|
304
|
+
children: [/* @__PURE__ */ _("h2", {
|
|
305
305
|
className: "font-semibold text-text-primary",
|
|
306
|
-
children:
|
|
307
|
-
}), /* @__PURE__ */
|
|
306
|
+
children: x("billing.addons.quotaAllocations", "Quota Allocations")
|
|
307
|
+
}), /* @__PURE__ */ _("button", {
|
|
308
308
|
type: "button",
|
|
309
|
-
onClick:
|
|
309
|
+
onClick: te,
|
|
310
310
|
className: "px-3 py-1 text-sm font-medium text-text-link hover:bg-[var(--color-accent-soft)] rounded-md transition-colors",
|
|
311
311
|
children: "+ Add Quota"
|
|
312
312
|
})]
|
|
313
|
-
}), /* @__PURE__ */
|
|
313
|
+
}), /* @__PURE__ */ _("div", {
|
|
314
314
|
className: "p-4 space-y-3",
|
|
315
|
-
children:
|
|
315
|
+
children: G.length === 0 ? /* @__PURE__ */ _("p", {
|
|
316
316
|
className: "text-sm text-text-muted",
|
|
317
|
-
children:
|
|
318
|
-
}) :
|
|
319
|
-
let n =
|
|
320
|
-
return /* @__PURE__ */
|
|
317
|
+
children: x("billing.addons.noQuotasAllocated", "No quotas allocated. Click \"Add Quota\" to add one.")
|
|
318
|
+
}) : G.map((e, t) => {
|
|
319
|
+
let n = k.find((t) => t.id === e.quotaId), r = n?.limits?.type ?? "unknown";
|
|
320
|
+
return /* @__PURE__ */ v("div", {
|
|
321
321
|
className: "p-3 border border-border-subtle rounded-lg bg-bg-sunken/20 space-y-3",
|
|
322
|
-
children: [/* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ v("div", {
|
|
323
323
|
className: "flex items-center gap-3",
|
|
324
|
-
children: [/* @__PURE__ */
|
|
324
|
+
children: [/* @__PURE__ */ v(m, {
|
|
325
325
|
value: e.quotaId,
|
|
326
326
|
onChange: (e) => $(t, "quotaId", e.target.value),
|
|
327
327
|
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"}`,
|
|
328
|
-
children: [/* @__PURE__ */
|
|
328
|
+
children: [/* @__PURE__ */ _("option", {
|
|
329
329
|
value: "",
|
|
330
330
|
disabled: !0,
|
|
331
|
-
children:
|
|
332
|
-
}),
|
|
331
|
+
children: x("billing.addons.selectQuota", "Select a quota...")
|
|
332
|
+
}), k.map((e) => /* @__PURE__ */ _("option", {
|
|
333
333
|
value: e.id,
|
|
334
334
|
children: e.name
|
|
335
335
|
}, e.id))]
|
|
336
|
-
}), /* @__PURE__ */
|
|
336
|
+
}), /* @__PURE__ */ _("button", {
|
|
337
337
|
type: "button",
|
|
338
|
-
onClick: () =>
|
|
338
|
+
onClick: () => ne(t),
|
|
339
339
|
className: "p-2 text-status-error-text hover:bg-status-error-bg-subtle rounded-md transition-colors",
|
|
340
340
|
title: "Remove quota",
|
|
341
|
-
children: /* @__PURE__ */
|
|
341
|
+
children: /* @__PURE__ */ _("svg", {
|
|
342
342
|
className: "size-5",
|
|
343
343
|
fill: "none",
|
|
344
344
|
viewBox: "0 0 24 24",
|
|
345
345
|
stroke: "currentColor",
|
|
346
|
-
children: /* @__PURE__ */
|
|
346
|
+
children: /* @__PURE__ */ _("path", {
|
|
347
347
|
strokeLinecap: "round",
|
|
348
348
|
strokeLinejoin: "round",
|
|
349
349
|
strokeWidth: 2,
|
|
@@ -351,18 +351,18 @@ var y = () => {
|
|
|
351
351
|
})
|
|
352
352
|
})
|
|
353
353
|
})]
|
|
354
|
-
}), n && /* @__PURE__ */
|
|
354
|
+
}), n && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", {
|
|
355
355
|
className: "flex items-center justify-between text-sm",
|
|
356
|
-
children: /* @__PURE__ */
|
|
356
|
+
children: /* @__PURE__ */ v("span", {
|
|
357
357
|
className: "capitalize text-text-muted",
|
|
358
358
|
children: ["Type: ", r]
|
|
359
359
|
})
|
|
360
|
-
}), /* @__PURE__ */
|
|
360
|
+
}), /* @__PURE__ */ v("div", {
|
|
361
361
|
className: "flex items-center gap-2",
|
|
362
|
-
children: [/* @__PURE__ */
|
|
362
|
+
children: [/* @__PURE__ */ v("label", {
|
|
363
363
|
className: "text-sm text-text-muted",
|
|
364
|
-
children: [
|
|
365
|
-
}), /* @__PURE__ */
|
|
364
|
+
children: [x("billing.addons.limit", "Limit"), ":"]
|
|
365
|
+
}), /* @__PURE__ */ _("input", {
|
|
366
366
|
type: "number",
|
|
367
367
|
min: "1",
|
|
368
368
|
value: e.quantity,
|
|
@@ -375,20 +375,20 @@ var y = () => {
|
|
|
375
375
|
})]
|
|
376
376
|
})]
|
|
377
377
|
}),
|
|
378
|
-
/* @__PURE__ */
|
|
379
|
-
overrides:
|
|
380
|
-
onChange:
|
|
378
|
+
/* @__PURE__ */ _(r, {
|
|
379
|
+
overrides: q,
|
|
380
|
+
onChange: J
|
|
381
381
|
}),
|
|
382
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ v("div", {
|
|
383
383
|
className: "flex items-center gap-3 pt-4",
|
|
384
|
-
children: [/* @__PURE__ */
|
|
384
|
+
children: [/* @__PURE__ */ _("button", {
|
|
385
385
|
type: "submit",
|
|
386
|
-
disabled:
|
|
386
|
+
disabled: M,
|
|
387
387
|
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",
|
|
388
|
-
children:
|
|
389
|
-
}), /* @__PURE__ */
|
|
388
|
+
children: M ? x("billing.addons.saving", "Saving...") : x("billing.addons.saveChanges", "Save Changes")
|
|
389
|
+
}), /* @__PURE__ */ _("button", {
|
|
390
390
|
type: "button",
|
|
391
|
-
onClick: () =>
|
|
391
|
+
onClick: () => C(`/addons/${S}`),
|
|
392
392
|
className: "px-6 py-2 text-sm font-medium border border-border-subtle text-text-primary rounded-button hover:bg-bg-sunken transition-colors",
|
|
393
393
|
children: "Cancel"
|
|
394
394
|
})]
|
|
@@ -398,6 +398,6 @@ var y = () => {
|
|
|
398
398
|
]
|
|
399
399
|
});
|
|
400
400
|
};
|
|
401
|
-
export {
|
|
401
|
+
export { b as AddonEditPage };
|
|
402
402
|
|
|
403
403
|
//# sourceMappingURL=AddonEditPage.js.map
|