// #region Imports
import { vi } from 'vitest';
// #endregion
// #region DOM API Polyfills for jsdom
// Mock DOMRect if not available
if (typeof globalThis.DOMRect === 'undefined') {
    globalThis.DOMRect = class DOMRect {
        x;
        y;
        width;
        height;
        top;
        right;
        bottom;
        left;
        constructor(x = 0, y = 0, width = 0, height = 0) {
            this.x = x;
            this.y = y;
            this.width = width;
            this.height = height;
            this.top = y;
            this.left = x;
            this.right = x + width;
            this.bottom = y + height;
        }
        toJSON() {
            return {
                x: this.x,
                y: this.y,
                width: this.width,
                height: this.height,
                top: this.top,
                right: this.right,
                bottom: this.bottom,
                left: this.left
            };
        }
    };
}
// Mock PointerEvent if not available
if (typeof globalThis.PointerEvent === 'undefined') {
    globalThis.PointerEvent = class PointerEvent extends MouseEvent {
        pointerId;
        width;
        height;
        pressure;
        tangentialPressure;
        tiltX;
        tiltY;
        twist;
        pointerType;
        isPrimary;
        constructor(type, eventInitDict = {}) {
            super(type, eventInitDict);
            this.pointerId = eventInitDict.pointerId || 0;
            this.width = eventInitDict.width || 1;
            this.height = eventInitDict.height || 1;
            this.pressure = eventInitDict.pressure || 0;
            this.tangentialPressure = eventInitDict.tangentialPressure || 0;
            this.tiltX = eventInitDict.tiltX || 0;
            this.tiltY = eventInitDict.tiltY || 0;
            this.twist = eventInitDict.twist || 0;
            this.pointerType = eventInitDict.pointerType || 'mouse';
            this.isPrimary = eventInitDict.isPrimary ?? true;
        }
    };
}
// Mock Web Animations API if not available
if (typeof Element !== 'undefined' && typeof Element.prototype.animate === 'undefined') {
    Element.prototype.animate = vi.fn(() => ({
        cancel: vi.fn(),
        finish: vi.fn(),
        pause: vi.fn(),
        play: vi.fn(),
        reverse: vi.fn(),
        updatePlaybackRate: vi.fn(),
        persist: vi.fn(),
        commitStyles: vi.fn(),
        oncancel: null,
        onfinish: null,
        onremove: null,
        finished: Promise.resolve(),
        ready: Promise.resolve(),
        playState: 'running',
        playbackRate: 1,
        startTime: 0,
        currentTime: 0,
        effect: null,
        timeline: null,
        id: '',
        pending: false,
        replaceState: 'active',
        addEventListener: vi.fn(),
        removeEventListener: vi.fn(),
        dispatchEvent: vi.fn()
    }));
}
// Mock getAnimations if not available
if (typeof Element !== 'undefined' && typeof Element.prototype.getAnimations === 'undefined') {
    Element.prototype.getAnimations = vi.fn(() => []);
}
// Mock getComputedStyle for transforms
if (typeof window !== 'undefined') {
    const originalGetComputedStyle = window.getComputedStyle;
    window.getComputedStyle = (element) => {
        const style = originalGetComputedStyle(element);
        // Return existing transform or 'none'
        return style;
    };
}
// #endregion
//# sourceMappingURL=vitest.setup.js.map