import { Component, Input } from '@angular/core';
import { CaseFlagStatus } from '../../enums';
import * as i0 from "@angular/core";
function CaseFlagTableComponent_table_0_caption_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "caption", 13);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r0.tableCaption);
} }
function CaseFlagTableComponent_table_0_tr_19_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "tr")(1, "td", 14);
    i0.ɵɵtext(2);
    i0.ɵɵpipe(3, "rpxTranslate");
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 1, "None"));
} }
function CaseFlagTableComponent_table_0_tbody_20_tr_1_div_15_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div")(1, "span", 23);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const flagDetail_r2 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1("Update Reason: ", flagDetail_r2.flagUpdateComment, "");
} }
function CaseFlagTableComponent_table_0_tbody_20_tr_1_strong_23_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "strong", 24);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "rpxTranslate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "Active"));
} }
function CaseFlagTableComponent_table_0_tbody_20_tr_1_strong_24_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "strong", 25);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "rpxTranslate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "Inactive"));
} }
function CaseFlagTableComponent_table_0_tbody_20_tr_1_strong_25_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "strong", 26);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "rpxTranslate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "Requested"));
} }
function CaseFlagTableComponent_table_0_tbody_20_tr_1_strong_26_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "strong", 27);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "rpxTranslate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "Not approved"));
} }
function CaseFlagTableComponent_table_0_tbody_20_tr_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "tr", 16)(1, "td", 17)(2, "div");
    i0.ɵɵtext(3);
    i0.ɵɵpipe(4, "flagFieldDisplay");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "div");
    i0.ɵɵtext(6);
    i0.ɵɵpipe(7, "flagFieldDisplay");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(8, "div");
    i0.ɵɵtext(9);
    i0.ɵɵpipe(10, "flagFieldDisplay");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementStart(11, "td", 17)(12, "div");
    i0.ɵɵtext(13);
    i0.ɵɵpipe(14, "flagFieldDisplay");
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(15, CaseFlagTableComponent_table_0_tbody_20_tr_1_div_15_Template, 3, 1, "div", 11);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(16, "td", 17);
    i0.ɵɵtext(17);
    i0.ɵɵpipe(18, "date");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(19, "td", 17);
    i0.ɵɵtext(20);
    i0.ɵɵpipe(21, "date");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(22, "td", 18);
    i0.ɵɵtemplate(23, CaseFlagTableComponent_table_0_tbody_20_tr_1_strong_23_Template, 3, 3, "strong", 19)(24, CaseFlagTableComponent_table_0_tbody_20_tr_1_strong_24_Template, 3, 3, "strong", 20)(25, CaseFlagTableComponent_table_0_tbody_20_tr_1_strong_25_Template, 3, 3, "strong", 21)(26, CaseFlagTableComponent_table_0_tbody_20_tr_1_strong_26_Template, 3, 3, "strong", 22);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const flagDetail_r2 = ctx.$implicit;
    const ctx_r0 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(4, 11, flagDetail_r2, "name"));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(7, 14, flagDetail_r2, "otherDescription"));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(10, 17, flagDetail_r2, "subTypeValue"));
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(14, 20, flagDetail_r2, "flagComment"));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", !ctx_r0.caseFlagsExternalUser && (flagDetail_r2.status === ctx_r0.caseFlagStatus.NOT_APPROVED || flagDetail_r2.status === ctx_r0.caseFlagStatus.INACTIVE) && flagDetail_r2.flagUpdateComment);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(18, 23, flagDetail_r2.dateTimeCreated, "dd LLL yyyy"));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(21, 26, flagDetail_r2.dateTimeModified, "dd LLL yyyy"));
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("ngIf", flagDetail_r2.status === ctx_r0.caseFlagStatus.ACTIVE);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", flagDetail_r2.status === ctx_r0.caseFlagStatus.INACTIVE);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", flagDetail_r2.status === ctx_r0.caseFlagStatus.REQUESTED);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", flagDetail_r2.status === ctx_r0.caseFlagStatus.NOT_APPROVED);
} }
function CaseFlagTableComponent_table_0_tbody_20_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "tbody", 10);
    i0.ɵɵtemplate(1, CaseFlagTableComponent_table_0_tbody_20_tr_1_Template, 27, 29, "tr", 15);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngForOf", ctx_r0.flagData.flags.details);
} }
function CaseFlagTableComponent_table_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "table", 1);
    i0.ɵɵtemplate(1, CaseFlagTableComponent_table_0_caption_1_Template, 2, 1, "caption", 2);
    i0.ɵɵelementStart(2, "thead", 3)(3, "tr", 4)(4, "th", 5);
    i0.ɵɵtext(5);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "th", 6);
    i0.ɵɵtext(7);
    i0.ɵɵpipe(8, "rpxTranslate");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(9, "th", 7);
    i0.ɵɵtext(10);
    i0.ɵɵpipe(11, "rpxTranslate");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(12, "th", 8);
    i0.ɵɵtext(13);
    i0.ɵɵpipe(14, "rpxTranslate");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(15, "th", 9);
    i0.ɵɵtext(16);
    i0.ɵɵpipe(17, "rpxTranslate");
    i0.ɵɵelementEnd()()();
    i0.ɵɵelementStart(18, "tbody", 10);
    i0.ɵɵtemplate(19, CaseFlagTableComponent_table_0_tr_19_Template, 4, 3, "tr", 11);
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(20, CaseFlagTableComponent_table_0_tbody_20_Template, 2, 1, "tbody", 12);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r0.tableCaption);
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate(ctx_r0.firstColumnHeader);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(8, 8, "Comments"));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(11, 10, "Creation date"));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(14, 12, "Last modified"));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(17, 14, "Flag status"));
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("ngIf", !ctx_r0.flagData.flags.details || ctx_r0.flagData.flags.details && ctx_r0.flagData.flags.details.length === 0);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r0.flagData.flags.details && ctx_r0.flagData.flags.details.length > 0);
} }
export class CaseFlagTableComponent {
    tableCaption;
    flagData;
    firstColumnHeader;
    caseFlagsExternalUser = false;
    get caseFlagStatus() {
        return CaseFlagStatus;
    }
    static ɵfac = function CaseFlagTableComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseFlagTableComponent)(); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseFlagTableComponent, selectors: [["ccd-case-flag-table"]], inputs: { tableCaption: "tableCaption", flagData: "flagData", firstColumnHeader: "firstColumnHeader", caseFlagsExternalUser: "caseFlagsExternalUser" }, decls: 1, vars: 1, consts: [["class", "govuk-table", 4, "ngIf"], [1, "govuk-table"], ["class", "govuk-table__caption govuk-table__caption--l", 4, "ngIf"], [1, "govuk-table__head"], [1, "govuk-table__row"], ["scope", "col", 1, "govuk-table__header", "col-party-name"], ["scope", "col", 1, "govuk-table__header", "col-comments"], ["scope", "col", 1, "govuk-table__header", "col-creation-date"], ["scope", "col", 1, "govuk-table__header", "col-last-modified"], ["scope", "col", 1, "govuk-table__header", "col-flag-status"], [1, "govuk-table__body"], [4, "ngIf"], ["class", "govuk-table__body", 4, "ngIf"], [1, "govuk-table__caption", "govuk-table__caption--l"], ["colspan", "5"], ["scope", "row", "class", "govuk-table__row", 4, "ngFor", "ngForOf"], ["scope", "row", 1, "govuk-table__row"], [1, "govuk-table__cell"], [1, "govuk-table__cell", "cell-flag-status"], ["class", "govuk-tag govuk-tag--turquoise", 4, "ngIf"], ["class", "govuk-tag govuk-tag--grey", 4, "ngIf"], ["class", "govuk-tag govuk-tag--yellow", 4, "ngIf"], ["class", "govuk-tag govuk-tag--red", 4, "ngIf"], [1, "govuk-!-font-weight-bold"], [1, "govuk-tag", "govuk-tag--turquoise"], [1, "govuk-tag", "govuk-tag--grey"], [1, "govuk-tag", "govuk-tag--yellow"], [1, "govuk-tag", "govuk-tag--red"]], template: function CaseFlagTableComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵtemplate(0, CaseFlagTableComponent_table_0_Template, 21, 16, "table", 0);
        } if (rf & 2) {
            i0.ɵɵproperty("ngIf", ctx.flagData);
        } }, styles: [".govuk-table[_ngcontent-%COMP%]   .govuk-table__caption[_ngcontent-%COMP%]{margin-top:10px}.govuk-table[_ngcontent-%COMP%]   .govuk-table__head[_ngcontent-%COMP%]   .govuk-table__row[_ngcontent-%COMP%]   .col-party-name[_ngcontent-%COMP%]{width:24%}.govuk-table[_ngcontent-%COMP%]   .govuk-table__head[_ngcontent-%COMP%]   .govuk-table__row[_ngcontent-%COMP%]   .col-comments[_ngcontent-%COMP%]{width:42%}.govuk-table[_ngcontent-%COMP%]   .govuk-table__head[_ngcontent-%COMP%]   .govuk-table__row[_ngcontent-%COMP%]   .col-creation-date[_ngcontent-%COMP%], .govuk-table[_ngcontent-%COMP%]   .govuk-table__head[_ngcontent-%COMP%]   .govuk-table__row[_ngcontent-%COMP%]   .col-last-modified[_ngcontent-%COMP%]{width:12%}.govuk-table[_ngcontent-%COMP%]   .govuk-table__head[_ngcontent-%COMP%]   .govuk-table__row[_ngcontent-%COMP%]   .col-flag-status[_ngcontent-%COMP%]{width:10%}.govuk-table[_ngcontent-%COMP%]   .govuk-table__body[_ngcontent-%COMP%]   .govuk-table__row[_ngcontent-%COMP%]   .cell-flag-status[_ngcontent-%COMP%]{white-space:nowrap}"] });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseFlagTableComponent, [{
        type: Component,
        args: [{ selector: 'ccd-case-flag-table', template: "<table class=\"govuk-table\" *ngIf=\"flagData\">\n  <caption class=\"govuk-table__caption govuk-table__caption--l\" *ngIf=\"tableCaption\">{{tableCaption}}</caption>\n  <thead class=\"govuk-table__head\">\n    <tr class=\"govuk-table__row\">\n      <th scope=\"col\" class=\"govuk-table__header col-party-name\">{{firstColumnHeader}}</th>\n      <th scope=\"col\" class=\"govuk-table__header col-comments\">{{'Comments' | rpxTranslate}}</th>\n      <th scope=\"col\" class=\"govuk-table__header col-creation-date\">{{'Creation date' | rpxTranslate}}</th>\n      <th scope=\"col\" class=\"govuk-table__header col-last-modified\">{{'Last modified' | rpxTranslate}}</th>\n      <th scope=\"col\" class=\"govuk-table__header col-flag-status\">{{'Flag status' | rpxTranslate}}</th>\n    </tr>\n  </thead>\n  <tbody class=\"govuk-table__body\">\n    <tr *ngIf=\"!flagData.flags.details || (flagData.flags.details && flagData.flags.details.length === 0)\">\n      <td colspan=\"5\">{{'None' | rpxTranslate}}</td>\n    </tr>\n  </tbody>\n  <tbody class=\"govuk-table__body\" *ngIf=\"flagData.flags.details && flagData.flags.details.length > 0\">\n    <tr scope=\"row\" class=\"govuk-table__row\" *ngFor=\"let flagDetail of flagData.flags.details\">\n      <td class=\"govuk-table__cell\">\n        <div>{{flagDetail | flagFieldDisplay:'name'}}</div>\n        <div>{{flagDetail | flagFieldDisplay:'otherDescription'}}</div>\n        <div>{{flagDetail | flagFieldDisplay:'subTypeValue'}}</div>\n      </td>\n      <td class=\"govuk-table__cell\">\n        <div>{{flagDetail | flagFieldDisplay:'flagComment'}}</div>\n        <div *ngIf=\"!caseFlagsExternalUser &&\n          (flagDetail.status === caseFlagStatus.NOT_APPROVED || flagDetail.status === caseFlagStatus.INACTIVE) &&\n          flagDetail.flagUpdateComment\">\n          <span class=\"govuk-!-font-weight-bold\">Update Reason: {{flagDetail.flagUpdateComment}}</span>\n        </div>\n      </td>\n      <td class=\"govuk-table__cell\">{{flagDetail.dateTimeCreated | date: 'dd LLL yyyy'}}</td>\n      <td class=\"govuk-table__cell\">{{flagDetail.dateTimeModified | date: 'dd LLL yyyy'}}</td>\n      <td class=\"govuk-table__cell cell-flag-status\">\n        <strong *ngIf=\"flagDetail.status === caseFlagStatus.ACTIVE\" class=\"govuk-tag govuk-tag--turquoise\">{{'Active' | rpxTranslate}}</strong>\n        <strong *ngIf=\"flagDetail.status === caseFlagStatus.INACTIVE\" class=\"govuk-tag govuk-tag--grey\">{{'Inactive' | rpxTranslate}}</strong>\n        <strong *ngIf=\"flagDetail.status === caseFlagStatus.REQUESTED\" class=\"govuk-tag govuk-tag--yellow\">{{'Requested' | rpxTranslate}}</strong>\n        <strong *ngIf=\"flagDetail.status === caseFlagStatus.NOT_APPROVED\" class=\"govuk-tag govuk-tag--red\">{{'Not approved' | rpxTranslate}}</strong>\n      </td>\n    </tr>\n  </tbody>\n</table>\n", styles: [".govuk-table .govuk-table__caption{margin-top:10px}.govuk-table .govuk-table__head .govuk-table__row .col-party-name{width:24%}.govuk-table .govuk-table__head .govuk-table__row .col-comments{width:42%}.govuk-table .govuk-table__head .govuk-table__row .col-creation-date,.govuk-table .govuk-table__head .govuk-table__row .col-last-modified{width:12%}.govuk-table .govuk-table__head .govuk-table__row .col-flag-status{width:10%}.govuk-table .govuk-table__body .govuk-table__row .cell-flag-status{white-space:nowrap}\n"] }]
    }], null, { tableCaption: [{
            type: Input
        }], flagData: [{
            type: Input
        }], firstColumnHeader: [{
            type: Input
        }], caseFlagsExternalUser: [{
            type: Input
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseFlagTableComponent, { className: "CaseFlagTableComponent", filePath: "lib/shared/components/palette/case-flag/components/case-flag-table/case-flag-table.component.ts", lineNumber: 10 }); })();
//# sourceMappingURL=data:application/json;base64, 