/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Component } from '@angular/core';
import get from 'lodash/fp/get';
import groupBy from 'lodash/fp/groupBy';
import { map } from 'rxjs/operators';
import { ChatService } from '../chat.service';
var GroupListComponent = /** @class */ (function () {
    function GroupListComponent(chatService) {
        this.chatService = chatService;
        this.groups$ = this.chatService.channels$.pipe(map(function (channels) { return Object.values(groupBy('groupId', channels)); }));
        this.selectedGroupId$ = this.chatService.selectedGroup$.pipe(map(get([0, 'groupId'])));
    }
    GroupListComponent.decorators = [
        { type: Component, args: [{
                    selector: 'bidi-group-list',
                    template: "<div class=\"chat-list-content is-relative\">\n\n  <div class=\"chat-list-header\">\n    <nav class=\"panel-chat\">\n      <p class=\"has-text-light is-uppercase is-size-6\" style=\"border-radius: 0; border-left: none; border-top: none;\">\n        Conversaciones\n      </p>\n    </nav>\n  </div>\n  <p class=\"has-text-tt is-uppercase is-size-7 is-relative desk-title\" style=\"padding-top: 4px;\">Selecciona un grupo</p>\n  <div class=\"chat-list\">\n    <div\n      *ngFor=\"let group of groups$ | async\"\n      (click)=\"chatService.selectGroup(group); chatService.selectChannel(null)\"\n      [ngClass]=\"{ 'has-text-tt': group[0].groupId === (selectedGroupId$ | async) }\"\n      class=\"label-chat is-ff-light has-text-light is-size-8 \"\n    >\n      <span>{{ group[0].groupName }}</span>\n      <!-- <div class=\"conversations-counter\">\n        <div class=\"counter\">1</div>\n      </div> -->\n    </div>\n  </div>\n\n</div>\n",
                    styles: [".chat-list-content{padding:25px;width:230px;background:rgba(30,54,72,.95);height:calc(100vh - 35px)}.panel-chat{margin-bottom:35px}.label-chat{padding:15px 0;border-bottom:1px solid;cursor:pointer}.label-chat:hover{color:#00dd89!important;border-color:#00dd89!important}.label-chat span{margin-right:4px}.label-chat .conversations-counter{position:relative;display:inline-block;font-size:9px}.label-chat .conversations-counter .counter{width:15px;height:15px;text-align:center;border-radius:99999px;color:#fff;font-weight:700;padding-top:1px;border:1px solid #00dd89;position:absolute;top:-16px}"]
                }] }
    ];
    /** @nocollapse */
    GroupListComponent.ctorParameters = function () { return [
        { type: ChatService }
    ]; };
    return GroupListComponent;
}());
export { GroupListComponent };
if (false) {
    /** @type {?} */
    GroupListComponent.prototype.groups$;
    /** @type {?} */
    GroupListComponent.prototype.selectedGroupId$;
    /** @type {?} */
    GroupListComponent.prototype.chatService;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JvdXAtbGlzdC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AYmlkaS9jb21tb24tY29tcG9uZW50cy8iLCJzb3VyY2VzIjpbImxpYi9tb2R1bGVzL2NoYXQvZ3JvdXAtbGlzdC9ncm91cC1saXN0LmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMxQyxPQUFPLEdBQUcsTUFBTSxlQUFlLENBQUM7QUFDaEMsT0FBTyxPQUFPLE1BQU0sbUJBQW1CLENBQUM7QUFFeEMsT0FBTyxFQUFFLEdBQUcsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBRXJDLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUU5QztJQWNFLDRCQUFvQixXQUF3QjtRQUF4QixnQkFBVyxHQUFYLFdBQVcsQ0FBYTtRQVI1QyxZQUFPLEdBQStCLElBQUksQ0FBQyxXQUFXLENBQUMsU0FBUyxDQUFDLElBQUksQ0FDbkUsR0FBRyxDQUFDLFVBQUEsUUFBUSxJQUFJLE9BQUEsTUFBTSxDQUFDLE1BQU0sQ0FBQyxPQUFPLENBQUMsU0FBUyxFQUFFLFFBQVEsQ0FBQyxDQUFDLEVBQTNDLENBQTJDLENBQUMsQ0FDN0QsQ0FBQztRQUVGL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