Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.130/page_editor/plugins/comments/components/AddCommentForm",["module","exports","require","frontend-js-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../app/contexts/StoreContext","../../../app/thunks/addFragmentComment","../../../core/hooks/useId","./CommentForm"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({fragmentEntryLinkId:e}){const[t,n]=(0,o.useState)(!1),s=(0,a.useDispatch)(),d=(0,f.useId)(),[i,p]=(0,o.useState)(!1),[l,m]=(0,o.useState)("");return o.default.createElement("div",{className:"page-editor__fragment-comment__form pt-2 px-3"},o.default.createElement(c.default,{id:d,loading:t,onCancelButtonClick:()=>{p(!1),m("")},onFormFocus:()=>{p(!0)},onSubmitButtonClick:()=>{n(!0),s((0,u.default)({body:l,fragmentEntryLinkId:e})).then((()=>{n(!1),p(!1),m("")})).catch((()=>{(0,r.openToast)({message:Liferay.Language.get("the-comment-could-not-be-saved"),type:"danger"}),n(!1)}))},onTextareaChange:e=>{e&&m(e)},showButtons:i,submitButtonLabel:Liferay.Language.get("comment"),textareaContent:l}))};var r=n("frontend-js-web"),o=(d(n("liferay!frontend-js-react-web$prop-types")),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react"))),a=n("../../../app/contexts/StoreContext"),u=d(n("../../../app/thunks/addFragmentComment")),f=n("../../../core/hooks/useId"),c=d(n("./CommentForm"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function d(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=AddCommentForm.js.map