@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
154 lines (152 loc) • 6.29 kB
JavaScript
/**
* VERSION: 2.154.0-alpha.1
* BUILD_TIMESTAMP: 1763401515326
* BUILD_DATE: Mon Nov 17 2025 17:45:15 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 73f4468155aaed0f31ab0d59dc3394018b939b6d
*/
import { j as s, p as m, c as a, A as c, X as p, U as g, V as t, n as u, k as x, l as j, o as b, i as h } from "../sheerid.js";
import { EmailLoopPendingComponent as E } from "./EmailLoopPending-pdu6KCZh.js";
const f = ({
verificationService: e
}) => {
const i = e.viewModel, o = e.fieldValidationErrors, d = (e.verificationResponse?.errorIds || []).includes(
"invalidEmail"
), n = (l) => {
e.updateViewModel({ ...i, organizationEmail: l }), x(
"organizationEmail",
l,
e
);
}, r = async () => {
j.info("StepEmailLoopComponent submitting form after skipping email loop");
const l = b(i, () => {
});
return e.submitStep(
t.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(
m,
{
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(c, { 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(
p,
{
fieldId: "emailOverride",
value: i.organizationEmail,
onChange: n,
placeholder: "",
label: /* @__PURE__ */ s.jsx(
a,
{
id: "step.emailLoop.collectOrganizationEmail.email.label",
defaultMessage: "Work email address"
}
),
errorMessage: d && /* @__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: () => g(
i,
e,
t.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: r,
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(u, { verificationService: e })
] });
}, L = ({ 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(f, { verificationService: e }) : /* @__PURE__ */ s.jsx(E, { verificationService: e }) });
}, M = h(L);
export {
M as default
};