@openmrs/esm-app-shell 3.1.11-pre.595 → 3.1.12-pre.598
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.
- package/dist/esm-devtools-app/openmrs-esm-devtools-app.js +1 -1
- package/dist/esm-devtools-app/openmrs-esm-devtools-app.js.buildmanifest.json +1 -1
- package/dist/esm-implementer-tools-app/openmrs-esm-implementer-tools-app.js +1 -1
- package/dist/esm-implementer-tools-app/openmrs-esm-implementer-tools-app.js.buildmanifest.json +1 -1
- package/dist/esm-login-app/openmrs-esm-login-app.js +1 -1
- package/dist/esm-login-app/openmrs-esm-login-app.js.buildmanifest.json +1 -1
- package/dist/esm-offline-tools-app/openmrs-esm-offline-tools-app.js +1 -1
- package/dist/esm-offline-tools-app/openmrs-esm-offline-tools-app.js.buildmanifest.json +1 -1
- package/dist/esm-primary-navigation-app/openmrs-esm-primary-navigation-app.js +1 -1
- package/dist/esm-primary-navigation-app/openmrs-esm-primary-navigation-app.js.buildmanifest.json +1 -1
- package/dist/openmrs.js +1 -1
- package/dist/service-worker.js +1 -1
- package/lib/esm-devtools-app/openmrs-esm-devtools-app.js +1 -1
- package/lib/esm-devtools-app/openmrs-esm-devtools-app.js.buildmanifest.json +1 -1
- package/lib/esm-implementer-tools-app/openmrs-esm-implementer-tools-app.js +1 -1
- package/lib/esm-implementer-tools-app/openmrs-esm-implementer-tools-app.js.buildmanifest.json +1 -1
- package/lib/esm-login-app/openmrs-esm-login-app.js +1 -1
- package/lib/esm-login-app/openmrs-esm-login-app.js.buildmanifest.json +1 -1
- package/lib/esm-offline-tools-app/openmrs-esm-offline-tools-app.js +1 -1
- package/lib/esm-offline-tools-app/openmrs-esm-offline-tools-app.js.buildmanifest.json +1 -1
- package/lib/esm-primary-navigation-app/openmrs-esm-primary-navigation-app.js +1 -1
- package/lib/esm-primary-navigation-app/openmrs-esm-primary-navigation-app.js.buildmanifest.json +1 -1
- package/lib/openmrs.js +2 -2
- package/lib/service-worker.js +1 -1
- package/package.json +7 -7
package/dist/service-worker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{"use strict";var e={183:()=>{try{self["workbox:core:6.2.4"]&&_()}catch(e){}},306:()=>{try{self["workbox:routing:6.2.4"]&&_()}catch(e){}},781:()=>{try{self["workbox:strategies:6.2.4"]&&_()}catch(e){}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}(()=>{n(183);class e extends Error{constructor(e,t){super(((e,...t)=>{let n=e;return t.length>0&&(n+=` :: ${JSON.stringify(t)}`),n})(e,t)),this.name=e,this.details=t}}const t=new Set,r={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},o=e=>{return e||(t=r.runtime,[r.prefix,t,r.suffix].filter((e=>e&&e.length>0)).join("-"));var t};function i(e,t){const n=new URL(e);for(const e of t)n.searchParams.delete(e);return n.href}class a{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}function u(e){return new Promise((t=>setTimeout(t,e)))}const s="object"==typeof global&&global&&global.Object===Object&&global;var c="object"==typeof self&&self&&self.Object===Object&&self;const l=s||c||Function("return this")(),f=l.Symbol,h=Array.isArray;var p=Object.prototype,d=p.hasOwnProperty,y=p.toString,v=f?f.toStringTag:void 0;var m=Object.prototype.toString;var g=f?f.toStringTag:void 0;const b=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":g&&g in Object(e)?function(e){var t=d.call(e,v),n=e[v];try{e[v]=void 0;var r=!0}catch(e){}var o=y.call(e);return r&&(t?e[v]=n:delete e[v]),o}(e):function(e){return m.call(e)}(e)},w=function(e){return null!=e&&"object"==typeof e};var _=f?f.prototype:void 0,k=_?_.toString:void 0;const x=function e(t){if("string"==typeof t)return t;if(h(t))return function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}(t,e)+"";if(function(e){return"symbol"==typeof e||w(e)&&"[object Symbol]"==b(e)}(t))return k?k.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var E=/[\\^$.*+?()[\]{}|]/g,O=RegExp(E.source);const P=function(e){return(e=null==(t=e)?"":x(t))&&O.test(e)?e.replace(E,"\\$&"):e;var t};var S=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},j=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};function R(e,t){return void 0===t&&(t={}),S(this,void 0,void 0,(function(){var n,r,o,i,a,u;return j(this,(function(s){switch(s.label){case 0:n=t.shouldRetry,r=t.getDelay,o=t.onError,n=null!=n?n:function(e){return function(e,t){return e<=5}(e)},r=null!=r?r:function(e){return function(e,t,n){void 0===n&&(n=!1);var r=n?e+1:e;return 1e3*Math.pow(2,r)}(e)},i=0,a=void 0,s.label=1;case 1:return s.trys.push([1,4,,5]),[4,C(r(i))];case 2:return s.sent(),[4,e()];case 3:return[2,s.sent()];case 4:return u=s.sent(),null==o||o(u,i),a=u,[3,5];case 5:if(n(i++))return[3,1];s.label=6;case 6:throw a}}))}))}function C(e){return S(this,void 0,void 0,(function(){return j(this,(function(t){return e<=0?[2]:[2,new Promise((function(t){return setTimeout(t,e)}))]}))}))}const A=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},T=l["__core-js_shared__"];var K,q=(K=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+K:"";var D=Function.prototype.toString;var I=/^\[object .+?Constructor\]$/,B=Function.prototype,F=Object.prototype,M=B.toString,N=F.hasOwnProperty,U=RegExp("^"+M.call(N).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const L=function(e){return!(!A(e)||(t=e,q&&q in t))&&(function(e){if(!A(e))return!1;var t=b(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?U:I).test(function(e){if(null!=e){try{return D.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t},W=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return L(n)?n:void 0},z=W(Object,"create");var H=Object.prototype.hasOwnProperty;var G=Object.prototype.hasOwnProperty;function V(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}V.prototype.clear=function(){this.__data__=z?z(null):{},this.size=0},V.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},V.prototype.get=function(e){var t=this.__data__;if(z){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return H.call(t,e)?t[e]:void 0},V.prototype.has=function(e){var t=this.__data__;return z?void 0!==t[e]:G.call(t,e)},V.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=z&&void 0===t?"__lodash_hash_undefined__":t,this};const $=V,Y=function(e,t){for(var n=e.length;n--;)if((r=e[n][0])===(o=t)||r!=r&&o!=o)return n;var r,o;return-1};var Q=Array.prototype.splice;function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}X.prototype.clear=function(){this.__data__=[],this.size=0},X.prototype.delete=function(e){var t=this.__data__,n=Y(t,e);return!(n<0||(n==t.length-1?t.pop():Q.call(t,n,1),--this.size,0))},X.prototype.get=function(e){var t=this.__data__,n=Y(t,e);return n<0?void 0:t[n][1]},X.prototype.has=function(e){return Y(this.__data__,e)>-1},X.prototype.set=function(e,t){var n=this.__data__,r=Y(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const J=X,Z=W(l,"Map"),ee=function(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function te(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}te.prototype.clear=function(){this.size=0,this.__data__={hash:new $,map:new(Z||J),string:new $}},te.prototype.delete=function(e){var t=ee(this,e).delete(e);return this.size-=t?1:0,t},te.prototype.get=function(e){return ee(this,e).get(e)},te.prototype.has=function(e){return ee(this,e).has(e)},te.prototype.set=function(e,t){var n=ee(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};const ne=te;function re(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ne;++t<n;)this.add(e[t])}re.prototype.add=re.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},re.prototype.has=function(e){return this.__data__.has(e)};const oe=re,ie=function(e){return e!=e},ae=function(e,t){return!(null==e||!e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}(e,ie,n)}(e,t,0)>-1},ue=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1},se=function(e,t){return e.has(t)},ce=W(l,"Set"),le=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},fe=ce&&1/le(new ce([,-0]))[1]==1/0?function(e){return new ce(e)}:function(){};var he,pe="omrs-spa-cache-v1",de=[{'revision':null,'url':'011d289a8d88a2fdfd6cd2c631c6345c.woff'},{'revision':null,'url':'040426f99ff6e00b86506452e0d1f10b.woff'},{'revision':null,'url':'092493151c223670ee3ae92081e1459c.woff2'},{'revision':null,'url':'0d8bb5b3ee5f5dac9e446d48480d28a9.woff2'},{'revision':null,'url':'176f8f5bd5f02b3abfcf894955d7e919.woff2'},{'revision':null,'url':'18d00f739ff1e1c52db1a1c0d9e98129.woff'},{'revision':null,'url':'2267169ee7270a22a963b2b2bfb7ab0c.woff'},{'revision':null,'url':'22fb8afba4ab1f093b6ef9e28a9b6e92.woff'},{'revision':null,'url':'2cb669abc02f2c1dcafa.js'},{'revision':null,'url':'2de7bfeaf08fb03d4315d49947f062f7.woff2'},{'revision':null,'url':'3254cfe8da4b4bdf57791236916365e0.woff'},{'revision':null,'url':'41dba2ac8f3b89bba110ecbb7334575b.woff2'},{'revision':null,'url':'49ae34d4cc6b98c00c69ab4c41de3e0c.woff'},{'revision':null,'url':'4b08e01d805fa35d7bf777f1b24314ae.woff2'},{'revision':null,'url':'57aab56f67155c247201b13c33e66699.woff2'},{'revision':null,'url':'5a0649a56872700d9315cfe399de812e.woff2'},{'revision':null,'url':'5a8e212f1c994e975f940c1a1dc723c8.woff'},{'revision':null,'url':'79db67aca65f5285964ab332bd65f451.woff'},{'revision':null,'url':'7d8125ff7f707231fd89d9d7109deadf.woff2'},{'revision':null,'url':'9360531f9bb817f917f01a6d394515f3.woff'},{'revision':null,'url':'b1d9d9904bfca8802a631c45590b9efa.woff'},{'revision':null,'url':'c18ee39fb002ad58b6dc595476f88fef.woff2'},{'revision':null,'url':'cd92541b177652fffb6e3b952f1c33f1.woff2'},{'revision':null,'url':'cea99d3e3e13a3a599a015c29f1046d0.woff'},{'revision':null,'url':'d022bc70dc1bf7b3425da9cdaa9841b6.woff2'},{'revision':null,'url':'d9479e8023bef9cbd9bf8d6eabd6bf36.woff2'},{'revision':'72cf874e7aa9a0604a3004f1a03ba4c7','url':'esm-devtools-app/67.openmrs-esm-devtools-app.js'},{'revision':'f026dccbdc52447b90622a447cdd38ca','url':'esm-devtools-app/openmrs-esm-devtools-app.js'},{'revision':'ff756894116864642cbf1f3b2a697d45','url':'esm-devtools-app/openmrs-esm-devtools-app.js.buildmanifest.json'},{'revision':'8c6585e1dfb4db238a0e810d2f064e87','url':'esm-implementer-tools-app/266.openmrs-esm-implementer-tools-app.js'},{'revision':'6fce53c7c7713ebf61712cc2929746fa','url':'esm-implementer-tools-app/266.openmrs-esm-implementer-tools-app.js.LICENSE.txt'},{'revision':'b7aa090a71868e6223495b8209208e48','url':'esm-implementer-tools-app/319.openmrs-esm-implementer-tools-app.js'},{'revision':'3167f91c8d1e4ea7a7905f9e74dae1e7','url':'esm-implementer-tools-app/472.openmrs-esm-implementer-tools-app.js'},{'revision':'1692977b9efc0d787ce265a17b328763','url':'esm-implementer-tools-app/574.openmrs-esm-implementer-tools-app.js'},{'revision':'7980155ebca111abe36174e99b020d81','url':'esm-implementer-tools-app/728.openmrs-esm-implementer-tools-app.js'},{'revision':'ce964ac5b34d07803455e371beb62e9c','url':'esm-implementer-tools-app/965.openmrs-esm-implementer-tools-app.js'},{'revision':'81896c98bac7b5b16ab1d3790da5b937','url':'esm-implementer-tools-app/965.openmrs-esm-implementer-tools-app.js.LICENSE.txt'},{'revision':'e3ef4f43d1fba60af3e369c5d13e7237','url':'esm-implementer-tools-app/openmrs-esm-implementer-tools-app.js'},{'revision':'0ece3bc388090a824bacbe181577bfa3','url':'esm-implementer-tools-app/openmrs-esm-implementer-tools-app.js.buildmanifest.json'},{'revision':'950bb59302159e6b7a7b43996b5d93c6','url':'esm-login-app/192.openmrs-esm-login-app.js'},{'revision':'1d248a496703ce7acaaf8f5b753b827b','url':'esm-login-app/236.openmrs-esm-login-app.js'},{'revision':'75c01ecf53582778ed36d765c8a2fbba','url':'esm-login-app/240.openmrs-esm-login-app.js'},{'revision':'300cf600895898996c81c1e90d2861fe','url':'esm-login-app/272.openmrs-esm-login-app.js'},{'revision':'10dca414ff381e093e51e23293431daf','url':'esm-login-app/319.openmrs-esm-login-app.js'},{'revision':'3afef0c6484c055e0c4f4e974893250d','url':'esm-login-app/322.openmrs-esm-login-app.js'},{'revision':'9d08bba9b1203cc1553b53b3a0e9c29c','url':'esm-login-app/336.openmrs-esm-login-app.js'},{'revision':'f7589322a9eb55e6a08dcd8995acc926','url':'esm-login-app/466.openmrs-esm-login-app.js'},{'revision':'fb8925647b6873b7b2806bc492d86a27','url':'esm-login-app/539.openmrs-esm-login-app.js'},{'revision':'d14c1aa13b412073f9bb4c2916610f60','url':'esm-login-app/571.openmrs-esm-login-app.js'},{'revision':'b13dd9c032439ec85273b6f4d304d879','url':'esm-login-app/574.openmrs-esm-login-app.js'},{'revision':'56e1e497f84a5947017c0d8e6470f68f','url':'esm-login-app/644.openmrs-esm-login-app.js'},{'revision':'39adbf8cde7ff9d9f1bff31af4a22595','url':'esm-login-app/673.openmrs-esm-login-app.js'},{'revision':'1c14510040102c4fa52becc292fee3e3','url':'esm-login-app/747.openmrs-esm-login-app.js'},{'revision':'99887f743833d2d35ea0bace32889f51','url':'esm-login-app/757.openmrs-esm-login-app.js'},{'revision':'858598cc555454bf01b354229d7c41ba','url':'esm-login-app/852.openmrs-esm-login-app.js'},{'revision':'81896c98bac7b5b16ab1d3790da5b937','url':'esm-login-app/852.openmrs-esm-login-app.js.LICENSE.txt'},{'revision':'813de325b6ffc54fb9cc62b375d5b267','url':'esm-login-app/984.openmrs-esm-login-app.js'},{'revision':'4205a7b213360e2c45c465845c4ad18d','url':'esm-login-app/openmrs-esm-login-app.js'},{'revision':'ed2803ea0d4bee475086469115d1db61','url':'esm-login-app/openmrs-esm-login-app.js.buildmanifest.json'},{'revision':'85eb01775e54780c23483bae9dcead9b','url':'esm-offline-tools-app/218.openmrs-esm-offline-tools-app.js'},{'revision':'7fec7cf1d855ef562caa5cc75662ef2f','url':'esm-offline-tools-app/438.openmrs-esm-offline-tools-app.js'},{'revision':'c49b51f0611acbdf2eac75b5d9fe47a0','url':'esm-offline-tools-app/535.openmrs-esm-offline-tools-app.js'},{'revision':'cc29644bcabc092809344e368692f5c8','url':'esm-offline-tools-app/574.openmrs-esm-offline-tools-app.js'},{'revision':'095bce75d7332ad9550616304546cb2a','url':'esm-offline-tools-app/697.openmrs-esm-offline-tools-app.js'},{'revision':'366f403d3697cb533aaafbd39077c13f','url':'esm-offline-tools-app/713.openmrs-esm-offline-tools-app.js'},{'revision':'af3d5301cee133c79998dbd78f79616b','url':'esm-offline-tools-app/814.openmrs-esm-offline-tools-app.js'},{'revision':'cbc9366c0e23bc6694d6e83197d6af9b','url':'esm-offline-tools-app/cbc9366c0e23bc6694d6e83197d6af9b.svg'},{'revision':'679e4a57dbceee02f487433334311088','url':'esm-offline-tools-app/openmrs-esm-offline-tools-app.js'},{'revision':'81896c98bac7b5b16ab1d3790da5b937','url':'esm-offline-tools-app/openmrs-esm-offline-tools-app.js.LICENSE.txt'},{'revision':'f12b9c183e13b341d466b956e16c1227','url':'esm-offline-tools-app/openmrs-esm-offline-tools-app.js.buildmanifest.json'},{'revision':'adf98a99aa985440c7751b69fa427859','url':'esm-primary-navigation-app/160.openmrs-esm-primary-navigation-app.js'},{'revision':'1f4cf77e15d54f720bb0b287996756c3','url':'esm-primary-navigation-app/201.openmrs-esm-primary-navigation-app.js'},{'revision':'81896c98bac7b5b16ab1d3790da5b937','url':'esm-primary-navigation-app/201.openmrs-esm-primary-navigation-app.js.LICENSE.txt'},{'revision':'0a2db48353832cb6c3975547adb073b4','url':'esm-primary-navigation-app/574.openmrs-esm-primary-navigation-app.js'},{'revision':'e09fa5e283bfe7f667c58964160c73d1','url':'esm-primary-navigation-app/674.openmrs-esm-primary-navigation-app.js'},{'revision':'92a910f39846d236f2d1b3437a4152a1','url':'esm-primary-navigation-app/764.openmrs-esm-primary-navigation-app.js'},{'revision':'16edd055e0913614ac12d44139c99c7e','url':'esm-primary-navigation-app/878.openmrs-esm-primary-navigation-app.js'},{'revision':'dc946000bbcfc524b347fbbff3a838cd','url':'esm-primary-navigation-app/898.openmrs-esm-primary-navigation-app.js'},{'revision':'783f14fa45b10e088e68f98251448010','url':'esm-primary-navigation-app/898.openmrs-esm-primary-navigation-app.js.LICENSE.txt'},{'revision':'d5cafa73e8e79c7e0c120b3aa16b0bd2','url':'esm-primary-navigation-app/openmrs-esm-primary-navigation-app.js'},{'revision':'03db1d6e050ef4391fb19f3da2998719','url':'esm-primary-navigation-app/openmrs-esm-primary-navigation-app.js.buildmanifest.json'},{'revision':null,'url':'f5b74d7ffcdf85b9dd60130fa0b2c087.woff2'},{'revision':null,'url':'f6efe64b9b246e70f4e82ee61e26b5b7.woff'},{'revision':null,'url':'f87f3d87cea0dd0979bfc8ac9ea90243.woff'},{'revision':'30de494bd9e73ae96c18fd0c06fa422b','url':'favicon.ico'},{'revision':null,'url':'https://spa-modules.nyc3.digitaloceanspaces.com/import-map.json'},{'revision':'18dc895b9723d370fea0437fa399a963','url':'importmap.json'},{'revision':'dde9d344c84c88ae2fcb80cc02913e2f','url':'index.html'},{'revision':'6b758b31ea00150986994edcfb033a94','url':'logo-512.png'},{'revision':'b860db243392596e3b875bad9794b4e5','url':'logo.svg'},{'revision':'18023a1718c7907f9f5a1478035763d0','url':'openmrs.css'},{'revision':'cbd7d0743f2671daf5e4dd3c990c9c39','url':'openmrs.js'},{'revision':'9188e0d35e25fa3723eb796003e71e70','url':'openmrs.js.LICENSE.txt'}],ye=me("index.html"),ve=(he=de.map((function(e){return me(e.url)})))&&he.length?function(e,t,n){var r=-1,o=ae,i=e.length,a=!0,u=[],s=u;if(n)a=!1,o=ue;else if(i>=200){var c=t?null:fe(e);if(c)return le(c);a=!1,o=se,s=new oe}else s=t?[]:u;e:for(;++r<i;){var l=e[r],f=t?t(l):l;if(l=n||0!==l?l:0,a&&f==f){for(var h=s.length;h--;)if(s[h]===f)continue e;t&&s.push(f),u.push(l)}else o(s,f,n)||(s!==u&&s.push(f),u.push(l))}return u}(he):[];function me(e){return new URL(e,self.location.href).href}const ge=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e},be=function(e){return w(e)&&"[object Arguments]"==b(e)};var we=Object.prototype,_e=we.hasOwnProperty,ke=we.propertyIsEnumerable;const xe=be(function(){return arguments}())?be:function(e){return w(e)&&_e.call(e,"callee")&&!ke.call(e,"callee")};var Ee=f?f.isConcatSpreadable:void 0;const Oe=function(e){return h(e)||xe(e)||!!(Ee&&e&&e[Ee])},Pe=function e(t,n,r,o,i){var a=-1,u=t.length;for(r||(r=Oe),i||(i=[]);++a<u;){var s=t[a];n>0&&r(s)?n>1?e(s,n-1,r,o,i):ge(i,s):o||(i[i.length]=s)}return i},Se=function(e){return null!=e&&e.length?Pe(e,1):[]};var je=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},Re=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};function Ce(e){var t=e.imports,n=void 0===t?{}:t;return je(this,void 0,void 0,(function(){var e,t,r=this;return Re(this,(function(o){switch(o.label){case 0:return e=Object.values(n),[4,Promise.all(e.map((function(e){return je(r,void 0,void 0,(function(){var t;return Re(this,(function(n){switch(n.label){case 0:return[4,(r=function(e){return e+".buildmanifest.json"}(e),fetch(r).then((function(e){return e.json()})).catch((function(){return null})))];case 1:return[2,(t=n.sent())?Ae(e,t):[]]}var r}))}))})))];case 1:return t=o.sent(),[2,Se(t)]}}))}))}function Ae(e,t){var n,r,o,i;try{for(var a=[],u=((i=((o=new URL(e)).origin+o.pathname).split("/"))[i.length-1]="",i.join("/")),s=0,c=null!==(n=t.chunks)&&void 0!==n?n:[];s<c.length;s++)for(var l=c[s],f=0,h=null!==(r=l.files)&&void 0!==r?r:[];f<h.length;f++){var p=h[f];a.push(new URL(p,u).toString())}return a}catch(e){return[]}}var Te=function(){return(Te=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Ke(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}var qe=Object.keys,De=Array.isArray,Ie="undefined"!=typeof self?self:"undefined"!=typeof window?window:global;function Be(e,t){return"object"!=typeof t||qe(t).forEach((function(n){e[n]=t[n]})),e}"undefined"==typeof Promise||Ie.Promise||(Ie.Promise=Promise);var Fe=Object.getPrototypeOf,Me={}.hasOwnProperty;function Ne(e,t){return Me.call(e,t)}function Ue(e,t){"function"==typeof t&&(t=t(Fe(e))),qe(t).forEach((function(n){We(e,n,t[n])}))}var Le=Object.defineProperty;function We(e,t,n,r){Le(e,t,Be(n&&Ne(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function ze(e){return{from:function(t){return e.prototype=Object.create(t.prototype),We(e.prototype,"constructor",e),{extend:Ue.bind(null,e.prototype)}}}}var He=Object.getOwnPropertyDescriptor;function Ge(e,t){var n;return He(e,t)||(n=Fe(e))&&Ge(n,t)}var Ve=[].slice;function $e(e,t,n){return Ve.call(e,t,n)}function Ye(e,t){return t(e)}function Qe(e){if(!e)throw new Error("Assertion Failed")}function Xe(e){Ie.setImmediate?setImmediate(e):setTimeout(e,0)}function Je(e,t){return e.reduce((function(e,n,r){var o=t(n,r);return o&&(e[o[0]]=o[1]),e}),{})}function Ze(e,t){if(Ne(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,o=t.length;r<o;++r){var i=Ze(e,t[r]);n.push(i)}return n}var a=t.indexOf(".");if(-1!==a){var u=e[t.substr(0,a)];return void 0===u?void 0:Ze(u,t.substr(a+1))}}function et(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){Qe("string"!=typeof n&&"length"in n);for(var r=0,o=t.length;r<o;++r)et(e,t[r],n[r])}else{var i=t.indexOf(".");if(-1!==i){var a=t.substr(0,i),u=t.substr(i+1);if(""===u)void 0===n?De(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=n;else{var s=e[a];s||(s=e[a]={}),et(s,u,n)}}else void 0===n?De(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function tt(e,t){"string"==typeof t?et(e,t,void 0):"length"in t&&[].map.call(t,(function(t){et(e,t,void 0)}))}function nt(e){var t={};for(var n in e)Ne(e,n)&&(t[n]=e[n]);return t}var rt=[].concat;function ot(e){return rt.apply([],e)}var it="Boolean,String,Date,RegExp,Blob,File,FileList,ArrayBuffer,DataView,Uint8ClampedArray,ImageData,Map,Set".split(",").concat(ot([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return Ie[e]})),at=it.map((function(e){return Ie[e]})),ut=Je(it,(function(e){return[e,!0]}));function st(e){if(!e||"object"!=typeof e)return e;var t;if(De(e)){t=[];for(var n=0,r=e.length;n<r;++n)t.push(st(e[n]))}else if(at.indexOf(e.constructor)>=0)t=e;else for(var o in t=e.constructor?Object.create(e.constructor.prototype):{},e)Ne(e,o)&&(t[o]=st(e[o]));return t}var ct={}.toString;function lt(e){return ct.call(e).slice(8,-1)}var ft=function(e,t){return"Array"===t?""+e.map((function(e){return ft(e,lt(e))})):"ArrayBuffer"===t?""+new Uint8Array(e):"Date"===t?e.getTime():ArrayBuffer.isView(e)?""+new Uint8Array(e.buffer):e};function ht(e,t,n,r){return n=n||{},r=r||"",qe(e).forEach((function(o){if(Ne(t,o)){var i=e[o],a=t[o];if("object"==typeof i&&"object"==typeof a&&i&&a){var u=lt(i),s=lt(a);u===s?ut[u]?ft(i,u)!==ft(a,s)&&(n[r+o]=t[o]):ht(i,a,n,r+o+"."):n[r+o]=t[o]}else i!==a&&(n[r+o]=t[o])}else n[r+o]=void 0})),qe(t).forEach((function(o){Ne(e,o)||(n[r+o]=t[o])})),n}var pt="undefined"!=typeof Symbol&&Symbol.iterator,dt=pt?function(e){var t;return null!=e&&(t=e[pt])&&t.apply(e)}:function(){return null},yt={};function vt(e){var t,n,r,o;if(1===arguments.length){if(De(e))return e.slice();if(this===yt&&"string"==typeof e)return[e];if(o=dt(e)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}var mt="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},gt="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function bt(e,t){gt=e,wt=t}var wt=function(){return!0},_t=!new Error("").stack;function kt(){if(_t)try{throw new Error}catch(e){return e}return new Error}function xt(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(wt).map((function(e){return"\n"+e})).join("")):""}var Et=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Ot=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Et),Pt={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};function St(e,t){this._e=kt(),this.name=e,this.message=t}function jt(e,t){return e+". Errors: "+Object.keys(t).map((function(e){return t[e].toString()})).filter((function(e,t,n){return n.indexOf(e)===t})).join("\n")}function Rt(e,t,n,r){this._e=kt(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=jt(e,t)}function Ct(e,t){this._e=kt(),this.name="BulkError",this.failures=t,this.message=jt(e,t)}ze(St).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+xt(this._e,2))}},toString:function(){return this.name+": "+this.message}}),ze(Rt).from(St),ze(Ct).from(St);var At=Ot.reduce((function(e,t){return e[t]=t+"Error",e}),{}),Tt=St,Kt=Ot.reduce((function(e,t){var n=t+"Error";function r(e,r){this._e=kt(),this.name=n,e?"string"==typeof e?(this.message=e+(r?"\n "+r:""),this.inner=r||null):"object"==typeof e&&(this.message=e.name+" "+e.message,this.inner=e):(this.message=Pt[t]||n,this.inner=null)}return ze(r).from(Tt),e[t]=r,e}),{});Kt.Syntax=SyntaxError,Kt.Type=TypeError,Kt.Range=RangeError;var qt=Et.reduce((function(e,t){return e[t+"Error"]=Kt[t],e}),{}),Dt=Ot.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Kt[t]),e}),{});function It(){}function Bt(e){return e}function Ft(e,t){return null==e||e===Bt?t:function(n){return t(e(n))}}function Mt(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Nt(e,t){return e===It?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?Mt(r,this.onsuccess):r),o&&(this.onerror=this.onerror?Mt(o,this.onerror):o),void 0!==i?i:n}}function Ut(e,t){return e===It?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?Mt(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Mt(r,this.onerror):r)}}function Lt(e,t){return e===It?t:function(n){var r=e.apply(this,arguments);Be(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?Mt(o,this.onsuccess):o),i&&(this.onerror=this.onerror?Mt(i,this.onerror):i),void 0===r?void 0===a?void 0:a:Be(r,a)}}function Wt(e,t){return e===It?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function zt(e,t){return e===It?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,o=arguments.length,i=new Array(o);o--;)i[o]=arguments[o];return n.then((function(){return t.apply(r,i)}))}return t.apply(this,arguments)}}Dt.ModifyError=Rt,Dt.DexieError=St,Dt.BulkError=Ct;var Ht={},Gt="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,e.__proto__,e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,t.__proto__,e]}(),Vt=Gt[0],$t=Gt[1],Yt=Gt[2],Qt=$t&&$t.then,Xt=Vt&&Vt.constructor,Jt=!!Yt,Zt=!1,en=Yt?function(){Yt.then(En)}:Ie.setImmediate?setImmediate.bind(null,En):Ie.MutationObserver?function(){var e=document.createElement("div");new MutationObserver((function(){En(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(En,0)},tn=function(e,t){fn.push([e,t]),rn&&(en(),rn=!1)},nn=!0,rn=!0,on=[],an=[],un=null,sn=Bt,cn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Yn,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{Yn(e[0],e[1])}catch(e){}}))}},ln=cn,fn=[],hn=0,pn=[];function dn(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=It,this._lib=!1;var t=this._PSD=ln;if(gt&&(this._stackHolder=kt(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Ht)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&gn(this,this._value))}this._state=null,this._value=null,++t.ref,mn(this,e)}var yn={get:function(){var e=ln,t=qn;function n(n,r){var o=this,i=!e.global&&(e!==ln||t!==qn),a=i&&!Fn(),u=new dn((function(t,u){wn(o,new vn(Gn(n,e,i,a),Gn(r,e,i,a),t,u,e))}));return gt&&xn(u,this),u}return n.prototype=Ht,n},set:function(e){We(this,"then",e&&e.prototype===Ht?yn:{get:function(){return e},set:yn.set})}};function vn(e,t,n,r,o){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=o}function mn(e,t){try{t((function(t){if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&On();t&&"function"==typeof t.then?mn(e,(function(e,n){t instanceof dn?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,bn(e)),n&&Pn()}}),gn.bind(null,e))}catch(t){gn(e,t)}}function gn(e,t){if(an.push(t),null===e._state){var n=e._lib&&On();t=sn(t),e._state=!1,e._value=t,gt&&null!==t&&"object"==typeof t&&!t._promise&&function(n,r,o){try{(function(){var n=Ge(t,"stack");t._promise=e,We(t,"stack",{get:function(){return Zt?n&&(n.get?n.get.apply(t):n.value):e.stack}})}).apply(null,void 0)}catch(e){}}(),function(e){on.some((function(t){return t._value===e._value}))||on.push(e)}(e),bn(e),n&&Pn()}}function bn(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)wn(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),0===hn&&(++hn,tn((function(){0==--hn&&Sn()}),[]))}function wn(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++hn,tn(_n,[n,e,t])}else e._listeners.push(t)}function _n(e,t,n){try{un=t;var r,o=t._value;t._state?r=e(o):(an.length&&(an=[]),r=e(o),-1===an.indexOf(o)&&function(e){for(var t=on.length;t;)if(on[--t]._value===e._value)return void on.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{un=null,0==--hn&&Sn(),--n.psd.ref||n.psd.finalize()}}function kn(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var o,i,a=e._value;null!=a?(o=a.name||"Error",i=a.message||a,r=xt(a,0)):(o=a,i=""),t.push(o+(i?": "+i:"")+r)}return gt&&((r=xt(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&kn(e._prev,t,n)),t}function xn(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function En(){On()&&Pn()}function On(){var e=nn;return nn=!1,rn=!1,e}function Pn(){var e,t,n;do{for(;fn.length>0;)for(e=fn,fn=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(fn.length>0);nn=!0,rn=!0}function Sn(){var e=on;on=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=pn.slice(0),n=t.length;n;)t[--n]()}function jn(e){return new dn(Ht,!1,e)}function Rn(e,t){var n=ln;return function(){var r=On(),o=ln;try{return Ln(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Ln(o,!1),r&&Pn()}}}Ue(dn.prototype,{then:yn,_then:function(e,t){wn(this,new vn(null,null,e,t,ln))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,(function(e){return e instanceof t?n(e):jn(e)})):this.then(null,(function(e){return e&&e.name===t?n(e):jn(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),jn(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{Zt=!0;var e=kn(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Zt=!1}}},timeout:function(e,t){var n=this;return e<1/0?new dn((function(r,o){var i=setTimeout((function(){return o(new Kt.Timeout(t))}),e);n.then(r,o).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&We(dn.prototype,Symbol.toStringTag,"Dexie.Promise"),cn.env=Wn(),Ue(dn,{all:function(){var e=vt.apply(null,arguments).map(Mn);return new dn((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(o,i){return dn.resolve(o).then((function(n){e[i]=n,--r||t(e)}),n)}))}))},resolve:function(e){if(e instanceof dn)return e;if(e&&"function"==typeof e.then)return new dn((function(t,n){e.then(t,n)}));var t=new dn(Ht,!0,e);return xn(t,un),t},reject:jn,race:function(){var e=vt.apply(null,arguments).map(Mn);return new dn((function(t,n){e.map((function(e){return dn.resolve(e).then(t,n)}))}))},PSD:{get:function(){return ln},set:function(e){return ln=e}},totalEchoes:{get:function(){return qn}},newPSD:In,usePSD:zn,scheduler:{get:function(){return tn},set:function(e){tn=e}},rejectionMapper:{get:function(){return sn},set:function(e){sn=e}},follow:function(e,t){return new dn((function(n,r){return In((function(t,n){var r=ln;r.unhandleds=[],r.onunhandled=n,r.finalize=Mt((function(){var e=this;pn.push((function r(){0===e.unhandleds.length?t():n(e.unhandleds[0]),pn.splice(pn.indexOf(r),1)})),++hn,tn((function(){0==--hn&&Sn()}),[])}),r.finalize),e()}),t,n,r)}))}}),Xt&&(Xt.allSettled&&We(dn,"allSettled",(function(){var e=vt.apply(null,arguments).map(Mn);return new dn((function(t){0===e.length&&t([]);var n=e.length,r=new Array(n);e.forEach((function(e,o){return dn.resolve(e).then((function(e){return r[o]={status:"fulfilled",value:e}}),(function(e){return r[o]={status:"rejected",reason:e}})).then((function(){return--n||t(r)}))}))}))})),Xt.any&&"undefined"!=typeof AggregateError&&We(dn,"any",(function(){var e=vt.apply(null,arguments).map(Mn);return new dn((function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,o=new Array(r);e.forEach((function(e,i){return dn.resolve(e).then((function(e){return t(e)}),(function(e){o[i]=e,--r||n(new AggregateError(o))}))}))}))})));var Cn={awaits:0,echoes:0,id:0},An=0,Tn=[],Kn=0,qn=0,Dn=0;function In(e,t,n,r){var o=ln,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++Dn;var a=cn.env;i.env=Jt?{Promise:dn,PromiseProp:{value:dn,configurable:!0,writable:!0},all:dn.all,race:dn.race,allSettled:dn.allSettled,any:dn.any,resolve:dn.resolve,reject:dn.reject,nthen:Vn(a.nthen,i),gthen:Vn(a.gthen,i)}:{},t&&Be(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=zn(i,e,n,r);return 0===i.ref&&i.finalize(),u}function Bn(){return Cn.id||(Cn.id=++An),++Cn.awaits,Cn.echoes+=100,Cn.id}function Fn(){return!!Cn.awaits&&(0==--Cn.awaits&&(Cn.id=0),Cn.echoes=100*Cn.awaits,!0)}function Mn(e){return Cn.echoes&&e&&e.constructor===Xt?(Bn(),e.then((function(e){return Fn(),e}),(function(e){return Fn(),Qn(e)}))):e}function Nn(e){++qn,Cn.echoes&&0!=--Cn.echoes||(Cn.echoes=Cn.id=0),Tn.push(ln),Ln(e,!0)}function Un(){var e=Tn[Tn.length-1];Tn.pop(),Ln(e,!1)}function Ln(e,t){var n=ln;if((t?!Cn.echoes||Kn++&&e===ln:!Kn||--Kn&&e===ln)||Hn(t?Nn.bind(null,e):Un),e!==ln&&(ln=e,n===cn&&(cn.env=Wn()),Jt)){var r=cn.env.Promise,o=e.env;$t.then=o.nthen,r.prototype.then=o.gthen,(n.global||e.global)&&(Object.defineProperty(Ie,"Promise",o.PromiseProp),r.all=o.all,r.race=o.race,r.resolve=o.resolve,r.reject=o.reject,o.allSettled&&(r.allSettled=o.allSettled),o.any&&(r.any=o.any))}}function Wn(){var e=Ie.Promise;return Jt?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(Ie,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:$t.then,gthen:e.prototype.then}:{}}function zn(e,t,n,r,o){var i=ln;try{return Ln(e,!0),t(n,r,o)}finally{Ln(i,!1)}}function Hn(e){Qt.call(Vt,e)}function Gn(e,t,n,r){return"function"!=typeof e?e:function(){var o=ln;n&&Bn(),Ln(t,!0);try{return e.apply(this,arguments)}finally{Ln(o,!1),r&&Hn(Fn)}}}function Vn(e,t){return function(n,r){return e.call(this,Gn(n,t),Gn(r,t))}}-1===(""+Qt).indexOf("[native code]")&&(Bn=Fn=It);var $n="unhandledrejection";function Yn(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,o={promise:t,reason:e};if(Ie.document&&document.createEvent?((r=document.createEvent("Event")).initEvent($n,!0,!0),Be(r,o)):Ie.CustomEvent&&Be(r=new CustomEvent($n,{detail:o}),o),r&&Ie.dispatchEvent&&(dispatchEvent(r),!Ie.PromiseRejectionEvent&&Ie.onunhandledrejection))try{Ie.onunhandledrejection(r)}catch(e){}gt&&r&&!r.defaultPrevented&&console.warn("Unhandled rejection: "+(e.stack||e))}catch(e){}}var Qn=dn.reject;function Xn(e,t,n,r){if(e._state.openComplete||ln.letThrough){var o=e._createTransaction(t,n,e._dbSchema);try{o.create()}catch(e){return Qn(e)}return o._promise(t,(function(e,t){return In((function(){return ln.trans=o,r(e,t,o)}))})).then((function(e){return o._completion.then((function(){return e}))}))}if(!e._state.isBeingOpened){if(!e._options.autoOpen)return Qn(new Kt.DatabaseClosed);e.open().catch(It)}return e._state.dbReadyPromise.then((function(){return Xn(e,t,n,r)}))}var Jn="3.0.3",Zn=String.fromCharCode(65535),er=-1/0,tr="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",nr="String expected.",rr=[],or="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),ir=or,ar=or,ur=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)},sr="__dbnames",cr="readonly",lr="readwrite";function fr(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var hr={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function pr(e){return function(t){return void 0===Ze(t,e)&&tt(t=st(t),e),t}}var dr=function(){function e(){}return e.prototype._trans=function(e,t,n){var r=this._tx||ln.trans,o=this.name;function i(e,n,r){if(!r.schema[o])throw new Kt.NotFound("Table "+o+" not part of transaction");return t(r.idbtrans,r)}var a=On();try{return r&&r.db===this.db?r===ln.trans?r._promise(e,i,n):In((function(){return r._promise(e,i,n)}),{trans:r,transless:ln.transless||ln}):Xn(this.db,e,[this.name],i)}finally{a&&Pn()}},e.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(function(t){return n.core.get({trans:t,key:e}).then((function(e){return n.hook.reading.fire(e)}))})).then(t)},e.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(De(e))return new this.db.WhereClause(this,"["+e.join("+")+"]");var t=qe(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter((function(e){return e.compound&&t.every((function(t){return e.keyPath.indexOf(t)>=0}))&&e.keyPath.every((function(e){return t.indexOf(e)>=0}))}))[0];if(n&&this.db._maxKey!==Zn)return this.where(n.name).equals(n.keyPath.map((function(t){return e[t]})));!n&>&&console.warn("The query "+JSON.stringify(e)+" on "+this.name+" would benefit of a compound index ["+t.join("+")+"]");var r=this.schema.idxByName,o=this.db._deps.indexedDB;function i(e,t){try{return 0===o.cmp(e,t)}catch(e){return!1}}var a=t.reduce((function(t,n){var o=t[0],a=t[1],u=r[n],s=e[n];return[o||u,o||!u?fr(a,u&&u.multi?function(e){var t=Ze(e,n);return De(t)&&t.some((function(e){return i(s,e)}))}:function(e){return i(s,Ze(e,n))}):a]}),[null,null]),u=a[0],s=a[1];return u?this.where(u.name).equals(e[u.keyPath]).filter(s):n?this.filter(s):this.where(t).equals("")},e.prototype.filter=function(e){return this.toCollection().and(e)},e.prototype.count=function(e){return this.toCollection().count(e)},e.prototype.offset=function(e){return this.toCollection().offset(e)},e.prototype.limit=function(e){return this.toCollection().limit(e)},e.prototype.each=function(e){return this.toCollection().each(e)},e.prototype.toArray=function(e){return this.toCollection().toArray(e)},e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},e.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,De(e)?"["+e.join("+")+"]":e))},e.prototype.reverse=function(){return this.toCollection().reverse()},e.prototype.mapToClass=function(e){this.schema.mappedClass=e;var t=function(t){if(!t)return t;var n=Object.create(e.prototype);for(var r in t)if(Ne(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e},e.prototype.defineClass=function(){return this.mapToClass((function(e){Be(this,e)}))},e.prototype.add=function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=pr(i)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})})).then((function(e){return e.numFailures?dn.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{et(e,i,t)}catch(e){}return t}))},e.prototype.update=function(e,t){if("object"!=typeof t||De(t))throw new Kt.InvalidArgument("Modifications must be an object.");if("object"!=typeof e||De(e))return this.where(":id").equals(e).modify(t);qe(t).forEach((function(n){et(e,n,t[n])}));var n=Ze(e,this.schema.primKey.keyPath);return void 0===n?Qn(new Kt.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(n).modify(t)},e.prototype.put=function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=pr(i)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})})).then((function(e){return e.numFailures?dn.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{et(e,i,t)}catch(e){}return t}))},e.prototype.delete=function(e){var t=this;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})})).then((function(e){return e.numFailures?dn.reject(e.failures[0]):void 0}))},e.prototype.clear=function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:hr})})).then((function(e){return e.numFailures?dn.reject(e.failures[0]):void 0}))},e.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",(function(n){return t.core.getMany({keys:e,trans:n}).then((function(e){return e.map((function(e){return t.hook.reading.fire(e)}))}))}))},e.prototype.bulkAdd=function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,i=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new Kt.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new Kt.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,c=u&&a?e.map(pr(u)):e;return r.core.mutate({trans:t,type:"add",keys:o,values:c,wantResults:i}).then((function(e){var t=e.numFailures,n=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?n:o;throw new Ct(r.name+".bulkAdd(): "+t+" of "+s+" operations failed",Object.keys(a).map((function(e){return a[e]})))}))}))},e.prototype.bulkPut=function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,i=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new Kt.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new Kt.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,c=u&&a?e.map(pr(u)):e;return r.core.mutate({trans:t,type:"put",keys:o,values:c,wantResults:i}).then((function(e){var t=e.numFailures,n=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?n:o;throw new Ct(r.name+".bulkPut(): "+t+" of "+s+" operations failed",Object.keys(a).map((function(e){return a[e]})))}))}))},e.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:e})})).then((function(e){var r=e.numFailures,o=e.lastResult,i=e.failures;if(0===r)return o;throw new Ct(t.name+".bulkDelete(): "+r+" of "+n+" operations failed",i)}))},e}();function yr(e){var t={},n=function(n,r){if(r){for(var o=arguments.length,i=new Array(o-1);--o;)i[o-1]=arguments[o];return t[n].subscribe.apply(null,i),e}if("string"==typeof n)return t[n]};n.addEventType=i;for(var r=1,o=arguments.length;r<o;++r)i(arguments[r]);return n;function i(e,r,o){if("object"==typeof e)return a(e);r||(r=Wt),o||(o=It);var i={subscribers:[],fire:o,subscribe:function(e){-1===i.subscribers.indexOf(e)&&(i.subscribers.push(e),i.fire=r(i.fire,e))},unsubscribe:function(e){i.subscribers=i.subscribers.filter((function(t){return t!==e})),i.fire=i.subscribers.reduce(r,o)}};return t[e]=n[e]=i,i}function a(e){qe(e).forEach((function(t){var n=e[t];if(De(n))i(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new Kt.InvalidArgument("Invalid event config");var r=i(t,Bt,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){Xe((function(){e.apply(null,t)}))}))}))}}))}}function vr(e,t){return ze(t).from({prototype:e}),t}function mr(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function gr(e,t){e.filter=fr(e.filter,t)}function br(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return fr(r(),t())}:t,e.justLimit=n&&!r}function wr(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new Kt.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function _r(e,t,n){var r=wr(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function kr(e,t,n,r){var o=e.replayFilter?fr(e.filter,e.replayFilter()):e.filter;if(e.or){var i={},a=function(e,n,r){if(!o||o(n,r,(function(e){return n.stop(e)}),(function(e){return n.fail(e)}))){var a=n.primaryKey,u=""+a;"[object ArrayBuffer]"===u&&(u=""+new Uint8Array(a)),Ne(i,u)||(i[u]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(a,n),xr(_r(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return xr(_r(e,r,n),fr(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function xr(e,t,n,r){var o=Rn(r?function(e,t,o){return n(r(e),t,o)}:n);return e.then((function(e){if(e)return e.start((function(){var n=function(){return e.continue()};t&&!t(e,(function(e){return n=e}),(function(t){e.stop(t),n=It}),(function(t){e.fail(t),n=It}))||o(e.value,e,(function(e){return n=e})),n()}))}))}var Er=function(){function e(){}return e.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,Qn.bind(null,n.error)):n.table._trans("readonly",e).then(t)},e.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,Qn.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},e.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=fr(t.algorithm,e)},e.prototype._iterate=function(e,t){return kr(this._ctx,e,t,this._ctx.table.core)},e.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&Be(n,e),t._ctx=n,t},e.prototype.raw=function(){return this._ctx.valueMapper=null,this},e.prototype.each=function(e){var t=this._ctx;return this._read((function(n){return kr(t,e,n,t.table.core)}))},e.prototype.count=function(e){var t=this;return this._read((function(e){var n=t._ctx,r=n.table.core;if(mr(n,!0))return r.count({trans:e,query:{index:wr(n,r.schema),range:n.range}}).then((function(e){return Math.min(e,n.limit)}));var o=0;return kr(n,(function(){return++o,!1}),e,r).then((function(){return o}))})).then(e)},e.prototype.sortBy=function(e,t){var n=e.split(".").reverse(),r=n[0],o=n.length-1;function i(e,t){return t?i(e[n[t]],t-1):e[r]}var a="next"===this._ctx.dir?1:-1;function u(e,t){var n=i(e,o),r=i(t,o);return n<r?-a:n>r?a:0}return this.toArray((function(e){return e.sort(u)})).then(t)},e.prototype.toArray=function(e){var t=this;return this._read((function(e){var n=t._ctx;if("next"===n.dir&&mr(n,!0)&&n.limit>0){var r=n.valueMapper,o=wr(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:o,range:n.range}}).then((function(e){var t=e.result;return r?t.map(r):t}))}var i=[];return kr(n,(function(e){return i.push(e)}),e,n.table.core).then((function(){return i}))}),e)},e.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,mr(t)?br(t,(function(){var t=e;return function(e,n){return 0===t||(1===t?(--t,!1):(n((function(){e.advance(t),t=0})),!1))}})):br(t,(function(){var t=e;return function(){return--t<0}}))),this},e.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),br(this._ctx,(function(){var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this},e.prototype.until=function(e,t){return gr(this._ctx,(function(n,r,o){return!e(n.value)||(r(o),t)})),this},e.prototype.first=function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},e.prototype.last=function(e){return this.reverse().first(e)},e.prototype.filter=function(e){var t,n;return gr(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=fr(t.isMatch,n),this},e.prototype.and=function(e){return this.filter(e)},e.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},e.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},e.prototype.desc=function(){return this.reverse()},e.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))},e.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},e.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))},e.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)},e.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&mr(t,!0)&&t.limit>0)return this._read((function(e){var n=wr(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((function(e){return e.result})).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)},e.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},e.prototype.firstKey=function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},e.prototype.lastKey=function(e){return this.reverse().firstKey(e)},e.prototype.distinct=function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return gr(this._ctx,(function(e){var t=e.primaryKey.toString(),r=Ne(n,t);return n[t]=!0,!r})),this},e.prototype.modify=function(e){var t=this,n=this._ctx;return this._write((function(r){var o;if("function"==typeof e)o=e;else{var i=qe(e),a=i.length;o=function(t){for(var n=!1,r=0;r<a;++r){var o=i[r],u=e[o];Ze(t,o)!==u&&(et(t,o,u),n=!0)}return n}}var u=n.table.core,s=u.schema.primaryKey,c=s.outbound,l=s.extractKey,f="testmode"in po?1:2e3,h=t.db.core.cmp,p=[],d=0,y=[],v=function(e,t){var n=t.failures,r=t.numFailures;d+=e-r;for(var o=0,i=qe(n);o<i.length;o++){var a=i[o];p.push(n[a])}};return t.clone().primaryKeys().then((function(e){var t=function(n){var i=Math.min(f,e.length-n);return u.getMany({trans:r,keys:e.slice(n,n+i)}).then((function(a){for(var s=[],p=[],d=c?[]:null,y=[],m=0;m<i;++m){var g=a[m],b={value:st(g),primKey:e[n+m]};!1!==o.call(b,b.value,b)&&(null==b.value?y.push(e[n+m]):c||0===h(l(g),l(b.value))?(p.push(b.value),c&&d.push(e[n+m])):(y.push(e[n+m]),s.push(b.value)))}return Promise.resolve(s.length>0&&u.mutate({trans:r,type:"add",values:s}).then((function(e){for(var t in e.failures)y.splice(parseInt(t),1);v(s.length,e)}))).then((function(e){return p.length>0&&u.mutate({trans:r,type:"put",keys:d,values:p}).then((function(e){return v(p.length,e)}))})).then((function(){return y.length>0&&u.mutate({trans:r,type:"delete",keys:y}).then((function(e){return v(y.length,e)}))})).then((function(){return e.length>n+i&&t(n+f)}))}))};return t(0).then((function(){if(p.length>0)throw new Rt("Error modifying one or more objects",p,d,y);return e.length}))}))}))},e.prototype.delete=function(){var e=this._ctx,t=e.range;return mr(e)&&(e.isPrimKey&&!ar||3===t.type)?this._write((function(n){var r=e.table.core.schema.primaryKey,o=t;return e.table.core.count({trans:n,query:{index:r,range:o}}).then((function(t){return e.table.core.mutate({trans:n,type:"deleteRange",range:o}).then((function(e){var n=e.failures,r=(e.lastResult,e.results,e.numFailures);if(r)throw new Rt("Could not delete some values",Object.keys(n).map((function(e){return n[e]})),t-r);return t-r}))}))})):this.modify((function(e,t){return t.value=null}))},e}();function Or(e,t){return e<t?-1:e===t?0:1}function Pr(e,t){return e>t?-1:e===t?0:1}function Sr(e,t,n){var r=e instanceof Kr?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function jr(e){return new e.Collection(e,(function(){return Tr("")})).limit(0)}function Rr(e,t,n,r,o,i){for(var a=Math.min(e.length,r.length),u=-1,s=0;s<a;++s){var c=t[s];if(c!==r[s])return o(e[s],n[s])<0?e.substr(0,s)+n[s]+n.substr(s+1):o(e[s],r[s])<0?e.substr(0,s)+r[s]+n.substr(s+1):u>=0?e.substr(0,u)+t[u]+n.substr(u+1):null;o(e[s],c)<0&&(u=s)}return a<r.length&&"next"===i?e+n.substr(e.length):a<e.length&&"prev"===i?e.substr(0,n.length):u<0?null:e.substr(0,u)+r[u]+n.substr(u+1)}function Cr(e,t,n,r){var o,i,a,u,s,c,l,f=n.length;if(!n.every((function(e){return"string"==typeof e})))return Sr(e,nr);function h(e){o=function(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}(e),i=function(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}(e),a="next"===e?Or:Pr;var t=n.map((function(e){return{lower:i(e),upper:o(e)}})).sort((function(e,t){return a(e.lower,t.lower)}));u=t.map((function(e){return e.upper})),s=t.map((function(e){return e.lower})),c=e,l="next"===e?"":r}h("next");var p=new e.Collection(e,(function(){return Ar(u[0],s[f-1]+r)}));p._ondirectionchange=function(e){h(e)};var d=0;return p._addAlgorithm((function(e,n,r){var o=e.key;if("string"!=typeof o)return!1;var h=i(o);if(t(h,s,d))return!0;for(var p=null,y=d;y<f;++y){var v=Rr(o,h,u[y],s[y],a,c);null===v&&null===p?d=y+1:(null===p||a(p,v)>0)&&(p=v)}return n(null!==p?function(){e.continue(p+l)}:r),!1})),p}function Ar(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Tr(e){return{type:1,lower:e,upper:e}}var Kr=function(){function e(){}return Object.defineProperty(e.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!0,configurable:!0}),e.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?jr(this):new this.Collection(this,(function(){return Ar(e,t,!n,!r)}))}catch(e){return Sr(this,tr)}},e.prototype.equals=function(e){return null==e?Sr(this,tr):new this.Collection(this,(function(){return Tr(e)}))},e.prototype.above=function(e){return null==e?Sr(this,tr):new this.Collection(this,(function(){return Ar(e,void 0,!0)}))},e.prototype.aboveOrEqual=function(e){return null==e?Sr(this,tr):new this.Collection(this,(function(){return Ar(e,void 0,!1)}))},e.prototype.below=function(e){return null==e?Sr(this,tr):new this.Collection(this,(function(){return Ar(void 0,e,!1,!0)}))},e.prototype.belowOrEqual=function(e){return null==e?Sr(this,tr):new this.Collection(this,(function(){return Ar(void 0,e)}))},e.prototype.startsWith=function(e){return"string"!=typeof e?Sr(this,nr):this.between(e,e+Zn,!0,!0)},e.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):Cr(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],Zn)},e.prototype.equalsIgnoreCase=function(e){return Cr(this,(function(e,t){return e===t[0]}),[e],"")},e.prototype.anyOfIgnoreCase=function(){var e=vt.apply(yt,arguments);return 0===e.length?jr(this):Cr(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},e.prototype.startsWithAnyOfIgnoreCase=function(){var e=vt.apply(yt,arguments);return 0===e.length?jr(this):Cr(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,Zn)},e.prototype.anyOf=function(){var e=this,t=vt.apply(yt,arguments),n=this._cmp;try{t.sort(n)}catch(e){return Sr(this,tr)}if(0===t.length)return jr(this);var r=new this.Collection(this,(function(){return Ar(t[0],t[t.length-1])}));r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var o=0;return r._addAlgorithm((function(e,r,i){for(var a=e.key;n(a,t[o])>0;)if(++o===t.length)return r(i),!1;return 0===n(a,t[o])||(r((function(){e.continue(t[o])})),!1)})),r},e.prototype.notEqual=function(e){return this.inAnyRange([[er,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},e.prototype.noneOf=function(){var e=vt.apply(yt,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Sr(this,tr)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[er,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},e.prototype.inAnyRange=function(e,t){var n=this,r=this._cmp,o=this._ascending,i=this._descending,a=this._min,u=this._max;if(0===e.length)return jr(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&o(e[0],e[1])<=0})))return Sr(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Kt.InvalidArgument);var s,c=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,f=o;function h(e,t){return f(e[0],t[0])}try{(s=e.reduce((function(e,t){for(var n=0,o=e.length;n<o;++n){var i=e[n];if(r(t[0],i[1])<0&&r(t[1],i[0])>0){i[0]=a(i[0],t[0]),i[1]=u(i[1],t[1]);break}}return n===o&&e.push(t),e}),[])).sort(h)}catch(e){return Sr(this,tr)}var p=0,d=l?function(e){return o(e,s[p][1])>0}:function(e){return o(e,s[p][1])>=0},y=c?function(e){return i(e,s[p][0])>0}:function(e){return i(e,s[p][0])>=0},v=d,m=new this.Collection(this,(function(){return Ar(s[0][0],s[s.length-1][1],!c,!l)}));return m._ondirectionchange=function(e){"next"===e?(v=d,f=o):(v=y,f=i),s.sort(h)},m._addAlgorithm((function(e,t,r){for(var i=e.key;v(i);)if(++p===s.length)return t(r),!1;return!!function(e){return!d(e)&&!y(e)}(i)||(0===n._cmp(i,s[p][1])||0===n._cmp(i,s[p][0])||t((function(){f===o?e.continue(s[p][0]):e.continue(s[p][1])})),!1)})),m},e.prototype.startsWithAnyOf=function(){var e=vt.apply(yt,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?jr(this):this.inAnyRange(e.map((function(e){return[e,e+Zn]}))):Sr(this,"startsWithAnyOf() only works with strings")},e}();function qr(e){return 1===e.length?e[0]:e}function Dr(e){try{return e.only([[]]),[[]]}catch(e){return Zn}}function Ir(e){return Rn((function(t){return Br(t),e(t.target.error),!1}))}function Br(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var Fr=function(){function e(){}return e.prototype._lock=function(){return Qe(!ln.global),++this._reculock,1!==this._reculock||ln.global||(ln.lockOwnerFor=this),this},e.prototype._unlock=function(){if(Qe(!ln.global),0==--this._reculock)for(ln.global||(ln.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{zn(e[1],e[0])}catch(e){}}return this},e.prototype._locked=function(){return this._reculock&&ln.lockOwnerFor!==this},e.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(Qe(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new Kt.DatabaseClosed(r);case"MissingAPIError":throw new Kt.MissingAPI(r.message,r);default:throw new Kt.OpenFailed(r)}if(!this.active)throw new Kt.TransactionInactive;return Qe(null===this._completion._state),(e=this.idbtrans=e||n.transaction(qr(this.storeNames),this.mode)).onerror=Rn((function(n){Br(n),t._reject(e.error)})),e.onabort=Rn((function(n){Br(n),t.active&&t._reject(new Kt.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=Rn((function(){t.active=!1,t._resolve()})),this},e.prototype._promise=function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return Qn(new Kt.ReadOnly("Transaction is readonly"));if(!this.active)return Qn(new Kt.TransactionInactive);if(this._locked())return new dn((function(o,i){r._blockedFuncs.push([function(){r._promise(e,t,n).then(o,i)},ln])}));if(n)return In((function(){var e=new dn((function(e,n){r._lock();var o=t(e,n,r);o&&o.then&&o.then(e,n)}));return e.finally((function(){return r._unlock()})),e._lib=!0,e}));var o=new dn((function(e,n){var o=t(e,n,r);o&&o.then&&o.then(e,n)}));return o._lib=!0,o},e.prototype._root=function(){return this.parent?this.parent._root():this},e.prototype.waitFor=function(e){var t=this._root(),n=dn.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((function(){return n}));else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var o=t._waitingFor;return new dn((function(e,r){n.then((function(n){return t._waitingQueue.push(Rn(e.bind(null,n)))}),(function(e){return t._waitingQueue.push(Rn(r.bind(null,e)))})).finally((function(){t._waitingFor===o&&(t._waitingFor=null)}))}))},e.prototype.abort=function(){this.active&&this._reject(new Kt.Abort),this.active=!1},e.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(Ne(t,e))return t[e];var n=this.schema[e];if(!n)throw new Kt.NotFound("Table "+e+" not part of transaction");var r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r},e}();function Mr(e,t,n,r,o,i,a){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:i,src:(n&&!a?"&":"")+(r?"*":"")+(o?"++":"")+Nr(t)}}function Nr(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Ur(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:Je(n,(function(e){return[e.name,e]}))}}function Lr(e){return null==e?function(){}:"string"==typeof e?function(e){return 1===e.split(".").length?function(t){return t[e]}:function(t){return Ze(t,e)}}(e):function(t){return Ze(t,e)}}function Wr(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}function zr(e){return[].slice.call(e)}var Hr=0;function Gr(e){return null==e?":id":"string"==typeof e?e:"["+e.join("+")+"]"}function Vr(e,t,n,r){var o=t.cmp.bind(t);function i(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var t=e.lower,r=e.upper,o=e.lowerOpen,i=e.upperOpen;return void 0===t?void 0===r?null:n.upperBound(r,!!i):void 0===r?n.lowerBound(t,!!o):n.bound(t,r,!!o,!!i)}var a=function(e,t){var n=zr(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((function(e){return t.objectStore(e)})).map((function(e){var t=e.keyPath,n=e.autoIncrement,r=De(t),o=null==t,i={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:Lr(t)},indexes:zr(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,n=e.unique,r=e.multiEntry,o=e.keyPath,a={name:t,compound:De(o),keyPath:o,unique:n,multiEntry:r,extractKey:Lr(o)};return i[Gr(o)]=a,a})),getIndexByKeyPath:function(e){return i[Gr(e)]}};return i[":id"]=a.primaryKey,null!=t&&(i[Gr(t)]=a.primaryKey),a}))},hasGetAll:n.length>0&&"getAll"in t.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,r),u=a.schema,s=a.hasGetAll,c=u.tables.map((function(e){return function(e){var t=e.name;return{name:t,schema:e,mutate:function(n){var r=n.trans,o=n.type,a=n.keys,u=n.values,s=n.range,c=n.wantResults;return new Promise((function(n,l){n=Rn(n);var f=r.objectStore(t),h=null==f.keyPath,p="put"===o||"add"===o;if(!p&&"delete"!==o&&"deleteRange"!==o)throw new Error("Invalid operation type: "+o);var d=(a||u||{length:1}).length;if(a&&u&&a.length!==u.length)throw new Error("Given keys array must have same length as given values array.");if(0===d)return n({numFailures:0,failures:{},results:[],lastResult:void 0});var y,v=c&&Ke(a||Wr(e.primaryKey,{type:o,keys:a,values:u})),m=[],g=0,b=function(e){++g,Br(e),v&&(v[e.target._reqno]=void 0),m[e.target._reqno]=e.target.error},w=function(e){var t=e.target;v[t._reqno]=t.result};if("deleteRange"===o){if(4===s.type)return n({numFailures:g,failures:m,results:v,lastResult:void 0});y=3===s.type?f.clear():f.delete(i(s))}else{var _=p?h?[u,a]:[u,null]:[a,null],k=_[0],x=_[1];if(p)for(var E=0;E<d;++E)(y=x&&void 0!==x[E]?f[o](k[E],x[E]):f[o](k[E]))._reqno=E,v&&void 0===v[E]&&(y.onsuccess=w),y.onerror=b;else for(E=0;E<d;++E)(y=f[o](k[E]))._reqno=E,y.onerror=b}var O=function(e){var t=e.target.result;v&&(v[d-1]=t),n({numFailures:g,failures:m,results:v,lastResult:t})};y.onerror=function(e){b(e),O(e)},y.onsuccess=O}))},getMany:function(e){var n=e.trans,r=e.keys;return new Promise((function(e,o){e=Rn(e);for(var i,a=n.objectStore(t),u=r.length,s=new Array(u),c=0,l=0,f=function(t){var n=t.target;s[n._pos]=n.result,++l===c&&e(s)},h=Ir(o),p=0;p<u;++p)null!=r[p]&&((i=a.get(r[p]))._pos=p,i.onsuccess=f,i.onerror=h,++c);0===c&&e(s)}))},get:function(e){var n=e.trans,r=e.key;return new Promise((function(e,o){e=Rn(e);var i=n.objectStore(t).get(r);i.onsuccess=function(t){return e(t.target.result)},i.onerror=Ir(o)}))},query:function(e){return function(n){return new Promise((function(r,o){r=Rn(r);var a=n.trans,u=n.values,s=n.limit,c=n.query,l=s===1/0?void 0:s,f=c.index,h=c.range,p=a.objectStore(t),d=f.isPrimaryKey?p:p.index(f.name),y=i(h);if(0===s)return r({result:[]});if(e){var v=u?d.getAll(y,l):d.getAllKeys(y,l);v.onsuccess=function(e){return r({result:e.target.result})},v.onerror=Ir(o)}else{var m=0,g=u||!("openKeyCursor"in d)?d.openCursor(y):d.openKeyCursor(y),b=[];g.onsuccess=function(e){var t=g.result;return t?(b.push(u?t.value:t.primaryKey),++m===s?r({result:b}):void t.continue()):r({result:b})},g.onerror=Ir(o)}}))}}(s),openCursor:function(e){var n=e.trans,r=e.values,o=e.query,a=e.reverse,u=e.unique;return new Promise((function(e,s){e=Rn(e);var c=o.index,l=o.range,f=n.objectStore(t),h=c.isPrimaryKey?f:f.index(c.name),p=a?u?"prevunique":"prev":u?"nextunique":"next",d=r||!("openKeyCursor"in h)?h.openCursor(i(l),p):h.openKeyCursor(i(l),p);d.onerror=Ir(s),d.onsuccess=Rn((function(t){var r=d.result;if(r){r.___id=++Hr,r.done=!1;var o=r.continue.bind(r),i=r.continuePrimaryKey;i&&(i=i.bind(r));var a=r.advance.bind(r),u=function(){throw new Error("Cursor not stopped")};r.trans=n,r.stop=r.continue=r.continuePrimaryKey=r.advance=function(){throw new Error("Cursor not started")},r.fail=Rn(s),r.next=function(){var e=this,t=1;return this.start((function(){return t--?e.continue():e.stop()})).then((function(){return e}))},r.start=function(e){var t=new Promise((function(e,t){e=Rn(e),d.onerror=Ir(t),r.fail=t,r.stop=function(t){r.stop=r.continue=r.continuePrimaryKey=r.advance=u,e(t)}})),n=function(){if(d.result)try{e()}catch(e){r.fail(e)}else r.done=!0,r.start=function(){throw new Error("Cursor behind last entry")},r.stop()};return d.onsuccess=Rn((function(e){d.onsuccess=n,n()})),r.continue=o,r.continuePrimaryKey=i,r.advance=a,n(),t},e(r)}else e(null)}),s)}))},count:function(e){var n=e.query,r=e.trans,o=n.index,a=n.range;return new Promise((function(e,n){var u=r.objectStore(t),s=o.isPrimaryKey?u:u.index(o.name),c=i(a),l=c?s.count(c):s.count();l.onsuccess=Rn((function(t){return e(t.target.result)})),l.onerror=Ir(n)}))}}}(e)})),l={};return c.forEach((function(e){return l[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!l[e])throw new Error("Table '"+e+"' not found");return l[e]},cmp:o,MIN_KEY:-1/0,MAX_KEY:Dr(n),schema:u}}function $r(e,t){var n=t.db,r=function(e,t,n,r){var o=n.IDBKeyRange;return{dbcore:function(e,t){return t.reduce((function(e,t){var n=t.create;return Te(Te({},e),n(e))}),e)}(Vr(t,n.indexedDB,o,r),e.dbcore)}}(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach((function(t){var n=t.name;e.core.schema.tables.some((function(e){return e.name===n}))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function Yr(e,t,n,r){n.forEach((function(n){var o=r[n];t.forEach((function(t){var r=Ge(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?We(t,n,{get:function(){return this.table(n)},set:function(e){Le(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,o))}))}))}function Qr(e,t){t.forEach((function(t){for(var n in t)t[n]instanceof e.Table&&delete t[n]}))}function Xr(e,t){return e._cfg.version-t._cfg.version}function Jr(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var o=e[n],i=t[n];if(o){var a={name:n,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto&&!or)a.recreate=!0,r.change.push(a);else{var u=o.idxByName,s=i.idxByName,c=void 0;for(c in u)s[c]||a.del.push(c);for(c in s){var l=u[c],f=s[c];l?l.src!==f.src&&a.change.push(f):a.add.push(f)}(a.del.length>0||a.add.length>0||a.change.length>0)&&r.change.push(a)}}else r.add.push([n,i])}return r}function Zr(e,t,n,r){var o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(e){return eo(o,e)})),o}function eo(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function to(e,t,n){var r={};return $e(t.objectStoreNames,0).forEach((function(e){for(var t=n.objectStore(e),o=t.keyPath,i=Mr(Nr(o),o||"",!1,!1,!!t.autoIncrement,o&&"string"!=typeof o,!0),a=[],u=0;u<t.indexNames.length;++u){var s=t.index(t.indexNames[u]);o=s.keyPath;var c=Mr(s.name,o,!!s.unique,!!s.multiEntry,!1,o&&"string"!=typeof o,!1);a.push(c)}r[e]=Ur(e,i,a)})),r}function no(e,t,n){for(var r=n.db.objectStoreNames,o=0;o<r.length;++o){var i=r[o],a=n.objectStore(i);e._hasGetAll="getAll"in a;for(var u=0;u<a.indexNames.length;++u){var s=a.indexNames[u],c=a.index(s).keyPath,l="string"==typeof c?c:"["+$e(c).join("+")+"]";if(t[i]){var f=t[i].idxByName[l];f&&(f.name=s,delete t[i].idxByName[l],t[i].idxByName[s]=f)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&Ie.WorkerGlobalScope&&Ie instanceof Ie.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}var ro,oo=function(){function e(){}return e.prototype._parseStoresSpec=function(e,t){qe(e).forEach((function(n){if(null!==e[n]){var r=e[n].split(",").map((function(e,t){var n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return Mr(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),De(r),0===t)})),o=r.shift();if(o.multi)throw new Kt.Schema("Primary key cannot be multi-valued");r.forEach((function(e){if(e.auto)throw new Kt.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Kt.Schema("Index must have a name and cannot be an empty string")})),t[n]=Ur(n,o,r)}}))},e.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?Be(this._cfg.storesSource,e):e;var n=t._versions,r={},o={};return n.forEach((function(e){Be(r,e._cfg.storesSource),o=e._cfg.dbschema={},e._parseStoresSpec(r,o)})),t._dbSchema=o,Qr(t,[t._allTables,t,t.Transaction.prototype]),Yr(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],qe(o),o),t._storeNames=qe(o),this},e.prototype.upgrade=function(e){return this._cfg.contentUpgrade=e,this},e}();function io(e){return In((function(){return ln.letThrough=!0,e()}))}function ao(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((function(){return t.dbOpenError?Qn(t.dbOpenError):e}));gt&&(t.openCanceller._stackHolder=kt()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.dbReadyResolve,o=null;return dn.race([t.openCanceller,new dn((function(r,i){if(!n)throw new Kt.MissingAPI("indexedDB API not found. If using IE10+, make sure to run your code on a server URL (not locally). If using old Safari versions, make sure to include indexedDB polyfill.");var a=e.name,u=t.autoSchema?n.open(a):n.open(a,Math.round(10*e.verno));if(!u)throw new Kt.MissingAPI("IndexedDB API not available");u.onerror=Ir(i),u.onblocked=Rn(e._fireOnBlocked),u.onupgradeneeded=Rn((function(r){if(o=u.transaction,t.autoSchema&&!e._options.allowEmptyDB){u.onerror=Br,o.abort(),u.result.close();var s=n.deleteDatabase(a);s.onsuccess=s.onerror=Rn((function(){i(new Kt.NoSuchDatabase("Database "+a+" doesnt exist"))}))}else{o.onerror=Ir(i);var c=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;e.idbdb=u.result,function(e,t,n,r){var o=e._dbSchema,i=e._createTransaction("readwrite",e._storeNames,o);i.create(n),i._completion.catch(r);var a=i._reject.bind(i),u=ln.transless||ln;In((function(){ln.trans=i,ln.transless=u,0===t?(qe(o).forEach((function(e){Zr(n,e,o[e].primKey,o[e].indexes)})),$r(e,n),dn.follow((function(){return e.on.populate.fire(i)})).catch(a)):function(e,t,n,r){var o=[],i=e._versions,a=e._dbSchema=to(0,e.idbdb,r),u=!1;return i.filter((function(e){return e._cfg.version>=t})).forEach((function(i){o.push((function(){var o=a,s=i._cfg.dbschema;no(e,o,r),no(e,s,r),a=e._dbSchema=s;var c=Jr(o,s);c.add.forEach((function(e){Zr(r,e[0],e[1].primKey,e[1].indexes)})),c.change.forEach((function(e){if(e.recreate)throw new Kt.Upgrade("Not yet support for changing primary key");var t=r.objectStore(e.name);e.add.forEach((function(e){return eo(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),eo(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var l=i._cfg.contentUpgrade;if(l&&i._cfg.version>t){$r(e,r),n._memoizedTables={},u=!0;var f=nt(s);c.del.forEach((function(e){f[e]=o[e]})),Qr(e,[e.Transaction.prototype]),Yr(e,[e.Transaction.prototype],qe(f),f),n.schema=f;var h,p=mt(l);p&&Bn();var d=dn.follow((function(){if((h=l(n))&&p){var e=Fn.bind(null,null);h.then(e,e)}}));return h&&"function"==typeof h.then?dn.resolve(h):d.then((function(){return h}))}})),o.push((function(t){u&&ir||function(e,t){for(var n=0;n<t.db.objectStoreNames.length;++n){var r=t.db.objectStoreNames[n];null==e[r]&&t.db.deleteObjectStore(r)}}(i._cfg.dbschema,t),Qr(e,[e.Transaction.prototype]),Yr(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}))})),function e(){return o.length?dn.resolve(o.shift()(n.idbtrans)).then(e):dn.resolve()}().then((function(){var e,t;t=r,qe(e=a).forEach((function(n){t.db.objectStoreNames.contains(n)||Zr(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,i,n).catch(a)}))}(e,c/10,o,i)}}),i),u.onsuccess=Rn((function(){o=null;var n=e.idbdb=u.result,i=$e(n.objectStoreNames);if(i.length>0)try{var s=n.transaction(qr(i),"readonly");t.autoSchema?function(e,t,n){e.verno=t.version/10;var r=e._dbSchema=to(0,t,n);e._storeNames=$e(t.objectStoreNames,0),Yr(e,[e._allTables],qe(r),r)}(e,n,s):(no(e,e._dbSchema,s),function(e,t){var n=Jr(to(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some((function(e){return e.add.length||e.change.length})))}(e,s)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),$r(e,s)}catch(e){}rr.push(e),n.onversionchange=Rn((function(n){t.vcFired=!0,e.on("versionchange").fire(n)})),ro.add(a),r()}),i)}))]).then((function(){return t.onReadyBeingFired=[],dn.resolve(io(e.on.ready.fire)).then((function e(){if(t.onReadyBeingFired.length>0){var n=t.onReadyBeingFired.reduce(zt,It);return t.onReadyBeingFired=[],dn.resolve(io(n)).then(e)}}))})).finally((function(){t.onReadyBeingFired=null})).then((function(){return t.isBeingOpened=!1,e})).catch((function(n){try{o&&o.abort()}catch(e){}return t.isBeingOpened=!1,e.close(),t.dbOpenError=n,Qn(t.dbOpenError)})).finally((function(){t.openComplete=!0,r()}))}function uo(e){var t=function(t){return e.next(t)},n=o(t),r=o((function(t){return e.throw(t)}));function o(e){return function(t){var o=e(t),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):De(i)?Promise.all(i).then(n,r):n(i)}}return o(t)()}function so(e,t,n){var r=arguments.length;if(r<2)throw new Kt.InvalidArgument("Too few arguments");for(var o=new Array(r-1);--r;)o[r-1]=arguments[r];n=o.pop();var i=ot(o);return[e,i,n]}function co(e,t,n,r,o){return dn.resolve().then((function(){var i=ln.transless||ln,a=e._createTransaction(t,n,e._dbSchema,r),u={trans:a,transless:i};r?a.idbtrans=r.idbtrans:a.create();var s,c=mt(o);c&&Bn();var l=dn.follow((function(){if(s=o.call(a,a))if(c){var e=Fn.bind(null,null);s.then(e,e)}else"function"==typeof s.next&&"function"==typeof s.throw&&(s=uo(s))}),u);return(s&&"function"==typeof s.then?dn.resolve(s).then((function(e){return a.active?e:Qn(new Kt.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):l.then((function(){return s}))).then((function(e){return r&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),Qn(e)}))}))}function lo(e,t,n){for(var r=De(e)?e.slice():[e],o=0;o<n;++o)r.push(t);return r}var fo={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return Te(Te({},e),{table:function(t){var n=e.table(t),r=n.schema,o={},i=[];function a(e,t,n){var r=Gr(e),u=o[r]=o[r]||[],s=null==e?0:"string"==typeof e?1:e.length,c=t>0,l=Te(Te({},n),{isVirtual:c,isPrimaryKey:!c&&n.isPrimaryKey,keyTail:t,keyLength:s,extractKey:Lr(e),unique:!c&&n.unique});return u.push(l),l.isPrimaryKey||i.push(l),s>1&&a(2===s?e[0]:e.slice(0,s-1),t+1,n),u.sort((function(e,t){return e.keyTail-t.keyTail})),l}var u=a(r.primaryKey.keyPath,0,r.primaryKey);o[":id"]=[u];for(var s=0,c=r.indexes;s<c.length;s++){var l=c[s];a(l.keyPath,0,l)}function f(t){var n,r,o=t.query.index;return o.isVirtual?Te(Te({},t),{query:{index:o,range:(n=t.query.range,r=o.keyTail,{type:1===n.type?2:n.type,lower:lo(n.lower,n.lowerOpen?e.MAX_KEY:e.MIN_KEY,r),lowerOpen:!0,upper:lo(n.upper,n.upperOpen?e.MIN_KEY:e.MAX_KEY,r),upperOpen:!0})}}):t}return Te(Te({},n),{schema:Te(Te({},r),{primaryKey:u,indexes:i,getIndexByKeyPath:function(e){var t=o[Gr(e)];return t&&t[0]}}),count:function(e){return n.count(f(e))},query:function(e){return n.query(f(e))},openCursor:function(t){var r=t.query.index,o=r.keyTail,i=r.isVirtual,a=r.keyLength;return i?n.openCursor(f(t)).then((function(n){return n&&function(n){return Object.create(n,{continue:{value:function(r){null!=r?n.continue(lo(r,t.reverse?e.MAX_KEY:e.MIN_KEY,o)):t.unique?n.continue(lo(n.key,t.reverse?e.MIN_KEY:e.MAX_KEY,o)):n.continue()}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(lo(t,e.MAX_KEY,o),r)}},key:{get:function(){var e=n.key;return 1===a?e[0]:e.slice(0,a)}},value:{get:function(){return n.value}}})}(n)})):n.openCursor(t)}})}})}},ho={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return Te(Te({},e),{table:function(t){var n=e.table(t),r=n.schema.primaryKey;return Te(Te({},n),{mutate:function(e){var o=ln.trans,i=o.table(t).hook,a=i.deleting,u=i.creating,s=i.updating;switch(e.type){case"add":if(u.fire===It)break;return o._promise("readwrite",(function(){return c(e)}),!0);case"put":if(u.fire===It&&s.fire===It)break;return o._promise("readwrite",(function(){return c(e)}),!0);case"delete":if(a.fire===It)break;return o._promise("readwrite",(function(){return c(e)}),!0);case"deleteRange":if(a.fire===It)break;return o._promise("readwrite",(function(){return function(e){return l(e.trans,e.range,1e4)}(e)}),!0)}return n.mutate(e);function c(e){var t=ln.trans,o=e.keys||Wr(r,e);if(!o)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?Te(Te({},e),{keys:o,wantResults:!0}):Te({},e)).type&&(e.values=Ke(e.values)),e.keys&&(e.keys=Ke(e.keys)),function(e,t,n){return"add"===t.type?Promise.resolve(new Array(t.values.length)):e.getMany({trans:t.trans,keys:n})}(n,e,o).then((function(i){var c=o.map((function(n,o){var c=i[o],l={onerror:null,onsuccess:null};if("delete"===e.type)a.fire.call(l,n,c,t);else if("add"===e.type||void 0===c){var f=u.fire.call(l,n,e.values[o],t);null==n&&null!=f&&(n=f,e.keys[o]=n,r.outbound||et(e.values[o],r.keyPath,n))}else{var h=ht(c,e.values[o]),p=s.fire.call(l,h,n,c,t);if(p){var d=e.values[o];Object.keys(p).forEach((function(e){Ne(d,e)?d[e]=p[e]:et(d,e,p[e])}))}}return l}));return n.mutate(e).then((function(t){for(var n=t.failures,r=t.results,a=t.numFailures,u=t.lastResult,s=0;s<o.length;++s){var l=r?r[s]:o[s],f=c[s];null==l?f.onerror&&f.onerror(n[s]):f.onsuccess&&f.onsuccess("put"===e.type&&i[s]?e.values[s]:l)}return{failures:n,results:r,numFailures:a,lastResult:u}})).catch((function(e){return c.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))}function l(e,t,o){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:o}).then((function(n){var r=n.result;return c({type:"delete",keys:r,trans:e}).then((function(n){return n.numFailures>0?Promise.reject(n.failures[0]):r.length<o?{failures:[],numFailures:0,lastResult:void 0}:l(e,Te(Te({},t),{lower:r[r.length-1],lowerOpen:!0}),o)}))}))}}})}})}},po=function(){function e(t,n){var r=this;this._middlewares={},this.verno=0;var o=e.dependencies;this._options=n=Te({addons:e.addons,autoOpen:!0,indexedDB:o.indexedDB,IDBKeyRange:o.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};var i=n.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null;var a,u={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:It,dbReadyPromise:null,cancelOpen:It,openCanceller:null,autoSchema:!0};u.dbReadyPromise=new dn((function(e){u.dbReadyResolve=e})),u.openCanceller=new dn((function(e,t){u.cancelOpen=t})),this._state=u,this.name=t,this.on=yr(this,"populate","blocked","versionchange",{ready:[zt,It]}),this.on.ready.subscribe=Ye(this.on.ready.subscribe,(function(t){return function(n,o){e.vip((function(){var e=r._state;if(e.openComplete)e.dbOpenError||dn.resolve().then(n),o&&t(n);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(n),o&&t(n);else{t(n);var i=r;o||t((function e(){i.on.ready.unsubscribe(n),i.on.ready.unsubscribe(e)}))}}))}})),this.Collection=(a=this,vr(Er.prototype,(function(e,t){this.db=a;var n=hr,r=null;if(t)try{n=t()}catch(e){r=e}var o=e._ctx,i=o.table,u=i.hook.reading.fire;this._ctx={table:i,index:o.index,isPrimKey:!o.index||i.schema.primKey.keyPath&&o.index===i.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:o.or,valueMapper:u!==Bt?u:null}}))),this.Table=function(e){return vr(dr.prototype,(function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:yr(null,{creating:[Nt,It],reading:[Ft,Bt],updating:[Lt,It],deleting:[Ut,It]})}))}(this),this.Transaction=function(e){return vr(Fr.prototype,(function(t,n,r,o){var i=this;this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.idbtrans=null,this.on=yr(this,"complete","error","abort"),this.parent=o||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new dn((function(e,t){i._resolve=e,i._reject=t})),this._completion.then((function(){i.active=!1,i.on.complete.fire()}),(function(e){var t=i.active;return i.active=!1,i.on.error.fire(e),i.parent?i.parent._reject(e):t&&i.idbtrans&&i.idbtrans.abort(),Qn(e)}))}))}(this),this.Version=function(e){return vr(oo.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return vr(Kr.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};var o=e._deps.indexedDB;if(!o)throw new Kt.MissingAPI("indexedDB API missing");this._cmp=this._ascending=o.cmp.bind(o),this._descending=function(e,t){return o.cmp(t,e)},this._max=function(e,t){return o.cmp(e,t)>0?e:t},this._min=function(e,t){return o.cmp(e,t)<0?e:t},this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database '"+r.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+r.name+"'. Closing db now to resume the delete request."),r.close()})),this.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('"+r.name+"') was blocked"):console.warn("Upgrade '"+r.name+"' blocked by other connection holding version "+e.oldVersion/10)})),this._maxKey=Dr(n.IDBKeyRange),this._createTransaction=function(e,t,n,o){return new r.Transaction(e,t,n,o)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),rr.filter((function(e){return e.name===r.name&&e!==r&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(fo),this.use(ho),i.forEach((function(e){return e(r)}))}return e.prototype.version=function(e){if(isNaN(e)||e<.1)throw new Kt.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Kt.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter((function(t){return t._cfg.version===e}))[0];return n||(n=new this.Version(e),t.push(n),t.sort(Xr),n.stores({}),this._state.autoSchema=!1,n)},e.prototype._whenReady=function(e){var t=this;return this._state.openComplete||ln.letThrough?e():new dn((function(e,n){if(!t._state.isBeingOpened){if(!t._options.autoOpen)return void n(new Kt.DatabaseClosed);t.open().catch(It)}t._state.dbReadyPromise.then(e,n)})).then(e)},e.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,o=e.name;o&&this.unuse({stack:t,name:o});var i=this._middlewares[t]||(this._middlewares[t]=[]);return i.push({stack:t,create:n,level:null==r?10:r,name:o}),i.sort((function(e,t){return e.level-t.level})),this},e.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((function(e){return r?e.create!==r:!!n&&e.name!==n}))),this},e.prototype.open=function(){return ao(this)},e.prototype.close=function(){var e=rr.indexOf(this),t=this._state;if(e>=0&&rr.splice(e,1),this.idbdb){try{this.idbdb.close()}catch(e){}this.idbdb=null}this._options.autoOpen=!1,t.dbOpenError=new Kt.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError),t.dbReadyPromise=new dn((function(e){t.dbReadyResolve=e})),t.openCanceller=new dn((function(e,n){t.cancelOpen=n}))},e.prototype.delete=function(){var e=this,t=arguments.length>0,n=this._state;return new dn((function(r,o){var i=function(){e.close();var t=e._deps.indexedDB.deleteDatabase(e.name);t.onsuccess=Rn((function(){ro.remove(e.name),r()})),t.onerror=Ir(o),t.onblocked=e._fireOnBlocked};if(t)throw new Kt.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(i):i()}))},e.prototype.backendDB=function(){return this.idbdb},e.prototype.isOpen=function(){return null!==this.idbdb},e.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},e.prototype.hasFailed=function(){return null!==this._state.dbOpenError},e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(e.prototype,"tables",{get:function(){var e=this;return qe(this._allTables).map((function(t){return e._allTables[t]}))},enumerable:!0,configurable:!0}),e.prototype.transaction=function(){var e=so.apply(this,arguments);return this._transaction.apply(this,e)},e.prototype._transaction=function(e,t,n){var r=this,o=ln.trans;o&&o.db===this&&-1===e.indexOf("!")||(o=null);var i,a,u=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(a=t.map((function(e){var t=e instanceof r.Table?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||e===cr)i=cr;else{if("rw"!=e&&e!=lr)throw new Kt.InvalidArgument("Invalid transaction mode: "+e);i=lr}if(o){if(o.mode===cr&&i===lr){if(!u)throw new Kt.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&a.forEach((function(e){if(o&&-1===o.storeNames.indexOf(e)){if(!u)throw new Kt.SubTransaction("Table "+e+" not included in parent transaction.");o=null}})),u&&o&&!o.active&&(o=null)}}catch(e){return o?o._promise(null,(function(t,n){n(e)})):Qn(e)}var s=co.bind(null,this,i,a,o,n);return o?o._promise(i,s,"lock"):ln.trans?zn(ln.transless,(function(){return r._whenReady(s)})):this._whenReady(s)},e.prototype.table=function(e){if(!Ne(this._allTables,e))throw new Kt.InvalidTable("Table "+e+" does not exist");return this._allTables[e]},e}(),yo=po;Ue(yo,Te(Te({},Dt),{delete:function(e){return new yo(e).delete()},exists:function(e){return new yo(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){return ro?ro.getDatabaseNames().then(e):dn.resolve([])},defineClass:function(){return function(e){Be(this,e)}},ignoreTransaction:function(e){return ln.trans?zn(ln.transless,e):e()},vip:io,async:function(e){return function(){try{var t=uo(e.apply(this,arguments));return t&&"function"==typeof t.then?t:dn.resolve(t)}catch(e){return Qn(e)}}},spawn:function(e,t,n){try{var r=uo(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:dn.resolve(r)}catch(e){return Qn(e)}},currentTransaction:{get:function(){return ln.trans||null}},waitFor:function(e,t){var n=dn.resolve("function"==typeof e?yo.ignoreTransaction(e):e).timeout(t||6e4);return ln.trans?ln.trans.waitFor(n):n},Promise:dn,debug:{get:function(){return gt},set:function(e){bt(e,"dexie"===e?function(){return!0}:ur)}},derive:ze,extend:Be,props:Ue,override:Ye,Events:yr,getByKeyPath:Ze,setByKeyPath:et,delByKeyPath:tt,shallowClone:nt,deepClone:st,getObjectDiff:ht,asap:Xe,minKey:er,addons:[],connections:rr,errnames:At,dependencies:function(){try{return{indexedDB:Ie.indexedDB||Ie.mozIndexedDB||Ie.webkitIndexedDB||Ie.msIndexedDB,IDBKeyRange:Ie.IDBKeyRange||Ie.webkitIDBKeyRange}}catch(e){return{indexedDB:null,IDBKeyRange:null}}}(),semVer:Jn,version:Jn.split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,n){return e+t/Math.pow(10,2*n)})),default:yo,Dexie:yo})),yo.maxKey=Dr(yo.dependencies.IDBKeyRange),function(e){try{ro=function(e){var t,n=e&&"function"==typeof e.databases;if(!n){var r=new po(sr,{addons:[]});r.version(1).stores({dbnames:"name"}),t=r.table("dbnames")}return{getDatabaseNames:function(){return n?dn.resolve(e.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return e!==sr}))})):t.toCollection().primaryKeys()},add:function(e){return!n&&e!==sr&&t.put({name:e}).catch(It)},remove:function(e){return!n&&e!==sr&&t.delete(e).catch(It)}}}(e)}catch(e){}}(po.dependencies.indexedDB),dn.rejectionMapper=function(e,t){if(!e||e instanceof St||e instanceof TypeError||e instanceof SyntaxError||!e.name||!qt[e.name])return e;var n=new qt[e.name](t||e.message,e);return"stack"in e&&We(n,"stack",{get:function(){return this.inner.stack}}),n},bt(gt,ur);var vo,mo=(vo=function(e,t){return(vo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}vo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),go=function(e){function t(){var t=e.call(this,"ServiceWorker")||this;return t.version(1).stores({dynamicRouteRegistrations:"++,&pattern"}),t.dynamicRouteRegistrations=t.table("dynamicRouteRegistrations"),t}return mo(t,e),t}(po),bo=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},wo=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};function _o(e){return bo(this,void 0,void 0,(function(){var t;return wo(this,(function(n){switch(n.label){case 0:return[4,Ce(e)];case 1:return[4,xo(t=n.sent())];case 2:return n.sent(),[4,ko(t)];case 3:return n.sent(),[2]}}))}))}function ko(e){return bo(this,void 0,void 0,(function(){var t,n,r,o,i=this;return wo(this,(function(a){switch(a.label){case 0:return 0===e.length?[2]:[4,caches.open(pe)];case 1:return t=a.sent(),[4,Promise.all(e.map((function(e){return bo(i,void 0,void 0,(function(){return wo(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,R((function(){return t.add(e)}),{onError:function(t,n){return console.debug("Failure attempt "+n+' at caching "'+e+'". Error: ',t)}})];case 1:return n.sent(),[2,{url:e,success:!0}];case 2:return n.sent(),[2,{url:e,success:!1}];case 3:return[2]}}))}))})))];case 2:return n=a.sent(),r=n.filter((function(e){return e.success})),o=n.filter((function(e){return!e.success})),r.length>0&&console.debug("Successfully added "+r.length+" URLs to the OMRS cache. URLs: ",r.map((function(e){return e.url}))),o.length>0&&console.error("Failed to cache "+o.length+" URLs. URLs: ",o.map((function(e){return e.url}))),[2]}}))}))}function xo(e){return bo(this,void 0,void 0,(function(){var t,n,r,o;return wo(this,(function(i){switch(i.label){case 0:return[4,caches.open(pe)];case 1:return[4,(t=i.sent()).keys()];case 2:return n=i.sent().map((function(e){return e.url})),[4,(new go).dynamicRouteRegistrations.toArray()];case 3:return r=i.sent(),o=n.filter((function(t){return!ve.includes(t)&&!e.includes(t)&&!r.some((function(e){return new RegExp(e.pattern).test(t)}))})),console.info("Removing the following expired URLs from the cache: ",o),console.debug("The following URLs were known and not invalidated: ",ve,e,r),[4,Promise.all(o.map((function(e){return t.delete(e)})))];case 4:return i.sent(),[2]}}))}))}var Eo=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},Oo=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Po={onImportMapChanged:function(e){var t=e.importMap;return Eo(this,void 0,void 0,(function(){return Oo(this,(function(e){switch(e.label){case 0:return[4,_o(t)];case 1:return e.sent(),[2]}}))}))},clearDynamicRoutes:function(){return Eo(this,void 0,void 0,(function(){return Oo(this,(function(e){switch(e.label){case 0:return[4,(new go).dynamicRouteRegistrations.clear()];case 1:return e.sent(),[2]}}))}))},registerDynamicRoute:function(e){var t=e.pattern,n=e.url;return Eo(this,void 0,void 0,(function(){var e,r;return Oo(this,(function(o){switch(o.label){case 0:return!(e=t)&&n&&(e="^"+P(n)+"$"),e?(r={pattern:e},[4,(new go).dynamicRouteRegistrations.put(r)]):[3,2];case 1:o.sent(),o.label=2;case 2:return[2]}}))}))}};n(306);const So=["DELETE","GET","HEAD","PATCH","POST","PUT"],jo=e=>e&&"object"==typeof e?e:{handle:e};class Ro{constructor(e,t,n="GET"){this.handler=jo(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=jo(e)}}class Co extends Ro{constructor(e,t,n){super((({url:t})=>{const n=e.exec(t.href);if(n&&(t.origin===location.origin||0===n.index))return n.slice(1)}),t,n)}}class Ao{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&"CACHE_URLS"===e.data.type){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map((t=>{"string"==typeof t&&(t=[t]);const n=new Request(...t);return this.handleRequest({request:n,event:e})})));e.waitUntil(n),e.ports&&e.ports[0]&&n.then((()=>e.ports[0].postMessage(!0)))}}))}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const r=n.origin===location.origin,{params:o,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n});let a=i&&i.handler;const u=e.method;if(!a&&this._defaultHandlerMap.has(u)&&(a=this._defaultHandlerMap.get(u)),!a)return;let s;try{s=a.handle({url:n,request:e,event:t,params:o})}catch(e){s=Promise.reject(e)}const c=i&&i.catchHandler;return s instanceof Promise&&(this._catchHandler||c)&&(s=s.catch((async r=>{if(c)try{return await c.handle({url:n,request:e,event:t,params:o})}catch(e){e instanceof Error&&(r=e)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw r}))),s}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){const o=this._routes.get(n.method)||[];for(const i of o){let o;const a=i.match({url:e,sameOrigin:t,request:n,event:r});if(a)return o=a,(Array.isArray(o)&&0===o.length||a.constructor===Object&&0===Object.keys(a).length||"boolean"==typeof a)&&(o=void 0),{route:i,params:o}}return{}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,jo(e))}setCatchHandler(e){this._catchHandler=jo(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(t){if(!this._routes.has(t.method))throw new e("unregister-route-but-not-found-with-method",{method:t.method});const n=this._routes.get(t.method).indexOf(t);if(!(n>-1))throw new e("unregister-route-route-not-registered");this._routes.get(t.method).splice(n,1)}}let To;const Ko=()=>(To||(To=new Ao,To.addFetchListener(),To.addCacheListener()),To);function qo(e){return"string"==typeof e?new Request(e):e}n(781);class Do{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new a,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(t){const{event:n}=this;let r=qo(t);if("navigate"===r.mode&&n instanceof FetchEvent&&n.preloadResponse){const e=await n.preloadResponse;if(e)return e}const o=this.hasCallback("fetchDidFail")?r.clone():null;try{for(const e of this.iterateCallbacks("requestWillFetch"))r=await e({request:r.clone(),event:n})}catch(t){if(t instanceof Error)throw new e("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const i=r.clone();try{let e;e=await fetch(r,"navigate"===r.mode?void 0:this._strategy.fetchOptions);for(const t of this.iterateCallbacks("fetchDidSucceed"))e=await t({event:n,request:i,response:e});return e}catch(e){throw o&&await this.runCallbacks("fetchDidFail",{error:e,event:n,originalRequest:o.clone(),request:i.clone()}),e}}async fetchAndCachePut(e){const t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){const t=qo(e);let n;const{cacheName:r,matchOptions:o}=this._strategy,i=await this.getCacheKey(t,"read"),a=Object.assign(Object.assign({},o),{cacheName:r});n=await caches.match(i,a);for(const e of this.iterateCallbacks("cachedResponseWillBeUsed"))n=await e({cacheName:r,matchOptions:o,cachedResponse:n,request:i,event:this.event})||void 0;return n}async cachePut(n,r){const o=qo(n);await u(0);const a=await this.getCacheKey(o,"write");if(!r)throw new e("cache-put-with-no-response",{url:(s=a.url,new URL(String(s),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var s;const c=await this._ensureResponseSafeToCache(r);if(!c)return!1;const{cacheName:l,matchOptions:f}=this._strategy,h=await self.caches.open(l),p=this.hasCallback("cacheDidUpdate"),d=p?await async function(e,t,n,r){const o=i(t.url,n);if(t.url===o)return e.match(t,r);const a=Object.assign(Object.assign({},r),{ignoreSearch:!0}),u=await e.keys(t,a);for(const t of u)if(o===i(t.url,n))return e.match(t,r)}(h,a.clone(),["__WB_REVISION__"],f):null;try{await h.put(a,p?c.clone():c)}catch(e){if(e instanceof Error)throw"QuotaExceededError"===e.name&&await async function(){for(const e of t)await e()}(),e}for(const e of this.iterateCallbacks("cacheDidUpdate"))await e({cacheName:l,oldResponse:d,newResponse:c.clone(),request:a,event:this.event});return!0}async getCacheKey(e,t){if(!this._cacheKeys[t]){let n=e;for(const e of this.iterateCallbacks("cacheKeyWillBeUsed"))n=qo(await e({mode:t,request:n,event:this.event,params:this.params}));this._cacheKeys[t]=n}return this._cacheKeys[t]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if("function"==typeof t[e]){const n=this._pluginStateMap.get(t),r=r=>{const o=Object.assign(Object.assign({},r),{state:n});return t[e](o)};yield r}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(const e of this.iterateCallbacks("cacheWillUpdate"))if(t=await e({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&200!==t.status&&(t=void 0),t}}class Io{constructor(e={}){this.cacheName=o(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,n="string"==typeof e.request?new Request(e.request):e.request,r="params"in e?e.params:void 0,o=new Do(this,{event:t,request:n,params:r}),i=this._getResponse(o,n,t);return[i,this._awaitComplete(i,o,n,t)]}async _getResponse(t,n,r){let o;await t.runCallbacks("handlerWillStart",{event:r,request:n});try{if(o=await this._handle(n,t),!o||"error"===o.type)throw new e("no-response",{url:n.url})}catch(e){if(e instanceof Error)for(const i of t.iterateCallbacks("handlerDidError"))if(o=await i({error:e,event:r,request:n}),o)break;if(!o)throw e}for(const e of t.iterateCallbacks("handlerWillRespond"))o=await e({event:r,request:n,response:o});return o}async _awaitComplete(e,t,n,r){let o,i;try{o=await e}catch(i){}try{await t.runCallbacks("handlerDidRespond",{event:r,request:n,response:o}),await t.doneWaiting()}catch(e){e instanceof Error&&(i=e)}if(await t.runCallbacks("handlerDidComplete",{event:r,request:n,response:o,error:i}),t.destroy(),i)throw i}}const Bo={cacheWillUpdate:async({response:e})=>200===e.status||0===e.status?e:null};function Fo(e){return t=this,n=void 0,o=function(){var t,n,r;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(o){switch(o.label){case 0:return[4,self.clients.matchAll({type:"window"})];case 1:for(t=o.sent(),n=0,r=t;n<r.length;n++)r[n].postMessage(e);return[2]}}))},new((r=void 0)||(r=Promise))((function(e,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function u(e){try{s(o.throw(e))}catch(e){i(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,u)}s((o=o.apply(t,n||[])).next())}));var t,n,r,o}function Mo(e){var t;return null!==(t=Uo(e,"x-omrs-offline-response-body"))&&void 0!==t?t:void 0}function No(e){var t,n=+(null!==(t=Uo(e,"x-omrs-offline-response-status"))&&void 0!==t?t:"");return isNaN(n)||n<200||n>599?503:n}function Uo(e,t){return e.get(t)}var Lo,Wo=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},zo=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Ho=new class extends Io{constructor(e={}){super(e),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}async _handle(t,n){let r,o;try{const e=[n.fetch(t)];if(this._networkTimeoutSeconds){const t=u(1e3*this._networkTimeoutSeconds);e.push(t)}if(o=await Promise.race(e),!o)throw new Error(`Timed out the network response after ${this._networkTimeoutSeconds} seconds.`)}catch(e){e instanceof Error&&(r=e)}if(!o)throw new e("no-response",{url:t.url,error:r});return o}},Go=new class extends Io{constructor(e={}){super(e),this.plugins.some((e=>"cacheWillUpdate"in e))||this.plugins.unshift(Bo),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}async _handle(t,n){const r=[],o=[];let i;if(this._networkTimeoutSeconds){const{id:e,promise:a}=this._getTimeoutPromise({request:t,logs:r,handler:n});i=e,o.push(a)}const a=this._getNetworkPromise({timeoutId:i,request:t,logs:r,handler:n});o.push(a);const u=await n.waitUntil((async()=>await n.waitUntil(Promise.race(o))||await a)());if(!u)throw new e("no-response",{url:t.url});return u}_getTimeoutPromise({request:e,logs:t,handler:n}){let r;return{promise:new Promise((t=>{r=setTimeout((async()=>{t(await n.cacheMatch(e))}),1e3*this._networkTimeoutSeconds)})),id:r}}async _getNetworkPromise({timeoutId:e,request:t,logs:n,handler:r}){let o,i;try{i=await r.fetchAndCachePut(t)}catch(e){e instanceof Error&&(o=e)}return e&&clearTimeout(e),!o&&i||(i=await r.cacheMatch(t)),i}}({cacheName:pe});function Vo(e){return Wo(this,void 0,void 0,(function(){var t;return zo(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,5]),[4,Ho.handle(e)];case 1:return[2,n.sent()];case 2:return n.sent(),[4,caches.open(pe)];case 3:return[4,n.sent().match(ye)];case 4:return[2,null!=(t=n.sent())?t:Response.error()];case 5:return[2]}}))}))}function $o(e){return Wo(this,void 0,void 0,(function(){return zo(this,(function(t){switch(t.label){case 0:return[4,Yo(e)];case 1:return t.sent()?[4,Go.handle(e)]:[3,3];case 2:return[2,t.sent()];case 3:return[4,Qo(e)];case 4:return[2,t.sent()]}}))}))}function Yo(e){var t=e.request,n=e.url;return Wo(this,void 0,void 0,(function(){return zo(this,(function(e){switch(e.label){case 0:return"GET"!==t.method?[2,!1]:"network-first"===Uo(t.headers,"x-omrs-offline-caching-strategy")?[2,!0]:[4,(new go).dynamicRouteRegistrations.toArray()];case 1:return[2,e.sent().some((function(e){return new RegExp(e.pattern).test(n.href)}))]}}))}))}function Qo(e){return Wo(this,void 0,void 0,(function(){var t,n,r,o,i,a;return zo(this,(function(u){switch(u.label){case 0:return[4,(t=e.request).clone()];case 1:n=u.sent(),u.label=2;case 2:return u.trys.push([2,4,,7]),[4,Ho.handle(e)];case 3:return[2,u.sent()];case 4:return u.sent(),[4,caches.match(t,{cacheName:pe})];case 5:return(r=u.sent())?[2,r]:(o=Fo,i={type:"networkRequestFailed"},a={url:t.url,method:t.method},[4,n.text()]);case 6:return o.apply(void 0,[(i.request=(a.body=u.sent(),a.headers=(s=t.headers,c={},s.forEach((function(e,t){return c[t]=e})),c),a),i)]),[2,new Response(Mo(t.headers),{status:No(t.headers)})];case 7:return[2]}var s,c}))}))}self.__WB_DISABLE_DEV_LOGS=!0,Lo={prefix:"omrs"},(e=>{for(const t of Object.keys(r))e(t)})((e=>{"string"==typeof Lo[e]&&(r[e]=Lo[e])})),function(){!function(e,t,n){let r;r=e instanceof RegExp?new Co(e,t,n):new Ro(e,t,n),Ko().registerRoute(r)}((function(e){return"navigate"===e.request.mode}),Vo);for(var e=Ko(),t=0,n=So;t<n.length;t++){var r=n[t];e.setDefaultHandler($o,r)}}(),self.addEventListener("message",(function(e){var t,n,r,o,i,a;return Eo(this,void 0,void 0,(function(){function u(e){console.warn("Handling a message resulted in an error.",e),s({success:!1,error:e})}function s(t){e.ports[0].postMessage(null!=t?t:{})}var c,l;return Oo(this,(function(f){switch(f.label){case 0:if(!(c=Po[null!==(r=null===(n=null===(t=e.data)||void 0===t?void 0:t.type)||void 0===n?void 0:n.toString())&&void 0!==r?r:""]))return u('Received an unknown message of type "'+(null===(o=e.data)||void 0===o?void 0:o.type)+" which cannot be handled."),[2];f.label=1;case 1:return f.trys.push([1,3,,4]),[4,c(e.data)];case 2:return s({success:!0,result:f.sent()}),[3,4];case 3:return l=f.sent(),u(null!==(a=null!==(i=null==l?void 0:l.message)&&void 0!==i?i:null==l?void 0:l.toString())&&void 0!==a?a:"Unknown error."),[3,4];case 4:return[2]}}))}))})),self.addEventListener("install",(function(e){self.skipWaiting(),e.waitUntil(ko(ve))}))})()})();
|
|
1
|
+
(()=>{"use strict";var e={183:()=>{try{self["workbox:core:6.2.4"]&&_()}catch(e){}},306:()=>{try{self["workbox:routing:6.2.4"]&&_()}catch(e){}},781:()=>{try{self["workbox:strategies:6.2.4"]&&_()}catch(e){}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}(()=>{n(183);class e extends Error{constructor(e,t){super(((e,...t)=>{let n=e;return t.length>0&&(n+=` :: ${JSON.stringify(t)}`),n})(e,t)),this.name=e,this.details=t}}const t=new Set,r={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},o=e=>{return e||(t=r.runtime,[r.prefix,t,r.suffix].filter((e=>e&&e.length>0)).join("-"));var t};function i(e,t){const n=new URL(e);for(const e of t)n.searchParams.delete(e);return n.href}class a{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}function u(e){return new Promise((t=>setTimeout(t,e)))}const s="object"==typeof global&&global&&global.Object===Object&&global;var c="object"==typeof self&&self&&self.Object===Object&&self;const l=s||c||Function("return this")(),f=l.Symbol,h=Array.isArray;var p=Object.prototype,d=p.hasOwnProperty,y=p.toString,v=f?f.toStringTag:void 0;var m=Object.prototype.toString;var g=f?f.toStringTag:void 0;const b=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":g&&g in Object(e)?function(e){var t=d.call(e,v),n=e[v];try{e[v]=void 0;var r=!0}catch(e){}var o=y.call(e);return r&&(t?e[v]=n:delete e[v]),o}(e):function(e){return m.call(e)}(e)},w=function(e){return null!=e&&"object"==typeof e};var _=f?f.prototype:void 0,k=_?_.toString:void 0;const x=function e(t){if("string"==typeof t)return t;if(h(t))return function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}(t,e)+"";if(function(e){return"symbol"==typeof e||w(e)&&"[object Symbol]"==b(e)}(t))return k?k.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var E=/[\\^$.*+?()[\]{}|]/g,O=RegExp(E.source);const P=function(e){return(e=null==(t=e)?"":x(t))&&O.test(e)?e.replace(E,"\\$&"):e;var t};var S=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},j=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};function R(e,t){return void 0===t&&(t={}),S(this,void 0,void 0,(function(){var n,r,o,i,a,u;return j(this,(function(s){switch(s.label){case 0:n=t.shouldRetry,r=t.getDelay,o=t.onError,n=null!=n?n:function(e){return function(e,t){return e<=5}(e)},r=null!=r?r:function(e){return function(e,t,n){void 0===n&&(n=!1);var r=n?e+1:e;return 1e3*Math.pow(2,r)}(e)},i=0,a=void 0,s.label=1;case 1:return s.trys.push([1,4,,5]),[4,C(r(i))];case 2:return s.sent(),[4,e()];case 3:return[2,s.sent()];case 4:return u=s.sent(),null==o||o(u,i),a=u,[3,5];case 5:if(n(i++))return[3,1];s.label=6;case 6:throw a}}))}))}function C(e){return S(this,void 0,void 0,(function(){return j(this,(function(t){return e<=0?[2]:[2,new Promise((function(t){return setTimeout(t,e)}))]}))}))}const A=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},T=l["__core-js_shared__"];var K,q=(K=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+K:"";var D=Function.prototype.toString;var I=/^\[object .+?Constructor\]$/,B=Function.prototype,F=Object.prototype,M=B.toString,N=F.hasOwnProperty,U=RegExp("^"+M.call(N).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const L=function(e){return!(!A(e)||(t=e,q&&q in t))&&(function(e){if(!A(e))return!1;var t=b(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?U:I).test(function(e){if(null!=e){try{return D.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t},W=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return L(n)?n:void 0},z=W(Object,"create");var H=Object.prototype.hasOwnProperty;var G=Object.prototype.hasOwnProperty;function V(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}V.prototype.clear=function(){this.__data__=z?z(null):{},this.size=0},V.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},V.prototype.get=function(e){var t=this.__data__;if(z){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return H.call(t,e)?t[e]:void 0},V.prototype.has=function(e){var t=this.__data__;return z?void 0!==t[e]:G.call(t,e)},V.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=z&&void 0===t?"__lodash_hash_undefined__":t,this};const $=V,Y=function(e,t){for(var n=e.length;n--;)if((r=e[n][0])===(o=t)||r!=r&&o!=o)return n;var r,o;return-1};var Q=Array.prototype.splice;function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}X.prototype.clear=function(){this.__data__=[],this.size=0},X.prototype.delete=function(e){var t=this.__data__,n=Y(t,e);return!(n<0||(n==t.length-1?t.pop():Q.call(t,n,1),--this.size,0))},X.prototype.get=function(e){var t=this.__data__,n=Y(t,e);return n<0?void 0:t[n][1]},X.prototype.has=function(e){return Y(this.__data__,e)>-1},X.prototype.set=function(e,t){var n=this.__data__,r=Y(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const J=X,Z=W(l,"Map"),ee=function(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function te(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}te.prototype.clear=function(){this.size=0,this.__data__={hash:new $,map:new(Z||J),string:new $}},te.prototype.delete=function(e){var t=ee(this,e).delete(e);return this.size-=t?1:0,t},te.prototype.get=function(e){return ee(this,e).get(e)},te.prototype.has=function(e){return ee(this,e).has(e)},te.prototype.set=function(e,t){var n=ee(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};const ne=te;function re(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ne;++t<n;)this.add(e[t])}re.prototype.add=re.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},re.prototype.has=function(e){return this.__data__.has(e)};const oe=re,ie=function(e){return e!=e},ae=function(e,t){return!(null==e||!e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}(e,ie,n)}(e,t,0)>-1},ue=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1},se=function(e,t){return e.has(t)},ce=W(l,"Set"),le=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},fe=ce&&1/le(new ce([,-0]))[1]==1/0?function(e){return new ce(e)}:function(){};var he,pe="omrs-spa-cache-v1",de=[{'revision':null,'url':'011d289a8d88a2fdfd6cd2c631c6345c.woff'},{'revision':null,'url':'040426f99ff6e00b86506452e0d1f10b.woff'},{'revision':null,'url':'092493151c223670ee3ae92081e1459c.woff2'},{'revision':null,'url':'0d8bb5b3ee5f5dac9e446d48480d28a9.woff2'},{'revision':null,'url':'176f8f5bd5f02b3abfcf894955d7e919.woff2'},{'revision':null,'url':'18d00f739ff1e1c52db1a1c0d9e98129.woff'},{'revision':null,'url':'2267169ee7270a22a963b2b2bfb7ab0c.woff'},{'revision':null,'url':'22fb8afba4ab1f093b6ef9e28a9b6e92.woff'},{'revision':null,'url':'2cb669abc02f2c1dcafa.js'},{'revision':null,'url':'2de7bfeaf08fb03d4315d49947f062f7.woff2'},{'revision':null,'url':'3254cfe8da4b4bdf57791236916365e0.woff'},{'revision':null,'url':'41dba2ac8f3b89bba110ecbb7334575b.woff2'},{'revision':null,'url':'49ae34d4cc6b98c00c69ab4c41de3e0c.woff'},{'revision':null,'url':'4b08e01d805fa35d7bf777f1b24314ae.woff2'},{'revision':null,'url':'57aab56f67155c247201b13c33e66699.woff2'},{'revision':null,'url':'5a0649a56872700d9315cfe399de812e.woff2'},{'revision':null,'url':'5a8e212f1c994e975f940c1a1dc723c8.woff'},{'revision':null,'url':'79db67aca65f5285964ab332bd65f451.woff'},{'revision':null,'url':'7d8125ff7f707231fd89d9d7109deadf.woff2'},{'revision':null,'url':'9360531f9bb817f917f01a6d394515f3.woff'},{'revision':null,'url':'b1d9d9904bfca8802a631c45590b9efa.woff'},{'revision':null,'url':'c18ee39fb002ad58b6dc595476f88fef.woff2'},{'revision':null,'url':'cd92541b177652fffb6e3b952f1c33f1.woff2'},{'revision':null,'url':'cea99d3e3e13a3a599a015c29f1046d0.woff'},{'revision':null,'url':'d022bc70dc1bf7b3425da9cdaa9841b6.woff2'},{'revision':null,'url':'d9479e8023bef9cbd9bf8d6eabd6bf36.woff2'},{'revision':'72cf874e7aa9a0604a3004f1a03ba4c7','url':'esm-devtools-app/67.openmrs-esm-devtools-app.js'},{'revision':'3fdc8d4517ba729db92a9c3c634a84e1','url':'esm-devtools-app/openmrs-esm-devtools-app.js'},{'revision':'f5edba8a73ed0d0c35df4ff6beaaf62f','url':'esm-devtools-app/openmrs-esm-devtools-app.js.buildmanifest.json'},{'revision':'8c6585e1dfb4db238a0e810d2f064e87','url':'esm-implementer-tools-app/266.openmrs-esm-implementer-tools-app.js'},{'revision':'6fce53c7c7713ebf61712cc2929746fa','url':'esm-implementer-tools-app/266.openmrs-esm-implementer-tools-app.js.LICENSE.txt'},{'revision':'b7aa090a71868e6223495b8209208e48','url':'esm-implementer-tools-app/319.openmrs-esm-implementer-tools-app.js'},{'revision':'3167f91c8d1e4ea7a7905f9e74dae1e7','url':'esm-implementer-tools-app/472.openmrs-esm-implementer-tools-app.js'},{'revision':'1692977b9efc0d787ce265a17b328763','url':'esm-implementer-tools-app/574.openmrs-esm-implementer-tools-app.js'},{'revision':'7980155ebca111abe36174e99b020d81','url':'esm-implementer-tools-app/728.openmrs-esm-implementer-tools-app.js'},{'revision':'ce964ac5b34d07803455e371beb62e9c','url':'esm-implementer-tools-app/965.openmrs-esm-implementer-tools-app.js'},{'revision':'81896c98bac7b5b16ab1d3790da5b937','url':'esm-implementer-tools-app/965.openmrs-esm-implementer-tools-app.js.LICENSE.txt'},{'revision':'e03af4b2eedc037a76fd44e0f19d2f75','url':'esm-implementer-tools-app/openmrs-esm-implementer-tools-app.js'},{'revision':'6b224a8cc3bd02a2465213877a0d8847','url':'esm-implementer-tools-app/openmrs-esm-implementer-tools-app.js.buildmanifest.json'},{'revision':'950bb59302159e6b7a7b43996b5d93c6','url':'esm-login-app/192.openmrs-esm-login-app.js'},{'revision':'1d248a496703ce7acaaf8f5b753b827b','url':'esm-login-app/236.openmrs-esm-login-app.js'},{'revision':'75c01ecf53582778ed36d765c8a2fbba','url':'esm-login-app/240.openmrs-esm-login-app.js'},{'revision':'300cf600895898996c81c1e90d2861fe','url':'esm-login-app/272.openmrs-esm-login-app.js'},{'revision':'10dca414ff381e093e51e23293431daf','url':'esm-login-app/319.openmrs-esm-login-app.js'},{'revision':'3afef0c6484c055e0c4f4e974893250d','url':'esm-login-app/322.openmrs-esm-login-app.js'},{'revision':'9d08bba9b1203cc1553b53b3a0e9c29c','url':'esm-login-app/336.openmrs-esm-login-app.js'},{'revision':'f7589322a9eb55e6a08dcd8995acc926','url':'esm-login-app/466.openmrs-esm-login-app.js'},{'revision':'fb8925647b6873b7b2806bc492d86a27','url':'esm-login-app/539.openmrs-esm-login-app.js'},{'revision':'d14c1aa13b412073f9bb4c2916610f60','url':'esm-login-app/571.openmrs-esm-login-app.js'},{'revision':'b13dd9c032439ec85273b6f4d304d879','url':'esm-login-app/574.openmrs-esm-login-app.js'},{'revision':'56e1e497f84a5947017c0d8e6470f68f','url':'esm-login-app/644.openmrs-esm-login-app.js'},{'revision':'39adbf8cde7ff9d9f1bff31af4a22595','url':'esm-login-app/673.openmrs-esm-login-app.js'},{'revision':'1c14510040102c4fa52becc292fee3e3','url':'esm-login-app/747.openmrs-esm-login-app.js'},{'revision':'99887f743833d2d35ea0bace32889f51','url':'esm-login-app/757.openmrs-esm-login-app.js'},{'revision':'858598cc555454bf01b354229d7c41ba','url':'esm-login-app/852.openmrs-esm-login-app.js'},{'revision':'81896c98bac7b5b16ab1d3790da5b937','url':'esm-login-app/852.openmrs-esm-login-app.js.LICENSE.txt'},{'revision':'813de325b6ffc54fb9cc62b375d5b267','url':'esm-login-app/984.openmrs-esm-login-app.js'},{'revision':'7ef7824f20975e6a924439de2d1ba087','url':'esm-login-app/openmrs-esm-login-app.js'},{'revision':'715207baba70163fbae9766965fa9078','url':'esm-login-app/openmrs-esm-login-app.js.buildmanifest.json'},{'revision':'85eb01775e54780c23483bae9dcead9b','url':'esm-offline-tools-app/218.openmrs-esm-offline-tools-app.js'},{'revision':'7fec7cf1d855ef562caa5cc75662ef2f','url':'esm-offline-tools-app/438.openmrs-esm-offline-tools-app.js'},{'revision':'c49b51f0611acbdf2eac75b5d9fe47a0','url':'esm-offline-tools-app/535.openmrs-esm-offline-tools-app.js'},{'revision':'cc29644bcabc092809344e368692f5c8','url':'esm-offline-tools-app/574.openmrs-esm-offline-tools-app.js'},{'revision':'095bce75d7332ad9550616304546cb2a','url':'esm-offline-tools-app/697.openmrs-esm-offline-tools-app.js'},{'revision':'366f403d3697cb533aaafbd39077c13f','url':'esm-offline-tools-app/713.openmrs-esm-offline-tools-app.js'},{'revision':'af3d5301cee133c79998dbd78f79616b','url':'esm-offline-tools-app/814.openmrs-esm-offline-tools-app.js'},{'revision':'cbc9366c0e23bc6694d6e83197d6af9b','url':'esm-offline-tools-app/cbc9366c0e23bc6694d6e83197d6af9b.svg'},{'revision':'32417b8c08b7af4daceade28dccff1db','url':'esm-offline-tools-app/openmrs-esm-offline-tools-app.js'},{'revision':'81896c98bac7b5b16ab1d3790da5b937','url':'esm-offline-tools-app/openmrs-esm-offline-tools-app.js.LICENSE.txt'},{'revision':'1529a5c9edd3d2985216a96698fec2f4','url':'esm-offline-tools-app/openmrs-esm-offline-tools-app.js.buildmanifest.json'},{'revision':'adf98a99aa985440c7751b69fa427859','url':'esm-primary-navigation-app/160.openmrs-esm-primary-navigation-app.js'},{'revision':'1f4cf77e15d54f720bb0b287996756c3','url':'esm-primary-navigation-app/201.openmrs-esm-primary-navigation-app.js'},{'revision':'81896c98bac7b5b16ab1d3790da5b937','url':'esm-primary-navigation-app/201.openmrs-esm-primary-navigation-app.js.LICENSE.txt'},{'revision':'0a2db48353832cb6c3975547adb073b4','url':'esm-primary-navigation-app/574.openmrs-esm-primary-navigation-app.js'},{'revision':'e09fa5e283bfe7f667c58964160c73d1','url':'esm-primary-navigation-app/674.openmrs-esm-primary-navigation-app.js'},{'revision':'92a910f39846d236f2d1b3437a4152a1','url':'esm-primary-navigation-app/764.openmrs-esm-primary-navigation-app.js'},{'revision':'16edd055e0913614ac12d44139c99c7e','url':'esm-primary-navigation-app/878.openmrs-esm-primary-navigation-app.js'},{'revision':'dc946000bbcfc524b347fbbff3a838cd','url':'esm-primary-navigation-app/898.openmrs-esm-primary-navigation-app.js'},{'revision':'783f14fa45b10e088e68f98251448010','url':'esm-primary-navigation-app/898.openmrs-esm-primary-navigation-app.js.LICENSE.txt'},{'revision':'6a9bbe12557e7c570f68f753a92da0f4','url':'esm-primary-navigation-app/openmrs-esm-primary-navigation-app.js'},{'revision':'eeea08c6b7cf6be9ba9478870b1d0860','url':'esm-primary-navigation-app/openmrs-esm-primary-navigation-app.js.buildmanifest.json'},{'revision':null,'url':'f5b74d7ffcdf85b9dd60130fa0b2c087.woff2'},{'revision':null,'url':'f6efe64b9b246e70f4e82ee61e26b5b7.woff'},{'revision':null,'url':'f87f3d87cea0dd0979bfc8ac9ea90243.woff'},{'revision':'30de494bd9e73ae96c18fd0c06fa422b','url':'favicon.ico'},{'revision':null,'url':'https://spa-modules.nyc3.digitaloceanspaces.com/import-map.json'},{'revision':'18dc895b9723d370fea0437fa399a963','url':'importmap.json'},{'revision':'dde9d344c84c88ae2fcb80cc02913e2f','url':'index.html'},{'revision':'6b758b31ea00150986994edcfb033a94','url':'logo-512.png'},{'revision':'b860db243392596e3b875bad9794b4e5','url':'logo.svg'},{'revision':'18023a1718c7907f9f5a1478035763d0','url':'openmrs.css'},{'revision':'4cbaea4e0d7e86e2a9f7b4bd2b2f29b2','url':'openmrs.js'},{'revision':'9188e0d35e25fa3723eb796003e71e70','url':'openmrs.js.LICENSE.txt'}],ye=me("index.html"),ve=(he=de.map((function(e){return me(e.url)})))&&he.length?function(e,t,n){var r=-1,o=ae,i=e.length,a=!0,u=[],s=u;if(n)a=!1,o=ue;else if(i>=200){var c=t?null:fe(e);if(c)return le(c);a=!1,o=se,s=new oe}else s=t?[]:u;e:for(;++r<i;){var l=e[r],f=t?t(l):l;if(l=n||0!==l?l:0,a&&f==f){for(var h=s.length;h--;)if(s[h]===f)continue e;t&&s.push(f),u.push(l)}else o(s,f,n)||(s!==u&&s.push(f),u.push(l))}return u}(he):[];function me(e){return new URL(e,self.location.href).href}const ge=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e},be=function(e){return w(e)&&"[object Arguments]"==b(e)};var we=Object.prototype,_e=we.hasOwnProperty,ke=we.propertyIsEnumerable;const xe=be(function(){return arguments}())?be:function(e){return w(e)&&_e.call(e,"callee")&&!ke.call(e,"callee")};var Ee=f?f.isConcatSpreadable:void 0;const Oe=function(e){return h(e)||xe(e)||!!(Ee&&e&&e[Ee])},Pe=function e(t,n,r,o,i){var a=-1,u=t.length;for(r||(r=Oe),i||(i=[]);++a<u;){var s=t[a];n>0&&r(s)?n>1?e(s,n-1,r,o,i):ge(i,s):o||(i[i.length]=s)}return i},Se=function(e){return null!=e&&e.length?Pe(e,1):[]};var je=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},Re=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};function Ce(e){var t=e.imports,n=void 0===t?{}:t;return je(this,void 0,void 0,(function(){var e,t,r=this;return Re(this,(function(o){switch(o.label){case 0:return e=Object.values(n),[4,Promise.all(e.map((function(e){return je(r,void 0,void 0,(function(){var t;return Re(this,(function(n){switch(n.label){case 0:return[4,(r=function(e){return e+".buildmanifest.json"}(e),fetch(r).then((function(e){return e.json()})).catch((function(){return null})))];case 1:return[2,(t=n.sent())?Ae(e,t):[]]}var r}))}))})))];case 1:return t=o.sent(),[2,Se(t)]}}))}))}function Ae(e,t){var n,r,o,i;try{for(var a=[],u=((i=((o=new URL(e)).origin+o.pathname).split("/"))[i.length-1]="",i.join("/")),s=0,c=null!==(n=t.chunks)&&void 0!==n?n:[];s<c.length;s++)for(var l=c[s],f=0,h=null!==(r=l.files)&&void 0!==r?r:[];f<h.length;f++){var p=h[f];a.push(new URL(p,u).toString())}return a}catch(e){return[]}}var Te=function(){return(Te=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Ke(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}var qe=Object.keys,De=Array.isArray,Ie="undefined"!=typeof self?self:"undefined"!=typeof window?window:global;function Be(e,t){return"object"!=typeof t||qe(t).forEach((function(n){e[n]=t[n]})),e}"undefined"==typeof Promise||Ie.Promise||(Ie.Promise=Promise);var Fe=Object.getPrototypeOf,Me={}.hasOwnProperty;function Ne(e,t){return Me.call(e,t)}function Ue(e,t){"function"==typeof t&&(t=t(Fe(e))),qe(t).forEach((function(n){We(e,n,t[n])}))}var Le=Object.defineProperty;function We(e,t,n,r){Le(e,t,Be(n&&Ne(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function ze(e){return{from:function(t){return e.prototype=Object.create(t.prototype),We(e.prototype,"constructor",e),{extend:Ue.bind(null,e.prototype)}}}}var He=Object.getOwnPropertyDescriptor;function Ge(e,t){var n;return He(e,t)||(n=Fe(e))&&Ge(n,t)}var Ve=[].slice;function $e(e,t,n){return Ve.call(e,t,n)}function Ye(e,t){return t(e)}function Qe(e){if(!e)throw new Error("Assertion Failed")}function Xe(e){Ie.setImmediate?setImmediate(e):setTimeout(e,0)}function Je(e,t){return e.reduce((function(e,n,r){var o=t(n,r);return o&&(e[o[0]]=o[1]),e}),{})}function Ze(e,t){if(Ne(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,o=t.length;r<o;++r){var i=Ze(e,t[r]);n.push(i)}return n}var a=t.indexOf(".");if(-1!==a){var u=e[t.substr(0,a)];return void 0===u?void 0:Ze(u,t.substr(a+1))}}function et(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){Qe("string"!=typeof n&&"length"in n);for(var r=0,o=t.length;r<o;++r)et(e,t[r],n[r])}else{var i=t.indexOf(".");if(-1!==i){var a=t.substr(0,i),u=t.substr(i+1);if(""===u)void 0===n?De(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=n;else{var s=e[a];s||(s=e[a]={}),et(s,u,n)}}else void 0===n?De(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function tt(e,t){"string"==typeof t?et(e,t,void 0):"length"in t&&[].map.call(t,(function(t){et(e,t,void 0)}))}function nt(e){var t={};for(var n in e)Ne(e,n)&&(t[n]=e[n]);return t}var rt=[].concat;function ot(e){return rt.apply([],e)}var it="Boolean,String,Date,RegExp,Blob,File,FileList,ArrayBuffer,DataView,Uint8ClampedArray,ImageData,Map,Set".split(",").concat(ot([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return Ie[e]})),at=it.map((function(e){return Ie[e]})),ut=Je(it,(function(e){return[e,!0]}));function st(e){if(!e||"object"!=typeof e)return e;var t;if(De(e)){t=[];for(var n=0,r=e.length;n<r;++n)t.push(st(e[n]))}else if(at.indexOf(e.constructor)>=0)t=e;else for(var o in t=e.constructor?Object.create(e.constructor.prototype):{},e)Ne(e,o)&&(t[o]=st(e[o]));return t}var ct={}.toString;function lt(e){return ct.call(e).slice(8,-1)}var ft=function(e,t){return"Array"===t?""+e.map((function(e){return ft(e,lt(e))})):"ArrayBuffer"===t?""+new Uint8Array(e):"Date"===t?e.getTime():ArrayBuffer.isView(e)?""+new Uint8Array(e.buffer):e};function ht(e,t,n,r){return n=n||{},r=r||"",qe(e).forEach((function(o){if(Ne(t,o)){var i=e[o],a=t[o];if("object"==typeof i&&"object"==typeof a&&i&&a){var u=lt(i),s=lt(a);u===s?ut[u]?ft(i,u)!==ft(a,s)&&(n[r+o]=t[o]):ht(i,a,n,r+o+"."):n[r+o]=t[o]}else i!==a&&(n[r+o]=t[o])}else n[r+o]=void 0})),qe(t).forEach((function(o){Ne(e,o)||(n[r+o]=t[o])})),n}var pt="undefined"!=typeof Symbol&&Symbol.iterator,dt=pt?function(e){var t;return null!=e&&(t=e[pt])&&t.apply(e)}:function(){return null},yt={};function vt(e){var t,n,r,o;if(1===arguments.length){if(De(e))return e.slice();if(this===yt&&"string"==typeof e)return[e];if(o=dt(e)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}var mt="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},gt="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function bt(e,t){gt=e,wt=t}var wt=function(){return!0},_t=!new Error("").stack;function kt(){if(_t)try{throw new Error}catch(e){return e}return new Error}function xt(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(wt).map((function(e){return"\n"+e})).join("")):""}var Et=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Ot=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Et),Pt={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};function St(e,t){this._e=kt(),this.name=e,this.message=t}function jt(e,t){return e+". Errors: "+Object.keys(t).map((function(e){return t[e].toString()})).filter((function(e,t,n){return n.indexOf(e)===t})).join("\n")}function Rt(e,t,n,r){this._e=kt(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=jt(e,t)}function Ct(e,t){this._e=kt(),this.name="BulkError",this.failures=t,this.message=jt(e,t)}ze(St).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+xt(this._e,2))}},toString:function(){return this.name+": "+this.message}}),ze(Rt).from(St),ze(Ct).from(St);var At=Ot.reduce((function(e,t){return e[t]=t+"Error",e}),{}),Tt=St,Kt=Ot.reduce((function(e,t){var n=t+"Error";function r(e,r){this._e=kt(),this.name=n,e?"string"==typeof e?(this.message=e+(r?"\n "+r:""),this.inner=r||null):"object"==typeof e&&(this.message=e.name+" "+e.message,this.inner=e):(this.message=Pt[t]||n,this.inner=null)}return ze(r).from(Tt),e[t]=r,e}),{});Kt.Syntax=SyntaxError,Kt.Type=TypeError,Kt.Range=RangeError;var qt=Et.reduce((function(e,t){return e[t+"Error"]=Kt[t],e}),{}),Dt=Ot.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Kt[t]),e}),{});function It(){}function Bt(e){return e}function Ft(e,t){return null==e||e===Bt?t:function(n){return t(e(n))}}function Mt(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Nt(e,t){return e===It?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?Mt(r,this.onsuccess):r),o&&(this.onerror=this.onerror?Mt(o,this.onerror):o),void 0!==i?i:n}}function Ut(e,t){return e===It?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?Mt(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Mt(r,this.onerror):r)}}function Lt(e,t){return e===It?t:function(n){var r=e.apply(this,arguments);Be(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?Mt(o,this.onsuccess):o),i&&(this.onerror=this.onerror?Mt(i,this.onerror):i),void 0===r?void 0===a?void 0:a:Be(r,a)}}function Wt(e,t){return e===It?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function zt(e,t){return e===It?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,o=arguments.length,i=new Array(o);o--;)i[o]=arguments[o];return n.then((function(){return t.apply(r,i)}))}return t.apply(this,arguments)}}Dt.ModifyError=Rt,Dt.DexieError=St,Dt.BulkError=Ct;var Ht={},Gt="undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,e.__proto__,e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,t.__proto__,e]}(),Vt=Gt[0],$t=Gt[1],Yt=Gt[2],Qt=$t&&$t.then,Xt=Vt&&Vt.constructor,Jt=!!Yt,Zt=!1,en=Yt?function(){Yt.then(En)}:Ie.setImmediate?setImmediate.bind(null,En):Ie.MutationObserver?function(){var e=document.createElement("div");new MutationObserver((function(){En(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(En,0)},tn=function(e,t){fn.push([e,t]),rn&&(en(),rn=!1)},nn=!0,rn=!0,on=[],an=[],un=null,sn=Bt,cn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Yn,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{Yn(e[0],e[1])}catch(e){}}))}},ln=cn,fn=[],hn=0,pn=[];function dn(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=It,this._lib=!1;var t=this._PSD=ln;if(gt&&(this._stackHolder=kt(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Ht)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&gn(this,this._value))}this._state=null,this._value=null,++t.ref,mn(this,e)}var yn={get:function(){var e=ln,t=qn;function n(n,r){var o=this,i=!e.global&&(e!==ln||t!==qn),a=i&&!Fn(),u=new dn((function(t,u){wn(o,new vn(Gn(n,e,i,a),Gn(r,e,i,a),t,u,e))}));return gt&&xn(u,this),u}return n.prototype=Ht,n},set:function(e){We(this,"then",e&&e.prototype===Ht?yn:{get:function(){return e},set:yn.set})}};function vn(e,t,n,r,o){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=o}function mn(e,t){try{t((function(t){if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&On();t&&"function"==typeof t.then?mn(e,(function(e,n){t instanceof dn?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,bn(e)),n&&Pn()}}),gn.bind(null,e))}catch(t){gn(e,t)}}function gn(e,t){if(an.push(t),null===e._state){var n=e._lib&&On();t=sn(t),e._state=!1,e._value=t,gt&&null!==t&&"object"==typeof t&&!t._promise&&function(n,r,o){try{(function(){var n=Ge(t,"stack");t._promise=e,We(t,"stack",{get:function(){return Zt?n&&(n.get?n.get.apply(t):n.value):e.stack}})}).apply(null,void 0)}catch(e){}}(),function(e){on.some((function(t){return t._value===e._value}))||on.push(e)}(e),bn(e),n&&Pn()}}function bn(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)wn(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),0===hn&&(++hn,tn((function(){0==--hn&&Sn()}),[]))}function wn(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++hn,tn(_n,[n,e,t])}else e._listeners.push(t)}function _n(e,t,n){try{un=t;var r,o=t._value;t._state?r=e(o):(an.length&&(an=[]),r=e(o),-1===an.indexOf(o)&&function(e){for(var t=on.length;t;)if(on[--t]._value===e._value)return void on.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{un=null,0==--hn&&Sn(),--n.psd.ref||n.psd.finalize()}}function kn(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var o,i,a=e._value;null!=a?(o=a.name||"Error",i=a.message||a,r=xt(a,0)):(o=a,i=""),t.push(o+(i?": "+i:"")+r)}return gt&&((r=xt(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&kn(e._prev,t,n)),t}function xn(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function En(){On()&&Pn()}function On(){var e=nn;return nn=!1,rn=!1,e}function Pn(){var e,t,n;do{for(;fn.length>0;)for(e=fn,fn=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(fn.length>0);nn=!0,rn=!0}function Sn(){var e=on;on=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=pn.slice(0),n=t.length;n;)t[--n]()}function jn(e){return new dn(Ht,!1,e)}function Rn(e,t){var n=ln;return function(){var r=On(),o=ln;try{return Ln(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Ln(o,!1),r&&Pn()}}}Ue(dn.prototype,{then:yn,_then:function(e,t){wn(this,new vn(null,null,e,t,ln))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,(function(e){return e instanceof t?n(e):jn(e)})):this.then(null,(function(e){return e&&e.name===t?n(e):jn(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),jn(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{Zt=!0;var e=kn(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Zt=!1}}},timeout:function(e,t){var n=this;return e<1/0?new dn((function(r,o){var i=setTimeout((function(){return o(new Kt.Timeout(t))}),e);n.then(r,o).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&We(dn.prototype,Symbol.toStringTag,"Dexie.Promise"),cn.env=Wn(),Ue(dn,{all:function(){var e=vt.apply(null,arguments).map(Mn);return new dn((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(o,i){return dn.resolve(o).then((function(n){e[i]=n,--r||t(e)}),n)}))}))},resolve:function(e){if(e instanceof dn)return e;if(e&&"function"==typeof e.then)return new dn((function(t,n){e.then(t,n)}));var t=new dn(Ht,!0,e);return xn(t,un),t},reject:jn,race:function(){var e=vt.apply(null,arguments).map(Mn);return new dn((function(t,n){e.map((function(e){return dn.resolve(e).then(t,n)}))}))},PSD:{get:function(){return ln},set:function(e){return ln=e}},totalEchoes:{get:function(){return qn}},newPSD:In,usePSD:zn,scheduler:{get:function(){return tn},set:function(e){tn=e}},rejectionMapper:{get:function(){return sn},set:function(e){sn=e}},follow:function(e,t){return new dn((function(n,r){return In((function(t,n){var r=ln;r.unhandleds=[],r.onunhandled=n,r.finalize=Mt((function(){var e=this;pn.push((function r(){0===e.unhandleds.length?t():n(e.unhandleds[0]),pn.splice(pn.indexOf(r),1)})),++hn,tn((function(){0==--hn&&Sn()}),[])}),r.finalize),e()}),t,n,r)}))}}),Xt&&(Xt.allSettled&&We(dn,"allSettled",(function(){var e=vt.apply(null,arguments).map(Mn);return new dn((function(t){0===e.length&&t([]);var n=e.length,r=new Array(n);e.forEach((function(e,o){return dn.resolve(e).then((function(e){return r[o]={status:"fulfilled",value:e}}),(function(e){return r[o]={status:"rejected",reason:e}})).then((function(){return--n||t(r)}))}))}))})),Xt.any&&"undefined"!=typeof AggregateError&&We(dn,"any",(function(){var e=vt.apply(null,arguments).map(Mn);return new dn((function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,o=new Array(r);e.forEach((function(e,i){return dn.resolve(e).then((function(e){return t(e)}),(function(e){o[i]=e,--r||n(new AggregateError(o))}))}))}))})));var Cn={awaits:0,echoes:0,id:0},An=0,Tn=[],Kn=0,qn=0,Dn=0;function In(e,t,n,r){var o=ln,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++Dn;var a=cn.env;i.env=Jt?{Promise:dn,PromiseProp:{value:dn,configurable:!0,writable:!0},all:dn.all,race:dn.race,allSettled:dn.allSettled,any:dn.any,resolve:dn.resolve,reject:dn.reject,nthen:Vn(a.nthen,i),gthen:Vn(a.gthen,i)}:{},t&&Be(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=zn(i,e,n,r);return 0===i.ref&&i.finalize(),u}function Bn(){return Cn.id||(Cn.id=++An),++Cn.awaits,Cn.echoes+=100,Cn.id}function Fn(){return!!Cn.awaits&&(0==--Cn.awaits&&(Cn.id=0),Cn.echoes=100*Cn.awaits,!0)}function Mn(e){return Cn.echoes&&e&&e.constructor===Xt?(Bn(),e.then((function(e){return Fn(),e}),(function(e){return Fn(),Qn(e)}))):e}function Nn(e){++qn,Cn.echoes&&0!=--Cn.echoes||(Cn.echoes=Cn.id=0),Tn.push(ln),Ln(e,!0)}function Un(){var e=Tn[Tn.length-1];Tn.pop(),Ln(e,!1)}function Ln(e,t){var n=ln;if((t?!Cn.echoes||Kn++&&e===ln:!Kn||--Kn&&e===ln)||Hn(t?Nn.bind(null,e):Un),e!==ln&&(ln=e,n===cn&&(cn.env=Wn()),Jt)){var r=cn.env.Promise,o=e.env;$t.then=o.nthen,r.prototype.then=o.gthen,(n.global||e.global)&&(Object.defineProperty(Ie,"Promise",o.PromiseProp),r.all=o.all,r.race=o.race,r.resolve=o.resolve,r.reject=o.reject,o.allSettled&&(r.allSettled=o.allSettled),o.any&&(r.any=o.any))}}function Wn(){var e=Ie.Promise;return Jt?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(Ie,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:$t.then,gthen:e.prototype.then}:{}}function zn(e,t,n,r,o){var i=ln;try{return Ln(e,!0),t(n,r,o)}finally{Ln(i,!1)}}function Hn(e){Qt.call(Vt,e)}function Gn(e,t,n,r){return"function"!=typeof e?e:function(){var o=ln;n&&Bn(),Ln(t,!0);try{return e.apply(this,arguments)}finally{Ln(o,!1),r&&Hn(Fn)}}}function Vn(e,t){return function(n,r){return e.call(this,Gn(n,t),Gn(r,t))}}-1===(""+Qt).indexOf("[native code]")&&(Bn=Fn=It);var $n="unhandledrejection";function Yn(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,o={promise:t,reason:e};if(Ie.document&&document.createEvent?((r=document.createEvent("Event")).initEvent($n,!0,!0),Be(r,o)):Ie.CustomEvent&&Be(r=new CustomEvent($n,{detail:o}),o),r&&Ie.dispatchEvent&&(dispatchEvent(r),!Ie.PromiseRejectionEvent&&Ie.onunhandledrejection))try{Ie.onunhandledrejection(r)}catch(e){}gt&&r&&!r.defaultPrevented&&console.warn("Unhandled rejection: "+(e.stack||e))}catch(e){}}var Qn=dn.reject;function Xn(e,t,n,r){if(e._state.openComplete||ln.letThrough){var o=e._createTransaction(t,n,e._dbSchema);try{o.create()}catch(e){return Qn(e)}return o._promise(t,(function(e,t){return In((function(){return ln.trans=o,r(e,t,o)}))})).then((function(e){return o._completion.then((function(){return e}))}))}if(!e._state.isBeingOpened){if(!e._options.autoOpen)return Qn(new Kt.DatabaseClosed);e.open().catch(It)}return e._state.dbReadyPromise.then((function(){return Xn(e,t,n,r)}))}var Jn="3.0.3",Zn=String.fromCharCode(65535),er=-1/0,tr="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",nr="String expected.",rr=[],or="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),ir=or,ar=or,ur=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)},sr="__dbnames",cr="readonly",lr="readwrite";function fr(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var hr={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function pr(e){return function(t){return void 0===Ze(t,e)&&tt(t=st(t),e),t}}var dr=function(){function e(){}return e.prototype._trans=function(e,t,n){var r=this._tx||ln.trans,o=this.name;function i(e,n,r){if(!r.schema[o])throw new Kt.NotFound("Table "+o+" not part of transaction");return t(r.idbtrans,r)}var a=On();try{return r&&r.db===this.db?r===ln.trans?r._promise(e,i,n):In((function(){return r._promise(e,i,n)}),{trans:r,transless:ln.transless||ln}):Xn(this.db,e,[this.name],i)}finally{a&&Pn()}},e.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(function(t){return n.core.get({trans:t,key:e}).then((function(e){return n.hook.reading.fire(e)}))})).then(t)},e.prototype.where=function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(De(e))return new this.db.WhereClause(this,"["+e.join("+")+"]");var t=qe(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter((function(e){return e.compound&&t.every((function(t){return e.keyPath.indexOf(t)>=0}))&&e.keyPath.every((function(e){return t.indexOf(e)>=0}))}))[0];if(n&&this.db._maxKey!==Zn)return this.where(n.name).equals(n.keyPath.map((function(t){return e[t]})));!n&>&&console.warn("The query "+JSON.stringify(e)+" on "+this.name+" would benefit of a compound index ["+t.join("+")+"]");var r=this.schema.idxByName,o=this.db._deps.indexedDB;function i(e,t){try{return 0===o.cmp(e,t)}catch(e){return!1}}var a=t.reduce((function(t,n){var o=t[0],a=t[1],u=r[n],s=e[n];return[o||u,o||!u?fr(a,u&&u.multi?function(e){var t=Ze(e,n);return De(t)&&t.some((function(e){return i(s,e)}))}:function(e){return i(s,Ze(e,n))}):a]}),[null,null]),u=a[0],s=a[1];return u?this.where(u.name).equals(e[u.keyPath]).filter(s):n?this.filter(s):this.where(t).equals("")},e.prototype.filter=function(e){return this.toCollection().and(e)},e.prototype.count=function(e){return this.toCollection().count(e)},e.prototype.offset=function(e){return this.toCollection().offset(e)},e.prototype.limit=function(e){return this.toCollection().limit(e)},e.prototype.each=function(e){return this.toCollection().each(e)},e.prototype.toArray=function(e){return this.toCollection().toArray(e)},e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},e.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,De(e)?"["+e.join("+")+"]":e))},e.prototype.reverse=function(){return this.toCollection().reverse()},e.prototype.mapToClass=function(e){this.schema.mappedClass=e;var t=function(t){if(!t)return t;var n=Object.create(e.prototype);for(var r in t)if(Ne(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e},e.prototype.defineClass=function(){return this.mapToClass((function(e){Be(this,e)}))},e.prototype.add=function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=pr(i)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})})).then((function(e){return e.numFailures?dn.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{et(e,i,t)}catch(e){}return t}))},e.prototype.update=function(e,t){if("object"!=typeof t||De(t))throw new Kt.InvalidArgument("Modifications must be an object.");if("object"!=typeof e||De(e))return this.where(":id").equals(e).modify(t);qe(t).forEach((function(n){et(e,n,t[n])}));var n=Ze(e,this.schema.primKey.keyPath);return void 0===n?Qn(new Kt.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(n).modify(t)},e.prototype.put=function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=pr(i)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})})).then((function(e){return e.numFailures?dn.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{et(e,i,t)}catch(e){}return t}))},e.prototype.delete=function(e){var t=this;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})})).then((function(e){return e.numFailures?dn.reject(e.failures[0]):void 0}))},e.prototype.clear=function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:hr})})).then((function(e){return e.numFailures?dn.reject(e.failures[0]):void 0}))},e.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",(function(n){return t.core.getMany({keys:e,trans:n}).then((function(e){return e.map((function(e){return t.hook.reading.fire(e)}))}))}))},e.prototype.bulkAdd=function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,i=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new Kt.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new Kt.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,c=u&&a?e.map(pr(u)):e;return r.core.mutate({trans:t,type:"add",keys:o,values:c,wantResults:i}).then((function(e){var t=e.numFailures,n=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?n:o;throw new Ct(r.name+".bulkAdd(): "+t+" of "+s+" operations failed",Object.keys(a).map((function(e){return a[e]})))}))}))},e.prototype.bulkPut=function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,i=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new Kt.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new Kt.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,c=u&&a?e.map(pr(u)):e;return r.core.mutate({trans:t,type:"put",keys:o,values:c,wantResults:i}).then((function(e){var t=e.numFailures,n=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?n:o;throw new Ct(r.name+".bulkPut(): "+t+" of "+s+" operations failed",Object.keys(a).map((function(e){return a[e]})))}))}))},e.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:e})})).then((function(e){var r=e.numFailures,o=e.lastResult,i=e.failures;if(0===r)return o;throw new Ct(t.name+".bulkDelete(): "+r+" of "+n+" operations failed",i)}))},e}();function yr(e){var t={},n=function(n,r){if(r){for(var o=arguments.length,i=new Array(o-1);--o;)i[o-1]=arguments[o];return t[n].subscribe.apply(null,i),e}if("string"==typeof n)return t[n]};n.addEventType=i;for(var r=1,o=arguments.length;r<o;++r)i(arguments[r]);return n;function i(e,r,o){if("object"==typeof e)return a(e);r||(r=Wt),o||(o=It);var i={subscribers:[],fire:o,subscribe:function(e){-1===i.subscribers.indexOf(e)&&(i.subscribers.push(e),i.fire=r(i.fire,e))},unsubscribe:function(e){i.subscribers=i.subscribers.filter((function(t){return t!==e})),i.fire=i.subscribers.reduce(r,o)}};return t[e]=n[e]=i,i}function a(e){qe(e).forEach((function(t){var n=e[t];if(De(n))i(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new Kt.InvalidArgument("Invalid event config");var r=i(t,Bt,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){Xe((function(){e.apply(null,t)}))}))}))}}))}}function vr(e,t){return ze(t).from({prototype:e}),t}function mr(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function gr(e,t){e.filter=fr(e.filter,t)}function br(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return fr(r(),t())}:t,e.justLimit=n&&!r}function wr(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new Kt.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function _r(e,t,n){var r=wr(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function kr(e,t,n,r){var o=e.replayFilter?fr(e.filter,e.replayFilter()):e.filter;if(e.or){var i={},a=function(e,n,r){if(!o||o(n,r,(function(e){return n.stop(e)}),(function(e){return n.fail(e)}))){var a=n.primaryKey,u=""+a;"[object ArrayBuffer]"===u&&(u=""+new Uint8Array(a)),Ne(i,u)||(i[u]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(a,n),xr(_r(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return xr(_r(e,r,n),fr(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function xr(e,t,n,r){var o=Rn(r?function(e,t,o){return n(r(e),t,o)}:n);return e.then((function(e){if(e)return e.start((function(){var n=function(){return e.continue()};t&&!t(e,(function(e){return n=e}),(function(t){e.stop(t),n=It}),(function(t){e.fail(t),n=It}))||o(e.value,e,(function(e){return n=e})),n()}))}))}var Er=function(){function e(){}return e.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,Qn.bind(null,n.error)):n.table._trans("readonly",e).then(t)},e.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,Qn.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},e.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=fr(t.algorithm,e)},e.prototype._iterate=function(e,t){return kr(this._ctx,e,t,this._ctx.table.core)},e.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&Be(n,e),t._ctx=n,t},e.prototype.raw=function(){return this._ctx.valueMapper=null,this},e.prototype.each=function(e){var t=this._ctx;return this._read((function(n){return kr(t,e,n,t.table.core)}))},e.prototype.count=function(e){var t=this;return this._read((function(e){var n=t._ctx,r=n.table.core;if(mr(n,!0))return r.count({trans:e,query:{index:wr(n,r.schema),range:n.range}}).then((function(e){return Math.min(e,n.limit)}));var o=0;return kr(n,(function(){return++o,!1}),e,r).then((function(){return o}))})).then(e)},e.prototype.sortBy=function(e,t){var n=e.split(".").reverse(),r=n[0],o=n.length-1;function i(e,t){return t?i(e[n[t]],t-1):e[r]}var a="next"===this._ctx.dir?1:-1;function u(e,t){var n=i(e,o),r=i(t,o);return n<r?-a:n>r?a:0}return this.toArray((function(e){return e.sort(u)})).then(t)},e.prototype.toArray=function(e){var t=this;return this._read((function(e){var n=t._ctx;if("next"===n.dir&&mr(n,!0)&&n.limit>0){var r=n.valueMapper,o=wr(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:o,range:n.range}}).then((function(e){var t=e.result;return r?t.map(r):t}))}var i=[];return kr(n,(function(e){return i.push(e)}),e,n.table.core).then((function(){return i}))}),e)},e.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,mr(t)?br(t,(function(){var t=e;return function(e,n){return 0===t||(1===t?(--t,!1):(n((function(){e.advance(t),t=0})),!1))}})):br(t,(function(){var t=e;return function(){return--t<0}}))),this},e.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),br(this._ctx,(function(){var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this},e.prototype.until=function(e,t){return gr(this._ctx,(function(n,r,o){return!e(n.value)||(r(o),t)})),this},e.prototype.first=function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},e.prototype.last=function(e){return this.reverse().first(e)},e.prototype.filter=function(e){var t,n;return gr(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=fr(t.isMatch,n),this},e.prototype.and=function(e){return this.filter(e)},e.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},e.prototype.reverse=function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},e.prototype.desc=function(){return this.reverse()},e.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))},e.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},e.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))},e.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)},e.prototype.primaryKeys=function(e){var t=this._ctx;if("next"===t.dir&&mr(t,!0)&&t.limit>0)return this._read((function(e){var n=wr(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((function(e){return e.result})).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)},e.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},e.prototype.firstKey=function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},e.prototype.lastKey=function(e){return this.reverse().firstKey(e)},e.prototype.distinct=function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return gr(this._ctx,(function(e){var t=e.primaryKey.toString(),r=Ne(n,t);return n[t]=!0,!r})),this},e.prototype.modify=function(e){var t=this,n=this._ctx;return this._write((function(r){var o;if("function"==typeof e)o=e;else{var i=qe(e),a=i.length;o=function(t){for(var n=!1,r=0;r<a;++r){var o=i[r],u=e[o];Ze(t,o)!==u&&(et(t,o,u),n=!0)}return n}}var u=n.table.core,s=u.schema.primaryKey,c=s.outbound,l=s.extractKey,f="testmode"in po?1:2e3,h=t.db.core.cmp,p=[],d=0,y=[],v=function(e,t){var n=t.failures,r=t.numFailures;d+=e-r;for(var o=0,i=qe(n);o<i.length;o++){var a=i[o];p.push(n[a])}};return t.clone().primaryKeys().then((function(e){var t=function(n){var i=Math.min(f,e.length-n);return u.getMany({trans:r,keys:e.slice(n,n+i)}).then((function(a){for(var s=[],p=[],d=c?[]:null,y=[],m=0;m<i;++m){var g=a[m],b={value:st(g),primKey:e[n+m]};!1!==o.call(b,b.value,b)&&(null==b.value?y.push(e[n+m]):c||0===h(l(g),l(b.value))?(p.push(b.value),c&&d.push(e[n+m])):(y.push(e[n+m]),s.push(b.value)))}return Promise.resolve(s.length>0&&u.mutate({trans:r,type:"add",values:s}).then((function(e){for(var t in e.failures)y.splice(parseInt(t),1);v(s.length,e)}))).then((function(e){return p.length>0&&u.mutate({trans:r,type:"put",keys:d,values:p}).then((function(e){return v(p.length,e)}))})).then((function(){return y.length>0&&u.mutate({trans:r,type:"delete",keys:y}).then((function(e){return v(y.length,e)}))})).then((function(){return e.length>n+i&&t(n+f)}))}))};return t(0).then((function(){if(p.length>0)throw new Rt("Error modifying one or more objects",p,d,y);return e.length}))}))}))},e.prototype.delete=function(){var e=this._ctx,t=e.range;return mr(e)&&(e.isPrimKey&&!ar||3===t.type)?this._write((function(n){var r=e.table.core.schema.primaryKey,o=t;return e.table.core.count({trans:n,query:{index:r,range:o}}).then((function(t){return e.table.core.mutate({trans:n,type:"deleteRange",range:o}).then((function(e){var n=e.failures,r=(e.lastResult,e.results,e.numFailures);if(r)throw new Rt("Could not delete some values",Object.keys(n).map((function(e){return n[e]})),t-r);return t-r}))}))})):this.modify((function(e,t){return t.value=null}))},e}();function Or(e,t){return e<t?-1:e===t?0:1}function Pr(e,t){return e>t?-1:e===t?0:1}function Sr(e,t,n){var r=e instanceof Kr?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function jr(e){return new e.Collection(e,(function(){return Tr("")})).limit(0)}function Rr(e,t,n,r,o,i){for(var a=Math.min(e.length,r.length),u=-1,s=0;s<a;++s){var c=t[s];if(c!==r[s])return o(e[s],n[s])<0?e.substr(0,s)+n[s]+n.substr(s+1):o(e[s],r[s])<0?e.substr(0,s)+r[s]+n.substr(s+1):u>=0?e.substr(0,u)+t[u]+n.substr(u+1):null;o(e[s],c)<0&&(u=s)}return a<r.length&&"next"===i?e+n.substr(e.length):a<e.length&&"prev"===i?e.substr(0,n.length):u<0?null:e.substr(0,u)+r[u]+n.substr(u+1)}function Cr(e,t,n,r){var o,i,a,u,s,c,l,f=n.length;if(!n.every((function(e){return"string"==typeof e})))return Sr(e,nr);function h(e){o=function(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}(e),i=function(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}(e),a="next"===e?Or:Pr;var t=n.map((function(e){return{lower:i(e),upper:o(e)}})).sort((function(e,t){return a(e.lower,t.lower)}));u=t.map((function(e){return e.upper})),s=t.map((function(e){return e.lower})),c=e,l="next"===e?"":r}h("next");var p=new e.Collection(e,(function(){return Ar(u[0],s[f-1]+r)}));p._ondirectionchange=function(e){h(e)};var d=0;return p._addAlgorithm((function(e,n,r){var o=e.key;if("string"!=typeof o)return!1;var h=i(o);if(t(h,s,d))return!0;for(var p=null,y=d;y<f;++y){var v=Rr(o,h,u[y],s[y],a,c);null===v&&null===p?d=y+1:(null===p||a(p,v)>0)&&(p=v)}return n(null!==p?function(){e.continue(p+l)}:r),!1})),p}function Ar(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Tr(e){return{type:1,lower:e,upper:e}}var Kr=function(){function e(){}return Object.defineProperty(e.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!0,configurable:!0}),e.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?jr(this):new this.Collection(this,(function(){return Ar(e,t,!n,!r)}))}catch(e){return Sr(this,tr)}},e.prototype.equals=function(e){return null==e?Sr(this,tr):new this.Collection(this,(function(){return Tr(e)}))},e.prototype.above=function(e){return null==e?Sr(this,tr):new this.Collection(this,(function(){return Ar(e,void 0,!0)}))},e.prototype.aboveOrEqual=function(e){return null==e?Sr(this,tr):new this.Collection(this,(function(){return Ar(e,void 0,!1)}))},e.prototype.below=function(e){return null==e?Sr(this,tr):new this.Collection(this,(function(){return Ar(void 0,e,!1,!0)}))},e.prototype.belowOrEqual=function(e){return null==e?Sr(this,tr):new this.Collection(this,(function(){return Ar(void 0,e)}))},e.prototype.startsWith=function(e){return"string"!=typeof e?Sr(this,nr):this.between(e,e+Zn,!0,!0)},e.prototype.startsWithIgnoreCase=function(e){return""===e?this.startsWith(e):Cr(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],Zn)},e.prototype.equalsIgnoreCase=function(e){return Cr(this,(function(e,t){return e===t[0]}),[e],"")},e.prototype.anyOfIgnoreCase=function(){var e=vt.apply(yt,arguments);return 0===e.length?jr(this):Cr(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},e.prototype.startsWithAnyOfIgnoreCase=function(){var e=vt.apply(yt,arguments);return 0===e.length?jr(this):Cr(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,Zn)},e.prototype.anyOf=function(){var e=this,t=vt.apply(yt,arguments),n=this._cmp;try{t.sort(n)}catch(e){return Sr(this,tr)}if(0===t.length)return jr(this);var r=new this.Collection(this,(function(){return Ar(t[0],t[t.length-1])}));r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var o=0;return r._addAlgorithm((function(e,r,i){for(var a=e.key;n(a,t[o])>0;)if(++o===t.length)return r(i),!1;return 0===n(a,t[o])||(r((function(){e.continue(t[o])})),!1)})),r},e.prototype.notEqual=function(e){return this.inAnyRange([[er,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},e.prototype.noneOf=function(){var e=vt.apply(yt,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Sr(this,tr)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[er,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},e.prototype.inAnyRange=function(e,t){var n=this,r=this._cmp,o=this._ascending,i=this._descending,a=this._min,u=this._max;if(0===e.length)return jr(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&o(e[0],e[1])<=0})))return Sr(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Kt.InvalidArgument);var s,c=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,f=o;function h(e,t){return f(e[0],t[0])}try{(s=e.reduce((function(e,t){for(var n=0,o=e.length;n<o;++n){var i=e[n];if(r(t[0],i[1])<0&&r(t[1],i[0])>0){i[0]=a(i[0],t[0]),i[1]=u(i[1],t[1]);break}}return n===o&&e.push(t),e}),[])).sort(h)}catch(e){return Sr(this,tr)}var p=0,d=l?function(e){return o(e,s[p][1])>0}:function(e){return o(e,s[p][1])>=0},y=c?function(e){return i(e,s[p][0])>0}:function(e){return i(e,s[p][0])>=0},v=d,m=new this.Collection(this,(function(){return Ar(s[0][0],s[s.length-1][1],!c,!l)}));return m._ondirectionchange=function(e){"next"===e?(v=d,f=o):(v=y,f=i),s.sort(h)},m._addAlgorithm((function(e,t,r){for(var i=e.key;v(i);)if(++p===s.length)return t(r),!1;return!!function(e){return!d(e)&&!y(e)}(i)||(0===n._cmp(i,s[p][1])||0===n._cmp(i,s[p][0])||t((function(){f===o?e.continue(s[p][0]):e.continue(s[p][1])})),!1)})),m},e.prototype.startsWithAnyOf=function(){var e=vt.apply(yt,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?jr(this):this.inAnyRange(e.map((function(e){return[e,e+Zn]}))):Sr(this,"startsWithAnyOf() only works with strings")},e}();function qr(e){return 1===e.length?e[0]:e}function Dr(e){try{return e.only([[]]),[[]]}catch(e){return Zn}}function Ir(e){return Rn((function(t){return Br(t),e(t.target.error),!1}))}function Br(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var Fr=function(){function e(){}return e.prototype._lock=function(){return Qe(!ln.global),++this._reculock,1!==this._reculock||ln.global||(ln.lockOwnerFor=this),this},e.prototype._unlock=function(){if(Qe(!ln.global),0==--this._reculock)for(ln.global||(ln.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{zn(e[1],e[0])}catch(e){}}return this},e.prototype._locked=function(){return this._reculock&&ln.lockOwnerFor!==this},e.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(Qe(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new Kt.DatabaseClosed(r);case"MissingAPIError":throw new Kt.MissingAPI(r.message,r);default:throw new Kt.OpenFailed(r)}if(!this.active)throw new Kt.TransactionInactive;return Qe(null===this._completion._state),(e=this.idbtrans=e||n.transaction(qr(this.storeNames),this.mode)).onerror=Rn((function(n){Br(n),t._reject(e.error)})),e.onabort=Rn((function(n){Br(n),t.active&&t._reject(new Kt.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=Rn((function(){t.active=!1,t._resolve()})),this},e.prototype._promise=function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return Qn(new Kt.ReadOnly("Transaction is readonly"));if(!this.active)return Qn(new Kt.TransactionInactive);if(this._locked())return new dn((function(o,i){r._blockedFuncs.push([function(){r._promise(e,t,n).then(o,i)},ln])}));if(n)return In((function(){var e=new dn((function(e,n){r._lock();var o=t(e,n,r);o&&o.then&&o.then(e,n)}));return e.finally((function(){return r._unlock()})),e._lib=!0,e}));var o=new dn((function(e,n){var o=t(e,n,r);o&&o.then&&o.then(e,n)}));return o._lib=!0,o},e.prototype._root=function(){return this.parent?this.parent._root():this},e.prototype.waitFor=function(e){var t=this._root(),n=dn.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((function(){return n}));else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var o=t._waitingFor;return new dn((function(e,r){n.then((function(n){return t._waitingQueue.push(Rn(e.bind(null,n)))}),(function(e){return t._waitingQueue.push(Rn(r.bind(null,e)))})).finally((function(){t._waitingFor===o&&(t._waitingFor=null)}))}))},e.prototype.abort=function(){this.active&&this._reject(new Kt.Abort),this.active=!1},e.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(Ne(t,e))return t[e];var n=this.schema[e];if(!n)throw new Kt.NotFound("Table "+e+" not part of transaction");var r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r},e}();function Mr(e,t,n,r,o,i,a){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:i,src:(n&&!a?"&":"")+(r?"*":"")+(o?"++":"")+Nr(t)}}function Nr(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Ur(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:Je(n,(function(e){return[e.name,e]}))}}function Lr(e){return null==e?function(){}:"string"==typeof e?function(e){return 1===e.split(".").length?function(t){return t[e]}:function(t){return Ze(t,e)}}(e):function(t){return Ze(t,e)}}function Wr(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}function zr(e){return[].slice.call(e)}var Hr=0;function Gr(e){return null==e?":id":"string"==typeof e?e:"["+e.join("+")+"]"}function Vr(e,t,n,r){var o=t.cmp.bind(t);function i(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var t=e.lower,r=e.upper,o=e.lowerOpen,i=e.upperOpen;return void 0===t?void 0===r?null:n.upperBound(r,!!i):void 0===r?n.lowerBound(t,!!o):n.bound(t,r,!!o,!!i)}var a=function(e,t){var n=zr(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((function(e){return t.objectStore(e)})).map((function(e){var t=e.keyPath,n=e.autoIncrement,r=De(t),o=null==t,i={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:Lr(t)},indexes:zr(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,n=e.unique,r=e.multiEntry,o=e.keyPath,a={name:t,compound:De(o),keyPath:o,unique:n,multiEntry:r,extractKey:Lr(o)};return i[Gr(o)]=a,a})),getIndexByKeyPath:function(e){return i[Gr(e)]}};return i[":id"]=a.primaryKey,null!=t&&(i[Gr(t)]=a.primaryKey),a}))},hasGetAll:n.length>0&&"getAll"in t.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,r),u=a.schema,s=a.hasGetAll,c=u.tables.map((function(e){return function(e){var t=e.name;return{name:t,schema:e,mutate:function(n){var r=n.trans,o=n.type,a=n.keys,u=n.values,s=n.range,c=n.wantResults;return new Promise((function(n,l){n=Rn(n);var f=r.objectStore(t),h=null==f.keyPath,p="put"===o||"add"===o;if(!p&&"delete"!==o&&"deleteRange"!==o)throw new Error("Invalid operation type: "+o);var d=(a||u||{length:1}).length;if(a&&u&&a.length!==u.length)throw new Error("Given keys array must have same length as given values array.");if(0===d)return n({numFailures:0,failures:{},results:[],lastResult:void 0});var y,v=c&&Ke(a||Wr(e.primaryKey,{type:o,keys:a,values:u})),m=[],g=0,b=function(e){++g,Br(e),v&&(v[e.target._reqno]=void 0),m[e.target._reqno]=e.target.error},w=function(e){var t=e.target;v[t._reqno]=t.result};if("deleteRange"===o){if(4===s.type)return n({numFailures:g,failures:m,results:v,lastResult:void 0});y=3===s.type?f.clear():f.delete(i(s))}else{var _=p?h?[u,a]:[u,null]:[a,null],k=_[0],x=_[1];if(p)for(var E=0;E<d;++E)(y=x&&void 0!==x[E]?f[o](k[E],x[E]):f[o](k[E]))._reqno=E,v&&void 0===v[E]&&(y.onsuccess=w),y.onerror=b;else for(E=0;E<d;++E)(y=f[o](k[E]))._reqno=E,y.onerror=b}var O=function(e){var t=e.target.result;v&&(v[d-1]=t),n({numFailures:g,failures:m,results:v,lastResult:t})};y.onerror=function(e){b(e),O(e)},y.onsuccess=O}))},getMany:function(e){var n=e.trans,r=e.keys;return new Promise((function(e,o){e=Rn(e);for(var i,a=n.objectStore(t),u=r.length,s=new Array(u),c=0,l=0,f=function(t){var n=t.target;s[n._pos]=n.result,++l===c&&e(s)},h=Ir(o),p=0;p<u;++p)null!=r[p]&&((i=a.get(r[p]))._pos=p,i.onsuccess=f,i.onerror=h,++c);0===c&&e(s)}))},get:function(e){var n=e.trans,r=e.key;return new Promise((function(e,o){e=Rn(e);var i=n.objectStore(t).get(r);i.onsuccess=function(t){return e(t.target.result)},i.onerror=Ir(o)}))},query:function(e){return function(n){return new Promise((function(r,o){r=Rn(r);var a=n.trans,u=n.values,s=n.limit,c=n.query,l=s===1/0?void 0:s,f=c.index,h=c.range,p=a.objectStore(t),d=f.isPrimaryKey?p:p.index(f.name),y=i(h);if(0===s)return r({result:[]});if(e){var v=u?d.getAll(y,l):d.getAllKeys(y,l);v.onsuccess=function(e){return r({result:e.target.result})},v.onerror=Ir(o)}else{var m=0,g=u||!("openKeyCursor"in d)?d.openCursor(y):d.openKeyCursor(y),b=[];g.onsuccess=function(e){var t=g.result;return t?(b.push(u?t.value:t.primaryKey),++m===s?r({result:b}):void t.continue()):r({result:b})},g.onerror=Ir(o)}}))}}(s),openCursor:function(e){var n=e.trans,r=e.values,o=e.query,a=e.reverse,u=e.unique;return new Promise((function(e,s){e=Rn(e);var c=o.index,l=o.range,f=n.objectStore(t),h=c.isPrimaryKey?f:f.index(c.name),p=a?u?"prevunique":"prev":u?"nextunique":"next",d=r||!("openKeyCursor"in h)?h.openCursor(i(l),p):h.openKeyCursor(i(l),p);d.onerror=Ir(s),d.onsuccess=Rn((function(t){var r=d.result;if(r){r.___id=++Hr,r.done=!1;var o=r.continue.bind(r),i=r.continuePrimaryKey;i&&(i=i.bind(r));var a=r.advance.bind(r),u=function(){throw new Error("Cursor not stopped")};r.trans=n,r.stop=r.continue=r.continuePrimaryKey=r.advance=function(){throw new Error("Cursor not started")},r.fail=Rn(s),r.next=function(){var e=this,t=1;return this.start((function(){return t--?e.continue():e.stop()})).then((function(){return e}))},r.start=function(e){var t=new Promise((function(e,t){e=Rn(e),d.onerror=Ir(t),r.fail=t,r.stop=function(t){r.stop=r.continue=r.continuePrimaryKey=r.advance=u,e(t)}})),n=function(){if(d.result)try{e()}catch(e){r.fail(e)}else r.done=!0,r.start=function(){throw new Error("Cursor behind last entry")},r.stop()};return d.onsuccess=Rn((function(e){d.onsuccess=n,n()})),r.continue=o,r.continuePrimaryKey=i,r.advance=a,n(),t},e(r)}else e(null)}),s)}))},count:function(e){var n=e.query,r=e.trans,o=n.index,a=n.range;return new Promise((function(e,n){var u=r.objectStore(t),s=o.isPrimaryKey?u:u.index(o.name),c=i(a),l=c?s.count(c):s.count();l.onsuccess=Rn((function(t){return e(t.target.result)})),l.onerror=Ir(n)}))}}}(e)})),l={};return c.forEach((function(e){return l[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!l[e])throw new Error("Table '"+e+"' not found");return l[e]},cmp:o,MIN_KEY:-1/0,MAX_KEY:Dr(n),schema:u}}function $r(e,t){var n=t.db,r=function(e,t,n,r){var o=n.IDBKeyRange;return{dbcore:function(e,t){return t.reduce((function(e,t){var n=t.create;return Te(Te({},e),n(e))}),e)}(Vr(t,n.indexedDB,o,r),e.dbcore)}}(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach((function(t){var n=t.name;e.core.schema.tables.some((function(e){return e.name===n}))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function Yr(e,t,n,r){n.forEach((function(n){var o=r[n];t.forEach((function(t){var r=Ge(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?We(t,n,{get:function(){return this.table(n)},set:function(e){Le(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,o))}))}))}function Qr(e,t){t.forEach((function(t){for(var n in t)t[n]instanceof e.Table&&delete t[n]}))}function Xr(e,t){return e._cfg.version-t._cfg.version}function Jr(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var o=e[n],i=t[n];if(o){var a={name:n,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto&&!or)a.recreate=!0,r.change.push(a);else{var u=o.idxByName,s=i.idxByName,c=void 0;for(c in u)s[c]||a.del.push(c);for(c in s){var l=u[c],f=s[c];l?l.src!==f.src&&a.change.push(f):a.add.push(f)}(a.del.length>0||a.add.length>0||a.change.length>0)&&r.change.push(a)}}else r.add.push([n,i])}return r}function Zr(e,t,n,r){var o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(e){return eo(o,e)})),o}function eo(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function to(e,t,n){var r={};return $e(t.objectStoreNames,0).forEach((function(e){for(var t=n.objectStore(e),o=t.keyPath,i=Mr(Nr(o),o||"",!1,!1,!!t.autoIncrement,o&&"string"!=typeof o,!0),a=[],u=0;u<t.indexNames.length;++u){var s=t.index(t.indexNames[u]);o=s.keyPath;var c=Mr(s.name,o,!!s.unique,!!s.multiEntry,!1,o&&"string"!=typeof o,!1);a.push(c)}r[e]=Ur(e,i,a)})),r}function no(e,t,n){for(var r=n.db.objectStoreNames,o=0;o<r.length;++o){var i=r[o],a=n.objectStore(i);e._hasGetAll="getAll"in a;for(var u=0;u<a.indexNames.length;++u){var s=a.indexNames[u],c=a.index(s).keyPath,l="string"==typeof c?c:"["+$e(c).join("+")+"]";if(t[i]){var f=t[i].idxByName[l];f&&(f.name=s,delete t[i].idxByName[l],t[i].idxByName[s]=f)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&Ie.WorkerGlobalScope&&Ie instanceof Ie.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}var ro,oo=function(){function e(){}return e.prototype._parseStoresSpec=function(e,t){qe(e).forEach((function(n){if(null!==e[n]){var r=e[n].split(",").map((function(e,t){var n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return Mr(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),De(r),0===t)})),o=r.shift();if(o.multi)throw new Kt.Schema("Primary key cannot be multi-valued");r.forEach((function(e){if(e.auto)throw new Kt.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Kt.Schema("Index must have a name and cannot be an empty string")})),t[n]=Ur(n,o,r)}}))},e.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?Be(this._cfg.storesSource,e):e;var n=t._versions,r={},o={};return n.forEach((function(e){Be(r,e._cfg.storesSource),o=e._cfg.dbschema={},e._parseStoresSpec(r,o)})),t._dbSchema=o,Qr(t,[t._allTables,t,t.Transaction.prototype]),Yr(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],qe(o),o),t._storeNames=qe(o),this},e.prototype.upgrade=function(e){return this._cfg.contentUpgrade=e,this},e}();function io(e){return In((function(){return ln.letThrough=!0,e()}))}function ao(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((function(){return t.dbOpenError?Qn(t.dbOpenError):e}));gt&&(t.openCanceller._stackHolder=kt()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.dbReadyResolve,o=null;return dn.race([t.openCanceller,new dn((function(r,i){if(!n)throw new Kt.MissingAPI("indexedDB API not found. If using IE10+, make sure to run your code on a server URL (not locally). If using old Safari versions, make sure to include indexedDB polyfill.");var a=e.name,u=t.autoSchema?n.open(a):n.open(a,Math.round(10*e.verno));if(!u)throw new Kt.MissingAPI("IndexedDB API not available");u.onerror=Ir(i),u.onblocked=Rn(e._fireOnBlocked),u.onupgradeneeded=Rn((function(r){if(o=u.transaction,t.autoSchema&&!e._options.allowEmptyDB){u.onerror=Br,o.abort(),u.result.close();var s=n.deleteDatabase(a);s.onsuccess=s.onerror=Rn((function(){i(new Kt.NoSuchDatabase("Database "+a+" doesnt exist"))}))}else{o.onerror=Ir(i);var c=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;e.idbdb=u.result,function(e,t,n,r){var o=e._dbSchema,i=e._createTransaction("readwrite",e._storeNames,o);i.create(n),i._completion.catch(r);var a=i._reject.bind(i),u=ln.transless||ln;In((function(){ln.trans=i,ln.transless=u,0===t?(qe(o).forEach((function(e){Zr(n,e,o[e].primKey,o[e].indexes)})),$r(e,n),dn.follow((function(){return e.on.populate.fire(i)})).catch(a)):function(e,t,n,r){var o=[],i=e._versions,a=e._dbSchema=to(0,e.idbdb,r),u=!1;return i.filter((function(e){return e._cfg.version>=t})).forEach((function(i){o.push((function(){var o=a,s=i._cfg.dbschema;no(e,o,r),no(e,s,r),a=e._dbSchema=s;var c=Jr(o,s);c.add.forEach((function(e){Zr(r,e[0],e[1].primKey,e[1].indexes)})),c.change.forEach((function(e){if(e.recreate)throw new Kt.Upgrade("Not yet support for changing primary key");var t=r.objectStore(e.name);e.add.forEach((function(e){return eo(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),eo(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var l=i._cfg.contentUpgrade;if(l&&i._cfg.version>t){$r(e,r),n._memoizedTables={},u=!0;var f=nt(s);c.del.forEach((function(e){f[e]=o[e]})),Qr(e,[e.Transaction.prototype]),Yr(e,[e.Transaction.prototype],qe(f),f),n.schema=f;var h,p=mt(l);p&&Bn();var d=dn.follow((function(){if((h=l(n))&&p){var e=Fn.bind(null,null);h.then(e,e)}}));return h&&"function"==typeof h.then?dn.resolve(h):d.then((function(){return h}))}})),o.push((function(t){u&&ir||function(e,t){for(var n=0;n<t.db.objectStoreNames.length;++n){var r=t.db.objectStoreNames[n];null==e[r]&&t.db.deleteObjectStore(r)}}(i._cfg.dbschema,t),Qr(e,[e.Transaction.prototype]),Yr(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}))})),function e(){return o.length?dn.resolve(o.shift()(n.idbtrans)).then(e):dn.resolve()}().then((function(){var e,t;t=r,qe(e=a).forEach((function(n){t.db.objectStoreNames.contains(n)||Zr(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,i,n).catch(a)}))}(e,c/10,o,i)}}),i),u.onsuccess=Rn((function(){o=null;var n=e.idbdb=u.result,i=$e(n.objectStoreNames);if(i.length>0)try{var s=n.transaction(qr(i),"readonly");t.autoSchema?function(e,t,n){e.verno=t.version/10;var r=e._dbSchema=to(0,t,n);e._storeNames=$e(t.objectStoreNames,0),Yr(e,[e._allTables],qe(r),r)}(e,n,s):(no(e,e._dbSchema,s),function(e,t){var n=Jr(to(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some((function(e){return e.add.length||e.change.length})))}(e,s)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),$r(e,s)}catch(e){}rr.push(e),n.onversionchange=Rn((function(n){t.vcFired=!0,e.on("versionchange").fire(n)})),ro.add(a),r()}),i)}))]).then((function(){return t.onReadyBeingFired=[],dn.resolve(io(e.on.ready.fire)).then((function e(){if(t.onReadyBeingFired.length>0){var n=t.onReadyBeingFired.reduce(zt,It);return t.onReadyBeingFired=[],dn.resolve(io(n)).then(e)}}))})).finally((function(){t.onReadyBeingFired=null})).then((function(){return t.isBeingOpened=!1,e})).catch((function(n){try{o&&o.abort()}catch(e){}return t.isBeingOpened=!1,e.close(),t.dbOpenError=n,Qn(t.dbOpenError)})).finally((function(){t.openComplete=!0,r()}))}function uo(e){var t=function(t){return e.next(t)},n=o(t),r=o((function(t){return e.throw(t)}));function o(e){return function(t){var o=e(t),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):De(i)?Promise.all(i).then(n,r):n(i)}}return o(t)()}function so(e,t,n){var r=arguments.length;if(r<2)throw new Kt.InvalidArgument("Too few arguments");for(var o=new Array(r-1);--r;)o[r-1]=arguments[r];n=o.pop();var i=ot(o);return[e,i,n]}function co(e,t,n,r,o){return dn.resolve().then((function(){var i=ln.transless||ln,a=e._createTransaction(t,n,e._dbSchema,r),u={trans:a,transless:i};r?a.idbtrans=r.idbtrans:a.create();var s,c=mt(o);c&&Bn();var l=dn.follow((function(){if(s=o.call(a,a))if(c){var e=Fn.bind(null,null);s.then(e,e)}else"function"==typeof s.next&&"function"==typeof s.throw&&(s=uo(s))}),u);return(s&&"function"==typeof s.then?dn.resolve(s).then((function(e){return a.active?e:Qn(new Kt.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):l.then((function(){return s}))).then((function(e){return r&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),Qn(e)}))}))}function lo(e,t,n){for(var r=De(e)?e.slice():[e],o=0;o<n;++o)r.push(t);return r}var fo={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return Te(Te({},e),{table:function(t){var n=e.table(t),r=n.schema,o={},i=[];function a(e,t,n){var r=Gr(e),u=o[r]=o[r]||[],s=null==e?0:"string"==typeof e?1:e.length,c=t>0,l=Te(Te({},n),{isVirtual:c,isPrimaryKey:!c&&n.isPrimaryKey,keyTail:t,keyLength:s,extractKey:Lr(e),unique:!c&&n.unique});return u.push(l),l.isPrimaryKey||i.push(l),s>1&&a(2===s?e[0]:e.slice(0,s-1),t+1,n),u.sort((function(e,t){return e.keyTail-t.keyTail})),l}var u=a(r.primaryKey.keyPath,0,r.primaryKey);o[":id"]=[u];for(var s=0,c=r.indexes;s<c.length;s++){var l=c[s];a(l.keyPath,0,l)}function f(t){var n,r,o=t.query.index;return o.isVirtual?Te(Te({},t),{query:{index:o,range:(n=t.query.range,r=o.keyTail,{type:1===n.type?2:n.type,lower:lo(n.lower,n.lowerOpen?e.MAX_KEY:e.MIN_KEY,r),lowerOpen:!0,upper:lo(n.upper,n.upperOpen?e.MIN_KEY:e.MAX_KEY,r),upperOpen:!0})}}):t}return Te(Te({},n),{schema:Te(Te({},r),{primaryKey:u,indexes:i,getIndexByKeyPath:function(e){var t=o[Gr(e)];return t&&t[0]}}),count:function(e){return n.count(f(e))},query:function(e){return n.query(f(e))},openCursor:function(t){var r=t.query.index,o=r.keyTail,i=r.isVirtual,a=r.keyLength;return i?n.openCursor(f(t)).then((function(n){return n&&function(n){return Object.create(n,{continue:{value:function(r){null!=r?n.continue(lo(r,t.reverse?e.MAX_KEY:e.MIN_KEY,o)):t.unique?n.continue(lo(n.key,t.reverse?e.MIN_KEY:e.MAX_KEY,o)):n.continue()}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(lo(t,e.MAX_KEY,o),r)}},key:{get:function(){var e=n.key;return 1===a?e[0]:e.slice(0,a)}},value:{get:function(){return n.value}}})}(n)})):n.openCursor(t)}})}})}},ho={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return Te(Te({},e),{table:function(t){var n=e.table(t),r=n.schema.primaryKey;return Te(Te({},n),{mutate:function(e){var o=ln.trans,i=o.table(t).hook,a=i.deleting,u=i.creating,s=i.updating;switch(e.type){case"add":if(u.fire===It)break;return o._promise("readwrite",(function(){return c(e)}),!0);case"put":if(u.fire===It&&s.fire===It)break;return o._promise("readwrite",(function(){return c(e)}),!0);case"delete":if(a.fire===It)break;return o._promise("readwrite",(function(){return c(e)}),!0);case"deleteRange":if(a.fire===It)break;return o._promise("readwrite",(function(){return function(e){return l(e.trans,e.range,1e4)}(e)}),!0)}return n.mutate(e);function c(e){var t=ln.trans,o=e.keys||Wr(r,e);if(!o)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?Te(Te({},e),{keys:o,wantResults:!0}):Te({},e)).type&&(e.values=Ke(e.values)),e.keys&&(e.keys=Ke(e.keys)),function(e,t,n){return"add"===t.type?Promise.resolve(new Array(t.values.length)):e.getMany({trans:t.trans,keys:n})}(n,e,o).then((function(i){var c=o.map((function(n,o){var c=i[o],l={onerror:null,onsuccess:null};if("delete"===e.type)a.fire.call(l,n,c,t);else if("add"===e.type||void 0===c){var f=u.fire.call(l,n,e.values[o],t);null==n&&null!=f&&(n=f,e.keys[o]=n,r.outbound||et(e.values[o],r.keyPath,n))}else{var h=ht(c,e.values[o]),p=s.fire.call(l,h,n,c,t);if(p){var d=e.values[o];Object.keys(p).forEach((function(e){Ne(d,e)?d[e]=p[e]:et(d,e,p[e])}))}}return l}));return n.mutate(e).then((function(t){for(var n=t.failures,r=t.results,a=t.numFailures,u=t.lastResult,s=0;s<o.length;++s){var l=r?r[s]:o[s],f=c[s];null==l?f.onerror&&f.onerror(n[s]):f.onsuccess&&f.onsuccess("put"===e.type&&i[s]?e.values[s]:l)}return{failures:n,results:r,numFailures:a,lastResult:u}})).catch((function(e){return c.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))}function l(e,t,o){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:o}).then((function(n){var r=n.result;return c({type:"delete",keys:r,trans:e}).then((function(n){return n.numFailures>0?Promise.reject(n.failures[0]):r.length<o?{failures:[],numFailures:0,lastResult:void 0}:l(e,Te(Te({},t),{lower:r[r.length-1],lowerOpen:!0}),o)}))}))}}})}})}},po=function(){function e(t,n){var r=this;this._middlewares={},this.verno=0;var o=e.dependencies;this._options=n=Te({addons:e.addons,autoOpen:!0,indexedDB:o.indexedDB,IDBKeyRange:o.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};var i=n.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null;var a,u={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:It,dbReadyPromise:null,cancelOpen:It,openCanceller:null,autoSchema:!0};u.dbReadyPromise=new dn((function(e){u.dbReadyResolve=e})),u.openCanceller=new dn((function(e,t){u.cancelOpen=t})),this._state=u,this.name=t,this.on=yr(this,"populate","blocked","versionchange",{ready:[zt,It]}),this.on.ready.subscribe=Ye(this.on.ready.subscribe,(function(t){return function(n,o){e.vip((function(){var e=r._state;if(e.openComplete)e.dbOpenError||dn.resolve().then(n),o&&t(n);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(n),o&&t(n);else{t(n);var i=r;o||t((function e(){i.on.ready.unsubscribe(n),i.on.ready.unsubscribe(e)}))}}))}})),this.Collection=(a=this,vr(Er.prototype,(function(e,t){this.db=a;var n=hr,r=null;if(t)try{n=t()}catch(e){r=e}var o=e._ctx,i=o.table,u=i.hook.reading.fire;this._ctx={table:i,index:o.index,isPrimKey:!o.index||i.schema.primKey.keyPath&&o.index===i.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:o.or,valueMapper:u!==Bt?u:null}}))),this.Table=function(e){return vr(dr.prototype,(function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:yr(null,{creating:[Nt,It],reading:[Ft,Bt],updating:[Lt,It],deleting:[Ut,It]})}))}(this),this.Transaction=function(e){return vr(Fr.prototype,(function(t,n,r,o){var i=this;this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.idbtrans=null,this.on=yr(this,"complete","error","abort"),this.parent=o||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new dn((function(e,t){i._resolve=e,i._reject=t})),this._completion.then((function(){i.active=!1,i.on.complete.fire()}),(function(e){var t=i.active;return i.active=!1,i.on.error.fire(e),i.parent?i.parent._reject(e):t&&i.idbtrans&&i.idbtrans.abort(),Qn(e)}))}))}(this),this.Version=function(e){return vr(oo.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return vr(Kr.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};var o=e._deps.indexedDB;if(!o)throw new Kt.MissingAPI("indexedDB API missing");this._cmp=this._ascending=o.cmp.bind(o),this._descending=function(e,t){return o.cmp(t,e)},this._max=function(e,t){return o.cmp(e,t)>0?e:t},this._min=function(e,t){return o.cmp(e,t)<0?e:t},this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database '"+r.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+r.name+"'. Closing db now to resume the delete request."),r.close()})),this.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('"+r.name+"') was blocked"):console.warn("Upgrade '"+r.name+"' blocked by other connection holding version "+e.oldVersion/10)})),this._maxKey=Dr(n.IDBKeyRange),this._createTransaction=function(e,t,n,o){return new r.Transaction(e,t,n,o)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),rr.filter((function(e){return e.name===r.name&&e!==r&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(fo),this.use(ho),i.forEach((function(e){return e(r)}))}return e.prototype.version=function(e){if(isNaN(e)||e<.1)throw new Kt.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Kt.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter((function(t){return t._cfg.version===e}))[0];return n||(n=new this.Version(e),t.push(n),t.sort(Xr),n.stores({}),this._state.autoSchema=!1,n)},e.prototype._whenReady=function(e){var t=this;return this._state.openComplete||ln.letThrough?e():new dn((function(e,n){if(!t._state.isBeingOpened){if(!t._options.autoOpen)return void n(new Kt.DatabaseClosed);t.open().catch(It)}t._state.dbReadyPromise.then(e,n)})).then(e)},e.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,o=e.name;o&&this.unuse({stack:t,name:o});var i=this._middlewares[t]||(this._middlewares[t]=[]);return i.push({stack:t,create:n,level:null==r?10:r,name:o}),i.sort((function(e,t){return e.level-t.level})),this},e.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((function(e){return r?e.create!==r:!!n&&e.name!==n}))),this},e.prototype.open=function(){return ao(this)},e.prototype.close=function(){var e=rr.indexOf(this),t=this._state;if(e>=0&&rr.splice(e,1),this.idbdb){try{this.idbdb.close()}catch(e){}this.idbdb=null}this._options.autoOpen=!1,t.dbOpenError=new Kt.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError),t.dbReadyPromise=new dn((function(e){t.dbReadyResolve=e})),t.openCanceller=new dn((function(e,n){t.cancelOpen=n}))},e.prototype.delete=function(){var e=this,t=arguments.length>0,n=this._state;return new dn((function(r,o){var i=function(){e.close();var t=e._deps.indexedDB.deleteDatabase(e.name);t.onsuccess=Rn((function(){ro.remove(e.name),r()})),t.onerror=Ir(o),t.onblocked=e._fireOnBlocked};if(t)throw new Kt.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(i):i()}))},e.prototype.backendDB=function(){return this.idbdb},e.prototype.isOpen=function(){return null!==this.idbdb},e.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name},e.prototype.hasFailed=function(){return null!==this._state.dbOpenError},e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(e.prototype,"tables",{get:function(){var e=this;return qe(this._allTables).map((function(t){return e._allTables[t]}))},enumerable:!0,configurable:!0}),e.prototype.transaction=function(){var e=so.apply(this,arguments);return this._transaction.apply(this,e)},e.prototype._transaction=function(e,t,n){var r=this,o=ln.trans;o&&o.db===this&&-1===e.indexOf("!")||(o=null);var i,a,u=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(a=t.map((function(e){var t=e instanceof r.Table?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||e===cr)i=cr;else{if("rw"!=e&&e!=lr)throw new Kt.InvalidArgument("Invalid transaction mode: "+e);i=lr}if(o){if(o.mode===cr&&i===lr){if(!u)throw new Kt.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&a.forEach((function(e){if(o&&-1===o.storeNames.indexOf(e)){if(!u)throw new Kt.SubTransaction("Table "+e+" not included in parent transaction.");o=null}})),u&&o&&!o.active&&(o=null)}}catch(e){return o?o._promise(null,(function(t,n){n(e)})):Qn(e)}var s=co.bind(null,this,i,a,o,n);return o?o._promise(i,s,"lock"):ln.trans?zn(ln.transless,(function(){return r._whenReady(s)})):this._whenReady(s)},e.prototype.table=function(e){if(!Ne(this._allTables,e))throw new Kt.InvalidTable("Table "+e+" does not exist");return this._allTables[e]},e}(),yo=po;Ue(yo,Te(Te({},Dt),{delete:function(e){return new yo(e).delete()},exists:function(e){return new yo(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){return ro?ro.getDatabaseNames().then(e):dn.resolve([])},defineClass:function(){return function(e){Be(this,e)}},ignoreTransaction:function(e){return ln.trans?zn(ln.transless,e):e()},vip:io,async:function(e){return function(){try{var t=uo(e.apply(this,arguments));return t&&"function"==typeof t.then?t:dn.resolve(t)}catch(e){return Qn(e)}}},spawn:function(e,t,n){try{var r=uo(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:dn.resolve(r)}catch(e){return Qn(e)}},currentTransaction:{get:function(){return ln.trans||null}},waitFor:function(e,t){var n=dn.resolve("function"==typeof e?yo.ignoreTransaction(e):e).timeout(t||6e4);return ln.trans?ln.trans.waitFor(n):n},Promise:dn,debug:{get:function(){return gt},set:function(e){bt(e,"dexie"===e?function(){return!0}:ur)}},derive:ze,extend:Be,props:Ue,override:Ye,Events:yr,getByKeyPath:Ze,setByKeyPath:et,delByKeyPath:tt,shallowClone:nt,deepClone:st,getObjectDiff:ht,asap:Xe,minKey:er,addons:[],connections:rr,errnames:At,dependencies:function(){try{return{indexedDB:Ie.indexedDB||Ie.mozIndexedDB||Ie.webkitIndexedDB||Ie.msIndexedDB,IDBKeyRange:Ie.IDBKeyRange||Ie.webkitIDBKeyRange}}catch(e){return{indexedDB:null,IDBKeyRange:null}}}(),semVer:Jn,version:Jn.split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,n){return e+t/Math.pow(10,2*n)})),default:yo,Dexie:yo})),yo.maxKey=Dr(yo.dependencies.IDBKeyRange),function(e){try{ro=function(e){var t,n=e&&"function"==typeof e.databases;if(!n){var r=new po(sr,{addons:[]});r.version(1).stores({dbnames:"name"}),t=r.table("dbnames")}return{getDatabaseNames:function(){return n?dn.resolve(e.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return e!==sr}))})):t.toCollection().primaryKeys()},add:function(e){return!n&&e!==sr&&t.put({name:e}).catch(It)},remove:function(e){return!n&&e!==sr&&t.delete(e).catch(It)}}}(e)}catch(e){}}(po.dependencies.indexedDB),dn.rejectionMapper=function(e,t){if(!e||e instanceof St||e instanceof TypeError||e instanceof SyntaxError||!e.name||!qt[e.name])return e;var n=new qt[e.name](t||e.message,e);return"stack"in e&&We(n,"stack",{get:function(){return this.inner.stack}}),n},bt(gt,ur);var vo,mo=(vo=function(e,t){return(vo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}vo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),go=function(e){function t(){var t=e.call(this,"ServiceWorker")||this;return t.version(1).stores({dynamicRouteRegistrations:"++,&pattern"}),t.dynamicRouteRegistrations=t.table("dynamicRouteRegistrations"),t}return mo(t,e),t}(po),bo=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},wo=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};function _o(e){return bo(this,void 0,void 0,(function(){var t;return wo(this,(function(n){switch(n.label){case 0:return[4,Ce(e)];case 1:return[4,xo(t=n.sent())];case 2:return n.sent(),[4,ko(t)];case 3:return n.sent(),[2]}}))}))}function ko(e){return bo(this,void 0,void 0,(function(){var t,n,r,o,i=this;return wo(this,(function(a){switch(a.label){case 0:return 0===e.length?[2]:[4,caches.open(pe)];case 1:return t=a.sent(),[4,Promise.all(e.map((function(e){return bo(i,void 0,void 0,(function(){return wo(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,R((function(){return t.add(e)}),{onError:function(t,n){return console.debug("Failure attempt "+n+' at caching "'+e+'". Error: ',t)}})];case 1:return n.sent(),[2,{url:e,success:!0}];case 2:return n.sent(),[2,{url:e,success:!1}];case 3:return[2]}}))}))})))];case 2:return n=a.sent(),r=n.filter((function(e){return e.success})),o=n.filter((function(e){return!e.success})),r.length>0&&console.debug("Successfully added "+r.length+" URLs to the OMRS cache. URLs: ",r.map((function(e){return e.url}))),o.length>0&&console.error("Failed to cache "+o.length+" URLs. URLs: ",o.map((function(e){return e.url}))),[2]}}))}))}function xo(e){return bo(this,void 0,void 0,(function(){var t,n,r,o;return wo(this,(function(i){switch(i.label){case 0:return[4,caches.open(pe)];case 1:return[4,(t=i.sent()).keys()];case 2:return n=i.sent().map((function(e){return e.url})),[4,(new go).dynamicRouteRegistrations.toArray()];case 3:return r=i.sent(),o=n.filter((function(t){return!ve.includes(t)&&!e.includes(t)&&!r.some((function(e){return new RegExp(e.pattern).test(t)}))})),console.info("Removing the following expired URLs from the cache: ",o),console.debug("The following URLs were known and not invalidated: ",ve,e,r),[4,Promise.all(o.map((function(e){return t.delete(e)})))];case 4:return i.sent(),[2]}}))}))}var Eo=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},Oo=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Po={onImportMapChanged:function(e){var t=e.importMap;return Eo(this,void 0,void 0,(function(){return Oo(this,(function(e){switch(e.label){case 0:return[4,_o(t)];case 1:return e.sent(),[2]}}))}))},clearDynamicRoutes:function(){return Eo(this,void 0,void 0,(function(){return Oo(this,(function(e){switch(e.label){case 0:return[4,(new go).dynamicRouteRegistrations.clear()];case 1:return e.sent(),[2]}}))}))},registerDynamicRoute:function(e){var t=e.pattern,n=e.url;return Eo(this,void 0,void 0,(function(){var e,r;return Oo(this,(function(o){switch(o.label){case 0:return!(e=t)&&n&&(e="^"+P(n)+"$"),e?(r={pattern:e},[4,(new go).dynamicRouteRegistrations.put(r)]):[3,2];case 1:o.sent(),o.label=2;case 2:return[2]}}))}))}};n(306);const So=["DELETE","GET","HEAD","PATCH","POST","PUT"],jo=e=>e&&"object"==typeof e?e:{handle:e};class Ro{constructor(e,t,n="GET"){this.handler=jo(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=jo(e)}}class Co extends Ro{constructor(e,t,n){super((({url:t})=>{const n=e.exec(t.href);if(n&&(t.origin===location.origin||0===n.index))return n.slice(1)}),t,n)}}class Ao{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&"CACHE_URLS"===e.data.type){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map((t=>{"string"==typeof t&&(t=[t]);const n=new Request(...t);return this.handleRequest({request:n,event:e})})));e.waitUntil(n),e.ports&&e.ports[0]&&n.then((()=>e.ports[0].postMessage(!0)))}}))}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const r=n.origin===location.origin,{params:o,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n});let a=i&&i.handler;const u=e.method;if(!a&&this._defaultHandlerMap.has(u)&&(a=this._defaultHandlerMap.get(u)),!a)return;let s;try{s=a.handle({url:n,request:e,event:t,params:o})}catch(e){s=Promise.reject(e)}const c=i&&i.catchHandler;return s instanceof Promise&&(this._catchHandler||c)&&(s=s.catch((async r=>{if(c)try{return await c.handle({url:n,request:e,event:t,params:o})}catch(e){e instanceof Error&&(r=e)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw r}))),s}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){const o=this._routes.get(n.method)||[];for(const i of o){let o;const a=i.match({url:e,sameOrigin:t,request:n,event:r});if(a)return o=a,(Array.isArray(o)&&0===o.length||a.constructor===Object&&0===Object.keys(a).length||"boolean"==typeof a)&&(o=void 0),{route:i,params:o}}return{}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,jo(e))}setCatchHandler(e){this._catchHandler=jo(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(t){if(!this._routes.has(t.method))throw new e("unregister-route-but-not-found-with-method",{method:t.method});const n=this._routes.get(t.method).indexOf(t);if(!(n>-1))throw new e("unregister-route-route-not-registered");this._routes.get(t.method).splice(n,1)}}let To;const Ko=()=>(To||(To=new Ao,To.addFetchListener(),To.addCacheListener()),To);function qo(e){return"string"==typeof e?new Request(e):e}n(781);class Do{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new a,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(t){const{event:n}=this;let r=qo(t);if("navigate"===r.mode&&n instanceof FetchEvent&&n.preloadResponse){const e=await n.preloadResponse;if(e)return e}const o=this.hasCallback("fetchDidFail")?r.clone():null;try{for(const e of this.iterateCallbacks("requestWillFetch"))r=await e({request:r.clone(),event:n})}catch(t){if(t instanceof Error)throw new e("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const i=r.clone();try{let e;e=await fetch(r,"navigate"===r.mode?void 0:this._strategy.fetchOptions);for(const t of this.iterateCallbacks("fetchDidSucceed"))e=await t({event:n,request:i,response:e});return e}catch(e){throw o&&await this.runCallbacks("fetchDidFail",{error:e,event:n,originalRequest:o.clone(),request:i.clone()}),e}}async fetchAndCachePut(e){const t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){const t=qo(e);let n;const{cacheName:r,matchOptions:o}=this._strategy,i=await this.getCacheKey(t,"read"),a=Object.assign(Object.assign({},o),{cacheName:r});n=await caches.match(i,a);for(const e of this.iterateCallbacks("cachedResponseWillBeUsed"))n=await e({cacheName:r,matchOptions:o,cachedResponse:n,request:i,event:this.event})||void 0;return n}async cachePut(n,r){const o=qo(n);await u(0);const a=await this.getCacheKey(o,"write");if(!r)throw new e("cache-put-with-no-response",{url:(s=a.url,new URL(String(s),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var s;const c=await this._ensureResponseSafeToCache(r);if(!c)return!1;const{cacheName:l,matchOptions:f}=this._strategy,h=await self.caches.open(l),p=this.hasCallback("cacheDidUpdate"),d=p?await async function(e,t,n,r){const o=i(t.url,n);if(t.url===o)return e.match(t,r);const a=Object.assign(Object.assign({},r),{ignoreSearch:!0}),u=await e.keys(t,a);for(const t of u)if(o===i(t.url,n))return e.match(t,r)}(h,a.clone(),["__WB_REVISION__"],f):null;try{await h.put(a,p?c.clone():c)}catch(e){if(e instanceof Error)throw"QuotaExceededError"===e.name&&await async function(){for(const e of t)await e()}(),e}for(const e of this.iterateCallbacks("cacheDidUpdate"))await e({cacheName:l,oldResponse:d,newResponse:c.clone(),request:a,event:this.event});return!0}async getCacheKey(e,t){if(!this._cacheKeys[t]){let n=e;for(const e of this.iterateCallbacks("cacheKeyWillBeUsed"))n=qo(await e({mode:t,request:n,event:this.event,params:this.params}));this._cacheKeys[t]=n}return this._cacheKeys[t]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if("function"==typeof t[e]){const n=this._pluginStateMap.get(t),r=r=>{const o=Object.assign(Object.assign({},r),{state:n});return t[e](o)};yield r}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(const e of this.iterateCallbacks("cacheWillUpdate"))if(t=await e({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&200!==t.status&&(t=void 0),t}}class Io{constructor(e={}){this.cacheName=o(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,n="string"==typeof e.request?new Request(e.request):e.request,r="params"in e?e.params:void 0,o=new Do(this,{event:t,request:n,params:r}),i=this._getResponse(o,n,t);return[i,this._awaitComplete(i,o,n,t)]}async _getResponse(t,n,r){let o;await t.runCallbacks("handlerWillStart",{event:r,request:n});try{if(o=await this._handle(n,t),!o||"error"===o.type)throw new e("no-response",{url:n.url})}catch(e){if(e instanceof Error)for(const i of t.iterateCallbacks("handlerDidError"))if(o=await i({error:e,event:r,request:n}),o)break;if(!o)throw e}for(const e of t.iterateCallbacks("handlerWillRespond"))o=await e({event:r,request:n,response:o});return o}async _awaitComplete(e,t,n,r){let o,i;try{o=await e}catch(i){}try{await t.runCallbacks("handlerDidRespond",{event:r,request:n,response:o}),await t.doneWaiting()}catch(e){e instanceof Error&&(i=e)}if(await t.runCallbacks("handlerDidComplete",{event:r,request:n,response:o,error:i}),t.destroy(),i)throw i}}const Bo={cacheWillUpdate:async({response:e})=>200===e.status||0===e.status?e:null};function Fo(e){return t=this,n=void 0,o=function(){var t,n,r;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(o){switch(o.label){case 0:return[4,self.clients.matchAll({type:"window"})];case 1:for(t=o.sent(),n=0,r=t;n<r.length;n++)r[n].postMessage(e);return[2]}}))},new((r=void 0)||(r=Promise))((function(e,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function u(e){try{s(o.throw(e))}catch(e){i(e)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,u)}s((o=o.apply(t,n||[])).next())}));var t,n,r,o}function Mo(e){var t;return null!==(t=Uo(e,"x-omrs-offline-response-body"))&&void 0!==t?t:void 0}function No(e){var t,n=+(null!==(t=Uo(e,"x-omrs-offline-response-status"))&&void 0!==t?t:"");return isNaN(n)||n<200||n>599?503:n}function Uo(e,t){return e.get(t)}var Lo,Wo=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function u(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}s((r=r.apply(e,t||[])).next())}))},zo=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Ho=new class extends Io{constructor(e={}){super(e),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}async _handle(t,n){let r,o;try{const e=[n.fetch(t)];if(this._networkTimeoutSeconds){const t=u(1e3*this._networkTimeoutSeconds);e.push(t)}if(o=await Promise.race(e),!o)throw new Error(`Timed out the network response after ${this._networkTimeoutSeconds} seconds.`)}catch(e){e instanceof Error&&(r=e)}if(!o)throw new e("no-response",{url:t.url,error:r});return o}},Go=new class extends Io{constructor(e={}){super(e),this.plugins.some((e=>"cacheWillUpdate"in e))||this.plugins.unshift(Bo),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}async _handle(t,n){const r=[],o=[];let i;if(this._networkTimeoutSeconds){const{id:e,promise:a}=this._getTimeoutPromise({request:t,logs:r,handler:n});i=e,o.push(a)}const a=this._getNetworkPromise({timeoutId:i,request:t,logs:r,handler:n});o.push(a);const u=await n.waitUntil((async()=>await n.waitUntil(Promise.race(o))||await a)());if(!u)throw new e("no-response",{url:t.url});return u}_getTimeoutPromise({request:e,logs:t,handler:n}){let r;return{promise:new Promise((t=>{r=setTimeout((async()=>{t(await n.cacheMatch(e))}),1e3*this._networkTimeoutSeconds)})),id:r}}async _getNetworkPromise({timeoutId:e,request:t,logs:n,handler:r}){let o,i;try{i=await r.fetchAndCachePut(t)}catch(e){e instanceof Error&&(o=e)}return e&&clearTimeout(e),!o&&i||(i=await r.cacheMatch(t)),i}}({cacheName:pe});function Vo(e){return Wo(this,void 0,void 0,(function(){var t;return zo(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,5]),[4,Ho.handle(e)];case 1:return[2,n.sent()];case 2:return n.sent(),[4,caches.open(pe)];case 3:return[4,n.sent().match(ye)];case 4:return[2,null!=(t=n.sent())?t:Response.error()];case 5:return[2]}}))}))}function $o(e){return Wo(this,void 0,void 0,(function(){return zo(this,(function(t){switch(t.label){case 0:return[4,Yo(e)];case 1:return t.sent()?[4,Go.handle(e)]:[3,3];case 2:return[2,t.sent()];case 3:return[4,Qo(e)];case 4:return[2,t.sent()]}}))}))}function Yo(e){var t=e.request,n=e.url;return Wo(this,void 0,void 0,(function(){return zo(this,(function(e){switch(e.label){case 0:return"GET"!==t.method?[2,!1]:"network-first"===Uo(t.headers,"x-omrs-offline-caching-strategy")?[2,!0]:[4,(new go).dynamicRouteRegistrations.toArray()];case 1:return[2,e.sent().some((function(e){return new RegExp(e.pattern).test(n.href)}))]}}))}))}function Qo(e){return Wo(this,void 0,void 0,(function(){var t,n,r,o,i,a;return zo(this,(function(u){switch(u.label){case 0:return[4,(t=e.request).clone()];case 1:n=u.sent(),u.label=2;case 2:return u.trys.push([2,4,,7]),[4,Ho.handle(e)];case 3:return[2,u.sent()];case 4:return u.sent(),[4,caches.match(t,{cacheName:pe})];case 5:return(r=u.sent())?[2,r]:(o=Fo,i={type:"networkRequestFailed"},a={url:t.url,method:t.method},[4,n.text()]);case 6:return o.apply(void 0,[(i.request=(a.body=u.sent(),a.headers=(s=t.headers,c={},s.forEach((function(e,t){return c[t]=e})),c),a),i)]),[2,new Response(Mo(t.headers),{status:No(t.headers)})];case 7:return[2]}var s,c}))}))}self.__WB_DISABLE_DEV_LOGS=!0,Lo={prefix:"omrs"},(e=>{for(const t of Object.keys(r))e(t)})((e=>{"string"==typeof Lo[e]&&(r[e]=Lo[e])})),function(){!function(e,t,n){let r;r=e instanceof RegExp?new Co(e,t,n):new Ro(e,t,n),Ko().registerRoute(r)}((function(e){return"navigate"===e.request.mode}),Vo);for(var e=Ko(),t=0,n=So;t<n.length;t++){var r=n[t];e.setDefaultHandler($o,r)}}(),self.addEventListener("message",(function(e){var t,n,r,o,i,a;return Eo(this,void 0,void 0,(function(){function u(e){console.warn("Handling a message resulted in an error.",e),s({success:!1,error:e})}function s(t){e.ports[0].postMessage(null!=t?t:{})}var c,l;return Oo(this,(function(f){switch(f.label){case 0:if(!(c=Po[null!==(r=null===(n=null===(t=e.data)||void 0===t?void 0:t.type)||void 0===n?void 0:n.toString())&&void 0!==r?r:""]))return u('Received an unknown message of type "'+(null===(o=e.data)||void 0===o?void 0:o.type)+" which cannot be handled."),[2];f.label=1;case 1:return f.trys.push([1,3,,4]),[4,c(e.data)];case 2:return s({success:!0,result:f.sent()}),[3,4];case 3:return l=f.sent(),u(null!==(a=null!==(i=null==l?void 0:l.message)&&void 0!==i?i:null==l?void 0:l.toString())&&void 0!==a?a:"Unknown error."),[3,4];case 4:return[2]}}))}))})),self.addEventListener("install",(function(e){self.skipWaiting(),e.waitUntil(ko(ve))}))})()})();
|
|
2
2
|
//# sourceMappingURL=service-worker.js.map
|