@burdenoff/microfe-billing 2026.1115.2 → 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/checkout/pages/CheckoutPage.js +1 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.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 +175 -171
- 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,45 +11,45 @@ import "../../../shared/utils/index.js";
|
|
|
11
11
|
import { useRefunds as c } from "../hooks/useRefunds.js";
|
|
12
12
|
import { statusTokens as l } from "../../../shared/utils/tokens.js";
|
|
13
13
|
import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
14
|
-
import { CTAOverflowMenu as h, IllustratedEmptyState as g, PagePurpose as _, ResponsiveTable as v } from "@burdenoff/fe-libs/ui";
|
|
15
|
-
import { AlertTriangle as
|
|
16
|
-
import { Link as
|
|
17
|
-
import { Fragment as
|
|
18
|
-
import { useI18n as
|
|
19
|
-
import { useApolloClient as
|
|
14
|
+
import { CTAOverflowMenu as h, IllustratedEmptyState as g, PagePurpose as _, ResponsiveTable as v, ThemedSelect as y } from "@burdenoff/fe-libs/ui";
|
|
15
|
+
import { AlertTriangle as b, Ban as x, CheckCircle as S, ChevronLeft as C, ChevronRight as w, Clock as T, Download as ee, Eye as E, Filter as te, Loader2 as D, MoreHorizontal as O, Play as k, Plus as ne, RefreshCw as re, RotateCcw as A, Search as j, SkipForward as M, X as N, XCircle as P } from "lucide-react";
|
|
16
|
+
import { Link as ie } from "react-router";
|
|
17
|
+
import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
18
|
+
import { useI18n as ae } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
19
|
+
import { useApolloClient as R } from "@apollo/client/react";
|
|
20
20
|
// src/billing/modules/billing/pages/RefundsPage.tsx
|
|
21
|
-
var
|
|
21
|
+
var z = {
|
|
22
22
|
PENDING: {
|
|
23
23
|
label: "Pending",
|
|
24
24
|
color: "yellow",
|
|
25
|
-
icon:
|
|
25
|
+
icon: T
|
|
26
26
|
},
|
|
27
27
|
PROCESSING: {
|
|
28
28
|
label: "Processing",
|
|
29
29
|
color: "blue",
|
|
30
|
-
icon:
|
|
30
|
+
icon: D
|
|
31
31
|
},
|
|
32
32
|
COMPLETED: {
|
|
33
33
|
label: "Completed",
|
|
34
34
|
color: "green",
|
|
35
|
-
icon:
|
|
35
|
+
icon: S
|
|
36
36
|
},
|
|
37
37
|
FAILED: {
|
|
38
38
|
label: "Failed",
|
|
39
39
|
color: "red",
|
|
40
|
-
icon:
|
|
40
|
+
icon: P
|
|
41
41
|
},
|
|
42
42
|
SKIPPED: {
|
|
43
43
|
label: "Skipped",
|
|
44
44
|
color: "gray",
|
|
45
|
-
icon:
|
|
45
|
+
icon: x
|
|
46
46
|
}
|
|
47
|
-
},
|
|
47
|
+
}, B = {
|
|
48
48
|
MANUAL: "Manual",
|
|
49
49
|
WEBHOOK_RECOVERY: "Webhook Recovery",
|
|
50
50
|
SUBSCRIPTION_CANCEL: "Subscription Cancel",
|
|
51
51
|
DUPLICATE_PAYMENT: "Duplicate Payment"
|
|
52
|
-
},
|
|
52
|
+
}, oe = ["stripe", "razorpay"], V = (e) => {
|
|
53
53
|
let t = {
|
|
54
54
|
yellow: `${l.warning.bg} ${l.warning.text}`,
|
|
55
55
|
blue: `${l.info.bg} ${l.info.text}`,
|
|
@@ -58,7 +58,7 @@ var I = {
|
|
|
58
58
|
gray: `${l.neutral.bg} ${l.neutral.text}`
|
|
59
59
|
};
|
|
60
60
|
return t[e] || t.gray;
|
|
61
|
-
},
|
|
61
|
+
}, se = ({ record: e, onViewDetails: t, onProcess: n, onSkip: r, onRetry: i, isProcessing: a }) => {
|
|
62
62
|
let [o, s] = m(!1), c = p(null);
|
|
63
63
|
d(() => {
|
|
64
64
|
let e = (e) => {
|
|
@@ -67,65 +67,65 @@ var I = {
|
|
|
67
67
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
68
68
|
}, []);
|
|
69
69
|
let u = e.status === "PENDING", f = e.status === "PENDING", h = e.status === "FAILED";
|
|
70
|
-
return /* @__PURE__ */
|
|
70
|
+
return /* @__PURE__ */ L("div", {
|
|
71
71
|
className: "relative",
|
|
72
72
|
ref: c,
|
|
73
|
-
children: [/* @__PURE__ */
|
|
73
|
+
children: [/* @__PURE__ */ I("button", {
|
|
74
74
|
type: "button",
|
|
75
75
|
onClick: () => s(!o),
|
|
76
76
|
disabled: a,
|
|
77
77
|
className: "p-1.5 rounded-md hover:bg-bg-sunken/50 transition-colors disabled:opacity-50",
|
|
78
78
|
"aria-label": "Refund actions",
|
|
79
|
-
children: a ? /* @__PURE__ */
|
|
80
|
-
}), o && /* @__PURE__ */
|
|
79
|
+
children: a ? /* @__PURE__ */ I(D, { className: "size-4 animate-spin text-text-muted" }) : /* @__PURE__ */ I(O, { className: "size-4 text-text-muted" })
|
|
80
|
+
}), o && /* @__PURE__ */ L("div", {
|
|
81
81
|
className: "absolute right-0 top-full mt-1 z-50 min-w-[160px] bg-bg-elevated border border-border-subtle rounded-input shadow-[var(--shadow-elevation-3)] py-1",
|
|
82
82
|
children: [
|
|
83
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ L("button", {
|
|
84
84
|
type: "button",
|
|
85
85
|
onClick: () => {
|
|
86
86
|
t(), s(!1);
|
|
87
87
|
},
|
|
88
88
|
className: "w-full flex items-center gap-2 px-3 py-2 text-sm text-text-primary hover:bg-bg-sunken/50 transition-colors",
|
|
89
|
-
children: [/* @__PURE__ */
|
|
89
|
+
children: [/* @__PURE__ */ I(E, { className: "size-4" }), "View Details"]
|
|
90
90
|
}),
|
|
91
|
-
u && /* @__PURE__ */
|
|
91
|
+
u && /* @__PURE__ */ L("button", {
|
|
92
92
|
type: "button",
|
|
93
93
|
onClick: () => {
|
|
94
94
|
n(), s(!1);
|
|
95
95
|
},
|
|
96
96
|
className: `w-full flex items-center gap-2 px-3 py-2 text-sm ${l.success.text} hover:bg-bg-sunken/50 transition-colors`,
|
|
97
|
-
children: [/* @__PURE__ */
|
|
97
|
+
children: [/* @__PURE__ */ I(k, { className: "size-4" }), "Process Refund"]
|
|
98
98
|
}),
|
|
99
|
-
f && /* @__PURE__ */
|
|
99
|
+
f && /* @__PURE__ */ L("button", {
|
|
100
100
|
type: "button",
|
|
101
101
|
onClick: () => {
|
|
102
102
|
r(), s(!1);
|
|
103
103
|
},
|
|
104
104
|
className: `w-full flex items-center gap-2 px-3 py-2 text-sm ${l.warning.text} hover:bg-bg-sunken/50 transition-colors`,
|
|
105
|
-
children: [/* @__PURE__ */
|
|
105
|
+
children: [/* @__PURE__ */ I(M, { className: "size-4" }), "Skip Refund"]
|
|
106
106
|
}),
|
|
107
|
-
h && /* @__PURE__ */
|
|
107
|
+
h && /* @__PURE__ */ L("button", {
|
|
108
108
|
type: "button",
|
|
109
109
|
onClick: () => {
|
|
110
110
|
i(), s(!1);
|
|
111
111
|
},
|
|
112
112
|
className: `w-full flex items-center gap-2 px-3 py-2 text-sm ${l.info.text} hover:bg-bg-sunken/50 transition-colors`,
|
|
113
|
-
children: [/* @__PURE__ */
|
|
113
|
+
children: [/* @__PURE__ */ I(A, { className: "size-4" }), "Retry Refund"]
|
|
114
114
|
})
|
|
115
115
|
]
|
|
116
116
|
})]
|
|
117
117
|
});
|
|
118
|
-
},
|
|
118
|
+
}, H = {
|
|
119
119
|
provider: "stripe",
|
|
120
120
|
gatewayPaymentId: "",
|
|
121
121
|
amount: 0,
|
|
122
122
|
currency: "USD"
|
|
123
|
-
},
|
|
124
|
-
let o =
|
|
125
|
-
c(""), d(null), p(null), v(
|
|
123
|
+
}, ce = ({ isOpen: e, onClose: t, onSubmit: n, isSubmitting: r }) => {
|
|
124
|
+
let o = R(), [s, c] = m(""), [l, d] = m(null), [f, p] = m(null), [h, g] = m(!1), [_, v] = m(H), y = () => {
|
|
125
|
+
c(""), d(null), p(null), v(H);
|
|
126
126
|
}, b = () => {
|
|
127
127
|
y(), t();
|
|
128
|
-
},
|
|
128
|
+
}, x = u(async (e) => {
|
|
129
129
|
let t = e.trim();
|
|
130
130
|
if (t) {
|
|
131
131
|
g(!0), p(null), d(null);
|
|
@@ -136,7 +136,7 @@ var I = {
|
|
|
136
136
|
fetchPolicy: "network-only"
|
|
137
137
|
}), n = e?.getTransaction ?? null;
|
|
138
138
|
if (!n) {
|
|
139
|
-
p("Transaction not found. Check the ID and try again."), v(
|
|
139
|
+
p("Transaction not found. Check the ID and try again."), v(H);
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
142
|
let r = n.metadata, a = typeof r?.total == "number" ? r.total : n.amount, s = {
|
|
@@ -164,189 +164,189 @@ var I = {
|
|
|
164
164
|
notes: ""
|
|
165
165
|
});
|
|
166
166
|
} catch {
|
|
167
|
-
p("Failed to look up transaction. Ensure the ID is correct."), v(
|
|
167
|
+
p("Failed to look up transaction. Ensure the ID is correct."), v(H);
|
|
168
168
|
} finally {
|
|
169
169
|
g(!1);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
}, [o]),
|
|
172
|
+
}, [o]), C = async (e) => {
|
|
173
173
|
e.preventDefault(), await n(_), y();
|
|
174
174
|
};
|
|
175
175
|
if (!e) return null;
|
|
176
|
-
let
|
|
177
|
-
return /* @__PURE__ */
|
|
176
|
+
let w = l?.totalAmount ?? void 0, T = w !== void 0 && _.amount > w + .01;
|
|
177
|
+
return /* @__PURE__ */ L("div", {
|
|
178
178
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
179
|
-
children: [/* @__PURE__ */
|
|
179
|
+
children: [/* @__PURE__ */ I("div", {
|
|
180
180
|
className: "absolute inset-0 bg-overlay-scrim",
|
|
181
181
|
onClick: b
|
|
182
|
-
}), /* @__PURE__ */
|
|
182
|
+
}), /* @__PURE__ */ L("div", {
|
|
183
183
|
className: "relative bg-bg-elevated border border-border-seam rounded-card shadow-[var(--shadow-elevation-4)] max-w-lg w-full mx-4 max-h-[90vh] overflow-auto",
|
|
184
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ L("div", {
|
|
185
185
|
className: "flex items-center justify-between p-4 border-b border-border-subtle",
|
|
186
|
-
children: [/* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ I("h2", {
|
|
187
187
|
className: "text-lg font-semibold",
|
|
188
188
|
children: "Create Manual Refund"
|
|
189
|
-
}), /* @__PURE__ */
|
|
189
|
+
}), /* @__PURE__ */ I("button", {
|
|
190
190
|
type: "button",
|
|
191
191
|
onClick: b,
|
|
192
192
|
className: "p-1 rounded-md hover:bg-bg-sunken/50 transition-colors",
|
|
193
|
-
children: /* @__PURE__ */
|
|
193
|
+
children: /* @__PURE__ */ I(N, { className: "size-5" })
|
|
194
194
|
})]
|
|
195
|
-
}), /* @__PURE__ */
|
|
196
|
-
onSubmit:
|
|
195
|
+
}), /* @__PURE__ */ L("form", {
|
|
196
|
+
onSubmit: C,
|
|
197
197
|
className: "p-4 space-y-4",
|
|
198
198
|
children: [
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ L("div", { children: [
|
|
200
|
+
/* @__PURE__ */ I("label", {
|
|
201
201
|
className: "block text-sm font-medium mb-1",
|
|
202
202
|
children: "Transaction ID *"
|
|
203
203
|
}),
|
|
204
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ L("div", {
|
|
205
205
|
className: "flex gap-2",
|
|
206
|
-
children: [/* @__PURE__ */
|
|
206
|
+
children: [/* @__PURE__ */ I("input", {
|
|
207
207
|
type: "text",
|
|
208
208
|
value: s,
|
|
209
209
|
onChange: (e) => {
|
|
210
210
|
c(e.target.value), d(null), p(null);
|
|
211
211
|
},
|
|
212
|
-
onBlur: () =>
|
|
212
|
+
onBlur: () => x(s),
|
|
213
213
|
className: "flex-1 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)]",
|
|
214
214
|
placeholder: "Paste transaction UUID...",
|
|
215
215
|
required: !0
|
|
216
|
-
}), /* @__PURE__ */
|
|
216
|
+
}), /* @__PURE__ */ I("button", {
|
|
217
217
|
type: "button",
|
|
218
|
-
onClick: () =>
|
|
218
|
+
onClick: () => x(s),
|
|
219
219
|
disabled: !s.trim() || h,
|
|
220
220
|
className: "px-3 py-2 border border-border-subtle rounded-md hover:bg-bg-sunken/50 transition-colors disabled:opacity-50 flex items-center gap-1 text-sm",
|
|
221
|
-
children: h ? /* @__PURE__ */
|
|
221
|
+
children: h ? /* @__PURE__ */ I(D, { className: "size-4 animate-spin" }) : /* @__PURE__ */ I(j, { className: "size-4" })
|
|
222
222
|
})]
|
|
223
223
|
}),
|
|
224
|
-
f && /* @__PURE__ */
|
|
224
|
+
f && /* @__PURE__ */ I("p", {
|
|
225
225
|
className: "text-xs text-status-error-text mt-1",
|
|
226
226
|
children: f
|
|
227
227
|
}),
|
|
228
|
-
h && /* @__PURE__ */
|
|
228
|
+
h && /* @__PURE__ */ I("p", {
|
|
229
229
|
className: "text-xs text-text-muted mt-1",
|
|
230
230
|
children: "Looking up transaction…"
|
|
231
231
|
})
|
|
232
232
|
] }),
|
|
233
|
-
l && /* @__PURE__ */ F
|
|
234
|
-
/* @__PURE__ */
|
|
233
|
+
l && /* @__PURE__ */ L(F, { children: [
|
|
234
|
+
/* @__PURE__ */ L("div", {
|
|
235
235
|
className: "p-3 bg-status-success-bg-subtle border border-border-subtle rounded-md text-sm space-y-1",
|
|
236
|
-
children: [/* @__PURE__ */
|
|
236
|
+
children: [/* @__PURE__ */ L("div", {
|
|
237
237
|
className: "flex items-center gap-2 text-status-success-text font-medium",
|
|
238
|
-
children: [/* @__PURE__ */
|
|
239
|
-
}), /* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ I(S, { className: "size-4" }), "Transaction found"]
|
|
239
|
+
}), /* @__PURE__ */ L("div", {
|
|
240
240
|
className: "text-text-muted grid grid-cols-2 gap-x-4 gap-y-0.5 mt-1",
|
|
241
241
|
children: [
|
|
242
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ L("span", { children: [
|
|
243
243
|
"Account:",
|
|
244
244
|
" ",
|
|
245
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ L("span", {
|
|
246
246
|
className: "text-text-primary font-mono text-xs",
|
|
247
247
|
children: [l.billingAccountId.slice(0, 16), "…"]
|
|
248
248
|
})
|
|
249
249
|
] }),
|
|
250
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ L("span", { children: [
|
|
251
251
|
"Paid:",
|
|
252
252
|
" ",
|
|
253
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ I("span", {
|
|
254
254
|
className: "text-text-primary",
|
|
255
255
|
children: a(l.totalAmount, l.currency)
|
|
256
256
|
})
|
|
257
257
|
] }),
|
|
258
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ L("span", { children: [
|
|
259
259
|
"Provider:",
|
|
260
260
|
" ",
|
|
261
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ I("span", {
|
|
262
262
|
className: "text-text-primary capitalize",
|
|
263
263
|
children: _.provider
|
|
264
264
|
})
|
|
265
265
|
] }),
|
|
266
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ L("span", { children: ["Currency: ", /* @__PURE__ */ I("span", {
|
|
267
267
|
className: "text-text-primary",
|
|
268
268
|
children: l.currency
|
|
269
269
|
})] })
|
|
270
270
|
]
|
|
271
271
|
})]
|
|
272
272
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ L("div", {
|
|
274
274
|
className: "grid grid-cols-2 gap-3",
|
|
275
|
-
children: [/* @__PURE__ */
|
|
275
|
+
children: [/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("label", {
|
|
276
276
|
className: "block text-xs font-medium text-text-muted mb-1",
|
|
277
277
|
children: "Provider"
|
|
278
|
-
}), /* @__PURE__ */
|
|
278
|
+
}), /* @__PURE__ */ I("div", {
|
|
279
279
|
className: "px-3 py-2 border border-border-subtle rounded-md bg-bg-sunken/30 text-sm capitalize",
|
|
280
280
|
children: _.provider
|
|
281
|
-
})] }), /* @__PURE__ */
|
|
281
|
+
})] }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("label", {
|
|
282
282
|
className: "block text-xs font-medium text-text-muted mb-1",
|
|
283
283
|
children: "Currency"
|
|
284
|
-
}), /* @__PURE__ */
|
|
284
|
+
}), /* @__PURE__ */ I("div", {
|
|
285
285
|
className: "px-3 py-2 border border-border-subtle rounded-md bg-bg-sunken/30 text-sm",
|
|
286
286
|
children: _.currency
|
|
287
287
|
})] })]
|
|
288
288
|
}),
|
|
289
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("label", {
|
|
290
290
|
className: "block text-xs font-medium text-text-muted mb-1",
|
|
291
291
|
children: "Gateway Payment ID"
|
|
292
|
-
}), /* @__PURE__ */
|
|
292
|
+
}), /* @__PURE__ */ I("div", {
|
|
293
293
|
className: "px-3 py-2 border border-border-subtle rounded-md bg-bg-sunken/30 text-sm font-mono truncate",
|
|
294
294
|
children: _.gatewayPaymentId
|
|
295
295
|
})] }),
|
|
296
|
-
_.purchaseType && /* @__PURE__ */
|
|
296
|
+
_.purchaseType && /* @__PURE__ */ L("div", {
|
|
297
297
|
className: "grid grid-cols-2 gap-3",
|
|
298
|
-
children: [/* @__PURE__ */
|
|
298
|
+
children: [/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("label", {
|
|
299
299
|
className: "block text-xs font-medium text-text-muted mb-1",
|
|
300
300
|
children: "Purchase Type"
|
|
301
|
-
}), /* @__PURE__ */
|
|
301
|
+
}), /* @__PURE__ */ I("div", {
|
|
302
302
|
className: "px-3 py-2 border border-border-subtle rounded-md bg-bg-sunken/30 text-sm",
|
|
303
303
|
children: _.purchaseType
|
|
304
|
-
})] }), /* @__PURE__ */
|
|
304
|
+
})] }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("label", {
|
|
305
305
|
className: "block text-xs font-medium text-text-muted mb-1",
|
|
306
306
|
children: "Purchase Detail"
|
|
307
|
-
}), /* @__PURE__ */
|
|
307
|
+
}), /* @__PURE__ */ I("div", {
|
|
308
308
|
className: "px-3 py-2 border border-border-subtle rounded-md bg-bg-sunken/30 text-sm truncate",
|
|
309
309
|
children: _.purchaseDetail || "—"
|
|
310
310
|
})] })]
|
|
311
311
|
}),
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ L("div", { children: [
|
|
313
|
+
/* @__PURE__ */ L("label", {
|
|
314
314
|
className: "block text-sm font-medium mb-1",
|
|
315
|
-
children: ["Refund Amount *", /* @__PURE__ */
|
|
315
|
+
children: ["Refund Amount *", /* @__PURE__ */ L("span", {
|
|
316
316
|
className: "text-xs text-text-muted ml-1",
|
|
317
317
|
children: [
|
|
318
318
|
"(max ",
|
|
319
|
-
a(
|
|
319
|
+
a(w, _.currency),
|
|
320
320
|
")"
|
|
321
321
|
]
|
|
322
322
|
})]
|
|
323
323
|
}),
|
|
324
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ I("input", {
|
|
325
325
|
type: "number",
|
|
326
326
|
step: "0.01",
|
|
327
327
|
min: "0.01",
|
|
328
|
-
max:
|
|
328
|
+
max: w,
|
|
329
329
|
value: _.amount,
|
|
330
330
|
onChange: (e) => v({
|
|
331
331
|
..._,
|
|
332
332
|
amount: parseFloat(e.target.value) || 0
|
|
333
333
|
}),
|
|
334
|
-
className: `w-full px-3 py-2 border rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] ${
|
|
334
|
+
className: `w-full px-3 py-2 border rounded-input bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] ${T ? "border-status-error-text" : "border-border-subtle"}`,
|
|
335
335
|
required: !0
|
|
336
336
|
}),
|
|
337
|
-
|
|
337
|
+
T && /* @__PURE__ */ L("p", {
|
|
338
338
|
className: "text-xs text-status-error-text mt-1",
|
|
339
339
|
children: [
|
|
340
340
|
"Amount cannot exceed the original payment of",
|
|
341
341
|
" ",
|
|
342
|
-
a(
|
|
342
|
+
a(w, _.currency)
|
|
343
343
|
]
|
|
344
344
|
})
|
|
345
345
|
] }),
|
|
346
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("label", {
|
|
347
347
|
className: "block text-sm font-medium mb-1",
|
|
348
348
|
children: "Reason"
|
|
349
|
-
}), /* @__PURE__ */
|
|
349
|
+
}), /* @__PURE__ */ I("input", {
|
|
350
350
|
type: "text",
|
|
351
351
|
value: _.reason || "",
|
|
352
352
|
onChange: (e) => v({
|
|
@@ -356,10 +356,10 @@ var I = {
|
|
|
356
356
|
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)]",
|
|
357
357
|
placeholder: "Reason for refund"
|
|
358
358
|
})] }),
|
|
359
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("label", {
|
|
360
360
|
className: "block text-sm font-medium mb-1",
|
|
361
361
|
children: "Notes"
|
|
362
|
-
}), /* @__PURE__ */
|
|
362
|
+
}), /* @__PURE__ */ I("textarea", {
|
|
363
363
|
value: _.notes || "",
|
|
364
364
|
onChange: (e) => v({
|
|
365
365
|
..._,
|
|
@@ -370,67 +370,67 @@ var I = {
|
|
|
370
370
|
placeholder: "Internal notes"
|
|
371
371
|
})] })
|
|
372
372
|
] }),
|
|
373
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ L("div", {
|
|
374
374
|
className: "flex gap-2 pt-2",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
375
|
+
children: [/* @__PURE__ */ I("button", {
|
|
376
376
|
type: "button",
|
|
377
377
|
onClick: b,
|
|
378
378
|
className: "flex-1 py-2 px-4 border border-border-subtle rounded-md hover:bg-bg-sunken/50 transition-colors",
|
|
379
379
|
children: "Cancel"
|
|
380
|
-
}), /* @__PURE__ */
|
|
380
|
+
}), /* @__PURE__ */ L("button", {
|
|
381
381
|
type: "submit",
|
|
382
|
-
disabled: r || !l || !_.gatewayPaymentId || _.amount <= 0 ||
|
|
382
|
+
disabled: r || !l || !_.gatewayPaymentId || _.amount <= 0 || T,
|
|
383
383
|
className: "flex-1 py-2 px-4 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bgHover transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",
|
|
384
|
-
children: [r && /* @__PURE__ */
|
|
384
|
+
children: [r && /* @__PURE__ */ I(D, { className: "size-4 animate-spin" }), "Create Refund"]
|
|
385
385
|
})]
|
|
386
386
|
})
|
|
387
387
|
]
|
|
388
388
|
})]
|
|
389
389
|
})]
|
|
390
390
|
});
|
|
391
|
-
},
|
|
391
|
+
}, le = ({ isOpen: e, record: t, onClose: n, onSubmit: r, isSubmitting: i }) => {
|
|
392
392
|
let [o, s] = m("");
|
|
393
|
-
return !e || !t ? null : /* @__PURE__ */
|
|
393
|
+
return !e || !t ? null : /* @__PURE__ */ L("div", {
|
|
394
394
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
395
|
-
children: [/* @__PURE__ */
|
|
395
|
+
children: [/* @__PURE__ */ I("div", {
|
|
396
396
|
className: "absolute inset-0 bg-overlay-scrim",
|
|
397
397
|
onClick: n
|
|
398
|
-
}), /* @__PURE__ */
|
|
398
|
+
}), /* @__PURE__ */ L("div", {
|
|
399
399
|
className: "relative bg-bg-elevated border border-border-seam rounded-card shadow-[var(--shadow-elevation-4)] max-w-md w-full mx-4",
|
|
400
|
-
children: [/* @__PURE__ */
|
|
400
|
+
children: [/* @__PURE__ */ L("div", {
|
|
401
401
|
className: "flex items-center justify-between p-4 border-b border-border-subtle",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
402
|
+
children: [/* @__PURE__ */ I("h2", {
|
|
403
403
|
className: "text-lg font-semibold",
|
|
404
404
|
children: "Skip Refund"
|
|
405
|
-
}), /* @__PURE__ */
|
|
405
|
+
}), /* @__PURE__ */ I("button", {
|
|
406
406
|
type: "button",
|
|
407
407
|
onClick: n,
|
|
408
408
|
className: "p-1 rounded-md hover:bg-bg-sunken/50 transition-colors",
|
|
409
|
-
children: /* @__PURE__ */
|
|
409
|
+
children: /* @__PURE__ */ I(N, { className: "size-5" })
|
|
410
410
|
})]
|
|
411
|
-
}), /* @__PURE__ */
|
|
411
|
+
}), /* @__PURE__ */ L("form", {
|
|
412
412
|
onSubmit: async (e) => {
|
|
413
413
|
e.preventDefault(), await r(o), s("");
|
|
414
414
|
},
|
|
415
415
|
className: "p-4 space-y-4",
|
|
416
416
|
children: [
|
|
417
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ I("div", {
|
|
418
418
|
className: `p-3 ${l.warning.bg} border ${l.warning.border} rounded-md`,
|
|
419
|
-
children: /* @__PURE__ */
|
|
419
|
+
children: /* @__PURE__ */ L("div", {
|
|
420
420
|
className: "flex items-start gap-2",
|
|
421
|
-
children: [/* @__PURE__ */
|
|
421
|
+
children: [/* @__PURE__ */ I(b, { className: `size-5 ${l.warning.icon} mt-0.5` }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
422
422
|
className: `text-sm font-medium ${l.warning.text}`,
|
|
423
423
|
children: "You are about to skip this refund"
|
|
424
|
-
}), /* @__PURE__ */
|
|
424
|
+
}), /* @__PURE__ */ L("p", {
|
|
425
425
|
className: `text-sm ${l.warning.text} mt-1`,
|
|
426
426
|
children: ["Amount: ", a(t.amount, t.currency)]
|
|
427
427
|
})] })]
|
|
428
428
|
})
|
|
429
429
|
}),
|
|
430
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("label", {
|
|
431
431
|
className: "block text-sm font-medium mb-1",
|
|
432
432
|
children: "Reason for skipping *"
|
|
433
|
-
}), /* @__PURE__ */
|
|
433
|
+
}), /* @__PURE__ */ I("textarea", {
|
|
434
434
|
value: o,
|
|
435
435
|
onChange: (e) => s(e.target.value),
|
|
436
436
|
className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface resize-none",
|
|
@@ -438,180 +438,180 @@ var I = {
|
|
|
438
438
|
placeholder: "Explain why this refund is being skipped...",
|
|
439
439
|
required: !0
|
|
440
440
|
})] }),
|
|
441
|
-
/* @__PURE__ */
|
|
441
|
+
/* @__PURE__ */ L("div", {
|
|
442
442
|
className: "flex gap-2",
|
|
443
|
-
children: [/* @__PURE__ */
|
|
443
|
+
children: [/* @__PURE__ */ I("button", {
|
|
444
444
|
type: "button",
|
|
445
445
|
onClick: n,
|
|
446
446
|
className: "flex-1 py-2 px-4 border border-border-subtle rounded-md hover:bg-bg-sunken/50 transition-colors",
|
|
447
447
|
children: "Cancel"
|
|
448
|
-
}), /* @__PURE__ */
|
|
448
|
+
}), /* @__PURE__ */ L("button", {
|
|
449
449
|
type: "submit",
|
|
450
450
|
disabled: i || !o.trim(),
|
|
451
451
|
className: `flex-1 py-2 px-4 ${l.warning.dot} text-action-primary-text rounded-md hover:opacity-90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2`,
|
|
452
|
-
children: [i && /* @__PURE__ */
|
|
452
|
+
children: [i && /* @__PURE__ */ I(D, { className: "size-4 animate-spin" }), "Skip Refund"]
|
|
453
453
|
})]
|
|
454
454
|
})
|
|
455
455
|
]
|
|
456
456
|
})]
|
|
457
457
|
})]
|
|
458
458
|
});
|
|
459
|
-
},
|
|
459
|
+
}, ue = ({ record: e, onClose: t }) => {
|
|
460
460
|
if (!e) return null;
|
|
461
|
-
let n =
|
|
462
|
-
return /* @__PURE__ */
|
|
461
|
+
let n = z[e.status].icon;
|
|
462
|
+
return /* @__PURE__ */ L("div", {
|
|
463
463
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
464
|
-
children: [/* @__PURE__ */
|
|
464
|
+
children: [/* @__PURE__ */ I("div", {
|
|
465
465
|
className: "absolute inset-0 bg-overlay-scrim",
|
|
466
466
|
onClick: t
|
|
467
|
-
}), /* @__PURE__ */
|
|
467
|
+
}), /* @__PURE__ */ L("div", {
|
|
468
468
|
className: "relative bg-bg-elevated border border-border-seam rounded-card shadow-[var(--shadow-elevation-4)] max-w-lg w-full mx-4 max-h-[90vh] overflow-auto",
|
|
469
469
|
children: [
|
|
470
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ L("div", {
|
|
471
471
|
className: "flex items-center justify-between p-4 border-b border-border-subtle",
|
|
472
|
-
children: [/* @__PURE__ */
|
|
472
|
+
children: [/* @__PURE__ */ I("h2", {
|
|
473
473
|
className: "text-lg font-semibold",
|
|
474
474
|
children: "Refund Details"
|
|
475
|
-
}), /* @__PURE__ */
|
|
475
|
+
}), /* @__PURE__ */ I("button", {
|
|
476
476
|
type: "button",
|
|
477
477
|
onClick: t,
|
|
478
478
|
className: "p-1 rounded-md hover:bg-bg-sunken/50 transition-colors",
|
|
479
|
-
children: /* @__PURE__ */
|
|
479
|
+
children: /* @__PURE__ */ I(N, { className: "size-5" })
|
|
480
480
|
})]
|
|
481
481
|
}),
|
|
482
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ L("div", {
|
|
483
483
|
className: "p-4 space-y-4",
|
|
484
484
|
children: [
|
|
485
|
-
/* @__PURE__ */
|
|
486
|
-
className: `flex items-center gap-2 p-3 rounded-md ${
|
|
487
|
-
children: [/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ L("div", {
|
|
486
|
+
className: `flex items-center gap-2 p-3 rounded-md ${V(z[e.status].color)}`,
|
|
487
|
+
children: [/* @__PURE__ */ I(n, { className: "size-5" }), /* @__PURE__ */ I("span", {
|
|
488
488
|
className: "font-medium",
|
|
489
|
-
children:
|
|
489
|
+
children: z[e.status].label
|
|
490
490
|
})]
|
|
491
491
|
}),
|
|
492
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ L("div", {
|
|
493
493
|
className: "grid grid-cols-2 gap-4",
|
|
494
|
-
children: [/* @__PURE__ */
|
|
494
|
+
children: [/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
495
495
|
className: "text-xs text-text-muted mb-1",
|
|
496
496
|
children: "Refund ID"
|
|
497
|
-
}), /* @__PURE__ */
|
|
497
|
+
}), /* @__PURE__ */ I("p", {
|
|
498
498
|
className: "text-sm font-mono break-all",
|
|
499
499
|
children: e.id
|
|
500
|
-
})] }), /* @__PURE__ */
|
|
500
|
+
})] }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
501
501
|
className: "text-xs text-text-muted mb-1",
|
|
502
502
|
children: "Source"
|
|
503
|
-
}), /* @__PURE__ */
|
|
503
|
+
}), /* @__PURE__ */ I("p", {
|
|
504
504
|
className: "text-sm",
|
|
505
|
-
children:
|
|
505
|
+
children: B[e.source]
|
|
506
506
|
})] })]
|
|
507
507
|
}),
|
|
508
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ L("div", {
|
|
509
509
|
className: "grid grid-cols-2 gap-4",
|
|
510
|
-
children: [/* @__PURE__ */
|
|
510
|
+
children: [/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
511
511
|
className: "text-xs text-text-muted mb-1",
|
|
512
512
|
children: "Amount"
|
|
513
|
-
}), /* @__PURE__ */
|
|
513
|
+
}), /* @__PURE__ */ I("p", {
|
|
514
514
|
className: "text-lg font-semibold",
|
|
515
515
|
children: a(e.amount, e.currency)
|
|
516
|
-
})] }), /* @__PURE__ */
|
|
516
|
+
})] }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
517
517
|
className: "text-xs text-text-muted mb-1",
|
|
518
518
|
children: "Provider"
|
|
519
|
-
}), /* @__PURE__ */
|
|
519
|
+
}), /* @__PURE__ */ I("p", {
|
|
520
520
|
className: "text-sm capitalize",
|
|
521
521
|
children: e.provider
|
|
522
522
|
})] })]
|
|
523
523
|
}),
|
|
524
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ L("div", {
|
|
525
525
|
className: "grid grid-cols-2 gap-4",
|
|
526
|
-
children: [/* @__PURE__ */
|
|
526
|
+
children: [/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
527
527
|
className: "text-xs text-text-muted mb-1",
|
|
528
528
|
children: "Gateway Payment ID"
|
|
529
|
-
}), /* @__PURE__ */
|
|
529
|
+
}), /* @__PURE__ */ I("p", {
|
|
530
530
|
className: "text-sm font-mono break-all",
|
|
531
531
|
children: e.gatewayPaymentId
|
|
532
|
-
})] }), e.gatewayOrderId && /* @__PURE__ */
|
|
532
|
+
})] }), e.gatewayOrderId && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
533
533
|
className: "text-xs text-text-muted mb-1",
|
|
534
534
|
children: "Gateway Order ID"
|
|
535
|
-
}), /* @__PURE__ */
|
|
535
|
+
}), /* @__PURE__ */ I("p", {
|
|
536
536
|
className: "text-sm font-mono break-all",
|
|
537
537
|
children: e.gatewayOrderId
|
|
538
538
|
})] })]
|
|
539
539
|
}),
|
|
540
|
-
e.gatewayRefundId && /* @__PURE__ */
|
|
540
|
+
e.gatewayRefundId && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
541
541
|
className: "text-xs text-text-muted mb-1",
|
|
542
542
|
children: "Gateway Refund ID"
|
|
543
|
-
}), /* @__PURE__ */
|
|
543
|
+
}), /* @__PURE__ */ I("p", {
|
|
544
544
|
className: "text-sm font-mono break-all",
|
|
545
545
|
children: e.gatewayRefundId
|
|
546
546
|
})] }),
|
|
547
|
-
(e.purchaseType || e.purchaseDetail) && /* @__PURE__ */
|
|
547
|
+
(e.purchaseType || e.purchaseDetail) && /* @__PURE__ */ L("div", {
|
|
548
548
|
className: "grid grid-cols-2 gap-4",
|
|
549
|
-
children: [e.purchaseType && /* @__PURE__ */
|
|
549
|
+
children: [e.purchaseType && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
550
550
|
className: "text-xs text-text-muted mb-1",
|
|
551
551
|
children: "Purchase Type"
|
|
552
|
-
}), /* @__PURE__ */
|
|
552
|
+
}), /* @__PURE__ */ I("p", {
|
|
553
553
|
className: "text-sm",
|
|
554
554
|
children: e.purchaseType
|
|
555
|
-
})] }), e.purchaseDetail && /* @__PURE__ */
|
|
555
|
+
})] }), e.purchaseDetail && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
556
556
|
className: "text-xs text-text-muted mb-1",
|
|
557
557
|
children: "Purchase Detail"
|
|
558
|
-
}), /* @__PURE__ */
|
|
558
|
+
}), /* @__PURE__ */ I("p", {
|
|
559
559
|
className: "text-sm",
|
|
560
560
|
children: e.purchaseDetail
|
|
561
561
|
})] })]
|
|
562
562
|
}),
|
|
563
|
-
e.reason && /* @__PURE__ */
|
|
563
|
+
e.reason && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
564
564
|
className: "text-xs text-text-muted mb-1",
|
|
565
565
|
children: "Reason"
|
|
566
|
-
}), /* @__PURE__ */
|
|
566
|
+
}), /* @__PURE__ */ I("p", {
|
|
567
567
|
className: "text-sm",
|
|
568
568
|
children: e.reason
|
|
569
569
|
})] }),
|
|
570
|
-
e.notes && /* @__PURE__ */
|
|
570
|
+
e.notes && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
571
571
|
className: "text-xs text-text-muted mb-1",
|
|
572
572
|
children: "Notes"
|
|
573
|
-
}), /* @__PURE__ */
|
|
573
|
+
}), /* @__PURE__ */ I("p", {
|
|
574
574
|
className: "text-sm",
|
|
575
575
|
children: e.notes
|
|
576
576
|
})] }),
|
|
577
|
-
e.errorMessage && /* @__PURE__ */
|
|
577
|
+
e.errorMessage && /* @__PURE__ */ L("div", {
|
|
578
578
|
className: `p-3 ${l.error.bg} border ${l.error.border} rounded-md`,
|
|
579
|
-
children: [/* @__PURE__ */
|
|
579
|
+
children: [/* @__PURE__ */ I("p", {
|
|
580
580
|
className: `text-xs ${l.error.text} mb-1`,
|
|
581
581
|
children: "Error Message"
|
|
582
|
-
}), /* @__PURE__ */
|
|
582
|
+
}), /* @__PURE__ */ I("p", {
|
|
583
583
|
className: `text-sm ${l.error.text}`,
|
|
584
584
|
children: e.errorMessage
|
|
585
585
|
})]
|
|
586
586
|
}),
|
|
587
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ L("div", {
|
|
588
588
|
className: "grid grid-cols-2 gap-4 pt-2 border-t border-border-subtle",
|
|
589
|
-
children: [/* @__PURE__ */
|
|
589
|
+
children: [/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
590
590
|
className: "text-xs text-text-muted mb-1",
|
|
591
591
|
children: "Created At"
|
|
592
|
-
}), /* @__PURE__ */
|
|
592
|
+
}), /* @__PURE__ */ I("p", {
|
|
593
593
|
className: "text-sm",
|
|
594
594
|
children: o(e.createdAt)
|
|
595
|
-
})] }), e.processedAt && /* @__PURE__ */
|
|
595
|
+
})] }), e.processedAt && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
596
596
|
className: "text-xs text-text-muted mb-1",
|
|
597
597
|
children: "Processed At"
|
|
598
|
-
}), /* @__PURE__ */
|
|
598
|
+
}), /* @__PURE__ */ I("p", {
|
|
599
599
|
className: "text-sm",
|
|
600
600
|
children: o(e.processedAt)
|
|
601
601
|
})] })]
|
|
602
602
|
}),
|
|
603
|
-
e.retryCount > 0 && /* @__PURE__ */
|
|
603
|
+
e.retryCount > 0 && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
604
604
|
className: "text-xs text-text-muted mb-1",
|
|
605
605
|
children: "Retry Count"
|
|
606
|
-
}), /* @__PURE__ */
|
|
606
|
+
}), /* @__PURE__ */ I("p", {
|
|
607
607
|
className: "text-sm",
|
|
608
608
|
children: e.retryCount
|
|
609
609
|
})] })
|
|
610
610
|
]
|
|
611
611
|
}),
|
|
612
|
-
/* @__PURE__ */
|
|
612
|
+
/* @__PURE__ */ I("div", {
|
|
613
613
|
className: "p-4 border-t border-border-subtle",
|
|
614
|
-
children: /* @__PURE__ */
|
|
614
|
+
children: /* @__PURE__ */ I("button", {
|
|
615
615
|
type: "button",
|
|
616
616
|
onClick: t,
|
|
617
617
|
className: "w-full py-2 px-4 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bgHover transition-colors",
|
|
@@ -621,7 +621,7 @@ var I = {
|
|
|
621
621
|
]
|
|
622
622
|
})]
|
|
623
623
|
});
|
|
624
|
-
},
|
|
624
|
+
}, U = {
|
|
625
625
|
PENDING: {
|
|
626
626
|
label: "Pending",
|
|
627
627
|
status: "PENDING"
|
|
@@ -638,93 +638,93 @@ var I = {
|
|
|
638
638
|
label: "All",
|
|
639
639
|
status: void 0
|
|
640
640
|
}
|
|
641
|
-
},
|
|
642
|
-
let { t: i } =
|
|
641
|
+
}, W = () => {
|
|
642
|
+
let { t: i } = ae(), l = (e, t) => {
|
|
643
643
|
let n = i(e);
|
|
644
644
|
return n === e ? t : n;
|
|
645
|
-
}, u = n(), [d, p] = m("PENDING"), [
|
|
646
|
-
...
|
|
647
|
-
status:
|
|
645
|
+
}, u = n(), [d, p] = m("PENDING"), [x, S] = m(""), [T, E] = m({}), [O, k] = m(!1), [A, M] = m(null), [P, F] = m(!1), [R, H] = m(!1), [W, G] = m(null), [de, K] = m(null), fe = f(() => ({
|
|
646
|
+
...T,
|
|
647
|
+
status: U[d].status
|
|
648
648
|
}), [
|
|
649
649
|
d,
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
]), { records:
|
|
656
|
-
if (!u.canViewPayments) return /* @__PURE__ */
|
|
657
|
-
if (
|
|
650
|
+
T.source,
|
|
651
|
+
T.provider,
|
|
652
|
+
T.billingAccountId,
|
|
653
|
+
T.fromDate,
|
|
654
|
+
T.toDate
|
|
655
|
+
]), { records: q, stats: J, pagination: Y, isLoading: pe, recordsError: X, unprocessedWebhooks: Z, refetch: Q, goToNextPage: me, goToPreviousPage: he, setFilters: ge, createRefundRecord: _e, processRefund: ve, skipRefund: ye, retryRefund: be, createRefundRecordsFromFailedWebhooks: xe, isCreating: Se, isProcessing: Ce, isCreatingFromWebhooks: we } = c({ filters: fe });
|
|
656
|
+
if (!u.canViewPayments) return /* @__PURE__ */ I(e, { message: "You don't have permission to view refunds." });
|
|
657
|
+
if (X && s(X)) return /* @__PURE__ */ I("div", {
|
|
658
658
|
className: "p-6",
|
|
659
|
-
children: /* @__PURE__ */
|
|
659
|
+
children: /* @__PURE__ */ I(r, {
|
|
660
660
|
title: "Server Unavailable",
|
|
661
661
|
message: "Unable to load refunds. The server might be down or experiencing issues.",
|
|
662
|
-
onRetry: () =>
|
|
662
|
+
onRetry: () => Q(),
|
|
663
663
|
showRetry: !0
|
|
664
664
|
})
|
|
665
665
|
});
|
|
666
666
|
let Te = (e) => {
|
|
667
|
-
p(e),
|
|
668
|
-
},
|
|
667
|
+
p(e), E({}), S("");
|
|
668
|
+
}, $ = (e, t) => {
|
|
669
669
|
if (e === "status") return;
|
|
670
670
|
let n = {
|
|
671
|
-
...
|
|
671
|
+
...T,
|
|
672
672
|
[e]: t || void 0
|
|
673
673
|
};
|
|
674
|
-
|
|
674
|
+
E(n), ge({
|
|
675
675
|
...n,
|
|
676
|
-
status:
|
|
676
|
+
status: U[d].status
|
|
677
677
|
});
|
|
678
678
|
}, Ee = async (e) => {
|
|
679
679
|
try {
|
|
680
|
-
await
|
|
680
|
+
await _e(e), F(!1);
|
|
681
681
|
} catch (e) {
|
|
682
682
|
console.error("Failed to create refund:", e);
|
|
683
683
|
}
|
|
684
684
|
}, De = async (e) => {
|
|
685
|
-
|
|
685
|
+
K(e.id);
|
|
686
686
|
try {
|
|
687
|
-
let t = await
|
|
687
|
+
let t = await ve(e.id);
|
|
688
688
|
!t.success && t.error && console.error("Refund processing failed:", t.error);
|
|
689
689
|
} catch (e) {
|
|
690
690
|
console.error("Failed to process refund:", e);
|
|
691
691
|
} finally {
|
|
692
|
-
|
|
692
|
+
K(null);
|
|
693
693
|
}
|
|
694
694
|
}, Oe = async (e) => {
|
|
695
|
-
if (
|
|
696
|
-
await
|
|
695
|
+
if (W) try {
|
|
696
|
+
await ye(W.id, e), H(!1), G(null);
|
|
697
697
|
} catch (e) {
|
|
698
698
|
console.error("Failed to skip refund:", e);
|
|
699
699
|
}
|
|
700
700
|
}, ke = async (e) => {
|
|
701
|
-
|
|
701
|
+
K(e.id);
|
|
702
702
|
try {
|
|
703
|
-
let t = await
|
|
703
|
+
let t = await be(e.id);
|
|
704
704
|
!t.success && t.error && console.error("Refund retry failed:", t.error);
|
|
705
705
|
} catch (e) {
|
|
706
706
|
console.error("Failed to retry refund:", e);
|
|
707
707
|
} finally {
|
|
708
|
-
|
|
708
|
+
K(null);
|
|
709
709
|
}
|
|
710
710
|
}, Ae = async () => {
|
|
711
711
|
try {
|
|
712
|
-
await
|
|
712
|
+
await xe();
|
|
713
713
|
} catch (e) {
|
|
714
714
|
console.error("Failed to create refunds from webhooks:", e);
|
|
715
715
|
}
|
|
716
|
-
},
|
|
716
|
+
}, je = x ? q.filter((e) => e.gatewayPaymentId.toLowerCase().includes(x.toLowerCase()) || e.gatewayOrderId?.toLowerCase().includes(x.toLowerCase()) || e.reason?.toLowerCase().includes(x.toLowerCase())) : q, Me = [
|
|
717
717
|
{
|
|
718
718
|
key: "date",
|
|
719
719
|
header: "Date",
|
|
720
720
|
priority: "primary",
|
|
721
721
|
cellClassName: "whitespace-nowrap",
|
|
722
|
-
cell: (e) => /* @__PURE__ */
|
|
722
|
+
cell: (e) => /* @__PURE__ */ L("div", {
|
|
723
723
|
className: "flex flex-col",
|
|
724
|
-
children: [/* @__PURE__ */
|
|
724
|
+
children: [/* @__PURE__ */ I("span", {
|
|
725
725
|
className: "text-sm text-text-primary",
|
|
726
726
|
children: o(e.createdAt).split(" ")[0]
|
|
727
|
-
}), /* @__PURE__ */
|
|
727
|
+
}), /* @__PURE__ */ I("span", {
|
|
728
728
|
className: "text-xs text-text-muted",
|
|
729
729
|
children: o(e.createdAt).split(" ")[1]
|
|
730
730
|
})]
|
|
@@ -735,12 +735,12 @@ var I = {
|
|
|
735
735
|
header: "Status",
|
|
736
736
|
cellClassName: "whitespace-nowrap",
|
|
737
737
|
cell: (e) => {
|
|
738
|
-
let t =
|
|
739
|
-
return /* @__PURE__ */
|
|
740
|
-
className: `inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium rounded ${
|
|
741
|
-
children: [/* @__PURE__ */
|
|
738
|
+
let t = z[e.status].icon;
|
|
739
|
+
return /* @__PURE__ */ L("span", {
|
|
740
|
+
className: `inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium rounded ${V(z[e.status].color)}`,
|
|
741
|
+
children: [/* @__PURE__ */ I(t, { className: "size-3" }), /* @__PURE__ */ I("span", {
|
|
742
742
|
className: "hidden sm:inline",
|
|
743
|
-
children:
|
|
743
|
+
children: z[e.status].label
|
|
744
744
|
})]
|
|
745
745
|
});
|
|
746
746
|
}
|
|
@@ -750,9 +750,9 @@ var I = {
|
|
|
750
750
|
header: "Source",
|
|
751
751
|
priority: "hidden-on-mobile",
|
|
752
752
|
cellClassName: "whitespace-nowrap",
|
|
753
|
-
cell: (e) => /* @__PURE__ */
|
|
753
|
+
cell: (e) => /* @__PURE__ */ I("span", {
|
|
754
754
|
className: "text-sm text-text-muted",
|
|
755
|
-
children:
|
|
755
|
+
children: B[e.source]
|
|
756
756
|
})
|
|
757
757
|
},
|
|
758
758
|
{
|
|
@@ -760,7 +760,7 @@ var I = {
|
|
|
760
760
|
header: "Provider",
|
|
761
761
|
priority: "hidden-on-mobile",
|
|
762
762
|
cellClassName: "whitespace-nowrap",
|
|
763
|
-
cell: (e) => /* @__PURE__ */
|
|
763
|
+
cell: (e) => /* @__PURE__ */ I("span", {
|
|
764
764
|
className: "text-sm text-text-primary capitalize",
|
|
765
765
|
children: e.provider
|
|
766
766
|
})
|
|
@@ -769,7 +769,7 @@ var I = {
|
|
|
769
769
|
key: "paymentId",
|
|
770
770
|
header: "Payment ID",
|
|
771
771
|
cellClassName: "whitespace-nowrap max-w-[120px] sm:max-w-[200px] truncate",
|
|
772
|
-
cell: (e) => /* @__PURE__ */
|
|
772
|
+
cell: (e) => /* @__PURE__ */ I("span", {
|
|
773
773
|
className: "text-sm font-mono text-text-muted",
|
|
774
774
|
children: e.gatewayPaymentId
|
|
775
775
|
})
|
|
@@ -779,7 +779,7 @@ var I = {
|
|
|
779
779
|
header: "Amount",
|
|
780
780
|
headerClassName: "text-right",
|
|
781
781
|
cellClassName: "text-right whitespace-nowrap",
|
|
782
|
-
cell: (e) => /* @__PURE__ */
|
|
782
|
+
cell: (e) => /* @__PURE__ */ I("span", {
|
|
783
783
|
className: "text-sm font-medium tabular-nums",
|
|
784
784
|
children: a(e.amount, e.currency)
|
|
785
785
|
})
|
|
@@ -789,26 +789,26 @@ var I = {
|
|
|
789
789
|
header: "Reason",
|
|
790
790
|
priority: "hidden-on-mobile",
|
|
791
791
|
cellClassName: "max-w-[200px] truncate",
|
|
792
|
-
cell: (e) => /* @__PURE__ */
|
|
792
|
+
cell: (e) => /* @__PURE__ */ I("span", {
|
|
793
793
|
className: "text-sm text-text-muted",
|
|
794
794
|
children: e.reason || "-"
|
|
795
795
|
})
|
|
796
796
|
}
|
|
797
|
-
],
|
|
797
|
+
], Ne = (e) => /* @__PURE__ */ I(se, {
|
|
798
798
|
record: e,
|
|
799
|
-
onViewDetails: () =>
|
|
799
|
+
onViewDetails: () => M(e),
|
|
800
800
|
onProcess: () => De(e),
|
|
801
801
|
onSkip: () => {
|
|
802
|
-
|
|
802
|
+
G(e), H(!0);
|
|
803
803
|
},
|
|
804
804
|
onRetry: () => ke(e),
|
|
805
|
-
isProcessing:
|
|
805
|
+
isProcessing: de === e.id
|
|
806
806
|
});
|
|
807
|
-
return
|
|
807
|
+
return pe ? /* @__PURE__ */ L("div", {
|
|
808
808
|
className: "space-y-6 p-6",
|
|
809
809
|
children: [
|
|
810
|
-
/* @__PURE__ */
|
|
811
|
-
/* @__PURE__ */
|
|
810
|
+
/* @__PURE__ */ I("div", { className: "h-8 w-48 bg-bg-sunken animate-pulse rounded" }),
|
|
811
|
+
/* @__PURE__ */ I("div", {
|
|
812
812
|
className: "grid grid-cols-5 gap-4",
|
|
813
813
|
children: [
|
|
814
814
|
1,
|
|
@@ -816,9 +816,9 @@ var I = {
|
|
|
816
816
|
3,
|
|
817
817
|
4,
|
|
818
818
|
5
|
|
819
|
-
].map((e) => /* @__PURE__ */
|
|
819
|
+
].map((e) => /* @__PURE__ */ I("div", { className: "h-24 bg-bg-sunken animate-pulse rounded-lg" }, e))
|
|
820
820
|
}),
|
|
821
|
-
/* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ I("div", {
|
|
822
822
|
className: "space-y-2",
|
|
823
823
|
children: [
|
|
824
824
|
1,
|
|
@@ -826,54 +826,54 @@ var I = {
|
|
|
826
826
|
3,
|
|
827
827
|
4,
|
|
828
828
|
5
|
|
829
|
-
].map((e) => /* @__PURE__ */
|
|
829
|
+
].map((e) => /* @__PURE__ */ I("div", { className: "h-16 bg-bg-sunken animate-pulse rounded" }, e))
|
|
830
830
|
})
|
|
831
831
|
]
|
|
832
|
-
}) : /* @__PURE__ */
|
|
832
|
+
}) : /* @__PURE__ */ L("div", {
|
|
833
833
|
className: "space-y-6 p-6",
|
|
834
834
|
children: [
|
|
835
|
-
/* @__PURE__ */
|
|
835
|
+
/* @__PURE__ */ I(t, {
|
|
836
836
|
title: l("billing.refunds.title", "Refund Management"),
|
|
837
837
|
description: "View and manage refund records",
|
|
838
|
-
actions: /* @__PURE__ */
|
|
838
|
+
actions: /* @__PURE__ */ L("div", {
|
|
839
839
|
className: "flex items-center gap-2",
|
|
840
|
-
children: [/* @__PURE__ */
|
|
840
|
+
children: [/* @__PURE__ */ L(ie, {
|
|
841
841
|
to: "logs",
|
|
842
842
|
className: "inline-flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md border border-border-subtle bg-bg-surface hover:bg-bg-sunken/50 transition-colors",
|
|
843
|
-
children: [/* @__PURE__ */
|
|
844
|
-
}), /* @__PURE__ */
|
|
843
|
+
children: [/* @__PURE__ */ I(b, { className: "size-4" }), "View Issue Log"]
|
|
844
|
+
}), /* @__PURE__ */ I(h, {
|
|
845
845
|
primary: {
|
|
846
846
|
label: "Create Manual Refund",
|
|
847
|
-
onSelect: () =>
|
|
848
|
-
icon: /* @__PURE__ */
|
|
847
|
+
onSelect: () => F(!0),
|
|
848
|
+
icon: /* @__PURE__ */ I(ne, { className: "size-4" })
|
|
849
849
|
},
|
|
850
|
-
actions: [...
|
|
851
|
-
label: `Import ${
|
|
850
|
+
actions: [...Z.length > 0 ? [{
|
|
851
|
+
label: `Import ${Z.length} Failed Webhooks`,
|
|
852
852
|
onSelect: Ae,
|
|
853
|
-
disabled:
|
|
854
|
-
icon:
|
|
853
|
+
disabled: we,
|
|
854
|
+
icon: we ? /* @__PURE__ */ I(D, { className: "size-4 animate-spin" }) : /* @__PURE__ */ I(ee, { className: "size-4" })
|
|
855
855
|
}] : [], {
|
|
856
856
|
label: "Refresh",
|
|
857
857
|
onSelect: () => {
|
|
858
|
-
|
|
858
|
+
Q();
|
|
859
859
|
},
|
|
860
|
-
icon: /* @__PURE__ */
|
|
860
|
+
icon: /* @__PURE__ */ I(re, { className: "size-4" })
|
|
861
861
|
}]
|
|
862
862
|
})]
|
|
863
863
|
})
|
|
864
864
|
}),
|
|
865
|
-
/* @__PURE__ */
|
|
866
|
-
/* @__PURE__ */
|
|
865
|
+
/* @__PURE__ */ I(_, { children: l("billing.refunds.purpose", "Track and act on every refund across all billing accounts — manual refunds, ones triggered by cancellations, and those recovered from failed payment-gateway webhooks. Use it to process pending refunds, retry failed ones, skip a refund with a reason, or create a manual refund for a specific transaction.") }),
|
|
866
|
+
/* @__PURE__ */ I("div", {
|
|
867
867
|
className: "border-b border-border-subtle",
|
|
868
|
-
children: /* @__PURE__ */
|
|
868
|
+
children: /* @__PURE__ */ I("div", {
|
|
869
869
|
className: "flex flex-wrap gap-2 sm:gap-0",
|
|
870
|
-
children: Object.keys(
|
|
871
|
-
let t = d === e, n =
|
|
872
|
-
return /* @__PURE__ */
|
|
870
|
+
children: Object.keys(U).map((e) => {
|
|
871
|
+
let t = d === e, n = J ? e === "PENDING" ? J.pending : e === "COMPLETED" ? J.completed : e === "FAILED" ? J.failed : J.pending + J.processing + J.completed + J.failed + J.skipped : 0;
|
|
872
|
+
return /* @__PURE__ */ L("button", {
|
|
873
873
|
type: "button",
|
|
874
874
|
onClick: () => Te(e),
|
|
875
875
|
className: `flex items-center gap-2 px-4 py-3 text-sm font-medium border-b-2 transition-colors whitespace-nowrap ${t ? "border-action-primary-bg text-text-link" : "border-transparent text-text-muted hover:text-text-primary hover:border-border-subtle"}`,
|
|
876
|
-
children: [
|
|
876
|
+
children: [U[e].label, J && /* @__PURE__ */ I("span", {
|
|
877
877
|
className: `px-2 py-0.5 text-xs rounded-full ${t ? "bg-[var(--color-accent-soft)] text-text-link" : "bg-bg-sunken text-text-muted"}`,
|
|
878
878
|
children: n
|
|
879
879
|
})]
|
|
@@ -881,97 +881,97 @@ var I = {
|
|
|
881
881
|
})
|
|
882
882
|
})
|
|
883
883
|
}),
|
|
884
|
-
/* @__PURE__ */
|
|
884
|
+
/* @__PURE__ */ L("div", {
|
|
885
885
|
className: "flex flex-col sm:flex-row gap-4",
|
|
886
886
|
children: [
|
|
887
|
-
/* @__PURE__ */
|
|
887
|
+
/* @__PURE__ */ L("div", {
|
|
888
888
|
className: "relative flex-1",
|
|
889
|
-
children: [/* @__PURE__ */
|
|
889
|
+
children: [/* @__PURE__ */ I(j, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-text-muted" }), /* @__PURE__ */ I("input", {
|
|
890
890
|
type: "text",
|
|
891
891
|
placeholder: "Search by payment ID, order ID, or reason...",
|
|
892
|
-
value:
|
|
893
|
-
onChange: (e) =>
|
|
892
|
+
value: x,
|
|
893
|
+
onChange: (e) => S(e.target.value),
|
|
894
894
|
className: "w-full pl-[3.25rem] pr-4 py-2 border border-border-subtle rounded-md bg-bg-surface"
|
|
895
895
|
})]
|
|
896
896
|
}),
|
|
897
|
-
/* @__PURE__ */
|
|
897
|
+
/* @__PURE__ */ L("button", {
|
|
898
898
|
type: "button",
|
|
899
|
-
onClick: () =>
|
|
900
|
-
className: `inline-flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md border transition-colors ${
|
|
899
|
+
onClick: () => k(!O),
|
|
900
|
+
className: `inline-flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md border transition-colors ${O ? "border-action-primary-bg bg-[var(--color-accent-soft)] text-text-link" : "border-border-subtle bg-bg-surface hover:bg-bg-sunken/50"}`,
|
|
901
901
|
children: [
|
|
902
|
-
/* @__PURE__ */
|
|
902
|
+
/* @__PURE__ */ I(te, { className: "size-4" }),
|
|
903
903
|
"Filters",
|
|
904
|
-
Object.values(
|
|
904
|
+
Object.values(T).filter(Boolean).length > 0 && /* @__PURE__ */ I("span", {
|
|
905
905
|
className: "px-1.5 py-0.5 text-xs rounded-full bg-action-primary-bg text-action-primary-text",
|
|
906
|
-
children: Object.values(
|
|
906
|
+
children: Object.values(T).filter(Boolean).length
|
|
907
907
|
})
|
|
908
908
|
]
|
|
909
909
|
}),
|
|
910
|
-
Object.values(
|
|
910
|
+
Object.values(T).filter(Boolean).length > 0 && /* @__PURE__ */ L("button", {
|
|
911
911
|
type: "button",
|
|
912
912
|
onClick: () => {
|
|
913
|
-
|
|
913
|
+
E({}), ge({});
|
|
914
914
|
},
|
|
915
915
|
className: "inline-flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-md text-text-muted hover:text-text-primary transition-colors",
|
|
916
|
-
children: [/* @__PURE__ */
|
|
916
|
+
children: [/* @__PURE__ */ I(N, { className: "size-4" }), "Clear"]
|
|
917
917
|
})
|
|
918
918
|
]
|
|
919
919
|
}),
|
|
920
|
-
|
|
920
|
+
O && /* @__PURE__ */ L("div", {
|
|
921
921
|
className: "p-4 border border-border-subtle rounded-lg bg-bg-sunken/30 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
922
922
|
children: [
|
|
923
|
-
/* @__PURE__ */
|
|
923
|
+
/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("label", {
|
|
924
924
|
className: "block text-sm font-medium mb-1",
|
|
925
925
|
children: "Source"
|
|
926
|
-
}), /* @__PURE__ */
|
|
927
|
-
value:
|
|
928
|
-
onChange: (e) =>
|
|
926
|
+
}), /* @__PURE__ */ L(y, {
|
|
927
|
+
value: T.source || "",
|
|
928
|
+
onChange: (e) => $("source", e.target.value),
|
|
929
929
|
className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
930
|
-
children: [/* @__PURE__ */
|
|
930
|
+
children: [/* @__PURE__ */ I("option", {
|
|
931
931
|
value: "",
|
|
932
932
|
children: "All Sources"
|
|
933
|
-
}), Object.entries(
|
|
933
|
+
}), Object.entries(B).map(([e, t]) => /* @__PURE__ */ I("option", {
|
|
934
934
|
value: e,
|
|
935
935
|
children: t
|
|
936
936
|
}, e))]
|
|
937
937
|
})] }),
|
|
938
|
-
/* @__PURE__ */
|
|
938
|
+
/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("label", {
|
|
939
939
|
className: "block text-sm font-medium mb-1",
|
|
940
940
|
children: "Provider"
|
|
941
|
-
}), /* @__PURE__ */
|
|
942
|
-
value:
|
|
943
|
-
onChange: (e) =>
|
|
941
|
+
}), /* @__PURE__ */ L(y, {
|
|
942
|
+
value: T.provider || "",
|
|
943
|
+
onChange: (e) => $("provider", e.target.value),
|
|
944
944
|
className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
945
|
-
children: [/* @__PURE__ */
|
|
945
|
+
children: [/* @__PURE__ */ I("option", {
|
|
946
946
|
value: "",
|
|
947
947
|
children: "All Providers"
|
|
948
|
-
}),
|
|
948
|
+
}), oe.map((e) => /* @__PURE__ */ I("option", {
|
|
949
949
|
value: e,
|
|
950
950
|
children: e.charAt(0).toUpperCase() + e.slice(1)
|
|
951
951
|
}, e))]
|
|
952
952
|
})] }),
|
|
953
|
-
/* @__PURE__ */
|
|
953
|
+
/* @__PURE__ */ L("div", {
|
|
954
954
|
className: "sm:col-span-2 lg:col-span-1",
|
|
955
|
-
children: [/* @__PURE__ */
|
|
955
|
+
children: [/* @__PURE__ */ I("label", {
|
|
956
956
|
className: "block text-sm font-medium mb-1",
|
|
957
957
|
children: "Date Range"
|
|
958
|
-
}), /* @__PURE__ */
|
|
958
|
+
}), /* @__PURE__ */ L("div", {
|
|
959
959
|
className: "flex flex-col sm:flex-row items-start sm:items-center gap-2",
|
|
960
960
|
children: [
|
|
961
|
-
/* @__PURE__ */
|
|
961
|
+
/* @__PURE__ */ I("input", {
|
|
962
962
|
type: "date",
|
|
963
|
-
value:
|
|
964
|
-
onChange: (e) =>
|
|
963
|
+
value: T.fromDate ? T.fromDate.split("T")[0] : "",
|
|
964
|
+
onChange: (e) => $("fromDate", e.target.value ? new Date(e.target.value).toISOString() : void 0),
|
|
965
965
|
className: "w-full sm:flex-1 p-2 border border-border-subtle rounded-md bg-bg-surface text-sm"
|
|
966
966
|
}),
|
|
967
|
-
/* @__PURE__ */
|
|
967
|
+
/* @__PURE__ */ I("span", {
|
|
968
968
|
className: "text-text-muted hidden sm:inline",
|
|
969
969
|
children: "-"
|
|
970
970
|
}),
|
|
971
|
-
/* @__PURE__ */
|
|
971
|
+
/* @__PURE__ */ I("input", {
|
|
972
972
|
type: "date",
|
|
973
|
-
value:
|
|
974
|
-
onChange: (e) =>
|
|
973
|
+
value: T.toDate ? T.toDate.split("T")[0] : "",
|
|
974
|
+
onChange: (e) => $("toDate", e.target.value ? new Date(e.target.value).toISOString() : void 0),
|
|
975
975
|
className: "w-full sm:flex-1 p-2 border border-border-subtle rounded-md bg-bg-surface text-sm"
|
|
976
976
|
})
|
|
977
977
|
]
|
|
@@ -979,103 +979,103 @@ var I = {
|
|
|
979
979
|
})
|
|
980
980
|
]
|
|
981
981
|
}),
|
|
982
|
-
|
|
983
|
-
illustration: Object.values(
|
|
982
|
+
je.length === 0 ? /* @__PURE__ */ I(g, {
|
|
983
|
+
illustration: Object.values(T).filter(Boolean).length > 0 ? "empty-search" : "empty-data",
|
|
984
984
|
title: "No refund records found",
|
|
985
|
-
description: Object.values(
|
|
986
|
-
}) : /* @__PURE__ */
|
|
985
|
+
description: Object.values(T).filter(Boolean).length > 0 ? "Try adjusting your filters." : d === "PENDING" ? "No pending refunds to process." : "Refund records will appear here when created."
|
|
986
|
+
}) : /* @__PURE__ */ I("div", {
|
|
987
987
|
className: "border border-border-subtle rounded-lg overflow-hidden",
|
|
988
|
-
children: /* @__PURE__ */
|
|
989
|
-
columns:
|
|
990
|
-
data:
|
|
988
|
+
children: /* @__PURE__ */ I(v, {
|
|
989
|
+
columns: Me,
|
|
990
|
+
data: je,
|
|
991
991
|
rowKey: (e) => e.id,
|
|
992
|
-
rowActions:
|
|
992
|
+
rowActions: Ne
|
|
993
993
|
})
|
|
994
994
|
}),
|
|
995
|
-
|
|
995
|
+
Y.totalCount > 0 && /* @__PURE__ */ L("div", {
|
|
996
996
|
className: "flex flex-col sm:flex-row items-center justify-between gap-4 border-t border-border-subtle pt-4",
|
|
997
|
-
children: [/* @__PURE__ */
|
|
997
|
+
children: [/* @__PURE__ */ L("p", {
|
|
998
998
|
className: "text-sm text-text-muted text-center sm:text-left",
|
|
999
999
|
children: [
|
|
1000
1000
|
"Showing ",
|
|
1001
|
-
|
|
1001
|
+
Y.page * Y.pageSize + 1,
|
|
1002
1002
|
" to",
|
|
1003
1003
|
" ",
|
|
1004
|
-
Math.min((
|
|
1004
|
+
Math.min((Y.page + 1) * Y.pageSize, Y.totalCount),
|
|
1005
1005
|
" of",
|
|
1006
1006
|
" ",
|
|
1007
|
-
|
|
1007
|
+
Y.totalCount,
|
|
1008
1008
|
" refunds"
|
|
1009
1009
|
]
|
|
1010
|
-
}), /* @__PURE__ */
|
|
1010
|
+
}), /* @__PURE__ */ L("div", {
|
|
1011
1011
|
className: "flex items-center gap-2",
|
|
1012
1012
|
children: [
|
|
1013
|
-
/* @__PURE__ */
|
|
1013
|
+
/* @__PURE__ */ L("button", {
|
|
1014
1014
|
type: "button",
|
|
1015
|
-
onClick:
|
|
1016
|
-
disabled: !
|
|
1015
|
+
onClick: he,
|
|
1016
|
+
disabled: !Y.hasPrevious,
|
|
1017
1017
|
className: "inline-flex items-center gap-1 px-3 py-1.5 text-sm font-medium rounded-button border border-border-subtle bg-bg-surface hover:bg-bg-sunken/50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
1018
|
-
children: [/* @__PURE__ */
|
|
1018
|
+
children: [/* @__PURE__ */ I(C, { className: "size-4" }), /* @__PURE__ */ I("span", {
|
|
1019
1019
|
className: "hidden sm:inline",
|
|
1020
1020
|
children: "Previous"
|
|
1021
1021
|
})]
|
|
1022
1022
|
}),
|
|
1023
|
-
/* @__PURE__ */
|
|
1023
|
+
/* @__PURE__ */ L("span", {
|
|
1024
1024
|
className: "text-sm text-text-muted px-2",
|
|
1025
1025
|
children: [
|
|
1026
|
-
/* @__PURE__ */
|
|
1026
|
+
/* @__PURE__ */ I("span", {
|
|
1027
1027
|
className: "hidden sm:inline",
|
|
1028
1028
|
children: "Page "
|
|
1029
1029
|
}),
|
|
1030
|
-
|
|
1030
|
+
Y.page + 1,
|
|
1031
1031
|
" ",
|
|
1032
|
-
/* @__PURE__ */
|
|
1032
|
+
/* @__PURE__ */ I("span", {
|
|
1033
1033
|
className: "hidden sm:inline",
|
|
1034
1034
|
children: "of"
|
|
1035
1035
|
}),
|
|
1036
|
-
/* @__PURE__ */
|
|
1036
|
+
/* @__PURE__ */ I("span", {
|
|
1037
1037
|
className: "sm:hidden",
|
|
1038
1038
|
children: "/"
|
|
1039
1039
|
}),
|
|
1040
1040
|
" ",
|
|
1041
|
-
Math.ceil(
|
|
1041
|
+
Math.ceil(Y.totalCount / Y.pageSize)
|
|
1042
1042
|
]
|
|
1043
1043
|
}),
|
|
1044
|
-
/* @__PURE__ */
|
|
1044
|
+
/* @__PURE__ */ L("button", {
|
|
1045
1045
|
type: "button",
|
|
1046
|
-
onClick:
|
|
1047
|
-
disabled: !
|
|
1046
|
+
onClick: me,
|
|
1047
|
+
disabled: !Y.hasMore,
|
|
1048
1048
|
className: "inline-flex items-center gap-1 px-3 py-1.5 text-sm font-medium rounded-button border border-border-subtle bg-bg-surface hover:bg-bg-sunken/50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
1049
|
-
children: [/* @__PURE__ */
|
|
1049
|
+
children: [/* @__PURE__ */ I("span", {
|
|
1050
1050
|
className: "hidden sm:inline",
|
|
1051
1051
|
children: "Next"
|
|
1052
|
-
}), /* @__PURE__ */
|
|
1052
|
+
}), /* @__PURE__ */ I(w, { className: "size-4" })]
|
|
1053
1053
|
})
|
|
1054
1054
|
]
|
|
1055
1055
|
})]
|
|
1056
1056
|
}),
|
|
1057
|
-
/* @__PURE__ */
|
|
1058
|
-
isOpen:
|
|
1059
|
-
onClose: () =>
|
|
1057
|
+
/* @__PURE__ */ I(ce, {
|
|
1058
|
+
isOpen: P,
|
|
1059
|
+
onClose: () => F(!1),
|
|
1060
1060
|
onSubmit: Ee,
|
|
1061
|
-
isSubmitting:
|
|
1061
|
+
isSubmitting: Se
|
|
1062
1062
|
}),
|
|
1063
|
-
/* @__PURE__ */
|
|
1064
|
-
isOpen:
|
|
1065
|
-
record:
|
|
1063
|
+
/* @__PURE__ */ I(le, {
|
|
1064
|
+
isOpen: R,
|
|
1065
|
+
record: W,
|
|
1066
1066
|
onClose: () => {
|
|
1067
|
-
|
|
1067
|
+
H(!1), G(null);
|
|
1068
1068
|
},
|
|
1069
1069
|
onSubmit: Oe,
|
|
1070
|
-
isSubmitting:
|
|
1070
|
+
isSubmitting: Ce
|
|
1071
1071
|
}),
|
|
1072
|
-
/* @__PURE__ */
|
|
1073
|
-
record:
|
|
1074
|
-
onClose: () =>
|
|
1072
|
+
/* @__PURE__ */ I(ue, {
|
|
1073
|
+
record: A,
|
|
1074
|
+
onClose: () => M(null)
|
|
1075
1075
|
})
|
|
1076
1076
|
]
|
|
1077
1077
|
});
|
|
1078
1078
|
};
|
|
1079
|
-
export {
|
|
1079
|
+
export { W as RefundsPage };
|
|
1080
1080
|
|
|
1081
1081
|
//# sourceMappingURL=RefundsPage.js.map
|