@tesouro/embedded-components-react 0.11.114 → 0.11.118

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 (52) hide show
  1. package/dist/index.css +81 -125
  2. package/dist/index.d.ts +11 -2
  3. package/dist/lib/AcceptDisclosuresWidget.d.ts +4 -0
  4. package/dist/lib/ReceivablesWidget.d.ts +7 -2
  5. package/dist/lib/WidgetSuite.d.ts +7 -2
  6. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +91 -88
  7. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +41 -59
  8. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/labels.js +2 -0
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/AdditionalOwnersStep.js +7 -5
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +163 -160
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BusinessDetailsStep.js +18 -18
  12. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/PersonalDetailsStep.js +25 -25
  13. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/additionalOwnerDraft.js +34 -31
  14. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/applicationStatusView.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/fieldInput/maxBirthDate.js +3 -2
  16. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/personalDetailsPanelMapping.js +21 -18
  17. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/testIds.js +3 -0
  18. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index11.js +382 -275
  19. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index12.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index13.js +2 -2
  21. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index15.js +37 -42
  22. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index19.js +56 -50
  23. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index2.js +32 -69
  24. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index21.js +3 -3
  25. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index22.js +14 -25
  26. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index24.js +36 -39
  27. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index25.js +120 -116
  28. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index26.js +14 -26
  29. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +2 -2
  30. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +41 -44
  31. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index29.js +96 -115
  32. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index3.js +14 -14
  33. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index31.js +35 -57
  34. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index33.js +37 -60
  35. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index35.js +28 -42
  36. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index4.js +266 -259
  37. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index5.js +51 -55
  38. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index6.js +42 -48
  39. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index7.js +69 -70
  40. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index9.js +2 -2
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/invoicesFilter.js +85 -50
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/invoicesFilterLabels.js +7 -2
  43. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  44. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +3 -2
  45. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/ConsentBlock/ConsentBlock.js +51 -0
  46. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/EmptyState/EmptyState.js +5 -3
  47. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js +1 -1
  48. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +84 -87
  49. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellScrollRegion.js +1 -1
  50. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellStepper.js +35 -21
  51. package/dist/packages/shared-ui-shadcn/dist/index.js +38 -101
  52. package/package.json +1 -1
@@ -54,9 +54,9 @@ import { useResumableBankAccountApplication as We } from "../../../../data-acces
54
54
  import { useStartedBankAccountApplication as Ge } from "../../../../data-access/dist/index12.js";
55
55
  import "../../../../data-access/dist/index.js";
56
56
  import { useCallback as v, useEffect as y, useMemo as b, useReducer as Ke, useRef as x, useState as S } from "react";
57
- import { Fragment as qe, jsx as C, jsxs as Je } from "react/jsx-runtime";
57
+ import { Fragment as qe, jsx as C, jsxs as w } from "react/jsx-runtime";
58
58
  // ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js
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) => be(e, void 0);
59
+ var Je = 2 ** 31 - 1, Ye = "DRAFT", Xe = [], Ze = "ttw:grid ttw:w-full ttw:place-items-center ttw:overflow-auto ttw:bg-background ttw:p-6", Qe = (e) => be(e, void 0);
60
60
  function $e(e) {
61
61
  return {
62
62
  ...e,
@@ -134,7 +134,7 @@ function ot({ callback: e }) {
134
134
  e?.();
135
135
  }, [e]), null;
136
136
  }
137
- function st({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboard: fe, onSuppressed: be, labels: _, initialBusinessDetails: Pe, initialPersonalDetails: Ie, initialAdditionalOwners: Le, initialApplicationId: We = null, initialWrittenSections: Ge, initialBoundAuthEpoch: Xe, onEditableDraftChange: st, onApplicationDeleted: ct, onNoticeReplacedByForm: lt, focusFormOnMount: E = !1, onFocusFormOnMountDone: ut, bankLogoSrc: dt, disclosureLinks: ft, showApplicationStatusRefresh: pt = !1, onResultPhaseChange: mt }) {
137
+ function st({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboard: fe, onSuppressed: be, labels: _, initialBusinessDetails: Pe, initialPersonalDetails: Ie, initialAdditionalOwners: Le, initialApplicationId: We = null, initialWrittenSections: Ge, initialBoundAuthEpoch: Ye, onEditableDraftChange: st, onApplicationDeleted: ct, onNoticeReplacedByForm: lt, focusFormOnMount: E = !1, onFocusFormOnMountDone: ut, bankLogoSrc: dt, disclosureLinks: ft, showApplicationStatusRefresh: pt = !1, onResultPhaseChange: mt }) {
138
138
  let D = f(), { authEpoch: ht } = i();
139
139
  y(() => {
140
140
  D(Ne.Mounted);
@@ -167,58 +167,61 @@ function st({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
167
167
  applicationStatus: _e(_?.applicationStatus)
168
168
  }, k = ne().initResponse, { termsHref: gt, privacyHref: _t, electronicCommunicationHref: vt, patriotActHref: yt } = ft ?? {}, bt = v(() => {
169
169
  p();
170
- }, [p]), xt = te(), [A, St] = S(T.personal), [j, Ct] = S(() => ({
170
+ }, [p]), xt = te(), [A, j] = S(T.personal), [M, St] = S(() => ({
171
171
  ...rt,
172
172
  ...Pe
173
- })), [M, wt] = S(() => ({
173
+ })), [N, Ct] = S(() => ({
174
174
  ...it,
175
175
  ...Ie
176
- })), [N, P] = S(() => Le ?? []), [F, Tt] = S(() => ({
177
- business: j,
178
- personal: M,
179
- owners: N
180
- })), [Et, Dt] = S(null);
176
+ })), [P, F] = S(() => Le ?? []), [I, wt] = S(() => ({
177
+ business: M,
178
+ personal: N,
179
+ owners: P
180
+ })), [Tt, Et] = S(null);
181
181
  y(() => {
182
- if (!Et) return;
182
+ if (!Tt) return;
183
183
  let e = {
184
- business: j,
185
- personal: M,
186
- owners: N
184
+ business: M,
185
+ personal: N,
186
+ owners: P
187
187
  };
188
- Tt((t) => Et.next(e, t)), Dt(null);
188
+ wt((t) => Tt.next(e, t)), Et(null);
189
189
  }, [
190
- Et,
191
- j,
190
+ Tt,
192
191
  M,
193
- N
192
+ N,
193
+ P
194
194
  ]);
195
- let Ot = (e, { ownersCleared: t = !1 } = {}) => Dt({ next: (n, r) => ({
195
+ let Dt = (e, { ownersCleared: t = !1 } = {}) => Et({ next: (n, r) => ({
196
196
  business: e.includes("business") ? n.business : r.business,
197
197
  personal: e.includes("personal") ? n.personal : r.personal,
198
- owners: t ? Ze : e.includes("owners") ? n.owners : r.owners
199
- }) }), [I, kt] = S(null), [At, jt] = S(0), [Mt, Nt] = S(null), [Pt, Ft] = S(!1), [L, It] = S(null), [R, Lt] = S(null), [Rt, zt] = S(null), [z, Bt] = S(We), [Vt, Ht] = S(() => Ge ?? {
198
+ owners: t ? Xe : e.includes("owners") ? n.owners : r.owners
199
+ }) }), [L, Ot] = S(null), [kt, At] = S(0), [jt, Mt] = S(null), [Nt, Pt] = S(!1), [R, Ft] = S(null), [It, Lt] = S(null), [Rt, zt] = S(null), [z, Bt] = S(We), [Vt, Ht] = S(() => Ge ?? {
200
200
  business: !1,
201
201
  owners: !1
202
202
  }), [Ut, Wt] = S({}), Gt = (e) => Wt((t) => ({
203
203
  ...t,
204
- ...e.taxId && w(e.taxId) && e.taxIdStructure ? {
204
+ ...e.taxId && Qe(e.taxId) && e.taxIdStructure ? {
205
205
  taxId: e.taxId,
206
206
  taxIdStructure: e.taxIdStructure
207
207
  } : {},
208
- ...e.ssn && w(e.ssn) ? { ssn: e.ssn } : {}
208
+ ...e.ssn && Qe(e.ssn) ? { ssn: e.ssn } : {}
209
209
  })), Kt = (e) => {
210
- let { taxId: t, taxIdStructure: n } = Ut, r = t !== void 0 && n !== void 0 && e.companyStructure !== j.companyStructure && e.companyStructure !== "" && e.companyStructure === "SOLE_PROPRIETORSHIP" != (n === "SOLE_PROPRIETORSHIP");
211
- Ct(r ? {
210
+ let { taxId: t, taxIdStructure: n } = Ut, r = t !== void 0 && n !== void 0 && e.companyStructure !== M.companyStructure && e.companyStructure !== "" && e.companyStructure === "SOLE_PROPRIETORSHIP" != (n === "SOLE_PROPRIETORSHIP");
211
+ St(r ? {
212
212
  ...e,
213
213
  taxId: e.taxId === t ? "" : e.taxId,
214
214
  taxIdOnFileLast4: ye(t),
215
215
  taxIdOnFileStructure: n
216
216
  } : e);
217
- }, [qt, Jt] = S(Xe ?? ht), [Yt, B] = S(null), [Xt, Zt] = S(null), [Qt, $t] = S(0), en = x(null);
217
+ }, [qt, Jt] = S(Ye ?? ht), [Yt, B] = S(null), [Xt, Zt] = S(null), [Qt, $t] = S(0), en = x(null);
218
218
  y(() => {
219
219
  if (Qt === 0) return;
220
- let e = en.current;
221
- (e?.querySelector("[aria-invalid=\"true\"]") ?? e?.querySelector("[data-needs-attention]"))?.focus();
220
+ let e = en.current, t = (t) => {
221
+ let n = Array.from(e?.querySelectorAll(t) ?? []);
222
+ return n.find((e) => e.getClientRects().length > 0) ?? (t === "[aria-invalid=\"true\"]" ? n[0] : n.at(-1));
223
+ };
224
+ (t("[aria-invalid=\"true\"]") ?? t("[data-needs-attention]"))?.focus();
222
225
  }, [Qt]);
223
226
  let [tn, nn] = S(!1), [rn, an] = S(!1), [on, sn] = S(!1), [cn, ln] = S(null), un = ze(), V = Be(), dn = Ve(), fn = He(), pn = Ue(), { setClientSecret: mn } = Re(), { data: hn, refetch: gn } = s(), { mutateAsync: _n } = o(), vn = l(), H = u(), yn = re(), [bn, xn] = Ke((e) => e + 1, 0), Sn = b(() => se(H.applications), [H.applications]), Cn = x(null);
224
227
  H.isResolved && (Cn.current = { application: Sn });
@@ -227,7 +230,7 @@ function st({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
227
230
  if (wn === null) return;
228
231
  let e = wn - Date.now();
229
232
  if (e < 0) return;
230
- let t = setTimeout(xn, Math.min(e + 1, Ye));
233
+ let t = setTimeout(xn, Math.min(e + 1, Je));
231
234
  return () => clearTimeout(t);
232
235
  }, [wn, bn]);
233
236
  let En = x(null);
@@ -300,38 +303,40 @@ function st({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
300
303
  children: O.applicationStatus.checkAgain
301
304
  }) : void 0
302
305
  });
303
- return /* @__PURE__ */ Je("div", {
304
- className: Qe,
306
+ return /* @__PURE__ */ w("div", {
307
+ className: Ze,
305
308
  children: [n, E ? /* @__PURE__ */ C(ot, { callback: ut }) : null]
306
309
  });
307
310
  }
308
311
  }
309
- let X = j.companyStructure === "SOLE_PROPRIETORSHIP", er = j.companyStructure !== "" && !X, tr = er ? Rt : Ze, Z = R && {
310
- ...R,
311
- ownsOver25Percent: M.ownsOver25Percent,
312
- ownershipPercentage: M.ownershipPercentage
312
+ let X = M.companyStructure === "SOLE_PROPRIETORSHIP", er = M.companyStructure !== "" && !X, tr = er ? Rt : Xe, Z = It && {
313
+ ...It,
314
+ ownsOver25Percent: N.ownsOver25Percent,
315
+ ownershipPercentage: N.ownershipPercentage
313
316
  }, nr = [
314
317
  O.stepIndicator.personal,
315
318
  O.stepIndicator.business,
316
319
  O.stepIndicator.review,
317
320
  O.stepIndicator.terms
318
- ], rr = R !== null && L !== null && tr !== null, ir = A === T.personal ? R !== null : A === T.business ? L !== null && tr !== null : A === T.review ? rr : rr && xe(j), Q = un.isPending || V.isPending || dn.isPending || fn.isPending || on, ar = () => {
319
- Ct((e) => e.isAuthorized === null && !e.isCheckboxChecked ? e : {
321
+ ], rr = It !== null && R !== null && tr !== null, ir = A === T.personal ? It !== null : A === T.business ? R !== null && tr !== null : A === T.review ? rr : rr && xe(M), Q = un.isPending || V.isPending || dn.isPending || fn.isPending || on, ar = () => {
322
+ St((e) => e.isAuthorized === null && !e.isCheckboxChecked ? e : {
320
323
  ...e,
321
324
  isAuthorized: null,
322
325
  isCheckboxChecked: !1
323
326
  });
324
327
  }, or = () => {
325
- B(null), ar(), St(T.personal);
328
+ B(null), ar(), j(T.personal);
326
329
  }, sr = () => {
327
- B(null), ar(), St(T.business);
330
+ B(null), ar(), j(T.business);
328
331
  }, cr = () => {
329
- B(null), A === T.review && ar(), I && P(tt(N, I)), St((e) => e === T.personal ? e : e - 1);
332
+ B(null), A === T.review && ar(), L && F(tt(P, L)), j((e) => e === T.personal ? e : e - 1);
333
+ }, lr = (e) => {
334
+ e < T.personal || e >= A || (B(null), e <= T.business && ar(), L && F(tt(P, L)), j(e));
330
335
  }, $ = {
331
- business: g(j) !== g(F.business),
332
- personal: g(M) !== g(F.personal),
333
- owners: g(nt(j.companyStructure === "SOLE_PROPRIETORSHIP" ? Ze : tt(N, I))) !== g(nt(F.owners))
334
- }, lr = $.business || $.personal || $.owners, ur = async (e) => {
336
+ business: g(M) !== g(I.business),
337
+ personal: g(N) !== g(I.personal),
338
+ owners: g(nt(M.companyStructure === "SOLE_PROPRIETORSHIP" ? Xe : tt(P, L))) !== g(nt(I.owners))
339
+ }, ur = $.business || $.personal || $.owners, dr = async (e) => {
335
340
  sn(!0);
336
341
  let t = new AbortController();
337
342
  En.current = t;
@@ -356,47 +361,47 @@ function st({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
356
361
  } finally {
357
362
  En.current = null, sn(!1);
358
363
  }
359
- }, dr = ({ evenWithoutMarker: e = !1 } = {}) => {
360
- Ct((t) => (t.taxIdOnFileLast4 || e) && w(t.taxId) ? $e(t) : t);
361
364
  }, fr = ({ evenWithoutMarker: e = !1 } = {}) => {
362
- wt((t) => (t.ssnOnFileLast4 || e) && w(t.ssn) ? et(t) : t);
365
+ St((t) => (t.taxIdOnFileLast4 || e) && Qe(t.taxId) ? $e(t) : t);
363
366
  }, pr = ({ evenWithoutMarker: e = !1 } = {}) => {
364
- P((t) => t.map((t) => (t.ssnOnFileLast4 || e && t.id) && w(t.ssn) ? et(t) : t));
365
- }, mr = () => {
366
- P((e) => e.map(Fe));
367
- }, hr = async (e) => {
368
- let t = $n.current, n = await un.mutateAsync({ body: Me(e, M) });
367
+ Ct((t) => (t.ssnOnFileLast4 || e) && Qe(t.ssn) ? et(t) : t);
368
+ }, mr = ({ evenWithoutMarker: e = !1 } = {}) => {
369
+ F((t) => t.map((t) => (t.ssnOnFileLast4 || e && t.id) && Qe(t.ssn) ? et(t) : t));
370
+ }, hr = () => {
371
+ F((e) => e.map(Fe));
372
+ }, gr = async (e) => {
373
+ let t = $n.current, n = await un.mutateAsync({ body: Me(e, N) });
369
374
  return Bt(n.id), Jt(t), n.clientSecret && mn(n.id, n.clientSecret), n.id;
370
- }, gr = async () => {
375
+ }, _r = async () => {
371
376
  if (A === T.personal) {
372
377
  if (!Z) return null;
373
- let e = F.business.companyStructure === "SOLE_PROPRIETORSHIP", t = z;
378
+ let e = I.business.companyStructure === "SOLE_PROPRIETORSHIP", t = z;
374
379
  return t ? await V.mutateAsync({
375
380
  path: { id: t },
376
381
  body: Oe({
377
382
  applicant: Z,
378
383
  isSoleProprietor: e
379
384
  })
380
- }) : t = await hr(De({
385
+ }) : t = await gr(De({
381
386
  applicant: Z,
382
387
  isSoleProprietor: e
383
- })), Gt({ ssn: Z.ssn }), fr(), Ot(["personal"]), t;
388
+ })), Gt({ ssn: Z.ssn }), pr(), Dt(["personal"]), t;
384
389
  }
385
390
  if (A === T.business) {
386
- if (!Z || !L || !tr) return null;
391
+ if (!Z || !R || !tr) return null;
387
392
  let e = {
388
- businessDetails: L,
393
+ businessDetails: R,
389
394
  applicant: Z,
390
395
  businessOwners: tr
391
396
  }, t = z;
392
397
  return t ? await V.mutateAsync({
393
398
  path: { id: t },
394
399
  body: Oe(e)
395
- }) : t = await hr(Oe(e)), Gt({
396
- taxId: L.taxId,
397
- taxIdStructure: L.companyStructure,
400
+ }) : t = await gr(Oe(e)), Gt({
401
+ taxId: R.taxId,
402
+ taxIdStructure: R.companyStructure,
398
403
  ssn: Z.ssn
399
- }), dr(), fr(), X ? mr() : pr(), Ot([
404
+ }), fr(), pr(), X ? hr() : mr(), Dt([
400
405
  "business",
401
406
  "personal",
402
407
  "owners"
@@ -405,60 +410,60 @@ function st({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
405
410
  owners: !0
406
411
  }), t;
407
412
  }
408
- return A === T.review ? rr ? z : null : !z || !xe(j) ? null : (await V.mutateAsync({
413
+ return A === T.review ? rr ? z : null : !z || !xe(M) ? null : (await V.mutateAsync({
409
414
  path: { id: z },
410
415
  body: Oe({ consent: {
411
416
  isLegallyAuthorized: !0,
412
417
  hasAcceptedDisclosures: !0
413
418
  } })
414
- }), Ot(["business"]), z);
415
- }, _r = async () => {
419
+ }), Dt(["business"]), z);
420
+ }, vr = async () => {
416
421
  if (B(null), !ir) {
417
422
  Zt(A), $t((e) => e + 1);
418
423
  return;
419
424
  }
420
425
  let e;
421
426
  try {
422
- e = await gr();
427
+ e = await _r();
423
428
  } catch {
424
429
  B(O.genericRetryError);
425
430
  return;
426
431
  }
427
432
  if (e !== null) {
428
433
  if (Zt(null), A === T.terms) try {
429
- await ur(e);
434
+ await dr(e);
430
435
  } catch {
431
436
  B(O.submitFailedError);
432
437
  }
433
- else St(A + 1);
438
+ else j(A + 1);
434
439
  }
435
- }, vr = async () => {
440
+ }, yr = async () => {
436
441
  B(null), nn(!0);
437
442
  try {
438
- if (await gr() === null) return;
439
- fr({ evenWithoutMarker: !0 }), A >= T.business && (dr({ evenWithoutMarker: !0 }), pr({ evenWithoutMarker: !0 })), n.success(O.applicationSavedToast);
443
+ if (await _r() === null) return;
444
+ pr({ evenWithoutMarker: !0 }), A >= T.business && (fr({ evenWithoutMarker: !0 }), mr({ evenWithoutMarker: !0 })), n.success(O.applicationSavedToast);
440
445
  } catch {
441
446
  n.error(O.genericRetryError);
442
447
  } finally {
443
448
  nn(!1);
444
449
  }
445
- }, yr = async () => {
446
- let e = tt(N, I), t = {
450
+ }, br = async () => {
451
+ let e = tt(P, L), t = {
447
452
  ...$,
448
453
  business: $.business || z !== null && !Vt.business,
449
454
  owners: $.owners || z !== null && !Vt.owners
450
455
  }, r = je({
451
- businessDetails: j,
452
- applicant: M,
456
+ businessDetails: M,
457
+ applicant: N,
453
458
  businessOwners: e,
454
- savedBusinessDetails: F.business,
455
- savedOwners: F.owners,
459
+ savedBusinessDetails: I.business,
460
+ savedOwners: I.owners,
456
461
  dirty: t
457
462
  });
458
- Ft(!0);
463
+ Pt(!0);
459
464
  try {
460
465
  if (!r) {
461
- if (!lr) {
466
+ if (!ur) {
462
467
  n.success(O.applicationSavedToast);
463
468
  return;
464
469
  }
@@ -468,29 +473,29 @@ function st({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
468
473
  z ? await V.mutateAsync({
469
474
  path: { id: z },
470
475
  body: r
471
- }) : await hr(Ae(r)), I && P(e), n.success(O.applicationSavedToast);
476
+ }) : await gr(Ae(r)), L && F(e), n.success(O.applicationSavedToast);
472
477
  let i = r;
473
478
  Gt({
474
479
  taxId: i.businessDetails?.taxId?.value,
475
- taxIdStructure: j.companyStructure,
480
+ taxIdStructure: M.companyStructure,
476
481
  ssn: i.applicant?.personalIdentificationNumber?.value
477
- }), i.businessDetails?.taxId !== void 0 && dr({ evenWithoutMarker: !0 }), i.applicant?.personalIdentificationNumber !== void 0 && fr({ evenWithoutMarker: !0 }), Array.isArray(i.businessOwners) && pr({ evenWithoutMarker: !0 }), i.businessOwners === null && e.length > 0 && mr(), Ht((e) => ({
482
+ }), i.businessDetails?.taxId !== void 0 && fr({ evenWithoutMarker: !0 }), i.applicant?.personalIdentificationNumber !== void 0 && pr({ evenWithoutMarker: !0 }), Array.isArray(i.businessOwners) && mr({ evenWithoutMarker: !0 }), i.businessOwners === null && e.length > 0 && hr(), Ht((e) => ({
478
483
  business: e.business || i.businessDetails !== void 0,
479
484
  owners: e.owners || i.businessOwners !== void 0
480
485
  }));
481
486
  let a = Array.isArray(i.businessOwners) ? "list" : i.businessOwners === null ? "cleared" : "none";
482
- Dt({ next: (e, n) => ke({
487
+ Et({ next: (e, n) => ke({
483
488
  current: e,
484
489
  saved: n,
485
490
  dirty: t,
486
491
  ownersWrite: a
487
- }) }), kt(null), jt((e) => e + 1);
492
+ }) }), Ot(null), At((e) => e + 1);
488
493
  } catch {
489
494
  n.error(O.genericRetryError);
490
495
  } finally {
491
- Ft(!1);
496
+ Pt(!1);
492
497
  }
493
- }, br = async () => {
498
+ }, xr = async () => {
494
499
  if (z !== null) try {
495
500
  await fn.mutateAsync({ path: { id: z } });
496
501
  } catch {
@@ -498,14 +503,16 @@ function st({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
498
503
  return;
499
504
  }
500
505
  an(!1), ct?.();
501
- }, xr = at(A, O), Sr = k.bankName?.trim() || O.fallbackBankName, Cr = ce(O.shellFdicDisclaimer, Sr);
506
+ }, Sr = at(A, O), Cr = k.bankName?.trim() || O.fallbackBankName, wr = ce(O.shellFdicDisclaimer, Cr);
502
507
  if (G) {
503
- let e = L?.companyLegalName ?? "", t = k.bankName?.trim() || O.fallbackBankName, n = cn ?? "pending", r = n === "success", i = {
508
+ let e = R?.companyLegalName ?? "", t = k.bankName?.trim() || O.fallbackBankName, n = cn ?? "pending", r = n === "success", i = {
504
509
  ...m.result,
505
510
  ...O.result
506
511
  }, a = /* @__PURE__ */ C(ue, {
507
512
  testIds: {
508
513
  processing: h.resultProcessing,
514
+ success: h.resultSuccess,
515
+ pending: h.resultPending,
509
516
  dashboardButton: h.resultDashboardButton
510
517
  },
511
518
  status: n,
@@ -514,7 +521,7 @@ function st({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
514
521
  headingLine1: r ? i.successHeadingLine1 : i.pendingHeadingLine1,
515
522
  headingLine2: `${e}!`,
516
523
  body: r ? i.successBody : i.pendingBody,
517
- followUpEmail: R?.workEmail ?? "",
524
+ followUpEmail: It?.workEmail ?? "",
518
525
  emailBoxLead: i.pendingEmailBoxLead,
519
526
  navigateToDashboardLabel: i.navigateToDashboard,
520
527
  bankLogoSrc: dt,
@@ -527,26 +534,27 @@ function st({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
527
534
  children: a
528
535
  });
529
536
  }
530
- let wr = A === T.personal ? O.nextToStep.business : A === T.business ? O.nextToStep.review : A === T.review ? O.nextToStep.terms : O.submit, Tr = A === T.business ? O.backToStepAriaLabel.personal : A === T.review ? O.backToStepAriaLabel.business : A === T.terms ? O.backToStepAriaLabel.review : void 0, Er = Q, Dr = Xt === A, Or = ir ? vr : yr, kr = Q || Pt || !ir && !lr && z === null, Ar = `${M.firstName} ${M.lastName}`.trim(), jr = X ? 100 : M.ownsOver25Percent === !0 ? M.ownershipPercentage ?? 0 : 0, Mr = j.companyDbaName.trim() || j.companyLegalName.trim(), Nr = X ? Ze : N, Pr = Xt === T.business && A === T.business && Nr.some((e) => !e.reviewed) ? O.ownersNeedReviewError : null;
531
- return /* @__PURE__ */ Je(qe, { children: [
537
+ let Tr = A === T.personal ? O.nextToStep.business : A === T.business ? O.nextToStep.review : A === T.review ? O.nextToStep.terms : O.submit, Er = A === T.business ? O.backToStepAriaLabel.personal : A === T.review ? O.backToStepAriaLabel.business : A === T.terms ? O.backToStepAriaLabel.review : void 0, Dr = Q, Or = Xt === A, kr = ir ? yr : br, Ar = Q || Nt || !ir && !ur && z === null, jr = `${N.firstName} ${N.lastName}`.trim(), Mr = X ? 100 : N.ownsOver25Percent === !0 ? N.ownershipPercentage ?? 0 : 0, Nr = M.companyDbaName.trim() || M.companyLegalName.trim(), Pr = X ? Xe : P, Fr = Xt === T.business && A === T.business && Pr.some((e) => !e.reviewed) ? O.ownersNeedReviewError : null;
538
+ return /* @__PURE__ */ w(qe, { children: [
532
539
  /* @__PURE__ */ C(ee, {
533
- title: xr.title,
534
- subtitle: xr.subtitle,
540
+ title: Sr.title,
541
+ subtitle: Sr.subtitle,
535
542
  focusTitleOnMount: E,
536
543
  stepLabels: nr,
537
544
  activeStep: A,
538
- disclaimerText: Cr,
545
+ onStepClick: lr,
546
+ disclaimerText: wr,
539
547
  onBack: cr,
540
548
  showBackButton: A !== T.personal,
541
- backAriaLabel: Tr,
542
- onNext: _r,
543
- onSaveAndClose: Or,
549
+ backAriaLabel: Er,
550
+ onNext: vr,
551
+ onSaveAndClose: kr,
544
552
  onDelete: () => an(!0),
545
- isNextDisabled: Er,
553
+ isNextDisabled: Dr,
546
554
  isNextLoading: Q && !tn,
547
- isSaveAndCloseDisabled: kr,
548
- isSaveAndCloseLoading: tn || Pt,
549
- nextLabel: wr,
555
+ isSaveAndCloseDisabled: Ar,
556
+ isSaveAndCloseLoading: tn || Nt,
557
+ nextLabel: Tr,
550
558
  nextIcon: null,
551
559
  nextTone: A === T.terms ? "success" : "primary",
552
560
  isTitleVisuallyHidden: A === T.terms,
@@ -559,6 +567,7 @@ function st({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
559
567
  testIds: {
560
568
  root: h.shell,
561
569
  back: h.shellBack,
570
+ stepButton: h.shellStepButton,
562
571
  saveAndClose: h.shellSaveAndClose,
563
572
  delete: h.shellDelete,
564
573
  next: h.shellNext,
@@ -567,86 +576,80 @@ function st({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
567
576
  fade: h.shellScrollFade
568
577
  }
569
578
  },
570
- children: /* @__PURE__ */ Je("div", {
579
+ children: /* @__PURE__ */ w("div", {
571
580
  ref: en,
572
581
  className: "ttw:contents",
573
582
  children: [
574
- A === T.personal ? /* @__PURE__ */ C("div", {
575
- className: "ttw:max-w-2xl",
576
- children: /* @__PURE__ */ C(Ce, {
577
- value: M,
578
- onValueChange: wt,
579
- onSnapshotChange: Lt,
580
- stateOptions: kn,
581
- isSubmitting: Q,
582
- showAllErrors: Dr,
583
- labels: O.personalDetails
584
- }, "personal")
585
- }) : null,
586
- A === T.business ? /* @__PURE__ */ Je("div", {
587
- className: "ttw:flex ttw:max-w-2xl ttw:flex-col ttw:gap-10",
583
+ A === T.personal ? /* @__PURE__ */ C("div", { children: /* @__PURE__ */ C(Ce, {
584
+ value: N,
585
+ onValueChange: Ct,
586
+ onSnapshotChange: Lt,
587
+ stateOptions: kn,
588
+ isSubmitting: Q,
589
+ showAllErrors: Or,
590
+ labels: O.personalDetails
591
+ }, "personal") }) : null,
592
+ A === T.business ? /* @__PURE__ */ w("div", {
593
+ className: "ttw:flex ttw:flex-col ttw:gap-10",
588
594
  children: [/* @__PURE__ */ C(Se, {
589
- value: j,
595
+ value: M,
590
596
  onValueChange: Kt,
591
- onSnapshotChange: It,
597
+ onSnapshotChange: Ft,
592
598
  naicsOptions: Dn,
593
599
  stateOptions: On,
594
600
  isSubmitting: Q,
595
- showAllErrors: Dr,
601
+ showAllErrors: Or,
596
602
  labels: O.businessDetails
597
- }, "business"), er ? /* @__PURE__ */ Je(qe, { children: [/* @__PURE__ */ C(t, {}), /* @__PURE__ */ C(Ee, {
598
- owners: Nr,
599
- onOwnersChange: P,
600
- primaryOwnerName: Ar,
603
+ }, "business"), er ? /* @__PURE__ */ w(qe, { children: [/* @__PURE__ */ C(t, {}), /* @__PURE__ */ C(Ee, {
604
+ owners: Pr,
605
+ onOwnersChange: F,
606
+ primaryOwnerName: jr,
601
607
  applicantOwnership: {
602
- ownsOver25Percent: M.ownsOver25Percent,
603
- ownershipPercentage: M.ownershipPercentage
608
+ ownsOver25Percent: N.ownsOver25Percent,
609
+ ownershipPercentage: N.ownershipPercentage
604
610
  },
605
- onApplicantOwnershipChange: (e) => wt((t) => ({
611
+ onApplicantOwnershipChange: (e) => Ct((t) => ({
606
612
  ...t,
607
613
  ...e
608
614
  })),
609
- applicantOwnershipBaseline: Mt,
610
- onApplicantOwnershipBaselineChange: Nt,
611
- businessName: Mr,
612
- applicantPersonalDetails: M,
615
+ applicantOwnershipBaseline: jt,
616
+ onApplicantOwnershipBaselineChange: Mt,
617
+ businessName: Nr,
618
+ applicantPersonalDetails: N,
613
619
  onEditPersonalDetails: or,
614
620
  stateOptions: An,
615
621
  onSnapshotChange: zt,
616
- onPendingOwnerChange: kt,
622
+ onPendingOwnerChange: Ot,
617
623
  isSubmitting: Q,
618
- showAllErrors: Dr,
624
+ showAllErrors: Or,
619
625
  revealErrorsAttempt: Qt,
620
- reviewError: Pr,
626
+ reviewError: Fr,
621
627
  labels: O.additionalOwners
622
- }, At)] }) : null]
623
- }) : null,
624
- A === T.review ? /* @__PURE__ */ C("div", {
625
- className: "ttw:max-w-2xl",
626
- children: /* @__PURE__ */ C(we, {
627
- personalDetails: M,
628
- businessDetails: j,
629
- additionalOwners: Nr,
630
- primaryOwnerName: Ar,
631
- primaryOwnerPercentage: jr,
632
- isSoleProprietor: X,
633
- personalStateOptions: kn,
634
- businessStateOptions: On,
635
- naicsOptions: Dn,
636
- onEditPersonal: or,
637
- onEditBusiness: sr,
638
- ownersEditAriaLabel: O.reviewOwnersEditAriaLabel,
639
- isSubmitting: Q,
640
- labels: O
641
- })
628
+ }, kt)] }) : null]
642
629
  }) : null,
630
+ A === T.review ? /* @__PURE__ */ C("div", { children: /* @__PURE__ */ C(we, {
631
+ personalDetails: N,
632
+ businessDetails: M,
633
+ additionalOwners: Pr,
634
+ primaryOwnerName: jr,
635
+ primaryOwnerPercentage: Mr,
636
+ isSoleProprietor: X,
637
+ personalStateOptions: kn,
638
+ businessStateOptions: On,
639
+ naicsOptions: Dn,
640
+ onEditPersonal: or,
641
+ onEditBusiness: sr,
642
+ ownersEditAriaLabel: O.reviewOwnersEditAriaLabel,
643
+ isSubmitting: Q,
644
+ labels: O
645
+ }) }) : null,
643
646
  A === T.terms ? /* @__PURE__ */ C(Te, {
644
- value: j,
645
- onValueChange: Ct,
647
+ value: M,
648
+ onValueChange: St,
646
649
  isSubmitting: Q,
647
- showAllErrors: Dr,
650
+ showAllErrors: Or,
648
651
  labels: O.businessDetails,
649
- bankName: Sr,
652
+ bankName: Cr,
650
653
  termsHref: gt,
651
654
  privacyHref: _t,
652
655
  electronicCommunicationHref: vt,
@@ -658,7 +661,7 @@ function st({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
658
661
  E ? /* @__PURE__ */ C(ot, { callback: ut }) : null,
659
662
  /* @__PURE__ */ C(de, {
660
663
  open: rn,
661
- onConfirm: br,
664
+ onConfirm: xr,
662
665
  onCancel: () => an(!1),
663
666
  isDeleting: fn.isPending,
664
667
  labels: {
@@ -716,7 +719,7 @@ function E(e) {
716
719
  focusFormOnMount: ee === o,
717
720
  onFocusFormOnMountDone: p
718
721
  }, o) }, o) : /* @__PURE__ */ C("div", {
719
- className: Qe,
722
+ className: Ze,
720
723
  children: /* @__PURE__ */ C(fe, {
721
724
  className: "ttw:max-w-2xl",
722
725
  onStartNewApplication: re,
@@ -732,7 +735,7 @@ var ut = { canRender: !1 };
732
735
  function dt(e) {
733
736
  let { authEpoch: t } = i(), { applicationId: n, clientSecret: r, isResolved: a } = We(), { application: o, isResolved: s, isUnavailable: c } = Ge(n, r), [l, u] = S(null);
734
737
  if (y(() => {
735
- l?.canRender !== !0 && a && s && (c || o !== null && o.status !== void 0 && o.status !== Xe ? u(ut) : u({
738
+ l?.canRender !== !0 && a && s && (c || o !== null && o.status !== void 0 && o.status !== Ye ? u(ut) : u({
736
739
  canRender: !0,
737
740
  applicationId: o === null ? null : n,
738
741
  authEpoch: t,
@@ -25,15 +25,15 @@ var v = [
25
25
  "naicsCode"
26
26
  ], y = new Set(v);
27
27
  function b({ value: b, onValueChange: x, onSnapshotChange: S, naicsOptions: C, stateOptions: w, isSubmitting: T, showAllErrors: E = !1, labels: D }) {
28
- let O = m(() => s(D), [D]), k = m(() => t(O), [O]).safeParse(b, u(O.invalidFieldError)), A = k.success ? k.data : null, j = k.success, M = c(v, b, k.error?.issues, O.requiredFieldError), { touched: N, touch: P } = d(() => l(v, b, M)), F = JSON.stringify(A), I = h(S);
29
- I.current = S, p(() => {
30
- I.current(A);
31
- }, [F]);
32
- let [L, R] = g(() => !j);
28
+ let O = m(() => s(D), [D]), k = m(() => t(O), [O]).safeParse(b, u(O.invalidFieldError)), A = k.success ? k.data : null, j = k.success, M = c(v, b, k.error?.issues, O.requiredFieldError), { touched: N } = d(() => l(v, b, M)), P = JSON.stringify(A), F = h(S);
29
+ F.current = S, p(() => {
30
+ F.current(A);
31
+ }, [P]);
32
+ let [I, L] = g(() => !j);
33
33
  p(() => {
34
- j || R(!0);
34
+ j || L(!0);
35
35
  }, [j]);
36
- let z = m(() => ({
36
+ let R = m(() => ({
37
37
  stateOptions: w,
38
38
  naicsOptions: C,
39
39
  labels: D
@@ -41,21 +41,21 @@ function b({ value: b, onValueChange: x, onSnapshotChange: S, naicsOptions: C, s
41
41
  w,
42
42
  C,
43
43
  D
44
- ]), B = m(() => i(D), [D]), V = m(() => a(b, z), [b, z]), H = m(() => r(b, x, z), [
44
+ ]), z = m(() => i(D), [D]), B = m(() => a(b, R), [b, R]), V = m(() => r(b, x, R), [
45
45
  b,
46
46
  x,
47
- z
48
- ]), U = f(H, M, E ? y : N, P), W = m(() => o(b, D), [b, D]);
47
+ R
48
+ ]), H = f(V, M, E ? y : N, () => void 0), U = m(() => o(b, D), [b, D]);
49
49
  return /* @__PURE__ */ _(e, {
50
- isEditing: L,
51
- onEditClick: () => R(!0),
52
- summaryRows: V,
53
- editFields: U,
54
- labels: B,
50
+ isEditing: I,
51
+ onEditClick: () => L(!0),
52
+ summaryRows: B,
53
+ editFields: H,
54
+ labels: z,
55
55
  isDisabled: T,
56
- taxIdRequired: W.required,
57
- taxIdPlaceholder: W.placeholder,
58
- taxIdHelpText: W.helpText,
56
+ taxIdRequired: U.required,
57
+ taxIdPlaceholder: U.placeholder,
58
+ taxIdHelpText: U.helpText,
59
59
  testIds: {
60
60
  root: n.businessDetailsPanel,
61
61
  editButton: n.businessDetailsEditButton,