/*
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 { __extends, __values } from "tslib";
import { Base, NotSupportedException, String_$type, fromEnum, markType } from "igniteui-angular-core";
import { IPackagePart_$type } from "./IPackagePart";
import { IPackageRelationship_$type } from "./IPackageRelationship";
import { Dictionary$2 } from "igniteui-angular-core";
/**
 * @hidden
 */
var CachedLoadPackagePart = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(CachedLoadPackagePart, _super);
    function CachedLoadPackagePart(a, b) {
        var _this = _super.call(this) || this;
        _this.a = null;
        _this.b = null;
        _this.c = null;
        _this.a = a;
        _this.b = b;
        return _this;
    }
    Object.defineProperty(CachedLoadPackagePart.prototype, "$package", {
        get: function () {
            return this.a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CachedLoadPackagePart.prototype, "uri", {
        get: function () {
            return this.b.uri;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CachedLoadPackagePart.prototype, "contentType", {
        get: function () {
            return this.b.contentType;
        },
        enumerable: false,
        configurable: true
    });
    CachedLoadPackagePart.prototype.createRelationship = function (a, b, c, d) {
        throw new NotSupportedException(0);
    };
    CachedLoadPackagePart.prototype.getRelationship = function (a) {
        if (this.c == null) {
            this.d();
        }
        return this.c.item(a);
    };
    CachedLoadPackagePart.prototype.getRelationships = function () {
        if (this.c == null) {
            this.d();
        }
        return this.c.values;
    };
    CachedLoadPackagePart.prototype.getStream = function (a, b) {
        return this.b.getStream(a, b);
    };
    CachedLoadPackagePart.prototype.d = function () {
        var e_1, _a;
        this.c = new Dictionary$2(String_$type, IPackageRelationship_$type, 0);
        try {
            for (var _b = __values(fromEnum(this.b.getRelationships())), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                this.c.item(a.id, a);
            }
        }
        catch (e_1_1) {
            e_1 = { error: e_1_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_1)
                    throw e_1.error;
            }
        }
    };
    CachedLoadPackagePart.$t = markType(CachedLoadPackagePart, 'CachedLoadPackagePart', Base.$, [IPackagePart_$type]);
    return CachedLoadPackagePart;
}(Base));
export { CachedLoadPackagePart };
