From 0496e08ba717ee7b2b81200987794de791d977a9 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Thu, 7 Nov 2024 14:29:24 -0800 Subject: [PATCH] Build minified CJS, ESM, and IIFE bundles with esbuild. --- dist/cjs/index.js | 12 ++++++++++++ dist/esm/index.js | 12 ++++++++++++ dist/iife/index.js | 12 ++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 dist/cjs/index.js create mode 100644 dist/esm/index.js create mode 100644 dist/iife/index.js diff --git a/dist/cjs/index.js b/dist/cjs/index.js new file mode 100644 index 0000000..4e739ef --- /dev/null +++ b/dist/cjs/index.js @@ -0,0 +1,12 @@ +"use strict";var Y=(n,r)=>()=>(r||n((r={exports:{}}).exports,r),r.exports);var W=Y(S=>{"use strict";S.byteLength=sr;S.toByteArray=wr;S.fromByteArray=Er;var E=[],x=[],ar=typeof Uint8Array<"u"?Uint8Array:Array,L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(I=0,q=L.length;I0)throw new Error("Invalid string. Length must be a multiple of 4");var t=n.indexOf("=");t===-1&&(t=r);var i=t===r?0:4-t%4;return[t,i]}function sr(n){var r=H(n),t=r[0],i=r[1];return(t+i)*3/4-i}function yr(n,r,t){return(r+t)*3/4-t}function wr(n){var r,t=H(n),i=t[0],e=t[1],o=new ar(yr(n,i,e)),u=0,c=e>0?i-4:i,f;for(f=0;f>16&255,o[u++]=r>>8&255,o[u++]=r&255;return e===2&&(r=x[n.charCodeAt(f)]<<2|x[n.charCodeAt(f+1)]>>4,o[u++]=r&255),e===1&&(r=x[n.charCodeAt(f)]<<10|x[n.charCodeAt(f+1)]<<4|x[n.charCodeAt(f+2)]>>2,o[u++]=r>>8&255,o[u++]=r&255),o}function xr(n){return E[n>>18&63]+E[n>>12&63]+E[n>>6&63]+E[n&63]}function Br(n,r,t){for(var i,e=[],o=r;oc?c:u+o));return i===1?(r=n[t-1],e.push(E[r>>2]+E[r<<4&63]+"==")):i===2&&(r=(n[t-2]<<8)+n[t-1],e.push(E[r>>10]+E[r>>4&63]+E[r<<2&63]+"=")),e.join("")}});var X=Y(M=>{M.read=function(n,r,t,i,e){var o,u,c=e*8-i-1,f=(1<>1,l=-7,a=t?e-1:0,F=t?-1:1,B=n[r+a];for(a+=F,o=B&(1<<-l)-1,B>>=-l,l+=c;l>0;o=o*256+n[r+a],a+=F,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=i;l>0;u=u*256+n[r+a],a+=F,l-=8);if(o===0)o=1-p;else{if(o===f)return u?NaN:(B?-1:1)*(1/0);u=u+Math.pow(2,i),o=o-p}return(B?-1:1)*u*Math.pow(2,o-i)};M.write=function(n,r,t,i,e,o){var u,c,f,p=o*8-e-1,l=(1<>1,F=e===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=i?0:o-1,N=i?1:-1,lr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,u=l):(u=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-u))<1&&(u--,f*=2),u+a>=1?r+=F/f:r+=F*Math.pow(2,1-a),r*f>=2&&(u++,f/=2),u+a>=l?(c=0,u=l):u+a>=1?(c=(r*f-1)*Math.pow(2,e),u=u+a):(c=r*Math.pow(2,a-1)*Math.pow(2,e),u=0));e>=8;n[t+B]=c&255,B+=N,c/=256,e-=8);for(u=u<0;n[t+B]=u&255,B+=N,u/=256,p-=8);n[t+B-N]|=lr*128}});var b=W(),U=X(),j=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;exports.Buffer=h;exports.SlowBuffer=Ar;exports.INSPECT_MAX_BYTES=50;var R=2147483647;exports.kMaxLength=R;var Z=(1<<28)-16;exports.kStringMaxLength=Z;exports.constants={MAX_LENGTH:R,MAX_STRING_LENGTH:Z};exports.Blob=typeof Blob<"u"?Blob:void 0;exports.File=typeof File<"u"?File:void 0;exports.atob=typeof atob<"u"?atob:void 0;exports.btoa=typeof btoa<"u"?btoa:void 0;h.TYPED_ARRAY_SUPPORT=dr();!h.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function dr(){try{let n=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(n,r),n.foo()===42}catch{return!1}}Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}});Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}});function d(n){if(n>R)throw new RangeError('The value "'+n+'" is invalid for option "size"');let r=new Uint8Array(n);return Object.setPrototypeOf(r,h.prototype),r}function h(n,r,t){if(typeof n=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return P(n)}return Q(n,r,t)}h.poolSize=8192;function Q(n,r,t){if(typeof n=="string")return Ir(n,r);if(ArrayBuffer.isView(n))return mr(n);if(n==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n);if(w(n,ArrayBuffer)||n&&w(n.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(w(n,SharedArrayBuffer)||n&&w(n.buffer,SharedArrayBuffer)))return D(n,r,t);if(typeof n=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=n.valueOf&&n.valueOf();if(i!=null&&i!==n)return h.from(i,r,t);let e=Fr(n);if(e)return e;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof n[Symbol.toPrimitive]=="function")return h.from(n[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n)}h.from=function(n,r,t){return Q(n,r,t)};Object.setPrototypeOf(h.prototype,Uint8Array.prototype);Object.setPrototypeOf(h,Uint8Array);function v(n){if(typeof n!="number")throw new TypeError('"size" argument must be of type number');if(n<0)throw new RangeError('The value "'+n+'" is invalid for option "size"')}function gr(n,r,t){return v(n),n<=0?d(n):r!==void 0?typeof t=="string"?d(n).fill(r,t):d(n).fill(r):d(n)}h.alloc=function(n,r,t){return gr(n,r,t)};function P(n){return v(n),d(n<0?0:O(n)|0)}h.allocUnsafe=function(n){return P(n)};h.allocUnsafeSlow=function(n){return P(n)};function Ir(n,r){if((typeof r!="string"||r==="")&&(r="utf8"),!h.isEncoding(r))throw new TypeError("Unknown encoding: "+r);let t=rr(n,r)|0,i=d(t),e=i.write(n,r);return e!==t&&(i=i.slice(0,e)),i}function k(n){let r=n.length<0?0:O(n.length)|0,t=d(r);for(let i=0;i=R)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+R.toString(16)+" bytes");return n|0}function Ar(n){return+n!=n&&(n=0),h.alloc(+n)}h.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==h.prototype};h.compare=function(r,t){if(!w(r,Uint8Array)||!w(t,Uint8Array))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;let i=r.length,e=t.length;for(let o=0,u=Math.min(i,e);oe.length){e.set(u.subarray(0,e.length-o),o);break}e.set(u,o),o+=u.length}return e};function rr(n,r){if(ArrayBuffer.isView(n)||w(n,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&w(n,SharedArrayBuffer))return n.byteLength;if(typeof n!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof n);let t=n.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;let e=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return $(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return fr(n).length;default:if(e)return i?-1:$(n).length;r=(""+r).toLowerCase(),e=!0}}h.byteLength=rr;function Ur(n,r,t){let i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(n||(n="utf8");;)switch(n){case"hex":return kr(this,r,t);case"utf8":case"utf-8":return nr(this,r,t);case"ascii":return Mr(this,r,t);case"latin1":case"binary":return br(this,r,t);case"base64":return Nr(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Dr(this,r,t);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),i=!0}}h.prototype._isBuffer=!0;function m(n,r,t){let i=n[r];n[r]=n[t],n[t]=i}h.prototype.swap16=function(){let r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(r+=" ... "),""};j&&(h.prototype[j]=h.prototype.inspect);h.prototype.compare=function(r,t,i,e,o){if(!w(r,Uint8Array))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),i===void 0&&(i=r?r.length:0),e===void 0&&(e=0),o===void 0&&(o=this.length),t<0||i>r.length||e<0||o>this.length)throw new RangeError("out of range index");if(e>=o&&t>=i)return 0;if(e>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,e>>>=0,o>>>=0,this===r)return 0;let u=o-e,c=i-t,f=Math.min(u,c);for(let p=0;p2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,pr(t)&&(t=e?0:n.length-1),t<0&&(t=n.length+t),t>=n.length){if(e)return-1;t=n.length-1}else if(t<0)if(e)t=0;else return-1;if(typeof r=="string"&&(r=h.from(r,i)),h.isBuffer(r))return r.length===0?-1:V(n,r,t,i,e);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?e?Uint8Array.prototype.indexOf.call(n,r,t):Uint8Array.prototype.lastIndexOf.call(n,r,t):V(n,[r],t,i,e);throw new TypeError("val must be string, number or Buffer")}function V(n,r,t,i,e){let o=1,u=n.length,c=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(n.length<2||r.length<2)return-1;o=2,u/=2,c/=2,t/=2}function f(l,a){return o===1?l[a]:l.readUInt16BE(a*o)}let p;if(e){let l=-1;for(p=t;pu&&(t=u-c),p=t;p>=0;p--){let l=!0;for(let a=0;ae&&(i=e)):i=e;let o=r.length;i>o>>>1&&(i=o>>>1);for(let u=0;u>>0,isFinite(i)?(i=i>>>0,e===void 0&&(e="utf8")):(e=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");e||(e="utf8");let u=!1;for(;;)switch(e){case"hex":return Tr(this,r,t,i);case"utf8":case"utf-8":return Rr(this,r,t,i);case"ascii":case"latin1":case"binary":return Cr(this,r,t,i);case"base64":return Sr(this,r,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _r(this,r,t,i);default:if(u)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),u=!0}};h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this,0)}};function Nr(n,r,t){return r===0&&t===n.length?b.fromByteArray(n):b.fromByteArray(n.slice(r,t))}function nr(n,r,t){t=Math.min(n.length,t);let i=[],e=r;for(;e239?4:o>223?3:o>191?2:1;if(e+c<=t){let f,p,l,a;switch(c){case 1:o<128&&(u=o);break;case 2:f=n[e+1],(f&192)===128&&(a=(o&31)<<6|f&63,a>127&&(u=a));break;case 3:f=n[e+1],p=n[e+2],(f&192)===128&&(p&192)===128&&(a=(o&15)<<12|(f&63)<<6|p&63,a>2047&&(a<55296||a>57343)&&(u=a));break;case 4:f=n[e+1],p=n[e+2],l=n[e+3],(f&192)===128&&(p&192)===128&&(l&192)===128&&(a=(o&15)<<18|(f&63)<<12|(p&63)<<6|l&63,a>65535&&a<1114112&&(u=a))}}u===null?(u=65533,c=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|u&1023),i.push(u),e+=c}return Lr(i)}var z=4096;function Lr(n){let r=n.length;if(r<=z)return String.fromCharCode.apply(String,n);let t="",i=0;for(;ii)&&(t=i);let e="";for(let o=r;oi&&(r=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),tt)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUintLE=h.prototype.readUIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||s(r,t,this.length);let e=this[r],o=1,u=0;for(;++u>>0,t=t>>>0,i||s(r,t,this.length);let e=this[r+--t],o=1;for(;t>0&&(o*=256);)e+=this[r+--t]*o;return e};h.prototype.readUint8=h.prototype.readUInt8=function(r,t){return r=r>>>0,t||s(r,1,this.length),this[r]};h.prototype.readUint16LE=h.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||s(r,2,this.length),this[r]|this[r+1]<<8};h.prototype.readUint16BE=h.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||s(r,2,this.length),this[r]<<8|this[r+1]};h.prototype.readUint32LE=h.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||s(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};h.prototype.readUint32BE=h.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||s(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};h.prototype.readBigUInt64LE=g(function(r){r=r>>>0,T(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&C(r,this.length-8);let e=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,o=this[++r]+this[++r]*2**8+this[++r]*2**16+i*2**24;return BigInt(e)+(BigInt(o)<>>0,T(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&C(r,this.length-8);let e=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],o=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+i;return(BigInt(e)<>>0,t=t>>>0,i||s(r,t,this.length);let e=this[r],o=1,u=0;for(;++u=o&&(e-=Math.pow(2,8*t)),e};h.prototype.readIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||s(r,t,this.length);let e=t,o=1,u=this[r+--e];for(;e>0&&(o*=256);)u+=this[r+--e]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*t)),u};h.prototype.readInt8=function(r,t){return r=r>>>0,t||s(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};h.prototype.readInt16LE=function(r,t){r=r>>>0,t||s(r,2,this.length);let i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};h.prototype.readInt16BE=function(r,t){r=r>>>0,t||s(r,2,this.length);let i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};h.prototype.readInt32LE=function(r,t){return r=r>>>0,t||s(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};h.prototype.readInt32BE=function(r,t){return r=r>>>0,t||s(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};h.prototype.readBigInt64LE=g(function(r){r=r>>>0,T(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&C(r,this.length-8);let e=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(i<<24);return(BigInt(e)<>>0,T(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&C(r,this.length-8);let e=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(e)<>>0,t||s(r,4,this.length),U.read(this,r,!0,23,4)};h.prototype.readFloatBE=function(r,t){return r=r>>>0,t||s(r,4,this.length),U.read(this,r,!1,23,4)};h.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||s(r,8,this.length),U.read(this,r,!0,52,8)};h.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||s(r,8,this.length),U.read(this,r,!1,52,8)};function y(n,r,t,i,e,o){if(!h.isBuffer(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>e||rn.length)throw new RangeError("Index out of range")}h.prototype.writeUintLE=h.prototype.writeUIntLE=function(r,t,i,e){if(r=+r,t=t>>>0,i=i>>>0,!e){let c=Math.pow(2,8*i)-1;y(this,r,t,i,c,0)}let o=1,u=0;for(this[t]=r&255;++u>>0,i=i>>>0,!e){let c=Math.pow(2,8*i)-1;y(this,r,t,i,c,0)}let o=i-1,u=1;for(this[t+o]=r&255;--o>=0&&(u*=256);)this[t+o]=r/u&255;return t+i};h.prototype.writeUint8=h.prototype.writeUInt8=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,1,255,0),this[t]=r&255,t+1};h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function ir(n,r,t,i,e){cr(r,i,e,n,t,7);let o=Number(r&BigInt(4294967295));n[t++]=o,o=o>>8,n[t++]=o,o=o>>8,n[t++]=o,o=o>>8,n[t++]=o;let u=Number(r>>BigInt(32)&BigInt(4294967295));return n[t++]=u,u=u>>8,n[t++]=u,u=u>>8,n[t++]=u,u=u>>8,n[t++]=u,t}function er(n,r,t,i,e){cr(r,i,e,n,t,7);let o=Number(r&BigInt(4294967295));n[t+7]=o,o=o>>8,n[t+6]=o,o=o>>8,n[t+5]=o,o=o>>8,n[t+4]=o;let u=Number(r>>BigInt(32)&BigInt(4294967295));return n[t+3]=u,u=u>>8,n[t+2]=u,u=u>>8,n[t+1]=u,u=u>>8,n[t]=u,t+8}h.prototype.writeBigUInt64LE=g(function(r,t=0){return ir(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});h.prototype.writeBigUInt64BE=g(function(r,t=0){return er(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});h.prototype.writeIntLE=function(r,t,i,e){if(r=+r,t=t>>>0,!e){let f=Math.pow(2,8*i-1);y(this,r,t,i,f-1,-f)}let o=0,u=1,c=0;for(this[t]=r&255;++o>0)-c&255;return t+i};h.prototype.writeIntBE=function(r,t,i,e){if(r=+r,t=t>>>0,!e){let f=Math.pow(2,8*i-1);y(this,r,t,i,f-1,-f)}let o=i-1,u=1,c=0;for(this[t+o]=r&255;--o>=0&&(u*=256);)r<0&&c===0&&this[t+o+1]!==0&&(c=1),this[t+o]=(r/u>>0)-c&255;return t+i};h.prototype.writeInt8=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};h.prototype.writeInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};h.prototype.writeInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};h.prototype.writeInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};h.prototype.writeInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};h.prototype.writeBigInt64LE=g(function(r,t=0){return ir(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});h.prototype.writeBigInt64BE=g(function(r,t=0){return er(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function or(n,r,t,i,e,o){if(t+i>n.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function ur(n,r,t,i,e){return r=+r,t=t>>>0,e||or(n,r,t,4,34028234663852886e22,-34028234663852886e22),U.write(n,r,t,i,23,4),t+4}h.prototype.writeFloatLE=function(r,t,i){return ur(this,r,t,!0,i)};h.prototype.writeFloatBE=function(r,t,i){return ur(this,r,t,!1,i)};function hr(n,r,t,i,e){return r=+r,t=t>>>0,e||or(n,r,t,8,17976931348623157e292,-17976931348623157e292),U.write(n,r,t,i,52,8),t+8}h.prototype.writeDoubleLE=function(r,t,i){return hr(this,r,t,!0,i)};h.prototype.writeDoubleBE=function(r,t,i){return hr(this,r,t,!1,i)};h.prototype.copy=function(r,t,i,e){if(!w(r,Uint8Array))throw new TypeError("argument should be a Buffer");if(i||(i=0),!e&&e!==0&&(e=this.length),t>=r.length&&(t=r.length),t||(t=0),e>0&&e=this.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),r.length-t>>0,i=i===void 0?this.length:i>>>0,r||(r=0);let o;if(typeof r=="number")for(o=t;o2**32?e=J(String(t)):typeof t=="bigint"&&(e=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(e=J(e)),e+="n"),i+=` It must be ${r}. Received ${e}`,i},RangeError);function J(n){let r="",t=n.length,i=n[0]==="-"?1:0;for(;t>=i+4;t-=3)r=`_${n.slice(t-3,t)}${r}`;return`${n.slice(0,t)}${r}`}function $r(n,r,t){T(r,"offset"),(n[r]===void 0||n[r+t]===void 0)&&C(r,n.length-(t+1))}function cr(n,r,t,i,e,o){if(n>t||n3?r===0||r===BigInt(0)?c=`>= 0${u} and < 2${u} ** ${(o+1)*8}${u}`:c=`>= -(2${u} ** ${(o+1)*8-1}${u}) and < 2 ** ${(o+1)*8-1}${u}`:c=`>= ${r}${u} and <= ${t}${u}`,new A.ERR_OUT_OF_RANGE("value",c,n)}$r(i,e,o)}function T(n,r){if(typeof n!="number")throw new A.ERR_INVALID_ARG_TYPE(r,"number",n)}function C(n,r,t){throw Math.floor(n)!==n?(T(n,t),new A.ERR_OUT_OF_RANGE(t||"offset","an integer",n)):r<0?new A.ERR_BUFFER_OUT_OF_BOUNDS:new A.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${r}`,n)}var Pr=/[^+/0-9A-Za-z-_]/g;function Or(n){if(n=n.split("=")[0],n=n.trim().replace(Pr,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function $(n,r){r=r||1/0;let t,i=n.length,e=null,o=[];for(let u=0;u55295&&t<57344){if(!e){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===i){(r-=3)>-1&&o.push(239,191,189);continue}e=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),e=t;continue}t=(e-55296<<10|t-56320)+65536}else e&&(r-=3)>-1&&o.push(239,191,189);if(e=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function Gr(n){let r=[];for(let t=0;t>8,e=t%256,o.push(e),o.push(i);return o}function fr(n){return b.toByteArray(Or(n))}function _(n,r,t,i){let e;for(e=0;e=r.length||e>=n.length);++e)r[e+t]=n[e];return e}function w(n,r){return n instanceof r||n!=null&&n.constructor!=null&&n.constructor.name!=null&&n.constructor.name===r.name||r===Uint8Array&&h.isBuffer(n)}function pr(n){return n!==n}var qr=function(){let n="0123456789abcdef",r=new Array(256);for(let t=0;t<16;++t){let i=t*16;for(let e=0;e<16;++e)r[i+e]=n[t]+n[e]}return r}(),K=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];function g(n){return typeof BigInt>"u"?Hr:n}function Hr(){throw new Error("BigInt not supported")} +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/*! Bundled license information: + +ieee754/index.js: + (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) +*/ diff --git a/dist/esm/index.js b/dist/esm/index.js new file mode 100644 index 0000000..0a44403 --- /dev/null +++ b/dist/esm/index.js @@ -0,0 +1,12 @@ +var M=(n,r)=>()=>(r||n((r={exports:{}}).exports,r),r.exports);var X=M(_=>{"use strict";_.byteLength=yr;_.toByteArray=xr;_.fromByteArray=dr;var d=[],x=[],sr=typeof Uint8Array<"u"?Uint8Array:Array,b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(m=0,H=b.length;m0)throw new Error("Invalid string. Length must be a multiple of 4");var t=n.indexOf("=");t===-1&&(t=r);var i=t===r?0:4-t%4;return[t,i]}function yr(n){var r=W(n),t=r[0],i=r[1];return(t+i)*3/4-i}function wr(n,r,t){return(r+t)*3/4-t}function xr(n){var r,t=W(n),i=t[0],e=t[1],o=new sr(wr(n,i,e)),u=0,c=e>0?i-4:i,f;for(f=0;f>16&255,o[u++]=r>>8&255,o[u++]=r&255;return e===2&&(r=x[n.charCodeAt(f)]<<2|x[n.charCodeAt(f+1)]>>4,o[u++]=r&255),e===1&&(r=x[n.charCodeAt(f)]<<10|x[n.charCodeAt(f+1)]<<4|x[n.charCodeAt(f+2)]>>2,o[u++]=r>>8&255,o[u++]=r&255),o}function Br(n){return d[n>>18&63]+d[n>>12&63]+d[n>>6&63]+d[n&63]}function Er(n,r,t){for(var i,e=[],o=r;oc?c:u+o));return i===1?(r=n[t-1],e.push(d[r>>2]+d[r<<4&63]+"==")):i===2&&(r=(n[t-2]<<8)+n[t-1],e.push(d[r>>10]+d[r>>4&63]+d[r<<2&63]+"=")),e.join("")}});var j=M(k=>{k.read=function(n,r,t,i,e){var o,u,c=e*8-i-1,f=(1<>1,l=-7,a=t?e-1:0,A=t?-1:1,E=n[r+a];for(a+=A,o=E&(1<<-l)-1,E>>=-l,l+=c;l>0;o=o*256+n[r+a],a+=A,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=i;l>0;u=u*256+n[r+a],a+=A,l-=8);if(o===0)o=1-p;else{if(o===f)return u?NaN:(E?-1:1)*(1/0);u=u+Math.pow(2,i),o=o-p}return(E?-1:1)*u*Math.pow(2,o-i)};k.write=function(n,r,t,i,e,o){var u,c,f,p=o*8-e-1,l=(1<>1,A=e===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=i?0:o-1,L=i?1:-1,ar=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,u=l):(u=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-u))<1&&(u--,f*=2),u+a>=1?r+=A/f:r+=A*Math.pow(2,1-a),r*f>=2&&(u++,f/=2),u+a>=l?(c=0,u=l):u+a>=1?(c=(r*f-1)*Math.pow(2,e),u=u+a):(c=r*Math.pow(2,a-1)*Math.pow(2,e),u=0));e>=8;n[t+E]=c&255,E+=L,c/=256,e-=8);for(u=u<0;n[t+E]=u&255,E+=L,u/=256,p-=8);n[t+E-L]|=ar*128}});var Xr=M(B=>{var D=X(),T=j(),V=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;B.Buffer=h;B.SlowBuffer=Ur;B.INSPECT_MAX_BYTES=50;var C=2147483647;B.kMaxLength=C;var Q=(1<<28)-16;B.kStringMaxLength=Q;B.constants={MAX_LENGTH:C,MAX_STRING_LENGTH:Q};B.Blob=typeof Blob<"u"?Blob:void 0;B.File=typeof File<"u"?File:void 0;B.atob=typeof atob<"u"?atob:void 0;B.btoa=typeof btoa<"u"?btoa:void 0;h.TYPED_ARRAY_SUPPORT=gr();!h.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function gr(){try{let n=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(n,r),n.foo()===42}catch{return!1}}Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}});Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}});function g(n){if(n>C)throw new RangeError('The value "'+n+'" is invalid for option "size"');let r=new Uint8Array(n);return Object.setPrototypeOf(r,h.prototype),r}function h(n,r,t){if(typeof n=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return G(n)}return v(n,r,t)}h.poolSize=8192;function v(n,r,t){if(typeof n=="string")return mr(n,r);if(ArrayBuffer.isView(n))return Fr(n);if(n==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n);if(w(n,ArrayBuffer)||n&&w(n.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(w(n,SharedArrayBuffer)||n&&w(n.buffer,SharedArrayBuffer)))return P(n,r,t);if(typeof n=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=n.valueOf&&n.valueOf();if(i!=null&&i!==n)return h.from(i,r,t);let e=Ar(n);if(e)return e;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof n[Symbol.toPrimitive]=="function")return h.from(n[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n)}h.from=function(n,r,t){return v(n,r,t)};Object.setPrototypeOf(h.prototype,Uint8Array.prototype);Object.setPrototypeOf(h,Uint8Array);function rr(n){if(typeof n!="number")throw new TypeError('"size" argument must be of type number');if(n<0)throw new RangeError('The value "'+n+'" is invalid for option "size"')}function Ir(n,r,t){return rr(n),n<=0?g(n):r!==void 0?typeof t=="string"?g(n).fill(r,t):g(n).fill(r):g(n)}h.alloc=function(n,r,t){return Ir(n,r,t)};function G(n){return rr(n),g(n<0?0:Y(n)|0)}h.allocUnsafe=function(n){return G(n)};h.allocUnsafeSlow=function(n){return G(n)};function mr(n,r){if((typeof r!="string"||r==="")&&(r="utf8"),!h.isEncoding(r))throw new TypeError("Unknown encoding: "+r);let t=tr(n,r)|0,i=g(t),e=i.write(n,r);return e!==t&&(i=i.slice(0,e)),i}function $(n){let r=n.length<0?0:Y(n.length)|0,t=g(r);for(let i=0;i=C)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C.toString(16)+" bytes");return n|0}function Ur(n){return+n!=n&&(n=0),h.alloc(+n)}h.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==h.prototype};h.compare=function(r,t){if(!w(r,Uint8Array)||!w(t,Uint8Array))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;let i=r.length,e=t.length;for(let o=0,u=Math.min(i,e);oe.length){e.set(u.subarray(0,e.length-o),o);break}e.set(u,o),o+=u.length}return e};function tr(n,r){if(ArrayBuffer.isView(n)||w(n,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&w(n,SharedArrayBuffer))return n.byteLength;if(typeof n!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof n);let t=n.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;let e=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return O(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return pr(n).length;default:if(e)return i?-1:O(n).length;r=(""+r).toLowerCase(),e=!0}}h.byteLength=tr;function Tr(n,r,t){let i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(n||(n="utf8");;)switch(n){case"hex":return Dr(this,r,t);case"utf8":case"utf-8":return ir(this,r,t);case"ascii":return br(this,r,t);case"latin1":case"binary":return kr(this,r,t);case"base64":return Lr(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $r(this,r,t);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),i=!0}}h.prototype._isBuffer=!0;function F(n,r,t){let i=n[r];n[r]=n[t],n[t]=i}h.prototype.swap16=function(){let r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(r+=" ... "),""};V&&(h.prototype[V]=h.prototype.inspect);h.prototype.compare=function(r,t,i,e,o){if(!w(r,Uint8Array))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),i===void 0&&(i=r?r.length:0),e===void 0&&(e=0),o===void 0&&(o=this.length),t<0||i>r.length||e<0||o>this.length)throw new RangeError("out of range index");if(e>=o&&t>=i)return 0;if(e>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,e>>>=0,o>>>=0,this===r)return 0;let u=o-e,c=i-t,f=Math.min(u,c);for(let p=0;p2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,lr(t)&&(t=e?0:n.length-1),t<0&&(t=n.length+t),t>=n.length){if(e)return-1;t=n.length-1}else if(t<0)if(e)t=0;else return-1;if(typeof r=="string"&&(r=h.from(r,i)),h.isBuffer(r))return r.length===0?-1:z(n,r,t,i,e);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?e?Uint8Array.prototype.indexOf.call(n,r,t):Uint8Array.prototype.lastIndexOf.call(n,r,t):z(n,[r],t,i,e);throw new TypeError("val must be string, number or Buffer")}function z(n,r,t,i,e){let o=1,u=n.length,c=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(n.length<2||r.length<2)return-1;o=2,u/=2,c/=2,t/=2}function f(l,a){return o===1?l[a]:l.readUInt16BE(a*o)}let p;if(e){let l=-1;for(p=t;pu&&(t=u-c),p=t;p>=0;p--){let l=!0;for(let a=0;ae&&(i=e)):i=e;let o=r.length;i>o>>>1&&(i=o>>>1);for(let u=0;u>>0,isFinite(i)?(i=i>>>0,e===void 0&&(e="utf8")):(e=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");e||(e="utf8");let u=!1;for(;;)switch(e){case"hex":return Rr(this,r,t,i);case"utf8":case"utf-8":return Cr(this,r,t,i);case"ascii":case"latin1":case"binary":return Sr(this,r,t,i);case"base64":return _r(this,r,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nr(this,r,t,i);default:if(u)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),u=!0}};h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this,0)}};function Lr(n,r,t){return r===0&&t===n.length?D.fromByteArray(n):D.fromByteArray(n.slice(r,t))}function ir(n,r,t){t=Math.min(n.length,t);let i=[],e=r;for(;e239?4:o>223?3:o>191?2:1;if(e+c<=t){let f,p,l,a;switch(c){case 1:o<128&&(u=o);break;case 2:f=n[e+1],(f&192)===128&&(a=(o&31)<<6|f&63,a>127&&(u=a));break;case 3:f=n[e+1],p=n[e+2],(f&192)===128&&(p&192)===128&&(a=(o&15)<<12|(f&63)<<6|p&63,a>2047&&(a<55296||a>57343)&&(u=a));break;case 4:f=n[e+1],p=n[e+2],l=n[e+3],(f&192)===128&&(p&192)===128&&(l&192)===128&&(a=(o&15)<<18|(f&63)<<12|(p&63)<<6|l&63,a>65535&&a<1114112&&(u=a))}}u===null?(u=65533,c=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|u&1023),i.push(u),e+=c}return Mr(i)}var J=4096;function Mr(n){let r=n.length;if(r<=J)return String.fromCharCode.apply(String,n);let t="",i=0;for(;ii)&&(t=i);let e="";for(let o=r;oi&&(r=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),tt)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUintLE=h.prototype.readUIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||s(r,t,this.length);let e=this[r],o=1,u=0;for(;++u>>0,t=t>>>0,i||s(r,t,this.length);let e=this[r+--t],o=1;for(;t>0&&(o*=256);)e+=this[r+--t]*o;return e};h.prototype.readUint8=h.prototype.readUInt8=function(r,t){return r=r>>>0,t||s(r,1,this.length),this[r]};h.prototype.readUint16LE=h.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||s(r,2,this.length),this[r]|this[r+1]<<8};h.prototype.readUint16BE=h.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||s(r,2,this.length),this[r]<<8|this[r+1]};h.prototype.readUint32LE=h.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||s(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};h.prototype.readUint32BE=h.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||s(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};h.prototype.readBigUInt64LE=I(function(r){r=r>>>0,R(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&S(r,this.length-8);let e=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,o=this[++r]+this[++r]*2**8+this[++r]*2**16+i*2**24;return BigInt(e)+(BigInt(o)<>>0,R(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&S(r,this.length-8);let e=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],o=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+i;return(BigInt(e)<>>0,t=t>>>0,i||s(r,t,this.length);let e=this[r],o=1,u=0;for(;++u=o&&(e-=Math.pow(2,8*t)),e};h.prototype.readIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||s(r,t,this.length);let e=t,o=1,u=this[r+--e];for(;e>0&&(o*=256);)u+=this[r+--e]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*t)),u};h.prototype.readInt8=function(r,t){return r=r>>>0,t||s(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};h.prototype.readInt16LE=function(r,t){r=r>>>0,t||s(r,2,this.length);let i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};h.prototype.readInt16BE=function(r,t){r=r>>>0,t||s(r,2,this.length);let i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};h.prototype.readInt32LE=function(r,t){return r=r>>>0,t||s(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};h.prototype.readInt32BE=function(r,t){return r=r>>>0,t||s(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};h.prototype.readBigInt64LE=I(function(r){r=r>>>0,R(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&S(r,this.length-8);let e=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(i<<24);return(BigInt(e)<>>0,R(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&S(r,this.length-8);let e=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(e)<>>0,t||s(r,4,this.length),T.read(this,r,!0,23,4)};h.prototype.readFloatBE=function(r,t){return r=r>>>0,t||s(r,4,this.length),T.read(this,r,!1,23,4)};h.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||s(r,8,this.length),T.read(this,r,!0,52,8)};h.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||s(r,8,this.length),T.read(this,r,!1,52,8)};function y(n,r,t,i,e,o){if(!h.isBuffer(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>e||rn.length)throw new RangeError("Index out of range")}h.prototype.writeUintLE=h.prototype.writeUIntLE=function(r,t,i,e){if(r=+r,t=t>>>0,i=i>>>0,!e){let c=Math.pow(2,8*i)-1;y(this,r,t,i,c,0)}let o=1,u=0;for(this[t]=r&255;++u>>0,i=i>>>0,!e){let c=Math.pow(2,8*i)-1;y(this,r,t,i,c,0)}let o=i-1,u=1;for(this[t+o]=r&255;--o>=0&&(u*=256);)this[t+o]=r/u&255;return t+i};h.prototype.writeUint8=h.prototype.writeUInt8=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,1,255,0),this[t]=r&255,t+1};h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function er(n,r,t,i,e){fr(r,i,e,n,t,7);let o=Number(r&BigInt(4294967295));n[t++]=o,o=o>>8,n[t++]=o,o=o>>8,n[t++]=o,o=o>>8,n[t++]=o;let u=Number(r>>BigInt(32)&BigInt(4294967295));return n[t++]=u,u=u>>8,n[t++]=u,u=u>>8,n[t++]=u,u=u>>8,n[t++]=u,t}function or(n,r,t,i,e){fr(r,i,e,n,t,7);let o=Number(r&BigInt(4294967295));n[t+7]=o,o=o>>8,n[t+6]=o,o=o>>8,n[t+5]=o,o=o>>8,n[t+4]=o;let u=Number(r>>BigInt(32)&BigInt(4294967295));return n[t+3]=u,u=u>>8,n[t+2]=u,u=u>>8,n[t+1]=u,u=u>>8,n[t]=u,t+8}h.prototype.writeBigUInt64LE=I(function(r,t=0){return er(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});h.prototype.writeBigUInt64BE=I(function(r,t=0){return or(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});h.prototype.writeIntLE=function(r,t,i,e){if(r=+r,t=t>>>0,!e){let f=Math.pow(2,8*i-1);y(this,r,t,i,f-1,-f)}let o=0,u=1,c=0;for(this[t]=r&255;++o>0)-c&255;return t+i};h.prototype.writeIntBE=function(r,t,i,e){if(r=+r,t=t>>>0,!e){let f=Math.pow(2,8*i-1);y(this,r,t,i,f-1,-f)}let o=i-1,u=1,c=0;for(this[t+o]=r&255;--o>=0&&(u*=256);)r<0&&c===0&&this[t+o+1]!==0&&(c=1),this[t+o]=(r/u>>0)-c&255;return t+i};h.prototype.writeInt8=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};h.prototype.writeInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};h.prototype.writeInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};h.prototype.writeInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};h.prototype.writeInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};h.prototype.writeBigInt64LE=I(function(r,t=0){return er(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});h.prototype.writeBigInt64BE=I(function(r,t=0){return or(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ur(n,r,t,i,e,o){if(t+i>n.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function hr(n,r,t,i,e){return r=+r,t=t>>>0,e||ur(n,r,t,4,34028234663852886e22,-34028234663852886e22),T.write(n,r,t,i,23,4),t+4}h.prototype.writeFloatLE=function(r,t,i){return hr(this,r,t,!0,i)};h.prototype.writeFloatBE=function(r,t,i){return hr(this,r,t,!1,i)};function cr(n,r,t,i,e){return r=+r,t=t>>>0,e||ur(n,r,t,8,17976931348623157e292,-17976931348623157e292),T.write(n,r,t,i,52,8),t+8}h.prototype.writeDoubleLE=function(r,t,i){return cr(this,r,t,!0,i)};h.prototype.writeDoubleBE=function(r,t,i){return cr(this,r,t,!1,i)};h.prototype.copy=function(r,t,i,e){if(!w(r,Uint8Array))throw new TypeError("argument should be a Buffer");if(i||(i=0),!e&&e!==0&&(e=this.length),t>=r.length&&(t=r.length),t||(t=0),e>0&&e=this.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),r.length-t>>0,i=i===void 0?this.length:i>>>0,r||(r=0);let o;if(typeof r=="number")for(o=t;o2**32?e=K(String(t)):typeof t=="bigint"&&(e=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(e=K(e)),e+="n"),i+=` It must be ${r}. Received ${e}`,i},RangeError);function K(n){let r="",t=n.length,i=n[0]==="-"?1:0;for(;t>=i+4;t-=3)r=`_${n.slice(t-3,t)}${r}`;return`${n.slice(0,t)}${r}`}function Pr(n,r,t){R(r,"offset"),(n[r]===void 0||n[r+t]===void 0)&&S(r,n.length-(t+1))}function fr(n,r,t,i,e,o){if(n>t||n3?r===0||r===BigInt(0)?c=`>= 0${u} and < 2${u} ** ${(o+1)*8}${u}`:c=`>= -(2${u} ** ${(o+1)*8-1}${u}) and < 2 ** ${(o+1)*8-1}${u}`:c=`>= ${r}${u} and <= ${t}${u}`,new U.ERR_OUT_OF_RANGE("value",c,n)}Pr(i,e,o)}function R(n,r){if(typeof n!="number")throw new U.ERR_INVALID_ARG_TYPE(r,"number",n)}function S(n,r,t){throw Math.floor(n)!==n?(R(n,t),new U.ERR_OUT_OF_RANGE(t||"offset","an integer",n)):r<0?new U.ERR_BUFFER_OUT_OF_BOUNDS:new U.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${r}`,n)}var Or=/[^+/0-9A-Za-z-_]/g;function Gr(n){if(n=n.split("=")[0],n=n.trim().replace(Or,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function O(n,r){r=r||1/0;let t,i=n.length,e=null,o=[];for(let u=0;u55295&&t<57344){if(!e){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===i){(r-=3)>-1&&o.push(239,191,189);continue}e=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),e=t;continue}t=(e-55296<<10|t-56320)+65536}else e&&(r-=3)>-1&&o.push(239,191,189);if(e=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function Yr(n){let r=[];for(let t=0;t>8,e=t%256,o.push(e),o.push(i);return o}function pr(n){return D.toByteArray(Gr(n))}function N(n,r,t,i){let e;for(e=0;e=r.length||e>=n.length);++e)r[e+t]=n[e];return e}function w(n,r){return n instanceof r||n!=null&&n.constructor!=null&&n.constructor.name!=null&&n.constructor.name===r.name||r===Uint8Array&&h.isBuffer(n)}function lr(n){return n!==n}var Hr=function(){let n="0123456789abcdef",r=new Array(256);for(let t=0;t<16;++t){let i=t*16;for(let e=0;e<16;++e)r[i+e]=n[t]+n[e]}return r}(),Z=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];function I(n){return typeof BigInt>"u"?Wr:n}function Wr(){throw new Error("BigInt not supported")}});export default Xr(); +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/*! Bundled license information: + +ieee754/index.js: + (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) +*/ diff --git a/dist/iife/index.js b/dist/iife/index.js new file mode 100644 index 0000000..8fcbc1a --- /dev/null +++ b/dist/iife/index.js @@ -0,0 +1,12 @@ +"use strict";(()=>{var M=(n,r)=>()=>(r||n((r={exports:{}}).exports,r),r.exports);var X=M(_=>{"use strict";_.byteLength=yr;_.toByteArray=xr;_.fromByteArray=dr;var d=[],x=[],sr=typeof Uint8Array<"u"?Uint8Array:Array,b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(m=0,H=b.length;m0)throw new Error("Invalid string. Length must be a multiple of 4");var t=n.indexOf("=");t===-1&&(t=r);var i=t===r?0:4-t%4;return[t,i]}function yr(n){var r=W(n),t=r[0],i=r[1];return(t+i)*3/4-i}function wr(n,r,t){return(r+t)*3/4-t}function xr(n){var r,t=W(n),i=t[0],e=t[1],o=new sr(wr(n,i,e)),u=0,c=e>0?i-4:i,f;for(f=0;f>16&255,o[u++]=r>>8&255,o[u++]=r&255;return e===2&&(r=x[n.charCodeAt(f)]<<2|x[n.charCodeAt(f+1)]>>4,o[u++]=r&255),e===1&&(r=x[n.charCodeAt(f)]<<10|x[n.charCodeAt(f+1)]<<4|x[n.charCodeAt(f+2)]>>2,o[u++]=r>>8&255,o[u++]=r&255),o}function Br(n){return d[n>>18&63]+d[n>>12&63]+d[n>>6&63]+d[n&63]}function Er(n,r,t){for(var i,e=[],o=r;oc?c:u+o));return i===1?(r=n[t-1],e.push(d[r>>2]+d[r<<4&63]+"==")):i===2&&(r=(n[t-2]<<8)+n[t-1],e.push(d[r>>10]+d[r>>4&63]+d[r<<2&63]+"=")),e.join("")}});var j=M(k=>{k.read=function(n,r,t,i,e){var o,u,c=e*8-i-1,f=(1<>1,l=-7,a=t?e-1:0,A=t?-1:1,E=n[r+a];for(a+=A,o=E&(1<<-l)-1,E>>=-l,l+=c;l>0;o=o*256+n[r+a],a+=A,l-=8);for(u=o&(1<<-l)-1,o>>=-l,l+=i;l>0;u=u*256+n[r+a],a+=A,l-=8);if(o===0)o=1-p;else{if(o===f)return u?NaN:(E?-1:1)*(1/0);u=u+Math.pow(2,i),o=o-p}return(E?-1:1)*u*Math.pow(2,o-i)};k.write=function(n,r,t,i,e,o){var u,c,f,p=o*8-e-1,l=(1<>1,A=e===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=i?0:o-1,L=i?1:-1,ar=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,u=l):(u=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-u))<1&&(u--,f*=2),u+a>=1?r+=A/f:r+=A*Math.pow(2,1-a),r*f>=2&&(u++,f/=2),u+a>=l?(c=0,u=l):u+a>=1?(c=(r*f-1)*Math.pow(2,e),u=u+a):(c=r*Math.pow(2,a-1)*Math.pow(2,e),u=0));e>=8;n[t+E]=c&255,E+=L,c/=256,e-=8);for(u=u<0;n[t+E]=u&255,E+=L,u/=256,p-=8);n[t+E-L]|=ar*128}});var Xr=M(B=>{var D=X(),T=j(),V=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;B.Buffer=h;B.SlowBuffer=Ur;B.INSPECT_MAX_BYTES=50;var C=2147483647;B.kMaxLength=C;var Q=(1<<28)-16;B.kStringMaxLength=Q;B.constants={MAX_LENGTH:C,MAX_STRING_LENGTH:Q};B.Blob=typeof Blob<"u"?Blob:void 0;B.File=typeof File<"u"?File:void 0;B.atob=typeof atob<"u"?atob:void 0;B.btoa=typeof btoa<"u"?btoa:void 0;h.TYPED_ARRAY_SUPPORT=gr();!h.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function gr(){try{let n=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(n,r),n.foo()===42}catch{return!1}}Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}});Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}});function g(n){if(n>C)throw new RangeError('The value "'+n+'" is invalid for option "size"');let r=new Uint8Array(n);return Object.setPrototypeOf(r,h.prototype),r}function h(n,r,t){if(typeof n=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return G(n)}return v(n,r,t)}h.poolSize=8192;function v(n,r,t){if(typeof n=="string")return mr(n,r);if(ArrayBuffer.isView(n))return Fr(n);if(n==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n);if(w(n,ArrayBuffer)||n&&w(n.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(w(n,SharedArrayBuffer)||n&&w(n.buffer,SharedArrayBuffer)))return P(n,r,t);if(typeof n=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=n.valueOf&&n.valueOf();if(i!=null&&i!==n)return h.from(i,r,t);let e=Ar(n);if(e)return e;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof n[Symbol.toPrimitive]=="function")return h.from(n[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n)}h.from=function(n,r,t){return v(n,r,t)};Object.setPrototypeOf(h.prototype,Uint8Array.prototype);Object.setPrototypeOf(h,Uint8Array);function rr(n){if(typeof n!="number")throw new TypeError('"size" argument must be of type number');if(n<0)throw new RangeError('The value "'+n+'" is invalid for option "size"')}function Ir(n,r,t){return rr(n),n<=0?g(n):r!==void 0?typeof t=="string"?g(n).fill(r,t):g(n).fill(r):g(n)}h.alloc=function(n,r,t){return Ir(n,r,t)};function G(n){return rr(n),g(n<0?0:Y(n)|0)}h.allocUnsafe=function(n){return G(n)};h.allocUnsafeSlow=function(n){return G(n)};function mr(n,r){if((typeof r!="string"||r==="")&&(r="utf8"),!h.isEncoding(r))throw new TypeError("Unknown encoding: "+r);let t=tr(n,r)|0,i=g(t),e=i.write(n,r);return e!==t&&(i=i.slice(0,e)),i}function $(n){let r=n.length<0?0:Y(n.length)|0,t=g(r);for(let i=0;i=C)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+C.toString(16)+" bytes");return n|0}function Ur(n){return+n!=n&&(n=0),h.alloc(+n)}h.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==h.prototype};h.compare=function(r,t){if(!w(r,Uint8Array)||!w(t,Uint8Array))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;let i=r.length,e=t.length;for(let o=0,u=Math.min(i,e);oe.length){e.set(u.subarray(0,e.length-o),o);break}e.set(u,o),o+=u.length}return e};function tr(n,r){if(ArrayBuffer.isView(n)||w(n,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&w(n,SharedArrayBuffer))return n.byteLength;if(typeof n!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof n);let t=n.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;let e=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return O(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return pr(n).length;default:if(e)return i?-1:O(n).length;r=(""+r).toLowerCase(),e=!0}}h.byteLength=tr;function Tr(n,r,t){let i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(n||(n="utf8");;)switch(n){case"hex":return Dr(this,r,t);case"utf8":case"utf-8":return ir(this,r,t);case"ascii":return br(this,r,t);case"latin1":case"binary":return kr(this,r,t);case"base64":return Lr(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $r(this,r,t);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),i=!0}}h.prototype._isBuffer=!0;function F(n,r,t){let i=n[r];n[r]=n[t],n[t]=i}h.prototype.swap16=function(){let r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(r+=" ... "),""};V&&(h.prototype[V]=h.prototype.inspect);h.prototype.compare=function(r,t,i,e,o){if(!w(r,Uint8Array))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),i===void 0&&(i=r?r.length:0),e===void 0&&(e=0),o===void 0&&(o=this.length),t<0||i>r.length||e<0||o>this.length)throw new RangeError("out of range index");if(e>=o&&t>=i)return 0;if(e>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,e>>>=0,o>>>=0,this===r)return 0;let u=o-e,c=i-t,f=Math.min(u,c);for(let p=0;p2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,lr(t)&&(t=e?0:n.length-1),t<0&&(t=n.length+t),t>=n.length){if(e)return-1;t=n.length-1}else if(t<0)if(e)t=0;else return-1;if(typeof r=="string"&&(r=h.from(r,i)),h.isBuffer(r))return r.length===0?-1:z(n,r,t,i,e);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?e?Uint8Array.prototype.indexOf.call(n,r,t):Uint8Array.prototype.lastIndexOf.call(n,r,t):z(n,[r],t,i,e);throw new TypeError("val must be string, number or Buffer")}function z(n,r,t,i,e){let o=1,u=n.length,c=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(n.length<2||r.length<2)return-1;o=2,u/=2,c/=2,t/=2}function f(l,a){return o===1?l[a]:l.readUInt16BE(a*o)}let p;if(e){let l=-1;for(p=t;pu&&(t=u-c),p=t;p>=0;p--){let l=!0;for(let a=0;ae&&(i=e)):i=e;let o=r.length;i>o>>>1&&(i=o>>>1);for(let u=0;u>>0,isFinite(i)?(i=i>>>0,e===void 0&&(e="utf8")):(e=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");e||(e="utf8");let u=!1;for(;;)switch(e){case"hex":return Rr(this,r,t,i);case"utf8":case"utf-8":return Cr(this,r,t,i);case"ascii":case"latin1":case"binary":return Sr(this,r,t,i);case"base64":return _r(this,r,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nr(this,r,t,i);default:if(u)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),u=!0}};h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this,0)}};function Lr(n,r,t){return r===0&&t===n.length?D.fromByteArray(n):D.fromByteArray(n.slice(r,t))}function ir(n,r,t){t=Math.min(n.length,t);let i=[],e=r;for(;e239?4:o>223?3:o>191?2:1;if(e+c<=t){let f,p,l,a;switch(c){case 1:o<128&&(u=o);break;case 2:f=n[e+1],(f&192)===128&&(a=(o&31)<<6|f&63,a>127&&(u=a));break;case 3:f=n[e+1],p=n[e+2],(f&192)===128&&(p&192)===128&&(a=(o&15)<<12|(f&63)<<6|p&63,a>2047&&(a<55296||a>57343)&&(u=a));break;case 4:f=n[e+1],p=n[e+2],l=n[e+3],(f&192)===128&&(p&192)===128&&(l&192)===128&&(a=(o&15)<<18|(f&63)<<12|(p&63)<<6|l&63,a>65535&&a<1114112&&(u=a))}}u===null?(u=65533,c=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|u&1023),i.push(u),e+=c}return Mr(i)}var J=4096;function Mr(n){let r=n.length;if(r<=J)return String.fromCharCode.apply(String,n);let t="",i=0;for(;ii)&&(t=i);let e="";for(let o=r;oi&&(r=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),tt)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUintLE=h.prototype.readUIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||s(r,t,this.length);let e=this[r],o=1,u=0;for(;++u>>0,t=t>>>0,i||s(r,t,this.length);let e=this[r+--t],o=1;for(;t>0&&(o*=256);)e+=this[r+--t]*o;return e};h.prototype.readUint8=h.prototype.readUInt8=function(r,t){return r=r>>>0,t||s(r,1,this.length),this[r]};h.prototype.readUint16LE=h.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||s(r,2,this.length),this[r]|this[r+1]<<8};h.prototype.readUint16BE=h.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||s(r,2,this.length),this[r]<<8|this[r+1]};h.prototype.readUint32LE=h.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||s(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};h.prototype.readUint32BE=h.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||s(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};h.prototype.readBigUInt64LE=I(function(r){r=r>>>0,R(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&S(r,this.length-8);let e=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,o=this[++r]+this[++r]*2**8+this[++r]*2**16+i*2**24;return BigInt(e)+(BigInt(o)<>>0,R(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&S(r,this.length-8);let e=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],o=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+i;return(BigInt(e)<>>0,t=t>>>0,i||s(r,t,this.length);let e=this[r],o=1,u=0;for(;++u=o&&(e-=Math.pow(2,8*t)),e};h.prototype.readIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||s(r,t,this.length);let e=t,o=1,u=this[r+--e];for(;e>0&&(o*=256);)u+=this[r+--e]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*t)),u};h.prototype.readInt8=function(r,t){return r=r>>>0,t||s(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};h.prototype.readInt16LE=function(r,t){r=r>>>0,t||s(r,2,this.length);let i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};h.prototype.readInt16BE=function(r,t){r=r>>>0,t||s(r,2,this.length);let i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};h.prototype.readInt32LE=function(r,t){return r=r>>>0,t||s(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};h.prototype.readInt32BE=function(r,t){return r=r>>>0,t||s(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};h.prototype.readBigInt64LE=I(function(r){r=r>>>0,R(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&S(r,this.length-8);let e=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(i<<24);return(BigInt(e)<>>0,R(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&S(r,this.length-8);let e=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(e)<>>0,t||s(r,4,this.length),T.read(this,r,!0,23,4)};h.prototype.readFloatBE=function(r,t){return r=r>>>0,t||s(r,4,this.length),T.read(this,r,!1,23,4)};h.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||s(r,8,this.length),T.read(this,r,!0,52,8)};h.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||s(r,8,this.length),T.read(this,r,!1,52,8)};function y(n,r,t,i,e,o){if(!h.isBuffer(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>e||rn.length)throw new RangeError("Index out of range")}h.prototype.writeUintLE=h.prototype.writeUIntLE=function(r,t,i,e){if(r=+r,t=t>>>0,i=i>>>0,!e){let c=Math.pow(2,8*i)-1;y(this,r,t,i,c,0)}let o=1,u=0;for(this[t]=r&255;++u>>0,i=i>>>0,!e){let c=Math.pow(2,8*i)-1;y(this,r,t,i,c,0)}let o=i-1,u=1;for(this[t+o]=r&255;--o>=0&&(u*=256);)this[t+o]=r/u&255;return t+i};h.prototype.writeUint8=h.prototype.writeUInt8=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,1,255,0),this[t]=r&255,t+1};h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function er(n,r,t,i,e){fr(r,i,e,n,t,7);let o=Number(r&BigInt(4294967295));n[t++]=o,o=o>>8,n[t++]=o,o=o>>8,n[t++]=o,o=o>>8,n[t++]=o;let u=Number(r>>BigInt(32)&BigInt(4294967295));return n[t++]=u,u=u>>8,n[t++]=u,u=u>>8,n[t++]=u,u=u>>8,n[t++]=u,t}function or(n,r,t,i,e){fr(r,i,e,n,t,7);let o=Number(r&BigInt(4294967295));n[t+7]=o,o=o>>8,n[t+6]=o,o=o>>8,n[t+5]=o,o=o>>8,n[t+4]=o;let u=Number(r>>BigInt(32)&BigInt(4294967295));return n[t+3]=u,u=u>>8,n[t+2]=u,u=u>>8,n[t+1]=u,u=u>>8,n[t]=u,t+8}h.prototype.writeBigUInt64LE=I(function(r,t=0){return er(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});h.prototype.writeBigUInt64BE=I(function(r,t=0){return or(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});h.prototype.writeIntLE=function(r,t,i,e){if(r=+r,t=t>>>0,!e){let f=Math.pow(2,8*i-1);y(this,r,t,i,f-1,-f)}let o=0,u=1,c=0;for(this[t]=r&255;++o>0)-c&255;return t+i};h.prototype.writeIntBE=function(r,t,i,e){if(r=+r,t=t>>>0,!e){let f=Math.pow(2,8*i-1);y(this,r,t,i,f-1,-f)}let o=i-1,u=1,c=0;for(this[t+o]=r&255;--o>=0&&(u*=256);)r<0&&c===0&&this[t+o+1]!==0&&(c=1),this[t+o]=(r/u>>0)-c&255;return t+i};h.prototype.writeInt8=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};h.prototype.writeInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};h.prototype.writeInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};h.prototype.writeInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};h.prototype.writeInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||y(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};h.prototype.writeBigInt64LE=I(function(r,t=0){return er(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});h.prototype.writeBigInt64BE=I(function(r,t=0){return or(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ur(n,r,t,i,e,o){if(t+i>n.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function hr(n,r,t,i,e){return r=+r,t=t>>>0,e||ur(n,r,t,4,34028234663852886e22,-34028234663852886e22),T.write(n,r,t,i,23,4),t+4}h.prototype.writeFloatLE=function(r,t,i){return hr(this,r,t,!0,i)};h.prototype.writeFloatBE=function(r,t,i){return hr(this,r,t,!1,i)};function cr(n,r,t,i,e){return r=+r,t=t>>>0,e||ur(n,r,t,8,17976931348623157e292,-17976931348623157e292),T.write(n,r,t,i,52,8),t+8}h.prototype.writeDoubleLE=function(r,t,i){return cr(this,r,t,!0,i)};h.prototype.writeDoubleBE=function(r,t,i){return cr(this,r,t,!1,i)};h.prototype.copy=function(r,t,i,e){if(!w(r,Uint8Array))throw new TypeError("argument should be a Buffer");if(i||(i=0),!e&&e!==0&&(e=this.length),t>=r.length&&(t=r.length),t||(t=0),e>0&&e=this.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),r.length-t>>0,i=i===void 0?this.length:i>>>0,r||(r=0);let o;if(typeof r=="number")for(o=t;o2**32?e=K(String(t)):typeof t=="bigint"&&(e=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(e=K(e)),e+="n"),i+=` It must be ${r}. Received ${e}`,i},RangeError);function K(n){let r="",t=n.length,i=n[0]==="-"?1:0;for(;t>=i+4;t-=3)r=`_${n.slice(t-3,t)}${r}`;return`${n.slice(0,t)}${r}`}function Pr(n,r,t){R(r,"offset"),(n[r]===void 0||n[r+t]===void 0)&&S(r,n.length-(t+1))}function fr(n,r,t,i,e,o){if(n>t||n3?r===0||r===BigInt(0)?c=`>= 0${u} and < 2${u} ** ${(o+1)*8}${u}`:c=`>= -(2${u} ** ${(o+1)*8-1}${u}) and < 2 ** ${(o+1)*8-1}${u}`:c=`>= ${r}${u} and <= ${t}${u}`,new U.ERR_OUT_OF_RANGE("value",c,n)}Pr(i,e,o)}function R(n,r){if(typeof n!="number")throw new U.ERR_INVALID_ARG_TYPE(r,"number",n)}function S(n,r,t){throw Math.floor(n)!==n?(R(n,t),new U.ERR_OUT_OF_RANGE(t||"offset","an integer",n)):r<0?new U.ERR_BUFFER_OUT_OF_BOUNDS:new U.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${r}`,n)}var Or=/[^+/0-9A-Za-z-_]/g;function Gr(n){if(n=n.split("=")[0],n=n.trim().replace(Or,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function O(n,r){r=r||1/0;let t,i=n.length,e=null,o=[];for(let u=0;u55295&&t<57344){if(!e){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===i){(r-=3)>-1&&o.push(239,191,189);continue}e=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),e=t;continue}t=(e-55296<<10|t-56320)+65536}else e&&(r-=3)>-1&&o.push(239,191,189);if(e=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function Yr(n){let r=[];for(let t=0;t>8,e=t%256,o.push(e),o.push(i);return o}function pr(n){return D.toByteArray(Gr(n))}function N(n,r,t,i){let e;for(e=0;e=r.length||e>=n.length);++e)r[e+t]=n[e];return e}function w(n,r){return n instanceof r||n!=null&&n.constructor!=null&&n.constructor.name!=null&&n.constructor.name===r.name||r===Uint8Array&&h.isBuffer(n)}function lr(n){return n!==n}var Hr=function(){let n="0123456789abcdef",r=new Array(256);for(let t=0;t<16;++t){let i=t*16;for(let e=0;e<16;++e)r[i+e]=n[t]+n[e]}return r}(),Z=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];function I(n){return typeof BigInt>"u"?Wr:n}function Wr(){throw new Error("BigInt not supported")}});Xr();})(); +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/*! Bundled license information: + +ieee754/index.js: + (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) +*/ -- 2.34.1