UNPKG

co2offset

Version:

Greenhouse Gas Accounting - ISO14064

2 lines 120 kB
/*! For license information please see main.js.LICENSE.txt */ (()=>{var e={6010:(e,t,n)=>{"use strict";const r=n(9669);e.exports=function(e){let t="https://co2-offset.p.rapidapi.com/",o={"content-type":"application/json","x-rapidapi-host":"co2-offset.p.rapidapi.com","x-rapidapi-key":e,useQueryString:!0};50!==e.length&&(o={"content-type":"application/json","x-account":e},t="https://api.corrently.io/v2.0/"),this.isOnline=!0;let i=this;if(this.EVENTRELOAD=9e5,this._forceEventReload=(new Date).getTime()+this.EVENTRELOAD,this._forceCertificateReload=(new Date).getTime()+this.EVENTRELOAD,this._forceBalanceReload=(new Date).getTime()+this.EVENTRELOAD,"undefined"!=typeof window){let e=window.localStorage.getItem("nextEventReload");null!=e&&(this._forceEventReload=e)}this._getAllDBEvents=function(){return new Promise((function(e){if("undefined"!=typeof window){const t=window.indexedDB.open("co2events",1);t.onupgradeneeded=function(e){e.target.result.createObjectStore("events",{keyPath:"event"})},t.onsuccess=function(t){try{const n=t.target.result,r=n.transaction("events","readonly"),o=r.objectStore("events");let i=[];o.openCursor().onsuccess=e=>{let t=e.target.result;if(t){let e=t.value;i.push(e),t.continue()}},r.oncomplete=function(){n.close(),e(i)}}catch(t){e([])}}}else{const t=n(1275);let r=[];t("co2events",{createIfMissing:!0},(function(t,n){n.createReadStream({}).on("data",(function(e){r.push(JSON.parse(e.value))})).on("close",(function(){})).on("end",(function(){n.close(),e(r)}))}))}}))},this._getAllCertificates=function(){return new Promise((function(e){if("undefined"!=typeof window){const t=window.indexedDB.open("co2certificates",1);t.onupgradeneeded=function(e){e.target.result.createObjectStore("certificates",{keyPath:"compensation"})},t.onsuccess=function(t){try{const n=t.target.result,r=n.transaction("certificates","readonly"),o=r.objectStore("certificates");let i=[];o.openCursor().onsuccess=e=>{let t=e.target.result;if(t){let e=t.value;i.push(e),t.continue()}},r.oncomplete=function(){n.close(),e(i)}}catch(t){e([])}}}else{const t=n(1275);let r=[];t("co2certificates",{createIfMissing:!0},(function(t,n){n.createReadStream({}).on("data",(function(e){r.push(JSON.parse(e.value))})).on("close",(function(){})).on("end",(function(){n.close(),e(r)}))}))}}))},this._compensate=async function(e,n){let i={method:"GET",url:t+"rapidapi/compensate",headers:o,params:{gram:e}};return null!=n&&(i.params.settlement=n),(await r(i)).data},this._identityLookup=async function(e,n){if("undefined"!=typeof window&&void 0!==window.localStorage.getItem("id_"+e)&&null!==window.localStorage.getItem("id_"+e))return JSON.parse(window.localStorage.getItem("id_"+e));{let i={method:"GET",url:t+"co2/identity",headers:o,params:{account:e}};null!=n&&(i.params.nonece=(new Date).getTime()+"_"+Math.random());const s=await r(i);return"undefined"!=typeof window&&window.localStorage.setItem("id_"+e,JSON.stringify(s.data)),s.data}},this.directCompensate=async function(e){return await i._compensate(e)},this.eventCompensate=async function(e){let t=await i.identityLookup(e);return i._forceEventReload=0,await i._compensate(t.event.co2eq-t.event.offset,e)},this.eventDelete=async function(e){const n=await r({method:"GET",url:t+"rapidapi/forgetEvent",headers:o,params:{event:e}});return i._forceEventReload=0,n.data},this.keyValue=async function(e){null==e&&(e={});try{const n=await r({method:"POST",url:t+"rapidapi/kv",headers:o,data:e});return i._forceEventReload=0,i.isOnline=!0,"undefined"!=typeof window&&window.localStorage.setItem("meta",JSON.stringify(n.data)),n.data}catch(e){if(i.isOnline=!1,"undefined"!=typeof window)return JSON.parse(window.localStorage.getItem("meta"))}},this.eventModify=async function(e,n){const s=await r({method:"POST",url:t+"co2/updateEvent?event="+e,headers:o,data:n});return i._forceEventReload=0,s.data},this.identityLookup=async function(e){return await i._identityLookup(e)},this.createViewAccount=async function(){return(await r({method:"POST",url:t+"co2/createViewAccount",headers:o,data:{}})).data},this.searchFootprint=async function(e){return(await r({method:"GET",url:t+"co2/activity/search",headers:o,params:{q:e}})).data},this.listEvents=async function(e){void 0!==e&&null!=e||(e={}),void 0!==e.account&&null!=e.account||(e.account=await i.whoami());let s=!0,a=[],c=[],u={};try{a=await i._getAllDBEvents();let e=0;for(let t=0;t<a.length;t++)a[t].timestamp>e&&(e=a[t].timestamp);i._forceEventReload>(new Date).getTime()&&a.length>0?s=!1:u.timestamp=1*e}catch(e){console.debug(e)}if(s){try{const e=await r({method:"GET",url:t+"co2/listEvents",headers:o,params:u});c=e.data,i.isOnline=!0,i._forceEventReload=(new Date).getTime()+i.EVENTRELOAD}catch(e){i.isOnline=!1}try{if("undefined"!=typeof window&&window.indexedDB){const e=window.indexedDB.open("co2events",1);e.onupgradeneeded=function(e){e.target.result.createObjectStore("events",{keyPath:"event"})},e.onsuccess=function(e){const t=e.target.result.transaction("events","readwrite").objectStore("events");for(let e=0;e<c.length;e++)t.add(c[e])},window.localStorage.setItem("nextEventReload",i._forceEventReload)}else n(1275)("co2events",{createIfMissing:!0},(async function(e,t){for(let e=0;e<c.length;e++)await t.put(c[e].event,JSON.stringify(c[e]));await t.close()}))}catch(e){console.log(e)}a=await i._getAllDBEvents()}if(void 0!==e.scope){let t=[];for(let n=0;n<a.length;n++)a[n].scope==e.scope&&t.push(a[n]);a=t}return a},this.disaggregationElectricity=async function(e,n,i,s){let a="";if(null!=s)for(const[e,t]of Object.entries(s))a+="&"+e+"="+encodeURIComponent(t);return(await r({method:"GET",url:t+"rapidapi/dispatchcert?zip="+e+"&wh="+n+"&product="+i+a,headers:o})).data},this.balance=async function(e){void 0!==e&&null!=e||(e={});let s=null;if("undefined"!=typeof window){if(s=window.localStorage.getItem("co2balance"),null!==s)try{s=JSON.parse(s)}catch(e){console.debug(e)}}else{const t=n(5747);try{let e=JSON.parse(t.readFileSync(".co2account.json"));void 0!==e.balance&&(s=e.balance)}catch(e){s=null}}if(void 0!==e.forceReload||null==s){let n=(new Date).getTime()+"_"+Math.random();const a=await r({method:"GET",url:t+"rapidapi/balanceOf?nonece="+n,headers:o,params:e});i._forceBalanceReload=(new Date).getTime()+i.EVENTRELOAD,s=a.data,"undefined"!=typeof window&&window.localStorage.setItem("co2balance",JSON.stringify(s))}return s},this.settleEvent=async function(e){const n=await r({method:"POST",url:t+"rapidapi/co2event",headers:o,data:e});return i._forceEventReload=0,n.data},this.createAccount=async function(e){const n=await r({method:"POST",url:t+"co2/createAccount",headers:o,data:e});return i._forceEventReload=0,n.data},this.addMeter=async function(e){const n=await r({method:"POST",url:t+"co2/addMeter",headers:o,data:e});return i._forceEventReload=0,n.data},this.listMeters=async function(){return(await r({method:"GET",url:t+"co2/listMeters",headers:o})).data},this.addMeteredReading=async function(e){const n=await r({method:"POST",url:t+"co2/addMeteredReading",headers:o,data:e});return i._forceEventReload=0,n.data},this.creditVoucher=async function(e){const n=await r({method:"POST",url:t+"rapidapi/voucher",headers:o,data:{code:e}});return i._forceEventReload=0,n.data},this.certificates=async function(){let e=!0,s=[],a=[],c={};try{s=await i._getAllCertificates();let t=0;for(let e=0;e<s.length;e++)s[e].timeStamp>t&&(t=s[e].timeStamp);i._forceEventReload>(new Date).getTime()&&s.length>0?e=!1:c.timestamp=1*t}catch(e){console.log("Certificate Cache Error",e)}if(e){try{const e=await r({method:"GET",url:t+"rapidapi/certificates",headers:o});a=e.data,i._forceCertificateReload=(new Date).getTime()+i.EVENTRELOAD,i.isOnline=!0}catch(e){i.isOnline=!1}try{if("undefined"!=typeof window&&window.indexedDB){const e=window.indexedDB.open("co2certificates",1);e.onupgradeneeded=function(e){e.target.result.createObjectStore("certificates",{keyPath:"compensation"})},e.onsuccess=function(e){const t=e.target.result.transaction("certificates","readwrite").objectStore("certificates");for(let e=0;e<a.length;e++)t.add(a[e])},window.localStorage.setItem("nextCertificateReload",i._forceCertificateReload)}else n(1275)("co2certificates",{createIfMissing:!0},(async function(e,t){for(let e=0;e<a.length;e++)t.put(a[e].compensation,JSON.stringify(a[e]))}))}catch(e){console.debug(e)}s=await i._getAllCertificates()}return s},this.allow=async function(e,n){return(await r({method:"POST",url:t+"rapidapi/allowSender",headers:o,data:{sender:e,allow:n}})).data},this.transfer=async function(e,n){const s=await r({method:"POST",url:t+"rapidapi/transfer",headers:o,data:{event:e,to:n}});return i._forceEventReload=0,s.data},this.whoami=async function(){if(void 0!==i._iam)return i._iam;{let e="";try{if("undefined"!=typeof window)e=window.localStorage.getItem("co2account");else try{const t=n(5747);let r=JSON.parse(t.readFileSync(".co2account.json"));void 0!==r.account&&(e=r.account)}catch(t){e=null}if(void 0===e||null==e||e.length<2)if(e=(await r({method:"GET",url:t+"rapidapi/whoami",headers:o})).data.account,"undefined"!=typeof window)window.localStorage.setItem("co2account",e);else{const t=n(5747);try{t.writeFileSync(".co2account.json",JSON.stringify({account:e}))}catch(e){console.debug(e)}}return i._iam=e,e}catch(e){console.debug(e)}}}}},8508:(e,t,n)=>{"use strict";const r=Object.freeze({});function o(e){if("object"!=typeof e||null===e)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=e,this._operations=[],this._written=!1}o.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},o.prototype.put=function(e,t,n){this._checkWritten();const o=this.db._checkKey(e)||this.db._checkValue(t);if(o)throw o;return e=this.db._serializeKey(e),t=this.db._serializeValue(t),this._put(e,t,null!=n?n:r),this},o.prototype._put=function(e,t,n){this._operations.push({...n,type:"put",key:e,value:t})},o.prototype.del=function(e,t){this._checkWritten();const n=this.db._checkKey(e);if(n)throw n;return e=this.db._serializeKey(e),this._del(e,null!=t?t:r),this},o.prototype._del=function(e,t){this._operations.push({...t,type:"del",key:e})},o.prototype.clear=function(){return this._checkWritten(),this._clear(),this},o.prototype._clear=function(){this._operations=[]},o.prototype.write=function(e,t){if(this._checkWritten(),"function"==typeof e&&(t=e),"function"!=typeof t)throw new Error("write() requires a callback argument");"object"==typeof e&&null!==e||(e={}),this._written=!0,this._write(e,t)},o.prototype._write=function(e,t){this.db._batch(this._operations,e,t)},o.prototype._nextTick=n(8920),e.exports=o},3538:(e,t,n)=>{"use strict";function r(e){if("object"!=typeof e||null===e)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=e,this._ended=!1,this._nexting=!1}r.prototype.next=function(e){let t=this;if(void 0===e)t=new Promise((function(t,n){e=function(e,r,o){e?n(e):void 0===r&&void 0===o?t():t([r,o])}}));else if("function"!=typeof e)throw new Error("next() requires a callback argument");return this._ended?(this._nextTick(e,new Error("cannot call next() after end()")),t):this._nexting?(this._nextTick(e,new Error("cannot call next() before previous next() has completed")),t):(this._nexting=!0,this._next((t,...n)=>{this._nexting=!1,e(t,...n)}),t)},r.prototype._next=function(e){this._nextTick(e)},r.prototype.seek=function(e){if(this._ended)throw new Error("cannot call seek() after end()");if(this._nexting)throw new Error("cannot call seek() before next() has completed");e=this.db._serializeKey(e),this._seek(e)},r.prototype._seek=function(e){},r.prototype.end=function(e){let t;if(void 0===e)t=new Promise((function(t,n){e=function(e){e?n(e):t()}}));else if("function"!=typeof e)throw new Error("end() requires a callback argument");return this._ended?(this._nextTick(e,new Error("end() already called on iterator")),t):(this._ended=!0,this._end(e),t)},r.prototype._end=function(e){this._nextTick(e)},r.prototype[Symbol.asyncIterator]=async function*(){try{let e;for(;void 0!==(e=await this.next());)yield e}finally{this._ended||await this.end()}},r.prototype._nextTick=n(8920),e.exports=r},2554:(e,t,n)=>{"use strict";const r=n(1675),o=n(8738),i=n(6957),s=n(3538),a=n(8508),c=n(70).R,u=n(70).F,l=Object.prototype.hasOwnProperty,f=["lt","lte","gt","gte"];function h(e){this.status="new",this.supports=r(e,{status:!0})}function d(e,t){const n={};for(const r in t){if(!l.call(t,r))continue;if("start"===r||"end"===r)throw new Error('Legacy range options ("start" and "end") have been removed');let o=t[r];p(r)&&(o=e._serializeKey(o)),n[r]=o}return n}function p(e){return-1!==f.indexOf(e)}h.prototype.open=function(e,t){const n=this.status;if("function"==typeof e&&(t=e),"function"!=typeof t)throw new Error("open() requires a callback argument");"object"==typeof e&&null!==e||(e={}),e.createIfMissing=!1!==e.createIfMissing,e.errorIfExists=!!e.errorIfExists,this.status="opening",this._open(e,e=>{if(e)return this.status=n,t(e);this.status="open",t()})},h.prototype._open=function(e,t){this._nextTick(t)},h.prototype.close=function(e){const t=this.status;if("function"!=typeof e)throw new Error("close() requires a callback argument");this.status="closing",this._close(n=>{if(n)return this.status=t,e(n);this.status="closed",e()})},h.prototype._close=function(e){this._nextTick(e)},h.prototype.get=function(e,t,n){if("function"==typeof t&&(n=t),"function"!=typeof n)throw new Error("get() requires a callback argument");const r=this._checkKey(e);if(r)return this._nextTick(n,r);e=this._serializeKey(e),"object"==typeof t&&null!==t||(t={}),t.asBuffer=!1!==t.asBuffer,this._get(e,t,n)},h.prototype._get=function(e,t,n){this._nextTick((function(){n(new Error("NotFound"))}))},h.prototype.getMany=function(e,t,n){if(n=c(t,n),n=i.fromCallback(n),t=u(t),function(e,t){return!e.isOperational()&&(e._nextTick(t,new Error("Database is not open")),!0)}(this,n))return n.promise;if(!Array.isArray(e))return this._nextTick(n,new Error("getMany() requires an array argument")),n.promise;if(0===e.length)return this._nextTick(n,null,[]),n.promise;"boolean"!=typeof t.asBuffer&&(t={...t,asBuffer:!0});const r=new Array(e.length);for(let t=0;t<e.length;t++){const o=e[t],i=this._checkKey(o);if(i)return this._nextTick(n,i),n.promise;r[t]=this._serializeKey(o)}return this._getMany(r,t,n),n.promise},h.prototype._getMany=function(e,t,n){this._nextTick(n,null,new Array(e.length).fill(void 0))},h.prototype.put=function(e,t,n,r){if("function"==typeof n&&(r=n),"function"!=typeof r)throw new Error("put() requires a callback argument");const o=this._checkKey(e)||this._checkValue(t);if(o)return this._nextTick(r,o);e=this._serializeKey(e),t=this._serializeValue(t),"object"==typeof n&&null!==n||(n={}),this._put(e,t,n,r)},h.prototype._put=function(e,t,n,r){this._nextTick(r)},h.prototype.del=function(e,t,n){if("function"==typeof t&&(n=t),"function"!=typeof n)throw new Error("del() requires a callback argument");const r=this._checkKey(e);if(r)return this._nextTick(n,r);e=this._serializeKey(e),"object"==typeof t&&null!==t||(t={}),this._del(e,t,n)},h.prototype._del=function(e,t,n){this._nextTick(n)},h.prototype.batch=function(e,t,n){if(!arguments.length)return this._chainedBatch();if("function"==typeof t&&(n=t),"function"==typeof e&&(n=e),"function"!=typeof n)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(e))return this._nextTick(n,new Error("batch(array) requires an array argument"));if(0===e.length)return this._nextTick(n);"object"==typeof t&&null!==t||(t={});const r=new Array(e.length);for(let t=0;t<e.length;t++){if("object"!=typeof e[t]||null===e[t])return this._nextTick(n,new Error("batch(array) element must be an object and not `null`"));const o=Object.assign({},e[t]);if("put"!==o.type&&"del"!==o.type)return this._nextTick(n,new Error("`type` must be 'put' or 'del'"));const i=this._checkKey(o.key);if(i)return this._nextTick(n,i);if(o.key=this._serializeKey(o.key),"put"===o.type){const e=this._checkValue(o.value);if(e)return this._nextTick(n,e);o.value=this._serializeValue(o.value)}r[t]=o}this._batch(r,t,n)},h.prototype._batch=function(e,t,n){this._nextTick(n)},h.prototype.clear=function(e,t){if("function"==typeof e)t=e;else if("function"!=typeof t)throw new Error("clear() requires a callback argument");(e=d(this,e)).reverse=!!e.reverse,e.limit="limit"in e?e.limit:-1,this._clear(e,t)},h.prototype._clear=function(e,t){e.keys=!0,e.values=!1,e.keyAsBuffer=!0,e.valueAsBuffer=!0;const n=this._iterator(e),r={},o=e=>{if(e)return n.end((function(){t(e)}));n.next((e,i)=>e?o(e):void 0===i?n.end(t):void this._del(i,r,o))};o()},h.prototype._setupIteratorOptions=function(e){return(e=d(this,e)).reverse=!!e.reverse,e.keys=!1!==e.keys,e.values=!1!==e.values,e.limit="limit"in e?e.limit:-1,e.keyAsBuffer=!1!==e.keyAsBuffer,e.valueAsBuffer=!1!==e.valueAsBuffer,e},h.prototype.iterator=function(e){return"object"==typeof e&&null!==e||(e={}),e=this._setupIteratorOptions(e),this._iterator(e)},h.prototype._iterator=function(e){return new s(this)},h.prototype._chainedBatch=function(){return new a(this)},h.prototype._serializeKey=function(e){return e},h.prototype._serializeValue=function(e){return e},h.prototype._checkKey=function(e){return null==e?new Error("key cannot be `null` or `undefined`"):o(e)&&0===e.length?new Error("key cannot be an empty Buffer"):""===e?new Error("key cannot be an empty String"):Array.isArray(e)&&0===e.length?new Error("key cannot be an empty Array"):void 0},h.prototype._checkValue=function(e){if(null==e)return new Error("value cannot be `null` or `undefined`")},h.prototype.isOperational=function(){return"open"===this.status||this._isOperational()},h.prototype._isOperational=function(){return!1},h.prototype._nextTick=n(8920),e.exports=h},4012:(e,t,n)=>{"use strict";t.AbstractLevelDOWN=n(2554),t.AbstractIterator=n(3538),t.AbstractChainedBatch=n(8508)},70:(e,t)=>{"use strict";t.R=function(e,t){return"function"==typeof e?e:t},t.F=function(e){return"object"==typeof e&&null!==e?e:{}}},8920:e=>{"use strict";e.exports=process.nextTick},9669:(e,t,n)=>{e.exports=n(1609)},7970:(e,t,n)=>{"use strict";var r=n(4867),o=n(6026),i=n(4097),s=n(5327),a=n(8605),c=n(7211),u=n(938).http,l=n(938).https,f=n(8835),h=n(8761),d=n(7288).version,p=n(5061),y=n(481),b=n(5655),g=n(5263),m=/https:?/;e.exports=function(e){return new Promise((function(t,n){var w;function v(){e.cancelToken&&e.cancelToken.unsubscribe(w),e.signal&&e.signal.removeEventListener("abort",w)}var _=function(e){v(),t(e)},E=function(e){v(),n(e)},x=e.data,S=e.headers,R={};if(Object.keys(S).forEach((function(e){R[e.toLowerCase()]=e})),"user-agent"in R?S[R["user-agent"]]||delete S[R["user-agent"]]:S["User-Agent"]="axios/"+d,x&&!r.isStream(x)){if(Buffer.isBuffer(x));else if(r.isArrayBuffer(x))x=Buffer.from(new Uint8Array(x));else{if(!r.isString(x))return E(p("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",e));x=Buffer.from(x,"utf-8")}R["content-length"]||(S["Content-Length"]=x.length)}var k=void 0;e.auth&&(k=(e.auth.username||"")+":"+(e.auth.password||""));var O=i(e.baseURL,e.url),C=f.parse(O),T=C.protocol||"http:";if(!k&&C.auth){var A=C.auth.split(":");k=(A[0]||"")+":"+(A[1]||"")}k&&R.authorization&&delete S[R.authorization];var j=m.test(T),M=j?e.httpsAgent:e.httpAgent,N={path:s(C.path,e.params,e.paramsSerializer).replace(/^\?/,""),method:e.method.toUpperCase(),headers:S,agent:M,agents:{http:e.httpAgent,https:e.httpsAgent},auth:k};e.socketPath?N.socketPath=e.socketPath:(N.hostname=C.hostname,N.port=C.port);var L,P=e.proxy;if(!P&&!1!==P){var B=T.slice(0,-1)+"_proxy",D=process.env[B]||process.env[B.toUpperCase()];if(D){var F=f.parse(D),I=process.env.no_proxy||process.env.NO_PROXY,q=!0;if(I&&(q=!I.split(",").map((function(e){return e.trim()})).some((function(e){return!!e&&("*"===e||"."===e[0]&&C.hostname.substr(C.hostname.length-e.length)===e||C.hostname===e)}))),q&&(P={host:F.hostname,port:F.port,protocol:F.protocol},F.auth)){var U=F.auth.split(":");P.auth={username:U[0],password:U[1]}}}}P&&(N.headers.host=C.hostname+(C.port?":"+C.port:""),function e(t,n,r){if(t.hostname=n.host,t.host=n.host,t.port=n.port,t.path=r,n.auth){var o=Buffer.from(n.auth.username+":"+n.auth.password,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+o}t.beforeRedirect=function(t){t.headers.host=t.host,e(t,n,t.href)}}(N,P,T+"//"+C.hostname+(C.port?":"+C.port:"")+N.path));var z=j&&(!P||m.test(P.protocol));e.transport?L=e.transport:0===e.maxRedirects?L=z?c:a:(e.maxRedirects&&(N.maxRedirects=e.maxRedirects),L=z?l:u),e.maxBodyLength>-1&&(N.maxBodyLength=e.maxBodyLength),e.insecureHTTPParser&&(N.insecureHTTPParser=e.insecureHTTPParser);var W=L.request(N,(function(t){if(!W.aborted){var n=t,i=t.req||W;if(204!==t.statusCode&&"HEAD"!==i.method&&!1!==e.decompress)switch(t.headers["content-encoding"]){case"gzip":case"compress":case"deflate":n=n.pipe(h.createUnzip()),delete t.headers["content-encoding"]}var s={status:t.statusCode,statusText:t.statusMessage,headers:t.headers,config:e,request:i};if("stream"===e.responseType)s.data=n,o(_,E,s);else{var a=[],c=0;n.on("data",(function(t){a.push(t),c+=t.length,e.maxContentLength>-1&&c>e.maxContentLength&&(n.destroy(),E(p("maxContentLength size of "+e.maxContentLength+" exceeded",e,null,i)))})),n.on("error",(function(t){W.aborted||E(y(t,e,null,i))})),n.on("end",(function(){var t=Buffer.concat(a);"arraybuffer"!==e.responseType&&(t=t.toString(e.responseEncoding),e.responseEncoding&&"utf8"!==e.responseEncoding||(t=r.stripBOM(t))),s.data=t,o(_,E,s)}))}}}));if(W.on("error",(function(t){W.aborted&&"ERR_FR_TOO_MANY_REDIRECTS"!==t.code||E(y(t,e,null,W))})),e.timeout){var V=parseInt(e.timeout,10);if(isNaN(V))return void E(p("error trying to parse `config.timeout` to int",e,"ERR_PARSE_TIMEOUT",W));W.setTimeout(V,(function(){W.abort();var t=e.transitional||b.transitional;E(p("timeout of "+V+"ms exceeded",e,t.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",W))}))}(e.cancelToken||e.signal)&&(w=function(e){W.aborted||(W.abort(),E(!e||e&&e.type?new g("canceled"):e))},e.cancelToken&&e.cancelToken.subscribe(w),e.signal&&(e.signal.aborted?w():e.signal.addEventListener("abort",w))),r.isStream(x)?x.on("error",(function(t){E(y(t,e,null,W))})).pipe(W):W.end(x)}))}},5448:(e,t,n)=>{"use strict";var r=n(4867),o=n(6026),i=n(4372),s=n(5327),a=n(4097),c=n(4109),u=n(7985),l=n(5061),f=n(5655),h=n(5263);e.exports=function(e){return new Promise((function(t,n){var d,p=e.data,y=e.headers,b=e.responseType;function g(){e.cancelToken&&e.cancelToken.unsubscribe(d),e.signal&&e.signal.removeEventListener("abort",d)}r.isFormData(p)&&delete y["Content-Type"];var m=new XMLHttpRequest;if(e.auth){var w=e.auth.username||"",v=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";y.Authorization="Basic "+btoa(w+":"+v)}var _=a(e.baseURL,e.url);function E(){if(m){var r="getAllResponseHeaders"in m?c(m.getAllResponseHeaders()):null,i={data:b&&"text"!==b&&"json"!==b?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m};o((function(e){t(e),g()}),(function(e){n(e),g()}),i),m=null}}if(m.open(e.method.toUpperCase(),s(_,e.params,e.paramsSerializer),!0),m.timeout=e.timeout,"onloadend"in m?m.onloadend=E:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(E)},m.onabort=function(){m&&(n(l("Request aborted",e,"ECONNABORTED",m)),m=null)},m.onerror=function(){n(l("Network Error",e,null,m)),m=null},m.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||f.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",m)),m=null},r.isStandardBrowserEnv()){var x=(e.withCredentials||u(_))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;x&&(y[e.xsrfHeaderName]=x)}"setRequestHeader"in m&&r.forEach(y,(function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete y[t]:m.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(m.withCredentials=!!e.withCredentials),b&&"json"!==b&&(m.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&m.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&m.upload&&m.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(d=function(e){m&&(n(!e||e&&e.type?new h("canceled"):e),m.abort(),m=null)},e.cancelToken&&e.cancelToken.subscribe(d),e.signal&&(e.signal.aborted?d():e.signal.addEventListener("abort",d))),p||(p=null),m.send(p)}))}},1609:(e,t,n)=>{"use strict";var r=n(4867),o=n(1849),i=n(321),s=n(7185),a=function e(t){var n=new i(t),a=o(i.prototype.request,n);return r.extend(a,i.prototype,n),r.extend(a,n),a.create=function(n){return e(s(t,n))},a}(n(5655));a.Axios=i,a.Cancel=n(5263),a.CancelToken=n(4972),a.isCancel=n(6502),a.VERSION=n(7288).version,a.all=function(e){return Promise.all(e)},a.spread=n(8713),a.isAxiosError=n(6268),e.exports=a,e.exports.default=a},5263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4972:(e,t,n)=>{"use strict";var r=n(5263);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t<r;t++)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},o.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},6502:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,n)=>{"use strict";var r=n(4867),o=n(5327),i=n(782),s=n(3572),a=n(7185),c=n(4875),u=c.validators;function l(e){this.defaults=e,this.interceptors={request:new i,response:new i}}l.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&c.assertOptions(t,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var n=[],r=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var o,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!r){var l=[s,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(i),o=Promise.resolve(e);l.length;)o=o.then(l.shift(),l.shift());return o}for(var f=e;n.length;){var h=n.shift(),d=n.shift();try{f=h(f)}catch(e){d(e);break}}try{o=s(f)}catch(e){return Promise.reject(e)}for(;i.length;)o=o.then(i.shift(),i.shift());return o},l.prototype.getUri=function(e){return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,n){return this.request(a(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,r){return this.request(a(r||{},{method:e,url:t,data:n}))}})),e.exports=l},782:(e,t,n)=>{"use strict";var r=n(4867);function o(){this.handlers=[]}o.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},4097:(e,t,n)=>{"use strict";var r=n(1793),o=n(7303);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},5061:(e,t,n)=>{"use strict";var r=n(481);e.exports=function(e,t,n,o,i){var s=new Error(e);return r(s,t,n,o,i)}},3572:(e,t,n)=>{"use strict";var r=n(4867),o=n(8527),i=n(6502),s=n(5655),a=n(5263);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a("canceled")}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return c(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(c(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},7185:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){t=t||{};var n={};function o(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function i(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(e[n],t[n])}function s(e){if(!r.isUndefined(t[e]))return o(void 0,t[e])}function a(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(void 0,t[n])}function c(n){return n in t?o(e[n],t[n]):n in e?o(void 0,e[n]):void 0}var u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c};return r.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||i,o=t(e);r.isUndefined(o)&&t!==c||(n[e]=o)})),n}},6026:(e,t,n)=>{"use strict";var r=n(5061);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},8527:(e,t,n)=>{"use strict";var r=n(4867),o=n(5655);e.exports=function(e,t,n){var i=this||o;return r.forEach(n,(function(n){e=n.call(i,e,t)})),e}},5655:(e,t,n)=>{"use strict";var r=n(4867),o=n(6016),i=n(481),s={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:("undefined"!=typeof XMLHttpRequest?c=n(5448):"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)&&(c=n(7970)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(a(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(0,JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||u.transitional,n=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,s=!n&&"json"===this.responseType;if(s||o&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(s)})),e.exports=u},7288:e=>{e.exports={version:"0.23.0"}},1849:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},5327:(e,t,n)=>{"use strict";var r=n(4867);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var s=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),s.push(o(t)+"="+o(e))})))})),i=s.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},7303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,s){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},6268:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},7985:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},6016:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},4109:(e,t,n)=>{"use strict";var r=n(4867),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,s={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(s[t]&&o.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},8713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4875:(e,t,n)=>{"use strict";var r=n(7288).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var i={};o.transitional=function(e,t,n){function o(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,s){if(!1===e)throw new Error(o(r," has been removed"+(t?" in "+t:"")));return t&&!i[r]&&(i[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,s)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],s=t[i];if(s){var a=e[i],c=void 0===a||s(a,i,e);if(!0!==c)throw new TypeError("option "+i+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:o}},4867:(e,t,n)=>{"use strict";var r=n(1849),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===o.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:c,isUndefined:s,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:u,isStream:function(e){return a(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:l,merge:function e(){var t={};function n(n,r){c(t[r])&&c(n)?t[r]=e(t[r],n):c(n)?t[r]=e({},n):i(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)l(arguments[r],n);return t},extend:function(e,t,n){return l(t,(function(t,o){e[o]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},6957:(e,t,n)=>{"use strict";var r=n(3522);t.fromCallback=function(e,t){if(void 0===e){var n=new Promise((function(t,n){e=function(e,r){e?n(e):t(r)}}));e[void 0!==t?t:"promise"]=n}else if("function"!=typeof e)throw new TypeError("Callback must be a function");return e},t.fromPromise=function(e,t){if(void 0===t)return e;e.then((function(e){r(()=>t(null,e))})).catch((function(e){r(()=>t(e))}))}},9435:e=>{var t=1e3,n=6e4,r=60*n,o=24*r;function i(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,s){s=s||{};var a,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var i=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(i){var s=parseFloat(i[1]);switch((i[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*o;case"hours":case"hour":case"hrs":case"hr":case"h":return s*r;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===u&&isFinite(e))return s.long?(a=e,(c=Math.abs(a))>=o?i(a,c,o,"day"):c>=r?i(a,c,r,"hour"):c>=n?i(a,c,n,"minute"):c>=t?i(a,c,t,"second"):a+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=r?Math.round(e/r)+"h":i>=n?Math.round(e/n)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},1227:(e,t,n)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))}),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(2447)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},2447:(e,t,n)=>{e.exports=function(e){function t(e){let n,o,i,s=null;function a(...e){if(!a.enabled)return;const r=a,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,o)=>{if("%%"===n)return"%";s++;const i=t.formatters[o];if("function"==typeof i){const t=e[s];n=i.call(r,t),e.splice(s,1),s--}return n}),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(9435),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},5158:(e,t,n)=>{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=n(1227):e.exports=n(39)},39:(e,t,n)=>{const r=n(3867),o=n(1669);t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(o.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:o}=this;if(o){const t=this.color,o="[3"+(t<8?t:"8;5;"+t),i=` ${o};1m${r} `;n[0]=i+n[0].split("\n").join("\n"+i),n.push(o+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=(t.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):r.isatty(process.stderr.fd)},t.destroy=o.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=n(2130);e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e},{}),e.exports=n(2447)(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts)}},7171:(e,t,n)=>{"use strict";const{AbstractChainedBatch:r}=n(4012),o=Symbol("operations");e.exports=class extends r{constructor(e){super(e),this[o]=[]}_put(e,t,n){this[o].push({...n,type:"put",key:e,value:t})}_del(e,t){this[o].push({...t,type:"del",key:e})}_clear(){this[o]=[]}_write(e,t){this.db.batch(this[o],e,t)}}},2790:(e,t,n)=>{"use strict";const{AbstractIterator:r}=n(4012),o=n(4378),i=n(2502).R,s=Symbol("options"),a=Symbol("iterator"),c=Symbol("operations"),u=Symbol("promise");function l(e,t){r.call(this,e),this[s]=t,this[a]=null,this[c]=[]}o(l,r),l.prototype.setDb=function(e){this[a]=e.iterator(this[s]);for(const e of this[c].splice(0,this[c].length))this[a][e.method](...e.args)},l.prototype.next=function(...e){if("open"===this.db.status)return this[a].next(...e);const t=i(e,u,(function(e,t){return void 0===e&&void 0===t?void 0:[e,t]}));return"opening"===this.db.status?this[c].push({method:"next",args:e}):this._nextTick(t,new Error("Database is not open")),t[u]||this},l.prototype.seek=function(...e){if("open"===this.db.status)this[a].seek(...e);else{if("opening"!==this.db.status)throw new Error("Database is not open");this[c].push({method:"seek",args:e})}},l.prototype.end=function(...e){if("open"===this.db.status)return this[a].end(...e);const t=i(e,u);return"opening"===this.db.status?this[c].push({method:"end",args:e}):this._nextTick(t,new Error("Database is not open")),t[u]||this};for(const e of["next","seek","end"])l.prototype["_"+e]=function(){throw new Error("Did not expect private method to be called: "+e)};e.exports=l},6944:(e,t,n)=>{"use strict";const{AbstractLevelDOWN:r}=n(4012),o=n(4378),i=n(2790),s=n(7171),a=n(2502).R,c=["put","get","getMany","del","batch","clear"],u=["approximateSize","compactRange"],l=Symbol("innerDb"),f=Symbol("operations"),h=Symbol("promise");function d(e){r.call(this,e.supports||{});for(const t of u)"function"!=typeof e[t]||this.supports.additionalMethods[t]||(this.supports.additionalMethods[t]=!0);this[l]=e,this[f]=[],function(e){const t=Object.keys(e.supports.additionalMethods);for(const n of c.concat(t))e[n]=function(...e){if("batch"===n&&0===e.length)return new s(this);if("open"===this.status)return this[l][n](...e);const t=a(e,h);return"opening"===this.status?this[f].push({method:n,args:e}):this._nextTick(t,new Error("Database is not open")),t[h]};e.iterator=function(e){if("open"===this.status)return this[l].iterator(e);if("opening"===this.status){const t=new i(this,e);return this[f].push({iterator:t}),t}throw new Error("Database is not open")};for(const t of c.concat(["iterator"]))e["_"+t]=function(){throw new Error("Did not expect private met