import { Component, EventEmitter, Input, Output } from '@angular/core';
import { LibConstants } from '../../models/LibConstants';
import * as i0 from "@angular/core";
import * as i1 from "@ionic/angular";
import * as i2 from "@angular/common";
import * as i3 from "primeng/api";
import * as i4 from "@angular/forms";
import * as i5 from "primeng/dialog";
function ProfileRedirectComponent_h4_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "h4", 7);
    i0.ɵɵtext(1, " Your MDES account is activated. ");
    i0.ɵɵelementEnd();
} }
function ProfileRedirectComponent_h4_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "h4", 7);
    i0.ɵɵtext(1, " Complete employment service registration ");
    i0.ɵɵelementEnd();
} }
function ProfileRedirectComponent_h4_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "h4", 7);
    i0.ɵɵtext(1, " Complete employment service registration ");
    i0.ɵɵelementEnd();
} }
function ProfileRedirectComponent_p_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p");
    i0.ɵɵtext(1, " First, you will complete your Employment Service registration and then you will have access to ");
    i0.ɵɵelementStart(2, "b");
    i0.ɵɵtext(3, "Employment");
    i0.ɵɵelementEnd();
    i0.ɵɵtext(4, " and ");
    i0.ɵɵelementStart(5, "b");
    i0.ɵɵtext(6, "Unemployment Insurance");
    i0.ɵɵelementEnd();
    i0.ɵɵtext(7, " services. ");
    i0.ɵɵelementEnd();
} }
function ProfileRedirectComponent_p_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p");
    i0.ɵɵtext(1, " You'll be redirected to our MSWorks website to complete employment service registration. ");
    i0.ɵɵelement(2, "br");
    i0.ɵɵtext(3, "If you choose ");
    i0.ɵɵelementStart(4, "b");
    i0.ɵɵtext(5, "Close");
    i0.ɵɵelementEnd();
    i0.ɵɵtext(6, " you will be logged out. ");
    i0.ɵɵelementEnd();
} }
function ProfileRedirectComponent_p_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p");
    i0.ɵɵtext(1, " You must complete your registration before you can go to your unemployment account. ");
    i0.ɵɵelement(2, "br");
    i0.ɵɵtext(3, "If you choose ");
    i0.ɵɵelementStart(4, "b");
    i0.ɵɵtext(5, "Close");
    i0.ɵɵelementEnd();
    i0.ɵɵtext(6, " you will be logged out. ");
    i0.ɵɵelementEnd();
} }
const _c0 = () => ({ width: "50vw" });
const _c1 = () => ({ "960px": "60vw", "640px": "100vw" });
export class ProfileRedirectComponent {
    constructor(navController) {
        this.navController = navController;
        this.commonSuccessPage = false;
        this.onSuccess = new EventEmitter();
        this.onClose = new EventEmitter();
    }
    ngOnInit() {
        this.setRedirectPage(this.redirectPage);
    }
    redirectToLink() {
        this.onSuccess.emit();
        window.open(`${LibConstants.msworksUrl}`, '_self');
    }
    close() {
        this.onClose.emit();
        this.navController.navigateRoot("login");
    }
    setRedirectPage(redirectPage) {
        switch (redirectPage.trim()) {
            case ('commonSuccessPage'):
                this.commonSuccessPage = true;
                break;
            case ('accountActivePage'):
                this.accountActivePage = true;
                break;
            case ('dashboardPage'):
                this.dashboardPage = true;
                break;
            default:
                console.log('default switch');
                break;
        }
    }
    static { this.ɵfac = function ProfileRedirectComponent_Factory(t) { return new (t || ProfileRedirectComponent)(i0.ɵɵdirectiveInject(i1.NavController)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ProfileRedirectComponent, selectors: [["app-profile-redirect"]], inputs: { email: "email", redirectPage: "redirectPage" }, outputs: { onSuccess: "onSuccess", onClose: "onClose" }, decls: 16, vars: 11, consts: [["visible", "true", "modal", "true", "appendTo", "body", "position", "top", 3, "breakpoints"], ["class", "heading ion-padding-left", 4, "ngIf"], [1, "ion-padding-left"], [4, "ngIf"], [1, "ion-text-right"], ["shape", "round", "type", "button", "color", "primary", "fill", "outline", 3, "click"], ["shape", "round", "type", "submit", "color", "primary", 3, "click"], [1, "heading", "ion-padding-left"]], template: function ProfileRedirectComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "p-dialog", 0)(1, "form");
            i0.ɵɵtemplate(2, ProfileRedirectComponent_h4_2_Template, 2, 0, "h4", 1)(3, ProfileRedirectComponent_h4_3_Template, 2, 0, "h4", 1)(4, ProfileRedirectComponent_h4_4_Template, 2, 0, "h4", 1);
            i0.ɵɵelementStart(5, "div", 2);
            i0.ɵɵtemplate(6, ProfileRedirectComponent_p_6_Template, 8, 0, "p", 3)(7, ProfileRedirectComponent_p_7_Template, 7, 0, "p", 3)(8, ProfileRedirectComponent_p_8_Template, 7, 0, "p", 3);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(9, "p-footer")(10, "div")(11, "div", 4)(12, "ion-button", 5);
            i0.ɵɵlistener("click", function ProfileRedirectComponent_Template_ion_button_click_12_listener() { return ctx.close(); });
            i0.ɵɵtext(13, "Close ");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(14, "ion-button", 6);
            i0.ɵɵlistener("click", function ProfileRedirectComponent_Template_ion_button_click_14_listener() { return ctx.redirectToLink(); });
            i0.ɵɵtext(15, "Ok");
            i0.ɵɵelementEnd()()()()()();
        } if (rf & 2) {
            i0.ɵɵstyleMap(i0.ɵɵpureFunction0(9, _c0));
            i0.ɵɵproperty("breakpoints", i0.ɵɵpureFunction0(10, _c1));
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", ctx.accountActivePage);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.commonSuccessPage);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.dashboardPage);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", ctx.accountActivePage);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.commonSuccessPage);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.dashboardPage);
        } }, dependencies: [i1.IonButton, i2.NgIf, i3.Footer, i4.ɵNgNoValidate, i4.NgControlStatusGroup, i4.NgForm, i5.Dialog] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ProfileRedirectComponent, [{
        type: Component,
        args: [{ selector: 'app-profile-redirect', template: "<p-dialog visible=\"true\" modal=\"true\" appendTo=\"body\" [breakpoints]=\"{'960px': '60vw', '640px': '100vw'}\"\r\n    [style]=\"{width: '50vw'}\" position=\"top\">\r\n    <form>\r\n        <h4 class=\"heading ion-padding-left\" *ngIf=\"accountActivePage\">\r\n            Your MDES account is activated.\r\n        </h4>\r\n        <h4 class=\"heading ion-padding-left\" *ngIf=\"commonSuccessPage\">\r\n            Complete employment service registration\r\n        </h4>\r\n        <h4 class=\"heading ion-padding-left\" *ngIf=\"dashboardPage\">\r\n            Complete employment service registration\r\n        </h4>\r\n        <div class=\"ion-padding-left\">\r\n            <p *ngIf=\"accountActivePage\">\r\n                First, you will complete your Employment Service registration and then you will have access to\r\n                <b>Employment</b> and <b>Unemployment Insurance</b> services.\r\n            </p>\r\n            <p *ngIf=\"commonSuccessPage\">\r\n                You'll be redirected to our MSWorks website to complete employment service registration.\r\n                <br>If you choose <b>Close</b> you will be logged out.\r\n            </p>\r\n            <p *ngIf=\"dashboardPage\">\r\n                You must complete your registration before you can go to your unemployment account.\r\n                <br>If you choose <b>Close</b> you will be logged out.\r\n            </p>\r\n        </div>\r\n\r\n        <p-footer>\r\n            <div>\r\n                <div class=\"ion-text-right\">\r\n                    <ion-button shape=\"round\" type=\"button\" color=\"primary\" fill=\"outline\" (click)=\"close()\">Close\r\n                    </ion-button>\r\n                    <ion-button shape=\"round\" type=\"submit\" color=\"primary\" (click)=\"redirectToLink()\">Ok</ion-button>\r\n                </div>\r\n            </div>\r\n        </p-footer>\r\n    </form>\r\n</p-dialog>" }]
    }], () => [{ type: i1.NavController }], { onSuccess: [{
            type: Output
        }], onClose: [{
            type: Output
        }], email: [{
            type: Input
        }], redirectPage: [{
            type: Input
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ProfileRedirectComponent, { className: "ProfileRedirectComponent", filePath: "lib\\components\\profile-redirect\\profile-redirect.component.ts", lineNumber: 10 }); })();
//# sourceMappingURL=data:application/json;base64, 