"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8320],{ToOP:function(t,e,o){o.r(e),o.d(e,{EmbeddedAffiliate:function(){return EmbeddedAffiliate}});var i=o("BGKE"),n=o("q1tI"),l=o("iBNF"),a=o("nq2p"),c=o("Biuj"),r=o("Eso5"),d=o("09QT"),s=o("/tR3"),u=o("oQBk"),m=o("fwTn"),p=o("hXNO"),g=o("P5LW"),h=o("rBCA"),v=o("7Ci/");let y=(0,h.Z)(v.W,{target:"e1dafv60"})("position:relative;z-index:10;display:flex;flex-direction:column;align-items:flex-start;padding:24px;gap:24px;background-color:",null===l.r||void 0===l.r?void 0:l.r.colors.neutral50,";border-radius:8px;.title{color:",null===l.r||void 0===l.r?void 0:l.r.colors.secondaryBase,";}.affiliate-carousel{> .mantine-Carousel-indicators{top:calc(100% + 8px);.mantine-Carousel-indicator{width:8px;height:8px;border-width:0;opacity:1;background-color:",null===l.r||void 0===l.r?void 0:l.r.colors.neutral200,";&[data-active]{background-color:",null===l.r||void 0===l.r?void 0:l.r.colors.primaryBase,";}}}> .mantine-Carousel-control{opacity:1;&[data-inactive]{opacity:0;cursor:'default';}}> .mantine-Carousel-controls{width:calc(100% + 70px);margin-left:-35px;}}"),EmbeddedAffiliate=t=>{var e;let{affiliates:o,position:h}=t,[v,f]=(0,n.useState)([]),{locale:x="en-PH"}=(0,g.h)(),b=(0,p.d)(),C=null==o?void 0:null===(e=o.productId)||void 0===e?void 0:e.split(","),fetchProductDetail=async t=>{var e,o;let i=await (0,d.d)(u.y.COMMON.GET_AFFILIATE_PRODUCT,{params:{productId:t}});if(null==i?void 0:null===(e=i.data)||void 0===e?void 0:e[0]){let t=(0,s.nx)(null==i?void 0:null===(o=i.data)||void 0===o?void 0:o[0],x);return t}};return(0,n.useEffect)(()=>{Promise.all((C||[]).map(async t=>{let e=await fetchProductDetail(t);return e})).then(t=>f(t.filter(t=>!!(null==t?void 0:t.id)&&(null==t?void 0:t.id)!==0)))},[]),v.length>0?(0,i.BX)(y,{fluid:!0,my:16,children:[o.title&&(0,i.tZ)(r.x,{sx:{borderLeft:"5px solid ".concat(l.r.colors.primaryBase),paddingLeft:12},children:(0,i.tZ)(a.H,{tag:"h5",className:"title",children:o.title})}),v.length>1?(0,i.tZ)(c.a,{slidesToShow:1,slidesToScroll:1,draggable:b,mx:"auto",height:"100%",maw:"100%",withControls:!b,withIndicators:b,controlsOffset:0,controlSize:32,className:"affiliate-carousel",children:v.map(t=>(0,i.tZ)(c.a.Slide,{children:(0,i.tZ)(m.V,{product:t,position:h})},t.id))},v.length):v.map(t=>(0,i.tZ)(m.V,{product:t,showProsCons:!0,position:h},t.id))]}):null}},"0njy":function(t,e,o){o.r(e),o.d(e,{EmbeddedCommunity:function(){return A},EmbeddedCommunityMain:function(){return EmbeddedCommunityMain}});var i=o("BGKE"),n=o("q1tI"),l=o("N0hu"),a=o("dDsW"),c=o("09QT"),r=o("JuOI"),d=o("iv2E"),s=o("x7/v"),u=o("hXNO"),m=o("P5LW"),p=o("o0qI"),g=o("nq2p"),h=o("iBNF"),v=o("0Pmq"),y=o("CJtR"),f=o("7mej"),x=o("rBCA"),b=o("eePC");let C=(0,x.Z)("div",{target:"ewnwqig0"})("&[data-fetching='true']{display:none;}margin-block:16px;padding:24px 16px;border-radius:8px;background-color:",null===h.r||void 0===h.r?void 0:h.r.colors.neutral50,";content-visibility:auto;contain-intrinsic-size:800px;",b.M.mbDown,"{margin-inline:-16px;}"),T=(0,x.Z)("div",{target:"ewnwqig1"})("width:100%;display:flex;gap:16px;",b.M.mbDown,"{flex-direction:column;gap:8px;}.grow{flex-grow:1;}.ask{white-space:nowrap;}.thumbnail{",b.M.mbDown,"{width:40px;height:40px;}",b.M.mbUp,"{width:48px;height:48px;}border-radius:50%;&-header{flex-shrink:0;",b.M.mbDown,"{display:flex;/* justify-content:space-between;*/\n gap:16px;/* > div{display:flex;gap:16px;}*/}}}.detail{&-general{",b.M.mbUp,"{min-height:50px;}}width:100%;flex-grow:1;gap:4px;display:flex;flex-direction:column;&-statistic{display:flex;gap:16px;}&-tag{display:flex;gap:8px;align-items:center;justify-content:space-between;",b.M.mbDown,"{flex-direction:column;}.ask{margin-left:auto;}}}"),w=(0,x.Z)("div",{target:"ewnwqig2"})("background-color:#ffffff;margin-top:16px;padding:16px 24px;",b.M.mbDown,"{padding:16px;}border:1px solid ",null===h.r||void 0===h.r?void 0:h.r.colors.neutral100,";border-radius:8px;hr{margin-top:24px;margin-bottom:16px;border:1px solid ",null===h.r||void 0===h.r?void 0:h.r.colors.neutral100,";}.join{margin-top:16px;}");var Z=o("Biuj"),E=o("unQi"),M=o("g/tz");let k={root:{background:"#ffffff",borderRadius:"32px",padding:"0",textTransform:"unset",height:"auto"}},B=(0,x.Z)("div",{target:"e1e3dvg0"})(".header{width:100%;display:flex;gap:16px;.detail{width:100%;flex-grow:1;gap:4px;display:flex;flex-direction:column;&-author{display:flex;gap:4px;align-items:center;}button{width:fit-content;text-align:left;}}}.content{margin-top:8px;margin-bottom:16px;a{color:",null===h.r||void 0===h.r?void 0:h.r.colors.primaryBase,";text-decoration:underline;}mention{color:",null===h.r||void 0===h.r?void 0:h.r.colors.primaryBase,";padding-right:4px;&:first-of-type ~ *{&:not(ul),&:not(ol){display:inline-block;}}&:first-of-type{margin-right:5px;}&:hover{text-decoration:underline;}}}.action{display:flex;gap:24px;align-items:center;justify-content:end;> *{display:flex;gap:8px;align-items:center;justify-content:end;}}"),N=(0,x.Z)(Z.a,{target:"e1e3dvg1"})("cursor:grab;",b.M.mbDown,"{width:100%;}.mantine-Carousel-control{&[data-inactive]{opacity:0;cursor:default;}background-color:#ffffff;opacity:1;",b.M.mbUp,"{&:first-of-type{transform:translateX(-110%);}}}.mantine-Carousel-viewport{width:calc(100% - 36px);}.mantine-Carousel-controls{}"),TopicScrollList=t=>{let{topics:e,communitySlug:o}=t,a=(0,u.d)(),{state:{isLoggedIn:c}}=(0,n.useContext)(p.I),{locale:r}=(0,m.h)(),[d,s]=(0,n.useState)(null),g=(0,n.useRef)(!0);if((0,n.useEffect)(()=>{let handleScroll=()=>{g.current=!1},handlePointerUp=()=>{setTimeout(()=>{g.current=!0},1e3)};return d&&(d.on("scroll",handleScroll),d.on("pointerUp",handlePointerUp)),()=>{d&&(d.off("scroll",handleScroll),d.off("pointerUp",handlePointerUp))}},[d]),!e)return(0,i.tZ)(i.HY,{});let onTopicClick=t=>{g.current&&(c?window.location.href="/".concat((0,y.UC)(r),"/community/").concat(o,"/").concat(null==t?void 0:t.slug):(0,M.p0)("".concat((0,y.UC)(r),"/community/on-boarding/?returnUrl=/").concat(o,"/").concat(null==t?void 0:t.slug),"communities","embeddedarticle","".concat(o,"/").concat(null==t?void 0:t.slug)))};return(0,i.tZ)(i.HY,{children:e&&e.length>0&&(0,i.tZ)(N,{align:"start",slideGap:"md",dragFree:!0,slideSize:"10%",styles:{root:{width:a?"100%":"400px"}},getEmblaApi:s,controlsOffset:-52,children:e.map(t=>(0,i.tZ)(Z.a.Slide,{children:(0,i.tZ)(E.Ct,{color:"#ffffff",styles:k,children:(0,i.tZ)(l.B,{color:"transparent",size:"sm",onClick:()=>onTopicClick(t),"data-event-category":"Together","data-event-action":"Join Topic","data-event-label":"".concat((0,y.UC)(r),"/community/").concat(o,"/").concat(null==t?void 0:t.slug),className:"pointer-event-child-none",children:(0,i.tZ)(v.T,{size:"p4",color:h.r.colors.gray600,children:t.name})})})},t.id))})})},CommunitySectionDesktop=t=>{let{community:e,topics:o,title:n,message:l,actionButton:a}=t,{locale:c}=(0,m.h)();return e?(0,i.BX)(T,{children:[(0,i.tZ)("div",{className:"thumbnail-header",children:(0,i.tZ)("img",{loading:"lazy",className:"thumbnail",src:e.thumbnail,alt:"thumbnail"})}),(0,i.BX)("div",{className:"detail",children:[(0,i.BX)("div",{className:"detail-general",children:[(0,i.tZ)("a",{href:"/community/".concat(null==e?void 0:e.slug),"data-event-category":"Together","data-event-action":"Community Title Click","data-event-label":"".concat((0,y.UC)(c),"/community/").concat(null==e?void 0:e.slug),className:"pointer-event-child-none",children:(0,i.tZ)(g.H,{tag:"h5",fontWeight:"bold",color:h.r.colors.gray800,className:"grow",children:n})}),(0,i.tZ)(f.g,{postsCount:e.postsCount,membersCount:e.membersCount})]}),l&&(0,i.tZ)("div",{className:"detail-message",children:(0,i.tZ)(v.T,{size:"p3",color:h.r.colors.gray800,children:l})}),(0,i.BX)("div",{className:"detail-tag",children:[(0,i.tZ)(TopicScrollList,{topics:o,communitySlug:e.slug}),a&&a]})]})]}):null},CommunitySectionMobile=t=>{let{community:e,topics:o,title:n,message:l,actionButton:a}=t,{locale:c}=(0,m.h)();return e?(0,i.BX)(T,{children:[(0,i.BX)("div",{className:"thumbnail-header",children:[(0,i.tZ)("img",{loading:"lazy",className:"thumbnail",src:e.thumbnail,alt:"thumbnail"}),(0,i.BX)("div",{children:[(0,i.tZ)("a",{href:"/community/".concat(null==e?void 0:e.slug),"data-event-category":"Together","data-event-action":"Community Title Click","data-event-label":"".concat((0,y.UC)(c),"/community/").concat(null==e?void 0:e.slug),className:"pointer-event-child-none",children:(0,i.tZ)(g.H,{tag:"h5",fontWeight:"bold",color:h.r.colors.gray800,className:"grow",children:n})}),(0,i.tZ)("div",{className:"detail-general",children:(0,i.tZ)(f.g,{postsCount:e.postsCount,membersCount:e.membersCount})})]})]}),(0,i.BX)("div",{className:"detail",children:[l&&(0,i.tZ)("div",{className:"detail-message",children:(0,i.tZ)(v.T,{size:"p3",color:h.r.colors.gray800,children:l})}),(0,i.tZ)("div",{className:"detail-tag",children:(0,i.tZ)(TopicScrollList,{topics:o,communitySlug:e.slug})})]}),a&&(0,i.tZ)("div",{children:a})]}):null},CommunitySection=t=>{let e=(0,u.d)();return e?(0,i.tZ)(CommunitySectionMobile,{...t}):(0,i.tZ)(CommunitySectionDesktop,{...t})};var S=o("Wgwc"),U=o.n(S),O=o("/tR3"),P=o("oQBk"),I=o("qPyV"),L=o.n(I);let getCommunityInfo=async(t,e)=>{let o=await e(P.y.TOGETHER.GET_TOGETHER_COMMUNITY_DETAIL,{params:t},"together");return(null==o?void 0:o.data)?(0,O.tg)(null==o?void 0:o.data):{}},getTopicInfo=async(t,e)=>{var o,i;let n=await e(P.y.TOGETHER.GET_TOGETHER_TOPICS,{params:t},"together");return((null==n?void 0:null===(i=n.data)||void 0===i?void 0:null===(o=i.topics)||void 0===o?void 0:o.map(t=>(0,O.l2)(t)))||[]).filter(t=>null==t?void 0:t.isActive)},getPostList=async(t,e)=>{let{articleId:o,...i}=t;try{var n,l;let[t,a]=await Promise.all([e(P.y.TOGETHER.GET_TOGETHER_POST_LIST,{params:{...i,articleId:o||"",sortBy:"popularity",postBy:"member"}},"together"),e(P.y.TOGETHER.GET_TOGETHER_POST_LIST,{params:{...i,reportStartDate:U()().subtract(2,"month").format("YYYY-MM-DD"),reportEndDate:U()().format("YYYY-MM-DD"),sortBy:"popularity",postBy:"member"}},"together")]),c=[...null==a?void 0:null===(n=a.data)||void 0===n?void 0:n.posts,...null===(l=t.data)||void 0===l?void 0:l.posts].sort((t,e)=>U()(t.created_at).isBefore(U()(e.created_at))?1:-1);return L()(c,"id").map(t=>(0,O.o9)(t))||[]}catch(t){return[]}};var D=o("ehjy"),z=o("2YCo"),X=o("FfFn"),_=o("PnmO"),G=o("Eso5"),H=o("raAP"),R=o("rIrU"),j=o("GvV+");let Post=t=>{var e,o,l,r;let{post:d,communitySlug:s}=t,{state:{isLoggedIn:g}}=(0,n.useContext)(p.I),{formatMessage:v}=(0,a.Z)(),{locale:f}=(0,m.h)(),x=(0,H.U)(),b=(0,u.d)(),C=(0,n.useRef)(null),[T,w]=(0,n.useState)(d.liked),[E,k]=(0,n.useState)(!1),N=(0,j.Tn)((0,j.rz)(d.description||"","display"),d.mentions||[]),S=(null==d?void 0:d.isAnonymous)?v({id:"cardPost.anonymous",defaultMessage:"Anonymous"}):(null===(e=d.author)||void 0===e?void 0:e.name)||(null===(o=d.author)||void 0===o?void 0:o.username)||"",U=(null==d?void 0:d.isAnonymous)?R.RU:null===(l=d.author)||void 0===l?void 0:l.avatar,O=(null==d?void 0:d.isAnonymous)?void 0:null===(r=d.author)||void 0===r?void 0:r.role,I="/community/".concat(s,"/").concat(null==d?void 0:d.slug),handleLikeClick=async()=>{g?(await (0,c.d)(P.y.TOGETHER.POST_TOGETHER_LIKE_POST,{params:{postId:d.id}},"together"),w(t=>!t),k(!0)):R.Ew?_.u.getState().triggerLogin({returnUrl:"".concat((0,y.UC)(f),"/community/on-boarding/?returnUrl=").concat(encodeURIComponent("/".concat(s,"/").concat(null==d?void 0:d.slug,"?postAction=like")))}):window.location.href=(0,y.bT)("".concat((0,y.UC)(f),"/community/on-boarding/?returnUrl=").concat(encodeURIComponent("/".concat(s,"/").concat(null==d?void 0:d.slug,"?postAction=like"))))},[L,A]=(0,n.useState)(null==d?void 0:d.likesCount);(0,n.useEffect)(()=>{E&&(T?A(t=>++t):A(t=>--t))},[null==d?void 0:d.likesCount,E,T]);let Y=(0,n.useCallback)(t=>{g||(t.preventDefault(),t.stopPropagation(),(0,M.p0)("".concat((0,y.mg)(f),"/community/on-boarding?return=").concat(encodeURIComponent((I||"").replace("/community",""))),"communities"))},[]);return(0,n.useEffect)(()=>(setTimeout(()=>{var t;return null===(t=C.current)||void 0===t?void 0:t.addEventListener("click",Y,{passive:!0})},1e3),()=>{var t;return null===(t=C.current)||void 0===t?void 0:t.removeEventListener("click",Y)}),[]),(0,i.BX)(B,{children:[(0,i.BX)("div",{className:"header",children:[(0,i.tZ)(Z.A,{src:U,radius:"xl",size:40,color:h.r.colors.primaryHover,children:((null==S?void 0:S[0])||"").toUpperCase()}),(0,i.BX)("div",{className:"detail",children:[(0,i.tZ)(G.x,{component:"a",href:"/community/".concat(s,"/").concat(null==d?void 0:d.slug),"data-event-category":"Together","data-event-action":"Click Post","data-event-label":"".concat((0,y.UC)(f),"/community/").concat(s,"/").concat(null==d?void 0:d.slug),className:"pointer-event-child-none",onClick:t=>{t.preventDefault(),t.stopPropagation(),window.location.href="/".concat((0,y.UC)(f)).concat(I)},children:(0,i.tZ)(z.T,{size:"s3",children:d.title})}),(0,i.BX)("div",{className:"detail-author",children:[(0,i.tZ)(z.T,{as:"span",size:"p4",color:h.r.colors.gray600,children:S}),!b&&(0,i.tZ)(D.A,{role:O||""}),(0,i.tZ)(z.T,{as:"span",size:"p4",color:h.r.colors.gray600,children:"\xb7"}),(0,i.tZ)(z.T,{as:"span",size:"p4",color:h.r.colors.gray600,children:d.createdTime})]})]})]}),(0,i.tZ)("div",{className:"content",children:(0,i.tZ)(X.S,{line:3,lineHeight:b?22:24,trackingAttributes:{dataEventCategory:"Together",dataEventAction:"See More Click",dataEventLabel:x},controlRef:C,children:(0,i.tZ)(z.T,{as:"div",size:"p2",color:h.r.colors.gray800,dangerouslySetInnerHTML:{__html:N}})},String(b))}),(0,i.BX)("div",{className:"action",children:[(0,i.BX)("div",{"data-event-category":"Together","data-event-action":"Like Click","data-event-label":"".concat((0,y.UC)(f),"/community/").concat(s,"/").concat(null==d?void 0:d.slug),onClick:handleLikeClick,className:"pointer-event-child-none",children:[T?(0,i.tZ)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"#d84023",className:"txt-icon",children:(0,i.tZ)("path",{d:"M19.8757 5.41452C19.4289 4.96607 18.8984 4.61034 18.3145 4.36763C17.7307 4.12492 17.1048 4 16.4728 4C15.8408 4 15.215 4.12492 14.6311 4.36763C14.0472 4.61034 13.5167 4.96607 13.0699 5.41452L12.1426 6.34476L11.2154 5.41452C10.3128 4.50912 9.08878 4.00047 7.81244 4.00047C6.5361 4.00047 5.31204 4.50912 4.40953 5.41452C3.50702 6.31992 3 7.5479 3 8.82833C3 10.1088 3.50702 11.3367 4.40953 12.2421L5.3368 13.1724L12.1426 20L18.9484 13.1724L19.8757 12.2421C20.3227 11.7939 20.6773 11.2617 20.9193 10.676C21.1612 10.0902 21.2857 9.46237 21.2857 8.82833C21.2857 8.19428 21.1612 7.56645 20.9193 6.9807C20.6773 6.39494 20.3227 5.86275 19.8757 5.41452V5.41452Z",stroke:"#d84023","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})}):(0,i.tZ)("svg",{width:"24",height:"24",viewBox:"0 0 20 20",fill:"none",children:(0,i.tZ)("path",{d:"M13.7498 2.5C11.3373 2.5 9.99984 4.24167 9.99984 4.24167C9.99984 4.24167 8.66234 2.5 6.24984 2.5C3.71817 2.5 1.6665 4.55167 1.6665 7.08333C1.6665 10.5592 5.75984 13.9275 6.90067 14.9917C7.46747 15.52 8.12184 16.1134 8.68282 16.6176C9.43278 17.2915 10.5669 17.2915 11.3169 16.6176C11.8778 16.1134 12.5322 15.52 13.099 14.9917C14.2398 13.9275 18.3332 10.5592 18.3332 7.08333C18.3332 4.55167 16.2815 2.5 13.7498 2.5ZM12.3423 13.425C12.1948 13.5583 12.0665 13.6742 11.9623 13.7717C11.3365 14.355 10.5965 15.0242 9.99984 15.5592C9.40317 15.0242 8.66234 14.3542 8.03734 13.7717C7.93234 13.6742 7.804 13.5575 7.65734 13.425C6.474 12.3558 3.33317 9.51583 3.33317 7.08333C3.33317 5.475 4.6415 4.16667 6.24984 4.16667C7.77234 4.16667 8.65484 5.22917 8.67817 5.25667L9.99984 6.66667L11.3215 5.25667C11.3298 5.24583 12.2273 4.16667 13.7498 4.16667C15.3582 4.16667 16.6665 5.475 16.6665 7.08333C16.6665 9.51583 13.5257 12.3558 12.3423 13.425Z",fill:"#595959"})}),(0,i.tZ)(z.T,{size:"p4",color:h.r.colors.gray600,children:L})]}),(0,i.BX)("a",{"data-event-category":"Together","data-event-action":"Comment Icon Click","data-event-label":"".concat((0,y.UC)(f),"/community/").concat(s,"/").concat(null==d?void 0:d.slug),href:I+"#comment",className:"pointer-event-child-none",onClick:t=>{null==t||t.preventDefault(),g?window.location.href="/community/".concat(s,"/").concat(null==d?void 0:d.slug):R.Ew?_.u.getState().triggerLogin({returnUrl:"".concat((0,y.UC)(f),"/community/on-boarding/?returnUrl=/").concat(s,"/").concat(null==d?void 0:d.slug,"?source=communities&action=embeddedarticle&campaign=").concat(s,"/").concat(null==d?void 0:d.slug)}):window.location.href=(0,y.bT)("".concat((0,y.UC)(f),"/community/on-boarding/?returnUrl=/").concat(s,"/").concat(null==d?void 0:d.slug,"?source=communities&action=embeddedarticle&campaign=").concat(s,"/").concat(null==d?void 0:d.slug))},children:[(0,i.BX)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,i.tZ)("path",{d:"M7.49984 9.1665C7.49984 9.62674 7.12674 9.99984 6.6665 9.99984C6.20627 9.99984 5.83317 9.62674 5.83317 9.1665C5.83317 8.70627 6.20627 8.33317 6.6665 8.33317C7.12674 8.33317 7.49984 8.70627 7.49984 9.1665Z",fill:"#595959"}),(0,i.tZ)("path",{d:"M9.99984 9.99984C10.4601 9.99984 10.8332 9.62674 10.8332 9.1665C10.8332 8.70627 10.4601 8.33317 9.99984 8.33317C9.5396 8.33317 9.1665 8.70627 9.1665 9.1665C9.1665 9.62674 9.5396 9.99984 9.99984 9.99984Z",fill:"#595959"}),(0,i.tZ)("path",{d:"M13.3332 9.99984C13.7934 9.99984 14.1665 9.62674 14.1665 9.1665C14.1665 8.70627 13.7934 8.33317 13.3332 8.33317C12.8729 8.33317 12.4998 8.70627 12.4998 9.1665C12.4998 9.62674 12.8729 9.99984 13.3332 9.99984Z",fill:"#595959"}),(0,i.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.99984 1.6665C5.45702 1.6665 1.6665 4.9782 1.6665 9.1665C1.6665 13.3548 5.45702 16.6665 9.99984 16.6665C10.1871 16.6665 10.3649 16.6421 10.5429 16.6177C10.639 16.6045 10.7353 16.5912 10.8332 16.5819V18.4824C10.8332 18.8119 11.1975 19.011 11.4748 18.8332L12.1174 18.4211C13.9192 17.2646 17.8207 14.2627 18.286 9.95426C18.3155 9.69796 18.3332 9.43546 18.3332 9.1665C18.3332 4.9782 14.5427 1.6665 9.99984 1.6665ZM9.99984 3.33317C13.742 3.33317 16.6665 5.99148 16.6665 9.1665C16.6665 9.367 16.6541 9.56703 16.6307 9.76872V9.77197L16.6291 9.77523C16.3411 12.4424 14.2061 14.5372 12.4998 15.9032V15.6613C12.4998 15.1351 12.0178 14.7409 11.5021 14.8452C11.0141 14.9437 10.5126 14.9998 9.99984 14.9998C6.25766 14.9998 3.33317 12.3415 3.33317 9.1665C3.33317 5.99148 6.25766 3.33317 9.99984 3.33317Z",fill:"#595959"})]}),(0,i.tZ)(z.T,{size:"p4",color:h.r.colors.gray600,children:null==d?void 0:d.commentsCount})]})]})]})},PostSection=t=>{let{posts:e,isJoined:o,communitySlug:c,hideButton:r=!1}=t,{state:{isLoggedIn:d}}=(0,n.useContext)(p.I),{locale:s}=(0,m.h)(),{formatMessage:u}=(0,a.Z)(),g=(0,n.useMemo)(()=>!d||!o,[d,o]);return e?(0,i.BX)(w,{children:[e.slice(0,3).map((t,e)=>(0,i.BX)(n.Fragment,{children:[(0,i.tZ)(Post,{post:t,communitySlug:c}),2!==e&&(0,i.tZ)("hr",{})]},t.id)),!r&&(0,i.tZ)(i.HY,{children:g?(0,i.tZ)(l.B,{color:"secondary",isBlock:!0,size:"lg",onClick:()=>{(0,M.p0)("".concat((0,y.UC)(s),"/community/on-boarding/?returnUrl=/").concat(c),"communities","embeddedarticle",c)},className:"join pointer-event-child-none","data-event-category":"Together","data-event-action":"Join Community","data-event-label":"".concat((0,y.UC)(s),"/community/").concat(c),children:u({id:"together.embed.topicCard.joinNow",defaultMessage:"Join Community"})}):(0,i.tZ)(l.B,{color:"secondary",isBlock:!0,size:"lg",onClick:()=>{window.open("".concat((0,y.UC)(s),"/community/").concat(c),"_blank")},className:"join pointer-event-child-none","data-event-category":"Together","data-event-action":"Join Discussion","data-event-label":"".concat((0,y.UC)(s),"/community/").concat(c),children:u({id:"together.embed.topicCard.joinDiscussion",defaultMessage:"Join Discussion"})})})]}):null},EmbeddedCommunityMain=t=>{let{community:e,title:o,description:l,titleMember:a,titleGuest:s,descriptionGuest:u,descriptionMember:g,articleId:h,actionButton:v,hideButton:y,...f}=t,{locale:x}=(0,m.h)(),{state:{isLoggedIn:b}}=(0,n.useContext)(p.I),[T,w]=(0,n.useState)(),[Z,E]=(0,n.useState)(),[M,k]=(0,n.useState)(),[B,N]=(0,n.useState)(!1),S=(0,n.useMemo)(()=>void 0!==l?l:b&&(null==T?void 0:T.joined)?l||g||(null==T?void 0:T.description):l||u||(null==T?void 0:T.description),[b,null==T?void 0:T.joined,null==T?void 0:T.description,g,u,l]),U=(0,n.useMemo)(()=>b&&(null==T?void 0:T.joined)?o||a||(null==T?void 0:T.name):o||s||(null==T?void 0:T.name),[b,null==T?void 0:T.joined,null==T?void 0:T.name,s,a,o]);return(0,n.useEffect)(()=>{N(!0);let t={communityId:null==e?void 0:e.community,websiteUrl:"https://".concat(d.domainLocales[x]),articleId:h};Promise.all([getCommunityInfo(t,c.d).then(t=>{w(t)}),getTopicInfo(t,c.d).then(t=>{E(t)}),getPostList(t,c.d).then(t=>{k(t)})]).then(()=>{N(!1)}).catch(t=>{console.error(t),N(!1)})},[null==e?void 0:e.community]),(0,i.BX)(r.Z,{children:[(0,i.tZ)("div",{style:{height:500,display:B?"block":"none"}}),(0,i.BX)(C,{"data-fetching":B,...f,children:[(0,i.tZ)(CommunitySection,{community:T,topics:Z,title:U,message:S,actionButton:v}),(0,i.tZ)(PostSection,{isJoined:null==T?void 0:T.joined,posts:M,communitySlug:null==T?void 0:T.slug,hideButton:y})]})]})},A=EmbeddedCommunityMain;A.HealthTool=t=>{var e,o,n;let{community:c}=(0,s.O)({communityId:null===(e=t.community)||void 0===e?void 0:e.community}),r=(0,u.d)(),{formatMessage:d}=(0,a.Z)();return(0,i.tZ)(EmbeddedCommunityMain,{hideButton:!0,title:null===(o=t.community)||void 0===o?void 0:o.title,description:null===(n=t.community)||void 0===n?void 0:n.description,actionButton:(0,i.tZ)("a",{href:"/community/".concat((null==c?void 0:c.slug)||""),children:(0,i.tZ)(l.B,{size:"md",color:"success",className:"ask",isBlock:r,icon:(0,i.tZ)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:(0,i.tZ)("path",{d:"M14.9852 4.49251C14.7904 4.49832 14.6054 4.57975 14.4696 4.71956L6.74988 12.4393L4.28015 9.96956C4.21104 9.89758 4.12827 9.84012 4.03667 9.80053C3.94508 9.76094 3.8465 9.74003 3.74672 9.73901C3.64694 9.73799 3.54796 9.7569 3.45558 9.79462C3.36319 9.83233 3.27926 9.8881 3.20871 9.95866C3.13815 10.0292 3.08238 10.1132 3.04466 10.2055C3.00694 10.2979 2.98804 10.3969 2.98905 10.4967C2.99007 10.5965 3.01098 10.695 3.05057 10.7866C3.09016 10.8782 3.14763 10.961 3.21961 11.0301L6.21961 14.0301C6.36026 14.1707 6.551 14.2497 6.74988 14.2497C6.94876 14.2497 7.1395 14.1707 7.28015 14.0301L15.5302 5.78011C15.6385 5.67476 15.7126 5.53913 15.7425 5.39099C15.7725 5.24285 15.757 5.08912 15.6981 4.94993C15.6392 4.81074 15.5396 4.69259 15.4124 4.61097C15.2852 4.52935 15.1363 4.48806 14.9852 4.49251Z",fill:"#008C50"})}),children:d({id:"together.embed.topicCard.joinDiscussion",defaultMessage:"Join Discussion"})})}),...t})}},hVZB:function(t,e,o){o.d(e,{Cl:function(){return h},Lq:function(){return c},Lv:function(){return a},Ok:function(){return s},P:function(){return d},Tw:function(){return g},WG:function(){return m},Wj:function(){return r},X0:function(){return p},en:function(){return f},g4:function(){return x},nt:function(){return v},uY:function(){return u},z$:function(){return y}});var i=o("rBCA"),n=o("eePC"),l=o("iBNF");let a=(0,i.Z)("div",{target:"e1c6pofg0"})("margin:24px 0;.big-divider{border:0;height:8px;background-color:#f7f9fc;margin:24px 0;}"),c=(0,i.Z)("div",{target:"e1c6pofg1"})("margin:12px 0 24px 0;",n.M.mbDown,"{width:calc(100% + 2rem);max-width:unset;margin-right:-1rem;margin-left:-1rem;}.container{",n.M.mbDown,"{padding:4px 16px 32px 16px;}",n.M.mbUp,"{padding:8px 4px 32px 4px;}}&[data-custom-columns='false']{.section{",n.M.mbUp,"{margin-right:24px;}}}.section{",n.M.mbDown,"{max-width:283px;margin:0 16p 0 0x;}.grid-layout{",n.M.mbUp,"{grid-column-gap:24px;padding:0 24px 0 0;height:100%;}",n.M.mbDown,"{grid-column-gap:12px;padding:0 12px 0 0;}}}&[data-column-count='3']{.section{.grid-layout{",n.M.mbUp,"{padding:0 54px 0 0;}}}}"),r=(0,i.Z)("div",{target:"e1c6pofg2"})("width:100%;margin:0 0 8px 0;border-radius:",l.r.borderRadius,";box-shadow:0px 16px 24px rgba(0,0,0,0.06),0px 2px 8px rgba(0,0,0,0.04),0px 0px 1px rgba(0,0,0,0.04);overflow-x:hidden;",n.M.mbDown,"{max-width:271px;min-height:342px;}",n.M.mbUp,"{max-width:342px;min-height:388px;height:100%;}.post-divider{border-top:0.5px solid #e4e8ec;border-bottom:none;margin:0;}&[data-home='true']{",n.M.mbDown,"{max-width:271px;min-height:318px;}",n.M.mbUp,"{max-width:368px;min-height:294px;}}"),d=(0,i.Z)("div",{target:"e1c6pofg3"})("position:absolute;top:0;display:block;width:100%;",n.M.mbDown,"{height:152px;}",n.M.mbUp,"{height:236px;}background-position:center;background-repeat:no-repeat;background-size:cover;border-radius:",l.r.borderRadius,";.thumbnail-container{display:flex;width:100%;height:100%;align-items:flex-end;justify-content:center;.thumbnail{position:absolute;z-index:10;bottom:0;",n.M.mbDown,"{width:80px;height:80px;}",n.M.mbUp,"{width:100px;height:100px;}margin:auto;border-radius:50%;}}&[data-home='true']{",n.M.mbUp,"{height:152px;}.thumbnail-container{.thumbnail{",n.M.mbDown,"{bottom:0;}",n.M.mbUp,"{bottom:33px;}}}}"),s=(0,i.Z)("div",{target:"e1c6pofg4"})("position:relative;width:100%;a{text-decoration:none;}",n.M.mbDown,"{margin-top:112px;padding:56px 16px 16px 16px;}",n.M.mbUp,"{margin-top:176px;padding:69px 16px 16px 16px;}background:white;border-radius:20px 20px 6px 6px;text-align:center;.statictis{display:flex;justify-content:space-around;",n.M.mbDown,"{magin-top:4px;}",n.M.mbUp,"{margin-top:8px;}}.button{width:100%;margin-top:24px;}&[data-home='false']{.statictis-item{",n.M.mbUp,"{display:flex;flex-direction:column;flex:1;.number{margin-right:4px;}}}}&[data-home='true']{",n.M.mbUp,"{margin-top:77px;padding:54px 16px 16px 16px;}.statictis{",n.M.mbUp,"{margin-top:18px;}}}"),u=(0,i.Z)("div",{target:"e1c6pofg5"})("display:flex;align-items:center;justify-content:space-between;",n.M.mbDown,"{padding:11px 8px;}",n.M.mbUp,"{padding:10px 16px;}.info{display:flex;align-items:center;text-decoration:none;}.topic-thumbnail{",n.M.mbDown,"{width:32px;height:32px;}",n.M.mbUp,"{width:40px;height:40px;}margin-right:8px;}.title{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1;text-overflow:ellipsis;}&[data-custom]{.follow-btn{padding:6px 12px;border-color:",l.r.colors.primaryActive,";color:",l.r.colors.primaryActive,";font-size:13px;font-weight:bold;line-height:20px;white-space:nowrap;}}&[data-has-followed='true']{.follow-btn{span{display:flex;align-items:center;}img{width:18px;height:18px;margin-right:8px;}border-color:",l.r.colors.gray300,";color:",l.r.colors.gray800,";}}"),m=(0,i.Z)("a",{target:"e1c6pofg6"})("display:flex;align-items:center;justify-content:center;padding:0 0 16px 0;text-decoration:none;p{color:",l.r.colors.primaryActive,";",n.M.mbDown,"{font-size:12px;font-weight:600;line-height:18px;}",n.M.mbUp,"{font-weight:bold;font-size:14px;line-height:22px;}}img{",n.M.mbDown,"{width:16px;height:16px;}",n.M.mbUp,"{width:18px;height:18px;}}"),p=(0,i.Z)("div",{target:"e1c6pofg7"})("display:flex;.line{border-right:5px solid #2d87f3;margin:4px 0;margin-right:16px;}h5{color:",l.r.colors.gray800,";margin-bottom:4px;",n.M.mbUp,"{padding:0px 16px;}}"),g=(0,i.Z)("div",{target:"e1c6pofg8"})("padding:16px;",n.M.mbDown,"{min-height:262px;}",n.M.mbUp,"{min-height:332px;}.post-title{display:-webkit-box;overflow:hidden;margin-top:16px;-webkit-box-orient:vertical;-webkit-line-clamp:2;}"),h=(0,i.Z)("div",{target:"e1c6pofg9"})("display:flex;justify-content:space-between;.option-icon{width:32px;height:32px;cursor:pointer;}"),v=(0,i.Z)("div",{target:"e1c6pofg10"})("display:flex;align-items:center;.avatar-container{position:relative;margin-right:8px;.avatar{width:40px;height:40px;border-radius:50%;}.badge{position:absolute;right:0;bottom:0;width:14px;height:14px;}}.author-info{.author-name{display:flex;align-items:center;.role{height:fit-content;padding:0 8px;margin-left:4px;background:#ff6f4d;border-radius:10px;color:white;font-size:8px;font-weight:600;line-height:18px;}}.speciality{.position-container{}}}"),y=(0,i.Z)("div",{target:"e1c6pofg11"})("margin-top:8px;line-height:1.5;word-break:break-word;.post-content-replying{display:inline-block;margin-right:5px;color:",l.r.colors.primaryBase,";cursor:pointer;&.tag-only{margin-right:0;}}.post-content{display:inline;white-space:pre-wrap;/* > *:first-of-type,*/\n > mention:first-of-type ~ *{&:not(ul),&:not(ol){display:inline-block;}}> mention:first-of-type{margin-right:5px;}&.has-see-more{*:last-child{&:not(ul),&:not(ol){display:inline;}}}img{width:100%;height:unset;}ul,ol{display:block;padding-left:1rem;list-style-position:inside;}ol{list-style-type:decimal;}ul{list-style-type:disc;}mention{padding-right:4px;color:#1890ff;:hover{text-decoration:underline;}}}.see-more-text{cursor:pointer;}"),f=(0,i.Z)("div",{target:"e1c6pofg13"})("display:flex;justify-content:space-between;padding:14px 16px;.like-comment{display:flex;.action{display:flex;align-items:center;margin-right:24px;color:",l.r.colors.gray800,";text-decoration:none;background:transparent;img{width:24px;height:24px;margin-right:4px;cursor:pointer;}}}.write-comment{display:flex;align-items:center;color:",l.r.colors.primaryActive,";cursor:pointer;font-size:14px;font-weight:bold;line-height:22px;text-decoration:none;img{width:18px;height:18px;}}"),x=(0,i.Z)("div",{target:"e1c6pofg14"})("display:inline-block;width:3px;height:3px;margin-bottom:calc(0.5em - 3px);background-color:",l.r.colors.gray400,";border-radius:50%;")},"8GF8":function(t,e,o){o.r(e),o.d(e,{EmbeddedCommunity:function(){return EmbeddedCommunity}});var i=o("BGKE"),n=o("q1tI"),l=o("G8oo"),a=o("nq2p"),c=o("iBNF"),r=o("0Pmq"),d=o("n+1h"),s=o("Wgwc"),u=o.n(s),m=o("09QT"),p=o("/tR3"),g=o("oQBk"),h=o("o0qI"),v=o("aNTj"),y=o("N0hu"),f=o("dDsW"),x=o("ECoa"),b=o("CJtR"),C=o("g/tz"),T=o("P5LW"),w=o("9L6u"),Z=o("hVZB");let CommunityCard=t=>{let{communityInfo:e,isFollowing:o,joinCommunity:l,isLoading:d,isMobile:s,isHome:u=!1}=t,{formatMessage:m}=(0,f.Z)(),{state:p}=(0,n.useContext)(h.I),{isLoggedIn:g}=p,{locale:v}=(0,T.h)();return(0,i.tZ)(Z.Wj,{"data-home":u,style:{position:"relative"},children:e?(0,i.BX)(i.HY,{children:[(0,i.tZ)("a",{href:"/community/".concat(null==e?void 0:e.slug),children:(0,i.tZ)(Z.P,{"data-home":u,style:{backgroundImage:"url('".concat(encodeURI((s?null==e?void 0:e.mobileCoverImage:null==e?void 0:e.coverImage)||""),"')")},children:(0,i.tZ)("div",{className:"thumbnail-container",children:(0,i.tZ)("img",{loading:"lazy",className:"thumbnail",src:null==e?void 0:e.thumbnail,alt:e.name})})})}),(0,i.BX)(Z.Ok,{"data-home":u,children:[(0,i.tZ)("a",{href:"/community/".concat(null==e?void 0:e.slug),children:(0,i.tZ)(a.H,{tag:"h5",children:null==e?void 0:e.name})}),(0,i.BX)("div",{className:"statictis",children:[(0,i.BX)("div",{className:"statictis-item",children:[(0,i.tZ)(r.T,{className:"number",size:"c1",color:c.r.colors.gray800,type:"bold",children:(0,w.dm)(null==e?void 0:e.topicsCount)}),(0,i.tZ)(r.T,{size:"p3",color:c.r.colors.gray600,children:m({id:"embedCommunity.card.topics",defaultMessage:"Topics"})})]}),(0,i.BX)("div",{className:"statictis-item",children:[(0,i.tZ)(r.T,{className:"number",size:"c1",color:c.r.colors.gray800,type:"bold",children:(0,w.dm)(null==e?void 0:e.postsCount)}),(0,i.tZ)(r.T,{size:"p3",color:c.r.colors.gray600,children:m({id:"embedCommunity.card.posts",defaultMessage:"Posts"})})]}),(null==e?void 0:e.membersCount)>=1e3&&(0,i.BX)("div",{className:"statictis-item",children:[(0,i.tZ)(r.T,{className:"number",size:"c1",color:c.r.colors.gray800,type:"bold",children:(0,w.dm)(null==e?void 0:e.membersCount)}),(0,i.tZ)(r.T,{size:"p3",color:c.r.colors.gray600,children:m({id:"embedCommunity.card.members",defaultMessage:"Members"})})]})]}),o?(0,i.tZ)("a",{href:"/community/".concat(null==e?void 0:e.slug),className:"no-replace-click",style:{textDecoration:"none"},children:(0,i.tZ)(y.B,{className:"button",size:"md",children:m({id:"together.embed.topicCard.joined",defaultMessage:"You joined"})})}):(0,i.tZ)(y.B,{dataEventCategory:"Together",dataEventAction:"Join Community",dataEventLabel:"".concat((0,b.UC)(v),"/community/").concat(null==e?void 0:e.slug),className:"button",size:"md",isDisabled:d,onClick:()=>{g?l():(0,C.p0)("".concat((0,b.UC)(v),"/community/on-boarding/?returnUrl=/").concat(null==e?void 0:e.slug),"communities","embeddedarticle",null==e?void 0:e.slug)},children:m({id:"together.embed.topicCard.joinNow",defaultMessage:"Join now"})})]})]}):(0,i.tZ)(x.Z,{height:383})})};var E=o("Biuj"),M=o("PnmO"),k=o("1dAL"),B=o("iv2E"),N=o("rIrU"),S=o("rnVk"),U=o("GvV+");let CardPostContent=t=>{let{className:e,style:o,replyingTo:l,mentionedUser:a,description:c,disableShortenContent:r,mentions:d=[],postUrl:s,isMobile:u}=t,{locale:m}=(0,T.h)(),{state:p}=(0,n.useContext)(h.I),{userInfo:g}=p,[v,y]=(0,n.useState)(!1),{formatMessage:x}=(0,f.Z)(),[w,E]=(0,n.useState)(!1),M=(0,U.Tn)((0,U.rz)(c||"","display"),d),k=u?70:200,N=(0,n.useMemo)(()=>{let t=(0,U.Nw)(M||"");if(r||v)return{showContent:t,hasSeeMore:!1};let e=t.slice(0,k),o=k-((e.match(/<\/div>/g)||[]).length-1)*27,i=(e||"").slice(0,o<40?40:o),n=(0,U.Nw)(i.replace(/(<|<\/)( +|[a-zA-Z]*)$/gi,"")),l=n.lengthE(!1),expertId:String(null==a?void 0:a.partnerId)}),(0,i.BX)(Z.z$,{className:"".concat(e," no-replace-click"),style:o,children:[O&&(0,i.BX)("span",{onClick:()=>P&&E(!0),className:"post-content-replying",children:["@",O]}),(null==c?void 0:c.startsWith("[mention+id="))&&(0,i.tZ)("span",{className:"post-content-replying tag-only",children:"@"}),(0,i.tZ)("span",{dangerouslySetInnerHTML:{__html:N.showContent},className:"post-content ".concat(N.hasSeeMore?"has-see-more":"")}),N.hasSeeMore&&!v&&(0,i.BX)("span",{children:["... ",(0,i.tZ)("span",{"data-event-category":"Together","data-event-action":"Click Post","data-event-label":"https://".concat(B.domainLocales[m]).concat(s),onClick:t=>{t.preventDefault(),t.stopPropagation(),(null==g?void 0:g.id)?y(!0):(0,C.p0)("".concat((0,b.mg)(m),"/community/on-boarding?return=").concat(encodeURIComponent((s||"").replace("/community",""))),"communities")},className:"see-more-text pointer-event-child-none",children:x({id:"home.seeMore",defaultMessage:"See more"})})]})]})]})},PostCard=t=>{var e,o;let{communityInfo:d,post:s,isMobile:u,isFollowing:m}=t,{state:p}=(0,n.useContext)(h.I),{locale:g}=(0,T.h)(),{formatMessage:v}=(0,f.Z)(),{isLoggedIn:y}=p,onClickPost=t=>{t.preventDefault(),y?window.location.href="/community/".concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug):N.Ew?M.u.getState().triggerLogin({returnUrl:"".concat((0,b.UC)(g),"/community/on-boarding/?returnUrl=/").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug,"?source=communities&action=embeddedarticle&campaign=").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug)}):window.location.href=(0,b.bT)("".concat((0,b.UC)(g),"/community/on-boarding/?returnUrl=/").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug,"?source=communities&action=embeddedarticle&campaign=").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug))},C=(null==s?void 0:s.liked)?"".concat(N.uQ,"/comment-heart.svg"):"".concat(N.uQ,"/heart.svg"),w=m?"".concat(N.Nr,"/writePen.svg"):"".concat(N.Nr,"/chevronLeftBlue.svg");return(0,i.tZ)(Z.Wj,{children:s?(0,i.BX)(i.HY,{children:[(0,i.BX)(Z.Tw,{children:[(0,i.tZ)("a",{"data-event-category":"Together","data-event-action":"Click Post","data-event-label":"https://".concat(B.domainLocales[g],"/community/").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),href:"/community/".concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),style:{textDecoration:"none"},className:"pointer-event-child-none",children:(0,i.tZ)(Z.Cl,{children:(0,i.BX)(Z.nt,{children:[(0,i.tZ)("div",{className:"avatar-container",children:(0,i.tZ)(E.A,{radius:"xl",src:null==s?void 0:null===(e=s.author)||void 0===e?void 0:e.avatar,size:40,color:c.r.colors.secondaryBase})}),(0,i.BX)("div",{className:"author-info",children:[(0,i.tZ)("div",{className:"author-name",children:(0,i.tZ)(r.T,{size:"md",type:"bold",children:null==s?void 0:null===(o=s.author)||void 0===o?void 0:o.name})}),(0,i.tZ)("div",{className:"speciality",children:(0,i.tZ)(k.T,{size:"md",contents:[(0,i.tZ)(r.T,{size:"p3",color:c.r.colors.gray500,type:"bold",className:"community-name",children:null==d?void 0:d.name},"1"),(0,i.tZ)(r.T,{size:"p3",color:c.r.colors.gray500,className:"create-time",children:null==s?void 0:s.createdTime},"2")],separator:(0,i.tZ)(Z.g4,{}),className:"position-container"})})]})]})})}),(0,i.BX)("div",{className:"content",children:[(0,i.tZ)("a",{href:"/community/".concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),style:{textDecoration:"none"},"data-event-category":"Together","data-event-action":"Click Post","data-event-label":"https://".concat(B.domainLocales[g],"/community/").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),className:"pointer-event-child-none",children:(0,i.tZ)(a.H,{tag:"h6",className:"post-title",children:null==s?void 0:s.title})}),(0,i.tZ)(CardPostContent,{className:"post-content-wrapper",description:s.description,disableShortenContent:!1,postUrl:"/community/".concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),isMobile:u,mentions:null==s?void 0:s.mentions})]})]}),(0,i.tZ)(l.D,{type:"solid",className:"post-divider"})," ",(0,i.BX)(Z.en,{children:[(0,i.BX)("div",{className:"like-comment",children:[(0,i.BX)("a",{"data-event-category":"Together","data-event-action":"Like Click","data-event-label":"https://".concat(B.domainLocales[g],"/community/").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),className:"action action-like pointer-event-child-none",href:"/community/".concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),onClick:onClickPost,children:[(0,i.tZ)("img",{loading:"lazy",src:C,alt:"heart-icon"}),null==s?void 0:s.likesCount]}),(0,i.BX)("a",{"data-event-category":"Together","data-event-action":"Comment Icon Click","data-event-label":"https://".concat(B.domainLocales[g],"/community/").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),className:"action action-comment",href:"/community/".concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),onClick:onClickPost,children:[(0,i.tZ)("img",{loading:"lazy",src:"".concat(N.uQ,"/comment.svg"),alt:"comment-icon"}),null==s?void 0:s.commentsCount]})]}),(0,i.BX)("a",{"data-event-category":"Together","data-event-action":"Comment Text Click","data-event-label":"https://".concat(B.domainLocales[g],"/community/").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),className:"write-comment pointer-event-child-none",href:"/community/".concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),onClick:onClickPost,children:[(0,i.tZ)("img",{loading:"lazy",src:w,alt:"left-chevron"}),v({id:"embedCommunity.card.comment",defaultMessage:"Comment"})]})]})]}):(0,i.tZ)(x.Z,{height:383})})},TopicCard=t=>{let{communityInfo:e,topics:o,leaveTopic:l,joinTopic:c,isLoading:d,selectedTopic:s,topicShows:u}=t,{state:m}=(0,n.useContext)(h.I),{isLoggedIn:p}=m,{locale:g}=(0,T.h)(),{formatMessage:v}=(0,f.Z)();return(0,i.tZ)(Z.Wj,{children:e?(0,i.BX)(i.HY,{children:[(0,i.tZ)(a.H,{tag:"h5",style:{padding:"16px 16px 8px 16px"},children:v({id:"together.embed.topicCard.title",defaultMessage:"{name} Topics"},{name:null==e?void 0:e.name})}),o.slice(0,u).map((t,o)=>(0,i.BX)(Z.uY,{"data-custom":!0,"data-has-followed":null==t?void 0:t.joined,children:[(0,i.BX)("a",{className:"info",href:"/community/".concat(null==e?void 0:e.slug,"/").concat(null==t?void 0:t.slug),children:[(0,i.tZ)("img",{loading:"lazy",src:null==t?void 0:t.thumbnail,className:"topic-thumbnail",alt:null==t?void 0:t.name}),(0,i.tZ)(r.T,{size:"label2",type:"bold",className:"title",children:null==t?void 0:t.name})]}),(0,i.tZ)(y.B,{dataEventCategory:"Together",dataEventAction:"Join Topic",dataEventLabel:"".concat((0,b.UC)(g),"/community/").concat(null==e?void 0:e.slug,"/").concat(null==t?void 0:t.slug),size:"md",color:"tertiary",className:"follow-btn",isDisabled:d&&s===(null==t?void 0:t.id),onClick:()=>{p?(null==t?void 0:t.joined)?l(null==t?void 0:t.id):c(null==t?void 0:t.id):(0,C.p0)("".concat((0,b.UC)(g),"/community/on-boarding/?returnUrl=/").concat(null==e?void 0:e.slug,"/").concat(null==t?void 0:t.slug),"communities","embeddedarticle","".concat(null==e?void 0:e.slug,"/").concat(null==t?void 0:t.slug))},children:(null==t?void 0:t.joined)?(0,i.BX)(i.HY,{children:[(0,i.tZ)("img",{loading:"lazy",src:"".concat(N.Nr,"/checkLight.svg"),alt:"check-icon"})," ",v({id:"together.embed.topicCard.following",defaultMessage:"Following"})]}):v({id:"together.embed.topicCard.follow",defaultMessage:"Follow"})})]},o)),o.length-u>0&&(0,i.BX)(Z.WG,{"data-event-category":"Together","data-event-action":"Join Topic","data-event-label":"".concat((0,b.UC)(g),"/community/").concat(null==e?void 0:e.slug),href:"/community/".concat(null==e?void 0:e.slug,"/#topic"),className:"pointer-event-child-none",children:[(0,i.tZ)(r.T,{size:"p3",children:v({id:"together.embed.topicCard.seeMore",defaultMessage:"See all topics"})}),(0,i.tZ)("img",{loading:"lazy",src:"".concat(N.Nr,"/chevronRightBlue.svg"),style:{width:"18px",height:"18px"},alt:"chevron-right"})]})]}):(0,i.tZ)(x.Z,{height:383})})},EmbeddedCommunity=t=>{let{titleMember:e,titleGuest:o,descriptionMember:s,descriptionGuest:y,communityId:f,isMobile:x,columns:b,showSeparatedLine:C=!0,isSpotlightLandingPage:T=!1}=t,{state:w}=(0,n.useContext)(h.I),{isLoggedIn:E}=w||{},[M,k]=(0,n.useState)(null),[B,N]=(0,n.useState)([]),[S,U]=(0,n.useState)([]),[O,P]=(0,n.useState)(!1),[I,L]=(0,n.useState)(-1),[D,z]=(0,n.useState)(!1),[X,_]=(0,n.useState)(null),G=x?4:5,fetchCommunityGuest=async()=>{var t,e,o,i;let n=await (0,m.d)(g.y.TOGETHER.GET_TOGETHER_COMMUNITY_DETAIL,{params:{communityId:f}},"together"),l=(null==n?void 0:n.data)?(0,p.tg)(null==n?void 0:n.data):{};k(l);let a=await (0,m.d)(g.y.TOGETHER.GET_TOGETHER_TOPICS,{params:{communityId:f}},"together");N(((null==a?void 0:null===(e=a.data)||void 0===e?void 0:null===(t=e.topics)||void 0===t?void 0:t.map(t=>(0,p.l2)(t)))||[]).filter(t=>null==t?void 0:t.isActive));let c=await (0,m.d)(g.y.TOGETHER.GET_TOGETHER_POST_LIST,{params:{communityId:f,sortBy:"popularity",reportStartDate:u()().subtract(6,"month").format("YYYY-MM-DD"),reportEndDate:u()().format("YYYY-MM-DD"),userType:1}},"together");U((null==c?void 0:null===(i=c.data)||void 0===i?void 0:null===(o=i.posts)||void 0===o?void 0:o.map(t=>(0,p.o9)(t)))||[])},fetchCommunityMember=async()=>{var t,e,o,i;let n=await (0,m.d)(g.y.TOGETHER.GET_TOGETHER_COMMUNITY_DETAIL,{params:{communityId:f}},"together"),l=(null==n?void 0:n.data)?(0,p.tg)(null==n?void 0:n.data):{};k(l),P(l.joined);let a=await (0,m.d)(g.y.TOGETHER.GET_TOGETHER_TOPICS,{params:{communityId:f}},"together");N(((null==a?void 0:null===(e=a.data)||void 0===e?void 0:null===(t=e.topics)||void 0===t?void 0:t.map(t=>(0,p.l2)(t)))||[]).filter(t=>null==t?void 0:t.isActive));let c=await (0,m.d)(g.y.TOGETHER.GET_TOGETHER_POST_LIST,{params:{communityId:f,sortBy:"popularity"}},"together");U((null==c?void 0:null===(i=c.data)||void 0===i?void 0:null===(o=i.posts)||void 0===o?void 0:o.map(t=>(0,p.o9)(t)))||[])};(0,n.useEffect)(()=>{E?fetchCommunityMember():fetchCommunityGuest()},[]),(0,n.useEffect)(()=>{v.E.measure(()=>{var t;let e=null===(t=document.getElementsByClassName("embed-community-".concat(f)))||void 0===t?void 0:t[0];(null==e?void 0:e.clientWidth)&&_((null==e?void 0:e.clientWidth)/2+10)})},[x]);let joinCommunity=async()=>{z(!0);let t=await (0,m.d)(g.y.TOGETHER.POST_TOGETHER_JOIN_COMMUNITY,{method:"POST",data:{ids:[f]}},"together");(null==t?void 0:t.status)===1&&P(!0),z(!1)},joinTopic=async t=>{if(z(!0),L(t),O){let e=await (0,m.d)(g.y.TOGETHER.POST_TOGETHER_JOIN_TOPIC,{method:"POST",data:{ids:[t]}},"together");(null==e?void 0:e.status)===1&&(fetchCommunityMember(),z(!1))}else{let e=await (0,m.d)(g.y.TOGETHER.POST_TOGETHER_JOIN_COMMUNITY,{method:"POST",data:{ids:[f]}},"together");if((null==e?void 0:e.status)===1){let e=await (0,m.d)(g.y.TOGETHER.POST_TOGETHER_JOIN_TOPIC,{method:"POST",data:{ids:[t]}},"together");(null==e?void 0:e.status)===1&&(fetchCommunityMember(),z(!1))}}},leaveTopic=async t=>{z(!0),L(t);let e=await (0,m.d)(g.y.TOGETHER.POST_TOGETHER_LEAVE_TOPIC,{method:"POST",data:{ids:[t]}},"together");(null==e?void 0:e.status)===1&&(fetchCommunityMember(),z(!1))},H=b||(x?1:2),R=x?283:352,j=b?void 0:X||R;return f?(0,i.BX)(Z.Lv,{className:"embed-community-".concat(f),children:[C&&(0,i.tZ)(l.D,{type:"solid",className:"big-divider"}),T?(0,i.tZ)(Z.X0,{children:(0,i.tZ)("h5",{children:O?e:o})}):(0,i.BX)(i.HY,{children:[(0,i.BX)(Z.X0,{children:[(0,i.tZ)("div",{className:"line"}),(0,i.tZ)(a.H,{tag:"h5",color:c.r.colors.secondaryBase,children:O?e:o})]}),(0,i.tZ)(r.T,{size:"md",color:c.r.colors.gray800,style:{marginTop:16},children:O?s:y})]}),(0,i.BX)(Z.Lq,{"data-custom-columns":void 0!==b,"data-column-count":H,children:[!E&&(0,i.BX)(d.S,{column:H,row:1,distanceOverlappedLeft:{amount:16,unit:"pixel"},isDotsShown:!x&&H<3,mode:x?"snapped":"infinity",type:"separated",isArrowShown:!x,customPageWidth:j,children:[(0,i.tZ)(CommunityCard,{communityInfo:M,isFollowing:O,isLoading:D,joinCommunity:joinCommunity,isMobile:x}),(0,i.tZ)(TopicCard,{communityInfo:M,topics:B,selectedTopic:I,leaveTopic:leaveTopic,joinTopic:joinTopic,isLoading:D,topicShows:G}),(0,i.tZ)(PostCard,{communityInfo:M,isFollowing:O,isMobile:x,post:null==S?void 0:S[0]})]}),E&&!O&&(0,i.BX)(d.S,{column:H,row:1,distanceOverlappedLeft:{amount:16,unit:"pixel"},isDotsShown:!x,mode:x?"snapped":"infinity",type:"separated",isArrowShown:!x,customPageWidth:j,children:[(0,i.tZ)(CommunityCard,{communityInfo:M,isFollowing:O,isLoading:D,joinCommunity:joinCommunity,isMobile:x}),(0,i.tZ)(TopicCard,{communityInfo:M,topics:B,selectedTopic:I,leaveTopic:leaveTopic,joinTopic:joinTopic,isLoading:D,topicShows:G}),(0,i.tZ)(PostCard,{communityInfo:M,isFollowing:O,isMobile:x,post:null==S?void 0:S[0]})]}),E&&O&&(0,i.BX)(d.S,{column:H,row:1,distanceOverlappedLeft:{amount:16,unit:"pixel"},isDotsShown:!x,mode:x?"snapped":"infinity",type:"separated",isArrowShown:!x,customPageWidth:j,children:[(0,i.tZ)(PostCard,{communityInfo:M,isFollowing:O,isMobile:x,post:null==S?void 0:S[0]}),(0,i.tZ)(PostCard,{communityInfo:M,isFollowing:O,isMobile:x,post:null==S?void 0:S[1]}),(0,i.tZ)(TopicCard,{communityInfo:M,topics:B,selectedTopic:I,leaveTopic:leaveTopic,joinTopic:joinTopic,isLoading:D,topicShows:G})]})]}),C&&(0,i.tZ)(l.D,{type:"solid",className:"big-divider"})]}):null}}}]);