Module 956480

1,833 characters · in a6b47c574000d0b5.js
Dependencies
Required by (1)
Lazily required by (0)none
Lazily requires (0)none
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(270103),p=n(375708);function m(e,t,n){let m=(0,l.bG)([s.A],()=>s.A.getChannel(e)?.guild_id),{posturesEnabled:A,interactionsEnabled:f}=(0,d.mf)({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[n,i]of t){let t=l.positions.get(n);if(null==t&&d.push(p.intl.formatToPlainString(h.default["qMj+2W"],{userName:s(n)})),null==t||t.x!==i.position.x||t.y!==i.position.y){let t=(0,c.r)(i.seat,i.position,e);null!=t&&g.push(p.intl.formatToPlainString(h.default.nPRAZX,{userName:s(n),seatLabel:t.getLabel()}))}if(null!=t&&A&&l.statusIds.get(n)!==i.statusId){let e=u.x.find(e=>e.id===i.statusId);C.push(null!=e?p.intl.formatToPlainString(h.default.gzrysL,{userName:s(n),postureLabel:p.intl.string(e.label)}):p.intl.formatToPlainString(h.default["vNuh/e"],{userName:s(n)}))}}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(f){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,A,f])}}