1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5811],{75951:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/labs/[author]/qna/[id]",function(){return n(52823)}])},33590:function(e,t,n){"use strict";var l=n(36492),r=n(11163),i=n(15636),a=n(67847);let s=()=>{let e=(0,r.useRouter)(),{qnaId:t}=e.query,n=(0,a.o)(e=>e.brand.name),{data:s,error:o,isError:c}=(0,l.a)(["qnaItemDetail",n,t],()=>(0,i.Wu)({name:n,postId:t}),{enabled:!!t&&!!n,retry:1,cacheTime:0});return{qnaItemDetail:s,error:o,isError:c}};t.Z=s},52823:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return K},default:function(){return W}});var l=n(85893),r=n(35707),i=n(28331),a=n(38138),s=n(93627),o=n(44012),c=n(56746),d=n(73209),u=n(92696),p=n(5616),x=n(15861),m=n(67720),y=n(90948),f=n(48228),h=n(85945),v=n(29204),g=n(25675),C=n.n(g),j=n(11163),b=n(67294),k=n(15636),w=n(67847),T=n(79404),Z=n(68977),B=n(33590),N=n(84956),P=n(2734),A=n(24153),I=n(72313),D=n(10984);let Q=(0,y.ZP)(e=>(0,l.jsx)(D.Z,{multiline:!0,minRows:1,fullWidth:!0,...e}))(e=>{let{theme:t}=e;return{backgroundColor:t.palette.common.white,borderRadius:"6px","& .MuiOutlinedInput-root":{borderRadius:"6px",padding:"12px 16px","& fieldset":{borderColor:t.palette.grey[200]},"&:hover fieldset":{borderColor:t.palette.grey[300]},"&.Mui-focused fieldset":{borderWidth:"1px",borderColor:t.palette.grey[700]},"&.Mui-error":{backgroundColor:t.palette.red[0],"& fieldset":{borderColor:t.palette.status.error}}},"& .MuiOutlinedInput-input":{...t.typography.body1},"& .MuiFormHelperText-root":{marginLeft:"8px",marginTop:"8px"}}}),S=e=>{let{content:t,onChange:n,onCancel:r,onSave:i,error:a}=e;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Q,{value:t,onChange:n,placeholder:"ëê¸ì ìì íì¸ì.",error:a,helperText:a?"ëê¸ì ì
ë ¥í´ì£¼ì¸ì.":""}),(0,l.jsxs)(p.Z,{sx:{display:"flex",justifyContent:"flex-end",gap:"8px"},children:[(0,l.jsx)(u.zx,{variant:"soft",label:"ì·¨ì",onClick:r}),(0,l.jsx)(u.zx,{variant:"solid",label:"ìì ",onClick:i})]})]})},O=e=>{let{brandUser:t,userName:n,repliesData:r,onSaveEdit:s,onDeleteReply:o}=e,d=(0,P.Z)(),[u,m]=(0,b.useState)(null),[y,f]=(0,b.useState)(!1),h=(e,t)=>{m({id:e,content:t}),(0,c.f2)("Post Management Button Clicked",{Position:"Brand Q&A comment","Button Name":"ìì í기"})},v=()=>{m(null)},g=e=>{if(!(null==u?void 0:u.content.trim())){f(!0);return}s(e,u.content),m(null)},j=e=>{m({...u,content:e.target.value}),y&&f(!1)};return(0,l.jsx)(l.Fragment,{children:null==r?void 0:r.map(e=>(0,l.jsxs)(U,{children:[(0,l.jsxs)(p.Z,{display:"flex",justifyContent:"space-between",children:[(0,l.jsxs)(p.Z,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:[(0,l.jsxs)(x.Z,{variant:"subtitle1",sx:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,l.jsx)(C(),{src:e.writerThumbnailUrl,alt:"".concat(e.writerNickname,"ì íë¡í ì´ë¯¸ì§"),width:24,height:24,style:{borderRadius:"50%"}}),e.writerNickname]}),t!==e.writerNickname&&(0,l.jsxs)(x.Z,{variant:"body1",color:"text.secondary",sx:{display:"flex",alignItems:"center",gap:"4px"},children:[(0,l.jsx)(i.Z,{icon:a.oT,size:a.u8.xxsmall,color:d.palette.text.secondary}),A.Fv[e.writerType]]})]}),(null==u?void 0:u.id)!==e.replyId&&!e.isDeleted&&e.isOwn&&(0,l.jsx)(I.Z,{onEditClick:()=>h(e.replyId,e.contents),onDeleteClick:()=>o(e.replyId)})]}),(null==u?void 0:u.id)===e.replyId?(0,l.jsx)(S,{content:u.content,onChange:j,onCancel:v,onSave:()=>g(e.replyId),error:y}):(0,l.jsx)(_,{reply:e})]},e.replyId))})},_=e=>{let{reply:t}=e;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(x.Z,{variant:"body1",sx:{whiteSpace:"pre-wrap",a:{}},color:t.isDeleted?"grey.300":"text.primary",children:t.isDeleted?"ìì±ìì ìí´ ìì ë ëê¸ì´ìì.":(e=>{let t=[],n=0,r=Array.from(e.matchAll(/((https?:\/\/)?(www\.)?[^\s]+(\.[^\s]+)+)/gi));for(let a of r){var i;let[r]=a,s=null!==(i=a.index)&&void 0!==i?i:0;if(n<s){let l=e.slice(n,s);t.push(l)}let o=r.startsWith("http")?r:"http://".concat(r);t.push((0,l.jsx)(x.Z,{component:"a",href:o,target:"_blank",rel:"noopener noreferrer",color:"secondary.main",children:r},s)),n=s+r.length}return n<e.length&&t.push(e.slice(n)),t})(t.contents)}),(0,l.jsxs)(x.Z,{variant:"body2",color:"text.secondary",sx:{span:{color:"grey.300"}},children:[(0,N.$)(t.createdAt),t.isEdited&&(0,l.jsx)("span",{children:" (ìì ë¨)"})]})]})},U=(0,y.ZP)(p.Z)(e=>{let{theme:t}=e;return{display:"flex",flexDirection:"column",gap:"16px",padding:"32px 0",borderBottom:"1px solid ".concat(t.palette.divider)}}),E={confirm:{title:"Q&A를 ìì í ê¹ì?",content:"ìì í Q&Aë ë ì´ì ë
¸ì¶ëì§ ìì¼ë©°, 복구í ì ìì´ì.",okText:"ìì ",cancelText:"ì·¨ì"},success:{title:"Q&A를 ìì íì´ì.",severity:"success",okText:"íì¸"},edit:{title:"ëµë³ì´ ìë£ë Q&Aë ìì í ì ìì´ì.",content:"ì¶ê° ì§ë¬¸ì´ ìë¤ë©´ ëê¸ë¡ ìì±í´ì£¼ì¸ì.",severity:"caution",okText:"íì¸"},access:{title:"ë¹ê³µê° ê²ìê¸ì´ìì.",content:"ìì±ìì ë¸ëëë§ ì´ëí ì ìì´ì.",severity:"caution",okText:"íì¸"},public:{title:"ê³µê° ê²ìê¸ë¡ ë³ê²½í ê¹ì?",content:"ê³µê° ê²ìê¸ì ë구ë ì íìì´ ë³¼ ì ìì´ì.",okText:"ë³ê²½í기",cancelText:"ì·¨ì"},private:{title:"ë¹ê³µê° ê²ìê¸ë¡ ë³ê²½í ê¹ì?",content:"ë¹ê³µê° ê²ìê¸ì ìì±ìì ë¸ëëë§ ì´ëí ì ìì´ì.",okText:"ë³ê²½í기",cancelText:"ì·¨ì"},delete:{title:"ëê¸ì ìì í ê¹ì?",content:"ìì íë©´ ëê¸ ë´ì©ì´ ë ì´ì íìëì§ ììì.",okText:"ìì ",cancelText:"ì·¨ì"},deleted:{title:"ìì ë ê²ìê¸ì´ìì.",okText:"íì¸"},error:{title:"ë¤ì íë² íì¸í´ì£¼ì¸ì.",severity:"caution",okText:"íì¸"}},R={privateSuccess:{icon:"success",text:"ë¹ê³µê° ê²ìê¸ë¡ ë³ê²½íì´ì."},publicSuccess:{icon:"success",text:"ê³µê° ê²ìê¸ë¡ ë³ê²½íì´ì."},warning:{icon:"warning",text:"문ì ê° ë°ìíì´ì. ë¤ì ìëí´ì£¼ì¸ì."},replySuccess:{icon:"success",text:"ëê¸ì ë±ë¡íì´ì."},replyUpdateSuccess:{icon:"success",text:"ëê¸ì ìì íì´ì."},replyDeleteSuccess:{icon:"success",text:"ëê¸ì ìì íì´ì."}},M=()=>{let e=(0,j.useRouter)(),{qnaId:t}=e.query,n=(0,w.o)(e=>e.brand.name),r=(0,w.o)(e=>e.brand.nickname),y=(0,w.o)(e=>e.brand.title),g=(0,w.o)(e=>e.brand.profileImageUrl),{user:N}=(0,o.tN)(),{isOpen:P,open:A,dialogProps:I}=(0,s.Z)(),{isOpen:D,open:S}=(0,s.Z)(),{showSnackbar:_}=(0,Z.NZ)(R),{qnaItemDetail:U,error:M,isError:H}=(0,B.Z)(),J=(null==N?void 0:N.displayName)===r,K=(null==U?void 0:U.isOwn)||J,W=(0,f.D)(k.is),L=(0,f.D)(k.NE),X=(0,f.D)(k.W_),$=(0,f.D)(k.pC),G=(0,f.D)(k.ef),V=(0,h.NL)(),[Y,ee]=(0,b.useState)(""),[et,en]=(0,b.useState)(!1),el={Positon:"Brand Q&A","Brand Name":y,Title:null==U?void 0:U.title},er=()=>{"waiting"===U.status?e.push((0,d.nx)(n,t)):A({...E.edit})},ei=(0,b.useCallback)(()=>{(0,c.f2)("Post Management Button Clicked",{...el,"Button Name":"".concat((null==U?void 0:U.isPrivate)?"ê³µê°":"ë¹ê³µê°","ë¡ ë³ê²½í기")}),A({...(null==U?void 0:U.isPrivate)?E.public:E.private,onOk:async()=>{try{let e=await L.mutateAsync({name:n,postId:t,isPrivate:!(null==U?void 0:U.isPrivate)});"OK"===e&&(_((null==U?void 0:U.isPrivate)?"publicSuccess":"privateSuccess"),V.invalidateQueries(["qnaItemDetail",n,t]))}catch(e){_("warning")}}})},[U,n,t,L,V]),ea=()=>{(0,c.f2)("Post Management Button Clicked",{...el,"Button Name":"ìì í기"}),A({...E.confirm,onOk:async()=>{try{let e=await W.mutateAsync({name:n,postId:t});"OK"===e&&S()}catch(t){A({...E.error,onOk:()=>{e.push((0,d.J8)(n))}})}}})},es=async(e,l)=>{(0,c.f2)("Add Comment Button Clicked",{"Post Category":"Brand Q&A","Button Name":"ìì ",Title:null==U?void 0:U.title,"Brand Name":y,"User Type":J?"ë¸ëë":"ì§ë¬¸ì"});try{let r=await $.mutateAsync({name:n,postId:t,replyId:e,contents:l});"OK"===r&&(_("replyUpdateSuccess"),V.invalidateQueries(["qnaItemDetail",n,t]),(0,c.f2)("Comment Upload Completed",{"Post Category":"Brand Q&A","Action Type":"Edit",Title:null==U?void 0:U.title,"Brand Name":y,"User Type":J?"ë¸ëë":"ì§ë¬¸ì"}))}catch(e){_("warning")}},eo=async e=>{(0,c.f2)("Post Management Button Clicked",{...el,Position:"Brand Q&A comment","Button Name":"ìì í기"}),A({...E.delete,onOk:async()=>{try{let l=await G.mutateAsync({name:n,postId:t,replyId:e});"OK"===l&&(_("replyDeleteSuccess"),V.invalidateQueries(["qnaItemDetail",n,t]),(0,c.f2)("Comment Delete Completed",{"Post Category":"Brand Q&A",Title:null==U?void 0:U.title,"Brand Name":y,"User Type":J?"ë¸ëë":"ì§ë¬¸ì"}))}catch(e){_("warning")}},onCancel:()=>{(0,c.f2)("Popup Button Clicked",{"Button Name":"ì·¨ì","Popup Title":"ëê¸ì ìì í ê¹ì?","Popup Type":"Delete Q&A Comment","Button URL":null})}})},ec=async()=>
1{if(!Y.trim()){en(!0);return}en(!1),(0,c.f2)("Add Comment Button Clicked",{"Post Category":"Brand Q&A","Button Name":"ë±ë¡í기",Title:null==U?void 0:U.title,"Brand Name":y,"User Type":J?"ë¸ëë":"ì§ë¬¸ì"});try{let e=await X.mutateAsync({name:n,postId:t,contents:Y});"OK"===e&&(_("replySuccess"),V.invalidateQueries(["qnaItemDetail",n,t]),ee(""),(0,c.f2)("Comment Upload Completed",{"Post Category":"Brand Q&A","Action Type":"New","Brand Name":y,Title:null==U?void 0:U.title,"User Type":J?"ë¸ëë":"ì§ë¬¸ì"}))}catch(e){_("warning")}};return((0,b.useEffect)(()=>{if((0,v.IZ)(M)&&!P){var t;let l=null===(t=M.response)||void 0===t?void 0:t.status,r={500:E.access,403:E.access,422:E.deleted}[l]||E.error;A({...r,onOk:()=>e.push((0,d.J8)(n)),onClose:()=>{}})}},[M,H,P,A,e,n]),!U&&H)?(0,l.jsx)(u.QH,{...I}):(0,l.jsxs)(q,{children:[(0,l.jsx)(T.Z,{detailContent:U,onEditClick:er,onDeleteClick:ea,onPrivateClick:ei}),(0,l.jsx)(p.Z,{sx:{display:"flex",justifyContent:"center"},children:(0,l.jsx)(u.zx,{href:(0,d.J8)(n),variant:"strokeSecondary",label:(0,l.jsxs)(x.Z,{variant:"subtitle2",sx:{display:"flex",alignItems:"center",gap:"4px"},children:["Q&A ì 체보기",(0,l.jsx)(i.Z,{icon:a.ol,size:a.u8.smallHalf})]}),onClick:()=>{(0,c.f2)("More Button Clicked",{"Button Name":"Q&A ì 체보기","Button Type":"Brand Q&A","Button URL":(0,d.J8)(n),"UI Type":"text"})},sx:{width:"fit-content"}})}),(0,l.jsx)(m.Z,{}),(0,l.jsxs)(z,{children:[(0,l.jsxs)(p.Z,{children:[(0,l.jsxs)(x.Z,{variant:"h6",sx:{display:"flex",gap:"6px",span:{color:"blue.400"}},children:["ëê¸",(0,l.jsx)("span",{children:null==U?void 0:U.replyCount})]}),(0,l.jsx)(x.Z,{variant:"body2",color:"grey.300",children:"ì§ë¬¸ ìì±ìì ë¸ëëë§ ë±ë¡í ì ìì´ì."})]}),(0,l.jsx)(O,{brandUser:r,userName:null==N?void 0:N.displayName,repliesData:null==U?void 0:U.replies,onSaveEdit:es,onDeleteReply:eo}),K&&(0,l.jsxs)(F,{children:[(0,l.jsxs)(p.Z,{sx:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,l.jsx)(C(),{src:J?g:null==U?void 0:U.writerProfileImageUrl,alt:"user profile image",width:24,height:24,style:{borderRadius:"50%"}}),(0,l.jsx)(x.Z,{variant:"subtitle1",children:"ëê¸ ìì±"})]}),(0,l.jsx)(Q,{placeholder:"ëê¸ì ìì±í´ì£¼ì¸ì.",value:Y,onChange:e=>{ee(e.target.value),et&&en(!1)},error:et,helperText:et?"ëê¸ì ìì± í ë±ë¡í´ì£¼ì¸ì.":""}),(0,l.jsx)(p.Z,{sx:{display:"flex",justifyContent:"flex-end"},children:(0,l.jsx)(u.zx,{variant:"solid",label:"ë±ë¡í기",onClick:ec})})]})]}),(0,l.jsx)(u.QH,{...I}),(0,l.jsx)(u.QH,{open:D,onOk:()=>e.push((0,d.J8)(n)),...E.success})]})},q=(0,y.ZP)(p.Z)(e=>{let{theme:t}=e;return{display:"flex",flexDirection:"column",gap:"32px",".editable-false":{border:"none",borderRadius:0,".editor-inner":{padding:0}},[t.breakpoints.down("lg")]:{margin:"0 32px"},[t.breakpoints.down("sm")]:{margin:"0 20px"}}}),z=(0,y.ZP)(p.Z)(e=>{let{theme:t}=e;return{display:"flex",flexDirection:"column",gap:"16px"}}),F=(0,y.ZP)(p.Z)(e=>{let{theme:t}=e;return{display:"flex",flexDirection:"column",gap:"16px",borderRadius:"8px"}});var H=n(37565);let J=e=>{let{author:t,labDataResult:n}=e;return(0,l.jsx)(r.z,{config:{...r.O,editable:!1},children:(0,l.jsx)(M,{})})};var K=!0,W=(0,H.xN)(J)}},function(e){e.O(0,[3662,1226,5970,9143,7565,6721,3519,9774,2888,179],function(){return e(e.s=75951)}),_N_E=e.O()}]); 2//# sourceMappingURL=[id]-23bc09a858910fcc.js.map
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.