/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { Base, markType } from "igniteui-webcomponents-core";
import { IExecutionContext_$type } from "igniteui-webcomponents-core";
import { truncate } from "igniteui-webcomponents-core";
import { dateNow } from "igniteui-webcomponents-core";
import { timeSpanTotalMilliseconds } from "igniteui-webcomponents-core";
/**
 * @hidden
 */
export let BrowserExecutionContext = /*@__PURE__*/ (() => {
    class BrowserExecutionContext extends Base {
        constructor(a) {
            super();
            this.b = new Date();
            this._requestAnimationFrame = null;
            this.requestAnimationFrame = a.getRequestAnimationFrame();
            this.b = dateNow();
        }
        get requestAnimationFrame() {
            return this._requestAnimationFrame;
        }
        set requestAnimationFrame(a) {
            this._requestAnimationFrame = a;
        }
        enqueueAction(a) {
            window.setTimeout(() => a(), 0);
        }
        enqueueAnimationAction(a) {
            this.requestAnimationFrame(() => a());
        }
        execute(a) {
            window.setTimeout(() => a(), 0);
        }
        executeDelayed(a, b) {
            window.setTimeout(() => a(), b);
        }
        getCurrentRelativeTime() {
            let a = dateNow();
            return truncate(timeSpanTotalMilliseconds((+a - +(this.b))));
        }
    }
    BrowserExecutionContext.$t = /*@__PURE__*/ markType(BrowserExecutionContext, 'BrowserExecutionContext', Base.$, [IExecutionContext_$type]);
    return BrowserExecutionContext;
})();
//# sourceMappingURL=BrowserExecutionContext.js.map
