UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

253 lines (251 loc) • 7.7 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 I, j as s, N, O as f, m as y, x as E, a2 as j, f as t, ae as P, ax as F, ag as D, o as n, ay as T, a4 as V, T as K, U as R, a5 as c, X as k, E as L, n as z, Y as B, a6 as O, Z as w, _ as q, $ as A, p as H, V as W, ad as _, az as $ } from "./es6-OV3Jb0XZ.js"; import U from "react"; import { injectIntl as Y, FormattedHTMLMessage as m } from "react-intl"; import { u as G } from "./useCollectFieldsEndpoint-BDmlArxx.js"; const X = { AT: "gbrNummer", ES: "numeroColegiado", DK: "autorisationsId", CH: "globalLocationNumber", IE: "registrationNumber", GB: "registrationNumber" }, p = (u) => { const a = X[u] || "registrationNumber"; return { labelKey: `step.collectMedicalPersonalInfo.${a}Label`, explanationKey: `step.collectMedicalPersonalInfo.${a}Explanation` }; }, Z = ({ intl: u, verificationService: a }) => { const o = a.viewModel, { fieldValidationErrors: l } = a, r = a.verificationResponse, b = I(r), C = f(), g = o.localeChoice.value, d = (e, M) => { const h = _(o, e, M); a.updateViewModel(h); }, { isFieldOptional: x } = G({ verificationId: r.verificationId, currentStep: r.currentStep, viewModel: o }), i = x("memberId"); return U.useEffect(() => { i ? a.updateViewModel({ fieldsToSkipValidation: [] }, { partial: !0 }) : a.updateViewModel( { fieldsToSkipValidation: ["memberId"] }, { partial: !0 } ); }, [i]), /* @__PURE__ */ s.jsxs( N, { verificationService: a, step: r.currentStep, children: [ /* @__PURE__ */ s.jsx( y, { verificationService: a, classNameIdentifier: "medical-personal-info" } ), /* @__PURE__ */ s.jsx(E, { verificationService: a }), /* @__PURE__ */ s.jsx( j, { verificationService: a, disabled: t("country")?.disabled } ), /* @__PURE__ */ s.jsx( P, { segmentId: "medical", value: { value: o.status, label: D( u, o.status, $ ) }, isErrored: !!l.status, options: F(u, r.availableStatuses), disabled: t("status")?.disabled, onChange: (e) => { d("status", e ? e.value : ""), n( "status", e ? e.value : "", a ); } } ), /* @__PURE__ */ s.jsx( T, { isErrored: !!l.organization, onChange: (e) => { V(e, a), n("organization", e, a); }, value: a.viewModel.organization, verificationService: a, disabled: t("organization")?.disabled } ), /* @__PURE__ */ s.jsxs("div", { className: "sid-names", children: [ /* @__PURE__ */ s.jsx( K, { value: o.firstName, isErrored: !!l.firstName, disabled: t("firstName")?.disabled, onChange: (e) => { d("firstName", e), n("firstName", e, a); } } ), /* @__PURE__ */ s.jsx( R, { value: o.lastName, isErrored: !!l.lastName, disabled: t("lastName")?.disabled, onChange: (e) => { d("lastName", e), n("lastName", e, a); } } ) ] }), /* @__PURE__ */ s.jsx( c, { errorId: l.birthDate, locale: g, disabled: t("birthDate")?.disabled, onChange: (e) => { d("birthDate", e), n("birthDate", e, a); }, value: o.birthDate } ), /* @__PURE__ */ s.jsx( k, { isErrored: !!l.postalCode, onChange: (e) => { d("postalCode", e), n("postalCode", e, a); }, value: o.postalCode, disabled: t("postalCode")?.disabled, explanation: /* @__PURE__ */ s.jsx( m, { id: "postalCodeExplanation", defaultMessage: "Use the location on file with your licensing body" } ) } ), /* @__PURE__ */ s.jsx( L, { value: o.email, isErrored: !!l.email, explanation: /* @__PURE__ */ s.jsx( m, { id: "emailExplanation", defaultMessage: "Needed to send you your unique code" } ), onChange: (e) => { d("email", e), n("email", e, a); }, onKeyDown: (e) => z(e), disabled: t("email")?.disabled } ), a.programTheme.isSmsNotifierConfigured || a.programTheme.smsLoopEnabled ? /* @__PURE__ */ s.jsx( B, { isRequired: !!a.programTheme.smsLoopEnabled, value: o.phoneNumber, isErrored: !!l.phoneNumber, onChange: (e) => { d("phoneNumber", e), n("phoneNumber", e, a); }, selectedCountryCode: o.countryChoice && o.countryChoice.value, disabled: t("phoneNumber")?.disabled } ) : null, i && /* @__PURE__ */ s.jsx( O, { value: o.memberId, isErrored: !!l.memberId, isRequired: t("memberId")?.requireIfOptional, disabled: t("memberId")?.disabled, onChange: (e) => { d("memberId", e), n("memberId", e, a); }, explanation: /* @__PURE__ */ s.jsx( m, { id: p(o.country).explanationKey, defaultMessage: "Your Professional Membership Registration Number" } ), label: /* @__PURE__ */ s.jsx( m, { id: p(o.country).labelKey, defaultMessage: "Registration Number" } ) } ), C.customFormFields.map((e) => /* @__PURE__ */ s.jsx(w, { config: e, verificationService: a })), /* @__PURE__ */ s.jsx( q, { verificationService: a, isErrored: !!l.marketConsentValue, onChange: (e) => { d("metadata", { ...a.viewModel.metadata, marketConsentValue: e }), n("marketConsentValue", e, a); }, viewModel: o, disabled: t("marketConsentValue")?.disabled } ), /* @__PURE__ */ s.jsx(A, { verificationService: a, suffix: "CollectAboveSubmit" }), /* @__PURE__ */ s.jsx( H, { step: W.collectMedicalProfessionalPersonalInfo, verificationService: a, viewModel: o, failedInstantMatch: b, buttonText: /* @__PURE__ */ s.jsx( m, { id: "step.personalInfo.submitButtonText", defaultMessage: "Verify My Medical Professional Status" } ) } ) ] } ); }, ee = Y( Z ); export { ee as default };