-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.mjs
8 lines (8 loc) · 30.1 KB
/
index.mjs
1
2
3
4
5
6
7
8
var Rt=Object.create;var et=Object.defineProperty;var _t=Object.getOwnPropertyDescriptor;var Ct=Object.getOwnPropertyNames;var Lt=Object.getPrototypeOf,kt=Object.prototype.hasOwnProperty;var G=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Dt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ct(t))!kt.call(e,i)&&i!==r&&et(e,i,{get:()=>t[i],enumerable:!(n=_t(t,i))||n.enumerable});return e};var Mt=(e,t,r)=>(r=e!=null?Rt(Lt(e)):{},Dt(t||!e||!e.__esModule?et(r,"default",{value:e,enumerable:!0}):r,e));var ot=G(N=>{"use strict";N.byteLength=Ot;N.toByteArray=$t;N.fromByteArray=Vt;var E=[],B=[],Nt=typeof Uint8Array<"u"?Uint8Array:Array,Y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(T=0,nt=Y.length;T<nt;++T)E[T]=Y[T],B[Y.charCodeAt(T)]=T;var T,nt;B["-".charCodeAt(0)]=62;B["_".charCodeAt(0)]=63;function it(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function Ot(e){var t=it(e),r=t[0],n=t[1];return(r+n)*3/4-n}function Pt(e,t,r){return(t+r)*3/4-r}function $t(e){var t,r=it(e),n=r[0],i=r[1],o=new Nt(Pt(e,n,i)),u=0,h=i>0?n-4:n,f;for(f=0;f<h;f+=4)t=B[e.charCodeAt(f)]<<18|B[e.charCodeAt(f+1)]<<12|B[e.charCodeAt(f+2)]<<6|B[e.charCodeAt(f+3)],o[u++]=t>>16&255,o[u++]=t>>8&255,o[u++]=t&255;return i===2&&(t=B[e.charCodeAt(f)]<<2|B[e.charCodeAt(f+1)]>>4,o[u++]=t&255),i===1&&(t=B[e.charCodeAt(f)]<<10|B[e.charCodeAt(f+1)]<<4|B[e.charCodeAt(f+2)]>>2,o[u++]=t>>8&255,o[u++]=t&255),o}function Gt(e){return E[e>>18&63]+E[e>>12&63]+E[e>>6&63]+E[e&63]}function Yt(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),i.push(Gt(n));return i.join("")}function Vt(e){for(var t,r=e.length,n=r%3,i=[],o=16383,u=0,h=r-n;u<h;u+=o)i.push(Yt(e,u,u+o>h?h:u+o));return n===1?(t=e[r-1],i.push(E[t>>2]+E[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(E[t>>10]+E[t>>4&63]+E[t<<2&63]+"=")),i.join("")}});var ut=G(V=>{V.read=function(e,t,r,n,i){var o,u,h=i*8-n-1,f=(1<<h)-1,p=f>>1,a=-7,s=r?i-1:0,l=r?-1:1,y=e[t+s];for(s+=l,o=y&(1<<-a)-1,y>>=-a,a+=h;a>0;o=o*256+e[t+s],s+=l,a-=8);for(u=o&(1<<-a)-1,o>>=-a,a+=n;a>0;u=u*256+e[t+s],s+=l,a-=8);if(o===0)o=1-p;else{if(o===f)return u?NaN:(y?-1:1)*(1/0);u=u+Math.pow(2,n),o=o-p}return(y?-1:1)*u*Math.pow(2,o-n)};V.write=function(e,t,r,n,i,o){var u,h,f,p=o*8-i-1,a=(1<<p)-1,s=a>>1,l=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:o-1,A=n?1:-1,U=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(h=isNaN(t)?1:0,u=a):(u=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-u))<1&&(u--,f*=2),u+s>=1?t+=l/f:t+=l*Math.pow(2,1-s),t*f>=2&&(u++,f/=2),u+s>=a?(h=0,u=a):u+s>=1?(h=(t*f-1)*Math.pow(2,i),u=u+s):(h=t*Math.pow(2,s-1)*Math.pow(2,i),u=0));i>=8;e[r+y]=h&255,y+=A,h/=256,i-=8);for(u=u<<i|h,p+=i;p>0;e[r+y]=u&255,y+=A,u/=256,p-=8);e[r+y-A]|=U*128}});var Ft=G(L=>{"use strict";var j=ot(),_=ut(),ct=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;L.Buffer=c;L.SlowBuffer=Ht;L.INSPECT_MAX_BYTES=50;var O=2147483647;L.kMaxLength=O;c.TYPED_ARRAY_SUPPORT=jt();!c.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 jt(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(!!c.isBuffer(this))return this.buffer}});Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(!!c.isBuffer(this))return this.byteOffset}});function m(e){if(e>O)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return z(e)}return at(e,t,r)}c.poolSize=8192;function at(e,t,r){if(typeof e=="string")return qt(e,t);if(ArrayBuffer.isView(e))return Xt(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(g(e,ArrayBuffer)||e&&g(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(g(e,SharedArrayBuffer)||e&&g(e.buffer,SharedArrayBuffer)))return q(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return c.from(n,t,r);let i=zt(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}c.from=function(e,t,r){return at(e,t,r)};Object.setPrototypeOf(c.prototype,Uint8Array.prototype);Object.setPrototypeOf(c,Uint8Array);function pt(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Wt(e,t,r){return pt(e),e<=0?m(e):t!==void 0?typeof r=="string"?m(e).fill(t,r):m(e).fill(t):m(e)}c.alloc=function(e,t,r){return Wt(e,t,r)};function z(e){return pt(e),m(e<0?0:H(e)|0)}c.allocUnsafe=function(e){return z(e)};c.allocUnsafeSlow=function(e){return z(e)};function qt(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=lt(e,t)|0,n=m(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function W(e){let t=e.length<0?0:H(e.length)|0,r=m(t);for(let n=0;n<t;n+=1)r[n]=e[n]&255;return r}function Xt(e){if(g(e,Uint8Array)){let t=new Uint8Array(e);return q(t.buffer,t.byteOffset,t.byteLength)}return W(e)}function q(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function zt(e){if(c.isBuffer(e)){let t=H(e.length)|0,r=m(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||Z(e.length)?m(0):W(e);if(e.type==="Buffer"&&Array.isArray(e.data))return W(e.data)}function H(e){if(e>=O)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+O.toString(16)+" bytes");return e|0}function Ht(e){return+e!=e&&(e=0),c.alloc(+e)}c.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==c.prototype};c.compare=function(t,r){if(g(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),g(r,Uint8Array)&&(r=c.from(r,r.offset,r.byteLength)),!c.isBuffer(t)||!c.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;let n=t.length,i=r.length;for(let o=0,u=Math.min(n,i);o<u;++o)if(t[o]!==r[o]){n=t[o],i=r[o];break}return n<i?-1:i<n?1:0};c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};c.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return c.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;let i=c.allocUnsafe(r),o=0;for(n=0;n<t.length;++n){let u=t[n];if(g(u,Uint8Array))o+u.length>i.length?(c.isBuffer(u)||(u=c.from(u)),u.copy(i,o)):Uint8Array.prototype.set.call(i,u,o);else if(c.isBuffer(u))u.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=u.length}return i};function lt(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||g(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return mt(e).length;default:if(i)return n?-1:X(e).length;t=(""+t).toLowerCase(),i=!0}}c.byteLength=lt;function Jt(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return or(this,t,r);case"utf8":case"utf-8":return wt(this,t,r);case"ascii":return nr(this,t,r);case"latin1":case"binary":return ir(this,t,r);case"base64":return rr(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ur(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}c.prototype._isBuffer=!0;function b(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}c.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<t;r+=2)b(this,r,r+1);return this};c.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<t;r+=4)b(this,r,r+3),b(this,r+1,r+2);return this};c.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<t;r+=8)b(this,r,r+7),b(this,r+1,r+6),b(this,r+2,r+5),b(this,r+3,r+4);return this};c.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?wt(this,0,t):Jt.apply(this,arguments)};c.prototype.toLocaleString=c.prototype.toString;c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:c.compare(this,t)===0};c.prototype.inspect=function(){let t="",r=L.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};ct&&(c.prototype[ct]=c.prototype.inspect);c.prototype.compare=function(t,r,n,i,o){if(g(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;let u=o-i,h=n-r,f=Math.min(u,h),p=this.slice(i,o),a=t.slice(r,n);for(let s=0;s<f;++s)if(p[s]!==a[s]){u=p[s],h=a[s];break}return u<h?-1:h<u?1:0};function yt(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Z(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=c.from(t,n)),c.isBuffer(t))return t.length===0?-1:ht(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):ht(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function ht(e,t,r,n,i){let o=1,u=e.length,h=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,u/=2,h/=2,r/=2}function f(a,s){return o===1?a[s]:a.readUInt16BE(s*o)}let p;if(i){let a=-1;for(p=r;p<u;p++)if(f(e,p)===f(t,a===-1?0:p-a)){if(a===-1&&(a=p),p-a+1===h)return a*o}else a!==-1&&(p-=p-a),a=-1}else for(r+h>u&&(r=u-h),p=r;p>=0;p--){let a=!0;for(let s=0;s<h;s++)if(f(e,p+s)!==f(t,s)){a=!1;break}if(a)return p}return-1}c.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};c.prototype.indexOf=function(t,r,n){return yt(this,t,r,n,!0)};c.prototype.lastIndexOf=function(t,r,n){return yt(this,t,r,n,!1)};function Zt(e,t,r,n){r=Number(r)||0;let i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let u;for(u=0;u<n;++u){let h=parseInt(t.substr(u*2,2),16);if(Z(h))return u;e[r+u]=h}return u}function Kt(e,t,r,n){return P(X(t,e.length-r),e,r,n)}function Qt(e,t,r,n){return P(sr(t),e,r,n)}function vt(e,t,r,n){return P(mt(t),e,r,n)}function tr(e,t,r,n){return P(ar(t,e.length-r),e,r,n)}c.prototype.write=function(t,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let u=!1;for(;;)switch(i){case"hex":return Zt(this,t,r,n);case"utf8":case"utf-8":return Kt(this,t,r,n);case"ascii":case"latin1":case"binary":return Qt(this,t,r,n);case"base64":return vt(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tr(this,t,r,n);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}};c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function rr(e,t,r){return t===0&&r===e.length?j.fromByteArray(e):j.fromByteArray(e.slice(t,r))}function wt(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let o=e[i],u=null,h=o>239?4:o>223?3:o>191?2:1;if(i+h<=r){let f,p,a,s;switch(h){case 1:o<128&&(u=o);break;case 2:f=e[i+1],(f&192)===128&&(s=(o&31)<<6|f&63,s>127&&(u=s));break;case 3:f=e[i+1],p=e[i+2],(f&192)===128&&(p&192)===128&&(s=(o&15)<<12|(f&63)<<6|p&63,s>2047&&(s<55296||s>57343)&&(u=s));break;case 4:f=e[i+1],p=e[i+2],a=e[i+3],(f&192)===128&&(p&192)===128&&(a&192)===128&&(s=(o&15)<<18|(f&63)<<12|(p&63)<<6|a&63,s>65535&&s<1114112&&(u=s))}}u===null?(u=65533,h=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),i+=h}return er(n)}var ft=4096;function er(e){let t=e.length;if(t<=ft)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=ft));return r}function nr(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]&127);return n}function ir(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function or(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let o=t;o<r;++o)i+=pr[e[o]];return i}function ur(e,t,r){let n=e.slice(t,r),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}c.prototype.slice=function(t,r){let n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);let i=this.subarray(t,r);return Object.setPrototypeOf(i,c.prototype),i};function w(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||w(t,r,this.length);let i=this[t],o=1,u=0;for(;++u<r&&(o*=256);)i+=this[t+u]*o;return i};c.prototype.readUintBE=c.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||w(t,r,this.length);let i=this[t+--r],o=1;for(;r>0&&(o*=256);)i+=this[t+--r]*o;return i};c.prototype.readUint8=c.prototype.readUInt8=function(t,r){return t=t>>>0,r||w(t,1,this.length),this[t]};c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||w(t,2,this.length),this[t]|this[t+1]<<8};c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||w(t,2,this.length),this[t]<<8|this[t+1]};c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||w(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};c.prototype.readBigUInt64LE=F(function(t){t=t>>>0,C(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&M(t,this.length-8);let i=r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});c.prototype.readBigUInt64BE=F(function(t){t=t>>>0,C(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&M(t,this.length-8);let i=r*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});c.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||w(t,r,this.length);let i=this[t],o=1,u=0;for(;++u<r&&(o*=256);)i+=this[t+u]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};c.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||w(t,r,this.length);let i=r,o=1,u=this[t+--i];for(;i>0&&(o*=256);)u+=this[t+--i]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*r)),u};c.prototype.readInt8=function(t,r){return t=t>>>0,r||w(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};c.prototype.readInt16LE=function(t,r){t=t>>>0,r||w(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};c.prototype.readInt16BE=function(t,r){t=t>>>0,r||w(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};c.prototype.readInt32LE=function(t,r){return t=t>>>0,r||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};c.prototype.readInt32BE=function(t,r){return t=t>>>0,r||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};c.prototype.readBigInt64LE=F(function(t){t=t>>>0,C(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&M(t,this.length-8);let i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)});c.prototype.readBigInt64BE=F(function(t){t=t>>>0,C(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&M(t,this.length-8);let i=(r<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)});c.prototype.readFloatLE=function(t,r){return t=t>>>0,r||w(t,4,this.length),_.read(this,t,!0,23,4)};c.prototype.readFloatBE=function(t,r){return t=t>>>0,r||w(t,4,this.length),_.read(this,t,!1,23,4)};c.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||w(t,8,this.length),_.read(this,t,!0,52,8)};c.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||w(t,8,this.length),_.read(this,t,!1,52,8)};function d(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){let h=Math.pow(2,8*n)-1;d(this,t,r,n,h,0)}let o=1,u=0;for(this[r]=t&255;++u<n&&(o*=256);)this[r+u]=t/o&255;return r+n};c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){let h=Math.pow(2,8*n)-1;d(this,t,r,n,h,0)}let o=n-1,u=1;for(this[r+o]=t&255;--o>=0&&(u*=256);)this[r+o]=t/u&255;return r+n};c.prototype.writeUint8=c.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||d(this,t,r,1,255,0),this[r]=t&255,r+1};c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||d(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||d(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||d(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||d(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function xt(e,t,r,n,i){It(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let u=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=u,u=u>>8,e[r++]=u,u=u>>8,e[r++]=u,u=u>>8,e[r++]=u,r}function dt(e,t,r,n,i){It(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let u=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=u,u=u>>8,e[r+2]=u,u=u>>8,e[r+1]=u,u=u>>8,e[r]=u,r+8}c.prototype.writeBigUInt64LE=F(function(t,r=0){return xt(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});c.prototype.writeBigUInt64BE=F(function(t,r=0){return dt(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});c.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){let f=Math.pow(2,8*n-1);d(this,t,r,n,f-1,-f)}let o=0,u=1,h=0;for(this[r]=t&255;++o<n&&(u*=256);)t<0&&h===0&&this[r+o-1]!==0&&(h=1),this[r+o]=(t/u>>0)-h&255;return r+n};c.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){let f=Math.pow(2,8*n-1);d(this,t,r,n,f-1,-f)}let o=n-1,u=1,h=0;for(this[r+o]=t&255;--o>=0&&(u*=256);)t<0&&h===0&&this[r+o+1]!==0&&(h=1),this[r+o]=(t/u>>0)-h&255;return r+n};c.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||d(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};c.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||d(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};c.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||d(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};c.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||d(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};c.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||d(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};c.prototype.writeBigInt64LE=F(function(t,r=0){return xt(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});c.prototype.writeBigInt64BE=F(function(t,r=0){return dt(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Bt(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Et(e,t,r,n,i){return t=+t,r=r>>>0,i||Bt(e,t,r,4,34028234663852886e22,-34028234663852886e22),_.write(e,t,r,n,23,4),r+4}c.prototype.writeFloatLE=function(t,r,n){return Et(this,t,r,!0,n)};c.prototype.writeFloatBE=function(t,r,n){return Et(this,t,r,!1,n)};function gt(e,t,r,n,i){return t=+t,r=r>>>0,i||Bt(e,t,r,8,17976931348623157e292,-17976931348623157e292),_.write(e,t,r,n,52,8),r+8}c.prototype.writeDoubleLE=function(t,r,n){return gt(this,t,r,!0,n)};c.prototype.writeDoubleBE=function(t,r,n){return gt(this,t,r,!1,n)};c.prototype.copy=function(t,r,n,i){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);let o=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),r),o};c.prototype.fill=function(t,r,n,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){let u=t.charCodeAt(0);(i==="utf8"&&u<128||i==="latin1")&&(t=u)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let o;if(typeof t=="number")for(o=r;o<n;++o)this[o]=t;else{let u=c.isBuffer(t)?t:c.from(t,i),h=u.length;if(h===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-r;++o)this[o+r]=u[o%h]}return this};var R={};function J(e,t,r){R[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}J("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);J("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);J("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=st(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=st(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function st(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function cr(e,t,r){C(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&M(t,e.length-(r+1))}function It(e,t,r,n,i,o){if(e>r||e<t){let u=typeof t=="bigint"?"n":"",h;throw o>3?t===0||t===BigInt(0)?h=`>= 0${u} and < 2${u} ** ${(o+1)*8}${u}`:h=`>= -(2${u} ** ${(o+1)*8-1}${u}) and < 2 ** ${(o+1)*8-1}${u}`:h=`>= ${t}${u} and <= ${r}${u}`,new R.ERR_OUT_OF_RANGE("value",h,e)}cr(n,i,o)}function C(e,t){if(typeof e!="number")throw new R.ERR_INVALID_ARG_TYPE(t,"number",e)}function M(e,t,r){throw Math.floor(e)!==e?(C(e,r),new R.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new R.ERR_BUFFER_OUT_OF_BOUNDS:new R.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var hr=/[^+/0-9A-Za-z-_]/g;function fr(e){if(e=e.split("=")[0],e=e.trim().replace(hr,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function X(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let u=0;u<n;++u){if(r=e.charCodeAt(u),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(u+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function sr(e){let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r)&255);return t}function ar(e,t){let r,n,i,o=[];for(let u=0;u<e.length&&!((t-=2)<0);++u)r=e.charCodeAt(u),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function mt(e){return j.toByteArray(fr(e))}function P(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function g(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Z(e){return e!==e}var pr=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function F(e){return typeof BigInt>"u"?lr:e}function lr(){throw new Error("BigInt not supported")}});var K=Mt(Ft()),yr=/[\u0000-\u0008\u1c80-\u1c86\u000B-\u001F\u007F-\u009F\u2000-\u200F\u2028-\u202F\u205F-\u206F\u3000\uFEFF\u{E0100}-\u{E01EF}]/u,wr=/[&$\+,:;~"`'=\?@#\s<>/\[\]\{\}|\\\^%]/u,Rr=/[0-9]/,xr=["a-z","\u03B1-\u03C9","\u0430-\u044F","\u4E00-\u9FAF"],dr=new RegExp(`^[${xr.join("")}]*$`,"iu"),Br=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Q=2**16,At=Q-1;function*Er(e=Q,t=!0,r=!0){for(let n=0;n<e;n++){let i=String.fromCodePoint(n);t&&dr.test(i)&&!yr.test(i)&&r&&!wr.test(i)&&n<e&&(yield i)}}var gr=(e=Q,t=!0,r=!0)=>[...Er(e,t,r)].join(""),I=gr(),Ir=At-I.length,Ut=Math.floor(At/I.length);if(Ut>3)throw new Error("The Unicode alphabet is too small to represent all possible symbols");var Tt=Math.round(Ir/Ut),k=Math.floor(Math.log2(I.length))/2,bt=1,mr=0,_r=e=>{if(typeof e=="string"){let l=K.Buffer.from(e),y=l.buffer.slice(l.byteOffset,l.byteOffset+l.byteLength);e=new Uint8Array(y)}let t=new DataView(e.buffer),r=[],n=0,i="";e.byteLength&1?r.push(bt):r.push(mr);let o=Math.ceil(e.byteLength),u=e.byteLength,h=o&1?o+1:o,f=h/Uint16Array.BYTES_PER_ELEMENT,p=f<=k,a=0,s=0;for(let l=0;l<h;l+=Uint16Array.BYTES_PER_ELEMENT){s++;let y=l/Uint16Array.BYTES_PER_ELEMENT,A=l===0||s===k,U=y===f-1,v=y===0,tt=A&&y>=0,$=u-l===1;l===0&&(r.push("0".charCodeAt(0)),a++);let S=$?t.getUint8(l):t.getUint16(l,Br);if(typeof I[S]>"u"){let x=1;for(;;){let D=S-Tt*x;if(typeof I[D]<"u"){r.push(I.charAt(D)),i=x.toString(2).padStart(2,"0")+i;break}if(++x,x===9)throw new Error("Encoder failed to encode the input value after 9 attempts: "+S)}}else r.push(I.charAt(S)),i="00"+i;if(tt||U){let x=n*k-k,D=parseInt(i,2),St=x+a,rt=!Number.isNaN(D)&&St>=1;rt&&(r[x+a]=I.charAt(D),s=0),rt&&!U&&!v&&(i="",p||(r.push("0".charCodeAt(0)),a++)),n++}}return r.join("")},Fr=e=>{if(!e||!e.length)return new Uint8Array;let t=[],r=[],n=!!(e.charCodeAt(0)&bt),i=[],o=0;for(let u=1;u<e.length-1;u++){if((u-1)%k===0){let U=e[u+o];if(typeof U>"u")break;let $=I.indexOf(U).toString(2).padStart(16,"0").match(/.{1,2}/g).map(x=>parseInt(x,2)).reverse();o++;let S=u+o;for(let x=0;x<k;x++)i[S+x]=$[x]}let p=u+o;if(typeof e[p]>"u")break;let a=e.charAt(p),s=u+1>=e.length-o,l=I.indexOf(a)+Tt*i[p],y=l&255,A=l>>8;if(n&&s){r.push(y);break}else r.push(y),r.push(A);t.push(l)}return new Uint8Array(r)},Cr=e=>K.Buffer.from(Fr(e)).toString();export{xr as CharacterClassRanges,wr as IsNotUriSafe,Rr as IsSimpleDigit,yr as IsUnicodeNonPrintableTest,I as UnicodeAlphabet,Cr as decodeToString,Fr as decodeToUint8Array,_r as encode,Br as isLittleEndian,gr as makeAlphabet};
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */