
/**
 *   VERSION: 2.239.0-alpha.0
 *   BUILD_TIMESTAMP: 1780012993002
 *   BUILD_DATE: Fri May 29 2026 00:03:13 GMT+0000 (Coordinated Universal Time)
 *   BUILD_COMMIT: 3344b6c0fd9fa858907db310cfb1ef5e0d224da2
 */
import { i as T, G as O, l as I, R as h, H as x, a as M, n as z, I as w, g as b, j as a, F as r, J as j } from "../sheerid.js";
import { F as L } from "./FormFieldInputSelect-eZgsxRw0.js";
import { F as H } from "./FormFieldTypeahead-CVa8xBC0.js";
import { F as v } from "./FormFieldText-CPwStdCx.js";
const S = ({
  value: t,
  isErrored: m,
  onChange: d,
  intl: l,
  placeholder: s = "",
  isRequired: u = !1,
  verificationService: n,
  disabled: g = !1
}) => {
  const { viewModel: o, programTheme: N, fieldValidationErrors: p } = n;
  if (!O(o))
    return I.error("Expected low-income view model is malformed"), null;
  const f = o.statuses[0] ? o.statuses[0] : void 0, [c, C] = h.useState();
  h.useEffect(() => {
    x(
      M(
        z(o, (e) => {
          e.statuses = ["OTHER_GOVERNMENT_ASSISTANCE"];
        }),
        N
      )
    ).then((e) => {
      if (e) {
        let i = e;
        o.countryChoice && (i = e.filter(
          (F) => F.country === o.countryChoice.value
        )), C(i.map(w));
      }
    }).catch((e) => {
      I.error(e);
    });
  }, []);
  const E = (e, i) => {
    i(e ? {
      id: e.value,
      name: e.label
    } : {
      id: 0,
      name: ""
    });
  };
  return b("organization")?.hidden ? null : f === "COMMUNITY_ELIGIBILITY_PROVISION" ? /* @__PURE__ */ a.jsx(
    H,
    {
      fieldId: "cep-organization",
      value: o.organization,
      verificationService: n,
      onChange: d,
      placeholder: l.formatHTMLMessage({
        id: "schoolNamePlaceholder",
        defaultMessage: "School name"
      }),
      label: /* @__PURE__ */ a.jsx(r, { id: "schoolName", defaultMessage: "School name" }),
      errorMessage: !!p.organization && /* @__PURE__ */ a.jsx(
        r,
        {
          id: "errorId.invalidOrganization",
          defaultMessage: "You must select an organization from the list"
        }
      ),
      isRequired: f === "COMMUNITY_ELIGIBILITY_PROVISION",
      disabled: g,
      orgSearchUrl: M(
        n.viewModel,
        n.programTheme
      )
    }
  ) : c ? /* @__PURE__ */ a.jsx(
    L,
    {
      fieldId: "low-income",
      value: c.find((e) => e.value === (t && t.value)),
      refId: "organization",
      onChange: (e) => E(e, d),
      placeholder: s || l.formatHTMLMessage({
        id: "lowIncomeOrganizationPlaceholder",
        defaultMessage: "Government Assistance Program"
      }),
      label: /* @__PURE__ */ a.jsx(
        r,
        {
          id: "lowIncomeOrganization",
          defaultMessage: "Government Assistance Program"
        }
      ),
      errorMessage: m && /* @__PURE__ */ a.jsx(
        r,
        {
          id: "errorId.invalidOrganization",
          defaultMessage: "You must select an organization from the list"
        }
      ),
      isRequired: u,
      showPlaceholderAndHideLabel: !!s,
      options: c,
      containerId: "sid-low-income-id",
      disabled: g
    }
  ) : /* @__PURE__ */ a.jsx(j, {});
}, _ = T(S), B = ({
  value: t,
  isErrored: m,
  onChange: d,
  intl: l,
  placeholder: s = "",
  disabled: u = !1
}) => b("ebtCardNumber")?.hidden ? null : /* @__PURE__ */ a.jsx(
  v,
  {
    fieldId: "ebtCardNumber",
    value: t,
    onChange: d,
    placeholder: s || l.formatHTMLMessage({
      id: "ebtCardNumberPlaceholder",
      defaultMessage: "EBT card Number"
    }),
    label: /* @__PURE__ */ a.jsx(r, { id: "ebtCardNumber", defaultMessage: "EBT card Number" }),
    errorMessage: m && /* @__PURE__ */ a.jsx(
      r,
      {
        id: "errorId.invalidEBTCardNumber",
        defaultMessage: "Invalid EBT Card Number"
      }
    ),
    showPlaceholderAndHideLabel: !!s,
    disabled: u
  }
), y = T(B);
export {
  y as E,
  _ as L
};
