import { filterDOMProps as m, mergeProps as a } from "../../utils/dist/module.es.js";
import { useFocusable as k } from "../../focus/dist/module.es.js";
import { usePress as x } from "../../interactions/dist/module.es.js";
function S(s, r) {
  let {
    elementType: i = "a",
    onPress: l,
    onPressStart: c,
    onPressEnd: p,
    onClick: o,
    isDisabled: e,
    ...P
  } = s, d;
  i !== "a" && (d = {
    role: "link",
    tabIndex: e ? void 0 : 0
  });
  let { focusableProps: f } = k(s, r), { pressProps: n, isPressed: b } = x({
    onPress: l,
    onPressStart: c,
    onPressEnd: p,
    isDisabled: e,
    ref: r
  }), $ = m(P, {
    labelable: !0
  }), u = a(f, n);
  return {
    isPressed: b,
    linkProps: a($, {
      ...u,
      ...d,
      "aria-disabled": e || void 0,
      onClick: (t) => {
        n.onClick(t), o && (o(t), console.warn("onClick is deprecated, please use onPress"));
      }
    })
  };
}
export {
  S as useLink
};
//# sourceMappingURL=module.es.js.map
