"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var core_1 = require("@angular/core");
var rxjs_1 = require("rxjs");
var cardContainer_1 = require("../../cardContainer");
var ItemCountComponent = (function () {
    function ItemCountComponent(cardContainer) {
        this.cardContainer = cardContainer;
    }
    Object.defineProperty(ItemCountComponent.prototype, "dataSource", {
        get: function () {
            return this.cardContainer && this.cardContainer.dataSource
                ? this.cardContainer.dataSource
                : null;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ItemCountComponent.prototype, "loadingDataSet$", {
        get: function () {
            return this.dataSource
                ? this.dataSource.loadingDataSet$
                : rxjs_1.Observable.of(false);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ItemCountComponent.prototype, "visibleCount$", {
        get: function () {
            return this.dataSource && this.dataSource.dataSet$
                ? this.dataSource.dataSet$.map(function (dataSet) { return dataSet ? dataSet.length : 0; })
                : rxjs_1.Observable.of(0);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(ItemCountComponent.prototype, "totalCount$", {
        get: function () {
            return this.dataSource
                ? this.dataSource.count$
                : rxjs_1.Observable.of(0);
        },
        enumerable: true,
        configurable: true
    });
    return ItemCountComponent;
}());
ItemCountComponent = __decorate([
    core_1.Component({
        selector: 'rlItemCount',
        template: require('./itemCount.html'),
        changeDetection: core_1.ChangeDetectionStrategy.OnPush,
    }),
    __param(0, core_1.Inject(core_1.forwardRef(function () { return cardContainer_1.CardContainerComponent; }))),
    __metadata("design:paramtypes", [cardContainer_1.CardContainerComponent])
], ItemCountComponent);
exports.ItemCountComponent = ItemCountComponent;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaXRlbUNvdW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaXRlbUNvdW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7QUFBQSxzQ0FBdUY7QUFDdkYsNkJBQWtDO0FBRWxDLHFEQUE2RDtBQVE3RCxJQUFhLGtCQUFrQjtJQTJCOUIsNEJBQThELGFBQXdDO1FBQ3JHLElBQUksQ0FBQyxhQUFhLEdBQUcsYUFBYSxDQUFDO0lBQ3BDLENBQUM7SUExQkQsc0JBQUksMENBQVU7YUFBZDtZQUNDLE1BQU0sQ0FBQyxJQUFJLENBQUMsYUFBYSxJQUFJLElBQUksQ0FBQyxhQUFhLENBQUMsVUFBVTtrQkFDdkQsSUFBSSxDQUFDLGFBQWEsQ0FBQyxVQUFVO2tCQUM3QixJQUFJLENBQUM7UUFDVCxDQUFDOzs7T0FBQTtJQUVELHNCQUFJLCtDQUFlO2FBQW5CO1lBQ0MsTUFBTSxDQUFDLElBQUksQ0FBQyxVQUFVO2tCQUNuQixJQUFJLENBQUMsVUFBVSxDQUFDLGVBQWU7a0JBQy9CLGlCQUFVLENBQUMsRUFBRSxDQUFDLEtBQUssQ0FBQyxDQUFDO1FBQ3pCLENBQUM7OztPQUFBO0lBRUQsc0JBQUksNkNBQWE7YUFBakI7WUFDQyxNQUFNLENBQUMsSUFBSSxDQUFDLFVBQVUsSUFBSSxJQUFJLENBQUMsVUFBVSxDQUFDLFFBQVE7a0JBQy9DLElBQUksQ0FBQyxVQUFVLENBQUMsUUFBUSxDQUFDLEdBQUcsQ0F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