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