/*! Record.js v0.8.0 | MIT | https://github.com/n2geoff/record.js */classo{constructor(e){if(this.store=(e||{}).store,this.debug=(e||{}).debug||!1,this.records=[],this.store&&localStorage){this._log("Initializing localStorage for "+this.store);letr=this._load()||[];this.records=[...r]}}_log(){this.debug&&console.log(...arguments)}add(e){if(Array.isArray(e)){letr=[];returne.forEach(()=>{e.id||(e.id=Math.random().toString(36).substr(2,9)),this.records.push(e),this.entries.push(e)}),this._save(),r}elsereturne.id||(e.id=Math.random().toString(36).substr(2,9)),this.records.push(e),this._save(),e}update(e){varr=this.records.indexOf(e);returnthis.records[r].id===e.id?(this.records.splice(r,1,e),this._save(),e):!1}find(e){if(!e)returnthis.records;if(typeofe=="string"||typeofe=="number")returnthis.records.filter(t=>t.id===e);letr=Object.keys(e);returnthis.records.filter(t=>r.indexOf("id")!==-1?t.id===e.id:r.every(s=>t[s]===e[s]))}remove(e){if(!e||Array.isArray(e))returnthis._log(console.error("remove() accepts a single object")),[];letr=this.find(e);returnr.forEach(t=>{this.records.splice(this.records.indexOf(t),1)}),this._save(),r}clear(){this.records=[],this._save()}_save(){this.store&&localStorage&&localStorage.setItem(this.store,JSON.stringify(this.records))}_load(){if(this.store&&localStorage)returnJSON.parse(localStorage.getItem(this.store))||[]}dump(){functione(r,t){lets=document.createElement("a"),i=newBlob([t],{type:"text/plain"});s.href=URL.createObjectURL(i),s.download=r,s.click()}e(`${this.store||"data"}.json`,JSON.stringify(this._load(),null,4))}}vara=o;export{aasdefault};