@tesouro/embedded-components-react 0.3.16 → 0.3.18

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 (111) hide show
  1. package/dist/index.d.ts +22 -1
  2. package/dist/index.js +10 -10
  3. package/dist/lib/AcceptDisclosuresWidget.d.ts +11 -1
  4. package/dist/lib/AcceptDisclosuresWidget.js +1 -1
  5. package/dist/lib/BalancesWidget.js +1 -1
  6. package/dist/lib/BankAccountOnboardingWidget.d.ts +21 -21
  7. package/dist/lib/BankAccountOnboardingWidget.js +1 -1
  8. package/dist/lib/CardsWidget.js +1 -1
  9. package/dist/lib/ExpenseApprovalPoliciesWidget.js +1 -1
  10. package/dist/lib/ExpenseManagementWidget.js +1 -1
  11. package/dist/lib/InsightsWidget.js +1 -1
  12. package/dist/lib/ReceiptMatchWidget.js +1 -1
  13. package/dist/lib/TransfersWidget.js +1 -1
  14. package/dist/lib/UploadReceiptWidget.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index.js +1 -1
  16. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +10 -140
  17. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index5.js +152 -0
  18. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +19 -19
  19. package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index4.js +10 -11
  21. package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index5.js +15 -64
  22. package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index6.js +75 -0
  23. package/dist/libs/tesouro-embedded-components-react/balances-widget/ui/dist/lib/BalancesWidget/BalancesWidget.js +16 -16
  24. package/dist/libs/tesouro-embedded-components-react/balances-widget/ui/dist/lib/BalancesWidget/SingleBalance/SingleBalance.js +7 -7
  25. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index10.js +109 -169
  27. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index11.js +170 -63
  28. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +73 -81
  29. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index13.js +77 -101
  30. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index14.js +110 -83
  31. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index15.js +91 -7
  32. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js +7 -28
  33. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +26 -320
  34. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js +341 -0
  35. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index9.js +29 -100
  36. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +0 -1
  37. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index11.js +3 -3
  38. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index15.js +32 -32
  39. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index16.js +2 -2
  40. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index18.js +14 -10
  41. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index19.js +42 -42
  42. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index2.js +80 -77
  43. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index20.js +2 -2
  44. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index22.js +14 -10
  45. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index23.js +16 -16
  46. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +5 -5
  47. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index3.js +7 -6
  48. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index5.js +23 -18
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +0 -1
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +28 -28
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +0 -1
  52. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/index.js +0 -1
  53. package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsHeader.js +5 -5
  54. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index.js +3 -3
  55. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index3.js +4 -23
  56. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index4.js +23 -24
  57. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index5.js +24 -30
  58. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index6.js +28 -55
  59. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index7.js +54 -209
  60. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +206 -81
  61. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +95 -0
  62. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardFaceSwatch.js +2 -2
  63. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +31 -30
  64. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListRow.js +11 -10
  65. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js +5 -5
  66. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index10.js +1 -255
  67. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index11.js +253 -2
  68. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index12.js +2 -71
  69. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index13.js +73 -0
  70. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index5.js +7 -218
  71. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index6.js +219 -79
  72. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index7.js +89 -2
  73. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index8.js +2 -47
  74. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index9.js +49 -1
  75. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ApprovalRuleCard.js +2 -2
  76. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ApprovalRuleForm.js +32 -32
  77. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ExpenseApprovalsPage.js +11 -8
  78. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index.js +1 -1
  79. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index10.js +12 -14
  80. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index11.js +21 -62
  81. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index12.js +73 -0
  82. package/dist/libs/tesouro-embedded-components-react/insights-widget/ui/dist/lib/InsightsWidget/InsightsWidget.js +6 -6
  83. package/dist/libs/tesouro-embedded-components-react/insights-widget/ui/dist/lib/InsightsWidget/SingleInsight/SingleInsight.js +10 -10
  84. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index5.js +1 -1
  85. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js +67 -46
  86. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/testIds.js +26 -0
  87. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/useApprovalPolicyRules.js +151 -135
  88. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js +11 -11
  89. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index14.js +17 -17
  90. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index16.js +17 -15
  91. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index18.js +9 -9
  92. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index20.js +16 -13
  93. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index3.js +13 -13
  94. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index5.js +11 -11
  95. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index7.js +5 -5
  96. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index9.js +6 -6
  97. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  98. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +21 -20
  99. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellOverlayPortal.js +10 -10
  100. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellScrollRegion.js +17 -17
  101. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index.js +1 -1
  102. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index5.js +18 -99
  103. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index6.js +116 -19
  104. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index7.js +28 -0
  105. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/ReviewTransferStep.js +9 -9
  106. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferMoneyModal.js +13 -11
  107. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferResultStep.js +7 -7
  108. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransfersWidget.js +19 -19
  109. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +4 -4
  110. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  111. package/package.json +1 -1
@@ -1,30 +1,9 @@
1
- import { RESULT_LABELS_EN as e } from "../../ui/dist/index12.js";
2
- import "../../ui/dist/index.js";
3
1
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js
4
- var t = {
5
- stepIndicator: {
6
- business: "Business",
7
- personal: "Personal",
8
- ownership: "Ownership",
9
- done: "Done"
10
- },
11
- businessDetails: {},
12
- personalDetails: {},
13
- additionalOwners: {},
14
- result: e,
15
- back: "Back",
16
- cancel: "Cancel",
17
- next: "Next",
18
- submit: "Submit application",
19
- businessReviewTitle: "Review your business details",
20
- businessReviewSubtitle: "Take a moment to make sure your business information is correct.",
21
- personalReviewTitle: "Review your personal details",
22
- personalReviewSubtitle: "Take a moment to make sure your personal information is correct.",
23
- modalTitle: "Bank account onboarding",
24
- submitFailedError: "Unable to submit application. Please try again.",
25
- genericRetryError: "Please try again.",
26
- fallbackBankName: "Member Bank",
27
- shellFdicDisclaimer: "Products and services are offered by {bankName}, N.A., Member FDIC."
28
- };
2
+ var e = {
3
+ Mounted: "onboarding.mounted",
4
+ OpenMarketing: "onboarding_widget_open_marketing_widget",
5
+ BeginOnboarding: "onboarding_widget_begin_onboarding",
6
+ Suppressed: "onboarding.suppressed"
7
+ }, t = "onboarding";
29
8
  //#endregion
30
- export { t as DEFAULT_LABELS };
9
+ export { e as OnboardingAnalyticsEvent, t as WIDGET_NAME };
@@ -1,324 +1,30 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { Dialog as e, DialogContent as t, DialogTitle as n } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { useAcceptWidgetDisclosures as r } from "../../../shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js";
7
- import { useDisclosuresQuery as i } from "../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
8
- import "../../../shared/data-access/dist/index.js";
9
- import { OnboardingShell as a } from "../../../shared/ui/dist/lib/OnboardingShell/OnboardingShell.js";
10
- import "../../../shared/ui/dist/index.js";
11
- import { useAnalyticsTrack as o } from "../../../shared/feature/dist/lib/analytics/hooks.js";
12
- import { WidgetProvider as s } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
13
- import { getStateOptions as c } from "../../../shared/util/dist/lib/usStates.js";
14
- import { extractApiErrorMessage as l } from "../../../shared/util/dist/lib/apiErrors.js";
15
- import { useRefetchWidget as u, useWidgetConfig as d } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
16
- import { getNaicsOptions as f } from "../../../shared/feature/dist/lib/naicsCodeMap.js";
17
- import "../../../shared/feature/dist/index.js";
18
- import { ADDITIONAL_OWNERS_LABELS_EN as p } from "../../ui/dist/index4.js";
19
- import { interpolateBankName as m } from "../../ui/dist/index6.js";
20
- import { ResultStep as ee } from "../../ui/dist/index11.js";
21
- import { MarketingWidget as te } from "../../ui/dist/index28.js";
1
+ import { RESULT_LABELS_EN as e } from "../../ui/dist/index12.js";
22
2
  import "../../ui/dist/index.js";
23
- import { BusinessDetailsStep as ne } from "./index9.js";
24
- import { PersonalDetailsStep as re } from "./index11.js";
25
- import { AdditionalOwnersStep as ie } from "./index13.js";
26
- import { buildCreateApplicationBody as ae, buildUpdateApplicationBody as h } from "./index14.js";
27
- import { OnboardingAnalyticsEvent as g, WIDGET_NAME as _ } from "./index15.js";
28
- import { DEFAULT_LABELS as v } from "./index16.js";
29
- import { ApplicationClientSecretProvider as oe, useApplicationClientSecret as se } from "../../data-access/dist/index2.js";
30
- import { useCreateApplication as ce } from "../../data-access/dist/index4.js";
31
- import { useUpdateApplication as le } from "../../data-access/dist/index6.js";
32
- import { useSubmitApplication as ue } from "../../data-access/dist/index7.js";
33
- import { usePollApplicationCompletion as de } from "../../data-access/dist/index8.js";
34
- import { OnboardingSuppressionReason as y } from "../../data-access/dist/index9.js";
35
- import { useOrganizationOnboardingSuppression as fe } from "../../data-access/dist/index10.js";
36
- import "../../data-access/dist/index.js";
37
- import { useCallback as b, useEffect as x, useMemo as S, useRef as pe, useState as C } from "react";
38
- import { Fragment as me, jsx as w, jsxs as T } from "react/jsx-runtime";
39
3
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js
40
- var he = {
41
- companyLegalName: "",
42
- companyDbaName: "",
43
- businessAddress: "",
44
- city: "",
45
- state: "",
46
- zipCode: "",
47
- companyPhoneNumber: "",
48
- companyStructure: "",
49
- website: "",
50
- taxId: "",
51
- naicsCode: "",
52
- isAuthorized: null,
53
- isCheckboxChecked: !1
54
- }, ge = {
55
- firstName: "",
56
- lastName: "",
57
- dateOfBirth: void 0,
58
- ssn: "",
59
- homeAddress: "",
60
- city: "",
61
- state: "",
62
- zipCode: "",
63
- mobilePhoneNumber: "",
64
- workEmail: "",
65
- ownsOver25Percent: null,
66
- ownershipPercentage: null
4
+ var t = {
5
+ stepIndicator: {
6
+ business: "Business",
7
+ personal: "Personal",
8
+ ownership: "Ownership",
9
+ done: "Done"
10
+ },
11
+ businessDetails: {},
12
+ personalDetails: {},
13
+ additionalOwners: {},
14
+ result: e,
15
+ back: "Back",
16
+ cancel: "Cancel",
17
+ next: "Next",
18
+ submit: "Submit application",
19
+ businessReviewTitle: "Review your business details",
20
+ businessReviewSubtitle: "Take a moment to make sure your business information is correct.",
21
+ personalReviewTitle: "Review your personal details",
22
+ personalReviewSubtitle: "Take a moment to make sure your personal information is correct.",
23
+ modalTitle: "Bank account onboarding",
24
+ submitFailedError: "Unable to submit application. Please try again.",
25
+ genericRetryError: "Please try again.",
26
+ fallbackBankName: "Member Bank",
27
+ shellFdicDisclaimer: "Products and services are offered by {bankName}, N.A., Member FDIC."
67
28
  };
68
- function _e(e, t) {
69
- if (e === 0) return {
70
- title: t.businessReviewTitle,
71
- subtitle: t.businessReviewSubtitle
72
- };
73
- if (e === 1) return {
74
- title: t.personalReviewTitle,
75
- subtitle: t.personalReviewSubtitle
76
- };
77
- let n = {
78
- ...p,
79
- ...t.additionalOwners
80
- };
81
- return {
82
- title: n.heading,
83
- subtitle: n.subheading
84
- };
85
- }
86
- function E({ onEmbeddedOnboardingCompletedSuccessfully: s, onNavigateToDashboard: p, labels: _, initialBusinessDetails: oe, initialPersonalDetails: E, initialAdditionalOwners: D, bankLogoSrc: ve, disclosureLinks: ye, marketingContent: O = null, open: be, defaultOpen: k, onOpenChange: A }) {
87
- let j = o();
88
- x(() => {
89
- j(g.Mounted);
90
- }, [j]);
91
- let M = {
92
- ...v,
93
- ..._,
94
- stepIndicator: {
95
- ...v.stepIndicator,
96
- ..._?.stepIndicator
97
- },
98
- businessDetails: _?.businessDetails ?? {},
99
- personalDetails: _?.personalDetails ?? {},
100
- additionalOwners: _?.additionalOwners ?? {},
101
- result: {
102
- ...v.result,
103
- ..._?.result
104
- }
105
- }, N = d().initResponse, { termsHref: xe, privacyHref: Se, electronicCommunicationHref: Ce, patriotActHref: we } = ye ?? {}, Te = O !== null, P = be === void 0, [Ee, F] = C(!1), [De, Oe] = C(!0), [ke, Ae] = C(() => k ?? !1), je = ve ?? O?.bankLogoSrc ?? void 0, Me = P ? ke : be, Ne = k ?? !1, I = b((e) => {
106
- P && Ae(e), A?.(e);
107
- }, [A, P]), Pe = b(() => {
108
- j(g.OpenMarketing), F(!0);
109
- }, [j]), Fe = b(() => {
110
- F(!1);
111
- }, []), Ie = b(() => {
112
- j(g.BeginOnboarding), F(!1), I(!0);
113
- }, [I, j]), Le = b(() => {
114
- Oe(!1), s();
115
- }, [s]), Re = u(), [L, R] = C(0), [ze, Be] = C(() => ({
116
- ...he,
117
- ...oe
118
- })), [z, Ve] = C(() => ({
119
- ...ge,
120
- ...E
121
- })), [He, Ue] = C(() => D ?? []), [B, We] = C(null), [V, Ge] = C(null), [H, Ke] = C(null), [U, qe] = C(null), [Je, W] = C(null), [G, Ye] = C(!1), [Xe, K] = C(null), Ze = ce(), q = le(), Qe = ue(), $e = de(), { setClientSecret: et } = se(), { data: tt, refetch: nt } = i(), { mutateAsync: rt } = r(), J = fe(), Y = pe(null);
122
- x(() => () => Y.current?.abort(), []);
123
- let it = S(() => f(M.businessDetails.naicsTitles), [M.businessDetails.naicsTitles]), at = S(() => c(M.businessDetails.stateTitles), [M.businessDetails.stateTitles]), ot = S(() => c(M.personalDetails.stateTitles), [M.personalDetails.stateTitles]), st = S(() => c(M.additionalOwners.stateTitles), [M.additionalOwners.stateTitles]), X = G || Xe !== null, ct = N?.status === "ACTIVE" || N?.status === "INACTIVE", lt = N?.status === "INVITED", Z = !!N && !X && (ct || lt || J.isSuppressed), Q = Z ? ct ? y.UserAlreadyOnboarded : lt ? y.UserInvitedToOrganization : J.reason : null;
124
- if (x(() => {
125
- !Z || !Q || (j(g.Suppressed, { reason: Q }), console.info(`[onboarding] not shown: ${Q}`));
126
- }, [
127
- Z,
128
- Q,
129
- j
130
- ]), !N || !X && (Z || !J.isResolved)) return null;
131
- let ut = B?.companyStructure === "SOLE_PROPRIETORSHIP", dt = [
132
- M.stepIndicator.business,
133
- M.stepIndicator.personal,
134
- M.stepIndicator.ownership
135
- ], ft = L === 0 ? B : L === 1 ? V : L === 2 ? H : null, $ = Ze.isPending || q.isPending || Qe.isPending || G, pt = () => {
136
- W(null), R((e) => e === 0 ? 0 : e - 1);
137
- }, mt = () => {
138
- I(!1);
139
- }, ht = async (e) => {
140
- Ye(!0), I(!0);
141
- let t = new AbortController();
142
- Y.current = t;
143
- let n = !1;
144
- try {
145
- let r = await Qe.mutateAsync({ path: { id: e } });
146
- if (t.signal.aborted) return;
147
- if (!r.id) throw Error(M.submitFailedError);
148
- if (n = !0, (await $e(e, { signal: t.signal })).status === "complete") {
149
- let e = tt;
150
- if (e === void 0 && (e = (await nt()).data), t.signal.aborted) return;
151
- if (e !== void 0) try {
152
- await rt({ displayedVersion: e.version ?? null });
153
- } catch {}
154
- if (t.signal.aborted) return;
155
- K("success"), Re(), Le();
156
- } else K("pending");
157
- } catch (e) {
158
- if (e instanceof DOMException && e.name === "AbortError") return;
159
- if (!n) throw e;
160
- K("pending");
161
- } finally {
162
- Y.current = null, Ye(!1);
163
- }
164
- }, gt = async () => {
165
- W(null);
166
- try {
167
- if (L === 0) {
168
- if (!B) return;
169
- let e = U;
170
- if (!e) {
171
- let t = await Ze.mutateAsync({ body: ae(B) });
172
- e = t.id, qe(e), t.clientSecret && et(t.clientSecret);
173
- }
174
- R(1);
175
- } else if (L === 1) {
176
- if (!V || !B || !U) return;
177
- await q.mutateAsync({
178
- path: { id: U },
179
- body: h({
180
- businessDetails: B,
181
- applicant: V
182
- })
183
- }), R(2);
184
- } else if (L === 2) {
185
- if (!H || !U) return;
186
- await q.mutateAsync({
187
- path: { id: U },
188
- body: h({ businessOwners: H })
189
- }), await ht(U);
190
- }
191
- } catch (e) {
192
- let t = l(e) ?? (e instanceof Error ? e.message : void 0) ?? M.genericRetryError;
193
- W(t);
194
- }
195
- }, _t = _e(Math.min(L, 2), M), vt = N.bankName?.trim() || M.fallbackBankName, yt = m(M.shellFdicDisclaimer, vt);
196
- if (X) {
197
- let r = B?.companyLegalName ?? "", i = N.bankName?.trim() || M.fallbackBankName, a = Xe ?? "pending", o = a === "success", s = {
198
- ...v.result,
199
- ...M.result
200
- };
201
- return /* @__PURE__ */ w(e, {
202
- open: Me,
203
- onOpenChange: I,
204
- children: /* @__PURE__ */ T(t, {
205
- 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",
206
- children: [/* @__PURE__ */ w(n, {
207
- className: "ttw:sr-only",
208
- children: M.modalTitle
209
- }), /* @__PURE__ */ w(ee, {
210
- status: a,
211
- isLoading: G,
212
- loadingMessage: s.loadingMessage,
213
- headingLine1: o ? s.successHeadingLine1 : s.pendingHeadingLine1,
214
- headingLine2: `${r}!`,
215
- body: o ? s.successBody : s.pendingBody,
216
- followUpEmail: V?.workEmail ?? "",
217
- emailBoxLead: s.pendingEmailBoxLead,
218
- navigateToDashboardLabel: s.navigateToDashboard,
219
- bankLogoSrc: je,
220
- bankLogoAlt: m(s.bankLogoAlt, i),
221
- fdicDisclaimer: m(s.fdicDisclaimer, i),
222
- onNavigateToDashboard: p
223
- })]
224
- })
225
- });
226
- }
227
- let bt = L === 2 ? M.submit : M.next, xt = ft === null || $;
228
- return /* @__PURE__ */ T(me, { children: [Te && De && O ? /* @__PURE__ */ w(te, {
229
- open: Ee,
230
- isVisible: !0,
231
- vspLogo: O.vspLogo,
232
- bankingText: O.bankingText,
233
- primaryCaption: O.primaryCaption,
234
- secondaryCaption: O.secondaryCaption,
235
- providedByCaption: O.providedByCaption,
236
- modalPrimaryImg: O.modalPrimaryImg,
237
- primaryModalHeader: O.primaryModalHeader,
238
- benefits: O.benefits,
239
- appearance: O.appearance,
240
- onOpenMarketingModal: Pe,
241
- onCloseMarketingModal: Fe,
242
- onPrimaryCtaClick: Ie
243
- }) : null, /* @__PURE__ */ T(a, {
244
- open: Me,
245
- defaultOpen: Ne,
246
- onOpenChange: I,
247
- title: _t.title,
248
- subtitle: _t.subtitle,
249
- stepLabels: dt,
250
- activeStep: L,
251
- disclaimerText: yt,
252
- onBack: L === 0 ? mt : pt,
253
- onCancel: L > 0 ? mt : void 0,
254
- onNext: gt,
255
- showDismissButton: !1,
256
- isNextDisabled: xt,
257
- isNextLoading: $,
258
- nextLabel: bt,
259
- nextIcon: null,
260
- errorMessage: Je,
261
- labels: {
262
- backButton: L === 0 ? M.cancel : M.back,
263
- cancelButton: M.cancel
264
- },
265
- children: [
266
- L === 0 ? /* @__PURE__ */ w(ne, {
267
- value: ze,
268
- onValueChange: Be,
269
- onSnapshotChange: We,
270
- naicsOptions: it,
271
- stateOptions: at,
272
- isSubmitting: $,
273
- labels: M.businessDetails,
274
- bankName: vt,
275
- termsHref: xe,
276
- privacyHref: Se,
277
- electronicCommunicationHref: Ce,
278
- patriotActHref: we
279
- }, "business") : null,
280
- L === 1 ? /* @__PURE__ */ w(re, {
281
- value: z,
282
- onValueChange: Ve,
283
- onSnapshotChange: Ge,
284
- stateOptions: ot,
285
- isSubmitting: $,
286
- labels: M.personalDetails
287
- }, "personal") : null,
288
- L === 2 ? /* @__PURE__ */ w(ie, {
289
- owners: He,
290
- onOwnersChange: Ue,
291
- primaryOwnerName: `${z.firstName} ${z.lastName}`.trim(),
292
- primaryOwnerPercentage: ut ? 100 : V?.ownsOver25Percent === !0 ? V.ownershipPercentage ?? 0 : 0,
293
- stateOptions: st,
294
- onSnapshotChange: Ke,
295
- isSubmitting: $,
296
- labels: M.additionalOwners
297
- }) : null
298
- ]
299
- })] });
300
- }
301
- function D({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: c, errorFallback: l, onError: u, analytics: d, disclosuresAcceptance: f, ...p }) {
302
- return /* @__PURE__ */ w(s, {
303
- baseUrl: e,
304
- widgetToken: t,
305
- organizationId: n,
306
- configClient: r,
307
- gatewayRouting: i,
308
- linkComponent: a,
309
- implementation: o,
310
- uiFramework: c,
311
- errorFallback: l,
312
- onError: u,
313
- analytics: d,
314
- disclosuresAcceptance: f,
315
- widgetName: _,
316
- children: /* @__PURE__ */ w(ve, { ...p })
317
- });
318
- }
319
- function ve(e) {
320
- let { initResponse: t } = d(), n = t?.userId ?? null, [r, i] = C(n), [a, o] = C(0);
321
- return n !== r && (i(n), r !== null && n !== null && o((e) => e + 1)), /* @__PURE__ */ w(oe, { children: /* @__PURE__ */ w(E, { ...e }, a) }, a);
322
- }
323
29
  //#endregion
324
- export { D as BankAccountOnboardingWidget, D as default };
30
+ export { t as DEFAULT_LABELS };