@burdenoff/microfe-billing 2026.1112.1 → 2026.1112.3
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/affiliate/pages/AffiliateDashboardPage.js +182 -150
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +153 -126
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +110 -109
- package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +220 -181
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +160 -141
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
- package/dist/billing/modules/plans/utils/planAction.d.ts +16 -0
- package/dist/billing/modules/plans/utils/planAction.js +16 -0
- package/dist/billing/modules/plans/utils/planAction.js.map +1 -0
- package/package.json +1 -1
|
@@ -2,28 +2,30 @@ import { useBillingPermissions as e } from "../../../hooks/useBillingPermissions
|
|
|
2
2
|
import { AccessDenied as t } from "../../../shared/components/AccessDenied.js";
|
|
3
3
|
import { PageHeader as n } from "../../../shared/components/PageHeader.js";
|
|
4
4
|
import { ServerError as r } from "../../../shared/components/ServerError.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { formatCurrency as o, formatDateTime as s } from "../../../shared/utils/format.js";
|
|
8
|
-
import { isServerError as c } from "../../../shared/utils/error.js";
|
|
5
|
+
import { MoneyActionDialog as ee } from "../../../shared/components/MoneyActionDialog.js";
|
|
6
|
+
import { useIsFluidgridsVariant as te } from "../../../hooks/useBillingVariant.js";
|
|
9
7
|
import "../../../shared/components/index.js";
|
|
8
|
+
import { formatCurrency as i, formatDateTime as a } from "../../../shared/utils/format.js";
|
|
9
|
+
import { isServerError as o } from "../../../shared/utils/error.js";
|
|
10
|
+
import { useBillingEventEmitter as s } from "../../../hooks/useBillingEventEmitter.js";
|
|
11
|
+
import { useBilling as c } from "../../../providers/BillingProvider.js";
|
|
10
12
|
import "../../../shared/utils/index.js";
|
|
11
|
-
import { useGetDefaultBillingAccountSettingsQuery as
|
|
12
|
-
import { addPayoutAccount as
|
|
13
|
-
import { PAYOUT_ACCOUNT_TONE_CLASSES as ce, isPayoutAccountPayable as
|
|
14
|
-
import { useCallback as
|
|
15
|
-
import { Landmark as
|
|
16
|
-
import { Fragment as
|
|
17
|
-
import { AlertDialog as
|
|
13
|
+
import { useGetDefaultBillingAccountSettingsQuery as l } from "../../../../generated/global-operations.js";
|
|
14
|
+
import { addPayoutAccount as u, archivePayoutAccount as ne, fetchPayoutAccounts as re, fetchPayoutRequests as ie, requestPayout as ae, setDefaultPayoutAccount as oe, updatePayoutAccount as se } from "../api.js";
|
|
15
|
+
import { PAYOUT_ACCOUNT_TONE_CLASSES as ce, isPayoutAccountPayable as d, payoutAccountStatusView as f, pickPayableAccountId as le } from "../payoutAccountStatus.js";
|
|
16
|
+
import { useCallback as ue, useEffect as de, useMemo as fe, useState as p } from "react";
|
|
17
|
+
import { Landmark as pe, RefreshCw as me, Send as he } from "lucide-react";
|
|
18
|
+
import { Fragment as ge, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
19
|
+
import { AlertDialog as _e, AlertDialogAction as ve, AlertDialogCancel as ye, AlertDialogContent as be, AlertDialogDescription as g, AlertDialogFooter as xe, AlertDialogHeader as Se, AlertDialogTitle as Ce, IllustratedEmptyState as _, PagePurpose as we, ResponsiveTable as Te } from "@burdenoff/fe-libs/ui";
|
|
18
20
|
// src/billing/modules/earnings/pages/PayoutsPage.tsx
|
|
19
|
-
var
|
|
21
|
+
var Ee = [
|
|
20
22
|
{
|
|
21
23
|
key: "amount",
|
|
22
24
|
header: "Amount",
|
|
23
25
|
priority: "primary",
|
|
24
|
-
cell: (e) => /* @__PURE__ */
|
|
26
|
+
cell: (e) => /* @__PURE__ */ m("span", {
|
|
25
27
|
className: "tabular-nums",
|
|
26
|
-
children:
|
|
28
|
+
children: i(e.requestedAmount, e.currency)
|
|
27
29
|
})
|
|
28
30
|
},
|
|
29
31
|
{
|
|
@@ -44,10 +46,10 @@ var w = [
|
|
|
44
46
|
{
|
|
45
47
|
key: "created",
|
|
46
48
|
header: "Created",
|
|
47
|
-
cell: (e) =>
|
|
49
|
+
cell: (e) => a(e.createdAt)
|
|
48
50
|
}
|
|
49
|
-
],
|
|
50
|
-
let
|
|
51
|
+
], v = () => {
|
|
52
|
+
let a = e(), v = te(), [De, y] = p(!1), [b, x] = p(!1), [S, C] = p(null), [w, T] = p(null), { emit: E } = s(), { apiGatewayUrl: D, authToken: O, orgId: k } = c(), { data: Oe } = l({}), A = Oe?.getDefaultBillingAccount?.id, [j, ke] = p([]), [M, Ae] = p([]), [N, P] = p(!0), [F, I] = p(null), [L, R] = p({
|
|
51
53
|
label: "",
|
|
52
54
|
type: "BANK_ACCOUNT",
|
|
53
55
|
providerPreference: "AUTO",
|
|
@@ -59,57 +61,57 @@ var w = [
|
|
|
59
61
|
routingNumber: "",
|
|
60
62
|
ifsc: "",
|
|
61
63
|
upiId: ""
|
|
62
|
-
}), [
|
|
63
|
-
apiGatewayUrl:
|
|
64
|
-
authToken:
|
|
65
|
-
orgId:
|
|
64
|
+
}), [z, B] = p(""), [V, H] = p(""), [U, W] = p(null), [G, K] = p(null), [q, J] = p(null), Y = fe(() => ({
|
|
65
|
+
apiGatewayUrl: D,
|
|
66
|
+
authToken: O,
|
|
67
|
+
orgId: k
|
|
66
68
|
}), [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
]),
|
|
71
|
-
if (
|
|
72
|
-
|
|
69
|
+
D,
|
|
70
|
+
O,
|
|
71
|
+
k
|
|
72
|
+
]), X = ue(async () => {
|
|
73
|
+
if (A) {
|
|
74
|
+
P(!0), I(null);
|
|
73
75
|
try {
|
|
74
|
-
let [e, t] = await Promise.all([re(
|
|
75
|
-
|
|
76
|
+
let [e, t] = await Promise.all([re(A, Y), ie(A, Y)]);
|
|
77
|
+
ke(e), Ae(t), H((t) => le(e, t));
|
|
76
78
|
} catch (e) {
|
|
77
|
-
|
|
79
|
+
I(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load payout data"));
|
|
78
80
|
} finally {
|
|
79
|
-
|
|
81
|
+
P(!1);
|
|
80
82
|
}
|
|
81
83
|
}
|
|
82
|
-
}, [
|
|
83
|
-
if (
|
|
84
|
-
|
|
85
|
-
}, [
|
|
86
|
-
if (
|
|
84
|
+
}, [A, Y]);
|
|
85
|
+
if (de(() => {
|
|
86
|
+
X();
|
|
87
|
+
}, [X]), !a.canManagePaymentMethods) return /* @__PURE__ */ m(t, { message: "You don't have permission to manage payout accounts." });
|
|
88
|
+
if (F && o(F)) return /* @__PURE__ */ m(r, {
|
|
87
89
|
title: "Payout data unavailable",
|
|
88
|
-
message:
|
|
89
|
-
onRetry: () => void
|
|
90
|
+
message: F.message,
|
|
91
|
+
onRetry: () => void X(),
|
|
90
92
|
showRetry: !0
|
|
91
93
|
});
|
|
92
|
-
let
|
|
93
|
-
if (!
|
|
94
|
-
|
|
94
|
+
let je = async () => {
|
|
95
|
+
if (!A) return;
|
|
96
|
+
J(null);
|
|
95
97
|
let e = {
|
|
96
|
-
billingAccountId:
|
|
97
|
-
...
|
|
98
|
+
billingAccountId: A,
|
|
99
|
+
...L
|
|
98
100
|
};
|
|
99
|
-
if (
|
|
101
|
+
if (U) await se(U, e, Y), E("billing.payout_account.updated", {
|
|
100
102
|
route: "/billing/payouts",
|
|
101
|
-
entityId:
|
|
103
|
+
entityId: U,
|
|
102
104
|
source: "payouts"
|
|
103
105
|
});
|
|
104
106
|
else {
|
|
105
|
-
let t = await
|
|
106
|
-
|
|
107
|
+
let t = await u(e, Y);
|
|
108
|
+
E("billing.payout_account.added", {
|
|
107
109
|
route: "/billing/payouts",
|
|
108
|
-
entityId:
|
|
110
|
+
entityId: A,
|
|
109
111
|
source: "payouts"
|
|
110
|
-
}),
|
|
112
|
+
}), J(t.status === "ACTIVE" ? "Payout account saved and ready to receive payouts." : "Payout account saved. It stays pending until the payout processor verifies it; you can request payouts to it once it is verified.");
|
|
111
113
|
}
|
|
112
|
-
|
|
114
|
+
R({
|
|
113
115
|
label: "",
|
|
114
116
|
type: "BANK_ACCOUNT",
|
|
115
117
|
providerPreference: "AUTO",
|
|
@@ -121,17 +123,17 @@ var w = [
|
|
|
121
123
|
routingNumber: "",
|
|
122
124
|
ifsc: "",
|
|
123
125
|
upiId: ""
|
|
124
|
-
}),
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
},
|
|
128
|
-
|
|
126
|
+
}), W(null), await X();
|
|
127
|
+
}, Me = async (e) => {
|
|
128
|
+
J(null), await oe(e, Y), await X();
|
|
129
|
+
}, Ne = async (e) => {
|
|
130
|
+
J(null), await ne(e, Y), E("billing.payout_account.archived", {
|
|
129
131
|
route: "/billing/payouts",
|
|
130
132
|
entityId: e,
|
|
131
133
|
source: "payouts"
|
|
132
|
-
}), await
|
|
133
|
-
},
|
|
134
|
-
|
|
134
|
+
}), await X();
|
|
135
|
+
}, Pe = (e) => {
|
|
136
|
+
J(null), W(e.id), R((t) => ({
|
|
135
137
|
...t,
|
|
136
138
|
label: e.label,
|
|
137
139
|
type: e.type,
|
|
@@ -145,121 +147,156 @@ var w = [
|
|
|
145
147
|
ifsc: "",
|
|
146
148
|
upiId: ""
|
|
147
149
|
}));
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
billingAccountId:
|
|
151
|
-
payoutAccountId:
|
|
152
|
-
amount: Number(
|
|
153
|
-
currency:
|
|
154
|
-
},
|
|
150
|
+
}, Z = j.find((e) => e.id === V), Q = j.some(d), $ = async () => {
|
|
151
|
+
A && V && z && Z && d(Z) && (await ae({
|
|
152
|
+
billingAccountId: A,
|
|
153
|
+
payoutAccountId: V,
|
|
154
|
+
amount: Number(z),
|
|
155
|
+
currency: Z.currency
|
|
156
|
+
}, Y), E("billing.payout.requested", {
|
|
155
157
|
route: "/billing/payouts",
|
|
156
|
-
entityId:
|
|
158
|
+
entityId: V,
|
|
157
159
|
source: "payouts",
|
|
158
|
-
amount: Number(
|
|
159
|
-
currency:
|
|
160
|
-
}),
|
|
160
|
+
amount: Number(z),
|
|
161
|
+
currency: Z.currency
|
|
162
|
+
}), B(""), await X());
|
|
163
|
+
}, Fe = async () => {
|
|
164
|
+
x(!0), C(null);
|
|
165
|
+
try {
|
|
166
|
+
await $(), y(!1), T({
|
|
167
|
+
ok: !0,
|
|
168
|
+
message: `Payout of ${i(Number(z), Z?.currency ?? "")} requested. We'll show its status below.`
|
|
169
|
+
});
|
|
170
|
+
} catch (e) {
|
|
171
|
+
C(e instanceof Error ? e.message : "The payout request failed.");
|
|
172
|
+
} finally {
|
|
173
|
+
x(!1);
|
|
174
|
+
}
|
|
161
175
|
};
|
|
162
|
-
return /* @__PURE__ */
|
|
176
|
+
return /* @__PURE__ */ h("div", {
|
|
163
177
|
className: "space-y-6 p-6",
|
|
164
178
|
children: [
|
|
165
|
-
/* @__PURE__ */
|
|
179
|
+
v && /* @__PURE__ */ m(ee, {
|
|
180
|
+
open: De,
|
|
181
|
+
title: "Review your payout",
|
|
182
|
+
description: "The amount is moved out of your available balance when you confirm.",
|
|
183
|
+
details: [{
|
|
184
|
+
label: "Amount",
|
|
185
|
+
value: i(Number(z), Z?.currency ?? "")
|
|
186
|
+
}, {
|
|
187
|
+
label: "Paid to",
|
|
188
|
+
value: Z ? `${Z.label} · ${Z.currency}` : ""
|
|
189
|
+
}],
|
|
190
|
+
confirmLabel: "Request payout",
|
|
191
|
+
busyLabel: "Requesting…",
|
|
192
|
+
isBusy: b,
|
|
193
|
+
error: S,
|
|
194
|
+
onConfirm: () => void Fe(),
|
|
195
|
+
onCancel: () => y(!1)
|
|
196
|
+
}),
|
|
197
|
+
v && w && /* @__PURE__ */ m("div", {
|
|
198
|
+
role: w.ok ? "status" : "alert",
|
|
199
|
+
className: `rounded-md border p-3 text-sm ${w.ok ? "border-status-success-border text-status-success-text" : "border-status-error-border text-status-error-text"}`,
|
|
200
|
+
children: w.message
|
|
201
|
+
}),
|
|
202
|
+
/* @__PURE__ */ m(n, {
|
|
166
203
|
title: "Payouts",
|
|
167
204
|
description: "Register payout accounts, request withdrawals, and track disbursement status."
|
|
168
205
|
}),
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
|
|
206
|
+
/* @__PURE__ */ m(we, { children: "Get your earnings paid out to a real bank account or UPI. Register where you want to be paid, request a withdrawal of your available balance, and track each request from submission through to disbursement here." }),
|
|
207
|
+
q ? /* @__PURE__ */ m("div", {
|
|
171
208
|
role: "status",
|
|
172
209
|
className: "rounded-lg border border-border-subtle bg-status-info-bg-subtle p-4 text-sm text-status-info-text",
|
|
173
|
-
children:
|
|
210
|
+
children: q
|
|
174
211
|
}) : null,
|
|
175
|
-
|
|
212
|
+
F && !o(F) ? /* @__PURE__ */ m("div", {
|
|
176
213
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm text-status-error-text",
|
|
177
|
-
children:
|
|
214
|
+
children: F.message
|
|
178
215
|
}) : null,
|
|
179
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ h("div", {
|
|
180
217
|
className: "grid gap-6 xl:grid-cols-[1.05fr,1.95fr]",
|
|
181
|
-
children: [/* @__PURE__ */
|
|
218
|
+
children: [/* @__PURE__ */ h("section", {
|
|
182
219
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
183
220
|
children: [
|
|
184
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ m("h2", {
|
|
185
222
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
186
|
-
children:
|
|
223
|
+
children: U ? "Edit payout account" : "Add payout account"
|
|
187
224
|
}),
|
|
188
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ h("div", {
|
|
189
226
|
className: "space-y-3",
|
|
190
227
|
children: [
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
value:
|
|
193
|
-
onChange: (e) =>
|
|
228
|
+
/* @__PURE__ */ m("input", {
|
|
229
|
+
value: L.label,
|
|
230
|
+
onChange: (e) => R((t) => ({
|
|
194
231
|
...t,
|
|
195
232
|
label: e.target.value
|
|
196
233
|
})),
|
|
197
234
|
placeholder: "Label",
|
|
198
235
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
199
236
|
}),
|
|
200
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ h("div", {
|
|
201
238
|
className: "grid gap-3 md:grid-cols-2",
|
|
202
|
-
children: [/* @__PURE__ */
|
|
203
|
-
value:
|
|
204
|
-
onChange: (e) =>
|
|
239
|
+
children: [/* @__PURE__ */ h("select", {
|
|
240
|
+
value: L.type,
|
|
241
|
+
onChange: (e) => R((t) => ({
|
|
205
242
|
...t,
|
|
206
243
|
type: e.target.value
|
|
207
244
|
})),
|
|
208
245
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
209
246
|
children: [
|
|
210
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ m("option", {
|
|
211
248
|
value: "BANK_ACCOUNT",
|
|
212
249
|
children: "Bank account"
|
|
213
250
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ m("option", {
|
|
215
252
|
value: "UPI",
|
|
216
253
|
children: "UPI"
|
|
217
254
|
}),
|
|
218
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ m("option", {
|
|
219
256
|
value: "WALLET",
|
|
220
257
|
children: "Wallet"
|
|
221
258
|
})
|
|
222
259
|
]
|
|
223
|
-
}), /* @__PURE__ */
|
|
224
|
-
value:
|
|
225
|
-
onChange: (e) =>
|
|
260
|
+
}), /* @__PURE__ */ h("select", {
|
|
261
|
+
value: L.providerPreference,
|
|
262
|
+
onChange: (e) => R((t) => ({
|
|
226
263
|
...t,
|
|
227
264
|
providerPreference: e.target.value
|
|
228
265
|
})),
|
|
229
266
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
230
267
|
children: [
|
|
231
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ m("option", {
|
|
232
269
|
value: "AUTO",
|
|
233
270
|
children: "Auto"
|
|
234
271
|
}),
|
|
235
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ m("option", {
|
|
236
273
|
value: "STRIPE",
|
|
237
274
|
children: "Stripe"
|
|
238
275
|
}),
|
|
239
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ m("option", {
|
|
240
277
|
value: "RAZORPAY",
|
|
241
278
|
children: "Razorpay"
|
|
242
279
|
}),
|
|
243
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ m("option", {
|
|
244
281
|
value: "MANUAL",
|
|
245
282
|
children: "Manual"
|
|
246
283
|
})
|
|
247
284
|
]
|
|
248
285
|
})]
|
|
249
286
|
}),
|
|
250
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ h("div", {
|
|
251
288
|
className: "grid gap-3 md:grid-cols-2",
|
|
252
|
-
children: [/* @__PURE__ */
|
|
253
|
-
value:
|
|
254
|
-
onChange: (e) =>
|
|
289
|
+
children: [/* @__PURE__ */ m("input", {
|
|
290
|
+
value: L.country,
|
|
291
|
+
onChange: (e) => R((t) => ({
|
|
255
292
|
...t,
|
|
256
293
|
country: e.target.value.toUpperCase()
|
|
257
294
|
})),
|
|
258
295
|
placeholder: "Country",
|
|
259
296
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
260
|
-
}), /* @__PURE__ */
|
|
261
|
-
value:
|
|
262
|
-
onChange: (e) =>
|
|
297
|
+
}), /* @__PURE__ */ m("input", {
|
|
298
|
+
value: L.currency,
|
|
299
|
+
onChange: (e) => R((t) => ({
|
|
263
300
|
...t,
|
|
264
301
|
currency: e.target.value.toUpperCase()
|
|
265
302
|
})),
|
|
@@ -267,49 +304,49 @@ var w = [
|
|
|
267
304
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
268
305
|
})]
|
|
269
306
|
}),
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
value:
|
|
272
|
-
onChange: (e) =>
|
|
307
|
+
/* @__PURE__ */ m("input", {
|
|
308
|
+
value: L.accountHolderName,
|
|
309
|
+
onChange: (e) => R((t) => ({
|
|
273
310
|
...t,
|
|
274
311
|
accountHolderName: e.target.value
|
|
275
312
|
})),
|
|
276
313
|
placeholder: "Account holder name",
|
|
277
314
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
278
315
|
}),
|
|
279
|
-
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
value:
|
|
282
|
-
onChange: (e) =>
|
|
316
|
+
L.type === "BANK_ACCOUNT" ? /* @__PURE__ */ h(ge, { children: [
|
|
317
|
+
/* @__PURE__ */ m("input", {
|
|
318
|
+
value: L.bankName,
|
|
319
|
+
onChange: (e) => R((t) => ({
|
|
283
320
|
...t,
|
|
284
321
|
bankName: e.target.value
|
|
285
322
|
})),
|
|
286
323
|
placeholder: "Bank name",
|
|
287
324
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
288
325
|
}),
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
-
value:
|
|
291
|
-
onChange: (e) =>
|
|
326
|
+
/* @__PURE__ */ m("input", {
|
|
327
|
+
value: L.accountNumber,
|
|
328
|
+
onChange: (e) => R((t) => ({
|
|
292
329
|
...t,
|
|
293
330
|
accountNumber: e.target.value
|
|
294
331
|
})),
|
|
295
332
|
placeholder: "Account number",
|
|
296
333
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
297
334
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
value:
|
|
300
|
-
onChange: (e) =>
|
|
335
|
+
/* @__PURE__ */ m("input", {
|
|
336
|
+
value: L.country === "IN" ? L.ifsc : L.routingNumber,
|
|
337
|
+
onChange: (e) => R((t) => t.country === "IN" ? {
|
|
301
338
|
...t,
|
|
302
339
|
ifsc: e.target.value
|
|
303
340
|
} : {
|
|
304
341
|
...t,
|
|
305
342
|
routingNumber: e.target.value
|
|
306
343
|
}),
|
|
307
|
-
placeholder:
|
|
344
|
+
placeholder: L.country === "IN" ? "IFSC" : "Routing number",
|
|
308
345
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
309
346
|
})
|
|
310
|
-
] }) :
|
|
311
|
-
value:
|
|
312
|
-
onChange: (e) =>
|
|
347
|
+
] }) : L.type === "UPI" ? /* @__PURE__ */ m("input", {
|
|
348
|
+
value: L.upiId,
|
|
349
|
+
onChange: (e) => R((t) => ({
|
|
313
350
|
...t,
|
|
314
351
|
upiId: e.target.value
|
|
315
352
|
})),
|
|
@@ -318,16 +355,16 @@ var w = [
|
|
|
318
355
|
}) : null
|
|
319
356
|
]
|
|
320
357
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ h("button", {
|
|
322
359
|
type: "button",
|
|
323
|
-
onClick: () => void
|
|
360
|
+
onClick: () => void je(),
|
|
324
361
|
className: "mt-4 inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
362
|
+
children: [/* @__PURE__ */ m(pe, { className: "size-4" }), U ? "Update payout account" : "Save payout account"]
|
|
326
363
|
}),
|
|
327
|
-
|
|
364
|
+
U ? /* @__PURE__ */ m("button", {
|
|
328
365
|
type: "button",
|
|
329
366
|
onClick: () => {
|
|
330
|
-
|
|
367
|
+
W(null), R({
|
|
331
368
|
label: "",
|
|
332
369
|
type: "BANK_ACCOUNT",
|
|
333
370
|
providerPreference: "AUTO",
|
|
@@ -345,96 +382,98 @@ var w = [
|
|
|
345
382
|
children: "Cancel edit"
|
|
346
383
|
}) : null
|
|
347
384
|
]
|
|
348
|
-
}), /* @__PURE__ */
|
|
385
|
+
}), /* @__PURE__ */ h("section", {
|
|
349
386
|
className: "space-y-4",
|
|
350
|
-
children: [/* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ h("div", {
|
|
351
388
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
352
389
|
children: [
|
|
353
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ h("div", {
|
|
354
391
|
className: "mb-4 flex items-center justify-between",
|
|
355
|
-
children: [/* @__PURE__ */
|
|
392
|
+
children: [/* @__PURE__ */ m("h2", {
|
|
356
393
|
className: "text-lg font-semibold text-text-primary",
|
|
357
394
|
children: "Request payout"
|
|
358
|
-
}), /* @__PURE__ */
|
|
395
|
+
}), /* @__PURE__ */ h("button", {
|
|
359
396
|
type: "button",
|
|
360
|
-
onClick: () => void
|
|
397
|
+
onClick: () => void X(),
|
|
361
398
|
className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary",
|
|
362
|
-
children: [/* @__PURE__ */
|
|
399
|
+
children: [/* @__PURE__ */ m(me, { className: "size-4" }), "Refresh"]
|
|
363
400
|
})]
|
|
364
401
|
}),
|
|
365
|
-
|
|
402
|
+
j.length === 0 && !N ? /* @__PURE__ */ m(_, {
|
|
366
403
|
illustration: "empty-generic",
|
|
367
404
|
title: "No payout accounts yet",
|
|
368
405
|
description: "Add a payout account before requesting a withdrawal."
|
|
369
|
-
}) : /* @__PURE__ */
|
|
406
|
+
}) : /* @__PURE__ */ h("div", {
|
|
370
407
|
className: "space-y-3",
|
|
371
408
|
children: [
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
-
value:
|
|
374
|
-
onChange: (e) =>
|
|
409
|
+
/* @__PURE__ */ h("select", {
|
|
410
|
+
value: V,
|
|
411
|
+
onChange: (e) => H(e.target.value),
|
|
375
412
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
376
|
-
children: [
|
|
413
|
+
children: [Q ? null : /* @__PURE__ */ m("option", {
|
|
377
414
|
value: "",
|
|
378
415
|
children: "No verified payout account yet"
|
|
379
|
-
}),
|
|
416
|
+
}), j.map((e) => /* @__PURE__ */ h("option", {
|
|
380
417
|
value: e.id,
|
|
381
|
-
disabled: !
|
|
418
|
+
disabled: !d(e),
|
|
382
419
|
children: [
|
|
383
420
|
e.label,
|
|
384
421
|
" · ",
|
|
385
422
|
e.currency,
|
|
386
423
|
" ·",
|
|
387
424
|
" ",
|
|
388
|
-
|
|
425
|
+
f(e.status).label
|
|
389
426
|
]
|
|
390
427
|
}, e.id))]
|
|
391
428
|
}),
|
|
392
|
-
|
|
429
|
+
Q ? null : /* @__PURE__ */ m("p", {
|
|
393
430
|
className: "text-sm text-text-secondary",
|
|
394
431
|
children: "Payouts can be requested once one of your payout accounts is verified."
|
|
395
432
|
}),
|
|
396
|
-
/* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ h("label", {
|
|
397
434
|
className: "block space-y-1 text-sm font-medium text-text-primary",
|
|
398
|
-
children: [/* @__PURE__ */
|
|
399
|
-
value:
|
|
400
|
-
onChange: (e) =>
|
|
435
|
+
children: [/* @__PURE__ */ m("span", { children: "Amount" }), /* @__PURE__ */ m("input", {
|
|
436
|
+
value: z,
|
|
437
|
+
onChange: (e) => B(e.target.value),
|
|
401
438
|
inputMode: "decimal",
|
|
402
439
|
placeholder: "0.00",
|
|
403
440
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-normal text-text-primary"
|
|
404
441
|
})]
|
|
405
442
|
}),
|
|
406
|
-
/* @__PURE__ */
|
|
443
|
+
/* @__PURE__ */ h("button", {
|
|
407
444
|
type: "button",
|
|
408
|
-
onClick: () =>
|
|
409
|
-
|
|
445
|
+
onClick: () => {
|
|
446
|
+
v ? (C(null), T(null), y(!0)) : $();
|
|
447
|
+
},
|
|
448
|
+
disabled: !Z || !d(Z),
|
|
410
449
|
className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text disabled:cursor-not-allowed disabled:opacity-50",
|
|
411
|
-
children: [/* @__PURE__ */
|
|
450
|
+
children: [/* @__PURE__ */ m(he, { className: "size-4" }), "Request payout"]
|
|
412
451
|
})
|
|
413
452
|
]
|
|
414
453
|
}),
|
|
415
|
-
|
|
454
|
+
j.length > 0 ? /* @__PURE__ */ h("div", {
|
|
416
455
|
className: "mt-4 space-y-3 rounded-md border border-border-subtle bg-bg-surface/60 p-3",
|
|
417
|
-
children: [/* @__PURE__ */
|
|
456
|
+
children: [/* @__PURE__ */ m("h3", {
|
|
418
457
|
className: "text-sm font-semibold text-text-primary",
|
|
419
458
|
children: "Saved payout accounts"
|
|
420
|
-
}),
|
|
421
|
-
let t =
|
|
422
|
-
return /* @__PURE__ */
|
|
459
|
+
}), j.map((e) => {
|
|
460
|
+
let t = f(e.status);
|
|
461
|
+
return /* @__PURE__ */ h("div", {
|
|
423
462
|
className: "flex flex-wrap items-center justify-between gap-3 rounded-md border border-border-subtle/70 bg-bg-surface px-3 py-2 text-sm",
|
|
424
|
-
children: [/* @__PURE__ */
|
|
425
|
-
/* @__PURE__ */
|
|
463
|
+
children: [/* @__PURE__ */ h("div", { children: [
|
|
464
|
+
/* @__PURE__ */ h("p", {
|
|
426
465
|
className: "flex flex-wrap items-center gap-2 font-medium text-text-primary",
|
|
427
466
|
children: [
|
|
428
467
|
e.label,
|
|
429
468
|
" ",
|
|
430
469
|
e.isDefault ? "• Default" : "",
|
|
431
|
-
/* @__PURE__ */
|
|
470
|
+
/* @__PURE__ */ m("span", {
|
|
432
471
|
className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${ce[t.tone]}`,
|
|
433
472
|
children: t.label
|
|
434
473
|
})
|
|
435
474
|
]
|
|
436
475
|
}),
|
|
437
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ h("p", {
|
|
438
477
|
className: "text-text-secondary",
|
|
439
478
|
children: [
|
|
440
479
|
e.providerPreference,
|
|
@@ -442,28 +481,28 @@ var w = [
|
|
|
442
481
|
e.currency
|
|
443
482
|
]
|
|
444
483
|
}),
|
|
445
|
-
t.hint ? /* @__PURE__ */
|
|
484
|
+
t.hint ? /* @__PURE__ */ m("p", {
|
|
446
485
|
className: "mt-1 text-xs text-text-secondary",
|
|
447
486
|
children: t.hint
|
|
448
487
|
}) : null
|
|
449
|
-
] }), /* @__PURE__ */
|
|
488
|
+
] }), /* @__PURE__ */ h("div", {
|
|
450
489
|
className: "flex flex-wrap gap-2",
|
|
451
490
|
children: [
|
|
452
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ m("button", {
|
|
453
492
|
type: "button",
|
|
454
|
-
onClick: () =>
|
|
493
|
+
onClick: () => Pe(e),
|
|
455
494
|
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
|
|
456
495
|
children: "Edit"
|
|
457
496
|
}),
|
|
458
|
-
e.isDefault ? null : /* @__PURE__ */
|
|
497
|
+
e.isDefault ? null : /* @__PURE__ */ m("button", {
|
|
459
498
|
type: "button",
|
|
460
|
-
onClick: () => void
|
|
499
|
+
onClick: () => void Me(e.id),
|
|
461
500
|
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
|
|
462
501
|
children: "Make default"
|
|
463
502
|
}),
|
|
464
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ m("button", {
|
|
465
504
|
type: "button",
|
|
466
|
-
onClick: () =>
|
|
505
|
+
onClick: () => K(e.id),
|
|
467
506
|
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text",
|
|
468
507
|
children: "Archive"
|
|
469
508
|
})
|
|
@@ -473,32 +512,32 @@ var w = [
|
|
|
473
512
|
})]
|
|
474
513
|
}) : null
|
|
475
514
|
]
|
|
476
|
-
}), /* @__PURE__ */
|
|
515
|
+
}), /* @__PURE__ */ h("div", {
|
|
477
516
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
478
|
-
children: [/* @__PURE__ */
|
|
517
|
+
children: [/* @__PURE__ */ m("h2", {
|
|
479
518
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
480
519
|
children: "Payout requests"
|
|
481
|
-
}), M.length === 0 && !
|
|
520
|
+
}), M.length === 0 && !N ? /* @__PURE__ */ m(_, {
|
|
482
521
|
illustration: "empty-data",
|
|
483
522
|
title: "No payout requests yet",
|
|
484
523
|
description: "Your payout requests and processing updates will appear here."
|
|
485
|
-
}) : /* @__PURE__ */
|
|
524
|
+
}) : /* @__PURE__ */ m(Te, {
|
|
486
525
|
data: M,
|
|
487
526
|
rowKey: (e) => e.id,
|
|
488
|
-
columns:
|
|
527
|
+
columns: Ee
|
|
489
528
|
})]
|
|
490
529
|
})]
|
|
491
530
|
})]
|
|
492
531
|
}),
|
|
493
|
-
/* @__PURE__ */
|
|
494
|
-
open:
|
|
532
|
+
/* @__PURE__ */ m(_e, {
|
|
533
|
+
open: G !== null,
|
|
495
534
|
onOpenChange: (e) => {
|
|
496
|
-
e ||
|
|
535
|
+
e || K(null);
|
|
497
536
|
},
|
|
498
|
-
children: /* @__PURE__ */
|
|
537
|
+
children: /* @__PURE__ */ h(be, { children: [/* @__PURE__ */ h(Se, { children: [/* @__PURE__ */ m(Ce, { children: "Archive payout account?" }), /* @__PURE__ */ m(g, { children: "Archive this payout account? You can add a new one at any time." })] }), /* @__PURE__ */ h(xe, { children: [/* @__PURE__ */ m(ye, { children: "Cancel" }), /* @__PURE__ */ m(ve, {
|
|
499
538
|
onClick: () => {
|
|
500
|
-
let e =
|
|
501
|
-
|
|
539
|
+
let e = G;
|
|
540
|
+
K(null), e && Ne(e);
|
|
502
541
|
},
|
|
503
542
|
children: "Archive"
|
|
504
543
|
})] })] })
|
|
@@ -506,6 +545,6 @@ var w = [
|
|
|
506
545
|
]
|
|
507
546
|
});
|
|
508
547
|
};
|
|
509
|
-
export {
|
|
548
|
+
export { v as PayoutsPage };
|
|
510
549
|
|
|
511
550
|
//# sourceMappingURL=PayoutsPage.js.map
|