text: !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("KeyValueStorage",[],t):"object"==typeof exports?exports.KeyValueStorage=t():e.KeyValueStorage=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeJsonParse=function(e){if("string"!=typeof e)throw new Error("Cannot safe json parse value of type "+typeof e);try{return JSON.parse(e)}catch(t){return e}},t.safeJsonStringify=function(e){return"string"==typeof e?e:JSON.stringify(e,(e,t)=>void 0===t?null:t)}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,s)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=o(n(2)),u=n(0),s=n(4);class c{constructor(){this.localStorage=i.default}getKeys(){return r(this,void 0,void 0,(function*(){return Object.keys(this.localStorage)}))}getEntries(){return r(this,void 0,void 0,(function*(){return Object.entries(this.localStorage).map(s.parseEntry)}))}getItem(e){return r(this,void 0,void 0,(function*(){const t=this.localStorage.getItem(e);if(null!==t)return u.safeJsonParse(t)}))}setItem(e,t){return r(this,void 0,void 0,(function*(){this.localStorage.setItem(e,u.safeJsonStringify(t))}))}removeItem(e){return r(this,void 0,void 0,(function*(){this.localStorage.removeItem(e)}))}}t.KeyValueStorage=c,t.default=c},function(e,t,n){(function(t){!function(){"use strict";var n;function r(){}(n=r).prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},n.prototype.setItem=function(e,t){this[e]=String(t)},n.prototype.removeItem=function(e){delete this[e]},n.prototype.clear=function(){var e=this;Object.keys(e).forEach((function(t){e[t]=void 0,delete e[t]}))},n.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},n.prototype.__defineGetter__("length",(function(){return Object.keys(this).length})),t.localStorage?e.exports=localStorage:e.exports=new r}()}).call(this,n(3))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(5)),r(n(7))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6);t.IKeyValueStorage=r.IKeyValueStorage},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.IKeyValueStorage=class{}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0);function o(e){return t.REACT_NATIVE_REQUIRED_OPTION in e}function i(e){return t.NODE_JS_REQUIRED_OPTION in e}t.REACT_NATIVE_REQUIRED_OPTION="asyncStorage",t.isReactNativeOptions=o,t.getReactNativeOptions=function(e){if(void 0===e||!o(e))throw new Error(`Missing ${t.REACT_NATIVE_REQUIRED_OPTION} option required for React-Native`);return e},t.NODE_JS_REQUIRED_OPTION="database",t.isNodeJSOptions=i,t.getNodeJSOptions=function(e){if(void 0===e||!i(e))throw new Error(`Missing ${t.NODE_JS_REQUIRED_OPTION} option required for NodeJS`);return e},t.parseEntry=function(e){return[e[0],r.safeJsonParse(e[1])]}}])}));