
/**
 *   VERSION: 2.240.0-alpha.1
 *   BUILD_TIMESTAMP: 1780360168537
 *   BUILD_DATE: Tue Jun 02 2026 00:29:28 GMT+0000 (Coordinated Universal Time)
 *   BUILD_COMMIT: 758cedd37e00f49a728d704d9ed36884f0f12d79
 */
import { k as g, r as x, j as e, P as E, g as l, a1 as j, u as n, m as N, F as p, Y as T, V as i, f as M } from "../sheerid.js";
import { s as P } from "./FormFieldTypeahead-BYkRNOT7.js";
import { F as f, L as k, B as F, P as I, a as y, M as D, C as V } from "./CaptchaComponent-DJipDl-5.js";
import { C as B } from "./ChangeLocaleComponent-D317H5S8.js";
import { C as L } from "./CountryComponentWrapper-DCc0WoEp.js";
import { E as O, P as z } from "./PersonalInfoStepSubmitButton-q2ua_b8H.js";
import { P as A } from "./PostalCodeComponent-BCYXpkvf.js";
import { T as R } from "./TeacherSchoolComponent-mDzQ-Clt.js";
import { P as W } from "./PersonalInfoStepWrapper-BCVAx0W6.js";
const w = ({
  verificationService: a
}) => {
  const { viewModel: o } = a, { fieldValidationErrors: d } = a, r = a.verificationResponse, h = g(r), C = M(), u = o.localeChoice.value, t = (s, m) => {
    const b = {
      [s]: m
    };
    a.updateViewModel(b, { partial: !0 });
  };
  return x.useEffect(() => {
    const s = (a.viewModel?.fieldsToSkipValidation || []).filter(
      (m) => m !== "birthDate"
    );
    a.programTheme.idCheckAddOnEnabled ? t("fieldsToSkipValidation", s) : (t("birthDate", ""), t("fieldsToSkipValidation", [...s, "birthDate"]));
  }, [a.programTheme.idCheckAddOnEnabled]), /* @__PURE__ */ e.jsxs(
    W,
    {
      verificationService: a,
      step: r.currentStep,
      children: [
        /* @__PURE__ */ e.jsx(
          E,
          {
            verificationService: a,
            classNameIdentifier: "teacher-personal-info"
          }
        ),
        /* @__PURE__ */ e.jsx(B, { verificationService: a }),
        /* @__PURE__ */ e.jsx(
          L,
          {
            verificationService: a,
            disabled: l("country")?.disabled
          }
        ),
        /* @__PURE__ */ e.jsx(
          R,
          {
            value: a.viewModel.organization,
            verificationService: a,
            isErrored: !!d.organization,
            disabled: l("organization")?.disabled,
            onChange: (s) => {
              j(s, a), n("organization", s, a);
            }
          }
        ),
        /* @__PURE__ */ e.jsxs("div", { className: "sid-names", children: [
          /* @__PURE__ */ e.jsx(
            f,
            {
              value: o.firstName,
              isErrored: !!d.firstName,
              disabled: l("firstName")?.disabled,
              onChange: (s) => {
                t("firstName", s), n("firstName", s, a);
              }
            }
          ),
          /* @__PURE__ */ e.jsx(
            k,
            {
              value: o.lastName,
              isErrored: !!d.lastName,
              disabled: l("lastName")?.disabled,
              onChange: (s) => {
                t("lastName", s), n("lastName", s, a);
              }
            }
          )
        ] }),
        a.programTheme.idCheckAddOnEnabled ? /* @__PURE__ */ e.jsx(
          F,
          {
            errorId: d.birthDate,
            locale: u,
            disabled: l("birthDate")?.disabled,
            onChange: (s) => {
              t("birthDate", s), n("birthDate", s, a);
            },
            value: o.birthDate
          }
        ) : null,
        /* @__PURE__ */ e.jsx(
          O,
          {
            value: o.email,
            isErrored: !!d.email,
            explanation: /* @__PURE__ */ e.jsx(
              p,
              {
                id: "emailExplanation",
                defaultMessage: "Must be your school-issued email address"
              }
            ),
            onChange: (s) => {
              t("email", s), n("email", s, a);
            },
            onKeyDown: (s) => N(s),
            disabled: l("email")?.disabled
          }
        ),
        a.programTheme.isSmsNotifierConfigured || a.programTheme.smsLoopEnabled ? /* @__PURE__ */ e.jsx(
          I,
          {
            isRequired: !!a.programTheme.smsLoopEnabled,
            value: o.phoneNumber,
            isErrored: !!d.phoneNumber,
            onChange: (s) => {
              t("phoneNumber", s), n("phoneNumber", s, a);
            },
            selectedCountryCode: o.countryChoice && o.countryChoice.value,
            disabled: l("phoneNumber")?.disabled
          }
        ) : null,
        P(a.programTheme, o) ? /* @__PURE__ */ e.jsx(
          A,
          {
            isErrored: !!d.postalCode,
            onChange: (s) => {
              t("postalCode", s), n("postalCode", s, a);
            },
            value: o.postalCode,
            disabled: l("postalCode")?.disabled
          }
        ) : null,
        C.customFormFields.map((s) => /* @__PURE__ */ e.jsx(y, { config: s, verificationService: a })),
        /* @__PURE__ */ e.jsx(
          D,
          {
            verificationService: a,
            isErrored: !!d.marketConsentValue,
            onChange: (s) => {
              t("metadata", {
                ...a.viewModel.metadata,
                marketConsentValue: s
              }), n("marketConsentValue", s, a);
            },
            viewModel: o,
            disabled: l("marketConsentValue")?.disabled
          }
        ),
        /* @__PURE__ */ e.jsx(T, { verificationService: a, suffix: "CollectAboveSubmit" }),
        /* @__PURE__ */ e.jsx(
          V,
          {
            verificationService: a,
            isErrored: !!d.captchaToken
          }
        ),
        /* @__PURE__ */ e.jsx(
          z,
          {
            step: i.collectTeacherPersonalInfo,
            verificationService: a,
            viewModel: o,
            failedInstantMatch: h,
            buttonText: /* @__PURE__ */ e.jsx(
              p,
              {
                id: "step.personalInfo.submitButtonText",
                defaultMessage: "Verify My Teacher Status"
              }
            )
          }
        )
      ]
    }
  );
}, Z = w;
export {
  Z as default
};
