import{L as h,M as c,e as i,f as n}from"./chunk-DQXXLIFV.js";import{da as a,fd as l}from"./chunk-LU6Q5ONP.js";c();n();l();var u=(()=>{class s{get themeId(){return this._themeId}constructor(){this.DEFAULT_THEME_ID="trademark",this._localStorageThemeKey="theme",this._themeId=null,this.storageListener=e=>{if(e.key===this._localStorageThemeKey&&e.newValue)try{let t=JSON.parse(e.newValue);t&&t.themeId&&this.selectTheme(t.themeId,!1)}catch{}}}init(){this.registerMultitabThemeSelected()}destroy(){window.removeEventListener("storage",this.storageListener)}renew(){let e=this.readThemeId();i.isSet(e)&&this.selectTheme(e,!1)}selectTheme(e,t=!0){if(this._themeId===e)return;let o=h.fromId("paw-theme"),m="assets/theme-"+e+".css";o.attr("href",m);let r=new h(null,document.body);i.isSet(this.themeId)?r.removeClass(`theme-${this.themeId}`):r.removeClass("theme-trademark"),r.addClass(`theme-${e}`),this._themeId=e,t&&localStorage.setItem(this._localStorageThemeKey,JSON.stringify({themeId:this._themeId,time:Date.now()}))}resetTheme(){this.selectTheme(this.DEFAULT_THEME_ID,!1)}registerMultitabThemeSelected(){window.addEventListener("storage",this.storageListener)}readThemeId(){let e=localStorage.getItem(this._localStorageThemeKey);if(!e)return null;try{return JSON.parse(e).themeId}catch{}return e}static{this.\u0275fac=function(t){return new(t||s)}}static{this.\u0275prov=a({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();export{u as a};
