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