@amityco/ui-kit-open-source 4.11.1 → 4.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1867,7 +1867,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[f6]+=1);var Ov=({theme:e})=>_
1867
1867
  `),mentionees:s}}var F2e={ltr:"ltr",rtl:"rtl"},mu=({namespace:e,theme:t,nodes:o,editorState:r,editable:i=!0})=>({namespace:e,editable:i,theme:a(a({},F2e),t),onError(n){throw n},nodes:o,editorState:r});var tg={textWithMention__container:"rg",textWithMention__mention:"wa",textWithMention__link:"ag",textWithMention__seeMore:"og"};var tl=({data:e,metadata:t,mentionees:o,pageId:r="*",maxLines:i=8,isBold:n=!1,componentId:a="*",seeMoreClassName:s,onClickSeeMoreButton:l,textClassName:m,linkClassName:c,mentionClassName:d})=>{let{goToUserProfilePage:u}=Y(),[g,f]=useState(!1),C=n?v.BodyBold:v.Body,y=useMemo(()=>su({data:e,mentionees:o,metadata:t}),[e,o,t]),b=(x,P)=>{var I;return nx(x)?ie__default.createElement("span",{key:v4$1(),"data-testid":`${r}/${a}/mention`,className:wl(tg.textWithMention__mention,d),onClick:()=>u(x.data.userId)},x.text):ax(x)||sx(x)?ie__default.createElement("a",{target:"_blank",key:x.url,href:x.url,rel:"noopener noreferrer",onMouseUp:w=>w.stopPropagation(),onTouchEnd:w=>w.stopPropagation(),onMouseDown:w=>w.stopPropagation(),onPointerUp:w=>w.stopPropagation(),onPointerDown:w=>w.stopPropagation(),onTouchStart:w=>w.stopPropagation(),className:wl(tg.textWithMention__link,c),"data-testid":`${r}/${a}/post_link`},eg(x.children[0])?(I=x.children[0])==null?void 0:I.text:x.url):eg(x)?ie__default.createElement(ie__default.Fragment,{key:P},x.text):null},_=x=>x.map((P,I)=>ie__default.createElement(ie__default.Fragment,{key:I},P.children.map((w,M)=>b(w,M)),ie__default.createElement("br",null)));return ie__default.createElement(C,{className:tg.textWithMention__container},g?_(y.root.children):ie__default.createElement(RE,{lines:i,ellipsis:ie__default.createElement(ie__default.Fragment,null,"..."," ",ie__default.createElement(oe,{variant:"text",className:wl(tg.textWithMention__seeMore,s),onPress:()=>l?l():f(!0)},ie__default.createElement(v.BodyBold,null," See more")))},ie__default.createElement("div",{className:wl(m)},_(y.root.children))))};var og=({commentId:e,reasonReport:t,onCloseMenu:o,isReplyComment:r})=>{let{success:i,info:n}=ce(),a=useQueryClient(),[s,l$1]=useState(!1),{isDesktop:m}=le(),{data:c,isLoading:d}=useQuery({queryKey:["asc-uikit","CommentRepository","isCommentFlaggedByMe",e],queryFn:()=>CommentRepository.isCommentFlaggedByMe(e),enabled:e!=null}),{mutateAsync:u,isPending:g}=useMutation({mutationFn:()=>l(void 0,null,function*(){if(e!=null)return CommentRepository.flagComment(e,t)}),onSuccess:()=>{i({content:`${r?"Reply":"Comment"} reported.`}),o==null||o();},onMutate:()=>l(void 0,null,function*(){yield a.cancelQueries({queryKey:["asc-uikit","CommentRepository","isCommentFlaggedByMe",e]}),a.setQueryData(["asc-uikit","CommentRepository","isCommentFlaggedByMe",e],()=>!0);}),onError:C=>{var y;(y=C.message)!=null&&y.includes("400400")?l$1(!0):n({content:`Failed to report ${r?"reply":"comment"}. Please try again.`,alignment:m?"fullscreen":"withSidebar"});},onSettled:()=>{a.invalidateQueries({queryKey:["asc-uikit","CommentRepository","isCommentFlaggedByMe",e]});}}),{mutateAsync:f}=useMutation({mutationFn:()=>l(void 0,null,function*(){if(e!=null)return CommentRepository.unflagComment(e)}),onSuccess:()=>{i({content:`${r?"Reply":"Comment"} unreported.`});},onMutate:()=>l(void 0,null,function*(){yield a.cancelQueries({queryKey:["asc-uikit","CommentRepository","isCommentFlaggedByMe",e]}),a.setQueryData(["asc-uikit","CommentRepository","isCommentFlaggedByMe",e],()=>!1);}),onError:()=>{n({content:`Failed to unreport ${r?"reply":"comment"}. Please try again.`,alignment:m?"fullscreen":"withSidebar"}),o==null||o();},onSettled:()=>{a.invalidateQueries({queryKey:["asc-uikit","CommentRepository","isCommentFlaggedByMe",e]});}});return {isLoading:d,isFlaggedByMe:c||!1,isCommentDeleted:s,isFlagLoading:g,mutateReportComment:u,mutateUnreportComment:f}};var $1=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 22 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M14.9062 12.3789L16.0312 11.2539C16.207 11.0781 16.5234 11.2188 16.5234 11.4648V16.5625C16.5234 17.5117 15.75 18.25 14.8359 18.25H2.46094C1.51172 18.25 0.773438 17.5117 0.773438 16.5625V4.1875C0.773438 3.27344 1.51172 2.5 2.46094 2.5H12.0586C12.3047 2.5 12.4453 2.81641 12.2695 2.99219L11.1445 4.11719C11.0742 4.1875 11.0039 4.1875 10.9336 4.1875H2.46094V16.5625H14.8359V12.5898C14.8359 12.5195 14.8359 12.4492 14.9062 12.3789ZM20.3906 5.3125L11.1797 14.5234L7.98047 14.875C7.06641 14.9805 6.29297 14.207 6.39844 13.293L6.75 10.0938L15.9609 0.882812C16.7695 0.0742188 18.0703 0.0742188 18.8789 0.882812L20.3906 2.39453C21.1992 3.20312 21.1992 4.50391 20.3906 5.3125ZM16.9453 6.36719L14.9062 4.32812L8.36719 10.8672L8.08594 13.1875L10.4062 12.9062L16.9453 6.36719ZM19.1953 3.58984L17.6836 2.07812C17.543 1.90234 17.2969 1.90234 17.1562 2.07812L16.1016 3.13281L18.1406 5.20703L19.2305 4.11719C19.3711 3.94141 19.3711 3.73047 19.1953 3.58984Z",fill:"currentColor"}));var $2e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 6 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M5.13281 4.71094L1.71094 8.17969C1.59375 8.29688 1.40625 8.29688 1.3125 8.17969L0.84375 7.71094C0.726562 7.59375 0.726562 7.42969 0.84375 7.3125L3.60938 4.5L0.84375 1.71094C0.726562 1.59375 0.726562 1.40625 0.84375 1.3125L1.3125 0.84375C1.40625 0.726562 1.59375 0.726562 1.71094 0.84375L5.13281 4.3125C5.25 4.42969 5.25 4.59375 5.13281 4.71094Z"})),du=$2e;var ol={textField:"tg",textField__labelWrapper:"ig",textField__label:"sg",textField__counter:"dg",textField__optional:"cg",textField__error:"lg",textField__disabled:"ng",textField__readonly:"mg",textField__input:"C"};var dx=ie__default.forwardRef((r,o)=>{var i=r,{className:e}=i,t=d(i,["className"]);let n=useRef(null),a$1=m=>{n.current=m,typeof o=="function"?o(m):o&&(o.current=m);},s=()=>{let m=n.current;m&&(m.style.height="3rem",m.style.height=`${m.scrollHeight}px`);};useEffect(()=>(s(),window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s);}),[]);let l=m=>{s(),t.onInput&&t.onInput(m);};return ie__default.createElement(TextArea,a({"aria-multiline":!0,className:wl(ol.textField__input,e),onInput:l,ref:a$1},t))});function cx(_){var x=_,{labelClassName:e,errorMessage:t,label:o,description:r,descriptionClassName:i,errorClassName:n,isError:a$1,isDisabled:s,isRequired:l,isReadOnly:m,isShowCounter:c,maxLength:d$1,minLength:u,counter:g,value:f="",className:C,children:y}=x,b$1=d(x,["labelClassName","errorMessage","label","description","descriptionClassName","errorClassName","isError","isDisabled","isRequired","isReadOnly","isShowCounter","maxLength","minLength","counter","value","className","children"]);return ie__default.createElement(TextField,b(a({},b$1),{className:wl(ol.textField,a$1&&ol.textField__error,s&&ol.textField__disabled,m&&ol.textField__readonly,C),isDisabled:s,isRequired:l,isReadOnly:m}),ie__default.createElement("div",{className:ol.textField__labelWrapper},ie__default.createElement("div",{className:ol.textField__label},o&&ie__default.createElement(Label,{className:e},ie__default.createElement(v.TitleBold,null,o)),!l&&ie__default.createElement(v.Caption,{className:wl(ol.textField__optional,i)},r)),c&&d$1&&ie__default.createElement(v.Caption,{className:ol.textField__counter},g?g(f):`${f.length}/${d$1}`)),y,t&&ie__default.createElement(FieldError,{className:n},t))}var ux=e=>ie__default.createElement("svg",a({fill:"none",width:"100%",height:"100%",viewBox:"0 0 61 42",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M58.3438 0.75C59.7148 0.75 60.875 1.91016 60.875 3.28125V38.7188C60.875 40.1953 59.7148 41.25 58.3438 41.25H5.1875C2.33984 41.25 0.125 39.0352 0.125 36.1875V6.65625C0.125 5.28516 1.17969 4.125 2.65625 4.125H6.875V3.28125C6.875 1.91016 7.92969 0.75 9.40625 0.75H58.3438ZM3.5 36.1875C3.5 37.1367 4.23828 37.875 5.1875 37.875C6.03125 37.875 6.875 37.1367 6.875 36.1875V7.5H3.5V36.1875ZM57.5 37.875V4.125H10.25V36.1875V36.293C10.25 36.7148 10.0391 37.4531 9.93359 37.875H57.5Z",fill:"currentColor"}),ie__default.createElement("path",{d:"M36.1875 21L39.3125 24.1562C39.7188 24.5312 39.7188 25.1562 39.3125 25.5312L38.625 26.2188C38.25 26.625 37.625 26.625 37.25 26.2188L34.125 23.0938L30.9688 26.2188C30.5938 26.625 29.9688 26.625 29.5938 26.2188L28.9062 25.5312C28.5 25.1562 28.5 24.5312 28.9062 24.1562L32.0312 21L28.9062 17.875C28.5 17.5 28.5 16.875 28.9062 16.5L29.5938 15.8125C29.9688 15.4062 30.5938 15.4062 30.9688 15.8125L34.125 18.9375L37.25 15.8125C37.625 15.4062 38.25 15.4062 38.625 15.8125L39.3125 16.5C39.7188 16.875 39.7188 17.5 39.3125 17.875L36.1875 21Z",fill:"currentColor"}));var Tc={failedToShow:"xa",failedToShow__icon:"hg",failedToShow__title:"gg",failedToShow__desc:"pg",failedToShow__button:"bg"};var Mc=({pageId:e="*",onBack:t,className:o})=>{let r="failed_to_show",{accessibilityId:i}=se({pageId:e,componentId:r});return ie__default.createElement("div",{"data-testid":i,className:wl(Tc.failedToShow,o)},ie__default.createElement(Z,{imgIcon:()=>ie__default.createElement(ux,{className:Tc.failedToShow__icon}),defaultIcon:()=>ie__default.createElement(ux,{className:Tc.failedToShow__icon})}),ie__default.createElement(v.Headline,{className:Tc.failedToShow__title},"Something went wrong"),ie__default.createElement(v.Body,{className:Tc.failedToShow__desc},"The content you\u2019re looking for is unavailable."),t&&ie__default.createElement(oe,{onPress:t,className:Tc.failedToShow__button},ie__default.createElement(v.Body,null,"Go Back")))};var fi={contentReportReason__container:"Ie",contentReportReason__titleContainer:"ya",contentReportReason__leftSpace:"ka",contentReportReason__titleContainer__leftMenu:"Ae",contentReportReason__title:"ja",contentReportReason__description:"za",contentReportReason__option:"ug",contentReportReason__angleRight:"Xa",contentReportReason__bottomContainer:"Ya",contentReportReason__submitButton:"fg",contentReportReason__content:"Ia",contentReportReason__textInput__label:"vg",contentReportReason__failed:"wg",contentReportReason__closeButton:"xg",contentReportReason__radioGroup:"yg"};var h8=({post:e,reasonReport:t,isFlaggable:o,onReportSuccess:r,onReportError:i,onUnreportSuccess:n,onUnreportError:a})=>{let s=useQueryClient(),l$1=(e==null?void 0:e.postId)||void 0,{data:m,isLoading:c}=useQuery({networkMode:"always",queryKey:["asc-uikit","PostRepository","isPostFlaggedByMe",l$1],queryFn:()=>PostRepository.isPostFlaggedByMe(l$1),enabled:l$1!=null&&o}),{mutateAsync:d,isPending:u}=useMutation({networkMode:"always",mutationFn:()=>l(void 0,null,function*(){return PostRepository.flagPost(e.postId,t)}),onMutate:()=>l(void 0,null,function*(){yield s.cancelQueries({queryKey:["asc-uikit","PostRepository","isPostFlaggedByMe",l$1]}),s.setQueryData(["asc-uikit","PostRepository","isPostFlaggedByMe",l$1],()=>!0);}),onSuccess:()=>{r==null||r();},onError:(f,C,y)=>{s.invalidateQueries({queryKey:["asc-uikit","PostRepository","isPostFlaggedByMe",l$1]}),i==null||i(f);},onSettled:()=>{s.invalidateQueries({queryKey:["asc-uikit","PostRepository","isPostFlaggedByMe",l$1]});}}),{mutateAsync:g}=useMutation({networkMode:"always",mutationFn:()=>l(void 0,null,function*(){return PostRepository.unflagPost(e.postId)}),onMutate:()=>l(void 0,null,function*(){yield s.cancelQueries({queryKey:["asc-uikit","PostRepository","isPostFlaggedByMe",l$1]}),s.setQueryData(["asc-uikit","PostRepository","isPostFlaggedByMe",l$1],()=>!1);}),onSuccess:()=>{n==null||n();},onError:(f,C,y)=>{s.invalidateQueries({queryKey:["asc-uikit","PostRepository","isPostFlaggedByMe",l$1]}),a==null||a(f);},onSettled:()=>{s.invalidateQueries({queryKey:["asc-uikit","PostRepository","isPostFlaggedByMe",l$1]});}});return {isLoading:c,isFlaggedByMe:m||!1,mutateReportPost:d,mutateUnReportPost:g,isPending:u}};var dU=({messageId:e,reasonReport:t,onCloseMenu:o})=>{let{success:r,info:i}=ce(),n=useQueryClient(),[a,s]=useState(!1),{isDesktop:l$1}=le(),m=["asc-uikit","MessageRepository","isMessageFlaggedByMe",e],{data:c,isLoading:d}=useQuery({queryKey:m,queryFn:()=>MessageRepository.isMessageFlaggedByMe(e),enabled:e!=null}),{mutateAsync:u,isPending:g}=useMutation({mutationFn:()=>l(void 0,null,function*(){if(e!=null)return MessageRepository.flagMessage(e,t)}),onSuccess:()=>{r({content:"Message reported."}),o==null||o();},onMutate:()=>l(void 0,null,function*(){yield n.cancelQueries({queryKey:m}),n.setQueryData(m,()=>!0);}),onError:C=>{var y;(y=C.message)!=null&&y.includes("400400")?s(!0):i({content:"Failed to report message. Please try again.",alignment:l$1?"fullscreen":"withSidebar"});},onSettled:()=>{n.invalidateQueries({queryKey:m});}}),{mutateAsync:f}=useMutation({mutationFn:()=>l(void 0,null,function*(){if(e!=null)return MessageRepository.unflagMessage(e)}),onSuccess:()=>{r({content:"Message unreported."});},onMutate:()=>l(void 0,null,function*(){yield n.cancelQueries({queryKey:m}),n.setQueryData(m,()=>!1);}),onError:()=>{i({content:"Failed to unreport Message. Please try again.",alignment:l$1?"fullscreen":"withSidebar"}),o==null||o();},onSettled:()=>{n.invalidateQueries({queryKey:m});}});return {isLoading:d,isFlaggedByMe:c||!1,isMessageDeleted:a,isFlagLoading:g,mutateReportMessage:u,mutateUnreportMessage:f}};var il=({pageId:e="*",componentId:t="*",className:o,onCloseMenu:r,post:i,comment:n,message:a$1,showReportPostButton:s})=>{let[m,c]=useState(!1),[d,u]=useState(""),[g,f]=useState(void 0),[C,y]=useState(!1),{online:b}=useNetworkState(),{isDesktop:_}=le(),{success:x,info:P}=ce(),{closePopup:I}=Se(),w=re=>{u(re.target.value);},M=re=>{re.key==="Enter"&&re.preventDefault();},T=()=>{if(i)return G();if(n)return H();if(a$1)return O()},E=re=>{let W=re;f(W),W===ContentFlagReasonEnum.Others&&c(!0);},N=()=>{I(),r==null||r();},{isLoading:A,isPending:D,mutateReportPost:G}=h8({post:i,reasonReport:g===ContentFlagReasonEnum.Others?d:g,isFlaggable:s,onReportSuccess:()=>{x({content:"Post reported."}),r==null||r(),I();},onReportError:re=>{var W;(W=re.message)!=null&&W.includes("400400")?y(!0):P({content:"Failed to report post. Please try again.",alignment:_?"fullscreen":"withSidebar"});},onUnreportSuccess:()=>{x({content:"Post unreported."}),r==null||r();},onUnreportError:()=>{P({content:"Failed to unreport post. Please try again.",alignment:_?"fullscreen":"withSidebar"}),r==null||r();}}),{mutateReportComment:H,isCommentDeleted:$,isFlagLoading:j}=og({commentId:n==null?void 0:n.commentId,reasonReport:g===ContentFlagReasonEnum.Others?d:g,onCloseMenu:N,isReplyComment:(n==null?void 0:n.parentId)!=null}),{mutateReportMessage:O,isFlagLoading:z}=dU({messageId:a$1==null?void 0:a$1.messageId,reasonReport:g===ContentFlagReasonEnum.Others?d:g,onCloseMenu:N}),k=!g||!b||D||j||z;useEffect(()=>{b||P({content:"No internet connection.",alignment:_?"fullscreen":"withSidebar"});},[b]);let F=useMemo(()=>[{value:ContentFlagReasonEnum.CommunityGuidelines},{value:ContentFlagReasonEnum.HarassmentOrBullying},{value:ContentFlagReasonEnum.SelfHarmOrSuicide},{value:ContentFlagReasonEnum.ViolenceOrThreateningContent},{value:ContentFlagReasonEnum.SellingRestrictedItems},{value:ContentFlagReasonEnum.SexualContentOrNudity},{value:ContentFlagReasonEnum.SpamOrScams},{value:ContentFlagReasonEnum.FalseInformation},{value:ContentFlagReasonEnum.Others,hasAngleRight:!0}],[]);return ie__default.createElement("div",{"data-iserror":C||$,className:wl(fi.contentReportReason__container,o)},C||$?ie__default.createElement(Mc,{className:fi.contentReportReason__failed}):ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("div",{className:fi.contentReportReason__titleContainer},ie__default.createElement("div",{"data-options":!_&&m,className:fi.contentReportReason__titleContainer__leftMenu},m?ie__default.createElement(ze,{onPress:()=>{f(void 0),c(!1);}}):ie__default.createElement("div",{className:fi.contentReportReason__leftSpace}),ie__default.createElement(v.TitleBold,{className:fi.contentReportReason__title},m?"Others":"Report reason")),ie__default.createElement(ot,{onPress:N,defaultClassName:fi.contentReportReason__closeButton})),ie__default.createElement("div",{className:fi.contentReportReason__content},m?ie__default.createElement("div",null,ie__default.createElement(cx,{label:"Describe the reason",description:"(Optional)",isShowCounter:!0,isRequired:!1,maxLength:300,counter:re=>`${re.length}/300`,labelClassName:fi.contentReportReason__textInput__label,value:d},ie__default.createElement(dx,{placeholder:"Share more details about this issue",value:d,onChange:w,onKeyDown:M,maxLength:300,disabled:A||j}))):ie__default.createElement(ie__default.Fragment,null,ie__default.createElement(v.Caption,{as:"p",className:fi.contentReportReason__description},"Tell us why you're reporting this content. Your report will be reviewed by our moderators and kept confidential."),ie__default.createElement(ds,{className:fi.contentReportReason__radioGroup,radios:F.map(re=>a({value:re.value,label:ie__default.createElement(v.BodyBold,{className:fi.contentReportReason__option},re.value),isDisabled:A||j},re.hasAngleRight&&{icon:ie__default.createElement(du,{className:fi.contentReportReason__angleRight}),onIconClick:()=>{f(ContentFlagReasonEnum.Others),c(!0);}})),onChange:E,value:g||void 0})))),ie__default.createElement("div",{className:fi.contentReportReason__bottomContainer},C||$?ie__default.createElement(oe,{"data-testid":`${e}/${t}/close_button`,className:fi.contentReportReason__submitButton,onPress:N},"Close"):ie__default.createElement(oe,{"data-testid":`${e}/${t}/submit_button`,isDisabled:k,type:"submit",className:fi.contentReportReason__submitButton,onPress:T},"Submit")))};var due=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M3.85195 7.0402V19.9C3.85195 20.425 4.22695 20.8 4.75195 20.8C5.23945 20.8 5.65195 20.425 5.65195 19.9V16.15L8.65195 15.4C10.1895 15.025 11.802 15.2125 13.227 15.925C14.135 16.3689 15.1082 16.6065 16.0823 16.6262L12.3156 13.6738C10.9719 13.3415 9.55103 13.3377 8.20195 13.675L5.65195 14.3125V8.45101L3.85195 7.0402Z",fill:"currentColor"}),ie__default.createElement("path",{d:"M15.2882 14.7332L17.5317 16.4916C17.8768 16.4194 18.2179 16.3182 18.552 16.1875L19.5354 15.8222L17.8699 14.5168C17.028 14.8294 16.1389 14.8979 15.2882 14.7332Z",fill:"currentColor"}),ie__default.createElement("path",{d:"M6.12051 5.30784L5.65195 5.42498V7.18045L3.85195 5.76964V3.52977L6.12051 5.30784Z",fill:"currentColor"}),ie__default.createElement("path",{d:"M18.852 14.016V5.08748C16.7145 5.94998 14.3145 5.87498 12.2895 4.86248C11.352 4.37498 10.2645 4.26248 9.25195 4.52498L7.34955 5.00058L3.87818 2.27978C3.97191 1.89442 4.30839 1.59998 4.75195 1.59998C5.23945 1.59998 5.65195 2.01248 5.65195 2.49998V3.54998L8.83945 2.76248C10.2645 2.42498 11.7645 2.57498 13.077 3.24998C14.802 4.11248 16.8645 4.11248 18.5895 3.24998L18.9645 3.06248C19.7145 2.68748 20.652 3.24998 20.652 4.11248V14.575C20.652 14.8335 20.5701 15.0648 20.4332 15.2554L18.852 14.016Z",fill:"currentColor"}),ie__default.createElement("path",{d:"M0.439353 1.975C0.739353 1.5625 1.30185 1.4875 1.67685 1.825L23.8769 19.225C24.2894 19.525 24.3644 20.0875 24.0269 20.4625C23.7269 20.875 23.1644 20.95 22.7894 20.6125L0.589354 3.2125C0.176853 2.9125 0.101853 2.35 0.439353 1.975Z",fill:"currentColor"})),pu=due;var nl={commentOptions__actionButton:"kg",commentOptions__actionButton__icon:"jg",commentOptions__deleteButton__icon:"zg",commentOptions__actionButton__text:"Xg",commentOptions__deleteButton__text:"Yg",commentOptions__reportReason:"Ig"};var uu=({pageId:e="*",componentId:t="*",comment:o,handleEditComment:r,handleDeleteComment:i,onCloseMenu:n})=>{let{userRoles:a}=Ne(),[s,l]=useState(ContentFlagReasonEnum.Others),m=o.parentId!=null,{openPopup:c}=Se(),{isDesktop:d}=le(),[u,g]=useState(!1),{isFlaggedByMe:f,mutateUnreportComment:C}=og({commentId:o.commentId,reasonReport:s,isReplyComment:m}),{canDelete:y,canEdit:b,canReport:_}=J6(o,!1,a);ce();let x=()=>{d?(n(),c({pageId:e,view:"desktop",isDismissable:!1,children:ie__default.createElement(il,{pageId:e,componentId:t,comment:o,showReportPostButton:!1,onCloseMenu:n})})):g(!0);},P=()=>{n(),C();},I=[b?{name:"Edit comment",action:r,icon:ie__default.createElement($1,{className:nl.commentOptions__actionButton__icon}),accessibilityId:"edit_comment",textStyle:nl.commentOptions__actionButton__text}:null,_?{name:f?m?"Unreport reply":"Unreport comment":m?"Report reply":"Report comment",action:f?P:x,icon:f?ie__default.createElement(pu,{className:nl.commentOptions__actionButton__icon}):ie__default.createElement(V3,{className:nl.commentOptions__actionButton__icon}),accessibilityId:"report_comment",textStyle:nl.commentOptions__actionButton__text}:null,y?{name:"Delete comment",action:i,icon:ie__default.createElement(uc,{className:nl.commentOptions__deleteButton__icon}),accessibilityId:"delete_comment",textStyle:nl.commentOptions__deleteButton__text}:null].filter(Yi);return ie__default.createElement(ie__default.Fragment,null,!u&&I.map((w,M)=>ie__default.createElement("div",{"data-testid":`${e}/${t}/${w.accessibilityId}`,className:nl.commentOptions__actionButton,key:M,onClick:()=>{w.action();}},w.icon,ie__default.createElement("div",{className:w.textStyle},ie__default.createElement(v.BodyBold,null,w.name)))),u&&ie__default.createElement(il,{pageId:e,componentId:t,className:nl.commentOptions__reportReason,comment:o,showReportPostButton:!1,onCloseMenu:n}))};var Sc={editorPlaceholder:"Ag",editorParagraph:"Mg",editorContainer:"Aa",editorEditableContent:"Ma",editorLink:"Sg",commentInput__mentionInterceptor:"Cg"};var pU={mention:"Eg"};function yue({domNode:e,data:t}){let o=e.textContent;return o!==null?{node:W1({text:o,data:t})}:null}var bm=class e extends TextNode{static getType(){return "mention"}static clone(t){return new e({data:t.__data,text:t.__text,key:t.__key})}static importJSON(t){let o=W1({text:t.text,data:t.data});return o.setTextContent(t.text),o.setFormat(t.format),o.setDetail(t.detail),o.setMode(t.mode),o.setStyle(t.style),o}constructor({text:t,data:o,key:r}){super(t,r),this.__data=o;}exportJSON(){return b(a({},super.exportJSON()),{data:this.__data,type:"mention",version:1})}createDOM(t){let o=super.createDOM(t);return o.className=pU.mention,o.setAttribute("data-testid","mention-preview"),o}exportDOM(){let t=document.createElement("span");return t.setAttribute("data-lexical-mention","true"),t.setAttribute("data-mention-data",JSON.stringify(this.__data)),t.textContent=this.__text,{element:t}}isSegmented(){return !1}static importDOM(){return {span:t=>t.hasAttribute("data-lexical-mention")?{conversion:o=>{var r;return yue({domNode:o,data:JSON.parse((r=o.getAttribute("data-mention-data"))!=null?r:"{}")})},priority:1}:null}}isTextEntity(){return !0}isToken(){return !0}canInsertTextBefore(){return !1}canInsertTextAfter(){return !1}};function W1({text:e,data:t}){return new bm({data:t,text:e}).setMode("segmented").toggleDirectionless()}var vue=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,_ue=[e=>{let t=vue.exec(e);if(t===null)return null;let o=t[0];return {index:t.index,length:o.length,text:o,url:o.startsWith("http")?o:`https://${o}`}}],gu=()=>ie__default.createElement(AutoLinkPlugin,{matchers:_ue});var fu=()=>ie__default.createElement(LinkPlugin,{validateUrl:eU});var gU=`\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'"~=<>_:;`,kue="\\b[A-Z][^\\s"+gU+"]",Bue={NAME:kue,PUNCTUATION:gU},fU=Bue.PUNCTUATION,hx=["@"].join(""),yU="[^"+hx+fU+"\\s]",Eue="(?:\\.[ |$]| |["+fU+"]|)",Aue=75,Lue=new RegExp("(^|\\s|\\()(["+hx+"]((?:"+yU+Eue+"){0,"+Aue+"}))$"),Fue=50,Due=new RegExp("(^|\\s|\\()(["+hx+"]((?:"+yU+"){0,"+Fue+"}))$");function Vue(e,t){let o=Lue.exec(e);if(o===null&&(o=Due.exec(e)),o!==null){let r=o[1],i=o[3];if(i.length>=t)return {leadOffset:o.index+r.length,matchingString:i,replaceableString:o[2]}}return null}function Uue(e){return Vue(e,0)}var yx=class extends MenuOption{constructor({data:t,dataId:o}){super(o),this.data=t;}};function yu({suggestions:e,getSuggestionId:t,onQueryChange:o,$createNode:r,menuRenderFn:i,commandPriority:n,anchorClassName:a}){let[s]=useLexicalComposerContext(),l=useMemo(()=>e.map(d=>new yx({data:d,dataId:t(d)})),[e]),m=useCallback((d,u,g)=>{s.update(()=>{let f=r(d.data,d.key),C=$createTextNode(" ");u&&($insertNodes([C]),C.insertBefore(u),u.replace(f)),C.select(),g();});},[s]),c=useCallback(d=>Uue(d),[s]);return ie__default.createElement(LexicalTypeaheadMenuPlugin,{anchorClassName:a,onQueryChange:o,onSelectOption:m,triggerFn:c,options:l,menuRenderFn:i,commandPriority:n})}var al=({displayName:e,limit:t,enabled:o=!0,matchType:r})=>{let[i,n]=useState([]),[a,s]=useState(!1),[l,m]=useState(!1),[c,d]=useState(!1),u=useRef(null),g=useRef(null),f=()=>{u.current&&(u.current(),d(!0));};return useEffect(()=>{if(g.current&&(g.current(),g.current=null),!o)return;let C=UserRepository.searchUserByDisplayName({displayName:e,limit:t,matchType:r},y=>{m(y.hasNextPage||!1),s(y.loading),u.current=y.onNextPage||null,n(y.data);});return g.current=C,()=>{var y;(y=g.current)==null||y.call(g),g.current=null;}},[e,t,o]),{users:i,isLoading:a,hasMore:l,loadMore:f,loadMoreHasBeenCalled:c}};var hu=({communityId:e,displayName:t,limit:o,enabled:r=!0})=>{let[i,n]=useState([]),[a,s]=useState(!1),[l,m]=useState(!1),[c,d]=useState(!1),u=useRef(null),g=useRef(null),f=()=>{u.current&&(u.current(),d(!0));};return useEffect(()=>{if(!r)return;g.current&&(g.current(),g.current=null);let C=CommunityRepository.Membership.searchMembers({communityId:e,search:t,limit:o,sortBy:"displayName",includeDeleted:!1},y=>{m(y.hasNextPage||!1),s(y.loading),u.current=y.onNextPage||null,n(y.data);});return g.current=C,()=>{var y;(y=g.current)==null||y.call(g),g.current=null;}},[e,t,r]),{members:i,isLoading:a,hasMore:l,loadMore:f,loadMoreHasBeenCalled:c}};var $ue=({communityId:e,shouldCall:t=!0})=>{let n=Cn({fetcher:CommunityRepository.getCommunity,params:e,shouldCall:t&&!!e}),{item:o,error:r}=n,i=d(n,["item","error"]);return a({community:o,error:r},i)},Ct=$ue;var Zue=e=>ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},e),ie__default.createElement("path",{d:"M13.6435 20.7628C12.5251 21.8728 11.4652 21.8812 10.3552 20.7628L9.10328 19.5109C8.98644 19.394 8.88629 19.3607 8.73606 19.3607H6.9667C5.38931 19.3607 4.63817 18.6095 4.63817 17.0321V15.2628C4.63817 15.1125 4.59644 15.004 4.48794 14.8955L3.23604 13.6353C2.12602 12.5253 2.11767 11.4653 3.23604 10.3553L4.48794 9.10342C4.59644 8.99492 4.63817 8.88642 4.63817 8.73619V6.96684C4.63817 5.37275 5.38931 4.6383 6.9667 4.6383H8.73606C8.88629 4.6383 8.99478 4.59657 9.10328 4.48807L10.3552 3.24452C11.4652 2.11781 12.5251 2.11781 13.6435 3.23617L14.8954 4.48807C15.0039 4.59657 15.1124 4.6383 15.2626 4.6383H17.032C18.6094 4.6383 19.3605 5.38944 19.3605 6.96684V8.73619C19.3605 8.88642 19.4023 8.98657 19.5108 9.10342L20.7627 10.3553C21.8727 11.4653 21.881 12.5253 20.7627 13.6353L19.5108 14.8955C19.4023 15.004 19.3605 15.1125 19.3605 15.2628V17.0321C19.3605 18.6095 18.6094 19.3607 17.032 19.3607H15.2626C15.1124 19.3607 15.0123 19.394 14.8954 19.5109L13.6435 20.7628Z",fill:"url(#paint0_linear_482_20867)"}),ie__default.createElement("path",{d:"M9.90432 15.9736C10.0879 16.1656 10.3216 16.2741 10.6137 16.2741C10.9225 16.2741 11.1729 16.1656 11.3649 15.9152L16.047 9.34691C16.1722 9.17164 16.2389 8.96299 16.2389 8.79607C16.2389 8.312 15.8717 7.95312 15.3543 7.95312C15.0204 7.95312 14.8034 8.06997 14.6031 8.35373L10.5803 14.0958L8.56896 11.8507C8.38535 11.6504 8.1767 11.5586 7.89293 11.5586C7.37548 11.5586 7.0166 11.9175 7.0166 12.4182C7.0166 12.6269 7.09172 12.8355 7.2336 12.9858L9.90432 15.9736Z",fill:"white"}),ie__default.createElement("defs",null,ie__default.createElement("linearGradient",{id:"paint0_linear_482_20867",x1:"5.40039",y1:"4.79844",x2:"5.40039",y2:"23.3984",gradientUnits:"userSpaceOnUse"},ie__default.createElement("stop",{stopColor:"#FFDB7D"}),ie__default.createElement("stop",{offset:"1",stopColor:"#D49900"})))),vU=Zue;var Mn=({className:e})=>ie__default.createElement(vU,{className:e});var sl={userMentionItem__item:"Me",allMentionItem__item:"Se",userMentionItem__avatar:"Rg",allMentionItem__atSign:"Ug",userMentionItem__displayName:"Bg",allMentionItem__displayName:"Fg",userMentionItem__rightPane:"Hg",userMentionItem__brandIcon:"Lg"};function vu({option:e,onClick:t,isSelected:o,onMouseEnter:r,pageId:i="*",componentId:n="*"}){let{user:a}=qe({userId:e.data.userId});return ie__default.createElement(oe,{key:e.key,onPress:t,ref:e.setRefElement,"aria-selected":o,onHoverStart:r,"data-is-selected":o,className:sl.userMentionItem__item,"data-testid":`${i}/${n}/mention_item`,variant:"text"},ie__default.createElement("div",null,ie__default.createElement(Ae,{pageId:i,componentId:n,userId:e.data.userId,className:sl.userMentionItem__avatar})),ie__default.createElement("div",{className:sl.userMentionItem__rightPane},ie__default.createElement("p",{className:sl.userMentionItem__displayName},a==null?void 0:a.displayName),a!=null&&a.isBrand?ie__default.createElement(Mn,{className:sl.userMentionItem__brandIcon}):null))}var Que=({node:e,onIntersect:t,onLeave:o,options:r})=>{useEffect(()=>{if(e==null)return;let i=new IntersectionObserver(n=>{var a;return ((a=n[0])==null?void 0:a.isIntersecting)&&t()},r);return i.observe(e),()=>i.disconnect()},[e,t,r,o]);},ke=Que;var d0e=e=>{let[t,o]=useState(null),{community:r,isLoading:i}=Ct({communityId:e}),n=useMemo(()=>!!e&&!i&&!(r!=null&&r.isPublic),[e,i,r]),{members:a,hasMore:s,isLoading:l,loadMore:m}=hu({communityId:e||"",displayName:t||"",limit:10,enabled:n}),{users:c,hasMore:d,loadMore:u,isLoading:g}=al({displayName:t||"",limit:10,enabled:!n}),f=x=>{o(x);},C=useMemo(()=>e&&i?[]:n?a.map(({user:x,userId:P})=>({userId:(x==null?void 0:x.userId)||P,displayName:x==null?void 0:x.displayName})):c.map(({displayName:x,userId:P})=>({userId:P,displayName:x})),[c,a,n,i]),y=useMemo(()=>n?s:d,[n,s,d]),b=()=>{_||!y||(n?m():u());},_=useMemo(()=>n?l:g,[l,g,n]);return {suggestions:C,queryString:t,onQueryChange:f,loadMore:b,hasMore:y,isLoading:_}},c0e=[AutoLinkNode,LinkNode,bm],_u=forwardRef(({pageId:e="*",componentId:t="*",communityId:o,value:r,onChange:i,maxLines:n=10,placehoder:a$1,mentionContainer:s,mentionContainerClassName:l},m)=>{var E;let[c,d]=useState(null),u="comment_input",{themeStyles:g,uiReference:f,config:C,accessibilityId:y}=S({pageId:e,componentId:t,elementId:u}),{onQueryChange:b$1,suggestions:_,isLoading:x,loadMore:P,hasMore:I}=d0e(o);ke({onIntersect:()=>{x===!1&&P();},node:c,options:{threshold:.7}});let w=ie__default.useRef(null),M=()=>{var N;(N=w.current)==null||N.update(()=>{$getRoot().clear();}),setTimeout(()=>{var A;(A=w.current)==null||A.blur();},500);};useImperativeHandle(m,()=>({clearEditorState:M}));let T=mu({namespace:f,theme:{placeholder:Sc.editorPlaceholder,paragraph:Sc.editorParagraph,link:Sc.editorLink},nodes:c0e});return ie__default.createElement(LexicalComposer,{initialConfig:a(a({},T),(E=r==null?void 0:r.data)!=null&&E.text?{editorState:JSON.stringify(su(r))}:{})},ie__default.createElement("div",{className:Sc.editorContainer,style:{"--asc-max-lines":n}},ie__default.createElement(RichTextPlugin,{contentEditable:ie__default.createElement(ContentEditable,{"data-testid":y,className:Sc.editorEditableContent}),placeholder:a$1?ie__default.createElement("div",{className:Sc.editorPlaceholder},a$1):null,ErrorBoundary:LexicalErrorBoundary}),ie__default.createElement(OnChangePlugin,{onChange:(N,A)=>{i(lu(A));}}),ie__default.createElement(HistoryPlugin,null),ie__default.createElement(AutoFocusPlugin,null),ie__default.createElement(fu,null),ie__default.createElement(gu,null),ie__default.createElement(EditorRefPlugin,{editorRef:w}),ie__default.createElement(yu,{suggestions:_,getSuggestionId:N=>N.userId,onQueryChange:b$1,$createNode:N=>W1({text:`@${(N==null?void 0:N.displayName)||""}`,data:N}),menuRenderFn:(N,{options:A,selectedIndex:D,setHighlightedIndex:G,selectOptionAndCleanUp:H})=>{if(A.length===0)return null;let $=A.map((j,O)=>ie__default.createElement(vu,{pageId:e,componentId:t,isSelected:D===O,onClick:()=>{G(O),H(j);},onMouseEnter:()=>{G(O);},key:j.key,option:b(a({},j),{setRefElement:z=>{O===A.length-1&&d(z),j.setRefElement(z);}})}));return s?_U.createPortal($,s):N!=null&&N.current?_U.createPortal(ie__default.createElement("div",{className:l},$),N.current):null},commandPriority:COMMAND_PRIORITY_HIGH})))});var u0e=20;function Ao({targetType:e,targetId:t,feedType:o,dataTypes:r,limit:i=u0e}){let s=it({fetcher:PostRepository.getPosts,params:{targetType:e,targetId:t,feedType:o,dataTypes:r,limit:i},shouldCall:!!t&&!!e}),{items:n}=s,a$1=d(s,["items"]);return a({posts:n},a$1)}var kc=(n=>(n.MEMBER="member",n.MODERATOR="moderator",n.SUPER_MODERATOR="super-moderator",n.COMMUNITY_MODERATOR="community-moderator",n.CHANNEL_MODERATOR="channel-moderator",n))(kc||{});var{COMMUNITY_MODERATOR:f0e}=kc;function Lo({communityId:e,shouldCall:t=!0}){let i=it({fetcher:CommunityRepository.Membership.getMembers,params:{communityId:e,roles:[f0e],limit:20},shouldCall:!!e&&t}),{items:o}=i,r=d(i,["items"]);return a({moderators:o},r)}var C0e=({post:e,childrenPosts:t=[],community:o,userId:r})=>{var g,f,C;let{moderators:i}=Lo({communityId:o==null?void 0:o.communityId}),{client:n}=Xt(),{posts:a$1}=Ao({targetType:"community",targetId:o==null?void 0:o.communityId,feedType:"reviewing"}),s=useMemo(()=>!t.find(y=>y.dataType==="liveStream"||y.dataType==="poll"),[t]),l=i.find(y=>y.userId===r),m=(e==null?void 0:e.postedUserId)===r,c=useMemo(()=>(o==null?void 0:o.postSetting)!=CommunityPostSettings.ANYONE_CAN_POST?a$1.find(y=>y.postId===(e==null?void 0:e.postId))!=null:!1,[o,a$1]),d=l!=null,u={canEdit:!1,canReport:!1,canDelete:!1,canReview:!1};if(m)!c&&s&&(u.canEdit=!0),u.canDelete=!0;else {if(o!=null){let y=(g=n==null?void 0:n.hasPermission("EDIT_COMMUNITY_POST").community(o.communityId))!=null?g:!1;u.canEdit=y&&s;let b=(f=n==null?void 0:n.hasPermission("DELETE_COMMUNITY_POST").community(o.communityId))!=null?f:!1;u.canDelete=b;}else {let y=(C=n==null?void 0:n.hasPermission("EDIT_USER_FEED_POST").currentUser())!=null?C:!1;u.canDelete=y;}c||(u.canReport=!0);}return a({isPostUnderReview:c,isModerator:d},u)},x8=C0e;var P8=t=>{var e=d(t,[]);return ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 16 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M9.6875 2.25C9.6875 3.19922 8.91406 3.9375 8 3.9375C7.05078 3.9375 6.3125 3.19922 6.3125 2.25C6.3125 1.33594 7.05078 0.5625 8 0.5625C8.91406 0.5625 9.6875 1.33594 9.6875 2.25ZM13.9062 0.5625C14.8203 0.5625 15.5938 1.33594 15.5938 2.25C15.5938 3.19922 14.8203 3.9375 13.9062 3.9375C12.957 3.9375 12.2188 3.19922 12.2188 2.25C12.2188 1.33594 12.957 0.5625 13.9062 0.5625ZM2.09375 0.5625C3.00781 0.5625 3.78125 1.33594 3.78125 2.25C3.78125 3.19922 3.00781 3.9375 2.09375 3.9375C1.14453 3.9375 0.40625 3.19922 0.40625 2.25C0.40625 1.33594 1.14453 0.5625 2.09375 0.5625Z"}))};var Cx={menuButton:"Tg",menuButton__button:"Ce"};function rg({onClick:e,className:t,pageId:o="*",iconClassName:r,componentId:i="*"}){let n="menu_button",{isExcluded:a,accessibilityId:s,themeStyles:l,config:m,defaultConfig:c,uiReference:d}=S({pageId:o,componentId:i,elementId:n});return a?null:ie__default.createElement(V,{onPress:e,"aria-label":"Click to open menu","data-testid":s,className:wl(Cx.menuButton__button,t)},ie__default.createElement(Z,{configIconName:m.icon,defaultIconName:c.icon,imgIcon:()=>ie__default.createElement("img",{src:m.icon,alt:d}),defaultIcon:()=>ie__default.createElement(P8,{className:wl(Cx.menuButton,r),style:l})}))}var w8={popover:"b","popover-slide":"Ee",dialog:"Vg",popover__menuButton:"Wg"};var ft=s=>{var l=s,{trigger:e,children:t,className:o,containerClassName:r,placement:i="bottom right",forceShowPopUp:n}=l,a$1=d(l,["trigger","children","className","containerClassName","placement","forceShowPopUp"]);let{isDesktop:m}=le(),[c,d$1]=useState(!1),u=useRef(null),g=()=>d$1(!0),f=()=>d$1(!1);return ie__default.createElement("div",{ref:u,className:r},typeof e=="function"?e({isOpen:c,isDesktop:m,openPopover:g,closePopover:f}):ie__default.createElement(rg,b(a({},e),{"aria-label":"menu","aria-expanded":c,onClick:()=>{var C;return m?g():(C=e.onClick)==null?void 0:C.call(e,{closePopover:f})},className:wl(c&&w8.popover__menuButton,e.className)})),(n||m)&&ie__default.createElement(Popover,b(a({},a$1),{isOpen:c,placement:i,triggerRef:u,onOpenChange:d$1,className:wl(w8.popover,o)}),ie__default.createElement(Dialog,{className:w8.dialog,"aria-label":"popover-dialog"},typeof t=="function"?t({closePopover:f}):t)))};var TU=e=>{let r=ko({fetcher:ReactionRepository.getReactions,params:e,shouldCall:()=>!!e.referenceId&&!!e.referenceType}),{items:t}=r,o=d(r,["items"]);return a({reactions:t},o)};var MU=createContext([]),Sn=()=>({config:useContext(MU)}),SU=({children:e})=>{let{config:t}=L3(),[o,r]=ie__default.useState([]);return ie__default.useEffect(()=>{if(!t)return;let i=t==null?void 0:t.message_reactions;i&&r(i);},[t]),ie__default.createElement(MU.Provider,{value:o},e)};var bu=e=>e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e;var M8=({reactionConfigItem:e,className:t})=>ie__default.createElement("img",{"data-testid":"reaction_image_view",key:e.name,src:e.image,alt:e.name,className:t});var N0e=o=>{var r=o,{backgroundColor:e}=r,t=d(r,["backgroundColor"]);return ie__default.createElement("svg",a({width:"21",height:"21",viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),ie__default.createElement("path",{d:"M19.6035 10.5C19.6035 15.7467 15.3502 20 10.1035 20C4.85681 20 0.603516 15.7467 0.603516 10.5C0.603516 5.25329 4.85681 1 10.1035 1C15.3502 1 19.6035 5.25329 19.6035 10.5Z",stroke:"currentColor",fill:e}),ie__default.createElement("path",{d:"M10.2723 6.71429C11.6786 6.71429 13.202 7.83595 13.202 9.29242C13.202 11.2344 11.1094 11.2679 11.1094 11.9877V12.0714C11.1094 12.3058 10.9252 12.4732 10.7076 12.4732H9.48549C9.26786 12.4732 9.08371 12.3058 9.08371 12.0714V11.9208C9.08371 10.8828 9.87054 10.4643 10.4732 10.1295C10.9754 9.84487 11.2935 9.66072 11.2935 9.27568C11.2935 8.77345 10.6574 8.45537 10.1384 8.45537C9.48549 8.45537 9.16741 8.75671 8.74888 9.27568C8.61496 9.44309 8.36384 9.47657 8.19643 9.34264L7.47656 8.79019C7.29241 8.673 7.25893 8.42188 7.37612 8.25447C8.0625 7.26675 8.93304 6.71429 10.2723 6.71429ZM10.1049 12.9755C10.7411 12.9755 11.26 13.4944 11.26 14.1306C11.26 14.7667 10.7411 15.2857 10.1049 15.2857C9.45201 15.2857 8.93304 14.7667 8.93304 14.1306C8.93304 13.4944 9.45201 12.9755 10.1049 12.9755Z",fill:"currentColor"}))},xu=N0e;var k0e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("rect",{width:"40",height:"40",rx:"20",fill:"#D9E5FC"}),ie__default.createElement("path",{d:"M23.1255 13.1312C22.385 12.4069 21.3806 12 20.3333 12C19.2861 12 18.2817 12.4069 17.5412 13.1312C16.8006 13.8555 16.3846 14.8378 16.3846 15.8621C16.3846 16.8864 16.8006 17.8687 17.5412 18.593C18.2817 19.3172 19.2861 19.7241 20.3333 19.7241C21.3806 19.7241 22.385 19.3172 23.1255 18.593C23.866 17.8687 24.2821 16.8864 24.2821 15.8621C24.2821 14.8378 23.866 13.8555 23.1255 13.1312Z",fill:"white"}),ie__default.createElement("path",{d:"M20.3333 21.931C16.2831 21.931 13 23.7848 13 26.069V28H27.6667V26.069C27.6667 23.7848 24.3836 21.931 20.3333 21.931Z",fill:"white"})),Pu=k0e;var vt={reactionListContainer:"Sa",tabListContainer:"Re",tabList:"Ca",tabItem:"Ea",reactionEmoji:"qg",userList:"Dg",userItem:"Gg",userDetailsContainer:"Jg",userDetailsProfile:"Kg",userDetailsReaction:"Ng",reactionItem:"Og",reactionIcon:"Pg",reactionCustomStateContainer:"Ue",loadingState:"Qg","skeleton-pulse":"Ra",reactionState:"Zg",reactionState2Line:"_g",removeBtn:"ep",userDetailsName:"rp",infiniteScrollContainer:"ap",reactionPanel:"Ua",avatar:"op",closeButton:"Ba",retryIcon:"tp"};var NU=({filteredReactions:e,removeReaction:t,hasMore:o,loadMore:r,isLoading:i,currentRef:n})=>{let{currentUserId:a}=Ne(),{goToUserProfilePage:s}=Y(),{config:l}=Sn(),{closePopup:m}=Se(),c=useMemo(()=>l.map(({name:u})=>u),[l]);if(!n||!e)return null;let d=u=>{m(),s(u);};return ie__default.createElement("div",{className:vt.infiniteScrollContainer},ie__default.createElement(L0e,{scrollableTarget:n,scrollThreshold:.7,hasMore:o,next:r,loader:i?ie__default.createElement("span",{key:0},"Loading..."):null,dataLength:e.length||0,style:{display:"flex",width:"100%"},height:n.clientHeight},ie__default.createElement("div",{className:vt.userList},e.map(u=>{var g,f,C,y;return ie__default.createElement(Fragment,{key:u.reactionId},ie__default.createElement("div",{className:vt.userItem},ie__default.createElement("div",{className:vt.userDetailsContainer},ie__default.createElement("div",{className:vt.userDetailsProfile},ie__default.createElement("div",{className:vt.avatar},ie__default.createElement(ho,{"data-testid":"user_avatar_view",avatarUrl:(f=(g=u.user)==null?void 0:g.avatar)==null?void 0:f.fileUrl,defaultImage:ie__default.createElement(Pu,null),onClick:()=>{var b;return d((b=u.user)==null?void 0:b.userId)}})),ie__default.createElement("div",null,ie__default.createElement(oe,{variant:"text",onPress:()=>{var b;return d((b=u.user)==null?void 0:b.userId)}},ie__default.createElement(v.BodyBold,{"data-testid":"user_display_name",className:vt.userDetailsName},(C=u.user)==null?void 0:C.displayName)),a===((y=u.user)==null?void 0:y.userId)&&ie__default.createElement("div",{onClick:()=>t(u.reactionName)},ie__default.createElement(v.Caption,{className:vt.removeBtn},"Click to remove reaction")))),ie__default.createElement("div",{className:vt.userDetailsReaction},c.includes(u.reactionName)?ie__default.createElement(M8,{reactionConfigItem:l.find(({name:b})=>b===u.reactionName),className:vt.reactionIcon}):ie__default.createElement(xu,{className:vt.reactionIcon})))))}))))};var F0e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 20 21",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{fill:"currentColor",d:"M18.8672 1.63086C19.1797 1.31836 19.6875 1.55273 19.6875 1.94336V7.5293C19.6875 7.80273 19.4531 7.99805 19.2188 7.99805H13.5938C13.2031 7.99805 12.9688 7.5293 13.2812 7.2168L15.3906 5.10742C14.0234 3.70117 12.1094 2.8418 10 2.8418C5.74219 2.8418 2.34375 6.2793 2.34375 10.498C2.34375 14.7559 5.74219 18.1543 10 18.1543C11.9531 18.1543 13.7109 17.4512 15.0781 16.2402C15.2734 16.084 15.5469 16.084 15.7031 16.2402L16.4844 17.0215C16.6797 17.2168 16.6797 17.5293 16.4844 17.7246C14.7656 19.248 12.4609 20.1855 10 20.1855C4.64844 20.1855 0.3125 15.8887 0.3125 10.5371C0.273438 5.18555 4.64844 0.810547 10 0.810547C12.6562 0.810547 15.0781 1.9043 16.8359 3.66211L18.8672 1.63086Z"})),Iu=F0e;var BU=()=>ie__default.createElement("div",{className:vt.reactionCustomStateContainer,"data-testid":"reaction_list"},ie__default.createElement("div",{className:vt.reactionState},ie__default.createElement(Iu,{className:vt.retryIcon}),ie__default.createElement(v.Body,null,ie__default.createElement(FormattedMessage,{id:"livechat.reaction.errorOnload"}))));var V0e=e=>ie__default.createElement("svg",a({width:"33",height:"33",viewBox:"0 0 33 33",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M11.25 9.28613C16.5938 9.28613 21 13.6924 21 19.0361C21 24.4268 16.5938 28.7861 11.25 28.7861C5.85938 28.7861 1.5 24.4268 1.5 19.0361C1.5 13.6924 5.85938 9.28613 11.25 9.28613ZM11.25 26.5361C15.375 26.5361 18.75 23.208 18.75 19.0361C18.75 14.9111 15.375 11.5361 11.25 11.5361C7.07812 11.5361 3.75 14.9111 3.75 19.0361C3.75 23.208 7.07812 26.5361 11.25 26.5361ZM14.1094 20.7236C14.5312 20.2549 15.2344 20.208 15.7031 20.6299C16.1719 21.0049 16.2188 21.708 15.8438 22.1768C14.6719 23.5361 13.0312 24.2861 11.25 24.2861C9.46875 24.2861 7.78125 23.5361 6.60938 22.1768C6.23438 21.708 6.28125 21.0049 6.75 20.6299C7.21875 20.208 7.92188 20.2549 8.34375 20.7236C9.75 22.4111 12.7031 22.4111 14.1094 20.7236ZM8.25 18.2861C7.40625 18.2861 6.75 17.6299 6.75 16.7861C6.75 15.9893 7.40625 15.2861 8.25 15.2861C9.04688 15.2861 9.75 15.9893 9.75 16.7861C9.75 17.6299 9.04688 18.2861 8.25 18.2861ZM14.25 18.2861C13.4062 18.2861 12.75 17.6299 12.75 16.7861C12.75 15.9893 13.4062 15.2861 14.25 15.2861C15.0469 15.2861 15.75 15.9893 15.75 16.7861C15.75 17.6299 15.0469 18.2861 14.25 18.2861ZM30.75 8.91113C31.125 8.91113 31.5 9.28613 31.5 9.66113V10.4111C31.5 10.833 31.125 11.1611 30.75 11.1611H27.375V14.5361C27.375 14.958 27 15.2861 26.625 15.2861H25.875C25.4531 15.2861 25.125 14.958 25.125 14.5361V11.1611H21.75C21.3281 11.1611 21 10.833 21 10.4111V9.66113C21 9.28613 21.3281 8.91113 21.75 8.91113H25.125V5.53613C25.125 5.16113 25.4531 4.78613 25.875 4.78613H26.625C27 4.78613 27.375 5.16113 27.375 5.53613V8.91113H30.75Z",fill:"#A5A9B5"})),AU=V0e;var FU=()=>ie__default.createElement("div",{className:vt.reactionCustomStateContainer,"data-testid":"reaction_list"},ie__default.createElement("div",{className:vt.reactionState},ie__default.createElement(AU,null),ie__default.createElement("div",{className:vt.reactionState2Line},ie__default.createElement(v.Body,null,ie__default.createElement(FormattedMessage,{id:"livechat.reaction.emptyState"})),ie__default.createElement(v.Caption,null,ie__default.createElement(FormattedMessage,{id:"livechat.reaction.emptyState.description"})))));var U0e=e=>ie__default.createElement("svg",a({width:"375",height:"56",viewBox:"0 0 375 56",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("rect",{x:"16",y:"8",width:"40",height:"40",rx:"20",fill:"#292B32"}),ie__default.createElement("rect",{x:"64",y:"24",width:"140",height:"8",rx:"4",fill:"#292B32"})),DU=U0e;var xx=()=>ie__default.createElement("div",{className:wl(vt.reactionCustomStateContainer,vt.loadingState),"data-testid":"reaction_list"},Array.from({length:8}).map((e,t)=>ie__default.createElement(DU,{key:`loading_${t}`})));var O0e=(e,t)=>({addReaction:i=>l(void 0,null,function*(){yield ReactionRepository.addReaction(e,t,i);}),removeReaction:i=>l(void 0,null,function*(){yield ReactionRepository.removeReaction(e,t,i);})}),HU=O0e;var W0e=(e,t)=>{let[o,r]=useState(0),[i,n]=useState({}),[a,s]=useState(null),l=({data:m,loading:c,error:d})=>{var u,g;c||d||(r(m.reactionsCount),n(m.reactions),s((g=(u=m.myReactions)==null?void 0:u[0])!=null?g:null));};return useEffect(()=>{if(e==="message")MessageRepository.getMessage(t,l);else if(e==="story")StoryRepository.getStoryByStoryId(t,l);else if(e==="comment")CommentRepository.getComment(t,l);else if(e==="post")PostRepository.getPost(t,l);else throw new Error("Unsupported reference type")},[t,e]),{reactions:i,reactionCount:o,myReaction:a}},OU=W0e;var k8="unknown",Q0e=(e,t,o)=>t==="All"?e:t===k8?e.filter(r=>!o.includes(r.reactionName)):e.filter(r=>r.reactionName===t.toLowerCase()),K0e=({filteredReactions:e,hasMore:t,loadMore:o,isLoading:r,removeReaction:i,error:n,currentRef:a})=>r?ie__default.createElement(xx,null):n?ie__default.createElement(BU,null):e.length===0?r?ie__default.createElement(xx,null):ie__default.createElement(FU,null):ie__default.createElement(NU,{currentRef:a,hasMore:t,loadMore:o,isLoading:r,filteredReactions:e,removeReaction:i}),ll=({pageId:e="*",referenceId:t,referenceType:o})=>{let r="reaction_list",{accessibilityId:i}=se({pageId:e,componentId:r}),{reactions:n,error:a,isLoading:s,hasMore:l,loadMore:m}=TU({referenceId:t,referenceType:o,limit:25}),{reactions:c,reactionCount:d}=OU(o,t),{closePopup:u}=Se(),[g,f]=useState("All"),C=useRef(null),{config:y}=Sn(),{removeReaction:b}=HU(o,t),_=M=>{f(M);};if(n==null||!y)return null;let x=useMemo(()=>y.map(M=>M.name),[y]),P=useMemo(()=>Object.keys(c).filter(M=>!x.includes(M)),[c]),I=useMemo(()=>P.reduce((M,T)=>M+c[T],0),[c]),w=useMemo(()=>Q0e(n,g,x),[n,g]);return ie__default.createElement("div",{className:vt.reactionListContainer,"data-testid":`${i}_header`},ie__default.createElement("div",{className:vt.tabListContainer},ie__default.createElement("div",{className:vt.tabList,"data-testid":`${i}_tab`},ie__default.createElement("div",{"data-active":g==="All",className:vt.tabItem,onClick:()=>_("All")},ie__default.createElement(v.Body,null,ie__default.createElement("span",{className:vt.reactionEmoji},"All ",bu(d)))),y.map(M=>{let{name:T,image:E}=M;return c[T]?ie__default.createElement("div",{key:T,"data-active":g===T,className:vt.tabItem,onClick:()=>_(T)},ie__default.createElement(v.Body,null,ie__default.createElement("span",{className:vt.reactionEmoji},ie__default.createElement(M8,{className:vt.reactionItem,reactionConfigItem:M}),bu(c[T])))):null}),P.length>0&&ie__default.createElement("div",{key:k8,"data-active":g===k8,className:vt.tabItem,onClick:()=>_(k8)},ie__default.createElement(v.Body,null,ie__default.createElement("span",{className:vt.reactionEmoji},ie__default.createElement(xu,{className:vt.reactionIcon}),bu(I))))),ie__default.createElement(ot,{defaultClassName:vt.closeButton,onPress:()=>u()})),ie__default.createElement("div",{ref:C,className:vt.reactionPanel},ie__default.createElement(K0e,{currentRef:C.current,hasMore:l,loadMore:m,error:a,isLoading:s,filteredReactions:w,removeReaction:b})))};var xr=Object.freeze({CONTAIN_BLOCKED_WORD:"Amity SDK (400308): Text contain blocked word",NOT_INCLUDE_WHITELIST_LINK:"Data contain link that is not in whitelist",CONTAIN_BLOCKLISTED_WORD:"Your text contains a blocklisted word.",IMAGE_NUDITY:"Amity SDK (500000): Image uploading failed: Nudity content is not permitted",DELETED_POST:"400400"});var mo={postReplyComment:"ip",postReplyComment__avatar:"sp",postReplyComment__details:"dp",postReplyComment__content:"cp",postReplyComment__content__username:"lp",postReplyComment__content__text:"np",postReplyComment__secondRow:"mp",postReplyComment__secondRow__leftPane:"hp",postReplyComment__secondRow__rightPane:"gp",postReplyComment__secondRow__rightPane__reactionCount:"pp",postReplyComment__secondRow__rightPane__like:"bp",postReplyComment__secondRow__like:"Fa",postReplyComment__secondRow__reply:"up",postReplyComment__secondRow__actionButton:"fp",postReplyComment__secondRow__actionButton__icon:"vp",postReplyComment__viewReply_button:"wp",postReplyComment__viewReply_icon:"xp",postReplyComment__viewReply_text:"yp",postReplyComment__actionButton:"kp",postReplyComment__actionButton__icon:"jp",postReplyComment__actionButton__text:"zp",postReplyComment__deleteComment_container:"Ha",postReplyComment__deleteComment_icon:"Xp",postReplyComment__deleteComment_text:"Yp",postReplyComment__edit:"Ip",postReplyComment__edit__inputWrap:"Ap",postReplyComment__edit__input:"Mp",postReplyComment__edit__buttonWrap:"Sp",postReplyComment__edit__button:"Cp",postReplyComment__edit__cancelButton:"Ep",postReplyComment__edit__saveButton:"Rp",postReplyComment__secondRow__timestamp:"Up",postReplyComment__userInfo:"Bp",postReplyComment__brandBadge:"Fp",postReplyComment__mentionContainer:"Hp"};var e5e=({pageId:e="*",community:t,comment:o,isHighlightDeleted:r=!1})=>{var $,j,O,z;let i="post_comment",{confirm:n}=Te(),{isDesktop:a}=le(),{openPopup:s}=Se(),{setDrawerData:l$1}=tt(),m=ce(),{accessibilityId:c,config:d,defaultConfig:u,isExcluded:g,uiReference:f,themeStyles:C}=se({pageId:e,componentId:i}),[y,b]=useState(!1),[_,x]=useState(!1),[P,I]=useState(),{isModerator:w}=x8({community:t,userId:($=o.creator)==null?void 0:$.userId}),M=(o.myReactions||[]).some(k=>k==="like"),T=(O=(j=o.creator)==null?void 0:j.isBrand)!=null?O:!1,E=()=>b(k=>!k),N=()=>l(void 0,null,function*(){return o.commentId&&CommentRepository.deleteComment(o.commentId)}),A=()=>{E(),x(!0);},D=()=>{E(),n({pageId:e,componentId:i,title:"Delete reply",content:"This reply will be permanently removed.",cancelText:"Cancel",okText:"Delete",onOk:N});},G=()=>l(void 0,null,function*(){o&&(M?yield ReactionRepository.removeReaction("comment",o==null?void 0:o.commentId,ps):yield ReactionRepository.addReaction("comment",o==null?void 0:o.commentId,ps));}),H=useCallback(()=>l(void 0,null,function*(){!P||!o.commentId||(yield CommentRepository.updateComment(o.commentId,{data:P.data,mentionees:P.mentionees,metadata:P.metadata}).catch(k=>{k.message.includes(xr.CONTAIN_BLOCKED_WORD)?m.info({content:"Your comment contains inappropriate word. Please review and delete it."}):k.message.includes(xr.NOT_INCLUDE_WHITELIST_LINK)?m.info({content:"Your comment contains a link that\u2019s not allowed. Please review and delete it."}):m.info({content:"Oops, something went wrong"});}),x(!1));}),[P]);return g?null:ie__default.createElement(ie__default.Fragment,null,o.isDeleted?ie__default.createElement("div",{"data-isdeleted-highlight":r,className:mo.postReplyComment__deleteComment_container,style:C},ie__default.createElement(H3,{className:mo.postReplyComment__deleteComment_icon}),ie__default.createElement(v.Caption,{className:mo.postReplyComment__deleteComment_text},"This reply has been deleted")):_?ie__default.createElement("div",{className:mo.postReplyComment__edit},ie__default.createElement(Ae,{pageId:e,componentId:i,userId:o.userId}),ie__default.createElement("div",{className:mo.postReplyComment__edit__inputWrap},ie__default.createElement("div",{className:mo.postReplyComment__edit__input},ie__default.createElement(_u,{pageId:e,componentId:i,communityId:t==null?void 0:t.communityId,mentionContainerClassName:mo.postReplyComment__mentionContainer,value:{data:{text:o.data.text},mentionees:o.mentionees,metadata:o.metadata||{}},onChange:k=>{I({data:{text:k.text},mentionees:k.mentionees,metadata:{mentioned:k.mentioned}});}})),ie__default.createElement("div",{className:mo.postReplyComment__edit__buttonWrap},ie__default.createElement(vm,{componentId:"edit_comment_component",className:wl(mo.postReplyComment__edit__button,mo.postReplyComment__edit__cancelButton),onPress:()=>{x(!1);}}),ie__default.createElement(cc,{className:wl(mo.postReplyComment__edit__button,mo.postReplyComment__edit__saveButton),componentId:"edit_comment_component",onPress:H})))):ie__default.createElement("div",{className:mo.postReplyComment,style:C,"data-testid":c},ie__default.createElement(Ae,{pageId:e,componentId:i,userId:o.userId}),ie__default.createElement("div",{className:mo.postReplyComment__details},ie__default.createElement("div",{className:mo.postReplyComment__content},ie__default.createElement("div",{className:mo.postReplyComment__userInfo},ie__default.createElement(v.BodyBold,{"data-testid":`${e}/${i}/username`,className:mo.postReplyComment__content__username},(z=o.creator)==null?void 0:z.displayName),T&&ie__default.createElement(Mn,{className:mo.postReplyComment__brandBadge})),w&&ie__default.createElement(_m,{pageId:e,componentId:i}),ie__default.createElement(tl,{pageId:e,componentId:i,data:{text:o.data.text},mentionees:o.mentionees,metadata:o.metadata})),ie__default.createElement("div",{className:mo.postReplyComment__secondRow},ie__default.createElement("div",{className:mo.postReplyComment__secondRow__leftPane},ie__default.createElement(v.Caption,{className:mo.postReplyComment__secondRow__timestamp},ie__default.createElement(gi,{pageId:e,componentId:i,timestamp:o.createdAt}),ie__default.createElement("span",{"data-testid":`${e}/${i}/reply_comment_edited_text`},o.createdAt!==o.editedAt&&" (edited)")),t&&t.isJoined&&ie__default.createElement("div",{onClick:G},ie__default.createElement(v.CaptionBold,{"data-testid":`${e}/${i}/reply_comment_like`,className:mo.postReplyComment__secondRow__like,"data-is-liked":M},"Like")),ie__default.createElement(ft,{trigger:{pageId:e,componentId:i,onClick:()=>b(!0),className:mo.postReplyComment__secondRow__actionButton,iconClassName:mo.postReplyComment__secondRow__actionButton__icon}},({closePopover:k})=>ie__default.createElement(uu,{pageId:e,componentId:i,comment:o,onCloseMenu:k,handleEditComment:A,handleDeleteComment:()=>{k(),D();}}))),o.reactionsCount>0&&ie__default.createElement(V,{className:mo.postReplyComment__secondRow__rightPane,onPress:()=>{let k=ie__default.createElement(ll,{pageId:e,referenceType:"comment",referenceId:o.commentId});a?s({view:"desktop",children:k}):l$1({content:k});}},ie__default.createElement(v.Caption,{className:mo.postReplyComment__secondRow__rightPane__reactionCount},fA(o.reactionsCount)),ie__default.createElement(P7,{className:mo.postReplyComment__secondRow__rightPane__like}))))),!a&&ie__default.createElement(Pa,{onClose:E,isOpen:y,mountPoint:document.getElementById("asc-uikit-post-comment"),detent:"content-height"},ie__default.createElement(uu,{pageId:e,componentId:i,comment:o,onCloseMenu:E,handleEditComment:A,handleDeleteComment:D})))},wx=e5e;var Bc={replyCommentList:"Lp",postReplyCommentList__viewReply_button:"La",postReplyCommentList__viewReply_icon:"Tp",postReplyCommentList__viewReply_text:"Vp",replyCommentList__highlightedComment:"Wp",replyCommentList__bounceAnimation:"qp",bounce:"Ta"};var WU=({pageId:e="*",componentId:t="*",referenceId:o,referenceType:r,community:i,parentId:n,highlightedCommentId:a})=>{let[s,l]=useState(!a),[m,c]=useState(!1),d=useRef(null),u=useRef(null),{comments:g,hasMore:f,isLoading:C,loadMore:y}=rx({referenceId:o,referenceType:r,parentId:n,limit:20,shouldCall:!0,includeDeleted:!0}),b=g.filter(I=>!a||I.commentId!==a),_=g.filter(I=>a==I.commentId),x=g.filter(I=>a==I.commentId&&I.isDeleted),P=()=>{a&&!s?(l(!0),f&&y()):y();};return useEffect(()=>{if(n&&a&&_.length>0){let I=w=>{w.detail.commentId===a&&(c(!0),u.current=setTimeout(()=>{c(!1);},1e3));};return document.addEventListener("comment-scroll-complete",I),()=>{document.removeEventListener("comment-scroll-complete",I),u.current&&(clearTimeout(u.current),u.current=null);}}},[_,a,n]),ie__default.createElement("div",{className:Bc.replyCommentList},C&&ie__default.createElement(l8,{numberOfSkeletons:3}),_.length>0&&_.map(I=>ie__default.createElement("div",{key:I.commentId,ref:d,className:`${Bc.replyCommentList__highlightedComment} ${m?Bc.replyCommentList__bounceAnimation:""}`},ie__default.createElement(wx,{pageId:e,community:i,comment:I,isHighlightDeleted:!(_.length>0&&s)}))),s&&b.map(I=>ie__default.createElement(wx,{key:I.commentId,pageId:e,community:i,comment:I})),(f||a&&b.length>0&&!s)&&ie__default.createElement("div",{"data-isdeleted-highlight":x.length>0,className:Bc.postReplyCommentList__viewReply_button,onClick:P},ie__default.createElement(a8,{className:Bc.postReplyCommentList__viewReply_icon}),ie__default.createElement(v.CaptionBold,{className:Bc.postReplyCommentList__viewReply_text},"View more replies")))};var Lt={postComment:"Dp",postComment__deleteComment_container:"Gp",postComment__deleteComment_icon:"Jp",postComment__deleteComment_text:"Kp",postComment__avatar:"Np",postComment__details:"Op",postComment__content:"Pp",postComment__content__username:"Va",postComment__content__text:"Qp",postComment__secondRow:"Zp",postComment__secondRow__leftPane:"_p",postComment__secondRow__timestamp:"eb",postComment__secondRow__rightPane:"rb",postComment__secondRow__rightPane__reactionCount:"ab",postComment__secondRow__rightPane__like:"ob",postComment__secondRow__like:"Wa",postComment__secondRow__reply:"tb",postComment__secondRow__actionButton:"ib",postComment__secondRow__actionButton__icon:"sb",postComment__viewReply_button:"db",postComment__viewReply_icon:"cb",postComment__viewReply_text:"lb",postComment__edit:"nb",postComment__edit__inputWrap:"mb",postComment__edit__mentionContainer:"hb",postComment__edit__input:"gb",postComment__edit__buttonWrap:"pb",postComment__edit__button:"bb",postComment__edit__cancelButton:"ub",postComment__edit__saveButton:"fb",postComment__seeMore:"vb",postComment__mentionContainer:"wb",postComment__userInfo:"xb",postComment__brandBadge:"yb"};var m5e=t=>{var e=d(t,[]);return ie__default.createElement("svg",a({width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"url(#paint0_linear_1709_1733)"}),ie__default.createElement("path",{d:"M10.7752 12.1C11.2221 12.1 11.6002 12.4782 11.6002 12.925V21.175C11.6002 21.6563 11.2221 22 10.7752 22H8.0252C7.54395 22 7.2002 21.6563 7.2002 21.175V12.925C7.2002 12.4782 7.54395 12.1 8.0252 12.1H10.7752ZM9.4002 20.625C9.84707 20.625 10.2252 20.2813 10.2252 19.8C10.2252 19.3532 9.84707 18.975 9.4002 18.975C8.91895 18.975 8.5752 19.3532 8.5752 19.8C8.5752 20.2813 8.91895 20.625 9.4002 20.625ZM20.4002 7.2188C20.4002 8.66255 19.5064 9.48755 19.2314 10.45H22.7377C23.8721 10.45 24.7658 11.4125 24.7658 12.4782C24.8002 13.0969 24.5252 13.75 24.1127 14.1625C24.4564 14.9532 24.3877 16.0875 23.8033 16.8782C24.0783 17.7719 23.8033 18.8719 23.2189 19.4563C23.3908 20.075 23.3221 20.5907 23.0127 21.0032C22.3252 22 20.5721 22 19.0939 22H18.9908C17.3408 22 16.0002 21.4157 14.9002 20.9344C14.3502 20.6938 13.6283 20.3844 13.0783 20.3844C12.8721 20.35 12.7002 20.1782 12.7002 19.9719V12.6157C12.7002 12.5125 12.7346 12.4094 12.8033 12.3063C14.1783 10.9657 14.7627 9.5563 15.8627 8.42192C16.3783 7.9063 16.5502 7.15005 16.7564 6.3938C16.8939 5.77505 17.2033 4.40005 17.9252 4.40005C18.7502 4.40005 20.4002 4.67505 20.4002 7.2188Z",fill:"white"}),ie__default.createElement("defs",null,ie__default.createElement("linearGradient",{id:"paint0_linear_1709_1733",x1:"12",y1:"3.2",x2:"26.4",y2:"39.2",gradientUnits:"userSpaceOnUse"},ie__default.createElement("stop",{stopColor:"#63A1FF"}),ie__default.createElement("stop",{offset:"1",stopColor:"#0041BE"}))))},Mx=({pageId:e="*",componentId:t="comment_bubble",comment:o,community:r,onClickReply:i,shouldAllowInteraction:n=!0,highlightedCommentId:a=void 0,parentId:s=void 0})=>{var Ee,J,R,be;let{accessibilityId:l$1,isExcluded:m,themeStyles:c}=se({pageId:e,componentId:t}),{isDesktop:d}=le(),{setDrawerData:u}=tt(),{openPopup:g,closePopup:f}=Se(),{confirm:C}=Te(),{goToUserProfilePage:y}=Y(),b=useRef(null),[_,x]=useState(!1),[P,I]=useState(!1),[w,M]=useState(!1),[T,E]=useState(),[N,A]=useState(void 0),D=ce(),{online:G}=useNetworkState(),{page:H}=Y(),{isModerator:$}=x8({community:r,userId:(Ee=o.creator)==null?void 0:Ee.userId}),j=(R=(J=o.creator)==null?void 0:J.isBrand)!=null?R:!1,{onClickUser:O}=Y(),z=()=>I(xe=>!xe),k=(o.myReactions||[]).some(xe=>xe==="like"),F=o.childrenNumber;if(m)return null;useEffect(()=>{a&&s&&CommentRepository.getComment(a,xe=>{A(xe.data);});},[a,s]);let re=()=>l(void 0,null,function*(){return o.commentId&&CommentRepository.deleteComment(o.commentId)}),W=()=>{z(),x(!0);},ne=()=>{if(z(),!G){D.info({content:"Oops, something went wrong",alignment:`${H.type==="ViewStoryPage"?"fullscreen":"withSidebar"}`});return}C({pageId:e,componentId:t,title:"Delete comment",content:"This comment will be permanently removed.",cancelText:"Cancel",okText:"Delete",onOk:re});},te=()=>l(void 0,null,function*(){o&&(k?yield ReactionRepository.removeReaction("comment",o==null?void 0:o.commentId,ps):yield ReactionRepository.addReaction("comment",o==null?void 0:o.commentId,ps));}),Q=useCallback(()=>l(void 0,null,function*(){if(!G){D.info({content:"Oops, something went wrong",alignment:`${H.type==="ViewStoryPage"?"fullscreen":"withSidebar"}`});return}!T||!o.commentId||(yield CommentRepository.updateComment(o.commentId,{data:T.data,mentionees:T.mentionees,metadata:T.metadata}).catch(xe=>{xe.message.includes(xr.CONTAIN_BLOCKED_WORD)?D.info({content:"Your comment contains inappropriate word. Please review and delete it."}):xe.message.includes(xr.NOT_INCLUDE_WHITELIST_LINK)?D.info({content:"Your comment contains a link that\u2019s not allowed. Please review and delete it."}):D.info({content:"Oops, something went wrong"});}),x(!1));}),[T]),me=s===o.commentId,X=a===o.commentId&&!s,q=F>0&&!w&&(!me||X&&!w),ae=w&&F>0&&!s||me&&F>0||(N==null?void 0:N.isDeleted);return ie__default.createElement("div",{style:c,"data-testid":l$1},o.isDeleted?ie__default.createElement("div",{className:Lt.postComment__deleteComment_container},ie__default.createElement(H3,{className:Lt.postComment__deleteComment_icon}),ie__default.createElement(v.Body,{className:Lt.postComment__deleteComment_text},"This comment has been deleted")):_?ie__default.createElement("div",{className:Lt.postComment__edit},ie__default.createElement(Ae,{pageId:e,componentId:t,userId:o.userId}),ie__default.createElement("div",{className:Lt.postComment__edit__inputWrap},ie__default.createElement("div",{className:Lt.postComment__edit__input},ie__default.createElement("div",{className:Lt.postComment__edit__mentionContainer,ref:b}),ie__default.createElement(_u,{communityId:r==null?void 0:r.communityId,value:{data:{text:o.data.text},mentionees:o.mentionees,metadata:o.metadata||{}},onChange:xe=>{E({data:{text:xe.text},mentionees:xe.mentionees,metadata:{mentioned:xe.mentioned}});},maxLines:5,mentionContainerClassName:Lt.postComment__mentionContainer})),ie__default.createElement("div",{className:Lt.postComment__edit__buttonWrap},ie__default.createElement(vm,{componentId:"edit_comment_component",className:wl(Lt.postComment__edit__button,Lt.postComment__edit__cancelButton),onPress:()=>{x(!1);}}),ie__default.createElement(cc,{className:wl(Lt.postComment__edit__button,Lt.postComment__edit__saveButton),componentId:"edit_comment_component",onPress:Q,isDisabled:!(T!=null&&T.data.text)||(T==null?void 0:T.data.text)===o.data.text})))):ie__default.createElement("div",{className:Lt.postComment},ie__default.createElement(Ae,{pageId:e,componentId:t,userId:o.userId,shouldRedirectToUserProfile:!0}),ie__default.createElement("div",{className:Lt.postComment__details},ie__default.createElement("div",{className:Lt.postComment__content,onClick:()=>{var xe,Xe;return O((Xe=(xe=o.creator)==null?void 0:xe.userId)!=null?Xe:"")}},ie__default.createElement(V,{onPress:()=>{var xe;f(),y((xe=o.creator)==null?void 0:xe.userId);},className:Lt.postComment__userInfo},ie__default.createElement(v.BodyBold,{"data-testid":`${e}/${t}/username`,className:Lt.postComment__content__username},(be=o.creator)==null?void 0:be.displayName),j&&ie__default.createElement(Mn,{className:Lt.postComment__brandBadge})),$&&!j&&ie__default.createElement(_m,{pageId:e,componentId:t}),ie__default.createElement(tl,{pageId:e,componentId:t,data:{text:o.data.text},mentionees:o.mentionees,metadata:o.metadata})),ie__default.createElement("div",{className:Lt.postComment__secondRow},n?ie__default.createElement("div",{className:Lt.postComment__secondRow__leftPane},ie__default.createElement(v.Caption,{className:Lt.postComment__secondRow__timestamp},ie__default.createElement(gi,{pageId:e,componentId:t,timestamp:o.createdAt}),ie__default.createElement("span",{"data-testid":`${e}/${t}/comment_edited_text`},o.createdAt!==o.editedAt&&" (edited)")),r&&r.isJoined&&ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("div",{onClick:te},ie__default.createElement(v.CaptionBold,{className:Lt.postComment__secondRow__like,"data-is-liked":k},"Like")),ie__default.createElement("div",{"data-testid":`${e}/${t}/reply_button`,onClick:()=>i(o)},ie__default.createElement(v.CaptionBold,{className:Lt.postComment__secondRow__reply},"Reply"))),ie__default.createElement(ft,{trigger:{onClick:()=>I(!0),className:Lt.postComment__secondRow__actionButton,iconClassName:Lt.postComment__secondRow__actionButton__icon}},({closePopover:xe})=>ie__default.createElement(uu,{pageId:e,componentId:t,comment:o,handleEditComment:()=>{xe(),W();},handleDeleteComment:()=>{xe(),ne();},onCloseMenu:xe}))):ie__default.createElement("div",null),o.reactionsCount>0&&ie__default.createElement(V,{className:Lt.postComment__secondRow__rightPane,onPress:()=>{let xe=ie__default.createElement(ll,{pageId:e,referenceType:"comment",referenceId:o.commentId});d?g({view:"desktop",children:xe}):u({content:xe});}},ie__default.createElement(v.Caption,{className:Lt.postComment__secondRow__rightPane__reactionCount},fA(o.reactionsCount)),ie__default.createElement(m5e,{className:Lt.postComment__secondRow__rightPane__like}))),q&&ie__default.createElement("div",{"data-testid":`${e}/${t}/view_reply_button`,className:Lt.postComment__viewReply_button,onClick:()=>M(!0)},ie__default.createElement(a8,{className:Lt.postComment__viewReply_icon}),ie__default.createElement(v.CaptionBold,{className:Lt.postComment__viewReply_text},"View ",F," ",F>1?"replies":"reply")),ae&&ie__default.createElement(WU,{pageId:e,componentId:t,community:r!=null?r:void 0,referenceId:o.referenceId,referenceType:o.referenceType,parentId:o.commentId,highlightedCommentId:me?a:void 0}))),!d&&ie__default.createElement(Pa,{onClose:z,isOpen:P,mountPoint:document.getElementById("asc-uikit-post-comment"),detent:"content-height"},ie__default.createElement(uu,{pageId:e,componentId:t,comment:o,handleEditComment:W,handleDeleteComment:ne,onCloseMenu:z})))};var Pr={commentAd:"kb",commentAd__container:"jb",commentAd__details:"zb",commentAd__avatar:"Xb",commentAd__content:"Yb",commentAd__content__advertiserName__container:"Ib",commentAd__content__advertiserName:"Ab",commentAd__content__text:"Mb",commentAd__adCard:"Sb",commentAd__adCard__imageContainer:"Cb",commentAd__adCard__image:"Eb",commentAd__adCard__detail:"Rb",commentAd__adCard__textContainer:"Ub",commentAd__adCard__description:"Bb",commentAd__adCard__headline:"Fb",commentAd__adCard__button:"Hb",commentAd__adCard__button__text:"Lb",infoIcon__button:"Tb",infoIcon:"Vb"};var c5e=o=>{var r=o,{color:e="white"}=r,t=d(r,["color"]);return ie__default.createElement("svg",a({width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),ie__default.createElement("path",{d:"M5.54688 1.78125C5.73438 1.40625 6.26562 1.42188 6.4375 1.78125L7.46875 3.85938L9.75 4.1875C10.1562 4.25 10.3125 4.75 10.0156 5.04688L8.375 6.65625L8.76562 8.92188C8.82812 9.32812 8.39062 9.64062 8.03125 9.45312L6 8.375L3.95312 9.45312C3.59375 9.64062 3.15625 9.32812 3.21875 8.92188L3.60938 6.65625L1.96875 5.04688C1.67188 4.75 1.82812 4.25 2.23438 4.1875L4.53125 3.85938L5.54688 1.78125Z",fill:e}))},KU=c5e;var ag={badge:"qa",badge__icon:"Wb",badge__text:"qb",badge__child:"Db"};var wu=()=>ie__default.createElement("div",{className:ag.badge},ie__default.createElement("div",{className:ag.badge__child},ie__default.createElement(KU,{className:ag.badge__icon}),ie__default.createElement("div",{className:ag.badge__text},"Sponsored")));var u5e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("rect",{width:"64",height:"64",rx:"32",fill:"#D9E5FC"}),ie__default.createElement("path",{d:"M20 28.5358C20.5156 28.5358 20.9375 28.8639 21.2188 29.2858L41 23.2858V41.2858L34.8125 39.4576C34.2969 41.3795 32.5625 42.7858 30.5 42.7858C28.0156 42.7858 26 40.7701 26 38.2858C26 37.817 26.0938 37.3014 26.2344 36.8795L21.2188 35.3326C20.9375 35.7545 20.5156 36.0358 20 36.0358C19.1562 36.0358 18.5 35.3795 18.5 34.5358V30.0358C18.5 29.2389 19.1562 28.5358 20 28.5358ZM28.3906 37.4889C28.2969 37.7701 28.25 38.0045 28.25 38.2858C28.25 39.5514 29.2344 40.5358 30.5 40.5358C31.5312 40.5358 32.4219 39.7858 32.6562 38.8014L28.3906 37.4889ZM44.75 21.7858C45.125 21.7858 45.5 22.1608 45.5 22.5358V42.0358C45.5 42.4576 45.125 42.7858 44.75 42.7858H43.25C42.8281 42.7858 42.5 42.4576 42.5 42.0358V22.5358C42.5 22.1608 42.8281 21.7858 43.25 21.7858H44.75Z",fill:"white"})),Tu=u5e;var g5e=e=>ie__default.createElement("svg",a({width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M8 2.25006C4.25 2.25006 1.25 5.28131 1.25 9.00006C1.25 12.7501 4.25 15.7501 8 15.7501C11.7188 15.7501 14.75 12.7501 14.75 9.00006C14.75 5.28131 11.6875 2.25006 8 2.25006ZM8 1.25006C12.25 1.25006 15.75 4.75006 15.75 9.00006C15.75 13.2813 12.25 16.7501 8 16.7501C3.71875 16.7501 0.25 13.2813 0.25 9.00006C0.25 4.75006 3.71875 1.25006 8 1.25006ZM6.875 12.0001H7.25V8.25006H6.875C6.65625 8.25006 6.5 8.09381 6.5 7.87506V7.62506C6.5 7.43756 6.65625 7.25006 6.875 7.25006H8.375C8.5625 7.25006 8.75 7.43756 8.75 7.62506V12.0001H9.125C9.3125 12.0001 9.5 12.1876 9.5 12.3751V12.6251C9.5 12.8438 9.3125 13.0001 9.125 13.0001H6.875C6.65625 13.0001 6.5 12.8438 6.5 12.6251V12.3751C6.5 12.1876 6.65625 12.0001 6.875 12.0001ZM8 4.50006C8.53125 4.50006 9 4.96881 9 5.50006C9 6.06256 8.53125 6.50006 8 6.50006C7.4375 6.50006 7 6.06256 7 5.50006C7 4.96881 7.4375 4.50006 8 4.50006Z",fill:"#A5A9B5"})),Ta=g5e;var yi={drawer__content:"Da",drawer__innerContent:"Gb",drawer__placeholder:"Jb",drawer__overlay:"Kb",drawer__title:"Nb",drawer__content__data:"Ob",drawer__content__data__title:"Pb",drawer__content__data__text:"Qb",drawer__content__data__caption:"Zb",drawer__content__data__infoIcon:"_b",drawer__content__emptySpace:"eu"};var E8=({isOpen:e,onOpenChange:t,ad:o})=>{var r;return ie__default.createElement(Drawer.Root,{open:e,onOpenChange:t,onDrag:i=>i.stopPropagation()},ie__default.createElement(Drawer.Portal,null,ie__default.createElement(Drawer.Overlay,{className:yi.drawer__overlay}),ie__default.createElement(Drawer.Content,{className:yi.drawer__content,onTouchStart:i=>i.stopPropagation(),onTouchMove:i=>i.stopPropagation(),onTouchEnd:i=>i.stopPropagation()},ie__default.createElement("div",{className:yi.drawer__innerContent},ie__default.createElement("div",{className:yi.drawer__placeholder}),ie__default.createElement(Drawer.Title,{className:yi.drawer__title},ie__default.createElement(v.TitleBold,null,"About this advertisement")),ie__default.createElement("div",{className:yi.drawer__content__data},ie__default.createElement(v.BodyBold,{className:yi.drawer__content__data__title},"Why this advertisement?"),ie__default.createElement("div",{className:yi.drawer__content__data__text},ie__default.createElement(Ta,{className:yi.drawer__content__data__infoIcon}),ie__default.createElement(v.Caption,{className:yi.drawer__content__data__caption},"You're seeing this advertisement because it was displayed to all users in the system."))),ie__default.createElement("div",{className:yi.drawer__content__data},ie__default.createElement(v.BodyBold,{className:yi.drawer__content__data__title},"About this advertiser"),ie__default.createElement("div",{className:yi.drawer__content__data__text},ie__default.createElement(Ta,{className:yi.drawer__content__data__infoIcon}),ie__default.createElement(v.Caption,{className:yi.drawer__content__data__caption},"Advertiser name: ",(r=o.advertiser)==null?void 0:r.companyName))),ie__default.createElement("div",{className:yi.drawer__content__emptySpace})))))};var XU=({ad:e,themeStyles:t,avatarUrl:o,adImageUrl:r,onCallToActionClick:i})=>{var l;let[n,a]=useState(!1),s=()=>{i==null||i(e.callToActionUrl);};return ie__default.createElement("div",{className:Pr.commentAd,style:t},ie__default.createElement(V,{className:Pr.infoIcon__button,onPress:()=>a(!0)},ie__default.createElement(Ta,{className:Pr.infoIcon})),ie__default.createElement("div",{className:Pr.commentAd__container},ie__default.createElement("div",{className:Pr.commentAd__avatar},ie__default.createElement(ho,{avatarUrl:o,defaultImage:ie__default.createElement(Tu,null)})),ie__default.createElement("div",{className:Pr.commentAd__details},ie__default.createElement("div",{className:Pr.commentAd__content},ie__default.createElement(v.BodyBold,{className:Pr.commentAd__content__advertiserName__container},ie__default.createElement("div",{className:Pr.commentAd__content__advertiserName},(l=e.advertiser)==null?void 0:l.name)),ie__default.createElement(wu,null),ie__default.createElement("div",null,ie__default.createElement(v.Body,{className:Pr.commentAd__content__text},e.body)),ie__default.createElement("div",{className:Pr.commentAd__adCard,onClick:s},ie__default.createElement("div",{className:Pr.commentAd__adCard__imageContainer},ie__default.createElement("img",{className:Pr.commentAd__adCard__image,src:r})),ie__default.createElement("div",{className:Pr.commentAd__adCard__detail},ie__default.createElement("div",{className:Pr.commentAd__adCard__textContainer},ie__default.createElement(v.Caption,{className:Pr.commentAd__adCard__description},e.description),ie__default.createElement(v.BodyBold,{className:Pr.commentAd__adCard__headline},e.headline)),e.callToActionUrl?ie__default.createElement(V,{className:Pr.commentAd__adCard__button,onPress:s},ie__default.createElement(v.CaptionBold,{className:Pr.commentAd__adCard__button__text},e.callToAction)):null))))),ie__default.createElement(E8,{ad:e,isOpen:n,onOpenChange:m=>a(m)}))};var RU=({pageId:e="*",ad:t})=>{var m,c,d,u,g,f;let o="comment_tray_component",{themeStyles:r}=se({pageId:e,componentId:o}),n=rt({fileId:(c=(m=t.advertiser)==null?void 0:m.avatar)==null?void 0:c.fileId})||((u=(d=t.advertiser)==null?void 0:d.avatar)==null?void 0:u.fileUrl)||"",s=rt({fileId:(g=t.image1_1)==null?void 0:g.fileId})||((f=t.image1_1)==null?void 0:f.fileUrl)||"";return ie__default.createElement(XU,{themeStyles:r,avatarUrl:n,adImageUrl:s,ad:t,onCallToActionClick:C=>{window==null||window.open(C,"_blank");}})};var ml={commentList__container:"ru",commentList__viewAllComments__button:"au",commentList__viewAllComments__button__text:"ou",commentList__container_intersection:"tu",noCommentsContainer:"Ga",noCommentsContainer__icon:"iu",commentList__highlightedComment:"su",commentList__bounceAnimation:"du",bounce:"Ja"};var A8=e=>"adId"in e,Ec=({referenceId:e,referenceType:t,pageId:o="*",onClickReply:r,limit:i=5,includeDeleted:n=!0,community:a,shouldAllowInteraction:s=!0,commentCount:l=0,renderReplyComment:m,highlightedCommentId:c,parentId:d,commentListClassName:u})=>{let g="comment_tray_component",{online:f}=useNetworkState(),{isDesktop:C}=le(),{themeStyles:y,accessibilityId:b}=se({componentId:g,pageId:o}),_=useRef(null),x=useRef(null),[P,I]=useState(null),[w,M]=useState(!1),[T,E]=useState(!1),{items:N,refresh:A,loadMore:D,hasMore:G,isLoading:H}=R3({fetcher:CommentRepository.getComments,params:{referenceId:e,referenceType:t,limit:c?20:i,includeDeleted:n},placement:"comment",pageSize:5,getItemId:O=>O.commentId,shouldCall:!0}),$=c?N.find(O=>!A8(O)&&O.commentId===(d||c)):void 0,j=N.filter(O=>A8(O)||!c||O.commentId!==(d||c));return ke({node:P,options:{threshold:.8},onIntersect:()=>{G&&H===!1&&D();}}),useEffect(()=>{A();},[]),useEffect(()=>{if(!d&&$&&x.current){let O=z=>{if(z.detail.commentId===$.commentId){E(!0);let k=setTimeout(()=>{E(!1);},1e3);return ()=>clearTimeout(k)}};return document.addEventListener("comment-scroll-complete",O),()=>{document.removeEventListener("comment-scroll-complete",O);}}},[$,c,d]),f?!H&&N.length===0?ie__default.createElement("div",{className:ml.noCommentsContainer},ie__default.createElement(v.Body,null,"No comments yet")):ie__default.createElement("div",{className:wl(ml.commentList__container,u),style:y,ref:_,"data-testid":b},$&&ie__default.createElement("div",{className:`${ml.commentList__highlightedComment} ${T?ml.commentList__bounceAnimation:""}`,ref:x},ie__default.createElement(Mx,{pageId:o,comment:$,onClickReply:O=>r==null?void 0:r(O),componentId:g,community:a,shouldAllowInteraction:s,highlightedCommentId:c,parentId:d}),m==null?void 0:m($)),j.map(O=>A8(O)?ie__default.createElement(RU,{key:O.adId,ad:O}):ie__default.createElement("div",{key:O.commentId},ie__default.createElement(Mx,{pageId:o,comment:O,onClickReply:z=>r==null?void 0:r(z),componentId:g,community:a,shouldAllowInteraction:s}),m==null?void 0:m(O))),C&&G&&!w&&j.filter(O=>!A8(O)).filter(O=>!O.isDeleted).length<l&&ie__default.createElement(oe,{className:ml.commentList__viewAllComments__button,variant:"text",onPress:()=>{D(),M(!0);}},ie__default.createElement(v.BodyBold,{className:ml.commentList__viewAllComments__button__text},"View all comments...")),H&&ie__default.createElement(l8,{pageId:o,componentId:g,numberOfSkeletons:3}),(!C||C&&w)&&ie__default.createElement("div",{ref:O=>I(O),className:ml.commentList__container_intersection})):ie__default.createElement("div",{className:ml.noCommentsContainer},ie__default.createElement(Iu,{className:ml.noCommentsContainer__icon}),ie__default.createElement(v.Body,null,"Unable to load comments"))};var lg={icon__container:"cu",icon:"lu",notifications:"Ka",notificationContainer:"j",appear:"Na",notification__text:"nu"};var Ur=({alignment:e="withSidebar",content:t,icon:o,duration:r,isShowAttributes:i,className:n,iconClassName:a,textClassName:s,onClose:l})=>{let[m,c]=useState(!0);return r&&setTimeout(()=>{c(!1),l==null||l();},r),m?m&&ie__default.createElement("div",{"data-show-detail-media-attachment":i,className:wl(lg.notificationContainer,n),"data-alignment":e},ie__default.createElement("div",{className:wl(lg.icon__container,a)},o)," ",typeof t=="string"?ie__default.createElement(v.Body,{className:wl(lg.notification__text,s)},t):t):null},oH=()=>{let e=wV();return ie__default.createElement("div",{className:lg.notifications},e.map(t=>ie__default.createElement(Ur,b(a({},t),{key:t.id}))))},L8=Ur;var Nn={commentComposer:"mu",commentComposer__top:"hu",commentComposer__mentionContainer:"gu",commentComposer__container:"pu",commentComposer__avatar:"bu",commentComposer__button:"Be",commentComposer__input:"uu",commentComposer__replyContainer:"fu",commentComposer__replyContainer__text:"vu",commentComposer__replyContainer__username:"wu",commentComposer__replyContainer__closeButton:"xu",commentComposer__disableContainer:"yu",commentComposer__notificationIcon:"ku"};var T5e=(e,t)=>{let a$1=Cn({fetcher:PostRepository.getPost,params:e,shouldCall:t!=null?t:!!e}),{item:o,isLoading:r,refresh:i}=a$1,n=d(a$1,["item","isLoading","refresh"]);return a({post:o,isLoading:r,refresh:i},n)},Ir=T5e;var k5e=()=>ie__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},ie__default.createElement("path",{fill:"currentColor",d:"M15.5 8c.813 0 1.5.688 1.5 1.5v7a1.5 1.5 0 01-1.5 1.5h-11A1.48 1.48 0 013 16.5v-7A1.5 1.5 0 014.5 8h1V6.5C5.5 4.031 7.5 2 10 2c2.5.031 4.5 2.063 4.5 4.563V8h1zM7 6.5V8h6V6.5c0-1.625-1.375-3-3-3-1.656 0-3 1.375-3 3zm8.5 10v-7h-11v7h11z"})),dl=({pageId:e="*",referenceId:t,referenceType:o,replyTo:r,onCancelReply:i,shouldAllowCreation:n=!0,community:a$1,containerClassName:s,commentComposerClassName:l$1})=>{var N,A;let m=Ne().currentUserId;qe({userId:m});let {isDesktop:d}=le(),u=ce(),{online:g}=useNetworkState(),f=useRef(null),C=useRef(null),y="comment_composer_bar",b$1=useRef(null),{page:_}=Y(),{post:x}=Ir(t),[P,I]=useState(0),[w,M]=useState({data:{text:""},mentionees:[{type:"user",userIds:[""]}],metadata:{}}),{mutateAsync:T,isPending:E}=useMutation({mutationFn:G=>l(void 0,[G],function*({params:D}){let H=r?r.commentId:void 0;yield CommentRepository.createComment(b(a({referenceId:r?r.referenceId:t,referenceType:o,parentId:H},D),{mentionees:D.mentionees}));}),onError:D=>{D.message.includes(xr.CONTAIN_BLOCKED_WORD)?u.info({content:"Your comment contains inappropriate word. Please review and delete it."}):D.message.includes(xr.NOT_INCLUDE_WHITELIST_LINK)?u.info({content:"Your comment contains a link that\u2019s not allowed. Please review and delete it."}):D.message.includes(xr.DELETED_POST)&&(x==null?void 0:x.dataType)==="clip"?u.info({content:"This clip is no longer available."}):u.info({content:"Oops, something went wrong"});},onSuccess:()=>{var D;M({data:{text:""},mentionees:[],metadata:{}}),(D=f.current)==null||D.clearEditorState(),i();}});return n?ie__default.createElement("div",{className:wl(Nn.commentComposer,l$1),"data-testid":`${e}/${y}/comment_composer`},!g&&E&&_.type=="ViewStoryPage"&&ie__default.createElement(Ur,{icon:ie__default.createElement(Co,{className:Nn.commentComposer__notificationIcon}),content:"Oops, something went wrong",alignment:"fixed",duration:3e3}),ie__default.createElement("div",{className:Nn.commentComposer__top},ie__default.createElement("div",{className:Nn.commentComposer__mentionContainer,ref:b$1}),r&&!d&&ie__default.createElement("div",{className:Nn.commentComposer__replyContainer,style:{"--asc-reply-container-offset-bottom":`${P}px`}},ie__default.createElement("div",{"data-testid":`${e}/${y}/comment_composer_reply_text`,className:Nn.commentComposer__replyContainer__text},ie__default.createElement("span",null,"Replying to "),ie__default.createElement("span",{className:Nn.commentComposer__replyContainer__username},r==null?void 0:r.userId)),ie__default.createElement(Xn,{onClick:i,className:Nn.commentComposer__replyContainer__closeButton}))),ie__default.createElement("div",{className:wl(Nn.commentComposer__container,s)},ie__default.createElement("div",{className:Nn.commentComposer__avatar},ie__default.createElement(Ae,{pageId:e,componentId:y,userId:m})),ie__default.createElement("div",{className:Nn.commentComposer__input,ref:C,"data-testid":`${e}/${y}/comment_composer`},ie__default.createElement(_u,{ref:f,mentionContainer:b$1==null?void 0:b$1.current,onChange:({text:D,mentioned:G,mentionees:H})=>{M({data:{text:D},mentionees:H,metadata:{mentioned:G}});},targetType:o,targetId:t,value:w,placehoder:r?`Replying to ${(N=r==null?void 0:r.creator)==null?void 0:N.displayName}...`:"Say something nice...",communityId:a$1==null?void 0:a$1.communityId})),ie__default.createElement(oe,{variant:"text","data-testid":`${e}/${y}/comment_composer_post`,isDisabled:!((A=w==null?void 0:w.data)!=null&&A.text)||E,className:Nn.commentComposer__button,onPressStart:()=>{if(!g&&_.type!=="ViewStoryPage"){u.info({content:"Oops, something went wrong"});return}T({params:w});}},ie__default.createElement(v.Body,null,"Post")))):ie__default.createElement("div",{className:Nn.commentComposer__disableContainer},ie__default.createElement(k5e,null),ie__default.createElement(v.Body,null,"Comments are disabled for this story"))};var F8={container:"ju",header:"zu",roundedHeader:"Xu",content:"Yu",scroller:"Iu",composeBarContainer:"Au",nestedBackdrop:"Mu",commentTrayContainer:"Oa",commentListContainer:"Su",mobileSheetComposeBarContainer:"Cu",commentTrayContainer__commentComposer:"Eu"};var Mu=({referenceId:e,pageId:t="*",referenceType:o,shouldAllowCreation:r=!0,shouldAllowInteraction:i=!0,community:n={}})=>{let a="comment_tray_component",{isDesktop:s}=le(),[l,m]=useState(),{accessibilityId:c,themeStyles:d}=se({pageId:t,componentId:a}),u=useCallback(()=>m(void 0),[]),g=useCallback(f=>m(C=>(C==null?void 0:C.commentId)===(f==null?void 0:f.commentId)?void 0:f),[]);return ie__default.createElement("div",{style:d,"data-testid":c,className:F8.commentTrayContainer},ie__default.createElement("div",{className:F8.commentListContainer},ie__default.createElement(Ec,{includeDeleted:!0,pageId:t,community:n,referenceId:e,onClickReply:g,referenceType:o,shouldAllowInteraction:i,renderReplyComment:f=>{if(l&&f.commentId===l.commentId&&s)return ie__default.createElement(dl,{pageId:t,replyTo:l,community:n,referenceId:e,referenceType:o,onCancelReply:u,shouldAllowCreation:r})}})),i&&ie__default.createElement(dl,{referenceId:e,onCancelReply:u,referenceType:o,replyTo:s?void 0:l,shouldAllowCreation:r,containerClassName:F8.commentTrayContainer__commentComposer}))};var aH={doneButton:"Ru"};function D8(n){var a$1=n,{pageId:e="*",componentId:t="*",className:o,isDisabled:r=!1}=a$1,i=d(a$1,["pageId","componentId","className","isDisabled"]);let s="done_button",{accessibilityId:l,config:m,isExcluded:c}=S({pageId:e,componentId:t,elementId:s}),{isDesktop:d$1}=le();return c?null:ie__default.createElement(oe,a({variant:d$1?"fill":"text",className:wl(aH.doneButton,o),"data-testid":l,isDisabled:r},i),ie__default.createElement(v.Body,null,m.done_button_text))}var hi={hyperlinkFormContainer:"Pa",hyperlinkConfig__inputPlaceholder:"te",form:"Uu",bottomSheet:"E","react-modal-sheet-backdrop":"Bu","react-modal-sheet-container":"Fu","react-modal-sheet-content":"Hu","react-modal-sheet-header":"Lu","react-modal-sheet-drag-indicator":"Tu",inputContainer:"Vu",input:"Qa",hasError:"Wu",label:"Fe",required:"qu",description:"Du",errorText:"Gu",characterCount:"Ju",headerContainer:"Za",labelContainer:"Ku",headerTitle:"Nu",cancelButton:"Ou",doneButton:"_a",removeIcon:"Pu",removeLinkButton:"Qu",divider:"eo",removeLinkContainer:"ro",hyperlinkConfig__footer:"ao",hyperlinkConfig__header__closeButton:"oo",hyperlinkConfig__header__closeButton__icon:"Zu",hyperlinkConfig__header__editCancelButton:"_u",hyperlinkConfig__header__editDoneButton:"ef",hyperlinkConfig__footer__editCancelButton:"rf",hyperlinkConfig__footer__editDoneButton:"af"};var Q1={underlineInput:"of",underlineInput__label:"tf",underlineInput__labelText:"if",underlineInput__counter:"sf",underlineInput__optional:"df",underlineInput__value:"u",underlineInput__helperText:"to"};var Ex={title:"cf",title__requiredIndicator:"lf"};function Ax({pageId:e="*",componentId:t="*",elementId:o="*",titleClassName:r,required:i=!1,labelText:n}){var c;let{accessibilityId:a,config:s,isExcluded:l,themeStyles:m}=S({pageId:e,componentId:t,elementId:o});return l?null:ie__default.createElement(v.TitleBold,{className:wl(Ex.title,r),style:m,"data-testid":a},(c=s.text)!=null?c:n,i&&ie__default.createElement("span",{className:Ex.title__requiredIndicator},"*"))}var Ac=forwardRef(function(_,b){var x=_,{pageId:e="*",componentId:t="*",elementId:o="*",name:r,label:i,optional:n=!1,maxLength:a$1,value:s,disabled:l=!1,showCounter:m=!1,isError:c=!1,helperText:d$1,required:u=!1,placeholder:g="",placeholderClassName:f="",onChange:C}=x,y=d(x,["pageId","componentId","elementId","name","label","optional","maxLength","value","disabled","showCounter","isError","helperText","required","placeholder","placeholderClassName","onChange"]);let P=useRef(null);useImperativeHandle(b,()=>P.current),useEffect(()=>{P.current&&(P.current.style.height="auto",P.current.style.height=`${P.current.scrollHeight}px`);},[s]);let I=w=>{C==null||C(w),P.current&&(P.current.style.height="auto",P.current.style.height=`${P.current.scrollHeight}px`);};return ie__default.createElement(TextField,{name:r,className:Q1.underlineInput},ie__default.createElement(Label,{className:Q1.underlineInput__label},ie__default.createElement("div",null,ie__default.createElement(Ax,{pageId:e,componentId:t,elementId:o,titleClassName:Q1.underlineInput__labelText,labelText:i,required:u}),n&&ie__default.createElement(v.Caption,{className:Q1.underlineInput__optional}," (Optional)")),m&&ie__default.createElement(v.Caption,{className:Q1.underlineInput__counter},s==null?void 0:s.length,"/",a$1)),ie__default.createElement(TextArea,a({ref:b,rows:1,maxLength:a$1,value:s,onChange:I,className:wl(Q1.underlineInput__value,f),"data-error":c,disabled:l,placeholder:g},y)),d$1&&ie__default.createElement(v.Caption,{className:Q1.underlineInput__helperText,"data-error":c},d$1))});var X5e=30,Fx=({pageId:e="*",url:t,customText:o,onClose:r,onSubmit:i,onRemove:n})=>{var G,H,$,j,O;let a$1="hyper_link_config_component",{confirm:s}=Te(),{removeDrawerData:l$1}=tt(),{accessibilityId:m,isExcluded:c,themeStyles:d}=se({pageId:e,componentId:a$1}),{closePopup:u}=Se(),{isDesktop:g}=le();if(c)return null;let{client:f}=Ne(),[C,y]=useState(!1),b$1="asc-story-hyperlink-form",_=z.object({url:z.string().refine(z=>{if(!z)return !0;try{let k=new URL(z);return ["http:","https:"].includes(k.protocol)}catch(k){if(z.startsWith("www."))try{let F=new URL(`https://${z}`);return ["http:","https:"].includes(F.protocol)}catch(F){return !1}return !1}},{message:"Please enter a valid URL."}).refine(z=>l(void 0,null,function*(){if(!z)return !0;let k=z.startsWith("www.")?`https://${z}`:z;return yield f==null?void 0:f.validateUrls([k]).catch(()=>!1)}),{message:"Please enter a whitelisted URL."}),customText:z.string().optional().refine(z=>l(void 0,null,function*(){return z?yield f==null?void 0:f.validateTexts([z]).catch(()=>!1):!0}),"Your text contains a blocklisted word.")}),{trigger:x,watch:P,register:I,handleSubmit:w,formState:{errors:M},reset:T}=useForm({resolver:zodResolver(_),defaultValues:{url:t,customText:o}});useEffect(()=>{let z=P(k=>{let F=k.url!==(t!=null?t:""),re=k.customText!==(o!=null?o:"");y(F||re);});return ()=>z.unsubscribe()},[P,t,o]);let E=z=>{i(z),r();},N=()=>{T(),n(),r();},A=()=>{s({title:"Remove Link",content:"This link will be removed from story.",cancelText:"Cancel",okText:"Remove",onOk:N});},D=()=>{C?s({title:"Unsaved changes",content:"Are you sure you want to cancel? Your changes won't be saved.",cancelText:"No",okText:"Yes",onOk:()=>{T(),u(),!g&&l$1();}}):r();};return ie__default.createElement("div",{"data-testid":m,style:d},ie__default.createElement("div",{className:hi.headerContainer},ie__default.createElement(vm,{pageId:e,componentId:a$1,onPress:D,className:hi.hyperlinkConfig__header__editCancelButton}),ie__default.createElement(v.Headline,null,"Add link"),ie__default.createElement(D8,{type:"submit",pageId:e,componentId:a$1,form:b$1,className:hi.hyperlinkConfig__header__editDoneButton}),ie__default.createElement(V,{onPress:D,className:hi.hyperlinkConfig__header__closeButton},ie__default.createElement(Xn,{className:hi.hyperlinkConfig__header__closeButton__icon}))),ie__default.createElement("div",{className:hi.divider}),ie__default.createElement("div",{className:hi.hyperlinkFormContainer},ie__default.createElement("form",{onSubmit:w(E),id:b$1,className:hi.form},ie__default.createElement(Ac,b(a({label:"URL",required:!0,placeholder:"https://example.com",placeholderClassName:hi.hyperlinkConfig__inputPlaceholder,value:P("url")},I("url",{onChange:()=>l(void 0,null,function*(){yield x("url");})})),{id:"asc-uikit-hyperlink-input-url",isError:!!((G=M.url)!=null&&G.message),helperText:(H=M==null?void 0:M.url)==null?void 0:H.message})),ie__default.createElement(Ac,b(a({label:"Customize link text",placeholder:"Name your link",placeholderClassName:hi.hyperlinkConfig__inputPlaceholder},I("customText",{onChange:()=>l(void 0,null,function*(){yield x("customText");})})),{id:"asc-uikit-hyperlink-input-link-text",isError:!!(($=M.customText)!=null&&$.message),helperText:(O=(j=M==null?void 0:M.customText)==null?void 0:j.message)!=null?O:"This text will show on the link instead of URL.",value:P("customText"),showCounter:!0,maxLength:X5e}))),t&&ie__default.createElement("div",{className:hi.removeLinkContainer},ie__default.createElement(V,{onPress:A,className:wl(hi.removeLinkButton)},ie__default.createElement(uc,{className:hi.removeIcon}),"Remove link"))),ie__default.createElement("div",{className:hi.hyperlinkConfig__footer},ie__default.createElement(vm,{pageId:e,componentId:a$1,onPress:D,className:hi.hyperlinkConfig__footer__editCancelButton}),ie__default.createElement(D8,{type:"submit",pageId:e,componentId:a$1,form:b$1,className:hi.hyperlinkConfig__footer__editDoneButton,isDisabled:!!M.url||!!M.customText||!P("url")})))};var Dx={emptyStateRing:"nf",errorRing:"mf",uploadingProgressRing:"hf","upload-progress":"io"};var e3e=({pageId:e,componentId:t,elementId:o,size:r})=>{let{config:i}=S({pageId:e,componentId:t,elementId:o}),n=i==null?void 0:i.progress_color;return ie__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:r,height:r,fill:"none",viewBox:`0 0 ${r} ${r}`},ie__default.createElement("defs",null,ie__default.createElement("linearGradient",{id:"story-ring-gradient",x1:"35.4004",y1:"1.875",x2:"10.6504",y2:"45.75",gradientUnits:"userSpaceOnUse"},ie__default.createElement("stop",{stopColor:n[0]}),ie__default.createElement("stop",{offset:1,stopColor:n[1]}))),ie__default.createElement("circle",{cx:r/2,cy:r/2,r:r/2-1,className:Dx.emptyStateRing}))},t3e=({pageId:e,componentId:t,elementId:o,size:r})=>{let{config:i}=S({pageId:e,componentId:t,elementId:o}),n=i==null?void 0:i.progress_color;return ie__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:r,height:r,fill:"none",viewBox:`0 0 ${r} ${r}`},ie__default.createElement("defs",null,ie__default.createElement("linearGradient",{id:"story-ring-gradient",x1:"35.4004",y1:"1.875",x2:"10.6504",y2:"45.75",gradientUnits:"userSpaceOnUse"},ie__default.createElement("stop",{stopColor:n[0]}),ie__default.createElement("stop",{offset:1,stopColor:n[1]}))),ie__default.createElement("circle",{cx:r/2,cy:r/2,r:r/2-1,strokeWidth:"2",strokeLinecap:"round",stroke:"url(#story-ring-gradient)",fill:"none",strokeDasharray:339,strokeDashoffset:0}))},o3e=({pageId:e,componentId:t,elementId:o,size:r})=>{let{config:i}=S({pageId:e,componentId:t,elementId:o}),n=i==null?void 0:i.progress_color;return ie__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:r,height:r,fill:"none",viewBox:`0 0 ${r} ${r}`},ie__default.createElement("defs",null,ie__default.createElement("linearGradient",{id:"story-ring-gradient",x1:"35.4004",y1:"1.875",x2:"10.6504",y2:"45.75",gradientUnits:"userSpaceOnUse"},ie__default.createElement("stop",{stopColor:n[0]}),ie__default.createElement("stop",{offset:1,stopColor:n[1]}))),ie__default.createElement("circle",{className:Dx.uploadingProgressRing,cx:r/2,cy:r/2,r:r/2-1,strokeWidth:"2",strokeLinecap:"round",stroke:"url(#story-ring-gradient)",fill:"none"}))},cg=s=>{var l=s,{pageId:e="*",componentId:t="*",hasUnseen:o=!1,uploading:r=!1,isErrored:i=!1,size:n=64}=l,a$1=d(l,["pageId","componentId","hasUnseen","uploading","isErrored","size"]);let m="story_ring",{isExcluded:c}=S({pageId:e,componentId:t,elementId:m});return c?null:i?ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:n,height:n,fill:"none",viewBox:`0 0 ${n} ${n}`},a$1),ie__default.createElement("circle",{cx:n/2,cy:n/2,r:n/2-1,stroke:getComputedStyle(document.documentElement).getPropertyValue("--asc-color-alert-default"),strokeWidth:"2"})):r?ie__default.createElement(o3e,{pageId:e,componentId:t,elementId:m,size:n}):o?ie__default.createElement(t3e,{pageId:e,componentId:t,elementId:m,size:n}):ie__default.createElement(e3e,{pageId:e,componentId:t,elementId:m,size:n})};var Lc=e=>{let i=R3({fetcher:StoryRepository.getActiveStoriesByTarget,params:e,shouldCall:!0,pageSize:10,placement:"story",getItemId:n=>(n==null?void 0:n.storyId)||""}),{items:t,refresh:o}=i,r=d(i,["items","refresh"]);return a({stories:t.filter(Yi),refresh:o},r)};var i3e=({community:e})=>{let{currentUserId:t,userRoles:o}=Ne(),{moderators:r}=Lo({communityId:e==null?void 0:e.communityId}),i=r.find(s=>s.userId===t),n=o.find(s=>s==="global-admin")!=null,a=i!=null;return {isModerator:a,canEdit:n||a,canReview:n||a}},Vx=i3e;var s3e=e=>{let[t,o]=useState([]);return useEffect(()=>{function r(){return l(this,null,function*(){if(e==null||e.length===0)return;let i=yield Promise.all(e.map(n=>l(this,null,function*(){let a=CategoryRepository.getCategory.locally(n);return a!=null&&a.data?a.data:(yield CategoryRepository.getCategory(n)).data})));o(i);})}r();},[e]),t},Fc=s3e;var gs=e=>{let{onEditCommunity:t}=Y(),{community:o}=Ct({communityId:e,shouldCall:!!e}),r=rt({fileId:o==null?void 0:o.avatarFileId,imageSize:"medium"}),{posts:i}=Ao({targetType:"community",targetId:e,feedType:"reviewing"}),n=Fc(o==null?void 0:o.categoryIds),{canReview:a,canEdit:s}=Vx({community:o}),l=useMemo(()=>(i==null?void 0:i.length)||0,[i]);return {community:o,reviewingPosts:i,avatarFileUrl:r,communityCategories:n,pendingPostsCount:l,canEditCommunity:s,canReviewCommunityPosts:a,onEditCommunity:t,joinCommunity:()=>e&&(o==null?void 0:o.join()),leaveCommunity:()=>e&&CommunityRepository.leaveCommunity(e),updateCommunity:g=>e&&CommunityRepository.updateCommunity(e,g),closeCommunity:()=>e&&CommunityRepository.deleteCommunity(e)}};function xm(){let{client:e}=Ne(),[t,o]=useState(null);return useEffect(()=>{if(!e)return;l(this,null,function*(){let i=yield e==null?void 0:e.getSocialSettings();i&&o(i);});},[e]),{socialSettings:t}}var c3e="global-admin",{COMMUNITY_MODERATOR:p3e,CHANNEL_MODERATOR:u3e,MODERATOR:g3e,SUPER_MODERATOR:f3e}=kc,dH=e=>{if(!(e!=null&&e.length))return !1;let t=[p3e,u3e,g3e,f3e];return e.some(o=>t.includes(o))},V8=e=>e!=null&&e.length?e.includes(c3e):!1;var Su=(e,t)=>e&&t?e.hasPermission("MANAGE_COMMUNITY_STORY").community(t):!1;function U8(e){if(!e)return;let t=new Date(e),r=Math.floor((new Date().getTime()-t.getTime())/1e3);if(r===1)return "Just now";if(r>1&&r<60)return `${r}s`;if(r>=60&&r<3600)return `${Math.floor(r/60)}m`;if(r>=3600&&r<86400)return `${Math.floor(r/3600)}h`}function Pm(e,t){return e?!!(e.hasPermission("CREATE_PRIVILEGED_POST").community(t.communityId)||t.postSetting!=="ONLY_ADMIN_CAN_POST"):!1}var H8=(e,t)=>e&&t?e.hasPermission("EDIT_COMMUNITY").community(t):!1,Hx=(e,t)=>e&&t?e.hasPermission("REVIEW_COMMUNITY_POST").community(t):!1,Ox=(e,t)=>e&&t?e.hasPermission("DELETE_COMMUNITY").community(t):!1,cH=(e,t)=>!e||!t?!1:e.hasPermission("DELETE_COMMUNITY_POST").currentUser()&&t==="community",pg=({total:e,altText:t,current:o,leftCount:r=0,isLastImage:i=!1})=>r&&i&&e>4?`Activate to view ${r} more photos`:`Photo ${o} of ${e}: ${t||"No description available"}`;function Ma(e){var s,l;let{client:t}=Ne(),{socialSettings:o}=xm(),{user:r}=qe({userId:t==null?void 0:t.userId}),i=V8(r==null?void 0:r.roles),n=dH(r==null?void 0:r.roles);return {hasStoryPermission:e?((l=o==null?void 0:o.story)==null?void 0:l.allowAllUserToCreateStory)||i||n||Su(t,e):(s=o==null?void 0:o.story)==null?void 0:s.allowAllUserToCreateStory}}var ug={errorIcon:"gf",addStoryButton:"pf",hiddenInput:"bf",storyWrapper:"uf",storyTabContainer:"ff",storyAvatarContainer:"vf",storyAvatar:"wf",storyTitle:"xf","animate-ring":"so",progressRing:"yf",progressRingStatic:"kf"};var C3e=e=>ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16"},e),ie__default.createElement("circle",{cx:"8",cy:"8",r:"7.25",fill:"#FA4D30",stroke:"#fff",strokeWidth:"1.5"}),ie__default.createElement("path",{fill:"#fff",d:"M9.25 10.75C9.25 11.453 8.687 12 8 12c-.703 0-1.25-.547-1.25-1.25 0-.688.547-1.25 1.25-1.25.688 0 1.25.563 1.25 1.25zM6.89 4.406A.378.378 0 017.267 4h1.453c.219 0 .39.188.375.406l-.203 4.25A.387.387 0 018.516 9H7.469a.387.387 0 01-.375-.344l-.203-4.25z"})),z8=({pageId:e="*",componentId:t="*",communityId:o,onFileChange:r,onStoryClick:i})=>{let{client:n}=Ne(),{community:a}=gs(o),{hasStoryPermission:s}=Ma(o),{isExcluded:l,accessibilityId:m,themeStyles:c}=se({pageId:e,componentId:t}),{stories:d}=Lc({targetId:o,targetType:"community",options:{orderBy:"asc",sortBy:"createdAt"}}),u=(d==null?void 0:d.length)>0,g=d.filter(_=>!_.adId),f=g.some(_=>!(_!=null&&_.isSeen)),C=g.some(_=>(_==null?void 0:_.syncState)==="syncing"),y=g.some(_=>(_==null?void 0:_.syncState)==="error"),b=()=>{Array.isArray(d)&&d.length===0||i();};return l||!u&&!s||a&&!Pm(n,a)||a!=null&&a.isPublic&&!a.isJoined&&!u?null:ie__default.createElement("div",{"data-testid":m,style:c,className:wl(ug.storyTabContainer)},ie__default.createElement("div",{className:wl(ug.storyWrapper)},u&&ie__default.createElement(cg,{pageId:e,componentId:t,hasUnseen:f,uploading:C,isErrored:y,size:48}),ie__default.createElement("button",{className:wl(ug.storyAvatarContainer),onClick:b},ie__default.createElement(ti,{pageId:e,componentId:t,community:a})),(a==null?void 0:a.isJoined)&&s&&a&&Pm(n,a)&&ie__default.createElement(FileTrigger,{onSelect:_=>{let x=Array.from(_);r(x[0]);}},ie__default.createElement(U1,{pageId:e,componentId:t})),y&&ie__default.createElement(C3e,{className:wl(ug.errorIcon)})),ie__default.createElement(v.Caption,{"data-testid":`${e}/${t}/story_title`},"Story"))};var cl={storyTabContainer:"do",storyTab:"jf",storyTabImage:"zf",storyTabContent:"Xf",storyTabTitle:"Yf",storyTabIcons:"co",storyTabSkeleton:"If",storyTabSkeletonAvatar:"Af","skeleton-pulse":"He",storyTabSkeletonUsername:"Mf",storyTabGlobalFeeed__arrow:"lo",storyTabGlobalFeeed__arrowIcon:"Sf",left:"no",right:"mo"};var _3e=e=>ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},e),ie__default.createElement("path",{d:"M20.4187 17.2429V15.4838L21.6578 14.2365C21.6585 14.2358 21.6591 14.2351 21.6598 14.2345C22.3179 13.5807 22.7516 12.8355 22.75 11.9942C22.7484 11.1537 22.3123 10.4094 21.6598 9.75682L20.4187 8.51578V6.7571C20.4187 5.82907 20.1982 4.99346 19.6024 4.39762C19.0065 3.80179 18.1709 3.58128 17.2429 3.58128H15.4842L14.2432 2.34024L13.7265 2.85697L14.2432 2.34024C13.5864 1.68348 12.8389 1.24622 11.9953 1.24784C11.1522 1.24946 10.4079 1.68897 9.75583 2.34991L8.51619 3.58128H6.75709C5.8332 3.58128 4.99652 3.79543 4.39906 4.38966C3.80081 4.98466 3.58127 5.82245 3.58127 6.7571V8.51578L2.34222 9.75484C2.34186 9.75519 2.3415 9.75555 2.34114 9.75591C1.68254 10.4099 1.24839 11.1554 1.25 11.9971C1.25162 12.8372 1.68721 13.5812 2.33924 14.2335C2.33957 14.2338 2.3399 14.2342 2.34023 14.2345L3.58127 15.4838V17.2429C3.58127 18.1709 3.80178 19.0066 4.39761 19.6024C4.99345 20.1982 5.82907 20.4187 6.75709 20.4187H8.51577L9.75483 21.6578C9.75525 21.6582 9.75567 21.6586 9.75609 21.6591C10.4102 22.3177 11.1557 22.7516 11.9982 22.75C12.8389 22.7484 13.5848 22.3133 14.2412 21.6618L14.2432 21.6598L15.4842 20.4187H17.2429C18.1709 20.4187 19.0065 20.1982 19.6024 19.6024C20.1982 19.0066 20.4187 18.1709 20.4187 17.2429ZM11.1362 14.6127L15.3255 8.63293C15.3257 8.63263 15.3259 8.63232 15.3261 8.63202C15.3555 8.59049 15.3769 8.56736 15.3897 8.55517C15.3961 8.54919 15.4003 8.54586 15.4025 8.54426L15.4048 8.54269L15.4054 8.54234L15.4054 8.54232L15.4062 8.542C15.4072 8.54166 15.4101 8.54065 15.4157 8.53942C15.4272 8.53692 15.4517 8.53308 15.4953 8.53308C15.5882 8.53308 15.6273 8.563 15.6388 8.57409C15.649 8.58379 15.6664 8.60504 15.6669 8.65903C15.6668 8.65902 15.6656 8.67471 15.6559 8.70306C15.6448 8.73553 15.6277 8.7697 15.6066 8.79916L15.6062 8.79975L10.738 15.6292C10.7079 15.6666 10.6872 15.6779 10.6764 15.6829C10.6626 15.6894 10.6288 15.7017 10.5567 15.7017C10.4668 15.7017 10.4177 15.6786 10.3664 15.6272L7.5945 12.5262L7.58765 12.5185L7.58058 12.511C7.58023 12.5106 7.57454 12.5043 7.5688 12.489C7.56299 12.4736 7.55926 12.4545 7.55926 12.4347C7.55926 12.3583 7.58347 12.332 7.59029 12.3253C7.59747 12.3182 7.63028 12.2892 7.72221 12.2892C7.78716 12.2892 7.81058 12.2992 7.8149 12.3011L7.81503 12.3012C7.81882 12.3028 7.8367 12.3105 7.87134 12.3478L9.9633 14.6828L10.5939 15.3867L11.1362 14.6127Z",fill:"#1054DE",stroke:"white",strokeWidth:"1.5"})),uH=_3e;var zx=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M10 14.875C9.5 14.875 9.125 14.5 9.125 14V12C9.125 11.5312 9.5 11.125 10 11.125C10.4688 11.125 10.875 11.5312 10.875 12V14C10.875 14.5 10.4688 14.875 10 14.875ZM17 9.5V16.5C17 17.3438 16.3125 18 15.5 18H4.5C3.65625 18 3 17.3438 3 16.5V9.5C3 8.6875 3.65625 8 4.5 8H5.5V6.5C5.5 4.03125 7.5 2 10 2C12.5 2.03125 14.5 4.0625 14.5 6.5625V8H15.5C16.3125 8 17 8.6875 17 9.5ZM7 8H13V6.5C13 4.875 11.625 3.5 10 3.5C8.34375 3.5 7 4.875 7 6.5V8ZM15.5 9.5H4.5V16.5H15.5V9.5Z"})),J1=zx;var jx={communityPrivateBadge:"Cf"};function ar({className:e,pageId:t="*",componentId:o="*"}){let r="community_private_badge",{accessibilityId:i,config:n,defaultConfig:a,isExcluded:s,uiReference:l,themeStyles:m}=S({pageId:t,componentId:o,elementId:r});return s?null:ie__default.createElement(Z,{configIconName:n.image,defaultIconName:a.image,defaultIcon:()=>ie__default.createElement(zx,{style:m,"data-testid":i,className:wl(jx.communityPrivateBadge,e)}),imgIcon:()=>ie__default.createElement("img",{src:n.image,alt:l,"data-testid":i,className:jx.communityPrivateBadge})})}var Im={container:"Ef",avatarContainer:"Rf",verifiedIcon:"Uf",avatarBackground:"Bf",avatar:"Ff",displayName:"Hf",errorIcon:"Lf",lockIcon:"Tf"};var I3e=e=>ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16"},e),ie__default.createElement("circle",{cx:"8",cy:"8",r:"7.25",fill:"#FA4D30",stroke:"#fff",strokeWidth:"1.5"}),ie__default.createElement("path",{fill:"#fff",d:"M9.25 10.75C9.25 11.453 8.687 12 8 12c-.703 0-1.25-.547-1.25-1.25 0-.688.547-1.25 1.25-1.25.688 0 1.25.563 1.25 1.25zM6.89 4.406A.378.378 0 017.267 4h1.453c.219 0 .39.188.375.406l-.203 4.25A.387.387 0 018.516 9H7.469a.387.387 0 01-.375-.344l-.203-4.25z"}));var yH=({pageId:e,componentId:t,targetId:o,hasUnseen:r,onClick:i,isErrored:n})=>{let{community:a}=Ct({communityId:o}),s=rt({fileId:a==null?void 0:a.avatarFileId,imageSize:"small"});return ie__default.createElement("div",{className:wl(Im.container),onClick:i},ie__default.createElement("div",{className:Im.avatarContainer},ie__default.createElement(cg,{pageId:e,componentId:t,hasUnseen:r,isErrored:n}),ie__default.createElement("div",{"data-testid":`${e}/${t}/community_avatar`,className:Im.avatarBackground},s&&ie__default.createElement("img",{className:Im.avatar,src:s,alt:a==null?void 0:a.displayName})),n&&ie__default.createElement(I3e,{className:Im.errorIcon}),(a==null?void 0:a.isOfficial)&&!n&&ie__default.createElement(uH,{className:Im.verifiedIcon})),ie__default.createElement(v.Caption,{"data-testid":`${e}/${t}/community_name`,className:wl(Im.displayName)},!(a!=null&&a.isPublic)&&ie__default.createElement(ar,{className:Im.lockIcon}),a==null?void 0:a.displayName))};var j8=e=>{let l=it({fetcher:StoryRepository.getGlobalStoryTargets,params:e,shouldCall:!0}),{items:t,hasMore:o,loadMore:r,isLoading:i,refresh:n}=l,a$1=d(l,["items","hasMore","loadMore","isLoading","refresh"]);return a({stories:t,hasMore:o,isLoading:i,loadMoreStories:()=>{o&&!i&&r();},refresh:n},a$1)};var hH={carousel:"Vf"};var ku=({children:e,isHidden:t,className:o,iconClassName:r,leftArrowClassName:i,scrollOffset:n=250,rightArrowClassName:a})=>{let s=useRef(null),[l,m]=useState(!1),[c,d]=useState(!1),[u,g]=useState(!1),f=_=>{s.current&&s.current.scrollBy({left:_,behavior:"smooth"});},C=()=>f(-n),y=()=>f(n),b=()=>{if(s.current){let{scrollLeft:_,scrollWidth:x,clientWidth:P}=s.current;m(x>P),d(_>0),g(_+P<x);}};return useEffect(()=>(setTimeout(()=>b(),300),s&&s.current&&s.current.addEventListener("scroll",b),()=>{s.current&&s.current.removeEventListener("scroll",b);}),[s.current]),ie__default.createElement("section",{className:wl(hH.carousel,o)},l&&!t&&ie__default.createElement(V,{onPress:C,className:wl(i),"data-shown":c,isDisabled:!c},ie__default.createElement(sc,{className:wl(r)})),ie__default.cloneElement(e,{ref:s}),l&&!t&&ie__default.createElement(V,{onPress:y,"data-shown":u,isDisabled:!u,className:wl(a)},ie__default.createElement(wo,{className:wl(r)})))};var N3e=10,G8=({pageId:e="*",componentId:t="*",goToViewStoryPage:o})=>{let{isExcluded:r,accessibilityId:i,themeStyles:n}=se({pageId:e,componentId:t}),{stories:a,isLoading:s,hasMore:l,loadMoreStories:m,refresh:c}=j8({seenState:"smart",limit:N3e}),d=useRef(null),u=useRef(null);return useEffect(()=>{c();},[]),useEffect(()=>{if(!d.current)return;let g=new IntersectionObserver(f=>{f[0].isIntersecting&&l&&m();},{root:d.current,rootMargin:"0px",threshold:.9});return ()=>{g&&g.disconnect();}},[d==null?void 0:d.current]),r||!s&&(a==null?void 0:a.length)===0?null:ie__default.createElement(ku,{scrollOffset:300,isHidden:s||a.length<=6,iconClassName:cl.storyTabGlobalFeeed__arrowIcon,leftArrowClassName:wl(cl.storyTabGlobalFeeed__arrow,cl.left),rightArrowClassName:wl(cl.storyTabGlobalFeeed__arrow,cl.right)},ie__default.createElement("div",{"data-testid":i,style:n,className:cl.storyTabContainer,ref:d},s?Array.from({length:10}).map((g,f)=>ie__default.createElement("div",{key:f,className:cl.storyTabSkeleton},ie__default.createElement("div",{className:cl.storyTabSkeletonAvatar}),ie__default.createElement("div",{className:cl.storyTabSkeletonUsername}))):a.map(g=>ie__default.createElement(yH,{pageId:e,componentId:t,key:g.targetId,targetId:g.targetId,hasUnseen:g.hasUnseen,isErrored:g.failedStoriesCount>0,onClick:()=>o({storyTargets:a,storyTarget:g}),size:64})),ie__default.createElement("div",{ref:u,style:{height:"1px",width:"1px"}})))};var Bu=o=>{var r=o,{pageId:e="*"}=r,t=d(r,["pageId"]);let i="story_tab_component",{AmityGlobalFeedComponentBehavior:n}=we(),{goToViewStoryPage:a,goToDraftStoryPage:s}=Y(),{setFile:l}=In();return (()=>{switch(t.type){case"communityFeed":return ie__default.createElement(z8,{pageId:e,componentId:i,communityId:t.communityId||"",onFileChange:c=>{l(c),c&&s(t.communityId||"","community",c.type.includes("image")?{type:"image",url:URL.createObjectURL(c)}:{type:"video",url:URL.createObjectURL(c)},"communityFeed");},onStoryClick:()=>a({targetId:t.communityId||"",targetType:"community",storyType:"communityFeed"})});case"globalFeed":return ie__default.createElement(G8,{pageId:e,componentId:i,goToViewStoryPage:({storyTarget:c,storyTargets:d})=>{var u;(u=n==null?void 0:n.goToViewStoryPage)==null||u.call(n,{targetId:c.targetId,targetType:c.targetType,storyType:"globalFeed",targetIds:d.map(g=>g.targetId)});}});default:return null}})()};var $8={createPostButton:"Wf",createPostButton__text:"ho",createPostButton__icon:"go"};function yg({pageId:e="*",componentId:t="*",defaultClassName:o,onClick:r}){let i="create_post_button",{accessibilityId:n,config:a,defaultConfig:s,isExcluded:l,uiReference:m,themeStyles:c}=S({pageId:e,componentId:t,elementId:i});return l?null:ie__default.createElement(V,{className:$8.createPostButton,onPress:()=>r==null?void 0:r(),"data-testid":n,style:c},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement($1,{className:wl($8.createPostButton__icon,o)}),imgIcon:()=>ie__default.createElement("img",{src:a.image,alt:m}),configIconName:a.image,defaultIconName:s.image}),ie__default.createElement(v.BodyBold,{className:$8.createPostButton__text},a.text))}var Z8={createPollButton:"qf",createPollButton__text:"po",createPollButton__icon:"bo"};var A3e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M14.0859 0.375C15 0.375 15.7734 1.14844 15.7734 2.0625V14.4375C15.7734 15.3867 15 16.125 14.0859 16.125H1.71094C0.761719 16.125 0.0234375 15.3867 0.0234375 14.4375V2.0625C0.0234375 1.14844 0.761719 0.375 1.71094 0.375H14.0859ZM14.0859 14.4375V2.0625H1.71094V14.4375H14.0859ZM4.24219 12.75C3.92578 12.75 3.67969 12.5039 3.67969 12.1875V7.6875C3.67969 7.40625 3.92578 7.125 4.24219 7.125H4.80469C5.08594 7.125 5.36719 7.40625 5.36719 7.6875V12.1875C5.36719 12.5039 5.08594 12.75 4.80469 12.75H4.24219ZM7.61719 12.75C7.30078 12.75 7.05469 12.5039 7.05469 12.1875V4.3125C7.05469 4.03125 7.30078 3.75 7.61719 3.75H8.17969C8.46094 3.75 8.74219 4.03125 8.74219 4.3125V12.1875C8.74219 12.5039 8.46094 12.75 8.17969 12.75H7.61719ZM10.9922 12.75C10.6758 12.75 10.4297 12.5039 10.4297 12.1875V9.9375C10.4297 9.65625 10.6758 9.375 10.9922 9.375H11.5547C11.8359 9.375 12.1172 9.65625 12.1172 9.9375V12.1875C12.1172 12.5039 11.8359 12.75 11.5547 12.75H10.9922Z",fill:"currentColor"})),W8=A3e;function Cg({pageId:e="*",componentId:t="*",onClick:o,defaultClassName:r}){let i="create_poll_button",{accessibilityId:n,config:a,defaultConfig:s,isExcluded:l,uiReference:m,themeStyles:c}=S({pageId:e,componentId:t,elementId:i});return l?null:ie__default.createElement(V,{className:Z8.createPollButton,onPress:o,"data-testid":n,style:c},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(W8,{className:wl(Z8.createPollButton__icon,r)}),imgIcon:()=>ie__default.createElement("img",{src:a.image,alt:m}),configIconName:a.image,defaultIconName:s.image}),ie__default.createElement(v.BodyBold,{className:Z8.createPollButton__text},a.text))}var q8=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M19.6484 4.375C20.8789 4.375 21.8984 5.39453 21.8984 6.625V17.875C21.8984 19.1406 20.8789 20.125 19.6484 20.125H6.14844C4.88281 20.125 3.89844 19.1406 3.89844 17.875V6.625C3.89844 5.39453 4.88281 4.375 6.14844 4.375H19.6484ZM12.8281 6.0625L10.0156 8.875H12.3711L15.1836 6.0625H12.8281ZM5.58594 7.71484V8.875H6.74609L9.55859 6.0625H7.20312L5.58594 7.71484ZM20.2109 17.875V10.5625H5.58594V17.875C5.58594 18.1914 5.83203 18.4375 6.14844 18.4375H19.6484C19.9297 18.4375 20.2109 18.1914 20.2109 17.875ZM20.2109 6.69531V6.625C20.2109 6.34375 19.9297 6.0625 19.6484 6.0625H18.4531L15.6406 8.875H17.9961L20.2109 6.69531ZM11.5625 17.3125C11.4922 17.3125 11.457 17.3125 11.3867 17.2773C11.2812 17.207 11.2109 17.0664 11.2109 16.9258V12.0742C11.2109 11.9336 11.2812 11.8281 11.3867 11.7578C11.4922 11.6875 11.668 11.6875 11.7734 11.7227L15.5 14.1484C15.6406 14.2188 15.7109 14.3242 15.7109 14.5C15.7109 14.6406 15.6406 14.7812 15.5352 14.8516L11.7734 17.2773C11.7031 17.3125 11.6328 17.3125 11.5625 17.3125Z",fill:"currentColor"}));var Y8={createClipButton:"Df",createClipButton__text:"Gf",createClipButton__icon:"Jf"};function _g({pageId:e="*",componentId:t="*",defaultClassName:o,onClick:r}){let i="create_clip_button",{accessibilityId:n,config:a,defaultConfig:s,isExcluded:l,uiReference:m,themeStyles:c}=S({pageId:e,componentId:t,elementId:i});return l?null:ie__default.createElement(V,{className:Y8.createClipButton,onPress:()=>r==null?void 0:r(),"data-testid":n,style:c},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(q8,{className:wl(Y8.createClipButton__icon,o)}),imgIcon:()=>ie__default.createElement("img",{src:a.image,alt:m}),configIconName:a.image,defaultIconName:s.image}),ie__default.createElement(v.BodyBold,{className:Y8.createClipButton__text},a.text))}var IH={createPostMenu:"Kf"};function Q8({pageId:e}){let t="create_post_menu",{hasStoryPermission:o}=Ma(),{AmityCreatePostMenuComponentBehavior:r}=we(),{isDesktop:i}=le();return ie__default.createElement("div",{className:IH.createPostMenu},ie__default.createElement(yg,{pageId:e,componentId:t,onClick:()=>{var n;return (n=r==null?void 0:r.goToSelectPostTargetPage)==null?void 0:n.call(r)}}),ie__default.createElement(Cg,{pageId:e,componentId:t,onClick:()=>{var n;return (n=r==null?void 0:r.goToSelectPollPostTargetPage)==null?void 0:n.call(r)}}),o&&ie__default.createElement(z2,{pageId:e,componentId:t,onClick:()=>{var n;return (n=r==null?void 0:r.goToStoryTargetSelectionPage)==null?void 0:n.call(r)}}),!i&&ie__default.createElement(_g,{pageId:e,componentId:t,onClick:()=>{var n;return (n=r==null?void 0:r.goToSelectClipPostTargetPage)==null?void 0:n.call(r,{isClipPost:!0})}}))}var wH=e=>ie__default.createElement("svg",a({fill:"none",width:"100%",height:"100%",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z",stroke:"currentColor",strokeWidth:"1.3",strokeMiterlimit:"10"}),ie__default.createElement("path",{d:"M16 12L10 8V16L16 12Z",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})),TH=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M19.375 4.375C20.6055 4.375 21.625 5.39453 21.625 6.625V17.875C21.625 19.1406 20.6055 20.125 19.375 20.125H5.875C4.60938 20.125 3.625 19.1406 3.625 17.875V6.625C3.625 5.39453 4.60938 4.375 5.875 4.375H19.375ZM12.5547 6.0625L9.74219 8.875H12.0977L14.9102 6.0625H12.5547ZM5.3125 7.71484V8.875H6.47266L9.28516 6.0625H6.92969L5.3125 7.71484ZM19.9375 17.875V10.5625H5.3125V17.875C5.3125 18.1914 5.55859 18.4375 5.875 18.4375H19.375C19.6562 18.4375 19.9375 18.1914 19.9375 17.875ZM19.9375 6.69531V6.625C19.9375 6.34375 19.6562 6.0625 19.375 6.0625H18.1797L15.3672 8.875H17.7227L19.9375 6.69531ZM11.2891 17.3125C11.2188 17.3125 11.1836 17.3125 11.1133 17.2773C11.0078 17.207 10.9375 17.0664 10.9375 16.9258V12.0742C10.9375 11.9336 11.0078 11.8281 11.1133 11.7578C11.2188 11.6875 11.3945 11.6875 11.5 11.7227L15.2266 14.1484C15.3672 14.2188 15.4375 14.3242 15.4375 14.5C15.4375 14.6406 15.3672 14.7812 15.2617 14.8516L11.5 17.2773C11.4297 17.3125 11.3594 17.3125 11.2891 17.3125Z",fill:"currentColor"}));var Pg={videoButton:"ie",videoButton__icon:"uo",videoButton__input:"Nf",videoButton__label:"fo"};function Vc({onPress:e,pageId:t="*",componentId:o="*",imgIconClassName:r,onVideoFileChange:i,defaultIconClassName:n,isDisabled:a=!1}){let s="video_button",{themeStyles:l,isExcluded:m,config:c,accessibilityId:d,uiReference:u,defaultConfig:g}=S({pageId:t,componentId:o,elementId:s});if(m)return null;let f=()=>{document.getElementById("video-upload").click();},C=y=>{y.preventDefault(),y.stopPropagation(),i==null||i(y.target.files?[...y.target.files]:[]);};return ie__default.createElement(V,{style:l,className:Pg.videoButton,"data-testid":d,onPress:e||f,isDisabled:a},ie__default.createElement(Z,{configIconName:c.icon,defaultIconName:g.icon,imgIcon:()=>ie__default.createElement("img",{src:c.icon,alt:u,className:r}),defaultIcon:()=>ie__default.createElement(wH,{"data-disabled":a,className:wl(Pg.videoButton__icon,n)})}),c.text&&ie__default.createElement(v.BodyBold,{className:Pg.videoButton__label},c.text),!e&&ie__default.createElement("input",{multiple:!0,type:"file",accept:"video/*",id:"video-upload",onChange:C,className:Pg.videoButton__input}))}var Ig={mediaAttachment:"Of",mediaAttachment__swipeDown:"vo",mediaAttachment__wrapMedia:"wo",mediaAttachment__wrapMedia_2items:"xo"};var Zx=10;function X1({pageId:e,isVisibleCamera:t,isVisibleImage:o,isVisibleVideo:r,totalMedia:i=0,onVideoFileChange:n,onImageFileChange:a}){let s="media_attachment",{themeStyles:l,accessibilityId:m,isExcluded:c}=se({pageId:e,componentId:s});return c?null:ie__default.createElement("div",{style:l,"data-testid":m,className:Ig.mediaAttachment},ie__default.createElement("div",{className:Ig.mediaAttachment__swipeDown}),ie__default.createElement("div",{className:wl(!o||!r||!t?Ig.mediaAttachment__wrapMedia_2items:Ig.mediaAttachment__wrapMedia)},t&&ie__default.createElement(Cm,{pageId:e,componentId:s,isVisibleImage:o,isVisibleVideo:r,onVideoFileChange:n,onImageFileChange:a,isDisabled:!!i&&i>=Zx}),o&&ie__default.createElement(ls,{pageId:e,componentId:s,onImageFileChange:a,isDisabled:!!i&&i>=Zx}),r&&ie__default.createElement(Vc,{pageId:e,componentId:s,onVideoFileChange:n,isDisabled:!!i&&i>=Zx})))}var Wx={detailedMediaAttachment:"Pf",detailedMediaAttachment__swipeDown:"Qf"};var qx=10;function Lu({pageId:e,isVisibleCamera:t,isVisibleImage:o,isVisibleVideo:r,totalMedia:i=0,onVideoFileChange:n,onImageFileChange:a}){let s="detailed_media_attachment",{themeStyles:l,accessibilityId:m,isExcluded:c}=se({pageId:e,componentId:s});return c?null:ie__default.createElement("div",{style:l,"data-testid":m,className:Wx.detailedMediaAttachment},ie__default.createElement("div",{className:Wx.detailedMediaAttachment__swipeDown}),t&&ie__default.createElement(Cm,{pageId:e,componentId:s,isVisibleImage:o,isVisibleVideo:r,isDisabled:!!i&&i>=qx,onVideoFileChange:n,onImageFileChange:a}),o&&ie__default.createElement(ls,{pageId:e,componentId:s,isDisabled:!!i&&i>=qx,onImageFileChange:a}),r&&ie__default.createElement(Vc,{pageId:e,componentId:s,isDisabled:!!i&&i>=qx,onVideoFileChange:n}))}var wm={userItem:"yo",userItem__leftPane:"Zf",userItem__rightPane:"_f",userItem__avatar:"e1",userItem__brandIcon__container:"r1",userItem__brandIcon:"a1",userItem__userName:"o1",userItem__userName__text:"t1"};var MH=({user:e,onClick:t,pageId:o="*",componentId:r="*"})=>{let{onClickUser:i}=Y();return ie__default.createElement(V,{key:e.userId,className:wm.userItem,onPress:()=>{t==null||t(),i(e.userId);}},ie__default.createElement("div",{"data-testid":`${o}/${r}/search_user_avatar`,className:wm.userItem__leftPane},ie__default.createElement(Ae,{pageId:o,userId:e.userId,componentId:r,className:wm.userItem__avatar})),ie__default.createElement("div",{className:wm.userItem__rightPane},ie__default.createElement("div",{className:wm.userItem__userName},ie__default.createElement(v.BodyBold,{className:wm.userItem__userName__text,"data-testid":`${o}/${r}/search_username`},e.displayName),e.isBrand?ie__default.createElement("div",{className:wm.userItem__brandIcon__container},ie__default.createElement(Mn,{className:wm.userItem__brandIcon})):null)))};var pl={userSearchItemSkeleton:"i1",userSearchItemSkeleton__leftPane:"s1",userSearchItemSkeleton__information:"d1",userSearchItemSkeleton__content:"c1",userSearchItemSkeleton__animation:"l1","skeleton-pulse":"ko",userSearchItemSkeleton__userAvatar:"n1",userSearchItemSkeleton__information__title:"m1"};var SH=({pageId:e="*",componentId:t="*"})=>{let{accessibilityId:o}=se({pageId:e,componentId:t});return ie__default.createElement("div",{"data-testid":o,className:wl(pl.userSearchItemSkeleton,pl.userSearchItemSkeleton__animation)},ie__default.createElement("div",{className:pl.userSearchItemSkeleton__leftPane},ie__default.createElement("div",{className:wl(pl.userSearchItemSkeleton__userAvatar,pl.userSearchItemSkeleton__animation)})),ie__default.createElement("div",{className:wl(pl.userSearchItemSkeleton__information,pl.userSearchItemSkeleton__animation)},ie__default.createElement("div",{className:wl(pl.userSearchItemSkeleton__information__title,pl.userSearchItemSkeleton__animation)})))};var J8={emptySearchResult:"jo",emptySearchResult__icon:"h1",emptySearchResult__text:"g1"};var Mg=e=>ie__default.createElement("div",a({className:J8.emptySearchResult},e),ie__default.createElement(U7,{className:J8.emptySearchResult__icon}),ie__default.createElement(v.TitleBold,{className:J8.emptySearchResult__text},"No results found"));var Sg={noInternetConnection__container:"p1",noInternetConnection__icon:"b1",noInternetConnection__title:"u1",noInternetConnection__retry:"f1"};var NH=({isShowRetryButton:e=!1,onRetry:t,className:o})=>ie__default.createElement("div",{className:wl(Sg.noInternetConnection__container,o)},ie__default.createElement(Z2,{className:Sg.noInternetConnection__icon}),ie__default.createElement(v.TitleBold,{className:Sg.noInternetConnection__title},"No internet connection"),e&&ie__default.createElement(oe,{onPress:t,variant:"outlined",className:Sg.noInternetConnection__retry},"Retry"));var kH={noInternetConnectionHoc:"zo"};var wr=n=>{var a$1=n,{page:e,children:t,className:o,refresh:r}=a$1,i=d(a$1,["page","children","className","refresh"]);let{online:s}=useNetworkState();return useEffect(()=>{s&&(r==null||r());},[s]),s?ie__default.createElement(ie__default.Fragment,null,t):ie__default.createElement("div",{className:wl(kH.noInternetConnectionHoc,o),"data-page":e},ie__default.createElement(NH,a({},i)))};var Qx={userSearchResult:"v1",userSearchResult__noInternetConnectionHoc:"w1"};var ey=({isLoading:e,onLoadMore:t,pageId:o="*",onClosePopover:r,userCollection:i=[]})=>{let n="user_search_result",{accessibilityId:a,themeStyles:s}=se({pageId:o,componentId:n}),[l,m]=useState(null);return ke({onIntersect:()=>t(),node:l}),ie__default.createElement("div",{className:Qx.userSearchResult,style:s,"data-testid":a},ie__default.createElement(wr,{page:"global-search",className:Qx.userSearchResult__noInternetConnectionHoc},i.length>0&&i.map(c=>ie__default.createElement(MH,{user:c,pageId:o,key:c.userId,onClick:r,componentId:n})),e?Array.from({length:5}).map((c,d)=>ie__default.createElement(SH,{key:d,pageId:o,componentId:n})):null,!e&&i.length===0&&ie__default.createElement(Mg,null)),ie__default.createElement("div",{ref:c=>m(c)}))};var BH={communityRowImage__img:"x1"};var Du=r=>{var i=r,{fallBackRenderer:e,src:t}=i,o=d(i,["fallBackRenderer","src"]);let[n,a$1]=useState(!1),s=l=>{a$1(!0);};return n||t==null?e?e():null:ie__default.createElement("img",b(a({},o),{src:t,onError:s}))};var rge=()=>ie__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"81",height:"80",viewBox:"0 0 81 80",fill:"none"},ie__default.createElement("g",{clipPath:"url(#clip0_7036_40403)"},ie__default.createElement("rect",{x:"0.449219",width:"80",height:"80",rx:"4",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M40.449 28.8C41.9151 28.8 43.3213 29.3697 44.358 30.3837C45.3947 31.3977 45.9772 32.7729 45.9772 34.2069C45.9772 35.6409 45.3947 37.0162 44.358 38.0302C43.3213 39.0442 41.9151 39.6138 40.449 39.6138C38.9828 39.6138 37.5767 39.0442 36.5399 38.0302C35.5032 37.0162 34.9208 35.6409 34.9208 34.2069C34.9208 32.7729 35.5032 31.3977 36.5399 30.3837C37.5767 29.3697 38.9828 28.8 40.449 28.8ZM29.3926 32.6621C30.2771 32.6621 31.0984 32.8938 31.8092 33.3109C31.5722 35.52 32.2356 37.7137 33.594 39.4285C32.8042 40.9115 31.2248 41.9311 29.3926 41.9311C28.1358 41.9311 26.9306 41.4428 26.042 40.5737C25.1533 39.7045 24.6541 38.5257 24.6541 37.2966C24.6541 36.0675 25.1533 34.8887 26.042 34.0195C26.9306 33.1504 28.1358 32.6621 29.3926 32.6621ZM51.5054 32.6621C52.7621 32.6621 53.9673 33.1504 54.856 34.0195C55.7446 34.8887 56.2438 36.0675 56.2438 37.2966C56.2438 38.5257 55.7446 39.7045 54.856 40.5737C53.9673 41.4428 52.7621 41.9311 51.5054 41.9311C49.6732 41.9311 48.0937 40.9115 47.3039 39.4285C48.6623 37.7137 49.3257 35.52 49.0888 33.3109C49.7995 32.8938 50.6209 32.6621 51.5054 32.6621ZM30.1823 48.4966C30.1823 45.2988 34.7786 42.7035 40.449 42.7035C46.1193 42.7035 50.7156 45.2988 50.7156 48.4966V51.2H30.1823V48.4966ZM21.4951 51.2V48.8828C21.4951 46.7355 24.4803 44.928 28.5238 44.4028C27.5919 45.4533 27.0233 46.9054 27.0233 48.4966V51.2H21.4951ZM59.4028 51.2H53.8746V48.4966C53.8746 46.9054 53.306 45.4533 52.3741 44.4028C56.4176 44.928 59.4028 46.7355 59.4028 48.8828V51.2Z",fill:"white"}),ie__default.createElement("rect",{x:"0.449219",width:"80",height:"80",fill:"url(#paint0_linear_7036_40403)"})),ie__default.createElement("defs",null,ie__default.createElement("linearGradient",{id:"paint0_linear_7036_40403",x1:"40.4492",y1:"40",x2:"40.4492",y2:"80",gradientUnits:"userSpaceOnUse"},ie__default.createElement("stop",{stopOpacity:"0"}),ie__default.createElement("stop",{offset:"1",stopOpacity:"0.4"})),ie__default.createElement("clipPath",{id:"clip0_7036_40403"},ie__default.createElement("rect",{x:"0.449219",width:"80",height:"80",rx:"4",fill:"white"})))),EH=({pageId:e="*",componentId:t="*",imgSrc:o})=>{let r="community_row_image",{themeStyles:i}=S({pageId:e,componentId:t,elementId:r});return ie__default.createElement(Du,{style:i,className:BH.communityRowImage__img,src:o,fallBackRenderer:()=>ie__default.createElement(rge,null)})};var Uc=a$1=>{var s=a$1,{onClick:e,className:t,pageId:o="*",defaultClassName:r,componentId:i="*"}=s,n=d(s,["onClick","className","pageId","defaultClassName","componentId"]);let l="community_join_button",{config:m,themeStyles:c,accessibilityId:d$1,isExcluded:u,uiReference:g,defaultConfig:f}=S({pageId:o,componentId:i,elementId:l});return u?null:ie__default.createElement(oe,a({size:"small",variant:"fill",color:"primary",onPress:e,style:c,className:t,"data-testid":d$1,icon:({className:C})=>ie__default.createElement(Z,{configIconName:m.icon,defaultIconName:f.icon,imgIcon:()=>ie__default.createElement("img",{src:m.icon,alt:g}),defaultIcon:()=>ie__default.createElement(br,{className:wl(C,r)})})},n),m.text)};var AH={communityDisplayName:"y1"};function Mo({className:e,community:t,pageId:o="*",componentId:r="*"}){var l;let i="community_display_name",{accessibilityId:n,isExcluded:a,themeStyles:s}=S({pageId:o,componentId:r,elementId:i});return a?null:ie__default.createElement(v.BodyBold,{style:s,"data-testid":n,className:wl(AH.communityDisplayName,e)},(l=t==null?void 0:t.displayName)!=null?l:"My Timeline")}var LH={communityMembersCount:"k1"};function Vu({pageId:e="*",componentId:t="*",memberCount:o}){let r="community_members_count",{accessibilityId:i,config:n,defaultConfig:a,isExcluded:s,uiReference:l,themeStyles:m}=S({pageId:e,componentId:t,elementId:r});return s?null:ie__default.createElement(v.Caption,{className:LH.communityMembersCount,style:m,"data-testid":i},`${fA(o)||0} ${o!==1?"members":"member"}`)}var cge=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M15.5938 4.625C15.75 4.46875 16 4.46875 16.125 4.625L17.0312 5.5C17.1562 5.65625 17.1562 5.90625 17.0312 6.03125L7.65625 15.4062C7.5 15.5625 7.28125 15.5625 7.125 15.4062L2.9375 11.25C2.8125 11.0938 2.8125 10.8438 2.9375 10.7188L3.84375 9.8125C3.96875 9.6875 4.21875 9.6875 4.375 9.8125L7.375 12.8438L15.5938 4.625Z"})),oy=cge;var ry=({onClick:e,className:t,pageId:o="*",defaultClassName:r,componentId:i="*"})=>{let n="community_joined_button",{config:a,themeStyles:s,accessibilityId:l,isExcluded:m,uiReference:c,defaultConfig:d}=S({pageId:o,componentId:i,elementId:n});return m?null:ie__default.createElement(oe,{size:"small",color:"secondary",onPress:e,variant:"outlined",style:s,className:t,"data-testid":l,icon:({className:u})=>ie__default.createElement(Z,{configIconName:a.icon,defaultIconName:d.icon,imgIcon:()=>ie__default.createElement("img",{src:a.icon,alt:c}),defaultIcon:()=>ie__default.createElement(oy,{className:wl(u,r)})})},ie__default.createElement(v.CaptionBold,null,a.text))};var Kx={communityOfficialBadge:"j1"};var fge=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("g",{clipPath:"url(#clip0_13767_12214)"},ie__default.createElement("path",{d:"M11.8976 17.8359L11.8996 17.834L12.8484 16.8852H14.193C14.9566 16.8852 15.6709 16.7038 16.1865 16.1882C16.7021 15.6726 16.8834 14.9584 16.8834 14.1947V12.8495L17.8322 11.8944C18.3738 11.3562 18.7497 10.7241 18.7483 9.99595C18.7469 9.26847 18.3691 8.63729 17.8322 8.1004L16.8834 7.15163V5.807C16.8834 5.04338 16.7021 4.3291 16.1865 3.81351C15.6709 3.29792 14.9566 3.11655 14.193 3.11655H12.8484L11.8996 2.16778C11.3594 1.62759 10.7254 1.2486 9.99508 1.25C9.26539 1.2514 8.63414 1.63213 8.09768 2.17571L7.15052 3.11655H5.80526C5.04577 3.11655 4.33044 3.29244 3.81321 3.80685C3.29521 4.32205 3.11481 5.03849 3.11481 5.807V7.15163L2.16803 8.09842C2.16771 8.09874 2.16738 8.09907 2.16706 8.09939C1.62494 8.63777 1.2486 9.27023 1.25 9.99883C1.2514 10.7259 1.62869 11.3567 2.16506 11.8934C2.16539 11.8937 2.16571 11.8941 2.16604 11.8944L3.11481 12.8495V14.1947C3.11481 14.9584 3.29618 15.6726 3.81177 16.1882C4.32736 16.7038 5.04164 16.8852 5.80526 16.8852H7.14989L8.09668 17.832C8.09701 17.8323 8.09734 17.8326 8.09767 17.833C8.63623 18.3753 9.26867 18.7514 9.99796 18.75C10.7254 18.7486 11.3578 18.3718 11.8976 17.8359ZM12.7177 16.8852C12.7178 16.8852 12.718 16.8852 12.7185 16.8852C12.718 16.8852 12.7177 16.8852 12.7177 16.8852ZM12.9428 3.21103L12.9426 3.2108C12.9427 3.21088 12.9428 3.21096 12.9429 3.21103L12.7185 3.43534L12.9428 3.21103ZM3.20929 7.05715L3.20909 7.05736C3.20916 7.05729 3.20923 7.05722 3.20929 7.05715L3.4336 7.28146L3.20929 7.05715Z",stroke:"white",strokeWidth:"1.5"}),ie__default.createElement("path",{d:"M8.25311 13.3107C8.40612 13.4707 8.60086 13.5611 8.84429 13.5611C9.10162 13.5611 9.31027 13.4707 9.47024 13.262L13.372 7.78844C13.4763 7.64238 13.532 7.46851 13.532 7.32941C13.532 6.92602 13.2259 6.62695 12.7947 6.62695C12.5165 6.62695 12.3357 6.72432 12.1688 6.96079L8.81647 11.7458L7.14031 9.87494C6.9873 9.70802 6.81343 9.63152 6.57696 9.63152C6.14575 9.63152 5.84668 9.93058 5.84668 10.3479C5.84668 10.5218 5.90928 10.6956 6.02751 10.8208L8.25311 13.3107Z",fill:"white"})),ie__default.createElement("defs",null,ie__default.createElement("clipPath",{id:"clip0_13767_12214"},ie__default.createElement("rect",{width:"20",height:"20",fill:"white"}))));function sr({className:e,pageId:t="*",componentId:o="*"}){let r="community_official_badge",{accessibilityId:i,config:n,defaultConfig:a,isExcluded:s,uiReference:l,themeStyles:m}=S({pageId:t,componentId:o,elementId:r});return s?null:ie__default.createElement(Z,{configIconName:n.icon,defaultIconName:a.icon,defaultIcon:()=>ie__default.createElement(fge,{style:m,"data-testid":i,className:wl(Kx.communityOfficialBadge,e)}),imgIcon:()=>ie__default.createElement("img",{alt:l,src:n.icon,"data-testid":i,className:Kx.communityOfficialBadge})})}var DH={communityCategory:"Xo"};var Jx=({pageId:e="*",componentId:t="*",categoryName:o,minCharacters:r,maxCharacters:i,truncate:n=!1,className:a$1,onClick:s})=>{let l="community_category",{config:m,themeStyles:c,accessibilityId:d,isExcluded:u}=S({pageId:e,componentId:t,elementId:l});if(u)return null;let g=o.length;return ie__default.createElement(V,{style:b(a({},c),{"--asc-community-category-min-characters":r&&g>r?`${Math.min(r,o.length)}ch`:void 0,"--asc-community-category-max-characters":i?`${i}ch`:void 0}),"data-testid":d,"data-truncated":g>(r!=null?r:0)?n:!1,className:wl(DH.communityCategory,a$1),onPress:()=>s==null?void 0:s()},ie__default.createElement(v.Caption,null,o))};var kg={communityCategories:"z1",communityCategories__categoryChip:"X1",communityCategories__categoryOverflow:"Y1"};var ed=({onClick:e,community:t,className:o,pageId:r="*",componentId:i="*",truncate:n=!1,maxCategoriesLength:a,maxCategoryCharacters:s,minCategoryCharacters:l})=>{let m=Fc(t.categoryIds),c=typeof a=="number"?m.length-a:0,d=typeof a=="number"?Math.min(m.length,a):m.length;return m.length===0?null:ie__default.createElement("div",{className:wl(kg.communityCategories,o),style:{"--asc-community-categories-length":c>0?d+1:d}},m.slice(0,d).map(u=>ie__default.createElement(Jx,{pageId:r,truncate:n,key:u.categoryId,componentId:i,categoryName:u.name,minCharacters:l,maxCharacters:s,onClick:()=>e==null?void 0:e(u.categoryId),className:kg.communityCategories__categoryChip})),c>0&&ie__default.createElement(Jx,{pageId:r,componentId:i,categoryName:`+${c}`,minCharacters:`+${c}`.length,className:wl(kg.communityCategories__categoryChip,kg.communityCategories__categoryOverflow)}))};var gl={communityRowItem:"I1",communityRowItem__image:"A1",communityRowItem__order:"M1",communityRowItem__content:"S1",communityRowItem__communityName:"C1",communityRowItem__joinButton:"E1",communityRowItem__pendingButton:"R1",communityRowItem__pendingButtonWrapper:"U1"};var _ge=e=>ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 20 20",fill:"none"},e),ie__default.createElement("path",{d:"M10 2.25C14.2812 2.25 17.75 5.71875 17.75 10C17.75 14.2812 14.2812 17.75 10 17.75C5.71875 17.75 2.25 14.2812 2.25 10C2.25 5.71875 5.71875 2.25 10 2.25ZM10 16.25C13.4375 16.25 16.25 13.4688 16.25 10C16.25 6.5625 13.4375 3.75 10 3.75C6.53125 3.75 3.75 6.5625 3.75 10C3.75 13.4688 6.53125 16.25 10 16.25ZM11.9062 13L9.25 11.0625C9.15625 11 9.125 10.875 9.125 10.7812V5.625C9.125 5.4375 9.28125 5.25 9.5 5.25H10.5C10.6875 5.25 10.875 5.4375 10.875 5.625V10.0625L12.9375 11.5938C13.125 11.7188 13.1562 11.9375 13.0312 12.125L12.4375 12.9062C12.3125 13.0938 12.0938 13.125 11.9062 13Z",fill:"currentColor"})),iy=_ge;var Eg=c=>{var d$1=c,{onClick:e,className:t,pageId:o="*",defaultClassName:r,componentId:i="*",elementId:n="*",defaultIcon:a$1,text:s="",typographyVariant:l="captionBold"}=d$1,m=d(d$1,["onClick","className","pageId","defaultClassName","componentId","elementId","defaultIcon","text","typographyVariant"]);let{config:u,themeStyles:g,accessibilityId:f,isExcluded:C,uiReference:y,defaultConfig:b$1}=S({pageId:o,componentId:i,elementId:n});return C?null:ie__default.createElement(oe,b(a({size:m.size||"small",variant:m.variant||"fill",color:m.color||"primary",onPress:e,style:g,"data-testid":f,icon:()=>ie__default.createElement(Z,{configIconName:u.image,defaultIconName:b$1.image,imgIcon:()=>ie__default.createElement("img",{src:u.image,alt:y}),defaultIcon:()=>a$1})},m),{className:t}),l==="captionBold"?ie__default.createElement(v.CaptionBold,null,u.text?u.text:s):ie__default.createElement(v.BodyBold,null,u.text?u.text:s))};var td=({onJoinSuccess:e,onJoinError:t,onLeaveSuccess:o,onLeaveError:r,onCancelJoinSuccess:i,onCancelJoinError:n,community:a,joinRequest:s}={community:{},onJoinSuccess:({data:l,communityId:m})=>{},onJoinError:()=>{},onLeaveSuccess:()=>{},onLeaveError:()=>{},onCancelJoinSuccess:()=>{},onCancelJoinError:()=>{},joinRequest:void 0})=>{let{success:l$1,info:m}=ce(),{mutate:c}=useMutation({mutationFn:g=>l(void 0,null,function*(){return yield g.join()}),onSuccess:(g,f)=>{l$1({content:g.status==="success"?`You joined ${f.displayName}.`:"Requested to join. You will be notified once your request is accepted."}),e==null||e({data:g,communityId:f.communityId});},onError:g=>{m({content:"Failed to join the community. Please try again."}),t==null||t(g);}}),{mutate:d}=useMutation({mutationFn:g=>CommunityRepository.leaveCommunity(g.communityId),onSuccess:()=>{l$1({content:"Successfully left the community"}),o==null||o();},onError:g=>{m({content:"Failed to leave the community. Please try again."}),r==null||r(g);}}),{mutate:u}=useMutation({mutationFn:()=>l(void 0,null,function*(){return yield s==null?void 0:s.cancel()}),onSuccess:()=>{l$1({content:"Canceled to join the community."}),i==null||i();},onError:g=>{m({content:"Failed to cancel joining the community."}),n==null||n(g);}});return {joinCommunity:c,leaveCommunity:d,cancelJoinCommunity:u}};function Ag({query:e,enabled:t}){let i=it({fetcher:CategoryRepository.getCategories,params:e,shouldCall:t}),{items:o}=i,r=d(i,["items"]);return a({categories:o},r)}function OH({params:e,enabled:t=!0}){let i=it({fetcher:CommunityRepository.getRecommendedCommunities,params:e,shouldCall:t}),{items:o}=i,r=d(i,["items"]);return a({recommendedCommunities:o},r)}function zH({params:e,enabled:t}){let i=it({fetcher:CommunityRepository.getTrendingCommunities,params:b(a({},e),{limit:(e==null?void 0:e.limit)||10}),shouldCall:t}),{items:o}=i,r=d(i,["items"]);return a({trendingCommunities:o},r)}var jH=createContext({fetchTrendingCommunities:()=>{},fetchRecommendedCommunities:()=>{},fetchCommunityCategories:()=>{},refetchRecommendedCommunities:()=>{},trendingCommunities:[],recommendedCommunities:[],categories:[],isEmpty:!1,noRecommendedCommunities:!1,noTrendingCommunities:!1,isCommunityEmpty:!1,isLoading:!1,isCategoryLoading:!1,error:null,refresh:()=>{},pendingJoinCommunities:[],setPendingJoinCommunity:()=>{},removePendingJoinCommunity:()=>{}}),fl=()=>useContext(jH),GH=({children:e})=>{let[t,o]=useState(!1),[r,i]=useState(!1),[n,a]=useState(!1),[s,l]=useState([]),m=zH({params:{limit:5},enabled:t}),c=OH({params:{limit:20},enabled:r}),d=Ag({query:{limit:5,sortBy:"name"},enabled:n}),u=m.isLoading||c.isLoading&&r||d.isLoading,g=m.error&&c.error&&d.error,f=()=>c.refresh(),C=()=>{m.refresh(),f(),d.refresh();},y=d.categories.length===0&&!d.isLoading,b=c.recommendedCommunities.length===0&&!c.isLoading&&r,_=m.trendingCommunities.length===0&&!m.isLoading,x=b&&_,P=y&&x,I=()=>o(!0),w=()=>i(!0),M=()=>a(!0),T=N=>{l(A=>[...A,N]);},E=N=>{l(A=>A.filter(D=>D!==N));};return ie__default.createElement(jH.Provider,{value:{fetchTrendingCommunities:I,fetchRecommendedCommunities:w,fetchCommunityCategories:M,refetchRecommendedCommunities:f,trendingCommunities:m.trendingCommunities,recommendedCommunities:c.recommendedCommunities,categories:d.categories,noRecommendedCommunities:b,noTrendingCommunities:_,isEmpty:P,isCommunityEmpty:x,isLoading:u,isCategoryLoading:d.isLoading,error:g,refresh:C,pendingJoinCommunities:s,setPendingJoinCommunity:T,removePendingJoinCommunity:E}},e)};var kge=e=>e<10?`0${e}`:`${e}`,Hc=({order:e,onClick:t,community:o,pageId:r="*",showJoinButton:i,onCategoryClick:n,elementId:a="*",onPendingButtonClick:s,componentId:l="*",maxCategoriesLength:m,maxCategoryCharacters:c,minCategoryCharacters:d,joinRequest:u})=>{let{themeStyles:g}=S({pageId:r,componentId:l,elementId:a}),f=rt({fileId:o.avatarFileId,imageSize:"medium"}),{confirm:C}=Te(),{online:y}=useNetworkState(),[b,_]=useState({communityId:"",isPending:!1}),{removePendingJoinCommunity:x,setPendingJoinCommunity:P}=fl(),{joinCommunity:I,leaveCommunity:w,cancelJoinCommunity:M}=td({joinRequest:u,community:o,onJoinSuccess:({data:N,communityId:A})=>{(N==null?void 0:N.status)==="pending"&&(A&&P(A),_({communityId:A,isPending:!0}));},onCancelJoinSuccess:()=>{x(o.communityId),_({communityId:o.communityId,isPending:!1});}}),T=ce(),E=N=>{if(!y){T.info({content:"Failed to leave community. Please try again."});return}if(N.requiresJoinApproval)return C({title:"Leave Community",content:"If you change your mind, you'll have to request to join again.",onOk:()=>w(N)});w(N);};return ie__default.createElement(V,{type:"button",style:g,key:o.communityId,className:gl.communityRowItem,onPress:()=>t(o.communityId),"data-has-categories":o.categoryIds.length>0},ie__default.createElement("div",{className:gl.communityRowItem__image},ie__default.createElement(EH,{pageId:r,componentId:l,imgSrc:f}),typeof e=="number"?ie__default.createElement(v.BodyBold,{className:gl.communityRowItem__order},kge(e)):null),ie__default.createElement("div",{className:gl.communityRowItem__content},ie__default.createElement("div",{className:gl.communityRowItem__communityName},!o.isPublic&&ie__default.createElement(ar,{pageId:r,componentId:l}),ie__default.createElement(Mo,{pageId:r,componentId:l,community:o}),o.isOfficial&&ie__default.createElement(sr,{pageId:r,componentId:l})),o.categoryIds.length>0&&ie__default.createElement(ed,{truncate:!0,pageId:r,community:o,componentId:l,onClick:n,maxCategoriesLength:m,minCategoryCharacters:d,maxCategoryCharacters:c}),ie__default.createElement(Vu,{pageId:r,componentId:l,memberCount:o.membersCount})),!!i&&(o!=null&&o.isJoined?ie__default.createElement(ry,{pageId:r,componentId:l,className:gl.communityRowItem__joinButton,"data-has-categories":o.categoryIds.length>0,onClick:()=>E(o)}):(u==null?void 0:u.status)==="pending"||(b==null?void 0:b.communityId)===o.communityId&&b.isPending?ie__default.createElement(Eg,{size:"small",color:"secondary",variant:"outlined",defaultIcon:ie__default.createElement(iy,{className:gl.communityRowItem__pendingButton}),onPress:()=>{var N;return (N=s==null?void 0:s())!=null?N:M()},text:"Pending",className:gl.communityRowItem__pendingButtonWrapper}):ie__default.createElement(Uc,{pageId:r,componentId:l,className:gl.communityRowItem__joinButton,"data-has-categories":o.categoryIds.length>0,onClick:()=>{if(!y){T.info({content:"Failed to join community. Please try again."});return}I(o);}})))};var yl={communityRowItemSkeleton:"B1",communityRowItemSkeleton__avatar:"F1",communityRowItemSkeleton__content:"H1",communityRowItemSkeleton__contentBar1:"L1",communityRowItemSkeleton__contentBar2:"T1",communityRowItemSkeleton__animation:"V1","skeleton-pulse":"Yo"};var Uu=({pageId:e="*",componentId:t="*",elementId:o="*"})=>{let{themeStyles:r}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement("div",{className:yl.communityRowItemSkeleton,style:r},ie__default.createElement("div",{className:wl(yl.communityRowItemSkeleton__avatar,yl.communityRowItemSkeleton__animation)}),ie__default.createElement("div",{className:wl(yl.communityRowItemSkeleton__content,yl.communityRowItemSkeleton__animation)},ie__default.createElement("div",{className:wl(yl.communityRowItemSkeleton__contentBar1,yl.communityRowItemSkeleton__animation)}),ie__default.createElement("div",{className:wl(yl.communityRowItemSkeleton__contentBar2,yl.communityRowItemSkeleton__animation)})))};var eP={communitySearchResult:"W1",communitySearchResult__communityItem:"Io",communitySearchResult__communityItem__leftPane:"q1",communitySearchResult__communityItem__rightPane:"D1",communityItem__communityName:"G1",communityItem__communityName__private:"J1",communityItem__communityCategory:"K1",communityItem__communityMemberCount:"N1",communitySearchResult__noInternetConnectionHoc:"O1"};var od=({isLoading:e,onLoadMore:t,pageId:o="*",onClosePopover:r,showJoinButton:i=!1,communityCollection:n=[]})=>{let a="community_search_result",{isDesktop:s}=le(),{themeStyles:l,accessibilityId:m}=se({pageId:o,componentId:a}),{goToCommunityProfilePage:c,goToCommunitiesByCategoryPage:d}=Y(),[u,g]=useState(null);return ke({onIntersect:()=>t(),node:u}),ie__default.createElement("div",{style:l,"data-testid":m,className:eP.communitySearchResult},ie__default.createElement(wr,{page:"global-search",className:eP.communitySearchResult__noInternetConnectionHoc},n.length>0&&n.map(f=>ie__default.createElement(Hc,{pageId:o,community:f,componentId:a,maxCategoryCharacters:24,key:f.communityId,showJoinButton:i,maxCategoriesLength:s?2:5,onCategoryClick:C=>d({categoryId:C}),onClick:C=>{r==null||r(),c(C);}})),e?Array.from({length:5}).map((f,C)=>ie__default.createElement(Uu,{key:C,pageId:o,componentId:a})):null,!e&&n.length===0&&ie__default.createElement(Mg,null)),ie__default.createElement("div",{ref:f=>g(f)}))};var Lge=e=>ie__default.createElement("svg",a({width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M16.7109 14.6562C16.8672 14.8125 16.8672 15.0625 16.7109 15.1875L15.9922 15.9062C15.8672 16.0625 15.6172 16.0625 15.4609 15.9062L11.6797 12.125C11.6172 12.0312 11.5859 11.9375 11.5859 11.8438V11.4375C10.4297 12.4062 8.96094 13 7.33594 13C3.74219 13 0.835938 10.0938 0.835938 6.5C0.835938 2.9375 3.74219 0 7.33594 0C10.8984 0 13.8359 2.9375 13.8359 6.5C13.8359 8.125 13.2109 9.625 12.2422 10.75H12.6484C12.7422 10.75 12.8359 10.8125 12.9297 10.875L16.7109 14.6562ZM7.33594 11.5C10.0859 11.5 12.3359 9.28125 12.3359 6.5C12.3359 3.75 10.0859 1.5 7.33594 1.5C4.55469 1.5 2.33594 3.75 2.33594 6.5C2.33594 9.28125 4.55469 11.5 7.33594 11.5Z"}));function tP({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r}){let i="search_icon",{config:n,defaultConfig:a,isExcluded:s,uiReference:l,themeStyles:m}=S({pageId:e,componentId:t,elementId:i});return s?null:ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(Lge,{className:o,style:m}),imgIcon:()=>ie__default.createElement("img",{src:n.icon,alt:l,className:r,style:m}),defaultIconName:a.icon,configIconName:n.icon})}var $H={clearButton:"Ao"};var kn=({pageId:e="*",imgClassName:t,buttonClassName:o,defaultClassName:r,componentId:i="*",onPress:n})=>{let a="clear_button",{accessibilityId:s,config:l,defaultConfig:m,isExcluded:c,uiReference:d,themeStyles:u}=S({pageId:e,componentId:i,elementId:a});return c?null:ie__default.createElement(V,{onPress:n,style:u,"aria-label":"Click to close","data-testid":s,className:wl($H.clearButton,o)},ie__default.createElement(Z,{configIconName:l.icon,defaultIconName:m.icon,defaultIcon:()=>ie__default.createElement(BV,{className:r}),imgIcon:()=>ie__default.createElement("img",{src:l.icon,alt:d,className:t})}))};var hl={topSearchBar:"Le",topSearchBar__inputBar:"P1",topSearchBar__textInput:"Mo",topSearchBar__searchIcon:"Q1",topSearchBar__searchIcon_img:"Z1",topSearchBar__clearButton:"_1",topSearchBar__clearButton__default:"e5",topSearchBar__clearButton__img:"r5",topSearchBar__cancelButton:"So"};function rd({pageId:e="*",search:t,onFocus:o,hasCancelButton:r=!0}){let i="top_search_bar",{onBack:n}=Y(),[a,s]=useState(""),{config:l,isExcluded:m,themeStyles:c,accessibilityId:d}=se({pageId:e,componentId:i});return useDebounce(()=>t(a),500,[a]),m?null:ie__default.createElement("div",{className:hl.topSearchBar,"data-cancel":!!r,style:c,"data-testid":d},ie__default.createElement("div",{className:hl.topSearchBar__inputBar},ie__default.createElement(tP,{pageId:e,componentId:i,defaultClassName:hl.topSearchBar__searchIcon,imgClassName:hl.topSearchBar__searchIcon_img}),ie__default.createElement(Input,{type:"text",onFocus:o,value:a,placeholder:l.text,className:hl.topSearchBar__textInput,onChange:u=>s(u.target.value)}),a!=""?ie__default.createElement(kn,{pageId:e,componentId:i,onPress:()=>s(""),buttonClassName:hl.topSearchBar__clearButton,imgClassName:hl.topSearchBar__clearButton__img,defaultClassName:hl.topSearchBar__clearButton__default}):null),r&&ie__default.createElement("div",{className:hl.topSearchBar__cancelButton},ie__default.createElement(C7,{pageId:e,componentId:i,onPress:()=>n()})))}function oP({pageId:e="*",componentId:t="*",defaultIconClassName:o,imgIconClassName:r}){let i="share_button";S({pageId:e,componentId:t,elementId:i});return null}var ly={commentButton:"a5",commentButton__icon:"o5",commentButton__text:"t5"};var jge=e=>ie__default.createElement("svg",a({width:"18",height:"16",viewBox:"0 0 18 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M9 0.1875C13.6816 0.1875 17.4668 3.30859 17.4668 7.09375C17.4668 10.9121 13.6816 14 9 14C7.9043 14 6.8418 13.834 5.91211 13.5352C4.91602 14.2324 3.32227 15.0625 1.29688 15.0625C0.964844 15.0625 0.666016 14.8965 0.533203 14.5977C0.433594 14.2988 0.466797 13.9668 0.699219 13.7344C0.732422 13.7344 1.76172 12.6055 2.22656 11.3105C1.13086 10.1484 0.5 8.6875 0.5 7.09375C0.5 3.30859 4.28516 0.1875 9 0.1875ZM9 12.4062C12.7852 12.4062 15.9062 10.0488 15.9062 7.09375C15.9062 4.17188 12.7852 1.78125 9 1.78125C5.18164 1.78125 2.09375 4.17188 2.09375 7.09375C2.09375 8.52148 2.79102 9.58398 3.38867 10.2148L4.08594 10.9453L3.7207 11.875C3.55469 12.3398 3.32227 12.8047 3.05664 13.2031C3.85352 12.9375 4.51758 12.5723 4.98242 12.2402L5.61328 11.7754L6.37695 12.0078C7.20703 12.2734 8.10352 12.4062 9 12.4062Z"}));function Dg({pageId:e="*",componentId:t="*",commentsCount:o,buttonClassName:r,defaultIconClassName:i,imgIconClassName:n,commentsCountClassName:a,onPress:s=()=>{}}){let l="comment_button",{accessibilityId:m,config:c,defaultConfig:d,isExcluded:u,uiReference:g}=S({pageId:e,componentId:t,elementId:l});return u?null:ie__default.createElement(V,{onPress:s,"data-testid":m},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement("div",{className:(wl(ly.commentButton),r)},ie__default.createElement(jge,{className:wl(ly.commentButton__icon,i)}),ie__default.createElement(v.BodyBold,{"data-testid":`${e}/${t}/comment_count`,className:wl(ly.commentButton__text,a)},typeof o=="number"?o:c.text)),imgIcon:()=>ie__default.createElement("img",{src:c.icon,alt:g,className:n}),defaultIconName:d.icon,configIconName:c.icon}))}var Ci={pollContent:"i5",pollContent__pollOptionContainer:"s5",pollContent__votedItemsContainer:"d5",pollContent__seeMore__button:"c5",pollContent__vote__button:"l5",pollContent__pollDetail__container:"n5",pollContent__pollDetail:"m5",pollContent__pollDetail__seeResult:"h5",pollContent__pollLabel:"g5",pollContent__formRadio:"p5",pollContent__checkbox:"b5",pollContent__formRadio__disabled:"Co",pollContent__checkbox__disabled:"Eo"};var ZH=e=>{let t=[],l=Math.floor(e/31536e6);e%=31536e6;let m=Math.floor(e/2592e6);e%=2592e6;let c=Math.floor(e/864e5);e%=864e5;let d=Math.floor(e/36e5);e%=36e5;let u=Math.floor(e/6e4);e%=6e4;let g=Math.floor(e/1e3);return m===1||m===0&&c===30?"30d":(l>0&&t.push(`${l} year${l>1?"s":""}`),m>0&&t.push(`${m} month${m>1?"s":""}`),c>0&&t.push(`${c}d`),d>0&&t.push(`${d} hour${d>1?"s":""}`),u>0&&t.push(`${u} minute${u>1?"s":""}`),g>0&&t.push(`${g} second${g>1?"s":""}`),t.join(" "))};var Cl={pollVotedItem:"Ro",pollVotedItem__title:"u5",pollVotedItem__title__text:"f5",pollVotedItem__title__percent:"Uo",pollVotedItem__voteCount:"v5",pollVotedItem__voteCount__avatar:"w5",pollVotedItem__voteCount__textPlaceholder:"x5",pollVoteItem__processBar:"Bo",pollVotedItem__processBar__count:"Fo"};var WH=({label:e,currentUserId:t,voteCount:o=0,isTopVoted:r=!1,percentage:i})=>{let n=t?o-1:o,a=useCallback(()=>n===0&&t?"Voted by you":n!==0?`Voted by ${fA(n)} participant${n>1?"s":""}${t?" and you":""}`:"No votes",[t,n]);return ie__default.createElement("div",{className:Cl.pollVotedItem,"data-top-voted":r},ie__default.createElement("div",{className:Cl.pollVotedItem__title},ie__default.createElement(v.BodyBold,{className:Cl.pollVotedItem__title},e),ie__default.createElement(v.BodyBold,{className:Cl.pollVotedItem__title__percent,"data-top-voted":r},i,"%")),ie__default.createElement("div",{className:Cl.pollVotedItem__voteCount},ie__default.createElement(v.Caption,null,a()),t&&ie__default.createElement(Ae,{className:Cl.pollVotedItem__voteCount__avatar,userId:t,textPlaceholderClassName:Cl.pollVotedItem__voteCount__textPlaceholder})),ie__default.createElement("div",{className:Cl.pollVoteItem__processBar,"data-top-voted":r},ie__default.createElement("div",{className:Cl.pollVotedItem__processBar__count,style:{width:`${i}%`},"data-top-voted":r})))};var qH=({caption:e,answers:t,disabled:o=!1,onAnswerChanged:r})=>{let[i,n]=useState(null);return ie__default.createElement(ds,{onChange:s=>{n(s),r==null||r(s);},value:i,labelClassName:Ci.pollContent__pollLabel,label:ie__default.createElement(v.CaptionBold,null,e),radioProps:{className:wl(Ci.pollContent__formRadio,o?Ci.pollContent__formRadio__disabled:""),isDisabled:o},radios:t.map(s=>({value:s.id,label:ie__default.createElement(v.BodyBold,null,s.data)}))})};var nP={checkbox:"o",checkbox__icon:"c"};function YH(r){var i=r,{label:e,className:t}=i,o=d(i,["label","className"]);return ie__default.createElement(Checkbox,b(a({},o),{className:wl(nP.checkbox,t)}),ie__default.createElement("div",{className:nP.checkbox__icon},ie__default.createElement("svg",{viewBox:"0 0 18 18","aria-hidden":"true"},ie__default.createElement("polyline",{points:"1 9 7 14 15 4"}))),e)}var aP={checkboxGroup:"y5",checkBox:"Ho"};function zc(l){var m=l,{label:e,className:t,checkboxes:o,errorMessage:r,checkboxProps:i,labelClassName:n,alignment:a$1="row-reverse"}=m,s=d(m,["label","className","checkboxes","errorMessage","checkboxProps","labelClassName","alignment"]);return ie__default.createElement(CheckboxGroup,b(a({},s),{className:wl(aP.checkboxGroup,t)}),e&&ie__default.createElement(Label,{className:n},e),o.map(c=>ie__default.createElement(YH,b(a(a({},c),i),{key:c.value,"data-alignment":a$1,className:wl(aP.checkBox,i==null?void 0:i.className)}))),r&&ie__default.createElement(FieldError,null,r))}var KH=({caption:e,answers:t,disabled:o=!1,onAnswerChanged:r})=>{let[i,n]=useState([]);return ie__default.createElement(zc,{onChange:s=>{n(s),r==null||r(s);},value:i,labelClassName:Ci.pollContent__pollLabel,label:ie__default.createElement(v.CaptionBold,null,e),checkboxProps:{className:wl(Ci.pollContent__checkbox,o?Ci.pollContent__checkbox__disabled:""),isDisabled:o},checkboxes:t.map(s=>({value:s.id,label:ie__default.createElement(v.BodyBold,null,s.data)}))})};var JH=({pageId:e="*",componentId:t="*",elementId:o="*",parentPost:r,posts:i,disabled:n=!1})=>{var A,D,G;let{error:a$1}=ce(),{currentUserId:s}=Ne(),[l$1,m]=useState(),[c,d]=useState(!1),[u,g]=useState(!1),f=gt(s),C=(A=i[0])==null?void 0:A.getPollInfo(),y=e==="post_detail_page",b$1=4,_=((D=r.creator)==null?void 0:D.userId)===s,x=r.feedType==="reviewing"||n,P=x||!l$1||(l$1==null?void 0:l$1.length)<1||n,I=(C==null?void 0:C.status)==="closed",w=useMemo(()=>{if(!C)return [];let H=Math.max(...C.answers.map(j=>j.voteCount)),$=C.answers.map(j=>b(a({},j),{isTopVoted:j.voteCount!==0&&j.voteCount===H})).sort((j,O)=>O.voteCount-j.voteCount);return !y&&$.length>b$1&&!u?$.slice(0,b$1):C.isVoted?$:C.answers},[C==null?void 0:C.answers,u]),M=useMemo(()=>(C==null?void 0:C.answers)&&!y&&(C==null?void 0:C.answers.length)>b$1,[C==null?void 0:C.answers]),T=useMemo(()=>C==null?void 0:C.answers.reduce((H,$)=>H+$.voteCount,0),[C==null?void 0:C.answers]),{mutateAsync:E}=useMutation({mutationFn:j=>l(void 0,[j],function*({pollId:H,answerIds:$}){return PollRepository.votePoll(H,$)}),onError:()=>{a$1({content:"Oops, something went wrong."});}}),N=H=>H?Number.isInteger(H)?String(H):H.toFixed(2):"0";return ((G=i[0])==null?void 0:G.dataType)!=="poll"||!C?null:ie__default.createElement(ie__default.Fragment,null,C.isVoted||c||I?ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("div",{className:Ci.pollContent__votedItemsContainer},w.map(H=>ie__default.createElement(WH,{label:H.data,percentage:T?N(H.voteCount/T*100):"0",voteCount:H.voteCount,currentUserId:H.isVotedByUser?f==null?void 0:f.userId:void 0,isTopVoted:H.isTopVoted,key:H.id}))),M&&!u&&ie__default.createElement(oe,{variant:"outlined",color:"secondary",className:Ci.pollContent__seeMore__button,onPress:()=>g(!0),isDisabled:n},"See full results")):ie__default.createElement(ie__default.Fragment,null,C.answerType==="single"?ie__default.createElement(qH,{caption:"Select one option",answers:w,disabled:x,onAnswerChanged:H=>m([H])}):ie__default.createElement(KH,{caption:"Select one or more options",answers:w,disabled:x,onAnswerChanged:m}),M&&!u&&ie__default.createElement(oe,{variant:"outlined",color:"secondary",className:Ci.pollContent__seeMore__button,onPress:()=>g(!0)},`See ${C.answers.length-b$1} more option${C.answers.length-b$1>1?"s":""}`),ie__default.createElement(oe,{className:Ci.pollContent__vote__button,onPress:()=>{l$1&&E({pollId:C.pollId,answerIds:l$1});},isDisabled:P},"Vote")),ie__default.createElement("div",{className:Ci.pollContent__pollDetail__container},ie__default.createElement("div",{className:Ci.pollContent__pollDetail},ie__default.createElement(v.CaptionBold,null,T),ie__default.createElement(v.CaptionBold,null,"vote",`${T&&T>1?"s":""}`),ie__default.createElement(v.CaptionBold,null,"\u2022"),!I&&typeof C.closedIn=="number"?ie__default.createElement(ie__default.Fragment,null,ie__default.createElement(v.CaptionBold,null,ZH(C.closedIn)),ie__default.createElement(v.CaptionBold,null,"left")):ie__default.createElement(v.CaptionBold,null,"Ended")),_&&!C.isVoted&&!c&&r.feedType!=="reviewing"&&!I&&ie__default.createElement(oe,{variant:"text",onPress:()=>d(!0)},ie__default.createElement(v.CaptionBold,{className:Ci.pollContent__pollDetail__seeResult},"See results")),c&&ie__default.createElement(oe,{variant:"text",onPress:()=>d(!1)},ie__default.createElement(v.CaptionBold,{className:Ci.pollContent__pollDetail__seeResult},"Back to vote"))))};var afe=t=>{var e=d(t,[]);return ie__default.createElement("svg",a({width:"32",height:"33",viewBox:"0 0 32 33",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("g",{clipPath:"url(#clip0_1709_7904)"},ie__default.createElement("path",{d:"M16 32.5C24.8366 32.5 32 25.3366 32 16.5C32 7.66344 24.8366 0.5 16 0.5C7.16344 0.5 0 7.66344 0 16.5C0 25.3366 7.16344 32.5 16 32.5Z",fill:"#FFD54F"}),ie__default.createElement("path",{d:"M9.33317 15.1667C10.8059 15.1667 11.9998 13.9728 11.9998 12.5C11.9998 11.0273 10.8059 9.83337 9.33317 9.83337C7.86041 9.83337 6.6665 11.0273 6.6665 12.5C6.6665 13.9728 7.86041 15.1667 9.33317 15.1667Z",fill:"#6D4C41"}),ie__default.createElement("path",{d:"M22.6667 15.1667C24.1394 15.1667 25.3333 13.9728 25.3333 12.5C25.3333 11.0273 24.1394 9.83337 22.6667 9.83337C21.1939 9.83337 20 11.0273 20 12.5C20 13.9728 21.1939 15.1667 22.6667 15.1667Z",fill:"#6D4C41"}),ie__default.createElement("path",{d:"M21.0248 27.3372C20.674 27.3372 20.3232 27.2038 20.0564 26.9352C17.8894 24.7682 14.1108 24.7682 11.9456 26.9352C11.4103 27.4705 10.5423 27.4705 10.007 26.9352C9.47163 26.4016 9.47163 25.5319 10.007 24.9966C11.6076 23.396 13.7362 22.5153 16.0001 22.5153C18.264 22.5153 20.3926 23.396 21.9932 24.9984C22.5286 25.5337 22.5286 26.4016 21.9932 26.937C21.7264 27.2038 21.3756 27.3372 21.0248 27.3372Z",fill:"#6D4C41"}),ie__default.createElement("path",{d:"M24.8228 16.5987C24.4495 16.0587 23.5508 16.0587 23.1775 16.5987C22.6228 17.4014 21.3335 19.3881 21.3335 20.5001C21.3335 21.9707 22.5295 23.1667 24.0002 23.1667C25.4708 23.1667 26.6668 21.9707 26.6668 20.5001C26.6668 19.3881 25.3775 17.4014 24.8228 16.5987Z",fill:"#00BCD4"})),ie__default.createElement("defs",null,ie__default.createElement("clipPath",{id:"clip0_1709_7904"},ie__default.createElement("rect",{width:"32",height:"32",fill:"white",transform:"translate(0 0.5)"}))))},XH=afe;var sfe=t=>{var e=d(t,[]);return ie__default.createElement("svg",a({width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("g",{id:"Reactions",clipPath:"url(#clip0_1709_1751)"},ie__default.createElement("path",{id:"Vector",d:"M16 32C24.8366 32 32 24.8366 32 16C32 7.16344 24.8366 0 16 0C7.16344 0 0 7.16344 0 16C0 24.8366 7.16344 32 16 32Z",fill:"#FFD54F"}),ie__default.createElement("path",{id:"Vector_2",d:"M27.2933 19.9601C26.9867 20.9334 26.5867 21.8267 26.0667 22.6667H5.93332C5.41332 21.8267 5.01332 20.9334 4.70665 19.9601C4.61332 19.6534 4.66665 19.3334 4.86665 19.0801C5.05332 18.8134 5.34665 18.6667 5.66665 18.6667H26.3333C26.6533 18.6667 26.9467 18.8134 27.1333 19.0801C27.3333 19.3334 27.3867 19.6534 27.2933 19.9601Z",fill:"white"}),ie__default.createElement("path",{id:"Vector_3",d:"M26.0664 22.6667C23.9598 26.1201 20.1864 28.2934 15.9998 28.2934C11.8131 28.2934 8.03977 26.1201 5.93311 22.6667H26.0664Z",fill:"#E53935"}),ie__default.createElement("path",{id:"Vector_4",d:"M12.3332 13.6668C11.7812 13.6668 11.3332 13.2188 11.3332 12.6668C11.3332 11.9322 10.7358 11.3335 9.99984 11.3335C9.26384 11.3335 8.6665 11.9322 8.6665 12.6668C8.6665 13.2188 8.2185 13.6668 7.6665 13.6668C7.1145 13.6668 6.6665 13.2188 6.6665 12.6668C6.6665 10.8295 8.16117 9.3335 9.99984 9.3335C11.8385 9.3335 13.3332 10.8295 13.3332 12.6668C13.3332 13.2188 12.8852 13.6668 12.3332 13.6668Z",fill:"#6D4C41"}),ie__default.createElement("path",{id:"Vector_5",d:"M24.3332 13.6668C23.7812 13.6668 23.3332 13.2188 23.3332 12.6668C23.3332 11.9322 22.7358 11.3335 21.9998 11.3335C21.2638 11.3335 20.6665 11.9322 20.6665 12.6668C20.6665 13.2188 20.2185 13.6668 19.6665 13.6668C19.1145 13.6668 18.6665 13.2188 18.6665 12.6668C18.6665 10.8295 20.1612 9.3335 21.9998 9.3335C23.8385 9.3335 25.3332 10.8295 25.3332 12.6668C25.3332 13.2188 24.8852 13.6668 24.3332 13.6668Z",fill:"#6D4C41"})),ie__default.createElement("defs",null,ie__default.createElement("clipPath",{id:"clip0_1709_1751"},ie__default.createElement("rect",{width:"32",height:"32",fill:"white"}))))},RH=sfe;var lfe=t=>{var e=d(t,[]);return ie__default.createElement("svg",a({width:"32",height:"33",viewBox:"0 0 32 33",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("circle",{cx:"16",cy:"16.5",r:"16",fill:"url(#paint0_linear_1709_7888)"}),ie__default.createElement("g",{clipPath:"url(#clip0_1709_7888)"},ie__default.createElement("path",{d:"M21.8752 10.2903C21.3417 9.70788 20.5123 8.92173 20.1595 10.6968C20.0395 11.3004 19.7591 11.7656 19.5189 12.1402C19.2599 10.8296 18.4808 9.47308 17.7467 8.55843C17.472 8.21623 16.4973 6.85588 16.3101 4.58008C16.2821 4.24043 15.8787 4.08093 15.6263 4.31003C13.2147 6.49923 11.891 9.51013 11.8419 12.8998C11.8419 12.8998 10.8377 12.0533 10.2921 10.4786C10.1452 10.0546 9.57671 9.97368 9.33006 10.3486C9.28271 10.4206 9.23881 10.4927 9.19921 10.5627C7.33856 13.8527 6.44351 17.848 7.27096 21.565C8.65446 27.7898 17.8062 29.5301 22.6511 25.6177C27.3914 21.7899 25.8846 14.6654 21.8752 10.2903Z",fill:"#ED694A"}),ie__default.createElement("path",{d:"M20.4125 14.8409C20.0185 14.4107 19.4058 13.83 19.1452 15.1411C19.0566 15.5869 18.8495 15.9306 18.6721 16.2073C18.4809 15.2392 17.9054 14.2372 17.3632 13.5617C17.1603 13.3089 16.4404 12.3042 16.302 10.6231C16.2814 10.3722 15.9834 10.2545 15.797 10.4237C14.0158 12.0406 13.038 14.2646 13.0018 16.7682C13.0018 16.7682 12.26 16.143 11.8571 14.9799C11.7486 14.6667 11.3287 14.607 11.1465 14.8839C11.1116 14.9371 11.0791 14.9904 11.0499 15.0421C9.67554 17.4721 9.01444 20.4231 9.62559 23.1686C10.6475 27.7664 17.4071 29.0518 20.9857 26.162C24.4869 23.3347 23.3739 18.0725 20.4125 14.8409Z",fill:"#F4A32C"}),ie__default.createElement("path",{d:"M19.077 18.9949C18.8103 18.7037 18.3955 18.3106 18.2191 19.1982C18.1592 19.5 18.0189 19.7326 17.8988 19.9199C17.7693 19.2645 17.3798 18.5863 17.0127 18.129C16.8754 17.9579 16.3881 17.2777 16.2944 16.1398C16.2804 15.9699 16.0787 15.8902 15.9525 16.0048C14.7467 17.0994 14.0849 18.6049 14.0603 20.2996C14.0603 20.2996 13.5582 19.8764 13.2855 19.0891C13.212 18.8771 12.9278 18.8366 12.8045 19.0241C12.7808 19.06 12.7589 19.0961 12.739 19.1311C11.8087 20.7761 11.3612 22.7737 11.7749 24.6323C12.4666 27.7447 17.0425 28.6149 19.4649 26.6586C20.2945 25.9887 20.8088 25.0448 20.9131 24.0006C21.0706 22.4191 20.4619 20.5062 19.077 18.9949Z",fill:"#F4D44E"}),ie__default.createElement("path",{d:"M17.838 22.85C17.6894 22.6878 17.4583 22.4688 17.36 22.9632C17.3266 23.1314 17.2485 23.261 17.1816 23.3653C17.1094 23.0002 16.8924 22.6223 16.6879 22.3676C16.6114 22.2722 16.3399 21.8933 16.2877 21.2593C16.2799 21.1647 16.1675 21.1203 16.0972 21.1841C15.4255 21.7939 15.0567 22.6327 15.043 23.5769C15.043 23.5769 14.7633 23.3411 14.6113 22.9024C14.5704 22.7843 14.412 22.7617 14.3434 22.8662C14.3302 22.8863 14.318 22.9064 14.307 22.9259C13.7887 23.8424 13.5393 24.9553 13.7698 25.9907C14.2947 28.3523 18.5971 28.2807 18.861 25.6388C18.9486 24.7577 18.6095 23.6919 17.838 22.85Z",fill:"#EAE9E8"}),ie__default.createElement("path",{d:"M14.7688 26.4597C14.5383 25.5334 14.7876 24.5379 15.3059 23.7181C15.3169 23.7006 15.3292 23.6827 15.3423 23.6647C15.411 23.5713 15.5694 23.5914 15.6103 23.6971C15.7622 24.0895 16.042 24.3004 16.042 24.3004C16.0532 23.6064 16.3046 22.9764 16.7664 22.4711C16.6631 22.3281 16.3472 21.9833 16.2877 21.2597C16.2799 21.165 16.1675 21.1207 16.0972 21.1844C15.4255 21.7943 15.0567 22.633 15.043 23.5772C15.043 23.5772 14.7633 23.3414 14.6113 22.9028C14.5704 22.7847 14.412 22.7621 14.3434 22.8666C14.3302 22.8867 14.318 22.9068 14.307 22.9263C13.7887 23.8427 13.5393 24.9557 13.7698 25.9911C13.9831 26.9509 14.8594 27.5277 15.8282 27.6669C15.3056 27.4102 14.904 27.0038 14.7688 26.4597Z",fill:"#F7E7A1"})),ie__default.createElement("defs",null,ie__default.createElement("linearGradient",{id:"paint0_linear_1709_7888",x1:"7.2",y1:"7.7",x2:"24.8",y2:"29.3",gradientUnits:"userSpaceOnUse"},ie__default.createElement("stop",{stopColor:"#FFF09F"}),ie__default.createElement("stop",{offset:"1",stopColor:"#FCCF5A"})),ie__default.createElement("clipPath",{id:"clip0_1709_7888"},ie__default.createElement("rect",{width:"25.6",height:"25.6",fill:"white",transform:"translate(3.2002 2.09998)"}))))},eO=lfe;var mfe=t=>{var e=d(t,[]);return ie__default.createElement("svg",a({width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("g",{id:"Reactions"},ie__default.createElement("circle",{id:"Ellipse 2",cx:"16",cy:"16",r:"16",fill:"url(#paint0_linear_1709_1738)"}),ie__default.createElement("path",{id:"circle",d:"M22.4466 10.5836C20.7296 9.07415 18.2009 9.36319 16.6088 11.0332L16.0156 11.6755L15.3912 11.0332C13.8303 9.36319 11.2704 9.07415 9.55338 10.5836C7.58661 12.3179 7.49295 15.401 9.24119 17.2637L15.2976 23.687C15.6722 24.1045 16.3278 24.1045 16.7024 23.687L22.7588 17.2637C24.507 15.401 24.4134 12.3179 22.4466 10.5836Z",fill:"white"})),ie__default.createElement("defs",null,ie__default.createElement("linearGradient",{id:"paint0_linear_1709_1738",x1:"7.2",y1:"7.2",x2:"28",y2:"39.2",gradientUnits:"userSpaceOnUse"},ie__default.createElement("stop",{stopColor:"#EE5C91"}),ie__default.createElement("stop",{offset:"0.833333",stopColor:"#E02222"}))))},tO=mfe;var dfe=t=>{var e=d(t,[]);return ie__default.createElement("svg",a({width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"url(#paint0_linear_1709_1733)"}),ie__default.createElement("path",{d:"M10.7752 12.1C11.2221 12.1 11.6002 12.4782 11.6002 12.925V21.175C11.6002 21.6563 11.2221 22 10.7752 22H8.0252C7.54395 22 7.2002 21.6563 7.2002 21.175V12.925C7.2002 12.4782 7.54395 12.1 8.0252 12.1H10.7752ZM9.4002 20.625C9.84707 20.625 10.2252 20.2813 10.2252 19.8C10.2252 19.3532 9.84707 18.975 9.4002 18.975C8.91895 18.975 8.5752 19.3532 8.5752 19.8C8.5752 20.2813 8.91895 20.625 9.4002 20.625ZM20.4002 7.2188C20.4002 8.66255 19.5064 9.48755 19.2314 10.45H22.7377C23.8721 10.45 24.7658 11.4125 24.7658 12.4782C24.8002 13.0969 24.5252 13.75 24.1127 14.1625C24.4564 14.9532 24.3877 16.0875 23.8033 16.8782C24.0783 17.7719 23.8033 18.8719 23.2189 19.4563C23.3908 20.075 23.3221 20.5907 23.0127 21.0032C22.3252 22 20.5721 22 19.0939 22H18.9908C17.3408 22 16.0002 21.4157 14.9002 20.9344C14.3502 20.6938 13.6283 20.3844 13.0783 20.3844C12.8721 20.35 12.7002 20.1782 12.7002 19.9719V12.6157C12.7002 12.5125 12.7346 12.4094 12.8033 12.3063C14.1783 10.9657 14.7627 9.5563 15.8627 8.42192C16.3783 7.9063 16.5502 7.15005 16.7564 6.3938C16.8939 5.77505 17.2033 4.40005 17.9252 4.40005C18.7502 4.40005 20.4002 4.67505 20.4002 7.2188Z",fill:"white"}),ie__default.createElement("defs",null,ie__default.createElement("linearGradient",{id:"paint0_linear_1709_1733",x1:"12",y1:"3.2",x2:"26.4",y2:"39.2",gradientUnits:"userSpaceOnUse"},ie__default.createElement("stop",{stopColor:"#63A1FF"}),ie__default.createElement("stop",{offset:"1",stopColor:"#0041BE"}))))},oO=dfe;var gfe=e=>{let[t,o]=useState(null);return useEffect(()=>{if(e==null)return;let r=StreamRepository.getStreamById(e,({data:i})=>{o(i);});return ()=>{r();}},[e]),t},cy=gfe;var Mm={linkPreviewSkeleton:"k5",linkPreviewSkeleton__bottom:"j5",linkPreviewSkeleton__bar1:"z5",linkPreviewSkeleton__bar2:"X5",linkPreviewSkeleton__image:"Y5",linkPreviewSkeleton__animation:"I5","skeleton-pulse":"Lo"};function rO(){return ie__default.createElement("div",{className:Mm.linkPreviewSkeleton},ie__default.createElement("div",{className:wl(Mm.linkPreviewSkeleton__image,Mm.linkPreviewSkeleton__animation)}),ie__default.createElement("div",{className:Mm.linkPreviewSkeleton__bottom},ie__default.createElement("div",{className:wl(Mm.linkPreviewSkeleton__bar1,Mm.linkPreviewSkeleton__animation)}),ie__default.createElement("div",{className:wl(Mm.linkPreviewSkeleton__bar2,Mm.linkPreviewSkeleton__animation)})))}var En={linkPreview:"A5",linkPreview__top:"M5",linkPreview__bottom:"S5",linkPreview__domain:"C5",linkPreview__object:"E5",linkPreview__unableToPreview:"R5",linkPreview__unableToPreview__icon:"U5"};var cP=new Map,Cfe=5e3,vfe=["https://api.cors.lol/?url=","https://api.allorigins.win/raw?url=","https://corsproxy.io/?"],pP=e=>{try{return new URL(e).hostname}catch(t){return ""}},_fe=(o,...r)=>l(void 0,[o,...r],function*(e,t={}){let i=new AbortController,n=setTimeout(()=>i.abort(),Cfe);try{let a$1=yield fetch(e,b(a({},t),{signal:i.signal}));return clearTimeout(n),a$1}catch(a){throw clearTimeout(n),a}}),iO=e=>l(void 0,null,function*(){let t=pP(e),o=r=>l(void 0,null,function*(){try{let i=yield _fe(`${r}${encodeURIComponent(e)}`,{headers:{Accept:"text/html"}});if(!i.ok)throw new Error("Failed to fetch preview");return i.text()}catch(i){throw i instanceof Error&&i.name==="AbortError"?new Error("Preview request timed out"):i}});try{let r=yield Client.fetchLinkPreview(e);if(!r.title)throw new Error("No data");return b(a({},r),{imageUrl:r.image,url:e,domain:t,timestamp:new Date})}catch(r){for(let i of vfe)try{let n=yield o(i);return bfe(n,e,t)}catch(n){console.warn(`Proxy ${i} failed: ${e}`,n);continue}throw new Error("All CORS proxies failed")}}),bfe=(e,t,o)=>{var s,l,m,c,d;let i=new DOMParser().parseFromString(e,"text/html"),n=((s=i.querySelector('meta[property="og:title"]'))==null?void 0:s.getAttribute("content"))||((l=i.querySelector("title"))==null?void 0:l.textContent)||"",a=((m=i.querySelector('meta[property="og:image"]'))==null?void 0:m.getAttribute("content"))||((c=i.querySelector('meta[property="twitter:image"]'))==null?void 0:c.getAttribute("content"))||((d=i.querySelector('meta[name="thumbnail"]'))==null?void 0:d.getAttribute("content"))||"";return {url:t,domain:o,title:n,imageUrl:a,timestamp:new Date}},nO=e=>{let t=new Date;return t.setDate(t.getDate()-1),e.timestamp>t};var aO=({url:e})=>useQuery({queryKey:["preview-metadata",e],queryFn:()=>l(void 0,null,function*(){let t=cP.get(e);if(t&&nO(t))return t;let o=yield iO(e);return cP.set(e,o),o}),retry:!1,enabled:!!e});var lO=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M21.1875 20.9141C21.1875 20.4219 21.5391 20 22.0312 20H25.8984C26.3906 20 26.7422 20.4219 26.7422 20.9141L26.25 28.7891C26.25 29.2109 25.8281 29.5625 25.4062 29.5625H22.5234C22.0312 29.5625 21.6797 29.2812 21.6797 28.7891L21.1875 20.9141ZM26.9531 33.5C26.9531 35.1875 25.6172 36.4531 24 36.4531C22.3125 36.4531 21.0469 35.1875 21.0469 33.5C21.0469 31.8828 22.3125 30.5469 24 30.5469C25.6172 30.5469 26.9531 31.8828 26.9531 33.5ZM26.8828 8.1875L43.7578 37.5078C45.0234 39.7578 43.4062 42.5 40.8047 42.5H7.125C4.52344 42.5 2.90625 39.6875 4.17188 37.5078L21.0469 8.1875C22.3125 5.9375 25.6172 6.00781 26.8828 8.1875ZM7.47656 38.5625C7.26562 38.8438 7.47656 39.125 7.82812 39.125H40.1016C40.4531 39.125 40.6641 38.8438 40.4531 38.5625L24.3516 10.5781C24.1406 10.2969 23.7891 10.2969 23.5781 10.5781L7.47656 38.5625Z",fill:"currentColor"}));var dO=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M38.625 11H9.375C7.47656 11 6 12.5469 6 14.375V34.625C6 36.5234 7.47656 38 9.375 38H38.625C40.4531 38 42 36.5234 42 34.625V14.375C42 12.5469 40.4531 11 38.625 11ZM38.2031 34.625H9.79688C9.51562 34.625 9.375 34.4844 9.375 34.2031V14.7969C9.375 14.5859 9.51562 14.375 9.79688 14.375H38.2031C38.4141 14.375 38.625 14.5859 38.625 14.7969V34.2031C38.625 34.4844 38.4141 34.625 38.2031 34.625ZM15 17.1875C13.3828 17.1875 12.1875 18.4531 12.1875 20C12.1875 21.6172 13.3828 22.8125 15 22.8125C16.5469 22.8125 17.8125 21.6172 17.8125 20C17.8125 18.4531 16.5469 17.1875 15 17.1875ZM12.75 31.25H35.25V25.625L29.0625 19.5078C28.7109 19.1562 28.2188 19.1562 27.8672 19.5078L19.5 27.875L16.6875 25.1328C16.3359 24.7812 15.8438 24.7812 15.4922 25.1328L12.75 27.875V31.25Z",fill:"currentColor"}));var Pfe=()=>ie__default.createElement("div",{className:En.linkPreview__unableToPreview},ie__default.createElement(lO,{className:En.linkPreview__unableToPreview__icon})),Ife=()=>ie__default.createElement("div",{className:En.linkPreview__unableToPreview},ie__default.createElement(dO,{className:En.linkPreview__unableToPreview__icon}));function cO({pageId:e="*",componentId:t="*",url:o}){var m,c;let r=aO({url:o}),i=pP(o),[n,a]=ie__default.useState(!1),s=()=>{window.open(o,"_blank");},l=()=>{a(!0);};return r.isLoading?ie__default.createElement(rO,null):r.isError?ie__default.createElement(V,{onPress:s,className:En.linkPreview},ie__default.createElement("div",{className:En.linkPreview__top},ie__default.createElement(Pfe,null)),ie__default.createElement("div",{className:En.linkPreview__bottom},ie__default.createElement(v.Caption,{className:En.linkPreview__domain},"Preview not available"),ie__default.createElement(v.BodyBold,null,"Please make sure the URL is correct and try again."))):ie__default.createElement(V,{"data-testid":`${e}/${t}/post_preview_link`,onPress:s,className:En.linkPreview},ie__default.createElement("div",{className:En.linkPreview__top},(m=r.data)!=null&&m.imageUrl&&!n?ie__default.createElement("img",{src:r.data.imageUrl,alt:r.data.title||"Link preview",className:En.linkPreview__object,onError:l}):ie__default.createElement(Ife,null)),ie__default.createElement("div",{className:En.linkPreview__bottom},ie__default.createElement(v.Caption,{className:En.linkPreview__domain},i),ie__default.createElement(v.BodyBold,null,((c=r.data)==null?void 0:c.title)||"")))}var Gc=({post:e,text:t="",mentioned:o,pageId:r="*",componentId:i="*",mentionees:n=[]})=>{var d,u,g,f,C;if(!t)return null;let{post:a}=Ir((d=e==null?void 0:e.children)==null?void 0:d[0]),s=iU.find(t).filter(y=>y.type==="url"),l=((u=e==null?void 0:e.children)==null?void 0:u[0])&&[PostContentType.IMAGE,PostContentType.VIDEO,PostContentType.POLL,PostContentType.LIVESTREAM,PostContentType.CLIP].includes(a==null?void 0:a.dataType),m=s&&s.length>0&&!l,c=cy((g=a==null?void 0:a.data)==null?void 0:g.streamId);return ie__default.createElement(ie__default.Fragment,null,(a==null?void 0:a.dataType)===PostContentType.LIVESTREAM?ie__default.createElement(ie__default.Fragment,null,ie__default.createElement(tl,{isBold:!0,pageId:r,mentionees:n,metadata:{mentioned:o},componentId:i,data:{text:(f=c==null?void 0:c.title)!=null?f:""}}),((C=c==null?void 0:c.description)==null?void 0:C.trim())&&ie__default.createElement(tl,{pageId:r,mentionees:n,metadata:{mentioned:o},componentId:i,data:{text:c.description}})):ie__default.createElement(tl,{pageId:r,componentId:i,data:{text:t},mentionees:n,metadata:{mentioned:o}}),m&&ie__default.createElement(cO,{pageId:r,componentId:i,url:s[0].href}))};function zu(e,t="medium"){return FileRepository.fileUrlWithSize(e,t)}var ju={imageContent:"R",imageContent__img:"B5",imageContent__imgContainer:"U",imageContent__imgCover:"F5",imageContent__skeleton:"H5",pulse:"To",imageContent__brokenImage:"L5"};var uP=({posts:e,pageId:t="*",elementId:o="*",componentId:r="*",onImageClick:i})=>{var l,m;let{themeStyles:n}=S({pageId:t,componentId:r,elementId:o}),a=e.slice(0,4),s=Math.max(0,e.length-4);return !e||((l=e[0])==null?void 0:l.dataType)!=="image"?null:ie__default.createElement("div",{style:n,className:ju.imageContent,"data-images-amount":Math.min((m=e==null?void 0:e.length)!=null?m:0,4)},a.map((c,d)=>ie__default.createElement(Sfe,{key:c.postId,index:d,imagePost:c,pageId:t,componentId:r,imageLeftCount:s,totalCount:e.length,onImageClick:()=>i(d),isLastImage:d===a.length-1})))};function Sfe({index:e,imagePost:t,isLastImage:o,totalCount:r,pageId:i="*",onImageClick:n,imageLeftCount:a,componentId:s="*"}){let[l,m]=useState(!1),c=t==null?void 0:t.getImageInfo();return t?ie__default.createElement(V,{onPress:()=>n(),className:ju.imageContent__imgContainer,"data-testid":`${i}/${s}/post_image`,"aria-label":pg({isLastImage:o,total:r,current:e+1,altText:c==null?void 0:c.altText,leftCount:a+1})},c&&c.fileUrl&&!l?ie__default.createElement("img",{loading:"lazy",onError:()=>m(!0),className:ju.imageContent__img,src:zu(c.fileUrl),alt:pg({isLastImage:o,total:r,current:e+1,altText:c==null?void 0:c.altText,leftCount:a+1})}):ie__default.createElement("div",{className:ju.imageContent__brokenImage}),a>0&&o&&ie__default.createElement(v.Headline,{className:ju.imageContent__imgCover},"+ ",a+1)):null}var ka={videoContent:"B",videoContent__video:"T5",videoContent__brokenImg:"V5",videoContent__videoContainer:"F",videoContent__videoCover:"W5",videoContent__playButtonCover:"q5",videoContent__playButton:"D5",videoContent__playButton__icon:"G5",videoContent__skeleton:"J5",pulse:"Vo",videoContent__skeleton__icon:"K5"};var kfe=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("circle",{cx:"20",cy:"20",r:"20",fill:"black",fillOpacity:"0.5"}),ie__default.createElement("g",{clipPath:"url(#clip0_212_1181)"},ie__default.createElement("path",{d:"M16 13V27L27 20L16 13Z",fill:"white"})),ie__default.createElement("defs",null,ie__default.createElement("clipPath",{id:"clip0_212_1181"},ie__default.createElement("rect",{width:"24",height:"24",fill:"white",transform:"translate(8 8)"})))),bl=kfe;var Efe=({fileId:e,placeholder:t})=>{let o=rt({fileId:e}),[r,i]=useState(!1);return ie__default.createElement(ie__default.Fragment,null,o&&!r?ie__default.createElement("img",{loading:"lazy",className:ka.videoContent__video,src:o,alt:e,onError:()=>i(!0)}):ie__default.createElement("div",{className:ka.videoContent__brokenImg}))},Afe=({videoPost:e,postAmount:t,isLastVideo:o,onVideoClick:r,pageId:i="*",videoLeftCount:n,componentId:a="*"})=>{var s;return e?ie__default.createElement(V,{onPress:()=>r(),"data-videos-amount":Math.min(t,4),className:ka.videoContent__videoContainer,"data-testid":`${i}/${a}/post_video`},ie__default.createElement(Efe,{fileId:(s=e==null?void 0:e.data)==null?void 0:s.thumbnailFileId,placeholder:ie__default.createElement("div",{className:ka.videoContent__skeleton},ie__default.createElement(bl,{className:ka.videoContent__skeleton__icon}))}),n>0&&o&&ie__default.createElement(v.Headline,{className:ka.videoContent__videoCover},"+ ",n+1),n===0||!o?ie__default.createElement("div",{className:ka.videoContent__playButtonCover},ie__default.createElement("div",{className:ka.videoContent__playButton},ie__default.createElement(bl,{className:ka.videoContent__playButton__icon}))):null):null},gP=({posts:e,onVideoClick:t,pageId:o="*",elementId:r="*",componentId:i="*"})=>{var l,m;let{themeStyles:n}=S({pageId:o,componentId:i,elementId:r}),a=e.slice(0,4),s=Math.max(0,e.length-4);return !e||((l=e[0])==null?void 0:l.dataType)!=="video"?null:ie__default.createElement("div",{className:ka.videoContent,style:n},ie__default.createElement("div",{style:n,className:ka.videoContent,"data-videos-amount":Math.min((m=e.length)!=null?m:0,4)},a.map((c,d)=>ie__default.createElement(Afe,{key:c.postId,pageId:o,videoPost:c,componentId:i,videoLeftCount:s,postAmount:e.length,onVideoClick:()=>t(d),isLastVideo:d===a.length-1}))))};var fs={clipContent:"Wo",clipContent__video:"qo",clipContent__brokenImg:"N5",clipContent__videoContainer:"O5",clipContent__videoCover:"P5",clipContent__playButtonCover:"Q5",clipContent__playButton:"Z5",clipContent__playButton__icon:"_5",clipContent__skeleton:"ev",pulse:"Do",clipContent__skeleton__icon:"rv"};var Dfe=({fileId:e,placeholder:t,displayMode:o="fill"})=>{let r=rt({fileId:e}),[i,n]=useState(!1);return ie__default.createElement(ie__default.Fragment,null,r&&!i?ie__default.createElement("img",{loading:"lazy",className:fs.clipContent__video,src:r,alt:e,onError:()=>n(!0),"data-isfill":o==="fill"}):ie__default.createElement("div",{className:fs.clipContent__brokenImg}))},Vfe=({post:e,onClipClick:t,pageId:o="*",componentId:r="*"})=>{var i,n;return ie__default.createElement(V,{onPress:()=>t(),className:fs.clipContent__videoContainer,"data-testid":`${o}/${r}/post_video`},ie__default.createElement(Dfe,{fileId:((i=e.data)==null?void 0:i.thumbnailFileId)||"",placeholder:ie__default.createElement("div",{className:fs.clipContent__skeleton},ie__default.createElement(bl,{className:fs.clipContent__skeleton__icon})),displayMode:((n=e.data)==null?void 0:n.displayMode)||"fill"}),ie__default.createElement("div",{className:fs.clipContent__playButtonCover},ie__default.createElement("div",{className:fs.clipContent__playButton},ie__default.createElement(bl,{className:fs.clipContent__playButton__icon}))))},fP=({posts:e,onClipClick:t,pageId:o="*",elementId:r="*",componentId:i="*"})=>{let n=e==null?void 0:e[0],{themeStyles:a}=S({pageId:o,componentId:i,elementId:r});return !n||n.dataType!=="clip"?null:ie__default.createElement("div",{className:fs.clipContent,style:a},ie__default.createElement("div",{style:a,className:fs.clipContent,"data-videos-amount":Math.min(e.length,4)},ie__default.createElement(Vfe,{key:e[0].postId,pageId:o,post:e[0],componentId:i,onClipClick:()=>t(n.postId)})))};function Ug({next:e,prev:t,threshold:o=50}){let r=useRef(0),i=useRef(0);return {handleTouchStart:l=>{r.current=l.touches[0].clientX;},handleTouchMove:l=>{i.current=l.touches[0].clientX;},handleTouchEnd:()=>{let l=r.current-i.current;l>o&&e(),l<-o&&t();}}}var Ufe=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M20.332 5.25391C21.2109 6.13281 21.2109 7.53906 20.332 8.41797L17.6953 11.0547L16.5 12.25L7.92188 20.8281L3.91406 21.25C3.87891 21.25 3.84375 21.25 3.80859 21.25C3.31641 21.25 2.92969 20.8281 3 20.3359L3.42188 16.3281L12 7.75L13.1953 6.55469L15.832 3.91797C16.2539 3.49609 16.8516 3.25 17.4141 3.25C17.9766 3.25 18.5742 3.49609 18.9961 3.91797L20.332 5.25391ZM7.14844 19.2109L15.3047 11.0898L16.3945 10L14.25 7.85547L13.1602 8.94531L5.03906 17.1016L4.79297 19.457L7.14844 19.2109ZM19.1367 7.22266C19.3477 7.01172 19.3477 6.66016 19.1367 6.44922L17.8008 5.11328C17.6602 4.97266 17.4844 4.9375 17.4141 4.9375C17.3438 4.9375 17.168 4.97266 17.0273 5.11328L15.4453 6.66016L17.5898 8.80469L19.1367 7.22266Z"})),py=Ufe;var Zc={altTextConfig:"Go",altTextConfig__content:"Jo",altTextConfig__imageContainer:"av",altTextConfig__image:"ov",altTextConfig__input:"Ko",altTextConfig__cta:"No"};var yO=Object.freeze({CONTAIN_BLOCKED_WORD:400308,CONTAIN_BLOCKED_URL:400309});function Yfe({mode:e,result:t}){let o=e.type==="edit",{isDesktop:r}=le(),{info:i,success:n}=ce(),a=useRef(null),s=rt({fileId:e.media.image.fileId}),{mutateAsync:l$1}=useMutation({networkMode:"always",mutationFn:_=>l(this,null,function*(){yield FileRepository.updateAltText(_.fileId,_.altText);}),onSuccess:(_,{altText:x})=>{t(x),o&&n({content:"Alt text updated.",alignment:"fullscreen"});},onError:_=>{var x;if(_.message.includes("Network Error"))return i({content:"No internet connection.",alignment:"fullscreen"});if(_.message.includes(`${yO.CONTAIN_BLOCKED_WORD}`)||_.message.includes(`${yO.CONTAIN_BLOCKED_URL}`))return i({content:(x=_==null?void 0:_.message)==null?void 0:x.split(": ")[1],alignment:"fullscreen"});i({alignment:"fullscreen",content:`Failed to ${e.type==="create"?"add":"edit"} alt text. Please try again.`});}}),m=useMemo(()=>xn.object({altText:o?xn.string().max(180):xn.string().trim().min(1).max(180)}),[o]),{watch:c,setValue:d,formState:u,register:g,handleSubmit:f}=useForm({mode:"onChange",defaultValues:{altText:e.media.image.altText||""},resolver:zodResolver(m)}),C=c("altText");return useEffect(()=>{a.current&&r&&(a.current.style.height=`${a.current.scrollHeight}px`);},[]),useEffect(()=>{if(a.current){let _=a.current.value.length;a.current.setSelectionRange(_,_);}},[a.current]),{altText:C,imageUrl:s,onSubmit:_=>l(this,null,function*(){yield l$1({fileId:e.media.image.fileId,altText:_.altText.trim()});}),formState:u,register:g,textareaRef:a,handleSubmit:f,handleTextareaChange:_=>{d("altText",_.target.value,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),a.current&&(a.current.style.height="auto",a.current.style.height=`${a.current.scrollHeight}px`);}}}function Og({mode:e,result:t,renderHeader:o}){var d;let{altText:r,onSubmit:i,register:n,imageUrl:a$1,formState:s,textareaRef:l,handleSubmit:m,handleTextareaChange:c}=Yfe({mode:e,result:t});return ie__default.createElement("form",{id:"alt-text-form",className:Zc.altTextConfig,onSubmit:u=>{u.preventDefault(),u.stopPropagation(),m(i)(u);}},o&&o({count:(d=r==null?void 0:r.trim().length)!=null?d:0,isDisabled:!s.isDirty||!s.isValid||s.isSubmitting}),ie__default.createElement("div",{className:Zc.altTextConfig__content},ie__default.createElement("figure",{className:Zc.altTextConfig__imageContainer},ie__default.createElement("img",{src:a$1,alt:e.media.image.altText,className:Zc.altTextConfig__image})),ie__default.createElement("div",null,ie__default.createElement(Label,{className:"srOnly",id:"alt-text"},"Describe this photo briefly to help visually impaired users understand its content"),ie__default.createElement(TextArea,b(a({},n("altText")),{rows:1,autoFocus:!0,maxLength:180,value:r,ref:l,"aria-labelledby":"alt-text",onChange:c,className:Zc.altTextConfig__input,placeholder:"Describe this photo briefly to help visually impaired users understand its content",onKeyDown:u=>{u.key==="Enter"&&u.preventDefault();}}))),ie__default.createElement(oe,{fullWidth:!0,type:"submit",size:"medium",variant:"fill",color:"primary",className:Zc.altTextConfig__cta,isDisabled:!s.isDirty||!s.isValid||s.isSubmitting},e.type==="create"?"Done":"Save")))}var Wc={altTextMenu:"Oo",altTextMenu__editAltText:"Te",altTextMenu__editAltText__icon:"tv",altTextConfig__header:"iv",altTextConfig__header__count:"sv",altTextConfig__header__icon:"dv"};function yP({pageId:e="*",onPress:t,file:o}){let r="alt_text_menu",{openPopup:i}=Se();return ie__default.createElement("div",{className:Wc.altTextMenu},ie__default.createElement(V,{"aria-haspopup":"menu",className:Wc.altTextMenu__editAltText,"data-testid":`${e}/${r}/edit_alt_text_button`,onPress:()=>{t(),o&&i({children:({close:n})=>ie__default.createElement(Og,{result:()=>n(),mode:{type:"edit",altText:o.altText||"",media:{type:"image",image:o}},renderHeader:({count:a})=>ie__default.createElement("div",{className:Wc.altTextConfig__header},ie__default.createElement("div",null,ie__default.createElement(v.Headline,null,"Edit alt text"),ie__default.createElement(v.Caption,{"aria-live":"polite",className:Wc.altTextConfig__header__count},a,"/180")),ie__default.createElement(ot,{pageId:e,onPress:n,defaultClassName:Wc.altTextConfig__header__icon}))})});}},ie__default.createElement(py,{className:Wc.altTextMenu__editAltText__icon}),ie__default.createElement(v.BodyBold,null,"Edit alt text")))}var hO=({file:e})=>To(e)?FileRepository.fileUrlWithSize(e.fileUrl,"medium"):URL.createObjectURL(e);var uy={altTextBadge:"Po",altTextBadge__text:"cv",altTextBadge__icon:"Qo"};function CO(r){var i=r,{className:e,completed:t}=i,o=d(i,["className","completed"]);return ie__default.createElement(V,b(a({},o),{"data-completed":t,"aria-label":"Add alternative text to your image",className:wl(uy.altTextBadge,e)}),ie__default.createElement(v.CaptionBold,{className:uy.altTextBadge__text},"ALT"),ie__default.createElement(oy,{className:uy.altTextBadge__icon}))}var CP={progress__spinner:"lv",progress__ring:"nv"};var zg=({progress:e})=>{let o=Math.min(100,Math.max(0,e))*3.6;return ie__default.createElement("div",{className:CP.progress__spinner},ie__default.createElement("div",{className:CP.progress__ring,style:{background:`conic-gradient(
1868
1868
  var(--asc-color-primary-default) ${o}deg,
1869
1869
  white ${o}deg 360deg
1870
- )`}}))};var Oo={thumbnail__container:"H",thumbnail__wrapper:"Ve",thumbnail__overlay:"mv",thumbnail__altText:"hv",thumbnail__failed__placeholder:"gv",thumbnail:"pv",closeIcon:"bv",closeButton:"uv",icon__status__error:"fv",icon__status:"vv",altTextConfig__header:"wv",altTextConfig__header__icon:"xv",altTextConfig__header__count:"yv",drawer__overlay:"kv",drawer__content:"jv",drawer__placeholder:"zv",altTextConfig__mobile__header:"Xv",altTextConfig__mobile__header__icon:"Yv",altTextConfig__mobile__header__count:"Iv",altTextConfig__mobile__header__title:"Av"};function jg({files:e,progress:t,removeFile:o,pageId:r="*",postImages:i=[],componentId:n="*",onRemovePostImage:a,onAltTextChange:s}){let l=e.length>0&&e.some(d=>J2(d)),m=i.length>0;if(!l&&!m)return null;let c=(l?e.filter(d=>J2(d)).length:0)+(m?i.length:0);return ie__default.createElement("div",{"data-images-amount":Math.min(c,3),className:Oo.thumbnail__container},i==null?void 0:i.map(d=>{var u;return ie__default.createElement(t4e,{post:d,pageId:r,key:(u=d.data)==null?void 0:u.fileId,componentId:n,totalImages:c,onRemovePostImage:a||(()=>{})})}),e.filter(d=>J2(d)).map(d=>ie__default.createElement(o4e,{file:d,pageId:r,progress:t,key:`file-${d.id}`,componentId:n,totalImages:c,onRemoveFile:()=>o(d.file),onAltTextChange:s})))}function t4e({post:e,pageId:t,totalImages:o,componentId:r,onRemovePostImage:i}){var a,s;let n=e==null?void 0:e.getImageInfo();return n?ie__default.createElement("div",{key:`post-${(a=e.data)==null?void 0:a.fileId}`,"data-images-height":o>2,className:Oo.thumbnail__wrapper},ie__default.createElement("img",{alt:(s=n.altText)!=null?s:"",className:Oo.thumbnail,src:zu(n.fileUrl)}),ie__default.createElement(V,{type:"reset",className:Oo.closeButton,onPress:()=>{var l;return ((l=e.data)==null?void 0:l.fileId)&&i(e.data.fileId)},"data-testid":`${t}/${r}/remove_thumbnail`},ie__default.createElement(Xn,{className:Oo.closeIcon}))):null}function o4e({file:e,pageId:t,progress:o,totalImages:r,componentId:i,onRemoveFile:n,onAltTextChange:a}){var m;let s=o[e.id]&&!To(e.file),l=e.errorText&&!("fileId"in e);return ie__default.createElement("div",{key:`file-${e.id}`,"data-images-height":r>2,className:Oo.thumbnail__wrapper},ie__default.createElement(r4e,{file:e}),(s||l)&&ie__default.createElement("div",{className:Oo.thumbnail__overlay}),ie__default.createElement(i4e,{testId:`${t}/${i}/remove_thumbnail`,onPress:n}),s&&ie__default.createElement("div",{className:Oo.icon__status},ie__default.createElement(zg,{progress:(m=o[e.id])!=null?m:100})),l&&ie__default.createElement("div",{className:Oo.icon__status__error},ie__default.createElement(Co,null)),To(e.file)&&!s&&!l&&ie__default.createElement(n4e,{file:e.file,onAltTextChange:a}))}function r4e({file:e,testId:t}){var o;return ie__default.createElement("img",{"data-testid":t,src:hO(e),className:Oo.thumbnail,alt:To(e.file)&&(o=e.file.altText)!=null?o:""})}function i4e({onPress:e,testId:t}){return ie__default.createElement(V,{"data-testid":t,type:"reset",className:Oo.closeButton,onPress:e},ie__default.createElement(Xn,{className:Oo.closeIcon}))}function n4e({file:e,onAltTextChange:t}){let{openPopup:o}=Se(),{isDesktop:r}=le(),[i,n]=ie__default.useState(!1);return ie__default.createElement("div",{className:Oo.thumbnail__altText},ie__default.createElement(CO,{completed:!!e.altText,onPress:()=>{r?o({children:({close:a})=>ie__default.createElement(Og,{result:s=>{t(e,s),a();},mode:e.altText!==null?{type:"edit",altText:e.altText||"",media:{type:"image",image:e}}:{type:"create",media:{type:"image",image:e}},renderHeader:({count:s})=>ie__default.createElement("div",{className:Oo.altTextConfig__header},ie__default.createElement(ze,{onPress:a,defaultClassName:Oo.altTextConfig__header__icon}),ie__default.createElement("div",null,ie__default.createElement(v.Headline,null,"Alt text"),ie__default.createElement(v.Caption,{className:Oo.altTextConfig__header__count},s,"/180")))})}):n(!0);}}),ie__default.createElement(vP,{file:e,isOpen:i,setIsOpen:n,onAltTextChange:t}))}function vP({file:e,isOpen:t,setIsOpen:o,onAltTextChange:r,mode:i="create"}){return ie__default.createElement(Drawer.Root,{open:t,onOpenChange:o,snapPoints:[1],activeSnapPoint:1},ie__default.createElement(Drawer.Portal,null,ie__default.createElement(Drawer.Overlay,{className:Oo.drawer__overlay}),ie__default.createElement(Drawer.Content,{className:Oo.drawer__content},ie__default.createElement("div",{className:Oo.drawer__placeholder}),ie__default.createElement(Og,{result:n=>{r==null||r(e,n),o(!1);},mode:e.altText!==null?{type:"edit",altText:e.altText||"",media:{type:"image",image:e}}:{type:"create",media:{type:"image",image:e}},renderHeader:({count:n,isDisabled:a})=>ie__default.createElement("div",{className:Oo.altTextConfig__mobile__header},ie__default.createElement(ot,{onPress:()=>o(!1),defaultClassName:Oo.altTextConfig__mobile__header__icon}),ie__default.createElement("div",{className:Oo.altTextConfig__mobile__header__title},ie__default.createElement(v.BodyBold,null,i==="create"?"Alt text":"Edit alt text"),ie__default.createElement(v.Caption,{className:Oo.altTextConfig__mobile__header__count},n,"/180")),ie__default.createElement(oe,{type:"submit",size:"medium",variant:"text",color:"primary",form:"alt-text-form",isDisabled:a},i==="create"?"Done":"Save"))}))))}var Ln={imageViewer__modal:"Mv",imageViewer__fullImage:"Zo",imageViewer__itemContainer:"_o",imageViewer__prev:"se",imageViewer__next:"de",imageViewer__prev__icon:"et",imageViewer__next__icon:"Sv",imageViewer__close:"rt",imageViewer__closeButton:"Cv",imageViewer__closeButton__img:"Ev",imageViewer__menuButton:"at",imageViewer__menuButton__icon:"Rv",imageViewer__count:"Uv"};var fy=({post:e,community:t})=>{let {currentUserId:o}=Ne();qe({userId:o});let i=useMemo(()=>e.targetType==="community"&&e.targetId===(t==null?void 0:t.communityId),[e.targetType,t==null?void 0:t.communityId]),{moderators:n}=Lo({communityId:t==null?void 0:t.communityId,shouldCall:i}),a=useMemo(()=>i?n.some(l=>l.userId===o):!1,[n,i,o]),s=e.postedUserId===o;return {isCommunityModerator:a,isOwner:s}};function $u({post:e,onClose:t,pageId:o="*",elementId:r="*",componentId:i="*",initialImageIndex:n}){var E;let{isOwner:a}=fy({post:e}),[s,l]=useState(n),{themeStyles:m,accessibilityId:c}=S({pageId:o,componentId:i,elementId:r}),[d,u]=useState(!1),g=(E=e.childrenPosts[s])==null?void 0:E.getImageInfo(),{setDrawerData:f,removeDrawerData:C}=tt(),[y,b]=ie__default.useState(!1),_=()=>{P&&l(N=>N+1);},x=()=>{I&&l(N=>N-1);},P=s<(e==null?void 0:e.children.length)-1,I=s>0,{handleTouchEnd:w,handleTouchMove:M,handleTouchStart:T}=Ug({next:_,prev:x});return ie__default.createElement("div",{style:m,"data-testid":c,className:Ln.imageViewer__modal},ie__default.createElement("span",{className:Ln.imageViewer__close},ie__default.createElement(kn,{pageId:o,onPress:t,componentId:i,defaultClassName:Ln.imageViewer__closeButton,imgClassName:Ln.imageViewer__closeButton__img}),a&&ie__default.createElement(ft,{trigger:{pageId:o,className:Ln.imageViewer__menuButton,iconClassName:Ln.imageViewer__menuButton__icon,onClick:()=>{f({content:ie__default.createElement(yP,{file:g,pageId:o,onPress:()=>{b(!0),C();}})});}}},({closePopover:N})=>ie__default.createElement(yP,{file:g,pageId:o,onPress:N}))),(e==null?void 0:e.children.length)>1&&ie__default.createElement(v.TitleBold,{className:Ln.imageViewer__count,as:"p"},s+1," / ",e==null?void 0:e.children.length),I&&ie__default.createElement(V,{onPress:x,className:Ln.imageViewer__prev,"aria-label":"Click to go to previous image"},ie__default.createElement(wo,{className:Ln.imageViewer__prev__icon})),ie__default.createElement("div",{"aria-live":"assertive"},g&&!d?ie__default.createElement("img",{onTouchEnd:w,onTouchMove:M,onTouchStart:T,onError:()=>u(!0),className:Ln.imageViewer__fullImage,src:zu(g.fileUrl),alt:pg({current:s+1,total:e==null?void 0:e.children.length,altText:g==null?void 0:g.altText})}):ie__default.createElement("div",{role:"status","aria-label":"loading image",className:Ln.imageViewer__itemContainer})),P&&ie__default.createElement(V,{onPress:_,className:Ln.imageViewer__next,"aria-label":"Click to go to next image"},ie__default.createElement(wo,{className:Ln.imageViewer__next__icon})),g&&ie__default.createElement(vP,{file:g,mode:"edit",isOpen:y,setIsOpen:b}))}var ys={videoViewer__modal:"ot",videoViewer__fullImage:"tt",videoViewer__prev:"We",videoViewer__next:"qe",videoViewer__prevButton:"it",videoViewer__nextButton:"Bv",videoViewer__close:"st",videoViewer__closeButton:"Fv",videoViewer__closeButton__img:"Hv",videoViewer__count:"Lv"};function Zu({post:e,onClose:t,pageId:o="*",elementId:r="*",componentId:i="*",initialVideoIndex:n}){useKeyPressEvent("Escape",t);let a=V2((e==null?void 0:e.children)||[]),{themeStyles:s,accessibilityId:l}=S({pageId:o,componentId:i,elementId:r}),[m,c]=useState(n),d=()=>{C&&c(b=>b+1);},u=()=>{y&&c(b=>b-1);},g=a.filter(b=>b.dataType==="video"||b.dataType==="clip"),f=g[m],C=m<g.length-1,y=m>0;return ie__default.createElement("div",{style:s,"data-testid":l,className:ys.videoViewer__modal},ie__default.createElement("span",{className:ys.videoViewer__close},ie__default.createElement(kn,{pageId:o,onPress:t,componentId:i,defaultClassName:ys.videoViewer__closeButton,imgClassName:ys.videoViewer__closeButton__img})),g.length>1&&ie__default.createElement(v.TitleBold,{className:ys.videoViewer__count},m+1," / ",g.length),y&&ie__default.createElement(V,{className:ys.videoViewer__prev,onPress:u},ie__default.createElement(wo,{className:ys.videoViewer__prevButton})),ie__default.createElement(u4e,{videoPost:f,next:d,prev:u}),C&&ie__default.createElement(V,{className:ys.videoViewer__next,onPress:d},ie__default.createElement(wo,{className:ys.videoViewer__nextButton})))}var u4e=memo(({videoPost:e,prev:t,next:o})=>{var d;let r=useMemo(()=>{var u,g,f,C,y;return (e==null?void 0:e.dataType)==="clip"?(u=e==null?void 0:e.data)==null?void 0:u.fileId:((g=e==null?void 0:e.data)==null?void 0:g.videoFileId.high)||((f=e==null?void 0:e.data)==null?void 0:f.videoFileId.medium)||((C=e==null?void 0:e.data)==null?void 0:C.videoFileId.low)||((y=e==null?void 0:e.data)==null?void 0:y.videoFileId.original)||void 0},[e]),{handleTouchEnd:i,handleTouchMove:n,handleTouchStart:a}=Ug({next:o,prev:t,threshold:100}),s=pr(r),l=pr((d=e==null?void 0:e.data)==null?void 0:d.thumbnailFileId),m=useRef(null),c=useMemo(()=>{if(s==null)return null;if(s.status===b2.Transcoded){let{videoUrl:u}=s;return (u==null?void 0:u["1080p"])||(u==null?void 0:u["720p"])||(u==null?void 0:u["480p"])||(u==null?void 0:u["360p"])||(u==null?void 0:u.original)||s.fileUrl}return s.fileUrl},[s]);return useEffect(()=>{var u;(u=m.current)==null||u.load();},[c]),c==null?null:ie__default.createElement("video",{controls:!0,autoPlay:!0,ref:m,controlsList:"nodownload",onTouchEnd:i,poster:l==null?void 0:l.fileUrl,onTouchMove:n,onTouchStart:a,onVolumeChange:u=>{var g;(e==null?void 0:e.dataType)==="clip"&&((g=e==null?void 0:e.data)!=null&&g.isMuted)&&(u.currentTarget.muted=!0);},className:ys.videoViewer__fullImage},ie__default.createElement("source",{src:c,type:"video/mp4"}),ie__default.createElement("p",null,"Your browser does not support this format of video. Please try again later once the server transcodes the video into an playable format(mp4)."))});function _P(){let o=it({fetcher:PostRepository.getGlobalPinnedPosts,params:{limit:10},shouldCall:!0}),{items:e}=o,t=d(o,["items"]);return a({globalFeaturedPosts:e},t)}var v4e=()=>{let[e,t]=useState([]),[o,r]=useState([]),[i,n]=useState(!1),[a$1,s]=useState(!1),[l$1,m]=useState(!1),[c,d]=useState(0),u=useRef(),g=useRef(),f=10,{itemWithAds:C,reset:y}=rU({items:e,pageSize:f,placement:"feed",getItemId:A=>A.postId}),{globalFeaturedPosts:b$1,isLoading:_}=_P();useEffect(()=>{b$1&&r(b$1);},[b$1]);let x=useCallback(()=>{let A=FeedRepository.getGlobalFeed({limit:f},({data:D,loading:G,error:H,hasNextPage:$,onNextPage:j})=>{n(G),D&&!G&&(m(!!$),u.current=j,t(D)),H&&console.error("error",H);});return g.current=A,A},[]);useEffect(()=>{let A=x();return ()=>{A();}},[x]);let P=useCallback(()=>l(void 0,null,function*(){g.current&&g.current(),t([]),m(!1),u.current=void 0,y(),yield new Promise(A=>setTimeout(A,100)),x();}),[x,y]),I=A=>{let D=A.target;d(D.scrollTop);},w=A=>{t(D=>new Set([...D.map(H=>H.postId)]).has(A.postId)?D:[A,...D]);},M=A=>{let D=e.filter(G=>G.postId!==A);t(D);},T=A=>{let D=e.map(G=>G.postId===A.postId?a(a({},G),A):G);t(D);},E=A=>{if(!b$1)return;let D=b$1.map(G=>{var H;return ((H=G.post)==null?void 0:H.postId)===A.postId?b(a({},G),{post:a(a({},G.post),A)}):G});r(D);},N=useCallback(()=>{u.current&&u.current();},[]);return {itemWithAds:C,isLoading:i,prependItem:w,removeItem:M,updateItem:T,updateGlobalFeaturedPosts:E,globalFeaturedPostsItems:o,loadMore:N,hasMore:l$1,loadMoreHasBeenCalled:a$1,refetch:P,scrollPosition:c,onScroll:I,isGlobalFeaturedPostsLoading:_}},wO=createContext({itemWithAds:[],isLoading:!1,prependItem:()=>{},removeItem:()=>{},updateItem:()=>{},updateGlobalFeaturedPosts:()=>{},loadMore:()=>{},hasMore:!1,loadMoreHasBeenCalled:!1,refetch:()=>Promise.resolve(),scrollPosition:0,onScroll:()=>{},isGlobalFeaturedPostsLoading:!1,globalFeaturedPostsItems:[]}),Fn=()=>{let e=useContext(wO);if(!e)throw new Error("useGlobalFeedContext must be used within a GlobalFeedProvider");return e},TO=({children:e})=>{let t=v4e();return ie__default.createElement(wO.Provider,{value:t},e)};function yy(n){var a$1=n,{pageId:e="*",componentId:t="*",isValid:o=!1,onSubmit:r}=a$1,i=d(a$1,["pageId","componentId","isValid","onSubmit"]);let s="create_new_post_button",{config:l,isExcluded:m,themeStyles:c,accessibilityId:d$1}=S({pageId:e,componentId:t,elementId:s});return m?null:ie__default.createElement(oe,b(a({},i),{type:"submit",style:c,"data-testid":d$1}),l.text)}var qu={editorPlaceholder:"Tv",editorParagraph:"Vv",editorContainer:"dt",editorRoot:"Wv",editorLink:"qv",postTextField__mentionInterceptor:"Dv"};var E4e=e=>{let[t,o]=useState(null),{community:r,isLoading:i}=Ct({communityId:e}),n=useMemo(()=>!!e&&!i&&!(r!=null&&r.isPublic),[e,i,r]),{members:a,hasMore:s,isLoading:l,loadMore:m}=hu({communityId:e||"",displayName:t||"",limit:10,enabled:n}),{users:c,hasMore:d,loadMore:u,isLoading:g}=al({displayName:t||"",limit:10,enabled:!n}),f=x=>{o(x);},C=useMemo(()=>e&&i?[]:n?a.map(({user:x,userId:P})=>({userId:(x==null?void 0:x.userId)||P,displayName:x==null?void 0:x.displayName})):c.map(({displayName:x,userId:P})=>({userId:P,displayName:x})),[c,a,n,i]),y=useMemo(()=>n?s:d,[n,s,d]),b=()=>{_||!y||(n?m():u());},_=useMemo(()=>n?l:g,[l,g,n]);return {suggestions:C,queryString:t,onQueryChange:f,loadMore:b,hasMore:y,isLoading:_}},A4e=[AutoLinkNode,LinkNode,bm],qc=({onChange:e,dataValue:t,className:o,communityId:r,pageId:i="*",mentionContainer:n,componentId:a$1="*",placeholderClassName:s,mentionContainerClassName:l,placeholder:m,isValidInput:c})=>{let d="post_text_field",[u,g]=useState(null),{accessibilityId:f}=S({pageId:i,componentId:a$1,elementId:d}),C=mu({namespace:"PostTextField",theme:{link:qu.editorLink,placeholder:qu.editorPlaceholder,paragraph:qu.editorParagraph},nodes:A4e}),{onQueryChange:y,suggestions:b$1,isLoading:_,loadMore:x}=E4e(r);return ke({onIntersect:()=>{x();},node:u,options:{threshold:.7}}),ie__default.createElement(LexicalComposer,{initialConfig:a(a({},C),t!=null&&t.data.text?{editorState:JSON.stringify(su(t))}:{})},ie__default.createElement("div",{"data-input-validation":c,className:wl(qu.editorContainer,o),"data-testid":f},ie__default.createElement(RichTextPlugin,{contentEditable:ie__default.createElement(ContentEditable,null),placeholder:ie__default.createElement("div",{className:wl(qu.editorPlaceholder,s),"data-isclip":a$1==="clipPost"},m!=null?m:"What's going on..."),ErrorBoundary:LexicalErrorBoundary}),ie__default.createElement(OnChangePlugin,{onChange:(P,I)=>{e(lu(I));}}),ie__default.createElement(HistoryPlugin,null),ie__default.createElement(AutoFocusPlugin,null),ie__default.createElement(fu,null),ie__default.createElement(gu,null),ie__default.createElement(yu,{suggestions:b$1,onQueryChange:y,commandPriority:COMMAND_PRIORITY_HIGH,getSuggestionId:P=>P.userId,$createNode:P=>W1({text:`@${(P==null?void 0:P.displayName)||""}`,data:P}),menuRenderFn:(P,{options:I,selectedIndex:w,setHighlightedIndex:M,selectOptionAndCleanUp:T})=>{if(I.length===0)return null;let E=I.map((N,A)=>ie__default.createElement(vu,{pageId:i,componentId:a$1,isSelected:w===A,onClick:()=>{M(A),T(N);},onMouseEnter:()=>{M(A);},key:N.key,option:b(a({},N),{setRefElement:D=>{A===I.length-1&&g(D),N.setRefElement(D);}})}));return n?_U.createPortal(E,n):P!=null&&P.current?_U.createPortal(ie__default.createElement("div",{className:l},E),P.current):null}})))};var Yo={thumbnail__container:"L",thumbnail__wrapper:"De",thumbnail:"Gv",closeButton:"Jv",closeIcon:"Kv",icon__status:"Nv",thumbnail__overlay:"Ov",playIcon:"Pv",thumbnailVideo__broken:"Qv"};var D4e=({post:e,pageId:t,componentId:o,onRemovePostVideo:r,totalVideos:i})=>{var a,s;let n=rt({fileId:(a=e.data)==null?void 0:a.thumbnailFileId});return n?ie__default.createElement("div",{key:`post-${(s=e.data)==null?void 0:s.videoFileId.original}`,"data-video-height":String(i>2),className:Yo.thumbnail__wrapper},ie__default.createElement("img",{src:n,className:Yo.thumbnail,alt:"video thumbnail uploaded"}),ie__default.createElement(V,{"data-testid":`${t}/${o}/remove_thumbnail`,type:"reset",className:Yo.closeButton,onPress:()=>{var l,m;return ((m=(l=e.data)==null?void 0:l.videoFileId)==null?void 0:m.original)&&(r==null?void 0:r(e.data.videoFileId.original))}},ie__default.createElement(Zi,{className:Yo.closeIcon})),ie__default.createElement("div",{className:Yo.playIcon},ie__default.createElement($i,null))):null},Gg=({pageId:e="*",componentId:t="*",progress:o,removeFile:r,files:i,postVideos:n=[],onRemovePostVideo:a})=>{let[s,l]=useState(!1),m=g=>{var f;return To(g.file)?g.file.type==="video"||(((f=g.file.attributes)==null?void 0:f.mimeType)||"").startsWith("video/"):g.file instanceof File?g.file.type.startsWith("video/"):!1},c=i.length>0&&i.some(g=>m(g)),d=n.length>0,u=(c?i.filter(g=>m(g)).length:0)+(d?n.length:0);return !c&&!d?null:ie__default.createElement("div",{"data-images-amount":Math.min(u,3),className:Yo.thumbnail__container},n.map(g=>{var f;return ie__default.createElement(D4e,{key:(f=g.data)==null?void 0:f.videoFileId.original,post:g,pageId:e,componentId:t,onRemovePostVideo:a,totalVideos:u})}),i==null?void 0:i.filter(g=>m(g)).map(g=>{var f,C;return ie__default.createElement("div",{key:`file-${g.id}`,"data-video-height":String(u>2),className:Yo.thumbnail__wrapper},o[g.id]&&!To(g.file)?ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("img",{src:g.thumbnailVideo,className:Yo.thumbnail,alt:"thumbnail-video"}),ie__default.createElement("div",{className:Yo.thumbnail__overlay}),ie__default.createElement(V,{"data-testid":`${e}/${t}/remove_thumbnail`,type:"reset",className:Yo.closeButton,onPress:()=>r(g.file)},ie__default.createElement(Zi,{className:Yo.closeIcon})),ie__default.createElement("div",{className:Yo.icon__status},ie__default.createElement(zg,{progress:(f=o[g.id])!=null?f:100}))):g.errorText?ie__default.createElement(ie__default.Fragment,null,s||!g.thumbnailVideo?ie__default.createElement("div",{className:Yo.thumbnailVideo__broken}):ie__default.createElement("img",{src:g.thumbnailVideo,className:Yo.thumbnail,alt:"thumbnail-video",onError:()=>l(!0)}),ie__default.createElement("div",{className:Yo.thumbnail__overlay}),ie__default.createElement(V,{"data-testid":`${e}/${t}/remove_thumbnail`,type:"reset",className:Yo.closeButton,onPress:()=>r(g.file)},ie__default.createElement(Zi,{className:Yo.closeIcon})),ie__default.createElement("div",{className:Yo.icon__status},ie__default.createElement(Wi,null))):ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("img",{"data-testid":`${e}/${t}/video_thumbnail`,className:Yo.thumbnail,alt:To(g.file)?(C=g.file.attributes)==null?void 0:C.name:"video thumbnail",src:g.thumbnailVideo}),ie__default.createElement(V,{"data-testid":`${e}/${t}/remove_thumbnail`,type:"reset",className:Yo.closeButton,onPress:()=>r(g.file)},ie__default.createElement(Zi,{className:Yo.closeIcon})),ie__default.createElement("div",{className:Yo.playIcon},ie__default.createElement($i,null))))}))};var xP="like";var V4e="global-admin",{COMMUNITY_MODERATOR:U4e,CHANNEL_MODERATOR:H4e,MODERATOR:O4e,SUPER_MODERATOR:z4e}=I1,$g=e=>{if(!(e!=null&&e.length))return !1;let t=[U4e,H4e,O4e,z4e];return e.some(o=>t.includes(o))},Yu=e=>e!=null&&e.length?e.includes(V4e):!1;var Cy=({files:e,posts:t})=>{let o="6.75rem",r="8.5rem",i="11rem",n="14.5rem",a="18.1rem",[s,l]=useState(o),[m,c]=useState(!1),[d,u]=useState(!0),[g,f]=useState(!0),[C,y]=useState(!0),b=s==r||s==i||s==n||s==a,_=P=>{s===o&&P==="0px"||l(P);};return useEffect(()=>{c(K2());},[]),useEffect(()=>{!(e!=null&&e.length)&&!(t!=null&&t.length)?(u(!0),f(!0),y(!0)):t!=null&&t.some(P=>P.dataType===PostContentType.IMAGE)||e!=null&&e.some(P=>J2(P))?(u(!0),f(!1),y(!1)):t!=null&&t.some(P=>P.dataType===PostContentType.VIDEO)||e!=null&&e.some(P=>cV(P))?(u(!1),f(!0),y(!1)):(u(!1),f(!1),y(!0));},[e,t]),useEffect(()=>{let P=[m,d,g,C].filter(Boolean).length;P===4?l(a):P===3?l(n):P===2?l(i):P===1&&l(r);},[m,d,g,C]),{isShowDetailMediaAttachmentMenu:b,snap:s,isVisibleCamera:m,isVisibleImage:d,isVisibleVideo:g,isVisibleFile:C,HEIGHT_MEDIA_ATTACHMENT_MENU:o,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_1:r,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_2:i,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_3:n,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_4:a,handleSnapChange:_,showToastPosition:()=>{switch(s){case o:return "0";case r:return "1";case i:return "2";case n:return "3";default:return "3"}}}};var BO=e=>new Promise((t,o)=>{let r=document.createElement("video"),i=document.createElement("canvas"),n=i.getContext("2d");r.src=URL.createObjectURL(e);let a=()=>{r.currentTime=10;},s=()=>{try{i.width=r.videoWidth,i.height=r.videoHeight,n==null||n.drawImage(r,0,0,i.width,i.height);let m=i.toDataURL("image/png");t(m);}catch(m){o(m);}finally{r.removeEventListener("canplay",a),r.removeEventListener("seeked",s),r.removeEventListener("error",l),URL.revokeObjectURL(r.src);}},l=m=>{o(new Error(`Error loading video: ${m}`));};r.addEventListener("canplay",a),r.addEventListener("seeked",s),r.addEventListener("error",l),r.load();});var j4e=100,AO=1*1024*1024*1024,G4e=2*1024*1024*1024;function Qu(e){let{info:t}=Te(),[o,r]=useState({}),[i,n]=useState(!1),[a$1,s]=useState([]),[l$1,m]=useState([]),c=(_,x)=>{let P=x<j4e?x:100;r(I=>b(a({},I),{[_.id]:P}));},d=(_,x)=>{if(To(_)){let P=a$1.filter(I=>I.file.fileId!==_.fileId);s(P);}else if(x!==void 0){let P=a$1.filter((I,w)=>w!==x);s(P);}else {let P=a$1.filter(I=>I.file.name!==_.name);s(P);}},u=(_,x)=>l(this,null,function*(){if(!_.length)return;let P=x===FileType.CLIP?_.filter(T=>T.size>G4e):_.filter(T=>T.size>AO),I=_.filter(T=>T.size<=AO),w=P.map(T=>({file:T,id:v4$1(),status:"failed",errorText:"File size exceed the limit"}));if(w.length>0&&s(T=>[...T,...w]),I.length===0)return;let M=yield Promise.all(I.map(T=>l(this,null,function*(){let E={file:T,id:v4$1(),status:"selected"};if(T.type.includes(FileType.VIDEO)||T.type.includes(FileType.CLIP)){let N=yield BO(T);m(A=>[...A,{file:T,videoUrl:URL.createObjectURL(T),thumbnail:N}]),N&&(E.thumbnailVideo=N);}return E})));g(M);try{yield Promise.allSettled(M.map(T=>f(T,x))),r({});}catch(T){console.error("error >>",T);}finally{n(!1);}}),g=(_,x)=>{n(!0),s(P=>[...P,..._]),r(_.reduce((P,I)=>b(a({},P),{[I.id]:0}),{}));},f=(_,x)=>l(this,null,function*(){var w;let P=new FormData;P.append("files",_.file);let I=C(x!=null?x:_.file.type);try{let M=yield I(P,T=>{c(_,T);});((w=M==null?void 0:M.data)==null?void 0:w.length)>0&&s(T=>T.map(E=>E.id===_.id?b(a({},E),{file:M.data[0],status:"uploaded"}):E));}catch(M){s(T=>T.map(E=>E.id===_.id?b(a({},E),{status:"failed",errorText:"Failed to upload."}):E));}}),C=_=>_.includes(FileType.VIDEO)?(x,P)=>FileRepository.uploadVideo(x,void 0,P):_.includes(FileType.IMAGE)?FileRepository.uploadImage:_.includes(FileType.CLIP)?(x,P)=>FileRepository.uploadClip(x,void 0,P):FileRepository.uploadFile;return {files:a$1,progress:o,isLoading:i,videoThumbnail:l$1,uploadFile:u,removeFile:d,handleFileChange:(_,x,P)=>{let I=typeof P=="number"?a$1.length>0?(a$1==null?void 0:a$1.length)+_.length+P:(_==null?void 0:_.length)+P:_.length+a$1.length,w="";switch(x){case FileType.IMAGE:w="You\u2019ve reached the upload limit of 10 images. Any additional images will not be saved. ";break;case FileType.FILE:w="We\u2019ve uploaded the first 10 files you selected. Any additional files have been discarded.";break;case FileType.VIDEO:w="You\u2019ve reached the upload limit of 10 videos. Any additional videos will not be saved. ";break}if(I&&I>10){t({pageId:e,type:"info",title:"Maximum upload limit reached",content:w,okText:"OK"});return}_.length>0&&u(_);},handleAltTextChange:(_,x)=>{s(P=>P.map(I=>To(I.file)&&I.file.type==="image"&&I.file.fileId===_.fileId?b(a({},I),{file:b(a({},_),{altText:x})}):I));}}}var by=({ref:e})=>{let[t,o]=useState(void 0);return useEffect(()=>{if(e.current==null)return;let r=new ResizeObserver(i=>{for(let n of i)o(n.target.clientHeight);});return e.current&&r.observe(e.current),()=>{r.disconnect();}},[e.current]),t};var So={createPost:"ct",createPost__form:"ce",createPost__topBar:"lt",createPost__formContent:"f",createPost__input:"nt",createPost__placeholder:"Ge",createPost__mentionContainer:"mt",createPost__attachment:"ht",createPost__ctaWrapper:"gt",createPost__cta:"pt",createPost__mention:"Je",createPost__attachmentDrawer:"bt",createPost__attachmentDrawer__content:"Zv",createPost__notificationWrapper:"le",createPost__notification:"z",createPost__notificationToast:"_v",createPost_notificationIcon:"ew",createPost__attachmentDrawer__contentContainer:"Ke",createPost__clipPostThumbnaiContainer:"rw",createPost__clipPostThumbnail:"ut",createPost__clipPostPlayIconWrap:"aw",createPost__clipPostPlayIcon:"ow"};var LO=createContext({file:null,setFile:()=>{},isMuted:!1,setIsMuted:()=>{},isAspectFill:!0,setIsAspectFill:()=>{},clipThumbnail:null,setClipThumbnail:()=>{}}),Pl=()=>useContext(LO),FO=({children:e})=>{let[t,o]=useState(null),[r,i]=useState(!1),[n,a]=useState(!0),[s,l]=useState(null),m={file:t,setFile:o,isMuted:r,setIsMuted:i,isAspectFill:n,setIsAspectFill:a,clipThumbnail:s,setClipThumbnail:l};return ie__default.createElement(LO.Provider,{value:m},e)};var Ku=e=>ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 25 24"},e),ie__default.createElement("path",{fill:"white",d:"M19.531 10.809a1.71 1.71 0 010 2.918L7.156 21.039c-1.125.668-2.531-.14-2.531-1.477V4.938c0-1.44 1.512-2.039 2.531-1.44l12.375 7.312z"}));function TP({community:e,targetType:t,targetId:o,isClipPost:r=!1}){let i="post_composer_page",n=useRef(null),a$1=useRef(null),s=useRef(null),{currentUserId:l$1}=Xt(),{user:m}=qe({userId:l$1}),{handleSubmit:c}=useForm(),{info:d}=Te(),{isDesktop:u}=le(),{confirm:g}=Te(),{onBack:f,prevPage:C,prev2Page:y}=Y(),{AmityPostComposerPageBehavior:b$1}=we(),{prependItem:_}=Fn(),{themeStyles:x}=ue({pageId:i}),P=by({ref:s}),{moderators:I}=Lo({communityId:e==null?void 0:e.communityId}),{closePopup:w}=Se(),{online:M}=useNetworkState(),{files:T,progress:E,isLoading:N,removeFile:A,handleFileChange:D,handleAltTextChange:G}=Qu(i),{file:H,setFile:$,clipThumbnail:j,isMuted:O,isAspectFill:z,setIsMuted:k,setIsAspectFill:F}=Pl(),[re,W]=useState(!1),[ne,te]=useState(!1),[Q,me]=useState(),[X,q]=useState({text:"",mentioned:[],mentionees:[{type:"user",userIds:[""]}],attachments:[{fileId:"",type:"image"}]}),{HEIGHT_MEDIA_ATTACHMENT_MENU:ae,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_1:Ee,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_2:J,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_3:R,snap:be,isShowDetailMediaAttachmentMenu:xe,isVisibleCamera:Xe,isVisibleImage:Qe,isVisibleVideo:ht,handleSnapChange:Zt,showToastPosition:Bt}=Cy({files:T}),{mutate:so}=useMutation({mutationFn:Re=>l(this,null,function*(){return PostRepository.createPost(Re)}),onMutate:()=>{W(!0),te(!1),me(void 0);},onSuccess:Re=>{let jt=Re.data,Gt=(I||[]).find($t=>$t.userId===jt.postedUserId)!=null;o||_(jt),(e!=null&&e.needApprovalOnPostCreation||(e==null?void 0:e.postSetting)===CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED)&&!Gt&&!Yu(m==null?void 0:m.roles)?d({pageId:i,title:"Posts sent for review",content:"Your post has been submitted to the pending list. It will be published once approved by the community moderator.",okText:"OK"}):_(jt),k(!1),F(!0),W(!1),ve();},onError:Re=>{W(!1),te(!0),$e(Re);}});function lo(){return l(this,null,function*(){var Gt;if(((Gt=X.text)==null?void 0:Gt.length)>5e4){me("You have reached the maximum of 50,000 characters in a post.");return}let Re=r?[{fileId:H&&To(H)?H.fileId:"",type:"clip",displayMode:z?"fill":"fit",isMuted:O}]:T.map(({file:$t})=>({fileId:$t.fileId,type:$t.type})),jt={targetId:o,targetType:t,data:{text:X.text},metadata:{mentioned:X.mentioned},mentionees:X.mentionees,attachments:Re};so(jt);})}let ve=()=>{$(null),Ce(),u&&w();},$e=Re=>{Re.message.includes(xr.CONTAIN_BLOCKED_WORD)?me("Your post wasn't posted because it contains a blocked word."):Re.message.includes(xr.NOT_INCLUDE_WHITELIST_LINK)?me("Your post wasn't posted because it contains a link that's not allowed."):me("Failed to create post. Please try again.");},pe=Re=>{q(jt=>b(a({},jt),{mentioned:Re.mentioned,text:Re.text,mentionees:Re.mentionees}));},Me=()=>{if(Ht)return f();g({pageId:i,type:"confirm",title:"Discard this post?",content:"The post will be permanently discarded. It cannot be undone.",onOk:()=>{$(null),Ce();},okText:"Discard",cancelText:"Keep editing"});},K=ie__default.createElement("div",{className:So.createPost__notificationWrapper,"data-item-position":be===ae},(re||!M)&&ie__default.createElement(Ur,{icon:ie__default.createElement(Ia,null),content:M?"Posting...":"Waiting for network...",alignment:"fixed"}),(ne||Q)&&ie__default.createElement(Ur,{duration:3e3,content:Q||"Failed to create post. Please try again.",alignment:"fixed",icon:ie__default.createElement(Co,{className:So.createPost_notificationIcon}),onClose:()=>{me(void 0),te(!1);}})),Ce=()=>{var Re;return (C==null?void 0:C.type)==="SelectPostTargetPage"||(y==null?void 0:y.type)==="SelectPostTargetPage"?(Re=b$1==null?void 0:b$1.goToSocialHomePage)==null?void 0:Re.call(b$1):(y==null?void 0:y.type)==="UserProfilePage"||(y==null?void 0:y.type)==="CommunityProfilePage"?f(2):f()},he=X.text.length>0||T.length>0||H!==void 0,Pe=T.some(Re=>Re.errorText!==void 0),Ht=X.text.length===0&&T.length===0&&H==null,Ii=!Ht&&he&&!Pe&&!re&&M&&!N,zt=()=>{(re||!M)&&(v.Body,Bt(),Ia);},Gi=()=>{(ne||Q)&&(v.Body,Bt(),So.createPost__notificationToast);};return ie__default.createElement("div",{className:So.createPost,style:x},u&&K,ie__default.createElement("form",{className:So.createPost__form,onSubmit:c(lo),"data-from-media":be==ae},ie__default.createElement("div",{className:So.createPost__topBar},ie__default.createElement(ot,{pageId:i,onPress:Me}),ie__default.createElement(Mo,{pageId:i,community:e}),ie__default.createElement(yy,{pageId:i,variant:"text",isDisabled:!Ii})),r&&ie__default.createElement("div",{className:So.createPost__clipPostThumbnaiContainer},ie__default.createElement("img",{"data-aspect-fill":z,src:j!=null?j:void 0,alt:"thumbnail clip",className:So.createPost__clipPostThumbnail}),ie__default.createElement("div",{className:So.createPost__clipPostPlayIconWrap},ie__default.createElement(Ku,{className:So.createPost__clipPostPlayIcon}))),ie__default.createElement("div",{className:So.createPost__formContent},ie__default.createElement(qc,{pageId:i,componentId:r?"clipPost":void 0,onChange:pe,communityId:o,className:So.createPost__input,dataValue:{data:{text:X.text}},placeholderClassName:So.createPost__placeholder,mentionContainer:u?null:a$1.current,mentionContainerClassName:So.createPost__mentionContainer}),ie__default.createElement(jg,{files:T,pageId:i,progress:E,removeFile:A,onAltTextChange:G}),ie__default.createElement(Gg,{files:T,pageId:i,progress:E,removeFile:A})),ie__default.createElement("div",{className:So.createPost__attachment},ie__default.createElement(X1,{pageId:i,isVisibleCamera:Xe,isVisibleImage:Qe,isVisibleVideo:ht,totalMedia:T.length,onVideoFileChange:Re=>D(Re,FileType.VIDEO),onImageFileChange:Re=>D(Re,FileType.IMAGE)})),ie__default.createElement("div",{className:So.createPost__ctaWrapper},ie__default.createElement(yy,{variant:"fill",pageId:i,className:So.createPost__cta,isDisabled:!Ii})),ie__default.createElement("div",{ref:a$1,className:So.createPost__mention,"data-testid":`${i}/mention_text_input_options`,style:{"--asc-mention-bottom":`${P!=null?P:0}px`}})),!u&&!r&&ie__default.createElement("div",{className:So.createPost__attachmentDrawer},ie__default.createElement("div",{ref:n}),n.current?_U.createPortal(ie__default.createElement(Drawer.Root,{modal:!1,open:!0,activeSnapPoint:be,snapPoints:[ae,Ee,J,R],setActiveSnapPoint:Re=>{typeof Re=="string"&&Zt(Re);}},ie__default.createElement(Drawer.Portal,{container:n.current},ie__default.createElement(Drawer.Content,{className:So.createPost__attachmentDrawer__content},ie__default.createElement("div",{ref:s,className:So.createPost__attachmentDrawer__contentContainer,"data-show-detail-media-attachment":xe},xe?ie__default.createElement(Lu,{pageId:i,isVisibleCamera:Xe,isVisibleImage:Qe,isVisibleVideo:ht,totalMedia:T.length,onImageFileChange:Re=>D(Re,FileType.IMAGE),onVideoFileChange:Re=>D(Re,FileType.VIDEO)}):ie__default.createElement(X1,{pageId:i,isVisibleCamera:Xe,isVisibleImage:Qe,isVisibleVideo:ht,totalMedia:T.length,onImageFileChange:Re=>D(Re,FileType.IMAGE),onVideoFileChange:Re=>D(Re,FileType.VIDEO)}))))),n.current):null,zt(),Gi()),r&&ie__default.createElement(ie__default.Fragment,null,zt(),Gi()))}function Iy(r){var i=r,{pageId:e="*",componentId:t="*"}=i,o=d(i,["pageId","componentId"]);let n="edit_post_button",{config:a$1,isExcluded:s,themeStyles:l,accessibilityId:m}=S({pageId:e,componentId:t,elementId:n});return s?null:ie__default.createElement(oe,a({type:"submit",style:l,"data-testid":m},o),a$1.text)}var VO={editPostTitle:"ft"};function qg({pageId:e="*",componentId:t="*"}){let o="edit_post_title",{config:r,isExcluded:i,themeStyles:n,accessibilityId:a}=S({pageId:e,componentId:t,elementId:o});return i?null:ie__default.createElement("div",{"data-testid":a,style:n,className:VO.editPostTitle},r.text)}var l6e=e=>{let[t,o]=useState([]);return useEffect(()=>{function r(){return l(this,null,function*(){if(!e||(e==null?void 0:e.length)===0)return;let i=yield PostRepository.getPostByIds(e);o(i.data);})}r();},[e]),t},UO=l6e;var Dt={editPost:"vt",editPost__form:"Ne",editPost__topBar:"wt",editPost__formContent:"xt",editPost__input:"yt",editPost__placeholder:"Oe",editPost__mentionContainer:"kt",editPost__attachment:"jt",editPost__ctaWrapper:"zt",editPost__cta:"Xt",editPost__mention:"Pe",editPost__notificationWrapper:"Yt",editPost__notification:"p",editPost__notificationToast:"tw",editPost__notificationIcon:"iw",editPost__notificationContainer:"It",editPost__attachmentDrawer:"At",editPost__attachmentDrawer__content:"sw",editPost_notificationIcon:"dw",editPost__attachmentDrawer__contentContainer:"Qe",editPost__clipPostThumbnaiContainer:"cw",editPost__clipPostThumbnail:"lw",editPost__clipPostThumbnailBroken:"nw",editPost__clipPostPlayIconWrap:"mw",editPost__clipPostPlayIcon:"hw"};function NP({post:e}){var rm,ee,fe,bt,wi,$d,a6;let t="post_composer_page",o=useRef(null),r=useRef(null),i=useRef(null),{isDesktop:n}=le(),{themeStyles:a$1}=ue({pageId:t}),{closePopup:s}=Se(),l$1=by({ref:i}),{onBack:m}=Y(),{confirm:c,info:d}=Te(),{updateItem:u,updateGlobalFeaturedPosts:g}=Fn(),{files:f,progress:C,isLoading:y,removeFile:b$1,handleFileChange:_,handleAltTextChange:x}=Qu(t),P=UO((e==null?void 0:e.children)||[]),{currentUserId:I}=Xt(),{user:w}=qe({userId:I}),M=(e==null?void 0:e.targetType)==="community"&&!!(e!=null&&e.targetId),{community:T}=Ct({communityId:e==null?void 0:e.targetId,shouldCall:M}),{moderators:E}=Lo({communityId:e==null?void 0:e.targetId,shouldCall:M}),[N,A]=useState(P),[D,G]=useState(!1),{HEIGHT_MEDIA_ATTACHMENT_MENU:H,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_1:$,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_2:j,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_3:O,snap:z,isShowDetailMediaAttachmentMenu:k,isVisibleCamera:F,isVisibleImage:re,isVisibleVideo:W,handleSnapChange:ne,showToastPosition:te}=Cy({files:f,posts:N}),[Q,me]=useState({text:(ee=(rm=e==null?void 0:e.data)==null?void 0:rm.text)!=null?ee:"",mentioned:((fe=e.metadata)==null?void 0:fe.mentioned)||[],mentionees:e.mentionees,attachments:[{fileId:"",type:"image"}]}),X=useNetworkState(),[q,ae]=useState(),[Ee,J]=useState([]),[R,be]=useState([]),[xe,Xe]=useState([]),[Qe,ht]=useState(!1),[Zt,Bt]=useState(!1),so=()=>useMutation({mutationFn:nt=>l(this,null,function*(){return yield PostRepository.editPost(e.postId,nt)}),onMutate:()=>{ht(!0),Bt(!1),ae(void 0);},onSuccess:nt=>{ht(!1),n?s():m(),u(nt.data),g(nt.data);},onError:nt=>{if(ht(!1),Bt(!0),nt.message.includes(xr.CONTAIN_BLOCKED_WORD)){ae("Your post wasn't posted because it contains a blocked word.");return}else if(nt.message.includes(xr.NOT_INCLUDE_WHITELIST_LINK)){ae("Your post wasn't posted because it contains a link that's not allowed.");return}else {ae("Failed to post.");return}}}),{mutateAsync:lo,isPending:ve}=so(),{handleSubmit:$e}=useForm();useEffect(()=>{A(P);let nt=P.filter(Er=>Er.dataType==="image");J(nt);let pi=P.filter(Er=>Er.dataType==="video");be(pi);let or=P.filter(Er=>Er.dataType==="clip");Xe(or);},[P]);let pe=useCallback(nt=>{J(pi=>pi.filter(or=>{var Er;return ((Er=or==null?void 0:or.data)==null?void 0:Er.fileId)!==nt})),A(pi=>pi.filter(or=>{var Er;return ((Er=or==null?void 0:or.data)==null?void 0:Er.fileId)!==nt}));},[]),Me=useCallback(nt=>{be(pi=>pi.filter(or=>{var Er;return ((Er=or==null?void 0:or.data)==null?void 0:Er.videoFileId.original)!==nt})),A(pi=>pi.filter(or=>{var Er;return ((Er=or==null?void 0:or.data)==null?void 0:Er.videoFileId.original)!==nt}));},[]),K=()=>{var pi,or;let nt=[];if(!zt){let Er=Ee.map(gn=>{var Z5;return {fileId:(Z5=gn==null?void 0:gn.data)==null?void 0:Z5.fileId,type:PostContentType.IMAGE}}),Tte=R.map(gn=>{var Z5;return {fileId:(Z5=gn==null?void 0:gn.data)==null?void 0:Z5.videoFileId.original,type:PostContentType.VIDEO}}),Mte=f.map(gn=>({fileId:To(gn.file)?gn.file.fileId:gn.id,type:To(gn.file)?gn.file.type:gn.file.type.startsWith("image/")?PostContentType.IMAGE:PostContentType.VIDEO}));nt.push(...Er,...Tte,...Mte);}Q&&lo(zt?{data:{text:Q.text},metadata:{mentioned:(pi=Q.mentioned)!=null?pi:[]},mentionees:Q.mentionees}:{data:{text:Q.text},metadata:{mentioned:(or=Q.mentioned)!=null?or:[]},mentionees:Q.mentionees,attachments:nt});},Ce=()=>{var pi;if((pi=Q.text)!=null&&pi.length&&Q.text.length>5e4){ae("You have reached maximum 50,000 characters in a post.");return}let nt=(E||[]).find(or=>or.userId===I)!=null;M&&(T!=null&&T.needApprovalOnPostCreation||(T==null?void 0:T.postSetting)===CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED)&&!nt&&!V8(w==null?void 0:w.roles)?c({pageId:t,title:"Post will be sent for review",content:"Posting in this community requires approval. Your edited post will be published once approved by the community moderator.",okText:"OK",cancelText:"Cancel",onOk:()=>{K();}}):K();},he=nt=>{me(pi=>b(a({},pi),{mentioned:nt.mentioned,text:nt.text,mentionees:nt.mentionees}));},Pe=()=>{if(Re)return m();c({pageId:t,type:"confirm",title:"Discard this post?",content:"The post will be permanently discarded. It cannot be undone.",onOk:()=>{m();},okText:"Discard",cancelText:"Keep editing"});},Ht=(f&&(f==null?void 0:f.length)||0)+(Ee&&(Ee==null?void 0:Ee.length)||0)+(R&&(R==null?void 0:R.length)||0),Ii=ie__default.createElement("div",{className:Dt.editPost__notificationWrapper,"data-item-position":z===H},(Qe||!X)&&ie__default.createElement(Ur,{icon:ie__default.createElement(Ia,null),content:X?"Posting...":"Waiting for network...",alignment:"fixed"}),(Zt||q)&&ie__default.createElement(Ur,{duration:3e3,content:q||"Failed to edit post. Please try again.",alignment:"fixed",icon:ie__default.createElement(Co,{className:Dt.editPost__notificationIcon}),onClose:()=>{ae(void 0),Bt(!1);}})),zt=xe.length>0,Gi=f.length>0||P.length!==N.length,Re=E1(e)&&((bt=e.data)==null?void 0:bt.text)===Q.text&&!Gi,jt=!(Q.text.trim().length>0||f.length>0||Ee.length>0||R.length>0||N.length>0),Gt=!X||Re||jt||y||ve||Zt||f.some(nt=>!To(nt.file)),$t=xe.length>0?(wi=xe[0].data)==null?void 0:wi.thumbnailFileId:null,St=rt({fileId:$t,imageSize:"medium"});Ir(e.postId);return ie__default.createElement("div",{className:Dt.editPost,style:a$1},n&&Ii,ie__default.createElement("form",{className:Dt.editPost__form,onSubmit:$e(Ce),"data-from-media":z==H},ie__default.createElement("div",{className:Dt.editPost__topBar},ie__default.createElement(ot,{pageId:t,onPress:Pe}),ie__default.createElement(qg,{pageId:t}),ie__default.createElement(Iy,{variant:"text",pageId:t,isDisabled:Gt})),zt&&ie__default.createElement("div",{className:Dt.editPost__clipPostThumbnaiContainer},St&&!D?ie__default.createElement("img",{src:St!=null?St:void 0,alt:"thumbnail clip",className:Dt.editPost__clipPostThumbnail,onError:()=>G(!0)}):ie__default.createElement("div",{className:Dt.editPost__clipPostThumbnailBroken}),ie__default.createElement("div",{className:Dt.editPost__clipPostPlayIconWrap},ie__default.createElement(Ku,{className:Dt.editPost__clipPostPlayIcon}))),ie__default.createElement("div",{className:Dt.editPost__formContent},ie__default.createElement(qc,{pageId:t,onChange:he,componentId:zt?"clipPost":void 0,className:Dt.editPost__input,placeholderClassName:Dt.editPost__placeholder,mentionContainer:n?null:o.current,mentionContainerClassName:Dt.editPost__mentionContainer,communityId:e.targetType==="community"?e.targetId:void 0,dataValue:{mentionees:e.mentionees,data:{text:(($d=e==null?void 0:e.data)==null?void 0:$d.text)||""},metadata:{mentioned:((a6=e.metadata)==null?void 0:a6.mentioned)||[]}}}),ie__default.createElement(jg,{files:f,pageId:t,progress:C,removeFile:b$1,postImages:Ee,onAltTextChange:x,onRemovePostImage:pe}),ie__default.createElement(Gg,{files:f,pageId:t,progress:C,removeFile:b$1,postVideos:R,onRemovePostVideo:Me})),!zt&&ie__default.createElement("div",{className:Dt.editPost__attachment},ie__default.createElement(X1,{pageId:t,totalMedia:Ht,isVisibleCamera:F,isVisibleImage:re,isVisibleVideo:W,onVideoFileChange:nt=>_(nt,FileType.VIDEO,N.length),onImageFileChange:nt=>_(nt,FileType.IMAGE,N.length)})),ie__default.createElement("div",{className:Dt.editPost__ctaWrapper},ie__default.createElement(Iy,{variant:"fill",pageId:t,className:Dt.editPost__cta,onPress:()=>$e(Ce),isDisabled:Gt})),ie__default.createElement("div",{ref:o,className:Dt.editPost__mention,"data-testid":`${t}/mention_text_input_options`,style:{"--asc-mention-bottom":`${l$1!=null?l$1:0}px`}})),!n&&!zt&&ie__default.createElement("div",{className:Dt.editPost__attachmentDrawer},ie__default.createElement("div",{ref:r}),r.current?_U.createPortal(ie__default.createElement(Drawer.Root,{modal:!1,open:!0,activeSnapPoint:z,snapPoints:[H,$,j,O],setActiveSnapPoint:nt=>{typeof nt=="string"&&ne(nt);}},ie__default.createElement(Drawer.Portal,{container:r.current},ie__default.createElement(Drawer.Content,{className:Dt.editPost__attachmentDrawer__content},ie__default.createElement("div",{ref:i,className:Dt.editPost__attachmentDrawer__contentContainer,"data-show-detail-media-attachment":k},k?ie__default.createElement(Lu,{pageId:t,isVisibleCamera:F,isVisibleImage:re,isVisibleVideo:W,totalMedia:Ht,onImageFileChange:nt=>_(nt,FileType.IMAGE,N.length),onVideoFileChange:nt=>_(nt,FileType.VIDEO,N.length)}):ie__default.createElement(X1,{pageId:t,isVisibleCamera:F,isVisibleImage:re,isVisibleVideo:W,totalMedia:Ht,onImageFileChange:nt=>_(nt,FileType.IMAGE,N.length),onVideoFileChange:nt=>_(nt,FileType.VIDEO,N.length)}))))),r.current):null,(Qe||!X)&&ie__default.createElement(v.Body,{className:Dt.editPost__notification,"data-show-detail-media-attachment":te(),"data-isclip":zt},ie__default.createElement(Ur,{className:Dt.editPost__notificationToast,content:X?"Posting...":"Waiting for network...",icon:ie__default.createElement(Ia,null),alignment:"fixed"})),(Zt||q)&&ie__default.createElement(v.Body,{className:Dt.editPost__notification,"data-show-detail-media-attachment":te(),"data-isclip":zt},ie__default.createElement(Ur,{content:q||"Failed to edit post. Please try again.",icon:ie__default.createElement(Co,{className:Dt.editPost_notificationIcon}),alignment:"fixed",duration:3e3,className:Dt.editPost__notificationToast,onClose:()=>{ae(void 0),Bt(!1);}}))),ie__default.createElement("div",{className:Dt.editPost__notificationContainer},(ve||!X)&&ie__default.createElement("div",{className:Dt.editPost__notification,"data-show-detail-media-attachment":te(),"data-isclip":zt},ie__default.createElement(Ur,{className:Dt.editPost__notificationToast,content:X?"Posting...":"Waiting for network...",icon:ie__default.createElement(Ia,null),alignment:"fixed"})),q&&ie__default.createElement("div",{className:Dt.editPost__notification,"data-isclip":zt,"data-show-detail-media-attachment":te()},ie__default.createElement(Ur,{content:q||"Failed to edit post. Please try again.",icon:ie__default.createElement(Co,{className:Dt.editPost__notificationIcon}),alignment:"fixed",duration:3e3,className:Dt.editPost__notificationToast,onClose:()=>{ae(void 0),Bt(!1);}}))))}var h6e=e=>e.mode==="create";function ki(e){if(h6e(e)){let{targetId:t,targetType:o,community:r,isClipPost:i}=e;return ie__default.createElement(TP,{mode:"create",targetId:t,targetType:o,community:r,isClipPost:i})}else {let{post:t,isClipPost:o}=e;return ie__default.createElement(NP,{mode:"edit",post:t,isClipPost:o})}}var C6e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M14.8125 6.0625C16.043 6.0625 17.3789 5.64062 18.6445 5.07812C19.7344 4.62109 21 5.42969 21 6.625V15.0625C21 15.6602 20.6836 16.1875 20.2266 16.5039C19.2773 17.1016 17.7656 17.875 15.6914 17.875C13.3008 17.875 11.7188 16.75 9.99609 16.75C8.02734 16.75 6.83203 17.1719 5.53125 17.7695V20.6875C5.53125 21.0039 5.25 21.25 4.96875 21.25H4.40625C4.08984 21.25 3.84375 21.0039 3.84375 20.6875V6.41406C3.31641 6.13281 3 5.57031 3 4.9375C3 3.98828 3.80859 3.21484 4.79297 3.28516C5.60156 3.32031 6.26953 3.95312 6.33984 4.76172C6.33984 4.83203 6.33984 4.90234 6.33984 4.9375C6.33984 5.14844 6.33984 5.32422 6.26953 5.5C7.04297 5.18359 7.99219 4.9375 9.11719 4.9375C11.5078 4.9375 13.0898 6.0625 14.8125 6.0625ZM19.3125 15.0625V6.625C18.1875 7.15234 16.3242 7.75 14.8125 7.75C12.7031 7.75 11.2266 6.625 9.11719 6.625C7.64062 6.625 6.26953 7.22266 5.53125 7.75V15.9062C6.62109 15.4141 8.48438 15.0625 9.99609 15.0625C12.1055 15.0625 13.582 16.1875 15.6914 16.1875C17.168 16.1875 18.5391 15.625 19.3125 15.0625Z"})),Ea=C6e;var Dn=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M19.3125 6.0625C19.5938 6.0625 19.875 6.34375 19.875 6.625V7.1875C19.875 7.50391 19.5938 7.75 19.3125 7.75H18.75L17.9766 19.668C17.9414 20.582 17.2031 21.25 16.2891 21.25H7.67578C6.76172 21.25 6.02344 20.582 5.98828 19.668L5.25 7.75H4.6875C4.37109 7.75 4.125 7.50391 4.125 7.1875V6.625C4.125 6.34375 4.37109 6.0625 4.6875 6.0625H7.57031L8.76562 4.09375C9.04688 3.60156 9.60938 3.25 10.207 3.25H13.7578C14.3555 3.25 14.918 3.60156 15.1992 4.09375L16.3945 6.0625H19.3125ZM10.207 4.9375L9.53906 6.0625H14.4258L13.7578 4.9375H10.207ZM16.2891 19.5625L17.0273 7.75H6.9375L7.67578 19.5625H16.2891Z"}));var Ri={postMenu:"Mt",postMenu__item:"v",postMenu__editPost__text:"gw",postMenu__editPost__icon:"pw",postMenu__reportPost__text:"bw",postMenu__reportPost__icon:"uw",postMenu__closePoll__icon:"fw",postMenu__closePoll__text:"vw",postMenu__deletePost__text:"ww",postMenu__deletePost__icon:"xw"};var b6e=e=>Cn({fetcher:PollRepository.getPoll,params:e,shouldCall:!!e}),GO=b6e;var ZO=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M9.91992 11.9688V15.9062C9.91992 16.3984 9.5332 16.75 9.07617 16.75C8.58398 16.75 8.23242 16.3984 8.23242 15.9062V11.9688C8.23242 11.5117 8.58398 11.125 9.07617 11.125C9.5332 11.125 9.91992 11.5117 9.91992 11.9688ZM11.6074 8.59375C11.6074 8.13672 11.959 7.75 12.4512 7.75C12.9082 7.75 13.2949 8.13672 13.2949 8.59375V15.9062C13.2949 16.3984 12.9082 16.75 12.4512 16.75C11.959 16.75 11.6074 16.3984 11.6074 15.9062V8.59375ZM16.6699 14.2188V15.9062C16.6699 16.3984 16.2832 16.75 15.8262 16.75C15.334 16.75 14.9824 16.3984 14.9824 15.9062V14.2188C14.9824 13.7617 15.334 13.375 15.8262 13.375C16.2832 13.375 16.6699 13.7617 16.6699 14.2188ZM4.57617 6.625C4.57617 5.39453 5.56055 4.375 6.82617 4.375H18.0762C19.3066 4.375 20.3262 5.39453 20.3262 6.625V17.875C20.3262 19.1406 19.3066 20.125 18.0762 20.125H6.82617C5.56055 20.125 4.57617 19.1406 4.57617 17.875V6.625ZM6.26367 6.625V17.875C6.26367 18.1914 6.50977 18.4375 6.82617 18.4375H18.0762C18.3574 18.4375 18.6387 18.1914 18.6387 17.875V6.625C18.6387 6.34375 18.3574 6.0625 18.0762 6.0625H6.82617C6.50977 6.0625 6.26367 6.34375 6.26367 6.625Z",fill:"currentColor"}));var Ru=({post:e,pageId:t="*",componentId:o="*",onConfirmEditPost:r,onCloseMenu:i,onPostDeleted:n})=>{var W,ne;let{success:a,info:s}=ce(),{isDesktop:l$1}=le(),{openPopup:m}=Se(),{post:c}=Ir((W=e.children)==null?void 0:W[0]),{item:d}=GO((ne=c==null?void 0:c.data)==null?void 0:ne.pollId),{client:u}=Ne(),g=useMemo(()=>(c==null?void 0:c.dataType)==="liveStream",[c==null?void 0:c.dataType]),f=useMemo(()=>(e==null?void 0:e.targetType)==="community",[e==null?void 0:e.targetType]),{community:C}=Ct({communityId:e==null?void 0:e.targetId,shouldCall:f}),[y,b]=useState(!1),{isCommunityModerator:_,isOwner:x}=fy({post:e,community:C}),{AmityPostContentComponentBehavior:P}=we(),{showEditPostButton:I,showDeletePostButton:w,showReportPostButton:M}=useMemo(()=>_?x?{showEditPostButton:!0,showDeletePostButton:!0,showReportPostButton:!1}:{showEditPostButton:!1,showDeletePostButton:!0,showReportPostButton:!0}:x?{showEditPostButton:!0,showDeletePostButton:!0,showReportPostButton:!1}:cH(u,e==null?void 0:e.targetType)?{showEditPostButton:!1,showDeletePostButton:!0,showReportPostButton:!0}:{showEditPostButton:!1,showDeletePostButton:!1,showReportPostButton:!0},[_,x,u,e]),T=useMemo(()=>!!(d&&d.status==="open"&&x),[x,d]),E=useMemo(()=>!!d,[d]),{isFlaggedByMe:N,isLoading:A,mutateUnReportPost:D}=h8({post:e,reasonReport:ContentFlagReasonEnum.Others,isFlaggable:M,onUnreportSuccess:()=>{a({content:"Post unreported."}),i();},onUnreportError:()=>{s({content:"Failed to unreport post. Please try again.",alignment:l$1?"fullscreen":"withSidebar"}),i();}}),{confirm:G}=Te(),{mutateAsync:H}=useMutation({networkMode:"always",mutationFn:()=>l(void 0,null,function*(){return i(),PostRepository.softDeletePost(e.postId)}),onSuccess:()=>{a({content:"Post deleted."}),n==null||n(e);},onError:()=>{s({content:"Failed to delete post. Please try again.",alignment:l$1?"fullscreen":"withSidebar"});}}),{mutateAsync:$}=useMutation({networkMode:"always",mutationFn:()=>l(void 0,null,function*(){if(d)return PollRepository.closePoll(d.pollId)}),onSuccess:()=>{a({content:"Poll closed."}),n==null||n(e);},onError:()=>{s({content:"Oops, something went wrong."});}}),j=()=>{i(),G({title:"Delete post",content:"This post will be permanently deleted.",cancelText:"Cancel",okText:"Delete",onOk:()=>{if(!navigator.onLine){s({content:"Oops, something went wrong."});return}H();},pageId:t,componentId:o});},O=()=>{var te;if(l$1)return i(),m({pageId:t,view:"desktop",isDismissable:!1,header:ie__default.createElement(qg,{pageId:"post_composer_page"}),children:ie__default.createElement(ki,{mode:"edit",post:e}),onClose:({close:Q})=>{G({onOk:Q,type:"confirm",okText:"Discard",cancelText:"Keep editing",title:"Discard this post?",pageId:"post_composer_page",content:"The post will be permanently discarded. It cannot be undone."});}});i(),(te=P==null?void 0:P.goToPostComposerPage)==null||te.call(P,{mode:"edit",post:e});},z=()=>{r?r({onConfirm:O}):O();},k=()=>{i(),G({title:"Close poll?",content:"The Poll duration you've set will be ignored and your poll will be closed immediately.",cancelText:"Cancel",okText:"Close poll",onOk:()=>{if(!navigator.onLine){s({content:"Oops, something went wrong."});return}$();},pageId:t,componentId:o});},F=()=>{i(),D();},re=()=>{l$1?(i(),m({id:"report_post_reason",pageId:t,view:"desktop",isDismissable:!1,children:ie__default.createElement(il,{pageId:t,componentId:o,onCloseMenu:i,post:e,showReportPostButton:M})})):b(!0);};return ie__default.createElement("div",{className:Ri.postMenu},!y&&T&&ie__default.createElement(V,{"data-testid":`${t}/${o}/close_poll_button`,className:Ri.postMenu__item,onPress:k},ie__default.createElement(ZO,{className:Ri.postMenu__closePoll__icon}),ie__default.createElement(v.BodyBold,{className:Ri.postMenu__reportPost__text},"Close poll")),!y&&M&&!A?ie__default.createElement(V,{"data-testid":`${t}/${o}/report_post_button`,className:Ri.postMenu__item,onPress:()=>N?F():re()},N?ie__default.createElement(pu,{className:Ri.postMenu__reportPost__icon}):ie__default.createElement(Ea,{className:Ri.postMenu__reportPost__icon}),ie__default.createElement(v.BodyBold,{className:Ri.postMenu__reportPost__text},N?"Unreport post":"Report post")):null,!y&&I&&!E&&!g?ie__default.createElement(V,{"data-testid":`${t}/${o}/edit_post`,className:Ri.postMenu__item,onPress:z},ie__default.createElement($1,{className:Ri.postMenu__editPost__icon}),ie__default.createElement(v.BodyBold,{className:Ri.postMenu__editPost__text},"Edit post")):null,!y&&w?ie__default.createElement(V,{"data-testid":`${t}/${o}/delete_post`,className:Ri.postMenu__item,onPress:j},ie__default.createElement(Dn,{className:Ri.postMenu__deletePost__icon}),ie__default.createElement(v.BodyBold,{className:Ri.postMenu__deletePost__text},"Delete post")):null,y&&!l$1&&ie__default.createElement(il,{pageId:t,componentId:o,onCloseMenu:i,post:e,showReportPostButton:M}))};var Ty=({post:e,community:t})=>{let{currentUserId:o}=Ne(),r=useMemo(()=>(e==null?void 0:e.targetType)==="community"&&(e==null?void 0:e.targetId)===(t==null?void 0:t.communityId),[e==null?void 0:e.targetType,t==null?void 0:t.communityId]),{moderators:i}=Lo({communityId:t==null?void 0:t.communityId,shouldCall:r}),n=useMemo(()=>r?i.some(s=>s.userId===(e==null?void 0:e.postedUserId)):!1,[i,r,e==null?void 0:e.postedUserId]),a=(e==null?void 0:e.postedUserId)===o;return {isCommunityModerator:n,isOwner:a}};var YO=({threshold:e,elementRef:t})=>{let[o,r]=useState(!1);return useEffect(()=>{if(!t.current)return;let i=new IntersectionObserver(n=>{n.forEach(a=>{let s=a.isIntersecting;r(s);});},{threshold:e});return i.observe(t.current),()=>{i.disconnect();}},[e,t]),{isVisible:o}};var QO={announcementBadge:"yw"};var kP={featuredIcon__background:"kw",featuredIcon__textColor:"jw"};var KO=r=>{var i=r,{backgroundColor:e,textColor:t}=i,o=d(i,["backgroundColor","textColor"]);return ie__default.createElement("svg",a({width:"73",height:"26",viewBox:"0 0 73 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o),ie__default.createElement("path",{d:"M0 0H69C71.2091 0 73 1.79086 73 4V22C73 24.2091 71.2091 26 69 26H0V0Z",className:kP.featuredIcon__background,fill:e}),ie__default.createElement("path",{d:"M9.12988 18V8.84033H14.9697V10.2178H10.7676V12.9282H14.6079V14.2612H10.7676V18H9.12988ZM19.5108 18.1396C17.4478 18.1396 16.1973 16.7559 16.1973 14.5469V14.5405C16.1973 12.3569 17.4605 10.9287 19.4346 10.9287C21.4088 10.9287 22.6275 12.3125 22.6275 14.4072V14.9277H17.7779C17.797 16.1719 18.4698 16.8955 19.5426 16.8955C20.3995 16.8955 20.8883 16.4639 21.0406 16.1465L21.0596 16.1021H22.564L22.545 16.1592C22.3228 17.0542 21.3961 18.1396 19.5108 18.1396ZM19.4537 12.1665C18.5714 12.1665 17.9112 12.7632 17.7906 13.8677H21.085C20.9771 12.7314 20.336 12.1665 19.4537 12.1665ZM26.0197 18.1143C24.6994 18.1143 23.7409 17.3018 23.7409 16.0386V16.0259C23.7409 14.7881 24.6867 14.0645 26.3752 13.9629L28.1588 13.855V13.2583C28.1588 12.5664 27.7082 12.1855 26.8576 12.1855C26.1339 12.1855 25.6642 12.4458 25.5055 12.9028L25.4992 12.9282H24.0075L24.0138 12.8711C24.1662 11.7031 25.2834 10.9287 26.9338 10.9287C28.7174 10.9287 29.7204 11.792 29.7204 13.2583V18H28.1588V17.0479H28.0509C27.6701 17.7207 26.9338 18.1143 26.0197 18.1143ZM25.3024 15.9624C25.3024 16.5527 25.8039 16.9019 26.5021 16.9019C27.4543 16.9019 28.1588 16.2798 28.1588 15.4546V14.896L26.5973 14.9976C25.715 15.0547 25.3024 15.3784 25.3024 15.9497V15.9624ZM34.2678 18.0317C32.6746 18.0317 32.0207 17.4985 32.0207 16.1592V12.2871H30.9416V11.062H32.0207V9.36084H33.6267V11.062H35.093V12.2871H33.6267V15.7847C33.6267 16.4766 33.8996 16.7686 34.5598 16.7686C34.782 16.7686 34.9026 16.7622 35.093 16.7432V17.9619C34.8645 18.0063 34.5725 18.0317 34.2678 18.0317ZM38.8851 18.1396C37.3236 18.1396 36.5238 17.2002 36.5238 15.5498V11.062H38.1043V15.188C38.1043 16.2607 38.5042 16.8066 39.4564 16.8066C40.4783 16.8066 41.0242 16.1465 41.0242 15.1055V11.062H42.6048V18H41.0242V16.9463H40.9163C40.5926 17.689 39.888 18.1396 38.8851 18.1396ZM44.4545 18V11.062H46.0351V12.1284H46.143C46.3778 11.3857 47.0126 10.9478 47.9267 10.9478C48.1679 10.9478 48.4154 10.9795 48.5678 11.0239V12.4395C48.3139 12.3887 48.0536 12.3506 47.7807 12.3506C46.727 12.3506 46.0351 12.979 46.0351 13.9692V18H44.4545ZM52.5757 18.1396C50.5127 18.1396 49.2622 16.7559 49.2622 14.5469V14.5405C49.2622 12.3569 50.5254 10.9287 52.4995 10.9287C54.4736 10.9287 55.6924 12.3125 55.6924 14.4072V14.9277H50.8428C50.8618 16.1719 51.5346 16.8955 52.6074 16.8955C53.4643 16.8955 53.9531 16.4639 54.1054 16.1465L54.1245 16.1021H55.6289L55.6098 16.1592C55.3877 17.0542 54.4609 18.1396 52.5757 18.1396ZM52.5185 12.1665C51.6362 12.1665 50.9761 12.7632 50.8554 13.8677H54.1499C54.042 12.7314 53.4009 12.1665 52.5185 12.1665ZM59.6939 18.1143C57.9546 18.1143 56.8502 16.7368 56.8502 14.5405V14.5278C56.8502 12.3188 57.9356 10.9478 59.6939 10.9478C60.6461 10.9478 61.4395 11.4175 61.8013 12.1665H61.9092V8.37695H63.4962V18H61.9092V16.9146H61.8013C61.4205 17.6699 60.6714 18.1143 59.6939 18.1143ZM60.189 16.7812C61.2681 16.7812 61.9346 15.9307 61.9346 14.5405V14.5278C61.9346 13.1377 61.2618 12.2808 60.189 12.2808C59.1163 12.2808 58.4561 13.1313 58.4561 14.5278V14.5405C58.4561 15.937 59.1099 16.7812 60.189 16.7812Z",className:kP.featuredIcon__textColor,fill:t}))};var AP=({pageId:e="*",componentId:t="*"})=>{let o="announcement_badge",{config:r,isExcluded:i,accessibilityId:n,uiReference:a,defaultConfig:s}=S({pageId:e,componentId:t,elementId:o});return i?null:ie__default.createElement(Z,{"data-testid":n,defaultIcon:()=>ie__default.createElement(KO,{className:QO.announcementBadge}),imgIcon:()=>ie__default.createElement("img",{src:r.icon,alt:a}),configIconName:r.icon,defaultIconName:s.icon})};var JO={pinBadge__icon:"zw"};var RO=e=>ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"29",height:"30",fill:"none",viewBox:"0 0 29 30"},e),ie__default.createElement("path",{fill:e.fill,d:"M18.106 16.436c.575 1.547.53 3.27-.596 4.398a.74.74 0 01-1.06 0l-3.006-3.005-2.32 2.32c-.022.022-.067.022-.089.044l-1.59.53c-.2.067-.398-.132-.332-.331l.53-1.591.066-.066 2.32-2.32-3.005-3.006a.722.722 0 010-1.06c1.105-1.105 2.829-1.194 4.376-.62l2.917-2.342-.929-.928a.722.722 0 010-1.06l1.061-1.06a.74.74 0 011.06 0l6.011 6.01a.76.76 0 010 1.06l-1.06 1.06a.74.74 0 01-1.061 0l-.95-.95-2.343 2.917z"}));var FP=({pageId:e,componentId:t})=>{let o="pin_badge",{config:r,isExcluded:i,accessibilityId:n,uiReference:a,defaultConfig:s}=S({pageId:e,componentId:t,elementId:o});return i?null:ie__default.createElement(Z,{"data-testid":n,defaultIcon:()=>ie__default.createElement(RO,{className:JO.pinBadge__icon}),imgIcon:()=>ie__default.createElement("img",{src:r.icon,alt:a}),defaultIconName:s.icon,configIconName:r.icon})};var Tr={idle:"idle",live:"live",ended:"ended",recorded:"recorded"};var ez="./livestream-default-thumbnail-C6F5AP64.png";var tz={liveStreamThumbnail:"Xw"};function DP({fileId:e,alt:t}){let o=rt({fileId:e});return ie__default.createElement("img",{alt:t,loading:"lazy",src:o!=null?o:ez,className:tz.liveStreamThumbnail})}var oz={liveStreamLiveBadge:"Yw"};function Qg(){return ie__default.createElement(v.CaptionBold,{className:oz.liveStreamLiveBadge},"Live")}var rz={liveStreamEndThumbnail:"St"};function Kg({view:e="post"}){return ie__default.createElement("div",{className:rz.liveStreamEndThumbnail,"data-view":e},ie__default.createElement(v.TitleBold,null,"This live stream has ended."),ie__default.createElement(v.Caption,null,"Playback will be available for you ",ie__default.createElement("br",null)," to watch shortly."))}var VP={liveStreamIdleThumbnail:"Ct",liveStreamIdleThumbnail__icon:"Iw"};function Jg({view:e="post"}){return ie__default.createElement("div",{className:VP.liveStreamIdleThumbnail,"data-view":e},ie__default.createElement(Co,{className:VP.liveStreamIdleThumbnail__icon}),ie__default.createElement(v.TitleBold,null,"This stream is currently unavailable."),e==="full-screen"&&ie__default.createElement(v.Caption,null,"Please try again later."))}var iz={liveStreamUpcomingBadge:"Aw"};function UP(){return ie__default.createElement(v.CaptionBold,{className:iz.liveStreamUpcomingBadge},"Upcoming Live")}var nz={liveStreamRecordedBadge:"Mw"};function HP(){return ie__default.createElement(v.CaptionBold,{className:nz.liveStreamRecordedBadge},"Recorded")}var OP={liveStreamContent:"Et",liveStreamContent__playButton:"Sw"};var az={LiveStreamBanThumbnail:"Rt"};function Xg({view:e="post"}){return ie__default.createElement("div",{className:az.LiveStreamBanThumbnail,"data-view":e},ie__default.createElement(v.TitleBold,null,"You\u2019ve been banned."),ie__default.createElement(v.Caption,null,"You can no longer access this live stream."))}function oa({queryParams:e,shouldCall:t=!0}){let i=it({fetcher:CommunityRepository.Membership.getMembers,params:b(a({},e),{includeDeleted:!1,limit:20}),shouldCall:!!(e!=null&&e.communityId)&&t}),{items:o}=i,r=d(i,["items"]);return a({members:o},r)}var Ny=({communityId:e,shouldCall:t=!0})=>{let i=Cn({fetcher:CommunityRepository.getCommunity,params:e,shouldCall:!!e&&t}),{item:o}=i,r=d(i,["item"]);return a({community:o},r)};function jP({parentPost:e,posts:t,goToPostDetail:o}){var g,f;let{goToLiveStreamPlayerPage:r}=Y(),[i,n]=useState(!1),a=useRef(null),s=(g=t==null?void 0:t[0])==null?void 0:g.getLivestreamInfo(),{currentUserId:l}=Ne(),{community:m}=Ny({communityId:e.targetId}),{members:c}=oa({queryParams:{communityId:m==null?void 0:m.communityId}}),d=c.find(C=>C.userId===l),u=(s==null?void 0:s.isBanned)||d&&d.isBanned;return useEffect(()=>((()=>{if(s!=null&&s.startedAt&&(s.status===Tr.idle||s.status===Tr.live)){let b=new Date().getTime()-new Date(s.startedAt).getTime(),_=b<15e3;if(n(_),_){let x=15e3-b+50;a.current=setTimeout(()=>{n(!1);},x);}}else n(!1);})(),()=>{a.current&&(clearTimeout(a.current),a.current=null);}),[s]),!t||((f=t[0])==null?void 0:f.dataType)!=="liveStream"||!s?null:u?ie__default.createElement(Xg,null):s.isDeleted?ie__default.createElement(Jg,null):s.status===Tr.ended?ie__default.createElement(Kg,null):ie__default.createElement(V,{className:OP.liveStreamContent,"data-idle":s.status===Tr.idle||i,onPress:()=>{s.status!==Tr.idle&&!i&&(r==null||r({post:e,goToDetailPage:o}));}},ie__default.createElement(DP,{fileId:s.thumbnailFileId,alt:s.title}),(s.status===Tr.idle||i)&&ie__default.createElement(UP,null),s.status===Tr.live&&!i&&ie__default.createElement(Qg,null),s.status===Tr.recorded&&ie__default.createElement(HP,null),s.status!==Tr.idle&&!i&&ie__default.createElement(bl,{className:OP.liveStreamContent__playButton}))}var Je={postContent:"Ut",postContent__bar:"Cw",postContent__bar__userAvatar:"Ew",postContent__bar__detail:"Rw",postContent__bar__information__subtitle:"Uw",postContent__bar__information__subtitle__moderator:"Bw",postContent__bar__information__subtitle__brand:"Fw",postContent__bar__information__subtitle__separator:"Hw",postContent__bar__actionButton:"Lw",postContent__content:"Tw",postContent__content_and_reactions:"Vw",postContent__divider:"Ww",postContent__reactionBar:"qw",postContent__reactionBar__leftPane:"Dw",postContent__reactionBar__rightPane:"Gw",postContent__reactionBar__leftPane__icon:"Jw",postContent__reactionBar__leftPane__iconImg:"Kw",postContent__reactionBar__leftPane__commentButton:"Nw",postTitle:"Bt",postTitle__text:"Ow",postTitle__icon:"Pw",postTitle__user__container:"ne",postTitle__brandIcon:"Qw",postTitle__community:"me",postTitle__communityText:"Zw",postContent__comment:"_w",postContent__reactions_and_comments:"ex",postContent__reactionsBar:"rx",postContent__commentsCount:"ax",postContent__reactionsBar__reactions:"ox",postContent__reactionsBar__reactions__icon:"w",postContent__reactionsBar__reactions__count:"tx",postContent__bar__information__editedTag:"ix",button:"he",popover:"Ze","fade-in":"Ft","zoom-in":"Ht","fade-out":"Lt","zoom-out":"Tt",menu:"sx",menuItem:"Vt",separator:"dx",postContent__notMember:"cx",postContent__wrapRightMenu:"lx",postContent__imageViewer:"nx",postContent__imageViewerOverlay:"Wt"};var ky=({post:e})=>{let[t,o]=useState(0),[r,i]=useState(!1),[n,a]=useState(null);useEffect(()=>{var m;e!=null&&a(((m=e.myReactions)==null?void 0:m[0])||null);},[e==null?void 0:e.myReactions]),useEffect(()=>{e!=null&&o((e==null?void 0:e.reactionsCount)||0);},[e==null?void 0:e.reactionsCount]);let{mutateAsync:s}=useMutation({mutationFn:m=>l(void 0,null,function*(){if(n&&n!==m)try{yield ReactionRepository.removeReaction("post",e==null?void 0:e.postId,n);}catch(c){console.error(c);}return ReactionRepository.addReaction("post",e==null?void 0:e.postId,m)}),onMutate:m=>{i(!0),o(t+1),a(m);}}),{mutateAsync:l$1}=useMutation({mutationFn:m=>l(void 0,null,function*(){return ReactionRepository.removeReaction("post",e==null?void 0:e.postId,m)}),onMutate:()=>{i(!0),o(Math.max(0,t-1)),a(null);}});return {reactionByMe:n,reactionsCount:t,mutateAddReactionAsync:s,mutateRemoveReactionAsync:l$1,setReactionByMe:a}};var e7e=({pageId:e,componentId:t,post:o,hideTarget:r})=>{var y;let i=useMemo(()=>(o==null?void 0:o.targetType)==="community",[o==null?void 0:o.targetType]),n=useMemo(()=>(o==null?void 0:o.targetType)==="user"&&(o==null?void 0:o.postedUserId)!==(o==null?void 0:o.targetId),[o==null?void 0:o.targetType,o==null?void 0:o.postedUserId,o==null?void 0:o.targetId]),{community:a}=Ct({communityId:o==null?void 0:o.targetId,shouldCall:i}),{user:s}=qe({userId:o==null?void 0:o.targetId,shouldCall:n}),{goToCommunityProfilePage:l,onClickUser:m}=Y(),c=a&&!r,d=s&&!r,u=(y=o==null?void 0:o.creator)==null?void 0:y.isBrand,g=(a==null?void 0:a.isPublic)===!1,f=(a==null?void 0:a.isOfficial)===!0,C=c||d;return ie__default.createElement("div",{className:Je.postTitle,"data-show-target-community":c===!0},o&&(o==null?void 0:o.creator)&&ie__default.createElement("div",{className:Je.postTitle__user__container,"data-show-brand-badge":u===!0,"data-show-target":C===!0},ie__default.createElement(V,{onPress:()=>{var b;return ((b=o==null?void 0:o.creator)==null?void 0:b.userId)&&m(o.creator.userId)},"data-testid":`${e}/${t}/username`},ie__default.createElement(v.BodyBold,{className:Je.postTitle__text},o.creator.displayName)),u?ie__default.createElement(Mn,{className:Je.postTitle__brandIcon}):null,C?ie__default.createElement(du,{"data-testid":`${e}/${t}/arrow_right`,className:Je.postTitle__icon}):null),c&&ie__default.createElement("div",{className:Je.postTitle__community,"data-show-private-badge":g===!0,"data-show-official-badge":f===!0},g&&ie__default.createElement(ar,null),ie__default.createElement(V,{className:Je.postTitle__communityText,"data-testid":`${e}/${t}/community_name`,onPress:()=>l(a.communityId)},ie__default.createElement(v.BodyBold,null,a.displayName)),f&&ie__default.createElement(sr,null)),d&&ie__default.createElement("div",{className:Je.postTitle__user__container,"data-show-brand-badge":(s==null?void 0:s.isBrand)===!0,"data-show-target":!1},ie__default.createElement(V,{onPress:()=>m(s.userId)},ie__default.createElement(v.BodyBold,{className:Je.postTitle__text},s.displayName)),(s==null?void 0:s.isBrand)===!0?ie__default.createElement(Mn,{className:Je.postTitle__brandIcon}):null))},e0=({post:e,pageId:t,componentId:o,onImageClick:r,onVideoClick:i,onClipClick:n,goToPostDetail:a,disabledContent:s=!1})=>ie__default.createElement(ie__default.Fragment,null,ie__default.createElement(JH,{pageId:t,componentId:o,parentPost:e,posts:e.childrenPosts,disabled:s}),ie__default.createElement(uP,{pageId:t,componentId:o,posts:e.childrenPosts,onImageClick:r}),ie__default.createElement(gP,{pageId:t,componentId:o,posts:e.childrenPosts,onVideoClick:i}),ie__default.createElement(jP,{posts:e.childrenPosts,goToPostDetail:a,parentPost:e}),ie__default.createElement(fP,{pageId:t,componentId:o,posts:e.childrenPosts,onClipClick:n})),en=({pageId:e="*",post:t,onClick:o,onPostDeleted:r,category:i,hideMenu:n=!1,hideTarget:a=!1,style:s,disabledContent:l$1=!1,isGlobalFeaturePost:m=!1,className:c})=>{var Zt,Bt,so,lo,ve,$e,pe,Me;let d="post_content",{themeStyles:u,accessibilityId:g}=se({pageId:e,componentId:d}),{isDesktop:f}=le(),{openPopup:C,closePopup:y}=Se(),{confirm:b}=Te(),{setDrawerData:_,removeDrawerData:x}=tt(),{moderators:P}=Lo({communityId:t==null?void 0:t.targetId}),{mutateAddReactionAsync:I,mutateRemoveReactionAsync:w,reactionByMe:M,reactionsCount:T}=ky({post:t}),E=(P||[]).find(K=>K.userId===t.postedUserId)!=null,[N,A]=useState(!1),[D,G]=useState(null),{page:H,goToClipFeedPage:$}=Y(),j=useRef(null),O=useMemo(()=>(t==null?void 0:t.targetType)==="community",[t==null?void 0:t.targetType]),{community:z}=Ct({communityId:t==null?void 0:t.targetId,shouldCall:O}),{isCommunityModerator:k}=Ty({post:t,community:z}),F=K=>{M?w(M):I(K);},re=K=>{C({id:"image-viewer",disabledAnimation:!0,isDismissable:f,className:Je.postContent__imageViewer,overlayClassName:Je.postContent__imageViewerOverlay,children:ie__default.createElement($u,{post:t,onClose:W,initialImageIndex:K})});},W=()=>{y("image-viewer");},ne=K=>{A(!0),G(K);},te=()=>{A(!1),G(null);},Q=({onConfirm:K})=>{b({title:"Edit globally featured post?",content:"The post you're editing has been featured globally. If you edit your post, it will need to be re-approved and will no longer be globally featured.",cancelText:"Cancel",okText:"Edit",onOk:K});},ae=!(z!=null&&z.isJoined)&&(t==null?void 0:t.targetType)==="community",Ee=((Zt=t==null?void 0:t.reactions)==null?void 0:Zt.like)>0,J=((Bt=t==null?void 0:t.reactions)==null?void 0:Bt.love)>0,R=((so=t==null?void 0:t.reactions)==null?void 0:so.fire)>0,be=((lo=t==null?void 0:t.reactions)==null?void 0:lo.happy)>0,xe=((ve=t==null?void 0:t.reactions)==null?void 0:ve.crying)>0,Xe=Ee||J||R||be||xe,Qe=!E&&m&&((z==null?void 0:z.needApprovalOnPostCreation)||(z==null?void 0:z.postSetting)==="ADMIN_REVIEW_POST_REQUIRED"),{isVisible:ht}=YO({threshold:.6,elementRef:j});return useEffect(()=>{var K;H.type!=="PostDetailPage"&&ht&&((K=t.analytics)==null||K.markAsViewed());},[t,ht,H.type]),ie__default.createElement("div",{"data-testid":g,ref:j,className:wl(Je.postContent,c),style:u},(i==="announcement"||i==="pin_and_announcement")&&ie__default.createElement(AP,{pageId:e,componentId:d}),ie__default.createElement("div",{className:Je.postContent__bar,"data-type":s},ie__default.createElement("div",{className:Je.postContent__bar__userAvatar},ie__default.createElement(Ae,{pageId:e,componentId:d,userId:t==null?void 0:t.postedUserId})),ie__default.createElement("div",{className:Je.postContent__bar__detail},ie__default.createElement("div",null,ie__default.createElement(e7e,{post:t,hideTarget:a,pageId:e,componentId:d})),ie__default.createElement("div",{className:Je.postContent__bar__information__subtitle},k?ie__default.createElement("div",{className:Je.postContent__bar__information__subtitle__moderator},ie__default.createElement(_m,{pageId:e,componentId:d}),ie__default.createElement("span",{className:Je.postContent__bar__information__subtitle__separator},"\u2022")):null,ie__default.createElement(gi,{timestamp:t.createdAt}),t.createdAt!==t.editedAt&&ie__default.createElement(v.Caption,{"data-testid":`${e}/${d}/post_edited_text`,className:Je.postContent__bar__information__editedTag},"(edited)"))),ie__default.createElement("div",{className:Je.postContent__wrapRightMenu},(i==="pin"||i==="pin_and_announcement")&&ie__default.createElement(FP,{pageId:e,componentId:d}),s==="feed"&&ie__default.createElement(ft,{containerClassName:Je.postContent__bar__actionButton,trigger:{pageId:e,componentId:d,onClick:({closePopover:K})=>_({content:ie__default.createElement(Ru,{post:t,pageId:e,componentId:d,onPostDeleted:r,onConfirmEditPost:Qe?({onConfirm:Ce})=>{K(),x(),Q({onConfirm:Ce});}:void 0,onCloseMenu:()=>{K(),x();}})})}},({closePopover:K})=>ie__default.createElement(Ru,{post:t,pageId:e,componentId:d,onPostDeleted:r,onConfirmEditPost:Qe?({onConfirm:Ce})=>{K(),x(),Q({onConfirm:Ce});}:void 0,onCloseMenu:()=>{K(),x();}})))),ie__default.createElement("div",{className:Je.postContent__content_and_reactions},ie__default.createElement("div",{className:Je.postContent__content},ie__default.createElement(Gc,{pageId:e,componentId:d,text:E1(t)?($e=t==null?void 0:t.data)==null?void 0:$e.text:"",mentioned:(pe=t==null?void 0:t.metadata)==null?void 0:pe.mentioned,mentionees:t==null?void 0:t.mentionees,post:t}),((Me=t.childrenPosts)==null?void 0:Me.length)>0?ie__default.createElement(e0,{pageId:e,componentId:d,post:t,onImageClick:re,onVideoClick:ne,onClipClick:()=>{f?ne(0):$==null||$({currentPostId:t.children[0]});},goToPostDetail:o,disabledContent:ae||l$1}):null),s==="detail"?ie__default.createElement("div",{className:Je.postContent__reactions_and_comments},ie__default.createElement("div",{className:Je.postContent__reactionsBar,onClick:()=>{let K=ie__default.createElement(ll,{pageId:e,referenceId:t.postId,referenceType:"post"});f?C({view:"desktop",children:K}):_({content:K});}},Xe?ie__default.createElement("div",{className:Je.postContent__reactionsBar__reactions},xe&&ie__default.createElement(XH,{className:Je.postContent__reactionsBar__reactions__icon}),be&&ie__default.createElement(RH,{className:Je.postContent__reactionsBar__reactions__icon}),R&&ie__default.createElement(eO,{className:Je.postContent__reactionsBar__reactions__icon}),J&&ie__default.createElement(tO,{className:Je.postContent__reactionsBar__reactions__icon}),Ee&&ie__default.createElement(oO,{className:Je.postContent__reactionsBar__reactions__icon})):null,ie__default.createElement(v.Caption,{"data-testid":`${e}/${d}/like_count`,className:Je.postContent__reactionsBar__reactions__count},`${fA((t==null?void 0:t.reactionsCount)||0)} ${(t==null?void 0:t.reactionsCount)===1?"like":"likes"}`)),ie__default.createElement(v.Caption,{"data-testid":`${e}/${d}/comment_count`,className:Je.postContent__commentsCount},`${(t==null?void 0:t.commentsCount)||0} ${(t==null?void 0:t.commentsCount)===1?"comment":"comments"}`)):null,ae&&H.type!=="PostDetailPage"?ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("div",{className:Je.postContent__divider}),ie__default.createElement(v.Body,{className:Je.postContent__notMember},"Join community to interact with all posts")):z&&!(z!=null&&z.isJoined)&&H.type==="PostDetailPage"?null:ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("div",{className:Je.postContent__divider}),ie__default.createElement("div",{className:Je.postContent__reactionBar},ie__default.createElement("div",{className:Je.postContent__reactionBar__leftPane},ie__default.createElement(V1,{pageId:e,componentId:d,reactionsCount:s==="feed"?T:void 0,myReaction:M,defaultIconClassName:Je.postContent__reactionBar__leftPane__icon,imgIconClassName:Je.postContent__reactionBar__leftPane__iconImg,onReactionClick:F}),ie__default.createElement(Dg,{pageId:e,componentId:d,commentsCount:s==="feed"?t.commentsCount:void 0,buttonClassName:Je.postContent__reactionBar__leftPane__commentButton,defaultIconClassName:Je.postContent__reactionBar__leftPane__icon,imgIconClassName:Je.postContent__reactionBar__leftPane__iconImg,onPress:()=>o==null?void 0:o()})),ie__default.createElement("div",{className:Je.postContent__reactionBar__rightPane},ie__default.createElement(oP,{pageId:e,componentId:d}))))),N&&typeof D=="number"?ie__default.createElement(Zu,{post:t,onClose:te,initialVideoIndex:D}):null)};var gr={postContentSkeleton:"qt",postContentSkeleton__bar:"mx",postContentSkeleton__bar__information:"hx",postContentSkeleton__content:"gx",postContentSkeleton__animation:"px","skeleton-pulse":"Dt",postContentSkeleton__bar__userAvatar:"bx",postContentSkeleton__bar__information__title:"ux",postContentSkeleton__bar__information__subtitle:"fx",postContentSkeleton__content__bar1:"vx",postContentSkeleton__content__bar2:"wx",postContentSkeleton__content__bar3:"xx"};var Rg=({pageId:e="*"})=>{let t="post_content",{accessibilityId:o,config:r,defaultConfig:i,isExcluded:n,uiReference:a,themeStyles:s}=se({pageId:e,componentId:t});return ie__default.createElement("div",{"data-testid":o,style:s,className:wl(gr.postContentSkeleton,gr.postContentSkeleton__animation)},ie__default.createElement("div",{className:wl(gr.postContentSkeleton__bar,gr.postContentSkeleton__animation)},ie__default.createElement("div",{className:wl(gr.postContentSkeleton__bar__userAvatar,gr.postContentSkeleton__animation)}),ie__default.createElement("div",{className:wl(gr.postContentSkeleton__bar__information,gr.postContentSkeleton__animation)},ie__default.createElement("div",{className:wl(gr.postContentSkeleton__bar__information__title,gr.postContentSkeleton__animation)}),ie__default.createElement("div",{className:wl(gr.postContentSkeleton__bar__information__subtitle,gr.postContentSkeleton__animation)}))),ie__default.createElement("div",{className:wl(gr.postContentSkeleton__content,gr.postContentSkeleton__animation)},ie__default.createElement("div",{className:wl(gr.postContentSkeleton__content__bar1,gr.postContentSkeleton__animation)}),ie__default.createElement("div",{className:wl(gr.postContentSkeleton__content__bar2,gr.postContentSkeleton__animation)}),ie__default.createElement("div",{className:wl(gr.postContentSkeleton__content__bar3,gr.postContentSkeleton__animation)})))};function hs({queryParams:e,shouldCall:t=!0}){let i=it({fetcher:CommunityRepository.getCommunities,params:e,shouldCall:t}),{items:o}=i,r=d(i,["items"]);return a({communities:o},r)}var dz={myCommunitiesList:"yx"};var By=({pageId:e="*"})=>{let t="my_communities",{themeStyles:o}=se({pageId:e,componentId:t}),{communities:r,hasMore:i,loadMore:n,isLoading:a}=hs({queryParams:{limit:20,membership:"member"}});return ie__default.createElement("div",{style:o,className:dz.myCommunitiesList},ie__default.createElement(od,{pageId:e,communityCollection:r,isLoading:a,onLoadMore:()=>{i&&a===!1&&n();}}))};var i7e=()=>ie__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"161",height:"161",viewBox:"0 0 161 161",fill:"none"},ie__default.createElement("path",{d:"M130.1 24.5H34.0996C29.6813 24.5 26.0996 28.0817 26.0996 32.5V128.5C26.0996 132.918 29.6813 136.5 34.0996 136.5H130.1C134.518 136.5 138.1 132.918 138.1 128.5V32.5C138.1 28.0817 134.518 24.5 130.1 24.5Z",fill:"#292B32"}),ie__default.createElement("path",{d:"M43.7002 68.2H44.2002H151.7C152.628 68.2 153.519 68.5688 154.175 69.2251C154.831 69.8815 155.2 70.7718 155.2 71.7V91.7C155.2 92.6283 154.831 93.5185 154.175 94.1749C153.519 94.8313 152.628 95.2 151.7 95.2H43.7002C42.7719 95.2 41.8817 94.8313 41.2253 94.1749C40.5689 93.5185 40.2002 92.6283 40.2002 91.7V71.7C40.2002 70.7718 40.5689 69.8815 41.2253 69.2251C41.8817 68.5688 42.7719 68.2 43.7002 68.2Z",fill:"#292B32",stroke:"#40434E"}),ie__default.createElement("path",{opacity:"0.3",d:"M90.9002 74.1H70.1002C68.7747 74.1 67.7002 75.1745 67.7002 76.5C67.7002 77.8255 68.7747 78.9 70.1002 78.9H90.9002C92.2257 78.9 93.3002 77.8255 93.3002 76.5C93.3002 75.1745 92.2257 74.1 90.9002 74.1Z",fill:"#40434E"}),ie__default.createElement("path",{opacity:"0.15",d:"M105.3 84.5H70.1002C68.7747 84.5 67.7002 85.5745 67.7002 86.9C67.7002 88.2255 68.7747 89.3 70.1002 89.3H105.3C106.626 89.3 107.7 88.2255 107.7 86.9C107.7 85.5745 106.626 84.5 105.3 84.5Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M53.6996 89.3C57.897 89.3 61.2996 85.8974 61.2996 81.7C61.2996 77.5027 57.897 74.1 53.6996 74.1C49.5022 74.1 46.0996 77.5027 46.0996 81.7C46.0996 85.8974 49.5022 89.3 53.6996 89.3Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M9.2998 102.6H9.7998H117.3C118.228 102.6 119.118 102.969 119.775 103.625C120.431 104.282 120.8 105.172 120.8 106.1V126.1C120.8 127.028 120.431 127.919 119.775 128.575C119.118 129.231 118.228 129.6 117.3 129.6H9.2998C8.37155 129.6 7.48131 129.231 6.82493 128.575C6.16855 127.919 5.7998 127.028 5.7998 126.1V106.1C5.7998 105.172 6.16855 104.282 6.82493 103.625C7.48131 102.969 8.37155 102.6 9.2998 102.6Z",fill:"#292B32",stroke:"#40434E"}),ie__default.createElement("path",{opacity:"0.3",d:"M56.4998 108.5H35.6998C34.3743 108.5 33.2998 109.575 33.2998 110.9C33.2998 112.225 34.3743 113.3 35.6998 113.3H56.4998C57.8253 113.3 58.8998 112.225 58.8998 110.9C58.8998 109.575 57.8253 108.5 56.4998 108.5Z",fill:"#40434E"}),ie__default.createElement("path",{opacity:"0.15",d:"M70.8998 118.9H35.6998C34.3743 118.9 33.2998 119.975 33.2998 121.3C33.2998 122.626 34.3743 123.7 35.6998 123.7H70.8998C72.2253 123.7 73.2998 122.626 73.2998 121.3C73.2998 119.975 72.2253 118.9 70.8998 118.9Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M19.3002 123.7C23.4976 123.7 26.9002 120.297 26.9002 116.1C26.9002 111.903 23.4976 108.5 19.3002 108.5C15.1028 108.5 11.7002 111.903 11.7002 116.1C11.7002 120.297 15.1028 123.7 19.3002 123.7Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M9.2998 33.8H117.3C119.233 33.8 120.8 35.367 120.8 37.3V57.3C120.8 59.233 119.233 60.8 117.3 60.8H9.2998C7.36681 60.8 5.7998 59.233 5.7998 57.3V37.3C5.7998 35.367 7.36681 33.8 9.2998 33.8Z",fill:"#292B32",stroke:"#40434E"}),ie__default.createElement("path",{opacity:"0.3",d:"M54.8992 39.7H34.0992C32.7737 39.7 31.6992 40.7745 31.6992 42.1C31.6992 43.4255 32.7737 44.5 34.0992 44.5H54.8992C56.2247 44.5 57.2992 43.4255 57.2992 42.1C57.2992 40.7745 56.2247 39.7 54.8992 39.7Z",fill:"#40434E"}),ie__default.createElement("path",{opacity:"0.15",d:"M69.2992 50.1H34.0992C32.7737 50.1 31.6992 51.1745 31.6992 52.5C31.6992 53.8255 32.7737 54.9 34.0992 54.9H69.2992C70.6247 54.9 71.6992 53.8255 71.6992 52.5C71.6992 51.1745 70.6247 50.1 69.2992 50.1Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M19.3002 54.9C23.4976 54.9 26.9002 51.4974 26.9002 47.3C26.9002 43.1026 23.4976 39.7 19.3002 39.7C15.1028 39.7 11.7002 43.1026 11.7002 47.3C11.7002 51.4974 15.1028 54.9 19.3002 54.9Z",fill:"#40434E"})),n7e=()=>ie__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"161",height:"160",viewBox:"0 0 161 160",fill:"none"},ie__default.createElement("path",{d:"M130.452 24H34.4521C30.0339 24 26.4521 27.5817 26.4521 32V128C26.4521 132.418 30.0339 136 34.4521 136H130.452C134.87 136 138.452 132.418 138.452 128V32C138.452 27.5817 134.87 24 130.452 24Z",fill:"#EBECEF"}),ie__default.createElement("path",{d:"M44.0522 67.7H44.5522H152.052C152.981 67.7 153.871 68.0688 154.527 68.7251C155.184 69.3815 155.552 70.2718 155.552 71.2V91.2C155.552 92.1283 155.184 93.0185 154.527 93.6749C153.871 94.3313 152.981 94.7 152.052 94.7H44.0522C43.124 94.7 42.2337 94.3313 41.5774 93.6749C40.921 93.0185 40.5522 92.1283 40.5522 91.2V71.2C40.5522 70.2718 40.921 69.3815 41.5774 68.7251C42.2337 68.0688 43.124 67.7 44.0522 67.7Z",fill:"white",stroke:"#EBECEF"}),ie__default.createElement("path",{opacity:"0.3",d:"M91.2523 73.6H70.4522C69.1268 73.6 68.0522 74.6745 68.0522 76C68.0522 77.3255 69.1268 78.4 70.4522 78.4H91.2523C92.5777 78.4 93.6523 77.3255 93.6523 76C93.6523 74.6745 92.5777 73.6 91.2523 73.6Z",fill:"#A5A9B5"}),ie__default.createElement("path",{opacity:"0.15",d:"M105.652 84H70.4522C69.1268 84 68.0522 85.0745 68.0522 86.4C68.0522 87.7255 69.1268 88.8 70.4522 88.8H105.652C106.978 88.8 108.052 87.7255 108.052 86.4C108.052 85.0745 106.978 84 105.652 84Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M54.0521 88.8C58.2495 88.8 61.6521 85.3974 61.6521 81.2C61.6521 77.0027 58.2495 73.6 54.0521 73.6C49.8548 73.6 46.4521 77.0027 46.4521 81.2C46.4521 85.3974 49.8548 88.8 54.0521 88.8Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M9.65234 102.1H10.1523H117.652C118.581 102.1 119.471 102.469 120.127 103.125C120.784 103.782 121.152 104.672 121.152 105.6V125.6C121.152 126.528 120.784 127.419 120.127 128.075C119.471 128.731 118.581 129.1 117.652 129.1H9.65234C8.72409 129.1 7.83385 128.731 7.17747 128.075C6.52109 127.419 6.15234 126.528 6.15234 125.6V105.6C6.15234 104.672 6.52109 103.782 7.17747 103.125C7.83385 102.469 8.72409 102.1 9.65234 102.1Z",fill:"white",stroke:"#EBECEF"}),ie__default.createElement("path",{opacity:"0.3",d:"M56.8523 108H36.0523C34.7269 108 33.6523 109.075 33.6523 110.4C33.6523 111.725 34.7269 112.8 36.0523 112.8H56.8523C58.1778 112.8 59.2523 111.725 59.2523 110.4C59.2523 109.075 58.1778 108 56.8523 108Z",fill:"#A5A9B5"}),ie__default.createElement("path",{opacity:"0.15",d:"M71.2523 118.4H36.0523C34.7269 118.4 33.6523 119.475 33.6523 120.8C33.6523 122.126 34.7269 123.2 36.0523 123.2H71.2523C72.5778 123.2 73.6523 122.126 73.6523 120.8C73.6523 119.475 72.5778 118.4 71.2523 118.4Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M19.6522 123.2C23.8496 123.2 27.2522 119.797 27.2522 115.6C27.2522 111.403 23.8496 108 19.6522 108C15.4549 108 12.0522 111.403 12.0522 115.6C12.0522 119.797 15.4549 123.2 19.6522 123.2Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M9.65234 33.3H117.652C119.585 33.3 121.152 34.867 121.152 36.8V56.8C121.152 58.733 119.585 60.3 117.652 60.3H9.65234C7.71935 60.3 6.15234 58.733 6.15234 56.8V36.8C6.15234 34.867 7.71935 33.3 9.65234 33.3Z",fill:"white",stroke:"#EBECEF"}),ie__default.createElement("path",{opacity:"0.3",d:"M55.2522 39.2H34.4522C33.1268 39.2 32.0522 40.2745 32.0522 41.6C32.0522 42.9255 33.1268 44 34.4522 44H55.2522C56.5777 44 57.6522 42.9255 57.6522 41.6C57.6522 40.2745 56.5777 39.2 55.2522 39.2Z",fill:"#A5A9B5"}),ie__default.createElement("path",{opacity:"0.15",d:"M69.6522 49.6H34.4522C33.1268 49.6 32.0522 50.6745 32.0522 52C32.0522 53.3255 33.1268 54.4 34.4522 54.4H69.6522C70.9777 54.4 72.0522 53.3255 72.0522 52C72.0522 50.6745 70.9777 49.6 69.6522 49.6Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M19.6522 54.4C23.8496 54.4 27.2522 50.9974 27.2522 46.8C27.2522 42.6026 23.8496 39.2 19.6522 39.2C15.4549 39.2 12.0522 42.6026 12.0522 46.8C12.0522 50.9974 15.4549 54.4 19.6522 54.4Z",fill:"#A5A9B5"})),WP=({pageId:e="*",componentId:t="*"})=>{let o="illustration",{currentTheme:r,accessibilityId:i,config:n,defaultConfig:a,isExcluded:s,uiReference:l,themeStyles:m}=S({pageId:e,componentId:t,elementId:o});return s?null:ie__default.createElement(Z,{defaultIconName:a.icon,configIconName:n.icon,imgIcon:()=>ie__default.createElement("img",{src:n.icon,alt:l,"data-testid":i}),defaultIcon:()=>ie__default.createElement("div",{"data-testid":i},r==="light"?ie__default.createElement(n7e,null):ie__default.createElement(i7e,null))})};var pz={description:"kx"};function Qc({pageId:e="*",componentId:t="*"}){let o="description",{accessibilityId:r,config:i,defaultConfig:n,isExcluded:a,uiReference:s,themeStyles:l}=S({pageId:e,componentId:t,elementId:o});return a?null:ie__default.createElement(v.Caption,{className:pz.description,style:l,"data-testid":r},i.text)}var Ey={exploreCommunitiesButton:"jx",exploreCommunitiesButton__icon:"zx",exploreCommunitiesButton__text:"Xx"};var d7e=e=>ie__default.createElement("svg",a({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M7.85254 0.25C12.1338 0.25 15.6025 3.71875 15.6025 8C15.6025 12.2812 12.1338 15.75 7.85254 15.75C3.57129 15.75 0.102539 12.2812 0.102539 8C0.102539 3.71875 3.57129 0.25 7.85254 0.25ZM13.4463 5.25C12.79 3.9375 11.6963 2.90625 10.3525 2.3125C10.79 3.125 11.1338 4.125 11.3525 5.25H13.4463ZM7.85254 1.75C7.25879 1.75 6.32129 3.0625 5.85254 5.25H9.82129C9.35254 3.0625 8.41504 1.75 7.85254 1.75ZM1.60254 8C1.60254 8.4375 1.63379 8.875 1.72754 9.25H4.13379C4.10254 8.84375 4.10254 8.4375 4.10254 8C4.10254 7.59375 4.10254 7.1875 4.13379 6.75H1.72754C1.63379 7.15625 1.60254 7.59375 1.60254 8ZM2.22754 10.75C2.88379 12.0625 3.97754 13.125 5.32129 13.7188C4.88379 12.9062 4.54004 11.9062 4.32129 10.75H2.22754ZM4.32129 5.25C4.54004 4.125 4.88379 3.125 5.32129 2.3125C3.97754 2.90625 2.88379 3.9375 2.22754 5.25H4.32129ZM7.85254 14.25C8.41504 14.25 9.35254 12.9688 9.82129 10.75H5.85254C6.32129 12.9688 7.25879 14.25 7.85254 14.25ZM10.04 9.25C10.0713 8.875 10.1025 8.4375 10.1025 8C10.1025 7.5625 10.0713 7.15625 10.04 6.75H5.63379C5.60254 7.15625 5.60254 7.5625 5.60254 8C5.60254 8.4375 5.60254 8.875 5.63379 9.25H10.04ZM10.3525 13.7188C11.6963 13.125 12.79 12.0625 13.4463 10.75H11.3525C11.1338 11.9062 10.79 12.9062 10.3525 13.7188ZM11.54 9.25H13.9775C14.04 8.875 14.1025 8.4375 14.1025 8C14.1025 7.59375 14.04 7.15625 13.9775 6.75H11.54C11.5713 7.1875 11.6025 7.59375 11.6025 8C11.6025 8.4375 11.5713 8.84375 11.54 9.25Z"}));function tf({pageId:e="*",componentId:t="*",className:o,onClick:r}){let i="explore_communities_button",{accessibilityId:n,config:a,defaultConfig:s,isExcluded:l,uiReference:m,themeStyles:c}=S({pageId:e,componentId:t,elementId:i});return l?null:ie__default.createElement(oe,{className:wl(Ey.exploreCommunitiesButton,o),"data-testid":n,style:c,onPress:r},ie__default.createElement(d7e,{className:Ey.exploreCommunitiesButton__icon}),ie__default.createElement(v.BodyBold,{className:Ey.exploreCommunitiesButton__text},a.text))}var uz={createCommunityButton:"Yx"};function of({pageId:e="*",componentId:t="*",onClick:o,textClassName:r}){let i="create_community_button",{accessibilityId:n,config:a,defaultConfig:s,isExcluded:l,uiReference:m,themeStyles:c}=S({pageId:e,componentId:t,elementId:i});return l?null:ie__default.createElement("div",{className:uz.createCommunityButton,onClick:()=>o(),"data-testid":n,style:c},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(ie__default.Fragment,null),imgIcon:()=>ie__default.createElement("img",{src:a.icon,alt:m}),configIconName:a.icon,defaultIconName:s.icon}),ie__default.createElement(v.Body,{className:r},"Create Community"))}var qP={emptyNewsfeed:"Ix",emptyNewsfeed__text:"Ax"};function o0({pageId:e="*"}){let t="empty_newsfeed",{goToCreateCommunityPage:o}=Y(),{isExcluded:r,themeStyles:i,accessibilityId:n}=se({pageId:e,componentId:t});return r?null:ie__default.createElement("div",{className:qP.emptyNewsfeed,style:i,"data-testid":n},ie__default.createElement(WP,{pageId:e,componentId:t}),ie__default.createElement("div",{className:qP.emptyNewsfeed__text},ie__default.createElement(xt,{pageId:e,componentId:t}),ie__default.createElement(Qc,{pageId:e,componentId:t})),ie__default.createElement(tf,{pageId:e,componentId:t}),ie__default.createElement(of,{pageId:e,componentId:t,onClick:()=>o==null?void 0:o({mode:"create"})}))}var Or={container:"Gt",innerContainer:"Jt",header:"Mx",header__title:"Sx",header__avatar:"Cx",header__detail:"Ex",content__text:"Rx",content__imageContainer:"Ux",content__image:"Bx",footer:"_e",footer__content__description:"Fx",footer__content__headline:"Hx",footer__left:"Kt",footer__right:"Lx",footer__content__button:"Tx",footer__content__button__text:"Vx",infoIcon__button:"Wx",infoIcon:"qx"};var fz=({ad:e,avatarUrl:t,adImageUrl:o,themeStyles:r,onCallToActionClick:i})=>{var l;let[n,a]=useState(!1),s=()=>{i==null||i(e.callToActionUrl);};return ie__default.createElement("div",{className:Or.container,style:r},ie__default.createElement("div",{className:Or.innerContainer},ie__default.createElement("div",{className:Or.header},ie__default.createElement("div",{className:Or.header__avatar},ie__default.createElement(ho,{avatarUrl:t,defaultImage:ie__default.createElement(Tu,null)})),ie__default.createElement("div",{className:Or.header__detail},ie__default.createElement(v.BodyBold,{className:Or.header__title},(l=e.advertiser)==null?void 0:l.name),ie__default.createElement(wu,null))),ie__default.createElement("div",null,e.body&&ie__default.createElement(v.Body,{className:Or.content__text},e.body),ie__default.createElement("div",{className:Or.content__imageContainer},ie__default.createElement("img",{className:Or.content__image,src:o})))),ie__default.createElement(V,{className:Or.infoIcon__button,onPress:()=>a(!0)},ie__default.createElement(Ta,{className:Or.infoIcon})),ie__default.createElement(V,{className:Or.footer,"data-has-url":!!e.callToActionUrl,onPress:s},ie__default.createElement("div",{className:Or.footer__left},ie__default.createElement(v.CaptionSmall,{className:Or.footer__content__description},ie__default.createElement(RE,{lines:1},ie__default.createElement("div",null,e.description))),ie__default.createElement(v.CaptionBold,{className:Or.footer__content__headline},ie__default.createElement(RE,{lines:2},ie__default.createElement("div",null,e.headline)))),e.callToActionUrl?ie__default.createElement("div",{className:Or.footer__right},ie__default.createElement(V,{className:Or.footer__content__button,onPress:s},ie__default.createElement(v.CaptionBold,{className:Or.footer__content__button__text},e.callToAction))):null),ie__default.createElement(E8,{ad:e,isOpen:n,onOpenChange:m=>a(m)}))};var yz=({pageId:e="*",ad:t})=>{var m,c,d,u,g,f;let o="post_content",{themeStyles:r}=se({pageId:e,componentId:o}),n=rt({fileId:(c=(m=t.advertiser)==null?void 0:m.avatar)==null?void 0:c.fileId})||((u=(d=t.advertiser)==null?void 0:d.avatar)==null?void 0:u.fileUrl)||"",s=rt({fileId:(g=t.image1_1)==null?void 0:g.fileId})||((f=t.image1_1)==null?void 0:f.fileUrl)||"";return ie__default.createElement(fz,{themeStyles:r,avatarUrl:n,adImageUrl:s,ad:t,onCallToActionClick:C=>{window==null||window.open(C,"_blank");}})};var hz={clickableArea:"Dx"};function Ay(r){var i=r,{className:e,style:t}=i,o=d(i,["className","style"]);let{children:n}=o,a$1=useRef(null),{buttonProps:s}=useButton(o,a$1);return createElement(o.elementType,b(a({},s),{className:wl(hz.clickableArea,e),ref:a$1,style:t}),n)}var rf={global_feed:"Gx",global_feed__postContainer:"Nt",global_feed__pullToRefresh:"Jx",global_feed__post__reactionBar__leftPane__icon:"Kx",global_feed__post__reactionBar__leftPane__iconImg:"Nx",global_feed__pullToRefresh__spinner:"Ox",spin:"Ot",global_feed__post__reactionBar:"Px",global_feed__post__reactionBar__leftPane:"Qx",global_feed__post__reactionBar__rightPane:"Zx",global_feed__intersection:"_x",global_feed__commentContainer:"ey"};var YP={divider:"X",divider__alphabet:"ry"};function zr({isShown:e=!0,type:t="post",className:o,alphabet:r}){return e?ie__default.createElement("div",{className:wl(YP.divider,o),"data-type":t},r&&ie__default.createElement(v.BodyBold,{className:YP.divider__alphabet},r)):null}var Ly=e=>(e==null?void 0:e.adId)!==void 0,Vy=({pageId:e="*",componentId:t="*",items:o,isLoading:r,globalFeaturedPosts:i,isGlobalFeaturedPostsLoading:n,onFeedReachBottom:a,onPostDeleted:s})=>{let{accessibilityId:l,themeStyles:m}=se({pageId:e,componentId:t}),[c,d]=useState(null),{AmityGlobalFeedComponentBehavior:u}=we();if(ke({node:c,onIntersect:()=>{a();}}),!r&&o.length===0&&!n&&(i==null?void 0:i.length)===0)return ie__default.createElement(o0,{pageId:e});let g=(y,b)=>{if(Ly(y)){if(b&&Ly(b))return `${b.adId}-${y.adId}`;if(b)return `${b.postId}-${y.adId}`}else return y.postId},f=new Set((i==null?void 0:i.map(y=>{var b;return (b=y.post)==null?void 0:b.postId}))||[]),C=o.filter(y=>Ly(y)?!0:!f.has(y.postId));return ie__default.createElement("div",{className:rf.global_feed,style:m,"data-testid":l},i&&i.map(y=>y.post?ie__default.createElement(ie__default.Fragment,{key:y.post.postId},ie__default.createElement(Ay,{elementType:"div",className:rf.global_feed__postContainer,onPress:()=>{var b,_;return (_=u==null?void 0:u.goToPostDetailPage)==null?void 0:_.call(u,{hideTarget:!0,postId:(b=y.post)==null?void 0:b.postId,category:"announcement"})}},ie__default.createElement(en,{pageId:e,post:y.post,category:"announcement",style:"feed",isGlobalFeaturePost:!0,onPostDeleted:()=>s==null?void 0:s(y.post),onClick:()=>{var b,_;(_=u==null?void 0:u.goToPostDetailPage)==null||_.call(u,{hideTarget:!0,postId:(b=y.post)==null?void 0:b.postId,category:"announcement"});}})),ie__default.createElement(zr,null)):null),C.map((y,b)=>ie__default.createElement(ie__default.Fragment,{key:g(y,C[Math.max(0,b-1)])},ie__default.createElement(zr,{isShown:b!==0}),Ly(y)?ie__default.createElement(yz,{ad:y}):ie__default.createElement(Ay,{elementType:"div",className:rf.global_feed__postContainer,onPress:()=>{var _;return (_=u==null?void 0:u.goToPostDetailPage)==null?void 0:_.call(u,{postId:y.postId})}},ie__default.createElement(en,{pageId:e,post:y,category:"general",style:"feed",onClick:()=>{var _;(_=u==null?void 0:u.goToPostDetailPage)==null||_.call(u,{postId:y.postId});},onPostDeleted:s})))),ie__default.createElement(zr,{isShown:C.length>0}),r?Array.from({length:5}).map((y,b)=>ie__default.createElement("div",{key:b},ie__default.createElement(Rg,null),ie__default.createElement(zr,{isShown:b!==5}))):null,!r&&ie__default.createElement("div",{ref:y=>d(y),className:rf.global_feed__intersection}))};var vz=({props:e,className:t})=>ie__default.createElement("div",{className:t},ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 21 20",fill:"none"},e),ie__default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.1122 5C11.1122 5.39449 10.7924 5.71429 10.3979 5.71429C10.0035 5.71429 9.68366 5.39449 9.68366 5V0.714286C9.68366 0.319797 10.0035 0 10.3979 0C10.7924 0 11.1122 0.319797 11.1122 0.714286V5ZM8.25509 6.28846C8.59673 6.09122 8.71378 5.65437 8.51654 5.31273L6.37368 1.60119C6.17644 1.25955 5.73959 1.1425 5.39795 1.33975C5.05631 1.53699 4.93926 1.97384 5.1365 2.31548L7.27936 6.02702C7.4766 6.36865 7.91346 6.48571 8.25509 6.28846ZM6.42496 6.88141C6.7666 7.07865 6.88366 7.51551 6.68641 7.85714C6.48917 8.19878 6.05232 8.31583 5.71068 8.11859L1.99914 5.97573C1.6575 5.77849 1.54045 5.34164 1.7377 5C1.93494 4.65836 2.37179 4.54131 2.71343 4.73855L6.42496 6.88141ZM6.11224 10C6.11224 9.60551 5.79244 9.28571 5.39795 9.28571H1.11223C0.717746 9.28571 0.397949 9.60551 0.397949 10C0.397949 10.3945 0.717746 10.7143 1.11224 10.7143H5.39795C5.79244 10.7143 6.11224 10.3945 6.11224 10ZM5.71068 11.8814C6.05232 11.6842 6.48917 11.8012 6.68641 12.1429C6.88366 12.4845 6.7666 12.9213 6.42497 13.1186L2.71343 15.2614C2.37179 15.4587 1.93494 15.3416 1.7377 15C1.54045 14.6584 1.6575 14.2215 1.99914 14.0243L5.71068 11.8814ZM8.25509 13.7115C7.91345 13.5143 7.4766 13.6313 7.27936 13.973L5.1365 17.6845C4.93926 18.0262 5.05631 18.463 5.39795 18.6603C5.73959 18.8575 6.17644 18.7404 6.37368 18.3988L8.51654 14.6873C8.71378 14.3456 8.59673 13.9088 8.25509 13.7115ZM10.3979 14.2857C10.0035 14.2857 9.68366 14.6055 9.68366 15V19.2857C9.68366 19.6802 10.0035 20 10.3979 20C10.7924 20 11.1122 19.6802 11.1122 19.2857V15C11.1122 14.6055 10.7924 14.2857 10.3979 14.2857ZM12.5408 6.28846C12.8824 6.48571 13.3193 6.36865 13.5165 6.02702L15.6594 2.31548C15.8566 1.97384 15.7396 1.53699 15.3979 1.33975C15.0563 1.1425 14.6195 1.25956 14.4222 1.60119L12.2794 5.31273C12.0821 5.65437 12.1992 6.09122 12.5408 6.28846ZM15.0852 8.11859C14.7436 8.31583 14.3067 8.19878 14.1095 7.85714C13.9122 7.51551 14.0293 7.07866 14.3709 6.88141L18.0825 4.73855C18.4241 4.54131 18.861 4.65836 19.0582 5C19.2554 5.34164 19.1384 5.77849 18.7968 5.97573L15.0852 8.11859ZM14.6837 10C14.6837 10.3945 15.0035 10.7143 15.3979 10.7143H19.6837C20.0782 10.7143 20.3979 10.3945 20.3979 10C20.3979 9.60551 20.0782 9.28571 19.6837 9.28571H15.3979C15.0035 9.28571 14.6837 9.60551 14.6837 10ZM14.3709 13.1186C14.0293 12.9213 13.9122 12.4845 14.1095 12.1429C14.3067 11.8012 14.7436 11.6842 15.0852 11.8814L18.7968 14.0243C19.1384 14.2215 19.2554 14.6584 19.0582 15C18.861 15.3416 18.4241 15.4587 18.0825 15.2614L14.3709 13.1186ZM12.5408 13.7115C12.1992 13.9088 12.0821 14.3456 12.2794 14.6873L14.4222 18.3988C14.6195 18.7404 15.0563 18.8575 15.3979 18.6603C15.7396 18.463 15.8566 18.0262 15.6594 17.6845L13.5165 13.973C13.3193 13.6313 12.8824 13.5143 12.5408 13.7115Z",fill:"url(#paint0_angular_1709_10374)"}),ie__default.createElement("defs",null,ie__default.createElement("radialGradient",{id:"paint0_angular_1709_10374",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(10.3979 10) scale(10)"},ie__default.createElement("stop",{offset:"0.669733",stopColor:"#595F67"}),ie__default.createElement("stop",{offset:"0.716307",stopColor:"#262626",stopOpacity:"0.01"})))));var QP={pullToRefresh:"ay",pullToRefresh__spinner:"oy",spin:"Pt"};var Tl=forwardRef(function({style:e,children:t,className:o,accessibilityId:r,onScroll:i,onTouchEndCallback:n},a){let s=useRef(0),[l,m]=useState(0);return ie__default.createElement("div",{ref:a,style:e,className:o,"data-testid":r,onDrag:c=>c.stopPropagation(),onTouchStart:c=>{s.current=c.touches[0].clientY;},onTouchMove:c=>{let d=c.touches[0].clientY;s.current>d||m(Math.min(d-s.current,100));},onTouchEnd:()=>{s.current=0,l>=75&&(n==null||n()),m(0);},onScroll:i},ie__default.createElement("div",{className:QP.pullToRefresh,style:{"--asc-pull-to-refresh-height":`${l}px`}},ie__default.createElement(vz,{className:QP.pullToRefresh__spinner})),t)});var Uy={pollButton:"er",pollButton__icon:"ty",pollButton__input:"iy",pollButton__label:"Qt"};var _z=e=>ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none"},e),ie__default.createElement("path",{d:"M3.75 20.25V3.75",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),ie__default.createElement("path",{d:"M3.75 5.25H15.75V9.75",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),ie__default.createElement("path",{d:"M20.25 9.75H3.75V14.25H20.25V9.75Z",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),ie__default.createElement("path",{d:"M12.75 14.25V18.75H3.75",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}));function JP({onPress:e,pageId:t="*",componentId:o="*",imgIconClassName:r,defaultIconClassName:i}){let n="poll_button",{themeStyles:a,isExcluded:s,config:l,accessibilityId:m,uiReference:c,defaultConfig:d}=S({pageId:t,componentId:o,elementId:n});return s?null:ie__default.createElement(V,{style:a,className:Uy.pollButton,"data-testid":m,onPress:e},ie__default.createElement(Z,{configIconName:l.icon,defaultIconName:d.icon,imgIcon:()=>ie__default.createElement("img",{src:l.icon,alt:c,className:r}),defaultIcon:()=>ie__default.createElement(_z,{className:wl(Uy.pollButton__icon,i)})}),l.text&&ie__default.createElement(v.BodyBold,{className:Uy.pollButton__label},l.text))}var bz={storyButton:"sy"};var xz={sheetIcon:"dy"};var XP=({icon:e,className:t})=>ie__default.cloneElement(e,{className:wl(xz.sheetIcon,t)});var D7e=e=>ie__default.createElement("svg",a({fill:"none",width:"100%",height:"100%",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.725 15.8693C3.01048 16.543 3.36529 17.1702 3.78943 17.7509C4.02522 18.0737 4.49097 18.0895 4.77295 17.8061L5.22247 17.3543C5.46663 17.1089 5.48651 16.7218 5.29592 16.4329C5.02174 16.0171 4.78977 15.5739 4.6 15.103C4.40556 14.6206 4.25542 14.1181 4.14959 13.5956C4.08148 13.2593 3.79412 13.005 3.45104 13.005H2.75733C2.35178 13.005 2.03269 13.3557 2.10258 13.7552C2.23079 14.488 2.43826 15.1928 2.725 15.8693ZM2.75 8.13065C2.47847 8.80049 2.27092 9.49788 2.12735 10.2228C2.04682 10.6295 2.36816 10.995 2.78269 10.995H3.45104C3.79412 10.995 4.08148 10.7407 4.14959 10.4044C4.25542 9.88192 4.40556 9.37943 4.6 8.89699C4.78977 8.42614 5.02174 7.98285 5.29592 7.56714C5.48651 7.27817 5.46663 6.89109 5.22247 6.6457L4.77295 6.19392C4.49097 5.91052 4.02508 5.92622 3.79048 6.24992C3.36977 6.83043 3.02294 7.45734 2.75 8.13065ZM8.1125 21.2714C8.77792 21.5589 9.4735 21.7671 10.1993 21.896C10.5988 21.967 10.95 21.6477 10.95 21.2419V20.5881C10.95 20.2454 10.6961 19.9586 10.3608 19.8873C9.84547 19.7777 9.35435 19.6192 8.8875 19.4121C8.42514 19.2069 7.97791 18.9625 7.54584 18.6791C7.25662 18.4893 6.87013 18.5189 6.63049 18.7683L6.1689 19.2488C5.89002 19.5391 5.91904 20.0079 6.24969 20.2374C6.83185 20.6417 7.45279 20.9863 8.1125 21.2714ZM6.26063 3.75497C5.92576 3.98688 5.90038 4.46269 6.18769 4.75144L6.66819 5.23436C6.91418 5.48159 7.30486 5.502 7.59378 5.30667C8.00409 5.02926 8.4395 4.78968 8.9 4.58794C9.37605 4.37939 9.87893 4.22025 10.4086 4.11053C10.745 4.04085 11 3.75361 11 3.4101V2.75564C11 2.3507 10.6503 2.03172 10.2511 2.09987C9.49795 2.22845 8.78508 2.43805 8.1125 2.72864C7.45692 3.0119 6.83963 3.35401 6.26063 3.75497ZM13.5869 19.8878C13.2524 19.9574 13 20.244 13 20.5856V21.234C13 21.6427 13.3559 21.9625 13.7581 21.8903C15.9912 21.4892 17.8802 20.437 19.425 18.7337C21.1417 16.8409 22 14.5963 22 12C22 9.40368 21.1417 7.15913 19.425 5.26633C17.8802 3.56303 15.9912 2.51082 13.7581 2.1097C13.3559 2.03745 13 2.35735 13 2.766V3.41436C13 3.75603 13.2524 4.0426 13.5869 4.1122C15.343 4.47761 16.8182 5.3397 18.0125 6.69849C19.3375 8.20603 20 9.9732 20 12C20 14.0268 19.3375 15.794 18.0125 17.3015C16.8182 18.6603 15.343 19.5224 13.5869 19.8878Z",fill:"currentColor"}),ie__default.createElement("path",{d:"M17.0625 11.375C17.2812 11.375 17.5 11.5938 17.5 11.8125V12.6875C17.5 12.9336 17.2812 13.125 17.0625 13.125H13.125V17.0625C13.125 17.3086 12.9062 17.5 12.6875 17.5H11.8125C11.5664 17.5 11.375 17.3086 11.375 17.0625V13.125H7.4375C7.19141 13.125 7 12.9336 7 12.6875V11.8125C7 11.5938 7.19141 11.375 7.4375 11.375H11.375V7.4375C11.375 7.21875 11.5664 7 11.8125 7H12.6875C12.9062 7 13.125 7.21875 13.125 7.4375V11.375H17.0625Z",fill:"currentColor"})),Pz=D7e;function eI({onPress:e,pageId:t="*",componentId:o="*",defaultIconClassName:r,imgIconClassName:i}){let n="story_button",{isExcluded:a,config:s,accessibilityId:l,uiReference:m,defaultConfig:c}=S({pageId:t,componentId:o,elementId:n});return a?null:ie__default.createElement(V,{"data-testid":l,className:bz.storyButton,onPress:e},ie__default.createElement(Z,{configIconName:s.icon,defaultIconName:c.icon,imgIcon:()=>ie__default.createElement("img",{src:s.icon,alt:m,className:i}),defaultIcon:()=>ie__default.createElement(XP,{className:r,icon:ie__default.createElement(Pz,null)})}))}var tI={myTimelineAvatar:"cy",myTimelineAvatar__userAvatar:"ly"};function r0({pageId:e="*",componentId:t="*",userId:o}){let r="my_timeline_avatar",{accessibilityId:i,isExcluded:n}=S({pageId:e,componentId:t,elementId:r});return n?null:ie__default.createElement("div",{className:tI.myTimelineAvatar,"data-testid":i},ie__default.createElement(Ae,{pageId:e,componentId:t,className:tI.myTimelineAvatar__userAvatar,userId:o}))}var wz={myTimelineText:"ny"};function i0({pageId:e="*",componentId:t="*"}){let o="my_timeline_text",{accessibilityId:r,config:i,isExcluded:n,themeStyles:a$1}=S({pageId:e,componentId:t,elementId:o});return n?null:ie__default.createElement(v.Body,{className:wz.myTimelineText,style:a({},a$1),"data-testid":r},i.text)}var jr={selectPostTargetPage:"Zt",selectPostTargetPage__topBar:"_t",selectPostTargetPage__timelineContainer:"ei",selectPostTargetPage__timeline:"ri",selectPostTargetPage__line:"my",selectPostTargetPage__myCommunities:"hy",selectPostTargetPage__communityAvatar:"gy",selectPostTargetPage__communityName:"py",selectPostTargetPage__closeButton:"by",selectPostTargetPage__title:"uy",selectPostTargetPage__displayName:"fy",selectPostTargetPage__myCommunitiesList:"vy"};function Bm({isClipPost:e=!1}){let t="select_post_target_page",{onBack:o}=Y(),{isDesktop:r}=le(),{confirm:i}=Te(),{client:n,currentUserId:a}=Ne(),{themeStyles:s}=ue({pageId:t}),{openPopup:l,closePopup:m}=Se(),{user:c}=qe({userId:a}),{AmityPostTargetSelectionPage:d}=we(),[u,g]=useState(null),{communities:f,hasMore:C,loadMore:y,isLoading:b}=hs({queryParams:{limit:20,membership:"member"}}),{file:_,setFile:x}=Pl(),[P,I]=useState(null);return ke({node:u,onIntersect:()=>{C&&!b&&y();}}),useEffect(()=>{var w,M;_&&(P?(w=d==null?void 0:d.goToDraftClipPage)==null||w.call(d,{targetId:P.communityId,targetType:"community",community:f.find(T=>T.communityId===P.communityId)}):(M=d==null?void 0:d.goToDraftClipPage)==null||M.call(d,{targetId:null,targetType:"user"}));},[_,P]),ie__default.createElement("div",{className:jr.selectPostTargetPage,style:s},ie__default.createElement("div",{className:jr.selectPostTargetPage__topBar},ie__default.createElement(ot,{pageId:t,onPress:()=>o(),imgClassName:jr.selectPostTargetPage__closeButton}),ie__default.createElement(xt,{pageId:t,titleClassName:jr.selectPostTargetPage__title}),ie__default.createElement("div",null)),ie__default.createElement("div",{className:jr.selectPostTargetPage__timelineContainer},e?ie__default.createElement(FileTrigger,{acceptedFileTypes:["video/*"],onSelect:w=>{if(w){let M=Array.from(w);M.length>0&&(I(null),x(M[0]));}}},ie__default.createElement(V,{className:jr.selectPostTargetPage__timeline,key:"timeline-button"},ie__default.createElement(r0,{pageId:t,userId:c==null?void 0:c.userId}),ie__default.createElement(i0,{pageId:t}))):ie__default.createElement(V,{className:jr.selectPostTargetPage__timeline,onPress:()=>{var w;r?l({pageId:t,view:"desktop",isDismissable:!1,onClose:()=>{i({type:"confirm",onOk:m,okText:"Discard",cancelText:"Keep editing",title:"Discard this post?",pageId:"post_composer_page",content:"The post will be permanently discarded. It cannot be undone."});},header:ie__default.createElement(Mo,{community:void 0,pageId:"post_composer_page",className:jr.selectPostTargetPage__displayName}),children:ie__default.createElement(ki,{targetId:null,targetType:"user",mode:"create",community:void 0})}):(w=d==null?void 0:d.goToPostComposerPage)==null||w.call(d,{mode:"create",targetId:null,targetType:"user",community:void 0});}},ie__default.createElement(r0,{pageId:t,userId:c==null?void 0:c.userId}),ie__default.createElement(i0,{pageId:t}))),ie__default.createElement("div",{className:jr.selectPostTargetPage__line}),ie__default.createElement("div",{className:jr.selectPostTargetPage__myCommunities},"My Communities"),ie__default.createElement("div",{className:jr.selectPostTargetPage__myCommunitiesList},f.filter(w=>Pm(n,w)).map(w=>e?ie__default.createElement(FileTrigger,{key:w.communityId,acceptedFileTypes:["video/*"],onSelect:M=>{if(M){let T=Array.from(M);T.length>0&&(I(w),x(T[0]));}}},ie__default.createElement(V,{className:jr.selectPostTargetPage__timeline},ie__default.createElement("div",{className:jr.selectPostTargetPage__communityAvatar},ie__default.createElement(ti,{pageId:t,community:w})),ie__default.createElement("div",{className:jr.selectPostTargetPage__communityName},!w.isPublic&&ie__default.createElement(ar,null),ie__default.createElement(Mo,{pageId:t,community:w}),w.isOfficial&&ie__default.createElement(sr,null)))):ie__default.createElement(V,{key:w.communityId,className:jr.selectPostTargetPage__timeline,onPress:()=>{var M;r?l({pageId:t,view:"desktop",isDismissable:!1,onClose:({close:T})=>{i({onOk:T,type:"confirm",okText:"Discard",cancelText:"Keep editing",title:"Discard this post?",pageId:"post_composer_page",content:"The post will be permanently discarded. It cannot be undone."});},header:ie__default.createElement(Mo,{community:w,pageId:"post_composer_page",className:jr.selectPostTargetPage__displayName}),children:ie__default.createElement(ki,{mode:"create",community:w,targetType:"community",targetId:w.communityId})}):(M=d==null?void 0:d.goToPostComposerPage)==null||M.call(d,{mode:"create",community:w,targetType:"community",targetId:w.communityId});}},ie__default.createElement("div",{className:jr.selectPostTargetPage__communityAvatar},ie__default.createElement(ti,{pageId:t,community:w})),ie__default.createElement("div",{className:jr.selectPostTargetPage__communityName},!w.isPublic&&ie__default.createElement(ar,null),ie__default.createElement(Mo,{pageId:t,community:w}),w.isOfficial&&ie__default.createElement(sr,null))))),ie__default.createElement("div",{ref:w=>g(w)}))}var Vn={pollTargetSelectionPage:"ai",pollTargetSelectionPage__topBar:"oi",pollTargetSelectionPage__timelineContainer:"ti",pollTargetSelectionPage__timeline:"ii",pollTargetSelectionPage__line:"wy",pollTargetSelectionPage__myCommunities:"xy",pollTargetSelectionPage__communityAvatar:"yy",pollTargetSelectionPage__communityName:"ky",pollTargetSelectionPage__closeButton:"jy",pollTargetSelectionPage__title:"zy",pollTargetSelectionPage__displayName:"Xy"};var kt={pollPostComposerPage__container:"si",pollPostComposerPage__form:"di",pollPostComposerPage__topBar:"ci",pollPostComposerPage__topBar__displayName:"Yy",pollPostComposerPage__pollQuestion:"Iy",pollPostComposerPage__pollQuestion__mention:"li",pollPostComposerPage__pollQuestion__label:"Ay",pollPostComposerPage__pollQuestion__limit:"My",pollPostComposerPage__pollQuestion__input:"ni",pollPostComposerPage__pollQuestion__placeholder:"Sy",pollPostComposerPage__pollOptions:"Cy",pollPostComposerPage__pollOptions__validationWrap:"Ey",pollPostComposerPage__pollQuestion__validationWrap:"Ry",pollPostComposerPage__pollQuestion__validationText:"Uy",pollPostComposerPage__pollOptions__options:"By",pollPostComposerPage__pollOptions__label:"Fy",pollPostComposerPage__pollOptions__optionsWrapper:"Hy",pollPostComposerPage__pollOptions__input:"T",pollPostComposerPage__pollOptions__trashIcon:"Ly",pollPostComposerPage__pollOptions__trashButton:"Ty",pollPostComposerPage__answerType:"Vy",pollPostComposerPage__duration:"Wy",pollPostComposerPage__duration__button:"qy",pollPostComposerPage__duration__dropdownIcon:"Dy",pollPostComposerPage__duration__captionWrap:"Gy",pollPostComposerPage__duration__caption:"Jy",pollPostComposerPage__overlay:"Ky",pollPostComposerPage_notificationIcon:"Ny",pollPostComposerPage__postButtonWrap:"Oy",pollPostComposerPage__postButton:"Py",pollPostComposerPage__notificationWrapper:"Qy"};var Sz=({pageId:e="*",componentId:t="*"})=>{let o="poll_question_title",{accessibilityId:r,themeStyles:i,config:n}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement(v.TitleBold,{style:i,"data-testid":r},n.text)};var oI=({pageId:e="*",componentId:t="*"})=>{let o="poll_options_title",{accessibilityId:r,themeStyles:i,config:n}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement(v.TitleBold,{style:i,"data-testid":r},n.text)};var Nz={pollOptionsDesc__title:"Zy"};var rI=({pageId:e="*",componentId:t="*"})=>{let o="poll_options_desc",{accessibilityId:r,themeStyles:i,config:n}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement(v.Caption,{className:Nz.pollOptionsDesc__title,style:i,"data-testid":r},n.text)};var iI={pollAddOptionButton__addOptionButton:"_y",pollAddOptionButton__plusIcon:"e2"};var kz=({pageId:e="*",componentId:t="*",onPress:o})=>{let r="poll_add_option_button",{config:i,themeStyles:n,accessibilityId:a,uiReference:s,defaultConfig:l}=S({pageId:e,componentId:t,elementId:r});return ie__default.createElement(oe,{style:n,"data-testid":a,size:"medium",variant:"outlined",color:"secondary",onPress:o,className:iI.pollAddOptionButton__addOptionButton,icon:({className:m})=>ie__default.createElement(Z,{configIconName:i.icon,defaultIconName:l.icon,imgIcon:()=>ie__default.createElement("img",{src:i.icon,alt:s}),defaultIcon:()=>ie__default.createElement(br,{className:wl(m,iI.pollAddOptionButton__plusIcon)})})},"Add Option")};var nI=({pageId:e="*",componentId:t="*"})=>{let o="poll_multiple_selection_title",{config:r,themeStyles:i,accessibilityId:n}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement(v.TitleBold,{"data-testid":n,style:i},r.text)};var Bz={pollMultipleSelectionDesc__text:"r2"};var aI=({pageId:e="*",componentId:t="*"})=>{let o="poll_multiple_selection_desc",{config:r,themeStyles:i,accessibilityId:n}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement(v.Caption,{"data-testid":n,style:i,className:Bz.pollMultipleSelectionDesc__text},r.text)};var sI=({pageId:e="*",componentId:t="*"})=>{let o="poll_duration_title",{config:r,themeStyles:i,accessibilityId:n}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement(v.TitleBold,{"data-testid":n,style:i},r.text)};var Ez={pollDurationDesc__text:"a2"};var Az=({pageId:e="*",componentId:t="*"})=>{let o="poll_duration_desc",{config:r,themeStyles:i,accessibilityId:n}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement(v.Caption,{"data-testid":n,style:i,className:Ez.pollDurationDesc__text},r.text)};var Ml={pollDurationOptions__container:"mi",pollDurationOptions__calendar:"o2",pollDurationOptions__optionsLabel:"t2",pollDurationOptions__pickDateTime:"i2",pollDurationOptions__angleRightIcon:"s2",pollDurationOptions__radio:"hi",pollDurationOptions__customRadio:"ge",pollDurationOptions__hiddenRadio:"rr",calendar:"d2",calendarNav:"c2",calendar__navRight:"l2",calendar__navLeft:"n2"};var La={calendar:"m2",calendar__subHeader:"h2",calendar__navRight:"gi",calendar__navLeft:"pi",calendar__navButton:"bi",calendar__heading:"g2",calendar__grid:"p2",calendar__cell:"V",calendar__buttonWrap:"b2"};var lI=({pageId:e="*",componentId:t="*",date:o,setDate:r,defaultValue:i,minValue:n,maxValue:a,isDisabledDate:s=!1})=>{let l=today(getLocalTimeZone()),m="calendar",{accessibilityId:c}=S({pageId:e,componentId:t,elementId:m});return ie__default.createElement(Calendar,{value:o,defaultValue:i!=null?i:l,defaultFocusedValue:i!=null?i:l,onChange:r,className:La.calendar,"aria-label":"Select a date",minValue:n!=null?n:void 0,maxValue:a!=null?a:void 0},ie__default.createElement("header",{className:La.calendarHeader},ie__default.createElement("div",{className:La.calendar__subHeader},ie__default.createElement(Heading,{slot:"title","aria-label":"calendar-heading",className:La.calendar__heading}),ie__default.createElement("div",{className:La.calendar__buttonWrap},ie__default.createElement(V,{className:La.calendar__navButton,slot:"previous","aria-disabled":s},ie__default.createElement(sc,{className:La.calendar__navLeft})),ie__default.createElement(V,{className:La.calendar__navButton,slot:"next","aria-disabled":s},ie__default.createElement(sc,{className:La.calendar__navRight}))))),ie__default.createElement(CalendarGrid,{className:La.calendar__grid},d=>ie__default.createElement(CalendarCell,{"data-testid":c,"data-istoday":d.toString()===l.toString(),date:d,className:La.calendar__cell,"aria-disabled":s,"data-selected":d.toString()===o.toString()})))};var Xc={timeField__container:"u2",timeField__wrap:"f2",timeField__label:"v2",timeField__dateInput:"w2",timeField__dateSegment:"x2",timeField__validateText:"y2"};var mI=({pageId:e="*",componentId:t="*",defaultValue:o,value:r,minValue:i,onChange:n})=>{let a="time_field",{accessibilityId:s}=S({pageId:e,componentId:t,elementId:a});return ie__default.createElement(TimeField,{value:r,onChange:n,defaultValue:o,hourCycle:12,autoFocus:!0,minValue:i||void 0,className:Xc.timeField__container},ie__default.createElement("div",{className:Xc.timeField__wrap},ie__default.createElement(Label,{className:Xc.timeField__label},"Time"),ie__default.createElement(DateInput,{"data-testid":s,className:Xc.timeField__dateInput},l=>ie__default.createElement(DateSegment,{segment:l,className:Xc.timeField__dateSegment}))),ie__default.createElement(FieldError,{className:Xc.timeField__validateText}))};var zy=({pageId:e="*",timeDuration:t,duration:o,selectedDate:r,selectedTime:i,onChange:n,onClose:a,onChangeDate:s,onChangeTime:l})=>{let m="poll_duration_options",{themeStyles:c,accessibilityId:d}=se({pageId:e,componentId:m});le();let g=now(getLocalTimeZone()),[f,C]=useState(o),[y,b]=useState(!1),[_,x]=useState(r!=null?r:today(getLocalTimeZone())),[P,I]=useState(i!=null?i:new Time(g.hour,g.minute)),[w,M]=useState(void 0),T=today(getLocalTimeZone()),E=T.add({days:30}),N=_<T||_>E,A=$=>{n($),C($),s==null||s(void 0),l==null||l(void 0);},D=$=>I($),G=$=>x($),H=()=>{s==null||s(_),l==null||l(P),C(void 0),n(void 0),a==null||a();};return useEffect(()=>{M((_==null?void 0:_.toString())===today(getLocalTimeZone()).toString()?new Time(g.hour,g.minute):void 0);},[_]),ie__default.createElement("div",{style:c,"data-testid":d,className:Ml.pollDurationOptions__container},y?ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("div",{className:Ml.pollDurationOptions__calendar},ie__default.createElement("div",{className:Ml.calendarNav},ie__default.createElement(ze,{onPress:()=>b(!1)}),ie__default.createElement(v.TitleBold,null,"Ends on"),ie__default.createElement(oe,{slot:null,variant:"text",onPress:H,isDisabled:w&&P<w},"Done")),ie__default.createElement(mI,{pageId:e,componentId:m,value:P,onChange:D,defaultValue:new Time(g.hour,g.minute),minValue:w}),ie__default.createElement(lI,{pageId:e,componentId:m,date:_,defaultValue:T,setDate:G,"aria-label":"Select a date",minValue:T,maxValue:E,isDisabledDate:N}))):ie__default.createElement(ie__default.Fragment,null,t.map($=>ie__default.createElement(Label,{key:$.value,htmlFor:`duration-${$.value}`,className:Ml.pollDurationOptions__optionsLabel},ie__default.createElement("div",null,ie__default.createElement(v.Body,null,$.label)),ie__default.createElement(Input,{"aria-label":"poll_duration_options_radio","data-testid":`${e}/${m}/poll_duration_options_radio`,type:"radio",id:`duration-${$.value}`,value:$.value,onChange:()=>{A($);},className:`${Ml.pollDurationOptions__radio} ${Ml.pollDurationOptions__hiddenRadio}`,checked:f!==void 0&&(f==null?void 0:f.value)===$.value}),ie__default.createElement("span",{className:Ml.pollDurationOptions__customRadio}))),ie__default.createElement(V,{onPress:()=>b(!0),className:Ml.pollDurationOptions__pickDateTime},ie__default.createElement(v.Body,null,"Pick date and time"),ie__default.createElement(du,{className:Ml.pollDurationOptions__angleRightIcon}))))};var Fz=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M19.6289 9.15625C19.8047 9.29688 19.8047 9.57812 19.6289 9.75391L12.2812 17.1016C12.1055 17.2773 11.8594 17.2773 11.6836 17.1016L4.33594 9.75391C4.16016 9.57812 4.16016 9.29688 4.33594 9.15625L5.00391 8.45312C5.17969 8.27734 5.46094 8.27734 5.60156 8.45312L12 14.8164L18.3633 8.45312C18.5039 8.27734 18.7852 8.27734 18.9609 8.45312L19.6289 9.15625Z",fill:e.fill}));var pI=e=>{if(!e)return;let t=new Date;return t.setHours(e.hour,e.minute,0),new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}).format(t)};var Dz=e=>new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short"}).format(e);var Vz=(e,t)=>{if(!e||!t)return;let o=new Date(e.year,e.month-1,e.day,t.hour,t.minute,t.second||0,0),r=Date.now();return o.getTime()-r};var uI={switch:"l",switch__indicator:"t"};function Em(r){var i=r,{label:e,className:t}=i,o=d(i,["label","className"]);return ie__default.createElement(Switch,b(a({},o),{className:wl(uI.switch,t)}),ie__default.createElement("div",{className:uI.switch__indicator}),e)}var mf=500,Oz=10,gI=60,A8e=864e5,$y=[{value:1,label:"1 day"},{value:3,label:"3 days"},{value:7,label:"7 days"},{value:14,label:"14 days"},{value:30,label:"30 days"}],Un=({targetId:e,targetType:t})=>{let o="poll_post_composer_page",{themeStyles:r,accessibilityId:i}=ue({pageId:o}),{onBack:n,prevPage:a$1}=Y(),{community:s}=Ct({communityId:e}),{moderators:l$1}=Lo({communityId:s==null?void 0:s.communityId}),m=ce(),{online:c}=useNetworkState(),{closePopup:d}=Se(),{confirm:u,info:g}=Te(),{setDrawerData:f,removeDrawerData:C}=tt(),y=useRef(null),{currentUserId:b$1}=Xt(),{user:_}=qe({userId:b$1}),x=now(getLocalTimeZone()),{prependItem:P}=Fn(),{isDesktop:I}=le(),[w,M]=useState(!1),[T,E]=useState(!1),[N,A]=useState([{dataType:"text",data:""},{dataType:"text",data:""}]),[D,G]=useState(!1),[H,$]=useState($y[4]),[j,O]=useState(void 0),[z,k]=useState(void 0),[F,re]=useState({pollId:"",text:"",mentioned:[],mentionees:[{type:"user",userIds:[""]}]}),W=D?"multiple":"single",ne=z?pI(z):pI(new Time(x.hour,x.minute)),te=j&&new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short"}).format(j.toDate(getLocalTimeZone())),Q=new Date;H&&Q.setDate(Q.getDate()+H.value);let me=Dz(Q),X=Vz(j,z),q=F.text.length>0||N.some(K=>K.data.length>0||K.data.trim()!=="")||D||(H==null?void 0:H.value)!==$y[4].value||j,ae=H&&!X?H.value*A8e:X,Ee={question:"",answers:[],answerType:"single",closedIn:0},{handleSubmit:J}=useForm({defaultValues:Ee});function R(K){return l(this,null,function*(){try{M(!0);let Ce=yield PostRepository.createPost(K),he=Ce.data,Pe=(l$1||[]).find(Ht=>Ht.userId===he.postedUserId)!=null;(s.needApprovalOnPostCreation||(s==null?void 0:s.postSetting)===CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED)&&!Pe&&!Yu(_==null?void 0:_.roles)?g({pageId:o,content:"Your post has been submitted to pending list. It will be review by community moderator.",okText:"OK"}):P(Ce.data);}catch(Ce){E(!0),Ce instanceof Error&&Ce.message===xr.CONTAIN_BLOCKED_WORD&&m.info({content:"Text contain blocked word."});}finally{M(!1),I?d():(a$1==null?void 0:a$1.type)==="PollTargetSelectionPage"?n(2):n();}})}function be(K){return l(this,null,function*(){var Pe;let Ce={};if((Pe=Ce.text)!=null&&Pe.length&&Ce.text.length>5e4){g({pageId:o,title:"Unable to post",content:"You have reached maximum 50,000 characters in a post.",okText:"Done"});return}if(!e)return;let he={targetId:e,targetType:t,data:{pollId:K,text:F.text},dataType:"poll",metadata:{mentioned:F.mentioned},mentionees:F.mentionees,attachments:[]};return R(he)})}let xe=K=>l(void 0,null,function*(){if(!c){m.info({content:"Failed to create post. Please try again.",alignment:"fixed"});return}try{M(!0);let Ce={question:F.text,answers:N,answerType:W,closedIn:ae},he=yield PollRepository.createPoll(Ce);yield be(he.data.pollId);}finally{M(!1),I&&d();}}),Xe=()=>{if(!q)return (a$1==null?void 0:a$1.type)=="PollTargetSelectionPage"?n(-2):n();u({pageId:o,type:"confirm",title:"Discard this post?",content:"The post will be permanently discarded. It cannot be undone.",onOk:()=>{(a$1==null?void 0:a$1.type)=="PollTargetSelectionPage"?n(-2):n();},okText:"Discard",cancelText:"Keep editing"});},Qe=K=>re(Ce=>b(a({},Ce),{mentioned:K.mentioned,text:K.text,mentionees:K.mentionees})),ht=()=>{N.length<Oz&&A([...N,{dataType:"text",data:""}]);},Zt=(K,Ce)=>{let he=N.map((Pe,Ht)=>Ht===K?b(a({},Pe),{data:Ce}):Pe);A(he);},Bt=K=>{let Ce=N.filter((he,Pe)=>Pe!==K);A(Ce);},so=K=>{K.key==="Enter"&&K.preventDefault();},lo=()=>G(!D),ve=K=>$(K),$e=K=>O(K),pe=K=>k(K),Me=w||F.text.trim()===""||F.text.length>mf||N.length<2||N.some(K=>K.data.length>gI||K.data.length===0||K.data.trim()==="");return ie__default.createElement("div",{style:r,"data-testid":i,className:kt.pollPostComposerPage__container},ie__default.createElement(Form,{id:"pollPostComposer",className:kt.pollPostComposerPage__form,onSubmit:J(xe)},ie__default.createElement("div",{className:kt.pollPostComposerPage__topBar},ie__default.createElement(ot,{pageId:o,onPress:Xe}),ie__default.createElement(Mo,{pageId:o,community:s,className:kt.pollPostComposerPage__topBar__displayName}),ie__default.createElement(oe,{size:"medium",variant:"text",color:"primary",type:"submit",isDisabled:Me},"Post")),ie__default.createElement(TextField,{name:"question",className:kt.pollPostComposerPage__pollQuestion},ie__default.createElement(Label,{className:kt.pollPostComposerPage__pollQuestion__label},ie__default.createElement(Sz,{pageId:o}),ie__default.createElement("span",{className:kt.pollPostComposerPage__pollQuestion__limit},F.text.length,"/",mf)),ie__default.createElement(qc,{"data-input-validation":F.text.length<=mf,isValidInput:F.text.length<=mf,pageId:o,communityId:e,dataValue:{data:{text:F.text}},mentionContainer:y.current,onChange:Qe,className:kt.pollPostComposerPage__pollQuestion__input,placeholderClassName:kt.pollPostComposerPage__pollQuestion__placeholder,placeholder:"What\u2019s your poll question?"}),F.text.length>mf&&ie__default.createElement("div",{className:kt.pollPostComposerPage__pollQuestion__validationWrap},ie__default.createElement(v.Caption,{className:kt.pollPostComposerPage__pollQuestion__validationText},"Poll question cannot exceed 500 characters."))),ie__default.createElement("div",{ref:y,className:kt.pollPostComposerPage__pollQuestion__mention,"data-testid":`${o}/mention_text_input_options`}),ie__default.createElement(TextField,{name:"answers",className:kt.pollPostComposerPage__pollOptions},ie__default.createElement(Label,{className:kt.pollPostComposerPage__pollOptions__label},ie__default.createElement(oI,{pageId:o}),ie__default.createElement(rI,{pageId:o})),N.map((K,Ce)=>ie__default.createElement("div",{className:kt.pollPostComposerPage__pollOptions__options},ie__default.createElement("div",{className:kt.pollPostComposerPage__pollOptions__optionsWrapper},ie__default.createElement(TextArea,{"data-isvalid":K.data.length<=gI,className:kt.pollPostComposerPage__pollOptions__input,value:K.data,placeholder:`Option ${Ce+1}`,onChange:he=>Zt(Ce,he.target.value),rows:1,onKeyDown:so}),ie__default.createElement(V,{className:kt.pollPostComposerPage__pollOptions__trashButton,onPress:()=>Bt(Ce)},ie__default.createElement(Dn,{className:kt.pollPostComposerPage__pollOptions__trashIcon}))),K.data.length>gI&&ie__default.createElement("div",{className:kt.pollPostComposerPage__pollOptions__validationWrap},ie__default.createElement(v.Caption,{className:kt.pollPostComposerPage__pollQuestion__validationText},"Poll option cannot exceed 60 characters.")))),N.length<Oz&&ie__default.createElement(kz,{onPress:ht,pageId:o})),ie__default.createElement(TextField,{name:"answerType",className:kt.pollPostComposerPage__answerType},ie__default.createElement(Label,{className:kt.pollPostComposerPage__answerType__label},ie__default.createElement(nI,{pageId:o}),ie__default.createElement(aI,{pageId:o})),ie__default.createElement(Em,{isSelected:D,onChange:lo,"data-testid":o})),ie__default.createElement(TextField,{"aria-label":"pick-date-time",name:"closedIn",className:kt.pollPostComposerPage__duration},ie__default.createElement(Label,null,ie__default.createElement(sI,{pageId:o}),ie__default.createElement(Az,{pageId:o})),ie__default.createElement(ft,{placement:"bottom",trigger:({isDesktop:K,isOpen:Ce,openPopover:he,closePopover:Pe})=>ie__default.createElement(V,{className:kt.pollPostComposerPage__duration__button,onPress:()=>{K?he():f({content:ie__default.createElement(zy,{pageId:o,timeDuration:$y,duration:H,selectedDate:j,selectedTime:z,onChange:ve,onClose:C,onChangeDate:$e,onChangeTime:pe})});}},ie__default.createElement(v.Body,null,j?`Ends on ${te} at ${ne}`:H&&H.label),ie__default.createElement(Fz,{className:kt.pollPostComposerPage__duration__dropdownIcon})),"aria-label":"poll_duration_options"},({closePopover:K})=>ie__default.createElement(zy,{pageId:o,timeDuration:$y,duration:H,selectedDate:j,selectedTime:z,onChange:ve,onClose:K,onChangeDate:$e,onChangeTime:pe}))),!j&&ie__default.createElement("div",{className:kt.pollPostComposerPage__duration__captionWrap},ie__default.createElement(v.Caption,{className:kt.pollPostComposerPage__duration__caption},`Ends on ${me} at ${ne}`)),I&&ie__default.createElement("div",{className:kt.pollPostComposerPage__postButtonWrap},ie__default.createElement(oe,{type:"submit",isDisabled:Me,className:kt.pollPostComposerPage__postButton},"Post"))),ie__default.createElement("div",{className:kt.pollPostComposerPage__notificationWrapper},w&&ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("div",{className:kt.pollPostComposerPage__overlay}),ie__default.createElement(Ur,{icon:ie__default.createElement(Ia,null),content:"Posting...",alignment:"fixed"})),T&&ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("div",{className:kt.pollPostComposerPage__overlay}),ie__default.createElement(Ur,{duration:3e3,content:"Failed to create post",alignment:"fixed",icon:ie__default.createElement(Co,{className:kt.createPost_notificationIcon})}))))};function Am(){let{client:e}=Ne(),t="select_poll_target_page",{themeStyles:o}=ue({pageId:t}),{onBack:r}=Y(),{communities:i,hasMore:n,loadMore:a,isLoading:s}=hs({queryParams:{limit:20,membership:"member"}}),{AmityPollTargetSelectionPageBehavior:l}=we(),{currentUserId:m}=Ne(),{user:c}=qe({userId:m}),{isDesktop:d}=le(),{openPopup:u}=Se(),{confirm:g}=Te(),[f,C]=useState(null);return ke({onIntersect:()=>{n&&s===!1&&a();},node:f}),ie__default.createElement("div",{className:Vn.pollTargetSelectionPage,style:o},ie__default.createElement("div",{className:Vn.pollTargetSelectionPage__topBar},ie__default.createElement(ot,{pageId:t,onPress:()=>r(),imgClassName:Vn.pollTargetSelectionPage__closeButton}),ie__default.createElement(xt,{pageId:t,titleClassName:Vn.pollTargetSelectionPage__title}),ie__default.createElement("div",null)),ie__default.createElement("div",{className:Vn.pollTargetSelectionPage__timelineContainer},ie__default.createElement(V,{className:Vn.pollTargetSelectionPage__timeline,onPress:()=>{var y;d?u({pageId:t,view:"desktop",isDismissable:!1,onClose:({close:b})=>{g({onOk:b,type:"confirm",okText:"Discard",cancelText:"Keep editing",title:"Discard this post?",pageId:"post_composer_page",content:"The post will be permanently discarded. It cannot be undone."});},header:ie__default.createElement(Mo,{community:void 0,pageId:"post_composer_page",className:Vn.pollTargetSelectionPage__displayName}),children:ie__default.createElement(Un,{targetId:null,targetType:"user"})}):(y=l==null?void 0:l.goToPollPostComposerPage)==null||y.call(l,{targetId:null,targetType:"user"});}},ie__default.createElement(r0,{pageId:t,userId:c==null?void 0:c.userId}),ie__default.createElement(i0,{pageId:t}))),ie__default.createElement("div",{className:Vn.pollTargetSelectionPage__line}),ie__default.createElement("div",{className:Vn.pollTargetSelectionPage__myCommunities},"My Communities"),i.filter(y=>Pm(e,y)).map(y=>ie__default.createElement(V,{key:y.communityId,className:Vn.pollTargetSelectionPage__timeline,onPress:()=>{var b;d?u({pageId:t,view:"desktop",isDismissable:!1,onClose:({close:_})=>{g({onOk:_,type:"confirm",okText:"Discard",cancelText:"Keep editing",title:"Discard this post?",pageId:"post_composer_page",content:"The post will be permanently discarded. It cannot be undone."});},header:ie__default.createElement(Mo,{community:y,pageId:"post_composer_page",className:Vn.pollTargetSelectionPage__displayName}),children:ie__default.createElement(Un,{targetType:"community",targetId:y.communityId})}):(b=l==null?void 0:l.goToPollPostComposerPage)==null||b.call(l,{targetType:"community",targetId:y.communityId});}},ie__default.createElement("div",{className:Vn.pollTargetSelectionPage__communityAvatar},ie__default.createElement(ti,{pageId:t,community:y})),ie__default.createElement("div",{className:Vn.pollTargetSelectionPage__communityName},!y.isPublic&&ie__default.createElement(ar,null),ie__default.createElement(Mo,{pageId:t,community:y}),y.isOfficial&&ie__default.createElement(sr,null)))),ie__default.createElement("div",{ref:y=>C(y)}))}var vs={selectStoryTargetPage:"ui",selectStoryTargetPage__skeletonContainer:"k2",selectStoryTargetPage__topBar:"fi",selectStoryTargetPage__timeline:"j2",selectStoryTargetPage__line:"z2",selectStoryTargetPage__myCommunities__container:"X2",selectStoryTargetPage__communityItem_container:"Y2",selectStoryTargetPage__myCommunities_text:"vi",selectStoryTargetPage__communityAvatar:"I2",selectStoryTargetPage__communityName:"A2",selectStoryTargetPage__closeButton:"M2",selectStoryTargetPage__title:"S2"};var Zy={communitySmallListSekeleton:"C2",communitySmallListSekeleton__avatar:"wi",communitySmallListSekeleton__displayName:"xi","skeleton-pulse":"yi"};var zz=()=>ie__default.createElement("div",{className:Zy.communitySmallListSekeleton},ie__default.createElement("div",{className:Zy.communitySmallListSekeleton__avatar}),ie__default.createElement("div",{className:Zy.communitySmallListSekeleton__displayName}));function Lm(){let e="select_story_target_page",{themeStyles:t}=ue({pageId:e}),{onBack:o}=Y(),{closePopup:r}=Se(),{communities:i,hasMore:n,loadMore:a,isLoading:s}=hs({queryParams:{limit:20,membership:"member"}}),{AmityStoryTargetSelectionPage:l}=we(),{file:m,setFile:c}=In(),{client:d}=Ne(),[u,g]=useState(null),[f,C]=useState(null),y=P=>{C(P);},b=P=>{P&&P.length>0&&f&&c(P[0]);},_=()=>ie__default.createElement("div",{className:vs.selectStoryTargetPage__skeletonContainer},Array.from({length:7}).map((P,I)=>ie__default.createElement(zz,{key:I}))),x=i.filter(P=>Pm(d,P)).map(P=>ie__default.createElement(FileTrigger,{key:P.communityId,onSelect:b},ie__default.createElement(V,{onPress:()=>y(P.communityId)},ie__default.createElement("div",{className:vs.selectStoryTargetPage__communityItem_container},ie__default.createElement("div",{className:vs.selectStoryTargetPage__communityAvatar},ie__default.createElement(ti,{pageId:e,community:P})),ie__default.createElement("div",{className:vs.selectStoryTargetPage__communityName},!P.isPublic&&ie__default.createElement(ar,null),ie__default.createElement(Mo,{pageId:e,community:P}),P.isOfficial&&ie__default.createElement(sr,null))))));return ke({onIntersect:()=>{n&&s===!1&&a();},node:u}),useEffect(()=>{var P;m&&((P=l==null?void 0:l.goToStoryCreationPage)==null||P.call(l,{targetId:f,targetType:"community",mediaType:m&&(m!=null&&m.type.includes("image"))?{type:"image",url:URL.createObjectURL(m)}:{type:"video",url:URL.createObjectURL(m)},storyType:"globalFeed"}),r());},[m]),ie__default.createElement("div",{className:vs.selectStoryTargetPage,style:t},ie__default.createElement("div",{className:vs.selectStoryTargetPage__topBar},ie__default.createElement(ot,{imgClassName:vs.selectStoryTargetPage__closeButton,pageId:e,onPress:()=>o()}),ie__default.createElement(xt,{pageId:e,titleClassName:vs.selectStoryTargetPage__title}),ie__default.createElement("div",null)),ie__default.createElement(v.Body,{className:vs.selectStoryTargetPage__myCommunities_text},"My Communities"),ie__default.createElement("div",{className:vs.selectStoryTargetPage__myCommunities__container},x,s&&_()),ie__default.createElement("div",{ref:P=>g(P)}))}var ra={postComposer:"ki",postComposer__avatar:"E2",postComposer__input:"ji",postComposer__title:"R2",postComposer__popup:"zi",postComposer__button:"U2",postComposer__avatarPlaceholder:"B2"};function Rc({pageId:e="*",communityId:t,onClickPost:o,onClickPoll:r,onSelectFile:i}){let n="post_composer",{currentUserId:a}=Ne();Y();let {openPopup:l}=Se(),{user:m,isLoading:c}=qe({userId:a}),{hasStoryPermission:d}=Ma(t);rt({fileId:m==null?void 0:m.avatarFileId,imageSize:"small"});let {accessibilityId:g,themeStyles:f}=se({pageId:e,componentId:n}),C=()=>{if(o)return o();l({pageId:e,componentId:n,view:"desktop",header:ie__default.createElement(xt,{pageId:"select_post_target_page",titleClassName:ra.postComposer__title}),children:ie__default.createElement(Bm,null)});},y=()=>{l({pageId:e,componentId:n,view:"desktop",header:ie__default.createElement(xt,{pageId:"select_story_target_page",titleClassName:ra.postComposer__title}),children:ie__default.createElement(Lm,null)});},b=()=>{if(r){r();return}l({pageId:e,componentId:n,view:"desktop",header:ie__default.createElement(xt,{pageId:"select_poll_target_page",titleClassName:ra.postComposer__title}),children:ie__default.createElement(Am,null)});},_=()=>{let x=e==="user_profile_page",P=e==="community_profile_page";return !d||d&&x?null:P?ie__default.createElement(FileTrigger,{onSelect:i},ie__default.createElement(eI,{pageId:e,componentId:n,defaultIconClassName:ra.postComposer__button})):ie__default.createElement(eI,{pageId:e,componentId:n,defaultIconClassName:ra.postComposer__button,onPress:y})};return ie__default.createElement("div",{className:ra.postComposer,"data-testid":g,style:f},ie__default.createElement(Ae,{pageId:e,userId:m==null?void 0:m.userId,componentId:n,className:ra.postComposer__avatar,imageContainerClassName:ra.postComposer__avatar,textPlaceholderClassName:ra.postComposer__avatarPlaceholder}),ie__default.createElement(V,{className:ra.postComposer__input,onPress:C},"What's going on?"),ie__default.createElement(ls,{onPress:C,pageId:e,componentId:n,defaultIconClassName:ra.postComposer__button}),ie__default.createElement(Vc,{onPress:C,pageId:e,componentId:n,defaultIconClassName:ra.postComposer__button}),ie__default.createElement(JP,{onPress:b,pageId:"post_composer_page",componentId:"poll_button"}),_())}var Gz={newsfeed:"Xi",newsfeed__postList:"F2",newsfeed__postContainer:"H2",newsfeed__post__reactionBar__leftPane__icon:"L2",newsfeed__post__reactionBar__leftPane__iconImg:"T2",newsfeed__post__reactionBar:"V2",newsfeed__post__reactionBar__leftPane:"W2",newsfeed__post__reactionBar__rightPane:"q2"};var Wy=({pageId:e="*"})=>{let t="newsfeed",{themeStyles:o}=se({pageId:e,componentId:t}),{itemWithAds:r,hasMore:i,isLoading:n,globalFeaturedPostsItems:a,isGlobalFeaturedPostsLoading:s,loadMore:l,refetch:m,removeItem:c}=Fn(),d=()=>{i&&!n&&(l==null||l());};return r.length===0&&!n?ie__default.createElement(o0,{pageId:e}):ie__default.createElement(Tl,{className:Gz.newsfeed,style:o,onTouchEndCallback:m},ie__default.createElement(zr,null),ie__default.createElement(Bu,{type:"globalFeed",pageId:e}),ie__default.createElement(zr,null),ie__default.createElement(Rc,{pageId:e}),ie__default.createElement(Vy,{pageId:e,items:r,isLoading:n,componentId:t,onFeedReachBottom:()=>d(),onPostDeleted:u=>{u&&u.postId&&c(u.postId);},globalFeaturedPosts:a,isGlobalFeaturedPostsLoading:s}))};var qy={postCreationButton:"D2",postCreationButton__icon:"G2"};var G8e=e=>ie__default.createElement("svg",a({style:{pointerEvents:"none"},width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M13.0002 5.96667C13.5314 5.96667 14.0002 6.43542 14.0002 6.96667V7.96667C14.0002 8.52917 13.5314 8.96667 13.0002 8.96667H8.50016V13.4667C8.50016 14.0292 8.03141 14.4667 7.50016 14.4667H6.50016C5.93766 14.4667 5.50016 14.0292 5.50016 13.4667V8.96667H1.00016C0.437662 8.96667 0.000162125 8.52917 0.000162125 7.96667V6.96667C0.000162125 6.43542 0.437662 5.96667 1.00016 5.96667H5.50016V1.46667C5.50016 0.935425 5.93766 0.466675 6.50016 0.466675H7.50016C8.03141 0.466675 8.50016 0.935425 8.50016 1.46667V5.96667H13.0002Z"}));function yI({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onClick:i}){let n="post_creation_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:m,uiReference:c,themeStyles:d}=S({pageId:e,componentId:t,elementId:n});return m?null:ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(V,{style:d,className:qy.postCreationButton,onPress:i,"data-testid":a},ie__default.createElement(G8e,{className:wl(qy.postCreationButton__icon,o)})),imgIcon:()=>ie__default.createElement("img",{src:s.image,alt:c,className:wl(qy.postCreationButton,r),onClick:i,"data-testid":a}),defaultIconName:l.image,configIconName:s.image})}var df={globalSearchButton:"J2",globalSearchButton__icon:"K2",globalSearchButton__svg:"N2"};var Z8e=e=>ie__default.createElement("svg",a({width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M15.7814 14.3104C16.0627 14.6229 16.0627 15.0917 15.7502 15.3729L14.8752 16.2479C14.5939 16.5604 14.1252 16.5604 13.8127 16.2479L10.7189 13.1542C10.5627 12.9979 10.5002 12.8104 10.5002 12.6229V12.0917C9.37516 12.9667 8.00016 13.4667 6.50016 13.4667C2.90641 13.4667 0.000162125 10.5604 0.000162125 6.96667C0.000162125 3.40417 2.90641 0.466675 6.50016 0.466675C10.0627 0.466675 13.0002 3.40417 13.0002 6.96667C13.0002 8.49792 12.4689 9.87292 11.6252 10.9667H12.1252C12.3127 10.9667 12.5002 11.0604 12.6564 11.1854L15.7814 14.3104ZM6.50016 10.9667C8.68766 10.9667 10.5002 9.18542 10.5002 6.96667C10.5002 4.77917 8.68766 2.96667 6.50016 2.96667C4.28141 2.96667 2.50016 4.77917 2.50016 6.96667C2.50016 9.18542 4.28141 10.9667 6.50016 10.9667Z"}));function hI({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onPress:i}){let n="global_search_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:m,uiReference:c,themeStyles:d}=S({pageId:e,componentId:t,elementId:n});return m?null:ie__default.createElement(V,{style:d,"data-testid":a,className:df.globalSearchButton,onPress:i},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement("div",{className:df.globalSearchButton__icon},ie__default.createElement(Z8e,{className:wl(df.globalSearchButton__svg,o)})),imgIcon:()=>ie__default.createElement("img",{style:d,src:s.image,alt:c,className:wl(df.globalSearchButton__icon,r),"data-testid":a}),defaultIconName:l.image,configIconName:s.image}))}var Wz={headerLabel:"O2"};function CI({pageId:e="*",componentId:t="*"}){let o="header_label",{accessibilityId:r,config:i,defaultConfig:n,isExcluded:a,uiReference:s,themeStyles:l}=S({pageId:e,componentId:t,elementId:o});return a?null:ie__default.createElement(v.Headline,{className:Wz.headerLabel,style:l,"data-testid":r},i.text)}var Fm=(i=>(i.Newsfeed="Newsfeed",i.Explore="Explore",i.MyCommunities="My communities",i.Clips="Clips",i))(Fm||{});var Yy={topNavigation:"P2",topNavigationLeftPane:"Q2",topNavigationRightPane:"Z2"};function Qy({pageId:e="*",selectedTab:t,onClickPostCreationButton:o}){let r="top_navigation",{goToSocialGlobalSearchPage:i,goToMyCommunitiesSearchPage:n,goToCreateCommunityPage:a,goToNotificationTrayPage:s}=Y(),{isExcluded:l,themeStyles:m}=se({pageId:e,componentId:r}),c=()=>{switch(t){case"Newsfeed":case"Explore":i();break;case"My communities":n();break}};if(l)return null;let d=()=>{notificationTray.markTraySeen(new Date().toISOString()),s();};return ie__default.createElement("div",{className:Yy.topNavigation,style:m},ie__default.createElement("div",{className:Yy.topNavigationLeftPane},ie__default.createElement(CI,{pageId:e,componentId:r})),ie__default.createElement("div",{className:Yy.topNavigationRightPane},ie__default.createElement($2,{pageId:e,componentId:r,onPress:d}),ie__default.createElement(hI,{pageId:e,componentId:r,onPress:c}),t!=="Explore"&&ie__default.createElement(yI,{pageId:e,componentId:r,onClick:()=>t=="My communities"?a==null?void 0:a({mode:"create"}):o==null?void 0:o()})))}var rp={communityPendingPost__container:"_2",communityPendingPost__content:"ek",communityPendingPost__icon:"rk",communityPendingPost__textContainer:"ak",communityPendingPost__title__wrapper:"ok",communityPendingPost__title:"tk",communityPendingPost__subtext:"ik"};var vI=({pageId:e="*",componentId:t="*",pendingPostsCount:o=0,onClick:r,isPostOwner:i,canReviewCommunityPosts:n,joinRequestsCount:a=0,isShowJoinRequest:s=!1,isShowPendingPost:l=!1})=>{let m="community_pending_post",{config:c,themeStyles:d,accessibilityId:u,isExcluded:g}=S({pageId:e,componentId:t,elementId:m});if(g)return null;let f=o>10?"10+":o,C=a>10?"10+":a,y=()=>o===1?"Your post is pending for review":"Your posts are pending for review",b=()=>o===1?"1 post requires approval":`${f} posts require approval`,_=()=>a===1?"1 join request requires approval":`${C} join requests require approval`,x=()=>{let I=o===1?"1 post":`${f} posts`,w=a===1?"1 request":`${C} requests`;return `${I} and ${w} require approval`},P=()=>i?y():n?l&&!s?b():s&&!l?_():x():null;return ie__default.createElement(V,{className:rp.communityPendingPost__container,style:d,"data-testid":u,onPress:r},ie__default.createElement("div",{className:rp.communityPendingPost__content},ie__default.createElement("div",{className:rp.communityPendingPost__textContainer},ie__default.createElement("div",{className:rp.communityPendingPost__title__wrapper},ie__default.createElement("div",{className:rp.communityPendingPost__icon}),ie__default.createElement(v.BodyBold,null,"Pending requests")),ie__default.createElement(v.Caption,{className:rp.communityPendingPost__subtext},P()))))};var Yz=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M13.6875 12.25C13.6875 13.1992 12.9141 13.9375 12 13.9375C11.0508 13.9375 10.3125 13.1992 10.3125 12.25C10.3125 11.3359 11.0508 10.5625 12 10.5625C12.9141 10.5625 13.6875 11.3359 13.6875 12.25ZM17.9062 10.5625C18.8203 10.5625 19.5938 11.3359 19.5938 12.25C19.5938 13.1992 18.8203 13.9375 17.9062 13.9375C16.957 13.9375 16.2188 13.1992 16.2188 12.25C16.2188 11.3359 16.957 10.5625 17.9062 10.5625ZM6.09375 10.5625C7.00781 10.5625 7.78125 11.3359 7.78125 12.25C7.78125 13.1992 7.00781 13.9375 6.09375 13.9375C5.14453 13.9375 4.40625 13.1992 4.40625 12.25C4.40625 11.3359 5.14453 10.5625 6.09375 10.5625Z"}));var _I={menuButton:"sk",menuButton__icon:"dk"};function bI(a$1){var s=a$1,{onPress:e,className:t,pageId:o="*",componentId:r="*",defaultIconClassName:i}=s,n=d(s,["onPress","className","pageId","componentId","defaultIconClassName"]);let l="menu_button",{isExcluded:m,accessibilityId:c,themeStyles:d$1,config:u,defaultConfig:g,uiReference:f}=S({pageId:o,componentId:r,elementId:l});return m?null:ie__default.createElement(V,b(a({},n),{onPress:e,style:d$1,"data-testid":c,className:wl(_I.menuButton,t),"aria-label":"Menu icon to open community profile settings page"}),ie__default.createElement(Z,{configIconName:u.icon,defaultIconName:g.icon,imgIcon:()=>ie__default.createElement("img",{src:u.icon,alt:f}),defaultIcon:()=>ie__default.createElement(Yz,{className:wl(_I.menuButton__icon,i)})}))}var md={communityCover:"Yi",communityCover__topBar:"pe",communityCover__topBarLeft:"ck",communityCover__privateIcon:"lk",communityCover__communityName:"nk",communityCover__backButton:"mk",communityCover__backButton__icon:"hk"};var xI=({image:e,onBack:t,isSticky:o,community:r,onClickMenu:i,pageId:n="*",componentId:a$1="*"})=>{let s="community_cover",{isExcluded:l,accessibilityId:m,themeStyles:c}=S({pageId:n,componentId:a$1,elementId:s});if(l)return null;let d={"--background-image":e?`url(${e})`:"linear-gradient(188deg, #A5A9B5 6.23%, #898E9E 93.77%)"};return ie__default.createElement("div",{"data-testid":m,className:md.communityCover,style:a(a({},c),d)},ie__default.createElement("div",{className:md.communityCover__topBar,"data-scroll":o},ie__default.createElement("div",{className:md.communityCover__topBarLeft},ie__default.createElement(ze,{onPress:t,className:md.communityCover__backButton,defaultClassName:md.communityCover__backButton__icon}),o&&ie__default.createElement(ie__default.Fragment,null,!(r!=null&&r.isPublic)&&ie__default.createElement(J1,{className:md.communityCover__privateIcon}),ie__default.createElement(v.TitleBold,{className:md.communityCover__communityName},r==null?void 0:r.displayName),(r==null?void 0:r.isOfficial)&&ie__default.createElement(sr,null))),(r==null?void 0:r.isJoined)&&ie__default.createElement(bI,{onPress:i})))};var Jy={communityDescription:"gk",communityDescription__text:"pk",communityDescription__seeMoreButton:"bk"};var PI=({pageId:e="*",componentId:t="*",description:o=""})=>{let r="community_description",[i,n]=useState(!1),{themeStyles:a,accessibilityId:s,isExcluded:l}=S({pageId:e,elementId:r,componentId:t}),m=()=>n(!0);return l||o.length===0?null:ie__default.createElement("div",{style:a,"data-testid":s,className:Jy.communityDescription},ie__default.createElement(v.Body,{className:Jy.communityDescription__text},i?o:ie__default.createElement(RE,{lines:4,ellipsis:ie__default.createElement(ie__default.Fragment,null,"..."," ",ie__default.createElement(V,{className:Jy.communityDescription__seeMoreButton,onPress:m},"See more"))},ie__default.createElement("div",null,o))))};var Kz={communityName__truncate:"uk"};var II=({pageId:e="*",componentId:t="*",name:o=""})=>{let r="community_name",{accessibilityId:i,isExcluded:n}=S({pageId:e,componentId:t,elementId:r});return n?null:ie__default.createElement(v.Headline,{"data-testid":i,className:Kz.communityName__truncate},o)};var cf={communityInfo__container:"fk",communityInfo__wrapper:"vk",communityInfo__count:"wk",communityInfo__title:"xk"};var Ry=({pageId:e="*",componentId:t="*",count:o,text:r,onClick:i})=>{let n="community_info",{config:a,accessibilityId:s,themeStyles:l,isExcluded:m}=S({pageId:e,componentId:t,elementId:n});return m?null:ie__default.createElement(V,{"data-testid":s,onPress:i,className:cf.communityInfo__container},ie__default.createElement("div",{className:cf.communityInfo__wrapper},ie__default.createElement(v.BodyBold,{className:cf.communityInfo__count},fA(o)),ie__default.createElement(v.Caption,{className:cf.communityInfo__title},r)))};var wI={invitations:[],isLoading:!1,refresh:()=>{},hasUnseenInvitations:!1};function Jz(){let[e,t]=useState(wI);return useEffect(()=>{let o,r=()=>{o&&o(),o=InvitationRepository.getMyCommunityInvitations({limit:20},({data:i,loading:n})=>{t(a=>({invitations:i,isLoading:n,refresh:r,hasUnseenInvitations:n?a.hasUnseenInvitations:i.slice(0,3).some(s=>!localStorage.getItem(s.invitationId))}));});};return r(),()=>{o&&o();}},[]),e}function ap(e){let[t,o]=useState(),[r,i]=useState(!1);return useEffect(()=>{e&&e.getInvitation&&(i(!0),e.getInvitation().then(n=>{o(n),i(!1);}).catch(()=>{o(void 0),i(!1);}));},[e]),{isLoading:r,invitation:t,setInvitation:o}}var on={container:"yk",headerImageContainer:"kk",headerImage:"jk",backButton:"Ii",moreButton:"Ai",content:"Mi",communityProfile__name:"zk",description:"Xk",communityProfile__communityInfo__container:"Yk",divider:"Ik",statCount:"Ak",statTitle:"Mk",menuButton:"Sk",communityProfile__joinButton__container:"Ck",communityProfile__joinButton:"Ek",communityProfile__pendingPost__container:"Rk",communityProfile__menuItem:"Uk",communityProfile__privateIcon:"Bk",communityProfile__communityCategories:"ar",communityProfile__cancelJoinButton__container:"Fk",communityProfile__pendingIcon:"Hk",communityProfile__cancelJoinButton:"Lk"};function ej(e){let[t,o]=useState(),[r,i]=useState(!1),n=useCallback(()=>l(this,null,function*(){if(!(!e||!e.communityId)){i(!0);try{let a=yield e.getMyJoinRequest();o(a);}catch(a){console.error("Error fetching join request:",a);}finally{i(!1);}}}),[e]);return useEffect(()=>{n();},[n,e.communityId]),{myJoinRequest:t,setMyJoinRequest:o,isLoading:r,refreshJoinRequest:n}}function sp({community:e,status:t=JoinRequestStatusEnum.Pending}){let[o,r]=useState(!0),[i,n]=useState(),[a,s]=useState(null),[l,m]=useState(),c=useRef(),d=useCallback(()=>{c.current&&c.current();},[]);return useEffect(()=>{if(!e.communityId)return;let u=e.getJoinRequests({communityId:e.communityId,type:"communityJoinRequest",targetType:"community",status:t,options:{limit:20}},({data:g,loading:f,error:C,hasNextPage:y,onNextPage:b})=>{r(f),!f&&g&&(s([...g]),m(y),c.current=y?b:null),C&&n(C);});return ()=>{u();}},[e.communityId,t]),{joinRequests:a,loading:o,hasMore:l,loadMore:d,error:i}}var t9=({pageId:e="*",community:t,isSticky:o,page:r})=>{var O;let i="community_header",{onBack:n}=Y(),{isDesktop:a}=le(),{AmityCommunityProfilePageBehavior:s}=we(),{currentUserId:l}=Xt(),{online:m}=useNetworkState(),c=ce(),{invitation:d,setInvitation:u}=ap(t),{myJoinRequest:g,setMyJoinRequest:f,refreshJoinRequest:C}=ej(t),{joinRequests:y}=sp({community:t}),[b,_]=ie__default.useState(!1),{avatarFileUrl:x,pendingPostsCount:P,reviewingPosts:I,canReviewCommunityPosts:w}=gs(t.communityId),[M,T]=ie__default.useState(!1),{joinCommunity:E,cancelJoinCommunity:N}=td({community:t,joinRequest:g,onJoinSuccess:({data:z})=>{(z==null?void 0:z.status)===JoinResultStatusEnum.Pending&&(f(z==null?void 0:z.request),_(!0)),C();},onLeaveSuccess:()=>{C();},onCancelJoinSuccess:()=>{C(),T(!0),_(!1);}}),A=I.some(z=>z.postedUserId===l),D=(g==null?void 0:g.status)===JoinRequestStatusEnum.Pending&&!M,G=(O=y&&(y==null?void 0:y.length))!=null?O:0,H=P>0&&I.length>0&&(w||A)&&(t.needApprovalOnPostCreation||(t==null?void 0:t.postSetting)===CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED),$=G>0&&w,j=H||$;return ie__default.createElement(ie__default.Fragment,null,ie__default.createElement(xI,{pageId:e,componentId:i,image:x,community:t,onBack:()=>n(r),isSticky:!a&&o,onClickMenu:()=>{var z;(z=s==null?void 0:s.goToCommunitySettingPage)==null||z.call(s,{community:t});}}),ie__default.createElement("div",{className:on.content},ie__default.createElement("div",{className:on.communityProfile__name},!t.isPublic&&ie__default.createElement(ar,{pageId:e,componentId:i,className:on.communityProfile__privateIcon}),ie__default.createElement(II,{pageId:e,componentId:i,name:t.displayName}),t.isOfficial&&ie__default.createElement(sr,{className:on.communityProfile__privateIcon})),ie__default.createElement("div",{className:on.communityProfile__communityCategories},ie__default.createElement(ed,{pageId:e,componentId:i,community:t,minCategoryCharacters:10})),ie__default.createElement(PI,{pageId:e,componentId:i,description:t.description||""}),ie__default.createElement("div",{className:on.communityProfile__communityInfo__container},ie__default.createElement(Ry,{pageId:e,componentId:i,count:t.postsCount,text:`post${t.postsCount===1?"":"s"}`}),ie__default.createElement("div",{className:on.divider}),ie__default.createElement(Ry,{pageId:e,componentId:i,count:t.membersCount,text:`member${t.membersCount===1?"":"s"}`,onClick:()=>{var z;t.isJoined&&((z=s==null?void 0:s.goToMembershipPage)==null||z.call(s,{community:t}));}})),d&&d.status===InvitationStatusEnum.Pending&&ie__default.createElement(oj,{pageId:e,community:t,invitation:d,removeInvitation:()=>u(void 0)}),(!d||d.status!==InvitationStatusEnum.Pending)&&!t.isJoined&&!D&&!b&&ie__default.createElement("div",{className:on.communityProfile__joinButton__container},ie__default.createElement(Uc,{size:"medium",pageId:e,onClick:()=>{if(!m){c.info({content:"Failed to join community. Please try again."});return}E(t);},componentId:i,className:on.communityProfile__joinButton})),(!t.isJoined&&D||b)&&ie__default.createElement("div",{className:on.communityProfile__cancelJoinButton__container},ie__default.createElement(Eg,{pageId:e,componentId:i,elementId:"community_cancel_request_button",size:"small",color:"secondary",variant:"outlined",defaultIcon:ie__default.createElement(iy,{className:on.communityProfile__pendingIcon}),onPress:N,text:"Cancel request",typographyVariant:"bodyBold",className:on.communityProfile__cancelJoinButton})),(t.isJoined||t.isPublic)&&ie__default.createElement("div",null,ie__default.createElement(Bu,{type:"communityFeed",pageId:e,communityId:t.communityId})),j&&ie__default.createElement("div",{className:on.communityProfile__pendingPost__container},ie__default.createElement(vI,{pageId:e,componentId:i,pendingPostsCount:P,onClick:()=>{var z;(z=s==null?void 0:s.goToPendingRequestPage)==null||z.call(s,{community:t});},isPostOwner:A,canReviewCommunityPosts:w,isShowJoinRequest:$,isShowPendingPost:H,joinRequestsCount:G}))),ie__default.createElement("div",{className:on.communityProfile__divider}))};var bye=t=>{var e=d(t,[]);return ie__default.createElement("svg",a({width:"61",height:"41",viewBox:"0 0 61 41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M58.3438 0.5C59.7148 0.5 60.875 1.66016 60.875 3.03125V38.4688C60.875 39.9453 59.7148 41 58.3438 41H5.1875C2.33984 41 0.125 38.7852 0.125 35.9375V6.40625C0.125 5.03516 1.17969 3.875 2.65625 3.875H6.875V3.03125C6.875 1.66016 7.92969 0.5 9.40625 0.5H58.3438ZM3.5 35.9375C3.5 36.8867 4.23828 37.625 5.1875 37.625C6.03125 37.625 6.875 36.8867 6.875 35.9375V7.25H3.5V35.9375ZM57.5 37.625V3.875H10.25V35.9375V36.043C10.25 36.4648 10.0391 37.2031 9.93359 37.625H57.5ZM14.8906 27.5C14.1523 27.5 13.625 26.9727 13.625 26.2344V8.51562C13.625 7.88281 14.1523 7.25 14.8906 7.25H32.6094C33.2422 7.25 33.875 7.88281 33.875 8.51562V26.2344C33.875 26.9727 33.2422 27.5 32.6094 27.5H14.8906ZM17 10.625V24.125H30.5V10.625H17ZM13.625 32.9844V32.1406C13.625 31.5078 14.1523 30.875 14.8906 30.875H32.6094C33.2422 30.875 33.875 31.5078 33.875 32.1406V32.9844C33.875 33.7227 33.2422 34.25 32.6094 34.25H14.8906C14.1523 34.25 13.625 33.7227 13.625 32.9844ZM37.25 32.9844V32.1406C37.25 31.5078 37.7773 30.875 38.5156 30.875H52.8594C53.4922 30.875 54.125 31.5078 54.125 32.1406V32.9844C54.125 33.7227 53.4922 34.25 52.8594 34.25H38.5156C37.7773 34.25 37.25 33.7227 37.25 32.9844ZM37.25 26.2344V25.3906C37.25 24.7578 37.7773 24.125 38.5156 24.125H52.8594C53.4922 24.125 54.125 24.7578 54.125 25.3906V26.2344C54.125 26.9727 53.4922 27.5 52.8594 27.5H38.5156C37.7773 27.5 37.25 26.9727 37.25 26.2344ZM37.25 12.7344V11.8906C37.25 11.2578 37.7773 10.625 38.5156 10.625H52.8594C53.4922 10.625 54.125 11.2578 54.125 11.8906V12.7344C54.125 13.4727 53.4922 14 52.8594 14H38.5156C37.7773 14 37.25 13.4727 37.25 12.7344ZM37.25 19.4844V18.6406C37.25 18.0078 37.7773 17.375 38.5156 17.375H52.8594C53.4922 17.375 54.125 18.0078 54.125 18.6406V19.4844C54.125 20.2227 53.4922 20.75 52.8594 20.75H38.5156C37.7773 20.75 37.25 20.2227 37.25 19.4844Z"}))},s0=bye;var pf={lockPrivateContent__wrap:"Si",lockPrivateContent__lockIcon:"Ci",lockPrivateContent__title:"Tk",lockPrivateContent__body:"Vk"};var Dm=()=>ie__default.createElement("div",{className:pf.lockPrivateContent__wrap},ie__default.createElement(J1,{className:pf.lockPrivateContent__lockIcon}),ie__default.createElement(v.TitleBold,{className:pf.lockPrivateContent__title},"This community is private"),ie__default.createElement(v.Body,{className:pf.lockPrivateContent__body},"Join this community to see its content and members."));function uf({communityId:e,placement:t,shouldCall:o}){let n=it({fetcher:PostRepository.getPinnedPosts,params:{communityId:e,placement:t,sortBy:"lastPinned"},shouldCall:o}),{items:r}=n,i=d(n,["items"]);return a({pinnedPost:r},i)}var $r={communityFeed__container:"Ei",communityFeed__loadingIndicator:"Wk",communityFeed__observerTarget:"qk",communityFeed__post:"Dk",communityFeed__spinner:"Gk",spin:"Ri",communityFeed__postContent:"Ui",communityFeed__postSkeleton:"Bi",communityFeed__postSkeletonHeader:"Jk",communityFeed__postSkeletonAvatar:"Fi",communityFeed__postSkeletonUserInfo:"Kk",communityFeed__postSkeletonUsername:"Hi",communityFeed__postSkeletonSubtitle:"Li",communityFeed__postSkeletonContent:"Nk",communityFeed__postSkeletonLine:"W",pulse:"Ti",communityFeed__emptyPost:"Vi",communityFeed__emptyPostIcon:"Ok",communityFeed__emptyPostText:"Pk",communityFeed__announcePost:"Wi",communityFeed__noInternet:"Qk"};var gf=()=>ie__default.createElement("div",{className:$r.communityFeed__postSkeleton},ie__default.createElement("div",{className:$r.communityFeed__postSkeletonHeader},ie__default.createElement("div",{className:$r.communityFeed__postSkeletonAvatar}),ie__default.createElement("div",{className:$r.communityFeed__postSkeletonUserInfo},ie__default.createElement("div",{className:$r.communityFeed__postSkeletonUsername}),ie__default.createElement("div",{className:$r.communityFeed__postSkeletonSubtitle}))),ie__default.createElement("div",{className:$r.communityFeed__postSkeletonContent},ie__default.createElement("div",{className:$r.communityFeed__postSkeletonLine}),ie__default.createElement("div",{className:$r.communityFeed__postSkeletonLine}),ie__default.createElement("div",{className:$r.communityFeed__postSkeletonLine}))),r9=({pageId:e="*",communityId:t})=>{let o="community_feed_component",{isExcluded:r,accessibilityId:i,themeStyles:n}=se({pageId:e,componentId:o}),{community:a$1}=Ct({communityId:t,shouldCall:!!t}),{posts:s,hasMore:l,loadMore:m,isLoading:c,refresh:d}=Ao({feedType:"published",targetId:t,targetType:"community",limit:10}),{pinnedPost:u,refresh:g}=uf({communityId:t,shouldCall:!!t&&(a$1==null?void 0:a$1.isJoined)}),{AmityCommunityProfilePageBehavior:f}=we(),[C,y]=useState(null),b$1=(u==null?void 0:u.filter(E=>(E==null?void 0:E.placement)==="announcement"&&(E==null?void 0:E.post)))||[],_=u.length>0?u.filter(E=>{var N;return (E==null?void 0:E.placement)==="default"&&(E==null?void 0:E.post)&&!b$1.map(A=>{var D;return (D=A==null?void 0:A.post)==null?void 0:D.postId}).includes((N=E==null?void 0:E.post)==null?void 0:N.postId)}):null,x=u==null?void 0:u.some(E=>{var N;return (E==null?void 0:E.placement)==="default"&&(E==null?void 0:E.post)&&b$1.map(A=>{var D;return (D=A==null?void 0:A.post)==null?void 0:D.postId}).includes((N=E==null?void 0:E.post)==null?void 0:N.postId)}),I=s.filter(E=>E&&!b$1.some(N=>{var A;return ((A=N==null?void 0:N.post)==null?void 0:A.postId)===(E==null?void 0:E.postId)})).map(E=>{let N=_==null?void 0:_.find(A=>{var D;return ((D=A==null?void 0:A.post)==null?void 0:D.postId)===(E==null?void 0:E.postId)});return N?b(a({},E),{placement:N.placement}):E});if(ke({node:C,onIntersect:()=>{l&&!c&&m();}}),useEffect(()=>{d(),g();},[]),r)return null;let w=(E,N)=>{var A;E&&((A=f==null?void 0:f.goToPostDetailPage)==null||A.call(f,{postId:E,hideTarget:!0,category:N||"general"}));},M=()=>ie__default.createElement(ie__default.Fragment,null,I.length>0&&I.filter(E=>E&&!!E.postId).map(E=>{if(!E||!E.postId)return null;let N=(E==null?void 0:E.placement)==="default"?"pin":"general";return ie__default.createElement(V,{key:E.postId,className:$r.communityFeed__postContent,onPress:()=>w(E.postId,N)},ie__default.createElement(en,{pageId:e,key:E.postId,post:E,category:N,style:"feed",hideTarget:!0,onClick:()=>w(E.postId,N)}))}),c&&Array.from({length:3}).map((E,N)=>ie__default.createElement(gf,{key:N})),(s==null?void 0:s.length)===0&&!c&&ie__default.createElement("div",{className:$r.communityFeed__emptyPost},ie__default.createElement(s0,{className:$r.communityFeed__emptyPostIcon}),ie__default.createElement(v.Body,{className:$r.communityFeed__emptyPostText},"No posts yet")),ie__default.createElement("div",{ref:E=>y(E),className:$r.communityFeed__observerTarget})),T=()=>b$1.length>0?b$1.filter(({post:E})=>!!E&&!!E.postId).map(({post:E})=>{if(!E||!E.postId)return null;let N=x?"pin_and_announcement":"announcement";return ie__default.createElement(V,{key:E.postId,onPress:()=>w(E.postId,N),className:$r.communityFeed__announcePost},ie__default.createElement(en,{pageId:e,key:E.postId,post:E,category:N,style:"feed",hideTarget:!0,onClick:()=>w(E.postId,N),onPostDeleted:()=>g()}))}):null;return ie__default.createElement("div",{"data-testid":i,className:$r.communityFeed__container,style:n},ie__default.createElement(wr,{page:"feed",refresh:()=>{d(),g();},className:$r.communityFeed__noInternet},ie__default.createElement(ie__default.Fragment,null,a$1!=null&&a$1.isJoined||a$1!=null&&a$1.isPublic?ie__default.createElement(ie__default.Fragment,null,T(),M()):c?Array.from({length:3}).map((E,N)=>ie__default.createElement(gf,{key:N})):ie__default.createElement(Dm,null))))};var ij=({communityId:e})=>ie__default.createElement("div",null,"CommunityPinnedPost");var Nl={communityImageFeed__container:"qi",communityImageFeed__containerSkeleton:"Di",communityImageFeed__itemSkeleton:"Zk",pulse:"_k",communityImageFeed__lock:"e4"};var l0={imageGallery:"Gi",imageGallery__itemContainer:"Ji",imageGallery__item:"r4",imageGallery__brokenImg:"a4",pulse:"Ki",imageGallery__skeleton__itemContainer:"o4"};var dd={modal:"t4",modalContent:"i4",closeButton:"s4",fullImage:"d4",overlayPanel:"c4",singleImageViewer__clearButton:"l4",singleImageViewer__clearButton__img:"n4",singleImageViewer__brokenImage:"Ni"};function ff({pageId:e="*",componentId:t="*",elementId:o="*",fileId:r,onClose:i}){let{themeStyles:n}=S({pageId:e,componentId:t,elementId:o}),a=We({fileId:r,imageSize:"medium"}),[s,l]=useState(!1);return ie__default.createElement("div",{style:n},ie__default.createElement("div",{className:dd.modal,onClick:i},ie__default.createElement("div",{className:dd.modalContent,onClick:m=>m.stopPropagation()},a&&!s?ie__default.createElement("img",{src:a,alt:r,className:dd.fullImage,onError:()=>l(!0)}):ie__default.createElement("div",{className:dd.singleImageViewer__brokenImage}),ie__default.createElement("span",{className:dd.closeButton},ie__default.createElement(kn,{pageId:e,componentId:t,defaultClassName:dd.singleImageViewer__clearButton,imgClassName:dd.singleImageViewer__clearButton__img,onPress:i})))))}var Eye=({fileId:e,postIndex:t,onClickImageItem:o})=>{let r=rt({fileId:e,imageSize:"medium"}),[i,n]=useState(!1);return r&&!i?ie__default.createElement(V,{className:l0.imageGallery__itemContainer,onPress:()=>o(t)},ie__default.createElement("img",{className:l0.imageGallery__item,src:r,alt:`${e}`,onError:()=>n(!0)})):ie__default.createElement(V,{className:l0.imageGallery__itemContainer,onPress:()=>o(t)},ie__default.createElement("div",{className:l0.imageGallery__brokenImg}))},yf=({posts:e,pageId:t,componentId:o,elementId:r})=>{var m,c;let[i,n]=useState(!1),[a,s]=useState(null),l=d=>{s(d),n(!0);};return ie__default.createElement("div",{className:l0.imageGallery},e==null?void 0:e.map((d,u)=>{var g,f;return ie__default.createElement(Eye,{key:(g=d==null?void 0:d.data)==null?void 0:g.fileId,fileId:(f=d==null?void 0:d.data)==null?void 0:f.fileId,postIndex:u,onClickImageItem:l})}),e&&i&&a!==null&&ie__default.createElement(ff,{fileId:(c=(m=e[a])==null?void 0:m.data)==null?void 0:c.fileId,onClose:()=>n(!1),pageId:t,componentId:o,elementId:r}))};var hf={emptyUserImageFeed__icon:"m4",emptyCommunityImageFeed__container:"Oi",emptyCommunityImageFeed__text:"h4",emptyCommunityImageFeed__icon:"g4"};var Lye=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 49 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M12.6875 17C9.83984 17 7.625 14.7852 7.625 11.9375C7.625 9.19531 9.83984 6.875 12.6875 6.875C15.4297 6.875 17.75 9.19531 17.75 11.9375C17.75 14.7852 15.4297 17 12.6875 17ZM12.6875 10.25C11.7383 10.25 11 11.0938 11 11.9375C11 12.8867 11.7383 13.625 12.6875 13.625C13.5312 13.625 14.375 12.8867 14.375 11.9375C14.375 11.0938 13.5312 10.25 12.6875 10.25ZM44.75 0.125C46.543 0.125 48.125 1.70703 48.125 3.5V44C48.125 45.8984 46.543 47.375 44.75 47.375H4.25C2.35156 47.375 0.875 45.8984 0.875 44V3.5C0.875 1.70703 2.35156 0.125 4.25 0.125H44.75ZM44.75 44V35.5625H4.25V44H44.75ZM9.83984 32.1875H18.2773L19.543 30.5L15.3242 24.9102L9.83984 32.1875ZM22.4961 32.1875H38.5273L30.5117 21.5352L22.4961 32.1875ZM44.75 32.1875V3.5H4.25V32.1875H5.62109L13.9531 21.1133C14.5859 20.2695 15.957 20.2695 16.6953 21.1133L21.6523 27.7578L29.1406 17.7383C29.7734 16.8945 31.1445 16.8945 31.8828 17.7383L42.7461 32.1875H44.75Z",fill:e.fill})),MI=Lye;var SI=({pageId:e="*",componentId:t="*"})=>{let o="empty_community_image_feed",{themeStyles:r,accessibilityId:i}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement("div",{style:r,"data-testid":i,className:hf.emptyCommunityImageFeed__container},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(MI,{className:hf.emptyCommunityImageFeed__icon}),imgIcon:()=>ie__default.createElement(MI,{className:hf.emptyCommunityImageFeed__icon})}),ie__default.createElement("div",null,ie__default.createElement(v.TitleBold,{className:hf.emptyCommunityImageFeed__text},"No photos yet")))};var i9=({pageId:e="*",communityId:t})=>{let o="community_image_feed",[r,i]=useState(null),{community:n}=Ct({communityId:t,shouldCall:!!t}),{isExcluded:a,accessibilityId:s,themeStyles:l}=se({pageId:e,componentId:o}),{posts:m,hasMore:c,loadMore:d,refresh:u,isLoading:g}=Ao({targetId:t,targetType:"community",limit:10,dataTypes:["image"]}),f=(n==null?void 0:n.isJoined)&&!(n!=null&&n.isPublic);if(a)return null;useEffect(()=>{u();},[]),ke({node:r,onIntersect:()=>{c&&!g&&d();}});let C=()=>ie__default.createElement("div",{className:Nl.communityImageFeed__containerSkeleton},ie__default.createElement("div",{className:Nl.communityImageFeed__itemSkeleton}),ie__default.createElement("div",{className:Nl.communityImageFeed__itemSkeleton}),ie__default.createElement("div",{className:Nl.communityImageFeed__itemSkeleton}),ie__default.createElement("div",{className:Nl.communityImageFeed__itemSkeleton}),ie__default.createElement("div",{className:Nl.communityImageFeed__itemSkeleton}),ie__default.createElement("div",{className:Nl.communityImageFeed__itemSkeleton}));return f||n!=null&&n.isPublic?ie__default.createElement("div",{style:l,"data-testid":s},ie__default.createElement(wr,{page:"feed",refresh:u},ie__default.createElement("div",{className:Nl.communityImageFeed__container},(m==null?void 0:m.length)===0&&!g&&ie__default.createElement(SI,{pageId:e,componentId:o}),(m==null?void 0:m.length)>0&&ie__default.createElement(yf,{posts:m,pageId:e,componentId:t}),g&&C())),ie__default.createElement("div",{ref:y=>i(y)})):ie__default.createElement("div",{className:Nl.communityImageFeed__lock},ie__default.createElement(Dm,null))};var Cf={emptyCommunityVideoFeed__container:"Pi",emptyCommunityVideoFeed__text:"p4",emptyCommunityVideoFeed__icon:"b4"};var Uye=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 54 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M50.5195 13.625C52.3125 13.625 54 14.9961 54 17V44.1055C54 46.0039 52.3125 47.375 50.5195 47.375C49.9922 47.375 49.1484 47.1641 48.6211 46.8477L40.5 41.1523V42.3125C40.5 45.1602 38.1797 47.375 35.4375 47.375H5.0625C2.21484 47.375 0 45.1602 0 42.3125V18.6875C0 15.9453 2.21484 13.625 5.0625 13.625H6.75V8.5625C6.75 3.92188 10.4414 0.125 15.1875 0.125H32.9062C33.3281 0.125 33.75 0.546875 33.75 0.96875V2.65625C33.75 3.18359 33.3281 3.5 32.9062 3.5H15.1875C12.3398 3.5 10.125 5.82031 10.125 8.5625V13.625H35.4375C38.1797 13.625 40.5 15.9453 40.5 18.6875V19.9531L48.6211 14.2578C49.1484 13.9414 49.9922 13.7305 50.5195 13.625V17L40.5 24.0664V37.0391L50.5195 44L50.625 17L50.5195 13.625ZM37.125 42.3125V18.6875C37.125 17.8438 36.2812 17 35.4375 17H5.0625C4.11328 17 3.375 17.8438 3.375 18.6875V42.3125C3.375 43.2617 4.11328 44 5.0625 44H35.4375C36.2812 44 37.125 43.2617 37.125 42.3125ZM33.0117 20.375C33.4336 20.4805 33.6445 20.6914 33.75 21.1133V23.1172C33.6445 23.5391 33.4336 23.75 33.0117 23.75H7.38281C6.96094 23.75 6.75 23.5391 6.75 23.1172V21.1133C6.75 20.6914 6.96094 20.4805 7.38281 20.375H33.0117Z",fill:e.fill})),NI=Uye;var kI=({pageId:e="*",componentId:t="*"})=>{let o="empty_community_video_feed",{themeStyles:r,accessibilityId:i}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement("div",{style:r,"data-testid":i,className:Cf.emptyCommunityVideoFeed__container},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(NI,{className:Cf.emptyCommunityVideoFeed__icon}),imgIcon:()=>ie__default.createElement(NI,{className:Cf.emptyCommunityVideoFeed__icon})}),ie__default.createElement("div",null,ie__default.createElement(v.TitleBold,{className:Cf.emptyCommunityVideoFeed__text},"No videos yet")))};var Vm={videoGallery:"Qi",videoGallery__itemContainer:"Zi",videoGallery__item:"u4",videoGallery__duration:"f4",videoGallery__brokenImg:"v4",pulse:"_i",videoGallery__skeleton__itemContainer:"w4",videoGallery__skeleton__item:"x4"};var dp={modal:"y4",modalContent:"k4",closeButton:"j4",fullImage:"z4",nextButton:"X4",prevButton:"Y4",overlayPanel:"I4",overlayPanel__prev:"es",overlayPanel__next:"rs",overlayPanel__prevButton:"as",overlayPanel__nextButton:"A4",overlayPanel__middle:"M4",videoViewer__clearButton:"S4",videoViewer__clearButton__img:"C4"};var Zye=memo(({fileId:e,thumbnailFileId:t,isMuted:o=!1})=>{let r=pr(e),i=pr(t),n=useRef(null),a=useMemo(()=>{if(r==null)return null;if(r.status===b2.Transcoded){let{videoUrl:s}=r;return (s==null?void 0:s["1080p"])||(s==null?void 0:s["720p"])||(s==null?void 0:s["480p"])||(s==null?void 0:s["360p"])||(s==null?void 0:s.original)||r.fileUrl}return r.fileUrl},[r]);return useEffect(()=>{var s;(s=n.current)==null||s.load();},[a]),a==null?ie__default.createElement(ie__default.Fragment,null):ie__default.createElement("video",{controls:!0,controlsList:"nodownload",autoPlay:!1,className:dp.fullImage,ref:n,poster:i==null?void 0:i.fileUrl,muted:o},ie__default.createElement("source",{src:a,type:"video/mp4"}),ie__default.createElement("p",null,"Your browser does not support this format of video. Please try again later once the server transcodes the video into an playable format(mp4)."))});function vf({pageId:e="*",componentId:t="*",elementId:o="*",fileId:r,thumbnailFileId:i,isMuted:n=!1,onClose:a}){let{themeStyles:s}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement("div",{style:s},ie__default.createElement("div",{className:dp.modal,onClick:a},ie__default.createElement("div",{className:dp.modalContent,onClick:l=>l.stopPropagation()},ie__default.createElement(Zye,{fileId:r,thumbnailFileId:i,isMuted:n}),ie__default.createElement("span",{className:dp.closeButton},ie__default.createElement(kn,{pageId:e,componentId:t,defaultClassName:dp.videoViewer__clearButton,imgClassName:dp.videoViewer__clearButton__img,onPress:a})))))}var n9=e=>{let t=Math.floor(e/3600),o=Math.floor(e%3600/60),r=Math.floor(e%60),i=t>0?`${t.toString().padStart(2,"0")}:`:"",n=`${o.toString().padStart(2,"0")}:`,a=r.toString().padStart(2,"0");return `${i}${n}${a}`};var Wye=({videoFileId:e,thumbnailFileId:t,postIndex:o,onClickVideoItem:r})=>{var l;let[i,n]=useState(!1),a=rt({fileId:t,imageSize:"medium"}),s=W2(e);return !a||!s?ie__default.createElement("div",{className:Vm.videoGallery__skeleton__itemContainer},ie__default.createElement(bl,{className:Vm.videoGallery__skeleton__item})):i?ie__default.createElement(V,{className:Vm.videoGallery__itemContainer,onPress:()=>r(o)},ie__default.createElement("div",{className:Vm.videoGallery__brokenImg})):ie__default.createElement(V,{className:Vm.videoGallery__itemContainer,onPress:()=>r(o)},ie__default.createElement("img",{className:Vm.videoGallery__item,src:a,alt:`${t}`,onError:()=>n(!0)}),ie__default.createElement(v.Caption,{className:Vm.videoGallery__duration},n9(((l=s==null?void 0:s.attributes.metadata)==null?void 0:l.video).duration)))},_f=({posts:e,pageId:t,componentId:o,elementId:r})=>{var m,c,d,u,g,f,C;let[i,n]=useState(!1),[a,s]=useState(null),l=y=>{s(y),n(!0);};return ie__default.createElement("div",{className:Vm.videoGallery},e==null?void 0:e.map((y,b)=>{var _,x,P,I,w,M,T;return ie__default.createElement(Wye,{key:(x=(_=y==null?void 0:y.data)==null?void 0:_.videoFileId)==null?void 0:x.original,videoFileId:(w=(I=(P=y==null?void 0:y.data)==null?void 0:P.videoFileId)==null?void 0:I.original)!=null?w:"",thumbnailFileId:(T=(M=y==null?void 0:y.data)==null?void 0:M.thumbnailFileId)!=null?T:"",postIndex:b,onClickVideoItem:l})}),e&&i&&a!==null&&ie__default.createElement(vf,{pageId:t,componentId:o,elementId:r,fileId:(u=(d=(c=(m=e[a])==null?void 0:m.data)==null?void 0:c.videoFileId)==null?void 0:d.original)!=null?u:"",thumbnailFileId:(C=(f=(g=e[a])==null?void 0:g.data)==null?void 0:f.thumbnailFileId)!=null?C:"",onClose:()=>n(!1)}))};var EI={tabButton__tabsButton:"os",tabButton__tabsButtonlabel:"ts"};var bf=({pageId:e="*",componentId:t="*",elementId:o="*",tab:r,activeTab:i,setActiveTab:n})=>{let{accessibilityId:a,config:s,themeStyles:l}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement(oe,{style:l,id:o,key:r.type,variant:"text",className:EI.tabButton__tabsButton,onPress:()=>n(r.type),"data-testid":a,"data-active":i===r.type},ie__default.createElement(v.Body,{className:EI.tabButton__tabsButtonlabel,"data-active":i===r.type},s.text))};var cd={clipGallery:"is",clipGallery__itemContainer:"ss",clipGallery__item:"ds",clipGallery__duration:"E4",clipGallery__brokenImg:"R4",pulse:"U4",clipGallery__skeleton__itemContainer:"B4",clipGallery__skeleton__item:"F4"};var Qye=({videoFileId:e,thumbnailFileId:t,postIndex:o,onClickVideoItem:r,displayMode:i="fill"})=>{var m;let[n,a]=useState(!1),s=rt({fileId:t,imageSize:"medium"}),l=W2(e);return !s||!l?ie__default.createElement(oe,{variant:"text",onPress:()=>r(o)},ie__default.createElement("div",{className:cd.clipGallery__skeleton__itemContainer})):n?ie__default.createElement(oe,{variant:"text",className:cd.clipGallery__itemContainer,onPress:()=>r(o)},ie__default.createElement("div",{className:cd.clipGallery__brokenImg})):ie__default.createElement(oe,{variant:"text",className:cd.clipGallery__itemContainer,onPress:()=>r(o)},ie__default.createElement("img",{className:cd.clipGallery__item,src:s,alt:`${t}`,onError:()=>a(!0),"data-isfill":i==="fill"}),ie__default.createElement(v.Caption,{className:cd.clipGallery__duration},n9((m=l==null?void 0:l.attributes.metadata.video)==null?void 0:m.duration)))},a9=({posts:e,pageId:t,componentId:o,elementId:r})=>{var u,g,f,C,y,b;let[i,n]=useState(!1),[a,s]=useState(null),{isDesktop:l}=le(),{AmityCommunityProfilePageBehavior:m,AmityUserProfilePageBehavior:c}=we(),d=_=>{var x,P,I,w,M,T;if(l)s(_),n(!0);else return (T=(P=((x=e==null?void 0:e[_])==null?void 0:x.targetType)==="community"?m:c)==null?void 0:P.goToClipFeedPage)==null?void 0:T.call(P,{currentPostId:((I=e==null?void 0:e[_])==null?void 0:I.postId)||void 0,postIndex:_,targetId:((w=e==null?void 0:e[_])==null?void 0:w.targetId)||void 0,targetType:((M=e==null?void 0:e[_])==null?void 0:M.targetType)||void 0})};return ie__default.createElement("div",{className:cd.clipGallery},e==null?void 0:e.map((_,x)=>{var P,I,w,M;return ie__default.createElement(Qye,{key:(P=_==null?void 0:_.data)==null?void 0:P.fileId,videoFileId:(I=_==null?void 0:_.data)==null?void 0:I.fileId,thumbnailFileId:((w=_.data)==null?void 0:w.thumbnailFileId)||void 0,postIndex:x,onClickVideoItem:d,displayMode:((M=_.data)==null?void 0:M.displayMode)||"fill"})}),e&&l&&i&&a!==null&&ie__default.createElement(vf,{pageId:t,componentId:o,elementId:r,fileId:(g=(u=e[a])==null?void 0:u.data)==null?void 0:g.fileId,thumbnailFileId:(C=(f=e[a])==null?void 0:f.data)==null?void 0:C.thumbnailFileId,onClose:()=>n(!1),isMuted:((b=(y=e[a])==null?void 0:y.data)==null?void 0:b.isMuted)||!1}))};var LI={emptyClipFeed__icon:"H4",emptyClipFeed:"L4"};var Jye=t=>{var e=d(t,[]);return ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M50.75 7.125C54.4414 7.125 57.5 10.1836 57.5 13.875V47.625C57.5 51.4219 54.4414 54.375 50.75 54.375H10.25C6.45312 54.375 3.5 51.4219 3.5 47.625V13.875C3.5 10.1836 6.45312 7.125 10.25 7.125H50.75ZM49.168 10.5H37.8828L27.7578 20.625H39.043L49.168 10.5ZM33.1367 10.5H21.8516L11.7266 20.625H23.0117L33.1367 10.5ZM6.875 13.875V20.625H6.98047L17.1055 10.5H10.25C8.35156 10.5 6.875 12.082 6.875 13.875ZM54.125 47.625V24H6.875V47.625C6.875 49.5234 8.35156 51 10.25 51H50.75C52.543 51 54.125 49.5234 54.125 47.625ZM54.125 20.625V13.875C54.125 12.9258 53.7031 12.082 52.9648 11.4492L43.7891 20.625H54.125ZM25.1211 47.3086C24.2773 46.7812 23.75 45.832 23.75 44.7773V30.2227C23.75 29.2734 24.2773 28.3242 25.1211 27.7969C26.0703 27.2695 27.125 27.2695 28.0742 27.9023L39.2539 35.0742C40.0977 35.6016 40.625 36.4453 40.625 37.5C40.625 38.5547 40.0977 39.3984 39.2539 39.9258L28.0742 47.2031C27.5469 47.5195 27.0195 47.625 26.4922 47.625C26.0703 47.625 25.543 47.5195 25.1211 47.3086ZM27.125 31.2773V43.8281L36.7227 37.5L27.125 31.2773Z",fill:"currentColor"}))},mj=Jye;var xf={emptyContent:"cs",emptyContent__text:"T4"};var Fo=({pageId:e="*",componentId:t="*",elementId:o="*",infoElementId:r="*",text:i,emptyContentClassName:n,defaultIcon:a})=>{let{config:s,defaultConfig:l,isExcluded:m,themeStyles:c,accessibilityId:d,uiReference:u}=S({pageId:e,componentId:t,elementId:o}),{config:g}=S({pageId:e,componentId:t,elementId:r});return m?null:ie__default.createElement("div",{style:c,"data-testid":d,className:wl(xf.emptyContent,n)},ie__default.createElement(Z,{defaultIcon:a,configIconName:s.image,defaultIconName:l.image,imgIcon:()=>ie__default.createElement("img",{src:s.image,alt:u})}),s.text?ie__default.createElement(ie__default.Fragment,null,ie__default.createElement(v.TitleBold,{className:xf.emptyContent__text},s.text),g.text&&ie__default.createElement(v.Caption,{className:xf.emptyContent__text},g.text)):i?ie__default.createElement(v.TitleBold,{className:xf.emptyContent__text},i):null)};var Pf=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"empty_clip_feed",defaultIcon:()=>ie__default.createElement(mj,{className:LI.emptyClipFeed__icon}),emptyContentClassName:LI.emptyClipFeed});var bs={communityVideoFeed__container:"ls",communityVideoFeed__containerSkeleton:"ns",communityVideoFeed__itemSkeleton:"V4",pulse:"W4",communityVideoFeed__lock:"q4",communityVideoFeed__videoFeedTabs:"ms",communityVideoFeed__observerTarget:"D4"};var s9=({pageId:e="*",communityId:t})=>{let o="community_video_feed",[r,i]=useState(null),[n,a]=useState(null),[s,l]=useState("videos"),{community:m}=Ct({communityId:t,shouldCall:!!t}),{isExcluded:c,accessibilityId:d,themeStyles:u}=se({pageId:e,componentId:o}),{posts:g,hasMore:f,loadMore:C,refresh:y,isLoading:b}=Ao({targetId:t,targetType:"community",limit:10,dataTypes:["video"]}),{posts:_,hasMore:x,loadMore:P,refresh:I,isLoading:w}=Ao({targetId:t,targetType:"community",limit:10,dataTypes:["clip"]}),M=(m==null?void 0:m.isJoined)&&!(m!=null&&m.isPublic);if(c)return null;useEffect(()=>{y(),I();},[]),ke({node:r,onIntersect:()=>{f&&!b&&C();}}),ke({node:n,onIntersect:()=>{x&&!w&&P();}});let T=[{type:"videos",elementId:"videos_button"},{type:"clips",elementId:"clips_button"}],E=()=>ie__default.createElement("div",{className:bs.communityVideoFeed__videoFeedTabs},T.map(D=>ie__default.createElement(bf,{key:D.type,pageId:e,componentId:o,elementId:D.elementId,tab:D,activeTab:s,setActiveTab:l}))),N=()=>ie__default.createElement("div",{className:bs.communityVideoFeed__containerSkeleton},ie__default.createElement("div",{className:bs.communityVideoFeed__itemSkeleton}),ie__default.createElement("div",{className:bs.communityVideoFeed__itemSkeleton}),ie__default.createElement("div",{className:bs.communityVideoFeed__itemSkeleton}),ie__default.createElement("div",{className:bs.communityVideoFeed__itemSkeleton}),ie__default.createElement("div",{className:bs.communityVideoFeed__itemSkeleton}),ie__default.createElement("div",{className:bs.communityVideoFeed__itemSkeleton}));if(!(M||m!=null&&m.isPublic))return ie__default.createElement("div",{className:bs.communityVideoFeed__lock},ie__default.createElement(Dm,null));let A=()=>s==="videos"?ie__default.createElement(ie__default.Fragment,null,(g==null?void 0:g.length)===0&&!b&&ie__default.createElement(kI,{pageId:e,componentId:o}),(g==null?void 0:g.length)>0&&ie__default.createElement(_f,{posts:g,pageId:e,componentId:t}),b&&N(),f&&ie__default.createElement("div",{ref:D=>i(D)})):ie__default.createElement(ie__default.Fragment,null,(_==null?void 0:_.length)===0&&!w&&ie__default.createElement(Pf,{pageId:e,componentId:o}),(_==null?void 0:_.length)>0&&ie__default.createElement(a9,{posts:_,pageId:e,componentId:t}),w&&N(),x&&ie__default.createElement("div",{ref:D=>a(D)}));return ie__default.createElement("div",{style:u,"data-testid":d},ie__default.createElement(wr,{page:"feed",refresh:y},ie__default.createElement(ie__default.Fragment,null,E(),ie__default.createElement("div",{className:bs.communityVideoFeed__container},A()))))};var Zr={pendingPostContent__container:"be",pendingPostContent__bar:"G4",pendingPostContent__userDetail:"J4",pendingPostContent__username:"K4",pendingPostContent__information__subtitle:"N4",pendingPostContent__editedTag:"O4",pendingPostContent__deletePost__icon:"P4",pendingPostContent__deletePost__text:"Q4",pendingPostContent__wrapRightMenu:"Z4",pendingPostContent__actionButton:"_4",pendingPostContent__item:"e7",pendingPostContent__textPost:"r7",pendingPostContent__buttonWrapper:"a7",pendingPostContent__imageViewer:"o7",pendingPostContent__imageViewerOverlay:"hs"};var DI={postAcceptButton__button:"t7",postAcceptButton__text:"i7"};var If=i=>{var n=i,{onClick:e,pageId:t="*",componentId:o="*"}=n,r=d(n,["onClick","pageId","componentId"]);let a$1="post_accept_button",{accessibilityId:s,config:l,isExcluded:m,themeStyles:c}=S({pageId:t,componentId:o,elementId:a$1});return m?null:ie__default.createElement(oe,a({size:"medium",variant:"fill",onPress:e,className:DI.postAcceptButton__button},r),ie__default.createElement(v.BodyBold,{style:c,"data-testid":s,className:DI.postAcceptButton__text},l==null?void 0:l.text))};var VI={postDeclineButton__button:"s7",postDeclineButton__text:"d7"};var l9=i=>{var n=i,{onClick:e,pageId:t="*",componentId:o="*"}=n,r=d(n,["onClick","pageId","componentId"]);let a$1="post_decline_button",{accessibilityId:s,config:l,isExcluded:m,themeStyles:c}=S({pageId:t,componentId:o,elementId:a$1});return m?null:ie__default.createElement(oe,a({size:"medium",onPress:e,color:"secondary",variant:"outlined",className:VI.postDeclineButton__button},r),ie__default.createElement(v.BodyBold,{style:c,"data-testid":s,className:VI.postDeclineButton__text},l==null?void 0:l.text))};var m9=({pageId:e="*",post:t,canReviewCommunityPosts:o=!1,refresh:r})=>{var G,H,$,j;let i="pending_post_content",{accessibilityId:n,themeStyles:a}=se({pageId:e,componentId:i}),{currentUserId:s}=Xt(),{post:l$1}=Ir(t==null?void 0:t.postId),{setDrawerData:m,removeDrawerData:c}=tt(),d=ce(),{online:u}=useNetworkState(),{openPopup:g,closePopup:f}=Se(),{isDesktop:C}=le(),[y,b]=useState(!1),[_,x]=useState(null),P=useMemo(()=>{if(t!=null&&l$1!=null)return zV(t==null?void 0:t.updatedAt).unix()>zV(l$1==null?void 0:l$1.updatedAt).unix()?t:l$1;if(l$1!=null)return l$1;if(t!=null)return t},[t,l$1]),I=O=>l(void 0,null,function*(){if(O!=null)try{yield PostRepository.approvePost(O),d.success({content:"Post accepted."});}catch(z){d.info({content:"Failed to accept post. This post has been reviewed by another moderator."}),r==null||r();}}),w=O=>l(void 0,null,function*(){if(O!=null)try{yield PostRepository.declinePost(O),d.success({content:"Post declined."});}catch(z){d.info({content:"Failed to decline post. This post has been reviewed by another moderator."}),r==null||r();}}),M=O=>l(void 0,null,function*(){if(O!=null)try{yield PostRepository.deletePost(O),c(),d.success({content:"Post deleted."});}catch(z){d.info({content:"Failed to delete post. Post has been deleted."}),r==null||r();}}),T=O=>O===s,E=O=>{P&&g({id:"image-viewer",disabledAnimation:!0,isDismissable:C,className:Zr.pendingPostContent__imageViewer,overlayClassName:Zr.pendingPostContent__imageViewerOverlay,children:ie__default.createElement($u,{post:P,onClose:N,initialImageIndex:O})});},N=()=>{f("image-viewer");},A=O=>{b(!0),x(O);},D=()=>{b(!1),x(null);};return P?ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("div",{"data-testid":n,style:a,className:Zr.pendingPostContent__container,key:P.postId},ie__default.createElement("div",{className:Zr.pendingPostContent__bar},ie__default.createElement("div",{className:Zr.pendingPostContent__userDetail},ie__default.createElement(Ae,{pageId:e,componentId:i,userId:P==null?void 0:P.postedUserId}),ie__default.createElement("div",null,ie__default.createElement(v.BodyBold,{className:Zr.pendingPostContent__username,"data-testid":`${e}/${i}/username`},(H=(G=P.creator)==null?void 0:G.displayName)!=null?H:""),ie__default.createElement("div",{className:Zr.pendingPostContent__information__subtitle},ie__default.createElement(gi,{timestamp:P.createdAt}),P.createdAt!==P.editedAt&&ie__default.createElement(v.Caption,{"data-testid":`${e}/${i}/post_edited_text`,className:Zr.pendingPostContent__editedTag},"(edited)")))),T(P.postedUserId)&&ie__default.createElement("div",{className:Zr.pendingPostContent__wrapRightMenu},ie__default.createElement(ft,{containerClassName:Zr.pendingPostContent__actionButton,trigger:{pageId:e,componentId:i,onClick:({closePopover:O})=>m({content:ie__default.createElement(V,{className:Zr.pendingPostContent__item,"data-testid":`${e}/${i}/delete_post`,onPress:()=>{O(),M(P.postId),c();}},ie__default.createElement(Dn,{className:Zr.pendingPostContent__deletePost__icon}),ie__default.createElement(v.TitleBold,{className:Zr.pendingPostContent__deletePost__text},"Delete post"))})}},({closePopover:O})=>ie__default.createElement(V,{className:Zr.pendingPostContent__item,"data-testid":`${e}/${i}/delete_post`,onPress:()=>{O(),M(P.postId);}},ie__default.createElement(Dn,{className:Zr.pendingPostContent__deletePost__icon}),ie__default.createElement(v.TitleBold,{className:Zr.pendingPostContent__deletePost__text},"Delete post"))))),ie__default.createElement("div",{className:Zr.pendingPostContent__textPost},ie__default.createElement(Gc,{pageId:e,componentId:i,text:E1(P)?($=P==null?void 0:P.data)==null?void 0:$.text:"",mentioned:(j=P==null?void 0:P.metadata)==null?void 0:j.mentioned,mentionees:P==null?void 0:P.mentionees,post:P}),P.children.length>0&&ie__default.createElement(e0,{pageId:e,componentId:i,post:P,onImageClick:E,onVideoClick:A,onClipClick:()=>{}})),o&&ie__default.createElement("div",{className:Zr.pendingPostContent__buttonWrapper},ie__default.createElement(If,{pageId:e,componentId:i,onClick:()=>{if(!u){d.info({content:"Failed to accept post. Please try again."});return}I(P.postId);}}),ie__default.createElement(l9,{pageId:e,componentId:i,onClick:()=>{{if(!u){d.info({content:"Failed to decline post. Please try again."});return}w(P.postId);}}})),y&&P&&typeof _=="number"?ie__default.createElement(Zu,{post:P,onClose:D,initialVideoIndex:_}):null)):null};var to={userProfileHeader__container:"c7",userProfileHeader__header:"l7",userProfileHeader__displayName:"n7",userProfileHeader__avatar:"m7",userProfileHeader__avatar__placeholder:"h7",userProfileHeader__badge__container:"g7",userProfileHeader__badge:"p7",userProfileHeader__description:"b7",userProfileHeader__relationship:"u7",userProfileHeader__relationship__separator:"f7",userProfileHeader__skeleton:"v7",userProfileHeader__skeleton__header:"w7",userProfileHeader__skeleton__avatar:"gs",userProfileHeader__skeleton__displayName:"ps",userProfileHeader__skeleton__about:"ue",userProfileHeader__skeleton__relationship__text:"bs",pulse:"us",userProfileHeader__skeleton__relationship:"x7",userProfileHeader__popOver__container:"y7",userProfileHeader__unFollowButton:"fs",userProfileHeader__unFollowButton__icon:"k7",userProfileHeader__unFollowButton__text:"j7",pendingCountButton:"z7",pendingCountButton__inner:"X7",pendingCountButton__notification:"Y7",pendingCountButton__notification__icon:"I7",pendingCountButton__notification__text:"A7",pendingCountButton__notification__requestCount:"M7"};var d9={userFollowing__container:"S7",userFollowing__count:"C7",userFollowing__label:"E7"};var c9e=e=>{let[t,o]=useState(0),[r,i]=useState(0),[n,a]=useState(null),[s,l]=useState(0);return Cn({fetcher:UserRepository.Relationship.getFollowInfo,params:e,callback:m=>{m.data&&(o(m.data.followerCount),i(m.data.followingCount),l(m.data.pendingCount),m.data.status&&a(m.data.status));},shouldCall:!!e}),{followerCount:t,followingCount:r,pendingCount:s,followStatus:n}},Bi=c9e;var El={userRelationshipPage:"vs",userRelationshipPage__container:"ws",userRelationshipPage__content:"xs",userRelationshipPage__tabBar:"R7",userRelationshipPage__topBar:"ys",userRelationshipPage__displayName:"U7",userRelationshipPage__feedTabs:"B7",userRelationshipPage__topSection:"F7",userRelationshipPage__tabList:"H7",userRelationshipPage__tabPanel:"L7"};var wf={tabs:"ks",tabsList:"js",tabPanel:"zs",tab:"x"};var Um=l=>{var m=l,{tabs:e,onChange:t,activeTab:o,className:r,labelClassName:i,tabListClassName:n,tabPanelClassName:a$1}=m,s=d(m,["tabs","onChange","activeTab","className","labelClassName","tabListClassName","tabPanelClassName"]);return ie__default.createElement(Tabs,b(a({},s),{selectedKey:o,onSelectionChange:t,className:wl(wf.tabs,r)}),ie__default.createElement(TabList,{"aria-label":s["aria-label"],className:wl(wf.tabsList,n)},e.map(c=>ie__default.createElement(Tab,{id:c.value,key:c.value,className:wf.tab,"data-testid":c.accessibilityId},ie__default.createElement(v.TitleBold,{className:i},c.label)))),e.map(c=>ie__default.createElement(TabPanel,{id:c.value,key:c.value,className:wl(wf.tabPanel,a$1)},c.content())))};function OI({userId:e,status:t}){let i=it({fetcher:UserRepository.Relationship.getFollowings,params:{limit:20,userId:e,status:t!=null?t:void 0},shouldCall:!!e}),{items:o}=i,r=d(i,["items"]);return a({followings:o},r)}var cp={userRelationshipList__container:"Xs",userRelationshipList__menuContainer:"T7",userRelationshipList__menuButton:"V7",userRelationshipList__menuButton__icon:"W7",userRelationshipList__menuButton__label:"q7",userRelationshipList__observerTarget:"D7",userRelationshipList__emptyIcon:"G7",userRelationshipList__emptyContainer:"J7",userRelationshipList__skeletonContainer:"Ys",userRelationshipList__emptyText:"K7"};var Hn={userItem:"N7",userItem__buttonWrap:"O7",userItem__avatar:"P7",userItem__displayName:"Q7",userItem__menuContainer:"Is",userItem__menuButton:"Z7",userItem__menuButtonSkeleton:"_7","skeleton-pulse":"As",userItem__menuButton__icon:"e3",userItem__menuButton__label:"r3"};var b9e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M23.0391 19.8086C23.25 20.0195 23.3203 20.3711 23.1094 20.6172L22.7578 21.0391C22.582 21.2852 22.1953 21.3203 21.9844 21.1445L0.960938 4.69141C0.714844 4.51562 0.679688 4.16406 0.855469 3.91797L1.20703 3.46094C1.41797 3.25 1.76953 3.17969 2.01562 3.39062L23.0391 19.8086ZM12 4.9375C10.6992 4.9375 9.60938 5.67578 9.01172 6.73047L7.67578 5.67578C8.58984 4.23438 10.1719 3.25 12 3.25C14.7773 3.25 17.0625 5.53516 17.0625 8.3125C17.0625 9.71875 16.5 10.9492 15.5859 11.8633L14.25 10.8086C14.918 10.2109 15.375 9.33203 15.375 8.3125C15.375 6.48438 13.8281 4.9375 12 4.9375ZM5.8125 19.5625H17.2383L19.0664 21.0039C18.7852 21.1797 18.5039 21.25 18.1875 21.25H5.8125C4.86328 21.25 4.125 20.5117 4.125 19.5625V18.6836C4.125 16.082 6.23438 13.9375 8.83594 13.9727C9.22266 13.9727 9.60938 14.043 9.96094 14.1836C10.1367 14.2188 10.3125 14.2539 10.4883 14.3242L12.8086 16.1172C12.5273 16.1523 12.2812 16.1875 12 16.1875C11.1211 16.1875 10.2422 16.0469 9.39844 15.7656C9.15234 15.6953 8.97656 15.625 8.83594 15.625C7.14844 15.625 5.8125 16.9961 5.8125 18.6836V19.5625Z",fill:"currentColor"})),Al=b9e;var x9e=()=>{let{confirm:e}=Te(),t=ce(),{mutateAsync:o}=useMutation({mutationFn:a=>UserRepository.Relationship.blockUser(a),onSuccess:()=>{t.success({content:"User blocked."});},onError:()=>{t.error({content:"Failed to block user. Please try again."});}}),{mutateAsync:r}=useMutation({mutationFn:a=>UserRepository.Relationship.unBlockUser(a),onSuccess:()=>{t.success({content:"User unblocked."});},onError:()=>{t.error({content:"Failed to unblock user. Please try again."});}});return {blockUser:({pageId:a,componentId:s,userId:l,displayName:m})=>{e({pageId:a,componentId:s,title:"Block user?",content:`${m} won\u2019t be able to see posts and comments that you\u2019ve created. They won\u2019t be notified that you\u2019ve blocked them.`,cancelText:"Cancel",okText:"Block",onOk:()=>o(l)});},unblockUser:({pageId:a,componentId:s,userId:l,displayName:m})=>{e({pageId:a,componentId:s,title:"Unblock user?",content:`${m} will now be able to see posts and comments that you\u2019ve created. They won\u2019t be notified that you\u2019ve unblocked them.`,cancelText:"Cancel",okText:"Unblock",onOk:()=>r(l)});}}},ud=x9e;var P9e=()=>{let e=ce(),{mutateAsync:t}=useMutation({mutationFn:r=>UserRepository.flagUser(r),onSuccess:()=>{e.success({content:"User reported."});},onError:()=>{e.error({content:"Failed to report user. Please try again."});}}),{mutateAsync:o}=useMutation({mutationFn:r=>UserRepository.unflagUser(r),onSuccess:()=>{e.success({content:"User unreported."});},onError:()=>{e.error({content:"Failed to unreported user. Please try again."});}});return {reportUser:t,unReportUser:o}},p9=P9e;var T9e=e=>{let{data:t,isLoading:o,isFetching:r}=useQuery({queryKey:["asc-uikit","UserRepository","isUserReportedByMe",e],queryFn:()=>UserRepository.isUserFlaggedByMe(e),enabled:e!=null});return {isLoading:o,isFetching:r,isReportedByMe:t}},u9=T9e;var zI=({user:e,closePopover:t,pageId:o="*",componentId:r="*"})=>{let{blockUser:i}=ud(),{removeDrawerData:n}=tt(),{reportUser:a,unReportUser:s}=p9(),{isReportedByMe:l,isFetching:m}=u9(e.userId),{online:c}=useNetworkState(),d=ce();return ie__default.createElement("div",{className:Hn.userItem__menuContainer},m?Array.from({length:2}).map((u,g)=>ie__default.createElement("div",{className:Hn.userItem__menuButtonSkeleton,key:g})):ie__default.createElement(ie__default.Fragment,null,ie__default.createElement(oe,{variant:"text","data-testid":`${o}/${r}/report_user_button`,className:Hn.userItem__menuButton,onPress:()=>{if(t(),n(),!c){d.info({content:`Failed to ${l?"unreport":"report"} user. Please try again.`});return}l?s(e.userId):a(e.userId);}},ie__default.createElement(V3,{className:Hn.userItem__menuButton__icon}),ie__default.createElement(v.BodyBold,{className:Hn.userItem__menuButton__label},l?"Unreport user":"Report user")),ie__default.createElement(oe,{variant:"text",className:Hn.userItem__menuButton,"data-testid":`${o}/${r}/block_user_button`,onPress:()=>{var u;if(t(),n(),!c){d.info({content:"Failed to block user. Please try again."});return}i({pageId:o,componentId:r,userId:e.userId,displayName:(u=e.displayName)!=null?u:""});}},ie__default.createElement(Al,{className:Hn.userItem__menuButton__icon}),ie__default.createElement(v.BodyBold,{className:Hn.userItem__menuButton__label},"Block user"))))};var _j=({userId:e,pageId:t="*",componentId:o="*"})=>{let{AmityUserRelationshipPageBehavior:r}=we(),{setDrawerData:i}=tt(),{user:n}=qe({userId:e});return n?ie__default.createElement("div",{className:Hn.userItem},ie__default.createElement(V,{onPress:()=>{var a;return (a=r==null?void 0:r.goToUserProfilePage)==null?void 0:a.call(r,{userId:e})},className:Hn.userItem__buttonWrap},ie__default.createElement(Ae,{pageId:t,componentId:o,userId:n.userId,className:Hn.userItem__avatar}),ie__default.createElement(v.BodyBold,{className:Hn.userItem__displayName},n.displayName)),ie__default.createElement(ft,{trigger:{pageId:t,componentId:o,onClick:({closePopover:a})=>i({content:ie__default.createElement(zI,{closePopover:a,user:n})})}},({closePopover:a})=>ie__default.createElement(zI,{closePopover:a,user:n}))):null};var g9={userListSkeleton:"a3",userListSkeleton__avatar:"Ms",userListSkeleton__displayName:"Ss","skeleton-pulse":"Cs"};var Fl=()=>ie__default.createElement("div",{className:g9.userListSkeleton},ie__default.createElement("div",{className:g9.userListSkeleton__avatar}),ie__default.createElement("div",{className:g9.userListSkeleton__displayName}));var Mf=({pageId:e="*",componentId:t="*",relationships:o,hasMore:r=!1,isLoading:i=!1,type:n,loadMore:a})=>{let[s,l]=useState(null),m=()=>ie__default.createElement("div",{className:cp.userRelationshipList__skeletonContainer},Array.from({length:5}).map((c,d)=>ie__default.createElement(Fl,{key:d})));return ke({onIntersect:()=>{i===!1&&(a==null||a());},node:s,options:{threshold:.7}}),ie__default.createElement("div",{className:cp.userRelationshipList__container},!i&&(o==null?void 0:o.length)===0?ie__default.createElement("div",{className:cp.userRelationshipList__emptyContainer},ie__default.createElement(q2,{className:cp.userRelationshipList__emptyIcon}),ie__default.createElement(v.TitleBold,{className:cp.userRelationshipList__emptyText},"Nothing here to see yet")):ie__default.createElement(ie__default.Fragment,null,o==null?void 0:o.map(c=>{let d=c[n==="following"?"to":"from"];return ie__default.createElement(_j,{key:d,userId:d,pageId:e,componentId:t})})),i&&m(),r&&ie__default.createElement("div",{ref:c=>l(c),className:cp.userRelationshipList__observerTarget}))};var bj=({userId:e,pageId:t="*",componentId:o="*"})=>{let{followings:r,hasMore:i,loadMore:n,isLoading:a}=OI({userId:e,status:"accepted"});return ie__default.createElement(Mf,{relationships:r,type:"following",pageId:t,componentId:o,hasMore:i,loadMore:n,isLoading:a})};function Sf({userId:e,status:t}){let i=it({fetcher:UserRepository.Relationship.getFollowers,params:{limit:20,userId:e,status:t!=null?t:void 0},shouldCall:!!e}),{items:o}=i,r=d(i,["items"]);return a({followers:o},r)}var xj=({userId:e,pageId:t="*",componentId:o="*"})=>{let{followers:r,hasMore:i,loadMore:n,isLoading:a}=Sf({userId:e,status:"accepted"});return ie__default.createElement(Mf,{relationships:r,type:"followers",pageId:t,componentId:o,hasMore:i,loadMore:n,isLoading:a})};var Hm=(o=>(o.FOLLOWING="following",o.FOLLOWER="followers",o))(Hm||{}),up=({userId:e,selectedTab:t})=>{let o="user_releationship_page",{themeStyles:r}=ue({pageId:o}),{user:i}=qe({userId:e}),{onBack:n}=Y(),[a,s]=useState(t),l=[{label:"Following",value:"following",content:()=>ie__default.createElement(bj,{userId:e})},{label:"Followers",value:"followers",content:()=>ie__default.createElement(xj,{userId:e})}];return ie__default.createElement("div",{className:El.userRelationshipPage,style:r},ie__default.createElement("div",{className:El.userRelationshipPage__container},ie__default.createElement("div",{className:El.userRelationshipPage__topSection},ie__default.createElement("div",{className:El.userRelationshipPage__topBar},ie__default.createElement(ze,{pageId:o,onPress:()=>n()}),ie__default.createElement(v.TitleBold,{className:El.userRelationshipPage__displayName},i==null?void 0:i.displayName))),ie__default.createElement("div",{className:El.userRelationshipPage__content},ie__default.createElement(Um,{className:El.userRelationshipPage__tabBar,tabs:l,activeTab:a,onChange:m=>s(m),tabListClassName:El.userRelationshipPage__tabList,tabPanelClassName:El.userRelationshipPage__tabPanel}))))};var Pj=({userId:e,pageId:t="*",componentId:o="*"})=>{let{followingCount:r}=Bi(e),{AmityUserProfileHeaderComponentBehavior:i}=we(),n="user_following",{themeStyles:a,config:s,accessibilityId:l}=S({pageId:t,componentId:o,elementId:n});return ie__default.createElement(V,{"data-testid":l,style:a,className:d9.userFollowing__container,onPress:()=>{var m;return (m=i.goToUserRelationshipPage)==null?void 0:m.call(i,{userId:e,selectedTab:"following"})}},ie__default.createElement(v.BodyBold,{className:d9.userFollowing__count},fA(r)),s.text&&ie__default.createElement(v.Caption,{className:d9.userFollowing__label}," ",s.text))};var f9={userFollower__container:"o3",userFollower__count:"t3",userFollower__label:"i3"};var Ij=({userId:e,pageId:t="*",componentId:o="*"})=>{let{followerCount:r}=Bi(e),i="user_follower",{AmityUserProfileHeaderComponentBehavior:n}=we(),{themeStyles:a,config:s,accessibilityId:l}=S({pageId:t,componentId:o,elementId:i});return ie__default.createElement(V,{className:f9.userFollower__container,"data-testid":l,style:a,onPress:()=>{var m;(m=n.goToUserRelationshipPage)==null||m.call(n,{userId:e,selectedTab:"followers"});}},ie__default.createElement(v.BodyBold,{className:f9.userFollower__count},fA(r)),s.text&&ie__default.createElement(v.Caption,{className:f9.userFollower__label},s.text))};var ZI={userName__displayName:"s3",userName__displayName__text:"d3"};var wj=({name:e,pageId:t="*",componentId:o="*"})=>{let r="user_name",{isExcluded:i,accessibilityId:n}=S({pageId:t,componentId:o,elementId:r});return i?null:ie__default.createElement("div",{className:ZI.userName__displayName,"data-testid":n},ie__default.createElement(v.Headline,null,ie__default.createElement(RE,{lines:4},ie__default.createElement("div",{className:ZI.userName__displayName__text},e))))};var h9={userDescription__description:"c3",userDescription__description__text:"l3",userDescription__seeMore__button:"n3"};var Tj=({description:e="",pageId:t="*",componentId:o="*"})=>{let r="user_description",[i,n]=useState(!1),{isExcluded:a,accessibilityId:s}=S({pageId:t,componentId:o,elementId:r}),l=()=>{n(!0);};return a?null:ie__default.createElement("div",{className:h9.userDescription__description,"data-testid":s},ie__default.createElement(v.Body,{className:h9.userDescription__description__text},i?e:ie__default.createElement(RE,{lines:4,ellipsis:ie__default.createElement(ie__default.Fragment,null,"...",ie__default.createElement(V,{className:h9.userDescription__seeMore__button,onPress:l},"See more"))},ie__default.createElement("div",null,e))))};var j9e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M13.6435 20.7628C12.5251 21.8728 11.4652 21.8812 10.3552 20.7628L9.10328 19.5109C8.98644 19.394 8.88629 19.3607 8.73606 19.3607H6.9667C5.38931 19.3607 4.63817 18.6095 4.63817 17.0321V15.2628C4.63817 15.1125 4.59644 15.004 4.48794 14.8955L3.23604 13.6353C2.12602 12.5253 2.11767 11.4653 3.23604 10.3553L4.48794 9.10342C4.59644 8.99492 4.63817 8.88642 4.63817 8.73619V6.96684C4.63817 5.37275 5.38931 4.6383 6.9667 4.6383H8.73606C8.88629 4.6383 8.99478 4.59657 9.10328 4.48807L10.3552 3.24452C11.4652 2.11781 12.5251 2.11781 13.6435 3.23617L14.8954 4.48807C15.0039 4.59657 15.1124 4.6383 15.2626 4.6383H17.032C18.6094 4.6383 19.3605 5.38944 19.3605 6.96684V8.73619C19.3605 8.88642 19.4023 8.98657 19.5108 9.10342L20.7627 10.3553C21.8727 11.4653 21.881 12.5253 20.7627 13.6353L19.5108 14.8955C19.4023 15.004 19.3605 15.1125 19.3605 15.2628V17.0321C19.3605 18.6095 18.6094 19.3607 17.032 19.3607H15.2626C15.1124 19.3607 15.0123 19.394 14.8954 19.5109L13.6435 20.7628Z",fill:"url(#paint0_linear_1571_10885)"}),ie__default.createElement("path",{d:"M9.90432 15.9736C10.0879 16.1656 10.3216 16.2741 10.6137 16.2741C10.9225 16.2741 11.1729 16.1656 11.3649 15.9152L16.047 9.34691C16.1722 9.17164 16.2389 8.96299 16.2389 8.79607C16.2389 8.312 15.8717 7.95312 15.3543 7.95312C15.0204 7.95312 14.8034 8.06997 14.6031 8.35373L10.5803 14.0958L8.56896 11.8507C8.38535 11.6504 8.1767 11.5586 7.89293 11.5586C7.37548 11.5586 7.0166 11.9175 7.0166 12.4182C7.0166 12.6269 7.09172 12.8355 7.2336 12.9858L9.90432 15.9736Z",fill:"white"}),ie__default.createElement("defs",null,ie__default.createElement("linearGradient",{id:"paint0_linear_1571_10885",x1:"11.9993",y1:"2.39844",x2:"11.9993",y2:"21.5964",gradientUnits:"userSpaceOnUse"},ie__default.createElement("stop",{"stop-color":"#FFDB7D"}),ie__default.createElement("stop",{offset:"1","stop-color":"#D49900"})))),Mj=j9e;var Nf={followUserButton:"m3",followUserButton__inner:"h3",followUserButton__icon:"g3",followUserButton__text:"p3"};var WI=({pageId:e="*",componentId:t="*",onClick:o})=>{let r="follow_user_button",{accessibilityId:i,config:n,defaultConfig:a,isExcluded:s,uiReference:l}=S({pageId:e,componentId:t,elementId:r});return s?null:ie__default.createElement(V,{"data-testid":i,className:Nf.followUserButton,onPress:o},ie__default.createElement("div",{className:Nf.followUserButton__inner},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(br,{className:Nf.followUserButton__icon}),configIconName:n.image,defaultIconName:a.image,imgIcon:()=>ie__default.createElement("img",{src:n.image,alt:l})}),n.text&&ie__default.createElement(v.BodyBold,{className:Nf.followUserButton__text},n.text)))};var kf={followingUserButton:"b3",followingUserButton__inner:"u3",followingUserButton__icon:"f3",followingUserButton__text:"v3"};var Z9e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M19.2871 7.62109C19.4043 7.73828 19.4043 7.91406 19.2871 8.03125L15.4785 11.8691C15.3613 11.9863 15.1562 11.9863 15.0391 11.8691L12.9004 9.67188C12.7832 9.55469 12.7832 9.37891 12.9004 9.26172L13.457 8.67578C13.5742 8.55859 13.75 8.55859 13.8672 8.67578L15.2734 10.082L18.291 7.03516C18.4082 6.91797 18.584 6.91797 18.7012 7.03516L19.2871 7.62109ZM7.1875 11.3125C4.84375 11.3125 2.96875 9.4375 2.96875 7.09375C2.96875 4.7793 4.84375 2.875 7.1875 2.875C9.50195 2.875 11.4062 4.7793 11.4062 7.09375C11.4062 9.4375 9.50195 11.3125 7.1875 11.3125ZM7.1875 4.28125C5.63477 4.28125 4.375 5.57031 4.375 7.09375C4.375 8.64648 5.63477 9.90625 7.1875 9.90625C8.71094 9.90625 10 8.64648 10 7.09375C10 5.57031 8.71094 4.28125 7.1875 4.28125ZM9.79492 11.7812C11.9629 11.7812 13.75 13.5684 13.75 15.7363V16.4688C13.75 17.2598 13.1055 17.875 12.3438 17.875H2.03125C1.24023 17.875 0.625 17.2598 0.625 16.4688V15.7363C0.625 13.5684 2.38281 11.7812 4.55078 11.7812C5.40039 11.7812 5.78125 12.25 7.1875 12.25C8.56445 12.25 8.94531 11.7812 9.79492 11.7812ZM12.3438 16.4688V15.7363C12.3438 14.3301 11.2012 13.1875 9.79492 13.1875C9.35547 13.1875 8.68164 13.6562 7.1875 13.6562C5.66406 13.6562 4.99023 13.1875 4.55078 13.1875C3.14453 13.1875 2.03125 14.3301 2.03125 15.7363V16.4688H12.3438Z"})),Nj=Z9e;var qI=({pageId:e="*",componentId:t="*",onClick:o})=>{let r="following_user_button",{accessibilityId:i,config:n,defaultConfig:a,isExcluded:s,uiReference:l}=S({pageId:e,componentId:t,elementId:r});return s?null:ie__default.createElement(V,{"data-testid":i,className:kf.followingUserButton,onPress:o},ie__default.createElement("div",{className:kf.followingUserButton__inner},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(Nj,{className:kf.followingUserButton__icon}),configIconName:n.image,defaultIconName:a.image,imgIcon:()=>ie__default.createElement("img",{src:n.image,alt:l})}),n.text&&ie__default.createElement(v.BodyBold,{className:kf.followingUserButton__text},n.text)))};var Bf={pendingUserButton:"w3",pendingUserButton__inner:"x3",pendingUserButton__icon:"y3",pendingUserButton__text:"k3"};var q9e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M7.6875 11.3125C5.34375 11.3125 3.46875 9.4375 3.46875 7.09375C3.46875 4.7793 5.34375 2.875 7.6875 2.875C10.002 2.875 11.9062 4.7793 11.9062 7.09375C11.9062 9.4375 10.002 11.3125 7.6875 11.3125ZM7.6875 4.28125C6.13477 4.28125 4.875 5.57031 4.875 7.09375C4.875 8.64648 6.13477 9.90625 7.6875 9.90625C9.21094 9.90625 10.5 8.64648 10.5 7.09375C10.5 5.57031 9.21094 4.28125 7.6875 4.28125ZM2.53125 16.4688H10.7637C11.0859 17.0254 11.4668 17.4941 11.9355 17.875H2.53125C1.74023 17.875 1.125 17.2598 1.125 16.4688V15.7363C1.125 13.5684 2.88281 11.7812 5.05078 11.7812C5.90039 11.7812 6.28125 12.25 7.6875 12.25C9.09375 12.25 9.41602 11.7812 10.3535 11.8105C10.1777 12.25 10.0898 12.748 10.0312 13.2461C9.73828 13.3047 8.94727 13.6562 7.6875 13.6562C6.16406 13.6562 5.49023 13.1875 5.05078 13.1875C3.64453 13.1875 2.53125 14.3301 2.53125 15.7363V16.4688ZM15.6562 9.4375C17.9707 9.4375 19.875 11.3418 19.875 13.6562C19.875 16 17.9707 17.875 15.6562 17.875C13.3125 17.875 11.4375 16 11.4375 13.6562C11.4375 11.3418 13.3125 9.4375 15.6562 9.4375ZM17.5312 13.8613V13.4805C17.5312 13.334 17.3848 13.1875 17.2383 13.1875H16.125V11.6055C16.125 11.459 15.9785 11.3125 15.832 11.3125H15.4512C15.3047 11.3125 15.1875 11.459 15.1875 11.6055V13.8613C15.1875 14.0078 15.3047 14.125 15.4512 14.125H17.2383C17.3848 14.125 17.5312 14.0078 17.5312 13.8613Z",fill:"currentColor"})),Bj=q9e;var YI=({pageId:e="*",componentId:t="*",onClick:o})=>{let r="pending_user_button",{accessibilityId:i,config:n,defaultConfig:a,isExcluded:s,uiReference:l}=S({pageId:e,componentId:t,elementId:r});return s?null:ie__default.createElement(V,{"data-testid":i,className:Bf.pendingUserButton,onPress:o},ie__default.createElement("div",{className:Bf.pendingUserButton__inner},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(Bj,{className:Bf.pendingUserButton__icon}),configIconName:n.image,defaultIconName:a.image,imgIcon:()=>ie__default.createElement("img",{src:n.image,alt:l})}),n.text&&ie__default.createElement(v.BodyBold,{className:Bf.pendingUserButton__text},n.text)))};var Ef={unblockUserButton:"j3",unblockUserButton__inner:"z3",unblockUserButton__icon:"X3",unblockUserButton__text:"Y3"};var Q9e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M19.6992 16.6738C19.875 16.8496 19.9336 17.1426 19.7578 17.3477L19.4648 17.6992C19.3184 17.9043 18.9961 17.9336 18.8203 17.7871L1.30078 4.07617C1.0957 3.92969 1.06641 3.63672 1.21289 3.43164L1.50586 3.05078C1.68164 2.875 1.97461 2.81641 2.17969 2.99219L19.6992 16.6738ZM10.5 4.28125C9.41602 4.28125 8.50781 4.89648 8.00977 5.77539L6.89648 4.89648C7.6582 3.69531 8.97656 2.875 10.5 2.875C12.8145 2.875 14.7188 4.7793 14.7188 7.09375C14.7188 8.26562 14.25 9.29102 13.4883 10.0527L12.375 9.17383C12.9316 8.67578 13.3125 7.94336 13.3125 7.09375C13.3125 5.57031 12.0234 4.28125 10.5 4.28125ZM5.34375 16.4688H14.8652L16.3887 17.6699C16.1543 17.8164 15.9199 17.875 15.6562 17.875H5.34375C4.55273 17.875 3.9375 17.2598 3.9375 16.4688V15.7363C3.9375 13.5684 5.69531 11.7812 7.86328 11.8105C8.18555 11.8105 8.50781 11.8691 8.80078 11.9863C8.94727 12.0156 9.09375 12.0449 9.24023 12.1035L11.1738 13.5977C10.9395 13.627 10.7344 13.6562 10.5 13.6562C9.76758 13.6562 9.03516 13.5391 8.33203 13.3047C8.12695 13.2461 7.98047 13.1875 7.86328 13.1875C6.45703 13.1875 5.34375 14.3301 5.34375 15.7363V16.4688Z",fill:"currentColor"})),Aj=Q9e;var Lj=({pageId:e="*",componentId:t="*",onClick:o})=>{let r="unblock_user_button",{accessibilityId:i,config:n,defaultConfig:a,isExcluded:s,uiReference:l}=S({pageId:e,componentId:t,elementId:r});return s?null:ie__default.createElement(V,{"data-testid":i,className:Ef.unblockUserButton,onPress:o},ie__default.createElement("div",{className:Ef.unblockUserButton__inner},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(Aj,{className:Ef.unblockUserButton__icon}),configIconName:n.image,defaultIconName:a.image,imgIcon:()=>ie__default.createElement("img",{src:n.image,alt:l})}),n.text&&ie__default.createElement(v.BodyBold,{className:Ef.unblockUserButton__text},n.text)))};var K9e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 7 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("circle",{cx:"3.5",cy:"3",r:"3"})),Dj=K9e;var J9e=()=>{let{confirm:e,closeConfirm:t}=Te(),o=ce(),{mutateAsync:r}=useMutation({mutationFn:a=>UserRepository.Relationship.follow(a),onError:()=>{e({title:"Unable to follow this user",content:"Oops! something went wrong. Please try again later.",onOk:()=>t()});}}),{mutateAsync:i}=useMutation({mutationFn:a=>UserRepository.Relationship.unfollow(a),onError:()=>{o.error({content:"Failed to unfollow user."});}});return {followUser:r,unFollowUser:({pageId:a,userId:s})=>{e({pageId:a,type:"info",title:"Unfollow this user?",content:"If you change your mind, you\u2019ll have to request to follow them again.",onOk:()=>i(s)});},cancelFollow:i}},Hj=J9e;var X9e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M10.5625 13.5C13.5625 13.5 16 15.9375 16 18.9375C16 19.5312 15.5 20 14.9062 20H3.0625C2.46875 20 2 19.5312 2 18.9375C2 15.9375 4.40625 13.5 7.40625 13.5H10.5625ZM3.5 18.5H14.4688C14.2188 16.5625 12.5938 15 10.5625 15H7.40625C5.375 15 3.71875 16.5625 3.5 18.5ZM9 12C6.78125 12 5 10.2188 5 8C5 5.8125 6.78125 4 9 4C11.1875 4 13 5.8125 13 8C13 10.2188 11.1875 12 9 12ZM9 5.5C7.59375 5.5 6.5 6.625 6.5 8C6.5 9.40625 7.59375 10.5 9 10.5C10.375 10.5 11.5 9.40625 11.5 8C11.5 6.625 10.375 5.5 9 5.5ZM20.0312 11L21.5 12.4688C21.8125 12.7812 21.8125 13.25 21.5 13.5312C21.2188 13.8438 20.75 13.8438 20.4688 13.5312L19 12.0625L17.5 13.5625C17.2188 13.8438 16.75 13.8438 16.4688 13.5625C16.1562 13.25 16.1562 12.7812 16.4688 12.5L17.9375 11.0312L16.4688 9.5625C16.1562 9.25 16.1562 8.78125 16.4688 8.5C16.75 8.1875 17.2188 8.1875 17.5 8.5L19 9.96875L20.4375 8.46875C20.75 8.15625 21.2188 8.15625 21.5 8.46875C21.8125 8.75 21.8125 9.21875 21.5 9.53125L20.0312 11Z",fill:"currentColor"})),zj=X9e;var the=()=>ie__default.createElement("div",{className:to.userProfileHeader__skeleton},ie__default.createElement("div",{className:to.userProfileHeader__skeleton__header},ie__default.createElement("div",{className:to.userProfileHeader__skeleton__avatar}),ie__default.createElement("div",{className:to.userProfileHeader__skeleton__displayName})),ie__default.createElement("div",null,ie__default.createElement("div",{className:to.userProfileHeader__skeleton__about}),ie__default.createElement("div",{className:to.userProfileHeader__skeleton__about})),ie__default.createElement("div",{className:to.userProfileHeader__skeleton__relationship},ie__default.createElement("div",{className:to.userProfileHeader__skeleton__relationship__text}),ie__default.createElement("div",{className:to.userProfileHeader__skeleton__relationship__text}))),C9=({user:e,pageId:t="*"})=>{var A;let o="user_profile_header",[r,i]=useState(!1),{currentUserId:n}=Ne(),{themeStyles:a,accessibilityId:s}=se({pageId:t,componentId:o}),{AmityUserProfileHeaderComponentBehavior:l}=we(),{followStatus:m,pendingCount:c}=Bi(e==null?void 0:e.userId),{followUser:d,unFollowUser:u,cancelFollow:g}=Hj(),{unblockUser:f}=ud(),{setDrawerData:C,removeDrawerData:y}=tt(),{online:b}=useNetworkState(),_=ce(),x=({onClickButton:D,userId:G})=>ie__default.createElement(oe,{className:to.userProfileHeader__unFollowButton,onPress:()=>{y(),u({pageId:t,userId:G}),D==null||D();},variant:"text"},ie__default.createElement(zj,{className:to.userProfileHeader__unFollowButton__icon}),ie__default.createElement(v.BodyBold,{className:to.userProfileHeader__unFollowButton__text},"Unfollow")),{isDesktop:P}=le(),I=D=>{C({content:x({userId:D})});},w=D=>ie__default.createElement(ft,{trigger:({openPopover:G})=>ie__default.createElement(qI,{pageId:t,componentId:o,onClick:()=>{P?G():I(D);}})},({closePopover:G})=>ie__default.createElement("div",{className:to.userProfileHeader__popOver__container},x({userId:D,onClickButton:G}))),M=n&&e&&n!==e.userId&&m==="pending",T=n&&e&&n!==e.userId&&m==="none",E=n&&e&&n!==e.userId&&m==="accepted",N=n&&e&&n!==e.userId&&m==="blocked";return e?ie__default.createElement("div",{className:to.userProfileHeader__container,style:a,"data-testid":s},ie__default.createElement("div",{className:to.userProfileHeader__header},ie__default.createElement(oe,{variant:"text",onPress:()=>i(!0)},ie__default.createElement(Ae,{userId:e.userId,className:to.userProfileHeader__avatar,textPlaceholderClassName:to.userProfileHeader__avatar__placeholder,pageId:t,componentId:o})),ie__default.createElement("div",{className:to.userProfileHeader__displayName},ie__default.createElement(wj,{name:(A=e.displayName)!=null?A:e.userId,pageId:t,componentId:o}),e.isBrand&&ie__default.createElement("div",{className:to.userProfileHeader__badge__container},ie__default.createElement(Mj,{className:to.userProfileHeader__badge})))),ie__default.createElement(Tj,{description:e.description,pageId:t,componentId:o}),ie__default.createElement("div",{className:to.userProfileHeader__relationship},ie__default.createElement(Pj,{userId:e.userId,pageId:t,componentId:o}),ie__default.createElement("div",{className:to.userProfileHeader__relationship__separator}),ie__default.createElement(Ij,{userId:e.userId,pageId:t,componentId:o})),c>0&&ie__default.createElement(oe,{variant:"outlined",className:to.pendingCountButton,onPress:()=>{var D;return (D=l==null?void 0:l.goToPendingFollowRequestPage)==null?void 0:D.call(l)}},ie__default.createElement("div",{className:to.pendingCountButton__inner},ie__default.createElement("div",{className:to.pendingCountButton__notification},ie__default.createElement(Dj,{className:to.pendingCountButton__notification__icon}),ie__default.createElement(v.BodyBold,{className:to.pendingCountButton__notification__text},"New follow requests")),ie__default.createElement("div",null,ie__default.createElement(v.Caption,{className:to.pendingCountButton__notification__requestCount},`${c} request${c>0?"s":""} need your approval`)))),T&&ie__default.createElement(WI,{pageId:t,componentId:o,onClick:()=>{if(!b){_.info({content:"Oops, something went wrong."});return}d(e.userId);}}),E&&w(e.userId),M&&ie__default.createElement(YI,{pageId:t,componentId:o,onClick:()=>{if(!b){_.info({content:"Oops, something went wrong."});return}g(e.userId);}}),N&&ie__default.createElement(Lj,{pageId:t,componentId:o,onClick:()=>{var D;if(!b){_.info({content:"Failed to unblock user. Please try again."});return}f({pageId:t,componentId:o,userId:e.userId,displayName:(D=e.displayName)!=null?D:e.userId});}}),r&&e.avatarFileId&&ie__default.createElement(ff,{fileId:e.avatarFileId,onClose:()=>i(!1),pageId:t,componentId:o})):ie__default.createElement(the,null)};var jj={emptyUserFeed:"Es",emptyUserFeed__icon:"I3",emptyUserFeed__text:"A3"};var QI=({pageId:e="*",componentId:t="*"})=>{let o="empty_user_feed",{config:r,defaultConfig:i,isExcluded:n,themeStyles:a,accessibilityId:s,uiReference:l}=S({pageId:e,componentId:t,elementId:o});return n?null:ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:o,defaultIcon:()=>ie__default.createElement(s0,{className:jj.emptyUserFeed__icon})})};var $j={blockedUserFeed__icon:"M3"};var Wj=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"blocked_user_feed",infoElementId:"blocked_user_feed_info",defaultIcon:()=>ie__default.createElement(Al,{className:$j.blockedUserFeed__icon})});var qj={privateUserFeed__icon:"S3"};var nhe=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 61 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M33.0312 43.75C33.0312 45.2266 31.8711 46.2812 30.5 46.2812C29.0234 46.2812 27.9688 45.2266 27.9688 43.75V37C27.9688 35.6289 29.0234 34.4688 30.5 34.4688C31.8711 34.4688 33.0312 35.6289 33.0312 37V43.75ZM30.5 3.25C37.8828 3.25 44 9.36719 44 16.75V23.5H47.375C51.0664 23.5 54.125 26.5586 54.125 30.25V50.5C54.125 54.2969 51.0664 57.25 47.375 57.25H13.625C9.82812 57.25 6.875 54.2969 6.875 50.5V30.25C6.875 26.5586 9.82812 23.5 13.625 23.5H17V16.75C17 9.36719 23.0117 3.25 30.5 3.25ZM30.5 8.3125C25.7539 8.3125 22.0625 12.1094 22.0625 16.75V23.5H38.9375V16.75C38.9375 12.1094 35.1406 8.3125 30.5 8.3125ZM13.625 28.5625C12.6758 28.5625 11.9375 29.4062 11.9375 30.25V50.5C11.9375 51.4492 12.6758 52.1875 13.625 52.1875H47.375C48.2188 52.1875 49.0625 51.4492 49.0625 50.5V30.25C49.0625 29.4062 48.2188 28.5625 47.375 28.5625H13.625Z"})),f0=nhe;var Kj=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"private_user_feed",infoElementId:"private_user_feed_info",defaultIcon:()=>ie__default.createElement(f0,{className:qj.privateUserFeed__icon})});var v9={errorContent__container:"Rs",errorContent__text:"C3",errorContent__icon:"E3"};var she=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 61 42",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M58.3438 0.75C59.7148 0.75 60.875 1.91016 60.875 3.28125V38.7188C60.875 40.1953 59.7148 41.25 58.3438 41.25H5.1875C2.33984 41.25 0.125 39.0352 0.125 36.1875V6.65625C0.125 5.28516 1.17969 4.125 2.65625 4.125H6.875V3.28125C6.875 1.91016 7.92969 0.75 9.40625 0.75H58.3438ZM3.5 36.1875C3.5 37.1367 4.23828 37.875 5.1875 37.875C6.03125 37.875 6.875 37.1367 6.875 36.1875V7.5H3.5V36.1875ZM57.5 37.875V4.125H10.25V36.1875V36.293C10.25 36.7148 10.0391 37.4531 9.93359 37.875H57.5Z"}),ie__default.createElement("path",{d:"M34.4375 13C37.0625 13 39.9062 15.0938 39.9062 17.8125C39.9062 21.4375 36 21.5 36 22.8438V23C36 23.4375 35.6562 23.75 35.25 23.75H32.9688C32.5625 23.75 32.2188 23.4375 32.2188 23V22.7188C32.2188 20.7812 33.6875 20 34.8125 19.375C35.75 18.8438 36.3438 18.5 36.3438 17.7812C36.3438 16.8438 35.1562 16.25 34.1875 16.25C32.9688 16.25 32.375 16.8125 31.5938 17.7812C31.3438 18.0938 30.875 18.1562 30.5625 17.9062L29.2188 16.875C28.875 16.6562 28.8125 16.1875 29.0312 15.875C30.3125 14.0312 31.9375 13 34.4375 13ZM34.125 24.6875C35.3125 24.6875 36.2812 25.6562 36.2812 26.8438C36.2812 28.0312 35.3125 29 34.125 29C32.9062 29 31.9375 28.0312 31.9375 26.8438C31.9375 25.6562 32.9062 24.6875 34.125 24.6875Z"})),Jj=she;var yp=()=>ie__default.createElement("div",{className:v9.errorContent__container},ie__default.createElement(Jj,{className:v9.errorContent__icon}),ie__default.createElement("div",{className:v9.errorContent__text},ie__default.createElement(v.TitleBold,null,"Something went wrong"),ie__default.createElement(v.Caption,null,"We couldn\u2019t recognize this feed.")));var ia={userFeed__container:"R3",userFeed__loadingIndicator:"U3",userFeed__observerTarget:"B3",userFeed__post:"F3",userFeed__spinner:"H3",spin:"Us",userFeed__postContent:"Bs",userFeed_postSkeleton__post:"Fs",userFeed_postSkeleton__post__header:"L3",userFeed_postSkeleton__post__avatar:"Hs",userFeed_postSkeleton__post__headerText_wrap:"T3",userFeed_postSkeleton__post__displayName:"Ls",userFeed_postSkeleton__post__timestamp:"Ts",userFeed_postSkeleton__post__content:"q",pulse:"Vs"};var che=()=>ie__default.createElement(ie__default.Fragment,null,Array.from({length:3}).map((e,t)=>ie__default.createElement("div",{key:t,className:ia.userFeed_postSkeleton__post},ie__default.createElement("div",{className:ia.userFeed_postSkeleton__post__header},ie__default.createElement("div",{className:ia.userFeed_postSkeleton__post__avatar}),ie__default.createElement("div",{className:ia.userFeed_postSkeleton__post__headerText_wrap},ie__default.createElement("div",{className:ia.userFeed_postSkeleton__post__displayName}),ie__default.createElement("div",{className:ia.userFeed_postSkeleton__post__timestamp}))),ie__default.createElement("div",null,ie__default.createElement("div",{className:ia.userFeed_postSkeleton__post__content}),ie__default.createElement("div",{className:ia.userFeed_postSkeleton__post__content}),ie__default.createElement("div",{className:ia.userFeed_postSkeleton__post__content}))))),_9=({pageId:e="*",userId:t})=>{let o="user_feed",[r,i]=useState(null),{AmityUserFeedComponentBehavior:n}=we(),{accessibilityId:a,themeStyles:s}=se({pageId:e,componentId:o}),{posts:l,hasMore:m,loadMore:c,refresh:d,isLoading:u,error:g}=Ao({targetId:t,targetType:"user",limit:10}),{followStatus:f}=Bi(t);ke({onIntersect:()=>{u===!1&&c();},node:r,options:{threshold:.7}}),useEffect(()=>{d();},[]);let C=()=>f==="blocked"?ie__default.createElement(Wj,{pageId:e,componentId:o}):g&&g.message.includes("You are not following this user")?ie__default.createElement(Kj,{pageId:e,componentId:o}):g?ie__default.createElement(yp,null):!u&&l.length===0?ie__default.createElement(QI,{pageId:e,componentId:o}):l.map(y=>ie__default.createElement(V,{key:y.postId,className:ia.userFeed__postContent,onPress:()=>{var b;return (b=n==null?void 0:n.goToPostDetailPage)==null?void 0:b.call(n,{postId:y.postId})}},ie__default.createElement(en,{category:"general",pageId:e,key:y.postId,post:y,style:"feed",onClick:()=>{var b;return (b=n==null?void 0:n.goToPostDetailPage)==null?void 0:b.call(n,{postId:y.postId})}})));return ie__default.createElement("div",{"data-testid":a,style:s},ie__default.createElement(wr,{page:"feed",refresh:d},ie__default.createElement("div",{className:ia.userFeed__container},C(),u&&ie__default.createElement(che,null),m&&ie__default.createElement("div",{ref:y=>i(y),className:ia.userFeed__observerTarget}))))};var Xj={emptyUserImageFeed__icon:"V3"};var uhe=t=>{var e=d(t,[]);return ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 61 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M18.6875 23.5C15.8398 23.5 13.625 21.2852 13.625 18.4375C13.625 15.6953 15.8398 13.375 18.6875 13.375C21.4297 13.375 23.75 15.6953 23.75 18.4375C23.75 21.2852 21.4297 23.5 18.6875 23.5ZM18.6875 16.75C17.7383 16.75 17 17.5938 17 18.4375C17 19.3867 17.7383 20.125 18.6875 20.125C19.5312 20.125 20.375 19.3867 20.375 18.4375C20.375 17.5938 19.5312 16.75 18.6875 16.75ZM50.75 6.625C52.543 6.625 54.125 8.20703 54.125 10V50.5C54.125 52.3984 52.543 53.875 50.75 53.875H10.25C8.35156 53.875 6.875 52.3984 6.875 50.5V10C6.875 8.20703 8.35156 6.625 10.25 6.625H50.75ZM50.75 50.5V42.0625H10.25V50.5H50.75ZM15.8398 38.6875H24.2773L25.543 37L21.3242 31.4102L15.8398 38.6875ZM28.4961 38.6875H44.5273L36.5117 28.0352L28.4961 38.6875ZM50.75 38.6875V10H10.25V38.6875H11.6211L19.9531 27.6133C20.5859 26.7695 21.957 26.7695 22.6953 27.6133L27.6523 34.2578L35.1406 24.2383C35.7734 23.3945 37.1445 23.3945 37.8828 24.2383L48.7461 38.6875H50.75Z"}))},eG=uhe;var oG=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"empty_user_image_feed",defaultIcon:()=>ie__default.createElement(eG,{className:Xj.emptyUserImageFeed__icon})});var rG={privateUserImageFeed__icon:"W3"};var JI=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"private_user_image_feed",infoElementId:"private_user_image_feed_info",defaultIcon:()=>ie__default.createElement(f0,{className:rG.privateUserImageFeed__icon})});var nG={blockedUserImageFeed__icon:"q3"};var XI=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"blocked_user_image_feed",infoElementId:"blocked_user_image_feed_info",defaultIcon:()=>ie__default.createElement(Al,{className:nG.blockedUserImageFeed__icon})});var RI={userImageFeed__container:"Ws",userImageFeed__loadingIndicator:"D3",userImageFeed__observerTarget:"G3",userImageFeed__spinner:"J3",spin:"qs",userImageFeed__postContent:"K3",userImageFeed_postSkeleton__post:"N3",userImageFeed_postSkeleton__post__header:"O3",userImageFeed_postSkeleton__post__avatar:"Ds",userImageFeed_postSkeleton__post__headerText_wrap:"P3",userImageFeed_postSkeleton__post__displayName:"Gs",userImageFeed_postSkeleton__post__timestamp:"Js",userImageFeed_postSkeleton__post__content:"D",pulse:"Ks"};var b9=({pageId:e="*",userId:t})=>{let o="user_image_feed",[r,i]=useState(null),{accessibilityId:n,themeStyles:a}=se({pageId:e,componentId:o}),{posts:s,hasMore:l,loadMore:m,refresh:c,error:d,isLoading:u}=Ao({targetId:t,targetType:"user",limit:10,dataTypes:["image"]}),{followStatus:g}=Bi(t);return ke({onIntersect:()=>{u===!1&&m();},node:r,options:{threshold:.7}}),useEffect(()=>{c();},[]),ie__default.createElement("div",{"data-testid":n,style:a},ie__default.createElement(wr,{page:"feed",refresh:c},ie__default.createElement(ie__default.Fragment,null,g==="blocked"?ie__default.createElement(XI,{pageId:e,componentId:o}):d?d.message.includes("You are not following this user")?ie__default.createElement(JI,{pageId:e,componentId:o}):ie__default.createElement(yp,null):!u&&s.length===0?ie__default.createElement(oG,{pageId:e,componentId:o}):ie__default.createElement("div",{className:RI.userImageFeed__container},ie__default.createElement(yf,{posts:s})),l&&ie__default.createElement("div",{ref:C=>i(C),className:RI.userImageFeed__observerTarget}))))};var sG={emptyUserVideoFeed__icon:"Q3"};var _he=t=>{var e=d(t,[]);return ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 60 61",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M53.5195 20.625C55.3125 20.625 57 21.9961 57 24V51.1055C57 53.0039 55.3125 54.375 53.5195 54.375C52.9922 54.375 52.1484 54.1641 51.6211 53.8477L43.5 48.1523V49.3125C43.5 52.1602 41.1797 54.375 38.4375 54.375H8.0625C5.21484 54.375 3 52.1602 3 49.3125V25.6875C3 22.9453 5.21484 20.625 8.0625 20.625H9.75V15.5625C9.75 10.9219 13.4414 7.125 18.1875 7.125H35.9062C36.3281 7.125 36.75 7.54688 36.75 7.96875V9.65625C36.75 10.1836 36.3281 10.5 35.9062 10.5H18.1875C15.3398 10.5 13.125 12.8203 13.125 15.5625V20.625H38.4375C41.1797 20.625 43.5 22.9453 43.5 25.6875V26.9531L51.6211 21.2578C52.1484 20.9414 52.9922 20.7305 53.5195 20.625V24L43.5 31.0664V44.0391L53.5195 51L53.625 24L53.5195 20.625ZM40.125 49.3125V25.6875C40.125 24.8438 39.2812 24 38.4375 24H8.0625C7.11328 24 6.375 24.8438 6.375 25.6875V49.3125C6.375 50.2617 7.11328 51 8.0625 51H38.4375C39.2812 51 40.125 50.2617 40.125 49.3125ZM36.0117 27.375C36.4336 27.4805 36.6445 27.6914 36.75 28.1133V30.1172C36.6445 30.5391 36.4336 30.75 36.0117 30.75H10.3828C9.96094 30.75 9.75 30.5391 9.75 30.1172V28.1133C9.75 27.6914 9.96094 27.4805 10.3828 27.375H36.0117Z"}))},mG=_he;var cG=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"empty_user_video_feed",defaultIcon:()=>ie__default.createElement(mG,{className:sG.emptyUserVideoFeed__icon})});var pG={privateUserVideoFeed__icon:"Z3"};var ew=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"private_user_video_feed",infoElementId:"private_user_video_feed_info",defaultIcon:()=>ie__default.createElement(f0,{className:pG.privateUserVideoFeed__icon})});var gG={blockedUserVideoFeed__icon:"_3"};var tw=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"blocked_user_image_feed",infoElementId:"blocked_user_image_feed_info",defaultIcon:()=>ie__default.createElement(Al,{className:gG.blockedUserVideoFeed__icon})});var Lf={userVideoFeed__container:"Ns",userVideoFeed__observerTarget:"ej",userVideoFeed__videoFeedTabs:"Os",userVideoFeed__tabsButton:"Ps",userVideoFeed__tabsButtonlabel:"Qs"};var x9=({pageId:e="*",userId:t})=>{let o="user_video_feed",[r,i]=useState(null),[n,a]=useState(null),[s,l]=useState("videos"),{followStatus:m}=Bi(t),{accessibilityId:c,themeStyles:d}=se({pageId:e,componentId:o}),{posts:u,hasMore:g,loadMore:f,refresh:C,error:y,isLoading:b}=Ao({targetId:t,targetType:"user",limit:10,dataTypes:["video"]}),{posts:_,hasMore:x,loadMore:P,refresh:I,error:w,isLoading:M}=Ao({targetId:t,targetType:"user",limit:10,dataTypes:["clip"]});ke({onIntersect:()=>{b===!1&&f();},node:r,options:{threshold:.7}}),ke({onIntersect:()=>{M===!1&&P();},node:n,options:{threshold:.7}}),useEffect(()=>{C(),I();},[]);let T=[{type:"videos",elementId:"videos_button"},{type:"clips",elementId:"clips_button"}],E=()=>ie__default.createElement("div",{className:Lf.userVideoFeed__videoFeedTabs},T.map(D=>ie__default.createElement(bf,{key:D.type,pageId:e,componentId:o,elementId:D.elementId,tab:D,activeTab:s,setActiveTab:l}))),N=(D,G,H)=>m==="blocked"?ie__default.createElement(tw,{pageId:e,componentId:o}):H?H.message.includes("You are not following this user")?ie__default.createElement(ew,{pageId:e,componentId:o}):ie__default.createElement(yp,null):s==="videos"&&!G&&D.length===0?ie__default.createElement(cG,{pageId:e,componentId:o}):s==="clips"&&!M&&_.length===0?ie__default.createElement(Pf,{pageId:e,componentId:o}):ie__default.createElement("div",{className:Lf.userVideoFeed__container},s==="videos"?ie__default.createElement(_f,{posts:D}):ie__default.createElement(a9,{posts:D})),A=()=>s==="videos"?ie__default.createElement(ie__default.Fragment,null,N(u,b,y),g&&ie__default.createElement("div",{ref:D=>i(D),className:Lf.userVideoFeed__observerTarget})):ie__default.createElement(ie__default.Fragment,null,N(_,M,w),x&&ie__default.createElement("div",{ref:D=>a(D),className:Lf.userVideoFeed__observerTarget}));return ie__default.createElement("div",{"data-testid":c,style:d},ie__default.createElement(wr,{page:"feed",refresh:C},ie__default.createElement(ie__default.Fragment,null,E(),A())))};var P9={categoryChip:"or",categoryChip__image:"rj",categoryChip__text:"aj"};var rw={categoryImage__placeHolderRect:"oj",categoryImage__placeHolderPath:"tj"};var Mhe=({className:e})=>ie__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",className:e},ie__default.createElement("rect",{width:"28",height:"28",rx:"14",className:rw.categoryImage__placeHolderRect}),ie__default.createElement("path",{d:"M19.6 14.7C19.6 14.3281 19.2719 14 18.9 14H15.4C15.0063 14 14.7 14.3281 14.7 14.7V18.2C14.7 18.5938 15.0063 18.9 15.4 18.9H18.9C19.2719 18.9 19.6 18.5938 19.6 18.2V14.7ZM9.8 13.3C8.24688 13.3 7 14.5688 7 16.1C7 17.6531 8.24688 18.9 9.8 18.9C11.3313 18.9 12.6 17.6531 12.6 16.1C12.6 14.5688 11.3313 13.3 9.8 13.3ZM18.8781 11.9C19.425 11.9 19.775 11.3313 19.4906 10.85L17.4125 7.35002C17.1281 6.89065 16.45 6.89065 16.1656 7.35002L14.0875 10.85C13.8031 11.3313 14.1531 11.9 14.7 11.9H18.8781Z",className:rw.categoryImage__placeHolderPath})),Df=({imgSrc:e,pageId:t="*",componentId:o="*",elementId:r="*",className:i})=>{let{themeStyles:n}=S({pageId:t,componentId:o,elementId:r});return ie__default.createElement(Du,{style:n,className:i,src:e,fallBackRenderer:()=>ie__default.createElement(Mhe,{className:i})})};var yG=({pageId:e="*",componentId:t="*",category:o,onClick:r})=>{var m;let i="category_chip",{isExcluded:n,accessibilityId:a,themeStyles:s}=S({pageId:e,componentId:t,elementId:i}),l=rt({fileId:(m=o.avatar)==null?void 0:m.fileId});return n?null:ie__default.createElement(V,{"data-testid":a,style:s,className:P9.categoryChip,onPress:()=>r==null?void 0:r(o.categoryId)},ie__default.createElement(Df,{imgSrc:l,className:P9.categoryChip__image,pageId:e,componentId:t,elementId:i}),ie__default.createElement(v.BodyBold,{className:P9.categoryChip__text},o.name))};var hG={exploreCategories__categoryChipSkeleton:"ij","skeleton-pulse":"Zs"};var CG=()=>ie__default.createElement("div",{className:hG.exploreCategories__categoryChipSkeleton});var Ul={exploreCommunityCategories:"_s",exploreCommunityCategories__carousel:"sj",exploreCommunityCategories__seeMore:"tr",exploreCommunityCategories__seeMoreIcon:"dj",exploreCommunityCategories__arrow:"ed",exploreCommunityCategories__arrowIcon:"cj",left:"rd",right:"ad"};var I9=({pageId:e="*"})=>{let t="explore_community_categories",{categories:o,isCategoryLoading:r,fetchCommunityCategories:i}=fl(),{goToAllCategoriesPage:n,goToCommunitiesByCategoryPage:a}=Y(),{accessibilityId:s,themeStyles:l}=se({pageId:e,componentId:t});return useEffect(()=>{i();},[]),ie__default.createElement(ku,{scrollOffset:300,isHidden:r||o.length<=3,className:Ul.exploreCommunityCategories__carousel,iconClassName:Ul.exploreCommunityCategories__arrowIcon,leftArrowClassName:wl(Ul.exploreCommunityCategories__arrow,Ul.left),rightArrowClassName:wl(Ul.exploreCommunityCategories__arrow,Ul.right)},ie__default.createElement("div",{style:l,"data-testid":s,className:Ul.exploreCommunityCategories},r?Array.from({length:6}).map((m,c)=>ie__default.createElement(CG,{key:c})):ie__default.createElement(Fragment,null,o.slice(0,5).map(m=>ie__default.createElement(yG,{pageId:e,category:m,key:m.categoryId,onClick:c=>a({categoryId:c})})),o.length>=5&&ie__default.createElement(V,{onPress:()=>n(),className:wl(Ul.exploreCommunityCategories__seeMore)},ie__default.createElement(v.BodyBold,null,"See more"),ie__default.createElement(wo,{className:Ul.exploreCommunityCategories__seeMoreIcon})))))};var vG=e=>ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"64",height:"39",viewBox:"0 0 64 39",fill:"none"},e),ie__default.createElement("path",{d:"M32 0.590942C34.4754 0.590942 36.8493 1.5527 38.5997 3.26463C40.35 4.97656 41.3333 7.29843 41.3333 9.71947C41.3333 12.1405 40.35 14.4624 38.5997 16.1743C36.8493 17.8862 34.4754 18.848 32 18.848C29.5246 18.848 27.1507 17.8862 25.4003 16.1743C23.65 14.4624 22.6667 12.1405 22.6667 9.71947C22.6667 7.29843 23.65 4.97656 25.4003 3.26463C27.1507 1.5527 29.5246 0.590942 32 0.590942ZM13.3333 7.11132C14.8267 7.11132 16.2133 7.50254 17.4133 8.20674C17.0133 11.9364 18.1333 15.64 20.4267 18.535C19.0933 21.0388 16.4267 22.7602 13.3333 22.7602C11.2116 22.7602 9.17677 21.9359 7.67648 20.4685C6.17619 19.0011 5.33333 17.0109 5.33333 14.9358C5.33333 12.8606 6.17619 10.8704 7.67648 9.40305C9.17677 7.93568 11.2116 7.11132 13.3333 7.11132ZM50.6667 7.11132C52.7884 7.11132 54.8232 7.93568 56.3235 9.40305C57.8238 10.8704 58.6667 12.8606 58.6667 14.9358C58.6667 17.0109 57.8238 19.0011 56.3235 20.4685C54.8232 21.9359 52.7884 22.7602 50.6667 22.7602C47.5733 22.7602 44.9067 21.0388 43.5733 18.535C45.8667 15.64 46.9867 11.9364 46.5867 8.20674C47.7867 7.50254 49.1733 7.11132 50.6667 7.11132ZM14.6667 33.8449C14.6667 28.446 22.4267 24.0643 32 24.0643C41.5733 24.0643 49.3333 28.446 49.3333 33.8449V38.4091H14.6667V33.8449ZM0 38.4091V34.4969C0 30.8716 5.04 27.82 11.8667 26.9333C10.2933 28.7068 9.33333 31.1585 9.33333 33.8449V38.4091H0ZM64 38.4091H54.6667V33.8449C54.6667 31.1585 53.7067 28.7068 52.1333 26.9333C58.96 27.82 64 30.8716 64 34.4969V38.4091Z",fill:"url(#paint0_linear_7891_25129)"}),ie__default.createElement("defs",null,ie__default.createElement("linearGradient",{id:"paint0_linear_7891_25129",x1:"32",y1:"0.590942",x2:"32",y2:"38.4091",gradientUnits:"userSpaceOnUse"},ie__default.createElement("stop",{stopColor:"white"}),ie__default.createElement("stop",{offset:"1",stopColor:"white"}))));var w9={communityCardImage:"lj",communityCardImage__placeholderImage:"nj",communityCardImage__placeholderImageIcon:"mj"};var aw=({imgSrc:e,className:t,pageId:o="*",componentId:r="*"})=>{let i="community_card_image",{themeStyles:n,accessibilityId:a}=S({pageId:o,componentId:r,elementId:i});return ie__default.createElement(Du,{src:e,style:n,"data-testid":a,alt:"Placeholder Community Cover",className:wl(w9.communityCardImage,t),fallBackRenderer:()=>ie__default.createElement(Lhe,{className:t})})},Lhe=({className:e})=>ie__default.createElement("div",{className:wl(w9.communityCardImage__placeholderImage,e)},ie__default.createElement(vG,{className:w9.communityCardImage__placeholderImageIcon}));var Fa={recommendedCommunityCardSkeleton:"hj",recommendedCommunityCardSkeleton__image:"gj",recommendedCommunityCardSkeleton__content:"pj",recommendedCommunityCardSkeleton__contentBar1:"bj",recommendedCommunityCardSkeleton__contentBar2:"uj",recommendedCommunityCardSkeleton__contentBar3:"fj",recommendedCommunityCardSkeleton__animation:"vj","skeleton-pulse":"od"};var bG=()=>ie__default.createElement("div",{className:Fa.recommendedCommunityCardSkeleton},ie__default.createElement("div",{className:wl(Fa.recommendedCommunityCardSkeleton__image,Fa.recommendedCommunityCardSkeleton__animation)}),ie__default.createElement("div",{className:wl(Fa.recommendedCommunityCardSkeleton__content,Fa.recommendedCommunityCardSkeleton__animation)},ie__default.createElement("div",{className:wl(Fa.recommendedCommunityCardSkeleton__contentBar1,Fa.recommendedCommunityCardSkeleton__animation)}),ie__default.createElement("div",{className:wl(Fa.recommendedCommunityCardSkeleton__contentBar2,Fa.recommendedCommunityCardSkeleton__animation)}),ie__default.createElement("div",{className:wl(Fa.recommendedCommunityCardSkeleton__contentBar3,Fa.recommendedCommunityCardSkeleton__animation)})));var Ei={recommendedCommunities:"wj",recommendedCommunityCard:"xj",recommendedCommunityCard__imageWrapper:"yj",recommendedCommunityCard__image:"kj",recommendedCommunityCard__content:"jj",recommendedCommunities__contentTitle:"zj",recommendedCommunityCard__communityName__private:"Xj",recommendedCommunityCard__bottom:"Yj",recommendedCommunityCard__content__left:"Ij",recommendedCommunityCard__category:"Aj",recommendedCommunities__content__right:"Mj",recommendedCommunityCard__arrowIcon:"ir",recommendedCommunityCard__arrow:"td",left:"id",right:"sd"};function M9(e){let[t,o]=useState();return useEffect(()=>{if(e.length===0)return;let r=CommunityRepository.getJoinRequestList({communityIds:e},({data:i})=>{o(i);});return ()=>r()},[JSON.stringify(e)]),{joinRequestList:t}}var jhe=({pageId:e,onClick:t,community:o,componentId:r,onCategoryClick:i,onJoinButtonClick:n,onLeaveButtonClick:a,isPendingJoin:s=!1})=>{let l=We({fileId:o.avatarFileId,imageSize:"medium"});return ie__default.createElement(V,{className:Ei.recommendedCommunityCard,onPress:()=>t(o.communityId)},ie__default.createElement("div",{className:Ei.recommendedCommunityCard__imageWrapper},ie__default.createElement(aw,{pageId:e,imgSrc:l,componentId:r,className:Ei.recommendedCommunityCard__image})),ie__default.createElement("div",{className:Ei.recommendedCommunityCard__content},ie__default.createElement("div",{className:Ei.recommendedCommunities__contentTitle},!o.isPublic&&ie__default.createElement(ar,{pageId:e,componentId:r}),ie__default.createElement(Mo,{pageId:e,componentId:r,community:o}),o.isOfficial&&ie__default.createElement(sr,{pageId:e,componentId:r})),ie__default.createElement("div",{className:Ei.recommendedCommunityCard__bottom},ie__default.createElement("div",{className:Ei.recommendedCommunityCard__content__left},ie__default.createElement(ed,{truncate:!0,pageId:e,community:o,maxCategoriesLength:2,componentId:r,onClick:i,className:Ei.recommendedCommunityCard__category}),ie__default.createElement(Vu,{pageId:e,componentId:r,memberCount:o.membersCount})),ie__default.createElement("div",{className:Ei.recommendedCommunities__content__right},o.isJoined&&s?ie__default.createElement(ry,{pageId:e,componentId:r,onClick:()=>a(o)}):ie__default.createElement(Uc,{pageId:e,componentId:r,onClick:()=>n(o)})))))},sw=({pageId:e="*"})=>{let t="recommended_communities",{accessibilityId:r,themeStyles:i}=se({pageId:e,componentId:t}),{online:n}=useNetworkState(),a=ce(),{goToCommunitiesByCategoryPage:s,goToCommunityProfilePage:l$1}=Y(),{recommendedCommunities:m,isLoading:c,fetchRecommendedCommunities:d,refetchRecommendedCommunities:u,pendingJoinCommunities:g,setPendingJoinCommunity:f}=fl(),C=m.map(w=>w.communityId).filter(w=>!g.includes(w)),{joinRequestList:y}=M9(C),b=y?m.filter(w=>!y.some(M=>M.targetId===w.communityId&&M.status==="pending")&&!g.includes(w.communityId)):m.filter(w=>!g.includes(w.communityId));useEffect(()=>{d();},[]);let{joinCommunity:_,leaveCommunity:x}=td({onJoinSuccess:({data:w,communityId:M})=>{(w==null?void 0:w.status)==="pending"&&M&&f(M),u();}}),P=w=>l(void 0,null,function*(){if(!n){a.info({content:"Failed to join community. Please try again."});return}_(w);}),I=w=>{if(!n){a.info({content:"Failed to leave community. Please try again."});return}x(w);};return ie__default.createElement(ku,{scrollOffset:400,iconClassName:Ei.recommendedCommunityCard__arrowIcon,isHidden:c||b.length<3,leftArrowClassName:wl(Ei.recommendedCommunityCard__arrow,Ei.left),rightArrowClassName:wl(Ei.recommendedCommunityCard__arrow,Ei.right)},ie__default.createElement("div",{style:i,"data-testid":r,className:Ei.recommendedCommunities},c?Array.from({length:4}).map((w,M)=>ie__default.createElement(bG,{key:M})):b.length===0?null:b.slice(0,4).map(w=>ie__default.createElement(jhe,{pageId:e,community:w,componentId:t,key:w.communityId,isPendingJoin:(y==null?void 0:y.some(M=>M.targetId===w.communityId&&M.status==="pending"))||g.includes(w.communityId),onJoinButtonClick:M=>P(M),onLeaveButtonClick:M=>I(M),onClick:M=>l$1(M),onCategoryClick:M=>s({categoryId:M})}))))};var lw={trendingCommunities:"Sj"};var mw=({pageId:e="*"})=>{let t="trending_communities",{accessibilityId:o,themeStyles:r}=se({pageId:e,componentId:t}),{trendingCommunities:i,isLoading:n,fetchTrendingCommunities:a$1,pendingJoinCommunities:s}=fl(),{goToCommunitiesByCategoryPage:l,goToCommunityProfilePage:m}=Y(),c=i.map(u=>u.communityId),{joinRequestList:d}=M9(c);return useEffect(()=>{a$1();},[]),n?ie__default.createElement("div",{style:r,"data-testid":o,className:lw.trendingCommunities},Array.from({length:5}).map((u,g)=>ie__default.createElement(Uu,{key:g}))):i.length===0?null:ie__default.createElement("div",{style:r,"data-testid":o,className:lw.trendingCommunities},i.map((u,g)=>{let f=d==null?void 0:d.find(b=>b.targetId===u.communityId),C=s.includes(u.communityId),y=f;return C&&f&&(y=b(a({},f),{status:JoinRequestStatusEnum.Pending})),ie__default.createElement(Hc,{showJoinButton:!0,pageId:e,order:g+1,community:u,maxCategoriesLength:2,minCategoryCharacters:3,componentId:t,maxCategoryCharacters:36,key:u.communityId,onClick:b=>m(b),onCategoryClick:b=>l({categoryId:b}),joinRequest:y})}))};var na={explore:"dd",explore__recommendedForYou:"fe",explore__trendingNow:"cd",explore__trendingTitleSkeleton:"ld","skeleton-pulse":"nd",explore__recommendedForYouTitle:"Cj",explore__exploreCategories:"sr",explore__divider:"md"};var dw={exploreError:"Ej",exploreError__text:"Rj"};var Yhe=()=>ie__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"62",height:"42",viewBox:"0 0 62 42",fill:"none"},ie__default.createElement("path",{d:"M58.7773 0.841919C60.1484 0.841919 61.3086 2.00208 61.3086 3.37317V38.8107C61.3086 40.2872 60.1484 41.3419 58.7773 41.3419H5.62109C2.77344 41.3419 0.558594 39.1271 0.558594 36.2794V6.74817C0.558594 5.37708 1.61328 4.21692 3.08984 4.21692H7.30859V3.37317C7.30859 2.00208 8.36328 0.841919 9.83984 0.841919H58.7773ZM3.93359 36.2794C3.93359 37.2286 4.67188 37.9669 5.62109 37.9669C6.46484 37.9669 7.30859 37.2286 7.30859 36.2794V7.59192H3.93359V36.2794ZM57.9336 37.9669V4.21692H10.6836V36.2794V36.3849C10.6836 36.8068 10.4727 37.545 10.3672 37.9669H57.9336Z",fill:"#EBECEF"})),PG=()=>ie__default.createElement("div",{className:dw.exploreError},ie__default.createElement(Yhe,null),ie__default.createElement("div",{className:dw.exploreError__text},ie__default.createElement(v.TitleBold,null,"Something went wrong"),ie__default.createElement(v.Caption,null,"Please try again.")));function N9({onClick:e,pageId:t="*",componentId:o="*"}){let r="explore_create_community",{accessibilityId:i,config:n,isExcluded:a,themeStyles:s}=S({pageId:t,componentId:o,elementId:r});return a?null:ie__default.createElement(oe,{size:"medium",variant:"fill",color:"primary",icon:ie__default.createElement(br,null),onPress:e,style:s,"data-testid":i},n.text)}var Qhe=()=>ie__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"161",height:"161",viewBox:"0 0 161 161",fill:"none"},ie__default.createElement("path",{d:"M130.1 24.5H34.0996C29.6813 24.5 26.0996 28.0817 26.0996 32.5V128.5C26.0996 132.918 29.6813 136.5 34.0996 136.5H130.1C134.518 136.5 138.1 132.918 138.1 128.5V32.5C138.1 28.0817 134.518 24.5 130.1 24.5Z",fill:"#292B32"}),ie__default.createElement("path",{d:"M43.7002 68.2H44.2002H151.7C152.628 68.2 153.519 68.5688 154.175 69.2251C154.831 69.8815 155.2 70.7718 155.2 71.7V91.7C155.2 92.6283 154.831 93.5185 154.175 94.1749C153.519 94.8313 152.628 95.2 151.7 95.2H43.7002C42.7719 95.2 41.8817 94.8313 41.2253 94.1749C40.5689 93.5185 40.2002 92.6283 40.2002 91.7V71.7C40.2002 70.7718 40.5689 69.8815 41.2253 69.2251C41.8817 68.5688 42.7719 68.2 43.7002 68.2Z",fill:"#292B32",stroke:"#40434E"}),ie__default.createElement("path",{opacity:"0.3",d:"M90.9002 74.1H70.1002C68.7747 74.1 67.7002 75.1745 67.7002 76.5C67.7002 77.8255 68.7747 78.9 70.1002 78.9H90.9002C92.2257 78.9 93.3002 77.8255 93.3002 76.5C93.3002 75.1745 92.2257 74.1 90.9002 74.1Z",fill:"#40434E"}),ie__default.createElement("path",{opacity:"0.15",d:"M105.3 84.5H70.1002C68.7747 84.5 67.7002 85.5745 67.7002 86.9C67.7002 88.2255 68.7747 89.3 70.1002 89.3H105.3C106.626 89.3 107.7 88.2255 107.7 86.9C107.7 85.5745 106.626 84.5 105.3 84.5Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M53.6996 89.3C57.897 89.3 61.2996 85.8974 61.2996 81.7C61.2996 77.5027 57.897 74.1 53.6996 74.1C49.5022 74.1 46.0996 77.5027 46.0996 81.7C46.0996 85.8974 49.5022 89.3 53.6996 89.3Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M9.2998 102.6H9.7998H117.3C118.228 102.6 119.118 102.969 119.775 103.625C120.431 104.282 120.8 105.172 120.8 106.1V126.1C120.8 127.028 120.431 127.919 119.775 128.575C119.118 129.231 118.228 129.6 117.3 129.6H9.2998C8.37155 129.6 7.48131 129.231 6.82493 128.575C6.16855 127.919 5.7998 127.028 5.7998 126.1V106.1C5.7998 105.172 6.16855 104.282 6.82493 103.625C7.48131 102.969 8.37155 102.6 9.2998 102.6Z",fill:"#292B32",stroke:"#40434E"}),ie__default.createElement("path",{opacity:"0.3",d:"M56.4998 108.5H35.6998C34.3743 108.5 33.2998 109.575 33.2998 110.9C33.2998 112.225 34.3743 113.3 35.6998 113.3H56.4998C57.8253 113.3 58.8998 112.225 58.8998 110.9C58.8998 109.575 57.8253 108.5 56.4998 108.5Z",fill:"#40434E"}),ie__default.createElement("path",{opacity:"0.15",d:"M70.8998 118.9H35.6998C34.3743 118.9 33.2998 119.975 33.2998 121.3C33.2998 122.626 34.3743 123.7 35.6998 123.7H70.8998C72.2253 123.7 73.2998 122.626 73.2998 121.3C73.2998 119.975 72.2253 118.9 70.8998 118.9Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M19.3002 123.7C23.4976 123.7 26.9002 120.297 26.9002 116.1C26.9002 111.903 23.4976 108.5 19.3002 108.5C15.1028 108.5 11.7002 111.903 11.7002 116.1C11.7002 120.297 15.1028 123.7 19.3002 123.7Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M9.2998 33.8H117.3C119.233 33.8 120.8 35.367 120.8 37.3V57.3C120.8 59.233 119.233 60.8 117.3 60.8H9.2998C7.36681 60.8 5.7998 59.233 5.7998 57.3V37.3C5.7998 35.367 7.36681 33.8 9.2998 33.8Z",fill:"#292B32",stroke:"#40434E"}),ie__default.createElement("path",{opacity:"0.3",d:"M54.8992 39.7H34.0992C32.7737 39.7 31.6992 40.7745 31.6992 42.1C31.6992 43.4255 32.7737 44.5 34.0992 44.5H54.8992C56.2247 44.5 57.2992 43.4255 57.2992 42.1C57.2992 40.7745 56.2247 39.7 54.8992 39.7Z",fill:"#40434E"}),ie__default.createElement("path",{opacity:"0.15",d:"M69.2992 50.1H34.0992C32.7737 50.1 31.6992 51.1745 31.6992 52.5C31.6992 53.8255 32.7737 54.9 34.0992 54.9H69.2992C70.6247 54.9 71.6992 53.8255 71.6992 52.5C71.6992 51.1745 70.6247 50.1 69.2992 50.1Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M19.3002 54.9C23.4976 54.9 26.9002 51.4974 26.9002 47.3C26.9002 43.1026 23.4976 39.7 19.3002 39.7C15.1028 39.7 11.7002 43.1026 11.7002 47.3C11.7002 51.4974 15.1028 54.9 19.3002 54.9Z",fill:"#40434E"})),Khe=()=>ie__default.createElement("svg",{width:"160",height:"160",viewBox:"0 0 160 160",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ie__default.createElement("path",{d:"M129.6 24H33.6C29.1817 24 25.6 27.5817 25.6 32V128C25.6 132.418 29.1817 136 33.6 136H129.6C134.018 136 137.6 132.418 137.6 128V32C137.6 27.5817 134.018 24 129.6 24Z",fill:"#EBECEF"}),ie__default.createElement("path",{d:"M43.2 67.7002H43.7H151.2C152.128 67.7002 153.019 68.0689 153.675 68.7253C154.331 69.3817 154.7 70.2719 154.7 71.2002V91.2002C154.7 92.1285 154.331 93.0187 153.675 93.6751C153.019 94.3314 152.128 94.7002 151.2 94.7002H43.2C42.2718 94.7002 41.3815 94.3314 40.7251 93.6751C40.0688 93.0187 39.7 92.1285 39.7 91.2002V71.2002C39.7 70.2719 40.0688 69.3817 40.7251 68.7253C41.3815 68.0689 42.2718 67.7002 43.2 67.7002Z",fill:"white",stroke:"#EBECEF"}),ie__default.createElement("path",{opacity:"0.3",d:"M90.4 73.6001H69.6C68.2745 73.6001 67.2 74.6746 67.2 76.0001C67.2 77.3256 68.2745 78.4001 69.6 78.4001H90.4C91.7255 78.4001 92.8 77.3256 92.8 76.0001C92.8 74.6746 91.7255 73.6001 90.4 73.6001Z",fill:"#A5A9B5"}),ie__default.createElement("path",{opacity:"0.15",d:"M104.8 84H69.6C68.2745 84 67.2 85.0745 67.2 86.4C67.2 87.7255 68.2745 88.8 69.6 88.8H104.8C106.125 88.8 107.2 87.7255 107.2 86.4C107.2 85.0745 106.125 84 104.8 84Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M53.1999 88.8001C57.3973 88.8001 60.7999 85.3975 60.7999 81.2001C60.7999 77.0027 57.3973 73.6001 53.1999 73.6001C49.0025 73.6001 45.5999 77.0027 45.5999 81.2001C45.5999 85.3975 49.0025 88.8001 53.1999 88.8001Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M8.8 102.1H9.3H116.8C117.728 102.1 118.618 102.469 119.275 103.125C119.931 103.782 120.3 104.672 120.3 105.6V125.6C120.3 126.528 119.931 127.419 119.275 128.075C118.618 128.731 117.728 129.1 116.8 129.1H8.8C7.87175 129.1 6.98151 128.731 6.32513 128.075C5.66875 127.419 5.3 126.528 5.3 125.6V105.6C5.3 104.672 5.66875 103.782 6.32513 103.125C6.98151 102.469 7.87175 102.1 8.8 102.1Z",fill:"white",stroke:"#EBECEF"}),ie__default.createElement("path",{opacity:"0.3",d:"M56 108H35.2C33.8745 108 32.8 109.075 32.8 110.4C32.8 111.725 33.8745 112.8 35.2 112.8H56C57.3255 112.8 58.4 111.725 58.4 110.4C58.4 109.075 57.3255 108 56 108Z",fill:"#A5A9B5"}),ie__default.createElement("path",{opacity:"0.15",d:"M70.4 118.4H35.2C33.8745 118.4 32.8 119.474 32.8 120.8C32.8 122.125 33.8745 123.2 35.2 123.2H70.4C71.7255 123.2 72.8 122.125 72.8 120.8C72.8 119.474 71.7255 118.4 70.4 118.4Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M18.8 123.2C22.9974 123.2 26.4 119.797 26.4 115.6C26.4 111.403 22.9974 108 18.8 108C14.6026 108 11.2 111.403 11.2 115.6C11.2 119.797 14.6026 123.2 18.8 123.2Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M8.8 33.2998H116.8C118.733 33.2998 120.3 34.8668 120.3 36.7998V56.7998C120.3 58.7328 118.733 60.2998 116.8 60.2998H8.8C6.86701 60.2998 5.3 58.7328 5.3 56.7998V36.7998C5.3 34.8668 6.86701 33.2998 8.8 33.2998Z",fill:"white",stroke:"#EBECEF"}),ie__default.createElement("path",{opacity:"0.3",d:"M54.3999 39.1997H33.5999C32.2744 39.1997 31.1999 40.2742 31.1999 41.5997C31.1999 42.9252 32.2744 43.9997 33.5999 43.9997H54.3999C55.7254 43.9997 56.7999 42.9252 56.7999 41.5997C56.7999 40.2742 55.7254 39.1997 54.3999 39.1997Z",fill:"#A5A9B5"}),ie__default.createElement("path",{opacity:"0.15",d:"M68.7999 49.5996H33.5999C32.2744 49.5996 31.1999 50.6741 31.1999 51.9996C31.1999 53.3251 32.2744 54.3996 33.5999 54.3996H68.7999C70.1254 54.3996 71.1999 53.3251 71.1999 51.9996C71.1999 50.6741 70.1254 49.5996 68.7999 49.5996Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M18.8001 54.3997C22.9975 54.3997 26.4001 50.9971 26.4001 46.7997C26.4001 42.6023 22.9975 39.1997 18.8001 39.1997C14.6027 39.1997 11.2001 42.6023 11.2001 46.7997C11.2001 50.9971 14.6027 54.3997 18.8001 54.3997Z",fill:"#A5A9B5"})),Uf=({pageId:e="*",componentId:t="*"})=>{let o="explore_empty_image",{currentTheme:r,accessibilityId:i,config:n,defaultConfig:a,isExcluded:s,uiReference:l,themeStyles:m}=S({pageId:e,componentId:t,elementId:o});return s?null:ie__default.createElement(Z,{defaultIconName:a.icon,configIconName:n.icon,imgIcon:()=>ie__default.createElement("img",{style:m,src:n.icon,alt:l,"data-testid":i}),defaultIcon:()=>ie__default.createElement("div",{"data-testid":i,style:m},r==="light"?ie__default.createElement(Khe,null):ie__default.createElement(Qhe,null))})};var cw={exploreEmpty:"hd",exploreEmpty__text:"Uj"};function pw({pageId:e="*"}){let t="explore_empty",{goToCreateCommunityPage:o}=Y(),{themeStyles:r,accessibilityId:i}=se({componentId:t,pageId:e});return ie__default.createElement("div",{className:cw.exploreEmpty,style:r,"data-testid":i},ie__default.createElement(Uf,{pageId:e,componentId:t}),ie__default.createElement("div",{className:cw.exploreEmpty__text},ie__default.createElement(xt,{pageId:e,componentId:t}),ie__default.createElement(Qc,{pageId:e,componentId:t})),ie__default.createElement(N9,{pageId:e,componentId:t,onClick:()=>o==null?void 0:o({mode:"create"})}))}var uw={exploreCommunityEmpty:"gd",exploreCommunityEmpty__text:"Bj"};function gw({pageId:e="*"}){let t="explore_community_empty",{goToCreateCommunityPage:o}=Y(),{themeStyles:r,accessibilityId:i}=se({componentId:t,pageId:e});return ie__default.createElement("div",{style:r,"data-testid":i,className:uw.exploreCommunityEmpty},ie__default.createElement(Uf,{pageId:e,componentId:t}),ie__default.createElement("div",{className:uw.exploreCommunityEmpty__text},ie__default.createElement(xt,{pageId:e,componentId:t}),ie__default.createElement(Qc,{pageId:e,componentId:t})),ie__default.createElement(N9,{pageId:e,componentId:t,onClick:()=>o==null?void 0:o({mode:"create"})}))}var wG={exploreTrendingTitle:"Fj"};function fw({pageId:e="*",componentId:t="*",titleClassName:o}){let r="explore_trending_title",{accessibilityId:i,config:n,isExcluded:a,themeStyles:s}=S({pageId:e,componentId:t,elementId:r});return a?null:ie__default.createElement(v.TitleBold,{className:wl(wG.exploreTrendingTitle,o),style:s,"data-testid":i},n.text)}var TG={exploreRecommendedTitle:"Hj"};function yw({pageId:e="*",componentId:t="*",titleClassName:o}){let r="explore_recommended_title",{accessibilityId:i,config:n,isExcluded:a,themeStyles:s}=S({pageId:e,componentId:t,elementId:r});return a?null:ie__default.createElement(v.TitleBold,{className:wl(TG.exploreRecommendedTitle,o),style:s,"data-testid":i},n.text)}function MG({pageId:e="*"}){let{refresh:t,isLoading:o,isEmpty:r,isCommunityEmpty:i,noRecommendedCommunities:n,noTrendingCommunities:a,error:s}=fl();return useEffect(()=>{t();},[]),s!=null?ie__default.createElement(PG,null):r?ie__default.createElement(Tl,{className:na.explore,onTouchEndCallback:t},ie__default.createElement(zr,null),ie__default.createElement(pw,{pageId:e})):i?ie__default.createElement(Tl,{className:na.explore,onTouchEndCallback:t},ie__default.createElement(zr,null),ie__default.createElement("div",{className:na.explore__exploreCategories},ie__default.createElement(I9,{pageId:e})),ie__default.createElement(zr,{className:na.explore__divider}),ie__default.createElement(gw,{pageId:e})):ie__default.createElement(Tl,{className:na.explore,onTouchEndCallback:t},ie__default.createElement(zr,null),ie__default.createElement("div",{className:na.explore__exploreCategories},ie__default.createElement(I9,{pageId:e})),ie__default.createElement(zr,{className:na.explore__divider}),n?null:ie__default.createElement("div",{className:na.explore__recommendedForYou,"data-is-loading":!!o},o?ie__default.createElement("div",{className:na.explore__trendingTitleSkeleton}):ie__default.createElement(yw,{pageId:e}),ie__default.createElement(sw,{pageId:e})),ie__default.createElement(zr,{className:na.explore__divider}),a?null:ie__default.createElement("div",{className:na.explore__trendingNow},o?ie__default.createElement("div",{className:na.explore__trendingTitleSkeleton}):ie__default.createElement(fw,{pageId:e}),ie__default.createElement(mw,{pageId:e})))}var k9=({pageId:e="*"})=>ie__default.createElement(GH,null,ie__default.createElement(MG,{pageId:e}));var _0={UNAVAILABLE:5e5};var NG=createContext({activeTab:"Newsfeed",setActiveTab:()=>{},liveStreamPlayer:null,setStreamPlayer:()=>{},acceptedInvitation:null,setAcceptedInvitation:()=>{},invitationNotificationTray:wI}),po=()=>{let e=useContext(NG);if(!e)throw new Error("useLayoutContext must be used within a LayoutProvider");return e},kG=({children:e})=>{let[t,o]=useState("Newsfeed"),[r,i]=useState(null),[n,a]=useState(null),s=Jz();return ie__default.createElement(NG.Provider,{value:{activeTab:t,setActiveTab:o,liveStreamPlayer:n,setStreamPlayer:a,acceptedInvitation:r,setAcceptedInvitation:i,invitationNotificationTray:s}},e)};var Om={invitationBanner:"pd",invitationBanner__inviter:"bd",invitationBanner__avatar:"Lj",invitationBanner__displayName:"Tj",invitationBanner__actions:"Vj",capitalize:"Wj"};function oj({community:e,pageId:t="*",removeInvitation:o,invitation:r}){var _,x;let i="invitation_banner",{onBack:n}=Y(),a=ce(),[s,l$1]=useState(!1),{setAcceptedInvitation:m,invitationNotificationTray:c}=po(),{accessibilityId:d,themeStyles:u}=se({pageId:t,componentId:i}),g=r||((_=ap(e))==null?void 0:_.invitation),{confirm:f}=Te(),C=()=>l(this,null,function*(){var P;try{yield g==null?void 0:g.accept(),yield CommunityRepository.getCommunityByIds([e.communityId]),a.success({content:`You joined ${(P=g==null?void 0:g.target)==null?void 0:P.displayName}.`}),g&&m(g),o==null||o();}catch(I){if(I.code===_0.UNAVAILABLE){a.info({content:"This invitation is no longer available."}),e.isPublic||e.isDiscoverable?o==null||o():n();return}a.info({content:"Failed to accept invitation. Please try again."});}finally{c.refresh();}}),y=()=>l(this,null,function*(){try{yield g==null?void 0:g.reject(),a.success({content:"Invitation declined."}),e.isPublic||e.isDiscoverable?o==null||o():n();}catch(P){if(P.code===_0.UNAVAILABLE){a.info({content:"This invitation is no longer available."}),e.isPublic||e.isDiscoverable?o==null||o():n();return}a.info({content:"Failed to decline invitation. Please try again."});}finally{c.refresh();}}),b=()=>l(this,null,function*(){if(e!=null&&e.requiresJoinApproval)return f({title:"Decline invitation?",content:"If you change your mind, you\u2019ll have to request to join again.",okText:"Decline",onOk:y});y();});return ie__default.createElement("div",{className:Om.invitationBanner,"data-testid":d,style:u},ie__default.createElement("div",{className:Om.invitationBanner__inviter,"data-truncate":s},ie__default.createElement("div",{className:Om.invitationBanner__avatar},ie__default.createElement(Ae,{userId:g==null?void 0:g.inviterUserPublicId,className:Om.invitationBanner__avatar,textPlaceholderClassName:Om.invitationBanner__avatar})),ie__default.createElement(v.BodyBold,{as:"p",className:Om.invitationBanner__displayName},ie__default.createElement(RE,{lines:3,onTruncate:l$1,ellipsis:ie__default.createElement(ie__default.Fragment,null,"... ",ie__default.createElement(v.BodyBold,{as:"span"},"invited you."))},ie__default.createElement("span",{className:Om.capitalize},(x=g==null?void 0:g.createdBy)==null?void 0:x.displayName)),!s&&ie__default.createElement(v.BodyBold,{as:"span"}," invited you."))),ie__default.createElement("div",{className:Om.invitationBanner__actions},ie__default.createElement(z1,{pageId:t,componentId:i,onPress:C}),ie__default.createElement(j1,{pageId:t,componentId:i,onPress:b})))}var b0={invitation:"qj",invitation__content:"Dj",invitation__user:"Gj",invitation__avatar:"Jj",invitation__actions:"Kj"};var BG=({onClose:e,invitation:t,pageId:o="*",componentId:r="*"})=>{let i=ce(),{AmityNotificationTrayPageBehavior:n}=we(),{setAcceptedInvitation:a,invitationNotificationTray:s}=po(),{confirm:l$1}=Te(),{community:m}=Ct({communityId:t.targetId}),c=()=>{var f;e==null||e(),localStorage.setItem(t.invitationId,t.invitationId),(f=n==null?void 0:n.goToCommunityProfilePage)==null||f.call(n,{communityId:t.targetId}),s.refresh();},d=()=>l(void 0,null,function*(){var f,C;try{e==null||e(),yield t.accept(),yield CommunityRepository.getCommunityByIds([t.targetId]),i.success({content:`You joined ${(f=t.target)==null?void 0:f.displayName}.`}),(C=n==null?void 0:n.goToCommunityProfilePage)==null||C.call(n,{communityId:t.targetId}),t&&a(t);}catch(y){if(y.code===_0.UNAVAILABLE)return i.info({content:"This invitation is no longer available."});i.info({content:"Failed to accept invitation. Please try again."});}finally{s.refresh();}}),u=()=>l(void 0,null,function*(){try{e==null||e(),yield t.reject(),i.success({content:"Invitation declined."});}catch(f){if(f.code===_0.UNAVAILABLE)return i.info({content:"This invitation is no longer available."});i.info({content:"Failed to decline invitation. Please try again."});}finally{s.refresh();}}),g=()=>{if(m!=null&&m.requiresJoinApproval)return e==null||e(),l$1({title:"Decline invitation?",content:"If you change your mind, you\u2019ll have to request to join again.",okText:"Decline",onOk:u});u();};return ie__default.createElement(V,{onPress:()=>c(),className:b0.invitation,"data-seen":!!localStorage.getItem(t.invitationId)},ie__default.createElement("div",{className:b0.invitation__content},ie__default.createElement("div",{className:b0.invitation__user},ie__default.createElement(Ae,{pageId:o,componentId:r,onPressAvatar:c,shouldRedirectToUserProfile:!1,className:b0.invitation__avatar,userId:t.inviterUserPublicId}),ie__default.createElement(Fb,{pageId:o,invitation:t,componentId:r})),ie__default.createElement(gi,{pageId:o,componentId:r,elementId:"invitation_date",timestamp:t.createdAt})),ie__default.createElement("div",{className:b0.invitation__actions},ie__default.createElement(z1,{pageId:o,onPress:d,componentId:r,elementId:"accept_invite_button"}),ie__default.createElement(j1,{pageId:o,onPress:g,componentId:r,elementId:"decline_invite_button"})))};var vw=({onClose:e,pageId:t="*",invitations:o})=>{let r="invitation_section",{accessibilityId:i,isExcluded:n,themeStyles:a}=se({pageId:t,componentId:r});return n?null:ie__default.createElement("div",{"data-testid":i,style:a},ie__default.createElement(Eb,{pageId:t,componentId:r}),o.slice(0,3).map(s=>ie__default.createElement(BG,{pageId:t,onClose:e,invitation:s,componentId:r,key:s.invitationId})))};var CCe=e=>{let[t,o]=useState([]);return useEffect(()=>{function r(){return l(this,null,function*(){if(e==null||e.length===0)return;let i=yield Promise.all(e.map(n=>l(this,null,function*(){return (yield CategoryRepository.getCategory(n)).data})));o(i);})}r();},[e]),t},EG=CCe;var vCe=({community:e})=>{let{currentUserId:t,userRoles:o,client:r}=Ye(),{moderators:i}=cm(e==null?void 0:e.communityId),n=i.find(m=>m.userId===t),a=o.find(m=>m==="global-admin")!=null,s=n!=null,l=(e==null?void 0:e.communityId)&&(r==null?void 0:r.hasPermission(w1.CreatePivillegedPostPermission).community(e==null?void 0:e.communityId))||(e==null?void 0:e.postSetting)!=="ONLY_ADMIN_CAN_POST";return {isModerator:s,canEdit:a||s,canReview:a||s,canCreatePost:!!l}},B9=vCe;var A9=e=>{let{onEditCommunity:t}=qt(),o=Lr(e),r=We({fileId:o==null?void 0:o.avatarFileId,imageSize:"medium"}),{posts:i}=as({targetType:"community",targetId:e,feedType:"reviewing"}),n=EG(o==null?void 0:o.categoryIds),{canReview:a,canEdit:s}=B9({community:o}),l=useMemo(()=>(i==null?void 0:i.length)||0,[i]);return {community:o,reviewingPosts:i,avatarFileUrl:r,communityCategories:n,pendingPostsCount:l,canEditCommunity:s,canReviewCommunityPosts:a,onEditCommunity:t,joinCommunity:()=>e&&CommunityRepository.joinCommunity(e),leaveCommunity:()=>e&&CommunityRepository.leaveCommunity(e),updateCommunity:g=>e&&CommunityRepository.updateCommunity(e,g),closeCommunity:()=>e&&CommunityRepository.deleteCommunity(e)}};var AG={roundedBackButton:"Nj"};var xCe=e=>ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"none",viewBox:"0 0 32 32"},e),ie__default.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"#000",fillOpacity:"0.5"}),ie__default.createElement("path",{fill:"currentColor",d:"M16.176 23.914c-.14.176-.422.176-.598 0L8.23 16.566a.405.405 0 010-.597l7.348-7.348c.176-.176.457-.176.598 0l.703.668c.176.176.176.457 0 .598l-5.45 5.449h12.024c.211 0 .422.21.422.422v.984c0 .246-.21.422-.422.422H11.43l5.449 5.484c.176.141.176.422 0 .598l-.703.668z"})),Hf=({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onPress:i})=>{let n="back_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:m,uiReference:c,themeStyles:d}=S({pageId:e,componentId:t,elementId:n});return m?null:ie__default.createElement(V,{style:d,className:AG.roundedBackButton,onPress:i},ie__default.createElement(Z,{"data-testid":a,defaultIcon:()=>ie__default.createElement(xCe,{className:o}),imgIcon:()=>ie__default.createElement("img",{src:s.icon,alt:c,className:r}),defaultIconName:l.icon,configIconName:s.icon}))};var Da={draftPageContainer:"ud",headerContainer:"Oj",storyWrapper:"fd",header:"Pj",topRightButtons:"Qj",mainContainer:"Zj",previewImage:"_j",footer:"ez",videoPreview:"rz",hyperLinkContainer:"az",playPauseButton:"oz",progressBar:"tz",progressFill:"iz",userInfo:"sz",name:"dz",description:"cz",storyPreview:"lz",addHyperlinkContainer:"vd"};var SCe=({targetId:e,targetType:t,mediaType:o,onDiscardCreateStory:r})=>{let{isDesktop:i}=le(),{openPopup:n,closePopup:a}=Se(),{setDrawerData:s,removeDrawerData:l$1}=tt(),{onBack:m,prevPage:c}=Y(),d="create_story_page",{accessibilityId:u,themeStyles:g}=ue({pageId:d}),{file:f,setFile:C,isStoryUploading:y,setIsStoryUploading:b}=In(),{community:_}=A9(e),{confirm:x}=Te(),P=ce(),{online:I}=useNetworkState(),[w,M]=useState([{data:{url:"",customText:""},type:"hyperlink"}]),[T,E]=useState("fit"),[N,A]=useState([]),D=useMemo(()=>{var ne;return (ne=w.filter(te=>te.type==="hyperlink"))==null?void 0:ne[0].data.url},[w]),G=useMemo(()=>{var ne;return (ne=w.filter(te=>te.type==="hyperlink"))==null?void 0:ne[0].data.customText},[w]),H=()=>{E(T==="fit"?"fill":"fit"),T==="fill"&&A([]);},$=X=>l(void 0,[X],function*({file:ne,imageMode:te,metadata:Q,items:me}){if(b(!0),!!ne){(c==null?void 0:c.type)==="ViewStoryPage"||(c==null?void 0:c.type)==="StoryTargetSelectionPage"?m(2):m();try{let q=new FormData;q.append("files",ne),C(null),(o==null?void 0:o.type)==="image"&&e?yield StoryRepository.createImageStory(t,e,q,Q,te,me):(o==null?void 0:o.type)==="video"&&e&&(yield StoryRepository.createVideoStory(t,e,q,Q,me)),P.success({content:"Successfully shared story"});}catch(q){q instanceof Error&&P.info({content:"Failed to upload"});}finally{b(!1);}}}),j=()=>{x({pageId:d,title:"Discard this story?",content:"The story will be permanently discarded. It cannot be undone.",cancelText:"Cancel",okText:"Discard",onOk:()=>{C(null),r();}});},O=({url:ne,customText:te=""})=>{M([{data:{url:ne,customText:te},type:"hyperlink"}]),l$1(),i?a():l$1();},z=()=>{M([{data:{url:"",customText:""},type:"hyperlink"}]);},k=ne=>ie__default.createElement("div",{className:Da.addHyperlinkContainer},ie__default.createElement(Fx,{pageId:d,url:D,customText:G,onClose:ne,onSubmit:O,onRemove:z})),F=()=>{var ne,te;if((te=(ne=w[0])==null?void 0:ne.data)!=null&&te.url){P.info({content:"Can\u2019t add more than one link to your story.",alignment:"fullscreen"});return}i?n({pageId:d,view:"desktop",children:k(a)}):s({content:k(()=>{l$1();})});},re=()=>{i?n({pageId:d,view:"desktop",children:k(a)}):s({content:k(()=>{l$1();})});},W=useCallback(ne=>l(void 0,null,function*(){let te=new Image;te.crossOrigin="Anonymous",te.src=ne,te.onload=()=>{let me=new TCe().getPalette(te,2);me&&A(me.map(X=>`rgb(${X.join(",")})`));};}),[]);return useEffect(()=>{l(void 0,null,function*(){if((o==null?void 0:o.type)==="image")if(f){let te=URL.createObjectURL(f);yield W(te);}else o.url&&(yield W(o.url));});},[f,o,T]),ie__default.createElement("div",{"data-testid":u,style:g,className:Da.storyWrapper},ie__default.createElement("div",{id:"asc-uikit-create-story",className:Da.draftPageContainer},ie__default.createElement("div",{className:Da.headerContainer},ie__default.createElement("div",{className:Da.header},ie__default.createElement(Hf,{pageId:d,onPress:j}),ie__default.createElement("div",{className:Da.topRightButtons},(o==null?void 0:o.type)==="image"&&ie__default.createElement(O2,{pageId:d,onPress:H}),ie__default.createElement(_7,{pageId:d,onPress:F})))),(o==null?void 0:o.type)==="image"?ie__default.createElement("div",{className:Da.mainContainer,style:{background:`linear-gradient(
1870
+ )`}}))};var Oo={thumbnail__container:"H",thumbnail__wrapper:"Ve",thumbnail__overlay:"mv",thumbnail__altText:"hv",thumbnail__failed__placeholder:"gv",thumbnail:"pv",closeIcon:"bv",closeButton:"uv",icon__status__error:"fv",icon__status:"vv",altTextConfig__header:"wv",altTextConfig__header__icon:"xv",altTextConfig__header__count:"yv",drawer__overlay:"kv",drawer__content:"jv",drawer__placeholder:"zv",altTextConfig__mobile__header:"Xv",altTextConfig__mobile__header__icon:"Yv",altTextConfig__mobile__header__count:"Iv",altTextConfig__mobile__header__title:"Av"};function jg({files:e,progress:t,removeFile:o,pageId:r="*",postImages:i=[],componentId:n="*",onRemovePostImage:a,onAltTextChange:s}){let l=e.length>0&&e.some(d=>J2(d)),m=i.length>0;if(!l&&!m)return null;let c=(l?e.filter(d=>J2(d)).length:0)+(m?i.length:0);return ie__default.createElement("div",{"data-images-amount":Math.min(c,3),className:Oo.thumbnail__container},i==null?void 0:i.map(d=>{var u;return ie__default.createElement(t4e,{post:d,pageId:r,key:(u=d.data)==null?void 0:u.fileId,componentId:n,totalImages:c,onRemovePostImage:a||(()=>{})})}),e.filter(d=>J2(d)).map(d=>ie__default.createElement(o4e,{file:d,pageId:r,progress:t,key:`file-${d.id}`,componentId:n,totalImages:c,onRemoveFile:()=>o(d.file),onAltTextChange:s})))}function t4e({post:e,pageId:t,totalImages:o,componentId:r,onRemovePostImage:i}){var a,s;let n=e==null?void 0:e.getImageInfo();return n?ie__default.createElement("div",{key:`post-${(a=e.data)==null?void 0:a.fileId}`,"data-images-height":o>2,className:Oo.thumbnail__wrapper},ie__default.createElement("img",{alt:(s=n.altText)!=null?s:"",className:Oo.thumbnail,src:zu(n.fileUrl)}),ie__default.createElement(V,{type:"reset",className:Oo.closeButton,onPress:()=>{var l;return ((l=e.data)==null?void 0:l.fileId)&&i(e.data.fileId)},"data-testid":`${t}/${r}/remove_thumbnail`},ie__default.createElement(Xn,{className:Oo.closeIcon}))):null}function o4e({file:e,pageId:t,progress:o,totalImages:r,componentId:i,onRemoveFile:n,onAltTextChange:a}){var m;let s=o[e.id]&&!To(e.file),l=e.errorText&&!("fileId"in e);return ie__default.createElement("div",{key:`file-${e.id}`,"data-images-height":r>2,className:Oo.thumbnail__wrapper},ie__default.createElement(r4e,{file:e}),(s||l)&&ie__default.createElement("div",{className:Oo.thumbnail__overlay}),ie__default.createElement(i4e,{testId:`${t}/${i}/remove_thumbnail`,onPress:n}),s&&ie__default.createElement("div",{className:Oo.icon__status},ie__default.createElement(zg,{progress:(m=o[e.id])!=null?m:100})),l&&ie__default.createElement("div",{className:Oo.icon__status__error},ie__default.createElement(Co,null)),To(e.file)&&!s&&!l&&ie__default.createElement(n4e,{file:e.file,onAltTextChange:a}))}function r4e({file:e,testId:t}){var o;return ie__default.createElement("img",{"data-testid":t,src:hO(e),className:Oo.thumbnail,alt:To(e.file)&&(o=e.file.altText)!=null?o:""})}function i4e({onPress:e,testId:t}){return ie__default.createElement(V,{"data-testid":t,type:"reset",className:Oo.closeButton,onPress:e},ie__default.createElement(Xn,{className:Oo.closeIcon}))}function n4e({file:e,onAltTextChange:t}){let{openPopup:o}=Se(),{isDesktop:r}=le(),[i,n]=ie__default.useState(!1);return ie__default.createElement("div",{className:Oo.thumbnail__altText},ie__default.createElement(CO,{completed:!!e.altText,onPress:()=>{r?o({children:({close:a})=>ie__default.createElement(Og,{result:s=>{t(e,s),a();},mode:e.altText!==null?{type:"edit",altText:e.altText||"",media:{type:"image",image:e}}:{type:"create",media:{type:"image",image:e}},renderHeader:({count:s})=>ie__default.createElement("div",{className:Oo.altTextConfig__header},ie__default.createElement(ze,{onPress:a,defaultClassName:Oo.altTextConfig__header__icon}),ie__default.createElement("div",null,ie__default.createElement(v.Headline,null,"Alt text"),ie__default.createElement(v.Caption,{className:Oo.altTextConfig__header__count},s,"/180")))})}):n(!0);}}),ie__default.createElement(vP,{file:e,isOpen:i,setIsOpen:n,onAltTextChange:t}))}function vP({file:e,isOpen:t,setIsOpen:o,onAltTextChange:r,mode:i="create"}){return ie__default.createElement(Drawer.Root,{open:t,onOpenChange:o,snapPoints:[1],activeSnapPoint:1},ie__default.createElement(Drawer.Portal,null,ie__default.createElement(Drawer.Overlay,{className:Oo.drawer__overlay}),ie__default.createElement(Drawer.Content,{className:Oo.drawer__content},ie__default.createElement("div",{className:Oo.drawer__placeholder}),ie__default.createElement(Og,{result:n=>{r==null||r(e,n),o(!1);},mode:e.altText!==null?{type:"edit",altText:e.altText||"",media:{type:"image",image:e}}:{type:"create",media:{type:"image",image:e}},renderHeader:({count:n,isDisabled:a})=>ie__default.createElement("div",{className:Oo.altTextConfig__mobile__header},ie__default.createElement(ot,{onPress:()=>o(!1),defaultClassName:Oo.altTextConfig__mobile__header__icon}),ie__default.createElement("div",{className:Oo.altTextConfig__mobile__header__title},ie__default.createElement(v.BodyBold,null,i==="create"?"Alt text":"Edit alt text"),ie__default.createElement(v.Caption,{className:Oo.altTextConfig__mobile__header__count},n,"/180")),ie__default.createElement(oe,{type:"submit",size:"medium",variant:"text",color:"primary",form:"alt-text-form",isDisabled:a},i==="create"?"Done":"Save"))}))))}var Ln={imageViewer__modal:"Mv",imageViewer__fullImage:"Zo",imageViewer__itemContainer:"_o",imageViewer__prev:"se",imageViewer__next:"de",imageViewer__prev__icon:"et",imageViewer__next__icon:"Sv",imageViewer__close:"rt",imageViewer__closeButton:"Cv",imageViewer__closeButton__img:"Ev",imageViewer__menuButton:"at",imageViewer__menuButton__icon:"Rv",imageViewer__count:"Uv"};var fy=({post:e,community:t})=>{let {currentUserId:o}=Ne();qe({userId:o});let i=useMemo(()=>e.targetType==="community"&&e.targetId===(t==null?void 0:t.communityId),[e.targetType,t==null?void 0:t.communityId]),{moderators:n}=Lo({communityId:t==null?void 0:t.communityId,shouldCall:i}),a=useMemo(()=>i?n.some(l=>l.userId===o):!1,[n,i,o]),s=e.postedUserId===o;return {isCommunityModerator:a,isOwner:s}};function $u({post:e,onClose:t,pageId:o="*",elementId:r="*",componentId:i="*",initialImageIndex:n}){var E;let{isOwner:a}=fy({post:e}),[s,l]=useState(n),{themeStyles:m,accessibilityId:c}=S({pageId:o,componentId:i,elementId:r}),[d,u]=useState(!1),g=(E=e.childrenPosts[s])==null?void 0:E.getImageInfo(),{setDrawerData:f,removeDrawerData:C}=tt(),[y,b]=ie__default.useState(!1),_=()=>{P&&l(N=>N+1);},x=()=>{I&&l(N=>N-1);},P=s<(e==null?void 0:e.children.length)-1,I=s>0,{handleTouchEnd:w,handleTouchMove:M,handleTouchStart:T}=Ug({next:_,prev:x});return ie__default.createElement("div",{style:m,"data-testid":c,className:Ln.imageViewer__modal},ie__default.createElement("span",{className:Ln.imageViewer__close},ie__default.createElement(kn,{pageId:o,onPress:t,componentId:i,defaultClassName:Ln.imageViewer__closeButton,imgClassName:Ln.imageViewer__closeButton__img}),a&&ie__default.createElement(ft,{trigger:{pageId:o,className:Ln.imageViewer__menuButton,iconClassName:Ln.imageViewer__menuButton__icon,onClick:()=>{f({content:ie__default.createElement(yP,{file:g,pageId:o,onPress:()=>{b(!0),C();}})});}}},({closePopover:N})=>ie__default.createElement(yP,{file:g,pageId:o,onPress:N}))),(e==null?void 0:e.children.length)>1&&ie__default.createElement(v.TitleBold,{className:Ln.imageViewer__count,as:"p"},s+1," / ",e==null?void 0:e.children.length),I&&ie__default.createElement(V,{onPress:x,className:Ln.imageViewer__prev,"aria-label":"Click to go to previous image"},ie__default.createElement(wo,{className:Ln.imageViewer__prev__icon})),ie__default.createElement("div",{"aria-live":"assertive"},g&&!d?ie__default.createElement("img",{onTouchEnd:w,onTouchMove:M,onTouchStart:T,onError:()=>u(!0),className:Ln.imageViewer__fullImage,src:zu(g.fileUrl),alt:pg({current:s+1,total:e==null?void 0:e.children.length,altText:g==null?void 0:g.altText})}):ie__default.createElement("div",{role:"status","aria-label":"loading image",className:Ln.imageViewer__itemContainer})),P&&ie__default.createElement(V,{onPress:_,className:Ln.imageViewer__next,"aria-label":"Click to go to next image"},ie__default.createElement(wo,{className:Ln.imageViewer__next__icon})),g&&ie__default.createElement(vP,{file:g,mode:"edit",isOpen:y,setIsOpen:b}))}var ys={videoViewer__modal:"ot",videoViewer__fullImage:"tt",videoViewer__prev:"We",videoViewer__next:"qe",videoViewer__prevButton:"it",videoViewer__nextButton:"Bv",videoViewer__close:"st",videoViewer__closeButton:"Fv",videoViewer__closeButton__img:"Hv",videoViewer__count:"Lv"};function Zu({post:e,onClose:t,pageId:o="*",elementId:r="*",componentId:i="*",initialVideoIndex:n}){useKeyPressEvent("Escape",t);let a=V2((e==null?void 0:e.children)||[]),{themeStyles:s,accessibilityId:l}=S({pageId:o,componentId:i,elementId:r}),[m,c]=useState(n),d=()=>{C&&c(b=>b+1);},u=()=>{y&&c(b=>b-1);},g=a.filter(b=>b.dataType==="video"||b.dataType==="clip"),f=g[m],C=m<g.length-1,y=m>0;return ie__default.createElement("div",{style:s,"data-testid":l,className:ys.videoViewer__modal},ie__default.createElement("span",{className:ys.videoViewer__close},ie__default.createElement(kn,{pageId:o,onPress:t,componentId:i,defaultClassName:ys.videoViewer__closeButton,imgClassName:ys.videoViewer__closeButton__img})),g.length>1&&ie__default.createElement(v.TitleBold,{className:ys.videoViewer__count},m+1," / ",g.length),y&&ie__default.createElement(V,{className:ys.videoViewer__prev,onPress:u},ie__default.createElement(wo,{className:ys.videoViewer__prevButton})),ie__default.createElement(u4e,{videoPost:f,next:d,prev:u}),C&&ie__default.createElement(V,{className:ys.videoViewer__next,onPress:d},ie__default.createElement(wo,{className:ys.videoViewer__nextButton})))}var u4e=memo(({videoPost:e,prev:t,next:o})=>{var d;let r=useMemo(()=>{var u,g,f,C,y;return (e==null?void 0:e.dataType)==="clip"?(u=e==null?void 0:e.data)==null?void 0:u.fileId:((g=e==null?void 0:e.data)==null?void 0:g.videoFileId.high)||((f=e==null?void 0:e.data)==null?void 0:f.videoFileId.medium)||((C=e==null?void 0:e.data)==null?void 0:C.videoFileId.low)||((y=e==null?void 0:e.data)==null?void 0:y.videoFileId.original)||void 0},[e]),{handleTouchEnd:i,handleTouchMove:n,handleTouchStart:a}=Ug({next:o,prev:t,threshold:100}),s=pr(r),l=pr((d=e==null?void 0:e.data)==null?void 0:d.thumbnailFileId),m=useRef(null),c=useMemo(()=>{if(s==null)return null;if(s.status===b2.Transcoded){let{videoUrl:u}=s;return (u==null?void 0:u["1080p"])||(u==null?void 0:u["720p"])||(u==null?void 0:u["480p"])||(u==null?void 0:u["360p"])||(u==null?void 0:u.original)||s.fileUrl}return s.fileUrl},[s]);return useEffect(()=>{var u;(u=m.current)==null||u.load();},[c]),c==null?null:ie__default.createElement("video",{controls:!0,autoPlay:!0,ref:m,controlsList:"nodownload",onTouchEnd:i,poster:l==null?void 0:l.fileUrl,onTouchMove:n,onTouchStart:a,onVolumeChange:u=>{var g;(e==null?void 0:e.dataType)==="clip"&&((g=e==null?void 0:e.data)!=null&&g.isMuted)&&(u.currentTarget.muted=!0);},className:ys.videoViewer__fullImage},ie__default.createElement("source",{src:c,type:"video/mp4"}),ie__default.createElement("p",null,"Your browser does not support this format of video. Please try again later once the server transcodes the video into an playable format(mp4)."))});function _P(){let o=it({fetcher:PostRepository.getGlobalPinnedPosts,params:{limit:10},shouldCall:!0}),{items:e}=o,t=d(o,["items"]);return a({globalFeaturedPosts:e},t)}var v4e=()=>{let[e,t]=useState([]),[o,r]=useState([]),[i,n]=useState(!1),[a$1,s]=useState(!1),[l$1,m]=useState(!1),[c,d]=useState(0),u=useRef(),g=useRef(),f=10,{itemWithAds:C,reset:y}=rU({items:e,pageSize:f,placement:"feed",getItemId:A=>A.postId}),{globalFeaturedPosts:b$1,isLoading:_}=_P();useEffect(()=>{b$1&&r(b$1);},[b$1]);let x=useCallback(()=>{let A=FeedRepository.getGlobalFeed({limit:f},({data:D,loading:G,error:H,hasNextPage:$,onNextPage:j})=>{n(G),D&&!G&&(m(!!$),u.current=j,t(D)),H&&console.error("error",H);});return g.current=A,A},[]);useEffect(()=>{let A=x();return ()=>{A();}},[x]);let P=useCallback(()=>l(void 0,null,function*(){g.current&&g.current(),t([]),m(!1),u.current=void 0,y(),yield new Promise(A=>setTimeout(A,100)),x();}),[x,y]),I=A=>{let D=A.target;d(D.scrollTop);},w=A=>{t(D=>new Set([...D.map(H=>H.postId)]).has(A.postId)?D:[A,...D]);},M=A=>{let D=e.filter(G=>G.postId!==A);t(D);},T=A=>{let D=e.map(G=>G.postId===A.postId?a(a({},G),A):G);t(D);},E=A=>{if(!b$1)return;let D=b$1.map(G=>{var H;return ((H=G.post)==null?void 0:H.postId)===A.postId?b(a({},G),{post:a(a({},G.post),A)}):G});r(D);},N=useCallback(()=>{u.current&&u.current();},[]);return {itemWithAds:C,isLoading:i,prependItem:w,removeItem:M,updateItem:T,updateGlobalFeaturedPosts:E,globalFeaturedPostsItems:o,loadMore:N,hasMore:l$1,loadMoreHasBeenCalled:a$1,refetch:P,scrollPosition:c,onScroll:I,isGlobalFeaturedPostsLoading:_}},wO=createContext({itemWithAds:[],isLoading:!1,prependItem:()=>{},removeItem:()=>{},updateItem:()=>{},updateGlobalFeaturedPosts:()=>{},loadMore:()=>{},hasMore:!1,loadMoreHasBeenCalled:!1,refetch:()=>Promise.resolve(),scrollPosition:0,onScroll:()=>{},isGlobalFeaturedPostsLoading:!1,globalFeaturedPostsItems:[]}),Fn=()=>{let e=useContext(wO);if(!e)throw new Error("useGlobalFeedContext must be used within a GlobalFeedProvider");return e},TO=({children:e})=>{let t=v4e();return ie__default.createElement(wO.Provider,{value:t},e)};function yy(n){var a$1=n,{pageId:e="*",componentId:t="*",isValid:o=!1,onSubmit:r}=a$1,i=d(a$1,["pageId","componentId","isValid","onSubmit"]);let s="create_new_post_button",{config:l,isExcluded:m,themeStyles:c,accessibilityId:d$1}=S({pageId:e,componentId:t,elementId:s});return m?null:ie__default.createElement(oe,b(a({},i),{type:"submit",style:c,"data-testid":d$1}),l.text)}var qu={editorPlaceholder:"Tv",editorParagraph:"Vv",editorContainer:"dt",editorRoot:"Wv",editorLink:"qv",postTextField__mentionInterceptor:"Dv"};var E4e=e=>{let[t,o]=useState(null),{community:r,isLoading:i}=Ct({communityId:e}),n=useMemo(()=>!!e&&!i&&!(r!=null&&r.isPublic),[e,i,r]),{members:a,hasMore:s,isLoading:l,loadMore:m}=hu({communityId:e||"",displayName:t||"",limit:10,enabled:n}),{users:c,hasMore:d,loadMore:u,isLoading:g}=al({displayName:t||"",limit:10,enabled:!n}),f=x=>{o(x);},C=useMemo(()=>e&&i?[]:n?a.map(({user:x,userId:P})=>({userId:(x==null?void 0:x.userId)||P,displayName:x==null?void 0:x.displayName})):c.map(({displayName:x,userId:P})=>({userId:P,displayName:x})),[c,a,n,i]),y=useMemo(()=>n?s:d,[n,s,d]),b=()=>{_||!y||(n?m():u());},_=useMemo(()=>n?l:g,[l,g,n]);return {suggestions:C,queryString:t,onQueryChange:f,loadMore:b,hasMore:y,isLoading:_}},A4e=[AutoLinkNode,LinkNode,bm],qc=({onChange:e,dataValue:t,className:o,communityId:r,pageId:i="*",mentionContainer:n,componentId:a$1="*",placeholderClassName:s,mentionContainerClassName:l,placeholder:m,isValidInput:c})=>{let d="post_text_field",[u,g]=useState(null),{accessibilityId:f}=S({pageId:i,componentId:a$1,elementId:d}),C=mu({namespace:"PostTextField",theme:{link:qu.editorLink,placeholder:qu.editorPlaceholder,paragraph:qu.editorParagraph},nodes:A4e}),{onQueryChange:y,suggestions:b$1,isLoading:_,loadMore:x}=E4e(r);return ke({onIntersect:()=>{x();},node:u,options:{threshold:.7}}),ie__default.createElement(LexicalComposer,{initialConfig:a(a({},C),t!=null&&t.data.text?{editorState:JSON.stringify(su(t))}:{})},ie__default.createElement("div",{"data-input-validation":c,className:wl(qu.editorContainer,o),"data-testid":f},ie__default.createElement(RichTextPlugin,{contentEditable:ie__default.createElement(ContentEditable,null),placeholder:ie__default.createElement("div",{className:wl(qu.editorPlaceholder,s),"data-isclip":a$1==="clipPost"},m!=null?m:"What's going on..."),ErrorBoundary:LexicalErrorBoundary}),ie__default.createElement(OnChangePlugin,{onChange:(P,I)=>{e(lu(I));}}),ie__default.createElement(HistoryPlugin,null),ie__default.createElement(AutoFocusPlugin,null),ie__default.createElement(fu,null),ie__default.createElement(gu,null),ie__default.createElement(yu,{suggestions:b$1,onQueryChange:y,commandPriority:COMMAND_PRIORITY_HIGH,getSuggestionId:P=>P.userId,$createNode:P=>W1({text:`@${(P==null?void 0:P.displayName)||""}`,data:P}),menuRenderFn:(P,{options:I,selectedIndex:w,setHighlightedIndex:M,selectOptionAndCleanUp:T})=>{if(I.length===0)return null;let E=I.map((N,A)=>ie__default.createElement(vu,{pageId:i,componentId:a$1,isSelected:w===A,onClick:()=>{M(A),T(N);},onMouseEnter:()=>{M(A);},key:N.key,option:b(a({},N),{setRefElement:D=>{A===I.length-1&&g(D),N.setRefElement(D);}})}));return n?_U.createPortal(E,n):P!=null&&P.current?_U.createPortal(ie__default.createElement("div",{className:l},E),P.current):null}})))};var Yo={thumbnail__container:"L",thumbnail__wrapper:"De",thumbnail:"Gv",closeButton:"Jv",closeIcon:"Kv",icon__status:"Nv",thumbnail__overlay:"Ov",playIcon:"Pv",thumbnailVideo__broken:"Qv"};var D4e=({post:e,pageId:t,componentId:o,onRemovePostVideo:r,totalVideos:i})=>{var a,s;let n=rt({fileId:(a=e.data)==null?void 0:a.thumbnailFileId});return n?ie__default.createElement("div",{key:`post-${(s=e.data)==null?void 0:s.videoFileId.original}`,"data-video-height":String(i>2),className:Yo.thumbnail__wrapper},ie__default.createElement("img",{src:n,className:Yo.thumbnail,alt:"video thumbnail uploaded"}),ie__default.createElement(V,{"data-testid":`${t}/${o}/remove_thumbnail`,type:"reset",className:Yo.closeButton,onPress:()=>{var l,m;return ((m=(l=e.data)==null?void 0:l.videoFileId)==null?void 0:m.original)&&(r==null?void 0:r(e.data.videoFileId.original))}},ie__default.createElement(Zi,{className:Yo.closeIcon})),ie__default.createElement("div",{className:Yo.playIcon},ie__default.createElement($i,null))):null},Gg=({pageId:e="*",componentId:t="*",progress:o,removeFile:r,files:i,postVideos:n=[],onRemovePostVideo:a})=>{let[s,l]=useState(!1),m=g=>{var f;return To(g.file)?g.file.type==="video"||(((f=g.file.attributes)==null?void 0:f.mimeType)||"").startsWith("video/"):g.file instanceof File?g.file.type.startsWith("video/"):!1},c=i.length>0&&i.some(g=>m(g)),d=n.length>0,u=(c?i.filter(g=>m(g)).length:0)+(d?n.length:0);return !c&&!d?null:ie__default.createElement("div",{"data-images-amount":Math.min(u,3),className:Yo.thumbnail__container},n.map(g=>{var f;return ie__default.createElement(D4e,{key:(f=g.data)==null?void 0:f.videoFileId.original,post:g,pageId:e,componentId:t,onRemovePostVideo:a,totalVideos:u})}),i==null?void 0:i.filter(g=>m(g)).map(g=>{var f,C;return ie__default.createElement("div",{key:`file-${g.id}`,"data-video-height":String(u>2),className:Yo.thumbnail__wrapper},o[g.id]&&!To(g.file)?ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("img",{src:g.thumbnailVideo,className:Yo.thumbnail,alt:"thumbnail-video"}),ie__default.createElement("div",{className:Yo.thumbnail__overlay}),ie__default.createElement(V,{"data-testid":`${e}/${t}/remove_thumbnail`,type:"reset",className:Yo.closeButton,onPress:()=>r(g.file)},ie__default.createElement(Zi,{className:Yo.closeIcon})),ie__default.createElement("div",{className:Yo.icon__status},ie__default.createElement(zg,{progress:(f=o[g.id])!=null?f:100}))):g.errorText?ie__default.createElement(ie__default.Fragment,null,s||!g.thumbnailVideo?ie__default.createElement("div",{className:Yo.thumbnailVideo__broken}):ie__default.createElement("img",{src:g.thumbnailVideo,className:Yo.thumbnail,alt:"thumbnail-video",onError:()=>l(!0)}),ie__default.createElement("div",{className:Yo.thumbnail__overlay}),ie__default.createElement(V,{"data-testid":`${e}/${t}/remove_thumbnail`,type:"reset",className:Yo.closeButton,onPress:()=>r(g.file)},ie__default.createElement(Zi,{className:Yo.closeIcon})),ie__default.createElement("div",{className:Yo.icon__status},ie__default.createElement(Wi,null))):ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("img",{"data-testid":`${e}/${t}/video_thumbnail`,className:Yo.thumbnail,alt:To(g.file)?(C=g.file.attributes)==null?void 0:C.name:"video thumbnail",src:g.thumbnailVideo}),ie__default.createElement(V,{"data-testid":`${e}/${t}/remove_thumbnail`,type:"reset",className:Yo.closeButton,onPress:()=>r(g.file)},ie__default.createElement(Zi,{className:Yo.closeIcon})),ie__default.createElement("div",{className:Yo.playIcon},ie__default.createElement($i,null))))}))};var xP="like";var V4e="global-admin",{COMMUNITY_MODERATOR:U4e,CHANNEL_MODERATOR:H4e,MODERATOR:O4e,SUPER_MODERATOR:z4e}=I1,$g=e=>{if(!(e!=null&&e.length))return !1;let t=[U4e,H4e,O4e,z4e];return e.some(o=>t.includes(o))},Yu=e=>e!=null&&e.length?e.includes(V4e):!1;var Cy=({files:e,posts:t})=>{let o="6.75rem",r="8.5rem",i="11rem",n="14.5rem",a="18.1rem",[s,l]=useState(o),[m,c]=useState(!1),[d,u]=useState(!0),[g,f]=useState(!0),[C,y]=useState(!0),b=s==r||s==i||s==n||s==a,_=P=>{s===o&&P==="0px"||l(P);};return useEffect(()=>{c(K2());},[]),useEffect(()=>{!(e!=null&&e.length)&&!(t!=null&&t.length)?(u(!0),f(!0),y(!0)):t!=null&&t.some(P=>P.dataType===PostContentType.IMAGE)||e!=null&&e.some(P=>J2(P))?(u(!0),f(!1),y(!1)):t!=null&&t.some(P=>P.dataType===PostContentType.VIDEO)||e!=null&&e.some(P=>cV(P))?(u(!1),f(!0),y(!1)):(u(!1),f(!1),y(!0));},[e,t]),useEffect(()=>{let P=[m,d,g,C].filter(Boolean).length;P===4?l(a):P===3?l(n):P===2?l(i):P===1&&l(r);},[m,d,g,C]),{isShowDetailMediaAttachmentMenu:b,snap:s,isVisibleCamera:m,isVisibleImage:d,isVisibleVideo:g,isVisibleFile:C,HEIGHT_MEDIA_ATTACHMENT_MENU:o,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_1:r,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_2:i,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_3:n,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_4:a,handleSnapChange:_,showToastPosition:()=>{switch(s){case o:return "0";case r:return "1";case i:return "2";case n:return "3";default:return "3"}}}};var BO=e=>new Promise((t,o)=>{let r=document.createElement("video"),i=document.createElement("canvas"),n=i.getContext("2d");r.src=URL.createObjectURL(e);let a=()=>{r.currentTime=10;},s=()=>{try{i.width=r.videoWidth,i.height=r.videoHeight,n==null||n.drawImage(r,0,0,i.width,i.height);let m=i.toDataURL("image/png");t(m);}catch(m){o(m);}finally{r.removeEventListener("canplay",a),r.removeEventListener("seeked",s),r.removeEventListener("error",l),URL.revokeObjectURL(r.src);}},l=m=>{o(new Error(`Error loading video: ${m}`));};r.addEventListener("canplay",a),r.addEventListener("seeked",s),r.addEventListener("error",l),r.load();});var j4e=100,AO=1*1024*1024*1024,G4e=2*1024*1024*1024;function Qu(e){let{info:t}=Te(),[o,r]=useState({}),[i,n]=useState(!1),[a$1,s]=useState([]),[l$1,m]=useState([]),c=(_,x)=>{let P=x<j4e?x:100;r(I=>b(a({},I),{[_.id]:P}));},d=(_,x)=>{if(To(_)){let P=a$1.filter(I=>I.file.fileId!==_.fileId);s(P);}else if(x!==void 0){let P=a$1.filter((I,w)=>w!==x);s(P);}else {let P=a$1.filter(I=>I.file.name!==_.name);s(P);}},u=(_,x)=>l(this,null,function*(){if(!_.length)return;let P=x===FileType.CLIP?_.filter(T=>T.size>G4e):_.filter(T=>T.size>AO),I=_.filter(T=>T.size<=AO),w=P.map(T=>({file:T,id:v4$1(),status:"failed",errorText:"File size exceed the limit"}));if(w.length>0&&s(T=>[...T,...w]),I.length===0)return;let M=yield Promise.all(I.map(T=>l(this,null,function*(){let E={file:T,id:v4$1(),status:"selected"};if(T.type.includes(FileType.VIDEO)||T.type.includes(FileType.CLIP)){let N=yield BO(T);m(A=>[...A,{file:T,videoUrl:URL.createObjectURL(T),thumbnail:N}]),N&&(E.thumbnailVideo=N);}return E})));g(M);try{yield Promise.allSettled(M.map(T=>f(T,x))),r({});}catch(T){console.error("error >>",T);}finally{n(!1);}}),g=(_,x)=>{n(!0),s(P=>[...P,..._]),r(_.reduce((P,I)=>b(a({},P),{[I.id]:0}),{}));},f=(_,x)=>l(this,null,function*(){var w;let P=new FormData;P.append("files",_.file);let I=C(x!=null?x:_.file.type);try{let M=yield I(P,T=>{c(_,T);});((w=M==null?void 0:M.data)==null?void 0:w.length)>0&&s(T=>T.map(E=>E.id===_.id?b(a({},E),{file:M.data[0],status:"uploaded"}):E));}catch(M){s(T=>T.map(E=>E.id===_.id?b(a({},E),{status:"failed",errorText:"Failed to upload."}):E));}}),C=_=>_.includes(FileType.VIDEO)?(x,P)=>FileRepository.uploadVideo(x,void 0,P):_.includes(FileType.IMAGE)?FileRepository.uploadImage:_.includes(FileType.CLIP)?(x,P)=>FileRepository.uploadClip(x,void 0,P):FileRepository.uploadFile;return {files:a$1,progress:o,isLoading:i,videoThumbnail:l$1,uploadFile:u,removeFile:d,handleFileChange:(_,x,P)=>{let I=typeof P=="number"?a$1.length>0?(a$1==null?void 0:a$1.length)+_.length+P:(_==null?void 0:_.length)+P:_.length+a$1.length,w="";switch(x){case FileType.IMAGE:w="You\u2019ve reached the upload limit of 10 images. Any additional images will not be saved. ";break;case FileType.FILE:w="We\u2019ve uploaded the first 10 files you selected. Any additional files have been discarded.";break;case FileType.VIDEO:w="You\u2019ve reached the upload limit of 10 videos. Any additional videos will not be saved. ";break}if(I&&I>10){t({pageId:e,type:"info",title:"Maximum upload limit reached",content:w,okText:"OK"});return}_.length>0&&u(_);},handleAltTextChange:(_,x)=>{s(P=>P.map(I=>To(I.file)&&I.file.type==="image"&&I.file.fileId===_.fileId?b(a({},I),{file:b(a({},_),{altText:x})}):I));}}}var by=({ref:e})=>{let[t,o]=useState(void 0);return useEffect(()=>{if(e.current==null)return;let r=new ResizeObserver(i=>{for(let n of i)o(n.target.clientHeight);});return e.current&&r.observe(e.current),()=>{r.disconnect();}},[e.current]),t};var So={createPost:"ct",createPost__form:"ce",createPost__topBar:"lt",createPost__formContent:"f",createPost__input:"nt",createPost__placeholder:"Ge",createPost__mentionContainer:"mt",createPost__attachment:"ht",createPost__ctaWrapper:"gt",createPost__cta:"pt",createPost__mention:"Je",createPost__attachmentDrawer:"bt",createPost__attachmentDrawer__content:"Zv",createPost__notificationWrapper:"le",createPost__notification:"z",createPost__notificationToast:"_v",createPost_notificationIcon:"ew",createPost__attachmentDrawer__contentContainer:"Ke",createPost__clipPostThumbnaiContainer:"rw",createPost__clipPostThumbnail:"ut",createPost__clipPostPlayIconWrap:"aw",createPost__clipPostPlayIcon:"ow"};var LO=createContext({file:null,setFile:()=>{},isMuted:!1,setIsMuted:()=>{},isAspectFill:!0,setIsAspectFill:()=>{},clipThumbnail:null,setClipThumbnail:()=>{}}),Pl=()=>useContext(LO),FO=({children:e})=>{let[t,o]=useState(null),[r,i]=useState(!1),[n,a]=useState(!0),[s,l]=useState(null),m={file:t,setFile:o,isMuted:r,setIsMuted:i,isAspectFill:n,setIsAspectFill:a,clipThumbnail:s,setClipThumbnail:l};return ie__default.createElement(LO.Provider,{value:m},e)};var Ku=e=>ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 25 24"},e),ie__default.createElement("path",{fill:"white",d:"M19.531 10.809a1.71 1.71 0 010 2.918L7.156 21.039c-1.125.668-2.531-.14-2.531-1.477V4.938c0-1.44 1.512-2.039 2.531-1.44l12.375 7.312z"}));function TP({community:e,targetType:t,targetId:o,isClipPost:r=!1}){let i="post_composer_page",n=useRef(null),a$1=useRef(null),s=useRef(null),{currentUserId:l$1}=Xt(),{user:m}=qe({userId:l$1}),{handleSubmit:c}=useForm(),{info:d}=Te(),{isDesktop:u}=le(),{confirm:g}=Te(),{onBack:f,prevPage:C,prev2Page:y}=Y(),{AmityPostComposerPageBehavior:b$1}=we(),{prependItem:_}=Fn(),{themeStyles:x}=ue({pageId:i}),P=by({ref:s}),{moderators:I}=Lo({communityId:e==null?void 0:e.communityId}),{closePopup:w}=Se(),{online:M}=useNetworkState(),{files:T,progress:E,isLoading:N,removeFile:A,handleFileChange:D,handleAltTextChange:G}=Qu(i),{file:H,setFile:$,clipThumbnail:j,isMuted:O,isAspectFill:z,setIsMuted:k,setIsAspectFill:F}=Pl(),[re,W]=useState(!1),[ne,te]=useState(!1),[Q,me]=useState(),[X,q]=useState({text:"",mentioned:[],mentionees:[{type:"user",userIds:[""]}],attachments:[{fileId:"",type:"image"}]}),{HEIGHT_MEDIA_ATTACHMENT_MENU:ae,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_1:Ee,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_2:J,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_3:R,snap:be,isShowDetailMediaAttachmentMenu:xe,isVisibleCamera:Xe,isVisibleImage:Qe,isVisibleVideo:ht,handleSnapChange:Zt,showToastPosition:Bt}=Cy({files:T}),{mutate:so}=useMutation({mutationFn:Re=>l(this,null,function*(){return PostRepository.createPost(Re)}),onMutate:()=>{W(!0),te(!1),me(void 0);},onSuccess:Re=>{let jt=Re.data,Gt=(I||[]).find($t=>$t.userId===jt.postedUserId)!=null;o||_(jt),(e!=null&&e.needApprovalOnPostCreation||(e==null?void 0:e.postSetting)===CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED)&&!Gt&&!Yu(m==null?void 0:m.roles)?d({pageId:i,title:"Posts sent for review",content:"Your post has been submitted to the pending list. It will be published once approved by the community moderator.",okText:"OK"}):_(jt),k(!1),F(!0),W(!1),ve();},onError:Re=>{W(!1),te(!0),$e(Re);}});function lo(){return l(this,null,function*(){var Gt;if(((Gt=X.text)==null?void 0:Gt.length)>5e4){me("You have reached the maximum of 50,000 characters in a post.");return}let Re=r?[{fileId:H&&To(H)?H.fileId:"",type:"clip",displayMode:z?"fill":"fit",isMuted:O}]:T.map(({file:$t})=>({fileId:$t.fileId,type:$t.type})),jt={targetId:o,targetType:t,data:{text:X.text},metadata:{mentioned:X.mentioned},mentionees:X.mentionees,attachments:Re};so(jt);})}let ve=()=>{$(null),Ce(),u&&w();},$e=Re=>{Re.message.includes(xr.CONTAIN_BLOCKED_WORD)?me("Your post wasn't posted because it contains a blocked word."):Re.message.includes(xr.NOT_INCLUDE_WHITELIST_LINK)?me("Your post wasn't posted because it contains a link that's not allowed."):me("Failed to create post. Please try again.");},pe=Re=>{q(jt=>b(a({},jt),{mentioned:Re.mentioned,text:Re.text,mentionees:Re.mentionees}));},Me=()=>{if(Ht)return f();g({pageId:i,type:"confirm",title:"Discard this post?",content:"The post will be permanently discarded. It cannot be undone.",onOk:()=>{$(null),Ce();},okText:"Discard",cancelText:"Keep editing"});},K=ie__default.createElement("div",{className:So.createPost__notificationWrapper,"data-item-position":be===ae},(re||!M)&&ie__default.createElement(Ur,{icon:ie__default.createElement(Ia,null),content:M?"Posting...":"Waiting for network...",alignment:"fixed"}),(ne||Q)&&ie__default.createElement(Ur,{duration:3e3,content:Q||"Failed to create post. Please try again.",alignment:"fixed",icon:ie__default.createElement(Co,{className:So.createPost_notificationIcon}),onClose:()=>{me(void 0),te(!1);}})),Ce=()=>{var Re;return (C==null?void 0:C.type)==="SelectPostTargetPage"||(y==null?void 0:y.type)==="SelectPostTargetPage"?(Re=b$1==null?void 0:b$1.goToSocialHomePage)==null?void 0:Re.call(b$1):(y==null?void 0:y.type)==="UserProfilePage"||(y==null?void 0:y.type)==="CommunityProfilePage"?f(2):f()},he=X.text.length>0||T.length>0||H!==void 0,Pe=T.some(Re=>Re.errorText!==void 0),Ht=X.text.length===0&&T.length===0&&H==null,Ii=!Ht&&he&&!Pe&&!re&&M&&!N,zt=()=>{(re||!M)&&(v.Body,Bt(),Ia);},Gi=()=>{(ne||Q)&&(v.Body,Bt(),So.createPost__notificationToast);};return ie__default.createElement("div",{className:So.createPost,style:x},u&&K,ie__default.createElement("form",{className:So.createPost__form,onSubmit:c(lo),"data-from-media":be==ae},ie__default.createElement("div",{className:So.createPost__topBar},ie__default.createElement(ot,{pageId:i,onPress:Me}),ie__default.createElement(Mo,{pageId:i,community:e}),ie__default.createElement(yy,{pageId:i,variant:"text",isDisabled:!Ii})),r&&ie__default.createElement("div",{className:So.createPost__clipPostThumbnaiContainer},ie__default.createElement("img",{"data-aspect-fill":z,src:j!=null?j:void 0,alt:"thumbnail clip",className:So.createPost__clipPostThumbnail}),ie__default.createElement("div",{className:So.createPost__clipPostPlayIconWrap},ie__default.createElement(Ku,{className:So.createPost__clipPostPlayIcon}))),ie__default.createElement("div",{className:So.createPost__formContent},ie__default.createElement(qc,{pageId:i,componentId:r?"clipPost":void 0,onChange:pe,communityId:o,className:So.createPost__input,dataValue:{data:{text:X.text}},placeholderClassName:So.createPost__placeholder,mentionContainer:u?null:a$1.current,mentionContainerClassName:So.createPost__mentionContainer}),ie__default.createElement(jg,{files:T,pageId:i,progress:E,removeFile:A,onAltTextChange:G}),ie__default.createElement(Gg,{files:T,pageId:i,progress:E,removeFile:A})),ie__default.createElement("div",{className:So.createPost__attachment},ie__default.createElement(X1,{pageId:i,isVisibleCamera:Xe,isVisibleImage:Qe,isVisibleVideo:ht,totalMedia:T.length,onVideoFileChange:Re=>D(Re,FileType.VIDEO),onImageFileChange:Re=>D(Re,FileType.IMAGE)})),ie__default.createElement("div",{className:So.createPost__ctaWrapper},ie__default.createElement(yy,{variant:"fill",pageId:i,className:So.createPost__cta,isDisabled:!Ii})),ie__default.createElement("div",{ref:a$1,className:So.createPost__mention,"data-testid":`${i}/mention_text_input_options`,style:{"--asc-mention-bottom":`${P!=null?P:0}px`}})),!u&&!r&&ie__default.createElement("div",{className:So.createPost__attachmentDrawer},ie__default.createElement("div",{ref:n}),n.current?_U.createPortal(ie__default.createElement(Drawer.Root,{modal:!1,open:!0,activeSnapPoint:be,snapPoints:[ae,Ee,J,R],setActiveSnapPoint:Re=>{typeof Re=="string"&&Zt(Re);}},ie__default.createElement(Drawer.Portal,{container:n.current},ie__default.createElement(Drawer.Content,{className:So.createPost__attachmentDrawer__content},ie__default.createElement("div",{ref:s,className:So.createPost__attachmentDrawer__contentContainer,"data-show-detail-media-attachment":xe},xe?ie__default.createElement(Lu,{pageId:i,isVisibleCamera:Xe,isVisibleImage:Qe,isVisibleVideo:ht,totalMedia:T.length,onImageFileChange:Re=>D(Re,FileType.IMAGE),onVideoFileChange:Re=>D(Re,FileType.VIDEO)}):ie__default.createElement(X1,{pageId:i,isVisibleCamera:Xe,isVisibleImage:Qe,isVisibleVideo:ht,totalMedia:T.length,onImageFileChange:Re=>D(Re,FileType.IMAGE),onVideoFileChange:Re=>D(Re,FileType.VIDEO)}))))),n.current):null,zt(),Gi()),r&&ie__default.createElement(ie__default.Fragment,null,zt(),Gi()))}function Iy(r){var i=r,{pageId:e="*",componentId:t="*"}=i,o=d(i,["pageId","componentId"]);let n="edit_post_button",{config:a$1,isExcluded:s,themeStyles:l,accessibilityId:m}=S({pageId:e,componentId:t,elementId:n});return s?null:ie__default.createElement(oe,a({type:"submit",style:l,"data-testid":m},o),a$1.text)}var VO={editPostTitle:"ft"};function qg({pageId:e="*",componentId:t="*"}){let o="edit_post_title",{config:r,isExcluded:i,themeStyles:n,accessibilityId:a}=S({pageId:e,componentId:t,elementId:o});return i?null:ie__default.createElement("div",{"data-testid":a,style:n,className:VO.editPostTitle},r.text)}var l6e=e=>{let[t,o]=useState([]);return useEffect(()=>{function r(){return l(this,null,function*(){if(!e||(e==null?void 0:e.length)===0)return;let i=yield PostRepository.getPostByIds(e);o(i.data);})}r();},[e]),t},UO=l6e;var Dt={editPost:"vt",editPost__form:"Ne",editPost__topBar:"wt",editPost__formContent:"xt",editPost__input:"yt",editPost__placeholder:"Oe",editPost__mentionContainer:"kt",editPost__attachment:"jt",editPost__ctaWrapper:"zt",editPost__cta:"Xt",editPost__mention:"Pe",editPost__notificationWrapper:"Yt",editPost__notification:"p",editPost__notificationToast:"tw",editPost__notificationIcon:"iw",editPost__notificationContainer:"It",editPost__attachmentDrawer:"At",editPost__attachmentDrawer__content:"sw",editPost_notificationIcon:"dw",editPost__attachmentDrawer__contentContainer:"Qe",editPost__clipPostThumbnaiContainer:"cw",editPost__clipPostThumbnail:"lw",editPost__clipPostThumbnailBroken:"nw",editPost__clipPostPlayIconWrap:"mw",editPost__clipPostPlayIcon:"hw"};function NP({post:e}){var rm,ee,fe,bt,wi,$d,a6;let t="post_composer_page",o=useRef(null),r=useRef(null),i=useRef(null),{isDesktop:n}=le(),{themeStyles:a$1}=ue({pageId:t}),{closePopup:s}=Se(),l$1=by({ref:i}),{onBack:m}=Y(),{confirm:c,info:d}=Te(),{updateItem:u,updateGlobalFeaturedPosts:g}=Fn(),{files:f,progress:C,isLoading:y,removeFile:b$1,handleFileChange:_,handleAltTextChange:x}=Qu(t),P=UO((e==null?void 0:e.children)||[]),{currentUserId:I}=Xt(),{user:w}=qe({userId:I}),M=(e==null?void 0:e.targetType)==="community"&&!!(e!=null&&e.targetId),{community:T}=Ct({communityId:e==null?void 0:e.targetId,shouldCall:M}),{moderators:E}=Lo({communityId:e==null?void 0:e.targetId,shouldCall:M}),[N,A]=useState(P),[D,G]=useState(!1),{HEIGHT_MEDIA_ATTACHMENT_MENU:H,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_1:$,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_2:j,HEIGHT_DETAIL_MEDIA_ATTACHMENT__MENU_3:O,snap:z,isShowDetailMediaAttachmentMenu:k,isVisibleCamera:F,isVisibleImage:re,isVisibleVideo:W,handleSnapChange:ne,showToastPosition:te}=Cy({files:f,posts:N}),[Q,me]=useState({text:(ee=(rm=e==null?void 0:e.data)==null?void 0:rm.text)!=null?ee:"",mentioned:((fe=e.metadata)==null?void 0:fe.mentioned)||[],mentionees:e.mentionees,attachments:[{fileId:"",type:"image"}]}),X=useNetworkState(),[q,ae]=useState(),[Ee,J]=useState([]),[R,be]=useState([]),[xe,Xe]=useState([]),[Qe,ht]=useState(!1),[Zt,Bt]=useState(!1),so=()=>useMutation({mutationFn:nt=>l(this,null,function*(){return yield PostRepository.editPost(e.postId,nt)}),onMutate:()=>{ht(!0),Bt(!1),ae(void 0);},onSuccess:nt=>{ht(!1),n?s():m(),u(nt.data),g(nt.data);},onError:nt=>{if(ht(!1),Bt(!0),nt.message.includes(xr.CONTAIN_BLOCKED_WORD)){ae("Your post wasn't posted because it contains a blocked word.");return}else if(nt.message.includes(xr.NOT_INCLUDE_WHITELIST_LINK)){ae("Your post wasn't posted because it contains a link that's not allowed.");return}else {ae("Failed to post.");return}}}),{mutateAsync:lo,isPending:ve}=so(),{handleSubmit:$e}=useForm();useEffect(()=>{A(P);let nt=P.filter(Er=>Er.dataType==="image");J(nt);let pi=P.filter(Er=>Er.dataType==="video");be(pi);let or=P.filter(Er=>Er.dataType==="clip");Xe(or);},[P]);let pe=useCallback(nt=>{J(pi=>pi.filter(or=>{var Er;return ((Er=or==null?void 0:or.data)==null?void 0:Er.fileId)!==nt})),A(pi=>pi.filter(or=>{var Er;return ((Er=or==null?void 0:or.data)==null?void 0:Er.fileId)!==nt}));},[]),Me=useCallback(nt=>{be(pi=>pi.filter(or=>{var Er;return ((Er=or==null?void 0:or.data)==null?void 0:Er.videoFileId.original)!==nt})),A(pi=>pi.filter(or=>{var Er;return ((Er=or==null?void 0:or.data)==null?void 0:Er.videoFileId.original)!==nt}));},[]),K=()=>{var pi,or;let nt=[];if(!zt){let Er=Ee.map(gn=>{var Z5;return {fileId:(Z5=gn==null?void 0:gn.data)==null?void 0:Z5.fileId,type:PostContentType.IMAGE}}),Tte=R.map(gn=>{var Z5;return {fileId:(Z5=gn==null?void 0:gn.data)==null?void 0:Z5.videoFileId.original,type:PostContentType.VIDEO}}),Mte=f.map(gn=>({fileId:To(gn.file)?gn.file.fileId:gn.id,type:To(gn.file)?gn.file.type:gn.file.type.startsWith("image/")?PostContentType.IMAGE:PostContentType.VIDEO}));nt.push(...Er,...Tte,...Mte);}Q&&lo(zt?{data:{text:Q.text},metadata:{mentioned:(pi=Q.mentioned)!=null?pi:[]},mentionees:Q.mentionees}:{data:{text:Q.text},metadata:{mentioned:(or=Q.mentioned)!=null?or:[]},mentionees:Q.mentionees,attachments:nt});},Ce=()=>{var pi;if((pi=Q.text)!=null&&pi.length&&Q.text.length>5e4){ae("You have reached maximum 50,000 characters in a post.");return}let nt=(E||[]).find(or=>or.userId===I)!=null;M&&(T!=null&&T.needApprovalOnPostCreation||(T==null?void 0:T.postSetting)===CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED)&&!nt&&!V8(w==null?void 0:w.roles)?c({pageId:t,title:"Post will be sent for review",content:"Posting in this community requires approval. Your edited post will be published once approved by the community moderator.",okText:"OK",cancelText:"Cancel",onOk:()=>{K();}}):K();},he=nt=>{me(pi=>b(a({},pi),{mentioned:nt.mentioned,text:nt.text,mentionees:nt.mentionees}));},Pe=()=>{if(Re)return m();c({pageId:t,type:"confirm",title:"Discard this post?",content:"The post will be permanently discarded. It cannot be undone.",onOk:()=>{m();},okText:"Discard",cancelText:"Keep editing"});},Ht=(f&&(f==null?void 0:f.length)||0)+(Ee&&(Ee==null?void 0:Ee.length)||0)+(R&&(R==null?void 0:R.length)||0),Ii=ie__default.createElement("div",{className:Dt.editPost__notificationWrapper,"data-item-position":z===H},(Qe||!X)&&ie__default.createElement(Ur,{icon:ie__default.createElement(Ia,null),content:X?"Posting...":"Waiting for network...",alignment:"fixed"}),(Zt||q)&&ie__default.createElement(Ur,{duration:3e3,content:q||"Failed to edit post. Please try again.",alignment:"fixed",icon:ie__default.createElement(Co,{className:Dt.editPost__notificationIcon}),onClose:()=>{ae(void 0),Bt(!1);}})),zt=xe.length>0,Gi=f.length>0||P.length!==N.length,Re=E1(e)&&((bt=e.data)==null?void 0:bt.text)===Q.text&&!Gi,jt=!(Q.text.trim().length>0||f.length>0||Ee.length>0||R.length>0||N.length>0),Gt=!X||Re||jt||y||ve||Zt||f.some(nt=>!To(nt.file)),$t=xe.length>0?(wi=xe[0].data)==null?void 0:wi.thumbnailFileId:null,St=rt({fileId:$t,imageSize:"medium"});Ir(e.postId);return ie__default.createElement("div",{className:Dt.editPost,style:a$1},n&&Ii,ie__default.createElement("form",{className:Dt.editPost__form,onSubmit:$e(Ce),"data-from-media":z==H},ie__default.createElement("div",{className:Dt.editPost__topBar},ie__default.createElement(ot,{pageId:t,onPress:Pe}),ie__default.createElement(qg,{pageId:t}),ie__default.createElement(Iy,{variant:"text",pageId:t,isDisabled:Gt})),zt&&ie__default.createElement("div",{className:Dt.editPost__clipPostThumbnaiContainer},St&&!D?ie__default.createElement("img",{src:St!=null?St:void 0,alt:"thumbnail clip",className:Dt.editPost__clipPostThumbnail,onError:()=>G(!0)}):ie__default.createElement("div",{className:Dt.editPost__clipPostThumbnailBroken}),ie__default.createElement("div",{className:Dt.editPost__clipPostPlayIconWrap},ie__default.createElement(Ku,{className:Dt.editPost__clipPostPlayIcon}))),ie__default.createElement("div",{className:Dt.editPost__formContent},ie__default.createElement(qc,{pageId:t,onChange:he,componentId:zt?"clipPost":void 0,className:Dt.editPost__input,placeholderClassName:Dt.editPost__placeholder,mentionContainer:n?null:o.current,mentionContainerClassName:Dt.editPost__mentionContainer,communityId:e.targetType==="community"?e.targetId:void 0,dataValue:{mentionees:e.mentionees,data:{text:(($d=e==null?void 0:e.data)==null?void 0:$d.text)||""},metadata:{mentioned:((a6=e.metadata)==null?void 0:a6.mentioned)||[]}}}),ie__default.createElement(jg,{files:f,pageId:t,progress:C,removeFile:b$1,postImages:Ee,onAltTextChange:x,onRemovePostImage:pe}),ie__default.createElement(Gg,{files:f,pageId:t,progress:C,removeFile:b$1,postVideos:R,onRemovePostVideo:Me})),!zt&&ie__default.createElement("div",{className:Dt.editPost__attachment},ie__default.createElement(X1,{pageId:t,totalMedia:Ht,isVisibleCamera:F,isVisibleImage:re,isVisibleVideo:W,onVideoFileChange:nt=>_(nt,FileType.VIDEO,N.length),onImageFileChange:nt=>_(nt,FileType.IMAGE,N.length)})),ie__default.createElement("div",{className:Dt.editPost__ctaWrapper},ie__default.createElement(Iy,{variant:"fill",pageId:t,className:Dt.editPost__cta,onPress:()=>$e(Ce),isDisabled:Gt})),ie__default.createElement("div",{ref:o,className:Dt.editPost__mention,"data-testid":`${t}/mention_text_input_options`,style:{"--asc-mention-bottom":`${l$1!=null?l$1:0}px`}})),!n&&!zt&&ie__default.createElement("div",{className:Dt.editPost__attachmentDrawer},ie__default.createElement("div",{ref:r}),r.current?_U.createPortal(ie__default.createElement(Drawer.Root,{modal:!1,open:!0,activeSnapPoint:z,snapPoints:[H,$,j,O],setActiveSnapPoint:nt=>{typeof nt=="string"&&ne(nt);}},ie__default.createElement(Drawer.Portal,{container:r.current},ie__default.createElement(Drawer.Content,{className:Dt.editPost__attachmentDrawer__content},ie__default.createElement("div",{ref:i,className:Dt.editPost__attachmentDrawer__contentContainer,"data-show-detail-media-attachment":k},k?ie__default.createElement(Lu,{pageId:t,isVisibleCamera:F,isVisibleImage:re,isVisibleVideo:W,totalMedia:Ht,onImageFileChange:nt=>_(nt,FileType.IMAGE,N.length),onVideoFileChange:nt=>_(nt,FileType.VIDEO,N.length)}):ie__default.createElement(X1,{pageId:t,isVisibleCamera:F,isVisibleImage:re,isVisibleVideo:W,totalMedia:Ht,onImageFileChange:nt=>_(nt,FileType.IMAGE,N.length),onVideoFileChange:nt=>_(nt,FileType.VIDEO,N.length)}))))),r.current):null,(Qe||!X)&&ie__default.createElement(v.Body,{className:Dt.editPost__notification,"data-show-detail-media-attachment":te(),"data-isclip":zt},ie__default.createElement(Ur,{className:Dt.editPost__notificationToast,content:X?"Posting...":"Waiting for network...",icon:ie__default.createElement(Ia,null),alignment:"fixed"})),(Zt||q)&&ie__default.createElement(v.Body,{className:Dt.editPost__notification,"data-show-detail-media-attachment":te(),"data-isclip":zt},ie__default.createElement(Ur,{content:q||"Failed to edit post. Please try again.",icon:ie__default.createElement(Co,{className:Dt.editPost_notificationIcon}),alignment:"fixed",duration:3e3,className:Dt.editPost__notificationToast,onClose:()=>{ae(void 0),Bt(!1);}}))),ie__default.createElement("div",{className:Dt.editPost__notificationContainer},(ve||!X)&&ie__default.createElement("div",{className:Dt.editPost__notification,"data-show-detail-media-attachment":te(),"data-isclip":zt},ie__default.createElement(Ur,{className:Dt.editPost__notificationToast,content:X?"Posting...":"Waiting for network...",icon:ie__default.createElement(Ia,null),alignment:"fixed"})),q&&ie__default.createElement("div",{className:Dt.editPost__notification,"data-isclip":zt,"data-show-detail-media-attachment":te()},ie__default.createElement(Ur,{content:q||"Failed to edit post. Please try again.",icon:ie__default.createElement(Co,{className:Dt.editPost__notificationIcon}),alignment:"fixed",duration:3e3,className:Dt.editPost__notificationToast,onClose:()=>{ae(void 0),Bt(!1);}}))))}var h6e=e=>e.mode==="create";function ki(e){if(h6e(e)){let{targetId:t,targetType:o,community:r,isClipPost:i}=e;return ie__default.createElement(TP,{mode:"create",targetId:t,targetType:o,community:r,isClipPost:i})}else {let{post:t,isClipPost:o}=e;return ie__default.createElement(NP,{mode:"edit",post:t,isClipPost:o})}}var C6e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M14.8125 6.0625C16.043 6.0625 17.3789 5.64062 18.6445 5.07812C19.7344 4.62109 21 5.42969 21 6.625V15.0625C21 15.6602 20.6836 16.1875 20.2266 16.5039C19.2773 17.1016 17.7656 17.875 15.6914 17.875C13.3008 17.875 11.7188 16.75 9.99609 16.75C8.02734 16.75 6.83203 17.1719 5.53125 17.7695V20.6875C5.53125 21.0039 5.25 21.25 4.96875 21.25H4.40625C4.08984 21.25 3.84375 21.0039 3.84375 20.6875V6.41406C3.31641 6.13281 3 5.57031 3 4.9375C3 3.98828 3.80859 3.21484 4.79297 3.28516C5.60156 3.32031 6.26953 3.95312 6.33984 4.76172C6.33984 4.83203 6.33984 4.90234 6.33984 4.9375C6.33984 5.14844 6.33984 5.32422 6.26953 5.5C7.04297 5.18359 7.99219 4.9375 9.11719 4.9375C11.5078 4.9375 13.0898 6.0625 14.8125 6.0625ZM19.3125 15.0625V6.625C18.1875 7.15234 16.3242 7.75 14.8125 7.75C12.7031 7.75 11.2266 6.625 9.11719 6.625C7.64062 6.625 6.26953 7.22266 5.53125 7.75V15.9062C6.62109 15.4141 8.48438 15.0625 9.99609 15.0625C12.1055 15.0625 13.582 16.1875 15.6914 16.1875C17.168 16.1875 18.5391 15.625 19.3125 15.0625Z"})),Ea=C6e;var Dn=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M19.3125 6.0625C19.5938 6.0625 19.875 6.34375 19.875 6.625V7.1875C19.875 7.50391 19.5938 7.75 19.3125 7.75H18.75L17.9766 19.668C17.9414 20.582 17.2031 21.25 16.2891 21.25H7.67578C6.76172 21.25 6.02344 20.582 5.98828 19.668L5.25 7.75H4.6875C4.37109 7.75 4.125 7.50391 4.125 7.1875V6.625C4.125 6.34375 4.37109 6.0625 4.6875 6.0625H7.57031L8.76562 4.09375C9.04688 3.60156 9.60938 3.25 10.207 3.25H13.7578C14.3555 3.25 14.918 3.60156 15.1992 4.09375L16.3945 6.0625H19.3125ZM10.207 4.9375L9.53906 6.0625H14.4258L13.7578 4.9375H10.207ZM16.2891 19.5625L17.0273 7.75H6.9375L7.67578 19.5625H16.2891Z"}));var Ri={postMenu:"Mt",postMenu__item:"v",postMenu__editPost__text:"gw",postMenu__editPost__icon:"pw",postMenu__reportPost__text:"bw",postMenu__reportPost__icon:"uw",postMenu__closePoll__icon:"fw",postMenu__closePoll__text:"vw",postMenu__deletePost__text:"ww",postMenu__deletePost__icon:"xw"};var b6e=e=>Cn({fetcher:PollRepository.getPoll,params:e,shouldCall:!!e}),GO=b6e;var ZO=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M9.91992 11.9688V15.9062C9.91992 16.3984 9.5332 16.75 9.07617 16.75C8.58398 16.75 8.23242 16.3984 8.23242 15.9062V11.9688C8.23242 11.5117 8.58398 11.125 9.07617 11.125C9.5332 11.125 9.91992 11.5117 9.91992 11.9688ZM11.6074 8.59375C11.6074 8.13672 11.959 7.75 12.4512 7.75C12.9082 7.75 13.2949 8.13672 13.2949 8.59375V15.9062C13.2949 16.3984 12.9082 16.75 12.4512 16.75C11.959 16.75 11.6074 16.3984 11.6074 15.9062V8.59375ZM16.6699 14.2188V15.9062C16.6699 16.3984 16.2832 16.75 15.8262 16.75C15.334 16.75 14.9824 16.3984 14.9824 15.9062V14.2188C14.9824 13.7617 15.334 13.375 15.8262 13.375C16.2832 13.375 16.6699 13.7617 16.6699 14.2188ZM4.57617 6.625C4.57617 5.39453 5.56055 4.375 6.82617 4.375H18.0762C19.3066 4.375 20.3262 5.39453 20.3262 6.625V17.875C20.3262 19.1406 19.3066 20.125 18.0762 20.125H6.82617C5.56055 20.125 4.57617 19.1406 4.57617 17.875V6.625ZM6.26367 6.625V17.875C6.26367 18.1914 6.50977 18.4375 6.82617 18.4375H18.0762C18.3574 18.4375 18.6387 18.1914 18.6387 17.875V6.625C18.6387 6.34375 18.3574 6.0625 18.0762 6.0625H6.82617C6.50977 6.0625 6.26367 6.34375 6.26367 6.625Z",fill:"currentColor"}));var Ru=({post:e,pageId:t="*",componentId:o="*",onConfirmEditPost:r,onCloseMenu:i,onPostDeleted:n})=>{var W,ne;let{success:a,info:s}=ce(),{isDesktop:l$1}=le(),{openPopup:m}=Se(),{post:c}=Ir((W=e.children)==null?void 0:W[0]),{item:d}=GO((ne=c==null?void 0:c.data)==null?void 0:ne.pollId),{client:u}=Ne(),g=useMemo(()=>(c==null?void 0:c.dataType)==="liveStream",[c==null?void 0:c.dataType]),f=useMemo(()=>(e==null?void 0:e.targetType)==="community",[e==null?void 0:e.targetType]),{community:C}=Ct({communityId:e==null?void 0:e.targetId,shouldCall:f}),[y,b]=useState(!1),{isCommunityModerator:_,isOwner:x}=fy({post:e,community:C}),{AmityPostContentComponentBehavior:P}=we(),{showEditPostButton:I,showDeletePostButton:w,showReportPostButton:M}=useMemo(()=>_?x?{showEditPostButton:!0,showDeletePostButton:!0,showReportPostButton:!1}:{showEditPostButton:!1,showDeletePostButton:!0,showReportPostButton:!0}:x?{showEditPostButton:!0,showDeletePostButton:!0,showReportPostButton:!1}:cH(u,e==null?void 0:e.targetType)?{showEditPostButton:!1,showDeletePostButton:!0,showReportPostButton:!0}:{showEditPostButton:!1,showDeletePostButton:!1,showReportPostButton:!0},[_,x,u,e]),T=useMemo(()=>!!(d&&d.status==="open"&&x),[x,d]),E=useMemo(()=>!!d,[d]),{isFlaggedByMe:N,isLoading:A,mutateUnReportPost:D}=h8({post:e,reasonReport:ContentFlagReasonEnum.Others,isFlaggable:M,onUnreportSuccess:()=>{a({content:"Post unreported."}),i();},onUnreportError:()=>{s({content:"Failed to unreport post. Please try again.",alignment:l$1?"fullscreen":"withSidebar"}),i();}}),{confirm:G}=Te(),{mutateAsync:H}=useMutation({networkMode:"always",mutationFn:()=>l(void 0,null,function*(){return i(),PostRepository.softDeletePost(e.postId)}),onSuccess:()=>{a({content:"Post deleted."}),n==null||n(e);},onError:()=>{s({content:"Failed to delete post. Please try again.",alignment:l$1?"fullscreen":"withSidebar"});}}),{mutateAsync:$}=useMutation({networkMode:"always",mutationFn:()=>l(void 0,null,function*(){if(d)return PollRepository.closePoll(d.pollId)}),onSuccess:()=>{a({content:"Poll closed."}),n==null||n(e);},onError:()=>{s({content:"Oops, something went wrong."});}}),j=()=>{i(),G({title:"Delete post",content:"This post will be permanently deleted.",cancelText:"Cancel",okText:"Delete",onOk:()=>{if(!navigator.onLine){s({content:"Oops, something went wrong."});return}H();},pageId:t,componentId:o});},O=()=>{var te;if(l$1)return i(),m({pageId:t,view:"desktop",isDismissable:!1,header:ie__default.createElement(qg,{pageId:"post_composer_page"}),children:ie__default.createElement(ki,{mode:"edit",post:e}),onClose:({close:Q})=>{G({onOk:Q,type:"confirm",okText:"Discard",cancelText:"Keep editing",title:"Discard this post?",pageId:"post_composer_page",content:"The post will be permanently discarded. It cannot be undone."});}});i(),(te=P==null?void 0:P.goToPostComposerPage)==null||te.call(P,{mode:"edit",post:e});},z=()=>{r?r({onConfirm:O}):O();},k=()=>{i(),G({title:"Close poll?",content:"The Poll duration you've set will be ignored and your poll will be closed immediately.",cancelText:"Cancel",okText:"Close poll",onOk:()=>{if(!navigator.onLine){s({content:"Oops, something went wrong."});return}$();},pageId:t,componentId:o});},F=()=>{i(),D();},re=()=>{l$1?(i(),m({id:"report_post_reason",pageId:t,view:"desktop",isDismissable:!1,children:ie__default.createElement(il,{pageId:t,componentId:o,onCloseMenu:i,post:e,showReportPostButton:M})})):b(!0);};return ie__default.createElement("div",{className:Ri.postMenu},!y&&T&&ie__default.createElement(V,{"data-testid":`${t}/${o}/close_poll_button`,className:Ri.postMenu__item,onPress:k},ie__default.createElement(ZO,{className:Ri.postMenu__closePoll__icon}),ie__default.createElement(v.BodyBold,{className:Ri.postMenu__reportPost__text},"Close poll")),!y&&M&&!A?ie__default.createElement(V,{"data-testid":`${t}/${o}/report_post_button`,className:Ri.postMenu__item,onPress:()=>N?F():re()},N?ie__default.createElement(pu,{className:Ri.postMenu__reportPost__icon}):ie__default.createElement(Ea,{className:Ri.postMenu__reportPost__icon}),ie__default.createElement(v.BodyBold,{className:Ri.postMenu__reportPost__text},N?"Unreport post":"Report post")):null,!y&&I&&!E&&!g?ie__default.createElement(V,{"data-testid":`${t}/${o}/edit_post`,className:Ri.postMenu__item,onPress:z},ie__default.createElement($1,{className:Ri.postMenu__editPost__icon}),ie__default.createElement(v.BodyBold,{className:Ri.postMenu__editPost__text},"Edit post")):null,!y&&w?ie__default.createElement(V,{"data-testid":`${t}/${o}/delete_post`,className:Ri.postMenu__item,onPress:j},ie__default.createElement(Dn,{className:Ri.postMenu__deletePost__icon}),ie__default.createElement(v.BodyBold,{className:Ri.postMenu__deletePost__text},"Delete post")):null,y&&!l$1&&ie__default.createElement(il,{pageId:t,componentId:o,onCloseMenu:i,post:e,showReportPostButton:M}))};var Ty=({post:e,community:t})=>{let{currentUserId:o}=Ne(),r=useMemo(()=>(e==null?void 0:e.targetType)==="community"&&(e==null?void 0:e.targetId)===(t==null?void 0:t.communityId),[e==null?void 0:e.targetType,t==null?void 0:t.communityId]),{moderators:i}=Lo({communityId:t==null?void 0:t.communityId,shouldCall:r}),n=useMemo(()=>r?i.some(s=>s.userId===(e==null?void 0:e.postedUserId)):!1,[i,r,e==null?void 0:e.postedUserId]),a=(e==null?void 0:e.postedUserId)===o;return {isCommunityModerator:n,isOwner:a}};var YO=({threshold:e,elementRef:t})=>{let[o,r]=useState(!1);return useEffect(()=>{if(!t.current)return;let i=new IntersectionObserver(n=>{n.forEach(a=>{let s=a.isIntersecting;r(s);});},{threshold:e});return i.observe(t.current),()=>{i.disconnect();}},[e,t]),{isVisible:o}};var QO={announcementBadge:"yw"};var kP={featuredIcon__background:"kw",featuredIcon__textColor:"jw"};var KO=r=>{var i=r,{backgroundColor:e,textColor:t}=i,o=d(i,["backgroundColor","textColor"]);return ie__default.createElement("svg",a({width:"73",height:"26",viewBox:"0 0 73 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o),ie__default.createElement("path",{d:"M0 0H69C71.2091 0 73 1.79086 73 4V22C73 24.2091 71.2091 26 69 26H0V0Z",className:kP.featuredIcon__background,fill:e}),ie__default.createElement("path",{d:"M9.12988 18V8.84033H14.9697V10.2178H10.7676V12.9282H14.6079V14.2612H10.7676V18H9.12988ZM19.5108 18.1396C17.4478 18.1396 16.1973 16.7559 16.1973 14.5469V14.5405C16.1973 12.3569 17.4605 10.9287 19.4346 10.9287C21.4088 10.9287 22.6275 12.3125 22.6275 14.4072V14.9277H17.7779C17.797 16.1719 18.4698 16.8955 19.5426 16.8955C20.3995 16.8955 20.8883 16.4639 21.0406 16.1465L21.0596 16.1021H22.564L22.545 16.1592C22.3228 17.0542 21.3961 18.1396 19.5108 18.1396ZM19.4537 12.1665C18.5714 12.1665 17.9112 12.7632 17.7906 13.8677H21.085C20.9771 12.7314 20.336 12.1665 19.4537 12.1665ZM26.0197 18.1143C24.6994 18.1143 23.7409 17.3018 23.7409 16.0386V16.0259C23.7409 14.7881 24.6867 14.0645 26.3752 13.9629L28.1588 13.855V13.2583C28.1588 12.5664 27.7082 12.1855 26.8576 12.1855C26.1339 12.1855 25.6642 12.4458 25.5055 12.9028L25.4992 12.9282H24.0075L24.0138 12.8711C24.1662 11.7031 25.2834 10.9287 26.9338 10.9287C28.7174 10.9287 29.7204 11.792 29.7204 13.2583V18H28.1588V17.0479H28.0509C27.6701 17.7207 26.9338 18.1143 26.0197 18.1143ZM25.3024 15.9624C25.3024 16.5527 25.8039 16.9019 26.5021 16.9019C27.4543 16.9019 28.1588 16.2798 28.1588 15.4546V14.896L26.5973 14.9976C25.715 15.0547 25.3024 15.3784 25.3024 15.9497V15.9624ZM34.2678 18.0317C32.6746 18.0317 32.0207 17.4985 32.0207 16.1592V12.2871H30.9416V11.062H32.0207V9.36084H33.6267V11.062H35.093V12.2871H33.6267V15.7847C33.6267 16.4766 33.8996 16.7686 34.5598 16.7686C34.782 16.7686 34.9026 16.7622 35.093 16.7432V17.9619C34.8645 18.0063 34.5725 18.0317 34.2678 18.0317ZM38.8851 18.1396C37.3236 18.1396 36.5238 17.2002 36.5238 15.5498V11.062H38.1043V15.188C38.1043 16.2607 38.5042 16.8066 39.4564 16.8066C40.4783 16.8066 41.0242 16.1465 41.0242 15.1055V11.062H42.6048V18H41.0242V16.9463H40.9163C40.5926 17.689 39.888 18.1396 38.8851 18.1396ZM44.4545 18V11.062H46.0351V12.1284H46.143C46.3778 11.3857 47.0126 10.9478 47.9267 10.9478C48.1679 10.9478 48.4154 10.9795 48.5678 11.0239V12.4395C48.3139 12.3887 48.0536 12.3506 47.7807 12.3506C46.727 12.3506 46.0351 12.979 46.0351 13.9692V18H44.4545ZM52.5757 18.1396C50.5127 18.1396 49.2622 16.7559 49.2622 14.5469V14.5405C49.2622 12.3569 50.5254 10.9287 52.4995 10.9287C54.4736 10.9287 55.6924 12.3125 55.6924 14.4072V14.9277H50.8428C50.8618 16.1719 51.5346 16.8955 52.6074 16.8955C53.4643 16.8955 53.9531 16.4639 54.1054 16.1465L54.1245 16.1021H55.6289L55.6098 16.1592C55.3877 17.0542 54.4609 18.1396 52.5757 18.1396ZM52.5185 12.1665C51.6362 12.1665 50.9761 12.7632 50.8554 13.8677H54.1499C54.042 12.7314 53.4009 12.1665 52.5185 12.1665ZM59.6939 18.1143C57.9546 18.1143 56.8502 16.7368 56.8502 14.5405V14.5278C56.8502 12.3188 57.9356 10.9478 59.6939 10.9478C60.6461 10.9478 61.4395 11.4175 61.8013 12.1665H61.9092V8.37695H63.4962V18H61.9092V16.9146H61.8013C61.4205 17.6699 60.6714 18.1143 59.6939 18.1143ZM60.189 16.7812C61.2681 16.7812 61.9346 15.9307 61.9346 14.5405V14.5278C61.9346 13.1377 61.2618 12.2808 60.189 12.2808C59.1163 12.2808 58.4561 13.1313 58.4561 14.5278V14.5405C58.4561 15.937 59.1099 16.7812 60.189 16.7812Z",className:kP.featuredIcon__textColor,fill:t}))};var AP=({pageId:e="*",componentId:t="*"})=>{let o="announcement_badge",{config:r,isExcluded:i,accessibilityId:n,uiReference:a,defaultConfig:s}=S({pageId:e,componentId:t,elementId:o});return i?null:ie__default.createElement(Z,{"data-testid":n,defaultIcon:()=>ie__default.createElement(KO,{className:QO.announcementBadge}),imgIcon:()=>ie__default.createElement("img",{src:r.icon,alt:a}),configIconName:r.icon,defaultIconName:s.icon})};var JO={pinBadge__icon:"zw"};var RO=e=>ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"29",height:"30",fill:"none",viewBox:"0 0 29 30"},e),ie__default.createElement("path",{fill:e.fill,d:"M18.106 16.436c.575 1.547.53 3.27-.596 4.398a.74.74 0 01-1.06 0l-3.006-3.005-2.32 2.32c-.022.022-.067.022-.089.044l-1.59.53c-.2.067-.398-.132-.332-.331l.53-1.591.066-.066 2.32-2.32-3.005-3.006a.722.722 0 010-1.06c1.105-1.105 2.829-1.194 4.376-.62l2.917-2.342-.929-.928a.722.722 0 010-1.06l1.061-1.06a.74.74 0 011.06 0l6.011 6.01a.76.76 0 010 1.06l-1.06 1.06a.74.74 0 01-1.061 0l-.95-.95-2.343 2.917z"}));var FP=({pageId:e,componentId:t})=>{let o="pin_badge",{config:r,isExcluded:i,accessibilityId:n,uiReference:a,defaultConfig:s}=S({pageId:e,componentId:t,elementId:o});return i?null:ie__default.createElement(Z,{"data-testid":n,defaultIcon:()=>ie__default.createElement(RO,{className:JO.pinBadge__icon}),imgIcon:()=>ie__default.createElement("img",{src:r.icon,alt:a}),defaultIconName:s.icon,configIconName:r.icon})};var Tr={idle:"idle",live:"live",ended:"ended",recorded:"recorded"};var ez="./livestream-default-thumbnail-C6F5AP64.png";var tz={liveStreamThumbnail:"Xw"};function DP({fileId:e,alt:t}){let o=rt({fileId:e});return ie__default.createElement("img",{alt:t,loading:"lazy",src:o!=null?o:ez,className:tz.liveStreamThumbnail})}var oz={liveStreamLiveBadge:"Yw"};function Qg(){return ie__default.createElement(v.CaptionBold,{className:oz.liveStreamLiveBadge},"Live")}var rz={liveStreamEndThumbnail:"St"};function Kg({view:e="post"}){return ie__default.createElement("div",{className:rz.liveStreamEndThumbnail,"data-view":e},ie__default.createElement(v.TitleBold,null,"This live stream has ended."),ie__default.createElement(v.Caption,null,"Playback will be available for you ",ie__default.createElement("br",null)," to watch shortly."))}var VP={liveStreamIdleThumbnail:"Ct",liveStreamIdleThumbnail__icon:"Iw"};function Jg({view:e="post"}){return ie__default.createElement("div",{className:VP.liveStreamIdleThumbnail,"data-view":e},ie__default.createElement(Co,{className:VP.liveStreamIdleThumbnail__icon}),ie__default.createElement(v.TitleBold,null,"This stream is currently unavailable."),e==="full-screen"&&ie__default.createElement(v.Caption,null,"Please try again later."))}var iz={liveStreamUpcomingBadge:"Aw"};function UP(){return ie__default.createElement(v.CaptionBold,{className:iz.liveStreamUpcomingBadge},"Upcoming Live")}var nz={liveStreamRecordedBadge:"Mw"};function HP(){return ie__default.createElement(v.CaptionBold,{className:nz.liveStreamRecordedBadge},"Recorded")}var OP={liveStreamContent:"Et",liveStreamContent__playButton:"Sw"};var az={LiveStreamBanThumbnail:"Rt"};function Xg({view:e="post"}){return ie__default.createElement("div",{className:az.LiveStreamBanThumbnail,"data-view":e},ie__default.createElement(v.TitleBold,null,"You\u2019ve been banned."),ie__default.createElement(v.Caption,null,"You can no longer access this live stream."))}function oa({queryParams:e,shouldCall:t=!0}){let i=it({fetcher:CommunityRepository.Membership.getMembers,params:b(a({},e),{includeDeleted:!1,limit:20}),shouldCall:!!(e!=null&&e.communityId)&&t}),{items:o}=i,r=d(i,["items"]);return a({members:o},r)}var Ny=({communityId:e,shouldCall:t=!0})=>{let i=Cn({fetcher:CommunityRepository.getCommunity,params:e,shouldCall:!!e&&t}),{item:o}=i,r=d(i,["item"]);return a({community:o},r)};function jP({parentPost:e,posts:t,goToPostDetail:o}){var g,f;let{goToLiveStreamPlayerPage:r}=Y(),[i,n]=useState(!1),a=useRef(null),s=(g=t==null?void 0:t[0])==null?void 0:g.getLivestreamInfo(),{currentUserId:l}=Ne(),{community:m}=Ny({communityId:e.targetId}),{members:c}=oa({queryParams:{communityId:m==null?void 0:m.communityId}}),d=c.find(C=>C.userId===l),u=(s==null?void 0:s.isBanned)||d&&d.isBanned;return useEffect(()=>((()=>{if(s!=null&&s.startedAt&&(s.status===Tr.idle||s.status===Tr.live)){let b=new Date().getTime()-new Date(s.startedAt).getTime(),_=b<15e3;if(n(_),_){let x=15e3-b+50;a.current=setTimeout(()=>{n(!1);},x);}}else n(!1);})(),()=>{a.current&&(clearTimeout(a.current),a.current=null);}),[s]),!t||((f=t[0])==null?void 0:f.dataType)!=="liveStream"||!s?null:u?ie__default.createElement(Xg,null):s.isDeleted?ie__default.createElement(Jg,null):s.status===Tr.ended?ie__default.createElement(Kg,null):ie__default.createElement(V,{className:OP.liveStreamContent,"data-idle":s.status===Tr.idle||i,onPress:()=>{s.status!==Tr.idle&&!i&&(r==null||r({post:e,goToDetailPage:o}));}},ie__default.createElement(DP,{fileId:s.thumbnailFileId,alt:s.title}),(s.status===Tr.idle||i)&&ie__default.createElement(UP,null),s.status===Tr.live&&!i&&ie__default.createElement(Qg,null),s.status===Tr.recorded&&ie__default.createElement(HP,null),s.status!==Tr.idle&&!i&&ie__default.createElement(bl,{className:OP.liveStreamContent__playButton}))}var Je={postContent:"Ut",postContent__bar:"Cw",postContent__bar__userAvatar:"Ew",postContent__bar__detail:"Rw",postContent__bar__information__subtitle:"Uw",postContent__bar__information__subtitle__moderator:"Bw",postContent__bar__information__subtitle__brand:"Fw",postContent__bar__information__subtitle__separator:"Hw",postContent__bar__actionButton:"Lw",postContent__content:"Tw",postContent__content_and_reactions:"Vw",postContent__divider:"Ww",postContent__reactionBar:"qw",postContent__reactionBar__leftPane:"Dw",postContent__reactionBar__rightPane:"Gw",postContent__reactionBar__leftPane__icon:"Jw",postContent__reactionBar__leftPane__iconImg:"Kw",postContent__reactionBar__leftPane__commentButton:"Nw",postTitle:"Bt",postTitle__text:"Ow",postTitle__icon:"Pw",postTitle__user__container:"ne",postTitle__brandIcon:"Qw",postTitle__community:"me",postTitle__communityText:"Zw",postContent__comment:"_w",postContent__reactions_and_comments:"ex",postContent__reactionsBar:"rx",postContent__commentsCount:"ax",postContent__reactionsBar__reactions:"ox",postContent__reactionsBar__reactions__icon:"w",postContent__reactionsBar__reactions__count:"tx",postContent__bar__information__editedTag:"ix",button:"he",popover:"Ze","fade-in":"Ft","zoom-in":"Ht","fade-out":"Lt","zoom-out":"Tt",menu:"sx",menuItem:"Vt",separator:"dx",postContent__notMember:"cx",postContent__wrapRightMenu:"lx",postContent__imageViewer:"nx",postContent__imageViewerOverlay:"Wt"};var ky=({post:e})=>{let[t,o]=useState(0),[r,i]=useState(!1),[n,a]=useState(null);useEffect(()=>{var m;e!=null&&a(((m=e.myReactions)==null?void 0:m[0])||null);},[e==null?void 0:e.myReactions]),useEffect(()=>{e!=null&&o((e==null?void 0:e.reactionsCount)||0);},[e==null?void 0:e.reactionsCount]);let{mutateAsync:s}=useMutation({mutationFn:m=>l(void 0,null,function*(){if(n&&n!==m)try{yield ReactionRepository.removeReaction("post",e==null?void 0:e.postId,n);}catch(c){console.error(c);}return ReactionRepository.addReaction("post",e==null?void 0:e.postId,m)}),onMutate:m=>{i(!0),o(t+1),a(m);}}),{mutateAsync:l$1}=useMutation({mutationFn:m=>l(void 0,null,function*(){return ReactionRepository.removeReaction("post",e==null?void 0:e.postId,m)}),onMutate:()=>{i(!0),o(Math.max(0,t-1)),a(null);}});return {reactionByMe:n,reactionsCount:t,mutateAddReactionAsync:s,mutateRemoveReactionAsync:l$1,setReactionByMe:a}};var e7e=({pageId:e,componentId:t,post:o,hideTarget:r})=>{var y;let i=useMemo(()=>(o==null?void 0:o.targetType)==="community",[o==null?void 0:o.targetType]),n=useMemo(()=>(o==null?void 0:o.targetType)==="user"&&(o==null?void 0:o.postedUserId)!==(o==null?void 0:o.targetId),[o==null?void 0:o.targetType,o==null?void 0:o.postedUserId,o==null?void 0:o.targetId]),{community:a}=Ct({communityId:o==null?void 0:o.targetId,shouldCall:i}),{user:s}=qe({userId:o==null?void 0:o.targetId,shouldCall:n}),{goToCommunityProfilePage:l,onClickUser:m}=Y(),c=a&&!r,d=s&&!r,u=(y=o==null?void 0:o.creator)==null?void 0:y.isBrand,g=(a==null?void 0:a.isPublic)===!1,f=(a==null?void 0:a.isOfficial)===!0,C=c||d;return ie__default.createElement("div",{className:Je.postTitle,"data-show-target-community":c===!0},o&&(o==null?void 0:o.creator)&&ie__default.createElement("div",{className:Je.postTitle__user__container,"data-show-brand-badge":u===!0,"data-show-target":C===!0},ie__default.createElement(V,{onPress:()=>{var b;return ((b=o==null?void 0:o.creator)==null?void 0:b.userId)&&m(o.creator.userId)},"data-testid":`${e}/${t}/username`},ie__default.createElement(v.BodyBold,{className:Je.postTitle__text},o.creator.displayName)),u?ie__default.createElement(Mn,{className:Je.postTitle__brandIcon}):null,C?ie__default.createElement(du,{"data-testid":`${e}/${t}/arrow_right`,className:Je.postTitle__icon}):null),c&&ie__default.createElement("div",{className:Je.postTitle__community,"data-show-private-badge":g===!0,"data-show-official-badge":f===!0},g&&ie__default.createElement(ar,null),ie__default.createElement(V,{className:Je.postTitle__communityText,"data-testid":`${e}/${t}/community_name`,onPress:()=>l(a.communityId)},ie__default.createElement(v.BodyBold,null,a.displayName)),f&&ie__default.createElement(sr,null)),d&&ie__default.createElement("div",{className:Je.postTitle__user__container,"data-show-brand-badge":(s==null?void 0:s.isBrand)===!0,"data-show-target":!1},ie__default.createElement(V,{onPress:()=>m(s.userId)},ie__default.createElement(v.BodyBold,{className:Je.postTitle__text},s.displayName)),(s==null?void 0:s.isBrand)===!0?ie__default.createElement(Mn,{className:Je.postTitle__brandIcon}):null))},e0=({post:e,pageId:t,componentId:o,onImageClick:r,onVideoClick:i,onClipClick:n,goToPostDetail:a,disabledContent:s=!1})=>ie__default.createElement(ie__default.Fragment,null,ie__default.createElement(JH,{pageId:t,componentId:o,parentPost:e,posts:e.childrenPosts,disabled:s}),ie__default.createElement(uP,{pageId:t,componentId:o,posts:e.childrenPosts,onImageClick:r}),ie__default.createElement(gP,{pageId:t,componentId:o,posts:e.childrenPosts,onVideoClick:i}),ie__default.createElement(jP,{posts:e.childrenPosts,goToPostDetail:a,parentPost:e}),ie__default.createElement(fP,{pageId:t,componentId:o,posts:e.childrenPosts,onClipClick:n})),en=({pageId:e="*",post:t,onClick:o,onPostDeleted:r,category:i,hideMenu:n=!1,hideTarget:a=!1,style:s,disabledContent:l$1=!1,isGlobalFeaturePost:m=!1,className:c})=>{var Zt,Bt,so,lo,ve,$e,pe,Me;let d="post_content",{themeStyles:u,accessibilityId:g}=se({pageId:e,componentId:d}),{isDesktop:f}=le(),{openPopup:C,closePopup:y}=Se(),{confirm:b}=Te(),{setDrawerData:_,removeDrawerData:x}=tt(),{moderators:P}=Lo({communityId:t==null?void 0:t.targetId}),{mutateAddReactionAsync:I,mutateRemoveReactionAsync:w,reactionByMe:M,reactionsCount:T}=ky({post:t}),E=(P||[]).find(K=>K.userId===t.postedUserId)!=null,[N,A]=useState(!1),[D,G]=useState(null),{page:H,goToClipFeedPage:$}=Y(),j=useRef(null),O=useMemo(()=>(t==null?void 0:t.targetType)==="community",[t==null?void 0:t.targetType]),{community:z}=Ct({communityId:t==null?void 0:t.targetId,shouldCall:O}),{isCommunityModerator:k}=Ty({post:t,community:z}),F=K=>{M?w(M):I(K);},re=K=>{C({id:"image-viewer",disabledAnimation:!0,isDismissable:f,className:Je.postContent__imageViewer,overlayClassName:Je.postContent__imageViewerOverlay,children:ie__default.createElement($u,{post:t,onClose:W,initialImageIndex:K})});},W=()=>{y("image-viewer");},ne=K=>{A(!0),G(K);},te=()=>{A(!1),G(null);},Q=({onConfirm:K})=>{b({title:"Edit globally featured post?",content:"The post you're editing has been featured globally. If you edit your post, it will need to be re-approved and will no longer be globally featured.",cancelText:"Cancel",okText:"Edit",onOk:K});},ae=!(z!=null&&z.isJoined)&&(t==null?void 0:t.targetType)==="community",Ee=((Zt=t==null?void 0:t.reactions)==null?void 0:Zt.like)>0,J=((Bt=t==null?void 0:t.reactions)==null?void 0:Bt.love)>0,R=((so=t==null?void 0:t.reactions)==null?void 0:so.fire)>0,be=((lo=t==null?void 0:t.reactions)==null?void 0:lo.happy)>0,xe=((ve=t==null?void 0:t.reactions)==null?void 0:ve.crying)>0,Xe=Ee||J||R||be||xe,Qe=!E&&m&&((z==null?void 0:z.needApprovalOnPostCreation)||(z==null?void 0:z.postSetting)==="ADMIN_REVIEW_POST_REQUIRED"),{isVisible:ht}=YO({threshold:.6,elementRef:j});return useEffect(()=>{var K;H.type!=="PostDetailPage"&&ht&&((K=t.analytics)==null||K.markAsViewed());},[t,ht,H.type]),ie__default.createElement("div",{"data-testid":g,ref:j,className:wl(Je.postContent,c),style:u},(i==="announcement"||i==="pin_and_announcement")&&ie__default.createElement(AP,{pageId:e,componentId:d}),ie__default.createElement("div",{className:Je.postContent__bar,"data-type":s},ie__default.createElement("div",{className:Je.postContent__bar__userAvatar},ie__default.createElement(Ae,{pageId:e,componentId:d,userId:t==null?void 0:t.postedUserId})),ie__default.createElement("div",{className:Je.postContent__bar__detail},ie__default.createElement("div",null,ie__default.createElement(e7e,{post:t,hideTarget:a,pageId:e,componentId:d})),ie__default.createElement("div",{className:Je.postContent__bar__information__subtitle},k?ie__default.createElement("div",{className:Je.postContent__bar__information__subtitle__moderator},ie__default.createElement(_m,{pageId:e,componentId:d}),ie__default.createElement("span",{className:Je.postContent__bar__information__subtitle__separator},"\u2022")):null,ie__default.createElement(gi,{timestamp:t.createdAt}),t.createdAt!==t.editedAt&&ie__default.createElement(v.Caption,{"data-testid":`${e}/${d}/post_edited_text`,className:Je.postContent__bar__information__editedTag},"(edited)"))),ie__default.createElement("div",{className:Je.postContent__wrapRightMenu},(i==="pin"||i==="pin_and_announcement")&&ie__default.createElement(FP,{pageId:e,componentId:d}),s==="feed"&&ie__default.createElement(ft,{containerClassName:Je.postContent__bar__actionButton,trigger:{pageId:e,componentId:d,onClick:({closePopover:K})=>_({content:ie__default.createElement(Ru,{post:t,pageId:e,componentId:d,onPostDeleted:r,onConfirmEditPost:Qe?({onConfirm:Ce})=>{K(),x(),Q({onConfirm:Ce});}:void 0,onCloseMenu:()=>{K(),x();}})})}},({closePopover:K})=>ie__default.createElement(Ru,{post:t,pageId:e,componentId:d,onPostDeleted:r,onConfirmEditPost:Qe?({onConfirm:Ce})=>{K(),x(),Q({onConfirm:Ce});}:void 0,onCloseMenu:()=>{K(),x();}})))),ie__default.createElement("div",{className:Je.postContent__content_and_reactions},ie__default.createElement("div",{className:Je.postContent__content},ie__default.createElement(Gc,{pageId:e,componentId:d,text:E1(t)?($e=t==null?void 0:t.data)==null?void 0:$e.text:"",mentioned:(pe=t==null?void 0:t.metadata)==null?void 0:pe.mentioned,mentionees:t==null?void 0:t.mentionees,post:t}),((Me=t.childrenPosts)==null?void 0:Me.length)>0?ie__default.createElement(e0,{pageId:e,componentId:d,post:t,onImageClick:re,onVideoClick:ne,onClipClick:()=>{f?ne(0):$==null||$({currentPostId:t.children[0]});},goToPostDetail:o,disabledContent:ae||l$1}):null),s==="detail"?ie__default.createElement("div",{className:Je.postContent__reactions_and_comments},ie__default.createElement("div",{className:Je.postContent__reactionsBar,onClick:()=>{let K=ie__default.createElement(ll,{pageId:e,referenceId:t.postId,referenceType:"post"});f?C({view:"desktop",children:K}):_({content:K});}},Xe?ie__default.createElement("div",{className:Je.postContent__reactionsBar__reactions},xe&&ie__default.createElement(XH,{className:Je.postContent__reactionsBar__reactions__icon}),be&&ie__default.createElement(RH,{className:Je.postContent__reactionsBar__reactions__icon}),R&&ie__default.createElement(eO,{className:Je.postContent__reactionsBar__reactions__icon}),J&&ie__default.createElement(tO,{className:Je.postContent__reactionsBar__reactions__icon}),Ee&&ie__default.createElement(oO,{className:Je.postContent__reactionsBar__reactions__icon})):null,ie__default.createElement(v.Caption,{"data-testid":`${e}/${d}/like_count`,className:Je.postContent__reactionsBar__reactions__count},`${fA((t==null?void 0:t.reactionsCount)||0)} ${(t==null?void 0:t.reactionsCount)===1?"like":"likes"}`)),ie__default.createElement(v.Caption,{"data-testid":`${e}/${d}/comment_count`,className:Je.postContent__commentsCount},`${(t==null?void 0:t.commentsCount)||0} ${(t==null?void 0:t.commentsCount)===1?"comment":"comments"}`)):null,ae&&H.type!=="PostDetailPage"?ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("div",{className:Je.postContent__divider}),ie__default.createElement(v.Body,{className:Je.postContent__notMember},"Join community to interact with all posts")):z&&!(z!=null&&z.isJoined)&&H.type==="PostDetailPage"?null:ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("div",{className:Je.postContent__divider}),ie__default.createElement("div",{className:Je.postContent__reactionBar},ie__default.createElement("div",{className:Je.postContent__reactionBar__leftPane},ie__default.createElement(V1,{pageId:e,componentId:d,reactionsCount:s==="feed"?T:void 0,myReaction:M,defaultIconClassName:Je.postContent__reactionBar__leftPane__icon,imgIconClassName:Je.postContent__reactionBar__leftPane__iconImg,onReactionClick:F}),ie__default.createElement(Dg,{pageId:e,componentId:d,commentsCount:s==="feed"?t.commentsCount:void 0,buttonClassName:Je.postContent__reactionBar__leftPane__commentButton,defaultIconClassName:Je.postContent__reactionBar__leftPane__icon,imgIconClassName:Je.postContent__reactionBar__leftPane__iconImg,onPress:()=>o==null?void 0:o()})),ie__default.createElement("div",{className:Je.postContent__reactionBar__rightPane},ie__default.createElement(oP,{pageId:e,componentId:d}))))),N&&typeof D=="number"?ie__default.createElement(Zu,{post:t,onClose:te,initialVideoIndex:D}):null)};var gr={postContentSkeleton:"qt",postContentSkeleton__bar:"mx",postContentSkeleton__bar__information:"hx",postContentSkeleton__content:"gx",postContentSkeleton__animation:"px","skeleton-pulse":"Dt",postContentSkeleton__bar__userAvatar:"bx",postContentSkeleton__bar__information__title:"ux",postContentSkeleton__bar__information__subtitle:"fx",postContentSkeleton__content__bar1:"vx",postContentSkeleton__content__bar2:"wx",postContentSkeleton__content__bar3:"xx"};var Rg=({pageId:e="*"})=>{let t="post_content",{accessibilityId:o,config:r,defaultConfig:i,isExcluded:n,uiReference:a,themeStyles:s}=se({pageId:e,componentId:t});return ie__default.createElement("div",{"data-testid":o,style:s,className:wl(gr.postContentSkeleton,gr.postContentSkeleton__animation)},ie__default.createElement("div",{className:wl(gr.postContentSkeleton__bar,gr.postContentSkeleton__animation)},ie__default.createElement("div",{className:wl(gr.postContentSkeleton__bar__userAvatar,gr.postContentSkeleton__animation)}),ie__default.createElement("div",{className:wl(gr.postContentSkeleton__bar__information,gr.postContentSkeleton__animation)},ie__default.createElement("div",{className:wl(gr.postContentSkeleton__bar__information__title,gr.postContentSkeleton__animation)}),ie__default.createElement("div",{className:wl(gr.postContentSkeleton__bar__information__subtitle,gr.postContentSkeleton__animation)}))),ie__default.createElement("div",{className:wl(gr.postContentSkeleton__content,gr.postContentSkeleton__animation)},ie__default.createElement("div",{className:wl(gr.postContentSkeleton__content__bar1,gr.postContentSkeleton__animation)}),ie__default.createElement("div",{className:wl(gr.postContentSkeleton__content__bar2,gr.postContentSkeleton__animation)}),ie__default.createElement("div",{className:wl(gr.postContentSkeleton__content__bar3,gr.postContentSkeleton__animation)})))};function hs({queryParams:e,shouldCall:t=!0}){let i=it({fetcher:CommunityRepository.getCommunities,params:e,shouldCall:t}),{items:o}=i,r=d(i,["items"]);return a({communities:o},r)}var dz={myCommunitiesList:"yx"};var By=({pageId:e="*"})=>{let t="my_communities",{themeStyles:o}=se({pageId:e,componentId:t}),{communities:r,hasMore:i,loadMore:n,isLoading:a}=hs({queryParams:{limit:20,membership:"member"}});return ie__default.createElement("div",{style:o,className:dz.myCommunitiesList},ie__default.createElement(od,{pageId:e,communityCollection:r,isLoading:a,onLoadMore:()=>{i&&a===!1&&n();}}))};var i7e=()=>ie__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"161",height:"161",viewBox:"0 0 161 161",fill:"none"},ie__default.createElement("path",{d:"M130.1 24.5H34.0996C29.6813 24.5 26.0996 28.0817 26.0996 32.5V128.5C26.0996 132.918 29.6813 136.5 34.0996 136.5H130.1C134.518 136.5 138.1 132.918 138.1 128.5V32.5C138.1 28.0817 134.518 24.5 130.1 24.5Z",fill:"#292B32"}),ie__default.createElement("path",{d:"M43.7002 68.2H44.2002H151.7C152.628 68.2 153.519 68.5688 154.175 69.2251C154.831 69.8815 155.2 70.7718 155.2 71.7V91.7C155.2 92.6283 154.831 93.5185 154.175 94.1749C153.519 94.8313 152.628 95.2 151.7 95.2H43.7002C42.7719 95.2 41.8817 94.8313 41.2253 94.1749C40.5689 93.5185 40.2002 92.6283 40.2002 91.7V71.7C40.2002 70.7718 40.5689 69.8815 41.2253 69.2251C41.8817 68.5688 42.7719 68.2 43.7002 68.2Z",fill:"#292B32",stroke:"#40434E"}),ie__default.createElement("path",{opacity:"0.3",d:"M90.9002 74.1H70.1002C68.7747 74.1 67.7002 75.1745 67.7002 76.5C67.7002 77.8255 68.7747 78.9 70.1002 78.9H90.9002C92.2257 78.9 93.3002 77.8255 93.3002 76.5C93.3002 75.1745 92.2257 74.1 90.9002 74.1Z",fill:"#40434E"}),ie__default.createElement("path",{opacity:"0.15",d:"M105.3 84.5H70.1002C68.7747 84.5 67.7002 85.5745 67.7002 86.9C67.7002 88.2255 68.7747 89.3 70.1002 89.3H105.3C106.626 89.3 107.7 88.2255 107.7 86.9C107.7 85.5745 106.626 84.5 105.3 84.5Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M53.6996 89.3C57.897 89.3 61.2996 85.8974 61.2996 81.7C61.2996 77.5027 57.897 74.1 53.6996 74.1C49.5022 74.1 46.0996 77.5027 46.0996 81.7C46.0996 85.8974 49.5022 89.3 53.6996 89.3Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M9.2998 102.6H9.7998H117.3C118.228 102.6 119.118 102.969 119.775 103.625C120.431 104.282 120.8 105.172 120.8 106.1V126.1C120.8 127.028 120.431 127.919 119.775 128.575C119.118 129.231 118.228 129.6 117.3 129.6H9.2998C8.37155 129.6 7.48131 129.231 6.82493 128.575C6.16855 127.919 5.7998 127.028 5.7998 126.1V106.1C5.7998 105.172 6.16855 104.282 6.82493 103.625C7.48131 102.969 8.37155 102.6 9.2998 102.6Z",fill:"#292B32",stroke:"#40434E"}),ie__default.createElement("path",{opacity:"0.3",d:"M56.4998 108.5H35.6998C34.3743 108.5 33.2998 109.575 33.2998 110.9C33.2998 112.225 34.3743 113.3 35.6998 113.3H56.4998C57.8253 113.3 58.8998 112.225 58.8998 110.9C58.8998 109.575 57.8253 108.5 56.4998 108.5Z",fill:"#40434E"}),ie__default.createElement("path",{opacity:"0.15",d:"M70.8998 118.9H35.6998C34.3743 118.9 33.2998 119.975 33.2998 121.3C33.2998 122.626 34.3743 123.7 35.6998 123.7H70.8998C72.2253 123.7 73.2998 122.626 73.2998 121.3C73.2998 119.975 72.2253 118.9 70.8998 118.9Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M19.3002 123.7C23.4976 123.7 26.9002 120.297 26.9002 116.1C26.9002 111.903 23.4976 108.5 19.3002 108.5C15.1028 108.5 11.7002 111.903 11.7002 116.1C11.7002 120.297 15.1028 123.7 19.3002 123.7Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M9.2998 33.8H117.3C119.233 33.8 120.8 35.367 120.8 37.3V57.3C120.8 59.233 119.233 60.8 117.3 60.8H9.2998C7.36681 60.8 5.7998 59.233 5.7998 57.3V37.3C5.7998 35.367 7.36681 33.8 9.2998 33.8Z",fill:"#292B32",stroke:"#40434E"}),ie__default.createElement("path",{opacity:"0.3",d:"M54.8992 39.7H34.0992C32.7737 39.7 31.6992 40.7745 31.6992 42.1C31.6992 43.4255 32.7737 44.5 34.0992 44.5H54.8992C56.2247 44.5 57.2992 43.4255 57.2992 42.1C57.2992 40.7745 56.2247 39.7 54.8992 39.7Z",fill:"#40434E"}),ie__default.createElement("path",{opacity:"0.15",d:"M69.2992 50.1H34.0992C32.7737 50.1 31.6992 51.1745 31.6992 52.5C31.6992 53.8255 32.7737 54.9 34.0992 54.9H69.2992C70.6247 54.9 71.6992 53.8255 71.6992 52.5C71.6992 51.1745 70.6247 50.1 69.2992 50.1Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M19.3002 54.9C23.4976 54.9 26.9002 51.4974 26.9002 47.3C26.9002 43.1026 23.4976 39.7 19.3002 39.7C15.1028 39.7 11.7002 43.1026 11.7002 47.3C11.7002 51.4974 15.1028 54.9 19.3002 54.9Z",fill:"#40434E"})),n7e=()=>ie__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"161",height:"160",viewBox:"0 0 161 160",fill:"none"},ie__default.createElement("path",{d:"M130.452 24H34.4521C30.0339 24 26.4521 27.5817 26.4521 32V128C26.4521 132.418 30.0339 136 34.4521 136H130.452C134.87 136 138.452 132.418 138.452 128V32C138.452 27.5817 134.87 24 130.452 24Z",fill:"#EBECEF"}),ie__default.createElement("path",{d:"M44.0522 67.7H44.5522H152.052C152.981 67.7 153.871 68.0688 154.527 68.7251C155.184 69.3815 155.552 70.2718 155.552 71.2V91.2C155.552 92.1283 155.184 93.0185 154.527 93.6749C153.871 94.3313 152.981 94.7 152.052 94.7H44.0522C43.124 94.7 42.2337 94.3313 41.5774 93.6749C40.921 93.0185 40.5522 92.1283 40.5522 91.2V71.2C40.5522 70.2718 40.921 69.3815 41.5774 68.7251C42.2337 68.0688 43.124 67.7 44.0522 67.7Z",fill:"white",stroke:"#EBECEF"}),ie__default.createElement("path",{opacity:"0.3",d:"M91.2523 73.6H70.4522C69.1268 73.6 68.0522 74.6745 68.0522 76C68.0522 77.3255 69.1268 78.4 70.4522 78.4H91.2523C92.5777 78.4 93.6523 77.3255 93.6523 76C93.6523 74.6745 92.5777 73.6 91.2523 73.6Z",fill:"#A5A9B5"}),ie__default.createElement("path",{opacity:"0.15",d:"M105.652 84H70.4522C69.1268 84 68.0522 85.0745 68.0522 86.4C68.0522 87.7255 69.1268 88.8 70.4522 88.8H105.652C106.978 88.8 108.052 87.7255 108.052 86.4C108.052 85.0745 106.978 84 105.652 84Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M54.0521 88.8C58.2495 88.8 61.6521 85.3974 61.6521 81.2C61.6521 77.0027 58.2495 73.6 54.0521 73.6C49.8548 73.6 46.4521 77.0027 46.4521 81.2C46.4521 85.3974 49.8548 88.8 54.0521 88.8Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M9.65234 102.1H10.1523H117.652C118.581 102.1 119.471 102.469 120.127 103.125C120.784 103.782 121.152 104.672 121.152 105.6V125.6C121.152 126.528 120.784 127.419 120.127 128.075C119.471 128.731 118.581 129.1 117.652 129.1H9.65234C8.72409 129.1 7.83385 128.731 7.17747 128.075C6.52109 127.419 6.15234 126.528 6.15234 125.6V105.6C6.15234 104.672 6.52109 103.782 7.17747 103.125C7.83385 102.469 8.72409 102.1 9.65234 102.1Z",fill:"white",stroke:"#EBECEF"}),ie__default.createElement("path",{opacity:"0.3",d:"M56.8523 108H36.0523C34.7269 108 33.6523 109.075 33.6523 110.4C33.6523 111.725 34.7269 112.8 36.0523 112.8H56.8523C58.1778 112.8 59.2523 111.725 59.2523 110.4C59.2523 109.075 58.1778 108 56.8523 108Z",fill:"#A5A9B5"}),ie__default.createElement("path",{opacity:"0.15",d:"M71.2523 118.4H36.0523C34.7269 118.4 33.6523 119.475 33.6523 120.8C33.6523 122.126 34.7269 123.2 36.0523 123.2H71.2523C72.5778 123.2 73.6523 122.126 73.6523 120.8C73.6523 119.475 72.5778 118.4 71.2523 118.4Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M19.6522 123.2C23.8496 123.2 27.2522 119.797 27.2522 115.6C27.2522 111.403 23.8496 108 19.6522 108C15.4549 108 12.0522 111.403 12.0522 115.6C12.0522 119.797 15.4549 123.2 19.6522 123.2Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M9.65234 33.3H117.652C119.585 33.3 121.152 34.867 121.152 36.8V56.8C121.152 58.733 119.585 60.3 117.652 60.3H9.65234C7.71935 60.3 6.15234 58.733 6.15234 56.8V36.8C6.15234 34.867 7.71935 33.3 9.65234 33.3Z",fill:"white",stroke:"#EBECEF"}),ie__default.createElement("path",{opacity:"0.3",d:"M55.2522 39.2H34.4522C33.1268 39.2 32.0522 40.2745 32.0522 41.6C32.0522 42.9255 33.1268 44 34.4522 44H55.2522C56.5777 44 57.6522 42.9255 57.6522 41.6C57.6522 40.2745 56.5777 39.2 55.2522 39.2Z",fill:"#A5A9B5"}),ie__default.createElement("path",{opacity:"0.15",d:"M69.6522 49.6H34.4522C33.1268 49.6 32.0522 50.6745 32.0522 52C32.0522 53.3255 33.1268 54.4 34.4522 54.4H69.6522C70.9777 54.4 72.0522 53.3255 72.0522 52C72.0522 50.6745 70.9777 49.6 69.6522 49.6Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M19.6522 54.4C23.8496 54.4 27.2522 50.9974 27.2522 46.8C27.2522 42.6026 23.8496 39.2 19.6522 39.2C15.4549 39.2 12.0522 42.6026 12.0522 46.8C12.0522 50.9974 15.4549 54.4 19.6522 54.4Z",fill:"#A5A9B5"})),WP=({pageId:e="*",componentId:t="*"})=>{let o="illustration",{currentTheme:r,accessibilityId:i,config:n,defaultConfig:a,isExcluded:s,uiReference:l,themeStyles:m}=S({pageId:e,componentId:t,elementId:o});return s?null:ie__default.createElement(Z,{defaultIconName:a.icon,configIconName:n.icon,imgIcon:()=>ie__default.createElement("img",{src:n.icon,alt:l,"data-testid":i}),defaultIcon:()=>ie__default.createElement("div",{"data-testid":i},r==="light"?ie__default.createElement(n7e,null):ie__default.createElement(i7e,null))})};var pz={description:"kx"};function Qc({pageId:e="*",componentId:t="*"}){let o="description",{accessibilityId:r,config:i,defaultConfig:n,isExcluded:a,uiReference:s,themeStyles:l}=S({pageId:e,componentId:t,elementId:o});return a?null:ie__default.createElement(v.Caption,{className:pz.description,style:l,"data-testid":r},i.text)}var Ey={exploreCommunitiesButton:"jx",exploreCommunitiesButton__icon:"zx",exploreCommunitiesButton__text:"Xx"};var d7e=e=>ie__default.createElement("svg",a({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M7.85254 0.25C12.1338 0.25 15.6025 3.71875 15.6025 8C15.6025 12.2812 12.1338 15.75 7.85254 15.75C3.57129 15.75 0.102539 12.2812 0.102539 8C0.102539 3.71875 3.57129 0.25 7.85254 0.25ZM13.4463 5.25C12.79 3.9375 11.6963 2.90625 10.3525 2.3125C10.79 3.125 11.1338 4.125 11.3525 5.25H13.4463ZM7.85254 1.75C7.25879 1.75 6.32129 3.0625 5.85254 5.25H9.82129C9.35254 3.0625 8.41504 1.75 7.85254 1.75ZM1.60254 8C1.60254 8.4375 1.63379 8.875 1.72754 9.25H4.13379C4.10254 8.84375 4.10254 8.4375 4.10254 8C4.10254 7.59375 4.10254 7.1875 4.13379 6.75H1.72754C1.63379 7.15625 1.60254 7.59375 1.60254 8ZM2.22754 10.75C2.88379 12.0625 3.97754 13.125 5.32129 13.7188C4.88379 12.9062 4.54004 11.9062 4.32129 10.75H2.22754ZM4.32129 5.25C4.54004 4.125 4.88379 3.125 5.32129 2.3125C3.97754 2.90625 2.88379 3.9375 2.22754 5.25H4.32129ZM7.85254 14.25C8.41504 14.25 9.35254 12.9688 9.82129 10.75H5.85254C6.32129 12.9688 7.25879 14.25 7.85254 14.25ZM10.04 9.25C10.0713 8.875 10.1025 8.4375 10.1025 8C10.1025 7.5625 10.0713 7.15625 10.04 6.75H5.63379C5.60254 7.15625 5.60254 7.5625 5.60254 8C5.60254 8.4375 5.60254 8.875 5.63379 9.25H10.04ZM10.3525 13.7188C11.6963 13.125 12.79 12.0625 13.4463 10.75H11.3525C11.1338 11.9062 10.79 12.9062 10.3525 13.7188ZM11.54 9.25H13.9775C14.04 8.875 14.1025 8.4375 14.1025 8C14.1025 7.59375 14.04 7.15625 13.9775 6.75H11.54C11.5713 7.1875 11.6025 7.59375 11.6025 8C11.6025 8.4375 11.5713 8.84375 11.54 9.25Z"}));function tf({pageId:e="*",componentId:t="*",className:o,onClick:r}){let i="explore_communities_button",{accessibilityId:n,config:a,defaultConfig:s,isExcluded:l,uiReference:m,themeStyles:c}=S({pageId:e,componentId:t,elementId:i});return l?null:ie__default.createElement(oe,{className:wl(Ey.exploreCommunitiesButton,o),"data-testid":n,style:c,onPress:r},ie__default.createElement(d7e,{className:Ey.exploreCommunitiesButton__icon}),ie__default.createElement(v.BodyBold,{className:Ey.exploreCommunitiesButton__text},a.text))}var uz={createCommunityButton:"Yx"};function of({pageId:e="*",componentId:t="*",onClick:o,textClassName:r}){let i="create_community_button",{accessibilityId:n,config:a,defaultConfig:s,isExcluded:l,uiReference:m,themeStyles:c}=S({pageId:e,componentId:t,elementId:i});return l?null:ie__default.createElement("div",{className:uz.createCommunityButton,onClick:()=>o(),"data-testid":n,style:c},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(ie__default.Fragment,null),imgIcon:()=>ie__default.createElement("img",{src:a.icon,alt:m}),configIconName:a.icon,defaultIconName:s.icon}),ie__default.createElement(v.Body,{className:r},"Create Community"))}var qP={emptyNewsfeed:"Ix",emptyNewsfeed__text:"Ax"};function o0({pageId:e="*"}){let t="empty_newsfeed",{goToCreateCommunityPage:o}=Y(),{isExcluded:r,themeStyles:i,accessibilityId:n}=se({pageId:e,componentId:t});return r?null:ie__default.createElement("div",{className:qP.emptyNewsfeed,style:i,"data-testid":n},ie__default.createElement(WP,{pageId:e,componentId:t}),ie__default.createElement("div",{className:qP.emptyNewsfeed__text},ie__default.createElement(xt,{pageId:e,componentId:t}),ie__default.createElement(Qc,{pageId:e,componentId:t})),ie__default.createElement(tf,{pageId:e,componentId:t}),ie__default.createElement(of,{pageId:e,componentId:t,onClick:()=>o==null?void 0:o({mode:"create"})}))}var Or={container:"Gt",innerContainer:"Jt",header:"Mx",header__title:"Sx",header__avatar:"Cx",header__detail:"Ex",content__text:"Rx",content__imageContainer:"Ux",content__image:"Bx",footer:"_e",footer__content__description:"Fx",footer__content__headline:"Hx",footer__left:"Kt",footer__right:"Lx",footer__content__button:"Tx",footer__content__button__text:"Vx",infoIcon__button:"Wx",infoIcon:"qx"};var fz=({ad:e,avatarUrl:t,adImageUrl:o,themeStyles:r,onCallToActionClick:i})=>{var l;let[n,a]=useState(!1),s=()=>{i==null||i(e.callToActionUrl);};return ie__default.createElement("div",{className:Or.container,style:r},ie__default.createElement("div",{className:Or.innerContainer},ie__default.createElement("div",{className:Or.header},ie__default.createElement("div",{className:Or.header__avatar},ie__default.createElement(ho,{avatarUrl:t,defaultImage:ie__default.createElement(Tu,null)})),ie__default.createElement("div",{className:Or.header__detail},ie__default.createElement(v.BodyBold,{className:Or.header__title},(l=e.advertiser)==null?void 0:l.name),ie__default.createElement(wu,null))),ie__default.createElement("div",null,e.body&&ie__default.createElement(v.Body,{className:Or.content__text},e.body),ie__default.createElement("div",{className:Or.content__imageContainer},ie__default.createElement("img",{className:Or.content__image,src:o})))),ie__default.createElement(V,{className:Or.infoIcon__button,onPress:()=>a(!0)},ie__default.createElement(Ta,{className:Or.infoIcon})),ie__default.createElement(V,{className:Or.footer,"data-has-url":!!e.callToActionUrl,onPress:s},ie__default.createElement("div",{className:Or.footer__left},ie__default.createElement(v.CaptionSmall,{className:Or.footer__content__description},ie__default.createElement(RE,{lines:1},ie__default.createElement("div",null,e.description))),ie__default.createElement(v.CaptionBold,{className:Or.footer__content__headline},ie__default.createElement(RE,{lines:2},ie__default.createElement("div",null,e.headline)))),e.callToActionUrl?ie__default.createElement("div",{className:Or.footer__right},ie__default.createElement(V,{className:Or.footer__content__button,onPress:s},ie__default.createElement(v.CaptionBold,{className:Or.footer__content__button__text},e.callToAction))):null),ie__default.createElement(E8,{ad:e,isOpen:n,onOpenChange:m=>a(m)}))};var yz=({pageId:e="*",ad:t})=>{var m,c,d,u,g,f;let o="post_content",{themeStyles:r}=se({pageId:e,componentId:o}),n=rt({fileId:(c=(m=t.advertiser)==null?void 0:m.avatar)==null?void 0:c.fileId})||((u=(d=t.advertiser)==null?void 0:d.avatar)==null?void 0:u.fileUrl)||"",s=rt({fileId:(g=t.image1_1)==null?void 0:g.fileId})||((f=t.image1_1)==null?void 0:f.fileUrl)||"";return ie__default.createElement(fz,{themeStyles:r,avatarUrl:n,adImageUrl:s,ad:t,onCallToActionClick:C=>{window==null||window.open(C,"_blank");}})};var hz={clickableArea:"Dx"};function Ay(r){var i=r,{className:e,style:t}=i,o=d(i,["className","style"]);let{children:n}=o,a$1=useRef(null),{buttonProps:s}=useButton(o,a$1);return createElement(o.elementType,b(a({},s),{className:wl(hz.clickableArea,e),ref:a$1,style:t}),n)}var rf={global_feed:"Gx",global_feed__postContainer:"Nt",global_feed__pullToRefresh:"Jx",global_feed__post__reactionBar__leftPane__icon:"Kx",global_feed__post__reactionBar__leftPane__iconImg:"Nx",global_feed__pullToRefresh__spinner:"Ox",spin:"Ot",global_feed__post__reactionBar:"Px",global_feed__post__reactionBar__leftPane:"Qx",global_feed__post__reactionBar__rightPane:"Zx",global_feed__intersection:"_x",global_feed__commentContainer:"ey"};var YP={divider:"X",divider__alphabet:"ry"};function zr({isShown:e=!0,type:t="post",className:o,alphabet:r}){return e?ie__default.createElement("div",{className:wl(YP.divider,o),"data-type":t},r&&ie__default.createElement(v.BodyBold,{className:YP.divider__alphabet},r)):null}var Ly=e=>(e==null?void 0:e.adId)!==void 0,Vy=({pageId:e="*",componentId:t="*",items:o,isLoading:r,globalFeaturedPosts:i,isGlobalFeaturedPostsLoading:n,onFeedReachBottom:a,onPostDeleted:s})=>{let{accessibilityId:l,themeStyles:m}=se({pageId:e,componentId:t}),[c,d]=useState(null),{AmityGlobalFeedComponentBehavior:u}=we();if(ke({node:c,onIntersect:()=>{a();}}),!r&&o.length===0&&!n&&(i==null?void 0:i.length)===0)return ie__default.createElement(o0,{pageId:e});let g=(y,b)=>{if(Ly(y)){if(b&&Ly(b))return `${b.adId}-${y.adId}`;if(b)return `${b.postId}-${y.adId}`}else return y.postId},f=new Set((i==null?void 0:i.map(y=>{var b;return (b=y.post)==null?void 0:b.postId}))||[]),C=o.filter(y=>Ly(y)?!0:!f.has(y.postId));return ie__default.createElement("div",{className:rf.global_feed,style:m,"data-testid":l},i&&i.map(y=>y.post?ie__default.createElement(ie__default.Fragment,{key:y.post.postId},ie__default.createElement(Ay,{elementType:"div",className:rf.global_feed__postContainer,onPress:()=>{var b,_;return (_=u==null?void 0:u.goToPostDetailPage)==null?void 0:_.call(u,{hideTarget:!0,postId:(b=y.post)==null?void 0:b.postId,category:"announcement"})}},ie__default.createElement(en,{pageId:e,post:y.post,category:"announcement",style:"feed",isGlobalFeaturePost:!0,onPostDeleted:()=>s==null?void 0:s(y.post),onClick:()=>{var b,_;(_=u==null?void 0:u.goToPostDetailPage)==null||_.call(u,{hideTarget:!0,postId:(b=y.post)==null?void 0:b.postId,category:"announcement"});}})),ie__default.createElement(zr,null)):null),C.map((y,b)=>ie__default.createElement(ie__default.Fragment,{key:g(y,C[Math.max(0,b-1)])},ie__default.createElement(zr,{isShown:b!==0}),Ly(y)?ie__default.createElement(yz,{ad:y}):ie__default.createElement(Ay,{elementType:"div",className:rf.global_feed__postContainer,onPress:()=>{var _;return (_=u==null?void 0:u.goToPostDetailPage)==null?void 0:_.call(u,{postId:y.postId})}},ie__default.createElement(en,{pageId:e,post:y,category:"general",style:"feed",onClick:()=>{var _;(_=u==null?void 0:u.goToPostDetailPage)==null||_.call(u,{postId:y.postId});},onPostDeleted:s})))),ie__default.createElement(zr,{isShown:C.length>0}),r?Array.from({length:5}).map((y,b)=>ie__default.createElement("div",{key:b},ie__default.createElement(Rg,null),ie__default.createElement(zr,{isShown:b!==5}))):null,!r&&ie__default.createElement("div",{ref:y=>d(y),className:rf.global_feed__intersection}))};var vz=({props:e,className:t})=>ie__default.createElement("div",{className:t},ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 21 20",fill:"none"},e),ie__default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.1122 5C11.1122 5.39449 10.7924 5.71429 10.3979 5.71429C10.0035 5.71429 9.68366 5.39449 9.68366 5V0.714286C9.68366 0.319797 10.0035 0 10.3979 0C10.7924 0 11.1122 0.319797 11.1122 0.714286V5ZM8.25509 6.28846C8.59673 6.09122 8.71378 5.65437 8.51654 5.31273L6.37368 1.60119C6.17644 1.25955 5.73959 1.1425 5.39795 1.33975C5.05631 1.53699 4.93926 1.97384 5.1365 2.31548L7.27936 6.02702C7.4766 6.36865 7.91346 6.48571 8.25509 6.28846ZM6.42496 6.88141C6.7666 7.07865 6.88366 7.51551 6.68641 7.85714C6.48917 8.19878 6.05232 8.31583 5.71068 8.11859L1.99914 5.97573C1.6575 5.77849 1.54045 5.34164 1.7377 5C1.93494 4.65836 2.37179 4.54131 2.71343 4.73855L6.42496 6.88141ZM6.11224 10C6.11224 9.60551 5.79244 9.28571 5.39795 9.28571H1.11223C0.717746 9.28571 0.397949 9.60551 0.397949 10C0.397949 10.3945 0.717746 10.7143 1.11224 10.7143H5.39795C5.79244 10.7143 6.11224 10.3945 6.11224 10ZM5.71068 11.8814C6.05232 11.6842 6.48917 11.8012 6.68641 12.1429C6.88366 12.4845 6.7666 12.9213 6.42497 13.1186L2.71343 15.2614C2.37179 15.4587 1.93494 15.3416 1.7377 15C1.54045 14.6584 1.6575 14.2215 1.99914 14.0243L5.71068 11.8814ZM8.25509 13.7115C7.91345 13.5143 7.4766 13.6313 7.27936 13.973L5.1365 17.6845C4.93926 18.0262 5.05631 18.463 5.39795 18.6603C5.73959 18.8575 6.17644 18.7404 6.37368 18.3988L8.51654 14.6873C8.71378 14.3456 8.59673 13.9088 8.25509 13.7115ZM10.3979 14.2857C10.0035 14.2857 9.68366 14.6055 9.68366 15V19.2857C9.68366 19.6802 10.0035 20 10.3979 20C10.7924 20 11.1122 19.6802 11.1122 19.2857V15C11.1122 14.6055 10.7924 14.2857 10.3979 14.2857ZM12.5408 6.28846C12.8824 6.48571 13.3193 6.36865 13.5165 6.02702L15.6594 2.31548C15.8566 1.97384 15.7396 1.53699 15.3979 1.33975C15.0563 1.1425 14.6195 1.25956 14.4222 1.60119L12.2794 5.31273C12.0821 5.65437 12.1992 6.09122 12.5408 6.28846ZM15.0852 8.11859C14.7436 8.31583 14.3067 8.19878 14.1095 7.85714C13.9122 7.51551 14.0293 7.07866 14.3709 6.88141L18.0825 4.73855C18.4241 4.54131 18.861 4.65836 19.0582 5C19.2554 5.34164 19.1384 5.77849 18.7968 5.97573L15.0852 8.11859ZM14.6837 10C14.6837 10.3945 15.0035 10.7143 15.3979 10.7143H19.6837C20.0782 10.7143 20.3979 10.3945 20.3979 10C20.3979 9.60551 20.0782 9.28571 19.6837 9.28571H15.3979C15.0035 9.28571 14.6837 9.60551 14.6837 10ZM14.3709 13.1186C14.0293 12.9213 13.9122 12.4845 14.1095 12.1429C14.3067 11.8012 14.7436 11.6842 15.0852 11.8814L18.7968 14.0243C19.1384 14.2215 19.2554 14.6584 19.0582 15C18.861 15.3416 18.4241 15.4587 18.0825 15.2614L14.3709 13.1186ZM12.5408 13.7115C12.1992 13.9088 12.0821 14.3456 12.2794 14.6873L14.4222 18.3988C14.6195 18.7404 15.0563 18.8575 15.3979 18.6603C15.7396 18.463 15.8566 18.0262 15.6594 17.6845L13.5165 13.973C13.3193 13.6313 12.8824 13.5143 12.5408 13.7115Z",fill:"url(#paint0_angular_1709_10374)"}),ie__default.createElement("defs",null,ie__default.createElement("radialGradient",{id:"paint0_angular_1709_10374",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(10.3979 10) scale(10)"},ie__default.createElement("stop",{offset:"0.669733",stopColor:"#595F67"}),ie__default.createElement("stop",{offset:"0.716307",stopColor:"#262626",stopOpacity:"0.01"})))));var QP={pullToRefresh:"ay",pullToRefresh__spinner:"oy",spin:"Pt"};var Tl=forwardRef(function({style:e,children:t,className:o,accessibilityId:r,onScroll:i,onTouchEndCallback:n},a){let s=useRef(0),[l,m]=useState(0);return ie__default.createElement("div",{ref:a,style:e,className:o,"data-testid":r,onDrag:c=>c.stopPropagation(),onTouchStart:c=>{s.current=c.touches[0].clientY;},onTouchMove:c=>{let d=c.touches[0].clientY;s.current>d||m(Math.min(d-s.current,100));},onTouchEnd:()=>{s.current=0,l>=75&&(n==null||n()),m(0);},onScroll:i},ie__default.createElement("div",{className:QP.pullToRefresh,style:{"--asc-pull-to-refresh-height":`${l}px`}},ie__default.createElement(vz,{className:QP.pullToRefresh__spinner})),t)});var Uy={pollButton:"er",pollButton__icon:"ty",pollButton__input:"iy",pollButton__label:"Qt"};var _z=e=>ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none"},e),ie__default.createElement("path",{d:"M3.75 20.25V3.75",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),ie__default.createElement("path",{d:"M3.75 5.25H15.75V9.75",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),ie__default.createElement("path",{d:"M20.25 9.75H3.75V14.25H20.25V9.75Z",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),ie__default.createElement("path",{d:"M12.75 14.25V18.75H3.75",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}));function JP({onPress:e,pageId:t="*",componentId:o="*",imgIconClassName:r,defaultIconClassName:i}){let n="poll_button",{themeStyles:a,isExcluded:s,config:l,accessibilityId:m,uiReference:c,defaultConfig:d}=S({pageId:t,componentId:o,elementId:n});return s?null:ie__default.createElement(V,{style:a,className:Uy.pollButton,"data-testid":m,onPress:e},ie__default.createElement(Z,{configIconName:l.icon,defaultIconName:d.icon,imgIcon:()=>ie__default.createElement("img",{src:l.icon,alt:c,className:r}),defaultIcon:()=>ie__default.createElement(_z,{className:wl(Uy.pollButton__icon,i)})}),l.text&&ie__default.createElement(v.BodyBold,{className:Uy.pollButton__label},l.text))}var bz={storyButton:"sy"};var xz={sheetIcon:"dy"};var XP=({icon:e,className:t})=>ie__default.cloneElement(e,{className:wl(xz.sheetIcon,t)});var D7e=e=>ie__default.createElement("svg",a({fill:"none",width:"100%",height:"100%",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.725 15.8693C3.01048 16.543 3.36529 17.1702 3.78943 17.7509C4.02522 18.0737 4.49097 18.0895 4.77295 17.8061L5.22247 17.3543C5.46663 17.1089 5.48651 16.7218 5.29592 16.4329C5.02174 16.0171 4.78977 15.5739 4.6 15.103C4.40556 14.6206 4.25542 14.1181 4.14959 13.5956C4.08148 13.2593 3.79412 13.005 3.45104 13.005H2.75733C2.35178 13.005 2.03269 13.3557 2.10258 13.7552C2.23079 14.488 2.43826 15.1928 2.725 15.8693ZM2.75 8.13065C2.47847 8.80049 2.27092 9.49788 2.12735 10.2228C2.04682 10.6295 2.36816 10.995 2.78269 10.995H3.45104C3.79412 10.995 4.08148 10.7407 4.14959 10.4044C4.25542 9.88192 4.40556 9.37943 4.6 8.89699C4.78977 8.42614 5.02174 7.98285 5.29592 7.56714C5.48651 7.27817 5.46663 6.89109 5.22247 6.6457L4.77295 6.19392C4.49097 5.91052 4.02508 5.92622 3.79048 6.24992C3.36977 6.83043 3.02294 7.45734 2.75 8.13065ZM8.1125 21.2714C8.77792 21.5589 9.4735 21.7671 10.1993 21.896C10.5988 21.967 10.95 21.6477 10.95 21.2419V20.5881C10.95 20.2454 10.6961 19.9586 10.3608 19.8873C9.84547 19.7777 9.35435 19.6192 8.8875 19.4121C8.42514 19.2069 7.97791 18.9625 7.54584 18.6791C7.25662 18.4893 6.87013 18.5189 6.63049 18.7683L6.1689 19.2488C5.89002 19.5391 5.91904 20.0079 6.24969 20.2374C6.83185 20.6417 7.45279 20.9863 8.1125 21.2714ZM6.26063 3.75497C5.92576 3.98688 5.90038 4.46269 6.18769 4.75144L6.66819 5.23436C6.91418 5.48159 7.30486 5.502 7.59378 5.30667C8.00409 5.02926 8.4395 4.78968 8.9 4.58794C9.37605 4.37939 9.87893 4.22025 10.4086 4.11053C10.745 4.04085 11 3.75361 11 3.4101V2.75564C11 2.3507 10.6503 2.03172 10.2511 2.09987C9.49795 2.22845 8.78508 2.43805 8.1125 2.72864C7.45692 3.0119 6.83963 3.35401 6.26063 3.75497ZM13.5869 19.8878C13.2524 19.9574 13 20.244 13 20.5856V21.234C13 21.6427 13.3559 21.9625 13.7581 21.8903C15.9912 21.4892 17.8802 20.437 19.425 18.7337C21.1417 16.8409 22 14.5963 22 12C22 9.40368 21.1417 7.15913 19.425 5.26633C17.8802 3.56303 15.9912 2.51082 13.7581 2.1097C13.3559 2.03745 13 2.35735 13 2.766V3.41436C13 3.75603 13.2524 4.0426 13.5869 4.1122C15.343 4.47761 16.8182 5.3397 18.0125 6.69849C19.3375 8.20603 20 9.9732 20 12C20 14.0268 19.3375 15.794 18.0125 17.3015C16.8182 18.6603 15.343 19.5224 13.5869 19.8878Z",fill:"currentColor"}),ie__default.createElement("path",{d:"M17.0625 11.375C17.2812 11.375 17.5 11.5938 17.5 11.8125V12.6875C17.5 12.9336 17.2812 13.125 17.0625 13.125H13.125V17.0625C13.125 17.3086 12.9062 17.5 12.6875 17.5H11.8125C11.5664 17.5 11.375 17.3086 11.375 17.0625V13.125H7.4375C7.19141 13.125 7 12.9336 7 12.6875V11.8125C7 11.5938 7.19141 11.375 7.4375 11.375H11.375V7.4375C11.375 7.21875 11.5664 7 11.8125 7H12.6875C12.9062 7 13.125 7.21875 13.125 7.4375V11.375H17.0625Z",fill:"currentColor"})),Pz=D7e;function eI({onPress:e,pageId:t="*",componentId:o="*",defaultIconClassName:r,imgIconClassName:i}){let n="story_button",{isExcluded:a,config:s,accessibilityId:l,uiReference:m,defaultConfig:c}=S({pageId:t,componentId:o,elementId:n});return a?null:ie__default.createElement(V,{"data-testid":l,className:bz.storyButton,onPress:e},ie__default.createElement(Z,{configIconName:s.icon,defaultIconName:c.icon,imgIcon:()=>ie__default.createElement("img",{src:s.icon,alt:m,className:i}),defaultIcon:()=>ie__default.createElement(XP,{className:r,icon:ie__default.createElement(Pz,null)})}))}var tI={myTimelineAvatar:"cy",myTimelineAvatar__userAvatar:"ly"};function r0({pageId:e="*",componentId:t="*",userId:o}){let r="my_timeline_avatar",{accessibilityId:i,isExcluded:n}=S({pageId:e,componentId:t,elementId:r});return n?null:ie__default.createElement("div",{className:tI.myTimelineAvatar,"data-testid":i},ie__default.createElement(Ae,{pageId:e,componentId:t,className:tI.myTimelineAvatar__userAvatar,userId:o}))}var wz={myTimelineText:"ny"};function i0({pageId:e="*",componentId:t="*"}){let o="my_timeline_text",{accessibilityId:r,config:i,isExcluded:n,themeStyles:a$1}=S({pageId:e,componentId:t,elementId:o});return n?null:ie__default.createElement(v.Body,{className:wz.myTimelineText,style:a({},a$1),"data-testid":r},i.text)}var jr={selectPostTargetPage:"Zt",selectPostTargetPage__topBar:"_t",selectPostTargetPage__timelineContainer:"ei",selectPostTargetPage__timeline:"ri",selectPostTargetPage__line:"my",selectPostTargetPage__myCommunities:"hy",selectPostTargetPage__communityAvatar:"gy",selectPostTargetPage__communityName:"py",selectPostTargetPage__closeButton:"by",selectPostTargetPage__title:"uy",selectPostTargetPage__displayName:"fy",selectPostTargetPage__myCommunitiesList:"vy"};function Bm({isClipPost:e=!1}){let t="select_post_target_page",{onBack:o}=Y(),{isDesktop:r}=le(),{confirm:i}=Te(),{client:n,currentUserId:a}=Ne(),{themeStyles:s}=ue({pageId:t}),{openPopup:l,closePopup:m}=Se(),{user:c}=qe({userId:a}),{AmityPostTargetSelectionPage:d}=we(),[u,g]=useState(null),{communities:f,hasMore:C,loadMore:y,isLoading:b}=hs({queryParams:{limit:20,membership:"member"}}),{file:_,setFile:x}=Pl(),[P,I]=useState(null);return ke({node:u,onIntersect:()=>{C&&!b&&y();}}),useEffect(()=>{var w,M;_&&(P?(w=d==null?void 0:d.goToDraftClipPage)==null||w.call(d,{targetId:P.communityId,targetType:"community",community:f.find(T=>T.communityId===P.communityId)}):(M=d==null?void 0:d.goToDraftClipPage)==null||M.call(d,{targetId:null,targetType:"user"}));},[_,P]),ie__default.createElement("div",{className:jr.selectPostTargetPage,style:s},ie__default.createElement("div",{className:jr.selectPostTargetPage__topBar},ie__default.createElement(ot,{pageId:t,onPress:()=>o(),imgClassName:jr.selectPostTargetPage__closeButton}),ie__default.createElement(xt,{pageId:t,titleClassName:jr.selectPostTargetPage__title}),ie__default.createElement("div",null)),ie__default.createElement("div",{className:jr.selectPostTargetPage__timelineContainer},e?ie__default.createElement(FileTrigger,{acceptedFileTypes:["video/*"],onSelect:w=>{if(w){let M=Array.from(w);M.length>0&&(I(null),x(M[0]));}}},ie__default.createElement(V,{className:jr.selectPostTargetPage__timeline,key:"timeline-button"},ie__default.createElement(r0,{pageId:t,userId:c==null?void 0:c.userId}),ie__default.createElement(i0,{pageId:t}))):ie__default.createElement(V,{className:jr.selectPostTargetPage__timeline,onPress:()=>{var w;r?l({pageId:t,view:"desktop",isDismissable:!1,onClose:()=>{i({type:"confirm",onOk:m,okText:"Discard",cancelText:"Keep editing",title:"Discard this post?",pageId:"post_composer_page",content:"The post will be permanently discarded. It cannot be undone."});},header:ie__default.createElement(Mo,{community:void 0,pageId:"post_composer_page",className:jr.selectPostTargetPage__displayName}),children:ie__default.createElement(ki,{targetId:null,targetType:"user",mode:"create",community:void 0})}):(w=d==null?void 0:d.goToPostComposerPage)==null||w.call(d,{mode:"create",targetId:null,targetType:"user",community:void 0});}},ie__default.createElement(r0,{pageId:t,userId:c==null?void 0:c.userId}),ie__default.createElement(i0,{pageId:t}))),ie__default.createElement("div",{className:jr.selectPostTargetPage__line}),ie__default.createElement("div",{className:jr.selectPostTargetPage__myCommunities},"My Communities"),ie__default.createElement("div",{className:jr.selectPostTargetPage__myCommunitiesList},f.filter(w=>Pm(n,w)).map(w=>e?ie__default.createElement(FileTrigger,{key:w.communityId,acceptedFileTypes:["video/*"],onSelect:M=>{if(M){let T=Array.from(M);T.length>0&&(I(w),x(T[0]));}}},ie__default.createElement(V,{className:jr.selectPostTargetPage__timeline},ie__default.createElement("div",{className:jr.selectPostTargetPage__communityAvatar},ie__default.createElement(ti,{pageId:t,community:w})),ie__default.createElement("div",{className:jr.selectPostTargetPage__communityName},!w.isPublic&&ie__default.createElement(ar,null),ie__default.createElement(Mo,{pageId:t,community:w}),w.isOfficial&&ie__default.createElement(sr,null)))):ie__default.createElement(V,{key:w.communityId,className:jr.selectPostTargetPage__timeline,onPress:()=>{var M;r?l({pageId:t,view:"desktop",isDismissable:!1,onClose:({close:T})=>{i({onOk:T,type:"confirm",okText:"Discard",cancelText:"Keep editing",title:"Discard this post?",pageId:"post_composer_page",content:"The post will be permanently discarded. It cannot be undone."});},header:ie__default.createElement(Mo,{community:w,pageId:"post_composer_page",className:jr.selectPostTargetPage__displayName}),children:ie__default.createElement(ki,{mode:"create",community:w,targetType:"community",targetId:w.communityId})}):(M=d==null?void 0:d.goToPostComposerPage)==null||M.call(d,{mode:"create",community:w,targetType:"community",targetId:w.communityId});}},ie__default.createElement("div",{className:jr.selectPostTargetPage__communityAvatar},ie__default.createElement(ti,{pageId:t,community:w})),ie__default.createElement("div",{className:jr.selectPostTargetPage__communityName},!w.isPublic&&ie__default.createElement(ar,null),ie__default.createElement(Mo,{pageId:t,community:w}),w.isOfficial&&ie__default.createElement(sr,null))))),ie__default.createElement("div",{ref:w=>g(w)}))}var Vn={pollTargetSelectionPage:"ai",pollTargetSelectionPage__topBar:"oi",pollTargetSelectionPage__timelineContainer:"ti",pollTargetSelectionPage__timeline:"ii",pollTargetSelectionPage__line:"wy",pollTargetSelectionPage__myCommunities:"xy",pollTargetSelectionPage__communityAvatar:"yy",pollTargetSelectionPage__communityName:"ky",pollTargetSelectionPage__closeButton:"jy",pollTargetSelectionPage__title:"zy",pollTargetSelectionPage__displayName:"Xy"};var kt={pollPostComposerPage__container:"si",pollPostComposerPage__form:"di",pollPostComposerPage__topBar:"ci",pollPostComposerPage__topBar__displayName:"Yy",pollPostComposerPage__pollQuestion:"Iy",pollPostComposerPage__pollQuestion__mention:"li",pollPostComposerPage__pollQuestion__label:"Ay",pollPostComposerPage__pollQuestion__limit:"My",pollPostComposerPage__pollQuestion__input:"ni",pollPostComposerPage__pollQuestion__placeholder:"Sy",pollPostComposerPage__pollOptions:"Cy",pollPostComposerPage__pollOptions__validationWrap:"Ey",pollPostComposerPage__pollQuestion__validationWrap:"Ry",pollPostComposerPage__pollQuestion__validationText:"Uy",pollPostComposerPage__pollOptions__options:"By",pollPostComposerPage__pollOptions__label:"Fy",pollPostComposerPage__pollOptions__optionsWrapper:"Hy",pollPostComposerPage__pollOptions__input:"T",pollPostComposerPage__pollOptions__trashIcon:"Ly",pollPostComposerPage__pollOptions__trashButton:"Ty",pollPostComposerPage__answerType:"Vy",pollPostComposerPage__duration:"Wy",pollPostComposerPage__duration__button:"qy",pollPostComposerPage__duration__dropdownIcon:"Dy",pollPostComposerPage__duration__captionWrap:"Gy",pollPostComposerPage__duration__caption:"Jy",pollPostComposerPage__overlay:"Ky",pollPostComposerPage_notificationIcon:"Ny",pollPostComposerPage__postButtonWrap:"Oy",pollPostComposerPage__postButton:"Py",pollPostComposerPage__notificationWrapper:"Qy"};var Sz=({pageId:e="*",componentId:t="*"})=>{let o="poll_question_title",{accessibilityId:r,themeStyles:i,config:n}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement(v.TitleBold,{style:i,"data-testid":r},n.text)};var oI=({pageId:e="*",componentId:t="*"})=>{let o="poll_options_title",{accessibilityId:r,themeStyles:i,config:n}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement(v.TitleBold,{style:i,"data-testid":r},n.text)};var Nz={pollOptionsDesc__title:"Zy"};var rI=({pageId:e="*",componentId:t="*"})=>{let o="poll_options_desc",{accessibilityId:r,themeStyles:i,config:n}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement(v.Caption,{className:Nz.pollOptionsDesc__title,style:i,"data-testid":r},n.text)};var iI={pollAddOptionButton__addOptionButton:"_y",pollAddOptionButton__plusIcon:"e2"};var kz=({pageId:e="*",componentId:t="*",onPress:o})=>{let r="poll_add_option_button",{config:i,themeStyles:n,accessibilityId:a,uiReference:s,defaultConfig:l}=S({pageId:e,componentId:t,elementId:r});return ie__default.createElement(oe,{style:n,"data-testid":a,size:"medium",variant:"outlined",color:"secondary",onPress:o,className:iI.pollAddOptionButton__addOptionButton,icon:({className:m})=>ie__default.createElement(Z,{configIconName:i.icon,defaultIconName:l.icon,imgIcon:()=>ie__default.createElement("img",{src:i.icon,alt:s}),defaultIcon:()=>ie__default.createElement(br,{className:wl(m,iI.pollAddOptionButton__plusIcon)})})},"Add Option")};var nI=({pageId:e="*",componentId:t="*"})=>{let o="poll_multiple_selection_title",{config:r,themeStyles:i,accessibilityId:n}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement(v.TitleBold,{"data-testid":n,style:i},r.text)};var Bz={pollMultipleSelectionDesc__text:"r2"};var aI=({pageId:e="*",componentId:t="*"})=>{let o="poll_multiple_selection_desc",{config:r,themeStyles:i,accessibilityId:n}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement(v.Caption,{"data-testid":n,style:i,className:Bz.pollMultipleSelectionDesc__text},r.text)};var sI=({pageId:e="*",componentId:t="*"})=>{let o="poll_duration_title",{config:r,themeStyles:i,accessibilityId:n}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement(v.TitleBold,{"data-testid":n,style:i},r.text)};var Ez={pollDurationDesc__text:"a2"};var Az=({pageId:e="*",componentId:t="*"})=>{let o="poll_duration_desc",{config:r,themeStyles:i,accessibilityId:n}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement(v.Caption,{"data-testid":n,style:i,className:Ez.pollDurationDesc__text},r.text)};var Ml={pollDurationOptions__container:"mi",pollDurationOptions__calendar:"o2",pollDurationOptions__optionsLabel:"t2",pollDurationOptions__pickDateTime:"i2",pollDurationOptions__angleRightIcon:"s2",pollDurationOptions__radio:"hi",pollDurationOptions__customRadio:"ge",pollDurationOptions__hiddenRadio:"rr",calendar:"d2",calendarNav:"c2",calendar__navRight:"l2",calendar__navLeft:"n2"};var La={calendar:"m2",calendar__subHeader:"h2",calendar__navRight:"gi",calendar__navLeft:"pi",calendar__navButton:"bi",calendar__heading:"g2",calendar__grid:"p2",calendar__cell:"V",calendar__buttonWrap:"b2"};var lI=({pageId:e="*",componentId:t="*",date:o,setDate:r,defaultValue:i,minValue:n,maxValue:a,isDisabledDate:s=!1})=>{let l=today(getLocalTimeZone()),m="calendar",{accessibilityId:c}=S({pageId:e,componentId:t,elementId:m});return ie__default.createElement(Calendar,{value:o,defaultValue:i!=null?i:l,defaultFocusedValue:i!=null?i:l,onChange:r,className:La.calendar,"aria-label":"Select a date",minValue:n!=null?n:void 0,maxValue:a!=null?a:void 0},ie__default.createElement("header",{className:La.calendarHeader},ie__default.createElement("div",{className:La.calendar__subHeader},ie__default.createElement(Heading,{slot:"title","aria-label":"calendar-heading",className:La.calendar__heading}),ie__default.createElement("div",{className:La.calendar__buttonWrap},ie__default.createElement(V,{className:La.calendar__navButton,slot:"previous","aria-disabled":s},ie__default.createElement(sc,{className:La.calendar__navLeft})),ie__default.createElement(V,{className:La.calendar__navButton,slot:"next","aria-disabled":s},ie__default.createElement(sc,{className:La.calendar__navRight}))))),ie__default.createElement(CalendarGrid,{className:La.calendar__grid},d=>ie__default.createElement(CalendarCell,{"data-testid":c,"data-istoday":d.toString()===l.toString(),date:d,className:La.calendar__cell,"aria-disabled":s,"data-selected":d.toString()===o.toString()})))};var Xc={timeField__container:"u2",timeField__wrap:"f2",timeField__label:"v2",timeField__dateInput:"w2",timeField__dateSegment:"x2",timeField__validateText:"y2"};var mI=({pageId:e="*",componentId:t="*",defaultValue:o,value:r,minValue:i,onChange:n})=>{let a="time_field",{accessibilityId:s}=S({pageId:e,componentId:t,elementId:a});return ie__default.createElement(TimeField,{value:r,onChange:n,defaultValue:o,hourCycle:12,autoFocus:!0,minValue:i||void 0,className:Xc.timeField__container},ie__default.createElement("div",{className:Xc.timeField__wrap},ie__default.createElement(Label,{className:Xc.timeField__label},"Time"),ie__default.createElement(DateInput,{"data-testid":s,className:Xc.timeField__dateInput},l=>ie__default.createElement(DateSegment,{segment:l,className:Xc.timeField__dateSegment}))),ie__default.createElement(FieldError,{className:Xc.timeField__validateText}))};var zy=({pageId:e="*",timeDuration:t,duration:o,selectedDate:r,selectedTime:i,onChange:n,onClose:a,onChangeDate:s,onChangeTime:l})=>{let m="poll_duration_options",{themeStyles:c,accessibilityId:d}=se({pageId:e,componentId:m});le();let g=now(getLocalTimeZone()),[f,C]=useState(o),[y,b]=useState(!1),[_,x]=useState(r!=null?r:today(getLocalTimeZone())),[P,I]=useState(i!=null?i:new Time(g.hour,g.minute)),[w,M]=useState(void 0),T=today(getLocalTimeZone()),E=T.add({days:30}),N=_<T||_>E,A=$=>{n($),C($),s==null||s(void 0),l==null||l(void 0);},D=$=>I($),G=$=>x($),H=()=>{s==null||s(_),l==null||l(P),C(void 0),n(void 0),a==null||a();};return useEffect(()=>{M((_==null?void 0:_.toString())===today(getLocalTimeZone()).toString()?new Time(g.hour,g.minute):void 0);},[_]),ie__default.createElement("div",{style:c,"data-testid":d,className:Ml.pollDurationOptions__container},y?ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("div",{className:Ml.pollDurationOptions__calendar},ie__default.createElement("div",{className:Ml.calendarNav},ie__default.createElement(ze,{onPress:()=>b(!1)}),ie__default.createElement(v.TitleBold,null,"Ends on"),ie__default.createElement(oe,{slot:null,variant:"text",onPress:H,isDisabled:w&&P<w},"Done")),ie__default.createElement(mI,{pageId:e,componentId:m,value:P,onChange:D,defaultValue:new Time(g.hour,g.minute),minValue:w}),ie__default.createElement(lI,{pageId:e,componentId:m,date:_,defaultValue:T,setDate:G,"aria-label":"Select a date",minValue:T,maxValue:E,isDisabledDate:N}))):ie__default.createElement(ie__default.Fragment,null,t.map($=>ie__default.createElement(Label,{key:$.value,htmlFor:`duration-${$.value}`,className:Ml.pollDurationOptions__optionsLabel},ie__default.createElement("div",null,ie__default.createElement(v.Body,null,$.label)),ie__default.createElement(Input,{"aria-label":"poll_duration_options_radio","data-testid":`${e}/${m}/poll_duration_options_radio`,type:"radio",id:`duration-${$.value}`,value:$.value,onChange:()=>{A($);},className:`${Ml.pollDurationOptions__radio} ${Ml.pollDurationOptions__hiddenRadio}`,checked:f!==void 0&&(f==null?void 0:f.value)===$.value}),ie__default.createElement("span",{className:Ml.pollDurationOptions__customRadio}))),ie__default.createElement(V,{onPress:()=>b(!0),className:Ml.pollDurationOptions__pickDateTime},ie__default.createElement(v.Body,null,"Pick date and time"),ie__default.createElement(du,{className:Ml.pollDurationOptions__angleRightIcon}))))};var Fz=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M19.6289 9.15625C19.8047 9.29688 19.8047 9.57812 19.6289 9.75391L12.2812 17.1016C12.1055 17.2773 11.8594 17.2773 11.6836 17.1016L4.33594 9.75391C4.16016 9.57812 4.16016 9.29688 4.33594 9.15625L5.00391 8.45312C5.17969 8.27734 5.46094 8.27734 5.60156 8.45312L12 14.8164L18.3633 8.45312C18.5039 8.27734 18.7852 8.27734 18.9609 8.45312L19.6289 9.15625Z",fill:e.fill}));var pI=e=>{if(!e)return;let t=new Date;return t.setHours(e.hour,e.minute,0),new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}).format(t)};var Dz=e=>new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short"}).format(e);var Vz=(e,t)=>{if(!e||!t)return;let o=new Date(e.year,e.month-1,e.day,t.hour,t.minute,t.second||0,0),r=Date.now();return o.getTime()-r};var uI={switch:"l",switch__indicator:"t"};function Em(r){var i=r,{label:e,className:t}=i,o=d(i,["label","className"]);return ie__default.createElement(Switch,b(a({},o),{className:wl(uI.switch,t)}),ie__default.createElement("div",{className:uI.switch__indicator}),e)}var mf=500,Oz=10,gI=60,A8e=864e5,$y=[{value:1,label:"1 day"},{value:3,label:"3 days"},{value:7,label:"7 days"},{value:14,label:"14 days"},{value:30,label:"30 days"}],Un=({targetId:e,targetType:t})=>{let o="poll_post_composer_page",{themeStyles:r,accessibilityId:i}=ue({pageId:o}),{onBack:n,prevPage:a$1}=Y(),{community:s}=Ct({communityId:e}),{moderators:l$1}=Lo({communityId:s==null?void 0:s.communityId}),m=ce(),{online:c}=useNetworkState(),{closePopup:d}=Se(),{confirm:u,info:g}=Te(),{setDrawerData:f,removeDrawerData:C}=tt(),y=useRef(null),{currentUserId:b$1}=Xt(),{user:_}=qe({userId:b$1}),x=now(getLocalTimeZone()),{prependItem:P}=Fn(),{isDesktop:I}=le(),[w,M]=useState(!1),[T,E]=useState(!1),[N,A]=useState([{dataType:"text",data:""},{dataType:"text",data:""}]),[D,G]=useState(!1),[H,$]=useState($y[4]),[j,O]=useState(void 0),[z,k]=useState(void 0),[F,re]=useState({pollId:"",text:"",mentioned:[],mentionees:[{type:"user",userIds:[""]}]}),W=D?"multiple":"single",ne=z?pI(z):pI(new Time(x.hour,x.minute)),te=j&&new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short"}).format(j.toDate(getLocalTimeZone())),Q=new Date;H&&Q.setDate(Q.getDate()+H.value);let me=Dz(Q),X=Vz(j,z),q=F.text.length>0||N.some(K=>K.data.length>0||K.data.trim()!=="")||D||(H==null?void 0:H.value)!==$y[4].value||j,ae=H&&!X?H.value*A8e:X,Ee={question:"",answers:[],answerType:"single",closedIn:0},{handleSubmit:J}=useForm({defaultValues:Ee});function R(K){return l(this,null,function*(){try{M(!0);let Ce=yield PostRepository.createPost(K),he=Ce.data,Pe=(l$1||[]).find(Ht=>Ht.userId===he.postedUserId)!=null;(s.needApprovalOnPostCreation||(s==null?void 0:s.postSetting)===CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED)&&!Pe&&!Yu(_==null?void 0:_.roles)?g({pageId:o,content:"Your post has been submitted to pending list. It will be review by community moderator.",okText:"OK"}):P(Ce.data);}catch(Ce){E(!0),Ce instanceof Error&&Ce.message===xr.CONTAIN_BLOCKED_WORD&&m.info({content:"Text contain blocked word."});}finally{M(!1),I?d():(a$1==null?void 0:a$1.type)==="PollTargetSelectionPage"?n(2):n();}})}function be(K){return l(this,null,function*(){var Pe;let Ce={};if((Pe=Ce.text)!=null&&Pe.length&&Ce.text.length>5e4){g({pageId:o,title:"Unable to post",content:"You have reached maximum 50,000 characters in a post.",okText:"Done"});return}if(!e)return;let he={targetId:e,targetType:t,data:{pollId:K,text:F.text},dataType:"poll",metadata:{mentioned:F.mentioned},mentionees:F.mentionees,attachments:[]};return R(he)})}let xe=K=>l(void 0,null,function*(){if(!c){m.info({content:"Failed to create post. Please try again.",alignment:"fixed"});return}try{M(!0);let Ce={question:F.text,answers:N,answerType:W,closedIn:ae},he=yield PollRepository.createPoll(Ce);yield be(he.data.pollId);}finally{M(!1),I&&d();}}),Xe=()=>{if(!q)return (a$1==null?void 0:a$1.type)=="PollTargetSelectionPage"?n(-2):n();u({pageId:o,type:"confirm",title:"Discard this post?",content:"The post will be permanently discarded. It cannot be undone.",onOk:()=>{(a$1==null?void 0:a$1.type)=="PollTargetSelectionPage"?n(-2):n();},okText:"Discard",cancelText:"Keep editing"});},Qe=K=>re(Ce=>b(a({},Ce),{mentioned:K.mentioned,text:K.text,mentionees:K.mentionees})),ht=()=>{N.length<Oz&&A([...N,{dataType:"text",data:""}]);},Zt=(K,Ce)=>{let he=N.map((Pe,Ht)=>Ht===K?b(a({},Pe),{data:Ce}):Pe);A(he);},Bt=K=>{let Ce=N.filter((he,Pe)=>Pe!==K);A(Ce);},so=K=>{K.key==="Enter"&&K.preventDefault();},lo=()=>G(!D),ve=K=>$(K),$e=K=>O(K),pe=K=>k(K),Me=w||F.text.trim()===""||F.text.length>mf||N.length<2||N.some(K=>K.data.length>gI||K.data.length===0||K.data.trim()==="");return ie__default.createElement("div",{style:r,"data-testid":i,className:kt.pollPostComposerPage__container},ie__default.createElement(Form,{id:"pollPostComposer",className:kt.pollPostComposerPage__form,onSubmit:J(xe)},ie__default.createElement("div",{className:kt.pollPostComposerPage__topBar},ie__default.createElement(ot,{pageId:o,onPress:Xe}),ie__default.createElement(Mo,{pageId:o,community:s,className:kt.pollPostComposerPage__topBar__displayName}),ie__default.createElement(oe,{size:"medium",variant:"text",color:"primary",type:"submit",isDisabled:Me},"Post")),ie__default.createElement(TextField,{name:"question",className:kt.pollPostComposerPage__pollQuestion},ie__default.createElement(Label,{className:kt.pollPostComposerPage__pollQuestion__label},ie__default.createElement(Sz,{pageId:o}),ie__default.createElement("span",{className:kt.pollPostComposerPage__pollQuestion__limit},F.text.length,"/",mf)),ie__default.createElement(qc,{"data-input-validation":F.text.length<=mf,isValidInput:F.text.length<=mf,pageId:o,communityId:e,dataValue:{data:{text:F.text}},mentionContainer:y.current,onChange:Qe,className:kt.pollPostComposerPage__pollQuestion__input,placeholderClassName:kt.pollPostComposerPage__pollQuestion__placeholder,placeholder:"What\u2019s your poll question?"}),F.text.length>mf&&ie__default.createElement("div",{className:kt.pollPostComposerPage__pollQuestion__validationWrap},ie__default.createElement(v.Caption,{className:kt.pollPostComposerPage__pollQuestion__validationText},"Poll question cannot exceed 500 characters."))),ie__default.createElement("div",{ref:y,className:kt.pollPostComposerPage__pollQuestion__mention,"data-testid":`${o}/mention_text_input_options`}),ie__default.createElement(TextField,{name:"answers",className:kt.pollPostComposerPage__pollOptions},ie__default.createElement(Label,{className:kt.pollPostComposerPage__pollOptions__label},ie__default.createElement(oI,{pageId:o}),ie__default.createElement(rI,{pageId:o})),N.map((K,Ce)=>ie__default.createElement("div",{className:kt.pollPostComposerPage__pollOptions__options},ie__default.createElement("div",{className:kt.pollPostComposerPage__pollOptions__optionsWrapper},ie__default.createElement(TextArea,{"data-isvalid":K.data.length<=gI,className:kt.pollPostComposerPage__pollOptions__input,value:K.data,placeholder:`Option ${Ce+1}`,onChange:he=>Zt(Ce,he.target.value),rows:1,onKeyDown:so}),ie__default.createElement(V,{className:kt.pollPostComposerPage__pollOptions__trashButton,onPress:()=>Bt(Ce)},ie__default.createElement(Dn,{className:kt.pollPostComposerPage__pollOptions__trashIcon}))),K.data.length>gI&&ie__default.createElement("div",{className:kt.pollPostComposerPage__pollOptions__validationWrap},ie__default.createElement(v.Caption,{className:kt.pollPostComposerPage__pollQuestion__validationText},"Poll option cannot exceed 60 characters.")))),N.length<Oz&&ie__default.createElement(kz,{onPress:ht,pageId:o})),ie__default.createElement(TextField,{name:"answerType",className:kt.pollPostComposerPage__answerType},ie__default.createElement(Label,{className:kt.pollPostComposerPage__answerType__label},ie__default.createElement(nI,{pageId:o}),ie__default.createElement(aI,{pageId:o})),ie__default.createElement(Em,{isSelected:D,onChange:lo,"data-testid":o})),ie__default.createElement(TextField,{"aria-label":"pick-date-time",name:"closedIn",className:kt.pollPostComposerPage__duration},ie__default.createElement(Label,null,ie__default.createElement(sI,{pageId:o}),ie__default.createElement(Az,{pageId:o})),ie__default.createElement(ft,{placement:"bottom",trigger:({isDesktop:K,isOpen:Ce,openPopover:he,closePopover:Pe})=>ie__default.createElement(V,{className:kt.pollPostComposerPage__duration__button,onPress:()=>{K?he():f({content:ie__default.createElement(zy,{pageId:o,timeDuration:$y,duration:H,selectedDate:j,selectedTime:z,onChange:ve,onClose:C,onChangeDate:$e,onChangeTime:pe})});}},ie__default.createElement(v.Body,null,j?`Ends on ${te} at ${ne}`:H&&H.label),ie__default.createElement(Fz,{className:kt.pollPostComposerPage__duration__dropdownIcon})),"aria-label":"poll_duration_options"},({closePopover:K})=>ie__default.createElement(zy,{pageId:o,timeDuration:$y,duration:H,selectedDate:j,selectedTime:z,onChange:ve,onClose:K,onChangeDate:$e,onChangeTime:pe}))),!j&&ie__default.createElement("div",{className:kt.pollPostComposerPage__duration__captionWrap},ie__default.createElement(v.Caption,{className:kt.pollPostComposerPage__duration__caption},`Ends on ${me} at ${ne}`)),I&&ie__default.createElement("div",{className:kt.pollPostComposerPage__postButtonWrap},ie__default.createElement(oe,{type:"submit",isDisabled:Me,className:kt.pollPostComposerPage__postButton},"Post"))),ie__default.createElement("div",{className:kt.pollPostComposerPage__notificationWrapper},w&&ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("div",{className:kt.pollPostComposerPage__overlay}),ie__default.createElement(Ur,{icon:ie__default.createElement(Ia,null),content:"Posting...",alignment:"fixed"})),T&&ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("div",{className:kt.pollPostComposerPage__overlay}),ie__default.createElement(Ur,{duration:3e3,content:"Failed to create post",alignment:"fixed",icon:ie__default.createElement(Co,{className:kt.createPost_notificationIcon})}))))};function Am(){let{client:e}=Ne(),t="select_poll_target_page",{themeStyles:o}=ue({pageId:t}),{onBack:r}=Y(),{communities:i,hasMore:n,loadMore:a,isLoading:s}=hs({queryParams:{limit:20,membership:"member"}}),{AmityPollTargetSelectionPageBehavior:l}=we(),{currentUserId:m}=Ne(),{user:c}=qe({userId:m}),{isDesktop:d}=le(),{openPopup:u}=Se(),{confirm:g}=Te(),[f,C]=useState(null);return ke({onIntersect:()=>{n&&s===!1&&a();},node:f}),ie__default.createElement("div",{className:Vn.pollTargetSelectionPage,style:o},ie__default.createElement("div",{className:Vn.pollTargetSelectionPage__topBar},ie__default.createElement(ot,{pageId:t,onPress:()=>r(),imgClassName:Vn.pollTargetSelectionPage__closeButton}),ie__default.createElement(xt,{pageId:t,titleClassName:Vn.pollTargetSelectionPage__title}),ie__default.createElement("div",null)),ie__default.createElement("div",{className:Vn.pollTargetSelectionPage__timelineContainer},ie__default.createElement(V,{className:Vn.pollTargetSelectionPage__timeline,onPress:()=>{var y;d?u({pageId:t,view:"desktop",isDismissable:!1,onClose:({close:b})=>{g({onOk:b,type:"confirm",okText:"Discard",cancelText:"Keep editing",title:"Discard this post?",pageId:"post_composer_page",content:"The post will be permanently discarded. It cannot be undone."});},header:ie__default.createElement(Mo,{community:void 0,pageId:"post_composer_page",className:Vn.pollTargetSelectionPage__displayName}),children:ie__default.createElement(Un,{targetId:null,targetType:"user"})}):(y=l==null?void 0:l.goToPollPostComposerPage)==null||y.call(l,{targetId:null,targetType:"user"});}},ie__default.createElement(r0,{pageId:t,userId:c==null?void 0:c.userId}),ie__default.createElement(i0,{pageId:t}))),ie__default.createElement("div",{className:Vn.pollTargetSelectionPage__line}),ie__default.createElement("div",{className:Vn.pollTargetSelectionPage__myCommunities},"My Communities"),i.filter(y=>Pm(e,y)).map(y=>ie__default.createElement(V,{key:y.communityId,className:Vn.pollTargetSelectionPage__timeline,onPress:()=>{var b;d?u({pageId:t,view:"desktop",isDismissable:!1,onClose:({close:_})=>{g({onOk:_,type:"confirm",okText:"Discard",cancelText:"Keep editing",title:"Discard this post?",pageId:"post_composer_page",content:"The post will be permanently discarded. It cannot be undone."});},header:ie__default.createElement(Mo,{community:y,pageId:"post_composer_page",className:Vn.pollTargetSelectionPage__displayName}),children:ie__default.createElement(Un,{targetType:"community",targetId:y.communityId})}):(b=l==null?void 0:l.goToPollPostComposerPage)==null||b.call(l,{targetType:"community",targetId:y.communityId});}},ie__default.createElement("div",{className:Vn.pollTargetSelectionPage__communityAvatar},ie__default.createElement(ti,{pageId:t,community:y})),ie__default.createElement("div",{className:Vn.pollTargetSelectionPage__communityName},!y.isPublic&&ie__default.createElement(ar,null),ie__default.createElement(Mo,{pageId:t,community:y}),y.isOfficial&&ie__default.createElement(sr,null)))),ie__default.createElement("div",{ref:y=>C(y)}))}var vs={selectStoryTargetPage:"ui",selectStoryTargetPage__skeletonContainer:"k2",selectStoryTargetPage__topBar:"fi",selectStoryTargetPage__timeline:"j2",selectStoryTargetPage__line:"z2",selectStoryTargetPage__myCommunities__container:"X2",selectStoryTargetPage__communityItem_container:"Y2",selectStoryTargetPage__myCommunities_text:"vi",selectStoryTargetPage__communityAvatar:"I2",selectStoryTargetPage__communityName:"A2",selectStoryTargetPage__closeButton:"M2",selectStoryTargetPage__title:"S2"};var Zy={communitySmallListSekeleton:"C2",communitySmallListSekeleton__avatar:"wi",communitySmallListSekeleton__displayName:"xi","skeleton-pulse":"yi"};var zz=()=>ie__default.createElement("div",{className:Zy.communitySmallListSekeleton},ie__default.createElement("div",{className:Zy.communitySmallListSekeleton__avatar}),ie__default.createElement("div",{className:Zy.communitySmallListSekeleton__displayName}));function Lm(){let e="select_story_target_page",{themeStyles:t}=ue({pageId:e}),{onBack:o}=Y(),{closePopup:r}=Se(),{communities:i,hasMore:n,loadMore:a,isLoading:s}=hs({queryParams:{limit:20,membership:"member"}}),{AmityStoryTargetSelectionPage:l}=we(),{file:m,setFile:c}=In(),{client:d}=Ne(),[u,g]=useState(null),[f,C]=useState(null),y=P=>{C(P);},b=P=>{P&&P.length>0&&f&&c(P[0]);},_=()=>ie__default.createElement("div",{className:vs.selectStoryTargetPage__skeletonContainer},Array.from({length:7}).map((P,I)=>ie__default.createElement(zz,{key:I}))),x=i.filter(P=>Pm(d,P)).map(P=>ie__default.createElement(FileTrigger,{key:P.communityId,onSelect:b},ie__default.createElement(V,{onPress:()=>y(P.communityId)},ie__default.createElement("div",{className:vs.selectStoryTargetPage__communityItem_container},ie__default.createElement("div",{className:vs.selectStoryTargetPage__communityAvatar},ie__default.createElement(ti,{pageId:e,community:P})),ie__default.createElement("div",{className:vs.selectStoryTargetPage__communityName},!P.isPublic&&ie__default.createElement(ar,null),ie__default.createElement(Mo,{pageId:e,community:P}),P.isOfficial&&ie__default.createElement(sr,null))))));return ke({onIntersect:()=>{n&&s===!1&&a();},node:u}),useEffect(()=>{var P;m&&((P=l==null?void 0:l.goToStoryCreationPage)==null||P.call(l,{targetId:f,targetType:"community",mediaType:m&&(m!=null&&m.type.includes("image"))?{type:"image",url:URL.createObjectURL(m)}:{type:"video",url:URL.createObjectURL(m)},storyType:"globalFeed"}),r());},[m]),ie__default.createElement("div",{className:vs.selectStoryTargetPage,style:t},ie__default.createElement("div",{className:vs.selectStoryTargetPage__topBar},ie__default.createElement(ot,{imgClassName:vs.selectStoryTargetPage__closeButton,pageId:e,onPress:()=>o()}),ie__default.createElement(xt,{pageId:e,titleClassName:vs.selectStoryTargetPage__title}),ie__default.createElement("div",null)),ie__default.createElement(v.Body,{className:vs.selectStoryTargetPage__myCommunities_text},"My Communities"),ie__default.createElement("div",{className:vs.selectStoryTargetPage__myCommunities__container},x,s&&_()),ie__default.createElement("div",{ref:P=>g(P)}))}var ra={postComposer:"ki",postComposer__avatar:"E2",postComposer__input:"ji",postComposer__title:"R2",postComposer__popup:"zi",postComposer__button:"U2",postComposer__avatarPlaceholder:"B2"};function Rc({pageId:e="*",communityId:t,onClickPost:o,onClickPoll:r,onSelectFile:i}){let n="post_composer",{currentUserId:a}=Ne();Y();let {openPopup:l}=Se(),{user:m,isLoading:c}=qe({userId:a}),{hasStoryPermission:d}=Ma(t);rt({fileId:m==null?void 0:m.avatarFileId,imageSize:"small"});let {accessibilityId:g,themeStyles:f}=se({pageId:e,componentId:n}),C=()=>{if(o)return o();l({pageId:e,componentId:n,view:"desktop",header:ie__default.createElement(xt,{pageId:"select_post_target_page",titleClassName:ra.postComposer__title}),children:ie__default.createElement(Bm,null)});},y=()=>{l({pageId:e,componentId:n,view:"desktop",header:ie__default.createElement(xt,{pageId:"select_story_target_page",titleClassName:ra.postComposer__title}),children:ie__default.createElement(Lm,null)});},b=()=>{if(r){r();return}l({pageId:e,componentId:n,view:"desktop",header:ie__default.createElement(xt,{pageId:"select_poll_target_page",titleClassName:ra.postComposer__title}),children:ie__default.createElement(Am,null)});},_=()=>{let x=e==="user_profile_page",P=e==="community_profile_page";return !d||d&&x?null:P?ie__default.createElement(FileTrigger,{onSelect:i},ie__default.createElement(eI,{pageId:e,componentId:n,defaultIconClassName:ra.postComposer__button})):ie__default.createElement(eI,{pageId:e,componentId:n,defaultIconClassName:ra.postComposer__button,onPress:y})};return ie__default.createElement("div",{className:ra.postComposer,"data-testid":g,style:f},ie__default.createElement(Ae,{pageId:e,userId:m==null?void 0:m.userId,componentId:n,className:ra.postComposer__avatar,imageContainerClassName:ra.postComposer__avatar,textPlaceholderClassName:ra.postComposer__avatarPlaceholder,shouldRedirectToUserProfile:!0}),ie__default.createElement(V,{className:ra.postComposer__input,onPress:C},"What's going on?"),ie__default.createElement(ls,{onPress:C,pageId:e,componentId:n,defaultIconClassName:ra.postComposer__button}),ie__default.createElement(Vc,{onPress:C,pageId:e,componentId:n,defaultIconClassName:ra.postComposer__button}),ie__default.createElement(JP,{onPress:b,pageId:"post_composer_page",componentId:"poll_button"}),_())}var Gz={newsfeed:"Xi",newsfeed__postList:"F2",newsfeed__postContainer:"H2",newsfeed__post__reactionBar__leftPane__icon:"L2",newsfeed__post__reactionBar__leftPane__iconImg:"T2",newsfeed__post__reactionBar:"V2",newsfeed__post__reactionBar__leftPane:"W2",newsfeed__post__reactionBar__rightPane:"q2"};var Wy=({pageId:e="*"})=>{let t="newsfeed",{themeStyles:o}=se({pageId:e,componentId:t}),{itemWithAds:r,hasMore:i,isLoading:n,globalFeaturedPostsItems:a,isGlobalFeaturedPostsLoading:s,loadMore:l,refetch:m,removeItem:c}=Fn(),d=()=>{i&&!n&&(l==null||l());};return r.length===0&&!n?ie__default.createElement(o0,{pageId:e}):ie__default.createElement(Tl,{className:Gz.newsfeed,style:o,onTouchEndCallback:m},ie__default.createElement(zr,null),ie__default.createElement(Bu,{type:"globalFeed",pageId:e}),ie__default.createElement(zr,null),ie__default.createElement(Rc,{pageId:e}),ie__default.createElement(Vy,{pageId:e,items:r,isLoading:n,componentId:t,onFeedReachBottom:()=>d(),onPostDeleted:u=>{u&&u.postId&&c(u.postId);},globalFeaturedPosts:a,isGlobalFeaturedPostsLoading:s}))};var qy={postCreationButton:"D2",postCreationButton__icon:"G2"};var G8e=e=>ie__default.createElement("svg",a({style:{pointerEvents:"none"},width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M13.0002 5.96667C13.5314 5.96667 14.0002 6.43542 14.0002 6.96667V7.96667C14.0002 8.52917 13.5314 8.96667 13.0002 8.96667H8.50016V13.4667C8.50016 14.0292 8.03141 14.4667 7.50016 14.4667H6.50016C5.93766 14.4667 5.50016 14.0292 5.50016 13.4667V8.96667H1.00016C0.437662 8.96667 0.000162125 8.52917 0.000162125 7.96667V6.96667C0.000162125 6.43542 0.437662 5.96667 1.00016 5.96667H5.50016V1.46667C5.50016 0.935425 5.93766 0.466675 6.50016 0.466675H7.50016C8.03141 0.466675 8.50016 0.935425 8.50016 1.46667V5.96667H13.0002Z"}));function yI({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onClick:i}){let n="post_creation_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:m,uiReference:c,themeStyles:d}=S({pageId:e,componentId:t,elementId:n});return m?null:ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(V,{style:d,className:qy.postCreationButton,onPress:i,"data-testid":a},ie__default.createElement(G8e,{className:wl(qy.postCreationButton__icon,o)})),imgIcon:()=>ie__default.createElement("img",{src:s.image,alt:c,className:wl(qy.postCreationButton,r),onClick:i,"data-testid":a}),defaultIconName:l.image,configIconName:s.image})}var df={globalSearchButton:"J2",globalSearchButton__icon:"K2",globalSearchButton__svg:"N2"};var Z8e=e=>ie__default.createElement("svg",a({width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M15.7814 14.3104C16.0627 14.6229 16.0627 15.0917 15.7502 15.3729L14.8752 16.2479C14.5939 16.5604 14.1252 16.5604 13.8127 16.2479L10.7189 13.1542C10.5627 12.9979 10.5002 12.8104 10.5002 12.6229V12.0917C9.37516 12.9667 8.00016 13.4667 6.50016 13.4667C2.90641 13.4667 0.000162125 10.5604 0.000162125 6.96667C0.000162125 3.40417 2.90641 0.466675 6.50016 0.466675C10.0627 0.466675 13.0002 3.40417 13.0002 6.96667C13.0002 8.49792 12.4689 9.87292 11.6252 10.9667H12.1252C12.3127 10.9667 12.5002 11.0604 12.6564 11.1854L15.7814 14.3104ZM6.50016 10.9667C8.68766 10.9667 10.5002 9.18542 10.5002 6.96667C10.5002 4.77917 8.68766 2.96667 6.50016 2.96667C4.28141 2.96667 2.50016 4.77917 2.50016 6.96667C2.50016 9.18542 4.28141 10.9667 6.50016 10.9667Z"}));function hI({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onPress:i}){let n="global_search_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:m,uiReference:c,themeStyles:d}=S({pageId:e,componentId:t,elementId:n});return m?null:ie__default.createElement(V,{style:d,"data-testid":a,className:df.globalSearchButton,onPress:i},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement("div",{className:df.globalSearchButton__icon},ie__default.createElement(Z8e,{className:wl(df.globalSearchButton__svg,o)})),imgIcon:()=>ie__default.createElement("img",{style:d,src:s.image,alt:c,className:wl(df.globalSearchButton__icon,r),"data-testid":a}),defaultIconName:l.image,configIconName:s.image}))}var Wz={headerLabel:"O2"};function CI({pageId:e="*",componentId:t="*"}){let o="header_label",{accessibilityId:r,config:i,defaultConfig:n,isExcluded:a,uiReference:s,themeStyles:l}=S({pageId:e,componentId:t,elementId:o});return a?null:ie__default.createElement(v.Headline,{className:Wz.headerLabel,style:l,"data-testid":r},i.text)}var Fm=(i=>(i.Newsfeed="Newsfeed",i.Explore="Explore",i.MyCommunities="My communities",i.Clips="Clips",i))(Fm||{});var Yy={topNavigation:"P2",topNavigationLeftPane:"Q2",topNavigationRightPane:"Z2"};function Qy({pageId:e="*",selectedTab:t,onClickPostCreationButton:o}){let r="top_navigation",{goToSocialGlobalSearchPage:i,goToMyCommunitiesSearchPage:n,goToCreateCommunityPage:a,goToNotificationTrayPage:s}=Y(),{isExcluded:l,themeStyles:m}=se({pageId:e,componentId:r}),c=()=>{switch(t){case"Newsfeed":case"Explore":i();break;case"My communities":n();break}};if(l)return null;let d=()=>{notificationTray.markTraySeen(new Date().toISOString()),s();};return ie__default.createElement("div",{className:Yy.topNavigation,style:m},ie__default.createElement("div",{className:Yy.topNavigationLeftPane},ie__default.createElement(CI,{pageId:e,componentId:r})),ie__default.createElement("div",{className:Yy.topNavigationRightPane},ie__default.createElement($2,{pageId:e,componentId:r,onPress:d}),ie__default.createElement(hI,{pageId:e,componentId:r,onPress:c}),t!=="Explore"&&ie__default.createElement(yI,{pageId:e,componentId:r,onClick:()=>t=="My communities"?a==null?void 0:a({mode:"create"}):o==null?void 0:o()})))}var rp={communityPendingPost__container:"_2",communityPendingPost__content:"ek",communityPendingPost__icon:"rk",communityPendingPost__textContainer:"ak",communityPendingPost__title__wrapper:"ok",communityPendingPost__title:"tk",communityPendingPost__subtext:"ik"};var vI=({pageId:e="*",componentId:t="*",pendingPostsCount:o=0,onClick:r,isPostOwner:i,canReviewCommunityPosts:n,joinRequestsCount:a=0,isShowJoinRequest:s=!1,isShowPendingPost:l=!1})=>{let m="community_pending_post",{config:c,themeStyles:d,accessibilityId:u,isExcluded:g}=S({pageId:e,componentId:t,elementId:m});if(g)return null;let f=o>10?"10+":o,C=a>10?"10+":a,y=()=>o===1?"Your post is pending for review":"Your posts are pending for review",b=()=>o===1?"1 post requires approval":`${f} posts require approval`,_=()=>a===1?"1 join request requires approval":`${C} join requests require approval`,x=()=>{let I=o===1?"1 post":`${f} posts`,w=a===1?"1 request":`${C} requests`;return `${I} and ${w} require approval`},P=()=>i?y():n?l&&!s?b():s&&!l?_():x():null;return ie__default.createElement(V,{className:rp.communityPendingPost__container,style:d,"data-testid":u,onPress:r},ie__default.createElement("div",{className:rp.communityPendingPost__content},ie__default.createElement("div",{className:rp.communityPendingPost__textContainer},ie__default.createElement("div",{className:rp.communityPendingPost__title__wrapper},ie__default.createElement("div",{className:rp.communityPendingPost__icon}),ie__default.createElement(v.BodyBold,null,"Pending requests")),ie__default.createElement(v.Caption,{className:rp.communityPendingPost__subtext},P()))))};var Yz=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M13.6875 12.25C13.6875 13.1992 12.9141 13.9375 12 13.9375C11.0508 13.9375 10.3125 13.1992 10.3125 12.25C10.3125 11.3359 11.0508 10.5625 12 10.5625C12.9141 10.5625 13.6875 11.3359 13.6875 12.25ZM17.9062 10.5625C18.8203 10.5625 19.5938 11.3359 19.5938 12.25C19.5938 13.1992 18.8203 13.9375 17.9062 13.9375C16.957 13.9375 16.2188 13.1992 16.2188 12.25C16.2188 11.3359 16.957 10.5625 17.9062 10.5625ZM6.09375 10.5625C7.00781 10.5625 7.78125 11.3359 7.78125 12.25C7.78125 13.1992 7.00781 13.9375 6.09375 13.9375C5.14453 13.9375 4.40625 13.1992 4.40625 12.25C4.40625 11.3359 5.14453 10.5625 6.09375 10.5625Z"}));var _I={menuButton:"sk",menuButton__icon:"dk"};function bI(a$1){var s=a$1,{onPress:e,className:t,pageId:o="*",componentId:r="*",defaultIconClassName:i}=s,n=d(s,["onPress","className","pageId","componentId","defaultIconClassName"]);let l="menu_button",{isExcluded:m,accessibilityId:c,themeStyles:d$1,config:u,defaultConfig:g,uiReference:f}=S({pageId:o,componentId:r,elementId:l});return m?null:ie__default.createElement(V,b(a({},n),{onPress:e,style:d$1,"data-testid":c,className:wl(_I.menuButton,t),"aria-label":"Menu icon to open community profile settings page"}),ie__default.createElement(Z,{configIconName:u.icon,defaultIconName:g.icon,imgIcon:()=>ie__default.createElement("img",{src:u.icon,alt:f}),defaultIcon:()=>ie__default.createElement(Yz,{className:wl(_I.menuButton__icon,i)})}))}var md={communityCover:"Yi",communityCover__topBar:"pe",communityCover__topBarLeft:"ck",communityCover__privateIcon:"lk",communityCover__communityName:"nk",communityCover__backButton:"mk",communityCover__backButton__icon:"hk"};var xI=({image:e,onBack:t,isSticky:o,community:r,onClickMenu:i,pageId:n="*",componentId:a$1="*"})=>{let s="community_cover",{isExcluded:l,accessibilityId:m,themeStyles:c}=S({pageId:n,componentId:a$1,elementId:s});if(l)return null;let d={"--background-image":e?`url(${e})`:"linear-gradient(188deg, #A5A9B5 6.23%, #898E9E 93.77%)"};return ie__default.createElement("div",{"data-testid":m,className:md.communityCover,style:a(a({},c),d)},ie__default.createElement("div",{className:md.communityCover__topBar,"data-scroll":o},ie__default.createElement("div",{className:md.communityCover__topBarLeft},ie__default.createElement(ze,{onPress:t,className:md.communityCover__backButton,defaultClassName:md.communityCover__backButton__icon}),o&&ie__default.createElement(ie__default.Fragment,null,!(r!=null&&r.isPublic)&&ie__default.createElement(J1,{className:md.communityCover__privateIcon}),ie__default.createElement(v.TitleBold,{className:md.communityCover__communityName},r==null?void 0:r.displayName),(r==null?void 0:r.isOfficial)&&ie__default.createElement(sr,null))),(r==null?void 0:r.isJoined)&&ie__default.createElement(bI,{onPress:i})))};var Jy={communityDescription:"gk",communityDescription__text:"pk",communityDescription__seeMoreButton:"bk"};var PI=({pageId:e="*",componentId:t="*",description:o=""})=>{let r="community_description",[i,n]=useState(!1),{themeStyles:a,accessibilityId:s,isExcluded:l}=S({pageId:e,elementId:r,componentId:t}),m=()=>n(!0);return l||o.length===0?null:ie__default.createElement("div",{style:a,"data-testid":s,className:Jy.communityDescription},ie__default.createElement(v.Body,{className:Jy.communityDescription__text},i?o:ie__default.createElement(RE,{lines:4,ellipsis:ie__default.createElement(ie__default.Fragment,null,"..."," ",ie__default.createElement(V,{className:Jy.communityDescription__seeMoreButton,onPress:m},"See more"))},ie__default.createElement("div",null,o))))};var Kz={communityName__truncate:"uk"};var II=({pageId:e="*",componentId:t="*",name:o=""})=>{let r="community_name",{accessibilityId:i,isExcluded:n}=S({pageId:e,componentId:t,elementId:r});return n?null:ie__default.createElement(v.Headline,{"data-testid":i,className:Kz.communityName__truncate},o)};var cf={communityInfo__container:"fk",communityInfo__wrapper:"vk",communityInfo__count:"wk",communityInfo__title:"xk"};var Ry=({pageId:e="*",componentId:t="*",count:o,text:r,onClick:i})=>{let n="community_info",{config:a,accessibilityId:s,themeStyles:l,isExcluded:m}=S({pageId:e,componentId:t,elementId:n});return m?null:ie__default.createElement(V,{"data-testid":s,onPress:i,className:cf.communityInfo__container},ie__default.createElement("div",{className:cf.communityInfo__wrapper},ie__default.createElement(v.BodyBold,{className:cf.communityInfo__count},fA(o)),ie__default.createElement(v.Caption,{className:cf.communityInfo__title},r)))};var wI={invitations:[],isLoading:!1,refresh:()=>{},hasUnseenInvitations:!1};function Jz(){let[e,t]=useState(wI);return useEffect(()=>{let o,r=()=>{o&&o(),o=InvitationRepository.getMyCommunityInvitations({limit:20},({data:i,loading:n})=>{t(a=>({invitations:i,isLoading:n,refresh:r,hasUnseenInvitations:n?a.hasUnseenInvitations:i.slice(0,3).some(s=>!localStorage.getItem(s.invitationId))}));});};return r(),()=>{o&&o();}},[]),e}function ap(e){let[t,o]=useState(),[r,i]=useState(!1);return useEffect(()=>{e&&e.getInvitation&&(i(!0),e.getInvitation().then(n=>{o(n),i(!1);}).catch(()=>{o(void 0),i(!1);}));},[e]),{isLoading:r,invitation:t,setInvitation:o}}var on={container:"yk",headerImageContainer:"kk",headerImage:"jk",backButton:"Ii",moreButton:"Ai",content:"Mi",communityProfile__name:"zk",description:"Xk",communityProfile__communityInfo__container:"Yk",divider:"Ik",statCount:"Ak",statTitle:"Mk",menuButton:"Sk",communityProfile__joinButton__container:"Ck",communityProfile__joinButton:"Ek",communityProfile__pendingPost__container:"Rk",communityProfile__menuItem:"Uk",communityProfile__privateIcon:"Bk",communityProfile__communityCategories:"ar",communityProfile__cancelJoinButton__container:"Fk",communityProfile__pendingIcon:"Hk",communityProfile__cancelJoinButton:"Lk"};function ej(e){let[t,o]=useState(),[r,i]=useState(!1),n=useCallback(()=>l(this,null,function*(){if(!(!e||!e.communityId)){i(!0);try{let a=yield e.getMyJoinRequest();o(a);}catch(a){console.error("Error fetching join request:",a);}finally{i(!1);}}}),[e]);return useEffect(()=>{n();},[n,e.communityId]),{myJoinRequest:t,setMyJoinRequest:o,isLoading:r,refreshJoinRequest:n}}function sp({community:e,status:t=JoinRequestStatusEnum.Pending}){let[o,r]=useState(!0),[i,n]=useState(),[a,s]=useState(null),[l,m]=useState(),c=useRef(),d=useCallback(()=>{c.current&&c.current();},[]);return useEffect(()=>{if(!e.communityId)return;let u=e.getJoinRequests({communityId:e.communityId,type:"communityJoinRequest",targetType:"community",status:t,options:{limit:20}},({data:g,loading:f,error:C,hasNextPage:y,onNextPage:b})=>{r(f),!f&&g&&(s([...g]),m(y),c.current=y?b:null),C&&n(C);});return ()=>{u();}},[e.communityId,t]),{joinRequests:a,loading:o,hasMore:l,loadMore:d,error:i}}var t9=({pageId:e="*",community:t,isSticky:o,page:r})=>{var O;let i="community_header",{onBack:n}=Y(),{isDesktop:a}=le(),{AmityCommunityProfilePageBehavior:s}=we(),{currentUserId:l}=Xt(),{online:m}=useNetworkState(),c=ce(),{invitation:d,setInvitation:u}=ap(t),{myJoinRequest:g,setMyJoinRequest:f,refreshJoinRequest:C}=ej(t),{joinRequests:y}=sp({community:t}),[b,_]=ie__default.useState(!1),{avatarFileUrl:x,pendingPostsCount:P,reviewingPosts:I,canReviewCommunityPosts:w}=gs(t.communityId),[M,T]=ie__default.useState(!1),{joinCommunity:E,cancelJoinCommunity:N}=td({community:t,joinRequest:g,onJoinSuccess:({data:z})=>{(z==null?void 0:z.status)===JoinResultStatusEnum.Pending&&(f(z==null?void 0:z.request),_(!0)),C();},onLeaveSuccess:()=>{C();},onCancelJoinSuccess:()=>{C(),T(!0),_(!1);}}),A=I.some(z=>z.postedUserId===l),D=(g==null?void 0:g.status)===JoinRequestStatusEnum.Pending&&!M,G=(O=y&&(y==null?void 0:y.length))!=null?O:0,H=P>0&&I.length>0&&(w||A)&&(t.needApprovalOnPostCreation||(t==null?void 0:t.postSetting)===CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED),$=G>0&&w,j=H||$;return ie__default.createElement(ie__default.Fragment,null,ie__default.createElement(xI,{pageId:e,componentId:i,image:x,community:t,onBack:()=>n(r),isSticky:!a&&o,onClickMenu:()=>{var z;(z=s==null?void 0:s.goToCommunitySettingPage)==null||z.call(s,{community:t});}}),ie__default.createElement("div",{className:on.content},ie__default.createElement("div",{className:on.communityProfile__name},!t.isPublic&&ie__default.createElement(ar,{pageId:e,componentId:i,className:on.communityProfile__privateIcon}),ie__default.createElement(II,{pageId:e,componentId:i,name:t.displayName}),t.isOfficial&&ie__default.createElement(sr,{className:on.communityProfile__privateIcon})),ie__default.createElement("div",{className:on.communityProfile__communityCategories},ie__default.createElement(ed,{pageId:e,componentId:i,community:t,minCategoryCharacters:10})),ie__default.createElement(PI,{pageId:e,componentId:i,description:t.description||""}),ie__default.createElement("div",{className:on.communityProfile__communityInfo__container},ie__default.createElement(Ry,{pageId:e,componentId:i,count:t.postsCount,text:`post${t.postsCount===1?"":"s"}`}),ie__default.createElement("div",{className:on.divider}),ie__default.createElement(Ry,{pageId:e,componentId:i,count:t.membersCount,text:`member${t.membersCount===1?"":"s"}`,onClick:()=>{var z;t.isJoined&&((z=s==null?void 0:s.goToMembershipPage)==null||z.call(s,{community:t}));}})),d&&d.status===InvitationStatusEnum.Pending&&ie__default.createElement(oj,{pageId:e,community:t,invitation:d,removeInvitation:()=>u(void 0)}),(!d||d.status!==InvitationStatusEnum.Pending)&&!t.isJoined&&!D&&!b&&ie__default.createElement("div",{className:on.communityProfile__joinButton__container},ie__default.createElement(Uc,{size:"medium",pageId:e,onClick:()=>{if(!m){c.info({content:"Failed to join community. Please try again."});return}E(t);},componentId:i,className:on.communityProfile__joinButton})),(!t.isJoined&&D||b)&&ie__default.createElement("div",{className:on.communityProfile__cancelJoinButton__container},ie__default.createElement(Eg,{pageId:e,componentId:i,elementId:"community_cancel_request_button",size:"small",color:"secondary",variant:"outlined",defaultIcon:ie__default.createElement(iy,{className:on.communityProfile__pendingIcon}),onPress:N,text:"Cancel request",typographyVariant:"bodyBold",className:on.communityProfile__cancelJoinButton})),(t.isJoined||t.isPublic)&&ie__default.createElement("div",null,ie__default.createElement(Bu,{type:"communityFeed",pageId:e,communityId:t.communityId})),j&&ie__default.createElement("div",{className:on.communityProfile__pendingPost__container},ie__default.createElement(vI,{pageId:e,componentId:i,pendingPostsCount:P,onClick:()=>{var z;(z=s==null?void 0:s.goToPendingRequestPage)==null||z.call(s,{community:t});},isPostOwner:A,canReviewCommunityPosts:w,isShowJoinRequest:$,isShowPendingPost:H,joinRequestsCount:G}))),ie__default.createElement("div",{className:on.communityProfile__divider}))};var bye=t=>{var e=d(t,[]);return ie__default.createElement("svg",a({width:"61",height:"41",viewBox:"0 0 61 41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M58.3438 0.5C59.7148 0.5 60.875 1.66016 60.875 3.03125V38.4688C60.875 39.9453 59.7148 41 58.3438 41H5.1875C2.33984 41 0.125 38.7852 0.125 35.9375V6.40625C0.125 5.03516 1.17969 3.875 2.65625 3.875H6.875V3.03125C6.875 1.66016 7.92969 0.5 9.40625 0.5H58.3438ZM3.5 35.9375C3.5 36.8867 4.23828 37.625 5.1875 37.625C6.03125 37.625 6.875 36.8867 6.875 35.9375V7.25H3.5V35.9375ZM57.5 37.625V3.875H10.25V35.9375V36.043C10.25 36.4648 10.0391 37.2031 9.93359 37.625H57.5ZM14.8906 27.5C14.1523 27.5 13.625 26.9727 13.625 26.2344V8.51562C13.625 7.88281 14.1523 7.25 14.8906 7.25H32.6094C33.2422 7.25 33.875 7.88281 33.875 8.51562V26.2344C33.875 26.9727 33.2422 27.5 32.6094 27.5H14.8906ZM17 10.625V24.125H30.5V10.625H17ZM13.625 32.9844V32.1406C13.625 31.5078 14.1523 30.875 14.8906 30.875H32.6094C33.2422 30.875 33.875 31.5078 33.875 32.1406V32.9844C33.875 33.7227 33.2422 34.25 32.6094 34.25H14.8906C14.1523 34.25 13.625 33.7227 13.625 32.9844ZM37.25 32.9844V32.1406C37.25 31.5078 37.7773 30.875 38.5156 30.875H52.8594C53.4922 30.875 54.125 31.5078 54.125 32.1406V32.9844C54.125 33.7227 53.4922 34.25 52.8594 34.25H38.5156C37.7773 34.25 37.25 33.7227 37.25 32.9844ZM37.25 26.2344V25.3906C37.25 24.7578 37.7773 24.125 38.5156 24.125H52.8594C53.4922 24.125 54.125 24.7578 54.125 25.3906V26.2344C54.125 26.9727 53.4922 27.5 52.8594 27.5H38.5156C37.7773 27.5 37.25 26.9727 37.25 26.2344ZM37.25 12.7344V11.8906C37.25 11.2578 37.7773 10.625 38.5156 10.625H52.8594C53.4922 10.625 54.125 11.2578 54.125 11.8906V12.7344C54.125 13.4727 53.4922 14 52.8594 14H38.5156C37.7773 14 37.25 13.4727 37.25 12.7344ZM37.25 19.4844V18.6406C37.25 18.0078 37.7773 17.375 38.5156 17.375H52.8594C53.4922 17.375 54.125 18.0078 54.125 18.6406V19.4844C54.125 20.2227 53.4922 20.75 52.8594 20.75H38.5156C37.7773 20.75 37.25 20.2227 37.25 19.4844Z"}))},s0=bye;var pf={lockPrivateContent__wrap:"Si",lockPrivateContent__lockIcon:"Ci",lockPrivateContent__title:"Tk",lockPrivateContent__body:"Vk"};var Dm=()=>ie__default.createElement("div",{className:pf.lockPrivateContent__wrap},ie__default.createElement(J1,{className:pf.lockPrivateContent__lockIcon}),ie__default.createElement(v.TitleBold,{className:pf.lockPrivateContent__title},"This community is private"),ie__default.createElement(v.Body,{className:pf.lockPrivateContent__body},"Join this community to see its content and members."));function uf({communityId:e,placement:t,shouldCall:o}){let n=it({fetcher:PostRepository.getPinnedPosts,params:{communityId:e,placement:t,sortBy:"lastPinned"},shouldCall:o}),{items:r}=n,i=d(n,["items"]);return a({pinnedPost:r},i)}var $r={communityFeed__container:"Ei",communityFeed__loadingIndicator:"Wk",communityFeed__observerTarget:"qk",communityFeed__post:"Dk",communityFeed__spinner:"Gk",spin:"Ri",communityFeed__postContent:"Ui",communityFeed__postSkeleton:"Bi",communityFeed__postSkeletonHeader:"Jk",communityFeed__postSkeletonAvatar:"Fi",communityFeed__postSkeletonUserInfo:"Kk",communityFeed__postSkeletonUsername:"Hi",communityFeed__postSkeletonSubtitle:"Li",communityFeed__postSkeletonContent:"Nk",communityFeed__postSkeletonLine:"W",pulse:"Ti",communityFeed__emptyPost:"Vi",communityFeed__emptyPostIcon:"Ok",communityFeed__emptyPostText:"Pk",communityFeed__announcePost:"Wi",communityFeed__noInternet:"Qk"};var gf=()=>ie__default.createElement("div",{className:$r.communityFeed__postSkeleton},ie__default.createElement("div",{className:$r.communityFeed__postSkeletonHeader},ie__default.createElement("div",{className:$r.communityFeed__postSkeletonAvatar}),ie__default.createElement("div",{className:$r.communityFeed__postSkeletonUserInfo},ie__default.createElement("div",{className:$r.communityFeed__postSkeletonUsername}),ie__default.createElement("div",{className:$r.communityFeed__postSkeletonSubtitle}))),ie__default.createElement("div",{className:$r.communityFeed__postSkeletonContent},ie__default.createElement("div",{className:$r.communityFeed__postSkeletonLine}),ie__default.createElement("div",{className:$r.communityFeed__postSkeletonLine}),ie__default.createElement("div",{className:$r.communityFeed__postSkeletonLine}))),r9=({pageId:e="*",communityId:t})=>{let o="community_feed_component",{isExcluded:r,accessibilityId:i,themeStyles:n}=se({pageId:e,componentId:o}),{community:a$1}=Ct({communityId:t,shouldCall:!!t}),{posts:s,hasMore:l,loadMore:m,isLoading:c,refresh:d}=Ao({feedType:"published",targetId:t,targetType:"community",limit:10}),{pinnedPost:u,refresh:g}=uf({communityId:t,shouldCall:!!t&&(a$1==null?void 0:a$1.isJoined)}),{AmityCommunityProfilePageBehavior:f}=we(),[C,y]=useState(null),b$1=(u==null?void 0:u.filter(E=>(E==null?void 0:E.placement)==="announcement"&&(E==null?void 0:E.post)))||[],_=u.length>0?u.filter(E=>{var N;return (E==null?void 0:E.placement)==="default"&&(E==null?void 0:E.post)&&!b$1.map(A=>{var D;return (D=A==null?void 0:A.post)==null?void 0:D.postId}).includes((N=E==null?void 0:E.post)==null?void 0:N.postId)}):null,x=u==null?void 0:u.some(E=>{var N;return (E==null?void 0:E.placement)==="default"&&(E==null?void 0:E.post)&&b$1.map(A=>{var D;return (D=A==null?void 0:A.post)==null?void 0:D.postId}).includes((N=E==null?void 0:E.post)==null?void 0:N.postId)}),I=s.filter(E=>E&&!b$1.some(N=>{var A;return ((A=N==null?void 0:N.post)==null?void 0:A.postId)===(E==null?void 0:E.postId)})).map(E=>{let N=_==null?void 0:_.find(A=>{var D;return ((D=A==null?void 0:A.post)==null?void 0:D.postId)===(E==null?void 0:E.postId)});return N?b(a({},E),{placement:N.placement}):E});if(ke({node:C,onIntersect:()=>{l&&!c&&m();}}),useEffect(()=>{d(),g();},[]),r)return null;let w=(E,N)=>{var A;E&&((A=f==null?void 0:f.goToPostDetailPage)==null||A.call(f,{postId:E,hideTarget:!0,category:N||"general"}));},M=()=>ie__default.createElement(ie__default.Fragment,null,I.length>0&&I.filter(E=>E&&!!E.postId).map(E=>{if(!E||!E.postId)return null;let N=(E==null?void 0:E.placement)==="default"?"pin":"general";return ie__default.createElement(V,{key:E.postId,className:$r.communityFeed__postContent,onPress:()=>w(E.postId,N)},ie__default.createElement(en,{pageId:e,key:E.postId,post:E,category:N,style:"feed",hideTarget:!0,onClick:()=>w(E.postId,N)}))}),c&&Array.from({length:3}).map((E,N)=>ie__default.createElement(gf,{key:N})),(s==null?void 0:s.length)===0&&!c&&ie__default.createElement("div",{className:$r.communityFeed__emptyPost},ie__default.createElement(s0,{className:$r.communityFeed__emptyPostIcon}),ie__default.createElement(v.Body,{className:$r.communityFeed__emptyPostText},"No posts yet")),ie__default.createElement("div",{ref:E=>y(E),className:$r.communityFeed__observerTarget})),T=()=>b$1.length>0?b$1.filter(({post:E})=>!!E&&!!E.postId).map(({post:E})=>{if(!E||!E.postId)return null;let N=x?"pin_and_announcement":"announcement";return ie__default.createElement(V,{key:E.postId,onPress:()=>w(E.postId,N),className:$r.communityFeed__announcePost},ie__default.createElement(en,{pageId:e,key:E.postId,post:E,category:N,style:"feed",hideTarget:!0,onClick:()=>w(E.postId,N),onPostDeleted:()=>g()}))}):null;return ie__default.createElement("div",{"data-testid":i,className:$r.communityFeed__container,style:n},ie__default.createElement(wr,{page:"feed",refresh:()=>{d(),g();},className:$r.communityFeed__noInternet},ie__default.createElement(ie__default.Fragment,null,a$1!=null&&a$1.isJoined||a$1!=null&&a$1.isPublic?ie__default.createElement(ie__default.Fragment,null,T(),M()):c?Array.from({length:3}).map((E,N)=>ie__default.createElement(gf,{key:N})):ie__default.createElement(Dm,null))))};var ij=({communityId:e})=>ie__default.createElement("div",null,"CommunityPinnedPost");var Nl={communityImageFeed__container:"qi",communityImageFeed__containerSkeleton:"Di",communityImageFeed__itemSkeleton:"Zk",pulse:"_k",communityImageFeed__lock:"e4"};var l0={imageGallery:"Gi",imageGallery__itemContainer:"Ji",imageGallery__item:"r4",imageGallery__brokenImg:"a4",pulse:"Ki",imageGallery__skeleton__itemContainer:"o4"};var dd={modal:"t4",modalContent:"i4",closeButton:"s4",fullImage:"d4",overlayPanel:"c4",singleImageViewer__clearButton:"l4",singleImageViewer__clearButton__img:"n4",singleImageViewer__brokenImage:"Ni"};function ff({pageId:e="*",componentId:t="*",elementId:o="*",fileId:r,onClose:i}){let{themeStyles:n}=S({pageId:e,componentId:t,elementId:o}),a=We({fileId:r,imageSize:"medium"}),[s,l]=useState(!1);return ie__default.createElement("div",{style:n},ie__default.createElement("div",{className:dd.modal,onClick:i},ie__default.createElement("div",{className:dd.modalContent,onClick:m=>m.stopPropagation()},a&&!s?ie__default.createElement("img",{src:a,alt:r,className:dd.fullImage,onError:()=>l(!0)}):ie__default.createElement("div",{className:dd.singleImageViewer__brokenImage}),ie__default.createElement("span",{className:dd.closeButton},ie__default.createElement(kn,{pageId:e,componentId:t,defaultClassName:dd.singleImageViewer__clearButton,imgClassName:dd.singleImageViewer__clearButton__img,onPress:i})))))}var Eye=({fileId:e,postIndex:t,onClickImageItem:o})=>{let r=rt({fileId:e,imageSize:"medium"}),[i,n]=useState(!1);return r&&!i?ie__default.createElement(V,{className:l0.imageGallery__itemContainer,onPress:()=>o(t)},ie__default.createElement("img",{className:l0.imageGallery__item,src:r,alt:`${e}`,onError:()=>n(!0)})):ie__default.createElement(V,{className:l0.imageGallery__itemContainer,onPress:()=>o(t)},ie__default.createElement("div",{className:l0.imageGallery__brokenImg}))},yf=({posts:e,pageId:t,componentId:o,elementId:r})=>{var m,c;let[i,n]=useState(!1),[a,s]=useState(null),l=d=>{s(d),n(!0);};return ie__default.createElement("div",{className:l0.imageGallery},e==null?void 0:e.map((d,u)=>{var g,f;return ie__default.createElement(Eye,{key:(g=d==null?void 0:d.data)==null?void 0:g.fileId,fileId:(f=d==null?void 0:d.data)==null?void 0:f.fileId,postIndex:u,onClickImageItem:l})}),e&&i&&a!==null&&ie__default.createElement(ff,{fileId:(c=(m=e[a])==null?void 0:m.data)==null?void 0:c.fileId,onClose:()=>n(!1),pageId:t,componentId:o,elementId:r}))};var hf={emptyUserImageFeed__icon:"m4",emptyCommunityImageFeed__container:"Oi",emptyCommunityImageFeed__text:"h4",emptyCommunityImageFeed__icon:"g4"};var Lye=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 49 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M12.6875 17C9.83984 17 7.625 14.7852 7.625 11.9375C7.625 9.19531 9.83984 6.875 12.6875 6.875C15.4297 6.875 17.75 9.19531 17.75 11.9375C17.75 14.7852 15.4297 17 12.6875 17ZM12.6875 10.25C11.7383 10.25 11 11.0938 11 11.9375C11 12.8867 11.7383 13.625 12.6875 13.625C13.5312 13.625 14.375 12.8867 14.375 11.9375C14.375 11.0938 13.5312 10.25 12.6875 10.25ZM44.75 0.125C46.543 0.125 48.125 1.70703 48.125 3.5V44C48.125 45.8984 46.543 47.375 44.75 47.375H4.25C2.35156 47.375 0.875 45.8984 0.875 44V3.5C0.875 1.70703 2.35156 0.125 4.25 0.125H44.75ZM44.75 44V35.5625H4.25V44H44.75ZM9.83984 32.1875H18.2773L19.543 30.5L15.3242 24.9102L9.83984 32.1875ZM22.4961 32.1875H38.5273L30.5117 21.5352L22.4961 32.1875ZM44.75 32.1875V3.5H4.25V32.1875H5.62109L13.9531 21.1133C14.5859 20.2695 15.957 20.2695 16.6953 21.1133L21.6523 27.7578L29.1406 17.7383C29.7734 16.8945 31.1445 16.8945 31.8828 17.7383L42.7461 32.1875H44.75Z",fill:e.fill})),MI=Lye;var SI=({pageId:e="*",componentId:t="*"})=>{let o="empty_community_image_feed",{themeStyles:r,accessibilityId:i}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement("div",{style:r,"data-testid":i,className:hf.emptyCommunityImageFeed__container},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(MI,{className:hf.emptyCommunityImageFeed__icon}),imgIcon:()=>ie__default.createElement(MI,{className:hf.emptyCommunityImageFeed__icon})}),ie__default.createElement("div",null,ie__default.createElement(v.TitleBold,{className:hf.emptyCommunityImageFeed__text},"No photos yet")))};var i9=({pageId:e="*",communityId:t})=>{let o="community_image_feed",[r,i]=useState(null),{community:n}=Ct({communityId:t,shouldCall:!!t}),{isExcluded:a,accessibilityId:s,themeStyles:l}=se({pageId:e,componentId:o}),{posts:m,hasMore:c,loadMore:d,refresh:u,isLoading:g}=Ao({targetId:t,targetType:"community",limit:10,dataTypes:["image"]}),f=(n==null?void 0:n.isJoined)&&!(n!=null&&n.isPublic);if(a)return null;useEffect(()=>{u();},[]),ke({node:r,onIntersect:()=>{c&&!g&&d();}});let C=()=>ie__default.createElement("div",{className:Nl.communityImageFeed__containerSkeleton},ie__default.createElement("div",{className:Nl.communityImageFeed__itemSkeleton}),ie__default.createElement("div",{className:Nl.communityImageFeed__itemSkeleton}),ie__default.createElement("div",{className:Nl.communityImageFeed__itemSkeleton}),ie__default.createElement("div",{className:Nl.communityImageFeed__itemSkeleton}),ie__default.createElement("div",{className:Nl.communityImageFeed__itemSkeleton}),ie__default.createElement("div",{className:Nl.communityImageFeed__itemSkeleton}));return f||n!=null&&n.isPublic?ie__default.createElement("div",{style:l,"data-testid":s},ie__default.createElement(wr,{page:"feed",refresh:u},ie__default.createElement("div",{className:Nl.communityImageFeed__container},(m==null?void 0:m.length)===0&&!g&&ie__default.createElement(SI,{pageId:e,componentId:o}),(m==null?void 0:m.length)>0&&ie__default.createElement(yf,{posts:m,pageId:e,componentId:t}),g&&C())),ie__default.createElement("div",{ref:y=>i(y)})):ie__default.createElement("div",{className:Nl.communityImageFeed__lock},ie__default.createElement(Dm,null))};var Cf={emptyCommunityVideoFeed__container:"Pi",emptyCommunityVideoFeed__text:"p4",emptyCommunityVideoFeed__icon:"b4"};var Uye=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 54 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M50.5195 13.625C52.3125 13.625 54 14.9961 54 17V44.1055C54 46.0039 52.3125 47.375 50.5195 47.375C49.9922 47.375 49.1484 47.1641 48.6211 46.8477L40.5 41.1523V42.3125C40.5 45.1602 38.1797 47.375 35.4375 47.375H5.0625C2.21484 47.375 0 45.1602 0 42.3125V18.6875C0 15.9453 2.21484 13.625 5.0625 13.625H6.75V8.5625C6.75 3.92188 10.4414 0.125 15.1875 0.125H32.9062C33.3281 0.125 33.75 0.546875 33.75 0.96875V2.65625C33.75 3.18359 33.3281 3.5 32.9062 3.5H15.1875C12.3398 3.5 10.125 5.82031 10.125 8.5625V13.625H35.4375C38.1797 13.625 40.5 15.9453 40.5 18.6875V19.9531L48.6211 14.2578C49.1484 13.9414 49.9922 13.7305 50.5195 13.625V17L40.5 24.0664V37.0391L50.5195 44L50.625 17L50.5195 13.625ZM37.125 42.3125V18.6875C37.125 17.8438 36.2812 17 35.4375 17H5.0625C4.11328 17 3.375 17.8438 3.375 18.6875V42.3125C3.375 43.2617 4.11328 44 5.0625 44H35.4375C36.2812 44 37.125 43.2617 37.125 42.3125ZM33.0117 20.375C33.4336 20.4805 33.6445 20.6914 33.75 21.1133V23.1172C33.6445 23.5391 33.4336 23.75 33.0117 23.75H7.38281C6.96094 23.75 6.75 23.5391 6.75 23.1172V21.1133C6.75 20.6914 6.96094 20.4805 7.38281 20.375H33.0117Z",fill:e.fill})),NI=Uye;var kI=({pageId:e="*",componentId:t="*"})=>{let o="empty_community_video_feed",{themeStyles:r,accessibilityId:i}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement("div",{style:r,"data-testid":i,className:Cf.emptyCommunityVideoFeed__container},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(NI,{className:Cf.emptyCommunityVideoFeed__icon}),imgIcon:()=>ie__default.createElement(NI,{className:Cf.emptyCommunityVideoFeed__icon})}),ie__default.createElement("div",null,ie__default.createElement(v.TitleBold,{className:Cf.emptyCommunityVideoFeed__text},"No videos yet")))};var Vm={videoGallery:"Qi",videoGallery__itemContainer:"Zi",videoGallery__item:"u4",videoGallery__duration:"f4",videoGallery__brokenImg:"v4",pulse:"_i",videoGallery__skeleton__itemContainer:"w4",videoGallery__skeleton__item:"x4"};var dp={modal:"y4",modalContent:"k4",closeButton:"j4",fullImage:"z4",nextButton:"X4",prevButton:"Y4",overlayPanel:"I4",overlayPanel__prev:"es",overlayPanel__next:"rs",overlayPanel__prevButton:"as",overlayPanel__nextButton:"A4",overlayPanel__middle:"M4",videoViewer__clearButton:"S4",videoViewer__clearButton__img:"C4"};var Zye=memo(({fileId:e,thumbnailFileId:t,isMuted:o=!1})=>{let r=pr(e),i=pr(t),n=useRef(null),a=useMemo(()=>{if(r==null)return null;if(r.status===b2.Transcoded){let{videoUrl:s}=r;return (s==null?void 0:s["1080p"])||(s==null?void 0:s["720p"])||(s==null?void 0:s["480p"])||(s==null?void 0:s["360p"])||(s==null?void 0:s.original)||r.fileUrl}return r.fileUrl},[r]);return useEffect(()=>{var s;(s=n.current)==null||s.load();},[a]),a==null?ie__default.createElement(ie__default.Fragment,null):ie__default.createElement("video",{controls:!0,controlsList:"nodownload",autoPlay:!1,className:dp.fullImage,ref:n,poster:i==null?void 0:i.fileUrl,muted:o},ie__default.createElement("source",{src:a,type:"video/mp4"}),ie__default.createElement("p",null,"Your browser does not support this format of video. Please try again later once the server transcodes the video into an playable format(mp4)."))});function vf({pageId:e="*",componentId:t="*",elementId:o="*",fileId:r,thumbnailFileId:i,isMuted:n=!1,onClose:a}){let{themeStyles:s}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement("div",{style:s},ie__default.createElement("div",{className:dp.modal,onClick:a},ie__default.createElement("div",{className:dp.modalContent,onClick:l=>l.stopPropagation()},ie__default.createElement(Zye,{fileId:r,thumbnailFileId:i,isMuted:n}),ie__default.createElement("span",{className:dp.closeButton},ie__default.createElement(kn,{pageId:e,componentId:t,defaultClassName:dp.videoViewer__clearButton,imgClassName:dp.videoViewer__clearButton__img,onPress:a})))))}var n9=e=>{let t=Math.floor(e/3600),o=Math.floor(e%3600/60),r=Math.floor(e%60),i=t>0?`${t.toString().padStart(2,"0")}:`:"",n=`${o.toString().padStart(2,"0")}:`,a=r.toString().padStart(2,"0");return `${i}${n}${a}`};var Wye=({videoFileId:e,thumbnailFileId:t,postIndex:o,onClickVideoItem:r})=>{var l;let[i,n]=useState(!1),a=rt({fileId:t,imageSize:"medium"}),s=W2(e);return !a||!s?ie__default.createElement("div",{className:Vm.videoGallery__skeleton__itemContainer},ie__default.createElement(bl,{className:Vm.videoGallery__skeleton__item})):i?ie__default.createElement(V,{className:Vm.videoGallery__itemContainer,onPress:()=>r(o)},ie__default.createElement("div",{className:Vm.videoGallery__brokenImg})):ie__default.createElement(V,{className:Vm.videoGallery__itemContainer,onPress:()=>r(o)},ie__default.createElement("img",{className:Vm.videoGallery__item,src:a,alt:`${t}`,onError:()=>n(!0)}),ie__default.createElement(v.Caption,{className:Vm.videoGallery__duration},n9(((l=s==null?void 0:s.attributes.metadata)==null?void 0:l.video).duration)))},_f=({posts:e,pageId:t,componentId:o,elementId:r})=>{var m,c,d,u,g,f,C;let[i,n]=useState(!1),[a,s]=useState(null),l=y=>{s(y),n(!0);};return ie__default.createElement("div",{className:Vm.videoGallery},e==null?void 0:e.map((y,b)=>{var _,x,P,I,w,M,T;return ie__default.createElement(Wye,{key:(x=(_=y==null?void 0:y.data)==null?void 0:_.videoFileId)==null?void 0:x.original,videoFileId:(w=(I=(P=y==null?void 0:y.data)==null?void 0:P.videoFileId)==null?void 0:I.original)!=null?w:"",thumbnailFileId:(T=(M=y==null?void 0:y.data)==null?void 0:M.thumbnailFileId)!=null?T:"",postIndex:b,onClickVideoItem:l})}),e&&i&&a!==null&&ie__default.createElement(vf,{pageId:t,componentId:o,elementId:r,fileId:(u=(d=(c=(m=e[a])==null?void 0:m.data)==null?void 0:c.videoFileId)==null?void 0:d.original)!=null?u:"",thumbnailFileId:(C=(f=(g=e[a])==null?void 0:g.data)==null?void 0:f.thumbnailFileId)!=null?C:"",onClose:()=>n(!1)}))};var EI={tabButton__tabsButton:"os",tabButton__tabsButtonlabel:"ts"};var bf=({pageId:e="*",componentId:t="*",elementId:o="*",tab:r,activeTab:i,setActiveTab:n})=>{let{accessibilityId:a,config:s,themeStyles:l}=S({pageId:e,componentId:t,elementId:o});return ie__default.createElement(oe,{style:l,id:o,key:r.type,variant:"text",className:EI.tabButton__tabsButton,onPress:()=>n(r.type),"data-testid":a,"data-active":i===r.type},ie__default.createElement(v.Body,{className:EI.tabButton__tabsButtonlabel,"data-active":i===r.type},s.text))};var cd={clipGallery:"is",clipGallery__itemContainer:"ss",clipGallery__item:"ds",clipGallery__duration:"E4",clipGallery__brokenImg:"R4",pulse:"U4",clipGallery__skeleton__itemContainer:"B4",clipGallery__skeleton__item:"F4"};var Qye=({videoFileId:e,thumbnailFileId:t,postIndex:o,onClickVideoItem:r,displayMode:i="fill"})=>{var m;let[n,a]=useState(!1),s=rt({fileId:t,imageSize:"medium"}),l=W2(e);return !s||!l?ie__default.createElement(oe,{variant:"text",onPress:()=>r(o)},ie__default.createElement("div",{className:cd.clipGallery__skeleton__itemContainer})):n?ie__default.createElement(oe,{variant:"text",className:cd.clipGallery__itemContainer,onPress:()=>r(o)},ie__default.createElement("div",{className:cd.clipGallery__brokenImg})):ie__default.createElement(oe,{variant:"text",className:cd.clipGallery__itemContainer,onPress:()=>r(o)},ie__default.createElement("img",{className:cd.clipGallery__item,src:s,alt:`${t}`,onError:()=>a(!0),"data-isfill":i==="fill"}),ie__default.createElement(v.Caption,{className:cd.clipGallery__duration},n9((m=l==null?void 0:l.attributes.metadata.video)==null?void 0:m.duration)))},a9=({posts:e,pageId:t,componentId:o,elementId:r})=>{var u,g,f,C,y,b;let[i,n]=useState(!1),[a,s]=useState(null),{isDesktop:l}=le(),{AmityCommunityProfilePageBehavior:m,AmityUserProfilePageBehavior:c}=we(),d=_=>{var x,P,I,w,M,T;if(l)s(_),n(!0);else return (T=(P=((x=e==null?void 0:e[_])==null?void 0:x.targetType)==="community"?m:c)==null?void 0:P.goToClipFeedPage)==null?void 0:T.call(P,{currentPostId:((I=e==null?void 0:e[_])==null?void 0:I.postId)||void 0,postIndex:_,targetId:((w=e==null?void 0:e[_])==null?void 0:w.targetId)||void 0,targetType:((M=e==null?void 0:e[_])==null?void 0:M.targetType)||void 0})};return ie__default.createElement("div",{className:cd.clipGallery},e==null?void 0:e.map((_,x)=>{var P,I,w,M;return ie__default.createElement(Qye,{key:(P=_==null?void 0:_.data)==null?void 0:P.fileId,videoFileId:(I=_==null?void 0:_.data)==null?void 0:I.fileId,thumbnailFileId:((w=_.data)==null?void 0:w.thumbnailFileId)||void 0,postIndex:x,onClickVideoItem:d,displayMode:((M=_.data)==null?void 0:M.displayMode)||"fill"})}),e&&l&&i&&a!==null&&ie__default.createElement(vf,{pageId:t,componentId:o,elementId:r,fileId:(g=(u=e[a])==null?void 0:u.data)==null?void 0:g.fileId,thumbnailFileId:(C=(f=e[a])==null?void 0:f.data)==null?void 0:C.thumbnailFileId,onClose:()=>n(!1),isMuted:((b=(y=e[a])==null?void 0:y.data)==null?void 0:b.isMuted)||!1}))};var LI={emptyClipFeed__icon:"H4",emptyClipFeed:"L4"};var Jye=t=>{var e=d(t,[]);return ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M50.75 7.125C54.4414 7.125 57.5 10.1836 57.5 13.875V47.625C57.5 51.4219 54.4414 54.375 50.75 54.375H10.25C6.45312 54.375 3.5 51.4219 3.5 47.625V13.875C3.5 10.1836 6.45312 7.125 10.25 7.125H50.75ZM49.168 10.5H37.8828L27.7578 20.625H39.043L49.168 10.5ZM33.1367 10.5H21.8516L11.7266 20.625H23.0117L33.1367 10.5ZM6.875 13.875V20.625H6.98047L17.1055 10.5H10.25C8.35156 10.5 6.875 12.082 6.875 13.875ZM54.125 47.625V24H6.875V47.625C6.875 49.5234 8.35156 51 10.25 51H50.75C52.543 51 54.125 49.5234 54.125 47.625ZM54.125 20.625V13.875C54.125 12.9258 53.7031 12.082 52.9648 11.4492L43.7891 20.625H54.125ZM25.1211 47.3086C24.2773 46.7812 23.75 45.832 23.75 44.7773V30.2227C23.75 29.2734 24.2773 28.3242 25.1211 27.7969C26.0703 27.2695 27.125 27.2695 28.0742 27.9023L39.2539 35.0742C40.0977 35.6016 40.625 36.4453 40.625 37.5C40.625 38.5547 40.0977 39.3984 39.2539 39.9258L28.0742 47.2031C27.5469 47.5195 27.0195 47.625 26.4922 47.625C26.0703 47.625 25.543 47.5195 25.1211 47.3086ZM27.125 31.2773V43.8281L36.7227 37.5L27.125 31.2773Z",fill:"currentColor"}))},mj=Jye;var xf={emptyContent:"cs",emptyContent__text:"T4"};var Fo=({pageId:e="*",componentId:t="*",elementId:o="*",infoElementId:r="*",text:i,emptyContentClassName:n,defaultIcon:a})=>{let{config:s,defaultConfig:l,isExcluded:m,themeStyles:c,accessibilityId:d,uiReference:u}=S({pageId:e,componentId:t,elementId:o}),{config:g}=S({pageId:e,componentId:t,elementId:r});return m?null:ie__default.createElement("div",{style:c,"data-testid":d,className:wl(xf.emptyContent,n)},ie__default.createElement(Z,{defaultIcon:a,configIconName:s.image,defaultIconName:l.image,imgIcon:()=>ie__default.createElement("img",{src:s.image,alt:u})}),s.text?ie__default.createElement(ie__default.Fragment,null,ie__default.createElement(v.TitleBold,{className:xf.emptyContent__text},s.text),g.text&&ie__default.createElement(v.Caption,{className:xf.emptyContent__text},g.text)):i?ie__default.createElement(v.TitleBold,{className:xf.emptyContent__text},i):null)};var Pf=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"empty_clip_feed",defaultIcon:()=>ie__default.createElement(mj,{className:LI.emptyClipFeed__icon}),emptyContentClassName:LI.emptyClipFeed});var bs={communityVideoFeed__container:"ls",communityVideoFeed__containerSkeleton:"ns",communityVideoFeed__itemSkeleton:"V4",pulse:"W4",communityVideoFeed__lock:"q4",communityVideoFeed__videoFeedTabs:"ms",communityVideoFeed__observerTarget:"D4"};var s9=({pageId:e="*",communityId:t})=>{let o="community_video_feed",[r,i]=useState(null),[n,a]=useState(null),[s,l]=useState("videos"),{community:m}=Ct({communityId:t,shouldCall:!!t}),{isExcluded:c,accessibilityId:d,themeStyles:u}=se({pageId:e,componentId:o}),{posts:g,hasMore:f,loadMore:C,refresh:y,isLoading:b}=Ao({targetId:t,targetType:"community",limit:10,dataTypes:["video"]}),{posts:_,hasMore:x,loadMore:P,refresh:I,isLoading:w}=Ao({targetId:t,targetType:"community",limit:10,dataTypes:["clip"]}),M=(m==null?void 0:m.isJoined)&&!(m!=null&&m.isPublic);if(c)return null;useEffect(()=>{y(),I();},[]),ke({node:r,onIntersect:()=>{f&&!b&&C();}}),ke({node:n,onIntersect:()=>{x&&!w&&P();}});let T=[{type:"videos",elementId:"videos_button"},{type:"clips",elementId:"clips_button"}],E=()=>ie__default.createElement("div",{className:bs.communityVideoFeed__videoFeedTabs},T.map(D=>ie__default.createElement(bf,{key:D.type,pageId:e,componentId:o,elementId:D.elementId,tab:D,activeTab:s,setActiveTab:l}))),N=()=>ie__default.createElement("div",{className:bs.communityVideoFeed__containerSkeleton},ie__default.createElement("div",{className:bs.communityVideoFeed__itemSkeleton}),ie__default.createElement("div",{className:bs.communityVideoFeed__itemSkeleton}),ie__default.createElement("div",{className:bs.communityVideoFeed__itemSkeleton}),ie__default.createElement("div",{className:bs.communityVideoFeed__itemSkeleton}),ie__default.createElement("div",{className:bs.communityVideoFeed__itemSkeleton}),ie__default.createElement("div",{className:bs.communityVideoFeed__itemSkeleton}));if(!(M||m!=null&&m.isPublic))return ie__default.createElement("div",{className:bs.communityVideoFeed__lock},ie__default.createElement(Dm,null));let A=()=>s==="videos"?ie__default.createElement(ie__default.Fragment,null,(g==null?void 0:g.length)===0&&!b&&ie__default.createElement(kI,{pageId:e,componentId:o}),(g==null?void 0:g.length)>0&&ie__default.createElement(_f,{posts:g,pageId:e,componentId:t}),b&&N(),f&&ie__default.createElement("div",{ref:D=>i(D)})):ie__default.createElement(ie__default.Fragment,null,(_==null?void 0:_.length)===0&&!w&&ie__default.createElement(Pf,{pageId:e,componentId:o}),(_==null?void 0:_.length)>0&&ie__default.createElement(a9,{posts:_,pageId:e,componentId:t}),w&&N(),x&&ie__default.createElement("div",{ref:D=>a(D)}));return ie__default.createElement("div",{style:u,"data-testid":d},ie__default.createElement(wr,{page:"feed",refresh:y},ie__default.createElement(ie__default.Fragment,null,E(),ie__default.createElement("div",{className:bs.communityVideoFeed__container},A()))))};var Zr={pendingPostContent__container:"be",pendingPostContent__bar:"G4",pendingPostContent__userDetail:"J4",pendingPostContent__username:"K4",pendingPostContent__information__subtitle:"N4",pendingPostContent__editedTag:"O4",pendingPostContent__deletePost__icon:"P4",pendingPostContent__deletePost__text:"Q4",pendingPostContent__wrapRightMenu:"Z4",pendingPostContent__actionButton:"_4",pendingPostContent__item:"e7",pendingPostContent__textPost:"r7",pendingPostContent__buttonWrapper:"a7",pendingPostContent__imageViewer:"o7",pendingPostContent__imageViewerOverlay:"hs"};var DI={postAcceptButton__button:"t7",postAcceptButton__text:"i7"};var If=i=>{var n=i,{onClick:e,pageId:t="*",componentId:o="*"}=n,r=d(n,["onClick","pageId","componentId"]);let a$1="post_accept_button",{accessibilityId:s,config:l,isExcluded:m,themeStyles:c}=S({pageId:t,componentId:o,elementId:a$1});return m?null:ie__default.createElement(oe,a({size:"medium",variant:"fill",onPress:e,className:DI.postAcceptButton__button},r),ie__default.createElement(v.BodyBold,{style:c,"data-testid":s,className:DI.postAcceptButton__text},l==null?void 0:l.text))};var VI={postDeclineButton__button:"s7",postDeclineButton__text:"d7"};var l9=i=>{var n=i,{onClick:e,pageId:t="*",componentId:o="*"}=n,r=d(n,["onClick","pageId","componentId"]);let a$1="post_decline_button",{accessibilityId:s,config:l,isExcluded:m,themeStyles:c}=S({pageId:t,componentId:o,elementId:a$1});return m?null:ie__default.createElement(oe,a({size:"medium",onPress:e,color:"secondary",variant:"outlined",className:VI.postDeclineButton__button},r),ie__default.createElement(v.BodyBold,{style:c,"data-testid":s,className:VI.postDeclineButton__text},l==null?void 0:l.text))};var m9=({pageId:e="*",post:t,canReviewCommunityPosts:o=!1,refresh:r})=>{var G,H,$,j;let i="pending_post_content",{accessibilityId:n,themeStyles:a}=se({pageId:e,componentId:i}),{currentUserId:s}=Xt(),{post:l$1}=Ir(t==null?void 0:t.postId),{setDrawerData:m,removeDrawerData:c}=tt(),d=ce(),{online:u}=useNetworkState(),{openPopup:g,closePopup:f}=Se(),{isDesktop:C}=le(),[y,b]=useState(!1),[_,x]=useState(null),P=useMemo(()=>{if(t!=null&&l$1!=null)return zV(t==null?void 0:t.updatedAt).unix()>zV(l$1==null?void 0:l$1.updatedAt).unix()?t:l$1;if(l$1!=null)return l$1;if(t!=null)return t},[t,l$1]),I=O=>l(void 0,null,function*(){if(O!=null)try{yield PostRepository.approvePost(O),d.success({content:"Post accepted."});}catch(z){d.info({content:"Failed to accept post. This post has been reviewed by another moderator."}),r==null||r();}}),w=O=>l(void 0,null,function*(){if(O!=null)try{yield PostRepository.declinePost(O),d.success({content:"Post declined."});}catch(z){d.info({content:"Failed to decline post. This post has been reviewed by another moderator."}),r==null||r();}}),M=O=>l(void 0,null,function*(){if(O!=null)try{yield PostRepository.deletePost(O),c(),d.success({content:"Post deleted."});}catch(z){d.info({content:"Failed to delete post. Post has been deleted."}),r==null||r();}}),T=O=>O===s,E=O=>{P&&g({id:"image-viewer",disabledAnimation:!0,isDismissable:C,className:Zr.pendingPostContent__imageViewer,overlayClassName:Zr.pendingPostContent__imageViewerOverlay,children:ie__default.createElement($u,{post:P,onClose:N,initialImageIndex:O})});},N=()=>{f("image-viewer");},A=O=>{b(!0),x(O);},D=()=>{b(!1),x(null);};return P?ie__default.createElement(ie__default.Fragment,null,ie__default.createElement("div",{"data-testid":n,style:a,className:Zr.pendingPostContent__container,key:P.postId},ie__default.createElement("div",{className:Zr.pendingPostContent__bar},ie__default.createElement("div",{className:Zr.pendingPostContent__userDetail},ie__default.createElement(Ae,{pageId:e,componentId:i,userId:P==null?void 0:P.postedUserId}),ie__default.createElement("div",null,ie__default.createElement(v.BodyBold,{className:Zr.pendingPostContent__username,"data-testid":`${e}/${i}/username`},(H=(G=P.creator)==null?void 0:G.displayName)!=null?H:""),ie__default.createElement("div",{className:Zr.pendingPostContent__information__subtitle},ie__default.createElement(gi,{timestamp:P.createdAt}),P.createdAt!==P.editedAt&&ie__default.createElement(v.Caption,{"data-testid":`${e}/${i}/post_edited_text`,className:Zr.pendingPostContent__editedTag},"(edited)")))),T(P.postedUserId)&&ie__default.createElement("div",{className:Zr.pendingPostContent__wrapRightMenu},ie__default.createElement(ft,{containerClassName:Zr.pendingPostContent__actionButton,trigger:{pageId:e,componentId:i,onClick:({closePopover:O})=>m({content:ie__default.createElement(V,{className:Zr.pendingPostContent__item,"data-testid":`${e}/${i}/delete_post`,onPress:()=>{O(),M(P.postId),c();}},ie__default.createElement(Dn,{className:Zr.pendingPostContent__deletePost__icon}),ie__default.createElement(v.TitleBold,{className:Zr.pendingPostContent__deletePost__text},"Delete post"))})}},({closePopover:O})=>ie__default.createElement(V,{className:Zr.pendingPostContent__item,"data-testid":`${e}/${i}/delete_post`,onPress:()=>{O(),M(P.postId);}},ie__default.createElement(Dn,{className:Zr.pendingPostContent__deletePost__icon}),ie__default.createElement(v.TitleBold,{className:Zr.pendingPostContent__deletePost__text},"Delete post"))))),ie__default.createElement("div",{className:Zr.pendingPostContent__textPost},ie__default.createElement(Gc,{pageId:e,componentId:i,text:E1(P)?($=P==null?void 0:P.data)==null?void 0:$.text:"",mentioned:(j=P==null?void 0:P.metadata)==null?void 0:j.mentioned,mentionees:P==null?void 0:P.mentionees,post:P}),P.children.length>0&&ie__default.createElement(e0,{pageId:e,componentId:i,post:P,onImageClick:E,onVideoClick:A,onClipClick:()=>{}})),o&&ie__default.createElement("div",{className:Zr.pendingPostContent__buttonWrapper},ie__default.createElement(If,{pageId:e,componentId:i,onClick:()=>{if(!u){d.info({content:"Failed to accept post. Please try again."});return}I(P.postId);}}),ie__default.createElement(l9,{pageId:e,componentId:i,onClick:()=>{{if(!u){d.info({content:"Failed to decline post. Please try again."});return}w(P.postId);}}})),y&&P&&typeof _=="number"?ie__default.createElement(Zu,{post:P,onClose:D,initialVideoIndex:_}):null)):null};var to={userProfileHeader__container:"c7",userProfileHeader__header:"l7",userProfileHeader__displayName:"n7",userProfileHeader__avatar:"m7",userProfileHeader__avatar__placeholder:"h7",userProfileHeader__badge__container:"g7",userProfileHeader__badge:"p7",userProfileHeader__description:"b7",userProfileHeader__relationship:"u7",userProfileHeader__relationship__separator:"f7",userProfileHeader__skeleton:"v7",userProfileHeader__skeleton__header:"w7",userProfileHeader__skeleton__avatar:"gs",userProfileHeader__skeleton__displayName:"ps",userProfileHeader__skeleton__about:"ue",userProfileHeader__skeleton__relationship__text:"bs",pulse:"us",userProfileHeader__skeleton__relationship:"x7",userProfileHeader__popOver__container:"y7",userProfileHeader__unFollowButton:"fs",userProfileHeader__unFollowButton__icon:"k7",userProfileHeader__unFollowButton__text:"j7",pendingCountButton:"z7",pendingCountButton__inner:"X7",pendingCountButton__notification:"Y7",pendingCountButton__notification__icon:"I7",pendingCountButton__notification__text:"A7",pendingCountButton__notification__requestCount:"M7"};var d9={userFollowing__container:"S7",userFollowing__count:"C7",userFollowing__label:"E7"};var c9e=e=>{let[t,o]=useState(0),[r,i]=useState(0),[n,a]=useState(null),[s,l]=useState(0);return Cn({fetcher:UserRepository.Relationship.getFollowInfo,params:e,callback:m=>{m.data&&(o(m.data.followerCount),i(m.data.followingCount),l(m.data.pendingCount),m.data.status&&a(m.data.status));},shouldCall:!!e}),{followerCount:t,followingCount:r,pendingCount:s,followStatus:n}},Bi=c9e;var El={userRelationshipPage:"vs",userRelationshipPage__container:"ws",userRelationshipPage__content:"xs",userRelationshipPage__tabBar:"R7",userRelationshipPage__topBar:"ys",userRelationshipPage__displayName:"U7",userRelationshipPage__feedTabs:"B7",userRelationshipPage__topSection:"F7",userRelationshipPage__tabList:"H7",userRelationshipPage__tabPanel:"L7"};var wf={tabs:"ks",tabsList:"js",tabPanel:"zs",tab:"x"};var Um=l=>{var m=l,{tabs:e,onChange:t,activeTab:o,className:r,labelClassName:i,tabListClassName:n,tabPanelClassName:a$1}=m,s=d(m,["tabs","onChange","activeTab","className","labelClassName","tabListClassName","tabPanelClassName"]);return ie__default.createElement(Tabs,b(a({},s),{selectedKey:o,onSelectionChange:t,className:wl(wf.tabs,r)}),ie__default.createElement(TabList,{"aria-label":s["aria-label"],className:wl(wf.tabsList,n)},e.map(c=>ie__default.createElement(Tab,{id:c.value,key:c.value,className:wf.tab,"data-testid":c.accessibilityId},ie__default.createElement(v.TitleBold,{className:i},c.label)))),e.map(c=>ie__default.createElement(TabPanel,{id:c.value,key:c.value,className:wl(wf.tabPanel,a$1)},c.content())))};function OI({userId:e,status:t}){let i=it({fetcher:UserRepository.Relationship.getFollowings,params:{limit:20,userId:e,status:t!=null?t:void 0},shouldCall:!!e}),{items:o}=i,r=d(i,["items"]);return a({followings:o},r)}var cp={userRelationshipList__container:"Xs",userRelationshipList__menuContainer:"T7",userRelationshipList__menuButton:"V7",userRelationshipList__menuButton__icon:"W7",userRelationshipList__menuButton__label:"q7",userRelationshipList__observerTarget:"D7",userRelationshipList__emptyIcon:"G7",userRelationshipList__emptyContainer:"J7",userRelationshipList__skeletonContainer:"Ys",userRelationshipList__emptyText:"K7"};var Hn={userItem:"N7",userItem__buttonWrap:"O7",userItem__avatar:"P7",userItem__displayName:"Q7",userItem__menuContainer:"Is",userItem__menuButton:"Z7",userItem__menuButtonSkeleton:"_7","skeleton-pulse":"As",userItem__menuButton__icon:"e3",userItem__menuButton__label:"r3"};var b9e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M23.0391 19.8086C23.25 20.0195 23.3203 20.3711 23.1094 20.6172L22.7578 21.0391C22.582 21.2852 22.1953 21.3203 21.9844 21.1445L0.960938 4.69141C0.714844 4.51562 0.679688 4.16406 0.855469 3.91797L1.20703 3.46094C1.41797 3.25 1.76953 3.17969 2.01562 3.39062L23.0391 19.8086ZM12 4.9375C10.6992 4.9375 9.60938 5.67578 9.01172 6.73047L7.67578 5.67578C8.58984 4.23438 10.1719 3.25 12 3.25C14.7773 3.25 17.0625 5.53516 17.0625 8.3125C17.0625 9.71875 16.5 10.9492 15.5859 11.8633L14.25 10.8086C14.918 10.2109 15.375 9.33203 15.375 8.3125C15.375 6.48438 13.8281 4.9375 12 4.9375ZM5.8125 19.5625H17.2383L19.0664 21.0039C18.7852 21.1797 18.5039 21.25 18.1875 21.25H5.8125C4.86328 21.25 4.125 20.5117 4.125 19.5625V18.6836C4.125 16.082 6.23438 13.9375 8.83594 13.9727C9.22266 13.9727 9.60938 14.043 9.96094 14.1836C10.1367 14.2188 10.3125 14.2539 10.4883 14.3242L12.8086 16.1172C12.5273 16.1523 12.2812 16.1875 12 16.1875C11.1211 16.1875 10.2422 16.0469 9.39844 15.7656C9.15234 15.6953 8.97656 15.625 8.83594 15.625C7.14844 15.625 5.8125 16.9961 5.8125 18.6836V19.5625Z",fill:"currentColor"})),Al=b9e;var x9e=()=>{let{confirm:e}=Te(),t=ce(),{mutateAsync:o}=useMutation({mutationFn:a=>UserRepository.Relationship.blockUser(a),onSuccess:()=>{t.success({content:"User blocked."});},onError:()=>{t.error({content:"Failed to block user. Please try again."});}}),{mutateAsync:r}=useMutation({mutationFn:a=>UserRepository.Relationship.unBlockUser(a),onSuccess:()=>{t.success({content:"User unblocked."});},onError:()=>{t.error({content:"Failed to unblock user. Please try again."});}});return {blockUser:({pageId:a,componentId:s,userId:l,displayName:m})=>{e({pageId:a,componentId:s,title:"Block user?",content:`${m} won\u2019t be able to see posts and comments that you\u2019ve created. They won\u2019t be notified that you\u2019ve blocked them.`,cancelText:"Cancel",okText:"Block",onOk:()=>o(l)});},unblockUser:({pageId:a,componentId:s,userId:l,displayName:m})=>{e({pageId:a,componentId:s,title:"Unblock user?",content:`${m} will now be able to see posts and comments that you\u2019ve created. They won\u2019t be notified that you\u2019ve unblocked them.`,cancelText:"Cancel",okText:"Unblock",onOk:()=>r(l)});}}},ud=x9e;var P9e=()=>{let e=ce(),{mutateAsync:t}=useMutation({mutationFn:r=>UserRepository.flagUser(r),onSuccess:()=>{e.success({content:"User reported."});},onError:()=>{e.error({content:"Failed to report user. Please try again."});}}),{mutateAsync:o}=useMutation({mutationFn:r=>UserRepository.unflagUser(r),onSuccess:()=>{e.success({content:"User unreported."});},onError:()=>{e.error({content:"Failed to unreported user. Please try again."});}});return {reportUser:t,unReportUser:o}},p9=P9e;var T9e=e=>{let{data:t,isLoading:o,isFetching:r}=useQuery({queryKey:["asc-uikit","UserRepository","isUserReportedByMe",e],queryFn:()=>UserRepository.isUserFlaggedByMe(e),enabled:e!=null});return {isLoading:o,isFetching:r,isReportedByMe:t}},u9=T9e;var zI=({user:e,closePopover:t,pageId:o="*",componentId:r="*"})=>{let{blockUser:i}=ud(),{removeDrawerData:n}=tt(),{reportUser:a,unReportUser:s}=p9(),{isReportedByMe:l,isFetching:m}=u9(e.userId),{online:c}=useNetworkState(),d=ce();return ie__default.createElement("div",{className:Hn.userItem__menuContainer},m?Array.from({length:2}).map((u,g)=>ie__default.createElement("div",{className:Hn.userItem__menuButtonSkeleton,key:g})):ie__default.createElement(ie__default.Fragment,null,ie__default.createElement(oe,{variant:"text","data-testid":`${o}/${r}/report_user_button`,className:Hn.userItem__menuButton,onPress:()=>{if(t(),n(),!c){d.info({content:`Failed to ${l?"unreport":"report"} user. Please try again.`});return}l?s(e.userId):a(e.userId);}},ie__default.createElement(V3,{className:Hn.userItem__menuButton__icon}),ie__default.createElement(v.BodyBold,{className:Hn.userItem__menuButton__label},l?"Unreport user":"Report user")),ie__default.createElement(oe,{variant:"text",className:Hn.userItem__menuButton,"data-testid":`${o}/${r}/block_user_button`,onPress:()=>{var u;if(t(),n(),!c){d.info({content:"Failed to block user. Please try again."});return}i({pageId:o,componentId:r,userId:e.userId,displayName:(u=e.displayName)!=null?u:""});}},ie__default.createElement(Al,{className:Hn.userItem__menuButton__icon}),ie__default.createElement(v.BodyBold,{className:Hn.userItem__menuButton__label},"Block user"))))};var _j=({userId:e,pageId:t="*",componentId:o="*"})=>{let{AmityUserRelationshipPageBehavior:r}=we(),{setDrawerData:i}=tt(),{user:n}=qe({userId:e});return n?ie__default.createElement("div",{className:Hn.userItem},ie__default.createElement(V,{onPress:()=>{var a;return (a=r==null?void 0:r.goToUserProfilePage)==null?void 0:a.call(r,{userId:e})},className:Hn.userItem__buttonWrap},ie__default.createElement(Ae,{pageId:t,componentId:o,userId:n.userId,className:Hn.userItem__avatar}),ie__default.createElement(v.BodyBold,{className:Hn.userItem__displayName},n.displayName)),ie__default.createElement(ft,{trigger:{pageId:t,componentId:o,onClick:({closePopover:a})=>i({content:ie__default.createElement(zI,{closePopover:a,user:n})})}},({closePopover:a})=>ie__default.createElement(zI,{closePopover:a,user:n}))):null};var g9={userListSkeleton:"a3",userListSkeleton__avatar:"Ms",userListSkeleton__displayName:"Ss","skeleton-pulse":"Cs"};var Fl=()=>ie__default.createElement("div",{className:g9.userListSkeleton},ie__default.createElement("div",{className:g9.userListSkeleton__avatar}),ie__default.createElement("div",{className:g9.userListSkeleton__displayName}));var Mf=({pageId:e="*",componentId:t="*",relationships:o,hasMore:r=!1,isLoading:i=!1,type:n,loadMore:a})=>{let[s,l]=useState(null),m=()=>ie__default.createElement("div",{className:cp.userRelationshipList__skeletonContainer},Array.from({length:5}).map((c,d)=>ie__default.createElement(Fl,{key:d})));return ke({onIntersect:()=>{i===!1&&(a==null||a());},node:s,options:{threshold:.7}}),ie__default.createElement("div",{className:cp.userRelationshipList__container},!i&&(o==null?void 0:o.length)===0?ie__default.createElement("div",{className:cp.userRelationshipList__emptyContainer},ie__default.createElement(q2,{className:cp.userRelationshipList__emptyIcon}),ie__default.createElement(v.TitleBold,{className:cp.userRelationshipList__emptyText},"Nothing here to see yet")):ie__default.createElement(ie__default.Fragment,null,o==null?void 0:o.map(c=>{let d=c[n==="following"?"to":"from"];return ie__default.createElement(_j,{key:d,userId:d,pageId:e,componentId:t})})),i&&m(),r&&ie__default.createElement("div",{ref:c=>l(c),className:cp.userRelationshipList__observerTarget}))};var bj=({userId:e,pageId:t="*",componentId:o="*"})=>{let{followings:r,hasMore:i,loadMore:n,isLoading:a}=OI({userId:e,status:"accepted"});return ie__default.createElement(Mf,{relationships:r,type:"following",pageId:t,componentId:o,hasMore:i,loadMore:n,isLoading:a})};function Sf({userId:e,status:t}){let i=it({fetcher:UserRepository.Relationship.getFollowers,params:{limit:20,userId:e,status:t!=null?t:void 0},shouldCall:!!e}),{items:o}=i,r=d(i,["items"]);return a({followers:o},r)}var xj=({userId:e,pageId:t="*",componentId:o="*"})=>{let{followers:r,hasMore:i,loadMore:n,isLoading:a}=Sf({userId:e,status:"accepted"});return ie__default.createElement(Mf,{relationships:r,type:"followers",pageId:t,componentId:o,hasMore:i,loadMore:n,isLoading:a})};var Hm=(o=>(o.FOLLOWING="following",o.FOLLOWER="followers",o))(Hm||{}),up=({userId:e,selectedTab:t})=>{let o="user_releationship_page",{themeStyles:r}=ue({pageId:o}),{user:i}=qe({userId:e}),{onBack:n}=Y(),[a,s]=useState(t),l=[{label:"Following",value:"following",content:()=>ie__default.createElement(bj,{userId:e})},{label:"Followers",value:"followers",content:()=>ie__default.createElement(xj,{userId:e})}];return ie__default.createElement("div",{className:El.userRelationshipPage,style:r},ie__default.createElement("div",{className:El.userRelationshipPage__container},ie__default.createElement("div",{className:El.userRelationshipPage__topSection},ie__default.createElement("div",{className:El.userRelationshipPage__topBar},ie__default.createElement(ze,{pageId:o,onPress:()=>n()}),ie__default.createElement(v.TitleBold,{className:El.userRelationshipPage__displayName},i==null?void 0:i.displayName))),ie__default.createElement("div",{className:El.userRelationshipPage__content},ie__default.createElement(Um,{className:El.userRelationshipPage__tabBar,tabs:l,activeTab:a,onChange:m=>s(m),tabListClassName:El.userRelationshipPage__tabList,tabPanelClassName:El.userRelationshipPage__tabPanel}))))};var Pj=({userId:e,pageId:t="*",componentId:o="*"})=>{let{followingCount:r}=Bi(e),{AmityUserProfileHeaderComponentBehavior:i}=we(),n="user_following",{themeStyles:a,config:s,accessibilityId:l}=S({pageId:t,componentId:o,elementId:n});return ie__default.createElement(V,{"data-testid":l,style:a,className:d9.userFollowing__container,onPress:()=>{var m;return (m=i.goToUserRelationshipPage)==null?void 0:m.call(i,{userId:e,selectedTab:"following"})}},ie__default.createElement(v.BodyBold,{className:d9.userFollowing__count},fA(r)),s.text&&ie__default.createElement(v.Caption,{className:d9.userFollowing__label}," ",s.text))};var f9={userFollower__container:"o3",userFollower__count:"t3",userFollower__label:"i3"};var Ij=({userId:e,pageId:t="*",componentId:o="*"})=>{let{followerCount:r}=Bi(e),i="user_follower",{AmityUserProfileHeaderComponentBehavior:n}=we(),{themeStyles:a,config:s,accessibilityId:l}=S({pageId:t,componentId:o,elementId:i});return ie__default.createElement(V,{className:f9.userFollower__container,"data-testid":l,style:a,onPress:()=>{var m;(m=n.goToUserRelationshipPage)==null||m.call(n,{userId:e,selectedTab:"followers"});}},ie__default.createElement(v.BodyBold,{className:f9.userFollower__count},fA(r)),s.text&&ie__default.createElement(v.Caption,{className:f9.userFollower__label},s.text))};var ZI={userName__displayName:"s3",userName__displayName__text:"d3"};var wj=({name:e,pageId:t="*",componentId:o="*"})=>{let r="user_name",{isExcluded:i,accessibilityId:n}=S({pageId:t,componentId:o,elementId:r});return i?null:ie__default.createElement("div",{className:ZI.userName__displayName,"data-testid":n},ie__default.createElement(v.Headline,null,ie__default.createElement(RE,{lines:4},ie__default.createElement("div",{className:ZI.userName__displayName__text},e))))};var h9={userDescription__description:"c3",userDescription__description__text:"l3",userDescription__seeMore__button:"n3"};var Tj=({description:e="",pageId:t="*",componentId:o="*"})=>{let r="user_description",[i,n]=useState(!1),{isExcluded:a,accessibilityId:s}=S({pageId:t,componentId:o,elementId:r}),l=()=>{n(!0);};return a?null:ie__default.createElement("div",{className:h9.userDescription__description,"data-testid":s},ie__default.createElement(v.Body,{className:h9.userDescription__description__text},i?e:ie__default.createElement(RE,{lines:4,ellipsis:ie__default.createElement(ie__default.Fragment,null,"...",ie__default.createElement(V,{className:h9.userDescription__seeMore__button,onPress:l},"See more"))},ie__default.createElement("div",null,e))))};var j9e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M13.6435 20.7628C12.5251 21.8728 11.4652 21.8812 10.3552 20.7628L9.10328 19.5109C8.98644 19.394 8.88629 19.3607 8.73606 19.3607H6.9667C5.38931 19.3607 4.63817 18.6095 4.63817 17.0321V15.2628C4.63817 15.1125 4.59644 15.004 4.48794 14.8955L3.23604 13.6353C2.12602 12.5253 2.11767 11.4653 3.23604 10.3553L4.48794 9.10342C4.59644 8.99492 4.63817 8.88642 4.63817 8.73619V6.96684C4.63817 5.37275 5.38931 4.6383 6.9667 4.6383H8.73606C8.88629 4.6383 8.99478 4.59657 9.10328 4.48807L10.3552 3.24452C11.4652 2.11781 12.5251 2.11781 13.6435 3.23617L14.8954 4.48807C15.0039 4.59657 15.1124 4.6383 15.2626 4.6383H17.032C18.6094 4.6383 19.3605 5.38944 19.3605 6.96684V8.73619C19.3605 8.88642 19.4023 8.98657 19.5108 9.10342L20.7627 10.3553C21.8727 11.4653 21.881 12.5253 20.7627 13.6353L19.5108 14.8955C19.4023 15.004 19.3605 15.1125 19.3605 15.2628V17.0321C19.3605 18.6095 18.6094 19.3607 17.032 19.3607H15.2626C15.1124 19.3607 15.0123 19.394 14.8954 19.5109L13.6435 20.7628Z",fill:"url(#paint0_linear_1571_10885)"}),ie__default.createElement("path",{d:"M9.90432 15.9736C10.0879 16.1656 10.3216 16.2741 10.6137 16.2741C10.9225 16.2741 11.1729 16.1656 11.3649 15.9152L16.047 9.34691C16.1722 9.17164 16.2389 8.96299 16.2389 8.79607C16.2389 8.312 15.8717 7.95312 15.3543 7.95312C15.0204 7.95312 14.8034 8.06997 14.6031 8.35373L10.5803 14.0958L8.56896 11.8507C8.38535 11.6504 8.1767 11.5586 7.89293 11.5586C7.37548 11.5586 7.0166 11.9175 7.0166 12.4182C7.0166 12.6269 7.09172 12.8355 7.2336 12.9858L9.90432 15.9736Z",fill:"white"}),ie__default.createElement("defs",null,ie__default.createElement("linearGradient",{id:"paint0_linear_1571_10885",x1:"11.9993",y1:"2.39844",x2:"11.9993",y2:"21.5964",gradientUnits:"userSpaceOnUse"},ie__default.createElement("stop",{"stop-color":"#FFDB7D"}),ie__default.createElement("stop",{offset:"1","stop-color":"#D49900"})))),Mj=j9e;var Nf={followUserButton:"m3",followUserButton__inner:"h3",followUserButton__icon:"g3",followUserButton__text:"p3"};var WI=({pageId:e="*",componentId:t="*",onClick:o})=>{let r="follow_user_button",{accessibilityId:i,config:n,defaultConfig:a,isExcluded:s,uiReference:l}=S({pageId:e,componentId:t,elementId:r});return s?null:ie__default.createElement(V,{"data-testid":i,className:Nf.followUserButton,onPress:o},ie__default.createElement("div",{className:Nf.followUserButton__inner},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(br,{className:Nf.followUserButton__icon}),configIconName:n.image,defaultIconName:a.image,imgIcon:()=>ie__default.createElement("img",{src:n.image,alt:l})}),n.text&&ie__default.createElement(v.BodyBold,{className:Nf.followUserButton__text},n.text)))};var kf={followingUserButton:"b3",followingUserButton__inner:"u3",followingUserButton__icon:"f3",followingUserButton__text:"v3"};var Z9e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M19.2871 7.62109C19.4043 7.73828 19.4043 7.91406 19.2871 8.03125L15.4785 11.8691C15.3613 11.9863 15.1562 11.9863 15.0391 11.8691L12.9004 9.67188C12.7832 9.55469 12.7832 9.37891 12.9004 9.26172L13.457 8.67578C13.5742 8.55859 13.75 8.55859 13.8672 8.67578L15.2734 10.082L18.291 7.03516C18.4082 6.91797 18.584 6.91797 18.7012 7.03516L19.2871 7.62109ZM7.1875 11.3125C4.84375 11.3125 2.96875 9.4375 2.96875 7.09375C2.96875 4.7793 4.84375 2.875 7.1875 2.875C9.50195 2.875 11.4062 4.7793 11.4062 7.09375C11.4062 9.4375 9.50195 11.3125 7.1875 11.3125ZM7.1875 4.28125C5.63477 4.28125 4.375 5.57031 4.375 7.09375C4.375 8.64648 5.63477 9.90625 7.1875 9.90625C8.71094 9.90625 10 8.64648 10 7.09375C10 5.57031 8.71094 4.28125 7.1875 4.28125ZM9.79492 11.7812C11.9629 11.7812 13.75 13.5684 13.75 15.7363V16.4688C13.75 17.2598 13.1055 17.875 12.3438 17.875H2.03125C1.24023 17.875 0.625 17.2598 0.625 16.4688V15.7363C0.625 13.5684 2.38281 11.7812 4.55078 11.7812C5.40039 11.7812 5.78125 12.25 7.1875 12.25C8.56445 12.25 8.94531 11.7812 9.79492 11.7812ZM12.3438 16.4688V15.7363C12.3438 14.3301 11.2012 13.1875 9.79492 13.1875C9.35547 13.1875 8.68164 13.6562 7.1875 13.6562C5.66406 13.6562 4.99023 13.1875 4.55078 13.1875C3.14453 13.1875 2.03125 14.3301 2.03125 15.7363V16.4688H12.3438Z"})),Nj=Z9e;var qI=({pageId:e="*",componentId:t="*",onClick:o})=>{let r="following_user_button",{accessibilityId:i,config:n,defaultConfig:a,isExcluded:s,uiReference:l}=S({pageId:e,componentId:t,elementId:r});return s?null:ie__default.createElement(V,{"data-testid":i,className:kf.followingUserButton,onPress:o},ie__default.createElement("div",{className:kf.followingUserButton__inner},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(Nj,{className:kf.followingUserButton__icon}),configIconName:n.image,defaultIconName:a.image,imgIcon:()=>ie__default.createElement("img",{src:n.image,alt:l})}),n.text&&ie__default.createElement(v.BodyBold,{className:kf.followingUserButton__text},n.text)))};var Bf={pendingUserButton:"w3",pendingUserButton__inner:"x3",pendingUserButton__icon:"y3",pendingUserButton__text:"k3"};var q9e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M7.6875 11.3125C5.34375 11.3125 3.46875 9.4375 3.46875 7.09375C3.46875 4.7793 5.34375 2.875 7.6875 2.875C10.002 2.875 11.9062 4.7793 11.9062 7.09375C11.9062 9.4375 10.002 11.3125 7.6875 11.3125ZM7.6875 4.28125C6.13477 4.28125 4.875 5.57031 4.875 7.09375C4.875 8.64648 6.13477 9.90625 7.6875 9.90625C9.21094 9.90625 10.5 8.64648 10.5 7.09375C10.5 5.57031 9.21094 4.28125 7.6875 4.28125ZM2.53125 16.4688H10.7637C11.0859 17.0254 11.4668 17.4941 11.9355 17.875H2.53125C1.74023 17.875 1.125 17.2598 1.125 16.4688V15.7363C1.125 13.5684 2.88281 11.7812 5.05078 11.7812C5.90039 11.7812 6.28125 12.25 7.6875 12.25C9.09375 12.25 9.41602 11.7812 10.3535 11.8105C10.1777 12.25 10.0898 12.748 10.0312 13.2461C9.73828 13.3047 8.94727 13.6562 7.6875 13.6562C6.16406 13.6562 5.49023 13.1875 5.05078 13.1875C3.64453 13.1875 2.53125 14.3301 2.53125 15.7363V16.4688ZM15.6562 9.4375C17.9707 9.4375 19.875 11.3418 19.875 13.6562C19.875 16 17.9707 17.875 15.6562 17.875C13.3125 17.875 11.4375 16 11.4375 13.6562C11.4375 11.3418 13.3125 9.4375 15.6562 9.4375ZM17.5312 13.8613V13.4805C17.5312 13.334 17.3848 13.1875 17.2383 13.1875H16.125V11.6055C16.125 11.459 15.9785 11.3125 15.832 11.3125H15.4512C15.3047 11.3125 15.1875 11.459 15.1875 11.6055V13.8613C15.1875 14.0078 15.3047 14.125 15.4512 14.125H17.2383C17.3848 14.125 17.5312 14.0078 17.5312 13.8613Z",fill:"currentColor"})),Bj=q9e;var YI=({pageId:e="*",componentId:t="*",onClick:o})=>{let r="pending_user_button",{accessibilityId:i,config:n,defaultConfig:a,isExcluded:s,uiReference:l}=S({pageId:e,componentId:t,elementId:r});return s?null:ie__default.createElement(V,{"data-testid":i,className:Bf.pendingUserButton,onPress:o},ie__default.createElement("div",{className:Bf.pendingUserButton__inner},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(Bj,{className:Bf.pendingUserButton__icon}),configIconName:n.image,defaultIconName:a.image,imgIcon:()=>ie__default.createElement("img",{src:n.image,alt:l})}),n.text&&ie__default.createElement(v.BodyBold,{className:Bf.pendingUserButton__text},n.text)))};var Ef={unblockUserButton:"j3",unblockUserButton__inner:"z3",unblockUserButton__icon:"X3",unblockUserButton__text:"Y3"};var Q9e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M19.6992 16.6738C19.875 16.8496 19.9336 17.1426 19.7578 17.3477L19.4648 17.6992C19.3184 17.9043 18.9961 17.9336 18.8203 17.7871L1.30078 4.07617C1.0957 3.92969 1.06641 3.63672 1.21289 3.43164L1.50586 3.05078C1.68164 2.875 1.97461 2.81641 2.17969 2.99219L19.6992 16.6738ZM10.5 4.28125C9.41602 4.28125 8.50781 4.89648 8.00977 5.77539L6.89648 4.89648C7.6582 3.69531 8.97656 2.875 10.5 2.875C12.8145 2.875 14.7188 4.7793 14.7188 7.09375C14.7188 8.26562 14.25 9.29102 13.4883 10.0527L12.375 9.17383C12.9316 8.67578 13.3125 7.94336 13.3125 7.09375C13.3125 5.57031 12.0234 4.28125 10.5 4.28125ZM5.34375 16.4688H14.8652L16.3887 17.6699C16.1543 17.8164 15.9199 17.875 15.6562 17.875H5.34375C4.55273 17.875 3.9375 17.2598 3.9375 16.4688V15.7363C3.9375 13.5684 5.69531 11.7812 7.86328 11.8105C8.18555 11.8105 8.50781 11.8691 8.80078 11.9863C8.94727 12.0156 9.09375 12.0449 9.24023 12.1035L11.1738 13.5977C10.9395 13.627 10.7344 13.6562 10.5 13.6562C9.76758 13.6562 9.03516 13.5391 8.33203 13.3047C8.12695 13.2461 7.98047 13.1875 7.86328 13.1875C6.45703 13.1875 5.34375 14.3301 5.34375 15.7363V16.4688Z",fill:"currentColor"})),Aj=Q9e;var Lj=({pageId:e="*",componentId:t="*",onClick:o})=>{let r="unblock_user_button",{accessibilityId:i,config:n,defaultConfig:a,isExcluded:s,uiReference:l}=S({pageId:e,componentId:t,elementId:r});return s?null:ie__default.createElement(V,{"data-testid":i,className:Ef.unblockUserButton,onPress:o},ie__default.createElement("div",{className:Ef.unblockUserButton__inner},ie__default.createElement(Z,{defaultIcon:()=>ie__default.createElement(Aj,{className:Ef.unblockUserButton__icon}),configIconName:n.image,defaultIconName:a.image,imgIcon:()=>ie__default.createElement("img",{src:n.image,alt:l})}),n.text&&ie__default.createElement(v.BodyBold,{className:Ef.unblockUserButton__text},n.text)))};var K9e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 7 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("circle",{cx:"3.5",cy:"3",r:"3"})),Dj=K9e;var J9e=()=>{let{confirm:e,closeConfirm:t}=Te(),o=ce(),{mutateAsync:r}=useMutation({mutationFn:a=>UserRepository.Relationship.follow(a),onError:()=>{e({title:"Unable to follow this user",content:"Oops! something went wrong. Please try again later.",onOk:()=>t()});}}),{mutateAsync:i}=useMutation({mutationFn:a=>UserRepository.Relationship.unfollow(a),onError:()=>{o.error({content:"Failed to unfollow user."});}});return {followUser:r,unFollowUser:({pageId:a,userId:s})=>{e({pageId:a,type:"info",title:"Unfollow this user?",content:"If you change your mind, you\u2019ll have to request to follow them again.",onOk:()=>i(s)});},cancelFollow:i}},Hj=J9e;var X9e=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M10.5625 13.5C13.5625 13.5 16 15.9375 16 18.9375C16 19.5312 15.5 20 14.9062 20H3.0625C2.46875 20 2 19.5312 2 18.9375C2 15.9375 4.40625 13.5 7.40625 13.5H10.5625ZM3.5 18.5H14.4688C14.2188 16.5625 12.5938 15 10.5625 15H7.40625C5.375 15 3.71875 16.5625 3.5 18.5ZM9 12C6.78125 12 5 10.2188 5 8C5 5.8125 6.78125 4 9 4C11.1875 4 13 5.8125 13 8C13 10.2188 11.1875 12 9 12ZM9 5.5C7.59375 5.5 6.5 6.625 6.5 8C6.5 9.40625 7.59375 10.5 9 10.5C10.375 10.5 11.5 9.40625 11.5 8C11.5 6.625 10.375 5.5 9 5.5ZM20.0312 11L21.5 12.4688C21.8125 12.7812 21.8125 13.25 21.5 13.5312C21.2188 13.8438 20.75 13.8438 20.4688 13.5312L19 12.0625L17.5 13.5625C17.2188 13.8438 16.75 13.8438 16.4688 13.5625C16.1562 13.25 16.1562 12.7812 16.4688 12.5L17.9375 11.0312L16.4688 9.5625C16.1562 9.25 16.1562 8.78125 16.4688 8.5C16.75 8.1875 17.2188 8.1875 17.5 8.5L19 9.96875L20.4375 8.46875C20.75 8.15625 21.2188 8.15625 21.5 8.46875C21.8125 8.75 21.8125 9.21875 21.5 9.53125L20.0312 11Z",fill:"currentColor"})),zj=X9e;var the=()=>ie__default.createElement("div",{className:to.userProfileHeader__skeleton},ie__default.createElement("div",{className:to.userProfileHeader__skeleton__header},ie__default.createElement("div",{className:to.userProfileHeader__skeleton__avatar}),ie__default.createElement("div",{className:to.userProfileHeader__skeleton__displayName})),ie__default.createElement("div",null,ie__default.createElement("div",{className:to.userProfileHeader__skeleton__about}),ie__default.createElement("div",{className:to.userProfileHeader__skeleton__about})),ie__default.createElement("div",{className:to.userProfileHeader__skeleton__relationship},ie__default.createElement("div",{className:to.userProfileHeader__skeleton__relationship__text}),ie__default.createElement("div",{className:to.userProfileHeader__skeleton__relationship__text}))),C9=({user:e,pageId:t="*"})=>{var A;let o="user_profile_header",[r,i]=useState(!1),{currentUserId:n}=Ne(),{themeStyles:a,accessibilityId:s}=se({pageId:t,componentId:o}),{AmityUserProfileHeaderComponentBehavior:l}=we(),{followStatus:m,pendingCount:c}=Bi(e==null?void 0:e.userId),{followUser:d,unFollowUser:u,cancelFollow:g}=Hj(),{unblockUser:f}=ud(),{setDrawerData:C,removeDrawerData:y}=tt(),{online:b}=useNetworkState(),_=ce(),x=({onClickButton:D,userId:G})=>ie__default.createElement(oe,{className:to.userProfileHeader__unFollowButton,onPress:()=>{y(),u({pageId:t,userId:G}),D==null||D();},variant:"text"},ie__default.createElement(zj,{className:to.userProfileHeader__unFollowButton__icon}),ie__default.createElement(v.BodyBold,{className:to.userProfileHeader__unFollowButton__text},"Unfollow")),{isDesktop:P}=le(),I=D=>{C({content:x({userId:D})});},w=D=>ie__default.createElement(ft,{trigger:({openPopover:G})=>ie__default.createElement(qI,{pageId:t,componentId:o,onClick:()=>{P?G():I(D);}})},({closePopover:G})=>ie__default.createElement("div",{className:to.userProfileHeader__popOver__container},x({userId:D,onClickButton:G}))),M=n&&e&&n!==e.userId&&m==="pending",T=n&&e&&n!==e.userId&&m==="none",E=n&&e&&n!==e.userId&&m==="accepted",N=n&&e&&n!==e.userId&&m==="blocked";return e?ie__default.createElement("div",{className:to.userProfileHeader__container,style:a,"data-testid":s},ie__default.createElement("div",{className:to.userProfileHeader__header},ie__default.createElement(oe,{variant:"text",onPress:()=>i(!0)},ie__default.createElement(Ae,{userId:e.userId,className:to.userProfileHeader__avatar,textPlaceholderClassName:to.userProfileHeader__avatar__placeholder,pageId:t,componentId:o})),ie__default.createElement("div",{className:to.userProfileHeader__displayName},ie__default.createElement(wj,{name:(A=e.displayName)!=null?A:e.userId,pageId:t,componentId:o}),e.isBrand&&ie__default.createElement("div",{className:to.userProfileHeader__badge__container},ie__default.createElement(Mj,{className:to.userProfileHeader__badge})))),ie__default.createElement(Tj,{description:e.description,pageId:t,componentId:o}),ie__default.createElement("div",{className:to.userProfileHeader__relationship},ie__default.createElement(Pj,{userId:e.userId,pageId:t,componentId:o}),ie__default.createElement("div",{className:to.userProfileHeader__relationship__separator}),ie__default.createElement(Ij,{userId:e.userId,pageId:t,componentId:o})),c>0&&ie__default.createElement(oe,{variant:"outlined",className:to.pendingCountButton,onPress:()=>{var D;return (D=l==null?void 0:l.goToPendingFollowRequestPage)==null?void 0:D.call(l)}},ie__default.createElement("div",{className:to.pendingCountButton__inner},ie__default.createElement("div",{className:to.pendingCountButton__notification},ie__default.createElement(Dj,{className:to.pendingCountButton__notification__icon}),ie__default.createElement(v.BodyBold,{className:to.pendingCountButton__notification__text},"New follow requests")),ie__default.createElement("div",null,ie__default.createElement(v.Caption,{className:to.pendingCountButton__notification__requestCount},`${c} request${c>0?"s":""} need your approval`)))),T&&ie__default.createElement(WI,{pageId:t,componentId:o,onClick:()=>{if(!b){_.info({content:"Oops, something went wrong."});return}d(e.userId);}}),E&&w(e.userId),M&&ie__default.createElement(YI,{pageId:t,componentId:o,onClick:()=>{if(!b){_.info({content:"Oops, something went wrong."});return}g(e.userId);}}),N&&ie__default.createElement(Lj,{pageId:t,componentId:o,onClick:()=>{var D;if(!b){_.info({content:"Failed to unblock user. Please try again."});return}f({pageId:t,componentId:o,userId:e.userId,displayName:(D=e.displayName)!=null?D:e.userId});}}),r&&e.avatarFileId&&ie__default.createElement(ff,{fileId:e.avatarFileId,onClose:()=>i(!1),pageId:t,componentId:o})):ie__default.createElement(the,null)};var jj={emptyUserFeed:"Es",emptyUserFeed__icon:"I3",emptyUserFeed__text:"A3"};var QI=({pageId:e="*",componentId:t="*"})=>{let o="empty_user_feed",{config:r,defaultConfig:i,isExcluded:n,themeStyles:a,accessibilityId:s,uiReference:l}=S({pageId:e,componentId:t,elementId:o});return n?null:ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:o,defaultIcon:()=>ie__default.createElement(s0,{className:jj.emptyUserFeed__icon})})};var $j={blockedUserFeed__icon:"M3"};var Wj=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"blocked_user_feed",infoElementId:"blocked_user_feed_info",defaultIcon:()=>ie__default.createElement(Al,{className:$j.blockedUserFeed__icon})});var qj={privateUserFeed__icon:"S3"};var nhe=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 61 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M33.0312 43.75C33.0312 45.2266 31.8711 46.2812 30.5 46.2812C29.0234 46.2812 27.9688 45.2266 27.9688 43.75V37C27.9688 35.6289 29.0234 34.4688 30.5 34.4688C31.8711 34.4688 33.0312 35.6289 33.0312 37V43.75ZM30.5 3.25C37.8828 3.25 44 9.36719 44 16.75V23.5H47.375C51.0664 23.5 54.125 26.5586 54.125 30.25V50.5C54.125 54.2969 51.0664 57.25 47.375 57.25H13.625C9.82812 57.25 6.875 54.2969 6.875 50.5V30.25C6.875 26.5586 9.82812 23.5 13.625 23.5H17V16.75C17 9.36719 23.0117 3.25 30.5 3.25ZM30.5 8.3125C25.7539 8.3125 22.0625 12.1094 22.0625 16.75V23.5H38.9375V16.75C38.9375 12.1094 35.1406 8.3125 30.5 8.3125ZM13.625 28.5625C12.6758 28.5625 11.9375 29.4062 11.9375 30.25V50.5C11.9375 51.4492 12.6758 52.1875 13.625 52.1875H47.375C48.2188 52.1875 49.0625 51.4492 49.0625 50.5V30.25C49.0625 29.4062 48.2188 28.5625 47.375 28.5625H13.625Z"})),f0=nhe;var Kj=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"private_user_feed",infoElementId:"private_user_feed_info",defaultIcon:()=>ie__default.createElement(f0,{className:qj.privateUserFeed__icon})});var v9={errorContent__container:"Rs",errorContent__text:"C3",errorContent__icon:"E3"};var she=e=>ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 61 42",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M58.3438 0.75C59.7148 0.75 60.875 1.91016 60.875 3.28125V38.7188C60.875 40.1953 59.7148 41.25 58.3438 41.25H5.1875C2.33984 41.25 0.125 39.0352 0.125 36.1875V6.65625C0.125 5.28516 1.17969 4.125 2.65625 4.125H6.875V3.28125C6.875 1.91016 7.92969 0.75 9.40625 0.75H58.3438ZM3.5 36.1875C3.5 37.1367 4.23828 37.875 5.1875 37.875C6.03125 37.875 6.875 37.1367 6.875 36.1875V7.5H3.5V36.1875ZM57.5 37.875V4.125H10.25V36.1875V36.293C10.25 36.7148 10.0391 37.4531 9.93359 37.875H57.5Z"}),ie__default.createElement("path",{d:"M34.4375 13C37.0625 13 39.9062 15.0938 39.9062 17.8125C39.9062 21.4375 36 21.5 36 22.8438V23C36 23.4375 35.6562 23.75 35.25 23.75H32.9688C32.5625 23.75 32.2188 23.4375 32.2188 23V22.7188C32.2188 20.7812 33.6875 20 34.8125 19.375C35.75 18.8438 36.3438 18.5 36.3438 17.7812C36.3438 16.8438 35.1562 16.25 34.1875 16.25C32.9688 16.25 32.375 16.8125 31.5938 17.7812C31.3438 18.0938 30.875 18.1562 30.5625 17.9062L29.2188 16.875C28.875 16.6562 28.8125 16.1875 29.0312 15.875C30.3125 14.0312 31.9375 13 34.4375 13ZM34.125 24.6875C35.3125 24.6875 36.2812 25.6562 36.2812 26.8438C36.2812 28.0312 35.3125 29 34.125 29C32.9062 29 31.9375 28.0312 31.9375 26.8438C31.9375 25.6562 32.9062 24.6875 34.125 24.6875Z"})),Jj=she;var yp=()=>ie__default.createElement("div",{className:v9.errorContent__container},ie__default.createElement(Jj,{className:v9.errorContent__icon}),ie__default.createElement("div",{className:v9.errorContent__text},ie__default.createElement(v.TitleBold,null,"Something went wrong"),ie__default.createElement(v.Caption,null,"We couldn\u2019t recognize this feed.")));var ia={userFeed__container:"R3",userFeed__loadingIndicator:"U3",userFeed__observerTarget:"B3",userFeed__post:"F3",userFeed__spinner:"H3",spin:"Us",userFeed__postContent:"Bs",userFeed_postSkeleton__post:"Fs",userFeed_postSkeleton__post__header:"L3",userFeed_postSkeleton__post__avatar:"Hs",userFeed_postSkeleton__post__headerText_wrap:"T3",userFeed_postSkeleton__post__displayName:"Ls",userFeed_postSkeleton__post__timestamp:"Ts",userFeed_postSkeleton__post__content:"q",pulse:"Vs"};var che=()=>ie__default.createElement(ie__default.Fragment,null,Array.from({length:3}).map((e,t)=>ie__default.createElement("div",{key:t,className:ia.userFeed_postSkeleton__post},ie__default.createElement("div",{className:ia.userFeed_postSkeleton__post__header},ie__default.createElement("div",{className:ia.userFeed_postSkeleton__post__avatar}),ie__default.createElement("div",{className:ia.userFeed_postSkeleton__post__headerText_wrap},ie__default.createElement("div",{className:ia.userFeed_postSkeleton__post__displayName}),ie__default.createElement("div",{className:ia.userFeed_postSkeleton__post__timestamp}))),ie__default.createElement("div",null,ie__default.createElement("div",{className:ia.userFeed_postSkeleton__post__content}),ie__default.createElement("div",{className:ia.userFeed_postSkeleton__post__content}),ie__default.createElement("div",{className:ia.userFeed_postSkeleton__post__content}))))),_9=({pageId:e="*",userId:t})=>{let o="user_feed",[r,i]=useState(null),{AmityUserFeedComponentBehavior:n}=we(),{accessibilityId:a,themeStyles:s}=se({pageId:e,componentId:o}),{posts:l,hasMore:m,loadMore:c,refresh:d,isLoading:u,error:g}=Ao({targetId:t,targetType:"user",limit:10}),{followStatus:f}=Bi(t);ke({onIntersect:()=>{u===!1&&c();},node:r,options:{threshold:.7}}),useEffect(()=>{d();},[]);let C=()=>f==="blocked"?ie__default.createElement(Wj,{pageId:e,componentId:o}):g&&g.message.includes("You are not following this user")?ie__default.createElement(Kj,{pageId:e,componentId:o}):g?ie__default.createElement(yp,null):!u&&l.length===0?ie__default.createElement(QI,{pageId:e,componentId:o}):l.map(y=>ie__default.createElement(V,{key:y.postId,className:ia.userFeed__postContent,onPress:()=>{var b;return (b=n==null?void 0:n.goToPostDetailPage)==null?void 0:b.call(n,{postId:y.postId})}},ie__default.createElement(en,{category:"general",pageId:e,key:y.postId,post:y,style:"feed",onClick:()=>{var b;return (b=n==null?void 0:n.goToPostDetailPage)==null?void 0:b.call(n,{postId:y.postId})}})));return ie__default.createElement("div",{"data-testid":a,style:s},ie__default.createElement(wr,{page:"feed",refresh:d},ie__default.createElement("div",{className:ia.userFeed__container},C(),u&&ie__default.createElement(che,null),m&&ie__default.createElement("div",{ref:y=>i(y),className:ia.userFeed__observerTarget}))))};var Xj={emptyUserImageFeed__icon:"V3"};var uhe=t=>{var e=d(t,[]);return ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 61 60",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M18.6875 23.5C15.8398 23.5 13.625 21.2852 13.625 18.4375C13.625 15.6953 15.8398 13.375 18.6875 13.375C21.4297 13.375 23.75 15.6953 23.75 18.4375C23.75 21.2852 21.4297 23.5 18.6875 23.5ZM18.6875 16.75C17.7383 16.75 17 17.5938 17 18.4375C17 19.3867 17.7383 20.125 18.6875 20.125C19.5312 20.125 20.375 19.3867 20.375 18.4375C20.375 17.5938 19.5312 16.75 18.6875 16.75ZM50.75 6.625C52.543 6.625 54.125 8.20703 54.125 10V50.5C54.125 52.3984 52.543 53.875 50.75 53.875H10.25C8.35156 53.875 6.875 52.3984 6.875 50.5V10C6.875 8.20703 8.35156 6.625 10.25 6.625H50.75ZM50.75 50.5V42.0625H10.25V50.5H50.75ZM15.8398 38.6875H24.2773L25.543 37L21.3242 31.4102L15.8398 38.6875ZM28.4961 38.6875H44.5273L36.5117 28.0352L28.4961 38.6875ZM50.75 38.6875V10H10.25V38.6875H11.6211L19.9531 27.6133C20.5859 26.7695 21.957 26.7695 22.6953 27.6133L27.6523 34.2578L35.1406 24.2383C35.7734 23.3945 37.1445 23.3945 37.8828 24.2383L48.7461 38.6875H50.75Z"}))},eG=uhe;var oG=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"empty_user_image_feed",defaultIcon:()=>ie__default.createElement(eG,{className:Xj.emptyUserImageFeed__icon})});var rG={privateUserImageFeed__icon:"W3"};var JI=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"private_user_image_feed",infoElementId:"private_user_image_feed_info",defaultIcon:()=>ie__default.createElement(f0,{className:rG.privateUserImageFeed__icon})});var nG={blockedUserImageFeed__icon:"q3"};var XI=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"blocked_user_image_feed",infoElementId:"blocked_user_image_feed_info",defaultIcon:()=>ie__default.createElement(Al,{className:nG.blockedUserImageFeed__icon})});var RI={userImageFeed__container:"Ws",userImageFeed__loadingIndicator:"D3",userImageFeed__observerTarget:"G3",userImageFeed__spinner:"J3",spin:"qs",userImageFeed__postContent:"K3",userImageFeed_postSkeleton__post:"N3",userImageFeed_postSkeleton__post__header:"O3",userImageFeed_postSkeleton__post__avatar:"Ds",userImageFeed_postSkeleton__post__headerText_wrap:"P3",userImageFeed_postSkeleton__post__displayName:"Gs",userImageFeed_postSkeleton__post__timestamp:"Js",userImageFeed_postSkeleton__post__content:"D",pulse:"Ks"};var b9=({pageId:e="*",userId:t})=>{let o="user_image_feed",[r,i]=useState(null),{accessibilityId:n,themeStyles:a}=se({pageId:e,componentId:o}),{posts:s,hasMore:l,loadMore:m,refresh:c,error:d,isLoading:u}=Ao({targetId:t,targetType:"user",limit:10,dataTypes:["image"]}),{followStatus:g}=Bi(t);return ke({onIntersect:()=>{u===!1&&m();},node:r,options:{threshold:.7}}),useEffect(()=>{c();},[]),ie__default.createElement("div",{"data-testid":n,style:a},ie__default.createElement(wr,{page:"feed",refresh:c},ie__default.createElement(ie__default.Fragment,null,g==="blocked"?ie__default.createElement(XI,{pageId:e,componentId:o}):d?d.message.includes("You are not following this user")?ie__default.createElement(JI,{pageId:e,componentId:o}):ie__default.createElement(yp,null):!u&&s.length===0?ie__default.createElement(oG,{pageId:e,componentId:o}):ie__default.createElement("div",{className:RI.userImageFeed__container},ie__default.createElement(yf,{posts:s})),l&&ie__default.createElement("div",{ref:C=>i(C),className:RI.userImageFeed__observerTarget}))))};var sG={emptyUserVideoFeed__icon:"Q3"};var _he=t=>{var e=d(t,[]);return ie__default.createElement("svg",a({width:"100%",height:"100%",viewBox:"0 0 60 61",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ie__default.createElement("path",{d:"M53.5195 20.625C55.3125 20.625 57 21.9961 57 24V51.1055C57 53.0039 55.3125 54.375 53.5195 54.375C52.9922 54.375 52.1484 54.1641 51.6211 53.8477L43.5 48.1523V49.3125C43.5 52.1602 41.1797 54.375 38.4375 54.375H8.0625C5.21484 54.375 3 52.1602 3 49.3125V25.6875C3 22.9453 5.21484 20.625 8.0625 20.625H9.75V15.5625C9.75 10.9219 13.4414 7.125 18.1875 7.125H35.9062C36.3281 7.125 36.75 7.54688 36.75 7.96875V9.65625C36.75 10.1836 36.3281 10.5 35.9062 10.5H18.1875C15.3398 10.5 13.125 12.8203 13.125 15.5625V20.625H38.4375C41.1797 20.625 43.5 22.9453 43.5 25.6875V26.9531L51.6211 21.2578C52.1484 20.9414 52.9922 20.7305 53.5195 20.625V24L43.5 31.0664V44.0391L53.5195 51L53.625 24L53.5195 20.625ZM40.125 49.3125V25.6875C40.125 24.8438 39.2812 24 38.4375 24H8.0625C7.11328 24 6.375 24.8438 6.375 25.6875V49.3125C6.375 50.2617 7.11328 51 8.0625 51H38.4375C39.2812 51 40.125 50.2617 40.125 49.3125ZM36.0117 27.375C36.4336 27.4805 36.6445 27.6914 36.75 28.1133V30.1172C36.6445 30.5391 36.4336 30.75 36.0117 30.75H10.3828C9.96094 30.75 9.75 30.5391 9.75 30.1172V28.1133C9.75 27.6914 9.96094 27.4805 10.3828 27.375H36.0117Z"}))},mG=_he;var cG=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"empty_user_video_feed",defaultIcon:()=>ie__default.createElement(mG,{className:sG.emptyUserVideoFeed__icon})});var pG={privateUserVideoFeed__icon:"Z3"};var ew=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"private_user_video_feed",infoElementId:"private_user_video_feed_info",defaultIcon:()=>ie__default.createElement(f0,{className:pG.privateUserVideoFeed__icon})});var gG={blockedUserVideoFeed__icon:"_3"};var tw=({pageId:e="*",componentId:t="*"})=>ie__default.createElement(Fo,{pageId:e,componentId:t,elementId:"blocked_user_image_feed",infoElementId:"blocked_user_image_feed_info",defaultIcon:()=>ie__default.createElement(Al,{className:gG.blockedUserVideoFeed__icon})});var Lf={userVideoFeed__container:"Ns",userVideoFeed__observerTarget:"ej",userVideoFeed__videoFeedTabs:"Os",userVideoFeed__tabsButton:"Ps",userVideoFeed__tabsButtonlabel:"Qs"};var x9=({pageId:e="*",userId:t})=>{let o="user_video_feed",[r,i]=useState(null),[n,a]=useState(null),[s,l]=useState("videos"),{followStatus:m}=Bi(t),{accessibilityId:c,themeStyles:d}=se({pageId:e,componentId:o}),{posts:u,hasMore:g,loadMore:f,refresh:C,error:y,isLoading:b}=Ao({targetId:t,targetType:"user",limit:10,dataTypes:["video"]}),{posts:_,hasMore:x,loadMore:P,refresh:I,error:w,isLoading:M}=Ao({targetId:t,targetType:"user",limit:10,dataTypes:["clip"]});ke({onIntersect:()=>{b===!1&&f();},node:r,options:{threshold:.7}}),ke({onIntersect:()=>{M===!1&&P();},node:n,options:{threshold:.7}}),useEffect(()=>{C(),I();},[]);let T=[{type:"videos",elementId:"videos_button"},{type:"clips",elementId:"clips_button"}],E=()=>ie__default.createElement("div",{className:Lf.userVideoFeed__videoFeedTabs},T.map(D=>ie__default.createElement(bf,{key:D.type,pageId:e,componentId:o,elementId:D.elementId,tab:D,activeTab:s,setActiveTab:l}))),N=(D,G,H)=>m==="blocked"?ie__default.createElement(tw,{pageId:e,componentId:o}):H?H.message.includes("You are not following this user")?ie__default.createElement(ew,{pageId:e,componentId:o}):ie__default.createElement(yp,null):s==="videos"&&!G&&D.length===0?ie__default.createElement(cG,{pageId:e,componentId:o}):s==="clips"&&!M&&_.length===0?ie__default.createElement(Pf,{pageId:e,componentId:o}):ie__default.createElement("div",{className:Lf.userVideoFeed__container},s==="videos"?ie__default.createElement(_f,{posts:D}):ie__default.createElement(a9,{posts:D})),A=()=>s==="videos"?ie__default.createElement(ie__default.Fragment,null,N(u,b,y),g&&ie__default.createElement("div",{ref:D=>i(D),className:Lf.userVideoFeed__observerTarget})):ie__default.createElement(ie__default.Fragment,null,N(_,M,w),x&&ie__default.createElement("div",{ref:D=>a(D),className:Lf.userVideoFeed__observerTarget}));return ie__default.createElement("div",{"data-testid":c,style:d},ie__default.createElement(wr,{page:"feed",refresh:C},ie__default.createElement(ie__default.Fragment,null,E(),A())))};var P9={categoryChip:"or",categoryChip__image:"rj",categoryChip__text:"aj"};var rw={categoryImage__placeHolderRect:"oj",categoryImage__placeHolderPath:"tj"};var Mhe=({className:e})=>ie__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",className:e},ie__default.createElement("rect",{width:"28",height:"28",rx:"14",className:rw.categoryImage__placeHolderRect}),ie__default.createElement("path",{d:"M19.6 14.7C19.6 14.3281 19.2719 14 18.9 14H15.4C15.0063 14 14.7 14.3281 14.7 14.7V18.2C14.7 18.5938 15.0063 18.9 15.4 18.9H18.9C19.2719 18.9 19.6 18.5938 19.6 18.2V14.7ZM9.8 13.3C8.24688 13.3 7 14.5688 7 16.1C7 17.6531 8.24688 18.9 9.8 18.9C11.3313 18.9 12.6 17.6531 12.6 16.1C12.6 14.5688 11.3313 13.3 9.8 13.3ZM18.8781 11.9C19.425 11.9 19.775 11.3313 19.4906 10.85L17.4125 7.35002C17.1281 6.89065 16.45 6.89065 16.1656 7.35002L14.0875 10.85C13.8031 11.3313 14.1531 11.9 14.7 11.9H18.8781Z",className:rw.categoryImage__placeHolderPath})),Df=({imgSrc:e,pageId:t="*",componentId:o="*",elementId:r="*",className:i})=>{let{themeStyles:n}=S({pageId:t,componentId:o,elementId:r});return ie__default.createElement(Du,{style:n,className:i,src:e,fallBackRenderer:()=>ie__default.createElement(Mhe,{className:i})})};var yG=({pageId:e="*",componentId:t="*",category:o,onClick:r})=>{var m;let i="category_chip",{isExcluded:n,accessibilityId:a,themeStyles:s}=S({pageId:e,componentId:t,elementId:i}),l=rt({fileId:(m=o.avatar)==null?void 0:m.fileId});return n?null:ie__default.createElement(V,{"data-testid":a,style:s,className:P9.categoryChip,onPress:()=>r==null?void 0:r(o.categoryId)},ie__default.createElement(Df,{imgSrc:l,className:P9.categoryChip__image,pageId:e,componentId:t,elementId:i}),ie__default.createElement(v.BodyBold,{className:P9.categoryChip__text},o.name))};var hG={exploreCategories__categoryChipSkeleton:"ij","skeleton-pulse":"Zs"};var CG=()=>ie__default.createElement("div",{className:hG.exploreCategories__categoryChipSkeleton});var Ul={exploreCommunityCategories:"_s",exploreCommunityCategories__carousel:"sj",exploreCommunityCategories__seeMore:"tr",exploreCommunityCategories__seeMoreIcon:"dj",exploreCommunityCategories__arrow:"ed",exploreCommunityCategories__arrowIcon:"cj",left:"rd",right:"ad"};var I9=({pageId:e="*"})=>{let t="explore_community_categories",{categories:o,isCategoryLoading:r,fetchCommunityCategories:i}=fl(),{goToAllCategoriesPage:n,goToCommunitiesByCategoryPage:a}=Y(),{accessibilityId:s,themeStyles:l}=se({pageId:e,componentId:t});return useEffect(()=>{i();},[]),ie__default.createElement(ku,{scrollOffset:300,isHidden:r||o.length<=3,className:Ul.exploreCommunityCategories__carousel,iconClassName:Ul.exploreCommunityCategories__arrowIcon,leftArrowClassName:wl(Ul.exploreCommunityCategories__arrow,Ul.left),rightArrowClassName:wl(Ul.exploreCommunityCategories__arrow,Ul.right)},ie__default.createElement("div",{style:l,"data-testid":s,className:Ul.exploreCommunityCategories},r?Array.from({length:6}).map((m,c)=>ie__default.createElement(CG,{key:c})):ie__default.createElement(Fragment,null,o.slice(0,5).map(m=>ie__default.createElement(yG,{pageId:e,category:m,key:m.categoryId,onClick:c=>a({categoryId:c})})),o.length>=5&&ie__default.createElement(V,{onPress:()=>n(),className:wl(Ul.exploreCommunityCategories__seeMore)},ie__default.createElement(v.BodyBold,null,"See more"),ie__default.createElement(wo,{className:Ul.exploreCommunityCategories__seeMoreIcon})))))};var vG=e=>ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"64",height:"39",viewBox:"0 0 64 39",fill:"none"},e),ie__default.createElement("path",{d:"M32 0.590942C34.4754 0.590942 36.8493 1.5527 38.5997 3.26463C40.35 4.97656 41.3333 7.29843 41.3333 9.71947C41.3333 12.1405 40.35 14.4624 38.5997 16.1743C36.8493 17.8862 34.4754 18.848 32 18.848C29.5246 18.848 27.1507 17.8862 25.4003 16.1743C23.65 14.4624 22.6667 12.1405 22.6667 9.71947C22.6667 7.29843 23.65 4.97656 25.4003 3.26463C27.1507 1.5527 29.5246 0.590942 32 0.590942ZM13.3333 7.11132C14.8267 7.11132 16.2133 7.50254 17.4133 8.20674C17.0133 11.9364 18.1333 15.64 20.4267 18.535C19.0933 21.0388 16.4267 22.7602 13.3333 22.7602C11.2116 22.7602 9.17677 21.9359 7.67648 20.4685C6.17619 19.0011 5.33333 17.0109 5.33333 14.9358C5.33333 12.8606 6.17619 10.8704 7.67648 9.40305C9.17677 7.93568 11.2116 7.11132 13.3333 7.11132ZM50.6667 7.11132C52.7884 7.11132 54.8232 7.93568 56.3235 9.40305C57.8238 10.8704 58.6667 12.8606 58.6667 14.9358C58.6667 17.0109 57.8238 19.0011 56.3235 20.4685C54.8232 21.9359 52.7884 22.7602 50.6667 22.7602C47.5733 22.7602 44.9067 21.0388 43.5733 18.535C45.8667 15.64 46.9867 11.9364 46.5867 8.20674C47.7867 7.50254 49.1733 7.11132 50.6667 7.11132ZM14.6667 33.8449C14.6667 28.446 22.4267 24.0643 32 24.0643C41.5733 24.0643 49.3333 28.446 49.3333 33.8449V38.4091H14.6667V33.8449ZM0 38.4091V34.4969C0 30.8716 5.04 27.82 11.8667 26.9333C10.2933 28.7068 9.33333 31.1585 9.33333 33.8449V38.4091H0ZM64 38.4091H54.6667V33.8449C54.6667 31.1585 53.7067 28.7068 52.1333 26.9333C58.96 27.82 64 30.8716 64 34.4969V38.4091Z",fill:"url(#paint0_linear_7891_25129)"}),ie__default.createElement("defs",null,ie__default.createElement("linearGradient",{id:"paint0_linear_7891_25129",x1:"32",y1:"0.590942",x2:"32",y2:"38.4091",gradientUnits:"userSpaceOnUse"},ie__default.createElement("stop",{stopColor:"white"}),ie__default.createElement("stop",{offset:"1",stopColor:"white"}))));var w9={communityCardImage:"lj",communityCardImage__placeholderImage:"nj",communityCardImage__placeholderImageIcon:"mj"};var aw=({imgSrc:e,className:t,pageId:o="*",componentId:r="*"})=>{let i="community_card_image",{themeStyles:n,accessibilityId:a}=S({pageId:o,componentId:r,elementId:i});return ie__default.createElement(Du,{src:e,style:n,"data-testid":a,alt:"Placeholder Community Cover",className:wl(w9.communityCardImage,t),fallBackRenderer:()=>ie__default.createElement(Lhe,{className:t})})},Lhe=({className:e})=>ie__default.createElement("div",{className:wl(w9.communityCardImage__placeholderImage,e)},ie__default.createElement(vG,{className:w9.communityCardImage__placeholderImageIcon}));var Fa={recommendedCommunityCardSkeleton:"hj",recommendedCommunityCardSkeleton__image:"gj",recommendedCommunityCardSkeleton__content:"pj",recommendedCommunityCardSkeleton__contentBar1:"bj",recommendedCommunityCardSkeleton__contentBar2:"uj",recommendedCommunityCardSkeleton__contentBar3:"fj",recommendedCommunityCardSkeleton__animation:"vj","skeleton-pulse":"od"};var bG=()=>ie__default.createElement("div",{className:Fa.recommendedCommunityCardSkeleton},ie__default.createElement("div",{className:wl(Fa.recommendedCommunityCardSkeleton__image,Fa.recommendedCommunityCardSkeleton__animation)}),ie__default.createElement("div",{className:wl(Fa.recommendedCommunityCardSkeleton__content,Fa.recommendedCommunityCardSkeleton__animation)},ie__default.createElement("div",{className:wl(Fa.recommendedCommunityCardSkeleton__contentBar1,Fa.recommendedCommunityCardSkeleton__animation)}),ie__default.createElement("div",{className:wl(Fa.recommendedCommunityCardSkeleton__contentBar2,Fa.recommendedCommunityCardSkeleton__animation)}),ie__default.createElement("div",{className:wl(Fa.recommendedCommunityCardSkeleton__contentBar3,Fa.recommendedCommunityCardSkeleton__animation)})));var Ei={recommendedCommunities:"wj",recommendedCommunityCard:"xj",recommendedCommunityCard__imageWrapper:"yj",recommendedCommunityCard__image:"kj",recommendedCommunityCard__content:"jj",recommendedCommunities__contentTitle:"zj",recommendedCommunityCard__communityName__private:"Xj",recommendedCommunityCard__bottom:"Yj",recommendedCommunityCard__content__left:"Ij",recommendedCommunityCard__category:"Aj",recommendedCommunities__content__right:"Mj",recommendedCommunityCard__arrowIcon:"ir",recommendedCommunityCard__arrow:"td",left:"id",right:"sd"};function M9(e){let[t,o]=useState();return useEffect(()=>{if(e.length===0)return;let r=CommunityRepository.getJoinRequestList({communityIds:e},({data:i})=>{o(i);});return ()=>r()},[JSON.stringify(e)]),{joinRequestList:t}}var jhe=({pageId:e,onClick:t,community:o,componentId:r,onCategoryClick:i,onJoinButtonClick:n,onLeaveButtonClick:a,isPendingJoin:s=!1})=>{let l=We({fileId:o.avatarFileId,imageSize:"medium"});return ie__default.createElement(V,{className:Ei.recommendedCommunityCard,onPress:()=>t(o.communityId)},ie__default.createElement("div",{className:Ei.recommendedCommunityCard__imageWrapper},ie__default.createElement(aw,{pageId:e,imgSrc:l,componentId:r,className:Ei.recommendedCommunityCard__image})),ie__default.createElement("div",{className:Ei.recommendedCommunityCard__content},ie__default.createElement("div",{className:Ei.recommendedCommunities__contentTitle},!o.isPublic&&ie__default.createElement(ar,{pageId:e,componentId:r}),ie__default.createElement(Mo,{pageId:e,componentId:r,community:o}),o.isOfficial&&ie__default.createElement(sr,{pageId:e,componentId:r})),ie__default.createElement("div",{className:Ei.recommendedCommunityCard__bottom},ie__default.createElement("div",{className:Ei.recommendedCommunityCard__content__left},ie__default.createElement(ed,{truncate:!0,pageId:e,community:o,maxCategoriesLength:2,componentId:r,onClick:i,className:Ei.recommendedCommunityCard__category}),ie__default.createElement(Vu,{pageId:e,componentId:r,memberCount:o.membersCount})),ie__default.createElement("div",{className:Ei.recommendedCommunities__content__right},o.isJoined&&s?ie__default.createElement(ry,{pageId:e,componentId:r,onClick:()=>a(o)}):ie__default.createElement(Uc,{pageId:e,componentId:r,onClick:()=>n(o)})))))},sw=({pageId:e="*"})=>{let t="recommended_communities",{accessibilityId:r,themeStyles:i}=se({pageId:e,componentId:t}),{online:n}=useNetworkState(),a=ce(),{goToCommunitiesByCategoryPage:s,goToCommunityProfilePage:l$1}=Y(),{recommendedCommunities:m,isLoading:c,fetchRecommendedCommunities:d,refetchRecommendedCommunities:u,pendingJoinCommunities:g,setPendingJoinCommunity:f}=fl(),C=m.map(w=>w.communityId).filter(w=>!g.includes(w)),{joinRequestList:y}=M9(C),b=y?m.filter(w=>!y.some(M=>M.targetId===w.communityId&&M.status==="pending")&&!g.includes(w.communityId)):m.filter(w=>!g.includes(w.communityId));useEffect(()=>{d();},[]);let{joinCommunity:_,leaveCommunity:x}=td({onJoinSuccess:({data:w,communityId:M})=>{(w==null?void 0:w.status)==="pending"&&M&&f(M),u();}}),P=w=>l(void 0,null,function*(){if(!n){a.info({content:"Failed to join community. Please try again."});return}_(w);}),I=w=>{if(!n){a.info({content:"Failed to leave community. Please try again."});return}x(w);};return ie__default.createElement(ku,{scrollOffset:400,iconClassName:Ei.recommendedCommunityCard__arrowIcon,isHidden:c||b.length<3,leftArrowClassName:wl(Ei.recommendedCommunityCard__arrow,Ei.left),rightArrowClassName:wl(Ei.recommendedCommunityCard__arrow,Ei.right)},ie__default.createElement("div",{style:i,"data-testid":r,className:Ei.recommendedCommunities},c?Array.from({length:4}).map((w,M)=>ie__default.createElement(bG,{key:M})):b.length===0?null:b.slice(0,4).map(w=>ie__default.createElement(jhe,{pageId:e,community:w,componentId:t,key:w.communityId,isPendingJoin:(y==null?void 0:y.some(M=>M.targetId===w.communityId&&M.status==="pending"))||g.includes(w.communityId),onJoinButtonClick:M=>P(M),onLeaveButtonClick:M=>I(M),onClick:M=>l$1(M),onCategoryClick:M=>s({categoryId:M})}))))};var lw={trendingCommunities:"Sj"};var mw=({pageId:e="*"})=>{let t="trending_communities",{accessibilityId:o,themeStyles:r}=se({pageId:e,componentId:t}),{trendingCommunities:i,isLoading:n,fetchTrendingCommunities:a$1,pendingJoinCommunities:s}=fl(),{goToCommunitiesByCategoryPage:l,goToCommunityProfilePage:m}=Y(),c=i.map(u=>u.communityId),{joinRequestList:d}=M9(c);return useEffect(()=>{a$1();},[]),n?ie__default.createElement("div",{style:r,"data-testid":o,className:lw.trendingCommunities},Array.from({length:5}).map((u,g)=>ie__default.createElement(Uu,{key:g}))):i.length===0?null:ie__default.createElement("div",{style:r,"data-testid":o,className:lw.trendingCommunities},i.map((u,g)=>{let f=d==null?void 0:d.find(b=>b.targetId===u.communityId),C=s.includes(u.communityId),y=f;return C&&f&&(y=b(a({},f),{status:JoinRequestStatusEnum.Pending})),ie__default.createElement(Hc,{showJoinButton:!0,pageId:e,order:g+1,community:u,maxCategoriesLength:2,minCategoryCharacters:3,componentId:t,maxCategoryCharacters:36,key:u.communityId,onClick:b=>m(b),onCategoryClick:b=>l({categoryId:b}),joinRequest:y})}))};var na={explore:"dd",explore__recommendedForYou:"fe",explore__trendingNow:"cd",explore__trendingTitleSkeleton:"ld","skeleton-pulse":"nd",explore__recommendedForYouTitle:"Cj",explore__exploreCategories:"sr",explore__divider:"md"};var dw={exploreError:"Ej",exploreError__text:"Rj"};var Yhe=()=>ie__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"62",height:"42",viewBox:"0 0 62 42",fill:"none"},ie__default.createElement("path",{d:"M58.7773 0.841919C60.1484 0.841919 61.3086 2.00208 61.3086 3.37317V38.8107C61.3086 40.2872 60.1484 41.3419 58.7773 41.3419H5.62109C2.77344 41.3419 0.558594 39.1271 0.558594 36.2794V6.74817C0.558594 5.37708 1.61328 4.21692 3.08984 4.21692H7.30859V3.37317C7.30859 2.00208 8.36328 0.841919 9.83984 0.841919H58.7773ZM3.93359 36.2794C3.93359 37.2286 4.67188 37.9669 5.62109 37.9669C6.46484 37.9669 7.30859 37.2286 7.30859 36.2794V7.59192H3.93359V36.2794ZM57.9336 37.9669V4.21692H10.6836V36.2794V36.3849C10.6836 36.8068 10.4727 37.545 10.3672 37.9669H57.9336Z",fill:"#EBECEF"})),PG=()=>ie__default.createElement("div",{className:dw.exploreError},ie__default.createElement(Yhe,null),ie__default.createElement("div",{className:dw.exploreError__text},ie__default.createElement(v.TitleBold,null,"Something went wrong"),ie__default.createElement(v.Caption,null,"Please try again.")));function N9({onClick:e,pageId:t="*",componentId:o="*"}){let r="explore_create_community",{accessibilityId:i,config:n,isExcluded:a,themeStyles:s}=S({pageId:t,componentId:o,elementId:r});return a?null:ie__default.createElement(oe,{size:"medium",variant:"fill",color:"primary",icon:ie__default.createElement(br,null),onPress:e,style:s,"data-testid":i},n.text)}var Qhe=()=>ie__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"161",height:"161",viewBox:"0 0 161 161",fill:"none"},ie__default.createElement("path",{d:"M130.1 24.5H34.0996C29.6813 24.5 26.0996 28.0817 26.0996 32.5V128.5C26.0996 132.918 29.6813 136.5 34.0996 136.5H130.1C134.518 136.5 138.1 132.918 138.1 128.5V32.5C138.1 28.0817 134.518 24.5 130.1 24.5Z",fill:"#292B32"}),ie__default.createElement("path",{d:"M43.7002 68.2H44.2002H151.7C152.628 68.2 153.519 68.5688 154.175 69.2251C154.831 69.8815 155.2 70.7718 155.2 71.7V91.7C155.2 92.6283 154.831 93.5185 154.175 94.1749C153.519 94.8313 152.628 95.2 151.7 95.2H43.7002C42.7719 95.2 41.8817 94.8313 41.2253 94.1749C40.5689 93.5185 40.2002 92.6283 40.2002 91.7V71.7C40.2002 70.7718 40.5689 69.8815 41.2253 69.2251C41.8817 68.5688 42.7719 68.2 43.7002 68.2Z",fill:"#292B32",stroke:"#40434E"}),ie__default.createElement("path",{opacity:"0.3",d:"M90.9002 74.1H70.1002C68.7747 74.1 67.7002 75.1745 67.7002 76.5C67.7002 77.8255 68.7747 78.9 70.1002 78.9H90.9002C92.2257 78.9 93.3002 77.8255 93.3002 76.5C93.3002 75.1745 92.2257 74.1 90.9002 74.1Z",fill:"#40434E"}),ie__default.createElement("path",{opacity:"0.15",d:"M105.3 84.5H70.1002C68.7747 84.5 67.7002 85.5745 67.7002 86.9C67.7002 88.2255 68.7747 89.3 70.1002 89.3H105.3C106.626 89.3 107.7 88.2255 107.7 86.9C107.7 85.5745 106.626 84.5 105.3 84.5Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M53.6996 89.3C57.897 89.3 61.2996 85.8974 61.2996 81.7C61.2996 77.5027 57.897 74.1 53.6996 74.1C49.5022 74.1 46.0996 77.5027 46.0996 81.7C46.0996 85.8974 49.5022 89.3 53.6996 89.3Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M9.2998 102.6H9.7998H117.3C118.228 102.6 119.118 102.969 119.775 103.625C120.431 104.282 120.8 105.172 120.8 106.1V126.1C120.8 127.028 120.431 127.919 119.775 128.575C119.118 129.231 118.228 129.6 117.3 129.6H9.2998C8.37155 129.6 7.48131 129.231 6.82493 128.575C6.16855 127.919 5.7998 127.028 5.7998 126.1V106.1C5.7998 105.172 6.16855 104.282 6.82493 103.625C7.48131 102.969 8.37155 102.6 9.2998 102.6Z",fill:"#292B32",stroke:"#40434E"}),ie__default.createElement("path",{opacity:"0.3",d:"M56.4998 108.5H35.6998C34.3743 108.5 33.2998 109.575 33.2998 110.9C33.2998 112.225 34.3743 113.3 35.6998 113.3H56.4998C57.8253 113.3 58.8998 112.225 58.8998 110.9C58.8998 109.575 57.8253 108.5 56.4998 108.5Z",fill:"#40434E"}),ie__default.createElement("path",{opacity:"0.15",d:"M70.8998 118.9H35.6998C34.3743 118.9 33.2998 119.975 33.2998 121.3C33.2998 122.626 34.3743 123.7 35.6998 123.7H70.8998C72.2253 123.7 73.2998 122.626 73.2998 121.3C73.2998 119.975 72.2253 118.9 70.8998 118.9Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M19.3002 123.7C23.4976 123.7 26.9002 120.297 26.9002 116.1C26.9002 111.903 23.4976 108.5 19.3002 108.5C15.1028 108.5 11.7002 111.903 11.7002 116.1C11.7002 120.297 15.1028 123.7 19.3002 123.7Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M9.2998 33.8H117.3C119.233 33.8 120.8 35.367 120.8 37.3V57.3C120.8 59.233 119.233 60.8 117.3 60.8H9.2998C7.36681 60.8 5.7998 59.233 5.7998 57.3V37.3C5.7998 35.367 7.36681 33.8 9.2998 33.8Z",fill:"#292B32",stroke:"#40434E"}),ie__default.createElement("path",{opacity:"0.3",d:"M54.8992 39.7H34.0992C32.7737 39.7 31.6992 40.7745 31.6992 42.1C31.6992 43.4255 32.7737 44.5 34.0992 44.5H54.8992C56.2247 44.5 57.2992 43.4255 57.2992 42.1C57.2992 40.7745 56.2247 39.7 54.8992 39.7Z",fill:"#40434E"}),ie__default.createElement("path",{opacity:"0.15",d:"M69.2992 50.1H34.0992C32.7737 50.1 31.6992 51.1745 31.6992 52.5C31.6992 53.8255 32.7737 54.9 34.0992 54.9H69.2992C70.6247 54.9 71.6992 53.8255 71.6992 52.5C71.6992 51.1745 70.6247 50.1 69.2992 50.1Z",fill:"#40434E"}),ie__default.createElement("path",{d:"M19.3002 54.9C23.4976 54.9 26.9002 51.4974 26.9002 47.3C26.9002 43.1026 23.4976 39.7 19.3002 39.7C15.1028 39.7 11.7002 43.1026 11.7002 47.3C11.7002 51.4974 15.1028 54.9 19.3002 54.9Z",fill:"#40434E"})),Khe=()=>ie__default.createElement("svg",{width:"160",height:"160",viewBox:"0 0 160 160",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ie__default.createElement("path",{d:"M129.6 24H33.6C29.1817 24 25.6 27.5817 25.6 32V128C25.6 132.418 29.1817 136 33.6 136H129.6C134.018 136 137.6 132.418 137.6 128V32C137.6 27.5817 134.018 24 129.6 24Z",fill:"#EBECEF"}),ie__default.createElement("path",{d:"M43.2 67.7002H43.7H151.2C152.128 67.7002 153.019 68.0689 153.675 68.7253C154.331 69.3817 154.7 70.2719 154.7 71.2002V91.2002C154.7 92.1285 154.331 93.0187 153.675 93.6751C153.019 94.3314 152.128 94.7002 151.2 94.7002H43.2C42.2718 94.7002 41.3815 94.3314 40.7251 93.6751C40.0688 93.0187 39.7 92.1285 39.7 91.2002V71.2002C39.7 70.2719 40.0688 69.3817 40.7251 68.7253C41.3815 68.0689 42.2718 67.7002 43.2 67.7002Z",fill:"white",stroke:"#EBECEF"}),ie__default.createElement("path",{opacity:"0.3",d:"M90.4 73.6001H69.6C68.2745 73.6001 67.2 74.6746 67.2 76.0001C67.2 77.3256 68.2745 78.4001 69.6 78.4001H90.4C91.7255 78.4001 92.8 77.3256 92.8 76.0001C92.8 74.6746 91.7255 73.6001 90.4 73.6001Z",fill:"#A5A9B5"}),ie__default.createElement("path",{opacity:"0.15",d:"M104.8 84H69.6C68.2745 84 67.2 85.0745 67.2 86.4C67.2 87.7255 68.2745 88.8 69.6 88.8H104.8C106.125 88.8 107.2 87.7255 107.2 86.4C107.2 85.0745 106.125 84 104.8 84Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M53.1999 88.8001C57.3973 88.8001 60.7999 85.3975 60.7999 81.2001C60.7999 77.0027 57.3973 73.6001 53.1999 73.6001C49.0025 73.6001 45.5999 77.0027 45.5999 81.2001C45.5999 85.3975 49.0025 88.8001 53.1999 88.8001Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M8.8 102.1H9.3H116.8C117.728 102.1 118.618 102.469 119.275 103.125C119.931 103.782 120.3 104.672 120.3 105.6V125.6C120.3 126.528 119.931 127.419 119.275 128.075C118.618 128.731 117.728 129.1 116.8 129.1H8.8C7.87175 129.1 6.98151 128.731 6.32513 128.075C5.66875 127.419 5.3 126.528 5.3 125.6V105.6C5.3 104.672 5.66875 103.782 6.32513 103.125C6.98151 102.469 7.87175 102.1 8.8 102.1Z",fill:"white",stroke:"#EBECEF"}),ie__default.createElement("path",{opacity:"0.3",d:"M56 108H35.2C33.8745 108 32.8 109.075 32.8 110.4C32.8 111.725 33.8745 112.8 35.2 112.8H56C57.3255 112.8 58.4 111.725 58.4 110.4C58.4 109.075 57.3255 108 56 108Z",fill:"#A5A9B5"}),ie__default.createElement("path",{opacity:"0.15",d:"M70.4 118.4H35.2C33.8745 118.4 32.8 119.474 32.8 120.8C32.8 122.125 33.8745 123.2 35.2 123.2H70.4C71.7255 123.2 72.8 122.125 72.8 120.8C72.8 119.474 71.7255 118.4 70.4 118.4Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M18.8 123.2C22.9974 123.2 26.4 119.797 26.4 115.6C26.4 111.403 22.9974 108 18.8 108C14.6026 108 11.2 111.403 11.2 115.6C11.2 119.797 14.6026 123.2 18.8 123.2Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M8.8 33.2998H116.8C118.733 33.2998 120.3 34.8668 120.3 36.7998V56.7998C120.3 58.7328 118.733 60.2998 116.8 60.2998H8.8C6.86701 60.2998 5.3 58.7328 5.3 56.7998V36.7998C5.3 34.8668 6.86701 33.2998 8.8 33.2998Z",fill:"white",stroke:"#EBECEF"}),ie__default.createElement("path",{opacity:"0.3",d:"M54.3999 39.1997H33.5999C32.2744 39.1997 31.1999 40.2742 31.1999 41.5997C31.1999 42.9252 32.2744 43.9997 33.5999 43.9997H54.3999C55.7254 43.9997 56.7999 42.9252 56.7999 41.5997C56.7999 40.2742 55.7254 39.1997 54.3999 39.1997Z",fill:"#A5A9B5"}),ie__default.createElement("path",{opacity:"0.15",d:"M68.7999 49.5996H33.5999C32.2744 49.5996 31.1999 50.6741 31.1999 51.9996C31.1999 53.3251 32.2744 54.3996 33.5999 54.3996H68.7999C70.1254 54.3996 71.1999 53.3251 71.1999 51.9996C71.1999 50.6741 70.1254 49.5996 68.7999 49.5996Z",fill:"#A5A9B5"}),ie__default.createElement("path",{d:"M18.8001 54.3997C22.9975 54.3997 26.4001 50.9971 26.4001 46.7997C26.4001 42.6023 22.9975 39.1997 18.8001 39.1997C14.6027 39.1997 11.2001 42.6023 11.2001 46.7997C11.2001 50.9971 14.6027 54.3997 18.8001 54.3997Z",fill:"#A5A9B5"})),Uf=({pageId:e="*",componentId:t="*"})=>{let o="explore_empty_image",{currentTheme:r,accessibilityId:i,config:n,defaultConfig:a,isExcluded:s,uiReference:l,themeStyles:m}=S({pageId:e,componentId:t,elementId:o});return s?null:ie__default.createElement(Z,{defaultIconName:a.icon,configIconName:n.icon,imgIcon:()=>ie__default.createElement("img",{style:m,src:n.icon,alt:l,"data-testid":i}),defaultIcon:()=>ie__default.createElement("div",{"data-testid":i,style:m},r==="light"?ie__default.createElement(Khe,null):ie__default.createElement(Qhe,null))})};var cw={exploreEmpty:"hd",exploreEmpty__text:"Uj"};function pw({pageId:e="*"}){let t="explore_empty",{goToCreateCommunityPage:o}=Y(),{themeStyles:r,accessibilityId:i}=se({componentId:t,pageId:e});return ie__default.createElement("div",{className:cw.exploreEmpty,style:r,"data-testid":i},ie__default.createElement(Uf,{pageId:e,componentId:t}),ie__default.createElement("div",{className:cw.exploreEmpty__text},ie__default.createElement(xt,{pageId:e,componentId:t}),ie__default.createElement(Qc,{pageId:e,componentId:t})),ie__default.createElement(N9,{pageId:e,componentId:t,onClick:()=>o==null?void 0:o({mode:"create"})}))}var uw={exploreCommunityEmpty:"gd",exploreCommunityEmpty__text:"Bj"};function gw({pageId:e="*"}){let t="explore_community_empty",{goToCreateCommunityPage:o}=Y(),{themeStyles:r,accessibilityId:i}=se({componentId:t,pageId:e});return ie__default.createElement("div",{style:r,"data-testid":i,className:uw.exploreCommunityEmpty},ie__default.createElement(Uf,{pageId:e,componentId:t}),ie__default.createElement("div",{className:uw.exploreCommunityEmpty__text},ie__default.createElement(xt,{pageId:e,componentId:t}),ie__default.createElement(Qc,{pageId:e,componentId:t})),ie__default.createElement(N9,{pageId:e,componentId:t,onClick:()=>o==null?void 0:o({mode:"create"})}))}var wG={exploreTrendingTitle:"Fj"};function fw({pageId:e="*",componentId:t="*",titleClassName:o}){let r="explore_trending_title",{accessibilityId:i,config:n,isExcluded:a,themeStyles:s}=S({pageId:e,componentId:t,elementId:r});return a?null:ie__default.createElement(v.TitleBold,{className:wl(wG.exploreTrendingTitle,o),style:s,"data-testid":i},n.text)}var TG={exploreRecommendedTitle:"Hj"};function yw({pageId:e="*",componentId:t="*",titleClassName:o}){let r="explore_recommended_title",{accessibilityId:i,config:n,isExcluded:a,themeStyles:s}=S({pageId:e,componentId:t,elementId:r});return a?null:ie__default.createElement(v.TitleBold,{className:wl(TG.exploreRecommendedTitle,o),style:s,"data-testid":i},n.text)}function MG({pageId:e="*"}){let{refresh:t,isLoading:o,isEmpty:r,isCommunityEmpty:i,noRecommendedCommunities:n,noTrendingCommunities:a,error:s}=fl();return useEffect(()=>{t();},[]),s!=null?ie__default.createElement(PG,null):r?ie__default.createElement(Tl,{className:na.explore,onTouchEndCallback:t},ie__default.createElement(zr,null),ie__default.createElement(pw,{pageId:e})):i?ie__default.createElement(Tl,{className:na.explore,onTouchEndCallback:t},ie__default.createElement(zr,null),ie__default.createElement("div",{className:na.explore__exploreCategories},ie__default.createElement(I9,{pageId:e})),ie__default.createElement(zr,{className:na.explore__divider}),ie__default.createElement(gw,{pageId:e})):ie__default.createElement(Tl,{className:na.explore,onTouchEndCallback:t},ie__default.createElement(zr,null),ie__default.createElement("div",{className:na.explore__exploreCategories},ie__default.createElement(I9,{pageId:e})),ie__default.createElement(zr,{className:na.explore__divider}),n?null:ie__default.createElement("div",{className:na.explore__recommendedForYou,"data-is-loading":!!o},o?ie__default.createElement("div",{className:na.explore__trendingTitleSkeleton}):ie__default.createElement(yw,{pageId:e}),ie__default.createElement(sw,{pageId:e})),ie__default.createElement(zr,{className:na.explore__divider}),a?null:ie__default.createElement("div",{className:na.explore__trendingNow},o?ie__default.createElement("div",{className:na.explore__trendingTitleSkeleton}):ie__default.createElement(fw,{pageId:e}),ie__default.createElement(mw,{pageId:e})))}var k9=({pageId:e="*"})=>ie__default.createElement(GH,null,ie__default.createElement(MG,{pageId:e}));var _0={UNAVAILABLE:5e5};var NG=createContext({activeTab:"Newsfeed",setActiveTab:()=>{},liveStreamPlayer:null,setStreamPlayer:()=>{},acceptedInvitation:null,setAcceptedInvitation:()=>{},invitationNotificationTray:wI}),po=()=>{let e=useContext(NG);if(!e)throw new Error("useLayoutContext must be used within a LayoutProvider");return e},kG=({children:e})=>{let[t,o]=useState("Newsfeed"),[r,i]=useState(null),[n,a]=useState(null),s=Jz();return ie__default.createElement(NG.Provider,{value:{activeTab:t,setActiveTab:o,liveStreamPlayer:n,setStreamPlayer:a,acceptedInvitation:r,setAcceptedInvitation:i,invitationNotificationTray:s}},e)};var Om={invitationBanner:"pd",invitationBanner__inviter:"bd",invitationBanner__avatar:"Lj",invitationBanner__displayName:"Tj",invitationBanner__actions:"Vj",capitalize:"Wj"};function oj({community:e,pageId:t="*",removeInvitation:o,invitation:r}){var _,x;let i="invitation_banner",{onBack:n}=Y(),a=ce(),[s,l$1]=useState(!1),{setAcceptedInvitation:m,invitationNotificationTray:c}=po(),{accessibilityId:d,themeStyles:u}=se({pageId:t,componentId:i}),g=r||((_=ap(e))==null?void 0:_.invitation),{confirm:f}=Te(),C=()=>l(this,null,function*(){var P;try{yield g==null?void 0:g.accept(),yield CommunityRepository.getCommunityByIds([e.communityId]),a.success({content:`You joined ${(P=g==null?void 0:g.target)==null?void 0:P.displayName}.`}),g&&m(g),o==null||o();}catch(I){if(I.code===_0.UNAVAILABLE){a.info({content:"This invitation is no longer available."}),e.isPublic||e.isDiscoverable?o==null||o():n();return}a.info({content:"Failed to accept invitation. Please try again."});}finally{c.refresh();}}),y=()=>l(this,null,function*(){try{yield g==null?void 0:g.reject(),a.success({content:"Invitation declined."}),e.isPublic||e.isDiscoverable?o==null||o():n();}catch(P){if(P.code===_0.UNAVAILABLE){a.info({content:"This invitation is no longer available."}),e.isPublic||e.isDiscoverable?o==null||o():n();return}a.info({content:"Failed to decline invitation. Please try again."});}finally{c.refresh();}}),b=()=>l(this,null,function*(){if(e!=null&&e.requiresJoinApproval)return f({title:"Decline invitation?",content:"If you change your mind, you\u2019ll have to request to join again.",okText:"Decline",onOk:y});y();});return ie__default.createElement("div",{className:Om.invitationBanner,"data-testid":d,style:u},ie__default.createElement("div",{className:Om.invitationBanner__inviter,"data-truncate":s},ie__default.createElement("div",{className:Om.invitationBanner__avatar},ie__default.createElement(Ae,{userId:g==null?void 0:g.inviterUserPublicId,className:Om.invitationBanner__avatar,textPlaceholderClassName:Om.invitationBanner__avatar})),ie__default.createElement(v.BodyBold,{as:"p",className:Om.invitationBanner__displayName},ie__default.createElement(RE,{lines:3,onTruncate:l$1,ellipsis:ie__default.createElement(ie__default.Fragment,null,"... ",ie__default.createElement(v.BodyBold,{as:"span"},"invited you."))},ie__default.createElement("span",{className:Om.capitalize},(x=g==null?void 0:g.createdBy)==null?void 0:x.displayName)),!s&&ie__default.createElement(v.BodyBold,{as:"span"}," invited you."))),ie__default.createElement("div",{className:Om.invitationBanner__actions},ie__default.createElement(z1,{pageId:t,componentId:i,onPress:C}),ie__default.createElement(j1,{pageId:t,componentId:i,onPress:b})))}var b0={invitation:"qj",invitation__content:"Dj",invitation__user:"Gj",invitation__avatar:"Jj",invitation__actions:"Kj"};var BG=({onClose:e,invitation:t,pageId:o="*",componentId:r="*"})=>{let i=ce(),{AmityNotificationTrayPageBehavior:n}=we(),{setAcceptedInvitation:a,invitationNotificationTray:s}=po(),{confirm:l$1}=Te(),{community:m}=Ct({communityId:t.targetId}),c=()=>{var f;e==null||e(),localStorage.setItem(t.invitationId,t.invitationId),(f=n==null?void 0:n.goToCommunityProfilePage)==null||f.call(n,{communityId:t.targetId}),s.refresh();},d=()=>l(void 0,null,function*(){var f,C;try{e==null||e(),yield t.accept(),yield CommunityRepository.getCommunityByIds([t.targetId]),i.success({content:`You joined ${(f=t.target)==null?void 0:f.displayName}.`}),(C=n==null?void 0:n.goToCommunityProfilePage)==null||C.call(n,{communityId:t.targetId}),t&&a(t);}catch(y){if(y.code===_0.UNAVAILABLE)return i.info({content:"This invitation is no longer available."});i.info({content:"Failed to accept invitation. Please try again."});}finally{s.refresh();}}),u=()=>l(void 0,null,function*(){try{e==null||e(),yield t.reject(),i.success({content:"Invitation declined."});}catch(f){if(f.code===_0.UNAVAILABLE)return i.info({content:"This invitation is no longer available."});i.info({content:"Failed to decline invitation. Please try again."});}finally{s.refresh();}}),g=()=>{if(m!=null&&m.requiresJoinApproval)return e==null||e(),l$1({title:"Decline invitation?",content:"If you change your mind, you\u2019ll have to request to join again.",okText:"Decline",onOk:u});u();};return ie__default.createElement(V,{onPress:()=>c(),className:b0.invitation,"data-seen":!!localStorage.getItem(t.invitationId)},ie__default.createElement("div",{className:b0.invitation__content},ie__default.createElement("div",{className:b0.invitation__user},ie__default.createElement(Ae,{pageId:o,componentId:r,onPressAvatar:c,shouldRedirectToUserProfile:!1,className:b0.invitation__avatar,userId:t.inviterUserPublicId}),ie__default.createElement(Fb,{pageId:o,invitation:t,componentId:r})),ie__default.createElement(gi,{pageId:o,componentId:r,elementId:"invitation_date",timestamp:t.createdAt})),ie__default.createElement("div",{className:b0.invitation__actions},ie__default.createElement(z1,{pageId:o,onPress:d,componentId:r,elementId:"accept_invite_button"}),ie__default.createElement(j1,{pageId:o,onPress:g,componentId:r,elementId:"decline_invite_button"})))};var vw=({onClose:e,pageId:t="*",invitations:o})=>{let r="invitation_section",{accessibilityId:i,isExcluded:n,themeStyles:a}=se({pageId:t,componentId:r});return n?null:ie__default.createElement("div",{"data-testid":i,style:a},ie__default.createElement(Eb,{pageId:t,componentId:r}),o.slice(0,3).map(s=>ie__default.createElement(BG,{pageId:t,onClose:e,invitation:s,componentId:r,key:s.invitationId})))};var CCe=e=>{let[t,o]=useState([]);return useEffect(()=>{function r(){return l(this,null,function*(){if(e==null||e.length===0)return;let i=yield Promise.all(e.map(n=>l(this,null,function*(){return (yield CategoryRepository.getCategory(n)).data})));o(i);})}r();},[e]),t},EG=CCe;var vCe=({community:e})=>{let{currentUserId:t,userRoles:o,client:r}=Ye(),{moderators:i}=cm(e==null?void 0:e.communityId),n=i.find(m=>m.userId===t),a=o.find(m=>m==="global-admin")!=null,s=n!=null,l=(e==null?void 0:e.communityId)&&(r==null?void 0:r.hasPermission(w1.CreatePivillegedPostPermission).community(e==null?void 0:e.communityId))||(e==null?void 0:e.postSetting)!=="ONLY_ADMIN_CAN_POST";return {isModerator:s,canEdit:a||s,canReview:a||s,canCreatePost:!!l}},B9=vCe;var A9=e=>{let{onEditCommunity:t}=qt(),o=Lr(e),r=We({fileId:o==null?void 0:o.avatarFileId,imageSize:"medium"}),{posts:i}=as({targetType:"community",targetId:e,feedType:"reviewing"}),n=EG(o==null?void 0:o.categoryIds),{canReview:a,canEdit:s}=B9({community:o}),l=useMemo(()=>(i==null?void 0:i.length)||0,[i]);return {community:o,reviewingPosts:i,avatarFileUrl:r,communityCategories:n,pendingPostsCount:l,canEditCommunity:s,canReviewCommunityPosts:a,onEditCommunity:t,joinCommunity:()=>e&&CommunityRepository.joinCommunity(e),leaveCommunity:()=>e&&CommunityRepository.leaveCommunity(e),updateCommunity:g=>e&&CommunityRepository.updateCommunity(e,g),closeCommunity:()=>e&&CommunityRepository.deleteCommunity(e)}};var AG={roundedBackButton:"Nj"};var xCe=e=>ie__default.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"none",viewBox:"0 0 32 32"},e),ie__default.createElement("circle",{cx:"16",cy:"16",r:"16",fill:"#000",fillOpacity:"0.5"}),ie__default.createElement("path",{fill:"currentColor",d:"M16.176 23.914c-.14.176-.422.176-.598 0L8.23 16.566a.405.405 0 010-.597l7.348-7.348c.176-.176.457-.176.598 0l.703.668c.176.176.176.457 0 .598l-5.45 5.449h12.024c.211 0 .422.21.422.422v.984c0 .246-.21.422-.422.422H11.43l5.449 5.484c.176.141.176.422 0 .598l-.703.668z"})),Hf=({pageId:e="*",componentId:t="*",defaultClassName:o,imgClassName:r,onPress:i})=>{let n="back_button",{accessibilityId:a,config:s,defaultConfig:l,isExcluded:m,uiReference:c,themeStyles:d}=S({pageId:e,componentId:t,elementId:n});return m?null:ie__default.createElement(V,{style:d,className:AG.roundedBackButton,onPress:i},ie__default.createElement(Z,{"data-testid":a,defaultIcon:()=>ie__default.createElement(xCe,{className:o}),imgIcon:()=>ie__default.createElement("img",{src:s.icon,alt:c,className:r}),defaultIconName:l.icon,configIconName:s.icon}))};var Da={draftPageContainer:"ud",headerContainer:"Oj",storyWrapper:"fd",header:"Pj",topRightButtons:"Qj",mainContainer:"Zj",previewImage:"_j",footer:"ez",videoPreview:"rz",hyperLinkContainer:"az",playPauseButton:"oz",progressBar:"tz",progressFill:"iz",userInfo:"sz",name:"dz",description:"cz",storyPreview:"lz",addHyperlinkContainer:"vd"};var SCe=({targetId:e,targetType:t,mediaType:o,onDiscardCreateStory:r})=>{let{isDesktop:i}=le(),{openPopup:n,closePopup:a}=Se(),{setDrawerData:s,removeDrawerData:l$1}=tt(),{onBack:m,prevPage:c}=Y(),d="create_story_page",{accessibilityId:u,themeStyles:g}=ue({pageId:d}),{file:f,setFile:C,isStoryUploading:y,setIsStoryUploading:b}=In(),{community:_}=A9(e),{confirm:x}=Te(),P=ce(),{online:I}=useNetworkState(),[w,M]=useState([{data:{url:"",customText:""},type:"hyperlink"}]),[T,E]=useState("fit"),[N,A]=useState([]),D=useMemo(()=>{var ne;return (ne=w.filter(te=>te.type==="hyperlink"))==null?void 0:ne[0].data.url},[w]),G=useMemo(()=>{var ne;return (ne=w.filter(te=>te.type==="hyperlink"))==null?void 0:ne[0].data.customText},[w]),H=()=>{E(T==="fit"?"fill":"fit"),T==="fill"&&A([]);},$=X=>l(void 0,[X],function*({file:ne,imageMode:te,metadata:Q,items:me}){if(b(!0),!!ne){(c==null?void 0:c.type)==="ViewStoryPage"||(c==null?void 0:c.type)==="StoryTargetSelectionPage"?m(2):m();try{let q=new FormData;q.append("files",ne),C(null),(o==null?void 0:o.type)==="image"&&e?yield StoryRepository.createImageStory(t,e,q,Q,te,me):(o==null?void 0:o.type)==="video"&&e&&(yield StoryRepository.createVideoStory(t,e,q,Q,me)),P.success({content:"Successfully shared story"});}catch(q){q instanceof Error&&P.info({content:"Failed to upload"});}finally{b(!1);}}}),j=()=>{x({pageId:d,title:"Discard this story?",content:"The story will be permanently discarded. It cannot be undone.",cancelText:"Cancel",okText:"Discard",onOk:()=>{C(null),r();}});},O=({url:ne,customText:te=""})=>{M([{data:{url:ne,customText:te},type:"hyperlink"}]),l$1(),i?a():l$1();},z=()=>{M([{data:{url:"",customText:""},type:"hyperlink"}]);},k=ne=>ie__default.createElement("div",{className:Da.addHyperlinkContainer},ie__default.createElement(Fx,{pageId:d,url:D,customText:G,onClose:ne,onSubmit:O,onRemove:z})),F=()=>{var ne,te;if((te=(ne=w[0])==null?void 0:ne.data)!=null&&te.url){P.info({content:"Can\u2019t add more than one link to your story.",alignment:"fullscreen"});return}i?n({pageId:d,view:"desktop",children:k(a)}):s({content:k(()=>{l$1();})});},re=()=>{i?n({pageId:d,view:"desktop",children:k(a)}):s({content:k(()=>{l$1();})});},W=useCallback(ne=>l(void 0,null,function*(){let te=new Image;te.crossOrigin="Anonymous",te.src=ne,te.onload=()=>{let me=new TCe().getPalette(te,2);me&&A(me.map(X=>`rgb(${X.join(",")})`));};}),[]);return useEffect(()=>{l(void 0,null,function*(){if((o==null?void 0:o.type)==="image")if(f){let te=URL.createObjectURL(f);yield W(te);}else o.url&&(yield W(o.url));});},[f,o,T]),ie__default.createElement("div",{"data-testid":u,style:g,className:Da.storyWrapper},ie__default.createElement("div",{id:"asc-uikit-create-story",className:Da.draftPageContainer},ie__default.createElement("div",{className:Da.headerContainer},ie__default.createElement("div",{className:Da.header},ie__default.createElement(Hf,{pageId:d,onPress:j}),ie__default.createElement("div",{className:Da.topRightButtons},(o==null?void 0:o.type)==="image"&&ie__default.createElement(O2,{pageId:d,onPress:H}),ie__default.createElement(_7,{pageId:d,onPress:F})))),(o==null?void 0:o.type)==="image"?ie__default.createElement("div",{className:Da.mainContainer,style:{background:`linear-gradient(
1871
1871
  180deg,
1872
1872
  ${N[0]} 0%,
1873
1873
  ${N[1]} 100%