/*
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 { OrderedDictionary } from "./OrderedDictionary";
import { IDictionary$2_$type } from "igniteui-react-core/ES5/IDictionary$2";
import { IDictionary_$type, IEnumerator$1_$type, IEnumerator_$type, Base, Type, getBoxIfEnum, markType } from "igniteui-react-core/ES5/type";
import { KeyValuePair$2 } from "igniteui-react-core/ES5/KeyValuePair$2";
import { Dictionary$2 } from "igniteui-react-core/ES5/Dictionary$2";
import { List$1 } from "igniteui-react-core/ES5/List$1";
/**
 * @hidden
 */
var OrderedDictionary$2 = /** @class */ (function (_super) {
    tslib_1.__extends(OrderedDictionary$2, _super);
    function OrderedDictionary$2($tKey, $tValue) {
        var _this = _super.call(this) || this;
        _this.$tKey = null;
        _this.$tValue = null;
        _this.e = null;
        _this.f = null;
        _this.$tKey = $tKey;
        _this.$tValue = $tValue;
        _this.$type = _this.$type.specialize(_this.$tKey, _this.$tValue);
        _this.e = new Dictionary$2(_this.$tKey, _this.$tValue, 0);
        _this.f = new List$1(_this.$tKey, 0);
        return _this;
    }
    OrderedDictionary$2.prototype.item1 = function (a) {
        return this.f._inner[a];
    };
    OrderedDictionary$2.prototype.item = function (a, b) {
        if (arguments.length === 2) {
            var c = this.f.indexOf(a);
            this.f._inner[c] = a;
            this.e.item(a, b);
            return b;
        }
        else {
            return this.e.item(a);
        }
    };
    OrderedDictionary$2.prototype.get_a = function () {
        return this.count;
    };
    Object.defineProperty(OrderedDictionary$2.prototype, "a", {
        get: function () {
            return this.get_a();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(OrderedDictionary$2.prototype, "count", {
        get: function () {
            return this.e.count;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(OrderedDictionary$2.prototype, "isReadOnly", {
        get: function () {
            return false;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(OrderedDictionary$2.prototype, "keys", {
        get: function () {
            return this.f;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(OrderedDictionary$2.prototype, "values", {
        get: function () {
            return this.e.values;
        },
        enumerable: true,
        configurable: true
    });
    OrderedDictionary$2.prototype.add = function (a) {
        this.addItem(a.key, a.value);
    };
    OrderedDictionary$2.prototype.addItem = function (a, b) {
        this.e.addItem(a, b);
        this.f.add(a);
    };
    OrderedDictionary$2.prototype.clear = function () {
        this.e.clear();
        this.f.clear();
    };
    OrderedDictionary$2.prototype.contains = function (a) {
        return this.e.contains(a);
    };
    OrderedDictionary$2.prototype.containsKey = function (a) {
        return this.e.containsKey(a);
    };
    OrderedDictionary$2.prototype.copyTo = function (a, b) {
        this.e.copyTo(a, b);
    };
    OrderedDictionary$2.prototype.getEnumerator = function () {
        return new OrderedDictionary_Enumerator$2(this.$tKey, this.$tValue, this);
    };
    OrderedDictionary$2.prototype.remove = function (a) {
        return this.removeItem(a.key);
    };
    OrderedDictionary$2.prototype.removeItem = function (a) {
        return this.e.removeItem(a) && this.f.remove(a);
    };
    OrderedDictionary$2.prototype.tryGetValue = function (a, b) {
        if (this.e.containsKey(a)) {
            b = this.e.item(a);
            return {
                ret: true,
                p1: b
            };
        }
        b = Type.getDefaultValue(this.$tValue);
        return {
            ret: false,
            p1: b
        };
    };
    OrderedDictionary$2.prototype.getEnumeratorObject = function () {
        return new OrderedDictionary_Enumerator$2(this.$tKey, this.$tValue, this);
    };
    OrderedDictionary$2.prototype.b = function (a) {
        return getBoxIfEnum(this.$tKey, this.item1(a));
    };
    OrderedDictionary$2.prototype.c = function (a) {
        return this.item(a);
    };
    OrderedDictionary$2.$t = markType(OrderedDictionary$2, 'OrderedDictionary$2', OrderedDictionary.$, [IDictionary$2_$type.specialize(0, 1), IDictionary_$type]);
    return OrderedDictionary$2;
}(OrderedDictionary));
export { OrderedDictionary$2 };
/**
 * @hidden
 */
var OrderedDictionary_Enumerator$2 = /** @class */ (function (_super) {
    tslib_1.__extends(OrderedDictionary_Enumerator$2, _super);
    function OrderedDictionary_Enumerator$2($tKey, $tValue, a) {
        var _this = _super.call(this) || this;
        _this.$tKey = null;
        _this.$tValue = null;
        _this.b = 0;
        _this.a = null;
        _this.$tKey = $tKey;
        _this.$tValue = $tValue;
        _this.$type = _this.$type.specialize(_this.$tKey, _this.$tValue);
        _this.b = -1;
        _this.a = a;
        return _this;
    }
    Object.defineProperty(OrderedDictionary_Enumerator$2.prototype, "currentObject", {
        get: function () {
            return getBoxIfEnum(this.$tValue, this.a.item(this.a.item1(this.b)));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(OrderedDictionary_Enumerator$2.prototype, "current", {
        get: function () {
            var a = this.a.item1(this.b);
            return new KeyValuePair$2(this.$tKey, this.$tValue, 1, a, this.a.item(a));
        },
        enumerable: true,
        configurable: true
    });
    OrderedDictionary_Enumerator$2.prototype.moveNext = function () {
        this.b++;
        return this.b < this.a.count;
    };
    OrderedDictionary_Enumerator$2.prototype.reset = function () {
        this.b = -1;
    };
    OrderedDictionary_Enumerator$2.prototype.dispose = function () {
    };
    OrderedDictionary_Enumerator$2.$t = markType(OrderedDictionary_Enumerator$2, 'OrderedDictionary_Enumerator$2', Base.$, [IEnumerator$1_$type.specialize(KeyValuePair$2.$.specialize(0, 1)), IEnumerator_$type]);
    return OrderedDictionary_Enumerator$2;
}(Base));
export { OrderedDictionary_Enumerator$2 };
