
/**
 *   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.239.0-alpha.0
 *   BUILD_TIMESTAMP: 1780013005605
 *   BUILD_DATE: Fri May 29 2026 00:03:25 GMT+0000 (Coordinated Universal Time)
 *   BUILD_COMMIT: 3344b6c0fd9fa858907db310cfb1ef5e0d224da2
 */
import { j as s, L as m, F as a, M as c, Q as p, V as t, f as g, u, q as x, k as j, i as b } from "../_mysheerid-preview.js";
import { F as h } from "./FormFieldText-BEmRFdkH.js";
import { EmailLoopPendingComponent as E } from "./EmailLoopPending-7yIJf3wF.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 }), u(
      "organizationEmail",
      l,
      e
    );
  }, r = async () => {
    x.info("StepEmailLoopComponent submitting form after skipping email loop");
    const l = j(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(
          h,
          {
            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: () => p(
              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(g, { 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 }) });
}, z = b(L);
export {
  z as default
};
