
/**
 *   VERSION: 2.239.0-alpha.0
 *   BUILD_TIMESTAMP: 1780012993002
 *   BUILD_DATE: Fri May 29 2026 00:03:13 GMT+0000 (Coordinated Universal Time)
 *   BUILD_COMMIT: 3344b6c0fd9fa858907db310cfb1ef5e0d224da2
 */
import { i as N, a6 as h, g as d, j as s, F as r, R as g, k as E, n as j, P as M, a1 as I, u as l, m as F, Y as y, V, f as P } from "../sheerid.js";
import { C as T } from "./ChangeLocaleComponent-D317H5S8.js";
import { F as R, L as k, B as D, P as L, a as w, M as q, C as B } from "./CaptchaComponent-CAmFHBQZ.js";
import { C as H } from "./CollegeNameComponent-Q14srw1R.js";
import { E as z, P as A } from "./PersonalInfoStepSubmitButton-BNyfPfz1.js";
import { C as O } from "./CountryComponentWrapper-D4Oa_2ti.js";
import { P as W } from "./PersonalInfoStepWrapper-BCVAx0W6.js";
import { F as K } from "./FormFieldText-CPwStdCx.js";
const X = ({
  value: a,
  isErrored: t,
  onChange: o,
  intl: i,
  explanation: p,
  placeholder: m = "",
  isRequired: u = !1
}) => {
  const b = h("include-cvec-field-france-student"), n = () => b === "labeled-optional" ? /* @__PURE__ */ s.jsx(
    r,
    {
      id: "cvecNumberExplanation",
      defaultMessage: "Optional - Add your CVEC number to increase your chances of being verified instantly."
    }
  ) : /* @__PURE__ */ s.jsx(
    r,
    {
      id: "_EXPERIMENTAL.cvecNumberExplanation",
      defaultMessage: "Add your CVEC number to increase your chances of being verified instantly."
    }
  );
  return d("cvecNumber")?.hidden ? null : /* @__PURE__ */ s.jsx(
    K,
    {
      fieldId: "cvecNumber",
      value: a,
      onChange: o,
      placeholder: m || i.formatHTMLMessage({
        id: "cvecNumberPlaceholder",
        defaultMessage: "CVEC certificate number"
      }),
      label: /* @__PURE__ */ s.jsx(r, { id: "cvecNumber", defaultMessage: "CVEC certificate number" }),
      errorMessage: t && /* @__PURE__ */ s.jsx(
        r,
        {
          id: "errorId.invalidCvecNumber",
          defaultMessage: "Invalid CVEC certificate number"
        }
      ),
      showPlaceholderAndHideLabel: !!m,
      required: u,
      explanation: p || n()
    }
  );
}, Y = N(X), _ = ({
  verificationService: a
}) => {
  const t = a.viewModel, { fieldValidationErrors: o } = a, i = a.verificationResponse, p = P(), m = h("include-cvec-field-france-student"), u = m !== "control" && m !== "default" && t?.countryChoice?.value === "FR";
  g.useEffect(() => {
    const e = (a.viewModel?.fieldsToSkipValidation || []).filter(
      (C) => C !== "cvecNumber"
    );
    u ? n("fieldsToSkipValidation", e) : n("fieldsToSkipValidation", [...e, "cvecNumber"]);
  }, [u]);
  const b = E(i), n = (e, C) => {
    const f = j(
      t,
      (x) => {
        x[e] = C;
      }
    );
    a.updateViewModel(f);
  }, c = t.localeChoice.value;
  return /* @__PURE__ */ s.jsxs(
    W,
    {
      verificationService: a,
      step: i.currentStep,
      children: [
        /* @__PURE__ */ s.jsx(
          M,
          {
            verificationService: a,
            classNameIdentifier: "student-personal-info"
          }
        ),
        /* @__PURE__ */ s.jsx(T, { verificationService: a }),
        /* @__PURE__ */ s.jsx(
          O,
          {
            verificationService: a,
            disabled: d("country")?.disabled
          }
        ),
        /* @__PURE__ */ s.jsx(
          H,
          {
            value: a.viewModel.organization,
            verificationService: a,
            isErrored: !!o.organization,
            isRequired: !0,
            disabled: d("organization")?.disabled,
            onChange: (e) => {
              I(e, a), l("organization", e, a);
            }
          }
        ),
        u && /* @__PURE__ */ s.jsx(
          Y,
          {
            isRequired: d("cvecNumber")?.requireIfOptional,
            value: t.cvecNumber,
            isErrored: !!o.cvecNumber,
            disabled: d("cvecNumber")?.disabled,
            onChange: (e) => {
              n("cvecNumber", e), l("cvecNumber", e, a);
            }
          }
        ),
        /* @__PURE__ */ s.jsxs("div", { className: "sid-names", children: [
          /* @__PURE__ */ s.jsx(
            R,
            {
              value: t.firstName,
              isErrored: !!o.firstName,
              disabled: d("firstName")?.disabled,
              onChange: (e) => {
                n("firstName", e), l("firstName", e, a);
              }
            }
          ),
          /* @__PURE__ */ s.jsx(
            k,
            {
              value: t.lastName,
              isErrored: !!o.lastName,
              disabled: d("lastName")?.disabled,
              onChange: (e) => {
                n("lastName", e), l("lastName", e, a);
              }
            }
          )
        ] }),
        /* @__PURE__ */ s.jsx(
          D,
          {
            value: t.birthDate,
            errorId: o.birthDate,
            locale: c,
            isRequired: !0,
            disabled: d("birthDate")?.disabled,
            onChange: (e) => {
              n("birthDate", e), l("birthDate", e, a);
            }
          }
        ),
        /* @__PURE__ */ s.jsx(
          z,
          {
            value: t.email,
            isErrored: !!o.email,
            explanation: /* @__PURE__ */ s.jsx(
              r,
              {
                id: "emailExplanation",
                defaultMessage: "Personal or school email is fine"
              }
            ),
            onChange: (e) => {
              n("email", e), l("email", e, a);
            },
            onKeyDown: (e) => F(e),
            disabled: d("email")?.disabled
          }
        ),
        a.programTheme.isSmsNotifierConfigured || a.programTheme.smsLoopEnabled ? /* @__PURE__ */ s.jsx(
          L,
          {
            isRequired: !!a.programTheme.smsLoopEnabled,
            value: t.phoneNumber,
            isErrored: !!o.phoneNumber,
            disabled: d("phoneNumber")?.disabled,
            onChange: (e) => {
              n("phoneNumber", e), l("phoneNumber", e, a);
            },
            selectedCountryCode: t.countryChoice && t.countryChoice.value
          }
        ) : null,
        (p.customFormFields || []).map((e) => /* @__PURE__ */ s.jsx(w, { config: e, verificationService: a })),
        " ",
        /* @__PURE__ */ s.jsx(
          q,
          {
            verificationService: a,
            isErrored: !!o.marketConsentValue,
            disabled: d("marketConsentValue")?.disabled,
            onChange: (e) => {
              n("metadata", {
                ...a.viewModel.metadata,
                marketConsentValue: e
              }), l("marketConsentValue", e, a);
            },
            viewModel: t
          }
        ),
        /* @__PURE__ */ s.jsx(y, { verificationService: a, suffix: "CollectAboveSubmit" }),
        /* @__PURE__ */ s.jsx(
          B,
          {
            verificationService: a,
            isErrored: !!o.captchaToken
          }
        ),
        /* @__PURE__ */ s.jsx(
          A,
          {
            step: V.collectStudentPersonalInfo,
            verificationService: a,
            viewModel: t,
            failedInstantMatch: b,
            buttonText: /* @__PURE__ */ s.jsx(
              r,
              {
                id: "step.personalInfo.submitButtonText",
                defaultMessage: "Verify My Student Status"
              }
            )
          }
        )
      ]
    }
  );
}, ee = _;
export {
  ee as default
};
