import { jsxs as i, jsx as e, Fragment as w } from "react/jsx-runtime";
import { forwardRef as y, useId as A } from "react";
import { cx as f } from "../../utils/classNames.js";
import { useArrowTheme as B } from "../../hooks/useArrowTheme.js";
import { Divider as _ } from "../divider/Divider.js";
import { StatusLabel as O } from "../status-label/StatusLabel.js";
import { Checkbox as R } from "../checkbox/Checkbox.js";
const S = y(
  ({
    label: d,
    labelId: b,
    body: s,
    status: m,
    leadingDecorationType: o,
    leadingImage: c,
    leadingIcon: u,
    leadingDecorationA11yLabel: x,
    dividerPosition: v = "bottom",
    inverse: $,
    checked: h,
    focused: p,
    trailingContentType: I,
    className: k,
    ...N
  }, C) => {
    const F = B(), l = $ ?? F.inverse, G = A(), t = b || G;
    if (!d)
      return null;
    let n;
    if (I === "checkbox")
      n = /* @__PURE__ */ e(
        R,
        {
          label: "",
          form: "",
          id: `checkbox-${t}`,
          name: `checkbox-${t}`,
          labelledBy: t,
          checked: h,
          inverse: l,
          focused: p
        }
      );
    else {
      const r = "radioGroupName" in N ? N.radioGroupName : void 0, a = r ? `${r}-${l ? "onDark" : "onLight"}` : void 0;
      n = /* @__PURE__ */ i("div", { className: "tdds-radio", children: [
        /* @__PURE__ */ e(
          "input",
          {
            id: `radio-${t}`,
            type: "radio",
            name: a,
            "aria-labelledby": t,
            checked: h,
            readOnly: !0,
            className: f({ "force-focus": !!p })
          }
        ),
        /* @__PURE__ */ e("label", { htmlFor: `radio-${t}`, children: "" })
      ] });
    }
    const L = /* @__PURE__ */ i(w, { children: [
      /* @__PURE__ */ e("div", { className: "tdds-list-item__label", children: d }),
      s == null ? void 0 : s.map(
        ({ text: r, icon: a }, j) => r ? /* @__PURE__ */ i("div", { className: "tdds-list-item__optional-copy", children: [
          a ?? null,
          r
        ] }, j) : null
      )
    ] }), g = /* @__PURE__ */ i("div", { className: "tdds-list-item__content", children: [
      o ? /* @__PURE__ */ i(
        "div",
        {
          className: "tdds-list-item__leading-decoration",
          "data-image-type": o,
          id: `${t}-leading-decoration`,
          children: [
            o === "icon" && u ? u : null,
            o !== "icon" && c ? /* @__PURE__ */ e("img", { src: c, alt: x || "" }) : null
          ]
        }
      ) : null,
      /* @__PURE__ */ i("div", { className: "tdds-list-item__main-content", id: t, children: [
        L,
        m ? /* @__PURE__ */ e(O, { ...m, inverse: l }) : null
      ] }),
      /* @__PURE__ */ e("div", { className: "tdds-list-item__trailing-content", children: n })
    ] });
    return /* @__PURE__ */ i(
      "li",
      {
        ref: C,
        className: f("tdds-list-item", k),
        "data-inverse": l ? "true" : void 0,
        role: "listitem",
        children: [
          v === "top" ? /* @__PURE__ */ e(_, { inverse: l }) : null,
          g,
          v === "bottom" ? /* @__PURE__ */ e(_, { inverse: l }) : null
        ]
      }
    );
  }
);
S.displayName = "ListItemFilter";
export {
  S as ListItemFilter
};
//# sourceMappingURL=ListItemFilter.js.map
