"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8556],{18618:function(e,t,a){a.d(t,{B:function(){return CardPost},E:function(){return CardReply},P:function(){return PopupDanger},a:function(){return TogetherAuthConfigContextProvider},b:function(){return CardReactions},e:function(){return LabelSorting},f:function(){return CardAuthor},g:function(){return CreateNewPostContent},q:function(){return PostContent},v:function(){return PostImagePreview},w:function(){return SocialLinkPreview}});var n,l,o,i,r,s,d,c,m=a(67294),p=a(54576);a(47856);var u=a(40650),g=a(57264),v=a(88547),h=a(53248),f=a(31740),b=a(89871),x=a(25876),y=a(31040),w=a(38358),E=a(99517),k=a(22311),C=a(47195),A=a(4698),N=a(10674),P=a(64761),T=a(64523),S=a(56817),z=a(69876),M=a(96768),j=a(87092),I=a(40254),R=a(54685),O=a(79640),D=a(10456),F=a(39238),B=a(36380),_=a.n(B),U=a(15184),$=a(74706),L=a(37658),V=a(36965),W=a(10981),q=a(7259),Z=a(81091),H=a(74360),G=a(71438),Q=a(23279),X=a.n(Q),Y=a(61512),K=a.n(Y),J=a(32951),ee=a(50722),et=a(92935),ea=a(75368),en=a(73935),el=a(10166),eo=a(38347),ei=a(23703),er=a(20760),es=a(27484),ed=a.n(es),ec=a(84110),em=a.n(ec),ep=a(70917),eu=a(80912),eg=a(62883),ev=a(32227),eh=a(90545);let ef=(0,m.createContext)({}),TogetherAuthConfigContextProvider=({children:e,defaultParams:t})=>m.createElement(ef.Provider,{value:{defaultParams:t}},e),useTogetherAuthRequiredAction=e=>{let{data:{userInfo:t,env:{togetherBasePath:a}}}=(0,m.useContext)(u.T),{defaultParams:n}=(0,m.useContext)(ef)||{},l=null==t?void 0:t.id,o=t&&"number"==typeof t.communities_interacted&&0===t.communities_interacted;return{authActionWrapper:(t,i)=>{let r=Object.assign(Object.assign(Object.assign({},n),e),i);if(l&&!o)return t&&t();{l||(0,ea.d)(u.B),(null==r?void 0:r._joinCommunityIds)&&(localStorage.setItem("to_join_community_ids",JSON.stringify(Array.from(new Set((JSON.parse(localStorage.getItem("to_join_community_ids")||"[]")||[]).concat(r._joinCommunityIds).filter(Boolean))))),null==r||delete r._joinCommunityIds),(null==r?void 0:r._joinTopicIds)&&(localStorage.setItem("to_join_topic_ids",JSON.stringify(Array.from(new Set((JSON.parse(localStorage.getItem("to_join_topic_ids")||"[]")||[]).concat(r._joinTopicIds).filter(Boolean))))),null==r||delete r._joinTopicIds);let e=(null==r?void 0:r._location)||window.location.href;return null==r||delete r._location,window.location.href=(0,u.m)(e,r,a),null}},params:Object.assign(Object.assign({},n),e)}},eb=el.Z.div` .link-info-container { padding: 0.5rem 1rem; background: ${e=>e.color||"#f4faff"}; } .link-image-wrapper { position: relative; overflow: hidden; width: 100%; padding-top: min(280px, 56.25%); .link-image-blur { position: absolute; top: 50%; left: 50%; width: 110%; height: 110%; /* Add the blur effect */ -webkit-filter: blur(8px); filter: blur(8px); object-fit: cover; object-position: center; opacity: 0.8; transform: translate(-50%, -50%); } .link-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; } } a { text-decoration: none; } &[data-is-marrybaby='true'] { overflow: hidden; border-radius: 1rem; .link-info-container { padding-bottom: 1rem; p { color: #2661ad; } .link-logo { max-width: 2rem; height: 13px; margin-right: 4px; object-fit: contain; vertical-align: middle; } } .link-image-wrapper { padding-top: min(360px, 56.25%); .link-image { object-fit: cover; } } } `,CardLink=({title:e,url:t,image:a,logo:n,className:l,style:o,noRefetch:i})=>{let{data:{locale:r,env:{isMarryBaby:s}}}=(0,m.useContext)(u.T),[d,c]=(0,m.useState)(!1),v=(0,P.rZ)(),h=(0,m.useRef)(i);h.current=i;let[f,b]=(0,m.useState)(null);(0,m.useEffect)(()=>{(0,g.a)(void 0,void 0,void 0,function*(){if(!h.current){if(!t)return b(null);b(e=>Object.assign(Object.assign({},e),{isFetching:!0})),(0,u.i)((0,u.g)(u.P.FETCH_PREVIEW,{_locale:r}),"POST",{data:{link:t},headers:{"Content-Type":"application/json"}}).then(e=>{var a,n,l;c(!1),b({title:null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.title,url:t,image:(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.image)||(null===(l=null==e?void 0:e.data)||void 0===l?void 0:l.logo)})}).catch(()=>{b(null)})}})},[t]);let x=(null==f?void 0:f.image)||a,y=(null==f?void 0:f.title)||e,w=(null==f?void 0:f.logo)||n,E=(null==f?void 0:f.url)||t,k=E.replace("http://","").replace("https://","").split(/[/?#]/),C=k[0],A=(0,m.useRef)(!1);return m.createElement(eb,{"data-is-marrybaby":s,className:`${l} no-replace-click`,style:o,color:v.colors[v.primaryColor][0]},m.createElement("a",{href:E,target:"_blank",rel:"noreferrer"},x&&m.createElement("div",{className:"link-image-wrapper"},!s&&m.createElement("img",{className:"link-image-blur",src:x,onError:e=>{A.current||(A.current=!0,e.currentTarget.src=u.n)},loading:"lazy"}),m.createElement("img",{className:"link-image",src:x,onError:e=>{A.current||(A.current=!0,e.currentTarget.src=u.n)},loading:"lazy"})),m.createElement("div",{className:"link-info-container"},m.createElement(p.T,{size:"n1"},s&&w&&!d&&m.createElement("img",{className:"link-logo",src:w,onError:()=>c(!0),loading:"lazy"}),C),m.createElement(et.H,{tag:"h6"},y))))},ex=(0,m.createContext)({});var ey={wrapper:"vvR-m49"};let LikeWrapper=e=>{var{children:t,className:a=""}=e,n=(0,g._)(e,["children","className"]);let{isReplied:l,trackingCategory:o,trackingLabel:i,onLikeClick:r}=(0,m.useContext)(ex);return m.createElement(T.x,Object.assign({className:`${ey.wrapper} ${a}`,"data-event-category":o,"data-event-action":l?"Like Comment Click":"Like Post Click","data-event-label":i},n,{onClick:()=>{null==r||r()}}),t)},ShareWrapper=e=>{var{children:t,className:a=""}=e,n=(0,g._)(e,["children","className"]);let{trackingCategory:l,trackingLabel:o,onShareClick:i}=(0,m.useContext)(ex);return m.createElement(T.x,Object.assign({className:`${ey.wrapper} ${a}`,"data-event-category":l,"data-event-action":"Share Icon Click","data-event-label":o},n,{onClick:()=>{null==i||i()}}),t)},CommentWrapper=e=>{var{children:t,className:a=""}=e,n=(0,g._)(e,["children","className"]);let{isReplied:l,trackingCategory:o,trackingLabel:i,onCommentClick:r}=(0,m.useContext)(ex);return m.createElement(T.x,Object.assign({className:`${ey.wrapper} ${a}`,"data-event-category":o,"data-event-action":l?"Reply Comment Click":"Comment Text Click","data-event-label":i},n,{onClick:e=>{e.preventDefault(),e.stopPropagation(),null==r||r()}}),t)};var ew={wrapper:"UhiT4m5",inner:"oEfeTkV",column:"OlbikxJ",iconTxt:"_9GXHCn3",clickableIcon:"HCsrR0N",count:"MV3lNuh"};(n=r||(r={}))[n.post=1]="post",n[n.reply=2]="reply";let CardReactions=e=>{var{type:t,viewCount:a,loveCount:n=0,replyCount:l=0,replyPadding:o,liked:i,isReplied:s,onCommentClick:d,onLikeClick:c,onShareClick:b,className:x,style:y,hideCommentIcon:w,showingMostEngaging:E,isMarryBaby:k,hasShare:C=!0,hasCountLike:A=!0,trackingCategory:N="Together",trackingLabel:P="",children:T}=e,S=(0,g._)(e,["type","viewCount","loveCount","replyCount","replyPadding","liked","isReplied","onCommentClick","onLikeClick","onShareClick","className","style","hideCommentIcon","showingMostEngaging","isMarryBaby","hasShare","hasCountLike","trackingCategory","trackingLabel","children"]);let{data:{env:{isMarryBaby:z}}}=(0,m.useContext)(u.T),M=k||z,{t:j}=(0,F.u)();return m.createElement(ex.Provider,{value:{liked:i,loveCount:n,trackingCategory:N,trackingLabel:P,isReplied:s,onLikeClick:c,onShareClick:b,onCommentClick:d}},T||m.createElement("div",Object.assign({className:`${ew.wrapper} ${x}`,"data-show-most-engaging":E,"data-type":t===r.post?"post":"reply","data-reply-padding":t===r.reply&&o,"data-is-marrybaby":M,style:y},S),m.createElement("div",{className:ew.inner},m.createElement("div",{className:ew.column},m.createElement(LikeWrapper,{className:ew.clickableIcon},m.createElement(p.T,{className:ew.iconTxt,size:"p3",as:"div"},m.createElement(v.Z,{className:"txt-icon",isMarryBaby:M,isSolid:i,color:i?M?U.t.mbColors.pink:U.t.colors.red800:"#737373"}),A&&m.createElement("div",{className:ew.count},n))),C&&m.createElement(ShareWrapper,{className:ew.clickableIcon},m.createElement(p.T,{size:"p3",className:ew.iconTxt,as:"div"},m.createElement(eo.I.Share,{isMarryBaby:M}))),void 0!==a&&m.createElement(p.T,{size:"p3",className:ew.iconTxt,as:"div"},m.createElement(eo.I.Eye,{isMarryBaby:M}),m.createElement("div",{className:ew.count},(0,ei.a)(a)))),!w&&m.createElement(CommentWrapper,{className:ew.clickableIcon},m.createElement(p.T,{size:"p3",className:ew.iconTxt,as:"div"},s?m.createElement(h.Z,{className:"txt-icon"}):m.createElement(f.Z,{className:"txt-icon",isMarryBaby:M}),s?j("cardReactions.reply"):m.createElement("div",{className:ew.count},j("post.commentCount",{count:l})))))))};CardReactions.LikeWrapper=LikeWrapper,CardReactions.ShareWrapper=ShareWrapper,CardReactions.CommentWrapper=CommentWrapper;let eE=(0,S.k)(e=>({wrapper:{display:"flex",flexWrap:"wrap",width:"100%",padding:"0.5rem 0",gap:"0.5rem"},item:{position:"relative",whiteSpace:"nowrap",padding:"5px 12px",background:e.colors.gray[0],borderRadius:"2rem",cursor:"pointer","-webkit-user-drag":"none",userSelect:"none",textDecoration:"none","*":{pointerEvents:"none"},"&:first-child":{marginLeft:0}},text:{}})),TagTopic=e=>{var{topics:t=[],onClick:a,className:n,style:l,trackingCategory:o="Together",locale:i="vi-VN",classNames:r,styles:s,unstyled:d,shortenedNumber:c=3,shortenedStyle:v}=e,h=(0,g._)(e,["topics","onClick","className","style","trackingCategory","locale","classNames","styles","unstyled","shortenedNumber","shortenedStyle"]);let{t:f}=(0,F.u)(),{classes:b}=eE(void 0,{name:"TagTopic",classNames:r,styles:s,unstyled:d}),{data:{env:{togetherBasePath:x}},action:{sanitizeFunction:y}}=(0,m.useContext)(u.T),[w,E]=(0,m.useState)(!v);return m.createElement("div",Object.assign({onClick:a,className:`${b.wrapper} ${n}`,style:l},h),(w?t:t.slice(0,c)).map((e,t)=>{let a=(null==e?void 0:e.dueDateMonth)&&(null==e?void 0:e.dueDateMonth)!==0&&(null==e?void 0:e.dueDateYear)&&(null==e?void 0:e.dueDateYear)!==0;return m.createElement("a",{className:b.item,key:t,"data-event-category":o,"data-event-action":"Topic in Post Click","data-event-label":`${(0,u.o)(i)}${x}${e.url}`,href:e.isActive&&!e.isHidden?`${x}${e.url}/`:void 0},m.createElement(p.T,{size:"p4"},m.createElement("span",{style:Object.assign({},a&&{textTransform:"capitalize"}),dangerouslySetInnerHTML:{__html:a?`${(0,er.Z)(new Date(2020,Number(e.dueDateMonth)-1,1),"MMMM",{locale:L.D[i]})}${i===V.L.Vietnam?"/":" "}${null==e?void 0:e.dueDateYear}`:(null==y?void 0:y(e.name))||e.name}})))}),!w&&t.length>c&&m.createElement("a",{className:b.item,href:"#",onClick:e=>{e.preventDefault(),E(!0)}},m.createElement(p.T,{size:"p4"},"+",f("tagTopic.moreTopics",{number:t.length-c}))))},ek=el.Z.div` display: flex; align-items: center; justify-content: space-between; padding: 16px; cursor: pointer; &[data-color='gray'] { background: ${U.t.colors.neutral50}; } &[data-color='white'] { border-bottom: 1px solid #e4e8ec; background: ${U.t.colors.white}; } .popover-menu__btn { display: flex; min-width: 2rem; height: 2rem; align-items: center; padding: 8px 0 !important; border: none; margin-left: 0.5rem; background: transparent; > span { display: flex; align-items: center; } &:hover { background: transparent !important; } } &.label-pinned { border-radius: ${U.t.borderRadius} 6px 0 0; .label-sort-pin-icon { width: 16px; height: 16px; vertical-align: middle; } } &[data-is-marrybaby='true'] { padding: 0.75rem 1rem; border-radius: 16px 16px 0px 0px; &[data-color='white'] { border-bottom: none; } &[data-color='gray'] { background: #f3f3f3; } .popover-menu__btn { width: unset; } &.label-pinned { border-bottom: none; background: #fff9eb; border-radius: 1rem 1rem 0 0; .label-sort-pin-icon { margin-right: 8px; } .label-sort-pin-heading { color: #fb8c00; } } &.label-sorting { ${q.M.tdUp} { padding-bottom: 1.5rem; margin-bottom: -0.75rem; } } } `,LabelSortPin=({label:e,rightLabel:t,onClick:a,color:n,className:l,style:o})=>{let{data:{env:{isMarryBaby:i}}}=(0,m.useContext)(u.T);return m.createElement(ek,{"data-is-marrybaby":i,"data-color":n,onClick:a,className:l,style:o},m.createElement(p.T,{className:"label-sort-pin-heading",size:i?"p4":"p3",weight:"bold"},e),t)},LabelPin=({onClick:e,color:t,className:a,style:n})=>{let{data:{env:{isMarryBaby:l}}}=(0,m.useContext)(u.T),{t:o}=(0,F.u)();return m.createElement(LabelSortPin,{label:m.createElement(m.Fragment,null,l&&m.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%23FB8C00' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m3.5 20 4.37-4.37'/%3e%3cpath stroke='%23FB8C00' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M4.956 11.294a1 1 0 0 0 0 1.414l2.918 2.918 2.918 2.918a1 1 0 0 0 1.414 0l1.175-1.175a1 1 0 0 0 .293-.707v-3.936l2.9-2.9 2.31.123c.282.015.56-.091.76-.291l.573-.574a1 1 0 0 0 0-1.414l-4.386-4.386a1 1 0 0 0-1.414 0l-.574.574a1 1 0 0 0-.29.76l.122 2.309-2.9 2.9H6.838a1 1 0 0 0-.707.293z' clip-rule='evenodd'/%3e%3cpath stroke='%23FB8C00' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m16.57 9.83-2.9-2.9'/%3e%3c/svg%3e",loading:"lazy"})," ",o("label.pinnedPost")),rightLabel:!l&&m.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23FEA21E' stroke-linecap='round' d='m7.186 7.682-3.504 6.132'/%3e%3cpath fill='%23FEA21E' stroke='%23FEA21E' stroke-linejoin='round' stroke-width='.5' d='M3.246 7.784a.25.25 0 0 0 .091.342l5.447 3.145a.25.25 0 0 0 .342-.092 3.39 3.39 0 0 0 .11-3.186l1.622-2.808a2.66 2.66 0 0 0 1.606-1.239.25.25 0 0 0-.092-.341l-4.19-2.42a.25.25 0 0 0-.341.092 2.66 2.66 0 0 0-.27 2.01L5.949 6.095a3.39 3.39 0 0 0-2.703 1.69Z'/%3e%3c/svg%3e",loading:"lazy"}),onClick:e,color:"white",className:`label-pinned ${a}`,style:n})},eC=el.Z.div` position: relative; display: content; .popover-menu__btn { /* position: relative; */ > span { width: 100%; height: 100%; > img { width: 100%; height: 100%; } } } .popover-menu__content { position: absolute; z-index: 10; width: 320px; padding: 8px; border: none; background: #fff; border-radius: 8px; box-shadow: 3px 3px 20px rgba(0, 0, 0, 0.1); &::before { position: absolute; width: 16px; height: 8px; background: #fff; content: ''; } &.--position { &-top { bottom: calc(100% + 8px); &.--align { &-start { left: 0; &::before { top: 100%; left: 16px; clip-path: polygon(0 0, 50% 100%, 100% 0); } } &-end { left: 100%; transform: translateX(calc(-100% + 1rem)); &::before { top: 100%; right: 16px; clip-path: polygon(0 0, 50% 100%, 100% 0); } } } } &-right { left: calc(100% + 8px); &.--align { &-start { top: 0; &::before { top: 16px; left: 0; width: 8px; height: 16px; clip-path: polygon(0 50%, 100% 0%, 100% 100%); transform: translateX(-100%); } } &-end { top: 100%; transform: translateX(calc(-100% + 1rem)); &::before { bottom: 16px; left: 0; width: 8px; height: 16px; clip-path: polygon(0 50%, 100% 0%, 100% 100%); transform: translateX(-100%); } } } } &-bottom { top: calc(100% + 8px); &.--align { &-start { left: 0; &::before { bottom: 100%; left: 16px; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); } } &-end { left: 100%; transform: translateX(calc(-100% + 1rem)); &::before { right: 16px; bottom: 100%; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); } } } } &-left { left: -8px; transform: translateX(-100%); &.--align { &-start { top: 0; &::before { top: 16px; left: 100%; width: 8px; height: 16px; clip-path: polygon(0 0%, 100% 50%, 0% 100%); transform: translateX(0); } } &-end { bottom: 0; &::before { bottom: 16px; left: 100%; width: 8px; height: 16px; clip-path: polygon(0 0%, 100% 50%, 0% 100%); transform: translateX(0); } } } } } } &[data-is-marrybaby='true'] { .popover-menu__content { padding: 0; border-radius: 12px; /* &::before { display: none; } */ } } `,eA=el.Z.div` display: flex; /* max-height: 300px; */ flex-direction: column; cursor: default; .__header { position: relative; display: flex; align-items: center; justify-content: center; padding: 1rem 0; margin-bottom: 8px; .__back-btn { position: absolute; top: 50%; left: 8px; width: 16px; height: 16px; cursor: pointer; transform: translateY(-50%); } } .tree-text-description { padding-right: 8px; padding-left: 8px; margin-top: -8px; margin-bottom: 8px; font-size: 14px; font-weight: 400; line-height: 22px; text-align: left; } .__content { overflow: auto; flex: 1; } .__list { .__item { position: relative; &.bold-item { font-weight: 700; } &:last-child { .__btn { margin-bottom: 0; } } .__btn { position: relative; display: flex; width: 100%; height: 40px; align-items: center; padding: 0 1rem; border: none; margin-bottom: 8px; color: ${U.t.colors.gray800}; cursor: pointer; text-align: left; transition: background 0.3s; /* for better gtm tracking result */ * { pointer-events: none; } &.--checked { color: ${U.t.colors.gray500}; pointer-events: none; } &:hover { background: ${U.t.colors.gray100}; } .__icon { width: 16px; height: 16px; margin-right: 0.4rem; } & > span { position: relative; & > img { width: 16px; height: 16px; margin-right: 0.4rem; } } } .__toggle { position: absolute; top: 50%; right: 16px; width: 16px; height: 16px; pointer-events: none; transform: translateY(-50%); } } } &[data-is-marrybaby='true'] { .__header { padding: 1rem; } .tree-text-description { padding: 0 1rem; } .__list { .__item { &:first-child { .__btn { border-top-left-radius: 12px; border-top-right-radius: 12px; } } &:last-child { .__btn { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; } } .__btn { height: unset; padding: 1rem; margin-bottom: 0; &:hover { background: ${U.t.mbColors.lightPink}; } } } } } `,PopoverMenu=({className:e,style:t,toggleButtonContent:a,position:n="bottom",align:l="end",children:o,buttonProps:i})=>{let{data:{env:{isMarryBaby:r}}}=(0,m.useContext)(u.T),[s,d]=(0,m.useState)(!1),c=(0,m.useRef)(null),p=(0,m.useRef)(s);return(0,m.useEffect)(()=>{var e;p.current=s,s&&(null===(e=c.current)||void 0===e||e.focus())},[s]),(0,m.useEffect)(()=>{let clickHandler=e=>{var t;(null===(t=c.current)||void 0===t?void 0:t.contains(e.target))||!p.current||d(!1)};return window.addEventListener("click",clickHandler,{passive:!0}),()=>{window.removeEventListener("click",clickHandler)}},[]),m.createElement(eC,{"data-is-marrybaby":r,className:e,style:t},m.createElement(ee.B,Object.assign({theme:r?"marryBaby":"helloSites",className:"popover-menu__btn",size:"md",color:"transparent",onClick:()=>d(e=>!e)},i),a),s?m.createElement("div",{ref:c,className:`popover-menu__content --position-${n} --align-${l}`,tabIndex:0,onClick:e=>e.stopPropagation()},"function"==typeof o?o({setShow:d}):o):null)},TreePopoverMenu=e=>{var{data:t}=e,a=(0,g._)(e,["data"]);return m.createElement(PopoverMenu,Object.assign({},a),({setShow:e})=>m.createElement(Tree,{data:t,setShow:e}))},getCurrentDataFromPath=(e,t)=>{let a=t.split("."),n=e;return a.forEach(e=>{var t,a;e&&n&&(null==n?void 0:n.type)==="list"&&(n=null===(a=null===(t=null==n?void 0:n.list)||void 0===t?void 0:t[Number(e)])||void 0===a?void 0:a.subTree)}),n},Tree=({data:e,setShow:t})=>{var a;let[n,l]=(0,m.useState)(""),o=(0,m.useMemo)(()=>e&&getCurrentDataFromPath(e,n),[e,n]);if(!e||!o)return null;let handleItemClick=(e,{subTree:a,onClick:n=()=>null})=>{n&&n(),a?l(t=>t.split(".").concat(String(e)).join(".")):t&&t(!1)};return m.createElement(eA,null,o.isShowheader?m.createElement("div",{className:"__header"},n?m.createElement("img",{className:"__back-btn",src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%23262626' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='m15 18-6-6 6-6'/%3e%3c/svg%3e",onClick:()=>l(e=>e.split(".").slice(0,-1).join(".")),loading:"lazy"}):null,o.title?m.createElement(et.H,{className:"__title",tag:"h6"},o.title):null):null,o.description?m.createElement(p.T,{className:"tree-text-description",color:U.t.colors.gray600,size:"p3",weight:"regular"},o.description):null,m.createElement("div",{className:"__content"},"jsx"===o.type?null===(a=null==o?void 0:o.jsxRenderer)||void 0===a?void 0:a.call(o,t):null,"list"===o.type?m.createElement("ul",{className:"__list"},Array.isArray(o.list)?o.list.map((e,t)=>m.createElement("li",{key:t,style:e.style,className:`__item ${e.className}`}," ",m.createElement("div",{className:`__btn ${e.selected?"--checked":""}`,onClick:()=>handleItemClick(t,e),"data-event-category":e.dataEventCategory,"data-event-action":e.dataEventAction,"data-event-label":e.dataEventLabel},e.icon&&m.createElement("img",{className:"__icon",src:e.icon,loading:"lazy"}),m.createElement("span",null,e.label)),e.subTree?m.createElement("img",{className:"__toggle",src:"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' stroke-width='1.5' d='m6 12 4-4-4-4'/%3e%3c/svg%3e",loading:"lazy"}):null,e.selected?m.createElement("img",{className:"__toggle",src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%238C8C8C' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M13.333 4 6 11.333 2.667 8'/%3e%3c/svg%3e",loading:"lazy"}):null)):null):null))};(l=s||(s={})).latest="latest",l.oldest="oldest",l.popular="popular";let LabelSorting=({onChange:e,className:t,style:a,leftLabel:n,rightLabel:l,color:o,value:i,choices:r})=>{let{data:{env:{isMarryBaby:s}}}=(0,m.useContext)(u.T);return m.createElement(LabelSortPin,{label:n,rightLabel:m.createElement(TreePopoverMenu,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:r.map(t=>({label:t.label,onClick:()=>e&&e(String(t.value)),selected:t.value===i,className:"bold-item"}))},toggleButtonContent:m.createElement("div",{style:{display:"flex"}},m.createElement(p.T,{style:{display:"flex",alignItems:"center",fontWeight:"normal",marginRight:12},size:"p4"},l),m.createElement("img",{src:s?"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%233E3F58' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m8 14 4 4 4-4M16 10l-4-4-4 4'/%3e%3c/svg%3e":"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath fill='%238C8C8C' d='M4.5 7h7a.46.46 0 0 0 .351-.165.56.56 0 0 0 .149-.39q0-.226-.149-.391l-3.5-3.89a.458.458 0 0 0-.703 0l-3.5 3.89a.56.56 0 0 0-.148.39q0 .226.148.391Q4.298 7 4.5 7M11.5 9h-7a.46.46 0 0 0-.352.165.56.56 0 0 0-.148.39q0 .226.148.391l3.5 3.889a.46.46 0 0 0 .703 0l3.5-3.889a.56.56 0 0 0 .149-.39q0-.226-.149-.391A.46.46 0 0 0 11.5 9'/%3e%3c/svg%3e",style:{width:16,height:16,alignSelf:"center"},loading:"lazy"}))}),color:"gray",className:t,style:a})},MainText=({children:e,className:t=""})=>m.createElement("div",{className:`tMiOKib ${t}`},e),SubText=({children:e,className:t=""})=>m.createElement("div",{className:`uDcqD-2 ${t}`},e);var eN={container:"sTU4T4I",info:"tCql9Je",avatarWrapper:"_3j7uYhH",avatarIcon:"PHABgoT"};let CardAuthor$1=({avatarProps:e,title:t,subTitle:a,children:n,className:l="",style:o,onAvatarClick:i,avatarIcon:r,dataEventCategory:s,dataEventAction:d,dataEventLabel:c})=>m.createElement("div",{className:`${eN.container} ${l}`,style:o},m.createElement("div",{className:eN.avatarWrapper,onClick:i,"data-event-category":s,"data-event-action":d,"data-event-label":c},m.createElement(H.U,Object.assign({},e)),r&&m.createElement("div",{className:eN.avatarIcon},r)),m.createElement("div",{className:`${eN.info} ${l}`,style:{minHeight:`${(null==e?void 0:e.size)||40}px`}},n||m.createElement(m.Fragment,null,t&&m.createElement(MainText,null,t),a&&m.createElement(SubText,null,a))));CardAuthor$1.MainText=MainText,CardAuthor$1.SubText=SubText,CardAuthor$1.SubDivider=({className:e=""})=>m.createElement("span",{className:`m-HVXw1 ${e}`}),CardAuthor$1.Row=({children:e,className:t=""})=>m.createElement("div",{className:`dZWeHns ${t} row`},e),CardAuthor$1.ColLeft=({children:e,className:t=""})=>m.createElement("div",{className:`${t} col-left`},e),CardAuthor$1.ColRight=({children:e,className:t=""})=>m.createElement("div",{className:`${t} col-right`},e),CardAuthor$1.SubTextRow=e=>{var{children:t,className:a=""}=e,n=(0,g._)(e,["children","className"]);return m.createElement("div",Object.assign({className:`pDlsows ${a}`},n),t)};var eP=(0,S.k)(()=>({root:{verticalAlign:"bottom"}}));let eT=(0,m.createContext)({}),AuthorBadgeItem=({styles:e,className:t,classNames:a})=>{let{role:n,siteType:l,title:o}=(0,m.useContext)(eT),{cx:i,classes:r}=eP(void 0,{name:"AuthorBadgeItem",styles:e,classNames:a});return n?m.createElement(Z.A,{className:i(r.root,t),siteType:l,role:n,title:o}):null};var eS=(0,S.k)(()=>({root:{}}));let ez=el.Z.div` position: fixed; left: 50%; width: 343px; background-color: ${U.t.colors.white}; border-radius: ${U.t.borderRadius}; box-shadow: 0px 0px 4px ${U.t.colors.gray200}; transform: translate(-50%, -50%); transition: all 0.5s ease-in-out; ${q.M.tdUp} { width: 750px; } &[data-animation='true'] { transition: all 0.5s ease-in-out; } &[data-open='true'] { z-index: 400; top: 50%; opacity: 1; visibility: visible; } &[data-open='false'] { top: -50%; } .popup-content { ${q.M.mbDown} { display: block; } display: flex; position: relative; z-index: 111; height: 100%; .button-see-more { margin: 32px 0; padding: 0; > * { display: inline-block; } } .close-button { position: absolute; z-index: 100; top: 10px; right: 10px; cursor: pointer; width: unset; height: unset; img { width: 100%; height: 100%; border-radius: 50%; } } } .main-info { padding-bottom: 32px; background-color: ${U.t.colors.primary50}; border-radius: ${U.t.borderRadius}; .btn-booking { display: flex; margin: 12px auto; } .avatar-title { position: relative; width: 100%; padding-top: 46px; text-align: center; } } `,eM=el.Z.div` position: fixed; z-index: 110; top: 0; left: 0; width: 100%; height: 100%; align-items: center; background: rgba(38, 38, 38, 0.3); &[data-open='false'] { display: none; } `,ej=el.Z.div` .image-container { .badge-avatar { position: absolute; right: 0; bottom: 0; top: 0; } } display: flex; justify-content: center; padding-bottom: 15px; text-align: center; .profile-image { width: 100px; min-width: 100px; height: 100px; min-height: 100px; border-radius: 50%; object-fit: cover; } .badge-avatar { width: 24px; height: 24px; } `,eI=el.Z.div` position: relative; z-index: 9; .specialty { display: flex; flex-wrap: wrap; justify-content: center; } padding: 0px 16px; text-align: center; .specialty { justify-content: center; } .experience { padding: 16px 0px 32px; text-align: left; .btn-wrapper { margin-top: 24px; } } p { max-width: 100%; -webkit-line-clamp: 4; -webkit-box-orient: vertical; text-overflow: ellipsis; overflow: hidden; } `,eR=el.Z.ul` padding-left: 18px; li { list-style-type: disc; } `;var eO="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%23262626' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M18 6 6 18M6 6l12 12'/%3e%3c/svg%3e",eD="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none'%3e%3cpath fill='white' stroke='%23E4E8EC' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M9 17A8 8 0 1 0 9 1a8 8 0 0 0 0 16'/%3e%3cpath fill='%23FF5331' d='M10.333 7.667V5H7.667v2.667H5v2.667h2.667V13h2.666v-2.666H13V7.667z'/%3e%3c/svg%3e";let eF=el.Z.div` display: flex; align-items: center; justify-content: center; padding: 1em; button { position: relative; } `,eB=ep.F4` 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } `;el.Z.div` display: flex; width: fit-content; width: -moz-fit-content; flex-direction: column; align-items: center; justify-content: center; padding: 1rem 2rem; background: white; border-radius: ${U.t.borderRadius}; box-shadow: -1px 1px 2px rgba(67, 70, 74, 0.0001), -2px 2px 5px rgba(67, 86, 100, 0.123689); .loading-spinner { width: 24px; height: 24px; margin-bottom: 0.5rem; animation: ${eB} 1.2s linear infinite; } &[data-is-marrybaby='true'] { box-shadow: none; } `;let Loading$1=({className:e,size:t="md"})=>{let{t:a}=(0,F.u)();return m.createElement(eF,{className:e},m.createElement(ee.B,{size:t,color:"transparent",isLoading:!0},a("loading")))},PopupDoctor=({isOpen:e=!0,onClose:t,enableAnimation:a=!0,doctorId:n,locale:l,isMobile:o,overwriteProfileProps:i,avatarFallback:r=W.C.getAssetPath("avatar.jpg"),trackingCategory:s="Together"})=>{var d,c,g;let{t:v}=(0,F.u)(),[h,f]=(0,m.useState)(null),[b,x]=(0,m.useState)(!1);(0,m.useEffect)(()=>{if(e&&n&&String(null==h?void 0:h.id)!==String(n)){x(!0);try{f(null),(0,u.i)((0,u.j)(u.C.GET_DOCTOR_INFO,{doctorId:n,website_url:u.p[l]}),"get").then(e=>{f(Object.assign(Object.assign({},null==e?void 0:e._data.doctor),i))})}catch(e){console.error(e)}x(!1)}},[e,n,null==h?void 0:h.id]);let y=(null==h?void 0:h.experiences)||[],w=(null==h?void 0:h.specialties)||[],E=w.map(e=>(null==e?void 0:e.name)||e).join(" • "),k=y.map(e=>{try{return JSON.parse(e.description)}catch(t){return e.description}}).filter(e=>e.content),renderExperienceText=e=>(null==e?void 0:e.year)?`${e.year} ${null==e?void 0:e.content}`:(null==e?void 0:e.content)?e.content:"string"==typeof e?e:"";return m.createElement(m.Fragment,null,m.createElement(ez,{"data-open":e,"data-animation":a,onClick:e=>e.stopPropagation()},b||!h?m.createElement(Loading$1,null):m.createElement("div",{className:"popup-content"},m.createElement("div",{className:"close-button",onClick:t},m.createElement("img",{src:eO,style:{width:20,height:20},alt:"close-icon",loading:"lazy"})),m.createElement("div",{className:"main-info"},m.createElement("div",{className:"border-banner"}),m.createElement("div",{className:"avatar-title"},m.createElement(ej,null,m.createElement("div",{className:"image-container"},m.createElement("div",{style:{position:"relative"}},m.createElement($.I,{src:null==h?void 0:h.avatar,backupSrc:r,className:"profile-image",alt:"avatar"}),m.createElement("img",{className:"badge-avatar",src:eD,alt:"badge",loading:"lazy"})))),m.createElement(eI,null,m.createElement(p.T,{size:"s3",weight:"semiBold",className:"full-name"},null==h?void 0:h.name),m.createElement("div",{className:"specialty"},E&&m.createElement(m.Fragment,null,m.createElement(p.T,{size:"p4",color:U.t.colors.gray800},E," • ")),m.createElement("a",{href:(0,u.q)({id:null===(d=null==h?void 0:h.organization)||void 0===d?void 0:d.id,name:null===(c=null==h?void 0:h.organization)||void 0===c?void 0:c.name,slug:null===(g=null==h?void 0:h.organization)||void 0===g?void 0:g.slug,locale:l}),className:"organisation",target:"_blank",rel:"noreferrer"},m.createElement(p.T,{size:"p4",className:"organisation",color:U.t.colors.gray800,style:{textDecoration:"underline"}},null==h?void 0:h.organization.name))))),!o&&m.createElement("div",{className:"btn-wrapper"},m.createElement("a",{href:(0,u.r)({name:h.name,id:h.id,locale:l})},m.createElement(ee.B,{color:"primary",size:"md",className:"btn-booking"},v("careBooking.bookAnAppointment"))))),k&&m.createElement(eI,null,m.createElement("div",{className:"experience"},m.createElement(p.T,{weight:"bold",size:"s3",color:U.t.colors.gray800,style:{paddingBottom:16}},v("expert.content.description").toUpperCase()),m.createElement(eR,null,k.map((e,t)=>m.createElement("li",{key:t},m.createElement(p.T,{size:"p2"},renderExperienceText(e))))),o?m.createElement("div",{className:"btn-wrapper"},m.createElement("a",{href:(0,u.r)({name:h.name,id:h.id,locale:l})},m.createElement(ee.B,{color:"primary",size:"md",className:"btn-booking"},v("careBooking.bookAnAppointment")))):m.createElement("a",{href:(0,u.r)({name:h.name,id:h.id,locale:l})},m.createElement(p.T,{size:"s4",color:"#2D87F3",style:{paddingTop:24},"data-event-category":s,"data-event-action":"See Full Doctor Profile","data-event-label":(0,u.o)(l)+(0,u.r)({name:h.name,id:h.id,locale:l})},v("home.seeExpert"))))))),m.createElement(eM,{"data-open":e,onClick:e=>{e.stopPropagation(),t()}}))},e_=el.Z.div` position: fixed; left: 50%; width: 343px; background-color: ${U.t.colors.white}; border-radius: ${U.t.borderRadius}; box-shadow: 0px 0px 4px ${U.t.colors.gray200}; transform: translate(-50%, -50%); transition: all 0.5s ease-in-out; ${q.M.tdUp} { width: 750px; } &[data-animation='true'] { transition: all 0.5s ease-in-out; } &[data-open='true'] { z-index: 400; top: 50%; opacity: 1; visibility: visible; } &[data-open='false'] { top: -50%; } .popup-content { ${q.M.mbDown} { display: block; } display: flex; position: relative; z-index: 111; height: 100%; .button-see-more { margin: 32px 0; padding: 0; > * { display: inline-block; } } .close-button { position: absolute; z-index: 100; top: 10px; right: 10px; cursor: pointer; width: unset; height: unset; img { width: 100%; height: 100%; border-radius: 50%; } } } .main-info { padding-bottom: 32px; background-color: ${U.t.colors.primary50}; border-radius: ${U.t.borderRadius}; .avatar-title { position: relative; width: 100%; padding-top: 46px; text-align: center; } } `,eU=el.Z.div` position: fixed; z-index: 110; top: 0; left: 0; width: 100%; height: 100%; align-items: center; background: rgba(38, 38, 38, 0.3); &[data-open='false'] { display: none; } `,e$=el.Z.div` .image-container { .badge-avatar { position: absolute; right: 0; bottom: 0; top: 0; } } display: flex; justify-content: center; padding-bottom: 15px; text-align: center; .profile-image { width: 100px; min-width: 100px; height: 100px; min-height: 100px; border-radius: 50%; object-fit: cover; } .badge-avatar { width: 24px; height: 24px; } `,eL=el.Z.div` position: relative; z-index: 9; .specialty { display: flex; flex-wrap: wrap; justify-content: center; } padding: 0px 16px; text-align: center; .specialty { justify-content: center; } .experience { padding: 16px 0px 32px; text-align: left; .btn-wrapper { margin-top: 24px; } } p { max-width: 100%; -webkit-line-clamp: 4; -webkit-box-orient: vertical; text-overflow: ellipsis; overflow: hidden; } `,eV=el.Z.div` display: flex; margin-top: 8px; .bullet-point { width: 24px; height: 24px; } `;var eW="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath fill='%2345A4FF' d='M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12'/%3e%3cpath fill='%232D87F3' d='M24 12a12 12 0 0 0-.128-1.758l-5.077-5.077L5.041 18.958l4.858 4.858c.682.12 1.384.184 2.1.184 6.628 0 12-5.373 12-12Z'/%3e%3cpath fill='white' d='M9.014 17.824 5.04 18.959l1.135-3.973 2.368.47z'/%3e%3cpath fill='%23F7F9FC' d='M8.544 15.456 5.041 18.96l3.972-1.135z'/%3e%3cpath fill='%23E4E8EC' d='M6.467 18.552 5.45 17.533l-.41 1.427 1.426-.407Z'/%3e%3cpath fill='%23D2D6DC' d='m5.957 18.043-.916.916 1.426-.407z'/%3e%3cpath fill='%23FFD658' d='m15.828 5.331 2.837 2.837-9.651 9.652-2.838-2.837z'/%3e%3cpath fill='%23FFC326' d='m7.594 16.404 9.651-9.651 1.419 1.418-9.652 9.652z'/%3e%3cpath fill='%23FF5331' d='m18.312 8.525-2.837-2.838 1.123-1.123c.44-.44 1.154-.44 1.595 0l1.243 1.243c.44.44.44 1.154 0 1.594z'/%3e%3cpath fill='%23F44D2C' d='m18.816 5.186-1.921 1.92 1.418 1.419 1.124-1.124c.44-.44.44-1.154 0-1.594l-.622-.621Z'/%3e%3c/svg%3e";let eq={author:eW,edtior:eW,expert:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3ccircle cx='12' cy='12' r='12' fill='%23FFCB37'/%3e%3ccircle cx='12' cy='12' r='10.5' fill='%23FE921D'/%3e%3cpath fill='white' d='M11.443 5.137a.6.6 0 0 1 1.114 0l1.436 3.577a.6.6 0 0 0 .516.375l3.846.26a.6.6 0 0 1 .344 1.06l-2.958 2.471a.6.6 0 0 0-.197.607l.94 3.738a.6.6 0 0 1-.9.655l-3.265-2.05a.6.6 0 0 0-.638 0l-3.265 2.05a.6.6 0 0 1-.9-.655l.94-3.738a.6.6 0 0 0-.198-.607L5.3 10.41a.6.6 0 0 1 .344-1.06l3.846-.26a.6.6 0 0 0 .517-.375z'/%3e%3c/svg%3e","fact-check":"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath fill='%2300C076' d='M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='m11.946 5.466-5.28 4.8-2.4-2.182'/%3e%3c/svg%3e",medical:eD},PopupExpert=({trackingCategory:e="Together",locale:t,isOpen:a=!0,onClose:n,enableAnimation:l=!0,expertId:o,overwriteProfileProps:i,avatarFallback:r=W.C.getAssetPath("avatar.jpg")})=>{let{t:s}=(0,F.u)(),[d,c]=(0,m.useState)(null),[g,v]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{if(a&&o&&String(null==d?void 0:d.user_id)!==String(o)){v(!0);try{c(null),(0,u.i)((0,u.t)(u.u.GET_EXPERT_BY_ID,{id:o}),"get").then(e=>{c(Object.assign(Object.assign({},null==e?void 0:e.data),i))})}catch(e){console.error(e)}v(!1)}},[a,o,null==d?void 0:d.user_id]),m.createElement(m.Fragment,null,m.createElement(e_,{"data-open":a,"data-animation":l,onClick:e=>e.stopPropagation()},g||!d?m.createElement(Loading$1,null):m.createElement("div",{className:"popup-content"},m.createElement("div",{className:"close-button",onClick:n},m.createElement("img",{src:eO,style:{width:20,height:20},alt:"close-icon",loading:"lazy"})),m.createElement("div",{className:"main-info"},m.createElement("div",{className:"border-banner"}),m.createElement("div",{className:"avatar-title"},m.createElement(e$,null,m.createElement("div",{className:"image-container"},m.createElement("div",{style:{position:"relative"}},m.createElement($.I,{src:null==d?void 0:d.avatar,className:"profile-image",alt:"avatar",backupSrc:r}),m.createElement("img",{className:"badge-avatar",src:eq[null==d?void 0:d.role],alt:"badge",loading:"lazy"})))),m.createElement(eL,null,m.createElement(p.T,{size:"s3",className:"full-name",weight:"semiBold"},null==d?void 0:d.display_name),m.createElement("div",null,m.createElement(p.T,{size:"p4",color:U.t.colors.gray800},null==d?void 0:d.specialty," • "),m.createElement("a",{href:null==d?void 0:d.organisation_url,className:"organisation",target:"_blank",rel:"noreferrer"},m.createElement(p.T,{size:"p4",className:"organisation",color:U.t.colors.gray800,style:{textDecoration:"underline"}},null==d?void 0:d.organisation)))))),m.createElement(eL,null,m.createElement("div",{className:"experience"},m.createElement(p.T,{weight:"bold",size:"p4",color:U.t.colors.gray800,style:{paddingBottom:16}},s("expert.content.description").toUpperCase()),m.createElement("div",{className:"list-items"},null!=d&&!!d.experiences&&d.experiences.filter(e=>!!(e&&(e.title||e.organization))).slice(0,3).map((e,t)=>m.createElement(eV,{key:t},m.createElement("img",{className:"bullet-point",src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3ccircle cx='12' cy='12' r='2' fill='%232D87F3'/%3e%3c/svg%3e",alt:"point",loading:"lazy"}),m.createElement("div",{className:"text-contain"},m.createElement(et.H,{tag:"h6",color:U.t.colors.gray800},null==e?void 0:e.title),m.createElement(p.T,{size:"p2",color:U.t.colors.gray500},null==e?void 0:e.organization))))),m.createElement("a",{href:null==d?void 0:d.profile_url,style:{display:"inline-block",paddingTop:24}},m.createElement(p.T,{as:"span",size:"s4",color:"#2D87F3","data-event-category":e,"data-event-action":"See Full Doctor Profile","data-event-label":(0,u.o)(t)+(null==d?void 0:d.profile_url)},s("home.seeExpert"))))))),m.createElement(eU,{"data-open":a,onClick:e=>{e.stopPropagation(),n()}}))},eZ=el.Z.div` position: fixed; left: 50%; width: 343px; background-color: ${U.t.colors.white}; border-radius: ${U.t.borderRadius}; box-shadow: 0px 0px 4px ${U.t.colors.gray200}; transform: translate(-50%, -50%); transition: all 0.5s ease-in-out; ${q.M.tdUp} { width: 750px; } &[data-animation='true'] { transition: all 0.5s ease-in-out; } &[data-open='true'] { z-index: 400; top: 50%; opacity: 1; visibility: visible; } &[data-open='false'] { top: -50%; } .popup-content { ${q.M.mbDown} { display: block; } display: flex; position: relative; z-index: 111; height: 100%; .button-see-more { margin: 32px 0; padding: 0; > * { display: inline-block; } } .close-button { position: absolute; z-index: 100; top: 10px; right: 10px; cursor: pointer; width: unset; height: unset; img { width: 100%; height: 100%; border-radius: 50%; } } } .main-info { padding-bottom: 32px; background-color: ${U.t.colors.primary50}; border-radius: ${U.t.borderRadius}; .btn-booking { display: flex; margin: 12px auto; } .avatar-title { position: relative; width: 100%; padding-top: 46px; text-align: center; } } `,eH=el.Z.div` position: fixed; z-index: 110; top: 0; left: 0; width: 100%; height: 100%; align-items: center; background: rgba(38, 38, 38, 0.3); &[data-open='false'] { display: none; } `,eG=el.Z.div` .image-container { .badge-avatar { position: absolute; right: 0; bottom: 0; top: 0; } } display: flex; justify-content: center; padding-bottom: 15px; text-align: center; .profile-image { width: 100px; min-width: 100px; height: 100px; min-height: 100px; border-radius: 50%; object-fit: cover; } .badge-avatar { width: 24px; height: 24px; } `,eQ=el.Z.div` position: relative; z-index: 9; .specialty { display: block; min-width: 240px; } padding: 0px 16px; text-align: center; .specialty { justify-content: center; } .experience { padding: 16px 0px 32px; text-align: left; .btn-wrapper { margin-top: 24px; } } p { max-width: 100%; } `,PopupHospital=({isOpen:e=!0,onClose:t,enableAnimation:a=!0,hospitalId:n,locale:l,isMobile:o,overwriteProfileProps:i,avatarFallback:r=W.C.getAssetPath("avatar.jpg"),trackingCategory:s="Together"})=>{let{t:d}=(0,F.u)(),[c,g]=(0,m.useState)(null),[v,h]=(0,m.useState)(!1);(0,m.useEffect)(()=>{if(e&&n&&String(null==c?void 0:c.id)!==String(n)){h(!0);try{g(null),(0,u.i)((0,u.j)(u.C.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:u.p[l]}),"get").then(e=>{g(Object.assign(Object.assign({},null==e?void 0:e._data.branch),i))})}catch(e){console.error(e)}h(!1)}},[e,n,null==c?void 0:c.id]);let f=(null==c?void 0:c.specialties)||[],b=(0,m.useMemo)(()=>f.map(e=>e.name),[f]);return m.createElement(m.Fragment,null,m.createElement(eZ,{"data-open":e,"data-animation":a,onClick:e=>e.stopPropagation()},v||!c?m.createElement(Loading$1,null):m.createElement("div",{className:"popup-content"},m.createElement("div",{className:"close-button",onClick:t},m.createElement("img",{src:eO,style:{width:20,height:20},alt:"close-icon",loading:"lazy"})),m.createElement("div",{className:"main-info"},m.createElement("div",{className:"border-banner"}),m.createElement("div",{className:"avatar-title"},m.createElement(eG,null,m.createElement("div",{className:"image-container"},m.createElement("div",{style:{position:"relative"}},m.createElement($.I,{src:null==c?void 0:c.logo,className:"profile-image",alt:"avatar",backupSrc:r}),m.createElement("img",{className:"badge-avatar",src:eD,alt:"badge",loading:"lazy"})))),m.createElement(eQ,null,m.createElement(p.T,{size:"s3",weight:"semiBold",className:"full-name"},null==c?void 0:c.name),m.createElement("div",{className:"specialty"},f&&m.createElement(p.T,{size:"p4",color:U.t.colors.gray800},b.join(" • "),"•"),m.createElement("a",{href:(0,u.q)({id:c.id,name:c.name,slug:c.slug,locale:l}),className:"organisation",target:"_blank",rel:"noreferrer"},m.createElement(p.T,{size:"p4",className:"organisation",color:U.t.colors.gray800,style:{textDecoration:"underline"}},null==c?void 0:c.name))))),!o&&m.createElement("a",{href:(0,u.q)({id:c.id,name:c.name,slug:c.slug,locale:l})},m.createElement("div",{className:"btn-wrapper"},m.createElement(ee.B,{color:"primary",size:"md",className:"btn-booking"},d("careBooking.bookAnAppointment"))))),m.createElement(eQ,null,m.createElement("div",{className:"experience"},m.createElement(p.T,{weight:"bold",size:"s3",color:U.t.colors.gray800,style:{paddingBottom:16}},d("hospital.content.description").toUpperCase()),m.createElement(p.T,{size:"p2",color:U.t.colors.gray500},c.about),o?m.createElement("a",{href:(0,u.q)({id:c.id,name:c.name,slug:c.slug,locale:l})},m.createElement("div",{className:"btn-wrapper"},m.createElement(ee.B,{color:"primary",size:"md",className:"btn-booking"},d("careBooking.bookAnAppointment")))):m.createElement("a",{href:(0,u.q)({id:c.id,name:c.name,slug:c.slug,locale:l})},m.createElement(p.T,{size:"s4",color:"#2D87F3",as:"span","data-event-category":s,"data-event-action":"See Full Hospital Profile","data-event-label":(0,u.o)(l)+(0,u.q)({id:c.id,name:c.name,slug:c.slug,locale:l})},d("home.seeHospital"))))))),m.createElement(eH,{"data-open":e,onClick:e=>{e.stopPropagation(),t()}}))},ProfileDetailModal=({open:e,onClose:t,children:a,profileModalProps:n})=>{let{t:l}=(0,F.u)();return m.createElement(eu.M,Object.assign({className:"_2UKyiK1",opened:e,onClose:t,overlayOpacity:.2,overflow:"inside",styles:{inner:{padding:0,justifyContent:"flex-end"},modal:{height:"100%",borderRadius:0},body:{padding:"24px",maxHeight:"100%"},content:{maxHeight:"100%",height:"100%",borderRadius:0}},title:"Profile"},n),m.createElement("div",{className:"E5ga-tI"},m.createElement("div",{className:"_8Y2nWXX"},l("profilePanel.modal.heading")),m.createElement("div",{className:"d0T7kSP",onClick:t},m.createElement(eg.C,null))),a)};ed().extend(em());let CardAuthor=e=>{let{className:t="",community:a,name:n,username:l,url:o,avatar:i,role:r,title:s,userType:d="user",expertId:c,specialty:p,organisation:g,isMarryBaby:v,doctorId:h,hospitalId:f,hasQuickBooking:y,handleMakeAppointment:w,communityTrackingAttr:E,isAnonymous:k,showDetailPopup:C,subLine:A,authActionWrapper:N,profileProps:P,profileModalProps:S,extendEle:j,avatarProps:I,hideInfo:R,timeText:O,onCloseFromPost:D,avatarIcon:B,badgeIconSize:_,hideBackground:V,children:H,styles:G,dataEventCategory:Q,dataEventAction:X,dataEventLabel:Y}=e,{data:{locale:K,router:J,env:{isMarryBaby:ee,togetherBasePath:et}}}=(0,m.useContext)(u.T),{isMobile:ea}=(0,$.u)(),{t:en}=(0,F.u)(),{classes:el}=eS(void 0,{name:"CardAuthor",styles:G}),eo="boolean"==typeof v?v:ee,ei=eo?"marryBaby":"helloSites",er=k?en("cardPost.anonymous"):n||l||"",es=k?W.C.getAssetPath("avatar.jpg"):i,ed=k?void 0:r,[ec,em]=(0,m.useState)(!1),{asPath:ep}=J||{},eu=`https://${L.d[K]}${ep}`,onAuthorClick=()=>{if(k||"chatbot"===d)return!1;C?ev(!0):o&&(window.location.href=o)};(0,m.useEffect)(()=>{(0,q.t)(ec)},[ec]);let[eg,ev]=(0,m.useState)(!1),eh=(null==e?void 0:e.role)==="expert",ef=!!(h||f),eb=["expert"===ed&&g&&m.createElement("span",null,g),"expert"===ed&&p&&m.createElement("span",null,p),!("expert"===ed&&p&&g)&&(null==a?void 0:a.name)&&m.createElement("a",Object.assign({href:(null==a?void 0:a.slug)&&a.isActive&&!a.isHidden?`${et}/${null==a?void 0:a.slug}/`:void 0,className:"author-community-name"},E),`${null==a?void 0:a.name}`),O&&m.createElement("span",null,O)].filter(Boolean),[ex,ey]=(0,m.useState)(null);return(0,m.useEffect)(()=>{eg&&!ex&&Promise.resolve().then(function(){return tD}).then(e=>{ey(()=>e.ProfileDetail)})},[eg]),m.createElement(eT.Provider,{value:{displayName:er,title:s,role:ed,siteType:ei,handleMakeAppointment:w,doctorId:h,hospitalId:f,currentUrl:eu}},m.createElement(ProfileDetailModal,{open:eg,onClose:()=>ev(!1),profileModalProps:S},ex&&m.createElement(ex,Object.assign({currentPageUrl:Y,authActionWrapper:N,onCloseFromPost:()=>{ev(!1),null==D||D()}},P,{authorProps:Object.assign({userId:null==e?void 0:e.userId,avatar:es,name:null==e?void 0:e.name,role:null==e?void 0:e.role,title:null==e?void 0:e.title,doctorId:h,hospitalId:f,hasQuickBooking:y},null==P?void 0:P.authorProps)}))),"expert"===ed&&c?m.createElement(PopupExpert,{isOpen:ec,onClose:()=>em(!1),expertId:c}):null,"expert"===ed&&h?m.createElement(PopupDoctor,{isOpen:ec,onClose:()=>em(!1),doctorId:h,locale:K}):null,"expert"===ed&&f?m.createElement(PopupHospital,{isOpen:ec,onClose:()=>em(!1),hospitalId:f,locale:K}):null,m.createElement("div",{className:`hhg-card-author ${el.root} ${t} ${eh?"expert-author":""}`,"data-background":!V&&eh,"data-is-marrybaby":eo},m.createElement(CardAuthor$1,{dataEventCategory:Q,dataEventAction:X,dataEventLabel:Y,onAvatarClick:onAuthorClick,avatarProps:Object.assign(Object.assign({avatar:k?W.C.getAssetPath(eo?"anomyous-avatar-1.svg":"anomyous-avatar.svg"):es,username:er},I),{style:{cursor:!k&&(o||C)?"pointer":"default"}}),avatarIcon:B||eh&&m.createElement(b.Z,{size:_||15})},H?m.createElement("div",{onClick:onAuthorClick},H):!R&&m.createElement(CardAuthor$1.Row,null,m.createElement(CardAuthor$1.ColLeft,null,m.createElement(z.k,{align:"center",onClick:onAuthorClick},m.createElement(CardAuthor$1.MainText,{onClick:onAuthorClick},er,"chatbot"===d?m.createElement(m.Fragment,null," ",m.createElement(x.Z,{color:U.t.colors.primaryBase,size:16,style:{display:"inline-block",transform:"translate(0, 2px)"}})):m.createElement(AuthorBadgeItem,null))),A||m.createElement(CardAuthor$1.SubTextRow,{style:y?{position:"relative"}:{}},eb.map((e,t)=>m.createElement(m.Fragment,null,0!==t&&m.createElement(CardAuthor$1.SubDivider,null),m.createElement(CardAuthor$1.SubText,null,e))),y&&ef&&m.createElement(T.x,{sx:{marginTop:(0,M.h)(5)}},m.createElement(Z.a,{bookingId:h||f,bookingType:h?"doctor":f?"hospital":void 0,size:ea?"xs":"sm"})))))),j&&j))};CardAuthor.MainText=CardAuthor$1.MainText,CardAuthor.SubText=CardAuthor$1.SubText,CardAuthor.SubTextRow=CardAuthor$1.SubTextRow,CardAuthor.SubDivider=CardAuthor$1.SubDivider,CardAuthor.AuthorBadge=AuthorBadgeItem,CardAuthor.DisplayName=()=>{let{displayName:e}=(0,m.useContext)(eT);return m.createElement(T.x,null,e)};let getDefaultFailNoti=e=>({message:e("notification.failure"),type:"danger"}),eX=el.Z.div` position: relative; display: flex; height: 100%; flex-direction: column; padding: 16px 24px; .input-group-container { flex: 1; padding-right: 2px; padding-left: 2px; margin-bottom: 0.5rem; -ms-overflow-style: none; /* IE and Edge */ overflow-y: auto; scrollbar-width: none; /* Firefox */ &::-webkit-scrollbar { display: none; } } .input-group { :not(:last-child) { margin-bottom: 0.6rem; } input:focus, textarea:focus, [contenteditable='true'] { outline: none; } label { margin-bottom: 5px; color: ${U.t.colors.gray600}; /* font-family: 'Open Sans', sans-serif; */ font-size: 13px; font-weight: bold; } .input-group-label { margin-bottom: 5px; color: ${U.t.colors.gray600}; /* font-family: 'Open Sans', sans-serif; */ font-size: 13px; font-weight: bold; } .input-notification { display: flex; & > img { width: 16px; height: 16px; margin-top: 1.5px; margin-right: 8px; } } .tag-list { } } .warning { margin-top: 16px; } .submit-btn { width: 100%; } .switch-label { display: flex; align-items: center; } .swich-input-group { padding: 12px 16px; border-radius: 8px; background: ${U.t.colors.neutral50}; &.askdoctor-switch { background: ${U.t.colors.primary50}; &.mb-color { background: ${U.t.mbColors.tonePink}; } } .mantine-Switch-labelWrapper { flex-grow: 1; } .mantine-Checkbox-body { display: flex; width: 100%; align-items: center; justify-content: space-between; } .mantine-Switch-track { margin-bottom: 0; } .label-txt { font-weight: normal; font-size: 14px; color: ${U.t.colors.gray800}; margin-left: 10px; } } `,eY=el.Z.div` display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 8px; background: ${U.t.colors.primary50}; &[data-is-marry-baby='true'] { background: ${U.t.mbColors.tonePink}; } .switch-label { display: flex; align-items: center; gap: 12px; } margin-bottom: 12px; `,eK=el.Z.div` margin-bottom: 12px; color: ${U.t.colors.red700}; svg { margin-right: 5px; } svg, span { vertical-align: middle; } `;var eJ="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cpath fill='%23FE921D' d='M8 14.5a6 6 0 1 0 0-12 6 6 0 0 0 0 12'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 5.5v3M8 11.5h.007'/%3e%3c/svg%3e";let e0={edit:/]*)data-url="true"[^<>]*>(.*?)<\/mocka>/gim,url:/((?:=")|(?:data-url="true">)|)(https?:\/\/(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))/gim,encodedUrl:/\[a\+href="([^<"]+)"(?:\+text=\"([^<"]+)")?\]/gim,editorMention:/]*data-id="([^<"]+)"[^>]*>([^<]+)<\/mention>/gim,editorFullMention:/]*data-id="([^<"]+)" [^\>]*data-name="([^<"]+)"[^>]*>([^<]+)<\/mention>/gim,savedMention:/\[mention\+id="([^<"]+)"([^\]]*)\]/gim,rawUrl:/^(https?:\/\/(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))$/gim,optionalProtocol:/^((https?:\/\/)?(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))$/gim,encodedUrl2:/]*href="([^>"]+)"[^>]*>([^<]+)<\/a>/gim},e1=/]*data-bad-word="[^\"]*" [^\>]*data-error="true"[^\>]*>(.*?)<\/mocka>/gim,encodePostUrl=(e,t=e=>e)=>{var a;return t(null===(a=e.replace(/(\ )+/g," ").replace(/(\&)+/g,"&"))||void 0===a?void 0:a.replace(/(\u200c|‌)+/g,"").replace(e0.url,(e,t,a)=>'="'!==t&&'data-url="true">'!==t?`${a}`:e).replace(e0.edit,(e,t,a)=>{var n;let l=null===(n=t.match(/data-href="([^"]*)"/im))||void 0===n?void 0:n[1];return l?`${a}`:`${a}`}))},encodeMention=e=>e.replace(e0.editorMention,(e,t,a)=>`[mention+id="${t}"+name="${a}"]`),getAnchorHtml=({url:e,text:t,method:a})=>{let n=t.indexOf(t.trimStart()),l=t.trimEnd().length,o=t.substring(0,n),i=t.substring(n,l),r=t.substring(l);return"edit"===a?`${o}${i}${r}`:"display"===a&&(e.startsWith("http://")||e.startsWith("https://"))?`${o}${i}${r}`:t},decodePostUrl=(e,t)=>e.replace(e0.encodedUrl,(e,a,n)=>{let l=n||a;return getAnchorHtml({text:l,url:a,method:t})}).replace(e0.encodedUrl2,(e,a,n)=>{let l=n||a;return getAnchorHtml({text:l,url:a,method:t})}),decodeMention=(e,t=[])=>e.replace(e0.savedMention,(e,a,n)=>{let l=t.find(e=>String(e.id)===a);if(!l){if(!n)return"";let e="";return n.replace(/\+name="([^<"]+)"/i,(t,a)=>(e=a,t)),`${e}`}return`${l.name}`}),getUrlsFromString=e=>{let t=[];return e.replace(/(\&)+/g,"&").replace(e0.url,(e,a,n)=>('="'!==a&&'data-url="true">'!==a&&t.push(n),e)),t},getMentionIdsFromString=(e,t)=>{let a=[];return(e.replace(e0.editorMention,(e,t)=>(a.push(t),e)).replace(e0.savedMention,(e,t)=>(a.push(t),e)),t)?a:Array.from(new Set(a)).slice(0,30)},getUrlsFromEditorString=e=>{var t;return[...getUrlsFromString(e),...(null===(t=e.match(e0.edit))||void 0===t?void 0:t.map(e=>{var t,a;let n=null===(t=e.match(/data-href="([^"]*)"/im))||void 0===t?void 0:t[1],l=null===(a=e.match(/>(.*?)<\/mocka>/im))||void 0===a?void 0:a[1];return n||l}))||[]].filter(e=>!!e)},escapeRegExp=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),wrapAnchorAroundUrls=e=>{var t,a;return null===(a=null===(t=e.replace(/(\ )+/g," "))||void 0===t?void 0:t.replace(/(\u200c|‌)+/g,""))||void 0===a?void 0:a.replace(e0.edit,(e,t,a)=>{var n;let l=null===(n=t.match(/data-href="([^"]*)"/im))||void 0===n?void 0:n[1];return!l||l===a||a.match(e0.rawUrl)?a:l?`${a}`:`${a}`}).replace(e0.url,(e,t,a)=>{if('="'!==t&&'data-url="true">'!==t){let e=a.toLowerCase(),t=e.startsWith("http")?"":" https://",n=`${t}${e}`;return getAnchorHtml({text:n,url:n,method:"edit"})}return e}).replace(e0.encodedUrl2,(e,t,a)=>getAnchorHtml({text:a||t,url:t,method:"edit"}))},removeEdittedBannedWord=e=>e.replace(e1,(e,t)=>{let a=document.createElement("div");a.innerHTML=e;let n=a.firstChild;return(null==n?void 0:n.innerText)!==(null==n?void 0:n.getAttribute("data-bad-word"))?t:e}),removeBannedWordWrapper=e=>e.replace(e1,"$1"),removeFontFormat=e=>e.replace(/]*>(.+)<\/font>/gim,(e,t)=>t.replace(/]*>(.+)<\/u>/gim,"$1")),encodePostContent=(e,t=e=>e)=>encodePostUrl(encodeMention(removeBannedWordWrapper(e)),t),e3=["hellobacsi.blog","hellosehat.com","hellodoktor.com","hellokrupet.com","hellodoctor.com.ph","hellokhunmor.com","hellosayarwon.com","helloyishi.com.tw","helloswasthya.com","marrybaby.vn"],reformatUrl=e=>e.match(e0.optionalProtocol)?e.startsWith("https://")||e.startsWith("http://")?e:`https://${e}`:"",highlightBadWords=(e,t)=>{let a=t.filter(Boolean);if(e&&a.length>0){let t=removeBannedWordWrapper(e);return t.replace(RegExp(`\\b(${a.map(e=>escapeRegExp(e)).join("|")})\\b`,"gi"),(e,t)=>{let a=document.createElement("mocka");return a.setAttribute("data-bad-word",t),a.setAttribute("data-error","true"),a.innerText=t,`${a.outerHTML}`})}return e},fixMalformedMention=e=>e.replace(e0.editorFullMention,(e,t,a,n)=>{if(n!==a){let e=a.split(" "),l=e.findIndex((t,a)=>{let l=e.slice(0,a+1).join(" ");return!n.startsWith(l)});if(0===l)return`@${n}`;{let a=(l<0?e:e.slice(0,l)).join(" "),o=n.slice(a.length).trim();return console.log(l,a,o),`${a} ${o} `}}return e}),youtubeVidIdGetter=e=>{var t;return e.includes("youtu")&&(null===(t=/(.*?)(^|\/|v=)([a-z0-9_-]{11})(.*)?/gim.exec(e))||void 0===t?void 0:t[3])||""},uploadAndGetSrc=(e,t,n)=>"string"==typeof e?Promise.resolve(e):(0,g.a)(void 0,void 0,void 0,function*(){var l;let o=new FormData;if(e.type.startsWith("image/gif"))o.append("image",e);else{let t=yield a.e(221).then(a.bind(a,40221)),n=yield t.default(e,{maxSizeMB:.4,maxWidthOrHeight:1536,useWebWorker:!0});o.append("image",n)}let i=n?u.v:u.d,r=yield i((0,u.g)(n?u.A.COMMENT.IMAGE_UPLOAD:u.P.COMMENT.IMAGE_UPLOAD,{_locale:t}),"POST",{data:o});return(null===(l=null==r?void 0:r.data)||void 0===l?void 0:l.image)||""}),likeUnlikePost=({id:e,locale:t})=>(0,g.a)(void 0,void 0,void 0,function*(){if(!e)return;let a=yield(0,u.d)((0,u.g)(u.P.POST.LIKE,{id:e,_locale:t}),"GET");return a}),deletePost=({id:e,locale:t})=>(0,g.a)(void 0,void 0,void 0,function*(){if(!e)return;let a=yield(0,u.d)((0,u.g)(u.P.POST.DELETE,{id:e,_locale:t}),"DELETE");return a}),getPostFormData=({title:e,description:t,communityId:a,imageFiles:n,previewUrl:l,topicIds:o,locale:i,sanitizeFunction:r,categoryCommunityId:s,categoryTopicIds:d,introUrl:c,bannerUrl:m,scheduleTime:p,isAnonymous:v,isAskDoctor:h})=>(0,g.a)(void 0,void 0,void 0,function*(){let g=new FormData,f=removeBannedWordWrapper(t),b=removeBannedWordWrapper(e),x=getMentionIdsFromString(f);if(g.append("title",b),g.append("description",encodePostContent(f,r)),s?g.append("category_community",String(s)):a&&g.append("community_id",String(a)),g.append("is_anonymous",v?"1":"0"),g.append("is_question",h?"1":"0"),(null==l?void 0:l.title)&&g.append("preview_title",l.title),(null==l?void 0:l.description)&&g.append("preview_description",l.description),(null==l?void 0:l.url)&&g.append("preview_link",(0,q.c)(l.url)),(null==l?void 0:l.image)&&g.append("preview_image",(0,q.c)(l.image)),null==o||o.forEach(e=>{g.append("topics[]",String(e||""))}),null==d||d.forEach(e=>{g.append("category_topics[]",String(e||""))}),null==n?void 0:n.length){let e=yield Promise.all(n.map((e,t)=>new Promise(a=>{setTimeout(()=>{a(uploadAndGetSrc(e,i))},2e3*t)})));null==e||e.filter(Boolean).slice(0,u.M).forEach((e,t)=>{g.append(`images[${t}]`,e)})}else g.append("images","");return null==x||x.forEach(e=>{g.append("mention_ids[]",e)}),g.append("intro_url",c||""),g.append("banner",m||""),p&&(g.append("post_type","scheduled"),g.append("schedule_datetime",p)),g}),createPost=({locale:e,formData:t,isArticleComment:a})=>(0,g.a)(void 0,void 0,void 0,function*(){let n=yield(0,u.d)((0,u.g)(a?u.P.POST.CREATE_ARTICLE_COMMENT:u.P.POST.CREATE,{_locale:e}),"POST",{data:t});return n}),editPost=({id:e,locale:t,formData:a})=>(0,g.a)(void 0,void 0,void 0,function*(){let n=yield(0,u.d)((0,u.g)(u.P.POST.UPDATE,{id:e,_locale:t}),"POST",{data:a});return n}),reportPost=({id:e,reason:t,locale:a})=>{let n=new FormData;return n.append("reason",t),(0,u.d)((0,u.g)(u.P.POST.REPORT,{_locale:a,id:e}),"POST",{data:n})},useImagePicker=(e,t)=>{let[a,n]=(0,m.useState)(e||[]),l=(0,m.useMemo)(()=>(e||a).map(e=>"string"==typeof e?e:URL.createObjectURL(e)),[e,a]);return{onSelectImages:l=>{let o=l.target.files;if(o){if(t&&e){let n=e||a;t(n.concat(Array.from(o)))}else n(a=>{let n=e||a;return t&&t(n.concat(Array.from(o))),n.concat(Array.from(o))})}},onRemoveImage:a=>{t&&e?(e.splice(a,1),t(e.slice())):n(n=>{let l=e||n;return l.splice(a,1),t&&t(l.slice()),l.slice()})},onRemoveAllImages:()=>{t?t([]):n([])},imageSrcs:l,imageFiles:e||a}},e2=el.Z.div` input:focus, textarea:focus, [contenteditable='true'] { outline: none; } .textarea-control { position: relative; border: 1px solid ${U.t.colors.gray200}; border-radius: ${U.t.borderRadius}; &.--focus { border-color: ${U.t.colors.primaryBase}; box-shadow: 0px 0px 2px 2px ${U.t.colors.primary200}; } .textarea-wrapper { width: 100%; height: 200px; } .control-tool { position: absolute; bottom: 0; left: 0; display: flex; width: calc(100% - 2rem); height: 40px; align-items: center; justify-content: flex-end; border-top: 1px solid ${U.t.colors.gray200}; margin: 0 1rem; .tool-button { display: flex; width: 2rem; height: 2rem; align-items: center; justify-content: center; background: transparent; cursor: pointer; } .image-icon { vertical-align: middle; } } } .link-preview-wrapper { position: relative; .icon-close { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; cursor: pointer; } } .image-gallery { margin-bottom: 1rem; .image-item { position: relative; overflow: hidden; width: 100%; height: 0; padding-top: 67%; margin-top: 1rem; border-radius: ${U.t.borderRadius}; & > img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; } .close-btn { position: absolute; top: 8px; right: 8px; left: unset; width: 24px; height: 24px; cursor: pointer; } } } .description-label { margin-bottom: 5px; color: ${U.t.colors.gray600}; /* font-family: 'Open Sans', sans-serif; */ font-size: 13px; font-weight: bold; } .count-string { margin-top: 5px; color: ${U.t.colors.gray500}; font-size: 11px; text-align: right; } .input-notification { display: flex; & > img { width: 16px; height: 16px; margin-top: 1.5px; margin-right: 8px; } } `,e6=el.Z.div` height: 100%; position: relative; width: 100%; display: flex; flex-direction: column; .ql-toolbar.ql-snow { top: 0; width: 100%; position: sticky; z-index: 3; border: none; border-bottom: 1px solid #ccc; background: white; .ql-formats { display: inline-flex; align-items: center; margin-right: 0.5rem; .link-tool-wrapper { .popover-menu__content { padding: 0.5rem; transform: translateX(calc(-50% - 1rem)); max-width: calc(100vw - 4rem); ::before { right: calc(50% - 8px); } .link-tool-popover { input { padding-left: 1rem; } .link-input-url { margin-bottom: 0.5rem; } .link-input-text { margin-bottom: 0.5rem; } label { display: inline-block; margin-bottom: 0.2rem; } .link-input-button-wrapper { &[data-is-marrybaby='true'] { .link-input-button { border: solid 2px ${U.t.mbColors.pink}; background-color: ${U.t.mbColors.pink}; &:hover:not(:disabled) { border: solid 2px ${U.t.mbColors.pink}; background-color: ${U.t.colors.white}; color: ${U.t.mbColors.pink}; } } } } .link-input-button { width: auto; height: auto; padding: 0.4rem 1rem; background-color: ${U.t.colors.primaryBase}; &:disabled { border-color: #bfbfbf; background-color: #bfbfbf; color: #fff; cursor: not-allowed; } &:hover:not(:disabled) { background-color: ${U.t.colors.primaryHover}; } } .error-text { padding: 0; margin-bottom: 0.5rem; font-weight: 600; color: ${U.t.colors.red700}; } } } } } @media (max-width: 450px) { position: relative; .ql-formats { .link-tool-wrapper { position: unset; .popover-menu__content { left: 0; transform: unset; max-width: 100%; } } } } } .quill { flex: 1; overflow-y: hidden; .ql-container { display: inline-block; width: 100%; min-height: 100%; /* padding: 14px 16px; */ border: none; border-radius: ${U.t.borderRadius}; color: ${U.t.colors.gray800}; font-size: 1rem; line-height: 1.5; resize: none; white-space: break-spaces; .ql-editor { word-break: break-word; overflow-wrap: break-word; /* -ms-overflow-style: none; scrollbar-width: none; &::-webkit-scrollbar { display: none; } */ } mocka { padding: 2px 6px; border-radius: 1rem; &[data-url='true'] { /* background-color: #eeeeff; */ font-style: italic; color: #1890ff; cursor: pointer; outline: none; text-decoration: underline; } &[data-error='true'] { background-color: #ffeeee; color: red; text-decoration: underline; font-style: bold; } } mention { padding: 2px 6px; border-radius: 1rem; background-color: #eeeeff; color: #1890ff; cursor: pointer; outline: none; text-decoration: none; } ol, ul { padding-left: 1rem; } } } .mention-search-container { position: absolute; background: white; border-radius: ${U.t.borderRadius}; filter: drop-shadow(0px 10px 16px rgba(0, 0, 0, 0.04)) drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.04)) drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.04)); overflow-y: scroll; z-index: 99; ::-webkit-scrollbar { -webkit-appearance: none; } ::-webkit-scrollbar:vertical { width: 14px; } ::-webkit-scrollbar-thumb { border-radius: ${U.t.borderRadius}; background-color: #d9d9d9; @supports (background-clip: padding-box) { border: 3px solid rgba(0, 0, 0, 0); background-clip: padding-box; } @supports not (background-clip: padding-box) { border: 3px solid white; } } ::-webkit-scrollbar-track { background-color: #fff; border-radius: 0 6px 6px 0; border-left: 1px solid #f2f2f2; } .mention-search-item { cursor: pointer; padding: 12px 1rem; display: flex; align-items: center; &.item-selected { background-color: ${U.t.colors.gray100}; } .search-avatar { width: 40px; height: 40px; font-size: 20px; margin-right: 20px; } } } `,e4=null;(0,g.a)(void 0,void 0,void 0,function*(){if("undefined"==typeof window)return;let e=yield Promise.all([a.e(9774),a.e(2937),a.e(1167)]).then(a.t.bind(a,71167,23));e4=e.default;let t=e.Quill||e4.Quill;t.register("modules/preserveWhiteSpace",class{constructor(e,t){this.quill=e,this.options=t,e.container.style.whiteSpace="pre-line"}});let n=t.import("blots/inline");let MockABlot=class MockABlot extends n{static create(e){if(!e)return super.create(!1);let t=super.create(e);return MockABlot.setNodeConfigurations(t,e),t}static formats(e){return!!(e.innerText&&(e.getAttribute("data-href")||e.getAttribute("data-url")||e.getAttribute("data-error")||e.getAttribute("data-bad-word")))&&{"data-bad-word":e.getAttribute("data-bad-word"),"data-error":e.getAttribute("data-error"),"data-href":e.getAttribute("data-href"),"data-url":e.getAttribute("data-url"),"data-text":e.innerText||e.getAttribute("data-href")}}static setNodeConfigurations(e,t){var a,n;t&&(null===(n=null===(a=null==t?void 0:t["data-text"])||void 0===a?void 0:a.replace(/(\ )+/g," "))||void 0===n?void 0:n.replace(/(\u200c|‌)+/g,""))&&(t["data-bad-word"]&&e.setAttribute("data-bad-word",t["data-bad-word"]),t["data-href"]&&e.setAttribute("data-href",t["data-href"]),t["data-error"]&&e.setAttribute("data-error",t["data-error"]),t["data-url"]&&e.setAttribute("data-url",t["data-url"]))}};MockABlot.blotName="mocka1",MockABlot.tagName="mocka",t.register(MockABlot);let MentionBlot=class MentionBlot extends n{static create(e){if(!e)return super.create(!1);let t=super.create(e);return MentionBlot.setNodeConfigurations(t,e),t}static formats(e){return!!(e.getAttribute("data-name")&&e.getAttribute("data-id"))&&{"data-name":e.getAttribute("data-name"),"data-id":e.getAttribute("data-id")}}static setNodeConfigurations(e,t){var a,n;t&&t["data-id"]&&(null===(n=null===(a=null==t?void 0:t["data-name"])||void 0===a?void 0:a.replace(/(\ )+/g," "))||void 0===n?void 0:n.replace(/(\u200c|‌)+/g,""))&&(t["data-id"]&&e.setAttribute("data-id",t["data-id"]),t["data-name"]&&e.setAttribute("data-name",t["data-name"]))}};MentionBlot.blotName="mention",MentionBlot.tagName="mention",t.register(MentionBlot)});let inputModify$1=(e,t)=>{var a;let{formatUrl:n,bannedWords:l=[]}=t||{},o=fixMalformedMention(removeFontFormat(e));if(!n)return{value:highlightBadWords(o,l)};let i=removeEdittedBannedWord(wrapAnchorAroundUrls(o)),r=getUrlsFromEditorString(o);if(r){let e=[];return r.forEach(t=>{if(t)try{let a=new URL(t);e3.some(e=>a.origin.endsWith(e))||e.push(t)}catch(a){e.push(t)}}),e.length>0&&(i=i.replace(RegExp(`data-url="true">(${e.map(escapeRegExp).join("|")})<`,"gi"),'data-error="true" data-url="true">$1<').replace(RegExp(`data-href="(${e.map(escapeRegExp).join("|")})" data-url="true">`,"gi"),'data-href="$1" data-error="true" data-url="true">')),{invalidUrls:e,previewUrl:null===(a=r.filter(t=>-1===e.indexOf(t)))||void 0===a?void 0:a[0],value:highlightBadWords(i,l)}}return{value:highlightBadWords(i,l)}},RichTextEditor=({html:e,onChange:t,className:a,style:n,onImagePickerClick:l,bannedWords:o=[],onInvalidUrlsChange:i,onPreviewUrlChange:r,setEditorRef:s,isReplying:d})=>{var c,v,h,f;let b=(0,m.useRef)([]);b.current=o;let[x,y]=(0,m.useState)([]),[w,E]=(0,m.useState)(null),{data:{locale:k}}=(0,m.useContext)(u.T),C=(null==o?void 0:o.join(","))||"";(0,m.useEffect)(()=>{var e,t;let a=null===(t=null===(e=M.current)||void 0===e?void 0:e.getEditor())||void 0===t?void 0:t.root.innerHTML;N(a)},[C]);let fetchPreviewData=e=>{w&&w.url===e||(E({url:e,isFetching:!0}),(0,u.i)((0,u.g)(u.P.FETCH_PREVIEW,{_locale:k}),"POST",{data:{link:e}}).then(t=>{var a,n,l,o;E({title:null===(a=null==t?void 0:t.data)||void 0===a?void 0:a.title,description:null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.description,image:(null===(l=null==t?void 0:t.data)||void 0===l?void 0:l.image)||(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.logo),url:e})}).catch(()=>{E(null)}))},A=(0,m.useRef)(fetchPreviewData);A.current=fetchPreviewData;let N=(0,m.useCallback)(X()(e=>{if(e){let a=inputModify$1(e,{bannedWords:b.current,formatUrl:!0}),{invalidUrls:n,previewUrl:l,value:o}=a;n&&y(n),l?A.current(l):E(null),o!==e&&(null==t||t(o))}},500),[]);(0,m.useEffect)(()=>{i&&i(x)},[x]),(0,m.useEffect)(()=>{r&&((null==w?void 0:w.url)?r({title:w.title||"",url:w.url||"",image:w.image||"",description:w.description||""}):r(null))},[w]);let P=(0,m.useRef)(l);P.current=l;let T=(0,ev.a)(),S=(0,m.useRef)({toolbar:{handlers:{image:()=>{var e;return null===(e=P.current)||void 0===e?void 0:e.call(P)},link:()=>!1},container:"#toolbar-"+T},preserveWhiteSpace:!0}),z=(0,m.useRef)(-1),M=(0,m.useRef)(null);s&&(null===(v=null===(c=M.current)||void 0===c?void 0:c.getEditor())||void 0===v?void 0:v.root)&&s(null===(f=null===(h=M.current)||void 0===h?void 0:h.getEditor())||void 0===f?void 0:f.root);let handleSelectionChange=()=>{var e,t,a,n,l,o,i,r;if(null===(t=null===(e=M.current)||void 0===e?void 0:e.getEditor())||void 0===t?void 0:t.root){let e=function(e){var t,a;let n=-1;if(void 0!==window.getSelection){let l=window.getSelection();if((null==l?void 0:l.rangeCount)&&(null==l?void 0:l.rangeCount)>0){let l=null===(t=window.getSelection())||void 0===t?void 0:t.getRangeAt(0);if(l){let t=l.cloneRange();t.selectNodeContents(e),t.setEnd(l.endContainer,l.endOffset),n=function calculateChildNodeOffset(e,t){return e.forEach((a,n)=>{let l=n+1===e.length;if(a.nodeType===Node.ELEMENT_NODE){let e=a.outerHTML;if(l)t+=e.indexOf(">")+1,t=calculateChildNodeOffset(a.childNodes,t);else{t+=e.length;return}}else a.nodeType===Node.TEXT_NODE&&(t+=(a.nodeValue||"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").length)}),t}(t.cloneContents().childNodes,n);let o=null===(a=l.endContainer.parentElement)||void 0===a?void 0:a.closest("mocka"),i=l.endContainer.nodeValue||l.endContainer.outerHTML;o&&(null==i?void 0:i.length)&&(n=n-l.endOffset+(o.outerHTML.length-(null==o?void 0:o.outerHTML.lastIndexOf(i))))}}}return n}(null===(n=null===(a=M.current)||void 0===a?void 0:a.getEditor())||void 0===n?void 0:n.root),t=null===(o=null===(l=M.current)||void 0===l?void 0:l.getEditor())||void 0===o?void 0:o.root.innerHTML;if(e>=0&&e0){let l=null===(t=window.getSelection())||void 0===t?void 0:t.getRangeAt(0);if(l){let t=l.cloneRange();t.selectNodeContents(e),t.setEnd(l.endContainer,l.endOffset);let o=(t.endContainer.nodeValue||"").substring(0,l.endOffset),i=o.lastIndexOf("@");if(i+1(0,g.a)(void 0,void 0,void 0,function*(){var n,l,o,i;if(!e||!DOMRect)return I([]);let r=yield((null===(n=(0,ea.g)(u.B))||void 0===n?void 0:n.length)||0)>0?(0,u.d)((0,u.g)(u.P.SEARCH_USER,{_locale:k,name:e}),"get"):(0,u.v)((0,u.g)(u.A.SEARCH_USER,{_locale:k,name:e}),"get");$(0),I(null===(o=null===(l=null==r?void 0:r.data)||void 0===l?void 0:l.users)||void 0===o?void 0:o.filter(e=>!(null==a?void 0:a.includes(String(e.id)))));let s=null===(i=F.current)||void 0===i?void 0:i.getBoundingClientRect();if(t&&s){let e={top:t.bottom-s.top,width:"min(343px, 100%)",maxHeight:256},a=s.width-(t.left-s.left);a<343?e.right=0:e.left=t.left-s.left,O(e)}}),500),[]),setSelectUser=(e,t)=>{var a,n,l;if(B.current){B.current.deleteContents();let o=document.createElement("mention");o.setAttribute("data-id",e),o.setAttribute("data-name",t),o.innerText=t;let i=document.createTextNode(" ");B.current.insertNode(i),B.current.insertNode(o);let r=null===(n=null===(a=M.current)||void 0===a?void 0:a.getEditor())||void 0===n?void 0:n.root;r.focus();let s=null===(l=window.getSelection())||void 0===l?void 0:l.getRangeAt(0);null==s||s.setStart(B.current.endContainer,B.current.endOffset),null==s||s.setEnd(B.current.endContainer,B.current.endOffset)}I([])},F=(0,m.useRef)(null),B=(0,m.useRef)(null),_=(0,m.useRef)(null),[U,$]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(_.current){let e=_.current,t=e.children.item(U);if(t){let a=e.getBoundingClientRect(),n=t.getBoundingClientRect();t.offsetTope.scrollTop+a.height&&(e.scrollTop=t.offsetTop-a.height+n.height)}}},[U]),(0,m.useEffect)(()=>{let clickHandler=function(e){var t;(null===(t=F.current)||void 0===t?void 0:t.contains(e.target))||I([])};return window.addEventListener("click",clickHandler,{passive:!0}),()=>{window.removeEventListener("click",clickHandler)}},[]),m.createElement(e6,{ref:F,className:a,style:n,onKeyDownCapture:e=>{if(null==j?void 0:j.length){let t=!1;if("ArrowDown"===e.key)t=!0,$(e=>e+1>=j.length?0:e+1);else if("Escape"===e.key)t=!0,$(0),I([]);else if("ArrowUp"===e.key)t=!0,$(e=>e-1<0?j.length-1:e-1);else if("Enter"===e.key||"Tab"===e.key){let e=j[U];e&&(t=!0,setSelectUser(e.id,e.name))}if(t)return e.preventDefault(),!1}}},m.createElement(CustomToolbar,{id:T,onAddLink:(e,a)=>{var n,l;let o=z.current+1,i=null===(l=null===(n=M.current)||void 0===n?void 0:n.getEditor())||void 0===l?void 0:l.root.innerHTML,r=((null==i?void 0:i.substring(0,o))||"")+`${e} `+((null==i?void 0:i.substring(o))||"");null==t||t(r),N(r)}}),e4&&m.createElement(e4,{ref:M,theme:"snow",value:e,onChange:e=>{null==t||t(e),N(e),handleSelectionChange()},onChangeSelection:()=>{handleSelectionChange()},modules:S.current,formats:["mocka1","mention","id","key","bold","italic","underline","list","bullet"]}),!!(null==j?void 0:j.length)&&m.createElement("div",{ref:_,className:"mention-search-container",style:R},j.map((e,t)=>m.createElement("div",{className:`mention-search-item ${U===t?"item-selected":""}`,key:e.id,onClick:t=>{t.preventDefault(),t.stopPropagation(),setSelectUser(e.id,e.name)},onMouseEnter:()=>{$(t)}},m.createElement(H.U,{className:"search-avatar",username:e.name,avatar:e.avatar}),m.createElement("div",null,m.createElement(p.T,{size:"p2"},e.name),m.createElement(p.T,{size:"p4",color:"#595959"},"@",e.username))))))},CustomToolbar=({onAddLink:e,id:t})=>m.createElement("div",{id:"toolbar-"+t,onClick:e=>{e.preventDefault(),e.stopPropagation()}},m.createElement("span",{className:"ql-formats"},m.createElement("button",{className:"ql-bold",type:"button"}),m.createElement("button",{className:"ql-italic",type:"button"}),m.createElement("button",{className:"ql-underline",type:"button"})),m.createElement("span",{className:"ql-formats"},m.createElement("button",{className:"ql-list",value:"ordered",type:"button"}),m.createElement("button",{className:"ql-list",value:"bullet",type:"button"})),m.createElement("span",{className:"ql-formats"},m.createElement("button",{className:"ql-image",type:"button"}),e&&m.createElement(PopoverMenu,{className:"link-tool-wrapper",toggleButtonContent:m.createElement("img",{className:"link-icon",src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M9.545 16H7.091c-.537 0-1.07-.104-1.566-.305a4.1 4.1 0 0 1-1.327-.867A3.96 3.96 0 0 1 3 12c0-1.06.431-2.078 1.198-2.828A4.14 4.14 0 0 1 7.091 8h2.454m4.38 0h2.984c.537 0 1.07.103 1.566.304a4.1 4.1 0 0 1 1.327.868c.38.371.681.812.887 1.297a3.92 3.92 0 0 1 0 3.062 4 4 0 0 1-.887 1.297c-.38.372-.831.667-1.327.867a4.2 4.2 0 0 1-1.566.305h-2.983M9 12h6'/%3e%3c/svg%3e",loading:"lazy"}),buttonProps:{size:"md",color:"transparent"},align:"end"},({setShow:t})=>m.createElement(LinkToolInputPopover,{onAddUrl:e,setShow:t})))),e5=["notification.limitUrlDomain","notification.urlWrongFormat"],LinkToolInputPopover=({onAddUrl:e,setShow:t})=>{let{data:{env:{isMarryBaby:a}}}=(0,m.useContext)(u.T),{t:n}=(0,F.u)(),[l,o]=(0,m.useState)(""),[i,r]=(0,m.useState)(""),[s,d]=(0,m.useState)(-1),checkUrlValid=e=>{let t=reformatUrl(e.trim());try{let e=new URL(t);if(!e.protocol.startsWith("http"))return d(1),!1;if(!e3.some(t=>e.origin.endsWith("/"+t)||e.origin.endsWith("."+t)))return d(0),!1;return d(-1),!0}catch(e){return d(1),!1}},c=l.trim()&&i.trim()&&s<0;return m.createElement("div",{className:"link-tool-popover"},m.createElement(G.I,{name:"url",value:l,size:"md",label:"URL",placeholder:n("placeholder.enterUrlHere"),type:"text",className:"link-input-url",onChange:e=>{o(e),checkUrlValid(e)}}),s>=0&&m.createElement(p.T,{size:"c2",className:"error-text"},n(e5[s])),m.createElement(G.I,{name:"text",value:i,size:"md",label:n("createPost.urlText"),placeholder:n("placeholder.enterUrlTextHere"),type:"text",className:"link-input-text",onChange:e=>r(e)}),m.createElement("div",{"data-is-marrybaby":a,className:"link-input-button-wrapper"},m.createElement(ee.B,{theme:a?"marryBaby":"helloSites",size:"sm",color:"primary",className:"link-input-button",onClick:()=>{c&&(e(i.trim(),reformatUrl(l.trim())),t&&t(!1))},isDisabled:!c},n("insert"))))};var e8="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 CreatePostDescription=({className:e,style:t,bannedWords:a=[],value:n,onChange:l,onPreviewUrlChange:o,onInvalidUrlsChange:i,onImageFilesChange:r,imageFiles:s,isReplying:d})=>{let{t:c}=(0,F.u)(),[g,v]=(0,m.useState)(null),h=(0,m.useRef)(null),{onSelectImages:f,onRemoveImage:b,imageSrcs:x}=useImagePicker(s,r);return(0,m.useEffect)(()=>{o&&((null==g?void 0:g.url)?o({title:g.title||"",url:g.url||"",image:g.image||"",description:g.description||""}):o(null))},[g]),m.createElement(e2,{className:e,style:t},m.createElement(p.T,{size:"p4",className:"description-label"},c("createPost.popup.description")),m.createElement("div",{className:"textarea-control"},m.createElement("div",{className:"textarea-wrapper"},m.createElement(RichTextEditor,{html:n||"",onChange:l,bannedWords:a,onImagePickerClick:()=>{var e;return null===(e=h.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:v,onInvalidUrlsChange:i,isReplying:d}))),m.createElement(p.T,{size:"p4",className:"count-string"},c("character"),": ",_()(n||"").length),(!x||0===x.length)&&g&&m.createElement("div",{className:"link-preview-wrapper"},g.isFetching?m.createElement(Loading$1,null):m.createElement(m.Fragment,null,m.createElement(CardLink,{title:g.title,url:g.url||"#",image:g.image,noRefetch:!0}),m.createElement("img",{src:e8,className:"icon-close",onClick:()=>v(null),loading:"lazy"}))),m.createElement("input",{ref:h,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:f}),x.length>u.M?m.createElement("div",{className:"input-notification"},m.createElement("img",{src:eJ,loading:"lazy"}),m.createElement(p.T,{size:"p4",color:U.t.colors.alertWarning},c("createPost.popup.warningImage"))):null,x.length>0&&m.createElement("div",{className:"image-gallery"},x.map((e,t)=>m.createElement("div",{key:t,className:"image-item"},m.createElement("img",{src:e,loading:"lazy"}),m.createElement("img",{className:"close-btn",src:e8,onClick:()=>b(t),loading:"lazy"})))))},e7=el.Z.div` input:focus, textarea:focus, [contenteditable='true'] { outline: none; } .title-input { overflow: hidden; width: 100%; padding: 12px 16px; border: solid 1px #d9d9d9; border-radius: ${U.t.borderRadius}; font-size: 16px; line-height: 1.2; white-space: nowrap; :focus { border-color: ${U.t.colors.primaryBase}; box-shadow: 0px 0px 2px 2px ${U.t.colors.primary200}; } br { display: none; } * { display: inline; white-space: nowrap; } mocka { padding: 2px 6px; border-radius: 1rem; &[data-error='true'] { background-color: #ffeeee; color: red; text-decoration: underline; font-style: bold; } } ol, ul { padding-left: 1rem; } } label { display: block; margin-bottom: 5px; color: ${U.t.colors.gray600}; font-size: 13px; font-weight: bold; } .count-string { margin-top: 5px; color: ${U.t.colors.gray500}; font-size: 11px; text-align: right; } `,inputModify=(e,t)=>{if(!t)return e;let{limit:a,bannedWords:n=[]}=t,l="number"==typeof a&&a>=0?e.substring(0,a):e,o=highlightBadWords(l,n);return o},CreatePostTitle=({className:e,style:t,bannedWords:a=[],value:n,onChange:l})=>{var o;let{t:i}=(0,F.u)(),[r,s]=(0,m.useState)(""),d=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(d.current){let pasteHandler=e=>{var t;e.preventDefault();let a=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain");document.execCommand("insertHTML",!1,a)},e=d.current;return e.addEventListener("paste",pasteHandler,{passive:!0}),()=>e.removeEventListener("paste",pasteHandler)}},[d]);let c=(null==a?void 0:a.join(","))||"";(0,m.useEffect)(()=>{var e;if(c){let t=null===(e=d.current)||void 0===e?void 0:e.innerText;if(t){let e=highlightBadWords(t,a);e!==t&&(l&&l(e),s(e))}}},[c]);let u=(0,m.useCallback)(X()(()=>{if(d.current){let e=inputModify(d.current.innerText,{limit:120,bannedWords:a});l&&l(e),s(e)}},300),[]);return(0,m.useEffect)(()=>{setTimeout(()=>{var e;null===(e=d.current)||void 0===e||e.focus()},500)},[]),m.createElement(e7,{className:e,style:t},m.createElement(G.I,{name:"title",value:n||r,size:"md",label:i("createPost.title"),CustomInput:m.createElement(K(),{innerRef:d,html:n||r,onChange:()=>{if(d.current&&d.current.innerText!==(n||r)){let e=inputModify(d.current.innerText,{bannedWords:a});l&&l(e),s(e),u()}},className:"title-input"})}),m.createElement(p.T,{size:"p4",className:"count-string"},i("createPost.popup.wordCount",{count:(null===(o=d.current)||void 0===o?void 0:o.innerText.length)||0,max:120})))},e9=el.Z.div` display: flex; width: 100%; flex-wrap: wrap; margin-top: 1rem; .tag-item { min-height: 32px; padding: 5px 12px; border: 1px solid ${U.t.colors.neutral100}; margin-right: 1rem; margin-bottom: 8px; border-radius: 1rem; color: ${U.t.colors.gray800}; cursor: pointer; font-size: 13px; line-height: 22px; transition: all 0.2s; &.--active { border-color: ${U.t.colors.primary50}; background: ${U.t.colors.primary50}; color: ${U.t.colors.primaryBase}; } &[data-disabled='true'] { background: ${U.t.colors.gray100}; color: ${U.t.colors.gray800}; } } .topic-spinner { margin-right: auto; margin-left: auto; & > button { width: 24px; height: 24px; } } &[data-is-marrybaby='true'] { .tag-item { border-color: transparent; background: #f3f3f3; color: #3e3f58; &.--active { border-color: #b6cdff; background: #e0e9fb; color: #3e3f58; } } } `,TopicSelectList=({className:e,style:t,topics:a,communityId:n,onChange:l,isLoading:o,disabled:i,forceTopics:r,selectedTopics:s,noFetch:d,dataEventCategory:c,dataEventAction:p,dataEventLabel:v})=>{let{data:{locale:h,env:{isMarryBaby:f}}}=(0,m.useContext)(u.T),[b,x]=(0,m.useState)(a?[...a]:[]),[y,w]=(0,m.useState)(s?[...s]:[]),[E,k]=(0,m.useState)(!1),C=(0,m.useRef)(a);C.current=a,(0,m.useEffect)(()=>{var e;!n||d||(null===(e=C.current)||void 0===e?void 0:e.length)||(x([]),k(!0),(0,g.a)(void 0,void 0,void 0,function*(){var e;try{let t=yield(0,u.i)((0,u.g)(u.P.TOPIC.LIST,{communityId:n,_locale:h}),"GET"),a=null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.topics;Array.isArray(a)&&x(()=>(null==a?void 0:a.map(H.c).sort((e,t)=>(e.order||0)-(t.order||0)))||[])}catch(e){console.log(e),k(!1)}k(!1)}))},[n,d]);let A=null==a?void 0:a.map(e=>e.id).join("-"),N=null==b?void 0:b.map(e=>e.id).join("-"),P=null==r?void 0:r.map(e=>e.id).join("-");(0,m.useEffect)(()=>{a&&void 0!==A&&A!==N&&x(a)},[a,A,N]);let T=(0,m.useMemo)(()=>b.filter(e=>!(null==r?void 0:r.some(t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId))),[N,P]);return m.createElement(e9,{"data-is-marrybaby":f,className:e,style:t},r.map(e=>m.createElement(TopicItem,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:!0,selected:!0,dataEventAction:p,dataEventCategory:c,dataEventLabel:v})),T.map(e=>m.createElement(TopicItem,{key:`${e.id}-${e.mappedCategoryId}`,topic:e,disabled:i,selected:(s||y).some(t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId),onClick:()=>{let t=s||y,a=t.findIndex(t=>t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId);-1!==a?t.splice(a,1):t.push(e),l&&s?l(t.slice()):(l&&l(t.slice()),w(t.slice()))},dataEventAction:p,dataEventCategory:c,dataEventLabel:v})),(o||E)&&m.createElement(Loading$1,{className:"topic-spinner"}))},TopicItem=e=>{var{topic:t,disabled:a,selected:n,onClick:l}=e,o=(0,g._)(e,["topic","disabled","selected","onClick"]);return m.createElement("div",Object.assign({className:"tag-item"+(n?" --active":""),"data-disabled":a,onClick:a?void 0:l},o),t.name)},CreateNewPostContent=({className:e,style:t,onPostCreatedEdited:a,onClose:n,communities:l=[],forceSelectCommunity:o,forceSelectTopics:i,articleId:r,optionalTopic:s,editPostData:d,defaultCommunity:c,defaultTopics:v,noFetchTopic:h,hideTopicList:f,selectAskDoctor:b,showAskDoctorOptions:x,currentPageUrl:E})=>{let k=!!(null==d?void 0:d.id),{data:{locale:C,env:{isMarryBaby:A}},action:{pushNotifications:N,sanitizeFunction:P}}=(0,m.useContext)(u.T),{t:T}=(0,F.u)(),[S,z]=(0,m.useState)(!1),[M,I]=(0,m.useState)(b),[R,O]=(0,m.useState)(!1),[B,L]=(0,m.useState)(!1),[V,q]=(0,m.useState)(!1),[G,Q]=(0,m.useState)(""),[X,Y]=(0,m.useState)(""),[K,J]=(0,m.useState)(o?{label:o.name,value:`${o.id||""}-${o.mappedCategoryId||""}`}:{label:T("community.choose"),value:""}),[ee,et]=(0,m.useState)([...i]),[ea,en]=(0,m.useState)([]),[el,eo]=(0,m.useState)([]),ei=o||l.find(e=>`${e.id||""}-${e.mappedCategoryId||""}`===K.value),er=o?[o]:l.filter(e=>e.isActive).sort((e,t)=>e.name>t.name?1:e.name0)&&ei&&(!ea||ea.length<=u.M)&&!(null==ec?void 0:ec.length)&&!V;(0,m.useEffect)(()=>{d?(Q(d.title||""),Y(decodeMention(decodePostUrl(d.description||"","edit"),d.mentions)),J({label:d.community.name,value:`${d.community.id||""}-${d.community.mappedCategoryId||""}`}),et(d.topics||[]),en(d.photos||[]),z(!!d.isAnonymous),I(!!d.isAskDoctor)):(c&&J({label:c.name,value:`${c.id||""}-${c.mappedCategoryId||""}`}),v&&et(v))},[]),(0,m.useEffect)(()=>{L(""!==G&&!/[a-zA-Z]/.test(G))},[G]);let onCreateEditSuccess=e=>{a&&a((0,H.b)(e),k),n&&n()},submitPost=()=>(0,g.a)(void 0,void 0,void 0,function*(){var e,t,a,l,o,i,s,c,m;let p;if(x&&void 0===M)return O(!0),!1;let u=yield getPostFormData({title:G,description:X,communityId:String((null==ei?void 0:ei.id)||""),imageFiles:ea,previewUrl:es,topicIds:null==ee?void 0:ee.map(e=>String(e.id||"")).filter(Boolean),locale:C,sanitizeFunction:P,categoryCommunityId:String((null==ei?void 0:ei.mappedCategoryId)||""),categoryTopicIds:null==ee?void 0:ee.map(e=>String(e.mappedCategoryId||"")).filter(Boolean),isAnonymous:S?1:0,isAskDoctor:M?1:0});r&&u.append("article_id",r),k?(null==d?void 0:d.id)&&(p=yield editPost({id:d.id,formData:u,locale:C})):p=yield createPost({formData:u,locale:C,isArticleComment:!(null==ei?void 0:ei.id)&&!!(null==ei?void 0:ei.mappedCategoryId)});let g=null==p?void 0:p.data;(null==g?void 0:g.id)&&!(null===(t=null===(e=null==p?void 0:p.messages)||void 0===e?void 0:e.moderation)||void 0===t?void 0:t.type)?(N({message:T("createPost.popup.success"),type:"success"}),onCreateEditSuccess(g)):(null===(l=null===(a=null==p?void 0:p.messages)||void 0===a?void 0:a.moderation)||void 0===l?void 0:l.type)==="banned"?(N({title:T("notification.post.blocked.title"),message:T("notification.post.blocked.message"),type:"danger"}),p.messages.moderation.words&&eo(p.messages.moderation.words)):(null===(i=null===(o=null==p?void 0:p.messages)||void 0===o?void 0:o.moderation)||void 0===i?void 0:i.type)==="suspect"?(N({title:T("notification.post.suspect.title"),message:T("notification.post.suspect.message"),type:"warning"}),n&&n()):(null===(c=null===(s=null==p?void 0:p.messages)||void 0===s?void 0:s.find)||void 0===c?void 0:c.call(s,e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))}))?(N({message:T("notification.suspend.message"),type:"danger"}),n&&n()):N({message:(null===(m=null==p?void 0:p.messages)||void 0===m?void 0:m[0])||T("notification.failure"),type:"danger"})});return m.createElement(eX,{className:e,style:t},m.createElement("div",{className:"input-group-container"},m.createElement(CreatePostTitle,{className:"input-group",bannedWords:el,value:G,onChange:Q}),B&&m.createElement(eK,null,m.createElement(y.Z,{isSolid:!0,color:U.t.colors.red700,size:14}),m.createElement(p.T,{size:"p3",as:"span",color:U.t.colors.red700},T("createPost.popup.specialCharErr"))),m.createElement(CreatePostDescription,{className:"input-group",bannedWords:el,value:X,onChange:Y,onPreviewUrlChange:ed,onInvalidUrlsChange:em,onImageFilesChange:en,imageFiles:ea}),x&&m.createElement(eY,{"data-is-marry-baby":A},m.createElement("div",{className:"switch-label"},m.createElement(w.Z,{isMarryBaby:A,size:A?32:24,color:U.t.colors.primaryBase,className:"label-icon"}),m.createElement("span",{className:"label-txt"},T("createPost.askDoctor"))),m.createElement(Z.B,{value:M,choices:[{label:T("createPost.askDoctorChoice.yes"),value:!0,dataEventCategory:"Together",dataEventAction:"Write Post Click - Ask Doctor",dataEventLabel:E},{label:T("createPost.askDoctorChoice.no"),value:!1}],onChange:e=>{"boolean"==typeof e&&(O(!1),I(e))}})),R&&m.createElement(eK,null,m.createElement(y.Z,{isSolid:!0,color:U.t.colors.red700,size:14}),m.createElement(p.T,{size:"p3",as:"span",color:U.t.colors.red700},T("createPost.message.askDoctorRequire"))),m.createElement("div",{className:"input-group"},m.createElement(p.T,{size:"p4",className:"input-group-label"},T("admin.community")),m.createElement(D.D,{options:(null==er?void 0:er.map(e=>({label:e.name,value:`${e.id||""}-${e.mappedCategoryId||""}`})))||[],id:"community-picker",placeholder:T("community.choose"),value:K,dropdownLabelTrackingAttributes:{"data-event-category":"Together","data-event-action":"Write Post Click - Choose Community/Topic","data-event-label":E},onChange:e=>{J({label:e.label,value:String(e.value)}),et([])},disabled:!!o}),m.createElement(p.T,{size:"sm",className:"warning",color:U.t.colors.gray400},"* ",T("commentPopup.warning.newPost"))),!f&&m.createElement("div",{className:"input-group"},m.createElement(p.T,{size:"p4",className:"input-group-label"},T("tab.topic")),m.createElement("div",{className:"input-notification"},m.createElement("img",{src:ei?"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cpath fill='%232D87F3' d='M8 14.5a6 6 0 1 0 0-12 6 6 0 0 0 0 12'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 5.5v3M8 11.5h.007'/%3e%3c/svg%3e":eJ,loading:"lazy"}),m.createElement(p.T,{size:"base",color:U.t.colors.gray500},T(ei?"createPost.popup.primary":"createPost.popup.warning"))),ei&&m.createElement(TopicSelectList,{className:"tag-list",communityId:ei.id,forceTopics:i,onChange:et,selectedTopics:ee,noFetch:h,dataEventCategory:"Together",dataEventAction:"Write Post Click - Choose Community/Topic",dataEventLabel:E}))),m.createElement("div",{className:"form-action"},m.createElement("div",{className:"input-group"},m.createElement(j.X,{className:"swich-input-group",labelPosition:"left",name:"PostAnonymous",checked:S,color:A?"pink":void 0,"data-event-category":"Together","data-event-action":"Write Post Click - Incognito","data-event-label":E,label:m.createElement("div",{className:"switch-label"},m.createElement("img",{className:"label-icon",src:W.C.getAssetPath("anomyous-avatar.svg"),alt:"anomyous avatar",style:{marginRight:"10px",width:"24px"},loading:"lazy"}),m.createElement("span",{className:"label-txt"},T("createPost.postAnonymous"))),value:"Post Anonymous",onChange:e=>z(e.currentTarget.checked),styles:{body:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},label:{display:"flex",alignItems:"center"}}})),m.createElement("div",{className:"input-group"},m.createElement($.B,{className:"submit-btn pointer-event-child-none",size:"lg","data-event-category":"Ask Doctor","data-event-action":"Submit Question","data-event-label":window.location.href,onClick:()=>(0,g.a)(void 0,void 0,void 0,function*(){if(ep&&!V){q(!0);try{yield submitPost()}catch(e){console.error(e),N(getDefaultFailNoti(T))}q(!1)}}),disabled:!ep,loading:V},T("createPost.popup.submit")))))},te=el.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: ${U.t.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: ${U.t.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'] { ${q.M.mbDown} { top: 100%; transform: translate(-50%, -100%); max-width: unset; width: 100%; background: unset; overflow: unset; } } } .popup-content { .close-button { ${q.M.mbDown} { display: none; } } .confirm-dialog { ${q.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; ${q.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 { ${q.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; } } ${q.M.mbDown} { display: flex; } } } } } `,tt=el.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 ${U.t.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; } `} `,ta=el.Z.div` cursor: pointer; display: flex; align-items: center; `;var tn="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%23262626' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M18 6 6 18M6 6l12 12'/%3e%3c/svg%3e";let PopupFrame=({className:e,style:t,closeIcon:a,heading:n="",children:l,isOpen:o=!1,hasFullscreen:i=!1,onClose:r=()=>null})=>{let[s,d]=(0,m.useState)(!1);return m.createElement(tt,{className:e,style:t,isExpand:s,hasFullscreen:i},m.createElement(H.P,{type:"confirm",onClose:r,isOpen:o,closeIcon:a||m.createElement("img",{src:tn,loading:"lazy"}),enableAnimation:!i},m.createElement("div",{className:"header"},m.createElement(et.H,{tag:"h5"},n),i&&m.createElement(ta,{onClick:()=>d(!s)},m.createElement(E.Z,{size:14,isExpand:s}))),m.createElement("div",{className:"content"},"function"==typeof l?l(s):l)))},PopupDanger=({className:e,isMarryBaby:t,style:a,title:n,description:l,acceptText:o,cancelText:i,onAccept:r,onCancel:s,thumbnail:d,isThumbnailIcon:c,onClose:g,acceptBtnTracking:v,acceptBtnProps:h,cancelBtnProps:f})=>{let{data:{env:{isMarryBaby:b}}}=(0,m.useContext)(u.T),x="boolean"==typeof t?t:b,[y,w]=(0,m.useState)(!1);return((0,m.useEffect)(()=>((0,q.t)(!0),setTimeout(()=>w(!0),0),()=>(0,q.t)(!1)),[]),"undefined"==typeof window)?null:en.createPortal(m.createElement(te,{"data-is-marrybaby":x,className:e,style:a,"data-open":y},m.createElement(PopupFrame,{className:"popup-frame",isOpen:y,onClose:g},m.createElement("div",{className:"confirm-dialog",onClick:e=>e.stopPropagation()},m.createElement("div",{className:"confirm-content"},d&&m.createElement("div",{className:`thumbnail-container ${c?"is-icon":""}`},m.createElement("img",{className:"thumbnail",src:d,loading:"lazy"})),m.createElement(et.H,{className:"title",tag:"h2"},n),m.createElement(p.T,{className:"desc",size:"lg"},l),m.createElement("div",{className:"btn-group"},m.createElement(ee.B,Object.assign({theme:x?"marryBaby":"helloSites",size:"md",color:"tertiary",onClick:()=>{null==r||r(),null==g||g()}},h,v),o),m.createElement(ee.B,Object.assign({theme:x?"marryBaby":"helloSites",size:"md",onClick:()=>{null==s||s(),null==g||g()}},f),i)))),x&&d&&m.createElement("div",{className:`thumbnail-container is-mobile ${c?"is-icon":""}`},m.createElement("img",{className:"thumbnail",src:d,loading:"lazy"})))),(0,q.a)())},tl=el.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: ${U.t.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: ${U.t.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 ${U.t.colors.gray200}; border-radius: ${U.t.borderRadius}; &:active, &:focus { border-color: ${U.t.colors.primaryBase}; box-shadow: 0px 0px 2px 2px ${U.t.colors.primary200}; } &:disabled { background-color: ${U.t.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: ${U.t.sizes.fwRegular}; ${q.M.mbDown} { font-size: 22px; line-height: 1.2; } ${q.M.mbUp} { font-size: 26px; line-height: 1.2; } } } &[data-size='md'] { .as-input { font-weight: ${U.t.sizes.fwRegular}; line-height: 22px; ${q.M.mbDown} { font-size: 14px; line-height: 1.2; } ${q.M.mbUp} { font-size: 16px; line-height: 1.2; } } } &[data-size='sm'] { .as-input { font-weight: ${U.t.sizes.fwRegular}; line-height: 20px; ${q.M.mbDown} { font-size: 13px; line-height: 1.5; } ${q.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: ${U.t.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; } } } `,to=(0,m.createContext)({}),getCommentFormBody=({postId:e,message:t,photos:a,link:n,locale:l,sanitizeFunction:o,replyingUserId:i,replyingUserName:r,replyingId:s})=>(0,g.a)(void 0,void 0,void 0,function*(){let d=new FormData,c=encodePostContent(t.replace(/(\ )+/g," "),o),m=getMentionIdsFromString(c);if(a&&a.length>0){let e=yield Promise.all(null==a?void 0:a.map(e=>uploadAndGetSrc(e,l)));e.filter(Boolean).slice(0,u.M).forEach(e=>{d.append("images[]",e)})}return n&&d.append("link",n),null==m||m.forEach(e=>{d.append("mention_ids[]",e)}),d.append("post_id",e),s&&d.append("parent_id",s),i&&(m.unshift(i),c=`[mention+id="${i}"+name="${(r||"").replace('"',"'")}"]${c}`,d.append("parent_user_id",String(i))),d.append("content",c),d.append("content",c),d}),submitComment=(e,t)=>(0,g.a)(void 0,void 0,void 0,function*(){return(0,u.d)((0,u.g)(u.P.COMMENT.CREATE,{_locale:t}),"POST",{data:e})}),decodeCommentBody=e=>{try{let t=e.match(/\[@([^\]]+)\]/),a=t?t[0].replace("[@","").replace("]",""):"",n=e.replace(/\[@([^\]]+)\]/,"");return{text:n.trim(),replyingTo:a}}catch(e){}return{text:""}},submitReply=(e,t)=>(0,g.a)(void 0,void 0,void 0,function*(){return(0,u.d)((0,u.g)(u.P.COMMENT.REPLY,{_locale:t}),"POST",{data:e})}),likeUnlikeComment=({commentId:e,setLike:t=!1,locale:a})=>(0,g.a)(void 0,void 0,void 0,function*(){return(0,u.d)((0,u.g)(t?u.P.COMMENT.LIKE:u.P.COMMENT.UNLIKE,{_locale:a,id:e}),"GET")}),deleteComment=({id:e,locale:t})=>(0,u.d)((0,u.g)(u.P.COMMENT.DELETE,{_locale:t,id:e}),"DELETE"),InputCommentBar=({isReply:e,className:t,onClose:a,replyToName:n,style:l,replyingId:o,replyingUser:i,onPostSuccess:r,post:s,isMarryBaby:d})=>{let{action:{pushNotifications:c,sanitizeFunction:v},data:{userInfo:h,locale:f,env:{isMarryBaby:b}}}=(0,m.useContext)(u.T),{t:x}=(0,F.u)(),{onSelectImages:y,onRemoveImage:w,imageSrcs:E,onRemoveAllImages:k,imageFiles:C}=useImagePicker(),[A,N]=(0,m.useState)(""),{trigger:P}=(0,m.useContext)(to),[T,S]=(0,m.useState)(!1),z=(0,m.useRef)(null),M=(0,m.useRef)(null),j=(0,m.useRef)(null),[I,R]=(0,m.useState)([]),[O,D]=(0,m.useState)([]),[B,_]=(0,m.useState)(null);return(0,m.useEffect)(()=>{var e;null===(e=j.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout(()=>{var e;null===(e=M.current)||void 0===e||e.focus()},400)},[P]),m.createElement(tl,{"data-is-reply":e,className:t,style:l},e&&m.createElement("div",{className:"reply-to-container"},m.createElement(p.T,{size:"p4"},m.createElement("span",{dangerouslySetInnerHTML:{__html:x("inputComment.replyTo",{name:`@${n||""}`})}})),m.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:()=>a&&a(),loading:"lazy"})),m.createElement("div",{className:"input-container",ref:j},m.createElement(H.U,{className:`avatar-wrapper ${e?"avatar-wrapper-reply":""}`,avatar:(null==h?void 0:h.id)?h.avatar:u.w,username:(null==h?void 0:h.name)||(null==h?void 0:h.username)}),m.createElement("input",{ref:z,onChange:y,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),m.createElement(G.I,{value:A,name:"input",size:"md",className:"input-wrapper",displayIcon:m.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:m.createElement("div",{className:"as-input"},m.createElement(RichTextEditor,{className:"textarea",html:A,onChange:N,onImagePickerClick:()=>{var e;return null===(e=z.current)||void 0===e?void 0:e.click()},bannedWords:O,onPreviewUrlChange:_,onInvalidUrlsChange:R,setEditorRef:e=>M.current=e,isReplying:e}))}),m.createElement(ee.B,{theme:("boolean"==typeof d?d:b)?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:()=>(0,g.a)(void 0,void 0,void 0,function*(){var t,n,l,d,m,p,u,g,h;if((null==s?void 0:s.id)&&!T){S(!0);try{let b=yield getCommentFormBody(Object.assign({message:A,photos:C,postId:String(s.id),link:null==B?void 0:B.url,sanitizeFunction:v,locale:f},e&&o?{replyingUserId:String((null==i?void 0:i.id)||(null===(t=null==s?void 0:s.author)||void 0===t?void 0:t.id)||""),replyingId:o,replyingUserName:(null==i?void 0:i.name)||(null==i?void 0:i.username)||""}:{})),y=yield e&&o?submitReply(b,f):submitComment(b,f),w=null==y?void 0:y.data;(null==w?void 0:w.id)&&!(null===(l=null===(n=null==y?void 0:y.messages)||void 0===n?void 0:n.moderation)||void 0===l?void 0:l.type)?(e=>{N(""),k(),a&&a();let t=(0,H.e)(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),r&&r(t)})(y):(null===(m=null===(d=null==y?void 0:y.messages)||void 0===d?void 0:d.moderation)||void 0===m?void 0:m.type)==="banned"?(c({title:x("notification.comment.blocked.title"),message:x("notification.comment.blocked.message"),type:"danger"}),y.messages.moderation.words&&D(y.messages.moderation.words)):(null===(u=null===(p=null==y?void 0:y.messages)||void 0===p?void 0:p.moderation)||void 0===u?void 0:u.type)==="suspect"?(c({title:x("notification.comment.suspect.title"),message:x("notification.comment.suspect.message"),type:"warning"}),N(""),k(),a&&a()):(null===(g=null==y?void 0:y.messages)||void 0===g?void 0:g.find(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))}))?(c({message:x("notification.suspend.message"),type:"warning"}),N(""),k(),a&&a()):c({title:"",message:(null===(h=null==y?void 0:y.messages)||void 0===h?void 0:h[0])||x("notification.comment.somethingWrong"),type:"danger"})}catch(e){c({title:"",message:x("notification.comment.somethingWrong"),type:"danger"})}S(!1)}}),isLoading:T,isDisabled:!!(null==I?void 0:I.length)||T||!A||(null==A?void 0:A.length)<2||!A.trim()},m.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==I?void 0:I.length)?m.createElement("div",{className:"error-text"},x("notification.limitUrlDomain")):null,(!E||0===E.length)&&B&&m.createElement("div",{className:"link-preview-wrapper"},B.isFetching?m.createElement(Loading$1,null):m.createElement(m.Fragment,null,m.createElement(CardLink,{title:B.title,url:B.url||"#",image:B.image,noRefetch:!0}),m.createElement("img",{src:e8,className:"icon-close",onClick:()=>_(null),loading:"lazy"}))),E&&E.length>0&&m.createElement("div",{className:"preview-images-container"},E.map((e,t)=>m.createElement("div",{key:t,className:"image-src-wrapper"},m.createElement("img",{className:"preview-image",src:e,loading:"lazy"}),m.createElement("img",{src:e8,className:"icon-close-circle",onClick:()=>w(t),loading:"lazy"})))))},ti=(0,u.s)(el.Z.a` * { pointer-events: none; } `,"hhg-share__item-wrapper"),tr=el.Z.div` padding: 1rem; .share__social { display: flex; width: 100%; align-items: center; justify-content: center; & > ${ti.classSelector} { margin: 0 7px; & > img { width: 32px; height: 32px; } .__label { display: none; } } } .share__copy-link { position: relative; padding: 1rem 0.5rem 0; margin-top: 16px; &::before { position: absolute; top: 0; left: 0; width: calc(100% + 2rem); border-top: 1px solid ${U.t.colors.neutral100}; margin-left: -1rem; content: ''; } .__label { margin-bottom: 8px; font-size: 11px; font-weight: 400; line-height: 17px; text-align: left; } .__input-group { position: relative; overflow: hidden; width: 100%; height: 40px; border: 1px solid ${U.t.colors.gray200}; background: #fff; border-radius: ${U.t.borderRadius}; & > input { width: 100%; height: 100%; padding: 0 16px; border: none; background: transparent; color: ${U.t.colors.gray800}; &:focus { outline: none; } } .__copy { position: absolute; top: 0; right: 0; width: 71px; height: 100%; padding-left: 12px; background: linear-gradient( 90deg, rgba(255, 255, 255, 0.1) 0%, #fff 17%, #fff 100% ); color: ${U.t.colors.primaryBase}; cursor: pointer; font-size: 14px; font-weight: 400; } } } &[data-is-marrybaby='true'] { ${q.M.mbDown} { padding: 0.5rem; } .share__social { justify-content: space-between; & > a { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; ${q.M.mbDown} { margin: 0; } & > img { margin-bottom: 0.8rem; } .__label { display: initial; } } } .share__copy-link { padding: 0; &::before { display: none; } .__label { display: none; } .__input-group { height: unset; background-color: rgb(243, 243, 243); border-radius: 16px; & > input { padding: 1rem; } .__copy { background: linear-gradient( 90deg, rgba(255, 255, 255, 0.1) 0%, #f3f3f3 17%, #f3f3f3 100% ); } } } } `,getSocialList=(e,t)=>t?[{icon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' fill='none'%3e%3cpath fill='url(%23a)' d='M35 9.583v20.834A4.59 4.59 0 0 1 30.417 35h-4.584V23.333h3.017a.84.84 0 0 0 .833-.733l.309-2.5a.8.8 0 0 0-.2-.65.82.82 0 0 0-.625-.283h-3.334V16.25c0-.917.75-1.667 1.667-1.667h1.667A.836.836 0 0 0 30 13.75v-2.817a.84.84 0 0 0-.758-.825A32 32 0 0 0 26.525 10c-3.667 0-5.692 2.183-5.692 6.142v3.025H17.5a.836.836 0 0 0-.833.833v2.5c0 .458.375.833.833.833h3.333V35H9.583A4.59 4.59 0 0 1 5 30.417V9.583A4.59 4.59 0 0 1 9.583 5h20.834A4.59 4.59 0 0 1 35 9.583'/%3e%3cdefs%3e%3clinearGradient id='a' x1='20' x2='20' y1='5' y2='35' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='%234DABF7'/%3e%3cstop offset='1' stop-color='%232668DA'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",name:"Facebook",href:`https://www.facebook.com/sharer.php?u=${e}`},{icon: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VELy3vgFAs2QrK4XfoFAuRGSZNzsFwhsqIaQQjMkZlSNP16gwEeKQ4vZuWVG7ShIgOXhOmX+V70HUq6Tp0+/2rK7SLm4aNdTEOR4uccfdFnvkZrvzmA/WbdLaBczT87wqzp0Hgpyc5QC2fNhic692bSsiC6/FjNgKohRIDWnRsWJlO44GJxOTFkx1fkiDdQKpOjj5oObnllotGHJ87undqt3hnToPFqmQmyHah7V1i6rfVtzaF7sCyZlxVHXrTDMn5TO+K9X+kYX5sxLZv54nRcUqe5h/CSBVyxUmJfw/F80TWQPc4elaf2kLpVCp0nkRd2Q6ILw9POdk4RfNQ7hrxo174WGX+64ZsrKyMj4T/0BmOLcBqL8HEcAAAAASUVORK5CYII=",name:"Zalo",href:`https://sp.zalo.me/share?href=${e}`},{icon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' fill='none'%3e%3cpath fill='%2303A9F4' d='M35 30.833A4.167 4.167 0 0 1 30.833 35H9.167A4.166 4.166 0 0 1 5 30.833V9.167A4.166 4.166 0 0 1 9.167 5h21.666C33.134 5 35 6.865 35 9.167z'/%3e%3cpath fill='white' d='M30 14.267c-.735.325-1.666.631-2.5.733.848-.503 2.194-1.552 2.5-2.5-.793.466-2.226.963-3.16 1.143-.747-.791-1.812-1.143-2.992-1.143C21.58 12.5 20 14.42 20 16.667v1.666c-3.333 0-6.583-2.539-8.606-5a4 4 0 0 0-.556 2.048c0 1.516 1.393 3.054 2.495 3.786-.672-.021-1.946-.535-2.5-.834v.048c0 1.972 1.384 3.311 3.26 3.685-.342.094-.76.434-2.366.434.521 1.613 3.144 2.465 4.94 2.5-1.405 1.09-3.91 1.667-5.834 1.667-.332 0-.512.018-.833-.02 1.815 1.15 4.35 1.686 6.667 1.686 7.547 0 11.666-5.765 11.666-11.141 0-.177-.005-.769-.015-.942.807-.568 1.134-1.163 1.682-1.983'/%3e%3c/svg%3e",name:"Twitter",href:`https://twitter.com/intent/tweet?url=${e}`},{icon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='41' height='40' fill='none'%3e%3cpath fill='%230078D4' d='M35.5 30.833A4.166 4.166 0 0 1 31.333 35H9.667A4.167 4.167 0 0 1 5.5 30.833V9.167A4.167 4.167 0 0 1 9.667 5h21.666A4.166 4.166 0 0 1 35.5 9.167z'/%3e%3cpath fill='black' d='M25.5 30.833v-8.416c0-1.408-.683-2.248-1.827-2.248-.68 0-1.179.382-1.483 1.136-.014.053-.034.271-.026.928l.002 8.6h-5.833V14.999h5.833v.884c.852-.587 1.896-.884 3.115-.884 3.79 0 6.05 2.578 6.05 6.895l.002 8.939zm-15.834 0V14.999h2.88c-1.668 0-2.88-1.226-2.88-2.917s1.232-2.916 2.928-2.916c1.677 0 2.871 1.192 2.905 2.9 0 1.702-1.232 2.933-2.929 2.933h2.93v15.834z' opacity='.05'/%3e%3cpath fill='black' d='M25.917 30.417v-7.999c0-1.644-.859-2.665-2.243-2.665-1.08 0-1.613.76-1.87 1.398-.067.166-.058.824-.055 1.105l.002 8.161h-5v-15h5v1.365c.662-.686 1.729-1.365 3.531-1.365 3.528 0 5.634 2.422 5.634 6.479l.001 8.521zm-15.833 0v-15h5v15zm2.464-15.833c-1.427 0-2.464-1.052-2.464-2.5 0-1.45 1.057-2.5 2.512-2.5 1.436 0 2.459 1.024 2.488 2.49 0 1.458-1.057 2.51-2.512 2.51z' opacity='.07'/%3e%3cpath fill='white' d='M10.5 15.833h4.167V30H10.5zm2.07-1.666h-.023c-1.243 0-2.047-.927-2.047-2.085 0-1.182.83-2.082 2.095-2.082 1.268 0 2.048.9 2.072 2.082 0 1.157-.804 2.085-2.096 2.085M30.5 30h-4.167v-7.582c0-1.832-1.02-3.082-2.66-3.082-1.25 0-1.927.843-2.255 1.658-.12.292-.085 1.099-.085 1.506V30h-4.166V15.833h4.166v2.18c.601-.93 1.542-2.18 3.949-2.18 2.981 0 5.217 1.875 5.217 6.062z'/%3e%3c/svg%3e",name:"LinkedIn",href:`https://www.linkedin.com/sharing/share-offsite/?url=${e}`},{icon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' fill='none'%3e%3cpath fill='url(%23a)' d='M36.667 19.584c0 8.975-7.458 16.25-16.666 16.25a17 17 0 0 1-3.987-.47 1.68 1.68 0 0 0-1.15.12l-3.647 1.825a1.417 1.417 0 0 1-2.05-1.267v-3.355a1.7 1.7 0 0 0-.567-1.249c-3.245-2.966-5.266-7.179-5.266-11.854 0-8.975 7.458-16.25 16.667-16.25 9.208 0 16.666 7.275 16.666 16.25'/%3e%3cpath fill='black' d='M29.16 14.41c-.357 0-.703.118-1 .343l-4.745 3.512a.6.6 0 0 1-.363.125.56.56 0 0 1-.341-.113l-3.31-2.492a3.82 3.82 0 0 0-2.298-.765c-1.313 0-2.52.66-3.23 1.764l-1.009 1.575-3.433 5.58a1.63 1.63 0 0 0-.06 1.678c.299.545.862.883 1.47.883.357 0 .703-.118 1-.342l4.746-3.513a.6.6 0 0 1 .362-.125c.125 0 .243.04.342.114l3.31 2.491a3.82 3.82 0 0 0 2.297.765 3.82 3.82 0 0 0 3.23-1.763l1.01-1.576 3.433-5.58a1.63 1.63 0 0 0 .059-1.678 1.68 1.68 0 0 0-1.47-.883' opacity='.05'/%3e%3cpath fill='black' d='M29.161 14.826c-.266 0-.525.09-.75.258L23.665 18.6c-.18.136-.39.207-.61.207a.98.98 0 0 1-.591-.197l-3.311-2.492a3.4 3.4 0 0 0-2.048-.68c-1.17 0-2.246.587-2.879 1.572l-1.008 1.575-3.43 5.574c-.247.387-.266.86-.048 1.259.222.405.656.667 1.104.667.266 0 .525-.09.75-.259l4.747-3.515c.18-.136.39-.206.61-.206a.98.98 0 0 1 .592.196l3.31 2.493c.6.446 1.307.68 2.048.68a3.41 3.41 0 0 0 2.88-1.572l1.008-1.576 3.429-5.573c.247-.387.267-.86.048-1.26a1.28 1.28 0 0 0-1.104-.666Z' opacity='.07'/%3e%3cpath fill='white' d='m28.663 15.417-4.75 3.516c-.509.384-1.2.384-1.7.009L18.9 16.449a3.004 3.004 0 0 0-4.325.784l-1.008 1.575-3.425 5.566c-.5.784.458 1.675 1.2 1.117l4.75-3.517a1.41 1.41 0 0 1 1.7-.008l3.311 2.492a3.004 3.004 0 0 0 4.325-.783l1.009-1.575 3.425-5.567c.5-.783-.459-1.675-1.2-1.116Z'/%3e%3cdefs%3e%3cradialGradient id='a' cx='0' cy='0' r='1' gradientTransform='translate(9.24 35.816)scale(39.6767)' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='%231292FF'/%3e%3cstop offset='.079' stop-color='%232982FF'/%3e%3cstop offset='.23' stop-color='%234E69FF'/%3e%3cstop offset='.351' stop-color='%236559FF'/%3e%3cstop offset='.428' stop-color='%236D53FF'/%3e%3cstop offset='.754' stop-color='%23DF47AA'/%3e%3cstop offset='.946' stop-color='%23FF6257'/%3e%3c/radialGradient%3e%3c/defs%3e%3c/svg%3e",name:"Messenger",href:`https://www.facebook.com/sharer.php?u=${e}`}]:[{icon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='33' height='32' fill='none'%3e%3cpath fill='%233B5998' d='M30.734 0H2.254A1.766 1.766 0 0 0 .5 1.766v28.48C.507 31.217 1.296 32 2.266 32h15.328V19.626h-4.16V14.78h4.16v-3.565c0-4.131 2.525-6.384 6.212-6.384a34 34 0 0 1 3.724.192v4.32h-2.54c-2.007 0-2.397.96-2.397 2.352v3.085h4.787l-.64 4.845h-4.16V32h8.154c.975 0 1.766-.79 1.766-1.766V1.754A1.766 1.766 0 0 0 30.734 0'/%3e%3c/svg%3e",name:"Facebook",href:`https://www.facebook.com/sharer.php?u=${e}`},{icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKoAAACqCAMAAAAKqCSwAAABqlBMVEUAAAD////3+fwAcrIAgMcDcrD9/f4Af8b6/P0AfcPy+fv3/P36/f0BfMAKc7AIcq0Aer3u9/kPdrDr9vn0+vvf7/UAd7oAdbbm8/gNc68bebA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Vay5cn0QmTLfm4DEN62fD0zncnUXqJS6POwFM2/XRcLb7SS2EvlDzd6fFt2YbhfElXwVa8v9sOjpwvD79+/H3729NFmJMwvMdQSQNgcXb7Y7Wczy+nOYnFqvX19qljsTC/PDN+O+RxS9PyvqG+lUSWgVkcMrH4iRQHDNd0iQa287JyqP5Hwde0i+iDzqXz8pmTV2nvWLy6tPtbWU9VPCv1FgSqkVU7fCqjG6IUq6qBAKqOaQDsKVERIUriqaVCVH8BrIST9KdbVUlltuF7LdKc+LDrzVllXmQH1w+kPi0YKs5oNdef0p4VbCFm/SKimcIDXtZ8Xj5WsUmI1AerTMx8XbyGUrPwVa86s1w1mfa3ksqg82uDPt1ZTeMCHHbVHG1hqHmxhAtQPYFKlznsMxzsO1RDWDx+evt6pAUJX8eEmJmfFJn9elCxs+mdb8bpKj2LCV+ZRXOiqP+DMdLAyqDosMgstD6pFa/wjDtU4/wU6bQ/uNazdKwAAAABJRU5ErkJggg==",name:"Zalo",href:`https://sp.zalo.me/share?href=${e}`},{icon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='33' height='32' fill='none'%3e%3crect width='32' height='32' x='.5' fill='%231FA1F3' rx='4'/%3e%3cpath fill='white' fill-rule='evenodd' d='m16.23 13.235.04.634-.673-.077c-2.455-.298-4.6-1.308-6.42-3.004l-.89-.842-.23.622c-.486 1.385-.175 2.848.836 3.832.54.544.418.621-.512.298-.324-.104-.607-.181-.634-.143-.095.091.229 1.27.485 1.735.35.648 1.066 1.282 1.848 1.657l.66.298-.781.013c-.756 0-.783.013-.702.285.27.841 1.335 1.735 2.523 2.123l.836.272-.729.414a7.9 7.9 0 0 1-3.614.958c-.607.013-1.106.065-1.106.104 0 .13 1.645.854 2.603 1.14 2.873.84 6.285.478 8.848-.959 1.82-1.023 3.641-3.055 4.491-5.023.459-1.049.917-2.965.917-3.884 0-.596.04-.673.796-1.385.445-.415.863-.868.944-.997.135-.246.122-.246-.566-.026-1.147.388-1.309.337-.742-.246.418-.414.917-1.165.917-1.385 0-.04-.202.026-.432.142-.242.13-.782.324-1.187.44l-.728.22-.66-.427c-.365-.233-.877-.492-1.147-.57-.688-.18-1.74-.155-2.36.052-1.687.583-2.752 2.085-2.63 3.729Z' clip-rule='evenodd'/%3e%3c/svg%3e",name:"Twitter",href:`https://twitter.com/intent/tweet?url=${e}`},{icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKsAAACqCAMAAADlak+OAAAB+1BMVEUAAAAqtkD3+fz9/f75+fkpsz7///9CxVM9wk9JyVgosD06wEwvu0QtuEJRzl5OzFxU0GH7/ftMy1o3vkn6+/qQ151X0WMzu0dExlVGx1Yrt0FAwlH2+PYtskIntD31+/bv+PDy9/Ps9e4xt0UkszsprD1FvlcoqTzj9Obz+vQzs0fg8OPH6cxNyFz3/Pg3tEopojze8+PR7tUrsEDo8+rn9um65sBJw1n5+v07t07a7t0mpjrr9+yI15Lw9fFdzmhRyV5exW/c8t/N6tE1uEjW7NpBt1Oz5rlZxmir4LSW2p950IZYzmM4pUkmnjh1zINuyHyx3LdVwGZTy2FFwlU7vE2i2aqP3JeC14xkx3M+vlDm8ujZ8tvA6cW3371+0op4wIRMvl1LuFzJ7M5izm9cwWxTxWLV8NnN7tG96MKm3a+g3amO1Zl31IHT6tav4Ldy031tzXpn0nLC58jA4MV7zIhoynZf0WpZymfE68mt5LOi4amc1qWc36RDvVQxq0TM5NCX1qCI0ZRbvGpWs2RMr1xAplC35L2i0amW3p6S1Z1914dt0XhqwXdSvmNFuFcwoUIrpT6o1q+Aw4tRuWLF4cmo466e2aeQ0ZqJzJOE0I+Ay4xkt3FOw1+s2bSFyJBds2pBrlI4rUpzxoBpzXWXz6Byu32Qyppiv3EixxFHAAAAAXRSTlMAQObYZgAAEeFJREFUeNrU2v9PEmEcB/DsKIMf1HOX0xG7K5fjkDsGCIo7dgctTGPTwAltWEtA8QtFNBMhf8h+aIjFL81Mt37JP7Tnked4josWPmDi27YK8bnXfe7zPPcc80aT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AwXt6oLjwUBufDW4vuy30LJOi3EmsXUc/7wplZbU2gYeYNGGZB4BQ8GCQqc0yeLGzkF1LQxDg0iJFA0XtrD2w+AqWLirUCnZZx9TBb04BuXc3NRiZ1UyqLjaTcNn6N0R/KzFAsSICpRGYTmxBbsbLYylpbWqtx/aZ3bWkxtSskGxEyfdCwbgjR8Hj84SgcjOzk4kEjhcvwgmm8aA7o3CpQSfJwwC59AQdmJm5nHekBeAh1IBP6Dg7paTFt+vS0ubm9lD4dEwF3s1WpAuMeBnDe4aGWnxVji2xJlvMNwN+ZJnWXLrQA6DnDObi5KDSSAlsEpDcMxHYijOQKHH/iQYh8BIcOzPq3xFGSbjIMDyx6q9XvF/w2PeFWjFDVt+qc+w3ivnJuAlLXDJjll95Wr5FpaX2LJPXnC7vLB8juPBlytWn2EtZyyfScVWjHVVlEdcV6Up53NYuPT5Tg5yNSsDPT3/sRd6XH+cG+QSnXPlsp7Lpryxl+iERpfoRFGVl+dcYZfibHFJaeVlObfd1cpLcs5AmZpmn4vx/4nzn4vxN6kYjVTruSNPAAAAAElFTkSuQmCC",name:"WhatsApp",href:`https://wa.me/?text=${e}`},{icon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='33' height='32' fill='none'%3e%3crect width='32' height='32' x='.5' fill='%230077B5' rx='4'/%3e%3cpath fill='white' fill-rule='evenodd' d='M11.357 9.07c-.022-1.094-.744-1.927-1.917-1.927S7.5 7.976 7.5 9.07C7.5 10.143 8.244 11 9.395 11h.022c1.196 0 1.94-.857 1.94-1.93m0 3.216H7.5v11.571h3.857zm9.294 0c2.771 0 4.849 1.616 4.849 5.089v6.482h-4.212V17.81c0-1.52-.609-2.556-2.134-2.556-1.163 0-1.856.698-2.16 1.374-.112.242-.14.579-.14.917v6.313h-4.211s.055-10.244 0-11.305h4.212v1.601c.559-.77 1.56-1.867 3.796-1.867' clip-rule='evenodd'/%3e%3c/svg%3e",name:"LinkedIn",href:`https://www.linkedin.com/sharing/share-offsite/?url=${e}`}],ShareBox=({className:e,trackingCategory:t="Together",style:a,shareUrl:n,title:l})=>{let{action:{pushNotifications:o},data:{env:{isMarryBaby:i}}}=(0,m.useContext)(u.T),{t:r}=(0,F.u)(),s=(0,m.useRef)(null),[d,c]=(0,m.useState)(!1),copyToClipboard=()=>{if(!(null==s?void 0:s.current))return;let e=document.createElement("textarea");e.value=s.current.value,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),s.current.focus(),c(!0),o({title:"",message:r("share.linkCopied"),type:"success"})};(0,m.useEffect)(()=>{copyToClipboard(),navigator.share&&navigator.share({title:l||"Read This Post",url:n}).then(()=>{o({title:"",message:r("share.linkShared"),type:"success"})}).catch(console.error)},[]);let g=getSocialList(n||"",i);return m.createElement(tr,{"data-is-marrybaby":i,className:e,style:a},m.createElement("div",{className:"share__social"},g.map((e,a)=>m.createElement(ti,{key:a,"data-event-category":t,"data-event-action":`Social Share - ${e.name}`,"data-event-label":n,href:e.href,target:"_blank",rel:"noreferrer"},m.createElement($.I,{alt:`share to ${e}`,src:e.icon}),m.createElement(p.T,{className:"__label",size:"label2",weight:"regular"},e.name)))),m.createElement("div",{className:"share__copy-link"},m.createElement(p.T,{className:"__label",color:U.t.colors.gray500,size:"p4",weight:"regular"},r("orCopyLink")),m.createElement("div",{className:"__input-group"},m.createElement("input",{ref:s,type:"text",value:n,readOnly:!0,onFocus:e=>e.target.select()}),m.createElement("button",{className:"__copy",onClick:()=>copyToClipboard()},i?m.createElement($.I,{alt:"copy share link",src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cg fill='%233e3f58'%3e%3cpath d='m19.726 8.537-.632.151zm0 4.65-.632-.151zm-9.097-8.918.146.633zm4.744 0-.146.633zm1.303 11.983a.65.65 0 1 0 .649 1.126zM6.041 7.23a.65.65 0 0 0 1.182.541zm13.053 1.459a9.34 9.34 0 0 1 0 4.348l1.264.303a10.6 10.6 0 0 0 0-4.953l-1.264.303zm-8.32-3.786a9.94 9.94 0 0 1 4.452 0l.291-1.267a11.24 11.24 0 0 0-5.035 0zm4.452 0c1.925.443 3.419 1.913 3.867 3.786l1.264-.303c-.566-2.363-2.445-4.199-4.84-4.75zm2.099 12.476a6.39 6.39 0 0 0 3.033-4.04l-1.264-.303a5.1 5.1 0 0 1-2.418 3.217zM10.482 3.636A6.47 6.47 0 0 0 6.04 7.23l1.182.541a5.17 5.17 0 0 1 3.551-2.868z'/%3e%3cpath d='m3.274 16.187-.632.151zm0-4.65-.632-.151zm13.451 0-.632.151zm0 4.65.632.151zm-4.354 4.268-.146-.633zm-4.744 0-.146.634zm0-13.186.146.633zm4.744 0-.146.633zm-8.465 8.767a9.34 9.34 0 0 1 0-4.348l-1.264-.303a10.6 10.6 0 0 0 0 4.953l1.264-.303zm12.187-4.348a9.34 9.34 0 0 1 0 4.348l1.264.303a10.6 10.6 0 0 0 0-4.953l-1.264.303zm-3.867 8.133a9.94 9.94 0 0 1-4.452 0l-.291 1.267a11.24 11.24 0 0 0 5.035 0l-.291-1.267zM7.774 7.903a9.94 9.94 0 0 1 4.452 0l.291-1.267a11.24 11.24 0 0 0-5.035 0l.291 1.267zm0 11.919c-1.925-.443-3.419-1.913-3.867-3.786l-1.264.303c.565 2.363 2.445 4.199 4.84 4.75zm4.744 1.267c2.395-.551 4.275-2.387 4.84-4.75l-1.264-.303c-.448 1.872-1.942 3.343-3.867 3.786zm-.291-13.186c1.925.443 3.419 1.913 3.867 3.785l1.264-.303c-.566-2.363-2.445-4.199-4.84-4.75l-.291 1.267zM7.482 6.636c-2.395.551-4.275 2.387-4.84 4.75l1.264.303c.448-1.872 1.942-3.343 3.867-3.785l-.291-1.267zM12.268 21l.083-2.523c.079-.573.221-.867.433-1.075l-.91-.928c-.499.489-.712 1.104-.811 1.827-.096.702-.095 1.596-.095 2.699zm4.205-5.409c-1.126 0-2.035-.001-2.748.093-.731.096-1.354.303-1.85.79l.91.928c.214-.21.519-.352 1.11-.43.609-.08 1.416-.082 2.579-.082z'/%3e%3c/g%3e%3cpath stroke='%233e3f58' stroke-linecap='round' stroke-width='1.3' d='M7 11h3m-3 3h5'/%3e%3c/svg%3e"}):r(d?"copied":"copy")))))},SharePopup=({trackingCategory:e,className:t,style:a,url:n,avatar:l,text:o,onClose:i})=>{let{data:{env:{isMarryBaby:r}}}=(0,m.useContext)(u.T),{t:s}=(0,F.u)(),[d,c]=(0,m.useState)(!1);return(0,m.useEffect)(()=>((0,q.t)(!0),setTimeout(()=>c(!0),0),()=>(0,q.t)(!1)),[]),m.createElement(I.h,null,m.createElement(ts,{"data-is-marrybaby":r,className:t,style:a},m.createElement(PopupFrame,{className:"share-popup",isOpen:d,onClose:i,heading:s("bottomBar.share")},r?m.createElement(p.T,{className:"share-mb-text",size:"sm"},s("article.shareOn")):m.createElement("div",{className:"custom-share__header"},l&&m.createElement("div",{className:"custom-share__header-image"},m.createElement("img",{src:l,loading:"lazy"})),m.createElement("div",{className:"custom-share__header-info"},m.createElement(et.H,{tag:"h4"},o),m.createElement(p.T,{className:"desc",size:"md"},n))),d&&m.createElement(ShareBox,{trackingCategory:e,shareUrl:n||("undefined"!=typeof window?window.location.href:""),title:o}))))},ts=el.Z.div` .share-popup { > div:first-child { height: unset; } .close-button { display: none; } .popup-content .header { display: none; } } .custom-share__header { display: flex; flex-wrap: no-wrap; align-items: center; padding: 1rem; border-bottom: 1px solid ${U.t.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'] { ${q.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; } } } `,td=el.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 tc="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:a,reasonText:n,onClose:l,postId:o})=>{let{data:{locale:i,env:{isMarryBaby:r}},action:{pushNotifications:s}}=(0,m.useContext)(u.T),{t:d}=(0,F.u)(),[c,v]=(0,m.useState)(!1);return m.createElement(td,{"data-is-marrybaby":r,className:e,style:t},m.createElement("ul",{className:"report-list"},m.createElement("li",{className:"report-item"},m.createElement("img",{src:tc,loading:"lazy"}),m.createElement(p.T,{className:"__label",color:U.t.colors.gray800,size:"p4"},n))),m.createElement(ee.B,{theme:r?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:c,onClick:()=>(0,g.a)(void 0,void 0,void 0,function*(){if(o&&!c){v(!0);try{let e=yield reportPost({id:o,reason:a,locale:i});(null==e?void 0:e.status)===1&&(s({message:"Post reported",type:"success"}),l&&l())}catch(e){}v(!1)}})},d("submit")))},tm=el.Z.div` padding: 0.5rem 1rem 1rem; line-height: 1.5; word-break: break-word; .post-content-replying { margin-right: 5px; cursor: pointer; display: inline-block; &.tag-only { margin-right: 0; } } .post-content { display: inline; white-space: pre-wrap; /* > *:first-child, */ > mention:first-child ~ * { &:not(ul), &:not(ol) { display: inline-block; } } > mention:first-child { margin-right: 5px; } &.has-see-more { *:last-child { &:not(ul), &:not(ol) { display: inline; } } } img { width: 100%; height: unset; } ul, ol { list-style-position: inside; padding-left: 1rem; display: block; } ol { list-style-type: decimal; } ul { list-style-type: disc; } mention { color: ${e=>e.mentionColor||"#1890ff"}; padding-right: 4px; :hover { text-decoration: underline; } } } `;var tp=(0,S.k)(e=>({root:{mention:{color:e.fn.primaryColor()},a:{"&,&:visited,&:focus":{color:e.fn.primaryColor()}},".create-post-link":{display:"inline",color:e.fn.primaryColor(),cursor:"pointer"}}}));let PostContent=e=>{var{trackingCategory:t,url:a,className:n,style:l,replyingTo:o,mentionedUser:i,description:r,disableShortenContent:s,mentions:d=[],maxChars:c=1e3,hideShowAllBtn:p,styles:v,onClickCreatePostLink:h}=e,f=(0,g._)(e,["trackingCategory","url","className","style","replyingTo","mentionedUser","description","disableShortenContent","mentions","maxChars","hideShowAllBtn","styles","onClickCreatePostLink"]);let{classes:b,theme:x}=tp(void 0,{name:"PostContent",styles:v}),[y,w]=(0,m.useState)(!1),{t:E}=(0,F.u)(),{authActionWrapper:k}=useTogetherAuthRequiredAction(),[C,A]=(0,m.useState)(!1),N=decodeMention(decodePostUrl(r||"","display"),d),{action:{sanitizeFunction:P}}=(0,m.useContext)(u.T),T=(0,m.useMemo)(()=>{let e=P(N||"");if(s||y)return{showContent:e,hasSeeMore:!1};let t=e.slice(0,c),a=c-((t.match(/<\/div>/g)||[]).length-1)*27,n=(t||"").slice(0,a<40?40:a),l=P(n.replace(/(<|<\/)( +|[a-zA-Z]*)$/gi,"")),o=l.length{e.preventDefault(),null==h||h()};return(0,m.useEffect)(()=>{var e;return null===(e=null==M?void 0:M.current)||void 0===e||e.querySelectorAll("[data-create-post]").forEach(e=>{e.addEventListener("click",handleCreatePostClick,{passive:!0})}),()=>{var e;null===(e=null==M?void 0:M.current)||void 0===e||e.querySelectorAll("[data-create-post]").forEach(e=>{e.removeEventListener("click",handleCreatePostClick,!1)})}},[s,y,N]),m.createElement(m.Fragment,null,z&&m.createElement(PopupExpert,{isOpen:C,onClose:()=>A(!1),expertId:String(null==i?void 0:i.partnerId)}),m.createElement(tm,Object.assign({ref:M,className:`${b.root} ${n} no-replace-click`,style:l,mentionColor:x.fn.primaryColor()},f),S&&m.createElement(R.e,{onClick:()=>z&&A(!0),className:"post-content-replying"},"@",S),(null==r?void 0:r.startsWith("[mention+id="))&&m.createElement("span",{className:"post-content-replying tag-only",style:{color:x.fn.primaryColor()}},"@"),m.createElement("span",{dangerouslySetInnerHTML:{__html:T.showContent},className:`post-content ${T.hasSeeMore?"has-see-more":""}`}),T.hasSeeMore&&!y&&m.createElement("span",null,"... ",!p&&m.createElement(R.e,Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),k(()=>w(!0))},className:"see-more-text"},t?{"data-event-category":t,"data-event-action":"See More Post Click","data-event-label":a}:{}),E("post.seeMore")))))},tu=el.Z.div` padding: 14px 16px 14px 17px; background: ${e=>e.bgColor}; border-left: 3px solid ${e=>e.highlight}; ${q.M.mbUp} { padding: 12px 12px 12px 17px; } `,tg=el.Z.div` display: flex; `,tv=el.Z.div` font-size: 12px; line-height: 18px; &[data-has-icon='true'] { margin-left: 10px; } `,th=el.Z.div` flex-shrink: 0; `,tf=el.Z.div` display: grid; grid-gap: 3px; grid-template-columns: 1fr 1fr; grid-template-rows: auto; .img-wrapper { position: relative; overflow: hidden; width: 100%; padding-top: 56.25%; grid-column: auto; & > img { cursor: zoom-in; } .img-preview-blur { position: absolute; top: 50%; left: 50%; width: 110%; height: 110%; /* Add the blur effect */ -webkit-filter: blur(8px); filter: blur(8px); object-fit: cover; object-position: center; opacity: 0.8; transform: translate(-50%, -50%); } .img-preview { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; } .img-more-overlay { position: absolute; top: 0; left: 0; display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.5); z-index: 4; } } &[data-image-count='1'] { .img-wrapper { /* padding-top: 100%; */ grid-column: 1/3; } } &[data-image-count='2'] { .img-wrapper { /* padding-top: 100%; */ } } &[data-image-count='3'] { .img-wrapper { &:first-child { grid-column: 1/3; } } } &[data-image-count='4'] { .img-wrapper { /* padding-top: 100%; */ } } &[data-image-count='5'] { grid-template-columns: repeat(6, 1fr); .img-wrapper { /* padding-top: 100%; */ grid-column: auto/ span 2; &:first-child { padding-top: 56.25%; grid-column: 1/4; } &:nth-child(2) { padding-top: 56.25%; grid-column: 4/7; } } } &[data-is-marrybaby='true'] { grid-gap: 8px; .img-wrapper { padding-top: 66.66%; border-radius: 1rem; .img-preview { object-fit: cover; } } &[data-image-count='3'] { grid-template-columns: 1fr 1fr 1fr; .img-wrapper { &:first-child { padding-top: 100%; grid-column: 1/3; grid-row: 1/3; } } } } `,tb=el.Z.div` position: fixed; z-index: 999; top: 0; left: 0; display: flex; overflow: hidden; width: 100vw; height: 100vh; flex-direction: column; background: white; opacity: 0; pointer-events: none; transition: opacity 0.2s linear; &[data-open='true'] { opacity: 1; pointer-events: auto; } .top-bar { position: relative; padding: 20px 40px; .icon-arrow-left { position: absolute; top: 50%; left: 20px; height: 24px; width: 24px; cursor: pointer; transform: translateY(-50%); } } .container { flex: 1; overflow-y: auto; .img-preview { width: 100%; min-width: 100%; margin-bottom: 0.5rem; cursor: pointer; max-height: 100%; object-fit: cover; } } `,tx=(0,el.Z)(e=>{var{icon:t,bgColor:a=U.t.colors.yellow50,highlightColor:n=U.t.colors.yellow800,message:l}=e,o=(0,g._)(e,["icon","bgColor","highlightColor","message"]);return m.createElement(tu,Object.assign({bgColor:a,highlight:n},o),m.createElement(tg,null,t&&m.createElement(th,null,t),m.createElement(tv,{"data-has-icon":!!t},l)))})` margin-bottom: 16px; `,ImagePreviewPopup=({className:e,style:t,authorName:a,images:n,onClose:l,onOpenSingleView:o,alt:i})=>{let{t:r}=(0,F.u)(),[s,d]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{setTimeout(()=>{d(!0)},0)},[]),m.createElement(I.h,null,m.createElement(tb,{className:e,style:t,"data-open":s},m.createElement("div",{className:"top-bar"},m.createElement("img",{className:"icon-arrow-left",src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='25' fill='none'%3e%3cpath stroke='%23262626' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M10.05 18.06 4 12.038l6.05-6.025M4.002 12.035h15'/%3e%3c/svg%3e",onClick:l,alt:"go back",loading:"lazy"}),m.createElement(p.T,{size:"p2",weight:"bold",style:{textAlign:"center"}},r("previewPhotos.title",{name:a}))),m.createElement("div",{className:"container"},n.map((e,t)=>m.createElement("img",{className:"img-preview",key:t,src:e,onClick:()=>null==o?void 0:o(t),alt:i,loading:"lazy"})))),",")},ty=el.Z.div` position: fixed; z-index: 999; top: 0; left: 0; display: flex; width: 100%; height: 100%; flex-direction: column; background: black; opacity: 0; pointer-events: none; transition: opacity 0.2s linear; &[data-open='true'] { opacity: 1; pointer-events: auto; } `,tw=el.Z.div` padding: 1rem; background: white; .icon-close { width: 26px; height: 26px; cursor: pointer; } `,tE=el.Z.div` position: relative; flex: 1; overflow: hidden; > img { height: 100%; width: 100%; object-fit: contain; object-position: center; } `,tk=el.Z.div` --inner-padding: max(16px, 20%); height: 100%; position: absolute; left: 0; padding: 8px; padding-right: var(--inner-padding); display: flex; align-items: center; top: 0; cursor: pointer; &[data-right] { padding-right: 8px; padding-left: var(--inner-padding); left: unset; right: 0; } &[data-disabled='true'] { cursor: not-allowed; } `,tC=el.Z.div` border-radius: 50%; background: rgba(0, 0, 0, 0.3); display: flex; align-items: center; justify-content: center; padding: 4px; > img { width: 16px; height: 16px; &[data-disabled='true'] { opacity: 0.5; } } ${q.M.tdUp} { padding: 8px; > img { width: 30px; height: 30px; } } `;var tA="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='m6 12.813 4-4-4-4'/%3e%3c/svg%3e";let PostSingleImageViewPopup=({initialViewIndex:e,images:t,onClose:a,alt:n})=>{let[l,o]=(0,m.useState)(e),[i,r]=(0,m.useState)(!1);(0,m.useEffect)(()=>{setTimeout(()=>{r(!0)},0)},[]);let s=null==t?void 0:t[l],d=0===l,c=!(null==t?void 0:t.length)||l===(null==t?void 0:t.length)-1;return m.createElement(I.h,null,m.createElement(ty,{"data-open":i&&!!s},m.createElement(tw,null,m.createElement("img",{src:tn,className:"icon-close",onClick:a,alt:"close",loading:"lazy"})),s&&l>=0&&m.createElement(m.Fragment,null,m.createElement(tE,null,m.createElement("img",{className:"img-preview",src:s,alt:n,loading:"lazy"}),m.createElement(tk,{"data-disabled":d,onClick:()=>!d&&o(l-1)},m.createElement(tC,null,m.createElement("img",{src:tA,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":d,loading:"lazy"}))),m.createElement(tk,{"data-right":!0,"data-disabled":c,onClick:()=>!c&&o(l+1)},m.createElement(tC,null,m.createElement("img",{src:tA,alt:"right arrow","data-disabled":c,loading:"lazy"})))))))},tN=(0,u.s)(el.Z.div` position: absolute; top: 0; right: 0; left: 0; bottom: 0; background: rgba(0, 0, 0, 0.4); color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; `,"hhgcomp-sensitivemask-inner"),tP=el.Z.div``,tT=el.Z.div` position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; z-index: 3; background: white; cursor: pointer; &, * { // transition: all 300ms; transform-origin: bottom left; } img { transition: none; } .img-preview { width: 100%; } &[data-is-blurred='true'] { .img-preview { /* Add the blur effect */ -webkit-filter: blur(24px); filter: blur(24px); } } &[data-is-blurred='false'] { background: transparent; cursor: zoom-in; ${tN.classSelector} { top: auto; right: auto; left: 8px; bottom: 8px; background: rgba(0, 0, 0, 0); align-items: flex-end; justify-content: flex-start; } } `,SensitiveMask=({image:e,showIcon:t=!0})=>{let[a,n]=(0,m.useState)(!0);return m.createElement(tT,{"data-is-blurred":a,onClick:e=>a&&e.stopPropagation()},m.createElement("img",{loading:"lazy",className:"img-preview",src:e}),m.createElement(tN,{onClick:e=>{e.stopPropagation(),n(!a)}},t&&m.createElement(tP,null,a?m.createElement("svg",{width:"22",height:"20",viewBox:"0 0 22 20",fill:"none"},m.createElement("path",{d:"M1.71 2.54a.996.996 0 0 1 0-1.41c.39-.39 1.03-.39 1.42 0l16.31 16.33a.996.996 0 1 1-1.41 1.41l-2.72-2.72c-1.34.52-2.79.82-4.31.82-5 0-9.27-3.11-11-7.5C.77 7.5 2.06 5.8 3.68 4.51zM16 9.47c0-2.76-2.24-5-5-5-.51 0-1 .1-1.47.24L7.36 2.54c1.15-.37 2.37-.57 3.64-.57 5 0 9.27 3.11 11 7.49-.69 1.76-1.79 3.3-3.18 4.53l-3.06-3.06c.14-.46.24-.95.24-1.46m-5 5c-2.76 0-5-2.24-5-5 0-.77.18-1.5.49-2.14L8.06 8.9c-.03.18-.06.37-.06.57 0 1.66 1.34 3 3 3 .2 0 .38-.03.57-.07l1.57 1.57c-.65.32-1.37.5-2.14.5m2.97-5.33a2.97 2.97 0 0 0-2.64-2.64z",fill:"#fff"})):m.createElement("svg",{width:"23",height:"16",viewBox:"0 0 23 16",fill:"none"},m.createElement("path",{d:"M12 0C5.142 0 1.886 5.879 1.096 7.557c-.132.28-.132.604 0 .884C1.886 10.121 5.142 16 12 16c6.834 0 10.092-5.837 10.896-7.54a1.08 1.08 0 0 0 0-.92C22.092 5.836 18.834 0 12 0m0 3a5 5 0 1 1-.001 10.001 5 5 0 0 1 0-10.001m0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6",fill:"#2D87F3"})))))},PostImagePreview=({className:e,images:t=[],style:a,authorName:n,isSensitive:l=!1,alt:o})=>{let{data:{env:{isMarryBaby:i}}}=(0,m.useContext)(u.T),{t:r}=(0,F.u)(),s=`+ ${(t.length||0)-4}`,[d,c]=(0,m.useState)(!1),[p,g]=(0,m.useState)(-1),v=t.length>5,h=(0,m.useRef)(!1);return(0,m.useEffect)(()=>()=>{h.current&&(0,q.t)(!1)},[]),(0,m.useEffect)(()=>{d||p>=0?((0,q.t)(!0),h.current=!0):((0,q.t)(!1),h.current=!1)},[d,p]),m.createElement(m.Fragment,null,l&&m.createElement(tx,{message:r("sensitiveMask.contentWarningDescription"),icon:m.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},m.createElement("path",{d:"M9 .667A8.336 8.336 0 0 0 .667 9c0 4.6 3.733 8.333 8.333 8.333S17.333 13.6 17.333 9 13.6.667 9 .667m0 9.166A.836.836 0 0 1 8.167 9V5.667c0-.459.375-.834.833-.834s.833.375.833.834V9A.836.836 0 0 1 9 9.833M8.167 11.5v1.667h1.666V11.5z",fill:"#FE921D"}))}),m.createElement(tf,{className:e,style:a,"data-image-count":v?5:t.length||0,"data-is-marrybaby":i,"data-cursor-pointer":!l},null==t?void 0:t.slice(0,5).map((e,t)=>{let a=4===t&&v;return m.createElement("div",{className:"img-wrapper",key:t,onClick:()=>{t>=4&&v?c(!0):g(t)}},l&&m.createElement(SensitiveMask,{image:e,showIcon:!a}),!i&&m.createElement("img",{loading:"lazy",className:"img-preview-blur",src:e,alt:o}),m.createElement("img",{loading:"lazy",className:"img-preview",src:e,alt:o}),a&&m.createElement("div",{className:"img-more-overlay"},m.createElement(et.H,{tag:"h1",as:"h2",color:"white"},s)))})),d&&m.createElement(ImagePreviewPopup,{authorName:n||"",images:t,onClose:()=>c(!1),onOpenSingleView:g,alt:o}),p>=0&&m.createElement(PostSingleImageViewPopup,{images:t,initialViewIndex:p,onClose:()=>g(-1),alt:o}))},tS=el.Z.div` .link-info-container { padding: 0.5rem 1rem; background: ${e=>e.color||"#f4faff"}; } .link-image-wrapper { position: relative; overflow: hidden; width: 100%; padding-top: 56.25%; &.fetching { background: lightgray; } .loading-spinner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .link-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; } } a { text-decoration: none; } &[data-is-marrybaby='true'] { overflow: hidden; border-radius: 1rem; } `,SocialLinkPreview=({url:e,image:t,className:a,style:n,baseUrl:l="",autoPlay:o=!0})=>{let{data:{locale:i}}=(0,m.useContext)(u.T),[r,s]=(0,m.useState)(null);(0,m.useEffect)(()=>{(0,g.a)(void 0,void 0,void 0,function*(){if(!t){if(!e)return s(null);s(e=>Object.assign(Object.assign({},e),{isFetching:!0})),(0,u.i)((0,u.g)(u.P.FETCH_PREVIEW,{_locale:i},void 0,l),"POST",{data:{link:e},headers:{"Content-Type":"application/json"}},!!l).then(t=>{var a,n;s({url:e,image:(null===(a=null==t?void 0:t.data)||void 0===a?void 0:a.image)||(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.logo)})}).catch(()=>{s(null)})}})},[e,t]);let d=t||(null==r?void 0:r.image),c=(null==r?void 0:r.url)||e,p=(0,m.useMemo)(()=>youtubeVidIdGetter(c),[c]),v=(0,m.useMemo)(()=>c.includes("facebook.com")||c.includes("fb.watch"),[c]),h=(0,m.useRef)(0),f=(0,m.useRef)(0),[b,x]=(0,m.useState)(!1);(0,m.useEffect)(()=>{let handleResize=()=>{var e;let t=null===(e=y.current)||void 0===e?void 0:e.getBoundingClientRect(),a=!1;t&&(!h.current||Math.abs((h.current-t.width)/(null==t?void 0:t.width))>.2)&&(h.current=Math.floor(t.width),a=!0),t&&(!f.current||Math.abs((f.current-t.height)/(null==t?void 0:t.height))>.2)&&(f.current=Math.floor(t.height),a=!0),a&&x(e=>!e)};return handleResize(),window.addEventListener("resize",handleResize,{passive:!0}),()=>{window.removeEventListener("resize",handleResize)}},[]);let y=(0,m.useRef)(null),w=(0,P.rZ)();return m.createElement(tS,{className:`${a} no-replace-click`,style:n,ref:y,color:w.colors[w.primaryColor][0]},!t&&(p||v)?m.createElement("div",{className:"link-image-wrapper"},p?m.createElement("iframe",{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${p}?&autoplay=${o?1:0}&mute=1&enablejsapi=1`,frameBorder:"0",allowFullScreen:!0,style:{position:"absolute",top:0,left:0,border:"none",overflow:"hidden"},loading:"lazy"}):v?m.createElement("iframe",{key:String(b),src:`https://www.facebook.com/plugins/video.php?href=${encodeURIComponent(c)}&autoplay=${o?1:0}&show_text=false&t=0&width=${h.current}&height=${f.current}`,style:{position:"absolute",top:"50%",left:"50%",border:"none",overflow:"hidden",height:f.current,width:h.current,transform:"translate(-50%, -50%)"},scrolling:"no",frameBorder:"0",allowFullScreen:!0,allow:"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share",loading:"lazy"}):null):m.createElement("a",{href:c,target:"_blank",rel:"noreferrer"},m.createElement("div",{className:`link-image-wrapper ${(null==r?void 0:r.isFetching)?"fetching":""}`},(null==r?void 0:r.isFetching)?m.createElement(Loading$1,{className:"loading-spinner"}):m.createElement($.I,{className:"link-image",src:d||u.n,backupSrc:u.n,alt:c}))))},Loading=({className:e,size:t="md"})=>{let{t:a}=(0,F.u)();return m.createElement("div",{className:`PD6nRZX ${e}`},m.createElement(ee.B,{size:t,color:"transparent",isLoading:!0},a("loading")))},CategoryText=({children:e,className:t=""})=>m.createElement("div",{className:`l5fL1xL ${t}`},e),Title=({children:e,className:t=""})=>m.createElement("div",{className:`L-aGKo7 ${t}`},e),Thumbnail=({src:e,defaultSrc:t=W.C.getAssetPath("logo/logomark.png"),ratio:a=1,size:n=80,radius:l=8,alt:o,className:i=""})=>m.createElement("div",{className:i},m.createElement("div",{className:"DZmf3s7",style:{width:`${n}px`,height:`${n*a}px`,borderRadius:`${l}px`}},m.createElement($.I,{src:e,backupSrc:t,alt:o}))),CardArticle=({category:e,title:t,src:a,children:n,className:l=""})=>m.createElement("div",{className:`eaR8ATZ ${l}`},m.createElement(Thumbnail,{src:a}),m.createElement("div",{className:"xM-7K0a"},n||m.createElement("div",null,e&&m.createElement(CategoryText,null,e),t&&m.createElement(Title,null,t))));CardArticle.CategoryText=CategoryText,CardArticle.Title=Title;let ArticleCard=({featureImage:e,postTitle:t,author:a,categories:n,isReview:l,className:o=""})=>{var i;return m.createElement(CardArticle,{src:e,className:o},m.createElement(m.Fragment,null,m.createElement(CardArticle.CategoryText,null,null===(i=null==n?void 0:n[0])||void 0===i?void 0:i.name),m.createElement(CardArticle.Title,null,t),m.createElement(CardAuthor$1,{avatarProps:Object.assign(Object.assign({},a),{size:32}),subTitle:m.createElement(m.Fragment,null,l?"Medically reviewed by Jobelle Ann Dela Cruz Bigalbal, MD":"Written by Jobelle Ann Dela Cruz Bigalbal, MD",m.createElement(CardAuthor$1.SubDivider,null),"Dec 12, 2022")})))};var tz={container:"SFSgnOz",header:"Tf3aoVa",heading:"TOt4QXl",headingIcon:"_5XYN1KT",accBodyGroup:"yE-tZRj",accBodyGroupItem:"LXiGuGT",accBodyGroupDesc:"r4rx-6v",subTitle:"XrHh8-C",subIcon:"c5-Yecd",group:"UBj6nWr",groupBody:"_2vptVBd",articleCardLink:"ZPDAwiR",relatedList:"_6wJn-NR",socialItem:"_21XDdFv",mbChevronWrapper:"LSyr3Zo"};let tM=(0,m.createContext)({}),About=({className:e=""})=>{var t,a,n,l,o;let{t:i}=(0,F.u)(),{info:r,isMarryBaby:s,currentPageUrl:d}=(0,m.useContext)(tM),c=null==r?void 0:r.data,p=[{type:"linkedin",icon:W.C.getAssetPath("linkedin.svg"),url:null===(t=null==r?void 0:r.contact)||void 0===t?void 0:t.linkedin,eventAction:"Doctor Profile - Linkedin"},{type:"instagram",icon:W.C.getAssetPath("instagram.svg"),url:null===(a=null==r?void 0:r.contact)||void 0===a?void 0:a.instagram,eventAction:"Doctor Profile - Instagram"},{type:"facebook",icon:W.C.getAssetPath("facebook.svg"),url:null===(n=null==r?void 0:r.contact)||void 0===n?void 0:n.facebook,eventAction:"Doctor Profile - Facebook"},{type:"youtube",icon:W.C.getAssetPath("youtube.svg"),url:null===(l=null==r?void 0:r.contact)||void 0===l?void 0:l.youtube,eventAction:"Doctor Profile - Youtube"},{type:"tiktok",icon:W.C.getAssetPath("tiktok.svg"),url:null===(o=null==r?void 0:r.contact)||void 0===o?void 0:o.tiktok,eventAction:"Doctor Profile - TikTok"}],u=[...((null==r?void 0:r.experiences)||[]).length>0?[{key:"experience",heading:i("profilePanel.experience"),iconSrc:W.C.getAssetPath(s?"award-doc-mb.svg":"award-doc.svg"),eventAction:"Doctor Experience Click",panel:m.createElement("div",{className:tz.accBodyGroup},null==r?void 0:r.experiences.map((e,t)=>m.createElement("div",{className:tz.accBodyGroupItem,key:String(t)},m.createElement("div",{className:tz.accBodyGroupTitle},e.title),m.createElement("div",{className:tz.accBodyGroupDesc},m.createElement("p",null,e.organization),m.createElement("p",null,e.duration)))))}]:[],...((null==r?void 0:r.educations)||[]).length>0?[{key:"education",heading:i("profilePanel.education"),iconSrc:W.C.getAssetPath(s?"book-mb.svg":"book.svg"),eventAction:"Doctor Degree Click",panel:m.createElement("div",{className:tz.accBodyGroup},null==r?void 0:r.educations.map((e,t)=>m.createElement("div",{className:tz.accBodyGroupItem,key:String(t)},m.createElement("div",{className:tz.accBodyGroupTitle},e.schoolName),m.createElement("div",{className:tz.accBodyGroupDesc},m.createElement("p",null,e.study),m.createElement("p",null,e.completedYear)))))}]:[],...((null==r?void 0:r.awards)||[]).length>0?[{key:"awards",heading:i("profilePanel.awards"),iconSrc:W.C.getAssetPath(s?"award-mb.svg":"award.svg"),eventAction:"Doctor Award Click",panel:m.createElement("div",{className:tz.accBodyGroup},null==r?void 0:r.awards.map((e,t)=>m.createElement("div",{className:tz.accBodyGroupTitle,key:t},e.title)))}]:[]],g=(null==r?void 0:r.relatedPosts)||[],v=p.filter(e=>e.url);return m.createElement("div",{className:`${tz.container} ${e}`,"data-is-marrybaby":s},u.length>0&&m.createElement(O.U,{defaultValue:u[0].key,chevron:s?m.createElement("div",{className:tz.mbChevronWrapper},m.createElement(J.Z,{size:12,color:U.t.mbColors.midGray})):m.createElement(J.Z,{color:U.t.colors.gray400}),styles:{chevron:{"&[data-rotate]":{".minus-path":{display:"block"},".plus-path":{display:"none"}}},content:{display:"flex",flexDirection:"column",gap:"16px",padding:"0"},item:{border:0},control:{paddingLeft:0,"&:hover":{background:"transparent"},"*":{pointerEvents:"none"}}}},u.map(e=>m.createElement(O.U.Item,{key:e.key,value:e.key},m.createElement(O.U.Control,{"data-event-category":"Together","data-event-action":e.eventAction,"data-event-label":d},m.createElement("div",{className:tz.header},m.createElement("div",{className:tz.headingIcon},m.createElement("img",{src:e.iconSrc,loading:"lazy"})),m.createElement("div",{className:tz.heading},e.heading))),m.createElement(O.U.Panel,null,e.panel)))),g.length>0&&m.createElement("div",{className:tz.group},m.createElement("div",{className:tz.subTitle},m.createElement("img",{className:tz.subIcon,src:W.C.getAssetPath(s?"mb-logo.svg":"logo/circle-solid.svg"),loading:"lazy"}),i("profilePanel.publishedArticles")),m.createElement("div",{className:`${tz.relatedList}`},null==r?void 0:r.relatedPosts.map(e=>m.createElement("a",{key:String(e.id),href:`${window.location.origin}${null==e?void 0:e.permalink}`,className:tz.articleCardLink},m.createElement(ArticleCard,Object.assign({className:"article-card"},Object.assign(Object.assign({},e),!e.author&&{author:{displayName:null==c?void 0:c.name,avatar:null==c?void 0:c.avatar}}),{isReview:!0})))))),v.length>0&&m.createElement("div",{className:tz.group},m.createElement("div",{className:tz.subTitle},m.createElement("img",{className:tz.subIcon,src:W.C.getAssetPath(s?"social-mb.svg":"social.svg"),loading:"lazy"}),i("profilePanel.socialLinks")),m.createElement("div",{className:tz.groupBody},m.createElement(z.k,null,p.map((e,t)=>e.url&&m.createElement("div",{className:tz.socialItem,key:t},m.createElement("a",{href:e.url,target:"_blank",rel:"noreferrer"},m.createElement("img",{src:e.icon,loading:"lazy",width:"32px","data-event-category":"Together","data-event-action":e.eventAction,"data-event-label":d}))))))))};var tj={container:"GYUElSy",question:"_3C6QpT1",questionTitle:"_9M9VYL6",community:"_1RuSyv3",questionCard:"_1IG-eEp"};let PostCard$1=({post:e,className:t=""})=>{var a,n,l,o,i,r,s,d;let{t:c}=(0,F.u)(),{data:{userInfo:p,env:{togetherBasePath:g}}}=(0,m.useContext)(u.T),{authActionWrapper:v,authorProps:h,currentPageUrl:f}=(0,m.useContext)(tM),x=`${window.location.origin}${g}/${null===(a=null==e?void 0:e.community)||void 0===a?void 0:a.slug}/${null==e?void 0:e.slug}/`;return m.createElement("div",{className:`${tj.container} ${t}`},m.createElement("div",{className:tj.header},m.createElement("div",{className:tj.question},c("profilePanel.question")," ",m.createElement($.A,{className:tj.questionTitle,href:"#",onClick:()=>{(null==p?void 0:p.id)||null==v||v(()=>window.location.href=x)}},"#",null==e?void 0:e.title)),m.createElement("div",{className:tj.community},null===(n=null==e?void 0:e.community)||void 0===n?void 0:n.name," - ",null==e?void 0:e.createdTime)),m.createElement("div",{className:tj.questionCard},m.createElement(CardAuthor,Object.assign({className:"card-author"},h,{role:"user",avatarIcon:m.createElement(b.Z,null),subLine:m.createElement(CardAuthor.SubTextRow,null,m.createElement(CardAuthor.SubText,null,null===(i=null===(o=null===(l=null==e?void 0:e.expertAnswer)||void 0===l?void 0:l.answer)||void 0===o?void 0:o[0])||void 0===i?void 0:i.createdTime))})),m.createElement(PostContent,{className:"post-content-wrapper",description:(null===(d=null===(s=null===(r=null==e?void 0:e.expertAnswer)||void 0===r?void 0:r.answer)||void 0===s?void 0:s[0])||void 0===d?void 0:d.content)||"",mentions:null==e?void 0:e.mentions,"data-testid":"Content of the Post"})),m.createElement($.B,{variant:"secondary","data-event-category":"Together","data-event-action":"Doctor Reply Click","data-event-label":f,size:"md",onClick:()=>{(null==p?void 0:p.id)?window.location.href=x:null==v||v(()=>window.location.href=x)}},c("profilePanel.anserwing.viewFull")))};var tI={container:"_8fd7YMs",thumb:"DomiQfw",content:"-b2qnfL"};let EmptyMessage=({message:e,buttonTxt:t,imgSrc:a,onBtnClick:n})=>{let{siteType:l,isMarryBaby:o}=(0,m.useContext)(tM);return m.createElement("div",{className:tI.container},m.createElement("div",{className:tI.thumb},m.createElement("img",{src:a||W.C.getAssetPath(o?"comments-mb.svg":"comments.svg"),loading:"lazy"})),e&&m.createElement("div",{className:tI.content},e),t&&m.createElement(ee.B,{size:"md",theme:l,color:"secondary",onClick:n},t))},Answering=({id:e})=>{let{t}=(0,F.u)(),{data:{locale:a}}=(0,m.useContext)(u.T),{authorProps:n}=(0,m.useContext)(tM),[l,o]=(0,m.useState)(null),[i,r]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{e&&(0,g.a)(void 0,void 0,void 0,function*(){var t;r(!0);let n=yield(0,u.i)((0,u.g)(u.P.USER.LIST_ANSWERS,{_locale:a,id:e}),"GET"),l=((null===(t=null==n?void 0:n.data)||void 0===t?void 0:t.replies)||[]).map(H.b);o(l),r(!1)})},[]),m.createElement("div",{className:"MrdoES3"},i?m.createElement(Loading,null):null!==l&&(l.length>0?l.map(e=>m.createElement(PostCard$1,{className:"post-card",key:e.id,post:e})):m.createElement(EmptyMessage,{message:t("profilePanel.emptyPostMess.content",{name:(null==n?void 0:n.name)||(null==n?void 0:n.username)})})))},QuestionCard=e=>{var t,a,n,l,{post:o}=e,i=(0,g._)(e,["post"]);let{data:{env:{togetherBasePath:r}}}=(0,m.useContext)(u.T);return m.createElement(m.Fragment,null,m.createElement("div",Object.assign({},i,{className:`toEutn7 ${(null==i?void 0:i.className)||""}`}),m.createElement(CardAuthor,{className:"card-author",avatar:null===(t=null==o?void 0:o.author)||void 0===t?void 0:t.avatar,name:(null===(a=null==o?void 0:o.author)||void 0===a?void 0:a.name)||(null===(n=null==o?void 0:o.author)||void 0===n?void 0:n.username),isAnonymous:!!(null==o?void 0:o.isAnonymous),subLine:m.createElement(CardAuthor.SubTextRow,null,m.createElement(CardAuthor.SubText,null,null==o?void 0:o.createdTime))}),m.createElement($.A,{href:`${window.location.origin}${r}/${null===(l=null==o?void 0:o.community)||void 0===l?void 0:l.slug}/${null==o?void 0:o.slug}/`,className:"drdisHs",rel:"noreferrer"},null==o?void 0:o.title)))};var tR={accordion:"I-uIJ6E",header:"_41WRsj2",heading:"AcOGL93",headingIcon:"JD3dWJN",chevron:"L2Q9T6m",container:"h-pSmhX"};let Care=()=>{var e,t;let{t:a}=(0,F.u)(),{data:{locale:n,userInfo:l}}=(0,m.useContext)(u.T),{onSkipQuestion:o,countValues:i,setCountValues:r}=(0,m.useContext)(tM),[s,d]=(0,m.useState)(),[c,p]=(0,m.useState)([]),[v,h]=(0,m.useState)(!1),f=null==l?void 0:l.id;(0,m.useEffect)(()=>{f&&(0,g.a)(void 0,void 0,void 0,function*(){var e;h(!0);let t=yield(0,u.d)((0,u.g)(u.P.USER.LIST_QUESTION_NEED_REPLY,{_locale:n}),"GET"),a=[],l=Object.create({});((null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.communities)||[]).filter(e=>((null==e?void 0:e.question)||[]).length>0).map(e=>{l[e.id]=e.question.map(H.b),delete e.question,a.push((0,H.a)(e))}),p(a),d(l),h(!1)})},[]);let handleSkipQuestion=({id:e,communityId:t})=>{if(e&&t&&s){let a=Object.assign(Object.assign({},s),{[t]:[...((null==s?void 0:s[t])||[]).filter(t=>t.id!==e)]}),n=0;Object.keys(a).map(e=>n+=a[e].length||0),d(a),r(Object.assign(Object.assign({},i),{total_question:n})),null==o||o(n)}};return m.createElement("div",{className:tR.container},v?m.createElement(Loading,null):(null==i?void 0:i.total_question)>0?c.length>0&&m.createElement(O.U,{className:tR.accordion,defaultValue:String((null===(t=c[null===(e=Object.keys(c))||void 0===e?void 0:e[0]])||void 0===t?void 0:t.id)||""),styles:e=>({control:{padding:"16px",border:`1px solid ${e.colors.neutral[1]}`,borderTopLeftRadius:"8px",borderTopRightRadius:"8px",'&[aria-expanded="false"]':{borderBottom:0}},chevron:{width:"32px",height:"32px"},content:{padding:0,border:`1px solid ${e.colors.neutral[1]}`,borderTop:0,borderBottom:0},label:{padding:0},item:{marginBottom:"16px"}}),chevron:m.createElement("div",{className:tR.chevron},m.createElement(k.Z,{color:U.t.colors.gray600,size:20}))},c.map(e=>{let t=s&&(null==s?void 0:s[e.id])||[];return t.length>0&&m.createElement(O.U.Item,{key:e.id,value:String(e.id)},m.createElement(O.U.Control,null,m.createElement("div",{className:tR.header},m.createElement("div",{className:tR.headingIcon},m.createElement("img",{src:e.thumbnail,loading:"lazy"})),m.createElement("div",{className:tR.heading},e.name))),m.createElement(O.U.Panel,null,m.createElement("div",{className:tR.body},t.map(e=>m.createElement(QuestionCard,{className:"question-card",key:e.id,post:e,onSkip:handleSkipQuestion})))))})):m.createElement(EmptyMessage,{message:a("profilePanel.emptyCareMess.content"),imgSrc:W.C.getAssetPath("questions.svg")}))},PostCard=({post:e,className:t=""})=>{var a;let{data:{userInfo:n,env:{togetherBasePath:l}}}=(0,m.useContext)(u.T),{t:o}=(0,F.u)(),i=(0,P.rZ)(),{authActionWrapper:r,authorProps:s}=(0,m.useContext)(tM),d=`${window.location.origin}${l}/${null===(a=null==e?void 0:e.community)||void 0===a?void 0:a.slug}/${null==e?void 0:e.slug}/`;return m.createElement("div",{className:`GA-zc-O ${t}`},m.createElement("div",{className:"IB049vj"},m.createElement("a",{"data-event-category":"Together","data-event-action":"Click Post","data-event-label":d,className:"_8I--vEV",href:d,onClick:e=>{(null==n?void 0:n.id)||(e.preventDefault(),null==r||r(()=>window.location.href=d))}}),m.createElement(CardAuthor$1,{className:"card-author",avatarProps:{avatar:null==s?void 0:s.avatar,size:32}},m.createElement(CardAuthor.MainText,{className:"A18McWD"},null==e?void 0:e.title),m.createElement(CardAuthor.SubTextRow,null,m.createElement(CardAuthor.SubText,null,null==e?void 0:e.createdTime))),m.createElement(PostContent,{className:"post-content-wrapper",description:null==e?void 0:e.description,mentions:null==e?void 0:e.mentions,maxChars:200,"data-testid":"Content of the Post",hideShowAllBtn:!0}),m.createElement(p.T,{size:"p3",color:i.fn.primaryColor()},o("post.seeMore"))))},Posts=()=>{let{t:e}=(0,F.u)(),{data:{locale:t}}=(0,m.useContext)(u.T),{authorId:a,authorProps:n,isAuthorLogin:l,onCloseFromPost:o}=(0,m.useContext)(tM),[i,r]=(0,m.useState)(null),[s,d]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{a&&(0,g.a)(void 0,void 0,void 0,function*(){var e;d(!0);let n=yield(0,u.i)((0,u.g)(u.P.USER.LIST_POST,{_locale:t,id:a,isAnonymous:0}),"GET"),l=((null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.posts)||[]).map(H.b);r(l),d(!1)})},[a]),m.createElement("div",{className:"TSMHoEM"},s?m.createElement(Loading,null):null!==i&&(i.length>0?i.map(e=>m.createElement(PostCard,{className:"post-card",key:e.id,post:e})):m.createElement(EmptyMessage,{message:e("profilePanel.emptyPostMess.content",{name:(null==n?void 0:n.name)||(null==n?void 0:n.username)||""}),buttonTxt:l&&e("profilePanel.createPost"),onBtnClick:()=>{null==o||o()}})))};var tO={container:"_4Vekw96",info:"DIJdGcB",body:"aQSt4-Q"};let formatExperience=e=>e?{title:null==e?void 0:e.title,organization:null==e?void 0:e.organization,duration:e.duration}:{},formatEducation=e=>e?{completedYear:null==e?void 0:e.completed_year,schoolName:e.school_name,study:e.study}:{};(o=d||(d={}))[o.About=0]="About",o[o.Care=1]="Care",o[o.Answer=2]="Answer",o[o.Posts=3]="Posts",(i=c||(c={}))[i.Expert=0]="Expert",i[i.User=1]="User";let ProfileDetail=e=>{var t,{authorProps:a,selectedTab:n,authActionWrapper:l,onSkipQuestion:o,onCloseFromPost:i,hideQuestionTab:r,hideAnswerTab:s,showSkipQuestionTag:c,rolesToShowQuestionsTab:p=["expert"],currentPageUrl:v}=e,h=(0,g._)(e,["authorProps","selectedTab","authActionWrapper","onSkipQuestion","onCloseFromPost","hideQuestionTab","hideAnswerTab","showSkipQuestionTag","rolesToShowQuestionsTab","currentPageUrl"]);let{data:{locale:f,userInfo:b,env:{isMarryBaby:x}}}=(0,m.useContext)(u.T),{t:y}=(0,F.u)(),w=null==a?void 0:a.role,E=null==b?void 0:b.role,k=String(null==a?void 0:a.userId),[C,A]=(0,m.useState)(),[N,P]=(0,m.useState)(!1),[T,S]=(0,m.useState)(),z=(null==b?void 0:b._togetherUserId)===(null==a?void 0:a.userId),M=[...-1!==p.indexOf(w)?[{value:d.About,text:y("profilePanel.tabs.highlight"),content:m.createElement(About,{id:k,info:T}),dataEventCategory:"Together",dataEventAction:"Doctor Profile Click",dataEventLabel:v}]:[],{value:d.Posts,text:y("profilePanel.tabs.posts"),content:m.createElement(Posts,null),hasCountResult:!0,keyOfCountApi:"post",keyOfResult:"total_post"},...r||-1===p.indexOf(E)||(null==b?void 0:b._togetherUserId)!==(null==a?void 0:a.userId)?[]:[{value:d.Care,text:`${y("profilePanel.tabs.care")}`,content:m.createElement(Care,null),hasCountResult:!0,keyOfCountApi:"question",keyOfResult:"total_question",dataEventCategory:"Together",dataEventAction:"Doctor Questions Click",dataEventLabel:v}],...s||-1===p.indexOf(w)?[]:[{value:d.Answer,text:`${y("profilePanel.tabs.expertAnswer")}`,content:m.createElement(Answering,{id:k}),hasCountResult:!0,keyOfCountApi:"reply",keyOfResult:"total_reply",dataEventCategory:"Together",dataEventAction:"Doctor Reply Tab Click",dataEventLabel:v}]],[j,I]=(0,m.useState)(null),[R,O]=(0,m.useState)(null),D={value:String(R),dataList:j,onTabChange:e=>O(Number(e))},B=null==M?void 0:M.filter(e=>null==e?void 0:e.hasCountResult);(0,m.useEffect)(()=>{(0,g.a)(void 0,void 0,void 0,function*(){var e,t,a,l,o,i,r,s,c,m;P(!0);let p=yield Promise.all([(0,u.i)((0,u.g)(u.P.USER.DETAIL,{_locale:f,id:k}),"GET"),...B.map(e=>(0,u.i)((0,u.g)(u.P.USER.COUNT_TABS,{_locale:f,id:k,[e.keyOfCountApi]:1}),"GET"))]),[g]=p,v={data:null==g?void 0:g.data,experiences:((null===(t=null===(e=null==g?void 0:g.data)||void 0===e?void 0:e.fields)||void 0===t?void 0:t.experiences)||[]).map(formatExperience),relatedPosts:((null===(a=null==g?void 0:g.data)||void 0===a?void 0:a.related_post)||[]).map(e=>(0,H.g)(e.post)),educations:((null===(o=null===(l=null==g?void 0:g.data)||void 0===l?void 0:l.fields)||void 0===o?void 0:o.educations)||[]).map(formatEducation),awards:(null===(r=null===(i=null==g?void 0:g.data)||void 0===i?void 0:i.fields)||void 0===r?void 0:r.awards_accreditations)||[],contact:(null===(c=null===(s=null==g?void 0:g.data)||void 0===s?void 0:s.fields)||void 0===c?void 0:c.contact)||{}};(null==g?void 0:g.status)===1&&S(v);let h=(null==v?void 0:v.relatedPosts)||[],b=Object.keys(v.contact).map(e=>{var t;return(null===(t=null==v?void 0:v.contact)||void 0===t?void 0:t[e])!==""}),x=[...(null==v?void 0:v.experiences)||[],...(null==v?void 0:v.educations)||[],...(null==v?void 0:v.awards)||[]],y=h.length>0||b.length>0||x.length>0,w={},E=B.map((e,t)=>{var a,n,l;let o=(null===(l=null===(n=null===(a=p[t+1])||void 0===a?void 0:a.data)||void 0===n?void 0:n.counting)||void 0===l?void 0:l[e.keyOfResult])||0;return o>0?(w[e.keyOfResult]=o,e):-1!==[d.Care,d.Posts].indexOf(e.value)?e:void 0}).filter(Boolean).map(e=>e.value),C=M.map(e=>{let t=Object.assign(Object.assign({},e),{text:e.text+(e.keyOfResult?` (${(null==w?void 0:w[e.keyOfResult])||"0"})`:"")});return t.hasCountResult?-1!==E.indexOf(t.value)?t:void 0:t.value===d.About?y&&t:t}).filter(Boolean);I(C),O(n||(null===(m=null==C?void 0:C[0])||void 0===m?void 0:m.value)),A(w),P(!1)})},[]);let _=null==T?void 0:T.data;return m.createElement(tM.Provider,{value:{isMarryBaby:x,siteType:x?"marryBaby":"helloSites",authorId:String((null==a?void 0:a.userId)||""),authActionWrapper:l,onSkipQuestion:o,info:T,authorProps:a,onCloseFromPost:i,countValues:C,setCountValues:A,isAuthorLogin:z,showSkipQuestionTag:c,currentPageUrl:v}},m.createElement("div",Object.assign({},h,{className:`${tO.container} ${(null==h?void 0:h.className)||""}`,"data-is-marrybaby":x}),N?m.createElement(Loading,null):m.createElement(m.Fragment,null,m.createElement(CardAuthor,Object.assign({},a,{className:"card-author",showDetailPopup:!1,subLine:(null==a?void 0:a.role)==="expert"?(null==_?void 0:_.specialty)&&(null==_?void 0:_.organisation)&&m.createElement(CardAuthor.SubTextRow,null,(null==_?void 0:_.specialty)&&m.createElement(m.Fragment,null,m.createElement(CardAuthor.SubText,null,null==_?void 0:_.specialty),m.createElement(CardAuthor.SubDivider,null)),m.createElement(CardAuthor.SubText,null,null==_?void 0:_.organisation)):(null==_?void 0:_.created_at)&&m.createElement(CardAuthor.SubTextRow,null,m.createElement(CardAuthor.SubText,null,y("profilePanel.joined")," ",ed()(null==_?void 0:_.created_at).toNow(!0)))})),"expert"===w&&m.createElement("div",{className:tO.info,dangerouslySetInnerHTML:{__html:null===(t=null==T?void 0:T.data)||void 0===t?void 0:t.description}}),null!==j&&null!==R&&(j.length>0?m.createElement("div",{className:tO.body},m.createElement($.T,Object.assign({},D))):m.createElement(EmptyMessage,{message:y("profilePanel.emptyPostMess.content",{text:(null==a?void 0:a.name)||(null==a?void 0:a.username)||""})})))))};var tD=Object.freeze({__proto__:null,get TabName(){return d},get UserType(){return c},TabDataInit:{experiences:[],relatedPosts:[],educations:[],awards:[],contact:{},data:{}},ProfileDetail:ProfileDetail}),tF="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",tB="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",t_="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",tU="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",t$="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 5.333a2 2 0 1 0 0-4 2 2 0 0 0 0 4M4 10a2 2 0 1 0 0-4 2 2 0 0 0 0 4M12 14.667a2 2 0 1 0 0-4 2 2 0 0 0 0 4M5.727 9.007l4.553 2.653M10.273 4.34 5.727 6.993'/%3e%3c/svg%3e",tL="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:n,className:l="",popoverClassName:o="",onBookmark:i,onRemoveBookmark:r,onEditPost:s})=>{let{data:{locale:d,userInfo:c,togetherUserId:p,env:{isMarryBaby:v}},action:{pushNotifications:h}}=(0,m.useContext)(u.T),{t:f}=(0,F.u)(),[b,x]=(0,m.useState)(!1),[y,w]=(0,m.useState)(!1),[E,k]=(0,m.useState)(!1),{authActionWrapper:C}=useTogetherAuthRequiredAction(),A=e&&(null==c?void 0:c.email)&&e===String(null==c?void 0:c.email);return m.createElement("div",{className:l,onClick:e=>{e.preventDefault(),e.stopPropagation()}},E&&m.createElement(SharePopup,{url:a,text:null==n?void 0:n.title,onClose:()=>k(!1)}),y&&m.createElement(PopupDanger,{thumbnail:W.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,g.a)(void 0,void 0,void 0,function*(){if((null==n?void 0:n.id)&&!b){x(!0);try{let e=yield deletePost({id:n.id,locale:d});(null==e?void 0:e.status)===1&&(null==t||t())}catch(e){}x(!1)}}),onClose:()=>w(!1)}),m.createElement(TreePopoverMenu,{className:o,toggleButtonContent:m.createElement("img",{src:v?tF:tU,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:b},data:A?{isShowheader:!1,type:"list",list:[{icon:t$,label:f("morePopover.share"),onClick:()=>k(!0)},{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:s},{icon:tL,label:f("actionPopover.delete"),onClick:()=>{C(()=>w(!0))}}]}:{isShowheader:!1,type:"list",list:[{icon:t$,label:f("morePopover.share"),onClick:()=>k(!0)},{icon:(null==n?void 0:n.bookmarked)?tB:t_,label:(null==n?void 0:n.bookmarked)?f("morePopover.unsavePost"):f("morePopover.savePost"),onClick:()=>{C(()=>(0,g.a)(void 0,void 0,void 0,function*(){if((null==c?void 0:c.id)&&(null==n?void 0:n.id)){if(null==n?void 0:n.bookmarked){let e=yield(0,u.d)((0,u.g)(u.P.BOOKMARK.DELETE,{_locale:d}),"DELETE",{data:{post_id:String(n.id)}});(null==e?void 0:e.status)===1?(h({title:"",message:"Removed saved post",type:"success",displayIcon:t_}),r&&r()):h({title:"",message:"Remove failed",type:"danger",displayIcon:t_})}else{let e=yield(0,u.d)((0,u.g)(u.P.BOOKMARK.CREATE,{_locale:d}),"POST",{data:{user_id:p||c.id,post_id:n.id}});(null==e?void 0:e.status)===1?(h({title:"",message:"Post saved",type:"success",displayIcon:tB}),i&&i()):h({title:"",message:"Post saved failed",type:"danger",displayIcon:t_})}}}))}},{icon:tc,label:f("morePopover.report"),subTree:{title:f("morePopover.report.title"),description:f("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(u.R).map(e=>({label:u.R[e].label,reason:u.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=>m.createElement(SubmitReportForm,{reason:e.reasonValue,reasonText:f(e.reason),postId:null==n?void 0:n.id,onClose:()=>t&&t(!1)})}}))}}]}}))},tV=el.Z.div` position: relative; margin-bottom: 24px; background: white; border-radius: ${U.t.borderRadius}; a { text-decoration: none; } ${q.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: ${U.t.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; ${q.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; ${q.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; ${q.M.mbDown} { width: 18px; height: 18px; } } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 1rem; } width: 350px; ${q.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%); } } ${q.M.mbDown} { margin-bottom: 12px; } } `,CardReplyPopover=({onDeleteComment:e,commentId:t,className:a="",popoverClassName:n=""})=>{let{data:{env:{isMarryBaby:l},locale:o},action:{pushNotifications:i}}=(0,m.useContext)(u.T),{t:r}=(0,F.u)(),[s,d]=(0,m.useState)(!1),{authActionWrapper:c}=useTogetherAuthRequiredAction();return m.createElement("div",{className:a,onClick:e=>{e.preventDefault(),e.stopPropagation()}},s&&m.createElement(PopupDanger,{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:r("popup.deleteComment.title"),description:r("popup.deleteComment.description"),acceptText:r("popup.deletePost.accept"),cancelText:r("popup.deletePost.cancel"),onAccept:()=>(0,g.a)(void 0,void 0,void 0,function*(){var a;if(!t)return;let n=yield deleteComment({id:t,locale:o});(null==n?void 0:n.status)===1?(e&&e(),i({title:"",message:r("notification.success"),type:"success"})):i({title:"",message:(null===(a=null==n?void 0:n.messages)||void 0===a?void 0:a[0])||r("notification.failure"),type:"danger"})}),onClose:()=>d(!1)}),m.createElement(TreePopoverMenu,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:tL,label:r("actionPopover.delete"),onClick:()=>{c(()=>{d(!0)})}}]},className:n,toggleButtonContent:m.createElement("img",{src:l?tF:tU,loading:"lazy"}),buttonProps:{}}))},tW=el.Z.div` .add-link { color: ${U.t.colors.primaryBase}; } `,tq=el.Z.div` margin: 16px 0; background: ${U.t.colors.yellow50}; padding: 5px 10px; border-radius: 2px; .icon { display: inline-block; vertical-align: middle; margin-right: 6px; } `,tZ=el.Z.div` display: flex; align-items: center; gap: 8px; `,tH=el.Z.div` padding: 8px 16px; `,tG=el.Z.div` margin-bottom: 12px; width: 100%; `,tQ=el.Z.div``,tX=el.Z.div` margin-bottom: 16px; `,tY=el.Z.div` display: flex; flex-wrap: wrap; row-gap: 16px; ${q.M.tdUp} { align-items: center; column-gap: 24px; } `,tK=el.Z.a` display: flex; align-items: center; gap: 16px; ${q.M.mbDown} { width: 100%; justify-content: space-between; } `,tJ=el.Z.div` display: flex; align-items: center; gap: 16px; `,t0=el.Z.div` border-radius: ${U.t.borderRadius}; overflow: hidden; width: 48px; height: 48px; img { object-fit: cover; width: 100%; height: 100%; } `,RecommentCategories=({categories:e})=>{let{t}=(0,F.u)(),{data:{locale:a,env:{isMarryBaby:n}}}=(0,m.useContext)(u.T),l=(0,eh.g)(a,n);return m.createElement(tQ,null,m.createElement(tX,null,m.createElement(et.H,{tag:"h6",as:"h5"},t("cardReply.recommentCategories.heading"))),m.createElement(tY,null,e.map(e=>m.createElement(tK,{href:l+e.permalink,key:String(e.termId),target:"_blank"},m.createElement(tJ,null,m.createElement(t0,null,m.createElement("img",{src:e.featureImage||W.C.getAssetPath(n?"mb-logo.svg":"/logo/logomark.png"),alt:e.displayName,loading:"lazy"})),m.createElement(p.T,{size:"s3",weight:"bold"},e.displayName)),m.createElement(C.Z,{size:20,color:U.t.colors.gray400})))))},t1=el.Z.a` padding: 12px 0; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid ${U.t.colors.neutral100}; text-decoration: none; &:first-child { border-top: 0; } `,SourceItem=({postTitle:e,articleReviewed:t,modifiedTime:a,href:n})=>{let{t:l}=(0,F.u)(),o=(()=>{let{expert:e,editor:a,is_author:n}=t;if(e){let t={name:e.display_name,role:"expert",avatar:e.avatar};return n?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 m.createElement(t1,{href:n,title:e,target:"_blank"},m.createElement(p.T,{size:"s3",as:"h5",weight:"bold"},e),m.createElement("div",null,m.createElement(CardAuthor,{avatar:null==o?void 0:o.avatar,avatarProps:{size:32},name:null==o?void 0:o.name,role:null==o?void 0:o.role,hideBackground:!0},m.createElement(CardAuthor.SubTextRow,null,m.createElement(CardAuthor.SubText,null,null==o?void 0:o.title," ",m.createElement("span",{style:{color:U.t.colors.gray800}},null==o?void 0:o.name)),m.createElement(CardAuthor.SubDivider,null),m.createElement(CardAuthor.SubText,null,a)))))};var t3={header:"F4mmgSy",chevron:"A7QrQ7A"};let t2=el.Z.div` position: relative; margin-bottom: 0; background: white; border-radius: ${U.t.borderRadius}; .verify-tag { margin-top: 12px; } .post-author { &.with-popover { padding-right: 2.6rem; } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${q.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: ${U.t.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; ${q.M.mbDown} { margin-left: 40px; } > .post-author { margin-left: -56px; ${q.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; ${q.M.mbDown} { width: 24px; height: 24px; font-size: 12px; } } } &[data-is-reply] { > .post-author { .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${q.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; ${q.M.mbDown} { padding-left: 0.5rem; } } ${q.M.mbDown} { margin-bottom: 12px; } } `,t6=(0,el.Z)(e=>{var{listUrl:t,hideSourceList:a,categorySlug:n,editMode:l,collapseSource:o,onListChange:i,isMarryBaby:r}=e,s=(0,g._)(e,["listUrl","hideSourceList","categorySlug","editMode","collapseSource","onListChange","isMarryBaby"]);let{t:d}=(0,F.u)(),[c,v]=(0,m.useState)(t||[]),[h,f]=(0,m.useState)([]),[b,x]=(0,m.useState)([]),[y,w]=(0,m.useState)(!1);(0,m.useEffect)(()=>{a||(0,g.a)(void 0,void 0,void 0,function*(){w(!0);let e=c.map(e=>{let t=new URL(e),a=String(t.pathname).split("/").filter(e=>""!=e),n=t.origin,l=-1!==n.search("marrybaby.vn");return{isMarrySite:l,path:a[a.length-1],href:e}}),t=[...e.map(e=>(0,u.i)(e.isMarrySite?(0,u.x)(u.u.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0):(0,u.t)(u.u.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0),"GET"))],a=yield Promise.all(t);f(a.map((t,a)=>{var n,l;return(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.post)&&Object.assign(Object.assign({},(0,H.g)(null===(l=null==t?void 0:t.data)||void 0===l?void 0:l.post)),{href:e[a].href})}).filter(Boolean)),w(!1)})},[]),(0,m.useEffect)(()=>{!a&&(null==h?void 0:h.length)===0&&n&&(0,g.a)(void 0,void 0,void 0,function*(){var e;let t=yield(0,u.i)(r?(0,u.x)(u.u.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:n},!0):(0,u.t)(u.u.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:n},!0),"GET");(null==t?void 0:t.data)&&x([(0,H.h)(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.category)])})},[h]);let handleRemoveItem=e=>{v(t=>{let a=[...t];return a.splice(e,1),a}),f(t=>{let a=[...t];return a.splice(e,1),a})};return(0,m.useEffect)(()=>{null==i||i(c)},[c]),m.createElement("div",Object.assign({},s),!l&&m.createElement(tq,null,m.createElement("img",{className:"icon",src:W.C.getAssetPath("warning.svg"),alt:"warning",style:{marginBottom:"3px",width:"18px"},loading:"lazy"}),m.createElement(p.T,{size:"s3",as:"span",dangerouslySetInnerHTML:{__html:d("cardReply.disclaimer")}})),a?null:y?m.createElement(Loading$1,null):h.length>0||l?m.createElement(tW,null,m.createElement(O.U,{defaultValue:!o&&"accordion",styles:{control:{borderRadius:"inherit",'&[aria-expanded="false"]':{borderBottom:0}},chevron:{width:"32px",height:"32px"},content:{padding:0,borderBottom:0,borderTop:`1px solid ${U.t.colors.neutral100}`},item:{marginBottom:"16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",border:`1px solid ${U.t.colors.neutral100}`,borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px","&[data-active]":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},chevron:m.createElement("div",{className:t3.chevron},m.createElement(k.Z,{color:U.t.colors.gray600,size:20}))},m.createElement(O.U.Item,{value:"accordion"},m.createElement(O.U.Control,null,m.createElement("div",{className:t3.header},m.createElement(et.H,{as:"h4",tag:"h6"},d("cardReply.source")))),m.createElement(O.U.Panel,null,m.createElement(tH,null,(h||[]).map((e,t)=>m.createElement(tZ,{key:String(t)},"object"==typeof e?m.createElement(SourceItem,Object.assign({},e)):m.createElement(tG,null,m.createElement(G.I,{style:{width:"100%"},name:"source-list",value:e||"",size:"sm",onChange:e=>{v(a=>{let n=[...a];return n[t]=e,n}),f(a=>{let n=[...a];return n[t]=e,n})}})),l&&m.createElement(ee.B,{size:"md",color:"transparent",icon:m.createElement(A.Z,null),onClick:()=>handleRemoveItem(t)}))),l&&m.createElement(ee.B,{className:"add-link",color:"transparent",size:"md",icon:m.createElement(J.Z,{color:U.t.colors.primaryBase,size:18}),onClick:()=>{v(e=>[...e,""]),f(e=>[...e,""])}},"Add source")))))):m.createElement(RecommentCategories,{categories:b}))})` margin-top: 12px; padding: 0.5rem 1rem 1rem; `,VerifiedTag=({userId:e,avatar:t,name:a,role:n,title:l,className:o})=>{let{t:i}=(0,F.u)(),[r,s]=(0,m.useState)(!1);return m.createElement(m.Fragment,null,m.createElement(ee.B,{className:`-dzIuHr ${o}`,color:"success",size:"xs",onClick:()=>s(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},m.createElement("span",{className:"text"},m.createElement(N.Z,{isSolid:!0,size:18,color:U.t.colors.green800,className:"icon"}),i("cardReply.verifyBy",{name:`${a||""}`}))),m.createElement(ProfileDetailModal,{open:r,onClose:()=>s(!1),profileModalProps:{zIndex:1e3}},m.createElement(ProfileDetail,{authorProps:{userId:e,avatar:t,name:a,role:n,title:l},hideQuestionTab:!0})))},CardReply=({className:e,style:t,comment:a,type:n="comment",level:l=0,replyingId:o,onPostCommentSuccess:i,post:s,onDeleteComment:d,refetchComment:c,hasQuickBookingEnable:p,handleMakeAppointment:v,cardAuthorProps:h,maxChars:f=600,disableShortenContent:b})=>{var x,y,w,E,k,C,A,N,P,T,S,z,M;let{data:{locale:j,userInfo:I,env:{isMarryBaby:R}}}=(0,m.useContext)(u.T),{t:O}=(0,F.u)(),[D,B]=(0,m.useState)(a||null),{id:_,countLikes:U,content:$,replies:V=[],images:W=[],author:q,liked:H,link:G,mentionedUser:Q,mentions:X}=D,{text:Y,replyingTo:K}=decodeCommentBody($),{authActionWrapper:J}=useTogetherAuthRequiredAction({_joinCommunityIds:[null===(x=null==s?void 0:s.community)||void 0===x?void 0:x.id],_joinTopicIds:null===(y=null==s?void 0:s.topics)||void 0===y?void 0:y.map(e=>e.id)}),[et,ea]=(0,m.useState)(4),en=null!=I&&!!I.id&&(null==V?void 0:V.some(e=>e.author.id===I.id)),addNewReply=e=>{B(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 c&&c(a),a}return t})},[el,eo]=(0,m.useState)(!1),ei=(0,m.useMemo)(()=>"comment"===n&&V&&0!=V.length?V.sort((e,t)=>{let a=new Date(e.createdAt).getTime(),n=new Date(t.createdAt).getTime();return a>n?-1:a{var e,t;(null==q?void 0:q.hospitalId)&&(e=q.hospitalId,(0,g.a)(void 0,void 0,void 0,function*(){var t;let a=yield(0,u.i)((0,u.j)(u.C.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:L.d[j]}),"get");(null===(t=null==a?void 0:a._data)||void 0===t?void 0:t.branch)&&ev(null==a?void 0:a._data.branch)})),(null==q?void 0:q.doctorId)&&(t=q.doctorId,(0,g.a)(void 0,void 0,void 0,function*(){var e;let a=yield(0,u.i)((0,u.j)(u.C.GET_DOCTOR_INFO,{doctorId:t,website_url:L.d[j]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&ef(null==a?void 0:a._data.doctor)}))},[q.hospitalId,q.doctorId]);let eb=(null==eh?void 0:eh.valid_outpatient)||(null==eh?void 0:eh.valid_telemedicine),ex=((null==eg?void 0:eg.total_available_service)||(null==eg?void 0:eg.total_available_doctor))>0,ey=p&&(eb||ex),ew=(null===(E=null==D?void 0:D.author)||void 0===E?void 0:E.type)==="chatbot";return m.createElement(TogetherAuthConfigContextProvider,{defaultParams:{_joinCommunityIds:[null===(k=null==s?void 0:s.community)||void 0===k?void 0:k.id],_joinTopicIds:null===(C=null==s?void 0:s.topics)||void 0===C?void 0:C.map(e=>e.id)}},m.createElement(t2,{className:e,style:t,"data-is-reply":!!l,"data-is-marrybaby":R,"data-has-booking":ey},"reply"===n&&m.createElement(Z.D,{className:"top-divider",type:"solid"}),m.createElement("div",{style:{padding:"16px 16px 0"}},m.createElement(CardAuthor,Object.assign({avatar:em,name:ed,username:ec,timeText:null==s?void 0:s.createdTime,community:null==s?void 0:s.community,className:`post-author ${es?"with-popover":""}`,type:n,userId:null==q?void 0:q.id,role:ep,expertId:null==q?void 0:q.partnerId,title:null==q?void 0:q.title,doctorId:null==q?void 0:q.doctorId,hospitalId:null==q?void 0:q.hospitalId,hasQuickBooking:ey,handleMakeAppointment:v,isAnonymous:(null==D?void 0:D.isAnonymous)||!!(null==s?void 0:s.isAnonymous)&&(null===(A=null==s?void 0:s.author)||void 0===A?void 0:A.username)===(null==q?void 0:q.username),hideBackground:ew,userType:null==q?void 0:q.type},h)),!!(null==D?void 0:D.isVerify)&&!(null==D?void 0:D.isOppose)&&m.createElement(VerifiedTag,{title:null===(N=null==D?void 0:D.userVerify)||void 0===N?void 0:N.title,name:null===(P=null==D?void 0:D.userVerify)||void 0===P?void 0:P.name,userId:null===(T=null==D?void 0:D.userVerify)||void 0===T?void 0:T.id,role:null===(S=null==D?void 0:D.userVerify)||void 0===S?void 0:S.role,avatar:null===(z=null==D?void 0:D.userVerify)||void 0===z?void 0:z.avatar,className:"verify-tag"})),m.createElement(PostContent,{className:"post-content-wrapper",replyingTo:K,mentionedUser:Q,description:Y,mentions:eu,maxChars:f,disableShortenContent:b}),m.createElement("span",null),m.createElement("span",null),W&&W.length>0?m.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},m.createElement(PostImagePreview,{images:W,authorName:null==q?void 0:q.username})):null,(!W||0===W.length)&&G?m.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},m.createElement(CardLink,{url:G})):null,"most-engaging"!==n?m.createElement(m.Fragment,null,ew&&m.createElement(t6,{listUrl:null==D?void 0:D.source,categorySlug:null==D?void 0:D.categorySlug}),m.createElement(CardReactions,{type:r.reply,loveCount:U,replyCount:er,className:"post-reaction",liked:H,isReplied:en,hideCommentIcon:"reply"===n||ew,hasShare:!1,onCommentClick:()=>J(()=>eo(e=>!e)),onCommentCountClick:()=>J(()=>{eo(!0)}),onLikeClick:()=>J(()=>(0,g.a)(void 0,void 0,void 0,function*(){if(_){let e=yield likeUnlikeComment({commentId:_,setLike:!H,locale:j});1===e.status&&B(e=>Object.assign(Object.assign({},e),{liked:!H,countLikes:e.countLikes+(H?-1:1)}))}}))}),el&&m.createElement(InputCommentBar,{replyingId:o||D.id,replyToName:ed,isReply:!0,onClose:()=>eo(!1),onPostSuccess:e=>{"reply"===n?i&&i(e):addNewReply(e)},post:s,replyingUser:q}),"comment"===n&&V&&V.length>0?m.createElement("div",{className:"comment-reply-wrapper"},null===(M=null==ei?void 0:ei.slice(0,et))||void 0===M?void 0:M.map(e=>m.createElement(CardReply,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:l+1,replyingId:_,onPostCommentSuccess:addNewReply,post:s,onDeleteComment:()=>{B(t=>Object.assign(Object.assign({},t),{replies:t.replies.filter(t=>t.id!==e.id),countReplies:t.countReplies-1}))},handleMakeAppointment:v,hasQuickBookingEnable:p})),er>et&&m.createElement(m.Fragment,null,m.createElement(Z.D,{className:"top-divider",type:"solid"}),m.createElement(ee.B,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>ea(e=>e+4)},O("comment.seeMoreReplies",{count:er-et}),m.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,es&&m.createElement(CardReplyPopover,{onDeleteComment:d,className:"popover",commentId:D.id})))},getMostEngagingComment=(e,t)=>(0,g.a)(void 0,void 0,void 0,function*(){var a,n,l;let o=yield(0,u.y)((0,u.g)(u.P.COMMENT.LIST,{postId:e,_locale:t,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(l=null===(n=null===(a=null==o?void 0:o.data)||void 0===a?void 0:a.comments)||void 0===n?void 0:n.map(H.e))||void 0===l?void 0:l[0]}),CardPost=({className:e,style:t,hideViewMoreComment:a,showMostEngaging:n,onCommentClick:l,onCommentCountClick:o,onMostEngagingCommentClick:i,onPostCommentSuccess:s,disableCardLink:d,disableShortenContent:c,onDeletePost:p,onEditPost:v,post:h,mostEngagingComment:f,onDeleteComment:b,showInputComment:x,InlineCommentsComponent:y,hasQuickBookingEnable:w,handleMakeAppointment:E,cardAuthorProps:k})=>{let[C,A]=(0,m.useState)(h),[N,P]=(0,m.useState)(!1),[T,S]=(0,m.useState)(f),{community:z,topics:M,author:j,slug:I,isPin:R,liked:O,photos:D,mentions:B,title:U,description:$,previewUrl:L,likesCount:V,commentsCount:W,id:q,commented:Z}=C,{data:{locale:H,env:{isMarryBaby:G,togetherBasePath:Q}},action:{pushNotifications:X}}=(0,m.useContext)(u.T),{t:Y}=(0,F.u)(),[K,J]=(0,m.useState)(x),ea=`${Q}/${(null==z?void 0:z.slug)||"_"}/${I||""}`,en=`${(0,u.o)(H)}${ea}`,{authActionWrapper:el}=useTogetherAuthRequiredAction((null==z?void 0:z.slug)?{_joinCommunityIds:[z.id],_joinTopicIds:null==M?void 0:M.map(e=>e.id)}:void 0),[eo,ei]=(0,m.useState)(!1);(0,m.useEffect)(()=>{J(x)},[x]);let er=(null==j?void 0:j.name)||(null==j?void 0:j.username)||"",es=(null==j?void 0:j.username)||(null==j?void 0:j.name)||"",ed=null==j?void 0:j.avatar,ec=(null==C?void 0:C.isAnonymous)?void 0:null==j?void 0:j.role,[em,ep]=(0,m.useState)(null),[eu,eg]=(0,m.useState)(null);(0,m.useEffect)(()=>{var e,t;(null==j?void 0:j.hospitalId)&&(e=j.hospitalId,(0,g.a)(void 0,void 0,void 0,function*(){var t;let a=yield(0,u.i)((0,u.j)(u.C.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:u.p[H]}),"get");(null===(t=null==a?void 0:a._data)||void 0===t?void 0:t.branch)&&ep(null==a?void 0:a._data.branch)})),(null==j?void 0:j.doctorId)&&(t=j.doctorId,(0,g.a)(void 0,void 0,void 0,function*(){var e;let a=yield(0,u.i)((0,u.j)(u.C.GET_DOCTOR_INFO,{doctorId:t,website_url:u.p[H]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&eg(null==a?void 0:a._data.doctor)}))},[j.hospitalId,j.doctorId]);let ev=(null==eu?void 0:eu.valid_outpatient)||(null==eu?void 0:eu.valid_telemedicine),eh=((null==em?void 0:em.total_available_service)||(null==em?void 0:em.total_available_doctor))>0;(0,m.useEffect)(()=>{(0,g.a)(void 0,void 0,void 0,function*(){if(q&&W&&n&&!(null==f?void 0:f.id)){let e=yield getMostEngagingComment(q,H);S(e)}})},[q,H,W,n,null==f?void 0:f.id]),(0,m.useEffect)(()=>{S(f)},[null==f?void 0:f.id]);let onDeleteComment=e=>(0,g.a)(void 0,void 0,void 0,function*(){if(W>1&&(null==T?void 0:T.id)&&(null==T?void 0:T.id)===(null==e?void 0:e.id)){let e=yield getMostEngagingComment(q,H);S(e)}A(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1})),b&&b(e)});return m.createElement(TogetherAuthConfigContextProvider,{defaultParams:(null==z?void 0:z.slug)?{_joinCommunityIds:[z.id],_joinTopicIds:null==M?void 0:M.map(e=>e.id)}:void 0},N&&m.createElement(SharePopup,{url:en,avatar:u.n,text:U,onClose:()=>P(!1)}),m.createElement(tV,{className:e,style:t,"data-is-marrybaby":G},R?m.createElement(LabelPin,{className:"post-pin"}):null,m.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},m.createElement(CardAuthor,Object.assign({avatar:ed,name:er,username:es,url:d?void 0:ea,community:z,timeText:null==C?void 0:C.createdTime,className:"post-author",role:ec,userId:null==j?void 0:j.id,expertId:null==j?void 0:j.partnerId,doctorId:null==j?void 0:j.doctorId,hospitalId:null==j?void 0:j.hospitalId,title:null==j?void 0:j.title,hasQuickBooking:w&&(ev||eh),handleMakeAppointment:E,"data-testid":"name",isAnonymous:!!(null==C?void 0:C.isAnonymous),extendEle:m.createElement(CardPostPopoverMore,{authorEmail:String(null==j?void 0:j.email),onDeletePost:p,shareUrl:en,post:C,className:"popover",onEditPost:v})},k))),m.createElement("a",{href:d?void 0:ea,className:"post-content-link-wrapper"},U&&m.createElement(et.H,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},_()(U)),m.createElement(PostContent,{className:"post-content-wrapper",description:$,disableShortenContent:c,mentions:B,"data-testid":"Content of the Post"})),m.createElement("span",null),m.createElement("span",null),m.createElement("div",{key:"tag-topic"},M&&M.length>0?m.createElement(TagTopic,{topics:M,className:"post-topics"}):null),m.createElement("div",{key:"social-preview"},(null==C?void 0:C.introUrl)?m.createElement("div",{className:`social-preview-wrapper ${(null==D?void 0:D.length)?"has-image":""}`},m.createElement(SocialLinkPreview,{url:C.introUrl,image:C.bannerImage})):null),m.createElement("div",{key:"image-preview"},(null==D?void 0:D.length)?m.createElement("div",{className:"image-preview-wrapper"},m.createElement(PostImagePreview,{images:D,authorName:null==j?void 0:j.name})):null),m.createElement("div",{key:"link-preview"},(null==C?void 0:C.introUrl)||(null==D?void 0:D.length)||null==L||!L.url?null:m.createElement("div",{className:"link-preview-wrapper"},m.createElement(CardLink,{title:L.title,url:L.url,image:L.image}))),m.createElement(CardReactions,{isMarryBaby:G,type:r.post,loveCount:V,replyCount:W,className:`post-reaction ${(null==D?void 0:D.length)||(null==L?void 0:L.url)?"hide-top-border":""}`,liked:eo?!O:O,isReplied:Z,onCommentClick:()=>el(()=>{l?l():J(e=>!e)}),onCommentCountClick:()=>{el(()=>{G?J(!0):o?o():d||(window.location.href=ea)})},onShareClick:()=>{P(!0)},onLikeClick:()=>(0,g.a)(void 0,void 0,void 0,function*(){if(q&&!eo){ei(!0);try{let e=yield likeUnlikePost({id:q,locale:H});(null==e?void 0:e.status)!==1?X(getDefaultFailNoti(Y)):A(e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked}))}catch(e){X(getDefaultFailNoti(Y))}ei(!1)}}),showingMostEngaging:!!(n&&(null==T?void 0:T.id))}),K&&m.createElement(InputCommentBar,{isMainCmt:!x,onClose:()=>J(!1),onPostSuccess:e=>{0!==W||(null==T?void 0:T.id)||S(e),A(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0})),s&&s(e)},post:C}),n&&(null==T?void 0:T.id)?m.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{i?(e.stopPropagation(),i()):window.location.href=ea}},m.createElement(CardReply,{hasQuickBookingEnable:w,handleMakeAppointment:E,comment:T,post:C,onDeleteComment:()=>{onDeleteComment&&onDeleteComment(T)},className:"most-engaging-comment",type:"most-engaging",key:T.id,cardAuthorProps:k}),W>1&&!a&&m.createElement(ee.B,{className:"see-more-comments",color:"ghost",size:"md"},Y("comment.seeMoreComments",{count:W-1}))):null,y))}}}]);