Build 600590stable
Module 956480
1,831 characters · in 8a95d4cf1a4a6317.jsDependencies
Source Raw
function(e,t,n){n.d(t,{A:()=>m}),n(321073);var i=n(582128),l=n(17928),a=n(765178),s=n(734057),r=n(287809),o=n(562153),c=n(996512),d=n(360729),u=n(610274),h=n(1195),p=n(375708);function m(e,t,n){let m=(0,l.bG)([s.A],()=>s.A.getChannel(e)?.guild_id),{posturesEnabled:f,interactionsEnabled:A}=d.A.useExperiment({guildId:m,location:"GuildRoomAnnouncer"},{autoTrackExposure:!1}),x=i.useRef(null);i.useEffect(()=>{let i=function(e,t,n){let i=new Map,l=new Map;for(let[e,n]of t)i.set(e,n.position),l.set(e,n.statusId);let a=new Map;for(let e of n)a.set(e.objectId,e.createdBy);return{channelId:e,positions:i,statusIds:l,noteAuthors:a}}(e,t,n),l=x.current;if(x.current=i,null==l||l.channelId!==e)return;function s(t){return(0,o.mG)(m,e,null!=t?r.default.getUser(t):null)}let d=[],g=[],C=[];for(let[e,n]of t){let t=l.positions.get(e);if(null==t&&d.push(p.intl.formatToPlainString(h.default["qMj+2W"],{userName:s(e)})),null==t||t.x!==n.position.x||t.y!==n.position.y){let t=(0,c.r)(n.position);null!=t&&g.push(p.intl.formatToPlainString(h.default.nPRAZX,{userName:s(e),seatLabel:t.getLabel()}))}if(null!=t&&f&&l.statusIds.get(e)!==n.statusId){let t=u.x.find(e=>e.id===n.statusId);C.push(null!=t?p.intl.formatToPlainString(h.default.gzrysL,{userName:s(e),postureLabel:p.intl.string(t.label)}):p.intl.formatToPlainString(h.default["vNuh/e"],{userName:s(e)}))}}let y=[];for(let[e]of l.positions)i.positions.has(e)||y.push(p.intl.formatToPlainString(h.default.u7LUkR,{userName:s(e)}));let j=[];if(A){for(let e of n)l.noteAuthors.has(e.objectId)||j.push(p.intl.formatToPlainString(h.default.zTbxKr,{userName:s(e.createdBy)}));for(let[e,t]of l.noteAuthors)i.noteAuthors.has(e)||j.push(p.intl.formatToPlainString(h.default.DO8iXB,{userName:s(t)}))}let I=[...d,...y,...g,...C,...j];0!==I.length&&a.O.announce(I.join(". "),"polite")},[t,n,e,m,f,A])}}