@burdenoff/microfe-billing 2026.1116.1 → 2026.1119.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.
- 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
|
@@ -6,29 +6,29 @@ import "../../../shared/components/index.js";
|
|
|
6
6
|
import { useGetCouponLazyQuery as i, useUpdateCouponMutation as a } from "../../../../generated/global-operations.js";
|
|
7
7
|
import { CouponStatus as o } from "../../../../generated/global-types.js";
|
|
8
8
|
import { useEffect as s, useState as c } from "react";
|
|
9
|
-
import { PagePurpose as l } from "@burdenoff/fe-libs/ui";
|
|
10
|
-
import { AlertCircle as
|
|
11
|
-
import { jsx as
|
|
12
|
-
import { useI18n as
|
|
9
|
+
import { PagePurpose as l, ThemedSelect as u } from "@burdenoff/fe-libs/ui";
|
|
10
|
+
import { AlertCircle as d, ArrowLeft as f, CheckCircle as p, Save as m } from "lucide-react";
|
|
11
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
|
+
import { useI18n as _ } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
13
13
|
// src/billing/modules/coupons/pages/EditCouponPage.tsx
|
|
14
|
-
var
|
|
15
|
-
let { t:
|
|
16
|
-
let n =
|
|
14
|
+
var v = () => {
|
|
15
|
+
let { t: v } = _(), y = (e, t) => {
|
|
16
|
+
let n = v(e);
|
|
17
17
|
return n === e ? t : n;
|
|
18
|
-
},
|
|
18
|
+
}, b = n(), x = r(), S = window.location.pathname.split("/").slice(-2)[0], [C, { data: w, loading: T, error: E }] = i(), [D, { loading: O }] = a(), [k, A] = c({
|
|
19
19
|
name: "",
|
|
20
20
|
description: "",
|
|
21
21
|
status: o.Active,
|
|
22
22
|
maxTotalUses: "",
|
|
23
23
|
maxUsesPerUser: "",
|
|
24
24
|
validUntil: ""
|
|
25
|
-
}), [
|
|
25
|
+
}), [j, M] = c({}), [N, P] = c(""), [F, I] = c(!1);
|
|
26
26
|
if (s(() => {
|
|
27
|
-
|
|
28
|
-
}, [
|
|
29
|
-
if (
|
|
30
|
-
let e =
|
|
31
|
-
|
|
27
|
+
S && C({ variables: { id: S } });
|
|
28
|
+
}, [S, C]), s(() => {
|
|
29
|
+
if (w?.getCoupon) {
|
|
30
|
+
let e = w.getCoupon;
|
|
31
|
+
A({
|
|
32
32
|
name: e.name,
|
|
33
33
|
description: e.description || "",
|
|
34
34
|
status: e.status,
|
|
@@ -37,297 +37,297 @@ var _ = () => {
|
|
|
37
37
|
validUntil: e.validUntil ? new Date(e.validUntil).toISOString().split("T")[0] : ""
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
}, [
|
|
41
|
-
let
|
|
42
|
-
|
|
40
|
+
}, [w]), !x.canManageDiscounts) return /* @__PURE__ */ h(e, { message: "You don't have permission to manage coupons." });
|
|
41
|
+
let L = (e, t) => {
|
|
42
|
+
A((n) => ({
|
|
43
43
|
...n,
|
|
44
44
|
[e]: t
|
|
45
|
-
})),
|
|
45
|
+
})), j[e] && M((t) => ({
|
|
46
46
|
...t,
|
|
47
47
|
[e]: ""
|
|
48
48
|
}));
|
|
49
|
-
},
|
|
49
|
+
}, R = () => {
|
|
50
50
|
let e = {};
|
|
51
|
-
return
|
|
52
|
-
},
|
|
53
|
-
if (e.preventDefault(),
|
|
54
|
-
if (!
|
|
51
|
+
return k.name.trim() || (e.name = "Name is required"), k.maxTotalUses && parseInt(k.maxTotalUses) < 1 && (e.maxTotalUses = "Must be at least 1"), k.maxUsesPerUser && parseInt(k.maxUsesPerUser) < 1 && (e.maxUsesPerUser = "Must be at least 1"), M(e), Object.keys(e).length === 0;
|
|
52
|
+
}, z = async (e) => {
|
|
53
|
+
if (e.preventDefault(), P(""), I(!1), R()) {
|
|
54
|
+
if (!S) P("Coupon ID is missing");
|
|
55
55
|
else try {
|
|
56
56
|
let e = {};
|
|
57
|
-
|
|
58
|
-
id:
|
|
57
|
+
k.name.trim() && (e.name = k.name.trim()), k.description.trim() && (e.description = k.description.trim()), k.status && (e.status = k.status), k.maxTotalUses && (e.maxTotalUses = parseInt(k.maxTotalUses)), k.maxUsesPerUser && (e.maxUsesPerUser = parseInt(k.maxUsesPerUser)), k.validUntil && (e.validUntil = new Date(k.validUntil).toISOString()), await D({ variables: {
|
|
58
|
+
id: S,
|
|
59
59
|
input: e
|
|
60
|
-
} }),
|
|
61
|
-
|
|
60
|
+
} }), I(!0), setTimeout(() => {
|
|
61
|
+
b("/coupons");
|
|
62
62
|
}, 1500);
|
|
63
63
|
} catch (e) {
|
|
64
|
-
console.error("Failed to update coupon:", e),
|
|
64
|
+
console.error("Failed to update coupon:", e), P(e instanceof Error ? e.message : "Failed to update coupon");
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
if (
|
|
68
|
+
if (T) return /* @__PURE__ */ g("div", {
|
|
69
69
|
className: "p-8",
|
|
70
|
-
children: [/* @__PURE__ */
|
|
71
|
-
title:
|
|
70
|
+
children: [/* @__PURE__ */ h(t, {
|
|
71
|
+
title: y("billing.coupons.editTitle", "Edit Coupon"),
|
|
72
72
|
description: "Loading coupon data...",
|
|
73
|
-
actions: /* @__PURE__ */
|
|
73
|
+
actions: /* @__PURE__ */ g("button", {
|
|
74
74
|
type: "button",
|
|
75
|
-
onClick: () =>
|
|
75
|
+
onClick: () => b("/coupons"),
|
|
76
76
|
className: "px-4 py-2 rounded-lg border border-border-subtle text-text-primary hover:bg-bg-sunken flex items-center gap-2",
|
|
77
|
-
children: [/* @__PURE__ */
|
|
77
|
+
children: [/* @__PURE__ */ h(f, { className: "size-4" }), "Back"]
|
|
78
78
|
})
|
|
79
|
-
}), /* @__PURE__ */
|
|
79
|
+
}), /* @__PURE__ */ h("div", {
|
|
80
80
|
className: "flex items-center justify-center h-64",
|
|
81
|
-
children: /* @__PURE__ */
|
|
81
|
+
children: /* @__PURE__ */ h("div", {
|
|
82
82
|
className: "text-text-muted",
|
|
83
83
|
children: "Loading coupon…"
|
|
84
84
|
})
|
|
85
85
|
})]
|
|
86
86
|
});
|
|
87
|
-
if (
|
|
87
|
+
if (E || !w?.getCoupon) return /* @__PURE__ */ g("div", {
|
|
88
88
|
className: "p-8",
|
|
89
|
-
children: [/* @__PURE__ */
|
|
89
|
+
children: [/* @__PURE__ */ h(t, {
|
|
90
90
|
title: "Edit Coupon",
|
|
91
91
|
description: "Coupon not found",
|
|
92
|
-
actions: /* @__PURE__ */
|
|
92
|
+
actions: /* @__PURE__ */ g("button", {
|
|
93
93
|
type: "button",
|
|
94
|
-
onClick: () =>
|
|
94
|
+
onClick: () => b("/coupons"),
|
|
95
95
|
className: "px-4 py-2 rounded-lg border border-border-subtle text-text-primary hover:bg-bg-sunken flex items-center gap-2",
|
|
96
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ h(f, { className: "size-4" }), "Back"]
|
|
97
97
|
})
|
|
98
|
-
}), /* @__PURE__ */
|
|
98
|
+
}), /* @__PURE__ */ h("div", {
|
|
99
99
|
className: "flex items-center justify-center h-64",
|
|
100
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ h("div", {
|
|
101
101
|
className: "text-status-error-text",
|
|
102
|
-
children:
|
|
102
|
+
children: E ? `Error: ${E.message}` : "Coupon not found"
|
|
103
103
|
})
|
|
104
104
|
})]
|
|
105
105
|
});
|
|
106
|
-
let
|
|
107
|
-
return /* @__PURE__ */
|
|
106
|
+
let B = w.getCoupon;
|
|
107
|
+
return /* @__PURE__ */ g("div", {
|
|
108
108
|
className: "p-8",
|
|
109
109
|
children: [
|
|
110
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ h(t, {
|
|
111
111
|
title: "Edit Coupon",
|
|
112
|
-
description: `Editing: ${
|
|
113
|
-
actions: /* @__PURE__ */
|
|
112
|
+
description: `Editing: ${B.code}`,
|
|
113
|
+
actions: /* @__PURE__ */ g("button", {
|
|
114
114
|
type: "button",
|
|
115
|
-
onClick: () =>
|
|
115
|
+
onClick: () => b("/coupons"),
|
|
116
116
|
className: "px-4 py-2 rounded-lg border border-border-subtle text-text-primary hover:bg-bg-sunken flex items-center gap-2",
|
|
117
|
-
children: [/* @__PURE__ */
|
|
117
|
+
children: [/* @__PURE__ */ h(f, { className: "size-4" }), "Back to Coupons"]
|
|
118
118
|
})
|
|
119
119
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ h(l, {
|
|
121
121
|
className: "mt-2",
|
|
122
122
|
children: "Update an existing coupon's discount, limits, expiry or applicable products. The code itself and its usage history are read-only; deactivate the coupon if you want to stop it being redeemed."
|
|
123
123
|
}),
|
|
124
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ h("div", {
|
|
125
125
|
className: "max-w-3xl mx-auto mt-8",
|
|
126
|
-
children: /* @__PURE__ */
|
|
127
|
-
onSubmit:
|
|
126
|
+
children: /* @__PURE__ */ g("form", {
|
|
127
|
+
onSubmit: z,
|
|
128
128
|
className: "space-y-6",
|
|
129
129
|
children: [
|
|
130
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ g("div", {
|
|
131
131
|
className: "bg-bg-sunken/30 border border-border-subtle rounded-lg p-6",
|
|
132
|
-
children: [/* @__PURE__ */
|
|
132
|
+
children: [/* @__PURE__ */ h("h3", {
|
|
133
133
|
className: "text-lg font-semibold text-text-primary mb-4",
|
|
134
134
|
children: "Coupon Details (Read-Only)"
|
|
135
|
-
}), /* @__PURE__ */
|
|
135
|
+
}), /* @__PURE__ */ g("div", {
|
|
136
136
|
className: "grid grid-cols-2 gap-4 text-sm",
|
|
137
137
|
children: [
|
|
138
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("span", {
|
|
139
139
|
className: "text-text-muted",
|
|
140
140
|
children: "Code:"
|
|
141
|
-
}), /* @__PURE__ */
|
|
141
|
+
}), /* @__PURE__ */ h("span", {
|
|
142
142
|
className: "ml-2 font-mono font-medium text-text-primary",
|
|
143
|
-
children:
|
|
143
|
+
children: B.code
|
|
144
144
|
})] }),
|
|
145
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("span", {
|
|
146
146
|
className: "text-text-muted",
|
|
147
147
|
children: "Type:"
|
|
148
|
-
}), /* @__PURE__ */
|
|
148
|
+
}), /* @__PURE__ */ h("span", {
|
|
149
149
|
className: "ml-2 text-text-primary capitalize",
|
|
150
|
-
children:
|
|
150
|
+
children: B.type.replace("_", " ").toLowerCase()
|
|
151
151
|
})] }),
|
|
152
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("span", {
|
|
153
153
|
className: "text-text-muted",
|
|
154
154
|
children: "Value:"
|
|
155
|
-
}), /* @__PURE__ */
|
|
155
|
+
}), /* @__PURE__ */ h("span", {
|
|
156
156
|
className: "ml-2 text-text-primary",
|
|
157
|
-
children:
|
|
157
|
+
children: B.type === "PERCENTAGE" ? `${B.value}%` : `$${B.value}`
|
|
158
158
|
})] }),
|
|
159
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("span", {
|
|
160
160
|
className: "text-text-muted",
|
|
161
161
|
children: "Scope:"
|
|
162
|
-
}), /* @__PURE__ */
|
|
162
|
+
}), /* @__PURE__ */ h("span", {
|
|
163
163
|
className: "ml-2 text-text-primary",
|
|
164
|
-
children:
|
|
164
|
+
children: B.scope
|
|
165
165
|
})] }),
|
|
166
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("span", {
|
|
167
167
|
className: "text-text-muted",
|
|
168
168
|
children: "Current Uses:"
|
|
169
|
-
}), /* @__PURE__ */
|
|
169
|
+
}), /* @__PURE__ */ g("span", {
|
|
170
170
|
className: "ml-2 text-text-primary",
|
|
171
|
-
children: [
|
|
171
|
+
children: [B.currentUses, B.maxTotalUses ? ` / ${B.maxTotalUses}` : ""]
|
|
172
172
|
})] }),
|
|
173
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("span", {
|
|
174
174
|
className: "text-text-muted",
|
|
175
175
|
children: "Created:"
|
|
176
|
-
}), /* @__PURE__ */
|
|
176
|
+
}), /* @__PURE__ */ h("span", {
|
|
177
177
|
className: "ml-2 text-text-primary",
|
|
178
|
-
children: new Date(
|
|
178
|
+
children: new Date(B.createdAt).toLocaleDateString()
|
|
179
179
|
})] })
|
|
180
180
|
]
|
|
181
181
|
})]
|
|
182
182
|
}),
|
|
183
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ g("div", {
|
|
184
184
|
className: "bg-bg-surface border border-border-subtle rounded-lg p-6 space-y-6",
|
|
185
185
|
children: [
|
|
186
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ h("h3", {
|
|
187
187
|
className: "text-lg font-semibold text-text-primary",
|
|
188
188
|
children: "Editable Fields"
|
|
189
189
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ g("div", {
|
|
191
191
|
className: "space-y-2",
|
|
192
192
|
children: [
|
|
193
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ g("label", {
|
|
194
194
|
htmlFor: "name",
|
|
195
195
|
className: "block text-sm font-medium text-text-primary",
|
|
196
|
-
children: ["Name ", /* @__PURE__ */
|
|
196
|
+
children: ["Name ", /* @__PURE__ */ h("span", {
|
|
197
197
|
className: "text-status-error-text",
|
|
198
198
|
children: "*"
|
|
199
199
|
})]
|
|
200
200
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ h("input", {
|
|
202
202
|
id: "name",
|
|
203
203
|
type: "text",
|
|
204
|
-
value:
|
|
205
|
-
onChange: (e) =>
|
|
204
|
+
value: k.name,
|
|
205
|
+
onChange: (e) => L("name", e.target.value),
|
|
206
206
|
placeholder: "e.g., Welcome Discount",
|
|
207
207
|
className: "w-full px-4 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
208
208
|
}),
|
|
209
|
-
|
|
209
|
+
j.name && /* @__PURE__ */ h("p", {
|
|
210
210
|
className: "text-sm text-status-error-text",
|
|
211
|
-
children:
|
|
211
|
+
children: j.name
|
|
212
212
|
})
|
|
213
213
|
]
|
|
214
214
|
}),
|
|
215
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ g("div", {
|
|
216
216
|
className: "space-y-2",
|
|
217
|
-
children: [/* @__PURE__ */
|
|
217
|
+
children: [/* @__PURE__ */ h("label", {
|
|
218
218
|
htmlFor: "description",
|
|
219
219
|
className: "block text-sm font-medium text-text-primary",
|
|
220
220
|
children: "Description"
|
|
221
|
-
}), /* @__PURE__ */
|
|
221
|
+
}), /* @__PURE__ */ h("textarea", {
|
|
222
222
|
id: "description",
|
|
223
|
-
value:
|
|
224
|
-
onChange: (e) =>
|
|
223
|
+
value: k.description,
|
|
224
|
+
onChange: (e) => L("description", e.target.value),
|
|
225
225
|
placeholder: "Optional description",
|
|
226
226
|
rows: 3,
|
|
227
227
|
className: "w-full px-4 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] resize-none"
|
|
228
228
|
})]
|
|
229
229
|
}),
|
|
230
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ g("div", {
|
|
231
231
|
className: "space-y-2",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
232
|
+
children: [/* @__PURE__ */ h("label", {
|
|
233
233
|
htmlFor: "status",
|
|
234
234
|
className: "block text-sm font-medium text-text-primary",
|
|
235
235
|
children: "Status"
|
|
236
|
-
}), /* @__PURE__ */
|
|
236
|
+
}), /* @__PURE__ */ g(u, {
|
|
237
237
|
id: "status",
|
|
238
|
-
value:
|
|
239
|
-
onChange: (e) =>
|
|
238
|
+
value: k.status,
|
|
239
|
+
onChange: (e) => L("status", e.target.value),
|
|
240
240
|
className: "w-full px-4 py-2 rounded-input border border-border-subtle 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",
|
|
241
241
|
children: [
|
|
242
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ h("option", {
|
|
243
243
|
value: "ACTIVE",
|
|
244
244
|
children: "Active"
|
|
245
245
|
}),
|
|
246
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ h("option", {
|
|
247
247
|
value: "INACTIVE",
|
|
248
248
|
children: "Inactive"
|
|
249
249
|
}),
|
|
250
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ h("option", {
|
|
251
251
|
value: "EXPIRED",
|
|
252
252
|
children: "Expired"
|
|
253
253
|
}),
|
|
254
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ h("option", {
|
|
255
255
|
value: "DEPLETED",
|
|
256
256
|
children: "Depleted"
|
|
257
257
|
})
|
|
258
258
|
]
|
|
259
259
|
})]
|
|
260
260
|
}),
|
|
261
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ g("div", {
|
|
262
262
|
className: "space-y-2",
|
|
263
263
|
children: [
|
|
264
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ h("label", {
|
|
265
265
|
htmlFor: "maxTotalUses",
|
|
266
266
|
className: "block text-sm font-medium text-text-primary",
|
|
267
267
|
children: "Maximum Total Uses"
|
|
268
268
|
}),
|
|
269
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ h("input", {
|
|
270
270
|
id: "maxTotalUses",
|
|
271
271
|
type: "number",
|
|
272
272
|
min: "1",
|
|
273
|
-
value:
|
|
274
|
-
onChange: (e) =>
|
|
273
|
+
value: k.maxTotalUses,
|
|
274
|
+
onChange: (e) => L("maxTotalUses", e.target.value),
|
|
275
275
|
placeholder: "Leave empty for unlimited",
|
|
276
276
|
className: "w-full px-4 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
277
277
|
}),
|
|
278
|
-
|
|
278
|
+
j.maxTotalUses && /* @__PURE__ */ h("p", {
|
|
279
279
|
className: "text-sm text-status-error-text",
|
|
280
|
-
children:
|
|
280
|
+
children: j.maxTotalUses
|
|
281
281
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ g("p", {
|
|
283
283
|
className: "text-sm text-text-muted",
|
|
284
284
|
children: [
|
|
285
285
|
"Current uses: ",
|
|
286
|
-
|
|
287
|
-
|
|
286
|
+
B.currentUses,
|
|
287
|
+
B.maxTotalUses ? ` / ${B.maxTotalUses}` : ""
|
|
288
288
|
]
|
|
289
289
|
})
|
|
290
290
|
]
|
|
291
291
|
}),
|
|
292
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ g("div", {
|
|
293
293
|
className: "space-y-2",
|
|
294
294
|
children: [
|
|
295
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ h("label", {
|
|
296
296
|
htmlFor: "maxUsesPerUser",
|
|
297
297
|
className: "block text-sm font-medium text-text-primary",
|
|
298
298
|
children: "Maximum Uses Per User"
|
|
299
299
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ h("input", {
|
|
301
301
|
id: "maxUsesPerUser",
|
|
302
302
|
type: "number",
|
|
303
303
|
min: "1",
|
|
304
|
-
value:
|
|
305
|
-
onChange: (e) =>
|
|
304
|
+
value: k.maxUsesPerUser,
|
|
305
|
+
onChange: (e) => L("maxUsesPerUser", e.target.value),
|
|
306
306
|
placeholder: "e.g., 1",
|
|
307
307
|
className: "w-full px-4 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
308
308
|
}),
|
|
309
|
-
|
|
309
|
+
j.maxUsesPerUser && /* @__PURE__ */ h("p", {
|
|
310
310
|
className: "text-sm text-status-error-text",
|
|
311
|
-
children:
|
|
311
|
+
children: j.maxUsesPerUser
|
|
312
312
|
})
|
|
313
313
|
]
|
|
314
314
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ g("div", {
|
|
316
316
|
className: "space-y-2",
|
|
317
317
|
children: [
|
|
318
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ h("label", {
|
|
319
319
|
htmlFor: "validUntil",
|
|
320
320
|
className: "block text-sm font-medium text-text-primary",
|
|
321
321
|
children: "Valid Until"
|
|
322
322
|
}),
|
|
323
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ h("input", {
|
|
324
324
|
id: "validUntil",
|
|
325
325
|
type: "date",
|
|
326
|
-
value:
|
|
327
|
-
onChange: (e) =>
|
|
326
|
+
value: k.validUntil,
|
|
327
|
+
onChange: (e) => L("validUntil", e.target.value),
|
|
328
328
|
className: "w-full px-4 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
329
329
|
}),
|
|
330
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ h("p", {
|
|
331
331
|
className: "text-sm text-text-muted",
|
|
332
332
|
children: "Leave empty for no expiration"
|
|
333
333
|
})
|
|
@@ -335,42 +335,42 @@ var _ = () => {
|
|
|
335
335
|
})
|
|
336
336
|
]
|
|
337
337
|
}),
|
|
338
|
-
|
|
338
|
+
N && /* @__PURE__ */ g("div", {
|
|
339
339
|
className: "flex items-start gap-3 p-4 rounded-lg bg-status-error-bg-subtle border border-status-error-border",
|
|
340
|
-
children: [/* @__PURE__ */
|
|
340
|
+
children: [/* @__PURE__ */ h(d, { className: "size-5 text-status-error-text mt-0.5" }), /* @__PURE__ */ g("div", {
|
|
341
341
|
className: "flex-1",
|
|
342
|
-
children: [/* @__PURE__ */
|
|
342
|
+
children: [/* @__PURE__ */ h("p", {
|
|
343
343
|
className: "text-sm font-medium text-status-error-text",
|
|
344
344
|
children: "Error"
|
|
345
|
-
}), /* @__PURE__ */
|
|
345
|
+
}), /* @__PURE__ */ h("p", {
|
|
346
346
|
className: "text-sm text-status-error-text/90 mt-1",
|
|
347
|
-
children:
|
|
347
|
+
children: N
|
|
348
348
|
})]
|
|
349
349
|
})]
|
|
350
350
|
}),
|
|
351
|
-
|
|
351
|
+
F && /* @__PURE__ */ g("div", {
|
|
352
352
|
className: "flex items-start gap-3 p-4 rounded-lg bg-status-success-bg-subtle border border-status-success-bg-subtle",
|
|
353
|
-
children: [/* @__PURE__ */
|
|
353
|
+
children: [/* @__PURE__ */ h(p, { className: "size-5 text-status-success-text mt-0.5" }), /* @__PURE__ */ g("div", {
|
|
354
354
|
className: "flex-1",
|
|
355
|
-
children: [/* @__PURE__ */
|
|
355
|
+
children: [/* @__PURE__ */ h("p", {
|
|
356
356
|
className: "text-sm font-medium text-status-success-text",
|
|
357
357
|
children: "Success"
|
|
358
|
-
}), /* @__PURE__ */
|
|
358
|
+
}), /* @__PURE__ */ h("p", {
|
|
359
359
|
className: "text-sm text-status-success-text/90 mt-1",
|
|
360
360
|
children: "Coupon updated successfully! Redirecting…"
|
|
361
361
|
})]
|
|
362
362
|
})]
|
|
363
363
|
}),
|
|
364
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ g("div", {
|
|
365
365
|
className: "flex gap-4 pt-4 border-t border-border-subtle",
|
|
366
|
-
children: [/* @__PURE__ */
|
|
366
|
+
children: [/* @__PURE__ */ g("button", {
|
|
367
367
|
type: "submit",
|
|
368
|
-
disabled:
|
|
368
|
+
disabled: O || F,
|
|
369
369
|
className: "px-6 py-2 rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bgHover disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",
|
|
370
|
-
children: [/* @__PURE__ */ m
|
|
371
|
-
}), /* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ h(m, { className: "size-4" }), O ? "Updating..." : "Update Coupon"]
|
|
371
|
+
}), /* @__PURE__ */ h("button", {
|
|
372
372
|
type: "button",
|
|
373
|
-
onClick: () =>
|
|
373
|
+
onClick: () => b("/coupons"),
|
|
374
374
|
className: "px-6 py-2 rounded-lg border border-border-subtle text-text-primary hover:bg-bg-sunken",
|
|
375
375
|
children: "Cancel"
|
|
376
376
|
})]
|
|
@@ -381,6 +381,6 @@ var _ = () => {
|
|
|
381
381
|
]
|
|
382
382
|
});
|
|
383
383
|
};
|
|
384
|
-
export {
|
|
384
|
+
export { v as EditCouponPage };
|
|
385
385
|
|
|
386
386
|
//# sourceMappingURL=EditCouponPage.js.map
|