UNPKG

@kobakazu0429/wasmer-wasi

Version:

Isomorphic Javascript library for interacting with WASI Modules in Node.js and the Browser. 📚

112 lines (110 loc) • 73.2 kB
/* ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. **************************************************************************** safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ 'use strict';var WASI=function(aa){function Oa(a,b){function c(){this.constructor=a}Pa(a,b);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)}function kc(a,b,c,d){return new (c||(c=Promise))(function(e,f){function k(a){try{m(d.next(a))}catch(ja){f(ja)}}function l(a){try{m(d["throw"](a))}catch(ja){f(ja)}}function m(a){a.done?e(a.value):(new c(function(b){b(a.value)})).then(k,l)}m((d=d.apply(a,b||[])).next())})}function lc(a,b){function c(a){return function(b){return d([a,b])}}function d(c){if(f)throw new TypeError("Generator is already executing."); for(;e;)try{if(f=1,k&&(l=c[0]&2?k["return"]:c[0]?k["throw"]||((l=k["return"])&&l.call(k),0):k.next)&&!(l=l.call(k,c[1])).done)return l;if(k=0,l)c=[c[0]&2,l.value];switch(c[0]){case 0:case 1:l=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++;k=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop();continue;default:if(!(l=e.trys,l=0<l.length&&l[l.length-1])&&(6===c[0]||2===c[0])){e=0;continue}if(3===c[0]&&(!l||c[1]>l[0]&&c[1]<l[3]))e.label=c[1];else if(6===c[0]&&e.label<l[1])e.label= l[1],l=c;else if(l&&e.label<l[2])e.label=l[2],e.ops.push(c);else{l[2]&&e.ops.pop();e.trys.pop();continue}}c=b.call(a,e)}catch(ja){c=[6,ja],k=0}finally{f=l=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}var e={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},f,k,l,m;return m={next:c(0),"throw":c(1),"return":c(2)},"function"===typeof Symbol&&(m[Symbol.iterator]=function(){return this}),m}function ka(a){var b="function"===typeof Symbol&&a[Symbol.iterator],c=0; return b?b.call(a):{next:function(){a&&c>=a.length&&(a=void 0);return{value:a&&a[c++],done:!a}}}}function qa(a,b){var c="function"===typeof Symbol&&a[Symbol.iterator];if(!c)return a;a=c.call(a);var d,e=[];try{for(;(void 0===b||0<b--)&&!(d=a.next()).done;)e.push(d.value)}catch(k){var f={error:k}}finally{try{d&&!d.done&&(c=a["return"])&&c.call(a)}finally{if(f)throw f.error;}}return e}function ra(){for(var a=[],b=0;b<arguments.length;b++)a=a.concat(qa(arguments[b]));return a}function mc(a){function b(b){e[b]= a[b]&&function(d){return new Promise(function(e,f){d=a[b](d);c(e,f,d.done,d.value)})}}function c(a,b,c,d){Promise.resolve(d).then(function(b){a({value:b,done:c})},b)}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var d=a[Symbol.asyncIterator],e;return d?d.call(a):(a="function"===typeof ka?ka(a):a[Symbol.iterator](),e={},b("next"),b("throw"),b("return"),e[Symbol.asyncIterator]=function(){return this},e)}function ob(){Qa=!0;for(var a=0;64>a;++a)F[a]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[a], A["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(a)]=a;A[45]=62;A[95]=63}function nc(a,b,c){for(var d=[],e=b;e<c;e+=3)b=(a[e]<<16)+(a[e+1]<<8)+a[e+2],d.push(F[b>>18&63]+F[b>>12&63]+F[b>>6&63]+F[b&63]);return d.join("")}function pb(a){Qa||ob();for(var b=a.length,c=b%3,d="",e=[],f=0,k=b-c;f<k;f+=16383)e.push(nc(a,f,f+16383>k?k:f+16383));1===c?(a=a[b-1],d+=F[a>>2],d+=F[a<<4&63],d+="=="):2===c&&(a=(a[b-2]<<8)+a[b-1],d+=F[a>>10],d+=F[a>>4&63],d+=F[a<<2&63],d+="=");e.push(d); return e.join("")}function sa(a,b,c,d,e){var f=8*e-d-1;var k=(1<<f)-1,l=k>>1,m=-7;e=c?e-1:0;var g=c?-1:1,h=a[b+e];e+=g;c=h&(1<<-m)-1;h>>=-m;for(m+=f;0<m;c=256*c+a[b+e],e+=g,m-=8);f=c&(1<<-m)-1;c>>=-m;for(m+=d;0<m;f=256*f+a[b+e],e+=g,m-=8);if(0===c)c=1-l;else{if(c===k)return f?NaN:Infinity*(h?-1:1);f+=Math.pow(2,d);c-=l}return(h?-1:1)*f*Math.pow(2,c-d)}function ta(a,b,c,d,e,f){var k,l=8*f-e-1,m=(1<<l)-1,g=m>>1,h=23===e?Math.pow(2,-24)-Math.pow(2,-77):0;f=d?0:f-1;var n=d?1:-1,Ra=0>b||0===b&&0>1/b?1: 0;b=Math.abs(b);isNaN(b)||Infinity===b?(b=isNaN(b)?1:0,d=m):(d=Math.floor(Math.log(b)/Math.LN2),1>b*(k=Math.pow(2,-d))&&(d--,k*=2),b=1<=d+g?b+h/k:b+h*Math.pow(2,1-g),2<=b*k&&(d++,k/=2),d+g>=m?(b=0,d=m):1<=d+g?(b=(b*k-1)*Math.pow(2,e),d+=g):(b=b*Math.pow(2,g-1)*Math.pow(2,e),d=0));for(;8<=e;a[c+f]=b&255,f+=n,b/=256,e-=8);d=d<<e|b;for(l+=e;0<l;a[c+f]=d&255,f+=n,d/=256,l-=8);a[c+f-n]|=128*Ra}function I(a,b){if((h.TYPED_ARRAY_SUPPORT?2147483647:1073741823)<b)throw new RangeError("Invalid typed array length"); h.TYPED_ARRAY_SUPPORT?(a=new Uint8Array(b),a.__proto__=h.prototype):(null===a&&(a=new h(b)),a.length=b);return a}function h(a,b,c){if(!(h.TYPED_ARRAY_SUPPORT||this instanceof h))return new h(a,b,c);if("number"===typeof a){if("string"===typeof b)throw Error("If encoding is specified then the first argument must be a string");return Sa(this,a)}return qb(this,a,b,c)}function qb(a,b,c,d){if("number"===typeof b)throw new TypeError('"value" argument must not be a number');if("undefined"!==typeof ArrayBuffer&& b instanceof ArrayBuffer){b.byteLength;if(0>c||b.byteLength<c)throw new RangeError("'offset' is out of bounds");if(b.byteLength<c+(d||0))throw new RangeError("'length' is out of bounds");b=void 0===c&&void 0===d?new Uint8Array(b):void 0===d?new Uint8Array(b,c):new Uint8Array(b,c,d);h.TYPED_ARRAY_SUPPORT?(a=b,a.__proto__=h.prototype):a=Ta(a,b);return a}if("string"===typeof b){d=a;a=c;if("string"!==typeof a||""===a)a="utf8";if(!h.isEncoding(a))throw new TypeError('"encoding" must be a valid string encoding'); c=rb(b,a)|0;d=I(d,c);b=d.write(b,a);b!==c&&(d=d.slice(0,b));return d}return oc(a,b)}function sb(a){if("number"!==typeof a)throw new TypeError('"size" argument must be a number');if(0>a)throw new RangeError('"size" argument must not be negative');}function Sa(a,b){sb(b);a=I(a,0>b?0:Ua(b)|0);if(!h.TYPED_ARRAY_SUPPORT)for(var c=0;c<b;++c)a[c]=0;return a}function Ta(a,b){var c=0>b.length?0:Ua(b.length)|0;a=I(a,c);for(var d=0;d<c;d+=1)a[d]=b[d]&255;return a}function oc(a,b){if(E(b)){var c=Ua(b.length)| 0;a=I(a,c);if(0===a.length)return a;b.copy(a,0,0,c);return a}if(b){if("undefined"!==typeof ArrayBuffer&&b.buffer instanceof ArrayBuffer||"length"in b)return(c="number"!==typeof b.length)||(c=b.length,c=c!==c),c?I(a,0):Ta(a,b);if("Buffer"===b.type&&tb(b.data))return Ta(a,b.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");}function Ua(a){if(a>=(h.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ (h.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return a|0}function E(a){return!(null==a||!a._isBuffer)}function rb(a,b){if(E(a))return a.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(a)||a instanceof ArrayBuffer))return a.byteLength;"string"!==typeof a&&(a=""+a);var c=a.length;if(0===c)return 0;for(var d=!1;;)switch(b){case "ascii":case "latin1":case "binary":return c;case "utf8":case "utf-8":case void 0:return ua(a).length; case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return 2*c;case "hex":return c>>>1;case "base64":return ub(a).length;default:if(d)return ua(a).length;b=(""+b).toLowerCase();d=!0}}function pc(a,b,c){var d=!1;if(void 0===b||0>b)b=0;if(b>this.length)return"";if(void 0===c||c>this.length)c=this.length;if(0>=c)return"";c>>>=0;b>>>=0;if(c<=b)return"";for(a||(a="utf8");;)switch(a){case "hex":a=b;b=c;c=this.length;if(!a||0>a)a=0;if(!b||0>b||b>c)b=c;d="";for(c=a;c<b;++c)a=d,d=this[c],d=16>d?"0"+d.toString(16): d.toString(16),d=a+d;return d;case "utf8":case "utf-8":return vb(this,b,c);case "ascii":a="";for(c=Math.min(this.length,c);b<c;++b)a+=String.fromCharCode(this[b]&127);return a;case "latin1":case "binary":a="";for(c=Math.min(this.length,c);b<c;++b)a+=String.fromCharCode(this[b]);return a;case "base64":return b=0===b&&c===this.length?pb(this):pb(this.slice(b,c)),b;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":b=this.slice(b,c);c="";for(a=0;a<b.length;a+=2)c+=String.fromCharCode(b[a]+256*b[a+ 1]);return c;default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase();d=!0}}function S(a,b,c){var d=a[b];a[b]=a[c];a[c]=d}function wb(a,b,c,d,e){if(0===a.length)return-1;"string"===typeof c?(d=c,c=0):2147483647<c?c=2147483647:-2147483648>c&&(c=-2147483648);c=+c;isNaN(c)&&(c=e?0:a.length-1);0>c&&(c=a.length+c);if(c>=a.length){if(e)return-1;c=a.length-1}else if(0>c)if(e)c=0;else return-1;"string"===typeof b&&(b=h.from(b,d));if(E(b))return 0===b.length?-1:xb(a,b,c,d,e);if("number"=== typeof b)return b&=255,h.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(a,b,c):Uint8Array.prototype.lastIndexOf.call(a,b,c):xb(a,[b],c,d,e);throw new TypeError("val must be string, number or Buffer");}function xb(a,b,c,d,e){function f(a,b){return 1===k?a[b]:a.readUInt16BE(b*k)}var k=1,l=a.length,m=b.length;if(void 0!==d&&(d=String(d).toLowerCase(),"ucs2"===d||"ucs-2"===d||"utf16le"===d||"utf-16le"===d)){if(2>a.length||2>b.length)return-1; k=2;l/=2;m/=2;c/=2}if(e)for(d=-1;c<l;c++)if(f(a,c)===f(b,-1===d?0:c-d)){if(-1===d&&(d=c),c-d+1===m)return d*k}else-1!==d&&(c-=c-d),d=-1;else for(c+m>l&&(c=l-m);0<=c;c--){l=!0;for(d=0;d<m;d++)if(f(a,c+d)!==f(b,d)){l=!1;break}if(l)return c}return-1}function vb(a,b,c){c=Math.min(a.length,c);for(var d=[];b<c;){var e=a[b],f=null,k=239<e?4:223<e?3:191<e?2:1;if(b+k<=c)switch(k){case 1:128>e&&(f=e);break;case 2:var l=a[b+1];128===(l&192)&&(e=(e&31)<<6|l&63,127<e&&(f=e));break;case 3:l=a[b+1];var m=a[b+2]; 128===(l&192)&&128===(m&192)&&(e=(e&15)<<12|(l&63)<<6|m&63,2047<e&&(55296>e||57343<e)&&(f=e));break;case 4:l=a[b+1];m=a[b+2];var g=a[b+3];128===(l&192)&&128===(m&192)&&128===(g&192)&&(e=(e&15)<<18|(l&63)<<12|(m&63)<<6|g&63,65535<e&&1114112>e&&(f=e))}null===f?(f=65533,k=1):65535<f&&(f-=65536,d.push(f>>>10&1023|55296),f=56320|f&1023);d.push(f);b+=k}a=d.length;if(a<=yb)d=String.fromCharCode.apply(String,d);else{c="";for(b=0;b<a;)c+=String.fromCharCode.apply(String,d.slice(b,b+=yb));d=c}return d}function r(a, b,c){if(0!==a%1||0>a)throw new RangeError("offset is not uint");if(a+b>c)throw new RangeError("Trying to access beyond buffer length");}function y(a,b,c,d,e,f){if(!E(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(b>e||b<f)throw new RangeError('"value" argument is out of bounds');if(c+d>a.length)throw new RangeError("Index out of range");}function va(a,b,c,d){0>b&&(b=65535+b+1);for(var e=0,f=Math.min(a.length-c,2);e<f;++e)a[c+e]=(b&255<<8*(d?e:1-e))>>>8*(d?e:1-e)}function wa(a, b,c,d){0>b&&(b=4294967295+b+1);for(var e=0,f=Math.min(a.length-c,4);e<f;++e)a[c+e]=b>>>8*(d?e:3-e)&255}function xa(a,b,c,d,e,f){if(c+d>a.length)throw new RangeError("Index out of range");if(0>c)throw new RangeError("Index out of range");}function ua(a,b){b=b||Infinity;for(var c,d=a.length,e=null,f=[],k=0;k<d;++k){c=a.charCodeAt(k);if(55295<c&&57344>c){if(!e){if(56319<c){-1<(b-=3)&&f.push(239,191,189);continue}else if(k+1===d){-1<(b-=3)&&f.push(239,191,189);continue}e=c;continue}if(56320>c){-1<(b-= 3)&&f.push(239,191,189);e=c;continue}c=(e-55296<<10|c-56320)+65536}else e&&-1<(b-=3)&&f.push(239,191,189);e=null;if(128>c){if(0>--b)break;f.push(c)}else if(2048>c){if(0>(b-=2))break;f.push(c>>6|192,c&63|128)}else if(65536>c){if(0>(b-=3))break;f.push(c>>12|224,c>>6&63|128,c&63|128)}else if(1114112>c){if(0>(b-=4))break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else throw Error("Invalid code point");}return f}function zb(a){for(var b=[],c=0;c<a.length;++c)b.push(a.charCodeAt(c)&255);return b} function ub(a){a=(a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")).replace(qc,"");if(2>a.length)a="";else for(;0!==a.length%4;)a+="=";Qa||ob();var b=a.length;if(0<b%4)throw Error("Invalid string. Length must be a multiple of 4");var c="="===a[b-2]?2:"="===a[b-1]?1:0;var d=new rc(3*b/4-c);var e=0<c?b-4:b;var f=0;for(b=0;b<e;b+=4){var k=A[a.charCodeAt(b)]<<18|A[a.charCodeAt(b+1)]<<12|A[a.charCodeAt(b+2)]<<6|A[a.charCodeAt(b+3)];d[f++]=k>>16&255;d[f++]=k>>8&255;d[f++]=k&255}2===c?(k=A[a.charCodeAt(b)]<<2| A[a.charCodeAt(b+1)]>>4,d[f++]=k&255):1===c&&(k=A[a.charCodeAt(b)]<<10|A[a.charCodeAt(b+1)]<<4|A[a.charCodeAt(b+2)]>>2,d[f++]=k>>8&255,d[f++]=k&255);return d}function la(a,b,c,d){for(var e=0;e<d&&!(e+c>=b.length||e>=a.length);++e)b[e+c]=a[e];return e}function Ab(a){return!!a.constructor&&"function"===typeof a.constructor.isBuffer&&a.constructor.isBuffer(a)}function Va(a,b){return b={exports:{}},a(b,b.exports),b.exports}function Bb(){throw Error("setTimeout has not been defined");}function Cb(){throw Error("clearTimeout has not been defined"); }function Db(a){if(L===setTimeout)return setTimeout(a,0);if((L===Bb||!L)&&setTimeout)return L=setTimeout,setTimeout(a,0);try{return L(a,0)}catch(b){try{return L.call(null,a,0)}catch(c){return L.call(this,a,0)}}}function sc(a){if(M===clearTimeout)return clearTimeout(a);if((M===Cb||!M)&&clearTimeout)return M=clearTimeout,clearTimeout(a);try{return M(a)}catch(b){try{return M.call(null,a)}catch(c){return M.call(this,a)}}}function tc(){ba&&T&&(ba=!1,T.length?J=T.concat(J):ya=-1,J.length&&Eb())}function Eb(){if(!ba){var a= Db(tc);ba=!0;for(var b=J.length;b;){T=J;for(J=[];++ya<b;)T&&T[ya].run();ya=-1;b=J.length}T=null;ba=!1;sc(a)}}function Fb(a){var b=Array(arguments.length-1);if(1<arguments.length)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];J.push(new Gb(a,b));1!==J.length||ba||Db(Eb)}function Gb(a,b){this.fun=a;this.array=b}function U(){}function Hb(){Wa=!0;for(var a=0;64>a;++a)B[a]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[a],D["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(a)]= a;D[45]=62;D[95]=63}function uc(a,b,c){for(var d=[],e=b;e<c;e+=3)b=(a[e]<<16)+(a[e+1]<<8)+a[e+2],d.push(B[b>>18&63]+B[b>>12&63]+B[b>>6&63]+B[b&63]);return d.join("")}function Ib(a){Wa||Hb();for(var b=a.length,c=b%3,d="",e=[],f=0,k=b-c;f<k;f+=16383)e.push(uc(a,f,f+16383>k?k:f+16383));1===c?(a=a[b-1],d+=B[a>>2],d+=B[a<<4&63],d+="=="):2===c&&(a=(a[b-2]<<8)+a[b-1],d+=B[a>>10],d+=B[a>>4&63],d+=B[a<<2&63],d+="=");e.push(d);return e.join("")}function za(a,b,c,d,e){var f=8*e-d-1;var k=(1<<f)-1,l=k>>1,m=-7; e=c?e-1:0;var g=c?-1:1,h=a[b+e];e+=g;c=h&(1<<-m)-1;h>>=-m;for(m+=f;0<m;c=256*c+a[b+e],e+=g,m-=8);f=c&(1<<-m)-1;c>>=-m;for(m+=d;0<m;f=256*f+a[b+e],e+=g,m-=8);if(0===c)c=1-l;else{if(c===k)return f?NaN:Infinity*(h?-1:1);f+=Math.pow(2,d);c-=l}return(h?-1:1)*f*Math.pow(2,c-d)}function Aa(a,b,c,d,e,f){var k,l=8*f-e-1,m=(1<<l)-1,g=m>>1,h=23===e?Math.pow(2,-24)-Math.pow(2,-77):0;f=d?0:f-1;var n=d?1:-1,Ra=0>b||0===b&&0>1/b?1:0;b=Math.abs(b);isNaN(b)||Infinity===b?(b=isNaN(b)?1:0,d=m):(d=Math.floor(Math.log(b)/ Math.LN2),1>b*(k=Math.pow(2,-d))&&(d--,k*=2),b=1<=d+g?b+h/k:b+h*Math.pow(2,1-g),2<=b*k&&(d++,k/=2),d+g>=m?(b=0,d=m):1<=d+g?(b=(b*k-1)*Math.pow(2,e),d+=g):(b=b*Math.pow(2,g-1)*Math.pow(2,e),d=0));for(;8<=e;a[c+f]=b&255,f+=n,b/=256,e-=8);d=d<<e|b;for(l+=e;0<l;a[c+f]=d&255,f+=n,d/=256,l-=8);a[c+f-n]|=128*Ra}function K(a,b){if((g.TYPED_ARRAY_SUPPORT?2147483647:1073741823)<b)throw new RangeError("Invalid typed array length");g.TYPED_ARRAY_SUPPORT?(a=new Uint8Array(b),a.__proto__=g.prototype):(null===a&& (a=new g(b)),a.length=b);return a}function g(a,b,c){if(!(g.TYPED_ARRAY_SUPPORT||this instanceof g))return new g(a,b,c);if("number"===typeof a){if("string"===typeof b)throw Error("If encoding is specified then the first argument must be a string");return Xa(this,a)}return Jb(this,a,b,c)}function Jb(a,b,c,d){if("number"===typeof b)throw new TypeError('"value" argument must not be a number');if("undefined"!==typeof ArrayBuffer&&b instanceof ArrayBuffer){b.byteLength;if(0>c||b.byteLength<c)throw new RangeError("'offset' is out of bounds"); if(b.byteLength<c+(d||0))throw new RangeError("'length' is out of bounds");b=void 0===c&&void 0===d?new Uint8Array(b):void 0===d?new Uint8Array(b,c):new Uint8Array(b,c,d);g.TYPED_ARRAY_SUPPORT?(a=b,a.__proto__=g.prototype):a=Ya(a,b);return a}if("string"===typeof b){d=a;a=c;if("string"!==typeof a||""===a)a="utf8";if(!g.isEncoding(a))throw new TypeError('"encoding" must be a valid string encoding');c=Kb(b,a)|0;d=K(d,c);b=d.write(b,a);b!==c&&(d=d.slice(0,b));return d}return vc(a,b)}function Lb(a){if("number"!== typeof a)throw new TypeError('"size" argument must be a number');if(0>a)throw new RangeError('"size" argument must not be negative');}function Xa(a,b){Lb(b);a=K(a,0>b?0:Za(b)|0);if(!g.TYPED_ARRAY_SUPPORT)for(var c=0;c<b;++c)a[c]=0;return a}function Ya(a,b){var c=0>b.length?0:Za(b.length)|0;a=K(a,c);for(var d=0;d<c;d+=1)a[d]=b[d]&255;return a}function vc(a,b){if(G(b)){var c=Za(b.length)|0;a=K(a,c);if(0===a.length)return a;b.copy(a,0,0,c);return a}if(b){if("undefined"!==typeof ArrayBuffer&&b.buffer instanceof ArrayBuffer||"length"in b)return(c="number"!==typeof b.length)||(c=b.length,c=c!==c),c?K(a,0):Ya(a,b);if("Buffer"===b.type&&Mb(b.data))return Ya(a,b.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");}function Za(a){if(a>=(g.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(g.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return a|0}function G(a){return!(null== a||!a._isBuffer)}function Kb(a,b){if(G(a))return a.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(a)||a instanceof ArrayBuffer))return a.byteLength;"string"!==typeof a&&(a=""+a);var c=a.length;if(0===c)return 0;for(var d=!1;;)switch(b){case "ascii":case "latin1":case "binary":return c;case "utf8":case "utf-8":case void 0:return Ba(a).length;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return 2*c;case "hex":return c>>>1;case "base64":return Nb(a).length; default:if(d)return Ba(a).length;b=(""+b).toLowerCase();d=!0}}function wc(a,b,c){var d=!1;if(void 0===b||0>b)b=0;if(b>this.length)return"";if(void 0===c||c>this.length)c=this.length;if(0>=c)return"";c>>>=0;b>>>=0;if(c<=b)return"";for(a||(a="utf8");;)switch(a){case "hex":a=b;b=c;c=this.length;if(!a||0>a)a=0;if(!b||0>b||b>c)b=c;d="";for(c=a;c<b;++c)a=d,d=this[c],d=16>d?"0"+d.toString(16):d.toString(16),d=a+d;return d;case "utf8":case "utf-8":return Ob(this,b,c);case "ascii":a="";for(c=Math.min(this.length, c);b<c;++b)a+=String.fromCharCode(this[b]&127);return a;case "latin1":case "binary":a="";for(c=Math.min(this.length,c);b<c;++b)a+=String.fromCharCode(this[b]);return a;case "base64":return b=0===b&&c===this.length?Ib(this):Ib(this.slice(b,c)),b;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":b=this.slice(b,c);c="";for(a=0;a<b.length;a+=2)c+=String.fromCharCode(b[a]+256*b[a+1]);return c;default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase();d=!0}}function V(a,b,c){var d= a[b];a[b]=a[c];a[c]=d}function Pb(a,b,c,d,e){if(0===a.length)return-1;"string"===typeof c?(d=c,c=0):2147483647<c?c=2147483647:-2147483648>c&&(c=-2147483648);c=+c;isNaN(c)&&(c=e?0:a.length-1);0>c&&(c=a.length+c);if(c>=a.length){if(e)return-1;c=a.length-1}else if(0>c)if(e)c=0;else return-1;"string"===typeof b&&(b=g.from(b,d));if(G(b))return 0===b.length?-1:Qb(a,b,c,d,e);if("number"===typeof b)return b&=255,g.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(a, b,c):Uint8Array.prototype.lastIndexOf.call(a,b,c):Qb(a,[b],c,d,e);throw new TypeError("val must be string, number or Buffer");}function Qb(a,b,c,d,e){function f(a,b){return 1===k?a[b]:a.readUInt16BE(b*k)}var k=1,l=a.length,m=b.length;if(void 0!==d&&(d=String(d).toLowerCase(),"ucs2"===d||"ucs-2"===d||"utf16le"===d||"utf-16le"===d)){if(2>a.length||2>b.length)return-1;k=2;l/=2;m/=2;c/=2}if(e)for(d=-1;c<l;c++)if(f(a,c)===f(b,-1===d?0:c-d)){if(-1===d&&(d=c),c-d+1===m)return d*k}else-1!==d&&(c-=c-d),d= -1;else for(c+m>l&&(c=l-m);0<=c;c--){l=!0;for(d=0;d<m;d++)if(f(a,c+d)!==f(b,d)){l=!1;break}if(l)return c}return-1}function Ob(a,b,c){c=Math.min(a.length,c);for(var d=[];b<c;){var e=a[b],f=null,k=239<e?4:223<e?3:191<e?2:1;if(b+k<=c)switch(k){case 1:128>e&&(f=e);break;case 2:var l=a[b+1];128===(l&192)&&(e=(e&31)<<6|l&63,127<e&&(f=e));break;case 3:l=a[b+1];var m=a[b+2];128===(l&192)&&128===(m&192)&&(e=(e&15)<<12|(l&63)<<6|m&63,2047<e&&(55296>e||57343<e)&&(f=e));break;case 4:l=a[b+1];m=a[b+2];var g=a[b+ 3];128===(l&192)&&128===(m&192)&&128===(g&192)&&(e=(e&15)<<18|(l&63)<<12|(m&63)<<6|g&63,65535<e&&1114112>e&&(f=e))}null===f?(f=65533,k=1):65535<f&&(f-=65536,d.push(f>>>10&1023|55296),f=56320|f&1023);d.push(f);b+=k}a=d.length;if(a<=Rb)d=String.fromCharCode.apply(String,d);else{c="";for(b=0;b<a;)c+=String.fromCharCode.apply(String,d.slice(b,b+=Rb));d=c}return d}function w(a,b,c){if(0!==a%1||0>a)throw new RangeError("offset is not uint");if(a+b>c)throw new RangeError("Trying to access beyond buffer length"); }function z(a,b,c,d,e,f){if(!G(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(b>e||b<f)throw new RangeError('"value" argument is out of bounds');if(c+d>a.length)throw new RangeError("Index out of range");}function Ca(a,b,c,d){0>b&&(b=65535+b+1);for(var e=0,f=Math.min(a.length-c,2);e<f;++e)a[c+e]=(b&255<<8*(d?e:1-e))>>>8*(d?e:1-e)}function Da(a,b,c,d){0>b&&(b=4294967295+b+1);for(var e=0,f=Math.min(a.length-c,4);e<f;++e)a[c+e]=b>>>8*(d?e:3-e)&255}function Ea(a,b,c,d,e,f){if(c+ d>a.length)throw new RangeError("Index out of range");if(0>c)throw new RangeError("Index out of range");}function Ba(a,b){b=b||Infinity;for(var c,d=a.length,e=null,f=[],k=0;k<d;++k){c=a.charCodeAt(k);if(55295<c&&57344>c){if(!e){if(56319<c){-1<(b-=3)&&f.push(239,191,189);continue}else if(k+1===d){-1<(b-=3)&&f.push(239,191,189);continue}e=c;continue}if(56320>c){-1<(b-=3)&&f.push(239,191,189);e=c;continue}c=(e-55296<<10|c-56320)+65536}else e&&-1<(b-=3)&&f.push(239,191,189);e=null;if(128>c){if(0>--b)break; f.push(c)}else if(2048>c){if(0>(b-=2))break;f.push(c>>6|192,c&63|128)}else if(65536>c){if(0>(b-=3))break;f.push(c>>12|224,c>>6&63|128,c&63|128)}else if(1114112>c){if(0>(b-=4))break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else throw Error("Invalid code point");}return f}function Sb(a){for(var b=[],c=0;c<a.length;++c)b.push(a.charCodeAt(c)&255);return b}function Nb(a){a=(a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")).replace(xc,"");if(2>a.length)a="";else for(;0!==a.length%4;)a+="=";Wa||Hb(); var b=a.length;if(0<b%4)throw Error("Invalid string. Length must be a multiple of 4");var c="="===a[b-2]?2:"="===a[b-1]?1:0;var d=new yc(3*b/4-c);var e=0<c?b-4:b;var f=0;for(b=0;b<e;b+=4){var k=D[a.charCodeAt(b)]<<18|D[a.charCodeAt(b+1)]<<12|D[a.charCodeAt(b+2)]<<6|D[a.charCodeAt(b+3)];d[f++]=k>>16&255;d[f++]=k>>8&255;d[f++]=k&255}2===c?(k=D[a.charCodeAt(b)]<<2|D[a.charCodeAt(b+1)]>>4,d[f++]=k&255):1===c&&(k=D[a.charCodeAt(b)]<<10|D[a.charCodeAt(b+1)]<<4|D[a.charCodeAt(b+2)]>>2,d[f++]=k>>8&255,d[f++]= k&255);return d}function ma(a,b,c,d){for(var e=0;e<d&&!(e+c>=b.length||e>=a.length);++e)b[e+c]=a[e];return e}function Tb(a){return null!=a&&(!!a._isBuffer||Ub(a)||"function"===typeof a.readFloatLE&&"function"===typeof a.slice&&Ub(a.slice(0,0)))}function Ub(a){return!!a.constructor&&"function"===typeof a.constructor.isBuffer&&a.constructor.isBuffer(a)}function C(a){if("string"!==typeof a)throw new TypeError("Path must be a string. Received "+JSON.stringify(a));}function Vb(a,b){for(var c="",d=0,e= -1,f=0,k,l=0;l<=a.length;++l){if(l<a.length)k=a.charCodeAt(l);else if(47===k)break;else k=47;if(47===k){if(e!==l-1&&1!==f)if(e!==l-1&&2===f){if(2>c.length||2!==d||46!==c.charCodeAt(c.length-1)||46!==c.charCodeAt(c.length-2))if(2<c.length){if(e=c.lastIndexOf("/"),e!==c.length-1){-1===e?(c="",d=0):(c=c.slice(0,e),d=c.length-1-c.lastIndexOf("/"));e=l;f=0;continue}}else if(2===c.length||1===c.length){c="";d=0;e=l;f=0;continue}b&&(c=0<c.length?c+"/..":"..",d=2)}else c=0<c.length?c+("/"+a.slice(e+1,l)): a.slice(e+1,l),d=l-e-1;e=l;f=0}else 46===k&&-1!==f?++f:f=-1}return c}var Pa=function(a,b){Pa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return Pa(a,b)},zc="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof global?global:{},n="undefined"!==typeof BigInt?BigInt:zc.BigInt||Number,Fa=DataView;Fa.prototype.setBigUint64||(Fa.prototype.setBigUint64=function(a,b,c){if(b<Math.pow(2,32)){b= Number(b);var d=0}else{d=b.toString(2);b="";for(var e=0;e<64-d.length;e++)b+="0";b+=d;d=parseInt(b.substring(0,32),2);b=parseInt(b.substring(32),2)}this.setUint32(a+(c?0:4),b,c);this.setUint32(a+(c?4:0),d,c)},Fa.prototype.getBigUint64=function(a,b){var c=this.getUint32(a+(b?0:4),b);a=this.getUint32(a+(b?4:0),b);c=c.toString(2);a=a.toString(2);b="";for(var d=0;d<32-c.length;d++)b+="0";return n("0b"+a+(b+c))});var W="undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window? window:{},F=[],A=[],rc="undefined"!==typeof Uint8Array?Uint8Array:Array,Qa=!1,Ac={}.toString,tb=Array.isArray||function(a){return"[object Array]"==Ac.call(a)};h.TYPED_ARRAY_SUPPORT=void 0!==W.TYPED_ARRAY_SUPPORT?W.TYPED_ARRAY_SUPPORT:!0;h.poolSize=8192;h._augment=function(a){a.__proto__=h.prototype;return a};h.from=function(a,b,c){return qb(null,a,b,c)};h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array);h.alloc=function(a,b,c){sb(a);a=0>=a?I(null,a):void 0!== b?"string"===typeof c?I(null,a).fill(b,c):I(null,a).fill(b):I(null,a);return a};h.allocUnsafe=function(a){return Sa(null,a)};h.allocUnsafeSlow=function(a){return Sa(null,a)};h.isBuffer=function(a){return null!=a&&(!!a._isBuffer||Ab(a)||"function"===typeof a.readFloatLE&&"function"===typeof a.slice&&Ab(a.slice(0,0)))};h.compare=function(a,b){if(!E(a)||!E(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var c=a.length,d=b.length,e=0,f=Math.min(c,d);e<f;++e)if(a[e]!==b[e]){c= a[e];d=b[e];break}return c<d?-1:d<c?1:0};h.isEncoding=function(a){switch(String(a).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}};h.concat=function(a,b){if(!tb(a))throw new TypeError('"list" argument must be an Array of Buffers');if(0===a.length)return h.alloc(0);var c;if(void 0===b)for(c=b=0;c<a.length;++c)b+=a[c].length;b=h.allocUnsafe(b);var d=0;for(c=0;c< a.length;++c){var e=a[c];if(!E(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(b,d);d+=e.length}return b};h.byteLength=rb;h.prototype._isBuffer=!0;h.prototype.swap16=function(){var a=this.length;if(0!==a%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var b=0;b<a;b+=2)S(this,b,b+1);return this};h.prototype.swap32=function(){var a=this.length;if(0!==a%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var b=0;b<a;b+=4)S(this, b,b+3),S(this,b+1,b+2);return this};h.prototype.swap64=function(){var a=this.length;if(0!==a%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var b=0;b<a;b+=8)S(this,b,b+7),S(this,b+1,b+6),S(this,b+2,b+5),S(this,b+3,b+4);return this};h.prototype.toString=function(){var a=this.length|0;return 0===a?"":0===arguments.length?vb(this,0,a):pc.apply(this,arguments)};h.prototype.equals=function(a){if(!E(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:0===h.compare(this, a)};h.prototype.inspect=function(){var a="";0<this.length&&(a=this.toString("hex",0,50).match(/.{2}/g).join(" "),50<this.length&&(a+=" ... "));return"<Buffer "+a+">"};h.prototype.compare=function(a,b,c,d,e){if(!E(a))throw new TypeError("Argument must be a Buffer");void 0===b&&(b=0);void 0===c&&(c=a?a.length:0);void 0===d&&(d=0);void 0===e&&(e=this.length);if(0>b||c>a.length||0>d||e>this.length)throw new RangeError("out of range index");if(d>=e&&b>=c)return 0;if(d>=e)return-1;if(b>=c)return 1;b>>>= 0;c>>>=0;d>>>=0;e>>>=0;if(this===a)return 0;var f=e-d,k=c-b,l=Math.min(f,k);d=this.slice(d,e);a=a.slice(b,c);for(b=0;b<l;++b)if(d[b]!==a[b]){f=d[b];k=a[b];break}return f<k?-1:k<f?1:0};h.prototype.includes=function(a,b,c){return-1!==this.indexOf(a,b,c)};h.prototype.indexOf=function(a,b,c){return wb(this,a,b,c,!0)};h.prototype.lastIndexOf=function(a,b,c){return wb(this,a,b,c,!1)};h.prototype.write=function(a,b,c,d){if(void 0===b)d="utf8",c=this.length,b=0;else if(void 0===c&&"string"===typeof b)d=b, c=this.length,b=0;else if(isFinite(b))b|=0,isFinite(c)?(c|=0,void 0===d&&(d="utf8")):(d=c,c=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var e=this.length-b;if(void 0===c||c>e)c=e;if(0<a.length&&(0>c||0>b)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");d||(d="utf8");for(e=!1;;)switch(d){case "hex":a:{b=Number(b)||0;d=this.length-b;c?(c=Number(c),c>d&&(c=d)):c=d;d=a.length;if(0!==d%2)throw new TypeError("Invalid hex string"); c>d/2&&(c=d/2);for(d=0;d<c;++d){e=parseInt(a.substr(2*d,2),16);if(isNaN(e)){a=d;break a}this[b+d]=e}a=d}return a;case "utf8":case "utf-8":return la(ua(a,this.length-b),this,b,c);case "ascii":return la(zb(a),this,b,c);case "latin1":case "binary":return la(zb(a),this,b,c);case "base64":return la(ub(a),this,b,c);case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":d=a;e=this.length-b;for(var f=[],k=0;k<d.length&&!(0>(e-=2));++k){var l=d.charCodeAt(k);a=l>>8;l%=256;f.push(l);f.push(a)}return la(f, this,b,c);default:if(e)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase();e=!0}};h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var yb=4096;h.prototype.slice=function(a,b){var c=this.length;a=~~a;b=void 0===b?c:~~b;0>a?(a+=c,0>a&&(a=0)):a>c&&(a=c);0>b?(b+=c,0>b&&(b=0)):b>c&&(b=c);b<a&&(b=a);if(h.TYPED_ARRAY_SUPPORT)b=this.subarray(a,b),b.__proto__=h.prototype;else{c=b-a;b=new h(c,void 0);for(var d=0;d<c;++d)b[d]=this[d+a]}return b}; h.prototype.readUIntLE=function(a,b,c){a|=0;b|=0;c||r(a,b,this.length);c=this[a];for(var d=1,e=0;++e<b&&(d*=256);)c+=this[a+e]*d;return c};h.prototype.readUIntBE=function(a,b,c){a|=0;b|=0;c||r(a,b,this.length);c=this[a+--b];for(var d=1;0<b&&(d*=256);)c+=this[a+--b]*d;return c};h.prototype.readUInt8=function(a,b){b||r(a,1,this.length);return this[a]};h.prototype.readUInt16LE=function(a,b){b||r(a,2,this.length);return this[a]|this[a+1]<<8};h.prototype.readUInt16BE=function(a,b){b||r(a,2,this.length); return this[a]<<8|this[a+1]};h.prototype.readUInt32LE=function(a,b){b||r(a,4,this.length);return(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]};h.prototype.readUInt32BE=function(a,b){b||r(a,4,this.length);return 16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])};h.prototype.readIntLE=function(a,b,c){a|=0;b|=0;c||r(a,b,this.length);c=this[a];for(var d=1,e=0;++e<b&&(d*=256);)c+=this[a+e]*d;c>=128*d&&(c-=Math.pow(2,8*b));return c};h.prototype.readIntBE=function(a,b,c){a|=0;b|=0;c||r(a, b,this.length);c=b;for(var d=1,e=this[a+--c];0<c&&(d*=256);)e+=this[a+--c]*d;e>=128*d&&(e-=Math.pow(2,8*b));return e};h.prototype.readInt8=function(a,b){b||r(a,1,this.length);return this[a]&128?-1*(255-this[a]+1):this[a]};h.prototype.readInt16LE=function(a,b){b||r(a,2,this.length);a=this[a]|this[a+1]<<8;return a&32768?a|4294901760:a};h.prototype.readInt16BE=function(a,b){b||r(a,2,this.length);a=this[a+1]|this[a]<<8;return a&32768?a|4294901760:a};h.prototype.readInt32LE=function(a,b){b||r(a,4,this.length); return this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24};h.prototype.readInt32BE=function(a,b){b||r(a,4,this.length);return this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]};h.prototype.readFloatLE=function(a,b){b||r(a,4,this.length);return sa(this,a,!0,23,4)};h.prototype.readFloatBE=function(a,b){b||r(a,4,this.length);return sa(this,a,!1,23,4)};h.prototype.readDoubleLE=function(a,b){b||r(a,8,this.length);return sa(this,a,!0,52,8)};h.prototype.readDoubleBE=function(a,b){b||r(a,8,this.length);return sa(this, a,!1,52,8)};h.prototype.writeUIntLE=function(a,b,c,d){a=+a;b|=0;c|=0;d||y(this,a,b,c,Math.pow(2,8*c)-1,0);d=1;var e=0;for(this[b]=a&255;++e<c&&(d*=256);)this[b+e]=a/d&255;return b+c};h.prototype.writeUIntBE=function(a,b,c,d){a=+a;b|=0;c|=0;d||y(this,a,b,c,Math.pow(2,8*c)-1,0);d=c-1;var e=1;for(this[b+d]=a&255;0<=--d&&(e*=256);)this[b+d]=a/e&255;return b+c};h.prototype.writeUInt8=function(a,b,c){a=+a;b|=0;c||y(this,a,b,1,255,0);h.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));this[b]=a&255;return b+1};h.prototype.writeUInt16LE= function(a,b,c){a=+a;b|=0;c||y(this,a,b,2,65535,0);h.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8):va(this,a,b,!0);return b+2};h.prototype.writeUInt16BE=function(a,b,c){a=+a;b|=0;c||y(this,a,b,2,65535,0);h.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a&255):va(this,a,b,!1);return b+2};h.prototype.writeUInt32LE=function(a,b,c){a=+a;b|=0;c||y(this,a,b,4,4294967295,0);h.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=a&255):wa(this,a,b,!0);return b+4};h.prototype.writeUInt32BE= function(a,b,c){a=+a;b|=0;c||y(this,a,b,4,4294967295,0);h.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a&255):wa(this,a,b,!1);return b+4};h.prototype.writeIntLE=function(a,b,c,d){a=+a;b|=0;d||(d=Math.pow(2,8*c-1),y(this,a,b,c,d-1,-d));d=0;var e=1,f=0;for(this[b]=a&255;++d<c&&(e*=256);)0>a&&0===f&&0!==this[b+d-1]&&(f=1),this[b+d]=(a/e>>0)-f&255;return b+c};h.prototype.writeIntBE=function(a,b,c,d){a=+a;b|=0;d||(d=Math.pow(2,8*c-1),y(this,a,b,c,d-1,-d));d=c-1;var e= 1,f=0;for(this[b+d]=a&255;0<=--d&&(e*=256);)0>a&&0===f&&0!==this[b+d+1]&&(f=1),this[b+d]=(a/e>>0)-f&255;return b+c};h.prototype.writeInt8=function(a,b,c){a=+a;b|=0;c||y(this,a,b,1,127,-128);h.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));0>a&&(a=255+a+1);this[b]=a&255;return b+1};h.prototype.writeInt16LE=function(a,b,c){a=+a;b|=0;c||y(this,a,b,2,32767,-32768);h.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8):va(this,a,b,!0);return b+2};h.prototype.writeInt16BE=function(a,b,c){a=+a;b|=0;c||y(this,a,b, 2,32767,-32768);h.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a&255):va(this,a,b,!1);return b+2};h.prototype.writeInt32LE=function(a,b,c){a=+a;b|=0;c||y(this,a,b,4,2147483647,-2147483648);h.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):wa(this,a,b,!0);return b+4};h.prototype.writeInt32BE=function(a,b,c){a=+a;b|=0;c||y(this,a,b,4,2147483647,-2147483648);0>a&&(a=4294967295+a+1);h.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]= a&255):wa(this,a,b,!1);return b+4};h.prototype.writeFloatLE=function(a,b,c){c||xa(this,a,b,4);ta(this,a,b,!0,23,4);return b+4};h.prototype.writeFloatBE=function(a,b,c){c||xa(this,a,b,4);ta(this,a,b,!1,23,4);return b+4};h.prototype.writeDoubleLE=function(a,b,c){c||xa(this,a,b,8);ta(this,a,b,!0,52,8);return b+8};h.prototype.writeDoubleBE=function(a,b,c){c||xa(this,a,b,8);ta(this,a,b,!1,52,8);return b+8};h.prototype.copy=function(a,b,c,d){c||(c=0);d||0===d||(d=this.length);b>=a.length&&(b=a.length); b||(b=0);0<d&&d<c&&(d=c);if(d===c||0===a.length||0===this.length)return 0;if(0>b)throw new RangeError("targetStart out of bounds");if(0>c||c>=this.length)throw new RangeError("sourceStart out of bounds");if(0>d)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length);a.length-b<d-c&&(d=a.length-b+c);var e=d-c;if(this===a&&c<b&&b<d)for(d=e-1;0<=d;--d)a[d+b]=this[d+c];else if(1E3>e||!h.TYPED_ARRAY_SUPPORT)for(d=0;d<e;++d)a[d+b]=this[d+c];else Uint8Array.prototype.set.call(a,this.subarray(c, c+e),b);return e};h.prototype.fill=function(a,b,c,d){if("string"===typeof a){"string"===typeof b?(d=b,b=0,c=this.length):"string"===typeof c&&(d=c,c=this.length);if(1===a.length){var e=a.charCodeAt(0);256>e&&(a=e)}if(void 0!==d&&"string"!==typeof d)throw new TypeError("encoding must be a string");if("string"===typeof d&&!h.isEncoding(d))throw new TypeError("Unknown encoding: "+d);}else"number"===typeof a&&(a&=255);if(0>b||this.length<b||this.length<c)throw new RangeError("Out of range index");if(c<= b)return this;b>>>=0;c=void 0===c?this.length:c>>>0;a||(a=0);if("number"===typeof a)for(d=b;d<c;++d)this[d]=a;else for(a=E(a)?a:ua((new h(a,d)).toString()),e=a.length,d=0;d<c-b;++d)this[d+b]=a[d%e];return this};var qc=/[^+\/0-9A-Za-z-_]/g,x=h,Ga="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{},L=Bb,M=Cb;"function"===typeof W.setTimeout&&(L=setTimeout);"function"===typeof W.clearTimeout&&(M=clearTimeout); var J=[],ba=!1,T,ya=-1;Gb.prototype.run=function(){this.fun.apply(null,this.array)};var ca=W.performance||{},Bc=ca.now||ca.mozNow||ca.msNow||ca.oNow||ca.webkitNow||function(){return(new Date).getTime()},Cc=new Date,Dc={nextTick:Fb,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:U,addListener:U,once:U,off:U,removeListener:U,removeAllListeners:U,emit:U,binding:function(a){throw Error("process.binding is not supported");},cwd:function(){return"/"},chdir:function(a){throw Error("process.chdir is not supported"); },umask:function(){return 0},hrtime:function(a){var b=.001*Bc.call(ca),c=Math.floor(b);b=Math.floor(b%1*1E9);a&&(c-=a[0],b-=a[1],0>b&&(c--,b+=1E9));return[c,b]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Cc)/1E3}},B=[],D=[],yc="undefined"!==typeof Uint8Array?Uint8Array:Array,Wa=!1,Ec={}.toString,Mb=Array.isArray||function(a){return"[object Array]"==Ec.call(a)};g.TYPED_ARRAY_SUPPORT=void 0!==W.TYPED_ARRAY_SUPPORT?W.TYPED_ARRAY_SUPPORT:!0;var Fc=g.TYPED_ARRAY_SUPPORT? 2147483647:1073741823;g.poolSize=8192;g._augment=function(a){a.__proto__=g.prototype;return a};g.from=function(a,b,c){return Jb(null,a,b,c)};g.TYPED_ARRAY_SUPPORT&&(g.prototype.__proto__=Uint8Array.prototype,g.__proto__=Uint8Array);g.alloc=function(a,b,c){Lb(a);a=0>=a?K(null,a):void 0!==b?"string"===typeof c?K(null,a).fill(b,c):K(null,a).fill(b):K(null,a);return a};g.allocUnsafe=function(a){return Xa(null,a)};g.allocUnsafeSlow=function(a){return Xa(null,a)};g.isBuffer=Tb;g.compare=function(a,b){if(!G(a)|| !G(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var c=a.length,d=b.length,e=0,f=Math.min(c,d);e<f;++e)if(a[e]!==b[e]){c=a[e];d=b[e];break}return c<d?-1:d<c?1:0};g.isEncoding=function(a){switch(String(a).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}};g.concat=function(a,b){if(!Mb(a))throw new TypeError('"list" argument must be an Array of Buffers'); if(0===a.length)return g.alloc(0);var c;if(void 0===b)for(c=b=0;c<a.length;++c)b+=a[c].length;b=g.allocUnsafe(b);var d=0;for(c=0;c<a.length;++c){var e=a[c];if(!G(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(b,d);d+=e.length}return b};g.byteLength=Kb;g.prototype._isBuffer=!0;g.prototype.swap16=function(){var a=this.length;if(0!==a%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var b=0;b<a;b+=2)V(this,b,b+1);return this};g.prototype.swap32=function(){var a= this.length;if(0!==a%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var b=0;b<a;b+=4)V(this,b,b+3),V(this,b+1,b+2);return this};g.prototype.swap64=function(){var a=this.length;if(0!==a%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var b=0;b<a;b+=8)V(this,b,b+7),V(this,b+1,b+6),V(this,b+2,b+5),V(this,b+3,b+4);return this};g.prototype.toString=function(){var a=this.length|0;return 0===a?"":0===arguments.length?Ob(this,0,a):wc.apply(this,arguments)}; g.prototype.equals=function(a){if(!G(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:0===g.compare(this,a)};g.prototype.inspect=function(){var a="";0<this.length&&(a=this.toString("hex",0,50).match(/.{2}/g).join(" "),50<this.length&&(a+=" ... "));return"<Buffer "+a+">"};g.prototype.compare=function(a,b,c,d,e){if(!G(a))throw new TypeError("Argument must be a Buffer");void 0===b&&(b=0);void 0===c&&(c=a?a.length:0);void 0===d&&(d=0);void 0===e&&(e=this.length);if(0>b||c>a.length|| 0>d||e>this.length)throw new RangeError("out of range index");if(d>=e&&b>=c)return 0;if(d>=e)return-1;if(b>=c)return 1;b>>>=0;c>>>=0;d>>>=0;e>>>=0;if(this===a)return 0;var f=e-d,k=c-b,l=Math.min(f,k);d=this.slice(d,e);a=a.slice(b,c);for(b=0;b<l;++b)if(d[b]!==a[b]){f=d[b];k=a[b];break}return f<k?-1:k<f?1:0};g.prototype.includes=function(a,b,c){return-1!==this.indexOf(a,b,c)};g.prototype.indexOf=function(a,b,c){return Pb(this,a,b,c,!0)};g.prototype.lastIndexOf=function(a,b,c){return Pb(this,a,b,c,!1)}; g.prototype.write=function(a,b,c,d){if(void 0===b)d="utf8",c=this.length,b=0;else if(void 0===c&&"string"===typeof b)d=b,c=this.length,b=0;else if(isFinite(b))b|=0,isFinite(c)?(c|=0,void 0===d&&(d="utf8")):(d=c,c=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var e=this.length-b;if(void 0===c||c>e)c=e;if(0<a.length&&(0>c||0>b)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");d||(d="utf8");for(e=!1;;)switch(d){case "hex":a:{b= Number(b)||0;d=this.length-b;c?(c=Number(c),c>d&&(c=d)):c=d;d=a.length;if(0!==d%2)throw new TypeError("Invalid hex string");c>d/2&&(c=d/2);for(d=0;d<c;++d){e=parseInt(a.substr(2*d,2),16);if(isNaN(e)){a=d;break a}this[b+d]=e}a=d}return a;case "utf8":case "utf-8":return ma(Ba(a,this.length-b),this,b,c);case "ascii":return ma(Sb(a),this,b,c);case "latin1":case "binary":return ma(Sb(a),this,b,c);case "base64":return ma(Nb(a),this,b,c);case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":d=a;e=this.length- b;for(var f=[],k=0;k<d.length&&!(0>(e-=2));++k){var l=d.charCodeAt(k);a=l>>8;l%=256;f.push(l);f.push(a)}return ma(f,this,b,c);default:if(e)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase();e=!0}};g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Rb=4096;g.prototype.slice=function(a,b){var c=this.length;a=~~a;b=void 0===b?c:~~b;0>a?(a+=c,0>a&&(a=0)):a>c&&(a=c);0>b?(b+=c,0>b&&(b=0)):b>c&&(b=c);b<a&&(b=a);if(g.TYPED_ARRAY_SUPPORT)b= this.subarray(a,b),b.__proto__=g.prototype;else{c=b-a;b=new g(c,void 0);for(var d=0;d<c;++d)b[d]=this[d+a]}return b};g.prototype.readUIntLE=function(a,b,c){a|=0;b|=0;c||w(a,b,this.length);c=this[a];for(var d=1,e=0;++e<b&&(d*=256);)c+=this[a+e]*d;return c};g.prototype.readUIntBE=function(a,b,c){a|=0;b|=0;c||w(a,b,this.length);c=this[a+--b];for(var d=1;0<b&&(d*=256);)c+=this[a+--b]*d;return c};g.prototype.readUInt8=function(a,b){b||w(a,1,this.length);return this[a]};g.prototype.readUInt16LE=function(a, b){b||w(a,2,this.length);return this[a]|this[a+1]<<8};g.prototype.readUInt16BE=function(a,b){b||w(a,2,this.length);return this[a]<<8|this[a+1]};g.prototype.readUInt32LE=function(a,b){b||w(a,4,this.length);return(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]};g.prototype.readUInt32BE=function(a,b){b||w(a,4,this.length);return 16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])};g.prototype.readIntLE=function(a,b,c){a|=0;b|=0;c||w(a,b,this.length);c=this[a];for(var d=1,e=0;++e<b&&(d*=256);)c+= this[a+e]*d;c>=128*d&&(c-=Math.pow(2,8*b));return c};g.prototype.readIntBE=function(a,b,c){a|=0;b|=0;c||w(a,b,this.length);c=b;for(var d=1,e=this[a+--c];0<c&&(d*=256);)e+=this[a+--c]*d;e>=128*d&&(e-=Math.pow(2,8*b));return e};g.prototype.readInt8=function(a,b){b||w(a,1,this.length);return this[a]&128?-1*(255-this[a]+1):this[a]};g.prototype.readInt16LE=function(a,b){b||w(a,2,this.length);a=this[a]|this[a+1]<<8;return a&32768?a|4294901760:a};g.prototype.readInt16BE=function(a,b){b||w(a,2,this.length); a=this[a+1]|this[a]<<8;return a&32768?a|4294901760:a};g.prototype.readInt32LE=function(a,b){b||w(a,4,this.length);return this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24};g.prototype.readInt32BE=function(a,b){b||w(a,4,this.length);return this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]};g.prototype.readFloatLE=function(a,b){b||w(a,4,this.length);return za(this,a,!0,23,4)};g.prototype.readFloatBE=function(a,b){b||w(a,4,this.length);return za(this,a,!1,23,4)};g.prototype.readDoubleLE=function(a,b){b|| w(a,8,this.length);return za(this,a,!0,52,8)};g.prototype.readDoubleBE=function(a,b){b||w(a,8,this.length);return za(this,a,!1,52,8)};g.prototype.writeUIntLE=function(a,b,c,d){a=+a;b|=0;c|=0;d||z(this,a,b,c,Math.pow(2,8*c)-1,0);d=1;var e=0;for(this[b]=a&255;++e<c&&(d*=256);)this[b+e]=a/d&255;return b+c};g.prototype.writeUIntBE=function(a,b,c,d){a=+a;b|=0;c|=0;d||z(this,a,b,c,Math.pow(2,8*c)-1,0);d=c-1;var e=1;for(this[b+d]=a&255;0<=--d&&(e*=256);)this[b+d]=a/e&255;return b+c};g.prototype.writeUInt8= function(a,b,c){a=+a;b|=0;c||z(this,a,b,1,255,0);g.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));this[b]=a&255;return b+1};g.prototype.writeUInt16LE=function(a,b,c){a=+a;b|=0;c||z(this,a,b,2,65535,0);g.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8):Ca(this,a,b,!0);return b+2};g.prototype.writeUInt16BE=function(a,b,c){a=+a;b|=0;c||z(this,a,b,2,65535,0);g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a&255):Ca(this,a,b,!1);return b+2};g.prototype.writeUInt32LE=function(a,b,c){a=+a;b|=0;c||z(this,a,b,4, 4294967295,0);g.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=a&255):Da(this,a,b,!0);return b+4};g.prototype.writeUInt32BE=function(a,b,c){a=+a;b|=0;c||z(this,a,b,4,4294967295,0);g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a&255):Da(this,a,b,!1);return b+4};g.prototype.writeIntLE=function(a,b,c,d){a=+a;b|=0;d||(d=Math.pow(2,8*c-1),z(this,a,b,c,d-1,-d));d=0;var e=1,f=0;for(this[b]=a&255;++d<c&&(e*=256);)0>a&&0===f&&0!==this[b+d- 1]&&(f=1),this[b+d]=(a/e>>0)-f&255;return b+c};g.prototype.writeIntBE=function(a,b,c,d){a=+a;b|=0;d||(d=Math.pow(2,8*c-1),z(this,a,b,c,d-1,-d));d=c-1;var e=1,f=0;for(this[b+d]=a&255;0<=--d&&(e*=256);)0>a&&0===f&&0!==this[b+d+1]&&(f=1),this[b+d]=(a/e>>0)-f&255;return b+c};g.prototype.writeInt8=function(a,b,c){a=+a;b|=0;c||z(this,a,b,1,127,-128);g.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));0>a&&(a=255+a+1);this[b]=a&255;return b+1};g.prototype.writeInt16LE=function(a,b,c){a=+a;b|=0;c||z(this,a,b,2,32767, -32768);g.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8):Ca(this,a,b,!0);return b+2};g.prototype.writeInt16BE=function(a,b,c){a=+a;b|=0;c||z(this,a,b,2,32767,-32768);g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a&255):Ca(this,a,b,!1);return b+2};g.prototype.writeInt32LE=function(a,b,c){a=+a;b|=0;c||z(this,a,b,4,2147483647,-2147483648);g.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):Da(this,a,b,!0);return b+4};g.prototype.writeInt32BE=function(a,b,c){a= +a;b|=0;c||z(this,a,b,4,2147483647,-2147483648);0>a&&(a=4294967295+a+1);g.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a&255):Da(this,a,b,!1);return b+4};g.prototype.writeFloatLE=function(a,b,c){c||Ea(this,a,b,4);Aa(this,a,b,!0,23,4);return b+4};g.prototype.writeFloatBE=function(a,b,c){c||Ea(this,a,b,4);Aa(this,a,b,!1,23,4);return b+4};g.prototype.writeDoubleLE=function(a,b,c){c||Ea(this,a,b,8);Aa(this,a,b,!0,52,8);return b+8};g.prototype.writeDoubleBE=function(a, b,c){c||Ea(this,a,b,8);Aa(this,a,b,!1,52,8);return b+8};g.prototype.copy=function(a,b,c,d){c||(c=0);d||0===d||(d=this.length);b>=a.length&&(b=a.length);b||(b=0);0<d&&d<c&&(d=c);if(d===c||0===a.length||0===this.length)return 0;if(0>b)throw new RangeError("targetStart out of bounds");if(0>c||c>=this.length)throw new RangeError("sourceStart out of bounds");if(0>d)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length);a.length-b<d-c&&(d=a.length-b+c);var e=d-c;if(this===a&&c<b&& b<d)for(d=e-1;0<=d;--d)a[d+b]=this[d+c];else if(1E3>e||!g.TYPED_ARRAY_SUPPORT)for(d=0;d<e;++d)a[d+b]=this[d+c];else Uint8Array.prototype.set.call(a,this.subarray(c,c+e),b);return e};g.prototype.fill=function(a,b,c,d){if("string"===typeof a){"string"===typeof b?(d=b,b=0,c=this.length):"string"===typeof c&&(d=c,c=this.length);if(1===a.length){var e=a.charCodeAt(0);256>e&&(a=e)}if(void 0!==d&&"string"!==typeof d)throw new TypeError("encoding must be a string");if("string"===typeof d&&!g.isEncoding(d))throw new TypeError("Unknown encoding: "+ d);}else"number"===typeof a&&(a&=255);if(0>b||this.length<b||this.length<c)throw new RangeError("Out of range index");if(c<=b)return this;b>>>=0;c=void 0===c?this.length:c>>>0;a||(a=0);if("number"===typeof a)for(d=b;d<c;++d)this[d]=a;else for(a=G(a)?a:Ba((new g(a,d)).toString()),e=a.length,d=0;d<c-b;++d)this[d+b]=a[d%e];return this};var xc=/[^+\/0-9A-Za-z-_]/g,Ha=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:Fc,Buffer:g,SlowBuffer:function(a){+a!=a&&(a=0);return g.alloc(+a)},isBuffer:Tb}), Wb=Va(function(a,b){function c(a,b){for(var c in a)b[c]=a[c]}function d(a,b,c){return e(a,b,c)}var e=Ha.Buffer;e.from&&e.alloc&&e.allocUnsafe&&e.allocUnsafeSlow?a.exports=Ha:(c(Ha,b),b.Buffer=d);d.prototype=Object.create(e.prototype);c(e,d);d.from=function(a,b,c){if("number"===typeof a)throw new TypeError("Argument must not be a number");return e(a,b,c)};d.alloc=function(a,b,c){if("number"!==typeof a)throw new TypeError("Argument must be a number");a=e(a);void 0!==b?"string"===typeof c?a.fill(b,c): a.fill(b):a.fill