import * as e from "react";
import { useTimeout as l } from "../../../../../../../@base-ui_utils@0.2.4_@types_react@18.3.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useTimeout.js";
import { createAttribute as m } from "../utils/createAttribute.js";
import { TYPEABLE_SELECTOR as p } from "../utils/constants.js";
const S = m("safe-polygon"), v = `button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${p}`;
function T(t) {
  return t ? !!t.closest(v) : !1;
}
function E(t) {
  const o = e.useRef(void 0), s = e.useRef(!1), r = e.useRef(void 0), f = e.useRef(!0), i = e.useRef(!1), a = e.useRef(() => {
  }), u = e.useRef(!1), c = l(), d = l(), R = e.useRef(void 0);
  return e.useMemo(() => {
    const n = t.context.dataRef.current;
    return n.hoverInteractionState || (n.hoverInteractionState = {
      pointerTypeRef: o,
      interactedInsideRef: s,
      handlerRef: r,
      blockMouseMoveRef: f,
      performedPointerEventsMutationRef: i,
      unbindMouseMoveRef: a,
      restTimeoutPendingRef: u,
      openChangeTimeout: c,
      restTimeout: d,
      handleCloseOptionsRef: R
    }), n.hoverInteractionState;
  }, [t, o, s, r, f, i, a, u, c, d, R]);
}
export {
  T as isInteractiveElement,
  S as safePolygonIdentifier,
  E as useHoverInteractionSharedState
};
