@tesouro/embedded-components-react 0.7.53 → 0.7.57

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