import { __rest as i, __assign as b } from "../../../../../../tslib/tslib.es6.es.js";
var v = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap(), c = function(r) {
  var e;
  (e = v.get(r.target)) === null || e === void 0 || e(r);
}, f = function(r) {
  r.forEach(c);
};
function u(r) {
  var e = r.root, t = i(r, ["root"]), o = e || document;
  a.has(o) || a.set(o, {});
  var s = a.get(o), n = JSON.stringify(t);
  return s[n] || (s[n] = new IntersectionObserver(f, b({ root: e }, t))), s[n];
}
function k(r, e, t) {
  var o = u(e);
  return v.set(r, t), o.observe(r), function() {
    v.delete(r), o.unobserve(r);
  };
}
export {
  k as observeIntersection
};
//# sourceMappingURL=observers.es.js.map
