"use strict";
const vue = require("vue");
const useElementIntersection = require("../hooks/use-element-intersection.js");
require("../_utils/global.js");
const intersectionObserver = vue.defineComponent({
  name: "OIntersectionObserver",
  emits: ["intersection"],
  setup(_props, { emit, slots }) {
    const { vIntersectionObserver } = useElementIntersection.useIntersectionObserverDirective({
      listener: (entry) => {
        emit("intersection", entry.isIntersecting, entry);
      },
      removeOnUnmounted: false
    });
    return () => {
      var _a;
      const children = (_a = slots.default) == null ? void 0 : _a.call(slots);
      return children == null ? void 0 : children.map((item) => vue.withDirectives(vue.cloneVNode(item), [[vIntersectionObserver]]));
    };
  }
});
module.exports = intersectionObserver;
