import { Component, Inject } from "@angular/core";
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
import { TranslateLibraryService } from "../../../../services/translation-registry.service";
import { Color } from "../../common/color.enum";
import { RiskResult } from "../../model/risk-result.model";
export class RiskResultComponent {
    constructor(translate, dialogRef, data) {
        this.translate = translate;
        this.dialogRef = dialogRef;
        this.data = data;
        this.results = [];
        this.color = Color;
        this.isSimple = 0;
        this.title = data.title;
        this.results = data.results;
        this.isSimple = data.isSimple || 0;
    }
    ngOnInit() {
        this.translate.getLanguageSubject$.pipe().subscribe((res) => {
            if (res) {
                this.LANG = this.translate.getObjectLang(res);
            }
        });
    }
    onCloseClick() {
        this.dialogRef.close();
    }
}
RiskResultComponent.decorators = [
    { type: Component, args: [{
                selector: 'qms-risk-result',
                template: "<div class=\"dialog-container\">\r\n  <div mat-dialog-title class=\"dialog-title\">\r\n    <h3 class=\"title\">{{ title }}</h3>\r\n    <button\r\n      qms-btn-icon\r\n      color=\"light\"\r\n      qms-tool-tip=\"Caption\"\r\n      mode=\"dark\"\r\n      (click)=\"onCloseClick()\"\r\n    >\r\n      <mat-icon>close</mat-icon>\r\n    </button>\r\n  </div>\r\n\r\n  <mat-dialog-content>\r\n    <div class=\"flex-container-header\">\r\n      <div class=\"first\">{{ isSimple ? LANG.EVENT : LANG.CAUSE }}</div>\r\n      <div class=\"second\">{{ LANG.AREA_OF_IMPACT }}</div>\r\n      <div class=\"third\">{{ LANG.RESULT }}</div>\r\n    </div>\r\n    <div class=\"flex-container\" *ngFor=\"let item of results\">\r\n      <!-- g y r 1 2 3   done -->\r\n      <div class=\"first\" [ngSwitch]=\"item.color\">\r\n        <label *ngSwitchCase=\"3\" class=\"label-red\"></label>\r\n        <label *ngSwitchCase=\"1\" class=\"label-green\"></label>\r\n        <label *ngSwitchCase=\"2\" class=\"label-yellow\"></label>\r\n        {{ item.cause }}\r\n      </div>\r\n      <div class=\"second\">{{ item.consequenceArea }}</div>\r\n      <ng-container [ngSwitch]=\"item.color\">\r\n        <div class=\"third text-red\" *ngSwitchCase=\"3\">\r\n          <span class=\"material-icons-outlined\">report_problem</span>\r\n          {{ LANG.NOT_ACCEPTED }}\r\n        </div>\r\n        <div class=\"third text-yellow\" *ngSwitchCase=\"2\">\r\n          <mat-icon>error_outline</mat-icon>\r\n          {{ LANG.MUST_BE_EVALUATED }}\r\n        </div>\r\n        <div class=\"third text-green\" *ngSwitchCase=\"1\">\r\n          <mat-icon>done</mat-icon>\r\n          {{ LANG.ACCEPTED }}\r\n        </div>\r\n      </ng-container>\r\n    </div>\r\n  </mat-dialog-content>\r\n</div>\r\n",
                styles: [".dialog-title{display:flex;justify-content:space-between}.dialog-title h3.title{font-family:Raleway;font-style:normal;font-weight:500;font-size:22px;line-height:26px}.flex-container-header{display:flex;align-items:center;font-size:.75rem;border-radius:4px;line-height:16px}.flex-container-header>div{font-family:Open Sans;font-style:normal;font-weight:600;text-align:left;padding:10px 25px;color:rgba(0,0,0,.6)}.flex-container-header .first{flex:0 1 40%}.flex-container-header .second,.flex-container-header .third{flex:0 1 30%}.flex-container{display:flex;align-items:center;font-size:.875rem;line-height:22px;border-radius:4px;border:1px solid #ddd;min-height:48px;margin-bottom:10px}.flex-container>div{font-family:Open Sans;font-style:normal;text-align:left;padding:10px 25px;color:#323232}.flex-container .first{display:flex;flex:0 1 40%;align-items:center;font-weight:600}.flex-container .second{flex:0 1 30%;font-weight:400}.flex-container .third{display:flex;flex:0 1 30%;align-items:center;font-weight:600;font-size:.75rem}.flex-container .third.text-green,.flex-container .third.text-red,.flex-container .third.text-yellow{font-size:.75rem}.flex-container .third.text-green .mat-icon,.flex-container .third.text-green .material-icons-outlined,.flex-container .third.text-red .mat-icon,.flex-container .third.text-red .material-icons-outlined,.flex-container .third.text-yellow .mat-icon,.flex-container .third.text-yellow .material-icons-outlined{margin-right:1rem}.flex-container .third.text-red{color:#b00020}.flex-container .third.text-yellow{color:#726729}.flex-container .third.text-green{color:#005935}.label-green,.label-red,.label-yellow{font-family:Open Sans;font-style:normal;font-weight:600;display:flex;text-align:center;margin-right:1rem;width:24px;height:24px;flex:0 0 24px;border-radius:1px}.label-red{background-color:#9e360f;color:#fff}.label-yellow{background-color:#e4cf53;color:rgba(0,0,0,.87)}.label-green{background-color:#00804c;color:#fff}"]
            },] }
];
RiskResultComponent.ctorParameters = () => [
    { type: TranslateLibraryService },
    { type: MatDialogRef },
    { type: RiskResult, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzdWx0LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3Ftcy1hbmd1bGFyL3NyYy9saWIvY29tcG9uZW50cy9yZWxhdGVkL3Jpc2svcmVzdWx0L3Jlc3VsdC5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLEVBQVUsTUFBTSxlQUFlLENBQUM7QUFDMUQsT0FBTyxFQUFFLFlBQVksRUFBRSxlQUFlLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUN6RSxPQUFPLEVBQUUsdUJBQXVCLEVBQUUsTUFBTSxtREFBbUQsQ0FBQztBQUM1RixPQUFPLEVBQUUsS0FBSyxFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDaEQsT0FBTyxFQUFVLFVBQVUsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBT25FLE1BQU0sT0FBTyxtQkFBbUI7SUFPOUIsWUFDUyxTQUFrQyxFQUNsQyxTQUE0QyxFQUNuQixJQUFnQjtRQUZ6QyxjQUFTLEdBQVQsU0FBUyxDQUF5QjtRQUNsQyxjQUFTLEdBQVQsU0FBUyxDQUFtQztRQUNuQixTQUFJLEdBQUosSUFBSSxDQUFZO1FBUGxEL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