Liferay.Loader.define("document-library-web@6.0.75/document_library/js/image-editor/EditImageWithImageEditor",["module","exports","require","@frontend-taglib-clay$clayui/modal","frontend-js-web","item-selector-taglib","liferay!frontend-js-react-web$react"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({editImageURL:e,portletNamespace:t,redirectURL:r}){const l=(0,i.useRef)(),[u,d]=(0,i.useState)(),[c,f]=(0,i.useState)(),{observer:s,onClose:m}=(0,a.useModal)({onClose:()=>{f(!1)}});return(0,i.useEffect)((()=>(window["".concat(t,"editWithImageEditor")]=({fileEntryId:e,imageURL:t})=>{l.current=e,d(t),f(!0)},()=>{window["".concat(t,"editWithImageEditor")]=()=>{}})),[t]),i.default.createElement(i.default.Fragment,null,c&&i.default.createElement(a.default,{className:"image-editor-modal",observer:s,size:"full-screen"},i.default.createElement(a.default.Header,null,Liferay.Language.get("editing-image")),i.default.createElement(a.default.Body,null,u&&i.default.createElement(o.ImageEditor,{imageId:l.current,imageSrc:u,onCancel:m,onSave:e=>{(null==e?void 0:e.success)&&(0,n.navigate)(r)},saveURL:e}))))};var a=u(r("@frontend-taglib-clay$clayui/modal")),n=r("frontend-js-web"),o=r("item-selector-taglib"),i=u(r("liferay!frontend-js-react-web$react"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=a?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}}}));
//# sourceMappingURL=EditImageWithImageEditor.js.map