@amityco/ulta-ui-kit 1.0.0-beta.10 → 1.0.0-beta.11
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 +58 -58
- package/dist/index.js +58 -58
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -403,7 +403,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
403
403
|
@media (max-height: 570px) {
|
|
404
404
|
top: 300px;
|
|
405
405
|
}
|
|
406
|
-
top:
|
|
406
|
+
top: 350px;
|
|
407
407
|
`,Uh=m.div`
|
|
408
408
|
margin: auto;
|
|
409
409
|
background: ${({theme:e})=>e.palette.system.background};
|
|
@@ -443,7 +443,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
443
443
|
border-top: 1px solid ${t.palette.base.shade4};
|
|
444
444
|
padding-top: 16px;
|
|
445
445
|
`}
|
|
446
|
-
`;var wU=({"data-qa-anchor":e="",size:t="",className:o,onOverlayClick:r=()=>{},onCancel:n,title:i,footer:a,clean:s,children:l})=>{let d=useRef(null);useEffect(()=>{var u;(u=d==null?void 0:d.current)==null||u.focus();},[d==null?void 0:d.current]);let p=typeof l=="string"||(l==null?void 0:l.type)==="FormattedMessage";return re.createElement(Oh,{onClick:r},re.createElement(zh,null,re.createElement($h,{small:t==="small",tabIndex:0,className:o,ref:d,"data-qa-anchor":e},(i||n)&&re.createElement(Vh,{clean:s},i,n&&re.createElement(Fh,{onClick:n})),re.createElement(jh,{isText:p},l),a&&re.createElement(Gh,{clean:s},a))))},Yt=wU;var MU=r=>{var n=r,{variant:e,fullWidth:t=!1}=n,o=M(n,["variant","fullWidth"]);switch(e){case"primary":return re.createElement(ye,E(c({},o),{fullWidth:t}));case"secondary":return re.createElement(Fe,E(c({},o),{fullWidth:t}));default:return re.createElement(Lh,E(c({},o),{fullWidth:t}))}},
|
|
446
|
+
`;var wU=({"data-qa-anchor":e="",size:t="",className:o,onOverlayClick:r=()=>{},onCancel:n,title:i,footer:a,clean:s,children:l})=>{let d=useRef(null);useEffect(()=>{var u;(u=d==null?void 0:d.current)==null||u.focus();},[d==null?void 0:d.current]);let p=typeof l=="string"||(l==null?void 0:l.type)==="FormattedMessage";return re.createElement(Oh,{onClick:r},re.createElement(zh,null,re.createElement($h,{small:t==="small",tabIndex:0,className:o,ref:d,"data-qa-anchor":e},(i||n)&&re.createElement(Vh,{clean:s},i,n&&re.createElement(Fh,{onClick:n})),re.createElement(jh,{isText:p},l),a&&re.createElement(Gh,{clean:s},a))))},Yt=wU;var MU=r=>{var n=r,{variant:e,fullWidth:t=!1}=n,o=M(n,["variant","fullWidth"]);switch(e){case"primary":return re.createElement(ye,E(c({},o),{fullWidth:t}));case"secondary":return re.createElement(Fe,E(c({},o),{fullWidth:t}));default:return re.createElement(Lh,E(c({},o),{fullWidth:t}))}},Y=MU;var Zh=m(Yt)`
|
|
447
447
|
max-width: 360px;
|
|
448
448
|
`,Qh=m.div`
|
|
449
449
|
padding: 1rem 1rem 0.75rem 1rem;
|
|
@@ -456,7 +456,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
456
456
|
&:hover {
|
|
457
457
|
background: ${({theme:e})=>e.palette.alert.main};
|
|
458
458
|
}
|
|
459
|
-
`,Kh=m(
|
|
459
|
+
`,Kh=m(Y)`
|
|
460
460
|
margin-right: 10px;
|
|
461
461
|
`;var PU=({"data-qa-anchor":e="",className:t,title:o,content:r,okText:n="Ok",onOk:i,OkButton:a=qh,cancelText:s="Cancel",CancelButton:l=Kh,onCancel:d,type:p="confirm"})=>re.createElement(Zh,{"data-qa-anchor":`confirm-modal-${e}`,clean:!0,className:t,title:o,footer:re.createElement(Wh,null,p==="confirm"&&re.createElement(l,{"data-qa-anchor":"confirm-modal-cancel-button",onClick:d},s),re.createElement(a,{"data-qa-anchor":`confirm-modal-${e}-ok-button`,onClick:i},n)),onCancel:d},re.createElement(Qh,null,r)),Jh=()=>{let{confirmData:e,closeConfirm:t}=Me();if(!e)return null;let o=()=>{t(),e!=null&&e.onCancel&&e.onCancel();},r=()=>{t(),e!=null&&e.onOk&&e.onOk(),e!=null&&e.onSuccess&&(e==null||e.onSuccess());};return re.createElement(va,null,re.createElement(PU,E(c({},e),{onCancel:o,onOk:r})))};var e0={icon__container:"Kr",icon:"Nr",notifications:"X",notificationContainer:"I",appear:"M"};var SU=t=>{var e=M(t,[]);return re.createElement("svg",c({width:"18",height:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M9 0.0273438C13.7812 0.0273438 17.7188 3.96484 17.7188 8.74609C17.7188 13.5625 13.7812 17.4648 9 17.4648C4.18359 17.4648 0.28125 13.5625 0.28125 8.74609C0.28125 3.96484 4.18359 0.0273438 9 0.0273438ZM9 1.71484C5.09766 1.71484 1.96875 4.87891 1.96875 8.74609C1.96875 12.6484 5.09766 15.7773 9 15.7773C12.8672 15.7773 16.0312 12.6484 16.0312 8.74609C16.0312 4.87891 12.8672 1.71484 9 1.71484ZM13.9219 6.32031C14.0625 6.46094 14.0625 6.74219 13.9219 6.91797L7.83984 12.9297C7.66406 13.1055 7.41797 13.1055 7.24219 12.9297L4.04297 9.69531C3.90234 9.55469 3.90234 9.27344 4.04297 9.09766L4.85156 8.32422C5.02734 8.14844 5.27344 8.14844 5.44922 8.32422L7.55859 10.4336L12.5156 5.51172C12.6914 5.33594 12.9727 5.33594 13.1133 5.51172L13.9219 6.32031Z"}))},t0=SU;var TU=t=>{var e=M(t,[]);return re.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 512 512"},e),re.createElement("path",{d:`M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504
|
|
462
462
|
119.083 392.957 8 256 8zm0 448c-110.532 0-200-89.431-200-200 0-110.495 89.472-200 200-200
|
|
@@ -550,7 +550,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
550
550
|
--pseudo-element-display: none; /* Disable animation */
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
|
-
`;var u0=createContext({client:null,currentUserId:void 0,userRoles:[]});var g0=createContext({client:null,currentUserId:void 0,userRoles:[]});var Z1=()=>useContext(u0),Y=Z1;var FC=createContext({subscribe:({fetcher:e,params:t,callback:o,config:r,refresh:n})=>({unsubscribe:()=>{}})}),G4=()=>useContext(FC);function Z4({children:e}){let t=useRef({}),o=useRef({}),r=useRef({}),{currentUserId:n}=Y();function i(s,l){return `${n}.${s}.${JSON.stringify(l)}`}useEffect(()=>()=>{Object.values(o.current).forEach(s=>s());},[]);let a=({fetcher:s,params:l,callback:d,config:p,refresh:u=!1})=>{if(n==null)return {unsubscribe(){}};let g=i(s.name,l);if(u&&(delete t.current[g],delete r.current[g]),t.current[g]&&r.current[g])d==null||d(r.current[g]),t.current[g].push(d);else {t.current[g]=[d];let f=s(l,y=>{r.current[g]=y,(t.current[g]||[]).forEach(h=>h(y));},p);o.current[g]=f;}return {unsubscribe(){let f=t.current[g].find(y=>y===d);f&&(t.current[g]=t.current[g].filter(y=>y!==f));}}};return re.createElement(FC.Provider,{value:{subscribe:a}},e)}var OC=createContext({subscribe:({fetcher:e,params:t,callback:o=()=>{},options:r})=>({unsubscribe:()=>{}})}),W4=()=>useContext(OC);function q4({children:e}){let t=useRef({}),o=useRef({}),r=useRef({}),{currentUserId:n}=Y();function i(s,l){return `${n}.${s}.${JSON.stringify(l)}`}useEffect(()=>()=>{Object.values(o.current).forEach(s=>s());},[]);let a=({fetcher:s,params:l,callback:d=()=>{},options:p})=>{if(n==null)return {unsubscribe(){}};let u=i(s.name,l);if(t.current[u])d(r.current[u]),t.current[u].push(d);else {t.current[u]=[d];let g=s(l,f=>{r.current[u]=f,(t.current[u]||[]).forEach(C=>C(f));},p);o.current[u]=g;}return {unsubscribe(){let g=t.current[u].find(f=>f===d);g&&(t.current[u]=t.current[u].filter(f=>f!==g));}}};return re.createElement(OC.Provider,{value:{subscribe:a}},e)}var j$=createContext({fetch:o=>_(void 0,[o],function*({fetchFn:e,params:t}){return yield Promise.resolve({})})});function K4({children:e}){let t=useRef({}),o=useRef({});function r(i,a){return `${i}.${JSON.stringify(a)}`}let n=({fetchFn:i,params:a})=>{var u;let s=r(i.name,a);if(((u=t.current[s])==null?void 0:u.length)>0){if(o.current[s]!=null)return Promise.resolve(o.current[s]);let g=()=>{},f=()=>{},y=new Promise((C,h)=>{g=C,f=h;});return t.current[s].push({resolve:g,reject:f}),y}let l=()=>{},d=()=>{},p=new Promise((g,f)=>{l=g,d=f;});return t.current[s]=[{resolve:l,reject:d}],i(...a).then(g=>{o.current[s]=g,t.current[s].forEach(({resolve:f})=>f(g));}).catch(g=>{t.current[s].forEach(({reject:f})=>f(g));}).finally(()=>{setTimeout(()=>{o.current[s]=null,t.current[s]=[];},500);}),p};return re.createElement(j$.Provider,{value:{fetch:n}},e)}var $C=createContext({subscribe:({topic:e,callback:t})=>({unsubscribe:()=>{}})}),VC=()=>useContext($C);function J4({children:e}){let t=useRef({}),o=useRef({});useEffect(()=>()=>{Object.values(o.current).forEach(n=>n());},[]);let r=({topic:n,callback:i})=>{if(t.current[n])t.current[n].push(i);else {t.current[n]=[i];let a=subscribeTopic(n,(...s)=>{(t.current[n]||[]).forEach(d=>d(...s));});o.current[n]=a;}return {unsubscribe(){let a=t.current[n].find(s=>s===i);a&&(t.current[n]=t.current[n].filter(s=>s!==a));}}};return re.createElement($C.Provider,{value:{subscribe:r}},e)}function X4({children:e}){return re.createElement(Z4,null,re.createElement(q4,null,re.createElement(J4,null,re.createElement(K4,null,e))))}function R$({fetcher:e,params:t,callback:o=()=>{},options:r,shouldCall:n=!0,getSubscribedTopic:i}){let{subscribe:a}=W4(),[s,l]=useState(null),d=useRef(null),p=useCallback(u=>{n&&t!=null&&(u.data&&l(u.data),o(u));},[n,o]);return useEffect(()=>(i&&(d.current=subscribeTopic(i())),()=>{var u;(u=d.current)==null||u.call(d);}),[i]),useEffect(()=>{if(t==null||!n)return;let{unsubscribe:u}=a({fetcher:e,params:t,callback:p,options:r});return ()=>{u();}},[t,n]),s}var Nt=R$;function Ts({fetcher:e,params:t,callback:o=()=>{},options:r,shouldSubscribe:n=()=>!0,getSubscribedTopic:i}){let{subscribe:a}=VC(),s=useRef(null);return Nt({fetcher:e,params:t,callback:l=>{let{error:d,loading:p}=l;if(p)return;if(d)throw d;let{unsubscribe:u}=a({topic:i(l),callback:o});s.current=u;},options:r,shouldCall:n}),useEffect(()=>()=>{var l;(l=s.current)==null||l.call(s);},[s]),{unsubscribe:()=>{var l;return (l=s.current)==null?void 0:l.call(s)}}}function ks({userId:e,level:t,shouldSubscribe:o=()=>!0,callback:r}){return Ts({fetcher:UserRepository.getUser,params:e,callback:r,shouldSubscribe:()=>!!e&&o(),getSubscribedTopic:({data:n})=>getUserTopic(n,t)})}var aV=e=>(ks({userId:e,level:SubscriptionLevels.USER}),Nt({fetcher:UserRepository.getUser,params:e,shouldCall:!!e})),oe=aV;var Ma=Object.freeze({MEMBER:"member",MODERATOR:"moderator",SUPER_MODERATOR:"super-moderator",COMMUNITY_MODERATOR:"community-moderator",CHANNEL_MODERATOR:"channel-moderator"}),lr=Object.freeze({EditUserPermission:"EDIT_USER",BanUserPermission:"BAN_USER",CreateRolePermission:"CREATE_ROLE",EditRolePermission:"EDIT_ROLE",DeleteRolePermission:"DELETE_ROLE",AssignRolePermission:"ASSIGN_USER_ROLE",EditChannelPermission:"EDIT_CHANNEL",EditChannelRatelimitPermission:"EDIT_CHANNEL_RATELIMIT",MuteChannelPermission:"MUTE_CHANNEL",CloseChannelPermission:"CLOSE_CHANNEL",AddChannelUserPermission:"ADD_CHANNEL_USER",EditChannelUserPermission:"EDIT_CHANNEL_USER",RemoveChannelUserPermission:"REMOVE_CHANNEL_USER",MuteChannelUserPermission:"MUTE_CHANNEL_USER",BanChannelUserPermission:"BAN_CHANNEL_USER",EditMessagePermission:"EDIT_MESSAGE",DeleteMessagePermission:"DELETE_MESSAGE",EditCommunityPermission:"EDIT_COMMUNITY",DeleteCommunityPermission:"DELETE_COMMUNITY",AddCommunityUserPermission:"ADD_COMMUNITY_USER",EditCommunityUserPermission:"EDIT_COMMUNITY_USER",RemoveCommunityUserPermission:"REMOVE_COMMUNITY_USER",MuteCommunityUserPermission:"MUTE_COMMUNITY_USER",BanCommunityUserPermission:"BAN_COMMUNITY_USER",EditUserFeedPostPermission:"EDIT_USER_FEED_POST",DeleteUserFeedPostPermission:"DELETE_USER_FEED_POST",EditUserFeedCommentPermission:"EDIT_USER_FEED_COMMENT",DeleteUserFeedCommentPermission:"DELETE_USER_FEED_COMMENT",EditCommunityFeedPostPermission:"EDIT_COMMUNITY_POST",DeleteCommunityFeedPostPermission:"DELETE_COMMUNITY_POST",EditCommunityFeedCommentPermission:"EDIT_COMMUNITY_COMMENT",DeleteCommunityFeedCommentPermission:"DELETE_COMMUNITY_COMMENT",CreateCommunityCategoryPermission:"CREATE_COMMUNITY_CATEGORY",EditCommunityCategoryPermission:"EDIT_COMMUNITY_CATEGORY",DeleteCommunityCategoryPermission:"DELETE_COMMUNITY_CATEGORY",ManageStoryPermission:"MANAGE_COMMUNITY_STORY",ReviewCommunityPost:"REVIEW_COMMUNITY_POST"}),GC=30,y0=Object.freeze({Uploaded:"uploaded",Transcoding:"transcoding",Transcoded:"transcoded",TranscodeFailed:"transcodeFailed"}),ZC="video/mp4",Qr=Object.freeze({CONTAIN_BLOCKED_WORD:"Amity SDK (400308): Text contain blocked word",NOT_INCLUDE_WHITELIST_LINK:"Amity SDK (400309): Data contain link that is not in whitelist",CONTAIN_BLOCKLISTED_WORD:"Your text contains a blocklisted word."});var WC={page:{type:"newsfeed",communityId:void 0},onChangePage:e=>{},onClickCategory:e=>{},onClickCommunity:e=>{},onClickUser:e=>{},onClickStory:(e,t,o)=>{},onCommunityCreated:e=>{},onEditCommunity:e=>{},onEditUser:e=>{},onMessageUser:e=>{},setNavigationBlocker:()=>{},onBack:()=>{},goToDraftStoryPage:e=>{},onClickNoti:(e,t)=>{}};process.env.NODE_ENV!=="production"&&(WC={page:{type:"newsfeed",communityId:void 0},onChangePage:e=>console.log(`NavigationContext onChangePage(${e})`),onClickCategory:e=>console.log(`NavigationContext onClickCategory(${e})`),onClickCommunity:e=>console.log(`NavigationContext onClickCommunity(${e})`),onClickUser:e=>console.log(`NavigationContext onClickUser(${e})`),onClickStory:(e,t,o)=>console.log(`NavigationContext onClickStory(${e}, ${t}, ${o})`),onCommunityCreated:e=>console.log(`NavigationContext onCommunityCreated(${e})`),onEditCommunity:e=>console.log(`NavigationContext onEditCommunity({${e})`),onClickNoti:(e,t)=>console.log(`NavigationContext onClickNoti({${e}, ${t})`),onEditUser:e=>console.log(`NavigationContext onEditUser(${e})`),onMessageUser:e=>console.log(`NavigationContext onMessageUser(${e})`),onBack:()=>console.log("NavigationContext onBack()"),goToDraftStoryPage:(e,t,o,r)=>console.log(`NavigationContext goToDraftStoryPage(${e})`)});var Y4=createContext(WC),J=()=>useContext(Y4);function R4({askForConfirmation:e,children:t,onChangePage:o,onClickCategory:r,onClickCommunity:n,onClickUser:i,onCommunityCreated:a,onEditCommunity:s,onEditUser:l,onMessageUser:d,onBack:p}){let[u,g]=useState([{type:"explore",communityId:void 0}]),f=useMemo(()=>u[u.length-1],[u]),[y,C]=useState(),{confirm:h}=Me(),v=e!=null?e:h,b=useCallback(()=>_(this,null,function*(){return y?new Promise(H=>{v(E(c({},y),{onSuccess:()=>{C==null||C(void 0),H(!0);},onCancel:()=>H(!1)}));}):!0}),[e,y,C]),x=useCallback(H=>_(this,null,function*(){(yield b())&&g(U=>[...U,H]);}),[b]),P=()=>{g(H=>H.length>1?H.slice(0,-1):H);},I=o?H=>_(this,null,function*(){(yield b())&&o(H);}):null,w=useCallback(H=>{x({type:H});},[x]),k=useCallback(H=>{let U={type:"communityfeed",communityId:H};if(I)return I(U);if(n)return n(H);x(U);},[I,n,x]),S=useCallback(H=>{let U={type:"communityfeed",communityId:H,isNewCommunity:!0};if(I)return I(U);if(a)return a(H);x(U);},[I,a,x]),A=useCallback(H=>{let U={type:"category",categoryId:H};if(I)return I(U);if(r)return r(H);x(U);},[I,r,x]),D=useCallback((H,U)=>{let Q={};if(U==="community"?Q={type:"communityfeed",communityId:H}:Q={type:"postdetail",targetId:H,targetType:U},I)return I(Q);x(Q);},[I,x]),z=useCallback((H,U)=>{let Q={type:U!=null?U:"userfeed",userId:H};if(I)return I(Q);if(i)return i(H);x(Q);},[I,i,x]),V=useCallback(H=>{let U={type:"useredit",userId:H};if(I)return I(U);if(l)return l(H);x(U);},[I,l,x]),N=useCallback((H,U)=>{let Q={type:"communityedit",communityId:H,tab:U};if(I)return I(Q);if(s)return s(H,{tab:U});x(Q);},[I,s,x]),O=useCallback(H=>{let U={type:"conversation",userId:H};if(I)return I(U);if(d)return d(H)},[I,d]),K=useCallback(()=>{p&&p(),P();},[I,p,P]),Z=useCallback((H,U,Q)=>{let W={type:"viewstory",targetId:H,storyType:U,targetIds:Q};if(I)return I(W);x(W);},[I,x]),G=useCallback((H,U,Q,W)=>{let B={type:"draftpage",targetId:H,targetType:U,mediaType:Q,storyType:W};if(I)return I(B);x(B);},[I,x]);return re.createElement(Y4.Provider,{value:{page:f,onChangePage:w,onClickCategory:A,onClickCommunity:k,onClickUser:z,onClickStory:Z,onCommunityCreated:S,onEditCommunity:N,onEditUser:V,onMessageUser:O,onBack:K,onClickNoti:D,goToDraftStoryPage:G,setNavigationBlocker:C}},t)}var pV=()=>useContext(g0),De=pV;var qC=createContext({subscribe:({fetcher:e,params:t,callback:o,config:r})=>({unsubscribe:()=>{}})}),h0=()=>useContext(qC);function t6({children:e}){let t=useRef({}),o=useRef({}),r=useRef({}),{currentUserId:n}=De();function i(s,l){return `${n}.${s}.${JSON.stringify(l)}`}useEffect(()=>()=>{Object.values(o.current).forEach(s=>s());},[]);let a=({fetcher:s,params:l,callback:d,config:p})=>{if(n==null)return {unsubscribe(){}};let u=i(s.name,l);if(t.current[u]&&r.current[u])d==null||d(r.current[u]),t.current[u].push(d);else {t.current[u]=[d];let g=s(l,f=>{r.current[u]=f,(t.current[u]||[]).forEach(C=>C(f));},p);o.current[u]=g;}return {unsubscribe(){let g=t.current[u].find(f=>f===d);g&&(t.current[u]=t.current[u].filter(f=>f!==g));}}};return re.createElement(qC.Provider,{value:{subscribe:a}},e)}var KC=createContext({subscribe:({fetcher:e,params:t,callback:o=()=>{},options:r})=>({unsubscribe:()=>{}})}),r6=()=>useContext(KC);function n6({children:e}){let t=useRef({}),o=useRef({}),r=useRef({}),{currentUserId:n}=De();function i(s,l){return `${n}.${s}.${JSON.stringify(l)}`}useEffect(()=>()=>{Object.values(o.current).forEach(s=>s());},[]);let a=({fetcher:s,params:l,callback:d=()=>{},options:p})=>{if(n==null)return {unsubscribe(){}};let u=i(s.name,l);if(t.current[u])d(r.current[u]),t.current[u].push(d);else {t.current[u]=[d];let g=s(l,f=>{r.current[u]=f,(t.current[u]||[]).forEach(C=>C(f));},p);o.current[u]=g;}return {unsubscribe(){let g=t.current[u].find(f=>f===d);g&&(t.current[u]=t.current[u].filter(f=>f!==g));}}};return re.createElement(KC.Provider,{value:{subscribe:a}},e)}var wV=createContext({fetch:o=>_(void 0,[o],function*({fetchFn:e,params:t}){return yield Promise.resolve({})})});function i6({children:e}){let t=useRef({}),o=useRef({});function r(i,a){return `${i}.${JSON.stringify(a)}`}let n=({fetchFn:i,params:a})=>{var u;let s=r(i.name,a);if(((u=t.current[s])==null?void 0:u.length)>0){if(o.current[s]!=null)return Promise.resolve(o.current[s]);let g=()=>{},f=()=>{},y=new Promise((C,h)=>{g=C,f=h;});return t.current[s].push({resolve:g,reject:f}),y}let l=()=>{},d=()=>{},p=new Promise((g,f)=>{l=g,d=f;});return t.current[s]=[{resolve:l,reject:d}],i(...a).then(g=>{o.current[s]=g,t.current[s].forEach(({resolve:f})=>f(g));}).catch(g=>{t.current[s].forEach(({reject:f})=>f(g));}).finally(()=>{setTimeout(()=>{o.current[s]=null,t.current[s]=[];},500);}),p};return re.createElement(wV.Provider,{value:{fetch:n}},e)}var YC=createContext({subscribe:({topic:e,callback:t})=>({unsubscribe:()=>{}})}),RC=()=>useContext(YC);function a6({children:e}){let t=useRef({}),o=useRef({});useEffect(()=>()=>{Object.values(o.current).forEach(n=>n());},[]);let r=({topic:n,callback:i})=>{if(t.current[n])t.current[n].push(i);else {t.current[n]=[i];let a=subscribeTopic(n,(...s)=>{(t.current[n]||[]).forEach(d=>d(...s));});o.current[n]=a;}return {unsubscribe(){let a=t.current[n].find(s=>s===i);a&&(t.current[n]=t.current[n].filter(s=>s!==a));}}};return re.createElement(YC.Provider,{value:{subscribe:r}},e)}function s6({children:e}){return re.createElement(t6,null,re.createElement(n6,null,re.createElement(a6,null,re.createElement(i6,null,e))))}var ev=createContext({}),j=e=>useContext(ev)[e]||null;function l6({children:e,config:t}){return re.createElement(ev.Provider,{value:t},e)}var LV=e=>Nt({fetcher:PostRepository.getPost,params:e,shouldCall:!!e}),lo=LV;var ov=q`
|
|
553
|
+
`;var u0=createContext({client:null,currentUserId:void 0,userRoles:[]});var g0=createContext({client:null,currentUserId:void 0,userRoles:[]});var Z1=()=>useContext(u0),X=Z1;var FC=createContext({subscribe:({fetcher:e,params:t,callback:o,config:r,refresh:n})=>({unsubscribe:()=>{}})}),G4=()=>useContext(FC);function Z4({children:e}){let t=useRef({}),o=useRef({}),r=useRef({}),{currentUserId:n}=X();function i(s,l){return `${n}.${s}.${JSON.stringify(l)}`}useEffect(()=>()=>{Object.values(o.current).forEach(s=>s());},[]);let a=({fetcher:s,params:l,callback:d,config:p,refresh:u=!1})=>{if(n==null)return {unsubscribe(){}};let g=i(s.name,l);if(u&&(delete t.current[g],delete r.current[g]),t.current[g]&&r.current[g])d==null||d(r.current[g]),t.current[g].push(d);else {t.current[g]=[d];let f=s(l,y=>{r.current[g]=y,(t.current[g]||[]).forEach(h=>h(y));},p);o.current[g]=f;}return {unsubscribe(){let f=t.current[g].find(y=>y===d);f&&(t.current[g]=t.current[g].filter(y=>y!==f));}}};return re.createElement(FC.Provider,{value:{subscribe:a}},e)}var OC=createContext({subscribe:({fetcher:e,params:t,callback:o=()=>{},options:r})=>({unsubscribe:()=>{}})}),W4=()=>useContext(OC);function q4({children:e}){let t=useRef({}),o=useRef({}),r=useRef({}),{currentUserId:n}=X();function i(s,l){return `${n}.${s}.${JSON.stringify(l)}`}useEffect(()=>()=>{Object.values(o.current).forEach(s=>s());},[]);let a=({fetcher:s,params:l,callback:d=()=>{},options:p})=>{if(n==null)return {unsubscribe(){}};let u=i(s.name,l);if(t.current[u])d(r.current[u]),t.current[u].push(d);else {t.current[u]=[d];let g=s(l,f=>{r.current[u]=f,(t.current[u]||[]).forEach(C=>C(f));},p);o.current[u]=g;}return {unsubscribe(){let g=t.current[u].find(f=>f===d);g&&(t.current[u]=t.current[u].filter(f=>f!==g));}}};return re.createElement(OC.Provider,{value:{subscribe:a}},e)}var j$=createContext({fetch:o=>_(void 0,[o],function*({fetchFn:e,params:t}){return yield Promise.resolve({})})});function K4({children:e}){let t=useRef({}),o=useRef({});function r(i,a){return `${i}.${JSON.stringify(a)}`}let n=({fetchFn:i,params:a})=>{var u;let s=r(i.name,a);if(((u=t.current[s])==null?void 0:u.length)>0){if(o.current[s]!=null)return Promise.resolve(o.current[s]);let g=()=>{},f=()=>{},y=new Promise((C,h)=>{g=C,f=h;});return t.current[s].push({resolve:g,reject:f}),y}let l=()=>{},d=()=>{},p=new Promise((g,f)=>{l=g,d=f;});return t.current[s]=[{resolve:l,reject:d}],i(...a).then(g=>{o.current[s]=g,t.current[s].forEach(({resolve:f})=>f(g));}).catch(g=>{t.current[s].forEach(({reject:f})=>f(g));}).finally(()=>{setTimeout(()=>{o.current[s]=null,t.current[s]=[];},500);}),p};return re.createElement(j$.Provider,{value:{fetch:n}},e)}var $C=createContext({subscribe:({topic:e,callback:t})=>({unsubscribe:()=>{}})}),VC=()=>useContext($C);function J4({children:e}){let t=useRef({}),o=useRef({});useEffect(()=>()=>{Object.values(o.current).forEach(n=>n());},[]);let r=({topic:n,callback:i})=>{if(t.current[n])t.current[n].push(i);else {t.current[n]=[i];let a=subscribeTopic(n,(...s)=>{(t.current[n]||[]).forEach(d=>d(...s));});o.current[n]=a;}return {unsubscribe(){let a=t.current[n].find(s=>s===i);a&&(t.current[n]=t.current[n].filter(s=>s!==a));}}};return re.createElement($C.Provider,{value:{subscribe:r}},e)}function X4({children:e}){return re.createElement(Z4,null,re.createElement(q4,null,re.createElement(J4,null,re.createElement(K4,null,e))))}function R$({fetcher:e,params:t,callback:o=()=>{},options:r,shouldCall:n=!0,getSubscribedTopic:i}){let{subscribe:a}=W4(),[s,l]=useState(null),d=useRef(null),p=useCallback(u=>{n&&t!=null&&(u.data&&l(u.data),o(u));},[n,o]);return useEffect(()=>(i&&(d.current=subscribeTopic(i())),()=>{var u;(u=d.current)==null||u.call(d);}),[i]),useEffect(()=>{if(t==null||!n)return;let{unsubscribe:u}=a({fetcher:e,params:t,callback:p,options:r});return ()=>{u();}},[t,n]),s}var Nt=R$;function Ts({fetcher:e,params:t,callback:o=()=>{},options:r,shouldSubscribe:n=()=>!0,getSubscribedTopic:i}){let{subscribe:a}=VC(),s=useRef(null);return Nt({fetcher:e,params:t,callback:l=>{let{error:d,loading:p}=l;if(p)return;if(d)throw d;let{unsubscribe:u}=a({topic:i(l),callback:o});s.current=u;},options:r,shouldCall:n}),useEffect(()=>()=>{var l;(l=s.current)==null||l.call(s);},[s]),{unsubscribe:()=>{var l;return (l=s.current)==null?void 0:l.call(s)}}}function ks({userId:e,level:t,shouldSubscribe:o=()=>!0,callback:r}){return Ts({fetcher:UserRepository.getUser,params:e,callback:r,shouldSubscribe:()=>!!e&&o(),getSubscribedTopic:({data:n})=>getUserTopic(n,t)})}var aV=e=>(ks({userId:e,level:SubscriptionLevels.USER}),Nt({fetcher:UserRepository.getUser,params:e,shouldCall:!!e})),oe=aV;var Ma=Object.freeze({MEMBER:"member",MODERATOR:"moderator",SUPER_MODERATOR:"super-moderator",COMMUNITY_MODERATOR:"community-moderator",CHANNEL_MODERATOR:"channel-moderator"}),lr=Object.freeze({EditUserPermission:"EDIT_USER",BanUserPermission:"BAN_USER",CreateRolePermission:"CREATE_ROLE",EditRolePermission:"EDIT_ROLE",DeleteRolePermission:"DELETE_ROLE",AssignRolePermission:"ASSIGN_USER_ROLE",EditChannelPermission:"EDIT_CHANNEL",EditChannelRatelimitPermission:"EDIT_CHANNEL_RATELIMIT",MuteChannelPermission:"MUTE_CHANNEL",CloseChannelPermission:"CLOSE_CHANNEL",AddChannelUserPermission:"ADD_CHANNEL_USER",EditChannelUserPermission:"EDIT_CHANNEL_USER",RemoveChannelUserPermission:"REMOVE_CHANNEL_USER",MuteChannelUserPermission:"MUTE_CHANNEL_USER",BanChannelUserPermission:"BAN_CHANNEL_USER",EditMessagePermission:"EDIT_MESSAGE",DeleteMessagePermission:"DELETE_MESSAGE",EditCommunityPermission:"EDIT_COMMUNITY",DeleteCommunityPermission:"DELETE_COMMUNITY",AddCommunityUserPermission:"ADD_COMMUNITY_USER",EditCommunityUserPermission:"EDIT_COMMUNITY_USER",RemoveCommunityUserPermission:"REMOVE_COMMUNITY_USER",MuteCommunityUserPermission:"MUTE_COMMUNITY_USER",BanCommunityUserPermission:"BAN_COMMUNITY_USER",EditUserFeedPostPermission:"EDIT_USER_FEED_POST",DeleteUserFeedPostPermission:"DELETE_USER_FEED_POST",EditUserFeedCommentPermission:"EDIT_USER_FEED_COMMENT",DeleteUserFeedCommentPermission:"DELETE_USER_FEED_COMMENT",EditCommunityFeedPostPermission:"EDIT_COMMUNITY_POST",DeleteCommunityFeedPostPermission:"DELETE_COMMUNITY_POST",EditCommunityFeedCommentPermission:"EDIT_COMMUNITY_COMMENT",DeleteCommunityFeedCommentPermission:"DELETE_COMMUNITY_COMMENT",CreateCommunityCategoryPermission:"CREATE_COMMUNITY_CATEGORY",EditCommunityCategoryPermission:"EDIT_COMMUNITY_CATEGORY",DeleteCommunityCategoryPermission:"DELETE_COMMUNITY_CATEGORY",ManageStoryPermission:"MANAGE_COMMUNITY_STORY",ReviewCommunityPost:"REVIEW_COMMUNITY_POST"}),GC=30,y0=Object.freeze({Uploaded:"uploaded",Transcoding:"transcoding",Transcoded:"transcoded",TranscodeFailed:"transcodeFailed"}),ZC="video/mp4",Qr=Object.freeze({CONTAIN_BLOCKED_WORD:"Amity SDK (400308): Text contain blocked word",NOT_INCLUDE_WHITELIST_LINK:"Amity SDK (400309): Data contain link that is not in whitelist",CONTAIN_BLOCKLISTED_WORD:"Your text contains a blocklisted word."});var WC={page:{type:"newsfeed",communityId:void 0},onChangePage:e=>{},onClickCategory:e=>{},onClickCommunity:e=>{},onClickUser:e=>{},onClickStory:(e,t,o)=>{},onCommunityCreated:e=>{},onEditCommunity:e=>{},onEditUser:e=>{},onMessageUser:e=>{},setNavigationBlocker:()=>{},onBack:()=>{},goToDraftStoryPage:e=>{},onClickNoti:(e,t)=>{}};process.env.NODE_ENV!=="production"&&(WC={page:{type:"newsfeed",communityId:void 0},onChangePage:e=>console.log(`NavigationContext onChangePage(${e})`),onClickCategory:e=>console.log(`NavigationContext onClickCategory(${e})`),onClickCommunity:e=>console.log(`NavigationContext onClickCommunity(${e})`),onClickUser:e=>console.log(`NavigationContext onClickUser(${e})`),onClickStory:(e,t,o)=>console.log(`NavigationContext onClickStory(${e}, ${t}, ${o})`),onCommunityCreated:e=>console.log(`NavigationContext onCommunityCreated(${e})`),onEditCommunity:e=>console.log(`NavigationContext onEditCommunity({${e})`),onClickNoti:(e,t)=>console.log(`NavigationContext onClickNoti({${e}, ${t})`),onEditUser:e=>console.log(`NavigationContext onEditUser(${e})`),onMessageUser:e=>console.log(`NavigationContext onMessageUser(${e})`),onBack:()=>console.log("NavigationContext onBack()"),goToDraftStoryPage:(e,t,o,r)=>console.log(`NavigationContext goToDraftStoryPage(${e})`)});var Y4=createContext(WC),J=()=>useContext(Y4);function R4({askForConfirmation:e,children:t,onChangePage:o,onClickCategory:r,onClickCommunity:n,onClickUser:i,onCommunityCreated:a,onEditCommunity:s,onEditUser:l,onMessageUser:d,onBack:p}){let[u,g]=useState([{type:"explore",communityId:void 0}]),f=useMemo(()=>u[u.length-1],[u]),[y,C]=useState(),{confirm:h}=Me(),v=e!=null?e:h,b=useCallback(()=>_(this,null,function*(){return y?new Promise(H=>{v(E(c({},y),{onSuccess:()=>{C==null||C(void 0),H(!0);},onCancel:()=>H(!1)}));}):!0}),[e,y,C]),x=useCallback(H=>_(this,null,function*(){(yield b())&&g(U=>[...U,H]);}),[b]),P=()=>{g(H=>H.length>1?H.slice(0,-1):H);},I=o?H=>_(this,null,function*(){(yield b())&&o(H);}):null,w=useCallback(H=>{x({type:H});},[x]),k=useCallback(H=>{let U={type:"communityfeed",communityId:H};if(I)return I(U);if(n)return n(H);x(U);},[I,n,x]),S=useCallback(H=>{let U={type:"communityfeed",communityId:H,isNewCommunity:!0};if(I)return I(U);if(a)return a(H);x(U);},[I,a,x]),A=useCallback(H=>{let U={type:"category",categoryId:H};if(I)return I(U);if(r)return r(H);x(U);},[I,r,x]),D=useCallback((H,U)=>{let Q={};if(U==="community"?Q={type:"communityfeed",communityId:H}:Q={type:"postdetail",targetId:H,targetType:U},I)return I(Q);x(Q);},[I,x]),z=useCallback((H,U)=>{let Q={type:U!=null?U:"userfeed",userId:H};if(I)return I(Q);if(i)return i(H);x(Q);},[I,i,x]),V=useCallback(H=>{let U={type:"useredit",userId:H};if(I)return I(U);if(l)return l(H);x(U);},[I,l,x]),N=useCallback((H,U)=>{let Q={type:"communityedit",communityId:H,tab:U};if(I)return I(Q);if(s)return s(H,{tab:U});x(Q);},[I,s,x]),O=useCallback(H=>{let U={type:"conversation",userId:H};if(I)return I(U);if(d)return d(H)},[I,d]),K=useCallback(()=>{p&&p(),P();},[I,p,P]),Z=useCallback((H,U,Q)=>{let W={type:"viewstory",targetId:H,storyType:U,targetIds:Q};if(I)return I(W);x(W);},[I,x]),G=useCallback((H,U,Q,W)=>{let B={type:"draftpage",targetId:H,targetType:U,mediaType:Q,storyType:W};if(I)return I(B);x(B);},[I,x]);return re.createElement(Y4.Provider,{value:{page:f,onChangePage:w,onClickCategory:A,onClickCommunity:k,onClickUser:z,onClickStory:Z,onCommunityCreated:S,onEditCommunity:N,onEditUser:V,onMessageUser:O,onBack:K,onClickNoti:D,goToDraftStoryPage:G,setNavigationBlocker:C}},t)}var pV=()=>useContext(g0),De=pV;var qC=createContext({subscribe:({fetcher:e,params:t,callback:o,config:r})=>({unsubscribe:()=>{}})}),h0=()=>useContext(qC);function t6({children:e}){let t=useRef({}),o=useRef({}),r=useRef({}),{currentUserId:n}=De();function i(s,l){return `${n}.${s}.${JSON.stringify(l)}`}useEffect(()=>()=>{Object.values(o.current).forEach(s=>s());},[]);let a=({fetcher:s,params:l,callback:d,config:p})=>{if(n==null)return {unsubscribe(){}};let u=i(s.name,l);if(t.current[u]&&r.current[u])d==null||d(r.current[u]),t.current[u].push(d);else {t.current[u]=[d];let g=s(l,f=>{r.current[u]=f,(t.current[u]||[]).forEach(C=>C(f));},p);o.current[u]=g;}return {unsubscribe(){let g=t.current[u].find(f=>f===d);g&&(t.current[u]=t.current[u].filter(f=>f!==g));}}};return re.createElement(qC.Provider,{value:{subscribe:a}},e)}var KC=createContext({subscribe:({fetcher:e,params:t,callback:o=()=>{},options:r})=>({unsubscribe:()=>{}})}),r6=()=>useContext(KC);function n6({children:e}){let t=useRef({}),o=useRef({}),r=useRef({}),{currentUserId:n}=De();function i(s,l){return `${n}.${s}.${JSON.stringify(l)}`}useEffect(()=>()=>{Object.values(o.current).forEach(s=>s());},[]);let a=({fetcher:s,params:l,callback:d=()=>{},options:p})=>{if(n==null)return {unsubscribe(){}};let u=i(s.name,l);if(t.current[u])d(r.current[u]),t.current[u].push(d);else {t.current[u]=[d];let g=s(l,f=>{r.current[u]=f,(t.current[u]||[]).forEach(C=>C(f));},p);o.current[u]=g;}return {unsubscribe(){let g=t.current[u].find(f=>f===d);g&&(t.current[u]=t.current[u].filter(f=>f!==g));}}};return re.createElement(KC.Provider,{value:{subscribe:a}},e)}var wV=createContext({fetch:o=>_(void 0,[o],function*({fetchFn:e,params:t}){return yield Promise.resolve({})})});function i6({children:e}){let t=useRef({}),o=useRef({});function r(i,a){return `${i}.${JSON.stringify(a)}`}let n=({fetchFn:i,params:a})=>{var u;let s=r(i.name,a);if(((u=t.current[s])==null?void 0:u.length)>0){if(o.current[s]!=null)return Promise.resolve(o.current[s]);let g=()=>{},f=()=>{},y=new Promise((C,h)=>{g=C,f=h;});return t.current[s].push({resolve:g,reject:f}),y}let l=()=>{},d=()=>{},p=new Promise((g,f)=>{l=g,d=f;});return t.current[s]=[{resolve:l,reject:d}],i(...a).then(g=>{o.current[s]=g,t.current[s].forEach(({resolve:f})=>f(g));}).catch(g=>{t.current[s].forEach(({reject:f})=>f(g));}).finally(()=>{setTimeout(()=>{o.current[s]=null,t.current[s]=[];},500);}),p};return re.createElement(wV.Provider,{value:{fetch:n}},e)}var YC=createContext({subscribe:({topic:e,callback:t})=>({unsubscribe:()=>{}})}),RC=()=>useContext(YC);function a6({children:e}){let t=useRef({}),o=useRef({});useEffect(()=>()=>{Object.values(o.current).forEach(n=>n());},[]);let r=({topic:n,callback:i})=>{if(t.current[n])t.current[n].push(i);else {t.current[n]=[i];let a=subscribeTopic(n,(...s)=>{(t.current[n]||[]).forEach(d=>d(...s));});o.current[n]=a;}return {unsubscribe(){let a=t.current[n].find(s=>s===i);a&&(t.current[n]=t.current[n].filter(s=>s!==a));}}};return re.createElement(YC.Provider,{value:{subscribe:r}},e)}function s6({children:e}){return re.createElement(t6,null,re.createElement(n6,null,re.createElement(a6,null,re.createElement(i6,null,e))))}var ev=createContext({}),j=e=>useContext(ev)[e]||null;function l6({children:e,config:t}){return re.createElement(ev.Provider,{value:t},e)}var LV=e=>Nt({fetcher:PostRepository.getPost,params:e,shouldCall:!!e}),lo=LV;var ov=q`
|
|
554
554
|
color: #cc0058;
|
|
555
555
|
fill: #cc0058;
|
|
556
556
|
`,rv=m(Fe)`
|
|
@@ -566,7 +566,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
566
566
|
height: 20px;
|
|
567
567
|
margin-right: 4px;
|
|
568
568
|
${ov}
|
|
569
|
-
`,nv=({isLiked:e})=>e?re.createElement(DV,null):re.createElement(AV,null);var FV=({onClick:e,isActive:t,isDisabled:o})=>re.createElement(rv,{active:t,disabled:o,"data-qa-anchor":t?"post-liked-button":"post-like-button",onClick:e},re.createElement(nv,{isLiked:t})," ",re.createElement(FormattedMessage,{id:t?"post.liked":"post.like"})),iv=e=>{let t=j("PostLikeButton");return t?t(e):re.createElement(FV,c({},e))};var cr="like";var Qe=()=>{let{currentUserId:e}=
|
|
569
|
+
`,nv=({isLiked:e})=>e?re.createElement(DV,null):re.createElement(AV,null);var FV=({onClick:e,isActive:t,isDisabled:o})=>re.createElement(rv,{active:t,disabled:o,"data-qa-anchor":t?"post-liked-button":"post-like-button",onClick:e},re.createElement(nv,{isLiked:t})," ",re.createElement(FormattedMessage,{id:t?"post.liked":"post.like"})),iv=e=>{let t=j("PostLikeButton");return t?t(e):re.createElement(FV,c({},e))};var cr="like";var Qe=()=>{let{currentUserId:e}=X(),t=oe(e),[o,r]=useState(!0),[n,i]=useState(!1),[a,s]=useState(!1);return useEffect(()=>{var l;t&&(i(!!(e!=null&&e.startsWith("public"))),s(!((l=t==null?void 0:t.metadata)!=null&&l.hasNickname)&&!(e!=null&&e.startsWith("public"))),r(!1));},[t]),{isAnonymousUser:n,isNoNicknameUser:a,isLoading:o}};var av=createContext({isOpen:!1,openNicknameModal:()=>{},closeNicknameModal:()=>{}});var sv=({children:e})=>{let[t,o]=useState(!1),{isLoading:r,isNoNicknameUser:n}=Qe(),i=X(),a=()=>{o(!1);},s=()=>{window.scrollTo(0,0),window.parent.postMessage("parentNeedsScrollToTop","*"),o(!0);},l=()=>{let d=localStorage.getItem(`lastNicknameDialogShowTime#${i.currentUserId}`),p=new Date().getTime();return d?(p-parseInt(d))/(1e3*60*60)>=24:(localStorage.setItem(`lastNicknameDialogShowTime#${i.currentUserId}`,p.toString()),!0)};return useEffect(()=>{if(!r&&n&&l()){s();let d=new Date().getTime();localStorage.setItem(`lastNicknameDialogShowTime#${i.currentUserId}`,d.toString());}},[r,n]),re.createElement(av.Provider,{value:{isOpen:t,openNicknameModal:s,closeNicknameModal:a}},e)},_o=()=>useContext(av);var lv=createContext({triggerAnonymousNeedsLogin:()=>{}});var mv=({children:e})=>{let{isAnonymousUser:t}=Qe(),o=()=>{let n=localStorage.getItem("lastLoginEventTime"),i=new Date().getTime();return n?(i-parseInt(n))/(1e3*60*60)>=24:(localStorage.setItem("lastLoginEventTime",i.toString()),!0)},r=()=>{window.parent.postMessage("anonymousNeedsLogin","*");};return useEffect(()=>{if(t&&o()){r();let n=new Date().getTime();localStorage.setItem("lastLoginEventTime",n.toString());}},[t]),re.createElement(lv.Provider,{value:{triggerAnonymousNeedsLogin:r}},e)},dr=()=>useContext(lv);function dv(e){var t,o;return e==null||((t=e.myReactions)==null?void 0:t.length)===0?!1:(o=e==null?void 0:e.myReactions)==null?void 0:o.includes(cr)}var XV=({postId:e,isNoNicknameUser:t=!1,isAnonymousUser:o=!1,onLikeSuccess:r,onUnlikeSuccess:n})=>{let i=lo(e),{openNicknameModal:a}=_o(),{triggerAnonymousNeedsLogin:s}=dr(),[l,d]=useState(dv(i));useEffect(()=>{d(dv(i));},[i==null?void 0:i.myReactions]);let p=()=>_(void 0,null,function*(){i!=null&&(t?a():o?s():l?(yield ReactionRepository.removeReaction("post",i.postId,cr),n==null||n(i),d(!l)):(yield ReactionRepository.addReaction("post",i.postId,cr),r==null||r(i),d(!l)));});return re.createElement(iv,{isActive:l,isDisabled:i==null,onClick:p})},pv=XV;var RV=e=>Nt({fetcher:CommunityRepository.getCommunity,params:e,shouldCall:!!e}),wt=RV;var ij=({targetId:e,targetType:t,remoteText:o,remoteMarkup:r})=>{let n=t==="community",i=wt(e),[a,s]=useState(o!=null?o:""),[l,d]=useState(r!=null?r:o),[p,u]=useState([]);useEffect(()=>{s(o||""),d(r!=null?r:"");},[o,r]);let g=({text:b,plainText:x,mentions:P})=>{s(x),d(b),u(P);},f=()=>{s(""),d(""),u([]);},y=()=>{s(o||""),d(r),u([]);},C=useCallback(b=>_(void 0,null,function*(){let x,P=b||"",I;return (P.match(/^@$/)||P==="")&&(P=void 0),n&&!(i!=null&&i.isPublic)&&e!=null?x=yield new Promise(w=>{I==null||I(),I=CommunityRepository.Membership.getMembers({communityId:e,search:P,limit:20},k=>{k.loading||w(k.data.map(({user:S})=>S).filter(Re));});}):x=yield new Promise(w=>{I==null||I(),I=UserRepository.getUsers({displayName:P,limit:20,sortBy:"displayName"},k=>{k.loading||w(k.data);});}),SC(x)}),[n,i==null?void 0:i.isPublic,e]),{mentionees:h,metadata:v}=useMemo(()=>{let{mentionees:b,metadata:x}=d0(p);return {mentionees:b,metadata:x}},[p]);return {text:a,markup:l,mentions:p,mentionees:h,metadata:v,onChange:g,clearAll:f,resetState:y,queryMentionees:C}},Wr=ij;var Ns={BIG:"big",REGULAR:"regular",SMALL:"small",TINY:"tiny"},sj=Ns.REGULAR,Q1={[Ns.BIG]:64,[Ns.REGULAR]:40,[Ns.SMALL]:32,[Ns.TINY]:28},lj=e=>useMemo(()=>e&&Q1[e]?e:sj,[e]),uv=lj;var dj=s=>{var l=s,{circle:e,borderRadius:t=12,primaryColor:o="#EBECEF",secondaryColor:r="#f3f3f3",duration:n=2,style:i}=l,a=M(l,["circle","borderRadius","primaryColor","secondaryColor","duration","style"]);return re.createElement(cj,E(c({},a),{duration:n,circle:e,style:E(c({},i),{backgroundColor:o,backgroundImage:`linear-gradient(90deg, ${o}, ${r}, ${o})`,borderRadius:e?void 0:t})}))},Ie=dj;var pj=i=>{var a=i,{loading:e,size:t,backgroundImage:o,children:r}=a,n=M(a,["loading","size","backgroundImage","children"]);return re.createElement("div",c({},n),e?re.createElement(Ie,{circle:!0,width:"100%",height:"100%",style:{display:"block"}}):r)},fv=m(pj)`
|
|
570
570
|
position: relative;
|
|
571
571
|
flex-shrink: 0;
|
|
572
572
|
overflow: hidden;
|
|
@@ -717,7 +717,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
717
717
|
margin-left: 8px;
|
|
718
718
|
background: ${({theme:e})=>e.palette.primary.main};
|
|
719
719
|
border-radius: 100px;
|
|
720
|
-
`;var Rj=30,eG=5e4,tG=({className:e,userToReply:t,onSubmit:o,postId:r})=>{let n=lo(r),{currentUserId:i}=
|
|
720
|
+
`;var Rj=30,eG=5e4,tG=({className:e,userToReply:t,onSubmit:o,postId:r})=>{let n=lo(r),{currentUserId:i}=X(),{info:a}=Me(),s=oe(i),l=se({fileId:s==null?void 0:s.avatarFileId,imageSize:"small"}),{text:d,markup:p,mentions:u,mentionees:g,metadata:f,onChange:y,queryMentionees:C}=Wr({targetId:n==null?void 0:n.targetId,targetType:n==null?void 0:n.targetType}),{formatMessage:h}=useIntl(),v=useRef(null);useEffect(()=>{var w;(w=v.current)==null||w.focus();},[]);let b=()=>{if(d!==""){if(u&&(u==null?void 0:u.length)>Rj)return a({title:re.createElement(FormattedMessage,{id:"CommentComposeBar.unableToMention"}),content:re.createElement(FormattedMessage,{id:"CommentComposeBar.overMentionees"}),okText:re.createElement(FormattedMessage,{id:"CommentComposeBar.okText"})});if((d==null?void 0:d.length)>eG)return a({title:re.createElement(FormattedMessage,{id:"CommentComposeBar.unableToPost"}),content:re.createElement(FormattedMessage,{id:"CommentComposeBar.overCharacter"}),okText:re.createElement(FormattedMessage,{id:"CommentComposeBar.done"})});o==null||o(d,g,f);}},x=d==="",P=t?h({id:"CommentComposeBar.replayTo"})+t:h({id:"CommentComposeBar.saySomething"}),I=h(t?{id:"reply"}:{id:"CommentComposeBar.addComment"});return re.createElement(Mv,{className:e},re.createElement(wv,{avatar:l,backgroundImage:Ee}),re.createElement(_v,null,re.createElement(Pv,{ref:v,"data-qa-anchor":"comment-compose-bar-textarea",placeholder:P,value:p,multiline:!0,mentionAllowed:!0,queryMentionees:C,onChange:w=>y==null?void 0:y(w)})),re.createElement(Sv,{"data-qa-anchor":t?"comment-compose-bar-reply-button":"comment-compose-bar-add-comment-button",disabled:x,onClick:b},I))},Pa=e=>{let t=j("CommentComposerBar");return t?t(e):re.createElement(tG,c({},e))};var Tv=m.div`
|
|
721
721
|
color: ${({theme:e})=>e.palette.neutral.shade1};
|
|
722
722
|
${({theme:e})=>e.typography.body}
|
|
723
723
|
`,kv=m.div`
|
|
@@ -801,7 +801,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
801
801
|
@media (max-width: 768px) {
|
|
802
802
|
${({fullSized:e})=>e?"width: 100%;":"min-width: 105px;"}
|
|
803
803
|
}
|
|
804
|
-
`;var Gv=200,_0=({parentContainer:e,dropdownRef:t,align:o=C2,scrollableHeight:r=Gv,position:n=Cn,buttonContainerHeight:i})=>{let[a,s]=useState(n),l=f2(t.current,{root:e,rootMargin:e?`0px 0px -${Math.ceil(r*100/(e.getBoundingClientRect().height-i))}% 0px`:void 0});return useEffect(()=>{var d;(l==null?void 0:l.isIntersecting)===!1?((d=l.boundingClientRect)==null?void 0:d.top)<0?s(Cn):s(w0):s(n);},[l,n]),{align:o,currentPosition:a,scrollableHeight:r}},NG=e=>re.createElement(
|
|
804
|
+
`;var Gv=200,_0=({parentContainer:e,dropdownRef:t,align:o=C2,scrollableHeight:r=Gv,position:n=Cn,buttonContainerHeight:i})=>{let[a,s]=useState(n),l=f2(t.current,{root:e,rootMargin:e?`0px 0px -${Math.ceil(r*100/(e.getBoundingClientRect().height-i))}% 0px`:void 0});return useEffect(()=>{var d;(l==null?void 0:l.isIntersecting)===!1?((d=l.boundingClientRect)==null?void 0:d.top)<0?s(Cn):s(w0):s(n);},[l,n]),{align:o,currentPosition:a,scrollableHeight:r}},NG=e=>re.createElement(Y,c({},e),re.createElement(hn,{height:14,width:14})),EG=({"data-qa-anchor":e="",isOpen:t,renderTrigger:o=NG,children:r,position:n=Cn,align:i=C2,handleClose:a,fullSized:s=!1,scrollable:l=!1,scrollableHeight:d=Gv,parentContainer:p=null,disabled:u=!1,className:g=""})=>{let[f,y]=useState(t),[C,h]=useState(n),[v,b]=v2(t),[x,P]=J1(),I=useCallback(()=>{a?t&&a():y(!1);},[a,t]),w=f2(v.current,{root:p,rootMargin:p?`0px 0px -${Math.ceil(d*100/(p.getBoundingClientRect().height-P))}% 0px`:void 0}),k={onClick:()=>y(!f),disabled:u};return useEffect(()=>{b||I();},[I,b]),useEffect(()=>{y(t);},[t]),useEffect(()=>{var S;(w==null?void 0:w.isIntersecting)===!1?((S=w.boundingClientRect)==null?void 0:S.top)<0?h(Cn):h(w0):h(n);},[w,n]),re.createElement(jv,{ref:v,className:g},re.createElement(Vv,{ref:x},o(E(c({},k),{"data-qa-anchor":e}))),(t||f)&&re.createElement(X1,null,re.createElement(Y1,{position:C,align:i,fullSized:s,scrollable:l,scrollableHeight:d},r)))},S0=EG;var el=m(Ca).attrs({width:16,height:16})`
|
|
805
805
|
cursor: pointer;
|
|
806
806
|
margin-left: auto;
|
|
807
807
|
`,tl=m(Fe)`
|
|
@@ -990,7 +990,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
990
990
|
width: 100%;
|
|
991
991
|
display: flex;
|
|
992
992
|
align-items: center;
|
|
993
|
-
`;var ZG=8,QG=({text:e,className:t,mentionees:o,maxLines:r=ZG})=>{let n=useRef(null),[i,a]=useState(!1),[s,l]=useState(!1),d=useMemo(()=>I0(e||"",c0(o)),[o,e]),p=()=>a(!0);return useEffect(()=>{if(n.current){let{scrollHeight:u,clientHeight:g}=n.current;l(u>g);}},[e,r]),e?re.createElement(tx,{"data-qa-anchor":"comment-content",className:t},re.createElement(ex,{isExpanded:i,maxLines:r,ref:n},re.createElement(NI.Atom,null,d.map(u=>{let g=`${e}-${u.start}-${u.end}`,f=e.substring(u.start,u.end);if(u.highlight){let y=o==null?void 0:o.find(C=>C.index===u.start);return y?re.createElement(b0,{key:g,mentionee:y},f):re.createElement("span",{key:g},f)}return re.createElement(q1,{key:g},f)}))),!i&&s&&re.createElement(ix,{onClick:p},"..."," ",re.createElement(ox,null,re.createElement(FormattedMessage,{id:"comment.readmore"})))):null},w6=QG;var JG=e=>{let[t,o]=useState(!1),{data:r,isLoading:n,refetch:i}=useQuery({queryKey:["asc-uikit","CommentRepository","isCommentFlaggedByMe",e],queryFn:()=>CommentRepository.isCommentFlaggedByMe(e),enabled:e!=null});useEffect(()=>{r!=null&&o(r);},[r]);let a=()=>_(void 0,null,function*(){if(e!=null)try{o(!0),yield CommentRepository.flagComment(e);}catch(d){o(!1);}finally{i();}}),s=()=>_(void 0,null,function*(){if(e!=null)try{o(!1),yield CommentRepository.unflagComment(e);}catch(d){o(!0);}finally{i();}});return {isLoading:n,isFlaggedByMe:t,flagComment:a,unflagComment:s,toggleFlagComment:()=>_(void 0,null,function*(){e!=null&&(t?s():a());})}},yx=JG;var P6=()=>/Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);var tZ=m(
|
|
993
|
+
`;var ZG=8,QG=({text:e,className:t,mentionees:o,maxLines:r=ZG})=>{let n=useRef(null),[i,a]=useState(!1),[s,l]=useState(!1),d=useMemo(()=>I0(e||"",c0(o)),[o,e]),p=()=>a(!0);return useEffect(()=>{if(n.current){let{scrollHeight:u,clientHeight:g}=n.current;l(u>g);}},[e,r]),e?re.createElement(tx,{"data-qa-anchor":"comment-content",className:t},re.createElement(ex,{isExpanded:i,maxLines:r,ref:n},re.createElement(NI.Atom,null,d.map(u=>{let g=`${e}-${u.start}-${u.end}`,f=e.substring(u.start,u.end);if(u.highlight){let y=o==null?void 0:o.find(C=>C.index===u.start);return y?re.createElement(b0,{key:g,mentionee:y},f):re.createElement("span",{key:g},f)}return re.createElement(q1,{key:g},f)}))),!i&&s&&re.createElement(ix,{onClick:p},"..."," ",re.createElement(ox,null,re.createElement(FormattedMessage,{id:"comment.readmore"})))):null},w6=QG;var JG=e=>{let[t,o]=useState(!1),{data:r,isLoading:n,refetch:i}=useQuery({queryKey:["asc-uikit","CommentRepository","isCommentFlaggedByMe",e],queryFn:()=>CommentRepository.isCommentFlaggedByMe(e),enabled:e!=null});useEffect(()=>{r!=null&&o(r);},[r]);let a=()=>_(void 0,null,function*(){if(e!=null)try{o(!0),yield CommentRepository.flagComment(e);}catch(d){o(!1);}finally{i();}}),s=()=>_(void 0,null,function*(){if(e!=null)try{o(!1),yield CommentRepository.unflagComment(e);}catch(d){o(!0);}finally{i();}});return {isLoading:n,isFlaggedByMe:t,flagComment:a,unflagComment:s,toggleFlagComment:()=>_(void 0,null,function*(){e!=null&&(t?s():a());})}},yx=JG;var P6=()=>/Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);var tZ=m(Y)`
|
|
994
994
|
border-radius: 100px;
|
|
995
995
|
border: 1px solid #000;
|
|
996
996
|
padding: 12px 24px;
|
|
@@ -1018,12 +1018,12 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
1018
1018
|
opacity: 0.75;
|
|
1019
1019
|
}
|
|
1020
1020
|
}
|
|
1021
|
-
`;var aZ="global-admin",{COMMUNITY_MODERATOR:sZ,CHANNEL_MODERATOR:lZ,MODERATOR:mZ,SUPER_MODERATOR:cZ}=Ma,Bs=e=>{if(!(e!=null&&e.length))return !1;let t=[sZ,lZ,mZ,cZ];return e.some(o=>t.includes(o))},vx=e=>e!=null&&e.length?e.includes(aZ):!1;var dZ=(e,t=!1,o=[])=>{let{currentUserId:r}=
|
|
1021
|
+
`;var aZ="global-admin",{COMMUNITY_MODERATOR:sZ,CHANNEL_MODERATOR:lZ,MODERATOR:mZ,SUPER_MODERATOR:cZ}=Ma,Bs=e=>{if(!(e!=null&&e.length))return !1;let t=[sZ,lZ,mZ,cZ];return e.some(o=>t.includes(o))},vx=e=>e!=null&&e.length?e.includes(aZ):!1;var dZ=(e,t=!1,o=[])=>{let{currentUserId:r}=X(),n=(e==null?void 0:e.userId)===r,i=!!(e!=null&&e.parentId);return {canDelete:!t&&n||Bs(o),canEdit:!t&&n,canLike:!t,canReply:!t&&!i,canReport:!t&&!n}},N0=dZ;var gZ=5,fZ=()=>re.createElement(sx,{"data-qa-anchor":"comment-deleted-comment"},re.createElement(x6,null,re.createElement(v6,null)),re.createElement(b6,null,re.createElement(I6,{"data-qa-anchor":"comment-deleted-comment-text"},re.createElement(FormattedMessage,{id:"comment.deleted"})))),yZ=()=>re.createElement("div",null,re.createElement(lx,{"data-qa-anchor":"reply-deleted-reply"},re.createElement(x6,{className:"reply"},re.createElement(v6,{style:{fill:"#6E6E6E"}})),re.createElement(b6,null,re.createElement(I6,{"data-qa-anchor":"reply-deleted-reply-text",style:{color:"#6E6E6E",borderRadius:"4px"}},re.createElement(FormattedMessage,{id:"reply.deleted"})))));function xx(e){var t;return e==null?"":typeof e.data=="string"?e.data:((t=e==null?void 0:e.data)==null?void 0:t.text)||""}var hZ=({commentId:e,readonly:t,onInteract:o})=>{let{onClickUser:r}=J(),n=x0(e),i=lo(n==null?void 0:n.referenceId),{confirm:a}=Me(),s=be(),l=oe(n==null?void 0:n.userId),d=Et(l==null?void 0:l.avatarFileId),{userRoles:p}=X(),[u,g]=useState(!1),[f,y]=useState(!1),{formatMessage:C}=useIntl(),[h,v]=useState(!1),{text:b,markup:x,mentions:P,onChange:I,queryMentionees:w,resetState:k,clearAll:S}=Wr({targetId:i==null?void 0:i.targetId,targetType:i==null?void 0:i.targetType,remoteText:xx(n),remoteMarkup:p0(xx(n),(n==null?void 0:n.metadata)||{})}),{canDelete:A,canEdit:D,canLike:z,canReply:V,canReport:N}=N0(n,t,p);if(i==null&&n==null)return re.createElement(k0,null);let O=(ne,te,ue)=>_(void 0,null,function*(){if(!(!(n!=null&&n.referenceType)||!(n!=null&&n.referenceId)))try{let{referenceType:ce,referenceId:Ze}=n;yield CommentRepository.createComment({referenceType:ce,referenceId:Ze,data:{text:ne},parentId:e,metadata:ue,mentionees:te}),g(!1),v(!0);}catch(ce){ce instanceof Error&&(ce.message===Qr.CONTAIN_BLOCKED_WORD?s.error({content:re.createElement(FormattedMessage,{id:"notification.error.blockedWord"})}):ce.message===Qr.NOT_INCLUDE_WHITELIST_LINK&&s.error({content:re.createElement(FormattedMessage,{id:"notification.error.whitelistLink"})}));}}),K=(ne,te,ue)=>_(void 0,null,function*(){return e&&CommentRepository.updateComment(e,{data:{text:ne},metadata:ue,mentionees:te})}),Z=()=>_(void 0,null,function*(){return e&&CommentRepository.deleteComment(e)}),G=()=>{g(ne=>!ne);},H=()=>{y(!0);},U=()=>{y(!1),k();},Q=()=>{let{metadata:ne,mentionees:te}=d0(P);o==null||o(e),K(b,te,ne),S(),y(!1);},W=!!(n!=null&&n.parentId),B=()=>{o==null||o(e),a({"data-qa-anchor":"delete-comment",title:re.createElement(FormattedMessage,{id:W?"reply.delete":"comment.delete"}),content:re.createElement(FormattedMessage,{id:W?"reply.deleteBody":"comment.deleteBody"}),cancelText:C({id:"comment.deleteConfirmCancelText"}),okText:C({id:"comment.deleteConfirmOkText"}),onOk:Z});};if(n==null)return null;if(n!=null&&n.isDeleted)return W?re.createElement(yZ,null):re.createElement(y6,null,re.createElement(fZ,null));let $=()=>{var ne;return re.createElement(Cx,{commentId:n==null?void 0:n.commentId,authorName:(l==null?void 0:l.displayName)||(l==null?void 0:l.userId)||C({id:"anonymous"}),authorAvatar:d==null?void 0:d.fileUrl,canDelete:A,canEdit:D,canLike:z,canReply:V,canReport:N,isBanned:l==null?void 0:l.isGlobalBanned,createdAt:n!=null&&n.createdAt?new Date(n.createdAt):void 0,editedAt:n!=null&&n.editedAt?new Date(n==null?void 0:n.editedAt):void 0,mentionees:(ne=n==null?void 0:n.metadata)==null?void 0:ne.mentioned,metadata:n==null?void 0:n.metadata,text:b,markup:x,startEditing:H,cancelEditing:U,handleEdit:Q,handleDelete:B,isEditing:f,queryMentionees:w,isReplyComment:W,onClickReply:G,onChange:I,onClickUser:()=>r(n.userId)})};return W?re.createElement(Xv,{"data-qa-anchor":"reply"},$()):re.createElement(y6,null,re.createElement(Jv,{"data-qa-anchor":"comment"},$()),n.children.length>0&&re.createElement(I2,{parentId:n.commentId,referenceType:n.referenceType,referenceId:n.referenceId,readonly:t,isExpanded:h,limit:gZ}),u&&re.createElement(Pa,{postId:i==null?void 0:i.postId,userToReply:l==null?void 0:l.displayName,onSubmit:(ne,te,ue)=>{o==null||o(e),O(ne,te,ue);}}))},bx=memo(e=>{let t=j("Comment");return t?t(e):re.createElement(hZ,c({},e))});var T6=m(Yu).attrs({height:"16px",width:"16px"})``,k6=m.div`
|
|
1022
1022
|
display: flex;
|
|
1023
1023
|
margin-right: 4px;
|
|
1024
1024
|
`,Ix=m.div`
|
|
1025
1025
|
border-top: 1px solid #e3e4e8;
|
|
1026
|
-
`;var E0=m(
|
|
1026
|
+
`;var E0=m(Y)`
|
|
1027
1027
|
width: 100%;
|
|
1028
1028
|
&.text-center {
|
|
1029
1029
|
justify-content: center;
|
|
@@ -1346,14 +1346,14 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
1346
1346
|
display: flex;
|
|
1347
1347
|
align-items: center;
|
|
1348
1348
|
justify-content: center;
|
|
1349
|
-
`,z0=()=>re.createElement(SizeMe,{monitorHeight:!0},({size:e})=>{let t=Math.min((e==null?void 0:e.width)||0,(e==null?void 0:e.height)||0);return re.createElement(oQ,null,re.createElement(Ie,{borderRadius:0,height:t,width:t,style:{display:"block"}}))}),rQ=m(Ut).attrs({width:24,height:24})``,Vx=m(
|
|
1349
|
+
`,z0=()=>re.createElement(SizeMe,{monitorHeight:!0},({size:e})=>{let t=Math.min((e==null?void 0:e.width)||0,(e==null?void 0:e.height)||0);return re.createElement(oQ,null,re.createElement(Ie,{borderRadius:0,height:t,width:t,style:{display:"block"}}))}),rQ=m(Ut).attrs({width:24,height:24})``,Vx=m(Y).attrs({variant:"secondary",children:re.createElement(rQ,null)})`
|
|
1350
1350
|
position: absolute;
|
|
1351
1351
|
top: 0.5em;
|
|
1352
1352
|
right: 0.5em;
|
|
1353
1353
|
`,nQ=m($t).attrs({width:24,height:24})`
|
|
1354
1354
|
z-index: 2;
|
|
1355
1355
|
opacity: 0.7;
|
|
1356
|
-
`,jx=m(
|
|
1356
|
+
`,jx=m(Y).attrs({variant:"secondary",children:re.createElement(nQ,null)})`
|
|
1357
1357
|
position: absolute;
|
|
1358
1358
|
top: 50%;
|
|
1359
1359
|
left: 50%;
|
|
@@ -1400,14 +1400,14 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
1400
1400
|
display: flex;
|
|
1401
1401
|
align-items: center;
|
|
1402
1402
|
justify-content: center;
|
|
1403
|
-
`,Yx=()=>re.createElement(SizeMe,{monitorHeight:!0},({size:e})=>{let t=Math.min(e.width||0,e.height||0);return re.createElement(gQ,null,re.createElement(Ie,{height:t,width:t,style:{display:"block"}}))}),fQ=m(Ut).attrs({width:24,height:24})``,Rx=m(
|
|
1403
|
+
`,Yx=()=>re.createElement(SizeMe,{monitorHeight:!0},({size:e})=>{let t=Math.min(e.width||0,e.height||0);return re.createElement(gQ,null,re.createElement(Ie,{height:t,width:t,style:{display:"block"}}))}),fQ=m(Ut).attrs({width:24,height:24})``,Rx=m(Y).attrs({variant:"secondary",children:re.createElement(fQ,null)})`
|
|
1404
1404
|
position: absolute;
|
|
1405
1405
|
top: 0.5em;
|
|
1406
1406
|
right: 0.5em;
|
|
1407
1407
|
`,yQ=m($t).attrs({width:24,height:24})`
|
|
1408
1408
|
z-index: 2;
|
|
1409
1409
|
opacity: 0.7;
|
|
1410
|
-
`,eb=m(
|
|
1410
|
+
`,eb=m(Y).attrs({variant:"secondary",icon:yQ})`
|
|
1411
1411
|
position: absolute;
|
|
1412
1412
|
top: 50%;
|
|
1413
1413
|
left: 50%;
|
|
@@ -1425,7 +1425,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
1425
1425
|
position: absolute;
|
|
1426
1426
|
top: 1rem;
|
|
1427
1427
|
left: 1rem;
|
|
1428
|
-
`;var vQ=({url:e,progress:t=-1,mediaFit:o,noBorder:r,onRemove:n,isRejected:i,onRetry:a,mimeType:s,autoPlay:l,isLive:d})=>{let p=useCallback(y=>{y.preventDefault(),y.stopPropagation(),n&&n();},[n]),u=useCallback(y=>{y.preventDefault(),y.stopPropagation(),a&&a();},[a]),[g,f]=useState(null);return useEffect(()=>{if(!(!g||!e||!e.includes("m3u8"))&&!(g!=null&&g.canPlayType("application/vnd.apple.mpegurl"))&&S2.isSupported()){let y=new S2;return y.loadSource(e),y.attachMedia(g),y.on(S2.Events.ERROR,(C,h)=>{if(h.fatal)switch(h.type){case S2.ErrorTypes.NETWORK_ERROR:y.startLoad();break;case S2.ErrorTypes.MEDIA_ERROR:y.recoverMediaError();break;}}),()=>y.destroy()}},[g,d,e]),re.createElement(ki,{border:!r},re.createElement(Kx,null,e?re.createElement(Xx,{key:e,ref:y=>f(y),className:i?"darken":void 0,mediaFit:o,mimeType:s,src:e,autoPlay:l}):re.createElement(Yx,null),re.createElement(tb,null,d&&re.createElement(ob,null),!!i&&re.createElement(eb,{onClick:u}),!!n&&re.createElement(Rx,{onClick:p}))),!Number.isNaN(t)&&re.createElement(il,{progress:(t||0)*100}))},al=vQ;var bQ=o=>{var r=o,{file:e}=r,t=M(r,["file"]);if(e==null)return null;let n=URL.createObjectURL(e);return re.createElement(al,c({url:n},t))},nb=bQ;var wQ=o=>{var r=o,{fileId:e}=r,t=M(r,["fileId"]);let n=Et(e);if(n==null)return null;let i=(()=>{if(n.status===y0.Transcoded){let{videoUrl:a}=n;return (a==null?void 0:a["1080p"])||(a==null?void 0:a["720p"])||(a==null?void 0:a["480p"])||(a==null?void 0:a["360p"])||(a==null?void 0:a.original)||n.fileUrl}return n.fileUrl})();return re.createElement(al,c({url:i,mimeType:ZC},t))},ib=wQ;function Ei(e){return "fileId"in e?re.createElement(ib,c({},e)):"file"in e?re.createElement(nb,c({},e)):null}var mb=m(
|
|
1428
|
+
`;var vQ=({url:e,progress:t=-1,mediaFit:o,noBorder:r,onRemove:n,isRejected:i,onRetry:a,mimeType:s,autoPlay:l,isLive:d})=>{let p=useCallback(y=>{y.preventDefault(),y.stopPropagation(),n&&n();},[n]),u=useCallback(y=>{y.preventDefault(),y.stopPropagation(),a&&a();},[a]),[g,f]=useState(null);return useEffect(()=>{if(!(!g||!e||!e.includes("m3u8"))&&!(g!=null&&g.canPlayType("application/vnd.apple.mpegurl"))&&S2.isSupported()){let y=new S2;return y.loadSource(e),y.attachMedia(g),y.on(S2.Events.ERROR,(C,h)=>{if(h.fatal)switch(h.type){case S2.ErrorTypes.NETWORK_ERROR:y.startLoad();break;case S2.ErrorTypes.MEDIA_ERROR:y.recoverMediaError();break;}}),()=>y.destroy()}},[g,d,e]),re.createElement(ki,{border:!r},re.createElement(Kx,null,e?re.createElement(Xx,{key:e,ref:y=>f(y),className:i?"darken":void 0,mediaFit:o,mimeType:s,src:e,autoPlay:l}):re.createElement(Yx,null),re.createElement(tb,null,d&&re.createElement(ob,null),!!i&&re.createElement(eb,{onClick:u}),!!n&&re.createElement(Rx,{onClick:p}))),!Number.isNaN(t)&&re.createElement(il,{progress:(t||0)*100}))},al=vQ;var bQ=o=>{var r=o,{file:e}=r,t=M(r,["file"]);if(e==null)return null;let n=URL.createObjectURL(e);return re.createElement(al,c({url:n},t))},nb=bQ;var wQ=o=>{var r=o,{fileId:e}=r,t=M(r,["fileId"]);let n=Et(e);if(n==null)return null;let i=(()=>{if(n.status===y0.Transcoded){let{videoUrl:a}=n;return (a==null?void 0:a["1080p"])||(a==null?void 0:a["720p"])||(a==null?void 0:a["480p"])||(a==null?void 0:a["360p"])||(a==null?void 0:a.original)||n.fileUrl}return n.fileUrl})();return re.createElement(al,c({url:i,mimeType:ZC},t))},ib=wQ;function Ei(e){return "fileId"in e?re.createElement(ib,c({},e)):"file"in e?re.createElement(nb,c({},e)):null}var mb=m(Y).attrs({variant:"secondary",children:re.createElement(Ut,null)})`
|
|
1429
1429
|
position: absolute;
|
|
1430
1430
|
top: 0.5em;
|
|
1431
1431
|
right: 0.5em;
|
|
@@ -1554,7 +1554,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
1554
1554
|
`,WQ=m($t).attrs({width:14,height:14})`
|
|
1555
1555
|
fill: ${({theme:e})=>e.palette.alert.main};
|
|
1556
1556
|
z-index: 2;
|
|
1557
|
-
`,Ab=e=>re.createElement(
|
|
1557
|
+
`,Ab=e=>re.createElement(Y,E(c({},e),{variant:"secondary"}),re.createElement(re.Fragment,null,re.createElement(WQ,null)," ",re.createElement(FormattedMessage,{id:"file.reUpload"}))),Db=m.div`
|
|
1558
1558
|
grid-area: name;
|
|
1559
1559
|
padding: 0 0.5em;
|
|
1560
1560
|
overflow: hidden;
|
|
@@ -1568,9 +1568,9 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
1568
1568
|
`,qQ=m(Ut)`
|
|
1569
1569
|
grid-area: remove;
|
|
1570
1570
|
z-index: 2;
|
|
1571
|
-
`,Fb=e=>re.createElement(
|
|
1571
|
+
`,Fb=e=>re.createElement(Y,E(c({},e),{variant:"secondary"}),re.createElement(qQ,{width:14,height:14})),Ob=m.div`
|
|
1572
1572
|
display: flex;
|
|
1573
|
-
`;var XQ=({"data-qa-anchor":e="",name:t,url:o,type:r,size:n,progress:i=-1,onRemove:a,isRejected:s,onRetry:l})=>{useIntl();let p=useCallback(y=>{y.preventDefault(),y.stopPropagation(),a&&a();},[a]),u=useCallback(y=>{y.preventDefault(),y.stopPropagation(),l&&l();},[l]),g=r==null?void 0:r.includes("image"),f=i<100;return re.createElement(Nb,{href:o,download:!0,"data-qa-anchor":e},re.createElement(Eb,null,g&&o?re.createElement(Bb,{src:o}):re.createElement(Lb,{file:{name:t,type:r},width:null,height:"100%"}),re.createElement(Db,null,t)," ",re.createElement(Hb,null,KQ(n||0,{base:2})),re.createElement(Ob,null,!!s&&re.createElement(Ab,{onClick:u}),!!a&&re.createElement(Fb,{"data-qa-anchor":"uploaders-file-remove-button",onClick:p,disabled:i!==-1&&f}))),!Number.isNaN(i)&&re.createElement(il,{progress:(i||0)*100}))},G0=XQ;var RQ=({"data-qa-anchor":e="",file:t,progress:o=-1,onRemove:r,isRejected:n,retry:i=()=>{}})=>{if(t==null)return null;let a=t.type.includes("image")?URL.createObjectURL(t):void 0;return re.createElement(G0,{"data-qa-anchor":e,name:t.name,size:t.size,type:t.type,url:a,progress:o,isRejected:n,onRemove:r,onRetry:()=>i()})},Ub=RQ;var oW=({"data-qa-anchor":e="",fileId:t,onRemove:o})=>{let r=Et(t);if(!r)return null;let n=FileRepository.fileUrlWithSize(r==null?void 0:r.fileUrl,"small");return re.createElement(G0,{"data-qa-anchor":e,name:r.attributes.name,size:isNaN(Number(r.attributes.size))?0:Number(r.attributes.size),type:r.attributes.mimeType,url:n,onRemove:o})},$b=oW;function Kr(e){return "fileId"in e?re.createElement($b,c({},e)):"file"in e?re.createElement(Ub,c({},e)):null}var iW=5,aW=e=>re.createElement(
|
|
1573
|
+
`;var XQ=({"data-qa-anchor":e="",name:t,url:o,type:r,size:n,progress:i=-1,onRemove:a,isRejected:s,onRetry:l})=>{useIntl();let p=useCallback(y=>{y.preventDefault(),y.stopPropagation(),a&&a();},[a]),u=useCallback(y=>{y.preventDefault(),y.stopPropagation(),l&&l();},[l]),g=r==null?void 0:r.includes("image"),f=i<100;return re.createElement(Nb,{href:o,download:!0,"data-qa-anchor":e},re.createElement(Eb,null,g&&o?re.createElement(Bb,{src:o}):re.createElement(Lb,{file:{name:t,type:r},width:null,height:"100%"}),re.createElement(Db,null,t)," ",re.createElement(Hb,null,KQ(n||0,{base:2})),re.createElement(Ob,null,!!s&&re.createElement(Ab,{onClick:u}),!!a&&re.createElement(Fb,{"data-qa-anchor":"uploaders-file-remove-button",onClick:p,disabled:i!==-1&&f}))),!Number.isNaN(i)&&re.createElement(il,{progress:(i||0)*100}))},G0=XQ;var RQ=({"data-qa-anchor":e="",file:t,progress:o=-1,onRemove:r,isRejected:n,retry:i=()=>{}})=>{if(t==null)return null;let a=t.type.includes("image")?URL.createObjectURL(t):void 0;return re.createElement(G0,{"data-qa-anchor":e,name:t.name,size:t.size,type:t.type,url:a,progress:o,isRejected:n,onRemove:r,onRetry:()=>i()})},Ub=RQ;var oW=({"data-qa-anchor":e="",fileId:t,onRemove:o})=>{let r=Et(t);if(!r)return null;let n=FileRepository.fileUrlWithSize(r==null?void 0:r.fileUrl,"small");return re.createElement(G0,{"data-qa-anchor":e,name:r.attributes.name,size:isNaN(Number(r.attributes.size))?0:Number(r.attributes.size),type:r.attributes.mimeType,url:n,onRemove:o})},$b=oW;function Kr(e){return "fileId"in e?re.createElement($b,c({},e)):"file"in e?re.createElement(Ub,c({},e)):null}var iW=5,aW=e=>re.createElement(Y,{onClick:e},re.createElement(FormattedMessage,{id:"collapsible.viewAll"})),sW=({items:e=[],onExpand:t=()=>{},visibleAmount:o=iW,renderTrigger:r=aW,renderItem:n})=>{let i=o<e.length?e.slice(0,o):e,[a,s]=useState(o>=e.length),l=()=>{s(!0),t();};return a?re.createElement(re.Fragment,null,e.map(d=>n(d))):re.createElement(re.Fragment,null,i.map(d=>n(d)),r(l))},jb=sW;var mW=m.div`
|
|
1574
1574
|
display: grid;
|
|
1575
1575
|
grid-template-columns: 100%;
|
|
1576
1576
|
grid-gap: 0.5rem;
|
|
@@ -1813,12 +1813,12 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
1813
1813
|
> :not(:first-child) {
|
|
1814
1814
|
margin-left: 0.25rem;
|
|
1815
1815
|
}
|
|
1816
|
-
`;var KW=({avatarFileUrl:e,postAuthorName:t,postTargetName:o,timeAgo:r,isModerator:n,isEdited:i,onClickCommunity:a,onClickUser:s,hidePostTarget:l,loading:d,isBanned:p})=>{let u=j("UIPostHeader");if(u)return u({avatarFileUrl:e,postAuthorName:t,postTargetName:o,timeAgo:r,isModerator:n,isEdited:i,onClickCommunity:a,onClickUser:s,hidePostTarget:l,loading:d,isBanned:p});let g=()=>re.createElement(SI,{"data-qa-anchor":"post-header-post-names"},re.createElement(NI,{lines:1},re.createElement(W6,{"data-qa-anchor":"post-header-post-name",className:yi({clickable:!!s}),onClick:s},t)),p&&re.createElement(Vn,null),o&&!l&&re.createElement(re.Fragment,null,re.createElement(wI,null),re.createElement(NI,{lines:1},re.createElement(II,{"data-qa-anchor":"post-header-post-target-name",className:yi({clickable:!!a}),onClick:a||void 0},o)))),f=()=>re.createElement(_I,{"data-qa-anchor":"post-header-additional-info",showTime:!!r},n&&re.createElement(q6,{"data-qa-anchor":"post-header-additional-info-moderator-badge"},re.createElement(MI,null)," ",re.createElement(FormattedMessage,{id:"moderator"})),r&&re.createElement(T0,{"data-qa-anchor":"post-header-additional-info-time-ago",date:r.getTime()}),i&&re.createElement(PI,{"data-qa-anchor":"post-header-additional-info-edited-label"},re.createElement(FormattedMessage,{id:"post.edited"})));return re.createElement(xI,{"data-qa-anchor":"post-header"},re.createElement(ge,{"data-qa-anchor":"post-header-avatar",avatar:e,backgroundImage:Ee,loading:d,onClick:s}),re.createElement(bI,{"data-qa-anchor":"post-header-post-info"},d?re.createElement(re.Fragment,null,re.createElement("div",null,re.createElement(Ie,{width:96,style:{fontSize:8}})),re.createElement(Ie,{width:189,style:{fontSize:8}})):re.createElement(re.Fragment,null,g(),f())))},EI=KW;var{COMMUNITY_MODERATOR:XW}=Ma;function Li(e){let r=ze({fetcher:CommunityRepository.Membership.getMembers,params:{communityId:e,roles:[XW]},shouldCall:!!e}),{items:t}=r,o=M(r,["items"]);return c({moderators:t},o)}var RW=({post:e,childrenPosts:t=[],community:o})=>{var g,f,y,C;let{currentUserId:r,client:n}=
|
|
1816
|
+
`;var KW=({avatarFileUrl:e,postAuthorName:t,postTargetName:o,timeAgo:r,isModerator:n,isEdited:i,onClickCommunity:a,onClickUser:s,hidePostTarget:l,loading:d,isBanned:p})=>{let u=j("UIPostHeader");if(u)return u({avatarFileUrl:e,postAuthorName:t,postTargetName:o,timeAgo:r,isModerator:n,isEdited:i,onClickCommunity:a,onClickUser:s,hidePostTarget:l,loading:d,isBanned:p});let g=()=>re.createElement(SI,{"data-qa-anchor":"post-header-post-names"},re.createElement(NI,{lines:1},re.createElement(W6,{"data-qa-anchor":"post-header-post-name",className:yi({clickable:!!s}),onClick:s},t)),p&&re.createElement(Vn,null),o&&!l&&re.createElement(re.Fragment,null,re.createElement(wI,null),re.createElement(NI,{lines:1},re.createElement(II,{"data-qa-anchor":"post-header-post-target-name",className:yi({clickable:!!a}),onClick:a||void 0},o)))),f=()=>re.createElement(_I,{"data-qa-anchor":"post-header-additional-info",showTime:!!r},n&&re.createElement(q6,{"data-qa-anchor":"post-header-additional-info-moderator-badge"},re.createElement(MI,null)," ",re.createElement(FormattedMessage,{id:"moderator"})),r&&re.createElement(T0,{"data-qa-anchor":"post-header-additional-info-time-ago",date:r.getTime()}),i&&re.createElement(PI,{"data-qa-anchor":"post-header-additional-info-edited-label"},re.createElement(FormattedMessage,{id:"post.edited"})));return re.createElement(xI,{"data-qa-anchor":"post-header"},re.createElement(ge,{"data-qa-anchor":"post-header-avatar",avatar:e,backgroundImage:Ee,loading:d,onClick:s}),re.createElement(bI,{"data-qa-anchor":"post-header-post-info"},d?re.createElement(re.Fragment,null,re.createElement("div",null,re.createElement(Ie,{width:96,style:{fontSize:8}})),re.createElement(Ie,{width:189,style:{fontSize:8}})):re.createElement(re.Fragment,null,g(),f())))},EI=KW;var{COMMUNITY_MODERATOR:XW}=Ma;function Li(e){let r=ze({fetcher:CommunityRepository.Membership.getMembers,params:{communityId:e,roles:[XW]},shouldCall:!!e}),{items:t}=r,o=M(r,["items"]);return c({moderators:t},o)}var RW=({post:e,childrenPosts:t=[],community:o})=>{var g,f,y,C;let{currentUserId:r,client:n}=X(),{moderators:i}=Li(o==null?void 0:o.communityId),a=useMemo(()=>!t.find(h=>h.dataType==="liveStream"||h.dataType==="poll"),[t]),s=i.find(h=>h.userId===(e==null?void 0:e.postedUserId)),l=(e==null?void 0:e.postedUserId)===r,d=useMemo(()=>(o==null?void 0:o.postSetting)!=CommunityPostSettings.ANYONE_CAN_POST?(e==null?void 0:e.feedType)==="reviewing":!1,[o,e]),p=s!=null,u={canEdit:!1,canReport:!1,canDelete:!1,canReview:!1};if(l)!d&&a&&(u.canEdit=!0),u.canDelete=!0;else {if(o!=null){let h=(g=n==null?void 0:n.hasPermission(lr.EditCommunityFeedPostPermission).community(o.communityId))!=null?g:!1;u.canEdit=h&&a;let v=(f=n==null?void 0:n.hasPermission(lr.DeleteCommunityFeedPostPermission).community(o.communityId))!=null?f:!1;u.canDelete=v;let b=(y=n==null?void 0:n.hasPermission(lr.ReviewCommunityPost).community(o.communityId))!=null?y:!1;u.canReview=b;}else {let h=(C=n==null?void 0:n.hasPermission(lr.EditUserFeedPostPermission).currentUser())!=null?C:!1;u.canDelete=h;}d||(u.canReport=!0);}return c({isPostUnderReview:d,isModerator:p},u)},Os=RW;var LI=({post:e,avatarFileUrl:t,loading:o,hidePostTarget:r})=>{let{onClickCommunity:n,onClickUser:i}=J(),{formatMessage:a}=useIntl(),s=oe(e==null?void 0:e.postedUserId),{userRoles:l}=X(),d=wt(e==null?void 0:e.targetId),{isModerator:p}=Os({community:d,post:e}),u=l.find(h=>h==="global-admin")!=null,g=(e==null?void 0:e.targetType)==="community",f=g?d==null?void 0:d.displayName:null,y=g?()=>e&&n(e==null?void 0:e.targetId):null,C=()=>e&&i(e.postedUserId);return {avatarFileUrl:t,postAuthorName:(s==null?void 0:s.displayName)||a({id:"anonymous"}),postTargetName:f,timeAgo:e!=null&&e.createdAt?new Date(e==null?void 0:e.createdAt):null,isModerator:e!=null&&e.targetId?p:u,isEdited:new Date(e==null?void 0:e.createdAt).getTime()<new Date(e==null?void 0:e.editedAt).getTime(),isBanned:s==null?void 0:s.isGlobalBanned,hidePostTarget:r,loading:o,onClickCommunity:y,onClickUser:C}};var rq=({postId:e,hidePostTarget:t,loading:o})=>{let r=lo(e),n=oe(r==null?void 0:r.postedUserId),i=se({fileId:n==null?void 0:n.avatarFileId,imageSize:"small"}),a=LI({post:r,avatarFileUrl:i,user:n,loading:o,hidePostTarget:t});return re.createElement(EI,c({},a))};var AI=memo(rq);m.div`
|
|
1817
1817
|
overflow-wrap: break-word;
|
|
1818
1818
|
color: ${({theme:e})=>e.palette.neutral.main};
|
|
1819
1819
|
white-space: pre-wrap;
|
|
1820
1820
|
${({theme:e})=>e.typography.body}
|
|
1821
|
-
`;m(
|
|
1821
|
+
`;m(Y).attrs({variant:"secondary"})`
|
|
1822
1822
|
color: ${({theme:e})=>e.palette.primary.main};
|
|
1823
1823
|
padding: 4px;
|
|
1824
1824
|
display: inline-block;
|
|
@@ -1837,7 +1837,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
1837
1837
|
&::after {
|
|
1838
1838
|
content: '';
|
|
1839
1839
|
}
|
|
1840
|
-
`,mq=m(
|
|
1840
|
+
`,mq=m(Y).attrs({variant:"secondary"})`
|
|
1841
1841
|
color: ${({theme:e})=>e.palette.primary.main};
|
|
1842
1842
|
padding: 4px;
|
|
1843
1843
|
display: inline-block;
|
|
@@ -1881,11 +1881,11 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
1881
1881
|
margin-left: 12px;
|
|
1882
1882
|
}
|
|
1883
1883
|
}
|
|
1884
|
-
`,QI=()=>re.createElement(re.Fragment,null,re.createElement("div",null,re.createElement(Ie,{style:{fontSize:8,maxWidth:374}})),re.createElement("div",null,re.createElement(Ie,{style:{fontSize:8,maxWidth:448}})),re.createElement("div",{style:{paddingBottom:50}},re.createElement(Ie,{style:{fontSize:8,maxWidth:279}})));var _q=e=>{let[t,o]=useState(!1),{currentUserId:r}=
|
|
1884
|
+
`,QI=()=>re.createElement(re.Fragment,null,re.createElement("div",null,re.createElement(Ie,{style:{fontSize:8,maxWidth:374}})),re.createElement("div",null,re.createElement(Ie,{style:{fontSize:8,maxWidth:448}})),re.createElement("div",{style:{paddingBottom:50}},re.createElement(Ie,{style:{fontSize:8,maxWidth:279}})));var _q=e=>{let[t,o]=useState(!1),{currentUserId:r}=X(),n=(e==null?void 0:e.postId)||void 0,i=useMemo(()=>(e==null?void 0:e.creatorId)===r,[e,r]),{data:a,isLoading:s,refetch:l}=useQuery({queryKey:["asc-uikit","PostRepository","isPostFlaggedByMe",n],queryFn:()=>PostRepository.isPostFlaggedByMe(n),enabled:e!=null});useEffect(()=>{a!=null&&o(a);},[a]);let d=()=>_(void 0,null,function*(){if(!(n==null||i))try{yield PostRepository.flagPost(n);}catch(g){o(!1);}finally{l();}}),p=()=>_(void 0,null,function*(){if(!(n==null||i))try{yield PostRepository.unflagPost(n);}catch(g){o(!0);}finally{l();}});return {isLoading:s,isFlaggedByMe:t,isUnableToFlag:i,flagPost:d,unflagPost:p,toggleFlagPost:()=>_(void 0,null,function*(){n==null||i||(t?p():d());})}},WI=_q;var kq=8,Nq=3,Eq="Post has been reviewed",Bq=({childrenPosts:e=[],handleDeletePost:t,handleReportPost:o,handleUnreportPost:r,handleClosePoll:n,isPollClosed:i,post:a,onEditPostClick:s,onClose:l,buttonContainerHeight:d})=>{let{formatMessage:p}=useIntl(),{info:u,confirm:g}=Me(),f=be(),{isFlaggedByMe:y,toggleFlagPost:C}=WI(a),h=a==null?void 0:a.targetId,v=wt(h),b=useRef(null),{currentPosition:x,align:P,scrollableHeight:I}=_0({dropdownRef:b,buttonContainerHeight:d,position:Cn,align:K1}),{canEdit:w,canReview:k,canDelete:S,canReport:A,isPostUnderReview:D}=Os({community:v,post:a,childrenPosts:e}),z=e.find(Z=>Z.dataType==="poll"),V=()=>_(void 0,null,function*(){C(),yield o==null?void 0:o(),f.success({content:re.createElement(FormattedMessage,{id:"report.reportSent"})});}),N=()=>_(void 0,null,function*(){C(),yield r==null?void 0:r(),f.success({content:re.createElement(FormattedMessage,{id:"report.unreportSent"})});}),O=()=>{g({title:p({id:"post.deletePost"}),content:p({id:D?"post.confirmPendingDelete":"post.confirmDelete"}),okText:p({id:"delete"}),onOk:()=>t==null?void 0:t(a==null?void 0:a.postId)});},K=[w?{name:p({id:"post.editPost"}),action:()=>s()}:null,S?{name:p({id:"post.deletePost"}),action:O}:null,A?{name:p(y?{id:"report.undoReport"}:{id:"report.doReport"}),action:y?N:V}:null,z&&!i?{name:p({id:"poll.close"}),action:n}:null].filter(Re);return re.createElement(jI,{ref:b},re.createElement(X1,null,re.createElement(Y1,{position:x,align:P,scrollableHeight:I},K.map(({name:Z,action:G})=>re.createElement(ol,{key:Z,"data-qa-anchor":`post-options-button-${Z}`,onClick:()=>{G==null||G(),l();}},Z)))))},Lq=m.div`
|
|
1885
1885
|
padding-bottom: 8px;
|
|
1886
1886
|
`,Aq=m.div`
|
|
1887
1887
|
padding-top: 8px;
|
|
1888
|
-
`,Dq=e=>{var Ze,dt,Ot,zt;let{childrenPosts:t=[],className:o,handleApprovePost:r,handleDeclinePost:n,hidePostTarget:i,readonly:a,post:s,loading:l}=e,{formatMessage:d}=useIntl(),[p,u]=useState(!1),g=()=>u(!0),f=()=>u(!1),{info:y,confirm:C}=Me(),h=be(),[v,b]=useState(!1),[x,P]=J1(),[I,w]=useState(!1),[k,S]=useState(!1),[A,D]=useState(!1),z=()=>b(ke=>!ke);useEffect(()=>(v?document.addEventListener("click",z):document.removeEventListener("click",z),()=>{document.removeEventListener("click",z);}),[v]);function V(ke){if(ke instanceof Error)if(ke.message.includes(Eq))y({title:re.createElement(FormattedMessage,{id:"post.error.cannotReview.title"}),content:re.createElement(FormattedMessage,{id:"post.error.cannotReview.description"})});else throw ke}let N=s==null?void 0:s.targetId,O=wt(N),{isAnonymousUser:K,isNoNicknameUser:Z}=Qe(),{openNicknameModal:G}=_o(),{triggerAnonymousNeedsLogin:H}=dr(),{canReview:U,isPostUnderReview:Q}=Os({community:O,post:s,childrenPosts:t}),W=()=>_(void 0,null,function*(){try{w(!0),yield r==null?void 0:r(),h.success({content:re.createElement(FormattedMessage,{id:"post.success.approved"})});}catch(ke){V(ke);}finally{w(!1);}}),B=()=>_(void 0,null,function*(){try{S(!0),yield n==null?void 0:n(),h.success({content:re.createElement(FormattedMessage,{id:"post.success.declined"})});}catch(ke){V(ke);}finally{S(!1);}}),$=t.length>0,ne=$?Nq:kq,te=t.find(ke=>ke.dataType==="liveStream"),ue=()=>{A?C({title:re.createElement(FormattedMessage,{id:"post.discard.title"}),content:re.createElement(FormattedMessage,{id:"post.discard.content"}),okText:re.createElement(FormattedMessage,{id:"general.action.discard"}),cancelText:"Cancel",onOk:()=>{u(!1);}}):u(!1);},ce=()=>D(!0);return re.createElement("div",{style:{marginTop:8}},re.createElement(H2,{"data-qa-anchor":"post",className:o},re.createElement(GI,null,re.createElement(AI,{postId:s==null?void 0:s.postId,hidePostTarget:i,loading:l}),!l&&re.createElement(VI,null,re.createElement("div",{ref:x},re.createElement(tl,{onClick:ke=>{ke.stopPropagation(),Z?G():K?H():z();},className:o},re.createElement(el,null))),v&&re.createElement(Bq,E(c({},e),{onApprove:W,onDecline:B,onClose:z,onEditPostClick:()=>g(),buttonContainerHeight:P})))),l?re.createElement(QI,null):re.createElement(re.Fragment,null,(Ze=s==null?void 0:s.data)!=null&&Ze.text?re.createElement(Lq,null,re.createElement($I,{data:(dt=te==null?void 0:te.data)!=null?dt:s==null?void 0:s.data,dataType:(Ot=te==null?void 0:te.dataType)!=null?Ot:s==null?void 0:s.dataType,postMaxLines:ne,mentionees:(zt=s==null?void 0:s.metadata)==null?void 0:zt.mentioned})):null,$&&re.createElement(Aq,null,re.createElement(iI,{contents:t})),!Q&&re.createElement(B6,{readonly:a,postId:s==null?void 0:s.postId}),Q&&U&&re.createElement(ZI,{"data-qa-anchor":"post-review"},re.createElement(ye,{"data-qa-anchor":"post-review-accept-button",disabled:I||k,onClick:W},re.createElement(FormattedMessage,{id:"general.action.accept"})),re.createElement(
|
|
1888
|
+
`,Dq=e=>{var Ze,dt,Ot,zt;let{childrenPosts:t=[],className:o,handleApprovePost:r,handleDeclinePost:n,hidePostTarget:i,readonly:a,post:s,loading:l}=e,{formatMessage:d}=useIntl(),[p,u]=useState(!1),g=()=>u(!0),f=()=>u(!1),{info:y,confirm:C}=Me(),h=be(),[v,b]=useState(!1),[x,P]=J1(),[I,w]=useState(!1),[k,S]=useState(!1),[A,D]=useState(!1),z=()=>b(ke=>!ke);useEffect(()=>(v?document.addEventListener("click",z):document.removeEventListener("click",z),()=>{document.removeEventListener("click",z);}),[v]);function V(ke){if(ke instanceof Error)if(ke.message.includes(Eq))y({title:re.createElement(FormattedMessage,{id:"post.error.cannotReview.title"}),content:re.createElement(FormattedMessage,{id:"post.error.cannotReview.description"})});else throw ke}let N=s==null?void 0:s.targetId,O=wt(N),{isAnonymousUser:K,isNoNicknameUser:Z}=Qe(),{openNicknameModal:G}=_o(),{triggerAnonymousNeedsLogin:H}=dr(),{canReview:U,isPostUnderReview:Q}=Os({community:O,post:s,childrenPosts:t}),W=()=>_(void 0,null,function*(){try{w(!0),yield r==null?void 0:r(),h.success({content:re.createElement(FormattedMessage,{id:"post.success.approved"})});}catch(ke){V(ke);}finally{w(!1);}}),B=()=>_(void 0,null,function*(){try{S(!0),yield n==null?void 0:n(),h.success({content:re.createElement(FormattedMessage,{id:"post.success.declined"})});}catch(ke){V(ke);}finally{S(!1);}}),$=t.length>0,ne=$?Nq:kq,te=t.find(ke=>ke.dataType==="liveStream"),ue=()=>{A?C({title:re.createElement(FormattedMessage,{id:"post.discard.title"}),content:re.createElement(FormattedMessage,{id:"post.discard.content"}),okText:re.createElement(FormattedMessage,{id:"general.action.discard"}),cancelText:"Cancel",onOk:()=>{u(!1);}}):u(!1);},ce=()=>D(!0);return re.createElement("div",{style:{marginTop:8}},re.createElement(H2,{"data-qa-anchor":"post",className:o},re.createElement(GI,null,re.createElement(AI,{postId:s==null?void 0:s.postId,hidePostTarget:i,loading:l}),!l&&re.createElement(VI,null,re.createElement("div",{ref:x},re.createElement(tl,{onClick:ke=>{ke.stopPropagation(),Z?G():K?H():z();},className:o},re.createElement(el,null))),v&&re.createElement(Bq,E(c({},e),{onApprove:W,onDecline:B,onClose:z,onEditPostClick:()=>g(),buttonContainerHeight:P})))),l?re.createElement(QI,null):re.createElement(re.Fragment,null,(Ze=s==null?void 0:s.data)!=null&&Ze.text?re.createElement(Lq,null,re.createElement($I,{data:(dt=te==null?void 0:te.data)!=null?dt:s==null?void 0:s.data,dataType:(Ot=te==null?void 0:te.dataType)!=null?Ot:s==null?void 0:s.dataType,postMaxLines:ne,mentionees:(zt=s==null?void 0:s.metadata)==null?void 0:zt.mentioned})):null,$&&re.createElement(Aq,null,re.createElement(iI,{contents:t})),!Q&&re.createElement(B6,{readonly:a,postId:s==null?void 0:s.postId}),Q&&U&&re.createElement(ZI,{"data-qa-anchor":"post-review"},re.createElement(ye,{"data-qa-anchor":"post-review-accept-button",disabled:I||k,onClick:W},re.createElement(FormattedMessage,{id:"general.action.accept"})),re.createElement(Y,{"data-qa-anchor":"post-review-decline-button",disabled:I||k,onClick:B},re.createElement(FormattedMessage,{id:"general.action.decline"}))),p&&re.createElement(Yt,{"data-qa-anchor":"post-editor-modal",title:d({id:"post.editPost"}),onCancel:()=>ue()},re.createElement(vI,{postId:s==null?void 0:s.postId,onSave:f,onChangeText:ce})))))},gr=re.memo(Dq);var KI=m.div`
|
|
1889
1889
|
color: ${({theme:e})=>e.palette.base.shade3};
|
|
1890
1890
|
display: flex;
|
|
1891
1891
|
align-items: center;
|
|
@@ -2137,7 +2137,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
2137
2137
|
min-width: 100px;
|
|
2138
2138
|
margin-left: 0;
|
|
2139
2139
|
`};
|
|
2140
|
-
`,ww=m(
|
|
2140
|
+
`,ww=m(Y)`
|
|
2141
2141
|
padding: 10px 16px;
|
|
2142
2142
|
margin-left: 12px;
|
|
2143
2143
|
border-radius: 100px;
|
|
@@ -2310,7 +2310,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
2310
2310
|
margin: 0 0.5rem;
|
|
2311
2311
|
`,Nw=m(Ut).attrs({width:18,height:18})`
|
|
2312
2312
|
fill: #000;
|
|
2313
|
-
`,Ew=m(
|
|
2313
|
+
`,Ew=m(Y)`
|
|
2314
2314
|
border: none;
|
|
2315
2315
|
padding: 0;
|
|
2316
2316
|
`;var MK=({categoryId:e,name:t,fileUrl:o,onClick:r,onRemove:n})=>{let i=useCallback(s=>{s.stopPropagation(),e&&(r==null||r(e));},[r,e]),a=useCallback(s=>{s.stopPropagation(),e&&(n==null||n(e));},[n,e]);return re.createElement(Tw,{onClick:i},re.createElement(ge,{size:"tiny",avatar:o,backgroundImage:$d}),re.createElement(kw,null,t),!!n&&re.createElement(Ew,{onClick:a},re.createElement(Nw,null)))},Lw=MK;var _K=({categoryId:e,onClick:t,onRemove:o})=>{let r=yl(e),n=se({fileId:r==null?void 0:r.avatarFileId,imageSize:"small"});return r==null?null:re.createElement(Lw,{categoryId:r.categoryId,name:r.name,fileUrl:n,onClick:i=>t==null?void 0:t(i),onRemove:o})},Aw=_K;function t7(e){let r=ze({fetcher:CategoryRepository.getCategories,params:e}),{items:t}=r,o=M(r,["items"]);return c({categories:t},o)}var NK=({"data-qa-anchor":e="",value:t,onChange:o,parentContainer:r=null})=>{let n=t!=null?t:[],[i,a]=useState(!1),[s,l]=useState(""),d=()=>a(!i);useIntl();let u=useRef(null),g=v=>{var b;l(v),a(!!v),v&&((b=u.current)==null||b.focus());},f=()=>{l(""),a(!1);},{categories:y}=t7({includeDeleted:!1,limit:100}),C=y.filter(v=>s?v.name.includes(s):!0).map(v=>({name:v.name,value:v.categoryId})),h=n.map(v=>{var b;return {name:((b=y.find(x=>x.categoryId===v))==null?void 0:b.name)||"",value:v}});return re.createElement(Kn,{"data-qa-anchor":`${e}-category`,value:h,options:C,renderTrigger:P=>{var I=P,{selected:v,remove:b}=I,x=M(I,["selected","remove"]);return re.createElement(Iw,E(c({},x),{onClick:d,"data-qa-anchor":`${e}-category-selector`}),v.map(w=>re.createElement(Aw,{key:w.value,categoryId:w.value,onRemove:()=>b(w,o)})),re.createElement(Pw,{ref:u,"data-qa-anchor":"category-selector-input",type:"text",value:s,onChange:w=>g(w.target.value)}),re.createElement(Mw,null))},renderItem:({value:v})=>re.createElement(bw,{categoryId:v}),parentContainer:r,isOpen:i,handleClose:f,multiple:!0,onSelect:({value:v})=>{var b;l(""),(b=u.current)==null||b.focus(),o==null||o([...new Set([...n,v])]);}})},cp=e=>{let t=j("CategorySelector");return t?t(e):re.createElement(NK,c({},e))};var Ow=In.object({displayName:In.string().max(30),description:In.string().max(180),categoryIds:In.string().array().min(1),avatarFileId:In.string().nullable().optional(),tags:In.string().array().optional(),isPublic:In.boolean()}),EK=Ow.extend({userIds:In.string().array().optional()}).refine(e=>{var t;return !(!e.isPublic&&((t=e.userIds)==null?void 0:t.length)===0)}),BK=Ow.partial(),zw=()=>useForm({defaultValues:{avatarFileId:void 0,description:"",displayName:"",isPublic:!0,tags:[],userIds:[],categoryIds:[]},resolver:zodResolver(EK)}),Uw=e=>useForm({defaultValues:{avatarFileId:e.avatarFileId,description:e.description,displayName:e.displayName,isPublic:e.isPublic,tags:e.tags,categoryIds:e.categoryIds},resolver:zodResolver(BK)});var $w=m.div`
|
|
@@ -2373,7 +2373,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
2373
2373
|
border-radius: var(--border-radius-rounded, 100px);
|
|
2374
2374
|
border: 1px solid var(--Component-Category-Tokens-button-primary-primary-border, #000);
|
|
2375
2375
|
background: var(--Component-Category-Tokens-button-primary-primary-bg, #000);
|
|
2376
|
-
`,Qw=m(
|
|
2376
|
+
`,Qw=m(Y)`
|
|
2377
2377
|
border-radius: 100px;
|
|
2378
2378
|
border: 1px solid #000;
|
|
2379
2379
|
padding: 12px 24px;
|
|
@@ -2422,7 +2422,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
2422
2422
|
margin: 0 0.5rem;
|
|
2423
2423
|
`,sM=m(Ut).attrs({width:12,height:12})`
|
|
2424
2424
|
fill: ${({theme:e})=>e.palette.base.shade1};
|
|
2425
|
-
`,lM=m(
|
|
2425
|
+
`,lM=m(Y)`
|
|
2426
2426
|
padding: 0.4rem 0.55rem;
|
|
2427
2427
|
border-radius: 10rem;
|
|
2428
2428
|
`;var WK=({userId:e,displayName:t="Anonymous",fileUrl:o,onClick:r,onRemove:n})=>{let i=useCallback(s=>{s.stopPropagation(),e&&(r==null||r(e));},[r,e]),a=useCallback(s=>{s.stopPropagation(),e&&(n==null||n(e));},[n,e]);return re.createElement(iM,{onClick:i},re.createElement(ge,{size:"tiny",avatar:o,backgroundImage:Ee}),re.createElement(aM,null,t),!!n&&re.createElement(lM,{onClick:a},re.createElement(sM,null)))},cM=e=>{let t=j("UserChip");return t?t(e):re.createElement(WK,c({},e))};var KK=({userId:e,onClick:t,onRemove:o})=>{let r=oe(e),n=se({fileId:r==null?void 0:r.avatarFileId,imageSize:"small"});return r==null?null:re.createElement(cM,{userId:r.userId,displayName:r.displayName,fileUrl:n,onClick:i=>t==null?void 0:t(i),onRemove:o})},dM=KK;var pM=m.div`
|
|
@@ -2443,7 +2443,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
2443
2443
|
outline: none;
|
|
2444
2444
|
border: none;
|
|
2445
2445
|
width: 100%;
|
|
2446
|
-
`;var RK=({value:e,onChange:t,parentContainer:o=null})=>{let r=e!=null?e:[],{currentUserId:n}=
|
|
2446
|
+
`;var RK=({value:e,onChange:t,parentContainer:o=null})=>{let r=e!=null?e:[],{currentUserId:n}=X(),[i,a]=useState(!1),[s,l]=useState(""),{users:d=[]}=pp(s),{formatMessage:p}=useIntl(),u=d.filter(({displayName:h,userId:v})=>(h==null?void 0:h.toLowerCase().includes(s.toLowerCase()))&&v!==n).map(({displayName:h,userId:v})=>({name:h,value:v})),g=r.map(h=>{var v;return {name:((v=d.find(b=>b.userId===h))==null?void 0:v.displayName)||"",value:h}}),f=()=>{a(!1),l("");},y=useRef(null),C=h=>{var v;l(h),a(!!h),h&&((v=y.current)==null||v.focus());};return re.createElement(Kn,{"data-qa-anchor":"user",value:g,options:s?u:[],renderTrigger:x=>{var P=x,{selected:h,remove:v}=P,b=M(P,["selected","remove"]);return re.createElement(pM,c({},b),h.map(I=>re.createElement(dM,{key:I.value,userId:I.value,onRemove:()=>v(I,t)})),re.createElement(uM,{ref:y,"data-qa-anchor":"user-selector-input",type:"text",value:s,placeholder:p({id:"UserSelector.placeholder"}),onChange:I=>C(I.target.value)}))},renderItem:({value:h})=>re.createElement(Xn,{userId:h}),parentContainer:o,isOpen:i,handleClose:f,multiple:!0,onSelect:({value:h})=>{var v;t==null||t([...new Set([...r,h])]),(v=y.current)==null||v.focus(),l("");}})},Aa=memo(e=>{let t=j("UserSelector");return t?t(e):re.createElement(RK,c({},e))});var r7=({title:e,children:t})=>re.createElement(vl,null,re.createElement(xl,null,t)),fM=({type:e,description:t,icon:o})=>re.createElement(np,null,re.createElement(op,null,o),re.createElement("div",null,e,re.createElement(ip,null,t))),rJ=({"data-qa-anchor":e="",className:t,onSubmit:o,onCancel:r})=>{let[n,i]=useState(!1),{register:a,handleSubmit:s,setError:l,watch:d,control:p,formState:u,setValue:g,getValues:f}=zw(),{errors:y}=u,C=d("displayName"),h=d("description"),v=d("isPublic"),b=useRef(null),x=w=>_(void 0,null,function*(){var k;try{if(i(!0),!w.isPublic&&((k=w.userIds)==null?void 0:k.length)===0){l("userIds",{message:"Please select at least one member"});return}yield o==null?void 0:o(E(c({},w),{displayName:w.displayName||"",avatarFileId:w.avatarFileId||void 0}));}finally{i(!1);}}),P=!u.isValid||n,I=b.current&&b.current.scrollHeight-b.current.clientHeight-b.current.scrollTop;return re.useLayoutEffect(()=>{I!=null&&b.current&&I<10&&b.current.scrollHeight-b.current.clientHeight-b.current.scrollTop>10&&b.current.scrollTo({top:b.current.scrollHeight});},[b.current,I,u]),re.createElement(La,{className:t,onSubmit:s(x)},re.createElement(Jn,{ref:b},re.createElement(r7,{title:"General"},re.createElement(yr,null,re.createElement(Controller,{name:"avatarFileId",control:p,render:S=>{var {field:A}=S,D=A,k=M(D,["ref"]);return re.createElement(mp,null,re.createElement(Ba,E(c({mimeType:"image/png, image/jpeg"},k),{"data-qa-anchor":e,isShowUploadImagePlaceholder:!0})))}})),re.createElement(yr,{error:y.displayName},re.createElement(Fi,null,re.createElement(Xr,{htmlFor:"displayName",className:"required"},re.createElement(FormattedMessage,{id:"community.name"})),re.createElement(Hi,null,C.length,"/30")),re.createElement($s,E(c({},a("displayName")),{"data-qa-anchor":`${e}-community-name-input`,placeholder:"Enter community name"})),re.createElement(fr,{errors:y,name:"displayName"})),re.createElement(yr,{error:y.description},re.createElement(Fi,null,re.createElement(Xr,{htmlFor:"description"},re.createElement(FormattedMessage,{id:"community.about"})),re.createElement(Hi,null,(h==null?void 0:h.length)||0,"/180")),re.createElement(Us,E(c({},a("description",{maxLength:{value:180,message:"Description text is too long"}})),{"data-qa-anchor":`${e}-community-description-textarea`,placeholder:"Enter description"})),re.createElement(fr,{errors:y,name:"description"})),re.createElement(yr,{error:y.categoryIds},re.createElement(Xr,{htmlFor:"categoryIds",className:"required"},re.createElement(FormattedMessage,{id:"community.category"})),re.createElement(Controller,{rules:{required:"Category is required"},name:"categoryIds",render:A=>{var {field:D}=A,z=D,S=M(z,["ref","onChange"]);return re.createElement(cp,E(c({parentContainer:b.current,onChange:V=>g("categoryIds",V,{shouldValidate:!0})},S),{"data-qa-anchor":`${e}`}))},control:p}),re.createElement(fr,{errors:y,name:"category"}))),re.createElement(r7,{title:re.createElement(FormattedMessage,{id:"community.categorypermission"})},re.createElement(Controller,{name:"isPublic",render:({field:w})=>re.createElement(lp,null,re.createElement(pl,E(c({},w),{value:w.value===!0,onChange:k=>w.onChange(k.target.checked),"data-qa-anchor":"community-form-public-type-community-type",label:"Public",renderer:()=>re.createElement(fM,{type:"Public",description:"Anyone can join, view and search the posts in this group.",icon:re.createElement(ep,null)})})),re.createElement(pl,E(c({},w),{value:w.value===!1,onChange:k=>w.onChange(!k.target.checked),"data-qa-anchor":"community-form-private-type-community-type",label:"Private",renderer:()=>re.createElement(fM,{type:"Private",description:"Only members invited by the moderators can join, view, and search the posts in this group.",icon:re.createElement(tp,null)})}))),control:p})),!v&&re.createElement(r7,{title:"Community members"},re.createElement(sp,{error:y.userIds},re.createElement(Xr,{className:"required"},re.createElement(FormattedMessage,{id:"community.addmembers"})),re.createElement(Controller,{name:"userIds",render:S=>{var {field:A}=S,D=A,k=M(D,["ref"]);return re.createElement(Aa,c({parentContainer:b.current,"data-qa-anchor":e},k))},control:p}),re.createElement(fr,{errors:y,name:"userIds"})))),re.createElement(ap,null,re.createElement(Y,{onClick:w=>{w.preventDefault(),r==null||r();}},re.createElement(FormattedMessage,{id:"cancel"})),re.createElement(Cl,{"data-qa-anchor":`${e}-save-button`,disabled:P},re.createElement(FormattedMessage,{id:"create"}))))},yM=memo(rJ);var iJ=r=>{var n=r,{edit:e,community:t}=n,o=M(n,["edit","community"]);return e?t==null?null:re.createElement(Rw,E(c({},o),{community:t})):re.createElement(yM,c({},o))},fp=memo(e=>{let t=j("CommunityForm");return t?t(e):re.createElement(iJ,c({},e))});m(fp)`
|
|
2447
2447
|
${Jn} {
|
|
2448
2448
|
max-height: 550px;
|
|
2449
2449
|
overflow-y: auto;
|
|
@@ -2600,7 +2600,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Bd]+=1);var $d=`url("data:ima
|
|
|
2600
2600
|
> div {
|
|
2601
2601
|
cursor: pointer;
|
|
2602
2602
|
}
|
|
2603
|
-
`;var aJ=e=>re.createElement("svg",c({width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("g",{id:"multiply","clip-path":"url(#clip0_5142_12451)"},re.createElement("path",{id:"fill",d:"M13.2488 2.64829C13.0035 2.45402 12.6461 2.47021 12.4194 2.69686L8 7.1158L3.58058 2.69686L3.52547 2.64819C3.26929 2.45274 2.91847 2.47508 2.6967 2.69686L2.64813 2.75137C2.45387 2.99669 2.47006 3.3541 2.6967 3.58074L7.11612 7.99969L2.6967 12.4196L2.64804 12.4747C2.45258 12.7309 2.47492 13.0817 2.6967 13.3035L2.75121 13.352C2.99654 13.5463 3.35394 13.5301 3.58058 13.3035L8 8.88357L12.4194 13.3035L12.4745 13.3521C12.7307 13.5476 13.0815 13.5252 13.3033 13.3035L13.3519 13.2489C13.5461 13.0036 13.5299 12.6462 13.3033 12.4196L8.88388 7.99969L13.3033 3.58074L13.352 3.52563C13.5474 3.26945 13.5251 2.91863 13.3033 2.69686L13.2488 2.64829Z",fill:"black"})),re.createElement("defs",null,re.createElement("clipPath",{id:"clip0_5142_12451"},re.createElement("rect",{width:"16",height:"16",fill:"white"})))),i7=aJ;var sJ=e=>re.createElement("svg",c({width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("g",{"clip-path":"url(#clip0_593_12387)"},re.createElement("path",{d:"M8.00003 0C8.60918 0 9.16863 0.324779 9.47228 0.846019L9.52953 0.952849L15.8447 13.8179C16.0755 14.2874 16.0476 14.8426 15.771 15.2866C15.5156 15.6964 15.0817 15.9577 14.6053 15.9952L14.4854 15.9998H1.51503C0.991951 16.0002 0.505748 15.7305 0.2291 15.2866C-0.0262662 14.8768 -0.0696812 14.3721 0.106551 13.9279L0.15519 13.8182L6.47058 0.952732C6.75705 0.369526 7.35026 0 8.00003 0ZM8.00003 1C7.76141 1 7.54125 1.12063 7.41219 1.31658L7.3682 1.3935L1.05274 14.2591C0.974401 14.4185 0.983873 14.607 1.07779 14.7577C1.1583 14.8869 1.29107 14.9725 1.4394 14.9943L1.5147 14.9998H14.4857C14.6633 14.9998 14.8283 14.9084 14.9223 14.7577C15.0028 14.6285 15.0212 14.4715 14.9754 14.3288L14.9472 14.2588L8.63191 1.39362C8.51356 1.15267 8.26848 1 8.00003 1ZM8.00003 11.9998L8.08175 12.0042C8.45752 12.045 8.75003 12.3632 8.75003 12.7498C8.75003 13.1641 8.41424 13.4998 8.00003 13.4998C7.58581 13.4998 7.25003 13.1641 7.25003 12.7498C7.25003 12.3632 7.54254 12.045 7.91831 12.0042L8.00003 11.9998ZM8.00003 4.99984C8.25316 4.99984 8.46236 5.18794 8.49546 5.43199L8.50003 5.49984V10.4998C8.50003 10.776 8.27617 10.9998 8.00003 10.9998C7.7469 10.9998 7.5377 10.8117 7.50459 10.5677L7.50003 10.4998V5.49984C7.50003 5.2237 7.72389 4.99984 8.00003 4.99984Z",fill:"#B30000"})),re.createElement("defs",null,re.createElement("clipPath",{id:"clip0_593_12387"},re.createElement("rect",{width:"16",height:"16",fill:"white"})))),DM=sJ;var cJ=({isOpen:e,onClose:t})=>{let{client:o}=
|
|
2603
|
+
`;var aJ=e=>re.createElement("svg",c({width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("g",{id:"multiply","clip-path":"url(#clip0_5142_12451)"},re.createElement("path",{id:"fill",d:"M13.2488 2.64829C13.0035 2.45402 12.6461 2.47021 12.4194 2.69686L8 7.1158L3.58058 2.69686L3.52547 2.64819C3.26929 2.45274 2.91847 2.47508 2.6967 2.69686L2.64813 2.75137C2.45387 2.99669 2.47006 3.3541 2.6967 3.58074L7.11612 7.99969L2.6967 12.4196L2.64804 12.4747C2.45258 12.7309 2.47492 13.0817 2.6967 13.3035L2.75121 13.352C2.99654 13.5463 3.35394 13.5301 3.58058 13.3035L8 8.88357L12.4194 13.3035L12.4745 13.3521C12.7307 13.5476 13.0815 13.5252 13.3033 13.3035L13.3519 13.2489C13.5461 13.0036 13.5299 12.6462 13.3033 12.4196L8.88388 7.99969L13.3033 3.58074L13.352 3.52563C13.5474 3.26945 13.5251 2.91863 13.3033 2.69686L13.2488 2.64829Z",fill:"black"})),re.createElement("defs",null,re.createElement("clipPath",{id:"clip0_5142_12451"},re.createElement("rect",{width:"16",height:"16",fill:"white"})))),i7=aJ;var sJ=e=>re.createElement("svg",c({width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("g",{"clip-path":"url(#clip0_593_12387)"},re.createElement("path",{d:"M8.00003 0C8.60918 0 9.16863 0.324779 9.47228 0.846019L9.52953 0.952849L15.8447 13.8179C16.0755 14.2874 16.0476 14.8426 15.771 15.2866C15.5156 15.6964 15.0817 15.9577 14.6053 15.9952L14.4854 15.9998H1.51503C0.991951 16.0002 0.505748 15.7305 0.2291 15.2866C-0.0262662 14.8768 -0.0696812 14.3721 0.106551 13.9279L0.15519 13.8182L6.47058 0.952732C6.75705 0.369526 7.35026 0 8.00003 0ZM8.00003 1C7.76141 1 7.54125 1.12063 7.41219 1.31658L7.3682 1.3935L1.05274 14.2591C0.974401 14.4185 0.983873 14.607 1.07779 14.7577C1.1583 14.8869 1.29107 14.9725 1.4394 14.9943L1.5147 14.9998H14.4857C14.6633 14.9998 14.8283 14.9084 14.9223 14.7577C15.0028 14.6285 15.0212 14.4715 14.9754 14.3288L14.9472 14.2588L8.63191 1.39362C8.51356 1.15267 8.26848 1 8.00003 1ZM8.00003 11.9998L8.08175 12.0042C8.45752 12.045 8.75003 12.3632 8.75003 12.7498C8.75003 13.1641 8.41424 13.4998 8.00003 13.4998C7.58581 13.4998 7.25003 13.1641 7.25003 12.7498C7.25003 12.3632 7.54254 12.045 7.91831 12.0042L8.00003 11.9998ZM8.00003 4.99984C8.25316 4.99984 8.46236 5.18794 8.49546 5.43199L8.50003 5.49984V10.4998C8.50003 10.776 8.27617 10.9998 8.00003 10.9998C7.7469 10.9998 7.5377 10.8117 7.50459 10.5677L7.50003 10.4998V5.49984C7.50003 5.2237 7.72389 4.99984 8.00003 4.99984Z",fill:"#B30000"})),re.createElement("defs",null,re.createElement("clipPath",{id:"clip0_593_12387"},re.createElement("rect",{width:"16",height:"16",fill:"white"})))),DM=sJ;var cJ=({isOpen:e,onClose:t})=>{let{client:o}=X(),[r,n]=useState(""),[i,a]=useState(""),[s,l]=useState(!1);if(!e)return null;let d=f=>{n(f.target.value),a("");},p=()=>{t&&t();};return re.createElement(Yt,{className:"login-wrapper","data-qa-anchor":"nickname-creation-modal",isOpen:e},re.createElement(MM,null,re.createElement(hM,null,re.createElement(PM,null,re.createElement(_M,null,"Join a vibrant community"),re.createElement(bM,{onClick:p},re.createElement(i7,null))),re.createElement(SM,null,`Ready to discover beauty tips and trends while making new connections?
|
|
2604
2604
|
Join below to get started!`),re.createElement("form",{onSubmit:f=>_(void 0,null,function*(){if(f.preventDefault(),l(!0),!r||!(o!=null&&o.userId)){l(!1);return}let y=/[^a-zA-Z0-9]/;if(r.length<3||r.length>26||r.includes(" ")||y.test(r)){a("default"),l(!1);return}try{yield UserRepository.updateUser(o==null?void 0:o.userId,{displayName:r,metadata:{hasNickname:!0}}),window.location.reload();}catch(C){C.message.includes("Deny from prehook: This name has already been taken")?a("This nickname has already been taken. Please try again."):a("default");}finally{l(!1);}})},re.createElement(TM,null,re.createElement(kM,{htmlFor:"input"},"Nickname"),re.createElement(CM,null,re.createElement(NM,{type:"text",id:"input",value:r,onChange:d,hasError:!!i,placeholder:"e.g., MakeupLover"}),r&&re.createElement(IM,{onClick:()=>{n(""),a("");}},re.createElement(i7,null))),i?re.createElement(vM,null,re.createElement(DM,{width:16,height:16}),re.createElement(EM,null,i==="default"?re.createElement(re.Fragment,null,re.createElement("div",null,"Nickname invalid. Please try again."),re.createElement("div",null,"Nickname must:",re.createElement(xM,null,re.createElement("li",null,"Be 3-25 characters in length."),re.createElement("li",null,"Not contain special characters."),re.createElement("li",null,"Not contain spaces."),re.createElement("li",null,"Not contain profanity.")))):i)):re.createElement(wM,null,`Choose how you want your name shown to the rest of the community.
|
|
2605
2605
|
|
|
2606
2606
|
Note: nickname must be alphanumeric only and 3-25 characters in length.`)),re.createElement(BM,null,"By clicking \u201CJoin\u201D, you agree to our ",re.createElement(yp,null,"Terms & Conditions")," and have read our ",re.createElement(yp,null,"Privacy Policy.")),re.createElement(LM,{type:"submit",disabled:!r||s},"JOIN"),re.createElement(AM,null,re.createElement(yp,{onClick:p},"Maybe later"))))))},hp=memo(e=>{let t=j("NickNameCreationModal");return t?t(e):re.createElement(cJ,c({},e))});var FM=()=>{let{isOpen:e,closeNicknameModal:t}=_o();return re.createElement(va,null,re.createElement(hp,{isOpen:e,onClose:t}))};var fJ=({apiKey:e,apiRegion:t,apiEndpoint:o,userId:r,displayName:n,customComponents:i={},postRendererConfig:a,theme:s={},children:l,socialCommunityCreationButtonVisible:d,actionHandlers:p,onConnectionStatusChange:u,onDisconnected:g,getAuthToken:f})=>{let y=new QueryClient,[C,h]=useState(!1),[v,b]=useState(null),x=useRef(null),P=useRef(null),I=oe(r),w=useMemo(()=>{var S;return {client:v||null,currentUserId:r||void 0,userRoles:(S=I==null?void 0:I.roles)!=null?S:[]}},[v,r,I==null?void 0:I.roles]);function k(){return _(this,null,function*(){try{let A=Client.getActiveClient();b(A);}catch(A){let D=Client.createClient(e,t,o?{apiEndpoint:o}:{});b(D);}let S={userId:r,displayName:n};if(f){let A=yield f();S=E(c({},S),{authToken:A});}yield Client.login(S,{sessionWillRenewAccessToken(A){f?f().then(D=>{A.renewWithAuthToken(D);}):A.renew();}}),h(!0),x.current==null&&(x.current=Client.onSessionStateChange(A=>{u==null||u(A);})),P.current==null&&(P.current=Client.onClientDisconnected(()=>{g&&g();}));})}return useEffect(()=>{window.parent.postMessage("uikitRendered","*");function S(){return _(this,null,function*(){yield k();})}return S(),()=>{var A,D;(A=x.current)==null||A.call(x),(D=P.current)==null||D.call(P);}},[r]),v==null?re.createElement(re.Fragment,null):C?re.createElement(QueryClientProvider,{client:y},re.createElement(PC,{locale:"en"},re.createElement(vy,{theme:DC(s)},re.createElement(HC,null,re.createElement(u0.Provider,{value:w},re.createElement(g0.Provider,{value:w},re.createElement(X4,null,re.createElement(s6,null,re.createElement(mv,null,re.createElement(sv,null,re.createElement(Dh,null,re.createElement(CC,null,re.createElement(Th,null,re.createElement(oC,null,re.createElement(uC,{initialConfig:{preferred_theme:"light"}},re.createElement(l6,{config:i},re.createElement(V4,{config:{socialCommunityCreationButtonVisible:d||!0}},re.createElement(Y6,{config:a},re.createElement(R4,c({},p),l))),re.createElement(Bh,null),re.createElement(iC,null),re.createElement(Jh,null),re.createElement(vC,null),re.createElement(FM,null))))))))))))))))):re.createElement(re.Fragment,null)},yJ=fJ;var vJ=()=>{let[e,t]=useState(null),o=Mo();return useEffect(()=>{e&&(o.error({content:e}),t(null));},[e]),[t]},UM=vJ;var IJ=m.div`
|
|
@@ -2629,7 +2629,7 @@ Note: nickname must be alphanumeric only and 3-25 characters in length.`)),re.cr
|
|
|
2629
2629
|
width: 100%;
|
|
2630
2630
|
padding-right: 60px;
|
|
2631
2631
|
color: ${({theme:e})=>e.palette.neutral.main};
|
|
2632
|
-
`,WM=m(a4)``,qM=m(
|
|
2632
|
+
`,WM=m(a4)``,qM=m(Y)`
|
|
2633
2633
|
background: transparent;
|
|
2634
2634
|
border: none;
|
|
2635
2635
|
outline: none;
|
|
@@ -2834,7 +2834,7 @@ Note: nickname must be alphanumeric only and 3-25 characters in length.`)),re.cr
|
|
|
2834
2834
|
`,vP=m.div`
|
|
2835
2835
|
display: flex;
|
|
2836
2836
|
align-items: center;
|
|
2837
|
-
`;var bP=200,_J=({option:e,removeOption:t,updateOption:o})=>{let[r,n]=useState(e.text);return re.createElement(GM,null,re.createElement(tP,null,re.createElement(QM,{"data-qa-anchor":"poll-composer-option-item-input",value:r,maxLength:bP,onChange:a=>{n(a.target.value),o(a.target.value);}}),re.createElement(Sl,null,`${r.length}/${bP}`)),re.createElement(qM,{"data-qa-anchor":"poll-composer-option-item-close-button",onClick:t},re.createElement(WM,{height:16})))},SJ=({onChange:e,optionsLimit:t})=>{let[o,r]=useState([]),n=!t||t&&o.length<t,i=d=>{e(d.map(({text:p})=>({dataType:"text",data:p})));},a=()=>{if(n){let d=[...o,{text:"",id:v4$1()}];r(d),i(d);}},s=(d,p)=>{let u=o.map(g=>g.id===d?E(c({},g),{text:p}):g);r(u),i(u);},l=d=>{let p=o.findIndex(g=>g.id===d),u=[...o.slice(0,p),...o.slice(p+1)];r(u),i(u);};return re.createElement(jM,null,re.createElement(oP,null,re.createElement(FormattedMessage,{id:"options_composer.title"})),o.map(d=>re.createElement(_J,{key:d.id,option:d,removeOption:()=>l(d.id),updateOption:p=>s(d.id,p)})),re.createElement("div",null,re.createElement(
|
|
2837
|
+
`;var bP=200,_J=({option:e,removeOption:t,updateOption:o})=>{let[r,n]=useState(e.text);return re.createElement(GM,null,re.createElement(tP,null,re.createElement(QM,{"data-qa-anchor":"poll-composer-option-item-input",value:r,maxLength:bP,onChange:a=>{n(a.target.value),o(a.target.value);}}),re.createElement(Sl,null,`${r.length}/${bP}`)),re.createElement(qM,{"data-qa-anchor":"poll-composer-option-item-close-button",onClick:t},re.createElement(WM,{height:16})))},SJ=({onChange:e,optionsLimit:t})=>{let[o,r]=useState([]),n=!t||t&&o.length<t,i=d=>{e(d.map(({text:p})=>({dataType:"text",data:p})));},a=()=>{if(n){let d=[...o,{text:"",id:v4$1()}];r(d),i(d);}},s=(d,p)=>{let u=o.map(g=>g.id===d?E(c({},g),{text:p}):g);r(u),i(u);},l=d=>{let p=o.findIndex(g=>g.id===d),u=[...o.slice(0,p),...o.slice(p+1)];r(u),i(u);};return re.createElement(jM,null,re.createElement(oP,null,re.createElement(FormattedMessage,{id:"options_composer.title"})),o.map(d=>re.createElement(_J,{key:d.id,option:d,removeOption:()=>l(d.id),updateOption:p=>s(d.id,p)})),re.createElement("div",null,re.createElement(Y,{"data-qa-anchor":"poll-composer-add-option-button",fullWidth:!0,disabled:!n,onClick:d=>{d.preventDefault(),a();}},re.createElement(Cp,null)," ",re.createElement(FormattedMessage,{id:"options_composer.button.add"}))))},wP=SJ;var MP=m.div`
|
|
2838
2838
|
display: flex;
|
|
2839
2839
|
align-items: center;
|
|
2840
2840
|
width: 100%;
|
|
@@ -2857,7 +2857,7 @@ Note: nickname must be alphanumeric only and 3-25 characters in length.`)),re.cr
|
|
|
2857
2857
|
cursor: pointer;
|
|
2858
2858
|
}
|
|
2859
2859
|
}
|
|
2860
|
-
`,SP=m(n4).attrs({width:24,height:24})``,TP=m(yn).attrs({width:24,height:24})``;var u7="{counter}",kP=({icon:e=null,onClick:t,disabled:o})=>re.createElement(_P,{disabled:o,onClick:t},e),kJ=({output:e=""})=>re.createElement(PP,null,e),NJ=({renderDecButton:e=kP,renderIncButton:t=kP,renderResult:o=kJ,resultFormat:r="{counter}",defaultValue:n=0,onChange:i,onlyPositiveNumber:a=!0})=>{let[s,l]=useState(n);return re.createElement(MP,null,e({onClick:d=>{d.preventDefault();let p=s-1;l(p),i(p);},icon:re.createElement(SP,null),disabled:a&&s-1<0}),o({output:r.replace(u7,s)}),t({onClick:d=>{d.preventDefault();let p=s+1;l(p),i(p);},icon:re.createElement(TP,null)}))},NP=NJ;var BJ=({onChange:e,parentContainer:t=null})=>{let{formatMessage:o}=useIntl(),r=Object.values(["single","multiple"]).map(n=>({name:o({id:"select.answerType.item"},{answerType:n}),value:n}));return re.createElement(eP,{options:r,value:[r[0]],parentContainer:t,renderItem:({name:n})=>re.createElement("div",null,n),onSelect:({value:n})=>e(n)})},BP=BJ;var LP=500,Z2=2,Tl=10,OJ=864e5,zJ=({children:e})=>re.createElement(JM,null,re.createElement(KM,null,e)),UJ=({className:e="",targetId:t,targetType:o,onCancel:r=()=>{},onSubmit:n=(a,s,l)=>{},onIsDirtyChange:i})=>{var N;let{text:a,markup:s,mentions:l,mentionees:d,metadata:p,queryMentionees:u,onChange:g}=Wr({targetId:t||void 0,targetType:o}),[f,y]=useState(!1),{info:C}=Me(),h={question:"",answers:[],answerType:"single",closedIn:0},{handleSubmit:v,setError:b,watch:x,control:P,formState:{errors:I,isDirty:w}}=useForm({defaultValues:h}),{formatMessage:k}=useIntl(),S=x("question",""),A=x("answers",[]);useEffect(()=>i==null?void 0:i(w),[w]);let D=O=>_(void 0,null,function*(){var K,Z,G;try{if(y(!0),!O.question.trim()){b("question",{message:"Question cannot be empty"});return}if(((K=O==null?void 0:O.answers)==null?void 0:K.length)<Z2){b("answers",{message:`Minimum amount of answers should be ${Z2}`});return}if(((Z=O==null?void 0:O.answers)==null?void 0:Z.length)>Tl){b("answers",{message:`Maximum amount of answers should be ${Tl}`});return}let H={question:O==null?void 0:O.question,answers:(G=O==null?void 0:O.answers)!=null&&G.length?O.answers:[],answerType:(O==null?void 0:O.answerType)||"single",closedIn:O&&O.closedIn?O.closedIn*OJ:void 0};yield n(H,d,p);}finally{y(!1);}}),z=!w||(S==null?void 0:S.length)===0||f,V=useRef(null);return re.createElement($M,null,re.createElement(VM,{className:e,onSubmit:v(D)},re.createElement(XM,{ref:V},re.createElement(zJ,null,re.createElement($2,null,re.createElement(l7,null,re.createElement(j2,null,re.createElement(V2,{className:"required"},re.createElement(FormattedMessage,{id:"poll_composer.question.label"}))),re.createElement(Sl,null,`${(N=a==null?void 0:a.length)!=null?N:0}/${LP}`)),re.createElement(Controller,{control:P,name:"question",rules:{required:"Question is required",maxLength:{value:LP,message:"Question is too long"}},render:H=>{var{field:U}=H,Q=U,{value:O,ref:K,onChange:Z}=Q,G=M(Q,["value","ref","onChange"]);return re.createElement(ZM,E(c({},G),{ref:K,"data-qa-anchor":"poll-composer-options-textarea",mentionAllowed:!0,multiline:!0,value:s,queryMentionees:u,placeholder:k({id:"poll_composer.question.placeholder"}),onChange:ne=>{var te=ne,{plainText:W,mentions:B}=te,$=M(te,["plainText","mentions"]);if((B==null?void 0:B.length)>GC)return C({title:re.createElement(FormattedMessage,{id:"pollComposer.unableToMention"}),content:re.createElement(FormattedMessage,{id:"pollComposer.overMentionees"}),okText:re.createElement(FormattedMessage,{id:"pollComposer.okText"}),type:"info"});g(c({plainText:W,mentions:B},$)),Z(W);}}))}}),re.createElement(s7,{errors:I,name:"question"})),re.createElement($2,null,re.createElement(l7,null,re.createElement(j2,null,re.createElement(V2,{className:"required"},re.createElement(FormattedMessage,{id:"poll_composer.poll_options.label"}))),re.createElement(Sl,null,`${A.length}/${Tl}`)),re.createElement(Controller,{rules:{required:`There should be at least ${Z2} answers`,minLength:{value:Z2,message:`There should be at least ${Z2} answers`},maxLength:{value:Tl,message:`There can be only ${Tl} answers maximum`}},name:"answers",control:P,render:({field:O})=>re.createElement(wP,c({optionsLimit:Tl},O))}),re.createElement(s7,{errors:I,name:"answers"})),re.createElement($2,{horizontal:!0,separate:!0},re.createElement(c7,null,re.createElement(j2,null,re.createElement(V2,null,re.createElement(FormattedMessage,{id:"poll_modal.answer_type.title"})),re.createElement("div",null,re.createElement(FormattedMessage,{id:"poll_modal.answer_type.body"}))),re.createElement(m7,null,re.createElement(Controller,{rules:{required:"Answer type is required"},name:"answerType",render:({field:O})=>re.createElement(BP,c({parentContainer:V.current},O)),control:P})))),re.createElement($2,{horizontal:!0,separate:!0},re.createElement(c7,null,re.createElement(j2,null,re.createElement(V2,null,re.createElement(FormattedMessage,{id:"poll_modal.closed_in.title"})),re.createElement("div",null,re.createElement(FormattedMessage,{id:"poll_modal.closed_in.body"}))),re.createElement(m7,null,re.createElement(Controller,{name:"closedIn",render:({field:O})=>re.createElement(NP,E(c({},O),{onlyPositiveNumber:!0,resultFormat:`${u7} days`})),control:P})))))),re.createElement(YM,null,re.createElement(
|
|
2860
|
+
`,SP=m(n4).attrs({width:24,height:24})``,TP=m(yn).attrs({width:24,height:24})``;var u7="{counter}",kP=({icon:e=null,onClick:t,disabled:o})=>re.createElement(_P,{disabled:o,onClick:t},e),kJ=({output:e=""})=>re.createElement(PP,null,e),NJ=({renderDecButton:e=kP,renderIncButton:t=kP,renderResult:o=kJ,resultFormat:r="{counter}",defaultValue:n=0,onChange:i,onlyPositiveNumber:a=!0})=>{let[s,l]=useState(n);return re.createElement(MP,null,e({onClick:d=>{d.preventDefault();let p=s-1;l(p),i(p);},icon:re.createElement(SP,null),disabled:a&&s-1<0}),o({output:r.replace(u7,s)}),t({onClick:d=>{d.preventDefault();let p=s+1;l(p),i(p);},icon:re.createElement(TP,null)}))},NP=NJ;var BJ=({onChange:e,parentContainer:t=null})=>{let{formatMessage:o}=useIntl(),r=Object.values(["single","multiple"]).map(n=>({name:o({id:"select.answerType.item"},{answerType:n}),value:n}));return re.createElement(eP,{options:r,value:[r[0]],parentContainer:t,renderItem:({name:n})=>re.createElement("div",null,n),onSelect:({value:n})=>e(n)})},BP=BJ;var LP=500,Z2=2,Tl=10,OJ=864e5,zJ=({children:e})=>re.createElement(JM,null,re.createElement(KM,null,e)),UJ=({className:e="",targetId:t,targetType:o,onCancel:r=()=>{},onSubmit:n=(a,s,l)=>{},onIsDirtyChange:i})=>{var N;let{text:a,markup:s,mentions:l,mentionees:d,metadata:p,queryMentionees:u,onChange:g}=Wr({targetId:t||void 0,targetType:o}),[f,y]=useState(!1),{info:C}=Me(),h={question:"",answers:[],answerType:"single",closedIn:0},{handleSubmit:v,setError:b,watch:x,control:P,formState:{errors:I,isDirty:w}}=useForm({defaultValues:h}),{formatMessage:k}=useIntl(),S=x("question",""),A=x("answers",[]);useEffect(()=>i==null?void 0:i(w),[w]);let D=O=>_(void 0,null,function*(){var K,Z,G;try{if(y(!0),!O.question.trim()){b("question",{message:"Question cannot be empty"});return}if(((K=O==null?void 0:O.answers)==null?void 0:K.length)<Z2){b("answers",{message:`Minimum amount of answers should be ${Z2}`});return}if(((Z=O==null?void 0:O.answers)==null?void 0:Z.length)>Tl){b("answers",{message:`Maximum amount of answers should be ${Tl}`});return}let H={question:O==null?void 0:O.question,answers:(G=O==null?void 0:O.answers)!=null&&G.length?O.answers:[],answerType:(O==null?void 0:O.answerType)||"single",closedIn:O&&O.closedIn?O.closedIn*OJ:void 0};yield n(H,d,p);}finally{y(!1);}}),z=!w||(S==null?void 0:S.length)===0||f,V=useRef(null);return re.createElement($M,null,re.createElement(VM,{className:e,onSubmit:v(D)},re.createElement(XM,{ref:V},re.createElement(zJ,null,re.createElement($2,null,re.createElement(l7,null,re.createElement(j2,null,re.createElement(V2,{className:"required"},re.createElement(FormattedMessage,{id:"poll_composer.question.label"}))),re.createElement(Sl,null,`${(N=a==null?void 0:a.length)!=null?N:0}/${LP}`)),re.createElement(Controller,{control:P,name:"question",rules:{required:"Question is required",maxLength:{value:LP,message:"Question is too long"}},render:H=>{var{field:U}=H,Q=U,{value:O,ref:K,onChange:Z}=Q,G=M(Q,["value","ref","onChange"]);return re.createElement(ZM,E(c({},G),{ref:K,"data-qa-anchor":"poll-composer-options-textarea",mentionAllowed:!0,multiline:!0,value:s,queryMentionees:u,placeholder:k({id:"poll_composer.question.placeholder"}),onChange:ne=>{var te=ne,{plainText:W,mentions:B}=te,$=M(te,["plainText","mentions"]);if((B==null?void 0:B.length)>GC)return C({title:re.createElement(FormattedMessage,{id:"pollComposer.unableToMention"}),content:re.createElement(FormattedMessage,{id:"pollComposer.overMentionees"}),okText:re.createElement(FormattedMessage,{id:"pollComposer.okText"}),type:"info"});g(c({plainText:W,mentions:B},$)),Z(W);}}))}}),re.createElement(s7,{errors:I,name:"question"})),re.createElement($2,null,re.createElement(l7,null,re.createElement(j2,null,re.createElement(V2,{className:"required"},re.createElement(FormattedMessage,{id:"poll_composer.poll_options.label"}))),re.createElement(Sl,null,`${A.length}/${Tl}`)),re.createElement(Controller,{rules:{required:`There should be at least ${Z2} answers`,minLength:{value:Z2,message:`There should be at least ${Z2} answers`},maxLength:{value:Tl,message:`There can be only ${Tl} answers maximum`}},name:"answers",control:P,render:({field:O})=>re.createElement(wP,c({optionsLimit:Tl},O))}),re.createElement(s7,{errors:I,name:"answers"})),re.createElement($2,{horizontal:!0,separate:!0},re.createElement(c7,null,re.createElement(j2,null,re.createElement(V2,null,re.createElement(FormattedMessage,{id:"poll_modal.answer_type.title"})),re.createElement("div",null,re.createElement(FormattedMessage,{id:"poll_modal.answer_type.body"}))),re.createElement(m7,null,re.createElement(Controller,{rules:{required:"Answer type is required"},name:"answerType",render:({field:O})=>re.createElement(BP,c({parentContainer:V.current},O)),control:P})))),re.createElement($2,{horizontal:!0,separate:!0},re.createElement(c7,null,re.createElement(j2,null,re.createElement(V2,null,re.createElement(FormattedMessage,{id:"poll_modal.closed_in.title"})),re.createElement("div",null,re.createElement(FormattedMessage,{id:"poll_modal.closed_in.body"}))),re.createElement(m7,null,re.createElement(Controller,{name:"closedIn",render:({field:O})=>re.createElement(NP,E(c({},O),{onlyPositiveNumber:!0,resultFormat:`${u7} days`})),control:P})))))),re.createElement(YM,null,re.createElement(Y,{onClick:O=>{O.preventDefault(),r();}},re.createElement(FormattedMessage,{id:"cancel"})),re.createElement(RM,{"data-qa-anchor":"poll-composer-post-button",disabled:z},re.createElement(FormattedMessage,{id:"post"})))))},AP=UJ;var GJ=({targetId:e,targetType:t,onClose:o,onCreatePoll:r})=>{let[n,i]=useState(!1),{formatMessage:a}=useIntl(),{confirm:s}=Me(),l=be(),d=(u,g,f)=>_(void 0,null,function*(){try{let y=yield PollRepository.createPoll(u);yield r(y.data.pollId,u.question,g,f),o();}catch(y){y instanceof Error&&(y.message===Qr.CONTAIN_BLOCKED_WORD?l.error({content:re.createElement(FormattedMessage,{id:"notification.error.blockedWord"})}):y.message===Qr.NOT_INCLUDE_WHITELIST_LINK&&l.error({content:re.createElement(FormattedMessage,{id:"notification.error.whitelistLink"})}));}}),p=()=>s({title:a({id:"CommunityCreationModal.title"}),content:a({id:"CommunityCreationModal.content"}),cancelText:a({id:"CommunityCreationModal.cancelText"}),okText:a({id:"CommunityCreationModal.okText"}),onOk:o});return re.createElement(Yt,{"data-qa-anchor":"poll-composer-modal",title:a({id:"poll_modal.title"}),clean:!1,onCancel:n?p:o},re.createElement(AP,{targetId:e,targetType:t,onIsDirtyChange:u=>i(u),onCancel:p,onSubmit:d}))},HP=GJ;var qJ=n=>{var i=n,{className:e,fixed:t=!1,children:o}=i,r=M(i,["className","fixed","children"]);return re.createElement(Popover,c({containerClassName:yi(e,{fixed:t})},r),o)},FP=m(qJ)`
|
|
2861
2861
|
${({theme:e})=>e.typography.body}
|
|
2862
2862
|
z-index: 10000;
|
|
2863
2863
|
background: ${({theme:e})=>e.palette.system.background};
|
|
@@ -2960,7 +2960,7 @@ Note: nickname must be alphanumeric only and 3-25 characters in length.`)),re.cr
|
|
|
2960
2960
|
background: none;
|
|
2961
2961
|
border: none;
|
|
2962
2962
|
padding: 0;
|
|
2963
|
-
`;m(i4)``;var _X=({targetId:e,targetType:t})=>{let[o,r]=useState(null),[n,i]=useState(null),a=useRef(null);return useEffect(()=>{if(!(e==null||e===""))return a.current&&a.current(),(t==="communityFeed"||t==="community")&&(a.current=CommunityRepository.getCommunity(e,s=>{r(s.data);})),a.current=UserRepository.getUser(e,s=>{i(s.data);}),()=>{var s;(s=a.current)==null||s.call(a);}},[e,t]),{community:o,user:n}},SX=10,TX=({className:e="",targetType:t,targetId:o,enablePostTargetPicker:r,communities:n=[],placeholder:i="What's going on...",hasMoreCommunities:a,loadMoreCommunities:s,onCreateSuccess:l,maxFiles:d=SX})=>{var ot,gn;let{currentUserId:p,client:u}=
|
|
2963
|
+
`;m(i4)``;var _X=({targetId:e,targetType:t})=>{let[o,r]=useState(null),[n,i]=useState(null),a=useRef(null);return useEffect(()=>{if(!(e==null||e===""))return a.current&&a.current(),(t==="communityFeed"||t==="community")&&(a.current=CommunityRepository.getCommunity(e,s=>{r(s.data);})),a.current=UserRepository.getUser(e,s=>{i(s.data);}),()=>{var s;(s=a.current)==null||s.call(a);}},[e,t]),{community:o,user:n}},SX=10,TX=({className:e="",targetType:t,targetId:o,enablePostTargetPicker:r,communities:n=[],placeholder:i="What's going on...",hasMoreCommunities:a,loadMoreCommunities:s,onCreateSuccess:l,maxFiles:d=SX})=>{var ot,gn;let{currentUserId:p,client:u}=X(),{setNavigationBlocker:g}=J(),f=oe(p),{info:y}=Me(),C=be(),[h,v]=useState(null);(t==="global"||t==="myFeed")&&(t="user",o=p||"");let [b,x]=useState({targetType:t,targetId:o}),{user:P,community:I}=_X({targetId:b.targetId,targetType:b.targetType});Li(I==null?void 0:I.communityId);Os({post:h,community:I}),useEffect(()=>{x({targetType:t,targetId:o});},[t,o]);let S=se({fileId:(P==null?void 0:P.avatarFileId)||(I==null?void 0:I.avatarFileId)||""}),[A,D]=useState([]),[z,V]=useState([]),[N,O]=useState([]),[K,Z]=useState([]),[G,H]=useState([]),[U,Q]=useState([]),[W,B]=useState(!1),[$]=UM(),{mentionees:ne,metadata:te,text:ue,markup:ce,onChange:Ze,queryMentionees:dt,clearAll:Ot}=Wr({targetType:b.targetType,targetId:b.targetId||void 0}),[zt,ke]=useState(!1),Un=()=>{y({title:re.createElement(FormattedMessage,{id:"postCreator.unableToPost"}),content:re.createElement(FormattedMessage,{id:"postCreator.overCharacter"}),okText:re.createElement(FormattedMessage,{id:"postCreator.done"}),type:"info"});},pn=useRef(null);function Oo(de){return _(this,null,function*(){var Ne;if(b.targetId)try{ke(!0);let wi=(yield PostRepository.createPost(de)).data;if(l==null||l(wi),Ot(),D([]),V([]),O([]),Z([]),H([]),Q([]),I){let $n=(Ne=u==null?void 0:u.hasPermission(lr.ReviewCommunityPost).community(I.communityId))!=null?Ne:!1;I.postSetting===CommunityPostSettings.ADMIN_REVIEW_POST_REQUIRED&&!$n&&C.success({content:re.createElement(FormattedMessage,{id:"post.success.submittedToReview"})});}}catch(Jt){Jt instanceof Error&&(Jt.message===Qr.CONTAIN_BLOCKED_WORD?C.error({content:re.createElement(FormattedMessage,{id:"notification.error.blockedWord"})}):Jt.message===Qr.NOT_INCLUDE_WHITELIST_LINK&&C.error({content:re.createElement(FormattedMessage,{id:"notification.error.whitelistLink"})}));}finally{ke(!1);}})}function Er(){return _(this,null,function*(){var wi;if(!b.targetId)return;let de={},Ne=[];if(ue&&(de.text=ue),A.length&&Ne.push(...A.map($n=>({fileId:$n.fileId,type:FileType.IMAGE}))),z.length&&Ne.push(...z.map($n=>({fileId:$n.fileId,type:FileType.VIDEO}))),N.length&&Ne.push(...N.map($n=>({fileId:$n.fileId,type:FileType.FILE}))),(wi=de.text)!=null&&wi.length&&de.text.length>5e4){Un();return}let Jt={targetId:b.targetId,targetType:b.targetType,data:de,dataType:"text",attachments:Ne,metadata:te,mentionees:ne};return Oo(Jt)})}let un=()=>{C.info({content:re.createElement(FormattedMessage,{id:"upload.attachmentLimit",values:{maxFiles:d}})});},fe=()=>{C.info({content:re.createElement(FormattedMessage,{id:"upload.fileSizeLimit"})});},st=b.targetType==="community"?sr:Ee,Ae=re.createElement(GP,{avatar:(P==null?void 0:P.avatarCustomUrl)||S||void 0,backgroundImage:st}),zo=!ue&&A.length===0&&z.length===0&&N.length===0||W||zt,Uo=!(!ue&&A.length===0&&z.length===0&&N.length===0);useEffect(()=>{Uo?g==null||g({title:re.createElement(FormattedMessage,{id:"post.discard.title"}),content:re.createElement(FormattedMessage,{id:"post.discard.content"}),okText:re.createElement(FormattedMessage,{id:"general.action.discard"}),onOk:()=>{Ot(),D([]),V([]),O([]),Z([]),H([]),Q([]),g==null||g(null);}}):g==null||g(null);},[Uo,g]);let [pa,Cs]=useState(!1),ua=(ot=b==null?void 0:b.targetType)!=null?ot:t,Ii=(gn=b==null?void 0:b.targetId)!=null?gn:o;return re.createElement(ZP,{className:yi("postComposeBar",e)},pa&&re.createElement(HP,{targetId:Ii||void 0,targetType:ua,onCreatePoll:(de,Ne,Jt,wi)=>_(void 0,null,function*(){Ii&&Oo({targetId:Ii,targetType:ua,data:{pollId:de,text:Ne},dataType:"poll",mentionees:Jt,metadata:wi});}),onClose:()=>Cs(!1)}),r&&f?re.createElement(UP,{user:f,communities:n,hasMoreCommunities:a,loadMoreCommunities:s,currentTargetId:b.targetId,onChange:x},Ae):Ae,re.createElement(WP,null,re.createElement(XP,null,re.createElement(JP,{"data-qa-anchor":"post-creator-textarea",multiline:!0,value:ce,placeholder:i,mentionAllowed:!0,queryMentionees:dt,loadMoreMentionees:de=>dt(de),append:re.createElement(re.Fragment,null,re.createElement(KP,null,re.createElement(VP,{files:K,uploadedFiles:A,uploadLoading:W,onLoadingChange:B,onChange:({uploaded:de,uploading:Ne})=>{D(de),Z(Ne);},onError:$,fileInputRef:pn}),re.createElement(jP,{files:G,uploadedFiles:z,uploadLoading:W,onLoadingChange:B,onChange:({uploaded:de,uploading:Ne})=>{V(de),H(Ne);},onError:$}),re.createElement(_p,{files:U,uploadedFiles:N,uploadLoading:W,onLoadingChange:B,onChange:({uploaded:de,uploading:Ne})=>{O(de),Q(Ne);},onError:$}))),onChange:({text:de,plainText:Ne,mentions:Jt})=>{if((Jt==null?void 0:Jt.length)>30)return y({title:re.createElement(FormattedMessage,{id:"postCreator.unableToMention"}),content:re.createElement(FormattedMessage,{id:"postCreator.overMentionees"}),okText:re.createElement(FormattedMessage,{id:"postCreator.okText"}),type:"info"});Ze({text:de,plainText:Ne,mentions:Jt});}}),re.createElement($P,{imageUploadDisabled:N.length>0||z.length>0||W,videoUploadDisabled:N.length>0||A.length>0||W,fileUploadDisabled:A.length>0||z.length>0||W,fileLimitRemaining:d-N.length-A.length-z.length,uploadLoading:W,onChangeImages:de=>Z(de),onChangeVideos:H,onChangeFiles:Q,onMaxFilesLimit:un,onFileSizeLimit:fe,fileInputRef:pn})),re.createElement(QP,{"data-qa-anchor":"post-creator-footer"},re.createElement(qP,{disabled:zo,"data-qa-anchor":"post-creator-post-button",onClick:Er},re.createElement(FormattedMessage,{id:"post"})))))},Q2=memo(TX);var EX=({postId:e,className:t,hidePostTarget:o,readonly:r,onDeleted:n})=>{var x;let i=lo(e),a=oe(i==null?void 0:i.postedUserId),s=se({fileId:a==null?void 0:a.avatarFileId,imageSize:"small"}),l=Na(i==null?void 0:i.children),{userRoles:d}=X(),p=ew(i==null?void 0:i.dataType),{currentUserId:u}=X(),g=(l||[]).find(P=>P.dataType==="poll"),f=Q0((x=g==null?void 0:g.data)==null?void 0:x.pollId),y=(f==null?void 0:f.status)==="closed",C=()=>_(void 0,null,function*(){f!=null&&(yield PollRepository.closePoll(f.pollId));}),h=()=>_(void 0,null,function*(){i!=null&&(yield PostRepository.deletePost(i.postId),n==null||n(i.postId));}),v=()=>_(void 0,null,function*(){i!=null&&(yield PostRepository.approvePost(i.postId));}),b=()=>_(void 0,null,function*(){i!=null&&(yield PostRepository.declinePost(i.postId));});return i==null||p==null?re.createElement(gr,{loading:!0}):re.createElement(re.Fragment,null,p({childrenPosts:l||[],handleClosePoll:C,isPollClosed:y,avatarFileUrl:s,user:a,poll:f,className:t,currentUserId:u||void 0,hidePostTarget:o,post:i,userRoles:d,readonly:r,handleApprovePost:v,handleDeclinePost:b,handleDeletePost:h}))},Da=memo(e=>{let t=j("Post");return t?t(e):re.createElement(EX,c({},e))});function BX(e){return re.createElement("svg",c({width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M14.3672 9.66406C17.5312 9.10156 20.8359 10.1562 23.1562 12.4766L23.9297 13.25L24.7734 12.4766C27.0938 10.1562 30.3984 9.10156 33.5625 9.66406C38.4141 10.4375 42 14.6562 42 19.5781V19.9297C42 22.8828 40.7344 25.6953 38.625 27.6641L25.8984 39.5469C25.4062 40.0391 24.7031 40.25 24 40.25C23.2266 40.25 22.5234 40.0391 22.0312 39.5469L9.30469 27.6641C7.19531 25.6953 6 22.8828 6 19.9297V19.5781C6 14.6562 9.51562 10.4375 14.3672 9.66406ZM23.9297 38C24.1406 38 24.2812 38 24.3516 37.8594L37.0781 25.9766C38.7656 24.4297 39.75 22.25 39.75 19.9297V19.5781C39.75 15.7109 36.9375 12.4766 33.2109 11.8438C30.6797 11.4219 28.1484 12.2656 26.3906 14.0234L25.5469 14.8672C25.4766 14.9375 25.4766 14.9375 25.4062 15.0078L28.2188 18.1719C28.4297 18.4531 28.5 18.7344 28.4297 19.0859C28.3594 19.4375 28.2188 19.7188 27.8672 19.8594L21.1875 23.7266L25.9688 29.4219C26.3203 29.9141 26.3203 30.6172 25.8281 31.0391C25.3359 31.3906 24.6328 31.3203 24.2109 30.8984L18.5859 24.1484C18.375 23.8672 18.3047 23.5156 18.375 23.2344C18.4453 22.8828 18.5859 22.6016 18.9375 22.4609L25.6172 18.5938L21.9609 14.5156H22.0312L21.5391 14.0234C19.7812 12.2656 17.25 11.4219 14.7188 11.8438C10.9922 12.4766 8.17969 15.7109 8.17969 19.5781V19.9297C8.17969 22.25 9.16406 24.4297 10.8516 25.9766L23.5781 37.8594C23.6484 38 23.7891 38 23.9297 38Z",fill:"#6E6E6E"}))}var e_=BX;var LX=m(Y)`
|
|
2964
2964
|
font-size: 14px;
|
|
2965
2965
|
margin-top: 24px;
|
|
2966
2966
|
border-radius: 100px;
|
|
@@ -3032,7 +3032,7 @@ Note: nickname must be alphanumeric only and 3-25 characters in length.`)),re.cr
|
|
|
3032
3032
|
`,a_=m.div`
|
|
3033
3033
|
font-size: 14px;
|
|
3034
3034
|
color: ${({theme:e})=>e.palette.base.shade1};
|
|
3035
|
-
`;var $X=()=>re.createElement(o_,null,re.createElement(r_,null,re.createElement(n_,null)),re.createElement(i_,null,re.createElement(FormattedMessage,{id:"privateFeed.title"})),re.createElement(a_,null,re.createElement(FormattedMessage,{id:"privateFeed.body"}))),q2=$X;var ZX=()=>{let[e,t]=useState([]),[o,r]=useState(!1),[n,i]=useState(null),[a,s]=useState(!1);function l(){return _(this,null,function*(){if(!o)try{r(!0);let f=yield FeedRepository.queryGlobalFeed({limit:10,queryToken:n||void 0});i(f.paging.next||null),t(y=>{let C=new Set([...y.map(h=>h.postId)]);return [...y,...f.data.filter(h=>!C.has(h.postId))]});}finally{r(!1);}})}useEffect(()=>(l(),()=>{t([]),i(null);}),[]);let d=f=>{t(y=>new Set([...y.map(h=>h.postId)]).has(f.postId)?y:[f,...y]);},p=f=>{let y=e.filter(C=>C.postId!==f);t(y);},u=useMemo(()=>n!==null,[n]);return {contents:e,isLoading:o,prependItem:d,removeItem:p,loadMore:()=>{s(!0),u&&!o&&l();},hasMore:u,loadMoreHasBeenCalled:a}},l_=ZX;var WX=10;function Mn({targetType:e,targetId:t,feedType:o,limit:r=WX}){let a=ze({fetcher:PostRepository.getPosts,params:{targetType:e,targetId:t,feedType:o,limit:r},shouldCall:!!t&&!!e}),{items:n}=a,i=M(a,["items"]);return c({posts:n},i)}function Cr(e,t){let n=ze({fetcher:CommunityRepository.getCommunities,params:e,shouldCall:t}),{items:o}=n,r=M(n,["items"]);return c({communities:o},r)}var XX=({className:e="",feedType:t,showPostCreator:o=!1,goToExplore:r,readonly:n=!1,isHiddenProfile:i=!1})=>{let{currentUserId:a}=
|
|
3035
|
+
`;var $X=()=>re.createElement(o_,null,re.createElement(r_,null,re.createElement(n_,null)),re.createElement(i_,null,re.createElement(FormattedMessage,{id:"privateFeed.title"})),re.createElement(a_,null,re.createElement(FormattedMessage,{id:"privateFeed.body"}))),q2=$X;var ZX=()=>{let[e,t]=useState([]),[o,r]=useState(!1),[n,i]=useState(null),[a,s]=useState(!1);function l(){return _(this,null,function*(){if(!o)try{r(!0);let f=yield FeedRepository.queryGlobalFeed({limit:10,queryToken:n||void 0});i(f.paging.next||null),t(y=>{let C=new Set([...y.map(h=>h.postId)]);return [...y,...f.data.filter(h=>!C.has(h.postId))]});}finally{r(!1);}})}useEffect(()=>(l(),()=>{t([]),i(null);}),[]);let d=f=>{t(y=>new Set([...y.map(h=>h.postId)]).has(f.postId)?y:[f,...y]);},p=f=>{let y=e.filter(C=>C.postId!==f);t(y);},u=useMemo(()=>n!==null,[n]);return {contents:e,isLoading:o,prependItem:d,removeItem:p,loadMore:()=>{s(!0),u&&!o&&l();},hasMore:u,loadMoreHasBeenCalled:a}},l_=ZX;var WX=10;function Mn({targetType:e,targetId:t,feedType:o,limit:r=WX}){let a=ze({fetcher:PostRepository.getPosts,params:{targetType:e,targetId:t,feedType:o,limit:r},shouldCall:!!t&&!!e}),{items:n}=a,i=M(a,["items"]);return c({posts:n},i)}function Cr(e,t){let n=ze({fetcher:CommunityRepository.getCommunities,params:e,shouldCall:t}),{items:o}=n,r=M(n,["items"]);return c({communities:o},r)}var XX=({className:e="",feedType:t,showPostCreator:o=!1,goToExplore:r,readonly:n=!1,isHiddenProfile:i=!1})=>{let{currentUserId:a}=X(),{isNoNicknameUser:s,isAnonymousUser:l}=Qe(),{contents:d,isLoading:p,loadMore:u,prependItem:g,removeItem:f,hasMore:y,loadMoreHasBeenCalled:C}=l_();function h(){return new Array(3).fill(3).map((v,b)=>re.createElement(gr,{key:b,loading:!0}))}return re.createElement(re.Fragment,null,o&&!s&&!l?re.createElement(Q2,{"data-qa-anchor":"feed-post-creator-textarea",targetType:"user",targetId:a||void 0,enablePostTargetPicker:!1,onCreateSuccess:v=>g(v)}):null,re.createElement(W2,{className:e,dataLength:d.length,next:u,hasMore:y,loader:null},i?re.createElement(q2,null):re.createElement(re.Fragment,null,(!p||C)&&re.createElement(To,{hasMore:y,loadMore:u,className:"load-more no-border",contentSlot:d.map(v=>re.createElement(Da,{key:v.postId,postId:v.postId,hidePostTarget:!1,readonly:n,onDeleted:b=>f(b)}))}),!p&&d.length===0&&re.createElement(Zs,{targetType:"global",goToExplore:r,canPost:o,feedType:t}),p?h():null)))},YX=({className:e="",feedType:t,targetType:o="myFeed",onPostCreated:r,goToExplore:n,readonly:i=!1,isHiddenProfile:a=!1})=>{let{currentUserId:s}=X(),l=s||void 0,{posts:d,hasMore:p,loadMore:u,isLoading:g,loadMoreHasBeenCalled:f}=Mn({targetType:"user",targetId:l,feedType:t}),{communities:y,hasMore:C,loadMore:h}=Cr({membership:"member"}),v=useCallback(()=>{h==null||h();},[h]);function b(){return new Array(3).fill(3).map((x,P)=>re.createElement(gr,{key:P,loading:!0}))}return re.createElement(re.Fragment,null,re.createElement(Q2,{"data-qa-anchor":"feed-post-creator-textarea",targetType:"user",targetId:l||void 0,communities:y,enablePostTargetPicker:!1,hasMoreCommunities:C,loadMoreCommunities:v,onCreateSuccess:r}),re.createElement(W2,{className:e,dataLength:d.length,next:u,hasMore:p,loader:null},a?re.createElement(q2,null):re.createElement(re.Fragment,null,(!g||f)&&re.createElement(To,{hasMore:p,loadMore:u,className:"load-more no-border",contentSlot:re.createElement(re.Fragment,null,d.map(x=>re.createElement(Da,{key:x.postId,postId:x.postId,hidePostTarget:!0,readonly:i})))}),!g&&d.length===0&&re.createElement(Zs,{targetType:o,goToExplore:n,canPost:!0,feedType:t}),g?b():null)))},RX=({className:e="",targetType:t,targetId:o="",feedType:r,showPostCreator:n=!1,onPostCreated:i,goToExplore:a,readonly:s=!1,isHiddenProfile:l=!1})=>{let{posts:d,hasMore:p,loadMore:u,isLoading:g,loadMoreHasBeenCalled:f,refresh:y}=Mn({targetType:t,targetId:o||void 0,feedType:r});useEffect(()=>{y();},[o,t]);function C(){return new Array(3).fill(3).map((h,v)=>re.createElement(gr,{key:v,loading:!0}))}return re.createElement(re.Fragment,null,n?re.createElement(Q2,{"data-qa-anchor":"feed-post-creator-textarea",targetType:t,targetId:o,enablePostTargetPicker:!1,onCreateSuccess:i}):null,re.createElement(W2,{className:e,dataLength:d.length,next:u,hasMore:p,loader:null},l?re.createElement(q2,null):re.createElement(re.Fragment,null,d.length>0&&re.createElement(To,{hasMore:p,loadMore:u,className:"load-more no-border",contentSlot:re.createElement(re.Fragment,null,d.map(h=>re.createElement(Da,{key:h.postId,postId:h.postId,hidePostTarget:!0,readonly:s})))}),!g&&d.length===0&&re.createElement(Zs,{targetType:t,goToExplore:a,canPost:n}),g?C():null)))},eY=({className:e="",feedType:t,targetType:o,targetId:r="",showPostCreator:n=!1,onPostCreated:i,goToExplore:a,readonly:s=!1,isHiddenProfile:l=!1})=>{let{posts:d,hasMore:p,loadMore:u,isLoading:g,loadMoreHasBeenCalled:f}=Mn({targetType:o,targetId:r||void 0,feedType:t}),{communities:y,hasMore:C,loadMore:h}=Cr({membership:"member"});function v(){return new Array(3).fill(3).map((b,x)=>re.createElement(gr,{key:x,loading:!0}))}return re.createElement(re.Fragment,null,n&&re.createElement(Q2,{"data-qa-anchor":"feed-post-creator-textarea",targetType:o,targetId:r,communities:y,enablePostTargetPicker:!1,hasMoreCommunities:C,loadMoreCommunities:h,onCreateSuccess:i}),re.createElement(W2,{className:e,dataLength:d.length,next:u,hasMore:p,loader:null},l?re.createElement(q2,null):re.createElement(re.Fragment,null,!g&&re.createElement(To,{hasMore:p,loadMore:u,className:"load-more no-border",contentSlot:re.createElement(re.Fragment,null,d.map(b=>re.createElement(Da,{key:b.postId,postId:b.postId,hidePostTarget:!0,readonly:s})))}),!g&&d.length===0&&re.createElement(Zs,{targetType:o,goToExplore:a,canPost:n,feedType:t}),g&&f?v():null)))},tY=e=>e==="communityFeed"?"community":e==="userFeed"?"user":e==="globalFeed"||e==="global"?"feed":e||"myFeed",oY=e=>{let n=e,{targetType:t}=n,o=M(n,["targetType"]),r=tY(t);return r==="feed"?re.createElement(XX,c({},o)):r==="myFeed"?re.createElement(YX,E(c({},o),{targetType:r})):r==="community"?re.createElement(RX,E(c({},o),{targetType:r})):re.createElement(eY,E(c({},o),{targetType:r}))},Ws=e=>{let t=j("Feed");return t?t(e):re.createElement(oY,c({},e))};var rY=m.div`
|
|
3036
3036
|
overflow: hidden;
|
|
3037
3037
|
display: grid;
|
|
3038
3038
|
grid-template-areas: 'side main' 'none main';
|
|
@@ -3350,7 +3350,7 @@ top: 40px;
|
|
|
3350
3350
|
color: #6e6e6e;
|
|
3351
3351
|
`,U_=m.p`
|
|
3352
3352
|
text-align: center;
|
|
3353
|
-
`;var uY=e=>{var t,o,r,n;return re.createElement("svg",c({width:(t=e.width)!=null?t:32,height:(o=e.height)!=null?o:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M16 26.7856C16.7969 26.7856 17.5 26.1294 17.5 25.2856H19C19 26.9731 17.6406 28.2856 16 28.2856C14.3125 28.2856 13 26.9731 13 25.2856H14.5C14.5 26.1294 15.1562 26.7856 16 26.7856ZM25.7969 19.9888C26.4531 20.645 26.6406 21.5825 26.3125 22.4263C25.9844 23.27 25.1406 23.7856 24.25 23.7856H7.75C6.8125 23.7856 5.96875 23.27 5.64062 22.4263C5.3125 21.5825 5.5 20.645 6.15625 19.9888C7.46875 18.77 8.45312 17.4575 8.45312 13.0044C8.45312 9.30127 11.4531 6.25439 15.25 5.87939V5.03564C15.25 4.66064 15.5781 4.28564 16 4.28564C16.375 4.28564 16.75 4.66064 16.75 5.03564V5.87939C20.5 6.25439 23.5 9.30127 23.5 13.0044C23.5 17.4575 24.4844 18.77 25.7969 19.9888ZM24.25 22.2856C24.9062 22.2856 25.2344 21.5356 24.7656 21.0669C23.125 19.52 22 17.7856 22 13.0044C22 9.86377 19.2812 7.28564 16 7.28564C12.6719 7.28564 9.95312 9.86377 9.95312 13.0044C9.95312 17.7856 8.82812 19.52 7.1875 21.0669C6.71875 21.5356 7.04688 22.2856 7.75 22.2856H24.25Z",fill:(r=e.color)!=null?r:"#000"}),re.createElement("path",{d:"M17.5 25.2856V25.1356H17.35V25.2856H17.5ZM19 25.2856H19.15V25.1356H19V25.2856ZM13 25.2856V25.1356H12.85V25.2856H13ZM14.5 25.2856H14.65V25.1356H14.5V25.2856ZM25.7969 19.9888L25.903 19.8826L25.8989 19.8789L25.7969 19.9888ZM6.15625 19.9888L6.05411 19.8788L6.05018 19.8827L6.15625 19.9888ZM15.25 5.87939L15.2647 6.02867L15.4 6.01531V5.87939H15.25ZM16.75 5.87939H16.6V6.01514L16.7351 6.02865L16.75 5.87939ZM24.7656 21.0669L24.8717 20.9608L24.8685 20.9578L24.7656 21.0669ZM7.1875 21.0669L7.08455 20.9577L7.08143 20.9608L7.1875 21.0669ZM16 26.9356C16.8767 26.9356 17.65 26.2153 17.65 25.2856H17.35C17.35 26.0435 16.7171 26.6356 16 26.6356V26.9356ZM17.5 25.4356H19V25.1356H17.5V25.4356ZM18.85 25.2856C18.85 26.8888 17.5593 28.1356 16 28.1356V28.4356C17.7219 28.4356 19.15 27.0575 19.15 25.2856H18.85ZM16 28.1356C14.3953 28.1356 13.15 26.8903 13.15 25.2856H12.85C12.85 27.056 14.2297 28.4356 16 28.4356V28.1356ZM13 25.4356H14.5V25.1356H13V25.4356ZM14.35 25.2856C14.35 26.2122 15.0734 26.9356 16 26.9356V26.6356C15.2391 26.6356 14.65 26.0466 14.65 25.2856H14.35ZM25.6908 20.0948C26.3047 20.7087 26.4794 21.5832 26.1727 22.3719L26.4523 22.4806C26.8018 21.5819 26.6016 20.5813 25.9029 19.8827L25.6908 20.0948ZM26.1727 22.3719C25.8693 23.152 25.0854 23.6356 24.25 23.6356V23.9356C25.1958 23.9356 26.0994 23.388 26.4523 22.4806L26.1727 22.3719ZM24.25 23.6356H7.75V23.9356H24.25V23.6356ZM7.75 23.6356C6.86586 23.6356 6.0832 23.1505 5.78043 22.3719L5.50082 22.4806C5.8543 23.3896 6.75914 23.9356 7.75 23.9356V23.6356ZM5.78043 22.3719C5.4737 21.5832 5.64844 20.7087 6.26232 20.0948L6.05018 19.8827C5.35156 20.5813 5.1513 21.5819 5.50082 22.4806L5.78043 22.3719ZM6.25832 20.0987C6.9225 19.4819 7.51458 18.8311 7.93636 17.7646C8.35629 16.7028 8.60312 15.2402 8.60312 13.0044H8.30313C8.30313 15.2217 8.05777 16.6419 7.65739 17.6543C7.25886 18.662 6.7025 19.2768 6.05418 19.8789L6.25832 20.0987ZM8.60312 13.0044C8.60312 9.38648 11.5363 6.39691 15.2647 6.02867L15.2353 5.73012C11.3699 6.11188 8.30313 9.21606 8.30313 13.0044H8.60312ZM15.4 5.87939V5.03564H15.1V5.87939H15.4ZM15.4 5.03564C15.4 4.73741 15.6669 4.43564 16 4.43564V4.13564C15.4893 4.13564 15.1 4.58388 15.1 5.03564H15.4ZM16 4.43564C16.1387 4.43564 16.29 4.50651 16.4096 4.62609C16.5291 4.74566 16.6 4.89693 16.6 5.03564H16.9C16.9 4.79936 16.7834 4.57563 16.6217 4.41395C16.46 4.25228 16.2363 4.13564 16 4.13564V4.43564ZM16.6 5.03564V5.87939H16.9V5.03564H16.6ZM16.7351 6.02865C20.4162 6.39676 23.35 9.38594 23.35 13.0044H23.65C23.65 9.2166 20.5838 6.11203 16.7649 5.73014L16.7351 6.02865ZM23.35 13.0044C23.35 15.2402 23.5968 16.7028 24.0168 17.7646C24.4385 18.8311 25.0306 19.4819 25.6948 20.0987L25.8989 19.8789C25.2506 19.2768 24.6943 18.662 24.2957 17.6543C23.8954 16.6419 23.65 15.2217 23.65 13.0044H23.35ZM24.25 22.4356C25.0335 22.4356 25.4394 21.5286 24.8717 20.9608L24.6596 21.173C25.0293 21.5427 24.779 22.1356 24.25 22.1356V22.4356ZM24.8685 20.9578C24.0577 20.1932 23.3825 19.3905 22.907 18.1932C22.4302 16.9926 22.15 15.3845 22.15 13.0044H21.85C21.85 15.4056 22.1323 17.0553 22.6282 18.3039C23.1253 19.5558 23.833 20.3937 24.6627 21.176L24.8685 20.9578ZM22.15 13.0044C22.15 9.774 19.357 7.13564 16 7.13564V7.43564C19.2055 7.43564 21.85 9.95354 21.85 13.0044H22.15ZM16 7.13564C12.5969 7.13564 9.80313 9.77327 9.80313 13.0044H10.1031C10.1031 9.95427 12.7468 7.43564 16 7.43564V7.13564ZM9.80313 13.0044C9.80313 15.3845 9.52292 16.9926 9.04614 18.1932C8.57066 19.3905 7.89547 20.1932 7.0846 20.9578L7.2904 21.176C8.12015 20.3937 8.82778 19.5558 9.32496 18.3039C9.82083 17.0553 10.1031 15.4056 10.1031 13.0044H9.80313ZM7.08143 20.9608C6.80211 21.2402 6.75604 21.6119 6.89263 21.9139C7.02897 22.2153 7.34129 22.4356 7.75 22.4356V22.1356C7.45558 22.1356 7.25228 21.981 7.16596 21.7902C7.07989 21.6 7.10414 21.3624 7.29357 21.173L7.08143 20.9608ZM7.75 22.4356H24.25V22.1356H7.75V22.4356Z",fill:(n=e.color)!=null?n:"#000"}))},I7=uY;var gY=e=>re.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},e),re.createElement("g",{"clip-path":"url(#clip0_5152_10658)"},re.createElement("circle",{cx:"5.99994",cy:"6",r:"5.5",fill:"#4D82FF",stroke:"white","stroke-width":"3"})),re.createElement("defs",null,re.createElement("clipPath",{id:"clip0_5152_10658"},re.createElement("rect",{width:"12",height:"12",rx:"6",fill:"white"})))),$_=gY;var V_=e=>{let o=Date.now()-e,r=60*1e3,n=60*r,i=24*n,a=30*i,s=365*i;if(o<r)return "now";if(o<n)return `${Math.floor(o/r)}m`;if(o<i)return `${Math.floor(o/n)}h`;if(o<a)return `${Math.floor(o/i)}d`;if(o<s){let g=new Date(e),f=g.getDate(),y=g.toLocaleString("default",{month:"short"});return `${f} ${y}`}let l=new Date(e),d=l.getDate(),p=l.toLocaleString("default",{month:"short"}),u=l.getFullYear();return `${d} ${p} ${u}`};var CY=({isHideUser:e=!1})=>{var k;let{currentUserId:t,client:o}=
|
|
3353
|
+
`;var uY=e=>{var t,o,r,n;return re.createElement("svg",c({width:(t=e.width)!=null?t:32,height:(o=e.height)!=null?o:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M16 26.7856C16.7969 26.7856 17.5 26.1294 17.5 25.2856H19C19 26.9731 17.6406 28.2856 16 28.2856C14.3125 28.2856 13 26.9731 13 25.2856H14.5C14.5 26.1294 15.1562 26.7856 16 26.7856ZM25.7969 19.9888C26.4531 20.645 26.6406 21.5825 26.3125 22.4263C25.9844 23.27 25.1406 23.7856 24.25 23.7856H7.75C6.8125 23.7856 5.96875 23.27 5.64062 22.4263C5.3125 21.5825 5.5 20.645 6.15625 19.9888C7.46875 18.77 8.45312 17.4575 8.45312 13.0044C8.45312 9.30127 11.4531 6.25439 15.25 5.87939V5.03564C15.25 4.66064 15.5781 4.28564 16 4.28564C16.375 4.28564 16.75 4.66064 16.75 5.03564V5.87939C20.5 6.25439 23.5 9.30127 23.5 13.0044C23.5 17.4575 24.4844 18.77 25.7969 19.9888ZM24.25 22.2856C24.9062 22.2856 25.2344 21.5356 24.7656 21.0669C23.125 19.52 22 17.7856 22 13.0044C22 9.86377 19.2812 7.28564 16 7.28564C12.6719 7.28564 9.95312 9.86377 9.95312 13.0044C9.95312 17.7856 8.82812 19.52 7.1875 21.0669C6.71875 21.5356 7.04688 22.2856 7.75 22.2856H24.25Z",fill:(r=e.color)!=null?r:"#000"}),re.createElement("path",{d:"M17.5 25.2856V25.1356H17.35V25.2856H17.5ZM19 25.2856H19.15V25.1356H19V25.2856ZM13 25.2856V25.1356H12.85V25.2856H13ZM14.5 25.2856H14.65V25.1356H14.5V25.2856ZM25.7969 19.9888L25.903 19.8826L25.8989 19.8789L25.7969 19.9888ZM6.15625 19.9888L6.05411 19.8788L6.05018 19.8827L6.15625 19.9888ZM15.25 5.87939L15.2647 6.02867L15.4 6.01531V5.87939H15.25ZM16.75 5.87939H16.6V6.01514L16.7351 6.02865L16.75 5.87939ZM24.7656 21.0669L24.8717 20.9608L24.8685 20.9578L24.7656 21.0669ZM7.1875 21.0669L7.08455 20.9577L7.08143 20.9608L7.1875 21.0669ZM16 26.9356C16.8767 26.9356 17.65 26.2153 17.65 25.2856H17.35C17.35 26.0435 16.7171 26.6356 16 26.6356V26.9356ZM17.5 25.4356H19V25.1356H17.5V25.4356ZM18.85 25.2856C18.85 26.8888 17.5593 28.1356 16 28.1356V28.4356C17.7219 28.4356 19.15 27.0575 19.15 25.2856H18.85ZM16 28.1356C14.3953 28.1356 13.15 26.8903 13.15 25.2856H12.85C12.85 27.056 14.2297 28.4356 16 28.4356V28.1356ZM13 25.4356H14.5V25.1356H13V25.4356ZM14.35 25.2856C14.35 26.2122 15.0734 26.9356 16 26.9356V26.6356C15.2391 26.6356 14.65 26.0466 14.65 25.2856H14.35ZM25.6908 20.0948C26.3047 20.7087 26.4794 21.5832 26.1727 22.3719L26.4523 22.4806C26.8018 21.5819 26.6016 20.5813 25.9029 19.8827L25.6908 20.0948ZM26.1727 22.3719C25.8693 23.152 25.0854 23.6356 24.25 23.6356V23.9356C25.1958 23.9356 26.0994 23.388 26.4523 22.4806L26.1727 22.3719ZM24.25 23.6356H7.75V23.9356H24.25V23.6356ZM7.75 23.6356C6.86586 23.6356 6.0832 23.1505 5.78043 22.3719L5.50082 22.4806C5.8543 23.3896 6.75914 23.9356 7.75 23.9356V23.6356ZM5.78043 22.3719C5.4737 21.5832 5.64844 20.7087 6.26232 20.0948L6.05018 19.8827C5.35156 20.5813 5.1513 21.5819 5.50082 22.4806L5.78043 22.3719ZM6.25832 20.0987C6.9225 19.4819 7.51458 18.8311 7.93636 17.7646C8.35629 16.7028 8.60312 15.2402 8.60312 13.0044H8.30313C8.30313 15.2217 8.05777 16.6419 7.65739 17.6543C7.25886 18.662 6.7025 19.2768 6.05418 19.8789L6.25832 20.0987ZM8.60312 13.0044C8.60312 9.38648 11.5363 6.39691 15.2647 6.02867L15.2353 5.73012C11.3699 6.11188 8.30313 9.21606 8.30313 13.0044H8.60312ZM15.4 5.87939V5.03564H15.1V5.87939H15.4ZM15.4 5.03564C15.4 4.73741 15.6669 4.43564 16 4.43564V4.13564C15.4893 4.13564 15.1 4.58388 15.1 5.03564H15.4ZM16 4.43564C16.1387 4.43564 16.29 4.50651 16.4096 4.62609C16.5291 4.74566 16.6 4.89693 16.6 5.03564H16.9C16.9 4.79936 16.7834 4.57563 16.6217 4.41395C16.46 4.25228 16.2363 4.13564 16 4.13564V4.43564ZM16.6 5.03564V5.87939H16.9V5.03564H16.6ZM16.7351 6.02865C20.4162 6.39676 23.35 9.38594 23.35 13.0044H23.65C23.65 9.2166 20.5838 6.11203 16.7649 5.73014L16.7351 6.02865ZM23.35 13.0044C23.35 15.2402 23.5968 16.7028 24.0168 17.7646C24.4385 18.8311 25.0306 19.4819 25.6948 20.0987L25.8989 19.8789C25.2506 19.2768 24.6943 18.662 24.2957 17.6543C23.8954 16.6419 23.65 15.2217 23.65 13.0044H23.35ZM24.25 22.4356C25.0335 22.4356 25.4394 21.5286 24.8717 20.9608L24.6596 21.173C25.0293 21.5427 24.779 22.1356 24.25 22.1356V22.4356ZM24.8685 20.9578C24.0577 20.1932 23.3825 19.3905 22.907 18.1932C22.4302 16.9926 22.15 15.3845 22.15 13.0044H21.85C21.85 15.4056 22.1323 17.0553 22.6282 18.3039C23.1253 19.5558 23.833 20.3937 24.6627 21.176L24.8685 20.9578ZM22.15 13.0044C22.15 9.774 19.357 7.13564 16 7.13564V7.43564C19.2055 7.43564 21.85 9.95354 21.85 13.0044H22.15ZM16 7.13564C12.5969 7.13564 9.80313 9.77327 9.80313 13.0044H10.1031C10.1031 9.95427 12.7468 7.43564 16 7.43564V7.13564ZM9.80313 13.0044C9.80313 15.3845 9.52292 16.9926 9.04614 18.1932C8.57066 19.3905 7.89547 20.1932 7.0846 20.9578L7.2904 21.176C8.12015 20.3937 8.82778 19.5558 9.32496 18.3039C9.82083 17.0553 10.1031 15.4056 10.1031 13.0044H9.80313ZM7.08143 20.9608C6.80211 21.2402 6.75604 21.6119 6.89263 21.9139C7.02897 22.2153 7.34129 22.4356 7.75 22.4356V22.1356C7.45558 22.1356 7.25228 21.981 7.16596 21.7902C7.07989 21.6 7.10414 21.3624 7.29357 21.173L7.08143 20.9608ZM7.75 22.4356H24.25V22.1356H7.75V22.4356Z",fill:(n=e.color)!=null?n:"#000"}))},I7=uY;var gY=e=>re.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},e),re.createElement("g",{"clip-path":"url(#clip0_5152_10658)"},re.createElement("circle",{cx:"5.99994",cy:"6",r:"5.5",fill:"#4D82FF",stroke:"white","stroke-width":"3"})),re.createElement("defs",null,re.createElement("clipPath",{id:"clip0_5152_10658"},re.createElement("rect",{width:"12",height:"12",rx:"6",fill:"white"})))),$_=gY;var V_=e=>{let o=Date.now()-e,r=60*1e3,n=60*r,i=24*n,a=30*i,s=365*i;if(o<r)return "now";if(o<n)return `${Math.floor(o/r)}m`;if(o<i)return `${Math.floor(o/n)}h`;if(o<a)return `${Math.floor(o/i)}d`;if(o<s){let g=new Date(e),f=g.getDate(),y=g.toLocaleString("default",{month:"short"});return `${f} ${y}`}let l=new Date(e),d=l.getDate(),p=l.toLocaleString("default",{month:"short"}),u=l.getFullYear();return `${d} ${p} ${u}`};var CY=({isHideUser:e=!1})=>{var k;let{currentUserId:t,client:o}=X(),r=oe(t),{onClickUser:n,onClickNoti:i}=J(),{isAnonymousUser:a,isNoNicknameUser:s}=Qe(),[l,d]=useState([]),[p,u]=useState(!1),[g,f]=useState(!1),y=useRef(null),[C,h]=useState(window.innerWidth),v=()=>{h(window.innerWidth);};useEffect(()=>(window.addEventListener("resize",v),()=>{window.removeEventListener("resize",v);}),[]);let b=()=>{f(!g);},x=useCallback(()=>_(void 0,null,function*(){var S;if((S=o==null?void 0:o.token)!=null&&S.accessToken)try{let A=yield fetch("https://beta.amity.services/notifications/v3/history",{method:"GET",headers:{Authorization:`Bearer ${o.token.accessToken}`}}),{data:D}=yield A.json(),z=D.map(V=>{if(V.verb==="mentreact"){let N=c({},V),O=V.targetName?" in "+V.targetName:"";return N.description=N.description+O,N}else return V});d(z);}catch(A){console.error("Error fetching notifications:",A);}}),[o]),P=S=>_(void 0,null,function*(){var z;let A="",D=[...l];D[S].hasRead=!0,d(D),f(!1),D[S].targetType==="comment"?A=D[S].parentTargetId:A=D[S].targetId,i&&i(A,D[S].targetType),yield fetch("https://beta.amity.services/notifications/v2/read",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${(z=o==null?void 0:o.token)==null?void 0:z.accessToken}`},body:JSON.stringify({verb:D[S].verb,targetId:D[S].targetId})});});useEffect(()=>{if(l){let S=l.some(A=>A.hasRead===!1);u(S);}},[l]);let I=S=>{y.current&&!y.current.contains(S.target)&&f(!1);};useEffect(()=>(document.addEventListener("mousedown",I),()=>{document.removeEventListener("mousedown",I);}),[]),useEffect(()=>{var S;(S=o==null?void 0:o.token)!=null&&S.accessToken&&x();},[o,x]);let w=()=>l.length>0?re.createElement(E_,null,l==null?void 0:l.map((S,A)=>re.createElement(N_,{onClick:()=>P(A),hasRead:S.hasRead},re.createElement(A_,null,re.createElement(L_,null,re.createElement(ge,{avatar:S.imageUrl,backgroundImage:Ee})),re.createElement(T_,null,re.createElement(xY,{text:S.description,keywords:vY}))),re.createElement(k_,null,V_(S.lastUpdate))))):re.createElement(F_,null,re.createElement(U_,null,re.createElement(I7,{width:48,height:48,color:"#6E6E6E"}),re.createElement(O_,null,"No notifications"),re.createElement(z_,null,"You're up to date!")));return a||s?null:re.createElement(h_,null,re.createElement(w_,{onClick:b},re.createElement(I7,null),re.createElement($_,{style:{position:"absolute",right:"10%",top:"10%",display:p?"":"none"}})),re.createElement(bY,{isNoNotification:l.length==0,ref:y,visible:g,onClose:b},(l.length>0||l.length===0&&C<768)&&re.createElement(S_,null,re.createElement(__,{onClick:()=>f(!1)},re.createElement(Lr,{style:{marginRight:12},width:24,height:20})),"Notifications"),re.createElement(P_,null,re.createElement(w,null)),re.createElement(B_,null)),!e&&re.createElement("div",{onClick:()=>n(t)},re.createElement("div",{style:{width:32,height:32}},re.createElement(ge,{size:"small",avatar:(k=r==null?void 0:r.avatar)==null?void 0:k.fileUrl,backgroundImage:Ee}))))},Ap=CY,vY=["posted","commented","added a reaction","replied","mentioned","added reactions"],xY=({text:e,keywords:t})=>{let o=t.sort((i,a)=>a.length-i.length),r=new RegExp(`(${o.join("|")})`,"gi"),n=e.split(r);return re.createElement("span",null,n.map((i,a)=>{let s=o.includes(i.toLowerCase());return re.createElement("span",{key:a,style:{color:s?"#0E3AC9":"black"}},i)}))},bY=forwardRef(({visible:e,isNoNotification:t=!0,children:o},r)=>re.createElement(M_,{isNoNotification:t,ref:r,visible:e},o));var j_=m.div`
|
|
3354
3354
|
display: flex;
|
|
3355
3355
|
justify-content: space-between;
|
|
3356
3356
|
align-items: center;
|
|
@@ -3361,7 +3361,7 @@ top: 40px;
|
|
|
3361
3361
|
font-weight: 500;
|
|
3362
3362
|
line-height: 24px;
|
|
3363
3363
|
letter-spacing: 0.03px;
|
|
3364
|
-
`;var IY=e=>re.createElement("svg",c({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M16.6562 8.5625C16.5391 8.48438 16.4609 8.40625 16.4609 8.28906C16.4609 8.13281 16.5391 8.05469 16.6562 7.97656L19 7L19.9375 4.69531C20.0156 4.57812 20.0938 4.5 20.2109 4.5C20.3672 4.5 20.4453 4.57812 20.5234 4.69531L21.5 7L23.8047 7.97656C23.9219 8.05469 24 8.13281 24 8.25C24 8.40625 23.9219 8.48438 23.8047 8.5625L21.5 9.5L20.5234 11.8438C20.4453 11.9609 20.3672 12.0391 20.25 12.0391C20.0938 12.0391 20.0156 11.9609 19.9375 11.8438L19 9.5L16.6562 8.5625ZM23.8047 20.4766C23.9219 20.5547 24 20.6328 24 20.75C24 20.9062 23.9219 20.9844 23.8047 21.0625L21.5 22L20.5234 24.3438C20.4453 24.4609 20.3672 24.5391 20.25 24.5391C20.0938 24.5391 20.0156 24.4609 19.9375 24.3438L19 22L16.6562 21.0625C16.5391 20.9844 16.4609 20.9062 16.4609 20.7891C16.4609 20.6328 16.5391 20.5547 16.6562 20.4766L19 19.5L19.9375 17.1953C20.0156 17.0781 20.0938 17 20.2109 17C20.3672 17 20.4453 17.0781 20.5234 17.1953L21.5 19.5L23.8047 20.4766ZM19 14.5C18.9609 14.8906 18.7656 15.2031 18.4531 15.3594L14.3516 17.3906L12.3203 21.4922C12.1641 21.8047 11.8516 22.0391 11.5 22.0391C11.1094 22.0391 10.7969 21.8047 10.6406 21.4922L8.60938 17.3906L4.50781 15.3594C4.19531 15.2031 3.96094 14.8906 3.96094 14.5391C3.96094 14.1484 4.19531 13.8359 4.50781 13.6797L8.60938 11.6484L10.6406 7.54688C10.9531 6.92188 12.0078 6.92188 12.3203 7.54688L14.3516 11.6484L18.4531 13.6797C18.7656 13.8359 18.9609 14.1484 19 14.5ZM13.2578 15.8672L15.9531 14.5L13.2578 13.1719C13.0625 13.0938 12.9062 12.9375 12.8281 12.7422L11.5 10.0469L10.1328 12.7422C10.0547 12.9375 9.89844 13.0938 9.70312 13.1719L7.00781 14.5L9.70312 15.8672C9.89844 15.9453 10.0547 16.1016 10.1328 16.2969L11.5 18.9922L12.8281 16.2969C12.9062 16.1016 13.0625 15.9453 13.2578 15.8672Z",fill:"black"})),Q_=IY;var wY=m(L4).attrs({width:20,height:20})``,MY=m(Q_).attrs({width:28,height:28})``,PY=({shouldHideExplore:e,children:t})=>{var p;let{onChangePage:o,page:r}=J(),{onClickUser:n}=J(),{currentUserId:i}=
|
|
3364
|
+
`;var IY=e=>re.createElement("svg",c({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M16.6562 8.5625C16.5391 8.48438 16.4609 8.40625 16.4609 8.28906C16.4609 8.13281 16.5391 8.05469 16.6562 7.97656L19 7L19.9375 4.69531C20.0156 4.57812 20.0938 4.5 20.2109 4.5C20.3672 4.5 20.4453 4.57812 20.5234 4.69531L21.5 7L23.8047 7.97656C23.9219 8.05469 24 8.13281 24 8.25C24 8.40625 23.9219 8.48438 23.8047 8.5625L21.5 9.5L20.5234 11.8438C20.4453 11.9609 20.3672 12.0391 20.25 12.0391C20.0938 12.0391 20.0156 11.9609 19.9375 11.8438L19 9.5L16.6562 8.5625ZM23.8047 20.4766C23.9219 20.5547 24 20.6328 24 20.75C24 20.9062 23.9219 20.9844 23.8047 21.0625L21.5 22L20.5234 24.3438C20.4453 24.4609 20.3672 24.5391 20.25 24.5391C20.0938 24.5391 20.0156 24.4609 19.9375 24.3438L19 22L16.6562 21.0625C16.5391 20.9844 16.4609 20.9062 16.4609 20.7891C16.4609 20.6328 16.5391 20.5547 16.6562 20.4766L19 19.5L19.9375 17.1953C20.0156 17.0781 20.0938 17 20.2109 17C20.3672 17 20.4453 17.0781 20.5234 17.1953L21.5 19.5L23.8047 20.4766ZM19 14.5C18.9609 14.8906 18.7656 15.2031 18.4531 15.3594L14.3516 17.3906L12.3203 21.4922C12.1641 21.8047 11.8516 22.0391 11.5 22.0391C11.1094 22.0391 10.7969 21.8047 10.6406 21.4922L8.60938 17.3906L4.50781 15.3594C4.19531 15.2031 3.96094 14.8906 3.96094 14.5391C3.96094 14.1484 4.19531 13.8359 4.50781 13.6797L8.60938 11.6484L10.6406 7.54688C10.9531 6.92188 12.0078 6.92188 12.3203 7.54688L14.3516 11.6484L18.4531 13.6797C18.7656 13.8359 18.9609 14.1484 19 14.5ZM13.2578 15.8672L15.9531 14.5L13.2578 13.1719C13.0625 13.0938 12.9062 12.9375 12.8281 12.7422L11.5 10.0469L10.1328 12.7422C10.0547 12.9375 9.89844 13.0938 9.70312 13.1719L7.00781 14.5L9.70312 15.8672C9.89844 15.9453 10.0547 16.1016 10.1328 16.2969L11.5 18.9922L12.8281 16.2969C12.9062 16.1016 13.0625 15.9453 13.2578 15.8672Z",fill:"black"})),Q_=IY;var wY=m(L4).attrs({width:20,height:20})``,MY=m(Q_).attrs({width:28,height:28})``,PY=({shouldHideExplore:e,children:t})=>{var p;let{onChangePage:o,page:r}=J(),{onClickUser:n}=J(),{currentUserId:i}=X(),{isLoading:a,isAnonymousUser:s,isNoNicknameUser:l}=Qe(),d=oe(i);return a?null:re.createElement(Np,null,re.createElement(j_,null,re.createElement(G_,null,re.createElement(FormattedMessage,{id:"sidesectioncommunity.community"})),re.createElement(Ap,{isHideUser:!0})),!s&&!l&&re.createElement(Ep,{"data-qa-anchor":"side-section-community-side-menu-action-item-user-feed-button",icon:re.createElement(ge,{size:"small",avatar:(p=d==null?void 0:d.avatar)==null?void 0:p.fileUrl,backgroundImage:Ee}),active:r.type==="userfeed",onClick:()=>n(i)},re.createElement(FormattedMessage,{id:"sidesectioncommunity.userProfile"})),!e&&re.createElement(Ep,{"data-qa-anchor":"side-section-community-side-menu-action-item-explore-button",icon:re.createElement(MY,null),active:r.type==="explore",onClick:()=>o("explore")},re.createElement(FormattedMessage,{id:"sidesectioncommunity.explore"})),!s&&!l&&re.createElement(Ep,{"data-qa-anchor":"side-section-community-side-menu-action-item-news-feed-button",icon:re.createElement(wY,null),active:r.type==="newsfeed",onClick:()=>o("newsfeed")},re.createElement(FormattedMessage,{id:"sidesectioncommunity.newfeed"})),t)},W_=PY;var q_=m.span`
|
|
3365
3365
|
${({theme:e,highlight:t})=>t?e.typography.bodyBold:e.typography.body}
|
|
3366
3366
|
`,_Y=({query:e,text:t})=>{if(e==null||(e==null?void 0:e.length)===0)return re.createElement(q_,null,t);let o=t.split(new RegExp(`(${e})`,"gi"));return re.createElement("span",null,o.map((r,n)=>re.createElement(q_,{key:`#${r}#${n}`,highlight:r.toLowerCase()===e.toLowerCase()},r)))},M7=_Y;var K_=m(_i).attrs({width:16,height:16})`
|
|
3367
3367
|
margin-right: 8px;
|
|
@@ -3437,7 +3437,7 @@ top: 40px;
|
|
|
3437
3437
|
grid-area: avatar;
|
|
3438
3438
|
`,oS=m.div`
|
|
3439
3439
|
grid-area: children;
|
|
3440
|
-
`;var rS={community__category:"U"};var nS={communityCategoryName:"fa"};function Ha({pageId:e="*",componentId:t="*",categoryName:o}){let r="community_category_name",{accessibilityId:n,isExcluded:i,themeStyles:a}=L({pageId:e,componentId:t,elementId:r});return i?null:re.createElement("div",{className:nS.communityCategoryName,style:a,"data-qa-anchor":n},o)}var Pn=({pageId:e="*",componentId:t="*",categories:o,maxCategories:r})=>{let n="community_category",{config:i,themeStyles:a,accessibilityId:s,isExcluded:l}=L({pageId:e,componentId:t,elementId:n});if(l)return null;let d=o.slice(0,2),p=Math.max(0,o.length-d.length);return re.createElement("div",{"data-qa-anchor":s,style:a,className:rS.community__category},typeof r=="number"?re.createElement(re.Fragment,null,d.map(u=>re.createElement(Ha,{categoryName:u.name})),p>0&&re.createElement(Ha,{categoryName:`+${p}`})):o.map(u=>re.createElement(Ha,{key:u.categoryId,categoryName:u.name})))};function zY({fetcher:e,params:t,callback:o=()=>{},config:r,shouldCall:n=!0}){let{subscribe:i}=h0(),[a,s]=useState(!1),[l,d]=useState(n||!0),[p,u]=useState([]),[g,f]=useState(null),[y,C]=useState(!1),h=useRef(null),v=useCallback(()=>{var x;h.current&&(s(!0),(x=h.current)==null||x.call(h));},[h,a,l,d]),b=useCallback(x=>{n&&(x.data&&u(x.data),d(x.loading),C(x.hasNextPage),f(x.error),h.current=x.onNextPage,o(x));},[n,h]);return useEffect(()=>{if(!n)return;let{unsubscribe:x}=i({fetcher:e,params:t,callback:b});return ()=>{x();}},[t,n]),{items:p,hasMore:y,isLoading:l,loadMore:v,error:g,loadMoreHasBeenCalled:a}}var nt=zY;var aS=e=>{let r=nt({fetcher:ReactionRepository.getReactions,params:e,shouldCall:!!e.referenceId&&!!e.referenceType}),{items:t}=r,o=M(r,["items"]);return c({reactions:t},o)};var _7=(e,t=[])=>{let o=(e==null?void 0:e.length)||0,r=[],n=(i,a,s)=>{r.push({start:i,end:a,highlight:s});};if(!t||(t==null?void 0:t.length)===0)n(0,o,!1);else {let i=0;t.forEach(a=>{n(i,a.start,!1),n(a.start,a.end,!0),i=a.end;}),n(i,o,!1);}return r};var $Y=1;function S7(e){return e?e.sort((o,r)=>o.index-r.index).map(({index:o,length:r})=>({start:o,end:o+r+$Y,highlight:!0})):[]}function Yr(e){return e!=null}function sS(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}function lS(e){return e*parseFloat(getComputedStyle(document.documentElement).fontSize)}var VY=new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/);function mS(e){return e==="https://"||VY.test(e)}var Bl,Ll,Hp,cS,J2,T7,qs=class qs{constructor(){bo(this,Hp);bo(this,J2);bo(this,Bl,void 0);ga(this,Bl,new Map);}static get instance(){return $o(qs,Ll)||ga(qs,Ll,new qs),$o(qs,Ll)}hasReachedLimit(t){let o=Br(this,J2,T7).call(this,t);return $o(this,Bl).get(t)===o}markSeen(t){$o(this,Bl).set(t,Br(this,J2,T7).call(this,t));}};Bl=new WeakMap,Ll=new WeakMap,Hp=new WeakSet,cS=function(t){let o=Dr.instance.getAdFrequencyByPlacement(t);return o==null||o.type!=="time-window"?0:o.value},J2=new WeakSet,T7=function(t){let o=on(),r=o.startOf("day").diff(o,"minute"),n=Math.ceil(r/Br(this,Hp,cS).call(this,t));return `${o.format("DD-MM-YYYY")}-${n}`},bo(qs,Ll,void 0);var Al=qs;var Dl,X2,Y2,k7,Ks=class Ks{constructor(){bo(this,Y2);bo(this,X2,"amity.seenRecencyCache");}static get instance(){return $o(Ks,Dl)||ga(Ks,Dl,new Ks),$o(Ks,Dl)}getSeenRecencyByAdId(t){return Br(this,Y2,k7).call(this)[t]}setSeenRecencyCache(t,o){let r=Br(this,Y2,k7).call(this);r[t]=o,window.localStorage.setItem($o(this,X2),JSON.stringify(r));}};Dl=new WeakMap,X2=new WeakMap,Y2=new WeakSet,k7=function(){return JSON.parse(window.localStorage.getItem($o(this,X2))||"{}")},bo(Ks,Dl,void 0);var Fp=Ks,Hl,R2,N7,Js=class Js{constructor(){bo(this,R2);this.isLoading=!0;this.ads=[];this.settings=null;this.subscribers=[];Client.onSessionStateChange(t=>_(this,null,function*(){if(t==="established"){let o=yield AdRepository.getNetworkAds();this.ads=o.ads,this.settings=o.settings,this.subscribers.forEach(r=>r(o)),this.isLoading=!1;}else t==="terminated"&&(this.ads=[],this.settings=null,this.subscribers.forEach(o=>o(null)));}));}static get instance(){return $o(Js,Hl)||ga(Js,Hl,new Js),$o(Js,Hl)}onNetworkAdsData(t){!this.isLoading&&this.ads.length>0&&this.settings&&t({ads:this.ads,settings:this.settings}),this.subscribers.push(t);}getLastSeen(t){return Fp.instance.getSeenRecencyByAdId(t)}markSeen(t,o){var r;Fp.instance.setSeenRecencyCache(t.adId,Date.now()),((r=Br(this,R2,N7).call(this,o))==null?void 0:r.type)==="time-window"&&Al.instance.markSeen(o),t.analytics.markAsSeen(o);}markClicked(t,o){t.analytics.markLinkAsClicked(o);}getAdFrequencyByPlacement(t){return Br(this,R2,N7).call(this,t)}};Hl=new WeakMap,R2=new WeakSet,N7=function(t){if(!this.settings)return null;switch(t){case"feed":return this.settings.frequency.feed;case"comment":return this.settings.frequency.comment;case"story":return this.settings.frequency.story;default:return null}},bo(Js,Hl,void 0);var Dr=Js;var Fl,zp,dS,Up,pS,$p,uS,Xs=class Xs{constructor(){bo(this,zp);bo(this,Up);bo(this,$p);}static get instance(){return $o(Xs,Fl)||ga(Xs,Fl,new Xs),$o(Xs,Fl)}recommendedAds({ads:t,placement:o,count:r,communityId:n}){let i=Br(this,zp,dS).call(this,t),a=new Map;return t.forEach(s=>{var u;let l=(((u=s.targets)==null?void 0:u.communityIds)||[]).includes(n||"")?1:0,d=i.get(s.adId);if(d==null)return;let p=l+Math.pow(Math.E,2*d);a.set(s.adId,p);}),Br(this,$p,uS).call(this,{ads:t,scores:a,count:r})}};Fl=new WeakMap,zp=new WeakSet,dS=function(t){let o=t.sort((a,s)=>Dr.instance.getLastSeen(s.adId)-Dr.instance.getLastSeen(a.adId)),r=new Map,n=Dr.instance.getLastSeen(o[o.length-1].adId);return Dr.instance.getLastSeen(o[0].adId)===n?o.forEach(a=>{r.set(a.adId,1);}):o.forEach((a,s)=>{let l=s/o.length;r.set(a.adId,l);}),r},Up=new WeakSet,pS=function(t){let o=0,r=Math.random();for(let n=0;n<t.length;n++)if(o+=t[n],r<o)return n;return t.length-1},$p=new WeakSet,uS=function({ads:t,scores:o,count:r}){let n=[...t],i=[];for(;i.length<r&&n.length>0;){let a=n.reduce((p,u)=>p+(o.get(u.adId)||0),0),s=n.map(p=>(o.get(p.adId)||0)/a),l=s.map(p=>p/s.reduce((u,g)=>u+g,0)),d=Br(this,Up,pS).call(this,l);i.push(n[d]),n.splice(d,1);}return i},bo(Xs,Fl,void 0);var Op=Xs;var fS=createContext({isLoading:!0,ads:[],settings:null,saveItemsPagination:()=>{},getItemsPaginationCache:()=>{}});var E7=()=>useContext(fS).settings,yS=({count:e,placement:t,communityId:o})=>{let n=useContext(fS).ads,[i,a]=useState([]),s=E7(),l=Dr.instance.getAdFrequencyByPlacement(t);return useEffect(()=>{s!=null&&s.enabled&&((l==null?void 0:l.type)==="time-window"&&Al.instance.hasReachedLimit(t)||a(Op.instance.recommendedAds({ads:n,placement:t,count:e,communityId:o})));},[n,e,t,o]),i};var JY=({placement:e,pageSize:t,communityId:o,getItemId:r})=>{let n=E7(),[i,a]=useState(0),[s,l]=useState([]),[d,p]=useState(0),u=Dr.instance.getAdFrequencyByPlacement(e),g=(u==null?void 0:u.type)==="fixed"?t/u.value:1,f=yS({count:g,placement:e,communityId:o});return {combineItemsWithAds:h=>{if(!(n!=null&&n.enabled))return h;if((u==null?void 0:u.type)==="fixed"){let v=new Set(h.map(V=>r(V))),b=s.map(V=>{let N=r(V[0]);if(!v.has(N))return null;let O=h.find(K=>r(K)===N);return O?V.length===1?[O]:[O,V[1]]:V}).filter(Yr),x=b[0],P=(()=>{if(x){let V=h.findIndex(N=>r(N)===r(x[0]));return V===-1?0:V}return 0})(),w=[...(h||[]).slice(0,P).map(V=>[V]),...b],k=h.slice(P).filter(V=>{let N=r(V);return !w.some(O=>r(O[0])===N)}),S=i,A=d,D=k.map(V=>{if(A=A+1,!(A%u.value===0))return [V];let O=f[S];return S=S+1>f.length-1?0:S+1,[V,O]});a(S),p(A);let z=[...w,...D];return l([...w,...D]),z.length===0&&(a(0),p(0)),[...w,...D].flatMap(V=>V)}else if((u==null?void 0:u.type)==="time-window")return h.length===0?h:[...h.slice(0,1),f[0],...h.slice(1)].filter(Yr);return h},reset:()=>{a(0),l([]),p(0);}}},ec=({fetcher:e,params:t,callback:o=()=>{},config:r,shouldCall:n=!0,placement:i,communityId:a,pageSize:s,getItemId:l})=>{let{combineItemsWithAds:d}=JY({placement:i,pageSize:s,communityId:a,getItemId:l}),f=nt({fetcher:e,params:t,config:r,shouldCall:n}),{items:p}=f,u=M(f,["items"]),g=useMemo(()=>d(p).flatMap(y=>y),[p]);return E(c({},u),{items:g})};var Ui=e=>{let r=ec({fetcher:StoryRepository.getActiveStoriesByTarget,params:e,shouldCall:!0,pageSize:10,placement:"story",getItemId:n=>(n==null?void 0:n.storyId)||""}),{items:t}=r,o=M(r,["items"]);return c({stories:t.filter(Yr)},o)};var A7=e=>{let t=Mo(),[o,r]=useState(!1),{data:n,isLoading:i,refetch:a}=useQuery({queryKey:["asc-uikit","CommentRepository","isCommentFlaggedByMe",e],queryFn:()=>CommentRepository.isCommentFlaggedByMe(e),enabled:e!=null});useEffect(()=>{n!=null&&r(n);},[n]);let s=()=>_(void 0,null,function*(){if(e!=null)try{r(!0),yield CommentRepository.flagComment(e);}catch(p){r(!1);}finally{a();}}),l=()=>_(void 0,null,function*(){if(e!=null)try{r(!1),yield CommentRepository.unflagComment(e);}catch(p){r(!0);}finally{a();}});return {isLoading:i,isFlaggedByMe:o,flagComment:s,unflagComment:l,toggleFlagComment:p=>_(void 0,null,function*(){if(e!=null)if(o){if(yield l(),p!=null&&p.onUnFlagSuccss)return p.onUnFlagSuccss();t.success({content:"Comment unreported"});}else {if(yield s(),p!=null&&p.onFlagSuccess)return p.onFlagSuccess();t.success({content:"Comment reported"});}})}};var tc=(i=>(i.MEMBER="member",i.MODERATOR="moderator",i.SUPER_MODERATOR="super-moderator",i.COMMUNITY_MODERATOR="community-moderator",i.CHANNEL_MODERATOR="channel-moderator",i))(tc||{});var{COMMUNITY_MODERATOR:oR}=tc;function Ol({communityId:e,shouldCall:t=!0}){let n=nt({fetcher:CommunityRepository.Membership.getMembers,params:{communityId:e,roles:[oR]},shouldCall:!!e&&t}),{items:o}=n,r=M(n,["items"]);return c({moderators:o},r)}var rR=({community:e})=>{var p,u,g,f;let{currentUserId:t}=Y(),{moderators:o}=Li(e==null?void 0:e.communityId),{client:r}=Y(),i=o.find(y=>y.userId===t)!=null;if(e==null)return {isModerator:i,canEdit:!1,canEditPost:!1,canReviewPost:!1,canEditUser:!1};let a=(p=r==null?void 0:r.hasPermission(lr.EditCommunityPermission).community(e.communityId))!=null?p:!1,s=(u=r==null?void 0:r.hasPermission(lr.EditCommunityFeedPostPermission).community(e==null?void 0:e.communityId))!=null?u:!1,l=(g=r==null?void 0:r.hasPermission(lr.ReviewCommunityPost).community(e.communityId))!=null?g:!1,d=(f=r==null?void 0:r.hasPermission(lr.EditCommunityUserPermission).community(e.communityId))!=null?f:!1;return {isModerator:i,canEdit:a,canEditPost:s,canReviewPost:l,canEditUser:d}},Fa=rR;var aR=e=>{let{data:t}=useQuery({queryKey:["asc-uikit","FileRepository","getFile",e],queryFn:()=>FileRepository.getFile(e),enabled:!!e});return t==null?void 0:t.data},hS=aR;var it=({fileId:e,imageSize:t="medium"})=>{let o=hS(e),[r,n]=useState(void 0);return useEffect(()=>{if(o==null||e==null){n(void 0);return}function i(){return _(this,null,function*(){if((o==null?void 0:o.fileUrl)==null)return;let a=FileRepository.fileUrlWithSize(o==null?void 0:o.fileUrl,t);n(a);})}i();},[o,t]),r};function uR({fetcher:e,params:t,callback:o=()=>{},options:r,shouldCall:n=!0,getSubscribedTopic:i}){let{subscribe:a}=r6(),[s,l]=useState(null),[d,p]=useState(void 0),[u,g]=useState(!1),[f,y]=useState(null),C=useRef(null),h=useCallback(v=>{n&&t!=null&&(g(v.loading),v.data&&l(v.data),p(v.origin),y(v.error),o(v));},[n,o]);return useEffect(()=>(i&&(C.current=subscribeTopic(i())),()=>{var v;(v=C.current)==null||v.call(C);}),[i]),useEffect(()=>{if(t==null||!n)return;let{unsubscribe:v}=a({fetcher:e,params:t,callback:h,options:r});return ()=>{v();}},[t,n]),{item:s,origin:d,isLoading:u||s==null&&f==null,error:f}}var Qo=uR;var fR=({communityId:e,shouldCall:t=!0})=>{let n=Qo({fetcher:CommunityRepository.getCommunity,params:e,shouldCall:t&&!!e}),{item:o}=n,r=M(n,["item"]);return c({community:o},r)},co=fR;var vR=e=>{let[t,o]=useState([]);return useEffect(()=>{function r(){return _(this,null,function*(){if(e==null||e.length===0)return;let n=yield Promise.all(e.map(i=>_(this,null,function*(){return (yield CategoryRepository.getCategory(i)).data})));o(n);})}r();},[e]),t},oc=vR;var vS={page:{type:"SocialHomePage",context:{communityId:void 0}},onChangePage:e=>{},onClickCategory:e=>{},onClickCommunity:e=>{},onClickUser:e=>{},onCommunityCreated:e=>{},onEditCommunity:e=>{},onEditUser:e=>{},onMessageUser:e=>{},goToUserProfilePage:e=>{},goToPostDetailPage:(e,t,o)=>{},goToViewStoryPage:e=>{},goToDraftStoryPage:(e,t,o,r)=>{},goToCommunityProfilePage:e=>{},goToSocialGlobalSearchPage:e=>{},goToSelectPostTargetPage:()=>{},goToStoryTargetSelectionPage:()=>{},goToPostComposerPage:()=>{},goToStoryCreationPage:()=>{},goToSocialHomePage:()=>{},goToMyCommunitiesSearchPage:()=>{},setNavigationBlocker:()=>{},onBack:()=>{},onClickStory:(e,t,o)=>{}};process.env.NODE_ENV!=="production"&&(vS={page:{type:"SocialHomePage",context:{communityId:void 0}},onChangePage:e=>console.log(`NavigationContext onChangePage(${e})`),onClickCategory:e=>console.log(`NavigationContext onClickCategory(${e})`),onClickCommunity:e=>console.log(`NavigationContext onClickCommunity(${e})`),onClickUser:e=>console.log(`NavigationContext onClickUser(${e})`),goToViewStoryPage:({targetId:e,storyType:t,targetType:o})=>console.log(`NavigationContext goToViewStoryPage(${e}, ${t}, ${o})`),onCommunityCreated:e=>console.log(`NavigationContext onCommunityCreated(${e})`),onEditCommunity:e=>console.log(`NavigationContext onEditCommunity({${e})`),onEditUser:e=>console.log(`NavigationContext onEditUser(${e})`),onMessageUser:e=>console.log(`NavigationContext onMessageUser(${e})`),onBack:()=>console.log("NavigationContext onBack()"),goToUserProfilePage:e=>console.log(`NavigationContext goToUserProfilePage(${e})`),goToPostDetailPage:(e,t,o)=>console.log(`NavigationContext goToPostDetailPage(${e} ${t} ${o})`),goToCommunityProfilePage:e=>console.log(`NavigationContext goToCommunityProfilePage(${e})`),goToSocialGlobalSearchPage:e=>console.log(`NavigationContext goToSocialGlobalSearchPage(${e})`),goToSelectPostTargetPage:()=>console.log("NavigationContext goToTargetPage()"),goToStoryTargetSelectionPage:()=>console.log("NavigationContext goToStoryTargetSelectionPage()"),goToDraftStoryPage:e=>console.log("NavigationContext goToDraftStoryPage()"),goToPostComposerPage:()=>console.log("NavigationContext goToPostComposerPage()"),goToStoryCreationPage:()=>console.log("NavigationContext goToStoryCreationPage()"),goToSocialHomePage:()=>console.log("NavigationContext goToSocialHomePage()"),goToMyCommunitiesSearchPage:()=>console.log("NavigationContext goToMyCommunitiesSearchPage()"),onClickStory:(e,t,o)=>console.log(`NavigationContext onClickStory(${e}, ${t}, ${o})`)});var IR=createContext(vS),$e=()=>useContext(IR);var rc=e=>{let{onEditCommunity:t}=$e(),{community:o}=co({communityId:e,shouldCall:!!e}),r=it({fileId:o==null?void 0:o.avatarFileId,imageSize:"medium"}),{posts:n}=Mn({targetType:"community",targetId:e,feedType:"reviewing"}),i=oc(o==null?void 0:o.categoryIds),{canReview:a,canEdit:s}=Fa({community:o}),l=useMemo(()=>(n==null?void 0:n.length)||0,[n]);return {community:o,reviewingPosts:n,avatarFileUrl:r,communityCategories:i,pendingPostsCount:l,canEditCommunity:s,canReviewCommunityPosts:a,onEditCommunity:t,joinCommunity:()=>e&&CommunityRepository.joinCommunity(e),leaveCommunity:()=>e&&CommunityRepository.leaveCommunity(e),updateCommunity:f=>e&&CommunityRepository.updateCommunity(e,f),closeCommunity:()=>e&&CommunityRepository.deleteCommunity(e)}};function $i({fetcher:e,params:t,callback:o=()=>{},options:r,shouldSubscribe:n=!0,getSubscribedTopic:i}){let{subscribe:a}=RC(),s=useRef(null);return Qo({fetcher:e,params:t,callback:l=>{let{error:d,loading:p}=l;if(p)return;if(d)throw d;let{unsubscribe:u}=a({topic:i(l),callback:o});s.current=u;},options:r,shouldCall:n}),useEffect(()=>()=>{var l;(l=s.current)==null||l.call(s);},[s]),{unsubscribe:()=>{var l;return (l=s.current)==null?void 0:l.call(s)}}}function Oa({targetId:e,targetType:t,shouldSubscribe:o=!0,callback:r}){return $i({fetcher:StoryRepository.getActiveStoriesByTarget,params:{targetId:e,targetType:t},callback:r,shouldSubscribe:!!e&&o,getSubscribedTopic:()=>getCommunityStoriesTopic({targetId:e,targetType:t})})}var TR=m.div`
|
|
3440
|
+
`;var rS={community__category:"U"};var nS={communityCategoryName:"fa"};function Ha({pageId:e="*",componentId:t="*",categoryName:o}){let r="community_category_name",{accessibilityId:n,isExcluded:i,themeStyles:a}=L({pageId:e,componentId:t,elementId:r});return i?null:re.createElement("div",{className:nS.communityCategoryName,style:a,"data-qa-anchor":n},o)}var Pn=({pageId:e="*",componentId:t="*",categories:o,maxCategories:r})=>{let n="community_category",{config:i,themeStyles:a,accessibilityId:s,isExcluded:l}=L({pageId:e,componentId:t,elementId:n});if(l)return null;let d=o.slice(0,2),p=Math.max(0,o.length-d.length);return re.createElement("div",{"data-qa-anchor":s,style:a,className:rS.community__category},typeof r=="number"?re.createElement(re.Fragment,null,d.map(u=>re.createElement(Ha,{categoryName:u.name})),p>0&&re.createElement(Ha,{categoryName:`+${p}`})):o.map(u=>re.createElement(Ha,{key:u.categoryId,categoryName:u.name})))};function zY({fetcher:e,params:t,callback:o=()=>{},config:r,shouldCall:n=!0}){let{subscribe:i}=h0(),[a,s]=useState(!1),[l,d]=useState(n||!0),[p,u]=useState([]),[g,f]=useState(null),[y,C]=useState(!1),h=useRef(null),v=useCallback(()=>{var x;h.current&&(s(!0),(x=h.current)==null||x.call(h));},[h,a,l,d]),b=useCallback(x=>{n&&(x.data&&u(x.data),d(x.loading),C(x.hasNextPage),f(x.error),h.current=x.onNextPage,o(x));},[n,h]);return useEffect(()=>{if(!n)return;let{unsubscribe:x}=i({fetcher:e,params:t,callback:b});return ()=>{x();}},[t,n]),{items:p,hasMore:y,isLoading:l,loadMore:v,error:g,loadMoreHasBeenCalled:a}}var nt=zY;var aS=e=>{let r=nt({fetcher:ReactionRepository.getReactions,params:e,shouldCall:!!e.referenceId&&!!e.referenceType}),{items:t}=r,o=M(r,["items"]);return c({reactions:t},o)};var _7=(e,t=[])=>{let o=(e==null?void 0:e.length)||0,r=[],n=(i,a,s)=>{r.push({start:i,end:a,highlight:s});};if(!t||(t==null?void 0:t.length)===0)n(0,o,!1);else {let i=0;t.forEach(a=>{n(i,a.start,!1),n(a.start,a.end,!0),i=a.end;}),n(i,o,!1);}return r};var $Y=1;function S7(e){return e?e.sort((o,r)=>o.index-r.index).map(({index:o,length:r})=>({start:o,end:o+r+$Y,highlight:!0})):[]}function Yr(e){return e!=null}function sS(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}function lS(e){return e*parseFloat(getComputedStyle(document.documentElement).fontSize)}var VY=new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/);function mS(e){return e==="https://"||VY.test(e)}var Bl,Ll,Hp,cS,J2,T7,qs=class qs{constructor(){bo(this,Hp);bo(this,J2);bo(this,Bl,void 0);ga(this,Bl,new Map);}static get instance(){return $o(qs,Ll)||ga(qs,Ll,new qs),$o(qs,Ll)}hasReachedLimit(t){let o=Br(this,J2,T7).call(this,t);return $o(this,Bl).get(t)===o}markSeen(t){$o(this,Bl).set(t,Br(this,J2,T7).call(this,t));}};Bl=new WeakMap,Ll=new WeakMap,Hp=new WeakSet,cS=function(t){let o=Dr.instance.getAdFrequencyByPlacement(t);return o==null||o.type!=="time-window"?0:o.value},J2=new WeakSet,T7=function(t){let o=on(),r=o.startOf("day").diff(o,"minute"),n=Math.ceil(r/Br(this,Hp,cS).call(this,t));return `${o.format("DD-MM-YYYY")}-${n}`},bo(qs,Ll,void 0);var Al=qs;var Dl,X2,Y2,k7,Ks=class Ks{constructor(){bo(this,Y2);bo(this,X2,"amity.seenRecencyCache");}static get instance(){return $o(Ks,Dl)||ga(Ks,Dl,new Ks),$o(Ks,Dl)}getSeenRecencyByAdId(t){return Br(this,Y2,k7).call(this)[t]}setSeenRecencyCache(t,o){let r=Br(this,Y2,k7).call(this);r[t]=o,window.localStorage.setItem($o(this,X2),JSON.stringify(r));}};Dl=new WeakMap,X2=new WeakMap,Y2=new WeakSet,k7=function(){return JSON.parse(window.localStorage.getItem($o(this,X2))||"{}")},bo(Ks,Dl,void 0);var Fp=Ks,Hl,R2,N7,Js=class Js{constructor(){bo(this,R2);this.isLoading=!0;this.ads=[];this.settings=null;this.subscribers=[];Client.onSessionStateChange(t=>_(this,null,function*(){if(t==="established"){let o=yield AdRepository.getNetworkAds();this.ads=o.ads,this.settings=o.settings,this.subscribers.forEach(r=>r(o)),this.isLoading=!1;}else t==="terminated"&&(this.ads=[],this.settings=null,this.subscribers.forEach(o=>o(null)));}));}static get instance(){return $o(Js,Hl)||ga(Js,Hl,new Js),$o(Js,Hl)}onNetworkAdsData(t){!this.isLoading&&this.ads.length>0&&this.settings&&t({ads:this.ads,settings:this.settings}),this.subscribers.push(t);}getLastSeen(t){return Fp.instance.getSeenRecencyByAdId(t)}markSeen(t,o){var r;Fp.instance.setSeenRecencyCache(t.adId,Date.now()),((r=Br(this,R2,N7).call(this,o))==null?void 0:r.type)==="time-window"&&Al.instance.markSeen(o),t.analytics.markAsSeen(o);}markClicked(t,o){t.analytics.markLinkAsClicked(o);}getAdFrequencyByPlacement(t){return Br(this,R2,N7).call(this,t)}};Hl=new WeakMap,R2=new WeakSet,N7=function(t){if(!this.settings)return null;switch(t){case"feed":return this.settings.frequency.feed;case"comment":return this.settings.frequency.comment;case"story":return this.settings.frequency.story;default:return null}},bo(Js,Hl,void 0);var Dr=Js;var Fl,zp,dS,Up,pS,$p,uS,Xs=class Xs{constructor(){bo(this,zp);bo(this,Up);bo(this,$p);}static get instance(){return $o(Xs,Fl)||ga(Xs,Fl,new Xs),$o(Xs,Fl)}recommendedAds({ads:t,placement:o,count:r,communityId:n}){let i=Br(this,zp,dS).call(this,t),a=new Map;return t.forEach(s=>{var u;let l=(((u=s.targets)==null?void 0:u.communityIds)||[]).includes(n||"")?1:0,d=i.get(s.adId);if(d==null)return;let p=l+Math.pow(Math.E,2*d);a.set(s.adId,p);}),Br(this,$p,uS).call(this,{ads:t,scores:a,count:r})}};Fl=new WeakMap,zp=new WeakSet,dS=function(t){let o=t.sort((a,s)=>Dr.instance.getLastSeen(s.adId)-Dr.instance.getLastSeen(a.adId)),r=new Map,n=Dr.instance.getLastSeen(o[o.length-1].adId);return Dr.instance.getLastSeen(o[0].adId)===n?o.forEach(a=>{r.set(a.adId,1);}):o.forEach((a,s)=>{let l=s/o.length;r.set(a.adId,l);}),r},Up=new WeakSet,pS=function(t){let o=0,r=Math.random();for(let n=0;n<t.length;n++)if(o+=t[n],r<o)return n;return t.length-1},$p=new WeakSet,uS=function({ads:t,scores:o,count:r}){let n=[...t],i=[];for(;i.length<r&&n.length>0;){let a=n.reduce((p,u)=>p+(o.get(u.adId)||0),0),s=n.map(p=>(o.get(p.adId)||0)/a),l=s.map(p=>p/s.reduce((u,g)=>u+g,0)),d=Br(this,Up,pS).call(this,l);i.push(n[d]),n.splice(d,1);}return i},bo(Xs,Fl,void 0);var Op=Xs;var fS=createContext({isLoading:!0,ads:[],settings:null,saveItemsPagination:()=>{},getItemsPaginationCache:()=>{}});var E7=()=>useContext(fS).settings,yS=({count:e,placement:t,communityId:o})=>{let n=useContext(fS).ads,[i,a]=useState([]),s=E7(),l=Dr.instance.getAdFrequencyByPlacement(t);return useEffect(()=>{s!=null&&s.enabled&&((l==null?void 0:l.type)==="time-window"&&Al.instance.hasReachedLimit(t)||a(Op.instance.recommendedAds({ads:n,placement:t,count:e,communityId:o})));},[n,e,t,o]),i};var JY=({placement:e,pageSize:t,communityId:o,getItemId:r})=>{let n=E7(),[i,a]=useState(0),[s,l]=useState([]),[d,p]=useState(0),u=Dr.instance.getAdFrequencyByPlacement(e),g=(u==null?void 0:u.type)==="fixed"?t/u.value:1,f=yS({count:g,placement:e,communityId:o});return {combineItemsWithAds:h=>{if(!(n!=null&&n.enabled))return h;if((u==null?void 0:u.type)==="fixed"){let v=new Set(h.map(V=>r(V))),b=s.map(V=>{let N=r(V[0]);if(!v.has(N))return null;let O=h.find(K=>r(K)===N);return O?V.length===1?[O]:[O,V[1]]:V}).filter(Yr),x=b[0],P=(()=>{if(x){let V=h.findIndex(N=>r(N)===r(x[0]));return V===-1?0:V}return 0})(),w=[...(h||[]).slice(0,P).map(V=>[V]),...b],k=h.slice(P).filter(V=>{let N=r(V);return !w.some(O=>r(O[0])===N)}),S=i,A=d,D=k.map(V=>{if(A=A+1,!(A%u.value===0))return [V];let O=f[S];return S=S+1>f.length-1?0:S+1,[V,O]});a(S),p(A);let z=[...w,...D];return l([...w,...D]),z.length===0&&(a(0),p(0)),[...w,...D].flatMap(V=>V)}else if((u==null?void 0:u.type)==="time-window")return h.length===0?h:[...h.slice(0,1),f[0],...h.slice(1)].filter(Yr);return h},reset:()=>{a(0),l([]),p(0);}}},ec=({fetcher:e,params:t,callback:o=()=>{},config:r,shouldCall:n=!0,placement:i,communityId:a,pageSize:s,getItemId:l})=>{let{combineItemsWithAds:d}=JY({placement:i,pageSize:s,communityId:a,getItemId:l}),f=nt({fetcher:e,params:t,config:r,shouldCall:n}),{items:p}=f,u=M(f,["items"]),g=useMemo(()=>d(p).flatMap(y=>y),[p]);return E(c({},u),{items:g})};var Ui=e=>{let r=ec({fetcher:StoryRepository.getActiveStoriesByTarget,params:e,shouldCall:!0,pageSize:10,placement:"story",getItemId:n=>(n==null?void 0:n.storyId)||""}),{items:t}=r,o=M(r,["items"]);return c({stories:t.filter(Yr)},o)};var A7=e=>{let t=Mo(),[o,r]=useState(!1),{data:n,isLoading:i,refetch:a}=useQuery({queryKey:["asc-uikit","CommentRepository","isCommentFlaggedByMe",e],queryFn:()=>CommentRepository.isCommentFlaggedByMe(e),enabled:e!=null});useEffect(()=>{n!=null&&r(n);},[n]);let s=()=>_(void 0,null,function*(){if(e!=null)try{r(!0),yield CommentRepository.flagComment(e);}catch(p){r(!1);}finally{a();}}),l=()=>_(void 0,null,function*(){if(e!=null)try{r(!1),yield CommentRepository.unflagComment(e);}catch(p){r(!0);}finally{a();}});return {isLoading:i,isFlaggedByMe:o,flagComment:s,unflagComment:l,toggleFlagComment:p=>_(void 0,null,function*(){if(e!=null)if(o){if(yield l(),p!=null&&p.onUnFlagSuccss)return p.onUnFlagSuccss();t.success({content:"Comment unreported"});}else {if(yield s(),p!=null&&p.onFlagSuccess)return p.onFlagSuccess();t.success({content:"Comment reported"});}})}};var tc=(i=>(i.MEMBER="member",i.MODERATOR="moderator",i.SUPER_MODERATOR="super-moderator",i.COMMUNITY_MODERATOR="community-moderator",i.CHANNEL_MODERATOR="channel-moderator",i))(tc||{});var{COMMUNITY_MODERATOR:oR}=tc;function Ol({communityId:e,shouldCall:t=!0}){let n=nt({fetcher:CommunityRepository.Membership.getMembers,params:{communityId:e,roles:[oR]},shouldCall:!!e&&t}),{items:o}=n,r=M(n,["items"]);return c({moderators:o},r)}var rR=({community:e})=>{var p,u,g,f;let{currentUserId:t}=X(),{moderators:o}=Li(e==null?void 0:e.communityId),{client:r}=X(),i=o.find(y=>y.userId===t)!=null;if(e==null)return {isModerator:i,canEdit:!1,canEditPost:!1,canReviewPost:!1,canEditUser:!1};let a=(p=r==null?void 0:r.hasPermission(lr.EditCommunityPermission).community(e.communityId))!=null?p:!1,s=(u=r==null?void 0:r.hasPermission(lr.EditCommunityFeedPostPermission).community(e==null?void 0:e.communityId))!=null?u:!1,l=(g=r==null?void 0:r.hasPermission(lr.ReviewCommunityPost).community(e.communityId))!=null?g:!1,d=(f=r==null?void 0:r.hasPermission(lr.EditCommunityUserPermission).community(e.communityId))!=null?f:!1;return {isModerator:i,canEdit:a,canEditPost:s,canReviewPost:l,canEditUser:d}},Fa=rR;var aR=e=>{let{data:t}=useQuery({queryKey:["asc-uikit","FileRepository","getFile",e],queryFn:()=>FileRepository.getFile(e),enabled:!!e});return t==null?void 0:t.data},hS=aR;var it=({fileId:e,imageSize:t="medium"})=>{let o=hS(e),[r,n]=useState(void 0);return useEffect(()=>{if(o==null||e==null){n(void 0);return}function i(){return _(this,null,function*(){if((o==null?void 0:o.fileUrl)==null)return;let a=FileRepository.fileUrlWithSize(o==null?void 0:o.fileUrl,t);n(a);})}i();},[o,t]),r};function uR({fetcher:e,params:t,callback:o=()=>{},options:r,shouldCall:n=!0,getSubscribedTopic:i}){let{subscribe:a}=r6(),[s,l]=useState(null),[d,p]=useState(void 0),[u,g]=useState(!1),[f,y]=useState(null),C=useRef(null),h=useCallback(v=>{n&&t!=null&&(g(v.loading),v.data&&l(v.data),p(v.origin),y(v.error),o(v));},[n,o]);return useEffect(()=>(i&&(C.current=subscribeTopic(i())),()=>{var v;(v=C.current)==null||v.call(C);}),[i]),useEffect(()=>{if(t==null||!n)return;let{unsubscribe:v}=a({fetcher:e,params:t,callback:h,options:r});return ()=>{v();}},[t,n]),{item:s,origin:d,isLoading:u||s==null&&f==null,error:f}}var Qo=uR;var fR=({communityId:e,shouldCall:t=!0})=>{let n=Qo({fetcher:CommunityRepository.getCommunity,params:e,shouldCall:t&&!!e}),{item:o}=n,r=M(n,["item"]);return c({community:o},r)},co=fR;var vR=e=>{let[t,o]=useState([]);return useEffect(()=>{function r(){return _(this,null,function*(){if(e==null||e.length===0)return;let n=yield Promise.all(e.map(i=>_(this,null,function*(){return (yield CategoryRepository.getCategory(i)).data})));o(n);})}r();},[e]),t},oc=vR;var vS={page:{type:"SocialHomePage",context:{communityId:void 0}},onChangePage:e=>{},onClickCategory:e=>{},onClickCommunity:e=>{},onClickUser:e=>{},onCommunityCreated:e=>{},onEditCommunity:e=>{},onEditUser:e=>{},onMessageUser:e=>{},goToUserProfilePage:e=>{},goToPostDetailPage:(e,t,o)=>{},goToViewStoryPage:e=>{},goToDraftStoryPage:(e,t,o,r)=>{},goToCommunityProfilePage:e=>{},goToSocialGlobalSearchPage:e=>{},goToSelectPostTargetPage:()=>{},goToStoryTargetSelectionPage:()=>{},goToPostComposerPage:()=>{},goToStoryCreationPage:()=>{},goToSocialHomePage:()=>{},goToMyCommunitiesSearchPage:()=>{},setNavigationBlocker:()=>{},onBack:()=>{},onClickStory:(e,t,o)=>{}};process.env.NODE_ENV!=="production"&&(vS={page:{type:"SocialHomePage",context:{communityId:void 0}},onChangePage:e=>console.log(`NavigationContext onChangePage(${e})`),onClickCategory:e=>console.log(`NavigationContext onClickCategory(${e})`),onClickCommunity:e=>console.log(`NavigationContext onClickCommunity(${e})`),onClickUser:e=>console.log(`NavigationContext onClickUser(${e})`),goToViewStoryPage:({targetId:e,storyType:t,targetType:o})=>console.log(`NavigationContext goToViewStoryPage(${e}, ${t}, ${o})`),onCommunityCreated:e=>console.log(`NavigationContext onCommunityCreated(${e})`),onEditCommunity:e=>console.log(`NavigationContext onEditCommunity({${e})`),onEditUser:e=>console.log(`NavigationContext onEditUser(${e})`),onMessageUser:e=>console.log(`NavigationContext onMessageUser(${e})`),onBack:()=>console.log("NavigationContext onBack()"),goToUserProfilePage:e=>console.log(`NavigationContext goToUserProfilePage(${e})`),goToPostDetailPage:(e,t,o)=>console.log(`NavigationContext goToPostDetailPage(${e} ${t} ${o})`),goToCommunityProfilePage:e=>console.log(`NavigationContext goToCommunityProfilePage(${e})`),goToSocialGlobalSearchPage:e=>console.log(`NavigationContext goToSocialGlobalSearchPage(${e})`),goToSelectPostTargetPage:()=>console.log("NavigationContext goToTargetPage()"),goToStoryTargetSelectionPage:()=>console.log("NavigationContext goToStoryTargetSelectionPage()"),goToDraftStoryPage:e=>console.log("NavigationContext goToDraftStoryPage()"),goToPostComposerPage:()=>console.log("NavigationContext goToPostComposerPage()"),goToStoryCreationPage:()=>console.log("NavigationContext goToStoryCreationPage()"),goToSocialHomePage:()=>console.log("NavigationContext goToSocialHomePage()"),goToMyCommunitiesSearchPage:()=>console.log("NavigationContext goToMyCommunitiesSearchPage()"),onClickStory:(e,t,o)=>console.log(`NavigationContext onClickStory(${e}, ${t}, ${o})`)});var IR=createContext(vS),$e=()=>useContext(IR);var rc=e=>{let{onEditCommunity:t}=$e(),{community:o}=co({communityId:e,shouldCall:!!e}),r=it({fileId:o==null?void 0:o.avatarFileId,imageSize:"medium"}),{posts:n}=Mn({targetType:"community",targetId:e,feedType:"reviewing"}),i=oc(o==null?void 0:o.categoryIds),{canReview:a,canEdit:s}=Fa({community:o}),l=useMemo(()=>(n==null?void 0:n.length)||0,[n]);return {community:o,reviewingPosts:n,avatarFileUrl:r,communityCategories:i,pendingPostsCount:l,canEditCommunity:s,canReviewCommunityPosts:a,onEditCommunity:t,joinCommunity:()=>e&&CommunityRepository.joinCommunity(e),leaveCommunity:()=>e&&CommunityRepository.leaveCommunity(e),updateCommunity:f=>e&&CommunityRepository.updateCommunity(e,f),closeCommunity:()=>e&&CommunityRepository.deleteCommunity(e)}};function $i({fetcher:e,params:t,callback:o=()=>{},options:r,shouldSubscribe:n=!0,getSubscribedTopic:i}){let{subscribe:a}=RC(),s=useRef(null);return Qo({fetcher:e,params:t,callback:l=>{let{error:d,loading:p}=l;if(p)return;if(d)throw d;let{unsubscribe:u}=a({topic:i(l),callback:o});s.current=u;},options:r,shouldCall:n}),useEffect(()=>()=>{var l;(l=s.current)==null||l.call(s);},[s]),{unsubscribe:()=>{var l;return (l=s.current)==null?void 0:l.call(s)}}}function Oa({targetId:e,targetType:t,shouldSubscribe:o=!0,callback:r}){return $i({fetcher:StoryRepository.getActiveStoriesByTarget,params:{targetId:e,targetType:t},callback:r,shouldSubscribe:!!e&&o,getSubscribedTopic:()=>getCommunityStoriesTopic({targetId:e,targetType:t})})}var TR=m.div`
|
|
3441
3441
|
display: flex;
|
|
3442
3442
|
flex-direction: column;
|
|
3443
3443
|
padding-left: 16px;
|
|
@@ -3487,7 +3487,7 @@ top: 40px;
|
|
|
3487
3487
|
top: calc(100% + 0.25rem);
|
|
3488
3488
|
width: 100%;
|
|
3489
3489
|
color: ${({theme:e})=>e.palette.base.main};
|
|
3490
|
-
`;var _S=({value:e,disabled:t})=>{let[o,r]=useState(!1),[n,i]=v2(o),a=()=>r(!1),s=()=>r(!0);return useEffect(()=>{t||e&&e.length>0&&r(!0);},[e,t]),useEffect(()=>{!i&&a();},[i]),ur("Escape",a),{isOpen:o,open:s,close:a,containerRef:n}},oee=({"data-qa-anchor":e="",items:t,value:o,searchValue:r,placeholder:n,loadMore:i,prepend:a,append:s,invalid:l,disabled:d,renderItem:p,onSearchValueChange:u,onClear:g,onChange:f})=>{let[y,C]=useState(!1),[h,v]=v2(y),b=()=>C(!1);return useEffect(()=>{d||r.length>0&&C(!0);},[r,d]),useEffect(()=>{!v&&b();},[v]),ur("Escape",b),re.createElement(eee,{ref:h},re.createElement(Rt,{"data-qa-anchor":e,value:r,invalid:l,disabled:d,prepend:a,append:s,placeholder:n,onClear:g,onChange:I=>u==null?void 0:u(I.plainText),onClick:()=>C(!0)}),y&&re.createElement(tee,null,re.createElement(ic,{items:t,append:i&&re.createElement(
|
|
3490
|
+
`;var _S=({value:e,disabled:t})=>{let[o,r]=useState(!1),[n,i]=v2(o),a=()=>r(!1),s=()=>r(!0);return useEffect(()=>{t||e&&e.length>0&&r(!0);},[e,t]),useEffect(()=>{!i&&a();},[i]),ur("Escape",a),{isOpen:o,open:s,close:a,containerRef:n}},oee=({"data-qa-anchor":e="",items:t,value:o,searchValue:r,placeholder:n,loadMore:i,prepend:a,append:s,invalid:l,disabled:d,renderItem:p,onSearchValueChange:u,onClear:g,onChange:f})=>{let[y,C]=useState(!1),[h,v]=v2(y),b=()=>C(!1);return useEffect(()=>{d||r.length>0&&C(!0);},[r,d]),useEffect(()=>{!v&&b();},[v]),ur("Escape",b),re.createElement(eee,{ref:h},re.createElement(Rt,{"data-qa-anchor":e,value:r,invalid:l,disabled:d,prepend:a,append:s,placeholder:n,onClear:g,onChange:I=>u==null?void 0:u(I.plainText),onClick:()=>C(!0)}),y&&re.createElement(tee,null,re.createElement(ic,{items:t,append:i&&re.createElement(Y,{fullWidth:!0,onClick:i},re.createElement(FormattedMessage,{id:"loadMore"})),onPick:I=>{f==null||f(t[I].value),C(!1),u==null||u("");},renderItem:I=>p(I)})))},SS=oee;var TS=m.div`
|
|
3491
3491
|
display: flex;
|
|
3492
3492
|
align-items: center;
|
|
3493
3493
|
padding-left: 20px;
|
|
@@ -3561,7 +3561,7 @@ top: 40px;
|
|
|
3561
3561
|
top: calc(100% + 0.25rem);
|
|
3562
3562
|
width: 100%;
|
|
3563
3563
|
color: ${({theme:e})=>e.palette.base.main};
|
|
3564
|
-
`,aee=({searchValue:e,isOpen:t})=>{let{onClickCommunity:o}=J(),{communities:r,hasMore:n,loadMore:i}=Cr({displayName:e},!!e),a=r.filter(Re),s=a.map(l=>l.displayName);return t?re.createElement(BS,null,re.createElement(ic,{items:s,append:n&&i?re.createElement(
|
|
3564
|
+
`,aee=({searchValue:e,isOpen:t})=>{let{onClickCommunity:o}=J(),{communities:r,hasMore:n,loadMore:i}=Cr({displayName:e},!!e),a=r.filter(Re),s=a.map(l=>l.displayName);return t?re.createElement(BS,null,re.createElement(ic,{items:s,append:n&&i?re.createElement(Y,{fullWidth:!0,onClick:i},re.createElement(FormattedMessage,{id:"loadMore"})):null,onPick:l=>a[l]?o(a[l].communityId):null,renderItem:l=>{let d=r.find(p=>p.displayName===l);return d&&re.createElement(nc,{communityId:d.communityId})}})):null},see=({searchValue:e,isOpen:t})=>{let{onClickUser:o}=J(),{users:r,hasMore:n,loadMore:i}=pp(e),a=r.filter(Re),s=a.map(l=>l.displayName);return t?re.createElement(BS,null,re.createElement(ic,{items:s,append:n&&i?re.createElement(Y,{fullWidth:!0,onClick:i},re.createElement(FormattedMessage,{id:"loadMore"})):null,onPick:l=>a[l]?o(a[l].userId):null,renderItem:l=>{let d=r.find(p=>p.displayName===l);return d&&re.createElement(Xn,{userId:d.userId,isBanned:d==null?void 0:d.isGlobalBanned})}})):null},lee=({className:e,sticky:t=!1,searchBy:o})=>{let[r,n]=useState(""),[i,a]=useState(o),{open:s,close:l,isOpen:d,containerRef:p}=_S({value:r});function u(){n("");}return re.createElement(NS,{className:e,sticky:t},re.createElement(FormattedMessage,{id:"exploreHeader.searchCommunityPlaceholder"},([g])=>re.createElement(iee,{ref:p},re.createElement(Rt,{"data-qa-anchor":"social-search-input",value:r,prepend:re.createElement(TS,null,re.createElement(kS,null)),placeholder:typeof g=="string"?g:void 0,onClear:u,onChange:f=>n==null?void 0:n(f.plainText),onClick:()=>s()}),d?re.createElement(xr,{tabs:[{value:"communities",label:"Groups"},{value:"accounts",label:"Accounts"}],activeTab:i,onChange:f=>a(f)}):null,i==="communities"?re.createElement(aee,{searchValue:r,isOpen:d}):null,i==="accounts"?re.createElement(see,{searchValue:r,isOpen:d}):null)))},LS=e=>{let t=j("SocialSearch");return t?t(e):re.createElement(lee,c({},e))};m(LS)`
|
|
3565
3565
|
background: ${({theme:e})=>e.palette.system.background};
|
|
3566
3566
|
padding: 0.5rem;
|
|
3567
3567
|
z-index: 100;
|
|
@@ -3577,7 +3577,7 @@ top: 40px;
|
|
|
3577
3577
|
`,Cee=m.div`
|
|
3578
3578
|
display: flex;
|
|
3579
3579
|
gap: 20px;
|
|
3580
|
-
`,DS=m(
|
|
3580
|
+
`,DS=m(Y).attrs({variant:"secondary"})`
|
|
3581
3581
|
width: 28px;
|
|
3582
3582
|
padding: 2px;
|
|
3583
3583
|
|
|
@@ -3768,7 +3768,7 @@ top: 40px;
|
|
|
3768
3768
|
`,rte=m.div`
|
|
3769
3769
|
display: flex;
|
|
3770
3770
|
gap: 20px;
|
|
3771
|
-
`,KS=m(
|
|
3771
|
+
`,KS=m(Y).attrs({variant:"secondary"})`
|
|
3772
3772
|
width: 28px;
|
|
3773
3773
|
padding: 2px;
|
|
3774
3774
|
|
|
@@ -3813,7 +3813,7 @@ top: 40px;
|
|
|
3813
3813
|
}
|
|
3814
3814
|
`,mte=()=>{let{onClickCommunity:e}=J(),{communities:t,loadMoreHasBeenCalled:o,loadMore:r,hasMore:n}=Cr({membership:"all",sortBy:"displayName",limit:12});return re.createElement("div",null,re.createElement(JS,{title:"All groups",columns:{1280:2,720:1},hasMore:n,loadMore:r},t.map(({communityId:i},a)=>re.createElement(lte,null,re.createElement("li",{key:i},re.createElement(Gl,{index:a,communityId:i,onClick:s=>e(s),disabledNumber:!0}))))))},XS=mte;function cte(e){return re.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"21",height:"20",viewBox:"0 0 21 20",fill:"none"},e),re.createElement("path",{d:"M9.36823 15.4777C10.062 16.1767 10.7245 16.1715 11.4234 15.4777L12.2059 14.6953C12.2789 14.6223 12.3415 14.6014 12.4354 14.6014H13.5412C14.5271 14.6014 14.9966 14.1319 14.9966 13.1461V12.0402C14.9966 11.9463 15.0227 11.8785 15.0905 11.8107L15.8729 11.023C16.5719 10.3293 16.5667 9.66681 15.8729 8.97305L15.0905 8.19061C15.0227 8.11758 14.9966 8.05499 14.9966 7.9611V6.85525C14.9966 5.86938 14.5271 5.39991 13.5412 5.39991H12.4354C12.3415 5.39991 12.2737 5.37383 12.2059 5.30602L11.4234 4.52358C10.7245 3.82461 10.062 3.82461 9.36823 4.5288L8.58579 5.30602C8.51798 5.37383 8.45017 5.39991 8.35628 5.39991H7.25043C6.26456 5.39991 5.79509 5.85894 5.79509 6.85525V7.9611C5.79509 8.05499 5.76901 8.1228 5.7012 8.19061L4.91876 8.97305C4.21979 9.66681 4.225 10.3293 4.91876 11.023L5.7012 11.8107C5.76901 11.8785 5.79509 11.9463 5.79509 12.0402V13.1461C5.79509 14.1319 6.26456 14.6014 7.25043 14.6014H8.35628C8.45017 14.6014 8.51276 14.6223 8.58579 14.6953L9.36823 15.4777ZM9.52993 12.6714C9.34736 12.6714 9.20131 12.6036 9.08655 12.4836L7.41735 10.6162C7.32867 10.5223 7.28173 10.3919 7.28173 10.2615C7.28173 9.94849 7.50603 9.72419 7.82943 9.72419C8.00679 9.72419 8.13719 9.78157 8.25195 9.90676L9.50907 11.3099L12.0233 7.72115C12.1485 7.5438 12.2841 7.47077 12.4928 7.47077C12.8162 7.47077 13.0457 7.69507 13.0457 7.99761C13.0457 8.10193 13.004 8.23234 12.9257 8.34188L9.9994 12.4471C9.87942 12.6036 9.72293 12.6714 9.52993 12.6714Z"}))}var Ys=cte;function dte(e){return re.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},e),re.createElement("path",{fill:e.fill?e.fill:"currentColor",d:"M20.332 5.254a2.228 2.228 0 010 3.164l-2.637 2.637L16.5 12.25l-8.578 8.578-4.008.422H3.81A.804.804 0 013 20.336l.422-4.008L12 7.75l1.195-1.195 2.637-2.637a2.3 2.3 0 011.582-.668 2.3 2.3 0 011.582.668l1.336 1.336zM7.148 19.21l8.157-8.121 1.09-1.09-2.145-2.145-1.09 1.09-8.12 8.157-.247 2.355 2.355-.246zM19.137 7.223a.552.552 0 000-.774L17.8 5.113a.6.6 0 00-.387-.176.6.6 0 00-.387.176L15.445 6.66l2.145 2.145 1.547-1.582z"}))}var G7=dte;function pte(e){return re.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},e),re.createElement("path",{fill:e.fill?e.fill:"currentColor",d:"M19.313 6.063c.28 0 .562.28.562.562v.563a.578.578 0 01-.563.562h-.562l-.773 11.918c-.036.879-.809 1.582-1.688 1.582H7.676c-.88 0-1.653-.703-1.688-1.582L5.25 7.75h-.563a.555.555 0 01-.562-.563v-.562c0-.281.246-.563.563-.563H7.57l1.196-1.968c.28-.457.914-.844 1.441-.844h3.55c.528 0 1.161.387 1.442.844l1.196 1.968h2.918zm-9.106-1.125l-.668 1.125h4.887l-.668-1.125h-3.551zm6.082 14.625l.738-11.813H6.937l.739 11.813h8.613z"}))}var Rs=pte;function ute(e){return re.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},e),re.createElement("path",{fill:e.fill||"currentColor",d:"M14.813 6.063c1.23 0 2.566-.422 3.832-.985C19.735 4.621 21 5.43 21 6.625v8.438c0 .597-.316 1.124-.773 1.44-.95.599-2.461 1.372-4.536 1.372-2.39 0-3.972-1.125-5.695-1.125-1.969 0-3.164.422-4.465 1.02v2.918a.578.578 0 01-.562.562h-.563a.555.555 0 01-.562-.563V6.415C3.316 6.133 3 5.57 3 4.938c0-.95.809-1.723 1.793-1.653A1.626 1.626 0 016.34 4.762c0 .035.035.14.035.176 0 .175-.07.421-.105.562a7.451 7.451 0 012.847-.563c2.39 0 3.973 1.125 5.695 1.125zm4.5 9V6.624c-1.125.527-2.989 1.125-4.5 1.125-2.11 0-3.586-1.125-5.696-1.125-1.476 0-2.847.598-3.586 1.125v8.156c1.09-.492 2.953-.844 4.465-.844 2.11 0 3.586 1.126 5.695 1.126 1.477 0 2.848-.563 3.621-1.125z"}))}var Z7=ute;var gte=e=>re.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 448 512",fill:"currentColor"},e),re.createElement("path",{d:`M441.9 167.3l-19.8-19.8c-4.7-4.7-12.3-4.7-17 0L224 328.2 42.9 147.5c-4.7-4.7-12.3-4.7-17
|
|
3815
3815
|
0L6.1 167.3c-4.7 4.7-4.7 12.3 0 17l209.4 209.4c4.7 4.7 12.3 4.7 17 0l209.4-209.4c4.7-4.7
|
|
3816
|
-
4.7-12.3 0-17z`})),Q7=gte;function fte(e){return re.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24"},e),re.createElement("path",{fill:e.fill?e.fill:"currentColor",d:"M14.04 10.21c1.792 1.794 1.898 4.677.316 6.575-.211.281-.07.14-2.954 3.024-1.933 1.933-5.062 1.933-6.96 0-1.934-1.899-1.934-5.028 0-6.961l2.214-2.215c.246-.246.703-.07.703.281.036.387.106.984.176 1.336.035.14 0 .281-.105.387l-1.617 1.617a2.95 2.95 0 000 4.184 2.95 2.95 0 004.183 0l2.637-2.637a2.95 2.95 0 000-4.184c-.176-.21-.563-.457-.809-.562-.14-.106-.246-.282-.21-.457.034-.387.21-.774.527-1.055l.14-.14a.435.435 0 01.492-.106c.457.246.88.527 1.266.914zm5.483-5.483c1.934 1.898 1.934 5.027 0 6.96l-2.214 2.215c-.247.246-.704.07-.704-.28a15.366 15.366 0 00-.175-1.337.397.397 0 01.105-.387l1.617-1.617a2.95 2.95 0 000-4.183 2.95 2.95 0 00-4.183 0l-2.637 2.636a2.95 2.95 0 000 4.184c.176.21.563.457.809.563.14.105.246.28.21.457a1.607 1.607 0 01-.527 1.054l-.14.14a.435.435 0 01-.493.106 5.266 5.266 0 01-1.265-.914c-1.793-1.793-1.899-4.676-.317-6.574.211-.281.07-.14 2.954-3.023 1.933-1.934 5.062-1.934 6.96 0z"}))}var lc=fte;function yte(e){return re.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16"},e),re.createElement("path",{fill:"#898E9E",d:"M4.375 8.875A.361.361 0 014 8.5v-1a.38.38 0 01.375-.375h7.25c.188 0 .375.188.375.375v1a.38.38 0 01-.375.375h-7.25zM15.75 8A7.749 7.749 0 018 15.75 7.749 7.749 0 01.25 8 7.749 7.749 0 018 .25 7.749 7.749 0 0115.75 8zm-1.5 0c0-3.438-2.813-6.25-6.25-6.25A6.248 6.248 0 001.75 8 6.228 6.228 0 008 14.25 6.248 6.248 0 0014.25 8z"}))}var mc=yte;var Cte=({isOtherUserProfile:e=!1})=>{let{isLoading:t,isNoNicknameUser:o,isAnonymousUser:r}=Qe(),[n,i]=useState([{name:"Explore",pageType:"explore"},{name:"Feed",pageType:"newsfeed"},{name:"Profile",pageType:"userfeed"},{name:"My groups",pageType:"mycommunities"}]);return useEffect(()=>{i(a=>o||r?a.filter(s=>s.name==="Profile"&&e?!0:s.name!=="Profile"&&s.name!=="My groups"&&s.name!=="Feed"):a);},[r,o,e]),t?null:re.createElement(f_,null,re.createElement(vte,{options:n}),!o&&!r&&re.createElement(v_,null,re.createElement(Ap,{isHideUser:!0})))},$a=Cte,vte=({options:e})=>{let[t,o]=useState(!1),{currentUserId:r}=
|
|
3816
|
+
4.7-12.3 0-17z`})),Q7=gte;function fte(e){return re.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24"},e),re.createElement("path",{fill:e.fill?e.fill:"currentColor",d:"M14.04 10.21c1.792 1.794 1.898 4.677.316 6.575-.211.281-.07.14-2.954 3.024-1.933 1.933-5.062 1.933-6.96 0-1.934-1.899-1.934-5.028 0-6.961l2.214-2.215c.246-.246.703-.07.703.281.036.387.106.984.176 1.336.035.14 0 .281-.105.387l-1.617 1.617a2.95 2.95 0 000 4.184 2.95 2.95 0 004.183 0l2.637-2.637a2.95 2.95 0 000-4.184c-.176-.21-.563-.457-.809-.562-.14-.106-.246-.282-.21-.457.034-.387.21-.774.527-1.055l.14-.14a.435.435 0 01.492-.106c.457.246.88.527 1.266.914zm5.483-5.483c1.934 1.898 1.934 5.027 0 6.96l-2.214 2.215c-.247.246-.704.07-.704-.28a15.366 15.366 0 00-.175-1.337.397.397 0 01.105-.387l1.617-1.617a2.95 2.95 0 000-4.183 2.95 2.95 0 00-4.183 0l-2.637 2.636a2.95 2.95 0 000 4.184c.176.21.563.457.809.563.14.105.246.28.21.457a1.607 1.607 0 01-.527 1.054l-.14.14a.435.435 0 01-.493.106 5.266 5.266 0 01-1.265-.914c-1.793-1.793-1.899-4.676-.317-6.574.211-.281.07-.14 2.954-3.023 1.933-1.934 5.062-1.934 6.96 0z"}))}var lc=fte;function yte(e){return re.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 16 16"},e),re.createElement("path",{fill:"#898E9E",d:"M4.375 8.875A.361.361 0 014 8.5v-1a.38.38 0 01.375-.375h7.25c.188 0 .375.188.375.375v1a.38.38 0 01-.375.375h-7.25zM15.75 8A7.749 7.749 0 018 15.75 7.749 7.749 0 01.25 8 7.749 7.749 0 018 .25 7.749 7.749 0 0115.75 8zm-1.5 0c0-3.438-2.813-6.25-6.25-6.25A6.248 6.248 0 001.75 8 6.228 6.228 0 008 14.25 6.248 6.248 0 0014.25 8z"}))}var mc=yte;var Cte=({isOtherUserProfile:e=!1})=>{let{isLoading:t,isNoNicknameUser:o,isAnonymousUser:r}=Qe(),[n,i]=useState([{name:"Explore",pageType:"explore"},{name:"Feed",pageType:"newsfeed"},{name:"Profile",pageType:"userfeed"},{name:"My groups",pageType:"mycommunities"}]);return useEffect(()=>{i(a=>o||r?a.filter(s=>s.name==="Profile"&&e?!0:s.name!=="Profile"&&s.name!=="My groups"&&s.name!=="Feed"):a);},[r,o,e]),t?null:re.createElement(f_,null,re.createElement(vte,{options:n}),!o&&!r&&re.createElement(v_,null,re.createElement(Ap,{isHideUser:!0})))},$a=Cte,vte=({options:e})=>{let[t,o]=useState(!1),{currentUserId:r}=X(),{onClickUser:n}=J(),i=useRef(null),{onChangePage:a,page:s}=J(),l=e.findIndex(h=>h.pageType===s.type),[d,p]=useState(e[l].name),[u,g]=useState(e),f=()=>{o(!t);},y=h=>{p(h==null?void 0:h.name),h.pageType==="userfeed"?(a(h.pageType),n(r)):a(h.pageType),o(!1);};useEffect(()=>{let h=e.filter(v=>v.name!==d);g(h);},[d,e]);let C=h=>{i.current&&!i.current.contains(h.target)&&o(!1);};return useEffect(()=>(document.addEventListener("mousedown",C),()=>{document.removeEventListener("mousedown",C);}),[]),re.createElement(C_,null,re.createElement(y_,{onClick:()=>{u.length>0&&f();}},re.createElement(x_,null,d),u.length>0&&re.createElement(Q7,{width:20,height:16})),u.length>0&&re.createElement(b_,{isOpen:t},u.map((h,v)=>re.createElement(I_,{key:v,onClick:()=>y(h)},h.name))))};var iT=m.img`
|
|
3817
3817
|
width: 100%;
|
|
3818
3818
|
border-radius: 8px;
|
|
3819
3819
|
position: relative;
|
|
@@ -4061,14 +4061,14 @@ top: 40px;
|
|
|
4061
4061
|
padding: 80px 16px;
|
|
4062
4062
|
color: ${({theme:e})=>e.palette.base.shade3};
|
|
4063
4063
|
width: 100%;
|
|
4064
|
-
`,r3=({message:e})=>re.createElement($te,null,re.createElement(i2,{width:48,height:48}),re.createElement(K0,null,`"It's empty here..."`),re.createElement(J0,null,e));var Zte=({profileUserId:e,currentUserId:t,userId:o,onClick:r})=>{let n=oe(o),{onClickUser:i}=J(),{confirm:a}=Me(),s=be(),{formatMessage:l}=useIntl(),{isFlaggedByMe:d,toggleFlagUser:p}=ja(o),u=()=>_(void 0,null,function*(){yield p(),s.success({content:re.createElement(FormattedMessage,{id:"report.reportSent"})});}),g=()=>UserRepository.Relationship.unfollow(o),f=e===t,y=t===o,C=()=>{let b=n!=null&&n.displayName?l({id:"user.unfollow.confirm.title"},{displayName:n.displayName}):l({id:"user.unfollow.confirm.title.thisUser"}),x=n!=null&&n.displayName?l({id:"user.unfollow.confirm.body"},{displayName:n.displayName}):l({id:"user.unfollow.confirm.body.thisUser"});a({title:b,content:x,cancelText:l({id:"buttonText.cancel"}),okText:l({id:"buttonText.unfollow"}),onOk:g});},h=useCallback(()=>{i(o);},[i,o]),v=useMemo(()=>{let b=[];return y||b.push({name:l(d?{id:"report.unreportUser"}:{id:"report.reportUser"}),action:u}),f&&b.push({name:l({id:"follower.menuItem.unfollow"}),action:C}),b},[d,f,y,C,u]);return re.createElement(Ql,{key:o},re.createElement(t3,null,re.createElement(Xn,{userId:o,onClick:h}),re.createElement(So,{options:v})))};function Qte({userId:e}){let{followings:t,isLoading:o,loadMore:r,hasMore:n,loadMoreHasBeenCalled:i}=R7({userId:e,status:"all"});return {items:useMemo(()=>{function s(){return new Array(5).fill(1).map((l,d)=>({skeleton:!0}))}return o&&!i?s():o&&i?[...t,...s()]:t},[t,o,i]),isLoading:o,hasMore:n,loadMore:r,loadMoreHasBeenCalled:i}}var Wte=({userId:e,onItemClick:t})=>{let{formatMessage:o}=useIntl(),{currentUserId:r}=
|
|
4064
|
+
`,r3=({message:e})=>re.createElement($te,null,re.createElement(i2,{width:48,height:48}),re.createElement(K0,null,`"It's empty here..."`),re.createElement(J0,null,e));var Zte=({profileUserId:e,currentUserId:t,userId:o,onClick:r})=>{let n=oe(o),{onClickUser:i}=J(),{confirm:a}=Me(),s=be(),{formatMessage:l}=useIntl(),{isFlaggedByMe:d,toggleFlagUser:p}=ja(o),u=()=>_(void 0,null,function*(){yield p(),s.success({content:re.createElement(FormattedMessage,{id:"report.reportSent"})});}),g=()=>UserRepository.Relationship.unfollow(o),f=e===t,y=t===o,C=()=>{let b=n!=null&&n.displayName?l({id:"user.unfollow.confirm.title"},{displayName:n.displayName}):l({id:"user.unfollow.confirm.title.thisUser"}),x=n!=null&&n.displayName?l({id:"user.unfollow.confirm.body"},{displayName:n.displayName}):l({id:"user.unfollow.confirm.body.thisUser"});a({title:b,content:x,cancelText:l({id:"buttonText.cancel"}),okText:l({id:"buttonText.unfollow"}),onOk:g});},h=useCallback(()=>{i(o);},[i,o]),v=useMemo(()=>{let b=[];return y||b.push({name:l(d?{id:"report.unreportUser"}:{id:"report.reportUser"}),action:u}),f&&b.push({name:l({id:"follower.menuItem.unfollow"}),action:C}),b},[d,f,y,C,u]);return re.createElement(Ql,{key:o},re.createElement(t3,null,re.createElement(Xn,{userId:o,onClick:h}),re.createElement(So,{options:v})))};function Qte({userId:e}){let{followings:t,isLoading:o,loadMore:r,hasMore:n,loadMoreHasBeenCalled:i}=R7({userId:e,status:"all"});return {items:useMemo(()=>{function s(){return new Array(5).fill(1).map((l,d)=>({skeleton:!0}))}return o&&!i?s():o&&i?[...t,...s()]:t},[t,o,i]),isLoading:o,hasMore:n,loadMore:r,loadMoreHasBeenCalled:i}}var Wte=({userId:e,onItemClick:t})=>{let{formatMessage:o}=useIntl(),{currentUserId:r}=X(),{items:n,loadMore:i,hasMore:a}=Qte({userId:e}),s=()=>a?re.createElement(ji,{onClick:()=>i==null?void 0:i()}):null;return n.length===0?re.createElement(re.Fragment,null,re.createElement(Wl,null,re.createElement(r3,{message:o({id:"follow.placeholder.noFollowings"})})),s()):re.createElement(re.Fragment,null,re.createElement(Wl,null,n.map(l=>Gn(l)?re.createElement(Ie,{style:{fontSize:8}}):re.createElement(Zte,{key:`${l.from}-${l.to}`,userId:l.to,profileUserId:e,currentUserId:r,onClick:()=>t(l.to)}))),s())},BT=Wte;function Gi({userId:e,status:t}){let n=ze({fetcher:UserRepository.Relationship.getFollowers,params:{userId:e,status:t!=null?t:void 0},shouldCall:!!e}),{items:o}=n,r=M(n,["items"]);return c({followers:o},r)}var Xte=({profileUserId:e,currentUserId:t,userId:o,onClick:r})=>{let n=oe(o),i=se({fileId:n==null?void 0:n.avatarFileId,imageSize:"small"}),{onClickUser:a}=J(),{confirm:s}=Me(),l=be(),{formatMessage:d}=useIntl(),{isFlaggedByMe:p,toggleFlagUser:u}=ja(o||void 0),g=()=>_(void 0,null,function*(){yield u(),l.success({content:re.createElement(FormattedMessage,{id:"report.reportSent"})});}),f=()=>{o&&UserRepository.Relationship.declineMyFollower(o);},y=e===t,C=t===o,h=()=>{s({title:re.createElement(FormattedMessage,{id:"follower.title.removeUser",values:{displayName:n==null?void 0:n.displayName}}),content:re.createElement(FormattedMessage,{id:"follower.body.removeUser",values:{displayName:n==null?void 0:n.displayName}}),cancelText:d({id:"buttonText.cancel"}),okText:d({id:"buttonText.remove"}),onOk:f});},v=useCallback(()=>{o!=null&&a(o);},[a,o]),b=useMemo(()=>{let x=[];return C||x.push({name:d(p?{id:"report.unreportUser"}:{id:"report.reportUser"}),action:g}),y&&x.push({name:d({id:"follower.menuItem.removeUser"}),action:h}),x},[p,y,C,h,g]);return re.createElement(Ql,{key:o},re.createElement(t3,null,re.createElement(up,{userId:n==null?void 0:n.userId,displayName:n==null?void 0:n.displayName,avatarFileUrl:i,onClick:v}),re.createElement(So,{options:b})))};function Yte({userId:e}){let{followers:t,isLoading:o,loadMore:r,hasMore:n,loadMoreHasBeenCalled:i}=Gi({userId:e,status:"accepted"});return {items:useMemo(()=>{function s(){return new Array(5).fill(1).map((l,d)=>({skeleton:!0}))}return o&&!i?s():o&&i?[...t,...s()]:t},[t,o,i]),isLoading:o,hasMore:n,loadMore:r,loadMoreHasBeenCalled:i}}var Rte=({userId:e,onItemClick:t})=>{let{formatMessage:o}=useIntl(),{items:r,loadMore:n,hasMore:i}=Yte({userId:e}),{currentUserId:a}=X(),s=()=>i?re.createElement(ji,{onClick:()=>n==null?void 0:n()}):null;return r.length===0?re.createElement(re.Fragment,null,re.createElement(Wl,null,re.createElement(r3,{message:o({id:"follow.placeholder.noFollowers"})})),s()):re.createElement(re.Fragment,null,re.createElement(Wl,null,r.map(l=>Gn(l)?re.createElement(Ie,{style:{fontSize:8}}):re.createElement(Xte,{key:`${l.from}-${l.to}`,userId:l.from,profileUserId:e,currentUserId:a,onClick:()=>t(l.to)}))),s())},DT=Rte;var ql=m.div`
|
|
4065
4065
|
display: grid;
|
|
4066
4066
|
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
4067
4067
|
gap: 1rem;
|
|
4068
4068
|
`,HT=m(Wn)`
|
|
4069
4069
|
margin-right: auto;
|
|
4070
4070
|
margin-left: auto;
|
|
4071
|
-
`;var toe=({userId:e})=>{let t=be();return re.createElement(Ql,null,re.createElement(Xn,{userId:e}),re.createElement(kT,null,re.createElement(ye,{fullWidth:!0,onClick:()=>_(void 0,null,function*(){e&&(yield UserRepository.Relationship.acceptMyFollower(e),t.success({content:re.createElement(FormattedMessage,{id:"notification.done"})}));})},re.createElement(FormattedMessage,{id:"request.accept"})),re.createElement(
|
|
4071
|
+
`;var toe=({userId:e})=>{let t=be();return re.createElement(Ql,null,re.createElement(Xn,{userId:e}),re.createElement(kT,null,re.createElement(ye,{fullWidth:!0,onClick:()=>_(void 0,null,function*(){e&&(yield UserRepository.Relationship.acceptMyFollower(e),t.success({content:re.createElement(FormattedMessage,{id:"notification.done"})}));})},re.createElement(FormattedMessage,{id:"request.accept"})),re.createElement(Y,{fullWidth:!0,onClick:()=>_(void 0,null,function*(){e&&(yield UserRepository.Relationship.declineMyFollower(e),t.success({content:re.createElement(FormattedMessage,{id:"notification.done"})}));})},re.createElement(FormattedMessage,{id:"request.decline"}))))},ooe=({userId:e})=>{let{followers:t,hasMore:o,loadMore:r,isLoading:n,loadMoreHasBeenCalled:i}=Gi({userId:e,status:"pending"}),a=useMemo(()=>{function l(){return new Array(5).fill(1).map((d,p)=>({userId:p,skeleton:!0}))}return n&&!i?l():n&&i?[...t,...l()]:t},[t,n,i]),s=()=>o?re.createElement(ji,{onClick:()=>r()}):null;return a.length===0?re.createElement(re.Fragment,null,re.createElement(ql,null,null),s()):re.createElement(re.Fragment,null,re.createElement(ql,null,a.map(l=>Gn(l)?re.createElement(Ie,{style:{fontSize:8}}):re.createElement(toe,{key:`${l.from}-${l.to}`,userId:l.from}))),s())},OT=ooe;var Rr={FOLLOWINGS:"Followings",FOLLOWERS:"Followers"},Kl="Pending";[{value:Rr.FOLLOWINGS,label:re.createElement(FormattedMessage,{id:"tabs.followings"})},{value:Rr.FOLLOWERS,label:re.createElement(FormattedMessage,{id:"tabs.followers"})},{value:Kl,label:re.createElement(FormattedMessage,{id:"tabs.pending"})}];var zT={tabButton:"D",tabButton__text:"ha"};function _n(a){var s=a,{pageId:e="*",componentId:t="*",elementId:o="*",children:r,isActive:n=!1}=s,i=M(s,["pageId","componentId","elementId","children","isActive"]);let{accessibilityId:l,config:d,defaultConfig:p,isExcluded:u,uiReference:g,themeStyles:f}=L({pageId:e,componentId:t,elementId:o});return re.createElement(F,c({style:f,className:zT.tabButton,"data-active":n,"data-qa-anchor":l},i),re.createElement(re.Fragment,null,r))}var soe=m.div`
|
|
4072
4072
|
display: flex;
|
|
4073
4073
|
flex-direction: column;
|
|
4074
4074
|
width: 100%;
|
|
@@ -4077,7 +4077,7 @@ top: 40px;
|
|
|
4077
4077
|
border-radius: 8px;
|
|
4078
4078
|
border: 1px solid #e6e6e6;
|
|
4079
4079
|
background: #fff;
|
|
4080
|
-
`,loe=({userId:e,activeTab:t,socialSettings:o,onTabChange:r,onFollowingListClick:n,onFollowerListClick:i})=>{let{currentUserId:a}=
|
|
4080
|
+
`,loe=({userId:e,activeTab:t,socialSettings:o,onTabChange:r,onFollowingListClick:n,onFollowerListClick:i})=>{let{currentUserId:a}=X(),s=l0(o),{formatMessage:l}=useIntl(),[d,p]=useState(Object.values(Rr).map(f=>({value:f,label:f}))),{followers:u}=Gi({userId:e,status:"pending"}),g=a===e;return useEffect(()=>{u!=null&&u.length&&g&&s?p(Object.values(Rr).map(f=>({value:f,label:f})).concat({value:Kl,label:l({id:"tabs.pending"})})):p(Object.values(Rr).map(f=>({value:f,label:f})));},[l,g,u,r]),re.createElement(soe,null,re.createElement(TT,null,d.map(f=>re.createElement(_n,{key:f.value,onPress:()=>r(f.value),isActive:t===f.value},f.label))),t===Rr.FOLLOWINGS&&re.createElement(BT,{userId:e,onItemClick:f=>n(f)}),t===Rr.FOLLOWERS&&re.createElement(DT,{userId:e,onItemClick:f=>i(f)}),t.includes(Kl)&&g&&re.createElement(OT,{userId:e}))},UT=loe;var Ko={TIMELINE:"TIMELINE",GALLERY:"GALLERY",FOLLOWERS:"FOLLOWERS"},a8=[{value:Ko.TIMELINE,label:re.createElement(FormattedMessage,{id:"tabs.timeline"})},{value:Ko.GALLERY,label:re.createElement(FormattedMessage,{id:"tabs.gallery"})},{value:Ko.FOLLOWERS,label:re.createElement(FormattedMessage,{id:"tabs.followers"})}];var $T=m.div`
|
|
4081
4081
|
height: 100%;
|
|
4082
4082
|
max-width: 546px;
|
|
4083
4083
|
margin: 0 auto;
|
|
@@ -4089,9 +4089,9 @@ top: 40px;
|
|
|
4089
4089
|
@media (max-width: 768px) {
|
|
4090
4090
|
display: flex;
|
|
4091
4091
|
}
|
|
4092
|
-
`;var coe=e=>{let[t,o]=useState(0),[r,n]=useState(0),[i,a]=useState(0);return Nt({fetcher:UserRepository.Relationship.getFollowInfo,params:e,callback:s=>{s.data&&(o(s.data.followerCount),n(s.data.followingCount),a(s.data.pendingCount));},shouldCall:!!e}),{followerCount:t,followingCount:r,pendingCount:i}},jT=coe;var poe=e=>{var o;let t=Nt({fetcher:UserRepository.Relationship.getFollowInfo,params:e});return (o=t==null?void 0:t.status)!=null?o:"none"},i3=poe;var foe=({userId:e,currentUserId:t,fileUrl:o,displayName:r,description:n,isMyProfile:i,onEditUser:a,onFollowRequest:s,onFollowDecline:l,onUnFollow:d,onPendingNotificationClick:p,onFollowingCountClick:u,onFollowerCountClick:g,onReportClick:f,isFollowPending:y,isFollowNone:C,isFollowAccepted:h,followerCount:v=0,followingCount:b=0,isPrivateNetwork:x})=>{let P=oe(e),{formatMessage:I}=useIntl(),{isFlaggedByMe:w}=ja(e||void 0),{confirm:k}=Me(),{isNoNicknameUser:S,isAnonymousUser:A}=Qe(),{openNicknameModal:D}=_o(),{triggerAnonymousNeedsLogin:z}=dr(),{followers:V}=Gi({userId:t,status:"pending"}),N=P!=null&&P.displayName?I({id:"user.unfollow.confirm.title"},{displayName:P.displayName}):I({id:"user.unfollow.confirm.title.thisUser"}),O=P!=null&&P.displayName?I({id:"user.unfollow.confirm.body"},{displayName:P.displayName}):I({id:"user.unfollow.confirm.body.thisUser"}),K=[h&&!i?{name:I({id:"user.unfollow"}),action:()=>k({title:N,content:O,cancelText:I({id:"buttonText.cancel"}),okText:I({id:"buttonText.unfollow"}),onOk:()=>_(void 0,null,function*(){yield d==null?void 0:d();})})}:void 0,i?void 0:{name:I(w?{id:"report.unreportUser"}:{id:"report.reportUser"}),action:()=>{f==null||f();}},!C&&!i?{name:I(h?{id:"user.follow"}:{id:"user.unfollow"}),action:()=>{d==null||d();}}:void 0].filter(Re);return re.createElement("div",null,re.createElement(aP,{"data-qa-anchor":"user-info"},re.createElement(sP,null,re.createElement(lP,{"data-qa-anchor":"user-info-profile-image",avatar:o,backgroundImage:Ee}),re.createElement(mP,null,i?re.createElement(d7,{"data-qa-anchor":"user-info-edit-profile-button",onClick:()=>(P==null?void 0:P.userId)&&(a==null?void 0:a(P.userId))},re.createElement(iP,null)," ",re.createElement(FormattedMessage,{id:"user.editProfile"})):re.createElement(re.Fragment,null,x&&y&&re.createElement(d7,{onClick:()=>l==null?void 0:l()},re.createElement(rP,null,re.createElement(nP,null)),re.createElement(FormattedMessage,{id:"user.cancel_follow"})),C&&re.createElement(cP,{onClick:()=>{S?D():A?z():s==null||s();}},re.createElement(Cp,null)," ",re.createElement(FormattedMessage,{id:"user.follow"})))),re.createElement(gP,{options:K,pullRight:!1,onClickOptionMenu:()=>{S?D():A&&z();},isClickable:!S&&!A})),re.createElement(vP,null,re.createElement(NI,{lines:3},re.createElement(dP,{"data-qa-anchor":"user-info-profile-name"},r)),P!=null&&P.isGlobalBanned?re.createElement(Vn,{style:{marginLeft:"0.265rem",marginTop:"1px"}}):null),re.createElement(pP,null,re.createElement(p7,{onClick:()=>{u==null||u();}},Tx(b)),re.createElement(FormattedMessage,{id:"counter.followings"}),re.createElement(p7,{onClick:()=>{g==null||g();}},Tx(v)),re.createElement(FormattedMessage,{id:"counter.followers"})),re.createElement(uP,{"data-qa-anchor":"user-info-description"},n),i&&V.length>0&&x&&re.createElement(fP,{onClick:()=>{p==null||p();}},re.createElement(yP,null,re.createElement(CP,null),re.createElement(FormattedMessage,{id:"follow.pendingNotification.title"})),re.createElement(hP,null,re.createElement(FormattedMessage,{id:"follow.pendingNotification.body"})))))},ZT=e=>{let t=j("UIUserInfo");return t?t(e):re.createElement(foe,c({},e))};function l8({userId:e,callback:t}){let o=oe(e),r=useRef(null);useEffect(()=>{if(o!=null)return r.current=subscribeTopic(_b(o),t),()=>{var n;(n=r.current)==null||n.call(r);}},[]);}function m8({userId:e,callback:t}){let o=oe(e),r=useRef(null);useEffect(()=>{if(o!=null)return r.current=subscribeTopic(Sb(o),t),()=>{var n;(n=r.current)==null||n.call(r);}},[]);}var Poe=({userId:e,onUnFollow:t,onFollowingCountClick:o,onFollowerCountClick:r,onPendingNotificationClick:n,isPrivateNetwork:i})=>{let{currentUserId:a}=
|
|
4092
|
+
`;var coe=e=>{let[t,o]=useState(0),[r,n]=useState(0),[i,a]=useState(0);return Nt({fetcher:UserRepository.Relationship.getFollowInfo,params:e,callback:s=>{s.data&&(o(s.data.followerCount),n(s.data.followingCount),a(s.data.pendingCount));},shouldCall:!!e}),{followerCount:t,followingCount:r,pendingCount:i}},jT=coe;var poe=e=>{var o;let t=Nt({fetcher:UserRepository.Relationship.getFollowInfo,params:e});return (o=t==null?void 0:t.status)!=null?o:"none"},i3=poe;var foe=({userId:e,currentUserId:t,fileUrl:o,displayName:r,description:n,isMyProfile:i,onEditUser:a,onFollowRequest:s,onFollowDecline:l,onUnFollow:d,onPendingNotificationClick:p,onFollowingCountClick:u,onFollowerCountClick:g,onReportClick:f,isFollowPending:y,isFollowNone:C,isFollowAccepted:h,followerCount:v=0,followingCount:b=0,isPrivateNetwork:x})=>{let P=oe(e),{formatMessage:I}=useIntl(),{isFlaggedByMe:w}=ja(e||void 0),{confirm:k}=Me(),{isNoNicknameUser:S,isAnonymousUser:A}=Qe(),{openNicknameModal:D}=_o(),{triggerAnonymousNeedsLogin:z}=dr(),{followers:V}=Gi({userId:t,status:"pending"}),N=P!=null&&P.displayName?I({id:"user.unfollow.confirm.title"},{displayName:P.displayName}):I({id:"user.unfollow.confirm.title.thisUser"}),O=P!=null&&P.displayName?I({id:"user.unfollow.confirm.body"},{displayName:P.displayName}):I({id:"user.unfollow.confirm.body.thisUser"}),K=[h&&!i?{name:I({id:"user.unfollow"}),action:()=>k({title:N,content:O,cancelText:I({id:"buttonText.cancel"}),okText:I({id:"buttonText.unfollow"}),onOk:()=>_(void 0,null,function*(){yield d==null?void 0:d();})})}:void 0,i?void 0:{name:I(w?{id:"report.unreportUser"}:{id:"report.reportUser"}),action:()=>{f==null||f();}},!C&&!i?{name:I(h?{id:"user.follow"}:{id:"user.unfollow"}),action:()=>{d==null||d();}}:void 0].filter(Re);return re.createElement("div",null,re.createElement(aP,{"data-qa-anchor":"user-info"},re.createElement(sP,null,re.createElement(lP,{"data-qa-anchor":"user-info-profile-image",avatar:o,backgroundImage:Ee}),re.createElement(mP,null,i?re.createElement(d7,{"data-qa-anchor":"user-info-edit-profile-button",onClick:()=>(P==null?void 0:P.userId)&&(a==null?void 0:a(P.userId))},re.createElement(iP,null)," ",re.createElement(FormattedMessage,{id:"user.editProfile"})):re.createElement(re.Fragment,null,x&&y&&re.createElement(d7,{onClick:()=>l==null?void 0:l()},re.createElement(rP,null,re.createElement(nP,null)),re.createElement(FormattedMessage,{id:"user.cancel_follow"})),C&&re.createElement(cP,{onClick:()=>{S?D():A?z():s==null||s();}},re.createElement(Cp,null)," ",re.createElement(FormattedMessage,{id:"user.follow"})))),re.createElement(gP,{options:K,pullRight:!1,onClickOptionMenu:()=>{S?D():A&&z();},isClickable:!S&&!A})),re.createElement(vP,null,re.createElement(NI,{lines:3},re.createElement(dP,{"data-qa-anchor":"user-info-profile-name"},r)),P!=null&&P.isGlobalBanned?re.createElement(Vn,{style:{marginLeft:"0.265rem",marginTop:"1px"}}):null),re.createElement(pP,null,re.createElement(p7,{onClick:()=>{u==null||u();}},Tx(b)),re.createElement(FormattedMessage,{id:"counter.followings"}),re.createElement(p7,{onClick:()=>{g==null||g();}},Tx(v)),re.createElement(FormattedMessage,{id:"counter.followers"})),re.createElement(uP,{"data-qa-anchor":"user-info-description"},n),i&&V.length>0&&x&&re.createElement(fP,{onClick:()=>{p==null||p();}},re.createElement(yP,null,re.createElement(CP,null),re.createElement(FormattedMessage,{id:"follow.pendingNotification.title"})),re.createElement(hP,null,re.createElement(FormattedMessage,{id:"follow.pendingNotification.body"})))))},ZT=e=>{let t=j("UIUserInfo");return t?t(e):re.createElement(foe,c({},e))};function l8({userId:e,callback:t}){let o=oe(e),r=useRef(null);useEffect(()=>{if(o!=null)return r.current=subscribeTopic(_b(o),t),()=>{var n;(n=r.current)==null||n.call(r);}},[]);}function m8({userId:e,callback:t}){let o=oe(e),r=useRef(null);useEffect(()=>{if(o!=null)return r.current=subscribeTopic(Sb(o),t),()=>{var n;(n=r.current)==null||n.call(r);}},[]);}var Poe=({userId:e,onUnFollow:t,onFollowingCountClick:o,onFollowerCountClick:r,onPendingNotificationClick:n,isPrivateNetwork:i})=>{let{currentUserId:a}=X(),{formatMessage:s}=useIntl(),{onEditUser:l}=J(),d=be(),p=oe(e),u=se({fileId:p==null?void 0:p.avatarFileId,imageSize:"small"});ks({userId:e,level:SubscriptionLevels.USER}),l8({userId:a}),m8({userId:a});let g=i3(e),f=()=>_(void 0,null,function*(){e&&(yield UserRepository.Relationship.declineMyFollower(e),d.success({content:re.createElement(FormattedMessage,{id:"notification.done"})}));}),y=()=>_(void 0,null,function*(){e&&(yield UserRepository.Relationship.unfollow(e),t==null||t(),d.success({content:re.createElement(FormattedMessage,{id:"notification.done"})}));}),{followerCount:C,followingCount:h}=jT(e),v=()=>_(void 0,null,function*(){e&&(yield UserRepository.Relationship.follow(e));});if(g==null)return null;let b=g==="none",x=g==="accepted",P=g==="pending";return re.createElement(ZT,{userId:e,currentUserId:a,fileUrl:(p==null?void 0:p.avatarCustomUrl)||u,displayName:(p==null?void 0:p.displayName)||s({id:"anonymous"}),description:p==null?void 0:p.description,onFollowerCountClick:r,onFollowingCountClick:o,onPendingNotificationClick:n,onFollowDecline:f,onFollowRequest:v,onUnFollow:y,onEditUser:l,isMyProfile:e===a,isFollowPending:P,isPrivateNetwork:i,isFollowNone:b,isFollowAccepted:x,followerCount:C,followingCount:h})},WT=memo(Poe);m(bT)`
|
|
4093
4093
|
background-color: #fff;
|
|
4094
|
-
`;var Soe=({userId:e,socialSettings:t,isOpen:o,toggleOpen:r,hideSideMenu:n})=>{let{currentUserId:i}=
|
|
4094
|
+
`;var Soe=({userId:e,socialSettings:t,isOpen:o,toggleOpen:r,hideSideMenu:n})=>{let{currentUserId:i}=X(),[a,s]=useState(Ko.TIMELINE),[l,d]=useState(Rr.FOLLOWINGS),p=i3(e),[u,g]=useState(null),f=e===i,y=()=>_(void 0,null,function*(){s(Ko.TIMELINE);});useEffect(()=>{u==null||u.scrollTo(0,0);},[e,u]);let C=p==="accepted",h=l0(t)&&!C&&!f,v=h?a8.filter(({value:b})=>b===Ko.TIMELINE):a8;return e?re.createElement("div",null,re.createElement($T,{ref:b=>g(b)},re.createElement(VT,null,re.createElement($a,{isOtherUserProfile:e!==i})),re.createElement(WT,{key:e,userId:e,onUnFollow:y,onPendingNotificationClick:()=>{s(Ko.FOLLOWERS),d(Kl);},onFollowingCountClick:()=>{s(Ko.FOLLOWERS),d(Rr.FOLLOWINGS);},onFollowerCountClick:()=>{s(Ko.FOLLOWERS),d(Rr.FOLLOWERS);}}),re.createElement(e3,{"data-qa-anchor":"user-feed-header",tabs:v,activeTab:a,onChange:s}),a===Ko.TIMELINE&&re.createElement(Ws,{targetType:f?"myFeed":"user",targetId:e,showPostCreator:f,isHiddenProfile:h}),a===Ko.GALLERY&&re.createElement(Rp,{targetType:"user",targetId:e,grid:!0}),a===Ko.FOLLOWERS&&!h&&re.createElement(UT,{userId:e,activeTab:l,socialSettings:t,onFollowingListClick:b=>s(Ko.TIMELINE),onFollowerListClick:b=>s(Ko.TIMELINE),onTabChange:b=>d(b)}))):null},qT=Soe;var KT=m.div`
|
|
4095
4095
|
max-width: 1160px;
|
|
4096
4096
|
margin: 0 auto;
|
|
4097
4097
|
padding: 30px 0;
|
|
@@ -4102,7 +4102,7 @@ top: 40px;
|
|
|
4102
4102
|
margin-bottom: 1rem;
|
|
4103
4103
|
`,XT=m.div`
|
|
4104
4104
|
${({theme:e})=>e.typography.headline}
|
|
4105
|
-
`,YT=m(
|
|
4105
|
+
`,YT=m(Y).attrs({variant:"secondary"})`
|
|
4106
4106
|
width: 28px;
|
|
4107
4107
|
padding: 2px;
|
|
4108
4108
|
|
|
@@ -4139,11 +4139,11 @@ top: 40px;
|
|
|
4139
4139
|
display: flex;
|
|
4140
4140
|
align-items: center;
|
|
4141
4141
|
cursor: pointer;
|
|
4142
|
-
`;var{COMMUNITY_MODERATOR:sk,CHANNEL_MODERATOR:lk}=Ma,Loe=({userId:e,currentUserId:t,onClick:o,roles:r=[],assignRolesToUsers:n,hasModeratorPermissions:i,removeRolesFromUsers:a,removeMembers:s,isJoined:l,isBanned:d})=>{let p=oe(e),{formatMessage:u}=useIntl(),{isFlaggedByMe:g,toggleFlagUser:f}=ja(e),y=p==null?void 0:p.isGlobalBanned,{confirm:C}=Me(),h=be();ks({userId:e,level:SubscriptionLevels.USER});let v=()=>_(void 0,null,function*(){return f()}),b=()=>{v(),h.success({content:re.createElement(FormattedMessage,{id:"report.reportSent"})});},x=()=>_(void 0,null,function*(){v(),h.success({content:re.createElement(FormattedMessage,{id:"report.unreportSent"})});}),P=()=>n([sk,lk],[e]),I=()=>a([sk,lk],[e]),w=()=>{C({"data-qa-anchor":"remove-user",title:re.createElement(FormattedMessage,{id:"community.removeUserFromCommunityTitle"}),content:re.createElement(FormattedMessage,{id:"community.removeUserFromCommunityBody"}),cancelText:"Cancel",okText:"Remove",onOk:()=>s([e])});},k=Bs(r);return re.createElement(ik,{"data-qa-anchor":"community-member-item"},re.createElement(ak,null,re.createElement(Xn,{userId:e,isBanned:d||y,onClick:o})),!(t===e)&&l&&re.createElement(So,{"data-qa-anchor":"community-members-option-menu",options:[{name:u(g?{id:"report.unreportUser"}:{id:"report.reportUser"}),action:g?x:b},i&&!k&&!y?{name:u({id:"moderatorMenu.promoteToModerator"}),action:P}:null,i&&k?{name:u({id:"moderatorMenu.dismissModerator"}),action:I}:null,i?{name:u({id:"moderatorMenu.removeFromCommunity"}),action:w,className:"danger-zone"}:null].filter(Re)}))},u8=Loe;var Yl={MEMBERS:"MEMBERS",MODERATORS:"MODERATORS"};[{value:Yl.MEMBERS,label:re.createElement(FormattedMessage,{id:"tabs.members"})},{value:Yl.MODERATORS,label:re.createElement(FormattedMessage,{id:"tabs.moderators"})}];function g8(e,t=5){let n=ze({fetcher:CommunityRepository.Membership.getMembers,params:{communityId:e,limit:t,memberships:["member"]},shouldCall:!!e}),{items:o}=n,r=M(n,["items"]);return c({members:o},r)}var Ooe=({community:e,members:t,loadMore:o,hasMore:r})=>{let n=e==null?void 0:e.communityId,{currentUserId:i}=
|
|
4142
|
+
`;var{COMMUNITY_MODERATOR:sk,CHANNEL_MODERATOR:lk}=Ma,Loe=({userId:e,currentUserId:t,onClick:o,roles:r=[],assignRolesToUsers:n,hasModeratorPermissions:i,removeRolesFromUsers:a,removeMembers:s,isJoined:l,isBanned:d})=>{let p=oe(e),{formatMessage:u}=useIntl(),{isFlaggedByMe:g,toggleFlagUser:f}=ja(e),y=p==null?void 0:p.isGlobalBanned,{confirm:C}=Me(),h=be();ks({userId:e,level:SubscriptionLevels.USER});let v=()=>_(void 0,null,function*(){return f()}),b=()=>{v(),h.success({content:re.createElement(FormattedMessage,{id:"report.reportSent"})});},x=()=>_(void 0,null,function*(){v(),h.success({content:re.createElement(FormattedMessage,{id:"report.unreportSent"})});}),P=()=>n([sk,lk],[e]),I=()=>a([sk,lk],[e]),w=()=>{C({"data-qa-anchor":"remove-user",title:re.createElement(FormattedMessage,{id:"community.removeUserFromCommunityTitle"}),content:re.createElement(FormattedMessage,{id:"community.removeUserFromCommunityBody"}),cancelText:"Cancel",okText:"Remove",onOk:()=>s([e])});},k=Bs(r);return re.createElement(ik,{"data-qa-anchor":"community-member-item"},re.createElement(ak,null,re.createElement(Xn,{userId:e,isBanned:d||y,onClick:o})),!(t===e)&&l&&re.createElement(So,{"data-qa-anchor":"community-members-option-menu",options:[{name:u(g?{id:"report.unreportUser"}:{id:"report.reportUser"}),action:g?x:b},i&&!k&&!y?{name:u({id:"moderatorMenu.promoteToModerator"}),action:P}:null,i&&k?{name:u({id:"moderatorMenu.dismissModerator"}),action:I}:null,i?{name:u({id:"moderatorMenu.removeFromCommunity"}),action:w,className:"danger-zone"}:null].filter(Re)}))},u8=Loe;var Yl={MEMBERS:"MEMBERS",MODERATORS:"MODERATORS"};[{value:Yl.MEMBERS,label:re.createElement(FormattedMessage,{id:"tabs.members"})},{value:Yl.MODERATORS,label:re.createElement(FormattedMessage,{id:"tabs.moderators"})}];function g8(e,t=5){let n=ze({fetcher:CommunityRepository.Membership.getMembers,params:{communityId:e,limit:t,memberships:["member"]},shouldCall:!!e}),{items:o}=n,r=M(n,["items"]);return c({members:o},r)}var Ooe=({community:e,members:t,loadMore:o,hasMore:r})=>{let n=e==null?void 0:e.communityId,{currentUserId:i}=X(),{canEditUser:a,canEditPost:s,canReviewPost:l}=Fa({community:e});return {community:e,members:t,currentUserId:i,hasMoreMembers:r,canEditPost:s,canReviewPost:l,canEditUser:a,loadMoreMembers:o,assignRolesToUsers:(g,f)=>n&&CommunityRepository.Moderation.addRoles(n,g,f),removeRolesFromUsers:(g,f)=>n&&CommunityRepository.Moderation.removeRoles(n,g,f),removeMembers:g=>n&&CommunityRepository.Membership.removeMembers(n,g)}};m.div`
|
|
4143
4143
|
width: 100%;
|
|
4144
4144
|
height: 1px;
|
|
4145
4145
|
background-color: var(--neutral-200);
|
|
4146
|
-
`;var zoe=({community:e,members:t,loadMore:o,hasMore:r})=>{let{onClickUser:n}=J(),{hasMoreMembers:i,loadMoreMembers:a,currentUserId:s,canEditUser:l,assignRolesToUsers:d,removeRolesFromUsers:p,removeMembers:u}=Ooe({community:e,hasMore:r,loadMore:o,members:t});return t.length===0?null:re.createElement(To,{hasMore:i,loadMore:a,contentSlot:t.map(({userId:g,roles:f,isBanned:y})=>re.createElement(u8,{key:g,userId:g,currentUserId:s||"",roles:f,assignRolesToUsers:d,removeRolesFromUsers:p,removeMembers:u,hasModeratorPermissions:l,isJoined:e==null?void 0:e.isJoined,isBanned:y,onClick:()=>n(g)}))})},Uoe=({community:e})=>{let t=e==null?void 0:e.communityId,{currentUserId:o}=
|
|
4146
|
+
`;var zoe=({community:e,members:t,loadMore:o,hasMore:r})=>{let{onClickUser:n}=J(),{hasMoreMembers:i,loadMoreMembers:a,currentUserId:s,canEditUser:l,assignRolesToUsers:d,removeRolesFromUsers:p,removeMembers:u}=Ooe({community:e,hasMore:r,loadMore:o,members:t});return t.length===0?null:re.createElement(To,{hasMore:i,loadMore:a,contentSlot:t.map(({userId:g,roles:f,isBanned:y})=>re.createElement(u8,{key:g,userId:g,currentUserId:s||"",roles:f,assignRolesToUsers:d,removeRolesFromUsers:p,removeMembers:u,hasModeratorPermissions:l,isJoined:e==null?void 0:e.isJoined,isBanned:y,onClick:()=>n(g)}))})},Uoe=({community:e})=>{let t=e==null?void 0:e.communityId,{currentUserId:o}=X(),{moderators:r,hasMore:n,loadMore:i}=Li(t),a=r.find(f=>f.userId===o),s=oe(o),l=Bs(a==null?void 0:a.roles),d=s0(a)&&l||Bs(s==null?void 0:s.roles)||vx(s==null?void 0:s.roles);return {moderators:r,currentUserId:o,hasMoreModerators:n,loadMoreModerators:i,hasModeratorPermissions:d,assignRolesToUsers:(f,y)=>t&&CommunityRepository.Moderation.addRoles(t,f,y),removeRolesFromUsers:(f,y)=>t&&CommunityRepository.Moderation.removeRoles(t,f,y),removeMembers:f=>t&&CommunityRepository.Membership.removeMembers(t,f)}},$oe=({community:e})=>{let{onClickUser:t}=J(),{currentUserId:o,moderators:r,hasMoreModerators:n,loadMoreModerators:i,hasModeratorPermissions:a,assignRolesToUsers:s,removeRolesFromUsers:l,removeMembers:d}=Uoe({community:e});return r.length===0?null:re.createElement(To,{hasMore:n,loadMore:i,contentSlot:r.map(({userId:p,roles:u,isBanned:g})=>re.createElement(u8,{key:p,userId:p,currentUserId:o||"",roles:u,assignRolesToUsers:s,removeRolesFromUsers:l,removeMembers:d,hasModeratorPermissions:a,isJoined:e==null?void 0:e.isJoined,isBanned:g,onClick:f=>f&&t(f)}))})},Voe=({communityId:e})=>{let{formatMessage:t}=useIntl(),{hasMore:o,loadMore:r,loadMoreHasBeenCalled:n,isLoading:i,members:a}=g8(e),s=wt(e),l=[{value:"MEMBERS",label:t({id:"CommunityMembers.members"})},{value:"MODERATORS",label:t({id:"CommunityMembers.moderators"})}],[d,p]=useState(Yl.MEMBERS);return re.createElement(nk,null,re.createElement(rk,null,l.map(u=>re.createElement(_n,{key:u.value,onPress:()=>p(u.value),isActive:d===u.value},u.label))),d===Yl.MEMBERS&&re.createElement(zoe,{community:s,hasMore:o,loadMore:r,members:a}),d===Yl.MODERATORS&&re.createElement($oe,{community:s}))},s3=memo(e=>{let t=j("CommunityMembers");return t?t(e):re.createElement(Voe,c({},e))});m.div`
|
|
4147
4147
|
${({breakpoints:e})=>e.map(({breakpoint:t,show:o})=>`
|
|
4148
4148
|
@media (min-width: ${t}px) {
|
|
4149
4149
|
display: ${o?"block":"none"};
|
|
@@ -4307,7 +4307,7 @@ top: 40px;
|
|
|
4307
4307
|
padding: 10px 16px;
|
|
4308
4308
|
justify-content: center;
|
|
4309
4309
|
width: 100%;
|
|
4310
|
-
`;m(
|
|
4310
|
+
`;m(Y)`
|
|
4311
4311
|
padding: 10px 16px;
|
|
4312
4312
|
justify-content: center;
|
|
4313
4313
|
width: 100%;
|
|
@@ -4446,7 +4446,7 @@ top: 40px;
|
|
|
4446
4446
|
justify-content: center;
|
|
4447
4447
|
border-radius: 100px;
|
|
4448
4448
|
box-sizing: border-box;
|
|
4449
|
-
`,sN=m(
|
|
4449
|
+
`,sN=m(Y)`
|
|
4450
4450
|
border-radius: 100px;
|
|
4451
4451
|
border: 1px solid #000;
|
|
4452
4452
|
`,lN=m.div`
|
|
@@ -4763,7 +4763,7 @@ top: 40px;
|
|
|
4763
4763
|
justify-content: center;
|
|
4764
4764
|
width: 100%;
|
|
4765
4765
|
height: 100%;
|
|
4766
|
-
`,zde=()=>{let{page:e}=J(),{client:t}=
|
|
4766
|
+
`,zde=()=>{let{page:e}=J(),{client:t}=X(),[o,r]=useState(null),[n,i]=useState(!1),a=()=>{i(!n);};return useEffect(()=>{if(t===null)return;function s(){return _(this,null,function*(){let l=yield t==null?void 0:t.getSocialSettings();l&&r(l);})}s();},[t]),useEffect(()=>{n&&i(!1);},[e.type,e.communityId]),re.createElement(Uk,null,re.createElement(Hde,null,re.createElement(m_,{aside:re.createElement(Fde,{activeCommunity:e.communityId})},e.type==="explore"&&re.createElement(cc,{isOpen:n,toggleOpen:a}),e.type==="newsfeed"&&re.createElement(IT,{toggleOpen:a,isOpen:n}),e.type==="postdetail"&&re.createElement(XL,{targetId:e.targetId,targetType:e.targetType}),e.type==="communityfeed"&&re.createElement(gN,{communityId:e.communityId,isNewCommunity:e.isNewCommunity,isOpen:n,toggleOpen:a}),e.type==="viewstory"&&re.createElement(Ode,null,re.createElement(jL,{targetId:e.targetId,type:e.storyType})),e.type==="draftpage"&&re.createElement(QL,{mediaType:e.mediaType,targetId:e.targetId,targetType:e.targetType}),e.type==="communityedit"&&re.createElement(wk,{communityId:e.communityId,tab:e.tab}),e.type==="category"&&re.createElement(ok,{categoryId:e.categoryId}),e.type==="userfeed"&&re.createElement(qT,{userId:e.userId,socialSettings:o,isOpen:n,toggleOpen:a}),e.type==="useredit"&&re.createElement(Ok,{userId:e.userId}),e.type==="mycommunities"&&re.createElement(M9,null))))},Ude=zde;var tA={DIRECT_CHAT:2,ONLY_ME_CHAT:1};function Zde(e,t){var i,a,s;if((i=e==null?void 0:e.metadata)!=null&&i.isDirectChat&&(e==null?void 0:e.memberCount)===tA.ONLY_ME_CHAT)return "Me";if(!((a=e==null?void 0:e.metadata)!=null&&a.isDirectChat)&&(e!=null&&e.displayName))return e==null?void 0:e.displayName;let{firstname:o="",lastname:r=""}=(s=t==null?void 0:t.metadata)!=null?s:{},n=trim(`${o}${r}`);return (t==null?void 0:t.displayName)||n||(t==null?void 0:t.userId)||e.channelId}function _9(o){return _(this,arguments,function*({avatarFileId:e,avatarCustomUrl:t}){if(t)return t;if(e){let r=yield FileRepository.getFile(e);return FileRepository.fileUrlWithSize(r.data.fileUrl,"small")}return null})}function Qde(a){return _(this,arguments,function*({channelAvatarFileId:e,channelAvatarCustomUrl:t,otherUserAvatarUrl:o,currentUserAvatarUrl:r,isDirectChat:n,memberCount:i=0}){return i===tA.ONLY_ME_CHAT?_9({avatarCustomUrl:r}):_9(n&&o?{avatarCustomUrl:o}:{avatarFileId:e,avatarCustomUrl:t})})}function Wde({channel:e}){var p,u,g,f,y;let{currentUserId:t}=Z1(),[o,r]=useState(null),n=(p=e==null?void 0:e.metadata)!=null&&p.isDirectChat?((g=(u=e==null?void 0:e.metadata)==null?void 0:u.userIds)!=null?g:[]).find(C=>C!==t):null,i=oe(t),a=oe(n),s=se({fileId:i==null?void 0:i.avatarFileId}),l=se({fileId:a==null?void 0:a.avatarFileId});return useEffect(()=>{function C(){return _(this,null,function*(){var v,b;let h=yield Qde({channelAvatarFileId:e==null?void 0:e.avatarFileId,channelAvatarCustomUrl:(v=e==null?void 0:e.metadata)==null?void 0:v.avatarCustomUrl,otherUserAvatarUrl:(a==null?void 0:a.avatarCustomUrl)||l,currentUserAvatarUrl:(i==null?void 0:i.avatarCustomUrl)||s,isDirectChat:(b=e==null?void 0:e.metadata)==null?void 0:b.isDirectChat,memberCount:e==null?void 0:e.memberCount});r(h);})}C();},[a==null?void 0:a.avatarCustomUrl,(f=e==null?void 0:e.metadata)==null?void 0:f.isDirectChat,e==null?void 0:e.memberCount,e==null?void 0:e.avatarFileId,(y=e==null?void 0:e.metadata)==null?void 0:y.avatarCustomUrl,s,i==null?void 0:i.avatarCustomUrl]),{chatName:useMemo(()=>e==null?void 0:Zde(e,a),[e,a]),chatAvatar:o,type:e==null?void 0:e.type}}var Gm=Wde;var oA=m(Fe)`
|
|
4767
4767
|
display: flex;
|
|
4768
4768
|
align-items: center;
|
|
4769
4769
|
width: 100%;
|
|
@@ -4950,7 +4950,7 @@ top: 40px;
|
|
|
4950
4950
|
display: flex;
|
|
4951
4951
|
flex-direction: column-reverse;
|
|
4952
4952
|
padding: 0 20px;
|
|
4953
|
-
`;function pd(e){let r=ze({fetcher:MessageRepository.getMessages,params:e,shouldCall:!!e.subChannelId}),{items:t}=r,o=M(r,["items"]);return c({messages:t},o)}var $0e=({message:e,isConsequent:t,isIncoming:o,containerRef:r})=>{let n=oe(e.creatorId),i=se({fileId:n==null?void 0:n.avatarFileId,imageSize:"small"});return re.createElement(VA,{key:e.messageId,avatar:i||"",messageId:e.messageId,data:(e==null?void 0:e.data)||"",type:e.dataType,createdAt:new Date(e.createdAt),isDeleted:e.isDeleted,userDisplayName:(n==null?void 0:n.displayName)||"",isConsequent:t,isIncoming:o,containerRef:r})},V0e=({channelId:e})=>{let{client:t}=
|
|
4953
|
+
`;function pd(e){let r=ze({fetcher:MessageRepository.getMessages,params:e,shouldCall:!!e.subChannelId}),{items:t}=r,o=M(r,["items"]);return c({messages:t},o)}var $0e=({message:e,isConsequent:t,isIncoming:o,containerRef:r})=>{let n=oe(e.creatorId),i=se({fileId:n==null?void 0:n.avatarFileId,imageSize:"small"});return re.createElement(VA,{key:e.messageId,avatar:i||"",messageId:e.messageId,data:(e==null?void 0:e.data)||"",type:e.dataType,createdAt:new Date(e.createdAt),isDeleted:e.isDeleted,userDisplayName:(n==null?void 0:n.displayName)||"",isConsequent:t,isIncoming:o,containerRef:r})},V0e=({channelId:e})=>{let{client:t}=X(),o=useRef(null),{messages:r,hasMore:n,loadMore:i,isLoading:a}=pd({subChannelId:e,sortBy:"segmentDesc",limit:20});return dd({channelId:e}),re.createElement(jA,{ref:o},o.current?re.createElement(RJ,{scrollableTarget:o.current,scrollThreshold:.7,hasMore:n,next:i,loader:a?re.createElement("span",{key:0},"Loading..."):null,inverse:!0,dataLength:(r==null?void 0:r.length)||0,style:{display:"flex",flexDirection:"column-reverse"},height:o.current.clientHeight},re.createElement(GA,{ref:o,"data-qa-anchor":"message-list"},r.map((s,l)=>{let d=r[l+1],p=d&&d.creatorId===s.creatorId,u=s.creatorId!==(t==null?void 0:t.userId);return !(s!=null&&s.data)||!s.createdAt?re.createElement(re.Fragment,null):re.createElement($0e,{key:s.messageId,message:s,isConsequent:p,isIncoming:u,containerRef:o})}))):null)},ZA=e=>{let t=j("MessageList");return t?t(e):re.createElement(V0e,c({},e))};var QA=m(S4).attrs({width:28,height:28})`
|
|
4954
4954
|
cursor: pointer;
|
|
4955
4955
|
margin-left: 12px;
|
|
4956
4956
|
margin-right: 8px;
|
|
@@ -5212,7 +5212,7 @@ top: 40px;
|
|
|
5212
5212
|
display: flex;
|
|
5213
5213
|
height: 100%;
|
|
5214
5214
|
width: 100%;
|
|
5215
|
-
`;var bpe=({name:e})=>re.createElement("div",{"data-qa-anchor":`chat-type-selector-item-${e}`},e),Ipe=({onChange:e,parentContainer:t})=>{let{formatMessage:o}=useIntl(),r=["live","community","conversation","broadcast"].map(n=>({name:o({id:"select.chatType.item"},{answerType:n}),value:n}));return re.createElement(aD,{"data-qa-anchor":"chat-type",options:r,value:[r[0]],parentContainer:t,renderItem:bpe,onSelect:({value:n})=>e(n)})},tH=Ipe;var _pe=({children:e})=>re.createElement(iD,null,re.createElement(nD,null,e)),Spe=({className:e,onCancel:t,onSubmit:o})=>{let{formatMessage:r}=useIntl(),[n,i]=re.useState(!1),a={type:"live",displayName:void 0,avatarFileId:void 0,userIds:[],tags:[]},{register:s,handleSubmit:l,watch:d,control:p,formState:{errors:u,isDirty:g}}=useForm({defaultValues:a}),f=d("userIds"),y=v=>_(void 0,null,function*(){i(!0);try{let b={displayName:v.displayName,type:(v==null?void 0:v.type)||"community",avatarFileId:(v==null?void 0:v.avatarFileId)||void 0,userIds:v==null?void 0:v.userIds,tags:v==null?void 0:v.tags};yield o==null?void 0:o(b);}finally{i(!1);}}),C=!g||f.length===0||n,h=useRef(null);return re.createElement(lD,null,re.createElement(dD,{className:e,onSubmit:l(y)},re.createElement(cD,{ref:h},re.createElement(_pe,null,re.createElement(ud,null,re.createElement(A9,null,re.createElement(L9,null,re.createElement(ou,null,re.createElement(FormattedMessage,{id:"chatComposer.label.type"})))),re.createElement(pD,null,re.createElement(Controller,{name:"type",rules:{required:"Channel type is required"},render:x=>{var {field:P}=x,I=P,b=M(I,["ref"]);return re.createElement(tH,c({parentContainer:h.current},b))},control:p,defaultValue:""}))),re.createElement(ud,null,re.createElement(A9,null,re.createElement(L9,null,re.createElement(ou,null,re.createElement(FormattedMessage,{id:"chatComposer.label.displayName"})))),re.createElement(sD,E(c({},s("displayName")),{placeholder:r({id:"chat_composer.placeholder.displayName"}),"data-qa-anchor":"chat-composer-display-name-input"})),re.createElement(D9,{errors:u,name:"displayName"})),re.createElement(ud,null,re.createElement(Controller,{name:"avatarFileId",control:p,render:x=>{var {field:P}=x,I=P,b=M(I,["ref"]);return re.createElement(Ba,c({mimeType:"image/png, image/jpeg"},b))},defaultValue:void 0})),re.createElement(ud,null,re.createElement(ou,{className:"required"},re.createElement(FormattedMessage,{id:"chatComposer.addUsers"})),re.createElement(Controller,{name:"userIds",render:x=>{var {field:P}=x,I=P,b=M(I,["ref"]);return re.createElement(Aa,E(c({parentContainer:h.current},b),{"data-qa-anchor":"chat-composer-select-user-input"}))},control:p}),re.createElement(D9,{errors:u,name:"userIds"})))),re.createElement(mD,null,re.createElement(
|
|
5215
|
+
`;var bpe=({name:e})=>re.createElement("div",{"data-qa-anchor":`chat-type-selector-item-${e}`},e),Ipe=({onChange:e,parentContainer:t})=>{let{formatMessage:o}=useIntl(),r=["live","community","conversation","broadcast"].map(n=>({name:o({id:"select.chatType.item"},{answerType:n}),value:n}));return re.createElement(aD,{"data-qa-anchor":"chat-type",options:r,value:[r[0]],parentContainer:t,renderItem:bpe,onSelect:({value:n})=>e(n)})},tH=Ipe;var _pe=({children:e})=>re.createElement(iD,null,re.createElement(nD,null,e)),Spe=({className:e,onCancel:t,onSubmit:o})=>{let{formatMessage:r}=useIntl(),[n,i]=re.useState(!1),a={type:"live",displayName:void 0,avatarFileId:void 0,userIds:[],tags:[]},{register:s,handleSubmit:l,watch:d,control:p,formState:{errors:u,isDirty:g}}=useForm({defaultValues:a}),f=d("userIds"),y=v=>_(void 0,null,function*(){i(!0);try{let b={displayName:v.displayName,type:(v==null?void 0:v.type)||"community",avatarFileId:(v==null?void 0:v.avatarFileId)||void 0,userIds:v==null?void 0:v.userIds,tags:v==null?void 0:v.tags};yield o==null?void 0:o(b);}finally{i(!1);}}),C=!g||f.length===0||n,h=useRef(null);return re.createElement(lD,null,re.createElement(dD,{className:e,onSubmit:l(y)},re.createElement(cD,{ref:h},re.createElement(_pe,null,re.createElement(ud,null,re.createElement(A9,null,re.createElement(L9,null,re.createElement(ou,null,re.createElement(FormattedMessage,{id:"chatComposer.label.type"})))),re.createElement(pD,null,re.createElement(Controller,{name:"type",rules:{required:"Channel type is required"},render:x=>{var {field:P}=x,I=P,b=M(I,["ref"]);return re.createElement(tH,c({parentContainer:h.current},b))},control:p,defaultValue:""}))),re.createElement(ud,null,re.createElement(A9,null,re.createElement(L9,null,re.createElement(ou,null,re.createElement(FormattedMessage,{id:"chatComposer.label.displayName"})))),re.createElement(sD,E(c({},s("displayName")),{placeholder:r({id:"chat_composer.placeholder.displayName"}),"data-qa-anchor":"chat-composer-display-name-input"})),re.createElement(D9,{errors:u,name:"displayName"})),re.createElement(ud,null,re.createElement(Controller,{name:"avatarFileId",control:p,render:x=>{var {field:P}=x,I=P,b=M(I,["ref"]);return re.createElement(Ba,c({mimeType:"image/png, image/jpeg"},b))},defaultValue:void 0})),re.createElement(ud,null,re.createElement(ou,{className:"required"},re.createElement(FormattedMessage,{id:"chatComposer.addUsers"})),re.createElement(Controller,{name:"userIds",render:x=>{var {field:P}=x,I=P,b=M(I,["ref"]);return re.createElement(Aa,E(c({parentContainer:h.current},b),{"data-qa-anchor":"chat-composer-select-user-input"}))},control:p}),re.createElement(D9,{errors:u,name:"userIds"})))),re.createElement(mD,null,re.createElement(Y,{onClick:v=>{v.preventDefault(),t==null||t();}},re.createElement(FormattedMessage,{id:"cancel"})),re.createElement(uD,{"data-qa-anchor":"chat-composer-submit-button",disabled:C},re.createElement(FormattedMessage,{id:"create"})))))},oH=Spe;var Npe=({onClose:e})=>{let{formatMessage:t}=useIntl(),{confirm:o}=Me(),r=be(),n=a=>_(void 0,null,function*(){try{yield ChannelRepository.createChannel(a),e();}catch(s){s instanceof Error&&r.error({content:s.message});}}),i=()=>o({title:t({id:"CommunityCreationModal.title"}),content:t({id:"CommunityCreationModal.content"}),cancelText:t({id:"CommunityCreationModal.cancelText"}),okText:t({id:"CommunityCreationModal.okText"}),onOk:e});return re.createElement(Yt,{"data-qa-anchor":"create-chat-modal",title:t({id:"chat_modal.title"}),onCancel:i},re.createElement(oH,{onSubmit:n,onCancel:i}))},nH=Npe;m.div`
|
|
5216
5216
|
display: flex;
|
|
5217
5217
|
flex-direction: column;
|
|
5218
5218
|
flex-grow: 1;
|
|
@@ -5275,7 +5275,7 @@ top: 40px;
|
|
|
5275
5275
|
min-width: 100px;
|
|
5276
5276
|
margin-left: 0;
|
|
5277
5277
|
`};
|
|
5278
|
-
`;var Fpe=({children:e})=>re.createElement(aH,null,re.createElement(iH,null,e)),Ope=({channelId:e,className:t,memberIds:o,onCancel:r,onSubmit:n})=>{let[i,a]=re.useState(!1),s=be(),l={userIds:o},{register:d,handleSubmit:p,watch:u,control:g,formState:{errors:f,isDirty:y}}=useForm({defaultValues:l}),C=u("userIds"),h=P=>_(void 0,[P],function*({userIds:x}){a(!0);try{n==null||n(x);let I=o.filter(k=>!x.includes(k)),w=x.filter(k=>!o.includes(k));return Promise.all([(w==null?void 0:w.length)>0?ChannelRepository.Membership.addMembers(e,w):null,(I==null?void 0:I.length)>0?ChannelRepository.Membership.removeMembers(e,I):null].filter(Re))}catch(I){I instanceof Error&&s.error({content:I.message});}finally{a(!1);}}),v=!y||C.length===0||i,b=useRef(null);return re.createElement(lH,null,re.createElement(uH,{className:t,onSubmit:p(h)},re.createElement(pH,{ref:b},re.createElement(Fpe,null,re.createElement(mH,null,re.createElement(sH,{className:"required"},re.createElement(FormattedMessage,{id:"chatComposer.addUsers"})),re.createElement(Controller,{name:"userIds",render:I=>{var {field:w}=I,k=w,P=M(k,["ref"]);return re.createElement(Aa,E(c({parentContainer:b.current},P),{"data-qa-anchor":"edit-chat-members-composer-select-user-input"}))},control:g}),re.createElement(cH,{errors:f,name:"userIds"})))),re.createElement(dH,null,re.createElement(
|
|
5278
|
+
`;var Fpe=({children:e})=>re.createElement(aH,null,re.createElement(iH,null,e)),Ope=({channelId:e,className:t,memberIds:o,onCancel:r,onSubmit:n})=>{let[i,a]=re.useState(!1),s=be(),l={userIds:o},{register:d,handleSubmit:p,watch:u,control:g,formState:{errors:f,isDirty:y}}=useForm({defaultValues:l}),C=u("userIds"),h=P=>_(void 0,[P],function*({userIds:x}){a(!0);try{n==null||n(x);let I=o.filter(k=>!x.includes(k)),w=x.filter(k=>!o.includes(k));return Promise.all([(w==null?void 0:w.length)>0?ChannelRepository.Membership.addMembers(e,w):null,(I==null?void 0:I.length)>0?ChannelRepository.Membership.removeMembers(e,I):null].filter(Re))}catch(I){I instanceof Error&&s.error({content:I.message});}finally{a(!1);}}),v=!y||C.length===0||i,b=useRef(null);return re.createElement(lH,null,re.createElement(uH,{className:t,onSubmit:p(h)},re.createElement(pH,{ref:b},re.createElement(Fpe,null,re.createElement(mH,null,re.createElement(sH,{className:"required"},re.createElement(FormattedMessage,{id:"chatComposer.addUsers"})),re.createElement(Controller,{name:"userIds",render:I=>{var {field:w}=I,k=w,P=M(k,["ref"]);return re.createElement(Aa,E(c({parentContainer:b.current},P),{"data-qa-anchor":"edit-chat-members-composer-select-user-input"}))},control:g}),re.createElement(cH,{errors:f,name:"userIds"})))),re.createElement(dH,null,re.createElement(Y,{onClick:x=>{x.preventDefault(),r==null||r();},disabled:y},re.createElement(FormattedMessage,{id:"cancel"})),re.createElement(gH,{"data-qa-anchor":"edit-chat-members-composer-submit-button",disabled:v},re.createElement(FormattedMessage,{id:"save"})))))};function U9(e){let l=e,{channelId:t}=l,o=M(l,["channelId"]),{isLoading:r,channelMembers:n,hasMore:i,loadMore:a}=vd(t),s=n.map(d=>d.userId);return r||t==null?null:re.createElement(Ope,E(c({},o),{channelId:t,memberIds:s}))}var Upe=({channelId:e,onClose:t})=>{let{formatMessage:o}=useIntl(),{confirm:r}=Me(),n=be(),i=s=>_(void 0,null,function*(){try{t();}catch(l){l instanceof Error&&n.error({content:l.message});}}),a=()=>r({title:o({id:"editChatMembersModal.confirm.title"}),content:o({id:"editChatMembersModal.confirm.content"}),cancelText:o({id:"editChatMembersModal.confirm.cancelText"}),okText:o({id:"editChatMembersModal.confirm.okText"}),onOk:t});return re.createElement(Yt,{"data-qa-anchor":"edit-chat-members-modal",title:o({id:"editChatMembersModal.title"}),onCancel:a},re.createElement(U9,{channelId:e,onSubmit:i,onCancel:a}))},hH=Upe;var jpe=({membershipFilter:e="all",defaultChannelId:t,onMemberSelect:o,onChannelSelect:r,onAddNewChannel:n,onEditChatMember:i})=>{let{formatMessage:a}=useIntl(),[s,l]=useState(null),[d,p]=useState(!1),u=be(),g=()=>p(!0),f=()=>p(!1),[y,C]=useState(!1),[h,v]=useState(!1),b=()=>C(!0),x=I=>{(s==null?void 0:s.channelId)!==(I==null?void 0:I.channelId)&&(f(),l(I),r==null||r(I));},P=()=>_(void 0,null,function*(){if(s!=null&&s.channelId)try{yield ChannelRepository.leaveChannel(s.channelId),u.success({content:a({id:"chat.leaveChat.success"})}),l(null);}catch(I){u.error({content:a({id:"chat.leaveChat.error"})});}});return useEffect(()=>{function I(){return _(this,null,function*(){return Client.startUnreadSync()})}return I(),()=>{Client.stopUnreadSync();}},[]),useEffect(()=>{t&&x({channelId:t,type:"standard"});},[t]),re.createElement(RD,null,re.createElement(CA,{selectedChannelId:s==null?void 0:s.channelId,membershipFilter:e,onChannelSelect:x,onAddNewChannelClick:()=>{b(),n==null||n();}}),s?re.createElement(gD,{channelId:s.channelId,shouldShowChatDetails:d,onChatDetailsClick:g}):null,d&&s?re.createElement(YD,{channelId:s.channelId,leaveChat:P,onEditChatMemberClick:I=>{v(!0),i==null||i(I);},onMemberSelect:o,onClose:f}):null,y?re.createElement(nH,{onClose:()=>C(!1)}):null,h&&s?re.createElement(hH,{channelId:s==null?void 0:s.channelId,onClose:()=>v(!1)}):null)},Gpe=jpe;var xH=(e,t)=>_(void 0,null,function*(){return ChannelRepository.Membership.addMembers(e,t)});var bH=(e,t)=>_(void 0,null,function*(){return ChannelRepository.Membership.removeMembers(e,t)});var Do=class Do{constructor(){this.client=null;this.isConnected=!1;this.stateChangeHandler=null;this.disconnectedHandler=null;}static setup(t){if(!Do.instance){Do.instance=new Do;let o=Client.createClient(t.apiKey,t.apiRegion,t!=null&&t.apiEndpoint?{apiEndpoint:t.apiEndpoint}:{});Do.setClient(o);}}static registerDevice(l){return _(this,arguments,function*({userId:t,displayName:o,sessionHandler:r,authToken:n,onConnectionStatusChange:i,onConnected:a,onDisconnected:s}){if(!Do.instance)throw new Error("AmityUIKitManager must be set up first using the setup method.");Do.instance.onConnectionStatusChange=i,Do.instance.onConnected=a,Do.instance.onDisconnected=s,yield Do.instance.connectAndLogin({userId:t,displayName:o,sessionHandler:r,authToken:n});})}static setClient(t){if(Do.instance)Do.instance.client=t,Do.instance.isConnected=!0;else throw new Error("AmityUIKitManager must be set up first using the setup method.")}connectAndLogin(i){return _(this,arguments,function*({userId:t,displayName:o,sessionHandler:r,authToken:n}){yield Client.login({userId:t,displayName:o,authToken:n},{sessionWillRenewAccessToken:r.sessionWillRenewAccessToken.bind(r)}),this.stateChangeHandler=Client.onSessionStateChange(a=>{var s;(s=this.onConnectionStatusChange)==null||s.call(this,a);}),this.disconnectedHandler=Client.onClientDisconnected(()=>{this.onDisconnected&&this.onDisconnected();}),this.onConnected&&this.onConnected();})}disconnect(){var t,o;(t=this.stateChangeHandler)==null||t.call(this),(o=this.disconnectedHandler)==null||o.call(this),this.client=null,this.isConnected=!1;}static getClient(){var t;return ((t=Do.instance)==null?void 0:t.client)||null}isClientConnected(){return this.isConnected}};Do.instance=null;var $9=Do;var Wpe=e=>re.createElement("svg",c({width:"100%",height:"100%",viewBox:"0 0 121 121",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("rect",{x:"0.5",y:"0.5",width:"120",height:"120",rx:"60",fill:"#D9E5FC"}),re.createElement("path",{d:"M53.3621 77.2578V64.4753C53.3621 61.6791 55.6698 59.3623 58.4549 59.3623H81.3727C84.2374 59.3623 86.4655 61.6791 86.4655 64.4753V77.2578C86.4655 80.1339 84.2374 82.3708 81.3727 82.3708V86.7648C81.3727 87.404 80.6565 87.7235 80.179 87.3241L73.5743 82.3708H58.4549C55.6698 82.3708 53.3621 80.1339 53.3621 77.2578Z",fill:"white"}),re.createElement("path",{d:"M78.1733 64.1802V46.5515C78.1733 42.2387 74.5708 38.6888 70.2321 38.6888H40.63C36.1715 38.6888 32.6888 42.247 32.6888 46.5515V64.1802C32.6888 68.3305 35.7628 71.6152 39.8188 72.0042V77.2915C39.8188 78.8883 41.6295 79.6431 42.7981 78.7042L51.8149 72.0429H70.2321C74.5625 72.0429 78.1733 68.6113 78.1733 64.1802Z",fill:"white",stroke:"#D9E5FC",strokeWidth:"1.6224"})),IH=Wpe;var qpe=e=>re.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 448 512",fill:"currentColor"},e),re.createElement("path",{d:`M313.6 304c-28.7 0-42.5 16-89.6 16-47.1 0-60.8-16-89.6-16C60.2 304 0 364.2 0
|
|
5279
5279
|
438.4V464c0 26.5 21.5 48 48 48h352c26.5 0
|
|
5280
5280
|
48-21.5 48-48v-25.6c0-74.2-60.2-134.4-134.4-134.4zM400 464H48v-25.6c0-47.6 38.8-86.4
|
|
5281
5281
|
86.4-86.4 14.6 0 38.3 16 89.6 16 51.7 0 74.9-16 89.6-16 47.6 0 86.4 38.8 86.4 86.4V464zM224
|
|
@@ -5289,8 +5289,8 @@ top: 40px;
|
|
|
5289
5289
|
}
|
|
5290
5290
|
`,Rpe=m.svg`
|
|
5291
5291
|
animation: ${Ype} 2s linear infinite;
|
|
5292
|
-
`,e3e=e=>{let t=v4$1();return re.createElement(Rpe,c({xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},e),re.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.52453 4C9.52453 4.31559 9.26869 4.57143 8.9531 4.57143C8.63751 4.57143 8.38167 4.31559 8.38167 4V0.571429C8.38167 0.255837 8.63751 0 8.9531 0C9.26869 0 9.52453 0.255837 9.52453 0.571428V4ZM7.23891 5.03082C7.51222 4.87303 7.60586 4.52355 7.44807 4.25024L5.73378 1.28101C5.57599 1.0077 5.22651 0.914056 4.9532 1.07185C4.67989 1.22965 4.58624 1.57913 4.74404 1.85244L6.45832 4.82167C6.61612 5.09498 6.9656 5.18862 7.23891 5.03082ZM5.77458 5.50525C6.04789 5.66304 6.14153 6.01252 5.98374 6.28583C5.82594 6.55914 5.47646 6.65278 5.20315 6.49499L2.23392 4.7807C1.96061 4.62291 1.86697 4.27343 2.02476 4.00012C2.18256 3.72681 2.53204 3.63316 2.80535 3.79096L5.77458 5.50525ZM5.52455 8.00013C5.52455 7.68454 5.26872 7.4287 4.95312 7.4287H1.52455C1.20896 7.4287 0.953125 7.68454 0.953125 8.00013C0.953125 8.31572 1.20896 8.57156 1.52455 8.57156H4.95313C5.26872 8.57156 5.52455 8.31572 5.52455 8.00013ZM5.20327 9.50543C5.47658 9.34764 5.82606 9.44128 5.98385 9.71459C6.14165 9.9879 6.048 10.3374 5.77469 10.4952L2.80546 12.2095C2.53215 12.3673 2.18267 12.2736 2.02488 12.0003C1.86708 11.727 1.96073 11.3775 2.23404 11.2197L5.20327 9.50543ZM7.23874 10.9693C6.96543 10.8115 6.61595 10.9051 6.45815 11.1784L4.74387 14.1476C4.58607 14.4209 4.67971 14.7704 4.95302 14.9282C5.22633 15.086 5.57581 14.9924 5.73361 14.7191L7.44789 11.7498C7.60569 11.4765 7.51205 11.127 7.23874 10.9693ZM8.95292 11.4287C8.63732 11.4287 8.38149 11.6845 8.38149 12.0001V15.4287C8.38149 15.7443 8.63732 16.0001 8.95292 16.0001C9.26851 16.0001 9.52435 15.7443 9.52435 15.4287V12.0001C9.52435 11.6845 9.26851 11.4287 8.95292 11.4287ZM10.6674 5.03064C10.9407 5.18843 11.2901 5.09479 11.4479 4.82148L13.1622 1.85225C13.32 1.57894 13.2264 1.22946 12.9531 1.07166C12.6798 0.913868 12.3303 1.00751 12.1725 1.28082L10.4582 4.25005C10.3004 4.52336 10.394 4.87284 10.6674 5.03064ZM12.7028 6.4947C12.4295 6.65249 12.08 6.55885 11.9222 6.28554C11.7644 6.01223 11.8581 5.66275 12.1314 5.50496L15.1006 3.79067C15.3739 3.63287 15.7234 3.72652 15.8812 3.99983C16.039 4.27314 15.9453 4.62262 15.672 4.78041L12.7028 6.4947ZM12.3816 8C12.3816 8.31559 12.6374 8.57143 12.953 8.57143H16.3816C16.6972 8.57143 16.953 8.31559 16.953 8C16.953 7.68441 16.6972 7.42857 16.3816 7.42857H12.953C12.6374 7.42857 12.3816 7.68441 12.3816 8ZM12.1315 10.4946C11.8582 10.3368 11.7646 9.98737 11.9224 9.71406C12.0801 9.44075 12.4296 9.3471 12.7029 9.5049L15.6722 11.2192C15.9455 11.377 16.0391 11.7265 15.8813 11.9998C15.7235 12.2731 15.3741 12.3667 15.1007 12.2089L12.1315 10.4946ZM10.6673 10.9693C10.3939 11.1271 10.3003 11.4766 10.4581 11.7499L12.1724 14.7191C12.3302 14.9924 12.6797 15.0861 12.953 14.9283C13.2263 14.7705 13.3199 14.421 13.1621 14.1477L11.4478 11.1785C11.29 10.9052 10.9406 10.8115 10.6673 10.9693Z",fill:`url(#paint_${t})`}),re.createElement("defs",null,re.createElement("radialGradient",{id:`paint_${t}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(8.95312 8) scale(8)"},re.createElement("stop",{offset:"0.669733",stopColor:"white"}),re.createElement("stop",{offset:"0.716307",stopColor:"white",stopOpacity:"0.01"}))))},PH=e3e;var SH={DIRECT_CHAT:2,ONLY_ME_CHAT:1};function i3e(e,t){var i,a,s;if((i=e==null?void 0:e.metadata)!=null&&i.isDirectChat&&(e==null?void 0:e.memberCount)===SH.ONLY_ME_CHAT)return "Me";if(!((a=e==null?void 0:e.metadata)!=null&&a.isDirectChat)&&(e!=null&&e.displayName))return e==null?void 0:e.displayName;let{firstname:o="",lastname:r=""}=(s=t==null?void 0:t.metadata)!=null?s:{},n=trim(`${o}${r}`);return (t==null?void 0:t.displayName)||n||(t==null?void 0:t.userId)||e.channelId}function G9(o){return _(this,arguments,function*({avatarFileId:e,avatarCustomUrl:t}){if(t)return t;if(e){let r=yield FileRepository.getFile(e);return FileRepository.fileUrlWithSize(r.data.fileUrl,"small")}return null})}function a3e(e,t,o){return _(this,null,function*(){var r,n;return (e==null?void 0:e.memberCount)===SH.ONLY_ME_CHAT?G9({avatarCustomUrl:o==null?void 0:o.avatarUrl}):(r=e==null?void 0:e.metadata)!=null&&r.isDirectChat&&(t!=null&&t.avatarUrl)?G9({avatarCustomUrl:t.avatarUrl}):G9({avatarFileId:e==null?void 0:e.avatarFileId,avatarCustomUrl:(n=e==null?void 0:e.metadata)==null?void 0:n.avatarCustomUrl})})}function s3e({channel:e}){var p,u,g;let{currentUserId:t}=Z1(),[o,r]=useState(null),n=(p=e==null?void 0:e.metadata)!=null&&p.isDirectChat?((g=(u=e==null?void 0:e.metadata)==null?void 0:u.userIds)!=null?g:[]).find(f=>f!==t):null,i=oe(t),a=oe(n),s=se({fileId:i==null?void 0:i.avatarFileId}),l=se({fileId:a==null?void 0:a.avatarFileId});return useEffect(()=>{function f(){return _(this,null,function*(){r(null);let y=yield a3e(e,{avatarUrl:(a==null?void 0:a.avatarCustomUrl)||l},{avatarUrl:(i==null?void 0:i.avatarCustomUrl)||s});r(y);})}f();},[a==null?void 0:a.avatarCustomUrl,e,s,i==null?void 0:i.avatarCustomUrl]),{chatName:useMemo(()=>e==null?void 0:i3e(e,a),[e,a]),chatAvatar:o,type:e==null?void 0:e.type}}var TH=s3e;var Km={messageListHeader:"Vf",displayName:"qf",memberCount:"Gf",memberIcon:"Jf",avatar:"Kf"};var lu=({channel:e,pageId:t="*"})=>{let o="chat_header",{themeStyles:r}=R({pageId:t,componentId:o}),{chatName:n,chatAvatar:i}=TH({channel:e}),a=su();return re.createElement("div",{className:Km.messageListHeader,style:r},re.createElement("div",{className:Km.avatar},re.createElement(xt,{avatarUrl:i,defaultImage:re.createElement(IH,null)})),re.createElement("div",null,re.createElement("div",{className:Km.displayName},re.createElement(T.Title,null,n||"Loading...")),re.createElement("div",{className:Km.memberCount},a?re.createElement(re.Fragment,null,re.createElement(MH,{className:Km.memberIcon}),re.createElement(T.Caption,null,Tx((e==null?void 0:e.memberCount)||0)," ",`${(e==null?void 0:e.memberCount)||0} ${(e==null?void 0:e.memberCount)===1?"member":"members"}`)):re.createElement(re.Fragment,null,re.createElement(PH,{width:20,height:20}),re.createElement(T.Caption,null,"Waiting for connection...")))))};var kH={spinner:"Nf",rotate:"wr"};var NH=o=>{var r=o,{className:e}=r,t=M(r,["className"]);return re.createElement("svg",c({width:"25",height:"25",xmlns:"http://www.w3.org/2000/svg","aria-label":"Loading...",viewBox:"0 0 100 100",version:"1.1",className:yi(kH.spinner,e)},t),re.createElement("defs",{id:"defs3821"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0",rx:"3",ry:"3",transform:"rotate(-90 50 50)",width:"25",x:"72",y:"47",id:"rect3793"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.08333333333333333",rx:"3",ry:"3",transform:"rotate(-60 50 50)",width:"25",x:"72",y:"47",id:"rect3795"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.16666666666666666",rx:"3",ry:"3",transform:"rotate(-30 50 50)",width:"25",x:"72",y:"47",id:"rect3797"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.25",rx:"3",ry:"3",transform:"rotate(0 50 50)",width:"25",x:"72",y:"47",id:"rect3799"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.3333333333333333",rx:"3",ry:"3",transform:"rotate(30 50 50)",width:"25",x:"72",y:"47",id:"rect3801"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.4166666666666667",rx:"3",ry:"3",transform:"rotate(60 50 50)",width:"25",x:"72",y:"47",id:"rect3803"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.5",rx:"3",ry:"3",transform:"rotate(90 50 50)",width:"25",x:"72",y:"47",id:"rect3805"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.5833333333333334",rx:"3",ry:"3",transform:"rotate(120 50 50)",width:"25",x:"72",y:"47",id:"rect3807"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.6666666666666666",rx:"3",ry:"3",transform:"rotate(150 50 50)",width:"25",x:"72",y:"47",id:"rect3809"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.75",rx:"3",ry:"3",transform:"rotate(180 50 50)",width:"25",x:"72",y:"47",id:"rect3811"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.8333333333333334",rx:"3",ry:"3",transform:"rotate(210 50 50)",width:"25",x:"72",y:"47",id:"rect3813"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.9166666666666666",rx:"3",ry:"3",transform:"rotate(240 50 50)",width:"25",x:"72",y:"47",id:"rect3815"}))};var rr={optionButton:"Of",optionIcon:"Pf",reactionIcon:"Qf",timestamp:"Wf",messageActionButton:"Zf",messageActionButtonText:"_f",messageDangerActionButtonText:"eh",copyIcon:"rh",replyIcon:"ah",binIcon:"oh",mentionIcon:"th",flagIcon:"ih"};var u3e=t=>{var e=M(t,[]);return re.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"21",viewBox:"0 0 20 21"},e),re.createElement("path",{d:"M10 8.78369C10.8125 8.78369 11.5 9.47119 11.5 10.2837C11.5 11.1274 10.8125 11.7837 10 11.7837C9.15625 11.7837 8.5 11.1274 8.5 10.2837C8.5 9.47119 9.15625 8.78369 10 8.78369ZM8.5 5.53369C8.5 4.72119 9.15625 4.03369 10 4.03369C10.8125 4.03369 11.5 4.72119 11.5 5.53369C11.5 6.37744 10.8125 7.03369 10 7.03369C9.15625 7.03369 8.5 6.37744 8.5 5.53369ZM8.5 15.0337C8.5 14.2212 9.15625 13.5337 10 13.5337C10.8125 13.5337 11.5 14.2212 11.5 15.0337C11.5 15.8774 10.8125 16.5337 10 16.5337C9.15625 16.5337 8.5 15.8774 8.5 15.0337Z"}))},BH=u3e;var LH={popover:"lh",fixed:"ch"};var C3e=i=>{var a=i,{isOpen:e,content:t,fixed:o=!1,children:r}=a,n=M(a,["isOpen","content","fixed","children"]);return re.createElement(Popover,c({containerClassName:yi(LH.popover,{fixed:!1}),isOpen:e,content:t},n),r)},AH=C3e;var v3e=e=>re.createElement("svg",c({width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M1.4375 10.5586C0.84375 9.99609 0.84375 9.02734 1.4375 8.46484L6.9375 2.96484C7.875 1.99609 9.5 2.68359 9.5 4.02734V6.52734C13.7812 6.65234 19 7.49609 19 12.8398C19 15.1211 17.7812 17.0273 15.9375 18.2461C14.7812 19.0273 13.25 17.9336 13.6875 16.5586C14.4375 14.1211 14.0625 12.8398 9.5 12.5586V14.9961C9.5 16.3398 7.875 17.0273 6.9375 16.0586L1.4375 10.5586ZM2.5 9.49609L8 14.9961V11.0273C13.125 11.0586 16.6562 12.0586 15.0938 16.9961C16.25 16.2461 17.5 14.9336 17.5 12.8398C17.5 8.37109 12.4688 8.02734 8 8.02734V3.99609L2.5 9.49609Z",fill:"currenColor"})),HH=v3e;var x3e=e=>re.createElement("svg",c({width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M16.5312 5.03992C16.7812 5.28992 17 5.75867 17 6.10242V14.4774C17 15.3212 16.3125 15.9774 15.5 15.9774H13V17.4774C13 18.3212 12.3125 18.9774 11.5 18.9774H4.5C3.65625 18.9774 3 18.3212 3 17.4774V7.47742C3 6.66492 3.65625 5.97742 4.5 5.97742H7V4.47742C7 3.66492 7.65625 2.97742 8.5 2.97742H13.875C14.2188 2.97742 14.6875 3.19617 14.9375 3.44617L16.5312 5.03992ZM11.3125 17.4774C11.4062 17.4774 11.5 17.4149 11.5 17.2899V15.9774H8.5C7.65625 15.9774 7 15.3212 7 14.4774V7.47742H4.6875C4.5625 7.47742 4.5 7.57117 4.5 7.66492V17.2899C4.5 17.4149 4.5625 17.4774 4.6875 17.4774H11.3125ZM15.3125 14.4774C15.4062 14.4774 15.5 14.4149 15.5 14.2899V7.97742H12.75C12.3125 7.97742 12 7.66492 12 7.22742V4.47742H8.6875C8.5625 4.47742 8.5 4.57117 8.5 4.66492V14.2899C8.5 14.4149 8.5625 14.4774 8.6875 14.4774H15.3125ZM15.5 6.47742V6.19617C15.5 6.13367 15.4688 6.10242 15.4375 6.07117L13.9062 4.53992C13.875 4.50867 13.8438 4.47742 13.7812 4.47742H13.5V6.47742H15.5Z",fill:"currenColor"})),OH=x3e;var b3e=e=>re.createElement("svg",c({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M12.875 4.375C13.0625 4.375 13.25 4.5625 13.25 4.75V5.125C13.25 5.33594 13.0625 5.5 12.875 5.5H12.5L11.9844 13.4453C11.9609 14.0312 11.4453 14.5 10.8594 14.5H5.11719C4.53125 14.5 4.01562 14.0312 3.99219 13.4453L3.5 5.5H3.125C2.91406 5.5 2.75 5.33594 2.75 5.125V4.75C2.75 4.5625 2.91406 4.375 3.125 4.375H5.04688L5.84375 3.0625C6.03125 2.75781 6.45312 2.5 6.80469 2.5H9.17188C9.52344 2.5 9.94531 2.75781 10.1328 3.0625L10.9297 4.375H12.875ZM6.80469 3.625L6.35938 4.375H9.61719L9.17188 3.625H6.80469ZM10.8594 13.375L11.3516 5.5H4.625L5.11719 13.375H10.8594Z"})),mu=b3e;var I3e=o=>{var r=o,{color:e="#FA4D30"}=r,t=M(r,["color"]);return re.createElement("svg",c({width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),re.createElement("path",{d:"M10.5 2.99609C11.5938 2.99609 12.7812 2.62109 13.9062 2.12109C14.875 1.71484 16 2.43359 16 3.49609V10.9961C16 11.5273 15.7188 11.9961 15.3125 12.2773C14.4688 12.8086 13.125 13.4961 11.2812 13.4961C9.15625 13.4961 7.75 12.4961 6.21875 12.4961C4.46875 12.4961 3.40625 12.8711 2.25 13.4023V15.9961C2.25 16.2773 2 16.4961 1.75 16.4961H1.25C0.96875 16.4961 0.75 16.2773 0.75 15.9961V3.30859C0.28125 3.05859 0 2.55859 0 1.99609C0 1.15234 0.71875 0.464844 1.59375 0.527344C2.3125 0.558594 2.90625 1.12109 2.96875 1.83984C2.96875 1.87109 3 1.96484 3 1.99609C3 2.15234 2.9375 2.37109 2.90625 2.49609C3.59375 2.21484 4.4375 1.99609 5.4375 1.99609C7.5625 1.99609 8.96875 2.99609 10.5 2.99609ZM14.5 10.9961V3.49609C13.5 3.96484 11.8438 4.49609 10.5 4.49609C8.625 4.49609 7.3125 3.49609 5.4375 3.49609C4.125 3.49609 2.90625 4.02734 2.25 4.49609V11.7461C3.21875 11.3086 4.875 10.9961 6.21875 10.9961C8.09375 10.9961 9.40625 11.9961 11.2812 11.9961C12.5938 11.9961 13.8125 11.4961 14.5 10.9961Z",fill:e}))},cu=I3e;var $H=({isOwner:e,isModerator:t,isFlagged:o,action:r,containerRef:n})=>{let[i,a]=useState(!1),s=useRef(null),l=()=>{r.onCopy&&r.onCopy(),a(!1);},d=()=>{r.onReply&&r.onReply(),a(!1);},p=()=>{r.onDelete&&r.onDelete(),a(!1);},u=()=>{r.onFlag&&r.onFlag(),a(!1);},g=()=>{r.onUnflag&&r.onUnflag(),a(!1);};return re.createElement(re.Fragment,null,re.createElement(AH,{positions:["bottom","top"],onClickOutside:()=>a(!1),isOpen:i,align:"start",parentElement:(n==null?void 0:n.current)||void 0,content:re.createElement(re.Fragment,null,re.createElement("div",{className:rr.messageActionButton,onClick:d},re.createElement("div",{className:rr.messageActionButtonText},re.createElement(T.Body,null,"Reply")),re.createElement(HH,{className:rr.replyIcon})),re.createElement("div",{className:rr.messageActionButton,onClick:l},re.createElement("div",{className:rr.messageActionButtonText},re.createElement(T.Body,null,"Copy")),re.createElement(OH,{className:rr.copyIcon})),(t||!e)&&re.createElement("div",{className:rr.messageActionButton,onClick:o?g:u},re.createElement("div",{className:rr.messageDangerActionButtonText},re.createElement(T.Body,null,o?"Unreport":"Report")),re.createElement(cu,{className:rr.flagIcon})),(e||t)&&re.createElement("div",{className:rr.messageActionButton,onClick:p},re.createElement("div",{className:rr.messageDangerActionButtonText},re.createElement(T.Body,null,"Delete")),re.createElement(mu,{className:rr.binIcon})))},re.createElement("div",{className:rr.optionButton,ref:s,onClick:()=>{a(!i);}},re.createElement(BH,{className:rr.optionIcon}))))};var du={messageItemContainer:"sh",userDisplayName:"nh",avatar:"dh",moderatorBadge:"mh"};var _3e=({avatarUrl:e,displayName:t,children:o})=>re.createElement("div",{className:du.messageItemContainer},re.createElement("div",{className:du.avatar},re.createElement(xt,{avatarUrl:e,defaultImage:re.createElement(Xa,null)})),re.createElement("div",null,re.createElement("div",{className:du.userDisplayName},re.createElement(T.CaptionBold,null,t)),o)),VH=_3e;var ys={messageBubble:"yr",messageRepliedBubble:"ph",messageParentContainer:"gh",messageParentDisplayName:"fh",messageParentText:"hh",messageChildContainer:"uh",messageChildText:"bh"};var k3e=e=>Nt({fetcher:MessageRepository.getMessage,params:e,shouldCall:!!e}),jH=k3e;var pu={mentionText:"vh",hyperlink:"xh"};var GH={hyperlink:"wh"};var L3e=({linkClassName:e,children:t})=>re.createElement(yG,{options:{target:"_blank",render:({attributes:o,content:r})=>re.createElement("a",c({className:e||GH.hyperlink},o),r)}},t),Z9=L3e;var A3e=({message:e,className:t})=>{var n,i,a;let o=(n=e.metadata)==null?void 0:n.mentioned,r=o==null?void 0:o.sort((s,l)=>s.index-l.index);if(r!=null&&r.length){let s=((i=e.data)==null?void 0:i.text)||"",l=[],d=0;r.forEach(u=>{let g=u.index,f=u.index+u.length+1,y=s.slice(d,g),C=s.slice(g,f);y&&l.push({text:y,isMention:!1}),l.push({text:C,isMention:!0}),d=f;});let p=s.slice(d);return p&&l.push({text:p,isMention:!1}),re.createElement(T.Body,{className:t},l.map((u,g)=>u.isMention?re.createElement("span",{key:g,className:pu.mentionText},u.text):re.createElement("span",{key:g},re.createElement(Z9,{linkClassName:pu.hyperlink},u.text))))}return re.createElement(T.Body,{className:t},re.createElement(Z9,{linkClassName:pu.hyperlink},(a=e.data)==null?void 0:a.text))},Q9=A3e;var D3e=({message:e})=>{var r,n,i;let{currentUserId:t}=Y(),o=(n=(r=e.metadata)==null?void 0:r.mentioned)==null?void 0:n.some(a=>a.userId===t||a.type==="channel");if(e&&e.parentId){let a=jH(e.parentId),s=oe(a==null?void 0:a.creatorId);return !a||!s?null:re.createElement("div",{className:ys.messageRepliedBubble},re.createElement("div",{className:ys.messageParentContainer},re.createElement("div",{className:ys.messageParentDisplayName},re.createElement(T.BodyBold,null,s.displayName)),re.createElement(T.Body,{className:ys.messageParentText},(i=a.data)==null?void 0:i.text)),re.createElement("div",{className:ys.messageChildContainer},re.createElement(Q9,{className:ys.messageChildText,message:e})))}return re.createElement("div",{"data-mentioned":o,className:ys.messageBubble},re.createElement(Q9,{message:e}))},QH=D3e;var Xm=e=>{let{client:t}=Y();return {isModerator:useMemo(()=>{if(!e)return !1;let r=(t==null?void 0:t.hasPermission("MUTE_CHANNEL").currentUser())||!1,n=(t==null?void 0:t.hasPermission("MUTE_CHANNEL").channel(e))||!1;return r||n},[e])}};var WH=e=>re.createElement("svg",c({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.0766 3.686C11.6827 3.45305 12.3021 3.33948 12.9061 3.3335C14.7179 3.31558 16.3937 4.2689 17.1729 5.89093L17.1895 5.92546L17.202 5.9624C17.6819 7.39004 17.5517 8.83248 17.0292 10.1008C16.7326 9.72289 16.3721 9.39755 15.964 9.14106C16.2254 8.26924 16.2483 7.32915 15.9455 6.39919C15.3774 5.24797 14.2332 4.57487 12.9278 4.60378C12.4981 4.61329 12.0515 4.70045 11.6019 4.86956C11.1731 5.08422 10.8198 5.36694 10.5238 5.73675L10.0093 6.37992L9.47729 5.74959C8.38507 4.45434 6.19511 4.17996 4.72103 5.44206C3.63692 6.5523 3.60343 8.44184 4.37082 10.0205C5.31606 11.6937 7.28176 13.3534 9.14794 14.7202L9.15794 14.7275C9.27155 14.8082 9.38012 14.8942 9.48451 14.9769C9.57334 15.0473 9.65915 15.1152 9.74247 15.1755C9.83249 15.2407 9.91925 15.2913 9.98761 15.3273C10.0527 15.3006 10.1319 15.2662 10.2153 15.2157C10.2662 15.1848 10.3205 15.1506 10.3776 15.1136C10.6388 15.4735 10.9562 15.7901 11.3169 16.0503C11.1818 16.1421 11.0508 16.227 10.9257 16.3029C10.8808 16.33 10.8388 16.3568 10.7982 16.3826C10.5856 16.5181 10.4104 16.6296 10.0526 16.6594L9.96091 16.6666L9.87002 16.6497C9.46411 16.575 9.1867 16.3802 8.94112 16.2025C8.80472 16.1038 8.67845 16.0042 8.57194 15.9202C8.48669 15.8529 8.4141 15.7957 8.3591 15.7569L8.35494 15.7536L8.34994 15.7496C6.42696 14.342 4.31681 12.6298 3.18676 10.6147L3.17842 10.5987L3.17008 10.5834C2.21058 8.62424 2.1731 6.14474 3.7738 4.53473L3.79047 4.51786L3.80882 4.50181C5.63352 2.91773 8.30066 3.019 9.97595 4.41428C10.2872 4.13498 10.6374 3.8993 11.0216 3.71089L11.0491 3.69724L11.0766 3.686Z",fill:"currentColor"}),re.createElement("path",{d:"M13.6839 10.0507L13.6839 10.0501L13.6725 10.0522C13.5717 10.0706 13.4807 10.1238 13.4151 10.2025C13.3496 10.2811 13.3137 10.3803 13.3137 10.4827C13.3137 10.4827 13.3137 10.4827 13.3137 10.4827V12.2327H11.5637V12.2322L11.5527 12.2332L11.4964 12.2382L11.4964 12.2376L11.485 12.2397C11.3842 12.2581 11.2932 12.3113 11.2276 12.39C11.1621 12.4686 11.1262 12.5678 11.1262 12.6702H11.1257L11.1267 12.6812L11.1317 12.7375L11.1312 12.7375L11.1333 12.7489C11.1517 12.8496 11.2049 12.9407 11.2835 13.0063C11.3622 13.0718 11.4613 13.1077 11.5637 13.1077C11.5637 13.1077 11.5637 13.1077 11.5638 13.1077H13.3137V14.8577H13.3132L13.3142 14.8687L13.3192 14.925L13.3187 14.925L13.3208 14.9364C13.3392 15.0371 13.3924 15.1282 13.471 15.1938L13.5511 15.0977L13.471 15.1938C13.5497 15.2593 13.6489 15.2952 13.7513 15.2952L13.7513 15.2957L13.7623 15.2947L13.8185 15.2897L13.8186 15.2902L13.83 15.2881C13.9307 15.2697 14.0218 15.2165 14.0873 15.1379C14.1529 15.0592 14.1887 14.96 14.1887 14.8577C14.1887 14.8577 14.1887 14.8576 14.1887 14.8576V13.1077H15.9387V13.1082L15.9498 13.1072L16.006 13.1022L16.0061 13.1027L16.0175 13.1006C16.1182 13.0822 16.2093 13.029 16.2748 12.9504C16.3404 12.8717 16.3763 12.7725 16.3762 12.6701L16.3767 12.6701L16.3757 12.6591L16.3707 12.6028L16.3713 12.6028L16.3692 12.5914C16.3507 12.4907 16.2976 12.3996 16.2189 12.3341C16.1403 12.2685 16.0411 12.2326 15.9387 12.2327C15.9387 12.2327 15.9387 12.2327 15.9387 12.2327H14.1887V10.4827H14.1892L14.1882 10.4716L14.1832 10.4153L14.1838 10.4153L14.1817 10.4039C14.1632 10.3032 14.1101 10.2121 14.0314 10.1466C13.9527 10.081 13.8536 10.0451 13.7512 10.0452V10.0447L13.7402 10.0457L13.6839 10.0507Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.25"}));var uu=o=>_(void 0,[o],function*({reactionName:e,message:t}){let r=t.myReactions||[];if(r.includes(e)){yield ReactionRepository.removeReaction("message",t.messageId,e);return}r.length>0&&(yield ReactionRepository.removeReaction("message",t.messageId,r[0])),yield ReactionRepository.addReaction("message",t.messageId,e);});var K9={quickReactionIcon:"yh",quickReactionIconContainer:"kr"};var gu=({pageId:e="*",componentId:t="*",message:o,onSelectReaction:r})=>{let n="message_quick_reaction",{config:i}=L({pageId:e,componentId:t,elementId:n}),{config:a}=mi(),s=useCallback(()=>{a&&i.reaction&&a.find(l=>l.name===i.reaction)&&uu({reactionName:i.reaction,message:o}),r&&r();},[a,i,o]);return re.createElement("div",{className:K9.quickReactionIconContainer},re.createElement(WH,{className:K9.quickReactionIcon,onClick:s}))};var J9={reactionPickerContainer:"kh",reactionButton:"v"};var X9=({message:e,onSelectReaction:t})=>{let{config:o}=mi(),r=n=>{uu({reactionName:n,message:e});};return o?re.createElement("div",{className:J9.reactionPickerContainer},o.map(n=>{var i;return re.createElement("img",{"data-active":(i=e.myReactions)==null?void 0:i.includes(n.name),key:n.name,src:n.image,alt:n.name,className:J9.reactionButton,onClick:()=>{r(n.name),t&&t(n.name);}})})):null};var fu={reactionContainer:"jh",reactionPickerWrap:"zh",reactionButton:"Ch"};var JH=({pageId:e="*",componentId:t="*",message:o,containerRef:r})=>{let [n,i]=useState(!1),[a,s]=useState(!1),[l,d]=useState(!1);re.useState();let g=useRef(null),f=useRef(a);useEffect(()=>{f.current=a;},[a]);let y=useCallback(()=>{if(!f.current)return;let I=setTimeout(()=>{f.current&&i(!0);},500);return ()=>clearTimeout(I)},[]),C=useRef(l);useEffect(()=>{C.current=l;},[l]);let h=useCallback(()=>{setTimeout(()=>{C.current||i(!1);},1e3);},[]),v=useCallback(I=>{g.current&&!g.current.contains(I.target)&&i(!1);},[]),b=()=>{if(!g.current||!(r!=null&&r.current))return "translate(-50%, 0px)";let I=r.current.getBoundingClientRect(),w=g.current.getBoundingClientRect();if(!I||!w)return "translate(-50%, 0px)";lS(Number(sS("--asc-spacing-s1").replace("rem","")));let S=w.right-I.right,A=I.left-w.left;return S>0?`translate(calc(-50% - ${S}px), 0px)`:A>0?`translate(calc(-50% + ${A}px), 0px)`:"translate(-50%, 0px)"},x=I=>{v(I);},P=()=>{s(!1),d(!1),i(!1);};return useEffect(()=>(document.addEventListener("mousedown",x),document.addEventListener("touchstart",v),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("touchstart",v);}),[]),useEffect(()=>{a?!n&&y():n&&h();},[a,n]),re.createElement("div",{className:fu.reactionContainer},n&&re.createElement("div",{className:fu.reactionPickerWrap,style:{transform:b()},ref:g,onMouseEnter:()=>d(!0),onMouseLeave:()=>{d(!1);}},re.createElement(X9,{message:o,onSelectReaction:P})),re.createElement("div",{className:fu.reactionButton,onMouseEnter:()=>{s(!0);},onMouseLeave:()=>{s(!1);}},re.createElement(gu,{message:o,onSelectReaction:P,pageId:e,componentId:t})))};var Rm={reactionPreviewContainer:"jr",reactionIconContainer:"n",reactionIcon:"Sh",reactionCount:"Bh",fallbackIcon:"Xh"};var tf=({message:e,onClick:t})=>{let{config:o}=mi(),r=e.reactions?useMemo(()=>Object.entries(e.reactions).sort((n,i)=>i[1]-n[1]).filter(n=>n[1]>0).slice(0,3).sort((n,i)=>n[1]-i[1]),[e==null?void 0:e.reactions]):[];return e!=null&&e.reactionsCount?re.createElement("div",{className:Rm.reactionPreviewContainer,"data-myreaction":(e==null?void 0:e.myReactions)&&!!(e!=null&&e.myReactions.length),onClick:t},re.createElement("div",{className:Rm.reactionIconContainer},r.map(n=>{let i=o.find(a=>a.name===n[0]);return re.createElement(re.Fragment,null,i?re.createElement("img",{className:Rm.reactionIcon,src:i.image,alt:i.name}):re.createElement(xm,{className:Rm.fallbackIcon,backgroundColor:getComputedStyle(document.documentElement).getPropertyValue("--asc-color-base-shade3")}))})),re.createElement("div",{className:Rm.reactionCount},vm(e.reactionsCount))):null};var Fn={messageItemContainer:"Ih",messageItemContainerInner:"zr",messageBubbleWrap:"Mh",messageReaction:"Yh",messageDeletedBubble:"Ah",messageOptionsWrap:"Eh",binIcon:"Fh",optionIcon:"Rh",flagIcon:"Uh",timestamp:"Dh",reactionListSheet:"Hh",reactionListContainer:"Lh",reactionListBackdrop:"Th"};var Q3e=({pageId:e="*",componentId:t="*",elementId:o="*",message:r,avatarUrl:n,userDisplayName:i,containerRef:a,action:s})=>{let l=Y(),d=r.creatorId===l.currentUserId,{isModerator:p}=Xm(r.channelId),[u,g]=useState(void 0);return re.createElement(re.Fragment,null,re.createElement(VH,{avatarUrl:n,displayName:i},re.createElement("div",{className:Fn.messageItemContainerInner,"data-reactions":!!r.reactionsCount},r.isDeleted?re.createElement("div",{className:Fn.messageDeletedBubble},re.createElement(mu,{className:Fn.binIcon}),re.createElement("div",null,re.createElement(T.Body,null,"This message was deleted"))):re.createElement("div",{className:Fn.messageBubbleWrap},re.createElement(QH,{message:r}),re.createElement("div",{className:Fn.messageReaction},re.createElement(tf,{message:r,onClick:()=>g(r)})),s&&re.createElement($H,{containerRef:a,isOwner:d,isModerator:p,action:s,isFlagged:r.flagCount>0}),re.createElement(JH,{message:r,containerRef:a,pageId:e,componentId:t}),r.flagCount>0&&re.createElement(cu,{className:Fn.flagIcon}),re.createElement("div",{className:Fn.timestamp},on(r.createdAt).format("HH:mm A"))))),u&&re.createElement(n1,{isOpen:!0,onClose:()=>g(void 0),className:Fn.reactionListSheet},re.createElement(n1.Container,{className:Fn.reactionListContainer},re.createElement(n1.Header,null),re.createElement(n1.Content,null,re.createElement(bm,{pageId:e,referenceId:u.messageId,referenceType:"message"}))),re.createElement(n1.Backdrop,{className:Fn.reactionListBackdrop})))},hu=Q3e;var of=({pageId:e="*",componentId:t="*",message:o,containerRef:r,action:n})=>{let i="sender_message_bubble",a=oe(o.creatorId),s=se({fileId:a==null?void 0:a.avatarFileId,imageSize:"small"});return re.createElement(hu,{message:o,userDisplayName:a==null?void 0:a.displayName,avatarUrl:s,containerRef:r,action:n,pageId:e,componentId:t,elementId:i})};var rf=({pageId:e="*",componentId:t="*",message:o,containerRef:r,action:n})=>{let i="receiver_message_bubble",{user:a}=No(o.creatorId),s=it({fileId:a==null?void 0:a.avatarFileId,imageSize:"small"});return re.createElement(hu,{pageId:e,componentId:t,elementId:i,message:o,userDisplayName:a==null?void 0:a.displayName,avatarUrl:s,containerRef:r,action:n})};var nf=(r,n)=>_(void 0,[r,n],function*(e,{onSuccess:t,onError:o}){try{yield MessageRepository.deleteMessage(e),t&&t();}catch(i){o&&o(i);}});var af=(e,t,o)=>_(void 0,null,function*(){try{yield MessageRepository.flagMessage(e),t&&t();}catch(r){o&&o(r);}});var XH=(e,t,o)=>_(void 0,null,function*(){try{yield MessageRepository.unflagMessage(e),t&&t();}catch(r){o&&o(r);}});var sf={icon:"Vh"};var mf=createContext({liveChatNotifications:[],liveChatNotificationFunction:{success:()=>{},error:()=>{},show:()=>{}}}),t5e=3e3,RH=({children:e})=>{let[t,o]=useState([]),r=i=>o&&o(a=>a.filter(s=>s.id!==i)),n=i=>{let a=Date.now();o(s=>[...s,c({id:a},i)]),setTimeout(()=>{r(a);},(i==null?void 0:i.duration)||t5e);};return re.createElement(mf.Provider,{value:{liveChatNotifications:t,liveChatNotificationFunction:{success:i=>n(E(c({},i),{icon:re.createElement(t0,{className:sf.icon})})),error:i=>n(E(c({},i),{icon:re.createElement($1,{className:sf.icon})})),show:i=>n(i)}}},e)},eF=()=>{let{liveChatNotifications:e}=useContext(mf);return e},e2=()=>{let{liveChatNotificationFunction:e}=useContext(mf);return e};var tF=()=>{let e=e2(),{formatMessage:t}=useIntl();return r=>_(void 0,null,function*(){yield navigator.clipboard.writeText(r),e.success({content:t({id:"livechat.notification.copy.message"})});})};var L1={infiniteScrollContainer:"qh",loadingIndicatorWrap:"Gh",loadingIndicator:"Jh",infiniteScrollInner:"Kh",customStatusContainer:"Nh",iconContainer:"Oh"};var Cu=({pageId:e="*",channel:t,replyMessage:o})=>{let r="message_list",n=Y(),i=useRef(null),[a,s]=useState(void 0),{confirm:l}=Ye(),d=e2(),p=tF(),{themeStyles:u}=R({pageId:e,componentId:r}),{messages:g,hasMore:f,loadMore:y,isLoading:C,error:h}=pd({subChannelId:t.channelId,sortBy:"segmentDesc",limit:10,includeDeleted:!0}),v=g,b=x=>{l({title:"Delete this message?",content:"This message will also be removed from your friend\u2019s devices.",cancelText:"Cancel",okText:"Delete",onOk:()=>nf(x,{onError:()=>d.error({content:"Unable to delete message. Please try again."})})});};return useEffect(()=>{let x=()=>{i.current&&s(i.current.clientHeight);},P=new ResizeObserver(x);return i.current&&P.observe(i.current),()=>{i.current&&P.unobserve(i.current);}},[]),h?re.createElement("div",{className:L1.customStatusContainer,ref:i,style:u},re.createElement("div",{className:L1.iconContainer},re.createElement(q3,null)),re.createElement(T.Caption,null,"Couldn't load chat")):re.createElement("div",{className:L1.infiniteScrollContainer,ref:i,style:u},i.current&&re.createElement(RJ,{className:L1.infiniteScrollInner,scrollableTarget:i.current,scrollThreshold:.7,hasMore:f,next:y,loader:C?re.createElement("div",{className:L1.loadingIndicatorWrap},re.createElement(NH,{className:L1.loadingIndicator})):null,inverse:!0,dataLength:v.length,height:i.current.clientHeight},v.map((x,P)=>x.creatorId===n.currentUserId?re.createElement(of,{message:x,action:t.isMuted?void 0:{onReply:()=>o(x),onDelete:()=>b(x.messageId),onCopy:()=>{var I,w;return ((I=x.data)==null?void 0:I.text)&&p((w=x.data)==null?void 0:w.text)}},key:x.messageId,containerRef:i,pageId:e,componentId:r}):re.createElement(rf,{message:x,action:{onReply:()=>o(x),onDelete:()=>b(x.messageId),onCopy:()=>{var I,w;return ((I=x.data)==null?void 0:I.text)&&p((w=x.data)==null?void 0:w.text)},onFlag:()=>af(x.messageId,()=>d.success({content:"Message reported"}),()=>d.error({content:"This message failed to be reported. Please try again."})),onUnflag:()=>XH(x.messageId,()=>d.success({content:"Message unreported"}),()=>d.error({content:"This message failed to be unreported. Please try again."}))},key:x.messageId,containerRef:i,pageId:e,componentId:r}))))};var l5e=e=>re.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"},e),re.createElement("path",{d:"M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2V448c0 17.7 14.3 32 32 32s32-14.3 32-32V141.2L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"})),rF=l5e;var cf={homeIndicatorContainer:"Ph",homeIndicator:"Qh"};var vu=()=>re.createElement("div",{className:cf.homeIndicatorContainer},re.createElement("div",{className:cf.homeIndicator}));var no={sendButton:"Wh",reactionButton:"Zh",sendButtonContainer:"_h",composeBarContainer:"eu",optionContainer:"ru",composeBar:"au",composeBarLoading:"ou",mentionText:"tu",editorPlaceholder:"iu",editorContainer:"Cr",editorRoot:"lu",editorParagraph:"cu",editorContainer__mentionTextInput_item:"Sr",editorLink:"Br",userMentionItem__item:"C",allMentionItem__item:"S",userMentionItem__avatar:"su",allMentionItem__atSign:"nu",userMentionItem__displayName:"du",allMentionItem__displayName:"mu"};var xu=({channelId:e,memberships:t,search:o,limit:r=20,shouldCall:n=!0})=>{let s=nt({fetcher:ChannelRepository.Membership.searchMembers,params:{channelId:e,search:o||"",memberships:t,limit:r},shouldCall:!!e&&n}),{items:i}=s,a=M(s,["items"]);return c({channelMembers:i},a)};var aF=`\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'"~=<>_:;`,v5e="\\b[A-Z][^\\s"+aF+"]",x5e={NAME:v5e,PUNCTUATION:aF},sF=x5e.PUNCTUATION,pf=["@"].join(""),lF="[^"+pf+sF+"\\s]",b5e="(?:\\.[ |$]| |["+sF+"]|)",I5e=75,w5e=new RegExp("(^|\\s|\\()(["+pf+"]((?:"+lF+b5e+"){0,"+I5e+"}))$"),M5e=50,P5e=new RegExp("(^|\\s|\\()(["+pf+"]((?:"+lF+"){0,"+M5e+"}))$");function _5e(e,t){let o=w5e.exec(e);if(o===null&&(o=P5e.exec(e)),o!==null){let r=o[1],n=o[3];if(n.length>=t)return {leadOffset:o.index+r.length,matchingString:n,replaceableString:o[2]}}return null}function S5e(e){return _5e(e,0)}var df=class extends MenuOption{constructor({data:t,dataId:o}){super(o),this.data=t;}};function mF({suggestions:e,getSuggestionId:t,onQueryChange:o,$createNode:r,menuRenderFn:n,commandPriority:i}){let[a]=useLexicalComposerContext(),s=useMemo(()=>e.map(p=>new df({data:p,dataId:t(p)})),[e]),l=useCallback((p,u,g)=>{a.update(()=>{let f=r(p.data,p.key),y=$createTextNode(" ");u&&($insertNodes([y]),y.insertBefore(u),u.replace(f)),y.select(),g();});},[a]),d=useCallback(p=>S5e(p),[a]);return re.createElement(LexicalTypeaheadMenuPlugin,{onQueryChange:o,onSelectOption:l,triggerFn:d,options:s,menuRenderFn:n,commandPriority:i})}function cF(e){return e.type==="text"}function T5e(e){return e.type==="mention"}function k5e(e){return e.type==="autolink"}function dF(e){let t=[],o=e.getEditorState().toJSON().root.children,r=[],n=!1,i=[],a=0;o.forEach(l=>{let d=l.children,p=[];d.forEach(u=>{cF(u)&&(p.push(u.text),a+=u.text.length),k5e(u)&&u.children.forEach(g=>{cF(g)&&(p.push(g.text),a+=g.text.length);}),T5e(u)&&(u.data.userId==="all"?(r.push({index:a,length:u.text.length,type:"channel"}),n=!0):(r.push({index:a,length:u.text.length,type:"user",userId:u.data.userId}),i.push(u.data.userId)),p.push(u.text),a+=u.text.length);}),a+=1,t.push(p.join(""));});let s=[];return i.length>0&&s.push({type:"user",userIds:i}),n&&s.push({type:"channel"}),{mentioned:r,text:t.join(`
|
|
5293
|
-
`),mentionees:s}}var N5e={ltr:"ltr",rtl:"rtl"},pF=({namespace:e,theme:t,nodes:o,editorState:r})=>({namespace:e,editable:!0,theme:c(c({},N5e),t),onError(n){throw n},nodes:o,editorState:r});var uF={mention:"pu"};function L5e({domNode:e,data:t}){let o=e.textContent;return o!==null?{node:bu({text:o,data:t})}:null}var Id=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=bu({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 E(c({},super.exportJSON()),{data:this.__data,type:"mention",version:1})}createDOM(t){let o=super.createDOM(t);return o.className=uF.mention,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 L5e({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 bu({text:e,data:t}){return new Id({data:t,text:e}).setMode("segmented").toggleDirectionless()}var gF=()=>re.createElement(LinkPlugin,{validateUrl:mS});var O5e=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,z5e=[e=>{let t=O5e.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}`}}],fF=()=>re.createElement(AutoLinkPlugin,{matchers:z5e});var Q5e=e=>{var o,r;let t=(()=>{switch(screen.orientation.type){case"landscape-primary":case"landscape-secondary":return .5;case"portrait-secondary":case"portrait-primary":return .75;default:return .5}})();return e.visualViewport?((o=e.visualViewport)==null?void 0:o.height)*((r=e.visualViewport)==null?void 0:r.scale)/e.screen.height<t:!1},yF=({commandPriority:e,onEnter:t})=>{let[o]=useLexicalComposerContext();return useEffect(()=>{o.registerCommand(KEY_ENTER_COMMAND,r=>{let n=$getSelection();if(!$isRangeSelection(n)||Q5e(window))return !1;let i=r;return i.preventDefault(),i.shiftKey?o.dispatchCommand(INSERT_PARAGRAPH_COMMAND,void 0):(t(),!0)},e);},[o,t]),null};var cue=200,due=e=>{let[t,o]=useState(null),{isModerator:r}=Xm(e||void 0),{channelMembers:n}=xu({search:t,channelId:e,memberships:["member"],limit:20}),i=s=>{o(s);};return {suggestions:useMemo(()=>{let s=n.map(({user:l,userId:d})=>({userId:(l==null?void 0:l.userId)||d,displayName:l==null?void 0:l.displayName}));return r&&(t===""||/^al*l*$/i.test(t||""))?[{userId:"all",displayName:"All"},...s]:s},[r,n]),queryString:t,onQueryChange:i}};function pue({option:e,isSelected:t,onClick:o,onMouseEnter:r}){return re.createElement("li",{key:e.key,tabIndex:-1,"data-is-selected":t,className:no.userMentionItem__item,ref:e.setRefElement,role:"option","aria-selected":t,onMouseEnter:r,onClick:o},re.createElement("div",null,re.createElement(uo,{className:no.userMentionItem__avatar,userId:e.data.userId})),re.createElement("p",{className:no.userMentionItem__displayName},e.data.displayName))}function uue({option:e,isSelected:t,onClick:o,onMouseEnter:r}){return re.createElement("li",{key:e.key,tabIndex:-1,"data-is-selected":t,className:no.allMentionItem__item,ref:e.setRefElement,role:"option","aria-selected":t,onMouseEnter:r,onClick:o},re.createElement("div",{className:no.allMentionItem__atSign},"@"),re.createElement("p",{className:no.allMentionItem__displayName},e.data.displayName))}var gue=[AutoLinkNode,LinkNode,Id],Iu=({pageId:e="*",channel:t,composeAction:{replyMessage:o,mentionMessage:r,clearReplyMessage:n,clearMention:i}})=>{var P;let a="message_composer",s=useRef(null),l=useRef(null),{themeStyles:d,uiReference:p,config:u,accessibilityId:g}=R({pageId:e,componentId:a}),{confirm:f}=Ye(),y=e2(),{onQueryChange:C,suggestions:h}=due(t.channelId),{mutateAsync:v}=useMutation({mutationFn:I=>MessageRepository.createMessage(I),onSuccess:()=>{var I;(I=l.current)==null||I.update(()=>{$getRoot().clear();}),n&&n();},onError:I=>{let w=I.message,k="Your message wasn't sent. Please try again.";w==="Amity SDK (400308): Text contain blocked word"?k="Your message wasn't sent as it contains a blocked word.":w==="Amity SDK (400309): Data contain link that is not in whitelist"?k="Your message wasn\u2019t sent as it contained a link that\u2019s not allowed.":w==="Amity SDK (400302): User is muted"&&(k="User is muted"),y.error({content:k});}}),b=()=>{if(!t||!l.current)return;let{mentioned:I,mentionees:w,text:k}=dF(l.current);if((k==null?void 0:k.trim().length)!==0){if(k.trim().length>((u==null?void 0:u.message_limit)||cue)){f({title:"Unable to send message",content:"Your message is too long. Please shorten your message and try again.",okText:"Ok"});return}v({tags:[],subChannelId:t.channelId,data:{text:k.trim()},dataType:"text",mentionees:w,metadata:{mentioned:I},parentId:(o==null?void 0:o.messageId)||void 0});}},x=pF({namespace:p,theme:{root:no.editorRoot,placeholder:no.editorPlaceholder,paragraph:no.editorParagraph,link:no.editorLink},nodes:gue});return re.createElement("div",{className:no.composeBarContainer,"data-qa-anchor":g,style:d},re.createElement("div",{className:no.composeBar},re.createElement("div",{ref:s,className:no.optionContainer}),re.createElement("div",{className:no.editorContainer},re.createElement(LexicalComposer,{initialConfig:x},re.createElement(RichTextPlugin,{contentEditable:re.createElement(ContentEditable,null),placeholder:(P=re.createElement("span",{className:no.editorPlaceholder},u.placeholder_text))!=null?P:null,ErrorBoundary:aue}),re.createElement(HistoryPlugin,null),re.createElement(AutoFocusPlugin,null),re.createElement(gF,null),re.createElement(fF,null),re.createElement(EditorRefPlugin,{editorRef:l}),re.createElement(yF,{onEnter:b,commandPriority:COMMAND_PRIORITY_LOW}),re.createElement(mF,{suggestions:h,getSuggestionId:I=>I.userId,onQueryChange:C,$createNode:I=>bu({text:`@${I.displayName||""}`,data:I}),menuRenderFn:(I,{options:w,selectedIndex:k,setHighlightedIndex:S,selectOptionAndCleanUp:A})=>!s.current||w.length===0?null:aie.createPortal(re.createElement(re.Fragment,null,w.map((D,z)=>D.data.userId==="all"?re.createElement(uue,{isSelected:k===z,onClick:()=>{S(z),A(D);},onMouseEnter:()=>{S(z);},key:D.key,option:D}):re.createElement(pue,{isSelected:k===z,onClick:()=>{S(z),A(D);},onMouseEnter:()=>{S(z);},key:D.key,option:D}))),s.current),commandPriority:COMMAND_PRIORITY_HIGH}))),re.createElement("div",{className:no.sendButtonContainer},re.createElement(rF,{className:no.sendButton,onClick:()=>b()}))),re.createElement(vu,null))};var CF=({channelId:e})=>{let r=Qo({fetcher:ChannelRepository.getChannel,params:e,shouldCall:!!e}),{item:t}=r,o=M(r,["item"]);return c({channel:t},o)};var ht={composeBarContainer:"gu",composeBar:"fu",textInputContainer:"hu",composeBarLoading:"uu",replyPlaceholderContainer:"bu",replyAvatar:"vu",replyProfile:"xu",replyProfileName:"wu",replyProfileMessage:"yu",replyDismiss:"ku",notificationPosition:"ju",messageListPlaceholder:"zu",mutedChannelContainer:"Cu",mutedIcon:"Su",commentAltIcon:"Bu",banStatePanel:"Xu"};var hue=({children:e})=>re.createElement(re.Fragment,null,re.createElement("div",{className:ht.messageListPlaceholder},e),re.createElement("div",{className:ht.composeBarContainer},re.createElement("div",{className:ht.composeBar},re.createElement("div",{className:ht.textInputContainer},re.createElement("div",{className:ht.composeBarLoading},re.createElement(V5,{width:20,height:20}),re.createElement("span",null,re.createElement(T.Body,null,"Loading chat..."))))),re.createElement(vu,null))),wu=hue;var vF=({replyMessage:e,onDismiss:t})=>{var r,n;let o=oe(e.creatorId);return o?re.createElement("div",{className:ht.replyPlaceholderContainer},re.createElement("div",{className:ht.replyAvatar},re.createElement(xt,{avatarUrl:(r=o.avatar)==null?void 0:r.fileUrl,defaultImage:re.createElement(Xa,null)})),re.createElement("div",{className:ht.replyProfile},re.createElement("div",{className:ht.replyProfileName},`Replying to ${o.displayName}`),re.createElement("div",{className:ht.replyProfileMessage},(n=e.data)==null?void 0:n.text)),re.createElement("div",{className:ht.replyDismiss},re.createElement(V1,{onClick:t,width:"20",height:"20"}))):null};var vue=({children:e})=>re.createElement("div",{className:ht.messageListPlaceholder},e),xF=vue;var uf={notifications:"Iu",notificationContainer:"Mu",appear:"Xr"};var bF=({className:e,content:t,icon:o})=>re.createElement("div",{className:yi(uf.notificationContainer,e)},o,re.createElement(T.Body,null,t)),gf=()=>{let e=eF();return re.createElement("div",{className:uf.notifications},e.map(t=>re.createElement(bF,E(c({},t),{key:t.id}))))};var Iue=e=>re.createElement("svg",c({width:"23",height:"21",viewBox:"0 0 23 21",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M21.7988 17.7605C22.0449 17.9363 22.1152 18.2878 21.9043 18.5339L21.5527 18.9558C21.3418 19.2019 20.9902 19.2722 20.7793 19.0613L-0.244141 2.60815C-0.490234 2.43237 -0.560547 2.08081 -0.349609 1.83472L0.00195312 1.37769C0.212891 1.16675 0.564453 1.09644 0.810547 1.30737L21.7988 17.7605ZM12.5527 7.49487C13.3262 7.91675 13.8887 8.69019 14.0645 9.53394L11.5684 7.60034C11.8496 7.35425 12.2363 7.31909 12.5527 7.49487ZM13.6074 6.15894C13.2207 5.91284 13.1152 5.3855 13.3613 4.99878C13.6074 4.61206 14.1348 4.47144 14.5215 4.71753C16.3848 5.91284 17.5449 7.9519 17.5449 10.1667C17.5449 10.8347 17.4395 11.4324 17.2637 12.03L15.7871 10.8699C15.8223 10.6589 15.8574 10.4128 15.8574 10.1667C15.8574 8.54956 15.0137 7.03784 13.6074 6.15894ZM15.4707 3.31128C15.084 3.06519 14.9785 2.53784 15.2246 2.11597C15.5059 1.72925 16.0332 1.62378 16.4199 1.86987C19.2324 3.73315 20.9199 6.8269 20.9199 10.1667C20.9199 11.6082 20.6035 12.9441 20.041 14.2097L18.6699 13.1199C19.0215 12.2058 19.1973 11.2214 19.1973 10.1667C19.1973 7.42456 17.8262 4.823 15.4707 3.31128ZM9.66992 4.29565V6.08862L7.49023 4.40112L8.22852 3.698C8.36914 3.52222 8.58008 3.41675 8.79102 3.41675C9.24805 3.41675 9.66992 3.76831 9.66992 4.29565ZM7.98242 14.0691V11.1863L9.66992 12.5222V16.073C9.66992 16.6003 9.24805 16.9167 8.79102 16.9167C8.58008 16.9167 8.36914 16.8464 8.22852 16.6707L5.09961 13.5417H1.51367C1.02148 13.5417 0.669922 13.1902 0.669922 12.698V7.6355C0.669922 7.17847 1.02148 6.79175 1.51367 6.79175H2.35742L4.50195 8.47925H2.35742V11.8542H5.76758L7.98242 14.0691Z"})),ff=Iue;var wF={inputTextContainer:"Yu",invalid:"Au",disabled:"Eu",baseInputStyle:"Fu",mentionContainer:"Ru","live-chat-mention-input":"Ir","live-chat-mention-input__suggestions__list":"Uu",mentions_mention:"Du",mentions__highlighter:"Hu"};var Mue=e=>re.createElement("svg",c({width:"49",height:"49",viewBox:"0 0 49 49",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M37.96 7C40.4209 7 42.46 9.03906 42.46 11.5V31.75C42.46 34.2812 40.4209 36.25 37.96 36.25H27.835L19.0459 42.8594C18.835 43 18.6943 43 18.5537 43C18.0615 43 17.71 42.7188 17.71 42.1562V36.25H10.96C8.42871 36.25 6.45996 34.2812 6.45996 31.75V11.5C6.45996 9.03906 8.42871 7 10.96 7H37.96ZM40.21 31.75V11.5C40.21 10.3047 39.1553 9.25 37.96 9.25H10.96C9.69434 9.25 8.70996 10.3047 8.70996 11.5V31.75C8.70996 33.0156 9.69434 34 10.96 34H19.96V39.3438L26.4287 34.4922L27.0615 34H37.96C39.1553 34 40.21 33.0156 40.21 31.75ZM24.46 25.5625C25.374 25.5625 26.1475 26.3359 26.1475 27.25C26.1475 28.2344 25.374 28.9375 24.46 28.9375C23.4756 28.9375 22.7725 28.2344 22.7725 27.25C22.7725 26.3359 23.4756 25.5625 24.46 25.5625ZM23.8271 23.875C23.5459 23.875 23.2646 23.6641 23.2646 23.3828L22.7725 15.5078C22.7725 15.1562 22.9834 14.875 23.335 14.875H25.5146C25.8662 14.875 26.0771 15.1562 26.0771 15.5078L25.585 23.3828C25.585 23.6641 25.3037 23.875 25.0225 23.875H23.8271Z"})),PF=Mue;var _ue=({pageId:e="*",channel:t})=>{var C;let o=su(),{isModerator:r}=Xm(t.channelId),n=Y().currentUserId,{channelMembers:i}=xu({channelId:t.channelId,memberships:["member","banned","muted"]}),a=i.find(h=>h.userId===n),[s,l]=useState(void 0),[d,p]=useState(void 0),[u,g]=useState(0),f=useRef(null),y=useRef(null);return useEffect(()=>{var h,v;(h=y.current)!=null&&h.clientHeight&&((v=y.current)==null?void 0:v.clientHeight)>0&&g(y.current.clientHeight-30);},[(C=y.current)==null?void 0:C.clientHeight]),o?a!=null&&a.isBanned?re.createElement(xF,null,re.createElement("div",{className:ht.banStatePanel},re.createElement(PF,{className:ht.commentAltIcon}),re.createElement(T.Heading,null,"You are banned from chat"),re.createElement(T.Body,null,"You won\u2019t be able to participate in this chat until you\u2019ve been unbanned."))):re.createElement(re.Fragment,null,re.createElement(Cu,{channel:t,replyMessage:l,pageId:e}),o&&re.createElement(re.Fragment,null,re.createElement("div",{ref:f,className:wF.mentionContainer}),!r&&t.isMuted?re.createElement("div",{className:ht.mutedChannelContainer},re.createElement(ff,{width:20,height:20,className:ht.mutedIcon}),re.createElement(T.Body,null,"This channel has been set to read-only by the channel moderator")):a!=null&&a.isMuted?re.createElement("div",{className:ht.mutedChannelContainer},re.createElement(ff,{width:20,height:20,className:ht.mutedIcon}),re.createElement(T.Body,null,"You\u2019ve been muted by the channel moderator")):null,s&&re.createElement(vF,{replyMessage:s,onDismiss:()=>l(void 0)}),re.createElement("div",{className:ht.notificationPosition,style:{bottom:u}},re.createElement(gf,null)),re.createElement("div",{ref:y},re.createElement(Iu,{pageId:e,disabled:!r&&t.isMuted||(a==null?void 0:a.isMuted),channel:t,suggestionRef:f,composeAction:{replyMessage:s,mentionMessage:d,clearReplyMessage:()=>l(void 0),clearMention:()=>p(void 0)}})))):re.createElement(wu,null)},SF=_ue;var Sue=({pageId:e="*",channel:t})=>t?re.createElement(SF,{channel:t,pageId:e}):re.createElement(wu,null),kF=Sue;var hf={messageListHeaderWrap:"Lu",liveChat:"Tu"};var NF=({channelId:e})=>{let{channel:t}=CF({channelId:e}),o="live_chat",{themeStyles:r}=Xe({pageId:o}),n=useRef(null);return re.createElement(RH,null,re.createElement("div",{className:hf.liveChat,ref:n,style:r},re.createElement("div",{className:hf.messageListHeaderWrap},re.createElement(lu,{channel:t,pageId:o})),re.createElement(kF,{channel:t,pageId:o})))};var xe={storyPreview_title:"Vu",contentWrapper:"qu",storyPreviewWrapper:"Gu",storyPreview_description:"Ju",storyPreviewContainer:"Ku",headerContainer:"Nu",progressBar:"Mr",progressFill:"Ou",userInfo:"Pu",storyPreviewTitle:"Yr",nameContainer:"Qu",hyperLinkContainer:"Wu",mediaContainer:"Ar",media:"Zu",avatarContainer:"Er",imageFit:"_u",imageCover:"eb",headerContent:"rb",userInfoContent:"ab",shadowOverlay:"ob",pulse:"Fr",skeleton:"d",textSkeleton:"tb",nameSkeleton:"ib",timeSkeleton:"lb"};var Eue=e=>re.createElement("svg",c({width:"100%",height:"100%",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("rect",{width:"40",height:"40",rx:"20",fill:"#D9E5FC"}),re.createElement("path",{d:"M19.8462 12C20.7625 12 21.6413 12.356 22.2893 12.9898C22.9373 13.6235 23.3013 14.4831 23.3013 15.3793C23.3013 16.2756 22.9373 17.1351 22.2893 17.7688C21.6413 18.4026 20.7625 18.7586 19.8462 18.7586C18.9298 18.7586 18.051 18.4026 17.403 17.7688C16.755 17.1351 16.391 16.2756 16.391 15.3793C16.391 14.4831 16.755 13.6235 17.403 12.9898C18.051 12.356 18.9298 12 19.8462 12ZM12.9359 14.4138C13.4887 14.4138 14.0021 14.5586 14.4463 14.8193C14.2982 16.2 14.7128 17.571 15.5618 18.6428C15.0682 19.5697 14.081 20.2069 12.9359 20.2069C12.1504 20.2069 11.3972 19.9017 10.8418 19.3585C10.2864 18.8153 9.97436 18.0786 9.97436 17.3103C9.97436 16.5421 10.2864 15.8054 10.8418 15.2622C11.3972 14.719 12.1504 14.4138 12.9359 14.4138ZM26.7564 14.4138C27.5419 14.4138 28.2951 14.719 28.8505 15.2622C29.4059 15.8054 29.7179 16.5421 29.7179 17.3103C29.7179 18.0786 29.4059 18.8153 28.8505 19.3585C28.2951 19.9017 27.5419 20.2069 26.7564 20.2069C25.6113 20.2069 24.6241 19.5697 24.1305 18.6428C24.9795 17.571 25.3941 16.2 25.246 14.8193C25.6903 14.5586 26.2036 14.4138 26.7564 14.4138ZM13.4295 24.3103C13.4295 22.3117 16.3022 20.6897 19.8462 20.6897C23.3901 20.6897 26.2628 22.3117 26.2628 24.3103V26H13.4295V24.3103ZM8 26V24.5517C8 23.2097 9.86577 22.08 12.3929 21.7517C11.8105 22.4083 11.4551 23.3159 11.4551 24.3103V26H8ZM31.6923 26H28.2372V24.3103C28.2372 23.3159 27.8818 22.4083 27.2994 21.7517C29.8265 22.08 31.6923 23.2097 31.6923 24.5517V26Z",fill:"white"})),Pu=Eue;var EF=({width:e="100%",height:t="100%"})=>re.createElement("div",{className:xe.storyPreviewWrapper,style:{width:e,height:t}},re.createElement("div",{className:xe.storyPreviewContainer},re.createElement("div",{className:xe.shadowOverlay}),re.createElement("div",{className:xe.headerContainer},re.createElement("div",{className:xe.headerContent},re.createElement("div",{className:xe.userInfo},re.createElement("div",{className:xe.userInfoContent},re.createElement("div",{className:yi(xe.avatarContainer,xe.skeleton)}),re.createElement("div",{className:xe.textSkeleton},re.createElement("div",{className:yi(xe.nameSkeleton,xe.skeleton)}),re.createElement("div",{className:yi(xe.timeSkeleton,xe.skeleton)})))))),re.createElement("div",{className:xe.contentWrapper},re.createElement("div",{className:yi(xe.mediaContainer,xe.skeleton)}))));var AF=({mediaType:e,hyperLink:t,width:o="100%",height:r="100%",onPlay:n,onPause:i,avatar:a,title:s,duration:l=5e3,isOfficial:d=!0,imageMode:p})=>{var N,O,K,Z;let[u,g]=useState(!0),[f,y]=useState(0),[C,h]=useState([]),v=useRef(null),b=useRef(null),[x,P]=useState(!0),[I,w]=useState(!1),k,S=()=>{g(!0),n&&n();},A=()=>{g(!1),i&&i();},D=()=>{(e==null?void 0:e.type)==="video"&&v.current?(v.current.currentTime=0,v.current.play()):(e==null?void 0:e.type)==="image"&&g(!1);},z=()=>{(e==null?void 0:e.type)==="video"&&v.current&&(v.current.currentTime=0,v.current.play(),y(0));},V=()=>{u?(A(),(e==null?void 0:e.type)==="video"&&v.current&&v.current.pause()):(S(),(e==null?void 0:e.type)==="video"&&v.current&&v.current.play());};return useEffect(()=>{let G=H=>_(void 0,null,function*(){let U=new Image;U.crossOrigin="Anonymous",U.src=H,U.onload=()=>{let W=new Tce().getPalette(U,2);if(W){let B=W.map($=>`rgb(${$[0]}, ${$[1]}, ${$[2]})`);h(B),P(!1);}},U.onerror=()=>{console.error("Error loading image for color extraction"),h([]),P(!1);};});return e!=null&&e.url&&(e==null?void 0:e.type)==="image"?G(e.url):(h([]),P(!1)),()=>{h([]),P(!0);}},[e==null?void 0:e.url]),useEffect(()=>(u?k=setInterval(()=>{if((e==null?void 0:e.type)==="video"&&v.current){let G=v.current.currentTime,H=v.current.duration,U=G/H*100;y(U),U>=100&&(clearInterval(k),D());}else (e==null?void 0:e.type)==="image"&&I&&y(G=>G>=100?(clearInterval(k),D(),100):G+100/(l/100));},100):clearInterval(k),()=>{clearInterval(k);}),[u,e,l,I]),x?re.createElement(EF,null):re.createElement("div",{className:xe.storyPreviewWrapper,style:{width:o,height:r}},re.createElement("div",{className:xe.storyPreviewContainer},re.createElement("div",{className:xe.headerContainer},re.createElement("div",{className:xe.progressBar},re.createElement("div",{className:xe.progressFill,style:{width:`${f}%`}})),re.createElement("div",{className:xe.headerContent},re.createElement("div",{className:xe.userInfo},re.createElement("div",{className:xe.userInfoContent},re.createElement("div",{className:xe.avatarContainer},re.createElement(xt,{avatarUrl:a,defaultImage:re.createElement(Pu,null)})),re.createElement(T.BodyBold,{className:xe.storyPreviewTitle},re.createElement("span",{className:xe.nameContainer},s," ",d&&re.createElement(Ys,{fill:"white"})))),(e==null?void 0:e.type)==="video"&&re.createElement("div",{onClick:V},u?re.createElement(Is,{width:24,height:24}):re.createElement(Io,{width:24,height:24}))))),re.createElement("div",{className:xe.contentWrapper},re.createElement("div",{className:xe.mediaContainer,style:{background:`linear-gradient(
|
|
5292
|
+
`,e3e=e=>{let t=v4$1();return re.createElement(Rpe,c({xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",viewBox:"0 0 17 16",fill:"none"},e),re.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.52453 4C9.52453 4.31559 9.26869 4.57143 8.9531 4.57143C8.63751 4.57143 8.38167 4.31559 8.38167 4V0.571429C8.38167 0.255837 8.63751 0 8.9531 0C9.26869 0 9.52453 0.255837 9.52453 0.571428V4ZM7.23891 5.03082C7.51222 4.87303 7.60586 4.52355 7.44807 4.25024L5.73378 1.28101C5.57599 1.0077 5.22651 0.914056 4.9532 1.07185C4.67989 1.22965 4.58624 1.57913 4.74404 1.85244L6.45832 4.82167C6.61612 5.09498 6.9656 5.18862 7.23891 5.03082ZM5.77458 5.50525C6.04789 5.66304 6.14153 6.01252 5.98374 6.28583C5.82594 6.55914 5.47646 6.65278 5.20315 6.49499L2.23392 4.7807C1.96061 4.62291 1.86697 4.27343 2.02476 4.00012C2.18256 3.72681 2.53204 3.63316 2.80535 3.79096L5.77458 5.50525ZM5.52455 8.00013C5.52455 7.68454 5.26872 7.4287 4.95312 7.4287H1.52455C1.20896 7.4287 0.953125 7.68454 0.953125 8.00013C0.953125 8.31572 1.20896 8.57156 1.52455 8.57156H4.95313C5.26872 8.57156 5.52455 8.31572 5.52455 8.00013ZM5.20327 9.50543C5.47658 9.34764 5.82606 9.44128 5.98385 9.71459C6.14165 9.9879 6.048 10.3374 5.77469 10.4952L2.80546 12.2095C2.53215 12.3673 2.18267 12.2736 2.02488 12.0003C1.86708 11.727 1.96073 11.3775 2.23404 11.2197L5.20327 9.50543ZM7.23874 10.9693C6.96543 10.8115 6.61595 10.9051 6.45815 11.1784L4.74387 14.1476C4.58607 14.4209 4.67971 14.7704 4.95302 14.9282C5.22633 15.086 5.57581 14.9924 5.73361 14.7191L7.44789 11.7498C7.60569 11.4765 7.51205 11.127 7.23874 10.9693ZM8.95292 11.4287C8.63732 11.4287 8.38149 11.6845 8.38149 12.0001V15.4287C8.38149 15.7443 8.63732 16.0001 8.95292 16.0001C9.26851 16.0001 9.52435 15.7443 9.52435 15.4287V12.0001C9.52435 11.6845 9.26851 11.4287 8.95292 11.4287ZM10.6674 5.03064C10.9407 5.18843 11.2901 5.09479 11.4479 4.82148L13.1622 1.85225C13.32 1.57894 13.2264 1.22946 12.9531 1.07166C12.6798 0.913868 12.3303 1.00751 12.1725 1.28082L10.4582 4.25005C10.3004 4.52336 10.394 4.87284 10.6674 5.03064ZM12.7028 6.4947C12.4295 6.65249 12.08 6.55885 11.9222 6.28554C11.7644 6.01223 11.8581 5.66275 12.1314 5.50496L15.1006 3.79067C15.3739 3.63287 15.7234 3.72652 15.8812 3.99983C16.039 4.27314 15.9453 4.62262 15.672 4.78041L12.7028 6.4947ZM12.3816 8C12.3816 8.31559 12.6374 8.57143 12.953 8.57143H16.3816C16.6972 8.57143 16.953 8.31559 16.953 8C16.953 7.68441 16.6972 7.42857 16.3816 7.42857H12.953C12.6374 7.42857 12.3816 7.68441 12.3816 8ZM12.1315 10.4946C11.8582 10.3368 11.7646 9.98737 11.9224 9.71406C12.0801 9.44075 12.4296 9.3471 12.7029 9.5049L15.6722 11.2192C15.9455 11.377 16.0391 11.7265 15.8813 11.9998C15.7235 12.2731 15.3741 12.3667 15.1007 12.2089L12.1315 10.4946ZM10.6673 10.9693C10.3939 11.1271 10.3003 11.4766 10.4581 11.7499L12.1724 14.7191C12.3302 14.9924 12.6797 15.0861 12.953 14.9283C13.2263 14.7705 13.3199 14.421 13.1621 14.1477L11.4478 11.1785C11.29 10.9052 10.9406 10.8115 10.6673 10.9693Z",fill:`url(#paint_${t})`}),re.createElement("defs",null,re.createElement("radialGradient",{id:`paint_${t}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(8.95312 8) scale(8)"},re.createElement("stop",{offset:"0.669733",stopColor:"white"}),re.createElement("stop",{offset:"0.716307",stopColor:"white",stopOpacity:"0.01"}))))},PH=e3e;var SH={DIRECT_CHAT:2,ONLY_ME_CHAT:1};function i3e(e,t){var i,a,s;if((i=e==null?void 0:e.metadata)!=null&&i.isDirectChat&&(e==null?void 0:e.memberCount)===SH.ONLY_ME_CHAT)return "Me";if(!((a=e==null?void 0:e.metadata)!=null&&a.isDirectChat)&&(e!=null&&e.displayName))return e==null?void 0:e.displayName;let{firstname:o="",lastname:r=""}=(s=t==null?void 0:t.metadata)!=null?s:{},n=trim(`${o}${r}`);return (t==null?void 0:t.displayName)||n||(t==null?void 0:t.userId)||e.channelId}function G9(o){return _(this,arguments,function*({avatarFileId:e,avatarCustomUrl:t}){if(t)return t;if(e){let r=yield FileRepository.getFile(e);return FileRepository.fileUrlWithSize(r.data.fileUrl,"small")}return null})}function a3e(e,t,o){return _(this,null,function*(){var r,n;return (e==null?void 0:e.memberCount)===SH.ONLY_ME_CHAT?G9({avatarCustomUrl:o==null?void 0:o.avatarUrl}):(r=e==null?void 0:e.metadata)!=null&&r.isDirectChat&&(t!=null&&t.avatarUrl)?G9({avatarCustomUrl:t.avatarUrl}):G9({avatarFileId:e==null?void 0:e.avatarFileId,avatarCustomUrl:(n=e==null?void 0:e.metadata)==null?void 0:n.avatarCustomUrl})})}function s3e({channel:e}){var p,u,g;let{currentUserId:t}=Z1(),[o,r]=useState(null),n=(p=e==null?void 0:e.metadata)!=null&&p.isDirectChat?((g=(u=e==null?void 0:e.metadata)==null?void 0:u.userIds)!=null?g:[]).find(f=>f!==t):null,i=oe(t),a=oe(n),s=se({fileId:i==null?void 0:i.avatarFileId}),l=se({fileId:a==null?void 0:a.avatarFileId});return useEffect(()=>{function f(){return _(this,null,function*(){r(null);let y=yield a3e(e,{avatarUrl:(a==null?void 0:a.avatarCustomUrl)||l},{avatarUrl:(i==null?void 0:i.avatarCustomUrl)||s});r(y);})}f();},[a==null?void 0:a.avatarCustomUrl,e,s,i==null?void 0:i.avatarCustomUrl]),{chatName:useMemo(()=>e==null?void 0:i3e(e,a),[e,a]),chatAvatar:o,type:e==null?void 0:e.type}}var TH=s3e;var Km={messageListHeader:"Vf",displayName:"qf",memberCount:"Gf",memberIcon:"Jf",avatar:"Kf"};var lu=({channel:e,pageId:t="*"})=>{let o="chat_header",{themeStyles:r}=R({pageId:t,componentId:o}),{chatName:n,chatAvatar:i}=TH({channel:e}),a=su();return re.createElement("div",{className:Km.messageListHeader,style:r},re.createElement("div",{className:Km.avatar},re.createElement(xt,{avatarUrl:i,defaultImage:re.createElement(IH,null)})),re.createElement("div",null,re.createElement("div",{className:Km.displayName},re.createElement(T.Title,null,n||"Loading...")),re.createElement("div",{className:Km.memberCount},a?re.createElement(re.Fragment,null,re.createElement(MH,{className:Km.memberIcon}),re.createElement(T.Caption,null,Tx((e==null?void 0:e.memberCount)||0)," ",`${(e==null?void 0:e.memberCount)||0} ${(e==null?void 0:e.memberCount)===1?"member":"members"}`)):re.createElement(re.Fragment,null,re.createElement(PH,{width:20,height:20}),re.createElement(T.Caption,null,"Waiting for connection...")))))};var kH={spinner:"Nf",rotate:"wr"};var NH=o=>{var r=o,{className:e}=r,t=M(r,["className"]);return re.createElement("svg",c({width:"25",height:"25",xmlns:"http://www.w3.org/2000/svg","aria-label":"Loading...",viewBox:"0 0 100 100",version:"1.1",className:yi(kH.spinner,e)},t),re.createElement("defs",{id:"defs3821"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0",rx:"3",ry:"3",transform:"rotate(-90 50 50)",width:"25",x:"72",y:"47",id:"rect3793"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.08333333333333333",rx:"3",ry:"3",transform:"rotate(-60 50 50)",width:"25",x:"72",y:"47",id:"rect3795"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.16666666666666666",rx:"3",ry:"3",transform:"rotate(-30 50 50)",width:"25",x:"72",y:"47",id:"rect3797"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.25",rx:"3",ry:"3",transform:"rotate(0 50 50)",width:"25",x:"72",y:"47",id:"rect3799"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.3333333333333333",rx:"3",ry:"3",transform:"rotate(30 50 50)",width:"25",x:"72",y:"47",id:"rect3801"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.4166666666666667",rx:"3",ry:"3",transform:"rotate(60 50 50)",width:"25",x:"72",y:"47",id:"rect3803"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.5",rx:"3",ry:"3",transform:"rotate(90 50 50)",width:"25",x:"72",y:"47",id:"rect3805"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.5833333333333334",rx:"3",ry:"3",transform:"rotate(120 50 50)",width:"25",x:"72",y:"47",id:"rect3807"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.6666666666666666",rx:"3",ry:"3",transform:"rotate(150 50 50)",width:"25",x:"72",y:"47",id:"rect3809"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.75",rx:"3",ry:"3",transform:"rotate(180 50 50)",width:"25",x:"72",y:"47",id:"rect3811"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.8333333333333334",rx:"3",ry:"3",transform:"rotate(210 50 50)",width:"25",x:"72",y:"47",id:"rect3813"}),re.createElement("rect",{fill:"#555555",height:"6",opacity:"0.9166666666666666",rx:"3",ry:"3",transform:"rotate(240 50 50)",width:"25",x:"72",y:"47",id:"rect3815"}))};var rr={optionButton:"Of",optionIcon:"Pf",reactionIcon:"Qf",timestamp:"Wf",messageActionButton:"Zf",messageActionButtonText:"_f",messageDangerActionButtonText:"eh",copyIcon:"rh",replyIcon:"ah",binIcon:"oh",mentionIcon:"th",flagIcon:"ih"};var u3e=t=>{var e=M(t,[]);return re.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"21",viewBox:"0 0 20 21"},e),re.createElement("path",{d:"M10 8.78369C10.8125 8.78369 11.5 9.47119 11.5 10.2837C11.5 11.1274 10.8125 11.7837 10 11.7837C9.15625 11.7837 8.5 11.1274 8.5 10.2837C8.5 9.47119 9.15625 8.78369 10 8.78369ZM8.5 5.53369C8.5 4.72119 9.15625 4.03369 10 4.03369C10.8125 4.03369 11.5 4.72119 11.5 5.53369C11.5 6.37744 10.8125 7.03369 10 7.03369C9.15625 7.03369 8.5 6.37744 8.5 5.53369ZM8.5 15.0337C8.5 14.2212 9.15625 13.5337 10 13.5337C10.8125 13.5337 11.5 14.2212 11.5 15.0337C11.5 15.8774 10.8125 16.5337 10 16.5337C9.15625 16.5337 8.5 15.8774 8.5 15.0337Z"}))},BH=u3e;var LH={popover:"lh",fixed:"ch"};var C3e=i=>{var a=i,{isOpen:e,content:t,fixed:o=!1,children:r}=a,n=M(a,["isOpen","content","fixed","children"]);return re.createElement(Popover,c({containerClassName:yi(LH.popover,{fixed:!1}),isOpen:e,content:t},n),r)},AH=C3e;var v3e=e=>re.createElement("svg",c({width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M1.4375 10.5586C0.84375 9.99609 0.84375 9.02734 1.4375 8.46484L6.9375 2.96484C7.875 1.99609 9.5 2.68359 9.5 4.02734V6.52734C13.7812 6.65234 19 7.49609 19 12.8398C19 15.1211 17.7812 17.0273 15.9375 18.2461C14.7812 19.0273 13.25 17.9336 13.6875 16.5586C14.4375 14.1211 14.0625 12.8398 9.5 12.5586V14.9961C9.5 16.3398 7.875 17.0273 6.9375 16.0586L1.4375 10.5586ZM2.5 9.49609L8 14.9961V11.0273C13.125 11.0586 16.6562 12.0586 15.0938 16.9961C16.25 16.2461 17.5 14.9336 17.5 12.8398C17.5 8.37109 12.4688 8.02734 8 8.02734V3.99609L2.5 9.49609Z",fill:"currenColor"})),HH=v3e;var x3e=e=>re.createElement("svg",c({width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M16.5312 5.03992C16.7812 5.28992 17 5.75867 17 6.10242V14.4774C17 15.3212 16.3125 15.9774 15.5 15.9774H13V17.4774C13 18.3212 12.3125 18.9774 11.5 18.9774H4.5C3.65625 18.9774 3 18.3212 3 17.4774V7.47742C3 6.66492 3.65625 5.97742 4.5 5.97742H7V4.47742C7 3.66492 7.65625 2.97742 8.5 2.97742H13.875C14.2188 2.97742 14.6875 3.19617 14.9375 3.44617L16.5312 5.03992ZM11.3125 17.4774C11.4062 17.4774 11.5 17.4149 11.5 17.2899V15.9774H8.5C7.65625 15.9774 7 15.3212 7 14.4774V7.47742H4.6875C4.5625 7.47742 4.5 7.57117 4.5 7.66492V17.2899C4.5 17.4149 4.5625 17.4774 4.6875 17.4774H11.3125ZM15.3125 14.4774C15.4062 14.4774 15.5 14.4149 15.5 14.2899V7.97742H12.75C12.3125 7.97742 12 7.66492 12 7.22742V4.47742H8.6875C8.5625 4.47742 8.5 4.57117 8.5 4.66492V14.2899C8.5 14.4149 8.5625 14.4774 8.6875 14.4774H15.3125ZM15.5 6.47742V6.19617C15.5 6.13367 15.4688 6.10242 15.4375 6.07117L13.9062 4.53992C13.875 4.50867 13.8438 4.47742 13.7812 4.47742H13.5V6.47742H15.5Z",fill:"currenColor"})),OH=x3e;var b3e=e=>re.createElement("svg",c({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M12.875 4.375C13.0625 4.375 13.25 4.5625 13.25 4.75V5.125C13.25 5.33594 13.0625 5.5 12.875 5.5H12.5L11.9844 13.4453C11.9609 14.0312 11.4453 14.5 10.8594 14.5H5.11719C4.53125 14.5 4.01562 14.0312 3.99219 13.4453L3.5 5.5H3.125C2.91406 5.5 2.75 5.33594 2.75 5.125V4.75C2.75 4.5625 2.91406 4.375 3.125 4.375H5.04688L5.84375 3.0625C6.03125 2.75781 6.45312 2.5 6.80469 2.5H9.17188C9.52344 2.5 9.94531 2.75781 10.1328 3.0625L10.9297 4.375H12.875ZM6.80469 3.625L6.35938 4.375H9.61719L9.17188 3.625H6.80469ZM10.8594 13.375L11.3516 5.5H4.625L5.11719 13.375H10.8594Z"})),mu=b3e;var I3e=o=>{var r=o,{color:e="#FA4D30"}=r,t=M(r,["color"]);return re.createElement("svg",c({width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),re.createElement("path",{d:"M10.5 2.99609C11.5938 2.99609 12.7812 2.62109 13.9062 2.12109C14.875 1.71484 16 2.43359 16 3.49609V10.9961C16 11.5273 15.7188 11.9961 15.3125 12.2773C14.4688 12.8086 13.125 13.4961 11.2812 13.4961C9.15625 13.4961 7.75 12.4961 6.21875 12.4961C4.46875 12.4961 3.40625 12.8711 2.25 13.4023V15.9961C2.25 16.2773 2 16.4961 1.75 16.4961H1.25C0.96875 16.4961 0.75 16.2773 0.75 15.9961V3.30859C0.28125 3.05859 0 2.55859 0 1.99609C0 1.15234 0.71875 0.464844 1.59375 0.527344C2.3125 0.558594 2.90625 1.12109 2.96875 1.83984C2.96875 1.87109 3 1.96484 3 1.99609C3 2.15234 2.9375 2.37109 2.90625 2.49609C3.59375 2.21484 4.4375 1.99609 5.4375 1.99609C7.5625 1.99609 8.96875 2.99609 10.5 2.99609ZM14.5 10.9961V3.49609C13.5 3.96484 11.8438 4.49609 10.5 4.49609C8.625 4.49609 7.3125 3.49609 5.4375 3.49609C4.125 3.49609 2.90625 4.02734 2.25 4.49609V11.7461C3.21875 11.3086 4.875 10.9961 6.21875 10.9961C8.09375 10.9961 9.40625 11.9961 11.2812 11.9961C12.5938 11.9961 13.8125 11.4961 14.5 10.9961Z",fill:e}))},cu=I3e;var $H=({isOwner:e,isModerator:t,isFlagged:o,action:r,containerRef:n})=>{let[i,a]=useState(!1),s=useRef(null),l=()=>{r.onCopy&&r.onCopy(),a(!1);},d=()=>{r.onReply&&r.onReply(),a(!1);},p=()=>{r.onDelete&&r.onDelete(),a(!1);},u=()=>{r.onFlag&&r.onFlag(),a(!1);},g=()=>{r.onUnflag&&r.onUnflag(),a(!1);};return re.createElement(re.Fragment,null,re.createElement(AH,{positions:["bottom","top"],onClickOutside:()=>a(!1),isOpen:i,align:"start",parentElement:(n==null?void 0:n.current)||void 0,content:re.createElement(re.Fragment,null,re.createElement("div",{className:rr.messageActionButton,onClick:d},re.createElement("div",{className:rr.messageActionButtonText},re.createElement(T.Body,null,"Reply")),re.createElement(HH,{className:rr.replyIcon})),re.createElement("div",{className:rr.messageActionButton,onClick:l},re.createElement("div",{className:rr.messageActionButtonText},re.createElement(T.Body,null,"Copy")),re.createElement(OH,{className:rr.copyIcon})),(t||!e)&&re.createElement("div",{className:rr.messageActionButton,onClick:o?g:u},re.createElement("div",{className:rr.messageDangerActionButtonText},re.createElement(T.Body,null,o?"Unreport":"Report")),re.createElement(cu,{className:rr.flagIcon})),(e||t)&&re.createElement("div",{className:rr.messageActionButton,onClick:p},re.createElement("div",{className:rr.messageDangerActionButtonText},re.createElement(T.Body,null,"Delete")),re.createElement(mu,{className:rr.binIcon})))},re.createElement("div",{className:rr.optionButton,ref:s,onClick:()=>{a(!i);}},re.createElement(BH,{className:rr.optionIcon}))))};var du={messageItemContainer:"sh",userDisplayName:"nh",avatar:"dh",moderatorBadge:"mh"};var _3e=({avatarUrl:e,displayName:t,children:o})=>re.createElement("div",{className:du.messageItemContainer},re.createElement("div",{className:du.avatar},re.createElement(xt,{avatarUrl:e,defaultImage:re.createElement(Xa,null)})),re.createElement("div",null,re.createElement("div",{className:du.userDisplayName},re.createElement(T.CaptionBold,null,t)),o)),VH=_3e;var ys={messageBubble:"yr",messageRepliedBubble:"ph",messageParentContainer:"gh",messageParentDisplayName:"fh",messageParentText:"hh",messageChildContainer:"uh",messageChildText:"bh"};var k3e=e=>Nt({fetcher:MessageRepository.getMessage,params:e,shouldCall:!!e}),jH=k3e;var pu={mentionText:"vh",hyperlink:"xh"};var GH={hyperlink:"wh"};var L3e=({linkClassName:e,children:t})=>re.createElement(yG,{options:{target:"_blank",render:({attributes:o,content:r})=>re.createElement("a",c({className:e||GH.hyperlink},o),r)}},t),Z9=L3e;var A3e=({message:e,className:t})=>{var n,i,a;let o=(n=e.metadata)==null?void 0:n.mentioned,r=o==null?void 0:o.sort((s,l)=>s.index-l.index);if(r!=null&&r.length){let s=((i=e.data)==null?void 0:i.text)||"",l=[],d=0;r.forEach(u=>{let g=u.index,f=u.index+u.length+1,y=s.slice(d,g),C=s.slice(g,f);y&&l.push({text:y,isMention:!1}),l.push({text:C,isMention:!0}),d=f;});let p=s.slice(d);return p&&l.push({text:p,isMention:!1}),re.createElement(T.Body,{className:t},l.map((u,g)=>u.isMention?re.createElement("span",{key:g,className:pu.mentionText},u.text):re.createElement("span",{key:g},re.createElement(Z9,{linkClassName:pu.hyperlink},u.text))))}return re.createElement(T.Body,{className:t},re.createElement(Z9,{linkClassName:pu.hyperlink},(a=e.data)==null?void 0:a.text))},Q9=A3e;var D3e=({message:e})=>{var r,n,i;let{currentUserId:t}=X(),o=(n=(r=e.metadata)==null?void 0:r.mentioned)==null?void 0:n.some(a=>a.userId===t||a.type==="channel");if(e&&e.parentId){let a=jH(e.parentId),s=oe(a==null?void 0:a.creatorId);return !a||!s?null:re.createElement("div",{className:ys.messageRepliedBubble},re.createElement("div",{className:ys.messageParentContainer},re.createElement("div",{className:ys.messageParentDisplayName},re.createElement(T.BodyBold,null,s.displayName)),re.createElement(T.Body,{className:ys.messageParentText},(i=a.data)==null?void 0:i.text)),re.createElement("div",{className:ys.messageChildContainer},re.createElement(Q9,{className:ys.messageChildText,message:e})))}return re.createElement("div",{"data-mentioned":o,className:ys.messageBubble},re.createElement(Q9,{message:e}))},QH=D3e;var Xm=e=>{let{client:t}=X();return {isModerator:useMemo(()=>{if(!e)return !1;let r=(t==null?void 0:t.hasPermission("MUTE_CHANNEL").currentUser())||!1,n=(t==null?void 0:t.hasPermission("MUTE_CHANNEL").channel(e))||!1;return r||n},[e])}};var WH=e=>re.createElement("svg",c({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.0766 3.686C11.6827 3.45305 12.3021 3.33948 12.9061 3.3335C14.7179 3.31558 16.3937 4.2689 17.1729 5.89093L17.1895 5.92546L17.202 5.9624C17.6819 7.39004 17.5517 8.83248 17.0292 10.1008C16.7326 9.72289 16.3721 9.39755 15.964 9.14106C16.2254 8.26924 16.2483 7.32915 15.9455 6.39919C15.3774 5.24797 14.2332 4.57487 12.9278 4.60378C12.4981 4.61329 12.0515 4.70045 11.6019 4.86956C11.1731 5.08422 10.8198 5.36694 10.5238 5.73675L10.0093 6.37992L9.47729 5.74959C8.38507 4.45434 6.19511 4.17996 4.72103 5.44206C3.63692 6.5523 3.60343 8.44184 4.37082 10.0205C5.31606 11.6937 7.28176 13.3534 9.14794 14.7202L9.15794 14.7275C9.27155 14.8082 9.38012 14.8942 9.48451 14.9769C9.57334 15.0473 9.65915 15.1152 9.74247 15.1755C9.83249 15.2407 9.91925 15.2913 9.98761 15.3273C10.0527 15.3006 10.1319 15.2662 10.2153 15.2157C10.2662 15.1848 10.3205 15.1506 10.3776 15.1136C10.6388 15.4735 10.9562 15.7901 11.3169 16.0503C11.1818 16.1421 11.0508 16.227 10.9257 16.3029C10.8808 16.33 10.8388 16.3568 10.7982 16.3826C10.5856 16.5181 10.4104 16.6296 10.0526 16.6594L9.96091 16.6666L9.87002 16.6497C9.46411 16.575 9.1867 16.3802 8.94112 16.2025C8.80472 16.1038 8.67845 16.0042 8.57194 15.9202C8.48669 15.8529 8.4141 15.7957 8.3591 15.7569L8.35494 15.7536L8.34994 15.7496C6.42696 14.342 4.31681 12.6298 3.18676 10.6147L3.17842 10.5987L3.17008 10.5834C2.21058 8.62424 2.1731 6.14474 3.7738 4.53473L3.79047 4.51786L3.80882 4.50181C5.63352 2.91773 8.30066 3.019 9.97595 4.41428C10.2872 4.13498 10.6374 3.8993 11.0216 3.71089L11.0491 3.69724L11.0766 3.686Z",fill:"currentColor"}),re.createElement("path",{d:"M13.6839 10.0507L13.6839 10.0501L13.6725 10.0522C13.5717 10.0706 13.4807 10.1238 13.4151 10.2025C13.3496 10.2811 13.3137 10.3803 13.3137 10.4827C13.3137 10.4827 13.3137 10.4827 13.3137 10.4827V12.2327H11.5637V12.2322L11.5527 12.2332L11.4964 12.2382L11.4964 12.2376L11.485 12.2397C11.3842 12.2581 11.2932 12.3113 11.2276 12.39C11.1621 12.4686 11.1262 12.5678 11.1262 12.6702H11.1257L11.1267 12.6812L11.1317 12.7375L11.1312 12.7375L11.1333 12.7489C11.1517 12.8496 11.2049 12.9407 11.2835 13.0063C11.3622 13.0718 11.4613 13.1077 11.5637 13.1077C11.5637 13.1077 11.5637 13.1077 11.5638 13.1077H13.3137V14.8577H13.3132L13.3142 14.8687L13.3192 14.925L13.3187 14.925L13.3208 14.9364C13.3392 15.0371 13.3924 15.1282 13.471 15.1938L13.5511 15.0977L13.471 15.1938C13.5497 15.2593 13.6489 15.2952 13.7513 15.2952L13.7513 15.2957L13.7623 15.2947L13.8185 15.2897L13.8186 15.2902L13.83 15.2881C13.9307 15.2697 14.0218 15.2165 14.0873 15.1379C14.1529 15.0592 14.1887 14.96 14.1887 14.8577C14.1887 14.8577 14.1887 14.8576 14.1887 14.8576V13.1077H15.9387V13.1082L15.9498 13.1072L16.006 13.1022L16.0061 13.1027L16.0175 13.1006C16.1182 13.0822 16.2093 13.029 16.2748 12.9504C16.3404 12.8717 16.3763 12.7725 16.3762 12.6701L16.3767 12.6701L16.3757 12.6591L16.3707 12.6028L16.3713 12.6028L16.3692 12.5914C16.3507 12.4907 16.2976 12.3996 16.2189 12.3341C16.1403 12.2685 16.0411 12.2326 15.9387 12.2327C15.9387 12.2327 15.9387 12.2327 15.9387 12.2327H14.1887V10.4827H14.1892L14.1882 10.4716L14.1832 10.4153L14.1838 10.4153L14.1817 10.4039C14.1632 10.3032 14.1101 10.2121 14.0314 10.1466C13.9527 10.081 13.8536 10.0451 13.7512 10.0452V10.0447L13.7402 10.0457L13.6839 10.0507Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.25"}));var uu=o=>_(void 0,[o],function*({reactionName:e,message:t}){let r=t.myReactions||[];if(r.includes(e)){yield ReactionRepository.removeReaction("message",t.messageId,e);return}r.length>0&&(yield ReactionRepository.removeReaction("message",t.messageId,r[0])),yield ReactionRepository.addReaction("message",t.messageId,e);});var K9={quickReactionIcon:"yh",quickReactionIconContainer:"kr"};var gu=({pageId:e="*",componentId:t="*",message:o,onSelectReaction:r})=>{let n="message_quick_reaction",{config:i}=L({pageId:e,componentId:t,elementId:n}),{config:a}=mi(),s=useCallback(()=>{a&&i.reaction&&a.find(l=>l.name===i.reaction)&&uu({reactionName:i.reaction,message:o}),r&&r();},[a,i,o]);return re.createElement("div",{className:K9.quickReactionIconContainer},re.createElement(WH,{className:K9.quickReactionIcon,onClick:s}))};var J9={reactionPickerContainer:"kh",reactionButton:"v"};var X9=({message:e,onSelectReaction:t})=>{let{config:o}=mi(),r=n=>{uu({reactionName:n,message:e});};return o?re.createElement("div",{className:J9.reactionPickerContainer},o.map(n=>{var i;return re.createElement("img",{"data-active":(i=e.myReactions)==null?void 0:i.includes(n.name),key:n.name,src:n.image,alt:n.name,className:J9.reactionButton,onClick:()=>{r(n.name),t&&t(n.name);}})})):null};var fu={reactionContainer:"jh",reactionPickerWrap:"zh",reactionButton:"Ch"};var JH=({pageId:e="*",componentId:t="*",message:o,containerRef:r})=>{let [n,i]=useState(!1),[a,s]=useState(!1),[l,d]=useState(!1);re.useState();let g=useRef(null),f=useRef(a);useEffect(()=>{f.current=a;},[a]);let y=useCallback(()=>{if(!f.current)return;let I=setTimeout(()=>{f.current&&i(!0);},500);return ()=>clearTimeout(I)},[]),C=useRef(l);useEffect(()=>{C.current=l;},[l]);let h=useCallback(()=>{setTimeout(()=>{C.current||i(!1);},1e3);},[]),v=useCallback(I=>{g.current&&!g.current.contains(I.target)&&i(!1);},[]),b=()=>{if(!g.current||!(r!=null&&r.current))return "translate(-50%, 0px)";let I=r.current.getBoundingClientRect(),w=g.current.getBoundingClientRect();if(!I||!w)return "translate(-50%, 0px)";lS(Number(sS("--asc-spacing-s1").replace("rem","")));let S=w.right-I.right,A=I.left-w.left;return S>0?`translate(calc(-50% - ${S}px), 0px)`:A>0?`translate(calc(-50% + ${A}px), 0px)`:"translate(-50%, 0px)"},x=I=>{v(I);},P=()=>{s(!1),d(!1),i(!1);};return useEffect(()=>(document.addEventListener("mousedown",x),document.addEventListener("touchstart",v),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("touchstart",v);}),[]),useEffect(()=>{a?!n&&y():n&&h();},[a,n]),re.createElement("div",{className:fu.reactionContainer},n&&re.createElement("div",{className:fu.reactionPickerWrap,style:{transform:b()},ref:g,onMouseEnter:()=>d(!0),onMouseLeave:()=>{d(!1);}},re.createElement(X9,{message:o,onSelectReaction:P})),re.createElement("div",{className:fu.reactionButton,onMouseEnter:()=>{s(!0);},onMouseLeave:()=>{s(!1);}},re.createElement(gu,{message:o,onSelectReaction:P,pageId:e,componentId:t})))};var Rm={reactionPreviewContainer:"jr",reactionIconContainer:"n",reactionIcon:"Sh",reactionCount:"Bh",fallbackIcon:"Xh"};var tf=({message:e,onClick:t})=>{let{config:o}=mi(),r=e.reactions?useMemo(()=>Object.entries(e.reactions).sort((n,i)=>i[1]-n[1]).filter(n=>n[1]>0).slice(0,3).sort((n,i)=>n[1]-i[1]),[e==null?void 0:e.reactions]):[];return e!=null&&e.reactionsCount?re.createElement("div",{className:Rm.reactionPreviewContainer,"data-myreaction":(e==null?void 0:e.myReactions)&&!!(e!=null&&e.myReactions.length),onClick:t},re.createElement("div",{className:Rm.reactionIconContainer},r.map(n=>{let i=o.find(a=>a.name===n[0]);return re.createElement(re.Fragment,null,i?re.createElement("img",{className:Rm.reactionIcon,src:i.image,alt:i.name}):re.createElement(xm,{className:Rm.fallbackIcon,backgroundColor:getComputedStyle(document.documentElement).getPropertyValue("--asc-color-base-shade3")}))})),re.createElement("div",{className:Rm.reactionCount},vm(e.reactionsCount))):null};var Fn={messageItemContainer:"Ih",messageItemContainerInner:"zr",messageBubbleWrap:"Mh",messageReaction:"Yh",messageDeletedBubble:"Ah",messageOptionsWrap:"Eh",binIcon:"Fh",optionIcon:"Rh",flagIcon:"Uh",timestamp:"Dh",reactionListSheet:"Hh",reactionListContainer:"Lh",reactionListBackdrop:"Th"};var Q3e=({pageId:e="*",componentId:t="*",elementId:o="*",message:r,avatarUrl:n,userDisplayName:i,containerRef:a,action:s})=>{let l=X(),d=r.creatorId===l.currentUserId,{isModerator:p}=Xm(r.channelId),[u,g]=useState(void 0);return re.createElement(re.Fragment,null,re.createElement(VH,{avatarUrl:n,displayName:i},re.createElement("div",{className:Fn.messageItemContainerInner,"data-reactions":!!r.reactionsCount},r.isDeleted?re.createElement("div",{className:Fn.messageDeletedBubble},re.createElement(mu,{className:Fn.binIcon}),re.createElement("div",null,re.createElement(T.Body,null,"This message was deleted"))):re.createElement("div",{className:Fn.messageBubbleWrap},re.createElement(QH,{message:r}),re.createElement("div",{className:Fn.messageReaction},re.createElement(tf,{message:r,onClick:()=>g(r)})),s&&re.createElement($H,{containerRef:a,isOwner:d,isModerator:p,action:s,isFlagged:r.flagCount>0}),re.createElement(JH,{message:r,containerRef:a,pageId:e,componentId:t}),r.flagCount>0&&re.createElement(cu,{className:Fn.flagIcon}),re.createElement("div",{className:Fn.timestamp},on(r.createdAt).format("HH:mm A"))))),u&&re.createElement(n1,{isOpen:!0,onClose:()=>g(void 0),className:Fn.reactionListSheet},re.createElement(n1.Container,{className:Fn.reactionListContainer},re.createElement(n1.Header,null),re.createElement(n1.Content,null,re.createElement(bm,{pageId:e,referenceId:u.messageId,referenceType:"message"}))),re.createElement(n1.Backdrop,{className:Fn.reactionListBackdrop})))},hu=Q3e;var of=({pageId:e="*",componentId:t="*",message:o,containerRef:r,action:n})=>{let i="sender_message_bubble",a=oe(o.creatorId),s=se({fileId:a==null?void 0:a.avatarFileId,imageSize:"small"});return re.createElement(hu,{message:o,userDisplayName:a==null?void 0:a.displayName,avatarUrl:s,containerRef:r,action:n,pageId:e,componentId:t,elementId:i})};var rf=({pageId:e="*",componentId:t="*",message:o,containerRef:r,action:n})=>{let i="receiver_message_bubble",{user:a}=No(o.creatorId),s=it({fileId:a==null?void 0:a.avatarFileId,imageSize:"small"});return re.createElement(hu,{pageId:e,componentId:t,elementId:i,message:o,userDisplayName:a==null?void 0:a.displayName,avatarUrl:s,containerRef:r,action:n})};var nf=(r,n)=>_(void 0,[r,n],function*(e,{onSuccess:t,onError:o}){try{yield MessageRepository.deleteMessage(e),t&&t();}catch(i){o&&o(i);}});var af=(e,t,o)=>_(void 0,null,function*(){try{yield MessageRepository.flagMessage(e),t&&t();}catch(r){o&&o(r);}});var XH=(e,t,o)=>_(void 0,null,function*(){try{yield MessageRepository.unflagMessage(e),t&&t();}catch(r){o&&o(r);}});var sf={icon:"Vh"};var mf=createContext({liveChatNotifications:[],liveChatNotificationFunction:{success:()=>{},error:()=>{},show:()=>{}}}),t5e=3e3,RH=({children:e})=>{let[t,o]=useState([]),r=i=>o&&o(a=>a.filter(s=>s.id!==i)),n=i=>{let a=Date.now();o(s=>[...s,c({id:a},i)]),setTimeout(()=>{r(a);},(i==null?void 0:i.duration)||t5e);};return re.createElement(mf.Provider,{value:{liveChatNotifications:t,liveChatNotificationFunction:{success:i=>n(E(c({},i),{icon:re.createElement(t0,{className:sf.icon})})),error:i=>n(E(c({},i),{icon:re.createElement($1,{className:sf.icon})})),show:i=>n(i)}}},e)},eF=()=>{let{liveChatNotifications:e}=useContext(mf);return e},e2=()=>{let{liveChatNotificationFunction:e}=useContext(mf);return e};var tF=()=>{let e=e2(),{formatMessage:t}=useIntl();return r=>_(void 0,null,function*(){yield navigator.clipboard.writeText(r),e.success({content:t({id:"livechat.notification.copy.message"})});})};var L1={infiniteScrollContainer:"qh",loadingIndicatorWrap:"Gh",loadingIndicator:"Jh",infiniteScrollInner:"Kh",customStatusContainer:"Nh",iconContainer:"Oh"};var Cu=({pageId:e="*",channel:t,replyMessage:o})=>{let r="message_list",n=X(),i=useRef(null),[a,s]=useState(void 0),{confirm:l}=Ye(),d=e2(),p=tF(),{themeStyles:u}=R({pageId:e,componentId:r}),{messages:g,hasMore:f,loadMore:y,isLoading:C,error:h}=pd({subChannelId:t.channelId,sortBy:"segmentDesc",limit:10,includeDeleted:!0}),v=g,b=x=>{l({title:"Delete this message?",content:"This message will also be removed from your friend\u2019s devices.",cancelText:"Cancel",okText:"Delete",onOk:()=>nf(x,{onError:()=>d.error({content:"Unable to delete message. Please try again."})})});};return useEffect(()=>{let x=()=>{i.current&&s(i.current.clientHeight);},P=new ResizeObserver(x);return i.current&&P.observe(i.current),()=>{i.current&&P.unobserve(i.current);}},[]),h?re.createElement("div",{className:L1.customStatusContainer,ref:i,style:u},re.createElement("div",{className:L1.iconContainer},re.createElement(q3,null)),re.createElement(T.Caption,null,"Couldn't load chat")):re.createElement("div",{className:L1.infiniteScrollContainer,ref:i,style:u},i.current&&re.createElement(RJ,{className:L1.infiniteScrollInner,scrollableTarget:i.current,scrollThreshold:.7,hasMore:f,next:y,loader:C?re.createElement("div",{className:L1.loadingIndicatorWrap},re.createElement(NH,{className:L1.loadingIndicator})):null,inverse:!0,dataLength:v.length,height:i.current.clientHeight},v.map((x,P)=>x.creatorId===n.currentUserId?re.createElement(of,{message:x,action:t.isMuted?void 0:{onReply:()=>o(x),onDelete:()=>b(x.messageId),onCopy:()=>{var I,w;return ((I=x.data)==null?void 0:I.text)&&p((w=x.data)==null?void 0:w.text)}},key:x.messageId,containerRef:i,pageId:e,componentId:r}):re.createElement(rf,{message:x,action:{onReply:()=>o(x),onDelete:()=>b(x.messageId),onCopy:()=>{var I,w;return ((I=x.data)==null?void 0:I.text)&&p((w=x.data)==null?void 0:w.text)},onFlag:()=>af(x.messageId,()=>d.success({content:"Message reported"}),()=>d.error({content:"This message failed to be reported. Please try again."})),onUnflag:()=>XH(x.messageId,()=>d.success({content:"Message unreported"}),()=>d.error({content:"This message failed to be unreported. Please try again."}))},key:x.messageId,containerRef:i,pageId:e,componentId:r}))))};var l5e=e=>re.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"},e),re.createElement("path",{d:"M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2V448c0 17.7 14.3 32 32 32s32-14.3 32-32V141.2L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"})),rF=l5e;var cf={homeIndicatorContainer:"Ph",homeIndicator:"Qh"};var vu=()=>re.createElement("div",{className:cf.homeIndicatorContainer},re.createElement("div",{className:cf.homeIndicator}));var no={sendButton:"Wh",reactionButton:"Zh",sendButtonContainer:"_h",composeBarContainer:"eu",optionContainer:"ru",composeBar:"au",composeBarLoading:"ou",mentionText:"tu",editorPlaceholder:"iu",editorContainer:"Cr",editorRoot:"lu",editorParagraph:"cu",editorContainer__mentionTextInput_item:"Sr",editorLink:"Br",userMentionItem__item:"C",allMentionItem__item:"S",userMentionItem__avatar:"su",allMentionItem__atSign:"nu",userMentionItem__displayName:"du",allMentionItem__displayName:"mu"};var xu=({channelId:e,memberships:t,search:o,limit:r=20,shouldCall:n=!0})=>{let s=nt({fetcher:ChannelRepository.Membership.searchMembers,params:{channelId:e,search:o||"",memberships:t,limit:r},shouldCall:!!e&&n}),{items:i}=s,a=M(s,["items"]);return c({channelMembers:i},a)};var aF=`\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'"~=<>_:;`,v5e="\\b[A-Z][^\\s"+aF+"]",x5e={NAME:v5e,PUNCTUATION:aF},sF=x5e.PUNCTUATION,pf=["@"].join(""),lF="[^"+pf+sF+"\\s]",b5e="(?:\\.[ |$]| |["+sF+"]|)",I5e=75,w5e=new RegExp("(^|\\s|\\()(["+pf+"]((?:"+lF+b5e+"){0,"+I5e+"}))$"),M5e=50,P5e=new RegExp("(^|\\s|\\()(["+pf+"]((?:"+lF+"){0,"+M5e+"}))$");function _5e(e,t){let o=w5e.exec(e);if(o===null&&(o=P5e.exec(e)),o!==null){let r=o[1],n=o[3];if(n.length>=t)return {leadOffset:o.index+r.length,matchingString:n,replaceableString:o[2]}}return null}function S5e(e){return _5e(e,0)}var df=class extends MenuOption{constructor({data:t,dataId:o}){super(o),this.data=t;}};function mF({suggestions:e,getSuggestionId:t,onQueryChange:o,$createNode:r,menuRenderFn:n,commandPriority:i}){let[a]=useLexicalComposerContext(),s=useMemo(()=>e.map(p=>new df({data:p,dataId:t(p)})),[e]),l=useCallback((p,u,g)=>{a.update(()=>{let f=r(p.data,p.key),y=$createTextNode(" ");u&&($insertNodes([y]),y.insertBefore(u),u.replace(f)),y.select(),g();});},[a]),d=useCallback(p=>S5e(p),[a]);return re.createElement(LexicalTypeaheadMenuPlugin,{onQueryChange:o,onSelectOption:l,triggerFn:d,options:s,menuRenderFn:n,commandPriority:i})}function cF(e){return e.type==="text"}function T5e(e){return e.type==="mention"}function k5e(e){return e.type==="autolink"}function dF(e){let t=[],o=e.getEditorState().toJSON().root.children,r=[],n=!1,i=[],a=0;o.forEach(l=>{let d=l.children,p=[];d.forEach(u=>{cF(u)&&(p.push(u.text),a+=u.text.length),k5e(u)&&u.children.forEach(g=>{cF(g)&&(p.push(g.text),a+=g.text.length);}),T5e(u)&&(u.data.userId==="all"?(r.push({index:a,length:u.text.length,type:"channel"}),n=!0):(r.push({index:a,length:u.text.length,type:"user",userId:u.data.userId}),i.push(u.data.userId)),p.push(u.text),a+=u.text.length);}),a+=1,t.push(p.join(""));});let s=[];return i.length>0&&s.push({type:"user",userIds:i}),n&&s.push({type:"channel"}),{mentioned:r,text:t.join(`
|
|
5293
|
+
`),mentionees:s}}var N5e={ltr:"ltr",rtl:"rtl"},pF=({namespace:e,theme:t,nodes:o,editorState:r})=>({namespace:e,editable:!0,theme:c(c({},N5e),t),onError(n){throw n},nodes:o,editorState:r});var uF={mention:"pu"};function L5e({domNode:e,data:t}){let o=e.textContent;return o!==null?{node:bu({text:o,data:t})}:null}var Id=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=bu({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 E(c({},super.exportJSON()),{data:this.__data,type:"mention",version:1})}createDOM(t){let o=super.createDOM(t);return o.className=uF.mention,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 L5e({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 bu({text:e,data:t}){return new Id({data:t,text:e}).setMode("segmented").toggleDirectionless()}var gF=()=>re.createElement(LinkPlugin,{validateUrl:mS});var O5e=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,z5e=[e=>{let t=O5e.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}`}}],fF=()=>re.createElement(AutoLinkPlugin,{matchers:z5e});var Q5e=e=>{var o,r;let t=(()=>{switch(screen.orientation.type){case"landscape-primary":case"landscape-secondary":return .5;case"portrait-secondary":case"portrait-primary":return .75;default:return .5}})();return e.visualViewport?((o=e.visualViewport)==null?void 0:o.height)*((r=e.visualViewport)==null?void 0:r.scale)/e.screen.height<t:!1},yF=({commandPriority:e,onEnter:t})=>{let[o]=useLexicalComposerContext();return useEffect(()=>{o.registerCommand(KEY_ENTER_COMMAND,r=>{let n=$getSelection();if(!$isRangeSelection(n)||Q5e(window))return !1;let i=r;return i.preventDefault(),i.shiftKey?o.dispatchCommand(INSERT_PARAGRAPH_COMMAND,void 0):(t(),!0)},e);},[o,t]),null};var cue=200,due=e=>{let[t,o]=useState(null),{isModerator:r}=Xm(e||void 0),{channelMembers:n}=xu({search:t,channelId:e,memberships:["member"],limit:20}),i=s=>{o(s);};return {suggestions:useMemo(()=>{let s=n.map(({user:l,userId:d})=>({userId:(l==null?void 0:l.userId)||d,displayName:l==null?void 0:l.displayName}));return r&&(t===""||/^al*l*$/i.test(t||""))?[{userId:"all",displayName:"All"},...s]:s},[r,n]),queryString:t,onQueryChange:i}};function pue({option:e,isSelected:t,onClick:o,onMouseEnter:r}){return re.createElement("li",{key:e.key,tabIndex:-1,"data-is-selected":t,className:no.userMentionItem__item,ref:e.setRefElement,role:"option","aria-selected":t,onMouseEnter:r,onClick:o},re.createElement("div",null,re.createElement(uo,{className:no.userMentionItem__avatar,userId:e.data.userId})),re.createElement("p",{className:no.userMentionItem__displayName},e.data.displayName))}function uue({option:e,isSelected:t,onClick:o,onMouseEnter:r}){return re.createElement("li",{key:e.key,tabIndex:-1,"data-is-selected":t,className:no.allMentionItem__item,ref:e.setRefElement,role:"option","aria-selected":t,onMouseEnter:r,onClick:o},re.createElement("div",{className:no.allMentionItem__atSign},"@"),re.createElement("p",{className:no.allMentionItem__displayName},e.data.displayName))}var gue=[AutoLinkNode,LinkNode,Id],Iu=({pageId:e="*",channel:t,composeAction:{replyMessage:o,mentionMessage:r,clearReplyMessage:n,clearMention:i}})=>{var P;let a="message_composer",s=useRef(null),l=useRef(null),{themeStyles:d,uiReference:p,config:u,accessibilityId:g}=R({pageId:e,componentId:a}),{confirm:f}=Ye(),y=e2(),{onQueryChange:C,suggestions:h}=due(t.channelId),{mutateAsync:v}=useMutation({mutationFn:I=>MessageRepository.createMessage(I),onSuccess:()=>{var I;(I=l.current)==null||I.update(()=>{$getRoot().clear();}),n&&n();},onError:I=>{let w=I.message,k="Your message wasn't sent. Please try again.";w==="Amity SDK (400308): Text contain blocked word"?k="Your message wasn't sent as it contains a blocked word.":w==="Amity SDK (400309): Data contain link that is not in whitelist"?k="Your message wasn\u2019t sent as it contained a link that\u2019s not allowed.":w==="Amity SDK (400302): User is muted"&&(k="User is muted"),y.error({content:k});}}),b=()=>{if(!t||!l.current)return;let{mentioned:I,mentionees:w,text:k}=dF(l.current);if((k==null?void 0:k.trim().length)!==0){if(k.trim().length>((u==null?void 0:u.message_limit)||cue)){f({title:"Unable to send message",content:"Your message is too long. Please shorten your message and try again.",okText:"Ok"});return}v({tags:[],subChannelId:t.channelId,data:{text:k.trim()},dataType:"text",mentionees:w,metadata:{mentioned:I},parentId:(o==null?void 0:o.messageId)||void 0});}},x=pF({namespace:p,theme:{root:no.editorRoot,placeholder:no.editorPlaceholder,paragraph:no.editorParagraph,link:no.editorLink},nodes:gue});return re.createElement("div",{className:no.composeBarContainer,"data-qa-anchor":g,style:d},re.createElement("div",{className:no.composeBar},re.createElement("div",{ref:s,className:no.optionContainer}),re.createElement("div",{className:no.editorContainer},re.createElement(LexicalComposer,{initialConfig:x},re.createElement(RichTextPlugin,{contentEditable:re.createElement(ContentEditable,null),placeholder:(P=re.createElement("span",{className:no.editorPlaceholder},u.placeholder_text))!=null?P:null,ErrorBoundary:aue}),re.createElement(HistoryPlugin,null),re.createElement(AutoFocusPlugin,null),re.createElement(gF,null),re.createElement(fF,null),re.createElement(EditorRefPlugin,{editorRef:l}),re.createElement(yF,{onEnter:b,commandPriority:COMMAND_PRIORITY_LOW}),re.createElement(mF,{suggestions:h,getSuggestionId:I=>I.userId,onQueryChange:C,$createNode:I=>bu({text:`@${I.displayName||""}`,data:I}),menuRenderFn:(I,{options:w,selectedIndex:k,setHighlightedIndex:S,selectOptionAndCleanUp:A})=>!s.current||w.length===0?null:aie.createPortal(re.createElement(re.Fragment,null,w.map((D,z)=>D.data.userId==="all"?re.createElement(uue,{isSelected:k===z,onClick:()=>{S(z),A(D);},onMouseEnter:()=>{S(z);},key:D.key,option:D}):re.createElement(pue,{isSelected:k===z,onClick:()=>{S(z),A(D);},onMouseEnter:()=>{S(z);},key:D.key,option:D}))),s.current),commandPriority:COMMAND_PRIORITY_HIGH}))),re.createElement("div",{className:no.sendButtonContainer},re.createElement(rF,{className:no.sendButton,onClick:()=>b()}))),re.createElement(vu,null))};var CF=({channelId:e})=>{let r=Qo({fetcher:ChannelRepository.getChannel,params:e,shouldCall:!!e}),{item:t}=r,o=M(r,["item"]);return c({channel:t},o)};var ht={composeBarContainer:"gu",composeBar:"fu",textInputContainer:"hu",composeBarLoading:"uu",replyPlaceholderContainer:"bu",replyAvatar:"vu",replyProfile:"xu",replyProfileName:"wu",replyProfileMessage:"yu",replyDismiss:"ku",notificationPosition:"ju",messageListPlaceholder:"zu",mutedChannelContainer:"Cu",mutedIcon:"Su",commentAltIcon:"Bu",banStatePanel:"Xu"};var hue=({children:e})=>re.createElement(re.Fragment,null,re.createElement("div",{className:ht.messageListPlaceholder},e),re.createElement("div",{className:ht.composeBarContainer},re.createElement("div",{className:ht.composeBar},re.createElement("div",{className:ht.textInputContainer},re.createElement("div",{className:ht.composeBarLoading},re.createElement(V5,{width:20,height:20}),re.createElement("span",null,re.createElement(T.Body,null,"Loading chat..."))))),re.createElement(vu,null))),wu=hue;var vF=({replyMessage:e,onDismiss:t})=>{var r,n;let o=oe(e.creatorId);return o?re.createElement("div",{className:ht.replyPlaceholderContainer},re.createElement("div",{className:ht.replyAvatar},re.createElement(xt,{avatarUrl:(r=o.avatar)==null?void 0:r.fileUrl,defaultImage:re.createElement(Xa,null)})),re.createElement("div",{className:ht.replyProfile},re.createElement("div",{className:ht.replyProfileName},`Replying to ${o.displayName}`),re.createElement("div",{className:ht.replyProfileMessage},(n=e.data)==null?void 0:n.text)),re.createElement("div",{className:ht.replyDismiss},re.createElement(V1,{onClick:t,width:"20",height:"20"}))):null};var vue=({children:e})=>re.createElement("div",{className:ht.messageListPlaceholder},e),xF=vue;var uf={notifications:"Iu",notificationContainer:"Mu",appear:"Xr"};var bF=({className:e,content:t,icon:o})=>re.createElement("div",{className:yi(uf.notificationContainer,e)},o,re.createElement(T.Body,null,t)),gf=()=>{let e=eF();return re.createElement("div",{className:uf.notifications},e.map(t=>re.createElement(bF,E(c({},t),{key:t.id}))))};var Iue=e=>re.createElement("svg",c({width:"23",height:"21",viewBox:"0 0 23 21",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M21.7988 17.7605C22.0449 17.9363 22.1152 18.2878 21.9043 18.5339L21.5527 18.9558C21.3418 19.2019 20.9902 19.2722 20.7793 19.0613L-0.244141 2.60815C-0.490234 2.43237 -0.560547 2.08081 -0.349609 1.83472L0.00195312 1.37769C0.212891 1.16675 0.564453 1.09644 0.810547 1.30737L21.7988 17.7605ZM12.5527 7.49487C13.3262 7.91675 13.8887 8.69019 14.0645 9.53394L11.5684 7.60034C11.8496 7.35425 12.2363 7.31909 12.5527 7.49487ZM13.6074 6.15894C13.2207 5.91284 13.1152 5.3855 13.3613 4.99878C13.6074 4.61206 14.1348 4.47144 14.5215 4.71753C16.3848 5.91284 17.5449 7.9519 17.5449 10.1667C17.5449 10.8347 17.4395 11.4324 17.2637 12.03L15.7871 10.8699C15.8223 10.6589 15.8574 10.4128 15.8574 10.1667C15.8574 8.54956 15.0137 7.03784 13.6074 6.15894ZM15.4707 3.31128C15.084 3.06519 14.9785 2.53784 15.2246 2.11597C15.5059 1.72925 16.0332 1.62378 16.4199 1.86987C19.2324 3.73315 20.9199 6.8269 20.9199 10.1667C20.9199 11.6082 20.6035 12.9441 20.041 14.2097L18.6699 13.1199C19.0215 12.2058 19.1973 11.2214 19.1973 10.1667C19.1973 7.42456 17.8262 4.823 15.4707 3.31128ZM9.66992 4.29565V6.08862L7.49023 4.40112L8.22852 3.698C8.36914 3.52222 8.58008 3.41675 8.79102 3.41675C9.24805 3.41675 9.66992 3.76831 9.66992 4.29565ZM7.98242 14.0691V11.1863L9.66992 12.5222V16.073C9.66992 16.6003 9.24805 16.9167 8.79102 16.9167C8.58008 16.9167 8.36914 16.8464 8.22852 16.6707L5.09961 13.5417H1.51367C1.02148 13.5417 0.669922 13.1902 0.669922 12.698V7.6355C0.669922 7.17847 1.02148 6.79175 1.51367 6.79175H2.35742L4.50195 8.47925H2.35742V11.8542H5.76758L7.98242 14.0691Z"})),ff=Iue;var wF={inputTextContainer:"Yu",invalid:"Au",disabled:"Eu",baseInputStyle:"Fu",mentionContainer:"Ru","live-chat-mention-input":"Ir","live-chat-mention-input__suggestions__list":"Uu",mentions_mention:"Du",mentions__highlighter:"Hu"};var Mue=e=>re.createElement("svg",c({width:"49",height:"49",viewBox:"0 0 49 49",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("path",{d:"M37.96 7C40.4209 7 42.46 9.03906 42.46 11.5V31.75C42.46 34.2812 40.4209 36.25 37.96 36.25H27.835L19.0459 42.8594C18.835 43 18.6943 43 18.5537 43C18.0615 43 17.71 42.7188 17.71 42.1562V36.25H10.96C8.42871 36.25 6.45996 34.2812 6.45996 31.75V11.5C6.45996 9.03906 8.42871 7 10.96 7H37.96ZM40.21 31.75V11.5C40.21 10.3047 39.1553 9.25 37.96 9.25H10.96C9.69434 9.25 8.70996 10.3047 8.70996 11.5V31.75C8.70996 33.0156 9.69434 34 10.96 34H19.96V39.3438L26.4287 34.4922L27.0615 34H37.96C39.1553 34 40.21 33.0156 40.21 31.75ZM24.46 25.5625C25.374 25.5625 26.1475 26.3359 26.1475 27.25C26.1475 28.2344 25.374 28.9375 24.46 28.9375C23.4756 28.9375 22.7725 28.2344 22.7725 27.25C22.7725 26.3359 23.4756 25.5625 24.46 25.5625ZM23.8271 23.875C23.5459 23.875 23.2646 23.6641 23.2646 23.3828L22.7725 15.5078C22.7725 15.1562 22.9834 14.875 23.335 14.875H25.5146C25.8662 14.875 26.0771 15.1562 26.0771 15.5078L25.585 23.3828C25.585 23.6641 25.3037 23.875 25.0225 23.875H23.8271Z"})),PF=Mue;var _ue=({pageId:e="*",channel:t})=>{var C;let o=su(),{isModerator:r}=Xm(t.channelId),n=X().currentUserId,{channelMembers:i}=xu({channelId:t.channelId,memberships:["member","banned","muted"]}),a=i.find(h=>h.userId===n),[s,l]=useState(void 0),[d,p]=useState(void 0),[u,g]=useState(0),f=useRef(null),y=useRef(null);return useEffect(()=>{var h,v;(h=y.current)!=null&&h.clientHeight&&((v=y.current)==null?void 0:v.clientHeight)>0&&g(y.current.clientHeight-30);},[(C=y.current)==null?void 0:C.clientHeight]),o?a!=null&&a.isBanned?re.createElement(xF,null,re.createElement("div",{className:ht.banStatePanel},re.createElement(PF,{className:ht.commentAltIcon}),re.createElement(T.Heading,null,"You are banned from chat"),re.createElement(T.Body,null,"You won\u2019t be able to participate in this chat until you\u2019ve been unbanned."))):re.createElement(re.Fragment,null,re.createElement(Cu,{channel:t,replyMessage:l,pageId:e}),o&&re.createElement(re.Fragment,null,re.createElement("div",{ref:f,className:wF.mentionContainer}),!r&&t.isMuted?re.createElement("div",{className:ht.mutedChannelContainer},re.createElement(ff,{width:20,height:20,className:ht.mutedIcon}),re.createElement(T.Body,null,"This channel has been set to read-only by the channel moderator")):a!=null&&a.isMuted?re.createElement("div",{className:ht.mutedChannelContainer},re.createElement(ff,{width:20,height:20,className:ht.mutedIcon}),re.createElement(T.Body,null,"You\u2019ve been muted by the channel moderator")):null,s&&re.createElement(vF,{replyMessage:s,onDismiss:()=>l(void 0)}),re.createElement("div",{className:ht.notificationPosition,style:{bottom:u}},re.createElement(gf,null)),re.createElement("div",{ref:y},re.createElement(Iu,{pageId:e,disabled:!r&&t.isMuted||(a==null?void 0:a.isMuted),channel:t,suggestionRef:f,composeAction:{replyMessage:s,mentionMessage:d,clearReplyMessage:()=>l(void 0),clearMention:()=>p(void 0)}})))):re.createElement(wu,null)},SF=_ue;var Sue=({pageId:e="*",channel:t})=>t?re.createElement(SF,{channel:t,pageId:e}):re.createElement(wu,null),kF=Sue;var hf={messageListHeaderWrap:"Lu",liveChat:"Tu"};var NF=({channelId:e})=>{let{channel:t}=CF({channelId:e}),o="live_chat",{themeStyles:r}=Xe({pageId:o}),n=useRef(null);return re.createElement(RH,null,re.createElement("div",{className:hf.liveChat,ref:n,style:r},re.createElement("div",{className:hf.messageListHeaderWrap},re.createElement(lu,{channel:t,pageId:o})),re.createElement(kF,{channel:t,pageId:o})))};var xe={storyPreview_title:"Vu",contentWrapper:"qu",storyPreviewWrapper:"Gu",storyPreview_description:"Ju",storyPreviewContainer:"Ku",headerContainer:"Nu",progressBar:"Mr",progressFill:"Ou",userInfo:"Pu",storyPreviewTitle:"Yr",nameContainer:"Qu",hyperLinkContainer:"Wu",mediaContainer:"Ar",media:"Zu",avatarContainer:"Er",imageFit:"_u",imageCover:"eb",headerContent:"rb",userInfoContent:"ab",shadowOverlay:"ob",pulse:"Fr",skeleton:"d",textSkeleton:"tb",nameSkeleton:"ib",timeSkeleton:"lb"};var Eue=e=>re.createElement("svg",c({width:"100%",height:"100%",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),re.createElement("rect",{width:"40",height:"40",rx:"20",fill:"#D9E5FC"}),re.createElement("path",{d:"M19.8462 12C20.7625 12 21.6413 12.356 22.2893 12.9898C22.9373 13.6235 23.3013 14.4831 23.3013 15.3793C23.3013 16.2756 22.9373 17.1351 22.2893 17.7688C21.6413 18.4026 20.7625 18.7586 19.8462 18.7586C18.9298 18.7586 18.051 18.4026 17.403 17.7688C16.755 17.1351 16.391 16.2756 16.391 15.3793C16.391 14.4831 16.755 13.6235 17.403 12.9898C18.051 12.356 18.9298 12 19.8462 12ZM12.9359 14.4138C13.4887 14.4138 14.0021 14.5586 14.4463 14.8193C14.2982 16.2 14.7128 17.571 15.5618 18.6428C15.0682 19.5697 14.081 20.2069 12.9359 20.2069C12.1504 20.2069 11.3972 19.9017 10.8418 19.3585C10.2864 18.8153 9.97436 18.0786 9.97436 17.3103C9.97436 16.5421 10.2864 15.8054 10.8418 15.2622C11.3972 14.719 12.1504 14.4138 12.9359 14.4138ZM26.7564 14.4138C27.5419 14.4138 28.2951 14.719 28.8505 15.2622C29.4059 15.8054 29.7179 16.5421 29.7179 17.3103C29.7179 18.0786 29.4059 18.8153 28.8505 19.3585C28.2951 19.9017 27.5419 20.2069 26.7564 20.2069C25.6113 20.2069 24.6241 19.5697 24.1305 18.6428C24.9795 17.571 25.3941 16.2 25.246 14.8193C25.6903 14.5586 26.2036 14.4138 26.7564 14.4138ZM13.4295 24.3103C13.4295 22.3117 16.3022 20.6897 19.8462 20.6897C23.3901 20.6897 26.2628 22.3117 26.2628 24.3103V26H13.4295V24.3103ZM8 26V24.5517C8 23.2097 9.86577 22.08 12.3929 21.7517C11.8105 22.4083 11.4551 23.3159 11.4551 24.3103V26H8ZM31.6923 26H28.2372V24.3103C28.2372 23.3159 27.8818 22.4083 27.2994 21.7517C29.8265 22.08 31.6923 23.2097 31.6923 24.5517V26Z",fill:"white"})),Pu=Eue;var EF=({width:e="100%",height:t="100%"})=>re.createElement("div",{className:xe.storyPreviewWrapper,style:{width:e,height:t}},re.createElement("div",{className:xe.storyPreviewContainer},re.createElement("div",{className:xe.shadowOverlay}),re.createElement("div",{className:xe.headerContainer},re.createElement("div",{className:xe.headerContent},re.createElement("div",{className:xe.userInfo},re.createElement("div",{className:xe.userInfoContent},re.createElement("div",{className:yi(xe.avatarContainer,xe.skeleton)}),re.createElement("div",{className:xe.textSkeleton},re.createElement("div",{className:yi(xe.nameSkeleton,xe.skeleton)}),re.createElement("div",{className:yi(xe.timeSkeleton,xe.skeleton)})))))),re.createElement("div",{className:xe.contentWrapper},re.createElement("div",{className:yi(xe.mediaContainer,xe.skeleton)}))));var AF=({mediaType:e,hyperLink:t,width:o="100%",height:r="100%",onPlay:n,onPause:i,avatar:a,title:s,duration:l=5e3,isOfficial:d=!0,imageMode:p})=>{var N,O,K,Z;let[u,g]=useState(!0),[f,y]=useState(0),[C,h]=useState([]),v=useRef(null),b=useRef(null),[x,P]=useState(!0),[I,w]=useState(!1),k,S=()=>{g(!0),n&&n();},A=()=>{g(!1),i&&i();},D=()=>{(e==null?void 0:e.type)==="video"&&v.current?(v.current.currentTime=0,v.current.play()):(e==null?void 0:e.type)==="image"&&g(!1);},z=()=>{(e==null?void 0:e.type)==="video"&&v.current&&(v.current.currentTime=0,v.current.play(),y(0));},V=()=>{u?(A(),(e==null?void 0:e.type)==="video"&&v.current&&v.current.pause()):(S(),(e==null?void 0:e.type)==="video"&&v.current&&v.current.play());};return useEffect(()=>{let G=H=>_(void 0,null,function*(){let U=new Image;U.crossOrigin="Anonymous",U.src=H,U.onload=()=>{let W=new Tce().getPalette(U,2);if(W){let B=W.map($=>`rgb(${$[0]}, ${$[1]}, ${$[2]})`);h(B),P(!1);}},U.onerror=()=>{console.error("Error loading image for color extraction"),h([]),P(!1);};});return e!=null&&e.url&&(e==null?void 0:e.type)==="image"?G(e.url):(h([]),P(!1)),()=>{h([]),P(!0);}},[e==null?void 0:e.url]),useEffect(()=>(u?k=setInterval(()=>{if((e==null?void 0:e.type)==="video"&&v.current){let G=v.current.currentTime,H=v.current.duration,U=G/H*100;y(U),U>=100&&(clearInterval(k),D());}else (e==null?void 0:e.type)==="image"&&I&&y(G=>G>=100?(clearInterval(k),D(),100):G+100/(l/100));},100):clearInterval(k),()=>{clearInterval(k);}),[u,e,l,I]),x?re.createElement(EF,null):re.createElement("div",{className:xe.storyPreviewWrapper,style:{width:o,height:r}},re.createElement("div",{className:xe.storyPreviewContainer},re.createElement("div",{className:xe.headerContainer},re.createElement("div",{className:xe.progressBar},re.createElement("div",{className:xe.progressFill,style:{width:`${f}%`}})),re.createElement("div",{className:xe.headerContent},re.createElement("div",{className:xe.userInfo},re.createElement("div",{className:xe.userInfoContent},re.createElement("div",{className:xe.avatarContainer},re.createElement(xt,{avatarUrl:a,defaultImage:re.createElement(Pu,null)})),re.createElement(T.BodyBold,{className:xe.storyPreviewTitle},re.createElement("span",{className:xe.nameContainer},s," ",d&&re.createElement(Ys,{fill:"white"})))),(e==null?void 0:e.type)==="video"&&re.createElement("div",{onClick:V},u?re.createElement(Is,{width:24,height:24}):re.createElement(Io,{width:24,height:24}))))),re.createElement("div",{className:xe.contentWrapper},re.createElement("div",{className:xe.mediaContainer,style:{background:`linear-gradient(
|
|
5294
5294
|
180deg,
|
|
5295
5295
|
${C[0]||"#000"} 0%,
|
|
5296
5296
|
${C[1]||"#000"} 100%
|