class StorageService {
    static instance;
    prefix = 'ap-chat-';
    static get Instance() {
        if (!StorageService.instance) StorageService.instance = new StorageService();
        return StorageService.instance;
    }
    getKey(key) {
        return `${this.prefix}${key}`;
    }
    get(key) {
        return localStorage.getItem(this.getKey(key));
    }
    set(key, value) {
        localStorage.setItem(this.getKey(key), value);
    }
    remove(key) {
        localStorage.removeItem(this.getKey(key));
    }
    clear() {
        Object.keys(StorageService).filter((key)=>key.startsWith(this.prefix)).forEach((key)=>localStorage.removeItem(key));
    }
}
export { StorageService };
