import { Component, HostBinding, inject } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { CountdownTimer } from '../../countdown';
import * as i0 from "@angular/core";
import * as i1 from "@angular/cdk/drag-drop";
import * as i2 from "@angular/material/dialog";
import * as i3 from "@angular/material/button";
import * as i4 from "../../countdown/countdown.component";
import * as i5 from "@metad/ocap-angular/core";
import * as i6 from "@ngx-translate/core";
export class NgmCountdownConfirmationComponent {
    constructor() {
        this.isDialogContainer = true;
        this.dialogRef = inject(MatDialogRef);
        this.data = inject(MAT_DIALOG_DATA);
        this.countDownConfig = { leftTime: 10 };
        if (this.data) {
            this.recordType = this.data.recordType;
            this.isEnabled = this.data.isEnabled;
        }
    }
    handleActionEvent(e) {
        if (e.action === 'done') {
            this.dialogRef.close('continue');
        }
    }
    close() {
        this.dialogRef.close();
    }
    continue() {
        this.dialogRef.close('continue');
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: NgmCountdownConfirmationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.10", type: NgmCountdownConfirmationComponent, selector: "ngm-countdown-confirmation", host: { properties: { "class.ngm-dialog-container": "this.isDialogContainer" } }, providers: [CountdownTimer], ngImport: i0, template: "<header mat-dialog-title cdkDrag cdkDragRootElement=\".cdk-overlay-pane\" cdkDragHandle>\n  <h4 style=\"pointer-events: none;\">\n    {{ 'COMPONENTS.COUNTDOWN_CONFIRMATION.CONFIRM' | translate: {Default: 'Confirm'} }}\n  </h4>\n</header>\n\n<mat-dialog-content class=\"mat-typography\">\n  <span>\n    <b>{{ recordType }}</b>\n    {{ 'COMPONENTS.COUNTDOWN_CONFIRMATION.WAS' | translate: {Default: 'Waiting seconds'} }}\n    {{ countDownConfig.leftTime }}\n    {{\n      (isEnabled ? ('COMPONENTS.COUNTDOWN_CONFIRMATION.ENABLED' | translate: {Default: 'Enabled'}) : ('COMPONENTS.COUNTDOWN_CONFIRMATION.DISABLED' | translate: {Default: 'Disabled'})) +\n        '?'\n    }}\n  </span>\n  <div class=\"mt-2\">\n    {{ 'COMPONENTS.COUNTDOWN_CONFIRMATION.WAIT_UNTIL_RELOAD' | translate: {Default: 'Waiting until reload'} }}\n    <ngm-countdown #cd [config]=\"countDownConfig\" (event)=\"handleActionEvent($event)\" />\n  </div>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n  <div ngmButtonGroup>\n    <button mat-button color=\"accent\" mat-dialog-close>{{ 'COMPONENTS.COMMON.CANCEL' | translate: {Default: 'Cancel'} }}</button>\n    <button mat-raised-button color=\"accent\" (click)=\"continue()\">{{ 'COMPONENTS.COMMON.APPLY' | translate: {Default: 'Apply'} }}</button>\n  </div>\n</mat-dialog-actions>\n", styles: [".center{align-items:center;width:350px}\n"], dependencies: [{ kind: "directive", type: i1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i1.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { 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.NgmCountdownComponent, selector: "ngm-countdown", inputs: ["config", "render"], outputs: ["event"] }, { kind: "directive", type: i5.ButtonGroupDirective, selector: "[ngmButtonGroup]" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: NgmCountdownConfirmationComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ngm-countdown-confirmation', providers: [CountdownTimer], template: "<header mat-dialog-title cdkDrag cdkDragRootElement=\".cdk-overlay-pane\" cdkDragHandle>\n  <h4 style=\"pointer-events: none;\">\n    {{ 'COMPONENTS.COUNTDOWN_CONFIRMATION.CONFIRM' | translate: {Default: 'Confirm'} }}\n  </h4>\n</header>\n\n<mat-dialog-content class=\"mat-typography\">\n  <span>\n    <b>{{ recordType }}</b>\n    {{ 'COMPONENTS.COUNTDOWN_CONFIRMATION.WAS' | translate: {Default: 'Waiting seconds'} }}\n    {{ countDownConfig.leftTime }}\n    {{\n      (isEnabled ? ('COMPONENTS.COUNTDOWN_CONFIRMATION.ENABLED' | translate: {Default: 'Enabled'}) : ('COMPONENTS.COUNTDOWN_CONFIRMATION.DISABLED' | translate: {Default: 'Disabled'})) +\n        '?'\n    }}\n  </span>\n  <div class=\"mt-2\">\n    {{ 'COMPONENTS.COUNTDOWN_CONFIRMATION.WAIT_UNTIL_RELOAD' | translate: {Default: 'Waiting until reload'} }}\n    <ngm-countdown #cd [config]=\"countDownConfig\" (event)=\"handleActionEvent($event)\" />\n  </div>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n  <div ngmButtonGroup>\n    <button mat-button color=\"accent\" mat-dialog-close>{{ 'COMPONENTS.COMMON.CANCEL' | translate: {Default: 'Cancel'} }}</button>\n    <button mat-raised-button color=\"accent\" (click)=\"continue()\">{{ 'COMPONENTS.COMMON.APPLY' | translate: {Default: 'Apply'} }}</button>\n  </div>\n</mat-dialog-actions>\n", styles: [".center{align-items:center;width:350px}\n"] }]
        }], ctorParameters: () => [], propDecorators: { isDialogContainer: [{
                type: HostBinding,
                args: ['class.ngm-dialog-container']
            }] } });
//# sourceMappingURL=data:application/json;base64, 