@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
157 lines (155 loc) • 6.37 kB
JavaScript
/**
* WARNING: This file is intended to be used within MySheerID.
* This file is not intended for use in other contexts and there are no guarantees about its behavior outside of MySheerID.
*/
/**
* VERSION: 2.230.0-alpha.0
* BUILD_TIMESTAMP: 1778694697559
* BUILD_DATE: Wed May 13 2026 17:51:37 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 7af1c105d5485ac4ed1190c56d492bb4590667a9
*/
import { j as s, L as n, F as l, a as r, i as j, R as N, I as y, k as S, o as g, s as f, M as C, V as a, p as w } from "../_mysheerid-preview.js";
import { S as M } from "./SSN-Hb1lTx8A.js";
import { C as _ } from "./ChangeLocaleComponent-Cu2DR-Q3.js";
const k = ({ useSsn: e, useDocUpload: d, verificationService: c }) => /* @__PURE__ */ s.jsxs("div", { id: "sid-ssn-choice", className: "sid-ssn-choice-container sid-l-container sid-l-horz-center", children: [
/* @__PURE__ */ s.jsxs("div", { role: "main", children: [
/* @__PURE__ */ s.jsxs("div", { className: "sid-header", children: [
/* @__PURE__ */ s.jsx("div", { className: "sid-ssn-choice-logo-container sid-l-horz-center", children: /* @__PURE__ */ s.jsx(n, { verificationService: c }) }),
/* @__PURE__ */ s.jsx("div", { className: "sid-header__title sid-l-horz-center", children: /* @__PURE__ */ s.jsx(
l,
{
id: "step.collectSocialSecurityNumber.selectOption",
defaultMessage: "Select an option",
tagName: "h1"
}
) })
] }),
/* @__PURE__ */ s.jsx("div", { className: "sid-ssn-choice__choice1 sid-l-space-top-lg", children: /* @__PURE__ */ s.jsx(
"button",
{
type: "button",
onClick: e,
className: "sid-btn sid-ssn-choice-one-btn sid-btn--light sid-l-full-width sid-use-ssn",
children: /* @__PURE__ */ s.jsx(
l,
{
id: "step.collectSocialSecurityNumber.useSsn",
defaultMessage: "Verify using your social security number"
}
)
}
) }),
/* @__PURE__ */ s.jsx("div", { className: "sid-ssn-choice__choice2 sid-l-space-top-md", children: /* @__PURE__ */ s.jsx(
"button",
{
type: "button",
onClick: d,
className: "sid-btn sid-ssn-choice-two-btn sid-btn--light sid-l-full-width sid-use-doc-upload",
children: /* @__PURE__ */ s.jsx(
l,
{
id: "step.collectSocialSecurityNumber.uploadDoc",
defaultMessage: "Upload a document"
}
)
}
) })
] }),
/* @__PURE__ */ s.jsx("div", { className: "sid-ssn-choice__footer sid-l-space-top-lg", children: /* @__PURE__ */ s.jsx(r, { verificationService: c }) })
] }), F = k, V = ({ verificationService: e }) => {
const [d, c] = N.useState(!0), i = e.viewModel, { fieldValidationErrors: u } = e, o = () => e.submitStep(
a.cancelSocialSecurityNumber,
i,
e.verificationResponse
), m = (t, h) => {
const b = w(
i,
(x) => {
x[t] = h;
}
);
e.updateViewModel(b);
}, p = i.socialSecurityNumber && i.socialSecurityNumber.toString().length === 9;
return d ? /* @__PURE__ */ s.jsx(
F,
{
useSsn: () => c(!1),
useDocUpload: o,
verificationService: e
}
) : /* @__PURE__ */ s.jsxs(
"div",
{
id: "sid-step-social-security",
className: "sid-social-sercurity-number-container sid-l-container sid-l-horz-center",
children: [
/* @__PURE__ */ s.jsxs("div", { role: "main", children: [
/* @__PURE__ */ s.jsxs("div", { className: "sid-header", children: [
/* @__PURE__ */ s.jsx("div", { className: "sid-social-security-number-logo-container sid-l-horz-center", children: /* @__PURE__ */ s.jsx(n, { verificationService: e }) }),
/* @__PURE__ */ s.jsx(y, { align: "center", children: /* @__PURE__ */ s.jsx(
l,
{
id: "step.collectSocialSecurityNumber.title",
defaultMessage: "Enter your social security number",
tagName: "h1"
}
) }),
/* @__PURE__ */ s.jsx(_, { verificationService: e }),
/* @__PURE__ */ s.jsx("div", { className: "sid-ssn-wrapper", children: /* @__PURE__ */ s.jsx(
M,
{
value: i.socialSecurityNumber,
onChange: (t) => {
m("socialSecurityNumber", t), g(
"socialSecurityNumber",
t,
e
);
},
isErrored: !!u[S.socialSecurityNumber],
placeholder: "000-00-0000"
}
) })
] }),
/* @__PURE__ */ s.jsx("div", { className: "sid-form-region sid-submit-wrapper sid-l-space-top-md", children: /* @__PURE__ */ s.jsx("div", { className: "sid-social-security-number-submit sid-submit", children: /* @__PURE__ */ s.jsx(
"button",
{
id: "sid-submit-wrapper__collect-info",
onClick: () => C(
i,
e,
a.collectSocialSecurityNumber
),
type: "submit",
className: `sid-btn sid-social-security-number-submit-btn sid-btn--dark sid-l-full-width ${p ? "" : "sid-btn--disabled-like"}`,
"aria-label": "submit",
ref: (t) => f("submitButton", t),
children: /* @__PURE__ */ s.jsx(l, { id: "proceed", defaultMessage: "Proceed" })
}
) }) }),
/* @__PURE__ */ s.jsx(
"div",
{
className: "sid-form-region sid-social-security-number-upload-instead-btn sid-l-space-top-md",
role: "button",
tabIndex: 0,
onKeyUp: o,
onClick: o,
children: /* @__PURE__ */ s.jsx("div", { className: "sid-social-security-number-upload-instead-text sid-h-link-like", children: /* @__PURE__ */ s.jsx(
l,
{
id: "step.collectSocialSecurityNumber.uploadInstead",
defaultMessage: "Upload a document instead"
}
) })
}
)
] }),
/* @__PURE__ */ s.jsx(r, { verificationService: e })
]
}
);
}, R = j(V);
export {
R as default
};