@tesouro/embedded-components-react 0.7.14 → 0.7.16
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 +11 -2
- package/dist/lib/AcceptDisclosuresWidget.d.ts +7 -0
- package/dist/lib/BankAccountOnboardingWidget.d.ts +4 -2
- package/dist/lib/WidgetSuite.d.ts +4 -2
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +97 -97
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +441 -433
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -4,76 +4,75 @@
|
|
|
4
4
|
"use client";
|
|
5
5
|
import { Button as e, Dialog as t, DialogContent as n, DialogTitle as r, cn as i, toast as a } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
6
|
import { getStateOptions as o } from "../../../../../shared/util/dist/lib/usStates.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { useDisclosuresQuery as ee } from "../../../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
|
|
7
|
+
import { useEmbedApi as s } from "../../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
8
|
+
import { personDisclosure as c } from "../../../../../shared/data-access/dist/lib/disclosures/personDisclosure.js";
|
|
9
|
+
import { useAcceptWidgetDisclosures as l } from "../../../../../shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js";
|
|
10
|
+
import { useDisclosuresQuery as u } from "../../../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
|
|
12
11
|
import { OnboardingSuppressionReason as d } from "../../../../../shared/data-access/dist/lib/onboardingSuppressionReason.js";
|
|
13
|
-
import { useOrganizationOnboardingSuppression as
|
|
14
|
-
import { useOrganizationApplicationStatus as
|
|
12
|
+
import { useOrganizationOnboardingSuppression as ee } from "../../../../../shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js";
|
|
13
|
+
import { useOrganizationApplicationStatus as f } from "../../../../../shared/data-access/dist/lib/useOrganizationApplicationStatus.js";
|
|
15
14
|
import "../../../../../shared/data-access/dist/index.js";
|
|
16
|
-
import { EmbeddedToaster as
|
|
17
|
-
import { OnboardingShell as
|
|
15
|
+
import { EmbeddedToaster as te } from "../../../../../shared/ui/dist/lib/EmbeddedToaster.js";
|
|
16
|
+
import { OnboardingShell as ne } from "../../../../../shared/ui/dist/lib/OnboardingShell/OnboardingShell.js";
|
|
18
17
|
import "../../../../../shared/ui/dist/index.js";
|
|
19
|
-
import { useAnalyticsTrack as
|
|
20
|
-
import { WidgetProvider as
|
|
21
|
-
import { useRefetchWidget as
|
|
22
|
-
import { getNaicsOptions as
|
|
23
|
-
import { deniedNoticeExpiresAt as
|
|
18
|
+
import { useAnalyticsTrack as re } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
19
|
+
import { WidgetProvider as ie } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
20
|
+
import { useRefetchWidget as ae, useWidgetConfig as oe, useWidgetInitStaleForToken as se, useWidgetLoading as ce } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
21
|
+
import { getNaicsOptions as le } from "../../../../../shared/feature/dist/lib/naicsCodeMap.js";
|
|
22
|
+
import { deniedNoticeExpiresAt as ue, selectBankAccountApplication as de } from "../../../../../shared/feature/dist/lib/application/bankAccountApplication.js";
|
|
24
23
|
import "../../../../../shared/feature/dist/index.js";
|
|
25
|
-
import { ADDITIONAL_OWNERS_LABELS_EN as
|
|
26
|
-
import { interpolateBankName as
|
|
27
|
-
import { ApplicationStatusCard as
|
|
28
|
-
import { ResultStep as
|
|
29
|
-
import { UnsavedApplicationDialog as
|
|
30
|
-
import { DeleteApplicationDialog as
|
|
24
|
+
import { ADDITIONAL_OWNERS_LABELS_EN as fe } from "../../../../ui/dist/index6.js";
|
|
25
|
+
import { interpolateBankName as pe } from "../../../../ui/dist/index8.js";
|
|
26
|
+
import { ApplicationStatusCard as me } from "../../../../ui/dist/index11.js";
|
|
27
|
+
import { ResultStep as he } from "../../../../ui/dist/index15.js";
|
|
28
|
+
import { UnsavedApplicationDialog as ge } from "../../../../ui/dist/index29.js";
|
|
29
|
+
import { DeleteApplicationDialog as _e } from "../../../../ui/dist/index31.js";
|
|
31
30
|
import "../../../../ui/dist/index.js";
|
|
32
|
-
import { DEFAULT_LABELS as
|
|
33
|
-
import { OnboardingApplicationView as
|
|
34
|
-
import { identifierLast4 as
|
|
35
|
-
import { bankAccountOnboardingTestIds as
|
|
36
|
-
import { BusinessDetailsStep as
|
|
37
|
-
import { PersonalDetailsStep as
|
|
38
|
-
import { valuesKey as
|
|
39
|
-
import { AdditionalOwnersStep as
|
|
40
|
-
import { buildCreateApplicationBody as
|
|
41
|
-
import { buildOnboardingPrefill as
|
|
42
|
-
import { acceptDraftedValues as
|
|
43
|
-
import { OnboardingAnalyticsEvent as
|
|
44
|
-
import { withoutResumeOnlyOwnerFields as
|
|
45
|
-
import { ApplicationClientSecretProvider as
|
|
46
|
-
import { useCreateApplication as
|
|
47
|
-
import { useUpdateApplication as
|
|
48
|
-
import { useSubmitApplication as
|
|
49
|
-
import { useDeleteApplication as
|
|
50
|
-
import { usePollApplicationCompletion as
|
|
51
|
-
import { useResumableBankAccountApplication as
|
|
52
|
-
import { useStartedBankAccountApplication as
|
|
31
|
+
import { DEFAULT_LABELS as p } from "./labels.js";
|
|
32
|
+
import { OnboardingApplicationView as ve, applicationStatusNoticeFor as ye, hiddenViewReason as be, isNoticeView as xe, mergeApplicationStatusLabels as Se, onboardingApplicationViewFor as Ce } from "./applicationStatusView.js";
|
|
33
|
+
import { identifierLast4 as we, isIdentifierEnteredOrStored as m } from "./fieldInput/storedIdentifier.js";
|
|
34
|
+
import { bankAccountOnboardingTestIds as h } from "./testIds.js";
|
|
35
|
+
import { BusinessDetailsStep as Te } from "./BusinessDetailsStep.js";
|
|
36
|
+
import { PersonalDetailsStep as Ee } from "./PersonalDetailsStep.js";
|
|
37
|
+
import { valuesKey as g } from "./valuesKey.js";
|
|
38
|
+
import { AdditionalOwnersStep as De } from "./AdditionalOwnersStep.js";
|
|
39
|
+
import { buildCreateApplicationBody as Oe, buildUpdateApplicationBody as ke } from "./apiMapping.js";
|
|
40
|
+
import { buildOnboardingPrefill as Ae } from "./buildOnboardingPrefill.js";
|
|
41
|
+
import { acceptDraftedValues as je, asCreateBody as Me, buildDraftApplicationBody as Ne, draftOwners as Pe, withApplicantWorkEmail as Fe } from "./draftApplicationMapping.js";
|
|
42
|
+
import { OnboardingAnalyticsEvent as Ie, WIDGET_NAME as Le } from "../analytics/events.js";
|
|
43
|
+
import { withoutResumeOnlyOwnerFields as Re, withoutStoredIdentifierMarkers as ze } from "./hostInitialValues.js";
|
|
44
|
+
import { ApplicationClientSecretProvider as Be, useApplicationClientSecret as Ve } from "../../../../data-access/dist/index3.js";
|
|
45
|
+
import { useCreateApplication as He } from "../../../../data-access/dist/index5.js";
|
|
46
|
+
import { useUpdateApplication as Ue } from "../../../../data-access/dist/index6.js";
|
|
47
|
+
import { useSubmitApplication as We } from "../../../../data-access/dist/index7.js";
|
|
48
|
+
import { useDeleteApplication as Ge } from "../../../../data-access/dist/index8.js";
|
|
49
|
+
import { usePollApplicationCompletion as Ke } from "../../../../data-access/dist/index9.js";
|
|
50
|
+
import { useResumableBankAccountApplication as qe } from "../../../../data-access/dist/index11.js";
|
|
51
|
+
import { useStartedBankAccountApplication as Je } from "../../../../data-access/dist/index12.js";
|
|
53
52
|
import "../../../../data-access/dist/index.js";
|
|
54
|
-
import { useCallback as
|
|
55
|
-
import { Fragment as
|
|
53
|
+
import { useCallback as Ye, useEffect as _, useMemo as v, useReducer as Xe, useRef as y, useState as b } from "react";
|
|
54
|
+
import { Fragment as Ze, jsx as x, jsxs as Qe } from "react/jsx-runtime";
|
|
56
55
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js
|
|
57
|
-
var
|
|
58
|
-
function
|
|
56
|
+
var $e = 2 ** 31 - 1, et = "DRAFT", tt = [], S = (e) => m(e, void 0);
|
|
57
|
+
function nt(e) {
|
|
59
58
|
return {
|
|
60
59
|
...e,
|
|
61
60
|
taxId: "",
|
|
62
|
-
taxIdOnFileLast4:
|
|
61
|
+
taxIdOnFileLast4: we(e.taxId),
|
|
63
62
|
taxIdOnFileStructure: e.companyStructure === "" ? void 0 : e.companyStructure
|
|
64
63
|
};
|
|
65
64
|
}
|
|
66
|
-
function
|
|
65
|
+
function rt(e) {
|
|
67
66
|
return {
|
|
68
67
|
...e,
|
|
69
68
|
ssn: "",
|
|
70
|
-
ssnOnFileLast4:
|
|
69
|
+
ssnOnFileLast4: we(e.ssn)
|
|
71
70
|
};
|
|
72
71
|
}
|
|
73
|
-
function
|
|
72
|
+
function it(e, t) {
|
|
74
73
|
return t ? e.map((e, n) => n === t.index ? t.owner : e) : e;
|
|
75
74
|
}
|
|
76
|
-
var
|
|
75
|
+
var at = {
|
|
77
76
|
companyLegalName: "",
|
|
78
77
|
companyDbaName: "",
|
|
79
78
|
businessAddress: "",
|
|
@@ -87,7 +86,7 @@ var st = {
|
|
|
87
86
|
naicsCode: "",
|
|
88
87
|
isAuthorized: null,
|
|
89
88
|
isCheckboxChecked: !1
|
|
90
|
-
},
|
|
89
|
+
}, ot = {
|
|
91
90
|
firstName: "",
|
|
92
91
|
lastName: "",
|
|
93
92
|
dateOfBirth: void 0,
|
|
@@ -101,7 +100,7 @@ var st = {
|
|
|
101
100
|
ownsOver25Percent: null,
|
|
102
101
|
ownershipPercentage: null
|
|
103
102
|
};
|
|
104
|
-
function
|
|
103
|
+
function st(e, t) {
|
|
105
104
|
if (e === 0) return {
|
|
106
105
|
title: t.businessReviewTitle,
|
|
107
106
|
subtitle: t.businessReviewSubtitle
|
|
@@ -111,7 +110,7 @@ function lt(e, t) {
|
|
|
111
110
|
subtitle: t.personalReviewSubtitle
|
|
112
111
|
};
|
|
113
112
|
let n = {
|
|
114
|
-
...
|
|
113
|
+
...fe,
|
|
115
114
|
...t.additionalOwners
|
|
116
115
|
};
|
|
117
116
|
return {
|
|
@@ -119,61 +118,62 @@ function lt(e, t) {
|
|
|
119
118
|
subtitle: n.subheading
|
|
120
119
|
};
|
|
121
120
|
}
|
|
122
|
-
function
|
|
123
|
-
let
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}, [
|
|
127
|
-
let
|
|
128
|
-
...ye,
|
|
121
|
+
function ct({ onEmbeddedOnboardingCompletedSuccessfully: ie, onNavigateToDashboard: fe, labels: m, initialBusinessDetails: Ae, initialPersonalDetails: Le, initialAdditionalOwners: ze, initialApplicationId: Be = null, initialBoundAuthEpoch: qe, onEditableDraftChange: Je, onApplicationDeleted: et, onNoticeReplacedByForm: ct, bankLogoSrc: lt, disclosureLinks: ut, open: dt, defaultOpen: ft, onOpenChange: pt, isFullScreenInline: C = !1, showApplicationStatusRefresh: mt = !1, onResultPhaseChange: ht }) {
|
|
122
|
+
let w = re(), { authEpoch: gt } = s();
|
|
123
|
+
_(() => {
|
|
124
|
+
w(Ie.Mounted);
|
|
125
|
+
}, [w]);
|
|
126
|
+
let T = {
|
|
129
127
|
...p,
|
|
128
|
+
...m,
|
|
129
|
+
deleteFailedError: m?.deleteFailedError ?? p.deleteFailedError,
|
|
130
130
|
stepIndicator: {
|
|
131
|
-
...
|
|
132
|
-
...
|
|
131
|
+
...p.stepIndicator,
|
|
132
|
+
...m?.stepIndicator
|
|
133
133
|
},
|
|
134
|
-
businessDetails:
|
|
135
|
-
personalDetails:
|
|
136
|
-
additionalOwners:
|
|
134
|
+
businessDetails: m?.businessDetails ?? {},
|
|
135
|
+
personalDetails: m?.personalDetails ?? {},
|
|
136
|
+
additionalOwners: m?.additionalOwners ?? {},
|
|
137
137
|
result: {
|
|
138
|
-
...
|
|
139
|
-
...
|
|
138
|
+
...p.result,
|
|
139
|
+
...m?.result
|
|
140
140
|
},
|
|
141
|
-
unsavedApplicationDialog:
|
|
142
|
-
deleteApplicationDialog:
|
|
143
|
-
applicationStatus:
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
}, [
|
|
147
|
-
|
|
148
|
-
}, [
|
|
149
|
-
...
|
|
150
|
-
...
|
|
151
|
-
})), [
|
|
152
|
-
...
|
|
153
|
-
...
|
|
154
|
-
})), [
|
|
155
|
-
business:
|
|
156
|
-
personal:
|
|
157
|
-
owners:
|
|
158
|
-
})), [
|
|
159
|
-
|
|
160
|
-
if (!
|
|
141
|
+
unsavedApplicationDialog: m?.unsavedApplicationDialog ?? {},
|
|
142
|
+
deleteApplicationDialog: m?.deleteApplicationDialog ?? {},
|
|
143
|
+
applicationStatus: Se(m?.applicationStatus)
|
|
144
|
+
}, E = oe().initResponse, { termsHref: _t, privacyHref: vt, electronicCommunicationHref: yt, patriotActHref: bt } = ut ?? {}, xt = dt === void 0, [St, Ct] = b(() => ft ?? !1), D = xt ? St : dt, wt = ft ?? !1, O = Ye((e) => {
|
|
145
|
+
xt && Ct(e), pt?.(e);
|
|
146
|
+
}, [pt, xt]), Tt = Ye(() => {
|
|
147
|
+
ie();
|
|
148
|
+
}, [ie]), Et = ae(), [k, Dt] = b(0), [A, Ot] = b(() => ({
|
|
149
|
+
...at,
|
|
150
|
+
...Ae
|
|
151
|
+
})), [j, kt] = b(() => ({
|
|
152
|
+
...ot,
|
|
153
|
+
...Le
|
|
154
|
+
})), [M, N] = b(() => ze ?? []), [P, At] = b(() => ({
|
|
155
|
+
business: A,
|
|
156
|
+
personal: j,
|
|
157
|
+
owners: M
|
|
158
|
+
})), [jt, Mt] = b(null);
|
|
159
|
+
_(() => {
|
|
160
|
+
if (!jt) return;
|
|
161
161
|
let e = {
|
|
162
|
-
business:
|
|
163
|
-
personal:
|
|
164
|
-
owners:
|
|
162
|
+
business: A,
|
|
163
|
+
personal: j,
|
|
164
|
+
owners: M
|
|
165
165
|
};
|
|
166
|
-
|
|
166
|
+
At((t) => jt.next(e, t)), Mt(null);
|
|
167
167
|
}, [
|
|
168
|
-
|
|
169
|
-
k,
|
|
168
|
+
jt,
|
|
170
169
|
A,
|
|
171
|
-
j
|
|
170
|
+
j,
|
|
171
|
+
M
|
|
172
172
|
]);
|
|
173
|
-
let
|
|
173
|
+
let Nt = (e, { owners: t = "none" } = {}) => Mt({ next: (n, r) => ({
|
|
174
174
|
business: e.includes("business") ? n.business : r.business,
|
|
175
175
|
personal: e.includes("personal") ? n.personal : r.personal,
|
|
176
|
-
owners: t === "cleared" ?
|
|
176
|
+
owners: t === "cleared" ? tt : t === "restored" ? je({
|
|
177
177
|
current: n,
|
|
178
178
|
saved: r,
|
|
179
179
|
dirty: {
|
|
@@ -183,438 +183,446 @@ function ut({ onEmbeddedOnboardingCompletedSuccessfully: ae, onNavigateToDashboa
|
|
|
183
183
|
},
|
|
184
184
|
ownersWrite: "list"
|
|
185
185
|
}).owners : e.includes("owners") ? n.owners : r.owners
|
|
186
|
-
}) }), [
|
|
186
|
+
}) }), [Pt, Ft] = b(null), [It, Lt] = b(0), [Rt, zt] = b(!1), [Bt, Vt] = b(!1), [F, Ht] = b(null), [I, Ut] = b(null), [Wt, Gt] = b(null), [L, Kt] = b(Be), [qt, Jt] = b(!1), [R, Yt] = b({}), Xt = (e) => Yt((t) => ({
|
|
187
187
|
...t,
|
|
188
|
-
...e.taxId &&
|
|
188
|
+
...e.taxId && S(e.taxId) && e.taxIdStructure ? {
|
|
189
189
|
taxId: e.taxId,
|
|
190
190
|
taxIdStructure: e.taxIdStructure
|
|
191
191
|
} : {},
|
|
192
|
-
...e.ssn &&
|
|
193
|
-
})),
|
|
194
|
-
let { taxId: t, taxIdStructure: n } =
|
|
195
|
-
|
|
192
|
+
...e.ssn && S(e.ssn) ? { ssn: e.ssn } : {}
|
|
193
|
+
})), Zt = (e) => {
|
|
194
|
+
let { taxId: t, taxIdStructure: n } = R, r = t !== void 0 && n !== void 0 && e.companyStructure !== A.companyStructure && e.companyStructure !== "" && e.companyStructure === "SOLE_PROPRIETORSHIP" != (n === "SOLE_PROPRIETORSHIP");
|
|
195
|
+
Ot(r ? {
|
|
196
196
|
...e,
|
|
197
197
|
taxId: e.taxId === t ? "" : e.taxId,
|
|
198
|
-
taxIdOnFileLast4:
|
|
198
|
+
taxIdOnFileLast4: we(t),
|
|
199
199
|
taxIdOnFileStructure: n
|
|
200
200
|
} : e);
|
|
201
|
-
}, [
|
|
202
|
-
!
|
|
203
|
-
let [
|
|
204
|
-
|
|
205
|
-
let
|
|
206
|
-
|
|
207
|
-
if (
|
|
208
|
-
let e =
|
|
201
|
+
}, [Qt, $t] = b(qe ?? gt), [en, z] = b(null), [tn, nn] = b(!1), [rn, an] = b(!1);
|
|
202
|
+
!C && !D && rn && an(!1);
|
|
203
|
+
let [on, sn] = b(!1), [cn, ln] = b(null), un = He(), B = Ue(), dn = We(), fn = Ge(), pn = Ke(), { setClientSecret: mn } = Ve(), { data: hn, refetch: gn } = u(), { mutateAsync: _n } = l(), vn = ee(), V = f(), yn = se(), [bn, xn] = Xe((e) => e + 1, 0), Sn = v(() => de(V.applications), [V.applications]), Cn = y(null);
|
|
204
|
+
V.isResolved && (Cn.current = { application: Sn });
|
|
205
|
+
let H = V.isResolved ? Sn : Cn.current?.application ?? null, wn = ue(H), U = Ce(H), Tn = V.isResolved || Cn.current !== null && U === ve.Form;
|
|
206
|
+
_(() => {
|
|
207
|
+
if (wn === null) return;
|
|
208
|
+
let e = wn - Date.now();
|
|
209
209
|
if (e < 0) return;
|
|
210
|
-
let t = setTimeout(
|
|
210
|
+
let t = setTimeout(xn, Math.min(e + 1, $e));
|
|
211
211
|
return () => clearTimeout(t);
|
|
212
|
-
}, [
|
|
213
|
-
let
|
|
214
|
-
|
|
215
|
-
let
|
|
216
|
-
|
|
217
|
-
if (
|
|
218
|
-
}, [
|
|
219
|
-
let
|
|
220
|
-
|
|
221
|
-
let
|
|
222
|
-
|
|
223
|
-
let
|
|
224
|
-
|
|
225
|
-
|
|
212
|
+
}, [wn, bn]);
|
|
213
|
+
let En = y(null);
|
|
214
|
+
_(() => () => En.current?.abort(), []);
|
|
215
|
+
let Dn = v(() => le(T.businessDetails.naicsTitles), [T.businessDetails.naicsTitles]), On = v(() => o(T.businessDetails.stateTitles), [T.businessDetails.stateTitles]), kn = v(() => o(T.personalDetails.stateTitles), [T.personalDetails.stateTitles]), An = v(() => o(T.additionalOwners.stateTitles), [T.additionalOwners.stateTitles]), W = on || cn !== null, jn = y(ht);
|
|
216
|
+
jn.current = ht, _(() => {
|
|
217
|
+
if (W) return jn.current?.(!0), () => jn.current?.(!1);
|
|
218
|
+
}, [W]);
|
|
219
|
+
let Mn = E?.status === "ACTIVE" || E?.status === "INACTIVE", Nn = E?.status === "INVITED", Pn = Mn || Nn, G = vn.isResolved && Tn, Fn = E && !W && !Pn && G && xe(U) ? U : null, K = !!E && !W && Fn === null && (Pn || G && (vn.isSuppressed || U === ve.Hidden)), q = K ? Mn ? d.UserAlreadyOnboarded : Nn ? d.UserInvitedToOrganization : U === ve.Hidden ? be(H) : vn.reason ?? be(H) : null, In = !!E && G && !W, [Ln, Rn] = b(!1), zn = Ln && K && !Pn && q !== d.OrganizationApplicationDenialExpired, J = Fn ?? (zn ? "unavailable" : null);
|
|
220
|
+
In && Ln !== (J !== null) && Rn(J !== null);
|
|
221
|
+
let Y = zn && q === d.OrganizationApplicationComplete, Bn = ce(), [X, Vn] = b("idle"), [Hn, Un] = b(!1);
|
|
222
|
+
In && Y !== Hn && (Un(Y), Y && Vn("requested")), X === "requested" && Bn && Vn("inFlight"), X === "inFlight" && !Bn && Vn("idle");
|
|
223
|
+
let Wn = Y && X !== "idle";
|
|
224
|
+
_(() => {
|
|
225
|
+
K && q && (w(Ie.Suppressed, { reason: q }), console.info(`[onboarding] not shown: ${q}`));
|
|
226
226
|
}, [
|
|
227
|
-
G,
|
|
228
227
|
K,
|
|
229
|
-
|
|
228
|
+
q,
|
|
229
|
+
w
|
|
230
230
|
]);
|
|
231
|
-
let
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}, [
|
|
235
|
-
let
|
|
236
|
-
|
|
237
|
-
let
|
|
238
|
-
|
|
239
|
-
if (!
|
|
240
|
-
let e =
|
|
241
|
-
|
|
231
|
+
let Gn = yn || !(C || D) ? null : Fn;
|
|
232
|
+
_(() => {
|
|
233
|
+
Gn && w(Ie.ApplicationStatusShown, { view: Gn });
|
|
234
|
+
}, [Gn, w]);
|
|
235
|
+
let Kn = y(J), qn = y(ct);
|
|
236
|
+
qn.current = ct;
|
|
237
|
+
let Jn = y(Et);
|
|
238
|
+
Jn.current = Et, _(() => {
|
|
239
|
+
if (!G || W) return;
|
|
240
|
+
let e = Kn.current !== null;
|
|
241
|
+
Kn.current = J, e && J === null && U === ve.Form && qn.current?.();
|
|
242
242
|
}, [
|
|
243
|
-
H,
|
|
244
243
|
U,
|
|
245
244
|
W,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
245
|
+
G,
|
|
246
|
+
J
|
|
247
|
+
]), _(() => {
|
|
248
|
+
X === "requested" && Jn.current();
|
|
249
|
+
}, [X]), _(() => {
|
|
250
|
+
Je?.(W || L === null ? null : {
|
|
251
|
+
applicationId: L,
|
|
252
|
+
authEpoch: Qt
|
|
253
253
|
});
|
|
254
254
|
}, [
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
255
|
+
Je,
|
|
256
|
+
W,
|
|
257
|
+
L,
|
|
258
|
+
Qt
|
|
259
259
|
]);
|
|
260
|
-
let
|
|
261
|
-
if (
|
|
262
|
-
if (!
|
|
263
|
-
if (
|
|
264
|
-
if (
|
|
265
|
-
if (
|
|
266
|
-
let a =
|
|
260
|
+
let Yn = y(gt);
|
|
261
|
+
if (Yn.current = gt, !E) return null;
|
|
262
|
+
if (!W) {
|
|
263
|
+
if (K && !J || Wn || !G) return null;
|
|
264
|
+
if (J) {
|
|
265
|
+
if (yn) return null;
|
|
266
|
+
let a = ye(J, H, E.bankName?.trim() || T.fallbackBankName, T.applicationStatus), o = /* @__PURE__ */ x(me, {
|
|
267
267
|
...a,
|
|
268
|
-
className: i("ttw:max-w-2xl", !
|
|
268
|
+
className: i("ttw:max-w-2xl", !C && "ttw:pr-12"),
|
|
269
269
|
testIds: {
|
|
270
|
-
root:
|
|
271
|
-
chip:
|
|
270
|
+
root: h.statusCard,
|
|
271
|
+
chip: h.statusCardChip
|
|
272
272
|
},
|
|
273
|
-
action:
|
|
273
|
+
action: mt ? /* @__PURE__ */ x(e, {
|
|
274
274
|
variant: "outline",
|
|
275
|
-
onClick:
|
|
276
|
-
"data-testid":
|
|
277
|
-
children:
|
|
275
|
+
onClick: Y ? () => Vn("requested") : vn.refetch,
|
|
276
|
+
"data-testid": h.statusCardCheckAgain,
|
|
277
|
+
children: T.applicationStatus.checkAgain
|
|
278
278
|
}) : void 0
|
|
279
279
|
});
|
|
280
|
-
return
|
|
280
|
+
return C ? /* @__PURE__ */ x("div", {
|
|
281
281
|
className: "ttw:grid ttw:h-full ttw:w-full ttw:place-items-center ttw:overflow-auto ttw:bg-background ttw:p-6",
|
|
282
282
|
children: o
|
|
283
|
-
}) : /* @__PURE__ */
|
|
284
|
-
open:
|
|
285
|
-
onOpenChange:
|
|
286
|
-
children: /* @__PURE__ */
|
|
283
|
+
}) : /* @__PURE__ */ x(t, {
|
|
284
|
+
open: D,
|
|
285
|
+
onOpenChange: O,
|
|
286
|
+
children: /* @__PURE__ */ Qe(n, {
|
|
287
287
|
showCloseButton: !0,
|
|
288
|
-
closeButtonTestId:
|
|
289
|
-
labels: { close:
|
|
288
|
+
closeButtonTestId: h.statusCardClose,
|
|
289
|
+
labels: { close: T.applicationStatus.close },
|
|
290
290
|
className: "ttw:max-h-[90vh] ttw:w-[720px] ttw:max-w-[calc(100vw-2rem)] ttw:gap-0 ttw:overflow-y-auto ttw:rounded-2xl ttw:border-0 ttw:p-0",
|
|
291
|
-
children: [/* @__PURE__ */
|
|
291
|
+
children: [/* @__PURE__ */ x(r, {
|
|
292
292
|
className: "ttw:sr-only",
|
|
293
|
-
children:
|
|
293
|
+
children: T.modalTitle
|
|
294
294
|
}), o]
|
|
295
295
|
})
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
let
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
],
|
|
304
|
-
|
|
305
|
-
},
|
|
306
|
-
business:
|
|
307
|
-
personal:
|
|
308
|
-
owners:
|
|
309
|
-
},
|
|
310
|
-
business: (e) =>
|
|
311
|
-
personal: (e) =>
|
|
312
|
-
owners: (e) => e.map((e) => e.id &&
|
|
313
|
-
},
|
|
299
|
+
let Z = F?.companyStructure === "SOLE_PROPRIETORSHIP", Xn = [
|
|
300
|
+
T.stepIndicator.business,
|
|
301
|
+
T.stepIndicator.personal,
|
|
302
|
+
T.stepIndicator.ownership
|
|
303
|
+
], Zn = k === 0 ? F : k === 1 ? I : k === 2 ? Wt : null, Q = un.isPending || B.isPending || dn.isPending || fn.isPending || on, Qn = () => {
|
|
304
|
+
z(null), Dt((e) => e === 0 ? 0 : e - 1);
|
|
305
|
+
}, $n = {
|
|
306
|
+
business: g(A) !== g(P.business),
|
|
307
|
+
personal: g(j) !== g(P.personal),
|
|
308
|
+
owners: g(A.companyStructure === "SOLE_PROPRIETORSHIP" ? tt : it(M, Pt)) !== g(P.owners)
|
|
309
|
+
}, er = $n.business || $n.personal || $n.owners, $ = {
|
|
310
|
+
business: (e) => R.taxId && e.taxId === R.taxId ? nt(e) : e,
|
|
311
|
+
personal: (e) => R.ssn && e.ssn === R.ssn ? rt(e) : e,
|
|
312
|
+
owners: (e) => e.map((e) => e.id && S(e.ssn) ? rt(e) : e)
|
|
313
|
+
}, tr = () => At((e) => ({
|
|
314
314
|
business: $.business(e.business),
|
|
315
315
|
personal: $.personal(e.personal),
|
|
316
316
|
owners: $.owners(e.owners)
|
|
317
|
-
})),
|
|
318
|
-
|
|
319
|
-
},
|
|
320
|
-
e ?
|
|
321
|
-
},
|
|
322
|
-
|
|
317
|
+
})), nr = () => {
|
|
318
|
+
Q || (er ? zt(!0) : (Ot($.business), kt($.personal), N($.owners), tr(), O(!1)));
|
|
319
|
+
}, rr = (e) => {
|
|
320
|
+
e ? O(!0) : nr();
|
|
321
|
+
}, ir = nr, ar = async (e) => {
|
|
322
|
+
sn(!0), O(!0);
|
|
323
323
|
let t = new AbortController();
|
|
324
|
-
|
|
324
|
+
En.current = t;
|
|
325
325
|
let n = !1;
|
|
326
326
|
try {
|
|
327
|
-
let r = await
|
|
327
|
+
let r = await dn.mutateAsync({ path: { id: e } });
|
|
328
328
|
if (t.signal.aborted) return;
|
|
329
|
-
if (!r.id) throw Error(
|
|
330
|
-
if (n = !0, (await
|
|
331
|
-
let e =
|
|
332
|
-
if (e === void 0 && (e = (await
|
|
329
|
+
if (!r.id) throw Error(T.submitFailedError);
|
|
330
|
+
if (n = !0, (await pn(e, { signal: t.signal })).status === "complete") {
|
|
331
|
+
let e = hn;
|
|
332
|
+
if (e === void 0 && (e = (await gn()).data), t.signal.aborted) return;
|
|
333
333
|
if (e !== void 0) try {
|
|
334
|
-
await
|
|
334
|
+
await _n({ displayedVersion: c(e)?.disclosureId ?? null });
|
|
335
335
|
} catch {}
|
|
336
336
|
if (t.signal.aborted) return;
|
|
337
|
-
|
|
338
|
-
} else
|
|
337
|
+
ln("success"), Et(), Tt();
|
|
338
|
+
} else ln("pending");
|
|
339
339
|
} catch (e) {
|
|
340
340
|
if (e instanceof DOMException && e.name === "AbortError") return;
|
|
341
341
|
if (!n) throw e;
|
|
342
|
-
|
|
342
|
+
ln("pending");
|
|
343
343
|
} finally {
|
|
344
|
-
|
|
344
|
+
En.current = null, sn(!1);
|
|
345
345
|
}
|
|
346
|
+
}, or = ({ evenWithoutMarker: e = !1 } = {}) => {
|
|
347
|
+
Ot((t) => (t.taxIdOnFileLast4 || e) && S(t.taxId) ? nt(t) : t);
|
|
346
348
|
}, sr = ({ evenWithoutMarker: e = !1 } = {}) => {
|
|
347
|
-
|
|
349
|
+
kt((t) => (t.ssnOnFileLast4 || e) && S(t.ssn) ? rt(t) : t);
|
|
348
350
|
}, cr = ({ evenWithoutMarker: e = !1 } = {}) => {
|
|
349
|
-
|
|
350
|
-
}, lr = (
|
|
351
|
-
|
|
352
|
-
}, ur = () => {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
let e = I;
|
|
362
|
-
return e ? await z.mutateAsync({
|
|
351
|
+
N((t) => t.map((t) => (t.ssnOnFileLast4 || e && t.id) && S(t.ssn) ? rt(t) : t));
|
|
352
|
+
}, lr = () => {
|
|
353
|
+
N((e) => e.map(Re));
|
|
354
|
+
}, ur = async (e) => {
|
|
355
|
+
let t = Yn.current, n = await un.mutateAsync({ body: Fe(e, j) });
|
|
356
|
+
return Kt(n.id), $t(t), n.clientSecret && mn(n.id, n.clientSecret), n.id;
|
|
357
|
+
}, dr = async () => {
|
|
358
|
+
let e = P.business.companyStructure === "SOLE_PROPRIETORSHIP" && !Z ? Pe(M) : [], t = e.length > 0 ? { businessOwners: e } : {};
|
|
359
|
+
if (k === 0) {
|
|
360
|
+
if (!F) return null;
|
|
361
|
+
let e = L;
|
|
362
|
+
return e ? await B.mutateAsync({
|
|
363
363
|
path: { id: e },
|
|
364
364
|
body: {
|
|
365
|
-
...
|
|
366
|
-
businessDetails:
|
|
367
|
-
carryConsent: !
|
|
365
|
+
...ke({
|
|
366
|
+
businessDetails: F,
|
|
367
|
+
carryConsent: !qt
|
|
368
368
|
}),
|
|
369
369
|
...t
|
|
370
370
|
}
|
|
371
|
-
}) : (e = await
|
|
372
|
-
taxId:
|
|
373
|
-
taxIdStructure:
|
|
374
|
-
}),
|
|
371
|
+
}) : (e = await ur(Oe(F)), Jt(!0)), Xt({
|
|
372
|
+
taxId: F.taxId,
|
|
373
|
+
taxIdStructure: F.companyStructure
|
|
374
|
+
}), or(), Z && lr(), Nt(["business"], { owners: Z ? "cleared" : t.businessOwners ? "restored" : "none" }), e;
|
|
375
375
|
}
|
|
376
|
-
return
|
|
377
|
-
path: { id:
|
|
376
|
+
return k === 1 ? !I || !F || !L ? null : (await B.mutateAsync({
|
|
377
|
+
path: { id: L },
|
|
378
378
|
body: {
|
|
379
|
-
...
|
|
380
|
-
businessDetails:
|
|
381
|
-
applicant:
|
|
382
|
-
carryConsent: !
|
|
379
|
+
...ke({
|
|
380
|
+
businessDetails: F,
|
|
381
|
+
applicant: I,
|
|
382
|
+
carryConsent: !qt
|
|
383
383
|
}),
|
|
384
384
|
...t
|
|
385
385
|
}
|
|
386
|
-
}),
|
|
387
|
-
taxId:
|
|
388
|
-
taxIdStructure:
|
|
389
|
-
ssn:
|
|
390
|
-
}),
|
|
391
|
-
path: { id:
|
|
392
|
-
body:
|
|
393
|
-
}),
|
|
394
|
-
},
|
|
395
|
-
|
|
386
|
+
}), Xt({
|
|
387
|
+
taxId: F.taxId,
|
|
388
|
+
taxIdStructure: F.companyStructure,
|
|
389
|
+
ssn: I.ssn
|
|
390
|
+
}), or(), sr(), Nt(["business", "personal"], { owners: Z ? "cleared" : t.businessOwners ? "restored" : "none" }), L) : k === 2 ? !Wt || !L ? null : (await B.mutateAsync({
|
|
391
|
+
path: { id: L },
|
|
392
|
+
body: ke({ businessOwners: Wt })
|
|
393
|
+
}), cr(), Nt(["owners"]), L) : null;
|
|
394
|
+
}, fr = async () => {
|
|
395
|
+
z(null);
|
|
396
|
+
let e;
|
|
396
397
|
try {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
398
|
+
e = await dr();
|
|
399
|
+
} catch {
|
|
400
|
+
z(T.genericRetryError);
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
if (e !== null) {
|
|
404
|
+
if (k === 2) try {
|
|
405
|
+
await ar(e);
|
|
406
|
+
} catch {
|
|
407
|
+
z(T.submitFailedError);
|
|
408
|
+
}
|
|
409
|
+
else Dt(k + 1);
|
|
402
410
|
}
|
|
403
|
-
},
|
|
404
|
-
|
|
411
|
+
}, pr = async () => {
|
|
412
|
+
z(null), nn(!0);
|
|
405
413
|
try {
|
|
406
|
-
if (await
|
|
407
|
-
|
|
408
|
-
} catch
|
|
409
|
-
a.error(
|
|
414
|
+
if (await dr() === null) return;
|
|
415
|
+
or({ evenWithoutMarker: !0 }), k >= 1 && sr({ evenWithoutMarker: !0 }), k === 2 && cr({ evenWithoutMarker: !0 }), a.success(T.applicationSavedToast), O(!1);
|
|
416
|
+
} catch {
|
|
417
|
+
a.error(T.genericRetryError);
|
|
410
418
|
} finally {
|
|
411
|
-
|
|
419
|
+
nn(!1);
|
|
412
420
|
}
|
|
413
|
-
},
|
|
414
|
-
let e =
|
|
415
|
-
businessDetails:
|
|
416
|
-
applicant:
|
|
421
|
+
}, mr = async () => {
|
|
422
|
+
let e = it(M, Pt), t = Ne({
|
|
423
|
+
businessDetails: A,
|
|
424
|
+
applicant: j,
|
|
417
425
|
businessOwners: e,
|
|
418
|
-
savedBusinessDetails:
|
|
419
|
-
savedOwners:
|
|
420
|
-
dirty:
|
|
421
|
-
}), n =
|
|
422
|
-
|
|
426
|
+
savedBusinessDetails: P.business,
|
|
427
|
+
savedOwners: P.owners,
|
|
428
|
+
dirty: $n
|
|
429
|
+
}), n = $n;
|
|
430
|
+
Vt(!0);
|
|
423
431
|
try {
|
|
424
432
|
if (!t) {
|
|
425
|
-
a.error(
|
|
433
|
+
a.error(T.saveDraftNothingValidError);
|
|
426
434
|
return;
|
|
427
435
|
}
|
|
428
|
-
let r = !
|
|
429
|
-
|
|
430
|
-
path: { id:
|
|
436
|
+
let r = !L;
|
|
437
|
+
L ? await B.mutateAsync({
|
|
438
|
+
path: { id: L },
|
|
431
439
|
body: t
|
|
432
|
-
}) : await
|
|
440
|
+
}) : await ur(Me(t)), Pt && N(e), a.success(T.applicationSavedToast);
|
|
433
441
|
let i = t;
|
|
434
|
-
r && i.applicant?.isLegallyAuthorized && i.applicant?.hasAcceptedDisclosures &&
|
|
442
|
+
r && i.applicant?.isLegallyAuthorized && i.applicant?.hasAcceptedDisclosures && Jt(!0), Xt({
|
|
435
443
|
taxId: i.businessDetails?.taxId?.value,
|
|
436
|
-
taxIdStructure:
|
|
444
|
+
taxIdStructure: A.companyStructure,
|
|
437
445
|
ssn: i.applicant?.personalIdentificationNumber?.value
|
|
438
|
-
}), i.businessDetails?.taxId !== void 0 &&
|
|
446
|
+
}), i.businessDetails?.taxId !== void 0 && or({ evenWithoutMarker: !0 }), i.applicant?.personalIdentificationNumber !== void 0 && sr({ evenWithoutMarker: !0 }), Array.isArray(i.businessOwners) && cr({ evenWithoutMarker: !0 }), i.businessOwners === null && e.length > 0 && lr();
|
|
439
447
|
let o = Array.isArray(i.businessOwners) ? "list" : i.businessOwners === null ? "cleared" : "none";
|
|
440
|
-
|
|
448
|
+
Mt({ next: (e, t) => je({
|
|
441
449
|
current: e,
|
|
442
450
|
saved: t,
|
|
443
451
|
dirty: n,
|
|
444
452
|
ownersWrite: o
|
|
445
|
-
}) }),
|
|
446
|
-
} catch
|
|
447
|
-
a.error(
|
|
453
|
+
}) }), Ft(null), Lt((e) => e + 1), zt(!1), O(!1);
|
|
454
|
+
} catch {
|
|
455
|
+
a.error(T.genericRetryError);
|
|
448
456
|
} finally {
|
|
449
|
-
|
|
457
|
+
Vt(!1);
|
|
450
458
|
}
|
|
451
|
-
},
|
|
452
|
-
|
|
453
|
-
},
|
|
454
|
-
if (
|
|
459
|
+
}, hr = () => {
|
|
460
|
+
Ot($.business(P.business)), kt($.personal(P.personal)), N($.owners(P.owners)), tr(), Ft(null), Lt((e) => e + 1), z(null), zt(!1), O(!1);
|
|
461
|
+
}, gr = async () => {
|
|
462
|
+
if (L !== null) {
|
|
455
463
|
try {
|
|
456
|
-
await
|
|
457
|
-
} catch
|
|
458
|
-
a.error(
|
|
464
|
+
await fn.mutateAsync({ path: { id: L } });
|
|
465
|
+
} catch {
|
|
466
|
+
a.error(T.deleteFailedError);
|
|
459
467
|
return;
|
|
460
468
|
}
|
|
461
|
-
a.success(
|
|
469
|
+
a.success(T.applicationDeletedToast);
|
|
462
470
|
}
|
|
463
|
-
|
|
464
|
-
},
|
|
465
|
-
if (
|
|
466
|
-
let e =
|
|
467
|
-
...
|
|
468
|
-
...
|
|
469
|
-
}, c = /* @__PURE__ */
|
|
471
|
+
an(!1), O(!1), et?.();
|
|
472
|
+
}, _r = st(Math.min(k, 2), T), vr = E.bankName?.trim() || T.fallbackBankName, yr = pe(T.shellFdicDisclaimer, vr);
|
|
473
|
+
if (W) {
|
|
474
|
+
let e = F?.companyLegalName ?? "", i = E.bankName?.trim() || T.fallbackBankName, a = cn ?? "pending", o = a === "success", s = {
|
|
475
|
+
...p.result,
|
|
476
|
+
...T.result
|
|
477
|
+
}, c = /* @__PURE__ */ x(he, {
|
|
470
478
|
testIds: {
|
|
471
|
-
processing:
|
|
472
|
-
dashboardButton:
|
|
479
|
+
processing: h.resultProcessing,
|
|
480
|
+
dashboardButton: h.resultDashboardButton
|
|
473
481
|
},
|
|
474
482
|
status: a,
|
|
475
|
-
isLoading:
|
|
483
|
+
isLoading: on,
|
|
476
484
|
loadingMessage: s.loadingMessage,
|
|
477
485
|
headingLine1: o ? s.successHeadingLine1 : s.pendingHeadingLine1,
|
|
478
486
|
headingLine2: `${e}!`,
|
|
479
487
|
body: o ? s.successBody : s.pendingBody,
|
|
480
|
-
followUpEmail:
|
|
488
|
+
followUpEmail: I?.workEmail ?? "",
|
|
481
489
|
emailBoxLead: s.pendingEmailBoxLead,
|
|
482
490
|
navigateToDashboardLabel: s.navigateToDashboard,
|
|
483
|
-
bankLogoSrc:
|
|
484
|
-
bankLogoAlt:
|
|
485
|
-
fdicDisclaimer:
|
|
486
|
-
onNavigateToDashboard:
|
|
491
|
+
bankLogoSrc: lt,
|
|
492
|
+
bankLogoAlt: pe(s.bankLogoAlt, i),
|
|
493
|
+
fdicDisclaimer: pe(s.fdicDisclaimer, i),
|
|
494
|
+
onNavigateToDashboard: fe
|
|
487
495
|
});
|
|
488
|
-
return
|
|
496
|
+
return C ? /* @__PURE__ */ x("div", {
|
|
489
497
|
className: "ttw:grid ttw:h-full ttw:w-full ttw:grid-rows-[1fr] ttw:place-items-center ttw:gap-0 ttw:overflow-auto ttw:bg-background",
|
|
490
498
|
children: c
|
|
491
|
-
}) : /* @__PURE__ */
|
|
492
|
-
open:
|
|
493
|
-
onOpenChange:
|
|
494
|
-
children: /* @__PURE__ */
|
|
499
|
+
}) : /* @__PURE__ */ x(t, {
|
|
500
|
+
open: D,
|
|
501
|
+
onOpenChange: O,
|
|
502
|
+
children: /* @__PURE__ */ Qe(n, {
|
|
495
503
|
className: "ttw:grid ttw:max-h-[95vh] ttw:w-[720px] ttw:max-w-[calc(100vw-2rem)] ttw:grid-rows-[1fr] ttw:gap-0 ttw:overflow-hidden ttw:rounded-2xl ttw:p-0",
|
|
496
|
-
children: [/* @__PURE__ */
|
|
504
|
+
children: [/* @__PURE__ */ x(r, {
|
|
497
505
|
className: "ttw:sr-only",
|
|
498
|
-
children:
|
|
506
|
+
children: T.modalTitle
|
|
499
507
|
}), c]
|
|
500
508
|
})
|
|
501
509
|
});
|
|
502
510
|
}
|
|
503
|
-
let
|
|
504
|
-
return /* @__PURE__ */
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
-
open:
|
|
507
|
-
defaultOpen:
|
|
508
|
-
onOpenChange:
|
|
509
|
-
isFullScreenInline:
|
|
510
|
-
title:
|
|
511
|
-
subtitle:
|
|
512
|
-
stepLabels:
|
|
513
|
-
activeStep:
|
|
514
|
-
disclaimerText:
|
|
515
|
-
onBack:
|
|
516
|
-
onCancel:
|
|
517
|
-
onNext:
|
|
518
|
-
onSaveAndClose:
|
|
519
|
-
onDelete: () =>
|
|
511
|
+
let br = k === 2 ? T.submit : T.next, xr = Zn === null || Q;
|
|
512
|
+
return /* @__PURE__ */ Qe(Ze, { children: [
|
|
513
|
+
/* @__PURE__ */ Qe(ne, {
|
|
514
|
+
open: D,
|
|
515
|
+
defaultOpen: wt,
|
|
516
|
+
onOpenChange: rr,
|
|
517
|
+
isFullScreenInline: C,
|
|
518
|
+
title: _r.title,
|
|
519
|
+
subtitle: _r.subtitle,
|
|
520
|
+
stepLabels: Xn,
|
|
521
|
+
activeStep: k,
|
|
522
|
+
disclaimerText: yr,
|
|
523
|
+
onBack: k === 0 ? ir : Qn,
|
|
524
|
+
onCancel: k > 0 ? ir : void 0,
|
|
525
|
+
onNext: fr,
|
|
526
|
+
onSaveAndClose: pr,
|
|
527
|
+
onDelete: () => an(!0),
|
|
520
528
|
showDismissButton: !1,
|
|
521
|
-
isNextDisabled:
|
|
522
|
-
isNextLoading:
|
|
523
|
-
isSaveAndCloseDisabled:
|
|
524
|
-
isSaveAndCloseLoading:
|
|
525
|
-
nextLabel:
|
|
529
|
+
isNextDisabled: xr,
|
|
530
|
+
isNextLoading: Q && !tn,
|
|
531
|
+
isSaveAndCloseDisabled: xr,
|
|
532
|
+
isSaveAndCloseLoading: tn,
|
|
533
|
+
nextLabel: br,
|
|
526
534
|
nextIcon: null,
|
|
527
|
-
errorMessage:
|
|
535
|
+
errorMessage: en,
|
|
528
536
|
labels: {
|
|
529
|
-
backButton:
|
|
530
|
-
cancelButton:
|
|
531
|
-
saveAndCloseButton:
|
|
532
|
-
deleteButton:
|
|
537
|
+
backButton: k === 0 ? T.cancel : T.back,
|
|
538
|
+
cancelButton: T.cancel,
|
|
539
|
+
saveAndCloseButton: T.saveAndClose,
|
|
540
|
+
deleteButton: T.deleteApplication
|
|
533
541
|
},
|
|
534
542
|
testIds: {
|
|
535
|
-
root:
|
|
536
|
-
dismiss:
|
|
537
|
-
back:
|
|
538
|
-
cancel:
|
|
539
|
-
saveAndClose:
|
|
540
|
-
delete:
|
|
541
|
-
next:
|
|
543
|
+
root: h.shell,
|
|
544
|
+
dismiss: h.shellDismiss,
|
|
545
|
+
back: h.shellBack,
|
|
546
|
+
cancel: h.shellCancel,
|
|
547
|
+
saveAndClose: h.shellSaveAndClose,
|
|
548
|
+
delete: h.shellDelete,
|
|
549
|
+
next: h.shellNext,
|
|
542
550
|
scrollRegion: {
|
|
543
|
-
root:
|
|
544
|
-
fade:
|
|
545
|
-
hint:
|
|
551
|
+
root: h.shellScrollRegion,
|
|
552
|
+
fade: h.shellScrollFade,
|
|
553
|
+
hint: h.shellScrollHint
|
|
546
554
|
}
|
|
547
555
|
},
|
|
548
556
|
children: [
|
|
549
|
-
|
|
550
|
-
value: k,
|
|
551
|
-
onValueChange: $t,
|
|
552
|
-
onSnapshotChange: Wt,
|
|
553
|
-
naicsOptions: kn,
|
|
554
|
-
stateOptions: An,
|
|
555
|
-
isSubmitting: Z,
|
|
556
|
-
labels: w.businessDetails,
|
|
557
|
-
bankName: br,
|
|
558
|
-
termsHref: yt,
|
|
559
|
-
privacyHref: bt,
|
|
560
|
-
electronicCommunicationHref: xt,
|
|
561
|
-
patriotActHref: St
|
|
562
|
-
}, "business") : null,
|
|
563
|
-
O === 1 ? /* @__PURE__ */ b(Oe, {
|
|
557
|
+
k === 0 ? /* @__PURE__ */ x(Te, {
|
|
564
558
|
value: A,
|
|
565
|
-
onValueChange:
|
|
566
|
-
onSnapshotChange:
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
559
|
+
onValueChange: Zt,
|
|
560
|
+
onSnapshotChange: Ht,
|
|
561
|
+
naicsOptions: Dn,
|
|
562
|
+
stateOptions: On,
|
|
563
|
+
isSubmitting: Q,
|
|
564
|
+
labels: T.businessDetails,
|
|
565
|
+
bankName: vr,
|
|
566
|
+
termsHref: _t,
|
|
567
|
+
privacyHref: vt,
|
|
568
|
+
electronicCommunicationHref: yt,
|
|
569
|
+
patriotActHref: bt
|
|
570
|
+
}, "business") : null,
|
|
571
|
+
k === 1 ? /* @__PURE__ */ x(Ee, {
|
|
572
|
+
value: j,
|
|
573
|
+
onValueChange: kt,
|
|
574
|
+
onSnapshotChange: Ut,
|
|
575
|
+
stateOptions: kn,
|
|
576
|
+
isSubmitting: Q,
|
|
577
|
+
labels: T.personalDetails
|
|
570
578
|
}, "personal") : null,
|
|
571
|
-
|
|
572
|
-
owners:
|
|
573
|
-
onOwnersChange:
|
|
574
|
-
primaryOwnerName: `${
|
|
575
|
-
primaryOwnerPercentage:
|
|
576
|
-
stateOptions:
|
|
577
|
-
onSnapshotChange:
|
|
578
|
-
onPendingOwnerChange:
|
|
579
|
-
isSubmitting:
|
|
580
|
-
labels:
|
|
581
|
-
},
|
|
579
|
+
k === 2 ? /* @__PURE__ */ x(De, {
|
|
580
|
+
owners: Z ? tt : M,
|
|
581
|
+
onOwnersChange: N,
|
|
582
|
+
primaryOwnerName: `${j.firstName} ${j.lastName}`.trim(),
|
|
583
|
+
primaryOwnerPercentage: Z ? 100 : I?.ownsOver25Percent === !0 ? I.ownershipPercentage ?? 0 : 0,
|
|
584
|
+
stateOptions: An,
|
|
585
|
+
onSnapshotChange: Gt,
|
|
586
|
+
onPendingOwnerChange: Ft,
|
|
587
|
+
isSubmitting: Q,
|
|
588
|
+
labels: T.additionalOwners
|
|
589
|
+
}, It) : null
|
|
582
590
|
]
|
|
583
591
|
}),
|
|
584
|
-
/* @__PURE__ */
|
|
585
|
-
open:
|
|
586
|
-
onSaveDraft:
|
|
587
|
-
onDiscard:
|
|
588
|
-
onCancel: () =>
|
|
589
|
-
isSaving:
|
|
590
|
-
labels:
|
|
592
|
+
/* @__PURE__ */ x(ge, {
|
|
593
|
+
open: Rt,
|
|
594
|
+
onSaveDraft: mr,
|
|
595
|
+
onDiscard: hr,
|
|
596
|
+
onCancel: () => zt(!1),
|
|
597
|
+
isSaving: Bt,
|
|
598
|
+
labels: T.unsavedApplicationDialog,
|
|
591
599
|
testIds: {
|
|
592
|
-
root:
|
|
593
|
-
saveDraft:
|
|
594
|
-
discard:
|
|
595
|
-
close:
|
|
600
|
+
root: h.unsavedDialog,
|
|
601
|
+
saveDraft: h.unsavedDialogSaveDraft,
|
|
602
|
+
discard: h.unsavedDialogDiscard,
|
|
603
|
+
close: h.unsavedDialogClose
|
|
596
604
|
}
|
|
597
605
|
}),
|
|
598
|
-
/* @__PURE__ */
|
|
599
|
-
open:
|
|
600
|
-
onConfirm:
|
|
601
|
-
onCancel: () =>
|
|
602
|
-
isDeleting:
|
|
606
|
+
/* @__PURE__ */ x(_e, {
|
|
607
|
+
open: rn,
|
|
608
|
+
onConfirm: gr,
|
|
609
|
+
onCancel: () => an(!1),
|
|
610
|
+
isDeleting: fn.isPending,
|
|
603
611
|
labels: {
|
|
604
|
-
descriptionEmphasis:
|
|
605
|
-
...
|
|
612
|
+
descriptionEmphasis: T.saveAndClose,
|
|
613
|
+
...T.deleteApplicationDialog
|
|
606
614
|
},
|
|
607
615
|
testIds: {
|
|
608
|
-
root:
|
|
609
|
-
confirm:
|
|
610
|
-
cancel:
|
|
616
|
+
root: h.deleteDialog,
|
|
617
|
+
confirm: h.deleteDialogConfirm,
|
|
618
|
+
cancel: h.deleteDialogCancel
|
|
611
619
|
}
|
|
612
620
|
}),
|
|
613
|
-
/* @__PURE__ */
|
|
621
|
+
/* @__PURE__ */ x(te, {})
|
|
614
622
|
] });
|
|
615
623
|
}
|
|
616
|
-
function
|
|
617
|
-
return /* @__PURE__ */
|
|
624
|
+
function lt({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: u, disclosuresAcceptance: d, providerLabels: ee, ...f }) {
|
|
625
|
+
return /* @__PURE__ */ x(ie, {
|
|
618
626
|
baseUrl: e,
|
|
619
627
|
widgetToken: t,
|
|
620
628
|
organizationId: n,
|
|
@@ -626,50 +634,50 @@ function dt({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, ga
|
|
|
626
634
|
errorFallback: c,
|
|
627
635
|
onError: l,
|
|
628
636
|
analytics: u,
|
|
629
|
-
disclosuresAcceptance:
|
|
630
|
-
providerLabels:
|
|
631
|
-
widgetName:
|
|
632
|
-
children: /* @__PURE__ */
|
|
637
|
+
disclosuresAcceptance: d,
|
|
638
|
+
providerLabels: ee,
|
|
639
|
+
widgetName: Le,
|
|
640
|
+
children: /* @__PURE__ */ x(ut, { ...f })
|
|
633
641
|
});
|
|
634
642
|
}
|
|
635
|
-
function
|
|
636
|
-
let { initResponse: t } =
|
|
637
|
-
r !== i && (a(r), i !== null && r !== null &&
|
|
638
|
-
let [l, u] =
|
|
639
|
-
return n !== l && (u(n),
|
|
643
|
+
function ut(e) {
|
|
644
|
+
let { initResponse: t } = oe(), { client: n } = s(), r = t?.userId ?? null, [i, a] = b(r), [o, c] = b(0);
|
|
645
|
+
r !== i && (a(r), i !== null && r !== null && c((e) => e + 1));
|
|
646
|
+
let [l, u] = b(n);
|
|
647
|
+
return n !== l && (u(n), c((e) => e + 1)), /* @__PURE__ */ x(dt, { ...e }, o);
|
|
640
648
|
}
|
|
641
|
-
function
|
|
642
|
-
let { authEpoch: t } =
|
|
649
|
+
function dt(e) {
|
|
650
|
+
let { authEpoch: t } = s(), { ownApplicationIds: n } = qe(), [r, i] = b(null), [a, o] = b(0), [c, l] = b(!1), u = Ye(() => {
|
|
643
651
|
i(null), o((e) => e + 1);
|
|
644
|
-
}, []),
|
|
652
|
+
}, []), d = Ye(() => {
|
|
645
653
|
i(null), l(!0), o((e) => e + 1);
|
|
646
654
|
}, []);
|
|
647
|
-
return r !== null && t !== r.authEpoch && n !== null && !n.includes(r.applicationId) && (i(null), o((e) => e + 1)), /* @__PURE__ */
|
|
655
|
+
return r !== null && t !== r.authEpoch && n !== null && !n.includes(r.applicationId) && (i(null), o((e) => e + 1)), /* @__PURE__ */ x(Be, { children: /* @__PURE__ */ x(pt, {
|
|
648
656
|
...e,
|
|
649
|
-
defaultOpen: !
|
|
657
|
+
defaultOpen: !c && e.defaultOpen,
|
|
650
658
|
onEditableDraftChange: i,
|
|
651
|
-
onApplicationDeleted:
|
|
659
|
+
onApplicationDeleted: d,
|
|
652
660
|
onNoticeReplacedByForm: u
|
|
653
661
|
}, a) }, a);
|
|
654
662
|
}
|
|
655
|
-
var
|
|
656
|
-
function
|
|
657
|
-
let { authEpoch: t } =
|
|
658
|
-
if (
|
|
663
|
+
var ft = { canRender: !1 };
|
|
664
|
+
function pt(e) {
|
|
665
|
+
let { authEpoch: t } = s(), { applicationId: n, clientSecret: r, isResolved: i } = qe(), { application: a, isResolved: o, isUnavailable: c } = Je(n, r), [l, u] = b(null);
|
|
666
|
+
if (_(() => {
|
|
659
667
|
if (l?.canRender !== !0 && i && o) {
|
|
660
|
-
if (
|
|
661
|
-
u(
|
|
668
|
+
if (c) {
|
|
669
|
+
u(ft);
|
|
662
670
|
return;
|
|
663
671
|
}
|
|
664
|
-
if (a !== null && a.status !== void 0 && a.status !==
|
|
665
|
-
u(
|
|
672
|
+
if (a !== null && a.status !== void 0 && a.status !== et) {
|
|
673
|
+
u(ft);
|
|
666
674
|
return;
|
|
667
675
|
}
|
|
668
676
|
u({
|
|
669
677
|
canRender: !0,
|
|
670
678
|
applicationId: a === null ? null : n,
|
|
671
679
|
authEpoch: t,
|
|
672
|
-
prefill:
|
|
680
|
+
prefill: Ae(a)
|
|
673
681
|
});
|
|
674
682
|
}
|
|
675
683
|
}, [
|
|
@@ -677,25 +685,25 @@ function ht(e) {
|
|
|
677
685
|
l,
|
|
678
686
|
i,
|
|
679
687
|
o,
|
|
680
|
-
|
|
688
|
+
c,
|
|
681
689
|
a,
|
|
682
690
|
n
|
|
683
691
|
]), l === null || !l.canRender) return null;
|
|
684
|
-
let { applicationId:
|
|
685
|
-
return /* @__PURE__ */
|
|
692
|
+
let { applicationId: d, authEpoch: ee, prefill: f } = l;
|
|
693
|
+
return /* @__PURE__ */ x(ct, {
|
|
686
694
|
...e,
|
|
687
|
-
initialApplicationId:
|
|
688
|
-
initialBoundAuthEpoch:
|
|
695
|
+
initialApplicationId: d,
|
|
696
|
+
initialBoundAuthEpoch: ee,
|
|
689
697
|
initialBusinessDetails: {
|
|
690
|
-
...
|
|
698
|
+
...ze(e.initialBusinessDetails),
|
|
691
699
|
...f?.businessDetails
|
|
692
700
|
},
|
|
693
701
|
initialPersonalDetails: {
|
|
694
|
-
...
|
|
702
|
+
...ze(e.initialPersonalDetails),
|
|
695
703
|
...f?.personalDetails
|
|
696
704
|
},
|
|
697
|
-
initialAdditionalOwners: f?.additionalOwners ?? e.initialAdditionalOwners?.map(
|
|
705
|
+
initialAdditionalOwners: f?.additionalOwners ?? e.initialAdditionalOwners?.map(Re)
|
|
698
706
|
});
|
|
699
707
|
}
|
|
700
708
|
//#endregion
|
|
701
|
-
export {
|
|
709
|
+
export { lt as BankAccountOnboardingWidget, lt as default };
|