t.exports=function(){function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function e(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){a(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t){return h(t)||c(t)||u(t)||l()}function h(t){if(Array.isArray(t))return p(t)}function c(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function u(t,e){if(t){if("string"==typeof t)return p(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(t,e):void 0}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var d="undefined"!=typeof window&&void 0!==window.document,f=d?window:{},m=!(!d||!f.document.documentElement)&&"ontouchstart"in f.document.documentElement,g=!!d&&"PointerEvent"in f,v="cropper",w="all",b="crop",y="move",x="zoom",C="e",M="w",k="s",D="n",B="ne",A="nw",T="se",S="sw",E="".concat(v,"-crop"),R="".concat(v,"-disabled"),O="".concat(v,"-hidden"),W="".concat(v,"-hide"),H="".concat(v,"-invisible"),z="".concat(v,"-modal"),N="".concat(v,"-move"),L="".concat(v,"Action"),j="".concat(v,"Preview"),P="crop",X="move",Y="none",I="crop",_="cropend",U="cropmove",V="cropstart",q="dblclick",F=m?"touchstart":"mousedown",G=m?"touchmove":"mousemove",Q=m?"touchend touchcancel":"mouseup",$=g?"pointerdown":F,K=g?"pointermove":G,Z=g?"pointerup pointercancel":Q,J="ready",tt="resize",et="wheel",nt="zoom",it="image/jpeg",rt=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,ot=/^data:/,at=/^data:image\/jpeg;base64,/,st=/^img|canvas$/i,ht=200,ct=100,ut={viewMode:0,dragMode:P,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:ht,minContainerHeight:ct,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},pt='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',lt=Number.isNaN||f.isNaN;function dt(t){return"number"==typeof t&&!lt(t)}var ft=function(t){return t>0&&t<1/0};function mt(t){return void 0===t}function gt(t){return"object"===n(t)&&null!==t}var vt=Object.prototype.hasOwnProperty;function wt(t){if(!gt(t))return!1;try{var e=t.constructor,n=e.prototype;return e&&n&&vt.call(n,"isPrototypeOf")}catch(t){return!1}}function bt(t){return"function"==typeof t}var yt=Array.prototype.slice;function xt(t){return Array.from?Array.from(t):yt.call(t)}function Ct(t,e){return t&&bt(e)&&(Array.isArray(t)||dt(t.length)?xt(t).forEach((function(n,i){e.call(t,n,i,t)})):gt(t)&&Object.keys(t).forEach((function(n){e.call(t,t[n],n,t)}))),t}var Mt=Object.assign||function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return gt(t)&&n.length>0&&n.forEach((function(e){gt(e)&&Object.keys(e).forEach((function(n){t[n]=e[n]}))})),t},kt=/\.\d*(?:0|9){12}\d*$/;function Dt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return kt.test(t)?Math.round(t*e)/e:t}var Bt=/^width|height|left|top|marginLeft|marginTop$/;function At(t,e){var n=t.style;Ct(e,(function(t,e){Bt.test(e)&&dt(t)&&(t="".concat(t,"px")),n[e]=t}))}function Tt(t,e){return t.classList?t.classList.contains(e):t.className.indexOf(e)>-1}function St(t,e){if(e)if(dt(t.length))Ct(t,(function(t){St(t,e)}));else if(t.classList)t.classList.add(e);else{var n=t.className.trim();n?n.indexOf(e)<0&&(t.className="".concat(n," ").concat(e)):t.className=e}}function Et(t,e){e&&(dt(t.length)?Ct(t,(function(t){Et(t,e)})):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function Rt(t,e,n){e&&(dt(t.length)?Ct(t,(function(t){Rt(t,e,n)})):n?St(t,e):Et(t,e))}var Ot=/([a-z\d])([A-Z])/g;function Wt(t){return t.replace(Ot,"$1-$2").toLowerCase()}function Ht(t,e){return gt(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(Wt(e)))}function zt(t,e,n){gt(n)?t[e]=n:t.dataset?t.dataset[e]=n:t.setAttribute("data-".concat(Wt(e)),n)}function Nt(t,e){if(gt(t[e]))try{delete t[e]}catch(n){t[e]=void 0}else if(t.dataset)try{delete t.dataset[e]}catch(n){t.dataset[e]=void 0}else t.removeAttribute("data-".concat(Wt(e)))}var Lt=/\s\s*/,jt=function(){var t=!1;if(d){var e=!1,n=function(){},i=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});f.addEventListener("test",n,i),f.removeEventListener("test",n,i)}return t}();function Pt(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n;e.trim().split(Lt).forEach((function(e){if(!jt){var o=t.listeners;o&&o[e]&&o[e][n]&&(r=o[e][n],delete o[e][n],0===Object.keys(o[e]).length&&delete o[e],0===Object.keys(o).length&&delete t.listeners)}t.removeEventListener(e,r,i)}))}function Xt(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n;e.trim().split(Lt).forEach((function(e){if(i.once&&!jt){var o=t.listeners,a=void 0===o?{}:o;r=function(){delete a[e][n],t.removeEventListener(e,r,i);for(var o=arguments.length,s=new Array(o),h=0;h<o;h++)s[h]=arguments[h];n.apply(t,s)},a[e]||(a[e]={}),a[e][n]&&t.removeEventListener(e,a[e][n],i),a[e][n]=r,t.listeners=a}t.addEventListener(e,r,i)}))}function Yt(t,e,n){var i;return bt(Event)&&bt(CustomEvent)?i=new CustomEvent(e,{detail:n,bubbles:!0,cancelable:!0}):(i=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,n),t.dispatchEvent(i)}function It(t){var e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var _t=f.location,Ut=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Vt(t){var e=t.match(Ut);return null!==e&&(e[1]!==_t.protocol||e[2]!==_t.hostname||e[3]!==_t.port)}function qt(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function Ft(t){var e=t.rotate,n=t.scaleX,i=t.scaleY,r=t.translateX,o=t.translateY,a=[];dt(r)&&0!==r&&a.push("translateX(".concat(r,"px)")),dt(o)&&0!==o&&a.push("translateY(".concat(o,"px)")),dt(e)&&0!==e&&a.push("rotate(".concat(e,"deg)")),dt(n)&&1!==n&&a.push("scaleX(".concat(n,")")),dt(i)&&1!==i&&a.push("scaleY(".concat(i,")"));var s=a.length?a.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Gt(t){var n=e({},t),i=0;return Ct(t,(function(t,e){delete n[e],Ct(n,(function(e){var n=Math.abs(t.startX-e.startX),r=Math.abs(t.startY-e.startY),o=Math.abs(t.endX-e.endX),a=Math.abs(t.endY-e.endY),s=Math.sqrt(n*n+r*r),h=(Math.sqrt(o*o+a*a)-s)/s;Math.abs(h)>Math.abs(i)&&(i=h)}))})),i}function Qt(t,n){var i=t.pageX,r=t.pageY,o={endX:i,endY:r};return n?o:e({startX:i,startY:r},o)}function $t(t){var e=0,n=0,i=0;return Ct(t,(function(t){var r=t.startX,o=t.startY;e+=r,n+=o,i+=1})),{pageX:e/=i,pageY:n/=i}}function Kt(t){var e=t.aspectRatio,n=t.height,i=t.width,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",o=ft(i),a=ft(n);if(o&&a){var s=n*e;"contain"===r&&s>i||"cover"===r&&s<i?n=i/e:i=n*e}else o?n=i/e:a&&(i=n*e);return{width:i,height:n}}function Zt(t){var e=t.width,n=t.height,i=t.degree;if(90==(i=Math.abs(i)%180))return{width:n,height:e};var r=i%90*Math.PI/180,o=Math.sin(r),a=Math.cos(r),s=e*a+n*o,h=e*o+n*a;return i>90?{width:h,height:s}:{width:s,height:h}}function Jt(t,e,n,i){var r=e.aspectRatio,o=e.naturalWidth,a=e.naturalHeight,h=e.rotate,c=void 0===h?0:h,u=e.scaleX,p=void 0===u?1:u,l=e.scaleY,d=void 0===l?1:l,f=n.aspectRatio,m=n.naturalWidth,g=n.naturalHeight,v=i.fillColor,w=void 0===v?"transparent":v,b=i.imageSmoothingEnabled,y=void 0===b||b,x=i.imageSmoothingQuality,C=void 0===x?"low":x,M=i.maxWidth,k=void 0===M?1/0:M,D=i.maxHeight,B=void 0===D?1/0:D,A=i.minWidth,T=void 0===A?0:A,S=i.minHeight,E=void 0===S?0:S,R=document.createElement("canvas"),O=R.getContext("2d"),W=Kt({aspectRatio:f,width:k,height:B}),H=Kt({aspectRatio:f,width:T,height:E},"cover"),z=Math.min(W.width,Math.max(H.width,m)),N=Math.min(W.height,Math.max(H.height,g)),L=Kt({aspectRatio:r,width:k,height:B}),j=Kt({aspectRatio:r,width:T,height:E},"cover"),P=Math.min(L.width,Math.max(j.width,o)),X=Math.min(L.height,Math.max(j.height,a)),Y=[-P/2,-X/2,P,X];return R.width=Dt(z),R.height=Dt(N),O.fillStyle=w,O.fillRect(0,0,z,N),O.save(),O.translate(z/2,N/2),O.rotate(c*Math.PI/180),O.scale(p,d),O.imageSmoothingEnabled=y,O.imageSmoothingQuality=C,O.drawImage.apply(O,[t].concat(s(Y.map((function(t){return Math.floor(Dt(t))}))))),O.restore(),R}var te=String.fromCharCode;function ee(t,e,n){var i="";n+=e;for(var r=e;r<n;r+=1)i+=te(t.getUint8(r));return i}var ne=/^data:.*,/;function ie(t){var e=t.replace(ne,""),n=atob(e),i=new ArrayBuffer(n.length),r=new Uint8Array(i);return Ct(r,(function(t,e){r[e]=n.charCodeAt(e)})),i}function re(t,e){for(var n=[],i=8192,r=new Uint8Array(t);r.length>0;)n.push(te.apply(null,xt(r.subarray(0,i)))),r=r.subarray(i);return"data:".concat(e,";base64,").concat(btoa(n.join("")))}function oe(t){var e,n=new DataView(t);try{var i,r,o;if(255===n.getUint8(0)&&216===n.getUint8(1))for(var a=n.byteLength,s=2;s+1<a;){if(255===n.getUint8(s)&&225===n.getUint8(s+1)){r=s;break}s+=1}if(r){var h=r+10;if("Exif"===ee(n,r+4,4)){var c=n.getUint16(h);if(((i=18761===c)||19789===c)&&42===n.getUint16(h+2,i)){var u=n.getUint32(h+4,i);u>=8&&(o=h+u)}}}if(o){var p,l,d=n.getUint16(o,i);for(l=0;l<d;l+=1)if(p=o+12*l+2,274===n.getUint16(p,i)){p+=8,e=n.getUint16(p,i),n.setUint16(p,1,i);break}}}catch(t){e=1}return e}function ae(t){var e=0,n=1,i=1;switch(t){case 2:n=-1;break;case 3:e=-180;break;case 4:i=-1;break;case 5:e=90,i=-1;break;case 6:e=90;break;case 7:e=90,n=-1;break;case 8:e=-90}return{rotate:e,scaleX:n,scaleY:i}}var se={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,e=this.options,n=this.container,i=this.cropper,r=Number(e.minContainerWidth),o=Number(e.minContainerHeight);St(i,O),Et(t,O);var a={width:Math.max(n.offsetWidth,r>=0?r:ht),height:Math.max(n.offsetHeight,o>=0?o:ct)};this.containerData=a,At(i,{width:a.width,height:a.height}),St(t,O),Et(i,O)},initCanvas:function(){var t=this.containerData,e=this.imageData,n=this.options.viewMode,i=Math.abs(e.rotate)%180==90,r=i?e.naturalHeight:e.naturalWidth,o=i?e.naturalWidth:e.naturalHeight,a=r/o,s=t.width,h=t.height;t.height*a>t.width?3===n?s=t.height*a:h=t.width/a:3===n?h=t.width/a:s=t.height*a;var c={aspectRatio:a,naturalWidth:r,naturalHeight:o,width:s,height:h};this.canvasData=c,this.limited=1===n||2===n,this.limitCanvas(!0,!0),c.width=Math.min(Math.max(c.width,c.minWidth),c.maxWidth),c.height=Math.min(Math.max(c.height,c.minHeight),c.maxHeight),c.left=(t.width-c.width)/2,c.top=(t.height-c.height)/2,c.oldLeft=c.left,c.oldTop=c.top,this.initialCanvasData=Mt({},c)},limitCanvas:function(t,e){var n=this.options,i=this.containerData,r=this.canvasData,o=this.cropBoxData,a=n.viewMode,s=r.aspectRatio,h=this.cropped&&o;if(t){var c=Number(n.minCanvasWidth)||0,u=Number(n.minCanvasHeight)||0;a>1?(c=Math.max(c,i.width),u=Math.max(u,i.height),3===a&&(u*s>c?c=u*s:u=c/s)):a>0&&(c?c=Math.max(c,h?o.width:0):u?u=Math.max(u,h?o.height:0):h&&(c=o.width,(u=o.height)*s>c?c=u*s:u=c/s));var p=Kt({aspectRatio:s,width:c,height:u});c=p.width,u=p.height,r.minWidth=c,r.minHeight=u,r.maxWidth=1/0,r.maxHeight=1/0}if(e)if(a>(h?0:1)){var l=i.width-r.width,d=i.height-r.height;r.minLeft=Math.min(0,l),r.minTop=Math.min(0,d),r.maxLeft=Math.max(0,l),r.maxTop=Math.max(0,d),h&&this.limited&&(r.minLeft=Math.min(o.left,o.left+(o.width-r.width)),r.minTop=Math.min(o.top,o.top+(o.height-r.height)),r.maxLeft=o.left,r.maxTop=o.top,2===a&&(r.width>=i.width&&(r.minLeft=Math.min(0,l),r.maxLeft=Math.max(0,l)),r.height>=i.height&&(r.minTop=Math.min(0,d),r.maxTop=Math.max(0,d))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=i.width,r.maxTop=i.height},renderCanvas:function(t,e){var n=this.canvasData,i=this.imageData;if(e){var r=Zt({width:i.naturalWidth*Math.abs(i.scaleX||1),height:i.naturalHeight*Math.abs(i.scaleY||1),degree:i.rotate||0}),o=r.width,a=r.height,s=n.width*(o/n.naturalWidth),h=n.height*(a/n.naturalHeight);n.left-=(s-n.width)/2,n.top-=(h-n.height)/2,n.width=s,n.height=h,n.aspectRatio=o/a,n.naturalWidth=o,n.naturalHeight=a,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCanvas(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,At(this.canvas,Mt({width:n.width,height:n.height},Ft({translateX:n.left,translateY:n.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var e=this.canvasData,n=this.imageData,i=n.naturalWidth*(e.width/e.naturalWidth),r=n.naturalHeight*(e.height/e.naturalHeight);Mt(n,{width:i,height:r,left:(e.width-i)/2,top:(e.height-r)/2}),At(this.image,Mt({width:n.width,height:n.height},Ft(Mt({translateX:n.left,translateY:n.top},n)))),t&&this.output()},initCropBox:function(){var t=this.options,e=this.canvasData,n=t.aspectRatio||t.initialAspectRatio,i=Number(t.autoCropArea)||.8,r={width:e.width,height:e.height};n&&(e.height*n>e.width?r.height=r.width/n:r.width=r.height*n),this.cropBoxData=r,this.limitCropBox(!0,!0),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),r.width=Math.max(r.minWidth,r.width*i),r.height=Math.max(r.minHeight,r.height*i),r.left=e.left+(e.width-r.width)/2,r.top=e.top+(e.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=Mt({},r)},limitCropBox:function(t,e){var n=this.options,i=this.containerData,r=this.canvasData,o=this.cropBoxData,a=this.limited,s=n.aspectRatio;if(t){var h=Number(n.minCropBoxWidth)||0,c=Number(n.minCropBoxHeight)||0,u=a?Math.min(i.width,r.width,r.width+r.left,i.width-r.left):i.width,p=a?Math.min(i.height,r.height,r.height+r.top,i.height-r.top):i.height;h=Math.min(h,i.width),c=Math.min(c,i.height),s&&(h&&c?c*s>h?c=h/s:h=c*s:h?c=h/s:c&&(h=c*s),p*s>u?p=u/s:u=p*s),o.minWidth=Math.min(h,u),o.minHeight=Math.min(c,p),o.maxWidth=u,o.maxHeight=p}e&&(a?(o.minLeft=Math.max(0,r.left),o.minTop=Math.max(0,r.top),o.maxLeft=Math.min(i.width,r.left+r.width)-o.width,o.maxTop=Math.min(i.height,r.top+r.height)-o.height):(o.minLeft=0,o.minTop=0,o.maxLeft=i.width-o.width,o.maxTop=i.height-o.height))},renderCropBox:function(){var t=this.options,e=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCropBox(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,t.movable&&t.cropBoxMovable&&zt(this.face,L,n.width>=e.width&&n.height>=e.height?y:w),At(this.cropBox,Mt({width:n.width,height:n.height},Ft({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Yt(this.element,I,this.getData())}},he={initPreview:function(){var t=this.element,e=this.crossOrigin,n=this.options.preview,i=e?this.crossOriginUrl:this.url,r=t.alt||"The image to preview",o=document.createElement("img");if(e&&(o.crossOrigin=e),o.src=i,o.alt=r,this.viewBox.appendChild(o),this.viewBoxImage=o,n){var a=n;"string"==typeof n?a=t.ownerDocument.querySelectorAll(n):n.querySelector&&(a=[n]),this.previews=a,Ct(a,(function(t){var n=document.createElement("img");zt(t,j,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),e&&(n.crossOrigin=e),n.src=i,n.alt=r,n.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',t.innerHTML="",t.appendChild(n)}))}},resetPreview:function(){Ct(this.previews,(function(t){var e=Ht(t,j);At(t,{width:e.width,height:e.height}),t.innerHTML=e.html,Nt(t,j)}))},preview:function(){var t=this.imageData,e=this.canvasData,n=this.cropBoxData,i=n.width,r=n.height,o=t.width,a=t.height,s=n.left-e.left-t.left,h=n.top-e.top-t.top;this.cropped&&!this.disabled&&(At(this.viewBoxImage,Mt({width:o,height:a},Ft(Mt({translateX:-s,translateY:-h},t)))),Ct(this.previews,(function(e){var n=Ht(e,j),c=n.width,u=n.height,p=c,l=u,d=1;i&&(l=r*(d=c/i)),r&&l>u&&(p=i*(d=u/r),l=u),At(e,{width:p,height:l}),At(e.getElementsByTagName("img")[0],Mt({width:o*d,height:a*d},Ft(Mt({translateX:-s*d,translateY:-h*d},t))))})))}},ce={bind:function(){var t=this.element,e=this.options,n=this.cropper;bt(e.cropstart)&&Xt(t,V,e.cropstart),bt(e.cropmove)&&Xt(t,U,e.cropmove),bt(e.cropend)&&Xt(t,_,e.cropend),bt(e.crop)&&Xt(t,I,e.crop),bt(e.zoom)&&Xt(t,nt,e.zoom),Xt(n,$,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&Xt(n,et,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&Xt(n,q,this.onDblclick=this.dblclick.bind(this)),Xt(t.ownerDocument,K,this.onCropMove=this.cropMove.bind(this)),Xt(t.ownerDocument,Z,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&Xt(window,tt,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,n=this.cropper;bt(e.cropstart)&&Pt(t,V,e.cropstart),bt(e.cropmove)&&Pt(t,U,e.cropmove),bt(e.cropend)&&Pt(t,_,e.cropend),bt(e.crop)&&Pt(t,I,e.crop),bt(e.zoom)&&Pt(t,nt,e.zoom),Pt(n,$,this.onCropStart),e.zoomable&&e.zoomOnWheel&&Pt(n,et,this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&Pt(n,q,this.onDblclick),Pt(t.ownerDocument,K,this.onCropMove),Pt(t.ownerDocument,Z,this.onCropEnd),e.responsive&&Pt(window,tt,this.onResize)}},ue={resize:function(){if(!this.disabled){var t,e,n=this.options,i=this.container,r=this.containerData,o=i.offsetWidth/r.width,a=i.offsetHeight/r.height,s=Math.abs(o-1)>Math.abs(a-1)?o:a;1!==s&&(n.restore&&(t=this.getCanvasData(),e=this.getCropBoxData()),this.render(),n.restore&&(this.setCanvasData(Ct(t,(function(e,n){t[n]=e*s}))),this.setCropBoxData(Ct(e,(function(t,n){e[n]=t*s})))))}},dblclick:function(){this.disabled||this.options.dragMode===Y||this.setDragMode(Tt(this.dragBox,E)?X:P)},wheel:function(t){var e=this,n=Number(this.options.wheelZoomRatio)||.1,i=1;this.disabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){e.wheeling=!1}),50),t.deltaY?i=t.deltaY>0?1:-1:t.wheelDelta?i=-t.wheelDelta/120:t.detail&&(i=t.detail>0?1:-1),this.zoom(-i*n,t)))},cropStart:function(t){var e=t.buttons,n=t.button;if(!(this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(dt(e)&&1!==e||dt(n)&&0!==n||t.ctrlKey))){var i,r=this.options,o=this.pointers;t.changedTouches?Ct(t.changedTouches,(function(t){o[t.identifier]=Qt(t)})):o[t.pointerId||0]=Qt(t),i=Object.keys(o).length>1&&r.zoomable&&r.zoomOnTouch?x:Ht(t.target,L),rt.test(i)&&!1!==Yt(this.element,V,{originalEvent:t,action:i})&&(t.preventDefault(),this.action=i,this.cropping=!1,i===b&&(this.cropping=!0,St(this.dragBox,z)))}},cropMove:function(t){var e=this.action;if(!this.disabled&&e){var n=this.pointers;t.preventDefault(),!1!==Yt(this.element,U,{originalEvent:t,action:e})&&(t.changedTouches?Ct(t.changedTouches,(function(t){Mt(n[t.identifier]||{},Qt(t,!0))})):Mt(n[t.pointerId||0]||{},Qt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,n=this.pointers;t.changedTouches?Ct(t.changedTouches,(function(t){delete n[t.identifier]})):delete n[t.pointerId||0],e&&(t.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,Rt(this.dragBox,z,this.cropped&&this.options.modal)),Yt(this.element,_,{originalEvent:t,action:e}))}}},pe={change:function(t){var e,n=this.options,i=this.canvasData,r=this.containerData,o=this.cropBoxData,a=this.pointers,s=this.action,h=n.aspectRatio,c=o.left,u=o.top,p=o.width,l=o.height,d=c+p,f=u+l,m=0,g=0,v=r.width,E=r.height,R=!0;!h&&t.shiftKey&&(h=p&&l?p/l:1),this.limited&&(m=o.minLeft,g=o.minTop,v=m+Math.min(r.width,i.width,i.left+i.width),E=g+Math.min(r.height,i.height,i.top+i.height));var W=a[Object.keys(a)[0]],H={x:W.endX-W.startX,y:W.endY-W.startY},z=function(t){switch(t){case C:d+H.x>v&&(H.x=v-d);break;case M:c+H.x<m&&(H.x=m-c);break;case D:u+H.y<g&&(H.y=g-u);break;case k:f+H.y>E&&(H.y=E-f)}};switch(s){case w:c+=H.x,u+=H.y;break;case C:if(H.x>=0&&(d>=v||h&&(u<=g||f>=E))){R=!1;break}z(C),(p+=H.x)<0&&(s=M,c-=p=-p),h&&(l=p/h,u+=(o.height-l)/2);break;case D:if(H.y<=0&&(u<=g||h&&(c<=m||d>=v))){R=!1;break}z(D),l-=H.y,u+=H.y,l<0&&(s=k,u-=l=-l),h&&(p=l*h,c+=(o.width-p)/2);break;case M:if(H.x<=0&&(c<=m||h&&(u<=g||f>=E))){R=!1;break}z(M),p-=H.x,c+=H.x,p<0&&(s=C,c-=p=-p),h&&(l=p/h,u+=(o.height-l)/2);break;case k:if(H.y>=0&&(f>=E||h&&(c<=m||d>=v))){R=!1;break}z(k),(l+=H.y)<0&&(s=D,u-=l=-l),h&&(p=l*h,c+=(o.width-p)/2);break;case B:if(h){if(H.y<=0&&(u<=g||d>=v)){R=!1;break}z(D),l-=H.y,u+=H.y,p=l*h}else z(D),z(C),H.x>=0?d<v?p+=H.x:H.y<=0&&u<=g&&(R=!1):p+=H.x,H.y<=0?u>g&&(l-=H.y,u+=H.y):(l-=H.y,u+=H.y);p<0&&l<0?(s=S,u-=l=-l,c-=p=-p):p<0?(s=A,c-=p=-p):l<0&&(s=T,u-=l=-l);break;case A:if(h){if(H.y<=0&&(u<=g||c<=m)){R=!1;break}z(D),l-=H.y,u+=H.y,p=l*h,c+=o.width-p}else z(D),z(M),H.x<=0?c>m?(p-=H.x,c+=H.x):H.y<=0&&u<=g&&(R=!1):(p-=H.x,c+=H.x),H.y<=0?u>g&&(l-=H.y,u+=H.y):(l-=H.y,u+=H.y);p<0&&l<0?(s=T,u-=l=-l,c-=p=-p):p<0?(s=B,c-=p=-p):l<0&&(s=S,u-=l=-l);break;case S:if(h){if(H.x<=0&&(c<=m||f>=E)){R=!1;break}z(M),p-=H.x,c+=H.x,l=p/h}else z(k),z(M),H.x<=0?c>m?(p-=H.x,c+=H.x):H.y>=0&&f>=E&&(R=!1):(p-=H.x,c+=H.x),H.y>=0?f<E&&(l+=H.y):l+=H.y;p<0&&l<0?(s=B,u-=l=-l,c-=p=-p):p<0?(s=T,c-=p=-p):l<0&&(s=A,u-=l=-l);break;case T:if(h){if(H.x>=0&&(d>=v||f>=E)){R=!1;break}z(C),l=(p+=H.x)/h}else z(k),z(C),H.x>=0?d<v?p+=H.x:H.y>=0&&f>=E&&(R=!1):p+=H.x,H.y>=0?f<E&&(l+=H.y):l+=H.y;p<0&&l<0?(s=A,u-=l=-l,c-=p=-p):p<0?(s=S,c-=p=-p):l<0&&(s=B,u-=l=-l);break;case y:this.move(H.x,H.y),R=!1;break;case x:this.zoom(Gt(a),t),R=!1;break;case b:if(!H.x||!H.y){R=!1;break}e=It(this.cropper),c=W.startX-e.left,u=W.startY-e.top,p=o.minWidth,l=o.minHeight,H.x>0?s=H.y>0?T:B:H.x<0&&(c-=p,s=H.y>0?S:A),H.y<0&&(u-=l),this.cropped||(Et(this.cropBox,O),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}R&&(o.width=p,o.height=l,o.left=c,o.top=u,this.action=s,this.renderCropBox()),Ct(a,(function(t){t.startX=t.endX,t.startY=t.endY}))}},le={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&St(this.dragBox,z),Et(this.cropBox,O),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Mt({},this.initialImageData),this.canvasData=Mt({},this.initialCanvasData),this.cropBoxData=Mt({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Mt(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Et(this.dragBox,z),St(this.cropBox,O)),this},replace:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&t&&(this.isImg&&(this.element.src=t),e?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,Ct(this.previews,(function(e){e.getElementsByTagName("img")[0].src=t})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Et(this.cropper,R)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,St(this.cropper,R)),this},destroy:function(){var t=this.element;return t[v]?(t[v]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.canvasData,i=n.left,r=n.top;return this.moveTo(mt(t)?t:i+Number(t),mt(e)?e:r+Number(e))},moveTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.canvasData,i=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(dt(t)&&(n.left=t,i=!0),dt(e)&&(n.top=e,i=!0),i&&this.renderCanvas(!0)),this},zoom:function(t,e){var n=this.canvasData;return t=(t=Number(t))<0?1/(1-t):1+t,this.zoomTo(n.width*t/n.naturalWidth,null,e)},zoomTo:function(t,e,n){var i=this.options,r=this.canvasData,o=r.width,a=r.height,s=r.naturalWidth,h=r.naturalHeight;if((t=Number(t))>=0&&this.ready&&!this.disabled&&i.zoomable){var c=s*t,u=h*t;if(!1===Yt(this.element,nt,{ratio:t,oldRatio:o/s,originalEvent:n}))return this;if(n){var p=this.pointers,l=It(this.cropper),d=p&&Object.keys(p).length?$t(p):{pageX:n.pageX,pageY:n.pageY};r.left-=(c-o)*((d.pageX-l.left-r.left)/o),r.top-=(u-a)*((d.pageY-l.top-r.top)/a)}else wt(e)&&dt(e.x)&&dt(e.y)?(r.left-=(c-o)*((e.x-r.left)/o),r.top-=(u-a)*((e.y-r.top)/a)):(r.left-=(c-o)/2,r.top-=(u-a)/2);r.width=c,r.height=u,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return dt(t=Number(t))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,dt(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(dt(e)?e:1,t)},scale:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.imageData,i=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(dt(t)&&(n.scaleX=t,i=!0),dt(e)&&(n.scaleY=e,i=!0),i&&this.renderCanvas(!0,!0)),this},getData:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.options,i=this.imageData,r=this.canvasData,o=this.cropBoxData;if(this.ready&&this.cropped){t={x:o.left-r.left,y:o.top-r.top,width:o.width,height:o.height};var a=i.width/i.naturalWidth;if(Ct(t,(function(e,n){t[n]=e/a})),e){var s=Math.round(t.y+t.height),h=Math.round(t.x+t.width);t.x=Math.round(t.x),t.y=Math.round(t.y),t.width=h-t.x,t.height=s-t.y}}else t={x:0,y:0,width:0,height:0};return n.rotatable&&(t.rotate=i.rotate||0),n.scalable&&(t.scaleX=i.scaleX||1,t.scaleY=i.scaleY||1),t},setData:function(t){var e=this.options,n=this.imageData,i=this.canvasData,r={};if(this.ready&&!this.disabled&&wt(t)){var o=!1;e.rotatable&&dt(t.rotate)&&t.rotate!==n.rotate&&(n.rotate=t.rotate,o=!0),e.scalable&&(dt(t.scaleX)&&t.scaleX!==n.scaleX&&(n.scaleX=t.scaleX,o=!0),dt(t.scaleY)&&t.scaleY!==n.scaleY&&(n.scaleY=t.scaleY,o=!0)),o&&this.renderCanvas(!0,!0);var a=n.width/n.naturalWidth;dt(t.x)&&(r.left=t.x*a+i.left),dt(t.y)&&(r.top=t.y*a+i.top),dt(t.width)&&(r.width=t.width*a),dt(t.height)&&(r.height=t.height*a),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?Mt({},this.containerData):{}},getImageData:function(){return this.sized?Mt({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&Ct(["left","top","width","height","naturalWidth","naturalHeight"],(function(n){e[n]=t[n]})),e},setCanvasData:function(t){var e=this.canvasData,n=e.aspectRatio;return this.ready&&!this.disabled&&wt(t)&&(dt(t.left)&&(e.left=t.left),dt(t.top)&&(e.top=t.top),dt(t.width)?(e.width=t.width,e.height=t.width/n):dt(t.height)&&(e.height=t.height,e.width=t.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var t,e=this.cropBoxData;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(t){var e,n,i=this.cropBoxData,r=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&wt(t)&&(dt(t.left)&&(i.left=t.left),dt(t.top)&&(i.top=t.top),dt(t.width)&&t.width!==i.width&&(e=!0,i.width=t.width),dt(t.height)&&t.height!==i.height&&(n=!0,i.height=t.height),r&&(e?i.height=i.width/r:n&&(i.width=i.height*r)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var e=this.canvasData,n=Jt(this.image,this.imageData,e,t);if(!this.cropped)return n;var i=this.getData(),r=i.x,o=i.y,a=i.width,h=i.height,c=n.width/Math.floor(e.naturalWidth);1!==c&&(r*=c,o*=c,a*=c,h*=c);var u=a/h,p=Kt({aspectRatio:u,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),l=Kt({aspectRatio:u,width:t.minWidth||0,height:t.minHeight||0},"cover"),d=Kt({aspectRatio:u,width:t.width||(1!==c?n.width:a),height:t.height||(1!==c?n.height:h)}),f=d.width,m=d.height;f=Math.min(p.width,Math.max(l.width,f)),m=Math.min(p.height,Math.max(l.height,m));var g=document.createElement("canvas"),v=g.getContext("2d");g.width=Dt(f),g.height=Dt(m),v.fillStyle=t.fillColor||"transparent",v.fillRect(0,0,f,m);var w=t.imageSmoothingEnabled,b=void 0===w||w,y=t.imageSmoothingQuality;v.imageSmoothingEnabled=b,y&&(v.imageSmoothingQuality=y);var x,C,M,k,D,B,A=n.width,T=n.height,S=r,E=o;S<=-a||S>A?(S=0,x=0,M=0,D=0):S<=0?(M=-S,S=0,D=x=Math.min(A,a+S)):S<=A&&(M=0,D=x=Math.min(a,A-S)),x<=0||E<=-h||E>T?(E=0,C=0,k=0,B=0):E<=0?(k=-E,E=0,B=C=Math.min(T,h+E)):E<=T&&(k=0,B=C=Math.min(h,T-E));var R=[S,E,x,C];if(D>0&&B>0){var O=f/a;R.push(M*O,k*O,D*O,B*O)}return v.drawImage.apply(v,[n].concat(s(R.map((function(t){return Math.floor(Dt(t))}))))),g},setAspectRatio:function(t){var e=this.options;return this.disabled||mt(t)||(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var e=this.options,n=this.dragBox,i=this.face;if(this.ready&&!this.disabled){var r=t===P,o=e.movable&&t===X;t=r||o?t:Y,e.dragMode=t,zt(n,L,t),Rt(n,E,r),Rt(n,N,o),e.cropBoxMovable||(zt(i,L,t),Rt(i,E,r),Rt(i,N,o))}return this}},de=f.Cropper,fe=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(i(this,t),!e||!st.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=Mt({},ut,wt(n)&&n),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return o(t,[{key:"init",value:function(){var t,e=this.element,n=e.tagName.toLowerCase();if(!e[v]){if(e[v]=this,"img"===n){if(this.isImg=!0,t=e.getAttribute("src")||"",this.originalUrl=t,!t)return;t=e.src}else"canvas"===n&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t)}}},{key:"load",value:function(t){var e=this;if(t){this.url=t,this.imageData={};var n=this.element,i=this.options;if(i.rotatable||i.scalable||(i.checkOrientation=!1),i.checkOrientation&&window.ArrayBuffer)if(ot.test(t))at.test(t)?this.read(ie(t)):this.clone();else{var r=new XMLHttpRequest,o=this.clone.bind(this);this.reloading=!0,this.xhr=r,r.onabort=o,r.onerror=o,r.ontimeout=o,r.onprogress=function(){r.getResponseHeader("content-type")!==it&&r.abort()},r.onload=function(){e.read(r.response)},r.onloadend=function(){e.reloading=!1,e.xhr=null},i.checkCrossOrigin&&Vt(t)&&n.crossOrigin&&(t=qt(t)),r.open("GET",t,!0),r.responseType="arraybuffer",r.withCredentials="use-credentials"===n.crossOrigin,r.send()}else this.clone()}}},{key:"read",value:function(t){var e=this.options,n=this.imageData,i=oe(t),r=0,o=1,a=1;if(i>1){this.url=re(t,it);var s=ae(i);r=s.rotate,o=s.scaleX,a=s.scaleY}e.rotatable&&(n.rotate=r),e.scalable&&(n.scaleX=o,n.scaleY=a),this.clone()}},{key:"clone",value:function(){var t=this.element,e=this.url,n=t.crossOrigin,i=e;this.options.checkCrossOrigin&&Vt(e)&&(n||(n="anonymous"),i=qt(e)),this.crossOrigin=n,this.crossOriginUrl=i;var r=document.createElement("img");n&&(r.crossOrigin=n),r.src=i||e,r.alt=t.alt||"The image to crop",this.image=r,r.onload=this.start.bind(this),r.onerror=this.stop.bind(this),St(r,W),t.parentNode.insertBefore(r,t.nextSibling)}},{key:"start",value:function(){var t=this,e=this.image;e.onload=null,e.onerror=null,this.sizing=!0;var n=f.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(f.navigator.userAgent),i=function(e,n){Mt(t.imageData,{naturalWidth:e,naturalHeight:n,aspectRatio:e/n}),t.initialImageData=Mt({},t.imageData),t.sizing=!1,t.sized=!0,t.build()};if(!e.naturalWidth||n){var r=document.createElement("img"),o=document.body||document.documentElement;this.sizingImage=r,r.onload=function(){i(r.width,r.height),n||o.removeChild(r)},r.src=e.src,n||(r.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",o.appendChild(r))}else i(e.naturalWidth,e.naturalHeight)}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var t=this.element,e=this.options,n=this.image,i=t.parentNode,r=document.createElement("div");r.innerHTML=pt;var o=r.querySelector(".".concat(v,"-container")),a=o.querySelector(".".concat(v,"-canvas")),s=o.querySelector(".".concat(v,"-drag-box")),h=o.querySelector(".".concat(v,"-crop-box")),c=h.querySelector(".".concat(v,"-face"));this.container=i,this.cropper=o,this.canvas=a,this.dragBox=s,this.cropBox=h,this.viewBox=o.querySelector(".".concat(v,"-view-box")),this.face=c,a.appendChild(n),St(t,O),i.insertBefore(o,t.nextSibling),this.isImg||Et(n,W),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,St(h,O),e.guides||St(h.getElementsByClassName("".concat(v,"-dashed")),O),e.center||St(h.getElementsByClassName("".concat(v,"-center")),O),e.background&&St(o,"".concat(v,"-bg")),e.highlight||St(c,H),e.cropBoxMovable&&(St(c,N),zt(c,L,w)),e.cropBoxResizable||(St(h.getElementsByClassName("".concat(v,"-line")),O),St(h.getElementsByClassName("".concat(v,"-point")),O)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),bt(e.ready)&&Xt(t,J,e.ready,{once:!0}),Yt(t,J)}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),Et(this.element,O))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=de,t}},{key:"setDefaults",value:function(t){Mt(ut,wt(t)&&t)}}]),t}();return Mt(fe.prototype,se,he,ce,ue,pe,le),fe}()}));function a(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}a("/*!\n * Cropper.js v1.5.12\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2021-06-12T08:00:11.623Z\n */\n\n.cropper-container {\n direction: ltr;\n font-size: 0;\n line-height: 0;\n position: relative;\n -ms-touch-action: none;\n touch-action: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.cropper-container img {\n display: block;\n height: 100%;\n image-orientation: 0deg;\n max-height: none !important;\n max-width: none !important;\n min-height: 0 !important;\n min-width: 0 !important;\n width: 100%;\n}\n\n.cropper-wrap-box,\n.cropper-canvas,\n.cropper-drag-box,\n.cropper-crop-box,\n.cropper-modal {\n bottom: 0;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.cropper-wrap-box,\n.cropper-canvas {\n overflow: hidden;\n}\n\n.cropper-drag-box {\n background-color: #fff;\n opacity: 0;\n}\n\n.cropper-modal {\n background-color: #000;\n opacity: 0.5;\n}\n\n.cropper-view-box {\n display: block;\n height: 100%;\n outline: 1px solid #39f;\n outline-color: rgba(51, 153, 255, 0.75);\n overflow: hidden;\n width: 100%;\n}\n\n.cropper-dashed {\n border: 0 dashed #eee;\n display: block;\n opacity: 0.5;\n position: absolute;\n}\n\n.cropper-dashed.dashed-h {\n border-bottom-width: 1px;\n border-top-width: 1px;\n height: calc(100% / 3);\n left: 0;\n top: calc(100% / 3);\n width: 100%;\n}\n\n.cropper-dashed.dashed-v {\n border-left-width: 1px;\n border-right-width: 1px;\n height: 100%;\n left: calc(100% / 3);\n top: 0;\n width: calc(100% / 3);\n}\n\n.cropper-center {\n display: block;\n height: 0;\n left: 50%;\n opacity: 0.75;\n position: absolute;\n top: 50%;\n width: 0;\n}\n\n.cropper-center::before,\n.cropper-center::after {\n background-color: #eee;\n content: ' ';\n display: block;\n position: absolute;\n}\n\n.cropper-center::before {\n height: 1px;\n left: -3px;\n top: 0;\n width: 7px;\n}\n\n.cropper-center::after {\n height: 7px;\n left: 0;\n top: -3px;\n width: 1px;\n}\n\n.cropper-face,\n.cropper-line,\n.cropper-point {\n display: block;\n height: 100%;\n opacity: 0.1;\n position: absolute;\n width: 100%;\n}\n\n.cropper-face {\n background-color: #fff;\n left: 0;\n top: 0;\n}\n\n.cropper-line {\n background-color: #39f;\n}\n\n.cropper-line.line-e {\n cursor: ew-resize;\n right: -3px;\n top: 0;\n width: 5px;\n}\n\n.cropper-line.line-n {\n cursor: ns-resize;\n height: 5px;\n left: 0;\n top: -3px;\n}\n\n.cropper-line.line-w {\n cursor: ew-resize;\n left: -3px;\n top: 0;\n width: 5px;\n}\n\n.cropper-line.line-s {\n bottom: -3px;\n cursor: ns-resize;\n height: 5px;\n left: 0;\n}\n\n.cropper-point {\n background-color: #39f;\n height: 5px;\n opacity: 0.75;\n width: 5px;\n}\n\n.cropper-point.point-e {\n cursor: ew-resize;\n margin-top: -3px;\n right: -3px;\n top: 50%;\n}\n\n.cropper-point.point-n {\n cursor: ns-resize;\n left: 50%;\n margin-left: -3px;\n top: -3px;\n}\n\n.cropper-point.point-w {\n cursor: ew-resize;\n left: -3px;\n margin-top: -3px;\n top: 50%;\n}\n\n.cropper-point.point-s {\n bottom: -3px;\n cursor: s-resize;\n left: 50%;\n margin-left: -3px;\n}\n\n.cropper-point.point-ne {\n cursor: nesw-resize;\n right: -3px;\n top: -3px;\n}\n\n.cropper-point.point-nw {\n cursor: nwse-resize;\n left: -3px;\n top: -3px;\n}\n\n.cropper-point.point-sw {\n bottom: -3px;\n cursor: nesw-resize;\n left: -3px;\n}\n\n.cropper-point.point-se {\n bottom: -3px;\n cursor: nwse-resize;\n height: 20px;\n opacity: 1;\n right: -3px;\n width: 20px;\n}\n\n@media (min-width: 768px) {\n .cropper-point.point-se {\n height: 15px;\n width: 15px;\n }\n}\n\n@media (min-width: 992px) {\n .cropper-point.point-se {\n height: 10px;\n width: 10px;\n }\n}\n\n@media (min-width: 1200px) {\n .cropper-point.point-se {\n height: 5px;\n opacity: 0.75;\n width: 5px;\n }\n}\n\n.cropper-point.point-se::before {\n background-color: #39f;\n bottom: -50%;\n content: ' ';\n display: block;\n height: 200%;\n opacity: 0;\n position: absolute;\n right: -50%;\n width: 200%;\n}\n\n.cropper-invisible {\n opacity: 0;\n}\n\n.cropper-bg {\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');\n}\n\n.cropper-hide {\n display: block;\n height: 0;\n position: absolute;\n width: 0;\n}\n\n.cropper-hidden {\n display: none !important;\n}\n\n.cropper-move {\n cursor: move;\n}\n\n.cropper-crop {\n cursor: crosshair;\n}\n\n.cropper-disabled .cropper-drag-box,\n.cropper-disabled .cropper-face,\n.cropper-disabled .cropper-line,\n.cropper-disabled .cropper-point {\n cursor: not-allowed;\n}\n"),t.cropper=null;var s=e.defineComponent({name:"VuePictureCropper",props:{boxStyle:{type:Object,required:!1,default:function(){return{}}},img:String,options:{type:Object,required:!1,default:function(){return{}}}},data:function(){return{cropper:null,mimeType:""}},watch:{img:function(t,e){if(!this.cropper)return this.init(),!1;try{this.cropper.replace(this.img),this.getImgSuffix()}catch(t){console.log(t)}}},beforeUnmount:function(){this.cropper&&this.cropper.destroy()},mounted:function(){this.init()},methods:{init:function(){return i(this,void 0,void 0,(function(){var t,e=this;return r(this,(function(n){switch(n.label){case 0:return[4,this.$nextTick()];case 1:return n.sent(),t=setInterval((function(){var n=document.querySelector(".vue--picture-cropper__img");if(n)try{e.cropper=new o(n,e.options),clearInterval(t),e.updateInstance(),e.getImgSuffix()}catch(t){console.log(t)}}),10),[2]}}))}))},updateInstance:function(){t.cropper=this.cropper,t.cropper.getDataURL=this.getDataURL,t.cropper.getBlob=this.getBlob},getImgSuffix:function(){var t=this.img.split(",")[0].replace(/data:(.*);base64/,"$1");this.mimeType=t},getDataURL:function(t){void 0===t&&(t={});try{return this.cropper.getCroppedCanvas(t).toDataURL(this.mimeType)}catch(t){return""}},getBlob:function(e){var n=t.cropper.getDataURL();if(!n)return null;for(var i=n.split(","),r=i[1].substring(0,i[1].length-2),o=window.atob(r),a=o.length,s=new Uint8Array(a);a--;)s[a]=o.charCodeAt(a);return new Blob([s],{type:this.mimeType})}}});a("\n.vue--picture-cropper__wrap {\n width: 100%;\n height: 100%;\n margin: 0;\n}\n.vue--picture-cropper__img {\n display: block;\n width: auto;\n height: auto;\n max-width: 100%;\n max-height: 100%;\n}\n"),s.render=function(t,n,i,r,o,a){return e.openBlock(),e.createBlock("div",{class:"vue--picture-cropper__wrap",style:t.boxStyle},[e.createVNode("img",{class:"vue--picture-cropper__img",src:t.img},null,8,["src"])],4)},s.__file="src/vue-picture-cropper.vue",t.default=s,Object.defineProperty(t,"__esModule",{value:!0})}))},8756:function(t,e,n){"use strict";n.r(e),n.d(e,{BaseTransition:function(){return i.pR},BaseTransitionPropsValidators:function(){return i.QP},Comment:function(){return i.Mw},DeprecationTypes:function(){return i.aT},EffectScope:function(){return i.yC},ErrorCodes:function(){return i.tG},ErrorTypeStrings:function(){return i.ZQ},Fragment:function(){return i.FK},KeepAlive:function(){return i.PR},ReactiveEffect:function(){return i.X2},Static:function(){return i.jC},Suspense:function(){return i.tY},Teleport:function(){return i.Im},Text:function(){return i.EY},TrackOpTypes:function(){return i.Ul},Transition:function(){return i.eB},TransitionGroup:function(){return i.F},TriggerOpTypes:function(){return i.PP},VueElement:function(){return i.Vy},assertNumber:function(){return i.U4},callWithAsyncErrorHandling:function(){return i.qL},callWithErrorHandling:function(){return i.gh},camelize:function(){return i.PT},capitalize:function(){return i.ZH},cloneVNode:function(){return i.E3},compatUtils:function(){return i.Y5},compile:function(){return r},computed:function(){return i.EW},createApp:function(){return i.Ef},createBlock:function(){return i.Wv},createCommentVNode:function(){return i.Q3},createElementBlock:function(){return i.CE},createElementVNode:function(){return i.Lk},createHydrationRenderer:function(){return i.ci},createPropsRestProxy:function(){return i.bn},createRenderer:function(){return i.K9},createSSRApp:function(){return i.m1},createSlots:function(){return i.eX},createStaticVNode:function(){return i.Fv},createTextVNode:function(){return i.eW},createVNode:function(){return i.bF},customRef:function(){return i.rY},defineAsyncComponent:function(){return i.$V},defineComponent:function(){return i.pM},defineCustomElement:function(){return i.Xq},defineEmits:function(){return i.qP},defineExpose:function(){return i.wk},defineModel:function(){return i.NP},defineOptions:function(){return i.GM},defineProps:function(){return i.Yj},defineSSRCustomElement:function(){return i.Po},defineSlots:function(){return i.Lu},devtools:function(){return i.lt},effect:function(){return i.QZ},effectScope:function(){return i.uY},getCurrentInstance:function(){return i.nI},getCurrentScope:function(){return i.o5},getTransitionRawChildren:function(){return i.Df},guardReactiveProps:function(){return i.Ng},h:function(){return i.h},handleError:function(){return i.H4},hasInjectionContext:function(){return i.PS},hydrate:function(){return i.Qv},initCustomFormatter:function(){return i.y$},initDirectivesForSSR:function(){return i.Ib},inject:function(){return i.WQ},isMemoSame:function(){return i.Bs},isProxy:function(){return i.ju},isReactive:function(){return i.g8},isReadonly:function(){return i.Tm},isRef:function(){return i.i9},isRuntimeOnly:function(){return i.dA},isShallow:function(){return i.fE},isVNode:function(){return i.vv},markRaw:function(){return i.IG},mergeDefaults:function(){return i.HF},mergeModels:function(){return i.zz},mergeProps:function(){return i.v6},nextTick:function(){return i.dY},normalizeClass:function(){return i.C4},normalizeProps:function(){return i._B},normalizeStyle:function(){return i.Tr},onActivated:function(){return i.n},onBeforeMount:function(){return i.KC},onBeforeUnmount:function(){return i.xo},onBeforeUpdate:function(){return i.Ic},onDeactivated:function(){return i.Y4},onErrorCaptured:function(){return i.qG},onMounted:function(){return i.sV},onRenderTracked:function(){return i.qR},onRenderTriggered:function(){return i.bj},onScopeDispose:function(){return i.jr},onServerPrefetch:function(){return i.SS},onUnmounted:function(){return i.hi},onUpdated:function(){return i.$u},openBlock:function(){return i.uX},popScopeId:function(){return i.jt},provide:function(){return i.Gt},proxyRefs:function(){return i.Pr},pushScopeId:function(){return i.Qi},queuePostFlushCb:function(){return i.Dl},reactive:function(){return i.Kh},readonly:function(){return i.tB},ref:function(){return i.KR},registerRuntimeCompiler:function(){return i.tC},render:function(){return i.XX},renderList:function(){return i.pI},renderSlot:function(){return i.RG},resolveComponent:function(){return i.g2},resolveDirective:function(){return i.gN},resolveDynamicComponent:function(){return i.$y},resolveFilter:function(){return i.LJ},resolveTransitionHooks:function(){return i.OW},setBlockTracking:function(){return i.Vq},setDevtoolsHook:function(){return i.iD},setTransitionHooks:function(){return i.MZ},shallowReactive:function(){return i.Gc},shallowReadonly:function(){return i.nD},shallowRef:function(){return i.IJ},ssrContextKey:function(){return i.Fw},ssrUtils:function(){return i.Gw},stop:function(){return i.ds},toDisplayString:function(){return i.v_},toHandlerKey:function(){return i.rU},toHandlers:function(){return i.Tb},toRaw:function(){return i.ux},toRef:function(){return i.lW},toRefs:function(){return i.QW},toValue:function(){return i.BA},transformVNodeArgs:function(){return i.gW},triggerRef:function(){return i.mu},unref:function(){return i.R1},useAttrs:function(){return i.OA},useCssModule:function(){return i.D},useCssVars:function(){return i.$9},useModel:function(){return i.fn},useSSRContext:function(){return i.LM},useSlots:function(){return i.Ht},useTransitionState:function(){return i.Gy},vModelCheckbox:function(){return i.lH},vModelDynamic:function(){return i.hp},vModelRadio:function(){return i.XL},vModelSelect:function(){return i.u1},vModelText:function(){return i.Jo},vShow:function(){return i.aG},version:function(){return i.rE},warn:function(){return i.R8},watch:function(){return i.wB},watchEffect:function(){return i.nT},watchPostEffect:function(){return i.p9},watchSyncEffect:function(){return i.U_},withAsyncContext:function(){return i.E},withCtx:function(){return i.k6},withDefaults:function(){return i.rO},withDirectives:function(){return i.bo},withKeys:function(){return i.jR},withMemo:function(){return i.bU},withModifiers:function(){return i.D$},withScopeId:function(){return i.YY}});var i=n(53751);
|