import{_ as N,a as f}from"./tslib-a1R-YvU1.js";import{a as m}from"./react-CXoDaX02.js";import{n as j}from"./normalize-wheel-DFC0jtAO.js";function H(s,i,t,e,o,r){r===void 0&&(r=0);var n=y(s,i,r),a=n.width,c=n.height,h=Math.min(a,t),p=Math.min(c,e);return h>p*o?{width:p*o,height:p}:{width:h,height:h/o}}function k(s){return s.width>s.height?s.width/s.naturalWidth:s.height/s.naturalHeight}function R(s,i,t,e,o){o===void 0&&(o=0);var r=y(i.width,i.height,o),n=r.width,a=r.height;return{x:M(s.x,n,t.width,e),y:M(s.y,a,t.height,e)}}function M(s,i,t,e){var o=Math.abs(i*e/2-t/2);return b(s,-o,o)}function A(s,i){return Math.sqrt(Math.pow(s.y-i.y,2)+Math.pow(s.x-i.x,2))}function W(s,i){return Math.atan2(i.y-s.y,i.x-s.x)*180/Math.PI}function B(s,i,t,e,o,r,n){r===void 0&&(r=0),n===void 0&&(n=!0);var a=n?G:U,c=y(i.width,i.height,r),h=y(i.naturalWidth,i.naturalHeight,r),p={x:a(100,((c.width-t.width/o)/2-s.x/o)/c.width*100),y:a(100,((c.height-t.height/o)/2-s.y/o)/c.height*100),width:a(100,t.width/c.width*100/o),height:a(100,t.height/c.height*100/o)},d=Math.round(a(h.width,p.width*h.width/100)),u=Math.round(a(h.height,p.height*h.height/100)),l=h.width>=h.height*e,v=l?{width:Math.round(u*e),height:u}:{width:d,height:Math.round(d/e)},g=f(f({},v),{x:Math.round(a(h.width-v.width,p.x*h.width/100)),y:Math.round(a(h.height-v.height,p.y*h.height/100))});return{croppedAreaPercentages:p,croppedAreaPixels:g}}function G(s,i){return Math.min(s,Math.max(0,i))}function U(s,i){return i}function V(s,i,t,e,o,r){var n=y(i.width,i.height,t),a=b(e.width/n.width*(100/s.width),o,r),c={x:a*n.width/2-e.width/2-n.width*a*(s.x/100),y:a*n.height/2-e.height/2-n.height*a*(s.y/100)};return{crop:c,zoom:a}}function K(s,i,t){var e=k(i);return t.height>t.width?t.height/(s.height*e):t.width/(s.width*e)}function q(s,i,t,e,o,r){t===void 0&&(t=0);var n=y(i.naturalWidth,i.naturalHeight,t),a=b(K(s,i,e),o,r),c=e.height>e.width?e.height/s.height:e.width/s.width,h={x:((n.width-s.width)/2-s.x)*c,y:((n.height-s.height)/2-s.y)*c};return{crop:h,zoom:a}}function T(s,i){return{x:(i.x+s.x)/2,y:(i.y+s.y)/2}}function Y(s){return s*Math.PI/180}function y(s,i,t){var e=Y(t);return{width:Math.abs(Math.cos(e)*s)+Math.abs(Math.sin(e)*i),height:Math.abs(Math.sin(e)*s)+Math.abs(Math.cos(e)*i)}}function b(s,i,t){return Math.min(Math.max(s,i),t)}function S(){for(var s=[],i=0;i<arguments.length;i++)s[i]=arguments[i];return s.filter(function(t){return typeof t=="string"&&t.length>0}).join(" ").trim()}var J=`.reactEasyCrop_Container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: move;
  display: flex;
  justify-content: center;
  align-items: center;
}

.reactEasyCrop_Image,
.reactEasyCrop_Video {
  will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */
}

.reactEasyCrop_Contain {
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}
.reactEasyCrop_Cover_Horizontal {
  width: 100%;
  height: auto;
}
.reactEasyCrop_Cover_Vertical {
  width: auto;
  height: 100%;
}

.reactEasyCrop_CropArea {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-sizing: border-box;
  box-shadow: 0 0 0 9999em;
  color: rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.reactEasyCrop_CropAreaRound {
  border-radius: 50%;
}

.reactEasyCrop_CropAreaGrid::before {
  content: ' ';
  box-sizing: border-box;
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.5);
  top: 0;
  bottom: 0;
  left: 33.33%;
  right: 33.33%;
  border-top: 0;
  border-bottom: 0;
}

.reactEasyCrop_CropAreaGrid::after {
  content: ' ';
  box-sizing: border-box;
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.5);
  top: 33.33%;
  bottom: 33.33%;
  left: 0;
  right: 0;
  border-left: 0;
  border-right: 0;
}
`,X=1,Q=3,$=1,rt=(function(s){N(i,s);function i(){var t=s!==null&&s.apply(this,arguments)||this;return t.cropperRef=m.createRef(),t.imageRef=m.createRef(),t.videoRef=m.createRef(),t.containerPosition={x:0,y:0},t.containerRef=null,t.styleRef=null,t.containerRect=null,t.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},t.dragStartPosition={x:0,y:0},t.dragStartCrop={x:0,y:0},t.gestureZoomStart=0,t.gestureRotationStart=0,t.isTouching=!1,t.lastPinchDistance=0,t.lastPinchRotation=0,t.rafDragTimeout=null,t.rafPinchTimeout=null,t.wheelTimer=null,t.currentDoc=typeof document<"u"?document:null,t.currentWindow=typeof window<"u"?window:null,t.resizeObserver=null,t.previousCropSize=null,t.isInitialized=!1,t.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},t.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!t.containerRef)){var e=!0;t.resizeObserver=new window.ResizeObserver(function(o){if(e){e=!1;return}t.computeSizes()}),t.resizeObserver.observe(t.containerRef)}},t.preventZoomSafari=function(e){return e.preventDefault()},t.cleanEvents=function(){t.currentDoc&&(t.currentDoc.removeEventListener("mousemove",t.onMouseMove),t.currentDoc.removeEventListener("mouseup",t.onDragStopped),t.currentDoc.removeEventListener("touchmove",t.onTouchMove),t.currentDoc.removeEventListener("touchend",t.onDragStopped),t.currentDoc.removeEventListener("gesturechange",t.onGestureChange),t.currentDoc.removeEventListener("gestureend",t.onGestureEnd),t.currentDoc.removeEventListener("scroll",t.onScroll))},t.clearScrollEvent=function(){t.containerRef&&t.containerRef.removeEventListener("wheel",t.onWheel),t.wheelTimer&&clearTimeout(t.wheelTimer)},t.onMediaLoad=function(){var e=t.computeSizes();e&&(t.previousCropSize=e,t.emitCropData(),t.setInitialCrop(e),t.isInitialized=!0),t.props.onMediaLoaded&&t.props.onMediaLoaded(t.mediaSize)},t.setInitialCrop=function(e){if(t.props.initialCroppedAreaPercentages){var o=V(t.props.initialCroppedAreaPercentages,t.mediaSize,t.props.rotation,e,t.props.minZoom,t.props.maxZoom),r=o.crop,n=o.zoom;t.props.onCropChange(r),t.props.onZoomChange&&t.props.onZoomChange(n)}else if(t.props.initialCroppedAreaPixels){var a=q(t.props.initialCroppedAreaPixels,t.mediaSize,t.props.rotation,e,t.props.minZoom,t.props.maxZoom),r=a.crop,n=a.zoom;t.props.onCropChange(r),t.props.onZoomChange&&t.props.onZoomChange(n)}},t.computeSizes=function(){var e,o,r,n,a,c,h=t.imageRef.current||t.videoRef.current;if(h&&t.containerRef){t.containerRect=t.containerRef.getBoundingClientRect(),t.saveContainerPosition();var p=t.containerRect.width/t.containerRect.height,d=((e=t.imageRef.current)===null||e===void 0?void 0:e.naturalWidth)||((o=t.videoRef.current)===null||o===void 0?void 0:o.videoWidth)||0,u=((r=t.imageRef.current)===null||r===void 0?void 0:r.naturalHeight)||((n=t.videoRef.current)===null||n===void 0?void 0:n.videoHeight)||0,l=h.offsetWidth<d||h.offsetHeight<u,v=d/u,g=void 0;if(l)switch(t.state.mediaObjectFit){default:case"contain":g=p>v?{width:t.containerRect.height*v,height:t.containerRect.height}:{width:t.containerRect.width,height:t.containerRect.width/v};break;case"horizontal-cover":g={width:t.containerRect.width,height:t.containerRect.width/v};break;case"vertical-cover":g={width:t.containerRect.height*v,height:t.containerRect.height};break}else g={width:h.offsetWidth,height:h.offsetHeight};t.mediaSize=f(f({},g),{naturalWidth:d,naturalHeight:u}),t.props.setMediaSize&&t.props.setMediaSize(t.mediaSize);var C=t.props.cropSize?t.props.cropSize:H(t.mediaSize.width,t.mediaSize.height,t.containerRect.width,t.containerRect.height,t.props.aspect,t.props.rotation);return(((a=t.state.cropSize)===null||a===void 0?void 0:a.height)!==C.height||((c=t.state.cropSize)===null||c===void 0?void 0:c.width)!==C.width)&&t.props.onCropSizeChange&&t.props.onCropSizeChange(C),t.setState({cropSize:C},t.recomputeCropPosition),t.props.setCropSize&&t.props.setCropSize(C),C}},t.saveContainerPosition=function(){if(t.containerRef){var e=t.containerRef.getBoundingClientRect();t.containerPosition={x:e.left,y:e.top}}},t.onMouseDown=function(e){t.currentDoc&&(e.preventDefault(),t.currentDoc.addEventListener("mousemove",t.onMouseMove),t.currentDoc.addEventListener("mouseup",t.onDragStopped),t.saveContainerPosition(),t.onDragStart(i.getMousePoint(e)))},t.onMouseMove=function(e){return t.onDrag(i.getMousePoint(e))},t.onScroll=function(e){t.currentDoc&&(e.preventDefault(),t.saveContainerPosition())},t.onTouchStart=function(e){t.currentDoc&&(t.isTouching=!0,!(t.props.onTouchRequest&&!t.props.onTouchRequest(e))&&(t.currentDoc.addEventListener("touchmove",t.onTouchMove,{passive:!1}),t.currentDoc.addEventListener("touchend",t.onDragStopped),t.saveContainerPosition(),e.touches.length===2?t.onPinchStart(e):e.touches.length===1&&t.onDragStart(i.getTouchPoint(e.touches[0]))))},t.onTouchMove=function(e){e.preventDefault(),e.touches.length===2?t.onPinchMove(e):e.touches.length===1&&t.onDrag(i.getTouchPoint(e.touches[0]))},t.onGestureStart=function(e){t.currentDoc&&(e.preventDefault(),t.currentDoc.addEventListener("gesturechange",t.onGestureChange),t.currentDoc.addEventListener("gestureend",t.onGestureEnd),t.gestureZoomStart=t.props.zoom,t.gestureRotationStart=t.props.rotation)},t.onGestureChange=function(e){if(e.preventDefault(),!t.isTouching){var o=i.getMousePoint(e),r=t.gestureZoomStart-1+e.scale;if(t.setNewZoom(r,o,{shouldUpdatePosition:!0}),t.props.onRotationChange){var n=t.gestureRotationStart+e.rotation;t.props.onRotationChange(n)}}},t.onGestureEnd=function(e){t.cleanEvents()},t.onDragStart=function(e){var o,r,n=e.x,a=e.y;t.dragStartPosition={x:n,y:a},t.dragStartCrop=f({},t.props.crop),(r=(o=t.props).onInteractionStart)===null||r===void 0||r.call(o)},t.onDrag=function(e){var o=e.x,r=e.y;t.currentWindow&&(t.rafDragTimeout&&t.currentWindow.cancelAnimationFrame(t.rafDragTimeout),t.rafDragTimeout=t.currentWindow.requestAnimationFrame(function(){if(t.state.cropSize&&!(o===void 0||r===void 0)){var n=o-t.dragStartPosition.x,a=r-t.dragStartPosition.y,c={x:t.dragStartCrop.x+n,y:t.dragStartCrop.y+a},h=t.props.restrictPosition?R(c,t.mediaSize,t.state.cropSize,t.props.zoom,t.props.rotation):c;t.props.onCropChange(h)}}))},t.onDragStopped=function(){var e,o;t.isTouching=!1,t.cleanEvents(),t.emitCropData(),(o=(e=t.props).onInteractionEnd)===null||o===void 0||o.call(e)},t.onWheel=function(e){if(t.currentWindow&&!(t.props.onWheelRequest&&!t.props.onWheelRequest(e))){e.preventDefault();var o=i.getMousePoint(e),r=j(e).pixelY,n=t.props.zoom-r*t.props.zoomSpeed/200;t.setNewZoom(n,o,{shouldUpdatePosition:!0}),t.state.hasWheelJustStarted||t.setState({hasWheelJustStarted:!0},function(){var a,c;return(c=(a=t.props).onInteractionStart)===null||c===void 0?void 0:c.call(a)}),t.wheelTimer&&clearTimeout(t.wheelTimer),t.wheelTimer=t.currentWindow.setTimeout(function(){return t.setState({hasWheelJustStarted:!1},function(){var a,c;return(c=(a=t.props).onInteractionEnd)===null||c===void 0?void 0:c.call(a)})},250)}},t.getPointOnContainer=function(e,o){var r=e.x,n=e.y;if(!t.containerRect)throw new Error("The Cropper is not mounted");return{x:t.containerRect.width/2-(r-o.x),y:t.containerRect.height/2-(n-o.y)}},t.getPointOnMedia=function(e){var o=e.x,r=e.y,n=t.props,a=n.crop,c=n.zoom;return{x:(o+a.x)/c,y:(r+a.y)/c}},t.setNewZoom=function(e,o,r){var n=r===void 0?{}:r,a=n.shouldUpdatePosition,c=a===void 0?!0:a;if(!(!t.state.cropSize||!t.props.onZoomChange)){var h=b(e,t.props.minZoom,t.props.maxZoom);if(c){var p=t.getPointOnContainer(o,t.containerPosition),d=t.getPointOnMedia(p),u={x:d.x*h-p.x,y:d.y*h-p.y},l=t.props.restrictPosition?R(u,t.mediaSize,t.state.cropSize,h,t.props.rotation):u;t.props.onCropChange(l)}t.props.onZoomChange(h)}},t.getCropData=function(){if(!t.state.cropSize)return null;var e=t.props.restrictPosition?R(t.props.crop,t.mediaSize,t.state.cropSize,t.props.zoom,t.props.rotation):t.props.crop;return B(e,t.mediaSize,t.state.cropSize,t.getAspect(),t.props.zoom,t.props.rotation,t.props.restrictPosition)},t.emitCropData=function(){var e=t.getCropData();if(e){var o=e.croppedAreaPercentages,r=e.croppedAreaPixels;t.props.onCropComplete&&t.props.onCropComplete(o,r),t.props.onCropAreaChange&&t.props.onCropAreaChange(o,r)}},t.emitCropAreaChange=function(){var e=t.getCropData();if(e){var o=e.croppedAreaPercentages,r=e.croppedAreaPixels;t.props.onCropAreaChange&&t.props.onCropAreaChange(o,r)}},t.recomputeCropPosition=function(){var e,o;if(t.state.cropSize){var r=t.props.crop;if(t.isInitialized&&(!((e=t.previousCropSize)===null||e===void 0)&&e.width)&&(!((o=t.previousCropSize)===null||o===void 0)&&o.height)){var n=Math.abs(t.previousCropSize.width-t.state.cropSize.width)>1e-6||Math.abs(t.previousCropSize.height-t.state.cropSize.height)>1e-6;if(n){var a=t.state.cropSize.width/t.previousCropSize.width,c=t.state.cropSize.height/t.previousCropSize.height;r={x:t.props.crop.x*a,y:t.props.crop.y*c}}}var h=t.props.restrictPosition?R(r,t.mediaSize,t.state.cropSize,t.props.zoom,t.props.rotation):r;t.previousCropSize=t.state.cropSize,t.props.onCropChange(h),t.emitCropData()}},t.onKeyDown=function(e){var o,r,n=t.props,a=n.crop,c=n.onCropChange,h=n.keyboardStep,p=n.zoom,d=n.rotation,u=h;if(t.state.cropSize){e.shiftKey&&(u*=.2);var l=f({},a);switch(e.key){case"ArrowUp":l.y-=u,e.preventDefault();break;case"ArrowDown":l.y+=u,e.preventDefault();break;case"ArrowLeft":l.x-=u,e.preventDefault();break;case"ArrowRight":l.x+=u,e.preventDefault();break;default:return}t.props.restrictPosition&&(l=R(l,t.mediaSize,t.state.cropSize,p,d)),e.repeat||(r=(o=t.props).onInteractionStart)===null||r===void 0||r.call(o),c(l)}},t.onKeyUp=function(e){var o,r;switch(e.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":e.preventDefault();break;default:return}t.emitCropData(),(r=(o=t.props).onInteractionEnd)===null||r===void 0||r.call(o)},t}return i.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=J,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},i.prototype.componentWillUnmount=function(){var t,e;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((e=this.styleRef.parentNode)===null||e===void 0||e.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},i.prototype.componentDidUpdate=function(t){var e,o,r,n,a,c,h,p,d;t.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):t.aspect!==this.props.aspect?this.computeSizes():t.objectFit!==this.props.objectFit?this.computeSizes():t.zoom!==this.props.zoom?this.recomputeCropPosition():((e=t.cropSize)===null||e===void 0?void 0:e.height)!==((o=this.props.cropSize)===null||o===void 0?void 0:o.height)||((r=t.cropSize)===null||r===void 0?void 0:r.width)!==((n=this.props.cropSize)===null||n===void 0?void 0:n.width)?this.computeSizes():(((a=t.crop)===null||a===void 0?void 0:a.x)!==((c=this.props.crop)===null||c===void 0?void 0:c.x)||((h=t.crop)===null||h===void 0?void 0:h.y)!==((p=this.props.crop)===null||p===void 0?void 0:p.y))&&this.emitCropAreaChange(),t.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),t.video!==this.props.video&&((d=this.videoRef.current)===null||d===void 0||d.load());var u=this.getObjectFit();u!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:u},this.computeSizes)},i.prototype.getAspect=function(){var t=this.props,e=t.cropSize,o=t.aspect;return e?e.width/e.height:o},i.prototype.getObjectFit=function(){var t,e,o,r;if(this.props.objectFit==="cover"){var n=this.imageRef.current||this.videoRef.current;if(n&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var a=this.containerRect.width/this.containerRect.height,c=((t=this.imageRef.current)===null||t===void 0?void 0:t.naturalWidth)||((e=this.videoRef.current)===null||e===void 0?void 0:e.videoWidth)||0,h=((o=this.imageRef.current)===null||o===void 0?void 0:o.naturalHeight)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoHeight)||0,p=c/h;return p<a?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},i.prototype.onPinchStart=function(t){var e=i.getTouchPoint(t.touches[0]),o=i.getTouchPoint(t.touches[1]);this.lastPinchDistance=A(e,o),this.lastPinchRotation=W(e,o),this.onDragStart(T(e,o))},i.prototype.onPinchMove=function(t){var e=this;if(!(!this.currentDoc||!this.currentWindow)){var o=i.getTouchPoint(t.touches[0]),r=i.getTouchPoint(t.touches[1]),n=T(o,r);this.onDrag(n),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var a=A(o,r),c=e.props.zoom*(a/e.lastPinchDistance);e.setNewZoom(c,n,{shouldUpdatePosition:!1}),e.lastPinchDistance=a;var h=W(o,r),p=e.props.rotation+(h-e.lastPinchRotation);e.props.onRotationChange&&e.props.onRotationChange(p),e.lastPinchRotation=h})}},i.prototype.render=function(){var t=this,e,o=this.props,r=o.image,n=o.video,a=o.mediaProps,c=o.cropperProps,h=o.transform,p=o.crop,d=p.x,u=p.y,l=o.rotation,v=o.zoom,g=o.cropShape,C=o.showGrid,P=o.roundCropAreaPixels,z=o.style,Z=z.containerStyle,L=z.cropAreaStyle,_=z.mediaStyle,x=o.classes,O=x.containerClassName,I=x.cropAreaClassName,E=x.mediaClassName,w=(e=this.state.mediaObjectFit)!==null&&e!==void 0?e:this.getObjectFit();return m.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(F){return t.containerRef=F},"data-testid":"container",style:Z,className:S("reactEasyCrop_Container",O)},r?m.createElement("img",f({alt:"",className:S("reactEasyCrop_Image",w==="contain"&&"reactEasyCrop_Contain",w==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",w==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E)},a,{src:r,ref:this.imageRef,style:f(f({},_),{transform:h||"translate(".concat(d,"px, ").concat(u,"px) rotate(").concat(l,"deg) scale(").concat(v,")")}),onLoad:this.onMediaLoad})):n&&m.createElement("video",f({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:S("reactEasyCrop_Video",w==="contain"&&"reactEasyCrop_Contain",w==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",w==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E)},a,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:f(f({},_),{transform:h||"translate(".concat(d,"px, ").concat(u,"px) rotate(").concat(l,"deg) scale(").concat(v,")")}),controls:!1}),(Array.isArray(n)?n:[{src:n}]).map(function(D){return m.createElement("source",f({key:D.src},D))})),this.state.cropSize&&m.createElement("div",f({ref:this.cropperRef,style:f(f({},L),{width:P?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:P?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:S("reactEasyCrop_CropArea",g==="round"&&"reactEasyCrop_CropAreaRound",C&&"reactEasyCrop_CropAreaGrid",I)},c)))},i.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:Q,minZoom:X,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:$},i.getMousePoint=function(t){return{x:Number(t.clientX),y:Number(t.clientY)}},i.getTouchPoint=function(t){return{x:Number(t.clientX),y:Number(t.clientY)}},i})(m.Component);export{rt as C};
