(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4851],{40875:function(e,t,n){"use strict";n.d(t,{R:function(){return v}});var o=n(85893),i=n(67294),r=n(43125),s=n(67128),a=n(32763),l=n(83129),d=n(2566),c=n(86896),u=n(24169),p=n(4266),m=n(26381),h=n(95983),v=function(e){var t=e.isBanner,n=(0,c.Z)().formatMessage,v=(0,m.h)(),f=v.locale,g=v.asPath,x=n({id:"common.chatWithMe",defaultMessage:"Chat with me"}),y=(0,p.d)(),b=(0,i.useState)((function(){return(0,h.A_)("chat_banner")})),w=b[0],C=b[1];return(0,i.useEffect)((function(){C((0,h.A_)("chat_banner"))}),[]),-1!==h.$x.indexOf(h.Vi.NEXT_PUBLIC_DEPLOY_LOCALE||"")?t?(0,o.jsx)(s.b,{href:w,children:(0,o.jsx)("img",{src:r.C.getAssetPath(y?"ai/chat_with_me_banner_mobile.jpg":"ai/chat_with_me_banner.jpg"),alt:x,style:{maxWidth:"100%"},"data-event-category":"Together","data-event-action":"Chat With Me","data-event-label":(0,u.Ow)(f,g)})}):(0,o.jsx)(a.B,{"data-event-category":"Together","data-event-action":"Chat With Me","data-event-label":(0,u.Ow)(f,g),leftIcon:(0,o.jsx)("img",{src:r.C.getAssetPath("ai/chat-icon.svg"),alt:x,style:{width:y?(0,d.h)(16):(0,d.h)(18),objectFit:"cover",aspectRatio:4.5}}),onClick:function(){return window.location.href=(0,h.A_)("chat_button")},styles:{root:{height:(0,d.h)(32),paddingLeft:(0,d.h)(8),paddingRight:(0,d.h)(8)},leftIcon:{marginRight:(0,d.h)(8)}},children:(0,o.jsx)(l.T,{size:y?"s5":"s4",color:"white",weight:"semiBold",children:x})}):null}},37125:function(e,t,n){"use strict";n.d(t,{t:function(){return c},E:function(){return u}});var o=n(26265),i=n(85893),r=n(45579),s=n(26381),a=n(95983);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function d(e){for(var t=1;t div{&:not(:last-child){position:relative;margin-right:22px;&::after{position:absolute;top:50%;left:calc(100% + 0.5rem);color:#9495a0;content:'\u2022';font-size:14px;transform:translateY(-50%);}}}}}"],(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.mbColors.lightGray})):""),s.ZP.img.withConfig({displayName:"indexstyled__StyledLeftIcon",componentId:"sc-15vdhb7-1"})(["width:1.5rem;height:1.5rem;margin-right:2px;",""],i.fn?(0,s.iv)(["margin-right:5px;"]):""),s.ZP.img.withConfig({displayName:"indexstyled__StyledRightIcon",componentId:"sc-15vdhb7-2"})(["width:1rem;height:1rem;margin-right:0.5rem;"]),(0,s.ZP)(r.T).withConfig({displayName:"indexstyled__StyledText",componentId:"sc-15vdhb7-3"})(["display:flex;align-items:center;"]);!function(e){e[e.post=1]="post",e[e.reply=2]="reply"}(o||(o={}))},59737:function(e,t,n){"use strict";var o=n(26265),i=n(85893),r=n(38347);n(67294);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function a(e){for(var t=1;t *{pointer-events:none;}","{width:248px;flex:0 0 248px;}"],(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.neutral100}),(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.white}),(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.gray800}),p.M.mbDown),f=(0,m.ZP)(h.U).withConfig({displayName:"indexstyled__StyledCardAuthorWrapper",componentId:"sc-cx6cp-1"})([".col-left{> *:first-child{font-size:14px;line-height:22px;letter-spacing:-0.2px;","{font-size:12px;line-height:18px;}}}"],p.M.mbDown),g=m.ZP.div.withConfig({displayName:"indexstyled__StyleContent",componentId:"sc-cx6cp-2"})(["display:flex;flex-direction:column;gap:4px;flex:1;"]),x=m.ZP.div.withConfig({displayName:"indexstyled__StyleTitle",componentId:"sc-cx6cp-3"})(["color:",";font-size:14px;font-weight:600;line-height:22px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"],(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.gray800})),y=m.ZP.div.withConfig({displayName:"indexstyled__StyleDescription",componentId:"sc-cx6cp-4"})(["overflow:hidden;color:",";font-size:14px;font-weight:400;line-height:22px;letter-spacing:-0.2px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;"],(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.gray800})),b=m.ZP.div.withConfig({displayName:"indexstyled__StyleReactionCard",componentId:"sc-cx6cp-5"})(["display:flex;justify-content:space-between;align-items:center;"]),w=m.ZP.div.withConfig({displayName:"indexstyled__StyleListReaction",componentId:"sc-cx6cp-6"})(["display:flex;justify-content:space-between;align-items:center;gap:16px;"]),C=m.ZP.div.withConfig({displayName:"indexstyled__StyleReactionItem",componentId:"sc-cx6cp-7"})(["display:flex;padding:3px 0px;justify-content:center;align-items:center;gap:4px;border-radius:8px;.reaction-number{color:",";font-size:12px;font-weight:600;line-height:18px;}"],(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.gray600})),j=function(e){var t,n,p,m,h,j=e.post,P=e.forceTimeText,O=e.dataEventAction,S=e.dataEventCategory,k=e.dataEventLabel,_=(0,l.useRouter)().locale,N=void 0===_?"vi-VN":_,I="".concat((0,u.k3)("/".concat((null===j||void 0===j||null===(t=j.community)||void 0===t?void 0:t.slug)||"_","/").concat((null===j||void 0===j?void 0:j.slug)||"","/"))),M="".concat((0,d.mg)(N)).concat(I);return(0,o.jsxs)(v,{href:M,"data-event-action":O,"data-event-category":S,"data-event-label":k,children:[(0,o.jsx)(f,{authorProps:{isAnonymous:null===j||void 0===j?void 0:j.isAnonymous,avatar:null===j||void 0===j||null===(n=j.author)||void 0===n?void 0:n.avatar,name:null===j||void 0===j||null===(p=j.author)||void 0===p?void 0:p.name,username:null===j||void 0===j||null===(m=j.author)||void 0===m?void 0:m.username,email:null===j||void 0===j||null===(h=j.author)||void 0===h?void 0:h.email,timeText:P||(null===j||void 0===j?void 0:j.createdTime),time:(null===j||void 0===j?void 0:j.scheduleDate)||(null===j||void 0===j?void 0:j.createdDate),showDetailPopup:!0}}),(0,o.jsxs)(g,{children:[(0,o.jsx)(x,{children:j.title}),(0,o.jsx)(y,{dangerouslySetInnerHTML:{__html:j.description||""}})]}),(0,o.jsxs)(b,{children:[(0,o.jsxs)(w,{children:["undefined"!==typeof j.likeCount&&j.likeCount>0&&(0,o.jsxs)(C,{children:[(0,o.jsx)(s.Z,{size:18}),(0,o.jsx)("div",{className:"reaction-number",children:(0,i.a)(j.likeCount)})]}),"undefined"!==typeof j.commentCount&&j.commentCount>0&&(0,o.jsxs)(C,{children:[(0,o.jsx)(c.Z,{size:18,color:r.r.colors.gray600}),(0,o.jsx)("div",{className:"reaction-number",children:(0,i.a)(j.commentCount)})]})]}),"undefined"!==typeof j.totalView&&j.totalView>0&&(0,o.jsxs)(C,{children:[(0,o.jsx)(a.Z,{size:18}),(0,o.jsx)("div",{className:"reaction-number",children:j.totalView})]})]})]})}},15437:function(e,t,n){"use strict";n.d(t,{Mw:function(){return d},N0:function(){return c},VJ:function(){return u},tb:function(){return p},lj:function(){return m},Kj:function(){return h},XQ:function(){return v},rA:function(){return f},vs:function(){return g},Tl:function(){return x},Vb:function(){return y}});var o,i,r=n(36308),s=n(57425),a=n(91256),l=n(56632),d=a.ZP.span.withConfig({displayName:"indexstyled__StyledBtnText",componentId:"sc-113z62q-0"})([""]),c=a.ZP.div.withConfig({displayName:"indexstyled__StyledRow",componentId:"sc-113z62q-1"})([""]),u=a.ZP.div.withConfig({displayName:"indexstyled__StyledColLeft",componentId:"sc-113z62q-2"})([""]),p=a.ZP.div.withConfig({displayName:"indexstyled__StyledColRight",componentId:"sc-113z62q-3"})([""]),m=a.ZP.div.withConfig({displayName:"indexstyled__StyledActionButton",componentId:"sc-113z62q-4"})([".check-box-anonymous{input{padding:0;}}"]),h=(0,a.ZP)(l.j).withConfig({displayName:"indexstyled__StyledCommunityButton",componentId:"sc-113z62q-5"})([""]),v=a.ZP.div.withConfig({displayName:"indexstyled__StyledInputCommentBar",componentId:"sc-113z62q-6"})([".reply-to-container{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;width:100%;}&[data-is-input-style='true']{","{display:flex;}","{width:48px;}","{width:calc(100% - 48px);}&[data-is-reply='true']{","{width:32px;}","{width:calc(100% - 32px);}","{","{width:48px;}","{width:calc(100% - 48px);}}}.error-text{padding:1rem;color:",";}.reply-to-container{.icon-close-comment{width:16px;height:16px;cursor:pointer;}a{text-decoration:none;}}.input-container{display:flex;.avatar-wrapper{display:flex;flex-shrink:0;align-items:center;margin-right:0.5rem;","{width:24px;height:24px;}}.input-wrapper{input[type='checkbox']{padding:0;}&[data-has-error]{.as-input{border-color:",";}}.as-input{.toolbar{position:absolute;bottom:0;","{left:-9px;}","{top:100%;bottom:auto;border-top:1px solid ",";margin-left:-16px;margin-right:-16px;width:calc(100% + 32px);}}.textarea{width:100%;max-height:225px;min-height:75px;","{margin-bottom:36px;}.ql-toolbar.ql-toolbar{padding:0;background:transparent !important;height:32px;button{","{margin:0 3px;}}}.ql-editor{margin-bottom:34px;margin-left:0;padding:0;}}width:100%;padding:16px;border:solid 1px #e4e8ec;border-radius:6px;","{padding:16px;.ql-editor{margin-left:0 !important;padding-top:0;}}&:focus-within,&:focus{border-color:",";box-shadow:0px 0px 2px 2px ",";}&:disabled{background-color:",";cursor:not-allowed;}span{&[data-error='true']{color:red;text-decoration:underline;}}}&[data-has-action-icon]{.as-input{padding:12px 48px 12px 16px;}}&[data-has-display-icon]{.as-input{padding:12px 16px 12px 48px;}}&[data-has-action-icon][data-has-display-icon]{.as-input{padding:12px 48px;}}&[data-size='lg']{.as-input{font-size:16px;font-weight:",";","{font-size:22px;line-height:1.2;}","{font-size:26px;line-height:1.2;}}}&[data-size='md']{.as-input{font-weight:",";line-height:22px;","{font-size:14px;line-height:1.2;}","{font-size:16px;line-height:1.2;}}}&[data-size='sm']{.as-input{font-weight:",";line-height:20px;","{font-size:13px;line-height:1.5;}","{font-size:13px;line-height:1.5;}}}}.images-input-label{height:100%;cursor:pointer;.icon-images-input{width:24px;height:24px;vertical-align:middle;}}}.preview-images-container{margin-top:1rem;.image-src-wrapper{position:relative;width:100%;padding-top:66.67%;&:not(:last-child){margin-bottom:1rem;}.preview-image{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;}.icon-close-circle{position:absolute;top:10px;right:10px;width:20px;height:20px;cursor:pointer;}}}","{.button-icon{& + span{display:none;}}}","{display:flex;flex-shrink:0;align-items:center;gap:16px;border:none;","{width:calc(100% + 32px);justify-content:space-between;border-top:1px solid ",";padding-left:16px;margin-left:-16px;margin-bottom:-16px;margin-right:-16px;}","{position:absolute;right:16px;bottom:16px;z-index:3;}","{display:none;}","{","{padding:0 !important;width:40px;height:40px;background:transparent !important;border:0 !important;}}","{.icon-enter{display:none;}","{display:block;}}&.send-button-post{background:",";border-radius:50%;}.icon-enter{width:20px;height:20px;vertical-align:middle;}&[data-is-loading='true']{> div{display:flex;align-items:center;justify-content:center;}}}}.mantine-Accordion-content{& > div > div{justify-content:space-between;}}"],c,u,p,u,p,r.M.mbUp,u,p,(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.red700}),r.M.mbDown,(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.red700}),r.M.mbUp,r.M.mbDown,null===(o=s.t.neutral)||void 0===o?void 0:o[1],r.M.mbDown,r.M.mbDown,r.M.mbDown,(function(e){return e.color}),(function(e){return e.shadowColor}),(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.gray100}),(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.sizes.fwRegular}),r.M.mbDown,r.M.mbUp,(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.sizes.fwRegular}),r.M.mbDown,r.M.mbUp,(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.sizes.fwRegular}),r.M.mbDown,r.M.mbUp,r.M.mbDown,m,r.M.mbDown,null===(i=s.t.neutral)||void 0===i?void 0:i[1],r.M.mbUp,d,r.M.mbDown,h,r.M.mbUp,d,(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.neutral100})),f=a.ZP.div.withConfig({displayName:"indexstyled__StyledInputCommentPost",componentId:"sc-113z62q-7"})(["position:relative;.card-textbox-overlay{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;cursor:pointer;}& > div{&.input-comment-post-marybaby{cursor:pointer;*{pointer-events:none;}}}"]),g=a.ZP.div.withConfig({displayName:"indexstyled__StyledMarryBabyInputCommentPostUI",componentId:"sc-113z62q-8"})(["padding:1rem;background:white;margin-bottom:8px;border:1px solid rgb(243,243,243);margin-bottom:8px;box-shadow:rgba(0,0,0,0.08) 0px 1px 3px;border-radius:24px;.upper-container{display:flex;align-items:center;padding-bottom:1rem;border-bottom:1px solid #fafafa;.avatar-wrapper{width:40px;height:40px;margin-right:1rem;}}.action-container{display:flex;align-items:center;justify-content:center;padding-top:1rem;.image-picker-icon,.video-picker-icon{width:24px;height:24px;margin-right:0.5rem;}.image-picker-wrapper,.video-picker-wrapper{display:flex;flex:1;align-items:center;justify-content:center;}}"]),x=(a.ZP.div.withConfig({displayName:"indexstyled__StyledEditorArea",componentId:"sc-113z62q-9"})([""]),a.ZP.div.withConfig({displayName:"indexstyled__StyledRichTextWRapper",componentId:"sc-113z62q-10"})([""])),y=a.ZP.div.withConfig({displayName:"indexstyled__StyledActions",componentId:"sc-113z62q-11"})(["display:flex;"])},85955:function(e,t,n){"use strict";n.d(t,{z:function(){return ce}});var o=n(85893),i=n(809),r=n.n(i),s=n(26265),a=n(92447),l=n(67294),d=n(22398),c=n(37699),u=n(10917),p=n(61683),m=n(63946),h=n(67128),v=n(5152),f=n(11163),g=n(86896),x=n(25559),y=n(2810),b=n(38347);function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function C(e){for(var t=1;t0,h=null===n||void 0===n?void 0:n.author;(null===h||void 0===h?void 0:h.name)||null===h||void 0===h||h.username,(null===h||void 0===h?void 0:h.username)||null===h||void 0===h||h.name,null===h||void 0===h||h.avatar,null===n||void 0===n||n.isAnonymous,null===h||void 0===h||h.email,null===n||void 0===n||n.createdTime,null===n||void 0===n||n.community,null===h||void 0===h||h.id;return(0,o.jsx)(U,q(q({},i),{},{children:(0,o.jsx)(W,{children:(0,o.jsxs)(H,{children:[(0,o.jsxs)(F,{"data-has-thumb":m,children:[(0,o.jsx)(R.T,{as:"h4",size:"s3",weight:"bold",children:null===n||void 0===n?void 0:n.title}),(0,o.jsx)(V,{children:(0,o.jsx)(D.P,{trackingCategory:O.UN,url:"",className:"post-content-wrapper",description:null===n||void 0===n?void 0:n.description,disableShortenContent:!1,mentions:null===n||void 0===n?void 0:n.mentions,maxChars:400})})]}),m&&(0,o.jsx)(G,{className:"cursor-pointer",onClick:function(){return r((function(){window.location.href=p}))},children:(0,o.jsx)(T.a,{images:n.photos})})]})})}))},X=n(45897),Q=z.ZP.div.withConfig({displayName:"indexstyled__StyledFormWrapper",componentId:"sc-1m5cyo6-0"})(["padding:16px;max-width:936px;margin:0 auto;"]),K=(z.ZP.div.withConfig({displayName:"indexstyled__StyledNote",componentId:"sc-1m5cyo6-1"})(["font-size:14px;margin-bottom:20px;"]),(0,z.ZP)(X.a).withConfig({displayName:"indexstyled__StyledPopupFrame",componentId:"sc-1m5cyo6-2"})(["[data-type='confirm']{overflow-y:auto;max-width:none;max-height:none;width:100vw;height:auto;max-height:100%;.popup-content{.header{padding-left:16px;}}","{transition:all 0.3s ease-in-out 0s;&[data-open='true']{z-index:500;}}}"],Z.M.mbDown));function $(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ee(e){for(var t=1;t ../../molecules/editor"]}}),ae=(0,v.default)((function(){return Promise.all([n.e(2937),n.e(7127),n.e(8007),n.e(1769),n.e(1420)]).then(n.bind(n,91769)).then((function(e){return e.RichTextProvider.Editor}))}),{loading:function(){return null},ssr:!1,loadableGenerated:{webpack:function(){return[91769]},modules:["../components/molecules/inputCommentBar/index.tsx -> ../../molecules/editor"]}}),le=(0,v.default)((function(){return Promise.all([n.e(2937),n.e(7127),n.e(8007),n.e(1769),n.e(1420)]).then(n.bind(n,91769)).then((function(e){return e.RichTextProvider.PreviewCard}))}),{loading:function(){return null},ssr:!1,loadableGenerated:{webpack:function(){return[91769]},modules:["../components/molecules/inputCommentBar/index.tsx -> ../../molecules/editor"]}}),de=(0,v.default)((function(){return Promise.all([n.e(2937),n.e(7127),n.e(8007),n.e(1769),n.e(1420)]).then(n.bind(n,91769)).then((function(e){return e.RichTextProvider.Error}))}),{loading:function(){return null},ssr:!1,loadableGenerated:{webpack:function(){return[91769]},modules:["../components/molecules/inputCommentBar/index.tsx -> ../../molecules/editor"]}}),ce=(0,l.forwardRef)((function(e,t){var n=e.isReply,i=e.className,s=e.onClose,v=e.replyToName,b=e.style,w=e.replyingId,C=e.replyingUser,Z=e.onPostSuccess,E=(e.onPopupClose,e.isMainCmt,e.post),D=e.btnProps,T=e.isEdit,R=e.commentId,L=void 0===R?"":R,A=e.expandPopupProps,B=e.imageFiles,z=e.isMobile,U=e.value,W=void 0===U?"":U,H=e.showFullEditor,V=e.btnLabel,F=e.headerTitle,G=e.avatarProps,Y=e.isAdmin,q=e.showSourceList,J=e.sourceList,X=e.colLeftWidth,Q=e.isAnonymous,K=e.showCountChar,$=e.hideReplyMentionsInText,ee=e.hideAnomyous,ie=e.hasCreatePost,ce=e.hasExpandChange,ue=(0,M.aC)(),pe=O.Vi.NEXT_PUBLIC_SSO,me=(0,g.Z)().formatMessage,he=(0,f.useRouter)().locale,ve=void 0===he?"vi-VN":he,fe=(0,l.useState)(W),ge=fe[0],xe=fe[1],ye=(0,l.useContext)(S.I),be=ye.pushNotifications,we=ye.state.userInfo,Ce=(0,l.useContext)(P.gj).trigger,je=(0,l.useState)(!1),Pe=je[0],Oe=je[1],Se=(0,l.useState)(J||[]),ke=Se[0],_e=Se[1],Ne=(0,l.useState)(!1),Ie=Ne[0],Me=Ne[1],Ze=(0,l.useState)(Q),Ee=Ze[0],De=Ze[1],Te=(0,l.useRef)(null),Re=(0,l.useRef)(null),Le=(0,l.useState)([]),Ae=Le[0],Be=Le[1],ze=(0,l.useState)(B||[]),Ue=ze[0],We=ze[1],He=(0,l.useState)(!1),Ve=He[0],Fe=He[1],Ge=(0,l.useState)(null),Ye=Ge[0],qe=Ge[1],Je=(0,l.useState)(!1),Xe=Je[0],Qe=Je[1],Ke=oe(void 0,{name:"InputCommentBar"}).theme,$e=Ke.colors,et=function(){var e=(0,a.Z)(r().mark((function e(){var t,o,i,a,l,d,c,u,p,m,h,v,f,g,y;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!q||!Ie){e.next=3;break}return Me(!0),e.abrupt("return",!1);case 3:if(Me(!1),null!==E&&void 0!==E&&E.id&&!Pe){e.next=6;break}return e.abrupt("return");case 6:return Oe(!0),e.prev=7,l=function(e){xe(""),s&&s();var t=(0,x.ec)(e.data);"string"===typeof t.images&&(t.images=JSON.parse(t.images)),Qe(!1),null===Z||void 0===Z||Z(t)},e.next=11,Promise.all(Ue.map((function(e,t){return new Promise((function(n){return setTimeout((function(){return n((0,N.tx)(e,ve))}),2e3*t)}))})));case 11:return d=e.sent,We(d),e.next=15,(0,_._Y)(re({message:ge,photos:Ue,postId:E.id,link:null===Ye||void 0===Ye?void 0:Ye.url,locale:ve,isAdmin:Y,type:q?"chatbot":void 0,sourceList:ke,isAnonymous:Ee,hideReplyMentionsInText:$},n&&w?{replyingUserId:String((null===C||void 0===C?void 0:C.id)||(null===E||void 0===E||null===(t=E.author)||void 0===t?void 0:t.id)||""),replyingId:w,replyingUserName:(null===C||void 0===C?void 0:C.name)||(null===C||void 0===C?void 0:C.username)||""}:{}));case 15:return c=e.sent,e.next=18,T?(0,_.uA)(L,c,ve,Y):n&&w?(0,_.Xi)(c,ve):(0,_.rd)(c,ve);case 18:if(u=e.sent,!Array.isArray(null===u||void 0===u?void 0:u.messages)||null===u||void 0===u||null===(o=u.messages)||void 0===o||!o.includes("unfollow_member")){e.next=22;break}return Oe(!1),e.abrupt("return",ue(et));case 22:null===(p=null===u||void 0===u?void 0:u.data)||void 0===p||!p.id||null!==u&&void 0!==u&&null!==(i=u.messages)&&void 0!==i&&null!==(a=i.moderation)&&void 0!==a&&a.type?"banned"===(null===u||void 0===u||null===(m=u.messages)||void 0===m||null===(h=m.moderation)||void 0===h?void 0:h.type)?(be({title:me({id:"notification.comment.blocked.title"}),message:me({id:"notification.comment.blocked.message"}),type:"danger"}),u.messages.moderation.words&&Be(u.messages.moderation.words)):"suspect"===(null===u||void 0===u||null===(v=u.messages)||void 0===v||null===(f=v.moderation)||void 0===f?void 0:f.type)?(be({title:me({id:"notification.comment.suspect.title"}),message:me({id:"notification.comment.suspect.message"}),type:"warning"}),xe(""),s&&s()):null!==u&&void 0!==u&&null!==(g=u.messages)&&void 0!==g&&g.find((function(e){var t;return!(null===e||void 0===e||null===(t=e.includes)||void 0===t||!t.call(e,"suspend"))}))?(be({message:me({id:"notification.suspend.message"}),type:"warning"}),xe(""),s&&s()):be({title:"",message:(null===u||void 0===u||null===(y=u.messages)||void 0===y?void 0:y[0])||me({id:"notification.comment.somethingWrong"}),type:"danger"}):l(u),e.next=30;break;case 26:e.prev=26,e.t0=e.catch(7),console.error(e.t0),be({title:"",message:me({id:"notification.comment.somethingWrong"}),type:"danger"});case 30:Oe(!1);case 31:case"end":return e.stop()}}),e,null,[[7,26]])})));return function(){return e.apply(this,arguments)}}(),tt=function(){var e;null===(e=Te.current)||void 0===e||e.focus()},nt=function(e){xe(e)};(0,l.useImperativeHandle)(t,(function(){return{focusEditor:tt,setValue:nt}})),(0,l.useEffect)((function(){tt()}),[Ce]),(0,l.useEffect)((function(){xe(W)}),[W]),(0,l.useEffect)((function(){Me((ke||[]).filter((function(e){return""===e})).length>0)}),[ke]),(0,l.useEffect)((function(){return function(){return Qe(!1)}}),[]);var ot=T||n,it=V||(T?"Update":me(n?{id:"cardReactions.reply"}:{id:"cardReactions.comment"})),rt={loading:!z&&Pe,disabled:Ie||Ve||Pe||!ge||(null===ge||void 0===ge?void 0:ge.length)<2||!ge.trim()},st=T?me(n?{id:"inputComment.updateReply",defaultMessage:"Edit reply"}:{id:"inputComment.updateComment",defaultMessage:"Edit comment"}):me({id:"inputComment.replyTo"},{name:'@'.concat(v||"","")}),at=(0,o.jsx)(se,{imageFiles:Ue,value:ge,onChange:xe,onImageFilesChange:We,bannedWords:Ae,onPreviewUrlChange:qe,isReplying:n,hasEmbbedSocialLink:!1,hasExpandToolbar:!1,hasExpandPopup:!H,hasCreatePost:ie,onInitEditor:function(e){return Te.current=e},onInvalidVal:Fe,children:(0,o.jsxs)(ne.XQ,{"data-is-input-style":!H,"data-is-reply":n,className:i,style:b,color:Ke.fn.primaryColor(),shadowColor:$e[Ke.primaryColor][2],children:[ot&&!H&&(0,o.jsxs)(ne.N0,{children:[(0,o.jsx)(ne.VJ,{style:X?{width:X}:{},children:"\xa0"}),(0,o.jsx)(ne.tb,{children:(0,o.jsxs)("div",{className:"reply-to-container",children:[(0,o.jsx)(d.T,{size:"p4",children:(0,o.jsx)("span",{dangerouslySetInnerHTML:{__html:F||st}})}),(0,o.jsx)("img",{src:(0,k.k3)("/svg/icon-close-circle-line.svg"),className:"icon-close-comment",onClick:function(){return s&&s()},alt:""})]})})]}),(0,o.jsxs)("div",{className:"input-container",ref:Re,children:[!H&&(0,o.jsx)("a",{href:pe+y.D9.GET_PROFILE,children:(0,o.jsx)(m.U,re({className:"avatar-wrapper ".concat(n?"avatar-wrapper-reply":""),avatar:null!==we&&void 0!==we&&we.id?we.avatar:O.DP,username:(null===we||void 0===we?void 0:we.name)||(null===we||void 0===we?void 0:we.username)},G))}),(0,o.jsx)(c.I,{value:ge,name:"input",size:"md",className:"input-wrapper",CustomInput:(0,o.jsxs)("div",{className:"as-input",children:[(0,o.jsx)(ne.Tl,{children:(0,o.jsx)(ae,{className:"textarea",toolbarStyle:re(re({},!H&&{borderBottom:0}),H&&{borderTopLeftRadius:6,borderTopRightRadius:6,border:"1px solid ".concat(u.r.colors.gray200)}),textareaStyle:re({},H&&{border:"1px solid ".concat(u.r.colors.gray200),borderTop:0,minHeight:155}),expandPopupHandler:function(){return Qe(!Xe)}})}),K&&(0,o.jsx)(I.k,{}),q&&(0,o.jsx)(p.S,{style:{marginTop:"20px"},editMode:T,listUrl:J,onListChange:function(e){return _e(e||[])}}),Ie&&(0,o.jsx)(d.T,{size:"p4",color:u.r.colors.red500,children:"Please fill source"}),(0,o.jsx)(ne.Vb,{style:re({},H&&{marginTop:"10px"}),children:(0,o.jsxs)(ne.lj,{style:re({},H&&{display:"flex",justifyContent:"space-between",width:"100%"}),children:[ee?(0,o.jsx)("div",{}):(0,o.jsx)(h.d,{defaultChecked:Q,size:"sm",label:me({id:"inputComment.anonymous",defaultMessage:"Anonymous"}),onChange:function(e){return De(null===e||void 0===e?void 0:e.currentTarget.checked)},className:"check-box-anonymous",styles:function(){return{input:{padding:"0 !important"}}}}),(0,o.jsx)(ne.Kj,re(re(re({className:"send-button",size:"sm",onClick:et},rt),D),{},{variant:!H&&z?"transparent":"primary",leftIcon:!H&&z&&(0,o.jsx)(j,{className:"icon-enter m-icon",color:Ke.fn.primaryColor()}),children:!z&&(0,o.jsx)(ne.Mw,{children:it})}))]})})]})})]}),(0,o.jsx)(de,{}),(0,o.jsx)(le,{})]})});return(0,o.jsxs)(o.Fragment,{children:[at,Xe&&(0,o.jsx)(te,re({heading:st,onClose:function(){Qe(!1)},onPostSuccess:Z,imageFiles:Ue,btnLabel:it,value:ge,bannedWords:Ae,post:E,isMobile:z,isEdit:T,isReply:n,commentId:L,hasExpandChange:ce},A))]})}))},38120:function(e,t,n){"use strict";n.d(t,{Z:function(){return b}});var o=n(85893),i=n(28140),r=n(809),s=n.n(r),a=n(92447),l=n(67294),d=n(45897),c=n(67128),u=n(32763),p=n(11163),m=n(86896),h=n(2810),v=n(80143),f=n(5886),g=n(43196),x=n(24169),y=n(22028),b=function(e){var t=e.authorId,n=(0,m.Z)().formatMessage,r=(0,p.useRouter)(),b=r.locale,w=void 0===b?"vi-VN":b,C=r.reload,j=(0,l.useContext)(f.I).pushNotifications,P=(0,l.useState)(""),O=P[0],S=P[1],k=(0,x.Rm)(w);return(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("div",{onClick:function(e){e.preventDefault(),e.stopPropagation()},children:[t&&"suspend"===O&&(0,o.jsx)(d.P,{thumbnail:"./svg/delete.svg",isThumbnailIcon:!0,title:n({id:"admin.action.suspendAccount"}),description:"Are you sure you want to suspend this account?",acceptText:"Suspend",cancelText:n({id:"popup.deletePost.cancel"}),onAccept:(0,a.Z)(s().mark((function e(){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,x.Cl)((0,x.cN)(h.qf.USER.SUSPEND,{website_url:k,id:t,type:"member"}),"POST");case 2:1===(null===(n=e.sent)||void 0===n?void 0:n.status)?(j({title:"Success",message:"This user was suspended!",type:"success"}),setTimeout((function(){C()}),500)):j({title:"Error",message:"Error",type:"danger"}),S("");case 5:case"end":return e.stop()}}),e)}))),onClose:function(){return S("")}}),(0,o.jsx)(c.o,{shadow:"lg",position:"bottom-end",width:320,styles:{dropdown:{padding:"0.5rem",border:0,boxShadow:"rgba(0, 0, 0, 0.1) 3px 3px 20px",borderRadius:"8px"}},children:function(e){var r=e.opened,s=e.open,a=e.close;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.o.Target,{children:(0,o.jsx)("div",{children:(0,o.jsx)(u.B,{variant:"error",onClick:r?a:s,style:{opacity:.7},leftIcon:(0,o.jsx)(v.Z,{color:"red"})})})}),(0,o.jsx)(c.o.Dropdown,{style:{border:"1px solid red"},children:(0,o.jsx)(y.m,{data:{isShowheader:!1,type:"list",list:(0,i.Z)(t?[{icon:(0,g.k3)("/svg/alert-circle.svg"),label:n({id:"admin.action.suspendAccount"}),onClick:function(){S("suspend")}}]:[])}})})]})}})]})})}},23464:function(e,t,n){"use strict";n.d(t,{o:function(){return Ke},X:function(){return $e}});var o=n(28140),i=n(809),r=n.n(i),s=n(92447),a=n(26265),l=n(85893),d=n(38347),c=n(67294),u=n(94044),p=n(17742),m=n(49738),h=n(91302),v=n(45897),f=n(83129),g=n(27484),x=n.n(g),y=n(79212),b=n.n(y),w=n(37412),C=n.n(w),j=n(36380),P=n.n(j),O=n(11163),S=n(86896),k=n(25559),_=n(2810),N=n(24169),I=n(10917),M=n(22398),Z=n(67128),E=n(38831),D=n(4266),T=n(27740),R=n(36308),L=n(91256),A=L.ZP.div.withConfig({displayName:"indexstyled__StyleSimilarPostContainer",componentId:"sc-1rhtygi-0"})(["display:flex;flex-direction:column;gap:8px;border-radius:8px;background:",";","{border-radius:0;padding:0 16px;}"],(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.white}),R.M.mbDown),B=L.ZP.div.withConfig({displayName:"indexstyled__StyleHeader",componentId:"sc-1rhtygi-1"})(["display:flex;align-items:center;gap:8px;justify-content:space-between;.header-left{display:flex;align-items:center;gap:8px;}.wrapper-icon{display:flex;align-items:center;justify-content:center;border-radius:100%;background:",";width:24px;height:24px;}.arrow-down{cursor:pointer;}"],(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.red50})),z=L.ZP.div.withConfig({displayName:"indexstyled__StyleWrapperCarousel",componentId:"sc-1rhtygi-2"})([""]),U=L.ZP.div.withConfig({displayName:"indexstyled__StyleControllIcon",componentId:"sc-1rhtygi-3"})(["width:100%;height:100%;border-radius:100%;display:flex;justify-content:center;align-items:center;.next-icon{transform:rotate(-90deg);}.previous-icon{transform:rotate(90deg);}*{pointer-events:none;}"]),W=function(e){var t=e.className,n=e.data,o=void 0===n?[]:n,i=(0,S.Z)().formatMessage,r=(0,D.d)(),s=(0,c.useMemo)((function(){return{container:{gap:"12px"},controls:{height:40,padding:0,left:"0",right:"0"},control:{opacity:1,border:0,boxShadow:"none",color:I.r.colors.gray800,fontSize:"16px",width:40,height:40,backgroundColor:I.r.colors.white,fill:I.r.colors.white,filter:"drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.04)) drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.04)) drop-shadow(0px 16px 24px rgba(0, 0, 0, 0.06))","&:hover":{width:40,height:40},"&[data-inactive]":{opacity:"0",cursor:"default"}}}}),[]);return o.length?(0,l.jsxs)(A,{className:t,children:[(0,l.jsx)(B,{children:(0,l.jsx)("div",{className:"header-left",children:(0,l.jsx)(M.T,{size:"p1",color:I.r.colors.gray800,type:"semiBold",children:i({id:"feedBlock.similarPost.heading",defaultMessage:"Similar posts"})})})}),(0,l.jsx)(z,{children:(0,l.jsx)(Z.a,{dragFree:!0,draggable:!0,align:"start",skipSnaps:!0,withControls:!0,initialSlide:0,styles:s,slidesToScroll:r?1:2,nextControlIcon:(0,l.jsx)(U,{"data-event-category":"Together - Similar post","data-event-action":"Carousel Scroll","data-event-label":"Right",children:(0,l.jsx)(E.Z,{className:"next-icon"})}),previousControlIcon:(0,l.jsx)(U,{"data-event-category":"Together - Similar post","data-event-action":"Carousel Scroll","data-event-label":"Left",children:(0,l.jsx)(E.Z,{className:"previous-icon"})}),children:o.map((function(e){var t,n,o="";null!==e&&void 0!==e&&null!==(t=e.community)&&void 0!==t&&t.name&&(o+="".concat(null===e||void 0===e||null===(n=e.community)||void 0===n?void 0:n.name));return null!==e&&void 0!==e&&e.createdTime&&(o+=" \u2022 ".concat(null===e||void 0===e?void 0:e.createdTime)),(0,l.jsx)(T.Z,{post:e,forceTimeText:o,dataEventAction:"Click Post",dataEventCategory:"Together - Similar post",dataEventLabel:e.id},e.id)}))})})]}):null},H=n(85955),V=n(86264),F=n(1821),G=n(21124),Y=n(95983),q=n(5200),J=n(50572),X=n(5886),Q=n(18833),K=n(31474),$=n(43196),ee=n(62714),te=n(42432),ne=n(38120),oe=n(68866),ie=n(32763),re=n(38987),se=n(73669),ae=n(56632),le=L.ZP.div.withConfig({displayName:"indexstyled__StyledSubmitReportForm",componentId:"sc-9n5ih0-0"})(["padding:0 8px;margin-top:18px;.report-list{margin-bottom:18px;.report-item{display:flex;align-items:center;margin-bottom:10px;font-weight:600;& > img{width:12px;height:12px;margin-right:8px;}.__label{font-size:14px;}}}.report-submit{width:100%;}",""],Y.fn?(0,L.iv)(["padding:0 1rem 1rem;"]):""),de=function(e){var t=e.className,n=e.style,o=e.reason,i=e.reasonText,a=e.onClose,d=e.postId,c=(0,S.Z)().formatMessage,u=(0,F.Jn)(),p=u.loading,m=u.onReportPost;return(0,l.jsxs)(le,{className:t,style:n,children:[(0,l.jsx)("ul",{className:"report-list",children:(0,l.jsxs)("li",{className:"report-item",children:[(0,l.jsx)("img",{src:"./svg/icon-alert-circle.svg"}),(0,l.jsx)(M.T,{className:"__label",color:I.r.colors.gray800,size:"p4",children:i})]})}),(0,l.jsx)(ae.j,{className:"report-submit",size:"lg",color:"primary",loading:p,onClick:(0,s.Z)(r().mark((function e(){var t;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,m({id:d,reason:o});case 4:null!==(t=e.sent)&&void 0!==t&&t.data&&a&&a();case 6:case"end":return e.stop()}}),e)}))),children:c({id:"submit"})})]})},ce=n(22028),ue=function(e){var t,n=e.url,o=e.authorEmail,i=e.onDeletePost,a=e.post,d=e.className,u=void 0===d?"":d,p=e.isMobile,m=(0,S.Z)().formatMessage,h=(0,O.useRouter)(),f=h.locale,g=void 0===f?"vi-VN":f,x=h.asPath,y=h.push,b=h.replace,w=(0,c.useContext)(X.I).state.userInfo,C=(0,c.useState)(!1),j=C[0],P=C[1],k=(0,c.useState)(!1),_=k[0],N=k[1],I=(0,G.h0)().authActionWrapper,M=(0,F.fw)().loading,E=null===(t=x.split("?"))||void 0===t?void 0:t[0],D=(0,F.ZL)().onDeletePost,T=o&&(null===w||void 0===w?void 0:w.email)&&o===String(null===w||void 0===w?void 0:w.email);return(0,l.jsxs)(l.Fragment,{children:[_&&(0,l.jsx)(se.T,{isMobile:p,onClose:function(){N(!1),b(E,void 0,{scroll:!1})},editPost:a,onPostSuccess:function(e,t,n){var o,i="action=".concat(n?"editPost":"createPost","&askDoctor=").concat(null!==t&&void 0!==t&&t.isAskDoctor?"true":"false"),r="".concat((0,oe.g)(g)).concat((0,$.k3)("/".concat((null===t||void 0===t||null===(o=t.community)||void 0===o?void 0:o.slug)||"_","/").concat((null===t||void 0===t?void 0:t.slug)||"","/?").concat(i)));y(r)}}),(0,l.jsxs)("div",{className:u,onClick:function(e){e.preventDefault(),e.stopPropagation()},children:[j&&(0,l.jsx)(v.P,{thumbnail:"./svg/delete.svg",isThumbnailIcon:!0,title:m({id:"popup.deletePost.title"}),description:m({id:"popup.deletePost.description"}),acceptText:m({id:"popup.deletePost.accept"}),cancelText:m({id:"popup.deletePost.cancel"}),onAccept:(0,s.Z)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==a&&void 0!==a&&a.id){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,D(a.id);case 4:e.sent&&i&&i();case 6:case"end":return e.stop()}}),e)}))),onClose:function(){return P(!1)}}),(0,l.jsx)(Z.o,{shadow:"lg",position:"bottom-end",width:320,styles:{dropdown:{padding:"0.5rem",border:0,boxShadow:"rgba(0, 0, 0, 0.1) 3px 3px 20px",borderRadius:"8px"}},children:function(e){var t=e.opened,o=e.open,i=e.close;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Z.o.Target,{children:(0,l.jsx)("div",{onClick:t?i:o,children:(0,l.jsx)(ie.B,{variant:"white",styles:{root:{cursor:"pointer"}},loading:M,leftIcon:(0,l.jsx)(re.Z,{})})})}),(0,l.jsx)(Z.o.Dropdown,{children:(0,l.jsx)(ce.m,{data:T?{isShowheader:!1,type:"list",list:[{icon:(0,$.k3)("/svg/icon-tab-edit-2.svg"),label:m({id:"actionPopover.edit"}),onClick:function(){I((function(){a&&N(!0)}))}},{icon:(0,$.k3)("/svg/icon-trash-bin.svg"),label:m({id:"actionPopover.delete"}),onClick:function(){I((function(){P(!0)}))}}]}:{isShowheader:!1,type:"list",list:[{icon:(0,$.k3)("/svg/icon-alert-circle.svg"),label:m({id:"morePopover.report"}),subTree:{title:m({id:"morePopover.report.title"}),description:m({id:"morePopover.report.description"}),isShowheader:!0,type:"list",list:Object.keys(Y.$4).map((function(e){return{label:Y.$4[e].label,reason:Y.$4[e].reportReasonText,reasonValue:e}})).map((function(e){return{label:m({id:e.label}),subTree:{title:m({id:"morePopover.reportSubmit.title"}),description:m({id:"morePopover.reportSubmit.description"}),isShowheader:!0,type:"jsx",jsxRenderer:function(t){return(0,l.jsx)(de,{reason:e.reasonValue,reasonText:m({id:e.reason}),postId:null===a||void 0===a?void 0:a.id,onClose:function(){return t&&t(!1)}})}}}}))},dataEventCategory:Y.UN,dataEventAction:"Report Post",dataEventLabel:n}]}})})]})}})]})]})};function pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function me(e){for(var t=1;t div:first-child{margin-left:16px;margin-right:16px;}}}.link-info-container{padding:0.5rem 1rem;background:#f4faff;}.link-image-wrapper{position:relative;overflow:hidden;width:100%;padding-top:56.25%;&.fetching{background:lightgray;}.loading-spinner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);}.link-image{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;object-position:center;}}"],R.M.mbDown),De=L.ZP.div.withConfig({displayName:"indexstyled__StyledWrapper",componentId:"sc-hxidb5-13"})(["background:white;border-radius:inherit;"]),Te=L.ZP.div.withConfig({displayName:"indexstyled__StyledPostContentWrapper",componentId:"sc-hxidb5-14"})(["position:relative;"]),Re=L.ZP.div.withConfig({displayName:"indexstyled__StyledPostContentLinkWrapper",componentId:"sc-hxidb5-15"})([""]),Le=L.ZP.a.withConfig({displayName:"indexstyled__StyledLinkOverlay",componentId:"sc-hxidb5-16"})(["position:absolute;top:0;left:0;right:0;bottom:0;"]),Ae=(0,L.ZP)(we.S).withConfig({displayName:"indexstyled__StyledSkipQuestionOfExpertBtn",componentId:"sc-hxidb5-17"})(["display:inline-block;font-size:12px;line-height:18px;font-weight:600;border:1px solid ",";padding:3px 8px;border-radius:2px;margin-right:5px;cursor:pointer;"],I.r.colors.neutral200),Be=L.ZP.div.withConfig({displayName:"indexstyled__StyledEventInfo",componentId:"sc-hxidb5-18"})(["padding:16px;background:",";display:flex;flex-direction:column;gap:8px;align-items:flex-start;","{padding:16px 24px;flex-direction:row;justify-content:space-between;align-items:center;}"],(function(e){return e.bgColor}),R.M.mbUp),ze=L.ZP.div.withConfig({displayName:"indexstyled__StyledEventHeader",componentId:"sc-hxidb5-19"})([""]),Ue=L.ZP.div.withConfig({displayName:"indexstyled__StyledEventDateBox",componentId:"sc-hxidb5-20"})(["background:white;border-radius:8px;padding:5px 12px;white-space:nowrap;","{border-radius:4px;.event-date{display:flex;gap:12px;}}.event-row{display:flex;justify-content:space-between;gap:8px;","{}}"],R.M.mbDown,R.M.mbUp),We=L.ZP.div.withConfig({displayName:"indexstyled__StyledEventDateWrapper",componentId:"sc-hxidb5-21"})(["","{order:2;}"],R.M.mbUp),He=L.ZP.div.withConfig({displayName:"indexstyled__StyledEventDateBoxDetail",componentId:"sc-hxidb5-22"})(["border:1px solid ",";border-radius:4px;display:inline-block;padding:3px 8px;margin:12px 0 11px;align-self:flex-start;.event-date{display:flex;gap:12px;}.event-row{display:flex;gap:4px;}"],I.r.colors.neutral100),Ve=(L.ZP.div.withConfig({displayName:"indexstyled__StyledExpiredTag",componentId:"sc-hxidb5-23"})([""]),L.ZP.div.withConfig({displayName:"indexstyled__StyledHeadingOnDetail",componentId:"sc-hxidb5-24"})(["line-height:32px;h1{display:inline-block;margin-right:8px;}"])),Fe=L.ZP.a.withConfig({displayName:"indexstyled__StyledMiniGamePostContent",componentId:"sc-hxidb5-25"})(["text-decoration:none;color:inherit;*{pointer-events:none;}"]),Ge=L.ZP.div.withConfig({displayName:"indexstyled__StyleReferenceArticle",componentId:"sc-hxidb5-26"})(["display:flex;padding:12px 16px 12px 12px;align-items:center;gap:16px;border-bottom:1px solid ",";background:",";gap:16px;","{align-items:flex-start;}.article-image{width:64px;height:64px;border-radius:4px;}.article-info{flex:1;display:flex;flex-direction:column;gap:6px;.article-info-title{color:",";font-size:16px;font-weight:600;line-height:26px;}.article-info-subtitle{color:",";font-size:12px;font-weight:400;line-height:18px;}}.article-link{width:32px;height:32px;background:",";border-radius:100%;align-items:center;justify-content:center;display:flex;cursor:pointer;","{display:none;}}"],I.r.colors.neutral100,I.r.colors.neutral50,R.M.mbDown,I.r.colors.gray800,I.r.colors.gray600,I.r.colors.white,R.M.mbDown),Ye=L.ZP.div.withConfig({displayName:"indexstyled__StyleMoreComment",componentId:"sc-hxidb5-27"})(["padding:0 16px 16px 68px;","{padding:0 16px 16px 52px;}"],R.M.mbDown),qe=L.ZP.div.withConfig({displayName:"indexstyled__StyleMoreCommentBtn",componentId:"sc-hxidb5-28"})(["display:flex;align-item:center;cursor:pointer;gap:8px;color:",";font-size:14px;font-weight:600;line-height:22px;"],I.r.colors.primaryBase),Je=(0,n(44036).k)((function(e){return{expiredTag:{background:e.colors.red[0],borderRadius:"4px",padding:"5px 12px",whiteSpace:"nowrap"}}}));function Xe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Qe(e){for(var t=1;t2||2===ie&&Tt.every((function(e){return"chatbot"!==e.type}))}),[Tt,ie]);(0,c.useEffect)((function(){Nt||It(!0)}),[Ht]),(0,c.useEffect)((function(){It(ve)}),[ve]),(0,c.useEffect)((function(){Nt&&At(!1)}),[Nt]);var Ft="".concat((0,$.k3)("/".concat((null===E||void 0===E?void 0:E.slug)||"_","/").concat(M||"","/"))),Gt="".concat((0,N.mg)(ct)).concat(Ft),Yt=(null===Z||void 0===Z?void 0:Z.name)||(null===Z||void 0===Z?void 0:Z.username)||"",qt=(null===Z||void 0===Z?void 0:Z.username)||(null===Z||void 0===Z?void 0:Z.name)||"",Jt=null===Z||void 0===Z?void 0:Z.avatar,Xt=null!==pe&&void 0!==pe&&pe.isAnonymous||null===Z||void 0===Z?void 0:Z.role;(0,c.useEffect)((function(){"#comment"!==window.location.hash&&"comment"!==(null===pt||void 0===pt?void 0:pt.action)||!bt||(It(!0),setTimeout((function(){if(null!==kt&&void 0!==kt&&kt.current){var e=kt.current.getBoundingClientRect().top+window.scrollY-80;window.scrollTo({top:e,behavior:"smooth"})}}),1e3),setTimeout((function(){var e;null===St||void 0===St||null===(e=St.current)||void 0===e||e.focusEditor()}),1500))}),[ut,bt]),(0,c.useEffect)((function(){Rt(me||[])}),[me]);var Qt=(0,c.useState)(!1),Kt=Qt[0],$t=Qt[1];(0,c.useEffect)((function(){$t(Boolean(Y.MN.includes(Y.Vi.NEXT_PUBLIC_DEPLOY_LOCALE||"")&&Y.vA.includes((null===yt||void 0===yt?void 0:yt.role)||"")&&be&&"expert"===(null===yt||void 0===yt?void 0:yt.role)&&(null===pe||void 0===pe?void 0:pe.isAskDoctor)&&!(null!==pe&&void 0!==pe&&pe.isReply)&&!(null!==pe&&void 0!==pe&&pe.isIgnoredQuestion)))}),[yt,pe]);var en=x()(),tn=x()(null===pe||void 0===pe?void 0:pe.eventEnd),nn=(null===pe||void 0===pe?void 0:pe.isMinigame)&&tn.isBefore(en,"dates"),on=b&&(0,l.jsx)(u.H,{as:C,tag:"h5",fontWeight:"bold","data-testid":"Title of the Post",children:P()(b)}),rn=nn?(0,l.jsx)(f.T,{size:"p4",as:"span",className:Pt.expiredTag,color:jt.colors.red[9],children:at({id:"cardPost.expired",defaultMessage:"Expired"})}):null,sn=(0,l.jsxs)(ke,{isDisable:nn,style:{marginTop:null!==pe&&void 0!==pe&&pe.isMinigame?0:null!==R&&void 0!==R&&R.length||null!==pe&&void 0!==pe&&pe.introUrl||null!==L&&void 0!==L&&L.url?"16px":0},children:[null!==pe&&void 0!==pe&&pe.introUrl?(0,l.jsx)("div",{children:(0,l.jsx)("div",{className:"social-preview-wrapper ".concat(null!==R&&void 0!==R&&R.length?"has-image":""),children:(0,l.jsx)(p.S,{url:pe.introUrl,image:pe.bannerImage})})},"social-preview"):null,null!==R&&void 0!==R&&R.length?(0,l.jsx)("div",{children:(0,l.jsx)("div",{className:"image-preview-wrapper","data-sensitive":Boolean(null===pe||void 0===pe?void 0:pe.isSensitive),children:(0,l.jsx)(m.a,{images:R,authorName:null===Z||void 0===Z?void 0:Z.name,isSensitive:Boolean(null===pe||void 0===pe?void 0:pe.isSensitive),alt:null===pe||void 0===pe?void 0:pe.title})})},"image-preview"):null,null!==pe&&void 0!==pe&&pe.introUrl||null!==R&&void 0!==R&&R.length||null===L||void 0===L||!L.url?null:(0,l.jsx)("div",{children:(0,l.jsx)("div",{className:"link-preview-wrapper",children:(0,l.jsx)(h.C,{title:L.title,url:L.url,image:L.image})})},"link-preview")]}),an=(null===pe||void 0===pe?void 0:pe.eventStart)&&(null===pe||void 0===pe?void 0:pe.eventEnd)&&(0,l.jsxs)("div",{className:"event-date",children:[(0,l.jsxs)("div",{className:"event-row",children:[(0,l.jsx)(f.T,{size:"p4",as:"span",color:null===(t=Ot.neutral)||void 0===t?void 0:t[6],children:at({id:"cardPost.startDate",defaultMessage:"Start date"})}),(0,l.jsx)(f.T,{size:"s4",weight:"semiBold",as:"span",color:jt.colors.gray[7],children:x()(pe.eventStart).format("DD/MM/YYYY")})]}),(0,l.jsxs)("div",{className:"event-row",children:[(0,l.jsx)(f.T,{size:"p4",as:"span",color:null===(n=Ot.neutral)||void 0===n?void 0:n[6],children:at({id:"cardPost.endDate",defaultMessage:"End date"})}),(0,l.jsx)(f.T,{size:"s4",weight:"semiBold",as:"span",color:jt.colors.gray[7],children:x()(pe.eventEnd).format("DD/MM/YYYY")})]})]}),ln=(0,c.useMemo)((function(){return ct===q.MV.Vietnam&&"suc-khoe-tinh-than"===(null===E||void 0===E?void 0:E.slug)}),[null===E||void 0===E?void 0:E.slug,ct]),dn=(0,l.jsx)(Ne,{children:I&&I.length>0?(0,l.jsx)(_e,{topics:I,className:"post-topics",shortenedStyle:!0,locale:ct}):null},"tag-topic"),cn=(0,l.jsx)(Ie,{trackingCategory:Y.UN,url:Gt,className:"post-content-wrapper",description:A,disableShortenContent:de,mentions:null===pe||void 0===pe?void 0:pe.mentions,"data-testid":"Content of the Post",maxChars:null!==pe&&void 0!==pe&&pe.isMinigame?350:1e3,onClickCreatePostLink:function(){Bt((function(){vt({type:J.H.SHOW_CREATE_NEW_POST_POPUP,payload:!0})}),{action:"create-post"})}},String((null===yt||void 0===yt?void 0:yt.id)||(null===pe||void 0===pe?void 0:pe.id))),un={post:pe,onSkip:function(){vt({type:J.H.DECREASE_QUESTION_FOR_EXPERT}),$t(!1)}};return(0,l.jsxs)(G.Mv,{defaultParams:null!==E&&void 0!==E&&E.slug?{_joinCommunityIds:[E.id],_joinTopicIds:null===I||void 0===I?void 0:I.map((function(e){return e.id})),_location:"/".concat(E.slug,"/").concat(M)}:void 0,children:[Zt&&(0,l.jsx)(v.S,{url:Gt,trackingCategory:Y.UN,avatar:Y.YS,text:b,onClose:function(){return Et(!1)}}),(0,l.jsxs)(De,Qe(Qe({className:g,style:y},rt),{},{children:[(0,l.jsxs)(Ee,{children:[(0,l.jsxs)(Pe,{children:[(0,l.jsxs)(Oe,{authorProps:{isAnonymous:null===pe||void 0===pe?void 0:pe.isAnonymous,avatar:Jt,name:Yt,username:qt,url:(null===Z||void 0===Z?void 0:Z.email)===(null===yt||void 0===yt?void 0:yt.email)?st+_.D9.GET_PROFILE:"",email:null===Z||void 0===Z?void 0:Z.email,timeText:null===pe||void 0===pe?void 0:pe.createdTime,time:(null===pe||void 0===pe?void 0:pe.scheduleDate)||(null===pe||void 0===pe?void 0:pe.createdDate)||T,community:E,className:"post-author with-popover",role:Xt,title:null===Z||void 0===Z?void 0:Z.title,userId:null===Z||void 0===Z?void 0:Z.id,expertId:null===pe||void 0===pe||null===(i=pe.author)||void 0===i?void 0:i.partnerId,organisation:null===Z||void 0===Z?void 0:Z.organisation,specialty:null===Z||void 0===Z?void 0:Z.specialty,doctorId:null===Z||void 0===Z?void 0:Z.doctorId,hospitalId:null===Z||void 0===Z?void 0:Z.hospitalId,dataEventCategory:Y.UN,dataEventAction:"Writer Profile Click",dataEventLabel:(0,N.Ow)(ct,ut),"data-testid":"name",showDetailPopup:!0},children:[k&&(0,l.jsx)(je,{children:(0,l.jsx)("img",{alt:"",className:"label-sort-pin-icon",src:(0,$.k3)("/svg/icon-pin-yellow.svg")})}),(null===pe||void 0===pe?void 0:pe.id)&&(null===(a=pe.author)||void 0===a?void 0:a.id)&&wt&&(0,l.jsx)(ne.Z,{authorId:pe.author.id}),(0,l.jsx)(ue,{url:Gt,authorEmail:String(null===Z||void 0===Z?void 0:Z.email),onDeletePost:ce,shareUrl:Gt,post:pe,isMobile:xe,className:"popover"})]}),Kt&&(0,l.jsx)("div",{children:(0,l.jsx)(Ae,Qe({},un))}),!(null!==pe&&void 0!==pe&&pe.isMinigame)&&(0,l.jsxs)(Te,{children:[(0,l.jsxs)(Re,{className:"post-content-link-wrapper",children:[on,cn]}),ye&&!le&&(0,l.jsx)(Le,Qe({href:Gt},{"data-even-category":Y.UN,"data-even-action":"Click Post","data-event-label":Gt}))]})]}),!(null!==pe&&void 0!==pe&&pe.isMinigame)&&dn,(0,l.jsxs)("div",{children:[sn,(null===pe||void 0===pe?void 0:pe.isMinigame)&&we&&(0,l.jsxs)(Pe,{children:[!nn&&(0,l.jsx)(He,{children:an}),(0,l.jsxs)(Ve,{children:[on," ",nn&&rn]}),cn]}),(null===pe||void 0===pe?void 0:pe.isMinigame)&&!we&&(0,l.jsxs)(Fe,Qe(Qe({href:Gt},{"data-even-category":Y.UN,"data-even-action":"Click Post","data-event-label":Gt}),{},{onClick:function(){window.location.href=Gt},children:[(0,l.jsxs)(Be,{bgColor:Ot[jt.primaryColor][0],children:[(0,l.jsx)(We,{children:nn?rn:pe.eventStart&&pe.eventEnd&&(0,l.jsx)(Ue,{children:an})}),(0,l.jsx)(ze,{children:on})]}),(0,l.jsx)(Pe,{children:cn}),dn]}))]}),(0,l.jsxs)(Ge,{style:{display:"none"},children:[(0,l.jsx)("div",{className:"article-image"}),(0,l.jsxs)("div",{className:"article-info",children:[(0,l.jsx)("div",{className:"article-info-title",children:"Vitamin B6: Gi\u1ea3i ph\xe1p m\u1edbi gi\xfap gi\u1ea3m tri\u1ec7u ch\u1ee9ng \u1ed1m ngh\xe9n"}),(0,l.jsx)("div",{className:"article-info-subtitle",children:"Tham v\u1ea5n y khoa BS. Nguy\u1ec5n Tr\u01b0\u1eddng Thanh \u2022 4 tu\u1ea7n tr\u01b0\u1edbc"})]}),(0,l.jsx)("div",{className:"article-link",children:(0,l.jsx)("img",{src:(0,$.k3)("/svg/general.svg"),className:"info-text-icon",alt:""})})]}),(0,l.jsxs)(Pe,{className:"padding-card-reactions",children:[(0,l.jsx)(Se,{trackingCategory:Y.UN,trackingLabel:Gt,type:ee.w.post,viewCount:z||void 0,loveCount:B,replyCount:ie,hasShare:!0,isSaved:(null===pe||void 0===pe?void 0:pe.bookmarked)||!1,hasActionStatistical:$e,className:"post-reaction ".concat(null!==R&&void 0!==R&&R.length||null!==L&&void 0!==L&&L.url?"hide-top-border":""),liked:Ut?!U:U,onCommentClick:function(){Bt((function(){re?re():It((function(e){return!e}))}),null!==E&&void 0!==E&&E.slug?{_location:"/".concat(E.slug,"/").concat(M),action:"comment"}:{action:"comment"})},onCommentCountClick:function(){Bt((function(){Y.fn?It(!0):se?se():window.location.href=Ft}),{action:"comment"})},onShareClick:function(){Et(!0)},onLikeClick:function(){return j&&Wt({id:j,isLike:!U})},onSaveClick:function(){Bt((0,s.Z)(r().mark((function e(){var t,n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==yt&&void 0!==yt&&yt.id&&null!==pe&&void 0!==pe&&pe.id){e.next=2;break}return e.abrupt("return");case 2:if(null===pe||void 0===pe||!pe.bookmarked){e.next=9;break}return e.next=5,(0,N.cA)((0,N.cN)(_.yy.BOOKMARK.DELETE,{_locale:ct}),"DELETE",{data:{post_id:String(pe.id)}});case 5:1===(null===(t=e.sent)||void 0===t?void 0:t.status)?(ft({title:"",message:"Removed saved post",type:"success",displayIcon:(0,$.k3)("/svg/icon-bookmark.svg")}),gt({type:K.t.update,payload:{id:pe.id,data:{bookmarked:!1}}})):ft({title:"",message:"Remove failed",type:"danger",displayIcon:(0,$.k3)("/svg/icon-bookmark.svg")}),e.next=13;break;case 9:return e.next=11,(0,N.cA)((0,N.cN)(_.yy.BOOKMARK.CREATE,{_locale:ct}),"POST",{data:{user_id:yt._togetherUserId||yt.id,post_id:pe.id}});case 11:1===(null===(n=e.sent)||void 0===n?void 0:n.status)?(ft({title:"",message:"Post saved",type:"success",displayIcon:(0,$.k3)("/svg/icon-bookmark-fill.svg")}),gt({type:K.t.update,payload:{id:pe.id,data:{bookmarked:!0}}})):ft({title:"",message:"Post saved failed",type:"danger",displayIcon:(0,$.k3)("/svg/icon-bookmark.svg")});case 13:case"end":return e.stop()}}),e)}))),{action:"save-post"})},onGoToUrl:function(e){var t=e?"".concat(Gt).concat(e):Gt;bt?window.location.href=t:Bt((function(){return window.location.href=t}))}}),ln&&(0,l.jsx)(ge,{}),tt&&(0,l.jsx)(W,{data:ot}),Nt&&(0,l.jsx)("div",{className:"wrapper-input-comment",ref:kt,children:(0,l.jsx)(Ze,{children:(0,l.jsx)(H.z,{ref:St,isMobile:xe,isMainCmt:!ve,onClose:function(){return It(!1)},onPostSuccess:function(e){null===ae||void 0===ae||ae(e),It(!1)},post:pe,btnProps:{dataEventCategory:Y.UN,dataEventAction:"Submit Comment",dataEventLabel:Gt},expandPopupProps:{heading:at({id:"cardReactions.comment",defaultMessage:"Comment"}),note:at({id:"cardPost.inputComment.note",defaultMessage:"Comment on {title}"},{title:"#".concat(null===pe||void 0===pe?void 0:pe.title,"")})},hasCreatePost:"moderator"===(null===yt||void 0===yt?void 0:yt.role)})})})]})]}),null===Tt||void 0===Tt?void 0:Tt.map((function(e,t){return(0,l.jsx)(Me,{className:"most-engaging-wrapper",children:(0,l.jsx)(te.M,{isMobile:xe,post:pe,isAnonymous:null===e||void 0===e?void 0:e.isAnonymous,comment:e,onDeleteComment:function(){he&&he(e)},onOpenEditInput:function(){At(!0)},onEditCommentSuccess:function(e){var n=(0,o.Z)(Tt);n[t]=e,Rt(n),At(!1)},className:"most-engaging-comment",type:"most-engaging",goToUrl:"/".concat((null===E||void 0===E?void 0:E.slug)||"_","/").concat(M),pageType:it})},e.id)})),fe,Xe&&Vt&&(0,l.jsx)(Ye,{children:(0,l.jsxs)(qe,{onClick:function(){bt?window.location.href=Gt:Bt((function(){return window.location.href=Gt}))},children:[at({id:"post.viewMoreComments",defaultMessage:"View more comments"}),(0,l.jsx)("img",{src:(0,$.k3)("/svg/chevronRightBlue.svg"),alt:""})]})})]}))]})},$e=function(e){var t=e.id,n=e.post,o=e.isMobile,i=(0,d.Z)(e,["id","post","isMobile"]),a=(0,O.useRouter)().locale,u=void 0===a?"vi-VN":a,p=(0,c.useState)([]),m=p[0],h=p[1],v=(0,c.useState)((null===n||void 0===n?void 0:n.commentCount)||0),f=v[0],g=v[1];(0,c.useEffect)((function(){(0,s.Z)(r().mark((function e(){var n,o,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t||!f){e.next=5;break}return e.next=3,(0,N.Jl)((0,N.cN)(_.yy.COMMENT.LIST,{postId:t,_locale:u,sort:"DESC",sortByExpert:1,withoutReply:1}),"GET");case 3:i=e.sent,h((null===i||void 0===i||null===(n=i.data)||void 0===n||null===(o=n.comments)||void 0===o?void 0:o.map(k.ec))||[]);case 5:case"end":return e.stop()}}),e)})))()}),[t,u,f]);return(0,l.jsx)(Ke,Qe({id:t,commentCount:f,isReplied:null===n||void 0===n?void 0:n.commented,onPostCommentSuccess:function(){g(f+1)},displayComment:m,onDeleteComment:function(){g(f-1)},post:n,isMobile:o,titleAs:"h5"},i))}},42432:function(e,t,n){"use strict";n.d(t,{M:function(){return Ee}});var o=n(85893),i=n(809),r=n.n(i),s=n(92447),a=n(28140),l=n(26265),d=n(32292),c=n(67294),u=n(10917),p=n(61683),m=n(49738),h=n(91302),v=n(57425),f=n(83129),g=n(35022),x=n(76804),y=n(88547),b=n(31040),w=n(19827),C=n(91938),j=n(2566),P=n(91759),O=n(5152),S=n(97762),k=n(86896),_=n(2810),N=n(91720),I=n(24169),M=n(62714),Z=n(40875),E=n(68558),D=n(85955),T=n(21124),R=n(26381),L=n(95983),A=3,B=n(50572),z=n(5886),U=n(43196),W=n(74467),H=n(13199),V=n(38120),F=n(45897),G=n(67128),Y=n(32763),q=n(11163),J=n(38987),X=n(22028),Q=function(e){var t=e.onDeleteComment,n=e.commentId,i=e.className,a=void 0===i?"":i,l=e.popoverClassName,d=void 0===l?"":l,u=e.onEditComment,p=(0,q.useRouter)().locale,m=void 0===p?"vi-VN":p,h=(0,k.Z)().formatMessage,v=(0,c.useContext)(z.I).pushNotifications,f=(0,c.useState)(!1),g=f[0],x=f[1],y=(0,T.h0)().authActionWrapper;return(0,o.jsxs)("div",{className:a,onClick:function(e){e.preventDefault(),e.stopPropagation()},children:[g&&(0,o.jsx)(F.P,{thumbnail:"./svg/delete.svg",isThumbnailIcon:!0,title:h({id:"popup.deleteComment.title"}),description:h({id:"popup.deleteComment.description"}),acceptText:h({id:"popup.deletePost.accept"}),cancelText:h({id:"popup.deletePost.cancel"}),onAccept:(0,s.Z)(r().mark((function e(){var o,i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,(0,W.YF)({id:n,locale:m});case 4:1===(null===(o=e.sent)||void 0===o?void 0:o.status)?(null===t||void 0===t||t(),v({title:"",message:h({id:"notification.success"}),type:"success"})):v({title:"",message:h({id:(null===o||void 0===o||null===(i=o.messages)||void 0===i?void 0:i[0])||"notification.failure"}),type:"danger"});case 6:case"end":return e.stop()}}),e)}))),onClose:function(){return x(!1)}}),(0,o.jsx)("div",{className:d,children:(0,o.jsx)(G.o,{shadow:"lg",position:"bottom-end",width:320,styles:{dropdown:{padding:"0.5rem",border:0,boxShadow:"rgba(0, 0, 0, 0.1) 3px 3px 20px",borderRadius:"8px"}},children:function(e){var t=e.opened,n=e.open,i=e.close;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(G.o.Target,{children:(0,o.jsx)("div",{onClick:t?i:n,children:(0,o.jsx)(Y.B,{variant:"white",styles:{root:{cursor:"pointer"}},leftIcon:(0,o.jsx)(J.Z,{})})})}),(0,o.jsx)(G.o.Dropdown,{children:(0,o.jsx)(X.m,{data:{isShowheader:!1,type:"list",list:[{icon:(0,U.k3)("/svg/icon-tab-edit-2.svg"),label:h({id:"actionPopover.edit"}),onClick:function(){y((function(){null===u||void 0===u||u()}))}},{icon:"./svg/icon-trash-bin.svg",label:h({id:"actionPopover.delete"}),onClick:function(){y((function(){x(!0)}))}}]}})})]})}})})]})},K=n(94044),$=n(75009),ee=n(43125),te=n(8981),ne=n(9713),oe=n(25559),ie=(0,n(44036).k)((function(e){return{root:(0,l.Z)({display:"flex",flexDirection:"column",gap:"8px",padding:"20px 0 0"},e.fn.largerThan("md"),{padding:"32px 0 0"}),successBox:{display:"flex",flexDirection:"column",alignItems:"center"},successContent:{display:"flex",flexDirection:"column",alignItems:"center",gap:"24px",marginTop:"-5px"},successBtn:{minWidth:"165px"},submitActions:(0,l.Z)({},e.fn.largerThan("md"),{marginTop:"20px",display:"flex",justifyContent:"flex-end"}),submitBtn:(0,l.Z)({width:"100%"},e.fn.largerThan("md"),{minWidth:"100px",width:"auto"})}}));function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function se(e){for(var t=1;t ../../organisms/cardReply/verifyActions"]}}),Ee=function e(t){var n,i,l,O,F,G,Y,q,J,X,K,$,ee,te,ne,oe,ie,re,se,le,de,ce=t.className,ue=t.style,pe=t.comment,me=t.type,he=void 0===me?"comment":me,Ie=t.level,Ee=void 0===Ie?0:Ie,De=t.replyingId,Te=t.isCommentDetail,Re=t.onPostCommentSuccess,Le=t.onEditCommentSuccess,Ae=t.onOpenEditInput,Be=t.post,ze=t.onDeleteComment,Ue=t.onDeleteReply,We=t.refetchComment,He=t.isMobile,Ve=t.goToUrl,Fe=t.showCurlBorder,Ge=t.borderColor,Ye=void 0===Ge?u.r.colors.neutral100:Ge,qe=t.onOpposeSuccess,Je=t.maxChars,Xe=void 0===Je?200:Je,Qe=t.disableShortenContent,Ke=(t.isAnonymous,t.enableEndorse),$e=void 0===Ke||Ke,et=t.hasCreatePost,tt=t.hasBindCreatePost,nt=t.pageType,ot=(0,w.rZ)(),it=L.Vi.NEXT_PUBLIC_SSO,rt=(0,k.Z)().formatMessage,st=(0,c.useState)(pe||null),at=st[0],lt=st[1],dt=(0,c.useState)(!1),ct=dt[0],ut=dt[1],pt=(0,c.useState)(!1),mt=pt[0],ht=pt[1],vt=(0,c.useState)(!1),ft=vt[0],gt=vt[1],xt=(0,P.q)(!1),yt=(0,d.Z)(xt,2),bt=yt[0],wt=yt[1],Ct=wt.open,jt=wt.close,Pt=(0,c.useState)(null===at||void 0===at?void 0:at.isFeedback),Ot=Pt[0],St=Pt[1],kt=(0,c.useRef)(null),_t=(0,c.useRef)(null);(0,c.useEffect)((function(){lt(pe),St(null===pe||void 0===pe?void 0:pe.isFeedback)}),[pe]),(0,c.useEffect)((function(){ft&&(null===Ae||void 0===Ae||Ae())}),[ft]),(0,c.useEffect)((function(){mt&&kt.current&&kt.current.getBoundingClientRect().bottom>window.innerHeight&&setTimeout((function(){return kt.current&&Nt(null===kt||void 0===kt?void 0:kt.current)}),100)}),[mt]),(0,c.useEffect)((function(){ft&&_t.current&&_t.current.getBoundingClientRect().bottom>window.innerHeight&&setTimeout((function(){return _t.current&&Nt(null===_t||void 0===_t?void 0:_t.current)}),100)}),[ft]);var Nt=function(e){return kt&&window.scrollTo({top:window.scrollY+e.getBoundingClientRect().bottom+30-window.innerHeight,behavior:"smooth"})},It=at.id,Mt=at.countLikes,Zt=at.content,Et=at.replies,Dt=at.images,Tt=void 0===Dt?[]:Dt,Rt=at.author,Lt=at.liked,At=at.link,Bt=at.mentionedUser,zt=at.mentions,Ut=(0,W.yD)(Zt),Wt=Ut.text,Ht=Ut.replyingTo,Vt=(0,R.h)(),Ft=Vt.locale,Gt=(Vt.asPath,(0,c.useContext)(z.I)),Yt=Gt.state,qt=Gt.dispatch,Jt=Yt.userInfo,Xt=Yt.isLoggedIn,Qt=Yt.isAdmin,Kt=null===Be||void 0===Be||null===(n=Be.community)||void 0===n?void 0:n.slug,$t="/".concat(Kt,"/").concat(null===Be||void 0===Be?void 0:Be.slug,"/"),en=(0,I.Rm)(Ft),tn=(0,T.h0)(Kt?{_joinCommunityIds:[null===Be||void 0===Be||null===(i=Be.community)||void 0===i?void 0:i.id],_joinTopicIds:null===Be||void 0===Be||null===(l=Be.topics)||void 0===l?void 0:l.map((function(e){return e.id})),_location:$t}:void 0).authActionWrapper,nn=(0,c.useRef)(null),on=(0,c.useState)(4),rn=on[0],sn=on[1],an=!(null===Jt||void 0===Jt||!Jt.id)&&Et.some((function(e){return e.author.id===Jt.id})),ln=!!Ve&&"".concat((0,I.mg)(Ft)).concat(L.GW).concat(Ve,"/"),dn=function(e){lt((function(t){if(!t.replies.find((function(t){return t.id===e.id}))){t.replies.unshift(e);var n=Me(Me({},t),{},{replies:t.replies.slice(),countReplies:t.countReplies+1});return null===We||void 0===We||We(n),n}return t}))},cn=(0,c.useMemo)((function(){return"comment"===he&&Et&&0!=Et.length?Et.sort((function(e,t){var n=new Date(e.createdAt).getTime(),o=new Date(t.createdAt).getTime();return n>o?-1:n@'.concat((null===Rt||void 0===Rt?void 0:Rt.name)||"","")})},hasCreatePost:et},"input-comment-"+at.id)}),Pn=(0,o.jsx)(fe,{children:(0,o.jsx)(D.z,{colLeftWidth:He?34:void 0,isMobile:He,ref:nn,onClose:function(){return gt(!1)},onPostSuccess:function(e){gt(!1),Le&&Le(e)},onPopupClose:function(){return gt(!1)},post:Be,isEdit:!0,isReply:!!Ee,commentId:null===at||void 0===at?void 0:at.id,imageFiles:(null===at||void 0===at?void 0:at.images)||[],isAnonymous:null===at||void 0===at?void 0:at.isAnonymous,hideReplyMentionsInText:(null===at||void 0===at?void 0:at.isAnonymous)||mn,hasCreatePost:et},"edit-"+(null===at||void 0===at?void 0:at.id))}),On=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(y.Z,{size:20,isMarryBaby:L.fn,isSolid:Xt?Lt:Mt>0,color:L.fn?u.r.mbColors.pink:u.r.colors.red800}),(0,o.jsx)("span",{className:"count-txt",children:Mt})]}),Sn={trackingCategory:L.UN,trackingLabel:(0,I.mg)(Ft)+$t,type:M.w.reply,loveCount:Mt,replyCount:un,className:"post-reaction",liked:Lt,isReplied:!an,hasShare:!1,onCommentClick:function(){return tn((function(){ht((function(e){return!e}))}),{action:"reply-comment"})},onCommentCountClick:function(){return tn((function(){ht(!0)}),{action:"reply-comment"})},onLikeClick:function(){return tn((0,s.Z)(r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,W.DX)({commentId:It,setLike:!Lt,locale:Ft});case 2:1===e.sent.status&<((function(e){return Me(Me({},e),{},{liked:!Lt,countLikes:e.countLikes+(Lt?-1:1)})}));case 4:case"end":return e.stop()}}),e)}))),{action:"like-comment"})}},kn=(0,S.renderToString)((0,o.jsx)(x.Markdown,{children:(0,U.lM)(Wt)}));return(0,o.jsxs)(T.Mv,{defaultParams:Kt?{_joinCommunityIds:[null===Be||void 0===Be||null===(q=Be.community)||void 0===q?void 0:q.id],_joinTopicIds:null===Be||void 0===Be||null===(J=Be.topics)||void 0===J?void 0:J.map((function(e){return e.id})),_location:"/".concat(Kt,"/").concat(null===Be||void 0===Be?void 0:Be.slug)}:void 0,children:[(0,o.jsxs)(Se,{borderColor:Cn,"data-is-expert-card":bn,className:ce,style:ue,"data-is-reply":!!Ee,children:[(0,o.jsxs)(je,{borderColor:Cn,isParent:Et.length>0,hasEditOpen:ft,children:[ft?(0,o.jsx)(ke,{borderColor:Cn,ref:_t,children:Pn}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(Oe,{borderColor:Cn,"data-show-curl-border":Fe,className:"".concat(wn?"bot-card":""),authorProps:{isAnonymous:(null===at||void 0===at?void 0:at.isAnonymous)||Boolean(mn),avatar:vn,name:hn,username:fn,className:"post-author ".concat(pn?"with-popover":""," ").concat(bn?"expert-card":"user-card"),userType:null===Rt||void 0===Rt?void 0:Rt.type,title:null===Rt||void 0===Rt?void 0:Rt.title,userId:null===Rt||void 0===Rt?void 0:Rt.id,role:null===Rt||void 0===Rt?void 0:Rt.role,expertId:null===Rt||void 0===Rt?void 0:Rt.partnerId,organisation:null===Rt||void 0===Rt?void 0:Rt.organisation,specialty:null===Rt||void 0===Rt?void 0:Rt.specialty,doctorId:null===Rt||void 0===Rt?void 0:Rt.doctorId,hospitalId:null===Rt||void 0===Rt?void 0:Rt.hospitalId,url:(null===Rt||void 0===Rt?void 0:Rt.email)===(null===Jt||void 0===Jt?void 0:Jt.email)?it+_.D9.GET_PROFILE:"",showDetailPopup:!0,hideBackground:"chatbot"===(null===Rt||void 0===Rt?void 0:Rt.type),authActionWrapper:tn,avatarProps:{size:He?24:40},badgeIconSize:null!==at&&void 0!==at&&at.isAnonymous||Boolean(mn)?1:He?12:15,onChatWithBot:function(){window.location.href=(0,L.A_)("chat_button")}},style:{marginBottom:bn||wn?"8px":0},children:[wn&&(0,o.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},onClick:function(e){ln&&(e.preventDefault(),e.stopPropagation(),tn((function(){"most-engaging"===he&&(window.location.href=ln)})))},children:wn&&(0,o.jsx)(C.x,{onClick:function(e){return e.stopPropagation()},children:(0,o.jsx)(Z.R,{})})}),!Rt.role&&!wn&&(null===Rt||void 0===Rt?void 0:Rt.id)&&Qt&&(0,o.jsx)(V.Z,{authorId:Rt.id}),pn&&(0,o.jsx)(Q,{onDeleteComment:function(){return null===ze||void 0===ze?void 0:ze(at)},className:"popover",commentId:at.id,onEditComment:function(){return yn(at.id)}})]}),(0,o.jsx)(ke,{borderColor:Cn,"data-is-expert-card":bn,children:(0,o.jsxs)(Pe,{children:[$e&&(0,o.jsxs)(Ne,{children:["expert"===(null===Jt||void 0===Jt?void 0:Jt.role)&&null!==Be&&void 0!==Be&&Be.isAskDoctor&&wn?(0,o.jsx)(Ze,{disabled:Boolean(ln),comment:at,onEndorseSuccess:function(e){lt((function(t){return Me(Me({},t),{},{isVerify:1,userVerify:e})}))},onOpposeSuccess:qe}):null,wn&&(Boolean(null===at||void 0===at?void 0:at.isVerify)&&!Boolean(null===at||void 0===at?void 0:at.isOppose)?(0,o.jsx)(p.V,{title:null===at||void 0===at||null===(X=at.userVerify)||void 0===X?void 0:X.title,name:null===at||void 0===at||null===(K=at.userVerify)||void 0===K?void 0:K.name,userId:null===at||void 0===at||null===($=at.userVerify)||void 0===$?void 0:$.id,role:null===at||void 0===at||null===(ee=at.userVerify)||void 0===ee?void 0:ee.role,avatar:null===at||void 0===at||null===(te=at.userVerify)||void 0===te?void 0:te.avatar}):(0,o.jsx)("div",{style:{height:"10px"}}))]}),(0,o.jsx)(ge,{className:"post-content-wrapper",replyingTo:Ht,mentionedUser:Bt,description:wn?kn:Wt,mentions:gn,onClick:function(e){ln&&(e.preventDefault(),e.stopPropagation(),tn((function(){return window.location.href=ln})))},maxChars:Xe,maxLines:"detail-post"===nt?void 0:A,disableShortenContent:Qe,onClickCreatePostLink:function(){tt&&tn((function(){qt({type:B.H.SHOW_CREATE_NEW_POST_POPUP,payload:!0})}),{action:"create-post"})}},String((null===Jt||void 0===Jt?void 0:Jt.id)||(null===Be||void 0===Be?void 0:Be.id))),wn&&(null===Be||void 0===Be||null===(ne=Be.sponsor)||void 0===ne?void 0:ne.id)&&(0,o.jsxs)(C.x,{sx:{display:"inline-flex",alignItems:"center",gap:(0,j.h)(8),background:null===(oe=v.t.neutral)||void 0===oe?void 0:oe[0],padding:"0 ".concat((0,j.h)(8)),margin:"18px 0 8px",img:{height:(0,j.h)(36)}},children:[(0,o.jsx)(b.Z,{color:ot.colors.blue[6],size:18}),null!==Be&&void 0!==Be&&null!==(ie=Be.sponsor)&&void 0!==ie&&ie.logo?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(f.T,{size:"n1",children:rt({id:"cardReply.sponsoredBy",defaultMessage:"Sponsored By"})}),(0,o.jsx)("img",{src:null===Be||void 0===Be||null===(re=Be.sponsor)||void 0===re?void 0:re.logo,alt:null===Be||void 0===Be||null===(se=Be.sponsor)||void 0===se?void 0:se.name})]}):(0,o.jsx)(f.T,{size:"n1",sx:{display:"inline-block",padding:"".concat((0,j.h)(5)," 0")},children:rt({id:"cardReply.sponsoredContent",defaultMessage:"Sponsored Post"})})]}),(0,o.jsxs)(xe,{children:[Tt&&Tt.length>0?(0,o.jsx)("div",{className:"image-preview-wrapper","data-is-reply":!0,children:(0,o.jsx)(m.a,{images:Tt,authorName:null===Rt||void 0===Rt?void 0:Rt.username,isSensitive:Boolean(null===at||void 0===at?void 0:at.isSensitive),alt:null===Be||void 0===Be?void 0:Be.title})},"image-preview"):null,Tt&&0!==Tt.length||!At?null:(0,o.jsx)("div",{className:"link-preview-wrapper","data-is-reply":!0,children:(0,o.jsx)(h.C,{url:At})},"link-preview")]}),wn&&(0,o.jsx)(C.x,{sx:{height:"10px"}}),(0,o.jsx)(ye,Me(Me({},Sn),{},{children:(0,o.jsxs)(be,{children:[(0,o.jsxs)("div",{className:"actions",children:[(0,o.jsx)("div",{className:"time-item reaction-item",children:null===at||void 0===at?void 0:at.createdTime}),(0,o.jsx)(ye.LikeWrapper,{className:"reaction-item ".concat(Lt?"liked":""),children:rt({id:"mobileBar.like",defaultMessage:"Like"})}),(!wn||wn&&(null===Be||void 0===Be||null===(le=Be.sponsor)||void 0===le?void 0:le.id))&&(0,o.jsx)(ye.CommentWrapper,{className:"reaction-item",children:rt({id:"cardReactions.reply",defaultMessage:"Reply"})}),wn&&!Ot&&(0,o.jsx)(C.x,{className:"reaction-item",onClick:function(){tn((function(){return null===Ct||void 0===Ct?void 0:Ct()}))},sx:{cursor:"pointer"},children:rt({id:"cardReply.feedbackBtn",defaultMessage:"Feedback"})})]}),Mt>0&&(0,o.jsx)("div",{className:"count-heart",children:On})]})})),wn?(0,o.jsx)(_e,{collapseSource:!Te,listUrl:null===at||void 0===at?void 0:at.source,categorySlug:null===at||void 0===at?void 0:at.categorySlug,isMarryBaby:L.fn}):null]})})]}),(0,o.jsxs)("div",{className:"comment-reply-wrapper",children:[ct&&(0,o.jsx)(E.g,{}),mt&&(0,o.jsx)(ke,{ref:kt,isParent:Et.length>0,borderColor:Cn,className:"input-wrapper",children:jn}),null===cn||void 0===cn||null===(de=cn.slice(0,rn))||void 0===de?void 0:de.map((function(t,n){return(0,o.jsx)(we,{"data-is-last-item":n===(null===cn||void 0===cn?void 0:cn.slice(0,rn).length)-1,isLastItem:n===(null===cn||void 0===cn?void 0:cn.slice(0,rn).length)-1,children:(0,o.jsx)(e,{borderColor:bn?u.r.colors.blue100:u.r.colors.neutral100,showCurlBorder:!0,isMobile:He,comment:t,type:"reply",className:"comment-reply-item",level:Ee+1,replyingId:It,onPostCommentSuccess:function(e){null===Re||void 0===Re||Re(e),dn(e)},post:Be,hasShare:!1,onDeleteComment:function(){var e=Me(Me({},at),{},{replies:at.replies.filter((function(e){return e.id!==t.id})),countReplies:at.countReplies-1});lt(e),null===Ue||void 0===Ue||Ue()},onEditCommentSuccess:function(e){var t=null===at||void 0===at?void 0:at.replies.findIndex((function(t){return t.id==e.id})),n=(0,a.Z)(null===at||void 0===at?void 0:at.replies);n[t]=e,lt((function(e){return Me(Me({},e),{},{replies:n})}))},showInputCommentOutside:!0,disableShortenContent:!0,hasCreatePost:et,hasBindCreatePost:tt,pageType:nt})},String(t.id)+n)}))]})]}),un>rn&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(Ce,Me({className:"more-cmt",text:rt({id:"comment.seeMoreReplies"},{count:un-rn}),onClick:function(){return sn((function(e){return e+4}))}},xn))})]}),(0,o.jsx)(g.M,{opened:bt,onClose:jt,title:rt({id:"botFeedback.modal.heading",defaultMessage:"How can we improve it ?"}),transitionProps:{transition:"fade",duration:200},withCloseButton:!0,target:L.Hh,children:(0,o.jsx)(ae,{id:null===at||void 0===at?void 0:at.id,onDone:function(){jt(),St(!0)}})})]})}},20367:function(e,t,n){"use strict";n.d(t,{t:function(){return ae}});var o=n(85893),i=n(26265),r=n(38347),s=n(11163),a=n(86896),l=n(24169),d=n(37125),c=n(16573),u=n(67294),p=n(67128),m=n(13199),h=n(91256),v=h.ZP.div.withConfig({displayName:"indexstyled__StyledWrapper",componentId:"sc-5xqvvz-0"})([""]);h.ZP.div.withConfig({displayName:"indexstyled__StyledLess",componentId:"sc-5xqvvz-1"})(["margin-top:5px;color:",";&:hover{cursor:pointer;}"],(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.primaryBase}));function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function g(e){for(var t=1;t/g)||[]).length-1),r=(t||"").slice(0,o<40?40:o),a=(0,m.Nw)(r.replace(/(<|<\/)( +|[a-zA-Z]*)$/gi,"")),l=a.length div":{flexDirection:"column",rowGap:e.spacing.xs},div:{marginLeft:0,textAlign:"center"}}},item:{display:"flex",flexDirection:"column",alignItems:"center",width:"33%",cursor:"pointer"},info:{display:"flex",flexDirection:"column",gap:"4px","*":{pointerEvents:"none"}},ourGuide:{}}})),Z=n(4266),E=n(95983),D=h.ZP.div.withConfig({displayName:"indexstyled__StyledWrapper",componentId:"sc-1woxv6l-0"})(["padding-top:16px;margin-bottom:24px;&:last-child{border-bottom:0;margin-bottom:0;}"]),T=h.ZP.div.withConfig({displayName:"indexstyled__StyledHeading",componentId:"sc-1woxv6l-1"})(["font-size:14px;line-height:22px;color:",";"],(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.gray400})),R=h.ZP.div.withConfig({displayName:"indexstyled__StyledDesc",componentId:"sc-1woxv6l-2"})(["font-size:14px;line-height:22px;margin-top:16px;color:",";"],(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.gray800})),L=h.ZP.div.withConfig({displayName:"indexstyled__StyledContent",componentId:"sc-1woxv6l-3"})(["margin-top:16px;"]);function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function B(e){for(var t=1;t0?(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("div",{className:P(x.root,t),children:[(0,o.jsxs)("div",{className:x.header,children:[(0,o.jsx)("div",{className:x.thumbnail,children:(0,o.jsx)("img",{className:x.image,alt:"top contributor",src:C.C.getAssetPath("comment-1.svg")})}),(0,o.jsx)(y.H,{as:"h4",tag:"h5",className:x.heading,children:m({id:"topContributor.heading",defaultMessage:"Top Contributors"})})]}),(0,o.jsx)("div",{className:x.list,children:v.map((function(e){return(0,o.jsx)("div",{className:x.item,children:(0,o.jsx)(S.U,{authorProps:{showDetailPopup:!0,avatar:e.avatar,avatarProps:{size:56},name:e.name||e.userName,username:e.userName,userId:e.id,children:(0,o.jsxs)("div",{className:x.info,"data-event-category":"Together","data-event-action":"Standout Member Click","data-event-label":(0,l.Ow)(d,c),children:[(0,o.jsx)(j.T,{size:"s4",weight:"bold",children:e.name}),(0,o.jsx)(j.T,{size:"n1",color:"#595959",children:m({id:"topContributor.countActivities",defaultMessage:"{number} activities"},{number:(0,b.a)(e.postsCount+e.commentsCount)})})]}),dataEventCategory:"Together",dataEventAction:"Standout Member Click",dataEventLabel:(0,l.Ow)(d,c)}})},String(e.id))}))}),r&&(0,o.jsx)("div",{className:x.ourGuide,children:(0,o.jsxs)(j.T,{size:"n1",children:[m({id:"topContributor.ourGuide",defaultMessage:"Our guide recommend for new member."})," ",(0,o.jsx)(p.b,{target:"_blank",href:(0,w.g)(d)+(0,_.k3)("/guideline"),"data-event-category":"Together","data-event-action":"Guide Recommend Click","data-event-label":(0,w.g)(d)+(0,_.k3)("/guideline"),children:m({id:"topContributor.readNow",defaultMessage:"Read now"})})]})})]})}):r?(0,o.jsx)(N.g,{style:{margin:"20px 0"}}):null},ae.FeedBlock=c.B,ae.NewQuestionNoti=function(e){var t=(0,Q.Z)({},e),n=(0,k.h)(),i=n.locale,r=n.asPath,s=(0,u.useContext)(te.I).state.userInfo,d=(0,a.Z)().formatMessage,c=(0,u.useContext)(te.I),p=c.state,m=p.questionForExpert,h=void 0===m?0:m,v=p.questionForExpertLoading,f=c.dispatch;return E.MN.includes(E.Vi.NEXT_PUBLIC_DEPLOY_LOCALE||"")&&E.vA.includes((null===s||void 0===s?void 0:s.role)||"")?v||null===v?(0,o.jsx)(K.g,{}):(0,o.jsxs)(ne,ie(ie({},t),{},{"data-event-category":"Together","data-event-action":"Your Question Click","data-event-label":(0,l.Ow)(i,r),onClick:function(){f({type:ee.H.SHOW_QUESTION_FOR_EXPERT_POPUP,payload:!0})},children:[(0,o.jsx)($.C,{disableDot:0===h}),(0,o.jsx)("span",{children:d({id:"newQuestionNoti.content",defaultMessage:"You have {number} Questions"},{number:h})})]})):null},ae.Container=function(e){var t=e.children,n=(0,r.Z)(e,["children"]);return(0,o.jsx)(H,se(se({className:"main-container"},n),{},{children:t}))},ae.LeftCol=function(e){var t=e.children,n=(0,r.Z)(e,["children"]);return(0,o.jsx)(G,se(se({},n),{},{children:t}))},ae.RightCol=function(e){var t=e.children,n=(0,r.Z)(e,["children"]);return(0,o.jsx)(Y,se(se({className:"home-right"},n),{},{children:t}))},ae.AboutIntro=function(e){var t=e.description,n=void 0===t?"":t,i=(0,a.Z)().formatMessage,r=(0,s.useRouter)(),d=r.locale,c=void 0===d?"vi-VN":d,u=r.asPath;return(0,o.jsx)(q,{title:i({id:"aboutThisGroup"}),description:(0,o.jsx)(x,{description:n||"",length:120,showMoreBtnProps:{"data-event-category":E.UN,"data-event-action":"See More Topic Info","data-event-label":(0,l.Ow)(c,u)}})})},ae.ForumIntro=function(e){var t=e.selectedCommunity,n=e.topicsBySelectedCommunity,i=e.communities,r=e.selectedTopic,s=e.adSlug,l=e.adUnitPath,c=e.postId,u=(0,a.Z)().formatMessage,p=(0,Z.d)();return(0,o.jsxs)(q,{className:"list-forums",title:u({id:"cardList.findYourCommunities"}),description:u({id:"cardList.description",defaultMessage:"Explore our range of communities based on the health topics that matter to you the most."}),children:[s&&l&&(0,o.jsx)(d.t,{adUnitPath:l,size:[[300,250],[300,600]],divId:"div-gpt-ad-post-topbanner-".concat(p?"mobile":"desktop"),pos:["TopBanner"],style:{margin:"1rem auto"},customTargetings:{content_id:c||""}},String(p)),(0,o.jsx)(X.I,{communities:i,selectedCommunity:t,topicsBySelectedCommunity:n,selectedTopic:r,showActiveTopic:!0})]})},ae.Section=z,ae.Row=function(e){var t=e.children,n=(0,r.Z)(e,["children"]);return(0,o.jsx)(V,se(se({},n),{},{children:t}))},ae.WideCol=function(e){var t=e.children,n=(0,r.Z)(e,["children"]);return(0,o.jsx)(F,se(se({},n),{},{children:t}))}},86264:function(e,t,n){"use strict";n.d(t,{gj:function(){return ut},ZP:function(){return mt}});var o,i=n(85893),r=n(28140),s=n(809),a=n.n(s),l=n(26265),d=n(92447),c=n(32292),u=n(67294),p=n(45579),m=n(67128),h=n(32763),v=n(2566),f=n(27484),g=n.n(f),x=n(15020),y=n(36380),b=n.n(y),w=n(45578),C=n.n(w),j=n(11163),P=n(86896),O=n(25559),S=n(2810),k=n(24169),_=n(37125),N=n(40875),I=n(83129),M=n(22028),Z=n(26381),E=n(95983),D=n(22398),T=n(36308),R=n(91256),L=R.ZP.div.withConfig({displayName:"indexstyled__StyledLabelSortPin",componentId:"sc-mt0569-0"})(["display:flex;align-items:center;justify-content:space-between;padding:8px 16px;cursor:pointer;&[data-color='gray']{background:",";}&[data-color='white']{border-top:1px solid #e4e8ec;border-bottom:1px solid #e4e8ec;background:",";}.popover-menu__btn{display:flex;min-width:2rem;height:2rem;align-items:center;padding:8px 0 !important;border:none;margin-left:0.5rem;background:transparent;> span{display:flex;align-items:center;}&:hover{background:transparent !important;}}&.label-pinned{border-radius:6px 6px 0 0;.label-sort-pin-icon{width:16px;height:16px;vertical-align:middle;}}",""],(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.neutral50}),(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.white}),E.fn&&(0,R.iv)(["padding:0.75rem 1rem;border-radius:16px 16px 0px 0px;&[data-color='white']{border-bottom:none;}&[data-color='gray']{background:#f3f3f3;}.popover-menu__btn{width:unset;}&.label-pinned{border-bottom:none;background:#fff9eb;border-radius:1rem 1rem 0 0;.label-sort-pin-icon{margin-right:8px;}.label-sort-pin-heading{color:#fb8c00;}}&.label-sorting{","{padding-bottom:1.5rem;margin-bottom:-0.75rem;}}"],T.M.mbUp)),A=function(e){var t=e.label,n=e.rightLabel,o=e.onClick,r=e.color,s=e.className,a=e.style;return(0,i.jsxs)(L,{"data-color":r,onClick:o,className:s,style:a,children:[(0,i.jsx)(D.T,{className:"label-sort-pin-heading",size:E.fn?"p4":"p3",type:"bold",children:t}),n]})};!function(e){e.latest="latest",e.oldest="oldest",e.popular="popular",e.experts="experts"}(o||(o={}));var B=function(e){var t=e.onChange,n=e.className,o=e.style,r=e.leftLabel,s=e.rightLabel,a=e.color,l=e.value,d=e.choices,c=(0,u.useState)(),p=c[0],h=c[1];return(0,u.useEffect)((function(){h(l)}),[l]),(0,i.jsx)(A,{label:r,rightLabel:(0,i.jsx)(m.o,{shadow:"lg",position:"bottom-end",width:250,styles:{dropdown:{padding:"0.5rem",border:0,boxShadow:"rgba(0, 0, 0, 0.1) 3px 3px 20px",borderRadius:"8px"}},children:function(e){var n=e.opened,o=e.open,r=e.close;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m.o.Target,{children:(0,i.jsx)("div",{onClick:n?r:o,children:(0,i.jsxs)("div",{style:{display:"flex"},children:[(0,i.jsx)(I.T,{style:{display:"flex",alignItems:"center",fontWeight:"normal",marginRight:12},size:"p4",children:s}),(0,i.jsx)("img",{alt:"",src:E.fn?"./svg/marrybaby/sortBy.svg":"./svg/icon-sort-arrow.svg",style:{width:16,height:16,alignSelf:"center"}})]})})}),(0,i.jsx)(m.o.Dropdown,{children:(0,i.jsx)(M.m,{data:{isShowheader:!1,type:"list",list:null===d||void 0===d?void 0:d.map((function(e){return{label:e.label||"",onClick:function(){return t&&t(String(e.value))},selected:e.value===p,className:"bold-item"}}))}})})]})}}),color:a||"gray",className:n,style:o})},z=function(){var e=(0,Z.h)().locale,t=(0,P.Z)().formatMessage;return function(e){var t=(0,u.useState)(o.latest),n=t[0];return{setSortChoiceValue:t[1],selectedSortChoice:null===e||void 0===e?void 0:e.find((function(e){return e.value===n})),sortedChoices:e}}([{label:t({id:"choicePopover.latest"}),value:o.latest},{label:t({id:"choicePopover.oldest"}),value:o.oldest}].concat((0,r.Z)(E.nd.includes(e)?[{label:t({id:"choicePopover.expertsComment"}),value:o.experts}]:[])))},U=n(11850),W=n(23464),H=n(42432),V=n(45093),F=n(1821),G=n(13195),Y=n(21124),q=n(48253),J=n(5200),X=n(50572),Q=n(5886),K=n(50017),$=n(63792),ee=n(43196),te=n(14153),ne=n(73963),oe=n(18833),ie=n(31474),re=n(20367),se=n(10917),ae=n(35022),le=n(38347),de=n(32951),ce=n(36808),ue=n.n(ce),pe=n(55368),me=n(44036),he=(0,me.k)((function(){return{bar:{transitionDuration:"0ms",background:se.r.colors.neutral300},root:{maxWidth:"calc(100% - 16px)",marginLeft:0,marginRight:0,height:(0,v.h)(4),background:"transparent",position:"relative","&:before":{position:"absolute",content:'""',top:0,left:0,right:0,bottom:0,background:"#fff",opacity:.25}}}}));function ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}var fe=function(e){var t=e.embla,n=e.styles,o=(0,le.Z)(e,["embla","styles"]),r=he(void 0,{name:"CarouselProgressBar",styles:n}).classes,s=(0,u.useState)(0),a=s[0],d=s[1],c=(0,u.useCallback)((function(){if(t){var e=Math.max(0,Math.min(1,t.scrollProgress()));d(100*e)}}),[t,d]);return(0,u.useEffect)((function(){t&&(t.on("scroll",c),c())}),[t]),(0,i.jsx)(pe.E,function(e){for(var t=1;t0,w=null===n||void 0===n?void 0:n.author,C=(null===w||void 0===w?void 0:w.name)||(null===w||void 0===w?void 0:w.username)||"",P=(null===w||void 0===w?void 0:w.username)||(null===w||void 0===w?void 0:w.name)||"",O=null===w||void 0===w?void 0:w.avatar,S={isAnonymous:null===n||void 0===n?void 0:n.isAnonymous,avatar:O,name:C,username:P,email:null===w||void 0===w?void 0:w.email,timeText:null===n||void 0===n?void 0:n.createdTime,community:null===n||void 0===n?void 0:n.community,showDetailPopup:!0,userId:null===w||void 0===w?void 0:w.id,profileModalProps:{zIndex:1e3}};return(0,i.jsxs)(Fe,nt(nt({},o),{},{children:[(0,i.jsx)(Ge,{children:(0,i.jsx)(Ke,nt({},S))}),(0,i.jsxs)(Ye,{children:[(0,i.jsxs)(qe,{children:[(0,i.jsxs)(Xe,{"data-has-thumb":b,children:[(0,i.jsx)(D.T,{as:"h4",size:"s3",type:"bold",children:null===n||void 0===n?void 0:n.title}),(0,i.jsxs)(Je,{children:[(0,i.jsx)(ze.P,{trackingCategory:E.UN,url:"",className:"post-content-wrapper",description:null===n||void 0===n?void 0:n.description,disableShortenContent:!1,mentions:null===n||void 0===n?void 0:n.mentions,maxChars:b?100:150}),(0,i.jsx)(et,nt(nt({href:y},{"data-event-category":E.UN,"data-event-action":"Click Post","data-event-label":y}),{},{onClick:function(e){r||(e.preventDefault(),s((function(){window.location.href=y})))}}))]})]}),b&&(0,i.jsx)(Qe,{className:"cursor-pointer",onClick:function(){return s((function(){window.location.href=y}))},children:(0,i.jsx)(Ue.a,{images:n.photos})})]}),(0,i.jsx)($e,{trackingCategory:E.UN,trackingLabel:y,type:We.w.post,viewCount:null!==n&&void 0!==n&&n.totalView?n.totalView:void 0,loveCount:v,replyCount:null===n||void 0===n?void 0:n.commentCount,className:"post-reaction",liked:p,hasShare:!1,hasSave:!1,hasShowAction:!1,isReleatedPost:!0,onCommentClick:function(){s((function(){window.location.href=y}))},onLikeClick:function(){g&&a({id:g,isLike:!p,onCallback:function(e){m(e),f(e?v+1:v-1)}})},onGoToUrl:function(e){var t=e?"".concat(y).concat(e):y;r?window.location.href=t:s((function(){window.location.href=t}))}})]})]}))};function it(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function rt(e){for(var t=1;t0&&S({ids:B,isJoin:!0,communityIds:[l.id],hideSuccessMessage:!0})};(0,u.useEffect)((function(){b&&"true"===ue().get(E.Z)&&((null===l||void 0===l?void 0:l.id)&&O({ids:[l.id],isJoin:!0,callbackFn:D}),ue().remove(E.Z))}),[b]);var T={controls:{padding:0,left:"-15px",right:"-15px",top:"calc(50% - 35px)"},control:{width:"30px",height:"30px",border:"1px solid ".concat(se.r.colors.neutral200),background:"white",opacity:1,boxShadow:"none",svg:{position:"absolute",width:"20px",height:"20px"}}},R="".concat((0,ee.k3)("/".concat((null===l||void 0===l?void 0:l.slug)||"_","/").concat((null===a||void 0===a?void 0:a.slug)||""))),L="".concat((0,k.mg)(f)).concat(R),A={type:"onlyButton",community:l,joinRequestLabelBtn:p({id:"actionPopover.joinCommunity",defaultMessage:"Join Community"}),onCallback:D,authRedirect:"/".concat((null===l||void 0===l?void 0:l.slug)||"_","/").concat((null===t||void 0===t?void 0:t.slug)||""),onClickBtnCallback:function(){return!b&&ue().set(E.Z,"true")},"data-event-category":E.UN,"data-event-action":"Join Community","data-event-label":"".concat((0,k.mg)(f)).concat(g)},B=(0,u.useMemo)((function(){return s.map((function(e){return String(e.id)}))}),[]),z=0===N.length?(0,i.jsx)(Oe,rt(rt({},A),{},{btnProps:{variant:d?"secondary":"ghost",leftIcon:(0,i.jsx)(de.Z,{size:18,color:"currentColor"}),styles:{root:{paddingRight:0},leftIcon:{marginRight:(0,v.h)(5)}}}})):(0,i.jsx)(_e,rt(rt({variant:d?"secondary":"ghost",leftIcon:(0,i.jsx)(de.Z,{size:18,color:"currentColor"}),onClick:function(){w({type:X.H.SHOW_CREATE_NEW_POST_POPUP,payload:!0})},styles:{root:{paddingRight:0},leftIcon:{marginRight:(0,v.h)(5)}}},{dataEventCategory:E.UN,dataEventAction:"Join Discussion",dataEventLabel:"".concat((0,k.mg)(f)).concat(g)}),{},{children:p({id:"relevantPostList.startDisCussion",defaultMessage:"Join discussion"})}));return o.length>0?(0,i.jsxs)(be,rt(rt({},c),{},{children:[(0,i.jsxs)(we,{children:[(0,i.jsx)(Ce,{size:"s1",children:p({id:"relevantPostList.heading",defaultMessage:"Related posts"})}),(0,i.jsx)(Se,{children:z})]}),(0,i.jsxs)(je,{children:[(0,i.jsxs)(Pe,{slideSize:d?"85%":"40%",align:"start",slideGap:"8px",getEmblaApi:Z,withIndicators:!d&&o.length>1,styles:function(){return rt(rt({},T),{},{indicators:{position:"static",marginTop:"24px"},indicator:{width:8,height:8,borderRadius:"50%",border:"1px solid ".concat(se.r.colors.neutral100),boxShadow:"none",background:"#fff",opacity:1,"&[data-active]":{borderColor:E.fn?se.r.mbColors.pink:se.r.colors.primaryBase,background:E.fn?se.r.mbColors.pink:se.r.colors.primaryBase}}})},children:[o.map((function(e){return(0,i.jsx)(Pe.Slide,{children:(0,i.jsx)(ot,{className:"post-card-item",post:e})},e.id)})),(0,i.jsx)(Pe.Slide,{children:(0,i.jsx)("a",{href:L,children:(0,i.jsx)(Be,{className:"post-card-item"})})})]}),(0,i.jsx)(ke,{children:z}),d&&(0,i.jsx)(fe,{embla:M,styles:{bar:{background:"#C3CBD4"},root:{background:"#fff",marginTop:(0,v.h)(20)}}})]})]})):null})).withConfig({displayName:"indexstyled__StyleRelevantPostListOutside",componentId:"sc-mxysjv-3"})(["","{margin-bottom:24px;}"],T.M.mbUp),(0,R.ZP)(ae.M).withConfig({displayName:"indexstyled__ModalSuccessPost",componentId:"sc-mxysjv-4"})([".mantine-Modal-header{border-bottom:none;}.modal-success-post-container{.modal-success-post-content{display:flex;gap:8px;flex-direction:column;margin-bottom:32px;align-items:center;}.modal-success-post-title{color:",";text-align:center;font-size:22px;font-weight:700;line-height:32px;letter-spacing:-0.6px;}.modal-success-post-description{color:",";font-size:16px;font-weight:400;line-height:24px;text-align:center;}.modal-success-post-action{display:flex;gap:12px;.mantine-Button-root{flex:1;}}}"],se.r.colors.gray800,se.r.colors.gray600));function dt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ct(e){for(var t=1;t0&&et(L)}),[L]),(0,u.useEffect)((function(){We({type:K.m.updateMultiple,payload:{dataArr:ce}})}),[ce]),(0,u.useEffect)((function(){We({type:$.Q.updateMultiple,payload:{dataArr:de}})}),[de]),(0,u.useEffect)((function(){Je&&We({type:ie.t.update,payload:{data:R}})}),[R]),(0,u.useEffect)((function(){if(me&&Le&&"like"===yt){for(var e=[],t=0,n=Object.entries(Fe);t0&&Ye({ids:s,names:r,isJoin:!0,communityIds:[ge]}),(null===R||void 0===R||!R.isLiked)&&qe({id:Je||"",isLike:!0})}}),[me]);var Xe=Je&&Ve[Je]||R,Qe=(0,u.useRef)(null),Ke=(0,u.useState)(L&&L.length>0?L:A),$e=Ke[0],et=Ke[1],tt=(0,u.useState)((null===Xe||void 0===Xe?void 0:Xe.commentCount)||0),nt=tt[0],ot=tt[1],it=(0,u.useState)(ne||{current:1,last:1,total_items:0}),rt=it[0],dt=it[1],pt=(0,q.g)(T),mt=(0,Z.h)(),ht=mt.locale,vt=mt.asPath,ft=mt.query,gt=ft.topicPostSlug,xt=ft.communitySlug,yt=ft.postAction,bt=ft.action,wt=ft.askDoctor,Ct=(0,u.useMemo)((function(){return E.z3.includes(ht)}),[ht]);(0,u.useEffect)((function(){var e=window.location.hash;if(e){var t="#oldest"===e?"oldest":"latest";ye(t),jt({page:1,sortValue:t,isRefetch:!0})}}),[vt]),(0,u.useEffect)((function(){Xe.community.slug&&Xe.slug&&"".concat(Xe.community.slug,"/").concat(Xe.slug)!=="".concat(xt,"/").concat(gt)&&mt.replace("./".concat(Xe.community.slug,"/").concat(Xe.slug).concat(mt.asPath.split("?")[1]?"?".concat(mt.asPath.split("?")[1]):""))}),[Xe.community.slug,Xe.slug]),(0,u.useEffect)((function(){bt&&wt&&("createPost"!==bt&&"editPost"!==bt||Ie(!0),"true"===wt&&Ee(!0))}),[bt,wt]);var jt=function(){var e=(0,d.Z)(a().mark((function e(t){var n,i,r,s,l,d,c,u,p,m,h;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Se){e.next=2;break}return e.abrupt("return");case 2:if(ke(!0),e.prev=3,i=(n=t||{}).page,r=void 0===i?1:i,s=n.isRefetch,l=n.sortValue,d=l===o.experts?{filterByExpert:1}:l===o.oldest?{sort:"oldest"}:l===o.latest?{sort:"newest"}:{},null===Xe||void 0===Xe||!Xe.id){e.next=13;break}return e.next=9,(0,k.Jl)((0,k.cN)(S.yy.COMMENT.LIST,ct({postId:String(Xe.id),_locale:ht,page:r},d)),"GET");case 9:m=e.sent,h=(null===m||void 0===m||null===(c=m.data)||void 0===c||null===(u=c.comments)||void 0===u?void 0:u.map(O.ec))||[],et((function(e){return C()(s?h:e.concat(h),"id")})),dt((null===m||void 0===m||null===(p=m.data)||void 0===p?void 0:p.pagination)||{current:1,last:1,total_items:0});case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(3),console.error(e.t0);case 18:ke(!1);case 19:case"end":return e.stop()}}),e,null,[[3,15]])})));return function(t){return e.apply(this,arguments)}}(),Pt=function(){var e=(0,d.Z)(a().mark((function e(t){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:et((function(e){return e.unshift(t),e.slice()})),dt((function(e){return ct(ct({},e),{},{total_items:e.total_items+1})})),We({type:ie.t.update,payload:{id:Xe.id,data:{commented:!0}}}),ot((function(e){return e+1}));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ot=function(){var e=(0,d.Z)(a().mark((function e(t){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:et((function(e){var n=e.findIndex((function(e){return e.id===t.id}));return e.splice(n,1,t),e.slice()}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),St=function(){mt.replace({pathname:mt.pathname,query:ct(ct({},mt.query),{},{action:"",askDoctor:""})},void 0,{shallow:!0}),Ie(!1)},kt=(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(at,{className:"comment-list",children:[$e&&$e.length>0?$e.map((function(e){return(0,i.jsx)(H.M,{isMobile:pt,className:"post-comment",comment:e,post:Xe,disableShortenContent:!0,isAnonymous:e.isAnonymous,isCommentDetail:!0,onPostCommentSuccess:function(){ot((function(e){return e+1}))},onDeleteReply:function(){ot((function(e){return e-1}))},onDeleteComment:function(t){et((function(t){return t.filter((function(t){return t.id!==e.id}))})),dt((function(e){return ct(ct({},e),{},{total_items:e.total_items-1})})),ot((function(e){return e-1-((null===t||void 0===t?void 0:t.replies)||[]).length}))},onEditCommentSuccess:function(e){et((function(t){var n=(0,r.Z)(t);return n[t.findIndex((function(t){return t.id===e.id}))]=e,n}))},onOpposeSuccess:function(){et((function(t){return t.filter((function(t){return t.id!==e.id}))})),dt((function(e){return ct(ct({},e),{},{total_items:e.total_items-1})})),ot((function(e){return e-1}))},refetchComment:Ot,hasCreatePost:"moderator"===(null===Re||void 0===Re?void 0:Re.role),hasBindCreatePost:!0,pageType:"detail-post"},e.id)})):null,(null===rt||void 0===rt?void 0:rt.current)<(null===rt||void 0===rt?void 0:rt.last)?(0,i.jsx)(U.V,{className:"more-cmt",onClick:function(){return jt({page:(null===rt||void 0===rt?void 0:rt.current)+1,sortValue:null===be||void 0===be?void 0:be.value})},text:fe({id:"comment.seeMoreComments"},{count:(null===rt||void 0===rt?void 0:rt.total_items)-$e.length})}):null]})}),_t=(0,u.useRef)(null),Nt=(0,u.useRef)(null),It=(null===(n=E.GK[ht])||void 0===n?void 0:n[xt])||"",Mt=(0,te.od)({countryAdTag:(0,te.Em)(ht,{isMobile:pt}),slug:It}),Zt=(null===Xe||void 0===Xe||Xe.community,null===Xe||void 0===Xe||Xe.topics,null===Xe||void 0===Xe||null===(s=Xe.topics)||void 0===s||s[0],null===Xe||void 0===Xe||null===(l=Xe.topics)||void 0===l||null===(f=l[0])||void 0===f||f.id,(0,u.useMemo)((function(){return(0,x.ZP)(Xe.metaSchema||"")}),[Xe]));return(0,i.jsx)(V.x,{ssrMenuContent:ae,title:(null===Xe||void 0===Xe?void 0:Xe.seoTitle)||Xe.title||fe({id:"home.seoTitle"}),description:(null===Xe||void 0===Xe?void 0:Xe.seoDescription)||b()(Xe.description||"").slice(0,147)||fe({id:"home.seoDescription"}),image:(null===Xe||void 0===Xe?void 0:Xe.seoImage)||(null===Xe||void 0===Xe||null===(g=Xe.photos)||void 0===g?void 0:g[0])||(null===Xe||void 0===Xe||null===(y=Xe.previewUrl)||void 0===y?void 0:y.image)||E.CX[ht].HOMEPAGE_IMAGE,SEOData:{isIndexable:!0,hasNoAmp:!0,schemaData:"string"!==typeof Zt&&!Array.isArray(Zt)&&(0,u.isValidElement)(Zt)?Zt.props.dangerouslySetInnerHTML.__html:fe({id:"home.seoSchema"})},footerMenu:se,sitewideBanner:le,onCreatePostClickOnBottomBar:function(e){Ae({type:X.H.SHOW_CREATE_NEW_POST_POPUP,payload:!0}),Ae({type:X.H.SET_ASK_DOCTOR_POST,payload:"undefined"!==typeof e?e:void 0})},isCommunitySticky:!0,isCommunityPage:!0,communities:ce,communityId:null===Xe||void 0===Xe||null===(w=Xe.community)||void 0===w?void 0:w.id,topics:de,defaultCommunity:Xe.community,onPostSuccess:function(e,t,n){var o,i="action=".concat(n?"editPost":"createPost","&askDoctor=").concat(null!==t&&void 0!==t&&t.isAskDoctor?"true":"false"),r="".concat((0,k.mg)(ht)).concat((0,ee.k3)("/".concat((null===t||void 0===t||null===(o=t.community)||void 0===o?void 0:o.slug)||"_","/").concat((null===t||void 0===t?void 0:t.slug)||"","/?").concat(i)));window.location.href=r},showCreatePostSticky:!0,children:(0,i.jsx)(Y.Mv,{defaultParams:null!==(j=Xe.community)&&void 0!==j&&j.slug?{_joinCommunityIds:[null===Xe||void 0===Xe||null===(I=Xe.community)||void 0===I?void 0:I.id],_joinTopicIds:null===Xe||void 0===Xe||null===(M=Xe.topics)||void 0===M?void 0:M.map((function(e){return e.id}))}:void 0,children:(0,i.jsxs)(ut.Provider,{value:{trigger:je,onTrigger:function(){return Pe(!je)}},children:[(0,i.jsx)(st,{hasTopBackground:!0,children:(0,i.jsxs)(re.t.Container,{children:[(0,i.jsx)(re.t.Row,{children:(0,i.jsx)(m.B,{className:"breadcrumb",styles:{control:{width:30,padding:"0 !important",background:"transparent !important","&[data-inactive]":{width:0},marginTop:"-1px"},viewport:{marginRight:"20px"}},children:[{label:fe({id:"breadcrumb.helloTogether"}),value:(0,ee.k3)("/")},{label:Xe.community.name,value:Xe.community.isHidden?(0,ee.k3)("/".concat(xt,"/").concat(gt)):(0,ee.k3)("/".concat(xt))},{label:Xe.title||"Post",value:(0,ee.k3)("/".concat(xt,"/").concat(gt))}].map((function(e){return(0,i.jsx)(m.B.Item,ct(ct({href:e.value},e),{},{children:e.label}),e.value)}))})}),(0,i.jsxs)(re.t.Row,{className:"main-content",children:[(0,i.jsx)(re.t.LeftCol,{children:(0,i.jsxs)("div",{ref:_t,children:[(0,i.jsx)(W.o,{isMobile:pt,className:"main-post",disableCardLink:!0,title:Xe.title,id:Xe.id,slug:Xe.slug,community:Xe.community,author:Xe.author,postDate:Xe.createdDate,topics:Xe.topics,photos:Xe.photos,previewUrl:Xe.previewUrl,description:Xe.description,commentCount:nt,viewCount:Xe.totalView,loveCount:Xe.likeCount,onCommentCountClick:function(){var e;return null===(e=Qe.current)||void 0===e?void 0:e.scrollIntoView()},isReplied:!Boolean(Xe.commented),isLiked:Xe.isLiked,onDeletePost:function(){return mt.push("/")},post:Xe,disableShortenContent:!0,onPostCommentSuccess:Pt,InlineCommentsComponent:E.fn?kt:void 0,showInputComment:Le,showSkipQuestionBtn:!0,showMoreCommentBtn:!1,hasActionStatistical:!1,isDetail:!0,hasSimilarPost:Ct,similarPosts:ve,pageType:"detail-post"}),!E.fn&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"sort-container",ref:Qe,children:(0,i.jsx)(B,{color:"white",value:(null===be||void 0===be?void 0:be.value)||"",onChange:function(e){e!==(null===be||void 0===be?void 0:be.value)&&(ye(e),jt({page:1,sortValue:e,isRefetch:!0}),window.location.hash="#"+e)},className:"label-sorting",leftLabel:pt?(null===be||void 0===be?void 0:be.label)||"":fe({id:"comment.count"},{count:nt}),rightLabel:pt?fe({id:"choicePopover.sort"}):(null===be||void 0===be?void 0:be.label)||"",choices:we})}),kt]}),pt&&It&&(0,i.jsx)(p.A,{adUnitPath:Mt,size:[[300,250],[300,600]],divId:"div-gpt-ad-post-MidBanner1-".concat(pt?"mobile":"desktop"),pos:["MidBanner1"],style:{margin:"1rem auto"}},String(pt))]})}),(0,i.jsx)(re.t.RightCol,{children:(0,i.jsxs)("div",{ref:Nt,style:{paddingTop:(0,v.h)(20)},children:[(0,i.jsx)(N.R,{isBanner:!0}),!pt&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{style:{height:"16px"}}),(0,i.jsx)(re.t.NewQuestionNoti,{})]}),(0,i.jsx)(re.t.TopContributor,{communityId:String(null===Xe||void 0===Xe||null===(D=Xe.community)||void 0===D?void 0:D.id),hasGuidelineList:pe}),!pt&&(0,i.jsx)(re.t.ForumIntro,{communities:ce,topicsBySelectedCommunity:Object.keys(Fe).length>0?Object.keys(Fe).map((function(e){return Fe[e]})):de,selectedCommunity:null===Xe||void 0===Xe?void 0:Xe.community,adSlug:It,adUnitPath:Mt,postId:null===Xe||void 0===Xe?void 0:Xe.id}),!pt&&It&&(0,i.jsx)(p.A,{adUnitPath:Mt,size:[[300,250],[300,600]],divId:"div-gpt-ad-post-MidBanner1-".concat(pt?"mobile":"desktop"),pos:["MidBanner1"],style:{margin:"1rem auto"},customTargetings:{content_id:Xe.id||""}},String(pt))]})})]})]})}),It&&(0,i.jsx)(_.E,{className:"article-bottom-ad",isMobile:pt,adUnitPath:Mt}),(0,i.jsx)(lt,{opened:Ne,onClose:St,title:"",transitionProps:{transition:"fade",duration:200},withCloseButton:!0,children:(0,i.jsxs)("div",{className:"modal-success-post-container",children:[(0,i.jsxs)("div",{className:"modal-success-post-content",children:[(0,i.jsx)("div",{children:(0,i.jsx)("img",{src:(0,ee.k3)("/svg/complete.svg"),className:"button-more-icon",alt:"Complete post"})}),(0,i.jsx)("div",{className:"modal-success-post-title",children:fe("editPost"===bt?{id:"updatePost.success.title"}:{id:"createPost.success.title"})}),ht===J.MV.Vietnam&&(0,i.jsx)("div",{className:"modal-success-post-description",children:fe(Ze?{id:"createPost.askDoctor.success.description"}:{id:"createPost.success.description"})})]}),ht===J.MV.Vietnam&&(0,i.jsxs)("div",{className:"modal-success-post-action",children:[(0,i.jsx)(h.B,{variant:"tertiary",onClick:St,type:"button",children:fe({id:"download.app.later"})}),(0,i.jsx)(h.B,{variant:"primary",onClick:function(){window.location.href=(0,E.A_)("chat_button")},type:"button",children:fe({id:"download.app.now"})})]})]})})]})})})},mt=function(e){var t=e.post,n=e.communities,o=e.topics,r=e.commentsPagination,s=e.hasGuidelineList,l=e.hotDiscussPosts,p=(0,u.useContext)(Q.I).state.userInfo,m=(0,j.useRouter)().locale,h=void 0===m?"vi-VN":m,v=(0,u.useState)(t),f=v[0],x=v[1],y=(0,u.useState)(n),b=y[0],w=y[1],C=(0,u.useState)(o),P=C[0],_=C[1],N=(0,u.useState)(),I=N[0],M=N[1],Z=(0,u.useState)([]),E=Z[0],D=Z[1],T=(0,u.useState)(r),R=T[0],L=T[1],A=(0,u.useState)([]),B=A[0],z=A[1],U=(0,u.useState)(!1),W=U[0],H=U[1],V=(0,u.useState)(s),F=V[0],G=V[1],Y=(0,u.useState)(l),q=(Y[0],Y[1]),J=function(){var e=(0,d.Z)(a().mark((function e(){var n,o,i,r,s,l,d,u,m,v,f,y,b,C,j,P,N,I,Z,E,T,R,A,B;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"===typeof p){e.next=30;break}return f=new Date,y=g()().format("YYYY-MM-DD"),b=new Date(f.getTime()).setDate(f.getDate()-60),C=g()(b).format("YYYY-MM-DD"),e.next=7,Promise.all([(0,k.Jl)((0,k.cN)(S.yy.POST.DETAIL_BY_ID_OR_SLUG,{idSlug:String(t.id),_locale:h,metaSchema:1}),"GET"),(0,k.Jl)((0,k.cN)(S.yy.COMMENT.LIST,{postId:String(t.id),_locale:h,sort:"newest"}),"GET"),(0,k.Jl)((0,k.cN)(S.yy.TOPIC.LIST,{communityId:t.community.id,_locale:h}),"GET"),(0,k.Jl)((0,k.cN)(S.yy.COMMUNITY.LIST,{_locale:h}),"GET"),(0,k.t9)((0,k.cN)(S.yy.GUIDELINE.LIST,{_locale:h}),"GET"),(0,k.t9)((0,k.cN)(S.yy.COMMUNITY.GET_HOT_DISCUSSION,{communityId:String(t.community.id),pageSize:5,startDate:C,endDate:y,postId:String(t.id),exclude_seeding:"1",_locale:h}),"GET")]);case 7:return j=e.sent,P=(0,c.Z)(j,6),N=P[0],I=P[1],Z=P[2],E=P[3],T=P[4],R=P[5],e.next=17,(0,ne.Q)(h);case 17:A=e.sent,M(A),x((0,O.W1)((null===N||void 0===N?void 0:N.data)||{})),L((null===I||void 0===I||null===(n=I.data)||void 0===n?void 0:n.pagination)||null),B=(null===I||void 0===I||null===(o=I.data)||void 0===o||null===(i=o.comments)||void 0===i?void 0:i.map(O.ec))||[],D(B||[]),_(null===Z||void 0===Z||null===(r=Z.data)||void 0===r||null===(s=r.topics)||void 0===s?void 0:s.map(O.UA)),w(((null===E||void 0===E||null===(l=E.data)||void 0===l?void 0:l.communities)||[]).map(O.yf)),G(((null===T||void 0===T||null===(d=T.data)||void 0===d||null===(u=d.guidelines)||void 0===u||null===(m=u[0])||void 0===m?void 0:m.post)||[]).length>0),H(!0),q(((null===R||void 0===R||null===(v=R.data)||void 0===v?void 0:v.posts)||[]).map(O.W1)),e.next=31;break;case 30:setTimeout(X.current,1e3);case 31:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=(0,u.useRef)(J);return X.current=J,(0,u.useEffect)((function(){setTimeout(X.current,500)}),[null===t||void 0===t?void 0:t.id]),(0,u.useEffect)((function(){"undefined"!==typeof p&&(0,d.Z)(a().mark((function e(){var t,n,o,i;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(["expert"===(null===p||void 0===p?void 0:p.role)&&(null===f||void 0===f?void 0:f.isAskDoctor)&&(0,k.t9)((0,k.cN)(S.yy.COMMENT.LIST_OPPOSE_REASONS,{_locale:h}),"get")]);case 2:n=e.sent,o=(0,c.Z)(n,1),i=o[0],z(((null===i||void 0===i||null===(t=i.data)||void 0===t?void 0:t.reasons)||[]).map(O.Aw));case 6:case"end":return e.stop()}}),e)})))()}),[p]),(0,i.jsx)(pt,ct(ct(ct({},e),I),{},{post:f,communities:b,topics:P,comments:E,commentsPagination:R,opposeReasons:B,hasGuidelineList:F,refetchAlready:W}))}},14153:function(e,t,n){"use strict";n.d(t,{od:function(){return s},Em:function(){return a}});n(68929);var o={"vi-VN":"HelloBacsi","id-ID":"HelloSehat","ms-MY":"HelloDoktor","km-KH":"HelloKrupet","en-PH":"HelloDoctorPH","th-TH":"HelloKhunmor","my-MM":"HelloSayarwon","zh-TW":"HelloYishi","hi-IN":"HelloSwasthya"},i="Mobile",r="Desktop",s=function(e){var t=e.countryAdTag,n=e.slug;return"/21682272649/".concat(t,"/").concat(t,"_Community/").concat(n)},a=function(e,t){var n=t.isMobile;return o[e]+(n?i:r)}},74467:function(e,t,n){"use strict";n.d(t,{_Y:function(){return c},rd:function(){return u},uA:function(){return p},yD:function(){return m},Xi:function(){return h},DX:function(){return v},YF:function(){return f}});var o=n(809),i=n.n(o),r=n(92447),s=n(2810),a=n(24169),l=n(95983),d=n(13199),c=function(){var e=(0,r.Z)(i().mark((function e(t){var n,o,r,s,a,c,u,p,m,h,v,f,g,x,y,b,w;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.postId,o=t.message,r=t.photos,s=t.link,a=t.locale,c=t.replyingUserId,u=t.replyingUserName,p=t.replyingId,m=t.isAdmin,h=t.sourceList,v=t.type,f=t.isAnonymous,g=void 0!==f&&f,x=t.hideReplyMentionsInText,y=new FormData,b=(0,d.dM)(o.replace(/(\ )+/g," ")),w=(0,d.Dc)(b),!(r&&r.length>0)){e.next=9;break}return e.next=7,Promise.all(null===r||void 0===r?void 0:r.map((function(e){return(0,d.tx)(e,a,m)})));case 7:e.sent.filter(Boolean).slice(0,l.O_).forEach((function(e){y.append("images[]",e)}));case 9:return s&&y.append("link",s),null===w||void 0===w||w.forEach((function(e){y.append("mention_ids[]",e)})),y.append("post_id",n),p&&y.append("parent_id",p),c&&(w.unshift(c),x||(b='[mention+id="'.concat(c,'"+name="').concat((u||"").replace('"',"'"),'"]').concat(b)),y.append("parent_user_id",String(c))),null===h||void 0===h||h.forEach((function(e){y.append("sources[]",e)})),v&&y.append("type",v),y.append("is_anonymous",String(Number(g))),y.append("content",b),e.abrupt("return",y);case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),u=function(){var e=(0,r.Z)(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,a.cA)((0,a.cN)(s.yy.COMMENT.CREATE,{_locale:n}),"POST",{data:t,headers:{"Content-Type":"multipart/form-data"}}));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),p=function(){var e=(0,r.Z)(i().mark((function e(t,n,o,r){var l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=r?a.Cl:a.cA,e.abrupt("return",l((0,a.cN)(r?s.qf.COMMENT.UPDATE:s.yy.COMMENT.UPDATE,{_locale:o,id:t}),"POST",{data:n,headers:{"Content-Type":"multipart/form-data"}}));case 2:case"end":return e.stop()}}),e)})));return function(t,n,o,i){return e.apply(this,arguments)}}(),m=function(e){try{var t=e.match(/\[@([^\]]+)\]/),n=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:n}}catch(o){console.error(o)}return{text:""}},h=function(){var e=(0,r.Z)(i().mark((function e(t,n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,a.cA)((0,a.cN)(s.yy.COMMENT.REPLY,{_locale:n}),"POST",{data:t,headers:{"Content-Type":"multipart/form-data"}}));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),v=function(){var e=(0,r.Z)(i().mark((function e(t){var n,o,r,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.commentId,o=t.setLike,r=void 0!==o&&o,l=t.locale,e.abrupt("return",(0,a.cA)((0,a.cN)(r?s.yy.COMMENT.LIKE:s.yy.COMMENT.UNLIKE,{_locale:l,id:n}),"GET"));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),f=function(e){var t=e.id,n=e.locale;return(0,a.cA)((0,a.cN)(s.yy.COMMENT.DELETE,{_locale:n,id:t}),"DELETE")}},73963:function(e,t,n){"use strict";n.d(t,{Q:function(){return u}});var o=n(809),i=n.n(o),r=n(26265),s=n(92447),a=n(18953),l=n(95983);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function c(e){for(var t=1;t