function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
export class IntersectionObserverMock {
    observe(target) {
        this.elements.add(target);
        this.callback(this.takeRecords(), this);
    }
    unobserve(target) {
        this.elements.delete(target);
    }
    takeRecords() {
        return [
            ...this.elements
        ].map((target)=>({
                time: Date.now(),
                target,
                boundingClientRect: target.getBoundingClientRect(),
                intersectionRatio: 0,
                intersectionRect: target.getBoundingClientRect(),
                isIntersecting: false,
                rootBounds: this.root && "getBoundingClientRect" in this.root ? this.root.getBoundingClientRect() : null
            }));
    }
    disconnect() {
        this.elements.clear();
    }
    constructor(callback, options = {}){
        _define_property(this, "callback", void 0);
        _define_property(this, "root", void 0);
        _define_property(this, "rootMargin", void 0);
        _define_property(this, "thresholds", void 0);
        _define_property(this, "elements", void 0);
        this.callback = callback;
        this.root = options.root || null;
        this.rootMargin = options.rootMargin || "";
        this.thresholds = typeof options.threshold === "number" ? [
            options.threshold
        ] : options.threshold ?? [];
        this.elements = new Set();
    }
}

//# sourceMappingURL=IntersectionObserver.js.map