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C;AACF,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,gBAAgB,CAChD,SAAS,EACT,OAAO,CACN,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,gBAAgB,CAChD,SAAS,EACT,OAAO,CACN,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,gBAAgB,CAClD,WAAW,EACX,SAAS,CACR,CAAC;AACF,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,CACpD,aAAa,EACb,WAAW,CACV,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,gBAAgB,CAClD,WAAW,EACX,SAAS,CACR,CAAC;AACF,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,gBAAgB,CACnD,YAAY,EACZ,UAAU,CACT,CAAC;AACF,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,CACpD,aAAa,EACb,WAAW,CACV,CAAC","file":"daytool_storage.js","sourcesContent":["import { daytool_calendar } from \"./daytool_calendar.js\";\nimport { daytool_case, daytool_event, daytool_feed, daytool_goal, daytool_need, daytool_note, daytool_clipboard, daytool_person, daytool_plan, daytool_stat } from \"./daytool_entity.js\";\nimport { daytool_import } from \"./UI/daytool_import.js\";\nimport { daytool_metadata } from \"./daytool.js\";\n\nexport class IndexedDBService {\n private dbName: string;\n private storeName: string;\n private version: number;\n private cursorPosition: IDBValidKey | null = null;\n\n constructor(dbName: string, storeName: string, version: number = 1) {\n this.dbName = dbName;\n this.storeName = storeName;\n this.version = version;\n }\n\n private openDatabase(): Promise {\n return new Promise((resolve, reject) => {\n const request = indexedDB.open(this.dbName, this.version);\n\n request.onupgradeneeded = (event: IDBVersionChangeEvent) => {\n const db = (event.target as IDBOpenDBRequest).result;\n if (!db.objectStoreNames.contains(this.storeName)) {\n db.createObjectStore(this.storeName, {\n keyPath: \"id\",\n autoIncrement: true,\n });\n }\n };\n\n request.onsuccess = () => {\n resolve(request.result);\n };\n\n request.onerror = (event) => {\n reject(`Database error: ${(event.target as IDBOpenDBRequest).error}`);\n };\n });\n }\n\n async add(item: T): Promise {\n const db = await this.openDatabase();\n\n return new Promise((resolve, reject) => {\n const transaction = db.transaction(this.storeName, \"readwrite\");\n const store = transaction.objectStore(this.storeName);\n const request = store.add(item);\n\n request.onsuccess = () => resolve(request.result as number);\n request.onerror = (event) =>\n reject(`Add failed: ${(event.target as IDBRequest).error}`);\n });\n }\n\n async getAll(): Promise {\n const db = await this.openDatabase();\n\n return new Promise((resolve, reject) => {\n const transaction = db.transaction(this.storeName, \"readonly\");\n const store = transaction.objectStore(this.storeName);\n const request = store.getAll();\n\n request.onsuccess = () => resolve(request.result as T[]);\n request.onerror = (event) =>\n reject(`Get all failed: ${(event.target as IDBRequest).error}`);\n });\n }\n\n async getLatest(): Promise {\n const db = await this.openDatabase();\n\n\n return new Promise((resolve, reject) => {\n const transaction = db.transaction(this.storeName, \"readonly\");\n const store = transaction.objectStore(this.storeName);\n const request = store.openCursor(null,\"prev\");\n\n request.onsuccess = () => resolve( request.result ? request.result.value : null as T| undefined);\n request.onerror = (event) =>\n reject(`Get all failed: ${(event.target as IDBRequest).error}`);\n });\n }\n\n async getById(id: number): Promise {\n const db = await this.openDatabase();\n\n\n return new Promise((resolve, reject) => {\n const transaction = db.transaction(this.storeName, \"readonly\");\n const store = transaction.objectStore(this.storeName);\n const request = store.get(id);\n\n request.onsuccess = () => resolve(request.result as T | undefined);\n request.onerror = (event) =>\n reject(`Get by ID failed: ${(event.target as IDBRequest).error}`);\n });\n }\n\n async update(id: number, updatedData: Partial): Promise {\n // Fetch the existing item in a separate transaction\n const existingItem = await this.getById(id);\n if (!existingItem) {\n throw new Error(`Item with ID ${id} not found`);\n }\n\n const db = await this.openDatabase();\n const updatedItem = { ...existingItem, ...updatedData };\n\n return new Promise((resolve, reject) => {\n const transaction = db.transaction(this.storeName, \"readwrite\");\n const store = transaction.objectStore(this.storeName);\n\n const request = store.put(updatedItem);\n\n request.onsuccess = () => resolve();\n request.onerror = (event) =>\n reject(`Update failed: ${(event.target as IDBRequest).error}`);\n });\n}\n\n async updateLatest(updatedData: Partial): Promise {\n const existingItem = await this.getLatest();\n if (!existingItem) {\n throw new Error(`Storage is empty`);\n }\n\n const db = await this.openDatabase();\n\n return new Promise((resolve, reject) => {\n const updatedItem = { ...existingItem, ...updatedData };\n const transaction = db.transaction(this.storeName, \"readwrite\");\n const store = transaction.objectStore(this.storeName);\n const request = store.put(updatedItem);\n\n request.onsuccess = () => resolve();\n request.onerror = (event) =>\n reject(`Update failed: ${(event.target as IDBRequest).error}`);\n });\n }\n\n async delete(id: number): Promise {\n const db = await this.openDatabase();\n\n return new Promise((resolve, reject) => {\n const transaction = db.transaction(this.storeName, \"readwrite\");\n const store = transaction.objectStore(this.storeName);\n const request = store.delete(id);\n\n request.onsuccess = () => resolve();\n request.onerror = (event) =>\n reject(`Delete failed: ${(event.target as IDBRequest).error}`);\n });\n }\n}\n\nexport async function deleteAllDatabases(): Promise {\n if (!indexedDB.databases) {\n console.warn(\"`indexedDB.databases()` is not supported in this browser.\");\n return;\n }\n\n const databases = await indexedDB.databases();\n for (const db of databases) {\n if (db.name) {\n const deleteRequest = indexedDB.deleteDatabase(db.name);\n\n deleteRequest.onsuccess = () => {\n console.log(`Database ${db.name} deleted successfully.`);\n };\n\n deleteRequest.onerror = (event) => {\n console.error(\n `Error deleting database ${db.name}:`,\n (event.target as IDBRequest).error\n );\n };\n }\n }\n}\n\nexport async function clearObjectStore(dbName: string, storeName: string): Promise {\n const db = await new Promise((resolve, reject) => {\n const request = indexedDB.open(dbName);\n\n request.onsuccess = () => resolve(request.result);\n request.onerror = (event) => reject(`Error opening database: ${(event.target as IDBRequest).error}`);\n });\n\n return new Promise((resolve, reject) => {\n const transaction = db.transaction(storeName, \"readwrite\");\n const store = transaction.objectStore(storeName);\n\n const clearRequest = store.clear();\n\n clearRequest.onsuccess = () => {\n console.log(`Object store ${storeName} cleared successfully.`);\n resolve();\n };\n\n clearRequest.onerror = (event) => {\n console.error(`Error clearing object store ${storeName}:`, (event.target as IDBRequest).error);\n reject((event.target as IDBRequest).error);\n };\n });\n }\n\n export const notesService = new IndexedDBService(\n \"NotesDB\",\n \"notes\"\n );\n export const statsService = new IndexedDBService(\n \"StatsDB\",\n \"stats\"\n );\n export const needsService = new IndexedDBService(\n \"NeedsDB\",\n \"needs\"\n );\n export const eventsService = new IndexedDBService(\n \"EventsDB\",\n \"events\"\n );\n export const goalsService = new IndexedDBService(\n \"GoalsDB\",\n \"goals\"\n );\n export const casesService = new IndexedDBService(\n \"CasesDB\",\n \"cases\"\n );\n export const feedsService = new IndexedDBService(\n \"FeedsDB\",\n \"feeds\"\n );\n export const plansService = new IndexedDBService(\n \"PlansDB\",\n \"plans\"\n );\n export const personsService = new IndexedDBService(\n \"PersonsDB\",\n \"persons\"\n );\n export const calendarsService = new IndexedDBService(\n \"CalendarsDB\",\n \"calendars\"\n );\n export const importsService = new IndexedDBService(\n \"ImportsDB\",\n \"imports\"\n );\n export const metadataService = new IndexedDBService(\n \"MetadataDB\",\n \"metadata\"\n );\n export const clipboardService = new IndexedDBService(\n \"ClipboardDB\",\n \"clipboard\"\n );"]}