UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

155 lines (153 loc) 6.28 kB
/** * 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.130.0-alpha.4 * BUILD_TIMESTAMP: 1759000347595 * BUILD_DATE: Sat Sep 27 2025 19:12:27 GMT+0000 (Coordinated Universal Time) * BUILD_COMMIT: be6ef87ab40e8747994d32363389cf39e36a4326 */ import { j as s, L as n, b as l, m as r, i as j, R as N, A as y, x as S, S as g, J as f, f as w, K as C, N as M, V as o, n as _ } from "../_mysheerid-preview.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 }) }) ] }), V = k, E = ({ verificationService: e }) => { const [d, c] = N.useState(!0), i = e.viewModel, { fieldValidationErrors: u } = e, a = () => e.submitStep( o.cancelSocialSecurityNumber, i, e.verificationResponse ), m = (t, h) => { const p = _( i, (x) => { x[t] = h; } ); e.updateViewModel(p); }, b = i.socialSecurityNumber && i.socialSecurityNumber.toString().length === 9; return d ? /* @__PURE__ */ s.jsx( V, { useSsn: () => c(!1), useDocUpload: a, 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(S, { verificationService: e }), /* @__PURE__ */ s.jsx("div", { className: "sid-ssn-wrapper", children: /* @__PURE__ */ s.jsx( g, { value: i.socialSecurityNumber, onChange: (t) => { m("socialSecurityNumber", t), w( "socialSecurityNumber", t, e ); }, isErrored: !!u[f.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: () => M( i, e, o.collectSocialSecurityNumber ), type: "submit", className: `sid-btn sid-social-security-number-submit-btn sid-btn--dark sid-l-full-width ${b ? "" : "sid-btn--disabled-like"}`, "aria-label": "submit", ref: (t) => C("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: a, onClick: a, 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 }) ] } ); }, z = j(E); export { z as default };