@burdenoff/microfe-billing 2026.1113.2 → 2026.1113.4
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/BillingRoot.js +83 -77
- package/dist/billing/BillingRoot.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +78 -78
- package/dist/billing/modules/addons/pages/AddonCreatePage.js +70 -70
- package/dist/billing/modules/addons/pages/AddonDetailPage.js +72 -72
- package/dist/billing/modules/addons/pages/AddonEditPage.js +79 -79
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +224 -224
- package/dist/billing/modules/addons/pages/AddonsListPage.js +186 -186
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +168 -168
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js +88 -88
- package/dist/billing/modules/billing/hooks/index.js +5 -5
- package/dist/billing/modules/billing/hooks/useInvoices.js +39 -20
- package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
- package/dist/billing/modules/billing/index.js +14 -14
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +92 -92
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +160 -160
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +100 -100
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +105 -105
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +37 -37
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +41 -41
- package/dist/billing/modules/billing/pages/RefundsPage.js +334 -334
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +174 -174
- package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +24 -24
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/checkout/components/OrderSummary.js +71 -71
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +646 -625
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/checkout/utils/checkoutOptions.d.ts +23 -0
- package/dist/billing/modules/checkout/utils/checkoutOptions.js +8 -0
- package/dist/billing/modules/checkout/utils/checkoutOptions.js.map +1 -0
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +112 -112
- package/dist/billing/modules/coupons/pages/CouponsListPage.js +118 -118
- package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js +119 -119
- package/dist/billing/modules/coupons/pages/EditCouponPage.js +82 -82
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js +30 -30
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +77 -77
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +187 -164
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +67 -67
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +594 -442
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/dashboard/utils/overviewSummary.d.ts +46 -0
- package/dist/billing/modules/dashboard/utils/overviewSummary.js +37 -0
- package/dist/billing/modules/dashboard/utils/overviewSummary.js.map +1 -0
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js +199 -199
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
- package/dist/billing/modules/earnings/components/PayoutDestinationList.d.ts +15 -0
- package/dist/billing/modules/earnings/components/PayoutDestinationList.js +66 -0
- package/dist/billing/modules/earnings/components/PayoutDestinationList.js.map +1 -0
- package/dist/billing/modules/earnings/components/PayoutErrorNotice.d.ts +7 -0
- package/dist/billing/modules/earnings/components/PayoutErrorNotice.js +19 -0
- package/dist/billing/modules/earnings/components/PayoutErrorNotice.js.map +1 -0
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +64 -64
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +122 -122
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +123 -110
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +178 -178
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +215 -157
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/earnings/utils/payoutDestination.d.ts +20 -0
- package/dist/billing/modules/earnings/utils/payoutDestination.js +27 -0
- package/dist/billing/modules/earnings/utils/payoutDestination.js.map +1 -0
- package/dist/billing/modules/earnings/utils/plainPayoutError.d.ts +10 -0
- package/dist/billing/modules/earnings/utils/plainPayoutError.js +50 -0
- package/dist/billing/modules/earnings/utils/plainPayoutError.js.map +1 -0
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +54 -54
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +94 -94
- package/dist/billing/modules/plans/pages/PlanCreatePage.js +73 -73
- package/dist/billing/modules/plans/pages/PlanDetailPage.js +96 -96
- package/dist/billing/modules/plans/pages/PlanEditPage.js +16 -16
- package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +100 -100
- package/dist/billing/modules/plans/pages/PlansListPage.js +88 -88
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +60 -60
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js +37 -37
- package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js +62 -62
- package/dist/billing/modules/quota/pages/QuotaPage.js +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +69 -69
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +76 -76
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +80 -80
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +95 -95
- package/dist/billing/modules/settings/pages/SettingsPage.js +134 -134
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +62 -62
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +36 -36
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +534 -410
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +111 -111
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +166 -160
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.d.ts +30 -0
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js +20 -0
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js.map +1 -0
- package/dist/billing/modules/subscriptions/utils/upgradeAccess.d.ts +10 -0
- package/dist/billing/modules/subscriptions/utils/upgradeAccess.js +7 -0
- package/dist/billing/modules/subscriptions/utils/upgradeAccess.js.map +1 -0
- package/dist/billing/modules/usage/pages/UsagePage.js +722 -591
- package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
- package/dist/billing/modules/usage/utils/usageHealth.d.ts +63 -0
- package/dist/billing/modules/usage/utils/usageHealth.js +43 -0
- package/dist/billing/modules/usage/utils/usageHealth.js.map +1 -0
- package/dist/billing/shared/components/EmptyState.js +3 -3
- package/dist/billing/shared/components/MoneyActionDialog.js +12 -12
- package/dist/billing/shared/ui/MetricCard.js +13 -13
- package/dist/billing/shared/utils/format.js +16 -4
- package/dist/billing/shared/utils/format.js.map +1 -1
- package/dist/billing/shared/utils/index.js +8 -8
- package/dist/generated/global-operations.js +294 -286
- package/dist/generated/global-operations.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,31 +1,36 @@
|
|
|
1
1
|
import { useBillingPermissions as e } from "../../../hooks/useBillingPermissions.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { useIsFluidgridsVariant as t } from "../../../hooks/useBillingVariant.js";
|
|
3
|
+
import { AccessDenied as ee } from "../../../shared/components/AccessDenied.js";
|
|
4
|
+
import { PageHeader as te } from "../../../shared/components/PageHeader.js";
|
|
5
|
+
import { ServerError as ne } from "../../../shared/components/ServerError.js";
|
|
6
|
+
import { MoneyActionDialog as re } from "../../../shared/components/MoneyActionDialog.js";
|
|
7
7
|
import "../../../shared/components/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { useTr as ie } from "../../../shared/hooks/useTr.js";
|
|
9
|
+
import { formatCurrency as n, formatDateTime as r } from "../../../shared/utils/format.js";
|
|
10
|
+
import { isServerError as i } from "../../../shared/utils/error.js";
|
|
11
|
+
import { useBillingEventEmitter as ae } from "../../../hooks/useBillingEventEmitter.js";
|
|
12
|
+
import { useBilling as oe } from "../../../providers/BillingProvider.js";
|
|
12
13
|
import "../../../shared/utils/index.js";
|
|
13
|
-
import { useGetDefaultBillingAccountSettingsQuery as
|
|
14
|
-
import { addPayoutAccount as
|
|
15
|
-
import { PAYOUT_ACCOUNT_TONE_CLASSES as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
14
|
+
import { useGetDefaultBillingAccountSettingsQuery as se } from "../../../../generated/global-operations.js";
|
|
15
|
+
import { addPayoutAccount as ce, archivePayoutAccount as le, fetchPayoutAccounts as ue, fetchPayoutRequests as de, requestPayout as fe, setDefaultPayoutAccount as pe, updatePayoutAccount as me } from "../api.js";
|
|
16
|
+
import { PAYOUT_ACCOUNT_TONE_CLASSES as he, isPayoutAccountPayable as a, payoutAccountStatusView as o, pickPayableAccountId as ge } from "../payoutAccountStatus.js";
|
|
17
|
+
import { PayoutDestinationList as _e } from "../components/PayoutDestinationList.js";
|
|
18
|
+
import { PayoutErrorNotice as s } from "../components/PayoutErrorNotice.js";
|
|
19
|
+
import { toPayoutDestinations as ve } from "../utils/payoutDestination.js";
|
|
20
|
+
import { plainPayoutError as c, rawErrorText as l } from "../utils/plainPayoutError.js";
|
|
21
|
+
import { useCallback as ye, useEffect as be, useMemo as xe, useState as u } from "react";
|
|
22
|
+
import { AlertDialog as Se, AlertDialogAction as Ce, AlertDialogCancel as we, AlertDialogContent as Te, AlertDialogDescription as Ee, AlertDialogFooter as De, AlertDialogHeader as Oe, AlertDialogTitle as ke, IllustratedEmptyState as d, PagePurpose as Ae, ResponsiveTable as je, ShowTechnicalDetails as f } from "@burdenoff/fe-libs/ui";
|
|
23
|
+
import { Landmark as Me, RefreshCw as Ne, Send as Pe } from "lucide-react";
|
|
24
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
20
25
|
// src/billing/modules/earnings/pages/PayoutsPage.tsx
|
|
21
|
-
var
|
|
26
|
+
var Fe = [
|
|
22
27
|
{
|
|
23
28
|
key: "amount",
|
|
24
29
|
header: "Amount",
|
|
25
30
|
priority: "primary",
|
|
26
31
|
cell: (e) => /* @__PURE__ */ m("span", {
|
|
27
32
|
className: "tabular-nums",
|
|
28
|
-
children:
|
|
33
|
+
children: n(e.requestedAmount, e.currency)
|
|
29
34
|
})
|
|
30
35
|
},
|
|
31
36
|
{
|
|
@@ -46,10 +51,10 @@ var Ee = [
|
|
|
46
51
|
{
|
|
47
52
|
key: "created",
|
|
48
53
|
header: "Created",
|
|
49
|
-
cell: (e) =>
|
|
54
|
+
cell: (e) => r(e.createdAt)
|
|
50
55
|
}
|
|
51
|
-
],
|
|
52
|
-
let
|
|
56
|
+
], g = () => {
|
|
57
|
+
let r = e(), g = t(), _ = ie(), [Ie, v] = u(!1), [Le, y] = u(!1), [Re, b] = u(null), [x, S] = u(null), [C, w] = u(null), [T, E] = u(null), { emit: D } = ae(), { apiGatewayUrl: O, authToken: k, orgId: A } = oe(), { data: ze } = se({}), j = ze?.getDefaultBillingAccount?.id, [M, Be] = u([]), [N, Ve] = u([]), [P, F] = u(!0), [I, L] = u(null), [R, z] = u({
|
|
53
58
|
label: "",
|
|
54
59
|
type: "BANK_ACCOUNT",
|
|
55
60
|
providerPreference: "AUTO",
|
|
@@ -61,57 +66,74 @@ var Ee = [
|
|
|
61
66
|
routingNumber: "",
|
|
62
67
|
ifsc: "",
|
|
63
68
|
upiId: ""
|
|
64
|
-
}), [
|
|
65
|
-
apiGatewayUrl:
|
|
66
|
-
authToken:
|
|
67
|
-
orgId:
|
|
69
|
+
}), [B, V] = u(""), [H, U] = u(""), [W, G] = u(null), [He, K] = u(null), [q, J] = u(null), Y = xe(() => ({
|
|
70
|
+
apiGatewayUrl: O,
|
|
71
|
+
authToken: k,
|
|
72
|
+
orgId: A
|
|
68
73
|
}), [
|
|
69
|
-
D,
|
|
70
74
|
O,
|
|
71
|
-
k
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
k,
|
|
76
|
+
A
|
|
77
|
+
]), X = ye(async () => {
|
|
78
|
+
if (j) {
|
|
79
|
+
F(!0), L(null);
|
|
75
80
|
try {
|
|
76
|
-
let [e, t] = await Promise.all([
|
|
77
|
-
|
|
81
|
+
let [e, t] = await Promise.all([ue(j, Y), de(j, Y)]);
|
|
82
|
+
Be(e), Ve(t), U((t) => ge(e, t));
|
|
78
83
|
} catch (e) {
|
|
79
|
-
|
|
84
|
+
L(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load payout data"));
|
|
80
85
|
} finally {
|
|
81
|
-
|
|
86
|
+
F(!1);
|
|
82
87
|
}
|
|
83
88
|
}
|
|
84
|
-
}, [
|
|
85
|
-
if (
|
|
89
|
+
}, [j, Y]);
|
|
90
|
+
if (be(() => {
|
|
86
91
|
X();
|
|
87
|
-
}, [X]), !
|
|
88
|
-
if (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
}, [X]), !r.canManagePaymentMethods) return /* @__PURE__ */ m(ee, { message: "You don't have permission to manage payout accounts." });
|
|
93
|
+
if (I && i(I)) {
|
|
94
|
+
let e = /* @__PURE__ */ m(ne, {
|
|
95
|
+
title: "Payout data unavailable",
|
|
96
|
+
message: g ? c(I, _) : I.message,
|
|
97
|
+
onRetry: () => void X(),
|
|
98
|
+
showRetry: !0
|
|
99
|
+
});
|
|
100
|
+
return g ? /* @__PURE__ */ h(p, { children: [e, /* @__PURE__ */ m("div", {
|
|
101
|
+
className: "px-6",
|
|
102
|
+
children: /* @__PURE__ */ m(f, {
|
|
103
|
+
copyable: !0,
|
|
104
|
+
children: l(I)
|
|
105
|
+
})
|
|
106
|
+
})] }) : e;
|
|
107
|
+
}
|
|
108
|
+
let Z = async (e) => {
|
|
109
|
+
if (!g) return e();
|
|
110
|
+
w(null);
|
|
111
|
+
try {
|
|
112
|
+
await e();
|
|
113
|
+
} catch (e) {
|
|
114
|
+
w(e);
|
|
115
|
+
}
|
|
116
|
+
}, Ue = async () => {
|
|
117
|
+
if (!j) return;
|
|
96
118
|
J(null);
|
|
97
119
|
let e = {
|
|
98
|
-
billingAccountId:
|
|
99
|
-
...
|
|
120
|
+
billingAccountId: j,
|
|
121
|
+
...R
|
|
100
122
|
};
|
|
101
|
-
if (
|
|
123
|
+
if (W) await me(W, e, Y), D("billing.payout_account.updated", {
|
|
102
124
|
route: "/billing/payouts",
|
|
103
|
-
entityId:
|
|
125
|
+
entityId: W,
|
|
104
126
|
source: "payouts"
|
|
105
127
|
});
|
|
106
128
|
else {
|
|
107
|
-
let t = await
|
|
108
|
-
|
|
129
|
+
let t = await ce(e, Y);
|
|
130
|
+
D("billing.payout_account.added", {
|
|
109
131
|
route: "/billing/payouts",
|
|
110
|
-
entityId:
|
|
132
|
+
entityId: j,
|
|
111
133
|
source: "payouts"
|
|
112
134
|
}), 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.");
|
|
113
135
|
}
|
|
114
|
-
|
|
136
|
+
z({
|
|
115
137
|
label: "",
|
|
116
138
|
type: "BANK_ACCOUNT",
|
|
117
139
|
providerPreference: "AUTO",
|
|
@@ -123,17 +145,17 @@ var Ee = [
|
|
|
123
145
|
routingNumber: "",
|
|
124
146
|
ifsc: "",
|
|
125
147
|
upiId: ""
|
|
126
|
-
}),
|
|
127
|
-
},
|
|
128
|
-
J(null), await
|
|
129
|
-
},
|
|
130
|
-
J(null), await
|
|
148
|
+
}), G(null), await X();
|
|
149
|
+
}, We = async (e) => {
|
|
150
|
+
J(null), await pe(e, Y), await X();
|
|
151
|
+
}, Ge = async (e) => {
|
|
152
|
+
J(null), await le(e, Y), D("billing.payout_account.archived", {
|
|
131
153
|
route: "/billing/payouts",
|
|
132
154
|
entityId: e,
|
|
133
155
|
source: "payouts"
|
|
134
156
|
}), await X();
|
|
135
|
-
},
|
|
136
|
-
J(null),
|
|
157
|
+
}, Ke = (e) => {
|
|
158
|
+
J(null), G(e.id), z((t) => ({
|
|
137
159
|
...t,
|
|
138
160
|
label: e.label,
|
|
139
161
|
type: e.type,
|
|
@@ -147,72 +169,83 @@ var Ee = [
|
|
|
147
169
|
ifsc: "",
|
|
148
170
|
upiId: ""
|
|
149
171
|
}));
|
|
150
|
-
},
|
|
151
|
-
|
|
152
|
-
billingAccountId:
|
|
153
|
-
payoutAccountId:
|
|
154
|
-
amount: Number(
|
|
155
|
-
currency:
|
|
156
|
-
}, Y),
|
|
172
|
+
}, Q = M.find((e) => e.id === H), qe = M.some(a), $ = async () => {
|
|
173
|
+
j && H && B && Q && a(Q) && (await fe({
|
|
174
|
+
billingAccountId: j,
|
|
175
|
+
payoutAccountId: H,
|
|
176
|
+
amount: Number(B),
|
|
177
|
+
currency: Q.currency
|
|
178
|
+
}, Y), D("billing.payout.requested", {
|
|
157
179
|
route: "/billing/payouts",
|
|
158
|
-
entityId:
|
|
180
|
+
entityId: H,
|
|
159
181
|
source: "payouts",
|
|
160
|
-
amount: Number(
|
|
161
|
-
currency:
|
|
162
|
-
}),
|
|
163
|
-
},
|
|
164
|
-
|
|
182
|
+
amount: Number(B),
|
|
183
|
+
currency: Q.currency
|
|
184
|
+
}), V(""), await X());
|
|
185
|
+
}, Je = async () => {
|
|
186
|
+
y(!0), b(null), S(null);
|
|
165
187
|
try {
|
|
166
|
-
await $(),
|
|
188
|
+
await $(), v(!1), E({
|
|
167
189
|
ok: !0,
|
|
168
|
-
message: `Payout of ${
|
|
190
|
+
message: `Payout of ${n(Number(B), Q?.currency ?? "")} requested. We'll show its status below.`
|
|
169
191
|
});
|
|
170
192
|
} catch (e) {
|
|
171
|
-
|
|
193
|
+
S(e), b(c(e, _));
|
|
172
194
|
} finally {
|
|
173
|
-
|
|
195
|
+
y(!1);
|
|
174
196
|
}
|
|
175
197
|
};
|
|
176
198
|
return /* @__PURE__ */ h("div", {
|
|
177
199
|
className: "space-y-6 p-6",
|
|
178
200
|
children: [
|
|
179
|
-
|
|
180
|
-
open:
|
|
201
|
+
g && /* @__PURE__ */ m(re, {
|
|
202
|
+
open: Ie,
|
|
181
203
|
title: "Review your payout",
|
|
182
204
|
description: "The amount is moved out of your available balance when you confirm.",
|
|
183
|
-
details: [
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
205
|
+
details: [
|
|
206
|
+
{
|
|
207
|
+
label: "Amount",
|
|
208
|
+
value: n(Number(B), Q?.currency ?? "")
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
label: "Paid to",
|
|
212
|
+
value: Q ? `${Q.label} · ${Q.currency}` : ""
|
|
213
|
+
},
|
|
214
|
+
...x && l(x) ? [{
|
|
215
|
+
label: _("billing.payoutError.technical", "Technical details"),
|
|
216
|
+
value: /* @__PURE__ */ m(f, {
|
|
217
|
+
copyable: !0,
|
|
218
|
+
children: l(x)
|
|
219
|
+
})
|
|
220
|
+
}] : []
|
|
221
|
+
],
|
|
190
222
|
confirmLabel: "Request payout",
|
|
191
223
|
busyLabel: "Requesting…",
|
|
192
|
-
isBusy:
|
|
193
|
-
error:
|
|
194
|
-
onConfirm: () => void
|
|
195
|
-
onCancel: () =>
|
|
224
|
+
isBusy: Le,
|
|
225
|
+
error: Re,
|
|
226
|
+
onConfirm: () => void Je(),
|
|
227
|
+
onCancel: () => v(!1)
|
|
196
228
|
}),
|
|
197
|
-
|
|
198
|
-
role:
|
|
199
|
-
className: `rounded-md border p-3 text-sm ${
|
|
200
|
-
children:
|
|
229
|
+
g && T && /* @__PURE__ */ m("div", {
|
|
230
|
+
role: T.ok ? "status" : "alert",
|
|
231
|
+
className: `rounded-md border p-3 text-sm ${T.ok ? "border-status-success-border text-status-success-text" : "border-status-error-border text-status-error-text"}`,
|
|
232
|
+
children: T.message
|
|
201
233
|
}),
|
|
202
|
-
/* @__PURE__ */ m(
|
|
234
|
+
/* @__PURE__ */ m(te, {
|
|
203
235
|
title: "Payouts",
|
|
204
236
|
description: "Register payout accounts, request withdrawals, and track disbursement status."
|
|
205
237
|
}),
|
|
206
|
-
/* @__PURE__ */ m(
|
|
238
|
+
/* @__PURE__ */ m(Ae, { 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
239
|
q ? /* @__PURE__ */ m("div", {
|
|
208
240
|
role: "status",
|
|
209
241
|
className: "rounded-lg border border-border-subtle bg-status-info-bg-subtle p-4 text-sm text-status-info-text",
|
|
210
242
|
children: q
|
|
211
243
|
}) : null,
|
|
212
|
-
|
|
244
|
+
I && !i(I) ? g ? /* @__PURE__ */ m(s, { error: I }) : /* @__PURE__ */ m("div", {
|
|
213
245
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4 text-sm text-status-error-text",
|
|
214
|
-
children:
|
|
246
|
+
children: I.message
|
|
215
247
|
}) : null,
|
|
248
|
+
g && C ? /* @__PURE__ */ m(s, { error: C }) : null,
|
|
216
249
|
/* @__PURE__ */ h("div", {
|
|
217
250
|
className: "grid gap-6 xl:grid-cols-[1.05fr,1.95fr]",
|
|
218
251
|
children: [/* @__PURE__ */ h("section", {
|
|
@@ -220,14 +253,14 @@ var Ee = [
|
|
|
220
253
|
children: [
|
|
221
254
|
/* @__PURE__ */ m("h2", {
|
|
222
255
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
223
|
-
children:
|
|
256
|
+
children: W ? "Edit payout account" : "Add payout account"
|
|
224
257
|
}),
|
|
225
258
|
/* @__PURE__ */ h("div", {
|
|
226
259
|
className: "space-y-3",
|
|
227
260
|
children: [
|
|
228
261
|
/* @__PURE__ */ m("input", {
|
|
229
|
-
value:
|
|
230
|
-
onChange: (e) =>
|
|
262
|
+
value: R.label,
|
|
263
|
+
onChange: (e) => z((t) => ({
|
|
231
264
|
...t,
|
|
232
265
|
label: e.target.value
|
|
233
266
|
})),
|
|
@@ -237,8 +270,8 @@ var Ee = [
|
|
|
237
270
|
/* @__PURE__ */ h("div", {
|
|
238
271
|
className: "grid gap-3 md:grid-cols-2",
|
|
239
272
|
children: [/* @__PURE__ */ h("select", {
|
|
240
|
-
value:
|
|
241
|
-
onChange: (e) =>
|
|
273
|
+
value: R.type,
|
|
274
|
+
onChange: (e) => z((t) => ({
|
|
242
275
|
...t,
|
|
243
276
|
type: e.target.value
|
|
244
277
|
})),
|
|
@@ -258,8 +291,8 @@ var Ee = [
|
|
|
258
291
|
})
|
|
259
292
|
]
|
|
260
293
|
}), /* @__PURE__ */ h("select", {
|
|
261
|
-
value:
|
|
262
|
-
onChange: (e) =>
|
|
294
|
+
value: R.providerPreference,
|
|
295
|
+
onChange: (e) => z((t) => ({
|
|
263
296
|
...t,
|
|
264
297
|
providerPreference: e.target.value
|
|
265
298
|
})),
|
|
@@ -287,16 +320,16 @@ var Ee = [
|
|
|
287
320
|
/* @__PURE__ */ h("div", {
|
|
288
321
|
className: "grid gap-3 md:grid-cols-2",
|
|
289
322
|
children: [/* @__PURE__ */ m("input", {
|
|
290
|
-
value:
|
|
291
|
-
onChange: (e) =>
|
|
323
|
+
value: R.country,
|
|
324
|
+
onChange: (e) => z((t) => ({
|
|
292
325
|
...t,
|
|
293
326
|
country: e.target.value.toUpperCase()
|
|
294
327
|
})),
|
|
295
328
|
placeholder: "Country",
|
|
296
329
|
className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
297
330
|
}), /* @__PURE__ */ m("input", {
|
|
298
|
-
value:
|
|
299
|
-
onChange: (e) =>
|
|
331
|
+
value: R.currency,
|
|
332
|
+
onChange: (e) => z((t) => ({
|
|
300
333
|
...t,
|
|
301
334
|
currency: e.target.value.toUpperCase()
|
|
302
335
|
})),
|
|
@@ -305,18 +338,18 @@ var Ee = [
|
|
|
305
338
|
})]
|
|
306
339
|
}),
|
|
307
340
|
/* @__PURE__ */ m("input", {
|
|
308
|
-
value:
|
|
309
|
-
onChange: (e) =>
|
|
341
|
+
value: R.accountHolderName,
|
|
342
|
+
onChange: (e) => z((t) => ({
|
|
310
343
|
...t,
|
|
311
344
|
accountHolderName: e.target.value
|
|
312
345
|
})),
|
|
313
346
|
placeholder: "Account holder name",
|
|
314
347
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
315
348
|
}),
|
|
316
|
-
|
|
349
|
+
R.type === "BANK_ACCOUNT" ? /* @__PURE__ */ h(p, { children: [
|
|
317
350
|
/* @__PURE__ */ m("input", {
|
|
318
|
-
value:
|
|
319
|
-
onChange: (e) =>
|
|
351
|
+
value: R.bankName,
|
|
352
|
+
onChange: (e) => z((t) => ({
|
|
320
353
|
...t,
|
|
321
354
|
bankName: e.target.value
|
|
322
355
|
})),
|
|
@@ -324,8 +357,8 @@ var Ee = [
|
|
|
324
357
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
325
358
|
}),
|
|
326
359
|
/* @__PURE__ */ m("input", {
|
|
327
|
-
value:
|
|
328
|
-
onChange: (e) =>
|
|
360
|
+
value: R.accountNumber,
|
|
361
|
+
onChange: (e) => z((t) => ({
|
|
329
362
|
...t,
|
|
330
363
|
accountNumber: e.target.value
|
|
331
364
|
})),
|
|
@@ -333,20 +366,20 @@ var Ee = [
|
|
|
333
366
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
334
367
|
}),
|
|
335
368
|
/* @__PURE__ */ m("input", {
|
|
336
|
-
value:
|
|
337
|
-
onChange: (e) =>
|
|
369
|
+
value: R.country === "IN" ? R.ifsc : R.routingNumber,
|
|
370
|
+
onChange: (e) => z((t) => t.country === "IN" ? {
|
|
338
371
|
...t,
|
|
339
372
|
ifsc: e.target.value
|
|
340
373
|
} : {
|
|
341
374
|
...t,
|
|
342
375
|
routingNumber: e.target.value
|
|
343
376
|
}),
|
|
344
|
-
placeholder:
|
|
377
|
+
placeholder: R.country === "IN" ? "IFSC" : "Routing number",
|
|
345
378
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary"
|
|
346
379
|
})
|
|
347
|
-
] }) :
|
|
348
|
-
value:
|
|
349
|
-
onChange: (e) =>
|
|
380
|
+
] }) : R.type === "UPI" ? /* @__PURE__ */ m("input", {
|
|
381
|
+
value: R.upiId,
|
|
382
|
+
onChange: (e) => z((t) => ({
|
|
350
383
|
...t,
|
|
351
384
|
upiId: e.target.value
|
|
352
385
|
})),
|
|
@@ -357,14 +390,14 @@ var Ee = [
|
|
|
357
390
|
}),
|
|
358
391
|
/* @__PURE__ */ h("button", {
|
|
359
392
|
type: "button",
|
|
360
|
-
onClick: () => void
|
|
393
|
+
onClick: () => void Z(Ue),
|
|
361
394
|
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",
|
|
362
|
-
children: [/* @__PURE__ */ m(
|
|
395
|
+
children: [/* @__PURE__ */ m(Me, { className: "size-4" }), W ? "Update payout account" : "Save payout account"]
|
|
363
396
|
}),
|
|
364
|
-
|
|
397
|
+
W ? /* @__PURE__ */ m("button", {
|
|
365
398
|
type: "button",
|
|
366
399
|
onClick: () => {
|
|
367
|
-
|
|
400
|
+
G(null), z({
|
|
368
401
|
label: "",
|
|
369
402
|
type: "BANK_ACCOUNT",
|
|
370
403
|
providerPreference: "AUTO",
|
|
@@ -396,10 +429,10 @@ var Ee = [
|
|
|
396
429
|
type: "button",
|
|
397
430
|
onClick: () => void X(),
|
|
398
431
|
className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary",
|
|
399
|
-
children: [/* @__PURE__ */ m(
|
|
432
|
+
children: [/* @__PURE__ */ m(Ne, { className: "size-4" }), "Refresh"]
|
|
400
433
|
})]
|
|
401
434
|
}),
|
|
402
|
-
|
|
435
|
+
M.length === 0 && !P ? /* @__PURE__ */ m(d, {
|
|
403
436
|
illustration: "empty-generic",
|
|
404
437
|
title: "No payout accounts yet",
|
|
405
438
|
description: "Add a payout account before requesting a withdrawal."
|
|
@@ -407,34 +440,34 @@ var Ee = [
|
|
|
407
440
|
className: "space-y-3",
|
|
408
441
|
children: [
|
|
409
442
|
/* @__PURE__ */ h("select", {
|
|
410
|
-
value:
|
|
411
|
-
onChange: (e) =>
|
|
443
|
+
value: H,
|
|
444
|
+
onChange: (e) => U(e.target.value),
|
|
412
445
|
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",
|
|
413
|
-
children: [
|
|
446
|
+
children: [qe ? null : /* @__PURE__ */ m("option", {
|
|
414
447
|
value: "",
|
|
415
448
|
children: "No verified payout account yet"
|
|
416
|
-
}),
|
|
449
|
+
}), M.map((e) => /* @__PURE__ */ h("option", {
|
|
417
450
|
value: e.id,
|
|
418
|
-
disabled: !
|
|
451
|
+
disabled: !a(e),
|
|
419
452
|
children: [
|
|
420
453
|
e.label,
|
|
421
454
|
" · ",
|
|
422
455
|
e.currency,
|
|
423
456
|
" ·",
|
|
424
457
|
" ",
|
|
425
|
-
|
|
458
|
+
o(e.status).label
|
|
426
459
|
]
|
|
427
460
|
}, e.id))]
|
|
428
461
|
}),
|
|
429
|
-
|
|
462
|
+
qe ? null : /* @__PURE__ */ m("p", {
|
|
430
463
|
className: "text-sm text-text-secondary",
|
|
431
464
|
children: "Payouts can be requested once one of your payout accounts is verified."
|
|
432
465
|
}),
|
|
433
466
|
/* @__PURE__ */ h("label", {
|
|
434
467
|
className: "block space-y-1 text-sm font-medium text-text-primary",
|
|
435
468
|
children: [/* @__PURE__ */ m("span", { children: "Amount" }), /* @__PURE__ */ m("input", {
|
|
436
|
-
value:
|
|
437
|
-
onChange: (e) =>
|
|
469
|
+
value: B,
|
|
470
|
+
onChange: (e) => V(e.target.value),
|
|
438
471
|
inputMode: "decimal",
|
|
439
472
|
placeholder: "0.00",
|
|
440
473
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-normal text-text-primary"
|
|
@@ -443,21 +476,46 @@ var Ee = [
|
|
|
443
476
|
/* @__PURE__ */ h("button", {
|
|
444
477
|
type: "button",
|
|
445
478
|
onClick: () => {
|
|
446
|
-
|
|
479
|
+
g ? (b(null), S(null), E(null), v(!0)) : $();
|
|
447
480
|
},
|
|
448
|
-
disabled: !
|
|
481
|
+
disabled: !Q || !a(Q),
|
|
449
482
|
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",
|
|
450
|
-
children: [/* @__PURE__ */ m(
|
|
483
|
+
children: [/* @__PURE__ */ m(Pe, { className: "size-4" }), "Request payout"]
|
|
451
484
|
})
|
|
452
485
|
]
|
|
453
486
|
}),
|
|
454
|
-
|
|
487
|
+
M.length > 0 ? /* @__PURE__ */ h("div", {
|
|
455
488
|
className: "mt-4 space-y-3 rounded-md border border-border-subtle bg-bg-surface/60 p-3",
|
|
456
489
|
children: [/* @__PURE__ */ m("h3", {
|
|
457
490
|
className: "text-sm font-semibold text-text-primary",
|
|
458
491
|
children: "Saved payout accounts"
|
|
459
|
-
}),
|
|
460
|
-
|
|
492
|
+
}), g ? /* @__PURE__ */ m(_e, {
|
|
493
|
+
destinations: ve(M),
|
|
494
|
+
renderActions: (e) => {
|
|
495
|
+
let t = M.find((t) => t.id === e.id);
|
|
496
|
+
return t ? /* @__PURE__ */ h(p, { children: [
|
|
497
|
+
/* @__PURE__ */ m("button", {
|
|
498
|
+
type: "button",
|
|
499
|
+
onClick: () => Ke(t),
|
|
500
|
+
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
|
|
501
|
+
children: _("billing.payouts.edit", "Edit")
|
|
502
|
+
}),
|
|
503
|
+
t.isDefault ? null : /* @__PURE__ */ m("button", {
|
|
504
|
+
type: "button",
|
|
505
|
+
onClick: () => void Z(() => We(t.id)),
|
|
506
|
+
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
|
|
507
|
+
children: _("billing.payouts.makeDefault", "Make default")
|
|
508
|
+
}),
|
|
509
|
+
/* @__PURE__ */ m("button", {
|
|
510
|
+
type: "button",
|
|
511
|
+
onClick: () => K(t.id),
|
|
512
|
+
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-status-error-text",
|
|
513
|
+
children: _("billing.payouts.archive", "Archive")
|
|
514
|
+
})
|
|
515
|
+
] }) : null;
|
|
516
|
+
}
|
|
517
|
+
}) : /* @__PURE__ */ m(p, { children: M.map((e) => {
|
|
518
|
+
let t = o(e.status);
|
|
461
519
|
return /* @__PURE__ */ h("div", {
|
|
462
520
|
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",
|
|
463
521
|
children: [/* @__PURE__ */ h("div", { children: [
|
|
@@ -468,7 +526,7 @@ var Ee = [
|
|
|
468
526
|
" ",
|
|
469
527
|
e.isDefault ? "• Default" : "",
|
|
470
528
|
/* @__PURE__ */ m("span", {
|
|
471
|
-
className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${
|
|
529
|
+
className: `inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${he[t.tone]}`,
|
|
472
530
|
children: t.label
|
|
473
531
|
})
|
|
474
532
|
]
|
|
@@ -490,13 +548,13 @@ var Ee = [
|
|
|
490
548
|
children: [
|
|
491
549
|
/* @__PURE__ */ m("button", {
|
|
492
550
|
type: "button",
|
|
493
|
-
onClick: () =>
|
|
551
|
+
onClick: () => Ke(e),
|
|
494
552
|
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
|
|
495
553
|
children: "Edit"
|
|
496
554
|
}),
|
|
497
555
|
e.isDefault ? null : /* @__PURE__ */ m("button", {
|
|
498
556
|
type: "button",
|
|
499
|
-
onClick: () => void
|
|
557
|
+
onClick: () => void Z(() => We(e.id)),
|
|
500
558
|
className: "rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary",
|
|
501
559
|
children: "Make default"
|
|
502
560
|
}),
|
|
@@ -509,7 +567,7 @@ var Ee = [
|
|
|
509
567
|
]
|
|
510
568
|
})]
|
|
511
569
|
}, e.id);
|
|
512
|
-
})]
|
|
570
|
+
}) })]
|
|
513
571
|
}) : null
|
|
514
572
|
]
|
|
515
573
|
}), /* @__PURE__ */ h("div", {
|
|
@@ -517,27 +575,27 @@ var Ee = [
|
|
|
517
575
|
children: [/* @__PURE__ */ m("h2", {
|
|
518
576
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
519
577
|
children: "Payout requests"
|
|
520
|
-
}),
|
|
578
|
+
}), N.length === 0 && !P ? /* @__PURE__ */ m(d, {
|
|
521
579
|
illustration: "empty-data",
|
|
522
580
|
title: "No payout requests yet",
|
|
523
581
|
description: "Your payout requests and processing updates will appear here."
|
|
524
|
-
}) : /* @__PURE__ */ m(
|
|
525
|
-
data:
|
|
582
|
+
}) : /* @__PURE__ */ m(je, {
|
|
583
|
+
data: N,
|
|
526
584
|
rowKey: (e) => e.id,
|
|
527
|
-
columns:
|
|
585
|
+
columns: Fe
|
|
528
586
|
})]
|
|
529
587
|
})]
|
|
530
588
|
})]
|
|
531
589
|
}),
|
|
532
|
-
/* @__PURE__ */ m(
|
|
533
|
-
open:
|
|
590
|
+
/* @__PURE__ */ m(Se, {
|
|
591
|
+
open: He !== null,
|
|
534
592
|
onOpenChange: (e) => {
|
|
535
593
|
e || K(null);
|
|
536
594
|
},
|
|
537
|
-
children: /* @__PURE__ */ h(
|
|
595
|
+
children: /* @__PURE__ */ h(Te, { children: [/* @__PURE__ */ h(Oe, { children: [/* @__PURE__ */ m(ke, { children: "Archive payout account?" }), /* @__PURE__ */ m(Ee, { children: "Archive this payout account? You can add a new one at any time." })] }), /* @__PURE__ */ h(De, { children: [/* @__PURE__ */ m(we, { children: "Cancel" }), /* @__PURE__ */ m(Ce, {
|
|
538
596
|
onClick: () => {
|
|
539
|
-
let e =
|
|
540
|
-
K(null), e &&
|
|
597
|
+
let e = He;
|
|
598
|
+
K(null), e && Z(() => Ge(e));
|
|
541
599
|
},
|
|
542
600
|
children: "Archive"
|
|
543
601
|
})] })] })
|
|
@@ -545,6 +603,6 @@ var Ee = [
|
|
|
545
603
|
]
|
|
546
604
|
});
|
|
547
605
|
};
|
|
548
|
-
export {
|
|
606
|
+
export { g as PayoutsPage };
|
|
549
607
|
|
|
550
608
|
//# sourceMappingURL=PayoutsPage.js.map
|