
/**
 *   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 w, l as A, R as g, v as z, g as v, j as e, F as t, H as B, I as R, K as T } from "../sheerid.js";
import { F as U } from "./FormFieldInputSelect-eZgsxRw0.js";
import { i as E } from "./FormFieldText-CPwStdCx.js";
import { D as I } from "./CaptchaComponent-CAmFHBQZ.js";
const N = ({
  autoFocus: r,
  onChange: s,
  value: i,
  isErrored: n,
  organizations: o = void 0,
  verificationService: d,
  intl: c,
  placeholder: f = "",
  disabled: p = !1
}) => {
  o && A.warn("Param `organizations` is deprecated and will not be used");
  const S = "branch-of-service", [D, y] = g.useState([]), [x, M] = g.useState(!1), [O, b] = g.useState(!1), { viewModel: j, programTheme: C } = d, { status: h } = j, { orgSearchUrl: H } = C.config, u = z(() => j?.countryChoice?.value), P = E(C, u);
  g.useEffect(() => {
    const a = new AbortController();
    return (async () => {
      if (P) {
        y([]), M(!0);
        return;
      }
      M(!1), b(!0);
      const l = new URL(H);
      u ? l.searchParams.set("country", u) : l.searchParams.delete("country"), h ? l.searchParams.set("tags", h) : l.searchParams.delete("tags");
      const F = await B(l.toString());
      a.signal.aborted || (F && y(F.map(R)), b(!1));
    })(), () => {
      a.abort();
    };
  }, [u, h]);
  const L = (a, m) => {
    m(a ? {
      id: a.value,
      name: a.label
    } : {
      id: 0,
      name: ""
    });
  };
  return v("organization")?.hidden ? null : /* @__PURE__ */ e.jsx(
    U,
    {
      fieldId: S,
      refId: "organization",
      autoFocus: r,
      options: D,
      onChange: (a) => L(a, s),
      value: D.find((a) => a.value === (i && i.value)),
      placeholder: f || c.formatHTMLMessage({
        id: "branchOfServicePlaceholder",
        defaultMessage: "Branch Of Service"
      }),
      isRequired: !0,
      isLoading: O,
      disabled: x || p,
      explanation: x ? /* @__PURE__ */ e.jsx(t, { id: "chooseCountry", defaultMessage: "Choose a country first" }) : null,
      label: /* @__PURE__ */ e.jsx(t, { id: "branchOfService", defaultMessage: "Branch Of Service" }),
      errorMessage: n && /* @__PURE__ */ e.jsx(
        t,
        {
          id: "errorId.invalidOrganization",
          defaultMessage: "You must select an organization from the list"
        }
      ),
      showPlaceholderAndHideLabel: !!f,
      containerId: `sid-${S}-id`
    }
  );
}, Y = w(N), _ = ({
  onChange: r,
  errorId: s,
  isErrored: i = !!s,
  value: n = "2000-01-01",
  disabled: o = !1,
  locale: d,
  mode: c = "month",
  isRequired: f = !0
}) => v("dischargeDate")?.hidden ? null : /* @__PURE__ */ e.jsx(
  I,
  {
    mode: c,
    value: n,
    label: /* @__PURE__ */ e.jsx(t, { id: "dischargeDate", defaultMessage: "Discharge date" }),
    explanation: /* @__PURE__ */ e.jsx(
      t,
      {
        id: "verificationPurposesOnly",
        defaultMessage: "Used for verification purposes only"
      }
    ),
    onChange: r,
    fieldName: "dischargeDate",
    fieldId: "discharge-date",
    isErrored: i,
    disabled: o,
    isRequired: f,
    locale: d,
    errorMsg: /* @__PURE__ */ e.jsx(t, { id: `errorId.${s}`, defaultMessage: "Invalid discharge date" })
  }
), G = ({
  onChange: r,
  errorId: s,
  isErrored: i = !!s,
  value: n = "2000-01-01",
  locale: o = T,
  disabled: d = !1
}) => v("activeDutyStartDate")?.hidden ? null : /* @__PURE__ */ e.jsx(
  I,
  {
    value: n,
    label: /* @__PURE__ */ e.jsx(t, { id: "activeDutyStartDate", defaultMessage: "Active Duty Start Date" }),
    explanation: /* @__PURE__ */ e.jsx(
      t,
      {
        id: "verificationPurposesOnly",
        defaultMessage: "Used for verification purposes only"
      }
    ),
    onChange: r,
    fieldName: "activeDutyStartDate",
    fieldId: "sid-active-duty-start-date",
    locale: o,
    isErrored: i,
    disabled: d,
    errorMsg: /* @__PURE__ */ e.jsx(t, { id: `errorId.${s}`, defaultMessage: "Invalid start date" })
  }
);
export {
  G as A,
  Y as B,
  _ as D
};
