"use strict";function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function requestTransaction(t){function e(t){return t.done?t.value:t.value.then(function(t){return e(r.next(t))},function(t){return e(r["throw"](t))})}var r=t([1,2,3]);return e(r.next())}!function(t){function e(t,e,r,o){var i=Object.create((e||n).prototype);return i._invoke=s(t,r||null,new h(o||[])),i}function r(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(n){return{type:"throw",arg:n}}}function n(){}function o(){}function i(){}function a(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function c(t){this.arg=t}function u(t){function e(e,r){var n=t[e](r),a=n.value;return a instanceof c?Promise.resolve(a.arg).then(o,i):Promise.resolve(a).then(function(t){return n.value=t,n},i)}function r(t,r){var o=n?n.then(function(){return e(t,r)}):new Promise(function(n){n(e(t,r))});return n=o["catch"](a),o}"object"==typeof process&&process.domain&&(e=process.domain.bind(e));var n,o=e.bind(t,"next"),i=e.bind(t,"throw"),a=e.bind(t,"return");this._invoke=r}function s(t,e,n){var o=x;return function(i,a){if(o===b)throw new Error("Generator is already running");if(o===E)return y();for(;;){var c=n.delegate;if(c){if("return"===i||"throw"===i&&c.iterator[i]===v){n.delegate=null;var u=c.iterator["return"];if(u){var s=r(u,c.iterator,a);if("throw"===s.type){i="throw",a=s.arg;continue}}if("return"===i)continue}var s=r(c.iterator[i],c.iterator,a);if("throw"===s.type){n.delegate=null,i="throw",a=s.arg;continue}i="next",a=v;var f=s.arg;if(!f.done)return o=L,f;n[c.resultName]=f.value,n.next=c.nextLoc,n.delegate=null}if("next"===i)o===L?n.sent=a:delete n.sent;else if("throw"===i){if(o===x)throw o=E,a;n.dispatchException(a)&&(i="next",a=v)}else"return"===i&&n.abrupt("return",a);o=b;var s=r(t,e,n);if("normal"===s.type){o=n.done?E:L;var f={value:s.arg,done:n.done};if(s.arg!==k)return f;n.delegate&&"next"===i&&(a=v)}else"throw"===s.type&&(o=E,i="throw",a=s.arg)}}}function f(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function l(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function h(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(f,this),this.reset()}function p(t){if(t){var e=t[g];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function o(){for(;++re;++e)this[t]=null},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,n){return i.type="throw",i.arg=t,r.next=e,!!n}if(this.done)throw t;for(var r=this,n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=d.call(o,"catchLoc"),c=d.call(o,"finallyLoc");if(a&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&d.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),l(r),k}},"catch":function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;l(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:p(t),resultName:e,nextLoc:r},k}}}("object"==typeof global?global:"object"==typeof window?window:"object"==typeof self?self:void 0);var IndexedDB=function(){var t=function(){function t(e){_classCallCheck(this,t),this.transaction=e}return t.prototype.setOperation=function(t){var e=this;return new Promise(function(r,n){var o=e.transaction.objectStore("OperationBuffer").put(t);o.onsuccess=function(){r(t)},o.onerror=function(){n("Could not set Operation!")}})},t.prototype.getOperation=function(t){var e=this;return new Promise(function(r,n){var o=e.transaction.objectStore("OperationBuffer").get(t);o.onsuccess=function(){r(o.result)},o.onerror=function(){n("Could not get Operation")}})},t}(),e=function(){function t(e){_classCallCheck(this,t),this.namespace=e,this.ready=new Promise(function(t,r){var n=indexedDB.open(e);n.onerror=function(){r("Couldn't open the IndexedDB database!")},n.onsuccess=function(e){t(e.target.result)},n.onupgradeneeded=function(t){var e=t.target.result;e.createObjectStore("OperationBuffer",{keyPath:"uid"}),e.createObjectStore("StateVector",{keyPath:"user"})}})["catch"](function(t){throw new Error(t)})}return t.prototype.requestTransaction=function(t){this.ready.then(function(){var e=t(3);e.next()})},t}();return{DB:e,Transaction:t}}(),OperationBuffer=function t(){_classCallCheck(this,t),this.i=4},Operation=function(){function t(e){_classCallCheck(this,t),this.i=e.i}return t.prototype.yay=function(){return this.i},t}(); //# sourceMappingURL=y.js.map