import { ChangeDetectionStrategy, Component, ElementRef, Input } from '@angular/core';
import { ModalSize, OverlayService } from '@aztrix/components/overlay';
import { ImagePreviewComponent } from './image-preview/image-preview.component';
import * as i0 from "@angular/core";
import * as i1 from "@aztrix/components/overlay";
import * as i2 from "@aztrix/components/button";
import * as i3 from "@aztrix/components/image-source";
import * as i4 from "@aztrix/icons";
import * as i5 from "@angular/common";
export class ImagePreviewButtonComponent {
    constructor(_overlay, _elementRef) {
        this._overlay = _overlay;
        this._elementRef = _elementRef;
    }
    preview() {
        this._overlay.createModal(ImagePreviewComponent, {
            title: 'label.preview',
            modalSize: ModalSize.SMALL,
            init: (modal) => {
                modal.source = this.source;
                modal.name = this.name;
            },
        }, this._elementRef);
    }
}
ImagePreviewButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ImagePreviewButtonComponent, deps: [{ token: i1.OverlayService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
ImagePreviewButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: ImagePreviewButtonComponent, selector: "ax-image-preview-button", inputs: { source: "source", name: "name" }, ngImport: i0, template: "<button\n  axButton\n  button-filled\n  color=\"white\"\n  [hidden]=\"imageSource.error$ | async\"\n  (click)=\"preview()\"\n>\n  <ax-image-source #imageSource [source]=\"source\" [safe]=\"true\">\n    <ax-icon class=\"icon\" name=\"image\"></ax-icon>\n  </ax-image-source>\n</button>\n", styles: ["button{width:1.5rem;height:1.5rem;min-width:0;padding:0;overflow:hidden}button[hidden]{display:none}\n"], dependencies: [{ kind: "directive", type: i2.ButtonDirective, selector: "[axButton]", inputs: ["color", "labelHideMobile", "smallButton", "bigButton", "fullWidth", "filled", "outline", "icon-button", "hoverLabel", "hover", "lowercase", "disabled"] }, { kind: "component", type: i3.ImageSourceComponent, selector: "ax-image-source", inputs: ["source", "fallbackSource", "actualSize", "alt", "safe", "round", "rounded", "border"] }, { kind: "component", type: i4.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ImagePreviewButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-image-preview-button', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n  axButton\n  button-filled\n  color=\"white\"\n  [hidden]=\"imageSource.error$ | async\"\n  (click)=\"preview()\"\n>\n  <ax-image-source #imageSource [source]=\"source\" [safe]=\"true\">\n    <ax-icon class=\"icon\" name=\"image\"></ax-icon>\n  </ax-image-source>\n</button>\n", styles: ["button{width:1.5rem;height:1.5rem;min-width:0;padding:0;overflow:hidden}button[hidden]{display:none}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.OverlayService }, { type: i0.ElementRef }]; }, propDecorators: { source: [{
                type: Input
            }], name: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW1hZ2UtcHJldmlldy1idXR0b24uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL2ltYWdlLXByZXZpZXctYnV0dG9uL2ltYWdlLXByZXZpZXctYnV0dG9uLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9pbWFnZS1wcmV2aWV3LWJ1dHRvbi9pbWFnZS1wcmV2aWV3LWJ1dHRvbi5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsdUJBQXVCLEVBQUUsU0FBUyxFQUFFLFVBQVUsRUFBRSxLQUFLLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFFcEYsT0FBTyxFQUFDLFNB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