const e=require(`../../functions/utils/serialize.utils.cjs`),t=require(`./BaseCacheDevice.cjs`);var n=class extends t.BaseCacheDevice{localDataStorage;constructor(e,t){super(),!e&&typeof localStorage<`u`&&(this.localDataStorage=localStorage),t&&this.mergeWithSerialized(t)}get(e){return this.localDataStorage?this.localDataStorage.getItem(e)??void 0:this.getInMemory(e)}set(e,t){this.localDataStorage?this.localDataStorage.setItem(e,t):this.setInMemory(e,t)}serialize(){let t=this.localDataStorage?Object.entries(localStorage):[...this.inMemoryCache];return Object.fromEntries(t.map(([t,n])=>[t,e.CustomJSONStringify(n)]))}};exports.LocalStorageCacheDevice=n;