
/**
 *   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 { h as x, _ as N, j as a, P as g, u as d, g as r, e as j, F as l, $ as E, Y as L, V as M, i as I, k as f, b as F } from "../_mysheerid-preview.js";
import { F as y, L as P, P as D, a as T, M as k, C as R } from "./CaptchaComponent-D-uHsjvA.js";
import { E as V, P as B } from "./PersonalInfoStepSubmitButton-Z9sp6sjQ.js";
import { D as c } from "./DriverLicenseNumberComponent-Bw9LOToD.js";
import { S as q } from "./StateSelectComponent-DJIfavwM.js";
import { C as A } from "./ChangeLocaleComponent-B5F9Azun.js";
import { P as H } from "./PersonalInfoStepWrapper-DgSuVlBj.js";
const K = ({
  intl: u,
  verificationService: s
}) => {
  const t = s.viewModel, { fieldValidationErrors: o } = s, p = s.verificationResponse, i = x(p), b = F(), n = (e, m) => {
    const C = f(
      t,
      (h) => {
        h[e] = m;
      }
    );
    s.updateViewModel(C);
  };
  return N(), /* @__PURE__ */ a.jsxs(
    H,
    {
      verificationService: s,
      step: p.currentStep,
      children: [
        /* @__PURE__ */ a.jsx(
          g,
          {
            verificationService: s,
            classNameIdentifier: "drivers-license"
          }
        ),
        /* @__PURE__ */ a.jsx(A, { verificationService: s }),
        /* @__PURE__ */ a.jsxs("div", { className: "sid-names", children: [
          /* @__PURE__ */ a.jsx(
            y,
            {
              value: t.firstName,
              isErrored: !!o.firstName,
              disabled: r("firstName")?.disabled,
              onChange: (e) => {
                n("firstName", e), d("firstName", e, s);
              }
            }
          ),
          /* @__PURE__ */ a.jsx(
            P,
            {
              value: t.lastName,
              isErrored: !!o.lastName,
              disabled: r("lastName")?.disabled,
              onChange: (e) => {
                n("lastName", e), d("lastName", e, s);
              }
            }
          )
        ] }),
        /* @__PURE__ */ a.jsx(
          V,
          {
            value: t.email,
            isErrored: !!o.email,
            explanation: /* @__PURE__ */ a.jsx(
              l,
              {
                id: "emailExplanation",
                defaultMessage: "Personal email address is recommended"
              }
            ),
            onChange: (e) => {
              n("email", e), d("email", e, s);
            },
            onKeyDown: (e) => j(e),
            disabled: r("email")?.disabled
          }
        ),
        s.programTheme.isSmsNotifierConfigured || s.programTheme.smsLoopEnabled ? /* @__PURE__ */ a.jsx(
          D,
          {
            isRequired: !!s.programTheme.smsLoopEnabled,
            value: t.phoneNumber,
            isErrored: !!o.phoneNumber,
            onChange: (e) => {
              n("phoneNumber", e), d("phoneNumber", e, s);
            },
            selectedCountryCode: t.countryChoice && t.countryChoice.value,
            disabled: r("phoneNumber")?.disabled
          }
        ) : null,
        /* @__PURE__ */ a.jsx(
          q,
          {
            isRequired: !0,
            options: E(s.programTheme, u),
            value: t.state || void 0,
            isErrored: !!o.state,
            disabled: r("state")?.disabled,
            onChange: async (e) => {
              const m = e ? e.value : void 0;
              n("state", m), d("state", m, s);
            },
            label: /* @__PURE__ */ a.jsx(l, { id: "driverLicenseState", defaultMessage: "Driver license state" })
          }
        ),
        /* @__PURE__ */ a.jsx(
          c,
          {
            value: t.driverLicenseNumber,
            isErrored: !!o.driverLicenseNumber,
            isRequired: !0,
            disabled: r("driverLicenseNumber")?.disabled,
            onChange: (e) => {
              n("driverLicenseNumber", e), d(
                "driverLicenseNumber",
                e,
                s
              );
            }
          }
        ),
        b.customFormFields.map((e) => /* @__PURE__ */ a.jsx(T, { config: e, verificationService: s })),
        /* @__PURE__ */ a.jsx(
          k,
          {
            verificationService: s,
            isErrored: !!o.marketConsentValue,
            onChange: (e) => {
              n("metadata", {
                ...s.viewModel.metadata,
                marketConsentValue: e
              }), d("marketConsentValue", e, s);
            },
            viewModel: t,
            disabled: r("marketConsentValue")?.disabled
          }
        ),
        /* @__PURE__ */ a.jsx(L, { verificationService: s, suffix: "CollectAboveSubmit" }),
        /* @__PURE__ */ a.jsx(
          R,
          {
            verificationService: s,
            isErrored: !!o.captchaToken
          }
        ),
        /* @__PURE__ */ a.jsx(
          B,
          {
            step: M.collectDriverLicensePersonalInfo,
            verificationService: s,
            viewModel: t,
            failedInstantMatch: i,
            buttonText: /* @__PURE__ */ a.jsx(
              l,
              {
                id: "step.personalInfo.submitButtonText",
                defaultMessage: "Verify My Identity"
              }
            )
          }
        )
      ]
    }
  );
}, G = I(K);
export {
  K as StepDriverLicensePersonalInfo,
  G as StepDriverLicensePersonalInfoComponent,
  G as default
};
