1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5447],{63542:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return v}});var o=n(85893),s=n(58723),m=n(55764),i=n(12930),a=n(67294),r=n(85852),u=n(24986),d=n(66165),c=n.n(d),l=n(32998),C=n(95271);function v(e){var t,n;let{parentCommentId:d,postId:v,defaultValue:p="",onCancel:_=()=>{},isEdit:f,commentToEditId:h}=e,[E,I]=(0,a.useState)(""),R=u.S.comment.createComment.useMutation(),g=u.S.comment.edit.useMutation(),x=u.S.useUtils(),{data:S}=u.S.me.getMe.useQuery(),M=(0,a.useRef)(null),y=f?"Edit comment":d?"Reply...":"Leave a comment",D=f?"Save":d?"Reply":"Comment";return(0,o.jsxs)("div",{className:c().CommentInput,children:[(0,o.jsx)(s.Z,{name:null!==(n=null==S?void 0:S.me.username)&&void 0!==n?n:"S",src:null==S?void 0:null===(t=S.me.avatar)||void 0===t?void 0:t.url,size:d||f?C.uJ:C.ZJ}),(0,o.jsxs)("div",{className:c().editor,children:[(0,o.jsx)(r.default,{setText:I,placeholder:y,defaultValue:p,editorRef:M}),(0,o.jsxs)("div",{className:c().buttons,children:[(0,o.jsx)(i.ZP,{loading:R.isLoading||g.isLoading,type:"primary",disabled:!E.length,onClick:h?()=>{h&&g.mutate({commentId:h,markdownBody:E},{onSuccess(){m.ZP.success("Edits saved"),x.comment.getComments.invalidate(),M.current.dispatchCommand(l.CLEAR_EDITOR_COMMAND,void 0),_()},onError(e){m.ZP.error(e.message)}})}:()=>{R.mutate({parentCommentId:d,postId:v,commentText:E},{onSuccess(){m.ZP.success(d?"Replied":"Commented"),x.comment.getComments.invalidate(),M.current.dispatchCommand(l.CLEAR_EDITOR_COMMAND,void 0),_()},onError(e){m.ZP.error(e.message)}})},children:D}),(d||f)&&(0,o.jsx)(i.ZP,{onClick:()=>{if(E){if(!window.confirm(p?"Discard your changes?":"Discard your comment?"))return;M.current.dispatchCommand(l.CLEAR_EDITOR_COMMAND,void 0)}_()},children:"Cancel"})]})]})]})}},66165:function(e){e.exports={buttons:"CommentInput_buttons__Wu2XU",CommentInput:"CommentInput_CommentInput__QvI3s",editor:"CommentInput_editor__14FxS"}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.