@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
220 lines (218 loc) • 7.25 kB
JavaScript
/**
* VERSION: 2.113.0-alpha.0
* BUILD_TIMESTAMP: 1750184680813
* BUILD_DATE: Tue Jun 17 2025 18:24:40 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 896154e79f58fffa6d52f3ed37f2db760a63df88
*/
import { j as a, M as k, N as P, m as V, w as f, a1 as A, f as t, ag as u, ah as R, a3 as q, u as n, O as w, T as z, U as B, a9 as L, ai as D, aj as O, W, E as U, n as H, X as K, Y as X, Z as Y, _ as Z, o as _, V as G, q as J } from "./es6-B9qAIX4x.js";
import { injectIntl as Q, FormattedHTMLMessage as p } from "react-intl";
const $ = ({
intl: I,
verificationService: e
}) => {
var C, g, h, b, x, y, i, j, E, N, M;
const o = e.viewModel, { fieldValidationErrors: d } = e, T = P(), m = (s, r) => {
const l = J(
o,
(F) => {
F[s] = r;
}
);
e.updateViewModel(l);
};
return /* @__PURE__ */ a.jsxs(
k,
{
verificationService: e,
step: e.verificationResponse.currentStep,
children: [
/* @__PURE__ */ a.jsx(
V,
{
verificationService: e,
classNameIdentifier: "employment"
}
),
/* @__PURE__ */ a.jsx(f, { verificationService: e }),
/* @__PURE__ */ a.jsx(
A,
{
verificationService: e,
disabled: (C = t("country")) == null ? void 0 : C.disabled,
viewModelDraftDecorator: (s, r) => {
const l = s;
l.shouldCollectAddress = u(
r,
e.programTheme.config.countries
), l.shouldCollectAddress ? l.fieldsToSkipValidation = void 0 : (l.address1 = "", l.city = "", l.state = "", l.postalCode = "", l.fieldsToSkipValidation = ["address1", "city", "state", "postalCode"]);
}
}
),
/* @__PURE__ */ a.jsx(
R,
{
value: e.viewModel.organization,
verificationService: e,
isErrored: !!d.organization,
disabled: (g = t("organization")) == null ? void 0 : g.disabled,
onChange: (s) => {
q(s, e), n("organization", s, e);
}
}
),
/* @__PURE__ */ a.jsxs("div", { className: "sid-names", children: [
/* @__PURE__ */ a.jsx(
w,
{
value: o.firstName,
isErrored: !!d.firstName,
disabled: (h = t("firstName")) == null ? void 0 : h.disabled,
onChange: (s) => {
m("firstName", s), n("firstName", s, e);
}
}
),
/* @__PURE__ */ a.jsx(
z,
{
value: o.lastName,
isErrored: !!d.lastName,
disabled: (b = t("lastName")) == null ? void 0 : b.disabled,
onChange: (s) => {
m("lastName", s), n("lastName", s, e);
}
}
)
] }),
u(
o.countryChoice,
e.programTheme.config.countries
) ? /* @__PURE__ */ a.jsx(
B,
{
isErrored: !!d.address1,
errorId: d.address1,
onChange: (s) => {
m("address1", s), n("address1", s, e);
},
isRequired: !0,
value: o.address1,
disabled: (x = t("address1")) == null ? void 0 : x.disabled,
explanation: /* @__PURE__ */ a.jsx(p, { id: "addressExplanation", defaultMessage: "Use your home address" })
}
) : null,
u(
o.countryChoice,
e.programTheme.config.countries
) ? /* @__PURE__ */ a.jsxs("div", { className: "sid-thirds", children: [
/* @__PURE__ */ a.jsx(
L,
{
isErrored: !!d.city,
errorId: d.city,
onChange: (s) => {
m("city", s), n("city", s, e);
},
value: o.city,
isRequired: !0,
disabled: (y = t("city")) == null ? void 0 : y.disabled
}
),
/* @__PURE__ */ a.jsx(
D,
{
isRequired: !0,
options: O(e.programTheme, I),
value: o.state || void 0,
isErrored: !!d.state,
onChange: async (s) => {
const r = s ? s.value : void 0;
m("state", r), n("state", r, e);
},
label: /* @__PURE__ */ a.jsx(p, { id: "state", defaultMessage: "State" }),
disabled: (i = t("state")) == null ? void 0 : i.disabled
}
),
/* @__PURE__ */ a.jsx(
W,
{
isErrored: !!d.postalCode,
onChange: (s) => {
m("postalCode", s), n("postalCode", s, e);
},
value: o.postalCode,
disabled: (j = t("postalCode")) == null ? void 0 : j.disabled
}
)
] }) : null,
/* @__PURE__ */ a.jsx(
U,
{
value: o.email,
isErrored: !!d.email,
explanation: /* @__PURE__ */ a.jsx(
p,
{
id: "emailExplanation",
defaultMessage: "Use your work email if you have one"
}
),
onChange: (s) => {
m("email", s), n("email", s, e);
},
onKeyDown: (s) => H(s),
disabled: (E = t("email")) == null ? void 0 : E.disabled
}
),
e.programTheme.isSmsNotifierConfigured || e.programTheme.smsLoopEnabled ? /* @__PURE__ */ a.jsx(
K,
{
isRequired: !!e.programTheme.smsLoopEnabled,
value: o.phoneNumber,
isErrored: !!d.phoneNumber,
onChange: (s) => {
m("phoneNumber", s), n("phoneNumber", s, e);
},
selectedCountryCode: o.countryChoice && o.countryChoice.value,
disabled: (N = t("phoneNumber")) == null ? void 0 : N.disabled
}
) : null,
T.customFormFields.map((s) => /* @__PURE__ */ a.jsx(X, { config: s, verificationService: e })),
/* @__PURE__ */ a.jsx(
Y,
{
verificationService: e,
isErrored: !!d.marketConsentValue,
onChange: (s) => {
m("metadata", {
...e.viewModel.metadata,
marketConsentValue: s
}), n("marketConsentValue", s, e);
},
viewModel: o,
disabled: (M = t("marketConsentValue")) == null ? void 0 : M.disabled
}
),
/* @__PURE__ */ a.jsx(Z, { verificationService: e, suffix: "CollectAboveSubmit" }),
/* @__PURE__ */ a.jsx(
_,
{
step: G.collectEmployeePersonalInfo,
verificationService: e,
viewModel: o,
buttonText: /* @__PURE__ */ a.jsx(
p,
{
id: "step.personalInfo.submitButtonText",
defaultMessage: "Verify My Employment Status"
}
)
}
)
]
}
);
}, v = Q($);
export {
v as default
};