New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-advanced-cropper

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-advanced-cropper - npm Package Compare versions

Comparing version 0.13.1 to 0.13.2

6

dist/index.es.js

@@ -49,5 +49,5 @@ import Vue from"vue";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n,a=0;a<t.length;a++)n=t[a],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),e}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null==arguments[t]?{}:arguments[t],a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){_defineProperty(e,t,n[t])})}return e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function createCommonjsModule(e,t){return t={exports:{}},e(t,t.exports),t.exports}var classnames=createCommonjsModule(function(e){/*!

// Therefore there is workaround to prevent processing after the component was unmounted
if(this.$refs.canvas){var t=this.$refs.image,i=this.checkOrientation?prepareSource(this.$refs.sourceCanvas,t,this.imageTransforms):t,n=this.$refs.canvas;n.width=e.width,n.height=e.height;var a=n.getContext("2d");a.drawImage(i,e.left,e.top,e.width,e.height,0,0,e.width,e.height)}},update:function(){this.$emit("change",this.getResult())},onChangeCoordinates:function(e){var t=!(1<arguments.length&&arguments[1]!==void 0)||arguments[1];this.coordinates=e,this.$listeners&&this.$listeners.change&&(t?this.debouncedUpdate():this.update())},onChangeImage:function(){var e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){var t=isCrossOriginURL(this.src);t&&this.canvas&&this.checkCrossOrigin&&(this.imageAttributes.crossOrigin="anonymous"),setTimeout(function(){e.checkOrientation?parseImage(t?addTimestamp(e.src):e.src).then(e.onParseImage):e.onParseImage({})},this.transitionTime)}else this.onChangeCoordinates({left:0,top:0,width:0,height:0},!1)},onParseImage:function(e){var t=this,i=e.arrayBuffer,n=e.orientation;this.imageAttributes.src=i&&n&&isLocal(this.src)?arrayBufferToDataURL(i):this.src,this.imageTransforms=getImageTransforms(n),Vue.nextTick(function(){var e=t.$refs.image;e&&e.complete&&t.refreshImage().then(t.resetCoordinates)})},onResize:function(e){this.frozenDirections.width&&(e.directions.left=0,e.directions.right=0),this.frozenDirections.height&&(e.directions.top=0,e.directions.bottom=0),this.onChangeCoordinates(this.resizeAlgorithm({coordinates:this.coordinates,restrictions:this.stencilRestrictions,imageSize:this.imageSize,coefficient:this.coefficient,aspectRatio:this.stencilAspectRatios(),resizeEvent:e}))},onMove:function(e){this.onChangeCoordinates(this.moveAlgorithm({coordinates:this.coordinates,imageSize:this.imageSize,coefficient:this.coefficient,moveEvent:e}))},defaultCoordinates:function(){var e=Math.max,t=Math.min,i=this.stencilAspectRatios(),n=this.stencilRestrictions,a=n.minWidth,o=n.minHeight,s=n.maxWidth,r=n.maxHeight,h=this.imageSize,c={};if(!i.minimum&&!i.maximum)c.height=o,c.width=a;else{var l={width:{maximum:i.minimum?t(r,a/i.minimum):r,minimum:i.maximum?e(o,a/i.maximum):o},height:{maximum:i.maximum?t(s,o*i.maximum):s,minimum:i.mininum?e(a,o*i.mininum):a}};if(l.width.maximum>=l.width.minimum)c.width=a,c.height=l.width.minimum;else if(l.height.maximum>=l.height.minimum)c.height=o,c.width=l.height.minimum;else throw"Error: current aspect ratio is incompatible with minimum/maximum height and width settings. Can't setup default coordinates"}return c.left=h.width/2-c.width/2,c.top=h.height/2-c.height/2,c},setCoordinates:function(e){var t=this;Vue.nextTick(function(){return t.imageLoaded?void t.applyTransforms(e):void(t.delayedTransforms=e)})},applyTransforms:function(e){var t=this,i=this.imageSize,n=this.coefficient,a=this.stencilAspectRatios(),o=function(e,a){return t.moveAlgorithm({coordinates:e,imageSize:i,coefficient:n,moveEvent:new MoveEvent(null,{left:(a.left-e.left)/n,top:(a.top-e.top)/n})})},s=function(e,s){var r=t.defaultCoordinates();return r=t.resizeAlgorithm({coordinates:r,restrictions:t.stencilRestrictions,imageSize:i,coefficient:n,aspectRatio:a,resizeEvent:new ResizeEvent(null,{left:(s.width-r.width)/(2*n),right:(s.width-r.width)/(2*n),top:(s.height-r.height)/(2*n),bottom:(s.height-r.height)/(2*n)})}),o(r,{left:e.left,top:e.top})},r=this.coordinates;return e.forEach||(e=[e]),e.forEach(function(e){var i={};i="function"==typeof e?e(_objectSpread({},r),t.imageSize):e,isUndefined(i.width)&&isUndefined(i.height)||(r=s(r,_objectSpread({},r,i))),isUndefined(i.left)&&isUndefined(i.top)||(r=o(r,_objectSpread({},r,i)))}),this.onChangeCoordinates(r,!1),r},resetCoordinates:function(){var e=this;// This function can be asynchronously called after completion of refreshing image promise
if(this.$refs.canvas){var t=this.$refs.image,i=this.checkOrientation?prepareSource(this.$refs.sourceCanvas,t,this.imageTransforms):t,n=this.$refs.canvas;n.width=e.width,n.height=e.height;var a=n.getContext("2d");a.drawImage(i,e.left,e.top,e.width,e.height,0,0,e.width,e.height)}},update:function(){this.$emit("change",this.getResult())},onChangeCoordinates:function(e){var t=!(1<arguments.length&&arguments[1]!==void 0)||arguments[1];this.coordinates=e,this.$listeners&&this.$listeners.change&&(t?this.debouncedUpdate():this.update())},onChangeImage:function(){var e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){var t=isCrossOriginURL(this.src);t&&this.canvas&&this.checkCrossOrigin&&(this.imageAttributes.crossOrigin="anonymous"),setTimeout(function(){e.checkOrientation?parseImage(t?addTimestamp(e.src):e.src).then(e.onParseImage):e.onParseImage({})},this.transitionTime)}else this.clearImage()},onParseImage:function(e){var t=this,i=e.arrayBuffer,n=e.orientation;this.imageAttributes.src=i&&n&&isLocal(this.src)?arrayBufferToDataURL(i):this.src,this.imageTransforms=getImageTransforms(n),Vue.nextTick(function(){var e=t.$refs.image;e&&e.complete&&t.refreshImage().then(t.resetCoordinates)})},onResize:function(e){this.frozenDirections.width&&(e.directions.left=0,e.directions.right=0),this.frozenDirections.height&&(e.directions.top=0,e.directions.bottom=0),this.onChangeCoordinates(this.resizeAlgorithm({coordinates:this.coordinates,restrictions:this.stencilRestrictions,imageSize:this.imageSize,coefficient:this.coefficient,aspectRatio:this.stencilAspectRatios(),resizeEvent:e}))},onMove:function(e){this.onChangeCoordinates(this.moveAlgorithm({coordinates:this.coordinates,imageSize:this.imageSize,coefficient:this.coefficient,moveEvent:e}))},defaultCoordinates:function(){var e=Math.max,t=Math.min,i=this.stencilAspectRatios(),n=this.stencilRestrictions,a=n.minWidth,o=n.minHeight,s=n.maxWidth,r=n.maxHeight,h=this.imageSize,c={};if(!i.minimum&&!i.maximum)c.height=o,c.width=a;else{var l={width:{maximum:i.minimum?t(r,a/i.minimum):r,minimum:i.maximum?e(o,a/i.maximum):o},height:{maximum:i.maximum?t(s,o*i.maximum):s,minimum:i.mininum?e(a,o*i.mininum):a}};if(l.width.maximum>=l.width.minimum)c.width=a,c.height=l.width.minimum;else if(l.height.maximum>=l.height.minimum)c.height=o,c.width=l.height.minimum;else throw"Error: current aspect ratio is incompatible with minimum/maximum height and width settings. Can't setup default coordinates"}return c.left=h.width/2-c.width/2,c.top=h.height/2-c.height/2,c},setCoordinates:function(e){var t=this;Vue.nextTick(function(){return t.imageLoaded?void t.applyTransforms(e):void(t.delayedTransforms=e)})},applyTransforms:function(e){var t=this,i=this.imageSize,n=this.coefficient,a=this.stencilAspectRatios(),o=function(e,a){return t.moveAlgorithm({coordinates:e,imageSize:i,coefficient:n,moveEvent:new MoveEvent(null,{left:(a.left-e.left)/n,top:(a.top-e.top)/n})})},s=function(e,s){var r=t.defaultCoordinates();return r=t.resizeAlgorithm({coordinates:r,restrictions:t.stencilRestrictions,imageSize:i,coefficient:n,aspectRatio:a,resizeEvent:new ResizeEvent(null,{left:(s.width-r.width)/(2*n),right:(s.width-r.width)/(2*n),top:(s.height-r.height)/(2*n),bottom:(s.height-r.height)/(2*n)})}),o(r,{left:e.left,top:e.top})},r=this.coordinates;return e.forEach||(e=[e]),e.forEach(function(e){var i={};i="function"==typeof e?e(_objectSpread({},r),t.imageSize):e,isUndefined(i.width)&&isUndefined(i.height)||(r=s(r,_objectSpread({},r,i))),isUndefined(i.left)&&isUndefined(i.top)||(r=o(r,_objectSpread({},r,i)))}),this.onChangeCoordinates(r,!1),r},resetCoordinates:function(){var e=this;// This function can be asynchronously called after completion of refreshing image promise
// Therefore there is a workaround to prevent processing after the component was unmounted
if(this.$refs.image){var t=this.$refs.cropper,i=this.$refs.image,n=this.stencilRestrictions,a=n.minWidth,o=n.minHeight,s=n.maxWidth,r=n.maxHeight,h=n.widthFrozen,c=n.heightFrozen;this.frozenDirections.width=!!h,this.frozenDirections.height=!!c;var l=migrateAlgorithm(this.defaultSize,"defaultSize",function(e){return[e.cropper,e.image,{minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight},e.imageWidth,e.imageHeight,e.props]})(_objectSpread({cropper:t,image:i,imageWidth:this.imageSize.width,imageHeight:this.imageSize.height,props:this.$props},this.stencilRestrictions));(l.width<a||l.height<o||l.width>s||l.height>r)&&console.warn("Warning: default size breaking size restrictions. Check your defaultSize function");var d=[l,function(n){return _objectSpread({},migrateAlgorithm(e.defaultPosition,"defaultPosition",function(e){return[e.cropper,e.image,e.stencilWidth,e.stencilHeight,e.imageWidth,e.imageHeight,e.props]})({cropper:t,image:i,stencilWidth:n.width,stencilHeight:n.height,imageWidth:e.imageSize.width,imageHeight:e.imageSize.height,props:e.$props}))}];this.delayedTransforms&&d.push.apply(d,_toConsumableArray(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.applyTransforms(d),this.delayedTransforms=null,this.imageLoaded=!0}},refreshImage:function(){var e=this,t=this.$refs.image,i=this.$refs.stretcher;this.imageTransforms.flipped?(this.imageSize.height=t.naturalWidth,this.imageSize.width=t.naturalHeight):(this.imageSize.height=t.naturalHeight,this.imageSize.width=t.naturalWidth);var n=this.imageSize.width/this.imageSize.height;return this.imageSize.height>this.imageSize.width?(i.style.height="".concat(this.imageSize.height,"px"),i.style.width="".concat(i.clientHeight*n,"px"),i.clientWidth/i.clientHeight!=n&&(i.style.height="".concat(i.clientWidth/n,"px"))):(i.style.width="".concat(this.imageSize.width,"px"),i.style.height="".concat(i.clientWidth/n,"px"),i.clientHeight/i.clientWidth!=n&&(i.style.width="".concat(i.clientHeight*n,"px"))),new Promise(function(t){var i=e.$refs.cropper,n=e.$refs.image;Vue.nextTick(function(){var a=migrateAlgorithm(e.areaSize,"areaSize",function(e){return[e.cropper,e.image,e.imageWidth,e.imageHeight]})({cropper:i,image:n,imageWidth:e.imageSize.width,imageHeight:e.imageSize.height}),o=a.height,s=a.width;o&&(e.boundarySize.height=o),s&&(e.boundarySize.width=s),t()})})},stencilAspectRatios:function(){return this.$refs.stencil.aspectRatios?this.$refs.stencil.aspectRatios():{minimum:this.stencilProps.aspectRatio||this.stencilProps.minAspectRatio,maximum:this.stencilProps.aspectRatio||this.stencilProps.maxAspectRatio}}}},__vue_script__$a=script$a,__vue_render__$a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"cropper",class:e.classes.cropper},[i("div",{class:e.classes.background,style:e.areaStyle}),e._v(" "),i("div",{ref:"stretcher",class:e.classes.stretcher}),e._v(" "),i("div",{ref:"area",class:e.classes.area,style:e.areaStyle},[i("img",{ref:"image",class:e.classes.image,style:e.imageStyle,attrs:{crossOrigin:e.imageAttributes.crossOrigin,src:e.imageAttributes.src}}),e._v(" "),i(e.stencilComponent,e._b({ref:"stencil",tag:"component",attrs:{img:{src:e.imageAttributes.src,size:e.imageSize,transforms:e.imageTransforms},"result-coordinates":e.coordinates,"stencil-coordinates":e.stencilCoordinates},on:{resize:e.onResize,move:e.onMove}},"component",e.stencilProps,!1)),e._v(" "),e.canvas?i("canvas",{ref:"canvas",style:{display:"none"}}):e._e(),e._v(" "),e.canvas?i("canvas",{ref:"sourceCanvas",style:{display:"none"}}):e._e()],1)])},__vue_staticRenderFns__$a=[];/* script */__vue_render__$a._withStripped=!0;/* style */var __vue_inject_styles__$a=void 0,__vue_scope_id__$a=void 0,__vue_module_identifier__$a=void 0,__vue_is_functional_template__$a=!1,Cropper=normalizeComponent_1({render:__vue_render__$a,staticRenderFns:__vue_staticRenderFns__$a},void 0,__vue_script__$a,__vue_scope_id__$a,__vue_is_functional_template__$a,__vue_module_identifier__$a,void 0,void 0),cn$a=easyBem("vue-preview-image"),script$b={name:"PreviewImage",props:{img:{type:String},classname:{type:String},imageClassname:{type:String},width:{type:Number},height:{type:Number},top:{type:Number},left:{type:Number},previewWidth:{type:Number,required:!0},previewHeight:{type:Number,required:!0}},data:function(){return{imageSize:{width:0,height:0}}},computed:{classnames:function(){return{default:classnames(cn$a(),this.classname),image:classnames(cn$a("image"),this.imageClassname)}},wrapperStyle:function(){return{width:"".concat(this.previewWidth,"px"),height:"".concat(this.previewHeight,"px")}},imageStyle:function(){var e=this.previewHeight/this.height,t=this.imageSize.height*e,i=this.imageSize.width*e;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(-this.left*e,"px"),top:"".concat(-this.top*e,"px")}}},watch:{img:function(){this.onChangeImage()}},mounted:function(){this.onChangeImage()},methods:{refreshImage:function(){var e=this.$refs.image;this.imageSize.height=e.naturalHeight,this.imageSize.width=e.naturalWidth},onChangeImage:function(){var e=this,t=this.$refs.image;t.complete?this.refreshImage():t.addEventListener("load",function(){e.refreshImage()})}}},__vue_script__$b=script$b,__vue_render__$b=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default,style:e.wrapperStyle},[i("img",{ref:"image",class:e.classnames.image,style:e.imageStyle,attrs:{src:e.img}})])},__vue_staticRenderFns__$b=[];/* scoped */__vue_render__$b._withStripped=!0;/* style */var __vue_inject_styles__$b=void 0,__vue_scope_id__$b=void 0,__vue_module_identifier__$b=void 0,__vue_is_functional_template__$b=!1,PreviewImage=normalizeComponent_1({render:__vue_render__$b,staticRenderFns:__vue_staticRenderFns__$b},void 0,__vue_script__$b,__vue_scope_id__$b,__vue_is_functional_template__$b,__vue_module_identifier__$b,void 0,void 0);/* scoped */Vue.component("cropper",Cropper),Vue.component("rectangle-stencil",RectangleStencil),Vue.component("circle-stencil",CircleStencil),Vue.component("simple-handler",SimpleHandler),Vue.component("simple-line",SimpleLine);export{BoundingBox,CircleStencil,Cropper,DragEvent,DraggableArea,DraggableElement,HandlerWrapper,LineWrapper,MoveEvent,PreviewImage,PreviewResult,RectangleStencil,ResizeEvent,SimpleHandler,SimpleLine};
if(this.$refs.image){var t=this.$refs.cropper,i=this.$refs.image,n=this.stencilRestrictions,a=n.minWidth,o=n.minHeight,s=n.maxWidth,r=n.maxHeight,h=n.widthFrozen,c=n.heightFrozen;this.frozenDirections.width=!!h,this.frozenDirections.height=!!c;var l=migrateAlgorithm(this.defaultSize,"defaultSize",function(e){return[e.cropper,e.image,{minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight},e.imageWidth,e.imageHeight,e.props]})(_objectSpread({cropper:t,image:i,imageWidth:this.imageSize.width,imageHeight:this.imageSize.height,props:this.$props},this.stencilRestrictions));(l.width<a||l.height<o||l.width>s||l.height>r)&&console.warn("Warning: default size breaking size restrictions. Check your defaultSize function");var d=[l,function(n){return _objectSpread({},migrateAlgorithm(e.defaultPosition,"defaultPosition",function(e){return[e.cropper,e.image,e.stencilWidth,e.stencilHeight,e.imageWidth,e.imageHeight,e.props]})({cropper:t,image:i,stencilWidth:n.width,stencilHeight:n.height,imageWidth:e.imageSize.width,imageHeight:e.imageSize.height,props:e.$props}))}];this.delayedTransforms&&d.push.apply(d,_toConsumableArray(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.applyTransforms(d),this.delayedTransforms=null,this.imageLoaded=!0}},clearImage:function(){var e=this.$refs.stretcher;this.imageLoaded=!1,this.onChangeCoordinates({left:0,top:0,width:0,height:0},!1),setTimeout(function(){e.style.height="auto",e.style.width="auto"},this.transitionTime)},refreshImage:function(){var e=this;if(this.src){var t=this.$refs.image,i=this.$refs.stretcher;this.imageTransforms.flipped?(this.imageSize.height=t.naturalWidth,this.imageSize.width=t.naturalHeight):(this.imageSize.height=t.naturalHeight,this.imageSize.width=t.naturalWidth);var n=this.imageSize.width/this.imageSize.height;return this.imageSize.height>this.imageSize.width?(i.style.height="".concat(this.imageSize.height,"px"),i.style.width="".concat(i.clientHeight*n,"px"),i.clientWidth/i.clientHeight!=n&&(i.style.height="".concat(i.clientWidth/n,"px"))):(i.style.width="".concat(this.imageSize.width,"px"),i.style.height="".concat(i.clientWidth/n,"px"),i.clientHeight/i.clientWidth!=n&&(i.style.width="".concat(i.clientHeight*n,"px"))),new Promise(function(t){var i=e.$refs.cropper,n=e.$refs.image;Vue.nextTick(function(){var a=migrateAlgorithm(e.areaSize,"areaSize",function(e){return[e.cropper,e.image,e.imageWidth,e.imageHeight]})({cropper:i,image:n,imageWidth:e.imageSize.width,imageHeight:e.imageSize.height}),o=a.height,s=a.width;o&&(e.boundarySize.height=o),s&&(e.boundarySize.width=s),t()})})}},stencilAspectRatios:function(){return this.$refs.stencil.aspectRatios?this.$refs.stencil.aspectRatios():{minimum:this.stencilProps.aspectRatio||this.stencilProps.minAspectRatio,maximum:this.stencilProps.aspectRatio||this.stencilProps.maxAspectRatio}}}},__vue_script__$a=script$a,__vue_render__$a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"cropper",class:e.classes.cropper},[i("div",{class:e.classes.background,style:e.areaStyle}),e._v(" "),i("div",{ref:"stretcher",class:e.classes.stretcher}),e._v(" "),i("div",{ref:"area",class:e.classes.area,style:e.areaStyle},[i("img",{ref:"image",class:e.classes.image,style:e.imageStyle,attrs:{crossOrigin:e.imageAttributes.crossOrigin,src:e.imageAttributes.src}}),e._v(" "),i(e.stencilComponent,e._b({ref:"stencil",tag:"component",attrs:{img:{src:e.imageAttributes.src,size:e.imageSize,transforms:e.imageTransforms},"result-coordinates":e.coordinates,"stencil-coordinates":e.stencilCoordinates},on:{resize:e.onResize,move:e.onMove}},"component",e.stencilProps,!1)),e._v(" "),e.canvas?i("canvas",{ref:"canvas",style:{display:"none"}}):e._e(),e._v(" "),e.canvas?i("canvas",{ref:"sourceCanvas",style:{display:"none"}}):e._e()],1)])},__vue_staticRenderFns__$a=[];/* script */__vue_render__$a._withStripped=!0;/* style */var __vue_inject_styles__$a=void 0,__vue_scope_id__$a=void 0,__vue_module_identifier__$a=void 0,__vue_is_functional_template__$a=!1,Cropper=normalizeComponent_1({render:__vue_render__$a,staticRenderFns:__vue_staticRenderFns__$a},void 0,__vue_script__$a,__vue_scope_id__$a,__vue_is_functional_template__$a,__vue_module_identifier__$a,void 0,void 0),cn$a=easyBem("vue-preview-image"),script$b={name:"PreviewImage",props:{img:{type:String},classname:{type:String},imageClassname:{type:String},width:{type:Number},height:{type:Number},top:{type:Number},left:{type:Number},previewWidth:{type:Number,required:!0},previewHeight:{type:Number,required:!0}},data:function(){return{imageSize:{width:0,height:0}}},computed:{classnames:function(){return{default:classnames(cn$a(),this.classname),image:classnames(cn$a("image"),this.imageClassname)}},wrapperStyle:function(){return{width:"".concat(this.previewWidth,"px"),height:"".concat(this.previewHeight,"px")}},imageStyle:function(){var e=this.previewHeight/this.height,t=this.imageSize.height*e,i=this.imageSize.width*e;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(-this.left*e,"px"),top:"".concat(-this.top*e,"px")}}},watch:{img:function(){this.onChangeImage()}},mounted:function(){this.onChangeImage()},methods:{refreshImage:function(){var e=this.$refs.image;this.imageSize.height=e.naturalHeight,this.imageSize.width=e.naturalWidth},onChangeImage:function(){var e=this,t=this.$refs.image;t.complete?this.refreshImage():t.addEventListener("load",function(){e.refreshImage()})}}},__vue_script__$b=script$b,__vue_render__$b=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default,style:e.wrapperStyle},[i("img",{ref:"image",class:e.classnames.image,style:e.imageStyle,attrs:{src:e.img}})])},__vue_staticRenderFns__$b=[];/* scoped */__vue_render__$b._withStripped=!0;/* style */var __vue_inject_styles__$b=void 0,__vue_scope_id__$b=void 0,__vue_module_identifier__$b=void 0,__vue_is_functional_template__$b=!1,PreviewImage=normalizeComponent_1({render:__vue_render__$b,staticRenderFns:__vue_staticRenderFns__$b},void 0,__vue_script__$b,__vue_scope_id__$b,__vue_is_functional_template__$b,__vue_module_identifier__$b,void 0,void 0);/* scoped */Vue.component("cropper",Cropper),Vue.component("rectangle-stencil",RectangleStencil),Vue.component("circle-stencil",CircleStencil),Vue.component("simple-handler",SimpleHandler),Vue.component("simple-line",SimpleLine);export{BoundingBox,CircleStencil,Cropper,DragEvent,DraggableArea,DraggableElement,HandlerWrapper,LineWrapper,MoveEvent,PreviewImage,PreviewResult,RectangleStencil,ResizeEvent,SimpleHandler,SimpleLine};

@@ -82,2 +82,2 @@ function styleInject(id, css) {

};
styleInject("vue-advanced-cropper", ".vue-advanced-cropper { text-align: center; position: relative; overflow: hidden; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; max-height: 100%; max-width: 100%;}.vue-advanced-cropper__stretcher { pointer-events: none; position: relative; max-width: 100%; max-height: 100%;}.vue-advanced-cropper__image { opacity: 0.5; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; position: absolute; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}.vue-advanced-cropper__area { position: absolute; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); top: 50%;}.vue-advanced-cropper__background { position: absolute; background: black; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-advanced-cropper__stencil-wrapper { position: absolute;}/*# sourceMappingURL=Cropper.vue.map */.vue-rectangle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; cursor: move;}/*# sourceMappingURL=RectangleStencil.vue.map */.vue-circle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: content-box; box-sizing: content-box; cursor: move;}.vue-circle-stencil__preview { border-radius: 50%;}/*# sourceMappingURL=CircleStencil.vue.map */.vue-line-wrapper { background: none; position: absolute; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-line-wrapper--north, .vue-line-wrapper--south { height: 12px; width: 100%; left: 0; -webkit-transform: translateY(-50%); transform: translateY(-50%);}.vue-line-wrapper--north { top: 0; cursor: n-resize;}.vue-line-wrapper--south { top: 100%; cursor: s-resize;}.vue-line-wrapper--east, .vue-line-wrapper--west { width: 12px; height: 100%; -webkit-transform: translateX(-50%); transform: translateX(-50%); top: 0;}.vue-line-wrapper--east { left: 100%; cursor: e-resize;}.vue-line-wrapper--west { left: 0; cursor: w-resize;}/*# sourceMappingURL=LineWrapper.vue.map */.vue-bounding-box { position: relative; height: 100%; width: 100%;}.vue-bounding-box__line { position: absolute;}.vue-bounding-box__line--north { top: 0; width: 100%; cursor: n-resize;}.vue-bounding-box__line--east { left: 100%; top: 0; height: 100%; cursor: e-resize;}.vue-bounding-box__line--south { top: 100%; width: 100%; cursor: s-resize;}.vue-bounding-box__line--west { left: 0; top: 0; height: 100%; cursor: w-resize;}/*# sourceMappingURL=BoundingBox.vue.map */.vue-square-handler { display: block; background: white; height: 10px; width: 10px;}/*# sourceMappingURL=SimpleHandler.vue.map */.vue-handler-wrapper { position: absolute; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-handler-wrapper__draggable { width: 30px; height: 30px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-handler-wrapper--west-north { left: 0; top: 0; cursor: nw-resize;}.vue-handler-wrapper--north { left: 50%; top: 0; cursor: n-resize;}.vue-handler-wrapper--east-north { left: 100%; top: 0; cursor: ne-resize;}.vue-handler-wrapper--east { left: 100%; top: 50%; cursor: e-resize;}.vue-handler-wrapper--east-south { left: 100%; top: 100%; cursor: se-resize;}.vue-handler-wrapper--south { left: 50%; top: 100%; cursor: s-resize;}.vue-handler-wrapper--west-south { left: 0; top: 100%; cursor: sw-resize;}.vue-handler-wrapper--west { left: 0; top: 50%; cursor: w-resize;}/*# sourceMappingURL=HandlerWrapper.vue.map */.vue-draggable-area { position: relative;}/*# sourceMappingURL=DraggableArea.vue.map */.vue-preview-result { overflow: hidden; -webkit-box-sizing: border-box; box-sizing: border-box; position: absolute; height: 100%; width: 100%;}.vue-preview-result__wrapper { position: absolute;}.vue-preview-result__image { pointer-events: none; position: absolute; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}/*# sourceMappingURL=PreviewResult.vue.map */.vue-simple-line { background: none; -webkit-transition: border 0.5s; transition: border 0.5s; border-color: rgba(255, 255, 255, 0.3); border-width: 0; border-style: solid;}.vue-simple-line--south, .vue-simple-line--north { height: 0; width: 100%;}.vue-simple-line--east, .vue-simple-line--west { height: 100%; width: 0;}.vue-simple-line--east { border-right-width: 1px;}.vue-simple-line--west { border-left-width: 1px;}.vue-simple-line--south { border-top-width: 1px;}.vue-simple-line--north { border-bottom-width: 1px;}.vue-simple-line--hover { opacity: 1; border-color: white;}/*# sourceMappingURL=SimpleLine.vue.map */.vue-preview-image { overflow: hidden; position: relative;}.vue-preview-image__image { pointer-events: none; position: absolute; max-width: unset !important;}/*# sourceMappingURL=PreviewImage.vue.map */");//# sourceMappingURL=index.es.js.map
styleInject("vue-advanced-cropper", ".vue-advanced-cropper { text-align: center; position: relative; overflow: hidden; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; max-height: 100%; max-width: 100%;}.vue-advanced-cropper__stretcher { pointer-events: none; position: relative; max-width: 100%; max-height: 100%;}.vue-advanced-cropper__image { opacity: 0.5; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; position: absolute; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}.vue-advanced-cropper__area { position: absolute; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); top: 50%;}.vue-advanced-cropper__background { position: absolute; background: black; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-advanced-cropper__stencil-wrapper { position: absolute;}/*# sourceMappingURL=Cropper.vue.map */.vue-square-handler { display: block; background: white; height: 10px; width: 10px;}/*# sourceMappingURL=SimpleHandler.vue.map */.vue-handler-wrapper { position: absolute; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-handler-wrapper__draggable { width: 30px; height: 30px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-handler-wrapper--west-north { left: 0; top: 0; cursor: nw-resize;}.vue-handler-wrapper--north { left: 50%; top: 0; cursor: n-resize;}.vue-handler-wrapper--east-north { left: 100%; top: 0; cursor: ne-resize;}.vue-handler-wrapper--east { left: 100%; top: 50%; cursor: e-resize;}.vue-handler-wrapper--east-south { left: 100%; top: 100%; cursor: se-resize;}.vue-handler-wrapper--south { left: 50%; top: 100%; cursor: s-resize;}.vue-handler-wrapper--west-south { left: 0; top: 100%; cursor: sw-resize;}.vue-handler-wrapper--west { left: 0; top: 50%; cursor: w-resize;}/*# sourceMappingURL=HandlerWrapper.vue.map */.vue-line-wrapper { background: none; position: absolute; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-line-wrapper--north, .vue-line-wrapper--south { height: 12px; width: 100%; left: 0; -webkit-transform: translateY(-50%); transform: translateY(-50%);}.vue-line-wrapper--north { top: 0; cursor: n-resize;}.vue-line-wrapper--south { top: 100%; cursor: s-resize;}.vue-line-wrapper--east, .vue-line-wrapper--west { width: 12px; height: 100%; -webkit-transform: translateX(-50%); transform: translateX(-50%); top: 0;}.vue-line-wrapper--east { left: 100%; cursor: e-resize;}.vue-line-wrapper--west { left: 0; cursor: w-resize;}/*# sourceMappingURL=LineWrapper.vue.map */.vue-bounding-box { position: relative; height: 100%; width: 100%;}.vue-bounding-box__line { position: absolute;}.vue-bounding-box__line--north { top: 0; width: 100%; cursor: n-resize;}.vue-bounding-box__line--east { left: 100%; top: 0; height: 100%; cursor: e-resize;}.vue-bounding-box__line--south { top: 100%; width: 100%; cursor: s-resize;}.vue-bounding-box__line--west { left: 0; top: 0; height: 100%; cursor: w-resize;}/*# sourceMappingURL=BoundingBox.vue.map */.vue-draggable-area { position: relative;}/*# sourceMappingURL=DraggableArea.vue.map */.vue-preview-result { overflow: hidden; -webkit-box-sizing: border-box; box-sizing: border-box; position: absolute; height: 100%; width: 100%;}.vue-preview-result__wrapper { position: absolute;}.vue-preview-result__image { pointer-events: none; position: absolute; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}/*# sourceMappingURL=PreviewResult.vue.map */.vue-preview-image { overflow: hidden; position: relative;}.vue-preview-image__image { pointer-events: none; position: absolute; max-width: unset !important;}/*# sourceMappingURL=PreviewImage.vue.map */.vue-simple-line { background: none; -webkit-transition: border 0.5s; transition: border 0.5s; border-color: rgba(255, 255, 255, 0.3); border-width: 0; border-style: solid;}.vue-simple-line--south, .vue-simple-line--north { height: 0; width: 100%;}.vue-simple-line--east, .vue-simple-line--west { height: 100%; width: 0;}.vue-simple-line--east { border-right-width: 1px;}.vue-simple-line--west { border-left-width: 1px;}.vue-simple-line--south { border-top-width: 1px;}.vue-simple-line--north { border-bottom-width: 1px;}.vue-simple-line--hover { opacity: 1; border-color: white;}/*# sourceMappingURL=SimpleLine.vue.map */.vue-circle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: content-box; box-sizing: content-box; cursor: move;}.vue-circle-stencil__preview { border-radius: 50%;}/*# sourceMappingURL=CircleStencil.vue.map */.vue-rectangle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; cursor: move;}/*# sourceMappingURL=RectangleStencil.vue.map */");//# sourceMappingURL=index.es.js.map

@@ -49,5 +49,5 @@ 'use strict';Object.defineProperty(exports,"__esModule",{value:!0});function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e["default"]:e}var Vue=_interopDefault(require("vue"));function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n,a=0;a<t.length;a++)n=t[a],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),e}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null==arguments[t]?{}:arguments[t],a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){_defineProperty(e,t,n[t])})}return e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function createCommonjsModule(e,t){return t={exports:{}},e(t,t.exports),t.exports}var classnames=createCommonjsModule(function(e){/*!

// Therefore there is workaround to prevent processing after the component was unmounted
if(this.$refs.canvas){var t=this.$refs.image,i=this.checkOrientation?prepareSource(this.$refs.sourceCanvas,t,this.imageTransforms):t,n=this.$refs.canvas;n.width=e.width,n.height=e.height;var a=n.getContext("2d");a.drawImage(i,e.left,e.top,e.width,e.height,0,0,e.width,e.height)}},update:function(){this.$emit("change",this.getResult())},onChangeCoordinates:function(e){var t=!(1<arguments.length&&arguments[1]!==void 0)||arguments[1];this.coordinates=e,this.$listeners&&this.$listeners.change&&(t?this.debouncedUpdate():this.update())},onChangeImage:function(){var e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){var t=isCrossOriginURL(this.src);t&&this.canvas&&this.checkCrossOrigin&&(this.imageAttributes.crossOrigin="anonymous"),setTimeout(function(){e.checkOrientation?parseImage(t?addTimestamp(e.src):e.src).then(e.onParseImage):e.onParseImage({})},this.transitionTime)}else this.onChangeCoordinates({left:0,top:0,width:0,height:0},!1)},onParseImage:function(e){var t=this,i=e.arrayBuffer,n=e.orientation;this.imageAttributes.src=i&&n&&isLocal(this.src)?arrayBufferToDataURL(i):this.src,this.imageTransforms=getImageTransforms(n),Vue.nextTick(function(){var e=t.$refs.image;e&&e.complete&&t.refreshImage().then(t.resetCoordinates)})},onResize:function(e){this.frozenDirections.width&&(e.directions.left=0,e.directions.right=0),this.frozenDirections.height&&(e.directions.top=0,e.directions.bottom=0),this.onChangeCoordinates(this.resizeAlgorithm({coordinates:this.coordinates,restrictions:this.stencilRestrictions,imageSize:this.imageSize,coefficient:this.coefficient,aspectRatio:this.stencilAspectRatios(),resizeEvent:e}))},onMove:function(e){this.onChangeCoordinates(this.moveAlgorithm({coordinates:this.coordinates,imageSize:this.imageSize,coefficient:this.coefficient,moveEvent:e}))},defaultCoordinates:function(){var e=Math.max,t=Math.min,i=this.stencilAspectRatios(),n=this.stencilRestrictions,a=n.minWidth,o=n.minHeight,s=n.maxWidth,r=n.maxHeight,h=this.imageSize,c={};if(!i.minimum&&!i.maximum)c.height=o,c.width=a;else{var l={width:{maximum:i.minimum?t(r,a/i.minimum):r,minimum:i.maximum?e(o,a/i.maximum):o},height:{maximum:i.maximum?t(s,o*i.maximum):s,minimum:i.mininum?e(a,o*i.mininum):a}};if(l.width.maximum>=l.width.minimum)c.width=a,c.height=l.width.minimum;else if(l.height.maximum>=l.height.minimum)c.height=o,c.width=l.height.minimum;else throw"Error: current aspect ratio is incompatible with minimum/maximum height and width settings. Can't setup default coordinates"}return c.left=h.width/2-c.width/2,c.top=h.height/2-c.height/2,c},setCoordinates:function(e){var t=this;Vue.nextTick(function(){return t.imageLoaded?void t.applyTransforms(e):void(t.delayedTransforms=e)})},applyTransforms:function(e){var t=this,i=this.imageSize,n=this.coefficient,a=this.stencilAspectRatios(),o=function(e,a){return t.moveAlgorithm({coordinates:e,imageSize:i,coefficient:n,moveEvent:new MoveEvent(null,{left:(a.left-e.left)/n,top:(a.top-e.top)/n})})},s=function(e,s){var r=t.defaultCoordinates();return r=t.resizeAlgorithm({coordinates:r,restrictions:t.stencilRestrictions,imageSize:i,coefficient:n,aspectRatio:a,resizeEvent:new ResizeEvent(null,{left:(s.width-r.width)/(2*n),right:(s.width-r.width)/(2*n),top:(s.height-r.height)/(2*n),bottom:(s.height-r.height)/(2*n)})}),o(r,{left:e.left,top:e.top})},r=this.coordinates;return e.forEach||(e=[e]),e.forEach(function(e){var i={};i="function"==typeof e?e(_objectSpread({},r),t.imageSize):e,isUndefined(i.width)&&isUndefined(i.height)||(r=s(r,_objectSpread({},r,i))),isUndefined(i.left)&&isUndefined(i.top)||(r=o(r,_objectSpread({},r,i)))}),this.onChangeCoordinates(r,!1),r},resetCoordinates:function(){var e=this;// This function can be asynchronously called after completion of refreshing image promise
if(this.$refs.canvas){var t=this.$refs.image,i=this.checkOrientation?prepareSource(this.$refs.sourceCanvas,t,this.imageTransforms):t,n=this.$refs.canvas;n.width=e.width,n.height=e.height;var a=n.getContext("2d");a.drawImage(i,e.left,e.top,e.width,e.height,0,0,e.width,e.height)}},update:function(){this.$emit("change",this.getResult())},onChangeCoordinates:function(e){var t=!(1<arguments.length&&arguments[1]!==void 0)||arguments[1];this.coordinates=e,this.$listeners&&this.$listeners.change&&(t?this.debouncedUpdate():this.update())},onChangeImage:function(){var e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){var t=isCrossOriginURL(this.src);t&&this.canvas&&this.checkCrossOrigin&&(this.imageAttributes.crossOrigin="anonymous"),setTimeout(function(){e.checkOrientation?parseImage(t?addTimestamp(e.src):e.src).then(e.onParseImage):e.onParseImage({})},this.transitionTime)}else this.clearImage()},onParseImage:function(e){var t=this,i=e.arrayBuffer,n=e.orientation;this.imageAttributes.src=i&&n&&isLocal(this.src)?arrayBufferToDataURL(i):this.src,this.imageTransforms=getImageTransforms(n),Vue.nextTick(function(){var e=t.$refs.image;e&&e.complete&&t.refreshImage().then(t.resetCoordinates)})},onResize:function(e){this.frozenDirections.width&&(e.directions.left=0,e.directions.right=0),this.frozenDirections.height&&(e.directions.top=0,e.directions.bottom=0),this.onChangeCoordinates(this.resizeAlgorithm({coordinates:this.coordinates,restrictions:this.stencilRestrictions,imageSize:this.imageSize,coefficient:this.coefficient,aspectRatio:this.stencilAspectRatios(),resizeEvent:e}))},onMove:function(e){this.onChangeCoordinates(this.moveAlgorithm({coordinates:this.coordinates,imageSize:this.imageSize,coefficient:this.coefficient,moveEvent:e}))},defaultCoordinates:function(){var e=Math.max,t=Math.min,i=this.stencilAspectRatios(),n=this.stencilRestrictions,a=n.minWidth,o=n.minHeight,s=n.maxWidth,r=n.maxHeight,h=this.imageSize,c={};if(!i.minimum&&!i.maximum)c.height=o,c.width=a;else{var l={width:{maximum:i.minimum?t(r,a/i.minimum):r,minimum:i.maximum?e(o,a/i.maximum):o},height:{maximum:i.maximum?t(s,o*i.maximum):s,minimum:i.mininum?e(a,o*i.mininum):a}};if(l.width.maximum>=l.width.minimum)c.width=a,c.height=l.width.minimum;else if(l.height.maximum>=l.height.minimum)c.height=o,c.width=l.height.minimum;else throw"Error: current aspect ratio is incompatible with minimum/maximum height and width settings. Can't setup default coordinates"}return c.left=h.width/2-c.width/2,c.top=h.height/2-c.height/2,c},setCoordinates:function(e){var t=this;Vue.nextTick(function(){return t.imageLoaded?void t.applyTransforms(e):void(t.delayedTransforms=e)})},applyTransforms:function(e){var t=this,i=this.imageSize,n=this.coefficient,a=this.stencilAspectRatios(),o=function(e,a){return t.moveAlgorithm({coordinates:e,imageSize:i,coefficient:n,moveEvent:new MoveEvent(null,{left:(a.left-e.left)/n,top:(a.top-e.top)/n})})},s=function(e,s){var r=t.defaultCoordinates();return r=t.resizeAlgorithm({coordinates:r,restrictions:t.stencilRestrictions,imageSize:i,coefficient:n,aspectRatio:a,resizeEvent:new ResizeEvent(null,{left:(s.width-r.width)/(2*n),right:(s.width-r.width)/(2*n),top:(s.height-r.height)/(2*n),bottom:(s.height-r.height)/(2*n)})}),o(r,{left:e.left,top:e.top})},r=this.coordinates;return e.forEach||(e=[e]),e.forEach(function(e){var i={};i="function"==typeof e?e(_objectSpread({},r),t.imageSize):e,isUndefined(i.width)&&isUndefined(i.height)||(r=s(r,_objectSpread({},r,i))),isUndefined(i.left)&&isUndefined(i.top)||(r=o(r,_objectSpread({},r,i)))}),this.onChangeCoordinates(r,!1),r},resetCoordinates:function(){var e=this;// This function can be asynchronously called after completion of refreshing image promise
// Therefore there is a workaround to prevent processing after the component was unmounted
if(this.$refs.image){var t=this.$refs.cropper,i=this.$refs.image,n=this.stencilRestrictions,a=n.minWidth,o=n.minHeight,s=n.maxWidth,r=n.maxHeight,h=n.widthFrozen,c=n.heightFrozen;this.frozenDirections.width=!!h,this.frozenDirections.height=!!c;var l=migrateAlgorithm(this.defaultSize,"defaultSize",function(e){return[e.cropper,e.image,{minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight},e.imageWidth,e.imageHeight,e.props]})(_objectSpread({cropper:t,image:i,imageWidth:this.imageSize.width,imageHeight:this.imageSize.height,props:this.$props},this.stencilRestrictions));(l.width<a||l.height<o||l.width>s||l.height>r)&&console.warn("Warning: default size breaking size restrictions. Check your defaultSize function");var d=[l,function(n){return _objectSpread({},migrateAlgorithm(e.defaultPosition,"defaultPosition",function(e){return[e.cropper,e.image,e.stencilWidth,e.stencilHeight,e.imageWidth,e.imageHeight,e.props]})({cropper:t,image:i,stencilWidth:n.width,stencilHeight:n.height,imageWidth:e.imageSize.width,imageHeight:e.imageSize.height,props:e.$props}))}];this.delayedTransforms&&d.push.apply(d,_toConsumableArray(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.applyTransforms(d),this.delayedTransforms=null,this.imageLoaded=!0}},refreshImage:function(){var e=this,t=this.$refs.image,i=this.$refs.stretcher;this.imageTransforms.flipped?(this.imageSize.height=t.naturalWidth,this.imageSize.width=t.naturalHeight):(this.imageSize.height=t.naturalHeight,this.imageSize.width=t.naturalWidth);var n=this.imageSize.width/this.imageSize.height;return this.imageSize.height>this.imageSize.width?(i.style.height="".concat(this.imageSize.height,"px"),i.style.width="".concat(i.clientHeight*n,"px"),i.clientWidth/i.clientHeight!=n&&(i.style.height="".concat(i.clientWidth/n,"px"))):(i.style.width="".concat(this.imageSize.width,"px"),i.style.height="".concat(i.clientWidth/n,"px"),i.clientHeight/i.clientWidth!=n&&(i.style.width="".concat(i.clientHeight*n,"px"))),new Promise(function(t){var i=e.$refs.cropper,n=e.$refs.image;Vue.nextTick(function(){var a=migrateAlgorithm(e.areaSize,"areaSize",function(e){return[e.cropper,e.image,e.imageWidth,e.imageHeight]})({cropper:i,image:n,imageWidth:e.imageSize.width,imageHeight:e.imageSize.height}),o=a.height,s=a.width;o&&(e.boundarySize.height=o),s&&(e.boundarySize.width=s),t()})})},stencilAspectRatios:function(){return this.$refs.stencil.aspectRatios?this.$refs.stencil.aspectRatios():{minimum:this.stencilProps.aspectRatio||this.stencilProps.minAspectRatio,maximum:this.stencilProps.aspectRatio||this.stencilProps.maxAspectRatio}}}},__vue_script__$a=script$a,__vue_render__$a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"cropper",class:e.classes.cropper},[i("div",{class:e.classes.background,style:e.areaStyle}),e._v(" "),i("div",{ref:"stretcher",class:e.classes.stretcher}),e._v(" "),i("div",{ref:"area",class:e.classes.area,style:e.areaStyle},[i("img",{ref:"image",class:e.classes.image,style:e.imageStyle,attrs:{crossOrigin:e.imageAttributes.crossOrigin,src:e.imageAttributes.src}}),e._v(" "),i(e.stencilComponent,e._b({ref:"stencil",tag:"component",attrs:{img:{src:e.imageAttributes.src,size:e.imageSize,transforms:e.imageTransforms},"result-coordinates":e.coordinates,"stencil-coordinates":e.stencilCoordinates},on:{resize:e.onResize,move:e.onMove}},"component",e.stencilProps,!1)),e._v(" "),e.canvas?i("canvas",{ref:"canvas",style:{display:"none"}}):e._e(),e._v(" "),e.canvas?i("canvas",{ref:"sourceCanvas",style:{display:"none"}}):e._e()],1)])},__vue_staticRenderFns__$a=[];/* script */__vue_render__$a._withStripped=!0;/* style */var __vue_inject_styles__$a=void 0,__vue_scope_id__$a=void 0,__vue_module_identifier__$a=void 0,__vue_is_functional_template__$a=!1,Cropper=normalizeComponent_1({render:__vue_render__$a,staticRenderFns:__vue_staticRenderFns__$a},void 0,__vue_script__$a,__vue_scope_id__$a,__vue_is_functional_template__$a,__vue_module_identifier__$a,void 0,void 0),cn$a=easyBem("vue-preview-image"),script$b={name:"PreviewImage",props:{img:{type:String},classname:{type:String},imageClassname:{type:String},width:{type:Number},height:{type:Number},top:{type:Number},left:{type:Number},previewWidth:{type:Number,required:!0},previewHeight:{type:Number,required:!0}},data:function(){return{imageSize:{width:0,height:0}}},computed:{classnames:function(){return{default:classnames(cn$a(),this.classname),image:classnames(cn$a("image"),this.imageClassname)}},wrapperStyle:function(){return{width:"".concat(this.previewWidth,"px"),height:"".concat(this.previewHeight,"px")}},imageStyle:function(){var e=this.previewHeight/this.height,t=this.imageSize.height*e,i=this.imageSize.width*e;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(-this.left*e,"px"),top:"".concat(-this.top*e,"px")}}},watch:{img:function(){this.onChangeImage()}},mounted:function(){this.onChangeImage()},methods:{refreshImage:function(){var e=this.$refs.image;this.imageSize.height=e.naturalHeight,this.imageSize.width=e.naturalWidth},onChangeImage:function(){var e=this,t=this.$refs.image;t.complete?this.refreshImage():t.addEventListener("load",function(){e.refreshImage()})}}},__vue_script__$b=script$b,__vue_render__$b=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default,style:e.wrapperStyle},[i("img",{ref:"image",class:e.classnames.image,style:e.imageStyle,attrs:{src:e.img}})])},__vue_staticRenderFns__$b=[];/* scoped */__vue_render__$b._withStripped=!0;/* style */var __vue_inject_styles__$b=void 0,__vue_scope_id__$b=void 0,__vue_module_identifier__$b=void 0,__vue_is_functional_template__$b=!1,PreviewImage=normalizeComponent_1({render:__vue_render__$b,staticRenderFns:__vue_staticRenderFns__$b},void 0,__vue_script__$b,__vue_scope_id__$b,__vue_is_functional_template__$b,__vue_module_identifier__$b,void 0,void 0);/* scoped */Vue.component("cropper",Cropper),Vue.component("rectangle-stencil",RectangleStencil),Vue.component("circle-stencil",CircleStencil),Vue.component("simple-handler",SimpleHandler),Vue.component("simple-line",SimpleLine),exports.BoundingBox=BoundingBox,exports.CircleStencil=CircleStencil,exports.Cropper=Cropper,exports.DragEvent=DragEvent,exports.DraggableArea=DraggableArea,exports.DraggableElement=DraggableElement,exports.HandlerWrapper=HandlerWrapper,exports.LineWrapper=LineWrapper,exports.MoveEvent=MoveEvent,exports.PreviewImage=PreviewImage,exports.PreviewResult=PreviewResult,exports.RectangleStencil=RectangleStencil,exports.ResizeEvent=ResizeEvent,exports.SimpleHandler=SimpleHandler,exports.SimpleLine=SimpleLine;
if(this.$refs.image){var t=this.$refs.cropper,i=this.$refs.image,n=this.stencilRestrictions,a=n.minWidth,o=n.minHeight,s=n.maxWidth,r=n.maxHeight,h=n.widthFrozen,c=n.heightFrozen;this.frozenDirections.width=!!h,this.frozenDirections.height=!!c;var l=migrateAlgorithm(this.defaultSize,"defaultSize",function(e){return[e.cropper,e.image,{minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight},e.imageWidth,e.imageHeight,e.props]})(_objectSpread({cropper:t,image:i,imageWidth:this.imageSize.width,imageHeight:this.imageSize.height,props:this.$props},this.stencilRestrictions));(l.width<a||l.height<o||l.width>s||l.height>r)&&console.warn("Warning: default size breaking size restrictions. Check your defaultSize function");var d=[l,function(n){return _objectSpread({},migrateAlgorithm(e.defaultPosition,"defaultPosition",function(e){return[e.cropper,e.image,e.stencilWidth,e.stencilHeight,e.imageWidth,e.imageHeight,e.props]})({cropper:t,image:i,stencilWidth:n.width,stencilHeight:n.height,imageWidth:e.imageSize.width,imageHeight:e.imageSize.height,props:e.$props}))}];this.delayedTransforms&&d.push.apply(d,_toConsumableArray(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.applyTransforms(d),this.delayedTransforms=null,this.imageLoaded=!0}},clearImage:function(){var e=this.$refs.stretcher;this.imageLoaded=!1,this.onChangeCoordinates({left:0,top:0,width:0,height:0},!1),setTimeout(function(){e.style.height="auto",e.style.width="auto"},this.transitionTime)},refreshImage:function(){var e=this;if(this.src){var t=this.$refs.image,i=this.$refs.stretcher;this.imageTransforms.flipped?(this.imageSize.height=t.naturalWidth,this.imageSize.width=t.naturalHeight):(this.imageSize.height=t.naturalHeight,this.imageSize.width=t.naturalWidth);var n=this.imageSize.width/this.imageSize.height;return this.imageSize.height>this.imageSize.width?(i.style.height="".concat(this.imageSize.height,"px"),i.style.width="".concat(i.clientHeight*n,"px"),i.clientWidth/i.clientHeight!=n&&(i.style.height="".concat(i.clientWidth/n,"px"))):(i.style.width="".concat(this.imageSize.width,"px"),i.style.height="".concat(i.clientWidth/n,"px"),i.clientHeight/i.clientWidth!=n&&(i.style.width="".concat(i.clientHeight*n,"px"))),new Promise(function(t){var i=e.$refs.cropper,n=e.$refs.image;Vue.nextTick(function(){var a=migrateAlgorithm(e.areaSize,"areaSize",function(e){return[e.cropper,e.image,e.imageWidth,e.imageHeight]})({cropper:i,image:n,imageWidth:e.imageSize.width,imageHeight:e.imageSize.height}),o=a.height,s=a.width;o&&(e.boundarySize.height=o),s&&(e.boundarySize.width=s),t()})})}},stencilAspectRatios:function(){return this.$refs.stencil.aspectRatios?this.$refs.stencil.aspectRatios():{minimum:this.stencilProps.aspectRatio||this.stencilProps.minAspectRatio,maximum:this.stencilProps.aspectRatio||this.stencilProps.maxAspectRatio}}}},__vue_script__$a=script$a,__vue_render__$a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"cropper",class:e.classes.cropper},[i("div",{class:e.classes.background,style:e.areaStyle}),e._v(" "),i("div",{ref:"stretcher",class:e.classes.stretcher}),e._v(" "),i("div",{ref:"area",class:e.classes.area,style:e.areaStyle},[i("img",{ref:"image",class:e.classes.image,style:e.imageStyle,attrs:{crossOrigin:e.imageAttributes.crossOrigin,src:e.imageAttributes.src}}),e._v(" "),i(e.stencilComponent,e._b({ref:"stencil",tag:"component",attrs:{img:{src:e.imageAttributes.src,size:e.imageSize,transforms:e.imageTransforms},"result-coordinates":e.coordinates,"stencil-coordinates":e.stencilCoordinates},on:{resize:e.onResize,move:e.onMove}},"component",e.stencilProps,!1)),e._v(" "),e.canvas?i("canvas",{ref:"canvas",style:{display:"none"}}):e._e(),e._v(" "),e.canvas?i("canvas",{ref:"sourceCanvas",style:{display:"none"}}):e._e()],1)])},__vue_staticRenderFns__$a=[];/* script */__vue_render__$a._withStripped=!0;/* style */var __vue_inject_styles__$a=void 0,__vue_scope_id__$a=void 0,__vue_module_identifier__$a=void 0,__vue_is_functional_template__$a=!1,Cropper=normalizeComponent_1({render:__vue_render__$a,staticRenderFns:__vue_staticRenderFns__$a},void 0,__vue_script__$a,__vue_scope_id__$a,__vue_is_functional_template__$a,__vue_module_identifier__$a,void 0,void 0),cn$a=easyBem("vue-preview-image"),script$b={name:"PreviewImage",props:{img:{type:String},classname:{type:String},imageClassname:{type:String},width:{type:Number},height:{type:Number},top:{type:Number},left:{type:Number},previewWidth:{type:Number,required:!0},previewHeight:{type:Number,required:!0}},data:function(){return{imageSize:{width:0,height:0}}},computed:{classnames:function(){return{default:classnames(cn$a(),this.classname),image:classnames(cn$a("image"),this.imageClassname)}},wrapperStyle:function(){return{width:"".concat(this.previewWidth,"px"),height:"".concat(this.previewHeight,"px")}},imageStyle:function(){var e=this.previewHeight/this.height,t=this.imageSize.height*e,i=this.imageSize.width*e;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(-this.left*e,"px"),top:"".concat(-this.top*e,"px")}}},watch:{img:function(){this.onChangeImage()}},mounted:function(){this.onChangeImage()},methods:{refreshImage:function(){var e=this.$refs.image;this.imageSize.height=e.naturalHeight,this.imageSize.width=e.naturalWidth},onChangeImage:function(){var e=this,t=this.$refs.image;t.complete?this.refreshImage():t.addEventListener("load",function(){e.refreshImage()})}}},__vue_script__$b=script$b,__vue_render__$b=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default,style:e.wrapperStyle},[i("img",{ref:"image",class:e.classnames.image,style:e.imageStyle,attrs:{src:e.img}})])},__vue_staticRenderFns__$b=[];/* scoped */__vue_render__$b._withStripped=!0;/* style */var __vue_inject_styles__$b=void 0,__vue_scope_id__$b=void 0,__vue_module_identifier__$b=void 0,__vue_is_functional_template__$b=!1,PreviewImage=normalizeComponent_1({render:__vue_render__$b,staticRenderFns:__vue_staticRenderFns__$b},void 0,__vue_script__$b,__vue_scope_id__$b,__vue_is_functional_template__$b,__vue_module_identifier__$b,void 0,void 0);/* scoped */Vue.component("cropper",Cropper),Vue.component("rectangle-stencil",RectangleStencil),Vue.component("circle-stencil",CircleStencil),Vue.component("simple-handler",SimpleHandler),Vue.component("simple-line",SimpleLine),exports.BoundingBox=BoundingBox,exports.CircleStencil=CircleStencil,exports.Cropper=Cropper,exports.DragEvent=DragEvent,exports.DraggableArea=DraggableArea,exports.DraggableElement=DraggableElement,exports.HandlerWrapper=HandlerWrapper,exports.LineWrapper=LineWrapper,exports.MoveEvent=MoveEvent,exports.PreviewImage=PreviewImage,exports.PreviewResult=PreviewResult,exports.RectangleStencil=RectangleStencil,exports.ResizeEvent=ResizeEvent,exports.SimpleHandler=SimpleHandler,exports.SimpleLine=SimpleLine;

@@ -82,2 +82,2 @@ function styleInject(id, css) {

};
styleInject("vue-advanced-cropper", ".vue-advanced-cropper { text-align: center; position: relative; overflow: hidden; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; max-height: 100%; max-width: 100%;}.vue-advanced-cropper__stretcher { pointer-events: none; position: relative; max-width: 100%; max-height: 100%;}.vue-advanced-cropper__image { opacity: 0.5; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; position: absolute; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}.vue-advanced-cropper__area { position: absolute; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); top: 50%;}.vue-advanced-cropper__background { position: absolute; background: black; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-advanced-cropper__stencil-wrapper { position: absolute;}/*# sourceMappingURL=Cropper.vue.map */.vue-rectangle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; cursor: move;}/*# sourceMappingURL=RectangleStencil.vue.map */.vue-circle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: content-box; box-sizing: content-box; cursor: move;}.vue-circle-stencil__preview { border-radius: 50%;}/*# sourceMappingURL=CircleStencil.vue.map */.vue-line-wrapper { background: none; position: absolute; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-line-wrapper--north, .vue-line-wrapper--south { height: 12px; width: 100%; left: 0; -webkit-transform: translateY(-50%); transform: translateY(-50%);}.vue-line-wrapper--north { top: 0; cursor: n-resize;}.vue-line-wrapper--south { top: 100%; cursor: s-resize;}.vue-line-wrapper--east, .vue-line-wrapper--west { width: 12px; height: 100%; -webkit-transform: translateX(-50%); transform: translateX(-50%); top: 0;}.vue-line-wrapper--east { left: 100%; cursor: e-resize;}.vue-line-wrapper--west { left: 0; cursor: w-resize;}/*# sourceMappingURL=LineWrapper.vue.map */.vue-bounding-box { position: relative; height: 100%; width: 100%;}.vue-bounding-box__line { position: absolute;}.vue-bounding-box__line--north { top: 0; width: 100%; cursor: n-resize;}.vue-bounding-box__line--east { left: 100%; top: 0; height: 100%; cursor: e-resize;}.vue-bounding-box__line--south { top: 100%; width: 100%; cursor: s-resize;}.vue-bounding-box__line--west { left: 0; top: 0; height: 100%; cursor: w-resize;}/*# sourceMappingURL=BoundingBox.vue.map */.vue-square-handler { display: block; background: white; height: 10px; width: 10px;}/*# sourceMappingURL=SimpleHandler.vue.map */.vue-handler-wrapper { position: absolute; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-handler-wrapper__draggable { width: 30px; height: 30px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-handler-wrapper--west-north { left: 0; top: 0; cursor: nw-resize;}.vue-handler-wrapper--north { left: 50%; top: 0; cursor: n-resize;}.vue-handler-wrapper--east-north { left: 100%; top: 0; cursor: ne-resize;}.vue-handler-wrapper--east { left: 100%; top: 50%; cursor: e-resize;}.vue-handler-wrapper--east-south { left: 100%; top: 100%; cursor: se-resize;}.vue-handler-wrapper--south { left: 50%; top: 100%; cursor: s-resize;}.vue-handler-wrapper--west-south { left: 0; top: 100%; cursor: sw-resize;}.vue-handler-wrapper--west { left: 0; top: 50%; cursor: w-resize;}/*# sourceMappingURL=HandlerWrapper.vue.map */.vue-draggable-area { position: relative;}/*# sourceMappingURL=DraggableArea.vue.map */.vue-preview-result { overflow: hidden; -webkit-box-sizing: border-box; box-sizing: border-box; position: absolute; height: 100%; width: 100%;}.vue-preview-result__wrapper { position: absolute;}.vue-preview-result__image { pointer-events: none; position: absolute; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}/*# sourceMappingURL=PreviewResult.vue.map */.vue-simple-line { background: none; -webkit-transition: border 0.5s; transition: border 0.5s; border-color: rgba(255, 255, 255, 0.3); border-width: 0; border-style: solid;}.vue-simple-line--south, .vue-simple-line--north { height: 0; width: 100%;}.vue-simple-line--east, .vue-simple-line--west { height: 100%; width: 0;}.vue-simple-line--east { border-right-width: 1px;}.vue-simple-line--west { border-left-width: 1px;}.vue-simple-line--south { border-top-width: 1px;}.vue-simple-line--north { border-bottom-width: 1px;}.vue-simple-line--hover { opacity: 1; border-color: white;}/*# sourceMappingURL=SimpleLine.vue.map */.vue-preview-image { overflow: hidden; position: relative;}.vue-preview-image__image { pointer-events: none; position: absolute; max-width: unset !important;}/*# sourceMappingURL=PreviewImage.vue.map */");//# sourceMappingURL=index.js.map
styleInject("vue-advanced-cropper", ".vue-advanced-cropper { text-align: center; position: relative; overflow: hidden; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; max-height: 100%; max-width: 100%;}.vue-advanced-cropper__stretcher { pointer-events: none; position: relative; max-width: 100%; max-height: 100%;}.vue-advanced-cropper__image { opacity: 0.5; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; position: absolute; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}.vue-advanced-cropper__area { position: absolute; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); top: 50%;}.vue-advanced-cropper__background { position: absolute; background: black; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-advanced-cropper__stencil-wrapper { position: absolute;}/*# sourceMappingURL=Cropper.vue.map */.vue-square-handler { display: block; background: white; height: 10px; width: 10px;}/*# sourceMappingURL=SimpleHandler.vue.map */.vue-handler-wrapper { position: absolute; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-handler-wrapper__draggable { width: 30px; height: 30px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-handler-wrapper--west-north { left: 0; top: 0; cursor: nw-resize;}.vue-handler-wrapper--north { left: 50%; top: 0; cursor: n-resize;}.vue-handler-wrapper--east-north { left: 100%; top: 0; cursor: ne-resize;}.vue-handler-wrapper--east { left: 100%; top: 50%; cursor: e-resize;}.vue-handler-wrapper--east-south { left: 100%; top: 100%; cursor: se-resize;}.vue-handler-wrapper--south { left: 50%; top: 100%; cursor: s-resize;}.vue-handler-wrapper--west-south { left: 0; top: 100%; cursor: sw-resize;}.vue-handler-wrapper--west { left: 0; top: 50%; cursor: w-resize;}/*# sourceMappingURL=HandlerWrapper.vue.map */.vue-line-wrapper { background: none; position: absolute; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-line-wrapper--north, .vue-line-wrapper--south { height: 12px; width: 100%; left: 0; -webkit-transform: translateY(-50%); transform: translateY(-50%);}.vue-line-wrapper--north { top: 0; cursor: n-resize;}.vue-line-wrapper--south { top: 100%; cursor: s-resize;}.vue-line-wrapper--east, .vue-line-wrapper--west { width: 12px; height: 100%; -webkit-transform: translateX(-50%); transform: translateX(-50%); top: 0;}.vue-line-wrapper--east { left: 100%; cursor: e-resize;}.vue-line-wrapper--west { left: 0; cursor: w-resize;}/*# sourceMappingURL=LineWrapper.vue.map */.vue-bounding-box { position: relative; height: 100%; width: 100%;}.vue-bounding-box__line { position: absolute;}.vue-bounding-box__line--north { top: 0; width: 100%; cursor: n-resize;}.vue-bounding-box__line--east { left: 100%; top: 0; height: 100%; cursor: e-resize;}.vue-bounding-box__line--south { top: 100%; width: 100%; cursor: s-resize;}.vue-bounding-box__line--west { left: 0; top: 0; height: 100%; cursor: w-resize;}/*# sourceMappingURL=BoundingBox.vue.map */.vue-draggable-area { position: relative;}/*# sourceMappingURL=DraggableArea.vue.map */.vue-preview-result { overflow: hidden; -webkit-box-sizing: border-box; box-sizing: border-box; position: absolute; height: 100%; width: 100%;}.vue-preview-result__wrapper { position: absolute;}.vue-preview-result__image { pointer-events: none; position: absolute; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}/*# sourceMappingURL=PreviewResult.vue.map */.vue-preview-image { overflow: hidden; position: relative;}.vue-preview-image__image { pointer-events: none; position: absolute; max-width: unset !important;}/*# sourceMappingURL=PreviewImage.vue.map */.vue-simple-line { background: none; -webkit-transition: border 0.5s; transition: border 0.5s; border-color: rgba(255, 255, 255, 0.3); border-width: 0; border-style: solid;}.vue-simple-line--south, .vue-simple-line--north { height: 0; width: 100%;}.vue-simple-line--east, .vue-simple-line--west { height: 100%; width: 0;}.vue-simple-line--east { border-right-width: 1px;}.vue-simple-line--west { border-left-width: 1px;}.vue-simple-line--south { border-top-width: 1px;}.vue-simple-line--north { border-bottom-width: 1px;}.vue-simple-line--hover { opacity: 1; border-color: white;}/*# sourceMappingURL=SimpleLine.vue.map */.vue-circle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: content-box; box-sizing: content-box; cursor: move;}.vue-circle-stencil__preview { border-radius: 50%;}/*# sourceMappingURL=CircleStencil.vue.map */.vue-rectangle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; cursor: move;}/*# sourceMappingURL=RectangleStencil.vue.map */");//# sourceMappingURL=index.js.map

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

(function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):(e=e||self,t(e["vue-advanced-cropper"]={},e.Vue))})(this,function(e,t){'use strict';var _=Math.max,M=Math.pow,T=Math.min,P=String.fromCharCode;function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n,a=0;a<t.length;a++)n=t[a],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}function a(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}function o(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function s(e){for(var t=1;t<arguments.length;t++){var n=null==arguments[t]?{}:arguments[t],a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){o(e,t,n[t])})}return e}function r(e){return h(e)||c(e)||l()}function h(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function c(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance")}/**
(function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):(e=e||self,t(e["vue-advanced-cropper"]={},e.Vue))})(this,function(e,t){'use strict';var _=Math.max,M=Math.pow,T=Math.min,L=String.fromCharCode;function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n,a=0;a<t.length;a++)n=t[a],n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}function a(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}function o(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function s(e){for(var t=1;t<arguments.length;t++){var n=null==arguments[t]?{}:arguments[t],a=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),a.forEach(function(t){o(e,t,n[t])})}return e}function r(e){return h(e)||c(e)||l()}function h(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function c(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance")}/**
* Returns a function, that, as long as it continues to be invoked, will not

@@ -15,10 +15,10 @@ * be triggered. The function will be called after it stops being called for

*/function d(e,t,i){function n(){var c=Date.now()-r;c<t&&0<=c?a=setTimeout(n,t-c):(a=null,!i&&(h=e.apply(s,o),s=o=null))}var a,o,s,r,h;null==t&&(t=100);var c=function(){s=this,o=arguments,r=Date.now();var c=i&&!a;return a||(a=setTimeout(n,t)),c&&(h=e.apply(s,o),s=o=null),h};return c.clear=function(){a&&(clearTimeout(a),a=null)},c.flush=function(){a&&(h=e.apply(s,o),s=o=null,clearTimeout(a),a=null)},c}function m(e,t){var i,n;return e&&t?(i="".concat(e).concat(t[0].toUpperCase()).concat(t.slice(1)),n="".concat(e,"-").concat(t)):(i=e||t,n=e||t),{name:i,classname:n}}function p(e){return /^data:/.test(e)||/^blob:/.test(e)}function g(e){if(p(e))return!1;var t=window.location,i=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/,n=i.exec(e)||[],a={protocol:n[1]||"",host:n[2]||"",port:n[3]||""},o=function(e){return{"http:":80,"https:":443}[e]},s=function(e){return e.port||o(e.protocol||t.protocol)};return(a.protocol||a.host||a.port)&&!!!(a.protocol&&a.protocol==t.protocol&&a.host&&a.host==t.host&&a.host&&s(a)==s(t))}function u(e){return"undefined"==typeof e}function f(e){var t="timestamp=".concat(new Date().getTime());return e+(-1===e.indexOf("?")?"?":"&")+t}function v(e,t,i){var n=Math.PI,a=i.flipped,o=i.orientation,s=t.naturalWidth,r=t.naturalHeight,h=e.getContext("2d");return e.width=s,e.height=r,h.save(),a&&(e.width=r,e.height=s),2==o?(h.translate(s,0),h.scale(-1,1)):3==o?(h.translate(s,r),h.rotate(1*n)):4==o?(h.translate(0,r),h.scale(1,-1)):5==o?(h.rotate(90/180*n),h.scale(1,-1)):6==o?(h.rotate(90/180*n),h.translate(0,-r)):7==o?(h.rotate(270/180*n),h.translate(-s,r),h.scale(1,-1)):8==o&&(h.translate(0,s),h.rotate(270/180*n)),h.drawImage(t,0,0,s,r),h.restore(),e}function w(e){var t={orientation:e};return e&&(2===e?t.scaleX=-1:3===e?t.rotate=-180:4===e?t.scaleY=-1:5===e?(t.rotate=90,t.scaleY=-1):6===e?t.rotate=90:7===e?(t.rotate=90,t.scaleX=-1):8===e?t.rotate=-90:void 0),(90===t.rotate||-90===t.rotate)&&(t.flipped=!0),t}function y(e){var t=e.rotate,i=e.scaleX,n=e.scaleY,a="";return(t||i||n)&&(t&&(a+=" rotate(".concat(t,"deg) ")),i&&(a+=" scaleX(".concat(i,") ")),n&&(a+=" scaleY(".concat(n,") "))),a}function x(e){return new Promise(function(t){b(e).then(function(e){t(e?{arrayBuffer:e,orientation:E(e)}:{arrayBuffer:null,orientation:null})}).catch(function(e){console.warn(e),t({arrayBuffer:null,orientation:null})})})}function b(e){return new Promise(function(t,i){try{if(!e)i("Error: the image is empty");else// Data URL
if(/^data:/i.test(e))t(z(e));else if(/^blob:/i.test(e)){var n=new FileReader;n.onload=function(i){t(i.target.result)},C(e,function(e){n.readAsArrayBuffer(e)})}else{var a=new XMLHttpRequest;a.onreadystatechange=function(){4!==this.readyState||(200===this.status||0===this.status?t(this.response):i("Warning: could not load an image to parse its orientation"),a=null)},a.onprogress=function(){"image/jpeg"!==a.getResponseHeader("content-type")&&a.abort()},a.withCredentials=!1,a.open("GET",e,!0),a.responseType="arraybuffer",a.send(null)}}catch(t){i(t)}})}function C(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="blob",i.onload=function(){(200==this.status||0===this.status)&&t(this.response)},i.send()}function z(e){e=e.replace(/^data:([^;]+);base64,/gmi,"");for(var t=atob(e),n=t.length,a=new ArrayBuffer(n),o=new Uint8Array(a),s=0;s<n;s++)o[s]=t.charCodeAt(s);return a}function S(e,t,n){var a,o="";for(a=t,n+=t;a<n;a++)o+=P(e.getUint8(a));return o}function E(e){try{var t,n,a,o,s,r,h=new DataView(e);// Only handle JPEG image (start by 0xFFD8)
if(/^data:/i.test(e))t(z(e));else if(/^blob:/i.test(e)){var n=new FileReader;n.onload=function(i){t(i.target.result)},C(e,function(e){n.readAsArrayBuffer(e)})}else{var a=new XMLHttpRequest;a.onreadystatechange=function(){4!==this.readyState||(200===this.status||0===this.status?t(this.response):i("Warning: could not load an image to parse its orientation"),a=null)},a.onprogress=function(){"image/jpeg"!==a.getResponseHeader("content-type")&&a.abort()},a.withCredentials=!1,a.open("GET",e,!0),a.responseType="arraybuffer",a.send(null)}}catch(t){i(t)}})}function C(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="blob",i.onload=function(){(200==this.status||0===this.status)&&t(this.response)},i.send()}function z(e){e=e.replace(/^data:([^;]+);base64,/gmi,"");for(var t=atob(e),n=t.length,a=new ArrayBuffer(n),o=new Uint8Array(a),s=0;s<n;s++)o[s]=t.charCodeAt(s);return a}function S(e,t,n){var a,o="";for(a=t,n+=t;a<n;a++)o+=L(e.getUint8(a));return o}function E(e){try{var t,n,a,o,s,r,h=new DataView(e);// Only handle JPEG image (start by 0xFFD8)
if(255===h.getUint8(0)&&216===h.getUint8(1))for(var c=h.byteLength,l=2;l+1<c;){if(255===h.getUint8(l)&&225===h.getUint8(l+1)){s=l;break}l++}if(s&&(n=s+4,a=s+10,"Exif"===S(h,n,4))){var d=h.getUint16(a);if(o=18761===d,(o||19789===d)&&42===h.getUint16(a+2,o)/* bigEndian */){var m=h.getUint32(a+4,o);8<=m&&(r=a+m)}}if(r)for(var p,g=h.getUint16(r,o),u=0;u<g;u++)if(p=r+12*u+2,274===h.getUint16(p,o)/* Orientation */){p+=8,t=h.getUint16(p,o),h.setUint16(p,1,o);break}return t}catch(e){return null}}function W(e){for(var t=[],i=8192,n=new Uint8Array(e)// Chunk Typed Array for better performance (#435)
;0<n.length;){var a=n.subarray(0,i);t.push(P.apply(null,Array.from?Array.from(a):Array.slice(a))),n=n.subarray(i)}return"data:image/jpeg;base64,".concat(btoa(t.join("")))}function H(e,t,i){return e.width+i*(t.left+t.right)}function $(e,t,i){return e.height+i*(t.top+t.bottom)}function R(e,t,i,n,a,o){var r=Math.abs,h=Math.floor,c=Math.ceil,l=i.minHeight,d=i.minWidth,m=i.maxHeight,p=i.maxWidth,g=s({},e),u=H(t,g,n),f=$(t,g,n);0>u&&(0>g.left&&0>g.right?(g.left=-(t.width-d)/(g.left/g.right),g.right=-(t.width-d)/(g.right/g.left)):0>g.left?g.left=-(t.width-d)/n:0>g.right&&(g.right=-(t.width-d)/n)),0>f&&(0>g.top&&0>g.bottom?(g.top=-(t.height-l)/(g.top/g.bottom),g.bottom=-(t.height-l)/(g.bottom/g.top)):0>g.top?g.top=-(t.height-l):0>g.bottom&&(g.bottom=-(t.height-l)));var v={width:1/0,height:1/0};// If ratio is not broken, resize all directions independently
if(g.right+g.left&&(c(t.left+t.width+n*g.right)>a.width&&(v.width=T(v.width,r(h(a.width-(t.left+t.width))/(n*g.right)))),0>t.left-n*g.left&&(v.width=T(v.width,r(t.left/(n*g.left)))),u<d&&(v.width=T(v.width,r((t.width-d)/((g.right+g.left)*n)))),u>p&&(v.width=T(v.width,r((p-t.width)/((g.right+g.left)*n))))),g.top+g.bottom&&(c(t.top+t.height+n*g.bottom)>a.height&&(v.height=T(v.height,r(h(a.height-(t.top+t.height))/(n*g.bottom)))),0>t.top-n*g.top&&(v.height=T(v.height,r(t.top/(n*g.top)))),f<l&&(v.height=T(v.height,r((t.height-l)/((g.top+g.bottom)*n)))),f>m&&(v.height=T(v.height,r((m-t.height)/((g.top+g.bottom)*n))))),v.width<M(10,-1)&&(v.width=0),v.height<M(10,-1)&&(v.height=0),!o)v.width!==1/0&&re.forEach(function(e){g[e]*=v.width}),v.height!==1/0&&he.forEach(function(e){g[e]*=v.height});else{var w;v.height<v.width?w=v.height:g.right+g.left&&(w=v.width),(v.height!==1/0||v.width!==1/0)&&ce.forEach(function(e){g[e]*=w})}return g}function D(e,t,i){function n(n){return console.warn("The arguments will be passed to the prop '".concat(t,"' as an single object {").concat(Object.keys(n).join(","),"} in the future releases. You should change the interface of your function.")),e.apply(void 0,r(i(n)))}return function(t){if(1<e.length)return n(t);try{return e(t)}catch(i){return n(t)}}}t=t&&t.hasOwnProperty("default")?t["default"]:t;var A=function(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e){/*!
;0<n.length;){var a=n.subarray(0,i);t.push(L.apply(null,Array.from?Array.from(a):Array.slice(a))),n=n.subarray(i)}return"data:image/jpeg;base64,".concat(btoa(t.join("")))}function H(e,t,i){return e.width+i*(t.left+t.right)}function $(e,t,i){return e.height+i*(t.top+t.bottom)}function R(e,t,i,n,a,o){var r=Math.abs,h=Math.floor,c=Math.ceil,l=i.minHeight,d=i.minWidth,m=i.maxHeight,p=i.maxWidth,g=s({},e),u=H(t,g,n),f=$(t,g,n);0>u&&(0>g.left&&0>g.right?(g.left=-(t.width-d)/(g.left/g.right),g.right=-(t.width-d)/(g.right/g.left)):0>g.left?g.left=-(t.width-d)/n:0>g.right&&(g.right=-(t.width-d)/n)),0>f&&(0>g.top&&0>g.bottom?(g.top=-(t.height-l)/(g.top/g.bottom),g.bottom=-(t.height-l)/(g.bottom/g.top)):0>g.top?g.top=-(t.height-l):0>g.bottom&&(g.bottom=-(t.height-l)));var v={width:1/0,height:1/0};// If ratio is not broken, resize all directions independently
if(g.right+g.left&&(c(t.left+t.width+n*g.right)>a.width&&(v.width=T(v.width,r(h(a.width-(t.left+t.width))/(n*g.right)))),0>t.left-n*g.left&&(v.width=T(v.width,r(t.left/(n*g.left)))),u<d&&(v.width=T(v.width,r((t.width-d)/((g.right+g.left)*n)))),u>p&&(v.width=T(v.width,r((p-t.width)/((g.right+g.left)*n))))),g.top+g.bottom&&(c(t.top+t.height+n*g.bottom)>a.height&&(v.height=T(v.height,r(h(a.height-(t.top+t.height))/(n*g.bottom)))),0>t.top-n*g.top&&(v.height=T(v.height,r(t.top/(n*g.top)))),f<l&&(v.height=T(v.height,r((t.height-l)/((g.top+g.bottom)*n)))),f>m&&(v.height=T(v.height,r((m-t.height)/((g.top+g.bottom)*n))))),v.width<M(10,-1)&&(v.width=0),v.height<M(10,-1)&&(v.height=0),!o)v.width!==1/0&&re.forEach(function(e){g[e]*=v.width}),v.height!==1/0&&he.forEach(function(e){g[e]*=v.height});else{var w;v.height<v.width?w=v.height:g.right+g.left&&(w=v.width),(v.height!==1/0||v.width!==1/0)&&ce.forEach(function(e){g[e]*=w})}return g}function D(e,t,i){function n(n){return console.warn("The arguments will be passed to the prop '".concat(t,"' as an single object {").concat(Object.keys(n).join(","),"} in the future releases. You should change the interface of your function.")),e.apply(void 0,r(i(n)))}return function(t){if(1<e.length)return n(t);try{return e(t)}catch(i){return n(t)}}}t=t&&t.hasOwnProperty("default")?t["default"]:t;var P=function(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e){/*!
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/ /* global define */(function(){function t(){for(var e,n=[],a=0;a<arguments.length;a++)if(e=arguments[a],e){var o=typeof e;if("string"===o||"number"===o)n.push(e);else if(Array.isArray(e)&&e.length){var s=t.apply(null,e);s&&n.push(s)}else if("object"===o)for(var r in e)i.call(e,r)&&e[r]&&n.push(r)}return n.join(" ")}var i={}.hasOwnProperty;e.exports?(t.default=t,e.exports=t):window.classNames=t})()}),L=function(e){return function(t,i){if(!t)return e;var n;"string"==typeof t?n=t:i=t;var a=e;return n&&(a+="__"+n),a+(i?Object.keys(i).reduce(function(e,t){var n=i[t];return n&&(e+=" "+("boolean"==typeof n?a+"--"+t:a+"--"+t+"_"+n)),e},""):"")}};/**
*/ /* global define */(function(){function t(){for(var e,n=[],a=0;a<arguments.length;a++)if(e=arguments[a],e){var o=typeof e;if("string"===o||"number"===o)n.push(e);else if(Array.isArray(e)&&e.length){var s=t.apply(null,e);s&&n.push(s)}else if("object"===o)for(var r in e)i.call(e,r)&&e[r]&&n.push(r)}return n.join(" ")}var i={}.hasOwnProperty;e.exports?(t.default=t,e.exports=t):window.classNames=t})()}),A=function(e){return function(t,i){if(!t)return e;var n;"string"==typeof t?n=t:i=t;var a=e;return n&&(a+="__"+n),a+(i?Object.keys(i).reduce(function(e,t){var n=i[t];return n&&(e+=" "+("boolean"==typeof n?a+"--"+t:a+"--"+t+"_"+n)),e},""):"")}};/**
* BEM class name factory.

@@ -41,3 +41,3 @@ *

var m=l.render;l.render=function(e,t){return d.call(t),m(e,t)}}else{// inject component registration as beforeCreate hook
var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,d):[d]}return i},U=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"draggable",class:e.classname,on:{touchstart:e.onTouchStart,mousedown:e.onMouseDown,mouseover:e.onMouseOver,mouseleave:e.onMouseLeave}},[e._t("default")],2)};U._withStripped=!0;/* style */var F=B({render:U,staticRenderFns:[]},void 0,I,void 0,!1,void 0,void 0,void 0),O=L("vue-handler-wrapper"),N={name:"HandlerWrapper",components:{DraggableElement:F},props:{horizontalPosition:{type:String},verticalPosition:{type:String},classname:{type:String}},computed:{classnames:function(){var e;if(this.horizontalPosition||this.verticalPosition){var t=m(this.horizontalPosition,this.verticalPosition);e=A(this.classname,O(o({},t.classname,!0)))}else e=A(this.classname,O());return{default:e,draggable:O("draggable")}}}},q=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default},[i("DraggableElement",{class:e.classnames.draggable,on:{drag:function(t){return e.$emit("drag",t)},leave:function(){return e.$emit("leave")},enter:function(){return e.$emit("enter")}}},[e._t("default")],2)],1)};/* scoped */q._withStripped=!0;/* style */var j=B({render:q,staticRenderFns:[]},void 0,N,void 0,!1,void 0,void 0,void 0),G=L("vue-line-wrapper"),K={name:"LineWrapper",components:{DraggableElement:F},props:{position:{type:String,required:!0}},computed:{classname:function(){return G(o({},this.position,!0))}}},V=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("DraggableElement",{class:e.classname,on:{drag:function(t){return e.$emit("drag",t)},leave:function(){return e.$emit("leave")},enter:function(){return e.$emit("enter")}}},[e._t("default")],2)};/* scoped */V._withStripped=!0;/* style */var J=B({render:V,staticRenderFns:[]},void 0,K,void 0,!1,void 0,void 0,void 0),Z=L("vue-bounding-box"),Q=["east","west",null],ee=["south","north",null],te={name:"BoundingBox",props:{classname:{type:String},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlerComponent:{type:[Object,String]},handlersClassnames:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},lineComponent:{type:[Object,String]},linesClassnames:{type:Object,default:function(){return{}}}},data:function(){var e=[];return Q.forEach(function(t){ee.forEach(function(i){if(t!==i){var n=m(t,i),a=n.name,o=n.classname;e.push({name:a,classname:o,verticalDirection:i,horizontalDirection:t})}})}),{points:e}},computed:{classnames:function(){var e=this.handlersClassnames,t=this.linesClassnames;return{default:A(Z(),this.classname),handlers:e,lines:t}},lineNodes:function(){var e=this,t=[];return this.points.forEach(function(i){i.horizontalDirection&&i.verticalDirection||!e.lines[i.name]||t.push({name:i.name,component:e.lineComponent,classname:A(e.classnames.lines.default,e.classnames.lines[i.name]),hoverClassname:e.classnames.lines.hover,verticalDirection:i.verticalDirection,horizontalDirection:i.horizontalDirection})}),t},handlerNodes:function(){var e=this,t=[];return this.points.forEach(function(i){e.handlers[i.name]&&t.push({name:i.name,component:e.handlerComponent,classname:A(e.classnames.handlers.default,e.classnames.handlers[i.name]),hoverClassname:e.classnames.handlers.hover,verticalDirection:i.verticalDirection,horizontalDirection:i.horizontalDirection})}),t}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.draggingAnchor=[]},methods:{onHandlerDrag:function(e,t,i){var n=e.shift(),a=n.left,o=n.top,s={left:0,right:0,top:0,bottom:0};"west"===t?s.left-=a:"east"==t&&(s.right+=a),"north"===i?s.top-=o:"south"==i&&(s.bottom+=o);var r;!i&&t?r="width":i&&!t&&(r="height"),this.$emit("resize",new Y(e.nativeEvent,s,{allowedDirections:{left:"west"===t||!t,right:"east"===t||!t,bottom:"south"===i||!i,top:"north"===i||!i},preserveAspectRatio:e.nativeEvent.shiftKey,respectDirection:r}))}}},ie=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"box",class:e.classnames.default},[e._t("default"),e._v(" "),i("div",e._l(e.lineNodes,function(t){return i(t.component,{key:t.name,tag:"component",attrs:{classname:t.classname,"hover-classname":t.hoverClassname,position:t.name},on:{drag:function(i){return e.onHandlerDrag(i,t.horizontalDirection,t.verticalDirection)}}})}),1),e._v(" "),i("div",e._l(e.handlerNodes,function(t){return i(t.component,{key:t.name,tag:"component",attrs:{classname:t.classname,"hover-classname":t.hoverClassname,"horizontal-position":t.horizontalDirection,"vertical-position":t.verticalDirection},on:{drag:function(i){return e.onHandlerDrag(i,t.horizontalDirection,t.verticalDirection)}}})}),1)],2)};/* scoped */ie._withStripped=!0;/* style */var ne=B({render:ie,staticRenderFns:[]},void 0,te,void 0,!1,void 0,void 0,void 0),ae=L("vue-draggable-area"),oe=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"container",on:{touchstart:e.onTouchStart,mousedown:e.onMouseDown}},[e._t("default")],2)};/* scoped */oe._withStripped=!0;/* style */var se=B({render:oe,staticRenderFns:[]},void 0,{name:"DraggableArea",computed:{classnames:function(){return{default:A(ae(),this.classname)}}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.draggingAnchor=[]},methods:{onTouchStart:function(t){t.cancelable&&(this.touches=r(t.touches),t.touches.length&&this.initAnchor(this.touches.reduce(function(e,i){return{clientX:e.clientX+i.clientX/t.touches.length,clientY:e.clientY+i.clientY/t.touches.length}},{clientX:0,clientY:0})),t.preventDefault&&t.preventDefault(),t.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(t){this.touches.length&&(this.processMove(t,t.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation())},onMouseDown:function(t){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault())},onMouseUp:function(){this.touches=[]},initAnchor:function(e){var t=this.$refs.container,i=t.getBoundingClientRect(),n=i.left,a=i.top;this.anchor={x:e.clientX-n,y:e.clientY-a}},processMove:function(e,t){var i=this,n=r(t);if(this.touches.length){var a=this.$refs.container,o=a.getBoundingClientRect(),s=o.left,h=o.top;if(1===this.touches.length&&1===n.length)this.$emit("move",new X(e,{left:n[0].clientX-s-this.anchor.x,top:n[0].clientY-h-this.anchor.y}));else if(1<this.touches.length&&this.touches.length===n.length){var c=n.map(function(e,t){return{x:e.clientX-i.touches[t].clientX,y:e.clientY-i.touches[t].clientY,position:{clientX:e.clientX,clientY:e.clientY},length:Math.sqrt(M(e.clientX-i.touches[t].clientX,2)+M(e.clientY-i.touches[t].clientY,2))}}),l=c.reduce(function(e,t){return e+t.length},0),d={left:c.reduce(function(e,t,i){return e+(1-t.length/l)*n[i].clientX},0),top:c.reduce(function(e,t,i){return e+(1-t.length/l)*n[i].clientY},0)},m={top:0,bottom:0,left:0,right:0};c.forEach(function(e,t){.25<e.length/l&&(n[t].clientY>d.top?m.bottom+=e.y:m.top-=e.y,n[t].clientX>d.left?m.right+=e.x:m.left-=e.x)}),this.$emit("resize",new Y(e,m))}this.touches=n}},processEnd:function(){this.touches=[]}}},void 0,!1,void 0,void 0,void 0),re=["left","right"],he=["top","bottom"],ce=["left","right","top","bottom"],le=L("vue-preview-result"),de={name:"PreviewResult",props:{img:{type:Object},classname:{type:String},imageClassname:{type:String},resultCoordinates:{type:Object,default:function(){return{width:0,height:0,left:0,top:0}}},stencilCoordinates:{type:Object,default:function(){return{width:0,height:0,left:0,top:0}}}},computed:{classnames:function(){return{default:A(le(),this.classname),image:A(le("image"),this.imageClassname),wrapper:le("wrapper")}},wrapperStyle:function(){return{width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"calc(50% - ".concat(this.stencilCoordinates.width/2,"px)"),top:"calc(50% - ".concat(this.stencilCoordinates.height/2,"px)")}},imageStyle:function(){var e=this.img.transforms,t=this.img.size.width,i=this.img.size.height,n=this.stencilCoordinates.height/this.resultCoordinates.height,a=i*n,o=t*n,s=e.flipped,r={width:"".concat(o,"px"),height:"".concat(a,"px")};return s?(r.width="".concat(a,"px"),r.height="".concat(o,"px"),r.left="".concat(-this.stencilCoordinates.left-(a-o)/2,"px"),r.top="".concat(-this.stencilCoordinates.top-(o-a)/2,"px")):(r.width="".concat(o,"px"),r.height="".concat(a,"px"),r.left="".concat(-this.stencilCoordinates.left,"px"),r.top="".concat(-this.stencilCoordinates.top,"px")),r.transform=y(e),r}}},me=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default},[i("div",{ref:"wrapper",class:e.classnames.wrapper,style:e.wrapperStyle},[i("img",{ref:"image",class:e.classnames.image,style:e.imageStyle,attrs:{src:e.img.src}})])])};/* scoped */me._withStripped=!0;/* style */var pe=B({render:me,staticRenderFns:[]},void 0,de,void 0,!1,void 0,void 0,void 0),ge=L("vue-square-handler"),ue={name:"SimpleHandler",components:{HandlerWrapper:j},props:{classname:{type:String},hoverClassname:{type:String},horizontalPosition:{type:String},verticalPosition:{type:String}},computed:{classnames:function(){return{default:A(ge(o({},this.position,!0)),this.classname,this.hover&&this.hoverClassname)}}},methods:{onDrag:function(e){this.$emit("drag",e)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1}}},fe=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("HandlerWrapper",{attrs:{"vertical-position":e.verticalPosition,"horizontal-position":e.horizontalPosition},on:{drag:e.onDrag}},[i("div",{class:e.classnames.default})])};/* scoped */fe._withStripped=!0;/* style */var ve=B({render:fe,staticRenderFns:[]},void 0,ue,void 0,!1,void 0,void 0,void 0),we=L("vue-simple-line"),ye={name:"SimpleLine",components:{LineWrapper:J},props:{classname:{type:String},hoverClassname:{type:String},position:{type:String}},data:function(){return{hover:!1}},computed:{classnames:function(){return{default:A(we(o({},this.position,!0)),this.classname,this.hover&&this.hoverClassname)}}},methods:{onDrag:function(e){this.$emit("drag",e)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1}}},xe=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("LineWrapper",{attrs:{position:e.position},on:{enter:e.onEnter,leave:e.onLeave,drag:e.onDrag}},[i("div",{class:e.classnames.default})])};/* scoped */xe._withStripped=!0;/* style */var be=B({render:xe,staticRenderFns:[]},void 0,ye,void 0,!1,void 0,void 0,void 0),Ce=L("vue-rectangle-stencil"),ze={name:"RectangleStencil",components:{PreviewResult:pe,BoundingBox:ne,DraggableArea:se},props:{img:{type:Object},resultCoordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlerComponent:{type:[Object,String],default:function(){return ve}},handlersClassnames:{type:Object,default:function(){return{}}},lines:{type:Object},lineComponent:{type:[Object,String],default:function(){return be}},linesClassnames:{type:Object,default:function(){return{}}},classname:{type:String},previewClassname:{type:String},boundingBoxClassname:{type:String},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]}},computed:{classes:function(){return{stencil:A(Ce(),this.classname),preview:A(Ce("preview"),this.previewClassname),boundingBox:A(Ce("bounding-box"),this.boundingBoxClassname)}},style:function(){var e=this.stencilCoordinates,t=e.height,i=e.width,n=e.left,a=e.top;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(n,"px"),top:"".concat(a,"px")}}},methods:{onMove:function(e){this.$emit("move",e)},onResize:function(e){this.$emit("resize",e)},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}}},Se=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classes.stencil,style:e.style},[i("BoundingBox",{attrs:{classname:e.classes.boundingBox,handlers:e.handlers,"handler-component":e.handlerComponent,"handlers-classnames":e.handlersClassnames,lines:e.lines,"line-component":e.lineComponent,"lines-classnames":e.linesClassnames},on:{resize:e.onResize}},[i("DraggableArea",{on:{move:e.onMove}},[i("PreviewResult",{attrs:{img:e.img,classname:e.classes.preview,"result-coordinates":e.resultCoordinates,"stencil-coordinates":e.stencilCoordinates}})],1)],1)],1)};/* scoped */Se._withStripped=!0;/* style */var Ee=B({render:Se,staticRenderFns:[]},void 0,ze,void 0,!1,void 0,void 0,void 0),We=L("vue-circle-stencil"),He={name:"CircleStencil",components:{PreviewResult:pe,BoundingBox:ne,DraggableArea:se},props:{img:{type:Object},stencilClass:{type:String},resultCoordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,westNorth:!0,westSouth:!0,eastSouth:!0}}},handlerComponent:{type:[Object,String],default:function(){return ve}},handlersClassnames:{type:Object,default:function(){return{}}},lines:{type:Object},lineComponent:{type:[Object,String],default:function(){return be}},linesClassnames:{type:Object,default:function(){return{}}},classname:{type:String},previewClassname:{type:String},boundingBoxClassname:{type:String}},computed:{classes:function(){return{stencil:A(We(),this.classname),preview:A(We("preview"),this.previewClassname),boundingBox:A(We("bounding-box"),this.boundingBox)}},style:function(){var e=this.stencilCoordinates,t=e.height,i=e.width,n=e.left,a=e.top;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(n,"px"),top:"".concat(a,"px")}}},methods:{onMove:function(e){this.$emit("move",e)},onResize:function(e){this.$emit("resize",e)},aspectRatios:function(){return{minimum:1,maximum:1}}}},$e=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classes.stencil,style:e.style},[i("BoundingBox",{attrs:{classname:e.classes.boundingBox,handlers:e.handlers,"handler-component":e.handlerComponent,"handlers-classnames":e.handlersClassnames,lines:e.lines,"line-component":e.lineComponent,"lines-classnames":e.linesClassnames},on:{resize:e.onResize}},[i("DraggableArea",{on:{move:e.onMove}},[i("PreviewResult",{attrs:{img:e.img,classname:e.classes.preview,"result-coordinates":e.resultCoordinates,"stencil-coordinates":e.stencilCoordinates}})],1)],1)],1)};/* scoped */$e._withStripped=!0;/* style */var Re=B({render:$e,staticRenderFns:[]},void 0,He,void 0,!1,void 0,void 0,void 0),De=L("vue-advanced-cropper"),_e={name:"Cropper",props:{src:{type:String,default:null},resizeAlgorithm:{type:Function,default:function(e){var t=Math.round,i=e.coordinates,n=e.restrictions,a=e.imageSize,o=e.coefficient,r=e.aspectRatio,h=e.resizeEvent,c=s({},i,{right:i.left+i.width,bottom:i.top+i.height}),l=h.params||{},d=s({},h.directions),m=l.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};Object.keys(m).forEach(function(e){m[e]||(d[e]=0)});var p=H(c,d,o),g=$(c,d,o);d=R(d,c,n,o,a),p=H(c,d,o),g=$(c,d,o);// Checks ratio:
var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,d):[d]}return i},U=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"draggable",class:e.classname,on:{touchstart:e.onTouchStart,mousedown:e.onMouseDown,mouseover:e.onMouseOver,mouseleave:e.onMouseLeave}},[e._t("default")],2)};U._withStripped=!0;/* style */var F=B({render:U,staticRenderFns:[]},void 0,I,void 0,!1,void 0,void 0,void 0),O=A("vue-handler-wrapper"),N={name:"HandlerWrapper",components:{DraggableElement:F},props:{horizontalPosition:{type:String},verticalPosition:{type:String},classname:{type:String}},computed:{classnames:function(){var e;if(this.horizontalPosition||this.verticalPosition){var t=m(this.horizontalPosition,this.verticalPosition);e=P(this.classname,O(o({},t.classname,!0)))}else e=P(this.classname,O());return{default:e,draggable:O("draggable")}}}},q=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default},[i("DraggableElement",{class:e.classnames.draggable,on:{drag:function(t){return e.$emit("drag",t)},leave:function(){return e.$emit("leave")},enter:function(){return e.$emit("enter")}}},[e._t("default")],2)],1)};/* scoped */q._withStripped=!0;/* style */var j=B({render:q,staticRenderFns:[]},void 0,N,void 0,!1,void 0,void 0,void 0),G=A("vue-line-wrapper"),K={name:"LineWrapper",components:{DraggableElement:F},props:{position:{type:String,required:!0}},computed:{classname:function(){return G(o({},this.position,!0))}}},V=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("DraggableElement",{class:e.classname,on:{drag:function(t){return e.$emit("drag",t)},leave:function(){return e.$emit("leave")},enter:function(){return e.$emit("enter")}}},[e._t("default")],2)};/* scoped */V._withStripped=!0;/* style */var J=B({render:V,staticRenderFns:[]},void 0,K,void 0,!1,void 0,void 0,void 0),Z=A("vue-bounding-box"),Q=["east","west",null],ee=["south","north",null],te={name:"BoundingBox",props:{classname:{type:String},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlerComponent:{type:[Object,String]},handlersClassnames:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},lineComponent:{type:[Object,String]},linesClassnames:{type:Object,default:function(){return{}}}},data:function(){var e=[];return Q.forEach(function(t){ee.forEach(function(i){if(t!==i){var n=m(t,i),a=n.name,o=n.classname;e.push({name:a,classname:o,verticalDirection:i,horizontalDirection:t})}})}),{points:e}},computed:{classnames:function(){var e=this.handlersClassnames,t=this.linesClassnames;return{default:P(Z(),this.classname),handlers:e,lines:t}},lineNodes:function(){var e=this,t=[];return this.points.forEach(function(i){i.horizontalDirection&&i.verticalDirection||!e.lines[i.name]||t.push({name:i.name,component:e.lineComponent,classname:P(e.classnames.lines.default,e.classnames.lines[i.name]),hoverClassname:e.classnames.lines.hover,verticalDirection:i.verticalDirection,horizontalDirection:i.horizontalDirection})}),t},handlerNodes:function(){var e=this,t=[];return this.points.forEach(function(i){e.handlers[i.name]&&t.push({name:i.name,component:e.handlerComponent,classname:P(e.classnames.handlers.default,e.classnames.handlers[i.name]),hoverClassname:e.classnames.handlers.hover,verticalDirection:i.verticalDirection,horizontalDirection:i.horizontalDirection})}),t}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.draggingAnchor=[]},methods:{onHandlerDrag:function(e,t,i){var n=e.shift(),a=n.left,o=n.top,s={left:0,right:0,top:0,bottom:0};"west"===t?s.left-=a:"east"==t&&(s.right+=a),"north"===i?s.top-=o:"south"==i&&(s.bottom+=o);var r;!i&&t?r="width":i&&!t&&(r="height"),this.$emit("resize",new Y(e.nativeEvent,s,{allowedDirections:{left:"west"===t||!t,right:"east"===t||!t,bottom:"south"===i||!i,top:"north"===i||!i},preserveAspectRatio:e.nativeEvent.shiftKey,respectDirection:r}))}}},ie=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"box",class:e.classnames.default},[e._t("default"),e._v(" "),i("div",e._l(e.lineNodes,function(t){return i(t.component,{key:t.name,tag:"component",attrs:{classname:t.classname,"hover-classname":t.hoverClassname,position:t.name},on:{drag:function(i){return e.onHandlerDrag(i,t.horizontalDirection,t.verticalDirection)}}})}),1),e._v(" "),i("div",e._l(e.handlerNodes,function(t){return i(t.component,{key:t.name,tag:"component",attrs:{classname:t.classname,"hover-classname":t.hoverClassname,"horizontal-position":t.horizontalDirection,"vertical-position":t.verticalDirection},on:{drag:function(i){return e.onHandlerDrag(i,t.horizontalDirection,t.verticalDirection)}}})}),1)],2)};/* scoped */ie._withStripped=!0;/* style */var ne=B({render:ie,staticRenderFns:[]},void 0,te,void 0,!1,void 0,void 0,void 0),ae=A("vue-draggable-area"),oe=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"container",on:{touchstart:e.onTouchStart,mousedown:e.onMouseDown}},[e._t("default")],2)};/* scoped */oe._withStripped=!0;/* style */var se=B({render:oe,staticRenderFns:[]},void 0,{name:"DraggableArea",computed:{classnames:function(){return{default:P(ae(),this.classname)}}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeDestroy:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.draggingAnchor=[]},methods:{onTouchStart:function(t){t.cancelable&&(this.touches=r(t.touches),t.touches.length&&this.initAnchor(this.touches.reduce(function(e,i){return{clientX:e.clientX+i.clientX/t.touches.length,clientY:e.clientY+i.clientY/t.touches.length}},{clientX:0,clientY:0})),t.preventDefault&&t.preventDefault(),t.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(t){this.touches.length&&(this.processMove(t,t.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation())},onMouseDown:function(t){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault())},onMouseUp:function(){this.touches=[]},initAnchor:function(e){var t=this.$refs.container,i=t.getBoundingClientRect(),n=i.left,a=i.top;this.anchor={x:e.clientX-n,y:e.clientY-a}},processMove:function(e,t){var i=this,n=r(t);if(this.touches.length){var a=this.$refs.container,o=a.getBoundingClientRect(),s=o.left,h=o.top;if(1===this.touches.length&&1===n.length)this.$emit("move",new X(e,{left:n[0].clientX-s-this.anchor.x,top:n[0].clientY-h-this.anchor.y}));else if(1<this.touches.length&&this.touches.length===n.length){var c=n.map(function(e,t){return{x:e.clientX-i.touches[t].clientX,y:e.clientY-i.touches[t].clientY,position:{clientX:e.clientX,clientY:e.clientY},length:Math.sqrt(M(e.clientX-i.touches[t].clientX,2)+M(e.clientY-i.touches[t].clientY,2))}}),l=c.reduce(function(e,t){return e+t.length},0),d={left:c.reduce(function(e,t,i){return e+(1-t.length/l)*n[i].clientX},0),top:c.reduce(function(e,t,i){return e+(1-t.length/l)*n[i].clientY},0)},m={top:0,bottom:0,left:0,right:0};c.forEach(function(e,t){.25<e.length/l&&(n[t].clientY>d.top?m.bottom+=e.y:m.top-=e.y,n[t].clientX>d.left?m.right+=e.x:m.left-=e.x)}),this.$emit("resize",new Y(e,m))}this.touches=n}},processEnd:function(){this.touches=[]}}},void 0,!1,void 0,void 0,void 0),re=["left","right"],he=["top","bottom"],ce=["left","right","top","bottom"],le=A("vue-preview-result"),de={name:"PreviewResult",props:{img:{type:Object},classname:{type:String},imageClassname:{type:String},resultCoordinates:{type:Object,default:function(){return{width:0,height:0,left:0,top:0}}},stencilCoordinates:{type:Object,default:function(){return{width:0,height:0,left:0,top:0}}}},computed:{classnames:function(){return{default:P(le(),this.classname),image:P(le("image"),this.imageClassname),wrapper:le("wrapper")}},wrapperStyle:function(){return{width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"calc(50% - ".concat(this.stencilCoordinates.width/2,"px)"),top:"calc(50% - ".concat(this.stencilCoordinates.height/2,"px)")}},imageStyle:function(){var e=this.img.transforms,t=this.img.size.width,i=this.img.size.height,n=this.stencilCoordinates.height/this.resultCoordinates.height,a=i*n,o=t*n,s=e.flipped,r={width:"".concat(o,"px"),height:"".concat(a,"px")};return s?(r.width="".concat(a,"px"),r.height="".concat(o,"px"),r.left="".concat(-this.stencilCoordinates.left-(a-o)/2,"px"),r.top="".concat(-this.stencilCoordinates.top-(o-a)/2,"px")):(r.width="".concat(o,"px"),r.height="".concat(a,"px"),r.left="".concat(-this.stencilCoordinates.left,"px"),r.top="".concat(-this.stencilCoordinates.top,"px")),r.transform=y(e),r}}},me=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default},[i("div",{ref:"wrapper",class:e.classnames.wrapper,style:e.wrapperStyle},[i("img",{ref:"image",class:e.classnames.image,style:e.imageStyle,attrs:{src:e.img.src}})])])};/* scoped */me._withStripped=!0;/* style */var pe=B({render:me,staticRenderFns:[]},void 0,de,void 0,!1,void 0,void 0,void 0),ge=A("vue-square-handler"),ue={name:"SimpleHandler",components:{HandlerWrapper:j},props:{classname:{type:String},hoverClassname:{type:String},horizontalPosition:{type:String},verticalPosition:{type:String}},computed:{classnames:function(){return{default:P(ge(o({},this.position,!0)),this.classname,this.hover&&this.hoverClassname)}}},methods:{onDrag:function(e){this.$emit("drag",e)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1}}},fe=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("HandlerWrapper",{attrs:{"vertical-position":e.verticalPosition,"horizontal-position":e.horizontalPosition},on:{drag:e.onDrag}},[i("div",{class:e.classnames.default})])};/* scoped */fe._withStripped=!0;/* style */var ve=B({render:fe,staticRenderFns:[]},void 0,ue,void 0,!1,void 0,void 0,void 0),we=A("vue-simple-line"),ye={name:"SimpleLine",components:{LineWrapper:J},props:{classname:{type:String},hoverClassname:{type:String},position:{type:String}},data:function(){return{hover:!1}},computed:{classnames:function(){return{default:P(we(o({},this.position,!0)),this.classname,this.hover&&this.hoverClassname)}}},methods:{onDrag:function(e){this.$emit("drag",e)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1}}},xe=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("LineWrapper",{attrs:{position:e.position},on:{enter:e.onEnter,leave:e.onLeave,drag:e.onDrag}},[i("div",{class:e.classnames.default})])};/* scoped */xe._withStripped=!0;/* style */var be=B({render:xe,staticRenderFns:[]},void 0,ye,void 0,!1,void 0,void 0,void 0),Ce=A("vue-rectangle-stencil"),ze={name:"RectangleStencil",components:{PreviewResult:pe,BoundingBox:ne,DraggableArea:se},props:{img:{type:Object},resultCoordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlerComponent:{type:[Object,String],default:function(){return ve}},handlersClassnames:{type:Object,default:function(){return{}}},lines:{type:Object},lineComponent:{type:[Object,String],default:function(){return be}},linesClassnames:{type:Object,default:function(){return{}}},classname:{type:String},previewClassname:{type:String},boundingBoxClassname:{type:String},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]}},computed:{classes:function(){return{stencil:P(Ce(),this.classname),preview:P(Ce("preview"),this.previewClassname),boundingBox:P(Ce("bounding-box"),this.boundingBoxClassname)}},style:function(){var e=this.stencilCoordinates,t=e.height,i=e.width,n=e.left,a=e.top;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(n,"px"),top:"".concat(a,"px")}}},methods:{onMove:function(e){this.$emit("move",e)},onResize:function(e){this.$emit("resize",e)},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}}},Se=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classes.stencil,style:e.style},[i("BoundingBox",{attrs:{classname:e.classes.boundingBox,handlers:e.handlers,"handler-component":e.handlerComponent,"handlers-classnames":e.handlersClassnames,lines:e.lines,"line-component":e.lineComponent,"lines-classnames":e.linesClassnames},on:{resize:e.onResize}},[i("DraggableArea",{on:{move:e.onMove}},[i("PreviewResult",{attrs:{img:e.img,classname:e.classes.preview,"result-coordinates":e.resultCoordinates,"stencil-coordinates":e.stencilCoordinates}})],1)],1)],1)};/* scoped */Se._withStripped=!0;/* style */var Ee=B({render:Se,staticRenderFns:[]},void 0,ze,void 0,!1,void 0,void 0,void 0),We=A("vue-circle-stencil"),He={name:"CircleStencil",components:{PreviewResult:pe,BoundingBox:ne,DraggableArea:se},props:{img:{type:Object},stencilClass:{type:String},resultCoordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,westNorth:!0,westSouth:!0,eastSouth:!0}}},handlerComponent:{type:[Object,String],default:function(){return ve}},handlersClassnames:{type:Object,default:function(){return{}}},lines:{type:Object},lineComponent:{type:[Object,String],default:function(){return be}},linesClassnames:{type:Object,default:function(){return{}}},classname:{type:String},previewClassname:{type:String},boundingBoxClassname:{type:String}},computed:{classes:function(){return{stencil:P(We(),this.classname),preview:P(We("preview"),this.previewClassname),boundingBox:P(We("bounding-box"),this.boundingBox)}},style:function(){var e=this.stencilCoordinates,t=e.height,i=e.width,n=e.left,a=e.top;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(n,"px"),top:"".concat(a,"px")}}},methods:{onMove:function(e){this.$emit("move",e)},onResize:function(e){this.$emit("resize",e)},aspectRatios:function(){return{minimum:1,maximum:1}}}},$e=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classes.stencil,style:e.style},[i("BoundingBox",{attrs:{classname:e.classes.boundingBox,handlers:e.handlers,"handler-component":e.handlerComponent,"handlers-classnames":e.handlersClassnames,lines:e.lines,"line-component":e.lineComponent,"lines-classnames":e.linesClassnames},on:{resize:e.onResize}},[i("DraggableArea",{on:{move:e.onMove}},[i("PreviewResult",{attrs:{img:e.img,classname:e.classes.preview,"result-coordinates":e.resultCoordinates,"stencil-coordinates":e.stencilCoordinates}})],1)],1)],1)};/* scoped */$e._withStripped=!0;/* style */var Re=B({render:$e,staticRenderFns:[]},void 0,He,void 0,!1,void 0,void 0,void 0),De=A("vue-advanced-cropper"),_e={name:"Cropper",props:{src:{type:String,default:null},resizeAlgorithm:{type:Function,default:function(e){var t=Math.round,i=e.coordinates,n=e.restrictions,a=e.imageSize,o=e.coefficient,r=e.aspectRatio,h=e.resizeEvent,c=s({},i,{right:i.left+i.width,bottom:i.top+i.height}),l=h.params||{},d=s({},h.directions),m=l.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};Object.keys(m).forEach(function(e){m[e]||(d[e]=0)});var p=H(c,d,o),g=$(c,d,o);d=R(d,c,n,o,a),p=H(c,d,o),g=$(c,d,o);// Checks ratio:
var u=null;if(l.preserveAspectRatio?u=c.width/c.height:r.minimum&&p/g<r.minimum?u=r.minimum:r.maximum&&p/g>r.maximum&&(u=r.maximum),u){var f=l.respectDirection;if(f||(c.width>c.height?f="width":f="height"),"width"===f){var v=c.height-p/u;m.top&&m.bottom?(d.bottom=-v/(2*o),d.top=-v/(2*o)):m.top?d.top=-v/o:m.bottom?d.bottom=-v/o:m.right?d.right=0:m.left&&(d.left=0)}else if("height"===f){var w=c.width-g*u;m.left&&m.right?(d.left=-w/(2*o),d.right=-w/(2*o)):m.left?d.left=-w/o:m.right?d.right=-w/o:m.top?d.top=0:m.bottom&&(d.bottom=0)}else ce.forEach(function(e){d[e]*=0})}// 3. Third step: check if desired box with correct aspect ratios break some limits and fit to this conditions

@@ -47,9 +47,9 @@ return d=R(d,c,n,o,a,u),{width:i.width+o*(t(d.right)+t(d.left)),height:i.height+o*(t(d.top)+t(d.bottom)),left:_(0,i.left-o*t(d.left)),top:_(0,i.top-o*t(d.top))}}},moveAlgorithm:{type:Function,default:function(e){var t=e.coordinates,i=e.imageSize,n=e.coefficient,a=e.moveEvent,o=s({},a.directions),r={left:t.left+n*o.left,top:t.top+n*o.top,width:t.width,height:t.height};return 0>r.left&&(r.left=0),r.left+r.width>i.width&&(r.left=_(0,i.width-r.width)),0>r.top&&(r.top=0),r.top+r.height>i.height&&(r.top=_(0,i.height-r.height)),r}// eslint-disable-next-line no-unused-vars

function(e){var t,i,n=e.cropper,a=e.image,o=e.minWidth,s=e.minHeight,r=e.maxWidth,h=e.maxHeight,c=e.imageWidth,l=e.imageHeight,d=e.props;return h>r?(t=_(s,.8*h),i=_(o,.8*r)):(i=_(o,.8*r),t=_(s,.8*h)),{height:t,width:i}}},defaultPosition:{type:Function,default:// eslint-disable-next-line no-unused-vars
function(e){var t=e.cropper,i=e.image,n=e.stencilWidth,a=e.stencilHeight,o=e.imageWidth,s=e.imageHeight,r=e.props;return{left:o/2-n/2,top:s/2-a/2}}},areaSize:{type:Function,default:function(e){var t=e.cropper,i=e.image,n=e.imageWidth,a=e.imageHeight,o=t.clientHeight,s=t.clientWidth,r=o,h=n*o/a;return h>s&&(h=s,r=a*s/n),{width:h,height:r}}},restrictions:{type:Function,default:function(e){var t=e.minWidth,i=e.minHeight,n=e.maxWidth,a=e.maxHeight,o=e.imageWidth,s=e.imageHeight;return{minWidth:t/100*o,minHeight:i/100*s,maxWidth:n?n/100*o:o,maxHeight:a?a/100*s:s}}},minWidth:{type:[Number,String],default:10},minHeight:{type:[Number,String],default:10},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},stencilComponent:{type:[Object,String],default:function(){return Ee}},stencilProps:{type:Object,default:function(){return{}}},classname:{type:String},imageClassname:{type:String},areaClassname:{type:String},backgroundClassname:{type:String},debounce:{type:Number,default:500},canvas:{type:Boolean,default:!0},checkCrossOrigin:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},transitionTime:{type:Number,default:300}},data:function(){return{boundarySize:{width:null,height:null},imageLoaded:!1,imageAttributes:{crossOrigin:!1,src:null},imageTransforms:{rotate:null,scaleX:null,scaleY:null},imageSize:{width:null,height:null},coordinates:{left:0,top:0,width:0,height:0},frozenDirections:{width:!1,height:!1}}},computed:{coefficient:function(){return this.imageSize.width?this.imageSize.width/this.boundarySize.width:0},classes:function(){return{cropper:A(De(),this.classname),image:A(De("image"),this.imageClassname),area:A(De("area"),this.areaClassname),stretcher:A(De("stretcher")),background:A(De("background"),this.backgroundClassname)}},stencilCoordinates:function(){var e=this.coordinates,t=e.width,i=e.height,n=e.left,a=e.top;return{width:t/this.coefficient,height:i/this.coefficient,left:n/this.coefficient,top:a/this.coefficient}},wrapperStyle:function(){return{width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"".concat(this.stencilCoordinates.left,"px"),top:"".concat(this.stencilCoordinates.top,"px")}},areaStyle:function(){return{width:this.boundarySize.width?"".concat(this.boundarySize.width,"px"):"auto",height:this.boundarySize.height?"".concat(this.boundarySize.height,"px"):"auto",opacity:this.imageLoaded?1:0,transition:"opacity ".concat(this.transitionTime,"ms")}},imageStyle:function(){var e={left:"50%",top:"50%",transform:"translate(-50%, -50%)"+y(this.imageTransforms)},t=this.imageTransforms.flipped;return t?(e.width="".concat(this.boundarySize.height,"px"),e.height="".concat(this.boundarySize.width,"px")):(e.width="".concat(this.boundarySize.width,"px"),e.height="".concat(this.boundarySize.height,"px")),e},stencilRestrictions:function(){var e=D(this.restrictions,"restrictions",function(e){return[e.minWidth,e.minHeight,e.maxWidth,e.maxHeight,e.imageWidth,e.imageHeight]})({minWidth:+this.minWidth,minHeight:+this.minHeight,maxWidth:+this.maxWidth,maxHeight:+this.maxHeight,imageWidth:this.imageSize.width,imageHeight:this.imageSize.height,props:this.$props});return this.minWidth>this.imageSize.width&&(console.warn("Warning: minimum width (".concat(e.minWidth,"px) greater that the image width (").concat(this.imageSize.width,"px). It is set equal to the image width and width resizing was blocked")),e.minWidth=this.imageSize.width,e.widthFrozen=!0),this.minHeight>this.imageSize.height&&(console.warn("Warning: minimum height (".concat(e.minHeight,"px) greater that the image height (").concat(this.imageSize.height,"px). It is set equal to the image height and height resizing was blocked")),e.minHeight=this.imageSize.height,e.heightFrozen=!0),e.minWidth>e.maxWidth&&(console.warn("Warning: maximum width (".concat(e.maxWidth,"px) fewer that the minimum width (").concat(e.minWidth,"px). It is set equal to the minimum width and width resizing was blocked")),e.maxWidth=e.minWidth,e.widthFrozen=!0),e.minHeight>e.maxHeight&&(console.warn("Warning: maximum height (".concat(e.maxHeight,"px) fewer that the minimum height (").concat(e.minHeight,"px). It is set equal to the minimum height and height resizing was blocked")),e.maxHeight=e.minHeight,e.heightFrozen=!0),(!e.maxWidth||e.maxWidth>this.imageSize.width)&&(e.maxWidth=this.imageSize.width),(!e.maxHeight||e.maxHeight>this.imageSize.height)&&(e.maxHeight=this.imageSize.height),e}},watch:{src:function(){this.onChangeImage()},minWidth:function(){this.resetCoordinates()},maxWidth:function(){this.resetCoordinates()},minHeight:function(){this.resetCoordinates()},maxHeight:function(){this.resetCoordinates()}},mounted:function(){var e=this;this.debouncedUpdate=d(this.update,this.debounce),window.addEventListener("resize",this.refreshImage),window.addEventListener("orientationchange",this.refreshImage),this.$refs.image.addEventListener("load",function(){e.$refs.image&&e.refreshImage().then(e.resetCoordinates)}),this.onChangeImage()},destroyed:function(){window.removeEventListener("resize",this.refreshImage),window.removeEventListener("orientationchange",this.refreshImage)},methods:{// External methods
function(e){var t=e.cropper,i=e.image,n=e.stencilWidth,a=e.stencilHeight,o=e.imageWidth,s=e.imageHeight,r=e.props;return{left:o/2-n/2,top:s/2-a/2}}},areaSize:{type:Function,default:function(e){var t=e.cropper,i=e.image,n=e.imageWidth,a=e.imageHeight,o=t.clientHeight,s=t.clientWidth,r=o,h=n*o/a;return h>s&&(h=s,r=a*s/n),{width:h,height:r}}},restrictions:{type:Function,default:function(e){var t=e.minWidth,i=e.minHeight,n=e.maxWidth,a=e.maxHeight,o=e.imageWidth,s=e.imageHeight;return{minWidth:t/100*o,minHeight:i/100*s,maxWidth:n?n/100*o:o,maxHeight:a?a/100*s:s}}},minWidth:{type:[Number,String],default:10},minHeight:{type:[Number,String],default:10},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},stencilComponent:{type:[Object,String],default:function(){return Ee}},stencilProps:{type:Object,default:function(){return{}}},classname:{type:String},imageClassname:{type:String},areaClassname:{type:String},backgroundClassname:{type:String},debounce:{type:Number,default:500},canvas:{type:Boolean,default:!0},checkCrossOrigin:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},transitionTime:{type:Number,default:300}},data:function(){return{boundarySize:{width:null,height:null},imageLoaded:!1,imageAttributes:{crossOrigin:!1,src:null},imageTransforms:{rotate:null,scaleX:null,scaleY:null},imageSize:{width:null,height:null},coordinates:{left:0,top:0,width:0,height:0},frozenDirections:{width:!1,height:!1}}},computed:{coefficient:function(){return this.imageSize.width?this.imageSize.width/this.boundarySize.width:0},classes:function(){return{cropper:P(De(),this.classname),image:P(De("image"),this.imageClassname),area:P(De("area"),this.areaClassname),stretcher:P(De("stretcher")),background:P(De("background"),this.backgroundClassname)}},stencilCoordinates:function(){var e=this.coordinates,t=e.width,i=e.height,n=e.left,a=e.top;return{width:t/this.coefficient,height:i/this.coefficient,left:n/this.coefficient,top:a/this.coefficient}},wrapperStyle:function(){return{width:"".concat(this.stencilCoordinates.width,"px"),height:"".concat(this.stencilCoordinates.height,"px"),left:"".concat(this.stencilCoordinates.left,"px"),top:"".concat(this.stencilCoordinates.top,"px")}},areaStyle:function(){return{width:this.boundarySize.width?"".concat(this.boundarySize.width,"px"):"auto",height:this.boundarySize.height?"".concat(this.boundarySize.height,"px"):"auto",opacity:this.imageLoaded?1:0,transition:"opacity ".concat(this.transitionTime,"ms")}},imageStyle:function(){var e={left:"50%",top:"50%",transform:"translate(-50%, -50%)"+y(this.imageTransforms)},t=this.imageTransforms.flipped;return t?(e.width="".concat(this.boundarySize.height,"px"),e.height="".concat(this.boundarySize.width,"px")):(e.width="".concat(this.boundarySize.width,"px"),e.height="".concat(this.boundarySize.height,"px")),e},stencilRestrictions:function(){var e=D(this.restrictions,"restrictions",function(e){return[e.minWidth,e.minHeight,e.maxWidth,e.maxHeight,e.imageWidth,e.imageHeight]})({minWidth:+this.minWidth,minHeight:+this.minHeight,maxWidth:+this.maxWidth,maxHeight:+this.maxHeight,imageWidth:this.imageSize.width,imageHeight:this.imageSize.height,props:this.$props});return this.minWidth>this.imageSize.width&&(console.warn("Warning: minimum width (".concat(e.minWidth,"px) greater that the image width (").concat(this.imageSize.width,"px). It is set equal to the image width and width resizing was blocked")),e.minWidth=this.imageSize.width,e.widthFrozen=!0),this.minHeight>this.imageSize.height&&(console.warn("Warning: minimum height (".concat(e.minHeight,"px) greater that the image height (").concat(this.imageSize.height,"px). It is set equal to the image height and height resizing was blocked")),e.minHeight=this.imageSize.height,e.heightFrozen=!0),e.minWidth>e.maxWidth&&(console.warn("Warning: maximum width (".concat(e.maxWidth,"px) fewer that the minimum width (").concat(e.minWidth,"px). It is set equal to the minimum width and width resizing was blocked")),e.maxWidth=e.minWidth,e.widthFrozen=!0),e.minHeight>e.maxHeight&&(console.warn("Warning: maximum height (".concat(e.maxHeight,"px) fewer that the minimum height (").concat(e.minHeight,"px). It is set equal to the minimum height and height resizing was blocked")),e.maxHeight=e.minHeight,e.heightFrozen=!0),(!e.maxWidth||e.maxWidth>this.imageSize.width)&&(e.maxWidth=this.imageSize.width),(!e.maxHeight||e.maxHeight>this.imageSize.height)&&(e.maxHeight=this.imageSize.height),e}},watch:{src:function(){this.onChangeImage()},minWidth:function(){this.resetCoordinates()},maxWidth:function(){this.resetCoordinates()},minHeight:function(){this.resetCoordinates()},maxHeight:function(){this.resetCoordinates()}},mounted:function(){var e=this;this.debouncedUpdate=d(this.update,this.debounce),window.addEventListener("resize",this.refreshImage),window.addEventListener("orientationchange",this.refreshImage),this.$refs.image.addEventListener("load",function(){e.$refs.image&&e.refreshImage().then(e.resetCoordinates)}),this.onChangeImage()},destroyed:function(){window.removeEventListener("resize",this.refreshImage),window.removeEventListener("orientationchange",this.refreshImage)},methods:{// External methods
getResult:function(){return this.canvas&&this.src?(this.updateCanvas(this.coordinates),{coordinates:s({},this.coordinates),canvas:this.$refs.canvas}):{coordinates:s({},this.coordinates)}},// Internal methods
getArea:function(){return this.$refs.area},getStencil:function(){return this.$refs.stencil},updateCanvas:function(e){// This function can be asynchronously called because it's debounced
// Therefore there is workaround to prevent processing after the component was unmounted
if(this.$refs.canvas){var t=this.$refs.image,i=this.checkOrientation?v(this.$refs.sourceCanvas,t,this.imageTransforms):t,n=this.$refs.canvas;n.width=e.width,n.height=e.height;var a=n.getContext("2d");a.drawImage(i,e.left,e.top,e.width,e.height,0,0,e.width,e.height)}},update:function(){this.$emit("change",this.getResult())},onChangeCoordinates:function(e){var t=!(1<arguments.length&&arguments[1]!==void 0)||arguments[1];this.coordinates=e,this.$listeners&&this.$listeners.change&&(t?this.debouncedUpdate():this.update())},onChangeImage:function(){var e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){var t=g(this.src);t&&this.canvas&&this.checkCrossOrigin&&(this.imageAttributes.crossOrigin="anonymous"),setTimeout(function(){e.checkOrientation?x(t?f(e.src):e.src).then(e.onParseImage):e.onParseImage({})},this.transitionTime)}else this.onChangeCoordinates({left:0,top:0,width:0,height:0},!1)},onParseImage:function(e){var i=this,n=e.arrayBuffer,a=e.orientation;this.imageAttributes.src=n&&a&&p(this.src)?W(n):this.src,this.imageTransforms=w(a),t.nextTick(function(){var e=i.$refs.image;e&&e.complete&&i.refreshImage().then(i.resetCoordinates)})},onResize:function(e){this.frozenDirections.width&&(e.directions.left=0,e.directions.right=0),this.frozenDirections.height&&(e.directions.top=0,e.directions.bottom=0),this.onChangeCoordinates(this.resizeAlgorithm({coordinates:this.coordinates,restrictions:this.stencilRestrictions,imageSize:this.imageSize,coefficient:this.coefficient,aspectRatio:this.stencilAspectRatios(),resizeEvent:e}))},onMove:function(e){this.onChangeCoordinates(this.moveAlgorithm({coordinates:this.coordinates,imageSize:this.imageSize,coefficient:this.coefficient,moveEvent:e}))},defaultCoordinates:function(){var e=this.stencilAspectRatios(),t=this.stencilRestrictions,i=t.minWidth,n=t.minHeight,a=t.maxWidth,o=t.maxHeight,s=this.imageSize,r={};if(!e.minimum&&!e.maximum)r.height=n,r.width=i;else{var h={width:{maximum:e.minimum?T(o,i/e.minimum):o,minimum:e.maximum?_(n,i/e.maximum):n},height:{maximum:e.maximum?T(a,n*e.maximum):a,minimum:e.mininum?_(i,n*e.mininum):i}};if(h.width.maximum>=h.width.minimum)r.width=i,r.height=h.width.minimum;else if(h.height.maximum>=h.height.minimum)r.height=n,r.width=h.height.minimum;else throw"Error: current aspect ratio is incompatible with minimum/maximum height and width settings. Can't setup default coordinates"}return r.left=s.width/2-r.width/2,r.top=s.height/2-r.height/2,r},setCoordinates:function(e){var i=this;t.nextTick(function(){return i.imageLoaded?void i.applyTransforms(e):void(i.delayedTransforms=e)})},applyTransforms:function(e){var t=this,i=this.imageSize,n=this.coefficient,a=this.stencilAspectRatios(),o=function(e,a){return t.moveAlgorithm({coordinates:e,imageSize:i,coefficient:n,moveEvent:new X(null,{left:(a.left-e.left)/n,top:(a.top-e.top)/n})})},r=function(e,s){var r=t.defaultCoordinates();return r=t.resizeAlgorithm({coordinates:r,restrictions:t.stencilRestrictions,imageSize:i,coefficient:n,aspectRatio:a,resizeEvent:new Y(null,{left:(s.width-r.width)/(2*n),right:(s.width-r.width)/(2*n),top:(s.height-r.height)/(2*n),bottom:(s.height-r.height)/(2*n)})}),o(r,{left:e.left,top:e.top})},h=this.coordinates;return e.forEach||(e=[e]),e.forEach(function(e){var i={};i="function"==typeof e?e(s({},h),t.imageSize):e,u(i.width)&&u(i.height)||(h=r(h,s({},h,i))),u(i.left)&&u(i.top)||(h=o(h,s({},h,i)))}),this.onChangeCoordinates(h,!1),h},resetCoordinates:function(){var e=this;// This function can be asynchronously called after completion of refreshing image promise
if(this.$refs.canvas){var t=this.$refs.image,i=this.checkOrientation?v(this.$refs.sourceCanvas,t,this.imageTransforms):t,n=this.$refs.canvas;n.width=e.width,n.height=e.height;var a=n.getContext("2d");a.drawImage(i,e.left,e.top,e.width,e.height,0,0,e.width,e.height)}},update:function(){this.$emit("change",this.getResult())},onChangeCoordinates:function(e){var t=!(1<arguments.length&&arguments[1]!==void 0)||arguments[1];this.coordinates=e,this.$listeners&&this.$listeners.change&&(t?this.debouncedUpdate():this.update())},onChangeImage:function(){var e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){var t=g(this.src);t&&this.canvas&&this.checkCrossOrigin&&(this.imageAttributes.crossOrigin="anonymous"),setTimeout(function(){e.checkOrientation?x(t?f(e.src):e.src).then(e.onParseImage):e.onParseImage({})},this.transitionTime)}else this.clearImage()},onParseImage:function(e){var i=this,n=e.arrayBuffer,a=e.orientation;this.imageAttributes.src=n&&a&&p(this.src)?W(n):this.src,this.imageTransforms=w(a),t.nextTick(function(){var e=i.$refs.image;e&&e.complete&&i.refreshImage().then(i.resetCoordinates)})},onResize:function(e){this.frozenDirections.width&&(e.directions.left=0,e.directions.right=0),this.frozenDirections.height&&(e.directions.top=0,e.directions.bottom=0),this.onChangeCoordinates(this.resizeAlgorithm({coordinates:this.coordinates,restrictions:this.stencilRestrictions,imageSize:this.imageSize,coefficient:this.coefficient,aspectRatio:this.stencilAspectRatios(),resizeEvent:e}))},onMove:function(e){this.onChangeCoordinates(this.moveAlgorithm({coordinates:this.coordinates,imageSize:this.imageSize,coefficient:this.coefficient,moveEvent:e}))},defaultCoordinates:function(){var e=this.stencilAspectRatios(),t=this.stencilRestrictions,i=t.minWidth,n=t.minHeight,a=t.maxWidth,o=t.maxHeight,s=this.imageSize,r={};if(!e.minimum&&!e.maximum)r.height=n,r.width=i;else{var h={width:{maximum:e.minimum?T(o,i/e.minimum):o,minimum:e.maximum?_(n,i/e.maximum):n},height:{maximum:e.maximum?T(a,n*e.maximum):a,minimum:e.mininum?_(i,n*e.mininum):i}};if(h.width.maximum>=h.width.minimum)r.width=i,r.height=h.width.minimum;else if(h.height.maximum>=h.height.minimum)r.height=n,r.width=h.height.minimum;else throw"Error: current aspect ratio is incompatible with minimum/maximum height and width settings. Can't setup default coordinates"}return r.left=s.width/2-r.width/2,r.top=s.height/2-r.height/2,r},setCoordinates:function(e){var i=this;t.nextTick(function(){return i.imageLoaded?void i.applyTransforms(e):void(i.delayedTransforms=e)})},applyTransforms:function(e){var t=this,i=this.imageSize,n=this.coefficient,a=this.stencilAspectRatios(),o=function(e,a){return t.moveAlgorithm({coordinates:e,imageSize:i,coefficient:n,moveEvent:new X(null,{left:(a.left-e.left)/n,top:(a.top-e.top)/n})})},r=function(e,s){var r=t.defaultCoordinates();return r=t.resizeAlgorithm({coordinates:r,restrictions:t.stencilRestrictions,imageSize:i,coefficient:n,aspectRatio:a,resizeEvent:new Y(null,{left:(s.width-r.width)/(2*n),right:(s.width-r.width)/(2*n),top:(s.height-r.height)/(2*n),bottom:(s.height-r.height)/(2*n)})}),o(r,{left:e.left,top:e.top})},h=this.coordinates;return e.forEach||(e=[e]),e.forEach(function(e){var i={};i="function"==typeof e?e(s({},h),t.imageSize):e,u(i.width)&&u(i.height)||(h=r(h,s({},h,i))),u(i.left)&&u(i.top)||(h=o(h,s({},h,i)))}),this.onChangeCoordinates(h,!1),h},resetCoordinates:function(){var e=this;// This function can be asynchronously called after completion of refreshing image promise
// Therefore there is a workaround to prevent processing after the component was unmounted
if(this.$refs.image){var t=this.$refs.cropper,i=this.$refs.image,n=this.stencilRestrictions,a=n.minWidth,o=n.minHeight,h=n.maxWidth,c=n.maxHeight,l=n.widthFrozen,d=n.heightFrozen;this.frozenDirections.width=!!l,this.frozenDirections.height=!!d;var m=D(this.defaultSize,"defaultSize",function(e){return[e.cropper,e.image,{minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight},e.imageWidth,e.imageHeight,e.props]})(s({cropper:t,image:i,imageWidth:this.imageSize.width,imageHeight:this.imageSize.height,props:this.$props},this.stencilRestrictions));(m.width<a||m.height<o||m.width>h||m.height>c)&&console.warn("Warning: default size breaking size restrictions. Check your defaultSize function");var p=[m,function(n){return s({},D(e.defaultPosition,"defaultPosition",function(e){return[e.cropper,e.image,e.stencilWidth,e.stencilHeight,e.imageWidth,e.imageHeight,e.props]})({cropper:t,image:i,stencilWidth:n.width,stencilHeight:n.height,imageWidth:e.imageSize.width,imageHeight:e.imageSize.height,props:e.$props}))}];this.delayedTransforms&&p.push.apply(p,r(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.applyTransforms(p),this.delayedTransforms=null,this.imageLoaded=!0}},refreshImage:function(){var e=this,i=this.$refs.image,n=this.$refs.stretcher;this.imageTransforms.flipped?(this.imageSize.height=i.naturalWidth,this.imageSize.width=i.naturalHeight):(this.imageSize.height=i.naturalHeight,this.imageSize.width=i.naturalWidth);var a=this.imageSize.width/this.imageSize.height;return this.imageSize.height>this.imageSize.width?(n.style.height="".concat(this.imageSize.height,"px"),n.style.width="".concat(n.clientHeight*a,"px"),n.clientWidth/n.clientHeight!=a&&(n.style.height="".concat(n.clientWidth/a,"px"))):(n.style.width="".concat(this.imageSize.width,"px"),n.style.height="".concat(n.clientWidth/a,"px"),n.clientHeight/n.clientWidth!=a&&(n.style.width="".concat(n.clientHeight*a,"px"))),new Promise(function(i){var n=e.$refs.cropper,a=e.$refs.image;t.nextTick(function(){var t=D(e.areaSize,"areaSize",function(e){return[e.cropper,e.image,e.imageWidth,e.imageHeight]})({cropper:n,image:a,imageWidth:e.imageSize.width,imageHeight:e.imageSize.height}),o=t.height,s=t.width;o&&(e.boundarySize.height=o),s&&(e.boundarySize.width=s),i()})})},stencilAspectRatios:function(){return this.$refs.stencil.aspectRatios?this.$refs.stencil.aspectRatios():{minimum:this.stencilProps.aspectRatio||this.stencilProps.minAspectRatio,maximum:this.stencilProps.aspectRatio||this.stencilProps.maxAspectRatio}}}},Me=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"cropper",class:e.classes.cropper},[i("div",{class:e.classes.background,style:e.areaStyle}),e._v(" "),i("div",{ref:"stretcher",class:e.classes.stretcher}),e._v(" "),i("div",{ref:"area",class:e.classes.area,style:e.areaStyle},[i("img",{ref:"image",class:e.classes.image,style:e.imageStyle,attrs:{crossOrigin:e.imageAttributes.crossOrigin,src:e.imageAttributes.src}}),e._v(" "),i(e.stencilComponent,e._b({ref:"stencil",tag:"component",attrs:{img:{src:e.imageAttributes.src,size:e.imageSize,transforms:e.imageTransforms},"result-coordinates":e.coordinates,"stencil-coordinates":e.stencilCoordinates},on:{resize:e.onResize,move:e.onMove}},"component",e.stencilProps,!1)),e._v(" "),e.canvas?i("canvas",{ref:"canvas",style:{display:"none"}}):e._e(),e._v(" "),e.canvas?i("canvas",{ref:"sourceCanvas",style:{display:"none"}}):e._e()],1)])};/* scoped */Me._withStripped=!0;/* style */var Te=B({render:Me,staticRenderFns:[]},void 0,_e,void 0,!1,void 0,void 0,void 0),Pe=L("vue-preview-image"),Ae={name:"PreviewImage",props:{img:{type:String},classname:{type:String},imageClassname:{type:String},width:{type:Number},height:{type:Number},top:{type:Number},left:{type:Number},previewWidth:{type:Number,required:!0},previewHeight:{type:Number,required:!0}},data:function(){return{imageSize:{width:0,height:0}}},computed:{classnames:function(){return{default:A(Pe(),this.classname),image:A(Pe("image"),this.imageClassname)}},wrapperStyle:function(){return{width:"".concat(this.previewWidth,"px"),height:"".concat(this.previewHeight,"px")}},imageStyle:function(){var e=this.previewHeight/this.height,t=this.imageSize.height*e,i=this.imageSize.width*e;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(-this.left*e,"px"),top:"".concat(-this.top*e,"px")}}},watch:{img:function(){this.onChangeImage()}},mounted:function(){this.onChangeImage()},methods:{refreshImage:function(){var e=this.$refs.image;this.imageSize.height=e.naturalHeight,this.imageSize.width=e.naturalWidth},onChangeImage:function(){var e=this,t=this.$refs.image;t.complete?this.refreshImage():t.addEventListener("load",function(){e.refreshImage()})}}},Le=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default,style:e.wrapperStyle},[i("img",{ref:"image",class:e.classnames.image,style:e.imageStyle,attrs:{src:e.img}})])};/* scoped */Le._withStripped=!0;/* style */var Ye=B({render:Le,staticRenderFns:[]},void 0,Ae,void 0,!1,void 0,void 0,void 0);/* scoped */t.component("cropper",Te),t.component("rectangle-stencil",Ee),t.component("circle-stencil",Re),t.component("simple-handler",ve),t.component("simple-line",be),e.BoundingBox=ne,e.CircleStencil=Re,e.Cropper=Te,e.DragEvent=k,e.DraggableArea=se,e.DraggableElement=F,e.HandlerWrapper=j,e.LineWrapper=J,e.MoveEvent=X,e.PreviewImage=Ye,e.PreviewResult=pe,e.RectangleStencil=Ee,e.ResizeEvent=Y,e.SimpleHandler=ve,e.SimpleLine=be,Object.defineProperty(e,"__esModule",{value:!0})});
if(this.$refs.image){var t=this.$refs.cropper,i=this.$refs.image,n=this.stencilRestrictions,a=n.minWidth,o=n.minHeight,h=n.maxWidth,c=n.maxHeight,l=n.widthFrozen,d=n.heightFrozen;this.frozenDirections.width=!!l,this.frozenDirections.height=!!d;var m=D(this.defaultSize,"defaultSize",function(e){return[e.cropper,e.image,{minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight},e.imageWidth,e.imageHeight,e.props]})(s({cropper:t,image:i,imageWidth:this.imageSize.width,imageHeight:this.imageSize.height,props:this.$props},this.stencilRestrictions));(m.width<a||m.height<o||m.width>h||m.height>c)&&console.warn("Warning: default size breaking size restrictions. Check your defaultSize function");var p=[m,function(n){return s({},D(e.defaultPosition,"defaultPosition",function(e){return[e.cropper,e.image,e.stencilWidth,e.stencilHeight,e.imageWidth,e.imageHeight,e.props]})({cropper:t,image:i,stencilWidth:n.width,stencilHeight:n.height,imageWidth:e.imageSize.width,imageHeight:e.imageSize.height,props:e.$props}))}];this.delayedTransforms&&p.push.apply(p,r(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.applyTransforms(p),this.delayedTransforms=null,this.imageLoaded=!0}},clearImage:function(){var e=this.$refs.stretcher;this.imageLoaded=!1,this.onChangeCoordinates({left:0,top:0,width:0,height:0},!1),setTimeout(function(){e.style.height="auto",e.style.width="auto"},this.transitionTime)},refreshImage:function(){var e=this;if(this.src){var i=this.$refs.image,n=this.$refs.stretcher;this.imageTransforms.flipped?(this.imageSize.height=i.naturalWidth,this.imageSize.width=i.naturalHeight):(this.imageSize.height=i.naturalHeight,this.imageSize.width=i.naturalWidth);var a=this.imageSize.width/this.imageSize.height;return this.imageSize.height>this.imageSize.width?(n.style.height="".concat(this.imageSize.height,"px"),n.style.width="".concat(n.clientHeight*a,"px"),n.clientWidth/n.clientHeight!=a&&(n.style.height="".concat(n.clientWidth/a,"px"))):(n.style.width="".concat(this.imageSize.width,"px"),n.style.height="".concat(n.clientWidth/a,"px"),n.clientHeight/n.clientWidth!=a&&(n.style.width="".concat(n.clientHeight*a,"px"))),new Promise(function(i){var n=e.$refs.cropper,a=e.$refs.image;t.nextTick(function(){var t=D(e.areaSize,"areaSize",function(e){return[e.cropper,e.image,e.imageWidth,e.imageHeight]})({cropper:n,image:a,imageWidth:e.imageSize.width,imageHeight:e.imageSize.height}),o=t.height,s=t.width;o&&(e.boundarySize.height=o),s&&(e.boundarySize.width=s),i()})})}},stencilAspectRatios:function(){return this.$refs.stencil.aspectRatios?this.$refs.stencil.aspectRatios():{minimum:this.stencilProps.aspectRatio||this.stencilProps.minAspectRatio,maximum:this.stencilProps.aspectRatio||this.stencilProps.maxAspectRatio}}}},Me=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"cropper",class:e.classes.cropper},[i("div",{class:e.classes.background,style:e.areaStyle}),e._v(" "),i("div",{ref:"stretcher",class:e.classes.stretcher}),e._v(" "),i("div",{ref:"area",class:e.classes.area,style:e.areaStyle},[i("img",{ref:"image",class:e.classes.image,style:e.imageStyle,attrs:{crossOrigin:e.imageAttributes.crossOrigin,src:e.imageAttributes.src}}),e._v(" "),i(e.stencilComponent,e._b({ref:"stencil",tag:"component",attrs:{img:{src:e.imageAttributes.src,size:e.imageSize,transforms:e.imageTransforms},"result-coordinates":e.coordinates,"stencil-coordinates":e.stencilCoordinates},on:{resize:e.onResize,move:e.onMove}},"component",e.stencilProps,!1)),e._v(" "),e.canvas?i("canvas",{ref:"canvas",style:{display:"none"}}):e._e(),e._v(" "),e.canvas?i("canvas",{ref:"sourceCanvas",style:{display:"none"}}):e._e()],1)])};/* scoped */Me._withStripped=!0;/* style */var Te=B({render:Me,staticRenderFns:[]},void 0,_e,void 0,!1,void 0,void 0,void 0),Le=A("vue-preview-image"),Pe={name:"PreviewImage",props:{img:{type:String},classname:{type:String},imageClassname:{type:String},width:{type:Number},height:{type:Number},top:{type:Number},left:{type:Number},previewWidth:{type:Number,required:!0},previewHeight:{type:Number,required:!0}},data:function(){return{imageSize:{width:0,height:0}}},computed:{classnames:function(){return{default:P(Le(),this.classname),image:P(Le("image"),this.imageClassname)}},wrapperStyle:function(){return{width:"".concat(this.previewWidth,"px"),height:"".concat(this.previewHeight,"px")}},imageStyle:function(){var e=this.previewHeight/this.height,t=this.imageSize.height*e,i=this.imageSize.width*e;return{width:"".concat(i,"px"),height:"".concat(t,"px"),left:"".concat(-this.left*e,"px"),top:"".concat(-this.top*e,"px")}}},watch:{img:function(){this.onChangeImage()}},mounted:function(){this.onChangeImage()},methods:{refreshImage:function(){var e=this.$refs.image;this.imageSize.height=e.naturalHeight,this.imageSize.width=e.naturalWidth},onChangeImage:function(){var e=this,t=this.$refs.image;t.complete?this.refreshImage():t.addEventListener("load",function(){e.refreshImage()})}}},Ae=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.classnames.default,style:e.wrapperStyle},[i("img",{ref:"image",class:e.classnames.image,style:e.imageStyle,attrs:{src:e.img}})])};/* scoped */Ae._withStripped=!0;/* style */var Ye=B({render:Ae,staticRenderFns:[]},void 0,Pe,void 0,!1,void 0,void 0,void 0);/* scoped */t.component("cropper",Te),t.component("rectangle-stencil",Ee),t.component("circle-stencil",Re),t.component("simple-handler",ve),t.component("simple-line",be),e.BoundingBox=ne,e.CircleStencil=Re,e.Cropper=Te,e.DragEvent=k,e.DraggableArea=se,e.DraggableElement=F,e.HandlerWrapper=j,e.LineWrapper=J,e.MoveEvent=X,e.PreviewImage=Ye,e.PreviewResult=pe,e.RectangleStencil=Ee,e.ResizeEvent=Y,e.SimpleHandler=ve,e.SimpleLine=be,Object.defineProperty(e,"__esModule",{value:!0})});

@@ -84,2 +84,2 @@ function styleInject(id, css) {

};
styleInject("vue-advanced-cropper", ".vue-advanced-cropper { text-align: center; position: relative; overflow: hidden; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; max-height: 100%; max-width: 100%;}.vue-advanced-cropper__stretcher { pointer-events: none; position: relative; max-width: 100%; max-height: 100%;}.vue-advanced-cropper__image { opacity: 0.5; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; position: absolute; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}.vue-advanced-cropper__area { position: absolute; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); top: 50%;}.vue-advanced-cropper__background { position: absolute; background: black; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-advanced-cropper__stencil-wrapper { position: absolute;}/*# sourceMappingURL=Cropper.vue.map */.vue-rectangle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; cursor: move;}/*# sourceMappingURL=RectangleStencil.vue.map */.vue-circle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: content-box; box-sizing: content-box; cursor: move;}.vue-circle-stencil__preview { border-radius: 50%;}/*# sourceMappingURL=CircleStencil.vue.map */.vue-line-wrapper { background: none; position: absolute; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-line-wrapper--north, .vue-line-wrapper--south { height: 12px; width: 100%; left: 0; -webkit-transform: translateY(-50%); transform: translateY(-50%);}.vue-line-wrapper--north { top: 0; cursor: n-resize;}.vue-line-wrapper--south { top: 100%; cursor: s-resize;}.vue-line-wrapper--east, .vue-line-wrapper--west { width: 12px; height: 100%; -webkit-transform: translateX(-50%); transform: translateX(-50%); top: 0;}.vue-line-wrapper--east { left: 100%; cursor: e-resize;}.vue-line-wrapper--west { left: 0; cursor: w-resize;}/*# sourceMappingURL=LineWrapper.vue.map */.vue-bounding-box { position: relative; height: 100%; width: 100%;}.vue-bounding-box__line { position: absolute;}.vue-bounding-box__line--north { top: 0; width: 100%; cursor: n-resize;}.vue-bounding-box__line--east { left: 100%; top: 0; height: 100%; cursor: e-resize;}.vue-bounding-box__line--south { top: 100%; width: 100%; cursor: s-resize;}.vue-bounding-box__line--west { left: 0; top: 0; height: 100%; cursor: w-resize;}/*# sourceMappingURL=BoundingBox.vue.map */.vue-square-handler { display: block; background: white; height: 10px; width: 10px;}/*# sourceMappingURL=SimpleHandler.vue.map */.vue-handler-wrapper { position: absolute; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-handler-wrapper__draggable { width: 30px; height: 30px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-handler-wrapper--west-north { left: 0; top: 0; cursor: nw-resize;}.vue-handler-wrapper--north { left: 50%; top: 0; cursor: n-resize;}.vue-handler-wrapper--east-north { left: 100%; top: 0; cursor: ne-resize;}.vue-handler-wrapper--east { left: 100%; top: 50%; cursor: e-resize;}.vue-handler-wrapper--east-south { left: 100%; top: 100%; cursor: se-resize;}.vue-handler-wrapper--south { left: 50%; top: 100%; cursor: s-resize;}.vue-handler-wrapper--west-south { left: 0; top: 100%; cursor: sw-resize;}.vue-handler-wrapper--west { left: 0; top: 50%; cursor: w-resize;}/*# sourceMappingURL=HandlerWrapper.vue.map */.vue-draggable-area { position: relative;}/*# sourceMappingURL=DraggableArea.vue.map */.vue-preview-result { overflow: hidden; -webkit-box-sizing: border-box; box-sizing: border-box; position: absolute; height: 100%; width: 100%;}.vue-preview-result__wrapper { position: absolute;}.vue-preview-result__image { pointer-events: none; position: absolute; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}/*# sourceMappingURL=PreviewResult.vue.map */.vue-simple-line { background: none; -webkit-transition: border 0.5s; transition: border 0.5s; border-color: rgba(255, 255, 255, 0.3); border-width: 0; border-style: solid;}.vue-simple-line--south, .vue-simple-line--north { height: 0; width: 100%;}.vue-simple-line--east, .vue-simple-line--west { height: 100%; width: 0;}.vue-simple-line--east { border-right-width: 1px;}.vue-simple-line--west { border-left-width: 1px;}.vue-simple-line--south { border-top-width: 1px;}.vue-simple-line--north { border-bottom-width: 1px;}.vue-simple-line--hover { opacity: 1; border-color: white;}/*# sourceMappingURL=SimpleLine.vue.map */.vue-preview-image { overflow: hidden; position: relative;}.vue-preview-image__image { pointer-events: none; position: absolute; max-width: unset !important;}/*# sourceMappingURL=PreviewImage.vue.map */");//# sourceMappingURL=index.umd.js.map
styleInject("vue-advanced-cropper", ".vue-advanced-cropper { text-align: center; position: relative; overflow: hidden; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; max-height: 100%; max-width: 100%;}.vue-advanced-cropper__stretcher { pointer-events: none; position: relative; max-width: 100%; max-height: 100%;}.vue-advanced-cropper__image { opacity: 0.5; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; position: absolute; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}.vue-advanced-cropper__area { position: absolute; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); top: 50%;}.vue-advanced-cropper__background { position: absolute; background: black; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-advanced-cropper__stencil-wrapper { position: absolute;}/*# sourceMappingURL=Cropper.vue.map */.vue-square-handler { display: block; background: white; height: 10px; width: 10px;}/*# sourceMappingURL=SimpleHandler.vue.map */.vue-handler-wrapper { position: absolute; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}.vue-handler-wrapper__draggable { width: 30px; height: 30px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-handler-wrapper--west-north { left: 0; top: 0; cursor: nw-resize;}.vue-handler-wrapper--north { left: 50%; top: 0; cursor: n-resize;}.vue-handler-wrapper--east-north { left: 100%; top: 0; cursor: ne-resize;}.vue-handler-wrapper--east { left: 100%; top: 50%; cursor: e-resize;}.vue-handler-wrapper--east-south { left: 100%; top: 100%; cursor: se-resize;}.vue-handler-wrapper--south { left: 50%; top: 100%; cursor: s-resize;}.vue-handler-wrapper--west-south { left: 0; top: 100%; cursor: sw-resize;}.vue-handler-wrapper--west { left: 0; top: 50%; cursor: w-resize;}/*# sourceMappingURL=HandlerWrapper.vue.map */.vue-line-wrapper { background: none; position: absolute; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;}.vue-line-wrapper--north, .vue-line-wrapper--south { height: 12px; width: 100%; left: 0; -webkit-transform: translateY(-50%); transform: translateY(-50%);}.vue-line-wrapper--north { top: 0; cursor: n-resize;}.vue-line-wrapper--south { top: 100%; cursor: s-resize;}.vue-line-wrapper--east, .vue-line-wrapper--west { width: 12px; height: 100%; -webkit-transform: translateX(-50%); transform: translateX(-50%); top: 0;}.vue-line-wrapper--east { left: 100%; cursor: e-resize;}.vue-line-wrapper--west { left: 0; cursor: w-resize;}/*# sourceMappingURL=LineWrapper.vue.map */.vue-bounding-box { position: relative; height: 100%; width: 100%;}.vue-bounding-box__line { position: absolute;}.vue-bounding-box__line--north { top: 0; width: 100%; cursor: n-resize;}.vue-bounding-box__line--east { left: 100%; top: 0; height: 100%; cursor: e-resize;}.vue-bounding-box__line--south { top: 100%; width: 100%; cursor: s-resize;}.vue-bounding-box__line--west { left: 0; top: 0; height: 100%; cursor: w-resize;}/*# sourceMappingURL=BoundingBox.vue.map */.vue-draggable-area { position: relative;}/*# sourceMappingURL=DraggableArea.vue.map */.vue-preview-result { overflow: hidden; -webkit-box-sizing: border-box; box-sizing: border-box; position: absolute; height: 100%; width: 100%;}.vue-preview-result__wrapper { position: absolute;}.vue-preview-result__image { pointer-events: none; position: absolute; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-transform-origin: center; transform-origin: center; max-width: unset !important;}/*# sourceMappingURL=PreviewResult.vue.map */.vue-preview-image { overflow: hidden; position: relative;}.vue-preview-image__image { pointer-events: none; position: absolute; max-width: unset !important;}/*# sourceMappingURL=PreviewImage.vue.map */.vue-simple-line { background: none; -webkit-transition: border 0.5s; transition: border 0.5s; border-color: rgba(255, 255, 255, 0.3); border-width: 0; border-style: solid;}.vue-simple-line--south, .vue-simple-line--north { height: 0; width: 100%;}.vue-simple-line--east, .vue-simple-line--west { height: 100%; width: 0;}.vue-simple-line--east { border-right-width: 1px;}.vue-simple-line--west { border-left-width: 1px;}.vue-simple-line--south { border-top-width: 1px;}.vue-simple-line--north { border-bottom-width: 1px;}.vue-simple-line--hover { opacity: 1; border-color: white;}/*# sourceMappingURL=SimpleLine.vue.map */.vue-circle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: content-box; box-sizing: content-box; cursor: move;}.vue-circle-stencil__preview { border-radius: 50%;}/*# sourceMappingURL=CircleStencil.vue.map */.vue-rectangle-stencil { position: absolute; height: 100%; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; cursor: move;}/*# sourceMappingURL=RectangleStencil.vue.map */");//# sourceMappingURL=index.umd.js.map
{
"name": "vue-advanced-cropper",
"version": "0.13.1",
"version": "0.13.2",
"description": "The advanced library to create your own croppers suited for any website design",

@@ -5,0 +5,0 @@ "author": "Norserium",

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 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