Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngx-image-cropper

Package Overview
Dependencies
Maintainers
1
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-image-cropper - npm Package Compare versions

Comparing version 1.4.1 to 1.5.0

2

bundles/ngx-image-cropper.umd.min.js

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/platform-browser"),require("@angular/common")):"function"==typeof define&&define.amd?define("ngx-image-cropper",["exports","@angular/core","@angular/platform-browser","@angular/common"],e):e(t["ngx-image-cropper"]={},t.ng.core,t.ng.platformBrowser,t.ng.common)}(this,function(t,r,e,i){"use strict";var n=function(){return(n=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function o(t){try{var e=function h(t){var e=new DataView(function n(t){t=t.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var e=atob(t),i=e.length,r=new Uint8Array(i),o=0;o<i;o++)r[o]=e.charCodeAt(o);return r.buffer}(t));if(65496!=e.getUint16(0,!1))return-2;var i=e.byteLength,r=2;for(;r<i;){if(e.getUint16(r+2,!1)<=8)return-1;var o=e.getUint16(r,!1);if(r+=2,65505==o){if(1165519206!=e.getUint32(r+=2,!1))return-1;var s=18761==e.getUint16(r+=6,!1);r+=e.getUint32(r+4,s);var a=e.getUint16(r,s);r+=2;for(var p=0;p<a;p++)if(274==e.getUint16(r+12*p,s))return e.getUint16(r+12*p+8,s)}else{if(65280!=(65280&o))break;r+=e.getUint16(r,!1)}}return-1}(t);return 1<e?s(t,e):Promise.resolve(t)}catch(i){return Promise.reject(i)}}function s(t,n){return new Promise(function(s,a){var p=new Image;p.onload=function(){var t=p.width,e=p.height,i=document.createElement("canvas"),r=i.getContext("2d");r?(4<n&&n<9?(i.width=e,i.height=t):(i.width=t,i.height=e),function o(t,e,i,r){switch(e){case 2:t.transform(-1,0,0,1,i,0);break;case 3:t.transform(-1,0,0,-1,i,r);break;case 4:t.transform(1,0,0,-1,0,r);break;case 5:t.transform(0,1,1,0,0,0);break;case 6:t.transform(0,1,-1,0,r,0);break;case 7:t.transform(0,-1,-1,0,r,i);break;case 8:t.transform(0,-1,1,0,0,i)}}(r,n,t,e),r.drawImage(p,0,0),s(i.toDataURL())):a(new Error("No context"))},p.src=t})}var a=function(){function t(t,e,i){this.sanitizer=t,this.cd=e,this.zone=i,this.setImageMaxSizeRetries=0,this.cropperScaledMinWidth=20,this.cropperScaledMinHeight=20,this.marginLeft="0px",this.imageVisible=!1,this.format="png",this.outputType="both",this.maintainAspectRatio=!0,this.aspectRatio=1,this.resizeToWidth=0,this.resizeToHeight=0,this.cropperMinWidth=0,this.cropperMinHeight=0,this.roundCropper=!1,this.onlyScaleDown=!1,this.imageQuality=92,this.autoCrop=!0,this.containWithinAspectRatio=!1,this.cropper={x1:-100,y1:-100,x2:1e4,y2:1e4},this.alignImage="center",this.startCropImage=new r.EventEmitter,this.imageCropped=new r.EventEmitter,this.imageCroppedBase64=new r.EventEmitter,this.imageCroppedFile=new r.EventEmitter,this.imageLoaded=new r.EventEmitter,this.cropperReady=new r.EventEmitter,this.loadImageFailed=new r.EventEmitter,this.initCropper()}return Object.defineProperty(t.prototype,"imageFileChanged",{set:function(t){this.initCropper(),t&&this.loadImageFile(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageChangedEvent",{set:function(t){this.initCropper(),t&&t.target&&t.target.files&&0<t.target.files.length&&this.loadImageFile(t.target.files[0])},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageBase64",{set:function(t){this.initCropper(),this.checkExifAndLoadBase64Image(t)},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){t.cropper&&(this.setMaxSize(),this.setCropperScaledMinSize(),this.checkCropperPosition(!1),this.doAutoCrop(),this.cd.markForCheck()),t.aspectRatio&&this.imageVisible&&this.resetCropperPosition()},t.prototype.initCropper=function(){this.imageVisible=!1,this.originalImage=null,this.safeImgDataUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",this.moveStart={active:!1,type:null,position:null,x1:0,y1:0,x2:0,y2:0,clientX:0,clientY:0},this.maxSize={width:0,height:0},this.originalSize={width:0,height:0},this.cropper.x1=-100,this.cropper.y1=-100,this.cropper.x2=1e4,this.cropper.y2=1e4},t.prototype.loadImageFile=function(i){var r=this,t=new FileReader;t.onload=function(t){var e=i.type;r.isValidImageType(e)?r.checkExifAndLoadBase64Image(t.target.result):r.loadImageFailed.emit()},t.readAsDataURL(i)},t.prototype.isValidImageType=function(t){return/image\/(png|jpg|jpeg|bmp|gif|tiff)/.test(t)},t.prototype.checkExifAndLoadBase64Image=function(t){var e=this;o(t).then(function(t){return e.fitImageToAspectRatio(t)}).then(function(t){return e.loadBase64Image(t)})["catch"](function(){return e.loadImageFailed.emit()})},t.prototype.fitImageToAspectRatio=function(t){return this.containWithinAspectRatio?function e(t,h){return new Promise(function(a,p){var n=new Image;n.onload=function(){var t=document.createElement("canvas"),e=t.getContext("2d");if(e){var i=n.height*h,r=n.width/h;t.width=Math.max(n.width,i),t.height=Math.max(n.height,r);var o=(t.width-n.width)/2,s=(t.height-n.height)/2;e.drawImage(n,o,s),a(t.toDataURL())}else p(new Error("No context"))},n.src=t})}(t,this.aspectRatio):Promise.resolve(t)},t.prototype.loadBase64Image=function(t){var e=this;this.originalBase64=t,this.safeImgDataUrl=this.sanitizer.bypassSecurityTrustResourceUrl(t),this.originalImage=new Image,this.originalImage.onload=function(){e.originalSize.width=e.originalImage.width,e.originalSize.height=e.originalImage.height,e.cd.markForCheck()},this.originalImage.src=t},t.prototype.imageLoadedInView=function(){var t=this;null!=this.originalImage&&(this.imageLoaded.emit(),this.setImageMaxSizeRetries=0,setTimeout(function(){return t.checkImageMaxSizeRecursively()}))},t.prototype.checkImageMaxSizeRecursively=function(){var t=this;40<this.setImageMaxSizeRetries?this.loadImageFailed.emit():this.sourceImage&&this.sourceImage.nativeElement&&0<this.sourceImage.nativeElement.offsetWidth?(this.setMaxSize(),this.setCropperScaledMinSize(),this.resetCropperPosition(),this.cropperReady.emit(),this.cd.markForCheck()):(this.setImageMaxSizeRetries++,setTimeout(function(){t.checkImageMaxSizeRecursively()},50))},t.prototype.onResize=function(){this.resizeCropperPosition(),this.setMaxSize(),this.setCropperScaledMinSize()},t.prototype.rotateLeft=function(){this.transformBase64(8)},t.prototype.rotateRight=function(){this.transformBase64(6)},t.prototype.flipHorizontal=function(){this.transformBase64(2)},t.prototype.flipVertical=function(){this.transformBase64(4)},t.prototype.transformBase64=function(t){var e=this;this.originalBase64&&s(this.originalBase64,t).then(function(t){return e.fitImageToAspectRatio(t)}).then(function(t){return e.loadBase64Image(t)})},t.prototype.resizeCropperPosition=function(){var t=this.sourceImage.nativeElement;this.maxSize.width===t.offsetWidth&&this.maxSize.height===t.offsetHeight||(this.cropper.x1=this.cropper.x1*t.offsetWidth/this.maxSize.width,this.cropper.x2=this.cropper.x2*t.offsetWidth/this.maxSize.width,this.cropper.y1=this.cropper.y1*t.offsetHeight/this.maxSize.height,this.cropper.y2=this.cropper.y2*t.offsetHeight/this.maxSize.height)},t.prototype.resetCropperPosition=function(){var t=this.sourceImage.nativeElement;if(this.maintainAspectRatio)if(t.offsetWidth/this.aspectRatio<t.offsetHeight){this.cropper.x1=0,this.cropper.x2=t.offsetWidth;var e=t.offsetWidth/this.aspectRatio;this.cropper.y1=(t.offsetHeight-e)/2,this.cropper.y2=this.cropper.y1+e}else{this.cropper.y1=0,this.cropper.y2=t.offsetHeight;var i=t.offsetHeight*this.aspectRatio;this.cropper.x1=(t.offsetWidth-i)/2,this.cropper.x2=this.cropper.x1+i}else this.cropper.x1=0,this.cropper.x2=t.offsetWidth,this.cropper.y1=0,this.cropper.y2=t.offsetHeight;this.doAutoCrop(),this.imageVisible=!0},t.prototype.startMove=function(t,e,i){void 0===i&&(i=null),t.preventDefault(),this.moveStart=n({active:!0,type:e,position:i,clientX:this.getClientX(t),clientY:this.getClientY(t)},this.cropper)},t.prototype.moveImg=function(t){this.moveStart.active&&(t.stopPropagation(),t.preventDefault(),"move"===this.moveStart.type?(this.move(t),this.checkCropperPosition(!0)):"resize"===this.moveStart.type&&(this.resize(t),this.checkCropperPosition(!1)),this.cd.detectChanges())},t.prototype.setMaxSize=function(){var t=this.sourceImage.nativeElement;this.maxSize.width=t.offsetWidth,this.maxSize.height=t.offsetHeight,this.marginLeft=this.sanitizer.bypassSecurityTrustStyle("calc(50% - "+this.maxSize.width/2+"px)")},t.prototype.setCropperScaledMinSize=function(){this.originalImage?(this.setCropperScaledMinWidth(),this.setCropperScaledMinHeight()):(this.cropperScaledMinWidth=20,this.cropperScaledMinHeight=20)},t.prototype.setCropperScaledMinWidth=function(){this.cropperScaledMinWidth=0<this.cropperMinWidth?Math.max(20,this.cropperMinWidth/this.originalImage.width*this.maxSize.width):20},t.prototype.setCropperScaledMinHeight=function(){this.maintainAspectRatio?this.cropperScaledMinHeight=Math.max(20,this.cropperScaledMinWidth/this.aspectRatio):0<this.cropperMinHeight?this.cropperScaledMinHeight=Math.max(20,this.cropperMinHeight/this.originalImage.height*this.maxSize.height):this.cropperScaledMinHeight=20},t.prototype.checkCropperPosition=function(t){void 0===t&&(t=!1),this.cropper.x1<0&&(this.cropper.x2-=t?this.cropper.x1:0,this.cropper.x1=0),this.cropper.y1<0&&(this.cropper.y2-=t?this.cropper.y1:0,this.cropper.y1=0),this.cropper.x2>this.maxSize.width&&(this.cropper.x1-=t?this.cropper.x2-this.maxSize.width:0,this.cropper.x2=this.maxSize.width),this.cropper.y2>this.maxSize.height&&(this.cropper.y1-=t?this.cropper.y2-this.maxSize.height:0,this.cropper.y2=this.maxSize.height)},t.prototype.moveStop=function(){this.moveStart.active&&(this.moveStart.active=!1,this.doAutoCrop())},t.prototype.move=function(t){var e=this.getClientX(t)-this.moveStart.clientX,i=this.getClientY(t)-this.moveStart.clientY;this.cropper.x1=this.moveStart.x1+e,this.cropper.y1=this.moveStart.y1+i,this.cropper.x2=this.moveStart.x2+e,this.cropper.y2=this.moveStart.y2+i},t.prototype.resize=function(t){var e=this.getClientX(t)-this.moveStart.clientX,i=this.getClientY(t)-this.moveStart.clientY;switch(this.moveStart.position){case"left":this.cropper.x1=Math.min(this.moveStart.x1+e,this.cropper.x2-this.cropperScaledMinWidth);break;case"topleft":this.cropper.x1=Math.min(this.moveStart.x1+e,this.cropper.x2-this.cropperScaledMinWidth),this.cropper.y1=Math.min(this.moveStart.y1+i,this.cropper.y2-this.cropperScaledMinHeight);break;case"top":this.cropper.y1=Math.min(this.moveStart.y1+i,this.cropper.y2-this.cropperScaledMinHeight);break;case"topright":this.cropper.x2=Math.max(this.moveStart.x2+e,this.cropper.x1+this.cropperScaledMinWidth),this.cropper.y1=Math.min(this.moveStart.y1+i,this.cropper.y2-this.cropperScaledMinHeight);break;case"right":this.cropper.x2=Math.max(this.moveStart.x2+e,this.cropper.x1+this.cropperScaledMinWidth);break;case"bottomright":this.cropper.x2=Math.max(this.moveStart.x2+e,this.cropper.x1+this.cropperScaledMinWidth),this.cropper.y2=Math.max(this.moveStart.y2+i,this.cropper.y1+this.cropperScaledMinHeight);break;case"bottom":this.cropper.y2=Math.max(this.moveStart.y2+i,this.cropper.y1+this.cropperScaledMinHeight);break;case"bottomleft":this.cropper.x1=Math.min(this.moveStart.x1+e,this.cropper.x2-this.cropperScaledMinWidth),this.cropper.y2=Math.max(this.moveStart.y2+i,this.cropper.y1+this.cropperScaledMinHeight)}this.maintainAspectRatio&&this.checkAspectRatio()},t.prototype.checkAspectRatio=function(){var t=0,e=0;switch(this.moveStart.position){case"top":this.cropper.x2=this.cropper.x1+(this.cropper.y2-this.cropper.y1)*this.aspectRatio,t=Math.max(this.cropper.x2-this.maxSize.width,0),e=Math.max(0-this.cropper.y1,0),(0<t||0<e)&&(this.cropper.x2-=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y1+=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"bottom":this.cropper.x2=this.cropper.x1+(this.cropper.y2-this.cropper.y1)*this.aspectRatio,t=Math.max(this.cropper.x2-this.maxSize.width,0),e=Math.max(this.cropper.y2-this.maxSize.height,0),(0<t||0<e)&&(this.cropper.x2-=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y2-=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"topleft":this.cropper.y1=this.cropper.y2-(this.cropper.x2-this.cropper.x1)/this.aspectRatio,t=Math.max(0-this.cropper.x1,0),e=Math.max(0-this.cropper.y1,0),(0<t||0<e)&&(this.cropper.x1+=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y1+=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"topright":this.cropper.y1=this.cropper.y2-(this.cropper.x2-this.cropper.x1)/this.aspectRatio,t=Math.max(this.cropper.x2-this.maxSize.width,0),e=Math.max(0-this.cropper.y1,0),(0<t||0<e)&&(this.cropper.x2-=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y1+=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"right":case"bottomright":this.cropper.y2=this.cropper.y1+(this.cropper.x2-this.cropper.x1)/this.aspectRatio,t=Math.max(this.cropper.x2-this.maxSize.width,0),e=Math.max(this.cropper.y2-this.maxSize.height,0),(0<t||0<e)&&(this.cropper.x2-=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y2-=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"left":case"bottomleft":this.cropper.y2=this.cropper.y1+(this.cropper.x2-this.cropper.x1)/this.aspectRatio,t=Math.max(0-this.cropper.x1,0),e=Math.max(this.cropper.y2-this.maxSize.height,0),(0<t||0<e)&&(this.cropper.x1+=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y2-=e*this.aspectRatio>t?e:t/this.aspectRatio)}},t.prototype.doAutoCrop=function(){this.autoCrop&&this.crop()},t.prototype.crop=function(t){if(void 0===t&&(t=this.outputType),this.sourceImage.nativeElement&&null!=this.originalImage){this.startCropImage.emit();var e=this.getImagePosition(),i=e.x2-e.x1,r=e.y2-e.y1,o=document.createElement("canvas");o.width=i,o.height=r;var s=o.getContext("2d");if(s){null!=this.backgroundColor&&(s.fillStyle=this.backgroundColor,s.fillRect(0,0,i,r)),s.drawImage(this.originalImage,e.x1,e.y1,i,r,0,0,i,r);var a={width:i,height:r,imagePosition:e,cropperPosition:n({},this.cropper)},p=this.getResizeRatio(i,r);return 1!==p&&(a.width=Math.round(i*p),a.height=this.maintainAspectRatio?Math.round(a.width/this.aspectRatio):Math.round(r*p),function F(t,e,i,r){void 0===r&&(r=!0);var o=t.width,s=t.height,a=o/(e=Math.round(e)),p=s/(i=Math.round(i)),n=Math.ceil(a/2),h=Math.ceil(p/2),c=t.getContext("2d");if(c){for(var m=c.getImageData(0,0,o,s),g=c.createImageData(e,i),l=m.data,u=g.data,d=0;d<i;d++)for(var f=0;f<e;f++){var y=4*(f+d*e),x=d*p,v=0,z=0,b=0,M=0,S=0,w=0,I=0,C=Math.floor(f*a),R=Math.floor(d*p),A=Math.ceil((f+1)*a),k=Math.ceil((d+1)*p);A=Math.min(A,o),k=Math.min(k,s);for(var H=R;H<k;H++)for(var E=Math.abs(x-H)/h,W=f*a,T=E*E,B=C;B<A;B++){var P=Math.abs(W-B)/n,U=Math.sqrt(T+P*P);if(!(1<=U)){var D=4*(B+H*o);I+=(v=2*U*U*U-3*U*U+1)*l[D+3],b+=v,l[D+3]<255&&(v=v*l[D+3]/250),M+=v*l[D],S+=v*l[D+1],w+=v*l[D+2],z+=v}}u[y]=M/z,u[y+1]=S/z,u[y+2]=w/z,u[y+3]=I/b}r?(t.width=e,t.height=i):c.clearRect(0,0,o,s),c.putImageData(g,0,0)}}(o,a.width,a.height)),this.cropToOutputType(t,o,a)}}return null},t.prototype.getImagePosition=function(){var t=this.sourceImage.nativeElement,e=this.originalSize.width/t.offsetWidth;return{x1:Math.round(this.cropper.x1*e),y1:Math.round(this.cropper.y1*e),x2:Math.min(Math.round(this.cropper.x2*e),this.originalSize.width),y2:Math.min(Math.round(this.cropper.y2*e),this.originalSize.height)}},t.prototype.cropToOutputType=function(t,e,i){var r=this;switch(t){case"file":return this.cropToFile(e).then(function(t){return i.file=t,r.imageCropped.emit(i),i});case"both":return i.base64=this.cropToBase64(e),this.cropToFile(e).then(function(t){return i.file=t,r.imageCropped.emit(i),i});default:return i.base64=this.cropToBase64(e),this.imageCropped.emit(i),i}},t.prototype.cropToBase64=function(t){var e=t.toDataURL("image/"+this.format,this.getQuality());return this.imageCroppedBase64.emit(e),e},t.prototype.cropToFile=function(t){var e=this;return this.getCanvasBlob(t).then(function(t){return t&&e.imageCroppedFile.emit(t),t})},t.prototype.getCanvasBlob=function(t){var i=this;return new Promise(function(e){t.toBlob(function(t){return i.zone.run(function(){return e(t)})},"image/"+i.format,i.getQuality())})},t.prototype.getQuality=function(){return Math.min(1,Math.max(0,this.imageQuality/100))},t.prototype.getResizeRatio=function(t,e){if(0<this.resizeToWidth){if(!this.onlyScaleDown||t>this.resizeToWidth)return this.resizeToWidth/t}else if(0<this.resizeToHeight&&(!this.onlyScaleDown||e>this.resizeToHeight))return this.resizeToHeight/e;return 1},t.prototype.getClientX=function(t){return t.clientX||t.touches&&t.touches[0]&&t.touches[0].clientX},t.prototype.getClientY=function(t){return t.clientY||t.touches&&t.touches[0]&&t.touches[0].clientY},t.decorators=[{type:r.Component,args:[{selector:"image-cropper",template:'<div [style.background]="imageVisible && backgroundColor">\n <img\n #sourceImage\n class="source-image"\n [src]="safeImgDataUrl"\n [style.visibility]="imageVisible ? \'visible\' : \'hidden\'"\n (load)="imageLoadedInView()"\n />\n <div class="cropper"\n *ngIf="imageVisible"\n [class.rounded]="roundCropper"\n [style.top.px]="cropper.y1"\n [style.left.px]="cropper.x1"\n [style.width.px]="cropper.x2 - cropper.x1"\n [style.height.px]="cropper.y2 - cropper.y1"\n [style.margin-left]="alignImage === \'center\' ? marginLeft : null"\n [style.visibility]="imageVisible ? \'visible\' : \'hidden\'"\n >\n <div\n (mousedown)="startMove($event, \'move\')"\n (touchstart)="startMove($event, \'move\')"\n class="move"\n >&nbsp;</div>\n <span\n class="resize topleft"\n (mousedown)="startMove($event, \'resize\', \'topleft\')"\n (touchstart)="startMove($event, \'resize\', \'topleft\')"\n ><span class="square"></span></span>\n <span\n class="resize top"\n ><span class="square"></span></span>\n <span\n class="resize topright"\n (mousedown)="startMove($event, \'resize\', \'topright\')"\n (touchstart)="startMove($event, \'resize\', \'topright\')"\n ><span class="square"></span></span>\n <span\n class="resize right"\n ><span class="square"></span></span>\n <span\n class="resize bottomright"\n (mousedown)="startMove($event, \'resize\', \'bottomright\')"\n (touchstart)="startMove($event, \'resize\', \'bottomright\')"\n ><span class="square"></span></span>\n <span\n class="resize bottom"\n ><span class="square"></span></span>\n <span\n class="resize bottomleft"\n (mousedown)="startMove($event, \'resize\', \'bottomleft\')"\n (touchstart)="startMove($event, \'resize\', \'bottomleft\')"\n ><span class="square"></span></span>\n <span\n class="resize left"\n ><span class="square"></span></span>\n <span\n class="resize-bar top"\n (mousedown)="startMove($event, \'resize\', \'top\')"\n (touchstart)="startMove($event, \'resize\', \'top\')"\n ></span>\n <span\n class="resize-bar right"\n (mousedown)="startMove($event, \'resize\', \'right\')"\n (touchstart)="startMove($event, \'resize\', \'right\')"\n ></span>\n <span\n class="resize-bar bottom"\n (mousedown)="startMove($event, \'resize\', \'bottom\')"\n (touchstart)="startMove($event, \'resize\', \'bottom\')"\n ></span>\n <span\n class="resize-bar left"\n (mousedown)="startMove($event, \'resize\', \'left\')"\n (touchstart)="startMove($event, \'resize\', \'left\')"\n ></span>\n </div>\n</div>\n',changeDetection:r.ChangeDetectionStrategy.OnPush,styles:[":host{display:flex;position:relative;width:100%;max-width:100%;max-height:100%;overflow:hidden;padding:5px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host>div{position:relative;width:100%}:host>div img.source-image{max-width:100%;max-height:100%}:host .cropper{position:absolute;display:flex;color:#53535c;background:0 0;touch-action:none;outline:rgba(255,255,255,.3) solid 100vw}:host .cropper:after{position:absolute;content:'';top:0;bottom:0;left:0;right:0;pointer-events:none;border:1px dashed;opacity:.75;color:inherit;z-index:1}:host .cropper .move{width:100%;cursor:move;border:1px solid rgba(255,255,255,.5)}:host .cropper .resize{position:absolute;display:inline-block;line-height:6px;padding:8px;opacity:.85;z-index:1}:host .cropper .resize .square{display:inline-block;background:#53535c;width:6px;height:6px;border:1px solid rgba(255,255,255,.5);box-sizing:content-box}:host .cropper .resize.topleft{top:-12px;left:-12px;cursor:nwse-resize}:host .cropper .resize.top{top:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .cropper .resize.topright{top:-12px;right:-12px;cursor:nesw-resize}:host .cropper .resize.right{top:calc(50% - 12px);right:-12px;cursor:ew-resize}:host .cropper .resize.bottomright{bottom:-12px;right:-12px;cursor:nwse-resize}:host .cropper .resize.bottom{bottom:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .cropper .resize.bottomleft{bottom:-12px;left:-12px;cursor:nesw-resize}:host .cropper .resize.left{top:calc(50% - 12px);left:-12px;cursor:ew-resize}:host .cropper .resize-bar{position:absolute;z-index:1}:host .cropper .resize-bar.top{top:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .cropper .resize-bar.right{top:11px;right:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .cropper .resize-bar.bottom{bottom:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .cropper .resize-bar.left{top:11px;left:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .cropper.rounded{outline-color:transparent}:host .cropper.rounded:after{border-radius:100%;box-shadow:0 0 0 100vw rgba(255,255,255,.3)}@media (orientation:portrait){:host .cropper{outline-width:100vh}:host .cropper.rounded:after{box-shadow:0 0 0 100vh rgba(255,255,255,.3)}}:host .cropper.rounded .move{border-radius:100%}"]}]}],t.ctorParameters=function(){return[{type:e.DomSanitizer},{type:r.ChangeDetectorRef},{type:r.NgZone}]},t.propDecorators={sourceImage:[{type:r.ViewChild,args:["sourceImage"]}],imageFileChanged:[{type:r.Input}],imageChangedEvent:[{type:r.Input}],imageBase64:[{type:r.Input}],format:[{type:r.Input}],outputType:[{type:r.Input}],maintainAspectRatio:[{type:r.Input}],aspectRatio:[{type:r.Input}],resizeToWidth:[{type:r.Input}],resizeToHeight:[{type:r.Input}],cropperMinWidth:[{type:r.Input}],cropperMinHeight:[{type:r.Input}],roundCropper:[{type:r.Input}],onlyScaleDown:[{type:r.Input}],imageQuality:[{type:r.Input}],autoCrop:[{type:r.Input}],backgroundColor:[{type:r.Input}],containWithinAspectRatio:[{type:r.Input}],cropper:[{type:r.Input}],alignImage:[{type:r.HostBinding,args:["style.text-align"]},{type:r.Input}],startCropImage:[{type:r.Output}],imageCropped:[{type:r.Output}],imageCroppedBase64:[{type:r.Output}],imageCroppedFile:[{type:r.Output}],imageLoaded:[{type:r.Output}],cropperReady:[{type:r.Output}],loadImageFailed:[{type:r.Output}],onResize:[{type:r.HostListener,args:["window:resize"]}],moveImg:[{type:r.HostListener,args:["document:mousemove",["$event"]]},{type:r.HostListener,args:["document:touchmove",["$event"]]}],moveStop:[{type:r.HostListener,args:["document:mouseup"]},{type:r.HostListener,args:["document:touchend"]}]},t}(),p=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{imports:[i.CommonModule],declarations:[a],exports:[a]}]}],t}();t.ImageCropperModule=p,t.ImageCropperComponent=a,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define("ngx-image-cropper",["exports","@angular/core","@angular/common","@angular/platform-browser"],e):e((t=t||self)["ngx-image-cropper"]={},t.ng.core,t.ng.common,t.ng.platformBrowser)}(this,(function(t,e,i,r){"use strict";var o=function(){return(o=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function s(t,e,i,r){var o,s=arguments.length,p=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(p=(s<3?o(p):s>3?o(e,i,p):o(e,i))||p);return s>3&&p&&Object.defineProperty(e,i,p),p}function p(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function a(t){try{var e=function(t){var e=new DataView(function(t){t=t.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var e=atob(t),i=e.length,r=new Uint8Array(i),o=0;o<i;o++)r[o]=e.charCodeAt(o);return r.buffer}(t));if(65496!=e.getUint16(0,!1))return-2;var i=e.byteLength,r=2;for(;r<i;){if(e.getUint16(r+2,!1)<=8)return-1;var o=e.getUint16(r,!1);if(r+=2,65505==o){if(1165519206!=e.getUint32(r+=2,!1))return-1;var s=18761==e.getUint16(r+=6,!1);r+=e.getUint32(r+4,s);var p=e.getUint16(r,s);r+=2;for(var a=0;a<p;a++)if(274==e.getUint16(r+12*a,s))return e.getUint16(r+12*a+8,s)}else{if(65280!=(65280&o))break;r+=e.getUint16(r,!1)}}return-1}(t);return e>1?n(t,e):Promise.resolve(t)}catch(t){return Promise.reject(t)}}function n(t,e){return new Promise((function(i,r){var o=new Image;o.onload=function(){var t=o.width,s=o.height,p=document.createElement("canvas"),a=p.getContext("2d");a?(4<e&&e<9?(p.width=s,p.height=t):(p.width=t,p.height=s),function(t,e,i,r){switch(e){case 2:t.transform(-1,0,0,1,i,0);break;case 3:t.transform(-1,0,0,-1,i,r);break;case 4:t.transform(1,0,0,-1,0,r);break;case 5:t.transform(0,1,1,0,0,0);break;case 6:t.transform(0,1,-1,0,r,0);break;case 7:t.transform(0,-1,-1,0,r,i);break;case 8:t.transform(0,-1,1,0,0,i)}}(a,e,t,s),a.drawImage(o,0,0),i(p.toDataURL())):r(new Error("No context"))},o.src=t}))}var h=function(){function t(t,i,r){this.sanitizer=t,this.cd=i,this.zone=r,this.setImageMaxSizeRetries=0,this.cropperScaledMinWidth=20,this.cropperScaledMinHeight=20,this.marginLeft="0px",this.imageVisible=!1,this.format="png",this.outputType="both",this.maintainAspectRatio=!0,this.aspectRatio=1,this.resizeToWidth=0,this.resizeToHeight=0,this.cropperMinWidth=0,this.cropperMinHeight=0,this.roundCropper=!1,this.onlyScaleDown=!1,this.imageQuality=92,this.autoCrop=!0,this.containWithinAspectRatio=!1,this.cropper={x1:-100,y1:-100,x2:1e4,y2:1e4},this.alignImage="center",this.startCropImage=new e.EventEmitter,this.imageCropped=new e.EventEmitter,this.imageCroppedBase64=new e.EventEmitter,this.imageCroppedFile=new e.EventEmitter,this.imageLoaded=new e.EventEmitter,this.cropperReady=new e.EventEmitter,this.loadImageFailed=new e.EventEmitter,this.initCropper()}return Object.defineProperty(t.prototype,"imageFileChanged",{set:function(t){this.initCropper(),t&&this.loadImageFile(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageChangedEvent",{set:function(t){this.initCropper(),t&&t.target&&t.target.files&&t.target.files.length>0&&this.loadImageFile(t.target.files[0])},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageBase64",{set:function(t){this.initCropper(),this.checkExifAndLoadBase64Image(t)},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){t.cropper&&(this.setMaxSize(),this.setCropperScaledMinSize(),this.checkCropperPosition(!1),this.doAutoCrop(),this.cd.markForCheck()),t.aspectRatio&&this.imageVisible&&this.resetCropperPosition()},t.prototype.initCropper=function(){this.imageVisible=!1,this.originalImage=null,this.safeImgDataUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",this.moveStart={active:!1,type:null,position:null,x1:0,y1:0,x2:0,y2:0,clientX:0,clientY:0},this.maxSize={width:0,height:0},this.originalSize={width:0,height:0},this.cropper.x1=-100,this.cropper.y1=-100,this.cropper.x2=1e4,this.cropper.y2=1e4},t.prototype.loadImageFile=function(t){var e=this,i=new FileReader;i.onload=function(i){var r=t.type;e.isValidImageType(r)?e.checkExifAndLoadBase64Image(i.target.result):e.loadImageFailed.emit()},i.readAsDataURL(t)},t.prototype.isValidImageType=function(t){return/image\/(png|jpg|jpeg|bmp|gif|tiff)/.test(t)},t.prototype.checkExifAndLoadBase64Image=function(t){var e=this;a(t).then((function(t){return e.fitImageToAspectRatio(t)})).then((function(t){return e.loadBase64Image(t)})).catch((function(){return e.loadImageFailed.emit()}))},t.prototype.fitImageToAspectRatio=function(t){return this.containWithinAspectRatio?(e=t,i=this.aspectRatio,new Promise((function(t,r){var o=new Image;o.onload=function(){var e=document.createElement("canvas"),s=e.getContext("2d");if(s){var p=o.height*i,a=o.width/i;e.width=Math.max(o.width,p),e.height=Math.max(o.height,a);var n=(e.width-o.width)/2,h=(e.height-o.height)/2;s.drawImage(o,n,h),t(e.toDataURL())}else r(new Error("No context"))},o.src=e}))):Promise.resolve(t);var e,i},t.prototype.loadBase64Image=function(t){var e=this;this.originalBase64=t,this.safeImgDataUrl=this.sanitizer.bypassSecurityTrustResourceUrl(t),this.originalImage=new Image,this.originalImage.onload=function(){e.originalSize.width=e.originalImage.width,e.originalSize.height=e.originalImage.height,e.cd.markForCheck()},this.originalImage.src=t},t.prototype.imageLoadedInView=function(){var t=this;null!=this.originalImage&&(this.imageLoaded.emit(),this.setImageMaxSizeRetries=0,setTimeout((function(){return t.checkImageMaxSizeRecursively()})))},t.prototype.checkImageMaxSizeRecursively=function(){var t=this;this.setImageMaxSizeRetries>40?this.loadImageFailed.emit():this.sourceImage&&this.sourceImage.nativeElement&&this.sourceImage.nativeElement.offsetWidth>0?(this.setMaxSize(),this.setCropperScaledMinSize(),this.resetCropperPosition(),this.cropperReady.emit(),this.cd.markForCheck()):(this.setImageMaxSizeRetries++,setTimeout((function(){t.checkImageMaxSizeRecursively()}),50))},t.prototype.onResize=function(){this.resizeCropperPosition(),this.setMaxSize(),this.setCropperScaledMinSize()},t.prototype.rotateLeft=function(){this.transformBase64(8)},t.prototype.rotateRight=function(){this.transformBase64(6)},t.prototype.flipHorizontal=function(){this.transformBase64(2)},t.prototype.flipVertical=function(){this.transformBase64(4)},t.prototype.transformBase64=function(t){var e=this;this.originalBase64&&n(this.originalBase64,t).then((function(t){return e.fitImageToAspectRatio(t)})).then((function(t){return e.loadBase64Image(t)}))},t.prototype.resizeCropperPosition=function(){var t=this.sourceImage.nativeElement;this.maxSize.width===t.offsetWidth&&this.maxSize.height===t.offsetHeight||(this.cropper.x1=this.cropper.x1*t.offsetWidth/this.maxSize.width,this.cropper.x2=this.cropper.x2*t.offsetWidth/this.maxSize.width,this.cropper.y1=this.cropper.y1*t.offsetHeight/this.maxSize.height,this.cropper.y2=this.cropper.y2*t.offsetHeight/this.maxSize.height)},t.prototype.resetCropperPosition=function(){var t=this.sourceImage.nativeElement;if(this.maintainAspectRatio)if(t.offsetWidth/this.aspectRatio<t.offsetHeight){this.cropper.x1=0,this.cropper.x2=t.offsetWidth;var e=t.offsetWidth/this.aspectRatio;this.cropper.y1=(t.offsetHeight-e)/2,this.cropper.y2=this.cropper.y1+e}else{this.cropper.y1=0,this.cropper.y2=t.offsetHeight;var i=t.offsetHeight*this.aspectRatio;this.cropper.x1=(t.offsetWidth-i)/2,this.cropper.x2=this.cropper.x1+i}else this.cropper.x1=0,this.cropper.x2=t.offsetWidth,this.cropper.y1=0,this.cropper.y2=t.offsetHeight;this.doAutoCrop(),this.imageVisible=!0},t.prototype.startMove=function(t,e,i){void 0===i&&(i=null),t.preventDefault(),this.moveStart=o({active:!0,type:e,position:i,clientX:this.getClientX(t),clientY:this.getClientY(t)},this.cropper)},t.prototype.moveImg=function(t){this.moveStart.active&&(t.stopPropagation(),t.preventDefault(),"move"===this.moveStart.type?(this.move(t),this.checkCropperPosition(!0)):"resize"===this.moveStart.type&&(this.resize(t),this.checkCropperPosition(!1)),this.cd.detectChanges())},t.prototype.setMaxSize=function(){var t=this.sourceImage.nativeElement;this.maxSize.width=t.offsetWidth,this.maxSize.height=t.offsetHeight,this.marginLeft=this.sanitizer.bypassSecurityTrustStyle("calc(50% - "+this.maxSize.width/2+"px)")},t.prototype.setCropperScaledMinSize=function(){this.originalImage?(this.setCropperScaledMinWidth(),this.setCropperScaledMinHeight()):(this.cropperScaledMinWidth=20,this.cropperScaledMinHeight=20)},t.prototype.setCropperScaledMinWidth=function(){this.cropperScaledMinWidth=this.cropperMinWidth>0?Math.max(20,this.cropperMinWidth/this.originalImage.width*this.maxSize.width):20},t.prototype.setCropperScaledMinHeight=function(){this.maintainAspectRatio?this.cropperScaledMinHeight=Math.max(20,this.cropperScaledMinWidth/this.aspectRatio):this.cropperMinHeight>0?this.cropperScaledMinHeight=Math.max(20,this.cropperMinHeight/this.originalImage.height*this.maxSize.height):this.cropperScaledMinHeight=20},t.prototype.checkCropperPosition=function(t){void 0===t&&(t=!1),this.cropper.x1<0&&(this.cropper.x2-=t?this.cropper.x1:0,this.cropper.x1=0),this.cropper.y1<0&&(this.cropper.y2-=t?this.cropper.y1:0,this.cropper.y1=0),this.cropper.x2>this.maxSize.width&&(this.cropper.x1-=t?this.cropper.x2-this.maxSize.width:0,this.cropper.x2=this.maxSize.width),this.cropper.y2>this.maxSize.height&&(this.cropper.y1-=t?this.cropper.y2-this.maxSize.height:0,this.cropper.y2=this.maxSize.height)},t.prototype.moveStop=function(){this.moveStart.active&&(this.moveStart.active=!1,this.doAutoCrop())},t.prototype.move=function(t){var e=this.getClientX(t)-this.moveStart.clientX,i=this.getClientY(t)-this.moveStart.clientY;this.cropper.x1=this.moveStart.x1+e,this.cropper.y1=this.moveStart.y1+i,this.cropper.x2=this.moveStart.x2+e,this.cropper.y2=this.moveStart.y2+i},t.prototype.resize=function(t){var e=this.getClientX(t)-this.moveStart.clientX,i=this.getClientY(t)-this.moveStart.clientY;switch(this.moveStart.position){case"left":this.cropper.x1=Math.min(this.moveStart.x1+e,this.cropper.x2-this.cropperScaledMinWidth);break;case"topleft":this.cropper.x1=Math.min(this.moveStart.x1+e,this.cropper.x2-this.cropperScaledMinWidth),this.cropper.y1=Math.min(this.moveStart.y1+i,this.cropper.y2-this.cropperScaledMinHeight);break;case"top":this.cropper.y1=Math.min(this.moveStart.y1+i,this.cropper.y2-this.cropperScaledMinHeight);break;case"topright":this.cropper.x2=Math.max(this.moveStart.x2+e,this.cropper.x1+this.cropperScaledMinWidth),this.cropper.y1=Math.min(this.moveStart.y1+i,this.cropper.y2-this.cropperScaledMinHeight);break;case"right":this.cropper.x2=Math.max(this.moveStart.x2+e,this.cropper.x1+this.cropperScaledMinWidth);break;case"bottomright":this.cropper.x2=Math.max(this.moveStart.x2+e,this.cropper.x1+this.cropperScaledMinWidth),this.cropper.y2=Math.max(this.moveStart.y2+i,this.cropper.y1+this.cropperScaledMinHeight);break;case"bottom":this.cropper.y2=Math.max(this.moveStart.y2+i,this.cropper.y1+this.cropperScaledMinHeight);break;case"bottomleft":this.cropper.x1=Math.min(this.moveStart.x1+e,this.cropper.x2-this.cropperScaledMinWidth),this.cropper.y2=Math.max(this.moveStart.y2+i,this.cropper.y1+this.cropperScaledMinHeight)}this.maintainAspectRatio&&this.checkAspectRatio()},t.prototype.checkAspectRatio=function(){var t=0,e=0;switch(this.moveStart.position){case"top":this.cropper.x2=this.cropper.x1+(this.cropper.y2-this.cropper.y1)*this.aspectRatio,t=Math.max(this.cropper.x2-this.maxSize.width,0),e=Math.max(0-this.cropper.y1,0),(t>0||e>0)&&(this.cropper.x2-=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y1+=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"bottom":this.cropper.x2=this.cropper.x1+(this.cropper.y2-this.cropper.y1)*this.aspectRatio,t=Math.max(this.cropper.x2-this.maxSize.width,0),e=Math.max(this.cropper.y2-this.maxSize.height,0),(t>0||e>0)&&(this.cropper.x2-=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y2-=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"topleft":this.cropper.y1=this.cropper.y2-(this.cropper.x2-this.cropper.x1)/this.aspectRatio,t=Math.max(0-this.cropper.x1,0),e=Math.max(0-this.cropper.y1,0),(t>0||e>0)&&(this.cropper.x1+=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y1+=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"topright":this.cropper.y1=this.cropper.y2-(this.cropper.x2-this.cropper.x1)/this.aspectRatio,t=Math.max(this.cropper.x2-this.maxSize.width,0),e=Math.max(0-this.cropper.y1,0),(t>0||e>0)&&(this.cropper.x2-=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y1+=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"right":case"bottomright":this.cropper.y2=this.cropper.y1+(this.cropper.x2-this.cropper.x1)/this.aspectRatio,t=Math.max(this.cropper.x2-this.maxSize.width,0),e=Math.max(this.cropper.y2-this.maxSize.height,0),(t>0||e>0)&&(this.cropper.x2-=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y2-=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"left":case"bottomleft":this.cropper.y2=this.cropper.y1+(this.cropper.x2-this.cropper.x1)/this.aspectRatio,t=Math.max(0-this.cropper.x1,0),e=Math.max(this.cropper.y2-this.maxSize.height,0),(t>0||e>0)&&(this.cropper.x1+=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y2-=e*this.aspectRatio>t?e:t/this.aspectRatio)}},t.prototype.doAutoCrop=function(){this.autoCrop&&this.crop()},t.prototype.crop=function(t){if(void 0===t&&(t=this.outputType),this.sourceImage.nativeElement&&null!=this.originalImage){this.startCropImage.emit();var e=this.getImagePosition(),i=e.x2-e.x1,r=e.y2-e.y1,s=document.createElement("canvas");s.width=i,s.height=r;var p=s.getContext("2d");if(p){null!=this.backgroundColor&&(p.fillStyle=this.backgroundColor,p.fillRect(0,0,i,r)),p.drawImage(this.originalImage,e.x1,e.y1,i,r,0,0,i,r);var a={width:i,height:r,imagePosition:e,cropperPosition:o({},this.cropper)},n=this.getResizeRatio(i,r);return 1!==n&&(a.width=Math.round(i*n),a.height=this.maintainAspectRatio?Math.round(a.width/this.aspectRatio):Math.round(r*n),function(t,e,i,r){void 0===r&&(r=!0);var o=t.width,s=t.height,p=o/(e=Math.round(e)),a=s/(i=Math.round(i)),n=Math.ceil(p/2),h=Math.ceil(a/2),c=t.getContext("2d");if(c){for(var g=c.getImageData(0,0,o,s),l=c.createImageData(e,i),m=g.data,d=l.data,u=0;u<i;u++)for(var f=0;f<e;f++){var y=4*(f+u*e),v=u*a,x=0,b=0,z=0,S=0,M=0,w=0,I=0,R=Math.floor(f*p),C=Math.floor(u*a),A=Math.ceil((f+1)*p),k=Math.ceil((u+1)*a);A=Math.min(A,o),k=Math.min(k,s);for(var O=C;O<k;O++)for(var H=Math.abs(v-O)/h,j=f*p,E=H*H,W=R;W<A;W++){var T=Math.abs(j-W)/n,B=Math.sqrt(E+T*T);if(!(B>=1)){var P=4*(W+O*o);I+=(x=2*B*B*B-3*B*B+1)*m[P+3],z+=x,m[P+3]<255&&(x=x*m[P+3]/250),S+=x*m[P],M+=x*m[P+1],w+=x*m[P+2],b+=x}}d[y]=S/b,d[y+1]=M/b,d[y+2]=w/b,d[y+3]=I/z}r?(t.width=e,t.height=i):c.clearRect(0,0,o,s),c.putImageData(l,0,0)}}(s,a.width,a.height)),this.cropToOutputType(t,s,a)}}return null},t.prototype.getImagePosition=function(){var t=this.sourceImage.nativeElement,e=this.originalSize.width/t.offsetWidth;return{x1:Math.round(this.cropper.x1*e),y1:Math.round(this.cropper.y1*e),x2:Math.min(Math.round(this.cropper.x2*e),this.originalSize.width),y2:Math.min(Math.round(this.cropper.y2*e),this.originalSize.height)}},t.prototype.cropToOutputType=function(t,e,i){var r=this;switch(t){case"file":return this.cropToFile(e).then((function(t){return i.file=t,r.imageCropped.emit(i),i}));case"both":return i.base64=this.cropToBase64(e),this.cropToFile(e).then((function(t){return i.file=t,r.imageCropped.emit(i),i}));default:return i.base64=this.cropToBase64(e),this.imageCropped.emit(i),i}},t.prototype.cropToBase64=function(t){var e=t.toDataURL("image/"+this.format,this.getQuality());return this.imageCroppedBase64.emit(e),e},t.prototype.cropToFile=function(t){var e=this;return this.getCanvasBlob(t).then((function(t){return t&&e.imageCroppedFile.emit(t),t}))},t.prototype.getCanvasBlob=function(t){var e=this;return new Promise((function(i){t.toBlob((function(t){return e.zone.run((function(){return i(t)}))}),"image/"+e.format,e.getQuality())}))},t.prototype.getQuality=function(){return Math.min(1,Math.max(0,this.imageQuality/100))},t.prototype.getResizeRatio=function(t,e){if(this.resizeToWidth>0){if(!this.onlyScaleDown||t>this.resizeToWidth)return this.resizeToWidth/t}else if(this.resizeToHeight>0&&(!this.onlyScaleDown||e>this.resizeToHeight))return this.resizeToHeight/e;return 1},t.prototype.getClientX=function(t){return t.touches&&t.touches[0]&&t.touches[0].clientX||t.clientX},t.prototype.getClientY=function(t){return t.touches&&t.touches[0]&&t.touches[0].clientY||t.clientY},t.ctorParameters=function(){return[{type:r.DomSanitizer},{type:e.ChangeDetectorRef},{type:e.NgZone}]},s([e.ViewChild("sourceImage",{static:!1}),p("design:type",e.ElementRef)],t.prototype,"sourceImage",void 0),s([e.Input(),p("design:type",File),p("design:paramtypes",[File])],t.prototype,"imageFileChanged",null),s([e.Input(),p("design:type",Object),p("design:paramtypes",[Object])],t.prototype,"imageChangedEvent",null),s([e.Input(),p("design:type",String),p("design:paramtypes",[String])],t.prototype,"imageBase64",null),s([e.Input(),p("design:type",String)],t.prototype,"format",void 0),s([e.Input(),p("design:type",String)],t.prototype,"outputType",void 0),s([e.Input(),p("design:type",Object)],t.prototype,"maintainAspectRatio",void 0),s([e.Input(),p("design:type",Object)],t.prototype,"aspectRatio",void 0),s([e.Input(),p("design:type",Object)],t.prototype,"resizeToWidth",void 0),s([e.Input(),p("design:type",Object)],t.prototype,"resizeToHeight",void 0),s([e.Input(),p("design:type",Object)],t.prototype,"cropperMinWidth",void 0),s([e.Input(),p("design:type",Object)],t.prototype,"cropperMinHeight",void 0),s([e.Input(),p("design:type",Object)],t.prototype,"roundCropper",void 0),s([e.Input(),p("design:type",Object)],t.prototype,"onlyScaleDown",void 0),s([e.Input(),p("design:type",Object)],t.prototype,"imageQuality",void 0),s([e.Input(),p("design:type",Object)],t.prototype,"autoCrop",void 0),s([e.Input(),p("design:type",String)],t.prototype,"backgroundColor",void 0),s([e.Input(),p("design:type",Object)],t.prototype,"containWithinAspectRatio",void 0),s([e.Input(),p("design:type",Object)],t.prototype,"cropper",void 0),s([e.HostBinding("style.text-align"),e.Input(),p("design:type",String)],t.prototype,"alignImage",void 0),s([e.Output(),p("design:type",Object)],t.prototype,"startCropImage",void 0),s([e.Output(),p("design:type",Object)],t.prototype,"imageCropped",void 0),s([e.Output(),p("design:type",Object)],t.prototype,"imageCroppedBase64",void 0),s([e.Output(),p("design:type",Object)],t.prototype,"imageCroppedFile",void 0),s([e.Output(),p("design:type",Object)],t.prototype,"imageLoaded",void 0),s([e.Output(),p("design:type",Object)],t.prototype,"cropperReady",void 0),s([e.Output(),p("design:type",Object)],t.prototype,"loadImageFailed",void 0),s([e.HostListener("window:resize"),p("design:type",Function),p("design:paramtypes",[]),p("design:returntype",void 0)],t.prototype,"onResize",null),s([e.HostListener("document:mousemove",["$event"]),e.HostListener("document:touchmove",["$event"]),p("design:type",Function),p("design:paramtypes",[Object]),p("design:returntype",void 0)],t.prototype,"moveImg",null),s([e.HostListener("document:mouseup"),e.HostListener("document:touchend"),p("design:type",Function),p("design:paramtypes",[]),p("design:returntype",void 0)],t.prototype,"moveStop",null),t=s([e.Component({selector:"image-cropper",template:'<div [style.background]="imageVisible && backgroundColor">\n <img\n #sourceImage\n class="source-image"\n [src]="safeImgDataUrl"\n [style.visibility]="imageVisible ? \'visible\' : \'hidden\'"\n (load)="imageLoadedInView()"\n />\n <div class="cropper"\n *ngIf="imageVisible"\n [class.rounded]="roundCropper"\n [style.top.px]="cropper.y1"\n [style.left.px]="cropper.x1"\n [style.width.px]="cropper.x2 - cropper.x1"\n [style.height.px]="cropper.y2 - cropper.y1"\n [style.margin-left]="alignImage === \'center\' ? marginLeft : null"\n [style.visibility]="imageVisible ? \'visible\' : \'hidden\'"\n >\n <div\n (mousedown)="startMove($event, \'move\')"\n (touchstart)="startMove($event, \'move\')"\n class="move"\n >&nbsp;</div>\n <span\n class="resize topleft"\n (mousedown)="startMove($event, \'resize\', \'topleft\')"\n (touchstart)="startMove($event, \'resize\', \'topleft\')"\n ><span class="square"></span></span>\n <span\n class="resize top"\n ><span class="square"></span></span>\n <span\n class="resize topright"\n (mousedown)="startMove($event, \'resize\', \'topright\')"\n (touchstart)="startMove($event, \'resize\', \'topright\')"\n ><span class="square"></span></span>\n <span\n class="resize right"\n ><span class="square"></span></span>\n <span\n class="resize bottomright"\n (mousedown)="startMove($event, \'resize\', \'bottomright\')"\n (touchstart)="startMove($event, \'resize\', \'bottomright\')"\n ><span class="square"></span></span>\n <span\n class="resize bottom"\n ><span class="square"></span></span>\n <span\n class="resize bottomleft"\n (mousedown)="startMove($event, \'resize\', \'bottomleft\')"\n (touchstart)="startMove($event, \'resize\', \'bottomleft\')"\n ><span class="square"></span></span>\n <span\n class="resize left"\n ><span class="square"></span></span>\n <span\n class="resize-bar top"\n (mousedown)="startMove($event, \'resize\', \'top\')"\n (touchstart)="startMove($event, \'resize\', \'top\')"\n ></span>\n <span\n class="resize-bar right"\n (mousedown)="startMove($event, \'resize\', \'right\')"\n (touchstart)="startMove($event, \'resize\', \'right\')"\n ></span>\n <span\n class="resize-bar bottom"\n (mousedown)="startMove($event, \'resize\', \'bottom\')"\n (touchstart)="startMove($event, \'resize\', \'bottom\')"\n ></span>\n <span\n class="resize-bar left"\n (mousedown)="startMove($event, \'resize\', \'left\')"\n (touchstart)="startMove($event, \'resize\', \'left\')"\n ></span>\n </div>\n</div>\n',changeDetection:e.ChangeDetectionStrategy.OnPush,styles:[':host{display:flex;position:relative;width:100%;max-width:100%;max-height:100%;overflow:hidden;padding:5px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host>div{position:relative;width:100%}:host>div img.source-image{max-width:100%;max-height:100%}:host .cropper{position:absolute;display:flex;color:#53535c;background:0 0;touch-action:none;outline:rgba(255,255,255,.3) solid 100vw}:host .cropper:after{position:absolute;content:"";top:0;bottom:0;left:0;right:0;pointer-events:none;border:1px dashed;opacity:.75;color:inherit;z-index:1}:host .cropper .move{width:100%;cursor:move;border:1px solid rgba(255,255,255,.5)}:host .cropper .resize{position:absolute;display:inline-block;line-height:6px;padding:8px;opacity:.85;z-index:1}:host .cropper .resize .square{display:inline-block;background:#53535c;width:6px;height:6px;border:1px solid rgba(255,255,255,.5);box-sizing:content-box}:host .cropper .resize.topleft{top:-12px;left:-12px;cursor:nwse-resize}:host .cropper .resize.top{top:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .cropper .resize.topright{top:-12px;right:-12px;cursor:nesw-resize}:host .cropper .resize.right{top:calc(50% - 12px);right:-12px;cursor:ew-resize}:host .cropper .resize.bottomright{bottom:-12px;right:-12px;cursor:nwse-resize}:host .cropper .resize.bottom{bottom:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .cropper .resize.bottomleft{bottom:-12px;left:-12px;cursor:nesw-resize}:host .cropper .resize.left{top:calc(50% - 12px);left:-12px;cursor:ew-resize}:host .cropper .resize-bar{position:absolute;z-index:1}:host .cropper .resize-bar.top{top:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .cropper .resize-bar.right{top:11px;right:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .cropper .resize-bar.bottom{bottom:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .cropper .resize-bar.left{top:11px;left:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .cropper.rounded{outline-color:transparent}:host .cropper.rounded:after{border-radius:100%;box-shadow:0 0 0 100vw rgba(255,255,255,.3)}@media (orientation:portrait){:host .cropper{outline-width:100vh}:host .cropper.rounded:after{box-shadow:0 0 0 100vh rgba(255,255,255,.3)}}:host .cropper.rounded .move{border-radius:100%}']}),p("design:paramtypes",[r.DomSanitizer,e.ChangeDetectorRef,e.NgZone])],t)}(),c=function(){function t(){}return t=s([e.NgModule({imports:[i.CommonModule],declarations:[h],exports:[h]})],t)}();t.ImageCropperComponent=h,t.ImageCropperModule=c,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=ngx-image-cropper.umd.min.js.map

@@ -1,8 +0,3 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
export { ImageCropperModule } from './src/image-cropper.module';
export { ImageCropperComponent } from './src/component/image-cropper.component';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUNoRSxPQUFPLEVBQWMscUJBQXFCLEVBQUUsTUFBTSx5Q0FBeUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB7IEltYWdlQ3JvcHBlck1vZHVsZSB9IGZyb20gJy4vc3JjL2ltYWdlLWNyb3BwZXIubW9kdWxlJztcbmV4cG9ydCB7IE91dHB1dFR5cGUsIEltYWdlQ3JvcHBlckNvbXBvbmVudCB9IGZyb20gJy4vc3JjL2NvbXBvbmVudC9pbWFnZS1jcm9wcGVyLmNvbXBvbmVudCc7XG5leHBvcnQgeyBDcm9wcGVyUG9zaXRpb24sIEltYWdlQ3JvcHBlZEV2ZW50IH0gZnJvbSAnLi9zcmMvaW50ZXJmYWNlcyc7XG4iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQ2hFLE9BQU8sRUFBYyxxQkFBcUIsRUFBRSxNQUFNLHlDQUF5QyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgSW1hZ2VDcm9wcGVyTW9kdWxlIH0gZnJvbSAnLi9zcmMvaW1hZ2UtY3JvcHBlci5tb2R1bGUnO1xuZXhwb3J0IHsgT3V0cHV0VHlwZSwgSW1hZ2VDcm9wcGVyQ29tcG9uZW50IH0gZnJvbSAnLi9zcmMvY29tcG9uZW50L2ltYWdlLWNyb3BwZXIuY29tcG9uZW50JztcbmV4cG9ydCB7IENyb3BwZXJQb3NpdGlvbiwgSW1hZ2VDcm9wcGVkRXZlbnQgfSBmcm9tICcuL3NyYy9pbnRlcmZhY2VzJztcbiJdfQ==
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
/**
* Generated bundle index. Do not edit.
*/
export { ImageCropperModule, ImageCropperComponent } from './index';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWltYWdlLWNyb3BwZXIuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbIm5neC1pbWFnZS1jcm9wcGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSwwREFBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
export * from './index';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWltYWdlLWNyb3BwZXIuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbIm5neC1pbWFnZS1jcm9wcGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19

@@ -1,24 +0,21 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
import * as tslib_1 from "tslib";
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ImageCropperComponent } from './component/image-cropper.component';
export class ImageCropperModule {
}
ImageCropperModule.decorators = [
{ type: NgModule, args: [{
imports: [
CommonModule
],
declarations: [
ImageCropperComponent
],
exports: [
ImageCropperComponent
]
},] }
];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW1hZ2UtY3JvcHBlci5tb2R1bGUuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbInNyYy9pbWFnZS1jcm9wcGVyLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDL0MsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0scUNBQXFDLENBQUM7QUFhNUUsTUFBTTs7O1lBWEwsUUFBUSxTQUFDO2dCQUNOLE9BQU8sRUFBRTtvQkFDTCxZQUFZO2lCQUNmO2dCQUNELFlBQVksRUFBRTtvQkFDVixxQkFBcUI7aUJBQ3hCO2dCQUNELE9BQU8sRUFBRTtvQkFDTCxxQkFBcUI7aUJBQ3hCO2FBQ0oiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgQ29tbW9uTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29tbW9uJztcbmltcG9ydCB7IEltYWdlQ3JvcHBlckNvbXBvbmVudCB9IGZyb20gJy4vY29tcG9uZW50L2ltYWdlLWNyb3BwZXIuY29tcG9uZW50JztcblxuQE5nTW9kdWxlKHtcbiAgICBpbXBvcnRzOiBbXG4gICAgICAgIENvbW1vbk1vZHVsZVxuICAgIF0sXG4gICAgZGVjbGFyYXRpb25zOiBbXG4gICAgICAgIEltYWdlQ3JvcHBlckNvbXBvbmVudFxuICAgIF0sXG4gICAgZXhwb3J0czogW1xuICAgICAgICBJbWFnZUNyb3BwZXJDb21wb25lbnRcbiAgICBdXG59KVxuZXhwb3J0IGNsYXNzIEltYWdlQ3JvcHBlck1vZHVsZSB7fVxuIl19
let ImageCropperModule = class ImageCropperModule {
};
ImageCropperModule = tslib_1.__decorate([
NgModule({
imports: [
CommonModule
],
declarations: [
ImageCropperComponent
],
exports: [
ImageCropperComponent
]
})
], ImageCropperModule);
export { ImageCropperModule };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW1hZ2UtY3JvcHBlci5tb2R1bGUuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbInNyYy9pbWFnZS1jcm9wcGVyLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDL0MsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0scUNBQXFDLENBQUM7QUFhNUUsSUFBYSxrQkFBa0IsR0FBL0IsTUFBYSxrQkFBa0I7Q0FBRyxDQUFBO0FBQXJCLGtCQUFrQjtJQVg5QixRQUFRLENBQUM7UUFDTixPQUFPLEVBQUU7WUFDTCxZQUFZO1NBQ2Y7UUFDRCxZQUFZLEVBQUU7WUFDVixxQkFBcUI7U0FDeEI7UUFDRCxPQUFPLEVBQUU7WUFDTCxxQkFBcUI7U0FDeEI7S0FDSixDQUFDO0dBQ1csa0JBQWtCLENBQUc7U0FBckIsa0JBQWtCIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IENvbW1vbk1vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvbW1vbic7XG5pbXBvcnQgeyBJbWFnZUNyb3BwZXJDb21wb25lbnQgfSBmcm9tICcuL2NvbXBvbmVudC9pbWFnZS1jcm9wcGVyLmNvbXBvbmVudCc7XG5cbkBOZ01vZHVsZSh7XG4gICAgaW1wb3J0czogW1xuICAgICAgICBDb21tb25Nb2R1bGVcbiAgICBdLFxuICAgIGRlY2xhcmF0aW9uczogW1xuICAgICAgICBJbWFnZUNyb3BwZXJDb21wb25lbnRcbiAgICBdLFxuICAgIGV4cG9ydHM6IFtcbiAgICAgICAgSW1hZ2VDcm9wcGVyQ29tcG9uZW50XG4gICAgXVxufSlcbmV4cG9ydCBjbGFzcyBJbWFnZUNyb3BwZXJNb2R1bGUge31cbiJdfQ==

@@ -1,18 +0,1 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
/**
* @record
*/
export function CropperPosition() { }
/** @type {?} */
CropperPosition.prototype.x1;
/** @type {?} */
CropperPosition.prototype.y1;
/** @type {?} */
CropperPosition.prototype.x2;
/** @type {?} */
CropperPosition.prototype.y2;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JvcHBlci1wb3NpdGlvbi5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbInNyYy9pbnRlcmZhY2VzL2Nyb3BwZXItcG9zaXRpb24uaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIENyb3BwZXJQb3NpdGlvbiB7XG4gICAgeDE6IG51bWJlcjtcbiAgICB5MTogbnVtYmVyO1xuICAgIHgyOiBudW1iZXI7XG4gICAgeTI6IG51bWJlcjtcbn0iXX0=

@@ -1,14 +0,1 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
/**
* @record
*/
export function Dimensions() { }
/** @type {?} */
Dimensions.prototype.width;
/** @type {?} */
Dimensions.prototype.height;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGltZW5zaW9ucy5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbInNyYy9pbnRlcmZhY2VzL2RpbWVuc2lvbnMuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIERpbWVuc2lvbnMge1xuICAgIHdpZHRoOiBudW1iZXI7XG4gICAgaGVpZ2h0OiBudW1iZXI7XG59Il19

@@ -1,22 +0,1 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
/**
* @record
*/
export function ImageCroppedEvent() { }
/** @type {?|undefined} */
ImageCroppedEvent.prototype.base64;
/** @type {?|undefined} */
ImageCroppedEvent.prototype.file;
/** @type {?} */
ImageCroppedEvent.prototype.width;
/** @type {?} */
ImageCroppedEvent.prototype.height;
/** @type {?} */
ImageCroppedEvent.prototype.cropperPosition;
/** @type {?} */
ImageCroppedEvent.prototype.imagePosition;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW1hZ2UtY3JvcHBlZC1ldmVudC5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbInNyYy9pbnRlcmZhY2VzL2ltYWdlLWNyb3BwZWQtZXZlbnQuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDcm9wcGVyUG9zaXRpb24gfSBmcm9tIFwiLi9jcm9wcGVyLXBvc2l0aW9uLmludGVyZmFjZVwiO1xuXG5leHBvcnQgaW50ZXJmYWNlIEltYWdlQ3JvcHBlZEV2ZW50IHtcbiAgICBiYXNlNjQ/OiBzdHJpbmcgfCBudWxsO1xuICAgIGZpbGU/OiBCbG9iIHwgbnVsbDtcbiAgICB3aWR0aDogbnVtYmVyO1xuICAgIGhlaWdodDogbnVtYmVyO1xuICAgIGNyb3BwZXJQb3NpdGlvbjogQ3JvcHBlclBvc2l0aW9uO1xuICAgIGltYWdlUG9zaXRpb246IENyb3BwZXJQb3NpdGlvbjtcbn0iXX0=

@@ -1,6 +0,1 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbInNyYy9pbnRlcmZhY2VzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBDcm9wcGVyUG9zaXRpb24gfSBmcm9tICcuL2Nyb3BwZXItcG9zaXRpb24uaW50ZXJmYWNlJztcbmV4cG9ydCB7IERpbWVuc2lvbnMgfSBmcm9tICcuL2RpbWVuc2lvbnMuaW50ZXJmYWNlJztcbmV4cG9ydCB7IEltYWdlQ3JvcHBlZEV2ZW50IH0gZnJvbSAnLi9pbWFnZS1jcm9wcGVkLWV2ZW50LmludGVyZmFjZSc7XG5leHBvcnQgeyBNb3ZlU3RhcnQgfSBmcm9tICcuL21vdmUtc3RhcnQuaW50ZXJmYWNlJztcbiJdfQ==

@@ -1,28 +0,1 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
/**
* @record
*/
export function MoveStart() { }
/** @type {?} */
MoveStart.prototype.active;
/** @type {?} */
MoveStart.prototype.type;
/** @type {?} */
MoveStart.prototype.position;
/** @type {?} */
MoveStart.prototype.x1;
/** @type {?} */
MoveStart.prototype.y1;
/** @type {?} */
MoveStart.prototype.x2;
/** @type {?} */
MoveStart.prototype.y2;
/** @type {?} */
MoveStart.prototype.clientX;
/** @type {?} */
MoveStart.prototype.clientY;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW92ZS1zdGFydC5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbInNyYy9pbnRlcmZhY2VzL21vdmUtc3RhcnQuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIE1vdmVTdGFydCB7XG4gICAgYWN0aXZlOiBib29sZWFuO1xuICAgIHR5cGU6IHN0cmluZyB8IG51bGw7XG4gICAgcG9zaXRpb246IHN0cmluZyB8IG51bGw7XG4gICAgeDE6IG51bWJlcjtcbiAgICB5MTogbnVtYmVyO1xuICAgIHgyOiBudW1iZXI7XG4gICAgeTI6IG51bWJlcjtcbiAgICBjbGllbnRYOiBudW1iZXI7XG4gICAgY2xpZW50WTogbnVtYmVyO1xufVxuIl19

@@ -1,12 +0,3 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
/**
* @param {?} srcBase64
* @return {?}
*/
export function resetExifOrientation(srcBase64) {
try {
/** @type {?} */
const exifRotation = getExifRotation(srcBase64);

@@ -24,19 +15,9 @@ if (exifRotation > 1) {

}
/**
* @param {?} srcBase64
* @param {?} exifRotation
* @return {?}
*/
export function transformBase64BasedOnExifRotation(srcBase64, exifRotation) {
return new Promise((resolve, reject) => {
/** @type {?} */
const img = new Image();
img.onload = function () {
/** @type {?} */
const width = img.width;
/** @type {?} */
const height = img.height;
/** @type {?} */
const canvas = document.createElement('canvas');
/** @type {?} */
const ctx = canvas.getContext('2d');

@@ -63,8 +44,3 @@ if (ctx) {

}
/**
* @param {?} imageBase64
* @return {?}
*/
function getExifRotation(imageBase64) {
/** @type {?} */
const view = new DataView(base64ToArrayBuffer(imageBase64));

@@ -74,5 +50,3 @@ if (view.getUint16(0, false) != 0xFFD8) {

}
/** @type {?} */
const length = view.byteLength;
/** @type {?} */
let offset = 2;

@@ -82,3 +56,2 @@ while (offset < length) {

return -1;
/** @type {?} */
const marker = view.getUint16(offset, false);

@@ -90,6 +63,4 @@ offset += 2;

}
/** @type {?} */
const little = view.getUint16(offset += 6, false) == 0x4949;
offset += view.getUint32(offset + 4, little);
/** @type {?} */
const tags = view.getUint16(offset, little);

@@ -112,13 +83,6 @@ offset += 2;

}
/**
* @param {?} imageBase64
* @return {?}
*/
function base64ToArrayBuffer(imageBase64) {
imageBase64 = imageBase64.replace(/^data\:([^\;]+)\;base64,/gmi, '');
/** @type {?} */
const binaryString = atob(imageBase64);
/** @type {?} */
const len = binaryString.length;
/** @type {?} */
const bytes = new Uint8Array(len);

@@ -130,9 +94,2 @@ for (let i = 0; i < len; i++) {

}
/**
* @param {?} ctx
* @param {?} orientation
* @param {?} width
* @param {?} height
* @return {?}
*/
function transformCanvas(ctx, orientation, width, height) {

@@ -163,3 +120,2 @@ switch (orientation) {

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhpZi51dGlscy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1pbWFnZS1jcm9wcGVyLyIsInNvdXJjZXMiOlsic3JjL3V0aWxzL2V4aWYudXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7QUFBQSxNQUFNLCtCQUErQixTQUFpQjtJQUNsRCxJQUFJLENBQUM7O1FBQ0QsTUFBTSxZQUFZLEdBQUcsZUFBZSxDQUFDLFNBQVMsQ0FBQyxDQUFDO1FBQ2hELEVBQUUsQ0FBQyxDQUFDLFlBQVksR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDO1lBQ25CLE1BQU0sQ0FBQyxrQ0FBa0MsQ0FBQyxTQUFTLEVBQUUsWUFBWSxDQUFDLENBQUM7U0FDdEU7UUFBQyxJQU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PSBuZXcgSW1hZ2UoKTtcbiAgICAgICAgaW1nLm9ubG9hZCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGNvbnN0IHdpZHRoID0gaW1nLndpZHRoO1xuICAgICAgICAgICAgY29uc3QgaGVpZ2h0ID0gaW1nLmhlaWdodDtcbiAgICAgICAgICAgIGNvbnN0IGNhbnZhcyA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2NhbnZhcycpO1xuICAgICAgICAgICAgY29uc3QgY3R4ID0gY2FudmFzLmdldENvbnRleHQoJzJkJyk7XG5cbiAgICAgICAgICAgIGlmIChjdHgpIHtcbiAgICAgICAgICAgICAgICBpZiAoNCA8IGV4aWZSb3RhdGlvbiAmJiBleGlmUm90YXRpb24gPCA5KSB7XG4gICAgICAgICAgICAgICAgICAgIGNhbnZhcy53aWR0aCA9IGhlaWdodDtcbiAgICAgICAgICAgICAgICAgICAgY2FudmFzLmhlaWdodCA9IHdpZHRoO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGNhbnZhcy53aWR0aCA9IHdpZHRoO1xuICAgICAgICAgICAgICAgICAgICBjYW52YXMuaGVpZ2h0ID0gaGVpZ2h0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0cmFuc2Zvcm1DYW52YXMoY3R4LCBleGlmUm90YXRpb24sIHdpZHRoLCBoZWlnaHQpO1xuICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoaW1nLCAwLCAwKTtcbiAgICAgICAgICAgICAgICByZXNvbHZlKGNhbnZhcy50b0RhdGFVUkwoKSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJlamVjdChuZXcgRXJyb3IoJ05vIGNvbnRleHQnKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIGltZy5zcmMgPSBzcmNCYXNlNjQ7XG4gICAgfSk7XG59XG5cbmZ1bmN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GVpZ2h0OiBudW1iZXIpIHtcbiAgICBzd2l0Y2ggKG9yaWVudGF0aW9uKSB7XG4gICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgIGN0eC50cmFuc2Zvcm0oLTEsIDAsIDAsIDEsIHdpZHRoLCAwKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICBjdHgudHJhbnNmb3JtKC0xLCAwLCAwLCAtMSwgd2lkdGgsIGhlaWdodCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgY3R4LnRyYW5zZm9ybSgxLCAwLCAwLCAtMSwgMCwgaGVpZ2h0KTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICBjdHgudHJhbnNmb3JtKDAsIDEsIDEsIDAsIDAsIDApO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgIGN0eC50cmFuc2Zvcm0oMCwgMSwgLTEsIDAsIGhlaWdodCwgMCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSA3OlxuICAgICAgICAgICAgY3R4LnRyYW5zZm9ybSgwLCAtMSwgLTEsIDAsIGhlaWdodCwgd2lkdGgpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgODpcbiAgICAgICAgICAgIGN0eC50cmFuc2Zvcm0oMCwgLTEsIDEsIDAsIDAsIHdpZHRoKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgIH1cbn1cbiJdfQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhpZi51dGlscy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1pbWFnZS1jcm9wcGVyLyIsInNvdXJjZXMiOlsic3JjL3V0aWxzL2V4aWYudXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5nc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IGNvbnN0IGN0eCA9IGNhbnZhcy5nZXRDb250ZXh0KCcyZCcpO1xuXG4gICAgICAgICAgICBpZiAoY3R4KSB7XG4gICAgICAgICAgICAgICAgaWYgKDQgPCBleGlmUm90YXRpb24gJiYgZXhpZlJvdGF0aW9uIDwgOSkge1xuICAgICAgICAgICAgICAgICAgICBjYW52YXMud2lkdGggPSBoZWlnaHQ7XG4gICAgICAgICAgICAgICAgICAgIGNhbnZhcy5oZWlnaHQgPSB3aWR0aDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBjYW52YXMud2lkdGggPSB3aWR0aDtcbiAgICAgICAgICAgICAgICAgICAgY2FudmFzLmhlaWdodCA9IGhlaWdodDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdHJhbnNmb3JtQ2FudmFzKGN0eCwgZXhpZlJvdGF0aW9uLCB3aWR0aCwgaGVpZ2h0KTtcbiAgICAgICAgICAgICAgICBjdHguZHJhd0ltYWdlKGltZywgMCwgMCk7XG4gICAgICAgICAgICAgICAgcmVzb2x2ZShjYW52YXMudG9EYXRhVVJMKCkpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZWplY3QobmV3IEVycm9yKCdObyBjb250ZXh0JykpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBpbWcuc3JjID0gc3JjQmFzZTY0O1xuICAgIH0pO1xufVxuXG5mdW5jdGlvbiBnZXRFeGlmUm90YXRpb24oaW1hZ2VCYXNlNjQ6IHN0cmluZyk6IG51bWJlciB7XG4gICAgY29uc3QgdmlldyA9IG5ldyBEYXRhVmlldyhiYXNlNjRUb0FycmF5QnVmZmVyKGltYWdlQmFzZTY0KSk7XG4gICAgaWYgKHZpZXcuZ2V0VWludDE2KDAsIGZhbHNlKSAhPSAweEZGRDgpIHtcbiAgICAgICAgcmV0dXJuIC0yO1xuICAgIH1cbiAgICBjb25zdCBsZW5ndGggPSB2aWV3LmJ5dGVMZW5ndGg7XG4gICAgbGV0IG9mZnNldCA9IDI7XG4gICAgd2hpbGUgKG9mZnNldCA8IGxlbmd0aCkge1xuICAgICAgICBpZiAodmlldy5nZXRVaW50MTYob2Zmc2V0ICsgMiwgZmFsc2UpIDw9IDgpIHJldHVybiAtMTtcbiAgICAgICAgY29uc3QgbWFya2VyID0gdmlldy5nZXRVaW50MTYob2Zmc2V0LCBmYWxzZSk7XG4gICAgICAgIG9mZnNldCArPSAyO1xuICAgICAgICBpZiAobWFya2VyID09IDB4RkZFMSkge1xuICAgICAgICAgICAgaWYgKHZpZXcuZ2V0VWludDMyKG9mZnNldCArPSAyLCBmYWxzZSkgIT0gMHg0NTc4Njk2Nikge1xuICAgICAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY29uc3QgbGl0dGxlID0gdmlldy5nZXRVaW50MTYob2Zmc2V0ICs9IDYsIGZhbHNlKSA9PSAweDQ5NDk7XG4gICAgICAgICAgICBvZmZzZXQgKz0gdmlldy5nZXRVaW50MzIob2Zmc2V0ICsgNCwgbGl0dGxlKTtcbiAgICAgICAgICAgIGNvbnN0IHRhZ3MgPSB2aWV3LmdldFVpbnQxNihvZmZzZXQsIGxpdHRsZSk7XG4gICAgICAgICAgICBvZmZzZXQgKz0gMjtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGFnczsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHZpZXcuZ2V0VWludDE2KG9mZnNldCArIChpICogMTIpLCBsaXR0bGUpID09IDB4MDExMikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmlldy5nZXRVaW50MTYob2Zmc2V0ICsgKGkgKiAxMikgKyA4LCBsaXR0bGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICgobWFya2VyICYgMHhGRjAwKSAhPSAweEZ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Nhc2UgNDpcbiAgICAgICAgICAgIGN0eC50cmFuc2Zvcm0oMSwgMCwgMCwgLTEsIDAsIGhlaWdodCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgY3R4LnRyYW5zZm9ybSgwLCAxLCAxLCAwLCAwLCAwKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICBjdHgudHJhbnNmb3JtKDAsIDEsIC0xLCAwLCBoZWlnaHQsIDApO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgNzpcbiAgICAgICAgICAgIGN0eC50cmFuc2Zvcm0oMCwgLTEsIC0xLCAwLCBoZWlnaHQsIHdpZHRoKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDg6XG4gICAgICAgICAgICBjdHgudHJhbnNmb3JtKDAsIC0xLCAxLCAwLCAwLCB3aWR0aCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICB9XG59XG4iXX0=

@@ -1,5 +0,1 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
/*

@@ -9,62 +5,31 @@ * Hermite resize - fast image resize/resample using Hermite filter.

*/
/**
* @param {?} canvas
* @param {?} width
* @param {?} height
* @param {?=} resizeCanvas
* @return {?}
*/
export function resizeCanvas(canvas, width, height, resizeCanvas = true) {
/** @type {?} */
const width_source = canvas.width;
/** @type {?} */
const height_source = canvas.height;
width = Math.round(width);
height = Math.round(height);
/** @type {?} */
const ratio_w = width_source / width;
/** @type {?} */
const ratio_h = height_source / height;
/** @type {?} */
const ratio_w_half = Math.ceil(ratio_w / 2);
/** @type {?} */
const ratio_h_half = Math.ceil(ratio_h / 2);
/** @type {?} */
const ctx = canvas.getContext('2d');
if (ctx) {
/** @type {?} */
const img = ctx.getImageData(0, 0, width_source, height_source);
/** @type {?} */
const img2 = ctx.createImageData(width, height);
/** @type {?} */
const data = img.data;
/** @type {?} */
const data2 = img2.data;
for (let j = 0; j < height; j++) {
for (let i = 0; i < width; i++) {
/** @type {?} */
const x2 = (i + j * width) * 4;
/** @type {?} */
const center_y = j * ratio_h;
/** @type {?} */
let weight = 0;
/** @type {?} */
let weights = 0;
/** @type {?} */
let weights_alpha = 0;
/** @type {?} */
let gx_r = 0;
/** @type {?} */
let gx_g = 0;
/** @type {?} */
let gx_b = 0;
/** @type {?} */
let gx_a = 0;
/** @type {?} */
const xx_start = Math.floor(i * ratio_w);
/** @type {?} */
const yy_start = Math.floor(j * ratio_h);
/** @type {?} */
let xx_stop = Math.ceil((i + 1) * ratio_w);
/** @type {?} */
let yy_stop = Math.ceil((j + 1) * ratio_h);

@@ -74,12 +39,7 @@ xx_stop = Math.min(xx_stop, width_source);

for (let yy = yy_start; yy < yy_stop; yy++) {
/** @type {?} */
const dy = Math.abs(center_y - yy) / ratio_h_half;
/** @type {?} */
const center_x = i * ratio_w;
/** @type {?} */
const w0 = dy * dy; //pre-calc part of w
for (let xx = xx_start; xx < xx_stop; xx++) {
/** @type {?} */
const dx = Math.abs(center_x - xx) / ratio_w_half;
/** @type {?} */
const w = Math.sqrt(w0 + dx * dx);

@@ -92,3 +52,2 @@ if (w >= 1) {

weight = 2 * w * w * w - 3 * w * w + 1;
/** @type {?} */
const pos_x = 4 * (xx + yy * width_source);

@@ -125,26 +84,14 @@ //alpha

}
/**
* @param {?} srcBase64
* @param {?} aspectRatio
* @return {?}
*/
export function fitImageToAspectRatio(srcBase64, aspectRatio) {
return new Promise((resolve, reject) => {
/** @type {?} */
const img = new Image();
img.onload = function () {
/** @type {?} */
const canvas = document.createElement('canvas');
/** @type {?} */
const ctx = canvas.getContext('2d');
if (ctx) {
/** @type {?} */
const minWidthToContain = img.height * aspectRatio;
/** @type {?} */
const minHeightToContain = img.width / aspectRatio;
canvas.width = Math.max(img.width, minWidthToContain);
canvas.height = Math.max(img.height, minHeightToContain);
/** @type {?} */
const dx = (canvas.width - img.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hdGEod2lkdGgsIGhlaWdodCk7XG4gICAgICAgIGNvbnN0IGRhdGEgPSBpbWcuZGF0YTtcbiAgICAgICAgY29uc3QgZGF0YTIgPSBpbWcyLmRhdGE7XG5cbiAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBoZWlnaHQ7IGorKykge1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB3aWR0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgeDIgPSAoaSArIGogKiB3aWR0aCkgKiA0O1xuICAgICAgICAgICAgICAgIGNvbnN0IGNlbnRlcl95ID0gaiAqIHJhdGlvX2g7XG4gICAgICAgICAgICAgICAgbGV0IHdlaWdodCA9IDA7XG4gICAgICAgICAgICAgICAgbGV0IHdlaWdodHMgPSAwO1xuICAgICAgICAgICAgICAgIGxldCB3ZWlnaHRzX2FscGhhID0gMDtcbiAgICAgICAgICAgICAgICBsZXQgZ3hfciA9IDA7XG4gICAgICAgICAgICAgICAgbGV0IGd4X2cgPSAwO1xuICAgICAgICAgICAgICAgIGxldCBneF9iID0gMDtcbiAgICAgICAgICAgICAgICBsZXQgZ3hfYSA9IDA7XG5cbiAgICAgICAgICAgICAgICBjb25zdCB4eF9zdGFydCA9IE1hdGguZmxvb3IoaSAqIHJhdGlvX3cpO1xuICAgICAgICAgICAgICAgIGNvbnN0IHl5X3N0YXJ0ID0gTWF0aC5mbG9vcihqICogcmF0aW9faCk7XG4gICAgICAgICAgICAgICAgbGV0IHh4X3N0b3AgPSBNYXRoLmNlaWwoKGkgKyAxKSAqIHJhdGlvX3cpO1xuICAgICAgICAgICAgICAgIGxldCB5eV9zdG9wID0gTWF0aC5jZWlsKChqICsgMSkgKiByYXRpb19oKTtcbiAgICAgICAgICAgICAgICB4eF9zdG9wID0gTWF0aC5taW4oeHhfc3RvcCwgd2lkdGhfc291cmNlKTtcbiAgICAgICAgICAgICAgICB5eV9zdG9wID0gTWF0aC5taW4oeXlfc3RvcCwgaGVpZ2h0X3NvdXJjZSk7XG5cbiAgICAgICAgICAgICAgICBmb3IgKGxldCB5eSA9IHl5X3N0YXJ0OyB5eSA8IHl5X3N0b3A7IHl5KyspIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZHkgPSBNYXRoLmFicyhjZW50ZXJfeSAtIHl5KSAvIHJhdGlvX2hfaGFsZjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY2VudGVyX3ggPSBpICogcmF0aW9fdztcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdzAgPSBkeSAqIGR5OyAvL3ByZS1jYWxjIHBhcnQgb2Ygd1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCB4eCA9IHh4X3N0YXJ0OyB4eCA8IHh4X3N0b3A7IHh4KyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGR4ID0gTWF0aC5hYnMoY2VudGVyX3ggLSB4eCkgLyByYXRpb193X2hhbGY7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB3ID0gTWF0aC5zcXJ0KHcwICsgZHggKiBkeCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodyA+PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9waXhlbCB0b28gZmFyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAvL2hlcm1pdGUgZmlsdGVyXG4gICAgICAgICAgICAgICAgICAgICAgICB3ZWlnaHQgPSAyICogdyAqIHcgKiB3IC0gMyAqIHcgKiB3ICsgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHBvc194ID0gNCAqICh4eCArIHl5ICogd2lkdGhfc291cmNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vYWxwaGFcbiAgICAgICAgICAgICAgICAgICAgICAgIGd4X2EgKz0gd2VpZ2h0ICogZGF0YVtwb3NfeCArIDNdO1xuICAgICAgICAgICAgICAgICAgICAgICAgd2VpZ2h0c19hbHBoYSArPSB3ZWlnaHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAvL2NvbG9yc1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRhdGFbcG9zX3ggKyAzXSA8IDI1NSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZWlnaHQgPSB3ZWlnaHQgKiBkYXRhW3Bvc194ICsgM10gLyAyNTA7XG4gICAgICAgICAgICAgICAgICAgICAgICBneF9yICs9IHdlaWdodCAqIGRhdGFbcG9zX3hdO1xuICAgICAgICAgICAgICAgICAgICAgICAgZ3hfZyArPSB3ZWlnaHQgKiBkYXRhW3Bvc194ICsgMV07XG4gICAgICAgICAgICAgICAgICAgICAgICBneF9iICs9IHdlaWdodCAqIGRhdGFbcG9zX3ggKyAyXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdlaWdodHMgKz0gd2VpZ2h0O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRhdGEyW3gyXSA9IGd4X3IgLyB3ZWlnaHRzO1xuICAgICAgICAgICAgICAgIGRhdGEyW3gyICsgMV0gPSBneF9nIC8gd2VpZ2h0cztcbiAgICAgICAgICAgICAgICBkYXRhMlt4MiArIDJdID0gZ3hfYiAvIHdlaWdodHM7XG4gICAgICAgICAgICAgICAgZGF0YTJbeDIgKyAzXSA9IGd4X2EgLyB3ZWlnaHRzX2FscGhhO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vY2xlYXIgYW5kIHJlc2l6ZSBjYW52YXNcbiAgICAgICAgaWYgKHJlc2l6ZUNhbnZhcykge1xuICAgICAgICAgICAgY2FudmFzLndpZHRoID0gd2lkdGg7XG4gICAgICAgICAgICBjYW52YXMuaGVpZ2h0ID0gaGVpZ2h0O1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgY3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dHguZ2V0SW1hZ2VEYXRhKDAsIDAsIHdpZHRoX3NvdXJjZSwgaGVpZ2h0X3NvdXJjZSk7XG4gICAgICAgIGNvbnN0IGltZzIgPSBjdHguY3JlYXRlSW1hZ2VEYXRhKHdpZHRoLCBoZWlnaHQpO1xuICAgICAgICBjb25zdCBkYXRhID0gaW1nLmRhdGE7XG4gICAgICAgIGNvbnN0IGRhdGEyID0gaW1nMi5kYXRhO1xuXG4gICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgaGVpZ2h0OyBqKyspIHtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgd2lkdGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGNvbnN0IHgyID0gKGkgKyBqICogd2lkdGgpICogNDtcbiAgICAgICAgICAgICAgICBjb25zdCBjZW50ZXJfeSA9IGogKiByYXRpb19oO1xuICAgICAgICAgICAgICAgIGxldCB3ZWlnaHQgPSAwO1xuICAgICAgICAgICAgICAgIGxldCB3ZWlnaHRzID0gMDtcbiAgICAgICAgICAgICAgICBsZXQgd2VpZ2h0c19hbHBoYSA9IDA7XG4gICAgICAgICAgICAgICAgbGV0IGd4X3IgPSAwO1xuICAgICAgICAgICAgICAgIGxldCBneF9nID0gMDtcbiAgICAgICAgICAgICAgICBsZXQgZ3hfYiA9IDA7XG4gICAgICAgICAgICAgICAgbGV0IGd4X2EgPSAwO1xuXG4gICAgICAgICAgICAgICAgY29uc3QgeHhfc3RhcnQgPSBNYXRoLmZsb29yKGkgKiByYXRpb193KTtcbiAgICAgICAgICAgICAgICBjb25zdCB5eV9zdGFydCA9IE1hdGguZmxvb3IoaiAqIHJhdGlvX2gpO1xuICAgICAgICAgICAgICAgIGxldCB4eF9zdG9wID0gTWF0aC5jZWlsKChpICsgMSkgKiByYXRpb193KTtcbiAgICAgICAgICAgICAgICBsZXQgeXlfc3RvcCA9IE1hdGguY2VpbCgoaiArIDEpICogcmF0aW9faCk7XG4gICAgICAgICAgICAgICAgeHhfc3RvcCA9IE1hdGgubWluKHh4X3N0b3AsIHdpZHRoX3NvdXJjZSk7XG4gICAgICAgICAgICAgICAgeXlfc3RvcCA9IE1hdGgubWluKHl5X3N0b3AsIGhlaWdodF9zb3VyY2UpO1xuXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgeXkgPSB5eV9zdGFydDsgeXkgPCB5eV9zdG9wOyB5eSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGR5ID0gTWF0aC5hYnMoY2VudGVyX3kgLSB5eSkgLyByYXRpb19oX2hhbGY7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNlbnRlcl94ID0gaSAqIHJhdGlvX3c7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHcwID0gZHkgKiBkeTsgLy9wcmUtY2FsYyBwYXJ0IG9mIHdcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgeHggPSB4eF9zdGFydDsgeHggPCB4eF9zdG9wOyB4eCsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBkeCA9IE1hdGguYWJzKGNlbnRlcl94IC0geHgpIC8gcmF0aW9fd19oYWxmO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdyA9IE1hdGguc3FydCh3MCArIGR4ICogZHgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHcgPj0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vcGl4ZWwgdG9vIGZhclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgLy9oZXJtaXRlIGZpbHRlclxuICAgICAgICAgICAgICAgICAgICAgICAgd2VpZ2h0ID0gMiAqIHcgKiB3ICogdyAtIDMgKiB3ICogdyArIDE7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBwb3NfeCA9IDQgKiAoeHggKyB5eSAqIHdpZHRoX3NvdXJjZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAvL2FscGhhXG4gICAgICAgICAgICAgICAgICAgICAgICBneF9hICs9IHdlaWdodCAqIGRhdGFbcG9zX3ggKyAzXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdlaWdodHNfYWxwaGEgKz0gd2VpZ2h0O1xuICAgICAgICAgICAgICAgICAgICAgICAgLy9jb2xvcnNcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkYXRhW3Bvc194ICsgM10gPCAyNTUpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2VpZ2h0ID0gd2VpZ2h0ICogZGF0YVtwb3NfeCArIDNdIC8gMjUwO1xuICAgICAgICAgICAgICAgICAgICAgICAgZ3hfciArPSB3ZWlnaHQgKiBkYXRhW3Bvc194XTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGd4X2cgKz0gd2VpZ2h0ICogZGF0YVtwb3NfeCArIDFdO1xuICAgICAgICAgICAgICAgICAgICAgICAgZ3hfYiArPSB3ZWlnaHQgKiBkYXRhW3Bvc194ICsgMl07XG4gICAgICAgICAgICAgICAgICAgICAgICB3ZWlnaHRzICs9IHdlaWdodDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBkYXRhMlt4Ml0gPSBneF9yIC8gd2VpZ2h0cztcbiAgICAgICAgICAgICAgICBkYXRhMlt4MiArIDFdID0gZ3hfZyAvIHdlaWdodHM7XG4gICAgICAgICAgICAgICAgZGF0YTJbeDIgKyAyXSA9IGd4X2IgLyB3ZWlnaHRzO1xuICAgICAgICAgICAgICAgIGRhdGEyW3gyICsgM10gPSBneF9hIC8gd2VpZ2h0c19hbHBoYTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvL2NsZWFyIGFuZCByZXNpemUgY2FudmFzXG4gICAgICAgIGlmIChyZXNpemVDYW52YXMpIHtcbiAgICAgICAgICAgIGNhbnZhcy53aWR0aCA9IHdpZHRoO1xuICAgICAgICAgICAgY2FudmFzLmhlaWdodCA9IGhlaWdodDtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGN0eC5jbGVhclJlY3QoMCwgMCwgd2lkdGhfc291cmNlLCBoZWlnaHRfc291cmNlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vZHJhd1xuICAgICAgICBjdHgucHV0SW1hZ2VEYXRhKGltZzIsIDAsIDApO1xuICAgIH1cbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGZpdEltYWdlVG9Bc3BlY3RSYXRpbyhzcmNCYXNlNjQ6IHN0cmluZywgYXNwZWN0UmF0aW86IG51bWJlcik6IFByb21pc2U8c3RyaW5nPiB7XG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgICAgY29uc3QgaW1nID0gbmV3IEltYWdlKCk7XG4gICAgICAgIGltZy5vbmxvYWQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBjb25zdCBjYW52YXMgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdjYW52YXMnKTtcbiAgICAgICAgICAgIGNvbnN0IGN0eCA9IGNhbnZhcy5nZXRDb250ZXh0KCcyZCcpO1xuXG4gICAgICAgICAgICBpZiAoY3R4KSB7XG4gICAgICAgICAgICAgICAgY29uc3QgbWluV2lkdGhUb0NvbnRhaW4gPSBpbWcuaGVpZ2h0ICogYXNwZWN0UmF0aW87XG4gICAgICAgICAgICAgICAgY29uc3QgbWluSGVpZ2h0VG9Db250YWluID0gaW1nLndpZHRoIC8gYXNwZWN0UmF0aW87XG4gICAgICAgICAgICAgICAgY2FudmFzLndpZHRoID0gTWF0aC5tYXgoaW1nLndpZHRoLCBtaW5XaWR0aFRvQ29udGFpbik7XG4gICAgICAgICAgICAgICAgY2FudmFzLmhlaWdodCA9IE1hdGgubWF4KGltZy5oZWlnaHQsIG1pbkhlaWdodFRvQ29udGFpbik7XG4gICAgICAgICAgICAgICAgY29uc3QgZHggPSAoY2FudmFzLndpZHRoIC0gaW1nLndpZHRoKSAvIDI7XG4gICAgICAgICAgICAgICAgY29uc3QgZHkgPSAoY2FudmFzLmhlaWdodCAtIGltZy5oZWlnaHQpIC8gMjtcbiAgICAgICAgICAgICAgICBjdHguZHJhd0ltYWdlKGltZywgZHgsIGR5KTtcbiAgICAgICAgICAgICAgICByZXNvbHZlKGNhbnZhcy50b0RhdGFVUkwoKSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJlamVjdChuZXcgRXJyb3IoJ05vIGNvbnRleHQnKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIGltZy5zcmMgPSBzcmNCYXNlNjQ7XG4gICAgfSk7XG59XG4iXX0=

@@ -1,8 +0,3 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
export { ImageCropperModule } from './src/image-cropper.module';
export { ImageCropperComponent } from './src/component/image-cropper.component';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUNoRSxPQUFPLEVBQWMscUJBQXFCLEVBQUUsTUFBTSx5Q0FBeUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB7IEltYWdlQ3JvcHBlck1vZHVsZSB9IGZyb20gJy4vc3JjL2ltYWdlLWNyb3BwZXIubW9kdWxlJztcbmV4cG9ydCB7IE91dHB1dFR5cGUsIEltYWdlQ3JvcHBlckNvbXBvbmVudCB9IGZyb20gJy4vc3JjL2NvbXBvbmVudC9pbWFnZS1jcm9wcGVyLmNvbXBvbmVudCc7XG5leHBvcnQgeyBDcm9wcGVyUG9zaXRpb24sIEltYWdlQ3JvcHBlZEV2ZW50IH0gZnJvbSAnLi9zcmMvaW50ZXJmYWNlcyc7XG4iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQ2hFLE9BQU8sRUFBYyxxQkFBcUIsRUFBRSxNQUFNLHlDQUF5QyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgSW1hZ2VDcm9wcGVyTW9kdWxlIH0gZnJvbSAnLi9zcmMvaW1hZ2UtY3JvcHBlci5tb2R1bGUnO1xuZXhwb3J0IHsgT3V0cHV0VHlwZSwgSW1hZ2VDcm9wcGVyQ29tcG9uZW50IH0gZnJvbSAnLi9zcmMvY29tcG9uZW50L2ltYWdlLWNyb3BwZXIuY29tcG9uZW50JztcbmV4cG9ydCB7IENyb3BwZXJQb3NpdGlvbiwgSW1hZ2VDcm9wcGVkRXZlbnQgfSBmcm9tICcuL3NyYy9pbnRlcmZhY2VzJztcbiJdfQ==
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
/**
* Generated bundle index. Do not edit.
*/
export { ImageCropperModule, ImageCropperComponent } from './index';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWltYWdlLWNyb3BwZXIuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbIm5neC1pbWFnZS1jcm9wcGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSwwREFBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19
export * from './index';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWltYWdlLWNyb3BwZXIuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbIm5neC1pbWFnZS1jcm9wcGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19

@@ -1,5 +0,2 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
import * as tslib_1 from "tslib";
import { NgModule } from '@angular/core';

@@ -11,19 +8,18 @@ import { CommonModule } from '@angular/common';

}
ImageCropperModule.decorators = [
{ type: NgModule, args: [{
imports: [
CommonModule
],
declarations: [
ImageCropperComponent
],
exports: [
ImageCropperComponent
]
},] }
];
ImageCropperModule = tslib_1.__decorate([
NgModule({
imports: [
CommonModule
],
declarations: [
ImageCropperComponent
],
exports: [
ImageCropperComponent
]
})
], ImageCropperModule);
return ImageCropperModule;
}());
export { ImageCropperModule };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW1hZ2UtY3JvcHBlci5tb2R1bGUuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9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ZW50XG4gICAgXSxcbiAgICBleHBvcnRzOiBbXG4gICAgICAgIEltYWdlQ3JvcHBlckNvbXBvbmVudFxuICAgIF1cbn0pXG5leHBvcnQgY2xhc3MgSW1hZ2VDcm9wcGVyTW9kdWxlIHt9XG4iXX0=

@@ -1,18 +0,1 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
/**
* @record
*/
export function CropperPosition() { }
/** @type {?} */
CropperPosition.prototype.x1;
/** @type {?} */
CropperPosition.prototype.y1;
/** @type {?} */
CropperPosition.prototype.x2;
/** @type {?} */
CropperPosition.prototype.y2;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JvcHBlci1wb3NpdGlvbi5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbInNyYy9pbnRlcmZhY2VzL2Nyb3BwZXItcG9zaXRpb24uaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIENyb3BwZXJQb3NpdGlvbiB7XG4gICAgeDE6IG51bWJlcjtcbiAgICB5MTogbnVtYmVyO1xuICAgIHgyOiBudW1iZXI7XG4gICAgeTI6IG51bWJlcjtcbn0iXX0=

@@ -1,14 +0,1 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
/**
* @record
*/
export function Dimensions() { }
/** @type {?} */
Dimensions.prototype.width;
/** @type {?} */
Dimensions.prototype.height;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGltZW5zaW9ucy5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbInNyYy9pbnRlcmZhY2VzL2RpbWVuc2lvbnMuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIERpbWVuc2lvbnMge1xuICAgIHdpZHRoOiBudW1iZXI7XG4gICAgaGVpZ2h0OiBudW1iZXI7XG59Il19

@@ -1,22 +0,1 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
/**
* @record
*/
export function ImageCroppedEvent() { }
/** @type {?|undefined} */
ImageCroppedEvent.prototype.base64;
/** @type {?|undefined} */
ImageCroppedEvent.prototype.file;
/** @type {?} */
ImageCroppedEvent.prototype.width;
/** @type {?} */
ImageCroppedEvent.prototype.height;
/** @type {?} */
ImageCroppedEvent.prototype.cropperPosition;
/** @type {?} */
ImageCroppedEvent.prototype.imagePosition;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW1hZ2UtY3JvcHBlZC1ldmVudC5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbInNyYy9pbnRlcmZhY2VzL2ltYWdlLWNyb3BwZWQtZXZlbnQuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDcm9wcGVyUG9zaXRpb24gfSBmcm9tIFwiLi9jcm9wcGVyLXBvc2l0aW9uLmludGVyZmFjZVwiO1xuXG5leHBvcnQgaW50ZXJmYWNlIEltYWdlQ3JvcHBlZEV2ZW50IHtcbiAgICBiYXNlNjQ/OiBzdHJpbmcgfCBudWxsO1xuICAgIGZpbGU/OiBCbG9iIHwgbnVsbDtcbiAgICB3aWR0aDogbnVtYmVyO1xuICAgIGhlaWdodDogbnVtYmVyO1xuICAgIGNyb3BwZXJQb3NpdGlvbjogQ3JvcHBlclBvc2l0aW9uO1xuICAgIGltYWdlUG9zaXRpb246IENyb3BwZXJQb3NpdGlvbjtcbn0iXX0=

@@ -1,6 +0,1 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbInNyYy9pbnRlcmZhY2VzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBDcm9wcGVyUG9zaXRpb24gfSBmcm9tICcuL2Nyb3BwZXItcG9zaXRpb24uaW50ZXJmYWNlJztcbmV4cG9ydCB7IERpbWVuc2lvbnMgfSBmcm9tICcuL2RpbWVuc2lvbnMuaW50ZXJmYWNlJztcbmV4cG9ydCB7IEltYWdlQ3JvcHBlZEV2ZW50IH0gZnJvbSAnLi9pbWFnZS1jcm9wcGVkLWV2ZW50LmludGVyZmFjZSc7XG5leHBvcnQgeyBNb3ZlU3RhcnQgfSBmcm9tICcuL21vdmUtc3RhcnQuaW50ZXJmYWNlJztcbiJdfQ==

@@ -1,28 +0,1 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
/**
* @record
*/
export function MoveStart() { }
/** @type {?} */
MoveStart.prototype.active;
/** @type {?} */
MoveStart.prototype.type;
/** @type {?} */
MoveStart.prototype.position;
/** @type {?} */
MoveStart.prototype.x1;
/** @type {?} */
MoveStart.prototype.y1;
/** @type {?} */
MoveStart.prototype.x2;
/** @type {?} */
MoveStart.prototype.y2;
/** @type {?} */
MoveStart.prototype.clientX;
/** @type {?} */
MoveStart.prototype.clientY;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW92ZS1zdGFydC5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbInNyYy9pbnRlcmZhY2VzL21vdmUtc3RhcnQuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgaW50ZXJmYWNlIE1vdmVTdGFydCB7XG4gICAgYWN0aXZlOiBib29sZWFuO1xuICAgIHR5cGU6IHN0cmluZyB8IG51bGw7XG4gICAgcG9zaXRpb246IHN0cmluZyB8IG51bGw7XG4gICAgeDE6IG51bWJlcjtcbiAgICB5MTogbnVtYmVyO1xuICAgIHgyOiBudW1iZXI7XG4gICAgeTI6IG51bWJlcjtcbiAgICBjbGllbnRYOiBudW1iZXI7XG4gICAgY2xpZW50WTogbnVtYmVyO1xufVxuIl19

@@ -1,12 +0,3 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
/**
* @param {?} srcBase64
* @return {?}
*/
export function resetExifOrientation(srcBase64) {
try {
/** @type {?} */
var exifRotation = getExifRotation(srcBase64);

@@ -24,19 +15,9 @@ if (exifRotation > 1) {

}
/**
* @param {?} srcBase64
* @param {?} exifRotation
* @return {?}
*/
export function transformBase64BasedOnExifRotation(srcBase64, exifRotation) {
return new Promise(function (resolve, reject) {
/** @type {?} */
var img = new Image();
img.onload = function () {
/** @type {?} */
var width = img.width;
/** @type {?} */
var height = img.height;
/** @type {?} */
var canvas = document.createElement('canvas');
/** @type {?} */
var ctx = canvas.getContext('2d');

@@ -63,8 +44,3 @@ if (ctx) {

}
/**
* @param {?} imageBase64
* @return {?}
*/
function getExifRotation(imageBase64) {
/** @type {?} */
var view = new DataView(base64ToArrayBuffer(imageBase64));

@@ -74,5 +50,3 @@ if (view.getUint16(0, false) != 0xFFD8) {

}
/** @type {?} */
var length = view.byteLength;
/** @type {?} */
var offset = 2;

@@ -82,3 +56,2 @@ while (offset < length) {

return -1;
/** @type {?} */
var marker = view.getUint16(offset, false);

@@ -90,6 +63,4 @@ offset += 2;

}
/** @type {?} */
var little = view.getUint16(offset += 6, false) == 0x4949;
offset += view.getUint32(offset + 4, little);
/** @type {?} */
var tags = view.getUint16(offset, little);

@@ -112,13 +83,6 @@ offset += 2;

}
/**
* @param {?} imageBase64
* @return {?}
*/
function base64ToArrayBuffer(imageBase64) {
imageBase64 = imageBase64.replace(/^data\:([^\;]+)\;base64,/gmi, '');
/** @type {?} */
var binaryString = atob(imageBase64);
/** @type {?} */
var len = binaryString.length;
/** @type {?} */
var bytes = new Uint8Array(len);

@@ -130,9 +94,2 @@ for (var i = 0; i < len; i++) {

}
/**
* @param {?} ctx
* @param {?} orientation
* @param {?} width
* @param {?} height
* @return {?}
*/
function transformCanvas(ctx, orientation, width, height) {

@@ -163,3 +120,2 @@ switch (orientation) {

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhpZi51dGlscy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1pbWFnZS1jcm9wcGVyLyIsInNvdXJjZXMiOlsic3JjL3V0aWxzL2V4aWYudXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7QUFBQSxNQUFNLCtCQUErQixTQUFpQjtJQUNsRCxJQUFJLENBQUM7O1FBQ0QsSUFBTSxZQUFZLEdBQUcsZUFBZSxDQUFDLFNBQVMsQ0FBQyxDQUFDO1FBQ2hELEVBQUUsQ0FBQyxDQUFDLFlBQVksR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDO1lBQ25CLE1BQU0sQ0FBQyxrQ0FBa0MsQ0FBQyxTQUFTLEVBQUUsWUFBWSxDQUFDLENBQUM7U0FDdEU7UUFBQyxJQUFJLENBQUMsQ0FBQztZQUNKLE1BQU0sQ0FBQyxPQUFPLENBQUMsT0FBTyxD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jb25zdCBoZWlnaHQgPSBpbWcuaGVpZ2h0O1xuICAgICAgICAgICAgY29uc3QgY2FudmFzID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnY2FudmFzJyk7XG4gICAgICAgICAgICBjb25zdCBjdHggPSBjYW52YXMuZ2V0Q29udGV4dCgnMmQnKTtcblxuICAgICAgICAgICAgaWYgKGN0eCkge1xuICAgICAgICAgICAgICAgIGlmICg0IDwgZXhpZlJvdGF0aW9uICYmIGV4aWZSb3RhdGlvbiA8IDkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FudmFzLndpZHRoID0gaGVpZ2h0O1xuICAgICAgICAgICAgICAgICAgICBjYW52YXMuaGVpZ2h0ID0gd2lkdGg7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY2FudmFzLndpZHRoID0gd2lkdGg7XG4gICAgICAgICAgICAgICAgICAgIGNhbnZhcy5oZWlnaHQgPSBoZWlnaHQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRyYW5zZm9ybUNhbnZhcyhjdHgsIGV4aWZSb3RhdGlvbiwgd2lkdGgsIGhlaWdodCk7XG4gICAgICAgICAgICAgICAgY3R4LmRyYXdJbWFnZShpbWcsIDAsIDApO1xuICAgICAgICAgICAgICAgIHJlc29sdmUoY2FudmFzLnRvRGF0YVVSTCgpKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcignTm8gY29udGV4dCcpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgaW1nLnNyYyA9IHNyY0Jhc2U2NDtcbiAgICB9KTtcbn1cblxuZnVuY3Rpb24gZ2V0RXhpZlJvdGF0aW9uKGltYWdlQmFzZTY0OiBzdHJpbmcpOiBudW1iZXIge1xuICAgIGNvbnN0IHZpZXcgPSBuZXcgRGF0YVZpZXcoYmFzZTY0VG9BcnJheUJ1Z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wgd2lkdGgsIDApO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgIGN0eC50cmFuc2Zvcm0oLTEsIDAsIDAsIC0xLCB3aWR0aCwgaGVpZ2h0KTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICBjdHgudHJhbnNmb3JtKDEsIDAsIDAsIC0xLCAwLCBoZWlnaHQpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgIGN0eC50cmFuc2Zvcm0oMCwgMSwgMSwgMCwgMCwgMCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgY3R4LnRyYW5zZm9ybSgwLCAxLCAtMSwgMCwgaGVpZ2h0LCAwKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDc6XG4gICAgICAgICAgICBjdHgudHJhbnNmb3JtKDAsIC0xLCAtMSwgMCwgaGVpZ2h0LCB3aWR0aCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSA4OlxuICAgICAgICAgICAgY3R4LnRyYW5zZm9ybSgwLCAtMSwgMSwgMCwgMCwgd2lkdGgpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgfVxufVxuIl19
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhpZi51dGlscy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1pbWFnZS1jcm9wcGVyLyIsInNvdXJjZXMiOlsic3JjL3V0aWxzL2V4aWYudXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxVQUFVLG9CQUFvQixDQUFDLFNBQWlCO0lBQ2xELElBQUk7UUFDQSxJQUFNLFlBQVksR0FBRyxlQUFlLENBQUMsU0FBUyxDQUFDLENBQUM7UUFDaEQsS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ldFVpbnQxNihvZmZzZXQgKyAyLCBmYWxzZSkgPD0gOCkgcmV0dXJuIC0xO1xuICAgICAgICBjb25zdCBtYXJrZXIgPSB2aWV3LmdldFVpbnQxNihvZmZzZXQsIGZhbHNlKTtcbiAgICAgICAgb2Zmc2V0ICs9IDI7XG4gICAgICAgIGlmIChtYXJrZXIgPT0gMHhGRkUxKSB7XG4gICAgICAgICAgICBpZiAodmlldy5nZXRVaW50MzIob2Zmc2V0ICs9IDIsIGZhbHNlKSAhPSAweDQ1Nzg2OTY2KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb25zdCBsaXR0bGUgPSB2aWV3LmdldFVpbnQxNihvZmZzZXQgKz0gNiwgZmFsc2UpID09IDB4NDk0OTtcbiAgICAgICAgICAgIG9mZnNldCArPSB2aWV3LmdldFVpbnQzMihvZmZzZXQgKyA0LCBsaXR0bGUpO1xuICAgICAgICAgICAgY29uc3QgdGFncyA9IHZpZXcuZ2V0VWludDE2KG9mZnNldCwgbGl0dGxlKTtcbiAgICAgICAgICAgIG9mZnNldCArPSAyO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0YWdzOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAodmlldy5nZXRVaW50MTYob2Zmc2V0ICsgKGkgKiAxMiksIGxpdHRsZSkgPT0gMHgwMTEyKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2aWV3LmdldFVpbnQxNihvZmZzZXQgKyAoaSAqIDEyKSArIDgsIGxpdHRsZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKChtYXJrZXIgJiAweEZGMDApICE9IDB4RkYwMCkge1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBvZmZzZXQgKz0gdmlldy5nZ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GJyZWFrO1xuICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICBjdHgudHJhbnNmb3JtKDAsIDEsIDEsIDAsIDAsIDApO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgIGN0eC50cmFuc2Zvcm0oMCwgMSwgLTEsIDAsIGhlaWdodCwgMCk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSA3OlxuICAgICAgICAgICAgY3R4LnRyYW5zZm9ybSgwLCAtMSwgLTEsIDAsIGhlaWdodCwgd2lkdGgpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgODpcbiAgICAgICAgICAgIGN0eC50cmFuc2Zvcm0oMCwgLTEsIDEsIDAsIDAsIHdpZHRoKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgIH1cbn1cbiJdfQ==

@@ -1,5 +0,1 @@

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
*/
/*

@@ -9,63 +5,32 @@ * Hermite resize - fast image resize/resample using Hermite filter.

*/
/**
* @param {?} canvas
* @param {?} width
* @param {?} height
* @param {?=} resizeCanvas
* @return {?}
*/
export function resizeCanvas(canvas, width, height, resizeCanvas) {
if (resizeCanvas === void 0) { resizeCanvas = true; }
/** @type {?} */
var width_source = canvas.width;
/** @type {?} */
var height_source = canvas.height;
width = Math.round(width);
height = Math.round(height);
/** @type {?} */
var ratio_w = width_source / width;
/** @type {?} */
var ratio_h = height_source / height;
/** @type {?} */
var ratio_w_half = Math.ceil(ratio_w / 2);
/** @type {?} */
var ratio_h_half = Math.ceil(ratio_h / 2);
/** @type {?} */
var ctx = canvas.getContext('2d');
if (ctx) {
/** @type {?} */
var img = ctx.getImageData(0, 0, width_source, height_source);
/** @type {?} */
var img2 = ctx.createImageData(width, height);
/** @type {?} */
var data = img.data;
/** @type {?} */
var data2 = img2.data;
for (var j = 0; j < height; j++) {
for (var i = 0; i < width; i++) {
/** @type {?} */
var x2 = (i + j * width) * 4;
/** @type {?} */
var center_y = j * ratio_h;
/** @type {?} */
var weight = 0;
/** @type {?} */
var weights = 0;
/** @type {?} */
var weights_alpha = 0;
/** @type {?} */
var gx_r = 0;
/** @type {?} */
var gx_g = 0;
/** @type {?} */
var gx_b = 0;
/** @type {?} */
var gx_a = 0;
/** @type {?} */
var xx_start = Math.floor(i * ratio_w);
/** @type {?} */
var yy_start = Math.floor(j * ratio_h);
/** @type {?} */
var xx_stop = Math.ceil((i + 1) * ratio_w);
/** @type {?} */
var yy_stop = Math.ceil((j + 1) * ratio_h);

@@ -75,12 +40,7 @@ xx_stop = Math.min(xx_stop, width_source);

for (var yy = yy_start; yy < yy_stop; yy++) {
/** @type {?} */
var dy = Math.abs(center_y - yy) / ratio_h_half;
/** @type {?} */
var center_x = i * ratio_w;
/** @type {?} */
var w0 = dy * dy; //pre-calc part of w
for (var xx = xx_start; xx < xx_stop; xx++) {
/** @type {?} */
var dx = Math.abs(center_x - xx) / ratio_w_half;
/** @type {?} */
var w = Math.sqrt(w0 + dx * dx);

@@ -93,3 +53,2 @@ if (w >= 1) {

weight = 2 * w * w * w - 3 * w * w + 1;
/** @type {?} */
var pos_x = 4 * (xx + yy * width_source);

@@ -126,26 +85,14 @@ //alpha

}
/**
* @param {?} srcBase64
* @param {?} aspectRatio
* @return {?}
*/
export function fitImageToAspectRatio(srcBase64, aspectRatio) {
return new Promise(function (resolve, reject) {
/** @type {?} */
var img = new Image();
img.onload = function () {
/** @type {?} */
var canvas = document.createElement('canvas');
/** @type {?} */
var ctx = canvas.getContext('2d');
if (ctx) {
/** @type {?} */
var minWidthToContain = img.height * aspectRatio;
/** @type {?} */
var minHeightToContain = img.width / aspectRatio;
canvas.width = Math.max(img.width, minWidthToContain);
canvas.height = Math.max(img.height, minHeightToContain);
/** @type {?} */
var dx = (canvas.width - img.width) / 2;
/** @type {?} */
var dy = (canvas.height - img.height) / 2;

@@ -162,3 +109,2 @@ ctx.drawIm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0YSA9IGltZy5kYXRhO1xuICAgICAgICBjb25zdCBkYXRhMiA9IGltZzIuZGF0YTtcblxuICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGhlaWdodDsgaisrKSB7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHdpZHRoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBjb25zdCB4MiA9IChpICsgaiAqIHdpZHRoKSAqIDQ7XG4gICAgICAgICAgICAgICAgY29uc3QgY2VudGVyX3kgPSBqICogcmF0aW9faDtcbiAgICAgICAgICAgICAgICBsZXQgd2VpZ2h0ID0gMDtcbiAgICAgICAgICAgICAgICBsZXQgd2VpZ2h0cyA9IDA7XG4gICAgICAgICAgICAgICAgbGV0IHdlaWdodHNfYWxwaGEgPSAwO1xuICAgICAgICAgICAgICAgIGxldCBneF9yID0gMDtcbiAgICAgICAgICAgICAgICBsZXQgZ3hfZyA9IDA7XG4gICAgICAgICAgICAgICAgbGV0IGd4X2IgPSAwO1xuICAgICAgICAgICAgICAgIGxldCBneF9hID0gMDtcblxuICAgICAgICAgICAgICAgIGNvbnN0IHh4X3N0YXJ0ID0gTWF0aC5mbG9vcihpICogcmF0aW9fdyk7XG4gICAgICAgICAgICAgICAgY29uc3QgeXlfc3RhcnQgPSBNYXRoLmZsb29yKGogKiByYXRpb19oKTtcbiAgICAgICAgICAgICAgICBsZXQgeHhfc3RvcCA9IE1hdGguY2VpbCgoaSArIDEpICogcmF0aW9fdyk7XG4gICAgICAgICAgICAgICAgbGV0IHl5X3N0b3AgPSBNYXRoLmNlaWwoKGogKyAxKSAqIHJhdGlvX2gpO1xuICAgICAgICAgICAgICAgIHh4X3N0b3AgPSBNYXRoLm1pbih4eF9zdG9wLCB3aWR0aF9zb3VyY2UpO1xuICAgICAgICAgICAgICAgIHl5X3N0b3AgPSBNYXRoLm1pbih5eV9zdG9wLCBoZWlnaHRfc291cmNlKTtcblxuICAgICAgICAgICAgICAgIGZvciAobGV0IHl5ID0geXlfc3RhcnQ7IHl5IDwgeXlfc3RvcDsgeXkrKykge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBkeSA9IE1hdGguYWJzKGNlbnRlcl95IC0geXkpIC8gcmF0aW9faF9oYWxmO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBjZW50ZXJfeCA9IGkgKiByYXRpb193O1xuICAgICAgICAgICAgICAgICAgICBjb25zdCB3MCA9IGR5ICogZHk7IC8vcHJlLWNhbGMgcGFydCBvZiB3XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IHh4ID0geHhfc3RhcnQ7IHh4IDwgeHhfc3RvcDsgeHgrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZHggPSBNYXRoLmFicyhjZW50ZXJfeCAtIHh4KSAvIHJhdGlvX3dfaGFsZjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHcgPSBNYXRoLnNxcnQodzAgKyBkeCAqIGR4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3ID49IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3BpeGVsIHRvbyBmYXJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vaGVybWl0ZSBmaWx0ZXJcbiAgICAgICAgICAgICAgICAgICAgICAgIHdlaWdodCA9IDIgKiB3ICogdyAqIHcgLSAzICogdyAqIHcgKyAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcG9zX3ggPSA0ICogKHh4ICsgeXkgKiB3aWR0aF9zb3VyY2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy9hbHBoYVxuICAgICAgICAgICAgICAgICAgICAgICAgZ3hfYSArPSB3ZWlnaHQgKiBkYXRhW3Bvc194ICsgM107XG4gICAgICAgICAgICAgICAgICAgICAgICB3ZWlnaHRzX2FscGhhICs9IHdlaWdodDtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vY29sb3JzXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YVtwb3NfeCArIDNdIDwgMjU1KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdlaWdodCA9IHdlaWdodCAqIGRhdGFbcG9zX3ggKyAzXSAvIDI1MDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGd4X3IgKz0gd2VpZ2h0ICogZGF0YVtwb3NfeF07XG4gICAgICAgICAgICAgICAgICAgICAgICBneF9nICs9IHdlaWdodCAqIGRhdGFbcG9zX3ggKyAxXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGd4X2IgKz0gd2VpZ2h0ICogZGF0YVtwb3NfeCArIDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgd2VpZ2h0cyArPSB3ZWlnaHQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZGF0YTJbeDJdID0gZ3hfciAvIHdlaWdodHM7XG4gICAgICAgICAgICAgICAgZGF0YTJbeDIgKyAxXSA9IGd4X2cgLyB3ZWlnaHRzO1xuICAgICAgICAgICAgICAgIGRhdGEyW3gyICsgMl0gPSBneF9iIC8gd2VpZ2h0cztcbiAgICAgICAgICAgICAgICBkYXRhMlt4MiArIDNdID0gZ3hfYSAvIHdlaWdodHNfYWxwaGE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy9jbGVhciBhbmQgcmVzaXplIGNhbnZhc1xuICAgICAgICBpZiAocmVzaXplQ2FudmFzKSB7XG4gICAgICAgICAgICBjYW52YXMud2lkdGggPSB3aWR0aDtcbiAgICAgICAgICAgIGNhbnZhcy5oZWlnaHQgPSBoZWlnaHQ7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBjdHguY2xlYXJSZWN0KDAsIDAsIHdpZHRoX3NvdXJjZSwgaGVpZ2h0X3NvdXJjZSk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TtcbiAgICAgICAgY29uc3QgaW1nMiA9IGN0eC5jcmVhdGVJbWFnZURhdGEod2lkdGgsIGhlaWdodCk7XG4gICAgICAgIGNvbnN0IGRhdGEgPSBpbWcuZGF0YTtcbiAgICAgICAgY29uc3QgZGF0YTIgPSBpbWcyLmRhdGE7XG5cbiAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBoZWlnaHQ7IGorKykge1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB3aWR0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgeDIgPSAoaSArIGogKiB3aWR0aCkgKiA0O1xuICAgICAgICAgICAgICAgIGNvbnN0IGNlbnRlcl95ID0gaiAqIHJhdGlvX2g7XG4gICAgICAgICAgICAgICAgbGV0IHdlaWdodCA9IDA7XG4gICAgICAgICAgICAgICAgbGV0IHdlaWdodHMgPSAwO1xuICAgICAgICAgICAgICAgIGxldCB3ZWlnaHRzX2FscGhhID0gMDtcbiAgICAgICAgICAgICAgICBsZXQgZ3hfciA9IDA7XG4gICAgICAgICAgICAgICAgbGV0IGd4X2cgPSAwO1xuICAgICAgICAgICAgICAgIGxldCBneF9iID0gMDtcbiAgICAgICAgICAgICAgICBsZXQgZ3hfYSA9IDA7XG5cbiAgICAgICAgICAgICAgICBjb25zdCB4eF9zdGFydCA9IE1hdGguZmxvb3IoaSAqIHJhdGlvX3cpO1xuICAgICAgICAgICAgICAgIGNvbnN0IHl5X3N0YXJ0ID0gTWF0aC5mbG9vcihqICogcmF0aW9faCk7XG4gICAgICAgICAgICAgICAgbGV0IHh4X3N0b3AgPSBNYXRoLmNlaWwoKGkgKyAxKSAqIHJhdGlvX3cpO1xuICAgICAgICAgICAgICAgIGxldCB5eV9zdG9wID0gTWF0aC5jZWlsKChqICsgMSkgKiByYXRpb19oKTtcbiAgICAgICAgICAgICAgICB4eF9zdG9wID0gTWF0aC5taW4oeHhfc3RvcCwgd2lkdGhfc291cmNlKTtcbiAgICAgICAgICAgICAgICB5eV9zdG9wID0gTWF0aC5taW4oeXlfc3RvcCwgaGVpZ2h0X3NvdXJjZSk7XG5cbiAgICAgICAgICAgICAgICBmb3IgKGxldCB5eSA9IHl5X3N0YXJ0OyB5eSA8IHl5X3N0b3A7IHl5KyspIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZHkgPSBNYXRoLmFicyhjZW50ZXJfeSAtIHl5KSAvIHJhdGlvX2hfaGFsZjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY2VudGVyX3ggPSBpICogcmF0aW9fdztcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdzAgPSBkeSAqIGR5OyAvL3ByZS1jYWxjIHBhcnQgb2Ygd1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCB4eCA9IHh4X3N0YXJ0OyB4eCA8IHh4X3N0b3A7IHh4KyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGR4ID0gTWF0aC5hYnMoY2VudGVyX3ggLSB4eCkgLyByYXRpb193X2hhbGY7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB3ID0gTWF0aC5zcXJ0KHcwICsgZHggKiBkeCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodyA+PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9waXhlbCB0b28gZmFyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAvL2hlcm1pdGUgZmlsdGVyXG4gICAgICAgICAgICAgICAgICAgICAgICB3ZWlnaHQgPSAyICogdyAqIHcgKiB3IC0gMyAqIHcgKiB3ICsgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHBvc194ID0gNCAqICh4eCArIHl5ICogd2lkdGhfc291cmNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vYWxwaGFcbiAgICAgICAgICAgICAgICAgICAgICAgIGd4X2EgKz0gd2VpZ2h0ICogZGF0YVtwb3NfeCArIDNdO1xuICAgICAgICAgICAgICAgICAgICAgICAgd2VpZ2h0c19hbHBoYSArPSB3ZWlnaHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAvL2NvbG9yc1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRhdGFbcG9zX3ggKyAzXSA8IDI1NSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZWlnaHQgPSB3ZWlnaHQgKiBkYXRhW3Bvc194ICsgM10gLyAyNTA7XG4gICAgICAgICAgICAgICAgICAgICAgICBneF9yICs9IHdlaWdodCAqIGRhdGFbcG9zX3hdO1xuICAgICAgICAgICAgICAgICAgICAgICAgZ3hfZyArPSB3ZWlnaHQgKiBkYXRhW3Bvc194ICsgMV07XG4gICAgICAgICAgICAgICAgICAgICAgICBneF9iICs9IHdlaWdodCAqIGRhdGFbcG9zX3ggKyAyXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdlaWdodHMgKz0gd2VpZ2h0O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRhdGEyW3gyXSA9IGd4X3IgLyB3ZWlnaHRzO1xuICAgICAgICAgICAgICAgIGRhdGEyW3gyICsgMV0gPSBneF9nIC8gd2VpZ2h0cztcbiAgICAgICAgICAgICAgICBkYXRhMlt4MiArIDJdID0gZ3hfYiAvIHdlaWdodHM7XG4gICAgICAgICAgICAgICAgZGF0YTJbeDIgKyAzXSA9IGd4X2EgLyB3ZWlnaHRzX2FscGhhO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vY2xlYXIgYW5kIHJlc2l6ZSBjYW52YXNcbiAgICAgICAgaWYgKHJlc2l6ZUNhbnZhcykge1xuICAgICAgICAgICAgY2FudmFzLndpZHRoID0gd2lkdGg7XG4gICAgICAgICAgICBjYW52YXMuaGVpZ2h0ID0gaGVpZ2h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52YXMud2lkdGggLSBpbWcud2lkdGgpIC8gMjtcbiAgICAgICAgICAgICAgICBjb25zdCBkeSA9IChjYW52YXMuaGVpZ2h0IC0gaW1nLmhlaWdodCkgLyAyO1xuICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoaW1nLCBkeCwgZHkpO1xuICAgICAgICAgICAgICAgIHJlc29sdmUoY2FudmFzLnRvRGF0YVVSTCgpKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcignTm8gY29udGV4dCcpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgaW1nLnNyYyA9IHNyY0Jhc2U2NDtcbiAgICB9KTtcbn1cbiJdfQ==

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":4,"exports":[{"export":[{"name":"CropperPosition","as":"CropperPosition"}],"from":"./src/cropper-position.interface"},{"export":[{"name":"ImageCroppedEvent","as":"ImageCroppedEvent"}],"from":"./src/image-cropped-event.interface"}],"metadata":{"ImageCropperModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":6,"character":8}],"declarations":[{"__symbolic":"reference","name":"ImageCropperComponent"}],"exports":[{"__symbolic":"reference","name":"ImageCropperComponent"}]}]}],"members":{}},"OutputType":{"__symbolic":"interface"},"ImageCropperComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":11,"character":1},"arguments":[{"selector":"image-cropper","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":15,"character":21},"member":"OnPush"},"template":"<div [style.background]=\"imageVisible && backgroundColor\">\n <img\n #sourceImage\n class=\"source-image\"\n [src]=\"safeImgDataUrl\"\n [style.visibility]=\"imageVisible ? 'visible' : 'hidden'\"\n (load)=\"imageLoadedInView()\"\n />\n <div class=\"cropper\"\n *ngIf=\"imageVisible\"\n [class.rounded]=\"roundCropper\"\n [style.top.px]=\"cropper.y1\"\n [style.left.px]=\"cropper.x1\"\n [style.width.px]=\"cropper.x2 - cropper.x1\"\n [style.height.px]=\"cropper.y2 - cropper.y1\"\n [style.margin-left]=\"alignImage === 'center' ? marginLeft : null\"\n [style.visibility]=\"imageVisible ? 'visible' : 'hidden'\"\n >\n <div\n (mousedown)=\"startMove($event, 'move')\"\n (touchstart)=\"startMove($event, 'move')\"\n class=\"move\"\n >&nbsp;</div>\n <span\n class=\"resize topleft\"\n (mousedown)=\"startMove($event, 'resize', 'topleft')\"\n (touchstart)=\"startMove($event, 'resize', 'topleft')\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize top\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize topright\"\n (mousedown)=\"startMove($event, 'resize', 'topright')\"\n (touchstart)=\"startMove($event, 'resize', 'topright')\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize right\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize bottomright\"\n (mousedown)=\"startMove($event, 'resize', 'bottomright')\"\n (touchstart)=\"startMove($event, 'resize', 'bottomright')\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize bottom\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize bottomleft\"\n (mousedown)=\"startMove($event, 'resize', 'bottomleft')\"\n (touchstart)=\"startMove($event, 'resize', 'bottomleft')\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize left\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize-bar top\"\n (mousedown)=\"startMove($event, 'resize', 'top')\"\n (touchstart)=\"startMove($event, 'resize', 'top')\"\n ></span>\n <span\n class=\"resize-bar right\"\n (mousedown)=\"startMove($event, 'resize', 'right')\"\n (touchstart)=\"startMove($event, 'resize', 'right')\"\n ></span>\n <span\n class=\"resize-bar bottom\"\n (mousedown)=\"startMove($event, 'resize', 'bottom')\"\n (touchstart)=\"startMove($event, 'resize', 'bottom')\"\n ></span>\n <span\n class=\"resize-bar left\"\n (mousedown)=\"startMove($event, 'resize', 'left')\"\n (touchstart)=\"startMove($event, 'resize', 'left')\"\n ></span>\n </div>\n</div>\n","styles":[":host{display:flex;position:relative;width:100%;max-width:100%;max-height:100%;overflow:hidden;padding:5px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host>div{position:relative;width:100%}:host>div img.source-image{max-width:100%;max-height:100%}:host .cropper{position:absolute;display:flex;color:#53535c;background:0 0;touch-action:none;outline:rgba(255,255,255,.3) solid 100vw}:host .cropper:after{position:absolute;content:'';top:0;bottom:0;left:0;right:0;pointer-events:none;border:1px dashed;opacity:.75;color:inherit;z-index:1}:host .cropper .move{width:100%;cursor:move;border:1px solid rgba(255,255,255,.5)}:host .cropper .resize{position:absolute;display:inline-block;line-height:6px;padding:8px;opacity:.85;z-index:1}:host .cropper .resize .square{display:inline-block;background:#53535c;width:6px;height:6px;border:1px solid rgba(255,255,255,.5);box-sizing:content-box}:host .cropper .resize.topleft{top:-12px;left:-12px;cursor:nwse-resize}:host .cropper .resize.top{top:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .cropper .resize.topright{top:-12px;right:-12px;cursor:nesw-resize}:host .cropper .resize.right{top:calc(50% - 12px);right:-12px;cursor:ew-resize}:host .cropper .resize.bottomright{bottom:-12px;right:-12px;cursor:nwse-resize}:host .cropper .resize.bottom{bottom:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .cropper .resize.bottomleft{bottom:-12px;left:-12px;cursor:nesw-resize}:host .cropper .resize.left{top:calc(50% - 12px);left:-12px;cursor:ew-resize}:host .cropper .resize-bar{position:absolute;z-index:1}:host .cropper .resize-bar.top{top:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .cropper .resize-bar.right{top:11px;right:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .cropper .resize-bar.bottom{bottom:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .cropper .resize-bar.left{top:11px;left:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .cropper.rounded{outline-color:transparent}:host .cropper.rounded:after{border-radius:100%;box-shadow:0 0 0 100vw rgba(255,255,255,.3)}@media (orientation:portrait){:host .cropper{outline-width:100vh}:host .cropper.rounded:after{box-shadow:0 0 0 100vh rgba(255,255,255,.3)}}:host .cropper.rounded .move{border-radius:100%}"]}]}],"members":{"sourceImage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":31,"character":5},"arguments":["sourceImage"]}]}],"imageFileChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":33,"character":5}}]}],"imageChangedEvent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":41,"character":5}}]}],"imageBase64":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":49,"character":5}}]}],"format":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":55,"character":5}}]}],"outputType":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":56,"character":5}}]}],"maintainAspectRatio":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":57,"character":5}}]}],"aspectRatio":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":58,"character":5}}]}],"resizeToWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":59,"character":5}}]}],"resizeToHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":60,"character":5}}]}],"cropperMinWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":61,"character":5}}]}],"cropperMinHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":62,"character":5}}]}],"roundCropper":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":63,"character":5}}]}],"onlyScaleDown":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":64,"character":5}}]}],"imageQuality":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":65,"character":5}}]}],"autoCrop":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":66,"character":5}}]}],"backgroundColor":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":67,"character":5}}]}],"containWithinAspectRatio":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":68,"character":5}}]}],"cropper":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":69,"character":5}}]}],"alignImage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":75,"character":5},"arguments":["style.text-align"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":76,"character":5}}]}],"startCropImage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":79,"character":5}}]}],"imageCropped":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":80,"character":5}}]}],"imageCroppedBase64":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":81,"character":5}}]}],"imageCroppedFile":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":82,"character":5}}]}],"imageLoaded":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":83,"character":5}}]}],"cropperReady":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":84,"character":5}}]}],"loadImageFailed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":85,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/platform-browser","name":"DomSanitizer","line":87,"character":35},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":88,"character":28},{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":89,"character":30}]}],"ngOnChanges":[{"__symbolic":"method"}],"initCropper":[{"__symbolic":"method"}],"loadImageFile":[{"__symbolic":"method"}],"isValidImageType":[{"__symbolic":"method"}],"checkExifAndLoadBase64Image":[{"__symbolic":"method"}],"fitImageToAspectRatio":[{"__symbolic":"method"}],"loadBase64Image":[{"__symbolic":"method"}],"imageLoadedInView":[{"__symbolic":"method"}],"checkImageMaxSizeRecursively":[{"__symbolic":"method"}],"onResize":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":204,"character":5},"arguments":["window:resize"]}]}],"rotateLeft":[{"__symbolic":"method"}],"rotateRight":[{"__symbolic":"method"}],"flipHorizontal":[{"__symbolic":"method"}],"flipVertical":[{"__symbolic":"method"}],"transformBase64":[{"__symbolic":"method"}],"resizeCropperPosition":[{"__symbolic":"method"}],"resetCropperPosition":[{"__symbolic":"method"}],"startMove":[{"__symbolic":"method"}],"moveImg":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":281,"character":5},"arguments":["document:mousemove",["$event"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":282,"character":5},"arguments":["document:touchmove",["$event"]]}]}],"setMaxSize":[{"__symbolic":"method"}],"setCropperScaledMinSize":[{"__symbolic":"method"}],"setCropperScaledMinWidth":[{"__symbolic":"method"}],"setCropperScaledMinHeight":[{"__symbolic":"method"}],"checkCropperPosition":[{"__symbolic":"method"}],"moveStop":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":350,"character":5},"arguments":["document:mouseup"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":351,"character":5},"arguments":["document:touchend"]}]}],"move":[{"__symbolic":"method"}],"resize":[{"__symbolic":"method"}],"checkAspectRatio":[{"__symbolic":"method"}],"doAutoCrop":[{"__symbolic":"method"}],"crop":[{"__symbolic":"method"}],"getImagePosition":[{"__symbolic":"method"}],"cropToOutputType":[{"__symbolic":"method"}],"cropToBase64":[{"__symbolic":"method"}],"cropToFile":[{"__symbolic":"method"}],"getCanvasBlob":[{"__symbolic":"method"}],"getQuality":[{"__symbolic":"method"}],"getResizeRatio":[{"__symbolic":"method"}],"getClientX":[{"__symbolic":"method"}],"getClientY":[{"__symbolic":"method"}]}}},"origins":{"ImageCropperModule":"./src/image-cropper.module","OutputType":"./src/component/image-cropper.component","ImageCropperComponent":"./src/component/image-cropper.component"},"importAs":"ngx-image-cropper"}
{"__symbolic":"module","version":4,"exports":[{"export":[{"name":"CropperPosition","as":"CropperPosition"}],"from":"./src/cropper-position.interface"},{"export":[{"name":"ImageCroppedEvent","as":"ImageCroppedEvent"}],"from":"./src/image-cropped-event.interface"}],"metadata":{"ImageCropperModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":6,"character":8}],"declarations":[{"__symbolic":"reference","name":"ImageCropperComponent"}],"exports":[{"__symbolic":"reference","name":"ImageCropperComponent"}]}]}],"members":{}},"OutputType":{"__symbolic":"interface"},"ImageCropperComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":11,"character":1},"arguments":[{"selector":"image-cropper","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":15,"character":21},"member":"OnPush"},"template":"<div [style.background]=\"imageVisible && backgroundColor\">\n <img\n #sourceImage\n class=\"source-image\"\n [src]=\"safeImgDataUrl\"\n [style.visibility]=\"imageVisible ? 'visible' : 'hidden'\"\n (load)=\"imageLoadedInView()\"\n />\n <div class=\"cropper\"\n *ngIf=\"imageVisible\"\n [class.rounded]=\"roundCropper\"\n [style.top.px]=\"cropper.y1\"\n [style.left.px]=\"cropper.x1\"\n [style.width.px]=\"cropper.x2 - cropper.x1\"\n [style.height.px]=\"cropper.y2 - cropper.y1\"\n [style.margin-left]=\"alignImage === 'center' ? marginLeft : null\"\n [style.visibility]=\"imageVisible ? 'visible' : 'hidden'\"\n >\n <div\n (mousedown)=\"startMove($event, 'move')\"\n (touchstart)=\"startMove($event, 'move')\"\n class=\"move\"\n >&nbsp;</div>\n <span\n class=\"resize topleft\"\n (mousedown)=\"startMove($event, 'resize', 'topleft')\"\n (touchstart)=\"startMove($event, 'resize', 'topleft')\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize top\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize topright\"\n (mousedown)=\"startMove($event, 'resize', 'topright')\"\n (touchstart)=\"startMove($event, 'resize', 'topright')\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize right\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize bottomright\"\n (mousedown)=\"startMove($event, 'resize', 'bottomright')\"\n (touchstart)=\"startMove($event, 'resize', 'bottomright')\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize bottom\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize bottomleft\"\n (mousedown)=\"startMove($event, 'resize', 'bottomleft')\"\n (touchstart)=\"startMove($event, 'resize', 'bottomleft')\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize left\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize-bar top\"\n (mousedown)=\"startMove($event, 'resize', 'top')\"\n (touchstart)=\"startMove($event, 'resize', 'top')\"\n ></span>\n <span\n class=\"resize-bar right\"\n (mousedown)=\"startMove($event, 'resize', 'right')\"\n (touchstart)=\"startMove($event, 'resize', 'right')\"\n ></span>\n <span\n class=\"resize-bar bottom\"\n (mousedown)=\"startMove($event, 'resize', 'bottom')\"\n (touchstart)=\"startMove($event, 'resize', 'bottom')\"\n ></span>\n <span\n class=\"resize-bar left\"\n (mousedown)=\"startMove($event, 'resize', 'left')\"\n (touchstart)=\"startMove($event, 'resize', 'left')\"\n ></span>\n </div>\n</div>\n","styles":[":host{display:flex;position:relative;width:100%;max-width:100%;max-height:100%;overflow:hidden;padding:5px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host>div{position:relative;width:100%}:host>div img.source-image{max-width:100%;max-height:100%}:host .cropper{position:absolute;display:flex;color:#53535c;background:0 0;touch-action:none;outline:rgba(255,255,255,.3) solid 100vw}:host .cropper:after{position:absolute;content:\"\";top:0;bottom:0;left:0;right:0;pointer-events:none;border:1px dashed;opacity:.75;color:inherit;z-index:1}:host .cropper .move{width:100%;cursor:move;border:1px solid rgba(255,255,255,.5)}:host .cropper .resize{position:absolute;display:inline-block;line-height:6px;padding:8px;opacity:.85;z-index:1}:host .cropper .resize .square{display:inline-block;background:#53535c;width:6px;height:6px;border:1px solid rgba(255,255,255,.5);box-sizing:content-box}:host .cropper .resize.topleft{top:-12px;left:-12px;cursor:nwse-resize}:host .cropper .resize.top{top:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .cropper .resize.topright{top:-12px;right:-12px;cursor:nesw-resize}:host .cropper .resize.right{top:calc(50% - 12px);right:-12px;cursor:ew-resize}:host .cropper .resize.bottomright{bottom:-12px;right:-12px;cursor:nwse-resize}:host .cropper .resize.bottom{bottom:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .cropper .resize.bottomleft{bottom:-12px;left:-12px;cursor:nesw-resize}:host .cropper .resize.left{top:calc(50% - 12px);left:-12px;cursor:ew-resize}:host .cropper .resize-bar{position:absolute;z-index:1}:host .cropper .resize-bar.top{top:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .cropper .resize-bar.right{top:11px;right:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .cropper .resize-bar.bottom{bottom:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .cropper .resize-bar.left{top:11px;left:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .cropper.rounded{outline-color:transparent}:host .cropper.rounded:after{border-radius:100%;box-shadow:0 0 0 100vw rgba(255,255,255,.3)}@media (orientation:portrait){:host .cropper{outline-width:100vh}:host .cropper.rounded:after{box-shadow:0 0 0 100vh rgba(255,255,255,.3)}}:host .cropper.rounded .move{border-radius:100%}"]}]}],"members":{"sourceImage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":31,"character":5},"arguments":["sourceImage",{"static":false}]}]}],"imageFileChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":33,"character":5}}]}],"imageChangedEvent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":41,"character":5}}]}],"imageBase64":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":49,"character":5}}]}],"format":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":55,"character":5}}]}],"outputType":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":56,"character":5}}]}],"maintainAspectRatio":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":57,"character":5}}]}],"aspectRatio":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":58,"character":5}}]}],"resizeToWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":59,"character":5}}]}],"resizeToHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":60,"character":5}}]}],"cropperMinWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":61,"character":5}}]}],"cropperMinHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":62,"character":5}}]}],"roundCropper":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":63,"character":5}}]}],"onlyScaleDown":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":64,"character":5}}]}],"imageQuality":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":65,"character":5}}]}],"autoCrop":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":66,"character":5}}]}],"backgroundColor":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":67,"character":5}}]}],"containWithinAspectRatio":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":68,"character":5}}]}],"cropper":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":69,"character":5}}]}],"alignImage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":75,"character":5},"arguments":["style.text-align"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":76,"character":5}}]}],"startCropImage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":79,"character":5}}]}],"imageCropped":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":80,"character":5}}]}],"imageCroppedBase64":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":81,"character":5}}]}],"imageCroppedFile":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":82,"character":5}}]}],"imageLoaded":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":83,"character":5}}]}],"cropperReady":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":84,"character":5}}]}],"loadImageFailed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":85,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/platform-browser","name":"DomSanitizer","line":87,"character":35},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":88,"character":28},{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":89,"character":30}]}],"ngOnChanges":[{"__symbolic":"method"}],"initCropper":[{"__symbolic":"method"}],"loadImageFile":[{"__symbolic":"method"}],"isValidImageType":[{"__symbolic":"method"}],"checkExifAndLoadBase64Image":[{"__symbolic":"method"}],"fitImageToAspectRatio":[{"__symbolic":"method"}],"loadBase64Image":[{"__symbolic":"method"}],"imageLoadedInView":[{"__symbolic":"method"}],"checkImageMaxSizeRecursively":[{"__symbolic":"method"}],"onResize":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":204,"character":5},"arguments":["window:resize"]}]}],"rotateLeft":[{"__symbolic":"method"}],"rotateRight":[{"__symbolic":"method"}],"flipHorizontal":[{"__symbolic":"method"}],"flipVertical":[{"__symbolic":"method"}],"transformBase64":[{"__symbolic":"method"}],"resizeCropperPosition":[{"__symbolic":"method"}],"resetCropperPosition":[{"__symbolic":"method"}],"startMove":[{"__symbolic":"method"}],"moveImg":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":281,"character":5},"arguments":["document:mousemove",["$event"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":282,"character":5},"arguments":["document:touchmove",["$event"]]}]}],"setMaxSize":[{"__symbolic":"method"}],"setCropperScaledMinSize":[{"__symbolic":"method"}],"setCropperScaledMinWidth":[{"__symbolic":"method"}],"setCropperScaledMinHeight":[{"__symbolic":"method"}],"checkCropperPosition":[{"__symbolic":"method"}],"moveStop":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":350,"character":5},"arguments":["document:mouseup"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":351,"character":5},"arguments":["document:touchend"]}]}],"move":[{"__symbolic":"method"}],"resize":[{"__symbolic":"method"}],"checkAspectRatio":[{"__symbolic":"method"}],"doAutoCrop":[{"__symbolic":"method"}],"crop":[{"__symbolic":"method"}],"getImagePosition":[{"__symbolic":"method"}],"cropToOutputType":[{"__symbolic":"method"}],"cropToBase64":[{"__symbolic":"method"}],"cropToFile":[{"__symbolic":"method"}],"getCanvasBlob":[{"__symbolic":"method"}],"getQuality":[{"__symbolic":"method"}],"getResizeRatio":[{"__symbolic":"method"}],"getClientX":[{"__symbolic":"method"}],"getClientY":[{"__symbolic":"method"}]}}},"origins":{"ImageCropperModule":"./src/image-cropper.module","OutputType":"./src/component/image-cropper.component","ImageCropperComponent":"./src/component/image-cropper.component"},"importAs":"ngx-image-cropper"}
{
"name": "ngx-image-cropper",
"version": "1.4.1",
"version": "1.5.0",
"description": "An image cropper for Angular",

@@ -20,7 +20,5 @@ "main": "bundles/ngx-image-cropper.umd.js",

"angular",
"angular 2",
"angular 4",
"angular 5",
"angular 6",
"angular 7",
"angular 8",
"cropper",

@@ -36,11 +34,11 @@ "image cropper"

"devDependencies": {
"@angular/common": "^6.1.0",
"@angular/compiler": "^6.1.0",
"@angular/compiler-cli": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/platform-browser": "^6.1.0",
"ng-packagr": "^4.1.0",
"rxjs": "^6.0.0",
"typescript": "~2.7.2",
"zone.js": "~0.8.26"
"@angular/common": "^8.2.0",
"@angular/compiler": "^8.2.0",
"@angular/compiler-cli": "^8.2.0",
"@angular/core": "^8.2.0",
"@angular/platform-browser": "^8.2.0",
"ng-packagr": "^5.5.0",
"rxjs": "^6.5.0",
"typescript": "~3.4.5",
"zone.js": "~0.10.2"
},

@@ -47,0 +45,0 @@ "esm5": "esm5/ngx-image-cropper.js",

@@ -85,23 +85,23 @@ # Image cropper for Angular

### Inputs
| Name | Type | Default | Description |
| ------------------------ |---------- | ------------ | --------------- |
| `imageChangedEvent` | FileEvent | | The change event from your file input (set to `null` to reset the cropper) |
| `imageFileChanged` | Blob(File)| | The file you want to change (set to `null` to reset the cropper) |
| `imageBase64` | string | | If you don't want to use a file input, you can set a base64 image directly and it will be loaded into the cropper |
| `format` | string | png | Output format (png, jpeg, webp, bmp, ico) (not all browsers support all types, png is always supported, others are optional) |
| `outputType` | string | both | Output type ('base64', 'file' or 'both'). Converting the image to a Blob can be quite a heavy operation. With this option, you could choose to only get the base64 which will improve the speed of cropping significantly |
| `aspectRatio` | number | 1 / 1 | The width / height ratio (e.g. 1 / 1 for a square, 4 / 3, 16 / 9 ...) |
| `maintainAspectRatio` | boolean | true | Keep width and height of cropped image equal according to the aspectRatio |
| `containWithAspectRatio` | boolean | false | When set to true, padding will be added around the image to make it fit to the aspect ratio |
| `resizeToWidth` | number | 0 (disabled) | Cropped image will be resized to this width (in px) |
| `resizeToHeight` | number | 0 (disabled) | Cropped image will be resized to this height (in px) (will be ignored if resizeToWidth is set) |
| `cropperMinWidth` | number | 0 (disabled) | The cropper cannot be made smaller than this number of pixels in width (relative to original image's size) (in px) |
| `cropperMinHeight` | number | 0 (disabled) | The cropper cannot be made smaller than this number of pixels in height (relative to original image's size) (in px) (will be ignored if `maintainAspectRatio` is set) |
| `onlyScaleDown` | boolean | false | When the `resizeToWidth` is set, enabling this option will make sure smaller images are not scaled up |
| `cropper` | CropperPosition | | To be able to overwrite the cropper coordinates, you can use this input. Create a new object of type `CropperPosition` and assign it to this input. Make sure to create a new object each time you wish to overwrite the cropper's position and wait for the `cropperReady` event to have fired. |
| `roundCropper` | boolean | false | Set this to true for a round cropper. Resulting image will still be square, use `border-radius: 100%` on resulting image to show it as round. |
| `imageQuality` | number | 92 | This only applies when using jpeg or webp as output format. Entering a number between 0 and 100 will determine the quality of the output image. |
| `autoCrop` | boolean | true | When set to true, the cropper will emit an image each time the position or size of the cropper is changed. When set to false, you can call the crop method yourself (use @ViewChild to get access to the croppers methods). |
| `alignImage` | 'left' or 'center' | 'center' | Use this to align the image in the cropper either to the left or center. |
| `backgroundColor` | string | 'white' | Use this to set a backgroundColor, this is useful if you upload an image of a format with transparent colors and convert it to 'jpeg' or 'bmp'. The transparent pixels will then become the set color or the default value. Enter a color HashCode or one of known HTML color names (https://www.w3schools.com/tags/ref_colornames.asp).|
| Name | Type | Default | Description |
| -------------------------- |---------- | ------------ | --------------- |
| `imageChangedEvent` | FileEvent | | The change event from your file input (set to `null` to reset the cropper) |
| `imageFileChanged` | Blob(File)| | The file you want to change (set to `null` to reset the cropper) |
| `imageBase64` | string | | If you don't want to use a file input, you can set a base64 image directly and it will be loaded into the cropper |
| `format` | string | png | Output format (png, jpeg, webp, bmp, ico) (not all browsers support all types, png is always supported, others are optional) |
| `outputType` | string | both | Output type ('base64', 'file' or 'both'). Converting the image to a Blob can be quite a heavy operation. With this option, you could choose to only get the base64 which will improve the speed of cropping significantly |
| `aspectRatio` | number | 1 / 1 | The width / height ratio (e.g. 1 / 1 for a square, 4 / 3, 16 / 9 ...) |
| `maintainAspectRatio` | boolean | true | Keep width and height of cropped image equal according to the aspectRatio |
| `containWithinAspectRatio` | boolean | false | When set to true, padding will be added around the image to make it fit to the aspect ratio |
| `resizeToWidth` | number | 0 (disabled) | Cropped image will be resized to this width (in px) |
| `resizeToHeight` | number | 0 (disabled) | Cropped image will be resized to this height (in px) (will be ignored if resizeToWidth is set) |
| `cropperMinWidth` | number | 0 (disabled) | The cropper cannot be made smaller than this number of pixels in width (relative to original image's size) (in px) |
| `cropperMinHeight` | number | 0 (disabled) | The cropper cannot be made smaller than this number of pixels in height (relative to original image's size) (in px) (will be ignored if `maintainAspectRatio` is set) |
| `onlyScaleDown` | boolean | false | When the `resizeToWidth` is set, enabling this option will make sure smaller images are not scaled up |
| `cropper` | CropperPosition | | To be able to overwrite the cropper coordinates, you can use this input. Create a new object of type `CropperPosition` and assign it to this input. Make sure to create a new object each time you wish to overwrite the cropper's position and wait for the `cropperReady` event to have fired. |
| `roundCropper` | boolean | false | Set this to true for a round cropper. Resulting image will still be square, use `border-radius: 100%` on resulting image to show it as round. |
| `imageQuality` | number | 92 | This only applies when using jpeg or webp as output format. Entering a number between 0 and 100 will determine the quality of the output image. |
| `autoCrop` | boolean | true | When set to true, the cropper will emit an image each time the position or size of the cropper is changed. When set to false, you can call the crop method yourself (use @ViewChild to get access to the croppers methods). |
| `alignImage` | 'left' or 'center' | 'center' | Use this to align the image in the cropper either to the left or center. |
| `backgroundColor` | string | | Use this to set a backgroundColor, this is useful if you upload an image of a format with transparent colors and convert it to 'jpeg' or 'bmp'. The transparent pixels will then become the set color or the default value. Enter a color HashCode or one of known HTML color names (https://www.w3schools.com/tags/ref_colornames.asp).|

@@ -108,0 +108,0 @@ ### Outputs

@@ -49,10 +49,10 @@ import { ElementRef, EventEmitter, OnChanges, SimpleChanges, ChangeDetectorRef, NgZone } from '@angular/core';

ngOnChanges(changes: SimpleChanges): void;
private initCropper();
private loadImageFile(file);
private isValidImageType(type);
private checkExifAndLoadBase64Image(imageBase64);
private fitImageToAspectRatio(imageBase64);
private loadBase64Image(imageBase64);
private initCropper;
private loadImageFile;
private isValidImageType;
private checkExifAndLoadBase64Image;
private fitImageToAspectRatio;
private loadBase64Image;
imageLoadedInView(): void;
private checkImageMaxSizeRecursively();
private checkImageMaxSizeRecursively;
onResize(): void;

@@ -63,27 +63,27 @@ rotateLeft(): void;

flipVertical(): void;
private transformBase64(exifOrientation);
private resizeCropperPosition();
private resetCropperPosition();
private transformBase64;
private resizeCropperPosition;
private resetCropperPosition;
startMove(event: any, moveType: string, position?: string | null): void;
moveImg(event: any): void;
private setMaxSize();
private setCropperScaledMinSize();
private setCropperScaledMinWidth();
private setCropperScaledMinHeight();
private checkCropperPosition(maintainSize?);
private setMaxSize;
private setCropperScaledMinSize;
private setCropperScaledMinWidth;
private setCropperScaledMinHeight;
private checkCropperPosition;
moveStop(): void;
private move(event);
private resize(event);
private checkAspectRatio();
private doAutoCrop();
private move;
private resize;
private checkAspectRatio;
private doAutoCrop;
crop(outputType?: OutputType): ImageCroppedEvent | Promise<ImageCroppedEvent> | null;
private getImagePosition();
private cropToOutputType(outputType, cropCanvas, output);
private cropToBase64(cropCanvas);
private cropToFile(cropCanvas);
private getCanvasBlob(cropCanvas);
private getQuality();
private getResizeRatio(width, height);
private getClientX(event);
private getClientY(event);
private getImagePosition;
private cropToOutputType;
private cropToBase64;
private cropToFile;
private getCanvasBlob;
private getQuality;
private getResizeRatio;
private getClientX;
private getClientY;
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc