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);
    }
}
AvatarCropperModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AvatarCropperModalComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.OverlayService }], target: i0.ɵɵFactoryTarget.Component });
AvatarCropperModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", 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        [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: ["format", "transform", "maintainAspectRatio", "aspectRatio", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "autoCrop", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "cropper", "alignImage", "disabled", "imageChangedEvent", "imageURL", "imageBase64", "imageFile"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed"] }, { 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: "15.1.5", 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        [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: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.OverlayService }]; }, propDecorators: { isIndividual: [{
                type: Input
            }] } });
//# sourceMapping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