import { j as e } from "../../../_virtual/jsx-runtime.js";
import j from "../../../icons/AlertCircle.js";
import { getId as m } from "../../../utils/index.js";
import { CheckRadioInputGroupWrapper as f, CheckRadioGroupLabel as C, CheckRadioGroupWrapper as o, CheckRadioErrorArea as R, CheckRadioHintArea as u } from "../styles.js";
import { CheckboxInput as I } from "./CheckboxInput.js";
function w({
  value: v,
  options: r,
  onChange: h,
  name: x,
  groupLabel: c,
  orientation: p = "row",
  id: G,
  hasError: t = !1,
  errorText: l,
  disabled: n = !1,
  assistText: k,
  ...s
}) {
  const d = m(s["data-testid"]), i = m(s["data-trackid"]);
  return /* @__PURE__ */ e.jsxs(f, { children: [
    c && /* @__PURE__ */ e.jsx(
      C,
      {
        "data-testid": d("group-label"),
        "data-trackid": i("group-label"),
        children: c
      }
    ),
    r && /* @__PURE__ */ e.jsx(o, { orientation: p, children: r.map((a) => /* @__PURE__ */ e.jsx(
      I,
      {
        label: a.label,
        value: a.value,
        id: a.id,
        name: x,
        hasError: t,
        disabled: n || a.disabled,
        onChange: h,
        "data-testid": d(a["data-testid"]),
        "data-trackid": i(a["data-trackid"]),
        "aria-label": a.label,
        indeterminate: a.indeterminate,
        checked: a.checked
      },
      a.value
    )) }),
    t && l && /* @__PURE__ */ e.jsxs(
      R,
      {
        "data-testid": d("error"),
        "data-trackid": i("error"),
        children: [
          /* @__PURE__ */ e.jsx(j, {}),
          l
        ]
      }
    ),
    k && !t && /* @__PURE__ */ e.jsx(
      u,
      {
        "data-testid": d("assistText"),
        "data-trackid": i("assistText"),
        children: k
      }
    )
  ] });
}
export {
  w as CheckboxGroup
};
