@tesouro/embedded-components-react 0.7.44 → 0.7.46
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/index.d.ts +30 -39
- package/dist/lib/CounterpartsWidget.d.ts +29 -22
- package/dist/lib/CounterpartsWidgetPublic.d.ts +29 -22
- package/dist/lib/CustomersWidget.d.ts +29 -22
- package/dist/lib/LinkedAccountsWidget.d.ts +1 -0
- package/dist/lib/ReceivablesWidget.d.ts +1 -0
- package/dist/lib/WidgetSuite.d.ts +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +12 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index5.js +30 -30
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index48.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index49.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +40 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index2.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +8 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +9 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +7 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +76 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +27 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +2 -76
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +30 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +5 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +32 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +2 -30
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index.js +1 -2
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +36 -36
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/viewModels.js +73 -77
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +8 -25
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index7.js +197 -208
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/auditHistory/labels.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +22 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +10 -24
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +53 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +21 -53
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +8 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +77 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +31 -69
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +17 -38
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +40 -17
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +26 -38
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +18 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +8 -18
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +35 -9
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +14 -36
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +26 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +84 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +487 -80
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +2 -494
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +48 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +62 -38
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +438 -61
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +207 -431
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +20 -222
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +6 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +265 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +2 -265
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +131 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +22 -125
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +235 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +3 -240
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +249 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +54 -242
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +221 -51
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +38 -222
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/forms.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/permissions.js +8 -7
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +200 -191
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/mocks/linkedAccounts.js +87 -79
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index15.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index5.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +11 -10
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/organization/useOrganizationQuery.js +24 -0
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index2.js +14 -0
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index3.js +13 -0
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index4.js +18 -0
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index5.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index6.js +20 -0
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index7.js +32 -0
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/ui/dist/index8.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/{bill-pay-widget → shared/document-status}/util/dist/lib/derivePayableStatus.js +23 -10
- package/dist/libs/tesouro-embedded-components-react/shared/document-status/util/dist/lib/receivableFilledTone.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +0 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +0 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +0 -34
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/data-access/dist/index7.js +0 -25
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +0 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +0 -45
|
@@ -7,42 +7,43 @@ import { TESOURO_NEW_EXTERNAL_BANK_ACCOUNT_LINKED_SUCCESS_EVENT as t, emitWidget
|
|
|
7
7
|
import { extractApiErrorMessage as ee } from "../../../../shared/util/dist/lib/apiErrors.js";
|
|
8
8
|
import { OrganizationStatus as te, isOrganizationOnItsWay as ne } from "../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
9
9
|
import { useEmbedApi as re } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
10
|
-
import { Scope as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
10
|
+
import { Scope as ie } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
11
|
+
import { useOrganizationQuery as ae } from "../../../../shared/data-access/dist/lib/organization/useOrganizationQuery.js";
|
|
12
|
+
import { useAllOrganizationRolesQuery as oe } from "../../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
|
|
13
|
+
import { useAllOrganizationUsersQuery as se } from "../../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
|
|
13
14
|
import "../../../../shared/data-access/dist/index.js";
|
|
14
15
|
import "../../../../shared/ui/dist/index.js";
|
|
15
|
-
import { useAnalyticsTrack as
|
|
16
|
-
import { useWidgetConfig as
|
|
16
|
+
import { useAnalyticsTrack as ce } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
17
|
+
import { useWidgetConfig as le, useWidgetError as ue, useWidgetLoading as de } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
17
18
|
import "../../../../shared/feature/dist/index.js";
|
|
18
|
-
import { filterRolesForOrganization as
|
|
19
|
-
import { filterUsersForOrganization as
|
|
20
|
-
import { DEFAULT_FEATURE_LABELS as
|
|
21
|
-
import { LinkedAccountsWidgetAnalyticsEvent as
|
|
22
|
-
import { EMPTY_CONNECT_FORM as
|
|
23
|
-
import { getLinkedAccountsPermissions as
|
|
24
|
-
import { toAccountRows as
|
|
25
|
-
import { fromApiAccountHolderType as
|
|
26
|
-
import { useConnectExternalBankAccountMutation as
|
|
27
|
-
import { useExternalBankAccountsQuery as
|
|
28
|
-
import { useGrantExternalBankAccountAccessMutation as
|
|
29
|
-
import { useLinkExternalBankAccountMutation as
|
|
30
|
-
import { useUnlinkExternalBankAccountMutation as
|
|
31
|
-
import { useUpdateExternalBankAccountMutation as
|
|
32
|
-
import { useValidateExternalBankAccountMutation as
|
|
19
|
+
import { filterRolesForOrganization as fe } from "../../../../../shared/util-validation/dist/index6.js";
|
|
20
|
+
import { filterUsersForOrganization as pe } from "../../../../../shared/util-validation/dist/index7.js";
|
|
21
|
+
import { DEFAULT_FEATURE_LABELS as me } from "./labels.js";
|
|
22
|
+
import { LinkedAccountsWidgetAnalyticsEvent as r } from "./analytics/events.js";
|
|
23
|
+
import { EMPTY_CONNECT_FORM as he, EMPTY_EDIT_FORM as ge, EMPTY_VERIFY_FORM as i, isConnectStep1Valid as a, isRoutingNumberValid as _e, isVerifyAmountInRange as ve, isVerifyFormValid as ye, parseVerifyAmountToMinorUnits as be, sanitizeRoutingNumberInput as xe, toEditForm as Se, toUpdateBody as Ce } from "./forms.js";
|
|
24
|
+
import { getLinkedAccountsPermissions as we } from "./permissions.js";
|
|
25
|
+
import { toAccountRows as Te } from "./rows.js";
|
|
26
|
+
import { fromApiAccountHolderType as Ee, toApiAccountHolderType as De, toSummaryTypeLabel as Oe, toTextParts as o } from "./summary.js";
|
|
27
|
+
import { useConnectExternalBankAccountMutation as ke } from "../../../data-access/dist/index3.js";
|
|
28
|
+
import { useExternalBankAccountsQuery as Ae } from "../../../data-access/dist/index4.js";
|
|
29
|
+
import { useGrantExternalBankAccountAccessMutation as je } from "../../../data-access/dist/index5.js";
|
|
30
|
+
import { useLinkExternalBankAccountMutation as Me } from "../../../data-access/dist/index6.js";
|
|
31
|
+
import { useUnlinkExternalBankAccountMutation as Ne } from "../../../data-access/dist/index9.js";
|
|
32
|
+
import { useUpdateExternalBankAccountMutation as Pe } from "../../../data-access/dist/index10.js";
|
|
33
|
+
import { useValidateExternalBankAccountMutation as Fe } from "../../../data-access/dist/index11.js";
|
|
33
34
|
import "../../../data-access/dist/index.js";
|
|
34
|
-
import { useAdminEligibleUserIds as
|
|
35
|
-
import { toAccessRows as
|
|
36
|
-
import { DEFAULT_LABELS as
|
|
35
|
+
import { useAdminEligibleUserIds as Ie } from "./useAdminEligibleUserIds.js";
|
|
36
|
+
import { toAccessRows as Le, toOrganizationRoleOptions as Re, toTeamMembers as ze } from "./teamMembers.js";
|
|
37
|
+
import { DEFAULT_LABELS as Be } from "../../../ui/dist/index15.js";
|
|
37
38
|
import "../../../ui/dist/index.js";
|
|
38
|
-
import { useCallback as
|
|
39
|
+
import { useCallback as Ve, useEffect as He, useMemo as s, useState as c } from "react";
|
|
39
40
|
//#region ../../libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js
|
|
40
|
-
function
|
|
41
|
+
function Ue(e) {
|
|
41
42
|
let t = e;
|
|
42
43
|
return typeof e == "object" && !!e && "verificationStatus" in e && t.verificationStatus === "VERIFIED";
|
|
43
44
|
}
|
|
44
45
|
var l = "tesouro.linkedAccounts.locallySentMicroDepositAccountIds.v1";
|
|
45
|
-
function
|
|
46
|
+
function We() {
|
|
46
47
|
if (typeof window > "u") return /* @__PURE__ */ new Set();
|
|
47
48
|
try {
|
|
48
49
|
let e = window.sessionStorage.getItem(l), t = e ? JSON.parse(e) : [];
|
|
@@ -59,158 +60,166 @@ function d(e) {
|
|
|
59
60
|
window.sessionStorage.setItem(l, JSON.stringify([...e]));
|
|
60
61
|
} catch {}
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
+
function Ge(e, t) {
|
|
63
64
|
let n = new Set(e).add(t);
|
|
64
65
|
return d(n), n;
|
|
65
66
|
}
|
|
66
|
-
var
|
|
67
|
-
function
|
|
67
|
+
var Ke = ie.ExternalBankAccountWriteOrg;
|
|
68
|
+
function f({ labels: ie, featureLabels: l }) {
|
|
68
69
|
let u = {
|
|
69
|
-
...
|
|
70
|
-
...
|
|
70
|
+
...Be,
|
|
71
|
+
...ie
|
|
71
72
|
}, d = {
|
|
72
|
-
...
|
|
73
|
+
...me,
|
|
73
74
|
...l
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
let
|
|
75
|
+
}, f = ce(), { organizationId: p, widgetToken: qe, initResponse: m } = le(), Je = de(), { organizationStatus: Ye } = re(), Xe = ne(Ye), Ze = !!ue(), h = !!(p && qe), Qe = h || !!qe && Ye === te.Rotating, g = s(() => we(m?.scopes), [m?.scopes]), _ = Qe && g.canRead && !!m, [v, $e] = c(), [y, et] = c(!1), [b, x] = c(1), [S, tt] = c([]), [C, nt] = c(), [rt, w] = c(), [T, it] = c(We), [at, E] = c(!1), [ot, st] = c(!1), [ct, D] = c(!1), [lt, O] = c(!1), [k, A] = c(), [j, ut] = c(he), [M, N] = c(!1), [P, F] = c(ge), [I, L] = c(i);
|
|
76
|
+
He(() => {
|
|
77
|
+
f(r.Mounted);
|
|
78
|
+
}, [f]);
|
|
79
|
+
let R = Ae({
|
|
79
80
|
limit: 100,
|
|
80
|
-
enabled:
|
|
81
|
-
}), B =
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
enabled: _
|
|
82
|
+
}), z = ke(), B = je(), V = Pe(), H = Ne(), U = Me(), W = Fe(), G = y && b >= 2, K = se({ enabled: G }), q = oe({ enabled: G }), dt = ae({ enabled: y && g.canReadOrganization }).data?.legalName ?? "", J = s(() => M ? j : {
|
|
83
|
+
...j,
|
|
84
|
+
nameOnAccount: dt
|
|
85
|
+
}, [
|
|
86
|
+
M,
|
|
87
|
+
j,
|
|
88
|
+
dt
|
|
89
|
+
]), { userIds: ft, isResolving: pt, isError: mt } = Ie({
|
|
90
|
+
enabled: G,
|
|
91
|
+
permissionKey: Ke,
|
|
92
|
+
organizationId: p
|
|
85
93
|
}), Y = s(() => {
|
|
86
|
-
let e =
|
|
87
|
-
organizationId:
|
|
88
|
-
organizationTypes:
|
|
89
|
-
}) : e, n =
|
|
90
|
-
return
|
|
94
|
+
let e = q.data?.data ?? [], t = p ? fe(e, {
|
|
95
|
+
organizationId: p,
|
|
96
|
+
organizationTypes: m?.organizationTypes ?? []
|
|
97
|
+
}) : e, n = pe(K.data?.data ?? [], p);
|
|
98
|
+
return ze(n, Re(t), ft);
|
|
91
99
|
}, [
|
|
92
|
-
|
|
93
|
-
J.data?.data,
|
|
100
|
+
ft,
|
|
94
101
|
q.data?.data,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
K.data?.data,
|
|
103
|
+
p,
|
|
104
|
+
m?.organizationTypes
|
|
105
|
+
]), ht = K.isLoading || K.isFetchingNextPage || !!K.hasNextPage || q.isResolving || pt, gt = !ht && !K.isError && !mt, X = _ ? R.data?.data ?? [] : [], Z = s(() => X.map((e) => e.verificationStatus === "UNVERIFIED" && T.has(e.id) ? {
|
|
98
106
|
...e,
|
|
99
107
|
verificationStatus: "VERIFICATION_SENT"
|
|
100
|
-
} : e), [X,
|
|
101
|
-
|
|
108
|
+
} : e), [X, T]), _t = [.../* @__PURE__ */ new Set([...Y.filter((e) => e.locked).map((e) => e.id), ...S])], vt = Ve((e) => {
|
|
109
|
+
z.reset(), B.reset(), U.reset(), e.nameOnAccount !== J.nameOnAccount && N(!0), ut({
|
|
102
110
|
...e,
|
|
103
|
-
routingNumber:
|
|
111
|
+
routingNumber: xe(e.routingNumber)
|
|
104
112
|
});
|
|
105
113
|
}, [
|
|
114
|
+
J.nameOnAccount,
|
|
115
|
+
z,
|
|
106
116
|
B,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
mt();
|
|
117
|
+
U
|
|
118
|
+
]), Q = () => {
|
|
119
|
+
x(3), n(t);
|
|
120
|
+
}, yt = (e) => {
|
|
121
|
+
if (!g.canMicroDeposit) {
|
|
122
|
+
Q();
|
|
114
123
|
return;
|
|
115
124
|
}
|
|
116
|
-
|
|
117
|
-
|
|
125
|
+
w("connect"), U.mutate({ path: { id: e } }, { onSuccess: () => {
|
|
126
|
+
w(void 0), it((t) => Ge(t, e)), f(r.AccountLinked, { accountId: e }), Q();
|
|
118
127
|
} });
|
|
119
|
-
},
|
|
120
|
-
|
|
128
|
+
}, bt = (e) => {
|
|
129
|
+
B.mutate({
|
|
121
130
|
path: { id: e },
|
|
122
|
-
body: { userIds:
|
|
123
|
-
}, { onSuccess: () =>
|
|
124
|
-
},
|
|
125
|
-
if (
|
|
126
|
-
if (
|
|
127
|
-
if (!
|
|
128
|
-
|
|
131
|
+
body: { userIds: _t }
|
|
132
|
+
}, { onSuccess: () => yt(e) });
|
|
133
|
+
}, xt = () => {
|
|
134
|
+
if (h && g.canWrite) {
|
|
135
|
+
if (b === 1) {
|
|
136
|
+
if (!a(J)) return;
|
|
137
|
+
x(2);
|
|
129
138
|
return;
|
|
130
139
|
}
|
|
131
|
-
if (
|
|
132
|
-
if (
|
|
133
|
-
|
|
140
|
+
if (b === 2 && gt) {
|
|
141
|
+
if (C) {
|
|
142
|
+
bt(C.id);
|
|
134
143
|
return;
|
|
135
144
|
}
|
|
136
|
-
|
|
137
|
-
nickname:
|
|
138
|
-
accountNumber:
|
|
139
|
-
routingNumber:
|
|
140
|
-
nameOnAccount:
|
|
141
|
-
type:
|
|
142
|
-
accountHolderType:
|
|
145
|
+
z.mutate({ body: {
|
|
146
|
+
nickname: J.nickname.trim(),
|
|
147
|
+
accountNumber: J.accountNumber.trim(),
|
|
148
|
+
routingNumber: J.routingNumber.trim(),
|
|
149
|
+
nameOnAccount: J.nameOnAccount.trim(),
|
|
150
|
+
type: J.type,
|
|
151
|
+
accountHolderType: De(J.accountHolderType)
|
|
143
152
|
} }, { onSuccess: (e) => {
|
|
144
|
-
|
|
153
|
+
f(r.AccountConnected, { accountId: e?.id }), nt(e), e?.id && bt(e.id);
|
|
145
154
|
} });
|
|
146
155
|
}
|
|
147
156
|
}
|
|
148
|
-
}, _t = () => {
|
|
149
|
-
S === 2 && C(1);
|
|
150
|
-
}, vt = (e, t) => {
|
|
151
|
-
Y.find((t) => t.id === e)?.locked || Qe((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
|
|
152
|
-
}, yt = (e) => {
|
|
153
|
-
(!e || g) && (!e || _.canWrite) && (e && (C(1), P(pe), Qe([]), $e(void 0), E(void 0), B.reset(), V.reset(), W.reset()), Ze(e));
|
|
154
|
-
}, bt = (e) => {
|
|
155
|
-
if (!g || !_.canWrite) return;
|
|
156
|
-
let t = X.find((t) => t.id === e);
|
|
157
|
-
b(e), I(xe(t)), O(!0);
|
|
158
|
-
}, xt = (e) => {
|
|
159
|
-
(!e || g) && (!e || _.canWrite) && O(e);
|
|
160
157
|
}, St = () => {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
158
|
+
b === 2 && x(1);
|
|
159
|
+
}, Ct = (e, t) => {
|
|
160
|
+
Y.find((t) => t.id === e)?.locked || tt((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
|
|
161
|
+
}, wt = (e) => {
|
|
162
|
+
(!e || h) && (!e || g.canWrite) && (e && (x(1), ut(he), N(!1), tt([]), nt(void 0), w(void 0), z.reset(), B.reset(), U.reset()), et(e));
|
|
163
|
+
}, Tt = (e) => {
|
|
164
|
+
if (!h || !g.canWrite) return;
|
|
165
|
+
let t = X.find((t) => t.id === e);
|
|
166
|
+
$e(e), F(Se(t)), E(!0);
|
|
167
|
+
}, Et = (e) => {
|
|
168
|
+
(!e || h) && (!e || g.canWrite) && E(e);
|
|
169
|
+
}, Dt = () => {
|
|
170
|
+
if (!h || !g.canWrite || !v) return;
|
|
171
|
+
let t = X.find((e) => e.id === v), n = Ce(P, t);
|
|
172
|
+
Object.keys(n).length !== 0 && V.mutate({
|
|
173
|
+
path: { id: v },
|
|
165
174
|
body: n
|
|
166
175
|
}, { onSuccess: () => {
|
|
167
|
-
|
|
176
|
+
f(r.AccountUpdated, { accountId: v }), e.success(d.editSuccessToast), E(!1);
|
|
168
177
|
} });
|
|
169
|
-
},
|
|
170
|
-
|
|
171
|
-
},
|
|
172
|
-
(!e ||
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
},
|
|
176
|
-
if (!
|
|
177
|
-
let e =
|
|
178
|
-
e !== null && t !== null && (
|
|
179
|
-
path: { id:
|
|
178
|
+
}, Ot = (e) => {
|
|
179
|
+
h && g.canWrite && ($e(e), L(i), O(!1), D(!1), st(!0));
|
|
180
|
+
}, kt = (e) => {
|
|
181
|
+
(!e || h) && (!e || g.canWrite) && (e || (O(!1), D(!1)), st(e));
|
|
182
|
+
}, At = (e) => {
|
|
183
|
+
W.reset(), O(!1), L(e);
|
|
184
|
+
}, jt = () => {
|
|
185
|
+
if (!h || !g.canWrite || !v || !ye(I)) return;
|
|
186
|
+
let e = be(I.firstAmount), t = be(I.secondAmount);
|
|
187
|
+
e !== null && t !== null && (O(!1), W.mutate({
|
|
188
|
+
path: { id: v },
|
|
180
189
|
body: {
|
|
181
190
|
firstAmount: e,
|
|
182
191
|
secondAmount: t
|
|
183
192
|
}
|
|
184
193
|
}, { onSuccess: (e) => {
|
|
185
|
-
if (!
|
|
186
|
-
|
|
194
|
+
if (!Ue(e)) {
|
|
195
|
+
O(!0);
|
|
187
196
|
return;
|
|
188
197
|
}
|
|
189
|
-
|
|
198
|
+
f(r.AccountVerified, { accountId: v }), n("tesouro-new-external-bank-account-linked-success"), D(!0);
|
|
190
199
|
} }));
|
|
191
|
-
},
|
|
192
|
-
|
|
193
|
-
|
|
200
|
+
}, Mt = (e) => {
|
|
201
|
+
h && g.canMicroDeposit && (w("row"), U.mutate({ path: { id: e } }, { onSuccess: () => {
|
|
202
|
+
w(void 0), it((t) => Ge(t, e)), f(r.AccountLinked, { accountId: e });
|
|
194
203
|
} }));
|
|
195
|
-
},
|
|
196
|
-
|
|
197
|
-
},
|
|
198
|
-
e ||
|
|
199
|
-
},
|
|
200
|
-
if (!
|
|
201
|
-
let t =
|
|
202
|
-
|
|
203
|
-
|
|
204
|
+
}, Nt = (e) => {
|
|
205
|
+
h && g.canWrite && A(e);
|
|
206
|
+
}, Pt = (e) => {
|
|
207
|
+
e || A(void 0);
|
|
208
|
+
}, Ft = () => {
|
|
209
|
+
if (!h || !g.canWrite || !k) return;
|
|
210
|
+
let t = k;
|
|
211
|
+
H.mutate({ path: { id: t } }, { onSuccess: () => {
|
|
212
|
+
f(r.AccountUnlinked, { accountId: t }), e.success(d.unlinkSuccessToast), A(void 0);
|
|
204
213
|
} });
|
|
205
|
-
},
|
|
206
|
-
selectedUserIds:
|
|
207
|
-
disabled:
|
|
214
|
+
}, It = z.isPending || B.isPending || V.isPending || W.isPending || H.isPending || U.isPending, Lt = g.canWrite, Rt = !h || It, $ = U.isError && rt === "connect", zt = Le(Y, {
|
|
215
|
+
selectedUserIds: S,
|
|
216
|
+
disabled: Rt || !Lt,
|
|
208
217
|
fallbackTooltip: u.teamMemberAccessTooltip,
|
|
209
|
-
onUserToggle:
|
|
210
|
-
}),
|
|
218
|
+
onUserToggle: Ct
|
|
219
|
+
}), Bt = Y.filter((e) => e.locked).length + S.length, Vt = C ? ((e) => {
|
|
211
220
|
let t = e.accountNumber.slice(-4), n = {
|
|
212
221
|
type: {
|
|
213
|
-
text:
|
|
222
|
+
text: Oe(e.accountHolderType ? Ee(e.accountHolderType) : J.accountHolderType, e.type ?? J.type, d),
|
|
214
223
|
emphasized: !1
|
|
215
224
|
},
|
|
216
225
|
last4: {
|
|
@@ -218,7 +227,7 @@ function p({ labels: r, featureLabels: l }) {
|
|
|
218
227
|
emphasized: !0
|
|
219
228
|
}
|
|
220
229
|
};
|
|
221
|
-
return
|
|
230
|
+
return T.has(e.id) ? {
|
|
222
231
|
variant: "deposits-sent",
|
|
223
232
|
description: o(d.summaryDescription, n),
|
|
224
233
|
nextSteps: [{
|
|
@@ -235,72 +244,72 @@ function p({ labels: r, featureLabels: l }) {
|
|
|
235
244
|
description: o(d.summaryAccountAddedDescription, n),
|
|
236
245
|
nextSteps: []
|
|
237
246
|
};
|
|
238
|
-
})(
|
|
247
|
+
})(C) : void 0, Ht = Te(Z, d, g, {
|
|
239
248
|
labels: u,
|
|
240
|
-
onEditSelect:
|
|
241
|
-
onVerifySelect:
|
|
242
|
-
onLinkSelect:
|
|
243
|
-
onUnlinkSelect:
|
|
244
|
-
}),
|
|
245
|
-
if (!
|
|
246
|
-
let e =
|
|
249
|
+
onEditSelect: Tt,
|
|
250
|
+
onVerifySelect: Ot,
|
|
251
|
+
onLinkSelect: Mt,
|
|
252
|
+
onUnlinkSelect: Nt
|
|
253
|
+
}), Ut = s(() => {
|
|
254
|
+
if (!z.isError && !B.isError && !$) return;
|
|
255
|
+
let e = z.error ?? B.error ?? ($ ? U.error : void 0);
|
|
247
256
|
return ee(e) ?? u.actionErrorTitle;
|
|
248
257
|
}, [
|
|
258
|
+
z.error,
|
|
259
|
+
z.isError,
|
|
249
260
|
B.error,
|
|
250
261
|
B.isError,
|
|
251
|
-
V.error,
|
|
252
|
-
V.isError,
|
|
253
262
|
$,
|
|
254
|
-
|
|
263
|
+
U.error,
|
|
255
264
|
u.actionErrorTitle
|
|
256
265
|
]);
|
|
257
266
|
return {
|
|
258
|
-
rows:
|
|
259
|
-
isLoading: !
|
|
260
|
-
isError:
|
|
261
|
-
isConnectOpen:
|
|
262
|
-
isEditOpen:
|
|
263
|
-
isVerifyOpen:
|
|
264
|
-
isVerifySuccess:
|
|
265
|
-
verifyAccountName: Z.find((e) => e.id ===
|
|
266
|
-
verifyAccountNumber: Z.find((e) => e.id ===
|
|
267
|
-
isUnlinkOpen: !!
|
|
268
|
-
unlinkAccountNumber: Z.find((e) => e.id ===
|
|
269
|
-
connectStep:
|
|
270
|
-
accessRows:
|
|
271
|
-
accessGrantedCount:
|
|
272
|
-
connectSummary:
|
|
273
|
-
isTeamMembersLoading:
|
|
274
|
-
isTeamMembersError:
|
|
275
|
-
isConnectNextDisabled:
|
|
276
|
-
isConnectRoutingNumberInvalid:
|
|
277
|
-
connectErrorMessage:
|
|
278
|
-
isVerifyFirstAmountInvalid:
|
|
279
|
-
isVerifySecondAmountInvalid:
|
|
280
|
-
isVerifySubmitDisabled: !ye(
|
|
281
|
-
isActionDisabled:
|
|
282
|
-
canConnect:
|
|
283
|
-
isSubmitting:
|
|
284
|
-
isActionError:
|
|
285
|
-
isConnectError:
|
|
286
|
-
isEditError:
|
|
287
|
-
isVerifyError:
|
|
288
|
-
connectForm:
|
|
289
|
-
editForm:
|
|
290
|
-
verifyForm:
|
|
291
|
-
onConnectOpenChange:
|
|
292
|
-
onEditOpenChange:
|
|
293
|
-
onVerifyOpenChange:
|
|
294
|
-
onUnlinkOpenChange:
|
|
295
|
-
onConnectFormChange:
|
|
296
|
-
onEditFormChange:
|
|
297
|
-
onVerifyFormChange:
|
|
298
|
-
onConnectNext:
|
|
299
|
-
onConnectBack:
|
|
300
|
-
onEditSubmit:
|
|
301
|
-
onVerifySubmit:
|
|
302
|
-
onUnlinkConfirm:
|
|
267
|
+
rows: Ht,
|
|
268
|
+
isLoading: !Ze && (Xe && !R.data || Je && !m || _ && R.isLoading),
|
|
269
|
+
isError: Ze || _ && R.isError,
|
|
270
|
+
isConnectOpen: y,
|
|
271
|
+
isEditOpen: at,
|
|
272
|
+
isVerifyOpen: ot,
|
|
273
|
+
isVerifySuccess: ct,
|
|
274
|
+
verifyAccountName: Z.find((e) => e.id === v)?.nickname,
|
|
275
|
+
verifyAccountNumber: Z.find((e) => e.id === v)?.accountNumber,
|
|
276
|
+
isUnlinkOpen: !!k,
|
|
277
|
+
unlinkAccountNumber: Z.find((e) => e.id === k)?.accountNumber,
|
|
278
|
+
connectStep: b,
|
|
279
|
+
accessRows: zt,
|
|
280
|
+
accessGrantedCount: Bt,
|
|
281
|
+
connectSummary: Vt,
|
|
282
|
+
isTeamMembersLoading: ht,
|
|
283
|
+
isTeamMembersError: K.isError || mt,
|
|
284
|
+
isConnectNextDisabled: b === 1 ? !a(J) : b === 2 && !gt,
|
|
285
|
+
isConnectRoutingNumberInvalid: J.routingNumber.trim() !== "" && !_e(J.routingNumber),
|
|
286
|
+
connectErrorMessage: Ut,
|
|
287
|
+
isVerifyFirstAmountInvalid: I.firstAmount.trim() !== "" && !ve(I.firstAmount),
|
|
288
|
+
isVerifySecondAmountInvalid: I.secondAmount.trim() !== "" && !ve(I.secondAmount),
|
|
289
|
+
isVerifySubmitDisabled: !ye(I),
|
|
290
|
+
isActionDisabled: Rt,
|
|
291
|
+
canConnect: Lt,
|
|
292
|
+
isSubmitting: It,
|
|
293
|
+
isActionError: U.isError || H.isError || z.isError || B.isError || V.isError || W.isError || lt,
|
|
294
|
+
isConnectError: z.isError || B.isError || $,
|
|
295
|
+
isEditError: V.isError,
|
|
296
|
+
isVerifyError: W.isError || lt,
|
|
297
|
+
connectForm: J,
|
|
298
|
+
editForm: P,
|
|
299
|
+
verifyForm: I,
|
|
300
|
+
onConnectOpenChange: wt,
|
|
301
|
+
onEditOpenChange: Et,
|
|
302
|
+
onVerifyOpenChange: kt,
|
|
303
|
+
onUnlinkOpenChange: Pt,
|
|
304
|
+
onConnectFormChange: vt,
|
|
305
|
+
onEditFormChange: F,
|
|
306
|
+
onVerifyFormChange: At,
|
|
307
|
+
onConnectNext: xt,
|
|
308
|
+
onConnectBack: St,
|
|
309
|
+
onEditSubmit: Dt,
|
|
310
|
+
onVerifySubmit: jt,
|
|
311
|
+
onUnlinkConfirm: Ft
|
|
303
312
|
};
|
|
304
313
|
}
|
|
305
314
|
//#endregion
|
|
306
|
-
export { l as LOCALLY_SENT_MICRO_DEPOSIT_ACCOUNT_IDS_STORAGE_KEY,
|
|
315
|
+
export { l as LOCALLY_SENT_MICRO_DEPOSIT_ACCOUNT_IDS_STORAGE_KEY, f as useLinkedAccountsWidget };
|