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