UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

275 lines (273 loc) • 8.66 kB
/** * 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.230.0-alpha.0 * BUILD_TIMESTAMP: 1778694697559 * BUILD_DATE: Wed May 13 2026 17:51:37 GMT+0000 (Coordinated Universal Time) * BUILD_COMMIT: 7af1c105d5485ac4ed1190c56d492bb4590667a9 */ import { i as I, m as f, R as N, j as s, P as E, g as t, o as n, a6 as j, a2 as y, _ as P, F as m, n as F, U as T, V as D, x as V, e as R, a7 as k } from "../_mysheerid-preview.js"; import { u as K } from "./useCollectFieldsEndpoint-Cd6d_u47.js"; import { F as L, L as c, P as B, a as w, M as z, C as O } from "./CaptchaComponent-CnWyxiTy.js"; import { E as q, P as A } from "./PersonalInfoStepSubmitButton-v_kWLmEw.js"; import { B as H } from "./militaryStepHelpers-jW2_4c1l.js"; import { P as W } from "./PostalCodeComponent-KXVfZkLx.js"; import { S as U } from "./StatusComponent-pmuIhuXi.js"; import { M as $ } from "./MedicalProfessionalOrganizationComponent-CXHX25GN.js"; import { C as G } from "./CountryComponentWrapper--2UQ7mXP.js"; import { M as Y } from "./MemberIdComponent-oanWSvQh.js"; import { C as _ } from "./ChangeLocaleComponent-Cu2DR-Q3.js"; import { P as J } from "./PersonalInfoStepWrapper-BOBNCgik.js"; const Q = { AT: "gbrNummer", ES: "numeroColegiado", DK: "autorisationsId", CH: "globalLocationNumber", IE: "registrationNumber", GB: "registrationNumber" }, b = (i) => { const a = Q[i] || "registrationNumber"; return { labelKey: `step.collectMedicalPersonalInfo.${a}Label`, explanationKey: `step.collectMedicalPersonalInfo.${a}Explanation` }; }, X = ({ intl: i, verificationService: a }) => { const o = a.viewModel, { fieldValidationErrors: l } = a, r = a.verificationResponse, C = f(r), g = R(), M = o.localeChoice.value, d = (e, u) => { const h = V(o, e, u); a.updateViewModel(h); }, { isFieldOptional: x } = K({ verificationId: r.verificationId, currentStep: r.currentStep, viewModel: o }), p = x("memberId"); return N.useEffect(() => { const e = (a.viewModel?.fieldsToSkipValidation || []).filter( (u) => u !== "memberId" ); p ? a.updateViewModel({ fieldsToSkipValidation: e }, { partial: !0 }) : a.updateViewModel( { fieldsToSkipValidation: [...e, "memberId"] }, { partial: !0 } ); }, [p]), /* @__PURE__ */ s.jsxs( J, { verificationService: a, step: r.currentStep, children: [ /* @__PURE__ */ s.jsx( E, { verificationService: a, classNameIdentifier: "medical-personal-info" } ), /* @__PURE__ */ s.jsx(_, { verificationService: a }), /* @__PURE__ */ s.jsx( G, { verificationService: a, disabled: t("country")?.disabled } ), /* @__PURE__ */ s.jsx( U, { segmentId: "medical", value: { value: o.status, label: y( i, o.status, k ) }, isErrored: !!l.status, options: j(i, r.availableStatuses), disabled: t("status")?.disabled, onChange: (e) => { d("status", e ? e.value : ""), n( "status", e ? e.value : "", a ); } } ), /* @__PURE__ */ s.jsx( $, { isErrored: !!l.organization, onChange: (e) => { P(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( L, { value: o.firstName, isErrored: !!l.firstName, disabled: t("firstName")?.disabled, onChange: (e) => { d("firstName", e), n("firstName", e, a); } } ), /* @__PURE__ */ s.jsx( c, { value: o.lastName, isErrored: !!l.lastName, disabled: t("lastName")?.disabled, onChange: (e) => { d("lastName", e), n("lastName", e, a); } } ) ] }), /* @__PURE__ */ s.jsx( H, { errorId: l.birthDate, locale: M, disabled: t("birthDate")?.disabled, onChange: (e) => { d("birthDate", e), n("birthDate", e, a); }, value: o.birthDate } ), /* @__PURE__ */ s.jsx( W, { 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( q, { 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) => F(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, p && /* @__PURE__ */ s.jsx( Y, { 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: b(o.country).explanationKey, defaultMessage: "Your Professional Membership Registration Number" } ), label: /* @__PURE__ */ s.jsx( m, { id: b(o.country).labelKey, defaultMessage: "Registration Number" } ) } ), g.customFormFields.map((e) => /* @__PURE__ */ s.jsx(w, { config: e, verificationService: a })), /* @__PURE__ */ s.jsx( z, { 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(T, { verificationService: a, suffix: "CollectAboveSubmit" }), /* @__PURE__ */ s.jsx( O, { verificationService: a, isErrored: !!l.captchaToken } ), /* @__PURE__ */ s.jsx( A, { step: D.collectMedicalProfessionalPersonalInfo, verificationService: a, viewModel: o, failedInstantMatch: C, buttonText: /* @__PURE__ */ s.jsx( m, { id: "step.personalInfo.submitButtonText", defaultMessage: "Verify My Medical Professional Status" } ) } ) ] } ); }, me = I( X ); export { me as default };