UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

156 lines (154 loc) 6.39 kB
/** * VERSION: 2.113.0-alpha.0 * BUILD_TIMESTAMP: 1750184680813 * BUILD_DATE: Tue Jun 17 2025 18:24:40 GMT+0000 (Coordinated Universal Time) * BUILD_COMMIT: 896154e79f58fffa6d52f3ed37f2db760a63df88 */ import { j as s, r as c, A as p, a0 as g, B as u, V as d, p as x, u as j, l as b, q as h } from "./es6-B9qAIX4x.js"; import { FormattedHTMLMessage as a, injectIntl as E } from "react-intl"; import { EmailLoopPendingComponent as f } from "./EmailLoopPending-CDvXBLwm.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 }), j( "organizationEmail", l, e ); }, m = async () => { b.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 }) }); }, k = E(N); export { k as default };