"use client";
import * as r from "react";
import { c as f } from "./useRenderElement-DNB2vtF1.js";
import { u as p } from "./useButton-JYPKQKj4.js";
import { u as h } from "./useCompositeListItem-CYQrZg5-.js";
function I(m = {}) {
  const {
    highlightItemOnHover: s,
    highlightedIndex: u,
    onHighlightedIndexChange: i
  } = p(), {
    ref: c,
    index: e
  } = h(m), t = u === e, n = r.useRef(null), a = f(c, n);
  return {
    compositeProps: r.useMemo(() => ({
      tabIndex: t ? 0 : -1,
      onFocus() {
        i(e);
      },
      onMouseMove() {
        const o = n.current;
        if (!s || !o)
          return;
        const d = o.hasAttribute("disabled") || o.ariaDisabled === "true";
        !t && !d && o.focus();
      }
    }), [t, i, e, s]),
    compositeRef: a,
    index: e
  };
}
export {
  I as u
};
