"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9353],{"7p59":function(e,t,i){i.d(t,{D:function(){return Divider}});var o=i("q1tI"),n=i("rBCA"),a=i("iBNF");let r=n.Z.hr` border-width: 1px; border-color: ${a.r.colors.neutral200}; border-style: ${e=>e.dividerType}; `,Divider=({type:e="solid",className:t,style:i})=>o.createElement(r,{style:i,className:t,"data-diver-type":e,dividerType:e})},nemj:function(e,t,i){i.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=i("otAR"),n=i("q1tI"),a=i("ASLx"),r=i("D9+h"),l=i("Frmf"),s=i("ns0B"),d=i.n(s),c=i("nSMY"),p=i("38FU"),m=i("XSl0"),u=i("aZjv"),h=i("ejmp"),g=i("mkgP"),v=i("rBCA"),b=i("q+5q"),f=i("iBNF"),x=i("Qlgr"),y=i("IQVP"),w=i("0l3Q"),E=i("u7Sf"),k=i("b/MO"),C=i("Lrsm"),S=i("+HxS"),_=i("7p59"),T=i("vWP/"),I=i("VLUI"),P=i("h84G"),N=i("MZpI"),O=i("QaGV"),j=i("bpvy"),z=i("/IYt"),D=i("V50O"),M=i("Q/Ck"),R=i("iRra"),B=i("xrdX"),$="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",A="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",L="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:i,post:a,className:r="",popoverClassName:s="",onEditPost:d})=>{let{data:{locale:v,userInfo:b,env:{isMarryBaby:f}}}=(0,n.useContext)(h.T),{t:x}=(0,l.u)(),[y,w]=(0,n.useState)(!1),[E,k]=(0,n.useState)(!1),[C,S]=(0,n.useState)(!1),{authActionWrapper:_}=(0,u.iV)(),T=e&&(null==b?void 0:b.email)&&e===String(null==b?void 0:b.email);return n.createElement("div",{className:r,onClick:e=>{e.preventDefault(),e.stopPropagation()}},C&&n.createElement(c.S,{url:i,text:null==a?void 0:a.title,onClose:()=>S(!1)}),E&&n.createElement(c.P,{thumbnail:p.C.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:x("popup.deletePost.title"),description:x("popup.deletePost.description"),acceptText:x("popup.deletePost.accept"),cancelText:x("popup.deletePost.cancel"),onAccept:()=>(0,o._)(void 0,void 0,void 0,function*(){if((null==a?void 0:a.id)&&!y){w(!0);try{let e=yield(0,c.h)({id:a.id,locale:v});(null==e?void 0:e.status)===1&&(null==t||t())}catch(e){}w(!1)}}),onClose:()=>k(!1)}),n.createElement(g.b,{className:s,toggleButtonContent:n.createElement("img",{src:f?$:A,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:y},data:T?{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:x("actionPopover.edit"),onClick:d},{icon:L,label:x("actionPopover.delete"),onClick:()=>{_(()=>k(!0))}}]}:{isShowheader:!1,type:"list",list:[{icon:c.i,label:x("morePopover.report"),subTree:{title:x("morePopover.report.title"),description:x("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(m.R).map(e=>({label:m.R[e].label,reason:m.R[e].reportReasonText,reasonValue:e})).map(e=>({label:x(e.label),subTree:{title:x("morePopover.reportSubmit.title"),description:x("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>n.createElement(c.b,{reason:e.reasonValue,reasonText:x(e.reason),postId:null==a?void 0:a.id,onClose:()=>t&&t(!1)})}}))}}]}}))},F=v.Z.div` position: relative; margin-bottom: 24px; background: white; border-radius: ${f.r.borderRadius}; a { text-decoration: none; } ${b.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: ${f.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; ${b.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; ${b.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; ${b.M.mbDown} { width: 18px; height: 18px; } } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 1rem; } width: 350px; ${b.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%); } } ${b.M.mbDown} { margin-bottom: 12px; } } `;var H="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:i="",popoverClassName:a=""})=>{let{data:{env:{isMarryBaby:r},locale:s},action:{pushNotifications:d}}=(0,n.useContext)(h.T),{t:p}=(0,l.u)(),[m,v]=(0,n.useState)(!1),{authActionWrapper:b}=(0,u.iV)();return n.createElement("div",{className:i,onClick:e=>{e.preventDefault(),e.stopPropagation()}},m&&n.createElement(c.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._)(void 0,void 0,void 0,function*(){var i;if(!t)return;let o=yield(0,c.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===(i=null==o?void 0:o.messages)||void 0===i?void 0:i[0])||p("notification.failure"),type:"danger"})}),onClose:()=>v(!1)}),n.createElement(g.b,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:L,label:p("actionPopover.delete"),onClick:()=>{b(()=>{v(!0)})}}]},className:a,toggleButtonContent:n.createElement("img",{src:r?$:A,loading:"lazy"}),buttonProps:{}}))},V=v.Z.div` .add-link { color: ${f.r.colors.primaryBase}; } `,U=v.Z.div` margin: 16px 0; background: ${f.r.colors.yellow50}; padding: 5px 10px; border-radius: 2px; .icon { display: inline-block; vertical-align: middle; margin-right: 6px; } `,Z=v.Z.div` display: flex; align-items: center; gap: 8px; `,G=v.Z.div` padding: 8px 16px; `,W=v.Z.div` margin-bottom: 12px; width: 100%; `,Y=v.Z.div``,q=v.Z.div` margin-bottom: 16px; `,Q=v.Z.div` display: flex; flex-wrap: wrap; row-gap: 16px; ${b.M.tdUp} { align-items: center; column-gap: 24px; } `,K=v.Z.a` display: flex; align-items: center; gap: 16px; ${b.M.mbDown} { width: 100%; justify-content: space-between; } `,X=v.Z.div` display: flex; align-items: center; gap: 16px; `,J=v.Z.div` border-radius: ${f.r.borderRadius}; overflow: hidden; width: 48px; height: 48px; img { object-fit: cover; width: 100%; height: 100%; } `,RecommentCategories=({categories:e})=>{let{t}=(0,l.u)(),{data:{locale:i,env:{isMarryBaby:o}}}=(0,n.useContext)(h.T),a=(0,R.g)(i,o);return n.createElement(Y,null,n.createElement(q,null,n.createElement(r.H,{tag:"h6",as:"h5"},t("cardReply.recommentCategories.heading"))),n.createElement(Q,null,e.map(e=>n.createElement(K,{href:a+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(D.T,{size:"s3",weight:"bold"},e.displayName)),n.createElement(I.Z,{size:20,color:f.r.colors.gray400})))))},ee=v.Z.a` padding: 12px 0; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid ${f.r.colors.neutral100}; text-decoration: none; &:first-child { border-top: 0; } `,SourceItem=({postTitle:e,articleReviewed:t,modifiedTime:i,href:o})=>{let{t:a}=(0,l.u)(),r=(()=>{let{expert:e,editor:i,is_author:o}=t;if(e){let t={name:e.display_name,role:"expert",avatar:e.avatar};return o?Object.assign({title:a("articleAuthor.title.written-by")},t):"expert"===e.role?Object.assign({title:a("articleAuthor.title.expert")},t):Object.assign({title:a("articleAuthor.title.medical")},t)}if(i)return{title:a("articleAuthor.title.fact-check"),name:i.display_name,avatar:i.avatar}})();return n.createElement(ee,{href:o,title:e,target:"_blank"},n.createElement(D.T,{size:"s3",as:"h5",weight:"bold"},e),n.createElement("div",null,n.createElement(E.C,{avatar:null==r?void 0:r.avatar,avatarProps:{size:32},name:null==r?void 0:r.name,role:null==r?void 0:r.role,hideBackground:!0},n.createElement(E.C.SubTextRow,null,n.createElement(E.C.SubText,null,null==r?void 0:r.title," ",n.createElement("span",{style:{color:f.r.colors.gray800}},null==r?void 0:r.name)),n.createElement(E.C.SubDivider,null),n.createElement(E.C.SubText,null,i)))))};var et={header:"F4mmgSy",chevron:"A7QrQ7A"};let SourceList=e=>{var{listUrl:t,hideSourceList:i,categorySlug:s,editMode:d,collapseSource:c,onListChange:m,isMarryBaby:u}=e,g=(0,o.a)(e,["listUrl","hideSourceList","categorySlug","editMode","collapseSource","onListChange","isMarryBaby"]);let{t:v}=(0,l.u)(),[b,w]=(0,n.useState)(t||[]),[E,k]=(0,n.useState)([]),[C,S]=(0,n.useState)([]),[_,I]=(0,n.useState)(!1);(0,n.useEffect)(()=>{i||(0,o._)(void 0,void 0,void 0,function*(){I(!0);let e=b.map(e=>{let t=new URL(e),i=String(t.pathname).split("/").filter(e=>""!=e),o=t.origin,n=-1!==o.search("marrybaby.vn");return{isMarrySite:n,path:i[i.length-1],href:e}}),t=[...e.map(e=>(0,h.c)(e.isMarrySite?(0,h.s)(y.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0):(0,h.g)(y.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0),"GET"))],i=yield Promise.all(t);k(i.map((t,i)=>{var o,n;return(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.post)&&Object.assign(Object.assign({},(0,x.f)(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.post)),{href:e[i].href})}).filter(Boolean)),I(!1)})},[]),(0,n.useEffect)(()=>{!i&&(null==E?void 0:E.length)===0&&s&&(0,o._)(void 0,void 0,void 0,function*(){var e;let t=yield(0,h.c)(u?(0,h.s)(y.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0):(0,h.g)(y.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0),"GET");(null==t?void 0:t.data)&&S([(0,x.h)(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.category)])})},[E]);let handleRemoveItem=e=>{w(t=>{let i=[...t];return i.splice(e,1),i}),k(t=>{let i=[...t];return i.splice(e,1),i})};return(0,n.useEffect)(()=>{null==m||m(b)},[b]),n.createElement("div",Object.assign({},g),!d&&n.createElement(U,null,n.createElement("img",{className:"icon",src:p.C.getAssetPath("warning.svg"),alt:"warning",style:{marginBottom:"3px",width:"18px"},loading:"lazy"}),n.createElement(D.T,{size:"s3",as:"span",dangerouslySetInnerHTML:{__html:v("cardReply.disclaimer")}})),i?null:_?n.createElement(M.L,null):E.length>0||d?n.createElement(V,null,n.createElement(j.U,{defaultValue:!c&&"accordion",styles:{control:{borderRadius:"inherit",'&[aria-expanded="false"]':{borderBottom:0}},chevron:{width:"32px",height:"32px"},content:{padding:0,borderBottom:0,borderTop:`1px solid ${f.r.colors.neutral100}`},item:{marginBottom:"16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",border:`1px solid ${f.r.colors.neutral100}`,borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px","&[data-active]":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},chevron:n.createElement("div",{className:et.chevron},n.createElement(P.Z,{color:f.r.colors.gray600,size:20}))},n.createElement(j.U.Item,{value:"accordion"},n.createElement(j.U.Control,null,n.createElement("div",{className:et.header},n.createElement(r.H,{as:"h4",tag:"h6"},v("cardReply.source")))),n.createElement(j.U.Panel,null,n.createElement(G,null,(E||[]).map((e,t)=>n.createElement(Z,{key:String(t)},"object"==typeof e?n.createElement(SourceItem,Object.assign({},e)):n.createElement(W,null,n.createElement(z.I,{style:{width:"100%"},name:"source-list",value:e||"",size:"sm",onChange:e=>{w(i=>{let o=[...i];return o[t]=e,o}),k(i=>{let o=[...i];return o[t]=e,o})}})),d&&n.createElement(a.B,{size:"md",color:"transparent",icon:n.createElement(N.Z,null),onClick:()=>handleRemoveItem(t)}))),d&&n.createElement(a.B,{className:"add-link",color:"transparent",size:"md",icon:n.createElement(T.Z,{color:f.r.colors.primaryBase,size:18}),onClick:()=>{w(e=>[...e,""]),k(e=>[...e,""])}},"Add source")))))):n.createElement(RecommentCategories,{categories:C}))},ei=v.Z.div` position: relative; margin-bottom: 0; background: white; border-radius: ${f.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; ${b.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: ${f.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; ${b.M.mbDown} { margin-left: 40px; } > .post-author { margin-left: -56px; ${b.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; ${b.M.mbDown} { width: 24px; height: 24px; font-size: 12px; } } } &[data-is-reply] { > .post-author { .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.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; ${b.M.mbDown} { padding-left: 0.5rem; } } ${b.M.mbDown} { margin-bottom: 12px; } } `,eo=(0,v.Z)(SourceList)` margin-top: 12px; padding: 0.5rem 1rem 1rem; `,VerifiedTag=({userId:e,avatar:t,name:i,role:o,title:r,className:s})=>{let{t:d}=(0,l.u)(),[c,p]=(0,n.useState)(!1);return n.createElement(n.Fragment,null,n.createElement(a.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(O.Z,{isSolid:!0,size:18,color:f.r.colors.green800,className:"icon"}),d("cardReply.verifyBy",{name:`${i||""}`}))),n.createElement(E.c,{open:c,onClose:()=>p(!1),profileModalProps:{zIndex:1e3}},n.createElement(k.a,{authorProps:{userId:e,avatar:t,name:i,role:o,title:r},hideQuestionTab:!0})))},CardReply=({className:e,style:t,comment:i,type:r="comment",level:s=0,replyingId:d,onPostCommentSuccess:p,post:m,onDeleteComment:v,refetchComment:b,hasQuickBookingEnable:f,handleMakeAppointment:x,cardAuthorProps:S,maxChars:T=600,disableShortenContent:I})=>{var P,N,O,j,z,D,M,R,$,A,L,F,H;let{data:{locale:V,userInfo:U,env:{isMarryBaby:Z}}}=(0,n.useContext)(h.T),{t:G}=(0,l.u)(),[W,Y]=(0,n.useState)(i||null),{id:q,countLikes:Q,content:K,replies:X=[],images:J=[],author:ee,liked:et,link:en,mentionedUser:ea,mentions:er}=W,{text:el,replyingTo:es}=(0,c.k)(K),{authActionWrapper:ed}=(0,u.iV)({_joinCommunityIds:[null===(P=null==m?void 0:m.community)||void 0===P?void 0:P.id],_joinTopicIds:null===(N=null==m?void 0:m.topics)||void 0===N?void 0:N.map(e=>e.id)}),[ec,ep]=(0,n.useState)(4),em=null!=U&&!!U.id&&(null==X?void 0:X.some(e=>e.author.id===U.id)),addNewReply=e=>{Y(t=>{if(!t.replies.find(t=>t.id===e.id)){t.replies.unshift(e);let i=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return b&&b(i),i}return t})},[eu,eh]=(0,n.useState)(!1),eg=(0,n.useMemo)(()=>"comment"===r&&X&&0!=X.length?X.sort((e,t)=>{let i=new Date(e.createdAt).getTime(),o=new Date(t.createdAt).getTime();return i>o?-1:i{var e,t;(null==ee?void 0:ee.hospitalId)&&(e=ee.hospitalId,(0,o._)(void 0,void 0,void 0,function*(){var t;let i=yield(0,h.c)((0,h.b)(y.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:B.v[V]}),"get");(null===(t=null==i?void 0:i._data)||void 0===t?void 0:t.branch)&&eC(null==i?void 0:i._data.branch)})),(null==ee?void 0:ee.doctorId)&&(t=ee.doctorId,(0,o._)(void 0,void 0,void 0,function*(){var e;let i=yield(0,h.c)((0,h.b)(y.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:B.v[V]}),"get");(null===(e=null==i?void 0:i._data)||void 0===e?void 0:e.doctor)&&e_(null==i?void 0:i._data.doctor)}))},[ee.hospitalId,ee.doctorId]);let eT=(null==eS?void 0:eS.valid_outpatient)||(null==eS?void 0:eS.valid_telemedicine),eI=((null==ek?void 0:ek.total_available_service)||(null==ek?void 0:ek.total_available_doctor))>0,eP=f&&(eT||eI),eN=(null===(j=null==W?void 0:W.author)||void 0===j?void 0:j.type)==="chatbot";return n.createElement(u.I_,{defaultParams:{_joinCommunityIds:[null===(z=null==m?void 0:m.community)||void 0===z?void 0:z.id],_joinTopicIds:null===(D=null==m?void 0:m.topics)||void 0===D?void 0:D.map(e=>e.id)}},n.createElement(ei,{className:e,style:t,"data-is-reply":!!s,"data-is-marrybaby":Z,"data-has-booking":eP},"reply"===r&&n.createElement(_.D,{className:"top-divider",type:"solid"}),n.createElement("div",{style:{padding:"16px 16px 0"}},n.createElement(E.C,Object.assign({avatar:ey,name:ef,username:ex,timeText:null==m?void 0:m.createdTime,community:null==m?void 0:m.community,className:`post-author ${eb?"with-popover":""}`,type:r,userId:null==ee?void 0:ee.id,role:ew,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:eP,handleMakeAppointment:x,isAnonymous:(null==W?void 0:W.isAnonymous)||!!(null==m?void 0:m.isAnonymous)&&(null===(M=null==m?void 0:m.author)||void 0===M?void 0:M.username)===(null==ee?void 0:ee.username),hideBackground:eN,userType:null==ee?void 0:ee.type},S)),!!(null==W?void 0:W.isVerify)&&!(null==W?void 0:W.isOppose)&&n.createElement(VerifiedTag,{title:null===(R=null==W?void 0:W.userVerify)||void 0===R?void 0:R.title,name:null===($=null==W?void 0:W.userVerify)||void 0===$?void 0:$.name,userId:null===(A=null==W?void 0:W.userVerify)||void 0===A?void 0:A.id,role:null===(L=null==W?void 0:W.userVerify)||void 0===L?void 0:L.role,avatar:null===(F=null==W?void 0:W.userVerify)||void 0===F?void 0:F.avatar,className:"verify-tag"})),n.createElement(k.P,{className:"post-content-wrapper",replyingTo:es,mentionedUser:ea,description:el,mentions:eE,maxChars:T,disableShortenContent:I}),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(C.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(w.C,{url:en})):null,"most-engaging"!==r?n.createElement(n.Fragment,null,eN&&n.createElement(eo,{listUrl:null==W?void 0:W.source,categorySlug:null==W?void 0:W.categorySlug}),n.createElement(g.C,{type:g.c.reply,loveCount:Q,replyCount:ev,className:"post-reaction",liked:et,isReplied:em,hideCommentIcon:"reply"===r||eN,hasShare:!1,onCommentClick:()=>ed(()=>eh(e=>!e)),onCommentCountClick:()=>ed(()=>{eh(!0)}),onLikeClick:()=>ed(()=>(0,o._)(void 0,void 0,void 0,function*(){if(q){let e=yield(0,c.l)({commentId:q,setLike:!et,locale:V});1===e.status&&Y(e=>Object.assign(Object.assign({},e),{liked:!et,countLikes:e.countLikes+(et?-1:1)}))}}))}),eu&&n.createElement(c.I,{replyingId:d||W.id,replyToName:ef,isReply:!0,onClose:()=>eh(!1),onPostSuccess:e=>{"reply"===r?p&&p(e):addNewReply(e)},post:m,replyingUser:ee}),"comment"===r&&X&&X.length>0?n.createElement("div",{className:"comment-reply-wrapper"},null===(H=null==eg?void 0:eg.slice(0,ec))||void 0===H?void 0:H.map(e=>n.createElement(CardReply,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:s+1,replyingId:q,onPostCommentSuccess:addNewReply,post:m,onDeleteComment:()=>{Y(t=>Object.assign(Object.assign({},t),{replies:t.replies.filter(t=>t.id!==e.id),countReplies:t.countReplies-1}))},handleMakeAppointment:x,hasQuickBookingEnable:f})),ev>ec&&n.createElement(n.Fragment,null,n.createElement(_.D,{className:"top-divider",type:"solid"}),n.createElement(a.B,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>ep(e=>e+4)},G("comment.seeMoreReplies",{count:ev-ec}),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,eb&&n.createElement(CardReplyPopover,{onDeleteComment:v,className:"popover",commentId:W.id})))},getMostEngagingComment=(e,t)=>(0,o._)(void 0,void 0,void 0,function*(){var i,o,n;let a=yield(0,h.t)((0,h.f)(y.yy.COMMENT.LIST,{postId:e,_locale:t,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(n=null===(o=null===(i=null==a?void 0:a.data)||void 0===i?void 0:i.comments)||void 0===o?void 0:o.map(x.g))||void 0===n?void 0:n[0]}),CardPost=({className:e,style:t,hideViewMoreComment:i,showMostEngaging:s,onCommentClick:p,onCommentCountClick:v,onMostEngagingCommentClick:b,onPostCommentSuccess:f,disableCardLink:x,disableShortenContent:_,onDeletePost:T,onEditPost:I,post:P,mostEngagingComment:N,onDeleteComment:O,showInputComment:j,InlineCommentsComponent:z,hasQuickBookingEnable:D,handleMakeAppointment:M,onSaveUnsaveSuccess:R,cardAuthorProps:B,verticalReactions:$=!1})=>{let[A,L]=(0,n.useState)(P),[V,U]=(0,n.useState)(!1),[Z,G]=(0,n.useState)(N),{community:W,topics:Y,author:q,slug:Q,isPin:K,liked:X,photos:J,mentions:ee,title:et,description:ei,previewUrl:eo,likesCount:en,commentsCount:ea,id:er,commented:el}=A,{data:{locale:es,togetherUserId:ed,userInfo:ec,env:{isMarryBaby:ep,togetherBasePath:em}},action:{pushNotifications:eu}}=(0,n.useContext)(h.T),eh=!!(null==ec?void 0:ec.id),{t:eg}=(0,l.u)(),[ev,eb]=(0,n.useState)(j),ef=`${em}/${(null==W?void 0:W.slug)||"_"}/${Q||""}`,ex=`${(0,h.l)(es)}${ef}`,{authActionWrapper:ey}=(0,u.iV)((null==W?void 0:W.slug)?{_joinCommunityIds:[W.id],_joinTopicIds:null==Y?void 0:Y.map(e=>e.id)}:void 0),[ew,eE]=(0,n.useState)(!1);(0,n.useEffect)(()=>{eb(j)},[j]);let ek=(null==q?void 0:q.name)||(null==q?void 0:q.username)||"",eC=(null==q?void 0:q.username)||(null==q?void 0:q.name)||"",eS=null==q?void 0:q.avatar,e_=(null==A?void 0:A.isAnonymous)?void 0:null==q?void 0:q.role,[eT,eI]=(0,n.useState)(null),[eP,eN]=(0,n.useState)(null);(0,n.useEffect)(()=>{var e,t;(null==q?void 0:q.hospitalId)&&(e=q.hospitalId,(0,o._)(void 0,void 0,void 0,function*(){var t;let i=yield(0,h.c)((0,h.b)(y.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:h.m[es]}),"get");(null===(t=null==i?void 0:i._data)||void 0===t?void 0:t.branch)&&eI(null==i?void 0:i._data.branch)})),(null==q?void 0:q.doctorId)&&(t=q.doctorId,(0,o._)(void 0,void 0,void 0,function*(){var e;let i=yield(0,h.c)((0,h.b)(y.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:h.m[es]}),"get");(null===(e=null==i?void 0:i._data)||void 0===e?void 0:e.doctor)&&eN(null==i?void 0:i._data.doctor)}))},[q.hospitalId,q.doctorId]);let eO=(null==eP?void 0:eP.valid_outpatient)||(null==eP?void 0:eP.valid_telemedicine),ej=((null==eT?void 0:eT.total_available_service)||(null==eT?void 0:eT.total_available_doctor))>0;(0,n.useEffect)(()=>{(0,o._)(void 0,void 0,void 0,function*(){if(er&&ea&&s&&!(null==N?void 0:N.id)){let e=yield getMostEngagingComment(er,es);G(e)}})},[er,es,ea,s,null==N?void 0:N.id]),(0,n.useEffect)(()=>{G(N)},[null==N?void 0:N.id]);let onDeleteComment=e=>(0,o._)(void 0,void 0,void 0,function*(){if(ea>1&&(null==Z?void 0:Z.id)&&(null==Z?void 0:Z.id)===(null==e?void 0:e.id)){let e=yield getMostEngagingComment(er,es);G(e)}L(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1})),O&&O(e)});return n.createElement(u.I_,{defaultParams:(null==W?void 0:W.slug)?{_joinCommunityIds:[W.id],_joinTopicIds:null==Y?void 0:Y.map(e=>e.id)}:void 0},V&&n.createElement(c.S,{url:ex,avatar:m.a,text:et,onClose:()=>U(!1)}),n.createElement(F,{className:e,style:t,"data-is-marrybaby":ep},K?n.createElement(g.a,{className:"post-pin"}):null,n.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},n.createElement(E.C,Object.assign({avatar:eS,name:ek,username:eC,url:x?void 0:ef,community:W,timeText:null==A?void 0:A.createdTime,className:"post-author",role:e_,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:D&&(eO||ej),handleMakeAppointment:M,"data-testid":"name",isAnonymous:!!(null==A?void 0:A.isAnonymous),extendEle:n.createElement(CardPostPopoverMore,{authorEmail:String(null==q?void 0:q.email),onDeletePost:T,shareUrl:ex,post:A,className:"popover",onEditPost:I})},B))),n.createElement("a",{href:x?void 0:ef,className:"post-content-link-wrapper"},et&&n.createElement(r.H,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},d()(et)),n.createElement(k.P,{className:"post-content-wrapper",description:ei,disableShortenContent:_,mentions:ee,"data-testid":"Content of the Post"})),n.createElement("span",null),n.createElement("span",null),n.createElement("div",{key:"tag-topic"},Y&&Y.length>0?n.createElement(g.T,{topics:Y,className:"post-topics"}):null),n.createElement("div",{key:"social-preview"},(null==A?void 0:A.introUrl)?n.createElement("div",{className:`social-preview-wrapper ${(null==J?void 0:J.length)?"has-image":""}`},n.createElement(S.S,{url:A.introUrl,image:A.bannerImage})):null),n.createElement("div",{key:"image-preview"},(null==J?void 0:J.length)?n.createElement("div",{className:"image-preview-wrapper"},n.createElement(C.a,{images:J,authorName:null==q?void 0:q.name,isSensitive:!!(null==A?void 0:A.isSensitive)})):null),n.createElement("div",{key:"link-preview"},(null==A?void 0:A.introUrl)||(null==J?void 0:J.length)||null==eo||!eo.url?null:n.createElement("div",{className:"link-preview-wrapper"},n.createElement(w.C,{title:eo.title,url:eo.url,image:eo.image}))),n.createElement(g.C,{isMarryBaby:ep,type:g.c.post,loveCount:en,replyCount:ea,className:`post-reaction ${(null==J?void 0:J.length)||(null==eo?void 0:eo.url)?"hide-top-border":""}`,liked:ew?!X:X,isReplied:el,isSaved:(null==A?void 0:A.bookmarked)||!1,onCommentClick:()=>ey(()=>{p?p():eb(e=>!e)}),onCommentCountClick:()=>{ey(()=>{ep?eb(!0):v?v():x||(window.location.href=ef)})},onShareClick:()=>{U(!0)},onLikeClick:()=>(0,o._)(void 0,void 0,void 0,function*(){ey(()=>(0,o._)(void 0,void 0,void 0,function*(){if(er&&!ew){eE(!0);try{let e=yield(0,c.m)({id:er,locale:es});(null==e?void 0:e.status)!==1?eu((0,c.g)(eg)):L(e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked}))}catch(e){eu((0,c.g)(eg))}eE(!1)}}))}),onSaveClick:()=>{ey(()=>(0,o._)(void 0,void 0,void 0,function*(){if((null==ec?void 0:ec.id)&&(null==A?void 0:A.id)){if(null==A?void 0:A.bookmarked){let e=yield(0,h.e)((0,h.f)(y.yy.BOOKMARK.DELETE,{_locale:es}),"DELETE",{headers:{"Content-Type":"application/json"},data:{post_id:String(A.id)}});(null==e?void 0:e.status)===1?(eu({title:"",message:eg("post.remove.success"),type:"success",displayIcon:H}),null==R||R()):eu({title:"",message:eg("post.remove.failed"),type:"danger",displayIcon:H})}else{let e=yield(0,h.e)((0,h.f)(y.yy.BOOKMARK.CREATE,{_locale:es}),"POST",{headers:{"Content-Type":"application/json"},data:{user_id:ed||ec.id,post_id:A.id}});(null==e?void 0:e.status)===1?(eu({title:"",message:eg("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==R||R()):eu({title:"",message:eg("post.save.failed"),type:"danger",displayIcon:H})}}}))},onGoToUrl:e=>{let t=e?`${ex}${e}`:ex;eh?window.location.href=t:ey(()=>window.location.href=t)},showingMostEngaging:!!(s&&(null==Z?void 0:Z.id)),isVertical:$}),ev&&n.createElement(c.I,{isMainCmt:!j,onClose:()=>eb(!1),onPostSuccess:e=>{0!==ea||(null==Z?void 0:Z.id)||G(e),L(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0})),f&&f(e)},post:A}),s&&(null==Z?void 0:Z.id)?n.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{b?(e.stopPropagation(),b()):window.location.href=ef}},n.createElement(CardReply,{hasQuickBookingEnable:D,handleMakeAppointment:M,comment:Z,post:A,onDeleteComment:()=>{onDeleteComment&&onDeleteComment(Z)},className:"most-engaging-comment",type:"most-engaging",key:Z.id,cardAuthorProps:B}),ea>1&&!i&&n.createElement(a.B,{className:"see-more-comments",color:"ghost",size:"md"},eg("comment.seeMoreComments",{count:ea-1}))):null,z))}},FYZO:function(e,t,i){i.d(t,{T:function(){return Text}});var o=i("otAR"),n=i("q1tI"),a=i("V50O");let Text=e=>{var{size:t="base",type:i="regular"}=e,r=(0,o.a)(e,["size","type"]);return n.createElement(a.T,Object.assign({size:t,weight:"caption"===i?"bold":i,"data-size":t,"data-type":i,"data-word-wrap":r.wordWrap,"data-is-uppercase":r.isUppercase},r))}},wZ5N:function(e,t,i){i.d(t,{B:function(){return BabyVaccineForm}});var o,n,a=i("otAR"),r=i("q1tI"),l=i("iuhU"),s=i("8vDj"),d=i("cChf"),c=i("ZFu2"),p=i("tYXV"),m=i("V50O"),u=i("Frmf"),h=i("DbhK"),g=i("UHeE"),v=i("lzTa"),b=i("fkrl");let f=(0,r.createContext)({}),DefaultLayout=e=>{var t=(0,a.a)(e,[]);let{t:i}=(0,u.u)(),{currentUrl:o,submitProps:n,form:s}=(0,r.useContext)(f),{classes:d={}}=(0,r.useContext)(h.C);return r.createElement(g.H,Object.assign({formLayout:"default"},t),r.createElement(g.H.FormRow,null,r.createElement(v.G,Object.assign({isBaby:!0},s.getInputProps("gender")))),r.createElement(g.H.FormRow,null,r.createElement(p.D,Object.assign({label:r.createElement(m.T,{size:"p2",weight:"semiBold"},i("babyGrowth.input.birthday")),placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0},maxDate:new Date},s.getInputProps("age")))),r.createElement(g.H.FormRow,{className:d.submitWrapper},r.createElement(g.H.Submit,Object.assign({type:"submit",className:(0,l.default)("due-date-calculate-button",d.submitBtn),dataEventCategory:"Health Tool",dataEventAction:"Vaccination Tool",dataEventLabel:o},n),i("dueDatePage.lastPeriod.calculate"))))},InlineLayout=e=>{var t=(0,a.a)(e,[]);let{t:i}=(0,u.u)(),{currentUrl:o,submitProps:n,form:s}=(0,r.useContext)(f),{classes:d={}}=(0,r.useContext)(h.C);return r.createElement(g.H,Object.assign({formLayout:"inline"},t),r.createElement(g.H.FormRow,null,r.createElement(g.H.BorderInlineControl,{label:i("tools.selectBabyGender"),width:"none"},r.createElement(v.G,Object.assign({isBaby:!0,hideLabel:!0,type:"radio"},s.getInputProps("gender")))),s.errors.gender&&r.createElement(g.H.Error,null,s.errors.gender)),r.createElement(g.H.FormRow,null,r.createElement(g.H.BorderInlineControl,{label:i("babyGrowth.input.birthday")},r.createElement(p.D,Object.assign({placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0},maxDate:new Date},s.getInputProps("age"),{error:null}))),s.errors.age&&r.createElement(g.H.Error,null,s.errors.age)),r.createElement(g.H.FormRow,{className:d.submitWrapper},r.createElement(g.H.Submit,Object.assign({type:"submit",className:(0,l.default)("due-date-calculate-button",d.submitBtn),dataEventCategory:"Health Tool",dataEventAction:"Vaccination Tool",dataEventLabel:o},n),i("dueDatePage.lastPeriod.calculate"))))},MbLayout=e=>{var t=(0,a.a)(e,[]);let{t:i}=(0,u.u)(),{currentUrl:o,submitProps:n,form:l}=(0,r.useContext)(f);return r.createElement(g.H,Object.assign({formLayout:"default"},t),r.createElement(g.H.Control,null,r.createElement(v.G,Object.assign({isBaby:!0},l.getInputProps("gender"),{error:null}))),l.errors.gender&&r.createElement(g.H.Error,null,l.errors.gender),r.createElement(g.H.FormRow,null,r.createElement(g.H.BorderBoxControl,{label:i("babyGrowth.input.birthday"),rightSection:r.createElement(b.Z,null)},r.createElement(p.D,Object.assign({placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0},maxDate:new Date,rightSection:null},l.getInputProps("age"),{error:null}))),l.errors.age&&r.createElement(g.H.Error,null,l.errors.age)),r.createElement(g.H.Submit,Object.assign({type:"submit",className:"due-date-calculate-button",dataEventCategory:"Health Tool",dataEventAction:"Vaccination Tool",dataEventLabel:o},n),i("dueDatePage.lastPeriod.calculate")))};(o=n||(n={}))[o.trackPeriod=0]="trackPeriod",o[o.conceive=1]="conceive",o[o.avoidPregnancy=2]="avoidPregnancy";let BabyVaccineForm=e=>{var{formLayout:t="default",submitProps:i,currentUrl:o,onSubmit:n}=e,l=(0,a.a)(e,["formLayout","submitProps","currentUrl","onSubmit"]);let{t:p}=(0,u.u)(),m=(0,s.rZ)(),h="mb"===m.other.template,g=(0,d.c)({validate:{gender:(0,c.U)(p("validation.error.requiredField")),age:(0,c.U)(p("validation.error.requiredField"))}}),v=Object.assign({onSubmit:g.onSubmit(n)},l);return r.createElement(f.Provider,{value:{submitProps:i,currentUrl:o,form:g}},"inline"===t?r.createElement(InlineLayout,Object.assign({},v)):h?r.createElement(MbLayout,Object.assign({formLayout:t},v)):r.createElement(DefaultLayout,Object.assign({},v)))}},"1WmY":function(e,t,i){i.d(t,{C:function(){return a},F:function(){return r},G:function(){return GlobalTextStyleNew},T:function(){return TemplateProvider},a:function(){return d},u:function(){return useTemplateVariant}});var o,n,a,r,l=i("mYVa"),s=i("q1tI");(o=a||(a={})).LEADGEN="leadgen",o.NONE="none",(n=r||(r={}))[n.regular=400]="regular",n[n.halfBold=500]="halfBold",n[n.semiBold=600]="semiBold",n[n.bold=700]="bold";let d={[a.NONE]:{fontSize:{base:[(0,l.h)(16),(0,l.h)(16)],lg:[(0,l.h)(18),(0,l.h)(16)],md:[(0,l.h)(18),(0,l.h)(16)],sm:[(0,l.h)(16),(0,l.h)(14)],xs:[(0,l.h)(14),(0,l.h)(12)],s1:[(0,l.h)(22),(0,l.h)(18)],s2:[(0,l.h)(18),(0,l.h)(16)],s3:[(0,l.h)(16),(0,l.h)(14)],s4:[(0,l.h)(14),(0,l.h)(12)],s5:[(0,l.h)(12),(0,l.h)(12)],p1:[(0,l.h)(18),(0,l.h)(16)],p2:[(0,l.h)(16),(0,l.h)(16)],p3:[(0,l.h)(16),(0,l.h)(14)],p4:[(0,l.h)(14),(0,l.h)(12)],p5:[(0,l.h)(12),(0,l.h)(12)],c1:[(0,l.h)(16),(0,l.h)(14)],c2:[(0,l.h)(14),(0,l.h)(12)],n1:[(0,l.h)(12),(0,l.h)(12)],label1:[(0,l.h)(14),(0,l.h)(14)],label2:[(0,l.h)(12),(0,l.h)(12)],h1:[(0,l.h)(40),(0,l.h)(26)],h2:[(0,l.h)(32),(0,l.h)(24)],h3:[(0,l.h)(26),(0,l.h)(20)],h4:[(0,l.h)(22),(0,l.h)(18)],h5:[(0,l.h)(18),(0,l.h)(16)],h5New:[(0,l.h)(20),(0,l.h)(18)],h6:[(0,l.h)(16),(0,l.h)(14)],title1:[(0,l.h)(17),(0,l.h)(17)],title2:[(0,l.h)(15),(0,l.h)(15)],body2:[(0,l.h)(15),(0,l.h)(15)]},lineHeight:{base:[(0,l.h)(24),(0,l.h)(24)],lg:[(0,l.h)(32),(0,l.h)(28)],md:[(0,l.h)(32),(0,l.h)(28)],sm:[(0,l.h)(24),(0,l.h)(22)],xs:[(0,l.h)(24),(0,l.h)(18)],s1:[(0,l.h)(32),(0,l.h)(26)],s2:[(0,l.h)(28),(0,l.h)(24)],s3:[(0,l.h)(24),(0,l.h)(24)],s4:[(0,l.h)(22),(0,l.h)(18)],s5:[(0,l.h)(18),(0,l.h)(18)],p1:[(0,l.h)(28),(0,l.h)(28)],p2:[(0,l.h)(24),(0,l.h)(24)],p3:[(0,l.h)(24),(0,l.h)(22)],p4:[(0,l.h)(22),(0,l.h)(18)],c1:[(0,l.h)(24),(0,l.h)(22)],c2:[(0,l.h)(22),(0,l.h)(18)],n1:[(0,l.h)(18),(0,l.h)(18)],label1:[(0,l.h)(22),(0,l.h)(22)],label2:[(0,l.h)(18),(0,l.h)(18)],h1:[(0,l.h)(52),(0,l.h)(34)],h2:[(0,l.h)(42),(0,l.h)(32)],h3:[(0,l.h)(36),(0,l.h)(26)],h4:[(0,l.h)(32),(0,l.h)(26)],h5:[(0,l.h)(28),(0,l.h)(24)],h5New:[(0,l.h)(28),(0,l.h)(24)],h6:[(0,l.h)(24),(0,l.h)(22)],title1:[(0,l.h)(24),(0,l.h)(24)],title2:[(0,l.h)(24),(0,l.h)(24)],body2:[(0,l.h)(24),(0,l.h)(24)]},letterSpacing:{lg:[-.2,0],md:[-.2,0],sm:[0,-.2],s1:[-.6,-.6],s2:[-.4,-.2],s3:[0,-.2],s4:[0,-.2],p1:[-.2,-.2],p2:[0,-.2],p3:[0,-.2],p4:[-.2,0],label1:[0,-.2],h1:[-1.2,-.9],h2:[-1,-.8],h3:[-.8,-.7],h4:[-.6,-.6],h5:[-.2,-.2],h5New:[-.4,-.4],h6:[0,-.2],title1:[-.4,-.4],title2:[-.3,-.3],body2:[-.3,-.3]},fontWeightBySize:{s1:r.semiBold,s2:r.semiBold,s3:r.semiBold,s4:r.semiBold,h1:r.bold,h2:r.bold,h3:r.bold,h4:r.bold,h5:r.bold,h5New:r.semiBold,h6:r.bold},fontWeight:r},[a.LEADGEN]:{fontSize:{base:[(0,l.h)(16),(0,l.h)(16)],lg:[(0,l.h)(18),(0,l.h)(16)],md:[(0,l.h)(18),(0,l.h)(16)],sm:[(0,l.h)(16),(0,l.h)(14)],xs:[(0,l.h)(14),(0,l.h)(12)],s1:[(0,l.h)(22),(0,l.h)(18)],s2:[(0,l.h)(18),(0,l.h)(16)],s3:[(0,l.h)(16),(0,l.h)(14)],s4:[(0,l.h)(14),(0,l.h)(12)],s5:[(0,l.h)(12),(0,l.h)(12)],p1:[(0,l.h)(17),(0,l.h)(17)],p2:[(0,l.h)(15),(0,l.h)(15)],p3:[(0,l.h)(13),(0,l.h)(13)],p4:[(0,l.h)(14),(0,l.h)(12)],p5:[(0,l.h)(12),(0,l.h)(12)],c1:[(0,l.h)(12),(0,l.h)(12)],c2:[(0,l.h)(11),(0,l.h)(11)],n1:[(0,l.h)(12),(0,l.h)(12)],label1:[(0,l.h)(14),(0,l.h)(14)],label2:[(0,l.h)(12),(0,l.h)(12)],h1:[(0,l.h)(40),(0,l.h)(26)],h2:[(0,l.h)(32),(0,l.h)(24)],h3:[(0,l.h)(26),(0,l.h)(22)],h4:[(0,l.h)(22),(0,l.h)(20)],h5:[(0,l.h)(18),(0,l.h)(16)],h5New:[(0,l.h)(20),(0,l.h)(18)],h6:[(0,l.h)(16),(0,l.h)(14)],title1:[(0,l.h)(17),(0,l.h)(17)],title2:[(0,l.h)(15),(0,l.h)(15)],body2:[(0,l.h)(15),(0,l.h)(15)],overline:[(0,l.h)(11),(0,l.h)(11)],subText:[(0,l.h)(10),(0,l.h)(10)]},lineHeight:{base:[(0,l.h)(24),(0,l.h)(24)],lg:[(0,l.h)(32),(0,l.h)(28)],md:[(0,l.h)(32),(0,l.h)(28)],sm:[(0,l.h)(24),(0,l.h)(22)],xs:[(0,l.h)(24),(0,l.h)(18)],s1:[(0,l.h)(32),(0,l.h)(26)],s2:[(0,l.h)(28),(0,l.h)(24)],s3:[(0,l.h)(24),(0,l.h)(24)],s4:[(0,l.h)(22),(0,l.h)(18)],s5:[(0,l.h)(18),(0,l.h)(18)],p1:[(0,l.h)(28),(0,l.h)(28)],p2:[(0,l.h)(24),(0,l.h)(24)],p3:[(0,l.h)(20),(0,l.h)(20)],p4:[(0,l.h)(22),(0,l.h)(18)],c1:[(0,l.h)(16),(0,l.h)(16)],c2:[(0,l.h)(22),(0,l.h)(18)],n1:[(0,l.h)(18),(0,l.h)(18)],label1:[(0,l.h)(22),(0,l.h)(22)],label2:[(0,l.h)(18),(0,l.h)(18)],h1:[(0,l.h)(48),(0,l.h)(34)],h2:[(0,l.h)(40),(0,l.h)(32)],h3:[(0,l.h)(32),(0,l.h)(32)],h4:[(0,l.h)(32),(0,l.h)(28)],h5:[(0,l.h)(28),(0,l.h)(24)],h5New:[(0,l.h)(28),(0,l.h)(24)],h6:[(0,l.h)(24),(0,l.h)(22)],title1:[(0,l.h)(24),(0,l.h)(24)],title2:[(0,l.h)(24),(0,l.h)(24)],body2:[(0,l.h)(24),(0,l.h)(24)],overline:[(0,l.h)(12),(0,l.h)(12)],subText:[(0,l.h)(12),(0,l.h)(12)]},letterSpacing:{lg:[-.2,0],md:[-.2,0],sm:[0,-.2],s1:[-.6,-.6],s2:[-.4,-.2],s3:[0,-.2],s4:[0,-.2],p1:[-.4,-.4],p2:[-.3,-.3],p3:[-.3,-.3],p4:[-.2,0],c1:[-.2,-.2],c2:[-.2,-.2],label1:[0,-.2],h1:[-1.2,-.9],h2:[-1,-.8],h3:[-.6,-.6],h4:[-.6,-.4],h5:[-.2,-.2],h5New:[-.4,-.4],h6:[0,-.2],n1:[-.2,-.2],title1:[-.4,-.4],title2:[-.3,-.3],body2:[-.3,-.3],overline:[-.2,-.2],subText:[-.2,-.2]},fontWeightBySize:{s1:r.semiBold,s2:r.semiBold,s3:r.semiBold,s4:r.semiBold,h1:r.bold,h2:r.bold,h3:r.bold,h4:r.bold,h5:r.bold,h5New:r.semiBold,h6:r.bold},fontWeight:r}},GlobalTextStyleNew=e=>({[a.LEADGEN]:{h1:{fontSize:(0,l.h)(40),lineHeight:(0,l.h)(48),letterSpacing:"-1.2px",[e.fn.smallerThan("sm")]:{fontSize:(0,l.h)(26),lineHeight:(0,l.h)(32),letterSpacing:"-0.6px"}},h2:{fontSize:(0,l.h)(32),lineHeight:(0,l.h)(40),letterSpacing:"-1px",[e.fn.smallerThan("sm")]:{fontSize:(0,l.h)(20),lineHeight:(0,l.h)(28),letterSpacing:"-0.4px"}},h3:{fontSize:(0,l.h)(26),lineHeight:(0,l.h)(32),letterSpacing:"-0.6px",[e.fn.smallerThan("sm")]:{fontSize:(0,l.h)(20),lineHeight:(0,l.h)(28),letterSpacing:"-0.4px"}},p1:{fontSize:(0,l.h)(17),lineHeight:(0,l.h)(28),letterSpacing:"-0.4px"},p2:{fontSize:(0,l.h)(15),lineHeight:(0,l.h)(24),letterSpacing:"-0.3px"}}}),c=(0,s.createContext)(a.NONE),TemplateProvider=({variant:e=a.NONE,children:t})=>s.createElement(c.Provider,{value:e},t),useTemplateVariant=()=>(0,s.useContext)(c)},nSMY:function(e,t,i){i.d(t,{I:function(){return InputCommentBar},P:function(){return PopupDanger},S:function(){return SharePopup},a:function(){return PopupFrame},b:function(){return SubmitReportForm},c:function(){return N},d:function(){return getPostFormData},e:function(){return editPost},f:function(){return createPost},g:function(){return getDefaultFailNoti},h:function(){return deletePost},i:function(){return R},j:function(){return deleteComment},k:function(){return decodeCommentBody},l:function(){return likeUnlikeComment},m:function(){return likeUnlikePost},u:function(){return useImagePicker}});var o=i("q1tI"),n=i("ASLx"),a=i("D9+h"),r=i("V50O"),l=i("q+5q"),s=i("i8i4"),d=i("ejmp"),c=i("rBCA"),p=i("iBNF"),m=i("otAR"),u=i("/IYt"),h=i("Frmf"),g=i("Qlgr"),v=i("XSl0"),b=i("IQVP"),f=i("Gbmr"),x=i("0l3Q"),y=i("Q/Ck"),w=i("uXCw"),E=i("HHio"),k=i("t/pd"),C=i("fKfj"),S=i("hO2q"),_=i("Lrsm"),T=i("/pFO");let useImagePicker=(e,t)=>{let[i,n]=(0,o.useState)(e||[]),a=(0,o.useMemo)(()=>(e||i).map(e=>"string"==typeof e?e:URL.createObjectURL(e)),[e,i]);return{onSelectImages:o=>{let a=o.target.files;if(a){if(t&&e){let o=e||i;t(o.concat(Array.from(a)))}else n(i=>{let o=e||i;return t&&t(o.concat(Array.from(a))),o.concat(Array.from(a))})}},onRemoveImage:i=>{t&&e?(e.splice(i,1),t(e.slice())):n(o=>{let n=e||o;return n.splice(i,1),t&&t(n.slice()),n.slice()})},onRemoveAllImages:()=>{t?t([]):n([])},imageSrcs:a,imageFiles:e||i}},getDefaultFailNoti=e=>({message:e("notification.failure"),type:"danger"}),likeUnlikePost=({id:e,locale:t})=>(0,m._)(void 0,void 0,void 0,function*(){if(!e)return;let i=yield(0,d.e)((0,d.f)(b.yy.POST.LIKE,{id:e,_locale:t}),"GET");return i}),deletePost=({id:e,locale:t})=>(0,m._)(void 0,void 0,void 0,function*(){if(!e)return;let i=yield(0,d.e)((0,d.f)(b.yy.POST.DELETE,{id:e,_locale:t}),"DELETE");return i}),getPostFormData=({title:e,description:t,communityId:i,imageFiles:o,previewUrl:n,topicIds:a,locale:r,sanitizeFunction:s,categoryCommunityId:d,categoryTopicIds:c,introUrl:p,bannerUrl:u,scheduleTime:h,isAnonymous:g,isAskDoctor:b})=>(0,m._)(void 0,void 0,void 0,function*(){let m=new FormData,x=(0,f.k)(t),y=(0,f.k)(e),w=(0,f.j)(x);if(m.append("title",y),m.append("description",(0,f.l)(x,s)),d?m.append("category_community",String(d)):i&&m.append("community_id",String(i)),m.append("is_anonymous",g?"1":"0"),m.append("is_question",b?"1":"0"),(null==n?void 0:n.title)&&m.append("preview_title",n.title),(null==n?void 0:n.description)&&m.append("preview_description",n.description),(null==n?void 0:n.url)&&m.append("preview_link",(0,l.c)(n.url)),(null==n?void 0:n.image)&&m.append("preview_image",(0,l.c)(n.image)),null==a||a.forEach(e=>{m.append("topics[]",String(e||""))}),null==c||c.forEach(e=>{m.append("category_topics[]",String(e||""))}),null==o?void 0:o.length){let e=yield Promise.all(o.map((e,t)=>new Promise(i=>{setTimeout(()=>{i((0,f.u)(e,r))},2e3*t)})));null==e||e.filter(Boolean).slice(0,v.M).forEach((e,t)=>{m.append(`images[${t}]`,e)})}else m.append("images","");return null==w||w.forEach(e=>{m.append("mention_ids[]",e)}),m.append("intro_url",p||""),m.append("banner",u||""),h&&(m.append("post_type","scheduled"),m.append("schedule_datetime",h)),m}),createPost=({locale:e,formData:t,isArticleComment:i})=>(0,m._)(void 0,void 0,void 0,function*(){let o=yield(0,d.e)((0,d.f)(i?b.yy.POST.CREATE_ARTICLE_COMMENT:b.yy.POST.CREATE,{_locale:e}),"POST",{data:t});return o}),editPost=({id:e,locale:t,formData:i})=>(0,m._)(void 0,void 0,void 0,function*(){let o=yield(0,d.e)((0,d.f)(b.yy.POST.UPDATE,{id:e,_locale:t}),"POST",{data:i});return o}),reportPost=({id:e,reason:t,locale:i})=>{let o=new FormData;return o.append("reason",t),(0,d.e)((0,d.f)(b.yy.POST.REPORT,{_locale:i,id:e}),"POST",{data:o})},I=c.Z.div` [data-type='confirm'] { max-width: 468px; /* height: 486px; */ padding: 0; .popup-content { display: flex; flex-direction: column; padding: 0; .close-button { top: 16px; right: 16px; width: 24px; height: 24px; z-index: 5; } .header { display: flex; height: 56px; align-items: center; padding: 16px 56px 16px 32px; border-bottom: 1px solid ${p.r.colors.neutral100}; font-weight: 900; width: 100%; justify-content: space-between; } .content { overflow: auto; flex: 1; .topic-list-wrapper { padding: 1rem; } } } } > div&[data-open='true'] { z-index: 250; &:last-child { z-index: 200; } } ${e=>e.isExpand&&` & > div[data-open] { width: 100%; height: 100%; max-width: none; max-height: none; } `} ${e=>e.hasFullscreen&&` & > div[data-open] { transition: all 0.5s ease-in-out, width 0s, height 0s; } `} `,P=c.Z.div` cursor: pointer; display: flex; align-items: center; `,PopupFrame=({className:e,style:t,closeIcon:i,heading:n="",children:r,isOpen:l=!1,hasFullscreen:s=!1,disableClickOutside:d=!1,initExpand:c=!1,onExpandChange:p,onClose:m=()=>null})=>{let[u,h]=(0,o.useState)(c);return o.createElement(I,{className:e,style:t,isExpand:u,hasFullscreen:s},o.createElement(S.P,{type:"confirm",onClose:m,isOpen:l,closeIcon:i||o.createElement("img",{src:_.C,loading:"lazy"}),enableAnimation:!s,disableClickOutside:d},o.createElement("div",{className:"header"},o.createElement(a.H,{tag:"h5"},n),s&&o.createElement(P,{onClick:()=>{null==p||p(),h(!u)}},o.createElement(C.Z,{size:14,isExpand:u}))),o.createElement("div",{className:"content"},"function"==typeof r?r(u):r)))};var N="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='25' fill='none'%3e%3cpath fill='%23262626' d='M12 22.984c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.478-10 10 4.477 10 10 10'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m14.828 10.156-5.657 5.657M9.172 10.156l5.657 5.657'/%3e%3c/svg%3e";let O=c.Z.div` [data-type='confirm'] { width: min(360px, 100%); height: auto; &[data-open='false'] { top: calc(-100% - 500px); } } z-index: 600; .header { display: none !important; } .confirm-dialog { position: relative; overflow: auto; width: 100%; padding-top: 44px; background: #fff; border-radius: ${p.r.borderRadius}; .confirm-content { display: flex; flex-direction: column; align-items: center; padding: 0 16px 16px; text-align: center; .title { margin-bottom: 8px; font-size: 24px; line-height: 32px; word-break: break-word; overflow-wrap: break-word; } .desc { margin-bottom: 24px; color: ${p.r.colors.gray500}; font-size: 18px; line-height: 24px; text-align: center; word-break: break-word; overflow-wrap: break-word; } .btn-group { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; button { margin: 0 4px 0.5rem; } } } } .thumbnail-container { width: 80px; height: 80px; margin-bottom: 32px; .thumbnail { width: 100%; height: 100%; } &.is-icon { display: flex; align-items: center; justify-content: center; background: #e0e9fc; border-radius: 1rem; .thumbnail { width: 40px; height: 40px; } } } &[data-is-marrybaby='true'] { .popup-frame { > div:first-child { overflow: hidden; border-radius: 1rem; &[data-open='true'] { ${l.M.mbDown} { top: 100%; transform: translate(-50%, -100%); max-width: unset; width: 100%; background: unset; overflow: unset; } } } .popup-content { .close-button { ${l.M.mbDown} { display: none; } } .confirm-dialog { ${l.M.mbDown} { background: unset; position: relative; overflow-x: hidden; &::before { content: ''; width: 200%; background: #fff; position: absolute; left: 50%; top: 0; transform: translateX(-50%); z-index: -1; height: 100%; border-top-left-radius: 100%; border-top-right-radius: 100%; } } .confirm-content { padding: 0 40px 40px; ${l.M.mbDown} { padding-left: 1.5rem; padding-right: 1.5rem; } .btn-group { width: 100%; justify-content: space-between; button { flex: 1; margin: 0; &:first-child { margin-right: 0.5rem; } } } } } } .thumbnail-container { ${l.M.mbDown} { display: none; } &.is-icon { background: #ffeaf1; border-radius: 24px; } &.is-mobile { position: absolute; top: 0; left: 50%; display: none; width: 48px; height: 48px; transform: translate(-50%, -50%); &.is-icon { border-radius: 1rem; .thumbnail { width: 24px; height: 24px; } } ${l.M.mbDown} { display: flex; } } } } } `,PopupDanger=({className:e,isMarryBaby:t,style:i,title:c,description:p,acceptText:m,cancelText:u,onAccept:h,onCancel:g,thumbnail:v,isThumbnailIcon:b,onClose:f,acceptBtnTracking:x,acceptBtnProps:y,cancelBtnProps:w})=>{let{data:{env:{isMarryBaby:E}}}=(0,o.useContext)(d.T),k="boolean"==typeof t?t:E,[C,S]=(0,o.useState)(!1);return((0,o.useEffect)(()=>((0,l.t)(!0),setTimeout(()=>S(!0),0),()=>(0,l.t)(!1)),[]),"undefined"==typeof window)?null:s.createPortal(o.createElement(O,{"data-is-marrybaby":k,className:e,style:i,"data-open":C},o.createElement(PopupFrame,{className:"popup-frame",isOpen:C,onClose:f},o.createElement("div",{className:"confirm-dialog",onClick:e=>e.stopPropagation()},o.createElement("div",{className:"confirm-content"},v&&o.createElement("div",{className:`thumbnail-container ${b?"is-icon":""}`},o.createElement("img",{className:"thumbnail",src:v,loading:"lazy"})),o.createElement(a.H,{className:"title",tag:"h2"},c),o.createElement(r.T,{className:"desc",size:"lg"},p),o.createElement("div",{className:"btn-group"},o.createElement(n.B,Object.assign({theme:k?"marryBaby":"helloSites",size:"md",color:"tertiary",onClick:()=>{null==h||h(),null==f||f()}},y,x),m),o.createElement(n.B,Object.assign({theme:k?"marryBaby":"helloSites",size:"md",onClick:()=>{null==g||g(),null==f||f()}},w),u)))),k&&v&&o.createElement("div",{className:`thumbnail-container is-mobile ${b?"is-icon":""}`},o.createElement("img",{className:"thumbnail",src:v,loading:"lazy"})))),(0,l.a)())},j=c.Z.div` padding: 1rem; border-top: 1px solid #f2f2f2; &[data-is-reply='true'] { padding-right: 0; padding-left: 0; border-top: 1px solid #e4e8ec; margin-right: 1rem; margin-left: 1rem; } .error-text { padding: 1rem; color: ${p.r.colors.red700}; } .reply-to-container { display: flex; justify-content: space-between; padding-bottom: 0.75rem; margin-top: -0.25rem; .icon-close-comment { width: 16px; height: 16px; cursor: pointer; } a { text-decoration: none; } } .input-container { display: flex; align-items: center; .avatar-wrapper { display: flex; flex-shrink: 0; align-items: center; margin-right: 0.5rem; &.avatar-wrapper-reply { width: 32px; height: 32px; .avatar { width: 32px; height: 32px; } } } .input-wrapper { margin-right: 0.5rem; &[data-has-error] { .as-input { border-color: ${p.r.colors.red700}; } } .as-input { .textarea { width: 100%; max-height: 225px; min-height: 75px; .ql-toolbar { padding: 0; } .ql-editor { padding-left: 0; padding-right: 0; } .quill { height: 0; } } width: 100%; padding: 12px 16px; border: solid 1px ${p.r.colors.gray200}; border-radius: ${p.r.borderRadius}; &:active, &:focus { border-color: ${p.r.colors.primaryBase}; box-shadow: 0px 0px 2px 2px ${p.r.colors.primary200}; } &:disabled { background-color: ${p.r.colors.gray100}; 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: ${p.r.sizes.fwRegular}; ${l.M.mbDown} { font-size: 22px; line-height: 1.2; } ${l.M.mbUp} { font-size: 26px; line-height: 1.2; } } } &[data-size='md'] { .as-input { font-weight: ${p.r.sizes.fwRegular}; line-height: 22px; ${l.M.mbDown} { font-size: 14px; line-height: 1.2; } ${l.M.mbUp} { font-size: 16px; line-height: 1.2; } } } &[data-size='sm'] { .as-input { font-weight: ${p.r.sizes.fwRegular}; line-height: 20px; ${l.M.mbDown} { font-size: 13px; line-height: 1.5; } ${l.M.mbUp} { font-size: 13px; line-height: 1.5; } } } } .images-input-label { height: 100%; cursor: pointer; .icon-images-input { width: 24px; height: 24px; vertical-align: middle; } } .send-button { display: flex; width: 40px; height: 40px; flex-shrink: 0; align-items: center; justify-content: center; padding: 0; border: none; &.send-button-post { background: ${p.r.colors.neutral100}; 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; } } } } .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; } } } `,z=(0,o.createContext)({}),getCommentFormBody=({postId:e,message:t,photos:i,link:o,locale:n,sanitizeFunction:a,replyingUserId:r,replyingUserName:l,replyingId:s})=>(0,m._)(void 0,void 0,void 0,function*(){let d=new FormData,c=(0,f.l)(t.replace(/(\ )+/g," "),a),p=(0,f.j)(c);if(i&&i.length>0){let e=yield Promise.all(null==i?void 0:i.map(e=>(0,f.u)(e,n)));e.filter(Boolean).slice(0,v.M).forEach(e=>{d.append("images[]",e)})}return o&&d.append("link",o),null==p||p.forEach(e=>{d.append("mention_ids[]",e)}),d.append("post_id",e),s&&d.append("parent_id",s),r&&(p.unshift(r),c=`[mention+id="${r}"+name="${(l||"").replace('"',"'")}"]${c}`,d.append("parent_user_id",String(r))),d.append("content",c),d.append("content",c),d}),submitComment=(e,t)=>(0,m._)(void 0,void 0,void 0,function*(){return(0,d.e)((0,d.f)(b.yy.COMMENT.CREATE,{_locale:t}),"POST",{data:e})}),decodeCommentBody=e=>{try{let t=e.match(/\[@([^\]]+)\]/),i=t?t[0].replace("[@","").replace("]",""):"",o=e.replace(/\[@([^\]]+)\]/,"");return{text:o.trim(),replyingTo:i}}catch(e){}return{text:""}},submitReply=(e,t)=>(0,m._)(void 0,void 0,void 0,function*(){return(0,d.e)((0,d.f)(b.yy.COMMENT.REPLY,{_locale:t}),"POST",{data:e})}),likeUnlikeComment=({commentId:e,setLike:t=!1,locale:i})=>(0,m._)(void 0,void 0,void 0,function*(){return(0,d.e)((0,d.f)(t?b.yy.COMMENT.LIKE:b.yy.COMMENT.UNLIKE,{_locale:i,id:e}),"GET")}),deleteComment=({id:e,locale:t})=>(0,d.e)((0,d.f)(b.yy.COMMENT.DELETE,{_locale:t,id:e}),"DELETE"),InputCommentBar=({isReply:e,className:t,onClose:i,replyToName:a,style:l,replyingId:s,replyingUser:c,onPostSuccess:p,post:b,isMarryBaby:f})=>{let{action:{pushNotifications:k,sanitizeFunction:C},data:{userInfo:S,locale:_,env:{isMarryBaby:T}}}=(0,o.useContext)(d.T),{t:I}=(0,h.u)(),{onSelectImages:P,onRemoveImage:O,imageSrcs:D,onRemoveAllImages:M,imageFiles:R}=useImagePicker(),[B,$]=(0,o.useState)(""),{trigger:A}=(0,o.useContext)(z),[L,F]=(0,o.useState)(!1),H=(0,o.useRef)(null),V=(0,o.useRef)(null),U=(0,o.useRef)(null),[Z,G]=(0,o.useState)([]),[W,Y]=(0,o.useState)([]),[q,Q]=(0,o.useState)(null);return(0,o.useEffect)(()=>{var e;null===(e=U.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout(()=>{var e;null===(e=V.current)||void 0===e||e.focus()},400)},[A]),o.createElement(j,{"data-is-reply":e,className:t,style:l},e&&o.createElement("div",{className:"reply-to-container"},o.createElement(r.T,{size:"p4"},o.createElement("span",{dangerouslySetInnerHTML:{__html:I("inputComment.replyTo",{name:`@${a||""}`})}})),o.createElement("img",{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3ccircle cx='8' cy='8.5' r='6.667' fill='white' stroke='%23404040'/%3e%3cpath stroke='%23404040' stroke-linecap='round' stroke-linejoin='round' d='m10 6.5-4 4M6 6.5l4 4'/%3e%3c/svg%3e",className:"icon-close-comment",onClick:()=>i&&i(),loading:"lazy"})),o.createElement("div",{className:"input-container",ref:U},o.createElement(w.U,{className:`avatar-wrapper ${e?"avatar-wrapper-reply":""}`,avatar:(null==S?void 0:S.id)?S.avatar:v.D,username:(null==S?void 0:S.name)||(null==S?void 0:S.username)}),o.createElement("input",{ref:H,onChange:P,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),o.createElement(u.I,{value:B,name:"input",size:"md",className:"input-wrapper",displayIcon:o.createElement("img",{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M10.754 4.854H4.492a1.79 1.79 0 0 0-1.789 1.789v12.524a1.79 1.79 0 0 0 1.79 1.789h12.523a1.79 1.79 0 0 0 1.79-1.79v-6.261'/%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M17.463 3.512a1.898 1.898 0 0 1 2.684 2.684l-8.498 8.498-3.579.895.895-3.579z'/%3e%3c/svg%3e",loading:"lazy"}),CustomInput:o.createElement("div",{className:"as-input"},o.createElement(E.R,{className:"textarea",html:B,onChange:$,onImagePickerClick:()=>{var e;return null===(e=H.current)||void 0===e?void 0:e.click()},bannedWords:W,onPreviewUrlChange:Q,onInvalidUrlsChange:G,setEditorRef:e=>V.current=e,isReplying:e}))}),o.createElement(n.B,{theme:("boolean"==typeof f?f:T)?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:()=>(0,m._)(void 0,void 0,void 0,function*(){var t,o,n,a,r,l,d,m,u;if((null==b?void 0:b.id)&&!L){F(!0);try{let h=yield getCommentFormBody(Object.assign({message:B,photos:R,postId:String(b.id),link:null==q?void 0:q.url,sanitizeFunction:C,locale:_},e&&s?{replyingUserId:String((null==c?void 0:c.id)||(null===(t=null==b?void 0:b.author)||void 0===t?void 0:t.id)||""),replyingId:s,replyingUserName:(null==c?void 0:c.name)||(null==c?void 0:c.username)||""}:{})),v=yield e&&s?submitReply(h,_):submitComment(h,_),f=null==v?void 0:v.data;(null==f?void 0:f.id)&&!(null===(n=null===(o=null==v?void 0:v.messages)||void 0===o?void 0:o.moderation)||void 0===n?void 0:n.type)?(e=>{$(""),M(),i&&i();let t=(0,g.g)(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),p&&p(t)})(v):(null===(r=null===(a=null==v?void 0:v.messages)||void 0===a?void 0:a.moderation)||void 0===r?void 0:r.type)==="banned"?(k({title:I("notification.comment.blocked.title"),message:I("notification.comment.blocked.message"),type:"danger"}),v.messages.moderation.words&&Y(v.messages.moderation.words)):(null===(d=null===(l=null==v?void 0:v.messages)||void 0===l?void 0:l.moderation)||void 0===d?void 0:d.type)==="suspect"?(k({title:I("notification.comment.suspect.title"),message:I("notification.comment.suspect.message"),type:"warning"}),$(""),M(),i&&i()):(null===(m=null==v?void 0:v.messages)||void 0===m?void 0:m.find(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))}))?(k({message:I("notification.suspend.message"),type:"warning"}),$(""),M(),i&&i()):k({title:"",message:(null===(u=null==v?void 0:v.messages)||void 0===u?void 0:u[0])||I("notification.comment.somethingWrong"),type:"danger"})}catch(e){k({title:"",message:I("notification.comment.somethingWrong"),type:"danger"})}F(!1)}}),isLoading:L,isDisabled:!!(null==Z?void 0:Z.length)||L||!B||(null==B?void 0:B.length)<2||!B.trim()},o.createElement("img",{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='20' height='21' fill='none'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m7.5 9.734-3.75 3.75 3.75 3.75'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M16.25 4.734v5.569c0 .843-.33 1.653-.915 2.25a3.1 3.1 0 0 1-2.21.931H3.75'/%3e%3c/svg%3e",className:"icon-enter",loading:"lazy"}))),(null==Z?void 0:Z.length)?o.createElement("div",{className:"error-text"},I("notification.limitUrlDomain")):null,(!D||0===D.length)&&q&&o.createElement("div",{className:"link-preview-wrapper"},q.isFetching?o.createElement(y.L,null):o.createElement(o.Fragment,null,o.createElement(x.C,{title:q.title,url:q.url||"#",image:q.image,noRefetch:!0}),o.createElement("img",{src:N,className:"icon-close",onClick:()=>Q(null),loading:"lazy"}))),D&&D.length>0&&o.createElement("div",{className:"preview-images-container"},D.map((e,t)=>o.createElement("div",{key:t,className:"image-src-wrapper"},o.createElement("img",{className:"preview-image",src:e,loading:"lazy"}),o.createElement("img",{src:N,className:"icon-close-circle",onClick:()=>O(t),loading:"lazy"})))))},SharePopup=({trackingCategory:e,className:t,style:i,url:n,text:a,onClose:r})=>{let{data:{env:{isMarryBaby:s}}}=(0,o.useContext)(d.T),{t:c}=(0,h.u)(),[p,m]=(0,o.useState)(!1);return(0,o.useEffect)(()=>((0,l.t)(!0),setTimeout(()=>m(!0),0),()=>(0,l.t)(!1)),[]),o.createElement(k.h,null,o.createElement(D,{"data-is-marrybaby":s,className:t,style:i},o.createElement(PopupFrame,{className:"share-popup",isOpen:p,onClose:r,heading:c("bottomBar.share")},p&&o.createElement(T.r,{trackingCategory:e,shareUrl:n||("undefined"!=typeof window?window.location.href:""),title:a}))))},D=c.Z.div` .share-popup { > div:first-child { height: unset; } } .custom-share__header { display: flex; flex-wrap: no-wrap; align-items: center; padding: 1rem; border-bottom: 1px solid ${p.r.colors.neutral100}; margin-bottom: 16px; .custom-share__header-image { width: 38px; height: 38px; flex-shrink: 0; & > img { width: 100%; height: 100%; object-fit: cover; object-position: center; } } .custom-share__header-info { flex: 1; padding: 0 8px; word-break: break-word; [data-tag='h4'] { margin-bottom: 8px; font-size: 14px; font-weight: bold; line-height: 14px; } [data-size='md'] { color: #a5a5a5; font-size: 14px; line-height: 14px; } } } &[data-is-marrybaby='true'] { .share-popup { > div:first-child { overflow: hidden; border-radius: 1rem; &[data-open='true'] { ${l.M.mbDown} { max-width: unset; width: 100%; top: 100%; transform: translate(-50%, -100%); border-bottom-left-radius: 0; border-bottom-right-radius: 0; } } } .close-button { display: block; } .popup-content { .header { display: block; padding: 1rem; background-color: rgb(243, 243, 243); } .content { padding-bottom: 1rem; } } .share-mb-text { margin: 1rem 1rem 0.5rem; } } } `,M=c.Z.div` 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%; } &[data-is-marrybaby='true'] { padding: 0 1rem 1rem; } `;var R="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.5' d='M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12M8 5v3M8 11h.007'/%3e%3c/svg%3e";let SubmitReportForm=({className:e,style:t,reason:i,reasonText:a,onClose:l,postId:s})=>{let{data:{locale:c,env:{isMarryBaby:u}},action:{pushNotifications:g}}=(0,o.useContext)(d.T),{t:v}=(0,h.u)(),[b,f]=(0,o.useState)(!1);return o.createElement(M,{"data-is-marrybaby":u,className:e,style:t},o.createElement("ul",{className:"report-list"},o.createElement("li",{className:"report-item"},o.createElement("img",{src:R,loading:"lazy"}),o.createElement(r.T,{className:"__label",color:p.r.colors.gray800,size:"p4"},a))),o.createElement(n.B,{theme:u?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:b,onClick:()=>(0,m._)(void 0,void 0,void 0,function*(){if(s&&!b){f(!0);try{let e=yield reportPost({id:s,reason:i,locale:c});(null==e?void 0:e.status)===1&&(g({message:"Post reported",type:"success"}),l&&l())}catch(e){}f(!1)}})},v("submit")))}},"+v/W":function(e,t,i){i.d(t,{A:function(){return AuthorBadge},B:function(){return BookingBtn}});var o=i("otAR"),n=i("q1tI"),a=i("Frmf"),r=i("/npG"),l=i("dvPo"),s=i("MCzq"),d=i("2Qp+"),c=i("ejmp"),p=i("xrdX"),m=i("GOBr"),u=(0,r.k)(e=>({root:{display:"inline-block",flexShrink:0,padding:"2px 0.5rem",marginLeft:"4px",borderRadius:e.radius.xs,fontSize:"12px",fontWeight:400,lineHeight:"18px",'&[data-label-type="admin"]':{background:e.primaryColor[0],color:e.primaryColor[9]},'&[data-label-type="local admin"]':{background:e.primaryColor[8]},'&[data-label-type="ambassador"]':{background:e.colors.green[4]},'&[data-label-type="expert"]':{background:e.colors.yellow[6]},'&[data-label-type="moderator"]':{background:e.colors.red[0],color:e.colors.red[8]},'&[data-label-type="sponsor"]':{background:e.colors.teal[4]},'&[data-label-type="guide"]':{background:e.colors.teal[4]},'&[data-label-type="influencer"]':{background:e.colors.teal[4]}}}));let h={admin:"cardAuthor.admin",moderator:"cardAuthor.moderator",ambassador:"cardAuthor.ambassador",expert:"cardAuthor.expert",sponsor:"cardAuthor.sponsor",guide:"cardAuthor.guide",influencer:"cardAuthor.influencer"},looselyMatchRole=e=>["admin","moderator","ambassador","expert","sponsor","guide","influencer"].find(t=>t===e),AuthorBadge=e=>{var{siteType:t,role:i,title:r,styles:l,className:s}=e,d=(0,o.a)(e,["siteType","role","title","styles","className"]);let{t:c}=(0,a.u)(),p=i?looselyMatchRole(i):"",{classes:m,cx:g}=u(void 0,{name:"AuthorBadge",styles:l});return p&&h[p]?n.createElement("div",Object.assign({className:g(m.root,s),"data-label-type":p,"data-is-marrybaby":"marryBaby"===t},d),r||c(h[p])):null},BookingBtn=e=>{var{label:t,bookingId:i,bookingType:r="doctor",locale:u="vi-VN"}=e,h=(0,o.a)(e,["label","bookingId","bookingType","locale"]);let{t:g}=(0,a.u)(),[v,b]=(0,n.useState)(!1),f=(0,n.useMemo)(()=>"undefined"!=typeof window?window.location.href:"",[]),x=(0,n.useCallback)(()=>(0,o._)(void 0,void 0,void 0,function*(){var e,t,o,n,a,d,h,g,v,f,x,y,w,E,k;let C="doctor"===r?l.P.GET_DOCTOR_DETAIL:"hospital"===r?l.P.GET_HOSPITAL_DETAIL:"service"===r?l.P.GET_SERVICE_DETAIL:"";try{b(!0);let l=yield(0,c.c)((0,c.b)(C,{id:i,site:p.v[u]}),"get");if((null==l?void 0:l._status)===1){let i="doctor"===r?{id:null===(t=null===(e=null==l?void 0:l._data)||void 0===e?void 0:e.doctor)||void 0===t?void 0:t.id,slug:null===(n=null===(o=null==l?void 0:l._data)||void 0===o?void 0:o.doctor)||void 0===n?void 0:n.slug,localSlug:null===(a=s.L[u])||void 0===a?void 0:a.DOCTOR}:"hospital"===r?{id:null===(h=null===(d=null==l?void 0:l._data)||void 0===d?void 0:d.branch)||void 0===h?void 0:h.id,slug:null===(v=null===(g=null==l?void 0:l._data)||void 0===g?void 0:g.branch)||void 0===v?void 0:v.slug,localSlug:null===(f=s.L[u])||void 0===f?void 0:f.HOSPITAL}:{id:null===(y=null===(x=null==l?void 0:l._data)||void 0===x?void 0:x.service)||void 0===y?void 0:y.id,slug:null===(E=null===(w=null==l?void 0:l._data)||void 0===w?void 0:w.service)||void 0===E?void 0:E.slug,localSlug:null===(k=s.L[u])||void 0===k?void 0:k.SERVICE};window.location.href=`https://${m.y?"":"discover."}${p.v[u]}/care/${i.localSlug}/${i.slug}-${i.id}/`}else b(!1)}catch(e){console.log(e),b(!1)}}),[]);return i&&r?n.createElement(d.B,Object.assign({dataEventCategory:"Care",dataEventAction:"Comment - Quick Booking",dataEventLabel:f,onClick:x,loading:v},h),t||g("careBooking.bookAnAppointment")):null}},"17Va":function(e,t,i){i.d(t,{A:function(){return Avatar},D:function(){return DistanceTag},I:function(){return IconWrapper},P:function(){return Pin3},S:function(){return ShapedArrowDown}});var o=i("q1tI"),n=i("rBCA"),a=i("iBNF"),r=i("c1cU"),l=i("V50O");let Pin3=e=>o.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 12 12",fill:"none"},e),o.createElement("g",{clipPath:"url(#clip0_5371_10640)"},o.createElement("path",{d:"M6.6665 4.3335L8.1665 5.8335L6.6665 7.3335",stroke:"#8C8C8C",strokeWidth:.72,strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{d:"M8.16667 5.8335H5.83333C5.09667 5.8335 4.5 6.43016 4.5 7.16683V7.50016",stroke:"#8C8C8C",strokeWidth:.72,strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{d:"M6.94331 10.3902L10.3907 6.94281C10.9114 6.42211 10.9114 5.57789 10.3907 5.05719L6.94331 1.60981C6.42261 1.08911 5.57839 1.08911 5.05769 1.60981L1.61031 5.05719C1.08961 5.57789 1.08961 6.42211 1.61031 6.94281L5.05769 10.3902C5.57839 10.9109 6.42261 10.9109 6.94331 10.3902Z",stroke:"#8C8C8C",strokeWidth:.72,strokeLinecap:"round",strokeLinejoin:"round"})),o.createElement("defs",null,o.createElement("clipPath",{id:"clip0_5371_10640"},o.createElement("rect",{width:12,height:12,fill:"white"})))),ShapedArrowDown=e=>o.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none"},e),o.createElement("path",{d:"M13.5554 9.33398L7.99989 5.55621L2.44434 9.33398",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})),s=n.Z.div` background-color: var(--background-color, transparent); color: white; cursor: pointer; img { --width: var(--width-prop, 40px); --height: var(--height-prop, 40px); width: var(--width); height: var(--height); } &[data-has-max='true'] { img { max-width: var(--width); max-height: var(--height); } } &[data-avatar-type='square'] { img { --width: var(--width-prop, 72px); --height: var(--height-prop, 72px); border-radius: ${a.r.borderRadius}; } } &[data-avatar-type='rounded'] { img { border-radius: 50%; } } &[data-custom-size='true'] { display: flex; overflow: hidden; overflow: hidden; width: var(--size); height: var(--size); align-items: center; justify-content: center; background-size: cover; font-size: calc(var(--size) / 2); font-weight: bold; &[data-avatar-type='square'] { border-radius: ${a.r.borderRadius}; } &[data-avatar-type='rounded'] { border-radius: 50%; img { --width: 100%; --height: 100%; } } img { object-fit: cover; } } `,d={xs:28,small:32,medium:40,large:48,xl:64,xxl:80,xxxl:96},Avatar=({type:e="square",size:t,avatarImg:i,avatarUrl:n,firstLetter:a,backgroundColor:l,onClick:c,style:p,className:m,width:u,height:h,alt:g})=>{let v=t?d[t]:void 0,[b,f]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(n){let e=document.createElement("img");e.setAttribute("src",n),e.addEventListener("error",()=>{f(!0)})}},[n,f]);let x=(!n&&!i||b)&&a;return o.createElement(s,{style:Object.assign(Object.assign({},p),{"--size":v?v+"px":void 0,"--width-prop":u?u+"px":void 0,"--height-prop":h?h+"px":void 0,"--background-color":l}),"data-has-max":!!(u&&h),"data-avatar-type":e,onClick:c,className:m,avatarUrl:n,"data-custom-size":!!t},i,n&&!b&&o.createElement(r.I,{src:n,alt:g||"avatar"}),x&&a)},c=n.Z.div` display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; color: ${a.r.colors.red700}; border-radius: 8px; border: 1px solid ${a.r.colors.neutral100}; font-size: 0.6875rem; line-height: 1rem; border-radius: 0.5rem; `,p=(0,n.Z)(Pin3)` width: 0.75rem; height: 0.75rem; color: ${a.r.colors.gray400}; `;function DistanceTag({value:e,className:t}){return o.createElement(c,{className:t},o.createElement(p,null),o.createElement(l.T,{size:"p3",weight:"regular",color:a.r.colors.gray400},e))}let m=n.Z.div` display: inline-flex; align-items: center; justify-content: center; flex-grow: 0; flex-shrink: 0; width: calc(var(--wrapper-size, var(--icon-size)) * 1px); height: calc(var(--wrapper-size, var(--icon-size)) * 1px); &[data-clickable='true'] { cursor: pointer; } > * { width: calc(var(--icon-size) * 1px); height: calc(var(--icon-size) * 1px); } &[data-svg-custom-stroke='true'] > svg * { stroke: var(--icon-stroke-color); } &[data-svg-custom-fill='true'] > svg * { fill: var(--icon-fill-color); } `,IconWrapper=({children:e,className:t,onClick:i,wrapperSize:n,iconSize:a=24,wrapperStyle:r,iconStyle:l,svgIcon:s,wrapperProps:d})=>o.createElement(m,Object.assign({className:t,onClick:i,style:Object.assign(Object.assign(Object.assign(Object.assign({},n&&{"--wrapper-size":n}),a&&{"--icon-size":a}),s&&Object.assign(Object.assign({},s.fill&&{"--icon-fill-color":s.fill}),s.stroke&&{"--icon-stroke-color":s.stroke})),r),"data-clickable":!!i,"data-svg-custom-stroke":!!(null==s?void 0:s.stroke),"data-svg-custom-fill":!!(null==s?void 0:s.fill)},d),o.cloneElement(e,{style:l}))},"38FU":function(e,t,i){i.d(t,{C:function(){return l}});var o=i("xrdX"),n=i("GOBr"),a=i("yNk5");let isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),r="hellosehat.com",l=new class{constructor(){this.baseDomain="",this.subPath="",this.getAssetPath=(e,t,i)=>{let o="https://hhg-common."+[t||this.getBaseDomain(),i||this.subPath,e].join("/");return n.y||a.env.JEST_WORKER_ID?o:o+"?v="+Math.floor(new Date().getTime()/1e3/60/3)}}getBaseDomain(){if(this.baseDomain)return this.baseDomain;if("undefined"!=typeof window){let{host:e}=window.location,t=e.split("."),i=o.v[Object.keys(o.v).find(t=>e.includes(o.v[t]))];return t.includes("localhost")||t.includes("hellohealthgroup")||t.every(e=>isNumeric(e))||!i?r:i}return r}};l.subPath="common",l.baseDomain=o.v["vi-VN"]},K8Z6:function(e,t,i){i.d(t,{S:function(){return Spoiler}});var o=i("otAR"),n=i("q1tI"),a=i("uCoU"),r=i("V50O"),l=i("Frmf"),s=i("iBNF");let Spoiler=e=>{var{children:t,line:i,lineHeight:d,trackingAttributes:c,maxHeight:p,customExpandFn:m}=e,u=(0,o.a)(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);let{t:h}=(0,l.u)(),g=(0,n.useMemo)(()=>p||(i&&d?i*d:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0)),[]);t||console.error("[HHG-Comp]:[Spoiler] Please provide children");let v=(0,n.useMemo)(()=>c?{"data-event-category":c.dataEventCategory,"data-event-action":c.dataEventAction,"data-event-label":c.dataEventLabel}:{},[c]);return n.createElement(a.o,Object.assign({showLabel:n.createElement(r.T,Object.assign({size:"p3",color:s.r.colors.primaryBase},v,{onClick:m}),h("articlePage.readMore")),hideLabel:n.createElement(r.T,Object.assign({size:"p3",color:s.r.colors.primaryBase},v),h("articlePage.showLess"))},u,{maxHeight:g}),t)}},"4OI8":function(e,t,i){i.d(t,{C:function(){return ChoiceField},T:function(){return TextField},i:function(){return S},u:function(){return h}});var o=i("/npG"),n=i("iuhU"),a=i("Eso5"),r=i("8vDj"),l=i("1WmY"),s=i("otAR"),d=i("q1tI"),c=i("ChHM"),p=i("AeFk"),m=i("rBCA"),u=i("iBNF"),h=(0,o.k)(e=>(0,l.G)(e)[l.C.LEADGEN]);let g=(0,d.createContext)({}),v=p.iv` height: 100% !important; min-height: calc(var(--container-height, 56px) * 24 / 56); line-height: calc(var(--container-height, 56px) * 24 / 56); border: none !important; border-radius: 0 !important; outline: none !important; box-shadow: none !important; padding: 0; cursor: pointer; /* opacity: 0; */ ::placeholder { color: ${u.r.colors.gray400}; } `,b=p.iv` height: auto !important; cursor: text; opacity: 1; transition: 0.1s ease-in-out all; `,f=p.iv` position: absolute; top: calc(var(--container-height) / 2); left: var(--space-x, 16px); margin: 0; z-index: 1; cursor: pointer; transform: translateY(-50%); transition: 0.125s ease-in all; right: 0; // auto grow width `,x=p.iv` top: var(--space-y-shrink, 6px); transform: translateY(0); transition: 0.125s ease-out all; right: 0; // auto grow width `,y=p.iv` min-height: var(--container-height, 56px); display: flex; align-items: flex-end; border: 1px solid ${u.r.colors.gray200}; border-radius: 8px; background-color: #fff; padding-inline: var(--space-x, 16px); padding-block: var(--space-y-not-shrink, 16px); cursor: pointer; pointer-events: none; &:has(.mantine-Input-rightSection) { padding-right: var(--container-height, 56px); } .mantine-Input-icon { display: none; } .mantine-NumberInput-control { border-color: ${u.r.colors.gray200}; } `,w=p.iv` height: auto; min-height: var(--container-height, 56px); padding-block: var(--space-y-shrink, 6px); cursor: text; pointer-events: auto; `,E=p.iv` color: ${u.r.colors.red800}; font-size: 12px; line-height: 1.5; `,k=m.Z.div` --space-x: 16px; --space-y-not-shrink: 15px; --space-y-shrink: 6px; --container-height: 56px; --label-not-shrink: 16px; --label-shrink: 12px; --input: 15px; position: relative; min-width: 100px; max-width: 100%; display: inline-block; .textField_wrapper { display: inline-block; width: 100%; cursor: pointer; } .mantine-InputWrapper-root { &[data-invalid='true'] { .mantine-Input-wrapper { border-color: ${u.r.colors.red400}; } } .mantine-Input-wrapper { &:has([data-invalid]) { border-color: ${u.r.colors.red400}; } } } .mantine-InputWrapper-label { ${f} } .mantine-Input-wrapper { ${y} + .mantine-Popover-dropdown[data-position="bottom-start"] { left: 0 !important; } + .mantine-Popover-dropdown[data-position='top-start'] { top: unset !important; left: 0 !important; bottom: 100% !important; } } .mantine-Input-input { ${v} } &.textField_shrink { .mantine-InputWrapper-label { ${x} } .mantine-Input-wrapper { ${w} &.mantine-Select-wrapper { .mantine-Select-rightSection { pointer-events: auto !important; } } } .mantine-Input-input { ${b} } &:has(.PhoneInput) { .mantine-InputWrapper-label { left: var(--space-x, 16px); } .PhoneInput { .PhoneInputInput { opacity: 1; } } } } &:focus-within { .mantine-Input-wrapper { transition: 0.25s linear border; border-color: ${u.r.colors.primary600}; box-shadow: 0 0 4px ${u.r.colors.primary200}; } } .PhoneInput { --phone-select: 75px; --phone-input-space-x: 8px; width: 100%; opacity: 1; border: none; .PhoneInputCountry { background-color: transparent; border: none; padding: 0; width: var(--phone-select, 75px); } .PhoneInputInput { flex: 1; min-width: 0; line-height: 1.5; outline: none !important; border: none; box-shadow: none; font-size: var(--input, 15px); padding: 0 var(--phone-input-space-x, 8px); /* opacity: 0; */ color: ${u.r.colors.gray800} !important; :focus { color: ${u.r.colors.gray800} !important; } } } &:has(.PhoneInput) { .mantine-InputWrapper-label { left: calc( var(--space-x, 16px) + var(--phone-select, 75px) + var(--phone-input-space-x, 8px) ); } } .icon { position: absolute; top: calc(var(--container-height) / 2); right: var(--space-x, 16px); transform: translateY(-50%); transition: 0.125s ease-in all; &.shrink { top: calc(var(--container-height) / 2 - 4px); transform: translateY(0); } } `,C=m.Z.div` &.leadgen-form_checkbox, &.leadgen-form_radio { width: 100%; } &.leadgen-form_dropdown { width: calc(50% - 12px); } .mantine-InputWrapper-root { display: block; } .mantine-InputWrapper-label { margin-bottom: 0.5rem; color: ${u.r.colors.gray800}; font-size: 16px; font-weight: 400; line-height: 1.5; } .mantine-Radio-root, .mantine-Checkbox-root { gap: 8px; min-width: calc(50% - 4px); // input[type='radio'], // input[type='checkbox'] { // border-color: ${u.r.colors.gray600}; // width: 18px; // height: 18px; // } // input[type='checkbox'] { // border-radius: 4px; // } // &[data-checked='true'] { // input[type='radio'], // input[type='checkbox'] { // border-color: ${u.r.colors.primary600}; // } // input[type='radio'] { // background-color: white; // } // } .mantine-Checkbox-input { &:checked { border-color: ${u.r.colors.primary600}; } } } .leadgen-choiceContainer { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; } .mantine-InputWrapper-error { ${E} } `;m.Z.div` position: absolute; top: calc(var(--container-height) / 2); right: var(--space-x, 16px); `;let TextField=e=>{let{shrink:t,onChangeShrink:i,children:o,className:a}=e,r=(0,s.a)(e,["shrink","onChangeShrink","children","className"]),[l,c]=(0,d.useState)(t),[p,m]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{c(t)},[t]),d.createElement(g.Provider,Object.assign({value:{shrinkProps:t,shrink:l,setShrink:c,onChangeShrink:i,hasIcon:p,setHasIcon:m}},r),d.createElement(k,Object.assign({shrink:l,className:(0,n.default)(a,"textField",{textField_shrink:!!l})},r),o))},TextFieldControl=e=>{let{shrink:t,shrinkProps:i,onChangeShrink:o,setShrink:n,hasIcon:r}=(0,d.useContext)(g),{children:l,htmlFor:s}=e,p=(0,c.O)(()=>{i||(n(!1),null==o||o(!1))}),focusInput=e=>{setTimeout(()=>{let t=e.querySelectorAll('input:not([disabled]):not([type="submit"]),select:not([disabled]),textarea:not([disabled])'),i=t.item(t.length-1);i&&i.focus({preventScroll:!0})},150)},m=(0,d.useCallback)(e=>{if(t){focusInput(e.currentTarget);return}n(!0),null==o||o(!0),focusInput(e.currentTarget)},[t]);return(0,d.useEffect)(()=>{n(i)},[i]),d.createElement(a.x,{ref:p,onClick:m,className:"textField_wrapper",component:s?"label":"div",htmlFor:s},"function"==typeof l?l({shrink:!!t,hasIcon:r}):l)},TextFieldIcon=({Icon:e})=>{let{shrink:t,setHasIcon:i}=(0,d.useContext)(g),o=(0,r.rZ)();return(0,d.useEffect)(()=>{e&&i(!0)},[]),e?d.createElement(e,{className:`icon ${t?"shrink":""}`,shrink:t,size:24,color:o.colors.gray[9]}):null};TextField.Control=TextFieldControl,TextField.Icon=TextFieldIcon;let ChoiceField=e=>{let{children:t,className:i}=e,o=(0,s.a)(e,["children","className"]);return d.createElement(C,Object.assign({className:(0,n.default)(i,"choiceField")},o),t)};var S=Object.freeze({__proto__:null,TextField:TextField,TextFieldControl:TextFieldControl,TextFieldIcon:TextFieldIcon,ChoiceField:ChoiceField})}}]);