import { union as r, without as i } from "./utils/js_utils.js";
class d {
  enter(e) {
    const t = this.entered.length, s = (n) => this.isNodeInDocument(n) && (!n.contains || n.contains(e));
    return this.entered = r(this.entered.filter(s), [
      e
    ]), t === 0 && this.entered.length > 0;
  }
  leave(e) {
    const t = this.entered.length;
    return this.entered = i(this.entered.filter(this.isNodeInDocument), e), t > 0 && this.entered.length === 0;
  }
  reset() {
    this.entered = [];
  }
  constructor(e) {
    this.entered = [], this.isNodeInDocument = e;
  }
}
export {
  d as EnterLeaveCounter
};
//# sourceMappingURL=EnterLeaveCounter.js.map
