define(["exports"],function(_exports){function onCachePutFail(e){console.log(e)}function updateCache(instance){var cache=instance.cache;cache&&cache.put("data",new Response(JSON.stringify(instance.localData))).catch(onCachePutFail)}function MyStore(){}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,MyStore.prototype.init=function(){try{"undefined"!=typeof caches&&caches.open("embydata").then(function(result){this.cache=result,this.localData={}}.bind(this),function(err){return console.log("Error opening cache: ".concat(err)),this.localData={},Promise.resolve()}.bind(this))}catch(err){console.log("Error opening cache: ".concat(err))}return Promise.resolve()},MyStore.prototype.setItem=function(name,value){localStorage.setItem(name,value);var localData=this.localData;localData&&localData[name]!==value&&(localData[name]=value,updateCache(this))},MyStore.prototype.getItem=function(name){return localStorage.getItem(name)},MyStore.prototype.removeItem=function(name){localStorage.removeItem(name);var localData=this.localData;localData&&(localData[name]=null,delete localData[name],updateCache(this))};_exports.default=new MyStore});