"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const useDomEvent = require("./use-dom-event.js");
const eventInfo = require("./event-info.js");
const utils = require("./utils.js");
var mouseEventNames = {
  pointerdown: "mousedown",
  pointermove: "mousemove",
  pointerup: "mouseup",
  pointercancel: "mousecancel",
  pointerover: "mouseover",
  pointerout: "mouseout",
  pointerenter: "mouseenter",
  pointerleave: "mouseleave"
};
var touchEventNames = {
  pointerdown: "touchstart",
  pointermove: "touchmove",
  pointerup: "touchend",
  pointercancel: "touchcancel"
};
function getPointerEventName(name) {
  if (utils.supportsPointerEvents()) {
    return name;
  } else if (utils.supportsTouchEvents()) {
    return touchEventNames[name];
  } else if (utils.supportsMouseEvents()) {
    return mouseEventNames[name];
  }
  return name;
}
function addPointerEvent(target, eventName, handler, options) {
  return useDomEvent.addDomEvent(target, getPointerEventName(eventName), eventInfo.wrapHandler(handler, eventName === "pointerdown"), options);
}
function usePointerEvent(ref, eventName, handler, options) {
  return useDomEvent.useDomEvent(ref, getPointerEventName(eventName), handler && eventInfo.wrapHandler(handler, eventName === "pointerdown"), options);
}
exports.addPointerEvent = addPointerEvent;
exports.usePointerEvent = usePointerEvent;
//# sourceMappingURL=use-pointer-event.js.map
