
/**
 *   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 M, g as t, R as g, j as s, P as I, a1 as j, u as n, m as N, F as b, Y as E, V as f, n as F, f as y } from "../sheerid.js";
import { F as P, L as V, B as k, P as T, a as D, M as R, C as q } from "./CaptchaComponent-DJipDl-5.js";
import { E as z, P as B } from "./PersonalInfoStepSubmitButton-q2ua_b8H.js";
import { M as L } from "./MemberIdComponent-OLftjHHc.js";
import { C as O } from "./ChangeLocaleComponent-D317H5S8.js";
import { M as w } from "./MembershipOrganizationComponent-C0QQRDDx.js";
import { C as W } from "./CountryComponentWrapper-DCc0WoEp.js";
import { P as H } from "./PersonalInfoStepWrapper-BCVAx0W6.js";
const K = ({ verificationService: a }) => {
  const o = a.viewModel, { fieldValidationErrors: d } = a, p = a.verificationResponse, u = M(p), C = y(), l = t("memberId")?.requireIfOptional, h = o.localeChoice.value, m = (e, r) => {
    const i = F(
      o,
      (x) => {
        x[e] = r;
      }
    );
    a.updateViewModel(i);
  };
  return g.useEffect(() => {
    const e = (a.viewModel?.fieldsToSkipValidation || []).filter(
      (r) => r !== "memberId"
    );
    l ? a.updateViewModel({ fieldsToSkipValidation: e }, { partial: !0 }) : a.updateViewModel(
      { fieldsToSkipValidation: [...e, "memberId"] },
      { partial: !0 }
    );
  }, [l]), /* @__PURE__ */ s.jsxs(
    H,
    {
      verificationService: a,
      step: p.currentStep,
      children: [
        /* @__PURE__ */ s.jsx(
          I,
          {
            verificationService: a,
            classNameIdentifier: "member-personal-info"
          }
        ),
        /* @__PURE__ */ s.jsx(O, { verificationService: a }),
        /* @__PURE__ */ s.jsx(
          W,
          {
            verificationService: a,
            disabled: t("country")?.disabled
          }
        ),
        /* @__PURE__ */ s.jsx(
          w,
          {
            value: a.viewModel.organization,
            verificationService: a,
            isErrored: !!d.organization,
            disabled: t("organization")?.disabled,
            onChange: (e) => {
              j(e, a), n("organization", e, a);
            }
          }
        ),
        /* @__PURE__ */ s.jsxs("div", { className: "sid-names", children: [
          /* @__PURE__ */ s.jsx(
            P,
            {
              value: o.firstName,
              isErrored: !!d.firstName,
              disabled: t("firstName")?.disabled,
              onChange: (e) => {
                m("firstName", e), n("firstName", e, a);
              }
            }
          ),
          /* @__PURE__ */ s.jsx(
            V,
            {
              value: o.lastName,
              isErrored: !!d.lastName,
              disabled: t("lastName")?.disabled,
              onChange: (e) => {
                m("lastName", e), n("lastName", e, a);
              }
            }
          )
        ] }),
        /* @__PURE__ */ s.jsx(
          z,
          {
            value: o.email,
            isErrored: !!d.email,
            explanation: /* @__PURE__ */ s.jsx(b, { id: "emailExplanation", defaultMessage: " " }),
            onChange: (e) => {
              m("email", e), n("email", e, a);
            },
            onKeyDown: (e) => N(e),
            disabled: t("email")?.disabled
          }
        ),
        /* @__PURE__ */ s.jsx(
          k,
          {
            errorId: d.birthDate,
            locale: h,
            isRequired: t("birthDate")?.requireIfOptional,
            onChange: (e) => {
              m("birthDate", e), n("birthDate", e, a);
            },
            value: o.birthDate,
            disabled: t("birthDate")?.disabled
          }
        ),
        /* @__PURE__ */ s.jsx(
          L,
          {
            value: o.memberId,
            isErrored: !!d.memberId,
            isRequired: l,
            disabled: t("memberId")?.disabled,
            onChange: (e) => {
              m("memberId", e), n("memberId", e, a);
            }
          }
        ),
        a.programTheme.isSmsNotifierConfigured || a.programTheme.smsLoopEnabled ? /* @__PURE__ */ s.jsx(
          T,
          {
            isRequired: !!a.programTheme.smsLoopEnabled,
            value: o.phoneNumber,
            isErrored: !!d.phoneNumber,
            onChange: (e) => {
              m("phoneNumber", e), n("phoneNumber", e, a);
            },
            selectedCountryCode: o.countryChoice && o.countryChoice.value,
            disabled: t("phoneNumber")?.disabled
          }
        ) : null,
        C.customFormFields.map((e) => /* @__PURE__ */ s.jsx(D, { config: e, verificationService: a })),
        /* @__PURE__ */ s.jsx(
          R,
          {
            verificationService: a,
            isErrored: !!d.marketConsentValue,
            onChange: (e) => {
              m("metadata", {
                ...a.viewModel.metadata,
                marketConsentValue: e
              }), n("marketConsentValue", e, a);
            },
            viewModel: o,
            disabled: t("marketConsentValue")?.disabled
          }
        ),
        /* @__PURE__ */ s.jsx(E, { verificationService: a, suffix: "CollectAboveSubmit" }),
        /* @__PURE__ */ s.jsx(
          q,
          {
            verificationService: a,
            isErrored: !!d.captchaToken
          }
        ),
        /* @__PURE__ */ s.jsx(
          B,
          {
            step: f.collectMemberPersonalInfo,
            verificationService: a,
            viewModel: o,
            failedInstantMatch: u,
            buttonText: /* @__PURE__ */ s.jsx(
              b,
              {
                id: "step.personalInfo.submitButtonText",
                defaultMessage: "Verify My Membership Status"
              }
            )
          }
        )
      ]
    }
  );
}, _ = K;
export {
  _ as default
};
