import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
function MyCommunitiesComponent_ng_container_5_a_1_Template(rf, ctx) { if (rf & 1) {
    var _r6 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "a", 9);
    i0.ɵɵlistener("click", function MyCommunitiesComponent_ng_container_5_a_1_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r6); var community_r4 = ctx.$implicit; var ctx_r5 = i0.ɵɵnextContext(2); return ctx_r5.onViewCommunity(community_r4); });
    i0.ɵɵelementStart(1, "figure", 10);
    i0.ɵɵelement(2, "img", 11);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "div", 12);
    i0.ɵɵelementStart(4, "div", 13);
    i0.ɵɵtext(5);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var community_r4 = ctx.$implicit;
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("src", community_r4 == null ? null : community_r4.assets == null ? null : community_r4.assets.logo_image, i0.ɵɵsanitizeUrl)("alt", community_r4 == null ? null : community_r4.name);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate((community_r4 == null ? null : community_r4.name) || "");
} }
function MyCommunitiesComponent_ng_container_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, MyCommunitiesComponent_ng_container_5_a_1_Template, 6, 3, "a", 8);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    var ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngForOf", ctx_r0.communities.slice(0, ctx_r0.maxCount));
} }
function MyCommunitiesComponent_p_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p", 14);
    i0.ɵɵelementStart(1, "a", 15);
    i0.ɵɵtext(2, "Browse");
    i0.ɵɵelementEnd();
    i0.ɵɵtext(3, " our online support groups and communities. ");
    i0.ɵɵelementEnd();
} }
function MyCommunitiesComponent_a_8_Template(rf, ctx) { if (rf & 1) {
    var _r8 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "a", 16);
    i0.ɵɵlistener("click", function MyCommunitiesComponent_a_8_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r8); var ctx_r7 = i0.ɵɵnextContext(); return ctx_r7.viewAllCommunities(); });
    i0.ɵɵtext(1, "View all");
    i0.ɵɵelementEnd();
} }
var MyCommunitiesComponent = /** @class */ (function () {
    function MyCommunitiesComponent() {
        this.communities = [];
        this.maxCount = 3;
        this.viewAll = new EventEmitter();
        this.viewCommunity = new EventEmitter();
    }
    MyCommunitiesComponent.prototype.ngOnInit = function () { };
    MyCommunitiesComponent.prototype.viewAllCommunities = function () {
        this.viewAll.emit();
    };
    MyCommunitiesComponent.prototype.onViewCommunity = function (community) {
        this.viewCommunity.emit(community);
    };
    MyCommunitiesComponent.ɵfac = function MyCommunitiesComponent_Factory(t) { return new (t || MyCommunitiesComponent)(); };
    MyCommunitiesComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MyCommunitiesComponent, selectors: [["ins-my-communities"]], inputs: { communities: "communities", maxCount: "maxCount" }, outputs: { viewAll: "viewAll", viewCommunity: "viewCommunity" }, decls: 9, vars: 3, consts: [[1, "widget-pack"], [1, "wp-head"], [1, "wp-title"], [1, "wp-body"], [4, "ngIf"], ["id", "no_communities", "class", "neutral-info", 4, "ngIf"], [1, "wp-foot"], ["class", "wp-link", 3, "click", 4, "ngIf"], ["class", "avatar-block", 3, "click", 4, "ngFor", "ngForOf"], [1, "avatar-block", 3, "click"], [1, "ab-fig"], [3, "src", "alt"], [1, "ab-meta"], [1, "ab-label"], ["id", "no_communities", 1, "neutral-info"], ["id", "no_communities_browse_link", "href", "/groups/", 1, "cursor-pointer"], [1, "wp-link", 3, "click"]], template: function MyCommunitiesComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "section", 0);
            i0.ɵɵelementStart(1, "div", 1);
            i0.ɵɵelementStart(2, "h1", 2);
            i0.ɵɵtext(3, "My Communities");
            i0.ɵɵelementEnd();
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(4, "div", 3);
            i0.ɵɵtemplate(5, MyCommunitiesComponent_ng_container_5_Template, 2, 1, "ng-container", 4);
            i0.ɵɵtemplate(6, MyCommunitiesComponent_p_6_Template, 4, 0, "p", 5);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(7, "div", 6);
            i0.ɵɵtemplate(8, MyCommunitiesComponent_a_8_Template, 2, 0, "a", 7);
            i0.ɵɵelementEnd();
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵadvance(5);
            i0.ɵɵproperty("ngIf", ctx.communities == null ? null : ctx.communities.length);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", !(ctx.communities == null ? null : ctx.communities.length));
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", ctx.communities && ctx.communities.length > ctx.maxCount);
        } }, directives: [i1.NgIf, i1.NgForOf], styles: ["a[_ngcontent-%COMP%]{text-decoration:none}*[_ngcontent-%COMP%]{font-family:Lato,sans-serif;outline:0}.widget-pack[_ngcontent-%COMP%]{background:#fff;border-radius:.5rem;padding:.9375rem}.wp-body[_ngcontent-%COMP%], .wp-foot[_ngcontent-%COMP%]{margin-top:.9375rem}.wp-title[_ngcontent-%COMP%]{font-size:1rem;font-weight:700;color:#061a73;margin:0;font-family:Lato,sans-serif}.wp-link[_ngcontent-%COMP%]{color:#6e6f70;font-size:.875rem;cursor:pointer}.wp-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.avatar-block[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;color:#000}.avatar-block[_ngcontent-%COMP%]   .ab-fig[_ngcontent-%COMP%]{width:2rem;height:2rem;border-radius:50%;margin:0 .75rem 0 0;flex:0 0 auto;position:relative;overflow:hidden;border:1px solid #e2e5e4;background:#fff}.avatar-block[_ngcontent-%COMP%]   .ab-fig[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{display:block;width:100%;height:100%;-o-object-fit:cover;object-fit:cover;image-rendering:auto}.avatar-block[_ngcontent-%COMP%]   .ab-meta[_ngcontent-%COMP%]{flex:1 1 auto}.avatar-block[_ngcontent-%COMP%]   .ab-label[_ngcontent-%COMP%]{font-size:.875rem;color:#000;line-height:1.3}.avatar-block[_ngcontent-%COMP%]   .ab-stamp[_ngcontent-%COMP%]{flex:0 0 auto;font-size:.75rem;color:#e1e3e2;margin-left:.625rem}.avatar-block[_ngcontent-%COMP%]:hover{text-decoration:underline}.avatar-block[_ngcontent-%COMP%]:not(:last-child){margin-bottom:1rem}.neutral-info[_ngcontent-%COMP%]{color:#6e6f70;font-size:.8125rem}"] });
    return MyCommunitiesComponent;
}());
export { MyCommunitiesComponent };
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(MyCommunitiesComponent, [{
        type: Component,
        args: [{
                selector: 'ins-my-communities',
                templateUrl: './my-communities.component.html',
                styleUrls: ['./my-communities.component.scss'],
            }]
    }], function () { return []; }, { communities: [{
            type: Input
        }], maxCount: [{
            type: Input
        }], viewAll: [{
            type: Output
        }], viewCommunity: [{
            type: Output
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 