-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
3 lines (3 loc) · 61.2 KB
/
index.js
1
2
3
// Store Fetch v1.2.2 by Adrian Stainforth <adrian.stainforth@gmail.com>
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@djforth/utilities"),require("date-fns/parseISO"),require("date-fns/parseJSON"),require("date-fns/subSeconds"),require("date-fns/subMonths"),require("date-fns/subMinutes"),require("date-fns/subHours"),require("date-fns/subDays"),require("date-fns/isWithinInterval"),require("idb")):"function"==typeof define&&define.amd?define(["@djforth/utilities","date-fns/parseISO","date-fns/parseJSON","date-fns/subSeconds","date-fns/subMonths","date-fns/subMinutes","date-fns/subHours","date-fns/subDays","date-fns/isWithinInterval","idb"],e):(t=t||self).StoreFetch=e(t.utilities,t.parseISO,t.parseJSON,t.subSeconds,t.subMonths,t.subMinutes,t.subHours,t.subDays,t.isWithinInterval,t.idb)}(this,(function(t,e,r,n,o,i,a,u,c,s){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r,n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n,o=o&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o,i=i&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i,a=a&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a,u=u&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u,c=c&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c;var f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function l(t,e){return t(e={exports:{}},e.exports),e.exports}var p=function(t){return t&&t.Math==Math&&t},d=p("object"==typeof globalThis&&globalThis)||p("object"==typeof window&&window)||p("object"==typeof self&&self)||p("object"==typeof f&&f)||Function("return this")(),v=function(t){try{return!!t()}catch(t){return!0}},h=!v((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),y={}.propertyIsEnumerable,g=Object.getOwnPropertyDescriptor,b={f:g&&!y.call({1:2},1)?function(t){var e=g(this,t);return!!e&&e.enumerable}:y},m=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},w={}.toString,x=function(t){return w.call(t).slice(8,-1)},O="".split,S=v((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==x(t)?O.call(t,""):Object(t)}:Object,k=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},j=function(t){return S(k(t))},E=function(t){return"object"==typeof t?null!==t:"function"==typeof t},P=function(t,e){if(!E(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!E(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!E(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!E(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},A={}.hasOwnProperty,T=function(t,e){return A.call(t,e)},L=d.document,I=E(L)&&E(L.createElement),D=function(t){return I?L.createElement(t):{}},R=!h&&!v((function(){return 7!=Object.defineProperty(D("div"),"a",{get:function(){return 7}}).a})),M=Object.getOwnPropertyDescriptor,_={f:h?M:function(t,e){if(t=j(t),e=P(e,!0),R)try{return M(t,e)}catch(t){}if(T(t,e))return m(!b.f.call(t,e),t[e])}},N=function(t){if(!E(t))throw TypeError(String(t)+" is not an object");return t},C=Object.defineProperty,F={f:h?C:function(t,e,r){if(N(t),e=P(e,!0),N(r),R)try{return C(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},z=h?function(t,e,r){return F.f(t,e,m(1,r))}:function(t,e,r){return t[e]=r,t},G=function(t,e){try{z(d,t,e)}catch(r){d[t]=e}return e},U=d["__core-js_shared__"]||G("__core-js_shared__",{}),q=Function.toString;"function"!=typeof U.inspectSource&&(U.inspectSource=function(t){return q.call(t)});var J,W,K,B=U.inspectSource,H=d.WeakMap,V="function"==typeof H&&/native code/.test(B(H)),Y=l((function(t){(t.exports=function(t,e){return U[t]||(U[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.4",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),$=0,Q=Math.random(),X=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++$+Q).toString(36)},Z=Y("keys"),tt=function(t){return Z[t]||(Z[t]=X(t))},et={},rt=d.WeakMap;if(V){var nt=new rt,ot=nt.get,it=nt.has,at=nt.set;J=function(t,e){return at.call(nt,t,e),e},W=function(t){return ot.call(nt,t)||{}},K=function(t){return it.call(nt,t)}}else{var ut=tt("state");et[ut]=!0,J=function(t,e){return z(t,ut,e),e},W=function(t){return T(t,ut)?t[ut]:{}},K=function(t){return T(t,ut)}}var ct,st,ft={set:J,get:W,has:K,enforce:function(t){return K(t)?W(t):J(t,{})},getterFor:function(t){return function(e){var r;if(!E(e)||(r=W(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},lt=l((function(t){var e=ft.get,r=ft.enforce,n=String(String).split("String");(t.exports=function(t,e,o,i){var a=!!i&&!!i.unsafe,u=!!i&&!!i.enumerable,c=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof e||T(o,"name")||z(o,"name",e),r(o).source=n.join("string"==typeof e?e:"")),t!==d?(a?!c&&t[e]&&(u=!0):delete t[e],u?t[e]=o:z(t,e,o)):u?t[e]=o:G(e,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||B(this)}))})),pt=d,dt=function(t){return"function"==typeof t?t:void 0},vt=function(t,e){return arguments.length<2?dt(pt[t])||dt(d[t]):pt[t]&&pt[t][e]||d[t]&&d[t][e]},ht=Math.ceil,yt=Math.floor,gt=function(t){return isNaN(t=+t)?0:(t>0?yt:ht)(t)},bt=Math.min,mt=function(t){return t>0?bt(gt(t),9007199254740991):0},wt=Math.max,xt=Math.min,Ot=function(t,e){var r=gt(t);return r<0?wt(r+e,0):xt(r,e)},St=function(t){return function(e,r,n){var o,i=j(e),a=mt(i.length),u=Ot(n,a);if(t&&r!=r){for(;a>u;)if((o=i[u++])!=o)return!0}else for(;a>u;u++)if((t||u in i)&&i[u]===r)return t||u||0;return!t&&-1}},kt={includes:St(!0),indexOf:St(!1)},jt=kt.indexOf,Et=function(t,e){var r,n=j(t),o=0,i=[];for(r in n)!T(et,r)&&T(n,r)&&i.push(r);for(;e.length>o;)T(n,r=e[o++])&&(~jt(i,r)||i.push(r));return i},Pt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],At=Pt.concat("length","prototype"),Tt={f:Object.getOwnPropertyNames||function(t){return Et(t,At)}},Lt={f:Object.getOwnPropertySymbols},It=vt("Reflect","ownKeys")||function(t){var e=Tt.f(N(t)),r=Lt.f;return r?e.concat(r(t)):e},Dt=function(t,e){for(var r=It(e),n=F.f,o=_.f,i=0;i<r.length;i++){var a=r[i];T(t,a)||n(t,a,o(e,a))}},Rt=/#|\.prototype\./,Mt=function(t,e){var r=Nt[_t(t)];return r==Ft||r!=Ct&&("function"==typeof e?v(e):!!e)},_t=Mt.normalize=function(t){return String(t).replace(Rt,".").toLowerCase()},Nt=Mt.data={},Ct=Mt.NATIVE="N",Ft=Mt.POLYFILL="P",zt=Mt,Gt=_.f,Ut=function(t,e){var r,n,o,i,a,u=t.target,c=t.global,s=t.stat;if(r=c?d:s?d[u]||G(u,{}):(d[u]||{}).prototype)for(n in e){if(i=e[n],o=t.noTargetGet?(a=Gt(r,n))&&a.value:r[n],!zt(c?n:u+(s?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Dt(i,o)}(t.sham||o&&o.sham)&&z(i,"sham",!0),lt(r,n,i,t)}},qt=Array.isArray||function(t){return"Array"==x(t)},Jt=function(t){return Object(k(t))},Wt=function(t,e,r){var n=P(e);n in t?F.f(t,n,m(0,r)):t[n]=r},Kt=!!Object.getOwnPropertySymbols&&!v((function(){return!String(Symbol())})),Bt=Kt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ht=Y("wks"),Vt=d.Symbol,Yt=Bt?Vt:Vt&&Vt.withoutSetter||X,$t=function(t){return T(Ht,t)||(Kt&&T(Vt,t)?Ht[t]=Vt[t]:Ht[t]=Yt("Symbol."+t)),Ht[t]},Qt=$t("species"),Xt=function(t,e){var r;return qt(t)&&("function"!=typeof(r=t.constructor)||r!==Array&&!qt(r.prototype)?E(r)&&null===(r=r[Qt])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===e?0:e)},Zt=vt("navigator","userAgent")||"",te=d.process,ee=te&&te.versions,re=ee&&ee.v8;re?st=(ct=re.split("."))[0]+ct[1]:Zt&&(!(ct=Zt.match(/Edge\/(\d+)/))||ct[1]>=74)&&(ct=Zt.match(/Chrome\/(\d+)/))&&(st=ct[1]);var ne=st&&+st,oe=$t("species"),ie=function(t){return ne>=51||!v((function(){var e=[];return(e.constructor={})[oe]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},ae=$t("isConcatSpreadable"),ue=ne>=51||!v((function(){var t=[];return t[ae]=!1,t.concat()[0]!==t})),ce=ie("concat"),se=function(t){if(!E(t))return!1;var e=t[ae];return void 0!==e?!!e:qt(t)};Ut({target:"Array",proto:!0,forced:!ue||!ce},{concat:function(t){var e,r,n,o,i,a=Jt(this),u=Xt(a,0),c=0;for(e=-1,n=arguments.length;e<n;e++)if(i=-1===e?a:arguments[e],se(i)){if(c+(o=mt(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(r=0;r<o;r++,c++)r in i&&Wt(u,c,i[r])}else{if(c>=9007199254740991)throw TypeError("Maximum allowed index exceeded");Wt(u,c++,i)}return u.length=c,u}});var fe,le=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},pe=function(t,e,r){if(le(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}},de=[].push,ve=function(t){var e=1==t,r=2==t,n=3==t,o=4==t,i=6==t,a=5==t||i;return function(u,c,s,f){for(var l,p,d=Jt(u),v=S(d),h=pe(c,s,3),y=mt(v.length),g=0,b=f||Xt,m=e?b(u,y):r?b(u,0):void 0;y>g;g++)if((a||g in v)&&(p=h(l=v[g],g,d),t))if(e)m[g]=p;else if(p)switch(t){case 3:return!0;case 5:return l;case 6:return g;case 2:de.call(m,l)}else if(o)return!1;return i?-1:n||o?o:m}},he={forEach:ve(0),map:ve(1),filter:ve(2),some:ve(3),every:ve(4),find:ve(5),findIndex:ve(6)},ye=Object.keys||function(t){return Et(t,Pt)},ge=h?Object.defineProperties:function(t,e){N(t);for(var r,n=ye(e),o=n.length,i=0;o>i;)F.f(t,r=n[i++],e[r]);return t},be=vt("document","documentElement"),me=tt("IE_PROTO"),we=function(){},xe=function(t){return"<script>"+t+"<\/script>"},Oe=function(){try{fe=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;Oe=fe?function(t){t.write(xe("")),t.close();var e=t.parentWindow.Object;return t=null,e}(fe):((e=D("iframe")).style.display="none",be.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(xe("document.F=Object")),t.close(),t.F);for(var r=Pt.length;r--;)delete Oe.prototype[Pt[r]];return Oe()};et[me]=!0;var Se=Object.create||function(t,e){var r;return null!==t?(we.prototype=N(t),r=new we,we.prototype=null,r[me]=t):r=Oe(),void 0===e?r:ge(r,e)},ke=$t("unscopables"),je=Array.prototype;null==je[ke]&&F.f(je,ke,{configurable:!0,value:Se(null)});var Ee=function(t){je[ke][t]=!0},Pe=Object.defineProperty,Ae={},Te=function(t){throw t},Le=function(t,e){if(T(Ae,t))return Ae[t];e||(e={});var r=[][t],n=!!T(e,"ACCESSORS")&&e.ACCESSORS,o=T(e,0)?e[0]:Te,i=T(e,1)?e[1]:void 0;return Ae[t]=!!r&&!v((function(){if(n&&!h)return!0;var t={length:-1};n?Pe(t,1,{enumerable:!0,get:Te}):t[1]=1,r.call(t,o,i)}))},Ie=he.find,De=!0,Re=Le("find");"find"in[]&&Array(1).find((function(){De=!1})),Ut({target:"Array",proto:!0,forced:De||!Re},{find:function(t){return Ie(this,t,arguments.length>1?arguments[1]:void 0)}}),Ee("find");var Me,_e,Ne,Ce={},Fe=!v((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),ze=tt("IE_PROTO"),Ge=Object.prototype,Ue=Fe?Object.getPrototypeOf:function(t){return t=Jt(t),T(t,ze)?t[ze]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Ge:null},qe=$t("iterator"),Je=!1;[].keys&&("next"in(Ne=[].keys())?(_e=Ue(Ue(Ne)))!==Object.prototype&&(Me=_e):Je=!0),null==Me&&(Me={}),T(Me,qe)||z(Me,qe,(function(){return this}));var We={IteratorPrototype:Me,BUGGY_SAFARI_ITERATORS:Je},Ke=F.f,Be=$t("toStringTag"),He=function(t,e,r){t&&!T(t=r?t:t.prototype,Be)&&Ke(t,Be,{configurable:!0,value:e})},Ve=We.IteratorPrototype,Ye=function(){return this},$e=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return N(r),function(t){if(!E(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(n),e?t.call(r,n):r.__proto__=n,r}}():void 0),Qe=We.IteratorPrototype,Xe=We.BUGGY_SAFARI_ITERATORS,Ze=$t("iterator"),tr=function(){return this},er=function(t,e,r,n,o,i,a){!function(t,e,r){var n=e+" Iterator";t.prototype=Se(Ve,{next:m(1,r)}),He(t,n,!1),Ce[n]=Ye}(r,e,n);var u,c,s,f=function(t){if(t===o&&h)return h;if(!Xe&&t in d)return d[t];switch(t){case"keys":case"values":case"entries":return function(){return new r(this,t)}}return function(){return new r(this)}},l=e+" Iterator",p=!1,d=t.prototype,v=d[Ze]||d["@@iterator"]||o&&d[o],h=!Xe&&v||f(o),y="Array"==e&&d.entries||v;if(y&&(u=Ue(y.call(new t)),Qe!==Object.prototype&&u.next&&(Ue(u)!==Qe&&($e?$e(u,Qe):"function"!=typeof u[Ze]&&z(u,Ze,tr)),He(u,l,!0))),"values"==o&&v&&"values"!==v.name&&(p=!0,h=function(){return v.call(this)}),d[Ze]!==h&&z(d,Ze,h),Ce[e]=h,o)if(c={values:f("values"),keys:i?h:f("keys"),entries:f("entries")},a)for(s in c)!Xe&&!p&&s in d||lt(d,s,c[s]);else Ut({target:e,proto:!0,forced:Xe||p},c);return c},rr=ft.set,nr=ft.getterFor("Array Iterator"),or=er(Array,"Array",(function(t,e){rr(this,{type:"Array Iterator",target:j(t),index:0,kind:e})}),(function(){var t=nr(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values");Ce.Arguments=Ce.Array,Ee("keys"),Ee("values"),Ee("entries");var ir=he.map,ar=ie("map"),ur=Le("map");Ut({target:"Array",proto:!0,forced:!ar||!ur},{map:function(t){return ir(this,t,arguments.length>1?arguments[1]:void 0)}});var cr=function(t){return function(e,r,n,o){le(r);var i=Jt(e),a=S(i),u=mt(i.length),c=t?u-1:0,s=t?-1:1;if(n<2)for(;;){if(c in a){o=a[c],c+=s;break}if(c+=s,t?c<0:u<=c)throw TypeError("Reduce of empty array with no initial value")}for(;t?c>=0:u>c;c+=s)c in a&&(o=r(o,a[c],c,i));return o}},sr=function(t,e){var r=[][t];return!!r&&v((function(){r.call(null,e||function(){throw 1},1)}))},fr={left:cr(!1),right:cr(!0)}.left,lr=sr("reduce"),pr=Le("reduce",{1:0});Ut({target:"Array",proto:!0,forced:!lr||!pr},{reduce:function(t){return fr(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}});var dr=v((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}));Ut({target:"Date",proto:!0,forced:dr},{toJSON:function(t){var e=Jt(this),r=P(e);return"number"!=typeof r||isFinite(r)?e.toISOString():null}});var vr=!v((function(){return Object.isExtensible(Object.preventExtensions({}))})),hr=l((function(t){var e=F.f,r=X("meta"),n=0,o=Object.isExtensible||function(){return!0},i=function(t){e(t,r,{value:{objectID:"O"+ ++n,weakData:{}}})},a=t.exports={REQUIRED:!1,fastKey:function(t,e){if(!E(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!T(t,r)){if(!o(t))return"F";if(!e)return"E";i(t)}return t[r].objectID},getWeakData:function(t,e){if(!T(t,r)){if(!o(t))return!0;if(!e)return!1;i(t)}return t[r].weakData},onFreeze:function(t){return vr&&a.REQUIRED&&o(t)&&!T(t,r)&&i(t),t}};et[r]=!0})),yr=(hr.REQUIRED,hr.fastKey,hr.getWeakData,hr.onFreeze,$t("iterator")),gr=Array.prototype,br={};br[$t("toStringTag")]="z";var mr="[object z]"===String(br),wr=$t("toStringTag"),xr="Arguments"==x(function(){return arguments}()),Or=mr?x:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),wr))?r:xr?x(e):"Object"==(n=x(e))&&"function"==typeof e.callee?"Arguments":n},Sr=$t("iterator"),kr=function(t,e,r,n){try{return n?e(N(r)[0],r[1]):e(r)}catch(e){var o=t.return;throw void 0!==o&&N(o.call(t)),e}},jr=l((function(t){var e=function(t,e){this.stopped=t,this.result=e};(t.exports=function(t,r,n,o,i){var a,u,c,s,f,l,p,d,v=pe(r,n,o?2:1);if(i)a=t;else{if("function"!=typeof(u=function(t){if(null!=t)return t[Sr]||t["@@iterator"]||Ce[Or(t)]}(t)))throw TypeError("Target is not iterable");if(void 0!==(d=u)&&(Ce.Array===d||gr[yr]===d)){for(c=0,s=mt(t.length);s>c;c++)if((f=o?v(N(p=t[c])[0],p[1]):v(t[c]))&&f instanceof e)return f;return new e(!1)}a=u.call(t)}for(l=a.next;!(p=l.call(a)).done;)if("object"==typeof(f=kr(a,v,p.value,o))&&f&&f instanceof e)return f;return new e(!1)}).stop=function(t){return new e(!0,t)}})),Er=function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return t},Pr=$t("iterator"),Ar=!1;try{var Tr=0,Lr={next:function(){return{done:!!Tr++}},return:function(){Ar=!0}};Lr[Pr]=function(){return this},Array.from(Lr,(function(){throw 2}))}catch(t){}var Ir=function(t,e){if(!e&&!Ar)return!1;var r=!1;try{var n={};n[Pr]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r},Dr=function(t,e,r){var n,o;return $e&&"function"==typeof(n=e.constructor)&&n!==r&&E(o=n.prototype)&&o!==r.prototype&&$e(t,o),t},Rr=function(t,e,r){for(var n in e)lt(t,n,e[n],r);return t},Mr=$t("species"),_r=function(t){var e=vt(t),r=F.f;h&&e&&!e[Mr]&&r(e,Mr,{configurable:!0,get:function(){return this}})},Nr=F.f,Cr=hr.fastKey,Fr=ft.set,zr=ft.getterFor,Gr=(function(t,e,r){var n=-1!==t.indexOf("Map"),o=-1!==t.indexOf("Weak"),i=n?"set":"add",a=d[t],u=a&&a.prototype,c=a,s={},f=function(t){var e=u[t];lt(u,t,"add"==t?function(t){return e.call(this,0===t?0:t),this}:"delete"==t?function(t){return!(o&&!E(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return o&&!E(t)?void 0:e.call(this,0===t?0:t)}:"has"==t?function(t){return!(o&&!E(t))&&e.call(this,0===t?0:t)}:function(t,r){return e.call(this,0===t?0:t,r),this})};if(zt(t,"function"!=typeof a||!(o||u.forEach&&!v((function(){(new a).entries().next()})))))c=r.getConstructor(e,t,n,i),hr.REQUIRED=!0;else if(zt(t,!0)){var l=new c,p=l[i](o?{}:-0,1)!=l,h=v((function(){l.has(1)})),y=Ir((function(t){new a(t)})),g=!o&&v((function(){for(var t=new a,e=5;e--;)t[i](e,e);return!t.has(-0)}));y||((c=e((function(e,r){Er(e,c,t);var o=Dr(new a,e,c);return null!=r&&jr(r,o[i],o,n),o}))).prototype=u,u.constructor=c),(h||g)&&(f("delete"),f("has"),n&&f("get")),(g||p)&&f(i),o&&u.clear&&delete u.clear}s[t]=c,Ut({global:!0,forced:c!=a},s),He(c,t),o||r.setStrong(c,t,n)}("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),{getConstructor:function(t,e,r,n){var o=t((function(t,i){Er(t,o,e),Fr(t,{type:e,index:Se(null),first:void 0,last:void 0,size:0}),h||(t.size=0),null!=i&&jr(i,t[n],t,r)})),i=zr(e),a=function(t,e,r){var n,o,a=i(t),c=u(t,e);return c?c.value=r:(a.last=c={index:o=Cr(e,!0),key:e,value:r,previous:n=a.last,next:void 0,removed:!1},a.first||(a.first=c),n&&(n.next=c),h?a.size++:t.size++,"F"!==o&&(a.index[o]=c)),t},u=function(t,e){var r,n=i(t),o=Cr(e);if("F"!==o)return n.index[o];for(r=n.first;r;r=r.next)if(r.key==e)return r};return Rr(o.prototype,{clear:function(){for(var t=i(this),e=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete e[r.index],r=r.next;t.first=t.last=void 0,h?t.size=0:this.size=0},delete:function(t){var e=i(this),r=u(this,t);if(r){var n=r.next,o=r.previous;delete e.index[r.index],r.removed=!0,o&&(o.next=n),n&&(n.previous=o),e.first==r&&(e.first=n),e.last==r&&(e.last=o),h?e.size--:this.size--}return!!r},forEach:function(t){for(var e,r=i(this),n=pe(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.next:r.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!u(this,t)}}),Rr(o.prototype,r?{get:function(t){var e=u(this,t);return e&&e.value},set:function(t,e){return a(this,0===t?0:t,e)}}:{add:function(t){return a(this,t=0===t?0:t,t)}}),h&&Nr(o.prototype,"size",{get:function(){return i(this).size}}),o},setStrong:function(t,e,r){var n=e+" Iterator",o=zr(e),i=zr(n);er(t,e,(function(t,e){Fr(this,{type:n,target:t,state:o(t),kind:e,last:void 0})}),(function(){for(var t=i(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?"keys"==e?{value:r.key,done:!1}:"values"==e?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),_r(e)}}),mr?{}.toString:function(){return"[object "+Or(this)+"]"});mr||lt(Object.prototype,"toString",Gr,{unsafe:!0});var Ur,qr,Jr,Wr=d.Promise,Kr=$t("species"),Br=/(iphone|ipod|ipad).*applewebkit/i.test(Zt),Hr=d.location,Vr=d.setImmediate,Yr=d.clearImmediate,$r=d.process,Qr=d.MessageChannel,Xr=d.Dispatch,Zr=0,tn={},en=function(t){if(tn.hasOwnProperty(t)){var e=tn[t];delete tn[t],e()}},rn=function(t){return function(){en(t)}},nn=function(t){en(t.data)},on=function(t){d.postMessage(t+"",Hr.protocol+"//"+Hr.host)};Vr&&Yr||(Vr=function(t){for(var e=[],r=1;arguments.length>r;)e.push(arguments[r++]);return tn[++Zr]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},Ur(Zr),Zr},Yr=function(t){delete tn[t]},"process"==x($r)?Ur=function(t){$r.nextTick(rn(t))}:Xr&&Xr.now?Ur=function(t){Xr.now(rn(t))}:Qr&&!Br?(Jr=(qr=new Qr).port2,qr.port1.onmessage=nn,Ur=pe(Jr.postMessage,Jr,1)):!d.addEventListener||"function"!=typeof postMessage||d.importScripts||v(on)?Ur="onreadystatechange"in D("script")?function(t){be.appendChild(D("script")).onreadystatechange=function(){be.removeChild(this),en(t)}}:function(t){setTimeout(rn(t),0)}:(Ur=on,d.addEventListener("message",nn,!1)));var an,un,cn,sn,fn,ln,pn,dn,vn={set:Vr,clear:Yr},hn=_.f,yn=vn.set,gn=d.MutationObserver||d.WebKitMutationObserver,bn=d.process,mn=d.Promise,wn="process"==x(bn),xn=hn(d,"queueMicrotask"),On=xn&&xn.value;On||(an=function(){var t,e;for(wn&&(t=bn.domain)&&t.exit();un;){e=un.fn,un=un.next;try{e()}catch(t){throw un?sn():cn=void 0,t}}cn=void 0,t&&t.enter()},wn?sn=function(){bn.nextTick(an)}:gn&&!Br?(fn=!0,ln=document.createTextNode(""),new gn(an).observe(ln,{characterData:!0}),sn=function(){ln.data=fn=!fn}):mn&&mn.resolve?(pn=mn.resolve(void 0),dn=pn.then,sn=function(){dn.call(pn,an)}):sn=function(){yn.call(d,an)});var Sn,kn,jn,En,Pn=On||function(t){var e={fn:t,next:void 0};cn&&(cn.next=e),un||(un=e,sn()),cn=e},An=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=n})),this.resolve=le(e),this.reject=le(r)},Tn={f:function(t){return new An(t)}},Ln=function(t,e){if(N(t),E(e)&&e.constructor===t)return e;var r=Tn.f(t);return(0,r.resolve)(e),r.promise},In=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Dn=vn.set,Rn=$t("species"),Mn="Promise",_n=ft.get,Nn=ft.set,Cn=ft.getterFor(Mn),Fn=Wr,zn=d.TypeError,Gn=d.document,Un=d.process,qn=vt("fetch"),Jn=Tn.f,Wn=Jn,Kn="process"==x(Un),Bn=!!(Gn&&Gn.createEvent&&d.dispatchEvent),Hn=zt(Mn,(function(){if(!(B(Fn)!==String(Fn))){if(66===ne)return!0;if(!Kn&&"function"!=typeof PromiseRejectionEvent)return!0}if(ne>=51&&/native code/.test(Fn))return!1;var t=Fn.resolve(1),e=function(t){t((function(){}),(function(){}))};return(t.constructor={})[Rn]=e,!(t.then((function(){}))instanceof e)})),Vn=Hn||!Ir((function(t){Fn.all(t).catch((function(){}))})),Yn=function(t){var e;return!(!E(t)||"function"!=typeof(e=t.then))&&e},$n=function(t,e,r){if(!e.notified){e.notified=!0;var n=e.reactions;Pn((function(){for(var o=e.value,i=1==e.state,a=0;n.length>a;){var u,c,s,f=n[a++],l=i?f.ok:f.fail,p=f.resolve,d=f.reject,v=f.domain;try{l?(i||(2===e.rejection&&to(t,e),e.rejection=1),!0===l?u=o:(v&&v.enter(),u=l(o),v&&(v.exit(),s=!0)),u===f.promise?d(zn("Promise-chain cycle")):(c=Yn(u))?c.call(u,p,d):p(u)):d(o)}catch(t){v&&!s&&v.exit(),d(t)}}e.reactions=[],e.notified=!1,r&&!e.rejection&&Xn(t,e)}))}},Qn=function(t,e,r){var n,o,i;Bn?((n=Gn.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),d.dispatchEvent(n)):n={promise:e,reason:r},(o=d["on"+t])?o(n):"unhandledrejection"===t&&((i=d.console)&&i.error)},Xn=function(t,e){Dn.call(d,(function(){var r,n=e.value;if(Zn(e)&&(r=In((function(){Kn?Un.emit("unhandledRejection",n,t):Qn("unhandledrejection",t,n)})),e.rejection=Kn||Zn(e)?2:1,r.error))throw r.value}))},Zn=function(t){return 1!==t.rejection&&!t.parent},to=function(t,e){Dn.call(d,(function(){Kn?Un.emit("rejectionHandled",t):Qn("rejectionhandled",t,e.value)}))},eo=function(t,e,r,n){return function(o){t(e,r,o,n)}},ro=function(t,e,r,n){e.done||(e.done=!0,n&&(e=n),e.value=r,e.state=2,$n(t,e,!0))},no=function(t,e,r,n){if(!e.done){e.done=!0,n&&(e=n);try{if(t===r)throw zn("Promise can't be resolved itself");var o=Yn(r);o?Pn((function(){var n={done:!1};try{o.call(r,eo(no,t,n,e),eo(ro,t,n,e))}catch(r){ro(t,n,r,e)}})):(e.value=r,e.state=1,$n(t,e,!1))}catch(r){ro(t,{done:!1},r,e)}}};Hn&&(Fn=function(t){Er(this,Fn,Mn),le(t),Sn.call(this);var e=_n(this);try{t(eo(no,this,e),eo(ro,this,e))}catch(t){ro(this,e,t)}},(Sn=function(t){Nn(this,{type:Mn,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Rr(Fn.prototype,{then:function(t,e){var r,n,o,i=Cn(this),a=Jn((r=Fn,void 0===(o=N(this).constructor)||null==(n=N(o)[Kr])?r:le(n)));return a.ok="function"!=typeof t||t,a.fail="function"==typeof e&&e,a.domain=Kn?Un.domain:void 0,i.parent=!0,i.reactions.push(a),0!=i.state&&$n(this,i,!1),a.promise},catch:function(t){return this.then(void 0,t)}}),kn=function(){var t=new Sn,e=_n(t);this.promise=t,this.resolve=eo(no,t,e),this.reject=eo(ro,t,e)},Tn.f=Jn=function(t){return t===Fn||t===jn?new kn(t):Wn(t)},"function"==typeof Wr&&(En=Wr.prototype.then,lt(Wr.prototype,"then",(function(t,e){var r=this;return new Fn((function(t,e){En.call(r,t,e)})).then(t,e)}),{unsafe:!0}),"function"==typeof qn&&Ut({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return Ln(Fn,qn.apply(d,arguments))}}))),Ut({global:!0,wrap:!0,forced:Hn},{Promise:Fn}),He(Fn,Mn,!1),_r(Mn),jn=vt(Mn),Ut({target:Mn,stat:!0,forced:Hn},{reject:function(t){var e=Jn(this);return e.reject.call(void 0,t),e.promise}}),Ut({target:Mn,stat:!0,forced:Hn},{resolve:function(t){return Ln(this,t)}}),Ut({target:Mn,stat:!0,forced:Vn},{all:function(t){var e=this,r=Jn(e),n=r.resolve,o=r.reject,i=In((function(){var r=le(e.resolve),i=[],a=0,u=1;jr(t,(function(t){var c=a++,s=!1;i.push(void 0),u++,r.call(e,t).then((function(t){s||(s=!0,i[c]=t,--u||n(i))}),o)})),--u||n(i)}));return i.error&&o(i.value),r.promise},race:function(t){var e=this,r=Jn(e),n=r.reject,o=In((function(){var o=le(e.resolve);jr(t,(function(t){o.call(e,t).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var oo=function(t){return function(e,r){var n,o,i=String(k(e)),a=gt(r),u=i.length;return a<0||a>=u?t?"":void 0:(n=i.charCodeAt(a))<55296||n>56319||a+1===u||(o=i.charCodeAt(a+1))<56320||o>57343?t?i.charAt(a):n:t?i.slice(a,a+2):o-56320+(n-55296<<10)+65536}},io={codeAt:oo(!1),charAt:oo(!0)}.charAt,ao=ft.set,uo=ft.getterFor("String Iterator");er(String,"String",(function(t){ao(this,{type:"String Iterator",string:String(t),index:0})}),(function(){var t,e=uo(this),r=e.string,n=e.index;return n>=r.length?{value:void 0,done:!0}:(t=io(r,n),e.index+=t.length,{value:t,done:!1})}));var co={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},so=$t("iterator"),fo=$t("toStringTag"),lo=or.values;for(var po in co){var vo=d[po],ho=vo&&vo.prototype;if(ho){if(ho[so]!==lo)try{z(ho,so,lo)}catch(t){ho[so]=lo}if(ho[fo]||z(ho,fo,po),co[po])for(var yo in or)if(ho[yo]!==or[yo])try{z(ho,yo,or[yo])}catch(t){ho[yo]=or[yo]}}}function go(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function bo(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){go(i,n,o,a,u,"next",t)}function u(t){go(i,n,o,a,u,"throw",t)}a(void 0)}))}}function mo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function xo(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?wo(Object(r),!0).forEach((function(e){mo(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wo(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Oo(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function So(t,e){return Eo(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(t,e)||Ao(t,e)||Lo()}function ko(t){return Eo(t)||Po(t)||Ao(t)||Lo()}function jo(t){return function(t){if(Array.isArray(t))return To(t)}(t)||Po(t)||Ao(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Eo(t){if(Array.isArray(t))return t}function Po(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function Ao(t,e){if(t){if("string"==typeof t)return To(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?To(t,e):void 0}}function To(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Lo(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}Ut({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}});var Io=l((function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function u(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new O(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=m(a,r);if(u){if(u===s)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var f=c(t,e,r);if("normal"===f.type){if(n=r.done?"completed":"suspendedYield",f.arg===s)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n="completed",r.method="throw",r.arg=f.arg)}}}(t,r,a),i}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var s={};function f(){}function l(){}function p(){}var d={};d[o]=function(){return this};var v=Object.getPrototypeOf,h=v&&v(v(S([])));h&&h!==e&&r.call(h,o)&&(d=h);var y=p.prototype=f.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function b(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,u){var s=c(t[o],t,i);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,u)}))}u(s.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function m(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,m(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,s;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function S(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return l.prototype=y.constructor=p,p.constructor=l,p[a]=l.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(b.prototype),b.prototype[i]=function(){return this},t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),y[a]="Generator",y[o]=function(){return this},y.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=S,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}})),Do=Tt.f,Ro={}.toString,Mo="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],_o={f:function(t){return Mo&&"[object Window]"==Ro.call(t)?function(t){try{return Do(t)}catch(t){return Mo.slice()}}(t):Do(j(t))}},No={f:$t},Co=F.f,Fo=function(t){var e=pt.Symbol||(pt.Symbol={});T(e,t)||Co(e,t,{value:No.f(t)})},zo=he.forEach,Go=tt("hidden"),Uo=$t("toPrimitive"),qo=ft.set,Jo=ft.getterFor("Symbol"),Wo=Object.prototype,Ko=d.Symbol,Bo=vt("JSON","stringify"),Ho=_.f,Vo=F.f,Yo=_o.f,$o=b.f,Qo=Y("symbols"),Xo=Y("op-symbols"),Zo=Y("string-to-symbol-registry"),ti=Y("symbol-to-string-registry"),ei=Y("wks"),ri=d.QObject,ni=!ri||!ri.prototype||!ri.prototype.findChild,oi=h&&v((function(){return 7!=Se(Vo({},"a",{get:function(){return Vo(this,"a",{value:7}).a}})).a}))?function(t,e,r){var n=Ho(Wo,e);n&&delete Wo[e],Vo(t,e,r),n&&t!==Wo&&Vo(Wo,e,n)}:Vo,ii=function(t,e){var r=Qo[t]=Se(Ko.prototype);return qo(r,{type:"Symbol",tag:t,description:e}),h||(r.description=e),r},ai=Bt?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof Ko},ui=function(t,e,r){t===Wo&&ui(Xo,e,r),N(t);var n=P(e,!0);return N(r),T(Qo,n)?(r.enumerable?(T(t,Go)&&t[Go][n]&&(t[Go][n]=!1),r=Se(r,{enumerable:m(0,!1)})):(T(t,Go)||Vo(t,Go,m(1,{})),t[Go][n]=!0),oi(t,n,r)):Vo(t,n,r)},ci=function(t,e){N(t);var r=j(e),n=ye(r).concat(pi(r));return zo(n,(function(e){h&&!si.call(r,e)||ui(t,e,r[e])})),t},si=function(t){var e=P(t,!0),r=$o.call(this,e);return!(this===Wo&&T(Qo,e)&&!T(Xo,e))&&(!(r||!T(this,e)||!T(Qo,e)||T(this,Go)&&this[Go][e])||r)},fi=function(t,e){var r=j(t),n=P(e,!0);if(r!==Wo||!T(Qo,n)||T(Xo,n)){var o=Ho(r,n);return!o||!T(Qo,n)||T(r,Go)&&r[Go][n]||(o.enumerable=!0),o}},li=function(t){var e=Yo(j(t)),r=[];return zo(e,(function(t){T(Qo,t)||T(et,t)||r.push(t)})),r},pi=function(t){var e=t===Wo,r=Yo(e?Xo:j(t)),n=[];return zo(r,(function(t){!T(Qo,t)||e&&!T(Wo,t)||n.push(Qo[t])})),n};if(Kt||(lt((Ko=function(){if(this instanceof Ko)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,e=X(t),r=function(t){this===Wo&&r.call(Xo,t),T(this,Go)&&T(this[Go],e)&&(this[Go][e]=!1),oi(this,e,m(1,t))};return h&&ni&&oi(Wo,e,{configurable:!0,set:r}),ii(e,t)}).prototype,"toString",(function(){return Jo(this).tag})),lt(Ko,"withoutSetter",(function(t){return ii(X(t),t)})),b.f=si,F.f=ui,_.f=fi,Tt.f=_o.f=li,Lt.f=pi,No.f=function(t){return ii($t(t),t)},h&&(Vo(Ko.prototype,"description",{configurable:!0,get:function(){return Jo(this).description}}),lt(Wo,"propertyIsEnumerable",si,{unsafe:!0}))),Ut({global:!0,wrap:!0,forced:!Kt,sham:!Kt},{Symbol:Ko}),zo(ye(ei),(function(t){Fo(t)})),Ut({target:"Symbol",stat:!0,forced:!Kt},{for:function(t){var e=String(t);if(T(Zo,e))return Zo[e];var r=Ko(e);return Zo[e]=r,ti[r]=e,r},keyFor:function(t){if(!ai(t))throw TypeError(t+" is not a symbol");if(T(ti,t))return ti[t]},useSetter:function(){ni=!0},useSimple:function(){ni=!1}}),Ut({target:"Object",stat:!0,forced:!Kt,sham:!h},{create:function(t,e){return void 0===e?Se(t):ci(Se(t),e)},defineProperty:ui,defineProperties:ci,getOwnPropertyDescriptor:fi}),Ut({target:"Object",stat:!0,forced:!Kt},{getOwnPropertyNames:li,getOwnPropertySymbols:pi}),Ut({target:"Object",stat:!0,forced:v((function(){Lt.f(1)}))},{getOwnPropertySymbols:function(t){return Lt.f(Jt(t))}}),Bo){var di=!Kt||v((function(){var t=Ko();return"[null]"!=Bo([t])||"{}"!=Bo({a:t})||"{}"!=Bo(Object(t))}));Ut({target:"JSON",stat:!0,forced:di},{stringify:function(t,e,r){for(var n,o=[t],i=1;arguments.length>i;)o.push(arguments[i++]);if(n=e,(E(e)||void 0!==t)&&!ai(t))return qt(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!ai(e))return e}),o[1]=e,Bo.apply(null,o)}})}Ko.prototype[Uo]||z(Ko.prototype,Uo,Ko.prototype.valueOf),He(Ko,"Symbol"),et[Go]=!0;var vi=F.f,hi=d.Symbol;if(h&&"function"==typeof hi&&(!("description"in hi.prototype)||void 0!==hi().description)){var yi={},gi=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof gi?new hi(t):void 0===t?hi():hi(t);return""===t&&(yi[e]=!0),e};Dt(gi,hi);var bi=gi.prototype=hi.prototype;bi.constructor=gi;var mi=bi.toString,wi="Symbol(test)"==String(hi("test")),xi=/^Symbol\((.*)\)[^)]+$/;vi(bi,"description",{configurable:!0,get:function(){var t=E(this)?this.valueOf():this,e=mi.call(t);if(T(yi,t))return"";var r=wi?e.slice(7,-1):e.replace(xi,"$1");return""===r?void 0:r}}),Ut({global:!0,forced:!0},{Symbol:gi})}Fo("iterator");var Oi=he.forEach,Si=sr("forEach"),ki=Le("forEach"),ji=Si&&ki?[].forEach:function(t){return Oi(this,t,arguments.length>1?arguments[1]:void 0)};Ut({target:"Array",proto:!0,forced:[].forEach!=ji},{forEach:ji});var Ei=ie("slice"),Pi=Le("slice",{ACCESSORS:!0,0:0,1:2}),Ai=$t("species"),Ti=[].slice,Li=Math.max;Ut({target:"Array",proto:!0,forced:!Ei||!Pi},{slice:function(t,e){var r,n,o,i=j(this),a=mt(i.length),u=Ot(t,a),c=Ot(void 0===e?a:e,a);if(qt(i)&&("function"!=typeof(r=i.constructor)||r!==Array&&!qt(r.prototype)?E(r)&&null===(r=r[Ai])&&(r=void 0):r=void 0,r===Array||void 0===r))return Ti.call(i,u,c);for(n=new(void 0===r?Array:r)(Li(c-u,0)),o=0;u<c;u++,o++)u in i&&Wt(n,o,i[u]);return n.length=o,n}});var Ii=b.f,Di=function(t){return function(e){for(var r,n=j(e),o=ye(n),i=o.length,a=0,u=[];i>a;)r=o[a++],h&&!Ii.call(n,r)||u.push(t?[r,n[r]]:n[r]);return u}},Ri={entries:Di(!0),values:Di(!1)}.entries;Ut({target:"Object",stat:!0},{entries:function(t){return Ri(t)}});var Mi=v((function(){Ue(1)}));for(var _i in Ut({target:"Object",stat:!0,forced:Mi,sham:!Fe},{getPrototypeOf:function(t){return Ue(Jt(t))}}),co){var Ni=d[_i],Ci=Ni&&Ni.prototype;if(Ci&&Ci.forEach!==ji)try{z(Ci,"forEach",ji)}catch(t){Ci.forEach=ji}}var Fi=v((function(){ye(1)}));Ut({target:"Object",stat:!0,forced:Fi},{keys:function(t){return ye(Jt(t))}});var zi=function(){var t=N(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},Gi=RegExp.prototype,Ui=Gi.toString,qi=v((function(){return"/a/b"!=Ui.call({source:"a",flags:"b"})})),Ji="toString"!=Ui.name;(qi||Ji)&<(RegExp.prototype,"toString",(function(){var t=N(this),e=String(t.source),r=t.flags;return"/"+e+"/"+String(void 0===r&&t instanceof RegExp&&!("flags"in Gi)?zi.call(t):r)}),{unsafe:!0});var Wi=function(){var t=bo(Io.mark((function t(e,r){var n,o,i,a=arguments;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:"readwrite",t.next=3,e;case 3:return o=t.sent,i=o.transaction(r,n),t.abrupt("return",{db:o,store:i.objectStore(r),tx:i});case 6:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),Ki=function(t){return"[object Object]"===Object.prototype.toString.call(t)&&Object.keys(t).length>0},Bi=function(t,e){var r=t.find((function(t){return t.store===e}));if(r&&r.hasOwnProperty("keyPath")){var n=r.keyPath;if(n.hasOwnProperty("keyPath"))return n.keyPath}return"id"},Hi=new Map,Vi=function(t){var e=new Map;return Object.entries(t).forEach((function(t){var r=So(t,2),n=r[0],o=r[1];e.set(n,$i(o))})),e},Yi=function(t){var e=new Map;return t.forEach((function(t,r){e.set(r,$i(t))})),e},$i=function(t){return Ki(t)?Vi(t):Array.isArray(t)?Yi(t):t},Qi=function(e){return function(r,n,o){var i=r.get(n)[Symbol.iterator](),a=ta(e,n);return function t(e,r,n){var o,i,a=null;do{if(o=e.next().value){var u=So(o,2),c=(u[0],u[1]);n(c)?a=c:(i=c,Object.getPrototypeOf(i)===Map.prototype&&(a=t(c[Symbol.iterator](),r,n)))}}while(void 0!==o&&null===a);return a}(i,o,t.curry(ea,a,o))}},Xi=function(t,e,r){if(0===t.size)return t;var n=e?t.get(e):t;return r?Array.isArray(r)?r.reduce((function(t,e){return t instanceof Map&&t.has(e)?t.get(e):null}),n):n.get(r):n},Zi=function(t,e,r){return r?e.map((function(e){return{key:e[r],store:t,updated:(new Date).getTime()}})):[{store:t,updated:(new Date).getTime()}]},ta=function(t,e){return t.find((function(t){return t.store===e})).keyPath.keyPath||"id"},ea=function(t,e,r){return r.has(t)&&r.get(t)===e},ra=function(t){var e=t.data,r=t.keys,n=t.store,o=t.value;if(r){var i=e.get(n);i.set(r,o),e.set(n,i)}else e.set(n,o);return e},na=function(t){0===Hi.size&&(t.forEach((function(t){var e=t.store;Hi.set(e,new Map)})),Hi.set("updated",new Map));var e=Qi(t);return{clear:function(){Hi.set(store,new Map)},deepSet:function(e,r,n,o){var i=$i(n);Hi=ra({data:Hi,keys:e,store:r,value:i});var a=!!o&&ta(t,r);Hi.set("updated",$i(Zi(r,n,a)))},find:function(t,r){return e(Hi,t,r)},get:function(t,e){return Xi(Hi,t,e)},getAll:function(){return Hi},set:function(e,r,n){var o=$i(r);Hi.set(e,$i(r));var i=!!n&&ta(t,e);Hi.set("updated",$i(Zi(e,o,i)))}}},oa=function(t){return void 0!==t&&("string"==typeof t||t[0])},ia=function t(e,r,n){var o=ko(r),i=o[0],a=o.slice(1);if(1===r.length){var u=Ki(n)?xo({},e[i],{},n):n;return xo({},e,mo({},i,u))}return xo({},e,mo({},i,xo({},e[i],{},t(e[i],a,n))))},aa=function(t){var e=t.data,r=t.keys,n=t.store,o=t.value;return Promise.resolve(e.deepSet(r,n,o))},ua=function(){var t=bo(Io.mark((function t(e){var r,n,o,i,a,u,c,s,f,l,p,d;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.keys,n=e.manager,o=e.schema,i=e.store,a=e.value,!n){t.next=18;break}if(u=Bi(o,i),!oa(r)||"key"!==u){t.next=12;break}if(Array.isArray(r)&&1!==r.length){t.next=7;break}return c=Array.isArray(r)?r[0]:r,t.abrupt("return",n.set(i,{key:c,value:mo({},c,a)}));case 7:return s=ko(r),f=s[0],l=s.slice(1),t.next=10,n.get(i,f);case 10:return p=t.sent,t.abrupt("return",n.set(i,{key:f,value:ia(p.value,l,a)}));case 12:if(!Ki(a)||!a.hasOwnProperty(u)){t.next=17;break}return t.next=15,n.get(i,a[u]);case 15:return d=t.sent,t.abrupt("return",n.set(i,xo({},d,{},a)));case 17:return t.abrupt("return",n.set(i,a));case 18:return t.abrupt("return",Promise.resolve(ra({data:data,keys:r,store:i,value:a})).then((function(t){data=t})));case 19:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),ca=/^(\d{4})-(\d{2})-(\d{2})$/,sa=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d+)$/,fa=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d+)Z$/,la=function(t){return Array.isArray(t)?da(t):Ki(t)?pa(t):"string"==typeof t?(n=t,ca.test(n)?e(n):sa.test(n)||fa.test(n)?r(n):n):t;var n},pa=function(t){return Object.entries(t).reduce((function(t,e){var r=So(e,2),n=r[0],o=r[1];return xo({},t,mo({},n,la(o)))}),{})},da=function(t){return t.map((function(t){return la(t)}))},va=function(t){return la(t)},ha=kt.includes,ya=Le("indexOf",{ACCESSORS:!0,1:0});Ut({target:"Array",proto:!0,forced:!ya},{includes:function(t){return ha(this,t,arguments.length>1?arguments[1]:void 0)}}),Ee("includes");var ga=$t("match"),ba=function(t){var e;return E(t)&&(void 0!==(e=t[ga])?!!e:"RegExp"==x(t))},ma=function(t){if(ba(t))throw TypeError("The method doesn't accept regular expressions");return t},wa=$t("match");Ut({target:"String",proto:!0,forced:!function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[wa]=!1,"/./"[t](e)}catch(t){}}return!1}("includes")},{includes:function(t){return!!~String(k(this)).indexOf(ma(t),arguments.length>1?arguments[1]:void 0)}});var xa=function(t){if(!t)return!1;var e,r=(e=t,Object.keys(Array.isArray(e)?e[0]:e));return["key","value"].reduce((function(t,e){return!!t&&r.includes(e)}),!0)},Oa=function(t){return xa(t)?Array.isArray(t)?t.reduce((function(t,e){var r=e.key,n=e.value,o=Oo(e,["key","value"]);return xo({},t,mo({},r,n||o))}),{}):t.value:t},Sa=function(t){return Array.isArray(t)?t:Ki(t)?Object.entries(t).map((function(t){var e=So(t,2);return{key:e[0],value:e[1]}})):{key:t,data:t}},ka=function(t){if(Array.isArray(t)){var e=ko(t);return{index:e[0],keys:e.slice(1)}}return{index:t}},ja=function(t,e){var r=e.store;return t.getAll(r).then((function(t){return Oa(t)})).then((function(t){return $i(t)})).then((function(t){var e=new Map;return e.set(r,t),e})).catch((function(t){}))},Ea=function(){var t=bo(Io.mark((function t(e){var r,n,o,i,a,u,c,s,f,l;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.manager,n=e.store,o=e.indexes,t.next=3,r.getDB();case 3:return i=t.sent,t.next=6,Wi(i,n);case 6:return a=t.sent,u=a.store,c=ka(o),s=c.index,f=c.keys,"key"===u.keyPath&&(l=Array.isArray(o)?o[0]:o,s=[l,"key"]),t.abrupt("return",{index:s,keys:f});case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Pa=function(){var t=bo(Io.mark((function t(e){var r,n,o,i,a,u,c,s;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.manager,n=e.store,o=e.indexes,t.next=3,Aa({manager:r,store:n,indexes:o});case 3:if(i=t.sent,a=i.data,u=i.keys,0!==a.length){t.next=8;break}return t.abrupt("return",new Map);case 8:if(c=Oa(a),s=$i(c),u){t.next=14;break}if(1!==s.size||!s.has(o)){t.next=13;break}return t.abrupt("return",s.get(o));case 13:return t.abrupt("return",s);case 14:return t.abrupt("return",Xi(s,null,u));case 15:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Aa=function(){var t=bo(Io.mark((function t(e){var r,n,o,i,a,u,c;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.manager,n=e.store,null!==(o=e.indexes)){t.next=6;break}return t.next=4,r.getAll(n);case 4:return i=t.sent,t.abrupt("return",{data:i,keys:null});case 6:return t.next=8,Ea({manager:r,store:n,indexes:o});case 8:if(a=t.sent,u=a.index,c=a.keys,!Array.isArray(u)){t.next=17;break}return t.next=14,r.get.apply(r,[n].concat(jo(u))).catch((function(t){}));case 14:i=t.sent,t.next=20;break;case 17:return t.next=19,r.get(n,u).catch((function(t){}));case 19:i=t.sent;case 20:return t.abrupt("return",{data:i,keys:c});case 21:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Ta=he.filter,La=ie("filter"),Ia=Le("filter");function Da(t,e){if(e.length<t)throw new TypeError(t+" argument"+t>1?"s":" required, but only "+e.length+" present")}function Ra(t){Da(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):new Date(NaN)}function Ma(t){Da(1,arguments);var e=Ra(t);return!isNaN(e)}Ut({target:"Array",proto:!0,forced:!La||!Ia},{filter:function(t){return Ta(this,t,arguments.length>1?arguments[1]:void 0)}});var _a=function(t){return t&&Array.isArray(t)&&t.length>1},Na=function(){var t=bo(Io.mark((function t(e,r,n){var o,i,a;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=Array.isArray(e)?e:[e],t.next=3,r.where("updated",{store:n}).catch((function(t){}));case 3:return i=t.sent,a=i.filter((function(t){var e=t.key;return o.includes(e)})),t.abrupt("return",a);case 6:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}(),Ca=function(t){return t.reduce((function(t,e){var r=e.updated,n=new Date(r);return Ma(t)||function(t,e){Da(2,arguments);var r=Ra(t),n=Ra(e);return r.getTime()>n.getTime()}(n,t)?n:t}),new Date(t[0].updated))},Fa=function(t){return Array.isArray(t)?Ca(t):function(t){var e=new Date(t.updated);return!Ma(e)&&e}(t)},za=function(){var t=bo(Io.mark((function t(e,r){var n,o;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.where("updated",{store:r}).catch((function(t){}));case 2:if(n=t.sent,_a(n)){t.next=5;break}return t.abrupt("return",!1);case 5:if(Ma(o=Fa(n))){t.next=8;break}return t.abrupt("return",!1);case 8:return t.abrupt("return",o);case 9:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),Ga=function(){var t=bo(Io.mark((function t(e,r,n){var o,i;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Na(e,r,n).catch((function(t){}));case 2:if(o=t.sent,_a(o)){t.next=5;break}return t.abrupt("return",!1);case 5:return i=Fa(o),t.abrupt("return",i);case 7:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}(),Ua=function(t,e){var r=function(t){var e=t.unit,r=t.value;switch(e.toLowerCase()){case"days":return u(new Date,r);case"hours":return a(new Date,r);case"minutes":return i(new Date,r);case"months":return o(new Date,r);case"seconds":return n(new Date,r);default:return u(new Date,r)}}(e);return!c(t,{start:r,end:new Date})},qa=function(){var e=bo(Io.mark((function e(r){var n,o,i,a,u,c,s,f;return Io.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.checker,o=r.keys,i=r.manager,a=r.store,u=r.timescales,i){e.next=3;break}return e.abrupt("return",!0);case 3:return c=o?t.curry(Ga,o):za,e.next=6,c(i,a);case 6:if(s=e.sent){e.next=9;break}return e.abrupt("return",!0);case 9:if(!n){e.next=11;break}return e.abrupt("return",n(s,u));case 11:return f=Ua(s,u),e.abrupt("return",f);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ja=function(t){return t instanceof Map},Wa=function(t){var e=[],r=t.entries(),n=r.next().value;do{var o=So(n,2),i=(o[0],o[1]);if(Ja(i)){var a=Ba(i);e.push(a)}else e.push(i);n=r.next().value}while(n&&n[0]);return e},Ka=function(t){var e={},r=t.entries(),n=r.next().value;do{var o=So(n,2),i=o[0],a=o[1];Ja(a)&&(a=Ba(a)),e=xo({},e,mo({},i,a)),n=r.next().value}while(n&&n[0]);return e},Ba=function(t){if(!Ja(t))return t;if(0===t.size)return[];var e=t.keys().next().value;return"number"==typeof e||"0"===e?Wa(t):Ka(t)},Ha=function(){var t=bo(Io.mark((function t(e){var r,n;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(e).catch((function(t){}));case 2:return r=t.sent,t.next=5,r.json();case 5:return n=t.sent,t.abrupt("return",va(n));case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Va="\t\n\v\f\r \u2028\u2029\ufeff",Ya="["+Va+"]",$a=RegExp("^"+Ya+Ya+"*"),Qa=RegExp(Ya+Ya+"*$"),Xa=function(t){return function(e){var r=String(k(e));return 1&t&&(r=r.replace($a,"")),2&t&&(r=r.replace(Qa,"")),r}},Za={start:Xa(1),end:Xa(2),trim:Xa(3)}.trim,tu=d.parseFloat,eu=1/tu(Va+"-0")!=-1/0?function(t){var e=Za(String(t)),r=tu(e);return 0===r&&"-"==e.charAt(0)?-0:r}:tu;function ru(t,e){return RegExp(t,e)}Ut({global:!0,forced:parseFloat!=eu},{parseFloat:eu});var nu={UNSUPPORTED_Y:v((function(){var t=ru("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),BROKEN_CARET:v((function(){var t=ru("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},ou=F.f,iu=Tt.f,au=ft.set,uu=$t("match"),cu=d.RegExp,su=cu.prototype,fu=/a/g,lu=/a/g,pu=new cu(fu)!==fu,du=nu.UNSUPPORTED_Y;if(h&&zt("RegExp",!pu||du||v((function(){return lu[uu]=!1,cu(fu)!=fu||cu(lu)==lu||"/a/i"!=cu(fu,"i")})))){for(var vu=function(t,e){var r,n=this instanceof vu,o=ba(t),i=void 0===e;if(!n&&o&&t.constructor===vu&&i)return t;pu?o&&!i&&(t=t.source):t instanceof vu&&(i&&(e=zi.call(t)),t=t.source),du&&(r=!!e&&e.indexOf("y")>-1)&&(e=e.replace(/y/g,""));var a=Dr(pu?new cu(t,e):cu(t,e),n?this:su,vu);return du&&r&&au(a,{sticky:r}),a},hu=function(t){t in vu||ou(vu,t,{configurable:!0,get:function(){return cu[t]},set:function(e){cu[t]=e}})},yu=iu(cu),gu=0;yu.length>gu;)hu(yu[gu++]);su.constructor=vu,vu.prototype=su,lt(d,"RegExp",vu)}_r("RegExp");var bu=RegExp.prototype.exec,mu=String.prototype.replace,wu=bu,xu=function(){var t=/a/,e=/b*/g;return bu.call(t,"a"),bu.call(e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),Ou=nu.UNSUPPORTED_Y||nu.BROKEN_CARET,Su=void 0!==/()??/.exec("")[1];(xu||Su||Ou)&&(wu=function(t){var e,r,n,o,i=this,a=Ou&&i.sticky,u=zi.call(i),c=i.source,s=0,f=t;return a&&(-1===(u=u.replace("y","")).indexOf("g")&&(u+="g"),f=String(t).slice(i.lastIndex),i.lastIndex>0&&(!i.multiline||i.multiline&&"\n"!==t[i.lastIndex-1])&&(c="(?: "+c+")",f=" "+f,s++),r=new RegExp("^(?:"+c+")",u)),Su&&(r=new RegExp("^"+c+"$(?!\\s)",u)),xu&&(e=i.lastIndex),n=bu.call(a?r:i,f),a?n?(n.input=n.input.slice(s),n[0]=n[0].slice(s),n.index=i.lastIndex,i.lastIndex+=n[0].length):i.lastIndex=0:xu&&n&&(i.lastIndex=i.global?n.index+n[0].length:e),Su&&n&&n.length>1&&mu.call(n[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(n[o]=void 0)})),n});Ut({target:"RegExp",proto:!0,forced:/./.exec!==wu},{exec:wu});var ku=function(t){var e=t.data,r=t.manager,n=t.store,o=t.indexes;if(r)return Pa({manager:r,store:n,indexes:o});var i=e.get(n,o);return Promise.resolve(i)},ju=function(){var t=bo(Io.mark((function t(e,r,n){var o;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ha(e);case 2:return o=t.sent,t.abrupt("return",r?r(o,n):o);case 4:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}(),Eu=function(){var t=bo(Io.mark((function t(e){var r,n,o,i,a;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.manager,n=e.store,o=e.data,e.keys){t.next=3;break}return t.abrupt("return",r.add("updated",{store:n,updated:(new Date).getTime(),updatedDate:(new Date).toJSON()}));case 3:return t.next=5,r.primaryKey(n);case 5:return i=t.sent,a=o.map((function(t){var e=t[i],o={store:n,updated:(new Date).getTime(),updatedDate:(new Date).toJSON(),key:e};r.add("updated",o)})),t.abrupt("return",Promise.all(a));case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Pu=function(){var t=bo(Io.mark((function t(e,r,n){var o,i,a=arguments;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=a.length>3&&void 0!==a[3]&&a[3],i=Sa(n),t.next=4,Eu({manager:e,store:r,data:i,keys:o});case 4:return t.abrupt("return",Promise.all(i.map((function(t){return e.set(r,t)}))).then((function(){return"Updated"})));case 5:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}();return function(){var e=bo(Io.mark((function e(r){var n,o,i,a,u;return Io.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.db,n=r.fetch,o=r.schema,r.version,i=na(o),a=null,u=n||{checker:null,updater:null,processor:null,timescales:{value:7,unit:"days"},url:"",useKeys:!1},e.next=8;break;case 7:a=e.sent;case 8:return e.abrupt("return",Promise.resolve({clear:function(t){return a?a.clear(t):(i.clear(),Promise.resolve(i))},close:function(){a&&a.close()},fetch:function(){var t=bo(Io.mark((function t(e,r,n){var o,c,s,f,l;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=(o=u).processor,s=o.url,f=o.useKeys,t.next=3,ju(r||s,n||c,e);case 3:if(l=t.sent,a){t.next=8;break}i.set(e,$i(l)),t.next=10;break;case 8:return t.next=10,Pu(a,e,l,f);case 10:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}(),find:function(){var t=bo(Io.mark((function t(e,r){var n;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!a){t.next=5;break}return t.next=3,a.get(e,r);case 3:return n=t.sent,t.abrupt("return",$i(n));case 5:return t.next=7,Promise.resolve(i.find(e,r));case 7:return n=t.sent,t.abrupt("return",n);case 9:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),findJS:function(){var t=bo(Io.mark((function t(e,r){var n;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!a){t.next=5;break}return t.next=3,a.get(e,r);case 3:return n=t.sent,t.abrupt("return",va(n));case 5:return t.next=7,Promise.resolve(i.find(e,r));case 7:return n=t.sent,t.abrupt("return",Ba(n));case 10:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),get:function(){var t=bo(Io.mark((function t(e){var r,n=arguments;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:null,t.abrupt("return",ku({data:i,manager:a,store:e,indexes:r}));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),getJS:function(){var t=bo(Io.mark((function t(e){var r,n,o=arguments;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:null,t.next=3,ku({data:i,manager:a,store:e,indexes:r});case 3:return n=t.sent,t.abrupt("return",Ba(n));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),getAll:function(){var e=bo(Io.mark((function e(){var r,n;return Io.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a){e.next=4;break}return r=t.curry(ja,a),n=o.map(r),e.abrupt("return",Promise.all(n).then((function(t){return t.reduce((function(t,e){return new Map([].concat(jo(t),jo(e)))}),new Map)})));case 4:return e.abrupt("return",Promise.resolve(i.getAll()));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),set:function(t){var e=t.store,r=t.keys,n=t.value,u=va(n);return a?ua({keys:r,manager:a,schema:o,store:e,value:u}):aa({data:i,keys:r,store:e,value:u})},setFetch:function(t){u=xo({},u,{},t)},update:function(){var t=bo(Io.mark((function t(e,r){var n,o,c,s,f,l,p,d,v,h;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.keys,o=e.store,c=e.api,f=(s=u).checker,l=s.processor,p=s.timescales,d=s.url,v=s.useKeys,t.next=4,qa({checker:f,keys:n,manager:a,store:o,timescales:r||p});case 4:if(!t.sent){t.next=16;break}return t.next=8,ju(c||d,l,o);case 8:if(h=t.sent,null!==a){t.next=14;break}i.deepSet(n,o,h,v),t.next=16;break;case 14:return t.next=16,Pu(a,o,h,v);case 16:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),where:function(){var t=bo(Io.mark((function t(e,r){var n;return Io.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!a){t.next=5;break}return t.next=3,a.find(e,r);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}()}));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}));
//# sourceMappingURL=index.js.map