@tesouro/embedded-components-react 0.5.36 → 0.5.38

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 (50) hide show
  1. package/README.md +14 -14
  2. package/dist/index.d.ts +41 -3
  3. package/dist/index.js +5 -5
  4. package/dist/lib/BankAccountOnboardingWidget.d.ts +41 -3
  5. package/dist/lib/BankAccountOnboardingWidget.js +5 -5
  6. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index10.js +184 -109
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index11.js +29 -174
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +117 -67
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index13.js +137 -44
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index14.js +77 -107
  12. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index15.js +84 -87
  13. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js +116 -88
  14. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +99 -5
  15. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js +100 -28
  16. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index19.js +5 -5
  17. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index20.js +26 -383
  18. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index21.js +19 -0
  19. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +407 -0
  20. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index6.js +2 -10
  21. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index7.js +22 -6
  22. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index8.js +11 -182
  23. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index9.js +8 -29
  24. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +12 -12
  25. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index10.js +27 -26
  26. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index11.js +34 -91
  27. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index12.js +96 -12
  28. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index13.js +14 -2
  29. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index14.js +0 -2
  30. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index15.js +4 -175
  31. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index16.js +180 -28
  32. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index17.js +31 -21
  33. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index18.js +21 -65
  34. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index19.js +60 -215
  35. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index20.js +230 -29
  36. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index21.js +32 -26
  37. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index22.js +26 -71
  38. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index23.js +71 -82
  39. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index24.js +87 -0
  40. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index3.js +38 -28
  41. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index4.js +2 -46
  42. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index5.js +48 -139
  43. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index6.js +138 -48
  44. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index7.js +47 -26
  45. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index8.js +32 -33
  46. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index9.js +31 -38
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +20 -8
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +1 -0
  49. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  50. package/package.json +1 -1
package/README.md CHANGED
@@ -437,20 +437,20 @@ A self-contained widget that walks an applicant through the embedded bank-accoun
437
437
 
438
438
  #### Props
439
439
 
440
- | Prop | Type | Required | Description |
441
- | ------------------------------------------- | ----------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
442
- | `onEmbeddedOnboardingCompletedSuccessfully` | `() => void` | Yes | Called when the application is submitted and approved. |
443
- | `onNavigateToDashboard` | `() => void` | Yes | Called when the user clicks the dashboard CTA on the result screen. |
444
- | `initialBusinessDetails` | `Partial<BusinessDetailsValues>` | No | Prefills step 1 (business details). Unset fields start empty; the user can still edit before continuing. |
445
- | `initialPersonalDetails` | `Partial<PersonalDetailsValues>` | No | Prefills step 2 (personal / about-you details). Unset fields start empty; the user can still edit before continuing. |
446
- | `initialAdditionalOwners` | `HostSuppliedOwner[]` | No | Prefills step 3 (additional owners). Defaults to an empty list when omitted. Excludes `id`, which names an owner the server already stores, so a seeded one would update instead of create. |
447
- | `open` | `boolean` | No | Controlled open state for the modal. When provided the host owns open/close and must update it via `onOpenChange`. Omit for uncontrolled mode. |
448
- | `defaultOpen` | `boolean` | No | Initial open state when uncontrolled. Defaults to `false` so the modal stays closed until the host opens it. Ignored when `open` is set. |
449
- | `onOpenChange` | `(open: boolean) => void` | No | Notified whenever the modal opens or closes — fires on overlay click, escape key, the close button, and any controlled state update. Used both as the change handler in controlled mode and a side hook. |
450
- | `labels` | `BankAccountOnboardingWidgetLabels` | No | Per-step label overrides — see Labels section. Accepts a `modalTitle` override for the modal's accessible title (default: `Bank account onboarding`). |
451
- | `bankLogoSrc` | `string` | No | URL for the bank logo rendered on the result screen; falls back to bank name text. |
452
- | `disclosureLinks` | `DisclosureLinks` | No | Host-resolved URLs for Terms of Use, Privacy Policy, Electronic Communication, and Patriot Act on the business-details agreement step. Omit to leave those links unset. |
453
- | `isFullScreenInline` | `boolean` | No | Renders the widget inline — filling the width/height of its host container — instead of in a modal. `open` / `defaultOpen` are ignored in this mode; the widget always renders once mounted, and the host controls mounting instead. `onOpenChange` still fires for gestures like Cancel, so hosts can react (e.g. by unmounting the widget). Defaults to `false`. |
440
+ | Prop | Type | Required | Description |
441
+ | ------------------------------------------- | ---------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
442
+ | `onEmbeddedOnboardingCompletedSuccessfully` | `() => void` | Yes | Called when the application is submitted and approved. |
443
+ | `onNavigateToDashboard` | `() => void` | Yes | Called when the user clicks the dashboard CTA on the result screen. |
444
+ | `initialBusinessDetails` | `Partial<HostSupplied<BusinessDetailsValues>>` | No | Prefills step 1 (business details). Unset fields start empty; the user can still edit before continuing. Excludes the resume-only `taxIdOnFileLast4` / `taxIdOnFileStructure`, which only a stored application may set. |
445
+ | `initialPersonalDetails` | `Partial<HostSupplied<PersonalDetailsValues>>` | No | Prefills step 2 (personal / about-you details). Unset fields start empty; the user can still edit before continuing. Excludes the resume-only `ssnOnFileLast4`. |
446
+ | `initialAdditionalOwners` | `HostSuppliedOwner[]` | No | Prefills step 3 (additional owners). Defaults to an empty list when omitted. Excludes `id`, which names an owner the server already stores, so a seeded one would update instead of create. |
447
+ | `open` | `boolean` | No | Controlled open state for the modal. When provided the host owns open/close and must update it via `onOpenChange`. Omit for uncontrolled mode. |
448
+ | `defaultOpen` | `boolean` | No | Initial open state when uncontrolled. Defaults to `false` so the modal stays closed until the host opens it. Ignored when `open` is set. |
449
+ | `onOpenChange` | `(open: boolean) => void` | No | Notified whenever the modal opens or closes — fires on overlay click, escape key, the close button, and any controlled state update. Used both as the change handler in controlled mode and a side hook. |
450
+ | `labels` | `BankAccountOnboardingWidgetLabels` | No | Per-step label overrides — see Labels section. Accepts a `modalTitle` override for the modal's accessible title (default: `Bank account onboarding`). |
451
+ | `bankLogoSrc` | `string` | No | URL for the bank logo rendered on the result screen; falls back to bank name text. |
452
+ | `disclosureLinks` | `DisclosureLinks` | No | Host-resolved URLs for Terms of Use, Privacy Policy, Electronic Communication, and Patriot Act on the business-details agreement step. Omit to leave those links unset. |
453
+ | `isFullScreenInline` | `boolean` | No | Renders the widget inline — filling the width/height of its host container — instead of in a modal. `open` / `defaultOpen` are ignored in this mode; the widget always renders once mounted, and the host controls mounting instead. `onOpenChange` still fires for gestures like Cancel, so hosts can react (e.g. by unmounting the widget). Defaults to `false`. |
454
454
 
455
455
  ### MarketingWidget
456
456
 
package/dist/index.d.ts CHANGED
@@ -4203,6 +4203,16 @@ interface BusinessDetailsValues {
4203
4203
  companyStructure: CompanyStructureValue | '';
4204
4204
  website: string;
4205
4205
  taxId: string;
4206
+ /**
4207
+ * Set only when resuming. While present, a blank field means keep the stored
4208
+ * tax id rather than missing, so the applicant need not retype it.
4209
+ */
4210
+ taxIdOnFileLast4?: string;
4211
+ /**
4212
+ * Structure the stored tax id was filed under. A change across the
4213
+ * sole-proprietorship line changes its type, so it can no longer be kept.
4214
+ */
4215
+ taxIdOnFileStructure?: CompanyStructureValue;
4206
4216
  naicsCode: string;
4207
4217
  isAuthorized: boolean | null;
4208
4218
  isCheckboxChecked: boolean;
@@ -4212,6 +4222,11 @@ interface PersonalDetailsValues {
4212
4222
  lastName: string;
4213
4223
  dateOfBirth: Date | undefined;
4214
4224
  ssn: string;
4225
+ /**
4226
+ * Set only when resuming. While present, a blank field means keep the stored
4227
+ * SSN rather than missing, so the applicant need not retype it.
4228
+ */
4229
+ ssnOnFileLast4?: string;
4215
4230
  homeAddress: string;
4216
4231
  city: string;
4217
4232
  state: string;
@@ -4232,6 +4247,12 @@ interface AdditionalOwner {
4232
4247
  lastName: string;
4233
4248
  dateOfBirth: Date | undefined;
4234
4249
  ssn: string;
4250
+ /**
4251
+ * Set only for a resumed owner carrying an `id`, which is what makes the write
4252
+ * a merge. Blank then means keep. Without an id the write creates a new row,
4253
+ * so an omitted identifier would store the owner without one.
4254
+ */
4255
+ ssnOnFileLast4?: string;
4235
4256
  homeAddress: string;
4236
4257
  city: string;
4237
4258
  state: string;
@@ -4279,6 +4300,8 @@ interface AdditionalOwnersLabels {
4279
4300
  dateOfBirthPlaceholder: string;
4280
4301
  dateOfBirthMinAgeError: string;
4281
4302
  ssn: string;
4303
+ /** Shown when an SSN is already stored and need not be retyped. */
4304
+ ssnOnFileTemplate: (last4: string) => string;
4282
4305
  ssnInvalid: string;
4283
4306
  ssnShow: string;
4284
4307
  ssnHide: string;
@@ -4323,6 +4346,8 @@ interface BusinessDetailsLabels {
4323
4346
  websiteInvalid: string;
4324
4347
  taxId: string;
4325
4348
  taxIdInvalid: string;
4349
+ /** Shown when a tax id is already stored and need not be retyped. */
4350
+ taxIdOnFileTemplate: (last4: string) => string;
4326
4351
  naicsCode: string;
4327
4352
  naicsCodePlaceholder: string;
4328
4353
  isAuthorizedQuestion: string;
@@ -4352,6 +4377,8 @@ interface PersonalDetailsLabels {
4352
4377
  dateOfBirthPlaceholder: string;
4353
4378
  dateOfBirthMinAgeError: string;
4354
4379
  ssn: string;
4380
+ /** Shown when an SSN is already stored and need not be retyped. */
4381
+ ssnOnFileTemplate: (last4: string) => string;
4355
4382
  ssnInvalid: string;
4356
4383
  ssnShow: string;
4357
4384
  ssnHide: string;
@@ -4425,8 +4452,17 @@ interface BankAccountOnboardingWidgetLabels {
4425
4452
  shellFdicDisclaimer: string;
4426
4453
  }
4427
4454
 
4428
- /** Host-supplied owners, which may not carry a resume-only id. */
4429
- type HostSuppliedOwner = Omit<AdditionalOwner, 'id'>;
4455
+ /**
4456
+ * Markers saying the server already holds an identifier. They make a blank
4457
+ * field valid and drop the identifier from the write, so a host that set one on
4458
+ * a fresh application would submit without an SSN or tax id.
4459
+ */
4460
+ declare const STORED_IDENTIFIER_MARKERS: readonly ["ssnOnFileLast4", "taxIdOnFileLast4", "taxIdOnFileStructure"];
4461
+ type StoredIdentifierMarker = (typeof STORED_IDENTIFIER_MARKERS)[number];
4462
+ /** Host-supplied initial values, which may never carry the markers. */
4463
+ type HostSupplied<T> = Omit<T, StoredIdentifierMarker>;
4464
+ /** Host-supplied owners, which may not carry an id either. */
4465
+ type HostSuppliedOwner = Omit<AdditionalOwner, StoredIdentifierMarker | 'id'>;
4430
4466
 
4431
4467
  interface BankAccountOnboardingWidgetInnerProps {
4432
4468
  onEmbeddedOnboardingCompletedSuccessfully: () => void;
@@ -4474,7 +4510,9 @@ interface BankAccountOnboardingWidgetInnerProps {
4474
4510
  */
4475
4511
  isFullScreenInline?: boolean;
4476
4512
  }
4477
- type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialAdditionalOwners'> & {
4513
+ type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners'> & {
4514
+ initialBusinessDetails?: Partial<HostSupplied<BusinessDetailsValues>>;
4515
+ initialPersonalDetails?: Partial<HostSupplied<PersonalDetailsValues>>;
4478
4516
  initialAdditionalOwners?: HostSuppliedOwner[];
4479
4517
  };
4480
4518
  declare function BankAccountOnboardingWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }: BankAccountOnboardingWidgetProps): React.JSX.Element;
package/dist/index.js CHANGED
@@ -52,11 +52,11 @@ import "./lib/InsightsWidget.js";
52
52
  import "./lib/InvoicingWidget.js";
53
53
  import { LinkedAccountsWidget as X } from "./libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index10.js";
54
54
  import "./lib/LinkedAccountsWidget.js";
55
- import { ADDITIONAL_OWNERS_LABELS_EN as Z } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index4.js";
56
- import { BUSINESS_DETAILS_LABELS_EN as Q } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index6.js";
57
- import { PERSONAL_DETAILS_LABELS_EN as $ } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index7.js";
58
- import { RESULT_LABELS_EN as ee } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index12.js";
59
- import { BankAccountOnboardingWidget as te } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index20.js";
55
+ import { ADDITIONAL_OWNERS_LABELS_EN as Z } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index5.js";
56
+ import { BUSINESS_DETAILS_LABELS_EN as Q } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index7.js";
57
+ import { PERSONAL_DETAILS_LABELS_EN as $ } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index8.js";
58
+ import { RESULT_LABELS_EN as ee } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index13.js";
59
+ import { BankAccountOnboardingWidget as te } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js";
60
60
  import "./lib/BankAccountOnboardingWidget.js";
61
61
  import { MARKETING_WIDGET_LABELS_EN as ne } from "./libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index2.js";
62
62
  import { MarketingWidget as re } from "./libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index4.js";
@@ -20,6 +20,16 @@ interface BusinessDetailsValues {
20
20
  companyStructure: CompanyStructureValue | '';
21
21
  website: string;
22
22
  taxId: string;
23
+ /**
24
+ * Set only when resuming. While present, a blank field means keep the stored
25
+ * tax id rather than missing, so the applicant need not retype it.
26
+ */
27
+ taxIdOnFileLast4?: string;
28
+ /**
29
+ * Structure the stored tax id was filed under. A change across the
30
+ * sole-proprietorship line changes its type, so it can no longer be kept.
31
+ */
32
+ taxIdOnFileStructure?: CompanyStructureValue;
23
33
  naicsCode: string;
24
34
  isAuthorized: boolean | null;
25
35
  isCheckboxChecked: boolean;
@@ -29,6 +39,11 @@ interface PersonalDetailsValues {
29
39
  lastName: string;
30
40
  dateOfBirth: Date | undefined;
31
41
  ssn: string;
42
+ /**
43
+ * Set only when resuming. While present, a blank field means keep the stored
44
+ * SSN rather than missing, so the applicant need not retype it.
45
+ */
46
+ ssnOnFileLast4?: string;
32
47
  homeAddress: string;
33
48
  city: string;
34
49
  state: string;
@@ -49,6 +64,12 @@ interface AdditionalOwner {
49
64
  lastName: string;
50
65
  dateOfBirth: Date | undefined;
51
66
  ssn: string;
67
+ /**
68
+ * Set only for a resumed owner carrying an `id`, which is what makes the write
69
+ * a merge. Blank then means keep. Without an id the write creates a new row,
70
+ * so an omitted identifier would store the owner without one.
71
+ */
72
+ ssnOnFileLast4?: string;
52
73
  homeAddress: string;
53
74
  city: string;
54
75
  state: string;
@@ -776,6 +797,8 @@ interface AdditionalOwnersLabels {
776
797
  dateOfBirthPlaceholder: string;
777
798
  dateOfBirthMinAgeError: string;
778
799
  ssn: string;
800
+ /** Shown when an SSN is already stored and need not be retyped. */
801
+ ssnOnFileTemplate: (last4: string) => string;
779
802
  ssnInvalid: string;
780
803
  ssnShow: string;
781
804
  ssnHide: string;
@@ -820,6 +843,8 @@ interface BusinessDetailsLabels {
820
843
  websiteInvalid: string;
821
844
  taxId: string;
822
845
  taxIdInvalid: string;
846
+ /** Shown when a tax id is already stored and need not be retyped. */
847
+ taxIdOnFileTemplate: (last4: string) => string;
823
848
  naicsCode: string;
824
849
  naicsCodePlaceholder: string;
825
850
  isAuthorizedQuestion: string;
@@ -849,6 +874,8 @@ interface PersonalDetailsLabels {
849
874
  dateOfBirthPlaceholder: string;
850
875
  dateOfBirthMinAgeError: string;
851
876
  ssn: string;
877
+ /** Shown when an SSN is already stored and need not be retyped. */
878
+ ssnOnFileTemplate: (last4: string) => string;
852
879
  ssnInvalid: string;
853
880
  ssnShow: string;
854
881
  ssnHide: string;
@@ -922,8 +949,17 @@ interface BankAccountOnboardingWidgetLabels {
922
949
  shellFdicDisclaimer: string;
923
950
  }
924
951
 
925
- /** Host-supplied owners, which may not carry a resume-only id. */
926
- type HostSuppliedOwner = Omit<AdditionalOwner, 'id'>;
952
+ /**
953
+ * Markers saying the server already holds an identifier. They make a blank
954
+ * field valid and drop the identifier from the write, so a host that set one on
955
+ * a fresh application would submit without an SSN or tax id.
956
+ */
957
+ declare const STORED_IDENTIFIER_MARKERS: readonly ["ssnOnFileLast4", "taxIdOnFileLast4", "taxIdOnFileStructure"];
958
+ type StoredIdentifierMarker = (typeof STORED_IDENTIFIER_MARKERS)[number];
959
+ /** Host-supplied initial values, which may never carry the markers. */
960
+ type HostSupplied<T> = Omit<T, StoredIdentifierMarker>;
961
+ /** Host-supplied owners, which may not carry an id either. */
962
+ type HostSuppliedOwner = Omit<AdditionalOwner, StoredIdentifierMarker | 'id'>;
927
963
 
928
964
  interface BankAccountOnboardingWidgetInnerProps {
929
965
  onEmbeddedOnboardingCompletedSuccessfully: () => void;
@@ -971,7 +1007,9 @@ interface BankAccountOnboardingWidgetInnerProps {
971
1007
  */
972
1008
  isFullScreenInline?: boolean;
973
1009
  }
974
- type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialAdditionalOwners'> & {
1010
+ type BankAccountOnboardingWidgetProps = WidgetProviderProps & Omit<BankAccountOnboardingWidgetInnerProps, 'initialApplicationId' | 'initialBusinessDetails' | 'initialPersonalDetails' | 'initialAdditionalOwners'> & {
1011
+ initialBusinessDetails?: Partial<HostSupplied<BusinessDetailsValues>>;
1012
+ initialPersonalDetails?: Partial<HostSupplied<PersonalDetailsValues>>;
975
1013
  initialAdditionalOwners?: HostSuppliedOwner[];
976
1014
  };
977
1015
  declare function BankAccountOnboardingWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }: BankAccountOnboardingWidgetProps): React.JSX.Element;
@@ -1,8 +1,8 @@
1
- import { ADDITIONAL_OWNERS_LABELS_EN as e } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index4.js";
2
- import { BUSINESS_DETAILS_LABELS_EN as t } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index6.js";
3
- import { PERSONAL_DETAILS_LABELS_EN as n } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index7.js";
4
- import { RESULT_LABELS_EN as r } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index12.js";
1
+ import { ADDITIONAL_OWNERS_LABELS_EN as e } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index5.js";
2
+ import { BUSINESS_DETAILS_LABELS_EN as t } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index7.js";
3
+ import { PERSONAL_DETAILS_LABELS_EN as n } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index8.js";
4
+ import { RESULT_LABELS_EN as r } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index13.js";
5
5
  import "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js";
6
- import { BankAccountOnboardingWidget as i } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index20.js";
6
+ import { BankAccountOnboardingWidget as i } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js";
7
7
  import "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index.js";
8
8
  export { e as ADDITIONAL_OWNERS_LABELS_EN, t as BUSINESS_DETAILS_LABELS_EN, i as BankAccountOnboardingWidget, n as PERSONAL_DETAILS_LABELS_EN, r as RESULT_LABELS_EN };
@@ -1,2 +1,2 @@
1
- import { BankAccountOnboardingWidget as e } from "./index20.js";
1
+ import { BankAccountOnboardingWidget as e } from "./index22.js";
2
2
  export { e as BankAccountOnboardingWidget };
@@ -1,116 +1,191 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { bankAccountOnboardingTestIds as e } from "./index9.js";
6
- import { isValidWebsiteUrl as t } from "./index6.js";
7
- import { BusinessDetailsPanel as n } from "../../ui/dist/index18.js";
8
- import { BusinessDisclosuresSection as r } from "../../ui/dist/index23.js";
1
+ import { maskIdentifierLast4 as e } from "./index6.js";
2
+ import { storedIdentifierFieldDisplay as t, usableStoredTaxIdLast4 as n } from "./index7.js";
3
+ import { isValidWebsiteUrl as r } from "./index8.js";
4
+ import { formatPhoneNumberInput as i } from "./index2.js";
5
+ import { sanitizeZipCodeInput as a } from "./index3.js";
6
+ import { sanitizeTaxIdInput as o } from "./index5.js";
7
+ import { BUSINESS_DETAILS_LABELS_EN as s } from "../../ui/dist/index7.js";
8
+ import { BUSINESS_DETAILS_PANEL_LABELS_EN as c } from "../../ui/dist/index18.js";
9
9
  import "../../ui/dist/index.js";
10
- import { buildBusinessDetailsEditFields as i, buildBusinessDetailsPanelLabels as a, buildBusinessDetailsSummaryRows as o, isBusinessWebsiteInvalid as s, mergeBusinessDetailsLabels as c } from "./index8.js";
11
- import { useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
12
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
13
- import { z as h } from "zod";
14
10
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index10.js
15
- function g(e) {
16
- return h.object({
17
- companyLegalName: h.string().min(1),
18
- companyDbaName: h.string(),
19
- businessAddress: h.string().min(1),
20
- city: h.string().min(1),
21
- state: h.string().min(2),
22
- zipCode: h.string().min(5),
23
- companyPhoneNumber: h.string().refine((e) => e.replace(/\D/g, "").length === 10, { message: e.companyPhoneNumberInvalid }),
24
- companyStructure: h.enum([
25
- "CORPORATION_PUBLIC",
26
- "CORPORATION_PRIVATE",
27
- "CORPORATION_NOT_FOR_PROFIT",
28
- "LLC",
29
- "LLP",
30
- "PARTNERSHIP",
31
- "SOLE_PROPRIETORSHIP",
32
- "GOVERNMENT",
33
- "COOPERATIVE",
34
- "ASSOCIATION",
35
- "OTHER"
36
- ]),
37
- website: h.string().refine((e) => !e || t(e), { message: e.websiteInvalid }),
38
- taxId: h.string().refine((e) => /^\d{9}$/.test(e), { message: e.taxIdInvalid }),
39
- naicsCode: h.string().min(1)
40
- });
11
+ function l(e) {
12
+ return {
13
+ ...s,
14
+ ...e,
15
+ companyStructureOptions: {
16
+ ...s.companyStructureOptions,
17
+ ...e?.companyStructureOptions
18
+ },
19
+ naicsTitles: {
20
+ ...s.naicsTitles,
21
+ ...e?.naicsTitles
22
+ },
23
+ stateTitles: {
24
+ ...s.stateTitles,
25
+ ...e?.stateTitles
26
+ }
27
+ };
41
28
  }
42
- function _(e) {
43
- return g(e).extend({
44
- isAuthorized: h.literal(!0),
45
- isCheckboxChecked: h.literal(!0)
46
- });
29
+ function u(e) {
30
+ return e.trim().length > 0 && !r(e);
47
31
  }
48
- function v({ value: t, onValueChange: h, onSnapshotChange: v, naicsOptions: y, stateOptions: b, isSubmitting: x, labels: S, bankName: C, termsHref: w, privacyHref: T, electronicCommunicationHref: E, patriotActHref: D }) {
49
- let O = u(() => c(S), [S]), k = u(() => ({
50
- panelFields: g(O),
51
- full: _(O)
52
- }), [O]), A = k.full.safeParse(t), j = A.success ? A.data : null, M = k.panelFields.safeParse(t).success, N = JSON.stringify(j), P = d(v);
53
- P.current = v, l(() => {
54
- P.current(j);
55
- }, [N]);
56
- let [F, I] = f(() => !M);
57
- l(() => {
58
- M || I(!0);
59
- }, [M]);
60
- let L = u(() => ({
61
- stateOptions: b,
62
- naicsOptions: y,
63
- labels: S
64
- }), [
65
- b,
66
- y,
67
- S
68
- ]), R = u(() => a(S), [S]), z = u(() => o(t, L), [t, L]), B = u(() => i(t, h, L), [
69
- t,
70
- h,
71
- L
72
- ]), V = s(t.website);
73
- return /* @__PURE__ */ m("div", {
74
- className: "ttw:flex ttw:flex-col ttw:gap-6",
75
- children: [/* @__PURE__ */ p(n, {
76
- isEditing: F,
77
- onEditClick: () => I(!0),
78
- summaryRows: z,
79
- editFields: B,
80
- labels: R,
81
- isDisabled: x,
82
- websiteInvalid: V,
83
- testIds: {
84
- root: e.businessDetailsPanel,
85
- editButton: e.businessDetailsEditButton,
86
- summary: { root: e.businessDetailsSummary },
87
- editForm: {
88
- root: e.businessDetailsEditForm,
89
- naicsCombobox: e.businessDetailsNaicsCombobox
90
- }
91
- }
92
- }), /* @__PURE__ */ p(r, {
93
- value: {
94
- isAuthorized: t.isAuthorized,
95
- isCheckboxChecked: t.isCheckboxChecked
96
- },
97
- onChange: (e) => h({
98
- ...t,
99
- ...e
100
- }),
101
- isSubmitting: x,
102
- labels: S,
103
- bankName: C,
104
- termsHref: w,
105
- privacyHref: T,
106
- electronicCommunicationHref: E,
107
- patriotActHref: D,
108
- testIds: {
109
- authorizationCheckbox: e.authorizationCheckbox,
110
- disclosureCheckbox: e.disclosureCheckbox
111
- }
112
- })]
32
+ function d(e) {
33
+ let t = l(e);
34
+ return {
35
+ ...c,
36
+ companyLegalName: t.companyLegalName,
37
+ companyDbaName: t.companyDbaName,
38
+ businessAddress: t.businessAddress,
39
+ city: t.city,
40
+ state: t.state,
41
+ statePlaceholder: t.statePlaceholder,
42
+ zipCode: t.zipCode,
43
+ companyPhoneNumber: t.companyPhoneNumber,
44
+ companyStructure: t.companyStructure,
45
+ companyStructurePlaceholder: t.companyStructurePlaceholder,
46
+ website: t.website,
47
+ websiteInvalid: t.websiteInvalid,
48
+ taxId: t.taxId,
49
+ naicsCode: t.naicsCode,
50
+ naicsCodePlaceholder: t.naicsCodePlaceholder
51
+ };
52
+ }
53
+ function f(t, r) {
54
+ let i = d(r.labels), a = l(r.labels), o = n(t), s = t.companyStructure && a.companyStructureOptions[t.companyStructure], c = r.stateOptions.find((e) => e.value === t.state)?.label ?? t.state, u = r.naicsOptions.find((e) => e.value === t.naicsCode)?.label ?? t.naicsCode;
55
+ return [
56
+ {
57
+ label: i.companyLegalName,
58
+ value: t.companyLegalName,
59
+ testId: "business-details-summary-legal-name"
60
+ },
61
+ {
62
+ label: i.companyDbaName,
63
+ value: t.companyDbaName,
64
+ testId: "business-details-summary-dba-name"
65
+ },
66
+ {
67
+ label: i.businessAddress,
68
+ value: t.businessAddress,
69
+ testId: "business-details-summary-address"
70
+ },
71
+ {
72
+ label: i.city,
73
+ value: t.city,
74
+ testId: "business-details-summary-city"
75
+ },
76
+ {
77
+ label: i.state,
78
+ value: c,
79
+ testId: "business-details-summary-state"
80
+ },
81
+ {
82
+ label: i.zipCode,
83
+ value: t.zipCode,
84
+ testId: "business-details-summary-zip-code"
85
+ },
86
+ {
87
+ label: i.companyPhoneNumber,
88
+ value: t.companyPhoneNumber,
89
+ testId: "business-details-summary-phone"
90
+ },
91
+ {
92
+ label: i.companyStructure,
93
+ value: s ?? t.companyStructure,
94
+ testId: "business-details-summary-structure"
95
+ },
96
+ {
97
+ label: i.website,
98
+ value: t.website,
99
+ testId: "business-details-summary-website"
100
+ },
101
+ {
102
+ label: i.taxId,
103
+ value: t.taxId ? t.taxId : o ? e(o) : "",
104
+ testId: "business-details-summary-tax-id"
105
+ },
106
+ {
107
+ label: i.naicsCode,
108
+ value: u,
109
+ testId: "business-details-summary-naics"
110
+ }
111
+ ];
112
+ }
113
+ function p(e, r) {
114
+ let i = l(r);
115
+ return t(n(e), i.taxIdOnFileTemplate);
116
+ }
117
+ function m(e, t, n) {
118
+ let r = l(n.labels), s = [
119
+ "CORPORATION_PUBLIC",
120
+ "CORPORATION_PRIVATE",
121
+ "CORPORATION_NOT_FOR_PROFIT",
122
+ "LLC",
123
+ "LLP",
124
+ "PARTNERSHIP",
125
+ "SOLE_PROPRIETORSHIP",
126
+ "GOVERNMENT",
127
+ "COOPERATIVE",
128
+ "ASSOCIATION",
129
+ "OTHER"
130
+ ].map((e) => ({
131
+ value: e,
132
+ label: r.companyStructureOptions[e]
133
+ })), c = (n) => (r) => t({
134
+ ...e,
135
+ [n]: r
113
136
  });
137
+ return {
138
+ companyLegalName: {
139
+ value: e.companyLegalName,
140
+ onValueChange: c("companyLegalName")
141
+ },
142
+ companyDbaName: {
143
+ value: e.companyDbaName,
144
+ onValueChange: c("companyDbaName")
145
+ },
146
+ businessAddress: {
147
+ value: e.businessAddress,
148
+ onValueChange: c("businessAddress")
149
+ },
150
+ city: {
151
+ value: e.city,
152
+ onValueChange: c("city")
153
+ },
154
+ state: {
155
+ value: e.state,
156
+ onValueChange: c("state"),
157
+ options: n.stateOptions
158
+ },
159
+ zipCode: {
160
+ value: e.zipCode,
161
+ onValueChange: (e) => c("zipCode")(a(e))
162
+ },
163
+ companyPhoneNumber: {
164
+ value: e.companyPhoneNumber,
165
+ onValueChange: (e) => c("companyPhoneNumber")(i(e))
166
+ },
167
+ companyStructure: {
168
+ value: e.companyStructure,
169
+ onValueChange: (n) => t({
170
+ ...e,
171
+ companyStructure: n
172
+ }),
173
+ options: s
174
+ },
175
+ website: {
176
+ value: e.website,
177
+ onValueChange: c("website")
178
+ },
179
+ taxId: {
180
+ value: e.taxId,
181
+ onValueChange: (e) => c("taxId")(o(e))
182
+ },
183
+ naicsCode: {
184
+ value: e.naicsCode,
185
+ onValueChange: c("naicsCode"),
186
+ options: n.naicsOptions
187
+ }
188
+ };
114
189
  }
115
190
  //#endregion
116
- export { v as BusinessDetailsStep };
191
+ export { m as buildBusinessDetailsEditFields, d as buildBusinessDetailsPanelLabels, f as buildBusinessDetailsSummaryRows, p as buildTaxIdFieldDisplay, u as isBusinessWebsiteInvalid, l as mergeBusinessDetailsLabels };