function useDisabledTriggerOnSafari(_ref5) {
  var disabled = _ref5.disabled,
      isVisible = _ref5.isVisible,
      ref = _ref5.ref;
  Object(react["useEffect"])(function () {
    if (!(typeof window !== "undefined" && "PointerEvent" in window) || !disabled || !isVisible) {
      return;
    }

    var ownerDocument = getOwnerDocument(ref.current);

    function handleMouseMove(event) {
      if (!isVisible) {
        return;
      }

      if (event.target instanceof Element && event.target.closest("[data-reach-tooltip-trigger][data-state='tooltip-visible']")) {
        return;
      }

      send({
        type: TooltipEvents.GlobalMouseMove
      });
    }

    ownerDocument.addEventListener("mousemove", handleMouseMove);
    return function () {
      ownerDocument.removeEventListener("mousemove", handleMouseMove);
    };
  }, [disabled, isVisible, ref]);
}
This is a workaround for using tooltips with disabled controls in Safari.
Safari fires `pointerenter` but does not fire `pointerleave`, and
`onPointerEventLeave` added to the trigger element will not work.

TODO: We may remove or modiify this behavior in a future version. Direction
from WAI-ARIA needed for guidance on handling disabled triggers. Tooltips
must be accessible by keyboard, and disabled form controls are generally
excluded from the tab sequence.

@see https://github.com/reach/reach-ui/issues/564
@see https://github.com/w3c/aria-practices/issues/128#issuecomment-588625727