Loading
function(e,t,n){"use strict";n.d(t,{A:()=>C});var i=n(17928),r=n(462887),s=n(228366),a=n(775602),o=n(677313),l=n(873298),u=n(284016),c=n(742023),d=n(617617),_=n(652215),h=n(185928),f=n(661531),p=n(353835),E=n(723702);function m(e){if(!__OVERLAY__&&E.isPlatformEmbedded)try{let t=f.A.colors.BACKGROUND_BASE_LOWEST.resolve({theme:e,saturation:a.A.saturation}).hex();p.A.setApplicationBackgroundColor(t)}catch{}}let g=0,A=h.qj,I=(0,o.A)(),T=A[I],S=null;function y(){if(!__OVERLAY__&&null!=S)return S;var e=I,t=A;if(__OVERLAY__)return _.NJ8.DARK;let n=h.dP;if(a.A.syncForcedColors&&"active"===a.A.systemForcedColors&&e!==h.Fc.NO_PREFERENCE)return e;if(c.Ay.useSystemTheme===h.Q_.ON&&e!==h.Fc.NO_PREFERENCE)return t[e];let i=u.A.getAppearanceSettings()?.theme;return null!=i?i:n[d.A.settings.appearance?.theme??l.Sx.UNSET]}function N(){let e=y();return e!==T&&(m(T=e),!0)}class v extends i.Ay.PersistedStore{static displayName="ThemeStore";static persistKey="ThemeStore";static migrations=[e=>{let t=e.theme;return"amoled"===t&&(t="midnight"),{...e,theme:t}},e=>e];initialize(e){e?.theme!=null&&(g=1,m(T=e.theme),null!=e.preferences&&(A=e.preferences),(0,r.M)(T)&&(A[h.Fc.DARK]=T)),this.waitFor(c.Ay,u.A,d.A,a.A)}getState(){return{theme:this.theme,preferences:A,status:g}}get theme(){return T}get systemTheme(){return I}themePreferenceForSystemTheme(e){return A[e]}}let C=new v(s.h,{CACHE_LOADED:N,CONNECTION_OPEN:function(){return 0===g&&(A={...A,[h.Fc.DARK]:_.NJ8.DARKER},g=1),N()},LOGOUT:function(e){return S=null,!e.isSwitchingAccount&&T!==_.NJ8.DARK&&(m(T=_.NJ8.DARK),N())},OVERLAY_INITIALIZE:N,SELECTIVELY_SYNCED_USER_SETTINGS_UPDATE:N,UNSYNCED_USER_SETTINGS_UPDATE:N,USER_SETTINGS_PROTO_UPDATE:N,RESET_PREVIEW_CLIENT_THEME:N,SYSTEM_THEME_CHANGE:function(e){let{systemTheme:t}=e;return I=t,N()},ACCESSIBILITY_DARK_SIDEBAR_TOGGLE:function(){return(0,r.q)(y())},UPDATE_THEME_PREFERENCES:function(e){return A={...A,...e.preferences},N()},SET_THEME_OVERRIDE:function(e){return S=e.theme,N()},CLEAR_THEME_OVERRIDE:function(){return S=null,N()},REFRESH_THEME:function(){return N()}})}