| In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Q=typeof window!="undefined"&&typeof window.document!="undefined",X=Q?window:{},Ct=Q&&X.document.documentElement?"ontouchstart"in X.document.documentElement:!1,Nt=Q?"PointerEvent"in X:!1,y="cropper",At="all",zt="crop",vt="move",kt="zoom",$="e",J="w",tt="s",U="n",rt="ne",ht="nw",B="se",ct="sw",C="".concat(y,"-crop"),I="".concat(y,"-disabled"),v="".concat(y,"-hidden"),R="".concat(y,"-hide"),et="".concat(y,"-invisible"),bt="".concat(y,"-modal"),wt="".concat(y,"-move"),lt="".concat(y,"Action"),ft="".concat(y,"Preview"),Rt="crop",St="move",_t="none",yt="crop",jt="cropend",Ut="cropmove",Vt="cropstart",te="dblclick",Me=Ct?"touchstart":"mousedown",Te=Ct?"touchmove":"mousemove",Oe=Ct?"touchend touchcancel":"mouseup",ee=Nt?"pointerdown":Me,ie=Nt?"pointermove":Te,ae=Nt?"pointerup pointercancel":Oe,re="ready",ne="resize",oe="wheel",Gt="zoom",se="image/jpeg",Ce=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Ne=/^data:/,Ae=/^data:image\/jpeg;base64,/,Re=/^img|canvas$/i,he=200,ce=100,le={viewMode:0,dragMode:Rt,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:he,minContainerHeight:ce,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Se='<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>',_e=Number.isNaN||X.isNaN;function p(a){return typeof a=="number"&&!_e(a)}var fe=function(t){return t>0&&t<1/0};function $t(a){return typeof a=="undefined"}function ut(a){return Ot(a)==="object"&&a!==null}var Ie=Object.prototype.hasOwnProperty;function xt(a){if(!ut(a))return!1;try{var t=a.constructor,i=t.prototype;return t&&i&&Ie.call(i,"isPrototypeOf")}catch(e){return!1}}function z(a){return typeof a=="function"}var Be=Array.prototype.slice;function ue(a){return Array.from?Array.from(a):Be.call(a)}function M(a,t){return a&&z(t)&&(Array.isArray(a)||p(a.length)?ue(a).forEach(function(i,e){t.call(a,i,e,a)}):ut(a)&&Object.keys(a).forEach(function(i){t.call(a,a[i],i,a)})),a}var D=Object.assign||function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),o=1;o<i;o++)e[o-1]=arguments[o];return ut(t)&&e.length>0&&e.forEach(function(r){ut(r)&&Object.keys(r).forEach(function(n){t[n]=r[n]})}),t},Pe=/\.\d*(?:0|9){12}\d*$/;function Dt(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Pe.test(a)?Math.round(a*t)/t:a}var Le=/^width|height|left|top|marginLeft|marginTop$/;function nt(a,t){var i=a.style;M(t,function(e,o){Le.test(o)&&p(e)&&(e="".concat(e,"px")),i[o]=e})}function ze(a,t){return a.classList?a.classList.contains(t):a.className.indexOf(t)>-1}function S(a,t){if(t){if(p(a.length)){M(a,function(e){S(e,t)});return}if(a.classList){a.classList.add(t);return}var i=a.className.trim();i?i.indexOf(t)<0&&(a.className="".concat(i," ").concat(t)):a.className=t}}function K(a,t){if(t){if(p(a.length)){M(a,function(i){K(i,t)});return}if(a.classList){a.classList.remove(t);return}a.className.indexOf(t)>=0&&(a.className=a.className.replace(t,""))}}function Et(a,t,i){if(t){if(p(a.length)){M(a,function(e){Et(e,t,i)});return}i?S(a,t):K(a,t)}}var ke=/([a-z\d])([A-Z])/g;function Kt(a){return a.replace(ke,"$1-$2").toLowerCase()}function qt(a,t){return ut(a[t])?a[t]:a.dataset?a.dataset[t]:a.getAttribute("data-".concat(Kt(t)))}function It(a,t,i){ut(i)?a[t]=i:a.dataset?a.dataset[t]=i:a.setAttribute("data-".concat(Kt(t)),i)}function Ye(a,t){if(ut(a[t]))try{delete a[t]}catch(i){a[t]=void 0}else if(a.dataset)try{delete a.dataset[t]}catch(i){a.dataset[t]=void 0}else a.removeAttribute("data-".concat(Kt(t)))}var de=/\s\s*/,pe=function(){var a=!1;if(Q){var t=!1,i=function(){},e=Object.defineProperty({},"once",{get:function(){return a=!0,t},set:function(r){t=r}});X.addEventListener("test",i,e),X.removeEventListener("test",i,e)}return a}();function V(a,t,i){var e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=i;t.trim().split(de).forEach(function(r){if(!pe){var n=a.listeners;n&&n[r]&&n[r][i]&&(o=n[r][i],delete n[r][i],Object.keys(n[r]).length===0&&delete n[r],Object.keys(n).length===0&&delete a.listeners)}a.removeEventListener(r,o,e)})}function W(a,t,i){var e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=i;t.trim().split(de).forEach(function(r){if(e.once&&!pe){var n=a.listeners,s=n===void 0?{}:n;o=function(){delete s[r][i],a.removeEventListener(r,o,e);for(var l=arguments.length,h=new Array(l),c=0;c<l;c++)h[c]=arguments[c];i.apply(a,h)},s[r]||(s[r]={}),s[r][i]&&a.removeEventListener(r,s[r][i],e),s[r][i]=o,a.listeners=s}a.addEventListener(r,o,e)})}function Mt(a,t,i){var e;return z(Event)&&z(CustomEvent)?e=new CustomEvent(t,{detail:i,bubbles:!0,cancelable:!0}):(e=document.createEvent("CustomEvent"),e.initCustomEvent(t,!0,!0,i)),a.dispatchEvent(e)}function ge(a){var t=a.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var Ft=X.location,Xe=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function me(a){var t=a.match(Xe);return t!==null&&(t[1]!==Ft.protocol||t[2]!==Ft.hostname||t[3]!==Ft.port)}function ve(a){var t="timestamp=".concat(new Date().getTime());return a+(a.indexOf("?")===-1?"?":"&")+t}function Bt(a){var t=a.rotate,i=a.scaleX,e=a.scaleY,o=a.translateX,r=a.translateY,n=[];p(o)&&o!==0&&n.push("translateX(".concat(o,"px)")),p(r)&&r!==0&&n.push("translateY(".concat(r,"px)")),p(t)&&t!==0&&n.push("rotate(".concat(t,"deg)")),p(i)&&i!==1&&n.push("scaleX(".concat(i,")")),p(e)&&e!==1&&n.push("scaleY(".concat(e,")"));var s=n.length?n.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function We(a){var t=F({},a),i=0;return M(a,function(e,o){delete t[o],M(t,function(r){var n=Math.abs(e.startX-r.startX),s=Math.abs(e.startY-r.startY),u=Math.abs(e.endX-r.endX),l=Math.abs(e.endY-r.endY),h=Math.sqrt(n*n+s*s),c=Math.sqrt(u*u+l*l),f=(c-h)/h;Math.abs(f)>Math.abs(i)&&(i=f)})}),i}function Yt(a,t){var i=a.pageX,e=a.pageY,o={endX:i,endY:e};return t?o:F({startX:i,startY:e},o)}function He(a){var t=0,i=0,e=0;return M(a,function(o){var r=o.startX,n=o.startY;t+=r,i+=n,e+=1}),t/=e,i/=e,{pageX:t,pageY:i}}function ot(a){var t=a.aspectRatio,i=a.height,e=a.width,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",r=fe(e),n=fe(i);if(r&&n){var s=i*t;o==="contain"&&s>e||o==="cover"&&s<e?i=e/t:e=i*t}else r?i=e/t:n&&(e=i*t);return{width:e,height:i}}function je(a){var t=a.width,i=a.height,e=a.degree;if(e=Math.abs(e)%180,e===90)return{width:i,height:t};var o=e%90*Math.PI/180,r=Math.sin(o),n=Math.cos(o),s=t*n+i*r,u=t*r+i*n;return e>90?{width:u,height:s}:{width:s,height:u}}function Ue(a,t,i,e){var o=t.aspectRatio,r=t.naturalWidth,n=t.naturalHeight,s=t.rotate,u=s===void 0?0:s,l=t.scaleX,h=l===void 0?1:l,c=t.scaleY,f=c===void 0?1:c,m=i.aspectRatio,g=i.naturalWidth,E=i.naturalHeight,b=e.fillColor,N=b===void 0?"transparent":b,_=e.imageSmoothingEnabled,T=_===void 0?!0:_,it=e.imageSmoothingQuality,Y=it===void 0?"low":it,d=e.maxWidth,w=d===void 0?1/0:d,A=e.maxHeight,H=A===void 0?1/0:A,at=e.minWidth,dt=at===void 0?0:at,pt=e.minHeight,st=pt===void 0?0:pt,q=document.createElement("canvas"),k=q.getContext("2d"),gt=ot({aspectRatio:m,width:w,height:H}),Xt=ot({aspectRatio:m,width:dt,height:st},"cover"),Zt=Math.min(gt.width,Math.max(Xt.width,g)),Qt=Math.min(gt.height,Math.max(Xt.height,E)),ye=ot({aspectRatio:o,width:w,height:H}),xe=ot({aspectRatio:o,width:dt,height:st},"cover"),De=Math.min(ye.width,Math.max(xe.width,r)),Ee=Math.min(ye.height,Math.max(xe.height,n)),ri=[-De/2,-Ee/2,De,Ee];return q.width=Dt(Zt),q.height=Dt(Qt),k.fillStyle=N,k.fillRect(0,0,Zt,Qt),k.save(),k.translate(Zt/2,Qt/2),k.rotate(u*Math.PI/180),k.scale(h,f),k.imageSmoothingEnabled=T,k.imageSmoothingQuality=Y,k.drawImage.apply(k,[a].concat(Lt(ri.map(function(ni){return Math.floor(Dt(ni))})))),k.restore(),q}var be=String.fromCharCode;function Ve(a,t,i){var e="";i+=t;for(var o=t;o<i;o+=1)e+=be(a.getUint8(o));return e}var Ge=/^data:.*,/;function $e(a){var t=a.replace(Ge,""),i=atob(t),e=new ArrayBuffer(i.length),o=new Uint8Array(e);return M(o,function(r,n){o[n]=i.charCodeAt(n)}),e}function Ke(a,t){for(var i=[],e=8192,o=new Uint8Array(a);o.length>0;)i.push(be.apply(null,ue(o.subarray(0,e)))),o=o.subarray(e);return"data:".concat(t,";base64,").concat(btoa(i.join("")))}function qe(a){var t=new DataView(a),i;try{var e,o,r;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var n=t.byteLength,s=2;s+1<n;){if(t.getUint8(s)===255&&t.getUint8(s+1)===225){o=s;break}s+=1}if(o){var u=o+4,l=o+10;if(Ve(t,u,4)==="Exif"){var h=t.getUint16(l);if(e=h===18761,(e||h===19789)&&t.getUint16(l+2,e)===42){var c=t.getUint32(l+4,e);c>=8&&(r=l+c)}}}if(r){var f=t.getUint16(r,e),m,g;for(g=0;g<f;g+=1)if(m=r+g*12+2,t.getUint16(m,e)===274){m+=8,i=t.getUint16(m,e),t.setUint16(m,1,e);break}}}catch(E){i=1}return i}function Fe(a){var t=0,i=1,e=1;switch(a){case 2:i=-1;break;case 3:t=-180;break;case 4:e=-1;break;case 5:t=90,e=-1;break;case 6:t=90;break;case 7:t=90,i=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:i,scaleY:e}}var Ze={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,i=this.options,e=this.container,o=this.cropper,r=Number(i.minContainerWidth),n=Number(i.minContainerHeight);S(o,v),K(t,v);var s={width:Math.max(e.offsetWidth,r>=0?r:he),height:Math.max(e.offsetHeight,n>=0?n:ce)};this.containerData=s,nt(o,{width:s.width,height:s.height}),S(t,v),K(o,v)},initCanvas:function(){var t=this.containerData,i=this.imageData,e=this.options.viewMode,o=Math.abs(i.rotate)%180===90,r=o?i.naturalHeight:i.naturalWidth,n=o?i.naturalWidth:i.naturalHeight,s=r/n,u=t.width,l=t.height;t.height*s>t.width?e===3?u=t.height*s:l=t.width/s:e===3?l=t.width/s:u=t.height*s;var h={aspectRatio:s,naturalWidth:r,naturalHeight:n,width:u,height:l};this.canvasData=h,this.limited=e===1||e===2,this.limitCanvas(!0,!0),h.width=Math.min(Math.max(h.width,h.minWidth),h.maxWidth),h.height=Math.min(Math.max(h.height,h.minHeight),h.maxHeight),h.left=(t.width-h.width)/2,h.top=(t.height-h.height)/2,h.oldLeft=h.left,h.oldTop=h.top,this.initialCanvasData=D({},h)},limitCanvas:function(t,i){var e=this.options,o=this.containerData,r=this.canvasData,n=this.cropBoxData,s=e.viewMode,u=r.aspectRatio,l=this.cropped&&n;if(t){var h=Number(e.minCanvasWidth)||0,c=Number(e.minCanvasHeight)||0;s>1?(h=Math.max(h,o.width),c=Math.max(c,o.height),s===3&&(c*u>h?h=c*u:c=h/u)):s>0&&(h?h=Math.max(h,l?n.width:0):c?c=Math.max(c,l?n.height:0):l&&(h=n.width,c=n.height,c*u>h?h=c*u:c=h/u));var f=ot({aspectRatio:u,width:h,height:c});h=f.width,c=f.height,r.minWidth=h,r.minHeight=c,r.maxWidth=1/0,r.maxHeight=1/0}if(i)if(s>(l?0:1)){var m=o.width-r.width,g=o.height-r.height;r.minLeft=Math.min(0,m),r.minTop=Math.min(0,g),r.maxLeft=Math.max(0,m),r.maxTop=Math.max(0,g),l&&this.limited&&(r.minLeft=Math.min(n.left,n.left+(n.width-r.width)),r.minTop=Math.min(n.top,n.top+(n.height-r.height)),r.maxLeft=n.left,r.maxTop=n.top,s===2&&(r.width>=o.width&&(r.minLeft=Math.min(0,m),r.maxLeft=Math.max(0,m)),r.height>=o.height&&(r.minTop=Math.min(0,g),r.maxTop=Math.max(0,g))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=o.width,r.maxTop=o.height},renderCanvas:function(t,i){var e=this.canvasData,o=this.imageData;if(i){var r=je({width:o.naturalWidth*Math.abs(o.scaleX||1),height:o.naturalHeight*Math.abs(o.scaleY||1),degree:o.rotate||0}),n=r.width,s=r.height,u=e.width*(n/e.naturalWidth),l=e.height*(s/e.naturalHeight);e.left-=(u-e.width)/2,e.top-=(l-e.height)/2,e.width=u,e.height=l,e.aspectRatio=n/s,e.naturalWidth=n,e.naturalHeight=s,this.limitCanvas(!0,!1)}(e.width>e.maxWidth||e.width<e.minWidth)&&(e.left=e.oldLeft),(e.height>e.maxHeight||e.height<e.minHeight)&&(e.top=e.oldTop),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),this.limitCanvas(!1,!0),e.left=Math.min(Math.max(e.left,e.minLeft),e.maxLeft),e.top=Math.min(Math.max(e.top,e.minTop),e.maxTop),e.oldLeft=e.left,e.oldTop=e.top,nt(this.canvas,D({width:e.width,height:e.height},Bt({translateX:e.left,translateY:e.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var i=this.canvasData,e=this.imageData,o=e.naturalWidth*(i.width/i.naturalWidth),r=e.naturalHeight*(i.height/i.naturalHeight);D(e,{width:o,height:r,left:(i.width-o)/2,top:(i.height-r)/2}),nt(this.image,D({width:e.width,height:e.height},Bt(D({translateX:e.left,translateY:e.top},e)))),t&&this.output()},initCropBox:function(){var t=this.options,i=this.canvasData,e=t.aspectRatio||t.initialAspectRatio,o=Number(t.autoCropArea)||.8,r={width:i.width,height:i.height};e&&(i.height*e>i.width?r.height=r.width/e:r.width=r.height*e),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*o),r.height=Math.max(r.minHeight,r.height*o),r.left=i.left+(i.width-r.width)/2,r.top=i.top+(i.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=D({},r)},limitCropBox:function(t,i){var e=this.options,o=this.containerData,r=this.canvasData,n=this.cropBoxData,s=this.limited,u=e.aspectRatio;if(t){var l=Number(e.minCropBoxWidth)||0,h=Number(e.minCropBoxHeight)||0,c=s?Math.min(o.width,r.width,r.width+r.left,o.width-r.left):o.width,f=s?Math.min(o.height,r.height,r.height+r.top,o.height-r.top):o.height;l=Math.min(l,o.width),h=Math.min(h,o.height),u&&(l&&h?h*u>l?h=l/u:l=h*u:l?h=l/u:h&&(l=h*u),f*u>c?f=c/u:c=f*u),n.minWidth=Math.min(l,c),n.minHeight=Math.min(h,f),n.maxWidth=c,n.maxHeight=f}i&&(s?(n.minLeft=Math.max(0,r.left),n.minTop=Math.max(0,r.top),n.maxLeft=Math.min(o.width,r.left+r.width)-n.width,n.maxTop=Math.min(o.height,r.top+r.height)-n.height):(n.minLeft=0,n.minTop=0,n.maxLeft=o.width-n.width,n.maxTop=o.height-n.height))},renderCropBox:function(){var t=this.options,i=this.containerData,e=this.cropBoxData;(e.width>e.maxWidth||e.width<e.minWidth)&&(e.left=e.oldLeft),(e.height>e.maxHeight||e.height<e.minHeight)&&(e.top=e.oldTop),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),this.limitCropBox(!1,!0),e.left=Math.min(Math.max(e.left,e.minLeft),e.maxLeft),e.top=Math.min(Math.max(e.top,e.minTop),e.maxTop),e.oldLeft=e.left,e.oldTop=e.top,t.movable&&t.cropBoxMovable&&It(this.face,lt,e.width>=i.width&&e.height>=i.height?vt:At),nt(this.cropBox,D({width:e.width,height:e.height},Bt({translateX:e.left,translateY:e.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Mt(this.element,yt,this.getData())}},Qe={initPreview:function(){var t=this.element,i=this.crossOrigin,e=this.options.preview,o=i?this.crossOriginUrl:this.url,r=t.alt||"The image to preview",n=document.createElement("img");if(i&&(n.crossOrigin=i),n.src=o,n.alt=r,this.viewBox.appendChild(n),this.viewBoxImage=n,!!e){var s=e;typeof e=="string"?s=t.ownerDocument.querySelectorAll(e):e.querySelector&&(s=[e]),this.previews=s,M(s,function(u){var l=document.createElement("img");It(u,ft,{width:u.offsetWidth,height:u.offsetHeight,html:u.innerHTML}),i&&(l.crossOrigin=i),l.src=o,l.alt=r,l.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;"',u.innerHTML="",u.appendChild(l)})}},resetPreview:function(){M(this.previews,function(t){var i=qt(t,ft);nt(t,{width:i.width,height:i.height}),t.innerHTML=i.html,Ye(t,ft)})},preview:function(){var t=this.imageData,i=this.canvasData,e=this.cropBoxData,o=e.width,r=e.height,n=t.width,s=t.height,u=e.left-i.left-t.left,l=e.top-i.top-t.top;!this.cropped||this.disabled||(nt(this.viewBoxImage,D({width:n,height:s},Bt(D({translateX:-u,translateY:-l},t)))),M(this.previews,function(h){var c=qt(h,ft),f=c.width,m=c.height,g=f,E=m,b=1;o&&(b=f/o,E=r*b),r&&E>m&&(b=m/r,g=o*b,E=m),nt(h,{width:g,height:E}),nt(h.getElementsByTagName("img")[0],D({width:n*b,height:s*b},Bt(D({translateX:-u*b,translateY:-l*b},t))))}))}},Je={bind:function(){var t=this.element,i=this.options,e=this.cropper;z(i.cropstart)&&W(t,Vt,i.cropstart),z(i.cropmove)&&W(t,Ut,i.cropmove),z(i.cropend)&&W(t,jt,i.cropend),z(i.crop)&&W(t,yt,i.crop),z(i.zoom)&&W(t,Gt,i.zoom),W(e,ee,this.onCropStart=this.cropStart.bind(this)),i.zoomable&&i.zoomOnWheel&&W(e,oe,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&W(e,te,this.onDblclick=this.dblclick.bind(this)),W(t.ownerDocument,ie,this.onCropMove=this.cropMove.bind(this)),W(t.ownerDocument,ae,this.onCropEnd=this.cropEnd.bind(this)),i.responsive&&W(window,ne,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,i=this.options,e=this.cropper;z(i.cropstart)&&V(t,Vt,i.cropstart),z(i.cropmove)&&V(t,Ut,i.cropmove),z(i.cropend)&&V(t,jt,i.cropend),z(i.crop)&&V(t,yt,i.crop),z(i.zoom)&&V(t,Gt,i.zoom),V(e,ee,this.onCropStart),i.zoomable&&i.zoomOnWheel&&V(e,oe,this.onWheel,{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&V(e,te,this.onDblclick),V(t.ownerDocument,ie,this.onCropMove),V(t.ownerDocument,ae,this.onCropEnd),i.responsive&&V(window,ne,this.onResize)}},ti={resize:function(){if(!this.disabled){var t=this.options,i=this.container,e=this.containerData,o=i.offsetWidth/e.width,r=i.offsetHeight/e.height,n=Math.abs(o-1)>Math.abs(r-1)?o:r;if(n!==1){var s,u;t.restore&&(s=this.getCanvasData(),u=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(M(s,function(l,h){s[h]=l*n})),this.setCropBoxData(M(u,function(l,h){u[h]=l*n})))}}},dblclick:function(){this.disabled||this.options.dragMode===_t||this.setDragMode(ze(this.dragBox,C)?St:Rt)},wheel:function(t){var i=this,e=Number(this.options.wheelZoomRatio)||.1,o=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50),t.deltaY?o=t.deltaY>0?1:-1:t.wheelDelta?o=-t.wheelDelta/120:t.detail&&(o=t.detail>0?1:-1),this.zoom(-o*e,t)))},cropStart:function(t){var i=t.buttons,e=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(p(i)&&i!==1||p(e)&&e!==0||t.ctrlKey))){var o=this.options,r=this.pointers,n;t.changedTouches?M(t.changedTouches,function(s){r[s.identifier]=Yt(s)}):r[t.pointerId||0]=Yt(t),Object.keys(r).length>1&&o.zoomable&&o.zoomOnTouch?n=kt:n=qt(t.target,lt),Ce.test(n)&&Mt(this.element,Vt,{originalEvent:t,action:n})!==!1&&(t.preventDefault(),this.action=n,this.cropping=!1,n===zt&&(this.cropping=!0,S(this.dragBox,bt)))}},cropMove:function(t){var i=this.action;if(!(this.disabled||!i)){var e=this.pointers;t.preventDefault(),Mt(this.element,Ut,{originalEvent:t,action:i})!==!1&&(t.changedTouches?M(t.changedTouches,function(o){D(e[o.identifier]||{},Yt(o,!0))}):D(e[t.pointerId||0]||{},Yt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var i=this.action,e=this.pointers;t.changedTouches?M(t.changedTouches,function(o){delete e[o.identifier]}):delete e[t.pointerId||0],i&&(t.preventDefault(),Object.keys(e).length||(this.action=""),this.cropping&&(this.cropping=!1,Et(this.dragBox,bt,this.cropped&&this.options.modal)),Mt(this.element,jt,{originalEvent:t,action:i}))}}},ei={change:function(t){var i=this.options,e=this.canvasData,o=this.containerData,r=this.cropBoxData,n=this.pointers,s=this.action,u=i.aspectRatio,l=r.left,h=r.top,c=r.width,f=r.height,m=l+c,g=h+f,E=0,b=0,N=o.width,_=o.height,T=!0,it;!u&&t.shiftKey&&(u=c&&f?c/f:1),this.limited&&(E=r.minLeft,b=r.minTop,N=E+Math.min(o.width,e.width,e.left+e.width),_=b+Math.min(o.height,e.height,e.top+e.height));var Y=n[Object.keys(n)[0]],d={x:Y.endX-Y.startX,y:Y.endY-Y.startY},w=function(H){switch(H){case $:m+d.x>N&&(d.x=N-m);break;case J:l+d.x<E&&(d.x=E-l);break;case U:h+d.y<b&&(d.y=b-h);break;case tt:g+d.y>_&&(d.y=_-g);break}};switch(s){case At:l+=d.x,h+=d.y;break;case $:if(d.x>=0&&(m>=N||u&&(h<=b||g>=_))){T=!1;break}w($),c+=d.x,c<0&&(s=J,c=-c,l-=c),u&&(f=c/u,h+=(r.height-f)/2);break;case U:if(d.y<=0&&(h<=b||u&&(l<=E||m>=N))){T=!1;break}w(U),f-=d.y,h+=d.y,f<0&&(s=tt,f=-f,h-=f),u&&(c=f*u,l+=(r.width-c)/2);break;case J:if(d.x<=0&&(l<=E||u&&(h<=b||g>=_))){T=!1;break}w(J),c-=d.x,l+=d.x,c<0&&(s=$,c=-c,l-=c),u&&(f=c/u,h+=(r.height-f)/2);break;case tt:if(d.y>=0&&(g>=_||u&&(l<=E||m>=N))){T=!1;break}w(tt),f+=d.y,f<0&&(s=U,f=-f,h-=f),u&&(c=f*u,l+=(r.width-c)/2);break;case rt:if(u){if(d.y<=0&&(h<=b||m>=N)){T=!1;break}w(U),f-=d.y,h+=d.y,c=f*u}else w(U),w($),d.x>=0?m<N?c+=d.x:d.y<=0&&h<=b&&(T=!1):c+=d.x,d.y<=0?h>b&&(f-=d.y,h+=d.y):(f-=d.y,h+=d.y);c<0&&f<0?(s=ct,f=-f,c=-c,h-=f,l-=c):c<0?(s=ht,c=-c,l-=c):f<0&&(s=B,f=-f,h-=f);break;case ht:if(u){if(d.y<=0&&(h<=b||l<=E)){T=!1;break}w(U),f-=d.y,h+=d.y,c=f*u,l+=r.width-c}else w(U),w(J),d.x<=0?l>E?(c-=d.x,l+=d.x):d.y<=0&&h<=b&&(T=!1):(c-=d.x,l+=d.x),d.y<=0?h>b&&(f-=d.y,h+=d.y):(f-=d.y,h+=d.y);c<0&&f<0?(s=B,f=-f,c=-c,h-=f,l-=c):c<0?(s=rt,c=-c,l-=c):f<0&&(s=ct,f=-f,h-=f);break;case ct:if(u){if(d.x<=0&&(l<=E||g>=_)){T=!1;break}w(J),c-=d.x,l+=d.x,f=c/u}else w(tt),w(J),d.x<=0?l>E?(c-=d.x,l+=d.x):d.y>=0&&g>=_&&(T=!1):(c-=d.x,l+=d.x),d.y>=0?g<_&&(f+=d.y):f+=d.y;c<0&&f<0?(s=rt,f=-f,c=-c,h-=f,l-=c):c<0?(s=B,c=-c,l-=c):f<0&&(s=ht,f=-f,h-=f);break;case B:if(u){if(d.x>=0&&(m>=N||g>=_)){T=!1;break}w($),c+=d.x,f=c/u}else w(tt),w($),d.x>=0?m<N?c+=d.x:d.y>=0&&g>=_&&(T=!1):c+=d.x,d.y>=0?g<_&&(f+=d.y):f+=d.y;c<0&&f<0?(s=ht,f=-f,c=-c,h-=f,l-=c):c<0?(s=ct,c=-c,l-=c):f<0&&(s=rt,f=-f,h-=f);break;case vt:this.move(d.x,d.y),T=!1;break;case kt:this.zoom(We(n),t),T=!1;break;case zt:if(!d.x||!d.y){T=!1;break}it=ge(this.cropper),l=Y.startX-it.left,h=Y.startY-it.top,c=r.minWidth,f=r.minHeight,d.x>0?s=d.y>0?B:rt:d.x<0&&(l-=c,s=d.y>0?ct:ht),d.y<0&&(h-=f),this.cropped||(K(this.cropBox,v),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}T&&(r.width=c,r.height=f,r.left=l,r.top=h,this.action=s,this.renderCropBox()),M(n,function(A){A.startX=A.endX,A.startY=A.endY})}},ii={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&S(this.dragBox,bt),K(this.cropBox,v),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=D({},this.initialImageData),this.canvasData=D({},this.initialCanvasData),this.cropBoxData=D({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(D(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),K(this.dragBox,bt),S(this.cropBox,v)),this},replace:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),i?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,M(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,K(this.cropper,I)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,S(this.cropper,I)),this},destroy:function(){var t=this.element;return t[y]?(t[y]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,e=this.canvasData,o=e.left,r=e.top;return this.moveTo($t(t)?t:o+Number(t),$t(i)?i:r+Number(i))},moveTo:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,e=this.canvasData,o=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.movable&&(p(t)&&(e.left=t,o=!0),p(i)&&(e.top=i,o=!0),o&&this.renderCanvas(!0)),this},zoom:function(t,i){var e=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(e.width*t/e.naturalWidth,null,i)},zoomTo:function(t,i,e){var o=this.options,r=this.canvasData,n=r.width,s=r.height,u=r.naturalWidth,l=r.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&o.zoomable){var h=u*t,c=l*t;if(Mt(this.element,Gt,{ratio:t,oldRatio:n/u,originalEvent:e})===!1)return this;if(e){var f=this.pointers,m=ge(this.cropper),g=f&&Object.keys(f).length?He(f):{pageX:e.pageX,pageY:e.pageY};r.left-=(h-n)*((g.pageX-m.left-r.left)/n),r.top-=(c-s)*((g.pageY-m.top-r.top)/s)}else xt(i)&&p(i.x)&&p(i.y)?(r.left-=(h-n)*((i.x-r.left)/n),r.top-=(c-s)*((i.y-r.top)/s)):(r.left-=(h-n)/2,r.top-=(c-s)/2);r.width=h,r.height=c,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),p(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var i=this.imageData.scaleY;return this.scale(t,p(i)?i:1)},scaleY:function(t){var i=this.imageData.scaleX;return this.scale(p(i)?i:1,t)},scale:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,e=this.imageData,o=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.scalable&&(p(t)&&(e.scaleX=t,o=!0),p(i)&&(e.scaleY=i,o=!0),o&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.options,e=this.imageData,o=this.canvasData,r=this.cropBoxData,n;if(this.ready&&this.cropped){n={x:r.left-o.left,y:r.top-o.top,width:r.width,height:r.height};var s=e.width/e.naturalWidth;if(M(n,function(h,c){n[c]=h/s}),t){var u=Math.round(n.y+n.height),l=Math.round(n.x+n.width);n.x=Math.round(n.x),n.y=Math.round(n.y),n.width=l-n.x,n.height=u-n.y}}else n={x:0,y:0,width:0,height:0};return i.rotatable&&(n.rotate=e.rotate||0),i.scalable&&(n.scaleX=e.scaleX||1,n.scaleY=e.scaleY||1),n},setData:function(t){var i=this.options,e=this.imageData,o=this.canvasData,r={};if(this.ready&&!this.disabled&&xt(t)){var n=!1;i.rotatable&&p(t.rotate)&&t.rotate!==e.rotate&&(e.rotate=t.rotate,n=!0),i.scalable&&(p(t.scaleX)&&t.scaleX!==e.scaleX&&(e.scaleX=t.scaleX,n=!0),p(t.scaleY)&&t.scaleY!==e.scaleY&&(e.scaleY=t.scaleY,n=!0)),n&&this.renderCanvas(!0,!0);var s=e.width/e.naturalWidth;p(t.x)&&(r.left=t.x*s+o.left),p(t.y)&&(r.top=t.y*s+o.top),p(t.width)&&(r.width=t.width*s),p(t.height)&&(r.height=t.height*s),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?D({},this.containerData):{}},getImageData:function(){return this.sized?D({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,i={};return this.ready&&M(["left","top","width","height","naturalWidth","naturalHeight"],function(e){i[e]=t[e]}),i},setCanvasData:function(t){var i=this.canvasData,e=i.aspectRatio;return this.ready&&!this.disabled&&xt(t)&&(p(t.left)&&(i.left=t.left),p(t.top)&&(i.top=t.top),p(t.width)?(i.width=t.width,i.height=t.width/e):p(t.height)&&(i.height=t.height,i.width=t.height*e),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,i;return this.ready&&this.cropped&&(i={left:t.left,top:t.top,width:t.width,height:t.height}),i||{}},setCropBoxData:function(t){var i=this.cropBoxData,e=this.options.aspectRatio,o,r;return this.ready&&this.cropped&&!this.disabled&&xt(t)&&(p(t.left)&&(i.left=t.left),p(t.top)&&(i.top=t.top),p(t.width)&&t.width!==i.width&&(o=!0,i.width=t.width),p(t.height)&&t.height!==i.height&&(r=!0,i.height=t.height),e&&(o?i.height=i.width/e:r&&(i.width=i.height*e)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var i=this.canvasData,e=Ue(this.image,this.imageData,i,t);if(!this.cropped)return e;var o=this.getData(t.rounded),r=o.x,n=o.y,s=o.width,u=o.height,l=e.width/Math.floor(i.naturalWidth);l!==1&&(r*=l,n*=l,s*=l,u*=l);var h=s/u,c=ot({aspectRatio:h,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),f=ot({aspectRatio:h,width:t.minWidth||0,height:t.minHeight||0},"cover"),m=ot({aspectRatio:h,width:t.width||(l!==1?e.width:s),height:t.height||(l!==1?e.height:u)}),g=m.width,E=m.height;g=Math.min(c.width,Math.max(f.width,g)),E=Math.min(c.height,Math.max(f.height,E));var b=document.createElement("canvas"),N=b.getContext("2d");b.width=Dt(g),b.height=Dt(E),N.fillStyle=t.fillColor||"transparent",N.fillRect(0,0,g,E);var _=t.imageSmoothingEnabled,T=_===void 0?!0:_,it=t.imageSmoothingQuality;N.imageSmoothingEnabled=T,it&&(N.imageSmoothingQuality=it);var Y=e.width,d=e.height,w=r,A=n,H,at,dt,pt,st,q;w<=-s||w>Y?(w=0,H=0,dt=0,st=0):w<=0?(dt=-w,w=0,H=Math.min(Y,s+w),st=H):w<=Y&&(dt=0,H=Math.min(s,Y-w),st=H),H<=0||A<=-u||A>d?(A=0,at=0,pt=0,q=0):A<=0?(pt=-A,A=0,at=Math.min(d,u+A),q=at):A<=d&&(pt=0,at=Math.min(u,d-A),q=at);var k=[w,A,H,at];if(st>0&&q>0){var gt=g/s;k.push(dt*gt,pt*gt,st*gt,q*gt)}return N.drawImage.apply(N,[e].concat(Lt(k.map(function(Xt){return Math.floor(Dt(Xt))})))),b},setAspectRatio:function(t){var i=this.options;return!this.disabled&&!$t(t)&&(i.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var i=this.options,e=this.dragBox,o=this.face;if(this.ready&&!this.disabled){var r=t===Rt,n=i.movable&&t===St;t=r||n?t:_t,i.dragMode=t,It(e,lt,t),Et(e,C,r),Et(e,wt,n),i.cropBoxMovable||(It(o,lt,t),Et(o,C,r),Et(o,wt,n))}return this}},ai=X.Cropper,we=function(){function a(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Z(this,a),!t||!Re.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=D({},le,xt(i)&&i),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 Wt(a,[{key:"init",value:function(){var i=this.element,e=i.tagName.toLowerCase(),o;if(!i[y]){if(i[y]=this,e==="img"){if(this.isImg=!0,o=i.getAttribute("src")||"",this.originalUrl=o,!o)return;o=i.src}else e==="canvas"&&window.HTMLCanvasElement&&(o=i.toDataURL());this.load(o)}}},{key:"load",value:function(i){var e=this;if(i){this.url=i,this.imageData={};var o=this.element,r=this.options;if(!r.rotatable&&!r.scalable&&(r.checkOrientation=!1),!r.checkOrientation||!window.ArrayBuffer){this.clone();return}if(Ne.test(i)){Ae.test(i)?this.read($e(i)):this.clone();return}var n=new XMLHttpRequest,s=this.clone.bind(this);this.reloading=!0,this.xhr=n,n.onabort=s,n.onerror=s,n.ontimeout=s,n.onprogress=function(){n.getResponseHeader("content-type")!==se&&n.abort()},n.onload=function(){e.read(n.response)},n.onloadend=function(){e.reloading=!1,e.xhr=null},r.checkCrossOrigin&&me(i)&&o.crossOrigin&&(i=ve(i)),n.open("GET",i,!0),n.responseType="arraybuffer",n.withCredentials=o.crossOrigin==="use-credentials",n.send()}}},{key:"read",value:function(i){var e=this.options,o=this.imageData,r=qe(i),n=0,s=1,u=1;if(r>1){this.url=Ke(i,se);var l=Fe(r);n=l.rotate,s=l.scaleX,u=l.scaleY}e.rotatable&&(o.rotate=n),e.scalable&&(o.scaleX=s,o.scaleY=u),this.clone()}},{key:"clone",value:function(){var i=this.element,e=this.url,o=i.crossOrigin,r=e;this.options.checkCrossOrigin&&me(e)&&(o||(o="anonymous"),r=ve(e)),this.crossOrigin=o,this.crossOriginUrl=r;var n=document.createElement("img");o&&(n.crossOrigin=o),n.src=r||e,n.alt=i.alt||"The image to crop",this.image=n,n.onload=this.start.bind(this),n.onerror=this.stop.bind(this),S(n,R),i.parentNode.insertBefore(n,i.nextSibling)}},{key:"start",value:function(){var i=this,e=this.image;e.onload=null,e.onerror=null,this.sizing=!0;var o=X.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(X.navigator.userAgent),r=function(l,h){D(i.imageData,{naturalWidth:l,naturalHeight:h,aspectRatio:l/h}),i.initialImageData=D({},i.imageData),i.sizing=!1,i.sized=!0,i.build()};if(e.naturalWidth&&!o){r(e.naturalWidth,e.naturalHeight);return}var n=document.createElement("img"),s=document.body||document.documentElement;this.sizingImage=n,n.onload=function(){r(n.width,n.height),o||s.removeChild(n)},n.src=e.src,o||(n.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;",s.appendChild(n))}},{key:"stop",value:function(){var i=this.image;i.onload=null,i.onerror=null,i.parentNode.removeChild(i),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var i=this.element,e=this.options,o=this.image,r=i.parentNode,n=document.createElement("div");n.innerHTML=Se;var s=n.querySelector(".".concat(y,"-container")),u=s.querySelector(".".concat(y,"-canvas")),l=s.querySelector(".".concat(y,"-drag-box")),h=s.querySelector(".".concat(y,"-crop-box")),c=h.querySelector(".".concat(y,"-face"));this.container=r,this.cropper=s,this.canvas=u,this.dragBox=l,this.cropBox=h,this.viewBox=s.querySelector(".".concat(y,"-view-box")),this.face=c,u.appendChild(o),S(i,v),r.insertBefore(s,i.nextSibling),K(o,R),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,S(h,v),e.guides||S(h.getElementsByClassName("".concat(y,"-dashed")),v),e.center||S(h.getElementsByClassName("".concat(y,"-center")),v),e.background&&S(s,"".concat(y,"-bg")),e.highlight||S(c,et),e.cropBoxMovable&&(S(c,wt),It(c,lt,At)),e.cropBoxResizable||(S(h.getElementsByClassName("".concat(y,"-line")),v),S(h.getElementsByClassName("".concat(y,"-point")),v)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),z(e.ready)&&W(i,re,e.ready,{once:!0}),Mt(i,re)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var i=this.cropper.parentNode;i&&i.removeChild(this.cropper),K(this.element,v)}}},{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=ai,a}},{key:"setDefaults",value:function(i){D(le,xt(i)&&i)}}])}();return D(we.prototype,Ze,Qe,Je,ti,ei,ii),we})},42016:function(Jt,Tt,F){"use strict";F.d(Tt,{f:function(){return Lt}});var j=F(67294),Pt=F(33129),Ot=F.n(Pt),Z=function(){return Z=Object.assign||function(P){for(var G,x=1,O=arguments.length;x<O;x++)for(var L in G=arguments[x])Object.prototype.hasOwnProperty.call(G,L)&&(P[L]=G[L]);return P},Z.apply(this,arguments)};function mt(P,G){var x={};for(var O in P)Object.prototype.hasOwnProperty.call(P,O)&&G.indexOf(O)<0&&(x[O]=P[O]);if(P!=null&&typeof Object.getOwnPropertySymbols=="function"){var L=0;for(O=Object.getOwnPropertySymbols(P);L<O.length;L++)G.indexOf(O[L])<0&&Object.prototype.propertyIsEnumerable.call(P,O[L])&&(x[O[L]]=P[O[L]])}return x}var Wt=["aspectRatio","autoCrop","autoCropArea","background","center","checkCrossOrigin","checkOrientation","cropBoxMovable","cropBoxResizable","data","dragMode","guides","highlight","initialAspectRatio","minCanvasHeight","minCanvasWidth","minContainerHeight","minContainerWidth","minCropBoxHeight","minCropBoxWidth","modal","movable","preview","responsive","restore","rotatable","scalable","toggleDragModeOnDblclick","viewMode","wheelZoomRatio","zoomOnTouch","zoomOnWheel","zoomable","cropstart","cropmove","cropend","crop","zoom","ready"],Ht={opacity:0,maxWidth:"100%"},Lt=j.forwardRef(function(P,G){var x=mt(P,[]),O=x.dragMode,L=O===void 0?"crop":O,Q=x.src,X=x.style,Ct=x.className,Nt=x.crossOrigin,y=x.scaleX,At=x.scaleY,zt=x.enable,vt=x.zoomTo,kt=x.rotateTo,$=x.alt,J=$===void 0?"picture":$,tt=x.ready,U=x.onInitialized,rt=mt(x,["dragMode","src","style","className","crossOrigin","scaleX","scaleY","enable","zoomTo","rotateTo","alt","ready","onInitialized"]),ht={scaleY:At,scaleX:y,enable:zt,zoomTo:vt,rotateTo:kt},B=function(){for(var C=[],I=0;I<arguments.length;I++)C[I]=arguments[I];var v=(0,j.useRef)(null);return j.useEffect(function(){C.forEach(function(R){R&&(typeof R=="function"?R(v.current):R.current=v.current)})},[C]),v}(G,(0,j.useRef)(null));(0,j.useEffect)(function(){var C;!((C=B.current)===null||C===void 0)&&C.cropper&&typeof vt=="number"&&B.current.cropper.zoomTo(vt)},[x.zoomTo]),(0,j.useEffect)(function(){var C;!((C=B.current)===null||C===void 0)&&C.cropper&&Q!==void 0&&B.current.cropper.reset().clear().replace(Q)},[Q]),(0,j.useEffect)(function(){if(B.current!==null){var C=new(Ot())(B.current,Z(Z({dragMode:L},rt),{ready:function(I){I.currentTarget!==null&&function(v,R){R===void 0&&(R={});var et=R.enable,bt=et===void 0||et,wt=R.scaleX,lt=wt===void 0?1:wt,ft=R.scaleY,Rt=ft===void 0?1:ft,St=R.zoomTo,_t=St===void 0?0:St,yt=R.rotateTo;bt?v.enable():v.disable(),v.scaleX(lt),v.scaleY(Rt),yt!==void 0&&v.rotateTo(yt),_t>0&&v.zoomTo(_t)}(I.currentTarget.cropper,ht),tt&&tt(I)}}));U&&U(C)}return function(){var I,v;(v=(I=B.current)===null||I===void 0?void 0:I.cropper)===null||v===void 0||v.destroy()}},[B]);var ct=function(C){return Wt.reduce(function(I,v){var R=I,et=v;return R[et],mt(R,[typeof et=="symbol"?et:et+""])},C)}(Z(Z({},rt),{crossOrigin:Nt,src:Q,alt:J}));return j.createElement("div",{style:X,className:Ct},j.createElement("img",Z({},ct,{style:Ht,ref:B})))})}}]); |