try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`f4072029-7a62-4b4b-9b75-715e9726cf1c`,e._sentryDebugIdIdentifier=`sentry-dbid-f4072029-7a62-4b4b-9b75-715e9726cf1c`)}catch{}import"./entry.client-dr7r6s9a.js";var e=class{cacheProvider;constructor(e){this.cacheProvider=e}async getCachedValue(e,...t){let n=this.getTableNameForParams(e,...t),r=this.cacheProvider.getTable(n);if(!r)throw Error(`Table ${n} not found in cache provider.`);let i=typeof e==`string`?e:String(e),a=await r.getValue(i);return a?{value:a.data,isExpired:r.isExpired(a)}:null}async fetchWithCache(e,...t){let n=await this.getCachedValue(e,...t);if(n&&!n.isExpired)return n.value;let r=this.getTableNameForParams(e,...t),i=this.cacheProvider.getTable(r);if(!i)throw Error(`Table ${r} not found in cache provider.`);let a=this.fetchFromSource(e,...t).then(async a=>(a&&i.setValue(a).catch(e=>{throw AggregateError([e],`Failed to update cache for ${r}: ${e}`)}).then(()=>{n&&this.onCacheUpdated(e,...t)}),a));return n?n.value:a}async updateCache(e,t,...n){let r=this.getTableNameForParams(e,...n),i=this.cacheProvider.getTable(r);i&&(await i.setValue(t).catch(e=>{throw AggregateError([e],`Failed to update cache for ${r}: ${e}`)}),this.onCacheUpdated(e,...n))}async refreshCache(e,...t){let n=await this.fetchFromSource(e,...t);await this.updateCache(e,n,...t)}};export{e as t};