@tesouro/embedded-components-react 0.2.266 → 0.2.269
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.
- package/README.md +15 -12
- package/dist/experimental/WidgetSuite.d.ts +25 -1
- package/dist/experimental/index.d.ts +25 -1
- package/dist/index.css +45 -9
- package/dist/index.d.ts +46 -22
- package/dist/index.js +1 -1
- package/dist/lib/AcceptDisclosuresWidget.d.ts +25 -1
- package/dist/lib/BalancesWidget.d.ts +24 -0
- package/dist/lib/BankAccountOnboardingWidget.d.ts +25 -1
- package/dist/lib/BankAccountsWidget.d.ts +25 -1
- package/dist/lib/BillPayWidget.d.ts +24 -0
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/lib/CardDetailsWidget.d.ts +25 -1
- package/dist/lib/CardsWidget.d.ts +25 -1
- package/dist/lib/ChartOfAccountsWidget.d.ts +25 -1
- package/dist/lib/CounterpartsWidget.d.ts +25 -1
- package/dist/lib/CreateCardWidget.d.ts +25 -1
- package/dist/lib/ExpenseApprovalPoliciesWidget.d.ts +25 -1
- package/dist/lib/ExpenseManagementWidget.d.ts +25 -1
- package/dist/lib/ExpenseRequirementsWidget.d.ts +25 -1
- package/dist/lib/HelpWidget.d.ts +25 -1
- package/dist/lib/InsightsWidget.d.ts +24 -0
- package/dist/lib/InvoicingWidget.d.ts +25 -1
- package/dist/lib/LinkedAccountsWidget.d.ts +25 -1
- package/dist/lib/ProductsWidget.d.ts +25 -1
- package/dist/lib/ProfileWidget.d.ts +25 -1
- package/dist/lib/ReceiptMatchWidget.d.ts +25 -1
- package/dist/lib/ReceivablesWidget.d.ts +25 -1
- package/dist/lib/SettingsWidget.d.ts +25 -1
- package/dist/lib/TagsWidget.d.ts +25 -1
- package/dist/lib/TeamWidget.d.ts +25 -1
- package/dist/lib/TransfersWidget.d.ts +24 -0
- package/dist/lib/WidgetProvider.d.ts +25 -1
- package/dist/lib/WidgetProviderPublic.d.ts +24 -0
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +122 -121
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +99 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +7 -97
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +99 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +2 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +44 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +1 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +48 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +9 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +8 -91
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +6 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +7 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +100 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +3 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +6 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +9 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +83 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +2 -111
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +8 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +104 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +37 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +15 -116
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +126 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +32 -69
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +0 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +34 -69
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +261 -181
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +32 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index7.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js +94 -93
- package/dist/libs/tesouro-embedded-components-react/expense-approval-policies-widget/feature/dist/lib/ExpenseApprovalPoliciesWidgetFeature.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index3.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/expense-receipt-match-widget/feature/dist/lib/ReceiptMatchWidget.js +12 -11
- package/dist/libs/tesouro-embedded-components-react/expense-requirements-widget/feature/dist/lib/ExpenseRequirementsWidget.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/feature/dist/index8.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/help-widget/feature/dist/index3.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index8.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/profile-widget/feature/dist/index4.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +22 -21
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/widgetGatewayHosts.js +14 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +76 -67
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +107 -101
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/client.js +12 -4
- package/dist/libs/tesouro-embedded-components-react/tags-widget/feature/dist/index11.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index17.js +106 -105
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index6.js +9 -8
- package/package.json +1 -1
|
@@ -9,32 +9,32 @@ import { useAnalyticsTrack as i } from "../../../shared/feature/dist/lib/analyti
|
|
|
9
9
|
import { WidgetProvider as a } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
10
10
|
import { getStateOptions as o } from "../../../shared/util/dist/lib/usStates.js";
|
|
11
11
|
import { extractApiErrorMessage as s } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
12
|
-
import { useRefetchWidget as
|
|
13
|
-
import { getNaicsOptions as
|
|
12
|
+
import { useRefetchWidget as ee, useWidgetConfig as c } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
13
|
+
import { getNaicsOptions as l } from "../../../shared/feature/dist/lib/naicsCodeMap.js";
|
|
14
14
|
import "../../../shared/feature/dist/index.js";
|
|
15
|
-
import { ADDITIONAL_OWNERS_LABELS_EN as
|
|
16
|
-
import { interpolateBankName as
|
|
17
|
-
import { ResultStep as
|
|
18
|
-
import { MarketingWidget as
|
|
15
|
+
import { ADDITIONAL_OWNERS_LABELS_EN as u } from "../../ui/dist/index4.js";
|
|
16
|
+
import { interpolateBankName as d } from "../../ui/dist/index6.js";
|
|
17
|
+
import { ResultStep as te } from "../../ui/dist/index11.js";
|
|
18
|
+
import { MarketingWidget as ne } from "../../ui/dist/index28.js";
|
|
19
19
|
import "../../ui/dist/index.js";
|
|
20
|
-
import { BusinessDetailsStep as
|
|
21
|
-
import { PersonalDetailsStep as
|
|
22
|
-
import { AdditionalOwnersStep as
|
|
23
|
-
import { buildCreateApplicationBody as
|
|
24
|
-
import { OnboardingAnalyticsEvent as
|
|
25
|
-
import { DEFAULT_LABELS as
|
|
26
|
-
import { ApplicationClientSecretProvider as
|
|
27
|
-
import { useCreateApplication as
|
|
28
|
-
import { useUpdateApplication as
|
|
29
|
-
import { useSubmitApplication as
|
|
30
|
-
import { usePollApplicationCompletion as
|
|
31
|
-
import { OnboardingSuppressionReason as
|
|
32
|
-
import { useOrganizationOnboardingSuppression as
|
|
20
|
+
import { BusinessDetailsStep as re } from "./index9.js";
|
|
21
|
+
import { PersonalDetailsStep as ie } from "./index11.js";
|
|
22
|
+
import { AdditionalOwnersStep as ae } from "./index13.js";
|
|
23
|
+
import { buildCreateApplicationBody as oe, buildUpdateApplicationBody as se } from "./index14.js";
|
|
24
|
+
import { OnboardingAnalyticsEvent as f, WIDGET_NAME as p } from "./index15.js";
|
|
25
|
+
import { DEFAULT_LABELS as m } from "./index16.js";
|
|
26
|
+
import { ApplicationClientSecretProvider as ce, useApplicationClientSecret as le } from "../../data-access/dist/index2.js";
|
|
27
|
+
import { useCreateApplication as ue } from "../../data-access/dist/index4.js";
|
|
28
|
+
import { useUpdateApplication as de } from "../../data-access/dist/index6.js";
|
|
29
|
+
import { useSubmitApplication as fe } from "../../data-access/dist/index7.js";
|
|
30
|
+
import { usePollApplicationCompletion as pe } from "../../data-access/dist/index8.js";
|
|
31
|
+
import { OnboardingSuppressionReason as h } from "../../data-access/dist/index9.js";
|
|
32
|
+
import { useOrganizationOnboardingSuppression as me } from "../../data-access/dist/index10.js";
|
|
33
33
|
import "../../data-access/dist/index.js";
|
|
34
|
-
import { useCallback as
|
|
35
|
-
import { Fragment as
|
|
34
|
+
import { useCallback as g, useEffect as _, useMemo as v, useRef as he, useState as y } from "react";
|
|
35
|
+
import { Fragment as ge, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
36
36
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js
|
|
37
|
-
var
|
|
37
|
+
var _e = {
|
|
38
38
|
companyLegalName: "",
|
|
39
39
|
companyDbaName: "",
|
|
40
40
|
businessAddress: "",
|
|
@@ -48,7 +48,7 @@ var ge = {
|
|
|
48
48
|
naicsCode: "",
|
|
49
49
|
isAuthorized: null,
|
|
50
50
|
isCheckboxChecked: !1
|
|
51
|
-
},
|
|
51
|
+
}, ve = {
|
|
52
52
|
firstName: "",
|
|
53
53
|
lastName: "",
|
|
54
54
|
dateOfBirth: void 0,
|
|
@@ -62,7 +62,7 @@ var ge = {
|
|
|
62
62
|
ownsOver25Percent: null,
|
|
63
63
|
ownershipPercentage: null
|
|
64
64
|
};
|
|
65
|
-
function
|
|
65
|
+
function ye(e, t) {
|
|
66
66
|
if (e === 0) return {
|
|
67
67
|
title: t.businessReviewTitle,
|
|
68
68
|
subtitle: t.businessReviewSubtitle
|
|
@@ -72,7 +72,7 @@ function ve(e, t) {
|
|
|
72
72
|
subtitle: t.personalReviewSubtitle
|
|
73
73
|
};
|
|
74
74
|
let n = {
|
|
75
|
-
...
|
|
75
|
+
...u,
|
|
76
76
|
...t.additionalOwners
|
|
77
77
|
};
|
|
78
78
|
return {
|
|
@@ -80,55 +80,55 @@ function ve(e, t) {
|
|
|
80
80
|
subtitle: n.subheading
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
let
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}, [
|
|
88
|
-
let
|
|
89
|
-
...
|
|
90
|
-
...
|
|
83
|
+
function be({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboard: u, labels: p, initialBusinessDetails: ce, initialPersonalDetails: be, initialAdditionalOwners: S, bankLogoSrc: xe, disclosureLinks: Se, marketingContent: C = null, open: Ce, defaultOpen: we, onOpenChange: w }) {
|
|
84
|
+
let T = i();
|
|
85
|
+
_(() => {
|
|
86
|
+
T(f.Mounted);
|
|
87
|
+
}, [T]);
|
|
88
|
+
let E = {
|
|
89
|
+
...m,
|
|
90
|
+
...p,
|
|
91
91
|
stepIndicator: {
|
|
92
|
-
...
|
|
93
|
-
...
|
|
92
|
+
...m.stepIndicator,
|
|
93
|
+
...p?.stepIndicator
|
|
94
94
|
},
|
|
95
|
-
businessDetails:
|
|
96
|
-
personalDetails:
|
|
97
|
-
additionalOwners:
|
|
95
|
+
businessDetails: p?.businessDetails ?? {},
|
|
96
|
+
personalDetails: p?.personalDetails ?? {},
|
|
97
|
+
additionalOwners: p?.additionalOwners ?? {},
|
|
98
98
|
result: {
|
|
99
|
-
...
|
|
100
|
-
...
|
|
99
|
+
...m.result,
|
|
100
|
+
...p?.result
|
|
101
101
|
}
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
}, [
|
|
105
|
-
|
|
106
|
-
}, [
|
|
107
|
-
|
|
108
|
-
}, []), ze =
|
|
109
|
-
|
|
110
|
-
}, [j,
|
|
111
|
-
|
|
112
|
-
}, [a]), Ve =
|
|
113
|
-
...ge,
|
|
114
|
-
...oe
|
|
115
|
-
})), [P, We] = b(() => ({
|
|
102
|
+
}, D = c().initResponse, { termsHref: Te, privacyHref: Ee, electronicCommunicationHref: De, patriotActHref: Oe } = Se ?? {}, ke = C !== null, O = Ce === void 0, [Ae, k] = y(!1), [je, Me] = y(!0), [Ne, Pe] = y(() => we ?? !1), Fe = xe ?? C?.bankLogoSrc ?? void 0, A = O ? Ne : Ce, Ie = we ?? !1, j = g((e) => {
|
|
103
|
+
O && Pe(e), w?.(e);
|
|
104
|
+
}, [w, O]), Le = g(() => {
|
|
105
|
+
T(f.OpenMarketing), k(!0);
|
|
106
|
+
}, [T]), Re = g(() => {
|
|
107
|
+
k(!1);
|
|
108
|
+
}, []), ze = g(() => {
|
|
109
|
+
T(f.BeginOnboarding), k(!1), j(!0);
|
|
110
|
+
}, [j, T]), Be = g(() => {
|
|
111
|
+
Me(!1), a();
|
|
112
|
+
}, [a]), Ve = ee(), [M, N] = y(0), [He, Ue] = y(() => ({
|
|
116
113
|
..._e,
|
|
117
|
-
...
|
|
118
|
-
})), [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
114
|
+
...ce
|
|
115
|
+
})), [P, We] = y(() => ({
|
|
116
|
+
...ve,
|
|
117
|
+
...be
|
|
118
|
+
})), [Ge, Ke] = y(() => S ?? []), [F, qe] = y(null), [I, Je] = y(null), [L, Ye] = y(null), [R, Xe] = y(null), [Ze, z] = y(null), [B, V] = y(!1), [H, U] = y(null), W = ue(), G = de(), K = fe(), Qe = pe(), { setClientSecret: $e } = le(), q = me(), J = he(null);
|
|
119
|
+
_(() => () => J.current?.abort(), []);
|
|
120
|
+
let et = v(() => l(E.businessDetails.naicsTitles), [E.businessDetails.naicsTitles]), tt = v(() => o(E.businessDetails.stateTitles), [E.businessDetails.stateTitles]), nt = v(() => o(E.personalDetails.stateTitles), [E.personalDetails.stateTitles]), rt = v(() => o(E.additionalOwners.stateTitles), [E.additionalOwners.stateTitles]), Y = B || H !== null, it = D?.status === "ACTIVE" || D?.status === "INACTIVE", X = D?.status === "INVITED", Z = !!D && !Y && (it || X || q.isSuppressed), Q = Z ? it ? h.UserAlreadyOnboarded : X ? h.UserInvitedToOrganization : q.reason : null;
|
|
121
|
+
if (_(() => {
|
|
122
|
+
!Z || !Q || (T(f.Suppressed, { reason: Q }), console.info(`[onboarding] not shown: ${Q}`));
|
|
123
123
|
}, [
|
|
124
124
|
Z,
|
|
125
125
|
Q,
|
|
126
|
-
|
|
127
|
-
]), !
|
|
126
|
+
T
|
|
127
|
+
]), !D || !Y && (Z || !q.isResolved)) return null;
|
|
128
128
|
let at = F?.companyStructure === "SOLE_PROPRIETORSHIP", ot = [
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
E.stepIndicator.business,
|
|
130
|
+
E.stepIndicator.personal,
|
|
131
|
+
E.stepIndicator.ownership
|
|
132
132
|
], st = M === 0 ? F : M === 1 ? I : M === 2 ? L : null, $ = W.isPending || G.isPending || K.isPending || B, ct = () => {
|
|
133
133
|
z(null), N((e) => e === 0 ? 0 : e - 1);
|
|
134
134
|
}, lt = () => {
|
|
@@ -141,7 +141,7 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
|
|
|
141
141
|
try {
|
|
142
142
|
let r = await K.mutateAsync({ path: { id: e } });
|
|
143
143
|
if (t.signal.aborted) return;
|
|
144
|
-
if (!r.id) throw Error(
|
|
144
|
+
if (!r.id) throw Error(E.submitFailedError);
|
|
145
145
|
n = !0, (await Qe(e, { signal: t.signal })).status === "complete" ? (U("success"), Ve(), Be()) : U("pending");
|
|
146
146
|
} catch (e) {
|
|
147
147
|
if (e instanceof DOMException && e.name === "AbortError") return;
|
|
@@ -157,7 +157,7 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
|
|
|
157
157
|
if (!F) return;
|
|
158
158
|
let e = R;
|
|
159
159
|
if (!e) {
|
|
160
|
-
let t = await W.mutateAsync({ body:
|
|
160
|
+
let t = await W.mutateAsync({ body: oe(F) });
|
|
161
161
|
e = t.id, Xe(e), t.clientSecret && $e(t.clientSecret);
|
|
162
162
|
}
|
|
163
163
|
N(1);
|
|
@@ -165,7 +165,7 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
|
|
|
165
165
|
if (!I || !F || !R) return;
|
|
166
166
|
await G.mutateAsync({
|
|
167
167
|
path: { id: R },
|
|
168
|
-
body:
|
|
168
|
+
body: se({
|
|
169
169
|
businessDetails: F,
|
|
170
170
|
applicant: I
|
|
171
171
|
})
|
|
@@ -174,28 +174,28 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
|
|
|
174
174
|
if (!L || !R) return;
|
|
175
175
|
await G.mutateAsync({
|
|
176
176
|
path: { id: R },
|
|
177
|
-
body:
|
|
177
|
+
body: se({ businessOwners: L })
|
|
178
178
|
}), await ut(R);
|
|
179
179
|
}
|
|
180
180
|
} catch (e) {
|
|
181
|
-
let t = s(e) ?? (e instanceof Error ? e.message : void 0) ??
|
|
181
|
+
let t = s(e) ?? (e instanceof Error ? e.message : void 0) ?? E.genericRetryError;
|
|
182
182
|
z(t);
|
|
183
183
|
}
|
|
184
|
-
}, ft =
|
|
184
|
+
}, ft = ye(Math.min(M, 2), E), pt = D.bankName?.trim() || E.fallbackBankName, mt = d(E.shellFdicDisclaimer, pt);
|
|
185
185
|
if (Y) {
|
|
186
|
-
let r = F?.companyLegalName ?? "", i =
|
|
187
|
-
...
|
|
188
|
-
...
|
|
186
|
+
let r = F?.companyLegalName ?? "", i = D.bankName?.trim() || E.fallbackBankName, a = H ?? "pending", o = a === "success", s = {
|
|
187
|
+
...m.result,
|
|
188
|
+
...E.result
|
|
189
189
|
};
|
|
190
|
-
return /* @__PURE__ */
|
|
191
|
-
open:
|
|
190
|
+
return /* @__PURE__ */ b(e, {
|
|
191
|
+
open: A,
|
|
192
192
|
onOpenChange: j,
|
|
193
|
-
children: /* @__PURE__ */
|
|
193
|
+
children: /* @__PURE__ */ x(t, {
|
|
194
194
|
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",
|
|
195
|
-
children: [/* @__PURE__ */
|
|
195
|
+
children: [/* @__PURE__ */ b(n, {
|
|
196
196
|
className: "ttw:sr-only",
|
|
197
|
-
children:
|
|
198
|
-
}), /* @__PURE__ */
|
|
197
|
+
children: E.modalTitle
|
|
198
|
+
}), /* @__PURE__ */ b(te, {
|
|
199
199
|
status: a,
|
|
200
200
|
isLoading: B,
|
|
201
201
|
loadingMessage: s.loadingMessage,
|
|
@@ -205,32 +205,32 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
|
|
|
205
205
|
followUpEmail: I?.workEmail ?? "",
|
|
206
206
|
emailBoxLead: s.pendingEmailBoxLead,
|
|
207
207
|
navigateToDashboardLabel: s.navigateToDashboard,
|
|
208
|
-
bankLogoSrc:
|
|
209
|
-
bankLogoAlt:
|
|
210
|
-
fdicDisclaimer:
|
|
211
|
-
onNavigateToDashboard:
|
|
208
|
+
bankLogoSrc: Fe,
|
|
209
|
+
bankLogoAlt: d(s.bankLogoAlt, i),
|
|
210
|
+
fdicDisclaimer: d(s.fdicDisclaimer, i),
|
|
211
|
+
onNavigateToDashboard: u
|
|
212
212
|
})]
|
|
213
213
|
})
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
|
-
let ht = M === 2 ?
|
|
217
|
-
return /* @__PURE__ */
|
|
218
|
-
open:
|
|
216
|
+
let ht = M === 2 ? E.submit : E.next, gt = st === null || $;
|
|
217
|
+
return /* @__PURE__ */ x(ge, { children: [ke && je && C ? /* @__PURE__ */ b(ne, {
|
|
218
|
+
open: Ae,
|
|
219
219
|
isVisible: !0,
|
|
220
|
-
vspLogo:
|
|
221
|
-
bankingText:
|
|
222
|
-
primaryCaption:
|
|
223
|
-
secondaryCaption:
|
|
224
|
-
providedByCaption:
|
|
225
|
-
modalPrimaryImg:
|
|
226
|
-
primaryModalHeader:
|
|
227
|
-
benefits:
|
|
228
|
-
appearance:
|
|
220
|
+
vspLogo: C.vspLogo,
|
|
221
|
+
bankingText: C.bankingText,
|
|
222
|
+
primaryCaption: C.primaryCaption,
|
|
223
|
+
secondaryCaption: C.secondaryCaption,
|
|
224
|
+
providedByCaption: C.providedByCaption,
|
|
225
|
+
modalPrimaryImg: C.modalPrimaryImg,
|
|
226
|
+
primaryModalHeader: C.primaryModalHeader,
|
|
227
|
+
benefits: C.benefits,
|
|
228
|
+
appearance: C.appearance,
|
|
229
229
|
onOpenMarketingModal: Le,
|
|
230
230
|
onCloseMarketingModal: Re,
|
|
231
231
|
onPrimaryCtaClick: ze
|
|
232
|
-
}) : null, /* @__PURE__ */
|
|
233
|
-
open:
|
|
232
|
+
}) : null, /* @__PURE__ */ x(r, {
|
|
233
|
+
open: A,
|
|
234
234
|
defaultOpen: Ie,
|
|
235
235
|
onOpenChange: j,
|
|
236
236
|
title: ft.title,
|
|
@@ -248,33 +248,33 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
|
|
|
248
248
|
nextIcon: null,
|
|
249
249
|
errorMessage: Ze,
|
|
250
250
|
labels: {
|
|
251
|
-
backButton: M === 0 ?
|
|
252
|
-
cancelButton:
|
|
251
|
+
backButton: M === 0 ? E.cancel : E.back,
|
|
252
|
+
cancelButton: E.cancel
|
|
253
253
|
},
|
|
254
254
|
children: [
|
|
255
|
-
M === 0 ? /* @__PURE__ */
|
|
255
|
+
M === 0 ? /* @__PURE__ */ b(re, {
|
|
256
256
|
value: He,
|
|
257
257
|
onValueChange: Ue,
|
|
258
258
|
onSnapshotChange: qe,
|
|
259
259
|
naicsOptions: et,
|
|
260
260
|
stateOptions: tt,
|
|
261
261
|
isSubmitting: $,
|
|
262
|
-
labels:
|
|
262
|
+
labels: E.businessDetails,
|
|
263
263
|
bankName: pt,
|
|
264
|
-
termsHref:
|
|
265
|
-
privacyHref:
|
|
266
|
-
electronicCommunicationHref:
|
|
267
|
-
patriotActHref:
|
|
264
|
+
termsHref: Te,
|
|
265
|
+
privacyHref: Ee,
|
|
266
|
+
electronicCommunicationHref: De,
|
|
267
|
+
patriotActHref: Oe
|
|
268
268
|
}, "business") : null,
|
|
269
|
-
M === 1 ? /* @__PURE__ */
|
|
269
|
+
M === 1 ? /* @__PURE__ */ b(ie, {
|
|
270
270
|
value: P,
|
|
271
271
|
onValueChange: We,
|
|
272
272
|
onSnapshotChange: Je,
|
|
273
273
|
stateOptions: nt,
|
|
274
274
|
isSubmitting: $,
|
|
275
|
-
labels:
|
|
275
|
+
labels: E.personalDetails
|
|
276
276
|
}, "personal") : null,
|
|
277
|
-
M === 2 ? /* @__PURE__ */
|
|
277
|
+
M === 2 ? /* @__PURE__ */ b(ae, {
|
|
278
278
|
owners: Ge,
|
|
279
279
|
onOwnersChange: Ke,
|
|
280
280
|
primaryOwnerName: `${P.firstName} ${P.lastName}`.trim(),
|
|
@@ -282,30 +282,31 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
|
|
|
282
282
|
stateOptions: rt,
|
|
283
283
|
onSnapshotChange: Ye,
|
|
284
284
|
isSubmitting: $,
|
|
285
|
-
labels:
|
|
285
|
+
labels: E.additionalOwners
|
|
286
286
|
}) : null
|
|
287
287
|
]
|
|
288
288
|
})] });
|
|
289
289
|
}
|
|
290
|
-
function
|
|
291
|
-
return /* @__PURE__ */
|
|
290
|
+
function S({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: o, implementation: s, uiFramework: ee, errorFallback: c, onError: l, analytics: u, ...d }) {
|
|
291
|
+
return /* @__PURE__ */ b(a, {
|
|
292
292
|
baseUrl: e,
|
|
293
293
|
widgetToken: t,
|
|
294
294
|
organizationId: n,
|
|
295
295
|
configClient: r,
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
296
|
+
gatewayRouting: i,
|
|
297
|
+
linkComponent: o,
|
|
298
|
+
implementation: s,
|
|
299
|
+
uiFramework: ee,
|
|
299
300
|
errorFallback: c,
|
|
300
301
|
onError: l,
|
|
301
302
|
analytics: u,
|
|
302
|
-
widgetName:
|
|
303
|
-
children: /* @__PURE__ */
|
|
303
|
+
widgetName: p,
|
|
304
|
+
children: /* @__PURE__ */ b(xe, { ...d })
|
|
304
305
|
});
|
|
305
306
|
}
|
|
306
|
-
function
|
|
307
|
-
let { initResponse: t } =
|
|
308
|
-
return n !== r && (i(n), r !== null && n !== null && o((e) => e + 1)), /* @__PURE__ */
|
|
307
|
+
function xe(e) {
|
|
308
|
+
let { initResponse: t } = c(), n = t?.userId ?? null, [r, i] = y(n), [a, o] = y(0);
|
|
309
|
+
return n !== r && (i(n), r !== null && n !== null && o((e) => e + 1)), /* @__PURE__ */ b(ce, { children: /* @__PURE__ */ b(be, { ...e }, a) }, a);
|
|
309
310
|
}
|
|
310
311
|
//#endregion
|
|
311
|
-
export {
|
|
312
|
+
export { S as BankAccountOnboardingWidget, S as default };
|
package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js
CHANGED
|
@@ -45,20 +45,21 @@ function l({ labels: t, accountDetailsLabels: n, featureLabels: l, isBankingTagl
|
|
|
45
45
|
...C
|
|
46
46
|
})] });
|
|
47
47
|
}
|
|
48
|
-
function u({ baseUrl: e, widgetToken: r, organizationId: i, configClient: a,
|
|
48
|
+
function u({ baseUrl: e, widgetToken: r, organizationId: i, configClient: a, gatewayRouting: o, linkComponent: c, implementation: u, uiFramework: d, errorFallback: f, onError: p, analytics: m, ...h }) {
|
|
49
49
|
return /* @__PURE__ */ s(t, {
|
|
50
50
|
widgetName: n,
|
|
51
51
|
baseUrl: e,
|
|
52
52
|
widgetToken: r,
|
|
53
53
|
organizationId: i,
|
|
54
54
|
configClient: a,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
gatewayRouting: o,
|
|
56
|
+
linkComponent: c,
|
|
57
|
+
implementation: u,
|
|
58
|
+
uiFramework: d,
|
|
59
|
+
errorFallback: f,
|
|
60
|
+
onError: p,
|
|
61
|
+
analytics: m,
|
|
62
|
+
children: /* @__PURE__ */ s(l, { ...h })
|
|
62
63
|
});
|
|
63
64
|
}
|
|
64
65
|
//#endregion
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import "./index2.js";
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
4
|
-
import "./index11.js";
|
|
2
|
+
import "./index8.js";
|
|
3
|
+
import "./index10.js";
|
|
5
4
|
import "./index12.js";
|
|
6
|
-
import "./
|
|
5
|
+
import "./index13.js";
|
|
7
6
|
import "./index17.js";
|
|
8
|
-
import "./index18.js";
|
|
9
7
|
import "./index19.js";
|
|
10
8
|
import "./index20.js";
|
|
11
9
|
import "./index21.js";
|
|
12
10
|
import "./index22.js";
|
|
13
11
|
import "./index23.js";
|
|
14
12
|
import "./index24.js";
|
|
15
|
-
import
|
|
13
|
+
import "./index25.js";
|
|
14
|
+
import "./index26.js";
|
|
15
|
+
import { BillPayWidget as e } from "./index30.js";
|
|
16
16
|
export { e as BillPayWidget };
|
|
@@ -1,9 +1,101 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { calculateTotal as e, displayLineAmount as t } from "./index6.js";
|
|
6
|
+
import { emptyLineItem as n, mapPayableToBillForm as r } from "./index9.js";
|
|
7
|
+
import { useCallback as i, useEffect as a, useMemo as o, useState as s } from "react";
|
|
1
8
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
function c({ payable: c, lineItems: l } = {}) {
|
|
10
|
+
let u = o(() => r({
|
|
11
|
+
payable: c ?? {},
|
|
12
|
+
lineItems: l ?? []
|
|
13
|
+
}), [c, l]), [d, f] = s(u.values), [p, m] = s(u.lineItems), [h, g] = s(u.discount), [_, v] = s(u.tax), [y, b] = s(), [x, S] = s(), [C, w] = s(), [T, E] = s(!1), [D, O] = s(!1), [k, A] = s(!1);
|
|
14
|
+
a(() => {
|
|
15
|
+
T || f(u.values);
|
|
16
|
+
}, [u]), a(() => {
|
|
17
|
+
D || m(u.lineItems);
|
|
18
|
+
}, [u]), a(() => {
|
|
19
|
+
k || (g(u.discount), v(u.tax));
|
|
20
|
+
}, [u]);
|
|
21
|
+
let j = i((e) => {
|
|
22
|
+
f((t) => ({
|
|
23
|
+
...t,
|
|
24
|
+
...e
|
|
25
|
+
})), E(!0);
|
|
26
|
+
}, []), M = i((e) => {
|
|
27
|
+
w((t) => {
|
|
28
|
+
if (!t?.[e]) return t;
|
|
29
|
+
let n = { ...t };
|
|
30
|
+
return delete n[e], Object.keys(n).length ? n : void 0;
|
|
31
|
+
});
|
|
32
|
+
}, []), N = i((e, n) => {
|
|
33
|
+
M(e), m((r) => r.map((r) => {
|
|
34
|
+
if (r.id !== e) return r;
|
|
35
|
+
let i = {
|
|
36
|
+
...r,
|
|
37
|
+
...n
|
|
38
|
+
};
|
|
39
|
+
return "amount" in n ? i : {
|
|
40
|
+
...i,
|
|
41
|
+
amount: t(i.quantity, i.price)
|
|
42
|
+
};
|
|
43
|
+
})), O(!0), b(void 0);
|
|
44
|
+
}, [M]), P = i((e, n) => {
|
|
45
|
+
M(e), m((r) => r.map((r) => {
|
|
46
|
+
if (r.id !== e) return r;
|
|
47
|
+
let i = Number.parseFloat(r.quantity), a = String(Math.max(1, (Number.isFinite(i) ? i : 1) + n));
|
|
48
|
+
return {
|
|
49
|
+
...r,
|
|
50
|
+
quantity: a,
|
|
51
|
+
amount: t(a, r.price)
|
|
52
|
+
};
|
|
53
|
+
})), O(!0), b(void 0);
|
|
54
|
+
}, [M]), F = i((e) => {
|
|
55
|
+
M(e), m((t) => t.length <= 1 ? t : t.filter((t) => t.id !== e)), O(!0), b(void 0);
|
|
56
|
+
}, [M]), I = i(() => {
|
|
57
|
+
m((e) => [...e, n()]), O(!0), b(void 0);
|
|
58
|
+
}, []), L = i((e) => {
|
|
59
|
+
g(e), A(!0), b(void 0);
|
|
60
|
+
}, []), R = i((e) => {
|
|
61
|
+
v(e), A(!0), b(void 0);
|
|
62
|
+
}, []), z = i((e) => {
|
|
63
|
+
b(e), A(!0);
|
|
64
|
+
}, []), B = o(() => p.map((e) => ({
|
|
65
|
+
...e,
|
|
66
|
+
onChange: (t) => N(e.id, t),
|
|
67
|
+
onQuantityStep: (t) => P(e.id, t),
|
|
68
|
+
onRemove: () => F(e.id)
|
|
69
|
+
})), [
|
|
70
|
+
p,
|
|
71
|
+
N,
|
|
72
|
+
F,
|
|
73
|
+
P
|
|
74
|
+
]), V = o(() => e(p, _, h), [
|
|
75
|
+
p,
|
|
76
|
+
_,
|
|
77
|
+
h
|
|
78
|
+
]);
|
|
79
|
+
return {
|
|
80
|
+
values: d,
|
|
81
|
+
errors: x,
|
|
82
|
+
setErrors: S,
|
|
83
|
+
lineItemErrors: C,
|
|
84
|
+
setLineItemErrors: w,
|
|
85
|
+
onChange: j,
|
|
86
|
+
lineItems: p,
|
|
87
|
+
lineItemRows: B,
|
|
88
|
+
discount: h,
|
|
89
|
+
onDiscountChange: L,
|
|
90
|
+
tax: _,
|
|
91
|
+
onTaxChange: R,
|
|
92
|
+
total: y ?? V,
|
|
93
|
+
totalOverride: y,
|
|
94
|
+
onTotalChange: z,
|
|
95
|
+
onAddLineItem: I,
|
|
96
|
+
isTotalsDirty: k,
|
|
97
|
+
isDirty: T || D || k
|
|
98
|
+
};
|
|
99
|
+
}
|
|
8
100
|
//#endregion
|
|
9
|
-
export {
|
|
101
|
+
export { c as useBillForm };
|
|
@@ -1,99 +1,9 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { useLedgerAccountsQuery as e } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
|
|
6
|
-
import { usePaymentTermsQuery as t } from "../../../shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js";
|
|
7
|
-
import "../../../shared/data-access/dist/index.js";
|
|
8
|
-
import { BILL_CREATE_SCREEN_LABELS_EN as n } from "./index2.js";
|
|
9
|
-
import { useAllPayableLineItemsQuery as r } from "../../data-access/dist/index6.js";
|
|
10
|
-
import { usePayableQuery as i } from "../../data-access/dist/index10.js";
|
|
11
|
-
import "../../data-access/dist/index.js";
|
|
12
|
-
import { useBillCreateController as a } from "./index7.js";
|
|
13
|
-
import { useBillForm as o } from "./index9.js";
|
|
14
|
-
import { BillCreateScreen as s } from "../../ui/dist/index28.js";
|
|
15
|
-
import { ExtractionNotice as c } from "../../ui/dist/index45.js";
|
|
16
|
-
import "../../ui/dist/index.js";
|
|
17
|
-
import { SourceDocumentContainer as l } from "./index3.js";
|
|
18
|
-
import { useVendorSectionProps as u } from "./index5.js";
|
|
19
|
-
import { billCreateTestIds as d } from "./index10.js";
|
|
20
|
-
import { useCallback as f, useEffect as p, useMemo as m, useState as h } from "react";
|
|
21
|
-
import { jsx as g } from "react/jsx-runtime";
|
|
22
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
lineItems: M.lineItems
|
|
30
|
-
}), L = F?.counterpart_id;
|
|
31
|
-
p(() => {
|
|
32
|
-
w || L && (C(L), T(!0));
|
|
33
|
-
}, [w, L]);
|
|
34
|
-
let R = f((e) => {
|
|
35
|
-
T(!0), C(e);
|
|
36
|
-
}, []), z = P.data?.data?.find((e) => e.id === I.values.paymentTerms), B = m(() => (P.data?.data ?? []).filter((e) => !!(e.id && e.name)).map((e) => ({
|
|
37
|
-
value: e.id,
|
|
38
|
-
label: e.name
|
|
39
|
-
})), [P.data]), V = a({
|
|
40
|
-
payableId: y,
|
|
41
|
-
form: I,
|
|
42
|
-
paymentTerm: z,
|
|
43
|
-
counterpartId: S,
|
|
44
|
-
onPayableCreated: k,
|
|
45
|
-
onSaved: k,
|
|
46
|
-
onDraftSaved: () => v(!1),
|
|
47
|
-
onFinalized: () => v(!1)
|
|
48
|
-
}), H = m(() => (N.data?.data ?? []).map((e) => ({
|
|
49
|
-
value: e.id,
|
|
50
|
-
label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
|
|
51
|
-
})), [N.data]), U = F?.source_of_payable_data === "ocr", W = F?.counterpart_raw_data?.name, G = () => {
|
|
52
|
-
I.isDirty && !window.confirm(x.discardConfirm) || v(!1);
|
|
53
|
-
}, K = u({
|
|
54
|
-
payableId: A,
|
|
55
|
-
counterpartId: S,
|
|
56
|
-
payableCounterpartId: L,
|
|
57
|
-
onCounterpartChange: R
|
|
58
|
-
});
|
|
59
|
-
return /* @__PURE__ */ g(s, {
|
|
60
|
-
open: _,
|
|
61
|
-
onOpenChange: (e) => e ? v(!0) : G(),
|
|
62
|
-
title: U && W ? x.extractedTitle(W) : x.newTitle,
|
|
63
|
-
notice: U && !E ? /* @__PURE__ */ g(c, { onDismiss: () => D(!0) }) : void 0,
|
|
64
|
-
vendor: {
|
|
65
|
-
...K,
|
|
66
|
-
testId: d.vendorSection
|
|
67
|
-
},
|
|
68
|
-
values: I.values,
|
|
69
|
-
errors: I.errors,
|
|
70
|
-
onChange: I.onChange,
|
|
71
|
-
paymentTermOptions: B,
|
|
72
|
-
lineItems: {
|
|
73
|
-
items: I.lineItemRows,
|
|
74
|
-
glCodeOptions: H,
|
|
75
|
-
totalAmountLabel: I.totalAmountLabel,
|
|
76
|
-
onAddLineItem: I.onAddLineItem,
|
|
77
|
-
testId: d.lineItems
|
|
78
|
-
},
|
|
79
|
-
documentPanel: /* @__PURE__ */ g(l, {
|
|
80
|
-
payableId: A,
|
|
81
|
-
isDocumentPending: !!A && !F?.file && (j.isLoading || F?.ocr_status === "processing"),
|
|
82
|
-
file: F?.file ? {
|
|
83
|
-
id: F.file.id,
|
|
84
|
-
name: F.file.name,
|
|
85
|
-
url: F.file.url,
|
|
86
|
-
mimetype: F.file.mimetype
|
|
87
|
-
} : void 0
|
|
88
|
-
}),
|
|
89
|
-
isLineItemsLoading: M.isResolving,
|
|
90
|
-
isSavingDraft: V.isSavingDraft,
|
|
91
|
-
isFinalizing: V.isFinalizing,
|
|
92
|
-
onCancel: G,
|
|
93
|
-
onSaveDraft: V.saveDraft,
|
|
94
|
-
onFinalize: V.finalize,
|
|
95
|
-
testId: d.dialog
|
|
96
|
-
});
|
|
97
|
-
}
|
|
2
|
+
var e = {
|
|
3
|
+
dialog: "bill-pay-bill-create-dialog",
|
|
4
|
+
vendorSection: "bill-pay-bill-create-vendor",
|
|
5
|
+
lineItems: "bill-pay-bill-create-line-items",
|
|
6
|
+
documentPanel: "bill-pay-bill-create-document"
|
|
7
|
+
};
|
|
98
8
|
//#endregion
|
|
99
|
-
export {
|
|
9
|
+
export { e as billCreateTestIds };
|