telegram-tt/dist/313.8a2407b28699bf5c67c8.js
Alexander Zinchuk 7d1591ee86 [Build]
2022-02-02 22:56:06 +01:00

3 lines
68 KiB
JavaScript

/*! For license information please see 313.8a2407b28699bf5c67c8.js.LICENSE.txt */
(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[313],{8136:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>w,CTR:()=>d,IGE:()=>v});var n=new Uint8Array(256),o=new Uint8Array(256),i=new Uint32Array(256),u=new Uint32Array(256),s=new Uint32Array(256),a=new Uint32Array(256),f=new Uint32Array(256),c=new Uint32Array(256),p=new Uint32Array(256),l=new Uint32Array(256);function h(t){if(t instanceof Uint32Array)return t;if("string"==typeof t){if(t.length%4!=0)for(var e=t.length%4;e<=4;e++)t+="\0x00";var r=new Uint32Array(t.length/4);for(e=0;e<t.length;e+=4)r[e/4]=(o=e,(n=t).charCodeAt(o)<<24^n.charCodeAt(o+1)<<16^n.charCodeAt(o+2)<<8^n.charCodeAt(o+3));return r}var n,o;if(t instanceof Uint8Array){for(r=new Uint32Array(t.length/4),e=0;e<t.length;e+=4)r[e/4]=t[e]<<24^t[e+1]<<16^t[e+2]<<8^t[e+3];return r}throw new Error("Unable to create 32-bit words")}function y(t,e,r){void 0===r&&(r=t);for(var n=0;n<t.length;n++)r[n]=t[n]^e[n]}!function(){for(var t,e,r,h,y,g=new Uint8Array(256),v=new Uint8Array(256),d=0,w=0,b=0;b<256;b++)g[b]=b<<1^283*(b>>7),v[g[b]^b]=b;for(;!n[d];d^=t||1)r=(r=w^w<<1^w<<2^w<<3^w<<4)>>8^255&r^99,n[d]=r,o[r]=d,y=16843009*g[e=g[t=g[d]]]^65537*e^257*t^16843008*d,h=257*g[r]^16843008*r,i[d]=h=h<<24^h>>>8,u[d]=h=h<<24^h>>>8,s[d]=h=h<<24^h>>>8,a[d]=h=h<<24^h>>>8,f[r]=y=y<<24^y>>>8,c[r]=y=y<<24^y>>>8,p[r]=y=y<<24^y>>>8,l[r]=y=y<<24^y>>>8,w=v[w]||1}();var g=function(){function t(t){var e=h(t);if(4!==e.length&&6!==e.length&&8!==e.length)throw new Error("Invalid key size");this.encKey=new Uint32Array(4*e.length+28),this.decKey=new Uint32Array(4*e.length+28),this.encKey.set(e);for(var r,o=1,i=e.length;i<4*e.length+28;i++)r=this.encKey[i-1],(i%e.length==0||8===e.length&&i%e.length==4)&&(r=n[r>>>24]<<24^n[r>>16&255]<<16^n[r>>8&255]<<8^n[255&r],i%e.length==0&&(r=r<<8^r>>>24^o<<24,o=o<<1^283*(o>>7))),this.encKey[i]=this.encKey[i-e.length]^r;for(var u=0;i;u++,i--)r=this.encKey[3&u?i:i-4],this.decKey[u]=i<=4||u<4?r:f[n[r>>>24]]^c[n[r>>16&255]]^p[n[r>>8&255]]^l[n[255&r]]}return t.prototype.encrypt=function(t){for(var e,r,o,f=h(t),c=new Uint32Array(4),p=f[0]^this.encKey[0],l=f[1]^this.encKey[1],y=f[2]^this.encKey[2],g=f[3]^this.encKey[3],v=this.encKey.length/4-2,d=4,w=0;w<v;w++)e=i[p>>>24]^u[l>>16&255]^s[y>>8&255]^a[255&g]^this.encKey[d],r=i[l>>>24]^u[y>>16&255]^s[g>>8&255]^a[255&p]^this.encKey[d+1],o=i[y>>>24]^u[g>>16&255]^s[p>>8&255]^a[255&l]^this.encKey[d+2],g=i[g>>>24]^u[p>>16&255]^s[l>>8&255]^a[255&y]^this.encKey[d+3],p=e,l=r,y=o,d+=4;for(w=0;w<4;w++)c[w]=n[p>>>24]<<24^n[l>>16&255]<<16^n[y>>8&255]<<8^n[255&g]^this.encKey[d++],e=p,p=l,l=y,y=g,g=e;return c},t.prototype.decrypt=function(t){for(var e,r,n,i=h(t),u=new Uint32Array(4),s=i[0]^this.decKey[0],a=i[3]^this.decKey[1],y=i[2]^this.decKey[2],g=i[1]^this.decKey[3],v=this.decKey.length/4-2,d=4,w=0;w<v;w++)e=f[s>>>24]^c[a>>16&255]^p[y>>8&255]^l[255&g]^this.decKey[d],r=f[a>>>24]^c[y>>16&255]^p[g>>8&255]^l[255&s]^this.decKey[d+1],n=f[y>>>24]^c[g>>16&255]^p[s>>8&255]^l[255&a]^this.decKey[d+2],g=f[g>>>24]^c[s>>16&255]^p[a>>8&255]^l[255&y]^this.decKey[d+3],s=e,a=r,y=n,d+=4;for(w=0;w<4;w++)u[3&-w]=o[s>>>24]<<24^o[a>>16&255]<<16^o[y>>8&255]<<8^o[255&g]^this.decKey[d++],e=s,s=a,a=y,y=g,g=e;return u},t}(),v=function(){function t(t,e,r){void 0===r&&(r=16),this.key=h(t),this.iv=h(e),this.cipher=new g(t),this.blockSize=r/4}return t.prototype.encrypt=function(t,e){for(var r=h(t),n=e||new Uint32Array(r.length),o=this.iv.subarray(this.blockSize,this.iv.length),i=this.iv.subarray(0,this.blockSize),u=new Uint32Array(this.blockSize),s=0;s<r.length;s+=this.blockSize){var a=r.subarray(s,s+this.blockSize);y(a,i,u);var f=this.cipher.encrypt(u);y(f,o),o=a,i=f;for(var c=s,p=0;c<r.length&&p<4;c++,p++)n[c]=f[p]}return n},t.prototype.decrypt=function(t,e){for(var r=h(t),n=e||new Uint32Array(r.length),o=this.iv.subarray(this.blockSize,this.iv.length),i=this.iv.subarray(0,this.blockSize),u=new Uint32Array(this.blockSize),s=0;s<n.length;s+=this.blockSize){var a=r.subarray(s,s+this.blockSize);y(a,o,u);var f=this.cipher.decrypt(u);y(f,i),i=a,o=f;for(var c=s,p=0;c<n.length&&p<4;c++,p++)n[c]=f[p]}return n},t}(),d=function(){function t(t,e,r){if(void 0===r&&(r=16),this.offset=0,this.key=h(t),this.counter=h(e),this.cipher=new g(t),this.blockSize=r/4,4!==this.counter.length)throw new Error("AES-CTR mode counter must be 16 bytes length")}return t.prototype.encrypt=function(t,e){for(var r=h(t),n=e||new Uint32Array(r.length),o=this.offset,i=0;i<r.length;i+=this.blockSize){for(var u=this.cipher.encrypt(this.counter),s=i,a=o;s<r.length&&a<this.blockSize;s++,a++)n[s]=u[a]^r[s];r.length-i>=this.blockSize&&this.incrementCounter(),o&&(i-=o,o=0)}return this.offset=(this.offset+r.length%4)%4,n},t.prototype.decrypt=function(t,e){return this.encrypt(t,e)},t.prototype.incrementCounter=function(){for(var t=this.counter.length-1;t>=0&&!(++this.counter[t]<4294967295);t--);},t}();const w=g},5078:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(655),o=r(2403),i=function(){function t(t){this._semaphore=new o.default(1,t)}return t.prototype.acquire=function(){return(0,n.__awaiter)(this,void 0,void 0,(function(){return(0,n.__generator)(this,(function(t){switch(t.label){case 0:return[4,this._semaphore.acquire()];case 1:return[2,t.sent()[1]]}}))}))},t.prototype.runExclusive=function(t){return this._semaphore.runExclusive((function(){return t()}))},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.waitForUnlock=function(){return this._semaphore.waitForUnlock()},t.prototype.release=function(){this._semaphore.release()},t.prototype.cancel=function(){return this._semaphore.cancel()},t}();e.default=i},2403:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(655),o=r(1764),i=function(){function t(t,e){if(void 0===e&&(e=o.E_CANCELED),this._maxConcurrency=t,this._cancelError=e,this._queue=[],this._waiters=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return t.prototype.acquire=function(){var t=this,e=this.isLocked(),r=new Promise((function(e,r){return t._queue.push({resolve:e,reject:r})}));return e||this._dispatch(),r},t.prototype.runExclusive=function(t){return(0,n.__awaiter)(this,void 0,void 0,(function(){var e,r,o;return(0,n.__generator)(this,(function(n){switch(n.label){case 0:return[4,this.acquire()];case 1:e=n.sent(),r=e[0],o=e[1],n.label=2;case 2:return n.trys.push([2,,4,5]),[4,t(r)];case 3:return[2,n.sent()];case 4:return o(),[7];case 5:return[2]}}))}))},t.prototype.waitForUnlock=function(){return(0,n.__awaiter)(this,void 0,void 0,(function(){var t=this;return(0,n.__generator)(this,(function(e){return this.isLocked()?[2,new Promise((function(e){return t._waiters.push({resolve:e})}))]:[2,Promise.resolve()]}))}))},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailable on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},t.prototype.cancel=function(){var t=this;this._queue.forEach((function(e){return e.reject(t._cancelError)})),this._queue=[]},t.prototype._dispatch=function(){var t=this,e=this._queue.shift();if(e){var r=!1;this._currentReleaser=function(){r||(r=!0,t._value++,t._resolveWaiters(),t._dispatch())},e.resolve([this._value--,this._currentReleaser])}},t.prototype._resolveWaiters=function(){this._waiters.forEach((function(t){return t.resolve()})),this._waiters=[]},t}();e.default=i},1764:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.E_CANCELED=e.E_ALREADY_LOCKED=e.E_TIMEOUT=void 0,e.E_TIMEOUT=new Error("timeout while waiting for mutex to become available"),e.E_ALREADY_LOCKED=new Error("mutex already locked"),e.E_CANCELED=new Error("request for lock canceled")},8125:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tryAcquire=e.withTimeout=e.Semaphore=e.Mutex=void 0;var n=r(655),o=r(5078);Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return o.default}});var i=r(2403);Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return i.default}});var u=r(1960);Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return u.withTimeout}});var s=r(3143);Object.defineProperty(e,"tryAcquire",{enumerable:!0,get:function(){return s.tryAcquire}}),(0,n.__exportStar)(r(1764),e)},3143:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tryAcquire=void 0;var n=r(1764),o=r(1960);e.tryAcquire=function(t,e){return void 0===e&&(e=n.E_ALREADY_LOCKED),(0,o.withTimeout)(t,0,e)}},1960:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=void 0;var n=r(655),o=r(1764);e.withTimeout=function(t,e,r){var i=this;return void 0===r&&(r=o.E_TIMEOUT),{acquire:function(){return new Promise((function(o,u){return(0,n.__awaiter)(i,void 0,void 0,(function(){var i,s,a,f;return(0,n.__generator)(this,(function(n){switch(n.label){case 0:i=!1,s=setTimeout((function(){i=!0,u(r)}),e),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.acquire()];case 2:return a=n.sent(),i?(Array.isArray(a)?a[1]:a)():(clearTimeout(s),o(a)),[3,4];case 3:return f=n.sent(),i||(clearTimeout(s),u(f)),[3,4];case 4:return[2]}}))}))}))},runExclusive:function(t){return(0,n.__awaiter)(this,void 0,void 0,(function(){var e,r;return(0,n.__generator)(this,(function(n){switch(n.label){case 0:e=function(){},n.label=1;case 1:return n.trys.push([1,,7,8]),[4,this.acquire()];case 2:return r=n.sent(),Array.isArray(r)?(e=r[1],[4,t(r[0])]):[3,4];case 3:return[2,n.sent()];case 4:return e=r,[4,t()];case 5:return[2,n.sent()];case 6:return[3,8];case 7:return e(),[7];case 8:return[2]}}))}))},release:function(){t.release()},cancel:function(){return t.cancel()},waitForUnlock:function(){return t.waitForUnlock()},isLocked:function(){return t.isLocked()}}}},9742:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,i=a(t),u=i[0],s=i[1],f=new o(function(t,e,r){return 3*(e+r)/4-r}(0,u,s)),c=0,p=s>0?u-4:u;for(r=0;r<p;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],f[c++]=e>>16&255,f[c++]=e>>8&255,f[c++]=255&e;return 2===s&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,f[c++]=255&e),1===s&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,f[c++]=e>>8&255,f[c++]=255&e),f},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],u=16383,s=0,a=n-o;s<a;s+=u)i.push(f(t,s,s+u>a?a:s+u));return 1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=i.length;u<s;++u)r[u]=i[u],n[i.charCodeAt(u)]=u;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,n){for(var o,i,u=[],s=e;s<n;s+=3)o=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),u.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return u.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},4736:(t,e,r)=>{var n;t=r.nmd(t);var o=function(t){"use strict";var e=1e7,r=9007199254740992,n=l(r),i="0123456789abcdefghijklmnopqrstuvwxyz",u="function"==typeof BigInt;function s(t,e,r,n){return void 0===t?s[0]:void 0===e||10==+e&&!r?V(t):F(t,e,r,n)}function a(t,e){this.value=t,this.sign=e,this.isSmall=!1}function f(t){this.value=t,this.sign=t<0,this.isSmall=!0}function c(t){this.value=t}function p(t){return-r<t&&t<r}function l(t){return t<1e7?[t]:t<1e14?[t%1e7,Math.floor(t/1e7)]:[t%1e7,Math.floor(t/1e7)%1e7,Math.floor(t/1e14)]}function h(t){y(t);var r=t.length;if(r<4&&T(t,n)<0)switch(r){case 0:return 0;case 1:return t[0];case 2:return t[0]+t[1]*e;default:return t[0]+(t[1]+t[2]*e)*e}return t}function y(t){for(var e=t.length;0===t[--e];);t.length=e+1}function g(t){for(var e=new Array(t),r=-1;++r<t;)e[r]=0;return e}function v(t){return t>0?Math.floor(t):Math.ceil(t)}function d(t,r){var n,o,i=t.length,u=r.length,s=new Array(i),a=0,f=e;for(o=0;o<u;o++)a=(n=t[o]+r[o]+a)>=f?1:0,s[o]=n-a*f;for(;o<i;)a=(n=t[o]+a)===f?1:0,s[o++]=n-a*f;return a>0&&s.push(a),s}function w(t,e){return t.length>=e.length?d(t,e):d(e,t)}function b(t,r){var n,o,i=t.length,u=new Array(i),s=e;for(o=0;o<i;o++)n=t[o]-s+r,r=Math.floor(n/s),u[o]=n-r*s,r+=1;for(;r>0;)u[o++]=r%s,r=Math.floor(r/s);return u}function m(t,r){var n,o,i=t.length,u=r.length,s=new Array(i),a=0,f=e;for(n=0;n<u;n++)(o=t[n]-a-r[n])<0?(o+=f,a=1):a=0,s[n]=o;for(n=u;n<i;n++){if(!((o=t[n]-a)<0)){s[n++]=o;break}o+=f,s[n]=o}for(;n<i;n++)s[n]=t[n];return y(s),s}function E(t,r,n){var o,i,u=t.length,s=new Array(u),c=-r,p=e;for(o=0;o<u;o++)i=t[o]+c,c=Math.floor(i/p),i%=p,s[o]=i<0?i+p:i;return"number"==typeof(s=h(s))?(n&&(s=-s),new f(s)):new a(s,n)}function _(t,r){var n,o,i,u,s=t.length,a=r.length,f=g(s+a),c=e;for(i=0;i<s;++i){u=t[i];for(var p=0;p<a;++p)n=u*r[p]+f[i+p],o=Math.floor(n/c),f[i+p]=n-o*c,f[i+p+1]+=o}return y(f),f}function A(t,r){var n,o,i=t.length,u=new Array(i),s=e,a=0;for(o=0;o<i;o++)n=t[o]*r+a,a=Math.floor(n/s),u[o]=n-a*s;for(;a>0;)u[o++]=a%s,a=Math.floor(a/s);return u}function B(t,e){for(var r=[];e-- >0;)r.push(0);return r.concat(t)}function S(t,e){var r=Math.max(t.length,e.length);if(r<=30)return _(t,e);r=Math.ceil(r/2);var n=t.slice(r),o=t.slice(0,r),i=e.slice(r),u=e.slice(0,r),s=S(o,u),a=S(n,i),f=S(w(o,n),w(u,i)),c=w(w(s,B(m(m(f,s),a),r)),B(a,2*r));return y(c),c}function O(t,r,n){return new a(t<e?A(r,t):_(r,l(t)),n)}function I(t){var r,n,o,i,u=t.length,s=g(u+u),a=e;for(o=0;o<u;o++){n=0-(i=t[o])*i;for(var f=o;f<u;f++)r=i*t[f]*2+s[o+f]+n,n=Math.floor(r/a),s[o+f]=r-n*a;s[o+u]=n}return y(s),s}function U(t,e){var r,n,o,i,u=t.length,s=g(u);for(o=0,r=u-1;r>=0;--r)o=(i=1e7*o+t[r])-(n=v(i/e))*e,s[r]=0|n;return[s,0|o]}function P(t,r){var n,o=V(r);if(u)return[new c(t.value/o.value),new c(t.value%o.value)];var i,p=t.value,d=o.value;if(0===d)throw new Error("Cannot divide by zero");if(t.isSmall)return o.isSmall?[new f(v(p/d)),new f(p%d)]:[s[0],t];if(o.isSmall){if(1===d)return[t,s[0]];if(-1==d)return[t.negate(),s[0]];var w=Math.abs(d);if(w<e){i=h((n=U(p,w))[0]);var b=n[1];return t.sign&&(b=-b),"number"==typeof i?(t.sign!==o.sign&&(i=-i),[new f(i),new f(b)]):[new a(i,t.sign!==o.sign),new f(b)]}d=l(w)}var E=T(p,d);if(-1===E)return[s[0],t];if(0===E)return[s[t.sign===o.sign?1:-1],s[0]];n=p.length+d.length<=200?function(t,r){var n,o,i,u,s,a,f,c=t.length,p=r.length,l=e,y=g(r.length),v=r[p-1],d=Math.ceil(l/(2*v)),w=A(t,d),b=A(r,d);for(w.length<=c&&w.push(0),b.push(0),v=b[p-1],o=c-p;o>=0;o--){for(n=l-1,w[o+p]!==v&&(n=Math.floor((w[o+p]*l+w[o+p-1])/v)),i=0,u=0,a=b.length,s=0;s<a;s++)i+=n*b[s],f=Math.floor(i/l),u+=w[o+s]-(i-f*l),i=f,u<0?(w[o+s]=u+l,u=-1):(w[o+s]=u,u=0);for(;0!==u;){for(n-=1,i=0,s=0;s<a;s++)(i+=w[o+s]-l+b[s])<0?(w[o+s]=i+l,i=0):(w[o+s]=i,i=1);u+=i}y[o]=n}return w=U(w,d)[0],[h(y),h(w)]}(p,d):function(t,r){for(var n,o,i,u,s,a=t.length,f=r.length,c=[],p=[],l=e;a;)if(p.unshift(t[--a]),y(p),T(p,r)<0)c.push(0);else{i=p[(o=p.length)-1]*l+p[o-2],u=r[f-1]*l+r[f-2],o>f&&(i=(i+1)*l),n=Math.ceil(i/u);do{if(T(s=A(r,n),p)<=0)break;n--}while(n);c.push(n),p=m(p,s)}return c.reverse(),[h(c),h(p)]}(p,d),i=n[0];var _=t.sign!==o.sign,B=n[1],S=t.sign;return"number"==typeof i?(_&&(i=-i),i=new f(i)):i=new a(i,_),"number"==typeof B?(S&&(B=-B),B=new f(B)):B=new a(B,S),[i,B]}function T(t,e){if(t.length!==e.length)return t.length>e.length?1:-1;for(var r=t.length-1;r>=0;r--)if(t[r]!==e[r])return t[r]>e[r]?1:-1;return 0}function M(t){var e=t.abs();return!e.isUnit()&&(!!(e.equals(2)||e.equals(3)||e.equals(5))||!(e.isEven()||e.isDivisibleBy(3)||e.isDivisibleBy(5))&&(!!e.lesser(49)||void 0))}function x(t,e){for(var r,n,i,u=t.prev(),s=u,a=0;s.isEven();)s=s.divide(2),a++;t:for(n=0;n<e.length;n++)if(!t.lesser(e[n])&&!(i=o(e[n]).modPow(s,t)).isUnit()&&!i.equals(u)){for(r=a-1;0!=r;r--){if((i=i.square().mod(t)).isUnit())return!1;if(i.equals(u))continue t}return!1}return!0}a.prototype=Object.create(s.prototype),f.prototype=Object.create(s.prototype),c.prototype=Object.create(s.prototype),a.prototype.add=function(t){var e=V(t);if(this.sign!==e.sign)return this.subtract(e.negate());var r=this.value,n=e.value;return e.isSmall?new a(b(r,Math.abs(n)),this.sign):new a(w(r,n),this.sign)},a.prototype.plus=a.prototype.add,f.prototype.add=function(t){var e=V(t),r=this.value;if(r<0!==e.sign)return this.subtract(e.negate());var n=e.value;if(e.isSmall){if(p(r+n))return new f(r+n);n=l(Math.abs(n))}return new a(b(n,Math.abs(r)),r<0)},f.prototype.plus=f.prototype.add,c.prototype.add=function(t){return new c(this.value+V(t).value)},c.prototype.plus=c.prototype.add,a.prototype.subtract=function(t){var e=V(t);if(this.sign!==e.sign)return this.add(e.negate());var r=this.value,n=e.value;return e.isSmall?E(r,Math.abs(n),this.sign):function(t,e,r){var n;return T(t,e)>=0?n=m(t,e):(n=m(e,t),r=!r),"number"==typeof(n=h(n))?(r&&(n=-n),new f(n)):new a(n,r)}(r,n,this.sign)},a.prototype.minus=a.prototype.subtract,f.prototype.subtract=function(t){var e=V(t),r=this.value;if(r<0!==e.sign)return this.add(e.negate());var n=e.value;return e.isSmall?new f(r-n):E(n,Math.abs(r),r>=0)},f.prototype.minus=f.prototype.subtract,c.prototype.subtract=function(t){return new c(this.value-V(t).value)},c.prototype.minus=c.prototype.subtract,a.prototype.negate=function(){return new a(this.value,!this.sign)},f.prototype.negate=function(){var t=this.sign,e=new f(-this.value);return e.sign=!t,e},c.prototype.negate=function(){return new c(-this.value)},a.prototype.abs=function(){return new a(this.value,!1)},f.prototype.abs=function(){return new f(Math.abs(this.value))},c.prototype.abs=function(){return new c(this.value>=0?this.value:-this.value)},a.prototype.multiply=function(t){var r,n,o,i=V(t),u=this.value,f=i.value,c=this.sign!==i.sign;if(i.isSmall){if(0===f)return s[0];if(1===f)return this;if(-1===f)return this.negate();if((r=Math.abs(f))<e)return new a(A(u,r),c);f=l(r)}return new a(-.012*(n=u.length)-.012*(o=f.length)+15e-6*n*o>0?S(u,f):_(u,f),c)},a.prototype.times=a.prototype.multiply,f.prototype._multiplyBySmall=function(t){return p(t.value*this.value)?new f(t.value*this.value):O(Math.abs(t.value),l(Math.abs(this.value)),this.sign!==t.sign)},a.prototype._multiplyBySmall=function(t){return 0===t.value?s[0]:1===t.value?this:-1===t.value?this.negate():O(Math.abs(t.value),this.value,this.sign!==t.sign)},f.prototype.multiply=function(t){return V(t)._multiplyBySmall(this)},f.prototype.times=f.prototype.multiply,c.prototype.multiply=function(t){return new c(this.value*V(t).value)},c.prototype.times=c.prototype.multiply,a.prototype.square=function(){return new a(I(this.value),!1)},f.prototype.square=function(){var t=this.value*this.value;return p(t)?new f(t):new a(I(l(Math.abs(this.value))),!1)},c.prototype.square=function(t){return new c(this.value*this.value)},a.prototype.divmod=function(t){var e=P(this,t);return{quotient:e[0],remainder:e[1]}},c.prototype.divmod=f.prototype.divmod=a.prototype.divmod,a.prototype.divide=function(t){return P(this,t)[0]},c.prototype.over=c.prototype.divide=function(t){return new c(this.value/V(t).value)},f.prototype.over=f.prototype.divide=a.prototype.over=a.prototype.divide,a.prototype.mod=function(t){return P(this,t)[1]},c.prototype.mod=c.prototype.remainder=function(t){return new c(this.value%V(t).value)},f.prototype.remainder=f.prototype.mod=a.prototype.remainder=a.prototype.mod,a.prototype.pow=function(t){var e,r,n,o=V(t),i=this.value,u=o.value;if(0===u)return s[1];if(0===i)return s[0];if(1===i)return s[1];if(-1===i)return o.isEven()?s[1]:s[-1];if(o.sign)return s[0];if(!o.isSmall)throw new Error("The exponent "+o.toString()+" is too large.");if(this.isSmall&&p(e=Math.pow(i,u)))return new f(v(e));for(r=this,n=s[1];!0&u&&(n=n.times(r),--u),0!==u;)u/=2,r=r.square();return n},f.prototype.pow=a.prototype.pow,c.prototype.pow=function(t){var e=V(t),r=this.value,n=e.value,o=BigInt(0),i=BigInt(1),u=BigInt(2);if(n===o)return s[1];if(r===o)return s[0];if(r===i)return s[1];if(r===BigInt(-1))return e.isEven()?s[1]:s[-1];if(e.isNegative())return new c(o);for(var a=this,f=s[1];(n&i)===i&&(f=f.times(a),--n),n!==o;)n/=u,a=a.square();return f},a.prototype.modPow=function(t,e){if(t=V(t),(e=V(e)).isZero())throw new Error("Cannot take modPow with modulus 0");var r=s[1],n=this.mod(e);for(t.isNegative()&&(t=t.multiply(s[-1]),n=n.modInv(e));t.isPositive();){if(n.isZero())return s[0];t.isOdd()&&(r=r.multiply(n).mod(e)),t=t.divide(2),n=n.square().mod(e)}return r},c.prototype.modPow=f.prototype.modPow=a.prototype.modPow,a.prototype.compareAbs=function(t){var e=V(t),r=this.value,n=e.value;return e.isSmall?1:T(r,n)},f.prototype.compareAbs=function(t){var e=V(t),r=Math.abs(this.value),n=e.value;return e.isSmall?r===(n=Math.abs(n))?0:r>n?1:-1:-1},c.prototype.compareAbs=function(t){var e=this.value,r=V(t).value;return(e=e>=0?e:-e)===(r=r>=0?r:-r)?0:e>r?1:-1},a.prototype.compare=function(t){if(t===1/0)return-1;if(t===-1/0)return 1;var e=V(t),r=this.value,n=e.value;return this.sign!==e.sign?e.sign?1:-1:e.isSmall?this.sign?-1:1:T(r,n)*(this.sign?-1:1)},a.prototype.compareTo=a.prototype.compare,f.prototype.compare=function(t){if(t===1/0)return-1;if(t===-1/0)return 1;var e=V(t),r=this.value,n=e.value;return e.isSmall?r==n?0:r>n?1:-1:r<0!==e.sign?r<0?-1:1:r<0?1:-1},f.prototype.compareTo=f.prototype.compare,c.prototype.compare=function(t){if(t===1/0)return-1;if(t===-1/0)return 1;var e=this.value,r=V(t).value;return e===r?0:e>r?1:-1},c.prototype.compareTo=c.prototype.compare,a.prototype.equals=function(t){return 0===this.compare(t)},c.prototype.eq=c.prototype.equals=f.prototype.eq=f.prototype.equals=a.prototype.eq=a.prototype.equals,a.prototype.notEquals=function(t){return 0!==this.compare(t)},c.prototype.neq=c.prototype.notEquals=f.prototype.neq=f.prototype.notEquals=a.prototype.neq=a.prototype.notEquals,a.prototype.greater=function(t){return this.compare(t)>0},c.prototype.gt=c.prototype.greater=f.prototype.gt=f.prototype.greater=a.prototype.gt=a.prototype.greater,a.prototype.lesser=function(t){return this.compare(t)<0},c.prototype.lt=c.prototype.lesser=f.prototype.lt=f.prototype.lesser=a.prototype.lt=a.prototype.lesser,a.prototype.greaterOrEquals=function(t){return this.compare(t)>=0},c.prototype.geq=c.prototype.greaterOrEquals=f.prototype.geq=f.prototype.greaterOrEquals=a.prototype.geq=a.prototype.greaterOrEquals,a.prototype.lesserOrEquals=function(t){return this.compare(t)<=0},c.prototype.leq=c.prototype.lesserOrEquals=f.prototype.leq=f.prototype.lesserOrEquals=a.prototype.leq=a.prototype.lesserOrEquals,a.prototype.isEven=function(){return 0==(1&this.value[0])},f.prototype.isEven=function(){return 0==(1&this.value)},c.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},a.prototype.isOdd=function(){return 1==(1&this.value[0])},f.prototype.isOdd=function(){return 1==(1&this.value)},c.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},a.prototype.isPositive=function(){return!this.sign},f.prototype.isPositive=function(){return this.value>0},c.prototype.isPositive=f.prototype.isPositive,a.prototype.isNegative=function(){return this.sign},f.prototype.isNegative=function(){return this.value<0},c.prototype.isNegative=f.prototype.isNegative,a.prototype.isUnit=function(){return!1},f.prototype.isUnit=function(){return 1===Math.abs(this.value)},c.prototype.isUnit=function(){return this.abs().value===BigInt(1)},a.prototype.isZero=function(){return!1},f.prototype.isZero=function(){return 0===this.value},c.prototype.isZero=function(){return this.value===BigInt(0)},a.prototype.isDivisibleBy=function(t){var e=V(t);return!e.isZero()&&(!!e.isUnit()||(0===e.compareAbs(2)?this.isEven():this.mod(e).isZero()))},c.prototype.isDivisibleBy=f.prototype.isDivisibleBy=a.prototype.isDivisibleBy,a.prototype.isPrime=function(e){var r=M(this);if(r!==t)return r;var n=this.abs(),i=n.bitLength();if(i<=64)return x(n,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var u=Math.log(2)*i.toJSNumber(),s=Math.ceil(!0===e?2*Math.pow(u,2):u),a=[],f=0;f<s;f++)a.push(o(f+2));return x(n,a)},c.prototype.isPrime=f.prototype.isPrime=a.prototype.isPrime,a.prototype.isProbablePrime=function(e,r){var n=M(this);if(n!==t)return n;for(var i=this.abs(),u=e===t?5:e,s=[],a=0;a<u;a++)s.push(o.randBetween(2,i.minus(2),r));return x(i,s)},c.prototype.isProbablePrime=f.prototype.isProbablePrime=a.prototype.isProbablePrime,a.prototype.modInv=function(t){for(var e,r,n,i=o.zero,u=o.one,s=V(t),a=this.abs();!a.isZero();)e=s.divide(a),r=i,n=s,i=u,s=a,u=r.subtract(e.multiply(u)),a=n.subtract(e.multiply(a));if(!s.isUnit())throw new Error(this.toString()+" and "+t.toString()+" are not co-prime");return-1===i.compare(0)&&(i=i.add(t)),this.isNegative()?i.negate():i},c.prototype.modInv=f.prototype.modInv=a.prototype.modInv,a.prototype.next=function(){var t=this.value;return this.sign?E(t,1,this.sign):new a(b(t,1),this.sign)},f.prototype.next=function(){var t=this.value;return t+1<r?new f(t+1):new a(n,!1)},c.prototype.next=function(){return new c(this.value+BigInt(1))},a.prototype.prev=function(){var t=this.value;return this.sign?new a(b(t,1),!0):E(t,1,this.sign)},f.prototype.prev=function(){var t=this.value;return t-1>-r?new f(t-1):new a(n,!0)},c.prototype.prev=function(){return new c(this.value-BigInt(1))};for(var R=[1];2*R[R.length-1]<=e;)R.push(2*R[R.length-1]);var L=R.length,N=R[L-1];function k(t){return Math.abs(t)<=e}function j(t,e,r){e=V(e);for(var n=t.isNegative(),i=e.isNegative(),u=n?t.not():t,s=i?e.not():e,a=0,f=0,c=null,p=null,l=[];!u.isZero()||!s.isZero();)a=(c=P(u,N))[1].toJSNumber(),n&&(a=N-1-a),f=(p=P(s,N))[1].toJSNumber(),i&&(f=N-1-f),u=c[0],s=p[0],l.push(r(a,f));for(var h=0!==r(n?1:0,i?1:0)?o(-1):o(0),y=l.length-1;y>=0;y-=1)h=h.multiply(N).add(o(l[y]));return h}a.prototype.shiftLeft=function(t){var e=V(t).toJSNumber();if(!k(e))throw new Error(String(e)+" is too large for shifting.");if(e<0)return this.shiftRight(-e);var r=this;if(r.isZero())return r;for(;e>=L;)r=r.multiply(N),e-=L-1;return r.multiply(R[e])},c.prototype.shiftLeft=function(t){return t=V(t),new c(this.value<<t.value)},f.prototype.shiftLeft=a.prototype.shiftLeft,a.prototype.shiftRight=function(t){var e,r=V(t).toJSNumber();if(!k(r))throw new Error(String(r)+" is too large for shifting.");if(r<0)return this.shiftLeft(-r);for(var n=this;r>=L;){if(n.isZero()||n.isNegative()&&n.isUnit())return n;n=(e=P(n,N))[1].isNegative()?e[0].prev():e[0],r-=L-1}return(e=P(n,R[r]))[1].isNegative()?e[0].prev():e[0]},c.prototype.shiftRight=function(t){return t=V(t),new c(this.value>>t.value)},f.prototype.shiftRight=a.prototype.shiftRight,a.prototype.not=function(){return this.negate().prev()},c.prototype.not=f.prototype.not=a.prototype.not,a.prototype.and=function(t){return j(this,t,(function(t,e){return t&e}))},c.prototype.and=f.prototype.and=a.prototype.and,a.prototype.or=function(t){return j(this,t,(function(t,e){return t|e}))},c.prototype.or=f.prototype.or=a.prototype.or,a.prototype.xor=function(t){return j(this,t,(function(t,e){return t^e}))},c.prototype.xor=f.prototype.xor=a.prototype.xor;var C=1<<30;function q(t){var r=t.value,n="number"==typeof r?r|C:"bigint"==typeof r?r|BigInt(C):r[0]+r[1]*e|1073758208;return n&-n}function K(t,e){if(e.compareTo(t)<=0){var r=K(t,e.square(e)),n=r.p,i=r.e,u=n.multiply(e);return u.compareTo(t)<=0?{p:u,e:2*i+1}:{p:n,e:2*i}}return{p:o(1),e:0}}function D(t,e){return t=V(t),e=V(e),t.greater(e)?t:e}function z(t,e){return t=V(t),e=V(e),t.lesser(e)?t:e}function $(t,e){if(t=V(t).abs(),e=V(e).abs(),t.equals(e))return t;if(t.isZero())return e;if(e.isZero())return t;for(var r,n,o=s[1];t.isEven()&&e.isEven();)r=z(q(t),q(e)),t=t.divide(r),e=e.divide(r),o=o.multiply(r);for(;t.isEven();)t=t.divide(q(t));do{for(;e.isEven();)e=e.divide(q(e));t.greater(e)&&(n=e,e=t,t=n),e=e.subtract(t)}while(!e.isZero());return o.isUnit()?t:t.multiply(o)}a.prototype.bitLength=function(){var t=this;return t.compareTo(o(0))<0&&(t=t.negate().subtract(o(1))),0===t.compareTo(o(0))?o(0):o(K(t,o(2)).e).add(o(1))},c.prototype.bitLength=f.prototype.bitLength=a.prototype.bitLength;var F=function(t,e,r,n){r=r||i,t=String(t),n||(t=t.toLowerCase(),r=r.toLowerCase());var o,u=t.length,s=Math.abs(e),a={};for(o=0;o<r.length;o++)a[r[o]]=o;for(o=0;o<u;o++)if("-"!==(p=t[o])&&p in a&&a[p]>=s){if("1"===p&&1===s)continue;throw new Error(p+" is not a valid digit in base "+e+".")}e=V(e);var f=[],c="-"===t[0];for(o=c?1:0;o<t.length;o++){var p;if((p=t[o])in a)f.push(V(a[p]));else{if("<"!==p)throw new Error(p+" is not a valid character");var l=o;do{o++}while(">"!==t[o]&&o<t.length);f.push(V(t.slice(l+1,o)))}}return Z(f,e,c)};function Z(t,e,r){var n,o=s[0],i=s[1];for(n=t.length-1;n>=0;n--)o=o.add(t[n].times(i)),i=i.times(e);return r?o.negate():o}function J(t,e){if((e=o(e)).isZero()){if(t.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(e.equals(-1)){if(t.isZero())return{value:[0],isNegative:!1};if(t.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-t.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var r=Array.apply(null,Array(t.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return r.unshift([1]),{value:[].concat.apply([],r),isNegative:!1}}var n=!1;if(t.isNegative()&&e.isPositive()&&(n=!0,t=t.abs()),e.isUnit())return t.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(t.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:n};for(var i,u=[],s=t;s.isNegative()||s.compareAbs(e)>=0;){i=s.divmod(e),s=i.quotient;var a=i.remainder;a.isNegative()&&(a=e.minus(a).abs(),s=s.next()),u.push(a.toJSNumber())}return u.push(s.toJSNumber()),{value:u.reverse(),isNegative:n}}function G(t,e,r){var n=J(t,e);return(n.isNegative?"-":"")+n.value.map((function(t){return function(t,e){return t<(e=e||i).length?e[t]:"<"+t+">"}(t,r)})).join("")}function Y(t){if(p(+t)){var e=+t;if(e===v(e))return u?new c(BigInt(e)):new f(e);throw new Error("Invalid integer: "+t)}var r="-"===t[0];r&&(t=t.slice(1));var n=t.split(/e/i);if(n.length>2)throw new Error("Invalid integer: "+n.join("e"));if(2===n.length){var o=n[1];if("+"===o[0]&&(o=o.slice(1)),(o=+o)!==v(o)||!p(o))throw new Error("Invalid integer: "+o+" is not a valid exponent.");var i=n[0],s=i.indexOf(".");if(s>=0&&(o-=i.length-s-1,i=i.slice(0,s)+i.slice(s+1)),o<0)throw new Error("Cannot include negative exponent part for integers");t=i+=new Array(o+1).join("0")}if(!/^([0-9][0-9]*)$/.test(t))throw new Error("Invalid integer: "+t);if(u)return new c(BigInt(r?"-"+t:t));for(var l=[],h=t.length,g=h-7;h>0;)l.push(+t.slice(g,h)),(g-=7)<0&&(g=0),h-=7;return y(l),new a(l,r)}function V(t){return"number"==typeof t?function(t){if(u)return new c(BigInt(t));if(p(t)){if(t!==v(t))throw new Error(t+" is not an integer.");return new f(t)}return Y(t.toString())}(t):"string"==typeof t?Y(t):"bigint"==typeof t?new c(t):t}a.prototype.toArray=function(t){return J(this,t)},f.prototype.toArray=function(t){return J(this,t)},c.prototype.toArray=function(t){return J(this,t)},a.prototype.toString=function(e,r){if(e===t&&(e=10),10!==e)return G(this,e,r);for(var n,o=this.value,i=o.length,u=String(o[--i]);--i>=0;)n=String(o[i]),u+="0000000".slice(n.length)+n;return(this.sign?"-":"")+u},f.prototype.toString=function(e,r){return e===t&&(e=10),10!=e?G(this,e,r):String(this.value)},c.prototype.toString=f.prototype.toString,c.prototype.toJSON=a.prototype.toJSON=f.prototype.toJSON=function(){return this.toString()},a.prototype.valueOf=function(){return parseInt(this.toString(),10)},a.prototype.toJSNumber=a.prototype.valueOf,f.prototype.valueOf=function(){return this.value},f.prototype.toJSNumber=f.prototype.valueOf,c.prototype.valueOf=c.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};for(var W=0;W<1e3;W++)s[W]=V(W),W>0&&(s[-W]=V(-W));return s.one=s[1],s.zero=s[0],s.minusOne=s[-1],s.max=D,s.min=z,s.gcd=$,s.lcm=function(t,e){return t=V(t).abs(),e=V(e).abs(),t.divide($(t,e)).multiply(e)},s.isInstance=function(t){return t instanceof a||t instanceof f||t instanceof c},s.randBetween=function(t,r,n){t=V(t),r=V(r);var o=n||Math.random,i=z(t,r),u=D(t,r).subtract(i).add(1);if(u.isSmall)return i.add(Math.floor(o()*u));for(var a=J(u,e).value,f=[],c=!0,p=0;p<a.length;p++){var l=c?a[p]:e,h=v(o()*l);f.push(h),h<l&&(c=!1)}return i.add(s.fromArray(f,e,!1))},s.fromArray=function(t,e,r){return Z(t.map(V),V(e||10),r)},s}();t.hasOwnProperty("exports")&&(t.exports=o),void 0===(n=function(){return o}.call(e,r,e,t))||(t.exports=n)},8764:(t,e,r)=>{"use strict";const n=r(9742),o=r(645),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=function(t){return+t!=t&&(t=0),a.alloc(+t)},e.INSPECT_MAX_BYTES=50;const u=2147483647;function s(t){if(t>u)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return p(t)}return f(t,e,r)}function f(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|g(t,e);let n=s(r);const o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(V(t,Uint8Array)){const e=new Uint8Array(t);return h(e.buffer,e.byteOffset,e.byteLength)}return l(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(V(t,ArrayBuffer)||t&&V(t.buffer,ArrayBuffer))return h(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(V(t,SharedArrayBuffer)||t&&V(t.buffer,SharedArrayBuffer)))return h(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return a.from(n,e,r);const o=function(t){if(a.isBuffer(t)){const e=0|y(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||W(t.length)?s(0):l(t):"Buffer"===t.type&&Array.isArray(t.data)?l(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function p(t){return c(t),s(t<0?0:0|y(t))}function l(t){const e=t.length<0?0:0|y(t.length),r=s(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function h(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,a.prototype),n}function y(t){if(t>=u)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u.toString(16)+" bytes");return 0|t}function g(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||V(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(o)return n?-1:J(t).length;e=(""+e).toLowerCase(),o=!0}}function v(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return U(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function d(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function w(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),W(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,o){let i,u=1,s=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;u=2,s/=2,a/=2,r/=2}function f(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(o){let n=-1;for(i=r;i<s;i++)if(f(t,i)===f(e,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===a)return n*u}else-1!==n&&(i-=i-n),n=-1}else for(r+a>s&&(r=s-a),i=r;i>=0;i--){let r=!0;for(let n=0;n<a;n++)if(f(t,i+n)!==f(e,n)){r=!1;break}if(r)return i}return-1}function m(t,e,r,n){r=Number(r)||0;const o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=e.length;let u;for(n>i/2&&(n=i/2),u=0;u<n;++u){const n=parseInt(e.substr(2*u,2),16);if(W(n))return u;t[r+u]=n}return u}function E(t,e,r,n){return Y(J(e,t.length-r),t,r,n)}function _(t,e,r,n){return Y(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function A(t,e,r,n){return Y(G(e),t,r,n)}function B(t,e,r,n){return Y(function(t,e){let r,n,o;const i=[];for(let u=0;u<t.length&&!((e-=2)<0);++u)r=t.charCodeAt(u),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);const n=[];let o=e;for(;o<r;){const e=t[o];let i=null,u=e>239?4:e>223?3:e>191?2:1;if(o+u<=r){let r,n,s,a;switch(u){case 1:e<128&&(i=e);break;case 2:r=t[o+1],128==(192&r)&&(a=(31&e)<<6|63&r,a>127&&(i=a));break;case 3:r=t[o+1],n=t[o+2],128==(192&r)&&128==(192&n)&&(a=(15&e)<<12|(63&r)<<6|63&n,a>2047&&(a<55296||a>57343)&&(i=a));break;case 4:r=t[o+1],n=t[o+2],s=t[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(a=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,a>65535&&a<1114112&&(i=a))}}null===i?(i=65533,u=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=u}return function(t){const e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=I));return r}(n)}e.kMaxLength=u,a.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(t,e,r){return f(t,e,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},a.allocUnsafe=function(t){return p(t)},a.allocUnsafeSlow=function(t){return p(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(V(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),V(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=a.allocUnsafe(e);let o=0;for(r=0;r<t.length;++r){let e=t[r];if(V(e,Uint8Array))o+e.length>n.length?(a.isBuffer(e)||(e=a.from(e)),e.copy(n,o)):Uint8Array.prototype.set.call(n,e,o);else{if(!a.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,o)}o+=e.length}return n},a.byteLength=g,a.prototype._isBuffer=!0,a.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)d(this,e,e+1);return this},a.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)d(this,e,e+3),d(this,e+1,e+2);return this},a.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},a.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?O(this,0,t):v.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},i&&(a.prototype[i]=a.prototype.inspect),a.prototype.compare=function(t,e,r,n,o){if(V(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;let i=(o>>>=0)-(n>>>=0),u=(r>>>=0)-(e>>>=0);const s=Math.min(i,u),f=this.slice(n,o),c=t.slice(e,r);for(let t=0;t<s;++t)if(f[t]!==c[t]){i=f[t],u=c[t];break}return i<u?-1:u<i?1:0},a.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function U(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function P(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function T(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=e;n<r;++n)o+=X[t[n]];return o}function M(t,e,r){const n=t.slice(e,r);let o="";for(let t=0;t<n.length-1;t+=2)o+=String.fromCharCode(n[t]+256*n[t+1]);return o}function x(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,r,n,o,i){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function L(t,e,r,n,o){z(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i;let u=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=u,u>>=8,t[r++]=u,u>>=8,t[r++]=u,u>>=8,t[r++]=u,r}function N(t,e,r,n,o){z(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r+7]=i,i>>=8,t[r+6]=i,i>>=8,t[r+5]=i,i>>=8,t[r+4]=i;let u=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=u,u>>=8,t[r+2]=u,u>>=8,t[r+1]=u,u>>=8,t[r]=u,r+8}function k(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function C(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,8),o.write(t,e,r,n,52,8),r+8}a.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUintLE=a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let n=this[t],o=1,i=0;for(;++i<e&&(o*=256);)n+=this[t+i]*o;return n},a.prototype.readUintBE=a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let n=this[t+--e],o=1;for(;e>0&&(o*=256);)n+=this[t+--e]*o;return n},a.prototype.readUint8=a.prototype.readUInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),this[t]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readBigUInt64LE=H((function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||F(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,o=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))})),a.prototype.readBigUInt64BE=H((function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||F(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],o=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)})),a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let n=this[t],o=1,i=0;for(;++i<e&&(o*=256);)n+=this[t+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let n=e,o=1,i=this[t+--n];for(;n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},a.prototype.readInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||x(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||x(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readBigInt64LE=H((function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||F(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),a.prototype.readBigInt64BE=H((function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||F(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),a.prototype.readFloatLE=function(t,e){return t>>>=0,e||x(t,4,this.length),o.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),o.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),o.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(t,8,this.length),o.read(this,t,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeBigUInt64LE=H((function(t,e=0){return L(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeBigUInt64BE=H((function(t,e=0){return N(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,t,e,r,n-1,-n)}let o=0,i=1,u=0;for(this[e]=255&t;++o<r&&(i*=256);)t<0&&0===u&&0!==this[e+o-1]&&(u=1),this[e+o]=(t/i>>0)-u&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,t,e,r,n-1,-n)}let o=r-1,i=1,u=0;for(this[e+o]=255&t;--o>=0&&(i*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/i>>0)-u&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeBigInt64LE=H((function(t,e=0){return L(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeBigInt64BE=H((function(t,e=0){return N(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return C(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return C(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o},a.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{const i=a.isBuffer(t)?t:a.from(t,n),u=i.length;if(0===u)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=i[o%u]}return this};const q={};function K(t,e,r){q[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function D(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function z(t,e,r,n,o,i){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let o;throw o=i>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new q.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,r){$(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||F(e,t.length-(r+1))}(n,o,i)}function $(t,e){if("number"!=typeof t)throw new q.ERR_INVALID_ARG_TYPE(e,"number",t)}function F(t,e,r){if(Math.floor(t)!==t)throw $(t,r),new q.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new q.ERR_BUFFER_OUT_OF_BOUNDS;throw new q.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}K("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),K("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),K("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=D(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=D(o)),o+="n"),n+=` It must be ${e}. Received ${o}`,n}),RangeError);const Z=/[^+/0-9A-Za-z-_]/g;function J(t,e){let r;e=e||1/0;const n=t.length;let o=null;const i=[];for(let u=0;u<n;++u){if(r=t.charCodeAt(u),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(u+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(Z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Y(t,e,r,n){let o;for(o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function V(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function W(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e}();function H(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},284:t=>{var e=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};t.exports=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return e()}try{return __global__||e()}finally{delete Object.prototype.__global__}}()},645:(t,e)=>{e.read=function(t,e,r,n,o){var i,u,s=8*o-n-1,a=(1<<s)-1,f=a>>1,c=-7,p=r?o-1:0,l=r?-1:1,h=t[e+p];for(p+=l,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+t[e+p],p+=l,c-=8);for(u=i&(1<<-c)-1,i>>=-c,c+=n;c>0;u=256*u+t[e+p],p+=l,c-=8);if(0===i)i=1-f;else{if(i===a)return u?NaN:1/0*(h?-1:1);u+=Math.pow(2,n),i-=f}return(h?-1:1)*u*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var u,s,a,f=8*i-o-1,c=(1<<f)-1,p=c>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,y=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,u=c):(u=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-u))<1&&(u--,a*=2),(e+=u+p>=1?l/a:l*Math.pow(2,1-p))*a>=2&&(u++,a/=2),u+p>=c?(s=0,u=c):u+p>=1?(s=(e*a-1)*Math.pow(2,o),u+=p):(s=e*Math.pow(2,p-1)*Math.pow(2,o),u=0));o>=8;t[r+h]=255&s,h+=y,s/=256,o-=8);for(u=u<<o|s,f+=o;f>0;t[r+h]=255&u,h+=y,u/=256,f-=8);t[r+h-y]|=128*g}},7435:(t,e)=>{e.endianness=function(){return"LE"},e.hostname=function(){return"undefined"!=typeof location?location.hostname:""},e.loadavg=function(){return[]},e.uptime=function(){return 0},e.freemem=function(){return Number.MAX_VALUE},e.totalmem=function(){return Number.MAX_VALUE},e.cpus=function(){return[]},e.type=function(){return"Browser"},e.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},e.networkInterfaces=e.getNetworkInterfaces=function(){return{}},e.arch=function(){return"javascript"},e.platform=function(){return"browser"},e.tmpdir=e.tmpDir=function(){return"/tmp"},e.EOL="\n",e.homedir=function(){return"/"}},655:(t,e,r)=>{"use strict";r.r(e),r.d(e,{__extends:()=>o,__assign:()=>i,__rest:()=>u,__decorate:()=>s,__param:()=>a,__metadata:()=>f,__awaiter:()=>c,__generator:()=>p,__createBinding:()=>l,__exportStar:()=>h,__values:()=>y,__read:()=>g,__spread:()=>v,__spreadArrays:()=>d,__spreadArray:()=>w,__await:()=>b,__asyncGenerator:()=>m,__asyncDelegator:()=>E,__asyncValues:()=>_,__makeTemplateObject:()=>A,__importStar:()=>S,__importDefault:()=>O,__classPrivateFieldGet:()=>I,__classPrivateFieldSet:()=>U});var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var i=function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};function u(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function s(t,e,r,n){var o,i=arguments.length,u=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(u=(i<3?o(u):i>3?o(e,r,u):o(e,r))||u);return i>3&&u&&Object.defineProperty(e,r,u),u}function a(t,e){return function(r,n){e(r,n,t)}}function f(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function c(t,e,r,n){return new(r||(r=Promise))((function(o,i){function u(t){try{a(n.next(t))}catch(t){i(t)}}function s(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,s)}a((n=n.apply(t,e||[])).next())}))}function p(t,e){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var l=Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]};function h(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||l(e,t,r)}function y(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)u.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u}function v(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(g(arguments[e]));return t}function d(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],u=0,s=i.length;u<s;u++,o++)n[o]=i[u];return n}function w(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}function b(t){return this instanceof b?(this.v=t,this):new b(t)}function m(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(t,e||[]),i=[];return n={},u("next"),u("throw"),u("return"),n[Symbol.asyncIterator]=function(){return this},n;function u(t){o[t]&&(n[t]=function(e){return new Promise((function(r,n){i.push([t,e,r,n])>1||s(t,e)}))})}function s(t,e){try{(r=o[t](e)).value instanceof b?Promise.resolve(r.value.v).then(a,f):c(i[0][2],r)}catch(t){c(i[0][3],t)}var r}function a(t){s("next",t)}function f(t){s("throw",t)}function c(t,e){t(e),i.shift(),i.length&&s(i[0][0],i[0][1])}}function E(t){var e,r;return e={},n("next"),n("throw",(function(t){throw t})),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,o){e[n]=t[n]?function(e){return(r=!r)?{value:b(t[n](e)),done:"return"===n}:o?o(e):e}:o}}function _(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=y(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise((function(n,o){!function(t,e,r,n){Promise.resolve(n).then((function(e){t({value:e,done:r})}),e)}(n,o,(e=t[r](e)).done,e.value)}))}}}function A(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var B=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function S(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&l(e,t,r);return B(e,t),e}function O(t){return t&&t.__esModule?t:{default:t}}function I(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)}function U(t,e,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(t,r):o?o.value=r:e.set(t,r),r}},5840:(t,e,r)=>{var n;if("object"==typeof globalThis)n=globalThis;else try{n=r(284)}catch(t){}finally{if(n||"undefined"==typeof window||(n=window),!n)throw new Error("Could not determine global this")}var o=n.WebSocket||n.MozWebSocket,i=r(9387);function u(t,e){return e?new o(t,e):new o(t)}o&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(t){Object.defineProperty(u,t,{get:function(){return o[t]}})})),t.exports={w3cwebsocket:o?u:null,version:i}},9387:(t,e,r)=>{t.exports=r(9794).version},4678:(t,e,r)=>{"use strict";r.r(e),r.d(e,{clear:()=>g,createStore:()=>i,del:()=>h,delMany:()=>y,entries:()=>b,get:()=>a,getMany:()=>p,keys:()=>d,promisifyRequest:()=>o,set:()=>f,setMany:()=>c,update:()=>l,values:()=>w});var n=r(4702);function o(t){return new Promise(((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)}))}function i(t,e){const r=(0,n.Z)().then((()=>{const r=indexedDB.open(t);return r.onupgradeneeded=()=>r.result.createObjectStore(e),o(r)}));return(t,n)=>r.then((r=>n(r.transaction(e,t).objectStore(e))))}let u;function s(){return u||(u=i("keyval-store","keyval")),u}function a(t,e=s()){return e("readonly",(e=>o(e.get(t))))}function f(t,e,r=s()){return r("readwrite",(r=>(r.put(e,t),o(r.transaction))))}function c(t,e=s()){return e("readwrite",(e=>(t.forEach((t=>e.put(t[1],t[0]))),o(e.transaction))))}function p(t,e=s()){return e("readonly",(e=>Promise.all(t.map((t=>o(e.get(t)))))))}function l(t,e,r=s()){return r("readwrite",(r=>new Promise(((n,i)=>{r.get(t).onsuccess=function(){try{r.put(e(this.result),t),n(o(r.transaction))}catch(t){i(t)}}}))))}function h(t,e=s()){return e("readwrite",(e=>(e.delete(t),o(e.transaction))))}function y(t,e=s()){return e("readwrite",(e=>(t.forEach((t=>e.delete(t))),o(e.transaction))))}function g(t=s()){return t("readwrite",(t=>(t.clear(),o(t.transaction))))}function v(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},o(t.transaction)}function d(t=s()){return t("readonly",(t=>{if(t.getAllKeys)return o(t.getAllKeys());const e=[];return v(t,(t=>e.push(t.key))).then((()=>e))}))}function w(t=s()){return t("readonly",(t=>{if(t.getAll)return o(t.getAll());const e=[];return v(t,(t=>e.push(t.value))).then((()=>e))}))}function b(t=s()){return t("readonly",(e=>{if(e.getAll&&e.getAllKeys)return Promise.all([o(e.getAllKeys()),o(e.getAll())]).then((([t,e])=>t.map(((t,r)=>[t,e[r]]))));const r=[];return t("readonly",(t=>v(t,(t=>r.push([t.key,t.value]))).then((()=>r))))}))}},4702:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n=function(){var t;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(e){var r=function(){return indexedDB.databases().finally(e)};t=setInterval(r,100),r()})).finally((function(){return clearInterval(t)})):Promise.resolve()}},9794:t=>{"use strict";t.exports={version:"1.0.34"}}}]);
//# sourceMappingURL=313.8a2407b28699bf5c67c8.js.map