"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3929],{O0Wn:function(e,t,a){a.d(t,{L:function(){return Logo}});var o=a("q1tI"),n=a("rqZo"),l=a("2IpA"),i=a("rBCA"),r=a("SPEo"),s=a("TFvo"),d=a("/MN3");let m=i.Z.div` position: relative; display: inline-flex; align-items: center; z-index: 0; .main-logo-icon { object-fit: contain; } &[data-logo-is-light] { > svg path { fill: #fff; } img { filter: brightness(0) invert(1); } } &[data-has-badge] { @supports (display: flex) and (gap: 1em) { gap: 0.5rem; } @supports not ((display: flex) and (gap: 1em)) { > img { margin-left: 0.25rem; } } } .common-logo-seasonal-left, .common-logo-seasonal-right { z-index: -1; max-width: unset; max-height: unset; pointer-events: none; } .common-logo-seasonal-left { position: absolute; top: 50%; left: 0; transform: translateY(-50%); pointer-events: none; } .common-logo-seasonal-right { position: absolute; top: 50%; right: 0; transform: translateY(-50%); } &[data-seasonal='christmas'] { padding-left: 37px; padding-right: 22px; .common-logo-seasonal-left { width: 125px; height: 56px; } .common-logo-seasonal-right { width: 23px; height: 17px; } ${r.M.mbDown} { padding-left: 30px; padding-right: 16px; .common-logo-seasonal-left { // width: 125px; height: 46px; } .common-logo-seasonal-right { // width: 23px; height: 12px; } } } &[data-seasonal='new-year'] { padding-right: 85px; .common-logo-seasonal-left { top: 35%; width: 100px; height: 56px; } .common-logo-seasonal-right { width: 85px; height: 54px; } ${r.M.mbDown} { padding-right: 0; .common-logo-seasonal-right { display: none; } } } &[data-seasonal='lunar-new-year'] { padding-left: 30px; padding-right: 35px; .common-logo-seasonal-left { width: 33px; height: 41px; } .common-logo-seasonal-right { width: 37px; height: 54px; } } &[data-seasonal='ramadan'] { &[data-type='hellosehat'] { padding-right: 35px; .common-logo-seasonal-left { width: 165px; height: unset; left: 6px; } .common-logo-seasonal-right { width: 33px; height: unset; } } &[data-type='hellodoktor'] { padding-right: 66px; .common-logo-seasonal-left { width: 133px; height: unset; left: 6px; } .common-logo-seasonal-right { width: 63px; height: unset; } } } &[data-seasonal='hung-king'] { &[data-type='hellobacsi'] { .common-logo-seasonal-left { width: 134px; height: unset; left: 50%; top: 50%; transform: translate(-50%, -50%); } } &[data-type='marryBaby'] { .common-logo-seasonal-left { width: 145px; height: unset; left: 50%; top: 50%; transform: translate(-50%, -50%); } } } &[data-seasonal='vn-independent-day'] { &[data-type='hellobacsi'], &[data-type='marryBaby'] { .common-logo-seasonal-left.desktop-only { width: unset; height: 56px; left: 65%; top: 50%; transform: translate(-50%, -50%); } } &[data-type='marryBaby'] { .common-logo-seasonal-left.desktop-only { left: 50%; z-index: 1; } } &[data-type='hellobacsi'], &[data-type='marryBaby'] { .common-logo-seasonal-left.mobile-only { width: unset; height: 56px; left: 60%; top: 50%; transform: translate(-50%, -50%); } } &[data-type='marryBaby'] { .common-logo-seasonal-left.mobile-only { left: 40%; z-index: 1; } } } .desktop-only { ${r.M.mbDown} { display: none; } } .mobile-only { ${r.M.mbUp} { display: none; } } `,p=i.Z.img` height: 16px; width: unset; margin-bottom: 4px; margin-left: -3px; `,isChristmas=e=>{let t=e.getDate(),a=e.getMonth();return 11===a&&t>=16&&t<=25},c={2023:[22,0],2024:[10,1],2025:[29,0],2026:[17,1],2027:[6,1],2028:[26,0],2029:[13,1],2030:[3,1],2031:[23,0],2032:[11,1],2033:[31,0],2034:[19,1],2035:[8,1],2036:[28,0],2037:[15,1],2038:[4,1],2039:[24,0],2040:[12,1]},u=[n.L.Vietnam,n.L.Taiwan,n.L.Indonesia,n.L.Malaysia],isLunarNewYear=e=>{let t=e.getFullYear(),a=c[t];if(!a)return!1;let o=new Date(t,a[1],a[0]),n=new Date(o);n.setDate(o.getDate()-7);let l=new Date(o);return l.setDate(o.getDate()+5),n<=e&&e<=l},isNewYear=e=>{let t=e.getDate(),a=e.getMonth();return 11===a&&t>=26||0===a&&t<=15},g=[{year:2024,start:[10,2],end:[8,3]},{year:2025,start:[1,2],end:[30,2]},{year:2026,start:[18,1],end:[19,2]},{year:2027,start:[8,1],end:[9,2]},{year:2028,start:[28,0],end:[26,1]},{year:2029,start:[16,0],end:[14,1]},{year:2030,start:[6,0],end:[4,1]},{year:2030,start:[26,11],end:[24,0,2031]},{year:2031,start:[15,11],end:[13,0,2032]},{year:2032,start:[4,11],end:[2,0,2033]}],isRamadan=e=>{let t=e.getFullYear(),a=g.filter(e=>e.year===t);return!!a.length&&a.some(a=>{let o=a.start[2]||t,n=new Date(o,a.start[1],a.start[0]),l=new Date(o,a.end[1],a.end[0]);return n<=e&&e<=l})},v={2024:[18,3],2025:[7,3],2026:[26,3],2027:[16,3],2028:[4,3],2029:[23,3],2030:[12,3],2031:[1,3],2032:[19,3],2033:[9,3],2034:[28,3],2035:[17,3]},isVNHungKing=e=>{let t=e.getFullYear(),a=v[t];if(!a)return!1;let o=new Date(t,a[1],a[0]),n=new Date(o);n.setDate(o.getDate()-1);let l=new Date(o);return l.setDate(o.getDate()+1),n<=e&&e<=l},isVN3004=e=>{let t=e.getFullYear(),a=new Date(t,3,30),o=new Date(a);o.setDate(a.getDate()-1);let n=new Date(a);return n.setDate(a.getDate()+2),o<=e&&e<=n},isLabourDay=e=>{let t=e.getFullYear(),a=new Date(t,4,1),o=new Date(a);o.setDate(a.getDate()-1);let n=new Date(a);return n.setDate(a.getDate()+1),o<=e&&e<=n},isVNIndependentDay=e=>{let t=e.getFullYear(),a=new Date(t,8,2),o=new Date(a);o.setDate(a.getDate()-1);let n=new Date(a);return n.setDate(a.getDate()+1),o<=e&&e<=n},Logo=({type:e,className:t,style:a,isLightLogo:i,customSize:r,badge:c,locale:g,dateForSeasonal:v,isPro:h})=>{let[y,w]=(0,o.useState)({isChristmas:!1,isLunarNewYear:!1,isNewYear:!1,isRamadan:!1,isVNHungKing:!1,isVN3004:!1,isLabourDay:!1,isVNIndependentDay:!1});return(0,o.useEffect)(()=>{if(!v||isNaN(new Date(v).getTime()))return;let e=new Date(v),t=isChristmas(e),a=u.includes(g)&&isLunarNewYear(e),o=!a&&isNewYear(e),l=isRamadan(e),i=g===n.L.Vietnam&&isVNHungKing(e),r=g===n.L.Vietnam&&isVN3004(e),s=g===n.L.Vietnam&&isLabourDay(e),d=g===n.L.Vietnam&&isVNIndependentDay(e);w({isChristmas:t,isLunarNewYear:a,isNewYear:o,isRamadan:l,isVNHungKing:i,isVN3004:r,isLabourDay:s,isVNIndependentDay:d})},[g,new Date(v).getDate()]),o.createElement(m,{className:t,style:a,"data-logo-is-light":i||void 0,"data-has-badge":!!c,"data-seasonal":y.isRamadan?"ramadan":y.isChristmas?"christmas":y.isLunarNewYear?"lunar-new-year":y.isNewYear?"new-year":y.isVNHungKing?"hung-king":y.isVN3004?"30-04":y.isLabourDay?"labour-day":y.isVNIndependentDay?"vn-independent-day":void 0,"data-type":e},y.isChristmas?o.createElement(o.Fragment,null,o.createElement(d.I,{alt:"left xmas logo",src:l.C.getAssetPath("logo/xmas-left.png"),className:"common-logo-seasonal-left"}),o.createElement(d.I,{alt:"right xmas logo",src:l.C.getAssetPath("logo/xmas-right.png"),className:"common-logo-seasonal-right"})):y.isNewYear?o.createElement(o.Fragment,null,o.createElement(d.I,{alt:"left new year logo",src:l.C.getAssetPath("logo/new-year-left.png"),className:"common-logo-seasonal-left"}),o.createElement(d.I,{alt:"right new year logo",src:l.C.getAssetPath("logo/new-year-right.png"),className:"common-logo-seasonal-right"})):y.isLunarNewYear?o.createElement(o.Fragment,null,o.createElement(d.I,{alt:"left lunar new year logo",loading:"lazy",src:l.C.getAssetPath("logo/lunar-new-year-left.png"),className:"common-logo-seasonal-left"}),o.createElement(d.I,{alt:"right lunar new year logo",loading:"lazy",src:l.C.getAssetPath("logo/lunar-new-year-right.png"),className:"common-logo-seasonal-right"})):y.isRamadan&&"hellosehat"===e?o.createElement(o.Fragment,null,o.createElement(d.I,{alt:"left ramadan logo",loading:"lazy",src:l.C.getAssetPath("logo/ramadan-sehat-left.png"),className:"common-logo-seasonal-left"}),o.createElement(d.I,{alt:"right ramadan logo",loading:"lazy",src:l.C.getAssetPath("logo/ramadan-sehat-right.png"),className:"common-logo-seasonal-right"})):y.isRamadan&&"hellodoktor"===e?o.createElement(o.Fragment,null,o.createElement(d.I,{alt:"left ramadan logo",loading:"lazy",src:l.C.getAssetPath("logo/ramadan-doktor-left.png"),className:"common-logo-seasonal-left"}),o.createElement(d.I,{alt:"right ramadan logo",loading:"lazy",src:l.C.getAssetPath("logo/ramadan-doktor-right.png"),className:"common-logo-seasonal-right"})):y.isVNHungKing&&("hellobacsi"===e||"marryBaby"===e)?o.createElement(o.Fragment,null,o.createElement(d.I,{alt:"Hung King logo",loading:"lazy",src:l.C.getAssetPath("logo/hung-king-bg.png"),className:"common-logo-seasonal-left"})):y.isVNIndependentDay&&("hellobacsi"===e||"marryBaby"===e)?o.createElement(o.Fragment,null,o.createElement(d.I,{alt:"VN Independent day logo",loading:"lazy",src:l.C.getAssetPath("logo/vn-independence-desktop.png"),className:"common-logo-seasonal-left desktop-only"}),o.createElement(d.I,{alt:"VN Independent day logo",loading:"lazy",src:l.C.getAssetPath("logo/vn-independence-mobile.png"),className:"common-logo-seasonal-left mobile-only"})):null,o.createElement(s.L,{type:e,width:null==r?void 0:r.width,height:null==r?void 0:r.height,isLight:i}),h?o.createElement(p,{src:l.C.getAssetPath("logo/pro-suffix.svg")}):null,c)}},"G+gm":function(e,t,a){a.d(t,{C:function(){return n}});var o=a("q1tI");let n=(0,o.forwardRef)(function(e,t){return o.createElement("circle",Object.assign({},e,{ref:t}),o.createElement("animate",{attributeName:"r",values:"4;8;4",dur:"2s",begin:"0s",repeatCount:"indefinite"}))})},"jZO+":function(e,t,a){a.d(t,{C:function(){return CardPost},S:function(){return SourceList},V:function(){return VerifiedTag},a:function(){return CardPostPopoverMore},b:function(){return CardReply},c:function(){return CardReplyPopover}});var o=a("ySIk"),n=a("q1tI"),l=a("xtxu"),i=a("oYLa"),r=a("ybaB"),s=a("ns0B"),d=a.n(s),m=a("NKbh"),p=a("2IpA"),c=a("58a8"),u=a("aZjv"),g=a("q/st"),v=a("zV7+"),h=a("rBCA"),y=a("SPEo"),w=a("iBNF"),f=a("sea2"),b=a("IQVP"),x=a("fhJG"),E=a("gzw/"),C=a("6XqM"),k=a("DCF0"),I=a("EmQz"),N=a("SyE+"),D=a("oTwY"),_=a("iZ8j"),S=a("e0pn"),T=a("LWwf"),P=a("PbOM"),R=a("bpvy"),M=a("OrYH"),A=a("Ag88"),z=a("iBpR"),j=a("3oiH"),L=a("xrdX"),V="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath fill='%233E3F58' d='M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M19 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2'/%3e%3c/svg%3e",O="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='3' height='13' fill='none'%3e%3ccircle cx='1.583' cy='6.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 6.417)'/%3e%3ccircle cx='1.583' cy='1.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 1.417)'/%3e%3ccircle cx='1.583' cy='11.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 11.417)'/%3e%3c/svg%3e",B="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M2 4h12'/%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.334 1.334 0 0 1 1.334 1.334V4m2 0v9.333a1.334 1.334 0 0 1-1.334 1.334H4.667a1.334 1.334 0 0 1-1.334-1.334V4zM6.667 7.333v4M9.333 7.333v4'/%3e%3c/svg%3e";let CardPostPopoverMore=({authorEmail:e,onDeletePost:t,shareUrl:a,post:l,className:i="",popoverClassName:s="",onEditPost:d})=>{let{data:{locale:h,userInfo:y,env:{isMarryBaby:w}}}=(0,n.useContext)(g.T),{t:f}=(0,r.u)(),[b,x]=(0,n.useState)(!1),[E,C]=(0,n.useState)(!1),[k,I]=(0,n.useState)(!1),{authActionWrapper:N}=(0,u.iV)(),D=e&&(null==y?void 0:y.email)&&e===String(null==y?void 0:y.email);return n.createElement("div",{className:i,onClick:e=>{e.preventDefault(),e.stopPropagation()}},k&&n.createElement(m.S,{url:a,text:null==l?void 0:l.title,onClose:()=>I(!1)}),E&&n.createElement(m.P,{thumbnail:p.C.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:f("popup.deletePost.title"),description:f("popup.deletePost.description"),acceptText:f("popup.deletePost.accept"),cancelText:f("popup.deletePost.cancel"),onAccept:()=>(0,o.a)(void 0,void 0,void 0,function*(){if((null==l?void 0:l.id)&&!b){x(!0);try{let e=yield(0,m.h)({id:l.id,locale:h});(null==e?void 0:e.status)===1&&(null==t||t())}catch(e){}x(!1)}}),onClose:()=>C(!1)}),n.createElement(v.b,{className:s,toggleButtonContent:n.createElement("img",{src:w?V:O,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:b},data:D?{isShowheader:!1,type:"list",list:[{icon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M7.17 3.236H2.995a1.193 1.193 0 0 0-1.193 1.192v8.35a1.193 1.193 0 0 0 1.193 1.192h8.35a1.193 1.193 0 0 0 1.192-1.192V8.603'/%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M11.643 2.341a1.265 1.265 0 0 1 1.789 1.79L7.766 9.795l-2.385.596.596-2.385z'/%3e%3c/svg%3e",label:f("actionPopover.edit"),onClick:d},{icon:B,label:f("actionPopover.delete"),onClick:()=>{N(()=>C(!0))}}]}:{isShowheader:!1,type:"list",list:[{icon:m.i,label:f("morePopover.report"),subTree:{title:f("morePopover.report.title"),description:f("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(c.R).map(e=>({label:c.R[e].label,reason:c.R[e].reportReasonText,reasonValue:e})).map(e=>({label:f(e.label),subTree:{title:f("morePopover.reportSubmit.title"),description:f("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>n.createElement(m.b,{reason:e.reasonValue,reasonText:f(e.reason),postId:null==l?void 0:l.id,onClose:()=>t&&t(!1)})}}))}}]}}))},$=h.Z.div` position: relative; margin-bottom: 24px; background: white; border-radius: ${w.r.borderRadius}; a { text-decoration: none; } ${y.M.mbDown} { margin-bottom: 8px; } &.flat-top { border-top-left-radius: 0; border-top-right-radius: 0; } .post-pin { padding: 0.5rem 1rem; border-radius: ${w.r.borderRadius} 6px 0 0; } .post-author { display: flex; align-items: center; justify-content: space-between; &.comment { padding-right: 2.6rem; } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${y.M.mbDown} { width: 32px; height: 32px; font-size: 16px; } } } .post-content-link-wrapper { color: inherit; cursor: pointer; .post-content-title { padding: 1rem 1rem 0; word-break: break-word; } } .social-preview-wrapper.has-image { margin-bottom: 5px; } .social-preview-wrapper, .image-preview-wrapper, .link-preview-wrapper { width: 100%; &[data-is-reply='true'] { padding-right: 1rem; padding-left: 1rem; } } .post-topics { padding: 0 1rem; } .post-reaction { background: none; border-radius: 0 0 6px 6px; &.hide-top-border { ::before { display: none; } } } .most-engaging-wrapper { padding: 1rem; cursor: pointer; .author-avatar-wrapper { width: 2rem; height: 2rem; font-size: 1rem; } .see-more-comments { width: 100%; padding: 12px 0 0; text-align: unset; } } &[data-most-engaging='true'] { border: none; ${y.M.mbDown} { margin: 1rem; border: 1px solid #e4e8ec; } } .top-divider { border-color: #e4e8ec; } .popover { .popover-menu__btn { display: flex; width: 1.5rem; height: 1rem; align-items: center; justify-content: center; padding: 0; background: transparent; &:hover { background-color: transparent; } } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 12.5px; } } } } } &[data-is-marrybaby='true'] { border: 1px solid #f3f3f3; border-radius: 1rem; /* shadow */ box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.08); .image-preview-wrapper, .link-preview-wrapper { padding-right: 1rem; padding-left: 1rem; } .popover { .popover-menu__btn { width: 24px; height: 24px; ${y.M.mbDown} { width: 18px; height: 18px; } } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 1rem; } width: 350px; ${y.M.mbDown} { max-width: calc(320px - 2rem); } } } } } .most-engaging-wrapper { position: relative; padding: 0; &::before { position: absolute; z-index: 5; top: 0; left: 50%; width: calc(100% - 2rem); height: 1px; background: #f3f3f3; content: ' '; transform: translateX(-50%); } } ${y.M.mbDown} { margin-bottom: 12px; } } `;var F="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e";let CardReplyPopover=({onDeleteComment:e,commentId:t,className:a="",popoverClassName:l=""})=>{let{data:{env:{isMarryBaby:i},locale:s},action:{pushNotifications:d}}=(0,n.useContext)(g.T),{t:p}=(0,r.u)(),[c,h]=(0,n.useState)(!1),{authActionWrapper:y}=(0,u.iV)();return n.createElement("div",{className:a,onClick:e=>{e.preventDefault(),e.stopPropagation()}},c&&n.createElement(m.P,{thumbnail:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cg stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' clip-path='url(%23a)'%3e%3cpath d='M2 4.008h12m-8.667 0V2.675a1.333 1.333 0 0 1 1.334-1.333h2.666a1.333 1.333 0 0 1 1.334 1.333v1.333m2 0v9.334a1.333 1.333 0 0 1-1.334 1.333H4.667a1.333 1.333 0 0 1-1.334-1.333V4.008zm-6 3.334v4m2.666-4v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='a'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:p("popup.deleteComment.title"),description:p("popup.deleteComment.description"),acceptText:p("popup.deletePost.accept"),cancelText:p("popup.deletePost.cancel"),onAccept:()=>(0,o.a)(void 0,void 0,void 0,function*(){var a;if(!t)return;let o=yield(0,m.j)({id:t,locale:s});(null==o?void 0:o.status)===1?(e&&e(),d({title:"",message:p("notification.success"),type:"success"})):d({title:"",message:(null===(a=null==o?void 0:o.messages)||void 0===a?void 0:a[0])||p("notification.failure"),type:"danger"})}),onClose:()=>h(!1)}),n.createElement(v.b,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:B,label:p("actionPopover.delete"),onClick:()=>{y(()=>{h(!0)})}}]},className:l,toggleButtonContent:n.createElement("img",{src:i?V:O,loading:"lazy"}),buttonProps:{}}))},Z=h.Z.div` .add-link { color: ${w.r.colors.primaryBase}; } `,Y=h.Z.div` margin: 16px 0; background: ${w.r.colors.yellow50}; padding: 5px 10px; border-radius: 2px; .icon { display: inline-block; vertical-align: middle; margin-right: 6px; } `,H=h.Z.div` display: flex; align-items: center; gap: 8px; `,U=h.Z.div` padding: 8px 16px; `,G=h.Z.div` margin-bottom: 12px; width: 100%; `,K=h.Z.div``,Q=h.Z.div` margin-bottom: 16px; `,q=h.Z.div` display: flex; flex-wrap: wrap; row-gap: 16px; ${y.M.tdUp} { align-items: center; column-gap: 24px; } `,W=h.Z.a` display: flex; align-items: center; gap: 16px; ${y.M.mbDown} { width: 100%; justify-content: space-between; } `,X=h.Z.div` display: flex; align-items: center; gap: 16px; `,J=h.Z.div` border-radius: ${w.r.borderRadius}; overflow: hidden; width: 48px; height: 48px; img { object-fit: cover; width: 100%; height: 100%; } `,RecommentCategories=({categories:e})=>{let{t}=(0,r.u)(),{data:{locale:a,env:{isMarryBaby:o}}}=(0,n.useContext)(g.T),l=(0,j.g)(a,o);return n.createElement(K,null,n.createElement(Q,null,n.createElement(i.H,{tag:"h6",as:"h5"},t("cardReply.recommentCategories.heading"))),n.createElement(q,null,e.map(e=>n.createElement(W,{href:l+e.permalink,key:String(e.termId),target:"_blank"},n.createElement(X,null,n.createElement(J,null,n.createElement("img",{src:e.featureImage||p.C.getAssetPath(o?"mb-logo.svg":"/logo/logomark.png"),alt:e.displayName,loading:"lazy"})),n.createElement(A.T,{size:"s3",weight:"bold"},e.displayName)),n.createElement(_.Z,{size:20,color:w.r.colors.gray400})))))},ee=h.Z.a` padding: 12px 0; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid ${w.r.colors.neutral100}; text-decoration: none; &:first-child { border-top: 0; } `,SourceItem=({postTitle:e,articleReviewed:t,modifiedTime:a,href:o})=>{let{t:l}=(0,r.u)(),i=(()=>{let{expert:e,editor:a,is_author:o}=t;if(e){let t={name:e.display_name,role:"expert",avatar:e.avatar};return o?Object.assign({title:l("articleAuthor.title.written-by")},t):"expert"===e.role?Object.assign({title:l("articleAuthor.title.expert")},t):Object.assign({title:l("articleAuthor.title.medical")},t)}if(a)return{title:l("articleAuthor.title.fact-check"),name:a.display_name,avatar:a.avatar}})();return n.createElement(ee,{href:o,title:e,target:"_blank"},n.createElement(A.T,{size:"s3",as:"h5",weight:"bold"},e),n.createElement("div",null,n.createElement(E.C,{avatar:null==i?void 0:i.avatar,avatarProps:{size:32},name:null==i?void 0:i.name,role:null==i?void 0:i.role,hideBackground:!0},n.createElement(E.C.SubTextRow,null,n.createElement(E.C.SubText,null,null==i?void 0:i.title," ",n.createElement("span",{style:{color:w.r.colors.gray800}},null==i?void 0:i.name)),n.createElement(E.C.SubDivider,null),n.createElement(E.C.SubText,null,a)))))};var et={header:"F4mmgSy",chevron:"A7QrQ7A"};let SourceList=e=>{var{listUrl:t,hideSourceList:a,categorySlug:s,editMode:d,collapseSource:m,onListChange:c,isMarryBaby:u}=e,v=(0,o._)(e,["listUrl","hideSourceList","categorySlug","editMode","collapseSource","onListChange","isMarryBaby"]);let{t:h}=(0,r.u)(),[y,x]=(0,n.useState)(t||[]),[E,C]=(0,n.useState)([]),[k,I]=(0,n.useState)([]),[N,_]=(0,n.useState)(!1);(0,n.useEffect)(()=>{a||(0,o.a)(void 0,void 0,void 0,function*(){_(!0);let e=y.map(e=>{let t=new URL(e),a=String(t.pathname).split("/").filter(e=>""!=e),o=t.origin,n=-1!==o.search("marrybaby.vn");return{isMarrySite:n,path:a[a.length-1],href:e}}),t=[...e.map(e=>(0,g.c)(e.isMarrySite?(0,g.s)(b.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0):(0,g.o)(b.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0),"GET"))],a=yield Promise.all(t);C(a.map((t,a)=>{var o,n;return(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.post)&&Object.assign(Object.assign({},(0,f.g)(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.post)),{href:e[a].href})}).filter(Boolean)),_(!1)})},[]),(0,n.useEffect)(()=>{!a&&(null==E?void 0:E.length)===0&&s&&(0,o.a)(void 0,void 0,void 0,function*(){var e;let t=yield(0,g.c)(u?(0,g.s)(b.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0):(0,g.o)(b.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0),"GET");(null==t?void 0:t.data)&&I([(0,f.h)(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.category)])})},[E]);let handleRemoveItem=e=>{x(t=>{let a=[...t];return a.splice(e,1),a}),C(t=>{let a=[...t];return a.splice(e,1),a})};return(0,n.useEffect)(()=>{null==c||c(y)},[y]),n.createElement("div",Object.assign({},v),!d&&n.createElement(Y,null,n.createElement("img",{className:"icon",src:p.C.getAssetPath("warning.svg"),alt:"warning",style:{marginBottom:"3px",width:"18px"},loading:"lazy"}),n.createElement(A.T,{size:"s3",as:"span",dangerouslySetInnerHTML:{__html:h("cardReply.disclaimer")}})),a?null:N?n.createElement(z.L,null):E.length>0||d?n.createElement(Z,null,n.createElement(R.U,{defaultValue:!m&&"accordion",styles:{control:{borderRadius:"inherit",'&[aria-expanded="false"]':{borderBottom:0}},chevron:{width:"32px",height:"32px"},content:{padding:0,borderBottom:0,borderTop:`1px solid ${w.r.colors.neutral100}`},item:{marginBottom:"16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",border:`1px solid ${w.r.colors.neutral100}`,borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px","&[data-active]":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},chevron:n.createElement("div",{className:et.chevron},n.createElement(S.Z,{color:w.r.colors.gray600,size:20}))},n.createElement(R.U.Item,{value:"accordion"},n.createElement(R.U.Control,null,n.createElement("div",{className:et.header},n.createElement(i.H,{as:"h4",tag:"h6"},h("cardReply.source")))),n.createElement(R.U.Panel,null,n.createElement(U,null,(E||[]).map((e,t)=>n.createElement(H,{key:String(t)},"object"==typeof e?n.createElement(SourceItem,Object.assign({},e)):n.createElement(G,null,n.createElement(M.I,{style:{width:"100%"},name:"source-list",value:e||"",size:"sm",onChange:e=>{x(a=>{let o=[...a];return o[t]=e,o}),C(a=>{let o=[...a];return o[t]=e,o})}})),d&&n.createElement(l.B,{size:"md",color:"transparent",icon:n.createElement(T.Z,null),onClick:()=>handleRemoveItem(t)}))),d&&n.createElement(l.B,{className:"add-link",color:"transparent",size:"md",icon:n.createElement(D.Z,{color:w.r.colors.primaryBase,size:18}),onClick:()=>{x(e=>[...e,""]),C(e=>[...e,""])}},"Add source")))))):n.createElement(RecommentCategories,{categories:k}))},ea=h.Z.div` position: relative; margin-bottom: 0; background: white; border-radius: ${w.r.borderRadius}; .verify-tag { margin-top: 12px; } .post-author { &.with-popover { padding-right: 2.6rem; } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${y.M.mbDown} { width: 32px; height: 32px; font-size: 16px; } } } .image-preview-wrapper, .link-preview-wrapper { width: 100%; &[data-is-reply='true'] { padding-right: 1rem; padding-left: 1rem; } } .post-reaction { background: none; border-radius: 0 0 6px 6px; } &[data-is-reply='true'] { > .post-author .author-avatar-wrapper { width: 20px; height: 20px; font-size: 10px; } } &[data-is-reply='false'] { border: 1px solid #e4e8ec; } .expert-wrapper { width: 100%; } &[data-has-booking='true'] { display: grid; .post-author { background-color: ${w.r.colors.primary50}; } .btn-wrapper { padding: 0 16px; .btn-booking { width: 100%; margin: 12px 0; } } } .comment-reply-wrapper { padding: 0 1rem; .more-cmt { .chevron-right { height: 1rem; width: 1rem; vertical-align: middle; } } } .top-divider { border-color: #e4e8ec; } .popover { position: absolute; top: 1.5rem; right: 1rem; .popover-menu__btn { display: flex; width: 1rem; height: 1rem; align-items: center; justify-content: center; padding: 0; background: transparent; &:hover { background-color: transparent; } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 12.5px; } } } } } } &[data-is-marrybaby='true'] { &[data-is-reply='false'] { border: none; } .image-preview-wrapper, .link-preview-wrapper { padding-right: 1rem; padding-left: 1rem; } .popover { .popover-menu__btn { width: 24px; height: 24px; } } margin-left: 56px; ${y.M.mbDown} { margin-left: 40px; } > .post-author { margin-left: -56px; ${y.M.mbDown} { margin-left: -40px; } .author-info { align-items: center; display: flex; align-items: center; .author-info-top { width: 100%; } .author-info-text-wrapper { justify-content: space-between; } } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${y.M.mbDown} { width: 24px; height: 24px; font-size: 12px; } } } &[data-is-reply] { > .post-author { .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${y.M.mbDown} { width: 24px; height: 24px; font-size: 12px; } } } } .comment-reply-wrapper { padding-right: 0; padding-left: 0; } .post-reaction { &::after { position: absolute; bottom: 0; left: 50%; width: calc(100% - 2rem); height: 1px; background: #f3f3f3; content: ' '; transform: translateX(-50%); } } .post-content-wrapper { padding-top: 0; padding-bottom: 0; ${y.M.mbDown} { padding-left: 0.5rem; } } ${y.M.mbDown} { margin-bottom: 12px; } } `,eo=(0,h.Z)(SourceList)` margin-top: 12px; padding: 0.5rem 1rem 1rem; `,VerifiedTag=({userId:e,avatar:t,name:a,role:o,title:i,className:s})=>{let{t:d}=(0,r.u)(),[m,p]=(0,n.useState)(!1);return n.createElement(n.Fragment,null,n.createElement(l.B,{className:`-dzIuHr ${s}`,color:"success",size:"xs",onClick:()=>p(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},n.createElement("span",{className:"text"},n.createElement(P.Z,{isSolid:!0,size:18,color:w.r.colors.green800,className:"icon"}),d("cardReply.verifyBy",{name:`${a||""}`}))),n.createElement(E.c,{open:m,onClose:()=>p(!1),profileModalProps:{zIndex:1e3}},n.createElement(C.a,{authorProps:{userId:e,avatar:t,name:a,role:o,title:i},hideQuestionTab:!0})))},CardReply=({className:e,style:t,comment:a,type:i="comment",level:s=0,replyingId:d,onPostCommentSuccess:p,post:c,onDeleteComment:h,refetchComment:y,hasQuickBookingEnable:w,handleMakeAppointment:f,cardAuthorProps:I,maxChars:D=600,disableShortenContent:_})=>{var S,T,P,R,M,A,z,j,V,O,B,$,F;let{data:{locale:Z,userInfo:Y,env:{isMarryBaby:H}}}=(0,n.useContext)(g.T),{t:U}=(0,r.u)(),[G,K]=(0,n.useState)(a||null),{id:Q,countLikes:q,content:W,replies:X=[],images:J=[],author:ee,liked:et,link:en,mentionedUser:el,mentions:ei}=G,{text:er,replyingTo:es}=(0,m.k)(W),{authActionWrapper:ed}=(0,u.iV)({_joinCommunityIds:[null===(S=null==c?void 0:c.community)||void 0===S?void 0:S.id],_joinTopicIds:null===(T=null==c?void 0:c.topics)||void 0===T?void 0:T.map(e=>e.id)}),[em,ep]=(0,n.useState)(4),ec=null!=Y&&!!Y.id&&(null==X?void 0:X.some(e=>e.author.id===Y.id)),addNewReply=e=>{K(t=>{if(!t.replies.find(t=>t.id===e.id)){t.replies.unshift(e);let a=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return y&&y(a),a}return t})},[eu,eg]=(0,n.useState)(!1),ev=(0,n.useMemo)(()=>"comment"===i&&X&&0!=X.length?X.sort((e,t)=>{let a=new Date(e.createdAt).getTime(),o=new Date(t.createdAt).getTime();return a>o?-1:a{var e,t;(null==ee?void 0:ee.hospitalId)&&(e=ee.hospitalId,(0,o.a)(void 0,void 0,void 0,function*(){var t;let a=yield(0,g.c)((0,g.g)(b.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:L.v[Z]}),"get");(null===(t=null==a?void 0:a._data)||void 0===t?void 0:t.branch)&&ek(null==a?void 0:a._data.branch)})),(null==ee?void 0:ee.doctorId)&&(t=ee.doctorId,(0,o.a)(void 0,void 0,void 0,function*(){var e;let a=yield(0,g.c)((0,g.g)(b.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:L.v[Z]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&eN(null==a?void 0:a._data.doctor)}))},[ee.hospitalId,ee.doctorId]);let eD=(null==eI?void 0:eI.valid_outpatient)||(null==eI?void 0:eI.valid_telemedicine),e_=((null==eC?void 0:eC.total_available_service)||(null==eC?void 0:eC.total_available_doctor))>0,eS=w&&(eD||e_),eT=(null===(R=null==G?void 0:G.author)||void 0===R?void 0:R.type)==="chatbot";return n.createElement(u.I_,{defaultParams:{_joinCommunityIds:[null===(M=null==c?void 0:c.community)||void 0===M?void 0:M.id],_joinTopicIds:null===(A=null==c?void 0:c.topics)||void 0===A?void 0:A.map(e=>e.id)}},n.createElement(ea,{className:e,style:t,"data-is-reply":!!s,"data-is-marrybaby":H,"data-has-booking":eS},"reply"===i&&n.createElement(N.D,{className:"top-divider",type:"solid"}),n.createElement("div",{style:{padding:"16px 16px 0"}},n.createElement(E.C,Object.assign({avatar:eb,name:ew,username:ef,timeText:null==c?void 0:c.createdTime,community:null==c?void 0:c.community,className:`post-author ${ey?"with-popover":""}`,type:i,userId:null==ee?void 0:ee.id,role:ex,expertId:null==ee?void 0:ee.partnerId,title:null==ee?void 0:ee.title,doctorId:null==ee?void 0:ee.doctorId,hospitalId:null==ee?void 0:ee.hospitalId,hasQuickBooking:eS,handleMakeAppointment:f,isAnonymous:(null==G?void 0:G.isAnonymous)||!!(null==c?void 0:c.isAnonymous)&&(null===(z=null==c?void 0:c.author)||void 0===z?void 0:z.username)===(null==ee?void 0:ee.username),hideBackground:eT,userType:null==ee?void 0:ee.type},I)),!!(null==G?void 0:G.isVerify)&&!(null==G?void 0:G.isOppose)&&n.createElement(VerifiedTag,{title:null===(j=null==G?void 0:G.userVerify)||void 0===j?void 0:j.title,name:null===(V=null==G?void 0:G.userVerify)||void 0===V?void 0:V.name,userId:null===(O=null==G?void 0:G.userVerify)||void 0===O?void 0:O.id,role:null===(B=null==G?void 0:G.userVerify)||void 0===B?void 0:B.role,avatar:null===($=null==G?void 0:G.userVerify)||void 0===$?void 0:$.avatar,className:"verify-tag"})),n.createElement(C.P,{className:"post-content-wrapper",replyingTo:es,mentionedUser:el,description:er,mentions:eE,maxChars:D,disableShortenContent:_}),n.createElement("span",null),n.createElement("span",null),J&&J.length>0?n.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},n.createElement(k.a,{images:J,authorName:null==ee?void 0:ee.username})):null,(!J||0===J.length)&&en?n.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},n.createElement(x.C,{url:en})):null,"most-engaging"!==i?n.createElement(n.Fragment,null,eT&&n.createElement(eo,{listUrl:null==G?void 0:G.source,categorySlug:null==G?void 0:G.categorySlug}),n.createElement(v.C,{type:v.c.reply,loveCount:q,replyCount:eh,className:"post-reaction",liked:et,isReplied:ec,hideCommentIcon:"reply"===i||eT,hasShare:!1,onCommentClick:()=>ed(()=>eg(e=>!e)),onCommentCountClick:()=>ed(()=>{eg(!0)}),onLikeClick:()=>ed(()=>(0,o.a)(void 0,void 0,void 0,function*(){if(Q){let e=yield(0,m.l)({commentId:Q,setLike:!et,locale:Z});1===e.status&&K(e=>Object.assign(Object.assign({},e),{liked:!et,countLikes:e.countLikes+(et?-1:1)}))}}))}),eu&&n.createElement(m.I,{replyingId:d||G.id,replyToName:ew,isReply:!0,onClose:()=>eg(!1),onPostSuccess:e=>{"reply"===i?p&&p(e):addNewReply(e)},post:c,replyingUser:ee}),"comment"===i&&X&&X.length>0?n.createElement("div",{className:"comment-reply-wrapper"},null===(F=null==ev?void 0:ev.slice(0,em))||void 0===F?void 0:F.map(e=>n.createElement(CardReply,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:s+1,replyingId:Q,onPostCommentSuccess:addNewReply,post:c,onDeleteComment:()=>{K(t=>Object.assign(Object.assign({},t),{replies:t.replies.filter(t=>t.id!==e.id),countReplies:t.countReplies-1}))},handleMakeAppointment:f,hasQuickBookingEnable:w})),eh>em&&n.createElement(n.Fragment,null,n.createElement(N.D,{className:"top-divider",type:"solid"}),n.createElement(l.B,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>ep(e=>e+4)},U("comment.seeMoreReplies",{count:eh-em}),n.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 12 4-4-4-4'/%3e%3c/svg%3e",loading:"lazy"})))):null):null,ey&&n.createElement(CardReplyPopover,{onDeleteComment:h,className:"popover",commentId:G.id})))},getMostEngagingComment=(e,t)=>(0,o.a)(void 0,void 0,void 0,function*(){var a,o,n;let l=yield(0,g.t)((0,g.e)(b.yy.COMMENT.LIST,{postId:e,_locale:t,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(n=null===(o=null===(a=null==l?void 0:l.data)||void 0===a?void 0:a.comments)||void 0===o?void 0:o.map(f.e))||void 0===n?void 0:n[0]}),CardPost=({className:e,style:t,hideViewMoreComment:a,showMostEngaging:s,onCommentClick:p,onCommentCountClick:h,onMostEngagingCommentClick:y,onPostCommentSuccess:w,disableCardLink:f,disableShortenContent:N,onDeletePost:D,onEditPost:_,post:S,mostEngagingComment:T,onDeleteComment:P,showInputComment:R,InlineCommentsComponent:M,hasQuickBookingEnable:A,handleMakeAppointment:z,onSaveUnsaveSuccess:j,cardAuthorProps:L,verticalReactions:V=!1})=>{let[O,B]=(0,n.useState)(S),[Z,Y]=(0,n.useState)(!1),[H,U]=(0,n.useState)(T),{community:G,topics:K,author:Q,slug:q,isPin:W,liked:X,photos:J,mentions:ee,title:et,description:ea,previewUrl:eo,likesCount:en,commentsCount:el,id:ei,commented:er}=O,{data:{locale:es,togetherUserId:ed,userInfo:em,env:{isMarryBaby:ep,togetherBasePath:ec}},action:{pushNotifications:eu}}=(0,n.useContext)(g.T),eg=!!(null==em?void 0:em.id),{t:ev}=(0,r.u)(),[eh,ey]=(0,n.useState)(R),ew=`${ec}/${(null==G?void 0:G.slug)||"_"}/${q||""}`,ef=`${(0,g.k)(es)}${ew}`,{authActionWrapper:eb}=(0,u.iV)((null==G?void 0:G.slug)?{_joinCommunityIds:[G.id],_joinTopicIds:null==K?void 0:K.map(e=>e.id)}:void 0),[ex,eE]=(0,n.useState)(!1);(0,n.useEffect)(()=>{ey(R)},[R]);let eC=(null==Q?void 0:Q.name)||(null==Q?void 0:Q.username)||"",ek=(null==Q?void 0:Q.username)||(null==Q?void 0:Q.name)||"",eI=null==Q?void 0:Q.avatar,eN=(null==O?void 0:O.isAnonymous)?void 0:null==Q?void 0:Q.role,[eD,e_]=(0,n.useState)(null),[eS,eT]=(0,n.useState)(null);(0,n.useEffect)(()=>{var e,t;(null==Q?void 0:Q.hospitalId)&&(e=Q.hospitalId,(0,o.a)(void 0,void 0,void 0,function*(){var t;let a=yield(0,g.c)((0,g.g)(b.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:g.l[es]}),"get");(null===(t=null==a?void 0:a._data)||void 0===t?void 0:t.branch)&&e_(null==a?void 0:a._data.branch)})),(null==Q?void 0:Q.doctorId)&&(t=Q.doctorId,(0,o.a)(void 0,void 0,void 0,function*(){var e;let a=yield(0,g.c)((0,g.g)(b.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:g.l[es]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&eT(null==a?void 0:a._data.doctor)}))},[Q.hospitalId,Q.doctorId]);let eP=(null==eS?void 0:eS.valid_outpatient)||(null==eS?void 0:eS.valid_telemedicine),eR=((null==eD?void 0:eD.total_available_service)||(null==eD?void 0:eD.total_available_doctor))>0;(0,n.useEffect)(()=>{(0,o.a)(void 0,void 0,void 0,function*(){if(ei&&el&&s&&!(null==T?void 0:T.id)){let e=yield getMostEngagingComment(ei,es);U(e)}})},[ei,es,el,s,null==T?void 0:T.id]),(0,n.useEffect)(()=>{U(T)},[null==T?void 0:T.id]);let onDeleteComment=e=>(0,o.a)(void 0,void 0,void 0,function*(){if(el>1&&(null==H?void 0:H.id)&&(null==H?void 0:H.id)===(null==e?void 0:e.id)){let e=yield getMostEngagingComment(ei,es);U(e)}B(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1})),P&&P(e)});return n.createElement(u.I_,{defaultParams:(null==G?void 0:G.slug)?{_joinCommunityIds:[G.id],_joinTopicIds:null==K?void 0:K.map(e=>e.id)}:void 0},Z&&n.createElement(m.S,{url:ef,avatar:c.D,text:et,onClose:()=>Y(!1)}),n.createElement($,{className:e,style:t,"data-is-marrybaby":ep},W?n.createElement(v.a,{className:"post-pin"}):null,n.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},n.createElement(E.C,Object.assign({avatar:eI,name:eC,username:ek,url:f?void 0:ew,community:G,timeText:null==O?void 0:O.createdTime,className:"post-author",role:eN,userId:null==Q?void 0:Q.id,expertId:null==Q?void 0:Q.partnerId,doctorId:null==Q?void 0:Q.doctorId,hospitalId:null==Q?void 0:Q.hospitalId,title:null==Q?void 0:Q.title,hasQuickBooking:A&&(eP||eR),handleMakeAppointment:z,"data-testid":"name",isAnonymous:!!(null==O?void 0:O.isAnonymous),extendEle:n.createElement(CardPostPopoverMore,{authorEmail:String(null==Q?void 0:Q.email),onDeletePost:D,shareUrl:ef,post:O,className:"popover",onEditPost:_})},L))),n.createElement("a",{href:f?void 0:ew,className:"post-content-link-wrapper"},et&&n.createElement(i.H,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},d()(et)),n.createElement(C.P,{className:"post-content-wrapper",description:ea,disableShortenContent:N,mentions:ee,"data-testid":"Content of the Post"})),n.createElement("span",null),n.createElement("span",null),n.createElement("div",{key:"tag-topic"},K&&K.length>0?n.createElement(v.T,{topics:K,className:"post-topics"}):null),n.createElement("div",{key:"social-preview"},(null==O?void 0:O.introUrl)?n.createElement("div",{className:`social-preview-wrapper ${(null==J?void 0:J.length)?"has-image":""}`},n.createElement(I.S,{url:O.introUrl,image:O.bannerImage})):null),n.createElement("div",{key:"image-preview"},(null==J?void 0:J.length)?n.createElement("div",{className:"image-preview-wrapper"},n.createElement(k.a,{images:J,authorName:null==Q?void 0:Q.name,isSensitive:!!(null==O?void 0:O.isSensitive)})):null),n.createElement("div",{key:"link-preview"},(null==O?void 0:O.introUrl)||(null==J?void 0:J.length)||null==eo||!eo.url?null:n.createElement("div",{className:"link-preview-wrapper"},n.createElement(x.C,{title:eo.title,url:eo.url,image:eo.image}))),n.createElement(v.C,{isMarryBaby:ep,type:v.c.post,loveCount:en,replyCount:el,className:`post-reaction ${(null==J?void 0:J.length)||(null==eo?void 0:eo.url)?"hide-top-border":""}`,liked:ex?!X:X,isReplied:er,isSaved:(null==O?void 0:O.bookmarked)||!1,onCommentClick:()=>eb(()=>{p?p():ey(e=>!e)}),onCommentCountClick:()=>{eb(()=>{ep?ey(!0):h?h():f||(window.location.href=ew)})},onShareClick:()=>{Y(!0)},onLikeClick:()=>(0,o.a)(void 0,void 0,void 0,function*(){eb(()=>(0,o.a)(void 0,void 0,void 0,function*(){if(ei&&!ex){eE(!0);try{let e=yield(0,m.m)({id:ei,locale:es});(null==e?void 0:e.status)!==1?eu((0,m.g)(ev)):B(e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked}))}catch(e){eu((0,m.g)(ev))}eE(!1)}}))}),onSaveClick:()=>{eb(()=>(0,o.a)(void 0,void 0,void 0,function*(){if((null==em?void 0:em.id)&&(null==O?void 0:O.id)){if(null==O?void 0:O.bookmarked){let e=yield(0,g.b)((0,g.e)(b.yy.BOOKMARK.DELETE,{_locale:es}),"DELETE",{headers:{"Content-Type":"application/json"},data:{post_id:String(O.id)}});(null==e?void 0:e.status)===1?(eu({title:"",message:ev("post.remove.success"),type:"success",displayIcon:F}),null==j||j()):eu({title:"",message:ev("post.remove.failed"),type:"danger",displayIcon:F})}else{let e=yield(0,g.b)((0,g.e)(b.yy.BOOKMARK.CREATE,{_locale:es}),"POST",{headers:{"Content-Type":"application/json"},data:{user_id:ed||em.id,post_id:O.id}});(null==e?void 0:e.status)===1?(eu({title:"",message:ev("post.save.success"),type:"success",displayIcon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23595959'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e"}),null==j||j()):eu({title:"",message:ev("post.save.failed"),type:"danger",displayIcon:F})}}}))},onGoToUrl:e=>{let t=e?`${ef}${e}`:ef;eg?window.location.href=t:eb(()=>window.location.href=t)},showingMostEngaging:!!(s&&(null==H?void 0:H.id)),isVertical:V}),eh&&n.createElement(m.I,{isMainCmt:!R,onClose:()=>ey(!1),onPostSuccess:e=>{0!==el||(null==H?void 0:H.id)||U(e),B(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0})),w&&w(e)},post:O}),s&&(null==H?void 0:H.id)?n.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{y?(e.stopPropagation(),y()):window.location.href=ew}},n.createElement(CardReply,{hasQuickBookingEnable:A,handleMakeAppointment:z,comment:H,post:O,onDeleteComment:()=>{onDeleteComment&&onDeleteComment(H)},className:"most-engaging-comment",type:"most-engaging",key:H.id,cardAuthorProps:L}),el>1&&!a&&n.createElement(l.B,{className:"see-more-comments",color:"ghost",size:"md"},ev("comment.seeMoreComments",{count:el-1}))):null,M))}},"2JFq":function(e,t,a){a.d(t,{T:function(){return Text}});var o=a("ySIk"),n=a("q1tI"),l=a("Ag88");let Text=e=>{var{size:t="base",type:a="regular"}=e,i=(0,o._)(e,["size","type"]);return n.createElement(l.T,Object.assign({size:t,weight:"caption"===a?"bold":a,"data-size":t,"data-type":a,"data-word-wrap":i.wordWrap,"data-is-uppercase":i.isUppercase},i))}}}]);