UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

155 lines (153 loc) 6.33 kB
/** * VERSION: 2.130.0-alpha.4 * BUILD_TIMESTAMP: 1759000305348 * BUILD_DATE: Sat Sep 27 2025 19:11:45 GMT+0000 (Coordinated Universal Time) * BUILD_COMMIT: be6ef87ab40e8747994d32363389cf39e36a4326 */ import { j as s, L as c, b as a, A as p, Q as g, N as u, V as d, m as x, f as b, l as j, n as h, i as E } from "../sheerid.js"; import { EmailLoopPendingComponent as f } from "./EmailLoopPending-CHILFZYc.js"; const L = ({ verificationService: e }) => { var t; const i = e.viewModel, o = e.fieldValidationErrors, n = (((t = e.verificationResponse) == null ? void 0 : t.errorIds) || []).includes( "invalidEmail" ), r = (l) => { e.updateViewModel({ ...i, organizationEmail: l }), b( "organizationEmail", l, e ); }, m = async () => { j.info("StepEmailLoopComponent submitting form after skipping email loop"); const l = h(i, () => { }); return e.submitStep( d.cancelEmailLoop, l, e.verificationResponse ); }; return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [ /* @__PURE__ */ s.jsxs("div", { className: "sid-header sid-l-horz-center", children: [ /* @__PURE__ */ s.jsxs("div", { role: "main", children: [ /* @__PURE__ */ s.jsx("div", { className: "sid-sso-logo-container sid-l-horz-center", children: /* @__PURE__ */ s.jsx( c, { verificationService: e, fallbackLogo: /* @__PURE__ */ s.jsx( "img", { className: "sid-sso-logo-default sid-l-lead-image", alt: "", src: "https://assets-resources.sheerid.com/common/images/2018/icons/doc-pending.svg" } ) } ) }), /* @__PURE__ */ s.jsx("div", { className: "sid-preheader-label sid-l-space-top-md", children: /* @__PURE__ */ s.jsx("span", { className: "sid-h-label", children: /* @__PURE__ */ s.jsx(a, { id: "instant", defaultMessage: "Instant" }) }) }), /* @__PURE__ */ s.jsx(p, { align: "center", children: /* @__PURE__ */ s.jsx( a, { id: "step.emailLoop.collectOrganizationEmail.title", defaultMessage: "Verify using your work email address", tagName: "h1" } ) }), /* @__PURE__ */ s.jsx("div", { className: "sid-header__subtitle-one", children: /* @__PURE__ */ s.jsx( a, { id: "step.emailLoop.collectOrganizationEmail.subtitle", defaultMessage: "Enter the email address provided by your employer and we'll send you a verification link" } ) }) ] }), /* @__PURE__ */ s.jsxs("div", { className: "sid-form-region sid-email-submit sid-submit-wrapper sid-l-space-top-md", children: [ /* @__PURE__ */ s.jsx( g, { fieldId: "emailOverride", value: i.organizationEmail, onChange: r, placeholder: "", label: /* @__PURE__ */ s.jsx( a, { id: "step.emailLoop.collectOrganizationEmail.email.label", defaultMessage: "Work email address" } ), errorMessage: n && /* @__PURE__ */ s.jsx( a, { id: "step.emailLoop.errors.invalidEmail", defaultMessage: "This email address is not valid for instant verification. Please use an email address provided by your employer or upload documentation below." } ) || o.organizationEmail && /* @__PURE__ */ s.jsx(a, { id: "emailIds.invalidEmail", defaultMessage: "Invalid email" }) } ), /* @__PURE__ */ s.jsx("div", { className: "sid-l-space-top-sm", children: /* @__PURE__ */ s.jsx( "button", { id: "sid-submit-btn-sso", type: "submit", disabled: !!o.organizationEmail, onClick: () => u( i, e, d.emailLoopCollectOrganizationEmail ), className: "sid-btn sid-sso-submit-btn sid-btn--dark sid-l-full-width ", "aria-label": "submit", children: /* @__PURE__ */ s.jsx( a, { id: "step.emailLoop.collectOrganizationEmail.email.send", defaultMessage: "Send Email" } ) } ) }), /* @__PURE__ */ s.jsxs("div", { className: "sid-form-region sid-l-space-top-lg sid-l-horz-center", children: [ /* @__PURE__ */ s.jsx("div", { className: "sid-header__subtitle-two sid-h-bold-text", children: /* @__PURE__ */ s.jsx( a, { id: "step.emailLoop.collectOrganizationEmail.alternative", defaultMessage: "Unable to access a work email address?" } ) }), /* @__PURE__ */ s.jsx("div", { className: "sid-form-region sid-l-space-btm-sm sid-l-space-top-sm", children: /* @__PURE__ */ s.jsx( a, { id: "step.sso.alternative", defaultMessage: "You can also verify by uploading proof of eligibility" } ) }), /* @__PURE__ */ s.jsx("div", { className: "sid-l-space-top-sm", children: /* @__PURE__ */ s.jsx( "button", { onClick: m, className: "sid-h-btn-link-like sid-link sid-h-bold-text", type: "button", children: /* @__PURE__ */ s.jsx( a, { id: "step.sso.cancel", defaultMessage: "Upload Proof of Enrollment" } ) } ) }) ] }), /* @__PURE__ */ s.jsx("div", { className: "sid-l-space-top-lg" }) ] }) ] }), /* @__PURE__ */ s.jsx(x, { verificationService: e }) ] }); }, N = ({ verificationService: e }) => { const i = e.verificationResponse.currentState === "collectOrganizationEmail"; return /* @__PURE__ */ s.jsx("div", { id: "sid-step-email-loop", className: "sid-step-email-loop-container sid-l-container", children: i ? /* @__PURE__ */ s.jsx(L, { verificationService: e }) : /* @__PURE__ */ s.jsx(f, { verificationService: e }) }); }, z = E(N); export { z as default };