/*
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 * as tslib_1 from "tslib";
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
 */
var BrowserExecutionContext = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(BrowserExecutionContext, _super);
    function BrowserExecutionContext(a) {
        var _this = _super.call(this) || this;
        _this.b = new Date();
        _this._requestAnimationFrame = null;
        _this.requestAnimationFrame = a.getRequestAnimationFrame();
        _this.b = dateNow();
        return _this;
    }
    Object.defineProperty(BrowserExecutionContext.prototype, "requestAnimationFrame", {
        get: function () {
            return this._requestAnimationFrame;
        },
        set: function (a) {
            this._requestAnimationFrame = a;
        },
        enumerable: true,
        configurable: true
    });
    BrowserExecutionContext.prototype.enqueueAction = function (a) {
        window.setTimeout(function () { return a(); }, 0);
    };
    BrowserExecutionContext.prototype.enqueueAnimationAction = function (a) {
        this.requestAnimationFrame(function () { return a(); });
    };
    BrowserExecutionContext.prototype.execute = function (a) {
        window.setTimeout(function () { return a(); }, 0);
    };
    BrowserExecutionContext.prototype.executeDelayed = function (a, b) {
        window.setTimeout(function () { return a(); }, b);
    };
    BrowserExecutionContext.prototype.getCurrentRelativeTime = function () {
        var a = dateNow();
        return truncate(timeSpanTotalMilliseconds((+a - +(this.b))));
    };
    BrowserExecutionContext.$t = markType(BrowserExecutionContext, 'BrowserExecutionContext', Base.$, [IExecutionContext_$type]);
    return BrowserExecutionContext;
}(Base));
export { BrowserExecutionContext };
//# sourceMappingURL=BrowserExecutionContext.js.map
