import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
function CommunityResourcesComponent_section_0_button_2_Template(rf, ctx) { if (rf & 1) {
    var _r5 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 9);
    i0.ɵɵlistener("click", function CommunityResourcesComponent_section_0_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r5); var ctx_r4 = i0.ɵɵnextContext(2); return ctx_r4.onCloseCommunityResources(); });
    i0.ɵɵelementEnd();
} }
function CommunityResourcesComponent_section_0_li_7_a_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "a", 12);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r9 = i0.ɵɵnextContext();
    var i_r7 = ctx_r9.index;
    var link_r6 = ctx_r9.$implicit;
    i0.ɵɵpropertyInterpolate1("id", "community-section-link-", i_r7, "");
    i0.ɵɵproperty("href", link_r6 == null ? null : link_r6.link, i0.ɵɵsanitizeUrl);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", link_r6 == null ? null : link_r6.label, " ");
} }
function CommunityResourcesComponent_section_0_li_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "li", 10);
    i0.ɵɵtemplate(1, CommunityResourcesComponent_section_0_li_7_a_1_Template, 2, 3, "a", 11);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var i_r7 = ctx.index;
    var ctx_r2 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r2.isMobile || !ctx_r2.isMobile && (i_r7 < ctx_r2.defaultLinksCount || i_r7 >= ctx_r2.defaultLinksCount && ctx_r2.showMore));
} }
function CommunityResourcesComponent_section_0_div_8_Template(rf, ctx) { if (rf & 1) {
    var _r11 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 13);
    i0.ɵɵelementStart(1, "a", 14);
    i0.ɵɵlistener("click", function CommunityResourcesComponent_section_0_div_8_Template_a_click_1_listener() { i0.ɵɵrestoreView(_r11); var ctx_r10 = i0.ɵɵnextContext(2); return ctx_r10.toggleShowMore(); });
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", ctx_r3.showMore ? "Show Less" : "See All Resources", " ");
} }
function CommunityResourcesComponent_section_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "section", 1);
    i0.ɵɵelementStart(1, "div", 2);
    i0.ɵɵtemplate(2, CommunityResourcesComponent_section_0_button_2_Template, 1, 0, "button", 3);
    i0.ɵɵelementStart(3, "h1", 4);
    i0.ɵɵtext(4, "Information and Resources");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "div", 5);
    i0.ɵɵelementStart(6, "ul", 6);
    i0.ɵɵtemplate(7, CommunityResourcesComponent_section_0_li_7_Template, 2, 1, "li", 7);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(8, CommunityResourcesComponent_section_0_div_8_Template, 3, 1, "div", 8);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("resources-mobile-panel", ctx_r0.isMobile)("active", ctx_r0.isMobile && ctx_r0.showCommunityResources);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r0.isMobile);
    i0.ɵɵadvance(5);
    i0.ɵɵproperty("ngForOf", ctx_r0.communitySectionLinks);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !ctx_r0.isMobile && (ctx_r0.communitySectionLinks == null ? null : ctx_r0.communitySectionLinks.length) > 4 && (ctx_r0.communitySectionLinks == null ? null : ctx_r0.communitySectionLinks.length) > ctx_r0.defaultLinksCount);
} }
var CommunityResourcesComponent = /** @class */ (function () {
    function CommunityResourcesComponent() {
        this.isMobile = false;
        this.communitySectionLinks = [];
        this.showCommunityResources = false;
        this.defaultLinksCount = 4;
        this.closeCommunityResources = new EventEmitter();
        this.showMore = false;
    }
    CommunityResourcesComponent.prototype.ngOnInit = function () {
        if (!Array.isArray(this.communitySectionLinks)) {
            this.communitySectionLinks = [];
        }
    };
    CommunityResourcesComponent.prototype.toggleShowMore = function () {
        this.showMore = !this.showMore;
    };
    CommunityResourcesComponent.prototype.onCloseCommunityResources = function () {
        this.closeCommunityResources.emit();
    };
    CommunityResourcesComponent.ɵfac = function CommunityResourcesComponent_Factory(t) { return new (t || CommunityResourcesComponent)(); };
    CommunityResourcesComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CommunityResourcesComponent, selectors: [["ins-community-resources"]], inputs: { community: "community", isMobile: "isMobile", communitySectionLinks: "communitySectionLinks", showCommunityResources: "showCommunityResources", defaultLinksCount: "defaultLinksCount" }, outputs: { closeCommunityResources: "closeCommunityResources" }, decls: 1, vars: 1, consts: [["class", "widget-pack community-resources-widget", 3, "resources-mobile-panel", "active", 4, "ngIf"], [1, "widget-pack", "community-resources-widget"], [1, "wp-head"], ["class", "icn-arrow-left csw-back", 3, "click", 4, "ngIf"], ["id", "community-links-title", 1, "wp-title"], [1, "wp-body"], [1, "crw-list"], ["class", "crw-item", 4, "ngFor", "ngForOf"], ["class", "wp-foot", 4, "ngIf"], [1, "icn-arrow-left", "csw-back", 3, "click"], [1, "crw-item"], ["class", "crw-link", "target", "_blank", 3, "id", "href", 4, "ngIf"], ["target", "_blank", 1, "crw-link", 3, "id", "href"], [1, "wp-foot"], ["id", "community-resources-toggle", 1, "wp-link", 3, "click"]], template: function CommunityResourcesComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵtemplate(0, CommunityResourcesComponent_section_0_Template, 9, 7, "section", 0);
        } if (rf & 2) {
            i0.ɵɵproperty("ngIf", ctx.communitySectionLinks == null ? null : ctx.communitySectionLinks.length);
        } }, 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}.crw-list[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0;font-size:.875rem;color:#000}.crw-item[_ngcontent-%COMP%]:not(:last-child){margin-bottom:.9375rem}.crw-link[_ngcontent-%COMP%]{color:#000}.crw-link[_ngcontent-%COMP%]:hover{text-decoration:underline}@media (max-width:1299px){.resources-mobile-panel[_ngcontent-%COMP%]{position:fixed;top:212px;z-index:1;bottom:0;left:0;right:0;border-radius:0;padding:0;transition:.3s ease-in-out;transform:translateY(100%)}.resources-mobile-panel[_ngcontent-%COMP%]   .wp-head[_ngcontent-%COMP%]{height:50px;display:flex;align-items:center;justify-content:center;border-bottom:1px solid #e2e5e4;position:relative}.resources-mobile-panel[_ngcontent-%COMP%]   .wp-title[_ngcontent-%COMP%]{color:#000}.resources-mobile-panel[_ngcontent-%COMP%]   .wp-body[_ngcontent-%COMP%]{padding:25px;margin:0}.resources-mobile-panel[_ngcontent-%COMP%]   .wp-foot[_ngcontent-%COMP%]{padding:0 25px}.resources-mobile-panel.active[_ngcontent-%COMP%]{transform:translateY(0)}}.csw-back[_ngcontent-%COMP%]{border:none;background:0 0;color:#000;padding:0;margin:0;left:16px;font-size:16px;position:absolute}"] });
    return CommunityResourcesComponent;
}());
export { CommunityResourcesComponent };
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(CommunityResourcesComponent, [{
        type: Component,
        args: [{
                selector: 'ins-community-resources',
                templateUrl: './community-resources.component.html',
                styleUrls: ['./community-resources.component.scss']
            }]
    }], function () { return []; }, { community: [{
            type: Input
        }], isMobile: [{
            type: Input
        }], communitySectionLinks: [{
            type: Input
        }], showCommunityResources: [{
            type: Input
        }], defaultLinksCount: [{
            type: Input
        }], closeCommunityResources: [{
            type: Output
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 