/** localStorage با try/catch؛ در حالتِ خصوصیِ مرورگر یا دسترسیِ مسدود throw نمی‌کند. */ export const store = { get(key: string): string | null { try { return localStorage.getItem(key); } catch { return null; } }, set(key: string, value: string) { try { localStorage.setItem(key, value); } catch { /* نادیده */ } }, remove(key: string) { try { localStorage.removeItem(key); } catch { /* نادیده */ } }, }; export const KEYS = { onboarded: 'tadrisino.onboarded', conversationId: 'tadrisino.conversationId', sound: 'tadrisino.sound', referralCode: 'tadrisino.referralCode', companion: 'tadrisino.companion', /** {gradeId: subjectKey}؛ کتابی که کاربر در هر پایه آخر انتخاب کرده. */ subjects: 'tadrisino.subjects', } as const;