import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input } from '@angular/core';
import { OverlayService } from '@aztrix/components/overlay';
import * as i0 from "@angular/core";
import * as i1 from "@aztrix/components/overlay";
import * as i2 from "@angular/common";
import * as i3 from "ngx-image-cropper";
import * as i4 from "@aztrix/components/button";
import * as i5 from "@aztrix/helpers";
export class AvatarCropperModalComponent {
    constructor(_changeDetector, _overlay) {
        this._changeDetector = _changeDetector;
        this._overlay = _overlay;
        this.isIndividual = false;
    }
    imageCropped(event) {
        this.croppedImage = event;
        this._changeDetector.markForCheck();
    }
    save() {
        this._overlay.closeModal();
        this.didFinishCropping(this.croppedImage);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AvatarCropperModalComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.OverlayService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AvatarCropperModalComponent, selector: "ax-avatar-cropper-modal", inputs: { isIndividual: "isIndividual" }, ngImport: i0, template: "<div class=\"modal-content-wrapper\">\n  <div class=\"c-modal__section\">\n    <div class=\"image-crop\" *ngIf=\"imageChangedEvent\">\n      <image-cropper\n        [imageChangedEvent]=\"imageChangedEvent\"\n        [output]=\"'base64'\"\n        [maintainAspectRatio]=\"true\"\n        [resizeToWidth]=\"250\"\n        [roundCropper]=\"isIndividual\"\n        (imageCropped)=\"imageCropped($event)\"\n      ></image-cropper>\n    </div>\n    <div class=\"h-button-wrapper\">\n      <button axButton (click)=\"save()\" color=\"primary\" fullWidth outline>\n        {{ 'label.upload' | translate }}\n      </button>\n    </div>\n  </div>\n</div>\n", styles: ["image-cropper{padding:0!important}.image-crop{width:50%;margin:0 auto 1rem}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.ImageCropperComponent, selector: "image-cropper", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "imageAltText", "cropperFrameAriaLabel", "output", "format", "transform", "maintainAspectRatio", "aspectRatio", "resetCropOnAspectRatioChange", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "autoCrop", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "cropper", "alignImage", "disabled", "hidden"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange"] }, { kind: "directive", type: i4.ButtonDirective, selector: "[axButton]", inputs: ["color", "labelHideMobile", "smallButton", "bigButton", "fullWidth", "filled", "outline", "icon-button", "hoverLabel", "hover", "lowercase", "disabled"] }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AvatarCropperModalComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-avatar-cropper-modal', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"modal-content-wrapper\">\n  <div class=\"c-modal__section\">\n    <div class=\"image-crop\" *ngIf=\"imageChangedEvent\">\n      <image-cropper\n        [imageChangedEvent]=\"imageChangedEvent\"\n        [output]=\"'base64'\"\n        [maintainAspectRatio]=\"true\"\n        [resizeToWidth]=\"250\"\n        [roundCropper]=\"isIndividual\"\n        (imageCropped)=\"imageCropped($event)\"\n      ></image-cropper>\n    </div>\n    <div class=\"h-button-wrapper\">\n      <button axButton (click)=\"save()\" color=\"primary\" fullWidth outline>\n        {{ 'label.upload' | translate }}\n      </button>\n    </div>\n  </div>\n</div>\n", styles: ["image-cropper{padding:0!important}.image-crop{width:50%;margin:0 auto 1rem}\n"] }]
        }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1.OverlayService }], propDecorators: { isIndividual: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXZhdGFyLWNyb3BwZXItbW9kYWwuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL2F2YXRhci9hdmF0YXItY3JvcHBlci1tb2RhbC9hdmF0YXItY3JvcHBlci1tb2RhbC5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvbmVudHMvYXZhdGFyL2F2YXRhci1jcm9wcGVyLW1vZGFsL2F2YXRhci1jcm9wcGVyLW1vZGFsLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyx1QkFBdUIsRUFBRSxpQkFBaUIsRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQzNGLE9BQU8sRUFBQyxjQUFjLEVBQUMsTUFBTSw0QkFBNEIsQ0FBQzs7Ozs7OztBQVMxRCxNQUFNLE9BQU8sMkJBQTJCO0lBT3RDLFlBQW9CLGVBQWtDLEVBQVUsUUFBd0I7UUFBcEUsb0JBQWUsR0FBZixlQUFlLENBQW1CO1FBQVUsYUFBUSxHQUFSLFFBQVEsQ0FBZ0I7UUFOL0UsaUJBQVksR0FBRyxLQUFLLENBQUM7SUFNNkQsQ0FBQztJQUVyRixZQUFZLENBQUMsS0FBd0I7UUFDMUMsSUFBSSxDQUFDLFlBQVksR0FBRyxLQUFLLENBQUM7UUFDMUIsSUFBSSxDQUFDLGVBQWUsQ0FBQyxZQUFZLEVBQUUsQ0FBQztJQUN0QyxDQUFDO0lBRU0sSUFBSTtRQUNULElBQUksQ0FBQyxRQUFRLENBQUMsVUFBVSxFQUFFLEN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