import { Component, ViewEncapsulation, Inject } from '@angular/core';
import { MAT_DIALOG_DATA } from "@angular/material/dialog";
import * as i0 from "@angular/core";
import * as i1 from "@angular/material/dialog";
import * as i2 from "@angular/common";
import * as i3 from "@angular/material/button";
import * as i4 from "@angular/material/toolbar";
export class MessageBoxDialogComponent {
    ngOnInit() {
    }
    constructor(dialogRef, data) {
        this.dialogRef = dialogRef;
        this.data = data;
        this.style = data.style || 0;
        this.caption = data.caption;
        this.message = data.message;
        this.title = data.title;
        this.isError = data.isError;
        this.isWarning = data.isWarning;
        this.button = data.button;
        this.dialogRef.disableClose = !data.allow_outside_click || false;
    }
    onOk() {
        this.dialogRef.close({ result: 1 });
    }
    onCancel() {
        this.dialogRef.close({ result: 2 });
    }
    onYes() {
        this.dialogRef.close({ result: 5 });
    }
    onNo() {
        this.dialogRef.close({ result: 6 });
    }
    onAccept() {
        this.dialogRef.close({ result: 3 });
    }
    onReject() {
        this.dialogRef.close({ result: 4 });
    }
    get ToolbarClass() {
        var classList = '';
        if (this.isError) {
            classList = 'mat-elevation-z2 caption_error';
        }
        else if (this.isWarning) {
            classList = 'mat-elevation-z2 caption_warning';
        }
        else {
            classList = 'mat-elevation-z2 caption';
        }
        return classList;
    }
    get ButtonClass_Primary() {
        var classList = '';
        if (this.isError) {
            classList = 'dialog-button dialog-button-accent';
        }
        else if (this.isWarning) {
            classList = 'dialog-button dialog-button-accent';
        }
        else {
            classList = 'dialog-button dialog-button-primary';
        }
        return classList;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MessageBoxDialogComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: MessageBoxDialogComponent, selector: "mobicloud-message-box-dialog", ngImport: i0, template: "<div mat-dialog-container class=\"simple-dialog-container\">\n    <mat-toolbar *ngIf=\"style==1\" [ngClass]=\"ToolbarClass\">\n      {{caption}}\n    </mat-toolbar>\n    <div class=\"title\" *ngIf=\"title!==''\">\n      <p>\n        {{title}}\n      </p>\n    </div>\n    <div class=\"message\" *ngIf=\"message!==''\">\n      <p>{{message}}</p>\n    </div>\n    <div class=\"dialog-button-container\">\n      <div *ngIf=\"button==0\">\n        <button mat-flat-button (click)=\"onOk()\" tabindex=\"-1\" [ngClass]=\"ButtonClass_Primary\" i18n=\"@@Button-Ok\">Ok</button>\n      </div>\n      <div *ngIf=\"button==1\">\n        <button mat-flat-button (click)=\"onOk()\" tabindex=\"-1\" [ngClass]=\"ButtonClass_Primary\" i18n=\"@@Button-Ok\">Ok</button>\n        <button mat-flat-button (click)=\"onCancel()\" tabindex=\"-1\" class=\"dialog-button dialog-button-accent\" i18n=\"@@Button-Cancel\">Cancel</button>\n      </div>\n      <div *ngIf=\"button==2\">\n        <button mat-flat-button (click)=\"onYes()\" tabindex=\"-1\" [ngClass]=\"ButtonClass_Primary\" i18n=\"@@Button-Yes\">Yes</button>\n        <button mat-flat-button (click)=\"onNo()\" tabindex=\"-1\" class=\"dialog-button dialog-button-accent\" i18n=\"@@Button-No\">No</button>\n      </div>\n      <div *ngIf=\"button==3\">\n        <button mat-flat-button (click)=\"onAccept()\" tabindex=\"-1\" [ngClass]=\"ButtonClass_Primary\" i18n=\"@@Button-Accept\">Accept</button>\n        <button mat-flat-button (click)=\"onReject()\" tabindex=\"-1\" class=\"dialog-button dialog-button-accent\" i18n=\"@@Button-Reject\">Reject</button>\n      </div>\n      <div *ngIf=\"button==4\">\n        <button mat-flat-button (click)=\"onYes()\" tabindex=\"-1\" [ngClass]=\"ButtonClass_Primary\" i18n=\"@@Button-Yes\">Yes</button>\n        <button mat-flat-button (click)=\"onNo()\" tabindex=\"-1\" class=\"dialog-button dialog-button-accent\" i18n=\"@@Button-No\">No</button>\n        <button mat-flat-button (click)=\"onCancel()\" tabindex=\"-1\" class=\"dialog-button dialog-button-accent\" i18n=\"@@Button-Cancel\">Cancel</button>\n      </div>      \n    </div>\n  </div>", styles: [".mat-dialog-container{padding:0!important}.caption{margin:0!important;height:30px;font-size:medium;background-color:var(--default-basecolor-dark);color:var(--default-basecolor-background-light)}.caption_error{margin:0!important;background-color:var(--default-buttoncolor-error)!important;color:var(--default-buttoncolor-text-error);height:30px;font-size:medium}.caption_warning{margin:0!important;background-color:var(--default-buttoncolor-warn)!important;color:var(--default-buttoncolor-text-warn)!important;height:30px;font-size:medium}div.title{font-weight:700;padding-left:25px;padding-right:25px;padding-bottom:0}div.message{padding:0 25px;font-size:12pt}.dialog-button-container{padding:10px;float:right}.dialog-button{margin-left:5px}.dialog-button-primary{background-color:var(--default-buttoncolor-primary);color:var(--default-buttoncolor-text-primary)}.dialog-button-accent,.dialog-button-warn,.dialog-button-error{background-color:var(--default-buttoncolor-accent);color:var(--default-buttoncolor-text-accent)}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: "    button[mat-button], button[mat-raised-button], button[mat-flat-button],    button[mat-stroked-button]  ", exportAs: ["matButton"] }, { kind: "component", type: i4.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }], encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MessageBoxDialogComponent, decorators: [{
            type: Component,
            args: [{ selector: 'mobicloud-message-box-dialog', encapsulation: ViewEncapsulation.None, template: "<div mat-dialog-container class=\"simple-dialog-container\">\n    <mat-toolbar *ngIf=\"style==1\" [ngClass]=\"ToolbarClass\">\n      {{caption}}\n    </mat-toolbar>\n    <div class=\"title\" *ngIf=\"title!==''\">\n      <p>\n        {{title}}\n      </p>\n    </div>\n    <div class=\"message\" *ngIf=\"message!==''\">\n      <p>{{message}}</p>\n    </div>\n    <div class=\"dialog-button-container\">\n      <div *ngIf=\"button==0\">\n        <button mat-flat-button (click)=\"onOk()\" tabindex=\"-1\" [ngClass]=\"ButtonClass_Primary\" i18n=\"@@Button-Ok\">Ok</button>\n      </div>\n      <div *ngIf=\"button==1\">\n        <button mat-flat-button (click)=\"onOk()\" tabindex=\"-1\" [ngClass]=\"ButtonClass_Primary\" i18n=\"@@Button-Ok\">Ok</button>\n        <button mat-flat-button (click)=\"onCancel()\" tabindex=\"-1\" class=\"dialog-button dialog-button-accent\" i18n=\"@@Button-Cancel\">Cancel</button>\n      </div>\n      <div *ngIf=\"button==2\">\n        <button mat-flat-button (click)=\"onYes()\" tabindex=\"-1\" [ngClass]=\"ButtonClass_Primary\" i18n=\"@@Button-Yes\">Yes</button>\n        <button mat-flat-button (click)=\"onNo()\" tabindex=\"-1\" class=\"dialog-button dialog-button-accent\" i18n=\"@@Button-No\">No</button>\n      </div>\n      <div *ngIf=\"button==3\">\n        <button mat-flat-button (click)=\"onAccept()\" tabindex=\"-1\" [ngClass]=\"ButtonClass_Primary\" i18n=\"@@Button-Accept\">Accept</button>\n        <button mat-flat-button (click)=\"onReject()\" tabindex=\"-1\" class=\"dialog-button dialog-button-accent\" i18n=\"@@Button-Reject\">Reject</button>\n      </div>\n      <div *ngIf=\"button==4\">\n        <button mat-flat-button (click)=\"onYes()\" tabindex=\"-1\" [ngClass]=\"ButtonClass_Primary\" i18n=\"@@Button-Yes\">Yes</button>\n        <button mat-flat-button (click)=\"onNo()\" tabindex=\"-1\" class=\"dialog-button dialog-button-accent\" i18n=\"@@Button-No\">No</button>\n        <button mat-flat-button (click)=\"onCancel()\" tabindex=\"-1\" class=\"dialog-button dialog-button-accent\" i18n=\"@@Button-Cancel\">Cancel</button>\n      </div>      \n    </div>\n  </div>", styles: [".mat-dialog-container{padding:0!important}.caption{margin:0!important;height:30px;font-size:medium;background-color:var(--default-basecolor-dark);color:var(--default-basecolor-background-light)}.caption_error{margin:0!important;background-color:var(--default-buttoncolor-error)!important;color:var(--default-buttoncolor-text-error);height:30px;font-size:medium}.caption_warning{margin:0!important;background-color:var(--default-buttoncolor-warn)!important;color:var(--default-buttoncolor-text-warn)!important;height:30px;font-size:medium}div.title{font-weight:700;padding-left:25px;padding-right:25px;padding-bottom:0}div.message{padding:0 25px;font-size:12pt}.dialog-button-container{padding:10px;float:right}.dialog-button{margin-left:5px}.dialog-button-primary{background-color:var(--default-buttoncolor-primary);color:var(--default-buttoncolor-text-primary)}.dialog-button-accent,.dialog-button-warn,.dialog-button-error{background-color:var(--default-buttoncolor-accent);color:var(--default-buttoncolor-text-accent)}\n"] }]
        }], ctorParameters: () => [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
                    type: Inject,
                    args: [MAT_DIALOG_DATA]
                }] }] });
//# sourceMappingURL=data:application/json;base64, 