UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

306 lines (304 loc) • 10.2 kB
/** * VERSION: 2.130.0-alpha.4 * BUILD_TIMESTAMP: 1759000305348 * BUILD_DATE: Sat Sep 27 2025 19:11:45 GMT+0000 (Coordinated Universal Time) * BUILD_COMMIT: be6ef87ab40e8747994d32363389cf39e36a4326 */ import { i as G, h as U, R as Y, j as s, v as $, P as X, a9 as J, E as F, g as l, f as t, b as r, w as Q, x as Z, T as _, a3 as S, al as v, ac as ee, am as ae, an as se, W as oe, y as le, z as ne, X as te, D as de, e as re, G as me, Y as ie, H as pe, M as ue, I as be, k as ge, V as Ce, a2 as xe } from "../sheerid.js"; import { u as he } from "./useCollectFieldsEndpoint-DFo1yXvN.js"; import { u as Me, E as Ie } from "./useEmailFirstExperiment-DH410dM-.js"; const Ee = { AT: "gbrNummer", ES: "numeroColegiado", DK: "autorisationsId", CH: "globalLocationNumber", IE: "registrationNumber", GB: "registrationNumber" }, k = (i) => { const a = Ee[i] || "registrationNumber"; return { labelKey: `step.collectMedicalPersonalInfo.${a}Label`, explanationKey: `step.collectMedicalPersonalInfo.${a}Explanation` }; }, je = ({ intl: i, verificationService: a }) => { var g, C, x, h, M, I, E, j, N, y, f, c, P; const o = a.viewModel, { fieldValidationErrors: n } = a, m = a.verificationResponse, R = U(m), D = Q(), L = o.localeChoice.value, d = (e, W) => { const A = xe(o, e, W); a.updateViewModel(A); }, { isFieldOptional: T } = he({ verificationId: m.verificationId, currentStep: m.currentStep, viewModel: o }), p = T("memberId"), { isEmailUpTop: u, isEmailValidationLoading: w, showFormFields: K, emailLookupResponse: b, emailOnBlur: V, emailOnKeyDown: B, handleResendClick: O, showEmailLookupResponseMessages: z, enableFormFields: H, handleOnClickProceedHere: q } = Me( a.programId, o.email, a.verificationResponse.segment ); return Y.useEffect(() => { p ? a.updateViewModel({ fieldsToSkipValidation: [] }, { partial: !0 }) : a.updateViewModel( { fieldsToSkipValidation: ["memberId"] }, { partial: !0 } ); }, [p]), /* @__PURE__ */ s.jsxs( $, { verificationService: a, step: m.currentStep, children: [ /* @__PURE__ */ s.jsx( X, { verificationService: a, classNameIdentifier: "medical-personal-info" } ), // #region email-first-experiment u && /* @__PURE__ */ s.jsxs("div", { className: "email-input-wrapper", children: [ w && /* @__PURE__ */ s.jsx("div", { className: "email-input-wrapper-frame", children: /* @__PURE__ */ s.jsx("div", { className: "transform-scale", children: /* @__PURE__ */ s.jsx(J, {}) }) }), /* @__PURE__ */ s.jsx( F, { value: o.email, isErrored: !!n.email, explanation: /* @__PURE__ */ s.jsx( r, { id: "emailExplanation", defaultMessage: "Personal email address is recommended" } ), onChange: (e) => { d("email", e), t("email", e, a); }, onKeyDown: B, onBlur: V, disabled: (g = l("email")) == null ? void 0 : g.disabled } ) ] }), z && b && /* @__PURE__ */ s.jsx( Ie, { emailLookupResponse: b, onResendClick: O, onHandleClickLink: q } ), K && /* @__PURE__ */ s.jsxs("div", { className: H || !u ? "" : "sid-disable-elements", children: [ /* @__PURE__ */ s.jsx(Z, { verificationService: a }), /* @__PURE__ */ s.jsx( _, { verificationService: a, disabled: (C = l("country")) == null ? void 0 : C.disabled } ), /* @__PURE__ */ s.jsx( S, { segmentId: "medical", value: { value: o.status, label: ee( i, o.status, ae ) }, isErrored: !!n.status, options: v(i, m.availableStatuses), disabled: (x = l("status")) == null ? void 0 : x.disabled, onChange: (e) => { d("status", e ? e.value : ""), t( "status", e ? e.value : "", a ); } } ), /* @__PURE__ */ s.jsx( se, { isErrored: !!n.organization, onChange: (e) => { oe(e, a), t("organization", e, a); }, value: a.viewModel.organization, verificationService: a, disabled: (h = l("organization")) == null ? void 0 : h.disabled } ), /* @__PURE__ */ s.jsxs("div", { className: "sid-names", children: [ /* @__PURE__ */ s.jsx( le, { value: o.firstName, isErrored: !!n.firstName, disabled: (M = l("firstName")) == null ? void 0 : M.disabled, onChange: (e) => { d("firstName", e), t("firstName", e, a); } } ), /* @__PURE__ */ s.jsx( ne, { value: o.lastName, isErrored: !!n.lastName, disabled: (I = l("lastName")) == null ? void 0 : I.disabled, onChange: (e) => { d("lastName", e), t("lastName", e, a); } } ) ] }), /* @__PURE__ */ s.jsx( te, { errorId: n.birthDate, locale: L, disabled: (E = l("birthDate")) == null ? void 0 : E.disabled, onChange: (e) => { d("birthDate", e), t("birthDate", e, a); }, value: o.birthDate } ), /* @__PURE__ */ s.jsx( de, { isErrored: !!n.postalCode, onChange: (e) => { d("postalCode", e), t("postalCode", e, a); }, value: o.postalCode, disabled: (j = l("postalCode")) == null ? void 0 : j.disabled, explanation: /* @__PURE__ */ s.jsx( r, { id: "postalCodeExplanation", defaultMessage: "Use the location on file with your licensing body" } ) } ), !u && /* @__PURE__ */ s.jsx( F, { value: o.email, isErrored: !!n.email, explanation: /* @__PURE__ */ s.jsx( r, { id: "emailExplanation", defaultMessage: "Needed to send you your unique code" } ), onChange: (e) => { d("email", e), t("email", e, a); }, onKeyDown: (e) => re(e), disabled: (N = l("email")) == null ? void 0 : N.disabled } ), a.programTheme.isSmsNotifierConfigured || a.programTheme.smsLoopEnabled ? /* @__PURE__ */ s.jsx( me, { isRequired: !!a.programTheme.smsLoopEnabled, value: o.phoneNumber, isErrored: !!n.phoneNumber, onChange: (e) => { d("phoneNumber", e), t("phoneNumber", e, a); }, selectedCountryCode: o.countryChoice && o.countryChoice.value, disabled: (y = l("phoneNumber")) == null ? void 0 : y.disabled } ) : null, p && /* @__PURE__ */ s.jsx( ie, { value: o.memberId, isErrored: !!n.memberId, isRequired: (f = l("memberId")) == null ? void 0 : f.requireIfOptional, disabled: (c = l("memberId")) == null ? void 0 : c.disabled, onChange: (e) => { d("memberId", e), t("memberId", e, a); }, explanation: /* @__PURE__ */ s.jsx( r, { id: k(o.country).explanationKey, defaultMessage: "Your Professional Membership Registration Number" } ), label: /* @__PURE__ */ s.jsx( r, { id: k(o.country).labelKey, defaultMessage: "Registration Number" } ) } ), D.customFormFields.map((e) => /* @__PURE__ */ s.jsx(pe, { config: e, verificationService: a })), /* @__PURE__ */ s.jsx( ue, { verificationService: a, isErrored: !!n.marketConsentValue, onChange: (e) => { d("metadata", { ...a.viewModel.metadata, marketConsentValue: e }), t( "marketConsentValue", e, a ); }, viewModel: o, disabled: (P = l("marketConsentValue")) == null ? void 0 : P.disabled } ), /* @__PURE__ */ s.jsx(be, { suffix: "CollectAboveSubmit" }), /* @__PURE__ */ s.jsx( ge, { step: Ce.collectMedicalProfessionalPersonalInfo, verificationService: a, viewModel: o, failedInstantMatch: R, buttonText: /* @__PURE__ */ s.jsx( r, { id: "step.personalInfo.submitButtonText", defaultMessage: "Verify My Medical Professional Status" } ) } ) ] }) ] } ); }, ce = G( je ); export { ce as default };