'use strict';
Object.defineProperty(exports, '__esModule', {
    value: true
});
exports.default = void 0;
var mergeOptionsToData = function (t) {
    if (0 < arguments.length && void 0 !== t) {
        var e = t;
    } else {
        var e = {};
    }
    var n = Object.assign({}, e);
    for (var r in n) {
        if (n.hasOwnProperty(r) && 'function' == typeof n[r]) {
            delete n[r];
        }
    }
    return n;
};
var bind = function (r, i) {
    return function () {
        for (t = arguments.length, e = new Array(t), n = 0, void 0; n < t; n++) {
            var t;
            var e;
            var n;
            e[n] = arguments[n];
        }
        return e.length ? r.apply(i, e) : r.call(i);
    };
};
var assign = function () {
    for (t = arguments.length, e = new Array(t), n = 0, void 0; n < t; n++) {
        var t;
        var e;
        var n;
        e[n] = arguments[n];
    }
    return Object.assign.apply(Object, [{}].concat(e));
};
var _default = {
    definitionFilter: function (t) {
        t.data = mergeOptionsToData(t.data);
        t.data.in = false;
        t.data.visible = false;
    },
    methods: {
        $mergeOptionsToData: mergeOptionsToData,
        $mergeOptionsAndBindMethods: function (t, e) {
            if (0 < arguments.length && void 0 !== t) {
                var n = t;
            } else {
                var n = {};
            }
            var r = 1 < arguments.length && void 0 !== e ? e : this.fns;
            var i = Object.assign({}, n);
            for (var a in i) {
                if (i.hasOwnProperty(a) && 'function' == typeof i[a]) {
                    r[a] = bind(i[a], this);
                    delete i[a];
                }
            }
            return i;
        },
        $setData: function () {
            for (e = this, t = arguments.length, n = new Array(t), r = 0, void 0; r < t; r++) {
                var e;
                var t;
                var n;
                var r;
                n[r] = arguments[r];
            }
            var i = assign.apply(void 0, [{}].concat(n));
            return new Promise(function (t) {
                e.setData(i, t);
            });
        },
        $requestAnimationFrame: function (t, e) {
            var n = 0 < arguments.length && void 0 !== t ? t : function () {};
            var r = 1 < arguments.length && void 0 !== e ? e : 16.666666666666668;
            return new Promise(function (t) {
                return setTimeout(t, r);
            }).then(n);
        }
    },
    created: function () {
        this.fns = {};
    },
    destroyed: function () {
        this.fns = {};
    }
};
exports.default = _default;
