(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6047],{89019:function(t,e,i){"use strict";i.r(e),i.d(e,{__N_SSP:function(){return Ot},default:function(){return Ct}});var n=i(32292),o=i(85893),a=i(28140),r=i(809),l=i.n(r),s=i(92447),d=i(26265),c=i(67294),u=i(67148),p=i(67128),v=i(27484),m=i.n(v),h=i(11163),g=i(86896),f=i(25559),y=i(2810),x=i(24169),b=i(37125),j=i(40875),w=i(17985),T=i(35712),S=i(55795),O=i(18833),C=i(43196),P=i(38347),E=i(94044),D=i(36834),_=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o{var{size:e=24,color:i=D.SQ,useCurrentColor:n,isActive:o,activeColor:a=D.SK}=t,r=_(t,["size","color","useCurrentColor","isActive","activeColor"]);const l=n?"currentColor":o?a:i,s=Object.assign({width:e,height:e},r);return c.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none"},s),c.createElement("path",{d:"M13.071 12 9.25 8.18a1.061 1.061 0 0 1 1.5-1.5l4.614 4.613a1 1 0 0 1 0 1.414l-4.614 4.614a1.061 1.061 0 0 1-1.5-1.5z",fill:l}))},M=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o{var{size:e=24,color:i=D.SQ,useCurrentColor:n,isActive:o,activeColor:a=D.SK}=t,r=M(t,["size","color","useCurrentColor","isActive","activeColor"]);const l=n?"currentColor":o?a:i,s=Object.assign({width:e,height:e},r);return c.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none"},s),c.createElement("path",{d:"m10.929 12 3.821-3.82a1.061 1.061 0 0 0-1.5-1.5l-4.614 4.613a1 1 0 0 0 0 1.414l4.614 4.614a1.061 1.061 0 0 0 1.5-1.5z",fill:l}))},k=i(44036),N=(0,k.k)((function(t){var e=t.colors;return{root:{borderRadius:t.radius.md,padding:t.spacing.md,background:e[t.primaryColor][0],marginBottom:t.spacing.xl},heading:{marginBottom:"12px",fontWeight:600},controlArrow:{position:"absolute",top:0,left:0,display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px",borderRadius:"50%",border:0,background:"white",boxShadow:"rgb(0 0 0 / 4%) 0px 10px 16px, rgb(0 0 0 / 4%) 0px 2px 8px, rgb(0 0 0 / 4%) 0px 0px 1px","*":{pointerEvents:"none"}}}})),B=i(68866),L=i(93178),G=i(95983),Y=(0,k.k)((function(t){return{root:{display:"block",width:"84px",background:"white",padding:"4px",borderRadius:"12px",height:"100%","*":{pointerEvents:"none"}},thumb:{position:"relative",height:0,background:"white",paddingBottom:"100%",marginBottom:"8px",borderRadius:"8px",overflow:"hidden"},thumbInner:{position:"absolute",top:0,left:0,right:0,bottom:0},img:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",objectFit:"cover"},text:{fontSize:"12px",lineHeight:"18px",color:t.colors.gray[6],textAlign:"center",fontWeight:600,textTransform:"capitalize"},icon:{position:"absolute",right:"4px",bottom:"4px",width:"14px",height:"14px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:t.colors.green[0]}}})),R=function(t){var e=t.image,i=void 0===e?"":e,n=t.href,a=void 0===n?"#":n,r=t.title,l=t.hasTick,s=t.dataEventAction,d=(0,h.useRouter)().locale,c=void 0===d?"vi-VN":d,u=Y(void 0,{name:"HighlightSliderItem"}),p=u.classes,v=u.theme;return(0,o.jsxs)("a",{className:p.root,href:a,"data-event-category":"Together","data-event-action":s,"data-event-label":(0,B.g)(c)+a,children:[(0,o.jsxs)("div",{className:p.thumb,children:[(0,o.jsx)("div",{className:p.thumbInner,children:(0,o.jsx)("img",{alt:"",className:p.img,src:""!==i?i:G.YS})}),l&&(0,o.jsx)("div",{className:p.icon,children:(0,o.jsx)(L.Z,{color:v.colors.green[6]})})]}),r&&(0,o.jsx)("div",{className:p.text,children:r})]})};function Z(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function U(t){for(var e=1;e0?(0,o.jsx)(H,{isMobile:i,data:r,nextArrowDataEventAction:"Arrow Click",prevArrowDataEventAction:"Arrow Click",heading:n({id:"channelCommunity.topics",defaultMessage:"Topics"})}):null},z=i(66486),F=i(44432),V=i(73870),q=i(23464),Q=i(90098),J=i(58649),K=i(45093),X=i(167),$=i(19842),tt=i(21124),et=i(48253),it=i(26381),nt=i(50572),ot=i(5886),at=i(63792),rt=i(14153),lt=i(73963),st=i(50017),dt=i(51809),ct=i(16592),ut=i(36308),pt=i(10917),vt=i(91256),mt=i(70027),ht=i(96486),gt=i(32131),ft=vt.ZP.div.withConfig({displayName:"indexstyled__StyledCardCommunityWrapper",componentId:"sc-jc1yf3-0"})(["","{margin-bottom:32px;}","{border-bottom:1px solid ",";}"],ut.M.mbUp,ut.M.mbDown,pt.r.colors.neutral100),yt=vt.ZP.div.withConfig({displayName:"indexstyled__StyledListSection",componentId:"sc-jc1yf3-1"})([""]),xt=((0,vt.ZP)(gt.Y).withConfig({displayName:"indexstyled__StyledTopicCardList",componentId:"sc-jc1yf3-2"})([""]),(0,vt.ZP)((function(t){var e=t.data,i=void 0===e?[]:e,n=t.isMobile,r=(0,h.useRouter)().locale,l=void 0===r?"vi-VN":r,s=(0,g.Z)().formatMessage,d=i.filter((function(t){return(null===t||void 0===t?void 0:t.dueDateMonth)||!1})),c=new Date,u=c.getMonth()+1,p=c.getFullYear(),v=u+9>12,m=(0,ht.sortBy)(d.filter((function(t){var e=(null===t||void 0===t?void 0:t.dueDateYear)||0,i=(null===t||void 0===t?void 0:t.dueDateMonth)||0;return e=u&&((null===t||void 0===t?void 0:t.dueDateMonth)||0)<=u+9})),["dueDateMonth"])),(0,a.Z)(v?(0,ht.sortBy)(d.filter((function(t){return(t.dueDateYear||0)===p+1&&((null===t||void 0===t?void 0:t.dueDateMonth)||0)<=u+9-12})),["dueDateMonth"]):[])),y=[].concat((0,a.Z)(m),(0,a.Z)(f)).map((function(t){return{image:t.image,href:(0,C.k3)("/".concat(t.communitySlug,"/").concat(t.slug,"/")),title:(0,o.jsxs)(o.Fragment,{children:[(0,mt.Z)(new Date(2020,Number(t.dueDateMonth)-1,1),"MMMM",{locale:G.vm[l]}),(0,o.jsx)("div",{children:t.dueDateYear})]}),hasTick:t.joined,dueDateYear:t.dueDateYear,dueDateMonth:t.dueDateMonth,dataEventAction:"Birth Month Topic Click"}})),x=y.findIndex((function(t){return t.dueDateYear==p&&t.dueDateMonth==u}));return y.length>9?(0,o.jsx)(H,{isMobile:n,data:y,initialSlide:x,nextArrowDataEventAction:"Birth Month Arrow Click",prevArrowDataEventAction:"Birth Month Arrow Click",heading:s({id:"monthParentToBe.heading",defaultMessage:"Month parent-to-be"})}):null})).withConfig({displayName:"indexstyled__StyledMonthParentToBe",componentId:"sc-jc1yf3-3"})(["margin-bottom:20px;"])),bt=i(20367);function jt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function wt(t){for(var e=1;e(e.pinDate||"")?-1:e.pinDate&&(t.pinDate||"")=0?e.slice(0,e.indexOf("#")):e;window.history.replaceState(void 0,"",Tt[t]?i+"#"+Tt[t]:i)}})}),((null===Ut||void 0===Ut?void 0:Ut.highlightTopics)||[]).length>0&&(0,o.jsx)(W,{isMobile:jt,topics:(null===Ut||void 0===Ut?void 0:Ut.highlightTopics)||[]}),(0,o.jsx)(xt,{data:P,isMobile:jt})]})})}),(0,o.jsx)(bt.t.Container,{children:(0,o.jsxs)(bt.t.Row,{children:[(0,o.jsxs)(bt.t.LeftCol,{children:[(0,o.jsxs)(c.Fragment,{children:[!jt&&(0,o.jsx)(z._,{onCreatePostClick:function(t){Yt({type:nt.H.SHOW_CREATE_NEW_POST_POPUP,payload:!0}),Yt({type:nt.H.SET_ASK_DOCTOR_POST,payload:"undefined"!==typeof t?t:void 0})},className:"input-new-post",style:{marginBottom:"24px"}}),le&&(0,o.jsx)(S.V,{data:R}),Ot?(0,o.jsx)("div",{className:"pinned-post",children:(0,o.jsx)(ct.u,{children:(0,o.jsx)(q.X,{isPinned:!0,isMobile:jt,id:Ot.id,title:Ot.title,slug:Ot.slug,community:Ot.community,author:Ot.author,postDate:Ot.createdDate,topics:Ot.topics,photos:Ot.photos,previewUrl:Ot.previewUrl,description:Ot.description,viewCount:Ot.totalView,loveCount:Ot.likeCount,isLiked:Ot.isLiked,post:Ot,hasLinkWrapper:!0,onDeletePost:function(){return Ot.id&&Kt(Ot.id)}})})}):ee&&$t.length>0?(0,o.jsx)("div",{children:(0,o.jsx)(V.V,{articles:(0,$.W)({startIndex:0,count:3,articles:$t}),style:{borderTopLeftRadius:0,borderTopRightRadius:0}})}):null!==I&&void 0!==I&&I.isPinned&&null!==I&&void 0!==I&&I.toolLink?(0,o.jsx)("div",{children:(0,o.jsx)(ct.u,{children:(0,o.jsx)(J.F,{topicHealthTool:I})})}):null!==M&&void 0!==M&&M.isPinned&&null!==M&&void 0!==M&&M.chatBotId?(0,o.jsx)("div",{children:(0,o.jsx)(Q.S,{chatBotId:String(M.chatBotId)})}):null,(0,o.jsx)(F.C,{tabContent:[{name:gt({id:"choicePopover.latest"}),dataEventCategory:"Together",dataEventAction:"Latest Post Click",dataEventLabel:(0,x.Ow)(pt,mt),dataTestid:"Tab Latest"},{name:gt({id:"choicePopover.popular"}),dataEventCategory:"Together",dataEventAction:"Trending Post Click",dataEventLabel:(0,x.Ow)(pt,mt),dataTestid:"Tab Popular"}].concat((0,a.Z)(lt?[{name:gt({id:"choicePopover.questionAndAnswer"}),dataTestid:"Q&A",icon:(0,o.jsx)("img",{src:G.fn?(0,C.k3)("/svg/marrybaby/questionMb.svg"):(0,C.k3)("/svg/question.svg"),className:"info-text-icon",alt:""})}]:[])),onChange:function(t){2===t?Mt("seeding"):0===t?Mt("newest"):1===t&&Mt("popularity")},initialTab:0,className:"tab-sort-container"}),(0,o.jsx)("div",{ref:Qt,className:"posts",children:null===Ft||void 0===Ft?void 0:Ft.map((function(t,e){var i=e>0?e%12===4?["TopBanner"]:e%12===8?["MidBanner1"]:e%12===0?["MidBanner2"]:null:null;return(0,o.jsxs)(c.Fragment,{children:[ie&&jt&&i&&(0,o.jsx)(b.t,{adUnitPath:ne,size:[[300,250],[300,600]],divId:"div-gpt-ad-".concat(i.toString().toLowerCase(),"-mobile-")+e,pos:i,style:{margin:"1rem auto",borderColor:"#e4e8ec"}}),(0,o.jsx)(ct.u,{children:(0,o.jsx)(q.X,{isMobile:jt,title:t.title,id:t.id,slug:t.slug,community:t.community,author:t.author,postDate:t.createdDate,topics:t.topics,photos:t.photos,previewUrl:t.previewUrl,description:t.description,viewCount:t.totalView,loveCount:t.likeCount,isLiked:t.isLiked,post:t,hasLinkWrapper:!0,onDeletePost:function(){return t.id&&Kt(t.id)}})}),$t.length>0&&(e+1)%te===0&&(0,o.jsx)(V.V,{articles:(0,$.W)({startIndex:Math.floor((e+1)/te)+(ee?1:0),count:3,articles:$t})}),I&&(e+1)%((null===I||void 0===I?void 0:I.topicFrequency)||3)===0&&(0,o.jsx)(ct.u,{children:(0,o.jsx)(J.F,{topicHealthTool:I})}),M&&(e+1)%((null===M||void 0===M?void 0:M.topicFrequency)||3)===0&&(0,o.jsx)(Q.S,{chatBotId:String(M.chatBotId),belowCommunityPostId:t.id})]},t.id)}))})]},0),qt?(0,o.jsx)(dt.ZY,{"data-show":qt,children:(0,o.jsx)(w.W,{})}):null]}),(0,o.jsxs)(bt.t.RightCol,{children:[(0,o.jsxs)(yt,{children:[!jt&&(0,o.jsx)(bt.t.NewQuestionNoti,{}),(0,o.jsx)(bt.t.AboutIntro,{description:null===Ut||void 0===Ut?void 0:Ut.description}),(0,o.jsx)(j.R,{isBanner:!0}),(0,o.jsx)(bt.t.TopContributor,{communityId:Wt,hasGuidelineList:L}),(0,o.jsx)(bt.t.FeedBlock,{popularTopics:Y,hotDiscussion:R,style:jt?{display:"none"}:{}}),!jt&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(bt.t.ForumIntro,{communities:B,topicsBySelectedCommunity:P,selectedCommunity:Ut})})]}),ie&&!jt&&Ft.map((function(t,e){var i=e%3===0?["TopBanner"]:e%3===1?["MidBanner1"]:e%3===2?["MidBanner2"]:null;return i?(0,o.jsx)("div",{className:"ad-wrapper",children:(0,o.jsx)("div",{className:"ad-container",children:(0,o.jsx)(b.t,{adUnitPath:ne,size:[[300,250],[300,600]],divId:"div-gpt-ad-".concat(i.toString().toLowerCase(),"-desktop-")+e,pos:i,style:{margin:"1rem auto",borderColor:"#e4e8ec"}})})},"div-gpt-ad-".concat(i.toString().toLowerCase(),"-desktop-")+e):null}))]})]})})]}),ie&&(0,o.jsx)(b.E,{className:"article-bottom-ad",isMobile:jt,adUnitPath:ne})]})})},Ot=!0,Ct=function(t){var e=t.community,i=t.mappingCategorySlug,a=void 0===i?"":i,r=(0,c.useContext)(ot.I).state,d=(0,h.useRouter)().locale,p=void 0===d?"vi-VN":d,v=r.userInfo,g=(0,u.c)(a).type,b=(0,c.useState)(),j=b[0],w=b[1];return(0,c.useEffect)((function(){"undefined"!==typeof v&&(0,s.Z)(l().mark((function t(){var i,o,a,r,s,d,c,u,v,h,b,j,T,S,O,C,P,E,D,_,I,M,A,k,N,B,L,G,Y,R,Z,U,H,W,z,F,V,q,Q,J,K,X,$,tt,et,it,nt;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return k=new Date,m()().format("YYYY-MM-DD"),N=new Date(k.getTime()).setDate(k.getDate()-60),m()(N).format("YYYY-MM-DD"),t.next=6,Promise.all([(0,x.Jl)((0,x.cN)(y.yy.COMMUNITY.DETAIL_BY_ID_OR_SLUG,{idSlug:String(e.id),_locale:p}),"GET"),(0,x.Jl)((0,x.cN)(y.yy.POST.LIST,{pin:"1",communityId:String(e.id),_locale:p,page:"1",exclude_seeding:"1",sort:"newest"}),"GET"),(0,x.Jl)((0,x.cN)(y.yy.POST.LIST,{page:"1",communityId:String(e.id),sort:"newest",exclude_seeding:"1",_locale:p}),"GET"),(0,x.Jl)((0,x.cN)(y.yy.POST.LIST,{_locale:p,page:"1",is_seeding:"1"}),"GET"),(0,x.Jl)((0,x.cN)(y.yy.TOPIC.LIST,{communityId:String(e.id),_locale:p,pageSize:100}),"GET"),(0,x.Jl)((0,x.cN)(y.yy.COMMUNITY.LIST,{_locale:p}),"GET"),(0,x.t9)((0,x.cN)(y.yy.GUIDELINE.LIST,{_locale:p}),"GET"),(0,x.t9)((0,x.cN)(y.yy.COMMUNITY.GET_POPULAR_TOPICS,{communityId:String(e.id),_locale:p}),"GET"),(0,x.t9)((0,x.cw)(y.yy.COMMUNITY.GET_HOT_POST,{community_id:String(e.id),_locale:p}),"GET"),(0,x.t9)((0,x.R4)(y.D9.CATEGORY.GET_DETAIL_BY_ID,{id:e.mappedCategoryId||""}),"GET")]);case 6:return B=t.sent,L=(0,n.Z)(B,10),G=L[0],Y=L[1],R=L[2],Z=L[3],U=L[4],H=L[5],W=L[6],z=L[7],F=L[8],V=L[9],t.next=20,(0,lt.Q)(p);case 20:if(q=t.sent,Q=(null===U||void 0===U||null===(i=U.data)||void 0===i||null===(o=i.topics)||void 0===o?void 0:o.map(f.UA).sort((function(t,e){return(t.order||0)-(e.order||0)})))||[],J=(null===Y||void 0===Y||null===(a=Y.data)||void 0===a||null===(r=a.posts)||void 0===r?void 0:r.filter((function(t){return t.is_pin})).map(f.W1).sort((function(t,e){return t.pinDate&&t.pinDate>(e.pinDate||"")?-1:e.pinDate&&(t.pinDate||"")0,popularTopics:((null===z||void 0===z||null===(E=z.data)||void 0===E?void 0:E.topics)||[]).map(f.UA),hotDiscussion:((null===F||void 0===F||null===(D=F.data)||void 0===D?void 0:D.posts)||[]).map(f.W1),mappingCategorySlug:(null===V||void 0===V||null===(_=V.data)||void 0===_||null===(I=_.category)||void 0===I?void 0:I.slug)||"",hasSeedingPost:((null===Z||void 0===Z||null===(M=Z.data)||void 0===M||null===(A=M.pagination)||void 0===A?void 0:A.total_items)||0)>0,mappingCategory:g}));case 38:case"end":return t.stop()}}),t)})))()}),[v,e.id]),(0,o.jsx)(St,wt(wt({},t),j))}},25303:function(t,e,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/[communitySlug]",function(){return i(89019)}])}},function(t){t.O(0,[9774,9377,5239,4885,768,1255,2273,5382,1577,8846,7658,4728,9478,939,7782,5777,442,9238,1303,4410,7462,5897,6380,8806,5057,1016,8588,6072,4413,7151,3824,5093,4851,3951,2888,179],(function(){return e=25303,t(t.s=e);var e}));var e=t.O();_N_E=e}]);