import{aI as n,f4 as C,ao as o,aF as f,bU as s,bo as x}from"./app-k0jcl5PQ.js";import{u as j}from"./Bg9cG42T.chunk.js";p.defaultProps={popupSize:"lg"};function p(e){const r=n.useRef(null),[c,a]=n.useState(!1),l={viewMode:2,autoCropArea:1,cropstart:()=>a(!0),cropend:()=>a(!1)},t=C[e.imageType],{crop:u,showSpinner:m,imageLoaded:d}=j(r,e.src,g=>e.onClickCrop(g,e.closePopup),t==null?void 0:t.width,t==null?void 0:t.height,l);function i(){c||e.closePopup()}return o.jsxs(f,{title:"Crop and resize your image",closePopup:i,size:e.popupSize,children:[o.jsx("div",{className:"pb-3",children:o.jsx("img",{src:e.src,alt:e.alt,ref:r,className:"img img-fluid"})}),o.jsxs(s,{children:[o.jsx(s.Cancel,{onClick:i}),o.jsx(s.Submit,{onClick:u,text:"Crop",variant:"dark",showSpinner:m,disabled:!d})]})]})}const S={renderCropper(e){const r=x.createRoot(document.getElementById("dialog-region"));r.render(o.jsx(p,{...e,closePopup:()=>r.unmount()}))}};export{S as C};
//# sourceMappingURL=D7h2WwBF.chunk.js.map
