/**
 * ldesign v0.4.2
 * (c) 2023 ldesign
 * @license MIT
 */

import { ref, onMounted, onUnmounted } from 'vue';
import { isServer } from '../utils/dom.js';
import '../_chunks/dep-c9c789a8.js';
import 'lodash/isString';
import 'lodash/isFunction';
import 'lodash/isArray';
import '../utils/easing.js';

var useMouse = function useMouse() {
  var x = ref(0);
  var y = ref(0);
  var onMouseMove = function onMouseMove(e) {
    x.value = e.clientX;
    y.value = e.clientY;
  };
  if (!isServer) {
    onMounted(function () {
      window.addEventListener("mousemove", onMouseMove, {
        passive: true
      });
    });
    onUnmounted(function () {
      window.removeEventListener("mousemove", onMouseMove);
    });
  }
  return {
    x: x,
    y: y
  };
};

export { useMouse };
//# sourceMappingURL=util.js.map
