"use strict";var e=require("effector-storage"),t=require("idb-keyval"),r=Symbol(),a=new Map,i=new Map;function n(e){var r=i.get(e);r&&(t.setMany([...r[2].entries()],e),i.delete(e))}function o({timeout:e,dbName:o,storeName:s,keyvalStore:u}){var c=o+"|"+s,d=a.get(c)||u;o&&s&&!d&&(d=t.createStore(o,s),a.set(c,d));var v=r=>({get:async()=>await t.get(r,d),async set(a){if(void 0===e)return await t.set(r,a,d);var[o,s,u]=i.get(d)||[void 0,void 0,new Map];u.set(r,a);var c=Date.now()+e;(void 0===s||s>c)&&(clearTimeout(o),i.set(d,[setTimeout(n,e,d),c,u]))}});return v.keyArea=d||r,v}function s(t){return"undefined"!=typeof indexedDB?o({...t}):e.nil({keyArea:r})}function u(t){return r=>e.persist({adapter:s,...t,...r})}o.factory=!0,s.factory=!0;var c=u();exports.adapter=s,exports.createPersist=u,exports.persist=c; //# sourceMappingURL=index.cjs.map