UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

174 lines (172 loc) 5.43 kB
/** * VERSION: 2.154.0-alpha.1 * BUILD_TIMESTAMP: 1763401626706 * BUILD_DATE: Mon Nov 17 2025 17:47:06 GMT+0000 (Coordinated Universal Time) * BUILD_COMMIT: 73f4468155aaed0f31ab0d59dc3394018b939b6d */ import { k as g, f as t, j as s, N as M, O as I, m as N, x as j, a2 as E, a3 as f, a4 as y, o as n, T as F, U as V, E as D, n as T, a5 as k, a6 as R, Y as O, Z as P, _ as q, $ as z, p as B, V as L, r as w } from "./es6-OV3Jb0XZ.js"; import W from "react"; import { FormattedHTMLMessage as p } from "react-intl"; const _ = ({ verificationService: e }) => { const o = e.viewModel, { fieldValidationErrors: d } = e, r = e.verificationResponse, b = g(r), u = I(), m = t("memberId")?.requireIfOptional, h = o.localeChoice.value, l = (a, C) => { const i = w( o, (x) => { x[a] = C; } ); e.updateViewModel(i); }; return W.useEffect(() => { m ? e.updateViewModel({ fieldsToSkipValidation: [] }, { partial: !0 }) : e.updateViewModel( { fieldsToSkipValidation: ["memberId"] }, { partial: !0 } ); }, [m]), /* @__PURE__ */ s.jsxs( M, { verificationService: e, step: r.currentStep, children: [ /* @__PURE__ */ s.jsx( N, { verificationService: e, classNameIdentifier: "member-personal-info" } ), /* @__PURE__ */ s.jsx(j, { verificationService: e }), /* @__PURE__ */ s.jsx( E, { verificationService: e, disabled: t("country")?.disabled } ), /* @__PURE__ */ s.jsx( f, { value: e.viewModel.organization, verificationService: e, isErrored: !!d.organization, disabled: t("organization")?.disabled, onChange: (a) => { y(a, e), n("organization", a, e); } } ), /* @__PURE__ */ s.jsxs("div", { className: "sid-names", children: [ /* @__PURE__ */ s.jsx( F, { value: o.firstName, isErrored: !!d.firstName, disabled: t("firstName")?.disabled, onChange: (a) => { l("firstName", a), n("firstName", a, e); } } ), /* @__PURE__ */ s.jsx( V, { value: o.lastName, isErrored: !!d.lastName, disabled: t("lastName")?.disabled, onChange: (a) => { l("lastName", a), n("lastName", a, e); } } ) ] }), /* @__PURE__ */ s.jsx( D, { value: o.email, isErrored: !!d.email, explanation: /* @__PURE__ */ s.jsx(p, { id: "emailExplanation", defaultMessage: " " }), onChange: (a) => { l("email", a), n("email", a, e); }, onKeyDown: (a) => T(a), disabled: t("email")?.disabled } ), /* @__PURE__ */ s.jsx( k, { errorId: d.birthDate, locale: h, isRequired: t("birthDate")?.requireIfOptional, onChange: (a) => { l("birthDate", a), n("birthDate", a, e); }, value: o.birthDate, disabled: t("birthDate")?.disabled } ), /* @__PURE__ */ s.jsx( R, { value: o.memberId, isErrored: !!d.memberId, isRequired: m, disabled: t("memberId")?.disabled, onChange: (a) => { l("memberId", a), n("memberId", a, e); } } ), e.programTheme.isSmsNotifierConfigured || e.programTheme.smsLoopEnabled ? /* @__PURE__ */ s.jsx( O, { isRequired: !!e.programTheme.smsLoopEnabled, value: o.phoneNumber, isErrored: !!d.phoneNumber, onChange: (a) => { l("phoneNumber", a), n("phoneNumber", a, e); }, selectedCountryCode: o.countryChoice && o.countryChoice.value, disabled: t("phoneNumber")?.disabled } ) : null, u.customFormFields.map((a) => /* @__PURE__ */ s.jsx(P, { config: a, verificationService: e })), /* @__PURE__ */ s.jsx( q, { verificationService: e, isErrored: !!d.marketConsentValue, onChange: (a) => { l("metadata", { ...e.viewModel.metadata, marketConsentValue: a }), n("marketConsentValue", a, e); }, viewModel: o, disabled: t("marketConsentValue")?.disabled } ), /* @__PURE__ */ s.jsx(z, { verificationService: e, suffix: "CollectAboveSubmit" }), /* @__PURE__ */ s.jsx( B, { step: L.collectMemberPersonalInfo, verificationService: e, viewModel: o, failedInstantMatch: b, buttonText: /* @__PURE__ */ s.jsx( p, { id: "step.personalInfo.submitButtonText", defaultMessage: "Verify My Membership Status" } ) } ) ] } ); }, U = _; export { U as default };