@openmrs/esm-app-shell 4.3.0 → 4.3.1
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/.turbo/turbo-build.log +102 -102
- package/dist/{65d45e049b339636.js → 28e4acd4c25b29d5.js} +1 -1
- package/dist/{65d45e049b339636.js.map → 28e4acd4c25b29d5.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/{openmrs.2cd4f1cc588a29b8.js → openmrs.8c33142777a563d3.js} +2 -2
- package/dist/{openmrs.2cd4f1cc588a29b8.js.map → openmrs.8c33142777a563d3.js.map} +1 -1
- package/dist/openmrs.c338e62151d961c5.css.map +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +2 -2
- package/lib/023bd53d342b7463.woff +0 -0
- package/lib/02acc4469a2fe2e4.woff2 +0 -0
- package/lib/033e03f8663ab9b1.woff +0 -0
- package/lib/052607e67da262ec.woff +0 -0
- package/lib/081587ca0db8e63f.woff2 +0 -0
- package/lib/08cf53c4e5e71cf1.woff2 +0 -0
- package/lib/090b2bc014d24ea4.woff2 +0 -0
- package/lib/0a28cd0b47497b71.woff +0 -0
- package/lib/0a9765a89ff0437d.woff +0 -0
- package/lib/0ae92bcea615e948.woff2 +0 -0
- package/lib/0be8520d8945b3b7.woff2 +0 -0
- package/lib/0bf6b66a8b86b014.woff +0 -0
- package/lib/0e7dd073cd8bb0ad.woff2 +0 -0
- package/lib/14869ac5d1830304.woff2 +0 -0
- package/lib/14aaceff85fc8b28.woff2 +0 -0
- package/lib/1590052e1cf8f28d.woff +0 -0
- package/lib/16f443eed01776ca.woff2 +0 -0
- package/lib/183bae0e53a22182.woff2 +0 -0
- package/lib/19b239a0bb74b27e.woff +0 -0
- package/lib/19c8f94ccd6289f5.woff2 +0 -0
- package/lib/1ae86565eab7451c.woff2 +0 -0
- package/lib/1c7bf8797e0a9be6.woff2 +0 -0
- package/lib/1d9aff9a93a3bb66.woff +0 -0
- package/lib/1f266d3619b30f16.woff2 +0 -0
- package/lib/1f8c5a4087a524fd.woff2 +0 -0
- package/lib/20ba2b23c5c0cd0b.woff2 +0 -0
- package/lib/2269d45733c5cf8f.woff +0 -0
- package/lib/258ecbd235953099.woff +0 -0
- package/lib/295dd01a1fbfee6d.woff2 +0 -0
- package/lib/2d7f835ab7c7c764.woff +0 -0
- package/lib/2f66cca99eeead63.woff +0 -0
- package/lib/2f686985e26e7107.woff2 +0 -0
- package/lib/315eff729e4ccbd9.woff2 +0 -0
- package/lib/326dd794d98c4ce5.js +0 -22
- package/lib/32f1e5aadf845e08.woff +0 -0
- package/lib/338484e1c850669c.woff +0 -0
- package/lib/33b7a82f1e295190.woff +0 -0
- package/lib/3674d98ec4a9173d.woff +0 -0
- package/lib/368d16e3259bf207.woff2 +0 -0
- package/lib/36c49aa341a7079a.woff2 +0 -0
- package/lib/36e1e0430475edee.woff2 +0 -0
- package/lib/3bc19662b8630ee9.woff2 +0 -0
- package/lib/3f645f473b3f8fba.woff2 +0 -0
- package/lib/4095df88acae9e98.woff +0 -0
- package/lib/4218ac9901b9d36d.woff2 +0 -0
- package/lib/4680ba68412e4da9.woff2 +0 -0
- package/lib/47d7a8698d562a0e.woff +0 -0
- package/lib/47ec6c9dffe776a0.woff +0 -0
- package/lib/48e37bd7ebf85a1f.woff2 +0 -0
- package/lib/48edfdf51dfb3160.woff +0 -0
- package/lib/4a35a2746c8ad7a5.woff +0 -0
- package/lib/4e11b8a7c445255f.woff2 +0 -0
- package/lib/4ea1f5c3baf89fe3.woff +0 -0
- package/lib/4ea99f41c896bf9d.woff +0 -0
- package/lib/5005db1d1caf70c7.woff +0 -0
- package/lib/528a8e7c1c141a31.woff +0 -0
- package/lib/52ca12f5b516d4ea.woff +0 -0
- package/lib/537ddd61c5c1fce2.woff2 +0 -0
- package/lib/5432f7541ec25c34.woff +0 -0
- package/lib/54a95d73a9454ba3.woff +0 -0
- package/lib/56c4118c0907f151.woff2 +0 -0
- package/lib/5938bc2ae7ec60c0.woff2 +0 -0
- package/lib/594306657c4e44e8.woff +0 -0
- package/lib/5a538aa477a66067.woff +0 -0
- package/lib/5c6586155f0d278a.woff2 +0 -0
- package/lib/60ec587649ba812a.woff2 +0 -0
- package/lib/616567cd947eb9dd.woff +0 -0
- package/lib/65168b59f44caab4.woff +0 -0
- package/lib/65c0982f98374864.woff +0 -0
- package/lib/65e6511e035870e1.woff2 +0 -0
- package/lib/661425f6798cd16a.woff2 +0 -0
- package/lib/66b864fe213caf46.woff2 +0 -0
- package/lib/6775fee945132ef9.woff +0 -0
- package/lib/68bbd362c8e4983b.woff +0 -0
- package/lib/68d6deec87b6b604.woff +0 -0
- package/lib/69a7e6d31d390296.woff +0 -0
- package/lib/69d087d970ee9455.woff2 +0 -0
- package/lib/69fa3fc7363bbc04.woff +0 -0
- package/lib/6a1f0178b45b2e9e.woff +0 -0
- package/lib/6c6c45e66ff54281.woff2 +0 -0
- package/lib/6ffb9ed97b21fdc0.woff +0 -0
- package/lib/7073a7323e92bd11.woff2 +0 -0
- package/lib/718c6cc31274ab1a.woff2 +0 -0
- package/lib/72cdbedfe04be9f9.woff2 +0 -0
- package/lib/7509c9f56fe9e532.woff2 +0 -0
- package/lib/75dc5c5b04adc8bf.woff2 +0 -0
- package/lib/76a7c256fc8b3490.woff +0 -0
- package/lib/77b48bc05299ecca.woff2 +0 -0
- package/lib/787f56efa306ddbc.woff +0 -0
- package/lib/7a0a0215c248c73d.woff2 +0 -0
- package/lib/7c4463d9c84f263a.woff +0 -0
- package/lib/7d112a556b7670d2.woff +0 -0
- package/lib/7d52d6014b5f2bbc.woff +0 -0
- package/lib/7f00bebb24e40167.woff2 +0 -0
- package/lib/7f2c6ea3e740417e.woff +0 -0
- package/lib/802c6176541eeed7.woff2 +0 -0
- package/lib/8080081b3379c637.woff2 +0 -0
- package/lib/8274cc1afc7619f1.woff +0 -0
- package/lib/8605507b7a8487c4.woff2 +0 -0
- package/lib/8a83d654702f6534.woff2 +0 -0
- package/lib/8ccee65f6cf254ee.woff +0 -0
- package/lib/8d82a082a4aba439.woff +0 -0
- package/lib/8de04ae985937b56.woff +0 -0
- package/lib/8fe71173a13fe571.woff2 +0 -0
- package/lib/90edccb224a51cee.woff +0 -0
- package/lib/94b292fe87831a8b.woff +0 -0
- package/lib/95dc66c1b88745f8.woff +0 -0
- package/lib/95fb698be77c85ef.woff +0 -0
- package/lib/9624cec0f9bdd81e.woff2 +0 -0
- package/lib/9662331fa31e3f20.woff +0 -0
- package/lib/98a3af55a1698171.woff2 +0 -0
- package/lib/9ba85996af74c5ce.woff2 +0 -0
- package/lib/9bc133b1df25cb74.woff +0 -0
- package/lib/9ddb22faa35006e7.woff2 +0 -0
- package/lib/9e97352380611b95.woff +0 -0
- package/lib/a167fb2799dd741b.woff2 +0 -0
- package/lib/a2045a5cc4fdf94f.woff2 +0 -0
- package/lib/a246c73905a31c93.woff2 +0 -0
- package/lib/a401aa7939cb6e6f.woff2 +0 -0
- package/lib/a41a71258c38684d.woff +0 -0
- package/lib/a60d94a72d615a8e.woff +0 -0
- package/lib/a66764dd0c1fa213.woff +0 -0
- package/lib/a6ed036f17a1ea29.woff2 +0 -0
- package/lib/a8f635129d660202.woff +0 -0
- package/lib/a9f25ca430709a1a.woff2 +0 -0
- package/lib/ae14d98ad8a1212c.woff +0 -0
- package/lib/aeec4f78084adf7f.woff +0 -0
- package/lib/af11e94b0644eba5.woff +0 -0
- package/lib/afa9121a49e95351.woff2 +0 -0
- package/lib/afcda12d9f805543.woff2 +0 -0
- package/lib/b09ded85a7da77f1.woff2 +0 -0
- package/lib/b2f4e9d1e821b71c.woff2 +0 -0
- package/lib/b30b06698dc369b2.woff +0 -0
- package/lib/b4a074bf828bb757.woff2 +0 -0
- package/lib/b7f447da43f6e596.woff2 +0 -0
- package/lib/b7f633b871b84820.woff +0 -0
- package/lib/bcca84a524572d10.woff2 +0 -0
- package/lib/be4d1f97b11d087c.woff2 +0 -0
- package/lib/be91def2232f6776.woff +0 -0
- package/lib/bec14780d81164de.woff2 +0 -0
- package/lib/c285f4b15d11f172.woff +0 -0
- package/lib/c4673617b80801f3.woff +0 -0
- package/lib/c553f7e0199c5084.woff2 +0 -0
- package/lib/c8470ed2c145ace7.woff +0 -0
- package/lib/c9d9ce9f465df4fe.woff2 +0 -0
- package/lib/ccb2870475da9fe8.woff +0 -0
- package/lib/d04134fa33c2606d.woff +0 -0
- package/lib/d11f9c5cd7d9ea16.woff +0 -0
- package/lib/d188f7f036ac5779.woff2 +0 -0
- package/lib/d265d81c58525ae4.woff2 +0 -0
- package/lib/d5942cd81663e136.woff2 +0 -0
- package/lib/d6097a5c452acf6d.woff +0 -0
- package/lib/d66b8ff73d95cabb.woff2 +0 -0
- package/lib/d77f5bf95de8edaa.woff +0 -0
- package/lib/d8829a685af4f372.woff +0 -0
- package/lib/d88899ef0fd16719.woff2 +0 -0
- package/lib/d9a5d958e69e058d.woff2 +0 -0
- package/lib/da65d9a514c628c8.woff +0 -0
- package/lib/dac90d495be353a0.woff2 +0 -0
- package/lib/dd7071bc6306585c.woff +0 -0
- package/lib/dd8ce598529c3fab.woff2 +0 -0
- package/lib/ddef6f2dd566c2b9.woff +0 -0
- package/lib/de013f1be25103fa.woff2 +0 -0
- package/lib/dee2ff599db31e5b.woff +0 -0
- package/lib/dee7c6b5dd954d9b.woff +0 -0
- package/lib/df222fceeffca849.woff2 +0 -0
- package/lib/e0d2e5b12f028b5d.woff +0 -0
- package/lib/e33e3db8e4f7559f.woff +0 -0
- package/lib/e62b00b9199c1ac9.woff2 +0 -0
- package/lib/e696cef1407b2610.woff2 +0 -0
- package/lib/e89ca83b24959664.woff +0 -0
- package/lib/eb8c0ae77ad55249.woff +0 -0
- package/lib/ed0997bd7d221b8e.woff +0 -0
- package/lib/eed48feba743e21c.woff2 +0 -0
- package/lib/f280bda8a6e535a6.woff +0 -0
- package/lib/f543c88feb236d11.woff2 +0 -0
- package/lib/f591b0079faa93fe.woff2 +0 -0
- package/lib/f6ed27923769ad1d.woff2 +0 -0
- package/lib/f8803bebe640d99a.woff +0 -0
- package/lib/favicon.ico +0 -0
- package/lib/fbebeb4336e67012.woff2 +0 -0
- package/lib/fd522cd7a5c646fe.woff +0 -0
- package/lib/icon_128x128.3dde25c6e69b1c010a6a5d6b27b3f436.png +0 -0
- package/lib/icon_144x144.e263e02b838d229b02ff9133e6e0f2ba.png +0 -0
- package/lib/icon_192x192.d3d318638bbe8a10a3c687d3d302d01a.png +0 -0
- package/lib/icon_256x256.c729f6e7e914b58fcea5ce91d7aa9bad.png +0 -0
- package/lib/icon_384x384.c8923df6b6bd08eba5c79b78d7fcecc0.png +0 -0
- package/lib/icon_512x512.7163efb26df832de513bc58d925ea22e.png +0 -0
- package/lib/icon_96x96.682ee334ae19d49894217370b8596f61.png +0 -0
- package/lib/index.html +0 -78
- package/lib/logo-512.png +0 -0
- package/lib/logo.svg +0 -30
- package/lib/manifest.c61e464ba60302bdc2442acdd49954f1.json +0 -47
- package/lib/openmrs.js +0 -12235
- package/lib/service-worker.js +0 -1730
- /package/dist/{openmrs.2cd4f1cc588a29b8.js.LICENSE.txt → openmrs.8c33142777a563d3.js.LICENSE.txt} +0 -0
package/dist/service-worker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e={889:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,n="millisecond",r="second",i="minute",o="hour",s="day",a="week",u="month",l="quarter",c="year",h="date",f="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},y=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},v={s:y,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,u),o=n-i<0,s=t.clone().add(r+(o?-1:1),u);return+(-(r+(n-i)/(o?i-s:s-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:c,w:a,d:s,D:h,h:o,m:i,s:r,ms:n,Q:l}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},m="en",b={};b[m]=g;var w=function(e){return e instanceof S},_=function e(t,n,r){var i;if(!t)return m;if("string"==typeof t){var o=t.toLowerCase();b[o]&&(i=o),n&&(b[o]=n,i=o);var s=t.split("-");if(!i&&s.length>1)return e(s[0])}else{var a=t.name;b[a]=t,i=a}return!r&&i&&(m=i),i||!r&&m},x=function(e,t){if(w(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new S(n)},k=v;k.l=_,k.i=w,k.w=function(e,t){return x(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function g(e){this.$L=_(e.locale,null,!0),this.parse(e)}var y=g.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(k.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(d);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return k},y.isValid=function(){return!(this.$d.toString()===f)},y.isSame=function(e,t){var n=x(e);return this.startOf(t)<=n&&n<=this.endOf(t)},y.isAfter=function(e,t){return x(e)<this.startOf(t)},y.isBefore=function(e,t){return this.endOf(t)<x(e)},y.$g=function(e,t,n){return k.u(e)?this[t]:this.set(n,e)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(e,t){var n=this,l=!!k.u(t)||t,f=k.p(e),d=function(e,t){var r=k.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return l?r:r.endOf(s)},p=function(e,t){return k.w(n.toDate()[e].apply(n.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},g=this.$W,y=this.$M,v=this.$D,m="set"+(this.$u?"UTC":"");switch(f){case c:return l?d(1,0):d(31,11);case u:return l?d(1,y):d(0,y+1);case a:var b=this.$locale().weekStart||0,w=(g<b?g+7:g)-b;return d(l?v-w:v+(6-w),y);case s:case h:return p(m+"Hours",0);case o:return p(m+"Minutes",1);case i:return p(m+"Seconds",2);case r:return p(m+"Milliseconds",3);default:return this.clone()}},y.endOf=function(e){return this.startOf(e,!1)},y.$set=function(e,t){var a,l=k.p(e),f="set"+(this.$u?"UTC":""),d=(a={},a[s]=f+"Date",a[h]=f+"Date",a[u]=f+"Month",a[c]=f+"FullYear",a[o]=f+"Hours",a[i]=f+"Minutes",a[r]=f+"Seconds",a[n]=f+"Milliseconds",a)[l],p=l===s?this.$D+(t-this.$W):t;if(l===u||l===c){var g=this.clone().set(h,1);g.$d[d](p),g.init(),this.$d=g.set(h,Math.min(this.$D,g.daysInMonth())).$d}else d&&this.$d[d](p);return this.init(),this},y.set=function(e,t){return this.clone().$set(e,t)},y.get=function(e){return this[k.p(e)]()},y.add=function(n,l){var h,f=this;n=Number(n);var d=k.p(l),p=function(e){var t=x(f);return k.w(t.date(t.date()+Math.round(e*n)),f)};if(d===u)return this.set(u,this.$M+n);if(d===c)return this.set(c,this.$y+n);if(d===s)return p(1);if(d===a)return p(7);var g=(h={},h[i]=e,h[o]=t,h[r]=1e3,h)[d]||1,y=this.$d.getTime()+n*g;return k.w(y,this)},y.subtract=function(e,t){return this.add(-1*e,t)},y.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var r=e||"YYYY-MM-DDTHH:mm:ssZ",i=k.z(this),o=this.$H,s=this.$m,a=this.$M,u=n.weekdays,l=n.months,c=function(e,n,i,o){return e&&(e[n]||e(t,r))||i[n].slice(0,o)},h=function(e){return k.s(o%12||12,e,"0")},d=n.meridiem||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r},g={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:k.s(a+1,2,"0"),MMM:c(n.monthsShort,a,l,3),MMMM:c(l,a),D:this.$D,DD:k.s(this.$D,2,"0"),d:String(this.$W),dd:c(n.weekdaysMin,this.$W,u,2),ddd:c(n.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(o),HH:k.s(o,2,"0"),h:h(1),hh:h(2),a:d(o,s,!0),A:d(o,s,!1),m:String(s),mm:k.s(s,2,"0"),s:String(this.$s),ss:k.s(this.$s,2,"0"),SSS:k.s(this.$ms,3,"0"),Z:i};return r.replace(p,(function(e,t){return t||g[e]||i.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(n,h,f){var d,p=k.p(h),g=x(n),y=(g.utcOffset()-this.utcOffset())*e,v=this-g,m=k.m(this,g);return m=(d={},d[c]=m/12,d[u]=m,d[l]=m/3,d[a]=(v-y)/6048e5,d[s]=(v-y)/864e5,d[o]=v/t,d[i]=v/e,d[r]=v/1e3,d)[p]||v,f?m:k.a(m)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return b[this.$L]},y.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=_(e,t,!0);return r&&(n.$L=r),n},y.clone=function(){return k.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},g}(),O=S.prototype;return x.prototype=O,[["$ms",n],["$s",r],["$m",i],["$H",o],["$W",s],["$M",u],["$y",c],["$D",h]].forEach((function(e){O[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),x.extend=function(e,t){return e.$i||(e(t,S,x),e.$i=!0),x},x.locale=_,x.isDayjs=w,x.unix=function(e){return x(1e3*e)},x.en=b[m],x.Ls=b,x.p={},x}()},99:(e,t,n)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach((function(t){i(e,t,n[t])}))}return e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}n.r(t),n.d(t,{default:()=>W});var p={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},g=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.init(t,n)}return u(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||p,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,o({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),y=function(){function e(){s(this,e),this.observers={}}return u(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){var i=[].concat(this.observers[e]);i.forEach((function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(t){t.apply(t,[e].concat(n))}))}}}]),e}();function v(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function m(e){return null==e?"":""+e}function b(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function w(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function _(e,t,n){var r=w(e,t,Object);r.obj[r.k]=n}function x(e,t){var n=w(e,t),r=n.obj,i=n.k;if(r)return r[i]}function k(e,t,n){var r=x(e,n);return void 0!==r?r:x(t,n)}function S(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):S(e[r],t[r],n):e[r]=t[r]);return e}function O(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var P={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function E(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return P[e]})):e}var C="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,j=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return s(this,t),n=c(this,h(t).call(this)),C&&y.call(l(n)),n.data=e||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return d(t,e),u(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=[e,t];return n&&"string"!=typeof n&&(o=o.concat(n)),n&&"string"==typeof n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split(".")),x(this.data,o)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var s=[e,t];n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(r=t,t=(s=e.split("."))[1]),this.addNamespaces(t),_(this.data,s,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var u=x(this.data,a)||{};r?S(u,n,i):u=o({},u,n),_(this.data,a,u),s.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?o({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(y),R={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,r,i))})),t}},D={},A=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,t),n=c(this,h(t).call(this)),C&&y.call(l(n)),b(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,l(n)),n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=g.create("translator"),n}return d(t,e),u(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var o=e.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:e,namespaces:i};var s=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(s[0])>-1)&&(i=s.shift()),e=s.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,n,i){var s=this;if("object"!==r(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var a=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,u=this.extractFromKey(e[e.length-1],n),l=u.key,c=u.namespaces,h=c[c.length-1],f=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f&&"cimode"===f.toLowerCase()){if(d){var p=n.nsSeparator||this.options.nsSeparator;return h+p+l}return l}var g=this.resolve(e,n),y=g&&g.res,v=g&&g.usedKey||l,m=g&&g.exactUsedKey||l,b=Object.prototype.toString.apply(y),w=["[object Number]","[object Function]","[object RegExp]"],_=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,k="string"!=typeof y&&"boolean"!=typeof y&&"number"!=typeof y;if(x&&y&&k&&w.indexOf(b)<0&&("string"!=typeof _||"[object Array]"!==b)){if(!n.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,y,n):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");if(a){var S="[object Array]"===b,O=S?[]:{},P=S?m:v;for(var E in y)if(Object.prototype.hasOwnProperty.call(y,E)){var C="".concat(P).concat(a).concat(E);O[E]=this.translate(C,o({},n,{joinArrays:!1,ns:c})),O[E]===C&&(O[E]=y[E])}y=O}}else if(x&&"string"==typeof _&&"[object Array]"===b)(y=y.join(_))&&(y=this.extendTranslation(y,e,n,i));else{var j=!1,R=!1,D=void 0!==n.count&&"string"!=typeof n.count,A=t.hasDefaultValue(n),L=D?this.pluralResolver.getSuffix(f,n.count):"",K=n["defaultValue".concat(L)]||n.defaultValue;!this.isValidLookup(y)&&A&&(j=!0,y=K),this.isValidLookup(y)||(R=!0,y=l);var T=A&&K!==y&&this.options.updateMissing;if(R||j||T){if(this.logger.log(T?"updateKey":"missingKey",f,h,l,T?K:y),a){var N=this.resolve(l,o({},n,{keySeparator:!1}));N&&N.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var M=[],$=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&$&&$[0])for(var I=0;I<$.length;I++)M.push($[I]);else"all"===this.options.saveMissingTo?M=this.languageUtils.toResolveHierarchy(n.lng||this.language):M.push(n.lng||this.language);var F=function(e,t,r){s.options.missingKeyHandler?s.options.missingKeyHandler(e,h,t,T?r:y,T,n):s.backendConnector&&s.backendConnector.saveMissing&&s.backendConnector.saveMissing(e,h,t,T?r:y,T,n),s.emit("missingKey",e,h,t,y)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?M.forEach((function(e){s.pluralResolver.getSuffixes(e).forEach((function(t){F([e],l+t,n["defaultValue".concat(t)]||K)}))})):F(M,l,K))}y=this.extendTranslation(y,e,n,g,i),R&&y===l&&this.options.appendNamespaceToMissingKey&&(y="".concat(h,":").concat(l)),R&&this.options.parseMissingKeyHandler&&(y=this.options.parseMissingKeyHandler(y))}return y}},{key:"extendTranslation",value:function(e,t,n,r,i){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,n,r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(o({},n,{interpolation:o({},this.options.interpolation,n.interpolation)}));var a,u=n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(u){var l=e.match(this.interpolator.nestingRegexp);a=l&&l.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=o({},this.options.interpolation.defaultVariables,c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),u){var h=e.match(this.interpolator.nestingRegexp);a<(h&&h.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return i&&i[0]===r[0]&&!n.context?(s.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):s.translate.apply(s,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var f=n.postProcess||this.options.postProcess,d="string"==typeof f?[f]:f;return null!=e&&d&&d.length&&!1!==n.applyPostProcessor&&(e=R.handle(d,e,t,this.options&&this.options.postProcessPassResolved?o({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,o,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var u=s.extractFromKey(e,a),l=u.key;n=l;var c=u.namespaces;s.options.fallbackNS&&(c=c.concat(s.options.fallbackNS));var h=void 0!==a.count&&"string"!=typeof a.count,f=void 0!==a.context&&"string"==typeof a.context&&""!==a.context,d=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);c.forEach((function(e){s.isValidLookup(t)||(o=e,!D["".concat(d[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(D["".concat(d[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(n,'" for languages "').concat(d.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),d.forEach((function(n){if(!s.isValidLookup(t)){i=n;var o,u,c=l,d=[c];for(s.i18nFormat&&s.i18nFormat.addLookupKeys?s.i18nFormat.addLookupKeys(d,l,n,e,a):(h&&(o=s.pluralResolver.getSuffix(n,a.count)),h&&f&&d.push(c+o),f&&d.push(c+="".concat(s.options.contextSeparator).concat(a.context)),h&&d.push(c+=o));u=d.pop();)s.isValidLookup(t)||(r=u,t=s.getResource(n,e,u,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),t}(y);function L(e){return e.charAt(0).toUpperCase()+e.slice(1)}var K=function(){function e(t){s(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=g.create("languageUtils")}return u(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=L(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=L(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=L(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&o(n.formatLanguageCode(e))})),i}}]),e}(),T=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],N={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};function M(){var e={};return T.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:N[t.fc]}}))})),e}var $=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.languageUtils=t,this.options=n,this.logger=g.create("pluralResolver"),this.rules=M()}return u(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){return this.getSuffixes(e).map((function(e){return t+e}))}},{key:"getSuffixes",value:function(e){var t=this,n=this.getRule(e);return n?n.numbers.map((function(n){return t.getSuffix(e,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=this,r=this.getRule(e);if(r){var i=r.noAbs?r.plurals(t):r.plurals(Math.abs(t)),o=r.numbers[i];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var s=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):s():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?s():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),I=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,e),this.logger=g.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return u(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:E,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?O(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?O(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?O(t.nestingPrefix):t.nestingPrefixEscaped||O("$t("),this.nestingSuffix=t.nestingSuffix?O(t.nestingSuffix):t.nestingSuffixEscaped||O(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,o,s,a=this,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(e){return e.replace(/\$/g,"$$$$")}var c=function(e){if(e.indexOf(a.formatSeparator)<0){var i=k(t,u,e);return a.alwaysFormat?a.format(i,void 0,n):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),l=o.join(a.formatSeparator).trim();return a.format(k(t,u,s),l,n,r)};this.resetRegExp();var h=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&r.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return l(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?l(a.escape(e)):l(e)}}].forEach((function(t){for(s=0;i=t.regex.exec(e);){if(void 0===(o=c(i[1].trim())))if("function"==typeof h){var n=h(e,i,r);o="string"==typeof n?n:""}else{if(f){o=i[0];continue}a.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(e)),o=""}else"string"==typeof o||a.useRawValueToEscape||(o=m(o));if(e=e.replace(i[0],t.safeValue(o)),t.regex.lastIndex=0,++s>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=o({},s);function u(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0],i=(i=this.interpolate(i,a)).replace(/'/g,'"');try{a=JSON.parse(i),t&&(a=o({},t,a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(i)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var l=[],c=!1;if(n[0].includes(this.formatSeparator)&&!/{.*}/.test(n[1])){var h=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=h.shift(),l=h,c=!0}if((r=t(u.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=m(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return i.format(e,t,s.lng,s)}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}(),F=function(e){function t(e,n,r){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return s(this,t),i=c(this,h(t).call(this)),C&&y.call(l(i)),i.backend=e,i.store=n,i.services=r,i.languageUtils=r.languageUtils,i.options=o,i.logger=g.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,o.backend,o),i}return d(t,e),u(t,[{key:"queueLoad",value:function(e,t,n,r){var i=this,o=[],s=[],a=[],u=[];return e.forEach((function(e){var r=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?s.indexOf(a)<0&&s.push(a):(i.state[a]=1,r=!1,s.indexOf(a)<0&&s.push(a),o.indexOf(a)<0&&o.push(a),u.indexOf(t)<0&&u.push(t)))})),r||a.push(e)})),(o.length||s.length)&&this.queue.push({pending:s,loaded:{},errors:[],callback:r}),{toLoad:o,pending:s,toLoadLanguages:a,toLoadNamespaces:u}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),n&&this.store.addResourceBundle(i,o,n),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(n){var r,a,u,l,c;r=n.loaded,a=o,(l=(u=w(r,[i],Object)).obj)[c=u.k]=l[c]||[],l[c].push(a),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){s[e]||(s[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){s[e].indexOf(t)<0&&s[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,s=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,(function(a,u){a&&u&&i<5?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*o,s)}),o):s(a,u)})):s(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,s){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&s&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),s),t.loaded(e,r,s)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,o({},s,{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),t}(y);function B(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===r(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===r(e[2])||"object"===r(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function q(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function U(){}const W=new(function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(s(this,t),e=c(this,h(t).call(this)),C&&y.call(l(e)),e.options=q(n),e.services={},e.logger=g,e.modules={external:[]},r&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,r),c(e,l(e));setTimeout((function(){e.init(n,r)}),0)}return e}return d(t,e),u(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function r(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(n=t,t={}),t.whitelist&&!t.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),t.nonExplicitWhitelist&&!t.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=o({},B(),this.options,q(t)),this.format=this.options.interpolation.format,n||(n=U),!this.options.isClone){this.modules.logger?g.init(r(this.modules.logger),this.options):g.init(null,this.options);var i=new K(this.options);this.store=new j(this.options.resources,this.options);var s=this.services;s.logger=g,s.resourceStore=this.store,s.languageUtils=i,s.pluralResolver=new $(i,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new I(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new F(r(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(s.languageDetector=r(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=r(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new A(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.length>0&&"dev"!==a[0]&&(this.options.lng=a[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var u=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var l=["addResource","addResources","addResourceBundle","removeResourceBundle"];l.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var c=v(),h=function(){var t=function(t,r){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),c.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),c}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:U,r=n,i="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return r();var o=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(i)s(i);else{var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.forEach((function(e){return s(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return s(e)})),this.services.backendConnector.load(o,this.options.ns,r)}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=v();return e||(e=this.languages),t||(t=this.options.ns),n||(n=U),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&R.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=v();this.emit("languageChanging",e);var i=function(e){var i="string"==typeof e?e:n.services.languageUtils.getBestMatchFromCodes(e);i&&(n.language||(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i)),n.translator.language||n.translator.changeLanguage(i),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(i)),n.loadResources(i,(function(e){!function(e,i){i?(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,i)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t){var n=this,i=function e(t,i){var s;if("object"!==r(i)){for(var a=arguments.length,u=new Array(a>2?a-2:0),l=2;l<a;l++)u[l-2]=arguments[l];s=n.options.overloadTranslationOptionHandler([t,i].concat(u))}else s=o({},i);return s.lng=s.lng||e.lng,s.lngs=s.lngs||e.lngs,s.ns=s.ns||e.ns,n.t(t,s)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var a=n.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||!(!s(r,e)||i&&!s(o,e))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=v();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=v();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){return e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),e?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr":"rtl"}},{key:"createInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new t(e,n)}},{key:"cloneInstance",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:U,i=o({},this.options,n,{isClone:!0}),s=new t(i),a=["store","services","language"];return a.forEach((function(t){s[t]=e[t]})),s.services=o({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s.translator=new A(s.services,s.options),s.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];s.emit.apply(s,[e].concat(n))})),s.init(i,r),s.translator.options=s.options,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}}]),t}(y))},854:()=>{"use strict";try{self["workbox:core:6.5.3"]&&_()}catch(e){}},955:()=>{"use strict";try{self["workbox:routing:6.5.3"]&&_()}catch(e){}},415:()=>{"use strict";try{self["workbox:strategies:6.5.3"]&&_()}catch(e){}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{n.S={};var e={},t={};n.I=(r,i)=>{i||(i=[]);var o=t[r];if(o||(o=t[r]={}),!(i.indexOf(o)>=0)){if(i.push(o),e[r])return e[r];n.o(n.S,r)||(n.S[r]={});var s=n.S[r],a="@openmrs/esm-app-shell",u=(e,t,n,r)=>{var i=s[e]=s[e]||{},o=i[t];(!o||!o.loaded&&(!r!=!o.eager?r:a>o.from))&&(i[t]={get:n,from:a,eager:!!r})},l=[];return"default"===r&&(u("dayjs","1.11.5",(()=>()=>n(889)),1),u("i18next","19.9.2",(()=>()=>n(99)),1)),e[r]=l.length?Promise.all(l).then((()=>e[r]=1)):1}}})(),(()=>{"use strict";n(854);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:""},i=e=>{return e||(t=r.runtime,[r.prefix,t,r.suffix].filter((e=>e&&e.length>0)).join("-"));var t};function o(e,t){const n=new URL(e);for(const e of t)n.searchParams.delete(e);return n.href}class s{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}function a(e){return new Promise((t=>setTimeout(t,e)))}const u="object"==typeof global&&global&&global.Object===Object&&global;var l="object"==typeof self&&self&&self.Object===Object&&self;const c=u||l||Function("return this")(),h=c.Symbol,f=Array.isArray;var d=Object.prototype,p=d.hasOwnProperty,g=d.toString,y=h?h.toStringTag:void 0;var v=Object.prototype.toString;var m=h?h.toStringTag:void 0;const b=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":m&&m in Object(e)?function(e){var t=p.call(e,y),n=e[y];try{e[y]=void 0;var r=!0}catch(e){}var i=g.call(e);return r&&(t?e[y]=n:delete e[y]),i}(e):function(e){return v.call(e)}(e)},w=function(e){return null!=e&&"object"==typeof e};var _=h?h.prototype:void 0,x=_?_.toString:void 0;const k=function e(t){if("string"==typeof t)return t;if(f(t))return function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}(t,e)+"";if(function(e){return"symbol"==typeof e||w(e)&&"[object Symbol]"==b(e)}(t))return x?x.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var S=/[\\^$.*+?()[\]{}|]/g,O=RegExp(S.source);const P=function(e){return(e=null==(t=e)?"":k(t))&&O.test(e)?e.replace(S,"\\$&"):e;var t};var E=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));function C(e,t){return e<=t}function j(e,t,n=!1){const r=n?e+1:e;return t*Math.pow(2,r)}function R(e){return E(this,null,(function*(){if(!(e<=0))return new Promise((t=>setTimeout(t,e)))}))}const D=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},A=c["__core-js_shared__"];var L,K=(L=/[^.]+$/.exec(A&&A.keys&&A.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"";var T=Function.prototype.toString;var N=/^\[object .+?Constructor\]$/,M=Function.prototype,$=Object.prototype,I=M.toString,F=$.hasOwnProperty,B=RegExp("^"+I.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const q=function(e){return!(!D(e)||(t=e,K&&K in t))&&(function(e){if(!D(e))return!1;var t=b(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?B:N).test(function(e){if(null!=e){try{return T.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t},U=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return q(n)?n:void 0},W=U(Object,"create");var V=Object.prototype.hasOwnProperty;var H=Object.prototype.hasOwnProperty;function z(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])}}z.prototype.clear=function(){this.__data__=W?W(null):{},this.size=0},z.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},z.prototype.get=function(e){var t=this.__data__;if(W){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return V.call(t,e)?t[e]:void 0},z.prototype.has=function(e){var t=this.__data__;return W?void 0!==t[e]:H.call(t,e)},z.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=W&&void 0===t?"__lodash_hash_undefined__":t,this};const Y=z,G=function(e,t){for(var n=e.length;n--;)if((r=e[n][0])===(i=t)||r!=r&&i!=i)return n;var r,i;return-1};var J=Array.prototype.splice;function Q(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])}}Q.prototype.clear=function(){this.__data__=[],this.size=0},Q.prototype.delete=function(e){var t=this.__data__,n=G(t,e);return!(n<0||(n==t.length-1?t.pop():J.call(t,n,1),--this.size,0))},Q.prototype.get=function(e){var t=this.__data__,n=G(t,e);return n<0?void 0:t[n][1]},Q.prototype.has=function(e){return G(this.__data__,e)>-1},Q.prototype.set=function(e,t){var n=this.__data__,r=G(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const X=Q,Z=U(c,"Map"),ee=function(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.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 Y,map:new(Z||X),string:new Y}},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 ie=re,oe=function(e){return e!=e},se=function(e,t){return!(null==e||!e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}(e,oe,n)}(e,t,0)>-1},ae=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1},ue=function(e,t){return e.has(t)},le=U(c,"Set"),ce=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},he=le&&1/ce(new le([,-0]))[1]==1/0?function(e){return new le(e)}:function(){},fe=function(e){return e&&e.length?function(e,t,n){var r=-1,i=se,o=e.length,s=!0,a=[],u=a;if(n)s=!1,i=ae;else if(o>=200){var l=t?null:he(e);if(l)return ce(l);s=!1,i=ue,u=new ie}else u=t?[]:a;e:for(;++r<o;){var c=e[r],h=t?t(c):c;if(c=n||0!==c?c:0,s&&h==h){for(var f=u.length;f--;)if(u[f]===h)continue e;t&&u.push(h),a.push(c)}else i(u,h,n)||(u!==a&&u.push(h),a.push(c))}return a}(e):[]},de="omrs-spa-cache-v1",pe=[{'revision':null,'url':'023bd53d342b7463.woff'},{'revision':null,'url':'02acc4469a2fe2e4.woff2'},{'revision':null,'url':'033e03f8663ab9b1.woff'},{'revision':null,'url':'052607e67da262ec.woff'},{'revision':null,'url':'081587ca0db8e63f.woff2'},{'revision':null,'url':'08cf53c4e5e71cf1.woff2'},{'revision':null,'url':'090b2bc014d24ea4.woff2'},{'revision':null,'url':'0a28cd0b47497b71.woff'},{'revision':null,'url':'0a9765a89ff0437d.woff'},{'revision':null,'url':'0ae92bcea615e948.woff2'},{'revision':null,'url':'0be8520d8945b3b7.woff2'},{'revision':null,'url':'0bf6b66a8b86b014.woff'},{'revision':null,'url':'0e7dd073cd8bb0ad.woff2'},{'revision':null,'url':'14869ac5d1830304.woff2'},{'revision':null,'url':'14aaceff85fc8b28.woff2'},{'revision':null,'url':'1590052e1cf8f28d.woff'},{'revision':null,'url':'16f443eed01776ca.woff2'},{'revision':null,'url':'183bae0e53a22182.woff2'},{'revision':null,'url':'19b239a0bb74b27e.woff'},{'revision':null,'url':'19c8f94ccd6289f5.woff2'},{'revision':null,'url':'1ae86565eab7451c.woff2'},{'revision':null,'url':'1c7bf8797e0a9be6.woff2'},{'revision':null,'url':'1d9aff9a93a3bb66.woff'},{'revision':null,'url':'1f266d3619b30f16.woff2'},{'revision':null,'url':'1f8c5a4087a524fd.woff2'},{'revision':null,'url':'20ba2b23c5c0cd0b.woff2'},{'revision':null,'url':'2269d45733c5cf8f.woff'},{'revision':null,'url':'258ecbd235953099.woff'},{'revision':null,'url':'295dd01a1fbfee6d.woff2'},{'revision':null,'url':'2d7f835ab7c7c764.woff'},{'revision':null,'url':'2f66cca99eeead63.woff'},{'revision':null,'url':'2f686985e26e7107.woff2'},{'revision':null,'url':'315eff729e4ccbd9.woff2'},{'revision':null,'url':'32f1e5aadf845e08.woff'},{'revision':null,'url':'338484e1c850669c.woff'},{'revision':null,'url':'33b7a82f1e295190.woff'},{'revision':null,'url':'3674d98ec4a9173d.woff'},{'revision':null,'url':'368d16e3259bf207.woff2'},{'revision':null,'url':'36c49aa341a7079a.woff2'},{'revision':null,'url':'36e1e0430475edee.woff2'},{'revision':null,'url':'3bc19662b8630ee9.woff2'},{'revision':null,'url':'3f645f473b3f8fba.woff2'},{'revision':null,'url':'4095df88acae9e98.woff'},{'revision':null,'url':'4218ac9901b9d36d.woff2'},{'revision':null,'url':'4680ba68412e4da9.woff2'},{'revision':null,'url':'47d7a8698d562a0e.woff'},{'revision':null,'url':'47ec6c9dffe776a0.woff'},{'revision':null,'url':'48e37bd7ebf85a1f.woff2'},{'revision':null,'url':'48edfdf51dfb3160.woff'},{'revision':null,'url':'4a35a2746c8ad7a5.woff'},{'revision':null,'url':'4e11b8a7c445255f.woff2'},{'revision':null,'url':'4ea1f5c3baf89fe3.woff'},{'revision':null,'url':'4ea99f41c896bf9d.woff'},{'revision':null,'url':'5005db1d1caf70c7.woff'},{'revision':null,'url':'528a8e7c1c141a31.woff'},{'revision':null,'url':'52ca12f5b516d4ea.woff'},{'revision':null,'url':'537ddd61c5c1fce2.woff2'},{'revision':null,'url':'5432f7541ec25c34.woff'},{'revision':null,'url':'54a95d73a9454ba3.woff'},{'revision':null,'url':'56c4118c0907f151.woff2'},{'revision':null,'url':'5938bc2ae7ec60c0.woff2'},{'revision':null,'url':'594306657c4e44e8.woff'},{'revision':null,'url':'5a538aa477a66067.woff'},{'revision':null,'url':'5c6586155f0d278a.woff2'},{'revision':null,'url':'60ec587649ba812a.woff2'},{'revision':null,'url':'616567cd947eb9dd.woff'},{'revision':null,'url':'65168b59f44caab4.woff'},{'revision':null,'url':'65c0982f98374864.woff'},{'revision':null,'url':'65d45e049b339636.js'},{'revision':null,'url':'65e6511e035870e1.woff2'},{'revision':null,'url':'661425f6798cd16a.woff2'},{'revision':null,'url':'66b864fe213caf46.woff2'},{'revision':null,'url':'6775fee945132ef9.woff'},{'revision':null,'url':'68bbd362c8e4983b.woff'},{'revision':null,'url':'68d6deec87b6b604.woff'},{'revision':null,'url':'69a7e6d31d390296.woff'},{'revision':null,'url':'69d087d970ee9455.woff2'},{'revision':null,'url':'69fa3fc7363bbc04.woff'},{'revision':null,'url':'6a1f0178b45b2e9e.woff'},{'revision':null,'url':'6c6c45e66ff54281.woff2'},{'revision':null,'url':'6ffb9ed97b21fdc0.woff'},{'revision':null,'url':'7073a7323e92bd11.woff2'},{'revision':null,'url':'718c6cc31274ab1a.woff2'},{'revision':null,'url':'72cdbedfe04be9f9.woff2'},{'revision':null,'url':'7509c9f56fe9e532.woff2'},{'revision':null,'url':'75dc5c5b04adc8bf.woff2'},{'revision':null,'url':'76a7c256fc8b3490.woff'},{'revision':null,'url':'77b48bc05299ecca.woff2'},{'revision':null,'url':'787f56efa306ddbc.woff'},{'revision':null,'url':'7a0a0215c248c73d.woff2'},{'revision':null,'url':'7c4463d9c84f263a.woff'},{'revision':null,'url':'7d112a556b7670d2.woff'},{'revision':null,'url':'7d52d6014b5f2bbc.woff'},{'revision':null,'url':'7f00bebb24e40167.woff2'},{'revision':null,'url':'7f2c6ea3e740417e.woff'},{'revision':null,'url':'802c6176541eeed7.woff2'},{'revision':null,'url':'8080081b3379c637.woff2'},{'revision':null,'url':'8274cc1afc7619f1.woff'},{'revision':null,'url':'8605507b7a8487c4.woff2'},{'revision':null,'url':'8a83d654702f6534.woff2'},{'revision':null,'url':'8ccee65f6cf254ee.woff'},{'revision':null,'url':'8d82a082a4aba439.woff'},{'revision':null,'url':'8de04ae985937b56.woff'},{'revision':null,'url':'8fe71173a13fe571.woff2'},{'revision':null,'url':'90edccb224a51cee.woff'},{'revision':null,'url':'94b292fe87831a8b.woff'},{'revision':null,'url':'95dc66c1b88745f8.woff'},{'revision':null,'url':'95fb698be77c85ef.woff'},{'revision':null,'url':'9624cec0f9bdd81e.woff2'},{'revision':null,'url':'9662331fa31e3f20.woff'},{'revision':null,'url':'98a3af55a1698171.woff2'},{'revision':null,'url':'9ba85996af74c5ce.woff2'},{'revision':null,'url':'9bc133b1df25cb74.woff'},{'revision':null,'url':'9ddb22faa35006e7.woff2'},{'revision':null,'url':'9e97352380611b95.woff'},{'revision':null,'url':'a167fb2799dd741b.woff2'},{'revision':null,'url':'a2045a5cc4fdf94f.woff2'},{'revision':null,'url':'a246c73905a31c93.woff2'},{'revision':null,'url':'a401aa7939cb6e6f.woff2'},{'revision':null,'url':'a41a71258c38684d.woff'},{'revision':null,'url':'a60d94a72d615a8e.woff'},{'revision':null,'url':'a66764dd0c1fa213.woff'},{'revision':null,'url':'a6ed036f17a1ea29.woff2'},{'revision':null,'url':'a8f635129d660202.woff'},{'revision':null,'url':'a9f25ca430709a1a.woff2'},{'revision':null,'url':'ae14d98ad8a1212c.woff'},{'revision':null,'url':'aeec4f78084adf7f.woff'},{'revision':null,'url':'af11e94b0644eba5.woff'},{'revision':null,'url':'afa9121a49e95351.woff2'},{'revision':null,'url':'afcda12d9f805543.woff2'},{'revision':null,'url':'b09ded85a7da77f1.woff2'},{'revision':null,'url':'b2f4e9d1e821b71c.woff2'},{'revision':null,'url':'b30b06698dc369b2.woff'},{'revision':null,'url':'b4a074bf828bb757.woff2'},{'revision':null,'url':'b7f447da43f6e596.woff2'},{'revision':null,'url':'b7f633b871b84820.woff'},{'revision':null,'url':'bcca84a524572d10.woff2'},{'revision':null,'url':'be4d1f97b11d087c.woff2'},{'revision':null,'url':'be91def2232f6776.woff'},{'revision':null,'url':'bec14780d81164de.woff2'},{'revision':null,'url':'c285f4b15d11f172.woff'},{'revision':null,'url':'c4673617b80801f3.woff'},{'revision':null,'url':'c553f7e0199c5084.woff2'},{'revision':null,'url':'c8470ed2c145ace7.woff'},{'revision':null,'url':'c9d9ce9f465df4fe.woff2'},{'revision':null,'url':'ccb2870475da9fe8.woff'},{'revision':null,'url':'d04134fa33c2606d.woff'},{'revision':null,'url':'d11f9c5cd7d9ea16.woff'},{'revision':null,'url':'d188f7f036ac5779.woff2'},{'revision':null,'url':'d265d81c58525ae4.woff2'},{'revision':null,'url':'d5942cd81663e136.woff2'},{'revision':null,'url':'d6097a5c452acf6d.woff'},{'revision':null,'url':'d66b8ff73d95cabb.woff2'},{'revision':null,'url':'d77f5bf95de8edaa.woff'},{'revision':null,'url':'d8829a685af4f372.woff'},{'revision':null,'url':'d88899ef0fd16719.woff2'},{'revision':null,'url':'d9a5d958e69e058d.woff2'},{'revision':null,'url':'da65d9a514c628c8.woff'},{'revision':null,'url':'dac90d495be353a0.woff2'},{'revision':null,'url':'dd7071bc6306585c.woff'},{'revision':null,'url':'dd8ce598529c3fab.woff2'},{'revision':null,'url':'ddef6f2dd566c2b9.woff'},{'revision':null,'url':'de013f1be25103fa.woff2'},{'revision':null,'url':'dee2ff599db31e5b.woff'},{'revision':null,'url':'dee7c6b5dd954d9b.woff'},{'revision':null,'url':'df222fceeffca849.woff2'},{'revision':null,'url':'e0d2e5b12f028b5d.woff'},{'revision':null,'url':'e33e3db8e4f7559f.woff'},{'revision':null,'url':'e62b00b9199c1ac9.woff2'},{'revision':null,'url':'e696cef1407b2610.woff2'},{'revision':null,'url':'e89ca83b24959664.woff'},{'revision':null,'url':'eb8c0ae77ad55249.woff'},{'revision':null,'url':'ed0997bd7d221b8e.woff'},{'revision':null,'url':'eed48feba743e21c.woff2'},{'revision':null,'url':'f280bda8a6e535a6.woff'},{'revision':null,'url':'f543c88feb236d11.woff2'},{'revision':null,'url':'f591b0079faa93fe.woff2'},{'revision':null,'url':'f6ed27923769ad1d.woff2'},{'revision':null,'url':'f8803bebe640d99a.woff'},{'revision':'30de494bd9e73ae96c18fd0c06fa422b','url':'favicon.ico'},{'revision':null,'url':'fbebeb4336e67012.woff2'},{'revision':null,'url':'fd522cd7a5c646fe.woff'},{'revision':null,'url':'https://dev3.openmrs.org/openmrs/spa/importmap.json'},{'revision':'1ce1de6048a06a2324f5d7dd8c79fac2','url':'index.html'},{'revision':'6b758b31ea00150986994edcfb033a94','url':'logo-512.png'},{'revision':'b860db243392596e3b875bad9794b4e5','url':'logo.svg'},{'revision':null,'url':'openmrs.2cd4f1cc588a29b8.js'},{'revision':'10230be33ff15c31af5f9a8587ee6ac8','url':'openmrs.2cd4f1cc588a29b8.js.LICENSE.txt'},{'revision':null,'url':'openmrs.c338e62151d961c5.css'}],ge=ve("index.html"),ye=fe(pe.map((({url:e})=>ve(e))));function ve(e){return new URL(e,self.location.href).href}const me=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},be=function(e){return w(e)&&"[object Arguments]"==b(e)};var we=Object.prototype,_e=we.hasOwnProperty,xe=we.propertyIsEnumerable;const ke=be(function(){return arguments}())?be:function(e){return w(e)&&_e.call(e,"callee")&&!xe.call(e,"callee")};var Se=h?h.isConcatSpreadable:void 0;const Oe=function(e){return f(e)||ke(e)||!!(Se&&e&&e[Se])},Pe=function e(t,n,r,i,o){var s=-1,a=t.length;for(r||(r=Oe),o||(o=[]);++s<a;){var u=t[s];n>0&&r(u)?n>1?e(u,n-1,r,i,o):me(o,u):i||(o[o.length]=u)}return o},Ee=function(e){return null!=e&&e.length?Pe(e,1):[]};var Ce=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));function je(e){return e+".buildmanifest.json"}function Re(e){return fetch(e).then((e=>e.json())).catch((()=>null))}function De(e,t){var n,r;try{const i=[],o=function(e){const t=(e.origin+e.pathname).split("/");return t[t.length-1]="",t.join("/")}(new URL(e,self.location.href));for(const e of null!=(n=t.chunks)?n:[])for(const t of null!=(r=e.files)?r:[])i.push(new URL(t,o).toString());return i}catch(t){return console.error("[SW] Failed to determine the dependencies of the module with the URL %s. Not precaching any of the module's assets. Error: ",e,t),[]}}const Ae="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Le=Object.keys,Ke=Array.isArray;function Te(e,t){return"object"!=typeof t||Le(t).forEach((function(n){e[n]=t[n]})),e}"undefined"==typeof Promise||Ae.Promise||(Ae.Promise=Promise);const Ne=Object.getPrototypeOf,Me={}.hasOwnProperty;function $e(e,t){return Me.call(e,t)}function Ie(e,t){"function"==typeof t&&(t=t(Ne(e))),("undefined"==typeof Reflect?Le:Reflect.ownKeys)(t).forEach((n=>{Be(e,n,t[n])}))}const Fe=Object.defineProperty;function Be(e,t,n,r){Fe(e,t,Te(n&&$e(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function qe(e){return{from:function(t){return e.prototype=Object.create(t.prototype),Be(e.prototype,"constructor",e),{extend:Ie.bind(null,e.prototype)}}}}const Ue=Object.getOwnPropertyDescriptor;function We(e,t){let n;return Ue(e,t)||(n=Ne(e))&&We(n,t)}const Ve=[].slice;function He(e,t,n){return Ve.call(e,t,n)}function ze(e,t){return t(e)}function Ye(e){if(!e)throw new Error("Assertion Failed")}function Ge(e){Ae.setImmediate?setImmediate(e):setTimeout(e,0)}function Je(e,t){return e.reduce(((e,n,r)=>{var i=t(n,r);return i&&(e[i[0]]=i[1]),e}),{})}function Qe(e,t){if($e(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,i=t.length;r<i;++r){var o=Qe(e,t[r]);n.push(o)}return n}var s=t.indexOf(".");if(-1!==s){var a=e[t.substr(0,s)];return void 0===a?void 0:Qe(a,t.substr(s+1))}}function Xe(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){Ye("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)Xe(e,t[r],n[r])}else{var o=t.indexOf(".");if(-1!==o){var s=t.substr(0,o),a=t.substr(o+1);if(""===a)void 0===n?Ke(e)&&!isNaN(parseInt(s))?e.splice(s,1):delete e[s]:e[s]=n;else{var u=e[s];u&&$e(e,s)||(u=e[s]={}),Xe(u,a,n)}}else void 0===n?Ke(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function Ze(e){var t={};for(var n in e)$e(e,n)&&(t[n]=e[n]);return t}const et=[].concat;function tt(e){return et.apply([],e)}const nt="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(tt([8,16,32,64].map((e=>["Int","Uint","Float"].map((t=>t+e+"Array")))))).filter((e=>Ae[e])),rt=nt.map((e=>Ae[e]));Je(nt,(e=>[e,!0]));let it=null;function ot(e){it="undefined"!=typeof WeakMap&&new WeakMap;const t=st(e);return it=null,t}function st(e){if(!e||"object"!=typeof e)return e;let t=it&&it.get(e);if(t)return t;if(Ke(e)){t=[],it&&it.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(st(e[n]))}else if(rt.indexOf(e.constructor)>=0)t=e;else{const n=Ne(e);for(var i in t=n===Object.prototype?{}:Object.create(n),it&&it.set(e,t),e)$e(e,i)&&(t[i]=st(e[i]))}return t}const{toString:at}={};function ut(e){return at.call(e).slice(8,-1)}const lt="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",ct="symbol"==typeof lt?function(e){var t;return null!=e&&(t=e[lt])&&t.apply(e)}:function(){return null},ht={};function ft(e){var t,n,r,i;if(1===arguments.length){if(Ke(e))return e.slice();if(this===ht&&"string"==typeof e)return[e];if(i=ct(e)){for(n=[];!(r=i.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}const dt="undefined"!=typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var pt="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function gt(e,t){pt=e,yt=t}var yt=()=>!0;const vt=!new Error("").stack;function mt(){if(vt)try{throw mt.arguments,new Error}catch(e){return e}return new Error}function bt(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(yt).map((e=>"\n"+e)).join("")):""}var wt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],_t=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(wt),xt={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function kt(e,t){this._e=mt(),this.name=e,this.message=t}function St(e,t){return e+". Errors: "+Object.keys(t).map((e=>t[e].toString())).filter(((e,t,n)=>n.indexOf(e)===t)).join("\n")}function Ot(e,t,n,r){this._e=mt(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=St(e,t)}function Pt(e,t){this._e=mt(),this.name="BulkError",this.failures=Object.keys(t).map((e=>t[e])),this.failuresByPos=t,this.message=St(e,t)}qe(kt).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+bt(this._e,2))}},toString:function(){return this.name+": "+this.message}}),qe(Ot).from(kt),qe(Pt).from(kt);var Et=_t.reduce(((e,t)=>(e[t]=t+"Error",e)),{});const Ct=kt;var jt=_t.reduce(((e,t)=>{var n=t+"Error";function r(e,r){this._e=mt(),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=xt[t]||n,this.inner=null)}return qe(r).from(Ct),e[t]=r,e}),{});jt.Syntax=SyntaxError,jt.Type=TypeError,jt.Range=RangeError;var Rt=wt.reduce(((e,t)=>(e[t+"Error"]=jt[t],e)),{}),Dt=_t.reduce(((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=jt[t]),e)),{});function At(){}function Lt(e){return e}function Kt(e,t){return null==e||e===Lt?t:function(n){return t(e(n))}}function Tt(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Nt(e,t){return e===At?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?Tt(r,this.onsuccess):r),i&&(this.onerror=this.onerror?Tt(i,this.onerror):i),void 0!==o?o:n}}function Mt(e,t){return e===At?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?Tt(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Tt(r,this.onerror):r)}}function $t(e,t){return e===At?t:function(n){var r=e.apply(this,arguments);Te(n,r);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var s=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?Tt(i,this.onsuccess):i),o&&(this.onerror=this.onerror?Tt(o,this.onerror):o),void 0===r?void 0===s?void 0:s:Te(r,s)}}function It(e,t){return e===At?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function Ft(e,t){return e===At?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return n.then((function(){return t.apply(r,o)}))}return t.apply(this,arguments)}}Dt.ModifyError=Ot,Dt.DexieError=kt,Dt.BulkError=Pt;var Bt={};const[qt,Ut,Wt]="undefined"==typeof Promise?[]:(()=>{let e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,Ne(e),e];const t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,Ne(t),e]})(),Vt=Ut&&Ut.then,Ht=qt&&qt.constructor,zt=!!Wt;var Yt=!1,Gt=Wt?()=>{Wt.then(bn)}:Ae.setImmediate?setImmediate.bind(null,bn):Ae.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver((()=>{bn(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(bn,0)},Jt=function(e,t){sn.push([e,t]),Xt&&(Gt(),Xt=!1)},Qt=!0,Xt=!0,Zt=[],en=[],tn=null,nn=Lt,rn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Un,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((e=>{try{Un(e[0],e[1])}catch(e){}}))}},on=rn,sn=[],an=0,un=[];function ln(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=At,this._lib=!1;var t=this._PSD=on;if(pt&&(this._stackHolder=mt(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Bt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&dn(this,this._value))}this._state=null,this._value=null,++t.ref,fn(this,e)}const cn={get:function(){var e=on,t=jn;function n(n,r){var i=!e.global&&(e!==on||t!==jn);const o=i&&!Ln();var s=new ln(((t,s)=>{gn(this,new hn(Bn(n,e,i,o),Bn(r,e,i,o),t,s,e))}));return pt&&mn(s,this),s}return n.prototype=Bt,n},set:function(e){Be(this,"then",e&&e.prototype===Bt?cn:{get:function(){return e},set:cn.set})}};function hn(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function fn(e,t){try{t((t=>{if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&wn();t&&"function"==typeof t.then?fn(e,((e,n)=>{t instanceof ln?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,pn(e)),n&&_n()}}),dn.bind(null,e))}catch(t){dn(e,t)}}function dn(e,t){if(en.push(t),null===e._state){var n=e._lib&&wn();t=nn(t),e._state=!1,e._value=t,pt&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){}}((()=>{var n=We(t,"stack");t._promise=e,Be(t,"stack",{get:()=>Yt?n&&(n.get?n.get.apply(t):n.value):e.stack})})),function(e){Zt.some((t=>t._value===e._value))||Zt.push(e)}(e),pn(e),n&&_n()}}function pn(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)gn(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===an&&(++an,Jt((()=>{0==--an&&xn()}),[]))}function gn(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,++an,Jt(yn,[n,e,t])}else e._listeners.push(t)}function yn(e,t,n){try{tn=t;var r,i=t._value;t._state?r=e(i):(en.length&&(en=[]),r=e(i),-1===en.indexOf(i)&&function(e){for(var t=Zt.length;t;)if(Zt[--t]._value===e._value)return void Zt.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{tn=null,0==--an&&xn(),--n.psd.ref||n.psd.finalize()}}function vn(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var i,o,s=e._value;null!=s?(i=s.name||"Error",o=s.message||s,r=bt(s,0)):(i=s,o=""),t.push(i+(o?": "+o:"")+r)}return pt&&((r=bt(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&vn(e._prev,t,n)),t}function mn(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function bn(){wn()&&_n()}function wn(){var e=Qt;return Qt=!1,Xt=!1,e}function _n(){var e,t,n;do{for(;sn.length>0;)for(e=sn,sn=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(sn.length>0);Qt=!0,Xt=!0}function xn(){var e=Zt;Zt=[],e.forEach((e=>{e._PSD.onunhandled.call(null,e._value,e)}));for(var t=un.slice(0),n=t.length;n;)t[--n]()}function kn(e){return new ln(Bt,!1,e)}function Sn(e,t){var n=on;return function(){var r=wn(),i=on;try{return Mn(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Mn(i,!1),r&&_n()}}}Ie(ln.prototype,{then:cn,_then:function(e,t){gn(this,new hn(null,null,e,t,on))},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,(e=>e instanceof t?n(e):kn(e))):this.then(null,(e=>e&&e.name===t?n(e):kn(e)))},finally:function(e){return this.then((t=>(e(),t)),(t=>(e(),kn(t))))},stack:{get:function(){if(this._stack)return this._stack;try{Yt=!0;var e=vn(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Yt=!1}}},timeout:function(e,t){return e<1/0?new ln(((n,r)=>{var i=setTimeout((()=>r(new jt.Timeout(t))),e);this.then(n,r).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&Be(ln.prototype,Symbol.toStringTag,"Dexie.Promise"),rn.env=$n(),Ie(ln,{all:function(){var e=ft.apply(null,arguments).map(Kn);return new ln((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(((i,o)=>ln.resolve(i).then((n=>{e[o]=n,--r||t(e)}),n)))}))},resolve:e=>{if(e instanceof ln)return e;if(e&&"function"==typeof e.then)return new ln(((t,n)=>{e.then(t,n)}));var t=new ln(Bt,!0,e);return mn(t,tn),t},reject:kn,race:function(){var e=ft.apply(null,arguments).map(Kn);return new ln(((t,n)=>{e.map((e=>ln.resolve(e).then(t,n)))}))},PSD:{get:()=>on,set:e=>on=e},totalEchoes:{get:()=>jn},newPSD:Dn,usePSD:In,scheduler:{get:()=>Jt,set:e=>{Jt=e}},rejectionMapper:{get:()=>nn,set:e=>{nn=e}},follow:(e,t)=>new ln(((n,r)=>Dn(((t,n)=>{var r=on;r.unhandleds=[],r.onunhandled=n,r.finalize=Tt((function(){!function(e){un.push((function t(){e(),un.splice(un.indexOf(t),1)})),++an,Jt((()=>{0==--an&&xn()}),[])}((()=>{0===this.unhandleds.length?t():n(this.unhandleds[0])}))}),r.finalize),e()}),t,n,r)))}),Ht&&(Ht.allSettled&&Be(ln,"allSettled",(function(){const e=ft.apply(null,arguments).map(Kn);return new ln((t=>{0===e.length&&t([]);let n=e.length;const r=new Array(n);e.forEach(((e,i)=>ln.resolve(e).then((e=>r[i]={status:"fulfilled",value:e}),(e=>r[i]={status:"rejected",reason:e})).then((()=>--n||t(r)))))}))})),Ht.any&&"undefined"!=typeof AggregateError&&Be(ln,"any",(function(){const e=ft.apply(null,arguments).map(Kn);return new ln(((t,n)=>{0===e.length&&n(new AggregateError([]));let r=e.length;const i=new Array(r);e.forEach(((e,o)=>ln.resolve(e).then((e=>t(e)),(e=>{i[o]=e,--r||n(new AggregateError(i))}))))}))})));const On={awaits:0,echoes:0,id:0};var Pn=0,En=[],Cn=0,jn=0,Rn=0;function Dn(e,t,n,r){var i=on,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++Rn;var s=rn.env;o.env=zt?{Promise:ln,PromiseProp:{value:ln,configurable:!0,writable:!0},all:ln.all,race:ln.race,allSettled:ln.allSettled,any:ln.any,resolve:ln.resolve,reject:ln.reject,nthen:qn(s.nthen,o),gthen:qn(s.gthen,o)}:{},t&&Te(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var a=In(o,e,n,r);return 0===o.ref&&o.finalize(),a}function An(){return On.id||(On.id=++Pn),++On.awaits,On.echoes+=100,On.id}function Ln(){return!!On.awaits&&(0==--On.awaits&&(On.id=0),On.echoes=100*On.awaits,!0)}function Kn(e){return On.echoes&&e&&e.constructor===Ht?(An(),e.then((e=>(Ln(),e)),(e=>(Ln(),Wn(e))))):e}function Tn(e){++jn,On.echoes&&0!=--On.echoes||(On.echoes=On.id=0),En.push(on),Mn(e,!0)}function Nn(){var e=En[En.length-1];En.pop(),Mn(e,!1)}function Mn(e,t){var n=on;if((t?!On.echoes||Cn++&&e===on:!Cn||--Cn&&e===on)||Fn(t?Tn.bind(null,e):Nn),e!==on&&(on=e,n===rn&&(rn.env=$n()),zt)){var r=rn.env.Promise,i=e.env;Ut.then=i.nthen,r.prototype.then=i.gthen,(n.global||e.global)&&(Object.defineProperty(Ae,"Promise",i.PromiseProp),r.all=i.all,r.race=i.race,r.resolve=i.resolve,r.reject=i.reject,i.allSettled&&(r.allSettled=i.allSettled),i.any&&(r.any=i.any))}}function $n(){var e=Ae.Promise;return zt?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(Ae,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:Ut.then,gthen:e.prototype.then}:{}}function In(e,t,n,r,i){var o=on;try{return Mn(e,!0),t(n,r,i)}finally{Mn(o,!1)}}function Fn(e){Vt.call(qt,e)}function Bn(e,t,n,r){return"function"!=typeof e?e:function(){var i=on;n&&An(),Mn(t,!0);try{return e.apply(this,arguments)}finally{Mn(i,!1),r&&Fn(Ln)}}}function qn(e,t){return function(n,r){return e.call(this,Bn(n,t),Bn(r,t))}}function Un(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,i={promise:t,reason:e};if(Ae.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),Te(r,i)):Ae.CustomEvent&&Te(r=new CustomEvent("unhandledrejection",{detail:i}),i),r&&Ae.dispatchEvent&&(dispatchEvent(r),!Ae.PromiseRejectionEvent&&Ae.onunhandledrejection))try{Ae.onunhandledrejection(r)}catch(e){}pt&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}-1===(""+Vt).indexOf("[native code]")&&(An=Ln=At);var Wn=ln.reject;function Vn(e,t,n,r){if(e.idbdb&&(e._state.openComplete||on.letThrough||e._vip)){var i=e._createTransaction(t,n,e._dbSchema);try{i.create(),e._state.PR1398_maxLoop=3}catch(i){return i.name===Et.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Vn(e,t,n,r)))):Wn(i)}return i._promise(t,((e,t)=>Dn((()=>(on.trans=i,r(e,t,i)))))).then((e=>i._completion.then((()=>e))))}if(e._state.openComplete)return Wn(new jt.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return Wn(new jt.DatabaseClosed);e.open().catch(At)}return e._state.dbReadyPromise.then((()=>Vn(e,t,n,r)))}const Hn=String.fromCharCode(65535),zn="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Yn=[],Gn="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Jn=Gn,Qn=Gn,Xn=e=>!/(dexie\.js|dexie\.min\.js)/.test(e);function Zn(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}const er={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function tr(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=ot(t))[e],t)}class nr{_trans(e,t,n){const r=this._tx||on.trans,i=this.name;function o(e,n,r){if(!r.schema[i])throw new jt.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)}const s=wn();try{return r&&r.db===this.db?r===on.trans?r._promise(e,o,n):Dn((()=>r._promise(e,o,n)),{trans:r,transless:on.transless||on}):Vn(this.db,e,[this.name],o)}finally{s&&_n()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(t=>this.core.get({trans:t,key:e}).then((e=>this.hook.reading.fire(e))))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(Ke(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);const t=Le(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);const n=this.schema.indexes.concat(this.schema.primKey).filter((e=>e.compound&&t.every((t=>e.keyPath.indexOf(t)>=0))&&e.keyPath.every((e=>t.indexOf(e)>=0))))[0];if(n&&this.db._maxKey!==Hn)return this.where(n.name).equals(n.keyPath.map((t=>e[t])));!n&&pt&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);const{idxByName:r}=this.schema,i=this.db._deps.indexedDB;function o(e,t){try{return 0===i.cmp(e,t)}catch(e){return!1}}const[s,a]=t.reduce((([t,n],i)=>{const s=r[i],a=e[i];return[t||s,t||!s?Zn(n,s&&s.multi?e=>{const t=Qe(e,i);return Ke(t)&&t.some((e=>o(a,e)))}:e=>o(a,Qe(e,i))):n]}),[null,null]);return s?this.where(s.name).equals(e[s.keyPath]).filter(a):n?this.filter(a):this.where(t).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,Ke(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;const t=t=>{if(!t)return t;const n=Object.create(e.prototype);for(var r in t)if($e(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}defineClass(){return this.mapToClass((function(e){Te(this,e)}))}add(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let i=e;return r&&n&&(i=tr(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[i]}))).then((e=>e.numFailures?ln.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{Xe(e,r,t)}catch(e){}return t}))}update(e,t){if("object"!=typeof e||Ke(e))return this.where(":id").equals(e).modify(t);{const n=Qe(e,this.schema.primKey.keyPath);if(void 0===n)return Wn(new jt.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?Le(t).forEach((n=>{Xe(e,n,t[n])})):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}}put(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let i=e;return r&&n&&(i=tr(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"put",values:[i],keys:null!=t?[t]:null}))).then((e=>e.numFailures?ln.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{Xe(e,r,t)}catch(e){}return t}))}delete(e){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:[e]}))).then((e=>e.numFailures?ln.reject(e.failures[0]):void 0))}clear(){return this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"deleteRange",range:er}))).then((e=>e.numFailures?ln.reject(e.failures[0]):void 0))}bulkGet(e){return this._trans("readonly",(t=>this.core.getMany({keys:e,trans:t}).then((e=>e.map((e=>this.hook.reading.fire(e)))))))}bulkAdd(e,t,n){const r=Array.isArray(t)?t:void 0,i=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:o}=this.schema.primKey;if(o&&r)throw new jt.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new jt.InvalidArgument("Arguments objects and keys must have the same length");const s=e.length;let a=o&&n?e.map(tr(o)):e;return this.core.mutate({trans:t,type:"add",keys:r,values:a,wantResults:i}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return i?t:n;throw new Pt(`${this.name}.bulkAdd(): ${e} of ${s} operations failed`,r)}))}))}bulkPut(e,t,n){const r=Array.isArray(t)?t:void 0,i=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:o}=this.schema.primKey;if(o&&r)throw new jt.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new jt.InvalidArgument("Arguments objects and keys must have the same length");const s=e.length;let a=o&&n?e.map(tr(o)):e;return this.core.mutate({trans:t,type:"put",keys:r,values:a,wantResults:i}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return i?t:n;throw new Pt(`${this.name}.bulkPut(): ${e} of ${s} operations failed`,r)}))}))}bulkDelete(e){const t=e.length;return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:e}))).then((({numFailures:e,lastResult:n,failures:r})=>{if(0===e)return n;throw new Pt(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,r)}))}}function rr(e){var t={},n=function(n,r){if(r){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return t[n].subscribe.apply(null,o),e}if("string"==typeof n)return t[n]};n.addEventType=o;for(var r=1,i=arguments.length;r<i;++r)o(arguments[r]);return n;function o(e,r,i){if("object"==typeof e)return s(e);r||(r=It),i||(i=At);var o={subscribers:[],fire:i,subscribe:function(e){-1===o.subscribers.indexOf(e)&&(o.subscribers.push(e),o.fire=r(o.fire,e))},unsubscribe:function(e){o.subscribers=o.subscribers.filter((function(t){return t!==e})),o.fire=o.subscribers.reduce(r,i)}};return t[e]=n[e]=o,o}function s(e){Le(e).forEach((function(t){var n=e[t];if(Ke(n))o(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new jt.InvalidArgument("Invalid event config");var r=o(t,Lt,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){Ge((function(){e.apply(null,t)}))}))}))}}))}}function ir(e,t){return qe(t).from({prototype:e}),t}function or(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function sr(e,t){e.filter=Zn(e.filter,t)}function ar(e,t,n){var r=e.replayFilter;e.replayFilter=r?()=>Zn(r(),t()):t,e.justLimit=n&&!r}function ur(e,t){if(e.isPrimKey)return t.primaryKey;const n=t.getIndexByKeyPath(e.index);if(!n)throw new jt.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function lr(e,t,n){const r=ur(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 cr(e,t,n,r){const i=e.replayFilter?Zn(e.filter,e.replayFilter()):e.filter;if(e.or){const o={},s=(e,n,r)=>{if(!i||i(n,r,(e=>n.stop(e)),(e=>n.fail(e)))){var s=n.primaryKey,a=""+s;"[object ArrayBuffer]"===a&&(a=""+new Uint8Array(s)),$e(o,a)||(o[a]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(s,n),hr(lr(e,r,n),e.algorithm,s,!e.keysOnly&&e.valueMapper)])}return hr(lr(e,r,n),Zn(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function hr(e,t,n,r){var i=Sn(r?(e,t,i)=>n(r(e),t,i):n);return e.then((e=>{if(e)return e.start((()=>{var n=()=>e.continue();t&&!t(e,(e=>n=e),(t=>{e.stop(t),n=At}),(t=>{e.fail(t),n=At}))||i(e.value,e,(e=>n=e)),n()}))}))}function fr(e,t){try{const n=dr(e),r=dr(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){const n=e.length,r=t.length,i=n<r?n:r;for(let n=0;n<i;++n)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return n===r?0:n<r?-1:1}(pr(e),pr(t));case"Array":return function(e,t){const n=e.length,r=t.length,i=n<r?n:r;for(let n=0;n<i;++n){const r=fr(e[n],t[n]);if(0!==r)return r}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function dr(e){const t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";const n=ut(e);return"ArrayBuffer"===n?"binary":n}function pr(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class gr{_read(e,t){var n=this._ctx;return n.error?n.table._trans(null,Wn.bind(null,n.error)):n.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,Wn.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=Zn(t.algorithm,e)}_iterate(e,t){return cr(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&Te(n,e),t._ctx=n,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read((n=>cr(t,e,n,t.table.core)))}count(e){return this._read((e=>{const t=this._ctx,n=t.table.core;if(or(t,!0))return n.count({trans:e,query:{index:ur(t,n.schema),range:t.range}}).then((e=>Math.min(e,t.limit)));var r=0;return cr(t,(()=>(++r,!1)),e,n).then((()=>r))})).then(e)}sortBy(e,t){const n=e.split(".").reverse(),r=n[0],i=n.length-1;function o(e,t){return t?o(e[n[t]],t-1):e[r]}var s="next"===this._ctx.dir?1:-1;function a(e,t){var n=o(e,i),r=o(t,i);return n<r?-s:n>r?s:0}return this.toArray((function(e){return e.sort(a)})).then(t)}toArray(e){return this._read((e=>{var t=this._ctx;if("next"===t.dir&&or(t,!0)&&t.limit>0){const{valueMapper:n}=t,r=ur(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:r,range:t.range}}).then((({result:e})=>n?e.map(n):e))}{const n=[];return cr(t,(e=>n.push(e)),e,t.table.core).then((()=>n))}}),e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,or(t)?ar(t,(()=>{var t=e;return(e,n)=>0===t||(1===t?(--t,!1):(n((()=>{e.advance(t),t=0})),!1))})):ar(t,(()=>{var t=e;return()=>--t<0}))),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),ar(this._ctx,(()=>{var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this}until(e,t){return sr(this._ctx,(function(n,r,i){return!e(n.value)||(r(i),t)})),this}first(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}last(e){return this.reverse().first(e)}filter(e){var t,n;return sr(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=Zn(t.isMatch,n),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))}keys(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)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&or(t,!0)&&t.limit>0)return this._read((e=>{var n=ur(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((({result:e})=>e)).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return sr(this._ctx,(function(e){var t=e.primaryKey.toString(),r=$e(n,t);return n[t]=!0,!r})),this}modify(e){var t=this._ctx;return this._write((n=>{var r;if("function"==typeof e)r=e;else{var i=Le(e),o=i.length;r=function(t){for(var n=!1,r=0;r<o;++r){var s=i[r],a=e[s];Qe(t,s)!==a&&(Xe(t,s,a),n=!0)}return n}}const s=t.table.core,{outbound:a,extractKey:u}=s.schema.primaryKey,l=this.db._options.modifyChunkSize||200,c=[];let h=0;const f=[],d=(e,t)=>{const{failures:n,numFailures:r}=t;h+=e-r;for(let e of Le(n))c.push(n[e])};return this.clone().primaryKeys().then((i=>{const o=c=>{const h=Math.min(l,i.length-c);return s.getMany({trans:n,keys:i.slice(c,c+h),cache:"immutable"}).then((f=>{const p=[],g=[],y=a?[]:null,v=[];for(let e=0;e<h;++e){const t=f[e],n={value:ot(t),primKey:i[c+e]};!1!==r.call(n,n.value,n)&&(null==n.value?v.push(i[c+e]):a||0===fr(u(t),u(n.value))?(g.push(n.value),a&&y.push(i[c+e])):(v.push(i[c+e]),p.push(n.value)))}const m=or(t)&&t.limit===1/0&&("function"!=typeof e||e===yr)&&{index:t.index,range:t.range};return Promise.resolve(p.length>0&&s.mutate({trans:n,type:"add",values:p}).then((e=>{for(let t in e.failures)v.splice(parseInt(t),1);d(p.length,e)}))).then((()=>(g.length>0||m&&"object"==typeof e)&&s.mutate({trans:n,type:"put",keys:y,values:g,criteria:m,changeSpec:"function"!=typeof e&&e}).then((e=>d(g.length,e))))).then((()=>(v.length>0||m&&e===yr)&&s.mutate({trans:n,type:"delete",keys:v,criteria:m}).then((e=>d(v.length,e))))).then((()=>i.length>c+h&&o(c+l)))}))};return o(0).then((()=>{if(c.length>0)throw new Ot("Error modifying one or more objects",c,h,f);return i.length}))}))}))}delete(){var e=this._ctx,t=e.range;return or(e)&&(e.isPrimKey&&!Qn||3===t.type)?this._write((n=>{const{primaryKey:r}=e.table.core.schema,i=t;return e.table.core.count({trans:n,query:{index:r,range:i}}).then((t=>e.table.core.mutate({trans:n,type:"deleteRange",range:i}).then((({failures:e,lastResult:n,results:r,numFailures:i})=>{if(i)throw new Ot("Could not delete some values",Object.keys(e).map((t=>e[t])),t-i);return t-i}))))})):this.modify(yr)}}const yr=(e,t)=>t.value=null;function vr(e,t){return e<t?-1:e===t?0:1}function mr(e,t){return e>t?-1:e===t?0:1}function br(e,t,n){var r=e instanceof Or?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function wr(e){return new e.Collection(e,(()=>Sr(""))).limit(0)}function _r(e,t,n,r,i,o){for(var s=Math.min(e.length,r.length),a=-1,u=0;u<s;++u){var l=t[u];if(l!==r[u])return i(e[u],n[u])<0?e.substr(0,u)+n[u]+n.substr(u+1):i(e[u],r[u])<0?e.substr(0,u)+r[u]+n.substr(u+1):a>=0?e.substr(0,a)+t[a]+n.substr(a+1):null;i(e[u],l)<0&&(a=u)}return s<r.length&&"next"===o?e+n.substr(e.length):s<e.length&&"prev"===o?e.substr(0,n.length):a<0?null:e.substr(0,a)+r[a]+n.substr(a+1)}function xr(e,t,n,r){var i,o,s,a,u,l,c,h=n.length;if(!n.every((e=>"string"==typeof e)))return br(e,"String expected.");function f(e){i=function(e){return"next"===e?e=>e.toUpperCase():e=>e.toLowerCase()}(e),o=function(e){return"next"===e?e=>e.toLowerCase():e=>e.toUpperCase()}(e),s="next"===e?vr:mr;var t=n.map((function(e){return{lower:o(e),upper:i(e)}})).sort((function(e,t){return s(e.lower,t.lower)}));a=t.map((function(e){return e.upper})),u=t.map((function(e){return e.lower})),l=e,c="next"===e?"":r}f("next");var d=new e.Collection(e,(()=>kr(a[0],u[h-1]+r)));d._ondirectionchange=function(e){f(e)};var p=0;return d._addAlgorithm((function(e,n,r){var i=e.key;if("string"!=typeof i)return!1;var f=o(i);if(t(f,u,p))return!0;for(var d=null,g=p;g<h;++g){var y=_r(i,f,a[g],u[g],s,l);null===y&&null===d?p=g+1:(null===d||s(d,y)>0)&&(d=y)}return n(null!==d?function(){e.continue(d+c)}:r),!1})),d}function kr(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Sr(e){return{type:1,lower:e,upper:e}}class Or{get Collection(){return this._ctx.table.db.Collection}between(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)?wr(this):new this.Collection(this,(()=>kr(e,t,!n,!r)))}catch(e){return br(this,zn)}}equals(e){return null==e?br(this,zn):new this.Collection(this,(()=>Sr(e)))}above(e){return null==e?br(this,zn):new this.Collection(this,(()=>kr(e,void 0,!0)))}aboveOrEqual(e){return null==e?br(this,zn):new this.Collection(this,(()=>kr(e,void 0,!1)))}below(e){return null==e?br(this,zn):new this.Collection(this,(()=>kr(void 0,e,!1,!0)))}belowOrEqual(e){return null==e?br(this,zn):new this.Collection(this,(()=>kr(void 0,e)))}startsWith(e){return"string"!=typeof e?br(this,"String expected."):this.between(e,e+Hn,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):xr(this,((e,t)=>0===e.indexOf(t[0])),[e],Hn)}equalsIgnoreCase(e){return xr(this,((e,t)=>e===t[0]),[e],"")}anyOfIgnoreCase(){var e=ft.apply(ht,arguments);return 0===e.length?wr(this):xr(this,((e,t)=>-1!==t.indexOf(e)),e,"")}startsWithAnyOfIgnoreCase(){var e=ft.apply(ht,arguments);return 0===e.length?wr(this):xr(this,((e,t)=>t.some((t=>0===e.indexOf(t)))),e,Hn)}anyOf(){const e=ft.apply(ht,arguments);let t=this._cmp;try{e.sort(t)}catch(e){return br(this,zn)}if(0===e.length)return wr(this);const n=new this.Collection(this,(()=>kr(e[0],e[e.length-1])));n._ondirectionchange=n=>{t="next"===n?this._ascending:this._descending,e.sort(t)};let r=0;return n._addAlgorithm(((n,i,o)=>{const s=n.key;for(;t(s,e[r])>0;)if(++r,r===e.length)return i(o),!1;return 0===t(s,e[r])||(i((()=>{n.continue(e[r])})),!1)})),n}notEqual(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const e=ft.apply(ht,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return br(this,zn)}const t=e.reduce(((e,t)=>e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}inAnyRange(e,t){const n=this._cmp,r=this._ascending,i=this._descending,o=this._min,s=this._max;if(0===e.length)return wr(this);if(!e.every((e=>void 0!==e[0]&&void 0!==e[1]&&r(e[0],e[1])<=0)))return br(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",jt.InvalidArgument);const a=!t||!1!==t.includeLowers,u=t&&!0===t.includeUppers;let l,c=r;function h(e,t){return c(e[0],t[0])}try{l=e.reduce((function(e,t){let r=0,i=e.length;for(;r<i;++r){const i=e[r];if(n(t[0],i[1])<0&&n(t[1],i[0])>0){i[0]=o(i[0],t[0]),i[1]=s(i[1],t[1]);break}}return r===i&&e.push(t),e}),[]),l.sort(h)}catch(e){return br(this,zn)}let f=0;const d=u?e=>r(e,l[f][1])>0:e=>r(e,l[f][1])>=0,p=a?e=>i(e,l[f][0])>0:e=>i(e,l[f][0])>=0;let g=d;const y=new this.Collection(this,(()=>kr(l[0][0],l[l.length-1][1],!a,!u)));return y._ondirectionchange=e=>{"next"===e?(g=d,c=r):(g=p,c=i),l.sort(h)},y._addAlgorithm(((e,t,n)=>{for(var i=e.key;g(i);)if(++f,f===l.length)return t(n),!1;return!!function(e){return!d(e)&&!p(e)}(i)||(0===this._cmp(i,l[f][1])||0===this._cmp(i,l[f][0])||t((()=>{c===r?e.continue(l[f][0]):e.continue(l[f][1])})),!1)})),y}startsWithAnyOf(){const e=ft.apply(ht,arguments);return e.every((e=>"string"==typeof e))?0===e.length?wr(this):this.inAnyRange(e.map((e=>[e,e+Hn]))):br(this,"startsWithAnyOf() only works with strings")}}function Pr(e){return Sn((function(t){return Er(t),e(t.target.error),!1}))}function Er(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}const Cr=rr(null,"storagemutated");class jr{_lock(){return Ye(!on.global),++this._reculock,1!==this._reculock||on.global||(on.lockOwnerFor=this),this}_unlock(){if(Ye(!on.global),0==--this._reculock)for(on.global||(on.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{In(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&on.lockOwnerFor!==this}create(e){if(!this.mode)return this;const t=this.db.idbdb,n=this.db._state.dbOpenError;if(Ye(!this.idbtrans),!e&&!t)switch(n&&n.name){case"DatabaseClosedError":throw new jt.DatabaseClosed(n);case"MissingAPIError":throw new jt.MissingAPI(n.message,n);default:throw new jt.OpenFailed(n)}if(!this.active)throw new jt.TransactionInactive;return Ye(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=Sn((t=>{Er(t),this._reject(e.error)})),e.onabort=Sn((t=>{Er(t),this.active&&this._reject(new jt.Abort(e.error)),this.active=!1,this.on("abort").fire(t)})),e.oncomplete=Sn((()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&Cr.storagemutated.fire(e.mutatedParts)})),this}_promise(e,t,n){if("readwrite"===e&&"readwrite"!==this.mode)return Wn(new jt.ReadOnly("Transaction is readonly"));if(!this.active)return Wn(new jt.TransactionInactive);if(this._locked())return new ln(((r,i)=>{this._blockedFuncs.push([()=>{this._promise(e,t,n).then(r,i)},on])}));if(n)return Dn((()=>{var e=new ln(((e,n)=>{this._lock();const r=t(e,n,this);r&&r.then&&r.then(e,n)}));return e.finally((()=>this._unlock())),e._lib=!0,e}));var r=new ln(((e,n)=>{var r=t(e,n,this);r&&r.then&&r.then(e,n)}));return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();const n=ln.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((()=>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 i=t._waitingFor;return new ln(((e,r)=>{n.then((n=>t._waitingQueue.push(Sn(e.bind(null,n)))),(e=>t._waitingQueue.push(Sn(r.bind(null,e))))).finally((()=>{t._waitingFor===i&&(t._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new jt.Abort))}table(e){const t=this._memoizedTables||(this._memoizedTables={});if($e(t,e))return t[e];const n=this.schema[e];if(!n)throw new jt.NotFound("Table "+e+" not part of transaction");const r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}}function Rr(e,t,n,r,i,o,s){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!s?"&":"")+(r?"*":"")+(i?"++":"")+Dr(t)}}function Dr(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Ar(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:Je(n,(e=>[e.name,e]))}}let Lr=e=>{try{return e.only([[]]),Lr=()=>[[]],[[]]}catch(e){return Lr=()=>Hn,Hn}};function Kr(e){return null==e?()=>{}:"string"==typeof e?function(e){return 1===e.split(".").length?t=>t[e]:t=>Qe(t,e)}(e):t=>Qe(t,e)}function Tr(e){return[].slice.call(e)}let Nr=0;function Mr(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function $r(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:n,upper:r,lowerOpen:i,upperOpen:o}=e;return void 0===n?void 0===r?null:t.upperBound(r,!!o):void 0===r?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!o)}const{schema:i,hasGetAll:o}=function(e,t){const n=Tr(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((e=>t.objectStore(e))).map((e=>{const{keyPath:t,autoIncrement:n}=e,r=Ke(t),i=null==t,o={},s={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:Kr(t)},indexes:Tr(e.indexNames).map((t=>e.index(t))).map((e=>{const{name:t,unique:n,multiEntry:r,keyPath:i}=e,s={name:t,compound:Ke(i),keyPath:i,unique:n,multiEntry:r,extractKey:Kr(i)};return o[Mr(i)]=s,s})),getIndexByKeyPath:e=>o[Mr(e)]};return o[":id"]=s.primaryKey,null!=t&&(o[Mr(t)]=s.primaryKey),s}))},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,n),s=i.tables.map((e=>function(e){const t=e.name;return{name:t,schema:e,mutate:function({trans:e,type:n,keys:i,values:o,range:s}){return new Promise(((a,u)=>{a=Sn(a);const l=e.objectStore(t),c=null==l.keyPath,h="put"===n||"add"===n;if(!h&&"delete"!==n&&"deleteRange"!==n)throw new Error("Invalid operation type: "+n);const{length:f}=i||o||{length:1};if(i&&o&&i.length!==o.length)throw new Error("Given keys array must have same length as given values array.");if(0===f)return a({numFailures:0,failures:{},results:[],lastResult:void 0});let d;const p=[],g=[];let y=0;const v=e=>{++y,Er(e)};if("deleteRange"===n){if(4===s.type)return a({numFailures:y,failures:g,results:[],lastResult:void 0});3===s.type?p.push(d=l.clear()):p.push(d=l.delete(r(s)))}else{const[e,t]=h?c?[o,i]:[o,null]:[i,null];if(h)for(let r=0;r<f;++r)p.push(d=t&&void 0!==t[r]?l[n](e[r],t[r]):l[n](e[r])),d.onerror=v;else for(let t=0;t<f;++t)p.push(d=l[n](e[t])),d.onerror=v}const m=e=>{const t=e.target.result;p.forEach(((e,t)=>null!=e.error&&(g[t]=e.error))),a({numFailures:y,failures:g,results:"delete"===n?i:p.map((e=>e.result)),lastResult:t})};d.onerror=e=>{v(e),m(e)},d.onsuccess=m}))},getMany:({trans:e,keys:n})=>new Promise(((r,i)=>{r=Sn(r);const o=e.objectStore(t),s=n.length,a=new Array(s);let u,l=0,c=0;const h=e=>{const t=e.target;a[t._pos]=t.result,++c===l&&r(a)},f=Pr(i);for(let e=0;e<s;++e)null!=n[e]&&(u=o.get(n[e]),u._pos=e,u.onsuccess=h,u.onerror=f,++l);0===l&&r(a)})),get:({trans:e,key:n})=>new Promise(((r,i)=>{r=Sn(r);const o=e.objectStore(t).get(n);o.onsuccess=e=>r(e.target.result),o.onerror=Pr(i)})),query:function(e){return n=>new Promise(((i,o)=>{i=Sn(i);const{trans:s,values:a,limit:u,query:l}=n,c=u===1/0?void 0:u,{index:h,range:f}=l,d=s.objectStore(t),p=h.isPrimaryKey?d:d.index(h.name),g=r(f);if(0===u)return i({result:[]});if(e){const e=a?p.getAll(g,c):p.getAllKeys(g,c);e.onsuccess=e=>i({result:e.target.result}),e.onerror=Pr(o)}else{let e=0;const t=a||!("openKeyCursor"in p)?p.openCursor(g):p.openKeyCursor(g),n=[];t.onsuccess=r=>{const o=t.result;return o?(n.push(a?o.value:o.primaryKey),++e===u?i({result:n}):void o.continue()):i({result:n})},t.onerror=Pr(o)}}))}(o),openCursor:function({trans:e,values:n,query:i,reverse:o,unique:s}){return new Promise(((a,u)=>{a=Sn(a);const{index:l,range:c}=i,h=e.objectStore(t),f=l.isPrimaryKey?h:h.index(l.name),d=o?s?"prevunique":"prev":s?"nextunique":"next",p=n||!("openKeyCursor"in f)?f.openCursor(r(c),d):f.openKeyCursor(r(c),d);p.onerror=Pr(u),p.onsuccess=Sn((t=>{const n=p.result;if(!n)return void a(null);n.___id=++Nr,n.done=!1;const r=n.continue.bind(n);let i=n.continuePrimaryKey;i&&(i=i.bind(n));const o=n.advance.bind(n),s=()=>{throw new Error("Cursor not stopped")};n.trans=e,n.stop=n.continue=n.continuePrimaryKey=n.advance=()=>{throw new Error("Cursor not started")},n.fail=Sn(u),n.next=function(){let e=1;return this.start((()=>e--?this.continue():this.stop())).then((()=>this))},n.start=e=>{const t=new Promise(((e,t)=>{e=Sn(e),p.onerror=Pr(t),n.fail=t,n.stop=t=>{n.stop=n.continue=n.continuePrimaryKey=n.advance=s,e(t)}})),a=()=>{if(p.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=()=>{throw new Error("Cursor behind last entry")},n.stop()};return p.onsuccess=Sn((e=>{p.onsuccess=a,a()})),n.continue=r,n.continuePrimaryKey=i,n.advance=o,a(),t},a(n)}),u)}))},count({query:e,trans:n}){const{index:i,range:o}=e;return new Promise(((e,s)=>{const a=n.objectStore(t),u=i.isPrimaryKey?a:a.index(i.name),l=r(o),c=l?u.count(l):u.count();c.onsuccess=Sn((t=>e(t.target.result))),c.onerror=Pr(s)}))}}}(e))),a={};return s.forEach((e=>a[e.name]=e)),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!a[e])throw new Error(`Table '${e}' not found`);return a[e]},MIN_KEY:-1/0,MAX_KEY:Lr(t),schema:i}}function Ir({_novip:e},t){const n=t.db,r=function(e,t,{IDBKeyRange:n,indexedDB:r},i){const o=function(e,t){return t.reduce(((e,{create:t})=>({...e,...t(e)})),e)}($r(t,n,i),e.dbcore);return{dbcore:o}}(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach((t=>{const n=t.name;e.core.schema.tables.some((e=>e.name===n))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function Fr({_novip:e},t,n,r){n.forEach((n=>{const i=r[n];t.forEach((t=>{const r=We(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?Be(t,n,{get(){return this.table(n)},set(e){Fe(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,i))}))}))}function Br({_novip:e},t){t.forEach((t=>{for(let n in t)t[n]instanceof e.Table&&delete t[n]}))}function qr(e,t){return e._cfg.version-t._cfg.version}function Ur(e,t,n,r){const i=e._dbSchema,o=e._createTransaction("readwrite",e._storeNames,i);o.create(n),o._completion.catch(r);const s=o._reject.bind(o),a=on.transless||on;Dn((()=>{on.trans=o,on.transless=a,0===t?(Le(i).forEach((e=>{Vr(n,e,i[e].primKey,i[e].indexes)})),Ir(e,n),ln.follow((()=>e.on.populate.fire(o))).catch(s)):function({_novip:e},t,n,r){const i=[],o=e._versions;let s=e._dbSchema=zr(0,e.idbdb,r),a=!1;return o.filter((e=>e._cfg.version>=t)).forEach((o=>{i.push((()=>{const i=s,u=o._cfg.dbschema;Yr(e,i,r),Yr(e,u,r),s=e._dbSchema=u;const l=Wr(i,u);l.add.forEach((e=>{Vr(r,e[0],e[1].primKey,e[1].indexes)})),l.change.forEach((e=>{if(e.recreate)throw new jt.Upgrade("Not yet support for changing primary key");{const t=r.objectStore(e.name);e.add.forEach((e=>Hr(t,e))),e.change.forEach((e=>{t.deleteIndex(e.name),Hr(t,e)})),e.del.forEach((e=>t.deleteIndex(e)))}}));const c=o._cfg.contentUpgrade;if(c&&o._cfg.version>t){Ir(e,r),n._memoizedTables={},a=!0;let t=Ze(u);l.del.forEach((e=>{t[e]=i[e]})),Br(e,[e.Transaction.prototype]),Fr(e,[e.Transaction.prototype],Le(t),t),n.schema=t;const o=dt(c);let s;o&&An();const h=ln.follow((()=>{if(s=c(n),s&&o){var e=Ln.bind(null,null);s.then(e,e)}}));return s&&"function"==typeof s.then?ln.resolve(s):h.then((()=>s))}})),i.push((t=>{a&&Jn||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((n=>null==e[n]&&t.db.deleteObjectStore(n)))}(o._cfg.dbschema,t),Br(e,[e.Transaction.prototype]),Fr(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}))})),function e(){return i.length?ln.resolve(i.shift()(n.idbtrans)).then(e):ln.resolve()}().then((()=>{var e,t;t=r,Le(e=s).forEach((n=>{t.db.objectStoreNames.contains(n)||Vr(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,o,n).catch(s)}))}function Wr(e,t){const n={del:[],add:[],change:[]};let r;for(r in e)t[r]||n.del.push(r);for(r in t){const i=e[r],o=t[r];if(i){const e={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto&&!Gn)e.recreate=!0,n.change.push(e);else{const t=i.idxByName,r=o.idxByName;let s;for(s in t)r[s]||e.del.push(s);for(s in r){const n=t[s],i=r[s];n?n.src!==i.src&&e.change.push(i):e.add.push(i)}(e.del.length>0||e.add.length>0||e.change.length>0)&&n.change.push(e)}}else n.add.push([r,o])}return n}function Vr(e,t,n,r){const i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((e=>Hr(i,e))),i}function Hr(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function zr(e,t,n){const r={};return He(t.objectStoreNames,0).forEach((e=>{const t=n.objectStore(e);let i=t.keyPath;const o=Rr(Dr(i),i||"",!1,!1,!!t.autoIncrement,i&&"string"!=typeof i,!0),s=[];for(let e=0;e<t.indexNames.length;++e){const n=t.index(t.indexNames[e]);i=n.keyPath;var a=Rr(n.name,i,!!n.unique,!!n.multiEntry,!1,i&&"string"!=typeof i,!1);s.push(a)}r[e]=Ar(e,o,s)})),r}function Yr({_novip:e},t,n){const r=n.db.objectStoreNames;for(let i=0;i<r.length;++i){const o=r[i],s=n.objectStore(o);e._hasGetAll="getAll"in s;for(let e=0;e<s.indexNames.length;++e){const n=s.indexNames[e],r=s.index(n).keyPath,i="string"==typeof r?r:"["+He(r).join("+")+"]";if(t[o]){const e=t[o].idxByName[i];e&&(e.name=n,delete t[o].idxByName[i],t[o].idxByName[n]=e)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&Ae.WorkerGlobalScope&&Ae instanceof Ae.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class Gr{_parseStoresSpec(e,t){Le(e).forEach((n=>{if(null!==e[n]){var r=e[n].split(",").map(((e,t)=>{const n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return Rr(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),Ke(r),0===t)})),i=r.shift();if(i.multi)throw new jt.Schema("Primary key cannot be multi-valued");r.forEach((e=>{if(e.auto)throw new jt.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new jt.Schema("Index must have a name and cannot be an empty string")})),t[n]=Ar(n,i,r)}}))}stores(e){const t=this.db;this._cfg.storesSource=this._cfg.storesSource?Te(this._cfg.storesSource,e):e;const n=t._versions,r={};let i={};return n.forEach((e=>{Te(r,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(r,i)})),t._dbSchema=i,Br(t,[t._allTables,t,t.Transaction.prototype]),Fr(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],Le(i),i),t._storeNames=Le(i),this}upgrade(e){return this._cfg.contentUpgrade=Ft(this._cfg.contentUpgrade||At,e),this}}function Jr(e,t){let n=e._dbNamesDB;return n||(n=e._dbNamesDB=new vi("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t}),n.version(1).stores({dbnames:"name"})),n.table("dbnames")}function Qr(e){return e&&"function"==typeof e.databases}function Xr(e){return Dn((function(){return on.letThrough=!0,e()}))}function Zr(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()})).finally((function(){return clearInterval(e)})):Promise.resolve()}function ei(e){var t=t=>e.next(t),n=i(t),r=i((t=>e.throw(t)));function i(e){return t=>{var i=e(t),o=i.value;return i.done?o:o&&"function"==typeof o.then?o.then(n,r):Ke(o)?Promise.all(o).then(n,r):n(o)}}return i(t)()}function ti(e,t,n){var r=arguments.length;if(r<2)throw new jt.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];n=i.pop();var o=tt(i);return[e,o,n]}function ni(e,t,n,r,i){return ln.resolve().then((()=>{const o=on.transless||on,s=e._createTransaction(t,n,e._dbSchema,r),a={trans:s,transless:o};if(r)s.idbtrans=r.idbtrans;else try{s.create(),e._state.PR1398_maxLoop=3}catch(r){return r.name===Et.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>ni(e,t,n,null,i)))):Wn(r)}const u=dt(i);let l;u&&An();const c=ln.follow((()=>{if(l=i.call(s,s),l)if(u){var e=Ln.bind(null,null);l.then(e,e)}else"function"==typeof l.next&&"function"==typeof l.throw&&(l=ei(l))}),a);return(l&&"function"==typeof l.then?ln.resolve(l).then((e=>s.active?e:Wn(new jt.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):c.then((()=>l))).then((e=>(r&&s._resolve(),s._completion.then((()=>e))))).catch((e=>(s._reject(e),Wn(e))))}))}function ri(e,t,n){const r=Ke(e)?e.slice():[e];for(let e=0;e<n;++e)r.push(t);return r}const ii={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){const n=e.table(t),{schema:r}=n,i={},o=[];function s(e,t,n){const r=Mr(e),a=i[r]=i[r]||[],u=null==e?0:"string"==typeof e?1:e.length,l=t>0,c={...n,isVirtual:l,keyTail:t,keyLength:u,extractKey:Kr(e),unique:!l&&n.unique};return a.push(c),c.isPrimaryKey||o.push(c),u>1&&s(2===u?e[0]:e.slice(0,u-1),t+1,n),a.sort(((e,t)=>e.keyTail-t.keyTail)),c}const a=s(r.primaryKey.keyPath,0,r.primaryKey);i[":id"]=[a];for(const e of r.indexes)s(e.keyPath,0,e);function u(t){const n=t.query.index;return n.isVirtual?{...t,query:{index:n,range:(r=t.query.range,i=n.keyTail,{type:1===r.type?2:r.type,lower:ri(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,i),lowerOpen:!0,upper:ri(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,i),upperOpen:!0})}}:t;var r,i}const l={...n,schema:{...r,primaryKey:a,indexes:o,getIndexByKeyPath:function(e){const t=i[Mr(e)];return t&&t[0]}},count:e=>n.count(u(e)),query:e=>n.query(u(e)),openCursor(t){const{keyTail:r,isVirtual:i,keyLength:o}=t.query.index;return i?n.openCursor(u(t)).then((n=>n&&function(n){const i=Object.create(n,{continue:{value:function(i){null!=i?n.continue(ri(i,t.reverse?e.MAX_KEY:e.MIN_KEY,r)):t.unique?n.continue(n.key.slice(0,o).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,r)):n.continue()}},continuePrimaryKey:{value(t,i){n.continuePrimaryKey(ri(t,e.MAX_KEY,r),i)}},primaryKey:{get:()=>n.primaryKey},key:{get(){const e=n.key;return 1===o?e[0]:e.slice(0,o)}},value:{get:()=>n.value}});return i}(n))):n.openCursor(t)}};return l}}}};function oi(e,t,n,r){return n=n||{},r=r||"",Le(e).forEach((i=>{if($e(t,i)){var o=e[i],s=t[i];if("object"==typeof o&&"object"==typeof s&&o&&s){const e=ut(o);e!==ut(s)?n[r+i]=t[i]:"Object"===e?oi(o,s,n,r+i+"."):o!==s&&(n[r+i]=t[i])}else o!==s&&(n[r+i]=t[i])}else n[r+i]=void 0})),Le(t).forEach((i=>{$e(e,i)||(n[r+i]=t[i])})),n}const si={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){const n=e.table(t),{primaryKey:r}=n.schema,i={...n,mutate(e){const i=on.trans,{deleting:o,creating:s,updating:a}=i.table(t).hook;switch(e.type){case"add":if(s.fire===At)break;return i._promise("readwrite",(()=>u(e)),!0);case"put":if(s.fire===At&&a.fire===At)break;return i._promise("readwrite",(()=>u(e)),!0);case"delete":if(o.fire===At)break;return i._promise("readwrite",(()=>u(e)),!0);case"deleteRange":if(o.fire===At)break;return i._promise("readwrite",(()=>function(e){return l(e.trans,e.range,1e4)}(e)),!0)}return n.mutate(e);function u(e){const t=on.trans,i=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(r,e);if(!i)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:i}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),function(e,t,n){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:"immutable"})}(n,e,i).then((u=>{const l=i.map(((n,i)=>{const l=u[i],c={onerror:null,onsuccess:null};if("delete"===e.type)o.fire.call(c,n,l,t);else if("add"===e.type||void 0===l){const o=s.fire.call(c,n,e.values[i],t);null==n&&null!=o&&(n=o,e.keys[i]=n,r.outbound||Xe(e.values[i],r.keyPath,n))}else{const r=oi(l,e.values[i]),o=a.fire.call(c,r,n,l,t);if(o){const t=e.values[i];Object.keys(o).forEach((e=>{$e(t,e)?t[e]=o[e]:Xe(t,e,o[e])}))}}return c}));return n.mutate(e).then((({failures:t,results:n,numFailures:r,lastResult:o})=>{for(let r=0;r<i.length;++r){const o=n?n[r]:i[r],s=l[r];null==o?s.onerror&&s.onerror(t[r]):s.onsuccess&&s.onsuccess("put"===e.type&&u[r]?e.values[r]:o)}return{failures:t,results:n,numFailures:r,lastResult:o}})).catch((e=>(l.forEach((t=>t.onerror&&t.onerror(e))),Promise.reject(e))))}))}function l(e,t,i){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:i}).then((({result:n})=>u({type:"delete",keys:n,trans:e}).then((r=>r.numFailures>0?Promise.reject(r.failures[0]):n.length<i?{failures:[],numFailures:0,lastResult:void 0}:l(e,{...t,lower:n[n.length-1],lowerOpen:!0},i)))))}}};return i}})};function ai(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;const r=[];for(let i=0,o=0;i<t.keys.length&&o<e.length;++i)0===fr(t.keys[i],e[o])&&(r.push(n?ot(t.values[i]):t.values[i]),++o);return r.length===e.length?r:null}catch(e){return null}}const ui={stack:"dbcore",level:-1,create:e=>({table:t=>{const n=e.table(t);return{...n,getMany:e=>{if(!e.cache)return n.getMany(e);const t=ai(e.keys,e.trans._cache,"clone"===e.cache);return t?ln.resolve(t):n.getMany(e).then((t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?ot(t):t},t)))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),n.mutate(e))}}})};function li(e){return!("from"in e)}const ci=function(e,t){if(!this){const t=new ci;return e&&"d"in e&&Te(t,e),t}Te(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function hi(e,t,n){const r=fr(t,n);if(isNaN(r))return;if(r>0)throw RangeError();if(li(e))return Te(e,{from:t,to:n,d:1});const i=e.l,o=e.r;if(fr(n,e.from)<0)return i?hi(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},pi(e);if(fr(t,e.to)>0)return o?hi(o,t,n):e.r={from:t,to:n,d:1,l:null,r:null},pi(e);fr(t,e.from)<0&&(e.from=t,e.l=null,e.d=o?o.d+1:1),fr(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);const s=!e.r;i&&!e.l&&fi(e,i),o&&s&&fi(e,o)}function fi(e,t){li(t)||function e(t,{from:n,to:r,l:i,r:o}){hi(t,n,r),i&&e(t,i),o&&e(t,o)}(e,t)}function di(e){let t=li(e)?null:{s:0,n:e};return{next(e){const n=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&fr(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||fr(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function pi(e){var t,n;const r=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(n=e.l)||void 0===n?void 0:n.d)||0),i=r>1?"r":r<-1?"l":"";if(i){const t="r"===i?"l":"r",n={...e},r=e[i];e.from=r.from,e.to=r.to,e[i]=r[i],n[i]=r[t],e[t]=n,n.d=gi(n)}e.d=gi(e)}function gi({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}Ie(ci.prototype,{add(e){return fi(this,e),this},addKey(e){return hi(this,e,e),this},addKeys(e){return e.forEach((e=>hi(this,e,e))),this},[lt](){return di(this)}});const yi={stack:"dbcore",level:0,create:e=>{const t=e.schema.name,n=new ci(e.MIN_KEY,e.MAX_KEY);return{...e,table:r=>{const i=e.table(r),{schema:o}=i,{primaryKey:s}=o,{extractKey:a,outbound:u}=s,l={...i,mutate:e=>{const s=e.trans,a=s.mutatedParts||(s.mutatedParts={}),u=e=>{const n=`idb://${t}/${r}/${e}`;return a[n]||(a[n]=new ci)},l=u(""),c=u(":dels"),{type:h}=e;let[f,d]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[];const p=e.trans._cache;return i.mutate(e).then((e=>{if(Ke(f)){"delete"!==h&&(f=e.results),l.addKeys(f);const t=ai(f,p);t||"add"===h||c.addKeys(f),(t||d)&&function(e,t,n,r){t.indexes.forEach((function(t){const i=e(t.name||"");function o(e){return null!=e?t.extractKey(e):null}const s=e=>t.multiEntry&&Ke(e)?e.forEach((e=>i.addKey(e))):i.addKey(e);(n||r).forEach(((e,t)=>{const i=n&&o(n[t]),a=r&&o(r[t]);0!==fr(i,a)&&(null!=i&&s(i),null!=a&&s(a))}))}))}(u,o,t,d)}else if(f){const e={from:f.lower,to:f.upper};c.add(e),l.add(e)}else l.add(n),c.add(n),o.indexes.forEach((e=>u(e.name).add(n)));return e}))}},c=({query:{index:t,range:n}})=>{var r,i;return[t,new ci(null!==(r=n.lower)&&void 0!==r?r:e.MIN_KEY,null!==(i=n.upper)&&void 0!==i?i:e.MAX_KEY)]},h={get:e=>[s,new ci(e.key)],getMany:e=>[s,(new ci).addKeys(e.keys)],count:c,query:c,openCursor:c};return Le(h).forEach((e=>{l[e]=function(o){const{subscr:s}=on;if(s){const l=e=>{const n=`idb://${t}/${r}/${e}`;return s[n]||(s[n]=new ci)},c=l(""),f=l(":dels"),[d,p]=h[e](o);if(l(d.name||"").add(p),!d.isPrimaryKey){if("count"!==e){const t="query"===e&&u&&o.values&&i.query({...o,values:!1});return i[e].apply(this,arguments).then((n=>{if("query"===e){if(u&&o.values)return t.then((({result:e})=>(c.addKeys(e),n)));const e=o.values?n.result.map(a):n.result;o.values?c.addKeys(e):f.addKeys(e)}else if("openCursor"===e){const e=n,t=o.values;return e&&Object.create(e,{key:{get:()=>(f.addKey(e.primaryKey),e.key)},primaryKey:{get(){const t=e.primaryKey;return f.addKey(t),t}},value:{get:()=>(t&&c.addKey(e.primaryKey),e.value)}})}return n}))}f.add(n)}}return i[e].apply(this,arguments)}})),l}}}};class vi{constructor(e,t){this._middlewares={},this.verno=0;const n=vi.dependencies;this._options=t={addons:vi.addons,autoOpen:!0,indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:r}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const i={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:At,dbReadyPromise:null,cancelOpen:At,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var o;i.dbReadyPromise=new ln((e=>{i.dbReadyResolve=e})),i.openCanceller=new ln(((e,t)=>{i.cancelOpen=t})),this._state=i,this.name=e,this.on=rr(this,"populate","blocked","versionchange","close",{ready:[Ft,At]}),this.on.ready.subscribe=ze(this.on.ready.subscribe,(e=>(t,n)=>{vi.vip((()=>{const r=this._state;if(r.openComplete)r.dbOpenError||ln.resolve().then(t),n&&e(t);else if(r.onReadyBeingFired)r.onReadyBeingFired.push(t),n&&e(t);else{e(t);const r=this;n||e((function e(){r.on.ready.unsubscribe(t),r.on.ready.unsubscribe(e)}))}}))})),this.Collection=(o=this,ir(gr.prototype,(function(e,t){this.db=o;let n=er,r=null;if(t)try{n=t()}catch(e){r=e}const i=e._ctx,s=i.table,a=s.hook.reading.fire;this._ctx={table:s,index:i.index,isPrimKey:!i.index||s.schema.primKey.keyPath&&i.index===s.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:i.or,valueMapper:a!==Lt?a:null}}))),this.Table=function(e){return ir(nr.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:rr(null,{creating:[Nt,At],reading:[Kt,Lt],updating:[$t,At],deleting:[Mt,At]})}))}(this),this.Transaction=function(e){return ir(jr.prototype,(function(t,n,r,i,o){this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=i,this.idbtrans=null,this.on=rr(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 ln(((e,t)=>{this._resolve=e,this._reject=t})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),Wn(e)}))}))}(this),this.Version=function(e){return ir(Gr.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return ir(Or.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};const i=e._deps.indexedDB;if(!i)throw new jt.MissingAPI;this._cmp=this._ascending=i.cmp.bind(i),this._descending=(e,t)=>i.cmp(t,e),this._max=(e,t)=>i.cmp(e,t)>0?e:t,this._min=(e,t)=>i.cmp(e,t)<0?e:t,this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()})),this.on("blocked",(e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)})),this._maxKey=Lr(t.IDBKeyRange),this._createTransaction=(e,t,n,r)=>new this.Transaction(e,t,n,this._options.chromeTransactionDurability,r),this._fireOnBlocked=e=>{this.on("blocked").fire(e),Yn.filter((e=>e.name===this.name&&e!==this&&!e._state.vcFired)).map((t=>t.on("versionchange").fire(e)))},this.use(ii),this.use(si),this.use(yi),this.use(ui),this.vip=Object.create(this,{_vip:{value:!0}}),r.forEach((e=>e(this)))}version(e){if(isNaN(e)||e<.1)throw new jt.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new jt.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);const t=this._versions;var n=t.filter((t=>t._cfg.version===e))[0];return n||(n=new this.Version(e),t.push(n),t.sort(qr),n.stores({}),this._state.autoSchema=!1,n)}_whenReady(e){return this.idbdb&&(this._state.openComplete||on.letThrough||this._vip)?e():new ln(((e,t)=>{if(this._state.openComplete)return t(new jt.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new jt.DatabaseClosed);this.open().catch(At)}this._state.dbReadyPromise.then(e,t)})).then(e)}use({stack:e,create:t,level:n,name:r}){r&&this.unuse({stack:e,name:r});const i=this._middlewares[e]||(this._middlewares[e]=[]);return i.push({stack:e,create:t,level:null==n?10:n,name:r}),i.sort(((e,t)=>e.level-t.level)),this}unuse({stack:e,name:t,create:n}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((e=>n?e.create!==n:!!t&&e.name!==t))),this}open(){return function(e){const t=e._state,{indexedDB:n}=e._deps;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((()=>t.dbOpenError?Wn(t.dbOpenError):e));pt&&(t.openCanceller._stackHolder=mt()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;const r=t.openCanceller;function i(){if(t.openCanceller!==r)throw new jt.DatabaseClosed("db.open() was cancelled")}let o=t.dbReadyResolve,s=null,a=!1;return ln.race([r,("undefined"==typeof navigator?ln.resolve():Zr()).then((()=>new ln(((r,o)=>{if(i(),!n)throw new jt.MissingAPI;const u=e.name,l=t.autoSchema?n.open(u):n.open(u,Math.round(10*e.verno));if(!l)throw new jt.MissingAPI;l.onerror=Pr(o),l.onblocked=Sn(e._fireOnBlocked),l.onupgradeneeded=Sn((r=>{if(s=l.transaction,t.autoSchema&&!e._options.allowEmptyDB){l.onerror=Er,s.abort(),l.result.close();const e=n.deleteDatabase(u);e.onsuccess=e.onerror=Sn((()=>{o(new jt.NoSuchDatabase(`Database ${u} doesnt exist`))}))}else{s.onerror=Pr(o);var i=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;a=i<1,e._novip.idbdb=l.result,Ur(e,i/10,s,o)}}),o),l.onsuccess=Sn((()=>{s=null;const n=e._novip.idbdb=l.result,i=He(n.objectStoreNames);if(i.length>0)try{const r=n.transaction(1===(o=i).length?o[0]:o,"readonly");t.autoSchema?function({_novip:e},t,n){e.verno=t.version/10;const r=e._dbSchema=zr(0,t,n);e._storeNames=He(t.objectStoreNames,0),Fr(e,[e._allTables],Le(r),r)}(e,n,r):(Yr(e,e._dbSchema,r),function(e,t){const n=Wr(zr(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some((e=>e.add.length||e.change.length)))}(e,r)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Ir(e,r)}catch(e){}var o;Yn.push(e),n.onversionchange=Sn((n=>{t.vcFired=!0,e.on("versionchange").fire(n)})),n.onclose=Sn((t=>{e.on("close").fire(t)})),a&&function({indexedDB:e,IDBKeyRange:t},n){!Qr(e)&&"__dbnames"!==n&&Jr(e,t).put({name:n}).catch(At)}(e._deps,u),r()}),o)}))))]).then((()=>(i(),t.onReadyBeingFired=[],ln.resolve(Xr((()=>e.on.ready.fire(e.vip)))).then((function n(){if(t.onReadyBeingFired.length>0){let r=t.onReadyBeingFired.reduce(Ft,At);return t.onReadyBeingFired=[],ln.resolve(Xr((()=>r(e.vip)))).then(n)}}))))).finally((()=>{t.onReadyBeingFired=null,t.isBeingOpened=!1})).then((()=>e)).catch((n=>{t.dbOpenError=n;try{s&&s.abort()}catch(e){}return r===t.openCanceller&&e._close(),Wn(n)})).finally((()=>{t.openComplete=!0,o()}))}(this)}_close(){const e=this._state,t=Yn.indexOf(this);if(t>=0&&Yn.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new ln((t=>{e.dbReadyResolve=t})),e.openCanceller=new ln(((t,n)=>{e.cancelOpen=n}))}close(){this._close();const e=this._state;this._options.autoOpen=!1,e.dbOpenError=new jt.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){const e=arguments.length>0,t=this._state;return new ln(((n,r)=>{const i=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=Sn((()=>{!function({indexedDB:e,IDBKeyRange:t},n){!Qr(e)&&"__dbnames"!==n&&Jr(e,t).delete(n).catch(At)}(this._deps,this.name),n()})),e.onerror=Pr(r),e.onblocked=this._fireOnBlocked};if(e)throw new jt.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(i):i()}))}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){const e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return Le(this._allTables).map((e=>this._allTables[e]))}transaction(){const e=ti.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,n){let r=on.trans;r&&r.db===this&&-1===e.indexOf("!")||(r=null);const i=-1!==e.indexOf("?");let o,s;e=e.replace("!","").replace("?","");try{if(s=t.map((e=>{var t=e instanceof this.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||"readonly"===e)o="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new jt.InvalidArgument("Invalid transaction mode: "+e);o="readwrite"}if(r){if("readonly"===r.mode&&"readwrite"===o){if(!i)throw new jt.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&s.forEach((e=>{if(r&&-1===r.storeNames.indexOf(e)){if(!i)throw new jt.SubTransaction("Table "+e+" not included in parent transaction.");r=null}})),i&&r&&!r.active&&(r=null)}}catch(e){return r?r._promise(null,((t,n)=>{n(e)})):Wn(e)}const a=ni.bind(null,this,o,s,r,n);return r?r._promise(o,a,"lock"):on.trans?In(on.transless,(()=>this._whenReady(a))):this._whenReady(a)}table(e){if(!$e(this._allTables,e))throw new jt.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}const mi="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class bi{constructor(e){this._subscribe=e}subscribe(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}[mi](){return this}}function wi(e,t){return Le(t).forEach((n=>{fi(e[n]||(e[n]=new ci),t[n])})),e}let _i;try{_i={indexedDB:Ae.indexedDB||Ae.mozIndexedDB||Ae.webkitIndexedDB||Ae.msIndexedDB,IDBKeyRange:Ae.IDBKeyRange||Ae.webkitIDBKeyRange}}catch(Ae){_i={indexedDB:null,IDBKeyRange:null}}const xi=vi;function ki(e){let t=Si;try{Si=!0,Cr.storagemutated.fire(e)}finally{Si=t}}Ie(xi,{...Dt,delete:e=>new xi(e,{addons:[]}).delete(),exists:e=>new xi(e,{addons:[]}).open().then((e=>(e.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(e){try{return function({indexedDB:e,IDBKeyRange:t}){return Qr(e)?Promise.resolve(e.databases()).then((e=>e.map((e=>e.name)).filter((e=>"__dbnames"!==e)))):Jr(e,t).toCollection().primaryKeys()}(xi.dependencies).then(e)}catch(e){return Wn(new jt.MissingAPI)}},defineClass:()=>function(e){Te(this,e)},ignoreTransaction:e=>on.trans?In(on.transless,e):e(),vip:Xr,async:function(e){return function(){try{var t=ei(e.apply(this,arguments));return t&&"function"==typeof t.then?t:ln.resolve(t)}catch(e){return Wn(e)}}},spawn:function(e,t,n){try{var r=ei(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:ln.resolve(r)}catch(e){return Wn(e)}},currentTransaction:{get:()=>on.trans||null},waitFor:function(e,t){const n=ln.resolve("function"==typeof e?xi.ignoreTransaction(e):e).timeout(t||6e4);return on.trans?on.trans.waitFor(n):n},Promise:ln,debug:{get:()=>pt,set:e=>{gt(e,"dexie"===e?()=>!0:Xn)}},derive:qe,extend:Te,props:Ie,override:ze,Events:rr,on:Cr,liveQuery:function(e){return new bi((t=>{const n=dt(e);let r=!1,i={},o={};const s={get closed(){return r},unsubscribe:()=>{r=!0,Cr.storagemutated.unsubscribe(c)}};t.start&&t.start(s);let a=!1,u=!1;function l(){return Le(o).some((e=>i[e]&&function(e,t){const n=di(t);let r=n.next();if(r.done)return!1;let i=r.value;const o=di(e);let s=o.next(i.from),a=s.value;for(;!r.done&&!s.done;){if(fr(a.from,i.to)<=0&&fr(a.to,i.from)>=0)return!0;fr(i.from,a.from)<0?i=(r=n.next(a.from)).value:a=(s=o.next(i.from)).value}return!1}(i[e],o[e])))}const c=e=>{wi(i,e),l()&&h()},h=()=>{if(a||r)return;i={};const f={},d=function(t){n&&An();const r=()=>Dn(e,{subscr:t,trans:null}),i=on.trans?In(on.transless,r):r();return n&&i.then(Ln,Ln),i}(f);u||(Cr("storagemutated",c),u=!0),a=!0,Promise.resolve(d).then((e=>{a=!1,r||(l()?h():(i={},o=f,t.next&&t.next(e)))}),(e=>{a=!1,t.error&&t.error(e),s.unsubscribe()}))};return h(),s}))},extendObservabilitySet:wi,getByKeyPath:Qe,setByKeyPath:Xe,delByKeyPath:function(e,t){"string"==typeof t?Xe(e,t,void 0):"length"in t&&[].map.call(t,(function(t){Xe(e,t,void 0)}))},shallowClone:Ze,deepClone:ot,getObjectDiff:oi,cmp:fr,asap:Ge,minKey:-1/0,addons:[],connections:Yn,errnames:Et,dependencies:_i,semVer:"3.2.2",version:"3.2.2".split(".").map((e=>parseInt(e))).reduce(((e,t,n)=>e+t/Math.pow(10,2*n)))}),xi.maxKey=Lr(xi.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(Cr("storagemutated",(e=>{if(!Si){let t;Gn?(t=document.createEvent("CustomEvent"),t.initCustomEvent("x-storagemutated-1",!0,!0,e)):t=new CustomEvent("x-storagemutated-1",{detail:e}),Si=!0,dispatchEvent(t),Si=!1}})),addEventListener("x-storagemutated-1",(({detail:e})=>{Si||ki(e)})));let Si=!1;if("undefined"!=typeof BroadcastChannel){const e=new BroadcastChannel("x-storagemutated-1");Cr("storagemutated",(t=>{Si||e.postMessage(t)})),e.onmessage=e=>{e.data&&ki(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){Cr("storagemutated",(e=>{try{Si||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((t=>t.postMessage({type:"x-storagemutated-1",changedParts:e}))))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(e=>{if("x-storagemutated-1"===e.key){const t=JSON.parse(e.newValue);t&&ki(t.changedParts)}}));const e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",(function({data:e}){e&&"x-storagemutated-1"===e.type&&ki(e.changedParts)}))}ln.rejectionMapper=function(e,t){if(!e||e instanceof kt||e instanceof TypeError||e instanceof SyntaxError||!e.name||!Rt[e.name])return e;var n=new Rt[e.name](t||e.message,e);return"stack"in e&&Be(n,"stack",{get:function(){return this.inner.stack}}),n},gt(pt,Xn);class Oi extends vi{constructor(){super("ServiceWorker"),this.version(1).stores({dynamicRouteRegistrations:"++,&pattern"}),this.dynamicRouteRegistrations=this.table("dynamicRouteRegistrations")}}var Pi=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));function Ei(e){return Pi(this,null,(function*(){const t=yield function(e){return Ce(this,arguments,(function*({imports:e={}}){const t=Object.values(e),n=yield Promise.all(t.map((e=>Ce(this,null,(function*(){const t=je(e),n=yield Re(t);return n?De(e,n):[]})))));return Ee(n)}))}(e);yield function(e){return Pi(this,null,(function*(){const t=yield caches.open(de),n=(yield t.keys()).map((e=>e.url)),r=yield(new Oi).dynamicRouteRegistrations.toArray(),i=n.filter((t=>!ye.includes(t)&&!e.includes(t)&&!r.some((e=>new RegExp(e.pattern).test(t)))));console.info("[SW] Removing the following expired URLs from the cache: ",i),console.debug("[SW] The following URLs were known and not invalidated: ",ye,e,r),yield Promise.all(i.map((e=>t.delete(e))))}))}(t),yield Ci(t)}))}function Ci(e){return Pi(this,null,(function*(){if(0===e.length)return;const t=yield caches.open(de),n=yield Promise.all(e.map((e=>Pi(this,null,(function*(){try{return yield function(e){return E(this,arguments,(function*(e,t={}){let{shouldRetry:n,getDelay:r,onError:i}=t;n=null!=n?n:e=>C(e,5),r=null!=r?r:e=>j(e,1e3);let o,s=0;do{try{return yield R(r(s)),yield e()}catch(e){null==i||i(e,s),o=e}}while(n(s++));throw o}))}((()=>t.add(e)),{onError:(t,n)=>console.debug(`[SW] Failure attempt ${n} at caching "${e}". Error: `,t)}),{url:e,success:!0}}catch(t){return{url:e,success:!1}}}))))),r=n.filter((e=>e.success)),i=n.filter((e=>!e.success));r.length>0&&console.debug(`[SW] Successfully added ${r.length} URLs to the OMRS cache. URLs: `,r.map((e=>e.url))),i.length>0&&console.error(`[SW] Failed to cache ${i.length} URLs. URLs: `,i.map((e=>e.url)))}))}var ji=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));const Ri={onImportMapChanged:function(e){return ji(this,arguments,(function*({importMap:e}){yield Ei(e)}))},clearDynamicRoutes:function(){return ji(this,null,(function*(){yield(new Oi).dynamicRouteRegistrations.clear()}))},registerDynamicRoute:function(e){return ji(this,arguments,(function*({pattern:e,url:t,strategy:n}){let r=e;if(!r&&t&&(r=`^${P(t)}$`),r){const e={pattern:r,strategy:n};yield(new Oi).dynamicRouteRegistrations.put(e)}}))}};n(955);const Di=["DELETE","GET","HEAD","PATCH","POST","PUT"],Ai=e=>e&&"object"==typeof e?e:{handle:e};class Li{constructor(e,t,n="GET"){this.handler=Ai(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=Ai(e)}}class Ki extends Li{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 Ti{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:i,route:o}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n});let s=o&&o.handler;const a=e.method;if(!s&&this._defaultHandlerMap.has(a)&&(s=this._defaultHandlerMap.get(a)),!s)return;let u;try{u=s.handle({url:n,request:e,event:t,params:i})}catch(e){u=Promise.reject(e)}const l=o&&o.catchHandler;return u instanceof Promise&&(this._catchHandler||l)&&(u=u.catch((r=>{return o=this,null,s=function*(){if(l)try{return yield l.handle({url:n,request:e,event:t,params:i})}catch(e){e instanceof Error&&(r=e)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw r},new Promise(((e,t)=>{var n=e=>{try{i(s.next(e))}catch(e){t(e)}},r=e=>{try{i(s.throw(e))}catch(e){t(e)}},i=t=>t.done?e(t.value):Promise.resolve(t.value).then(n,r);i((s=s.apply(o,null)).next())}));var o,s}))),u}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){const i=this._routes.get(n.method)||[];for(const o of i){let i;const s=o.match({url:e,sameOrigin:t,request:n,event:r});if(s)return i=s,(Array.isArray(i)&&0===i.length||s.constructor===Object&&0===Object.keys(s).length||"boolean"==typeof s)&&(i=void 0),{route:o,params:i}}return{}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,Ai(e))}setCatchHandler(e){this._catchHandler=Ai(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 Ni;const Mi=()=>(Ni||(Ni=new Ti,Ni.addFetchListener(),Ni.addCacheListener()),Ni);n(415);var $i=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));function Ii(e){return"string"==typeof e?new Request(e):e}class Fi{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new s,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)}fetch(t){return $i(this,null,(function*(){const{event:n}=this;let r=Ii(t);if("navigate"===r.mode&&n instanceof FetchEvent&&n.preloadResponse){const e=yield n.preloadResponse;if(e)return e}const i=this.hasCallback("fetchDidFail")?r.clone():null;try{for(const e of this.iterateCallbacks("requestWillFetch"))r=yield e({request:r.clone(),event:n})}catch(t){if(t instanceof Error)throw new e("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const o=r.clone();try{let e;e=yield fetch(r,"navigate"===r.mode?void 0:this._strategy.fetchOptions);for(const t of this.iterateCallbacks("fetchDidSucceed"))e=yield t({event:n,request:o,response:e});return e}catch(e){throw i&&(yield this.runCallbacks("fetchDidFail",{error:e,event:n,originalRequest:i.clone(),request:o.clone()})),e}}))}fetchAndCachePut(e){return $i(this,null,(function*(){const t=yield this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}))}cacheMatch(e){return $i(this,null,(function*(){const t=Ii(e);let n;const{cacheName:r,matchOptions:i}=this._strategy,o=yield this.getCacheKey(t,"read"),s=Object.assign(Object.assign({},i),{cacheName:r});n=yield caches.match(o,s);for(const e of this.iterateCallbacks("cachedResponseWillBeUsed"))n=(yield e({cacheName:r,matchOptions:i,cachedResponse:n,request:o,event:this.event}))||void 0;return n}))}cachePut(n,r){return $i(this,null,(function*(){const i=Ii(n);yield a(0);const s=yield this.getCacheKey(i,"write");if(!r)throw new e("cache-put-with-no-response",{url:(u=s.url,new URL(String(u),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var u;const l=yield this._ensureResponseSafeToCache(r);if(!l)return!1;const{cacheName:c,matchOptions:h}=this._strategy,f=yield self.caches.open(c),d=this.hasCallback("cacheDidUpdate"),p=d?yield function(e,t,n,r){return i=this,s=function*(){const i=o(t.url,n);if(t.url===i)return e.match(t,r);const s=Object.assign(Object.assign({},r),{ignoreSearch:!0}),a=yield e.keys(t,s);for(const t of a)if(i===o(t.url,n))return e.match(t,r)},new Promise(((e,t)=>{var n=e=>{try{o(s.next(e))}catch(e){t(e)}},r=e=>{try{o(s.throw(e))}catch(e){t(e)}},o=t=>t.done?e(t.value):Promise.resolve(t.value).then(n,r);o((s=s.apply(i,null)).next())}));var i,s}(f,s.clone(),["__WB_REVISION__"],h):null;try{yield f.put(s,d?l.clone():l)}catch(e){if(e instanceof Error)throw"QuotaExceededError"===e.name&&(yield function(){return e=this,n=function*(){for(const e of t)yield e()},new Promise(((t,r)=>{var i=e=>{try{s(n.next(e))}catch(e){r(e)}},o=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=e=>e.done?t(e.value):Promise.resolve(e.value).then(i,o);s((n=n.apply(e,null)).next())}));var e,n}()),e}for(const e of this.iterateCallbacks("cacheDidUpdate"))yield e({cacheName:c,oldResponse:p,newResponse:l.clone(),request:s,event:this.event});return!0}))}getCacheKey(e,t){return $i(this,null,(function*(){const n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let r=e;for(const e of this.iterateCallbacks("cacheKeyWillBeUsed"))r=Ii(yield e({mode:t,request:r,event:this.event,params:this.params}));this._cacheKeys[n]=r}return this._cacheKeys[n]}))}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}runCallbacks(e,t){return $i(this,null,(function*(){for(const n of this.iterateCallbacks(e))yield 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 i=Object.assign(Object.assign({},r),{state:n});return t[e](i)};yield r}}waitUntil(e){return this._extendLifetimePromises.push(e),e}doneWaiting(){return $i(this,null,(function*(){let e;for(;e=this._extendLifetimePromises.shift();)yield e}))}destroy(){this._handlerDeferred.resolve(null)}_ensureResponseSafeToCache(e){return $i(this,null,(function*(){let t=e,n=!1;for(const e of this.iterateCallbacks("cacheWillUpdate"))if(t=(yield 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}))}}var Bi=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));class qi{constructor(e={}){this.cacheName=i(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,i=new Fi(this,{event:t,request:n,params:r}),o=this._getResponse(i,n,t);return[o,this._awaitComplete(o,i,n,t)]}_getResponse(t,n,r){return Bi(this,null,(function*(){let i;yield t.runCallbacks("handlerWillStart",{event:r,request:n});try{if(i=yield this._handle(n,t),!i||"error"===i.type)throw new e("no-response",{url:n.url})}catch(e){if(e instanceof Error)for(const o of t.iterateCallbacks("handlerDidError"))if(i=yield o({error:e,event:r,request:n}),i)break;if(!i)throw e}for(const e of t.iterateCallbacks("handlerWillRespond"))i=yield e({event:r,request:n,response:i});return i}))}_awaitComplete(e,t,n,r){return Bi(this,null,(function*(){let i,o;try{i=yield e}catch(e){}try{yield t.runCallbacks("handlerDidRespond",{event:r,request:n,response:i}),yield t.doneWaiting()}catch(e){e instanceof Error&&(o=e)}if(yield t.runCallbacks("handlerDidComplete",{event:r,request:n,response:i,error:o}),t.destroy(),o)throw o}))}}const Ui={cacheWillUpdate:e=>{return void 0,t=[e],n=function*({response:e}){return 200===e.status||0===e.status?e:null},new Promise(((e,r)=>{var i=e=>{try{s(n.next(e))}catch(e){r(e)}},o=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(i,o);s((n=n.apply(undefined,t)).next())}));var t,n}};var Wi=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));function Vi(e){var t;const n=+(null!=(t=Hi(e,"x-omrs-offline-response-status"))?t:"");return isNaN(n)||n<200||n>599?503:n}function Hi(e,t){return e.get(t)}var zi=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));const Yi=new class extends qi{constructor(e={}){super(e),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}_handle(t,n){return r=this,null,i=function*(){let r,i;try{const e=[n.fetch(t)];if(this._networkTimeoutSeconds){const t=a(1e3*this._networkTimeoutSeconds);e.push(t)}if(i=yield Promise.race(e),!i)throw new Error(`Timed out the network response after ${this._networkTimeoutSeconds} seconds.`)}catch(e){e instanceof Error&&(r=e)}if(!i)throw new e("no-response",{url:t.url,error:r});return i},new Promise(((e,t)=>{var n=e=>{try{s(i.next(e))}catch(e){t(e)}},o=e=>{try{s(i.throw(e))}catch(e){t(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(n,o);s((i=i.apply(r,null)).next())}));var r,i}},Gi=new class extends qi{_handle(t,n){return r=this,null,i=function*(){const r=yield n.cacheMatch(t);if(!r)throw new e("no-response",{url:t.url});return r},new Promise(((e,t)=>{var n=e=>{try{s(i.next(e))}catch(e){t(e)}},o=e=>{try{s(i.throw(e))}catch(e){t(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(n,o);s((i=i.apply(r,null)).next())}));var r,i}}({cacheName:de}),Ji=new class extends qi{constructor(e={}){super(e),this.plugins.some((e=>"cacheWillUpdate"in e))||this.plugins.unshift(Ui),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}_handle(t,n){return Wi(this,null,(function*(){const r=[],i=[];let o;if(this._networkTimeoutSeconds){const{id:e,promise:s}=this._getTimeoutPromise({request:t,logs:r,handler:n});o=e,i.push(s)}const s=this._getNetworkPromise({timeoutId:o,request:t,logs:r,handler:n});i.push(s);const a=yield n.waitUntil((()=>Wi(this,null,(function*(){return(yield n.waitUntil(Promise.race(i)))||(yield s)})))());if(!a)throw new e("no-response",{url:t.url});return a}))}_getTimeoutPromise({request:e,logs:t,handler:n}){let r;return{promise:new Promise((t=>{r=setTimeout((()=>Wi(this,null,(function*(){t(yield n.cacheMatch(e))}))),1e3*this._networkTimeoutSeconds)})),id:r}}_getNetworkPromise(e){return Wi(this,arguments,(function*({timeoutId:e,request:t,logs:n,handler:r}){let i,o;try{o=yield r.fetchAndCachePut(t)}catch(e){e instanceof Error&&(i=e)}return e&&clearTimeout(e),!i&&o||(o=yield r.cacheMatch(t)),o}))}}({cacheName:de}),Qi="network-only-or-cache-only",Xi={"network-first":e=>Ji.handle(e),"network-only-or-cache-only":e=>zi(void 0,null,(function*(){try{return yield Yi.handle(e)}catch(t){return yield Gi.handle(e)}}))};function Zi(e){return zi(this,null,(function*(){try{return yield Yi.handle(e)}catch(e){const t=yield caches.open(de),n=yield t.match(ge);return null!=n?n:Response.error()}}))}function eo(e){return zi(this,null,(function*(){var t;const{request:n}=e,r="GET"===e.request.method?yield function(e){return zi(this,arguments,(function*({request:e}){var t;return null!=(t=to(e.headers))?t:yield no(e.url)}))}(e):Qi,i=null!=(t=Xi[r])?t:Xi[Qi];try{return yield i(e)}catch(e){return console.warn("[SW] Could not handle the request to %s (using handler %s).",n.url,r,e),new Response(function(e){var t;return null!=(t=Hi(e,"x-omrs-offline-response-body"))?t:void 0}(n.headers),{status:Vi(n.headers)})}}))}function to(e){return Hi(e,"x-omrs-offline-caching-strategy")}function no(e){return zi(this,null,(function*(){var t;const n=new Oi,r=yield n.dynamicRouteRegistrations.toArray(),i=fe(r.filter((t=>new RegExp(t.pattern).test(e))).map((e=>{var t;return null!=(t=e.strategy)?t:"network-first"})));return i.length<=1?i[0]:null!=(t=["network-first","network-only-or-cache-only"].find((e=>i.some((t=>t===e)))))?t:Qi}))}var ro;self.__WB_DISABLE_DEV_LOGS=!0,ro={prefix:"omrs"},(e=>{for(const t of Object.keys(r))e(t)})((e=>{"string"==typeof ro[e]&&(r[e]=ro[e])})),function(){!function(e,t,n){let r;r=e instanceof RegExp?new Ki(e,t,n):new Li(e,t,n),Mi().registerRoute(r)}((({request:e})=>"navigate"===e.mode),Zi);const e=Mi();for(const t of Di)e.setDefaultHandler(eo,t)}(),self.addEventListener("message",(function(e){return ji(this,null,(function*(){var t,n,r,i,o,s;const a=Ri[null!=(r=null==(n=null==(t=e.data)?void 0:t.type)?void 0:n.toString())?r:""];if(a)try{l({success:!0,result:yield a(e.data)})}catch(e){u(null!=(s=null!=(o=null==e?void 0:e.message)?o:null==e?void 0:e.toString())?s:"Unknown error.")}else u(`Received an unknown message of type "${null==(i=e.data)?void 0:i.type} which cannot be handled.`);function u(e){console.warn("[SW] Handling a message resulted in an error.",e),l({success:!1,error:e})}function l(t){e.ports[0].postMessage(null!=t?t:{})}}))})),self.addEventListener("install",(e=>{self.skipWaiting(),e.waitUntil(Ci(ye))})),self.addEventListener("activate",(e=>{e.waitUntil(self.clients.claim())}))})()})();
|
|
1
|
+
(()=>{var e={889:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,n="millisecond",r="second",i="minute",o="hour",s="day",a="week",u="month",l="quarter",c="year",h="date",f="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},y=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},v={s:y,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,u),o=n-i<0,s=t.clone().add(r+(o?-1:1),u);return+(-(r+(n-i)/(o?i-s:s-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:c,w:a,d:s,D:h,h:o,m:i,s:r,ms:n,Q:l}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},m="en",b={};b[m]=g;var w=function(e){return e instanceof S},_=function e(t,n,r){var i;if(!t)return m;if("string"==typeof t){var o=t.toLowerCase();b[o]&&(i=o),n&&(b[o]=n,i=o);var s=t.split("-");if(!i&&s.length>1)return e(s[0])}else{var a=t.name;b[a]=t,i=a}return!r&&i&&(m=i),i||!r&&m},x=function(e,t){if(w(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new S(n)},k=v;k.l=_,k.i=w,k.w=function(e,t){return x(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function g(e){this.$L=_(e.locale,null,!0),this.parse(e)}var y=g.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(k.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(d);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return k},y.isValid=function(){return!(this.$d.toString()===f)},y.isSame=function(e,t){var n=x(e);return this.startOf(t)<=n&&n<=this.endOf(t)},y.isAfter=function(e,t){return x(e)<this.startOf(t)},y.isBefore=function(e,t){return this.endOf(t)<x(e)},y.$g=function(e,t,n){return k.u(e)?this[t]:this.set(n,e)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(e,t){var n=this,l=!!k.u(t)||t,f=k.p(e),d=function(e,t){var r=k.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return l?r:r.endOf(s)},p=function(e,t){return k.w(n.toDate()[e].apply(n.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},g=this.$W,y=this.$M,v=this.$D,m="set"+(this.$u?"UTC":"");switch(f){case c:return l?d(1,0):d(31,11);case u:return l?d(1,y):d(0,y+1);case a:var b=this.$locale().weekStart||0,w=(g<b?g+7:g)-b;return d(l?v-w:v+(6-w),y);case s:case h:return p(m+"Hours",0);case o:return p(m+"Minutes",1);case i:return p(m+"Seconds",2);case r:return p(m+"Milliseconds",3);default:return this.clone()}},y.endOf=function(e){return this.startOf(e,!1)},y.$set=function(e,t){var a,l=k.p(e),f="set"+(this.$u?"UTC":""),d=(a={},a[s]=f+"Date",a[h]=f+"Date",a[u]=f+"Month",a[c]=f+"FullYear",a[o]=f+"Hours",a[i]=f+"Minutes",a[r]=f+"Seconds",a[n]=f+"Milliseconds",a)[l],p=l===s?this.$D+(t-this.$W):t;if(l===u||l===c){var g=this.clone().set(h,1);g.$d[d](p),g.init(),this.$d=g.set(h,Math.min(this.$D,g.daysInMonth())).$d}else d&&this.$d[d](p);return this.init(),this},y.set=function(e,t){return this.clone().$set(e,t)},y.get=function(e){return this[k.p(e)]()},y.add=function(n,l){var h,f=this;n=Number(n);var d=k.p(l),p=function(e){var t=x(f);return k.w(t.date(t.date()+Math.round(e*n)),f)};if(d===u)return this.set(u,this.$M+n);if(d===c)return this.set(c,this.$y+n);if(d===s)return p(1);if(d===a)return p(7);var g=(h={},h[i]=e,h[o]=t,h[r]=1e3,h)[d]||1,y=this.$d.getTime()+n*g;return k.w(y,this)},y.subtract=function(e,t){return this.add(-1*e,t)},y.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var r=e||"YYYY-MM-DDTHH:mm:ssZ",i=k.z(this),o=this.$H,s=this.$m,a=this.$M,u=n.weekdays,l=n.months,c=function(e,n,i,o){return e&&(e[n]||e(t,r))||i[n].slice(0,o)},h=function(e){return k.s(o%12||12,e,"0")},d=n.meridiem||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r},g={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:k.s(a+1,2,"0"),MMM:c(n.monthsShort,a,l,3),MMMM:c(l,a),D:this.$D,DD:k.s(this.$D,2,"0"),d:String(this.$W),dd:c(n.weekdaysMin,this.$W,u,2),ddd:c(n.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(o),HH:k.s(o,2,"0"),h:h(1),hh:h(2),a:d(o,s,!0),A:d(o,s,!1),m:String(s),mm:k.s(s,2,"0"),s:String(this.$s),ss:k.s(this.$s,2,"0"),SSS:k.s(this.$ms,3,"0"),Z:i};return r.replace(p,(function(e,t){return t||g[e]||i.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(n,h,f){var d,p=k.p(h),g=x(n),y=(g.utcOffset()-this.utcOffset())*e,v=this-g,m=k.m(this,g);return m=(d={},d[c]=m/12,d[u]=m,d[l]=m/3,d[a]=(v-y)/6048e5,d[s]=(v-y)/864e5,d[o]=v/t,d[i]=v/e,d[r]=v/1e3,d)[p]||v,f?m:k.a(m)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return b[this.$L]},y.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=_(e,t,!0);return r&&(n.$L=r),n},y.clone=function(){return k.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},g}(),O=S.prototype;return x.prototype=O,[["$ms",n],["$s",r],["$m",i],["$H",o],["$W",s],["$M",u],["$y",c],["$D",h]].forEach((function(e){O[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),x.extend=function(e,t){return e.$i||(e(t,S,x),e.$i=!0),x},x.locale=_,x.isDayjs=w,x.unix=function(e){return x(1e3*e)},x.en=b[m],x.Ls=b,x.p={},x}()},99:(e,t,n)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach((function(t){i(e,t,n[t])}))}return e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}n.r(t),n.d(t,{default:()=>W});var p={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},g=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.init(t,n)}return u(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||p,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,o({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),y=function(){function e(){s(this,e),this.observers={}}return u(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){var i=[].concat(this.observers[e]);i.forEach((function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(t){t.apply(t,[e].concat(n))}))}}}]),e}();function v(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function m(e){return null==e?"":""+e}function b(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function w(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function _(e,t,n){var r=w(e,t,Object);r.obj[r.k]=n}function x(e,t){var n=w(e,t),r=n.obj,i=n.k;if(r)return r[i]}function k(e,t,n){var r=x(e,n);return void 0!==r?r:x(t,n)}function S(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):S(e[r],t[r],n):e[r]=t[r]);return e}function O(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var P={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function E(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return P[e]})):e}var C="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,j=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return s(this,t),n=c(this,h(t).call(this)),C&&y.call(l(n)),n.data=e||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return d(t,e),u(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=[e,t];return n&&"string"!=typeof n&&(o=o.concat(n)),n&&"string"==typeof n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split(".")),x(this.data,o)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var s=[e,t];n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(r=t,t=(s=e.split("."))[1]),this.addNamespaces(t),_(this.data,s,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var u=x(this.data,a)||{};r?S(u,n,i):u=o({},u,n),_(this.data,a,u),s.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?o({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(y),R={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,r,i))})),t}},D={},A=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,t),n=c(this,h(t).call(this)),C&&y.call(l(n)),b(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,l(n)),n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=g.create("translator"),n}return d(t,e),u(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var o=e.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:e,namespaces:i};var s=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(s[0])>-1)&&(i=s.shift()),e=s.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,n,i){var s=this;if("object"!==r(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var a=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,u=this.extractFromKey(e[e.length-1],n),l=u.key,c=u.namespaces,h=c[c.length-1],f=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f&&"cimode"===f.toLowerCase()){if(d){var p=n.nsSeparator||this.options.nsSeparator;return h+p+l}return l}var g=this.resolve(e,n),y=g&&g.res,v=g&&g.usedKey||l,m=g&&g.exactUsedKey||l,b=Object.prototype.toString.apply(y),w=["[object Number]","[object Function]","[object RegExp]"],_=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,k="string"!=typeof y&&"boolean"!=typeof y&&"number"!=typeof y;if(x&&y&&k&&w.indexOf(b)<0&&("string"!=typeof _||"[object Array]"!==b)){if(!n.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,y,n):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");if(a){var S="[object Array]"===b,O=S?[]:{},P=S?m:v;for(var E in y)if(Object.prototype.hasOwnProperty.call(y,E)){var C="".concat(P).concat(a).concat(E);O[E]=this.translate(C,o({},n,{joinArrays:!1,ns:c})),O[E]===C&&(O[E]=y[E])}y=O}}else if(x&&"string"==typeof _&&"[object Array]"===b)(y=y.join(_))&&(y=this.extendTranslation(y,e,n,i));else{var j=!1,R=!1,D=void 0!==n.count&&"string"!=typeof n.count,A=t.hasDefaultValue(n),L=D?this.pluralResolver.getSuffix(f,n.count):"",K=n["defaultValue".concat(L)]||n.defaultValue;!this.isValidLookup(y)&&A&&(j=!0,y=K),this.isValidLookup(y)||(R=!0,y=l);var T=A&&K!==y&&this.options.updateMissing;if(R||j||T){if(this.logger.log(T?"updateKey":"missingKey",f,h,l,T?K:y),a){var N=this.resolve(l,o({},n,{keySeparator:!1}));N&&N.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var M=[],$=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&$&&$[0])for(var I=0;I<$.length;I++)M.push($[I]);else"all"===this.options.saveMissingTo?M=this.languageUtils.toResolveHierarchy(n.lng||this.language):M.push(n.lng||this.language);var F=function(e,t,r){s.options.missingKeyHandler?s.options.missingKeyHandler(e,h,t,T?r:y,T,n):s.backendConnector&&s.backendConnector.saveMissing&&s.backendConnector.saveMissing(e,h,t,T?r:y,T,n),s.emit("missingKey",e,h,t,y)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?M.forEach((function(e){s.pluralResolver.getSuffixes(e).forEach((function(t){F([e],l+t,n["defaultValue".concat(t)]||K)}))})):F(M,l,K))}y=this.extendTranslation(y,e,n,g,i),R&&y===l&&this.options.appendNamespaceToMissingKey&&(y="".concat(h,":").concat(l)),R&&this.options.parseMissingKeyHandler&&(y=this.options.parseMissingKeyHandler(y))}return y}},{key:"extendTranslation",value:function(e,t,n,r,i){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,n,r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(o({},n,{interpolation:o({},this.options.interpolation,n.interpolation)}));var a,u=n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(u){var l=e.match(this.interpolator.nestingRegexp);a=l&&l.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=o({},this.options.interpolation.defaultVariables,c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),u){var h=e.match(this.interpolator.nestingRegexp);a<(h&&h.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return i&&i[0]===r[0]&&!n.context?(s.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):s.translate.apply(s,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var f=n.postProcess||this.options.postProcess,d="string"==typeof f?[f]:f;return null!=e&&d&&d.length&&!1!==n.applyPostProcessor&&(e=R.handle(d,e,t,this.options&&this.options.postProcessPassResolved?o({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,o,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var u=s.extractFromKey(e,a),l=u.key;n=l;var c=u.namespaces;s.options.fallbackNS&&(c=c.concat(s.options.fallbackNS));var h=void 0!==a.count&&"string"!=typeof a.count,f=void 0!==a.context&&"string"==typeof a.context&&""!==a.context,d=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);c.forEach((function(e){s.isValidLookup(t)||(o=e,!D["".concat(d[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(D["".concat(d[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(n,'" for languages "').concat(d.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),d.forEach((function(n){if(!s.isValidLookup(t)){i=n;var o,u,c=l,d=[c];for(s.i18nFormat&&s.i18nFormat.addLookupKeys?s.i18nFormat.addLookupKeys(d,l,n,e,a):(h&&(o=s.pluralResolver.getSuffix(n,a.count)),h&&f&&d.push(c+o),f&&d.push(c+="".concat(s.options.contextSeparator).concat(a.context)),h&&d.push(c+=o));u=d.pop();)s.isValidLookup(t)||(r=u,t=s.getResource(n,e,u,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),t}(y);function L(e){return e.charAt(0).toUpperCase()+e.slice(1)}var K=function(){function e(t){s(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=g.create("languageUtils")}return u(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=L(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=L(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=L(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&o(n.formatLanguageCode(e))})),i}}]),e}(),T=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],N={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};function M(){var e={};return T.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:N[t.fc]}}))})),e}var $=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.languageUtils=t,this.options=n,this.logger=g.create("pluralResolver"),this.rules=M()}return u(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){return this.getSuffixes(e).map((function(e){return t+e}))}},{key:"getSuffixes",value:function(e){var t=this,n=this.getRule(e);return n?n.numbers.map((function(n){return t.getSuffix(e,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=this,r=this.getRule(e);if(r){var i=r.noAbs?r.plurals(t):r.plurals(Math.abs(t)),o=r.numbers[i];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var s=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):s():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?s():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),I=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,e),this.logger=g.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return u(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:E,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?O(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?O(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?O(t.nestingPrefix):t.nestingPrefixEscaped||O("$t("),this.nestingSuffix=t.nestingSuffix?O(t.nestingSuffix):t.nestingSuffixEscaped||O(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,o,s,a=this,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(e){return e.replace(/\$/g,"$$$$")}var c=function(e){if(e.indexOf(a.formatSeparator)<0){var i=k(t,u,e);return a.alwaysFormat?a.format(i,void 0,n):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),l=o.join(a.formatSeparator).trim();return a.format(k(t,u,s),l,n,r)};this.resetRegExp();var h=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&r.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return l(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?l(a.escape(e)):l(e)}}].forEach((function(t){for(s=0;i=t.regex.exec(e);){if(void 0===(o=c(i[1].trim())))if("function"==typeof h){var n=h(e,i,r);o="string"==typeof n?n:""}else{if(f){o=i[0];continue}a.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(e)),o=""}else"string"==typeof o||a.useRawValueToEscape||(o=m(o));if(e=e.replace(i[0],t.safeValue(o)),t.regex.lastIndex=0,++s>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=o({},s);function u(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0],i=(i=this.interpolate(i,a)).replace(/'/g,'"');try{a=JSON.parse(i),t&&(a=o({},t,a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(i)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var l=[],c=!1;if(n[0].includes(this.formatSeparator)&&!/{.*}/.test(n[1])){var h=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=h.shift(),l=h,c=!0}if((r=t(u.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=m(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return i.format(e,t,s.lng,s)}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}(),F=function(e){function t(e,n,r){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return s(this,t),i=c(this,h(t).call(this)),C&&y.call(l(i)),i.backend=e,i.store=n,i.services=r,i.languageUtils=r.languageUtils,i.options=o,i.logger=g.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,o.backend,o),i}return d(t,e),u(t,[{key:"queueLoad",value:function(e,t,n,r){var i=this,o=[],s=[],a=[],u=[];return e.forEach((function(e){var r=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?s.indexOf(a)<0&&s.push(a):(i.state[a]=1,r=!1,s.indexOf(a)<0&&s.push(a),o.indexOf(a)<0&&o.push(a),u.indexOf(t)<0&&u.push(t)))})),r||a.push(e)})),(o.length||s.length)&&this.queue.push({pending:s,loaded:{},errors:[],callback:r}),{toLoad:o,pending:s,toLoadLanguages:a,toLoadNamespaces:u}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),n&&this.store.addResourceBundle(i,o,n),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(n){var r,a,u,l,c;r=n.loaded,a=o,(l=(u=w(r,[i],Object)).obj)[c=u.k]=l[c]||[],l[c].push(a),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){s[e]||(s[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){s[e].indexOf(t)<0&&s[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,s=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,(function(a,u){a&&u&&i<5?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*o,s)}),o):s(a,u)})):s(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,s){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&s&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),s),t.loaded(e,r,s)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,o({},s,{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),t}(y);function B(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===r(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===r(e[2])||"object"===r(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function q(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function U(){}const W=new(function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(s(this,t),e=c(this,h(t).call(this)),C&&y.call(l(e)),e.options=q(n),e.services={},e.logger=g,e.modules={external:[]},r&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,r),c(e,l(e));setTimeout((function(){e.init(n,r)}),0)}return e}return d(t,e),u(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function r(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(n=t,t={}),t.whitelist&&!t.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),t.nonExplicitWhitelist&&!t.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=o({},B(),this.options,q(t)),this.format=this.options.interpolation.format,n||(n=U),!this.options.isClone){this.modules.logger?g.init(r(this.modules.logger),this.options):g.init(null,this.options);var i=new K(this.options);this.store=new j(this.options.resources,this.options);var s=this.services;s.logger=g,s.resourceStore=this.store,s.languageUtils=i,s.pluralResolver=new $(i,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new I(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new F(r(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(s.languageDetector=r(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=r(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new A(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.length>0&&"dev"!==a[0]&&(this.options.lng=a[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var u=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var l=["addResource","addResources","addResourceBundle","removeResourceBundle"];l.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var c=v(),h=function(){var t=function(t,r){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),c.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),c}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:U,r=n,i="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return r();var o=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(i)s(i);else{var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.forEach((function(e){return s(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return s(e)})),this.services.backendConnector.load(o,this.options.ns,r)}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=v();return e||(e=this.languages),t||(t=this.options.ns),n||(n=U),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&R.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=v();this.emit("languageChanging",e);var i=function(e){var i="string"==typeof e?e:n.services.languageUtils.getBestMatchFromCodes(e);i&&(n.language||(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i)),n.translator.language||n.translator.changeLanguage(i),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(i)),n.loadResources(i,(function(e){!function(e,i){i?(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,i)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t){var n=this,i=function e(t,i){var s;if("object"!==r(i)){for(var a=arguments.length,u=new Array(a>2?a-2:0),l=2;l<a;l++)u[l-2]=arguments[l];s=n.options.overloadTranslationOptionHandler([t,i].concat(u))}else s=o({},i);return s.lng=s.lng||e.lng,s.lngs=s.lngs||e.lngs,s.ns=s.ns||e.ns,n.t(t,s)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var a=n.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||!(!s(r,e)||i&&!s(o,e))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=v();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=v();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){return e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),e?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr":"rtl"}},{key:"createInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new t(e,n)}},{key:"cloneInstance",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:U,i=o({},this.options,n,{isClone:!0}),s=new t(i),a=["store","services","language"];return a.forEach((function(t){s[t]=e[t]})),s.services=o({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s.translator=new A(s.services,s.options),s.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];s.emit.apply(s,[e].concat(n))})),s.init(i,r),s.translator.options=s.options,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}}]),t}(y))},854:()=>{"use strict";try{self["workbox:core:6.5.3"]&&_()}catch(e){}},955:()=>{"use strict";try{self["workbox:routing:6.5.3"]&&_()}catch(e){}},415:()=>{"use strict";try{self["workbox:strategies:6.5.3"]&&_()}catch(e){}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{n.S={};var e={},t={};n.I=(r,i)=>{i||(i=[]);var o=t[r];if(o||(o=t[r]={}),!(i.indexOf(o)>=0)){if(i.push(o),e[r])return e[r];n.o(n.S,r)||(n.S[r]={});var s=n.S[r],a="@openmrs/esm-app-shell",u=(e,t,n,r)=>{var i=s[e]=s[e]||{},o=i[t];(!o||!o.loaded&&(!r!=!o.eager?r:a>o.from))&&(i[t]={get:n,from:a,eager:!!r})},l=[];return"default"===r&&(u("dayjs","1.11.5",(()=>()=>n(889)),1),u("i18next","19.9.2",(()=>()=>n(99)),1)),e[r]=l.length?Promise.all(l).then((()=>e[r]=1)):1}}})(),(()=>{"use strict";n(854);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:""},i=e=>{return e||(t=r.runtime,[r.prefix,t,r.suffix].filter((e=>e&&e.length>0)).join("-"));var t};function o(e,t){const n=new URL(e);for(const e of t)n.searchParams.delete(e);return n.href}class s{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}function a(e){return new Promise((t=>setTimeout(t,e)))}const u="object"==typeof global&&global&&global.Object===Object&&global;var l="object"==typeof self&&self&&self.Object===Object&&self;const c=u||l||Function("return this")(),h=c.Symbol,f=Array.isArray;var d=Object.prototype,p=d.hasOwnProperty,g=d.toString,y=h?h.toStringTag:void 0;var v=Object.prototype.toString;var m=h?h.toStringTag:void 0;const b=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":m&&m in Object(e)?function(e){var t=p.call(e,y),n=e[y];try{e[y]=void 0;var r=!0}catch(e){}var i=g.call(e);return r&&(t?e[y]=n:delete e[y]),i}(e):function(e){return v.call(e)}(e)},w=function(e){return null!=e&&"object"==typeof e};var _=h?h.prototype:void 0,x=_?_.toString:void 0;const k=function e(t){if("string"==typeof t)return t;if(f(t))return function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}(t,e)+"";if(function(e){return"symbol"==typeof e||w(e)&&"[object Symbol]"==b(e)}(t))return x?x.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var S=/[\\^$.*+?()[\]{}|]/g,O=RegExp(S.source);const P=function(e){return(e=null==(t=e)?"":k(t))&&O.test(e)?e.replace(S,"\\$&"):e;var t};var E=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));function C(e,t){return e<=t}function j(e,t,n=!1){const r=n?e+1:e;return t*Math.pow(2,r)}function R(e){return E(this,null,(function*(){if(!(e<=0))return new Promise((t=>setTimeout(t,e)))}))}const D=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},A=c["__core-js_shared__"];var L,K=(L=/[^.]+$/.exec(A&&A.keys&&A.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"";var T=Function.prototype.toString;var N=/^\[object .+?Constructor\]$/,M=Function.prototype,$=Object.prototype,I=M.toString,F=$.hasOwnProperty,B=RegExp("^"+I.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const q=function(e){return!(!D(e)||(t=e,K&&K in t))&&(function(e){if(!D(e))return!1;var t=b(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?B:N).test(function(e){if(null!=e){try{return T.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t},U=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return q(n)?n:void 0},W=U(Object,"create");var V=Object.prototype.hasOwnProperty;var H=Object.prototype.hasOwnProperty;function z(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])}}z.prototype.clear=function(){this.__data__=W?W(null):{},this.size=0},z.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},z.prototype.get=function(e){var t=this.__data__;if(W){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return V.call(t,e)?t[e]:void 0},z.prototype.has=function(e){var t=this.__data__;return W?void 0!==t[e]:H.call(t,e)},z.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=W&&void 0===t?"__lodash_hash_undefined__":t,this};const Y=z,G=function(e,t){for(var n=e.length;n--;)if((r=e[n][0])===(i=t)||r!=r&&i!=i)return n;var r,i;return-1};var J=Array.prototype.splice;function Q(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])}}Q.prototype.clear=function(){this.__data__=[],this.size=0},Q.prototype.delete=function(e){var t=this.__data__,n=G(t,e);return!(n<0||(n==t.length-1?t.pop():J.call(t,n,1),--this.size,0))},Q.prototype.get=function(e){var t=this.__data__,n=G(t,e);return n<0?void 0:t[n][1]},Q.prototype.has=function(e){return G(this.__data__,e)>-1},Q.prototype.set=function(e,t){var n=this.__data__,r=G(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const X=Q,Z=U(c,"Map"),ee=function(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.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 Y,map:new(Z||X),string:new Y}},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 ie=re,oe=function(e){return e!=e},se=function(e,t){return!(null==e||!e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}(e,oe,n)}(e,t,0)>-1},ae=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1},ue=function(e,t){return e.has(t)},le=U(c,"Set"),ce=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},he=le&&1/ce(new le([,-0]))[1]==1/0?function(e){return new le(e)}:function(){},fe=function(e){return e&&e.length?function(e,t,n){var r=-1,i=se,o=e.length,s=!0,a=[],u=a;if(n)s=!1,i=ae;else if(o>=200){var l=t?null:he(e);if(l)return ce(l);s=!1,i=ue,u=new ie}else u=t?[]:a;e:for(;++r<o;){var c=e[r],h=t?t(c):c;if(c=n||0!==c?c:0,s&&h==h){for(var f=u.length;f--;)if(u[f]===h)continue e;t&&u.push(h),a.push(c)}else i(u,h,n)||(u!==a&&u.push(h),a.push(c))}return a}(e):[]},de="omrs-spa-cache-v1",pe=[{'revision':null,'url':'023bd53d342b7463.woff'},{'revision':null,'url':'02acc4469a2fe2e4.woff2'},{'revision':null,'url':'033e03f8663ab9b1.woff'},{'revision':null,'url':'052607e67da262ec.woff'},{'revision':null,'url':'081587ca0db8e63f.woff2'},{'revision':null,'url':'08cf53c4e5e71cf1.woff2'},{'revision':null,'url':'090b2bc014d24ea4.woff2'},{'revision':null,'url':'0a28cd0b47497b71.woff'},{'revision':null,'url':'0a9765a89ff0437d.woff'},{'revision':null,'url':'0ae92bcea615e948.woff2'},{'revision':null,'url':'0be8520d8945b3b7.woff2'},{'revision':null,'url':'0bf6b66a8b86b014.woff'},{'revision':null,'url':'0e7dd073cd8bb0ad.woff2'},{'revision':null,'url':'14869ac5d1830304.woff2'},{'revision':null,'url':'14aaceff85fc8b28.woff2'},{'revision':null,'url':'1590052e1cf8f28d.woff'},{'revision':null,'url':'16f443eed01776ca.woff2'},{'revision':null,'url':'183bae0e53a22182.woff2'},{'revision':null,'url':'19b239a0bb74b27e.woff'},{'revision':null,'url':'19c8f94ccd6289f5.woff2'},{'revision':null,'url':'1ae86565eab7451c.woff2'},{'revision':null,'url':'1c7bf8797e0a9be6.woff2'},{'revision':null,'url':'1d9aff9a93a3bb66.woff'},{'revision':null,'url':'1f266d3619b30f16.woff2'},{'revision':null,'url':'1f8c5a4087a524fd.woff2'},{'revision':null,'url':'20ba2b23c5c0cd0b.woff2'},{'revision':null,'url':'2269d45733c5cf8f.woff'},{'revision':null,'url':'258ecbd235953099.woff'},{'revision':null,'url':'28e4acd4c25b29d5.js'},{'revision':null,'url':'295dd01a1fbfee6d.woff2'},{'revision':null,'url':'2d7f835ab7c7c764.woff'},{'revision':null,'url':'2f66cca99eeead63.woff'},{'revision':null,'url':'2f686985e26e7107.woff2'},{'revision':null,'url':'315eff729e4ccbd9.woff2'},{'revision':null,'url':'32f1e5aadf845e08.woff'},{'revision':null,'url':'338484e1c850669c.woff'},{'revision':null,'url':'33b7a82f1e295190.woff'},{'revision':null,'url':'3674d98ec4a9173d.woff'},{'revision':null,'url':'368d16e3259bf207.woff2'},{'revision':null,'url':'36c49aa341a7079a.woff2'},{'revision':null,'url':'36e1e0430475edee.woff2'},{'revision':null,'url':'3bc19662b8630ee9.woff2'},{'revision':null,'url':'3f645f473b3f8fba.woff2'},{'revision':null,'url':'4095df88acae9e98.woff'},{'revision':null,'url':'4218ac9901b9d36d.woff2'},{'revision':null,'url':'4680ba68412e4da9.woff2'},{'revision':null,'url':'47d7a8698d562a0e.woff'},{'revision':null,'url':'47ec6c9dffe776a0.woff'},{'revision':null,'url':'48e37bd7ebf85a1f.woff2'},{'revision':null,'url':'48edfdf51dfb3160.woff'},{'revision':null,'url':'4a35a2746c8ad7a5.woff'},{'revision':null,'url':'4e11b8a7c445255f.woff2'},{'revision':null,'url':'4ea1f5c3baf89fe3.woff'},{'revision':null,'url':'4ea99f41c896bf9d.woff'},{'revision':null,'url':'5005db1d1caf70c7.woff'},{'revision':null,'url':'528a8e7c1c141a31.woff'},{'revision':null,'url':'52ca12f5b516d4ea.woff'},{'revision':null,'url':'537ddd61c5c1fce2.woff2'},{'revision':null,'url':'5432f7541ec25c34.woff'},{'revision':null,'url':'54a95d73a9454ba3.woff'},{'revision':null,'url':'56c4118c0907f151.woff2'},{'revision':null,'url':'5938bc2ae7ec60c0.woff2'},{'revision':null,'url':'594306657c4e44e8.woff'},{'revision':null,'url':'5a538aa477a66067.woff'},{'revision':null,'url':'5c6586155f0d278a.woff2'},{'revision':null,'url':'60ec587649ba812a.woff2'},{'revision':null,'url':'616567cd947eb9dd.woff'},{'revision':null,'url':'65168b59f44caab4.woff'},{'revision':null,'url':'65c0982f98374864.woff'},{'revision':null,'url':'65e6511e035870e1.woff2'},{'revision':null,'url':'661425f6798cd16a.woff2'},{'revision':null,'url':'66b864fe213caf46.woff2'},{'revision':null,'url':'6775fee945132ef9.woff'},{'revision':null,'url':'68bbd362c8e4983b.woff'},{'revision':null,'url':'68d6deec87b6b604.woff'},{'revision':null,'url':'69a7e6d31d390296.woff'},{'revision':null,'url':'69d087d970ee9455.woff2'},{'revision':null,'url':'69fa3fc7363bbc04.woff'},{'revision':null,'url':'6a1f0178b45b2e9e.woff'},{'revision':null,'url':'6c6c45e66ff54281.woff2'},{'revision':null,'url':'6ffb9ed97b21fdc0.woff'},{'revision':null,'url':'7073a7323e92bd11.woff2'},{'revision':null,'url':'718c6cc31274ab1a.woff2'},{'revision':null,'url':'72cdbedfe04be9f9.woff2'},{'revision':null,'url':'7509c9f56fe9e532.woff2'},{'revision':null,'url':'75dc5c5b04adc8bf.woff2'},{'revision':null,'url':'76a7c256fc8b3490.woff'},{'revision':null,'url':'77b48bc05299ecca.woff2'},{'revision':null,'url':'787f56efa306ddbc.woff'},{'revision':null,'url':'7a0a0215c248c73d.woff2'},{'revision':null,'url':'7c4463d9c84f263a.woff'},{'revision':null,'url':'7d112a556b7670d2.woff'},{'revision':null,'url':'7d52d6014b5f2bbc.woff'},{'revision':null,'url':'7f00bebb24e40167.woff2'},{'revision':null,'url':'7f2c6ea3e740417e.woff'},{'revision':null,'url':'802c6176541eeed7.woff2'},{'revision':null,'url':'8080081b3379c637.woff2'},{'revision':null,'url':'8274cc1afc7619f1.woff'},{'revision':null,'url':'8605507b7a8487c4.woff2'},{'revision':null,'url':'8a83d654702f6534.woff2'},{'revision':null,'url':'8ccee65f6cf254ee.woff'},{'revision':null,'url':'8d82a082a4aba439.woff'},{'revision':null,'url':'8de04ae985937b56.woff'},{'revision':null,'url':'8fe71173a13fe571.woff2'},{'revision':null,'url':'90edccb224a51cee.woff'},{'revision':null,'url':'94b292fe87831a8b.woff'},{'revision':null,'url':'95dc66c1b88745f8.woff'},{'revision':null,'url':'95fb698be77c85ef.woff'},{'revision':null,'url':'9624cec0f9bdd81e.woff2'},{'revision':null,'url':'9662331fa31e3f20.woff'},{'revision':null,'url':'98a3af55a1698171.woff2'},{'revision':null,'url':'9ba85996af74c5ce.woff2'},{'revision':null,'url':'9bc133b1df25cb74.woff'},{'revision':null,'url':'9ddb22faa35006e7.woff2'},{'revision':null,'url':'9e97352380611b95.woff'},{'revision':null,'url':'a167fb2799dd741b.woff2'},{'revision':null,'url':'a2045a5cc4fdf94f.woff2'},{'revision':null,'url':'a246c73905a31c93.woff2'},{'revision':null,'url':'a401aa7939cb6e6f.woff2'},{'revision':null,'url':'a41a71258c38684d.woff'},{'revision':null,'url':'a60d94a72d615a8e.woff'},{'revision':null,'url':'a66764dd0c1fa213.woff'},{'revision':null,'url':'a6ed036f17a1ea29.woff2'},{'revision':null,'url':'a8f635129d660202.woff'},{'revision':null,'url':'a9f25ca430709a1a.woff2'},{'revision':null,'url':'ae14d98ad8a1212c.woff'},{'revision':null,'url':'aeec4f78084adf7f.woff'},{'revision':null,'url':'af11e94b0644eba5.woff'},{'revision':null,'url':'afa9121a49e95351.woff2'},{'revision':null,'url':'afcda12d9f805543.woff2'},{'revision':null,'url':'b09ded85a7da77f1.woff2'},{'revision':null,'url':'b2f4e9d1e821b71c.woff2'},{'revision':null,'url':'b30b06698dc369b2.woff'},{'revision':null,'url':'b4a074bf828bb757.woff2'},{'revision':null,'url':'b7f447da43f6e596.woff2'},{'revision':null,'url':'b7f633b871b84820.woff'},{'revision':null,'url':'bcca84a524572d10.woff2'},{'revision':null,'url':'be4d1f97b11d087c.woff2'},{'revision':null,'url':'be91def2232f6776.woff'},{'revision':null,'url':'bec14780d81164de.woff2'},{'revision':null,'url':'c285f4b15d11f172.woff'},{'revision':null,'url':'c4673617b80801f3.woff'},{'revision':null,'url':'c553f7e0199c5084.woff2'},{'revision':null,'url':'c8470ed2c145ace7.woff'},{'revision':null,'url':'c9d9ce9f465df4fe.woff2'},{'revision':null,'url':'ccb2870475da9fe8.woff'},{'revision':null,'url':'d04134fa33c2606d.woff'},{'revision':null,'url':'d11f9c5cd7d9ea16.woff'},{'revision':null,'url':'d188f7f036ac5779.woff2'},{'revision':null,'url':'d265d81c58525ae4.woff2'},{'revision':null,'url':'d5942cd81663e136.woff2'},{'revision':null,'url':'d6097a5c452acf6d.woff'},{'revision':null,'url':'d66b8ff73d95cabb.woff2'},{'revision':null,'url':'d77f5bf95de8edaa.woff'},{'revision':null,'url':'d8829a685af4f372.woff'},{'revision':null,'url':'d88899ef0fd16719.woff2'},{'revision':null,'url':'d9a5d958e69e058d.woff2'},{'revision':null,'url':'da65d9a514c628c8.woff'},{'revision':null,'url':'dac90d495be353a0.woff2'},{'revision':null,'url':'dd7071bc6306585c.woff'},{'revision':null,'url':'dd8ce598529c3fab.woff2'},{'revision':null,'url':'ddef6f2dd566c2b9.woff'},{'revision':null,'url':'de013f1be25103fa.woff2'},{'revision':null,'url':'dee2ff599db31e5b.woff'},{'revision':null,'url':'dee7c6b5dd954d9b.woff'},{'revision':null,'url':'df222fceeffca849.woff2'},{'revision':null,'url':'e0d2e5b12f028b5d.woff'},{'revision':null,'url':'e33e3db8e4f7559f.woff'},{'revision':null,'url':'e62b00b9199c1ac9.woff2'},{'revision':null,'url':'e696cef1407b2610.woff2'},{'revision':null,'url':'e89ca83b24959664.woff'},{'revision':null,'url':'eb8c0ae77ad55249.woff'},{'revision':null,'url':'ed0997bd7d221b8e.woff'},{'revision':null,'url':'eed48feba743e21c.woff2'},{'revision':null,'url':'f280bda8a6e535a6.woff'},{'revision':null,'url':'f543c88feb236d11.woff2'},{'revision':null,'url':'f591b0079faa93fe.woff2'},{'revision':null,'url':'f6ed27923769ad1d.woff2'},{'revision':null,'url':'f8803bebe640d99a.woff'},{'revision':'30de494bd9e73ae96c18fd0c06fa422b','url':'favicon.ico'},{'revision':null,'url':'fbebeb4336e67012.woff2'},{'revision':null,'url':'fd522cd7a5c646fe.woff'},{'revision':null,'url':'https://dev3.openmrs.org/openmrs/spa/importmap.json'},{'revision':'601b333254b7b6fc48bf9db81ab1749d','url':'index.html'},{'revision':'6b758b31ea00150986994edcfb033a94','url':'logo-512.png'},{'revision':'b860db243392596e3b875bad9794b4e5','url':'logo.svg'},{'revision':null,'url':'openmrs.8c33142777a563d3.js'},{'revision':'10230be33ff15c31af5f9a8587ee6ac8','url':'openmrs.8c33142777a563d3.js.LICENSE.txt'},{'revision':null,'url':'openmrs.c338e62151d961c5.css'}],ge=ve("index.html"),ye=fe(pe.map((({url:e})=>ve(e))));function ve(e){return new URL(e,self.location.href).href}const me=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},be=function(e){return w(e)&&"[object Arguments]"==b(e)};var we=Object.prototype,_e=we.hasOwnProperty,xe=we.propertyIsEnumerable;const ke=be(function(){return arguments}())?be:function(e){return w(e)&&_e.call(e,"callee")&&!xe.call(e,"callee")};var Se=h?h.isConcatSpreadable:void 0;const Oe=function(e){return f(e)||ke(e)||!!(Se&&e&&e[Se])},Pe=function e(t,n,r,i,o){var s=-1,a=t.length;for(r||(r=Oe),o||(o=[]);++s<a;){var u=t[s];n>0&&r(u)?n>1?e(u,n-1,r,i,o):me(o,u):i||(o[o.length]=u)}return o},Ee=function(e){return null!=e&&e.length?Pe(e,1):[]};var Ce=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));function je(e){return e+".buildmanifest.json"}function Re(e){return fetch(e).then((e=>e.json())).catch((()=>null))}function De(e,t){var n,r;try{const i=[],o=function(e){const t=(e.origin+e.pathname).split("/");return t[t.length-1]="",t.join("/")}(new URL(e,self.location.href));for(const e of null!=(n=t.chunks)?n:[])for(const t of null!=(r=e.files)?r:[])i.push(new URL(t,o).toString());return i}catch(t){return console.error("[SW] Failed to determine the dependencies of the module with the URL %s. Not precaching any of the module's assets. Error: ",e,t),[]}}const Ae="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Le=Object.keys,Ke=Array.isArray;function Te(e,t){return"object"!=typeof t||Le(t).forEach((function(n){e[n]=t[n]})),e}"undefined"==typeof Promise||Ae.Promise||(Ae.Promise=Promise);const Ne=Object.getPrototypeOf,Me={}.hasOwnProperty;function $e(e,t){return Me.call(e,t)}function Ie(e,t){"function"==typeof t&&(t=t(Ne(e))),("undefined"==typeof Reflect?Le:Reflect.ownKeys)(t).forEach((n=>{Be(e,n,t[n])}))}const Fe=Object.defineProperty;function Be(e,t,n,r){Fe(e,t,Te(n&&$e(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function qe(e){return{from:function(t){return e.prototype=Object.create(t.prototype),Be(e.prototype,"constructor",e),{extend:Ie.bind(null,e.prototype)}}}}const Ue=Object.getOwnPropertyDescriptor;function We(e,t){let n;return Ue(e,t)||(n=Ne(e))&&We(n,t)}const Ve=[].slice;function He(e,t,n){return Ve.call(e,t,n)}function ze(e,t){return t(e)}function Ye(e){if(!e)throw new Error("Assertion Failed")}function Ge(e){Ae.setImmediate?setImmediate(e):setTimeout(e,0)}function Je(e,t){return e.reduce(((e,n,r)=>{var i=t(n,r);return i&&(e[i[0]]=i[1]),e}),{})}function Qe(e,t){if($e(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,i=t.length;r<i;++r){var o=Qe(e,t[r]);n.push(o)}return n}var s=t.indexOf(".");if(-1!==s){var a=e[t.substr(0,s)];return void 0===a?void 0:Qe(a,t.substr(s+1))}}function Xe(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){Ye("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)Xe(e,t[r],n[r])}else{var o=t.indexOf(".");if(-1!==o){var s=t.substr(0,o),a=t.substr(o+1);if(""===a)void 0===n?Ke(e)&&!isNaN(parseInt(s))?e.splice(s,1):delete e[s]:e[s]=n;else{var u=e[s];u&&$e(e,s)||(u=e[s]={}),Xe(u,a,n)}}else void 0===n?Ke(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function Ze(e){var t={};for(var n in e)$e(e,n)&&(t[n]=e[n]);return t}const et=[].concat;function tt(e){return et.apply([],e)}const nt="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(tt([8,16,32,64].map((e=>["Int","Uint","Float"].map((t=>t+e+"Array")))))).filter((e=>Ae[e])),rt=nt.map((e=>Ae[e]));Je(nt,(e=>[e,!0]));let it=null;function ot(e){it="undefined"!=typeof WeakMap&&new WeakMap;const t=st(e);return it=null,t}function st(e){if(!e||"object"!=typeof e)return e;let t=it&&it.get(e);if(t)return t;if(Ke(e)){t=[],it&&it.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(st(e[n]))}else if(rt.indexOf(e.constructor)>=0)t=e;else{const n=Ne(e);for(var i in t=n===Object.prototype?{}:Object.create(n),it&&it.set(e,t),e)$e(e,i)&&(t[i]=st(e[i]))}return t}const{toString:at}={};function ut(e){return at.call(e).slice(8,-1)}const lt="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",ct="symbol"==typeof lt?function(e){var t;return null!=e&&(t=e[lt])&&t.apply(e)}:function(){return null},ht={};function ft(e){var t,n,r,i;if(1===arguments.length){if(Ke(e))return e.slice();if(this===ht&&"string"==typeof e)return[e];if(i=ct(e)){for(n=[];!(r=i.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}const dt="undefined"!=typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var pt="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function gt(e,t){pt=e,yt=t}var yt=()=>!0;const vt=!new Error("").stack;function mt(){if(vt)try{throw mt.arguments,new Error}catch(e){return e}return new Error}function bt(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(yt).map((e=>"\n"+e)).join("")):""}var wt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],_t=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(wt),xt={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function kt(e,t){this._e=mt(),this.name=e,this.message=t}function St(e,t){return e+". Errors: "+Object.keys(t).map((e=>t[e].toString())).filter(((e,t,n)=>n.indexOf(e)===t)).join("\n")}function Ot(e,t,n,r){this._e=mt(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=St(e,t)}function Pt(e,t){this._e=mt(),this.name="BulkError",this.failures=Object.keys(t).map((e=>t[e])),this.failuresByPos=t,this.message=St(e,t)}qe(kt).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+bt(this._e,2))}},toString:function(){return this.name+": "+this.message}}),qe(Ot).from(kt),qe(Pt).from(kt);var Et=_t.reduce(((e,t)=>(e[t]=t+"Error",e)),{});const Ct=kt;var jt=_t.reduce(((e,t)=>{var n=t+"Error";function r(e,r){this._e=mt(),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=xt[t]||n,this.inner=null)}return qe(r).from(Ct),e[t]=r,e}),{});jt.Syntax=SyntaxError,jt.Type=TypeError,jt.Range=RangeError;var Rt=wt.reduce(((e,t)=>(e[t+"Error"]=jt[t],e)),{}),Dt=_t.reduce(((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=jt[t]),e)),{});function At(){}function Lt(e){return e}function Kt(e,t){return null==e||e===Lt?t:function(n){return t(e(n))}}function Tt(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Nt(e,t){return e===At?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?Tt(r,this.onsuccess):r),i&&(this.onerror=this.onerror?Tt(i,this.onerror):i),void 0!==o?o:n}}function Mt(e,t){return e===At?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?Tt(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Tt(r,this.onerror):r)}}function $t(e,t){return e===At?t:function(n){var r=e.apply(this,arguments);Te(n,r);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var s=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?Tt(i,this.onsuccess):i),o&&(this.onerror=this.onerror?Tt(o,this.onerror):o),void 0===r?void 0===s?void 0:s:Te(r,s)}}function It(e,t){return e===At?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function Ft(e,t){return e===At?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return n.then((function(){return t.apply(r,o)}))}return t.apply(this,arguments)}}Dt.ModifyError=Ot,Dt.DexieError=kt,Dt.BulkError=Pt;var Bt={};const[qt,Ut,Wt]="undefined"==typeof Promise?[]:(()=>{let e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,Ne(e),e];const t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,Ne(t),e]})(),Vt=Ut&&Ut.then,Ht=qt&&qt.constructor,zt=!!Wt;var Yt=!1,Gt=Wt?()=>{Wt.then(bn)}:Ae.setImmediate?setImmediate.bind(null,bn):Ae.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver((()=>{bn(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(bn,0)},Jt=function(e,t){sn.push([e,t]),Xt&&(Gt(),Xt=!1)},Qt=!0,Xt=!0,Zt=[],en=[],tn=null,nn=Lt,rn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Un,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((e=>{try{Un(e[0],e[1])}catch(e){}}))}},on=rn,sn=[],an=0,un=[];function ln(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=At,this._lib=!1;var t=this._PSD=on;if(pt&&(this._stackHolder=mt(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Bt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&dn(this,this._value))}this._state=null,this._value=null,++t.ref,fn(this,e)}const cn={get:function(){var e=on,t=jn;function n(n,r){var i=!e.global&&(e!==on||t!==jn);const o=i&&!Ln();var s=new ln(((t,s)=>{gn(this,new hn(Bn(n,e,i,o),Bn(r,e,i,o),t,s,e))}));return pt&&mn(s,this),s}return n.prototype=Bt,n},set:function(e){Be(this,"then",e&&e.prototype===Bt?cn:{get:function(){return e},set:cn.set})}};function hn(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function fn(e,t){try{t((t=>{if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&wn();t&&"function"==typeof t.then?fn(e,((e,n)=>{t instanceof ln?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,pn(e)),n&&_n()}}),dn.bind(null,e))}catch(t){dn(e,t)}}function dn(e,t){if(en.push(t),null===e._state){var n=e._lib&&wn();t=nn(t),e._state=!1,e._value=t,pt&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){}}((()=>{var n=We(t,"stack");t._promise=e,Be(t,"stack",{get:()=>Yt?n&&(n.get?n.get.apply(t):n.value):e.stack})})),function(e){Zt.some((t=>t._value===e._value))||Zt.push(e)}(e),pn(e),n&&_n()}}function pn(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)gn(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===an&&(++an,Jt((()=>{0==--an&&xn()}),[]))}function gn(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,++an,Jt(yn,[n,e,t])}else e._listeners.push(t)}function yn(e,t,n){try{tn=t;var r,i=t._value;t._state?r=e(i):(en.length&&(en=[]),r=e(i),-1===en.indexOf(i)&&function(e){for(var t=Zt.length;t;)if(Zt[--t]._value===e._value)return void Zt.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{tn=null,0==--an&&xn(),--n.psd.ref||n.psd.finalize()}}function vn(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var i,o,s=e._value;null!=s?(i=s.name||"Error",o=s.message||s,r=bt(s,0)):(i=s,o=""),t.push(i+(o?": "+o:"")+r)}return pt&&((r=bt(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&vn(e._prev,t,n)),t}function mn(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function bn(){wn()&&_n()}function wn(){var e=Qt;return Qt=!1,Xt=!1,e}function _n(){var e,t,n;do{for(;sn.length>0;)for(e=sn,sn=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(sn.length>0);Qt=!0,Xt=!0}function xn(){var e=Zt;Zt=[],e.forEach((e=>{e._PSD.onunhandled.call(null,e._value,e)}));for(var t=un.slice(0),n=t.length;n;)t[--n]()}function kn(e){return new ln(Bt,!1,e)}function Sn(e,t){var n=on;return function(){var r=wn(),i=on;try{return Mn(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Mn(i,!1),r&&_n()}}}Ie(ln.prototype,{then:cn,_then:function(e,t){gn(this,new hn(null,null,e,t,on))},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,(e=>e instanceof t?n(e):kn(e))):this.then(null,(e=>e&&e.name===t?n(e):kn(e)))},finally:function(e){return this.then((t=>(e(),t)),(t=>(e(),kn(t))))},stack:{get:function(){if(this._stack)return this._stack;try{Yt=!0;var e=vn(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Yt=!1}}},timeout:function(e,t){return e<1/0?new ln(((n,r)=>{var i=setTimeout((()=>r(new jt.Timeout(t))),e);this.then(n,r).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&Be(ln.prototype,Symbol.toStringTag,"Dexie.Promise"),rn.env=$n(),Ie(ln,{all:function(){var e=ft.apply(null,arguments).map(Kn);return new ln((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(((i,o)=>ln.resolve(i).then((n=>{e[o]=n,--r||t(e)}),n)))}))},resolve:e=>{if(e instanceof ln)return e;if(e&&"function"==typeof e.then)return new ln(((t,n)=>{e.then(t,n)}));var t=new ln(Bt,!0,e);return mn(t,tn),t},reject:kn,race:function(){var e=ft.apply(null,arguments).map(Kn);return new ln(((t,n)=>{e.map((e=>ln.resolve(e).then(t,n)))}))},PSD:{get:()=>on,set:e=>on=e},totalEchoes:{get:()=>jn},newPSD:Dn,usePSD:In,scheduler:{get:()=>Jt,set:e=>{Jt=e}},rejectionMapper:{get:()=>nn,set:e=>{nn=e}},follow:(e,t)=>new ln(((n,r)=>Dn(((t,n)=>{var r=on;r.unhandleds=[],r.onunhandled=n,r.finalize=Tt((function(){!function(e){un.push((function t(){e(),un.splice(un.indexOf(t),1)})),++an,Jt((()=>{0==--an&&xn()}),[])}((()=>{0===this.unhandleds.length?t():n(this.unhandleds[0])}))}),r.finalize),e()}),t,n,r)))}),Ht&&(Ht.allSettled&&Be(ln,"allSettled",(function(){const e=ft.apply(null,arguments).map(Kn);return new ln((t=>{0===e.length&&t([]);let n=e.length;const r=new Array(n);e.forEach(((e,i)=>ln.resolve(e).then((e=>r[i]={status:"fulfilled",value:e}),(e=>r[i]={status:"rejected",reason:e})).then((()=>--n||t(r)))))}))})),Ht.any&&"undefined"!=typeof AggregateError&&Be(ln,"any",(function(){const e=ft.apply(null,arguments).map(Kn);return new ln(((t,n)=>{0===e.length&&n(new AggregateError([]));let r=e.length;const i=new Array(r);e.forEach(((e,o)=>ln.resolve(e).then((e=>t(e)),(e=>{i[o]=e,--r||n(new AggregateError(i))}))))}))})));const On={awaits:0,echoes:0,id:0};var Pn=0,En=[],Cn=0,jn=0,Rn=0;function Dn(e,t,n,r){var i=on,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++Rn;var s=rn.env;o.env=zt?{Promise:ln,PromiseProp:{value:ln,configurable:!0,writable:!0},all:ln.all,race:ln.race,allSettled:ln.allSettled,any:ln.any,resolve:ln.resolve,reject:ln.reject,nthen:qn(s.nthen,o),gthen:qn(s.gthen,o)}:{},t&&Te(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var a=In(o,e,n,r);return 0===o.ref&&o.finalize(),a}function An(){return On.id||(On.id=++Pn),++On.awaits,On.echoes+=100,On.id}function Ln(){return!!On.awaits&&(0==--On.awaits&&(On.id=0),On.echoes=100*On.awaits,!0)}function Kn(e){return On.echoes&&e&&e.constructor===Ht?(An(),e.then((e=>(Ln(),e)),(e=>(Ln(),Wn(e))))):e}function Tn(e){++jn,On.echoes&&0!=--On.echoes||(On.echoes=On.id=0),En.push(on),Mn(e,!0)}function Nn(){var e=En[En.length-1];En.pop(),Mn(e,!1)}function Mn(e,t){var n=on;if((t?!On.echoes||Cn++&&e===on:!Cn||--Cn&&e===on)||Fn(t?Tn.bind(null,e):Nn),e!==on&&(on=e,n===rn&&(rn.env=$n()),zt)){var r=rn.env.Promise,i=e.env;Ut.then=i.nthen,r.prototype.then=i.gthen,(n.global||e.global)&&(Object.defineProperty(Ae,"Promise",i.PromiseProp),r.all=i.all,r.race=i.race,r.resolve=i.resolve,r.reject=i.reject,i.allSettled&&(r.allSettled=i.allSettled),i.any&&(r.any=i.any))}}function $n(){var e=Ae.Promise;return zt?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(Ae,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:Ut.then,gthen:e.prototype.then}:{}}function In(e,t,n,r,i){var o=on;try{return Mn(e,!0),t(n,r,i)}finally{Mn(o,!1)}}function Fn(e){Vt.call(qt,e)}function Bn(e,t,n,r){return"function"!=typeof e?e:function(){var i=on;n&&An(),Mn(t,!0);try{return e.apply(this,arguments)}finally{Mn(i,!1),r&&Fn(Ln)}}}function qn(e,t){return function(n,r){return e.call(this,Bn(n,t),Bn(r,t))}}function Un(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,i={promise:t,reason:e};if(Ae.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),Te(r,i)):Ae.CustomEvent&&Te(r=new CustomEvent("unhandledrejection",{detail:i}),i),r&&Ae.dispatchEvent&&(dispatchEvent(r),!Ae.PromiseRejectionEvent&&Ae.onunhandledrejection))try{Ae.onunhandledrejection(r)}catch(e){}pt&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}-1===(""+Vt).indexOf("[native code]")&&(An=Ln=At);var Wn=ln.reject;function Vn(e,t,n,r){if(e.idbdb&&(e._state.openComplete||on.letThrough||e._vip)){var i=e._createTransaction(t,n,e._dbSchema);try{i.create(),e._state.PR1398_maxLoop=3}catch(i){return i.name===Et.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Vn(e,t,n,r)))):Wn(i)}return i._promise(t,((e,t)=>Dn((()=>(on.trans=i,r(e,t,i)))))).then((e=>i._completion.then((()=>e))))}if(e._state.openComplete)return Wn(new jt.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return Wn(new jt.DatabaseClosed);e.open().catch(At)}return e._state.dbReadyPromise.then((()=>Vn(e,t,n,r)))}const Hn=String.fromCharCode(65535),zn="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Yn=[],Gn="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Jn=Gn,Qn=Gn,Xn=e=>!/(dexie\.js|dexie\.min\.js)/.test(e);function Zn(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}const er={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function tr(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=ot(t))[e],t)}class nr{_trans(e,t,n){const r=this._tx||on.trans,i=this.name;function o(e,n,r){if(!r.schema[i])throw new jt.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)}const s=wn();try{return r&&r.db===this.db?r===on.trans?r._promise(e,o,n):Dn((()=>r._promise(e,o,n)),{trans:r,transless:on.transless||on}):Vn(this.db,e,[this.name],o)}finally{s&&_n()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(t=>this.core.get({trans:t,key:e}).then((e=>this.hook.reading.fire(e))))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(Ke(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);const t=Le(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);const n=this.schema.indexes.concat(this.schema.primKey).filter((e=>e.compound&&t.every((t=>e.keyPath.indexOf(t)>=0))&&e.keyPath.every((e=>t.indexOf(e)>=0))))[0];if(n&&this.db._maxKey!==Hn)return this.where(n.name).equals(n.keyPath.map((t=>e[t])));!n&&pt&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);const{idxByName:r}=this.schema,i=this.db._deps.indexedDB;function o(e,t){try{return 0===i.cmp(e,t)}catch(e){return!1}}const[s,a]=t.reduce((([t,n],i)=>{const s=r[i],a=e[i];return[t||s,t||!s?Zn(n,s&&s.multi?e=>{const t=Qe(e,i);return Ke(t)&&t.some((e=>o(a,e)))}:e=>o(a,Qe(e,i))):n]}),[null,null]);return s?this.where(s.name).equals(e[s.keyPath]).filter(a):n?this.filter(a):this.where(t).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,Ke(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;const t=t=>{if(!t)return t;const n=Object.create(e.prototype);for(var r in t)if($e(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}defineClass(){return this.mapToClass((function(e){Te(this,e)}))}add(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let i=e;return r&&n&&(i=tr(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[i]}))).then((e=>e.numFailures?ln.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{Xe(e,r,t)}catch(e){}return t}))}update(e,t){if("object"!=typeof e||Ke(e))return this.where(":id").equals(e).modify(t);{const n=Qe(e,this.schema.primKey.keyPath);if(void 0===n)return Wn(new jt.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?Le(t).forEach((n=>{Xe(e,n,t[n])})):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}}put(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let i=e;return r&&n&&(i=tr(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"put",values:[i],keys:null!=t?[t]:null}))).then((e=>e.numFailures?ln.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{Xe(e,r,t)}catch(e){}return t}))}delete(e){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:[e]}))).then((e=>e.numFailures?ln.reject(e.failures[0]):void 0))}clear(){return this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"deleteRange",range:er}))).then((e=>e.numFailures?ln.reject(e.failures[0]):void 0))}bulkGet(e){return this._trans("readonly",(t=>this.core.getMany({keys:e,trans:t}).then((e=>e.map((e=>this.hook.reading.fire(e)))))))}bulkAdd(e,t,n){const r=Array.isArray(t)?t:void 0,i=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:o}=this.schema.primKey;if(o&&r)throw new jt.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new jt.InvalidArgument("Arguments objects and keys must have the same length");const s=e.length;let a=o&&n?e.map(tr(o)):e;return this.core.mutate({trans:t,type:"add",keys:r,values:a,wantResults:i}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return i?t:n;throw new Pt(`${this.name}.bulkAdd(): ${e} of ${s} operations failed`,r)}))}))}bulkPut(e,t,n){const r=Array.isArray(t)?t:void 0,i=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:o}=this.schema.primKey;if(o&&r)throw new jt.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new jt.InvalidArgument("Arguments objects and keys must have the same length");const s=e.length;let a=o&&n?e.map(tr(o)):e;return this.core.mutate({trans:t,type:"put",keys:r,values:a,wantResults:i}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return i?t:n;throw new Pt(`${this.name}.bulkPut(): ${e} of ${s} operations failed`,r)}))}))}bulkDelete(e){const t=e.length;return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:e}))).then((({numFailures:e,lastResult:n,failures:r})=>{if(0===e)return n;throw new Pt(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,r)}))}}function rr(e){var t={},n=function(n,r){if(r){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return t[n].subscribe.apply(null,o),e}if("string"==typeof n)return t[n]};n.addEventType=o;for(var r=1,i=arguments.length;r<i;++r)o(arguments[r]);return n;function o(e,r,i){if("object"==typeof e)return s(e);r||(r=It),i||(i=At);var o={subscribers:[],fire:i,subscribe:function(e){-1===o.subscribers.indexOf(e)&&(o.subscribers.push(e),o.fire=r(o.fire,e))},unsubscribe:function(e){o.subscribers=o.subscribers.filter((function(t){return t!==e})),o.fire=o.subscribers.reduce(r,i)}};return t[e]=n[e]=o,o}function s(e){Le(e).forEach((function(t){var n=e[t];if(Ke(n))o(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new jt.InvalidArgument("Invalid event config");var r=o(t,Lt,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){Ge((function(){e.apply(null,t)}))}))}))}}))}}function ir(e,t){return qe(t).from({prototype:e}),t}function or(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function sr(e,t){e.filter=Zn(e.filter,t)}function ar(e,t,n){var r=e.replayFilter;e.replayFilter=r?()=>Zn(r(),t()):t,e.justLimit=n&&!r}function ur(e,t){if(e.isPrimKey)return t.primaryKey;const n=t.getIndexByKeyPath(e.index);if(!n)throw new jt.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function lr(e,t,n){const r=ur(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 cr(e,t,n,r){const i=e.replayFilter?Zn(e.filter,e.replayFilter()):e.filter;if(e.or){const o={},s=(e,n,r)=>{if(!i||i(n,r,(e=>n.stop(e)),(e=>n.fail(e)))){var s=n.primaryKey,a=""+s;"[object ArrayBuffer]"===a&&(a=""+new Uint8Array(s)),$e(o,a)||(o[a]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(s,n),hr(lr(e,r,n),e.algorithm,s,!e.keysOnly&&e.valueMapper)])}return hr(lr(e,r,n),Zn(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function hr(e,t,n,r){var i=Sn(r?(e,t,i)=>n(r(e),t,i):n);return e.then((e=>{if(e)return e.start((()=>{var n=()=>e.continue();t&&!t(e,(e=>n=e),(t=>{e.stop(t),n=At}),(t=>{e.fail(t),n=At}))||i(e.value,e,(e=>n=e)),n()}))}))}function fr(e,t){try{const n=dr(e),r=dr(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){const n=e.length,r=t.length,i=n<r?n:r;for(let n=0;n<i;++n)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return n===r?0:n<r?-1:1}(pr(e),pr(t));case"Array":return function(e,t){const n=e.length,r=t.length,i=n<r?n:r;for(let n=0;n<i;++n){const r=fr(e[n],t[n]);if(0!==r)return r}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function dr(e){const t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";const n=ut(e);return"ArrayBuffer"===n?"binary":n}function pr(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class gr{_read(e,t){var n=this._ctx;return n.error?n.table._trans(null,Wn.bind(null,n.error)):n.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,Wn.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=Zn(t.algorithm,e)}_iterate(e,t){return cr(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&Te(n,e),t._ctx=n,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read((n=>cr(t,e,n,t.table.core)))}count(e){return this._read((e=>{const t=this._ctx,n=t.table.core;if(or(t,!0))return n.count({trans:e,query:{index:ur(t,n.schema),range:t.range}}).then((e=>Math.min(e,t.limit)));var r=0;return cr(t,(()=>(++r,!1)),e,n).then((()=>r))})).then(e)}sortBy(e,t){const n=e.split(".").reverse(),r=n[0],i=n.length-1;function o(e,t){return t?o(e[n[t]],t-1):e[r]}var s="next"===this._ctx.dir?1:-1;function a(e,t){var n=o(e,i),r=o(t,i);return n<r?-s:n>r?s:0}return this.toArray((function(e){return e.sort(a)})).then(t)}toArray(e){return this._read((e=>{var t=this._ctx;if("next"===t.dir&&or(t,!0)&&t.limit>0){const{valueMapper:n}=t,r=ur(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:r,range:t.range}}).then((({result:e})=>n?e.map(n):e))}{const n=[];return cr(t,(e=>n.push(e)),e,t.table.core).then((()=>n))}}),e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,or(t)?ar(t,(()=>{var t=e;return(e,n)=>0===t||(1===t?(--t,!1):(n((()=>{e.advance(t),t=0})),!1))})):ar(t,(()=>{var t=e;return()=>--t<0}))),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),ar(this._ctx,(()=>{var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this}until(e,t){return sr(this._ctx,(function(n,r,i){return!e(n.value)||(r(i),t)})),this}first(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}last(e){return this.reverse().first(e)}filter(e){var t,n;return sr(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=Zn(t.isMatch,n),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))}keys(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)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&or(t,!0)&&t.limit>0)return this._read((e=>{var n=ur(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((({result:e})=>e)).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return sr(this._ctx,(function(e){var t=e.primaryKey.toString(),r=$e(n,t);return n[t]=!0,!r})),this}modify(e){var t=this._ctx;return this._write((n=>{var r;if("function"==typeof e)r=e;else{var i=Le(e),o=i.length;r=function(t){for(var n=!1,r=0;r<o;++r){var s=i[r],a=e[s];Qe(t,s)!==a&&(Xe(t,s,a),n=!0)}return n}}const s=t.table.core,{outbound:a,extractKey:u}=s.schema.primaryKey,l=this.db._options.modifyChunkSize||200,c=[];let h=0;const f=[],d=(e,t)=>{const{failures:n,numFailures:r}=t;h+=e-r;for(let e of Le(n))c.push(n[e])};return this.clone().primaryKeys().then((i=>{const o=c=>{const h=Math.min(l,i.length-c);return s.getMany({trans:n,keys:i.slice(c,c+h),cache:"immutable"}).then((f=>{const p=[],g=[],y=a?[]:null,v=[];for(let e=0;e<h;++e){const t=f[e],n={value:ot(t),primKey:i[c+e]};!1!==r.call(n,n.value,n)&&(null==n.value?v.push(i[c+e]):a||0===fr(u(t),u(n.value))?(g.push(n.value),a&&y.push(i[c+e])):(v.push(i[c+e]),p.push(n.value)))}const m=or(t)&&t.limit===1/0&&("function"!=typeof e||e===yr)&&{index:t.index,range:t.range};return Promise.resolve(p.length>0&&s.mutate({trans:n,type:"add",values:p}).then((e=>{for(let t in e.failures)v.splice(parseInt(t),1);d(p.length,e)}))).then((()=>(g.length>0||m&&"object"==typeof e)&&s.mutate({trans:n,type:"put",keys:y,values:g,criteria:m,changeSpec:"function"!=typeof e&&e}).then((e=>d(g.length,e))))).then((()=>(v.length>0||m&&e===yr)&&s.mutate({trans:n,type:"delete",keys:v,criteria:m}).then((e=>d(v.length,e))))).then((()=>i.length>c+h&&o(c+l)))}))};return o(0).then((()=>{if(c.length>0)throw new Ot("Error modifying one or more objects",c,h,f);return i.length}))}))}))}delete(){var e=this._ctx,t=e.range;return or(e)&&(e.isPrimKey&&!Qn||3===t.type)?this._write((n=>{const{primaryKey:r}=e.table.core.schema,i=t;return e.table.core.count({trans:n,query:{index:r,range:i}}).then((t=>e.table.core.mutate({trans:n,type:"deleteRange",range:i}).then((({failures:e,lastResult:n,results:r,numFailures:i})=>{if(i)throw new Ot("Could not delete some values",Object.keys(e).map((t=>e[t])),t-i);return t-i}))))})):this.modify(yr)}}const yr=(e,t)=>t.value=null;function vr(e,t){return e<t?-1:e===t?0:1}function mr(e,t){return e>t?-1:e===t?0:1}function br(e,t,n){var r=e instanceof Or?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function wr(e){return new e.Collection(e,(()=>Sr(""))).limit(0)}function _r(e,t,n,r,i,o){for(var s=Math.min(e.length,r.length),a=-1,u=0;u<s;++u){var l=t[u];if(l!==r[u])return i(e[u],n[u])<0?e.substr(0,u)+n[u]+n.substr(u+1):i(e[u],r[u])<0?e.substr(0,u)+r[u]+n.substr(u+1):a>=0?e.substr(0,a)+t[a]+n.substr(a+1):null;i(e[u],l)<0&&(a=u)}return s<r.length&&"next"===o?e+n.substr(e.length):s<e.length&&"prev"===o?e.substr(0,n.length):a<0?null:e.substr(0,a)+r[a]+n.substr(a+1)}function xr(e,t,n,r){var i,o,s,a,u,l,c,h=n.length;if(!n.every((e=>"string"==typeof e)))return br(e,"String expected.");function f(e){i=function(e){return"next"===e?e=>e.toUpperCase():e=>e.toLowerCase()}(e),o=function(e){return"next"===e?e=>e.toLowerCase():e=>e.toUpperCase()}(e),s="next"===e?vr:mr;var t=n.map((function(e){return{lower:o(e),upper:i(e)}})).sort((function(e,t){return s(e.lower,t.lower)}));a=t.map((function(e){return e.upper})),u=t.map((function(e){return e.lower})),l=e,c="next"===e?"":r}f("next");var d=new e.Collection(e,(()=>kr(a[0],u[h-1]+r)));d._ondirectionchange=function(e){f(e)};var p=0;return d._addAlgorithm((function(e,n,r){var i=e.key;if("string"!=typeof i)return!1;var f=o(i);if(t(f,u,p))return!0;for(var d=null,g=p;g<h;++g){var y=_r(i,f,a[g],u[g],s,l);null===y&&null===d?p=g+1:(null===d||s(d,y)>0)&&(d=y)}return n(null!==d?function(){e.continue(d+c)}:r),!1})),d}function kr(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Sr(e){return{type:1,lower:e,upper:e}}class Or{get Collection(){return this._ctx.table.db.Collection}between(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)?wr(this):new this.Collection(this,(()=>kr(e,t,!n,!r)))}catch(e){return br(this,zn)}}equals(e){return null==e?br(this,zn):new this.Collection(this,(()=>Sr(e)))}above(e){return null==e?br(this,zn):new this.Collection(this,(()=>kr(e,void 0,!0)))}aboveOrEqual(e){return null==e?br(this,zn):new this.Collection(this,(()=>kr(e,void 0,!1)))}below(e){return null==e?br(this,zn):new this.Collection(this,(()=>kr(void 0,e,!1,!0)))}belowOrEqual(e){return null==e?br(this,zn):new this.Collection(this,(()=>kr(void 0,e)))}startsWith(e){return"string"!=typeof e?br(this,"String expected."):this.between(e,e+Hn,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):xr(this,((e,t)=>0===e.indexOf(t[0])),[e],Hn)}equalsIgnoreCase(e){return xr(this,((e,t)=>e===t[0]),[e],"")}anyOfIgnoreCase(){var e=ft.apply(ht,arguments);return 0===e.length?wr(this):xr(this,((e,t)=>-1!==t.indexOf(e)),e,"")}startsWithAnyOfIgnoreCase(){var e=ft.apply(ht,arguments);return 0===e.length?wr(this):xr(this,((e,t)=>t.some((t=>0===e.indexOf(t)))),e,Hn)}anyOf(){const e=ft.apply(ht,arguments);let t=this._cmp;try{e.sort(t)}catch(e){return br(this,zn)}if(0===e.length)return wr(this);const n=new this.Collection(this,(()=>kr(e[0],e[e.length-1])));n._ondirectionchange=n=>{t="next"===n?this._ascending:this._descending,e.sort(t)};let r=0;return n._addAlgorithm(((n,i,o)=>{const s=n.key;for(;t(s,e[r])>0;)if(++r,r===e.length)return i(o),!1;return 0===t(s,e[r])||(i((()=>{n.continue(e[r])})),!1)})),n}notEqual(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const e=ft.apply(ht,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return br(this,zn)}const t=e.reduce(((e,t)=>e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}inAnyRange(e,t){const n=this._cmp,r=this._ascending,i=this._descending,o=this._min,s=this._max;if(0===e.length)return wr(this);if(!e.every((e=>void 0!==e[0]&&void 0!==e[1]&&r(e[0],e[1])<=0)))return br(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",jt.InvalidArgument);const a=!t||!1!==t.includeLowers,u=t&&!0===t.includeUppers;let l,c=r;function h(e,t){return c(e[0],t[0])}try{l=e.reduce((function(e,t){let r=0,i=e.length;for(;r<i;++r){const i=e[r];if(n(t[0],i[1])<0&&n(t[1],i[0])>0){i[0]=o(i[0],t[0]),i[1]=s(i[1],t[1]);break}}return r===i&&e.push(t),e}),[]),l.sort(h)}catch(e){return br(this,zn)}let f=0;const d=u?e=>r(e,l[f][1])>0:e=>r(e,l[f][1])>=0,p=a?e=>i(e,l[f][0])>0:e=>i(e,l[f][0])>=0;let g=d;const y=new this.Collection(this,(()=>kr(l[0][0],l[l.length-1][1],!a,!u)));return y._ondirectionchange=e=>{"next"===e?(g=d,c=r):(g=p,c=i),l.sort(h)},y._addAlgorithm(((e,t,n)=>{for(var i=e.key;g(i);)if(++f,f===l.length)return t(n),!1;return!!function(e){return!d(e)&&!p(e)}(i)||(0===this._cmp(i,l[f][1])||0===this._cmp(i,l[f][0])||t((()=>{c===r?e.continue(l[f][0]):e.continue(l[f][1])})),!1)})),y}startsWithAnyOf(){const e=ft.apply(ht,arguments);return e.every((e=>"string"==typeof e))?0===e.length?wr(this):this.inAnyRange(e.map((e=>[e,e+Hn]))):br(this,"startsWithAnyOf() only works with strings")}}function Pr(e){return Sn((function(t){return Er(t),e(t.target.error),!1}))}function Er(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}const Cr=rr(null,"storagemutated");class jr{_lock(){return Ye(!on.global),++this._reculock,1!==this._reculock||on.global||(on.lockOwnerFor=this),this}_unlock(){if(Ye(!on.global),0==--this._reculock)for(on.global||(on.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{In(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&on.lockOwnerFor!==this}create(e){if(!this.mode)return this;const t=this.db.idbdb,n=this.db._state.dbOpenError;if(Ye(!this.idbtrans),!e&&!t)switch(n&&n.name){case"DatabaseClosedError":throw new jt.DatabaseClosed(n);case"MissingAPIError":throw new jt.MissingAPI(n.message,n);default:throw new jt.OpenFailed(n)}if(!this.active)throw new jt.TransactionInactive;return Ye(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=Sn((t=>{Er(t),this._reject(e.error)})),e.onabort=Sn((t=>{Er(t),this.active&&this._reject(new jt.Abort(e.error)),this.active=!1,this.on("abort").fire(t)})),e.oncomplete=Sn((()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&Cr.storagemutated.fire(e.mutatedParts)})),this}_promise(e,t,n){if("readwrite"===e&&"readwrite"!==this.mode)return Wn(new jt.ReadOnly("Transaction is readonly"));if(!this.active)return Wn(new jt.TransactionInactive);if(this._locked())return new ln(((r,i)=>{this._blockedFuncs.push([()=>{this._promise(e,t,n).then(r,i)},on])}));if(n)return Dn((()=>{var e=new ln(((e,n)=>{this._lock();const r=t(e,n,this);r&&r.then&&r.then(e,n)}));return e.finally((()=>this._unlock())),e._lib=!0,e}));var r=new ln(((e,n)=>{var r=t(e,n,this);r&&r.then&&r.then(e,n)}));return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();const n=ln.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((()=>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 i=t._waitingFor;return new ln(((e,r)=>{n.then((n=>t._waitingQueue.push(Sn(e.bind(null,n)))),(e=>t._waitingQueue.push(Sn(r.bind(null,e))))).finally((()=>{t._waitingFor===i&&(t._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new jt.Abort))}table(e){const t=this._memoizedTables||(this._memoizedTables={});if($e(t,e))return t[e];const n=this.schema[e];if(!n)throw new jt.NotFound("Table "+e+" not part of transaction");const r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}}function Rr(e,t,n,r,i,o,s){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!s?"&":"")+(r?"*":"")+(i?"++":"")+Dr(t)}}function Dr(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Ar(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:Je(n,(e=>[e.name,e]))}}let Lr=e=>{try{return e.only([[]]),Lr=()=>[[]],[[]]}catch(e){return Lr=()=>Hn,Hn}};function Kr(e){return null==e?()=>{}:"string"==typeof e?function(e){return 1===e.split(".").length?t=>t[e]:t=>Qe(t,e)}(e):t=>Qe(t,e)}function Tr(e){return[].slice.call(e)}let Nr=0;function Mr(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function $r(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:n,upper:r,lowerOpen:i,upperOpen:o}=e;return void 0===n?void 0===r?null:t.upperBound(r,!!o):void 0===r?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!o)}const{schema:i,hasGetAll:o}=function(e,t){const n=Tr(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((e=>t.objectStore(e))).map((e=>{const{keyPath:t,autoIncrement:n}=e,r=Ke(t),i=null==t,o={},s={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:Kr(t)},indexes:Tr(e.indexNames).map((t=>e.index(t))).map((e=>{const{name:t,unique:n,multiEntry:r,keyPath:i}=e,s={name:t,compound:Ke(i),keyPath:i,unique:n,multiEntry:r,extractKey:Kr(i)};return o[Mr(i)]=s,s})),getIndexByKeyPath:e=>o[Mr(e)]};return o[":id"]=s.primaryKey,null!=t&&(o[Mr(t)]=s.primaryKey),s}))},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,n),s=i.tables.map((e=>function(e){const t=e.name;return{name:t,schema:e,mutate:function({trans:e,type:n,keys:i,values:o,range:s}){return new Promise(((a,u)=>{a=Sn(a);const l=e.objectStore(t),c=null==l.keyPath,h="put"===n||"add"===n;if(!h&&"delete"!==n&&"deleteRange"!==n)throw new Error("Invalid operation type: "+n);const{length:f}=i||o||{length:1};if(i&&o&&i.length!==o.length)throw new Error("Given keys array must have same length as given values array.");if(0===f)return a({numFailures:0,failures:{},results:[],lastResult:void 0});let d;const p=[],g=[];let y=0;const v=e=>{++y,Er(e)};if("deleteRange"===n){if(4===s.type)return a({numFailures:y,failures:g,results:[],lastResult:void 0});3===s.type?p.push(d=l.clear()):p.push(d=l.delete(r(s)))}else{const[e,t]=h?c?[o,i]:[o,null]:[i,null];if(h)for(let r=0;r<f;++r)p.push(d=t&&void 0!==t[r]?l[n](e[r],t[r]):l[n](e[r])),d.onerror=v;else for(let t=0;t<f;++t)p.push(d=l[n](e[t])),d.onerror=v}const m=e=>{const t=e.target.result;p.forEach(((e,t)=>null!=e.error&&(g[t]=e.error))),a({numFailures:y,failures:g,results:"delete"===n?i:p.map((e=>e.result)),lastResult:t})};d.onerror=e=>{v(e),m(e)},d.onsuccess=m}))},getMany:({trans:e,keys:n})=>new Promise(((r,i)=>{r=Sn(r);const o=e.objectStore(t),s=n.length,a=new Array(s);let u,l=0,c=0;const h=e=>{const t=e.target;a[t._pos]=t.result,++c===l&&r(a)},f=Pr(i);for(let e=0;e<s;++e)null!=n[e]&&(u=o.get(n[e]),u._pos=e,u.onsuccess=h,u.onerror=f,++l);0===l&&r(a)})),get:({trans:e,key:n})=>new Promise(((r,i)=>{r=Sn(r);const o=e.objectStore(t).get(n);o.onsuccess=e=>r(e.target.result),o.onerror=Pr(i)})),query:function(e){return n=>new Promise(((i,o)=>{i=Sn(i);const{trans:s,values:a,limit:u,query:l}=n,c=u===1/0?void 0:u,{index:h,range:f}=l,d=s.objectStore(t),p=h.isPrimaryKey?d:d.index(h.name),g=r(f);if(0===u)return i({result:[]});if(e){const e=a?p.getAll(g,c):p.getAllKeys(g,c);e.onsuccess=e=>i({result:e.target.result}),e.onerror=Pr(o)}else{let e=0;const t=a||!("openKeyCursor"in p)?p.openCursor(g):p.openKeyCursor(g),n=[];t.onsuccess=r=>{const o=t.result;return o?(n.push(a?o.value:o.primaryKey),++e===u?i({result:n}):void o.continue()):i({result:n})},t.onerror=Pr(o)}}))}(o),openCursor:function({trans:e,values:n,query:i,reverse:o,unique:s}){return new Promise(((a,u)=>{a=Sn(a);const{index:l,range:c}=i,h=e.objectStore(t),f=l.isPrimaryKey?h:h.index(l.name),d=o?s?"prevunique":"prev":s?"nextunique":"next",p=n||!("openKeyCursor"in f)?f.openCursor(r(c),d):f.openKeyCursor(r(c),d);p.onerror=Pr(u),p.onsuccess=Sn((t=>{const n=p.result;if(!n)return void a(null);n.___id=++Nr,n.done=!1;const r=n.continue.bind(n);let i=n.continuePrimaryKey;i&&(i=i.bind(n));const o=n.advance.bind(n),s=()=>{throw new Error("Cursor not stopped")};n.trans=e,n.stop=n.continue=n.continuePrimaryKey=n.advance=()=>{throw new Error("Cursor not started")},n.fail=Sn(u),n.next=function(){let e=1;return this.start((()=>e--?this.continue():this.stop())).then((()=>this))},n.start=e=>{const t=new Promise(((e,t)=>{e=Sn(e),p.onerror=Pr(t),n.fail=t,n.stop=t=>{n.stop=n.continue=n.continuePrimaryKey=n.advance=s,e(t)}})),a=()=>{if(p.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=()=>{throw new Error("Cursor behind last entry")},n.stop()};return p.onsuccess=Sn((e=>{p.onsuccess=a,a()})),n.continue=r,n.continuePrimaryKey=i,n.advance=o,a(),t},a(n)}),u)}))},count({query:e,trans:n}){const{index:i,range:o}=e;return new Promise(((e,s)=>{const a=n.objectStore(t),u=i.isPrimaryKey?a:a.index(i.name),l=r(o),c=l?u.count(l):u.count();c.onsuccess=Sn((t=>e(t.target.result))),c.onerror=Pr(s)}))}}}(e))),a={};return s.forEach((e=>a[e.name]=e)),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!a[e])throw new Error(`Table '${e}' not found`);return a[e]},MIN_KEY:-1/0,MAX_KEY:Lr(t),schema:i}}function Ir({_novip:e},t){const n=t.db,r=function(e,t,{IDBKeyRange:n,indexedDB:r},i){const o=function(e,t){return t.reduce(((e,{create:t})=>({...e,...t(e)})),e)}($r(t,n,i),e.dbcore);return{dbcore:o}}(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach((t=>{const n=t.name;e.core.schema.tables.some((e=>e.name===n))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function Fr({_novip:e},t,n,r){n.forEach((n=>{const i=r[n];t.forEach((t=>{const r=We(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?Be(t,n,{get(){return this.table(n)},set(e){Fe(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,i))}))}))}function Br({_novip:e},t){t.forEach((t=>{for(let n in t)t[n]instanceof e.Table&&delete t[n]}))}function qr(e,t){return e._cfg.version-t._cfg.version}function Ur(e,t,n,r){const i=e._dbSchema,o=e._createTransaction("readwrite",e._storeNames,i);o.create(n),o._completion.catch(r);const s=o._reject.bind(o),a=on.transless||on;Dn((()=>{on.trans=o,on.transless=a,0===t?(Le(i).forEach((e=>{Vr(n,e,i[e].primKey,i[e].indexes)})),Ir(e,n),ln.follow((()=>e.on.populate.fire(o))).catch(s)):function({_novip:e},t,n,r){const i=[],o=e._versions;let s=e._dbSchema=zr(0,e.idbdb,r),a=!1;return o.filter((e=>e._cfg.version>=t)).forEach((o=>{i.push((()=>{const i=s,u=o._cfg.dbschema;Yr(e,i,r),Yr(e,u,r),s=e._dbSchema=u;const l=Wr(i,u);l.add.forEach((e=>{Vr(r,e[0],e[1].primKey,e[1].indexes)})),l.change.forEach((e=>{if(e.recreate)throw new jt.Upgrade("Not yet support for changing primary key");{const t=r.objectStore(e.name);e.add.forEach((e=>Hr(t,e))),e.change.forEach((e=>{t.deleteIndex(e.name),Hr(t,e)})),e.del.forEach((e=>t.deleteIndex(e)))}}));const c=o._cfg.contentUpgrade;if(c&&o._cfg.version>t){Ir(e,r),n._memoizedTables={},a=!0;let t=Ze(u);l.del.forEach((e=>{t[e]=i[e]})),Br(e,[e.Transaction.prototype]),Fr(e,[e.Transaction.prototype],Le(t),t),n.schema=t;const o=dt(c);let s;o&&An();const h=ln.follow((()=>{if(s=c(n),s&&o){var e=Ln.bind(null,null);s.then(e,e)}}));return s&&"function"==typeof s.then?ln.resolve(s):h.then((()=>s))}})),i.push((t=>{a&&Jn||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((n=>null==e[n]&&t.db.deleteObjectStore(n)))}(o._cfg.dbschema,t),Br(e,[e.Transaction.prototype]),Fr(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}))})),function e(){return i.length?ln.resolve(i.shift()(n.idbtrans)).then(e):ln.resolve()}().then((()=>{var e,t;t=r,Le(e=s).forEach((n=>{t.db.objectStoreNames.contains(n)||Vr(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,o,n).catch(s)}))}function Wr(e,t){const n={del:[],add:[],change:[]};let r;for(r in e)t[r]||n.del.push(r);for(r in t){const i=e[r],o=t[r];if(i){const e={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto&&!Gn)e.recreate=!0,n.change.push(e);else{const t=i.idxByName,r=o.idxByName;let s;for(s in t)r[s]||e.del.push(s);for(s in r){const n=t[s],i=r[s];n?n.src!==i.src&&e.change.push(i):e.add.push(i)}(e.del.length>0||e.add.length>0||e.change.length>0)&&n.change.push(e)}}else n.add.push([r,o])}return n}function Vr(e,t,n,r){const i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((e=>Hr(i,e))),i}function Hr(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function zr(e,t,n){const r={};return He(t.objectStoreNames,0).forEach((e=>{const t=n.objectStore(e);let i=t.keyPath;const o=Rr(Dr(i),i||"",!1,!1,!!t.autoIncrement,i&&"string"!=typeof i,!0),s=[];for(let e=0;e<t.indexNames.length;++e){const n=t.index(t.indexNames[e]);i=n.keyPath;var a=Rr(n.name,i,!!n.unique,!!n.multiEntry,!1,i&&"string"!=typeof i,!1);s.push(a)}r[e]=Ar(e,o,s)})),r}function Yr({_novip:e},t,n){const r=n.db.objectStoreNames;for(let i=0;i<r.length;++i){const o=r[i],s=n.objectStore(o);e._hasGetAll="getAll"in s;for(let e=0;e<s.indexNames.length;++e){const n=s.indexNames[e],r=s.index(n).keyPath,i="string"==typeof r?r:"["+He(r).join("+")+"]";if(t[o]){const e=t[o].idxByName[i];e&&(e.name=n,delete t[o].idxByName[i],t[o].idxByName[n]=e)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&Ae.WorkerGlobalScope&&Ae instanceof Ae.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class Gr{_parseStoresSpec(e,t){Le(e).forEach((n=>{if(null!==e[n]){var r=e[n].split(",").map(((e,t)=>{const n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return Rr(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),Ke(r),0===t)})),i=r.shift();if(i.multi)throw new jt.Schema("Primary key cannot be multi-valued");r.forEach((e=>{if(e.auto)throw new jt.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new jt.Schema("Index must have a name and cannot be an empty string")})),t[n]=Ar(n,i,r)}}))}stores(e){const t=this.db;this._cfg.storesSource=this._cfg.storesSource?Te(this._cfg.storesSource,e):e;const n=t._versions,r={};let i={};return n.forEach((e=>{Te(r,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(r,i)})),t._dbSchema=i,Br(t,[t._allTables,t,t.Transaction.prototype]),Fr(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],Le(i),i),t._storeNames=Le(i),this}upgrade(e){return this._cfg.contentUpgrade=Ft(this._cfg.contentUpgrade||At,e),this}}function Jr(e,t){let n=e._dbNamesDB;return n||(n=e._dbNamesDB=new vi("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t}),n.version(1).stores({dbnames:"name"})),n.table("dbnames")}function Qr(e){return e&&"function"==typeof e.databases}function Xr(e){return Dn((function(){return on.letThrough=!0,e()}))}function Zr(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()})).finally((function(){return clearInterval(e)})):Promise.resolve()}function ei(e){var t=t=>e.next(t),n=i(t),r=i((t=>e.throw(t)));function i(e){return t=>{var i=e(t),o=i.value;return i.done?o:o&&"function"==typeof o.then?o.then(n,r):Ke(o)?Promise.all(o).then(n,r):n(o)}}return i(t)()}function ti(e,t,n){var r=arguments.length;if(r<2)throw new jt.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];n=i.pop();var o=tt(i);return[e,o,n]}function ni(e,t,n,r,i){return ln.resolve().then((()=>{const o=on.transless||on,s=e._createTransaction(t,n,e._dbSchema,r),a={trans:s,transless:o};if(r)s.idbtrans=r.idbtrans;else try{s.create(),e._state.PR1398_maxLoop=3}catch(r){return r.name===Et.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>ni(e,t,n,null,i)))):Wn(r)}const u=dt(i);let l;u&&An();const c=ln.follow((()=>{if(l=i.call(s,s),l)if(u){var e=Ln.bind(null,null);l.then(e,e)}else"function"==typeof l.next&&"function"==typeof l.throw&&(l=ei(l))}),a);return(l&&"function"==typeof l.then?ln.resolve(l).then((e=>s.active?e:Wn(new jt.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):c.then((()=>l))).then((e=>(r&&s._resolve(),s._completion.then((()=>e))))).catch((e=>(s._reject(e),Wn(e))))}))}function ri(e,t,n){const r=Ke(e)?e.slice():[e];for(let e=0;e<n;++e)r.push(t);return r}const ii={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){const n=e.table(t),{schema:r}=n,i={},o=[];function s(e,t,n){const r=Mr(e),a=i[r]=i[r]||[],u=null==e?0:"string"==typeof e?1:e.length,l=t>0,c={...n,isVirtual:l,keyTail:t,keyLength:u,extractKey:Kr(e),unique:!l&&n.unique};return a.push(c),c.isPrimaryKey||o.push(c),u>1&&s(2===u?e[0]:e.slice(0,u-1),t+1,n),a.sort(((e,t)=>e.keyTail-t.keyTail)),c}const a=s(r.primaryKey.keyPath,0,r.primaryKey);i[":id"]=[a];for(const e of r.indexes)s(e.keyPath,0,e);function u(t){const n=t.query.index;return n.isVirtual?{...t,query:{index:n,range:(r=t.query.range,i=n.keyTail,{type:1===r.type?2:r.type,lower:ri(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,i),lowerOpen:!0,upper:ri(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,i),upperOpen:!0})}}:t;var r,i}const l={...n,schema:{...r,primaryKey:a,indexes:o,getIndexByKeyPath:function(e){const t=i[Mr(e)];return t&&t[0]}},count:e=>n.count(u(e)),query:e=>n.query(u(e)),openCursor(t){const{keyTail:r,isVirtual:i,keyLength:o}=t.query.index;return i?n.openCursor(u(t)).then((n=>n&&function(n){const i=Object.create(n,{continue:{value:function(i){null!=i?n.continue(ri(i,t.reverse?e.MAX_KEY:e.MIN_KEY,r)):t.unique?n.continue(n.key.slice(0,o).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,r)):n.continue()}},continuePrimaryKey:{value(t,i){n.continuePrimaryKey(ri(t,e.MAX_KEY,r),i)}},primaryKey:{get:()=>n.primaryKey},key:{get(){const e=n.key;return 1===o?e[0]:e.slice(0,o)}},value:{get:()=>n.value}});return i}(n))):n.openCursor(t)}};return l}}}};function oi(e,t,n,r){return n=n||{},r=r||"",Le(e).forEach((i=>{if($e(t,i)){var o=e[i],s=t[i];if("object"==typeof o&&"object"==typeof s&&o&&s){const e=ut(o);e!==ut(s)?n[r+i]=t[i]:"Object"===e?oi(o,s,n,r+i+"."):o!==s&&(n[r+i]=t[i])}else o!==s&&(n[r+i]=t[i])}else n[r+i]=void 0})),Le(t).forEach((i=>{$e(e,i)||(n[r+i]=t[i])})),n}const si={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){const n=e.table(t),{primaryKey:r}=n.schema,i={...n,mutate(e){const i=on.trans,{deleting:o,creating:s,updating:a}=i.table(t).hook;switch(e.type){case"add":if(s.fire===At)break;return i._promise("readwrite",(()=>u(e)),!0);case"put":if(s.fire===At&&a.fire===At)break;return i._promise("readwrite",(()=>u(e)),!0);case"delete":if(o.fire===At)break;return i._promise("readwrite",(()=>u(e)),!0);case"deleteRange":if(o.fire===At)break;return i._promise("readwrite",(()=>function(e){return l(e.trans,e.range,1e4)}(e)),!0)}return n.mutate(e);function u(e){const t=on.trans,i=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(r,e);if(!i)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:i}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),function(e,t,n){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:"immutable"})}(n,e,i).then((u=>{const l=i.map(((n,i)=>{const l=u[i],c={onerror:null,onsuccess:null};if("delete"===e.type)o.fire.call(c,n,l,t);else if("add"===e.type||void 0===l){const o=s.fire.call(c,n,e.values[i],t);null==n&&null!=o&&(n=o,e.keys[i]=n,r.outbound||Xe(e.values[i],r.keyPath,n))}else{const r=oi(l,e.values[i]),o=a.fire.call(c,r,n,l,t);if(o){const t=e.values[i];Object.keys(o).forEach((e=>{$e(t,e)?t[e]=o[e]:Xe(t,e,o[e])}))}}return c}));return n.mutate(e).then((({failures:t,results:n,numFailures:r,lastResult:o})=>{for(let r=0;r<i.length;++r){const o=n?n[r]:i[r],s=l[r];null==o?s.onerror&&s.onerror(t[r]):s.onsuccess&&s.onsuccess("put"===e.type&&u[r]?e.values[r]:o)}return{failures:t,results:n,numFailures:r,lastResult:o}})).catch((e=>(l.forEach((t=>t.onerror&&t.onerror(e))),Promise.reject(e))))}))}function l(e,t,i){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:i}).then((({result:n})=>u({type:"delete",keys:n,trans:e}).then((r=>r.numFailures>0?Promise.reject(r.failures[0]):n.length<i?{failures:[],numFailures:0,lastResult:void 0}:l(e,{...t,lower:n[n.length-1],lowerOpen:!0},i)))))}}};return i}})};function ai(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;const r=[];for(let i=0,o=0;i<t.keys.length&&o<e.length;++i)0===fr(t.keys[i],e[o])&&(r.push(n?ot(t.values[i]):t.values[i]),++o);return r.length===e.length?r:null}catch(e){return null}}const ui={stack:"dbcore",level:-1,create:e=>({table:t=>{const n=e.table(t);return{...n,getMany:e=>{if(!e.cache)return n.getMany(e);const t=ai(e.keys,e.trans._cache,"clone"===e.cache);return t?ln.resolve(t):n.getMany(e).then((t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?ot(t):t},t)))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),n.mutate(e))}}})};function li(e){return!("from"in e)}const ci=function(e,t){if(!this){const t=new ci;return e&&"d"in e&&Te(t,e),t}Te(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function hi(e,t,n){const r=fr(t,n);if(isNaN(r))return;if(r>0)throw RangeError();if(li(e))return Te(e,{from:t,to:n,d:1});const i=e.l,o=e.r;if(fr(n,e.from)<0)return i?hi(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},pi(e);if(fr(t,e.to)>0)return o?hi(o,t,n):e.r={from:t,to:n,d:1,l:null,r:null},pi(e);fr(t,e.from)<0&&(e.from=t,e.l=null,e.d=o?o.d+1:1),fr(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);const s=!e.r;i&&!e.l&&fi(e,i),o&&s&&fi(e,o)}function fi(e,t){li(t)||function e(t,{from:n,to:r,l:i,r:o}){hi(t,n,r),i&&e(t,i),o&&e(t,o)}(e,t)}function di(e){let t=li(e)?null:{s:0,n:e};return{next(e){const n=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&fr(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||fr(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function pi(e){var t,n;const r=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(n=e.l)||void 0===n?void 0:n.d)||0),i=r>1?"r":r<-1?"l":"";if(i){const t="r"===i?"l":"r",n={...e},r=e[i];e.from=r.from,e.to=r.to,e[i]=r[i],n[i]=r[t],e[t]=n,n.d=gi(n)}e.d=gi(e)}function gi({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}Ie(ci.prototype,{add(e){return fi(this,e),this},addKey(e){return hi(this,e,e),this},addKeys(e){return e.forEach((e=>hi(this,e,e))),this},[lt](){return di(this)}});const yi={stack:"dbcore",level:0,create:e=>{const t=e.schema.name,n=new ci(e.MIN_KEY,e.MAX_KEY);return{...e,table:r=>{const i=e.table(r),{schema:o}=i,{primaryKey:s}=o,{extractKey:a,outbound:u}=s,l={...i,mutate:e=>{const s=e.trans,a=s.mutatedParts||(s.mutatedParts={}),u=e=>{const n=`idb://${t}/${r}/${e}`;return a[n]||(a[n]=new ci)},l=u(""),c=u(":dels"),{type:h}=e;let[f,d]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[];const p=e.trans._cache;return i.mutate(e).then((e=>{if(Ke(f)){"delete"!==h&&(f=e.results),l.addKeys(f);const t=ai(f,p);t||"add"===h||c.addKeys(f),(t||d)&&function(e,t,n,r){t.indexes.forEach((function(t){const i=e(t.name||"");function o(e){return null!=e?t.extractKey(e):null}const s=e=>t.multiEntry&&Ke(e)?e.forEach((e=>i.addKey(e))):i.addKey(e);(n||r).forEach(((e,t)=>{const i=n&&o(n[t]),a=r&&o(r[t]);0!==fr(i,a)&&(null!=i&&s(i),null!=a&&s(a))}))}))}(u,o,t,d)}else if(f){const e={from:f.lower,to:f.upper};c.add(e),l.add(e)}else l.add(n),c.add(n),o.indexes.forEach((e=>u(e.name).add(n)));return e}))}},c=({query:{index:t,range:n}})=>{var r,i;return[t,new ci(null!==(r=n.lower)&&void 0!==r?r:e.MIN_KEY,null!==(i=n.upper)&&void 0!==i?i:e.MAX_KEY)]},h={get:e=>[s,new ci(e.key)],getMany:e=>[s,(new ci).addKeys(e.keys)],count:c,query:c,openCursor:c};return Le(h).forEach((e=>{l[e]=function(o){const{subscr:s}=on;if(s){const l=e=>{const n=`idb://${t}/${r}/${e}`;return s[n]||(s[n]=new ci)},c=l(""),f=l(":dels"),[d,p]=h[e](o);if(l(d.name||"").add(p),!d.isPrimaryKey){if("count"!==e){const t="query"===e&&u&&o.values&&i.query({...o,values:!1});return i[e].apply(this,arguments).then((n=>{if("query"===e){if(u&&o.values)return t.then((({result:e})=>(c.addKeys(e),n)));const e=o.values?n.result.map(a):n.result;o.values?c.addKeys(e):f.addKeys(e)}else if("openCursor"===e){const e=n,t=o.values;return e&&Object.create(e,{key:{get:()=>(f.addKey(e.primaryKey),e.key)},primaryKey:{get(){const t=e.primaryKey;return f.addKey(t),t}},value:{get:()=>(t&&c.addKey(e.primaryKey),e.value)}})}return n}))}f.add(n)}}return i[e].apply(this,arguments)}})),l}}}};class vi{constructor(e,t){this._middlewares={},this.verno=0;const n=vi.dependencies;this._options=t={addons:vi.addons,autoOpen:!0,indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:r}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const i={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:At,dbReadyPromise:null,cancelOpen:At,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var o;i.dbReadyPromise=new ln((e=>{i.dbReadyResolve=e})),i.openCanceller=new ln(((e,t)=>{i.cancelOpen=t})),this._state=i,this.name=e,this.on=rr(this,"populate","blocked","versionchange","close",{ready:[Ft,At]}),this.on.ready.subscribe=ze(this.on.ready.subscribe,(e=>(t,n)=>{vi.vip((()=>{const r=this._state;if(r.openComplete)r.dbOpenError||ln.resolve().then(t),n&&e(t);else if(r.onReadyBeingFired)r.onReadyBeingFired.push(t),n&&e(t);else{e(t);const r=this;n||e((function e(){r.on.ready.unsubscribe(t),r.on.ready.unsubscribe(e)}))}}))})),this.Collection=(o=this,ir(gr.prototype,(function(e,t){this.db=o;let n=er,r=null;if(t)try{n=t()}catch(e){r=e}const i=e._ctx,s=i.table,a=s.hook.reading.fire;this._ctx={table:s,index:i.index,isPrimKey:!i.index||s.schema.primKey.keyPath&&i.index===s.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:i.or,valueMapper:a!==Lt?a:null}}))),this.Table=function(e){return ir(nr.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:rr(null,{creating:[Nt,At],reading:[Kt,Lt],updating:[$t,At],deleting:[Mt,At]})}))}(this),this.Transaction=function(e){return ir(jr.prototype,(function(t,n,r,i,o){this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=i,this.idbtrans=null,this.on=rr(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 ln(((e,t)=>{this._resolve=e,this._reject=t})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),Wn(e)}))}))}(this),this.Version=function(e){return ir(Gr.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return ir(Or.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};const i=e._deps.indexedDB;if(!i)throw new jt.MissingAPI;this._cmp=this._ascending=i.cmp.bind(i),this._descending=(e,t)=>i.cmp(t,e),this._max=(e,t)=>i.cmp(e,t)>0?e:t,this._min=(e,t)=>i.cmp(e,t)<0?e:t,this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()})),this.on("blocked",(e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)})),this._maxKey=Lr(t.IDBKeyRange),this._createTransaction=(e,t,n,r)=>new this.Transaction(e,t,n,this._options.chromeTransactionDurability,r),this._fireOnBlocked=e=>{this.on("blocked").fire(e),Yn.filter((e=>e.name===this.name&&e!==this&&!e._state.vcFired)).map((t=>t.on("versionchange").fire(e)))},this.use(ii),this.use(si),this.use(yi),this.use(ui),this.vip=Object.create(this,{_vip:{value:!0}}),r.forEach((e=>e(this)))}version(e){if(isNaN(e)||e<.1)throw new jt.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new jt.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);const t=this._versions;var n=t.filter((t=>t._cfg.version===e))[0];return n||(n=new this.Version(e),t.push(n),t.sort(qr),n.stores({}),this._state.autoSchema=!1,n)}_whenReady(e){return this.idbdb&&(this._state.openComplete||on.letThrough||this._vip)?e():new ln(((e,t)=>{if(this._state.openComplete)return t(new jt.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new jt.DatabaseClosed);this.open().catch(At)}this._state.dbReadyPromise.then(e,t)})).then(e)}use({stack:e,create:t,level:n,name:r}){r&&this.unuse({stack:e,name:r});const i=this._middlewares[e]||(this._middlewares[e]=[]);return i.push({stack:e,create:t,level:null==n?10:n,name:r}),i.sort(((e,t)=>e.level-t.level)),this}unuse({stack:e,name:t,create:n}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((e=>n?e.create!==n:!!t&&e.name!==t))),this}open(){return function(e){const t=e._state,{indexedDB:n}=e._deps;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((()=>t.dbOpenError?Wn(t.dbOpenError):e));pt&&(t.openCanceller._stackHolder=mt()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;const r=t.openCanceller;function i(){if(t.openCanceller!==r)throw new jt.DatabaseClosed("db.open() was cancelled")}let o=t.dbReadyResolve,s=null,a=!1;return ln.race([r,("undefined"==typeof navigator?ln.resolve():Zr()).then((()=>new ln(((r,o)=>{if(i(),!n)throw new jt.MissingAPI;const u=e.name,l=t.autoSchema?n.open(u):n.open(u,Math.round(10*e.verno));if(!l)throw new jt.MissingAPI;l.onerror=Pr(o),l.onblocked=Sn(e._fireOnBlocked),l.onupgradeneeded=Sn((r=>{if(s=l.transaction,t.autoSchema&&!e._options.allowEmptyDB){l.onerror=Er,s.abort(),l.result.close();const e=n.deleteDatabase(u);e.onsuccess=e.onerror=Sn((()=>{o(new jt.NoSuchDatabase(`Database ${u} doesnt exist`))}))}else{s.onerror=Pr(o);var i=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;a=i<1,e._novip.idbdb=l.result,Ur(e,i/10,s,o)}}),o),l.onsuccess=Sn((()=>{s=null;const n=e._novip.idbdb=l.result,i=He(n.objectStoreNames);if(i.length>0)try{const r=n.transaction(1===(o=i).length?o[0]:o,"readonly");t.autoSchema?function({_novip:e},t,n){e.verno=t.version/10;const r=e._dbSchema=zr(0,t,n);e._storeNames=He(t.objectStoreNames,0),Fr(e,[e._allTables],Le(r),r)}(e,n,r):(Yr(e,e._dbSchema,r),function(e,t){const n=Wr(zr(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some((e=>e.add.length||e.change.length)))}(e,r)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Ir(e,r)}catch(e){}var o;Yn.push(e),n.onversionchange=Sn((n=>{t.vcFired=!0,e.on("versionchange").fire(n)})),n.onclose=Sn((t=>{e.on("close").fire(t)})),a&&function({indexedDB:e,IDBKeyRange:t},n){!Qr(e)&&"__dbnames"!==n&&Jr(e,t).put({name:n}).catch(At)}(e._deps,u),r()}),o)}))))]).then((()=>(i(),t.onReadyBeingFired=[],ln.resolve(Xr((()=>e.on.ready.fire(e.vip)))).then((function n(){if(t.onReadyBeingFired.length>0){let r=t.onReadyBeingFired.reduce(Ft,At);return t.onReadyBeingFired=[],ln.resolve(Xr((()=>r(e.vip)))).then(n)}}))))).finally((()=>{t.onReadyBeingFired=null,t.isBeingOpened=!1})).then((()=>e)).catch((n=>{t.dbOpenError=n;try{s&&s.abort()}catch(e){}return r===t.openCanceller&&e._close(),Wn(n)})).finally((()=>{t.openComplete=!0,o()}))}(this)}_close(){const e=this._state,t=Yn.indexOf(this);if(t>=0&&Yn.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new ln((t=>{e.dbReadyResolve=t})),e.openCanceller=new ln(((t,n)=>{e.cancelOpen=n}))}close(){this._close();const e=this._state;this._options.autoOpen=!1,e.dbOpenError=new jt.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){const e=arguments.length>0,t=this._state;return new ln(((n,r)=>{const i=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=Sn((()=>{!function({indexedDB:e,IDBKeyRange:t},n){!Qr(e)&&"__dbnames"!==n&&Jr(e,t).delete(n).catch(At)}(this._deps,this.name),n()})),e.onerror=Pr(r),e.onblocked=this._fireOnBlocked};if(e)throw new jt.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(i):i()}))}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){const e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return Le(this._allTables).map((e=>this._allTables[e]))}transaction(){const e=ti.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,n){let r=on.trans;r&&r.db===this&&-1===e.indexOf("!")||(r=null);const i=-1!==e.indexOf("?");let o,s;e=e.replace("!","").replace("?","");try{if(s=t.map((e=>{var t=e instanceof this.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||"readonly"===e)o="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new jt.InvalidArgument("Invalid transaction mode: "+e);o="readwrite"}if(r){if("readonly"===r.mode&&"readwrite"===o){if(!i)throw new jt.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&s.forEach((e=>{if(r&&-1===r.storeNames.indexOf(e)){if(!i)throw new jt.SubTransaction("Table "+e+" not included in parent transaction.");r=null}})),i&&r&&!r.active&&(r=null)}}catch(e){return r?r._promise(null,((t,n)=>{n(e)})):Wn(e)}const a=ni.bind(null,this,o,s,r,n);return r?r._promise(o,a,"lock"):on.trans?In(on.transless,(()=>this._whenReady(a))):this._whenReady(a)}table(e){if(!$e(this._allTables,e))throw new jt.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}const mi="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class bi{constructor(e){this._subscribe=e}subscribe(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}[mi](){return this}}function wi(e,t){return Le(t).forEach((n=>{fi(e[n]||(e[n]=new ci),t[n])})),e}let _i;try{_i={indexedDB:Ae.indexedDB||Ae.mozIndexedDB||Ae.webkitIndexedDB||Ae.msIndexedDB,IDBKeyRange:Ae.IDBKeyRange||Ae.webkitIDBKeyRange}}catch(Ae){_i={indexedDB:null,IDBKeyRange:null}}const xi=vi;function ki(e){let t=Si;try{Si=!0,Cr.storagemutated.fire(e)}finally{Si=t}}Ie(xi,{...Dt,delete:e=>new xi(e,{addons:[]}).delete(),exists:e=>new xi(e,{addons:[]}).open().then((e=>(e.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(e){try{return function({indexedDB:e,IDBKeyRange:t}){return Qr(e)?Promise.resolve(e.databases()).then((e=>e.map((e=>e.name)).filter((e=>"__dbnames"!==e)))):Jr(e,t).toCollection().primaryKeys()}(xi.dependencies).then(e)}catch(e){return Wn(new jt.MissingAPI)}},defineClass:()=>function(e){Te(this,e)},ignoreTransaction:e=>on.trans?In(on.transless,e):e(),vip:Xr,async:function(e){return function(){try{var t=ei(e.apply(this,arguments));return t&&"function"==typeof t.then?t:ln.resolve(t)}catch(e){return Wn(e)}}},spawn:function(e,t,n){try{var r=ei(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:ln.resolve(r)}catch(e){return Wn(e)}},currentTransaction:{get:()=>on.trans||null},waitFor:function(e,t){const n=ln.resolve("function"==typeof e?xi.ignoreTransaction(e):e).timeout(t||6e4);return on.trans?on.trans.waitFor(n):n},Promise:ln,debug:{get:()=>pt,set:e=>{gt(e,"dexie"===e?()=>!0:Xn)}},derive:qe,extend:Te,props:Ie,override:ze,Events:rr,on:Cr,liveQuery:function(e){return new bi((t=>{const n=dt(e);let r=!1,i={},o={};const s={get closed(){return r},unsubscribe:()=>{r=!0,Cr.storagemutated.unsubscribe(c)}};t.start&&t.start(s);let a=!1,u=!1;function l(){return Le(o).some((e=>i[e]&&function(e,t){const n=di(t);let r=n.next();if(r.done)return!1;let i=r.value;const o=di(e);let s=o.next(i.from),a=s.value;for(;!r.done&&!s.done;){if(fr(a.from,i.to)<=0&&fr(a.to,i.from)>=0)return!0;fr(i.from,a.from)<0?i=(r=n.next(a.from)).value:a=(s=o.next(i.from)).value}return!1}(i[e],o[e])))}const c=e=>{wi(i,e),l()&&h()},h=()=>{if(a||r)return;i={};const f={},d=function(t){n&&An();const r=()=>Dn(e,{subscr:t,trans:null}),i=on.trans?In(on.transless,r):r();return n&&i.then(Ln,Ln),i}(f);u||(Cr("storagemutated",c),u=!0),a=!0,Promise.resolve(d).then((e=>{a=!1,r||(l()?h():(i={},o=f,t.next&&t.next(e)))}),(e=>{a=!1,t.error&&t.error(e),s.unsubscribe()}))};return h(),s}))},extendObservabilitySet:wi,getByKeyPath:Qe,setByKeyPath:Xe,delByKeyPath:function(e,t){"string"==typeof t?Xe(e,t,void 0):"length"in t&&[].map.call(t,(function(t){Xe(e,t,void 0)}))},shallowClone:Ze,deepClone:ot,getObjectDiff:oi,cmp:fr,asap:Ge,minKey:-1/0,addons:[],connections:Yn,errnames:Et,dependencies:_i,semVer:"3.2.2",version:"3.2.2".split(".").map((e=>parseInt(e))).reduce(((e,t,n)=>e+t/Math.pow(10,2*n)))}),xi.maxKey=Lr(xi.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(Cr("storagemutated",(e=>{if(!Si){let t;Gn?(t=document.createEvent("CustomEvent"),t.initCustomEvent("x-storagemutated-1",!0,!0,e)):t=new CustomEvent("x-storagemutated-1",{detail:e}),Si=!0,dispatchEvent(t),Si=!1}})),addEventListener("x-storagemutated-1",(({detail:e})=>{Si||ki(e)})));let Si=!1;if("undefined"!=typeof BroadcastChannel){const e=new BroadcastChannel("x-storagemutated-1");Cr("storagemutated",(t=>{Si||e.postMessage(t)})),e.onmessage=e=>{e.data&&ki(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){Cr("storagemutated",(e=>{try{Si||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((t=>t.postMessage({type:"x-storagemutated-1",changedParts:e}))))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(e=>{if("x-storagemutated-1"===e.key){const t=JSON.parse(e.newValue);t&&ki(t.changedParts)}}));const e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",(function({data:e}){e&&"x-storagemutated-1"===e.type&&ki(e.changedParts)}))}ln.rejectionMapper=function(e,t){if(!e||e instanceof kt||e instanceof TypeError||e instanceof SyntaxError||!e.name||!Rt[e.name])return e;var n=new Rt[e.name](t||e.message,e);return"stack"in e&&Be(n,"stack",{get:function(){return this.inner.stack}}),n},gt(pt,Xn);class Oi extends vi{constructor(){super("ServiceWorker"),this.version(1).stores({dynamicRouteRegistrations:"++,&pattern"}),this.dynamicRouteRegistrations=this.table("dynamicRouteRegistrations")}}var Pi=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));function Ei(e){return Pi(this,null,(function*(){const t=yield function(e){return Ce(this,arguments,(function*({imports:e={}}){const t=Object.values(e),n=yield Promise.all(t.map((e=>Ce(this,null,(function*(){const t=je(e),n=yield Re(t);return n?De(e,n):[]})))));return Ee(n)}))}(e);yield function(e){return Pi(this,null,(function*(){const t=yield caches.open(de),n=(yield t.keys()).map((e=>e.url)),r=yield(new Oi).dynamicRouteRegistrations.toArray(),i=n.filter((t=>!ye.includes(t)&&!e.includes(t)&&!r.some((e=>new RegExp(e.pattern).test(t)))));console.info("[SW] Removing the following expired URLs from the cache: ",i),console.debug("[SW] The following URLs were known and not invalidated: ",ye,e,r),yield Promise.all(i.map((e=>t.delete(e))))}))}(t),yield Ci(t)}))}function Ci(e){return Pi(this,null,(function*(){if(0===e.length)return;const t=yield caches.open(de),n=yield Promise.all(e.map((e=>Pi(this,null,(function*(){try{return yield function(e){return E(this,arguments,(function*(e,t={}){let{shouldRetry:n,getDelay:r,onError:i}=t;n=null!=n?n:e=>C(e,5),r=null!=r?r:e=>j(e,1e3);let o,s=0;do{try{return yield R(r(s)),yield e()}catch(e){null==i||i(e,s),o=e}}while(n(s++));throw o}))}((()=>t.add(e)),{onError:(t,n)=>console.debug(`[SW] Failure attempt ${n} at caching "${e}". Error: `,t)}),{url:e,success:!0}}catch(t){return{url:e,success:!1}}}))))),r=n.filter((e=>e.success)),i=n.filter((e=>!e.success));r.length>0&&console.debug(`[SW] Successfully added ${r.length} URLs to the OMRS cache. URLs: `,r.map((e=>e.url))),i.length>0&&console.error(`[SW] Failed to cache ${i.length} URLs. URLs: `,i.map((e=>e.url)))}))}var ji=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));const Ri={onImportMapChanged:function(e){return ji(this,arguments,(function*({importMap:e}){yield Ei(e)}))},clearDynamicRoutes:function(){return ji(this,null,(function*(){yield(new Oi).dynamicRouteRegistrations.clear()}))},registerDynamicRoute:function(e){return ji(this,arguments,(function*({pattern:e,url:t,strategy:n}){let r=e;if(!r&&t&&(r=`^${P(t)}$`),r){const e={pattern:r,strategy:n};yield(new Oi).dynamicRouteRegistrations.put(e)}}))}};n(955);const Di=["DELETE","GET","HEAD","PATCH","POST","PUT"],Ai=e=>e&&"object"==typeof e?e:{handle:e};class Li{constructor(e,t,n="GET"){this.handler=Ai(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=Ai(e)}}class Ki extends Li{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 Ti{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:i,route:o}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n});let s=o&&o.handler;const a=e.method;if(!s&&this._defaultHandlerMap.has(a)&&(s=this._defaultHandlerMap.get(a)),!s)return;let u;try{u=s.handle({url:n,request:e,event:t,params:i})}catch(e){u=Promise.reject(e)}const l=o&&o.catchHandler;return u instanceof Promise&&(this._catchHandler||l)&&(u=u.catch((r=>{return o=this,null,s=function*(){if(l)try{return yield l.handle({url:n,request:e,event:t,params:i})}catch(e){e instanceof Error&&(r=e)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw r},new Promise(((e,t)=>{var n=e=>{try{i(s.next(e))}catch(e){t(e)}},r=e=>{try{i(s.throw(e))}catch(e){t(e)}},i=t=>t.done?e(t.value):Promise.resolve(t.value).then(n,r);i((s=s.apply(o,null)).next())}));var o,s}))),u}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){const i=this._routes.get(n.method)||[];for(const o of i){let i;const s=o.match({url:e,sameOrigin:t,request:n,event:r});if(s)return i=s,(Array.isArray(i)&&0===i.length||s.constructor===Object&&0===Object.keys(s).length||"boolean"==typeof s)&&(i=void 0),{route:o,params:i}}return{}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,Ai(e))}setCatchHandler(e){this._catchHandler=Ai(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 Ni;const Mi=()=>(Ni||(Ni=new Ti,Ni.addFetchListener(),Ni.addCacheListener()),Ni);n(415);var $i=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));function Ii(e){return"string"==typeof e?new Request(e):e}class Fi{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new s,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)}fetch(t){return $i(this,null,(function*(){const{event:n}=this;let r=Ii(t);if("navigate"===r.mode&&n instanceof FetchEvent&&n.preloadResponse){const e=yield n.preloadResponse;if(e)return e}const i=this.hasCallback("fetchDidFail")?r.clone():null;try{for(const e of this.iterateCallbacks("requestWillFetch"))r=yield e({request:r.clone(),event:n})}catch(t){if(t instanceof Error)throw new e("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const o=r.clone();try{let e;e=yield fetch(r,"navigate"===r.mode?void 0:this._strategy.fetchOptions);for(const t of this.iterateCallbacks("fetchDidSucceed"))e=yield t({event:n,request:o,response:e});return e}catch(e){throw i&&(yield this.runCallbacks("fetchDidFail",{error:e,event:n,originalRequest:i.clone(),request:o.clone()})),e}}))}fetchAndCachePut(e){return $i(this,null,(function*(){const t=yield this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}))}cacheMatch(e){return $i(this,null,(function*(){const t=Ii(e);let n;const{cacheName:r,matchOptions:i}=this._strategy,o=yield this.getCacheKey(t,"read"),s=Object.assign(Object.assign({},i),{cacheName:r});n=yield caches.match(o,s);for(const e of this.iterateCallbacks("cachedResponseWillBeUsed"))n=(yield e({cacheName:r,matchOptions:i,cachedResponse:n,request:o,event:this.event}))||void 0;return n}))}cachePut(n,r){return $i(this,null,(function*(){const i=Ii(n);yield a(0);const s=yield this.getCacheKey(i,"write");if(!r)throw new e("cache-put-with-no-response",{url:(u=s.url,new URL(String(u),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var u;const l=yield this._ensureResponseSafeToCache(r);if(!l)return!1;const{cacheName:c,matchOptions:h}=this._strategy,f=yield self.caches.open(c),d=this.hasCallback("cacheDidUpdate"),p=d?yield function(e,t,n,r){return i=this,s=function*(){const i=o(t.url,n);if(t.url===i)return e.match(t,r);const s=Object.assign(Object.assign({},r),{ignoreSearch:!0}),a=yield e.keys(t,s);for(const t of a)if(i===o(t.url,n))return e.match(t,r)},new Promise(((e,t)=>{var n=e=>{try{o(s.next(e))}catch(e){t(e)}},r=e=>{try{o(s.throw(e))}catch(e){t(e)}},o=t=>t.done?e(t.value):Promise.resolve(t.value).then(n,r);o((s=s.apply(i,null)).next())}));var i,s}(f,s.clone(),["__WB_REVISION__"],h):null;try{yield f.put(s,d?l.clone():l)}catch(e){if(e instanceof Error)throw"QuotaExceededError"===e.name&&(yield function(){return e=this,n=function*(){for(const e of t)yield e()},new Promise(((t,r)=>{var i=e=>{try{s(n.next(e))}catch(e){r(e)}},o=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=e=>e.done?t(e.value):Promise.resolve(e.value).then(i,o);s((n=n.apply(e,null)).next())}));var e,n}()),e}for(const e of this.iterateCallbacks("cacheDidUpdate"))yield e({cacheName:c,oldResponse:p,newResponse:l.clone(),request:s,event:this.event});return!0}))}getCacheKey(e,t){return $i(this,null,(function*(){const n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let r=e;for(const e of this.iterateCallbacks("cacheKeyWillBeUsed"))r=Ii(yield e({mode:t,request:r,event:this.event,params:this.params}));this._cacheKeys[n]=r}return this._cacheKeys[n]}))}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}runCallbacks(e,t){return $i(this,null,(function*(){for(const n of this.iterateCallbacks(e))yield 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 i=Object.assign(Object.assign({},r),{state:n});return t[e](i)};yield r}}waitUntil(e){return this._extendLifetimePromises.push(e),e}doneWaiting(){return $i(this,null,(function*(){let e;for(;e=this._extendLifetimePromises.shift();)yield e}))}destroy(){this._handlerDeferred.resolve(null)}_ensureResponseSafeToCache(e){return $i(this,null,(function*(){let t=e,n=!1;for(const e of this.iterateCallbacks("cacheWillUpdate"))if(t=(yield 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}))}}var Bi=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));class qi{constructor(e={}){this.cacheName=i(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,i=new Fi(this,{event:t,request:n,params:r}),o=this._getResponse(i,n,t);return[o,this._awaitComplete(o,i,n,t)]}_getResponse(t,n,r){return Bi(this,null,(function*(){let i;yield t.runCallbacks("handlerWillStart",{event:r,request:n});try{if(i=yield this._handle(n,t),!i||"error"===i.type)throw new e("no-response",{url:n.url})}catch(e){if(e instanceof Error)for(const o of t.iterateCallbacks("handlerDidError"))if(i=yield o({error:e,event:r,request:n}),i)break;if(!i)throw e}for(const e of t.iterateCallbacks("handlerWillRespond"))i=yield e({event:r,request:n,response:i});return i}))}_awaitComplete(e,t,n,r){return Bi(this,null,(function*(){let i,o;try{i=yield e}catch(e){}try{yield t.runCallbacks("handlerDidRespond",{event:r,request:n,response:i}),yield t.doneWaiting()}catch(e){e instanceof Error&&(o=e)}if(yield t.runCallbacks("handlerDidComplete",{event:r,request:n,response:i,error:o}),t.destroy(),o)throw o}))}}const Ui={cacheWillUpdate:e=>{return void 0,t=[e],n=function*({response:e}){return 200===e.status||0===e.status?e:null},new Promise(((e,r)=>{var i=e=>{try{s(n.next(e))}catch(e){r(e)}},o=e=>{try{s(n.throw(e))}catch(e){r(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(i,o);s((n=n.apply(undefined,t)).next())}));var t,n}};var Wi=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));function Vi(e){var t;const n=+(null!=(t=Hi(e,"x-omrs-offline-response-status"))?t:"");return isNaN(n)||n<200||n>599?503:n}function Hi(e,t){return e.get(t)}var zi=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));const Yi=new class extends qi{constructor(e={}){super(e),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}_handle(t,n){return r=this,null,i=function*(){let r,i;try{const e=[n.fetch(t)];if(this._networkTimeoutSeconds){const t=a(1e3*this._networkTimeoutSeconds);e.push(t)}if(i=yield Promise.race(e),!i)throw new Error(`Timed out the network response after ${this._networkTimeoutSeconds} seconds.`)}catch(e){e instanceof Error&&(r=e)}if(!i)throw new e("no-response",{url:t.url,error:r});return i},new Promise(((e,t)=>{var n=e=>{try{s(i.next(e))}catch(e){t(e)}},o=e=>{try{s(i.throw(e))}catch(e){t(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(n,o);s((i=i.apply(r,null)).next())}));var r,i}},Gi=new class extends qi{_handle(t,n){return r=this,null,i=function*(){const r=yield n.cacheMatch(t);if(!r)throw new e("no-response",{url:t.url});return r},new Promise(((e,t)=>{var n=e=>{try{s(i.next(e))}catch(e){t(e)}},o=e=>{try{s(i.throw(e))}catch(e){t(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(n,o);s((i=i.apply(r,null)).next())}));var r,i}}({cacheName:de}),Ji=new class extends qi{constructor(e={}){super(e),this.plugins.some((e=>"cacheWillUpdate"in e))||this.plugins.unshift(Ui),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}_handle(t,n){return Wi(this,null,(function*(){const r=[],i=[];let o;if(this._networkTimeoutSeconds){const{id:e,promise:s}=this._getTimeoutPromise({request:t,logs:r,handler:n});o=e,i.push(s)}const s=this._getNetworkPromise({timeoutId:o,request:t,logs:r,handler:n});i.push(s);const a=yield n.waitUntil((()=>Wi(this,null,(function*(){return(yield n.waitUntil(Promise.race(i)))||(yield s)})))());if(!a)throw new e("no-response",{url:t.url});return a}))}_getTimeoutPromise({request:e,logs:t,handler:n}){let r;return{promise:new Promise((t=>{r=setTimeout((()=>Wi(this,null,(function*(){t(yield n.cacheMatch(e))}))),1e3*this._networkTimeoutSeconds)})),id:r}}_getNetworkPromise(e){return Wi(this,arguments,(function*({timeoutId:e,request:t,logs:n,handler:r}){let i,o;try{o=yield r.fetchAndCachePut(t)}catch(e){e instanceof Error&&(i=e)}return e&&clearTimeout(e),!i&&o||(o=yield r.cacheMatch(t)),o}))}}({cacheName:de}),Qi="network-only-or-cache-only",Xi={"network-first":e=>Ji.handle(e),"network-only-or-cache-only":e=>zi(void 0,null,(function*(){try{return yield Yi.handle(e)}catch(t){return yield Gi.handle(e)}}))};function Zi(e){return zi(this,null,(function*(){try{return yield Yi.handle(e)}catch(e){const t=yield caches.open(de),n=yield t.match(ge);return null!=n?n:Response.error()}}))}function eo(e){return zi(this,null,(function*(){var t;const{request:n}=e,r="GET"===e.request.method?yield function(e){return zi(this,arguments,(function*({request:e}){var t;return null!=(t=to(e.headers))?t:yield no(e.url)}))}(e):Qi,i=null!=(t=Xi[r])?t:Xi[Qi];try{return yield i(e)}catch(e){return console.warn("[SW] Could not handle the request to %s (using handler %s).",n.url,r,e),new Response(function(e){var t;return null!=(t=Hi(e,"x-omrs-offline-response-body"))?t:void 0}(n.headers),{status:Vi(n.headers)})}}))}function to(e){return Hi(e,"x-omrs-offline-caching-strategy")}function no(e){return zi(this,null,(function*(){var t;const n=new Oi,r=yield n.dynamicRouteRegistrations.toArray(),i=fe(r.filter((t=>new RegExp(t.pattern).test(e))).map((e=>{var t;return null!=(t=e.strategy)?t:"network-first"})));return i.length<=1?i[0]:null!=(t=["network-first","network-only-or-cache-only"].find((e=>i.some((t=>t===e)))))?t:Qi}))}var ro;self.__WB_DISABLE_DEV_LOGS=!0,ro={prefix:"omrs"},(e=>{for(const t of Object.keys(r))e(t)})((e=>{"string"==typeof ro[e]&&(r[e]=ro[e])})),function(){!function(e,t,n){let r;r=e instanceof RegExp?new Ki(e,t,n):new Li(e,t,n),Mi().registerRoute(r)}((({request:e})=>"navigate"===e.mode),Zi);const e=Mi();for(const t of Di)e.setDefaultHandler(eo,t)}(),self.addEventListener("message",(function(e){return ji(this,null,(function*(){var t,n,r,i,o,s;const a=Ri[null!=(r=null==(n=null==(t=e.data)?void 0:t.type)?void 0:n.toString())?r:""];if(a)try{l({success:!0,result:yield a(e.data)})}catch(e){u(null!=(s=null!=(o=null==e?void 0:e.message)?o:null==e?void 0:e.toString())?s:"Unknown error.")}else u(`Received an unknown message of type "${null==(i=e.data)?void 0:i.type} which cannot be handled.`);function u(e){console.warn("[SW] Handling a message resulted in an error.",e),l({success:!1,error:e})}function l(t){e.ports[0].postMessage(null!=t?t:{})}}))})),self.addEventListener("install",(e=>{self.skipWaiting(),e.waitUntil(Ci(ye))})),self.addEventListener("activate",(e=>{e.waitUntil(self.clients.claim())}))})()})();
|