UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

286 lines (284 loc) • 9.15 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 M, B as h, l as x, m as L, R as y, J as P, j as o, P as T, g as d, p as E, A as f, o as n, a9 as w, a2 as F, D as V, _ as B, F as b, Y as R, n as O, V as z, e as D, aa as A } from "../_mysheerid-preview.js"; import { B as k } from "./militaryStepHelpers-jW2_4c1l.js"; import { E as _, P as q } from "./PersonalInfoStepSubmitButton-v_kWLmEw.js"; import { F as H, L as W, P as Y, a as c, M as G, C as K } from "./CaptchaComponent-CnWyxiTy.js"; import { S as U } from "./StatusComponent-pmuIhuXi.js"; import { E as J, L as S } from "./EBTCardNumberComponent-oYQJ_tP7.js"; import { P as Q } from "./PostalCodeComponent-KXVfZkLx.js"; import { C as X } from "./ChangeLocaleComponent-Cu2DR-Q3.js"; import { C as Z } from "./CountryComponentWrapper--2UQ7mXP.js"; import { A as $ } from "./AddressComponent-DV2Wsw6k.js"; import { C as v } from "./City-BmrJpnS6.js"; import { S as ss } from "./StateSelectComponent-CIpB-Rh1.js"; import { P as es } from "./PersonalInfoStepWrapper-BOBNCgik.js"; const as = ({ intl: u, verificationService: e }) => { const { viewModel: a } = e, I = D(); if (!h(a)) return x.error("Expected LowIncomePersonalInfoViewModel"), null; const { fieldValidationErrors: t } = e, { verificationResponse: C } = e, N = L( C ), j = a.localeChoice.value, m = a.statuses[0] ? a.statuses[0] : void 0, g = m === "SNAP_BENEFITS", l = (s, r) => { if (!h(a)) { x.error("Expected LowIncomePersonalInfoViewModel"); return; } const i = E( a, (p) => { p[s] = r; } ); e.updateViewModel(i); }; return y.useEffect(() => { g && P({ fieldsToSkipValidation: ["organization"] }); }, [g]), /* @__PURE__ */ o.jsxs( es, { verificationService: e, step: C.currentStep, children: [ /* @__PURE__ */ o.jsx( T, { verificationService: e, classNameIdentifier: "low-income" } ), /* @__PURE__ */ o.jsx(X, { verificationService: e }), /* @__PURE__ */ o.jsx( Z, { verificationService: e, disabled: d("country")?.disabled } ), /* @__PURE__ */ o.jsx( U, { segmentId: "low-income", value: { value: a.statuses ? a.statuses[0] : "", label: a.statuses ? F(u, a.statuses[0], A) : "" }, isErrored: !!t.statuses, disabled: d("status")?.disabled, options: w( u, C.availableStatuses ), onChange: (s) => { const r = s ? [s.value] : [], i = E( a, (p) => { a.statuses[0] !== r[0] && (p.organization = f.organization), p.statuses = r; } ); e.updateViewModel(i), n( "statuses", s ? s.value : "", e ); } } ), m === "SNAP_BENEFITS" && /* @__PURE__ */ o.jsx( J, { value: a.ebtCardNumber, isErrored: !!t.ebtCardNumber, disabled: d("ebtCardNumber")?.disabled, onChange: (s) => { l("ebtCardNumber", s), n("ebtCardNumber", s, e); } } ), (m === "OTHER_GOVERNMENT_ASSISTANCE" || m === "COMMUNITY_ELIGIBILITY_PROVISION") && /* @__PURE__ */ o.jsx( S, { isErrored: !!t.organization, onChange: (s) => { B(s, e), n("organization", s, e); }, value: V(e.viewModel.organization), verificationService: e, isRequired: !0, disabled: d("organization")?.disabled } ), /* @__PURE__ */ o.jsxs("div", { className: "sid-names", children: [ /* @__PURE__ */ o.jsx( H, { value: a.firstName, isErrored: !!t.firstName, disabled: d("firstName")?.disabled, onChange: (s) => { l("firstName", s), n("firstName", s, e); } } ), /* @__PURE__ */ o.jsx( W, { value: a.lastName, isErrored: !!t.lastName, disabled: d("lastName")?.disabled, onChange: (s) => { l("lastName", s), n("lastName", s, e); } } ) ] }), /* @__PURE__ */ o.jsx( k, { errorId: t.birthDate, locale: j, disabled: d("birthDate")?.disabled, onChange: (s) => { l("birthDate", s), n("birthDate", s, e); }, value: a.birthDate } ), /* @__PURE__ */ o.jsx( $, { isErrored: !!t.address1, errorId: t.address1, disabled: d("address1")?.disabled, onChange: (s) => { l("address1", s), n("address1", s, e); }, value: a.address1, isRequired: !0, explanation: /* @__PURE__ */ o.jsx(b, { id: "addressExplanation", defaultMessage: "Use your home address" }) } ), /* @__PURE__ */ o.jsxs("div", { className: "sid-address-extra-fields sid-thirds", children: [ /* @__PURE__ */ o.jsx( v, { isErrored: !!t.city, errorId: t.city, onChange: (s) => { l("city", s), n("city", s, e); }, value: a.city, isRequired: !0, disabled: d("city")?.disabled } ), /* @__PURE__ */ o.jsx( ss, { isRequired: !0, options: R(e.programTheme, u), value: a.state || void 0, isErrored: !!t.state, disabled: d("state")?.disabled, onChange: async (s) => { const r = s ? s.value : void 0; l("state", r), n("state", r, e); } } ), /* @__PURE__ */ o.jsx( Q, { isErrored: !!t.postalCode, onChange: (s) => { l("postalCode", s), n("postalCode", s, e); }, value: a.postalCode, disabled: d("postalCode")?.disabled } ) ] }), /* @__PURE__ */ o.jsx( _, { value: a.email, isErrored: !!t.email, explanation: /* @__PURE__ */ o.jsx(b, { id: "emailExplanation", defaultMessage: " " }), onChange: (s) => { l("email", s), n("email", s, e); }, onKeyDown: (s) => O(s), disabled: d("email")?.disabled } ), e.programTheme.isSmsNotifierConfigured || e.programTheme.smsLoopEnabled ? /* @__PURE__ */ o.jsx( Y, { isRequired: !!e.programTheme.smsLoopEnabled, value: a.phoneNumber, isErrored: !!t.phoneNumber, onChange: (s) => { l("phoneNumber", s), n("phoneNumber", s, e); }, selectedCountryCode: a.countryChoice && a.countryChoice.value, disabled: d("phoneNumber")?.disabled } ) : null, (I.customFormFields || []).map((s) => /* @__PURE__ */ o.jsx(c, { config: s, verificationService: e })), " ", /* @__PURE__ */ o.jsx( G, { verificationService: e, isErrored: !!t.marketConsentValue, onChange: (s) => { l("metadata", { ...e.viewModel.metadata, marketConsentValue: s }), n("marketConsentValue", s, e); }, viewModel: a, disabled: d("marketConsentValue")?.disabled } ), /* @__PURE__ */ o.jsx( K, { verificationService: e, isErrored: !!t.captchaToken } ), /* @__PURE__ */ o.jsx( q, { step: z.collectLowIncomePersonalInfo, verificationService: e, viewModel: a, failedInstantMatch: N, buttonText: /* @__PURE__ */ o.jsx( b, { id: "step.personalInfo.submitButtonText", defaultMessage: "Verify Status" } ) } ) ] } ); }, hs = M(as); export { hs as default };