@tesouro/embedded-components-react 0.5.9 → 0.5.11
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/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +4 -78
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +84 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +4 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +3 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +30 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +37 -166
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +164 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +48 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +1 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +45 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +13 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +8 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +7 -59
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +64 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +8 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +18 -139
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +144 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +24 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +91 -84
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +92 -87
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +133 -129
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -1,81 +1,7 @@
|
|
|
1
|
-
import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
2
|
-
import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
3
|
-
import "../../../shared/data-access/dist/index.js";
|
|
4
|
-
import { BanIcon as n, CalendarXIcon as r, RotateCcwIcon as i, ThumbsDownIcon as a, ThumbsUpIcon as o } from "lucide-react";
|
|
5
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function c({ status: n, scopes: r, arePendingApproversUnknown: i, hasApprovalPolicy: a = !0, hasWaitingRequest: o }) {
|
|
10
|
-
let s = e(r, [t.PayableApproveOrg]);
|
|
11
|
-
return !!(n === "approve_in_progress" && s);
|
|
12
|
-
}
|
|
13
|
-
function l({ status: l, scopes: u, canDecideApprovalRequest: d, hasScheduledPayment: f, scheduledPaymentIntentId: p, arePendingApproversUnknown: m, hasApprovalPolicy: h, hasWaitingRequest: g, isPayabilityUnknown: _, labels: v }) {
|
|
14
|
-
let y = e(u, [t.PayablePayOrg]), b = e(u, [t.BankAccountReadOrg]), x = s(u), S = e(u, [t.PaymentRailAch]), C = e(u, [t.PayableWriteOrg]), w = y, T = [];
|
|
15
|
-
if (l === "approve_in_progress" && d && (T.push({
|
|
16
|
-
id: "approve",
|
|
17
|
-
label: v.approve,
|
|
18
|
-
variant: "default",
|
|
19
|
-
surface: "row"
|
|
20
|
-
}), T.push({
|
|
21
|
-
id: "reject",
|
|
22
|
-
label: v.reject,
|
|
23
|
-
variant: "ghost",
|
|
24
|
-
surface: "row"
|
|
25
|
-
})), c({
|
|
26
|
-
status: l,
|
|
27
|
-
scopes: u,
|
|
28
|
-
arePendingApproversUnknown: m,
|
|
29
|
-
hasApprovalPolicy: h,
|
|
30
|
-
hasWaitingRequest: g
|
|
31
|
-
})) {
|
|
32
|
-
let e = h === !1 ? void 0 : v.policyOverridesHeading;
|
|
33
|
-
T.push({
|
|
34
|
-
id: "forceApprove",
|
|
35
|
-
label: v.forceApprove,
|
|
36
|
-
variant: "ghost",
|
|
37
|
-
surface: "menu",
|
|
38
|
-
icon: o,
|
|
39
|
-
sectionHeading: e
|
|
40
|
-
}), T.push({
|
|
41
|
-
id: "forceReject",
|
|
42
|
-
label: v.forceReject,
|
|
43
|
-
variant: "ghost",
|
|
44
|
-
surface: "menu",
|
|
45
|
-
icon: a,
|
|
46
|
-
sectionHeading: e
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
let E = l === "waiting_to_be_paid" && y && !f, D = l === "waiting_to_be_paid" && y && b && x && S && !f && !_;
|
|
50
|
-
return E && T.push({
|
|
51
|
-
id: "markAsPaid",
|
|
52
|
-
label: v.markAsPaid,
|
|
53
|
-
variant: "outline",
|
|
54
|
-
surface: "row"
|
|
55
|
-
}), D && T.push({
|
|
56
|
-
id: "payBill",
|
|
57
|
-
label: v.payBill,
|
|
58
|
-
variant: "default",
|
|
59
|
-
surface: "row"
|
|
60
|
-
}), l === "new" && C && T.push({
|
|
61
|
-
id: "cancel",
|
|
62
|
-
label: v.cancel,
|
|
63
|
-
variant: "ghost",
|
|
64
|
-
surface: "menu",
|
|
65
|
-
icon: n
|
|
66
|
-
}), (l === "rejected" || l === "waiting_to_be_paid" && !f) && C && T.push({
|
|
67
|
-
id: "reopen",
|
|
68
|
-
label: v.reopen,
|
|
69
|
-
variant: "ghost",
|
|
70
|
-
surface: "menu",
|
|
71
|
-
icon: i
|
|
72
|
-
}), l === "waiting_to_be_paid" && f && p && w && T.push({
|
|
73
|
-
id: "cancelScheduledPayment",
|
|
74
|
-
label: v.cancelScheduledPayment,
|
|
75
|
-
variant: "ghost",
|
|
76
|
-
surface: "menu",
|
|
77
|
-
icon: r
|
|
78
|
-
}), T;
|
|
2
|
+
var e = /* @__PURE__ */ new Set(["draft", "new"]);
|
|
3
|
+
function t(t) {
|
|
4
|
+
return !!(t && e.has(t));
|
|
79
5
|
}
|
|
80
6
|
//#endregion
|
|
81
|
-
export {
|
|
7
|
+
export { t as isEditablePayableStatus };
|
|
@@ -1,6 +1,87 @@
|
|
|
1
|
+
import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
2
|
+
import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
3
|
+
import "../../../shared/data-access/dist/index.js";
|
|
4
|
+
import { isEditablePayableStatus as n } from "./index19.js";
|
|
5
|
+
import { BanIcon as r, CalendarXIcon as i, RotateCcwIcon as a, ThumbsDownIcon as o, ThumbsUpIcon as s } from "lucide-react";
|
|
1
6
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js
|
|
2
|
-
function
|
|
3
|
-
return e
|
|
7
|
+
function c(n) {
|
|
8
|
+
return e(n, [t.CounterpartReadOrg]);
|
|
9
|
+
}
|
|
10
|
+
function l({ status: n, scopes: r, arePendingApproversUnknown: i, hasApprovalPolicy: a = !0, hasWaitingRequest: o }) {
|
|
11
|
+
let s = e(r, [t.PayableApproveOrg]);
|
|
12
|
+
return !!(n === "approve_in_progress" && s);
|
|
13
|
+
}
|
|
14
|
+
function u({ status: u, scopes: d, canDecideApprovalRequest: f, hasScheduledPayment: p, scheduledPaymentIntentId: m, arePendingApproversUnknown: h, hasApprovalPolicy: g, hasWaitingRequest: _, isPayabilityUnknown: v, canEdit: y, labels: b }) {
|
|
15
|
+
let x = e(d, [t.PayablePayOrg]), S = e(d, [t.BankAccountReadOrg]), C = c(d), w = e(d, [t.PaymentRailAch]), T = e(d, [t.PayableWriteOrg]), E = x, D = [];
|
|
16
|
+
if (y && n(u) && T && D.push({
|
|
17
|
+
id: "edit",
|
|
18
|
+
label: b.edit,
|
|
19
|
+
variant: "default",
|
|
20
|
+
surface: "row"
|
|
21
|
+
}), u === "approve_in_progress" && f && (D.push({
|
|
22
|
+
id: "approve",
|
|
23
|
+
label: b.approve,
|
|
24
|
+
variant: "default",
|
|
25
|
+
surface: "row"
|
|
26
|
+
}), D.push({
|
|
27
|
+
id: "reject",
|
|
28
|
+
label: b.reject,
|
|
29
|
+
variant: "ghost",
|
|
30
|
+
surface: "row"
|
|
31
|
+
})), l({
|
|
32
|
+
status: u,
|
|
33
|
+
scopes: d,
|
|
34
|
+
arePendingApproversUnknown: h,
|
|
35
|
+
hasApprovalPolicy: g,
|
|
36
|
+
hasWaitingRequest: _
|
|
37
|
+
})) {
|
|
38
|
+
let e = g === !1 ? void 0 : b.policyOverridesHeading;
|
|
39
|
+
D.push({
|
|
40
|
+
id: "forceApprove",
|
|
41
|
+
label: b.forceApprove,
|
|
42
|
+
variant: "ghost",
|
|
43
|
+
surface: "menu",
|
|
44
|
+
icon: s,
|
|
45
|
+
sectionHeading: e
|
|
46
|
+
}), D.push({
|
|
47
|
+
id: "forceReject",
|
|
48
|
+
label: b.forceReject,
|
|
49
|
+
variant: "ghost",
|
|
50
|
+
surface: "menu",
|
|
51
|
+
icon: o,
|
|
52
|
+
sectionHeading: e
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
let O = u === "waiting_to_be_paid" && x && !p, k = u === "waiting_to_be_paid" && x && S && C && w && !p && !v;
|
|
56
|
+
return O && D.push({
|
|
57
|
+
id: "markAsPaid",
|
|
58
|
+
label: b.markAsPaid,
|
|
59
|
+
variant: "outline",
|
|
60
|
+
surface: "row"
|
|
61
|
+
}), k && D.push({
|
|
62
|
+
id: "payBill",
|
|
63
|
+
label: b.payBill,
|
|
64
|
+
variant: "default",
|
|
65
|
+
surface: "row"
|
|
66
|
+
}), u === "new" && T && D.push({
|
|
67
|
+
id: "cancel",
|
|
68
|
+
label: b.cancel,
|
|
69
|
+
variant: "ghost",
|
|
70
|
+
surface: "menu",
|
|
71
|
+
icon: r
|
|
72
|
+
}), (u === "rejected" || u === "waiting_to_be_paid" && !p) && T && D.push({
|
|
73
|
+
id: "reopen",
|
|
74
|
+
label: b.reopen,
|
|
75
|
+
variant: "ghost",
|
|
76
|
+
surface: "menu",
|
|
77
|
+
icon: a
|
|
78
|
+
}), u === "waiting_to_be_paid" && p && m && E && D.push({
|
|
79
|
+
id: "cancelScheduledPayment",
|
|
80
|
+
label: b.cancelScheduledPayment,
|
|
81
|
+
variant: "ghost",
|
|
82
|
+
surface: "menu",
|
|
83
|
+
icon: i
|
|
84
|
+
}), D;
|
|
4
85
|
}
|
|
5
86
|
//#endregion
|
|
6
|
-
export {
|
|
87
|
+
export { l as canOverrideApprovalPolicy, c as canReadCounterpartBankAccounts, u as getBillDetailActions };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
2
|
+
function e(e) {
|
|
3
|
+
return e?.amount_due ?? e?.total_amount ?? void 0;
|
|
4
|
+
}
|
|
6
5
|
//#endregion
|
|
7
|
-
export { e as
|
|
6
|
+
export { e as resolveAmountDueMinorUnits };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var e = {
|
|
3
|
+
scheduleDialog: "pay-bill-schedule-dialog",
|
|
4
|
+
reviewDialog: "pay-bill-review-dialog"
|
|
5
|
+
};
|
|
5
6
|
//#endregion
|
|
6
|
-
export { e as
|
|
7
|
+
export { e as payBillFlowTestIds };
|
|
@@ -1,35 +1,6 @@
|
|
|
1
|
-
import { coerceAmountValueToMinorUnits as e } from "../../../shared/util/dist/lib/coerceAmountValueToMinorUnits.js";
|
|
2
|
-
import { formatMoneyExact as t } from "../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
3
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
availableBalancePrefix: (e) => `Available balance: ${e}`,
|
|
7
|
-
futureInsufficientFunds: "Not enough funds right now. Add funds before the payment date.",
|
|
8
|
-
todayInsufficientFunds: "Not enough funds to pay today. Choose a different account or a later date."
|
|
9
|
-
};
|
|
10
|
-
function r(e) {
|
|
11
|
-
return e.slice(-4);
|
|
12
|
-
}
|
|
13
|
-
function i(i, a = n) {
|
|
14
|
-
return i.filter((e) => e.status === "ACTIVE").map((n) => {
|
|
15
|
-
let i = e(n.balance.value), o = n.balance.currencyCode;
|
|
16
|
-
return {
|
|
17
|
-
id: n.id,
|
|
18
|
-
primaryLabel: `${n.nickname || a.unnamedSourceAccount} - ${r(n.accountNumber)}`,
|
|
19
|
-
secondaryLabel: a.availableBalancePrefix(t(i / 100, { currencyCode: o })),
|
|
20
|
-
balanceMinorUnits: i
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function a({ selectedAccount: e, amountDueMinorUnits: t, isToday: r, labels: i = n }) {
|
|
25
|
-
let a = e?.balanceMinorUnits;
|
|
26
|
-
return a === void 0 ? { state: "warning" } : a >= t ? { state: "sufficient" } : r ? {
|
|
27
|
-
state: "error",
|
|
28
|
-
message: i.todayInsufficientFunds
|
|
29
|
-
} : {
|
|
30
|
-
state: "warning",
|
|
31
|
-
message: i.futureInsufficientFunds
|
|
32
|
-
};
|
|
2
|
+
function e(e) {
|
|
3
|
+
return e ? `••••${e.slice(-4)}` : void 0;
|
|
33
4
|
}
|
|
34
5
|
//#endregion
|
|
35
|
-
export {
|
|
6
|
+
export { e as maskAccountNumber };
|
|
@@ -1,44 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "../../ui/dist/index.js";
|
|
4
|
-
import { SOURCE_ACCOUNT_LABELS_EN as n } from "./index23.js";
|
|
1
|
+
import { coerceAmountValueToMinorUnits as e } from "../../../shared/util/dist/lib/coerceAmountValueToMinorUnits.js";
|
|
2
|
+
import { formatMoneyExact as t } from "../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
5
3
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
sourceAccount: "Pay from",
|
|
12
|
-
accountHolder: "Account holder name",
|
|
13
|
-
routingNumber: "Routing number",
|
|
14
|
-
accountNumber: "Account number",
|
|
15
|
-
achMethod: "Pay by ACH bank transfer",
|
|
16
|
-
scheduledToast: "Payment scheduled",
|
|
17
|
-
submitError: "Couldn't schedule this payment. Try again.",
|
|
18
|
-
selectAccountError: "Select a source account.",
|
|
19
|
-
selectDateError: "Select a payment date.",
|
|
20
|
-
staleDateError: "That date has passed. Choose a new payment date.",
|
|
21
|
-
missingPaymentInstructionsError: "This vendor does not have ACH payment instructions on file.",
|
|
22
|
-
checkingPaymentInstructionsError: "Still checking this vendor's payment instructions. Try again in a moment.",
|
|
23
|
-
paymentInstructionsUnavailableError: "Couldn't check this vendor's payment instructions. Try again.",
|
|
24
|
-
missingVendorName: "Not provided",
|
|
25
|
-
...n,
|
|
26
|
-
scheduleDialog: t,
|
|
27
|
-
reviewDialog: e
|
|
4
|
+
var n = {
|
|
5
|
+
unnamedSourceAccount: "Bank account",
|
|
6
|
+
availableBalancePrefix: (e) => `Available balance: ${e}`,
|
|
7
|
+
futureInsufficientFunds: "Not enough funds right now. Add funds before the payment date.",
|
|
8
|
+
todayInsufficientFunds: "Not enough funds to pay today. Choose a different account or a later date."
|
|
28
9
|
};
|
|
29
|
-
function
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
10
|
+
function r(e) {
|
|
11
|
+
return e.slice(-4);
|
|
12
|
+
}
|
|
13
|
+
function i(i, a = n) {
|
|
14
|
+
return i.filter((e) => e.status === "ACTIVE").map((n) => {
|
|
15
|
+
let i = e(n.balance.value), o = n.balance.currencyCode;
|
|
16
|
+
return {
|
|
17
|
+
id: n.id,
|
|
18
|
+
primaryLabel: `${n.nickname || a.unnamedSourceAccount} - ${r(n.accountNumber)}`,
|
|
19
|
+
secondaryLabel: a.availableBalancePrefix(t(i / 100, { currencyCode: o })),
|
|
20
|
+
balanceMinorUnits: i
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function a({ selectedAccount: e, amountDueMinorUnits: t, isToday: r, labels: i = n }) {
|
|
25
|
+
let a = e?.balanceMinorUnits;
|
|
26
|
+
return a === void 0 ? { state: "warning" } : a >= t ? { state: "sufficient" } : r ? {
|
|
27
|
+
state: "error",
|
|
28
|
+
message: i.todayInsufficientFunds
|
|
29
|
+
} : {
|
|
30
|
+
state: "warning",
|
|
31
|
+
message: i.futureInsufficientFunds
|
|
41
32
|
};
|
|
42
33
|
}
|
|
43
34
|
//#endregion
|
|
44
|
-
export {
|
|
35
|
+
export { n as SOURCE_ACCOUNT_LABELS_EN, a as deriveSourceAccountFunds, i as mapSourceAccountOptions };
|
|
@@ -1,173 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
-
import { useAllBankAccountsQuery as t } from "../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
|
|
7
|
-
import "../../../shared/data-access/dist/index.js";
|
|
8
|
-
import "../../../shared/ui/dist/index.js";
|
|
9
|
-
import { useAnalyticsCaptureException as n } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
10
|
-
import { formatCalendarDate as r } from "../../../shared/util/dist/lib/formatCalendarDate.js";
|
|
11
|
-
import { formatMoneyExact as i } from "../../../shared/util/dist/lib/formatMoneyExact.js";
|
|
12
|
-
import { extractApiErrorMessage as a } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
13
|
-
import "../../../shared/feature/dist/index.js";
|
|
14
|
-
import { useSchedulePaymentMutation as o } from "../../data-access/dist/index12.js";
|
|
15
|
-
import "../../data-access/dist/index.js";
|
|
16
|
-
import { dateToCalendarKey as s, getDefaultPaymentDate as c, isPastEasternDate as l, isTodayInEastern as u } from "./index16.js";
|
|
17
|
-
import { maskAccountNumber as d } from "./index22.js";
|
|
18
|
-
import { deriveSourceAccountFunds as f, mapSourceAccountOptions as p } from "./index23.js";
|
|
19
|
-
import { mergePayBillFlowLabels as m } from "./index24.js";
|
|
20
|
-
import { useMemo as h, useState as g } from "react";
|
|
1
|
+
import { REVIEW_TRANSACTION_DIALOG_LABELS_EN as e } from "../../ui/dist/index92.js";
|
|
2
|
+
import { SCHEDULE_PAYMENT_DIALOG_LABELS_EN as t } from "../../ui/dist/index98.js";
|
|
3
|
+
import "../../ui/dist/index.js";
|
|
4
|
+
import { SOURCE_ACCOUNT_LABELS_EN as n } from "./index24.js";
|
|
21
5
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
error: i.message ?? r.todayInsufficientFunds
|
|
47
|
-
} : {
|
|
48
|
-
ok: !0,
|
|
49
|
-
date: e,
|
|
50
|
-
account: t
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function y({ payableId: l, amountDueMinorUnits: y, currencyCode: b = "USD", dueDate: x, vendorName: S, vendorEmail: C, vendorBankAccount: w, isVendorBankAccountLoading: T, isVendorBankAccountError: E, onMissingAchInstructions: D, poweredByBankName: O, labels: k }) {
|
|
54
|
-
let A = h(() => m(k), [k]), j = S ?? A.missingVendorName, [M, N] = g(!1), [P, F] = g(!1), [I, L] = g(() => c()), [R, z] = g(), B = t({ enabled: M || P }), V = o(), H = n(), U = h(() => p(B.data?.data ?? [], A), [B.data?.data, A]), W = U.find((e) => e.id === R), G = I ? u(I) : !1, K = { before: c() }, q = f({
|
|
55
|
-
selectedAccount: W,
|
|
56
|
-
amountDueMinorUnits: y,
|
|
57
|
-
isToday: G,
|
|
58
|
-
labels: A
|
|
59
|
-
}), J = i(y / 100, { currencyCode: b }), Y = I ? r(s(I)) : void 0, X = x ? A.dueDateSuffix(r(x)) : void 0, Z = () => v({
|
|
60
|
-
selectedDate: I,
|
|
61
|
-
selectedAccount: W,
|
|
62
|
-
amountDueMinorUnits: y,
|
|
63
|
-
labels: A
|
|
64
|
-
}), Q = () => {
|
|
65
|
-
if (T) {
|
|
66
|
-
e.error(A.checkingPaymentInstructionsError);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
if (E) {
|
|
70
|
-
e.error(A.paymentInstructionsUnavailableError);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
if (!_(w)) {
|
|
74
|
-
D ? D() : e.error(A.missingPaymentInstructionsError);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
N(!0);
|
|
78
|
-
}, $ = () => {
|
|
79
|
-
F(!1), N(!1);
|
|
80
|
-
};
|
|
6
|
+
var r = {
|
|
7
|
+
amountDue: "Amount due",
|
|
8
|
+
paymentAmount: "Payment amount",
|
|
9
|
+
dueDateSuffix: (e) => `by ${e}`,
|
|
10
|
+
paymentDate: "Payment date",
|
|
11
|
+
sourceAccount: "Pay from",
|
|
12
|
+
accountHolder: "Account holder name",
|
|
13
|
+
routingNumber: "Routing number",
|
|
14
|
+
accountNumber: "Account number",
|
|
15
|
+
achMethod: "Pay by ACH bank transfer",
|
|
16
|
+
scheduledToast: "Payment scheduled",
|
|
17
|
+
submitError: "Couldn't schedule this payment. Try again.",
|
|
18
|
+
selectAccountError: "Select a source account.",
|
|
19
|
+
selectDateError: "Select a payment date.",
|
|
20
|
+
staleDateError: "That date has passed. Choose a new payment date.",
|
|
21
|
+
missingPaymentInstructionsError: "This vendor does not have ACH payment instructions on file.",
|
|
22
|
+
checkingPaymentInstructionsError: "Still checking this vendor's payment instructions. Try again in a moment.",
|
|
23
|
+
paymentInstructionsUnavailableError: "Couldn't check this vendor's payment instructions. Try again.",
|
|
24
|
+
missingVendorName: "Not provided",
|
|
25
|
+
...n,
|
|
26
|
+
scheduleDialog: t,
|
|
27
|
+
reviewDialog: e
|
|
28
|
+
};
|
|
29
|
+
function i(e) {
|
|
81
30
|
return {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
amountDue: J,
|
|
88
|
-
dueDateSuffix: X,
|
|
89
|
-
paymentAmountLabel: A.paymentAmount,
|
|
90
|
-
paymentAmount: J,
|
|
91
|
-
selectedDate: I,
|
|
92
|
-
selectedDateLabel: Y,
|
|
93
|
-
calendarDisabled: K,
|
|
94
|
-
isToday: G,
|
|
95
|
-
selectedAccountId: R,
|
|
96
|
-
accounts: U,
|
|
97
|
-
poweredByBankName: O,
|
|
98
|
-
funds: q,
|
|
99
|
-
isAccountsLoading: B.isLoading,
|
|
100
|
-
isAccountsError: B.isError,
|
|
101
|
-
isSubmitting: V.isPending,
|
|
102
|
-
onDateChange: L,
|
|
103
|
-
onAccountChange: z,
|
|
104
|
-
onReview: () => {
|
|
105
|
-
let t = Z();
|
|
106
|
-
if (!t.ok) {
|
|
107
|
-
e.error(t.error);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
N(!1), F(!0);
|
|
111
|
-
},
|
|
112
|
-
onCancel: $,
|
|
113
|
-
labels: A.scheduleDialog
|
|
31
|
+
...r,
|
|
32
|
+
...e,
|
|
33
|
+
scheduleDialog: {
|
|
34
|
+
...r.scheduleDialog,
|
|
35
|
+
...e?.scheduleDialog
|
|
114
36
|
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
amountLabel: A.paymentAmount,
|
|
119
|
-
amount: J,
|
|
120
|
-
rows: [{
|
|
121
|
-
label: A.sourceAccount,
|
|
122
|
-
value: W?.primaryLabel ?? ""
|
|
123
|
-
}, {
|
|
124
|
-
label: A.paymentDate,
|
|
125
|
-
value: Y ?? ""
|
|
126
|
-
}],
|
|
127
|
-
payTo: {
|
|
128
|
-
name: j,
|
|
129
|
-
email: C,
|
|
130
|
-
methodLabel: A.achMethod,
|
|
131
|
-
fields: _(w) ? [
|
|
132
|
-
{
|
|
133
|
-
label: A.routingNumber,
|
|
134
|
-
value: w.routing_number
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
label: A.accountNumber,
|
|
138
|
-
value: w.account_number,
|
|
139
|
-
maskedValue: d(w.account_number)
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
label: A.accountHolder,
|
|
143
|
-
value: w.account_holder_name
|
|
144
|
-
}
|
|
145
|
-
] : []
|
|
146
|
-
},
|
|
147
|
-
isSubmitting: V.isPending,
|
|
148
|
-
onBack: () => {
|
|
149
|
-
F(!1), N(!0);
|
|
150
|
-
},
|
|
151
|
-
onCancel: $,
|
|
152
|
-
onSubmit: async () => {
|
|
153
|
-
let t = Z();
|
|
154
|
-
if (!t.ok) {
|
|
155
|
-
F(!1), e.error(t.error), N(!0);
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
try {
|
|
159
|
-
await V.mutateAsync({
|
|
160
|
-
payableId: l,
|
|
161
|
-
paymentDate: s(t.date),
|
|
162
|
-
sourceBankAccountId: t.account.id
|
|
163
|
-
}), $(), e.success(A.scheduledToast);
|
|
164
|
-
} catch (t) {
|
|
165
|
-
H(t, { payable_id: l }), e.error(a(t) ?? A.submitError);
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
labels: A.reviewDialog
|
|
37
|
+
reviewDialog: {
|
|
38
|
+
...r.reviewDialog,
|
|
39
|
+
...e?.reviewDialog
|
|
169
40
|
}
|
|
170
41
|
};
|
|
171
42
|
}
|
|
172
43
|
//#endregion
|
|
173
|
-
export {
|
|
44
|
+
export { r as PAY_BILL_FLOW_LABELS_EN, i as mergePayBillFlowLabels };
|