/*
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, fromEnum, markType } from "igniteui-react-core/ES5/type";
import { List$1 } from "igniteui-react-core/ES5/List$1";
/**
 * @hidden
 */
var DictInterpolator$3 = /** @class */ (function (_super) {
    tslib_1.__extends(DictInterpolator$3, _super);
    function DictInterpolator$3($tKey, $tValue, $tFrame, a, b, c, d) {
        var _this = _super.call(this) || this;
        _this.$tKey = null;
        _this.$tValue = null;
        _this.$tFrame = null;
        _this.a = null;
        _this.c = null;
        _this.d = null;
        _this.b = null;
        _this.$tKey = $tKey;
        _this.$tValue = $tValue;
        _this.$tFrame = $tFrame;
        _this.$type = _this.$type.specialize(_this.$tKey, _this.$tValue, _this.$tFrame);
        _this.a = a;
        _this.c = b;
        _this.d = c;
        _this.b = d;
        return _this;
    }
    DictInterpolator$3.prototype.e = function (a, b, c, d, e, f) {
        var e_1, _a, e_2, _b, e_3, _c, e_4, _d;
        var g = new List$1(this.$tKey, 0);
        var _loop_1 = function (h) {
            var i;
            var j;
            var k = a.item(h);
            var l = ((function () { var m = c.tryGetValue(h, i); i = m.p1; return m.ret; })());
            var m = ((function () { var n = d.tryGetValue(h, j); j = n.p1; return n.ret; })());
            if (!l && !m) {
                g.add(h);
            }
            else {
                this_1.a(k, b, i, j, e, f);
                if (!this_1.d(k)) {
                    g.add(h);
                }
            }
        };
        var this_1 = this;
        try {
            for (var _e = tslib_1.__values(fromEnum(a.keys)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var h = _f.value;
                _loop_1(h);
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_f && !_f.done && (_a = _e.return)) _a.call(_e);
            }
            finally { if (e_1) throw e_1.error; }
        }
        try {
            for (var _g = tslib_1.__values(fromEnum(g)), _h = _g.next(); !_h.done; _h = _g.next()) {
                var n = _h.value;
                a.removeItem(n);
            }
        }
        catch (e_2_1) { e_2 = { error: e_2_1 }; }
        finally {
            try {
                if (_h && !_h.done && (_b = _g.return)) _b.call(_g);
            }
            finally { if (e_2) throw e_2.error; }
        }
        var _loop_2 = function (o) {
            var p = c.item(o);
            var q = void 0;
            var r;
            var s = d.tryGetValue(o, q);
            q = s.p1;
            var t = ((function () { var u = a.tryGetValue(o, r); r = u.p1; return u.ret; })());
            if (!t) {
                r = this_2.b();
                this_2.a(r, b, p, q, e, f);
                if (!this_2.d(r)) {
                    return "continue";
                }
                a.addItem(this_2.c(r), r);
            }
        };
        var this_2 = this;
        try {
            for (var _j = tslib_1.__values(fromEnum(c.keys)), _k = _j.next(); !_k.done; _k = _j.next()) {
                var o = _k.value;
                _loop_2(o);
            }
        }
        catch (e_3_1) { e_3 = { error: e_3_1 }; }
        finally {
            try {
                if (_k && !_k.done && (_c = _j.return)) _c.call(_j);
            }
            finally { if (e_3) throw e_3.error; }
        }
        var _loop_3 = function (u) {
            var v = d.item(u);
            var w;
            var x;
            var y = ((function () { var z = c.tryGetValue(u, w); w = z.p1; return z.ret; })());
            var z = ((function () { var aa = a.tryGetValue(u, x); x = aa.p1; return aa.ret; })());
            if (!z && !y) {
                x = this_3.b();
                this_3.a(x, b, w, v, e, f);
                if (!this_3.d(x)) {
                    return "continue";
                }
                a.addItem(this_3.c(x), x);
            }
        };
        var this_3 = this;
        try {
            for (var _l = tslib_1.__values(fromEnum(d.keys)), _m = _l.next(); !_m.done; _m = _l.next()) {
                var u = _m.value;
                _loop_3(u);
            }
        }
        catch (e_4_1) { e_4 = { error: e_4_1 }; }
        finally {
            try {
                if (_m && !_m.done && (_d = _l.return)) _d.call(_l);
            }
            finally { if (e_4) throw e_4.error; }
        }
    };
    DictInterpolator$3.$t = markType(DictInterpolator$3, 'DictInterpolator$3');
    return DictInterpolator$3;
}(Base));
export { DictInterpolator$3 };
