import { ChangeDetectionStrategy, Component, Inject, ViewEncapsulation } from '@angular/core';
import { MatSnackBarRef, MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar';
import * as i0 from "@angular/core";
import * as i1 from "@angular/material/snack-bar";
import * as i2 from "@angular/material/button";
import * as i3 from "@ngx-translate/core";
export class NgmConfirmSnackBar {
    constructor(snackBarRef, data) {
        this.snackBarRef = snackBarRef;
        this.data = data;
    }
    dismiss() {
        this.snackBarRef.dismiss();
    }
    /** Performs the action on the snack bar. */
    action() {
        this.snackBarRef.dismissWithAction();
    }
    /** If the action button should be shown. */
    get hasAction() {
        return !!this.data.action;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: NgmConfirmSnackBar, deps: [{ token: i1.MatSnackBarRef }, { token: MAT_SNACK_BAR_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.10", type: NgmConfirmSnackBar, selector: "ngm-confirm-snackbar", host: { classAttribute: "ngm-confirm-snackbar" }, ngImport: i0, template: `<span class="flex-1 flex">{{data.message}}</span>
    <div class="ngm-confirm-snackbar-action">
      <button mat-button (click)="dismiss()">
        {{ 'COMPONENTS.COMMON.CANCEL' | translate: {Default: 'Cancel'} }}
      </button>
    </div>
  @if(hasAction) {
    <div class="ngm-confirm-snackbar-action">
      <button mat-flat-button color="primary" (click)="action()">{{data.action}}</button>
    </div>
  }`, isInline: true, styles: [".ngm-confirm-snackbar{display:flex;justify-content:space-between;align-items:center;line-height:20px;opacity:1}.ngm-confirm-snackbar .ngm-confirm-snackbar-action{flex-shrink:0;margin:-8px -8px -8px 8px}.ngm-confirm-snackbar .ngm-confirm-snackbar-action button{max-height:36px;min-width:0}[dir=rtl] .ngm-confirm-snackbar .ngm-confirm-snackbar-action{margin-left:-8px;margin-right:8px}.ngm-confirm-snackbar .mat-mdc-button.mat-unthemed:not(:disabled){--mdc-text-button-label-text-color: #e5e7eb}.dark .ngm-confirm-snackbar .mat-mdc-button.mat-unthemed:not(:disabled){--mdc-text-button-label-text-color: #262626}\n"], dependencies: [{ kind: "component", type: i2.MatButton, selector: "    button[mat-button], button[mat-raised-button], button[mat-flat-button],    button[mat-stroked-button]  ", exportAs: ["matButton"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.10", ngImport: i0, type: NgmConfirmSnackBar, decorators: [{
            type: Component,
            args: [{ selector: 'ngm-confirm-snackbar', template: `<span class="flex-1 flex">{{data.message}}</span>
    <div class="ngm-confirm-snackbar-action">
      <button mat-button (click)="dismiss()">
        {{ 'COMPONENTS.COMMON.CANCEL' | translate: {Default: 'Cancel'} }}
      </button>
    </div>
  @if(hasAction) {
    <div class="ngm-confirm-snackbar-action">
      <button mat-flat-button color="primary" (click)="action()">{{data.action}}</button>
    </div>
  }`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
                        'class': 'ngm-confirm-snackbar',
                    }, styles: [".ngm-confirm-snackbar{display:flex;justify-content:space-between;align-items:center;line-height:20px;opacity:1}.ngm-confirm-snackbar .ngm-confirm-snackbar-action{flex-shrink:0;margin:-8px -8px -8px 8px}.ngm-confirm-snackbar .ngm-confirm-snackbar-action button{max-height:36px;min-width:0}[dir=rtl] .ngm-confirm-snackbar .ngm-confirm-snackbar-action{margin-left:-8px;margin-right:8px}.ngm-confirm-snackbar .mat-mdc-button.mat-unthemed:not(:disabled){--mdc-text-button-label-text-color: #e5e7eb}.dark .ngm-confirm-snackbar .mat-mdc-button.mat-unthemed:not(:disabled){--mdc-text-button-label-text-color: #262626}\n"] }]
        }], ctorParameters: () => [{ type: i1.MatSnackBarRef }, { type: undefined, decorators: [{
                    type: Inject,
                    args: [MAT_SNACK_BAR_DATA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