import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "../../services/notification/notification.service";
import * as i2 from "@ionic/angular";
import * as i3 from "@angular/common";
import * as i4 from "primeng/api";
import * as i5 from "primeng/carousel";
import * as i6 from "primeng/divider";
import * as i7 from "@fortawesome/angular-fontawesome";
function InfoComponent_div_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "div", 3);
} }
function InfoComponent_div_1_ion_col_6_ion_button_11_Template(rf, ctx) { if (rf & 1) {
    const _r10 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "ion-button", 17);
    i0.ɵɵlistener("click", function InfoComponent_div_1_ion_col_6_ion_button_11_Template_ion_button_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r10); const link_r8 = restoredCtx.$implicit; const ctx_r9 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r9.open(link_r8)); });
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const link_r8 = ctx.$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1("", link_r8.linkDesc, " ");
} }
function InfoComponent_div_1_ion_col_6_p_divider_12_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "p-divider", 18);
} }
const _c0 = a1 => ["far", a1];
function InfoComponent_div_1_ion_col_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "ion-col", 7)(1, "div", 8)(2, "div")(3, "p", 9);
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "ion-label");
    i0.ɵɵelement(6, "span", 10);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(7, "div", 11)(8, "div", 12);
    i0.ɵɵelement(9, "fa-icon", 13);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(10, "div", 14);
    i0.ɵɵtemplate(11, InfoComponent_div_1_ion_col_6_ion_button_11_Template, 2, 1, "ion-button", 15);
    i0.ɵɵelementEnd()()();
    i0.ɵɵtemplate(12, InfoComponent_div_1_ion_col_6_p_divider_12_Template, 1, 0, "p-divider", 16);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const trend_r4 = ctx.$implicit;
    const isLast_r5 = ctx.last;
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate(trend_r4.header);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("innerHTML", trend_r4.subHeader, i0.ɵɵsanitizeHtml);
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("icon", i0.ɵɵpureFunction1(5, _c0, trend_r4.image));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngForOf", trend_r4.links);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !isLast_r5);
} }
function InfoComponent_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 4)(1, "ion-grid")(2, "ion-row")(3, "ion-col", 5)(4, "ion-grid")(5, "ion-row");
    i0.ɵɵtemplate(6, InfoComponent_div_1_ion_col_6_Template, 13, 7, "ion-col", 6);
    i0.ɵɵelementEnd()()()()();
    i0.ɵɵelement(7, "br");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(6);
    i0.ɵɵproperty("ngForOf", ctx_r1.trendingLinks);
} }
function InfoComponent_p_carousel_2_ng_template_1_a_4_Template(rf, ctx) { if (rf & 1) {
    const _r16 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "a", 22);
    i0.ɵɵlistener("click", function InfoComponent_p_carousel_2_ng_template_1_a_4_Template_a_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r16); const link_r14 = restoredCtx.$implicit; const ctx_r15 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r15.open(link_r14)); });
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const link_r14 = ctx.$implicit;
    i0.ɵɵattribute("aria-label", link_r14.linkDesc);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(link_r14.linkDesc);
} }
function InfoComponent_p_carousel_2_ng_template_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "h3");
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(2, "p");
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(4, InfoComponent_p_carousel_2_ng_template_1_a_4_Template, 2, 2, "a", 21);
} if (rf & 2) {
    const trend_r12 = ctx.$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(trend_r12.header);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(trend_r12.subHeader);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngForOf", trend_r12.links);
} }
function InfoComponent_p_carousel_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p-carousel", 19);
    i0.ɵɵtemplate(1, InfoComponent_p_carousel_2_ng_template_1_Template, 5, 3, "ng-template", 20);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵproperty("value", ctx_r2.trendingLinks)("numScroll", 1)("responsiveOptions", ctx_r2.responsiveOptions)("autoplayInterval", 10000)("circular", true);
} }
export class InfoComponent {
    constructor(ns) {
        this.ns = ns;
        this.display = "tile";
        this.type = "MRKT";
        this.onLinkClick = new EventEmitter();
        this.trendingLinks = [];
        this.responsiveOptions = [
            {
                breakpoint: '1024px',
                numVisible: 1,
                numScroll: 1
            },
            {
                breakpoint: '768px',
                numVisible: 1,
                numScroll: 1
            },
            {
                breakpoint: '560px',
                numVisible: 1,
                numScroll: 1
            }
        ];
    }
    ngOnInit() {
        this.trendingLinks = [];
        this.ns
            .fetchTrends()
            .subscribe(res => {
            this.trendingLinks = res.filter(trend => {
                if (this.userType) {
                    return trend.userType == this.userType;
                }
                else {
                    return trend.type == this.type;
                }
            });
        });
    }
    open(link) {
        if (link.linkType == 'LINK') {
            window.open(link.linkUrl, 'blank');
        }
        else {
            this.onLinkClick.emit(link);
        }
    }
    static { this.ɵfac = function InfoComponent_Factory(t) { return new (t || InfoComponent)(i0.ɵɵdirectiveInject(i1.NotificationService)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: InfoComponent, selectors: [["app-info"]], inputs: { heading: "heading", display: "display", type: "type", userType: "userType" }, outputs: { onLinkClick: "onLinkClick" }, decls: 3, vars: 3, consts: [["class", "ion-padding-start ion-padding-end", 4, "ngIf"], ["class", "grid p-jc-left ion-padding-start ion-padding-end", 4, "ngIf"], [3, "value", "numScroll", "responsiveOptions", "autoplayInterval", "circular", 4, "ngIf"], [1, "ion-padding-start", "ion-padding-end"], [1, "grid", "p-jc-left", "ion-padding-start", "ion-padding-end"], ["size", "12", "sizeSm", "12", "sizeXs", "12", "sizeMd", "12", "sizeLg", "12", "sizeXl", "10", "offsetXl", "1"], ["class", "full-height", "size", "12", "sizeSm", "12", "sizeXs", "12", "sizeMd", "6", "sizeLg", "3", "sizeXl", "3", "style", "width: 320px !important;", 4, "ngFor", "ngForOf"], ["size", "12", "sizeSm", "12", "sizeXs", "12", "sizeMd", "6", "sizeLg", "3", "sizeXl", "3", 1, "full-height", 2, "width", "320px !important"], [1, "flex"], [1, "heading"], [2, "color", "var(--ion-color-medium-gray)", 3, "innerHTML"], [1, "grid"], [1, "col-3"], [1, "app-tile-img", 3, "icon"], [1, "col-9"], ["shape", "round", "fill", "outline", "target", "blank", "size", "small", "class", "app-tile-button", 3, "click", 4, "ngFor", "ngForOf"], ["layout", "vertical", "class", "ion-hide-sm-down ion-hide-md-down", 4, "ngIf"], ["shape", "round", "fill", "outline", "target", "blank", "size", "small", 1, "app-tile-button", 3, "click"], ["layout", "vertical", 1, "ion-hide-sm-down", "ion-hide-md-down"], [3, "value", "numScroll", "responsiveOptions", "autoplayInterval", "circular"], ["pTemplate", "item"], ["class", "link", "target", "_blank", "rel", "noopener", 3, "click", 4, "ngFor", "ngForOf"], ["target", "_blank", "rel", "noopener", 1, "link", 3, "click"]], template: function InfoComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵtemplate(0, InfoComponent_div_0_Template, 1, 0, "div", 0)(1, InfoComponent_div_1_Template, 8, 1, "div", 1)(2, InfoComponent_p_carousel_2_Template, 2, 5, "p-carousel", 2);
        } if (rf & 2) {
            i0.ɵɵproperty("ngIf", ctx.trendingLinks && ctx.trendingLinks.length > 0 && ctx.display == "tile" && ctx.heading);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.display == "tile");
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.display == "slider" && ctx.trendingLinks && ctx.trendingLinks.length > 0);
        } }, dependencies: [i2.IonButton, i2.IonCol, i2.IonGrid, i2.IonLabel, i2.IonRow, i3.NgForOf, i3.NgIf, i4.PrimeTemplate, i5.Carousel, i6.Divider, i7.FaIconComponent], styles: [".heading[_ngcontent-%COMP%]{font-size:26px;font-family:var(--app-font-light);margin-bottom:5px;color:var(--ion-color-medium-gray)}.app-tile-img[_ngcontent-%COMP%]{font-size:40px;color:var(--ion-color-primary)}.app-tile-button[_ngcontent-%COMP%]{position:absolute;bottom:15px}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(InfoComponent, [{
        type: Component,
        args: [{ selector: 'app-info', template: "<div class=\"ion-padding-start ion-padding-end\"\r\n  *ngIf=\"trendingLinks && trendingLinks.length > 0 && display=='tile' && heading\">\r\n  <!--<h1>{{heading}}</h1> -->\r\n  <!--<p-divider></p-divider> -->\r\n</div>\r\n<div class=\"grid p-jc-left ion-padding-start ion-padding-end\" *ngIf=\"display=='tile'\">\r\n  <ion-grid>\r\n    <ion-row>\r\n      <ion-col size=\"12\" sizeSm=\"12\" sizeXs=\"12\" sizeMd=\"12\" sizeLg=\"12\" sizeXl=\"10\" offsetXl=\"1\">\r\n        <ion-grid>\r\n          <ion-row>\r\n            <ion-col *ngFor=\"let trend of trendingLinks; let isLast = last\" class=\"full-height\" size=\"12\" sizeSm=\"12\"\r\n              sizeXs=\"12\" sizeMd=\"6\" sizeLg=\"3\" sizeXl=\"3\" style=\"width: 320px !important;\">\r\n              <div class=\"flex\">\r\n                <div>\r\n                  <p class=\"heading\">{{trend.header}}</p>\r\n                  <ion-label><span [innerHTML]=\"trend.subHeader\" style=\"color: var(--ion-color-medium-gray);\"></span>\r\n                  </ion-label>\r\n                  <div class=\"grid\">\r\n                    <div class=\"col-3\">\r\n                      <fa-icon [icon]=\"['far', trend.image]\" class=\"app-tile-img\"></fa-icon>\r\n                    </div>\r\n                    <div class=\"col-9\">\r\n                      <ion-button shape=\"round\" fill=\"outline\" (click)=\"open(link)\" target=\"blank\"\r\n                        *ngFor=\"let link of trend.links\" size=\"small\" class=\"app-tile-button\">{{link.linkDesc}}\r\n                      </ion-button>\r\n                    </div>\r\n                  </div>\r\n                </div>\r\n                <p-divider layout=\"vertical\" *ngIf=\"!isLast\" class=\"ion-hide-sm-down ion-hide-md-down\"></p-divider>\r\n              </div>\r\n            </ion-col>\r\n          </ion-row>\r\n        </ion-grid>\r\n      </ion-col>\r\n    </ion-row>\r\n  </ion-grid>\r\n\r\n  <br />\r\n</div>\r\n\r\n<p-carousel [value]=\"trendingLinks\" [numScroll]=\"1\" [responsiveOptions]=\"responsiveOptions\" [autoplayInterval]=\"10000\"\r\n  [circular]=\"true\" *ngIf=\"display=='slider' && trendingLinks && trendingLinks.length > 0\">\r\n  <ng-template let-trend pTemplate=\"item\">\r\n    <h3>{{trend.header}}</h3>\r\n    <p>{{trend.subHeader}}</p>\r\n    <a class=\"link\" target=\"_blank\" *ngFor=\"let link of trend.links\" [attr.aria-label]=\"link.linkDesc\" rel=\"noopener\"\r\n      (click)=\"open(link)\">{{link.linkDesc}}</a>\r\n  </ng-template>\r\n</p-carousel>", styles: [".heading{font-size:26px;font-family:var(--app-font-light);margin-bottom:5px;color:var(--ion-color-medium-gray)}.app-tile-img{font-size:40px;color:var(--ion-color-primary)}.app-tile-button{position:absolute;bottom:15px}\n"] }]
    }], () => [{ type: i1.NotificationService }], { heading: [{
            type: Input
        }], display: [{
            type: Input
        }], type: [{
            type: Input
        }], userType: [{
            type: Input
        }], onLinkClick: [{
            type: Output
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(InfoComponent, { className: "InfoComponent", filePath: "lib\\components\\info\\info.component.ts", lineNumber: 9 }); })();
//# sourceMappingURL=data:application/json;base64, 