@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
255 lines (253 loc) • 7.84 kB
JavaScript
/**
* 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.154.0-alpha.1
* BUILD_TIMESTAMP: 1763401584959
* BUILD_DATE: Mon Nov 17 2025 17:46:24 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 73f4468155aaed0f31ab0d59dc3394018b939b6d
*/
import { i as I, h as N, R as y, j as s, x as E, y as j, P as f, z as P, Y as F, a as t, a9 as D, am as K, ab as R, k as n, an as T, ao as V, _ as c, B as k, D as B, $ as L, H as z, c as m, E as O, f as w, J as q, a0 as H, K as A, M as W, N as $, m as Y, V as G, a8 as J } from "../_mysheerid-preview.js";
import { u as U } from "./useCollectFieldsEndpoint-DIzHv7w9.js";
const _ = {
AT: "gbrNummer",
ES: "numeroColegiado",
DK: "autorisationsId",
CH: "globalLocationNumber",
IE: "registrationNumber",
GB: "registrationNumber"
}, p = (u) => {
const a = _[u] || "registrationNumber";
return {
labelKey: `step.collectMedicalPersonalInfo.${a}Label`,
explanationKey: `step.collectMedicalPersonalInfo.${a}Explanation`
};
}, Q = ({
intl: u,
verificationService: a
}) => {
const o = a.viewModel, { fieldValidationErrors: l } = a, r = a.verificationResponse, b = N(r), C = j(), g = o.localeChoice.value, d = (e, M) => {
const h = J(o, e, M);
a.updateViewModel(h);
}, { isFieldOptional: x } = U({
verificationId: r.verificationId,
currentStep: r.currentStep,
viewModel: o
}), i = x("memberId");
return y.useEffect(() => {
i ? a.updateViewModel({ fieldsToSkipValidation: [] }, { partial: !0 }) : a.updateViewModel(
{ fieldsToSkipValidation: ["memberId"] },
{ partial: !0 }
);
}, [i]), /* @__PURE__ */ s.jsxs(
E,
{
verificationService: a,
step: r.currentStep,
children: [
/* @__PURE__ */ s.jsx(
f,
{
verificationService: a,
classNameIdentifier: "medical-personal-info"
}
),
/* @__PURE__ */ s.jsx(P, { verificationService: a }),
/* @__PURE__ */ s.jsx(
F,
{
verificationService: a,
disabled: t("country")?.disabled
}
),
/* @__PURE__ */ s.jsx(
D,
{
segmentId: "medical",
value: {
value: o.status,
label: R(
u,
o.status,
T
)
},
isErrored: !!l.status,
options: K(u, r.availableStatuses),
disabled: t("status")?.disabled,
onChange: (e) => {
d("status", e ? e.value : ""), n(
"status",
e ? e.value : "",
a
);
}
}
),
/* @__PURE__ */ s.jsx(
V,
{
isErrored: !!l.organization,
onChange: (e) => {
c(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(
B,
{
value: o.lastName,
isErrored: !!l.lastName,
disabled: t("lastName")?.disabled,
onChange: (e) => {
d("lastName", e), n("lastName", e, a);
}
}
)
] }),
/* @__PURE__ */ s.jsx(
L,
{
errorId: l.birthDate,
locale: g,
disabled: t("birthDate")?.disabled,
onChange: (e) => {
d("birthDate", e), n("birthDate", e, a);
},
value: o.birthDate
}
),
/* @__PURE__ */ s.jsx(
z,
{
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(
O,
{
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) => w(e),
disabled: t("email")?.disabled
}
),
a.programTheme.isSmsNotifierConfigured || a.programTheme.smsLoopEnabled ? /* @__PURE__ */ s.jsx(
q,
{
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(
H,
{
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(A, { config: e, verificationService: a })),
/* @__PURE__ */ s.jsx(
W,
{
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($, { verificationService: a, suffix: "CollectAboveSubmit" }),
/* @__PURE__ */ s.jsx(
Y,
{
step: G.collectMedicalProfessionalPersonalInfo,
verificationService: a,
viewModel: o,
failedInstantMatch: b,
buttonText: /* @__PURE__ */ s.jsx(
m,
{
id: "step.personalInfo.submitButtonText",
defaultMessage: "Verify My Medical Professional Status"
}
)
}
)
]
}
);
}, S = I(
Q
);
export {
S as default
};