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]=`a50ff790-d56d-4bf4-8a1c-9ce00f1e5a06`,e._sentryDebugIdIdentifier=`sentry-dbid-a50ff790-d56d-4bf4-8a1c-9ce00f1e5a06`)}catch{}import"./rolldown-runtime-eb2nym32.js";import{Ga as e,Mr as t}from"./entry.client-dr7r6s9a.js";import{t as n}from"./FetchCacheAdaptor-j49ssbci.js";var r=class r extends n{static createTrialTimeCache(t,n,r){return new e({name:`TrialTimeInfoCache+${n.toLowerCase()}+${t}`,version:1,tables:{TrialTimeInfo:{keyPath:`productId`,indexes:null,cacheTimeMs:r}}})}trialTimeManager;queryInvalidator;constructor(e,t,n,i,a){let o=r.createTrialTimeCache(e,t,i);super(o),this.trialTimeManager=n,this.queryInvalidator=a}async fetchRemainingTrialTime(e){return await this.fetchWithCache(e)}async updateTrialTimeCache(e,t){let n={productId:e,remainingGameplayTimeInSeconds:t,remainingGameplayTimeLastUpdated:new Date().toISOString()};await this.updateCache(e,n)}async refreshTrialTime(e){await this.refreshCache(e)}async clearTrialTimeCache(e){let t=this.getTableNameForParams(e),n=this.cacheProvider.getTable(t);n&&await n.deleteWhere(t=>t.data.productId===e)}getTableNameForParams(e){return`TrialTimeInfo`}onCacheUpdated(e){this.queryInvalidator(e)}async fetchFromSource(e){let n=await this.trialTimeManager.fetchRemainingTrialTime(e);return t({productId:e,remainingGameplayTimeInSeconds:n.remainingGameplayTimeInSeconds,remainingGameplayTimeLastUpdated:n.remainingGameplayTimeLastUpdated},(await this.getCachedValue(e))?.value)}};export{r as TrialTimeManagerIndexedDbWrapper};