import{aP as x,aT as t,dX as I,j as o,E as S,dY as D,dZ as r,aQ as E}from"./app-BgLa5dit.js";function w(e){var i,n;const u=x(),{getDataUrlAndResetContext:c,setImage:m}=t.useContext(I),[a,g]=t.useState(),[p,s]=t.useState(!1),[d,h]=t.useState(!1);function l(f){E(u,e.getRequest(e.imageType,f,m,e.closePopup))}function C(){p||e.closePopup()}return t.useEffect(()=>g(c()),[]),o.jsx(S,{title:"Crop Image",size:e.popupSize,closePopup:C,onEntered:()=>h(!0),children:d&&a&&o.jsx(D,{dataUrl:a,minWidth:((i=e.overrideDimensions)==null?void 0:i.width)??r[e.imageType].width,minHeight:((n=e.overrideDimensions)==null?void 0:n.height)??r[e.imageType].height,onCrop:l,onCancel:e.closePopup,submitVariant:e.submitVariant,onCropStart:()=>s(!0),onCropEnd:()=>s(!1)})})}export{w as ImageUploadView};
//# sourceMappingURL=zHqMr6SC.chunk.js.map
