"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const useResizeObserver = require("../hooks/use-resize-observer.js");
const is = require("../_utils/is.js");
require("vue");
require("../_utils/global.js");
let listener = () => null;
let ro = null;
const vOnResize = {
  beforeMount() {
    ro = useResizeObserver.useResizeObserver();
  },
  mounted(el, binding) {
    if (is.isFunction(binding.value)) {
      listener = binding.value;
      ro == null ? void 0 : ro.observe(el, listener);
    }
  },
  unmounted(el) {
    if (listener) {
      ro == null ? void 0 : ro.unobserve(el, listener);
    }
  }
};
exports.vOnResize = vOnResize;
