import { Component, EventEmitter, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "../../services/claimant-service/claimant.service";
import * as i2 from "../../services/logger/logger.service";
import * as i3 from "@ionic/angular";
import * as i4 from "@angular/common";
import * as i5 from "primeng/api";
import * as i6 from "primeng/dialog";
import * as i7 from "primeng/table";
import * as i8 from "@fortawesome/angular-fontawesome";
import * as i9 from "@ngx-translate/core";
function JobSearchResultPageComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "ion-grid");
    i0.ɵɵelement(1, "ion-row");
    i0.ɵɵelementStart(2, "ion-row");
    i0.ɵɵelement(3, "ion-col");
    i0.ɵɵelementEnd()();
} }
function JobSearchResultPageComponent_h3_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "h3");
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "translate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "job.search.results.popup.messages.noJobs"));
} }
function JobSearchResultPageComponent_h3_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "h3");
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "translate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "job.search.results.popup.messages.title"));
} }
function JobSearchResultPageComponent_p_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p");
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "translate");
    i0.ɵɵelementStart(3, "b");
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd();
    i0.ɵɵtext(5);
    i0.ɵɵpipe(6, "translate");
    i0.ɵɵelementStart(7, "b");
    i0.ɵɵtext(8);
    i0.ɵɵelementEnd();
    i0.ɵɵtext(9);
    i0.ɵɵpipe(10, "translate");
    i0.ɵɵelementStart(11, "b");
    i0.ɵɵtext(12);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 6, "job.search.results.popup.messages.search.criteria"));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(ctx_r3.jobResultsData == null ? null : ctx_r3.jobResultsData.zipCode);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind1(6, 8, "job.search.results.popup.messages.radius"), " ");
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate1("", ctx_r3.jobResultsData == null ? null : ctx_r3.jobResultsData.geographicalRange, " ");
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(10, 10, "job.search.results.popup.messages.keywords"));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(ctx_r3.jobResultsData == null ? null : ctx_r3.jobResultsData.keyWord);
} }
function JobSearchResultPageComponent_p_table_8_ng_template_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "tr")(1, "th", 7);
    i0.ɵɵtext(2);
    i0.ɵɵpipe(3, "translate");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "th", 7);
    i0.ɵɵtext(5);
    i0.ɵɵpipe(6, "translate");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(7, "th", 7);
    i0.ɵɵtext(8);
    i0.ɵɵpipe(9, "translate");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(10, "th", 7);
    i0.ɵɵtext(11);
    i0.ɵɵpipe(12, "translate");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(13, "th", 7);
    i0.ɵɵtext(14);
    i0.ɵɵpipe(15, "translate");
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 5, "job.search.results.table.header.Posted"));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 7, "job.search.results.table.header.Position"));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(9, 9, "job.search.results.table.header.Employer"));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(12, 11, "job.search.results.table.header.ZipCode"));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(15, 13, "job.search.results.table.header.View"));
} }
const _c0 = () => ["far", "angle-right"];
function JobSearchResultPageComponent_p_table_8_ng_template_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "tr", 8)(1, "td", 7);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "td", 7);
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "td", 7);
    i0.ɵɵtext(6);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(7, "td", 7);
    i0.ɵɵtext(8);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(9, "td", 7)(10, "ion-button", 9);
    i0.ɵɵelement(11, "fa-icon", 10);
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const matchingJobs_r9 = ctx.$implicit;
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", matchingJobs_r9.jobOrderCreateDate ? matchingJobs_r9.jobOrderCreateDate : "N/A", " ");
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", matchingJobs_r9.jobTitle ? matchingJobs_r9.jobTitle : "N/A", " ");
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", matchingJobs_r9.employerName ? matchingJobs_r9.employerName : "N/A", " ");
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", matchingJobs_r9.zipCode ? matchingJobs_r9.zipCode : "N/A", " ");
    i0.ɵɵadvance(2);
    i0.ɵɵpropertyInterpolate("href", matchingJobs_r9.jobOrderURL ? matchingJobs_r9.jobOrderURL : "N/A");
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("icon", i0.ɵɵpureFunction0(6, _c0));
} }
function JobSearchResultPageComponent_p_table_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p-table", 5);
    i0.ɵɵtemplate(1, JobSearchResultPageComponent_p_table_8_ng_template_1_Template, 16, 15, "ng-template", 1)(2, JobSearchResultPageComponent_p_table_8_ng_template_2_Template, 12, 7, "ng-template", 6);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext();
    i0.ɵɵproperty("value", ctx_r4.matchingJobs)("rowHover", true);
} }
function JobSearchResultPageComponent_ng_template_9_Template(rf, ctx) { if (rf & 1) {
    const _r11 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "ion-grid")(1, "ion-row");
    i0.ɵɵelement(2, "ion-col", 11);
    i0.ɵɵelementStart(3, "ion-col", 12)(4, "ion-button", 13);
    i0.ɵɵlistener("click", function JobSearchResultPageComponent_ng_template_9_Template_ion_button_click_4_listener() { i0.ɵɵrestoreView(_r11); const ctx_r10 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r10.cancel()); });
    i0.ɵɵtext(5, "Close");
    i0.ɵɵelementEnd()()()();
} }
const _c1 = () => ({ width: "60vw" });
const _c2 = () => ({ "1024px": "75vw", "768px": "85vw", "640px": "100vw" });
export class JobSearchResultPageComponent {
    constructor(cs, loggerService) {
        this.cs = cs;
        this.loggerService = loggerService;
        this.areJobsFetched = true;
        this.onCancel = new EventEmitter();
    }
    ngOnInit() {
        this.getClaimantJobResults();
    }
    getClaimantJobResults() {
        this.cs.getJobResults()
            .subscribe(res => {
            this.jobResultsData = res;
            this.loggerService.info(res);
            this.matchingJobs = res.availableJobModel;
        }, err => {
            this.areJobsFetched = false;
            this.loggerService.info('error while calling job result', err);
        });
    }
    cancel() {
        this.onCancel.emit();
    }
    static { this.ɵfac = function JobSearchResultPageComponent_Factory(t) { return new (t || JobSearchResultPageComponent)(i0.ɵɵdirectiveInject(i1.ClaimantService), i0.ɵɵdirectiveInject(i2.LoggerService)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: JobSearchResultPageComponent, selectors: [["app-job-search-result-page"]], outputs: { onCancel: "onCancel" }, decls: 10, vars: 9, consts: [["visible", "true", "modal", "true", "appendTo", "body", "position", "top", 3, "breakpoints"], ["pTemplate", "header"], [4, "ngIf"], ["styleClass", "p-datatable-striped p-datatable-worksearch ion-padding-top", 3, "value", "rowHover", 4, "ngIf"], ["pTemplate", "footer"], ["styleClass", "p-datatable-striped p-datatable-worksearch ion-padding-top", 3, "value", "rowHover"], ["pTemplate", "body"], ["colspan", "2"], [1, "ui-selectable-row"], ["fill", "outline", "shape", "round", "size", "small", "target", "blank", 1, "small-button", 2, "--border-color", "#4478AA", "--border-width", "2px", "--color", "#4478AA", 3, "href"], [1, "button-icon", 3, "icon"], [1, "ion-text-left"], [1, "ion-text-right"], ["shape", "round", "fill", "outline", "type", "reset", 3, "click"]], template: function JobSearchResultPageComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "p-dialog", 0);
            i0.ɵɵtemplate(1, JobSearchResultPageComponent_ng_template_1_Template, 4, 0, "ng-template", 1);
            i0.ɵɵelementStart(2, "ion-grid")(3, "ion-row")(4, "ion-col");
            i0.ɵɵtemplate(5, JobSearchResultPageComponent_h3_5_Template, 3, 3, "h3", 2)(6, JobSearchResultPageComponent_h3_6_Template, 3, 3, "h3", 2)(7, JobSearchResultPageComponent_p_7_Template, 13, 12, "p", 2)(8, JobSearchResultPageComponent_p_table_8_Template, 3, 2, "p-table", 3);
            i0.ɵɵelementEnd()()();
            i0.ɵɵtemplate(9, JobSearchResultPageComponent_ng_template_9_Template, 6, 0, "ng-template", 4);
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵstyleMap(i0.ɵɵpureFunction0(7, _c1));
            i0.ɵɵproperty("breakpoints", i0.ɵɵpureFunction0(8, _c2));
            i0.ɵɵadvance(5);
            i0.ɵɵproperty("ngIf", ctx.matchingJobs == null && ctx.areJobsFetched == false);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.matchingJobs != null);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.matchingJobs != null);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.matchingJobs != null);
        } }, dependencies: [i3.IonButton, i3.IonCol, i3.IonGrid, i3.IonRow, i4.NgIf, i5.PrimeTemplate, i6.Dialog, i7.Table, i8.FaIconComponent, i9.TranslatePipe], styles: ["ion-col[_ngcontent-%COMP%]{margin-left:0!important}.button-icon[_ngcontent-%COMP%]{font-size:18px;color:var(--ion-color-primary)}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(JobSearchResultPageComponent, [{
        type: Component,
        args: [{ selector: 'app-job-search-result-page', template: "<p-dialog visible=\"true\" modal=\"true\" appendTo=\"body\"\r\n    [breakpoints]=\"{'1024px': '75vw', '768px': '85vw', '640px': '100vw'}\" [style]=\"{width: '60vw'}\" position=\"top\">\r\n    <ng-template pTemplate=\"header\">\r\n        <ion-grid>\r\n            <ion-row>\r\n\r\n            </ion-row>\r\n            <ion-row>\r\n                <ion-col>\r\n\r\n                </ion-col>\r\n            </ion-row>\r\n        </ion-grid>\r\n    </ng-template>\r\n    <ion-grid>\r\n        <ion-row>\r\n            <ion-col>\r\n                <h3 *ngIf=\"matchingJobs == null && areJobsFetched== false\">{{'job.search.results.popup.messages.noJobs' | translate}}</h3>\r\n                <h3 *ngIf=\"matchingJobs != null\">{{'job.search.results.popup.messages.title' | translate}}</h3>\r\n                <p *ngIf=\"matchingJobs != null\">{{'job.search.results.popup.messages.search.criteria' | translate}}<b>{{jobResultsData?.zipCode}}</b>{{'job.search.results.popup.messages.radius' | translate}} <b>{{jobResultsData?.geographicalRange}} </b>{{'job.search.results.popup.messages.keywords' | translate}}<b>{{jobResultsData?.keyWord}}</b></p>\r\n                \r\n                <p-table [value]=\"matchingJobs\" [rowHover]=\"true\" *ngIf=\"matchingJobs != null\"\r\n                    styleClass=\"p-datatable-striped p-datatable-worksearch ion-padding-top\">\r\n                    <ng-template pTemplate=\"header\" let-columns>\r\n                        <tr>\r\n                            <th colspan=\"2\">{{'job.search.results.table.header.Posted' | translate}}</th>\r\n                            <th colspan=\"2\">{{'job.search.results.table.header.Position' | translate}}</th>\r\n                            <th colspan=\"2\">{{'job.search.results.table.header.Employer' | translate}}</th>\r\n                            <th colspan=\"2\">{{'job.search.results.table.header.ZipCode' | translate}}</th>\r\n                            <th colspan=\"2\">{{'job.search.results.table.header.View' | translate}}</th>\r\n                        </tr>\r\n                    </ng-template>\r\n                    \r\n                    <ng-template pTemplate=\"body\" let-matchingJobs  >\r\n                        <tr class=\"ui-selectable-row\">\r\n                            <td colspan=\"2\">\r\n                                {{matchingJobs.jobOrderCreateDate?matchingJobs.jobOrderCreateDate:'N/A' }}\r\n                            </td>\r\n                            <td colspan=\"2\">\r\n                                {{matchingJobs.jobTitle?matchingJobs.jobTitle:'N/A'}}\r\n                            </td>\r\n                            <td colspan=\"2\">\r\n                                {{matchingJobs.employerName?matchingJobs.employerName:'N/A'}}\r\n                            </td>\r\n                            <td colspan=\"2\">\r\n                                {{matchingJobs.zipCode?matchingJobs.zipCode:'N/A'}}\r\n                            </td>\r\n                            <td colspan=\"2\">\r\n                                <ion-button href=\"{{matchingJobs.jobOrderURL?matchingJobs.jobOrderURL:'N/A'}}\"  fill=\"outline\"  shape=\"round\" \r\n                                class=\"small-button\" size=\"small\" target=\"blank\"\r\n                                style=\"--border-color:#4478AA; --border-width:2px; --color:#4478AA;\">\r\n                                    \r\n                                    <fa-icon [icon]=\"['far', 'angle-right']\" class=\"button-icon\"></fa-icon>\r\n                                </ion-button>\r\n                            </td>\r\n                        </tr>\r\n                    </ng-template>\r\n                </p-table>\r\n            </ion-col>\r\n        </ion-row>\r\n    </ion-grid>\r\n\r\n\r\n\r\n    <ng-template pTemplate=\"footer\">\r\n        <ion-grid>\r\n            <ion-row>\r\n                <ion-col class=\"ion-text-left\">\r\n\r\n                </ion-col>\r\n                <ion-col class=\"ion-text-right\">\r\n                    <ion-button shape=\"round\" fill=\"outline\" type=\"reset\" (click)=\"cancel()\">Close</ion-button>\r\n                </ion-col>\r\n            </ion-row>\r\n        </ion-grid>\r\n    </ng-template>\r\n</p-dialog>", styles: ["ion-col{margin-left:0!important}.button-icon{font-size:18px;color:var(--ion-color-primary)}\n"] }]
    }], () => [{ type: i1.ClaimantService }, { type: i2.LoggerService }], { onCancel: [{
            type: Output
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(JobSearchResultPageComponent, { className: "JobSearchResultPageComponent", filePath: "lib\\components\\job-search-result-page\\job-search-result-page.component.ts", lineNumber: 12 }); })();
//# sourceMappingURL=data:application/json;base64, 