Build 533169stable
Module 967198
1,598 characters · in no known chunkDependencies
Required by (135)
54714509204392563932294335255814958217644606921772800814008205792960930559718797491105713123677134638139286151199160761174768181800187508198168198229205761214771218252223251223330244920248465249477250627256415256449260821264540270887272444274184285059288989291335292103309010315206320501322223323350328913329482331969346446347209352423353428357064380786382289394318400528407195412775416092430086448894470710475723483660485724487401498336515598519057534225551028557534569024571139574660574842581381584682585510598733613760645725649308649813650724663111668267676002681637686956704037708051708197733441739008742984745109748319757942761640766219767143775427793322795144826673828430832275846293849867885041885617910463916768933917950067952719954540969508972937976639979807986789986880987344992771
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{A:()=>R});var r=n(311907),i=n(73153),s=n(212455),a=n(463347),o=n(334465),l=n(976860),u=n(961350),c=n(650048),d=n(71393),_=n(652215);let f=-1,p=null,h=null,m={};function E(e){return e===_.ME?null:e??null}function g(){null!=p&&null==d.A.getGuild(p)&&null==s.A.getRequest(p)&&(p=null),null!=h&&null==d.A.getGuild(h)&&null==s.A.getRequest(h)&&(h=null),I(p)}function A(e){p=e.selectedGuildId,h=void 0,g()}function I(e){null!=e&&(m[e]=Date.now())}function T(e){let{guildId:t}=e;if(p===t)return!1;I(p),I(t),null!=t&&(h=t),p=t}function S(e){let t=!1;return delete m[e],h===e&&(h=null,t=!0),p===e&&(d.A.getGuildsArray().find(t=>t.id!==e),p=null,(0,l.bG)(_.BVt.ME),t=!0),t}function y(e){let{guild:{id:t,unavailable:n}}=e;return!0!==n&&S(t)}function v(e){let{guildId:t,user:n}=e;return n.id===u.default.getId()&&S(t)}function N(){p=null,h=null}class C extends r.Ay.PersistedStore{static displayName="SelectedGuildStore";static persistKey="SelectedGuildStore";initialize(e){this.mustEmitChanges(e=>"CONNECTION_OPEN"!==e.type),this.waitFor(u.default,c.A,d.A,s.A),m=e?.selectedGuildTimestampMillis??{},p=e?.selectedGuildId??null,h=e?.lastSelectedGuildId??null;let t=c.A.lastNonVoiceRoute,n=(0,o.B)(t,{path:_.BVt.CHANNEL(a.pv.guildId())});E(n?.params?.guildId)}getState(){return{selectedGuildTimestampMillis:m,selectedGuildId:p,lastSelectedGuildId:h}}getGuildId(){return p}getLastSelectedGuildId(){return h}getLastSelectedTimestamp(e){return p===e?f:m[e]}}let R=new C(i.h,{CONNECTION_OPEN:g,OVERLAY_INITIALIZE:A,CHANNEL_SELECT:T,GUILD_MEMBER_REMOVE:v,GUILD_DELETE:y,LOGOUT:N})}