import { Component, Input } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@ionic/angular";
import * as i2 from "../../services/login/login.service";
import * as i3 from "../../services/util/util.service";
import * as i4 from "@angular/common";
import * as i5 from "primeng/messages";
function PageComponent_div_6_h1_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "h1");
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r2.headingText);
} }
function PageComponent_div_6_div_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 11);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r3.detailText);
} }
function PageComponent_div_6_ion_button_5_Template(rf, ctx) { if (rf & 1) {
    const _r6 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "ion-button", 12);
    i0.ɵɵlistener("click", function PageComponent_div_6_ion_button_5_Template_ion_button_click_0_listener() { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r5.openHome()); });
    i0.ɵɵelement(1, "ion-icon", 13);
    i0.ɵɵtext(2, " Home ");
    i0.ɵɵelementEnd();
} }
function PageComponent_div_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 6);
    i0.ɵɵelement(1, "p-messages", 7)(2, "i");
    i0.ɵɵtemplate(3, PageComponent_div_6_h1_3_Template, 2, 1, "h1", 8)(4, PageComponent_div_6_div_4_Template, 2, 1, "div", 9)(5, PageComponent_div_6_ion_button_5_Template, 3, 0, "ion-button", 10);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("value", ctx_r0.util.msgs);
    i0.ɵɵadvance(1);
    i0.ɵɵclassMap(ctx_r0.icon);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.headingText);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.detailText);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.homeButton);
} }
function PageComponent_div_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 14);
    i0.ɵɵprojection(1);
    i0.ɵɵelementEnd();
} }
const _c0 = ["*"];
export class PageComponent {
    constructor(nav, ls, util) {
        this.nav = nav;
        this.ls = ls;
        this.util = util;
        this.homeButton = false;
        this.hideCard = false;
    }
    ngOnInit() { }
    openHome() {
        if (this.ls.getUser()) {
            if (this.ls.isClaimant()) {
                this.util.openPageByContextRoot('cp', "welcome");
                this.util.hideLoader();
            }
            else if (this.ls.isEmployer() || this.ls.isTpa()) {
                //this.util.openPageByContextRoot('cp',"employer-dashboard");
                this.util.openPageByContextRoot('ss', "welcome");
                this.util.hideLoader();
            }
            else {
                //this.util.openPageByContextRoot('cp',"csr-dashboard");
                this.util.openPageByContextRoot('ss', "welcome");
                this.util.hideLoader();
            }
        }
        else {
            this.nav.navigateRoot('/login');
        }
    }
    static { this.ɵfac = function PageComponent_Factory(t) { return new (t || PageComponent)(i0.ɵɵdirectiveInject(i1.NavController), i0.ɵɵdirectiveInject(i2.LoginService), i0.ɵɵdirectiveInject(i3.UtilService)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PageComponent, selectors: [["app-page"]], inputs: { src: "src", style: "style", alt: "alt", icon: "icon", headingText: "headingText", detailText: "detailText", homeButton: "homeButton", hideCard: "hideCard" }, ngContentSelectors: _c0, decls: 8, vars: 6, consts: [[1, "page-body", "notfound-page"], [1, "page-type"], [3, "src", "alt"], ["size", "12", "size-xl", "6", "size-lg", "8", "size-md", "10", "size-sm", "12", "offset-lg", "3", "offset-md", "3", "offset-xl", "3"], ["class", "card page-panel", 4, "ngIf"], ["style", "margin: -13% auto 0 auto;", 4, "ngIf"], [1, "card", "page-panel"], [3, "value"], [4, "ngIf"], ["class", "page-detail", 4, "ngIf"], ["color", "dark", "shape", "round", "value", "Home", 3, "click", 4, "ngIf"], [1, "page-detail"], ["color", "dark", "shape", "round", "value", "Home", 3, "click"], ["name", "home", "slot", "start"], [2, "margin", "-13% auto 0 auto"]], template: function PageComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵprojectionDef();
            i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
            i0.ɵɵelement(2, "img", 2);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(3, "ion-grid")(4, "ion-row")(5, "ion-col", 3);
            i0.ɵɵtemplate(6, PageComponent_div_6_Template, 6, 6, "div", 4)(7, PageComponent_div_7_Template, 2, 0, "div", 5);
            i0.ɵɵelementEnd()()()();
        } if (rf & 2) {
            i0.ɵɵstyleMap(ctx.style);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("src", ctx.src, i0.ɵɵsanitizeUrl)("alt", ctx.alt ? ctx.alt : "image");
            i0.ɵɵadvance(4);
            i0.ɵɵproperty("ngIf", !ctx.hideCard);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.hideCard);
        } }, dependencies: [i1.IonButton, i1.IonCol, i1.IonGrid, i1.IonIcon, i1.IonRow, i4.NgIf, i5.Messages], styles: [".page-body[_ngcontent-%COMP%]{height:auto}.page-body.notfound-page[_ngcontent-%COMP%]   .page-type[_ngcontent-%COMP%]{background:var(--ion-color-primary)}.page-body[_ngcontent-%COMP%]   .page-type[_ngcontent-%COMP%]{width:100%;height:50%;padding:50px 100px 100px;box-sizing:border-box;text-align:center}.page-type[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:15%}@media (max-width: 576px){.page-type[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:100%}}.page-body[_ngcontent-%COMP%]   .page-panel[_ngcontent-%COMP%]{text-align:center;padding:35px;margin:-15% auto 0;z-index:100}.card[_ngcontent-%COMP%]{box-shadow:0 1px 3px #0003,0 1px 1px #00000024,0 2px 1px -1px #0000001f;-webkit-box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);-moz-box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);border-radius:2px;background:#fff;padding:1em;margin-bottom:1em;box-sizing:border-box}.page-body.notfound-page[_ngcontent-%COMP%]   .page-panel[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:var(--ion-color-dark)}.page-body[_ngcontent-%COMP%]   .page-panel[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:72px}.page-body[_ngcontent-%COMP%]   .page-panel[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{font-size:36px;line-height:36px;color:#757575}.card[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{font-size:1.5em;font-weight:400;margin:1em 0}.page-body[_ngcontent-%COMP%]   .page-panel[_ngcontent-%COMP%]   .page-detail[_ngcontent-%COMP%]{margin:20px 0 100px;color:#757575}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PageComponent, [{
        type: Component,
        args: [{ selector: 'app-page', template: "<div class=\"page-body notfound-page\" [style]=\"style\">\r\n  \r\n<div class=\"page-type\"><img [src]=\"src\" [alt]=\"alt ? alt : 'image'\"></div>\r\n<ion-grid>\r\n    <ion-row>\r\n    <ion-col size=\"12\" size-xl=\"6\" size-lg=\"8\" size-md=\"10\" size-sm=\"12\" offset-lg=\"3\" offset-md=\"3\" offset-xl=\"3\">\r\n        <div class=\"card page-panel\" *ngIf=\"!hideCard\">\r\n        <p-messages [value]=\"util.msgs\"></p-messages>\r\n        <i [class]=\"icon\"></i>\r\n        <h1 *ngIf=\"headingText\">{{headingText}}</h1>\r\n        <div class=\"page-detail\" *ngIf=\"detailText\">{{detailText}}</div>\r\n        <ion-button color=\"dark\" shape=\"round\" (click)=\"openHome()\" *ngIf=\"homeButton\" value=\"Home\"> \r\n            <ion-icon name=\"home\" slot=\"start\"></ion-icon>\r\n            Home \r\n        </ion-button>\r\n        </div>\r\n        <div *ngIf=\"hideCard\" style=\"margin: -13% auto 0 auto;\">\r\n        <ng-content></ng-content>\r\n        </div>\r\n    </ion-col>\r\n    </ion-row>\r\n</ion-grid>\r\n</div>", styles: [".page-body{height:auto}.page-body.notfound-page .page-type{background:var(--ion-color-primary)}.page-body .page-type{width:100%;height:50%;padding:50px 100px 100px;box-sizing:border-box;text-align:center}.page-type img{width:15%}@media (max-width: 576px){.page-type img{width:100%}}.page-body .page-panel{text-align:center;padding:35px;margin:-15% auto 0;z-index:100}.card{box-shadow:0 1px 3px #0003,0 1px 1px #00000024,0 2px 1px -1px #0000001f;-webkit-box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);-moz-box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);border-radius:2px;background:#fff;padding:1em;margin-bottom:1em;box-sizing:border-box}.page-body.notfound-page .page-panel i{color:var(--ion-color-dark)}.page-body .page-panel i{font-size:72px}.page-body .page-panel h1{font-size:36px;line-height:36px;color:#757575}.card h1{font-size:1.5em;font-weight:400;margin:1em 0}.page-body .page-panel .page-detail{margin:20px 0 100px;color:#757575}\n"] }]
    }], () => [{ type: i1.NavController }, { type: i2.LoginService }, { type: i3.UtilService }], { src: [{
            type: Input,
            args: ['src']
        }], style: [{
            type: Input,
            args: ['style']
        }], alt: [{
            type: Input,
            args: ['alt']
        }], icon: [{
            type: Input,
            args: ['icon']
        }], headingText: [{
            type: Input,
            args: ['headingText']
        }], detailText: [{
            type: Input,
            args: ['detailText']
        }], homeButton: [{
            type: Input,
            args: ['homeButton']
        }], hideCard: [{
            type: Input,
            args: ['hideCard']
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PageComponent, { className: "PageComponent", filePath: "lib\\components\\page\\page.component.ts", lineNumber: 11 }); })();
//# sourceMappingURL=data:application/json;base64, 