@tesouro/embedded-components-react 0.5.171 → 0.5.172
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/dist/index.d.ts +18 -0
- package/dist/index.js +1 -1
- package/dist/lib/BankAccountOnboardingWidget.d.ts +18 -0
- package/dist/lib/BankAccountOnboardingWidget.js +1 -1
- package/dist/lib/WidgetSuite.d.ts +18 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index10.js +82 -184
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index11.js +189 -29
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +34 -127
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index13.js +83 -175
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index14.js +173 -84
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index15.js +62 -92
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js +86 -115
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +5 -97
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js +105 -87
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index19.js +99 -5
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index20.js +94 -28
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index21.js +182 -16
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +5 -423
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index23.js +34 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index24.js +19 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js +580 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index25.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index26.js +59 -0
- 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/ui/dist/lib/OnboardingShell/OnboardingShell.js +62 -49
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js +1 -1
- package/package.json +1 -1
|
@@ -1,91 +1,180 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { AboutYouPanel as n } from "../../ui/dist/index23.js";
|
|
1
|
+
import { maskIdentifierLast4 as e } from "./index6.js";
|
|
2
|
+
import { storedIdentifierFieldDisplay as t } from "./index7.js";
|
|
3
|
+
import { formatPhoneNumberInput as n } from "./index2.js";
|
|
4
|
+
import { sanitizeZipCodeInput as r } from "./index3.js";
|
|
5
|
+
import { PERSONAL_DETAILS_LABELS_EN as i } from "../../ui/dist/index8.js";
|
|
6
|
+
import { ABOUT_YOU_PANEL_LABELS_EN as a } from "../../ui/dist/index22.js";
|
|
8
7
|
import "../../ui/dist/index.js";
|
|
9
|
-
import {
|
|
10
|
-
import { buildAboutYouEditFields as a, buildAboutYouPanelLabels as o, buildAboutYouSummaryRows as s, buildSsnDisplayValues as c, mergePersonalDetailsLabels as l } from "./index13.js";
|
|
11
|
-
import { useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
12
|
-
import { jsx as m } from "react/jsx-runtime";
|
|
13
|
-
import { z as h } from "zod";
|
|
8
|
+
import { formatSsnInput as o, maskSsn as s, sanitizeSsnDigits as c } from "./index4.js";
|
|
14
9
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index14.js
|
|
15
|
-
function
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
10
|
+
function l(e) {
|
|
11
|
+
return e ? e.toLocaleDateString("en-US", {
|
|
12
|
+
month: "short",
|
|
13
|
+
day: "numeric",
|
|
14
|
+
year: "numeric"
|
|
15
|
+
}) : "";
|
|
16
|
+
}
|
|
17
|
+
function u(e) {
|
|
18
|
+
return {
|
|
19
|
+
...i,
|
|
20
|
+
...e
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function d(e) {
|
|
24
|
+
let t = u(e);
|
|
25
|
+
return {
|
|
26
|
+
...a,
|
|
27
|
+
firstName: t.firstName,
|
|
28
|
+
lastName: t.lastName,
|
|
29
|
+
dateOfBirth: t.dateOfBirth,
|
|
30
|
+
dateOfBirthPlaceholder: t.dateOfBirthPlaceholder,
|
|
31
|
+
ssn: t.ssn,
|
|
32
|
+
ssnShow: t.ssnShow,
|
|
33
|
+
ssnHide: t.ssnHide,
|
|
34
|
+
homeAddress: t.homeAddress,
|
|
35
|
+
city: t.city,
|
|
36
|
+
state: t.state,
|
|
37
|
+
statePlaceholder: t.statePlaceholder,
|
|
38
|
+
zipCode: t.zipCode,
|
|
39
|
+
mobilePhoneNumber: t.mobilePhoneNumber,
|
|
40
|
+
workEmail: t.workEmail,
|
|
41
|
+
ownsOver25Question: t.ownsOver25Question,
|
|
42
|
+
ownsOver25SummaryLabel: t.ownsOver25SummaryLabel,
|
|
43
|
+
ownsOver25Yes: t.ownsOver25Yes,
|
|
44
|
+
ownsOver25No: t.ownsOver25No,
|
|
45
|
+
ownershipPercentage: t.ownershipPercentage,
|
|
46
|
+
ownershipPercentagePlaceholder: t.ownershipPercentagePlaceholder
|
|
47
|
+
};
|
|
37
48
|
}
|
|
38
|
-
function
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
49
|
+
function f(t, n) {
|
|
50
|
+
let r = d(n.labels), i = n.stateOptions.find((e) => e.value === t.state)?.label ?? t.state;
|
|
51
|
+
return [
|
|
52
|
+
{
|
|
53
|
+
label: r.firstName,
|
|
54
|
+
value: t.firstName,
|
|
55
|
+
testId: "about-you-summary-first-name"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: r.lastName,
|
|
59
|
+
value: t.lastName,
|
|
60
|
+
testId: "about-you-summary-last-name"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: r.dateOfBirth,
|
|
64
|
+
value: l(t.dateOfBirth),
|
|
65
|
+
testId: "about-you-summary-dob"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
label: r.ssn,
|
|
69
|
+
value: t.ssn ? s(t.ssn) : t.ssnOnFileLast4 ? e(t.ssnOnFileLast4) : "",
|
|
70
|
+
testId: "about-you-summary-ssn",
|
|
71
|
+
valueMonospace: !0
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
label: r.homeAddress,
|
|
75
|
+
value: t.homeAddress,
|
|
76
|
+
testId: "about-you-summary-home-address"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
label: r.city,
|
|
80
|
+
value: t.city,
|
|
81
|
+
testId: "about-you-summary-city"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
label: r.state,
|
|
85
|
+
value: i,
|
|
86
|
+
testId: "about-you-summary-state"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
label: r.zipCode,
|
|
90
|
+
value: t.zipCode,
|
|
91
|
+
testId: "about-you-summary-zip-code"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
label: r.mobilePhoneNumber,
|
|
95
|
+
value: t.mobilePhoneNumber,
|
|
96
|
+
testId: "about-you-summary-mobile-phone"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
label: r.workEmail,
|
|
100
|
+
value: t.workEmail,
|
|
101
|
+
testId: "about-you-summary-email"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
label: r.ownershipPercentage,
|
|
105
|
+
value: t.ownershipPercentage === null ? "" : `${t.ownershipPercentage}%`,
|
|
106
|
+
testId: "about-you-summary-ownership-percentage"
|
|
87
107
|
}
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
function p(e, t, i) {
|
|
111
|
+
let a = (n) => (r) => t({
|
|
112
|
+
...e,
|
|
113
|
+
[n]: r
|
|
88
114
|
});
|
|
115
|
+
return {
|
|
116
|
+
firstName: {
|
|
117
|
+
value: e.firstName,
|
|
118
|
+
onValueChange: a("firstName")
|
|
119
|
+
},
|
|
120
|
+
lastName: {
|
|
121
|
+
value: e.lastName,
|
|
122
|
+
onValueChange: a("lastName")
|
|
123
|
+
},
|
|
124
|
+
dateOfBirth: {
|
|
125
|
+
value: e.dateOfBirth,
|
|
126
|
+
onValueChange: a("dateOfBirth")
|
|
127
|
+
},
|
|
128
|
+
ssn: {
|
|
129
|
+
value: e.ssn,
|
|
130
|
+
onValueChange: (e) => a("ssn")(c(e))
|
|
131
|
+
},
|
|
132
|
+
homeAddress: {
|
|
133
|
+
value: e.homeAddress,
|
|
134
|
+
onValueChange: a("homeAddress")
|
|
135
|
+
},
|
|
136
|
+
city: {
|
|
137
|
+
value: e.city,
|
|
138
|
+
onValueChange: a("city")
|
|
139
|
+
},
|
|
140
|
+
state: {
|
|
141
|
+
value: e.state,
|
|
142
|
+
onValueChange: a("state"),
|
|
143
|
+
options: i.stateOptions
|
|
144
|
+
},
|
|
145
|
+
zipCode: {
|
|
146
|
+
value: e.zipCode,
|
|
147
|
+
onValueChange: (e) => a("zipCode")(r(e))
|
|
148
|
+
},
|
|
149
|
+
mobilePhoneNumber: {
|
|
150
|
+
value: e.mobilePhoneNumber,
|
|
151
|
+
onValueChange: (e) => a("mobilePhoneNumber")(n(e))
|
|
152
|
+
},
|
|
153
|
+
workEmail: {
|
|
154
|
+
value: e.workEmail,
|
|
155
|
+
onValueChange: a("workEmail")
|
|
156
|
+
},
|
|
157
|
+
ownsOver25Percent: {
|
|
158
|
+
value: e.ownsOver25Percent === null ? "" : e.ownsOver25Percent ? "yes" : "no",
|
|
159
|
+
onValueChange: (n) => t({
|
|
160
|
+
...e,
|
|
161
|
+
ownsOver25Percent: n === "" ? null : n === "yes",
|
|
162
|
+
ownershipPercentage: n === "yes" ? e.ownershipPercentage : null
|
|
163
|
+
})
|
|
164
|
+
},
|
|
165
|
+
ownershipPercentage: {
|
|
166
|
+
value: e.ownershipPercentage,
|
|
167
|
+
onValueChange: a("ownershipPercentage")
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function m(e, n, r) {
|
|
172
|
+
let i = u(r);
|
|
173
|
+
return {
|
|
174
|
+
masked: s(e),
|
|
175
|
+
formatted: o(e),
|
|
176
|
+
...t(n, i.ssnOnFileTemplate)
|
|
177
|
+
};
|
|
89
178
|
}
|
|
90
179
|
//#endregion
|
|
91
|
-
export {
|
|
180
|
+
export { p as buildAboutYouEditFields, d as buildAboutYouPanelLabels, f as buildAboutYouSummaryRows, m as buildSsnDisplayValues, u as mergePersonalDetailsLabels };
|
|
@@ -1,97 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { bankAccountOnboardingTestIds as e } from "./index12.js";
|
|
6
|
+
import { getMaxBirthDate as t } from "./index9.js";
|
|
7
|
+
import { buildPersonalDetailsSchema as n } from "./index10.js";
|
|
8
|
+
import { AboutYouPanel as r } from "../../ui/dist/index23.js";
|
|
5
9
|
import "../../ui/dist/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
10
|
+
import { buildAboutYouEditFields as i, buildAboutYouPanelLabels as a, buildAboutYouSummaryRows as o, buildSsnDisplayValues as s, mergePersonalDetailsLabels as c } from "./index14.js";
|
|
11
|
+
import { useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
12
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
8
13
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index15.js
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
value: e.lastName,
|
|
59
|
-
onValueChange: r("lastName")
|
|
60
|
-
},
|
|
61
|
-
dateOfBirth: {
|
|
62
|
-
value: e.dateOfBirth,
|
|
63
|
-
onValueChange: r("dateOfBirth")
|
|
64
|
-
},
|
|
65
|
-
ssn: {
|
|
66
|
-
value: e.ssn,
|
|
67
|
-
onValueChange: (e) => r("ssn")(e)
|
|
68
|
-
},
|
|
69
|
-
homeAddress: {
|
|
70
|
-
value: e.homeAddress,
|
|
71
|
-
onValueChange: r("homeAddress")
|
|
72
|
-
},
|
|
73
|
-
city: {
|
|
74
|
-
value: e.city,
|
|
75
|
-
onValueChange: r("city")
|
|
76
|
-
},
|
|
77
|
-
state: {
|
|
78
|
-
value: e.state,
|
|
79
|
-
onValueChange: r("state"),
|
|
80
|
-
options: n.stateOptions
|
|
81
|
-
},
|
|
82
|
-
zipCode: {
|
|
83
|
-
value: e.zipCode,
|
|
84
|
-
onValueChange: (e) => r("zipCode")(e)
|
|
85
|
-
},
|
|
86
|
-
mobilePhoneNumber: {
|
|
87
|
-
value: e.mobilePhoneNumber,
|
|
88
|
-
onValueChange: (e) => r("mobilePhoneNumber")(e)
|
|
89
|
-
},
|
|
90
|
-
ownershipPercentage: {
|
|
91
|
-
value: e.ownershipPercentage,
|
|
92
|
-
onValueChange: r("ownershipPercentage")
|
|
14
|
+
function m({ value: m, onValueChange: h, onSnapshotChange: g, stateOptions: _, isSubmitting: v, labels: y }) {
|
|
15
|
+
let b = u(() => c(y), [y]), x = u(() => n(b), [b]).safeParse(m), S = x.success ? x.data : null, C = JSON.stringify({
|
|
16
|
+
...S,
|
|
17
|
+
dateOfBirth: S?.dateOfBirth?.toISOString()
|
|
18
|
+
}), w = d(g);
|
|
19
|
+
w.current = g, l(() => {
|
|
20
|
+
w.current(S);
|
|
21
|
+
}, [C]);
|
|
22
|
+
let [T, E] = f(() => S === null), [D, O] = f(!1);
|
|
23
|
+
l(() => {
|
|
24
|
+
S === null && E(!0);
|
|
25
|
+
}, [C]);
|
|
26
|
+
let k = u(() => ({
|
|
27
|
+
stateOptions: _,
|
|
28
|
+
labels: y
|
|
29
|
+
}), [_, y]), A = u(() => a(y), [y]), j = u(() => o(m, k), [m, k]), M = u(() => i(m, h, k), [
|
|
30
|
+
m,
|
|
31
|
+
h,
|
|
32
|
+
k
|
|
33
|
+
]), N = u(() => s(m.ssn, m.ssnOnFileLast4, y), [
|
|
34
|
+
m.ssn,
|
|
35
|
+
m.ssnOnFileLast4,
|
|
36
|
+
y
|
|
37
|
+
]), P = u(() => t(), []);
|
|
38
|
+
return /* @__PURE__ */ p(r, {
|
|
39
|
+
isEditing: T,
|
|
40
|
+
onEditClick: () => E(!0),
|
|
41
|
+
summaryRows: j,
|
|
42
|
+
editFields: M,
|
|
43
|
+
labels: A,
|
|
44
|
+
isDisabled: v,
|
|
45
|
+
ssnRevealed: D,
|
|
46
|
+
ssnToggleAriaLabel: D ? A.ssnHide : A.ssnShow,
|
|
47
|
+
onToggleSsnVisibility: () => O((e) => !e),
|
|
48
|
+
showOwnershipPercentage: m.ownsOver25Percent === !0,
|
|
49
|
+
maxBirthDate: P,
|
|
50
|
+
ssnMaskedDisplay: N.masked,
|
|
51
|
+
ssnFormattedDisplay: N.formatted,
|
|
52
|
+
ssnRequired: N.required,
|
|
53
|
+
ssnPlaceholder: N.placeholder,
|
|
54
|
+
ssnHelpText: N.helpText,
|
|
55
|
+
testIds: {
|
|
56
|
+
root: e.aboutYouPanel,
|
|
57
|
+
editButton: e.aboutYouEditButton,
|
|
58
|
+
summary: { root: e.aboutYouSummary },
|
|
59
|
+
editForm: {
|
|
60
|
+
root: e.aboutYouEditForm,
|
|
61
|
+
ownsOver25Question: e.aboutYouOwnsOver25Question
|
|
62
|
+
}
|
|
93
63
|
}
|
|
94
|
-
};
|
|
64
|
+
});
|
|
95
65
|
}
|
|
96
66
|
//#endregion
|
|
97
|
-
export {
|
|
67
|
+
export { m as PersonalDetailsStep };
|
|
@@ -1,126 +1,97 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import { bankAccountOnboardingTestIds as t } from "./index11.js";
|
|
7
|
-
import { ADDITIONAL_OWNERS_LABELS_EN as n } from "../../ui/dist/index5.js";
|
|
8
|
-
import { AdditionalOwnersForm as r } from "../../ui/dist/index6.js";
|
|
1
|
+
import { storedIdentifierFieldDisplay as e } from "./index7.js";
|
|
2
|
+
import { getMaxBirthDate as t, isAtLeastMinOwnerAge as n } from "./index9.js";
|
|
3
|
+
import { formatPhoneNumberInput as r } from "./index2.js";
|
|
4
|
+
import { sanitizeZipCodeInput as i } from "./index3.js";
|
|
5
|
+
import { ADDITIONAL_OWNERS_LABELS_EN as a } from "../../ui/dist/index5.js";
|
|
9
6
|
import "../../ui/dist/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import { EMPTY_ADDITIONAL_OWNER as a, buildAdditionalOwnerEditDisplay as o, buildAdditionalOwnerEditFields as s, normalizeAdditionalOwnerDraft as c } from "./index15.js";
|
|
12
|
-
import { useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
13
|
-
import { jsx as p } from "react/jsx-runtime";
|
|
14
|
-
import { z as m } from "zod";
|
|
7
|
+
import { formatSsnInput as o, maskSsn as s, sanitizeSsnDigits as c } from "./index4.js";
|
|
15
8
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return e.ownershipPercentage !== null && e.ownershipPercentage >= 25 ? e.ownershipPercentage : 0;
|
|
38
|
-
}
|
|
39
|
-
function _(e) {
|
|
40
|
-
return `${g(e)}%`;
|
|
9
|
+
var l = {
|
|
10
|
+
firstName: "",
|
|
11
|
+
lastName: "",
|
|
12
|
+
dateOfBirth: void 0,
|
|
13
|
+
ssn: "",
|
|
14
|
+
homeAddress: "",
|
|
15
|
+
city: "",
|
|
16
|
+
state: "",
|
|
17
|
+
zipCode: "",
|
|
18
|
+
mobilePhoneNumber: "",
|
|
19
|
+
ownsOver25Percent: null,
|
|
20
|
+
ownershipPercentage: null
|
|
21
|
+
};
|
|
22
|
+
function u(e) {
|
|
23
|
+
return {
|
|
24
|
+
...e,
|
|
25
|
+
ssn: c(e.ssn),
|
|
26
|
+
zipCode: i(e.zipCode),
|
|
27
|
+
mobilePhoneNumber: r(e.mobilePhoneNumber),
|
|
28
|
+
ownsOver25Percent: e.ownershipPercentage === null ? null : e.ownershipPercentage >= 25
|
|
29
|
+
};
|
|
41
30
|
}
|
|
42
|
-
function
|
|
31
|
+
function d(r, i) {
|
|
32
|
+
let c = {
|
|
33
|
+
...a,
|
|
34
|
+
...i
|
|
35
|
+
}, l = e(r.ssnOnFileLast4, c.ssnOnFileTemplate);
|
|
43
36
|
return {
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
ssnRequired: l.required,
|
|
38
|
+
ssnPlaceholder: l.placeholder,
|
|
39
|
+
ssnHelpText: l.helpText,
|
|
40
|
+
dateOfBirthInvalid: r.dateOfBirth !== void 0 && !n(r.dateOfBirth),
|
|
41
|
+
ownershipPercentageInvalid: r.ownershipPercentage !== null && r.ownershipPercentage < 25,
|
|
42
|
+
maxBirthDate: t(),
|
|
43
|
+
ssnMaskedDisplay: s(r.ssn),
|
|
44
|
+
ssnFormattedDisplay: o(r.ssn)
|
|
46
45
|
};
|
|
47
46
|
}
|
|
48
|
-
function
|
|
49
|
-
let
|
|
50
|
-
...n,
|
|
51
|
-
...S
|
|
52
|
-
}), [S]), w = u(() => h(C), [C]), [T, E] = f(null), [D, O] = f(null), [k, A] = f(null), [j, M] = f(!1), N = (e) => {
|
|
53
|
-
E(c(e));
|
|
54
|
-
}, P = _ + e.reduce((e, t) => e + g(t), 0), F = P > 100 ? C.totalOwnershipExceedsTemplate(P) : null, I = P > 75, L = `${_}%`, R = _ >= 25, z = e.every((e) => w.safeParse(e).success), B = T !== null && w.safeParse(T).success, V = z && F === null && T === null && k === null ? e : null, H = JSON.stringify({ snapshot: V?.map((e) => ({
|
|
47
|
+
function f(e, t, n) {
|
|
48
|
+
let r = (n) => (r) => t(u({
|
|
55
49
|
...e,
|
|
56
|
-
|
|
57
|
-
}))
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
O(null), M(!1), E({ ...a });
|
|
63
|
-
}, G = (t) => {
|
|
64
|
-
O(t), M(!1), E(c({ ...e[t] }));
|
|
65
|
-
}, K = (t) => {
|
|
66
|
-
let n = e[t];
|
|
67
|
-
A({
|
|
68
|
-
index: t,
|
|
69
|
-
displayName: `${n.firstName} ${n.lastName}`.trim()
|
|
70
|
-
});
|
|
71
|
-
}, q = () => {
|
|
72
|
-
k && (i(e.filter((e, t) => t !== k.index)), A(null));
|
|
73
|
-
}, J = () => {
|
|
74
|
-
A(null);
|
|
75
|
-
}, Y = T ? {
|
|
76
|
-
fields: s(T, N, { stateOptions: y }),
|
|
77
|
-
display: o(T, C),
|
|
78
|
-
isExisting: D !== null,
|
|
79
|
-
isValid: B,
|
|
80
|
-
ssnRevealed: j,
|
|
81
|
-
ssnToggleAriaLabel: j ? C.ssnHide : C.ssnShow,
|
|
82
|
-
onToggleSsnVisibility: () => M((e) => !e),
|
|
83
|
-
onSubmit: () => {
|
|
84
|
-
if (!T) return;
|
|
85
|
-
let t = w.safeParse(T);
|
|
86
|
-
if (t.success) {
|
|
87
|
-
if (D === null) i([...e, t.data]);
|
|
88
|
-
else {
|
|
89
|
-
let n = [...e];
|
|
90
|
-
n[D] = t.data, i(n);
|
|
91
|
-
}
|
|
92
|
-
E(null), O(null), M(!1);
|
|
93
|
-
}
|
|
50
|
+
[n]: r
|
|
51
|
+
}));
|
|
52
|
+
return {
|
|
53
|
+
firstName: {
|
|
54
|
+
value: e.firstName,
|
|
55
|
+
onValueChange: r("firstName")
|
|
94
56
|
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
57
|
+
lastName: {
|
|
58
|
+
value: e.lastName,
|
|
59
|
+
onValueChange: r("lastName")
|
|
60
|
+
},
|
|
61
|
+
dateOfBirth: {
|
|
62
|
+
value: e.dateOfBirth,
|
|
63
|
+
onValueChange: r("dateOfBirth")
|
|
64
|
+
},
|
|
65
|
+
ssn: {
|
|
66
|
+
value: e.ssn,
|
|
67
|
+
onValueChange: (e) => r("ssn")(e)
|
|
68
|
+
},
|
|
69
|
+
homeAddress: {
|
|
70
|
+
value: e.homeAddress,
|
|
71
|
+
onValueChange: r("homeAddress")
|
|
72
|
+
},
|
|
73
|
+
city: {
|
|
74
|
+
value: e.city,
|
|
75
|
+
onValueChange: r("city")
|
|
76
|
+
},
|
|
77
|
+
state: {
|
|
78
|
+
value: e.state,
|
|
79
|
+
onValueChange: r("state"),
|
|
80
|
+
options: n.stateOptions
|
|
81
|
+
},
|
|
82
|
+
zipCode: {
|
|
83
|
+
value: e.zipCode,
|
|
84
|
+
onValueChange: (e) => r("zipCode")(e)
|
|
85
|
+
},
|
|
86
|
+
mobilePhoneNumber: {
|
|
87
|
+
value: e.mobilePhoneNumber,
|
|
88
|
+
onValueChange: (e) => r("mobilePhoneNumber")(e)
|
|
89
|
+
},
|
|
90
|
+
ownershipPercentage: {
|
|
91
|
+
value: e.ownershipPercentage,
|
|
92
|
+
onValueChange: r("ownershipPercentage")
|
|
122
93
|
}
|
|
123
|
-
}
|
|
94
|
+
};
|
|
124
95
|
}
|
|
125
96
|
//#endregion
|
|
126
|
-
export {
|
|
97
|
+
export { l as EMPTY_ADDITIONAL_OWNER, d as buildAdditionalOwnerEditDisplay, f as buildAdditionalOwnerEditFields, u as normalizeAdditionalOwnerDraft };
|