UNPKG

neon-serverless

Version:

node-postgres for serverless environments from neon.tech

578 lines 139 kB
"use strict";var Zs=Object.create;var ve=Object.defineProperty;var Js=Object.getOwnPropertyDescriptor;var Xs=Object.getOwnPropertyNames;var eo=Object.getPrototypeOf,to=Object.prototype.hasOwnProperty;var ro=(r,e,t)=>e in r?ve(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}): r[e]=t;var a=(r,e)=>ve(r,"name",{value:e,configurable:!0});var W=(r,e)=>()=>(r&&(e=r(r=0)),e);var I=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Y=(r,e)=>{for(var t in e) ve(r,t,{get:e[t],enumerable:!0})},_n=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e== "function")for(let i of Xs(e))!to.call(r,i)&&i!==t&&ve(r,i,{get:()=>e[i],enumerable:!(n= Js(e,i))||n.enumerable});return r};var qe=(r,e,t)=>(t=r!=null?Zs(eo(r)):{},_n(e||!r||!r.__esModule?ve(t,"default",{ value:r,enumerable:!0}):t,r)),U=r=>_n(ve({},"__esModule",{value:!0}),r);var T=(r,e,t)=>(ro(r,typeof e!="symbol"?e+"":e,t),t);var In=I(rt=>{"use strict";p();rt.byteLength=io;rt.toByteArray=oo;rt.fromByteArray= co;var oe=[],J=[],no=typeof Uint8Array<"u"?Uint8Array:Array,It="ABCDEFGHIJKLMNOP\ QRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(xe=0,An=It.length;xe<An;++xe) oe[xe]=It[xe],J[It.charCodeAt(xe)]=xe;var xe,An;J["-".charCodeAt(0)]=62;J["_".charCodeAt( 0)]=63;function Cn(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. L\ ength must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0: 4-t%4;return[t,n]}a(Cn,"getLens");function io(r){var e=Cn(r),t=e[0],n=e[1];return(t+ n)*3/4-n}a(io,"byteLength");function so(r,e,t){return(e+t)*3/4-t}a(so,"_byteLeng\ th");function oo(r){var e,t=Cn(r),n=t[0],i=t[1],s=new no(so(r,n,i)),o=0,u=i>0?n- 4:n,c;for(c=0;c<u;c+=4)e=J[r.charCodeAt(c)]<<18|J[r.charCodeAt(c+1)]<<12|J[r.charCodeAt( c+2)]<<6|J[r.charCodeAt(c+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i=== 2&&(e=J[r.charCodeAt(c)]<<2|J[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=J[r. charCodeAt(c)]<<10|J[r.charCodeAt(c+1)]<<4|J[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255, s[o++]=e&255),s}a(oo,"toByteArray");function ao(r){return oe[r>>18&63]+oe[r>>12& 63]+oe[r>>6&63]+oe[r&63]}a(ao,"tripletToBase64");function uo(r,e,t){for(var n,i=[], s=e;s<t;s+=3)n=(r[s]<<16&16711680)+(r[s+1]<<8&65280)+(r[s+2]&255),i.push(ao(n)); return i.join("")}a(uo,"encodeChunk");function co(r){for(var e,t=r.length,n=t%3, i=[],s=16383,o=0,u=t-n;o<u;o+=s)i.push(uo(r,o,o+s>u?u:o+s));return n===1?(e=r[t- 1],i.push(oe[e>>2]+oe[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(oe[e>> 10]+oe[e>>4&63]+oe[e<<2&63]+"=")),i.join("")}a(co,"fromByteArray")});var Tn=I(Tt=>{p();Tt.read=function(r,e,t,n,i){var s,o,u=i*8-n-1,c=(1<<u)-1,h=c>> 1,f=-7,m=t?i-1:0,x=t?-1:1,A=r[e+m];for(m+=x,s=A&(1<<-f)-1,A>>=-f,f+=u;f>0;s=s*256+ r[e+m],m+=x,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=n;f>0;o=o*256+r[e+m],m+=x,f-=8);if(s=== 0)s=1-h;else{if(s===c)return o?NaN:(A?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-h}return(A? -1:1)*o*Math.pow(2,s-n)};Tt.write=function(r,e,t,n,i,s){var o,u,c,h=s*8-i-1,f=(1<< h)-1,m=f>>1,x=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=n?0:s-1,P=n?1:-1,D=e<0|| e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=f):(o=Math. floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+m>=1?e+=x/c:e+= x*Math.pow(2,1-m),e*c>=2&&(o++,c/=2),o+m>=f?(u=0,o=f):o+m>=1?(u=(e*c-1)*Math.pow( 2,i),o=o+m):(u=e*Math.pow(2,m-1)*Math.pow(2,i),o=0));i>=8;r[t+A]=u&255,A+=P,u/=256, i-=8);for(o=o<<i|u,h+=i;h>0;r[t+A]=o&255,A+=P,o/=256,h-=8);r[t+A-P]|=D*128}});var Gn=I(Ie=>{"use strict";p();var Pt=In(),Ae=Tn(),Pn=typeof Symbol=="function"&& typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ie.Buffer= l;Ie.SlowBuffer=mo;Ie.INSPECT_MAX_BYTES=50;var nt=2147483647;Ie.kMaxLength=nt;l. TYPED_ARRAY_SUPPORT=ho();!l.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console. error=="function"&&console.error("This browser lacks typed array (Uint8Array) su\ pport which is required by `buffer` v5.x. Use `buffer` v4.x if you require old b\ rowser support.");function ho(){try{let r=new Uint8Array(1),e={foo:function(){return 42}}; return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e), r.foo()===42}catch{return!1}}a(ho,"typedArraySupport");Object.defineProperty(l.prototype, "parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}); Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer( this))return this.byteOffset}});function he(r){if(r>nt)throw new RangeError('The\ value "'+r+'" is invalid for option "size"');let e=new Uint8Array(r);return Object. setPrototypeOf(e,l.prototype),e}a(he,"createBuffer");function l(r,e,t){if(typeof r== "number"){if(typeof e=="string")throw new TypeError('The "string" argument must \ be of type string. Received type number');return Ft(r)}return Fn(r,e,t)}a(l,"Buf\ fer");l.poolSize=8192;function Fn(r,e,t){if(typeof r=="string")return fo(r,e);if(ArrayBuffer. isView(r))return po(r);if(r==null)throw new TypeError("The first argument must b\ e one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received\ type "+typeof r);if(ae(r,ArrayBuffer)||r&&ae(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer< "u"&&(ae(r,SharedArrayBuffer)||r&&ae(r.buffer,SharedArrayBuffer)))return Lt(r,e, t);if(typeof r=="number")throw new TypeError('The "value" argument must not be o\ f type number. Received type number');let n=r.valueOf&&r.valueOf();if(n!=null&&n!== r)return l.from(n,e,t);let i=yo(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!= null&&typeof r[Symbol.toPrimitive]=="function")return l.from(r[Symbol.toPrimitive]( "string"),e,t);throw new TypeError("The first argument must be one of type strin\ g, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}a( Fn,"from");l.from=function(r,e,t){return Fn(r,e,t)};Object.setPrototypeOf(l.prototype, Uint8Array.prototype);Object.setPrototypeOf(l,Uint8Array);function Mn(r){if(typeof r!= "number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError( 'The value "'+r+'" is invalid for option "size"')}a(Mn,"assertSize");function lo(r,e,t){ return Mn(r),r<=0?he(r):e!==void 0?typeof t=="string"?he(r).fill(e,t):he(r).fill( e):he(r)}a(lo,"alloc");l.alloc=function(r,e,t){return lo(r,e,t)};function Ft(r){ return Mn(r),he(r<0?0:Mt(r)|0)}a(Ft,"allocUnsafe");l.allocUnsafe=function(r){return Ft( r)};l.allocUnsafeSlow=function(r){return Ft(r)};function fo(r,e){if((typeof e!="\ string"||e==="")&&(e="utf8"),!l.isEncoding(e))throw new TypeError("Unknown encod\ ing: "+e);let t=Dn(r,e)|0,n=he(t),i=n.write(r,e);return i!==t&&(n=n.slice(0,i)), n}a(fo,"fromString");function Bt(r){let e=r.length<0?0:Mt(r.length)|0,t=he(e);for(let n=0;n< e;n+=1)t[n]=r[n]&255;return t}a(Bt,"fromArrayLike");function po(r){if(ae(r,Uint8Array)){ let e=new Uint8Array(r);return Lt(e.buffer,e.byteOffset,e.byteLength)}return Bt( r)}a(po,"fromArrayView");function Lt(r,e,t){if(e<0||r.byteLength<e)throw new RangeError( '"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError( '"length" is outside of buffer bounds');let n;return e===void 0&&t===void 0?n=new Uint8Array( r):t===void 0?n=new Uint8Array(r,e):n=new Uint8Array(r,e,t),Object.setPrototypeOf( n,l.prototype),n}a(Lt,"fromArrayBuffer");function yo(r){if(l.isBuffer(r)){let e=Mt( r.length)|0,t=he(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0) return typeof r.length!="number"||kt(r.length)?he(0):Bt(r);if(r.type==="Buffer"&& Array.isArray(r.data))return Bt(r.data)}a(yo,"fromObject");function Mt(r){if(r>= nt)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ nt.toString(16)+" bytes");return r|0}a(Mt,"checked");function mo(r){return+r!=r&& (r=0),l.alloc(+r)}a(mo,"SlowBuffer");l.isBuffer=a(function(e){return e!=null&&e. _isBuffer===!0&&e!==l.prototype},"isBuffer");l.compare=a(function(e,t){if(ae(e,Uint8Array)&& (e=l.from(e,e.offset,e.byteLength)),ae(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)), !l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments\ must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,i=t. length;for(let s=0,o=Math.min(n,i);s<o;++s)if(e[s]!==t[s]){n=e[s],i=t[s];break}return n< i?-1:i<n?1:0},"compare");l.isEncoding=a(function(e){switch(String(e).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}},"isEn\ coding");l.concat=a(function(e,t){if(!Array.isArray(e))throw new TypeError('"lis\ t" argument must be an Array of Buffers');if(e.length===0)return l.alloc(0);let n; if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let i=l.allocUnsafe(t),s=0; for(n=0;n<e.length;++n){let o=e[n];if(ae(o,Uint8Array))s+o.length>i.length?(l.isBuffer( o)||(o=l.from(o)),o.copy(i,s)):Uint8Array.prototype.set.call(i,o,s);else if(l.isBuffer( o))o.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buf\ fers');s+=o.length}return i},"concat");function Dn(r,e){if(l.isBuffer(r))return r. length;if(ArrayBuffer.isView(r)||ae(r,ArrayBuffer))return r.byteLength;if(typeof r!= "string")throw new TypeError('The "string" argument must be one of type string, \ Buffer, or ArrayBuffer. Received type '+typeof r);let t=r.length,n=arguments.length> 2&&arguments[2]===!0;if(!n&&t===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"\ latin1":case"binary":return t;case"utf8":case"utf-8":return Rt(r).length;case"uc\ s2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"\ base64":return Hn(r).length;default:if(i)return n?-1:Rt(r).length;e=(""+e).toLowerCase(), i=!0}}a(Dn,"byteLength");l.byteLength=Dn;function go(r,e,t){let n=!1;if((e===void 0|| e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)|| (t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Io( this,e,t);case"utf8":case"utf-8":return Un(this,e,t);case"ascii":return Ao(this, e,t);case"latin1":case"binary":return Co(this,e,t);case"base64":return vo(this,e, t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return To(this,e,t);default: if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a( go,"slowToString");l.prototype._isBuffer=!0;function Ee(r,e,t){let n=r[e];r[e]=r[t], r[t]=n}a(Ee,"swap");l.prototype.swap16=a(function(){let e=this.length;if(e%2!==0) throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t< e;t+=2)Ee(this,t,t+1);return this},"swap16");l.prototype.swap32=a(function(){let e=this. length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bit\ s");for(let t=0;t<e;t+=4)Ee(this,t,t+3),Ee(this,t+1,t+2);return this},"swap32"); l.prototype.swap64=a(function(){let e=this.length;if(e%8!==0)throw new RangeError( "Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)Ee(this,t,t+7), Ee(this,t+1,t+6),Ee(this,t+2,t+5),Ee(this,t+3,t+4);return this},"swap64");l.prototype. toString=a(function(){let e=this.length;return e===0?"":arguments.length===0?Un( this,0,e):go.apply(this,arguments)},"toString");l.prototype.toLocaleString=l.prototype. toString;l.prototype.equals=a(function(e){if(!l.isBuffer(e))throw new TypeError( "Argument must be a Buffer");return this===e?!0:l.compare(this,e)===0},"equals"); l.prototype.inspect=a(function(){let e="",t=Ie.INSPECT_MAX_BYTES;return e=this.toString( "hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+ e+">"},"inspect");Pn&&(l.prototype[Pn]=l.prototype.inspect);l.prototype.compare= a(function(e,t,n,i,s){if(ae(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l. isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffe\ r or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e? e.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),t<0||n>e.length||i<0|| s>this.length)throw new RangeError("out of range index");if(i>=s&&t>=n)return 0; if(i>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,s>>>=0,this===e)return 0; let o=s-i,u=n-t,c=Math.min(o,u),h=this.slice(i,s),f=e.slice(t,n);for(let m=0;m<c;++m) if(h[m]!==f[m]){o=h[m],u=f[m];break}return o<u?-1:u<o?1:0},"compare");function kn(r,e,t,n,i){ if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647: t<-2147483648&&(t=-2147483648),t=+t,kt(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t), t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e== "string"&&(e=l.from(e,n)),l.isBuffer(e))return e.length===0?-1:Bn(r,e,t,n,i);if(typeof e== "number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array. prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Bn(r, [e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(kn,"bid\ irectionalIndexOf");function Bn(r,e,t,n,i){let s=1,o=r.length,u=e.length;if(n!== void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="\ utf-16le")){if(r.length<2||e.length<2)return-1;s=2,o/=2,u/=2,t/=2}function c(f,m){ return s===1?f[m]:f.readUInt16BE(m*s)}a(c,"read");let h;if(i){let f=-1;for(h=t;h< o;h++)if(c(r,h)===c(e,f===-1?0:h-f)){if(f===-1&&(f=h),h-f+1===u)return f*s}else f!== -1&&(h-=h-f),f=-1}else for(t+u>o&&(t=o-u),h=t;h>=0;h--){let f=!0;for(let m=0;m<u;m++) if(c(r,h+m)!==c(e,m)){f=!1;break}if(f)return h}return-1}a(Bn,"arrayIndexOf");l.prototype. includes=a(function(e,t,n){return this.indexOf(e,t,n)!==-1},"includes");l.prototype. indexOf=a(function(e,t,n){return kn(this,e,t,n,!0)},"indexOf");l.prototype.lastIndexOf= a(function(e,t,n){return kn(this,e,t,n,!1)},"lastIndexOf");function wo(r,e,t,n){ t=Number(t)||0;let i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;let s=e.length;n> s/2&&(n=s/2);let o;for(o=0;o<n;++o){let u=parseInt(e.substr(o*2,2),16);if(kt(u)) return o;r[t+o]=u}return o}a(wo,"hexWrite");function bo(r,e,t,n){return it(Rt(e, r.length-t),r,t,n)}a(bo,"utf8Write");function So(r,e,t,n){return it(Ro(e),r,t,n)} a(So,"asciiWrite");function xo(r,e,t,n){return it(Hn(e),r,t,n)}a(xo,"base64Write"); function Eo(r,e,t,n){return it(Fo(e,r.length-t),r,t,n)}a(Eo,"ucs2Write");l.prototype. write=a(function(e,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&& typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)? (n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.wri\ te(string, encoding, offset[, length]) is no longer supported");let s=this.length- t;if((n===void 0||n>s)&&(n=s),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError( "Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"\ hex":return wo(this,e,t,n);case"utf8":case"utf-8":return bo(this,e,t,n);case"asc\ ii":case"latin1":case"binary":return So(this,e,t,n);case"base64":return xo(this, e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Eo(this,e,t,n);default: if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"\ write");l.prototype.toJSON=a(function(){return{type:"Buffer",data:Array.prototype. slice.call(this._arr||this,0)}},"toJSON");function vo(r,e,t){return e===0&&t===r. length?Pt.fromByteArray(r):Pt.fromByteArray(r.slice(e,t))}a(vo,"base64Slice");function Un(r,e,t){ t=Math.min(r.length,t);let n=[],i=e;for(;i<t;){let s=r[i],o=null,u=s>239?4:s>223? 3:s>191?2:1;if(i+u<=t){let c,h,f,m;switch(u){case 1:s<128&&(o=s);break;case 2:c= r[i+1],(c&192)===128&&(m=(s&31)<<6|c&63,m>127&&(o=m));break;case 3:c=r[i+1],h=r[i+ 2],(c&192)===128&&(h&192)===128&&(m=(s&15)<<12|(c&63)<<6|h&63,m>2047&&(m<55296|| m>57343)&&(o=m));break;case 4:c=r[i+1],h=r[i+2],f=r[i+3],(c&192)===128&&(h&192)=== 128&&(f&192)===128&&(m=(s&15)<<18|(c&63)<<12|(h&63)<<6|f&63,m>65535&&m<1114112&& (o=m))}}o===null?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320| o&1023),n.push(o),i+=u}return _o(n)}a(Un,"utf8Slice");var Ln=4096;function _o(r){ let e=r.length;if(e<=Ln)return String.fromCharCode.apply(String,r);let t="",n=0; for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=Ln));return t}a(_o,"d\ ecodeCodePointsArray");function Ao(r,e,t){let n="";t=Math.min(r.length,t);for(let i=e;i< t;++i)n+=String.fromCharCode(r[i]&127);return n}a(Ao,"asciiSlice");function Co(r,e,t){ let n="";t=Math.min(r.length,t);for(let i=e;i<t;++i)n+=String.fromCharCode(r[i]); return n}a(Co,"latin1Slice");function Io(r,e,t){let n=r.length;(!e||e<0)&&(e=0), (!t||t<0||t>n)&&(t=n);let i="";for(let s=e;s<t;++s)i+=Mo[r[s]];return i}a(Io,"he\ xSlice");function To(r,e,t){let n=r.slice(e,t),i="";for(let s=0;s<n.length-1;s+= 2)i+=String.fromCharCode(n[s]+n[s+1]*256);return i}a(To,"utf16leSlice");l.prototype. slice=a(function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&& (e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let i=this.subarray( e,t);return Object.setPrototypeOf(i,l.prototype),i},"slice");function q(r,e,t){if(r% 1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError( "Trying to access beyond buffer length")}a(q,"checkOffset");l.prototype.readUintLE= l.prototype.readUIntLE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this.length);let i=this[e], s=1,o=0;for(;++o<t&&(s*=256);)i+=this[e+o]*s;return i},"readUIntLE");l.prototype. readUintBE=l.prototype.readUIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this. length);let i=this[e+--t],s=1;for(;t>0&&(s*=256);)i+=this[e+--t]*s;return i},"re\ adUIntBE");l.prototype.readUint8=l.prototype.readUInt8=a(function(e,t){return e= e>>>0,t||q(e,1,this.length),this[e]},"readUInt8");l.prototype.readUint16LE=l.prototype. readUInt16LE=a(function(e,t){return e=e>>>0,t||q(e,2,this.length),this[e]|this[e+ 1]<<8},"readUInt16LE");l.prototype.readUint16BE=l.prototype.readUInt16BE=a(function(e,t){ return e=e>>>0,t||q(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");l.prototype. readUint32LE=l.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||q(e,4,this. length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE"); l.prototype.readUint32BE=l.prototype.readUInt32BE=a(function(e,t){return e=e>>>0, t||q(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"\ readUInt32BE");l.prototype.readBigUInt64LE=de(a(function(e){e=e>>>0,Ce(e,"offset"); let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Ne(e,this.length-8);let i=t+ this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]* 2**16+n*2**24;return BigInt(i)+(BigInt(s)<<BigInt(32))},"readBigUInt64LE"));l.prototype. readBigUInt64BE=de(a(function(e){e=e>>>0,Ce(e,"offset");let t=this[e],n=this[e+7]; (t===void 0||n===void 0)&&Ne(e,this.length-8);let i=t*2**24+this[++e]*2**16+this[++e]* 2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt( i)<<BigInt(32))+BigInt(s)},"readBigUInt64BE"));l.prototype.readIntLE=a(function(e,t,n){ e=e>>>0,t=t>>>0,n||q(e,t,this.length);let i=this[e],s=1,o=0;for(;++o<t&&(s*=256);) i+=this[e+o]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*t)),i},"readIntLE");l.prototype. readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this.length);let i=t,s=1,o=this[e+ --i];for(;i>0&&(s*=256);)o+=this[e+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*t)), o},"readIntBE");l.prototype.readInt8=a(function(e,t){return e=e>>>0,t||q(e,1,this. length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");l.prototype.readInt16LE= a(function(e,t){e=e>>>0,t||q(e,2,this.length);let n=this[e]|this[e+1]<<8;return n& 32768?n|4294901760:n},"readInt16LE");l.prototype.readInt16BE=a(function(e,t){e=e>>> 0,t||q(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n}, "readInt16BE");l.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||q(e,4,this. length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");l.prototype. readInt32BE=a(function(e,t){return e=e>>>0,t||q(e,4,this.length),this[e]<<24|this[e+ 1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");l.prototype.readBigInt64LE=de(a(function(e){ e=e>>>0,Ce(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Ne(e, this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt( i)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readB\ igInt64LE"));l.prototype.readBigInt64BE=de(a(function(e){e=e>>>0,Ce(e,"offset"); let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Ne(e,this.length-8);let i=(t<< 24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<<BigInt(32))+BigInt( this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)},"readBigInt64BE"));l.prototype. readFloatLE=a(function(e,t){return e=e>>>0,t||q(e,4,this.length),Ae.read(this,e, !0,23,4)},"readFloatLE");l.prototype.readFloatBE=a(function(e,t){return e=e>>>0, t||q(e,4,this.length),Ae.read(this,e,!1,23,4)},"readFloatBE");l.prototype.readDoubleLE= a(function(e,t){return e=e>>>0,t||q(e,8,this.length),Ae.read(this,e,!0,52,8)},"r\ eadDoubleLE");l.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||q(e,8,this. length),Ae.read(this,e,!1,52,8)},"readDoubleBE");function H(r,e,t,n,i,s){if(!l.isBuffer( r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e< s)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError( "Index out of range")}a(H,"checkInt");l.prototype.writeUintLE=l.prototype.writeUIntLE= a(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;H(this,e, t,n,u,0)}let s=1,o=0;for(this[t]=e&255;++o<n&&(s*=256);)this[t+o]=e/s&255;return t+ n},"writeUIntLE");l.prototype.writeUintBE=l.prototype.writeUIntBE=a(function(e,t,n,i){ if(e=+e,t=t>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;H(this,e,t,n,u,0)}let s=n-1, o=1;for(this[t+s]=e&255;--s>=0&&(o*=256);)this[t+s]=e/o&255;return t+n},"writeUI\ ntBE");l.prototype.writeUint8=l.prototype.writeUInt8=a(function(e,t,n){return e= +e,t=t>>>0,n||H(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");l.prototype.writeUint16LE= l.prototype.writeUInt16LE=a(function(e,t,n){return e=+e,t=t>>>0,n||H(this,e,t,2, 65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeUInt16LE");l.prototype.writeUint16BE= l.prototype.writeUInt16BE=a(function(e,t,n){return e=+e,t=t>>>0,n||H(this,e,t,2, 65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");l.prototype.writeUint32LE= l.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||H(this,e,t,4, 4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+ 4},"writeUInt32LE");l.prototype.writeUint32BE=l.prototype.writeUInt32BE=a(function(e,t,n){ return e=+e,t=t>>>0,n||H(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16, this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeUInt32BE");function On(r,e,t,n,i){jn( e,n,i,r,t,7);let s=Number(e&BigInt(4294967295));r[t++]=s,s=s>>8,r[t++]=s,s=s>>8, r[t++]=s,s=s>>8,r[t++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]= o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,t}a(On,"wrtBigUInt64LE");function qn(r,e,t,n,i){ jn(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295));r[t+7]=s,s=s>>8,r[t+6]=s,s=s>> 8,r[t+5]=s,s=s>>8,r[t+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+ 3]=o,o=o>>8,r[t+2]=o,o=o>>8,r[t+1]=o,o=o>>8,r[t]=o,t+8}a(qn,"wrtBigUInt64BE");l. prototype.writeBigUInt64LE=de(a(function(e,t=0){return On(this,e,t,BigInt(0),BigInt( "0xffffffffffffffff"))},"writeBigUInt64LE"));l.prototype.writeBigUInt64BE=de(a(function(e,t=0){ return qn(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE")); l.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2, 8*n-1);H(this,e,t,n,c-1,-c)}let s=0,o=1,u=0;for(this[t]=e&255;++s<n&&(o*=256);)e< 0&&u===0&&this[t+s-1]!==0&&(u=1),this[t+s]=(e/o>>0)-u&255;return t+n},"writeIntL\ E");l.prototype.writeIntBE=a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow( 2,8*n-1);H(this,e,t,n,c-1,-c)}let s=n-1,o=1,u=0;for(this[t+s]=e&255;--s>=0&&(o*= 256);)e<0&&u===0&&this[t+s+1]!==0&&(u=1),this[t+s]=(e/o>>0)-u&255;return t+n},"w\ riteIntBE");l.prototype.writeInt8=a(function(e,t,n){return e=+e,t=t>>>0,n||H(this, e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");l.prototype.writeInt16LE= a(function(e,t,n){return e=+e,t=t>>>0,n||H(this,e,t,2,32767,-32768),this[t]=e&255, this[t+1]=e>>>8,t+2},"writeInt16LE");l.prototype.writeInt16BE=a(function(e,t,n){ return e=+e,t=t>>>0,n||H(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255, t+2},"writeInt16BE");l.prototype.writeInt32LE=a(function(e,t,n){return e=+e,t=t>>> 0,n||H(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]= e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE");l.prototype.writeInt32BE=a(function(e,t,n){ return e=+e,t=t>>>0,n||H(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+ 1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeIn\ t32BE");l.prototype.writeBigInt64LE=de(a(function(e,t=0){return On(this,e,t,-BigInt( "0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));l.prototype. writeBigInt64BE=de(a(function(e,t=0){return qn(this,e,t,-BigInt("0x8000000000000\ 000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Nn(r,e,t,n,i,s){ if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError( "Index out of range")}a(Nn,"checkIEEE754");function Qn(r,e,t,n,i){return e=+e,t= t>>>0,i||Nn(r,e,t,4,34028234663852886e22,-34028234663852886e22),Ae.write(r,e,t,n, 23,4),t+4}a(Qn,"writeFloat");l.prototype.writeFloatLE=a(function(e,t,n){return Qn( this,e,t,!0,n)},"writeFloatLE");l.prototype.writeFloatBE=a(function(e,t,n){return Qn( this,e,t,!1,n)},"writeFloatBE");function Wn(r,e,t,n,i){return e=+e,t=t>>>0,i||Nn( r,e,t,8,17976931348623157e292,-17976931348623157e292),Ae.write(r,e,t,n,52,8),t+8} a(Wn,"writeDouble");l.prototype.writeDoubleLE=a(function(e,t,n){return Wn(this,e, t,!0,n)},"writeDoubleLE");l.prototype.writeDoubleBE=a(function(e,t,n){return Wn( this,e,t,!1,n)},"writeDoubleBE");l.prototype.copy=a(function(e,t,n,i){if(!l.isBuffer( e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i= this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||e.length=== 0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of boun\ ds");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),e.length-t<i-n&&(i=e.length- t+n);let s=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="functio\ n"?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),t), s},"copy");l.prototype.fill=a(function(e,t,n,i){if(typeof e=="string"){if(typeof t== "string"?(i=t,t=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"&&!l.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length=== 1){let o=e.charCodeAt(0);(i==="utf8"&&o<128||i==="latin1")&&(e=o)}}else typeof e== "number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this. length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0, n=n===void 0?this.length:n>>>0,e||(e=0);let s;if(typeof e=="number")for(s=t;s<n;++s) this[s]=e;else{let o=l.isBuffer(e)?e:l.from(e,i),u=o.length;if(u===0)throw new TypeError( 'The value "'+e+'" is invalid for argument "value"');for(s=0;s<n-t;++s)this[s+t]= o[s%u]}return this},"fill");var _e={};function Dt(r,e,t){var n;_e[r]=(n=class extends t{constructor(){ super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0, configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){ return r}set code(s){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0, value:s,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}, a(n,"NodeError"),n)}a(Dt,"E");Dt("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r? `${r} is outside of buffer bounds`:"Attempt to access memory outside buffer boun\ ds"},RangeError);Dt("ERR_INVALID_ARG_TYPE",function(r,e){return`The "${r}" argum\ ent must be of type number. Received type ${typeof e}`},TypeError);Dt("ERR_OUT_O\ F_RANGE",function(r,e,t){let n=`The value of "${r}" is out of range.`,i=t;return Number. isInteger(t)&&Math.abs(t)>2**32?i=Rn(String(t)):typeof t=="bigint"&&(i=String(t), (t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Rn(i)),i+="n"),n+=` It\ must be ${e}. Received ${i}`,n},RangeError);function Rn(r){let e="",t=r.length, n=r[0]==="-"?1:0;for(;t>=n+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0, t)}${e}`}a(Rn,"addNumericalSeparator");function Po(r,e,t){Ce(e,"offset"),(r[e]=== void 0||r[e+t]===void 0)&&Ne(e,r.length-(t+1))}a(Po,"checkBounds");function jn(r,e,t,n,i,s){ if(r>t||r<e){let o=typeof e=="bigint"?"n":"",u;throw s>3?e===0||e===BigInt(0)?u= `>= 0${o} and < 2${o} ** ${(s+1)*8}${o}`:u=`>= -(2${o} ** ${(s+1)*8-1}${o}) and \ < 2 ** ${(s+1)*8-1}${o}`:u=`>= ${e}${o} and <= ${t}${o}`,new _e.ERR_OUT_OF_RANGE( "value",u,r)}Po(n,i,s)}a(jn,"checkIntBI");function Ce(r,e){if(typeof r!="number") throw new _e.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Ce,"validateNumber");function Ne(r,e,t){ throw Math.floor(r)!==r?(Ce(r,t),new _e.ERR_OUT_OF_RANGE(t||"offset","an integer", r)):e<0?new _e.ERR_BUFFER_OUT_OF_BOUNDS:new _e.ERR_OUT_OF_RANGE(t||"offset",`>= ${t? 1:0} and <= ${e}`,r)}a(Ne,"boundsError");var Bo=/[^+/0-9A-Za-z-_]/g;function Lo(r){ if(r=r.split("=")[0],r=r.trim().replace(Bo,""),r.length<2)return"";for(;r.length% 4!==0;)r=r+"=";return r}a(Lo,"base64clean");function Rt(r,e){e=e||1/0;let t,n=r. length,i=null,s=[];for(let o=0;o<n;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!i){ if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&& s.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191, 189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191, 189);if(i=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break; s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>> 6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63| 128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}a( Rt,"utf8ToBytes");function Ro(r){let e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt( t)&255);return e}a(Ro,"asciiToBytes");function Fo(r,e){let t,n,i,s=[];for(let o=0;o< r.length&&!((e-=2)<0);++o)t=r.charCodeAt(o),n=t>>8,i=t%256,s.push(i),s.push(n);return s} a(Fo,"utf16leToBytes");function Hn(r){return Pt.toByteArray(Lo(r))}a(Hn,"base64T\ oBytes");function it(r,e,t,n){let i;for(i=0;i<n&&!(i+t>=e.length||i>=r.length);++i) e[i+t]=r[i];return i}a(it,"blitBuffer");function ae(r,e){return r instanceof e|| r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name} a(ae,"isInstance");function kt(r){return r!==r}a(kt,"numberIsNaN");var Mo=function(){ let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let i=0;i< 16;++i)e[n+i]=r[t]+r[i]}return e}();function de(r){return typeof BigInt>"u"?Do:r} a(de,"defineBigIntMethod");function Do(){throw new Error("BigInt not supported")} a(Do,"BufferBigIntNotDefined")});var w,b,E,g,d,y,p=W(()=>{"use strict";w=globalThis,b=globalThis.setImmediate??(r=>setTimeout( r,0)),E=globalThis.clearImmediate??(r=>clearTimeout(r)),g=globalThis.crypto??{}; g.subtle??(g.subtle={});d=typeof globalThis.Buffer=="function"&&typeof globalThis. Buffer.allocUnsafe=="function"?globalThis.Buffer:Gn().Buffer,y=globalThis.process?? {};y.env??(y.env={});try{y.nextTick(()=>{})}catch{let e=Promise.resolve();y.nextTick= e.then.bind(e)}});var $n={};Y($n,{parse:()=>Ut});function Ut(r,e=!1){let{protocol:t}=new URL(r),n="\ http:"+r.substring(t.length),{username:i,password:s,host:o,hostname:u,port:c,pathname:h, search:f,searchParams:m,hash:x}=new URL(n);s=decodeURIComponent(s);let A=i+":"+s, P=e?Object.fromEntries(m.entries()):f;return{href:r,protocol:t,auth:A,username:i, password:s,host:o,hostname:u,port:c,pathname:h,search:f,query:P,hash:x}}var Ot=W( ()=>{"use strict";p();a(Ut,"parse")});var ye=I((Jc,qt)=>{"use strict";p();var Te=typeof Reflect=="object"?Reflect:null, Kn=Te&&typeof Te.apply=="function"?Te.apply:a(function(e,t,n){return Function.prototype. apply.call(e,t,n)},"ReflectApply"),st;Te&&typeof Te.ownKeys=="function"?st=Te.ownKeys: Object.getOwnPropertySymbols?st=a(function(e){return Object.getOwnPropertyNames( e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):st=a(function(e){return Object. getOwnPropertyNames(e)},"ReflectOwnKeys");function ko(r){console&&console.warn&& console.warn(r)}a(ko,"ProcessEmitWarning");var zn=Number.isNaN||a(function(e){return e!== e},"NumberIsNaN");function L(){L.init.call(this)}a(L,"EventEmitter");qt.exports= L;qt.exports.once=No;L.EventEmitter=L;L.prototype._events=void 0;L.prototype._eventsCount= 0;L.prototype._maxListeners=void 0;var Vn=10;function ot(r){if(typeof r!="functi\ on")throw new TypeError('The "listener" argument must be of type Function. Recei\ ved type '+typeof r)}a(ot,"checkListener");Object.defineProperty(L,"defaultMaxLi\ steners",{enumerable:!0,get:function(){return Vn},set:function(r){if(typeof r!="\ number"||r<0||zn(r))throw new RangeError('The value of "defaultMaxListeners" is \ out of range. It must be a non-negative number. Received '+r+".");Vn=r}});L.init= function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&& (this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners|| void 0};L.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||zn( e))throw new RangeError('The value of "n" is out of range. It must be a non-nega\ tive number. Received '+e+".");return this._maxListeners=e,this},"setMaxListener\ s");function Yn(r){return r._maxListeners===void 0?L.defaultMaxListeners:r._maxListeners} a(Yn,"_getMaxListeners");L.prototype.getMaxListeners=a(function(){return Yn(this)}, "getMaxListeners");L.prototype.emit=a(function(e){for(var t=[],n=1;n<arguments.length;n++) t.push(arguments[n]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error=== void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error) throw o;var u=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw u.context= o,u}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")Kn(c,this,t);else for(var h=c. length,f=ti(c,h),n=0;n<h;++n)Kn(f[n],this,t);return!0},"emit");function Zn(r,e,t,n){ var i,s,o;if(ot(t),s=r._events,s===void 0?(s=r._events=Object.create(null),r._eventsCount= 0):(s.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),s=r. _events),o=s[e]),o===void 0)o=s[e]=t,++r._eventsCount;else if(typeof o=="functio\ n"?o=s[e]=n?[t,o]:[o,t]:n?o.unshift(t):o.push(t),i=Yn(r),i>0&&o.length>i&&!o.warned){ o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+ " "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit"); u.name="MaxListenersExceededWarning",u.emitter=r,u.type=e,u.count=o.length,ko(u)} return r}a(Zn,"_addListener");L.prototype.addListener=a(function(e,t){return Zn( this,e,t,!1)},"addListener");L.prototype.on=L.prototype.addListener;L.prototype. prependListener=a(function(e,t){return Zn(this,e,t,!0)},"prependListener");function Uo(){ if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired= !0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this. target,arguments)}a(Uo,"onceWrapper");function Jn(r,e,t){var n={fired:!1,wrapFn:void 0, target:r,type:e,listener:t},i=Uo.bind(n);return i.listener=t,n.wrapFn=i,i}a(Jn,"\ _onceWrap");L.prototype.once=a(function(e,t){return ot(t),this.on(e,Jn(this,e,t)), this},"once");L.prototype.prependOnceListener=a(function(e,t){return ot(t),this. prependListener(e,Jn(this,e,t)),this},"prependOnceListener");L.prototype.removeListener= a(function(e,t){var n,i,s,o,u;if(ot(t),i=this._events,i===void 0)return this;if(n= i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this. _events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeList\ ener",e,n.listener||t));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--) if(n[o]===t||n[o].listener===t){u=n[o].listener,s=o;break}if(s<0)return this;s=== 0?n.shift():Oo(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit( "removeListener",e,u||t)}return this},"removeListener");L.prototype.off=L.prototype. removeListener;L.prototype.removeAllListeners=a(function(e){var t,n,i;if(n=this. _events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length=== 0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this. _eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments. length===0){var s=Object.keys(n),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeList\ ener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"), this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="f\ unction")this.removeListener(e,t);else if(t!==void 0)for(i=t.length-1;i>=0;i--)this. removeListener(e,t[i]);return this},"removeAllListeners");function Xn(r,e,t){var n=r. _events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="functi\ on"?t?[i.listener||i]:[i]:t?qo(i):ti(i,i.length)}a(Xn,"_listeners");L.prototype. listeners=a(function(e){return Xn(this,e,!0)},"listeners");L.prototype.rawListeners= a(function(e){return Xn(this,e,!1)},"rawListeners");L.listenerCount=function(r,e){ return typeof r.listenerCount=="function"?r.listenerCount(e):ei.call(r,e)};L.prototype. listenerCount=ei;function ei(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t== "function")return 1;if(t!==void 0)return t.length}return 0}a(ei,"listenerCount"); L.prototype.eventNames=a(function(){return this._eventsCount>0?st(this._events): []},"eventNames");function ti(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n]; return t}a(ti,"arrayClone");function Oo(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r. pop()}a(Oo,"spliceOne");function qo(r){for(var e=new Array(r.length),t=0;t<e.length;++t) e[t]=r[t].listener||r[t];return e}a(qo,"unwrapListeners");function No(r,e){return new Promise( function(t,n){function i(o){r.removeListener(e,s),n(o)}a(i,"errorListener");function s(){ typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call( arguments))}a(s,"resolver"),ri(r,e,s,{once:!0}),e!=="error"&&Qo(r,i,{once:!0})})} a(No,"once");function Qo(r,e,t){typeof r.on=="function"&&ri(r,"error",e,t)}a(Qo, "addErrorHandlerIfEventEmitter");function ri(r,e,t,n){if(typeof r.on=="function") n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener( e,a(function i(s){n.once&&r.removeEventListener(e,i),t(s)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Receiv\ ed type '+typeof r)}a(ri,"eventTargetAgnosticAddListener")});var ii={};Y(ii,{Socket:()=>me,isIP:()=>Wo});function Wo(r){return 0}var ni,S,me, at=W(()=>{"use strict";p();ni=qe(ye(),1);a(Wo,"isIP");S=class S extends ni.EventEmitter{constructor(){ super(...arguments);T(this,"opts",{});T(this,"connecting",!1);T(this,"pending",!0); T(this,"writable",!0);T(this,"encrypted",!1);T(this,"authorized",!1);T(this,"des\ troyed",!1);T(this,"ws",null);T(this,"writeBuffer");T(this,"tlsState",0);T(this, "tlsRead");T(this,"tlsWrite")}static get poolQueryViaFetch(){return S.opts.poolQueryViaFetch?? S.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){S.opts.poolQueryViaFetch= t}static get fetchEndpoint(){return S.opts.fetchEndpoint??S.defaults.fetchEndpoint}static set fetchEndpoint(t){ S.opts.fetchEndpoint=t}static get fetchConnectionCache(){return S.opts.fetchConnectionCache?? S.defaults.fetchConnectionCache}static set fetchConnectionCache(t){S.opts.fetchConnectionCache= t}static get fetchFunction(){return S.opts.fetchFunction??S.defaults.fetchFunction}static set fetchFunction(t){ S.opts.fetchFunction=t}static get webSocketConstructor(){return S.opts.webSocketConstructor?? S.defaults.webSocketConstructor}static set webSocketConstructor(t){S.opts.webSocketConstructor= t}get webSocketConstructor(){return this.opts.webSocketConstructor??S.webSocketConstructor}set webSocketConstructor(t){ this.opts.webSocketConstructor=t}static get wsProxy(){return S.opts.wsProxy??S.defaults. wsProxy}static set wsProxy(t){S.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy?? S.wsProxy}set wsProxy(t){this.opts.wsProxy=t}static get coalesceWrites(){return S. opts.coalesceWrites??S.defaults.coalesceWrites}static set coalesceWrites(t){S.opts. coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??S.coalesceWrites}set coalesceWrites(t){ this.opts.coalesceWrites=t}static get useSecureWebSocket(){return S.opts.useSecureWebSocket?? S.defaults.useSecureWebSocket}static set useSecureWebSocket(t){S.opts.useSecureWebSocket= t}get useSecureWebSocket(){return this.opts.useSecureWebSocket??S.useSecureWebSocket}set useSecureWebSocket(t){ this.opts.useSecureWebSocket=t}static get forceDisablePgSSL(){return S.opts.forceDisablePgSSL?? S.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){S.opts.forceDisablePgSSL= t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??S.forceDisablePgSSL}set forceDisablePgSSL(t){ this.opts.forceDisablePgSSL=t}static get disableSNI(){return S.opts.disableSNI?? S.defaults.disableSNI}static set disableSNI(t){S.opts.disableSNI=t}get disableSNI(){ return this.opts.disableSNI??S.disableSNI}set disableSNI(t){this.opts.disableSNI= t}static get pipelineConnect(){return S.opts.pipelineConnect??S.defaults.pipelineConnect}static set pipelineConnect(t){ S.opts.pipelineConnect=t}get pipelineConnect(){return this.opts.pipelineConnect?? S.pipelineConnect}set pipelineConnect(t){this.opts.pipelineConnect=t}static get subtls(){ return S.opts.subtls??S.defaults.subtls}static set subtls(t){S.opts.subtls=t}get subtls(){ return this.opts.subtls??S.subtls}set subtls(t){this.opts.subtls=t}static get pipelineTLS(){ return S.opts.pipelineTLS??S.defaults.pipelineTLS}static set pipelineTLS(t){S.opts. pipelineTLS=t}get pipelineTLS(){return this.opts.pipelineTLS??S.pipelineTLS}set pipelineTLS(t){ this.opts.pipelineTLS=t}static get rootCerts(){return S.opts.rootCerts??S.defaults. rootCerts}static set rootCerts(t){S.opts.rootCerts=t}get rootCerts(){return this. opts.rootCerts??S.rootCerts}set rootCerts(t){this.opts.rootCerts=t}wsProxyAddrForHost(t,n){ let i=this.wsProxy;if(i===void 0)throw new Error("No WebSocket proxy is configur\ ed. Please refer to https://github.com/neondatabase/serverless#run-your-own-webs\ ocket-proxy");return typeof i=="function"?i(t,n):`${i}?address=${t}:${n}`}setNoDelay(){ return this}setKeepAlive(){return this}ref(){return this}unref(){return this}async connect(t,n,i){ this.connecting=!0,i&&this.once("connect",i);let s;try{s=this.wsProxyAddrForHost( n,typeof t=="string"?parseInt(t,10):t)}catch(o){this.emit("error",o),this.emit("\ close");return}return this.ws=await new Promise(async o=>{try{let c=(this.useSecureWebSocket? "wss:":"ws:")+"//"+s,h;if(this.webSocketConstructor!==void 0)h=new this.webSocketConstructor( c);else try{h=new WebSocket(c)}catch{h=new __unstable_WebSocket(c)}h.addEventListener( "open",()=>{o(h)})}catch(u){try{let h=(this.useSecureWebSocket?"https:":"http:")+ "//"+s;await fetch(h,{headers:{Upgrade:"websocket"}}).then(f=>{let m=f.webSocket; if(m==null)throw u;m.accept(),o(m)})}catch{this.emit("error",new Error("All atte\ mpts to open a WebSocket to connect to the database failed. Please refer to http\ s://github.com/neondatabase/serverless#run-on-node")),this.emit("close");return}}}), this.ws.binaryType="arraybuffer",this.ws.addEventListener("error",o=>{this.emit( "error",o),this.emit("close")}),this.ws.addEventListener("close",()=>{this.emit( "close")}),this.ws.addEventListener("message",o=>{if(this.tlsState===0){let u=d. from(o.data);this.emit("data",u)}}),this.connecting=!1,this.pending=!1,this.emit( "connect"),this.emit("ready"),this}async startTls(t){if(this.subtls===void 0)throw new Error( "For Postgres SSL connections, you must set `neonConfig.subtls` to the subtls li\ brary. See https://github.com/neondatabase/serverless/blob/main/CONFIG.md for mo\ re information.");this.tlsState=1;let n=this.subtls.TrustedCert.fromPEM(this.rootCerts), i=new this.subtls.WebSocketReadQueue(this.ws),s=i.read.bind(i),o=this.rawWrite.bind( this),[u,c]=await this.subtls.startTls(t,n,s,o,{useSNI:!this.disableSNI,expectPreData:this. pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead=u,this.tlsWrite=c,this.tlsState= 2,this.encrypted=!0,this.authorized=!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){ for(;;){let t=await this.tlsRead();if(t===void 0)break;{let n=d.from(t);this.emit( "data",n)}}}rawWrite(t){if(!this.coalesceWrites){this.ws.send(t);return}if(this. writeBuffer===void 0)this.writeBuffer=t,setTimeout(()=>{this.ws.send(this.writeBuffer), this.writeBuffer=void 0},0);else{let n=new Uint8Array(this.writeBuffer.length+t. length);n.set(this.writeBuffer),n.set(t,this.writeBuffer.length),this.writeBuffer= n}}write(t,n="utf8",i=s=>{}){return t.length===0?i():(typeof t=="string"&&(t=d.from( t,n)),this.tlsState===0?this.rawWrite(t):this.tlsState===1?this.once("secureConn\ ection",()=>this.write(t,n,i)):this.tlsWrite(t),!0)}end(t=d.alloc(0),n="utf8",i){ return this.write(t,n,()=>{this.ws.close(),i&&i()}),this}destroy(){return this.destroyed= !0,this.end()}};a(S,"Socket"),T(S,"defaults",{poolQueryViaFetch:!1,fetchEndpoint:t=>"\ https://"+t+"/sql",fetchConnectionCache:!1,fetchFunction:void 0,webSocketConstructor:void 0, wsProxy:t=>t+"/v2",useSecureWebSocket:!0,forceDisablePgSSL:!0,coalesceWrites:!0, pipelineConnect:"password",subtls:void 0,rootCerts:"",pipelineTLS:!1,disableSNI:!1}), T(S,"opts",{});me=S});function Qe(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119, o=2600822924,u=528734635,c=1541459225,h=0,f=0,m=[1116352408,1899447441,3049323471, 3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278, 1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078, 604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808, 3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372, 1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800, 3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556, 883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452, 2361852424,2428436474,2756734187,3204031479,3329325298],x=a((B,_)=>B>>>_|B<<32-_, "rrot"),A=new Uint32Array(64),P=new Uint8Array(64),D=a(()=>{for(let v=0,k=0;v<16;v++, k+=4)A[v]=P[k]<<24|P[k+1]<<16|P[k+2]<<8|P[k+3];for(let v=16;v<64;v++){let k=x(A[v- 15],7)^x(A[v-15],18)^A[v-15]>>>3,se=x(A[v-2],17)^x(A[v-2],19)^A[v-2]>>>10;A[v]=A[v- 16]+k+A[v-7]+se|0}let B=e,_=t,te=n,be=i,Z=s,fe=o,re=u,z=c;for(let v=0;v<64;v++){ let k=x(Z,6)^x(Z,11)^x(Z,25),se=Z&fe^~Z&re,ne=z+k+se+m[v]+A[v]|0,ie=x(B,2)^x(B,13)^ x(B,22),ce=B&_^B&te^_&te,pe=ie+ce|0;z=re,re=fe,fe=Z,Z=be+ne|0,be=te,te=_,_=B,B=ne+ pe|0}e=e+B|0,t=t+_|0,n=n+te|0,i=i+be|0,s=s+Z|0,o=o+fe|0,u=u+re|0,c=c+z|0,f=0},"p\ rocess"),V=a(B=>{typeof B=="string"&&(B=new TextEncoder().encode(B));for(let _=0;_< B.length;_++)P[f++]=B[_],f===64&&D();h+=B.length},"add"),ue=a(()=>{if(P[f++]=128, f==64&&D(),f+8>64){for(;f<64;)P[f++]=0;D()}for(;f<58;)P[f++]=0;let B=h*8;P[f++]= B/1099511627776&255,P[f++]=B/4294967296&255,P[f++]=B>>>24,P[f++]=B>>>16&255,P[f++]= B>>>8&255,P[f++]=B&255,D();let _=new Uint8Array(32);return _[0]=e>>>24,_[1]=e>>> 16&255,_[2]=e>>>8&255,_[3]=e&255,_[4]=t>>>24,_[5]=t>>>16&255,_[6]=t>>>8&255,_[7]= t&255,_[8]=n>>>24,_[9]=n>>>16&255,_[10]=n>>>8&255,_[11]=n&255,_[12]=i>>>24,_[13]= i>>>16&255,_[14]=i>>>8&255,_[15]=i&255,_[16]=s>>>24,_[17]=s>>>16&255,_[18]=s>>>8& 255,_[19]=s&255,_[20]=o>>>24,_[21]=o>>>16&255,_[22]=o>>>8&255,_[23]=o&255,_[24]= u>>>24,_[25]=u>>>16&255,_[26]=u>>>8&255,_[27]=u&255,_[28]=c>>>24,_[29]=c>>>16&255, _[30]=c>>>8&255,_[31]=c&255,_},"digest");return r===void 0?{add:V,digest:ue}:(V( r),ue())}var si=W(()=>{"use strict";p();a(Qe,"sha256")});var O,We,oi=W(()=>{"use strict";p();O=class O{constructor(){T(this,"_dataLength", 0);T(this,"_bufferLength",0);T(this,"_state",new Int32Array(4));T(this,"_buffer", new ArrayBuffer(68));T(this,"_buffer8");T(this,"_buffer32");this._buffer8=new Uint8Array( this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashByteArray(e,t=!1){ return this.onePassHasher.start().appendByteArray(e).end(t)}static hashStr(e,t=!1){ return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){ return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){let t=O. hexChars,n=O.hexOut,i,s,o,u;for(u=0;u<4;u+=1)for(s=u*8,i=e[u],o=0;o<8;o+=2)n[s+1+ o]=t.charAt(i&15),i>>>=4,n[s+0+o]=t.charAt(i&15),i>>>=4;return n.join("")}static _md5cycle(e,t){ let n=e[0],i=e[1],s=e[2],o=e[3];n+=(i&s|~i&o)+t[0]-680876936|0,n=(n<<7|n>>>25)+i| 0,o+=(n&i|~n&s)+t[1]-389564586|0,o=(o<<12|o>>>20)+n|0,s+=(o&n|~o&i)+t[2]+606105819| 0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&n)+t[3]-1044525330|0,i=(i<<22|i>>>10)+s|0,n+=(i& s|~i&o)+t[4]-176418897|0,n=(n<<7|n>>>25)+i|0,o+=(n&i|~n&s)+t[5]+1200080426|0,o=(o<< 12|o>>>20)+n|0,s+=(o&n|~o&i)+t[6]-1473231341|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&n)+ t[7]-45705983|0,i=(i<<22|i>>>10)+s|0,n+=(i&s|~i&o)+t[8]+1770035416|0,n=(n<<7|n>>> 25)+i|0,o+=(n&i|~n&s)+t[9]-1958414417|0,o=(o<<12|o>>>20)+n|0,s+=(o&n|~o&i)+t[10]- 42063|0,s=(s<<17|s>>>15)+o|0,i+=(s&o|~s&n)+t[11]-1990404162|0,i=(i<<22|i>>>10)+s| 0,n+=(i&s|~i&o)+t[12]+1804603682|0,n=(n<<7|n>>>25)+i|0,o+=(n&i|~n&s)+t[13]-40341101| 0,o=(o<<12|o>>>20)+n|0,s+=(o&n|~o&i)+t[14]-1502002290|0,s=(s<<17|s>>>15)+