indexeddbshim 15.2.0 → 16.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +1 -1
  2. package/badges/licenses-badge-dev.svg +1 -1
  3. package/badges/licenses-badge.svg +1 -1
  4. package/dist/DOMException.d.ts +2 -2
  5. package/dist/DOMException.d.ts.map +1 -1
  6. package/dist/DOMStringList.d.ts.map +1 -1
  7. package/dist/Event.d.ts +1 -1
  8. package/dist/Event.d.ts.map +1 -1
  9. package/dist/IDBCursor.d.ts +3 -2
  10. package/dist/IDBCursor.d.ts.map +1 -1
  11. package/dist/IDBDatabase.d.ts.map +1 -1
  12. package/dist/IDBFactory.d.ts +1 -1
  13. package/dist/IDBFactory.d.ts.map +1 -1
  14. package/dist/IDBIndex.d.ts +3 -3
  15. package/dist/IDBIndex.d.ts.map +1 -1
  16. package/dist/IDBKeyRange.d.ts +2 -2
  17. package/dist/IDBKeyRange.d.ts.map +1 -1
  18. package/dist/IDBObjectStore.d.ts +3 -3
  19. package/dist/IDBObjectStore.d.ts.map +1 -1
  20. package/dist/IDBTransaction.d.ts.map +1 -1
  21. package/dist/Key.d.ts +7 -7
  22. package/dist/Key.d.ts.map +1 -1
  23. package/dist/Sca.d.ts +1 -1
  24. package/dist/Sca.d.ts.map +1 -1
  25. package/dist/indexeddbshim-Key.js +1668 -1839
  26. package/dist/indexeddbshim-Key.js.map +1 -1
  27. package/dist/indexeddbshim-Key.min.js +2 -2
  28. package/dist/indexeddbshim-Key.min.js.map +1 -1
  29. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +1257 -1163
  30. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
  31. package/dist/indexeddbshim-UnicodeIdentifiers.js +1850 -2721
  32. package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
  33. package/dist/indexeddbshim-UnicodeIdentifiers.min.js +2 -2
  34. package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
  35. package/dist/indexeddbshim-node.cjs +1257 -1163
  36. package/dist/indexeddbshim-node.cjs.map +1 -1
  37. package/dist/indexeddbshim-noninvasive.js +1848 -2719
  38. package/dist/indexeddbshim-noninvasive.js.map +1 -1
  39. package/dist/indexeddbshim-noninvasive.min.js +2 -2
  40. package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
  41. package/dist/indexeddbshim.js +1846 -2709
  42. package/dist/indexeddbshim.js.map +1 -1
  43. package/dist/indexeddbshim.min.js +2 -2
  44. package/dist/indexeddbshim.min.js.map +1 -1
  45. package/dist/node-UnicodeIdentifiers.d.ts.map +1 -1
  46. package/dist/node.d.ts.map +1 -1
  47. package/dist/setGlobalVars.d.ts +1 -1
  48. package/dist/setGlobalVars.d.ts.map +1 -1
  49. package/dist/unicode-regex.d.ts +2 -2
  50. package/dist/unicode-regex.d.ts.map +1 -1
  51. package/dist/util.d.ts +1 -1
  52. package/dist/util.d.ts.map +1 -1
  53. package/package.json +30 -31
  54. package/src/DOMException.js +0 -1
  55. package/src/DOMStringList.js +0 -1
  56. package/src/IDBCursor.js +8 -4
  57. package/src/IDBFactory.js +2 -4
  58. package/src/IDBIndex.js +1 -2
  59. package/src/IDBKeyRange.js +1 -0
  60. package/src/IDBObjectStore.js +0 -1
  61. package/src/IDBTransaction.js +0 -1
  62. package/src/Key.js +5 -1
  63. package/src/browser-UnicodeIdentifiers.js +2 -2
  64. package/src/browser-noninvasive.js +1 -1
  65. package/src/browser.js +1 -1
  66. package/src/setGlobalVars.js +0 -2
  67. package/src/unicode-regex.js +12 -3
  68. package/src/util.js +1 -0
@@ -1,3 +1,3 @@
1
- /*! indexeddbshim - v15.2.0 - 9/11/2024 */
2
- !function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}function n(e){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=e.apply(n,r);function u(e){t(a,o,i,u,c,"next",e)}function c(e){t(a,o,i,u,c,"throw",e)}u(void 0)}))}}function r(e,t,n){if(c())return Reflect.construct.apply(null,arguments);var r=[null];return r.push.apply(r,t),new(e.bind.apply(e,r))}function o(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,p(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=y(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function a(e,t,n,r){var o={configurable:!0,enumerable:!0};return o[e]=r,Object.defineProperty(t,n,o)}function u(e,t,n){return(t=p(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(){f=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),u=new B(r||[]);return o(a,"_invoke",{value:T(e,n,u)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var _="suspendedStart",p="suspendedYield",h="executing",y="completed",v={};function b(){}function g(){}function m(){}var E={};s(E,a,(function(){return this}));var w=Object.getPrototypeOf,D=w&&w(w(F([])));D&&D!==n&&r.call(D,a)&&(E=D);var I=m.prototype=b.prototype=Object.create(E);function O(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(o,i,a,u){var c=d(e[o],e,i);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(l).then((function(e){s.value=e,a(s)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function T(t,n,r){var o=_;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=A(u,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===_)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=d(t,n,r);if("normal"===s.type){if(o=r.done?y:p,s.arg===v)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=y,r.method="throw",r.arg=s.arg)}}}function A(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,A(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function B(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function F(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return g.prototype=m,o(I,"constructor",{value:m,configurable:!0}),o(m,"constructor",{value:g,configurable:!0}),g.displayName=s(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s(e,c,"GeneratorFunction")),e.prototype=Object.create(I),e},t.awrap=function(e){return{__await:e}},O(S.prototype),s(S.prototype,u,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(l(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},O(I),s(I,c,"Generator"),s(I,a,(function(){return this})),s(I,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=F,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return u.type="throw",u.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:F(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(e,t)||y(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||y(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function y(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}var b=0,g=1,m=2,E=3,w="undefined"==typeof DOMException?function(e,t){var n=new Error(e);return n.name=t,n}:DOMException,D=new WeakMap,I=new WeakMap,O=function(e){var t=this;this[Symbol.toStringTag]="Event",this.toString=function(){return"[object Event]"};var n=Array.prototype.slice.call(arguments),r=n[1],o=n[2];if(!arguments.length)throw new TypeError("Failed to construct 'Event': 1 argument required, but only 0 present.");o=o||{};var i={};"composed"in(r=r||{})&&(i.composed=r.composed),D.set(this,o),I.set(this,i);this.initEvent(e,r.bubbles,r.cancelable),["target","currentTarget","eventPhase","defaultPrevented"].forEach((function(e){var n=e;Object.defineProperty(t,n,{get:function(){return void 0!==i[n]?i[n]:n in o?o[n]:"eventPhase"===n?0:"defaultPrevented"!==n&&null}})}));var a=["type","bubbles","cancelable","isTrusted","timeStamp","initEvent","composedPath","composed"];"[object CustomEvent]"===this.toString()&&a.push("detail","initCustomEvent"),Object.defineProperties(this,a.reduce((function(e,t){var n=t;return e[n]={get:function(){return n in i?i[n]:n in o?o[n]:!["bubbles","cancelable","composed"].includes(n)&&void 0}},e}),{}))};O.prototype.preventDefault=function(){if(!(this instanceof O))throw new TypeError("Illegal invocation");var e=D.get(this),t=I.get(this);this.cancelable&&!t._passive&&(t.defaultPrevented=!0,"function"==typeof e.preventDefault&&e.preventDefault())},O.prototype.stopImmediatePropagation=function(){I.get(this)._stopImmediatePropagation=!0},O.prototype.stopPropagation=function(){I.get(this)._stopPropagation=!0},O.prototype.initEvent=function(e,t,n){var r=I.get(this);r._dispatched||(Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,get:function(){return e}}),Object.defineProperty(this,"bubbles",{enumerable:!0,configurable:!0,get:function(){return t}}),Object.defineProperty(this,"cancelable",{enumerable:!0,configurable:!0,get:function(){return n}}),r.type=e,void 0!==t&&(r.bubbles=t),void 0!==n&&(r.cancelable=n))},["type","target","currentTarget"].forEach((function(e){Object.defineProperty(O.prototype,e,{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}})})),["eventPhase","defaultPrevented","bubbles","cancelable","timeStamp"].forEach((function(e){Object.defineProperty(O.prototype,e,{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}})})),["NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE"].forEach((function(e,t){Object.defineProperty(O,e,{enumerable:!0,writable:!1,value:t}),Object.defineProperty(O.prototype,e,{writable:!1,value:t})})),O[Symbol.toStringTag]="Function",O.prototype[Symbol.toStringTag]="EventPrototype",Object.defineProperty(O,"prototype",{writable:!1});var S=function(e){var t=Array.prototype.slice.call(arguments),n=t[1],r=t[2];O.call(this,e,n,r),this[Symbol.toStringTag]="CustomEvent",this.toString=function(){return"[object CustomEvent]"},n=n||{},this.initCustomEvent(e,n.bubbles,n.cancelable,"detail"in n?n.detail:null)};function T(e,t,n){var r=e[t];void 0===r&&(e[t]=r=[]);var o="boolean"==typeof n?{capture:n}:n||{},i=JSON.stringify(o);return{listenersByTypeOptions:r.filter((function(e){return i===JSON.stringify(e.options)})),options:o,listenersByType:r}}Object.defineProperty(S.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:S}),S.prototype.initCustomEvent=function(e,t,n,r){if(!(this instanceof S))throw new TypeError("Illegal invocation");var o=I.get(this);S.call(this,e,{bubbles:t,cancelable:n,detail:r},arguments[4]),o._dispatched||(void 0!==r&&(o.detail=r),Object.defineProperty(this,"detail",{get:function(){return o.detail}}))},S[Symbol.toStringTag]="Function",S.prototype[Symbol.toStringTag]="CustomEventPrototype",Object.defineProperty(S.prototype,"detail",{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}}),Object.defineProperty(S,"prototype",{writable:!1});var A={addListener:function(e,t,n,r){var o=T(e,n,r),i=o.listenersByTypeOptions;r=o.options;var a=o.listenersByType;i.some((function(e){return e.listener===t}))||a.push({listener:t,options:r})},removeListener:function(e,t,n,r){var o=T(e,n,r),i=o.listenersByType,a=JSON.stringify(o.options);i.some((function(r,o){return r.listener===t&&a===JSON.stringify(r.options)&&(i.splice(o,1),i.length||delete e[n],!0)}))},hasListener:function(e,t,n,r){return T(e,n,r).listenersByTypeOptions.some((function(e){return e.listener===t}))}};function N(){throw new TypeError("Illegal constructor")}Object.assign(N.prototype,["Early","","Late","Default"].reduce((function(e,t){return["add","remove","has"].forEach((function(n){e[n+t+"EventListener"]=function(e,r){var o=arguments[2];if(arguments.length<2)throw new TypeError("2 or more arguments required");if("string"!=typeof e)throw new w("UNSPECIFIED_EVENT_TYPE_ERR","UNSPECIFIED_EVENT_TYPE_ERR");try{"handleEvent"in r&&r.handleEvent.bind&&(r=r.handleEvent.bind(r))}catch(e){console.log("Uncaught `handleEvent` error",e)}var i="_"+t.toLowerCase()+(""===t?"l":"L")+"isteners";return this[i]||Object.defineProperty(this,i,{value:{}}),A[n+"Listener"](this[i],r,e,o)}})),e}),{})),Object.assign(N.prototype,{_legacyOutputDidListenersThrowCheck:void 0,__setOptions:function(e){e=e||{},this._defaultSync=e.defaultSync,this._extraProperties=e.extraProperties||[],e.legacyOutputDidListenersThrowFlag&&(this._legacyOutputDidListenersThrowCheck=!0,this._extraProperties.push("__legacyOutputDidListenersThrowError"))},dispatchEvent:function(e){return this._dispatchEvent(e,!0)},_dispatchEvent:function(e,t){var n=this;["early","","late","default"].forEach((function(e){var t="_"+e+(""===e?"l":"L")+"isteners";n[t]||Object.defineProperty(n,t,{value:{}})}));var r,o=I.get(e);if(o&&t&&o._dispatched)throw new w("The object is in an invalid state.","InvalidStateError");o?r=e:(r=function(e){var t=e.bubbles,n=e.cancelable,r=e.detail,o=e.type;return"detail"in e?new S(o,{bubbles:t,cancelable:n,detail:r},e):new O(o,{bubbles:t,cancelable:n},e)}(e),(o=I.get(r))._dispatched=!0,this._extraProperties.forEach((function(t){t in e&&(r[t]=e[t])})));var i=r.type;function a(){o.eventPhase=b,o.currentTarget=null,delete o._children}function u(){o._stopImmediatePropagation=void 0,o._stopPropagation=void 0,r.defaultPrevented&&o.cancelable||(o.eventPhase=m,r.target.invokeCurrentListeners(r.target._defaultListeners,r,i)),a()}var c=function(){return o._stopImmediatePropagation=void 0,o._stopPropagation=void 0,n._defaultSync?u():setTimeout(u,0),o.eventPhase=m,o._stopPropagation||(o._stopImmediatePropagation=void 0,o._stopPropagation=void 0,r.target.invokeCurrentListeners(r.target._lateListeners,r,i)),a(),!r.defaultPrevented};switch(t&&(o.target=this),"eventPhase"in r&&r.eventPhase){case g:if(o._stopPropagation)return c();this.invokeCurrentListeners(this._listeners,r,i);var s=o._children&&o._children.length&&o._children.pop();return s&&s!==r.target||(o.eventPhase=m),s&&(s._defaultSync=this._defaultSync),(s||this)._dispatchEvent(r,!1);case m:return o._stopPropagation?c():(this.invokeCurrentListeners(this._listeners,r,i,!0),o.bubbles?(o.eventPhase=E,this._dispatchEvent(r,!1)):c());case E:if(o._stopPropagation)return c();var l=this.__getParent&&this.__getParent();return l?(l.invokeCurrentListeners(l._listeners,r,i,!0),l._defaultSync=this._defaultSync,l._dispatchEvent(r,!1)):c();default:if(o.eventPhase=m,this.invokeCurrentListeners(this._earlyListeners,r,i),!("__getParent"in this))return o.eventPhase=m,this._dispatchEvent(r,!1);for(var f=this,d=this;f.__getParent&&null!==(f=f.__getParent());)o._children||(o._children=[]),o._children.push(d),d=f;return d._defaultSync=this._defaultSync,o.eventPhase=g,d._dispatchEvent(r,!1)}},invokeCurrentListeners:function(e,t,n,r){var o=this,i=I.get(t);i.currentTarget=this;var a=T(e,n,{}).listenersByType.concat(),u=a.length?1:0;return a.some((function(e,a){var c=r?o["on"+n]:null;if(i._stopImmediatePropagation)return!0;a===u&&"function"==typeof c&&o.tryCatch(t,(function(){!1===c.call(t.currentTarget,t)&&t.preventDefault()}));var s=e.options,l=s.once,f=s.passive,d=s.capture;if(i._passive=f,d&&t.target!==t.currentTarget&&t.eventPhase===g||t.eventPhase===m||!d&&t.target!==t.currentTarget&&t.eventPhase===E){var _=e.listener;o.tryCatch(t,(function(){_.call(t.currentTarget,t)})),l&&o.removeEventListener(n,_,s)}return!1})),this.tryCatch(t,(function(){var e=r?o["on"+n]:null;"function"==typeof e&&a.length<2&&(!1===e.call(t.currentTarget,t)&&t.preventDefault())})),!t.defaultPrevented},tryCatch:function(e,t){try{t()}catch(t){this.triggerErrorEvent(t,e)}},triggerErrorEvent:function(e,t){var n,r=e;"string"==typeof e&&(r=new Error("Uncaught exception: "+e));var o=!1;"undefined"==typeof window||"undefined"==typeof ErrorEvent||window&&"object"===("undefined"==typeof window?"undefined":v(window))&&!window.dispatchEvent?(o=!0,n=function(){setTimeout((function(){throw r}))}):n=function(){var t=new ErrorEvent("error",{error:e,message:r.message||"",filename:r.fileName||"",lineno:r.lineNumber||0,colno:r.columnNumber||0});window.dispatchEvent(t)},o&&this._legacyOutputDidListenersThrowCheck||n(),this._legacyOutputDidListenersThrowCheck&&(t.__legacyOutputDidListenersThrowError=r)}}),N.prototype[Symbol.toStringTag]="EventTargetPrototype",Object.defineProperty(N,"prototype",{writable:!1});var x=N,B={createInstance:function(e){var t=function(){this.__setOptions(e)};return t.prototype=x.prototype,new t}};N.ShimEvent=O,N.ShimCustomEvent=S,N.ShimDOMException=w,N.ShimEventTarget=N,N.EventTargetFactory=B;var F={},j={};function P(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}["DEBUG","cacheDatabaseInstances","autoName","fullIDLSupport","checkOrigin","cursorPreloadPackSize","UnicodeIDStart","UnicodeIDContinue","registerSCA","avoidAutoShim","win","DEFAULT_DB_SIZE","useSQLiteIndexes","fs","addNonIDBGlobals","replaceNonIDBGlobals","escapeDatabaseName","unescapeDatabaseName","databaseCharacterEscapeList","databaseNameLengthLimit","escapeNFDForDatabaseNames","addSQLiteExtension",["memoryDatabase",function(e){if(!/^(?::memory:|file::memory:(\?(?:[\0-"\$-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?(#(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?)?$/.test(e))throw new TypeError('`memoryDatabase` must be the empty string, ":memory:", or a "file::memory:[?queryString][#hash] URL".')}],"deleteDatabaseFiles","databaseBasePath","sysDatabaseBasePath","sqlBusyTimeout","sqlTrace","sqlProfile","createIndexes"].forEach((function(e){var t;if(Array.isArray(e)){var n=d(e,2);e=n[0],t=n[1]}Object.defineProperty(j,e,{get:function(){return F[e]},set:function(n){t&&t(n),F[e]=n}})}));var C=P(/[\xC0-\xC5\xC7-\xCF\xD1-\xD6\xD9-\xDD\xE0-\xE5\xE7-\xEF\xF1-\xF6\xF9-\xFD\xFF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0\u01A1\u01AF\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01F0\u01F4\u01F5\u01F8-\u021B\u021E\u021F\u0226-\u0233\u0344\u0385\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AA-\u03B0\u03CA-\u03CE\u03D3\u03D4\u0400\u0401\u0403\u0407\u040C-\u040E\u0419\u0439\u0450\u0451\u0453\u0457\u045C-\u045E\u0476\u0477\u04C1\u04C2\u04D0-\u04D3\u04D6\u04D7\u04DA-\u04DF\u04E2-\u04E7\u04EA-\u04F5\u04F8\u04F9\u0622-\u0626\u06C0\u06C2\u06D3\u0929\u0931\u0934\u0958-\u095F\u09CB\u09CC\u09DC\u09DD\u09DF\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B48\u0B4B\u0B4C\u0B5C\u0B5D\u0B94\u0BCA-\u0BCC\u0C48\u0CC0\u0CC7\u0CC8\u0CCA\u0CCB\u0D4A-\u0D4C\u0DDA\u0DDC-\u0DDE\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F73\u0F75\u0F76\u0F78\u0F81\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9\u1026\u1B06\u1B08\u1B0A\u1B0C\u1B0E\u1B12\u1B3B\u1B3D\u1B40\u1B41\u1B43\u1E00-\u1E99\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FC1-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEE\u1FF2-\u1FF4\u1FF6-\u1FFC\u212B\u219A\u219B\u21AE\u21CD-\u21CF\u2204\u2209\u220C\u2224\u2226\u2241\u2244\u2247\u2249\u2260\u2262\u226D-\u2271\u2274\u2275\u2278\u2279\u2280\u2281\u2284\u2285\u2288\u2289\u22AC-\u22AF\u22E0-\u22E3\u22EA-\u22ED\u2ADC\u304C\u304E\u3050\u3052\u3054\u3056\u3058\u305A\u305C\u305E\u3060\u3062\u3065\u3067\u3069\u3070\u3071\u3073\u3074\u3076\u3077\u3079\u307A\u307C\u307D\u3094\u309E\u30AC\u30AE\u30B0\u30B2\u30B4\u30B6\u30B8\u30BA\u30BC\u30BE\u30C0\u30C2\u30C5\u30C7\u30C9\u30D0\u30D1\u30D3\u30D4\u30D6\u30D7\u30D9\u30DA\u30DC\u30DD\u30F4\u30F7-\u30FA\u30FE\uAC00-\uD7A3\uFB1D\uFB1F\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4E]|\uD804[\uDC9A\uDC9C\uDCAB\uDD2E\uDD2F\uDF4B\uDF4C]|\uD805[\uDCBB\uDCBC\uDCBE\uDDBA\uDDBB]|\uD806\uDD38|\uD834[\uDD5E-\uDD64\uDDBB-\uDDC0]/);function k(e){return e.replaceAll(/((?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])))(?!(?:(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))|(^|(?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))((?:(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))/g,(function(e,t,n,r){return t?"^2"+t.codePointAt().toString(16).padStart(4,"0"):(n||"")+"^3"+r.codePointAt().toString(16).padStart(4,"0")}))}function L(e){return"_"+k(e.replaceAll("^","^^").replaceAll("\0","^0").replaceAll(/([A-Z])/g,"^$1"))}function R(e){return k(e.replaceAll("^","^^").replaceAll("\0","^0"))}function q(e){return function(e){return e.replaceAll(/(\^+)3(d[0-9a-f]{3})/g,(function(e,t,n){return t.length%2?t.slice(1)+String.fromCodePoint(Number.parseInt(n,16)):e})).replaceAll(/(\^+)2(d[0-9a-f]{3})/g,(function(e,t,n){return t.length%2?t.slice(1)+String.fromCodePoint(Number.parseInt(n,16)):e}))}(e).replaceAll(/(\^+)0/g,(function(e,t){return t.length%2?t.slice(1)+"\0":e})).replaceAll("^^","^")}function U(e){return'"'+function(e){return e.replaceAll('"','""')}(e)+'"'}function M(e){if(j.escapeDatabaseName)return j.escapeDatabaseName(R(e));if(e="D"+L(e),!1!==j.escapeNFDForDatabaseNames&&(e=e.replaceAll(new RegExp(C,"gu"),(function(e){return"^4"+e.codePointAt(0).toString(16).padStart(6,"0")}))),!1!==j.databaseCharacterEscapeList&&(e=e.replace(j.databaseCharacterEscapeList?new RegExp(j.databaseCharacterEscapeList,"gu"):/[\0-\x1F"\*\/:<>\?\\\|\x7F]/g,(function(e){return"^1"+e.charCodeAt(0).toString(16).padStart(2,"0")}))),!1!==j.databaseNameLengthLimit&&e.length>=(j.databaseNameLengthLimit||254)-(!1!==j.addSQLiteExtension?7:0))throw new Error("Unexpectedly long database name supplied; length limit required for Node compatibility; passed length: "+e.length+"; length limit setting: "+(j.databaseNameLengthLimit||254)+".");return e+(!1!==j.addSQLiteExtension?".sqlite":"")}function V(e){return U("S"+L(e))}function K(e){return U("I"+L(e))}function G(e){return"I"+L(e)}function H(e){return e.replaceAll("^","^^")}function Q(e,t){return t[Symbol.hasInstance](e)}function W(e){return null!==e&&"object"===h(e)}function Y(e){return W(e)&&Symbol.iterator in e&&"function"==typeof e[Symbol.iterator]}function $(e,t){t.forEach((function(t){var n=a("set",a("get",{},t,(function(){throw new TypeError("Illegal invocation")})),t,(function(e){throw new TypeError("Illegal invocation")})),r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r)}))}function J(e,t){t.forEach((function(t){var n=a("get",{},t,(function(){throw new TypeError("Illegal invocation")})),r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r)}))}function X(e,t){(t="string"==typeof t?[t]:t).forEach((function(t){var n=a("set",a("get",{},t,(function(){return e["__"+t]})),t,(function(n){e["__"+t]=n})),r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r)})),t.forEach((function(t){e[t]=null}))}function z(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;(t="string"==typeof t?[t]:t).forEach((function(t){var r;n&&t in n?r=n[t]:(Object.defineProperty(e,"__"+t,{enumerable:!1,configurable:!1,writable:!0}),r=a("get",{},t,(function(){return this["__"+t]})));var o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,o)}))}function Z(e){var t=j.UnicodeIDStart||"[$A-Z_a-z]",n=j.UnicodeIDContinue||"[$0-9A-Z_a-z]";return new RegExp("^"+("(?:"+t+"|[$_])")+("(?:"+n+"|[$_‌‍])")+"*$","u").test(e)}function ee(e){return"string"==typeof e&&(""===e||Z(e)||e.split(".").every((function(e){return Z(e)})))}function te(e){return ee(e)||Array.isArray(e)&&Boolean(e.length)&&_(e).every((function(e){return ee(e)}))}function ne(e,t){var n,r;switch(e=Math.floor(Number(e)),t){case"unsigned long long":n=9007199254740991,r=0;break;case"unsigned long":n=4294967295,r=0;break;default:throw new Error("Unrecognized type supplied to enforceRange")}if(!Number.isFinite(e)||e>n||e<r)throw new TypeError("Invalid range: "+e);return e}function re(e,t){return null===e&&t?"":oe(e)}function oe(e){return""+e}function ie(e){return Y(e)?_(e).map((function(e){return oe(e)})):oe(e)}function ae(e){return null==e}function ue(e,t,n){var r=new O(e,n);return r.debug=t,r}Object.defineProperty(O,Symbol.hasInstance,{value:function(e){return W(e)&&"target"in e&&"bubbles"in e&&"boolean"==typeof e.bubbles}});function ce(e){O.call(this,e),this[Symbol.toStringTag]="IDBVersionChangeEvent",this.toString=function(){return"[object IDBVersionChangeEvent]"},this.__eventInitDict=arguments[1]||{}}function se(e,t){return new DOMException.prototype.constructor(t,e||"DOMException")}ce.prototype=Object.create(O.prototype),ce.prototype[Symbol.toStringTag]="IDBVersionChangeEventPrototype",["oldVersion","newVersion"].forEach((function(e){var t=a("get",{},e,(function(){if(!(this instanceof ce))throw new TypeError("Illegal invocation");return this.__eventInitDict&&this.__eventInitDict[e]||("oldVersion"===e?0:null)})),n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(ce.prototype,e,n)})),Object.defineProperty(ce,Symbol.hasInstance,{value:function(e){return W(e)&&"oldVersion"in e&&"defaultPrevented"in e&&"boolean"==typeof e.defaultPrevented}}),Object.defineProperty(ce.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:ce}),Object.defineProperty(ce,"prototype",{writable:!1});var le={IndexSizeError:1,HierarchyRequestError:3,WrongDocumentError:4,InvalidCharacterError:5,NoModificationAllowedError:7,NotFoundError:8,NotSupportedError:9,InUseAttributeError:10,InvalidStateError:11,SyntaxError:12,InvalidModificationError:13,NamespaceError:14,InvalidAccessError:15,TypeMismatchError:17,SecurityError:18,NetworkError:19,AbortError:20,URLMismatchError:21,QuotaExceededError:22,TimeoutError:23,InvalidNodeTypeError:24,DataCloneError:25,EncodingError:0,NotReadableError:0,UnknownError:0,ConstraintError:0,DataError:0,TransactionInactiveError:0,ReadOnlyError:0,VersionError:0,OperationError:0,NotAllowedError:0},fe={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};var de=function(){function e(e,t){this[Symbol.toStringTag]="DOMException",this._code=t in le?le[t]:fe[t]||0,this._name=t||"Error",this._message=void 0===e?"":""+e,Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,writable:!0,value:this._code}),void 0!==t&&Object.defineProperty(this,"name",{configurable:!0,enumerable:!0,writable:!0,value:this._name}),void 0!==e&&Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,writable:!0,value:this._message})}var t=function(){};return t.prototype=Object.create(Error.prototype),["name","message"].forEach((function(n){Object.defineProperty(t.prototype,n,{enumerable:!0,get:function(){if(!(this instanceof e||this instanceof t||this instanceof Error))throw new TypeError("Illegal invocation");return this["name"===n?"_name":"_message"]}})})),Object.defineProperty(t.prototype,"code",{configurable:!0,enumerable:!0,get:function(){throw new TypeError("Illegal invocation")}}),e.prototype=new t,e.prototype[Symbol.toStringTag]="DOMExceptionPrototype",Object.defineProperty(e,"prototype",{writable:!1}),Object.keys(le).forEach((function(t){Object.defineProperty(e.prototype,t,{enumerable:!0,configurable:!1,value:le[t]}),Object.defineProperty(e,t,{enumerable:!0,configurable:!1,value:le[t]})})),Object.keys(fe).forEach((function(t){Object.defineProperty(e.prototype,t,{enumerable:!0,configurable:!1,value:fe[t]}),Object.defineProperty(e,t,{enumerable:!0,configurable:!1,value:fe[t]})})),Object.defineProperty(e.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:e}),e}();function _e(e,t,n){if(j.DEBUG){var r=n&&"object"===h(n)&&n.message?n.message:n,o="function"==typeof console.error?"error":"log";console[o](e+": "+t+". "+(r||"")),console.trace&&console.trace()}}function pe(e){return e&&"object"===h(e)&&"string"==typeof e.name}function he(e){var t,n;if(4===e.code)t="QuotaExceededError",n="The operation failed because there was not enough remaining storage space, or the storage quota was reached and the user declined to give more space to the database.";else t="UnknownError",n="The operation failed for reasons unrelated to the database itself and not covered by any other errors.";n+=" ("+e.message+")--("+e.code+")";var r=be(t,n);return r.sqlError=e,r}var ye,ve=!1;try{pe(ye=se("test name","test message"))&&"test name"===ye.name&&"test message"===ye.message&&(ve=!0)}catch(e){}var be=ve?function(e,t,n){return _e(e,t,n),se(e,t)}:function(e,t,n){return _e(e,t,n),function(e,t){return new de(t,e)}(e,t)},ge=ve?DOMException:de,me=["onsuccess","onerror"],Ee=["source","transaction","readyState"],we=["result","error"];function De(){throw new TypeError("Illegal constructor")}De.__super=function(){var e=this;this[Symbol.toStringTag]="IDBRequest",this.__setOptions({legacyOutputDidListenersThrowFlag:!0}),we.forEach((function(t){Object.defineProperty(e,"__"+t,{enumerable:!1,configurable:!1,writable:!0}),Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){if(!this.__done)throw be("InvalidStateError","Can't get "+t+"; the request is still pending.");return this["__"+t]}})})),z(this,Ee,{readyState:{get readyState(){return this.__done?"done":"pending"}}}),X(this,me),this.__result=void 0,this.__error=this.__source=this.__transaction=null,this.__done=!1},De.__createInstance=function(){return new De.__super},De.prototype=B.createInstance({extraProperties:["debug"]}),De.prototype[Symbol.toStringTag]="IDBRequestPrototype",De.prototype.__getParent=function(){return"[object IDBOpenDBRequest]"===this.toString()?null:this.__transaction},J(De.prototype,Ee),J(De.prototype,we),$(De.prototype,me),Object.defineProperty(De.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:De}),De.__super.prototype=De.prototype,Object.defineProperty(De,"prototype",{writable:!1});var Ie=["onblocked","onupgradeneeded"];function Oe(){throw new TypeError("Illegal constructor")}Oe.prototype=Object.create(De.prototype),Object.defineProperty(Oe.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Oe});var Se=Oe;function Te(e){return e&&"function"==typeof e.then}function Ae(e,t){e.then(null,t)}Oe.__createInstance=function(){function e(){De.__super.call(this),this[Symbol.toStringTag]="IDBOpenDBRequest",this.__setOptions({legacyOutputDidListenersThrowFlag:!0,extraProperties:["oldVersion","newVersion","debug"]}),X(this,Ie)}return e.prototype=Se.prototype,new e},$(Oe.prototype,Ie),Oe.prototype[Symbol.toStringTag]="IDBOpenDBRequestPrototype",Object.defineProperty(Oe,"prototype",{writable:!1});var Ne=2,xe=0,Be=1;function Fe(e){var t=this;function n(e,n){t.v=e,t.s=n,t.c[n].forEach((function(t){t(e)})),t.c[n].length&&(t.c=null)}function r(e){t.c&&(Te(e)?Ae(e.then(r),r):n(e,Be))}t.v=0,t.s=Ne,t.c=[[],[]];try{e((function e(o){t.c&&(Te(o)?Ae(o.then(e),r):n(o,xe))}),r)}catch(e){r(e)}}function je(e,t){var n=it(e),r=it(t),o=n>r?1:n===r?0:-1;if(j.DEBUG){var i=at(n),a=at(r);"object"===h(e)&&(e=JSON.stringify(e),i=JSON.stringify(i)),"object"===h(t)&&(t=JSON.stringify(t),a=JSON.stringify(a)),i!==e&&console.warn(e+" was incorrectly encoded as "+i),a!==t&&console.warn(t+" was incorrectly encoded as "+a)}return o}Fe.prototype.then=function(e,t){var n=this;return new Fe((function(r,o){var i="function"==typeof t?t:o;function a(){try{r(e?e(n.v):n.v)}catch(e){i(e)}}n.s===xe?a():n.s===Be?i(n.v):(n.c[xe].push(a),n.c[Be].push(i))}))},Fe.prototype.catch=function(e){var t=this;return new Fe((function(n,r){function o(){try{n(e(t.v))}catch(e){r(e)}}t.s===Be?o():t.s===xe?n(t.v):(t.c[Be].push(o),t.c[xe].push(n))}))},Fe.all=function(e){return new Fe((function(t,n){var r=e.length,o=[];r?e.forEach((function(i,a){Te(i)?Ae(i.then((function(e){o[a]=e,--r||t(o)})),n):(o[a]=i,--r||t(e))})):t(o)}))},Fe.race=function(e){var t=!1;return new Fe((function(n,r){e.some((function(e,o){return Te(e)?(Ae(e.then((function(e){t||(n(e),t=!0)})),r),!1):(n(e),t=!0,!0)}))}))},Fe.resolve=function(e){return new Fe((function(t,n){t(e)}))},Fe.reject=function(e){return new Fe((function(t,n){n(e)}))};var Pe={invalid:100,number:200,date:300,string:400,binary:500,array:600},Ce=Object.keys(Pe);Ce.forEach((function(e){Pe[e]=String.fromCodePoint(Pe[e])}));var ke=Ce.reduce((function(e,t){return e[Pe[t]]=t,e}),{}),Le=["negativeInfinity","bigNegative","smallNegative","smallPositive","bigPositive","positiveInfinity"],Re={invalid:{encode:function(){return Pe.invalid+"-"},decode:function(){}},number:{encode:function(e){var t,n,r,o=e===Number.MIN_VALUE?"0."+"0".repeat(214)+"2":Math.abs(e).toString(32),i=o.indexOf("."),a=(o=-1!==i?o.replace(".",""):o).search(/(?:[\0-\/1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/);return o=o.slice(a),Number.isFinite(Number(e))?e<0?e>-1?(t=Le.indexOf("smallNegative"),n=qe(a),r=Me(Ue(o))):(t=Le.indexOf("bigNegative"),n=Me(qe(-1!==i?i:o.length)),r=Me(Ue(o))):e<1?(t=Le.indexOf("smallPositive"),n=Me(qe(a)),r=Ue(o)):(t=Le.indexOf("bigPositive"),n=qe(-1!==i?i:o.length),r=Ue(o)):(n=Ge(2),r=Ge(11),t=Le.indexOf(e>0?"positiveInfinity":"negativeInfinity")),Pe.number+"-"+t+n+r},decode:function(e){var t=Number(e.slice(2,3)),n=e.slice(3,5),r=e.slice(5,16);switch(Le[t]){case"negativeInfinity":return Number.NEGATIVE_INFINITY;case"positiveInfinity":return Number.POSITIVE_INFINITY;case"bigPositive":return Ve(r,n);case"smallPositive":return Ve(r,n=He(Me(n)));case"smallNegative":return n=He(n),-Ve(r=Me(r),n);case"bigNegative":return n=Me(n),-Ve(r=Me(r),n);default:throw new Error("Invalid number.")}}},string:{encode:function(e,t){return t&&(e=e.replaceAll(/((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))/g,"-$1")+" "),Pe.string+"-"+e},decode:function(e,t){return e=e.slice(2),t&&(e=e.slice(0,-1).replaceAll(/\x2D((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))/g,"$1")),e}},array:{encode:function(e){var t,n=[],r=i(e.entries());try{for(r.s();!(t=r.n()).done;){var o=d(t.value,2),a=o[0],u=it(o[1],!0);n[a]=u}}catch(e){r.e(e)}finally{r.f()}return n.push(Pe.invalid+"-"),Pe.array+"-"+JSON.stringify(n)},decode:function(e){var t=JSON.parse(e.slice(2));t.pop();for(var n=0;n<t.length;n++){var r=at(t[n],!0);t[n]=r}return t}},date:{encode:function(e){return Pe.date+"-"+e.toJSON()},decode:function(e){return new Date(e.slice(2))}},binary:{encode:function(e){return Pe.binary+"-"+(e.byteLength?_(Ye(e)).map((function(e){return String(e).padStart(3,"0")})):"")},decode:function(e){var t=e.slice(2),n=t.length?t.split(",").map((function(e){return Number.parseInt(e)})):[],r=new ArrayBuffer(n.length);return new Uint8Array(r).set(n),r}}};function qe(e){var t=e.toString(32);return 1===t.length?"0"+t:t}function Ue(e){return(e+Ge(11)).slice(0,11)}function Me(e){var t,n="",r=i(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;n+=(31-Number.parseInt(o,32)).toString(32)}}catch(e){r.e(e)}finally{r.f()}return n}function Ve(e,t){var n=Number.parseInt(t,32);if(n<0)return Ke(Number.parseInt(e,32)*Math.pow(32,n-10));if(n<11){var r=e.slice(0,n),o=Number.parseInt(r,32),i=e.slice(n);return Ke(o+Number.parseInt(i,32)*Math.pow(32,n-11))}var a=e+Ge(n-11);return Number.parseInt(a,32)}function Ke(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;return Number.parseFloat(e.toPrecision(t))}function Ge(e){return"0".repeat(e)}function He(e){return"-"+e}function Qe(e){if(Array.isArray(e))return"array";if(W(t=e)&&"getDate"in t&&"function"==typeof t.getDate)return"date";var t;if(function(e){return W(e)&&"byteLength"in e&&"number"==typeof e.byteLength&&("slice"in e&&"function"==typeof e.slice||"getFloat64"in e&&"function"==typeof e.getFloat64)}(e))return"binary";var n=h(e);return["string","number"].includes(n)?n:"invalid"}function We(e,t){return $e(e,t,!1,!0)}function Ye(e){var t=0,n=0;if(ArrayBuffer.isView(e)){if(void 0===e.buffer)throw new TypeError("Could not copy the bytes held by a buffer source as the buffer was undefined.");t=e.byteOffset,n=e.byteLength}else n=e.byteLength;return new Uint8Array("buffer"in e&&e.buffer||e,t,n)}function $e(e,t,n,r){if((t=t||[]).includes(e))return{type:"array",invalid:!0,message:"An array key cannot be circular"};var o=Qe(e),i={type:o,value:e};switch(o){case"number":return Number.isNaN(e)?{type:"NaN",invalid:!0}:Object.is(e,-0)?{type:o,value:0}:i;case"string":return i;case"binary":return{type:"binary",value:Ye(e)};case"array":var a=e,u=a.length;t.push(e);for(var c,s=[],l=function(){if(!n&&!Object.hasOwn(a,f))return{v:{type:o,invalid:!0,message:"Does not have own index property"}};try{var e=$e(a[f],t,!1,r);if(e.invalid)return n?0:{v:{type:o,invalid:!0,message:"Bad array entry value-to-key conversion"}};(!n||!r&&s.every((function(t){return 0!==je(t,e.value)}))||r&&s.every((function(t){return 0!==je(t,e)})))&&s.push(r?e:e.value)}catch(e){if(!n)throw e}},f=0;f<u;f++)if(0!==(c=l())&&c)return c.v;return{type:o,value:s};case"date":var d=e;return Number.isNaN(d.getTime())?{type:o,invalid:!0,message:"Not a valid date"}:r?{type:o,value:d.getTime()}:{type:o,value:new Date(d.getTime())};default:var _=null===e?"null":h(e);return{type:_,invalid:!0,message:"Not a valid key; type "+_}}}function Je(e,t){return $e(e,null,!0,t)}function Xe(e,t){var n=We(e,t);if(n.invalid)throw be("DataError",n.message||"Not a valid key; type: "+n.type);return n}function ze(e,t,n,r){var o=Ze(e,t);return o.failure?o:n?Je(o.value,r):$e(o.value,null,!1,r)}function Ze(e,t,n,r){if(Array.isArray(t)){var o=[];return t.some((function(t){var n=Ze(e,t);return!!n.failure||(o.push(n.value),!1)}))?{failure:!0}:{value:o}}return""===t?{value:e}:t.split(".").some((function(t){if("length"!==t||"string"!=typeof e&&!Array.isArray(e))if(W(n=e)&&"size"in n&&"number"==typeof n.size&&"slice"in n&&"function"==typeof n.slice&&!("lastModified"in n))switch(t){case"size":case"type":e=e[t]}else{if(!function(e){return W(e)&&"name"in e&&"string"==typeof e.name&&"slice"in e&&"function"==typeof e.slice&&"lastModified"in e}(e))return!W(e)||!Object.hasOwn(e,t)||void 0===(e=e[t]);switch(t){case"name":case"lastModified":e=e[t];break;case"lastModifiedDate":e=new Date(e.lastModified)}}else e=e.length;var n;return!1}))?{failure:!0}:{value:e}}function et(e,t,n){var r=n.split("."),o=r.pop();r.forEach((function(t){Object.hasOwn(e,t)||(e[t]={}),e=e[t]})),e[o]=t}function tt(e,t){var n=t.split(".");n.pop();var r,o=i(n);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(!W(e))return!1;if(!Object.hasOwn(e,a))return!0;e=e[a]}}catch(e){o.e(e)}finally{o.f()}return W(e)}function nt(e,t,n){var r=void 0===t.lower,o=void 0===t.upper,i=it(e,!0),a=n?t.__lowerCached:it(t.lower,!0),u=n?t.__upperCached:it(t.upper,!0);return!r&&(t.lowerOpen&&null!==i&&null!==a&&i>a||!t.lowerOpen&&(!i&&!a||null!==i&&null!==a&&i>=a))&&(r=!0),!o&&(t.upperOpen&&null!==i&&null!==u&&i<u||!t.upperOpen&&(!i&&!u||null!==i&&null!==u&&i<=u))&&(o=!0),r&&o}function rt(e,t){return"array"===ke[t.slice(0,1)]?t.indexOf(e)>1:t===e}function ot(e,t){var n=[];if(Array.isArray(e)){var r,o=i(e);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(Array.isArray(a)){if(t&&t.lower===t.upper)continue;if(1!==a.length){ot(a,t).length>0&&n.push(a);continue}a=a[0]}(ae(t)||nt(a,t,!0))&&n.push(a)}}catch(e){o.e(e)}finally{o.f()}}else(ae(t)||nt(e,t,!0))&&n.push(e);return n}function it(e,t){return void 0===e?null:Re[Qe(e)].encode(e,t)}function at(e,t){if("string"==typeof e)return Re[ke[e.slice(0,1)]].decode(e,t)}function ut(e,t){return at(it(e,t),t)}var ct=9007199254740992;function st(e,t,n,r){e.executeSql('SELECT "currNum" FROM __sys__ WHERE "name" = ?',[R(t.__currentName)],(function(e,t){1!==t.rows.length?n(1):n(t.rows.item(0).currNum)}),(function(e,t){return r(be("DataError","Could not get the auto increment value for key",t)),!1}))}function lt(e,t,n,r,o){var i='UPDATE __sys__ SET "currNum" = ? WHERE "name" = ?',a=[n,R(t.__currentName)];j.DEBUG&&console.log(i,a),e.executeSql(i,a,(function(){r(n)}),(function(e,t){return o(be("UnknownError","Could not set the auto increment value for key",t)),!1}))}function ft(e,t,n,r,o){return lt(e,t,n=n===ct?n+2:n+1,r,o)}function dt(e,t,n,r){st(e,t,(function(o){o>ct?n("failure"):ft(e,t,o,(function(){n(null,o,o)}),r)}),r)}function _t(e,t,n,r,o){"number"!=typeof n||n<1?r():st(e,t,(function(i){var a=Math.floor(Math.min(n,ct));a>=i?ft(e,t,a,(function(){r(i)}),o):r()}),o)}var pt=Object.freeze({__proto__:null,assignCurrentNumber:lt,checkKeyCouldBeInjectedIntoValue:tt,convertKeyToValue:function e(t){var n=t.type,r=t.value;switch(n){case"number":case"string":return r;case"array":for(var o=[],i=r.length,a=0;a<i;){var u=e(r[a]);o[a]=u,a++}return o;case"date":return new Date(r);case"binary":var c=r.length,s=new ArrayBuffer(c);return new Uint8Array(s,r.byteOffset||0,r.byteLength).set(r),s;default:throw new Error("Bad key")}},convertValueToKey:We,convertValueToKeyRethrowingAndIfInvalid:Xe,convertValueToKeyValueDecoded:$e,convertValueToMultiEntryKey:function(e){return $e(e,null,!0,!0)},convertValueToMultiEntryKeyDecoded:Je,decode:at,encode:it,evaluateKeyPathOnValue:function(e,t,n){return Ze(e,t)},extractKeyFromValueUsingKeyPath:function(e,t,n){return ze(e,t,n,!0)},extractKeyValueDecodedFromValueUsingKeyPath:ze,findMultiEntryMatches:ot,generateKeyForStore:dt,injectKeyIntoValueUsingKeyPath:et,isKeyInRange:nt,isMultiEntryMatch:rt,possiblyUpdateKeyGenerator:_t,roundTrip:ut});function ht(){throw this.__lowerOpen=!1,this.__upperOpen=!1,new TypeError("Illegal constructor")}var yt=ht;function vt(e,t,n,r,o,i){if(e&&(void 0!==e.lower||void 0!==e.upper)){var a,u;o&&n.push("AND");var c=void 0!==e.lower,s=void 0!==e.upper;if(c&&(a=i?e.__lowerCached:it(e.lower)),s&&(u=i?e.__upperCached:it(e.upper)),c){if(r.push(R(a)),s&&a===u&&!e.lowerOpen&&!e.upperOpen)return void n.push(t,"=","?");n.push(t,e.lowerOpen?">":">=","?")}c&&s&&n.push("AND"),s&&(n.push(t,e.upperOpen?"<":"<=","?"),r.push(R(u)))}}function bt(e,t){if(Q(e,ht))return"[object IDBKeyRange]"!==e.toString()?ht.__createInstance(e.lower,e.upper,e.lowerOpen,e.upperOpen):e;if(!ae(e))return Xe(e),ht.only(e);if(t)throw be("DataError","No key or range was specified")}ht.__createInstance=function(e,t,n,r){function o(){if(this[Symbol.toStringTag]="IDBKeyRange",void 0===e&&void 0===t)throw be("DataError","Both arguments to the key range method cannot be undefined");var o,i;if(void 0!==e&&(o=ut(e),Xe(e)),void 0!==t&&(i=ut(t),Xe(t)),void 0!==e&&void 0!==t&&e!==t&&it(e)>it(t))throw be("DataError","`lower` must not be greater than `upper` argument in `bound()` call.");this.__lower=o,this.__upper=i,this.__lowerOpen=Boolean(n),this.__upperOpen=Boolean(r)}return o.prototype=yt.prototype,new o},ht.prototype.includes=function(e){if(!W(this)||"boolean"!=typeof this.__lowerOpen)throw new TypeError("Illegal invocation");if(!arguments.length)throw new TypeError("IDBKeyRange.includes requires a key argument");return Xe(e),nt(e,this)},ht.only=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.only requires a value argument");return ht.__createInstance(e,e,!1,!1)},ht.lowerBound=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.lowerBound requires a value argument");return ht.__createInstance(e,void 0,arguments[1],!0)},ht.upperBound=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.upperBound requires a value argument");return ht.__createInstance(void 0,e,!0,arguments[1])},ht.bound=function(e,t){if(arguments.length<=1)throw new TypeError("IDBKeyRange.bound requires lower and upper arguments");return ht.__createInstance(e,t,arguments[2],arguments[3])},ht.prototype[Symbol.toStringTag]="IDBKeyRangePrototype",["lower","upper","lowerOpen","upperOpen"].forEach((function(e){Object.defineProperty(ht.prototype,"__"+e,{enumerable:!1,configurable:!1,writable:!0});var t=a("get",{},e,(function(){if(!W(this)||"boolean"!=typeof this.__lowerOpen)throw new TypeError("Illegal invocation");return this["__"+e]})),n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(ht.prototype,e,n)})),Object.defineProperty(ht,Symbol.hasInstance,{value:function(e){return W(e)&&"upper"in e&&"lowerOpen"in e&&"boolean"==typeof e.lowerOpen}}),Object.defineProperty(ht,"prototype",{writable:!1});var gt=!1,mt={test:!0};if(Object.defineProperty)try{Object.defineProperty(mt,"test",{enumerable:!1}),mt.test&&(gt=!0)}catch(e){}var Et=function(){throw this._items=[],this._length=0,new TypeError("Illegal constructor")};Et.prototype=u(u({constructor:Et,contains:function(e){if(!arguments.length)throw new TypeError("DOMStringList.contains must be supplied a value");return this._items.includes(e)},item:function(e){if(!arguments.length)throw new TypeError("DOMStringList.item must be supplied a value");return e<0||e>=this.length||!Number.isInteger(e)?null:this._items[e]},clone:function(){var e=Et.__createInstance();return e._items=this._items.slice(),e._length=this.length,e.addIndexes(),e},addIndexes:function(){for(var e=0;e<this._items.length;e++)this[e]=this._items[e]},sortList:function(){return this._items.sort(),this.addIndexes(),this._items},forEach:function(e,t){this._items.forEach(e,t)},map:function(e,t){return this._items.map(e,t)},indexOf:function(e){return this._items.indexOf(e)},push:function(e){this._items.push(e),this._length++,this.sortList()},splice:function(){var e;for(var t in(e=this._items).splice.apply(e,arguments),this._length=this._items.length,this)t===String(Number.parseInt(t))&&delete this[t];this.sortList()}},Symbol.toStringTag,"DOMStringListPrototype"),Symbol.iterator,f().mark((function e(){var t;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t<this._items.length)){e.next=6;break}return e.next=4,this._items[t++];case 4:e.next=1;break;case 6:case"end":return e.stop()}}),e,this)}))),Object.defineProperty(Et,Symbol.hasInstance,{value:function(e){return"DOMStringListPrototype"===Object.prototype.toString.call(e)}});var wt=Et;if(Object.defineProperty(Et,"__createInstance",{value:function(){var e=function(){this.toString=function(){return"[object DOMStringList]"},Object.defineProperty(this,"length",{enumerable:!0,get:function(){return this._length}}),this._items=[],this._length=0};return e.prototype=wt.prototype,new e}}),gt){Object.defineProperty(Et,"prototype",{writable:!1});["addIndexes","sortList","forEach","map","indexOf","push","splice","constructor","__createInstance"].forEach((function(e){Object.defineProperty(Et.prototype,e,{enumerable:!1})})),Object.defineProperty(Et.prototype,"length",{configurable:!0,enumerable:!0,get:function(){throw new TypeError("Illegal invocation")}});["_items","_length"].forEach((function(e){Object.defineProperty(Et.prototype,e,{enumerable:!1,writable:!0})}))}var Dt=0,It=["onabort","oncomplete","onerror"],Ot=["objectStoreNames","mode","db","error"];function St(){throw new TypeError("Illegal constructor")}var Tt=St;function At(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?At(Object(n),!0).forEach((function(t){jt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):At(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xt(e){return xt="function"==typeof Symbol&&"symbol"==h(Symbol.iterator)?function(e){return h(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":h(e)},xt(e)}function Bt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ft(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Lt(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function jt(e,t,n){return(t=Lt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(e,t)||Ct(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ct(e,t){if(e){if("string"==typeof e)return kt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kt(e,t):void 0}}function kt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Lt(e){var t=function(e,t){if("object"!=h(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==h(t)?t:String(t)}St.__createInstance=function(e,t,n){function r(){var r=this,o=this;o[Symbol.toStringTag]="IDBTransaction",z(o,Ot),o.__id=++Dt,o.__active=!0,o.__running=!1,o.__errored=!1,o.__requests=[],o.__objectStoreNames=t,o.__mode=n,o.__db=e,o.__error=null,o.__setOptions({legacyOutputDidListenersThrowFlag:!0}),Ot.forEach((function(e){Object.defineProperty(r,e,{configurable:!0})})),X(this,It),o.__storeHandles={},setTimeout((function(){o.__executeRequests()}),0)}return r.prototype=Tt.prototype,new r},St.prototype=B.createInstance({defaultSync:!0,extraProperties:["complete"]}),St.prototype.__transFinishedCb=function(e,t){t(Boolean(e))},St.prototype.__executeRequests=function(){var e=this;e.__running?j.DEBUG&&console.log("Looks like the request set is already running",e.mode):(e.__running=!0,e.db.__db["readonly"===e.mode?"readTransaction":"transaction"]((function(t){e.__tx=t;var n,r=-1;function o(t,r){if(!e.__errored&&!e.__requestsFinished&&(r&&(n.req=r),n.req&&!n.req.__done)){n.req.__done=!0,n.req.__result=t,n.req.__error=null,e.__active=!0;var o=ue("success");if(n.req.dispatchEvent(o),o.__legacyOutputDidListenersThrowError)return _e("Error","An error occurred in a success handler attached to request chain",o.__legacyOutputDidListenersThrowError),void e.__abortTransaction(be("AbortError","A request was aborted (in user handler after success)."));u()}}function a(){if(!(e.__errored||e.__requestsFinished||n.req&&n.req.__done)){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var a=function(e){var t;if(e){if(1===e.length)return e[0];var n,r=i(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(pe(o))return o;o&&"string"==typeof o.message&&(t=o)}}catch(t){r.e(t)}finally{r.f()}}return t}(r);if(n.req){n.req.__done=!0,n.req.__error=a,n.req.__result=void 0,n.req.addLateEventListener("error",(function(e){e.cancelable&&e.defaultPrevented&&!e.__legacyOutputDidListenersThrowError&&u()})),n.req.addDefaultEventListener("error",(function(){n.req&&e.__abortTransaction(n.req.__error)})),e.__active=!0;var c=ue("error",a,{bubbles:!0,cancelable:!0});n.req.dispatchEvent(c),c.__legacyOutputDidListenersThrowError&&(_e("Error","An error occurred in an error handler attached to request chain",c.__legacyOutputDidListenersThrowError),c.preventDefault(),e.__abortTransaction(be("AbortError","A request was aborted (in user handler after error).")))}else e.__abortTransaction(a)}}function u(){if(!e.__errored&&!e.__requestsFinished)if(++r>=e.__requests.length)e.__requests=[],e.__active&&function(){function t(){e.__completed=!0,j.DEBUG&&console.log("Transaction completed");var t=ue("complete");try{e.__internal=!0,e.dispatchEvent(t),e.__internal=!1,e.dispatchEvent(ue("__complete"))}catch(t){throw e.__internal=!1,e.__errored=!0,t}finally{e.__storeHandles={}}}if(e.__active=!1,e.__requestsFinished=!0,"readwrite"===e.mode)return e.__transactionFinished?void t():void(e.__transactionEndCallback=t);if("readonly"===e.mode)return void t();var n=ue("__beforecomplete");n.complete=t,e.dispatchEvent(n)}();else try{if(!(n=e.__requests[r]).req)return void n.op(t,n.args,u,a);if(n.req.__done)return;n.op(t,n.args,o,a,u)}catch(e){a(e)}}u()}),(function(t){if(!0!==t){var n=he(t);e.__abortTransaction(n)}}),(function(){e.__transFinishedCb===St.prototype.__transFinishedCb&&(e.__transactionEndCallback||e.__requestsFinished?e.__transactionEndCallback&&!e.__completed&&e.__transFinishedCb(e.__errored,e.__transactionEndCallback):e.__transactionFinished=!0)}),(function(t,n,r,o,i){return!(!t.readOnly&&!n)||(e.__transFinishedCb=function(e,t){e?o(e,t):i(t)},e.__transactionEndCallback&&!e.__completed&&e.__transFinishedCb(e.__errored,e.__transactionEndCallback),!1)})))},St.prototype.__createRequest=function(e){var t=De.__createInstance();return t.__source=void 0!==e?e:this.db,t.__transaction=this,t},St.prototype.__addToTransactionQueue=function(e,t,n){var r=this.__createRequest(n);return this.__pushToQueue(r,e,t),r},St.prototype.__addNonRequestToTransactionQueue=function(e,t){this.__pushToQueue(null,e,t)},St.prototype.__pushToQueue=function(e,t,n){this.__assertActive(),this.__requests.push({op:t,args:n,req:e})},St.prototype.__assertActive=function(){if(!this.__active)throw be("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished")},St.prototype.__assertWritable=function(){if("readonly"===this.mode)throw be("ReadOnlyError","The transaction is read only")},St.prototype.__assertVersionChange=function(){St.__assertVersionChange(this)},St.prototype.objectStore=function(e){var t=this;if(!(t instanceof St))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");if(St.__assertNotFinished(t),-1===t.__objectStoreNames.indexOf(e))throw be("NotFoundError",e+" is not participating in this transaction");var n=t.db.__objectStores[e];if(!n)throw be("NotFoundError",e+" does not exist in "+t.db.name);return(!t.__storeHandles[e]||t.__storeHandles[e].__pendingDelete||t.__storeHandles[e].__deleted)&&(t.__storeHandles[e]=lr.__clone(n,t)),t.__storeHandles[e]},St.prototype.__abortTransaction=function(e){var t=this;function n(n,r){n?r&&"code"in r&&"number"==typeof r.code?j.DEBUG&&console.log("Rollback erred; feature is probably not supported as per WebSQL",t):j.DEBUG&&console.log("Rollback succeeded",t):j.DEBUG&&console.log("Rollback not possible due to missing transaction",t),t.dispatchEvent(ue("__preabort")),t.__requests.filter((function(e,t,n){return e.req&&!e.req.__done&&[t,-1].includes(n.map((function(e){return e.req})).lastIndexOf(e.req))})).reduce((function(e,t){return e.then((function(){if(!t.req)throw new Error("Missing request");t.req.__done=!0,t.req.__result=void 0,t.req.__error=be("AbortError","A request was aborted (an unfinished request).");var e=ue("error",t.req.__error,{bubbles:!0,cancelable:!0});return new Fe((function(n){setTimeout((function(){if(!t.req)throw new Error("Missing request");t.req.dispatchEvent(e),n()}))}))}))}),Fe.resolve(void 0)).then((function(){var n=ue("abort",e,{bubbles:!0,cancelable:!1});setTimeout((function(){t.__abortFinished=!0,t.dispatchEvent(n),t.__storeHandles={},t.dispatchEvent(ue("__abort"))}))})).catch((function(e){throw console.log("Abort error"),e}))}_e("Error","An error occurred in a transaction",e),t.__errored||(t.__errored=!0,"versionchange"===t.mode&&(t.db.__version=t.db.__oldVersion,t.db.__objectStoreNames=t.db.__oldObjectStoreNames,t.__objectStoreNames=t.db.__oldObjectStoreNames,Object.values(t.db.__objectStores).concat(Object.values(t.__storeHandles)).forEach((function(e){"__pendingName"in e&&t.db.__oldObjectStoreNames.indexOf(e.__pendingName)>-1&&(e.__name=e.__originalName),e.__indexNames=e.__oldIndexNames,delete e.__pendingDelete,Object.values(e.__indexes).concat(Object.values(e.__indexHandles)).forEach((function(t){"__pendingName"in t&&e.__oldIndexNames.indexOf(t.__pendingName)>-1&&(t.__name=t.__originalName),delete t.__pendingDelete}))}))),t.__active=!1,null!==e&&(t.__error=e),t.__requestsFinished&&setTimeout((function(){throw e}),0),t.__transFinishedCb(!0,(function(e){if(e&&t.__tx){if("readwrite"===t.mode)return t.__transactionFinished?void n():void(t.__transactionEndCallback=n);try{t.__tx.executeSql("ROLLBACK",[],n,n)}catch(e){n()}}else n(null,{code:0})})))},St.prototype.abort=function(){var e=this;if(!(e instanceof St))throw new TypeError("Illegal invocation");j.DEBUG&&console.log("The transaction was aborted",e),St.__assertNotFinished(e),e.__abortTransaction(null)},St.prototype[Symbol.toStringTag]="IDBTransactionPrototype",St.__assertVersionChange=function(e){if(!e||"versionchange"!==e.mode)throw be("InvalidStateError","Not a version transaction")},St.__assertNotVersionChange=function(e){if(e&&"versionchange"===e.mode)throw be("InvalidStateError","Cannot be called during a version transaction")},St.__assertNotFinished=function(e){if(!e||e.__completed||e.__abortFinished||e.__errored)throw be("InvalidStateError","Transaction finished by commit or abort")},St.__assertNotFinishedObjectStoreMethod=function(e){try{St.__assertNotFinished(e)}catch(t){if(e&&!e.__completed&&!e.__abortFinished)throw be("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished");throw t}},St.__assertActive=function(e){if(!e||!e.__active)throw be("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished")},St.prototype.__getParent=function(){return this.db},$(St.prototype,It),J(St.prototype,Ot),Object.defineProperty(St.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:St}),Object.defineProperty(St,"prototype",{writable:!1});var Rt=Ft((function e(t){Bt(this,e),this.p=new Promise(t)}));Rt.__typeson__type__="TypesonPromise","undefined"!=typeof Symbol&&Object.defineProperty(Rt.prototype,Symbol.toStringTag,{get:function(){return"TypesonPromise"}}),Rt.prototype.then=function(e,t){var n=this;return new Rt((function(r,o){n.p.then((function(t){r(e?e(t):t)})).catch((function(e){return t?t(e):Promise.reject(e)})).then(r,o)}))},Rt.prototype.catch=function(e){return this.then((function(){}),e)},Rt.resolve=function(e){return new Rt((function(t){t(e)}))},Rt.reject=function(e){return new Rt((function(t,n){n(e)}))},Rt.all=function(e){return new Rt((function(t,n){Promise.all(e.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(t,n)}))},Rt.race=function(e){return new Rt((function(t,n){Promise.race(e.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(t,n)}))},Rt.allSettled=function(e){return new Rt((function(t,n){Promise.allSettled(e.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(t,n)}))};var qt=Object.hasOwn,Ut=Object.getPrototypeOf;function Mt(e,t){return Qt(e)&&"function"==typeof e.then&&!t}function Vt(e){return Object.prototype.toString.call(e).slice(8,-1)}function Kt(e,t){if(!e||"object"!==xt(e))return!1;var n=Ut(e);if(!n)return null===t;var r=qt(n,"constructor")&&n.constructor;return"function"!=typeof r?null===t:t===r||null!==t&&Function.prototype.toString.call(r)===Function.prototype.toString.call(t)||"function"==typeof t&&"string"==typeof r.__typeson__type__&&r.__typeson__type__===t.__typeson__type__}function Gt(e){return!(!e||"Object"!==Vt(e))&&(!Ut(e)||Kt(e,Object))}function Ht(e){if(!e||"Object"!==Vt(e))return!1;var t=Ut(e);return!t||Kt(e,Object)||Ht(t)}function Qt(e){return null!==e&&"object"===xt(e)}function Wt(e){return e.replaceAll("''","''''").replace(/^$/,"''").replaceAll("~","~0").replaceAll(".","~1")}function Yt(e){return e.replaceAll("~1",".").replaceAll("~0","~").replace(/^''$/,"").replaceAll("''''","''")}function $t(e,t){if(""===t)return e;if(null===e||"object"!==xt(e))throw new TypeError("Unexpected non-object type");var n=t.indexOf(".");if(n>-1){var r=e[Yt(t.slice(0,n))];return void 0===r?void 0:$t(r,t.slice(n+1))}return e[Yt(t)]}function Jt(e,t,n){if(""===t)return n;if(!e||"object"!==xt(e))throw new TypeError("Unexpected non-object type");var r=t.indexOf(".");return r>-1?Jt(e[Yt(t.slice(0,r))],t.slice(r+1),n):(e[Yt(t)]=n,e)}function Xt(e){return null===e?"null":Array.isArray(e)?"array":xt(e)}function zt(e,t,n){return e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e}var Zt=Object.keys,en=Object.hasOwn,tn=Array.isArray,nn=["type","replaced","iterateIn","iterateUnsetNumeric","addLength"];function rn(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function on(e,t){var n,r;if(""===e.keypath)return-1;var o=null!==(n=e.keypath.match(/\./g))&&void 0!==n?n:0,i=null!==(r=t.keypath.match(/\./g))&&void 0!==r?r:0;return o&&(o=o.length),i&&(i=i.length),o>i?-1:o<i?1:e.keypath<t.keypath?-1:e.keypath>t.keypath?1:0}var an=function(){function e(t){Bt(this,e),this.options=t,this.plainObjectReplacers=[],this.nonplainObjectReplacers=[],this.revivers={},this.types={}}return Ft(e,[{key:"stringify",value:function(e,t,n,r){r=Nt(Nt(Nt({},this.options),r),{},{stringification:!0});var o=this.encapsulate(e,null,r);return tn(o)?JSON.stringify(o[0],t,n):o.then((function(e){return JSON.stringify(e,t,n)}))}},{key:"stringifySync",value:function(e,t,n,r){return this.stringify(e,t,n,Nt(Nt({throwOnBadSyncType:!0},r),{},{sync:!0}))}},{key:"stringifyAsync",value:function(e,t,n,r){return this.stringify(e,t,n,Nt(Nt({throwOnBadSyncType:!0},r),{},{sync:!1}))}},{key:"parse",value:function(e,t,n){return n=Nt(Nt(Nt({},this.options),n),{},{parse:!0}),this.revive(JSON.parse(e,t),n)}},{key:"parseSync",value:function(e,t,n){return this.parse(e,t,Nt(Nt({throwOnBadSyncType:!0},n),{},{sync:!0}))}},{key:"parseAsync",value:function(e,t,n){return this.parse(e,t,Nt(Nt({throwOnBadSyncType:!0},n),{},{sync:!1}))}},{key:"specialTypeNames",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.returnTypeNames=!0,this.encapsulate(e,t,n)}},{key:"rootTypeName",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.iterateNone=!0,this.encapsulate(e,t,n)}},{key:"encapsulate",value:function(e,t,n){var r=this,o=Nt(Nt({sync:!0},this.options),n),i=o.sync,a={},u=[],c=[],s=[],l=!("cyclic"in o)||o.cyclic,f=o.encapsulateObserver,d=function(e){var t=Object.values(a);if(o.iterateNone)return t.length?t[0]:Xt(e);if(t.length){if(o.returnTypeNames)return function(e){return function(e){if(Array.isArray(e))return kt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ct(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(new Set(t));e&&Gt(e)&&!en(e,"$types")?e.$types=a:e={$:e,$types:{$:a}}}else Qt(e)&&en(e,"$types")&&(e={$:e,$types:!0});return!o.returnTypeNames&&e},_=rn((function(e,t){return zt(Promise.all(t.map((function(e){return e[1].p}))),(function(n){return zt(Promise.all(n.map(rn((function(n){var r=!1,o=[],i=Pt(t.splice(0,1),1),a=Pt(i[0],7),u=a[0],c=a[2],s=a[3],l=a[4],f=a[5],d=a[6],p=h(u,n,c,s,o,!0,d),y=Kt(p,Rt);return function(e,t){var n=e();return n&&n.then?n.then(t):t(n)}((function(){if(u&&y)return zt(p.p,(function(t){l[f]=t;var n=_(e,o);return r=!0,n}))}),(function(t){return r?t:(u?l[f]=p:e=y?p.p:p,_(e,o))}))})))),(function(){return e}))}))})),p=function(e,t,n){Object.assign(e,t);var r=nn.map((function(t){var n=e[t];return delete e[t],n}));n(),nn.forEach((function(t,n){e[t]=r[n]}))},h=function e(t,n,i,s,l,d,_){var h,v={},b=xt(n),g=f?function(e){var r,o=null!==(r=null!=_?_:s.type)&&void 0!==r?r:Xt(n);f(Object.assign(null!=e?e:v,{keypath:t,value:n,cyclic:i,stateObj:s,promisesData:l,resolvingTypesonPromise:d,awaitingTypesonPromise:Kt(n,Rt)},{type:o}))}:null;if(["string","boolean","number","undefined"].includes(b))return void 0===n||Number.isNaN(n)||n===Number.NEGATIVE_INFINITY||n===Number.POSITIVE_INFINITY||0===n?(h=s.replaced?n:y(t,n,s,l,!1,d,g))!==n&&(v={replaced:h}):h=n,g&&g(),h;if(null===n)return g&&g(),n;if(i&&!s.iterateIn&&!s.iterateUnsetNumeric&&n&&"object"===xt(n)){var m=u.indexOf(n);if(!(m<0))return a[t]="#",g&&g({cyclicKeypath:c[m]}),"#"+c[m];!0===i&&(u.push(n),c.push(t))}var E,w,D=Gt(n),I=tn(n),O=(D||I)&&(!r.plainObjectReplacers.length||s.replaced)||s.iterateIn?n:y(t,n,s,l,D||I,null,g);if(O!==n?(h=O,v={replaced:O}):""===t&&Kt(n,Rt)?(l.push([t,n,i,s,void 0,void 0,s.type]),h=n):I&&"object"!==s.iterateIn||"array"===s.iterateIn?(E=new Array(n.length),v={clone:E}):(["function","symbol"].includes(xt(n))||"toJSON"in n||Kt(n,Rt)||Kt(n,Promise)||Kt(n,ArrayBuffer))&&!D&&"object"!==s.iterateIn?h=n:(E={},s.addLength&&(E.length=n.length),v={clone:E}),g&&g(),o.iterateNone)return null!==(w=E)&&void 0!==w?w:h;if(!E)return h;if(s.iterateIn){var S=function(r){var o={ownKeys:en(n,r)};p(s,o,(function(){var o=t+(t?".":"")+Wt(r),a=e(o,n[r],Boolean(i),s,l,d);Kt(a,Rt)?l.push([o,a,Boolean(i),s,E,r,s.type]):void 0!==a&&(E[r]=a)}))};for(var T in n)S(T);g&&g({endIterateIn:!0,end:!0})}else Zt(n).forEach((function(r){var o=t+(t?".":"")+Wt(r);p(s,{ownKeys:!0},(function(){var t=e(o,n[r],Boolean(i),s,l,d);Kt(t,Rt)?l.push([o,t,Boolean(i),s,E,r,s.type]):void 0!==t&&(E[r]=t)}))})),g&&g({endIterateOwn:!0,end:!0});if(s.iterateUnsetNumeric){for(var A=n.length,N=function(r){if(!(r in n)){var o="".concat(t).concat(t?".":"").concat(r);p(s,{ownKeys:!1},(function(){var t=e(o,void 0,Boolean(i),s,l,d);Kt(t,Rt)?l.push([o,t,Boolean(i),s,E,r,s.type]):void 0!==t&&(E[r]=t)}))}},x=0;x<A;x++)N(x);g&&g({endIterateUnsetNumeric:!0,end:!0})}return E},y=function(e,t,n,o,u,c,s){for(var f=u?r.plainObjectReplacers:r.nonplainObjectReplacers,d=f.length;d--;){var _=f[d];if(_.test(t,n)){var p=_.type;if(r.revivers[p]){var y=a[e];a[e]=y?[p].concat(y):p}if(Object.assign(n,{type:p,replaced:!0}),(i||!_.replaceAsync)&&!_.replace)return s&&s({typeDetected:!0}),h(e,t,l&&"readonly",n,o,c,p);s&&s({replacing:!0});var v=void 0;if(i||!_.replaceAsync){if(void 0===_.replace)throw new TypeError("Missing replacer");v=_.replace(t,n)}else v=_.replaceAsync(t,n);return h(e,v,l&&"readonly",n,o,c,p)}}return t},v=h("",e,l,null!=t?t:{},s);if(s.length)return i&&o.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Promise.resolve(_(v,s)).then(d);if(!i&&o.throwOnBadSyncType)throw new TypeError("Async method requested but sync result obtained");return o.stringification&&i?[d(v)]:i?d(v):Promise.resolve(d(v))}},{key:"encapsulateSync",value:function(e,t,n){return this.encapsulate(e,t,Nt(Nt({throwOnBadSyncType:!0},n),{},{sync:!0}))}},{key:"encapsulateAsync",value:function(e,t,n){return this.encapsulate(e,t,Nt(Nt({throwOnBadSyncType:!0},n),{},{sync:!1}))}},{key:"revive",value:function(e,t){var n=this,r=Nt(Nt({sync:!0},this.options),t),o=r.sync;function i(e){if(o)return e;if(r.throwOnBadSyncType)throw new TypeError("Async method requested but sync result obtained");return Promise.resolve(e)}if(!e||"object"!==xt(e)||Array.isArray(e))return i(e);var a=e.$types;if(!0===a)return i(e.$);if(!a||"object"!==xt(a)||Array.isArray(a))return i(e);var u=[],c={},s=!0;a.$&&Gt(a.$)&&(e=e.$,a=a.$,s=!1);var l=function(e,t){var r,i=Pt(null!==(r=n.revivers[e])&&void 0!==r?r:[],1)[0];if(!i)throw new Error("Unregistered type: "+e);if(o&&!("revive"in i))return t;if(!o&&i.reviveAsync)return i.reviveAsync(t,c);if(i.revive)return i.revive(t,c);throw new Error("Missing reviver")},f=[];function d(e){return Kt(e,un)?void 0:e}var _,p=function(){var t=[];if(!a)throw new Error("Found bad `types`");if(Object.entries(a).forEach((function(e){var r=Pt(e,2),o=r[0],i=r[1];"#"!==i&&[].concat(i).forEach((function(e){var r;Pt(null!==(r=n.revivers[e])&&void 0!==r?r:[null,{}],2)[1].plain&&(t.push({keypath:o,type:e}),delete a[o])}))})),t.length)return t.sort(on).reduce((function t(n,r){var o=r.keypath,i=r.type;if(Mt(n))return n.then((function(e){return t(e,{keypath:o,type:i})}));var a=$t(e,o);if(Kt(a=l(i,a),Rt))return a.then((function(t){var n=Jt(e,o,t);n===t&&(e=n)}));var u=Jt(e,o,a);u===a&&(e=u)}),void 0)}();return Kt(p,Rt)?_=p.then((function(){return e})):(_=function e(t,n,r,o,i){if(!s||"$types"!==t){var c=a[t],d=tn(n);if(d||Gt(n)){var _=d?new Array(n.length):{};for(Zt(n).forEach((function(o){var i=e(t+(t?".":"")+Wt(o),n[o],null!=r?r:_,_,o),a=function(e){return Kt(e,un)?_[o]=void 0:void 0!==e&&(_[o]=e),e};Kt(i,Rt)?f.push(i.then((function(e){return a(e)}))):a(i)})),n=_;u.length;){var p=Pt(u[0],4),h=p[0],y=p[1],v=p[2],b=p[3],g=$t(h,y);if(void 0===g)break;v[b]=g,u.splice(0,1)}}if(!c)return n;if("#"===c){var m=$t(r,n.slice(1));return void 0===m&&u.push([r,n.slice(1),o,i]),m}return[].concat(c).reduce((function e(t,n){if(Kt(t,Rt))return t.then((function(t){return e(t,n)}));if("string"!=typeof n)throw new TypeError("Bad type JSON");return l(n,t)}),n)}}("",e,null),f.length&&(_=Rt.resolve(_).then((function(e){return Rt.all([e].concat(f))})).then((function(e){return Pt(e,1)[0]})))),Mt(_)?o&&r.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Kt(_,Rt)?_.p.then(d):_:!o&&r.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():o?d(_):Promise.resolve(d(_))}},{key:"reviveSync",value:function(e,t){return this.revive(e,Nt(Nt({throwOnBadSyncType:!0},t),{},{sync:!0}))}},{key:"reviveAsync",value:function(e,t){return this.revive(e,Nt(Nt({throwOnBadSyncType:!0},t),{},{sync:!1}))}},{key:"register",value:function(e,t){var n=this,r=null!=t?t:{},o=function e(t){tn(t)?t.forEach((function(t){return e(t)})):Zt(t).forEach((function(e){var o;if("#"===e)throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");if(cn.includes(e))throw new TypeError("Plain JSON object types are reserved as type names");var i=t[e],a=i&&"function"!=typeof i&&!Array.isArray(i)&&i.testPlainObjects?n.plainObjectReplacers:n.nonplainObjectReplacers,u=a.filter((function(t){return t.type===e}));if(u.length&&(a.splice(a.indexOf(u[0]),1),delete n.revivers[e],delete n.types[e]),"function"==typeof i){var c=i;i={test:function(e){return e&&e.constructor===c},replace:function(e){return Nt({},e)},revive:function(e){return Object.assign(Object.create(c.prototype),e)}}}else if(tn(i)){var s=Pt(i,3);i={test:s[0],replace:s[1],revive:s[2]}}if(null!==(o=i)&&void 0!==o&&o.test){var l={type:e,test:i.test.bind(i)};i.replace&&(l.replace=i.replace.bind(i)),i.replaceAsync&&(l.replaceAsync=i.replaceAsync.bind(i));var f="number"==typeof r.fallback?r.fallback:r.fallback?0:Number.POSITIVE_INFINITY;if(i.testPlainObjects?n.plainObjectReplacers.splice(f,0,l):n.nonplainObjectReplacers.splice(f,0,l),i.revive||i.reviveAsync){var d={};i.revive&&(d.revive=i.revive.bind(i)),i.reviveAsync&&(d.reviveAsync=i.reviveAsync.bind(i)),n.revivers[e]=[d,{plain:i.testPlainObjects}]}n.types[e]=i}}))};return[].concat(e).forEach((function(e){return o(e)})),this}}]),e}(),un=Ft((function e(){Bt(this,e)}));un.__typeson__type__="TypesonUndefined";for(var cn=["null","boolean","number","string","array","object"],sn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ln=new Uint8Array(256),fn=0;fn<64;fn++)ln[sn.codePointAt(fn)]=fn;var dn=function(e,t,n){null==n&&(n=e.byteLength);for(var r=new Uint8Array(e,0,n),o=r.length,i="",a=0;a<o;a+=3)i+=sn[r[a]>>2],i+=sn[(3&r[a])<<4|r[a+1]>>4],i+=sn[(15&r[a+1])<<2|r[a+2]>>6],i+=sn[63&r[a+2]];return o%3==2?i=i.slice(0,-1)+"=":o%3==1&&(i=i.slice(0,-2)+"=="),i},_n=function(e,t){var n=e.length;if(n%4)throw new Error("Bad base64 length: not divisible by four");var r,o,i,a,u=.75*e.length,c=0;"="===e[e.length-1]&&(u--,"="===e[e.length-2]&&u--);for(var s=new ArrayBuffer(u,t),l=new Uint8Array(s),f=0;f<n;f+=4)r=ln[e.codePointAt(f)],o=ln[e.codePointAt(f+1)],i=ln[e.codePointAt(f+2)],a=ln[e.codePointAt(f+3)],l[c++]=r<<2|o>>4,l[c++]=(15&o)<<4|i>>2,l[c++]=(3&i)<<6|63&a;return s},pn={arraybuffer:{test:function(e){return"ArrayBuffer"===Vt(e)},replace:function(e,t){t.buffers||(t.buffers=[]);var n=t.buffers.indexOf(e);return n>-1?{index:n}:(t.buffers.push(e),{s:dn(e),maxByteLength:e.maxByteLength})},revive:function(e,t){if(t.buffers||(t.buffers=[]),Object.hasOwn(e,"index"))return t.buffers[e.index];var n=_n(e.s,{maxByteLength:e.maxByteLength});return t.buffers.push(n),n}}},hn={bigintObject:{test:function(e){return"object"==h(e)&&Kt(e,BigInt)},replace:String,revive:function(e){return new Object(BigInt(e))}}},yn={bigint:{test:function(e){return"bigint"==typeof e},replace:String,revive:function(e){return BigInt(e)}}};function vn(e){return new Uint8Array(e).reduce((function(e,t){return e+String.fromCodePoint(t)}),"")}function bn(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer}var gn={blob:{test:function(e){return"Blob"===Vt(e)},replace:function(e){var t=new XMLHttpRequest;if(t.overrideMimeType("text/plain; charset=x-user-defined"),t.open("GET",URL.createObjectURL(e),!1),t.send(),200!==t.status&&0!==t.status)throw new Error("Bad Blob access: "+t.status);return{type:e.type,stringContents:t.responseText}},revive:function(e){var t=e.type,n=e.stringContents;return new Blob([bn(n)],{type:t})},replaceAsync:function(e){return new Rt((function(t,n){var r=new FileReader;r.addEventListener("load",(function(){t({type:e.type,stringContents:vn(r.result)})})),r.addEventListener("error",(function(){n(r.error)})),r.readAsArrayBuffer(e)}))}}},mn={cryptokey:{test:function(e){return"CryptoKey"===Vt(e)&&e.extractable},replaceAsync:function(e){return new Rt(function(){var t=n(f().mark((function t(n,r){var o;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,crypto.subtle.exportKey("jwk",e);case 3:o=t.sent,t.next=9;break;case 6:return t.prev=6,t.t0=t.catch(0),t.abrupt("return",void r(t.t0));case 9:n({jwk:o,algorithm:e.algorithm,usages:e.usages});case 10:case"end":return t.stop()}}),t,null,[[0,6]])})));return function(e,n){return t.apply(this,arguments)}}())},revive:function(e){var t=e.jwk,n=e.algorithm,r=e.usages;return crypto.subtle.importKey("jwk",t,n,!0,r)}}},En={dataview:{test:function(e){return"DataView"===Vt(e)},replace:function(e,t){var n=e.buffer,r=e.byteOffset,o=e.byteLength;t.buffers||(t.buffers=[]);var i=t.buffers.indexOf(n);return i>-1?{index:i,byteOffset:r,byteLength:o}:(t.buffers.push(n),{encoded:dn(n),maxByteLength:n.maxByteLength,byteOffset:r,byteLength:o})},revive:function(e,t){t.buffers||(t.buffers=[]);var n,r=e.byteOffset,o=e.byteLength,i=e.encoded,a=e.index,u=e.maxByteLength;return"index"in e?n=t.buffers[a]:(n=_n(i,void 0===u?u:{maxByteLength:u}),t.buffers.push(n)),new DataView(n,r,o)}}},wn={date:{test:function(e){return"Date"===Vt(e)},replace:function(e){var t=e.getTime();return Number.isNaN(t)?"NaN":t},revive:function(e){return"NaN"===e?new Date(Number.NaN):new Date(e)}}},Dn={domexception:{test:function(e){return"DOMException"===Vt(e)},replace:function(e){return{name:e.name,message:e.message}},revive:function(e){var t=e.message,n=e.name;return new DOMException(t,n)}}},In={};function On(e){In[e.name.toLowerCase()]={test:function(t){return Vt(t)===e.name},replace:function(e){return e.is2D?{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}:{m11:e.m11,m12:e.m12,m13:e.m13,m14:e.m14,m21:e.m21,m22:e.m22,m23:e.m23,m24:e.m24,m31:e.m31,m32:e.m32,m33:e.m33,m34:e.m34,m41:e.m41,m42:e.m42,m43:e.m43,m44:e.m44}},revive:function(t){return Object.hasOwn(t,"a")?new e([t.a,t.b,t.c,t.d,t.e,t.f]):new e([t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44])}}}"undefined"!=typeof DOMMatrix&&On(DOMMatrix),"undefined"!=typeof DOMMatrixReadOnly&&On(DOMMatrixReadOnly);var Sn={};function Tn(e){Sn[e.name.toLowerCase()]={test:function(t){return Vt(t)===e.name},replace:function(e){return{x:e.x,y:e.y,z:e.z,w:e.w}},revive:function(t){var n=t.x,r=t.y,o=t.z,i=t.w;return new e(n,r,o,i)}}}"undefined"!=typeof DOMPoint&&Tn(DOMPoint),"undefined"!=typeof DOMPointReadOnly&&Tn(DOMPointReadOnly);var An={domquad:{test:function(e){return"DOMQuad"===Vt(e)},replace:function(e){return{p1:e.p1,p2:e.p2,p3:e.p3,p4:e.p4}},revive:function(e){var t=e.p1,n=e.p2,r=e.p3,o=e.p4;return new DOMQuad(t,n,r,o)}}},Nn={};function xn(e){Nn[e.name.toLowerCase()]={test:function(t){return Vt(t)===e.name},replace:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}},revive:function(t){var n=t.x,r=t.y,o=t.width,i=t.height;return new e(n,r,o,i)}}}"undefined"!=typeof DOMRect&&xn(DOMRect),"undefined"!=typeof DOMRectReadOnly&&xn(DOMRectReadOnly);var Bn={error:{test:function(e){return"Error"===Vt(e)},replace:function(e){return{name:e.name,message:e.message,cause:e.cause,stack:e.stack,fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber}},revive:function(e){var t=new Error(e.message);return t.name=e.name,t.cause=e.cause,t.stack=e.stack,t.fileName=e.fileName,t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}}},Fn={};function jn(e){Fn[e.name.toLowerCase()]={test:function(t){return Kt(t,e)},replace:function(e){return{name:e.name,message:e.message,cause:e.cause,stack:e.stack,fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber,errors:e.errors}},revive:function(t){var n="undefined"!=typeof AggregateError&&e===AggregateError?new e(t.errors,t.message):new e(t.message);return n.name=t.name,n.cause=t.cause,n.stack=t.stack,n.fileName=t.fileName,n.lineNumber=t.lineNumber,n.columnNumber=t.columnNumber,n}}}[TypeError,RangeError,SyntaxError,ReferenceError,EvalError,URIError].forEach((function(e){return jn(e)})),"undefined"!=typeof AggregateError&&jn(AggregateError),"function"==typeof InternalError&&jn(InternalError);var Pn={file:{test:function(e){return"File"===Vt(e)},replace:function(e){var t=new XMLHttpRequest;if(t.overrideMimeType("text/plain; charset=x-user-defined"),t.open("GET",URL.createObjectURL(e),!1),t.send(),200!==t.status&&0!==t.status)throw new Error("Bad File access: "+t.status);return{type:e.type,stringContents:t.responseText,name:e.name,lastModified:e.lastModified}},revive:function(e){var t=e.name,n=e.type,r=e.stringContents,o=e.lastModified;return new File([bn(r)],t,{type:n,lastModified:o})},replaceAsync:function(e){return new Rt((function(t,n){var r=new FileReader;r.addEventListener("load",(function(){t({type:e.type,stringContents:vn(r.result),name:e.name,lastModified:e.lastModified})})),r.addEventListener("error",(function(){n(r.error)})),r.readAsArrayBuffer(e)}))}}},Cn={file:Pn.file,filelist:{test:function(e){return"FileList"===Vt(e)},replace:function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e.item(n);return t},revive:function(e){var t=function(){return o((function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._files=arguments[0],this.length=this._files.length}),[{key:"item",value:function(e){return this._files[e]}},{key:Symbol.toStringTag,get:function(){return"FileList"}}])}();return new t(e)}}},kn={imagebitmap:{test:function(e){return"ImageBitmap"===Vt(e)||e&&e.dataset&&"ImageBitmap"===e.dataset.toStringTag},replace:function(e){var t=document.createElement("canvas");return t.getContext("2d").drawImage(e,0,0),{width:e.width,height:e.height,dataURL:t.toDataURL()}},revive:function(e){var t="undefined"==typeof OffscreenCanvas?document.createElement("canvas"):new OffscreenCanvas(e.width,e.height),n=t.getContext("2d"),r=document.createElement("img");return r.addEventListener("load",(function(){n.drawImage(r,0,0)})),r.src=e.dataURL,"undefined"==typeof OffscreenCanvas?t:t.transferToImageBitmap()},reviveAsync:function(e){var t=document.createElement("canvas"),r=t.getContext("2d"),o=document.createElement("img");return o.addEventListener("load",(function(){r.drawImage(o,0,0)})),o.src=e.dataURL,new Rt(function(){var e=n(f().mark((function e(n,r){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.t0=n,e.next=4,createImageBitmap(t);case 4:e.t1=e.sent,(0,e.t0)(e.t1),e.next=11;break;case 8:e.prev=8,e.t2=e.catch(0),r(e.t2);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t,n){return e.apply(this,arguments)}}())}}},Ln={imagedata:{test:function(e){return"ImageData"===Vt(e)},replace:function(e){return{array:_(e.data),width:e.width,height:e.height}},revive:function(e){return new ImageData(new Uint8ClampedArray(e.array),e.width,e.height)}}},Rn={infinity:{test:function(e){return e===Number.POSITIVE_INFINITY},replace:function(){return"Infinity"},revive:function(){return Number.POSITIVE_INFINITY}}},qn={map:{test:function(e){return"Map"===Vt(e)},replace:function(e){return _(e.entries())},revive:function(e){return new Map(e)}}},Un={nan:{test:function(e){return Number.isNaN(e)},replace:function(){return"NaN"},revive:function(){return Number.NaN}}},Mn={negativeInfinity:{test:function(e){return e===Number.NEGATIVE_INFINITY},replace:function(){return"-Infinity"},revive:function(){return Number.NEGATIVE_INFINITY}}},Vn={negativeZero:{test:function(e){return Object.is(e,-0)},replace:function(){return 0},revive:function(){return-0}}},Kn={StringObject:{test:function(e){return"String"===Vt(e)&&"object"==h(e)},replace:String,revive:function(e){return new String(e)}},BooleanObject:{test:function(e){return"Boolean"===Vt(e)&&"object"==h(e)},replace:function(e){return e.valueOf()},revive:function(e){return new Boolean(e)}},NumberObject:{test:function(e){return"Number"===Vt(e)&&"object"==h(e)},replace:Number,revive:function(e){return new Number(e)}}},Gn={regexp:{test:function(e){return"RegExp"===Vt(e)},replace:function(e){return{source:e.source,flags:(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.sticky?"y":"")+(e.unicode?"u":"")}},revive:function(e){var t=e.source,n=e.flags;return new RegExp(t,n)}}},Hn={set:{test:function(e){return"Set"===Vt(e)},replace:function(e){return _(e.values())},revive:function(e){return new Set(e)}}},Qn={};"function"==typeof Int8Array&&[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array].concat(_("function"==typeof BigInt64Array?[BigInt64Array,BigUint64Array]:[])).forEach((function(e){return function(e){var t=e.name;Qn[t.toLowerCase()]={test:function(e){return Vt(e)===t},replace:function(e){return(0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e:e.slice(0)).buffer},revive:function(t){return"ArrayBuffer"===Vt(t)?new e(t):t}}}(e)}));var Wn={};"function"==typeof Int8Array&&[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array].concat(_("function"==typeof BigInt64Array?[BigInt64Array,BigUint64Array]:[])).forEach((function(e){return function(e){var t=e.name;Wn[t.toLowerCase()]={test:function(e){return Vt(e)===t},replace:function(e,t){var n=e.buffer,r=e.byteOffset,o=e.length;t.buffers||(t.buffers=[]);var i=t.buffers.indexOf(n);return i>-1?{index:i,byteOffset:r,length:o}:(t.buffers.push(n),{maxByteLength:n.maxByteLength,encoded:dn(n),byteOffset:r,length:o})},revive:function(t,n){n.buffers||(n.buffers=[]);var r,o=t.byteOffset,i=t.length,a=t.encoded,u=t.index,c=t.maxByteLength;return"index"in t?r=n.buffers[u]:(r=_n(a,void 0===c?void 0:{maxByteLength:c}),n.buffers.push(r)),new e(r,o,i)}}}(e)}));var Yn={undef:{test:function(e,t){return void 0===e&&(t.ownKeys||!("ownKeys"in t))},replace:function(){return 0},revive:function(){return new un}}},$n={userObject:{test:function(e){return Ht(e)},replace:function(e){return l({},e)},revive:function(e){return e}}},Jn=[{arrayNonindexKeys:{testPlainObjects:!0,test:function(e,t){return!!Array.isArray(e)&&(Object.keys(e).some((function(e){return String(Number.parseInt(e))!==e}))&&(t.iterateIn="object",t.addLength=!0),!0)},replace:function(e,t){return t.iterateUnsetNumeric=!0,e},revive:function(e){if(Array.isArray(e))return e;var t=[];return Object.entries(e).forEach((function(e){var n=d(e,2),r=n[0],o=n[1];t[r]=o})),t}}},{sparseUndefined:{test:function(e,t){return void 0===e&&!1===t.ownKeys},replace:function(){return 0},revive:function(){}}}],Xn=[$n,Yn,Jn,Kn,[Un,Rn,Mn,Vn],wn,Gn,Ln,kn,Pn,Cn,gn,Bn,Fn].concat("function"==typeof Map?qn:[],"function"==typeof Set?Hn:[],"function"==typeof ArrayBuffer?pn:[],"function"==typeof Uint8Array?Wn:[],"function"==typeof DataView?En:[],"undefined"!=typeof crypto?mn:[],"undefined"!=typeof BigInt?[yn,hn]:[],"undefined"!=typeof DOMException?Dn:[],"undefined"!=typeof DOMRect?Nn:[],"undefined"!=typeof DOMPoint?Sn:[],"undefined"!=typeof DOMQuad?An:[],"undefined"!=typeof DOMMatrix?In:[]).concat({checkDataCloneException:{test:function(e){var t={}.toString.call(e).slice(8,-1);if(["symbol","function"].includes(h(e))||["Arguments","Module","Promise","WeakMap","WeakSet","Event","MessageChannel"].includes(t)||e&&"object"==h(e)&&"number"==typeof e.nodeType&&"function"==typeof e.insertBefore)throw new DOMException("The object cannot be cloned.","DataCloneError");return!1}}}),zn=(new an).register(Xn);function Zn(e){zn=(new an).register(e(Xn))}function er(e,t){var n;try{n=zn.stringifySync(e)}catch(e){if(Kt(e,ReferenceError)||Kt(e,ge))throw be("DataCloneError","The object cannot be cloned.");throw e}return t&&t(n),n}function tr(e){return zn.parse(e)}function nr(e){return tr(er(e))}var rr=Object.freeze({__proto__:null,clone:nr,decode:tr,encode:er,register:Zn}),or=["objectStore","keyPath","multiEntry","unique"];function ir(){throw new TypeError("Illegal constructor")}var ar=ir;function ur(e,t,n,r,o,i,a,u,c,s,l,f,d){t&&(e=1),e&&u.push("LIMIT",String(e));var _="count"===i;j.DEBUG&&console.log("Trying to fetch data for Index",u.join(" "),c),s.executeSql(u.join(" "),c,(function(e,u){var c=[],s=0,l=_?function(){}:"key"===i?function(e){return at(q(e.key))}:function(e){return tr(q(e.value))};if(n.multiEntry)for(var d=G(n.name),p=it(o,n.multiEntry),h=function(){var e,n=u.rows.item(y),i=at(n[d]);if(r&&(a&&o.some((function(e){return i.includes(e)}))||rt(JSON.stringify(p).slice(1,-1),n[d]))?(s++,e=n):r||a||void 0!==i&&(s+=Array.isArray(i)?i.length:1,e=n),e&&(c.push(l(e)),t))return 1},y=0;y<u.rows.length&&!h();y++);else{for(var v=0;v<u.rows.length;v++){var b=u.rows.item(v);b&&c.push(l(b))}s=c.length}f(_?s:0===s?t?void 0:[]:t?c[0]:c)}),d)}function cr(e,t,n,r,o){var i=e||!ae(n),a=["SELECT",U("count"===r?"key":r)+(t.multiEntry?", "+K(t.name):""),"FROM",V(t.objectStore.__currentName),"WHERE",K(t.name),"NOT NULL"],u=[];if(i)if(o)a.push("AND ("),n.forEach((function(e,n){n>0&&a.push("OR"),a.push(K(t.name),"LIKE ? ESCAPE '^' "),u.push("%"+H(it(e,t.multiEntry))+"%")})),a.push(")");else if(t.multiEntry)a.push("AND",K(t.name),"LIKE ? ESCAPE '^'"),Array.isArray(n)?u.push("%"+H(JSON.stringify(it(n,t.multiEntry)).slice(1,-1))+"%"):u.push("%"+H(it(n,t.multiEntry))+"%");else{vt(bt(n,e),K(t.name),a,u,!0,!1)}return[e,t,i,n,r,o,a,u]}ir.__createInstance=function(e,t){function n(){var n=this;n[Symbol.toStringTag]="IDBIndex",z(n,or),n.__objectStore=e,n.__name=n.__originalName=t.columnName,n.__keyPath=Array.isArray(t.keyPath)?t.keyPath.slice():t.keyPath;var r=t.optionalParams;n.__multiEntry=Boolean(r&&r.multiEntry),n.__unique=Boolean(r&&r.unique),n.__deleted=Boolean(t.__deleted),n.__objectStore.__cursors=t.cursors||[],Object.defineProperty(n,"__currentName",{get:function(){return"__pendingName"in n?n.__pendingName:n.name}}),Object.defineProperty(n,"name",{enumerable:!1,configurable:!1,get:function(){return this.__name},set:function(t){var n=this;t=re(t);var r=n.name;if(St.__assertVersionChange(n.objectStore.transaction),St.__assertActive(n.objectStore.transaction),ar.__invalidStateIfDeleted(n),lr.__invalidStateIfDeleted(n),t!==r){if(n.objectStore.__indexes[t]&&!n.objectStore.__indexes[t].__deleted&&!n.objectStore.__indexes[t].__pendingDelete)throw be("ConstraintError",'Index "'+t+'" already exists on '+n.objectStore.__currentName);n.__name=t;var o=n.objectStore;delete o.__indexes[r],o.__indexes[t]=n,o.indexNames.splice(o.indexNames.indexOf(r),1,t);var i=o.transaction.__storeHandles[o.name],a=i.__indexHandles[r];a.__name=t,i.__indexHandles[t]=a,n.__pendingName=r;var u=[["key","BLOB "+(o.autoIncrement?"UNIQUE, inc INTEGER PRIMARY KEY AUTOINCREMENT":"PRIMARY KEY")],["value","BLOB"]].concat(_(o.indexNames).filter((function(e){return e!==t})).map((function(e){return[K(e),"BLOB"]})));n.__renameIndex(o,r,t,u,(function(t,n){ar.__updateIndexList(e,t,(function(e){delete i.__pendingName,n(e)}))}))}}})}return n.prototype=ar.prototype,new n},ir.__invalidStateIfDeleted=function(e,t){if(e.__deleted||e.__pendingDelete||e.__pendingCreate&&e.objectStore.transaction&&e.objectStore.transaction.__errored)throw be("InvalidStateError",t||"This index has been deleted")},ir.__clone=function(e,t){var n=ir.__createInstance(t,{columnName:e.name,keyPath:e.keyPath,optionalParams:{multiEntry:e.multiEntry,unique:e.unique}});return["__pendingCreate","__pendingDelete","__deleted","__originalName","__recreated"].forEach((function(t){n[t]=e[t]})),n},ir.__createIndex=function(e,t){var n=t.name,r=e.__currentName,o=e.__indexes[n];t.__pendingCreate=!0,e.indexNames.push(n),e.__indexes[n]=t;var i=e.__indexHandles[n];(!i||t.__pendingDelete||t.__deleted||i.__pendingDelete||i.__deleted)&&(i=e.__indexHandles[n]=ir.__clone(t,e)),e.transaction.__addNonRequestToTransactionQueue((function(a,u,c,s){var l=o&&(o.__deleted||o.__recreated),f={};function d(e,t){s(be("UnknownError",'Could not create index "'+n+'"'+t.code+"::"+t.message,t))}function _(o){ir.__updateIndexList(e,o,(function(){o.executeSql('SELECT "key", "value" FROM '+V(r),[],(function(o,a){j.DEBUG&&console.log("Adding existing "+r+" records to the "+n+" index"),function u(l){if(l<a.rows.length)try{var _=ze(tr(q(a.rows.item(l).value)),t.keyPath,t.multiEntry);if("invalid"in _&&_.invalid||"failure"in _&&_.failure)throw new Error("Go to catch; ignore bad indexKey");var p=it(_.value,t.multiEntry);if(t.unique){if(f[p])return f={},void s(be("ConstraintError","Duplicate values already exist within the store"));f[p]=!0}o.executeSql("UPDATE "+V(r)+" SET "+K(n)+' = ? WHERE "key" = ?',[R(p),a.rows.item(l).key],(function(){u(l+1)}),d)}catch(e){u(l+1)}else delete t.__pendingCreate,delete i.__pendingCreate,t.__deleted&&(delete t.__deleted,delete i.__deleted,t.__recreated=!0,i.__recreated=!0),f={},c(e)}(0)}),d)}),d)}var p=V(r),h=K(t.name);if(l)_(a);else{var y=["ALTER TABLE",p,"ADD",h,"BLOB"].join(" ");j.DEBUG&&console.log(y),a.executeSql(y,[],(function(e){j.useSQLiteIndexes?e.executeSql('CREATE INDEX IF NOT EXISTS "'+p.slice(1,-1)+"^5"+h.slice(1,-1)+'" ON '+p+"("+h+")",[],_,d):_(e)}),d)}}))},ir.__deleteIndex=function(e,t){t.__pendingDelete=!0;var n=e.__indexHandles[t.name];n&&(n.__pendingDelete=!0),e.indexNames.splice(e.indexNames.indexOf(t.name),1),e.transaction.__addNonRequestToTransactionQueue((function(r,o,i,a){function u(e,n){a(be("UnknownError",'Could not delete index "'+t.name+'"',n))}function c(){ir.__updateIndexList(e,r,(function(e){delete t.__pendingDelete,delete t.__recreated,t.__deleted=!0,n&&(n.__deleted=!0,delete n.__pendingDelete),i(e)}),u)}j.useSQLiteIndexes?r.executeSql("DROP INDEX IF EXISTS "+U(V(e.name).slice(1,-1)+"^5"+K(t.name).slice(1,-1)),[],c,u):c()}))},ir.__updateIndexList=function(e,t,n,r){for(var o={},i=0;i<e.indexNames.length;i++){var a=e.__indexes[e.indexNames[i]];o[a.name]={columnName:a.name,keyPath:a.keyPath,optionalParams:{unique:a.unique,multiEntry:a.multiEntry},deleted:Boolean(a.__deleted)}}j.DEBUG&&console.log("Updating the index list for "+e.__currentName,o),t.executeSql('UPDATE __sys__ SET "indexList" = ? WHERE "name" = ?',[JSON.stringify(o),R(e.__currentName)],(function(){n(e)}),r)},ir.prototype.__fetchIndexData=function(e,t,n,r){var o=this;if(void 0!==r&&(r=ne(r,"unsigned long")),ir.__invalidStateIfDeleted(o),lr.__invalidStateIfDeleted(o.objectStore),o.objectStore.__deleted)throw be("InvalidStateError","This index's object store has been deleted");if(St.__assertActive(o.objectStore.transaction),n&&ae(e))throw be("DataError","No key or range was specified");var i=cr(n,o,e,t,!1);return o.objectStore.transaction.__addToTransactionQueue((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];ur.apply(void 0,[r].concat(_(i),t))}),void 0,o)},ir.prototype.openCursor=function(){var e=this,t=Array.prototype.slice.call(arguments),n=t[0],r=t[1],o=Gr.__createInstance(n,r,e.objectStore,e,G(e.name),"value");return e.__objectStore.__cursors.push(o),o.__request},ir.prototype.openKeyCursor=function(){var e=this,t=Array.prototype.slice.call(arguments),n=t[0],r=t[1],o=Mr.__createInstance(n,r,e.objectStore,e,G(e.name),"key");return e.__objectStore.__cursors.push(o),o.__request},ir.prototype.get=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBIndex.get`.");return this.__fetchIndexData(e,"value",!0)},ir.prototype.getKey=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBIndex.getKey`.");return this.__fetchIndexData(e,"key",!0)},ir.prototype.getAll=function(){var e=Array.prototype.slice.call(arguments),t=e[0],n=e[1];return this.__fetchIndexData(t,"value",!1,n)},ir.prototype.getAllKeys=function(){var e=Array.prototype.slice.call(arguments),t=e[0],n=e[1];return this.__fetchIndexData(t,"key",!1,n)},ir.prototype.count=function(){var e=this,t=arguments[0];return Q(t,ht)?Gr.__createInstance(t,"next",e.objectStore,e,G(e.name),"value",!0).__request:e.__fetchIndexData(t,"count",!1)},ir.prototype.__renameIndex=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=e.__currentName,a=V(i),u=K(n),c=U("tmp_"+V(i).slice(1,-1)),s=r.map((function(e){return e[0]})),l=r.map((function(e){return e.join(" ")})),f=l.length?l.join(", ")+", ":"",d=s.length?s.join(", ")+", ":"";e.transaction.__addNonRequestToTransactionQueue((function(e,n,r,i){function l(e,t){i(t)}function _(){o?o(e,r):r()}var p="CREATE TABLE "+c+"("+f+u+" BLOB)";j.DEBUG&&console.log(p),e.executeSql(p,[],(function(){var n="INSERT INTO "+c+"("+d+u+") SELECT "+d+K(t)+" FROM "+a;j.DEBUG&&console.log(n),e.executeSql(n,[],(function(){var t="DROP TABLE "+a;j.DEBUG&&console.log(t),e.executeSql(t,[],(function(){var t="ALTER TABLE "+c+" RENAME TO "+a;j.DEBUG&&console.log(t),e.executeSql(t,[],(function(e){if(j.useSQLiteIndexes){var t=s.slice(2).map((function(t){return new Fe((function(n,r){var o="CREATE INDEX "+U(a.slice(1,-1)+"^5"+t.slice(1,-1))+" ON "+a+"("+t+")";j.DEBUG&&console.log(o),e.executeSql(o,[],n,(function(e,t){r(t)}))}))}));t.push(new Fe((function(t,n){var r=U("sk_"+a.slice(1,-1)),o="DROP INDEX IF EXISTS "+r;j.DEBUG&&console.log(o),e.executeSql(o,[],(function(){var o="CREATE INDEX "+r+" ON "+a+'("key")';j.DEBUG&&console.log(o),e.executeSql(o,[],t,(function(e,t){n(t)}))}),(function(e,t){n(t)}))}))),Fe.all(t).then(_,i).catch((function(e){throw console.log("Index rename error"),e}))}else _()}),l)}),l)}),l)}),l)}))},Object.defineProperty(ir,Symbol.hasInstance,{value:function(e){return W(e)&&"openCursor"in e&&"function"==typeof e.openCursor&&"multiEntry"in e&&"boolean"==typeof e.multiEntry}}),J(ir.prototype,or),$(ir.prototype,["name"]),ir.prototype[Symbol.toStringTag]="IDBIndexPrototype",Object.defineProperty(ir,"prototype",{writable:!1});var sr=["keyPath","indexNames","transaction","autoIncrement"];function lr(){throw new TypeError("Illegal constructor")}var fr=lr;function dr(e,t){for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}lr.__createInstance=function(e,t){function n(){var n=this;n[Symbol.toStringTag]="IDBObjectStore",z(this,sr),n.__name=n.__originalName=e.name,n.__keyPath=Array.isArray(e.keyPath)?e.keyPath.slice():e.keyPath,n.__transaction=t,n.__idbdb=e.idbdb,n.__cursors=e.cursors||[],n.__autoIncrement=Boolean(e.autoInc),n.__indexes={},n.__indexHandles={},n.__indexNames=Et.__createInstance();var r=e.indexList;for(var o in r)if(Object.hasOwn(r,o)){var i=ir.__createInstance(n,r[o]);n.__indexes[i.name]=i,i.__deleted||n.indexNames.push(i.name)}n.__oldIndexNames=n.indexNames.clone(),Object.defineProperty(this,"__currentName",{get:function(){return"__pendingName"in this?this.__pendingName:this.name}}),Object.defineProperty(this,"name",{enumerable:!1,configurable:!1,get:function(){return this.__name},set:function(e){var t=this;e=re(e);var n=t.name;if(fr.__invalidStateIfDeleted(t),St.__assertVersionChange(t.transaction),St.__assertActive(t.transaction),n!==e){if(t.__idbdb.__objectStores[e]&&!t.__idbdb.__objectStores[e].__pendingDelete)throw be("ConstraintError",'Object store "'+e+'" already exists in '+t.__idbdb.name);t.__name=e;var r=t.__idbdb.__objectStores[n];r.__name=e,t.__idbdb.__objectStores[e]=r,delete t.__idbdb.__objectStores[n],t.__idbdb.objectStoreNames.splice(t.__idbdb.objectStoreNames.indexOf(n),1,e);var o=t.transaction.__storeHandles[n];o.__name=e,t.transaction.__storeHandles[e]=o,t.__pendingName=n;var i='UPDATE __sys__ SET "name" = ? WHERE "name" = ?',a=[R(e),R(n)];j.DEBUG&&console.log(i,a),t.transaction.__addNonRequestToTransactionQueue((function(r,o,u,c){r.executeSql(i,a,(function(r){var o="ALTER TABLE "+V(n)+" RENAME TO "+V(e);j.DEBUG&&console.log(o),r.executeSql(o,[],(function(){delete t.__pendingName,u()}))}),(function(e,t){return c(t),!1}))}))}}})}return n.prototype=fr.prototype,new n},lr.__clone=function(e,t){var n=lr.__createInstance({name:e.__currentName,keyPath:Array.isArray(e.keyPath)?e.keyPath.slice():e.keyPath,autoInc:e.autoIncrement,indexList:{},idbdb:e.__idbdb,cursors:e.__cursors},t);return["__indexes","__indexNames","__oldIndexNames","__deleted","__pendingDelete","__pendingCreate","__originalName"].forEach((function(t){n[t]=e[t]})),n},lr.__invalidStateIfDeleted=function(e,t){if(e.__deleted||e.__pendingDelete||e.__pendingCreate&&"transaction"in e&&e.transaction&&e.transaction.__errored)throw be("InvalidStateError",t||"This store has been deleted")},lr.__createObjectStore=function(e,t){var n=t.__currentName;t.__pendingCreate=!0,e.__objectStores[n]=t,e.objectStoreNames.push(n);var r=e.__versionTransaction,o=r.__storeHandles;return(!o[n]||o[n].__pendingDelete||o[n].__deleted)&&(o[n]=lr.__clone(t,r)),r.__addNonRequestToTransactionQueue((function(e,r,o,i){function a(e,t){return j.DEBUG&&console.log(t),i(be("UnknownError",'Could not create object store "'+n+'"',t)),!1}var u=V(n),c=["CREATE TABLE",u,"(key BLOB",t.autoIncrement?"UNIQUE, inc INTEGER PRIMARY KEY AUTOINCREMENT":"PRIMARY KEY",", value BLOB)"].join(" ");j.DEBUG&&console.log(c),e.executeSql(c,[],(function(e){function r(){var r=JSON.stringify(t.keyPath);e.executeSql("INSERT INTO __sys__ VALUES (?,?,?,?,?)",[R(n),r,Number(t.autoIncrement),"{}",1],(function(){delete t.__pendingCreate,delete t.__deleted,o(t)}),a)}j.useSQLiteIndexes?e.executeSql("CREATE INDEX IF NOT EXISTS "+U("sk_"+u.slice(1,-1))+" ON "+u+'("key")',[],r,a):r()}),a)})),o[n]},lr.__deleteObjectStore=function(e,t){t.__pendingDelete=!0,t.__indexNames=Et.__createInstance(),e.objectStoreNames.splice(e.objectStoreNames.indexOf(t.__currentName),1);var n=e.__versionTransaction.__storeHandles[t.__currentName];n&&(n.__indexNames=Et.__createInstance(),n.__pendingDelete=!0),e.__versionTransaction.__addNonRequestToTransactionQueue((function(e,r,o,i){function a(e,t){return j.DEBUG&&console.log(t),i(be("UnknownError","Could not delete ObjectStore",t)),!1}e.executeSql('SELECT "name" FROM __sys__ WHERE "name" = ?',[R(t.__currentName)],(function(e,r){r.rows.length>0&&e.executeSql("DROP TABLE "+V(t.__currentName),[],(function(){e.executeSql('DELETE FROM __sys__ WHERE "name" = ?',[R(t.__currentName)],(function(){delete t.__pendingDelete,t.__deleted=!0,n&&(delete n.__pendingDelete,n.__deleted=!0),o()}),a)}),a)}))}))},lr.prototype.__validateKeyAndValueAndCloneValue=function(e,t,n){var r=this;if(null!==r.keyPath){if(void 0!==t)throw be("DataError","The object store uses in-line keys and the key parameter was provided");var o=nr(e);if((t=ze(o,r.keyPath)).invalid)throw be("DataError","KeyPath was specified, but key was invalid.");if(t.failure){if(!n){if(!r.autoIncrement)throw be("DataError","Could not evaluate a key from keyPath and there is no key generator");if(!tt(o,r.keyPath))throw be("DataError","A key could not be injected into a value");return[void 0,o]}throw be("DataError","Could not evaluate a key from keyPath")}return[t.value,o]}if(void 0===t){if(!r.autoIncrement)throw be("DataError","The object store uses out-of-line keys and has no key generator and the key parameter was not provided.");t=void 0}else Xe(t);return[t,nr(e)]},lr.prototype.__deriveKey=function(e,t,n,r,o){var i=this;function a(e){er(n,(function(t){t=tr(t),r(t,e)}))}i.autoIncrement?void 0===n?dt(e,i,(function(e,n,a){e?o(be("ConstraintError","The key generator's current number has reached the maximum safe integer limit")):(null!==i.keyPath&&et(t,n,i.keyPath),r(n,a))}),o):_t(e,i,n,a,o):a()},lr.prototype.__insertData=function(e,t,n,r,o,i,a){var u=this,c={},s=Object.keys(u.__indexes).map((function(t){return new Fe((function(r,o){var i=u.__indexes[t];if(i.__pendingCreate||i.__deleted)r(void 0);else{var a;try{if("invalid"in(a=ze(n,i.keyPath,i.multiEntry))&&a.invalid||"failure"in a&&a.failure)throw new Error("Go to catch")}catch(e){return void r(void 0)}if(a=a.value,i.unique){var s=i.multiEntry&&Array.isArray(a),l=cr(!0,i,a,"key",s);ur.apply(void 0,[null].concat(_(l),[e,null,function(e){if(void 0===e)return f(i),void r(void 0);o(be("ConstraintError","Index already contains a record equal to "+(s?"one of the subkeys of":"")+"`indexKey`"))},o]))}else f(i),r(void 0)}function f(e){void 0!==a&&(c[e.__currentName]=it(a,e.multiEntry))}}))}));return Fe.all(s).then((function(){var n=["INSERT INTO",V(u.__currentName),"("],o=[" VALUES ("],s=[];void 0!==r&&(n.push(U("key"),","),o.push("?,"),s.push(R(it(r)))),Object.entries(c).forEach((function(e){var t=d(e,2),r=t[0],i=t[1];n.push(K(r)+","),o.push("?,"),s.push(R(i))})),n.push(U("value")+" )"),o.push("?)"),s.push(R(t));var l=n.join(" ")+o.join(" ");j.DEBUG&&console.log("SQL for adding",l,s),e.executeSql(l,s,(function(){i(r)}),(function(e,t){return a(be("ConstraintError",t.message,t)),!1}))})).catch((function(t){function n(){a(t)}return"number"==typeof o?(lt(e,u,o,n,n),null):(n(),null)}))},lr.prototype.add=function(e){var t=this,n=arguments[1];if(!(t instanceof lr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No value was specified");lr.__invalidStateIfDeleted(t),St.__assertActive(t.transaction),t.transaction.__assertWritable();var r=t.transaction.__createRequest(t),o=d(t.__validateKeyAndValueAndCloneValue(e,n,!1),2),i=o[0],a=o[1];return lr.__storingRecordObjectStore(r,t,!0,a,!0,i),r},lr.prototype.put=function(e){var t=this,n=arguments[1];if(!(t instanceof lr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No value was specified");lr.__invalidStateIfDeleted(t),St.__assertActive(t.transaction),t.transaction.__assertWritable();var r=t.transaction.__createRequest(t),o=d(t.__validateKeyAndValueAndCloneValue(e,n,!1),2),i=o[0],a=o[1];return lr.__storingRecordObjectStore(r,t,!0,a,!1,i),r},lr.prototype.__overwrite=function(e,t,n,r){var o="DELETE FROM "+V(this.__currentName)+' WHERE "key" = ?',i=it(t);e.executeSql(o,[R(i)],(function(e,r){j.DEBUG&&console.log("Did the row with the",t,"exist?",r.rowsAffected),n(e)}),(function(e,t){return r(t),!1}))},lr.__storingRecordObjectStore=function(e,t,n,r,o){var i=arguments[5];t.transaction.__pushToQueue(e,(function(e,a,u,c){t.__deriveKey(e,r,i,(function(i,a){er(r,(function(s){function l(e){t.__insertData(e,s,r,i,a,(function(){n&&t.__cursors.forEach((function(e){e.__invalidateCache()})),u.apply(void 0,arguments)}),c)}o?l(e):t.__overwrite(e,i,l,c)}))}),c)}))},lr.prototype.__get=function(e,t,n,r){var o=this;void 0!==r&&(r=ne(r,"unsigned long")),lr.__invalidStateIfDeleted(o),St.__assertActive(o.transaction);var i=bt(e,!n),a=["SELECT",U(t?"key":"value"),"FROM",V(o.__currentName)],u=[];if(void 0!==i&&(a.push("WHERE"),vt(i,U("key"),a,u)),n||(r=1),r){if(!Number.isFinite(r))throw new TypeError("The count parameter must be a finite number");a.push("LIMIT",String(r))}var c=a.join(" ");return o.transaction.__addToTransactionQueue((function(e,r,i,a){j.DEBUG&&console.log("Fetching",o.__currentName,u),e.executeSql(c,u,(function(e,r){var o;j.DEBUG&&console.log("Fetched data",r);try{if(0===r.rows.length)return void(n?i([]):i());if(o=[],t)for(var a=0;a<r.rows.length;a++)o.push(at(q(r.rows.item(a).key),!1));else for(var u=0;u<r.rows.length;u++)o.push(tr(q(r.rows.item(u).value)));n||(o=o[0])}catch(e){j.DEBUG&&console.log(e)}i(o)}),(function(e,t){return a(t),!1}))}),void 0,o)},lr.prototype.get=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.get`.");return this.__get(e)},lr.prototype.getKey=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.getKey`.");return this.__get(e,!0)},lr.prototype.getAll=function(){var e=Array.prototype.slice.call(arguments),t=e[0],n=e[1];return this.__get(t,!1,!0,n)},lr.prototype.getAllKeys=function(){var e=Array.prototype.slice.call(arguments),t=e[0],n=e[1];return this.__get(t,!0,!0,n)},lr.prototype.delete=function(e){var t=this;if(!(this instanceof lr))throw new TypeError("Illegal invocation");if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.delete`.");lr.__invalidStateIfDeleted(t),St.__assertActive(t.transaction),t.transaction.__assertWritable();var n=bt(e,!0),r=["DELETE FROM",V(t.__currentName),"WHERE"],o=[];vt(n,U("key"),r,o);var i=r.join(" ");return t.transaction.__addToTransactionQueue((function(e,n,r,a){j.DEBUG&&console.log("Deleting",t.__currentName,o),e.executeSql(i,o,(function(e,n){j.DEBUG&&console.log("Deleted from database",n.rowsAffected),t.__cursors.forEach((function(e){e.__invalidateCache()})),r()}),(function(e,t){return a(t),!1}))}),void 0,t)},lr.prototype.clear=function(){var e=this;if(!(this instanceof lr))throw new TypeError("Illegal invocation");return lr.__invalidStateIfDeleted(e),St.__assertActive(e.transaction),e.transaction.__assertWritable(),e.transaction.__addToTransactionQueue((function(t,n,r,o){t.executeSql("DELETE FROM "+V(e.__currentName),[],(function(t,n){j.DEBUG&&console.log("Cleared all records from database",n.rowsAffected),e.__cursors.forEach((function(e){e.__invalidateCache()})),r()}),(function(e,t){return o(t),!1}))}),void 0,e)},lr.prototype.count=function(){var e=this,t=arguments[0];if(!(e instanceof lr))throw new TypeError("Illegal invocation");return lr.__invalidStateIfDeleted(e),St.__assertActive(e.transaction),Gr.__createInstance(t,"next",e,e,"key","value",!0).__request},lr.prototype.openCursor=function(){var e=this,t=Array.prototype.slice.call(arguments),n=t[0],r=t[1];if(!(e instanceof lr))throw new TypeError("Illegal invocation");lr.__invalidStateIfDeleted(e);var o=Gr.__createInstance(n,r,e,e,"key","value");return e.__cursors.push(o),o.__request},lr.prototype.openKeyCursor=function(){var e=this;if(!(e instanceof lr))throw new TypeError("Illegal invocation");lr.__invalidStateIfDeleted(e);var t=Array.prototype.slice.call(arguments),n=t[0],r=t[1],o=Mr.__createInstance(n,r,e,e,"key","key");return e.__cursors.push(o),o.__request},lr.prototype.index=function(e){var t=this;if(!(t instanceof lr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No index name was specified");lr.__invalidStateIfDeleted(t),St.__assertNotFinished(t.transaction);var n=t.__indexes[e];if(!n||n.__deleted)throw be("NotFoundError",'Index "'+e+'" does not exist on '+t.__currentName);return(!t.__indexHandles[e]||t.__indexes[e].__pendingDelete||t.__indexes[e].__deleted)&&(t.__indexHandles[e]=ir.__clone(n,t)),t.__indexHandles[e]},lr.prototype.createIndex=function(e,t){var n=this,r=arguments[2];if(!(n instanceof lr))throw new TypeError("Illegal invocation");if(e=String(e),0===arguments.length)throw new TypeError("No index name was specified");if(1===arguments.length)throw new TypeError("No key path was specified");if(St.__assertVersionChange(n.transaction),lr.__invalidStateIfDeleted(n),St.__assertActive(n.transaction),n.__indexes[e]&&!n.__indexes[e].__deleted&&!n.__indexes[e].__pendingDelete)throw be("ConstraintError",'Index "'+e+'" already exists on '+n.__currentName);if(!te(t=ie(t)))throw be("SyntaxError","A valid keyPath must be supplied");if(Array.isArray(t)&&r&&r.multiEntry)throw be("InvalidAccessError","The keyPath argument was an array and the multiEntry option is true.");r=r||{};var o={columnName:e,keyPath:t,optionalParams:{unique:Boolean(r.unique),multiEntry:Boolean(r.multiEntry)}},i=ir.__createInstance(n,o);return ir.__createIndex(n,i),i},lr.prototype.deleteIndex=function(e){var t=this;if(!(t instanceof lr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No index name was specified");St.__assertVersionChange(t.transaction),lr.__invalidStateIfDeleted(t),St.__assertActive(t.transaction);var n=t.__indexes[e];if(!n)throw be("NotFoundError",'Index "'+e+'" does not exist on '+t.__currentName);ir.__deleteIndex(t,n)},J(lr.prototype,sr),$(lr.prototype,["name"]),lr.prototype[Symbol.toStringTag]="IDBObjectStorePrototype",Object.defineProperty(lr,"prototype",{writable:!1});var _r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,pr=function(e){return _r.exec(e).slice(1)};function hr(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r.charAt(0))}return e=dr(gr(e.split("/"),(function(e){return!!e})),!t).join("/"),(t?"/":"")+e||"."}function yr(e){var t=vr(e),n="/"===mr(e,-1);return e=dr(gr(e.split("/"),(function(e){return!!e})),!t).join("/"),e||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function vr(e){return"/"===e.charAt(0)}var br={extname:function(e){return pr(e)[3]},basename:function(e,t){var n=pr(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},dirname:function(e){var t=pr(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},sep:"/",delimiter:":",relative:function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=hr(e).substr(1),t=hr(t).substr(1);for(var r=n(e.split("/")),o=n(t.split("/")),i=Math.min(r.length,o.length),a=i,u=0;u<i;u++)if(r[u]!==o[u]){a=u;break}var c=[];for(u=a;u<r.length;u++)c.push("..");return(c=c.concat(o.slice(a))).join("/")},join:function(){return yr(gr(Array.prototype.slice.call(arguments,0),(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},isAbsolute:vr,normalize:yr,resolve:hr};function gr(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var mr="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)},Er=["onabort","onclose","onerror","onversionchange"],wr=["name","version","objectStoreNames"];function Dr(){throw this.__versionTransaction=null,this.__objectStores=null,this.__transactions=[],new TypeError("Illegal constructor")}var Ir,Or=Dr;Dr.__createInstance=function(e,t,n,r,o){function i(){var i=this;this[Symbol.toStringTag]="IDBDatabase",z(this,wr),this.__db=e,this.__closePending=!1,this.__oldVersion=n,this.__version=r,this.__name=t,this.__upgradeTransaction=null,X(this,Er),this.__setOptions({legacyOutputDidListenersThrowFlag:!0}),this.__transactions=[],this.__objectStores={},this.__objectStoreNames=Et.__createInstance();for(var a={},u=function(){var e=o.rows.item(c);a.name=e.name,a.keyPath=JSON.parse(e.keyPath),["autoInc","indexList"].forEach((function(t){a[t]=JSON.parse(e[t])})),a.idbdb=i;var t=lr.__createInstance(a);i.__objectStores[t.name]=t,i.objectStoreNames.push(t.name)},c=0;c<o.rows.length;c++)u();this.__oldObjectStoreNames=this.objectStoreNames.clone()}return i.prototype=Or.prototype,new i},Dr.prototype=B.createInstance(),Dr.prototype[Symbol.toStringTag]="IDBDatabasePrototype",Dr.prototype.createObjectStore=function(e){var t=arguments[1];if(e=String(e),!(this instanceof Dr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");St.__assertVersionChange(this.__versionTransaction),this.throwIfUpgradeTransactionNull(),St.__assertActive(this.__versionTransaction);var n=(t=l({},t)).keyPath;if(null!==(n=void 0===n?null:ie(n))&&!te(n))throw be("SyntaxError","The keyPath argument contains an invalid key path.");if(this.__objectStores[e]&&!this.__objectStores[e].__pendingDelete)throw be("ConstraintError",'Object store "'+e+'" already exists in '+this.name);var r=t.autoIncrement;if(r&&(""===n||Array.isArray(n)))throw be("InvalidAccessError","With autoIncrement set, the keyPath argument must not be an array or empty string.");var o={name:e,keyPath:n,autoInc:r,indexList:{},idbdb:this},i=lr.__createInstance(o,this.__versionTransaction);return lr.__createObjectStore(this,i)},Dr.prototype.deleteObjectStore=function(e){if(!(this instanceof Dr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");St.__assertVersionChange(this.__versionTransaction),this.throwIfUpgradeTransactionNull(),St.__assertActive(this.__versionTransaction);var t=this.__objectStores[e];if(!t)throw be("NotFoundError",'Object store "'+e+'" does not exist in '+this.name);lr.__deleteObjectStore(this,t)},Dr.prototype.close=function(){if(!(this instanceof Dr))throw new TypeError("Illegal invocation");this.__closePending=!0,this.__unblocking&&this.__unblocking.check(),this.__transactions=[]},Dr.prototype.transaction=function(e){var t=this;if(0===arguments.length)throw new TypeError("You must supply a valid `storeNames` to `IDBDatabase.transaction`");var n=arguments[1];if(e=Y(e)?_(new Set(ie(e))).sort():[re(e)],n=n||"readonly",St.__assertNotVersionChange(this.__versionTransaction),this.__closePending)throw be("InvalidStateError","An attempt was made to start a new transaction on a database connection that is not open");var r=Et.__createInstance();if(e.forEach((function(e){if(!t.objectStoreNames.contains(e))throw be("NotFoundError",'The "'+e+'" object store does not exist');r.push(e)})),0===e.length)throw be("InvalidAccessError","No valid object store names were specified");if("readonly"!==n&&"readwrite"!==n)throw new TypeError("Invalid transaction mode: "+n);var o=St.__createInstance(this,r,n);return this.__transactions.push(o),o},Dr.prototype.throwIfUpgradeTransactionNull=function(){if(null===this.__upgradeTransaction)throw be("InvalidStateError","No upgrade transaction associated with database.")},Dr.prototype.__forceClose=function(e){var t=this;t.close();var n=0;t.__transactions.forEach((function(r){r.on__abort=function(){if(++n===t.__transactions.length){var e=ue("close");setTimeout((function(){t.dispatchEvent(e)}))}},r.__abortTransaction(be("AbortError","The connection was force-closed: "+(e||"")))})),t.__transactions=[]},$(Dr.prototype,Er),J(Dr.prototype,wr),Object.defineProperty(Dr.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Dr}),Object.defineProperty(Dr,"prototype",{writable:!1});var Sr=function(){return"object"===("undefined"==typeof location?"undefined":h(location))&&location?location.origin:"null"},Tr=function(){return!1!==j.checkOrigin&&"null"===Sr()},Ar={};function Nr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sr(),n=Ar[t][e];if(n[0]){var r=n[0],o=r.req,i=r.cb;o.addEventListener("success",a),o.addEventListener("error",a),o.addEventListener("blocked",a),i(o)}function a(){n.shift(),Nr(e,t)}}function xr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Sr(),r=arguments.length>3?arguments[3]:void 0;Ar[n][t]||(Ar[n][t]=[]),Ar[n][t].push({req:e,cb:r}),1===Ar[n][t].length&&Nr(t,n)}function Br(e,t,n,r){var o=function(e){return e.__closePending},i=function(){return e.every((function(e){return o(e)}))};return e.reduce((function(e,t){return o(t)?e:e.then((function(){if(!o(t)){var e=new ce("versionchange",{oldVersion:n,newVersion:r});return new Fe((function(n){setTimeout((function(){t.dispatchEvent(e),n(void 0)}))}))}}))}),Fe.resolve(void 0)).then((function(){if(!i())return new Fe((function(a){var u={check:function(){i()&&a(void 0)}},c=new ce("blocked",{oldVersion:n,newVersion:r});setTimeout((function(){t.dispatchEvent(c),i()?a(void 0):e.forEach((function(e){o(e)||(e.__unblocking=u)}))}))}))}))}var Fr,jr={},Pr=0;function Cr(e){return Object.keys(jr[e]).map(Number).reduce((function(e,t){return t>e?t:e}),0)}function kr(e,t,n,r,o){if("string"==typeof j.memoryDatabase){var i=jr[t]?function(e){return jr[e]&&jr[e][Cr(e)]}(t):null;if(!i)return console.warn("Could not find a memory database instance to delete."),void r();var a=i._db&&i._db._db;return a&&a.close?void a.close((function(e){e?console.warn("Error closing (destroying) memory database"):r()})):void console.error("The `openDatabase` implementation does not have the expected `._db._db.close` method for closing the database")}Ir&&!1!==j.deleteDatabaseFiles?Ir.unlink(br.join(j.databaseBasePath||"",n),(function(e){e&&"ENOENT"!==e.code?o({code:0,message:"Error removing database file: "+n+" "+e}):r()})):e(br.join(j.databaseBasePath||"",n),"1",t,j.DEFAULT_DB_SIZE).transaction((function(e){e.executeSql('SELECT "name" FROM __sys__',[],(function(e,t){var n=t.rows;!function t(i){i>=n.length?e.executeSql("DROP TABLE IF EXISTS __sys__",[],(function(){r()}),o):e.executeSql("DROP TABLE "+V(q(n.item(i).name)),[],(function(){t(i+1)}),(function(){return t(i+1),!1}))}(0)}),(function(){return r(),!1}))}))}function Lr(e,t,n){function r(e,t){var r=he(t||e);j.DEBUG&&console.log("Error in sysdb transaction - when creating dbVersions",t),n(r)}Fr?t():(Fr=e("string"==typeof j.memoryDatabase?j.memoryDatabase:br.join("string"==typeof j.sysDatabaseBasePath?j.sysDatabaseBasePath:j.databaseBasePath||"","__sysdb__"+(!1!==j.addSQLiteExtension?".sqlite":"")),"1","System Database",j.DEFAULT_DB_SIZE)).transaction((function(e){e.executeSql("CREATE TABLE IF NOT EXISTS dbVersions (name BLOB, version INT);",[],(function(e){j.useSQLiteIndexes?e.executeSql("CREATE INDEX IF NOT EXISTS dbvname ON dbVersions(name)",[],t,r):t()}),r)}),r)}function Rr(){throw new TypeError("Illegal constructor")}var qr=Rr;Rr.__createInstance=function(){function e(){this[Symbol.toStringTag]="IDBFactory",this.__connections={}}return e.prototype=qr.prototype,new e},Rr.prototype.open=function(e){var t=this;if(!(t instanceof Rr))throw new TypeError("Illegal invocation");var n=arguments[1];if(0===arguments.length)throw new TypeError("Database name is required");if(void 0!==n&&0===(n=ne(n,"unsigned long long")))throw new TypeError("Version cannot be 0");if(Tr())throw be("SecurityError","Cannot open an IndexedDB database from an opaque origin.");var r=Oe.__createInstance(),o=!1;j.autoName&&""===e&&(e="autoNamedDatabase_"+Pr++);var i,a=R(e=String(e)),u="string"==typeof j.memoryDatabase,c=!1!==j.cacheDatabaseInstances||u;try{i=M(e)}catch(e){throw e}function s(e,t){if(o)return!1;var n=t?he(t):e;o=!0;var i=ue("error",n,{bubbles:!0,cancelable:!0});return r.__done=!0,r.__error=n,r.__result=void 0,r.dispatchEvent(i),!1}function l(o){var l;if((u||c)&&e in jr&&jr[e][n]?l=jr[e][n]:(l=t.__openDatabase(u?j.memoryDatabase:br.join(j.databaseBasePath||"",i),"1",e,j.DEFAULT_DB_SIZE),c&&(e in jr||(jr[e]={}),jr[e][n]=l)),void 0===n&&(n=o||1),o>n){var f=be("VersionError","An attempt was made to open a database using a lower version than the existing version.",n);c?setTimeout((function(){s(f)})):s(f)}else l.transaction((function(u){u.executeSql("CREATE TABLE IF NOT EXISTS __sys__ (name BLOB, keyPath BLOB, autoInc BOOLEAN, indexList BLOB, currNum INTEGER)",[],(function(){function f(){!function(o,u,l){o.executeSql('SELECT "name", "keyPath", "autoInc", "indexList" FROM __sys__',[],(function(o,f){function d(){r.__result=_,r.__done=!0}var _=Dr.__createInstance(u,e,l,n,f);if(t.__connections[e]||(t.__connections[e]=[]),t.__connections[e].push(_),l<n)Br(t.__connections[e].slice(0,-1),r,l,n).then((function(){var o=function(e,t,n){if(t)try{e.executeSql("ROLLBACK",[],n,n)}catch(t){Fr.transaction((function(e){function t(e){throw new Error("Unable to roll back upgrade transaction!"+(e||""))}0===l?e.executeSql('DELETE FROM dbVersions WHERE "name" = ?',[a],(function(){n(t)}),t):e.executeSql('UPDATE dbVersions SET "version" = ? WHERE "name" = ?',[l,a],n,t)}))}else n()};Fr.transaction((function(u){function f(){var a=new ce("upgradeneeded",{oldVersion:l,newVersion:n});r.__result=_,_.__upgradeTransaction=r.__transaction=r.__result.__versionTransaction=St.__createInstance(r.__result,r.__result.objectStoreNames,"versionchange"),r.__done=!0,r.transaction.__addNonRequestToTransactionQueue((function(e,t,n){if(r.dispatchEvent(a),a.__legacyOutputDidListenersThrowError)return _e("Error","An error occurred in an upgradeneeded handler attached to request chain",a.__legacyOutputDidListenersThrowError),void r.transaction.__abortTransaction(be("AbortError","A request was aborted."));n()})),r.transaction.on__beforecomplete=function(e){_.__upgradeTransaction=null,r.__result.__versionTransaction=null,o(u,!1,(function(){return r.transaction.__transFinishedCb(!1,(function(){e.complete(),r.__transaction=null})),!1}))},r.transaction.on__preabort=function(){_.__upgradeTransaction=null,c&&e in jr&&delete jr[e][n]},r.transaction.on__abort=function(){r.__transaction=null,r.__result=void 0,r.__done=!1,_.close(),setTimeout((function(){var n=be("AbortError","The upgrade transaction was aborted.");o(u,n,(function(r){return 0===l?(kr(t.__openDatabase,e,i,s.bind(null,n),r||s),!1):(s(n),!1)}))}))},r.transaction.on__complete=function(){var e=_.__transactions.indexOf(r.transaction);if(e>-1&&_.__transactions.splice(e,1),r.__result.__closePending)return r.__transaction=null,void s(be("AbortError","The connection has been closed."));d(),r.__transaction=null;var t=ue("success");r.dispatchEvent(t)}}0===l?u.executeSql("INSERT INTO dbVersions VALUES (?,?)",[a,n],f,s):u.executeSql('UPDATE dbVersions SET "version" = ? WHERE "name" = ?',[n,a],f,s)}),s,void 0,(function(e,t,n,r,i){return!(!e.readOnly&&!t&&(o=function(e,t,n){t?r(t,n):i(n)},1))}))})).catch((function(e){throw console.log("Error within `triggerAnyVersionChangeAndBlockedEvents`"),e}));else{d();var p=ue("success");r.dispatchEvent(p)}}),s)}(u,l,o)}j.createIndexes?u.executeSql("CREATE INDEX IF NOT EXISTS sysname ON __sys__(name)",[],f,s):f()}),s)}),s)}return xr(r,e,void 0,(function(){var n;c&&(e in jr||(jr[e]={}),n=Cr(e)),n?l(n):Lr(t.__openDatabase,(function(){Fr.readTransaction((function(e){e.executeSql('SELECT "version" FROM dbVersions WHERE "name" = ?',[a],(function(e,t){0===t.rows.length?l(0):l(t.rows.item(0).version)}),s)}),s)}),s)})),r},Rr.prototype.deleteDatabase=function(e){var t=this;if(!(t instanceof Rr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("Database name is required");if(Tr())throw be("SecurityError","Cannot delete an IndexedDB database from an opaque origin.");var n,r=R(e=String(e));try{n=M(e)}catch(e){throw e}var o="string"==typeof j.memoryDatabase,i=!1!==j.cacheDatabaseInstances||o,a=Oe.__createInstance(),u=!1,c=0,s=function(e,t){t(e)};function l(e,t){if(u||!0===t)return!1;var n=he(t||e);return s(!0,(function(){a.__done=!0,a.__error=n,a.__result=void 0;var e=ue("error",n,{bubbles:!0,cancelable:!0});a.dispatchEvent(e),u=!0})),!1}return xr(a,e,void 0,(function(o){Lr(t.__openDatabase,(function(){function a(){o.__result=void 0,o.__done=!0;var e=new ce("success",{oldVersion:c,newVersion:null});o.dispatchEvent(e)}function u(){s(!1,(function(){i&&e in jr&&delete jr[e],delete t.__connections[e],a()}))}Fr.readTransaction((function(i){i.executeSql('SELECT "version" FROM dbVersions WHERE "name" = ?',[r],(function(i,f){if(0!==f.rows.length){var d=f.rows.item(0);c=d.version,Br(t.__connections[e]||[],o,c,null).then((function(){Fr.transaction((function(o){o.executeSql('DELETE FROM dbVersions WHERE "name" = ? ',[r],(function(){kr(t.__openDatabase,e,n,u,l)}),l)}),l,void 0,(function(e,t,n,r,o){return!(!e.readOnly&&!t)||(s=function(e,t){e?r(e,t):o(t)},!1)}))}),l)}else a()}),l)}))}),l)})),a},Rr.prototype.cmp=function(e,t){if(!(this instanceof Rr))throw new TypeError("Illegal invocation");if(arguments.length<2)throw new TypeError("You must provide two keys to be compared");return Xe(e),Xe(t),je(e,t)},Rr.prototype.databases=function(){var e=this,t=!1;return new Promise((function(n,r){if(!(e instanceof Rr))throw new TypeError("Illegal invocation");if(Tr())throw be("SecurityError","Cannot get IndexedDB database names from an opaque origin.");function o(e,n){if(t)return!1;var o=n?he(n):e;return t=!0,r(o),!1}Lr(e.__openDatabase,(function(){Fr.readTransaction((function(e){e.executeSql('SELECT "name", "version" FROM dbVersions',[],(function(e,t){for(var r=[],o=0;o<t.rows.length;o++){var i=t.rows.item(o),a=i.name,u=i.version;r.push({name:q(a),version:u})}n(r)}),o)}),o)}),o)}))},Rr.prototype.__forceClose=function(e,t,n){var r=this;function o(e){e.__forceClose(n)}if(ae(e))Object.values(r.__connections).forEach((function(e){e.forEach((function(e){o(e)}))}));else if(r.__connections[e])if(ae(t))r.__connections[e].forEach((function(e){o(e)}));else{if(!Number.isInteger(t)||t<0||t>r.__connections[e].length-1)throw new TypeError("If providing an argument, __forceClose must be called with a numeric index to indicate a specific connection to close");o(r.__connections[e][t])}else console.log("No database connections with that name to force close")},Rr.prototype.__setConnectionQueueOrigin=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Sr();Ar[e]={}},Rr.prototype[Symbol.toStringTag]="IDBFactoryPrototype",Object.defineProperty(Rr,"prototype",{writable:!1});var Ur=Rr.__createInstance();function Mr(){throw new TypeError("Illegal constructor")}var Vr=Mr;Mr.__super=function(e,t,n,r,o,i,a){this[Symbol.toStringTag]="IDBCursor",z(this,["key","primaryKey","request"]),lr.__invalidStateIfDeleted(n),this.__indexSource=Q(r,ir),this.__indexSource&&ir.__invalidStateIfDeleted(r),St.__assertActive(n.transaction);var u=bt(e);if(void 0!==t&&!["next","prev","nextunique","prevunique"].includes(t))throw new TypeError(t+"is not a valid cursor direction");Object.defineProperties(this,{source:{writable:!1,value:r},direction:{writable:!1,value:t||"next"}}),this.__key=void 0,this.__primaryKey=void 0,this.__store=n,this.__range=u,this.__request=De.__createInstance(),this.__request.__source=r,this.__request.__transaction=this.__store.transaction,this.__keyColumnName=o,this.__valueColumnName=i,this.__keyOnly="key"===i,this.__valueDecoder=this.__keyOnly?pt:rr,this.__count=a,this.__prefetchedIndex=-1,this.__multiEntryIndex=!!this.__indexSource&&("multiEntry"in r&&r.multiEntry),this.__unique=this.direction.includes("unique"),this.__sqlDirection=["prev","prevunique"].includes(this.direction)?"DESC":"ASC",void 0!==u&&(u.__lowerCached=void 0!==u.lower&&it(u.lower,this.__multiEntryIndex),u.__upperCached=void 0!==u.upper&&it(u.upper,this.__multiEntryIndex)),this.__gotValue=!0,this.continue()},Mr.__createInstance=function(){var e=Vr.__super;e.prototype=Vr.prototype;for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return r(e,n)},Mr.prototype.__find=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(this.__multiEntryIndex){var r=t[0],o=t[1],i=t[2],a=t[3],u=t[4];this.__findMultiEntry(r,o,i,a,u)}else{var c=t[0],s=t[1],l=t[2],f=t[3],d=t[4],_=t[5];this.__findBasic(c,s,l,f,d,_)}},Mr.prototype.__findBasic=function(e,t,n,r,o,i){var a=void 0!==i;i=i||1;var u=this,c=U(u.__keyColumnName),s=U("key"),l=["SELECT * FROM",V(u.__store.__currentName)],f=[];l.push("WHERE",c,"NOT NULL"),vt(u.__range,c,l,f,!0,!0);var d=u.__sqlDirection,_="ASC"===d?">":"<";void 0!==t&&(l.push("AND",s,_+"= ?"),f.push(it(t))),void 0!==e?(l.push("AND",c,_+"= ?"),f.push(it(e))):a&&void 0!==u.__key&&(l.push("AND",c,_+" ?"),f.push(it(u.__key))),u.__count||(l.push("ORDER BY",c,d),"key"!==u.__keyColumnName&&(u.__unique?"prevunique"===u.direction&&l.push(",",s,"ASC"):l.push(",",s,d)),!u.__unique&&u.__indexSource&&l.push(",",U(u.__valueColumnName),d),l.push("LIMIT",String(i)));var p=l.join(" ");j.DEBUG&&console.log(p,f),n.executeSql(p,f,(function(e,t){u.__count?r(void 0,t.rows.length,void 0):t.rows.length>1?(u.__prefetchedIndex=0,u.__prefetchedData=t.rows,j.DEBUG&&console.log("Preloaded "+u.__prefetchedData.length+" records for cursor"),u.__decode(t.rows.item(0),r)):1===t.rows.length?u.__decode(t.rows.item(0),r):(j.DEBUG&&console.log("Reached end of cursors"),r(void 0,void 0,void 0))}),(function(e,t){return j.DEBUG&&console.log("Could not execute Cursor.continue",p,f),o(t),!1}))};var Kr=/\[/g;function Gr(){throw new TypeError("Illegal constructor")}Mr.prototype.__findMultiEntry=function(e,t,n,r,o){var a=this;if(a.__prefetchedData&&a.__prefetchedData.length===a.__prefetchedIndex)return j.DEBUG&&console.log("Reached end of multiEntry cursor"),void r(void 0,void 0,void 0);var u=U(a.__keyColumnName),c=["SELECT * FROM",V(a.__store.__currentName)],s=[];c.push("WHERE",u,"NOT NULL"),a.__range&&void 0!==a.__range.lower&&Array.isArray(a.__range.upper)&&0===a.__range.upper.indexOf(a.__range.lower)&&(c.push("AND",u,"LIKE ? ESCAPE '^'"),s.push("%"+H(a.__range.__lowerCached.slice(0,-1))+"%"));var l=a.__sqlDirection,f="ASC"===l?">":"<",d=U("key");void 0!==t&&(c.push("AND",d,f+"= ?"),s.push(it(t))),void 0!==e?(c.push("AND",u,f+"= ?"),s.push(it(e))):void 0!==a.__key&&(c.push("AND",u,f+" ?"),s.push(it(a.__key))),a.__count||(c.push("ORDER BY",u,l),a.__unique||"key"===a.__keyColumnName||c.push(",",U("key"),l),!a.__unique&&a.__indexSource&&c.push(",",U(a.__valueColumnName),l));var _=c.join(" ");j.DEBUG&&console.log(_,s),n.executeSql(_,s,(function(e,t){if(t.rows.length>0){if(a.__count){for(var n=0,o=0;o<t.rows.length;o++){n+=ot(at(t.rows.item(o)[a.__keyColumnName],!0),a.__range).length}return void r(void 0,n,void 0)}for(var u=[],c=0;c<t.rows.length;c++){var s,l=t.rows.item(c),f=i(ot(at(l[a.__keyColumnName],!0),a.__range));try{for(f.s();!(s=f.n()).done;){var d={matchingKey:it(s.value,!0),key:l.key};d[a.__keyColumnName]=l[a.__keyColumnName],d[a.__valueColumnName]=l[a.__valueColumnName],u.push(d)}}catch(e){f.e(e)}finally{f.f()}}var _=0===a.direction.indexOf("prev");u.sort((function(e,t){return e.matchingKey.replaceAll(Kr,"z")<t.matchingKey.replaceAll(Kr,"z")?_?1:-1:e.matchingKey.replaceAll(Kr,"z")>t.matchingKey.replaceAll(Kr,"z")?_?-1:1:e.key<t.key?"prev"===a.direction?1:-1:e.key>t.key?"prev"===a.direction?-1:1:0})),u.length>1?(a.__prefetchedIndex=0,a.__prefetchedData={data:u,length:u.length,item:function(e){return this.data[e]}},j.DEBUG&&console.log("Preloaded "+a.__prefetchedData.length+" records for multiEntry cursor"),a.__decode(u[0],r)):1===u.length?(j.DEBUG&&console.log("Reached end of multiEntry cursor"),a.__decode(u[0],r)):(j.DEBUG&&console.log("Reached end of multiEntry cursor"),r(void 0,void 0,void 0))}else j.DEBUG&&console.log("Reached end of multiEntry cursor"),r(void 0,void 0,void 0)}),(function(e,t){return j.DEBUG&&console.log("Could not execute Cursor.continue",_,s),o(t),!1}))},Mr.prototype.__onsuccess=function(e){var t=this;return function(n,r,o){t.__count?e(r,t.__request):(void 0!==n&&(t.__gotValue=!0),t.__key=void 0===n?null:n,t.__primaryKey=void 0===o?null:o,t.__value=void 0===r?null:r,e(void 0===n?null:t,t.__request))}},Mr.prototype.__decode=function(e,t){var n=this;if(n.__multiEntryIndex&&n.__unique){if(n.__matchedKeys||(n.__matchedKeys={}),n.__matchedKeys[e.matchingKey])return void t(void 0,void 0,void 0);n.__matchedKeys[e.matchingKey]=!0}var r=q(n.__multiEntryIndex?e.matchingKey:e[n.__keyColumnName]),o=q(e[n.__valueColumnName]),i=q(e.key);t(at(r,n.__multiEntryIndex),n.__valueDecoder.decode(o),at(i),r)},Mr.prototype.__sourceOrEffectiveObjStoreDeleted=function(){lr.__invalidStateIfDeleted(this.__store,"The cursor's effective object store has been deleted"),this.__indexSource&&ir.__invalidStateIfDeleted(this.source,"The cursor's index source has been deleted")},Mr.prototype.__invalidateCache=function(){this.__prefetchedData=null},Mr.prototype.__continue=function(e,t){var n=this,r=void 0!==n.__advanceCount;if(St.__assertActive(n.__store.transaction),n.__sourceOrEffectiveObjStoreDeleted(),!n.__gotValue&&!t)throw be("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(void 0!==e){Xe(e);var o=je(e,n.key);if(0===o||n.direction.includes("next")&&-1===o||n.direction.includes("prev")&&1===o)throw be("DataError","Cannot "+(r?"advance":"continue")+" the cursor in an unexpected direction")}this.__continueFinish(e,void 0,r)},Mr.prototype.__continueFinish=function(e,t,n){var r=this,o=r.__advanceCount||j.cursorPreloadPackSize||100;r.__gotValue=!1,r.__request.__done=!1,r.__store.transaction.__pushToQueue(r.__request,(function i(a,u,c,s,l){function f(e,t,o){if(n){if(r.__advanceCount&&r.__advanceCount>=2&&void 0!==e)return r.__advanceCount--,r.__key=e,r.__continue(void 0,!0),void l();r.__advanceCount=void 0}r.__onsuccess(c)(e,t,o)}r.__prefetchedData&&(r.__prefetchedIndex++,r.__prefetchedIndex<r.__prefetchedData.length)?r.__decode(r.__prefetchedData.item(r.__prefetchedIndex),(function(n,o,l,d){var _;!r.__unique||r.__multiEntryIndex||d!==it(r.key,r.__multiEntryIndex)?(_=Number(void 0===e)||je(n,e))>0||0===_&&(r.__unique||void 0===t||je(l,t)>=0)?f(n,o,l):i(a,u,c,s):i(a,u,c,s)})):r.__find(e,t,a,f,(function(){r.__advanceCount=void 0;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=t[0],i=t[1];s(o,i)}),o)}))},Mr.prototype.continue=function(){this.__continue(arguments[0])},Mr.prototype.continuePrimaryKey=function(e,t){var n=this;if(St.__assertActive(n.__store.transaction),n.__sourceOrEffectiveObjStoreDeleted(),!n.__indexSource)throw be("InvalidAccessError","`continuePrimaryKey` may only be called on an index source.");if(!["next","prev"].includes(n.direction))throw be("InvalidAccessError","`continuePrimaryKey` may not be called with unique cursors.");if(!n.__gotValue)throw be("InvalidStateError","The cursor is being iterated or has iterated past its end.");Xe(e),Xe(t);var r=je(e,n.key);if("next"===n.direction&&-1===r||"prev"===n.direction&&1===r)throw be("DataError","Cannot continue the cursor in an unexpected direction");function o(){n.__continueFinish(e,t,!1)}0===r?er(t,(function(e){er(n.primaryKey,(function(t){if(e===t||"next"===n.direction&&e<t||"prev"===n.direction&&e>t)throw be("DataError","Cannot continue the cursor in an unexpected direction");o()}))})):o()},Mr.prototype.advance=function(e){var t=this;if(0===(e=ne(e,"unsigned long")))throw new TypeError("Calling advance() with count argument 0");t.__gotValue&&(t.__advanceCount=e),t.__continue()},Mr.prototype.update=function(e){var t=this;if(!arguments.length)throw new TypeError("A value must be passed to update()");if(St.__assertActive(t.__store.transaction),t.__store.transaction.__assertWritable(),t.__sourceOrEffectiveObjStoreDeleted(),!t.__gotValue)throw be("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(t.__keyOnly)throw be("InvalidStateError","This cursor method cannot be called when the key only flag has been set.");var n=t.__store.transaction.__createRequest(t),r=t.primaryKey;function o(e){lr.__storingRecordObjectStore(n,t.__store,!1,e,!1,r)}if(null!==t.__store.keyPath){var i=d(t.__store.__validateKeyAndValueAndCloneValue(e,void 0,!0),2),a=i[0],u=i[1];if(0!==je(t.primaryKey,a))throw be("DataError","The key of the supplied value to `update` is not equal to the cursor's effective key");o(u)}else{o(nr(e))}return n},Mr.prototype.delete=function(){var e=this;if(St.__assertActive(e.__store.transaction),e.__store.transaction.__assertWritable(),e.__sourceOrEffectiveObjStoreDeleted(),!e.__gotValue)throw be("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(e.__keyOnly)throw be("InvalidStateError","This cursor method cannot be called when the key only flag has been set.");return this.__store.transaction.__addToTransactionQueue((function(t,n,r,o){e.__find(void 0,void 0,t,(function(n,i,a){var u="DELETE FROM "+V(e.__store.__currentName)+' WHERE "key" = ?';j.DEBUG&&console.log(u,n,a),t.executeSql(u,[R(it(a))],(function(e,t){1===t.rowsAffected?r(void 0):o("No rows with key found"+n)}),(function(e,t){return o(t),!1}))}),o)}),void 0,e)},Mr.prototype[Symbol.toStringTag]="IDBCursorPrototype",J(Mr.prototype,["source","direction","key","primaryKey","request"]),Object.defineProperty(Mr,"prototype",{writable:!1}),Gr.prototype=Object.create(Mr.prototype),Object.defineProperty(Gr.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Gr});var Hr=Gr;function Qr(e,t){if(e&&"object"===h(e))Object.entries(e).forEach((function(e){var t=d(e,2);Qr(t[0],t[1])}));else{if(!(e in j))throw new Error(e+" is not a valid configuration property");j[e]=t,"registerSCA"===e&&"function"==typeof t&&Zn(t)}}Gr.__createInstance=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];function r(){var e=t[0],n=t[1],r=t[2],o=t[3],i=t[4],a=t[5],u=t[6];Mr.__super.call(this,e,n,r,o,i,a,u),this[Symbol.toStringTag]="IDBCursorWithValue",z(this,"value")}return r.prototype=Hr.prototype,new r},J(Gr.prototype,["value"]),Gr.prototype[Symbol.toStringTag]="IDBCursorWithValuePrototype",Object.defineProperty(Gr,"prototype",{writable:!1}),j.win="undefined"!=typeof window?window:self,function(){var e=globalThis||{};function t(t,n,r){if(!r||!Object.defineProperty)try{e[t]=n}catch(e){console.log(e)}if(e[t]!==n&&Object.defineProperty)try{var o=r||{};if("get"in o){var i=a("get",{},t,(function(){return r.get.call(this)}));o=Object.getOwnPropertyDescriptor(i,t)}else"value"in o||(o.value=n),"writable"in o||(o.writable=!0);Object.defineProperty(e,t,o)}catch(e){}e[t]!==n&&"undefined"!=typeof console&&console.warn&&console.warn("Unable to shim "+t)}void 0!==j.win.openDatabase&&t("shimIndexedDB",Ur,{enumerable:!1,configurable:!0}),"shimIndexedDB"in e&&e.shimIndexedDB?(e.shimIndexedDB.__useShim=function(){function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";t(e+"DOMException",ge),t(e+"DOMStringList",Et,{enumerable:!1,configurable:!0,writable:!0,value:Et}),t(e+"Event",O,{configurable:!0,writable:!0,value:O,enumerable:!1}),t(e+"CustomEvent",S,{configurable:!0,writable:!0,value:S,enumerable:!1}),t(e+"EventTarget",N,{configurable:!0,writable:!0,value:N,enumerable:!1})}var r,o=Rr;if(void 0!==j.win.openDatabase){if(Ur.__openDatabase=j.win.openDatabase.bind(j.win),t("indexedDB",Ur,{enumerable:!0,configurable:!0,get:function(){if(this!==e&&!ae(this)&&!this.shimNS)throw new TypeError("Illegal invocation");return Ur}}),[["IDBFactory",o],["IDBDatabase",Dr],["IDBObjectStore",lr],["IDBIndex",ir],["IDBTransaction",St],["IDBCursor",Mr],["IDBCursorWithValue",Gr],["IDBKeyRange",ht],["IDBRequest",De],["IDBOpenDBRequest",Oe],["IDBVersionChangeEvent",ce]].forEach((function(e){var n=d(e,2);t(n[0],n[1],{enumerable:!1,configurable:!0})})),j.fs&&(r=j.fs,Ir=r),j.fullIDLSupport&&(Object.setPrototypeOf(e.IDBOpenDBRequest,e.IDBRequest),Object.setPrototypeOf(e.IDBCursorWithValue,e.IDBCursor),Object.setPrototypeOf(Dr,N),Object.setPrototypeOf(De,N),Object.setPrototypeOf(St,N),Object.setPrototypeOf(ce,O),Object.setPrototypeOf(ge,Error),Object.setPrototypeOf(ge.prototype,Error.prototype),Object.setPrototypeOf(S,O),Object.setPrototypeOf(S.prototype,O.prototype)),e.indexedDB&&!e.indexedDB.toString().includes("[native code]")&&(j.addNonIDBGlobals&&n("Shim"),j.replaceNonIDBGlobals&&n()),!e.shimIndexedDB)return;e.shimIndexedDB.__setConnectionQueueOrigin()}},e.shimIndexedDB.__debug=function(e){j.DEBUG=e},e.shimIndexedDB.__setConfig=Qr,e.shimIndexedDB.__getConfig=function(e){if(!(e in j))throw new Error(e+" is not a valid configuration property");return j[e]},e.shimIndexedDB.__setUnicodeIdentifiers=function(e){Qr({UnicodeIDStart:e.UnicodeIDStart,UnicodeIDContinue:e.UnicodeIDContinue})}):(e.shimIndexedDB={},["__useShim","__debug","__setConfig","__getConfig","__setUnicodeIdentifiers"].forEach((function(t){e.shimIndexedDB[t]=function(){console.warn("This browser does not have WebSQL to shim.")}}))),"indexedDB"in e||"undefined"==typeof window||(e.indexedDB=e.indexedDB||"webkitIndexedDB"in e&&e.webkitIndexedDB||"mozIndexedDB"in e&&e.mozIndexedDB||"oIndexedDB"in e&&e.oIndexedDB||"msIndexedDB"in e&&e.msIndexedDB);var n=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(/Android (?:2|3|4\.[0-3])/.test(navigator.userAgent)&&!navigator.userAgent.includes("Chrome")||(!navigator.userAgent.includes("Safari")||navigator.userAgent.includes("Chrome"))&&/(iPad|iPhone|iPod)(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])* o[s\u017F] 9_/i.test(navigator.userAgent)&&"undefined"!=typeof window&&!("MSStream"in window))&&(n=!0),j.DEFAULT_DB_SIZE||(j.DEFAULT_DB_SIZE=1024*("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")?25:4)*1024),j.avoidAutoShim||e.indexedDB&&!n||void 0===j.win.openDatabase?(e.IDBDatabase=e.IDBDatabase||"webkitIDBDatabase"in e&&e.webkitIDBDatabase,e.IDBTransaction=e.IDBTransaction||"webkitIDBTransaction"in e&&e.webkitIDBTransaction||{},e.IDBCursor=e.IDBCursor||"webkitIDBCursor"in e&&e.webkitIDBCursor,e.IDBKeyRange=e.IDBKeyRange||"webkitIDBKeyRange"in e&&e.webkitIDBKeyRange):e.shimIndexedDB.__useShim()}()}));
1
+ /*! indexeddbshim - v16.1.0 - 9/1/2025 */
2
+ !function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}var t=0,n=1,r=2,o=3,i="undefined"==typeof DOMException?function(e,t){var n=new Error(e);return n.name=t,n}:DOMException,a=new WeakMap,s=new WeakMap,c=function(e){var t=this;this[Symbol.toStringTag]="Event",this.toString=function(){return"[object Event]"};var n=Array.prototype.slice.call(arguments),r=n[1],o=n[2];if(!arguments.length)throw new TypeError("Failed to construct 'Event': 1 argument required, but only 0 present.");o=o||{};var i={};"composed"in(r=r||{})&&(i.composed=r.composed),a.set(this,o),s.set(this,i);this.initEvent(e,r.bubbles,r.cancelable),["target","currentTarget","eventPhase","defaultPrevented"].forEach((function(e){var n=e;Object.defineProperty(t,n,{get:function(){return void 0!==i[n]?i[n]:n in o?o[n]:"eventPhase"===n?0:"defaultPrevented"!==n&&null}})}));var c=["type","bubbles","cancelable","isTrusted","timeStamp","initEvent","composedPath","composed"];"[object CustomEvent]"===this.toString()&&c.push("detail","initCustomEvent"),Object.defineProperties(this,c.reduce((function(e,t){var n=t;return e[n]={get:function(){return n in i?i[n]:n in o?o[n]:!["bubbles","cancelable","composed"].includes(n)&&void 0}},e}),{}))};c.prototype.preventDefault=function(){if(!(this instanceof c))throw new TypeError("Illegal invocation");var e=a.get(this),t=s.get(this);this.cancelable&&!t._passive&&(t.defaultPrevented=!0,"function"==typeof e.preventDefault&&e.preventDefault())},c.prototype.stopImmediatePropagation=function(){s.get(this)._stopImmediatePropagation=!0},c.prototype.stopPropagation=function(){s.get(this)._stopPropagation=!0},c.prototype.initEvent=function(e,t,n){var r=s.get(this);r._dispatched||(Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,get:function(){return e}}),Object.defineProperty(this,"bubbles",{enumerable:!0,configurable:!0,get:function(){return t}}),Object.defineProperty(this,"cancelable",{enumerable:!0,configurable:!0,get:function(){return n}}),r.type=e,void 0!==t&&(r.bubbles=t),void 0!==n&&(r.cancelable=n))},["type","target","currentTarget"].forEach((function(e){Object.defineProperty(c.prototype,e,{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}})})),["eventPhase","defaultPrevented","bubbles","cancelable","timeStamp"].forEach((function(e){Object.defineProperty(c.prototype,e,{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}})})),["NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE"].forEach((function(e,t){Object.defineProperty(c,e,{enumerable:!0,writable:!1,value:t}),Object.defineProperty(c.prototype,e,{writable:!1,value:t})})),c[Symbol.toStringTag]="Function",c.prototype[Symbol.toStringTag]="EventPrototype",Object.defineProperty(c,"prototype",{writable:!1});var u=function(e){var t=Array.prototype.slice.call(arguments),n=t[1],r=t[2];c.call(this,e,n,r),this[Symbol.toStringTag]="CustomEvent",this.toString=function(){return"[object CustomEvent]"},n=n||{},this.initCustomEvent(e,n.bubbles,n.cancelable,"detail"in n?n.detail:null)};function l(e,t,n){var r=e[t];void 0===r&&(e[t]=r=[]);var o="boolean"==typeof n?{capture:n}:n||{},i=JSON.stringify(o);return{listenersByTypeOptions:r.filter((function(e){return i===JSON.stringify(e.options)})),options:o,listenersByType:r}}Object.defineProperty(u.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:u}),u.prototype.initCustomEvent=function(e,t,n,r){if(!(this instanceof u))throw new TypeError("Illegal invocation");var o=s.get(this);u.call(this,e,{bubbles:t,cancelable:n,detail:r},arguments[4]),o._dispatched||(void 0!==r&&(o.detail=r),Object.defineProperty(this,"detail",{get:function(){return o.detail}}))},u[Symbol.toStringTag]="Function",u.prototype[Symbol.toStringTag]="CustomEventPrototype",Object.defineProperty(u.prototype,"detail",{enumerable:!0,configurable:!0,get:function(){throw new TypeError("Illegal invocation")}}),Object.defineProperty(u,"prototype",{writable:!1});var _={addListener:function(e,t,n,r){var o=l(e,n,r),i=o.listenersByTypeOptions;r=o.options;var a=o.listenersByType;i.some((function(e){return e.listener===t}))||a.push({listener:t,options:r})},removeListener:function(e,t,n,r){var o=l(e,n,r),i=o.listenersByType,a=JSON.stringify(o.options);i.some((function(r,o){return r.listener===t&&a===JSON.stringify(r.options)&&(i.splice(o,1),i.length||delete e[n],!0)}))},hasListener:function(e,t,n,r){return l(e,n,r).listenersByTypeOptions.some((function(e){return e.listener===t}))}};function d(){throw new TypeError("Illegal constructor")}Object.assign(d.prototype,["Early","","Late","Default"].reduce((function(e,t){return["add","remove","has"].forEach((function(n){e[n+t+"EventListener"]=function(e,r){var o=arguments[2];if(arguments.length<2)throw new TypeError("2 or more arguments required");if("string"!=typeof e)throw new i("UNSPECIFIED_EVENT_TYPE_ERR","UNSPECIFIED_EVENT_TYPE_ERR");try{"handleEvent"in r&&r.handleEvent.bind&&(r=r.handleEvent.bind(r))}catch(e){console.log("Uncaught `handleEvent` error",e)}var a="_"+t.toLowerCase()+(""===t?"l":"L")+"isteners";return this[a]||Object.defineProperty(this,a,{value:{}}),_[n+"Listener"](this[a],r,e,o)}})),e}),{})),Object.assign(d.prototype,{_legacyOutputDidListenersThrowCheck:void 0,__setOptions:function(e){e=e||{},this._defaultSync=e.defaultSync,this._extraProperties=e.extraProperties||[],e.legacyOutputDidListenersThrowFlag&&(this._legacyOutputDidListenersThrowCheck=!0,this._extraProperties.push("__legacyOutputDidListenersThrowError"))},dispatchEvent:function(e){return this._dispatchEvent(e,!0)},_dispatchEvent:function(e,a){var l=this;["early","","late","default"].forEach((function(e){var t="_"+e+(""===e?"l":"L")+"isteners";l[t]||Object.defineProperty(l,t,{value:{}})}));var _,d=s.get(e);if(d&&a&&d._dispatched)throw new i("The object is in an invalid state.","InvalidStateError");d?_=e:(_=function(e){var t=e.bubbles,n=e.cancelable,r=e.detail,o=e.type;return"detail"in e?new u(o,{bubbles:t,cancelable:n,detail:r},e):new c(o,{bubbles:t,cancelable:n},e)}(e),(d=s.get(_))._dispatched=!0,this._extraProperties.forEach((function(t){t in e&&(_[t]=e[t])})));var f=_.type;function p(){d.eventPhase=t,d.currentTarget=null,delete d._children}function h(){d._stopImmediatePropagation=void 0,d._stopPropagation=void 0,_.defaultPrevented&&d.cancelable||(d.eventPhase=r,_.target.invokeCurrentListeners(_.target._defaultListeners,_,f)),p()}var y=function(){return d._stopImmediatePropagation=void 0,d._stopPropagation=void 0,l._defaultSync?h():setTimeout(h,0),d.eventPhase=r,d._stopPropagation||(d._stopImmediatePropagation=void 0,d._stopPropagation=void 0,_.target.invokeCurrentListeners(_.target._lateListeners,_,f)),p(),!_.defaultPrevented};switch(a&&(d.target=this),"eventPhase"in _&&_.eventPhase){case n:if(d._stopPropagation)return y();this.invokeCurrentListeners(this._listeners,_,f);var b=d._children&&d._children.length&&d._children.pop();return b&&b!==_.target||(d.eventPhase=r),b&&(b._defaultSync=this._defaultSync),(b||this)._dispatchEvent(_,!1);case r:return d._stopPropagation?y():(this.invokeCurrentListeners(this._listeners,_,f,!0),d.bubbles?(d.eventPhase=o,this._dispatchEvent(_,!1)):y());case o:if(d._stopPropagation)return y();var g=this.__getParent&&this.__getParent();return g?(g.invokeCurrentListeners(g._listeners,_,f,!0),g._defaultSync=this._defaultSync,g._dispatchEvent(_,!1)):y();default:if(d.eventPhase=r,this.invokeCurrentListeners(this._earlyListeners,_,f),!("__getParent"in this))return d.eventPhase=r,this._dispatchEvent(_,!1);for(var m=this,v=this;m.__getParent&&null!==(m=m.__getParent());)d._children||(d._children=[]),d._children.push(v),v=m;return v._defaultSync=this._defaultSync,d.eventPhase=n,v._dispatchEvent(_,!1)}},invokeCurrentListeners:function(e,t,i,a){var c=this,u=s.get(t);u.currentTarget=this;var _=l(e,i,{}).listenersByType.concat(),d=_.length?1:0;return _.some((function(e,s){var l=a?c["on"+i]:null;if(u._stopImmediatePropagation)return!0;s===d&&"function"==typeof l&&c.tryCatch(t,(function(){!1===l.call(t.currentTarget,t)&&t.preventDefault()}));var _=e.options,f=_.once,p=_.passive,h=_.capture;if(u._passive=p,h&&t.target!==t.currentTarget&&t.eventPhase===n||t.eventPhase===r||!h&&t.target!==t.currentTarget&&t.eventPhase===o){var y=e.listener;c.tryCatch(t,(function(){y.call(t.currentTarget,t)})),f&&c.removeEventListener(i,y,_)}return!1})),this.tryCatch(t,(function(){var e=a?c["on"+i]:null;"function"==typeof e&&_.length<2&&(!1===e.call(t.currentTarget,t)&&t.preventDefault())})),!t.defaultPrevented},tryCatch:function(e,t){try{t()}catch(t){this.triggerErrorEvent(t,e)}},triggerErrorEvent:function(t,n){var r,o=t;"string"==typeof t&&(o=new Error("Uncaught exception: "+t));var i=!1;"undefined"==typeof window||"undefined"==typeof ErrorEvent||window&&"object"===("undefined"==typeof window?"undefined":e(window))&&!window.dispatchEvent?(i=!0,r=function(){setTimeout((function(){throw o}))}):r=function(){var e=new ErrorEvent("error",{error:t,message:o.message||"",filename:o.fileName||"",lineno:o.lineNumber||0,colno:o.columnNumber||0});window.dispatchEvent(e)},i&&this._legacyOutputDidListenersThrowCheck||r(),this._legacyOutputDidListenersThrowCheck&&(n.__legacyOutputDidListenersThrowError=o)}}),d.prototype[Symbol.toStringTag]="EventTargetPrototype",Object.defineProperty(d,"prototype",{writable:!1});var f=d,p={createInstance:function(e){var t=function(){this.__setOptions(e)};return t.prototype=f.prototype,new t}};d.ShimEvent=c,d.ShimCustomEvent=u,d.ShimDOMException=i,d.ShimEventTarget=d,d.EventTargetFactory=p;const h={},y={};function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var g,m;["DEBUG","cacheDatabaseInstances","autoName","fullIDLSupport","checkOrigin","cursorPreloadPackSize","UnicodeIDStart","UnicodeIDContinue","registerSCA","avoidAutoShim","win","DEFAULT_DB_SIZE","useSQLiteIndexes","fs","addNonIDBGlobals","replaceNonIDBGlobals","escapeDatabaseName","unescapeDatabaseName","databaseCharacterEscapeList","databaseNameLengthLimit","escapeNFDForDatabaseNames","addSQLiteExtension",["memoryDatabase",e=>{if(!/^(?::memory:|file::memory:(\?[^#]*)?(#.*)?)?$/u.test(e))throw new TypeError('`memoryDatabase` must be the empty string, ":memory:", or a "file::memory:[?queryString][#hash] URL".')}],"deleteDatabaseFiles","databaseBasePath","sysDatabaseBasePath","sqlBusyTimeout","sqlTrace","sqlProfile","createIndexes"].forEach((e=>{let t;Array.isArray(e)&&([e,t]=e),Object.defineProperty(y,e,{get:()=>h[e],set(n){t&&t(n),h[e]=n}})}));var v=b(m?g:(m=1,g=/[\xC0-\xC5\xC7-\xCF\xD1-\xD6\xD9-\xDD\xE0-\xE5\xE7-\xEF\xF1-\xF6\xF9-\xFD\xFF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0\u01A1\u01AF\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01F0\u01F4\u01F5\u01F8-\u021B\u021E\u021F\u0226-\u0233\u0344\u0385\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AA-\u03B0\u03CA-\u03CE\u03D3\u03D4\u0400\u0401\u0403\u0407\u040C-\u040E\u0419\u0439\u0450\u0451\u0453\u0457\u045C-\u045E\u0476\u0477\u04C1\u04C2\u04D0-\u04D3\u04D6\u04D7\u04DA-\u04DF\u04E2-\u04E7\u04EA-\u04F5\u04F8\u04F9\u0622-\u0626\u06C0\u06C2\u06D3\u0929\u0931\u0934\u0958-\u095F\u09CB\u09CC\u09DC\u09DD\u09DF\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B48\u0B4B\u0B4C\u0B5C\u0B5D\u0B94\u0BCA-\u0BCC\u0C48\u0CC0\u0CC7\u0CC8\u0CCA\u0CCB\u0D4A-\u0D4C\u0DDA\u0DDC-\u0DDE\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F73\u0F75\u0F76\u0F78\u0F81\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9\u1026\u1B06\u1B08\u1B0A\u1B0C\u1B0E\u1B12\u1B3B\u1B3D\u1B40\u1B41\u1B43\u1E00-\u1E99\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FC1-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEE\u1FF2-\u1FF4\u1FF6-\u1FFC\u212B\u219A\u219B\u21AE\u21CD-\u21CF\u2204\u2209\u220C\u2224\u2226\u2241\u2244\u2247\u2249\u2260\u2262\u226D-\u2271\u2274\u2275\u2278\u2279\u2280\u2281\u2284\u2285\u2288\u2289\u22AC-\u22AF\u22E0-\u22E3\u22EA-\u22ED\u2ADC\u304C\u304E\u3050\u3052\u3054\u3056\u3058\u305A\u305C\u305E\u3060\u3062\u3065\u3067\u3069\u3070\u3071\u3073\u3074\u3076\u3077\u3079\u307A\u307C\u307D\u3094\u309E\u30AC\u30AE\u30B0\u30B2\u30B4\u30B6\u30B8\u30BA\u30BC\u30BE\u30C0\u30C2\u30C5\u30C7\u30C9\u30D0\u30D1\u30D3\u30D4\u30D6\u30D7\u30D9\u30DA\u30DC\u30DD\u30F4\u30F7-\u30FA\u30FE\uAC00-\uD7A3\uFB1D\uFB1F\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4E]|\uD801[\uDDC9\uDDE4]|\uD804[\uDC9A\uDC9C\uDCAB\uDD2E\uDD2F\uDF4B\uDF4C\uDF83\uDF85\uDF8E\uDF91\uDFC5\uDFC7\uDFC8]|\uD805[\uDCBB\uDCBC\uDCBE\uDDBA\uDDBB]|\uD806\uDD38|\uD818[\uDD21-\uDD28]|\uD81B[\uDD68-\uDD6A]|\uD834[\uDD5E-\uDD64\uDDBB-\uDDC0]/));function E(e){return e.replaceAll(/([\uD800-\uDBFF])(?![\uDC00-\uDFFF])|(^|[^\uD800-\uDBFF])([\uDC00-\uDFFF])/gu,(function(e,t,n,r){return t?"^2"+t.codePointAt().toString(16).padStart(4,"0"):(n||"")+"^3"+r.codePointAt().toString(16).padStart(4,"0")}))}function w(e){return"_"+E(e.replaceAll("^","^^").replaceAll("\0","^0").replaceAll(/([A-Z])/gu,"^$1"))}function D(e){return E(e.replaceAll("^","^^").replaceAll("\0","^0"))}function I(e){return function(e){return e.replaceAll(/(\^+)3(d[0-9a-f]{3})/gu,((e,t,n)=>t.length%2?t.slice(1)+String.fromCodePoint(Number.parseInt(n,16)):e)).replaceAll(/(\^+)2(d[0-9a-f]{3})/gu,((e,t,n)=>t.length%2?t.slice(1)+String.fromCodePoint(Number.parseInt(n,16)):e))}(e).replaceAll(/(\^+)0/gu,((e,t)=>t.length%2?t.slice(1)+"\0":e)).replaceAll("^^","^")}function O(e){return'"'+function(e){return e.replaceAll('"','""')}(e)+'"'}function S(e){if(y.escapeDatabaseName)return y.escapeDatabaseName(D(e));if(e="D"+w(e),!1!==y.escapeNFDForDatabaseNames&&(e=e.replaceAll(new RegExp(v,"gu"),(function(e){return"^4"+e.codePointAt(0).toString(16).padStart(6,"0")}))),!1!==y.databaseCharacterEscapeList&&(e=e.replace(y.databaseCharacterEscapeList?new RegExp(y.databaseCharacterEscapeList,"gu"):/[\u0000-\u001F\u007F"*/:<>?\\|]/gu,(function(e){return"^1"+e.charCodeAt(0).toString(16).padStart(2,"0")}))),!1!==y.databaseNameLengthLimit&&e.length>=(y.databaseNameLengthLimit||254)-(!1!==y.addSQLiteExtension?7:0))throw new Error("Unexpectedly long database name supplied; length limit required for Node compatibility; passed length: "+e.length+"; length limit setting: "+(y.databaseNameLengthLimit||254)+".");return e+(!1!==y.addSQLiteExtension?".sqlite":"")}function T(e){return O("S"+w(e))}function N(e){return O("I"+w(e))}function A(e){return"I"+w(e)}function x(e){return e.replaceAll("^","^^")}function B(e,t){return t[Symbol.hasInstance](e)}function j(e){return null!==e&&"object"==typeof e}function C(e){return j(e)&&Symbol.iterator in e&&"function"==typeof e[Symbol.iterator]}function P(e,t){t.forEach((t=>{const n={get[t](){throw new TypeError("Illegal invocation")},set[t](e){throw new TypeError("Illegal invocation")}},r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r)}))}function k(e,t){t.forEach((t=>{const n={get[t](){throw new TypeError("Illegal invocation")}},r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r)}))}function R(e,t){(t="string"==typeof t?[t]:t).forEach((t=>{const n={get[t](){return e["__"+t]},set[t](n){e["__"+t]=n}},r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r)})),t.forEach((t=>{e[t]=null}))}function F(e,t,n=null){(t="string"==typeof t?[t]:t).forEach((function(t){let r;n&&t in n?r=n[t]:(Object.defineProperty(e,"__"+t,{enumerable:!1,configurable:!1,writable:!0}),r={get[t](){return this["__"+t]}});const o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,o)}))}function L(e){const t=y.UnicodeIDStart||"[$A-Z_a-z]",n=y.UnicodeIDContinue||"[$0-9A-Z_a-z]";return new RegExp("^"+("(?:"+t+"|[$_])")+("(?:"+n+"|[$_‌‍])")+"*$","u").test(e)}function q(e){return"string"==typeof e&&(""===e||L(e)||e.split(".").every((e=>L(e))))}function U(e){return q(e)||Array.isArray(e)&&Boolean(e.length)&&[...e].every((e=>q(e)))}function M(e,t){let n,r;switch(e=Math.floor(Number(e)),t){case"unsigned long long":n=9007199254740991,r=0;break;case"unsigned long":n=4294967295,r=0;break;default:throw new Error("Unrecognized type supplied to enforceRange")}if(!Number.isFinite(e)||e>n||e<r)throw new TypeError("Invalid range: "+e);return e}function V(e,t){return null===e&&t?"":K(e)}function K(e){return""+e}function G(e){return C(e)?[...e].map((e=>K(e))):K(e)}function H(e){return null==e}function Q(e,t,n){const r=new c(e,n);return r.debug=t,r}Object.defineProperty(c,Symbol.hasInstance,{value:e=>j(e)&&"target"in e&&"bubbles"in e&&"boolean"==typeof e.bubbles});function W(e){c.call(this,e),this[Symbol.toStringTag]="IDBVersionChangeEvent",this.toString=function(){return"[object IDBVersionChangeEvent]"},this.__eventInitDict=arguments[1]||{}}function z(e,t){return new DOMException.prototype.constructor(t,e||"DOMException")}W.prototype=Object.create(c.prototype),W.prototype[Symbol.toStringTag]="IDBVersionChangeEventPrototype",["oldVersion","newVersion"].forEach((e=>{const t={get[e](){if(!(this instanceof W))throw new TypeError("Illegal invocation");return this.__eventInitDict&&this.__eventInitDict[e]||("oldVersion"===e?0:null)}},n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(W.prototype,e,n)})),Object.defineProperty(W,Symbol.hasInstance,{value:e=>j(e)&&"oldVersion"in e&&"defaultPrevented"in e&&"boolean"==typeof e.defaultPrevented}),Object.defineProperty(W.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:W}),Object.defineProperty(W,"prototype",{writable:!1});const Y={IndexSizeError:1,HierarchyRequestError:3,WrongDocumentError:4,InvalidCharacterError:5,NoModificationAllowedError:7,NotFoundError:8,NotSupportedError:9,InUseAttributeError:10,InvalidStateError:11,SyntaxError:12,InvalidModificationError:13,NamespaceError:14,InvalidAccessError:15,TypeMismatchError:17,SecurityError:18,NetworkError:19,AbortError:20,URLMismatchError:21,QuotaExceededError:22,TimeoutError:23,InvalidNodeTypeError:24,DataCloneError:25,EncodingError:0,NotReadableError:0,UnknownError:0,ConstraintError:0,DataError:0,TransactionInactiveError:0,ReadOnlyError:0,VersionError:0,OperationError:0,NotAllowedError:0},$={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};const J=function(){function e(e,t){this[Symbol.toStringTag]="DOMException",this._code=t in Y?Y[t]:$[t]||0,this._name=t||"Error",this._message=void 0===e?"":""+e,Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,writable:!0,value:this._code}),void 0!==t&&Object.defineProperty(this,"name",{configurable:!0,enumerable:!0,writable:!0,value:this._name}),void 0!==e&&Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,writable:!0,value:this._message})}const t=function(){};return t.prototype=Object.create(Error.prototype),["name","message"].forEach((n=>{Object.defineProperty(t.prototype,n,{enumerable:!0,get(){if(!(this instanceof e||this instanceof t||this instanceof Error))throw new TypeError("Illegal invocation");return this["name"===n?"_name":"_message"]}})})),Object.defineProperty(t.prototype,"code",{configurable:!0,enumerable:!0,get(){throw new TypeError("Illegal invocation")}}),e.prototype=new t,e.prototype[Symbol.toStringTag]="DOMExceptionPrototype",Object.defineProperty(e,"prototype",{writable:!1}),Object.keys(Y).forEach((t=>{Object.defineProperty(e.prototype,t,{enumerable:!0,configurable:!1,value:Y[t]}),Object.defineProperty(e,t,{enumerable:!0,configurable:!1,value:Y[t]})})),Object.keys($).forEach((t=>{Object.defineProperty(e.prototype,t,{enumerable:!0,configurable:!1,value:$[t]}),Object.defineProperty(e,t,{enumerable:!0,configurable:!1,value:$[t]})})),Object.defineProperty(e.prototype,"constructor",{writable:!0,configurable:!0,enumerable:!1,value:e}),e}();function X(e,t,n){if(y.DEBUG){const r=n&&"object"==typeof n&&n.message?n.message:n,o="function"==typeof console.error?"error":"log";console[o](e+": "+t+". "+(r||"")),console.trace&&console.trace()}}function Z(e){return e&&"object"==typeof e&&"string"==typeof e.name}function ee(e){let t,n;if(4===e.code)t="QuotaExceededError",n="The operation failed because there was not enough remaining storage space, or the storage quota was reached and the user declined to give more space to the database.";else t="UnknownError",n="The operation failed for reasons unrelated to the database itself and not covered by any other errors.";n+=" ("+e.message+")--("+e.code+")";const r=re(t,n);return r.sqlError=e,r}let te,ne=!1;try{te=z("test name","test message"),Z(te)&&"test name"===te.name&&"test message"===te.message&&(ne=!0)}catch(e){}const re=ne?function(e,t,n){return X(e,t,n),z(e,t)}:function(e,t,n){return X(e,t,n),function(e,t){return new J(t,e)}(e,t)},oe=ne?DOMException:J,ie=["onsuccess","onerror"],ae=["source","transaction","readyState"],se=["result","error"];function ce(){throw new TypeError("Illegal constructor")}ce.__super=function(){this[Symbol.toStringTag]="IDBRequest",this.__setOptions({legacyOutputDidListenersThrowFlag:!0}),se.forEach((e=>{Object.defineProperty(this,"__"+e,{enumerable:!1,configurable:!1,writable:!0}),Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get(){if(!this.__done)throw re("InvalidStateError","Can't get "+e+"; the request is still pending.");return this["__"+e]}})})),F(this,ae,{readyState:{get readyState(){return this.__done?"done":"pending"}}}),R(this,ie),this.__result=void 0,this.__error=this.__source=this.__transaction=null,this.__done=!1},ce.__createInstance=function(){return new ce.__super},ce.prototype=p.createInstance({extraProperties:["debug"]}),ce.prototype[Symbol.toStringTag]="IDBRequestPrototype",ce.prototype.__getParent=function(){return"[object IDBOpenDBRequest]"===this.toString()?null:this.__transaction},k(ce.prototype,ae),k(ce.prototype,se),P(ce.prototype,ie),Object.defineProperty(ce.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:ce}),ce.__super.prototype=ce.prototype,Object.defineProperty(ce,"prototype",{writable:!1});const ue=["onblocked","onupgradeneeded"];function le(){throw new TypeError("Illegal constructor")}le.prototype=Object.create(ce.prototype),Object.defineProperty(le.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:le});const _e=le;function de(e){return e&&"function"==typeof e.then}function fe(e,t){e.then(null,t)}le.__createInstance=function(){function e(){ce.__super.call(this),this[Symbol.toStringTag]="IDBOpenDBRequest",this.__setOptions({legacyOutputDidListenersThrowFlag:!0,extraProperties:["oldVersion","newVersion","debug"]}),R(this,ue)}return e.prototype=_e.prototype,new e},P(le.prototype,ue),le.prototype[Symbol.toStringTag]="IDBOpenDBRequestPrototype",Object.defineProperty(le,"prototype",{writable:!1});const pe=2,he=0,ye=1;function be(e){const t=this;function n(e,n){t.v=e,t.s=n,t.c[n].forEach((function(t){t(e)})),t.c[n].length&&(t.c=null)}function r(e){t.c&&(de(e)?fe(e.then(r),r):n(e,ye))}t.v=0,t.s=pe,t.c=[[],[]];try{e((function e(o){t.c&&(de(o)?fe(o.then(e),r):n(o,he))}),r)}catch(e){r(e)}}function ge(e,t){const n=Ge(e),r=Ge(t),o=n>r?1:n===r?0:-1;if(y.DEBUG){let o=He(n),i=He(r);"object"==typeof e&&(e=JSON.stringify(e),o=JSON.stringify(o)),"object"==typeof t&&(t=JSON.stringify(t),i=JSON.stringify(i)),o!==e&&console.warn(e+" was incorrectly encoded as "+o),i!==t&&console.warn(t+" was incorrectly encoded as "+i)}return o}be.prototype.then=function(e,t){const n=this;return new be((function(r,o){const i="function"==typeof t?t:o;function a(){try{r(e?e(n.v):n.v)}catch(e){i(e)}}n.s===he?a():n.s===ye?i(n.v):(n.c[he].push(a),n.c[ye].push(i))}))},be.prototype.catch=function(e){const t=this;return new be((function(n,r){function o(){try{n(e(t.v))}catch(e){r(e)}}t.s===ye?o():t.s===he?n(t.v):(t.c[ye].push(o),t.c[he].push(n))}))},be.all=function(e){return new be(((t,n)=>{let r=e.length;const o=[];r?e.forEach(((i,a)=>{de(i)?fe(i.then((e=>{o[a]=e,--r||t(o)})),n):(o[a]=i,--r||t(e))})):t(o)}))},be.race=function(e){let t=!1;return new be(((n,r)=>{e.some(((e,o)=>de(e)?(fe(e.then((e=>{t||(n(e),t=!0)})),r),!1):(n(e),t=!0,!0)))}))},be.resolve=function(e){return new be(((t,n)=>{t(e)}))},be.reject=function(e){return new be(((t,n)=>{n(e)}))};const me={invalid:100,number:200,date:300,string:400,binary:500,array:600},ve=Object.keys(me);ve.forEach((e=>{me[e]=String.fromCodePoint(me[e])}));const Ee=ve.reduce(((e,t)=>(e[me[t]]=t,e)),{}),we=["negativeInfinity","bigNegative","smallNegative","smallPositive","bigPositive","positiveInfinity"],De={invalid:{encode:()=>me.invalid+"-",decode(){}},number:{encode(e){let t=e===Number.MIN_VALUE?"0."+"0".repeat(214)+"2":Math.abs(e).toString(32);const n=t.indexOf(".");t=-1!==n?t.replace(".",""):t;const r=t.search(/[^0]/u);let o,i,a;return t=t.slice(r),Number.isFinite(Number(e))?e<0?e>-1?(o=we.indexOf("smallNegative"),i=Ie(r),a=Se(Oe(t))):(o=we.indexOf("bigNegative"),i=Se(Ie(-1!==n?n:t.length)),a=Se(Oe(t))):e<1?(o=we.indexOf("smallPositive"),i=Se(Ie(r)),a=Oe(t)):(o=we.indexOf("bigPositive"),i=Ie(-1!==n?n:t.length),a=Oe(t)):(i=Ae(2),a=Ae(11),o=we.indexOf(e>0?"positiveInfinity":"negativeInfinity")),me.number+"-"+o+i+a},decode(e){const t=Number(e.slice(2,3));let n=e.slice(3,5),r=e.slice(5,16);switch(we[t]){case"negativeInfinity":return Number.NEGATIVE_INFINITY;case"positiveInfinity":return Number.POSITIVE_INFINITY;case"bigPositive":return Te(r,n);case"smallPositive":return n=xe(Se(n)),Te(r,n);case"smallNegative":return n=xe(n),r=Se(r),-Te(r,n);case"bigNegative":return n=Se(n),r=Se(r),-Te(r,n);default:throw new Error("Invalid number.")}}},string:{encode:(e,t)=>(t&&(e=e.replaceAll(/(.)/gu,"-$1")+" "),me.string+"-"+e),decode:(e,t)=>(e=e.slice(2),t&&(e=e.slice(0,-1).replaceAll(/-(.)/gu,"$1")),e)},array:{encode(e){const t=[];for(const[n,r]of e.entries()){const e=Ge(r,!0);t[n]=e}return t.push(me.invalid+"-"),me.array+"-"+JSON.stringify(t)},decode(e){const t=JSON.parse(e.slice(2));t.pop();for(let e=0;e<t.length;e++){const n=He(t[e],!0);t[e]=n}return t}},date:{encode:e=>me.date+"-"+e.toJSON(),decode:e=>new Date(e.slice(2))},binary:{encode:e=>me.binary+"-"+(e.byteLength?[...Ce(e)].map((e=>String(e).padStart(3,"0"))):""),decode(e){const t=e.slice(2),n=t.length?t.split(",").map((e=>Number.parseInt(e))):[],r=new ArrayBuffer(n.length);return new Uint8Array(r).set(n),r}}};function Ie(e){const t=e.toString(32);return 1===t.length?"0"+t:t}function Oe(e){return(e+Ae(11)).slice(0,11)}function Se(e){let t="";for(const n of e)t+=(31-Number.parseInt(n,32)).toString(32);return t}function Te(e,t){const n=Number.parseInt(t,32);if(n<0)return Ne(Number.parseInt(e,32)*32**(n-10));if(n<11){const t=e.slice(0,n),r=Number.parseInt(t,32),o=e.slice(n);return Ne(r+Number.parseInt(o,32)*32**(n-11))}const r=e+Ae(n-11);return Number.parseInt(r,32)}function Ne(e,t=16){return Number.parseFloat(e.toPrecision(t))}function Ae(e){return"0".repeat(e)}function xe(e){return"-"+e}function Be(e){if(Array.isArray(e))return"array";if(j(t=e)&&"getDate"in t&&"function"==typeof t.getDate)return"date";var t;if(function(e){return j(e)&&"byteLength"in e&&"number"==typeof e.byteLength&&("slice"in e&&"function"==typeof e.slice||"getFloat64"in e&&"function"==typeof e.getFloat64)}(e))return"binary";const n=typeof e;return["string","number"].includes(n)?n:"invalid"}function je(e,t){return Pe(e,t,!1,!0)}function Ce(e){let t=0,n=0;if(ArrayBuffer.isView(e)){if(void 0===e.buffer)throw new TypeError("Could not copy the bytes held by a buffer source as the buffer was undefined.");t=e.byteOffset,n=e.byteLength}else n=e.byteLength;return new Uint8Array("buffer"in e&&e.buffer||e,t,n)}function Pe(e,t,n,r){if((t=t||[]).includes(e))return{type:"array",invalid:!0,message:"An array key cannot be circular"};const o=Be(e),i={type:o,value:e};switch(o){case"number":return Number.isNaN(e)?{type:"NaN",invalid:!0}:Object.is(e,-0)?{type:o,value:0}:i;case"string":return i;case"binary":return{type:"binary",value:Ce(e)};case"array":{const i=e,a=i.length;t.push(e);const s=[];for(let e=0;e<a;e++){if(!n&&!Object.hasOwn(i,e))return{type:o,invalid:!0,message:"Does not have own index property"};try{const a=Pe(i[e],t,!1,r);if(a.invalid){if(n)continue;return{type:o,invalid:!0,message:"Bad array entry value-to-key conversion"}}(!n||!r&&s.every((e=>0!==ge(e,a.value)))||r&&s.every((e=>0!==ge(e,a))))&&s.push(r?a:a.value)}catch(e){if(!n)throw e}}return{type:o,value:s}}case"date":{const t=e;return Number.isNaN(t.getTime())?{type:o,invalid:!0,message:"Not a valid date"}:r?{type:o,value:t.getTime()}:{type:o,value:new Date(t)}}default:{const t=null===e?"null":typeof e;return{type:t,invalid:!0,message:"Not a valid key; type "+t}}}}function ke(e,t){return Pe(e,null,!0,t)}function Re(e,t){const n=je(e,t);if(n.invalid)throw re("DataError",n.message||"Not a valid key; type: "+n.type);return n}function Fe(e,t,n,r){const o=Le(e,t);return o.failure?o:n?ke(o.value,r):Pe(o.value,null,!1,r)}function Le(e,t,n,r){if(Array.isArray(t)){const n=[];return t.some((t=>{const r=Le(e,t);return!!r.failure||(n.push(r.value),!1)}))?{failure:!0}:{value:n}}if(""===t)return{value:e};return t.split(".").some((t=>{if("length"!==t||"string"!=typeof e&&!Array.isArray(e))if(j(n=e)&&"size"in n&&"number"==typeof n.size&&"slice"in n&&"function"==typeof n.slice&&!("lastModified"in n))switch(t){case"size":case"type":e=e[t]}else{if(!function(e){return j(e)&&"name"in e&&"string"==typeof e.name&&"slice"in e&&"function"==typeof e.slice&&"lastModified"in e}(e))return!j(e)||!Object.hasOwn(e,t)||void 0===(e=e[t]);switch(t){case"name":case"lastModified":e=e[t];break;case"lastModifiedDate":e=new Date(e.lastModified)}}else e=e.length;var n;return!1}))?{failure:!0}:{value:e}}function qe(e,t,n){const r=n.split("."),o=r.pop();r.forEach((t=>{Object.hasOwn(e,t)||(e[t]={}),e=e[t]})),e[o]=t}function Ue(e,t){const n=t.split(".");n.pop();for(const t of n){if(!j(e))return!1;if(!Object.hasOwn(e,t))return!0;e=e[t]}return j(e)}function Me(e,t,n){let r=void 0===t.lower,o=void 0===t.upper;const i=Ge(e,!0),a=n?t.__lowerCached:Ge(t.lower,!0),s=n?t.__upperCached:Ge(t.upper,!0);return!r&&(t.lowerOpen&&null!==i&&null!==a&&i>a||!t.lowerOpen&&(!i&&!a||null!==i&&null!==a&&i>=a))&&(r=!0),!o&&(t.upperOpen&&null!==i&&null!==s&&i<s||!t.upperOpen&&(!i&&!s||null!==i&&null!==s&&i<=s))&&(o=!0),r&&o}function Ve(e,t){return"array"===Ee[t.slice(0,1)]?t.indexOf(e)>1:t===e}function Ke(e,t){const n=[];if(Array.isArray(e))for(let r of e){if(Array.isArray(r)){if(t&&t.lower===t.upper)continue;if(1!==r.length){Ke(r,t).length>0&&n.push(r);continue}r=r[0]}(H(t)||Me(r,t,!0))&&n.push(r)}else(H(t)||Me(e,t,!0))&&n.push(e);return n}function Ge(e,t){return void 0===e?null:De[Be(e)].encode(e,t)}function He(e,t){if("string"==typeof e)return De[Ee[e.slice(0,1)]].decode(e,t)}function Qe(e,t){return He(Ge(e,t),t)}const We=9007199254740992;function ze(e,t,n,r){e.executeSql('SELECT "currNum" FROM __sys__ WHERE "name" = ?',[D(t.__currentName)],(function(e,t){1!==t.rows.length?n(1):n(t.rows.item(0).currNum)}),(function(e,t){return r(re("DataError","Could not get the auto increment value for key",t)),!1}))}function Ye(e,t,n,r,o){const i='UPDATE __sys__ SET "currNum" = ? WHERE "name" = ?',a=[n,D(t.__currentName)];y.DEBUG&&console.log(i,a),e.executeSql(i,a,(function(){r(n)}),(function(e,t){return o(re("UnknownError","Could not set the auto increment value for key",t)),!1}))}function $e(e,t,n,r,o){return Ye(e,t,n=n===We?n+2:n+1,r,o)}function Je(e,t,n,r){ze(e,t,(function(o){o>We?n("failure"):$e(e,t,o,(function(){n(null,o,o)}),r)}),r)}function Xe(e,t,n,r,o){"number"!=typeof n||n<1?r():ze(e,t,(function(i){const a=Math.floor(Math.min(n,We));a>=i?$e(e,t,a,(function(){r(i)}),o):r()}),o)}var Ze=Object.freeze({__proto__:null,assignCurrentNumber:Ye,checkKeyCouldBeInjectedIntoValue:Ue,convertKeyToValue:function e(t){const{type:n,value:r}=t;switch(n){case"number":case"string":return r;case"array":{const t=[],n=r.length;let o=0;for(;o<n;){const n=e(r[o]);t[o]=n,o++}return t}case"date":return new Date(r);case"binary":{const e=r.length,t=new ArrayBuffer(e);return new Uint8Array(t,r.byteOffset||0,r.byteLength).set(r),t}default:throw new Error("Bad key")}},convertValueToKey:je,convertValueToKeyRethrowingAndIfInvalid:Re,convertValueToKeyValueDecoded:Pe,convertValueToMultiEntryKey:function(e){return Pe(e,null,!0,!0)},convertValueToMultiEntryKeyDecoded:ke,decode:He,encode:Ge,evaluateKeyPathOnValue:function(e,t,n){return Le(e,t)},extractKeyFromValueUsingKeyPath:function(e,t,n){return Fe(e,t,n,!0)},extractKeyValueDecodedFromValueUsingKeyPath:Fe,findMultiEntryMatches:Ke,generateKeyForStore:Je,injectKeyIntoValueUsingKeyPath:qe,isKeyInRange:Me,isMultiEntryMatch:Ve,possiblyUpdateKeyGenerator:Xe,roundTrip:Qe});function et(){throw this.__lowerOpen=!1,this.__upperOpen=!1,new TypeError("Illegal constructor")}const tt=et;function nt(e,t,n,r,o,i){if(e&&(void 0!==e.lower||void 0!==e.upper)){let a,s;o&&n.push("AND");const c=void 0!==e.lower,u=void 0!==e.upper;if(c&&(a=i?e.__lowerCached:Ge(e.lower)),u&&(s=i?e.__upperCached:Ge(e.upper)),c){if(r.push(D(a)),u&&a===s&&!e.lowerOpen&&!e.upperOpen)return void n.push(t,"=","?");n.push(t,e.lowerOpen?">":">=","?")}c&&u&&n.push("AND"),u&&(n.push(t,e.upperOpen?"<":"<=","?"),r.push(D(s)))}}function rt(e,t){if(B(e,et))return"[object IDBKeyRange]"!==e.toString()?et.__createInstance(e.lower,e.upper,e.lowerOpen,e.upperOpen):e;if(!H(e))return Re(e),et.only(e);if(t)throw re("DataError","No key or range was specified")}et.__createInstance=function(e,t,n,r){function o(){if(this[Symbol.toStringTag]="IDBKeyRange",void 0===e&&void 0===t)throw re("DataError","Both arguments to the key range method cannot be undefined");let o,i;if(void 0!==e&&(o=Qe(e),Re(e)),void 0!==t&&(i=Qe(t),Re(t)),void 0!==e&&void 0!==t&&e!==t&&Ge(e)>Ge(t))throw re("DataError","`lower` must not be greater than `upper` argument in `bound()` call.");this.__lower=o,this.__upper=i,this.__lowerOpen=Boolean(n),this.__upperOpen=Boolean(r)}return o.prototype=tt.prototype,new o},et.prototype.includes=function(e){if(!j(this)||"boolean"!=typeof this.__lowerOpen)throw new TypeError("Illegal invocation");if(!arguments.length)throw new TypeError("IDBKeyRange.includes requires a key argument");return Re(e),Me(e,this)},et.only=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.only requires a value argument");return et.__createInstance(e,e,!1,!1)},et.lowerBound=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.lowerBound requires a value argument");return et.__createInstance(e,void 0,arguments[1],!0)},et.upperBound=function(e){if(!arguments.length)throw new TypeError("IDBKeyRange.upperBound requires a value argument");return et.__createInstance(void 0,e,!0,arguments[1])},et.bound=function(e,t){if(arguments.length<=1)throw new TypeError("IDBKeyRange.bound requires lower and upper arguments");return et.__createInstance(e,t,arguments[2],arguments[3])},et.prototype[Symbol.toStringTag]="IDBKeyRangePrototype",["lower","upper","lowerOpen","upperOpen"].forEach((e=>{Object.defineProperty(et.prototype,"__"+e,{enumerable:!1,configurable:!1,writable:!0});const t={get[e](){if(!j(this)||"boolean"!=typeof this.__lowerOpen)throw new TypeError("Illegal invocation");return this["__"+e]}},n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(et.prototype,e,n)})),Object.defineProperty(et,Symbol.hasInstance,{value:e=>j(e)&&"upper"in e&&"lowerOpen"in e&&"boolean"==typeof e.lowerOpen}),Object.defineProperty(et,"prototype",{writable:!1});let ot=!1;const it={test:!0};if(Object.defineProperty)try{Object.defineProperty(it,"test",{enumerable:!1}),it.test&&(ot=!0)}catch(e){}const at=function(){throw this._items=[],this._length=0,new TypeError("Illegal constructor")};at.prototype={constructor:at,contains(e){if(!arguments.length)throw new TypeError("DOMStringList.contains must be supplied a value");return this._items.includes(e)},item(e){if(!arguments.length)throw new TypeError("DOMStringList.item must be supplied a value");return e<0||e>=this.length||!Number.isInteger(e)?null:this._items[e]},clone(){const e=at.__createInstance();return e._items=this._items.slice(),e._length=this.length,e.addIndexes(),e},addIndexes(){for(let e=0;e<this._items.length;e++)this[e]=this._items[e]},sortList(){return this._items.sort(),this.addIndexes(),this._items},forEach(e,t){this._items.forEach(e,t)},map(e,t){return this._items.map(e,t)},indexOf(e){return this._items.indexOf(e)},push(e){this._items.push(e),this._length++,this.sortList()},splice(...e){this._items.splice(...e),this._length=this._items.length;for(const e in this)e===String(Number.parseInt(e))&&delete this[e];this.sortList()},[Symbol.toStringTag]:"DOMStringListPrototype",*[Symbol.iterator](){let e=0;for(;e<this._items.length;)yield this._items[e++]}},Object.defineProperty(at,Symbol.hasInstance,{value:e=>"DOMStringListPrototype"===Object.prototype.toString.call(e)});const st=at;if(Object.defineProperty(at,"__createInstance",{value(){const e=function(){this.toString=function(){return"[object DOMStringList]"},Object.defineProperty(this,"length",{enumerable:!0,get(){return this._length}}),this._items=[],this._length=0};return e.prototype=st.prototype,new e}}),ot){Object.defineProperty(at,"prototype",{writable:!1});["addIndexes","sortList","forEach","map","indexOf","push","splice","constructor","__createInstance"].forEach((e=>{Object.defineProperty(at.prototype,e,{enumerable:!1})})),Object.defineProperty(at.prototype,"length",{configurable:!0,enumerable:!0,get(){throw new TypeError("Illegal invocation")}});["_items","_length"].forEach((e=>{Object.defineProperty(at.prototype,e,{enumerable:!1,writable:!0})}))}let ct=0;const ut=["onabort","oncomplete","onerror"],lt=["objectStoreNames","mode","db","error"];function _t(){throw new TypeError("Illegal constructor")}const dt=_t;function ft(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ht(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,vt(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function yt(e,t,n){return(t=vt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bt(Object(n),!0).forEach((function(t){yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||wt(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vt(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function Et(e){return Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Et(e)}function wt(e,t){if(e){if("string"==typeof e)return ft(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ft(e,t):void 0}}_t.__createInstance=function(e,t,n){function r(){const r=this;r[Symbol.toStringTag]="IDBTransaction",F(r,lt),r.__id=++ct,r.__active=!0,r.__running=!1,r.__errored=!1,r.__requests=[],r.__objectStoreNames=t,r.__mode=n,r.__db=e,r.__error=null,r.__setOptions({legacyOutputDidListenersThrowFlag:!0}),lt.forEach((e=>{Object.defineProperty(this,e,{configurable:!0})})),R(this,ut),r.__storeHandles={},setTimeout((()=>{r.__executeRequests()}),0)}return r.prototype=dt.prototype,new r},_t.prototype=p.createInstance({defaultSync:!0,extraProperties:["complete"]}),_t.prototype.__transFinishedCb=function(e,t){t(Boolean(e))},_t.prototype.__executeRequests=function(){const e=this;e.__running?y.DEBUG&&console.log("Looks like the request set is already running",e.mode):(e.__running=!0,e.db.__db["readonly"===e.mode?"readTransaction":"transaction"]((function(t){e.__tx=t;let n,r=-1;function o(t,r){if(e.__errored||e.__requestsFinished)return;if(r&&(n.req=r),!n.req)return;if(n.req.__done)return;n.req.__done=!0,n.req.__result=t,n.req.__error=null,e.__active=!0;const o=Q("success");if(n.req.dispatchEvent(o),o.__legacyOutputDidListenersThrowError)return X("Error","An error occurred in a success handler attached to request chain",o.__legacyOutputDidListenersThrowError),void e.__abortTransaction(re("AbortError","A request was aborted (in user handler after success)."));a()}function i(...t){if(e.__errored||e.__requestsFinished)return;if(n.req&&n.req.__done)return;const r=function(e){let t;if(e){if(1===e.length)return e[0];for(const n of e){if(Z(n))return n;n&&"string"==typeof n.message&&(t=n)}}return t}(t);if(!n.req)return void e.__abortTransaction(r);n.req.__done=!0,n.req.__error=r,n.req.__result=void 0,n.req.addLateEventListener("error",(function(e){e.cancelable&&e.defaultPrevented&&!e.__legacyOutputDidListenersThrowError&&a()})),n.req.addDefaultEventListener("error",(function(){n.req&&e.__abortTransaction(n.req.__error)})),e.__active=!0;const o=Q("error",r,{bubbles:!0,cancelable:!0});n.req.dispatchEvent(o),o.__legacyOutputDidListenersThrowError&&(X("Error","An error occurred in an error handler attached to request chain",o.__legacyOutputDidListenersThrowError),o.preventDefault(),e.__abortTransaction(re("AbortError","A request was aborted (in user handler after error).")))}function a(){if(!e.__errored&&!e.__requestsFinished)if(r++,r>=e.__requests.length)e.__requests=[],e.__active&&function(){function t(){e.__completed=!0,y.DEBUG&&console.log("Transaction completed");const t=Q("complete");try{e.__internal=!0,e.dispatchEvent(t),e.__internal=!1,e.dispatchEvent(Q("__complete"))}catch(t){throw e.__internal=!1,e.__errored=!0,t}finally{e.__storeHandles={}}}if(e.__active=!1,e.__requestsFinished=!0,"readwrite"===e.mode)return e.__transactionFinished?void t():void(e.__transactionEndCallback=t);if("readonly"===e.mode)return void t();const n=Q("__beforecomplete");n.complete=t,e.dispatchEvent(n)}();else try{if(n=e.__requests[r],!n.req)return void n.op(t,n.args,a,i);if(n.req.__done)return;n.op(t,n.args,o,i,a)}catch(e){i(e)}}a()}),(function(t){if(!0===t)return;const n=ee(t);e.__abortTransaction(n)}),(function(){e.__transFinishedCb===_t.prototype.__transFinishedCb&&(e.__transactionEndCallback||e.__requestsFinished?e.__transactionEndCallback&&!e.__completed&&e.__transFinishedCb(e.__errored,e.__transactionEndCallback):e.__transactionFinished=!0)}),(function(t,n,r,o,i){return!(!t.readOnly&&!n)||(e.__transFinishedCb=function(e,t){e?o(e,t):i(t)},e.__transactionEndCallback&&!e.__completed&&e.__transFinishedCb(e.__errored,e.__transactionEndCallback),!1)})))},_t.prototype.__createRequest=function(e){const t=ce.__createInstance();return t.__source=void 0!==e?e:this.db,t.__transaction=this,t},_t.prototype.__addToTransactionQueue=function(e,t,n){const r=this.__createRequest(n);return this.__pushToQueue(r,e,t),r},_t.prototype.__addNonRequestToTransactionQueue=function(e,t){this.__pushToQueue(null,e,t)},_t.prototype.__pushToQueue=function(e,t,n){this.__assertActive(),this.__requests.push({op:t,args:n,req:e})},_t.prototype.__assertActive=function(){if(!this.__active)throw re("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished")},_t.prototype.__assertWritable=function(){if("readonly"===this.mode)throw re("ReadOnlyError","The transaction is read only")},_t.prototype.__assertVersionChange=function(){_t.__assertVersionChange(this)},_t.prototype.objectStore=function(e){const t=this;if(!(t instanceof _t))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");if(_t.__assertNotFinished(t),-1===t.__objectStoreNames.indexOf(e))throw re("NotFoundError",e+" is not participating in this transaction");const n=t.db.__objectStores[e];if(!n)throw re("NotFoundError",e+" does not exist in "+t.db.name);return(!t.__storeHandles[e]||t.__storeHandles[e].__pendingDelete||t.__storeHandles[e].__deleted)&&(t.__storeHandles[e]=Yn.__clone(n,t)),t.__storeHandles[e]},_t.prototype.__abortTransaction=function(e){const t=this;function n(n,r){n?r&&"code"in r&&"number"==typeof r.code?y.DEBUG&&console.log("Rollback erred; feature is probably not supported as per WebSQL",t):y.DEBUG&&console.log("Rollback succeeded",t):y.DEBUG&&console.log("Rollback not possible due to missing transaction",t),t.dispatchEvent(Q("__preabort")),t.__requests.filter((function(e,t,n){return e.req&&!e.req.__done&&[t,-1].includes(n.map((e=>e.req)).lastIndexOf(e.req))})).reduce((function(e,t){return e.then((function(){if(!t.req)throw new Error("Missing request");t.req.__done=!0,t.req.__result=void 0,t.req.__error=re("AbortError","A request was aborted (an unfinished request).");const e=Q("error",t.req.__error,{bubbles:!0,cancelable:!0});return new be((n=>{setTimeout((()=>{if(!t.req)throw new Error("Missing request");t.req.dispatchEvent(e),n()}))}))}))}),be.resolve(void 0)).then((function(){const n=Q("abort",e,{bubbles:!0,cancelable:!1});setTimeout((()=>{t.__abortFinished=!0,t.dispatchEvent(n),t.__storeHandles={},t.dispatchEvent(Q("__abort"))}))})).catch((e=>{throw console.log("Abort error"),e}))}X("Error","An error occurred in a transaction",e),t.__errored||(t.__errored=!0,"versionchange"===t.mode&&(t.db.__version=t.db.__oldVersion,t.db.__objectStoreNames=t.db.__oldObjectStoreNames,t.__objectStoreNames=t.db.__oldObjectStoreNames,Object.values(t.db.__objectStores).concat(Object.values(t.__storeHandles)).forEach((function(e){"__pendingName"in e&&t.db.__oldObjectStoreNames.indexOf(e.__pendingName)>-1&&(e.__name=e.__originalName),e.__indexNames=e.__oldIndexNames,delete e.__pendingDelete,Object.values(e.__indexes).concat(Object.values(e.__indexHandles)).forEach((function(t){"__pendingName"in t&&e.__oldIndexNames.indexOf(t.__pendingName)>-1&&(t.__name=t.__originalName),delete t.__pendingDelete}))}))),t.__active=!1,null!==e&&(t.__error=e),t.__requestsFinished&&setTimeout((()=>{throw e}),0),t.__transFinishedCb(!0,(function(e){if(e&&t.__tx){if("readwrite"===t.mode)return t.__transactionFinished?void n():void(t.__transactionEndCallback=n);try{t.__tx.executeSql("ROLLBACK",[],n,n)}catch(e){n()}}else n(null,{code:0})})))},_t.prototype.abort=function(){const e=this;if(!(e instanceof _t))throw new TypeError("Illegal invocation");y.DEBUG&&console.log("The transaction was aborted",e),_t.__assertNotFinished(e),e.__abortTransaction(null)},_t.prototype[Symbol.toStringTag]="IDBTransactionPrototype",_t.__assertVersionChange=function(e){if(!e||"versionchange"!==e.mode)throw re("InvalidStateError","Not a version transaction")},_t.__assertNotVersionChange=function(e){if(e&&"versionchange"===e.mode)throw re("InvalidStateError","Cannot be called during a version transaction")},_t.__assertNotFinished=function(e){if(!e||e.__completed||e.__abortFinished||e.__errored)throw re("InvalidStateError","Transaction finished by commit or abort")},_t.__assertNotFinishedObjectStoreMethod=function(e){try{_t.__assertNotFinished(e)}catch(t){if(e&&!e.__completed&&!e.__abortFinished)throw re("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished");throw t}},_t.__assertActive=function(e){if(!e||!e.__active)throw re("TransactionInactiveError","A request was placed against a transaction which is currently not active, or which is finished")},_t.prototype.__getParent=function(){return this.db},P(_t.prototype,ut),k(_t.prototype,lt),Object.defineProperty(_t.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:_t}),Object.defineProperty(_t,"prototype",{writable:!1});var Dt=ht((function e(t){pt(this,e),this.p=new Promise(t)}));Dt.__typeson__type__="TypesonPromise","undefined"!=typeof Symbol&&Object.defineProperty(Dt.prototype,Symbol.toStringTag,{get:function(){return"TypesonPromise"}}),Dt.prototype.then=function(e,t){var n=this;return new Dt((function(r,o){n.p.then((function(t){r(e?e(t):t)})).catch((function(e){return t?t(e):Promise.reject(e)})).then(r,o)}))},Dt.prototype.catch=function(e){return this.then((function(){}),e)},Dt.resolve=function(e){return new Dt((function(t){t(e)}))},Dt.reject=function(e){return new Dt((function(t,n){n(e)}))},Dt.all=function(e){return new Dt((function(t,n){Promise.all(e.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(t,n)}))},Dt.race=function(e){return new Dt((function(t,n){Promise.race(e.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(t,n)}))},Dt.allSettled=function(e){return new Dt((function(t,n){Promise.allSettled(e.map((function(e){return null!=e&&e.constructor&&"__typeson__type__"in e.constructor&&"TypesonPromise"===e.constructor.__typeson__type__?e.p:e}))).then(t,n)}))};var It=Object.hasOwn,Ot=Object.getPrototypeOf;function St(e,t){return Bt(e)&&"function"==typeof e.then&&!0}function Tt(e){return Object.prototype.toString.call(e).slice(8,-1)}function Nt(e,t){if(!e||"object"!==Et(e))return!1;var n=Ot(e);if(!n)return null===t;var r=It(n,"constructor")&&n.constructor;return"function"!=typeof r?null===t:t===r||null!==t&&Function.prototype.toString.call(r)===Function.prototype.toString.call(t)||"function"==typeof t&&"string"==typeof r.__typeson__type__&&r.__typeson__type__===t.__typeson__type__}function At(e){return!(!e||"Object"!==Tt(e))&&(!Ot(e)||Nt(e,Object))}function xt(e){if(!e||"Object"!==Tt(e))return!1;var t=Ot(e);return!t||Nt(e,Object)||xt(t)}function Bt(e){return null!==e&&"object"===Et(e)}function jt(e){return e.replaceAll("''","''''").replace(/^$/,"''").replaceAll("~","~0").replaceAll(".","~1")}function Ct(e){return e.replaceAll("~1",".").replaceAll("~0","~").replace(/^''$/,"").replaceAll("''''","''")}function Pt(e,t){if(""===t)return e;if(null===e||"object"!==Et(e))throw new TypeError("Unexpected non-object type");var n=t.indexOf(".");if(-1!==n){var r=e[Ct(t.slice(0,n))];return void 0===r?void 0:Pt(r,t.slice(n+1))}return e[Ct(t)]}function kt(e,t,n){if(""===t)return n;if(!e||"object"!==Et(e))throw new TypeError("Unexpected non-object type");if("__proto__"===t)throw new TypeError("Invalid property");var r=t.indexOf(".");return-1!==r?kt(e[Ct(t.slice(0,r))],t.slice(r+1),n):(e[Ct(t)]=n,e)}function Rt(e){return null===e?"null":Array.isArray(e)?"array":Et(e)}function Ft(e,t,n){return e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e}var Lt=Object.keys,qt=Object.hasOwn,Ut=Array.isArray,Mt=["type","replaced","iterateIn","iterateUnsetNumeric","addLength"];function Vt(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function Kt(e,t){var n,r;if(""===e.keypath)return-1;var o=null!==(n=e.keypath.match(/\./g))&&void 0!==n?n:0,i=null!==(r=t.keypath.match(/\./g))&&void 0!==r?r:0;return o&&(o=o.length),i&&(i=i.length),o>i?-1:o<i?1:e.keypath<t.keypath?-1:e.keypath>t.keypath?1:0}var Gt=ht((function e(t){pt(this,e),this.options=t,this.plainObjectReplacers=[],this.nonplainObjectReplacers=[],this.revivers={},this.types={}}),[{key:"stringify",value:function(e,t,n,r){r=gt(gt(gt({},this.options),r),{},{stringification:!0});var o=this.encapsulate(e,null,r);return Ut(o)?JSON.stringify(o[0],t,n):o.then((function(e){return JSON.stringify(e,t,n)}))}},{key:"stringifySync",value:function(e,t,n,r){return this.stringify(e,t,n,gt(gt({throwOnBadSyncType:!0},r),{},{sync:!0}))}},{key:"stringifyAsync",value:function(e,t,n,r){return this.stringify(e,t,n,gt(gt({throwOnBadSyncType:!0},r),{},{sync:!1}))}},{key:"parse",value:function(e,t,n){return n=gt(gt(gt({},this.options),n),{},{parse:!0}),this.revive(JSON.parse(e,t),n)}},{key:"parseSync",value:function(e,t,n){return this.parse(e,t,gt(gt({throwOnBadSyncType:!0},n),{},{sync:!0}))}},{key:"parseAsync",value:function(e,t,n){return this.parse(e,t,gt(gt({throwOnBadSyncType:!0},n),{},{sync:!1}))}},{key:"specialTypeNames",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.returnTypeNames=!0,this.encapsulate(e,t,n)}},{key:"rootTypeName",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.iterateNone=!0,this.encapsulate(e,t,n)}},{key:"encapsulate",value:function(e,t,n){var r=this,o=gt(gt({sync:!0},this.options),n),i=o.sync,a={},s=[],c=[],u=[],l=!("cyclic"in o)||o.cyclic,_=o.encapsulateObserver,d=function(e){var t=Object.values(a);if(o.iterateNone)return t.length?t[0]:Rt(e);if(t.length){if(o.returnTypeNames)return function(e){return function(e){if(Array.isArray(e))return ft(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||wt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(new Set(t));e&&At(e)&&!qt(e,"$types")?e.$types=a:e={$:e,$types:{$:a}}}else Bt(e)&&qt(e,"$types")&&(e={$:e,$types:!0});return!o.returnTypeNames&&e},f=Vt((function(e,t){return Ft(Promise.all(t.map((function(e){return e[1].p}))),(function(n){return Ft(Promise.all(n.map(Vt((function(n){var r=!1,o=[],i=mt(t.splice(0,1),1),a=mt(i[0],7),s=a[0],c=a[2],u=a[3],l=a[4],_=a[5],d=a[6],p=h(s,n,c,u,o,!0,d),y=Nt(p,Dt);return function(e,t){var n=e();return n&&n.then?n.then(t):t(n)}((function(){if(s&&y)return Ft(p.p,(function(t){l[_]=t;var n=f(e,o);return r=!0,n}))}),(function(t){return r?t:(s?l[_]=p:e=y?p.p:p,f(e,o))}))})))),(function(){return e}))}))})),p=function(e,t,n){Object.assign(e,t);var r=Mt.map((function(t){var n=e[t];return delete e[t],n}));n(),Mt.forEach((function(t,n){e[t]=r[n]}))},h=function(e,t,n,i,u,l,d){var f,b={},g=Et(t),m=_?function(r){var o,a=null!==(o=null!=d?d:i.type)&&void 0!==o?o:Rt(t);_(Object.assign(null!=r?r:b,{keypath:e,value:t,cyclic:n,stateObj:i,promisesData:u,resolvingTypesonPromise:l,awaitingTypesonPromise:Nt(t,Dt)},{type:a}))}:null;if(["string","boolean","number","undefined"].includes(g))return void 0===t||Number.isNaN(t)||t===Number.NEGATIVE_INFINITY||t===Number.POSITIVE_INFINITY||0===t?(f=i.replaced?t:y(e,t,i,u,!1,l,m))!==t&&(b={replaced:f}):f=t,m&&m(),f;if(null===t)return m&&m(),t;if(n&&!i.iterateIn&&!i.iterateUnsetNumeric&&t&&"object"===Et(t)){var v=s.indexOf(t);if(-1!==v)return a[e]="#",m&&m({cyclicKeypath:c[v]}),"#"+c[v];!0===n&&(s.push(t),c.push(e))}var E,w=At(t),D=Ut(t),I=(w||D)&&(!r.plainObjectReplacers.length||i.replaced)||i.iterateIn?t:y(e,t,i,u,w||D,null,m);if(I!==t?(f=I,b={replaced:I}):""===e&&Nt(t,Dt)?(u.push([e,t,n,i,void 0,void 0,i.type]),f=t):D&&"object"!==i.iterateIn||"array"===i.iterateIn?(E=new Array(t.length),b={clone:E}):(["function","symbol"].includes(Et(t))||"toJSON"in t||Nt(t,Dt)||Nt(t,Promise)||Nt(t,ArrayBuffer))&&!w&&"object"!==i.iterateIn?f=t:(E={},i.addLength&&(E.length=t.length),b={clone:E}),m&&m(),o.iterateNone)return null!=E?E:f;if(!E)return f;if(i.iterateIn){var O=function(r){var o={ownKeys:qt(t,r)};p(i,o,(function(){var o=e+(e?".":"")+jt(r),a=h(o,t[r],Boolean(n),i,u,l);Nt(a,Dt)?u.push([o,a,Boolean(n),i,E,r,i.type]):void 0!==a&&(E[r]=a)}))};for(var S in t)O(S);m&&m({endIterateIn:!0,end:!0})}else Lt(t).forEach((function(r){var o=e+(e?".":"")+jt(r);p(i,{ownKeys:!0},(function(){var e=h(o,t[r],Boolean(n),i,u,l);Nt(e,Dt)?u.push([o,e,Boolean(n),i,E,r,i.type]):void 0!==e&&(E[r]=e)}))})),m&&m({endIterateOwn:!0,end:!0});if(i.iterateUnsetNumeric){for(var T=t.length,N=function(r){if(!(r in t)){var o="".concat(e).concat(e?".":"").concat(String(r));p(i,{ownKeys:!1},(function(){var e=h(o,void 0,Boolean(n),i,u,l);Nt(e,Dt)?u.push([o,e,Boolean(n),i,E,r,i.type]):void 0!==e&&(E[r]=e)}))}},A=0;A<T;A++)N(A);m&&m({endIterateUnsetNumeric:!0,end:!0})}return E},y=function(e,t,n,o,s,c,u){for(var _=s?r.plainObjectReplacers:r.nonplainObjectReplacers,d=_.length;d--;){var f=_[d];if(f.test(t,n)){var p=f.type;if(r.revivers[p]){var y=a[e];a[e]=y?[p].concat(y):p}if(Object.assign(n,{type:p,replaced:!0}),(i||!f.replaceAsync)&&!f.replace)return u&&u({typeDetected:!0}),h(e,t,l&&"readonly",n,o,c,p);u&&u({replacing:!0});var b=void 0;if(i||!f.replaceAsync){if(void 0===f.replace)throw new TypeError("Missing replacer");b=f.replace(t,n)}else b=f.replaceAsync(t,n);return h(e,b,l&&"readonly",n,o,c,p)}}return t},b=h("",e,l,null!=t?t:{},u);if(u.length)return i&&o.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Promise.resolve(f(b,u)).then(d);if(!i&&o.throwOnBadSyncType)throw new TypeError("Async method requested but sync result obtained");return o.stringification&&i?[d(b)]:i?d(b):Promise.resolve(d(b))}},{key:"encapsulateSync",value:function(e,t,n){return this.encapsulate(e,t,gt(gt({throwOnBadSyncType:!0},n),{},{sync:!0}))}},{key:"encapsulateAsync",value:function(e,t,n){return this.encapsulate(e,t,gt(gt({throwOnBadSyncType:!0},n),{},{sync:!1}))}},{key:"revive",value:function(e,t){var n=this,r=gt(gt({sync:!0},this.options),t),o=r.sync;function i(e){if(o)return e;if(r.throwOnBadSyncType)throw new TypeError("Async method requested but sync result obtained");return Promise.resolve(e)}if(!e||"object"!==Et(e)||Array.isArray(e))return i(e);var a=e.$types;if(!0===a)return i(e.$);if(!a||"object"!==Et(a)||Array.isArray(a))return i(e);var s=[],c={},u=!0;a.$&&At(a.$)&&(e=e.$,a=a.$,u=!1);var l=function(e,t){var r,i=mt(null!==(r=n.revivers[e])&&void 0!==r?r:[],1)[0];if(!i)throw new Error("Unregistered type: "+e);if(o&&!("revive"in i))return t;if(!o&&i.reviveAsync)return i.reviveAsync(t,c);if(i.revive)return i.revive(t,c);throw new Error("Missing reviver")},_=[];function d(e){return Nt(e,Ht)?void 0:e}var f,p=function(){var t=[];if(!a)throw new Error("Found bad `types`");if(Object.entries(a).forEach((function(e){var r=mt(e,2),o=r[0],i=r[1];"#"!==i&&[].concat(i).forEach((function(e){var r;mt(null!==(r=n.revivers[e])&&void 0!==r?r:[null,{}],2)[1].plain&&(t.push({keypath:o,type:e}),delete a[o])}))})),t.length)return t.sort(Kt),t.reduce((function t(n,r){var o=r.keypath,i=r.type;if(St(n))return n.then((function(e){return t(e,{keypath:o,type:i})}));var a=Pt(e,o);if(Nt(a=l(i,a),Dt))return a.then((function(t){var n=kt(e,o,t);n===t&&(e=n)}));var s=kt(e,o,a);s===a&&(e=s)}),void 0)}();return Nt(p,Dt)?f=p.then((function(){return e})):(f=function e(t,n,r,o,i){if(!u||"$types"!==t){var c=a[t],d=Ut(n);if(d||At(n)){var f=d?new Array(n.length):{};for(Lt(n).forEach((function(o){var i=e(t+(t?".":"")+jt(o),n[o],null!=r?r:f,f,o),a=function(e){return Nt(e,Ht)?f[o]=void 0:void 0!==e&&(f[o]=e),e};Nt(i,Dt)?_.push(i.then((function(e){return a(e)}))):a(i)})),n=f;s.length;){var p=mt(s[0],4),h=p[0],y=p[1],b=p[2],g=p[3],m=Pt(h,y);if(void 0===m)break;b[g]=m,s.splice(0,1)}}if(!c)return n;if("#"===c){var v=Pt(r,n.slice(1));return void 0===v&&s.push([r,n.slice(1),o,i]),v}return[].concat(c).reduce((function e(t,n){if(Nt(t,Dt))return t.then((function(t){return e(t,n)}));if("string"!=typeof n)throw new TypeError("Bad type JSON");return l(n,t)}),n)}}("",e,null),_.length&&(f=Dt.resolve(f).then((function(e){return Dt.all([e].concat(_))})).then((function(e){return mt(e,1)[0]})))),St(f)?o&&r.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Nt(f,Dt)?f.p.then(d):f:!o&&r.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():o?d(f):Promise.resolve(d(f))}},{key:"reviveSync",value:function(e,t){return this.revive(e,gt(gt({throwOnBadSyncType:!0},t),{},{sync:!0}))}},{key:"reviveAsync",value:function(e,t){return this.revive(e,gt(gt({throwOnBadSyncType:!0},t),{},{sync:!1}))}},{key:"register",value:function(e,t){var n=this,r=null!=t?t:{},o=function(e){Ut(e)?e.forEach((function(e){o(e)})):Lt(e).forEach((function(t){var o;if("#"===t)throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");if(Qt.includes(t))throw new TypeError("Plain JSON object types are reserved as type names");var i=e[t],a=i&&"function"!=typeof i&&!Array.isArray(i)&&i.testPlainObjects?n.plainObjectReplacers:n.nonplainObjectReplacers,s=a.filter((function(e){return e.type===t}));if(s.length&&(a.splice(a.indexOf(s[0]),1),delete n.revivers[t],delete n.types[t]),"function"==typeof i){var c=i;i={test:function(e){return e&&e.constructor===c},replace:function(e){return gt({},e)},revive:function(e){return Object.assign(Object.create(c.prototype),e)}}}else if(Ut(i)){var u=mt(i,3);i={test:u[0],replace:u[1],revive:u[2]}}if(null!==(o=i)&&void 0!==o&&o.test){var l={type:t,test:i.test.bind(i)};i.replace&&(l.replace=i.replace.bind(i)),i.replaceAsync&&(l.replaceAsync=i.replaceAsync.bind(i));var _="number"==typeof r.fallback?r.fallback:r.fallback?0:Number.POSITIVE_INFINITY;if(i.testPlainObjects?n.plainObjectReplacers.splice(_,0,l):n.nonplainObjectReplacers.splice(_,0,l),i.revive||i.reviveAsync){var d={};i.revive&&(d.revive=i.revive.bind(i)),i.reviveAsync&&(d.reviveAsync=i.reviveAsync.bind(i)),n.revivers[t]=[d,{plain:i.testPlainObjects}]}n.types[t]=i}}))};return[].concat(e).forEach((function(e){o(e)})),this}}]),Ht=ht((function e(){pt(this,e)}));Ht.__typeson__type__="TypesonUndefined";for(var Qt=["null","boolean","number","string","array","object"],Wt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zt=new Uint8Array(256),Yt=0;Yt<64;Yt++)zt[Wt.codePointAt(Yt)]=Yt;var $t=function(e,t,n){null==n&&(n=e.byteLength);for(var r=new Uint8Array(e,0,n),o=r.length,i="",a=0;a<o;a+=3)i+=Wt[r[a]>>2],i+=Wt[(3&r[a])<<4|r[a+1]>>4],i+=Wt[(15&r[a+1])<<2|r[a+2]>>6],i+=Wt[63&r[a+2]];return o%3==2?i=i.slice(0,-1)+"=":o%3==1&&(i=i.slice(0,-2)+"=="),i},Jt=function(e,t){var n=e.length;if(n%4)throw new Error("Bad base64 length: not divisible by four");var r,o,i,a,s=.75*e.length,c=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);for(var u=new ArrayBuffer(s,t),l=new Uint8Array(u),_=0;_<n;_+=4)r=zt[e.codePointAt(_)],o=zt[e.codePointAt(_+1)],i=zt[e.codePointAt(_+2)],a=zt[e.codePointAt(_+3)],l[c++]=r<<2|o>>4,l[c++]=(15&o)<<4|i>>2,l[c++]=(3&i)<<6|63&a;return u};const Xt={arraybuffer:{test:e=>"ArrayBuffer"===Tt(e),replace(e,t){t.buffers||(t.buffers=[]);const n=t.buffers.indexOf(e);return-1!==n?{index:n}:(t.buffers.push(e),{s:$t(e),maxByteLength:e.maxByteLength,resizable:e.resizable})},revive(e,t){if(t.buffers||(t.buffers=[]),Object.hasOwn(e,"index"))return t.buffers[e.index];const n=Jt(e.s,e.resizable?{maxByteLength:e.maxByteLength}:void 0);return t.buffers.push(n),n}}},Zt={bigintObject:{test:e=>"object"==typeof e&&Nt(e,BigInt),replace:String,revive:e=>new Object(BigInt(e))}},en={bigint:{test:e=>"bigint"==typeof e,replace:String,revive:e=>BigInt(e)}};function tn(e){return new Uint8Array(e).reduce(((e,t)=>e+String.fromCodePoint(t)),"")}function nn(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer}const rn={blob:{test:e=>"Blob"===Tt(e),replace(e){const t=new XMLHttpRequest;if(t.overrideMimeType("text/plain; charset=x-user-defined"),t.open("GET",URL.createObjectURL(e),!1),t.send(),200!==t.status&&0!==t.status)throw new Error("Bad Blob access: "+t.status);return{type:e.type,stringContents:t.responseText}},revive(e){const{type:t,stringContents:n}=e;return new Blob([nn(n)],{type:t})},replaceAsync:e=>new Dt(((t,n)=>{const r=new FileReader;r.addEventListener("load",(()=>{t({type:e.type,stringContents:tn(r.result)})})),r.addEventListener("error",(()=>{n(r.error)})),r.readAsArrayBuffer(e)}))}},on={cryptokey:{test:e=>"CryptoKey"===Tt(e)&&e.extractable,replaceAsync:e=>new Dt((async(t,n)=>{let r;try{r=await crypto.subtle.exportKey("jwk",e)}catch(t){return void n(t)}t({jwk:r,algorithm:e.algorithm,usages:e.usages})})),revive(e){const{jwk:t,algorithm:n,usages:r}=e;return crypto.subtle.importKey("jwk",t,n,!0,r)}}},an={dataview:{test:e=>"DataView"===Tt(e),replace({buffer:e,byteOffset:t,byteLength:n},r){r.buffers||(r.buffers=[]);const o=r.buffers.indexOf(e);return-1!==o?{index:o,byteOffset:t,byteLength:n}:(r.buffers.push(e),{encoded:$t(e),maxByteLength:e.maxByteLength,resizable:e.resizable,byteOffset:t,byteLength:n})},revive(e,t){t.buffers||(t.buffers=[]);const{byteOffset:n,byteLength:r,encoded:o,index:i,maxByteLength:a,resizable:s}=e;let c;return"index"in e?c=t.buffers[i]:(c=Jt(o,s?{maxByteLength:a}:a),t.buffers.push(c)),new DataView(c,n,r)}}},sn={date:{test:e=>"Date"===Tt(e),replace(e){const t=e.getTime();return Number.isNaN(t)?"NaN":t},revive:e=>"NaN"===e?new Date(Number.NaN):new Date(e)}},cn={domexception:{test:e=>"DOMException"===Tt(e),replace:e=>({name:e.name,message:e.message}),revive:({message:e,name:t})=>new DOMException(e,t)}},un={};function ln(e){un[e.name.toLowerCase()]={test:t=>Tt(t)===e.name,replace:e=>e.is2D?{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}:{m11:e.m11,m12:e.m12,m13:e.m13,m14:e.m14,m21:e.m21,m22:e.m22,m23:e.m23,m24:e.m24,m31:e.m31,m32:e.m32,m33:e.m33,m34:e.m34,m41:e.m41,m42:e.m42,m43:e.m43,m44:e.m44},revive:t=>Object.hasOwn(t,"a")?new e([t.a,t.b,t.c,t.d,t.e,t.f]):new e([t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44])}}"undefined"!=typeof DOMMatrix&&ln(DOMMatrix),"undefined"!=typeof DOMMatrixReadOnly&&ln(DOMMatrixReadOnly);const _n={};function dn(e){_n[e.name.toLowerCase()]={test:t=>Tt(t)===e.name,replace:e=>({x:e.x,y:e.y,z:e.z,w:e.w}),revive:({x:t,y:n,z:r,w:o})=>new e(t,n,r,o)}}"undefined"!=typeof DOMPoint&&dn(DOMPoint),"undefined"!=typeof DOMPointReadOnly&&dn(DOMPointReadOnly);const fn={domquad:{test:e=>"DOMQuad"===Tt(e),replace:e=>({p1:e.p1,p2:e.p2,p3:e.p3,p4:e.p4}),revive:({p1:e,p2:t,p3:n,p4:r})=>new DOMQuad(e,t,n,r)}},pn={};function hn(e){pn[e.name.toLowerCase()]={test:t=>Tt(t)===e.name,replace:e=>({x:e.x,y:e.y,width:e.width,height:e.height}),revive:({x:t,y:n,width:r,height:o})=>new e(t,n,r,o)}}"undefined"!=typeof DOMRect&&hn(DOMRect),"undefined"!=typeof DOMRectReadOnly&&hn(DOMRectReadOnly);const yn={error:{test:e=>"Error"===Tt(e),replace:({name:e,message:t,cause:n,stack:r,fileName:o,lineNumber:i,columnNumber:a})=>({name:e,message:t,cause:n,stack:r,fileName:o,lineNumber:i,columnNumber:a}),revive(e){const t=new Error(e.message);return t.name=e.name,t.cause=e.cause,t.stack=e.stack,t.fileName=e.fileName,t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}}},bn={};function gn(e){bn[e.name.toLowerCase()]={test:t=>Nt(t,e),replace:({name:e,message:t,cause:n,stack:r,fileName:o,lineNumber:i,columnNumber:a,errors:s})=>({name:e,message:t,cause:n,stack:r,fileName:o,lineNumber:i,columnNumber:a,errors:s}),revive(t){const n="undefined"!=typeof AggregateError&&e===AggregateError?new e(t.errors,t.message):new e(t.message);return n.name=t.name,n.cause=t.cause,n.stack=t.stack,n.fileName=t.fileName,n.lineNumber=t.lineNumber,n.columnNumber=t.columnNumber,n}}}[TypeError,RangeError,SyntaxError,ReferenceError,EvalError,URIError].forEach((e=>gn(e))),"undefined"!=typeof AggregateError&&gn(AggregateError),"function"==typeof InternalError&&gn(InternalError);const mn={file:{test:e=>"File"===Tt(e),replace(e){const t=new XMLHttpRequest;if(t.overrideMimeType("text/plain; charset=x-user-defined"),t.open("GET",URL.createObjectURL(e),!1),t.send(),200!==t.status&&0!==t.status)throw new Error("Bad File access: "+t.status);return{type:e.type,stringContents:t.responseText,name:e.name,lastModified:e.lastModified}},revive:({name:e,type:t,stringContents:n,lastModified:r})=>new File([nn(n)],e,{type:t,lastModified:r}),replaceAsync:e=>new Dt((function(t,n){const r=new FileReader;r.addEventListener("load",(function(){t({type:e.type,stringContents:tn(r.result),name:e.name,lastModified:e.lastModified})})),r.addEventListener("error",(function(){n(r.error)})),r.readAsArrayBuffer(e)}))}},vn={file:mn.file,filelist:{test:e=>"FileList"===Tt(e),replace(e){const t=[];for(let n=0;n<e.length;n++)t[n]=e.item(n);return t},revive(e){class t{constructor(){this._files=arguments[0],this.length=this._files.length}item(e){return this._files[e]}get[Symbol.toStringTag](){return"FileList"}}return new t(e)}}},En={imagebitmap:{test:e=>"ImageBitmap"===Tt(e)||e&&e.dataset&&"ImageBitmap"===e.dataset.toStringTag,replace(e){const t=document.createElement("canvas");return t.getContext("2d").drawImage(e,0,0),{width:e.width,height:e.height,dataURL:t.toDataURL()}},revive(e){const t="undefined"==typeof OffscreenCanvas?document.createElement("canvas"):new OffscreenCanvas(e.width,e.height),n=t.getContext("2d"),r=document.createElement("img");return r.addEventListener("load",(function(){n.drawImage(r,0,0)})),r.src=e.dataURL,"undefined"==typeof OffscreenCanvas?t:t.transferToImageBitmap()},reviveAsync(e){const t=document.createElement("canvas"),n=t.getContext("2d"),r=document.createElement("img");return r.addEventListener("load",(function(){n.drawImage(r,0,0)})),r.src=e.dataURL,new Dt((async(e,n)=>{try{e(await createImageBitmap(t))}catch(e){n(e)}}))}}},wn={imagedata:{test:e=>"ImageData"===Tt(e),replace:e=>({array:[...e.data],width:e.width,height:e.height}),revive:e=>new ImageData(new Uint8ClampedArray(e.array),e.width,e.height)}},Dn={infinity:{test:e=>e===Number.POSITIVE_INFINITY,replace:()=>"Infinity",revive:()=>Number.POSITIVE_INFINITY}},In={map:{test:e=>"Map"===Tt(e),replace:e=>[...e.entries()],revive:e=>new Map(e)}},On={nan:{test:e=>Number.isNaN(e),replace:()=>"NaN",revive:()=>Number.NaN}},Sn={negativeInfinity:{test:e=>e===Number.NEGATIVE_INFINITY,replace:()=>"-Infinity",revive:()=>Number.NEGATIVE_INFINITY}},Tn={negativeZero:{test:e=>Object.is(e,-0),replace:()=>0,revive:()=>-0}},Nn={StringObject:{test:e=>"String"===Tt(e)&&"object"==typeof e,replace:String,revive:e=>new String(e)},BooleanObject:{test:e=>"Boolean"===Tt(e)&&"object"==typeof e,replace:e=>e.valueOf(),revive:e=>new Boolean(e)},NumberObject:{test:e=>"Number"===Tt(e)&&"object"==typeof e,replace:Number,revive:e=>new Number(e)}},An={regexp:{test:e=>"RegExp"===Tt(e),replace:e=>({source:e.source,flags:(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.sticky?"y":"")+(e.unicode?"u":"")+(e.unicodeSets?"v":"")+(e.hasIndices?"d":"")+(e.dotAll?"s":"")}),revive:({source:e,flags:t})=>new RegExp(e,t)}},xn={set:{test:e=>"Set"===Tt(e),replace:e=>[...e.values()],revive:e=>new Set(e)}},Bn={};"function"==typeof Int8Array&&[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,..."function"==typeof BigInt64Array?[BigInt64Array,BigUint64Array]:[]].forEach((e=>function(e){const t=e.name;Bn[t.toLowerCase()]={test:e=>Tt(e)===t,replace:e=>(0===e.byteOffset&&e.byteLength===e.buffer.byteLength?e:e.slice(0)).buffer,revive:t=>"ArrayBuffer"===Tt(t)?new e(t):t}}(e)));const jn={};"function"==typeof Int8Array&&[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,..."function"==typeof BigInt64Array?[BigInt64Array,BigUint64Array]:[]].forEach((e=>function(e){const t=e.name;jn[t.toLowerCase()]={test:e=>Tt(e)===t,replace({buffer:e,byteOffset:t,length:n},r){r.buffers||(r.buffers=[]);const o=r.buffers.indexOf(e);return-1!==o?{index:o,byteOffset:t,length:n}:(r.buffers.push(e),{maxByteLength:e.maxByteLength,resizable:e.resizable,encoded:$t(e),byteOffset:t,length:n})},revive(t,n){n.buffers||(n.buffers=[]);const{byteOffset:r,length:o,encoded:i,index:a,maxByteLength:s,resizable:c}=t;let u;return"index"in t?u=n.buffers[a]:(u=Jt(i,c?{maxByteLength:s}:void 0),n.buffers.push(u)),new e(u,r,o)}}}(e)));const Cn={undef:{test:(e,t)=>void 0===e&&(t.ownKeys||!("ownKeys"in t)),replace:()=>0,revive:()=>new Ht}},Pn={userObject:{test:e=>xt(e),replace:e=>({...e}),revive:e=>e}},kn=[{arrayNonindexKeys:{testPlainObjects:!0,test:(e,t)=>!!Array.isArray(e)&&(Object.keys(e).some((e=>String(Number.parseInt(e))!==e))&&(t.iterateIn="object",t.addLength=!0),!0),replace:(e,t)=>(t.iterateUnsetNumeric=!0,e),revive(e){if(Array.isArray(e))return e;const t=[];return Object.entries(e).forEach((([e,n])=>{t[e]=n})),t}}},{sparseUndefined:{test:(e,t)=>void 0===e&&!1===t.ownKeys,replace:()=>0,revive(){}}}],Rn=[Pn,Cn,kn,Nn,[On,Dn,Sn,Tn],sn,An,wn,En,mn,vn,rn,yn,bn].concat("function"==typeof Map?In:[],"function"==typeof Set?xn:[],"function"==typeof ArrayBuffer?Xt:[],"function"==typeof Uint8Array?jn:[],"function"==typeof DataView?an:[],"undefined"!=typeof crypto?on:[],"undefined"!=typeof BigInt?[en,Zt]:[],"undefined"!=typeof DOMException?cn:[],"undefined"!=typeof DOMRect?pn:[],"undefined"!=typeof DOMPoint?_n:[],"undefined"!=typeof DOMQuad?fn:[],"undefined"!=typeof DOMMatrix?un:[]).concat({checkDataCloneException:{test(e){const t={}.toString.call(e).slice(8,-1);if(["symbol","function"].includes(typeof e)||["Arguments","Module","Promise","WeakMap","WeakSet","Event","MessageChannel"].includes(t)||e&&"object"==typeof e&&"number"==typeof e.nodeType&&"function"==typeof e.insertBefore)throw new DOMException("The object cannot be cloned.","DataCloneError");return!1}}});let Fn=(new Gt).register(Rn);function Ln(e){Fn=(new Gt).register(e(Rn))}function qn(e,t){let n;try{n=Fn.stringifySync(e)}catch(e){if(Nt(e,ReferenceError)||Nt(e,oe))throw re("DataCloneError","The object cannot be cloned.");throw e}return t&&t(n),n}function Un(e){return Fn.parse(e)}function Mn(e){return Un(qn(e))}var Vn=Object.freeze({__proto__:null,clone:Mn,decode:Un,encode:qn,register:Ln});const Kn=["objectStore","keyPath","multiEntry","unique"];function Gn(){throw new TypeError("Illegal constructor")}const Hn=Gn;function Qn(e,t,n,r,o,i,a,s,c,u,l,_,d){t&&(e=1),e&&s.push("LIMIT",String(e));const f="count"===i;y.DEBUG&&console.log("Trying to fetch data for Index",s.join(" "),c),u.executeSql(s.join(" "),c,(function(e,s){const c=[];let u=0;const l=f?()=>{}:"key"===i?e=>He(I(e.key)):e=>Un(I(e.value));if(n.multiEntry){const e=A(n.name),i=Ge(o,n.multiEntry);for(let n=0;n<s.rows.length;n++){const _=s.rows.item(n),d=He(_[e]);let f;if(r&&(a&&o.some((e=>d.includes(e)))||Ve(JSON.stringify(i).slice(1,-1),_[e]))?(u++,f=_):r||a||void 0!==d&&(u+=Array.isArray(d)?d.length:1,f=_),f&&(c.push(l(f)),t))break}}else{for(let e=0;e<s.rows.length;e++){const t=s.rows.item(e);t&&c.push(l(t))}u=c.length}_(f?u:0===u?t?void 0:[]:t?c[0]:c)}),d)}function Wn(e,t,n,r,o){const i=e||!H(n),a=["SELECT",O("count"===r?"key":r)+(t.multiEntry?", "+N(t.name):""),"FROM",T(t.objectStore.__currentName),"WHERE",N(t.name),"NOT NULL"],s=[];if(i)if(o)a.push("AND ("),n.forEach(((e,n)=>{n>0&&a.push("OR"),a.push(N(t.name),"LIKE ? ESCAPE '^' "),s.push("%"+x(Ge(e,t.multiEntry))+"%")})),a.push(")");else if(t.multiEntry)a.push("AND",N(t.name),"LIKE ? ESCAPE '^'"),Array.isArray(n)?s.push("%"+x(JSON.stringify(Ge(n,t.multiEntry)).slice(1,-1))+"%"):s.push("%"+x(Ge(n,t.multiEntry))+"%");else{nt(rt(n,e),N(t.name),a,s,!0,!1)}return[e,t,i,n,r,o,a,s]}Gn.__createInstance=function(e,t){function n(){const n=this;n[Symbol.toStringTag]="IDBIndex",F(n,Kn),n.__objectStore=e,n.__name=n.__originalName=t.columnName,n.__keyPath=Array.isArray(t.keyPath)?t.keyPath.slice():t.keyPath;const{optionalParams:r}=t;n.__multiEntry=Boolean(r&&r.multiEntry),n.__unique=Boolean(r&&r.unique),n.__deleted=Boolean(t.__deleted),n.__objectStore.__cursors=t.cursors||[],Object.defineProperty(n,"__currentName",{get:()=>"__pendingName"in n?n.__pendingName:n.name}),Object.defineProperty(n,"name",{enumerable:!1,configurable:!1,get(){return this.__name},set(t){const n=this;t=V(t);const r=n.name;if(_t.__assertVersionChange(n.objectStore.transaction),_t.__assertActive(n.objectStore.transaction),Hn.__invalidStateIfDeleted(n),Yn.__invalidStateIfDeleted(n),t===r)return;if(n.objectStore.__indexes[t]&&!n.objectStore.__indexes[t].__deleted&&!n.objectStore.__indexes[t].__pendingDelete)throw re("ConstraintError",'Index "'+t+'" already exists on '+n.objectStore.__currentName);n.__name=t;const{objectStore:o}=n;delete o.__indexes[r],o.__indexes[t]=n,o.indexNames.splice(o.indexNames.indexOf(r),1,t);const i=o.transaction.__storeHandles[o.name],a=i.__indexHandles[r];a.__name=t,i.__indexHandles[t]=a,n.__pendingName=r;const s=[["key","BLOB "+(o.autoIncrement?"UNIQUE, inc INTEGER PRIMARY KEY AUTOINCREMENT":"PRIMARY KEY")],["value","BLOB"]].concat([...o.indexNames].filter((e=>e!==t)).map((e=>[N(e),"BLOB"])));n.__renameIndex(o,r,t,s,(function(t,n){Hn.__updateIndexList(e,t,(function(e){delete i.__pendingName,n(e)}))}))}})}return n.prototype=Hn.prototype,new n},Gn.__invalidStateIfDeleted=function(e,t){if(e.__deleted||e.__pendingDelete||e.__pendingCreate&&e.objectStore.transaction&&e.objectStore.transaction.__errored)throw re("InvalidStateError",t||"This index has been deleted")},Gn.__clone=function(e,t){const n=Gn.__createInstance(t,{columnName:e.name,keyPath:e.keyPath,optionalParams:{multiEntry:e.multiEntry,unique:e.unique}});return["__pendingCreate","__pendingDelete","__deleted","__originalName","__recreated"].forEach((t=>{n[t]=e[t]})),n},Gn.__createIndex=function(e,t){const n=t.name,r=e.__currentName,o=e.__indexes[n];t.__pendingCreate=!0,e.indexNames.push(n),e.__indexes[n]=t;let i=e.__indexHandles[n];(!i||t.__pendingDelete||t.__deleted||i.__pendingDelete||i.__deleted)&&(i=e.__indexHandles[n]=Gn.__clone(t,e));const{transaction:a}=e;a.__addNonRequestToTransactionQueue((function(a,s,c,u){const l=o&&(o.__deleted||o.__recreated);let _={};function d(e,t){u(re("UnknownError",'Could not create index "'+n+'"'+t.code+"::"+t.message,t))}function f(o){Gn.__updateIndexList(e,o,(function(){o.executeSql('SELECT "key", "value" FROM '+T(r),[],(function(o,a){y.DEBUG&&console.log("Adding existing "+r+" records to the "+n+" index"),function s(l){if(l<a.rows.length)try{const e=Fe(Un(I(a.rows.item(l).value)),t.keyPath,t.multiEntry);if("invalid"in e&&e.invalid||"failure"in e&&e.failure)throw new Error("Go to catch; ignore bad indexKey");const i=Ge(e.value,t.multiEntry);if(t.unique){if(_[i])return _={},void u(re("ConstraintError","Duplicate values already exist within the store"));_[i]=!0}o.executeSql("UPDATE "+T(r)+" SET "+N(n)+' = ? WHERE "key" = ?',[D(i),a.rows.item(l).key],(function(){s(l+1)}),d)}catch(e){s(l+1)}else delete t.__pendingCreate,delete i.__pendingCreate,t.__deleted&&(delete t.__deleted,delete i.__deleted,t.__recreated=!0,i.__recreated=!0),_={},c(e)}(0)}),d)}),d)}const p=T(r),h=N(t.name);if(l)f(a);else{const e=["ALTER TABLE",p,"ADD",h,"BLOB"].join(" ");y.DEBUG&&console.log(e),a.executeSql(e,[],(function(e){y.useSQLiteIndexes?e.executeSql('CREATE INDEX IF NOT EXISTS "'+p.slice(1,-1)+"^5"+h.slice(1,-1)+'" ON '+p+"("+h+")",[],f,d):f(e)}),d)}}))},Gn.__deleteIndex=function(e,t){t.__pendingDelete=!0;const n=e.__indexHandles[t.name];n&&(n.__pendingDelete=!0),e.indexNames.splice(e.indexNames.indexOf(t.name),1);const{transaction:r}=e;r.__addNonRequestToTransactionQueue((function(r,o,i,a){function s(e,n){a(re("UnknownError",'Could not delete index "'+t.name+'"',n))}function c(){Gn.__updateIndexList(e,r,(function(e){delete t.__pendingDelete,delete t.__recreated,t.__deleted=!0,n&&(n.__deleted=!0,delete n.__pendingDelete),i(e)}),s)}y.useSQLiteIndexes?r.executeSql("DROP INDEX IF EXISTS "+O(T(e.name).slice(1,-1)+"^5"+N(t.name).slice(1,-1)),[],c,s):c()}))},Gn.__updateIndexList=function(e,t,n,r){const o={};for(let t=0;t<e.indexNames.length;t++){const n=e.__indexes[e.indexNames[t]];o[n.name]={columnName:n.name,keyPath:n.keyPath,optionalParams:{unique:n.unique,multiEntry:n.multiEntry},deleted:Boolean(n.__deleted)}}y.DEBUG&&console.log("Updating the index list for "+e.__currentName,o),t.executeSql('UPDATE __sys__ SET "indexList" = ? WHERE "name" = ?',[JSON.stringify(o),D(e.__currentName)],(function(){n(e)}),r)},Gn.prototype.__fetchIndexData=function(e,t,n,r){const o=this;if(void 0!==r&&(r=M(r,"unsigned long")),Gn.__invalidStateIfDeleted(o),Yn.__invalidStateIfDeleted(o.objectStore),o.objectStore.__deleted)throw re("InvalidStateError","This index's object store has been deleted");if(_t.__assertActive(o.objectStore.transaction),n&&H(e))throw re("DataError","No key or range was specified");const i=Wn(n,o,e,t,!1);return o.objectStore.transaction.__addToTransactionQueue((function(...e){Qn(r,...i,...e)}),void 0,o)},Gn.prototype.openCursor=function(){const e=this,[t,n]=arguments,r=Ar.__createInstance(t,n,e.objectStore,e,A(e.name),"value");return e.__objectStore.__cursors.push(r),r.__request},Gn.prototype.openKeyCursor=function(){const e=this,[t,n]=arguments,r=Sr.__createInstance(t,n,e.objectStore,e,A(e.name),"key");return e.__objectStore.__cursors.push(r),r.__request},Gn.prototype.get=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBIndex.get`.");return this.__fetchIndexData(e,"value",!0)},Gn.prototype.getKey=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBIndex.getKey`.");return this.__fetchIndexData(e,"key",!0)},Gn.prototype.getAll=function(){const[e,t]=arguments;return this.__fetchIndexData(e,"value",!1,t)},Gn.prototype.getAllKeys=function(){const[e,t]=arguments;return this.__fetchIndexData(e,"key",!1,t)},Gn.prototype.count=function(){const e=this,t=arguments[0];return B(t,et)?Ar.__createInstance(t,"next",e.objectStore,e,A(e.name),"value",!0).__request:e.__fetchIndexData(t,"count",!1)},Gn.prototype.__renameIndex=function(e,t,n,r=[],o=null){const i=e.__currentName,a=T(i),s=N(n),c=O("tmp_"+T(i).slice(1,-1)),u=r.map((e=>e[0])),l=r.map((e=>e.join(" "))),_=l.length?l.join(", ")+", ":"",d=u.length?u.join(", ")+", ":"";e.transaction.__addNonRequestToTransactionQueue((function(e,n,r,i){function l(e,t){i(t)}function f(){o?o(e,r):r()}const p="CREATE TABLE "+c+"("+_+s+" BLOB)";y.DEBUG&&console.log(p),e.executeSql(p,[],(function(){const n="INSERT INTO "+c+"("+d+s+") SELECT "+d+N(t)+" FROM "+a;y.DEBUG&&console.log(n),e.executeSql(n,[],(function(){const t="DROP TABLE "+a;y.DEBUG&&console.log(t),e.executeSql(t,[],(function(){const t="ALTER TABLE "+c+" RENAME TO "+a;y.DEBUG&&console.log(t),e.executeSql(t,[],(function(e){if(!y.useSQLiteIndexes)return void f();const t=u.slice(2).map((t=>new be((function(n,r){const o="CREATE INDEX "+O(a.slice(1,-1)+"^5"+t.slice(1,-1))+" ON "+a+"("+t+")";y.DEBUG&&console.log(o),e.executeSql(o,[],n,(function(e,t){r(t)}))}))));t.push(new be((function(t,n){const r=O("sk_"+a.slice(1,-1)),o="DROP INDEX IF EXISTS "+r;y.DEBUG&&console.log(o),e.executeSql(o,[],(function(){const o="CREATE INDEX "+r+" ON "+a+'("key")';y.DEBUG&&console.log(o),e.executeSql(o,[],t,(function(e,t){n(t)}))}),(function(e,t){n(t)}))}))),be.all(t).then(f,i).catch((e=>{throw console.log("Index rename error"),e}))}),l)}),l)}),l)}),l)}))},Object.defineProperty(Gn,Symbol.hasInstance,{value:e=>j(e)&&"openCursor"in e&&"function"==typeof e.openCursor&&"multiEntry"in e&&"boolean"==typeof e.multiEntry}),k(Gn.prototype,Kn),P(Gn.prototype,["name"]),Gn.prototype[Symbol.toStringTag]="IDBIndexPrototype",Object.defineProperty(Gn,"prototype",{writable:!1});const zn=["keyPath","indexNames","transaction","autoIncrement"];function Yn(){throw new TypeError("Illegal constructor")}const $n=Yn;function Jn(e,t){for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}Yn.__createInstance=function(e,t){function n(){const n=this;n[Symbol.toStringTag]="IDBObjectStore",F(this,zn),n.__name=n.__originalName=e.name,n.__keyPath=Array.isArray(e.keyPath)?e.keyPath.slice():e.keyPath,n.__transaction=t,n.__idbdb=e.idbdb,n.__cursors=e.cursors||[],n.__autoIncrement=Boolean(e.autoInc),n.__indexes={},n.__indexHandles={},n.__indexNames=at.__createInstance();const{indexList:r}=e;for(const e in r)if(Object.hasOwn(r,e)){const t=Gn.__createInstance(n,r[e]);n.__indexes[t.name]=t,t.__deleted||n.indexNames.push(t.name)}n.__oldIndexNames=n.indexNames.clone(),Object.defineProperty(this,"__currentName",{get(){return"__pendingName"in this?this.__pendingName:this.name}}),Object.defineProperty(this,"name",{enumerable:!1,configurable:!1,get(){return this.__name},set(e){const t=this;e=V(e);const n=t.name;if($n.__invalidStateIfDeleted(t),_t.__assertVersionChange(t.transaction),_t.__assertActive(t.transaction),n===e)return;if(t.__idbdb.__objectStores[e]&&!t.__idbdb.__objectStores[e].__pendingDelete)throw re("ConstraintError",'Object store "'+e+'" already exists in '+t.__idbdb.name);t.__name=e;const r=t.__idbdb.__objectStores[n];r.__name=e,t.__idbdb.__objectStores[e]=r,delete t.__idbdb.__objectStores[n],t.__idbdb.objectStoreNames.splice(t.__idbdb.objectStoreNames.indexOf(n),1,e);const o=t.transaction.__storeHandles[n];o.__name=e,t.transaction.__storeHandles[e]=o,t.__pendingName=n;const i='UPDATE __sys__ SET "name" = ? WHERE "name" = ?',a=[D(e),D(n)];y.DEBUG&&console.log(i,a),t.transaction.__addNonRequestToTransactionQueue((function(r,o,s,c){r.executeSql(i,a,(function(r){const o="ALTER TABLE "+T(n)+" RENAME TO "+T(e);y.DEBUG&&console.log(o),r.executeSql(o,[],(function(){delete t.__pendingName,s()}))}),(function(e,t){return c(t),!1}))}))}})}return n.prototype=$n.prototype,new n},Yn.__clone=function(e,t){const n=Yn.__createInstance({name:e.__currentName,keyPath:Array.isArray(e.keyPath)?e.keyPath.slice():e.keyPath,autoInc:e.autoIncrement,indexList:{},idbdb:e.__idbdb,cursors:e.__cursors},t);return["__indexes","__indexNames","__oldIndexNames","__deleted","__pendingDelete","__pendingCreate","__originalName"].forEach((t=>{n[t]=e[t]})),n},Yn.__invalidStateIfDeleted=function(e,t){if(e.__deleted||e.__pendingDelete||e.__pendingCreate&&"transaction"in e&&e.transaction&&e.transaction.__errored)throw re("InvalidStateError",t||"This store has been deleted")},Yn.__createObjectStore=function(e,t){const n=t.__currentName;t.__pendingCreate=!0,e.__objectStores[n]=t,e.objectStoreNames.push(n);const r=e.__versionTransaction,o=r.__storeHandles;return(!o[n]||o[n].__pendingDelete||o[n].__deleted)&&(o[n]=Yn.__clone(t,r)),r.__addNonRequestToTransactionQueue((function(e,r,o,i){function a(e,t){return y.DEBUG&&console.log(t),i(re("UnknownError",'Could not create object store "'+n+'"',t)),!1}const s=T(n),c=["CREATE TABLE",s,"(key BLOB",t.autoIncrement?"UNIQUE, inc INTEGER PRIMARY KEY AUTOINCREMENT":"PRIMARY KEY",", value BLOB)"].join(" ");y.DEBUG&&console.log(c),e.executeSql(c,[],(function(e){function r(){const r=JSON.stringify(t.keyPath);e.executeSql("INSERT INTO __sys__ VALUES (?,?,?,?,?)",[D(n),r,Number(t.autoIncrement),"{}",1],(function(){delete t.__pendingCreate,delete t.__deleted,o(t)}),a)}y.useSQLiteIndexes?e.executeSql("CREATE INDEX IF NOT EXISTS "+O("sk_"+s.slice(1,-1))+" ON "+s+'("key")',[],r,a):r()}),a)})),o[n]},Yn.__deleteObjectStore=function(e,t){t.__pendingDelete=!0,t.__indexNames=at.__createInstance(),e.objectStoreNames.splice(e.objectStoreNames.indexOf(t.__currentName),1);const n=e.__versionTransaction.__storeHandles[t.__currentName];n&&(n.__indexNames=at.__createInstance(),n.__pendingDelete=!0);e.__versionTransaction.__addNonRequestToTransactionQueue((function(e,r,o,i){function a(e,t){return y.DEBUG&&console.log(t),i(re("UnknownError","Could not delete ObjectStore",t)),!1}e.executeSql('SELECT "name" FROM __sys__ WHERE "name" = ?',[D(t.__currentName)],(function(e,r){r.rows.length>0&&e.executeSql("DROP TABLE "+T(t.__currentName),[],(function(){e.executeSql('DELETE FROM __sys__ WHERE "name" = ?',[D(t.__currentName)],(function(){delete t.__pendingDelete,t.__deleted=!0,n&&(delete n.__pendingDelete,n.__deleted=!0),o()}),a)}),a)}))}))},Yn.prototype.__validateKeyAndValueAndCloneValue=function(e,t,n){const r=this;if(null!==r.keyPath){if(void 0!==t)throw re("DataError","The object store uses in-line keys and the key parameter was provided");const o=Mn(e);if((t=Fe(o,r.keyPath)).invalid)throw re("DataError","KeyPath was specified, but key was invalid.");if(t.failure){if(!n){if(!r.autoIncrement)throw re("DataError","Could not evaluate a key from keyPath and there is no key generator");if(!Ue(o,r.keyPath))throw re("DataError","A key could not be injected into a value");return[void 0,o]}throw re("DataError","Could not evaluate a key from keyPath")}return[t.value,o]}if(void 0===t){if(!r.autoIncrement)throw re("DataError","The object store uses out-of-line keys and has no key generator and the key parameter was not provided.");t=void 0}else Re(t);return[t,Mn(e)]},Yn.prototype.__deriveKey=function(e,t,n,r,o){const i=this;function a(e){qn(n,(function(t){t=Un(t),r(t,e)}))}i.autoIncrement?void 0===n?Je(e,i,(function(e,n,a){e?o(re("ConstraintError","The key generator's current number has reached the maximum safe integer limit")):(null!==i.keyPath&&qe(t,n,i.keyPath),r(n,a))}),o):Xe(e,i,n,a,o):a()},Yn.prototype.__insertData=function(e,t,n,r,o,i,a){const s=this,c={},u=Object.keys(s.__indexes).map((t=>new be(((r,o)=>{const i=s.__indexes[t];if(i.__pendingCreate||i.__deleted)return void r(void 0);let a;try{if(a=Fe(n,i.keyPath,i.multiEntry),"invalid"in a&&a.invalid||"failure"in a&&a.failure)throw new Error("Go to catch")}catch(e){return void r(void 0)}function u(e){void 0!==a&&(c[e.__currentName]=Ge(a,e.multiEntry))}if(a=a.value,i.unique){const t=i.multiEntry&&Array.isArray(a);Qn(null,...Wn(!0,i,a,"key",t),e,null,(function(e){if(void 0===e)return u(i),void r(void 0);o(re("ConstraintError","Index already contains a record equal to "+(t?"one of the subkeys of":"")+"`indexKey`"))}),o)}else u(i),r(void 0)}))));return be.all(u).then((()=>{const n=["INSERT INTO",T(s.__currentName),"("],o=[" VALUES ("],u=[];void 0!==r&&(n.push(O("key"),","),o.push("?,"),u.push(D(Ge(r)))),Object.entries(c).forEach((([e,t])=>{n.push(N(e)+","),o.push("?,"),u.push(D(t))})),n.push(O("value")+" )"),o.push("?)"),u.push(D(t));const l=n.join(" ")+o.join(" ");y.DEBUG&&console.log("SQL for adding",l,u),e.executeSql(l,u,(function(){i(r)}),(function(e,t){return a(re("ConstraintError",t.message,t)),!1}))})).catch((function(t){function n(){a(t)}return"number"==typeof o?(Ye(e,s,o,n,n),null):(n(),null)}))},Yn.prototype.add=function(e){const t=this,n=arguments[1];if(!(t instanceof Yn))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No value was specified");Yn.__invalidStateIfDeleted(t),_t.__assertActive(t.transaction),t.transaction.__assertWritable();const r=t.transaction.__createRequest(t),[o,i]=t.__validateKeyAndValueAndCloneValue(e,n,!1);return Yn.__storingRecordObjectStore(r,t,!0,i,!0,o),r},Yn.prototype.put=function(e){const t=this,n=arguments[1];if(!(t instanceof Yn))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No value was specified");Yn.__invalidStateIfDeleted(t),_t.__assertActive(t.transaction),t.transaction.__assertWritable();const r=t.transaction.__createRequest(t),[o,i]=t.__validateKeyAndValueAndCloneValue(e,n,!1);return Yn.__storingRecordObjectStore(r,t,!0,i,!1,o),r},Yn.prototype.__overwrite=function(e,t,n,r){const o="DELETE FROM "+T(this.__currentName)+' WHERE "key" = ?',i=Ge(t);e.executeSql(o,[D(i)],(function(e,r){y.DEBUG&&console.log("Did the row with the",t,"exist?",r.rowsAffected),n(e)}),(function(e,t){return r(t),!1}))},Yn.__storingRecordObjectStore=function(e,t,n,r,o){const i=arguments[5];t.transaction.__pushToQueue(e,(function(e,a,s,c){t.__deriveKey(e,r,i,(function(i,a){qn(r,(function(u){function l(e){t.__insertData(e,u,r,i,a,(function(...e){n&&t.__cursors.forEach((e=>{e.__invalidateCache()})),s(...e)}),c)}o?l(e):t.__overwrite(e,i,l,c)}))}),c)}))},Yn.prototype.__get=function(e,t,n,r){const o=this;void 0!==r&&(r=M(r,"unsigned long")),Yn.__invalidStateIfDeleted(o),_t.__assertActive(o.transaction);const i=rt(e,!n),a=["SELECT",O(t?"key":"value"),"FROM",T(o.__currentName)],s=[];if(void 0!==i&&(a.push("WHERE"),nt(i,O("key"),a,s)),n||(r=1),r){if(!Number.isFinite(r))throw new TypeError("The count parameter must be a finite number");a.push("LIMIT",String(r))}const c=a.join(" ");return o.transaction.__addToTransactionQueue((function(e,r,i,a){y.DEBUG&&console.log("Fetching",o.__currentName,s),e.executeSql(c,s,(function(e,r){let o;y.DEBUG&&console.log("Fetched data",r);try{if(0===r.rows.length)return void(n?i([]):i());if(o=[],t)for(let e=0;e<r.rows.length;e++)o.push(He(I(r.rows.item(e).key),!1));else for(let e=0;e<r.rows.length;e++)o.push(Un(I(r.rows.item(e).value)));n||(o=o[0])}catch(e){y.DEBUG&&console.log(e)}i(o)}),(function(e,t){return a(t),!1}))}),void 0,o)},Yn.prototype.get=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.get`.");return this.__get(e)},Yn.prototype.getKey=function(e){if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.getKey`.");return this.__get(e,!0)},Yn.prototype.getAll=function(){const[e,t]=arguments;return this.__get(e,!1,!0,t)},Yn.prototype.getAllKeys=function(){const[e,t]=arguments;return this.__get(e,!0,!0,t)},Yn.prototype.delete=function(e){const t=this;if(!(this instanceof Yn))throw new TypeError("Illegal invocation");if(!arguments.length)throw new TypeError("A parameter was missing for `IDBObjectStore.delete`.");Yn.__invalidStateIfDeleted(t),_t.__assertActive(t.transaction),t.transaction.__assertWritable();const n=rt(e,!0),r=["DELETE FROM",T(t.__currentName),"WHERE"],o=[];nt(n,O("key"),r,o);const i=r.join(" ");return t.transaction.__addToTransactionQueue((function(e,n,r,a){y.DEBUG&&console.log("Deleting",t.__currentName,o),e.executeSql(i,o,(function(e,n){y.DEBUG&&console.log("Deleted from database",n.rowsAffected),t.__cursors.forEach((e=>{e.__invalidateCache()})),r()}),(function(e,t){return a(t),!1}))}),void 0,t)},Yn.prototype.clear=function(){const e=this;if(!(this instanceof Yn))throw new TypeError("Illegal invocation");return Yn.__invalidStateIfDeleted(e),_t.__assertActive(e.transaction),e.transaction.__assertWritable(),e.transaction.__addToTransactionQueue((function(t,n,r,o){t.executeSql("DELETE FROM "+T(e.__currentName),[],(function(t,n){y.DEBUG&&console.log("Cleared all records from database",n.rowsAffected),e.__cursors.forEach((e=>{e.__invalidateCache()})),r()}),(function(e,t){return o(t),!1}))}),void 0,e)},Yn.prototype.count=function(){const e=this,t=arguments[0];if(!(e instanceof Yn))throw new TypeError("Illegal invocation");return Yn.__invalidStateIfDeleted(e),_t.__assertActive(e.transaction),Ar.__createInstance(t,"next",e,e,"key","value",!0).__request},Yn.prototype.openCursor=function(){const e=this,[t,n]=arguments;if(!(e instanceof Yn))throw new TypeError("Illegal invocation");Yn.__invalidStateIfDeleted(e);const r=Ar.__createInstance(t,n,e,e,"key","value");return e.__cursors.push(r),r.__request},Yn.prototype.openKeyCursor=function(){const e=this;if(!(e instanceof Yn))throw new TypeError("Illegal invocation");Yn.__invalidStateIfDeleted(e);const[t,n]=arguments,r=Sr.__createInstance(t,n,e,e,"key","key");return e.__cursors.push(r),r.__request},Yn.prototype.index=function(e){const t=this;if(!(t instanceof Yn))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No index name was specified");Yn.__invalidStateIfDeleted(t),_t.__assertNotFinished(t.transaction);const n=t.__indexes[e];if(!n||n.__deleted)throw re("NotFoundError",'Index "'+e+'" does not exist on '+t.__currentName);return(!t.__indexHandles[e]||t.__indexes[e].__pendingDelete||t.__indexes[e].__deleted)&&(t.__indexHandles[e]=Gn.__clone(n,t)),t.__indexHandles[e]},Yn.prototype.createIndex=function(e,t){const n=this;let r=arguments[2];if(!(n instanceof Yn))throw new TypeError("Illegal invocation");if(e=String(e),0===arguments.length)throw new TypeError("No index name was specified");if(1===arguments.length)throw new TypeError("No key path was specified");if(_t.__assertVersionChange(n.transaction),Yn.__invalidStateIfDeleted(n),_t.__assertActive(n.transaction),n.__indexes[e]&&!n.__indexes[e].__deleted&&!n.__indexes[e].__pendingDelete)throw re("ConstraintError",'Index "'+e+'" already exists on '+n.__currentName);if(!U(t=G(t)))throw re("SyntaxError","A valid keyPath must be supplied");if(Array.isArray(t)&&r&&r.multiEntry)throw re("InvalidAccessError","The keyPath argument was an array and the multiEntry option is true.");r=r||{};const o={columnName:e,keyPath:t,optionalParams:{unique:Boolean(r.unique),multiEntry:Boolean(r.multiEntry)}},i=Gn.__createInstance(n,o);return Gn.__createIndex(n,i),i},Yn.prototype.deleteIndex=function(e){const t=this;if(!(t instanceof Yn))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No index name was specified");_t.__assertVersionChange(t.transaction),Yn.__invalidStateIfDeleted(t),_t.__assertActive(t.transaction);const n=t.__indexes[e];if(!n)throw re("NotFoundError",'Index "'+e+'" does not exist on '+t.__currentName);Gn.__deleteIndex(t,n)},k(Yn.prototype,zn),P(Yn.prototype,["name"]),Yn.prototype[Symbol.toStringTag]="IDBObjectStorePrototype",Object.defineProperty(Yn,"prototype",{writable:!1});var Xn=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,Zn=function(e){return Xn.exec(e).slice(1)};function er(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r.charAt(0))}return e=Jn(or(e.split("/"),(function(e){return!!e})),!t).join("/"),(t?"/":"")+e||"."}function tr(e){var t=nr(e),n="/"===ir(e,-1);return e=Jn(or(e.split("/"),(function(e){return!!e})),!t).join("/"),e||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function nr(e){return"/"===e.charAt(0)}var rr={extname:function(e){return Zn(e)[3]},basename:function(e,t){var n=Zn(e)[2];return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},dirname:function(e){var t=Zn(e),n=t[0],r=t[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},sep:"/",delimiter:":",relative:function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=er(e).substr(1),t=er(t).substr(1);for(var r=n(e.split("/")),o=n(t.split("/")),i=Math.min(r.length,o.length),a=i,s=0;s<i;s++)if(r[s]!==o[s]){a=s;break}var c=[];for(s=a;s<r.length;s++)c.push("..");return(c=c.concat(o.slice(a))).join("/")},join:function(){return tr(or(Array.prototype.slice.call(arguments,0),(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},isAbsolute:nr,normalize:tr,resolve:er};function or(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}var ir="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)};const ar=["onabort","onclose","onerror","onversionchange"],sr=["name","version","objectStoreNames"];function cr(){throw this.__versionTransaction=null,this.__objectStores=null,this.__transactions=[],new TypeError("Illegal constructor")}const ur=cr;let lr;cr.__createInstance=function(e,t,n,r,o){function i(){this[Symbol.toStringTag]="IDBDatabase",F(this,sr),this.__db=e,this.__closePending=!1,this.__oldVersion=n,this.__version=r,this.__name=t,this.__upgradeTransaction=null,R(this,ar),this.__setOptions({legacyOutputDidListenersThrowFlag:!0}),this.__transactions=[],this.__objectStores={},this.__objectStoreNames=at.__createInstance();const i={};for(let e=0;e<o.rows.length;e++){const t=o.rows.item(e);i.name=t.name,i.keyPath=JSON.parse(t.keyPath),["autoInc","indexList"].forEach((e=>{i[e]=JSON.parse(t[e])})),i.idbdb=this;const n=Yn.__createInstance(i);this.__objectStores[n.name]=n,this.objectStoreNames.push(n.name)}this.__oldObjectStoreNames=this.objectStoreNames.clone()}return i.prototype=ur.prototype,new i},cr.prototype=p.createInstance(),cr.prototype[Symbol.toStringTag]="IDBDatabasePrototype",cr.prototype.createObjectStore=function(e){let t=arguments[1];if(e=String(e),!(this instanceof cr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");_t.__assertVersionChange(this.__versionTransaction),this.throwIfUpgradeTransactionNull(),_t.__assertActive(this.__versionTransaction),t={...t};let{keyPath:n}=t;if(n=void 0===n?null:G(n),null!==n&&!U(n))throw re("SyntaxError","The keyPath argument contains an invalid key path.");if(this.__objectStores[e]&&!this.__objectStores[e].__pendingDelete)throw re("ConstraintError",'Object store "'+e+'" already exists in '+this.name);const r=t.autoIncrement;if(r&&(""===n||Array.isArray(n)))throw re("InvalidAccessError","With autoIncrement set, the keyPath argument must not be an array or empty string.");const o={name:e,keyPath:n,autoInc:r,indexList:{},idbdb:this},i=Yn.__createInstance(o,this.__versionTransaction);return Yn.__createObjectStore(this,i)},cr.prototype.deleteObjectStore=function(e){if(!(this instanceof cr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("No object store name was specified");_t.__assertVersionChange(this.__versionTransaction),this.throwIfUpgradeTransactionNull(),_t.__assertActive(this.__versionTransaction);const t=this.__objectStores[e];if(!t)throw re("NotFoundError",'Object store "'+e+'" does not exist in '+this.name);Yn.__deleteObjectStore(this,t)},cr.prototype.close=function(){if(!(this instanceof cr))throw new TypeError("Illegal invocation");this.__closePending=!0,this.__unblocking&&this.__unblocking.check(),this.__transactions=[]},cr.prototype.transaction=function(e){if(0===arguments.length)throw new TypeError("You must supply a valid `storeNames` to `IDBDatabase.transaction`");let t=arguments[1];if(e=C(e)?[...new Set(G(e))].sort():[V(e)],t=t||"readonly",_t.__assertNotVersionChange(this.__versionTransaction),this.__closePending)throw re("InvalidStateError","An attempt was made to start a new transaction on a database connection that is not open");const n=at.__createInstance();if(e.forEach((e=>{if(!this.objectStoreNames.contains(e))throw re("NotFoundError",'The "'+e+'" object store does not exist');n.push(e)})),0===e.length)throw re("InvalidAccessError","No valid object store names were specified");if("readonly"!==t&&"readwrite"!==t)throw new TypeError("Invalid transaction mode: "+t);const r=_t.__createInstance(this,n,t);return this.__transactions.push(r),r},cr.prototype.throwIfUpgradeTransactionNull=function(){if(null===this.__upgradeTransaction)throw re("InvalidStateError","No upgrade transaction associated with database.")},cr.prototype.__forceClose=function(e){const t=this;t.close();let n=0;t.__transactions.forEach((function(r){r.on__abort=function(){if(n++,n===t.__transactions.length){const e=Q("close");setTimeout((()=>{t.dispatchEvent(e)}))}},r.__abortTransaction(re("AbortError","The connection was force-closed: "+(e||"")))})),t.__transactions=[]},P(cr.prototype,ar),k(cr.prototype,sr),Object.defineProperty(cr.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:cr}),Object.defineProperty(cr,"prototype",{writable:!1});const _r=()=>"object"==typeof location&&location?location.origin:"null",dr=()=>!1!==y.checkOrigin&&"null"===_r(),fr={};function pr(e,t=_r()){const n=fr[t][e];if(!n[0])return;const{req:r,cb:o}=n[0];function i(){n.shift(),pr(e,t)}r.addEventListener("success",i),r.addEventListener("error",i),r.addEventListener("blocked",i),o(r)}function hr(e,t,n=_r(),r){fr[n][t]||(fr[n][t]=[]),fr[n][t].push({req:e,cb:r}),1===fr[n][t].length&&pr(t,n)}function yr(e,t,n,r){const o=e=>e.__closePending,i=()=>e.every((e=>o(e)));return e.reduce((function(e,t){return o(t)?e:e.then((function(){if(o(t))return;const e=new W("versionchange",{oldVersion:n,newVersion:r});return new be((function(n){setTimeout((()=>{t.dispatchEvent(e),n(void 0)}))}))}))}),be.resolve(void 0)).then((function(){if(!i())return new be((function(a){const s={check(){i()&&a(void 0)}},c=new W("blocked",{oldVersion:n,newVersion:r});setTimeout((()=>{t.dispatchEvent(c),i()?a(void 0):e.forEach((e=>{o(e)||(e.__unblocking=s)}))}))}))}))}const br={};let gr,mr=0;function vr(e){return Object.keys(br[e]).map(Number).reduce(((e,t)=>Math.max(t,e)),0)}function Er(e,t,n,r,o){if("string"==typeof y.memoryDatabase){const e=br[t]?function(e){return br[e]&&br[e][vr(e)]}(t):null;if(!e)return console.warn("Could not find a memory database instance to delete."),void r();const n=e._db&&e._db._db;return n&&n.close?void n.close((e=>{e?console.warn("Error closing (destroying) memory database"):r()})):void console.error("The `openDatabase` implementation does not have the expected `._db._db.close` method for closing the database")}if(lr&&!1!==y.deleteDatabaseFiles)return void lr.unlink(rr.join(y.databaseBasePath||"",n),(e=>{e&&"ENOENT"!==e.code?o({code:0,message:"Error removing database file: "+n+" "+e}):r()}));e(rr.join(y.databaseBasePath||"",n),"1",t,y.DEFAULT_DB_SIZE).transaction((function(e){e.executeSql('SELECT "name" FROM __sys__',[],(function(e,t){const n=t.rows;!function t(i){i>=n.length?e.executeSql("DROP TABLE IF EXISTS __sys__",[],(function(){r()}),o):e.executeSql("DROP TABLE "+T(I(n.item(i).name)),[],(function(){t(i+1)}),(function(){return t(i+1),!1}))}(0)}),(function(){return r(),!1}))}))}function wr(e,t,n){function r(e,t){const r=ee(t||e);y.DEBUG&&console.log("Error in sysdb transaction - when creating dbVersions",t),n(r)}gr?t():(gr=e("string"==typeof y.memoryDatabase?y.memoryDatabase:rr.join("string"==typeof y.sysDatabaseBasePath?y.sysDatabaseBasePath:y.databaseBasePath||"","__sysdb__"+(!1!==y.addSQLiteExtension?".sqlite":"")),"1","System Database",y.DEFAULT_DB_SIZE),gr.transaction((function(e){e.executeSql("CREATE TABLE IF NOT EXISTS dbVersions (name BLOB, version INT);",[],(function(e){y.useSQLiteIndexes?e.executeSql("CREATE INDEX IF NOT EXISTS dbvname ON dbVersions(name)",[],t,r):t()}),r)}),r))}function Dr(){throw new TypeError("Illegal constructor")}const Ir=Dr;Dr.__createInstance=function(){function e(){this[Symbol.toStringTag]="IDBFactory",this.__connections={}}return e.prototype=Ir.prototype,new e},Dr.prototype.open=function(e){const t=this;if(!(t instanceof Dr))throw new TypeError("Illegal invocation");let n=arguments[1];if(0===arguments.length)throw new TypeError("Database name is required");if(void 0!==n&&(n=M(n,"unsigned long long"),0===n))throw new TypeError("Version cannot be 0");if(dr())throw re("SecurityError","Cannot open an IndexedDB database from an opaque origin.");const r=le.__createInstance();let o=!1;y.autoName&&""===e&&(e="autoNamedDatabase_"+mr++);const i=D(e=String(e)),a="string"==typeof y.memoryDatabase,s=!1!==y.cacheDatabaseInstances||a;let c;try{c=S(e)}catch(e){throw e}function u(e,t){if(o)return!1;const n=t?ee(t):e;o=!0;const i=Q("error",n,{bubbles:!0,cancelable:!0});return r.__done=!0,r.__error=n,r.__result=void 0,r.dispatchEvent(i),!1}function l(o){let l;if((a||s)&&e in br&&br[e][n]?l=br[e][n]:(l=t.__openDatabase(a?y.memoryDatabase:rr.join(y.databaseBasePath||"",c),"1",e,y.DEFAULT_DB_SIZE),s&&(e in br||(br[e]={}),br[e][n]=l)),void 0===n&&(n=o||1),o>n){const e=re("VersionError","An attempt was made to open a database using a lower version than the existing version.",n);s?setTimeout((()=>{u(e)})):u(e)}else l.transaction((function(a){a.executeSql("CREATE TABLE IF NOT EXISTS __sys__ (name BLOB, keyPath BLOB, autoInc BOOLEAN, indexList BLOB, currNum INTEGER)",[],(function(){function _(){!function(o,a,l){o.executeSql('SELECT "name", "keyPath", "autoInc", "indexList" FROM __sys__',[],(function(o,_){function d(){r.__result=f,r.__done=!0}const f=cr.__createInstance(a,e,l,n,_);if(t.__connections[e]||(t.__connections[e]=[]),t.__connections[e].push(f),l<n)yr(t.__connections[e].slice(0,-1),r,l,n).then((function(){let o=function(e,t,n){if(t)try{e.executeSql("ROLLBACK",[],n,n)}catch(t){gr.transaction((function(e){function t(e){throw new Error("Unable to roll back upgrade transaction!"+(e||""))}0===l?e.executeSql('DELETE FROM dbVersions WHERE "name" = ?',[i],(function(){n(t)}),t):e.executeSql('UPDATE dbVersions SET "version" = ? WHERE "name" = ?',[l,i],n,t)}))}else n()};gr.transaction((function(a){function _(){const i=new W("upgradeneeded",{oldVersion:l,newVersion:n});r.__result=f,f.__upgradeTransaction=r.__transaction=r.__result.__versionTransaction=_t.__createInstance(r.__result,r.__result.objectStoreNames,"versionchange"),r.__done=!0,r.transaction.__addNonRequestToTransactionQueue((function(e,t,n){if(r.dispatchEvent(i),i.__legacyOutputDidListenersThrowError)return X("Error","An error occurred in an upgradeneeded handler attached to request chain",i.__legacyOutputDidListenersThrowError),void r.transaction.__abortTransaction(re("AbortError","A request was aborted."));n()})),r.transaction.on__beforecomplete=function(e){f.__upgradeTransaction=null,r.__result.__versionTransaction=null,o(a,!1,(function(){return r.transaction.__transFinishedCb(!1,(function(){e.complete(),r.__transaction=null})),!1}))},r.transaction.on__preabort=function(){f.__upgradeTransaction=null,s&&e in br&&delete br[e][n]},r.transaction.on__abort=function(){r.__transaction=null,r.__result=void 0,r.__done=!1,f.close(),setTimeout((()=>{const n=re("AbortError","The upgrade transaction was aborted.");o(a,n,(function(r){return 0===l?(Er(t.__openDatabase,e,c,u.bind(null,n),r||u),!1):(u(n),!1)}))}))},r.transaction.on__complete=function(){const e=f.__transactions.indexOf(r.transaction);if(-1!==e&&f.__transactions.splice(e,1),r.__result.__closePending)return r.__transaction=null,void u(re("AbortError","The connection has been closed."));d(),r.__transaction=null;const t=Q("success");r.dispatchEvent(t)}}0===l?a.executeSql("INSERT INTO dbVersions VALUES (?,?)",[i,n],_,u):a.executeSql('UPDATE dbVersions SET "version" = ? WHERE "name" = ?',[n,i],_,u)}),u,void 0,(function(e,t,n,r,i){return!(!e.readOnly&&!t&&(o=function(e,t,n){t?r(t,n):i(n)},1))}))})).catch((e=>{throw console.log("Error within `triggerAnyVersionChangeAndBlockedEvents`"),e}));else{d();const e=Q("success");r.dispatchEvent(e)}}),u)}(a,l,o)}y.createIndexes?a.executeSql("CREATE INDEX IF NOT EXISTS sysname ON __sys__(name)",[],_,u):_()}),u)}),u)}return hr(r,e,void 0,(function(){let n;s&&(e in br||(br[e]={}),n=vr(e)),n?l(n):wr(t.__openDatabase,(function(){gr.readTransaction((function(e){e.executeSql('SELECT "version" FROM dbVersions WHERE "name" = ?',[i],(function(e,t){0===t.rows.length?l(0):l(t.rows.item(0).version)}),u)}),u)}),u)})),r},Dr.prototype.deleteDatabase=function(e){const t=this;if(!(t instanceof Dr))throw new TypeError("Illegal invocation");if(0===arguments.length)throw new TypeError("Database name is required");if(dr())throw re("SecurityError","Cannot delete an IndexedDB database from an opaque origin.");const n=D(e=String(e));let r;try{r=S(e)}catch(e){throw e}const o="string"==typeof y.memoryDatabase,i=!1!==y.cacheDatabaseInstances||o,a=le.__createInstance();let s=!1,c=0,u=function(e,t){t(e)};function l(e,t){if(s||!0===t)return!1;const n=ee(t||e);return u(!0,(function(){a.__done=!0,a.__error=n,a.__result=void 0;const e=Q("error",n,{bubbles:!0,cancelable:!0});a.dispatchEvent(e),s=!0})),!1}return hr(a,e,void 0,(function(o){wr(t.__openDatabase,(function(){function a(){o.__result=void 0,o.__done=!0;const e=new W("success",{oldVersion:c,newVersion:null});o.dispatchEvent(e)}function s(){u(!1,(function(){i&&e in br&&delete br[e],delete t.__connections[e],a()}))}gr.readTransaction((function(i){i.executeSql('SELECT "version" FROM dbVersions WHERE "name" = ?',[n],(function(i,_){if(0===_.rows.length)return void a();({version:c}=_.rows.item(0));yr(t.__connections[e]||[],o,c,null).then((function(){gr.transaction((function(o){o.executeSql('DELETE FROM dbVersions WHERE "name" = ? ',[n],(function(){Er(t.__openDatabase,e,r,s,l)}),l)}),l,void 0,(function(e,t,n,r,o){return!(!e.readOnly&&!t)||(u=function(e,t){e?r(e,t):o(t)},!1)}))}),l)}),l)}))}),l)})),a},Dr.prototype.cmp=function(e,t){if(!(this instanceof Dr))throw new TypeError("Illegal invocation");if(arguments.length<2)throw new TypeError("You must provide two keys to be compared");return Re(e),Re(t),ge(e,t)},Dr.prototype.databases=function(){const e=this;let t=!1;return new Promise((function(n,r){if(!(e instanceof Dr))throw new TypeError("Illegal invocation");if(dr())throw re("SecurityError","Cannot get IndexedDB database names from an opaque origin.");function o(e,n){if(t)return!1;const o=n?ee(n):e;return t=!0,r(o),!1}wr(e.__openDatabase,(function(){gr.readTransaction((function(e){e.executeSql('SELECT "name", "version" FROM dbVersions',[],(function(e,t){const r=[];for(let e=0;e<t.rows.length;e++){const{name:n,version:o}=t.rows.item(e);r.push({name:I(n),version:o})}n(r)}),o)}),o)}),o)}))},Dr.prototype.__forceClose=function(e,t,n){const r=this;function o(e){e.__forceClose(n)}if(H(e))Object.values(r.__connections).forEach((e=>{e.forEach((e=>{o(e)}))}));else if(r.__connections[e])if(H(t))r.__connections[e].forEach((e=>{o(e)}));else{if(!Number.isInteger(t)||t<0||t>r.__connections[e].length-1)throw new TypeError("If providing an argument, __forceClose must be called with a numeric index to indicate a specific connection to close");o(r.__connections[e][t])}else console.log("No database connections with that name to force close")},Dr.prototype.__setConnectionQueueOrigin=function(e=_r()){fr[e]={}},Dr.prototype[Symbol.toStringTag]="IDBFactoryPrototype",Object.defineProperty(Dr,"prototype",{writable:!1});const Or=Dr.__createInstance();function Sr(){throw new TypeError("Illegal constructor")}const Tr=Sr;Sr.__super=function(e,t,n,r,o,i,a){this[Symbol.toStringTag]="IDBCursor",F(this,["key","primaryKey","request"]),Yn.__invalidStateIfDeleted(n),this.__indexSource=B(r,Gn),this.__indexSource&&Gn.__invalidStateIfDeleted(r),_t.__assertActive(n.transaction);const s=rt(e);if(void 0!==t&&!["next","prev","nextunique","prevunique"].includes(t))throw new TypeError(t+"is not a valid cursor direction");Object.defineProperties(this,{source:{writable:!1,value:r},direction:{writable:!1,value:t||"next"}}),this.__key=void 0,this.__primaryKey=void 0,this.__store=n,this.__range=s,this.__request=ce.__createInstance(),this.__request.__source=r,this.__request.__transaction=this.__store.transaction,this.__keyColumnName=o,this.__valueColumnName=i,this.__keyOnly="key"===i,this.__valueDecoder=this.__keyOnly?Ze:Vn,this.__count=a,this.__prefetchedIndex=-1,this.__multiEntryIndex=!!this.__indexSource&&("multiEntry"in r&&r.multiEntry),this.__unique=this.direction.includes("unique"),this.__sqlDirection=["prev","prevunique"].includes(this.direction)?"DESC":"ASC",void 0!==s&&(s.__lowerCached=void 0!==s.lower&&Ge(s.lower,this.__multiEntryIndex),s.__upperCached=void 0!==s.upper&&Ge(s.upper,this.__multiEntryIndex)),this.__gotValue=!0,this.continue()},Sr.__createInstance=function(...e){const t=Tr.__super;return t.prototype=Tr.prototype,new t(...e)},Sr.prototype.__find=function(...e){if(this.__multiEntryIndex){const[t,n,r,o,i,a]=e;this.__findMultiEntry(t,n,r,o,i,a)}else{const[t,n,r,o,i,a]=e;this.__findBasic(t,n,r,o,i,a)}},Sr.prototype.__findBasic=function(e,t,n,r,o,i){const a=void 0!==i;i=i||1;const s=this,c=O(s.__keyColumnName),u=O("key"),l=["SELECT * FROM",T(s.__store.__currentName)],_=[];l.push("WHERE",c,"NOT NULL"),nt(s.__range,c,l,_,!0,!0);const d=s.__sqlDirection,f="ASC"===d?">":"<";void 0!==t&&(l.push("AND",u,f+"= ?"),_.push(Ge(t))),void 0!==e?(l.push("AND",c,f+"= ?"),_.push(Ge(e))):a&&void 0!==s.__key&&(l.push("AND",c,f+" ?"),_.push(Ge(s.__key))),s.__count||(l.push("ORDER BY",c,d),"key"!==s.__keyColumnName&&(s.__unique?"prevunique"===s.direction&&l.push(",",u,"ASC"):l.push(",",u,d)),!s.__unique&&s.__indexSource&&l.push(",",O(s.__valueColumnName),d),l.push("LIMIT",String(i)));const p=l.join(" ");y.DEBUG&&console.log(p,_),n.executeSql(p,_,(function(e,t){s.__count?r(void 0,t.rows.length,void 0):t.rows.length>1?(s.__prefetchedIndex=0,s.__prefetchedData=t.rows,y.DEBUG&&console.log("Preloaded "+s.__prefetchedData.length+" records for cursor"),s.__decode(t.rows.item(0),r)):1===t.rows.length?s.__decode(t.rows.item(0),r):(y.DEBUG&&console.log("Reached end of cursors"),r(void 0,void 0,void 0))}),(function(e,t){return y.DEBUG&&console.log("Could not execute Cursor.continue",p,_),o(t),!1}))};const Nr=/\[/gu;function Ar(){throw new TypeError("Illegal constructor")}Sr.prototype.__findMultiEntry=function(e,t,n,r,o,i){const a=this;if(a.__prefetchedData&&a.__prefetchedData.length===a.__prefetchedIndex)return y.DEBUG&&console.log("Reached end of multiEntry cursor"),void r(void 0,void 0,void 0);const s=O(a.__keyColumnName),c=["SELECT * FROM",T(a.__store.__currentName)],u=[];c.push("WHERE",s,"NOT NULL"),a.__range&&void 0!==a.__range.lower&&Array.isArray(a.__range.upper)&&0===a.__range.upper.indexOf(a.__range.lower)&&(c.push("AND",s,"LIKE ? ESCAPE '^'"),u.push("%"+x(a.__range.__lowerCached.slice(0,-1))+"%"));const l=a.__sqlDirection,_="ASC"===l?">":"<",d=O("key");void 0!==t&&(c.push("AND",d,_+"= ?"),u.push(Ge(t))),void 0!==e?(c.push("AND",s,_+"= ?"),u.push(Ge(e))):void 0!==a.__key&&(c.push("AND",s,_+" ?"),u.push(Ge(a.__key))),a.__count||(c.push("ORDER BY",s,l),a.__unique||"key"===a.__keyColumnName||c.push(",",O("key"),l),!a.__unique&&a.__indexSource&&c.push(",",O(a.__valueColumnName),l),c.push("LIMIT",String(i)));const f=c.join(" ");y.DEBUG&&console.log(f,u),n.executeSql(f,u,(function(e,t){if(t.rows.length>0){if(a.__count){let e=0;for(let n=0;n<t.rows.length;n++){e+=Ke(He(t.rows.item(n)[a.__keyColumnName],!0),a.__range).length}return void r(void 0,e,void 0)}const e=[];for(let n=0;n<t.rows.length;n++){const r=t.rows.item(n),o=Ke(He(r[a.__keyColumnName],!0),a.__range);for(const t of o){const n={matchingKey:Ge(t,!0),key:r.key};n[a.__keyColumnName]=r[a.__keyColumnName],n[a.__valueColumnName]=r[a.__valueColumnName],e.push(n)}}const n=0===a.direction.indexOf("prev");e.sort((function(e,t){return e.matchingKey.replaceAll(Nr,"z")<t.matchingKey.replaceAll(Nr,"z")?n?1:-1:e.matchingKey.replaceAll(Nr,"z")>t.matchingKey.replaceAll(Nr,"z")?n?-1:1:e.key<t.key?"prev"===a.direction?1:-1:e.key>t.key?"prev"===a.direction?-1:1:0})),e.length>1?(a.__prefetchedIndex=0,a.__prefetchedData={data:e,length:e.length,item(e){return this.data[e]}},y.DEBUG&&console.log("Preloaded "+a.__prefetchedData.length+" records for multiEntry cursor"),a.__decode(e[0],r)):1===e.length?(y.DEBUG&&console.log("Reached end of multiEntry cursor"),a.__decode(e[0],r)):(y.DEBUG&&console.log("Reached end of multiEntry cursor"),r(void 0,void 0,void 0))}else y.DEBUG&&console.log("Reached end of multiEntry cursor"),r(void 0,void 0,void 0)}),(function(e,t){return y.DEBUG&&console.log("Could not execute Cursor.continue",f,u),o(t),!1}))},Sr.prototype.__onsuccess=function(e){const t=this;return function(n,r,o){if(t.__count)e(r,t.__request);else{void 0!==n&&(t.__gotValue=!0),t.__key=void 0===n?null:n,t.__primaryKey=void 0===o?null:o,t.__value=void 0===r?null:r;e(void 0===n?null:t,t.__request)}}},Sr.prototype.__decode=function(e,t){const n=this;if(n.__multiEntryIndex&&n.__unique){if(n.__matchedKeys||(n.__matchedKeys={}),n.__matchedKeys[e.matchingKey])return void t(void 0,void 0,void 0);n.__matchedKeys[e.matchingKey]=!0}const r=I(n.__multiEntryIndex?e.matchingKey:e[n.__keyColumnName]),o=I(e[n.__valueColumnName]),i=I(e.key);t(He(r,n.__multiEntryIndex),n.__valueDecoder.decode(o),He(i),r)},Sr.prototype.__sourceOrEffectiveObjStoreDeleted=function(){Yn.__invalidStateIfDeleted(this.__store,"The cursor's effective object store has been deleted"),this.__indexSource&&Gn.__invalidStateIfDeleted(this.source,"The cursor's index source has been deleted")},Sr.prototype.__invalidateCache=function(){this.__prefetchedData=null},Sr.prototype.__continue=function(e,t){const n=this,r=void 0!==n.__advanceCount;if(_t.__assertActive(n.__store.transaction),n.__sourceOrEffectiveObjStoreDeleted(),!n.__gotValue&&!t)throw re("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(void 0!==e){Re(e);const t=ge(e,n.key);if(0===t||n.direction.includes("next")&&-1===t||n.direction.includes("prev")&&1===t)throw re("DataError","Cannot "+(r?"advance":"continue")+" the cursor in an unexpected direction")}this.__continueFinish(e,void 0,r)},Sr.prototype.__continueFinish=function(e,t,n){const r=this,o=r.__advanceCount||y.cursorPreloadPackSize||100;r.__gotValue=!1,r.__request.__done=!1,r.__store.transaction.__pushToQueue(r.__request,(function i(a,s,c,u,l){function _(e,t,o){if(n){if(r.__advanceCount&&r.__advanceCount>=2&&void 0!==e)return r.__advanceCount--,r.__key=e,r.__continue(void 0,!0),void l();r.__advanceCount=void 0}r.__onsuccess(c)(e,t,o)}r.__prefetchedData&&(r.__prefetchedIndex++,r.__prefetchedIndex<r.__prefetchedData.length)?r.__decode(r.__prefetchedData.item(r.__prefetchedIndex),(function(n,o,l,d){!r.__unique||r.__multiEntryIndex||d!==Ge(r.key,r.__multiEntryIndex)?function(){const d=Number(void 0===e)||ge(n,e);d>0||0===d&&(r.__unique||void 0===t||ge(l,t)>=0)?_(n,o,l):i(a,s,c,u)}():i(a,s,c,u)})):r.__find(e,t,a,_,(function(...e){r.__advanceCount=void 0;const[t,n]=e;u(t,n)}),o)}))},Sr.prototype.continue=function(){this.__continue(arguments[0])},Sr.prototype.continuePrimaryKey=function(e,t){const n=this;if(_t.__assertActive(n.__store.transaction),n.__sourceOrEffectiveObjStoreDeleted(),!n.__indexSource)throw re("InvalidAccessError","`continuePrimaryKey` may only be called on an index source.");if(!["next","prev"].includes(n.direction))throw re("InvalidAccessError","`continuePrimaryKey` may not be called with unique cursors.");if(!n.__gotValue)throw re("InvalidStateError","The cursor is being iterated or has iterated past its end.");Re(e),Re(t);const r=ge(e,n.key);if("next"===n.direction&&-1===r||"prev"===n.direction&&1===r)throw re("DataError","Cannot continue the cursor in an unexpected direction");function o(){n.__continueFinish(e,t,!1)}0===r?qn(t,(function(e){qn(n.primaryKey,(function(t){if(e===t||"next"===n.direction&&e<t||"prev"===n.direction&&e>t)throw re("DataError","Cannot continue the cursor in an unexpected direction");o()}))})):o()},Sr.prototype.advance=function(e){const t=this;if(0===(e=M(e,"unsigned long")))throw new TypeError("Calling advance() with count argument 0");t.__gotValue&&(t.__advanceCount=e),t.__continue()},Sr.prototype.update=function(e){const t=this;if(!arguments.length)throw new TypeError("A value must be passed to update()");if(_t.__assertActive(t.__store.transaction),t.__store.transaction.__assertWritable(),t.__sourceOrEffectiveObjStoreDeleted(),!t.__gotValue)throw re("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(t.__keyOnly)throw re("InvalidStateError","This cursor method cannot be called when the key only flag has been set.");const n=t.__store.transaction.__createRequest(t),r=t.primaryKey;function o(e){Yn.__storingRecordObjectStore(n,t.__store,!1,e,!1,r)}if(null!==t.__store.keyPath){const[n,r]=t.__store.__validateKeyAndValueAndCloneValue(e,void 0,!0);if(0!==ge(t.primaryKey,n))throw re("DataError","The key of the supplied value to `update` is not equal to the cursor's effective key");o(r)}else{o(Mn(e))}return n},Sr.prototype.delete=function(){const e=this;if(_t.__assertActive(e.__store.transaction),e.__store.transaction.__assertWritable(),e.__sourceOrEffectiveObjStoreDeleted(),!e.__gotValue)throw re("InvalidStateError","The cursor is being iterated or has iterated past its end.");if(e.__keyOnly)throw re("InvalidStateError","This cursor method cannot be called when the key only flag has been set.");return this.__store.transaction.__addToTransactionQueue((function(t,n,r,o){e.__find(void 0,void 0,t,(function(n,i,a){const s="DELETE FROM "+T(e.__store.__currentName)+' WHERE "key" = ?';y.DEBUG&&console.log(s,n,a),t.executeSql(s,[D(Ge(a))],(function(e,t){1===t.rowsAffected?r(void 0):o("No rows with key found"+n)}),(function(e,t){return o(t),!1}))}),o)}),void 0,e)},Sr.prototype[Symbol.toStringTag]="IDBCursorPrototype",k(Sr.prototype,["source","direction","key","primaryKey","request"]),Object.defineProperty(Sr,"prototype",{writable:!1}),Ar.prototype=Object.create(Sr.prototype),Object.defineProperty(Ar.prototype,"constructor",{enumerable:!1,writable:!0,configurable:!0,value:Ar});const xr=Ar;function Br(e,t){if(e&&"object"==typeof e)Object.entries(e).forEach((([e,t])=>{Br(e,t)}));else{if(!(e in y))throw new Error(e+" is not a valid configuration property");y[e]=t,"registerSCA"===e&&"function"==typeof t&&Ln(t)}}Ar.__createInstance=function(...e){function t(){const[t,n,r,o,i,a,s]=e;Sr.__super.call(this,t,n,r,o,i,a,s),this[Symbol.toStringTag]="IDBCursorWithValue",F(this,"value")}return t.prototype=xr.prototype,new t},k(Ar.prototype,["value"]),Ar.prototype[Symbol.toStringTag]="IDBCursorWithValuePrototype",Object.defineProperty(Ar,"prototype",{writable:!1}),y.win="undefined"!=typeof window?window:self,function(){const e=globalThis||{};function t(t,n,r){if(!r||!Object.defineProperty)try{e[t]=n}catch(e){console.log(e)}if(e[t]!==n&&Object.defineProperty)try{let o=r||{};if("get"in o){const e={get[t](){return r.get.call(this)}};o=Object.getOwnPropertyDescriptor(e,t)}else"value"in o||(o.value=n),"writable"in o||(o.writable=!0);Object.defineProperty(e,t,o)}catch(e){}e[t]!==n&&"undefined"!=typeof console&&console.warn&&console.warn("Unable to shim "+t)}void 0!==y.win.openDatabase&&t("shimIndexedDB",Or,{enumerable:!1,configurable:!0}),"shimIndexedDB"in e&&e.shimIndexedDB?(e.shimIndexedDB.__useShim=function(){function n(e=""){t(e+"DOMException",oe),t(e+"DOMStringList",at,{enumerable:!1,configurable:!0,writable:!0,value:at}),t(e+"Event",c,{configurable:!0,writable:!0,value:c,enumerable:!1}),t(e+"CustomEvent",u,{configurable:!0,writable:!0,value:u,enumerable:!1}),t(e+"EventTarget",d,{configurable:!0,writable:!0,value:d,enumerable:!1})}const r=Dr;if(void 0!==y.win.openDatabase){if(Or.__openDatabase=y.win.openDatabase.bind(y.win),t("indexedDB",Or,{enumerable:!0,configurable:!0,get(){if(this!==e&&!H(this)&&!this.shimNS)throw new TypeError("Illegal invocation");return Or}}),[["IDBFactory",r],["IDBDatabase",cr],["IDBObjectStore",Yn],["IDBIndex",Gn],["IDBTransaction",_t],["IDBCursor",Sr],["IDBCursorWithValue",Ar],["IDBKeyRange",et],["IDBRequest",ce],["IDBOpenDBRequest",le],["IDBVersionChangeEvent",W]].forEach((([e,n])=>{t(e,n,{enumerable:!1,configurable:!0})})),y.fs&&(o=y.fs,lr=o),y.fullIDLSupport&&(Object.setPrototypeOf(e.IDBOpenDBRequest,e.IDBRequest),Object.setPrototypeOf(e.IDBCursorWithValue,e.IDBCursor),Object.setPrototypeOf(cr,d),Object.setPrototypeOf(ce,d),Object.setPrototypeOf(_t,d),Object.setPrototypeOf(W,c),Object.setPrototypeOf(oe,Error),Object.setPrototypeOf(oe.prototype,Error.prototype),Object.setPrototypeOf(u,c),Object.setPrototypeOf(u.prototype,c.prototype)),e.indexedDB&&!e.indexedDB.toString().includes("[native code]")&&(y.addNonIDBGlobals&&n("Shim"),y.replaceNonIDBGlobals&&n()),!e.shimIndexedDB)return;e.shimIndexedDB.__setConnectionQueueOrigin()}var o},e.shimIndexedDB.__debug=function(e){y.DEBUG=e},e.shimIndexedDB.__setConfig=Br,e.shimIndexedDB.__getConfig=function(e){if(!(e in y))throw new Error(e+" is not a valid configuration property");return y[e]},e.shimIndexedDB.__setUnicodeIdentifiers=function({UnicodeIDStart:e,UnicodeIDContinue:t}){Br({UnicodeIDStart:e,UnicodeIDContinue:t})}):(e.shimIndexedDB={},["__useShim","__debug","__setConfig","__getConfig","__setUnicodeIdentifiers"].forEach((t=>{e.shimIndexedDB[t]=function(){console.warn("This browser does not have WebSQL to shim.")}}))),"indexedDB"in e||"undefined"==typeof window||(e.indexedDB=e.indexedDB||"webkitIndexedDB"in e&&e.webkitIndexedDB||"mozIndexedDB"in e&&e.mozIndexedDB||"oIndexedDB"in e&&e.oIndexedDB||"msIndexedDB"in e&&e.msIndexedDB);let n=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(/Android (?:2|3|4\.[0-3])/u.test(navigator.userAgent)&&!navigator.userAgent.includes("Chrome")||(!navigator.userAgent.includes("Safari")||navigator.userAgent.includes("Chrome"))&&/(iPad|iPhone|iPod).* os 9_/iu.test(navigator.userAgent)&&"undefined"!=typeof window&&!("MSStream"in window))&&(n=!0),y.DEFAULT_DB_SIZE||(y.DEFAULT_DB_SIZE=1024*("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")?25:4)*1024),y.avoidAutoShim||e.indexedDB&&!n||void 0===y.win.openDatabase?(e.IDBDatabase=e.IDBDatabase||"webkitIDBDatabase"in e&&e.webkitIDBDatabase,e.IDBTransaction=e.IDBTransaction||"webkitIDBTransaction"in e&&e.webkitIDBTransaction||{},e.IDBCursor=e.IDBCursor||"webkitIDBCursor"in e&&e.webkitIDBCursor,e.IDBKeyRange=e.IDBKeyRange||"webkitIDBKeyRange"in e&&e.webkitIDBKeyRange):e.shimIndexedDB.__useShim()}()}));
3
3
  //# sourceMappingURL=indexeddbshim.min.js.map