import { Component } from '@angular/core';
import { BasePage } from '../../pages/BasePage';
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/accordion";
import * as i5 from "primeng/card";
import * as i6 from "primeng/badge";
import * as i7 from "@ngx-translate/core";
function NewsComponent_div_0_div_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 6);
    i0.ɵɵelement(1, "ion-spinner", 7);
    i0.ɵɵelementEnd();
} }
function NewsComponent_div_0_p_accordionTab_8_p_badge_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "p-badge", 10);
} }
function NewsComponent_div_0_p_accordionTab_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p-accordionTab", 8)(1, "div");
    i0.ɵɵtemplate(2, NewsComponent_div_0_p_accordionTab_8_p_badge_2_Template, 1, 0, "p-badge", 9);
    i0.ɵɵelementStart(3, "b");
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(5, "p");
    i0.ɵɵtext(6);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const n_r3 = ctx.$implicit;
    const i_r4 = ctx.index;
    i0.ɵɵpropertyInterpolate("header", n_r3.heading);
    i0.ɵɵproperty("selected", i_r4 == 0);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", i_r4 == 0);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(n_r3.startDate);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(n_r3.description);
} }
function NewsComponent_div_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div")(1, "p-card", 1)(2, "div", 2)(3, "ion-label", 3);
    i0.ɵɵtext(4);
    i0.ɵɵpipe(5, "translate");
    i0.ɵɵelementEnd()();
    i0.ɵɵtemplate(6, NewsComponent_div_0_div_6_Template, 2, 0, "div", 4);
    i0.ɵɵelementStart(7, "p-accordion");
    i0.ɵɵtemplate(8, NewsComponent_div_0_p_accordionTab_8_Template, 7, 5, "p-accordionTab", 5);
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(5, 3, "claimant.dashbaord.form.newsinfo"));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r0.loading);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngForOf", ctx_r0.news);
} }
export class NewsComponent extends BasePage {
    constructor(ns) {
        super();
        this.ns = ns;
        this.news = [];
    }
    ngOnInit() {
        this.fetchNewsAndAnnouncementInfo();
    }
    fetchNewsAndAnnouncementInfo() {
        this.showLoader();
        this.ns.fetchNewsAnnouncementsInformation()
            .subscribe(resNews => {
            this.news = resNews;
            this.hideLoader();
        }, err => {
            this.news = [];
            this.hideLoader();
        });
    }
    static { this.ɵfac = function NewsComponent_Factory(t) { return new (t || NewsComponent)(i0.ɵɵdirectiveInject(i1.NotificationService)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: NewsComponent, selectors: [["app-news"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[4, "ngIf"], ["styleClass", " app-box"], [1, "ion-text-center", "app-card-heading"], ["color", "dark"], ["class", "ion-text-center", 4, "ngIf"], [3, "header", "selected", 4, "ngFor", "ngForOf"], [1, "ion-text-center"], ["name", "dots"], [3, "header", "selected"], ["style", "padding-right: 1rem;", "value", "New", 4, "ngIf"], ["value", "New", 2, "padding-right", "1rem"]], template: function NewsComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵtemplate(0, NewsComponent_div_0_Template, 9, 5, "div", 0);
        } if (rf & 2) {
            i0.ɵɵproperty("ngIf", ctx.news.length != 0);
        } }, dependencies: [i2.IonLabel, i2.IonSpinner, i3.NgForOf, i3.NgIf, i4.Accordion, i4.AccordionTab, i5.Card, i6.Badge, i7.TranslatePipe] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NewsComponent, [{
        type: Component,
        args: [{ selector: 'app-news', template: "<div *ngIf=\"(news.length != 0)\">\r\n    <p-card styleClass=\" app-box\">\r\n        <div class=\"ion-text-center app-card-heading\">\r\n            <ion-label color=\"dark\">{{'claimant.dashbaord.form.newsinfo'|translate}}</ion-label>\r\n        </div>\r\n        <div *ngIf=\"loading\" class=\"ion-text-center\">\r\n            <ion-spinner name=\"dots\"></ion-spinner>\r\n        </div>\r\n        <p-accordion>\r\n            <p-accordionTab header=\"{{n.heading}}\" *ngFor=\"let n of news; let i = index\" [selected]=\"i == 0\">\r\n                <div>\r\n                    <p-badge style=\"padding-right: 1rem;\" value=\"New\" *ngIf=\"i == 0\"></p-badge> <b>{{n.startDate}}</b>\r\n                </div>\r\n                <p>{{n.description}}</p>\r\n            </p-accordionTab>\r\n        </p-accordion>\r\n    </p-card>\r\n</div>" }]
    }], () => [{ type: i1.NotificationService }], null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(NewsComponent, { className: "NewsComponent", filePath: "lib\\components\\news\\news.component.ts", lineNumber: 11 }); })();
//# sourceMappingURL=data:application/json;base64, 