diff --git a/build.sh b/build.sh index 4257275..0711527 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -e +PACKAGE_VERSION=$(node -p "require('./package.json').version") + # if nothing modified, stop (`touch src` to force build) find src -newer index.js | read || exit 0 @@ -20,6 +22,7 @@ npx esbuild src/index.ts \ --keep-names \ --inject:src/shims/shims.js \ --define:BUNDLE_EXT=\"js\" \ + --define:PACKAGE_VERSION=\"$PACKAGE_VERSION\" \ --target=es2020 \ --outfile=index.js \ $DEBUG_ARG $MINIFY_ARG @@ -32,6 +35,7 @@ npx esbuild src/index.ts \ --keep-names \ --inject:src/shims/shims.js \ --define:BUNDLE_EXT=\"mjs\" \ + --define:PACKAGE_VERSION=\"$PACKAGE_VERSION\" \ --target=es2020 \ --banner:js='/* @ts-self-types="./index.d.mts" */' \ --outfile=index.mjs \ diff --git a/index.js b/index.js index 650ab34..05bec5d 100644 --- a/index.js +++ b/index.js @@ -1,71 +1,71 @@ -"use strict";var So=Object.create;var Te=Object.defineProperty;var Eo=Object.getOwnPropertyDescriptor;var Ao=Object.getOwnPropertyNames;var Co=Object.getPrototypeOf,_o=Object.prototype.hasOwnProperty;var Io=(r,e,t)=>e in r?Te(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>Te(r,"name",{value:e,configurable:!0});var G=(r,e)=>()=>(r&&(e=r(r=0)),e);var T=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),te=(r,e)=>{for(var t in e)Te(r,t,{get:e[t], -enumerable:!0})},On=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ao(e))!_o. -call(r,i)&&i!==t&&Te(r,i,{get:()=>e[i],enumerable:!(n=Eo(e,i))||n.enumerable});return r};var Ae=(r,e,t)=>(t=r!=null?So(Co(r)):{},On(e||!r||!r.__esModule?Te(t,"default",{value:r,enumerable:!0}): -t,r)),O=r=>On(Te({},"__esModule",{value:!0}),r);var E=(r,e,t)=>Io(r,typeof e!="symbol"?e+"":e,t);var Nn=T(ft=>{"use strict";p();ft.byteLength=Po;ft.toByteArray=Bo;ft.fromByteArray=ko;var ue=[],re=[], -To=typeof Uint8Array<"u"?Uint8Array:Array,Qt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ -23456789+/";for(Ce=0,qn=Qt.length;Ce0)throw new Error("Invalid string. Length 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(Qn,"getLens"); -function Po(r){var e=Qn(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Po,"byteLength");function Ro(r,e,t){return(e+ -t)*3/4-t}a(Ro,"_byteLength");function Bo(r){var e,t=Qn(r),n=t[0],i=t[1],s=new To(Ro(r,n,i)),o=0,u=i> +"use strict";var Eo=Object.create;var Te=Object.defineProperty;var Ao=Object.getOwnPropertyDescriptor;var Co=Object.getOwnPropertyNames;var _o=Object.getPrototypeOf,Io=Object.prototype.hasOwnProperty;var To=(r,e,t)=>e in r?Te(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>Te(r,"name",{value:e,configurable:!0});var $=(r,e)=>()=>(r&&(e=r(r=0)),e);var T=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),te=(r,e)=>{for(var t in e)Te(r,t,{get:e[t], +enumerable:!0})},qn=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Co(e))!Io. +call(r,i)&&i!==t&&Te(r,i,{get:()=>e[i],enumerable:!(n=Ao(e,i))||n.enumerable});return r};var Ae=(r,e,t)=>(t=r!=null?Eo(_o(r)):{},qn(e||!r||!r.__esModule?Te(t,"default",{value:r,enumerable:!0}): +t,r)),O=r=>qn(Te({},"__esModule",{value:!0}),r);var E=(r,e,t)=>To(r,typeof e!="symbol"?e+"":e,t);var Wn=T(ht=>{"use strict";p();ht.byteLength=Ro;ht.toByteArray=Lo;ht.fromByteArray=Mo;var ue=[],re=[], +Po=typeof Uint8Array<"u"?Uint8Array:Array,Nt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ +23456789+/";for(Ce=0,Qn=Nt.length;Ce0)throw new Error("Invalid string. Length 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(Nn,"getLens"); +function Ro(r){var e=Nn(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Ro,"byteLength");function Bo(r,e,t){return(e+ +t)*3/4-t}a(Bo,"_byteLength");function Lo(r){var e,t=Nn(r),n=t[0],i=t[1],s=new Po(Bo(r,n,i)),o=0,u=i> 0?n-4:n,c;for(c=0;c>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=re[r.charCodeAt( c)]<<2|re[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=re[r.charCodeAt(c)]<<10|re[r.charCodeAt(c+1)]<< -4|re[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(Bo,"toByteArray");function Lo(r){return ue[r>> -18&63]+ue[r>>12&63]+ue[r>>6&63]+ue[r&63]}a(Lo,"tripletToBase64");function Fo(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(Lo(n));return i.join("")}a(Fo,"en\ -codeChunk");function ko(r){for(var e,t=r.length,n=t%3,i=[],s=16383,o=0,u=t-n;o>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(Lo,"toByteArray");function Fo(r){return ue[r>> +18&63]+ue[r>>12&63]+ue[r>>6&63]+ue[r&63]}a(Fo,"tripletToBase64");function ko(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(Fo(n));return i.join("")}a(ko,"en\ +codeChunk");function Mo(r){for(var e,t=r.length,n=t%3,i=[],s=16383,o=0,u=t-n;ou?u:o+s));return n===1?(e=r[t-1],i.push(ue[e>>2]+ue[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1], -i.push(ue[e>>10]+ue[e>>4&63]+ue[e<<2&63]+"=")),i.join("")}a(ko,"fromByteArray")});var Wn=T(Nt=>{p();Nt.read=function(r,e,t,n,i){var s,o,u=i*8-n-1,c=(1<>1,f=-7,y=t?i-1:0,g=t? +i.push(ue[e>>10]+ue[e>>4&63]+ue[e<<2&63]+"=")),i.join("")}a(Mo,"fromByteArray")});var jn=T(Wt=>{p();Wt.read=function(r,e,t,n,i){var s,o,u=i*8-n-1,c=(1<>1,f=-7,y=t?i-1:0,g=t? -1:1,A=r[e+y];for(y+=g,s=A&(1<<-f)-1,A>>=-f,f+=u;f>0;s=s*256+r[e+y],y+=g,f-=8);for(o=s&(1<<-f)-1,s>>= -f,f+=n;f>0;o=o*256+r[e+y],y+=g,f-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(A?-1:1)*(1/0);o=o+Math. -pow(2,n),s=s-l}return(A?-1:1)*o*Math.pow(2,s-n)};Nt.write=function(r,e,t,n,i,s){var o,u,c,l=s*8-i-1, +pow(2,n),s=s-l}return(A?-1:1)*o*Math.pow(2,s-n)};Wt.write=function(r,e,t,n,i,s){var o,u,c,l=s*8-i-1, f=(1<>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=n?0:s-1,C=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+y>=1?e+=g/c:e+=g*Math.pow(2,1-y),e*c>=2&&(o++,c/=2),o+y>=f?(u=0,o=f): o+y>=1?(u=(e*c-1)*Math.pow(2,i),o=o+y):(u=e*Math.pow(2,y-1)*Math.pow(2,i),o=0));i>=8;r[t+A]=u&255,A+= -C,u/=256,i-=8);for(o=o<0;r[t+A]=o&255,A+=C,o/=256,l-=8);r[t+A-C]|=D*128}});var si=T(Le=>{"use strict";p();var Wt=Nn(),Re=Wn(),jn=typeof Symbol=="function"&&typeof Symbol.for== -"function"?Symbol.for("nodejs.util.inspect.custom"):null;Le.Buffer=h;Le.SlowBuffer=Qo;Le.INSPECT_MAX_BYTES= -50;var ht=2147483647;Le.kMaxLength=ht;h.TYPED_ARRAY_SUPPORT=Mo();!h.TYPED_ARRAY_SUPPORT&&typeof console< +C,u/=256,i-=8);for(o=o<0;r[t+A]=o&255,A+=C,o/=256,l-=8);r[t+A-C]|=D*128}});var oi=T(Le=>{"use strict";p();var jt=Wn(),Re=jn(),Hn=typeof Symbol=="function"&&typeof Symbol.for== +"function"?Symbol.for("nodejs.util.inspect.custom"):null;Le.Buffer=h;Le.SlowBuffer=No;Le.INSPECT_MAX_BYTES= +50;var pt=2147483647;Le.kMaxLength=pt;h.TYPED_ARRAY_SUPPORT=Uo();!h.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 browser support.");function Mo(){ +pport which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Uo(){ try{let r=new Uint8Array(1),e={foo:a(function(){return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array. -prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}a(Mo,"typedArraySupport");Object. +prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}a(Uo,"typedArraySupport");Object. defineProperty(h.prototype,"parent",{enumerable:!0,get:a(function(){if(h.isBuffer(this))return this. buffer},"get")});Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:a(function(){if(h.isBuffer( -this))return this.byteOffset},"get")});function pe(r){if(r>ht)throw new RangeError('The value "'+r+'\ +this))return this.byteOffset},"get")});function pe(r){if(r>pt)throw new RangeError('The value "'+r+'\ " is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,h.prototype), e}a(pe,"createBuffer");function h(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 Gt(r)}return Vn(r,e,t)} -a(h,"Buffer");h.poolSize=8192;function Vn(r,e,t){if(typeof r=="string")return Do(r,e);if(ArrayBuffer. -isView(r))return Oo(r);if(r==null)throw new TypeError("The first argument must be one of type string\ +'The "string" argument must be of type string. Received type number');return Vt(r)}return Kn(r,e,t)} +a(h,"Buffer");h.poolSize=8192;function Kn(r,e,t){if(typeof r=="string")return Oo(r,e);if(ArrayBuffer. +isView(r))return qo(r);if(r==null)throw new TypeError("The first argument must be one of type string\ , Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(ce(r,ArrayBuffer)|| r&&ce(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ce(r,SharedArrayBuffer)||r&&ce(r.buffer, -SharedArrayBuffer)))return Ht(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument\ +SharedArrayBuffer)))return Gt(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument\ must not be of type number. Received type number');let n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return h. -from(n,e,t);let i=qo(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. +from(n,e,t);let i=Qo(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. toPrimitive]=="function")return h.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The\ first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Receiv\ -ed type "+typeof r)}a(Vn,"from");h.from=function(r,e,t){return Vn(r,e,t)};Object.setPrototypeOf(h.prototype, +ed type "+typeof r)}a(Kn,"from");h.from=function(r,e,t){return Kn(r,e,t)};Object.setPrototypeOf(h.prototype, Uint8Array.prototype);Object.setPrototypeOf(h,Uint8Array);function zn(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(zn,"assertSize");function Uo(r,e,t){return zn(r),r<=0?pe(r):e!==void 0?typeof t== -"string"?pe(r).fill(e,t):pe(r).fill(e):pe(r)}a(Uo,"alloc");h.alloc=function(r,e,t){return Uo(r,e,t)}; -function Gt(r){return zn(r),pe(r<0?0:Vt(r)|0)}a(Gt,"allocUnsafe");h.allocUnsafe=function(r){return Gt( -r)};h.allocUnsafeSlow=function(r){return Gt(r)};function Do(r,e){if((typeof e!="string"||e==="")&&(e= -"utf8"),!h.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=Kn(r,e)|0,n=pe(t),i=n.write( -r,e);return i!==t&&(n=n.slice(0,i)),n}a(Do,"fromString");function jt(r){let e=r.length<0?0:Vt(r.length)| -0,t=pe(e);for(let n=0;n=ht)throw new RangeError("Attempt to allocate Buffer larger t\ -han maximum size: 0x"+ht.toString(16)+" bytes");return r|0}a(Vt,"checked");function Qo(r){return+r!= -r&&(r=0),h.alloc(+r)}a(Qo,"SlowBuffer");h.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== +r,e,t),Object.setPrototypeOf(n,h.prototype),n}a(Gt,"fromArrayBuffer");function Qo(r){if(h.isBuffer(r)){ +let e=Kt(r.length)|0,t=pe(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r. +length!="number"||Yt(r.length)?pe(0):Ht(r);if(r.type==="Buffer"&&Array.isArray(r.data))return Ht(r.data)} +a(Qo,"fromObject");function Kt(r){if(r>=pt)throw new RangeError("Attempt to allocate Buffer larger t\ +han maximum size: 0x"+pt.toString(16)+" bytes");return r|0}a(Kt,"checked");function No(r){return+r!= +r&&(r=0),h.alloc(+r)}a(No,"SlowBuffer");h.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== h.prototype},"isBuffer");h.compare=a(function(e,t){if(ce(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)), ce(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),!h.isBuffer(e)||!h.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, @@ -77,18 +77,18 @@ utf-16le":return!0;default:return!1}},"isEncoding");h.concat=a(function(e,t){if( for(t=0,n=0;ni.length?(h.isBuffer(o)||(o=h.from(o)),o.copy(i,s)):Uint8Array.prototype. set.call(i,o,s);else if(h.isBuffer(o))o.copy(i,s);else throw new TypeError('"list" argument must be \ -an Array of Buffers');s+=o.length}return i},"concat");function Kn(r,e){if(h.isBuffer(r))return r.length; +an Array of Buffers');s+=o.length}return i},"concat");function Yn(r,e){if(h.isBuffer(r))return r.length; if(ArrayBuffer.isView(r)||ce(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 $t(r).length;case"ucs2":case"\ -ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return ii(r).length;default: -if(i)return n?-1:$t(r).length;e=(""+e).toLowerCase(),i=!0}}a(Kn,"byteLength");h.byteLength=Kn;function No(r,e,t){ +ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return si(r).length;default: +if(i)return n?-1:$t(r).length;e=(""+e).toLowerCase(),i=!0}}a(Yn,"byteLength");h.byteLength=Yn;function Wo(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 Zo(this,e,t);case"u\ -tf8":case"utf-8":return Zn(this,e,t);case"ascii":return Ko(this,e,t);case"latin1":case"binary":return Yo( -this,e,t);case"base64":return Vo(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Jo( -this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(No, +0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Jo(this,e,t);case"u\ +tf8":case"utf-8":return Jn(this,e,t);case"ascii":return Yo(this,e,t);case"latin1":case"binary":return Zo( +this,e,t);case"base64":return Ko(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xo( +this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(Wo, "slowToString");h.prototype._isBuffer=!0;function _e(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(_e,"swap"); h.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;tt&&(e+=" ... "),""},"inspect");jn&&(h.prototype[jn]=h.prototype.inspect);h.prototype.compare=a(function(e,t,n,i,s){ +er "+e+">"},"inspect");Hn&&(h.prototype[Hn]=h.prototype.inspect);h.prototype.compare=a(function(e,t,n,i,s){ if(ce(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(e))throw new TypeError('The "ta\ rget" argument must be one of type Buffer 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),l=this.slice( i,s),f=e.slice(t,n);for(let y=0;y2147483647? -t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Kt(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r. +compare");function Zn(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,Yt(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=h.from( -e,n)),h.isBuffer(e))return e.length===0?-1:Hn(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array. +e,n)),h.isBuffer(e))return e.length===0?-1:Gn(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):Hn(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Yn,"bidire\ -ctionalIndexOf");function Hn(r,e,t,n,i){let s=1,o=r.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(), +call(r,e,t):Gn(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Zn,"bidire\ +ctionalIndexOf");function Gn(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,y){return s===1?f[y]:f.readUInt16BE(y*s)}a(c,"read");let l;if(i){let f=-1;for(l= t;lo&&(t=o-u),l=t;l>=0;l--){let f=!0;for(let y=0;yi&&(n=i)):n=i;let s=e.length;n>s/2&&(n=s/2);let o;for(o= -0;o>>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 buf\ -fer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return Wo(this,e,t,n);case"utf8":case"\ -utf-8":return jo(this,e,t,n);case"ascii":case"latin1":case"binary":return Ho(this,e,t,n);case"base64": -return $o(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Go(this,e,t,n);default: +fer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return jo(this,e,t,n);case"utf8":case"\ +utf-8":return Ho(this,e,t,n);case"ascii":case"latin1":case"binary":return Go(this,e,t,n);case"base64": +return $o(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Vo(this,e,t,n);default: if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"write");h.prototype. toJSON=a(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSO\ -N");function Vo(r,e,t){return e===0&&t===r.length?Wt.fromByteArray(r):Wt.fromByteArray(r.slice(e,t))} -a(Vo,"base64Slice");function Zn(r,e,t){t=Math.min(r.length,t);let n=[],i=e;for(;i239?4:s>223?3:s>191?2:1;if(i+u<=t){let c,l,f,y;switch(u){case 1:s<128&&(o=s);break;case 2:c=r[i+ 1],(c&192)===128&&(y=(s&31)<<6|c&63,y>127&&(o=y));break;case 3:c=r[i+1],l=r[i+2],(c&192)===128&&(l&192)=== 128&&(y=(s&15)<<12|(c&63)<<6|l&63,y>2047&&(y<55296||y>57343)&&(o=y));break;case 4:c=r[i+1],l=r[i+2], f=r[i+3],(c&192)===128&&(l&192)===128&&(f&192)===128&&(y=(s&15)<<18|(c&63)<<12|(l&63)<<6|f&63,y>65535&& y<1114112&&(o=y))}}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 zo(n)}a(Zn,"utf8Slice");var $n=4096;function zo(r){let e=r.length;if(e<=$n)return String. +n.push(o),i+=u}return zo(n)}a(Jn,"utf8Slice");var $n=4096;function zo(r){let e=r.length;if(e<=$n)return String. fromCharCode.apply(String,r);let t="",n=0;for(;nn)&&(t=n);let i="";for(let s=e;sn)&&(t=n);let i="";for(let s=e;sn&&(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,h.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 \ @@ -207,14 +207,14 @@ e>>>8,t+2},"writeUInt16LE");h.prototype.writeUint16BE=h.prototype.writeUInt16BE= writeUint32LE=h.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||V(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");h.prototype. writeUint32BE=h.prototype.writeUInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||V(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 Jn(r,e,t,n,i){ -ni(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++]= +0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeUInt32BE");function Xn(r,e,t,n,i){ +ii(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(Jn,"wrtBigUInt64LE");function Xn(r,e,t,n,i){ni(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295)); +8,r[t++]=o,t}a(Xn,"wrtBigUInt64LE");function ei(r,e,t,n,i){ii(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(Xn,"wrtBigUInt64BE");h.prototype. -writeBigUInt64LE=be(a(function(e,t=0){return Jn(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ -riteBigUInt64LE"));h.prototype.writeBigUInt64BE=be(a(function(e,t=0){return Xn(this,e,t,BigInt(0),BigInt( +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(ei,"wrtBigUInt64BE");h.prototype. +writeBigUInt64LE=be(a(function(e,t=0){return Xn(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ +riteBigUInt64LE"));h.prototype.writeBigUInt64BE=be(a(function(e,t=0){return ei(this,e,t,BigInt(0),BigInt( "0xffffffffffffffff"))},"writeBigUInt64BE"));h.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>> 0,!i){let c=Math.pow(2,8*n-1);V(this,e,t,n,c-1,-c)}let s=0,o=1,u=0;for(this[t]=e&255;++s>0)-u&255;return t+n},"writeIntLE");h.prototype.writeIntBE= @@ -228,17 +228,17 @@ writeInt16BE=a(function(e,t,n){return e=+e,t=t>>>0,n||V(this,e,t,2,32767,-32768) 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");h.prototype.writeInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||V(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},"writeInt32BE");h.prototype.writeBigInt64LE=be(a(function(e,t=0){return Jn(this,e,t,-BigInt("0x\ +t+4},"writeInt32BE");h.prototype.writeBigInt64LE=be(a(function(e,t=0){return Xn(this,e,t,-BigInt("0x\ 8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));h.prototype.writeBigInt64BE=be( -a(function(e,t=0){return Xn(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"w\ -riteBigInt64BE"));function ei(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(ei,"checkIEEE754");function ti(r,e,t,n,i){return e= -+e,t=t>>>0,i||ei(r,e,t,4,34028234663852886e22,-34028234663852886e22),Re.write(r,e,t,n,23,4),t+4}a(ti, -"writeFloat");h.prototype.writeFloatLE=a(function(e,t,n){return ti(this,e,t,!0,n)},"writeFloatLE");h. -prototype.writeFloatBE=a(function(e,t,n){return ti(this,e,t,!1,n)},"writeFloatBE");function ri(r,e,t,n,i){ -return e=+e,t=t>>>0,i||ei(r,e,t,8,17976931348623157e292,-17976931348623157e292),Re.write(r,e,t,n,52, -8),t+8}a(ri,"writeDouble");h.prototype.writeDoubleLE=a(function(e,t,n){return ri(this,e,t,!0,n)},"wr\ -iteDoubleLE");h.prototype.writeDoubleBE=a(function(e,t,n){return ri(this,e,t,!1,n)},"writeDoubleBE"); +a(function(e,t=0){return ei(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"w\ +riteBigInt64BE"));function ti(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(ti,"checkIEEE754");function ri(r,e,t,n,i){return e= ++e,t=t>>>0,i||ti(r,e,t,4,34028234663852886e22,-34028234663852886e22),Re.write(r,e,t,n,23,4),t+4}a(ri, +"writeFloat");h.prototype.writeFloatLE=a(function(e,t,n){return ri(this,e,t,!0,n)},"writeFloatLE");h. +prototype.writeFloatBE=a(function(e,t,n){return ri(this,e,t,!1,n)},"writeFloatBE");function ni(r,e,t,n,i){ +return e=+e,t=t>>>0,i||ti(r,e,t,8,17976931348623157e292,-17976931348623157e292),Re.write(r,e,t,n,52, +8),t+8}a(ni,"writeDouble");h.prototype.writeDoubleLE=a(function(e,t,n){return ni(this,e,t,!0,n)},"wr\ +iteDoubleLE");h.prototype.writeDoubleBE=a(function(e,t,n){return ni(this,e,t,!1,n)},"writeDoubleBE"); h.prototype.copy=a(function(e,t,n,i){if(!h.isBuffer(e))throw new TypeError("argument should be a Buf\ fer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i2**32?i=Gn(String(t)):typeof t=="bigint"&&(i=String( -t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Gn(i)),i+="n"),n+=` It must be ${e}. Re\ -ceived ${i}`,n},RangeError);function Gn(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(Gn,"addNumericalSeparator");function Xo(r,e,t){ -Be(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&Ve(e,r.length-(t+1))}a(Xo,"checkBounds");function ni(r,e,t,n,i,s){ +f range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=Vn(String(t)):typeof t=="bigint"&&(i=String( +t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Vn(i)),i+="n"),n+=` It must be ${e}. Re\ +ceived ${i}`,n},RangeError);function Vn(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(Vn,"addNumericalSeparator");function ea(r,e,t){ +Be(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&Ve(e,r.length-(t+1))}a(ea,"checkBounds");function ii(r,e,t,n,i,s){ if(r>t||r3?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} a\ -nd <= ${t}${o}`,new Pe.ERR_OUT_OF_RANGE("value",u,r)}Xo(n,i,s)}a(ni,"checkIntBI");function Be(r,e){if(typeof r!= +nd <= ${t}${o}`,new Pe.ERR_OUT_OF_RANGE("value",u,r)}ea(n,i,s)}a(ii,"checkIntBI");function Be(r,e){if(typeof r!= "number")throw new Pe.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Be,"validateNumber");function Ve(r,e,t){throw Math. floor(r)!==r?(Be(r,t),new Pe.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new Pe.ERR_BUFFER_OUT_OF_BOUNDS: -new Pe.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(Ve,"boundsError");var ea=/[^+/0-9A-Za-z-_]/g; -function ta(r){if(r=r.split("=")[0],r=r.trim().replace(ea,""),r.length<2)return"";for(;r.length%4!== -0;)r=r+"=";return r}a(ta,"base64clean");function $t(r,e){e=e||1/0;let t,n=r.length,i=null,s=[];for(let o=0;o< +new Pe.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(Ve,"boundsError");var ta=/[^+/0-9A-Za-z-_]/g; +function ra(r){if(r=r.split("=")[0],r=r.trim().replace(ta,""),r.length<2)return"";for(;r.length%4!== +0;)r=r+"=";return r}a(ra,"base64clean");function $t(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($t,"utf\ -8ToBytes");function ra(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(na,"utf16leToBytes");function ii(r){return Wt.toByteArray( -ta(r))}a(ii,"base64ToBytes");function pt(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) -e[i+t]=r[i];return i}a(pt,"blitBuffer");function ce(r,e){return r instanceof e||r!=null&&r.constructor!= -null&&r.constructor.name!=null&&r.constructor.name===e.name}a(ce,"isInstance");function Kt(r){return r!== -r}a(Kt,"numberIsNaN");var ia=function(){let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){ +8ToBytes");function na(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(ia,"utf16leToBytes");function si(r){return jt.toByteArray( +ra(r))}a(si,"base64ToBytes");function dt(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) +e[i+t]=r[i];return i}a(dt,"blitBuffer");function ce(r,e){return r instanceof e||r!=null&&r.constructor!= +null&&r.constructor.name!=null&&r.constructor.name===e.name}a(ce,"isInstance");function Yt(r){return r!== +r}a(Yt,"numberIsNaN");var sa=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 be(r){return typeof BigInt>"u"? -sa:r}a(be,"defineBigIntMethod");function sa(){throw new Error("BigInt not supported")}a(sa,"BufferBi\ -gIntNotDefined")});var b,v,x,d,m,p=G(()=>{"use strict";b=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),x=globalThis. +oa:r}a(be,"defineBigIntMethod");function oa(){throw new Error("BigInt not supported")}a(oa,"BufferBi\ +gIntNotDefined")});var b,v,x,d,m,p=$(()=>{"use strict";b=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),x=globalThis. clearImmediate??(r=>clearTimeout(r)),d=typeof globalThis.Buffer=="function"&&typeof globalThis.Buffer. -allocUnsafe=="function"?globalThis.Buffer:si().Buffer,m=globalThis.process??{};m.env??(m.env={});try{ -m.nextTick(()=>{})}catch{let e=Promise.resolve();m.nextTick=e.then.bind(e)}});var ve=T((Fl,Yt)=>{"use strict";p();var Fe=typeof Reflect=="object"?Reflect:null,oi=Fe&&typeof Fe.apply== -"function"?Fe.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),dt; -Fe&&typeof Fe.ownKeys=="function"?dt=Fe.ownKeys:Object.getOwnPropertySymbols?dt=a(function(e){return Object. -getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):dt=a(function(e){return Object. -getOwnPropertyNames(e)},"ReflectOwnKeys");function oa(r){console&&console.warn&&console.warn(r)}a(oa, -"ProcessEmitWarning");var ui=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function R(){R. -init.call(this)}a(R,"EventEmitter");Yt.exports=R;Yt.exports.once=la;R.EventEmitter=R;R.prototype._events= -void 0;R.prototype._eventsCount=0;R.prototype._maxListeners=void 0;var ai=10;function yt(r){if(typeof r!= +allocUnsafe=="function"?globalThis.Buffer:oi().Buffer,m=globalThis.process??{};m.env??(m.env={});try{ +m.nextTick(()=>{})}catch{let e=Promise.resolve();m.nextTick=e.then.bind(e)}});var ve=T((kl,Zt)=>{"use strict";p();var Fe=typeof Reflect=="object"?Reflect:null,ai=Fe&&typeof Fe.apply== +"function"?Fe.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),yt; +Fe&&typeof Fe.ownKeys=="function"?yt=Fe.ownKeys:Object.getOwnPropertySymbols?yt=a(function(e){return Object. +getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):yt=a(function(e){return Object. +getOwnPropertyNames(e)},"ReflectOwnKeys");function aa(r){console&&console.warn&&console.warn(r)}a(aa, +"ProcessEmitWarning");var ci=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function R(){R. +init.call(this)}a(R,"EventEmitter");Zt.exports=R;Zt.exports.once=fa;R.EventEmitter=R;R.prototype._events= +void 0;R.prototype._eventsCount=0;R.prototype._maxListeners=void 0;var ui=10;function mt(r){if(typeof r!= "function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)} -a(yt,"checkListener");Object.defineProperty(R,"defaultMaxListeners",{enumerable:!0,get:a(function(){ -return ai},"get"),set:a(function(r){if(typeof r!="number"||r<0||ui(r))throw new RangeError('The valu\ -e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");ai=r}, +a(mt,"checkListener");Object.defineProperty(R,"defaultMaxListeners",{enumerable:!0,get:a(function(){ +return ui},"get"),set:a(function(r){if(typeof r!="number"||r<0||ci(r))throw new RangeError('The valu\ +e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");ui=r}, "set")});R.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}; -R.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||ui(e))throw new RangeError('Th\ +R.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||ci(e))throw new RangeError('Th\ e value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners= -e,this},"setMaxListeners");function ci(r){return r._maxListeners===void 0?R.defaultMaxListeners:r._maxListeners} -a(ci,"_getMaxListeners");R.prototype.getMaxListeners=a(function(){return ci(this)},"getMaxListeners"); +e,this},"setMaxListeners");function li(r){return r._maxListeners===void 0?R.defaultMaxListeners:r._maxListeners} +a(li,"_getMaxListeners");R.prototype.getMaxListeners=a(function(){return li(this)},"getMaxListeners"); R.prototype.emit=a(function(e){for(var t=[],n=1;n 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")oi(c,this,t);else for(var l=c. -length,f=di(c,l),n=0;n0&&o.length>i&&!o.warned){o.warned= +"function"?o=s[e]=n?[t,o]:[o,t]:n?o.unshift(t):o.push(t),i=li(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,oa(u)}return r}a(li,"_addListener");R.prototype.addListener=a(function(e,t){ -return li(this,e,t,!1)},"addListener");R.prototype.on=R.prototype.addListener;R.prototype.prependListener= -a(function(e,t){return li(this,e,t,!0)},"prependListener");function aa(){if(!this.fired)return this. +r,u.type=e,u.count=o.length,aa(u)}return r}a(fi,"_addListener");R.prototype.addListener=a(function(e,t){ +return fi(this,e,t,!1)},"addListener");R.prototype.on=R.prototype.addListener;R.prototype.prependListener= +a(function(e,t){return fi(this,e,t,!0)},"prependListener");function ua(){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(aa,"onceWrapper");function fi(r,e,t){var n={fired:!1, -wrapFn:void 0,target:r,type:e,listener:t},i=aa.bind(n);return i.listener=t,n.wrapFn=i,i}a(fi,"_onceW\ -rap");R.prototype.once=a(function(e,t){return yt(t),this.on(e,fi(this,e,t)),this},"once");R.prototype. -prependOnceListener=a(function(e,t){return yt(t),this.prependListener(e,fi(this,e,t)),this},"prepend\ -OnceListener");R.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(yt(t),i=this._events,i=== +target):this.listener.apply(this.target,arguments)}a(ua,"onceWrapper");function hi(r,e,t){var n={fired:!1, +wrapFn:void 0,target:r,type:e,listener:t},i=ua.bind(n);return i.listener=t,n.wrapFn=i,i}a(hi,"_onceW\ +rap");R.prototype.once=a(function(e,t){return mt(t),this.on(e,hi(this,e,t)),this},"once");R.prototype. +prependOnceListener=a(function(e,t){return mt(t),this.prependListener(e,hi(this,e,t)),this},"prepend\ +OnceListener");R.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(mt(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("removeListener",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():ua(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== +listener,s=o;break}if(s<0)return this;s===0?n.shift():ca(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== void 0&&this.emit("removeListener",e,u||t)}return this},"removeListener");R.prototype.off=R.prototype. removeListener;R.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= @@ -340,25 +340,25 @@ if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.cr length===0){var s=Object.keys(n),o;for(i=0;i= -0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function hi(r,e,t){var n=r._events; +0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function pi(r,e,t){var n=r._events; if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t? -ca(i):di(i,i.length)}a(hi,"_listeners");R.prototype.listeners=a(function(e){return hi(this,e,!0)},"l\ -isteners");R.prototype.rawListeners=a(function(e){return hi(this,e,!1)},"rawListeners");R.listenerCount= -function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):pi.call(r,e)};R.prototype. -listenerCount=pi;function pi(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(pi,"listenerCount");R.prototype.eventNames=a(function(){ -return this._eventsCount>0?dt(this._events):[]},"eventNames");function di(r,e){for(var t=new Array(e), -n=0;n0?yt(this._events):[]},"eventNames");function yi(r,e){for(var t=new Array(e), +n=0;nse,isIP:()=>ha});function ha(r){return 0}var wi,mi,S,se,ke=G(()=>{"use s\ -trict";p();wi=Ae(ve(),1);a(ha,"isIP");mi=/^[^.]+\./,S=class S extends wi.EventEmitter{constructor(){ +ust be of type EventEmitter. Received type '+typeof r)}a(mi,"eventTargetAgnosticAddListener")});var bi={};te(bi,{Socket:()=>se,isIP:()=>pa});function pa(r){return 0}var gi,wi,S,se,ke=$(()=>{"use s\ +trict";p();gi=Ae(ve(),1);a(pa,"isIP");wi=/^[^.]+\./,S=class S extends gi.EventEmitter{constructor(){ super(...arguments);E(this,"opts",{});E(this,"connecting",!1);E(this,"pending",!0);E(this,"writable", !0);E(this,"encrypted",!1);E(this,"authorized",!1);E(this,"destroyed",!1);E(this,"ws",null);E(this,"\ writeBuffer");E(this,"tlsState",0);E(this,"tlsRead");E(this,"tlsWrite")}static get poolQueryViaFetch(){ @@ -423,129 +423,129 @@ n}}write(t,n="utf8",i=s=>{}){return t.length===0?(i(),!0):(typeof t=="string"&&( tlsState===0?(this.rawWrite(t),i()):this.tlsState===1?this.once("secureConnection",()=>{this.write(t, n,i)}):(this.tlsWrite(t),i()),!0)}end(t=d.alloc(0),n="utf8",i=()=>{}){return this.write(t,n,()=>{this. ws.close(),i()}),this}destroy(){return this.destroyed=!0,this.end()}};a(S,"Socket"),E(S,"defaults",{ -poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{let s;return i?.jwtAuth?s=t.replace(mi,"apiauth."):s= -t.replace(mi,"api."),"https://"+s+"/sql"},"fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0, +poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{let s;return i?.jwtAuth?s=t.replace(wi,"apiauth."):s= +t.replace(wi,"api."),"https://"+s+"/sql"},"fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0, webSocketConstructor:void 0,wsProxy:a(t=>t+"/v2","wsProxy"),useSecureWebSocket:!0,forceDisablePgSSL:!0, coalesceWrites:!0,pipelineConnect:"password",subtls:void 0,rootCerts:"",pipelineTLS:!1,disableSNI:!1, -disableWarningInBrowsers:!1}),E(S,"opts",{});se=S});var bi={};te(bi,{parse:()=>Zt});function Zt(r,e=!1){let{protocol:t}=new URL(r),n="http:"+r.substring( +disableWarningInBrowsers:!1}),E(S,"opts",{});se=S});var vi={};te(vi,{parse:()=>Jt});function Jt(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:l,search:f,searchParams:y,hash:g}=new URL( n);s=decodeURIComponent(s),i=decodeURIComponent(i),l=decodeURIComponent(l);let A=i+":"+s,C=e?Object. fromEntries(y.entries()):f;return{href:r,protocol:t,auth:A,username:i,password:s,host:o,hostname:u,port:c, -pathname:l,search:f,query:C,hash:g}}var Jt=G(()=>{"use strict";p();a(Zt,"parse")});var rr=T(Ci=>{"use strict";p();Ci.parse=function(r,e){return new tr(r,e).parse()};var vt=class vt{constructor(e,t){ -this.source=e,this.transform=t||Ca,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){ +pathname:l,search:f,query:C,hash:g}}var Xt=$(()=>{"use strict";p();a(Jt,"parse")});var nr=T(_i=>{"use strict";p();_i.parse=function(r,e){return new rr(r,e).parse()};var xt=class xt{constructor(e,t){ +this.source=e,this.transform=t||_a,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){ return this.position>=this.source.length}nextCharacter(){var e=this.source[this.position++];return e=== "\\"?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){this.recorded.push( e)}newEntry(e){var t;(this.recorded.length>0||e)&&(t=this.recorded.join(""),t==="NULL"&&!e&&(t=null), t!==null&&(t=this.transform(t)),this.entries.push(t),this.recorded=[])}consumeDimensions(){if(this.source[0]=== "[")for(;!this.isEof();){var e=this.nextCharacter();if(e.value==="=")break}}parse(e){var t,n,i;for(this. consumeDimensions();!this.isEof();)if(t=this.nextCharacter(),t.value==="{"&&!i)this.dimension++,this. -dimension>1&&(n=new vt(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse( +dimension>1&&(n=new xt(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse( !0)),this.position+=n.position-2);else if(t.value==="}"&&!i){if(this.dimension--,!this.dimension&&(this. newEntry(),e))return this.entries}else t.value==='"'&&!t.escaped?(i&&this.newEntry(!0),i=!i):t.value=== ","&&!i?this.newEntry():this.record(t.value);if(this.dimension!==0)throw new Error("array dimension \ -not balanced");return this.entries}};a(vt,"ArrayParser");var tr=vt;function Ca(r){return r}a(Ca,"ide\ -ntity")});var nr=T((Xl,_i)=>{p();var _a=rr();_i.exports={create:a(function(r,e){return{parse:a(function(){return _a. -parse(r,e)},"parse")}},"create")}});var Pi=T((rf,Ti)=>{"use strict";p();var Ia=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, -Ta=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Pa=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Ra=/^-?infinity$/;Ti. -exports=a(function(e){if(Ra.test(e))return Number(e.replace("i","I"));var t=Ia.exec(e);if(!t)return Ba( -e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Ii(i));var s=parseInt(t[2],10)-1,o=t[3],u=parseInt(t[4], -10),c=parseInt(t[5],10),l=parseInt(t[6],10),f=t[7];f=f?1e3*parseFloat(f):0;var y,g=La(e);return g!=null? -(y=new Date(Date.UTC(i,s,o,u,c,l,f)),ir(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= -new Date(i,s,o,u,c,l,f),ir(i)&&y.setFullYear(i)),y},"parseDate");function Ba(r){var e=Ta.exec(r);if(e){ -var t=parseInt(e[1],10),n=!!e[4];n&&(t=Ii(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return ir( -t)&&o.setFullYear(t),o}}a(Ba,"getDate");function La(r){if(r.endsWith("+00"))return 0;var e=Pa.exec(r. +not balanced");return this.entries}};a(xt,"ArrayParser");var rr=xt;function _a(r){return r}a(_a,"ide\ +ntity")});var ir=T((rf,Ii)=>{p();var Ia=nr();Ii.exports={create:a(function(r,e){return{parse:a(function(){return Ia. +parse(r,e)},"parse")}},"create")}});var Ri=T((of,Pi)=>{"use strict";p();var Ta=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, +Pa=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Ra=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Ba=/^-?infinity$/;Pi. +exports=a(function(e){if(Ba.test(e))return Number(e.replace("i","I"));var t=Ta.exec(e);if(!t)return La( +e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Ti(i));var s=parseInt(t[2],10)-1,o=t[3],u=parseInt(t[4], +10),c=parseInt(t[5],10),l=parseInt(t[6],10),f=t[7];f=f?1e3*parseFloat(f):0;var y,g=Fa(e);return g!=null? +(y=new Date(Date.UTC(i,s,o,u,c,l,f)),sr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= +new Date(i,s,o,u,c,l,f),sr(i)&&y.setFullYear(i)),y},"parseDate");function La(r){var e=Pa.exec(r);if(e){ +var t=parseInt(e[1],10),n=!!e[4];n&&(t=Ti(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return sr( +t)&&o.setFullYear(t),o}}a(La,"getDate");function Fa(r){if(r.endsWith("+00"))return 0;var e=Ra.exec(r. split(" ")[1]);if(e){var t=e[1];if(t==="Z")return 0;var n=t==="-"?-1:1,i=parseInt(e[2],10)*3600+parseInt( -e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(La,"timeZoneOffset");function Ii(r){return-(r- -1)}a(Ii,"bcYearToNegativeYear");function ir(r){return r>=0&&r<100}a(ir,"is0To99")});var Bi=T((of,Ri)=>{p();Ri.exports=ka;var Fa=Object.prototype.hasOwnProperty;function ka(r){for(var e=1;e< -arguments.length;e++){var t=arguments[e];for(var n in t)Fa.call(t,n)&&(r[n]=t[n])}return r}a(ka,"ext\ -end")});var ki=T((cf,Fi)=>{"use strict";p();var Ma=Bi();Fi.exports=De;function De(r){if(!(this instanceof De)) -return new De(r);Ma(this,Va(r))}a(De,"PostgresInterval");var Ua=["seconds","minutes","hours","days", -"months","years"];De.prototype.toPostgres=function(){var r=Ua.filter(this.hasOwnProperty,this);return this. +e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(Fa,"timeZoneOffset");function Ti(r){return-(r- +1)}a(Ti,"bcYearToNegativeYear");function sr(r){return r>=0&&r<100}a(sr,"is0To99")});var Li=T((cf,Bi)=>{p();Bi.exports=Ma;var ka=Object.prototype.hasOwnProperty;function Ma(r){for(var e=1;e< +arguments.length;e++){var t=arguments[e];for(var n in t)ka.call(t,n)&&(r[n]=t[n])}return r}a(Ma,"ext\ +end")});var Mi=T((hf,ki)=>{"use strict";p();var Ua=Li();ki.exports=De;function De(r){if(!(this instanceof De)) +return new De(r);Ua(this,Ka(r))}a(De,"PostgresInterval");var Da=["seconds","minutes","hours","days", +"months","years"];De.prototype.toPostgres=function(){var r=Da.filter(this.hasOwnProperty,this);return this. milliseconds&&r.indexOf("seconds")<0&&r.push("seconds"),r.length===0?"0":r.map(function(e){var t=this[e]|| 0;return e==="seconds"&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/, -"")),t+" "+e},this).join(" ")};var Da={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ -S"},Oa=["years","months","days"],qa=["hours","minutes","seconds"];De.prototype.toISOString=De.prototype. -toISO=function(){var r=Oa.map(t,this).join(""),e=qa.map(t,this).join("");return"P"+r+"T"+e;function t(n){ +"")),t+" "+e},this).join(" ")};var Oa={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ +S"},qa=["years","months","days"],Qa=["hours","minutes","seconds"];De.prototype.toISOString=De.prototype. +toISO=function(){var r=qa.map(t,this).join(""),e=Qa.map(t,this).join("");return"P"+r+"T"+e;function t(n){ var i=this[n]||0;return n==="seconds"&&this.milliseconds&&(i=(i+this.milliseconds/1e3).toFixed(6).replace( -/0+$/,"")),i+Da[n]}};var sr="([+-]?\\d+)",Qa=sr+"\\s+years?",Na=sr+"\\s+mons?",Wa=sr+"\\s+days?",ja="\ -([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",Ha=new RegExp([Qa,Na,Wa,ja].map(function(r){return"\ -("+r+")?"}).join("\\s*")),Li={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, -$a=["hours","minutes","seconds","milliseconds"];function Ga(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}a(Ga,"parseMilliseconds");function Va(r){if(!r)return{};var e=Ha.exec(r),t=e[8]==="-";return Object. -keys(Li).reduce(function(n,i){var s=Li[i],o=e[s];return!o||(o=i==="milliseconds"?Ga(o):parseInt(o,10), -!o)||(t&&~$a.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(Va,"parse")});var Ui=T((hf,Mi)=>{"use strict";p();Mi.exports=a(function(e){if(/^\\x/.test(e))return new d(e.substr( +/0+$/,"")),i+Oa[n]}};var or="([+-]?\\d+)",Na=or+"\\s+years?",Wa=or+"\\s+mons?",ja=or+"\\s+days?",Ha="\ +([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",Ga=new RegExp([Na,Wa,ja,Ha].map(function(r){return"\ +("+r+")?"}).join("\\s*")),Fi={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, +$a=["hours","minutes","seconds","milliseconds"];function Va(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(Va,"parseMilliseconds");function Ka(r){if(!r)return{};var e=Ga.exec(r),t=e[8]==="-";return Object. +keys(Fi).reduce(function(n,i){var s=Fi[i],o=e[s];return!o||(o=i==="milliseconds"?Va(o):parseInt(o,10), +!o)||(t&&~$a.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(Ka,"parse")});var Di=T((yf,Ui)=>{"use strict";p();Ui.exports=a(function(e){if(/^\\x/.test(e))return new d(e.substr( 2),"hex");for(var t="",n=0;n{p();var Ye=rr(),Ze=nr(),xt=Pi(),Oi=ki(),qi=Ui();function St(r){return a(function(t){ -return t===null?t:r(t)},"nullAllowed")}a(St,"allowNull");function Qi(r){return r===null?r:r==="TRUE"|| -r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(Qi,"parseBool");function za(r){return r? -Ye.parse(r,Qi):null}a(za,"parseBoolArray");function Ka(r){return parseInt(r,10)}a(Ka,"parseBaseTenIn\ -t");function or(r){return r?Ye.parse(r,St(Ka)):null}a(or,"parseIntegerArray");function Ya(r){return r? -Ye.parse(r,St(function(e){return Ni(e).trim()})):null}a(Ya,"parseBigIntegerArray");var Za=a(function(r){ -if(!r)return null;var e=Ze.create(r,function(t){return t!==null&&(t=lr(t)),t});return e.parse()},"pa\ -rsePointArray"),ar=a(function(r){if(!r)return null;var e=Ze.create(r,function(t){return t!==null&&(t= -parseFloat(t)),t});return e.parse()},"parseFloatArray"),ne=a(function(r){if(!r)return null;var e=Ze. -create(r);return e.parse()},"parseStringArray"),ur=a(function(r){if(!r)return null;var e=Ze.create(r, -function(t){return t!==null&&(t=xt(t)),t});return e.parse()},"parseDateArray"),Ja=a(function(r){if(!r) -return null;var e=Ze.create(r,function(t){return t!==null&&(t=Oi(t)),t});return e.parse()},"parseInt\ -ervalArray"),Xa=a(function(r){return r?Ye.parse(r,St(qi)):null},"parseByteAArray"),cr=a(function(r){ -return parseInt(r,10)},"parseInteger"),Ni=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ -parseBigInteger"),Di=a(function(r){return r?Ye.parse(r,St(JSON.parse)):null},"parseJsonArray"),lr=a( +parseBytea")});var Hi=T((gf,ji)=>{p();var Ze=nr(),Je=ir(),St=Ri(),qi=Mi(),Qi=Di();function Et(r){return a(function(t){ +return t===null?t:r(t)},"nullAllowed")}a(Et,"allowNull");function Ni(r){return r===null?r:r==="TRUE"|| +r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(Ni,"parseBool");function za(r){return r? +Ze.parse(r,Ni):null}a(za,"parseBoolArray");function Ya(r){return parseInt(r,10)}a(Ya,"parseBaseTenIn\ +t");function ar(r){return r?Ze.parse(r,Et(Ya)):null}a(ar,"parseIntegerArray");function Za(r){return r? +Ze.parse(r,Et(function(e){return Wi(e).trim()})):null}a(Za,"parseBigIntegerArray");var Ja=a(function(r){ +if(!r)return null;var e=Je.create(r,function(t){return t!==null&&(t=fr(t)),t});return e.parse()},"pa\ +rsePointArray"),ur=a(function(r){if(!r)return null;var e=Je.create(r,function(t){return t!==null&&(t= +parseFloat(t)),t});return e.parse()},"parseFloatArray"),ne=a(function(r){if(!r)return null;var e=Je. +create(r);return e.parse()},"parseStringArray"),cr=a(function(r){if(!r)return null;var e=Je.create(r, +function(t){return t!==null&&(t=St(t)),t});return e.parse()},"parseDateArray"),Xa=a(function(r){if(!r) +return null;var e=Je.create(r,function(t){return t!==null&&(t=qi(t)),t});return e.parse()},"parseInt\ +ervalArray"),eu=a(function(r){return r?Ze.parse(r,Et(Qi)):null},"parseByteAArray"),lr=a(function(r){ +return parseInt(r,10)},"parseInteger"),Wi=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ +parseBigInteger"),Oi=a(function(r){return r?Ze.parse(r,Et(JSON.parse)):null},"parseJsonArray"),fr=a( function(r){return r[0]!=="("?null:(r=r.substring(1,r.length-1).split(","),{x:parseFloat(r[0]),y:parseFloat( -r[1])})},"parsePoint"),eu=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, +r[1])})},"parsePoint"),tu=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, i=2;i{"use strict";p();var z=1e6;function ru(r){var e=r.readInt32BE(0),t=r.readUInt32BE( -4),n="";e<0&&(e=~e+(t===0),t=~t+1>>>0,n="-");var i="",s,o,u,c,l,f;{if(s=e%z,e=e/z>>>0,o=4294967296*s+ -t,t=o/z>>>0,u=""+(o-z*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f>>0,o=4294967296*s+t,t=o/z>>>0,u=""+(o-z*t),t===0&&e===0)return n+u+i;for(c="",l=6-u. -length,f=0;f>>0,o=4294967296*s+t,t=o/z>>>0,u=""+(o-z*t),t===0&& -e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var nu=$i(),L=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(A,C,D){return A* +r[i])}var s=fr(e);return s.radius=parseFloat(t),s},"parseCircle"),ru=a(function(r){r(20,Wi),r(21,lr), +r(23,lr),r(26,lr),r(700,parseFloat),r(701,parseFloat),r(16,Ni),r(1082,St),r(1114,St),r(1184,St),r(600, +fr),r(651,ne),r(718,tu),r(1e3,za),r(1001,eu),r(1005,ar),r(1007,ar),r(1028,ar),r(1016,Za),r(1017,Ja), +r(1021,ur),r(1022,ur),r(1231,ur),r(1014,ne),r(1015,ne),r(1008,ne),r(1009,ne),r(1040,ne),r(1041,ne),r( +1115,cr),r(1182,cr),r(1185,cr),r(1186,qi),r(1187,Xa),r(17,Qi),r(114,JSON.parse.bind(JSON)),r(3802,JSON. +parse.bind(JSON)),r(199,Oi),r(3807,Oi),r(3907,ne),r(2951,ne),r(791,ne),r(1183,ne),r(1270,ne)},"init"); +ji.exports={init:ru}});var $i=T((xf,Gi)=>{"use strict";p();var K=1e6;function nu(r){var e=r.readInt32BE(0),t=r.readUInt32BE( +4),n="";e<0&&(e=~e+(t===0),t=~t+1>>>0,n="-");var i="",s,o,u,c,l,f;{if(s=e%K,e=e/K>>>0,o=4294967296*s+ +t,t=o/K>>>0,u=""+(o-K*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f>>0,o=4294967296*s+t,t=o/K>>>0,u=""+(o-K*t),t===0&&e===0)return n+u+i;for(c="",l=6-u. +length,f=0;f>>0,o=4294967296*s+t,t=o/K>>>0,u=""+(o-K*t),t===0&& +e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var iu=$i(),L=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(A,C,D){return A* Math.pow(2,D)+C};var s=t>>3,o=a(function(A){return n?~A&255:A},"inv"),u=255,c=8-t%8;e>t%8);var l=0;t%8+e>=8&&(l=i(0,o(r[s])&u,c));for(var f=e+t>>3,y=s+1;y0&&(l=i(l,o(r[f])>>8-g,g)),l},"parseBits"),zi=a(function(r,e,t){var n=Math. pow(2,t-1)-1,i=L(r,1),s=L(r,t,1);if(s===0)return 0;var o=1,u=a(function(l,f,y){l===0&&(l=1);for(var g=1;g<= y;g++)o/=2,(f&1<0&&(l+=o);return l},"parsePrecisionBits"),c=L(r,e,t+1,!1,u);return s==Math.pow( -2,t+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1:-1)*Math.pow(2,s-n)*c},"parseFloatFromBits"),iu=a(function(r){ -return L(r,1)==1?-1*(L(r,15,1,!0)+1):L(r,15,1)},"parseInt16"),Gi=a(function(r){return L(r,1)==1?-1*(L( -r,31,1,!0)+1):L(r,31,1)},"parseInt32"),su=a(function(r){return zi(r,23,8)},"parseFloat32"),ou=a(function(r){ -return zi(r,52,11)},"parseFloat64"),au=a(function(r){var e=L(r,16,32);if(e==49152)return NaN;for(var t=Math. +2,t+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1:-1)*Math.pow(2,s-n)*c},"parseFloatFromBits"),su=a(function(r){ +return L(r,1)==1?-1*(L(r,15,1,!0)+1):L(r,15,1)},"parseInt16"),Vi=a(function(r){return L(r,1)==1?-1*(L( +r,31,1,!0)+1):L(r,31,1)},"parseInt32"),ou=a(function(r){return zi(r,23,8)},"parseFloat32"),au=a(function(r){ +return zi(r,52,11)},"parseFloat64"),uu=a(function(r){var e=L(r,16,32);if(e==49152)return NaN;for(var t=Math. pow(1e4,L(r,16,16)),n=0,i=[],s=L(r,16),o=0;o>3,(i+=f<<3)>>3),y;console.log("ERROR: ElementType no\ t implemented: "+l)},"parseElement"),c=a(function(l,f){var y=[],g;if(l.length>1){var A=l.shift();for(g= 0;g0},"parseBool"),lu=a(function(r){r(20,nu),r(21,iu),r(23,Gi),r(26,Gi),r(1700,au),r(700,su), -r(701,ou),r(16,cu),r(1114,Vi.bind(null,!1)),r(1184,Vi.bind(null,!0)),r(1e3,Je),r(1007,Je),r(1016,Je), -r(1008,Je),r(1009,Je),r(25,uu)},"init");Ki.exports={init:lu}});var Ji=T((Af,Zi)=>{p();Zi.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25, +"parseArray"),cu=a(function(r){return r.toString("utf8")},"parseText"),lu=a(function(r){return r===null? +null:L(r,8)>0},"parseBool"),fu=a(function(r){r(20,iu),r(21,su),r(23,Vi),r(26,Vi),r(1700,uu),r(700,ou), +r(701,au),r(16,lu),r(1114,Ki.bind(null,!1)),r(1184,Ki.bind(null,!0)),r(1e3,Xe),r(1007,Xe),r(1016,Xe), +r(1008,Xe),r(1009,Xe),r(25,cu)},"init");Yi.exports={init:fu}});var Xi=T((If,Ji)=>{p();Ji.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25, OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194,SMGR:210,PATH:602,POLYGON:604,CIDR:650, FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703,TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829, INET:869,ACLITEM:1033,BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186, TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203,REGOPERATOR:2204, REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220,PG_NDISTINCT:3361,PG_DEPENDENCIES:3402, TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642,REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089, -REGROLE:4096}});var tt=T(et=>{p();var fu=ji(),hu=Yi(),pu=nr(),du=Ji();et.getTypeParser=yu;et.setTypeParser=mu;et.arrayParser= -pu;et.builtins=du;var Xe={text:{},binary:{}};function Xi(r){return String(r)}a(Xi,"noParse");function yu(r,e){ -return e=e||"text",Xe[e]&&Xe[e][r]||Xi}a(yu,"getTypeParser");function mu(r,e,t){typeof e=="function"&& -(t=e,e="text"),Xe[e][r]=t}a(mu,"setTypeParser");fu.init(function(r,e){Xe.text[r]=e});hu.init(function(r,e){ -Xe.binary[r]=e})});var At=T((Pf,es)=>{"use strict";p();var wu=tt();function Et(r){this._types=r||wu,this.text={},this.binary= -{}}a(Et,"TypeOverrides");Et.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ -binary":return this.binary;default:return{}}};Et.prototype.setTypeParser=function(r,e,t){typeof e=="\ -function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Et.prototype.getTypeParser=function(r,e){return e= -e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};es.exports=Et});function rt(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119,o=2600822924,u=528734635, +REGROLE:4096}});var rt=T(tt=>{p();var hu=Hi(),pu=Zi(),du=ir(),yu=Xi();tt.getTypeParser=mu;tt.setTypeParser=wu;tt.arrayParser= +du;tt.builtins=yu;var et={text:{},binary:{}};function es(r){return String(r)}a(es,"noParse");function mu(r,e){ +return e=e||"text",et[e]&&et[e][r]||es}a(mu,"getTypeParser");function wu(r,e,t){typeof e=="function"&& +(t=e,e="text"),et[e][r]=t}a(wu,"setTypeParser");hu.init(function(r,e){et.text[r]=e});pu.init(function(r,e){ +et.binary[r]=e})});var Ct=T((Lf,ts)=>{"use strict";p();var gu=rt();function At(r){this._types=r||gu,this.text={},this.binary= +{}}a(At,"TypeOverrides");At.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ +binary":return this.binary;default:return{}}};At.prototype.setTypeParser=function(r,e,t){typeof e=="\ +function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};At.prototype.getTypeParser=function(r,e){return e= +e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};ts.exports=At});function nt(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119,o=2600822924,u=528734635, c=1541459225,l=0,f=0,y=[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, @@ -556,8 +556,8 @@ c=1541459225,l=0,f=0,y=[1116352408,1899447441,3049323471,3921009573,961987163,15 w,"rrot"),A=new Uint32Array(64),C=new Uint8Array(64),D=a(()=>{for(let B=0,j=0;B<16;B++,j+=4)A[B]=C[j]<< 24|C[j+1]<<16|C[j+2]<<8|C[j+3];for(let B=16;B<64;B++){let j=g(A[B-15],7)^g(A[B-15],18)^A[B-15]>>>3,fe=g( A[B-2],17)^g(A[B-2],19)^A[B-2]>>>10;A[B]=A[B-16]+j+A[B-7]+fe|0}let I=e,w=t,Z=n,W=i,J=s,X=o,oe=u,ae=c; -for(let B=0;B<64;B++){let j=g(J,6)^g(J,11)^g(J,25),fe=J&X^~J&oe,me=ae+j+fe+y[B]+A[B]|0,Ge=g(I,2)^g(I, -13)^g(I,22),he=I&w^I&Z^w&Z,Ie=Ge+he|0;ae=oe,oe=X,X=J,J=W+me|0,W=Z,Z=w,w=I,I=me+Ie|0}e=e+I|0,t=t+w|0, +for(let B=0;B<64;B++){let j=g(J,6)^g(J,11)^g(J,25),fe=J&X^~J&oe,me=ae+j+fe+y[B]+A[B]|0,$e=g(I,2)^g(I, +13)^g(I,22),he=I&w^I&Z^w&Z,Ie=$e+he|0;ae=oe,oe=X,X=J,J=W+me|0,W=Z,Z=w,w=I,I=me+Ie|0}e=e+I|0,t=t+w|0, n=n+Z|0,i=i+W|0,s=s+J|0,o=o+X|0,u=u+oe|0,c=c+ae|0,f=0},"process"),Y=a(I=>{typeof I=="string"&&(I=new TextEncoder(). encode(I));for(let w=0;w{if(C[f++]= 128,f==64&&D(),f+8>64){for(;f<64;)C[f++]=0;D()}for(;f<58;)C[f++]=0;let I=l*8;C[f++]=I/1099511627776& @@ -567,7 +567,7 @@ encode(I));for(let w=0;w>>8&255,w[15]=i&255,w[16]=s>>>24,w[17]=s>>>16&255,w[18]=s>>>8&255,w[19]=s&255,w[20]=o>>>24,w[21]= o>>>16&255,w[22]=o>>>8&255,w[23]=o&255,w[24]=u>>>24,w[25]=u>>>16&255,w[26]=u>>>8&255,w[27]=u&255,w[28]= c>>>24,w[29]=c>>>16&255,w[30]=c>>>8&255,w[31]=c&255,w},"digest");return r===void 0?{add:Y,digest:P}: -(Y(r),P())}var ts=G(()=>{"use strict";p();a(rt,"sha256")});var U,nt,rs=G(()=>{"use strict";p();U=class U{constructor(){E(this,"_dataLength",0);E(this,"_bufferL\ +(Y(r),P())}var rs=$(()=>{"use strict";p();a(nt,"sha256")});var U,it,ns=$(()=>{"use strict";p();U=class U{constructor(){E(this,"_dataLength",0);E(this,"_bufferL\ ength",0);E(this,"_state",new Int32Array(4));E(this,"_buffer",new ArrayBuffer(68));E(this,"_buffer8"); E(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( @@ -629,126 +629,126 @@ o<=4294967295)i[14]=o;else{let u=o.toString(16).match(/(.*?)(.{0,8})$/);if(u===n u[2],16),l=parseInt(u[1],16)||0;i[14]=c,i[15]=l}return U._md5cycle(this._state,i),e?this._state:U._hex( this._state)}};a(U,"Md5"),E(U,"stateIdentity",new Int32Array([1732584193,-271733879,-1732584194,271733878])), E(U,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),E(U,"hexChars","0123456789\ -abcdef"),E(U,"hexOut",[]),E(U,"onePassHasher",new U);nt=U});var fr={};te(fr,{createHash:()=>bu,createHmac:()=>vu,randomBytes:()=>gu});function gu(r){return crypto. -getRandomValues(d.alloc(r))}function bu(r){if(r==="sha256")return{update:a(function(e){return{digest:a( -function(){return d.from(rt(e))},"digest")}},"update")};if(r==="md5")return{update:a(function(e){return{ -digest:a(function(){return typeof e=="string"?nt.hashStr(e):nt.hashByteArray(e)},"digest")}},"update")}; -throw new Error(`Hash type '${r}' not supported`)}function vu(r,e){if(r!=="sha256")throw new Error(`\ +abcdef"),E(U,"hexOut",[]),E(U,"onePassHasher",new U);it=U});var hr={};te(hr,{createHash:()=>vu,createHmac:()=>xu,randomBytes:()=>bu});function bu(r){return crypto. +getRandomValues(d.alloc(r))}function vu(r){if(r==="sha256")return{update:a(function(e){return{digest:a( +function(){return d.from(nt(e))},"digest")}},"update")};if(r==="md5")return{update:a(function(e){return{ +digest:a(function(){return typeof e=="string"?it.hashStr(e):it.hashByteArray(e)},"digest")}},"update")}; +throw new Error(`Hash type '${r}' not supported`)}function xu(r,e){if(r!=="sha256")throw new Error(`\ Only sha256 is supported (requested: '${r}')`);return{update:a(function(t){return{digest:a(function(){ typeof e=="string"&&(e=new TextEncoder().encode(e)),typeof t=="string"&&(t=new TextEncoder().encode( -t));let n=e.length;if(n>64)e=rt(e);else if(n<64){let c=new Uint8Array(64);c.set(e),e=c}let i=new Uint8Array( +t));let n=e.length;if(n>64)e=nt(e);else if(n<64){let c=new Uint8Array(64);c.set(e),e=c}let i=new Uint8Array( 64),s=new Uint8Array(64);for(let c=0;c<64;c++)i[c]=54^e[c],s[c]=92^e[c];let o=new Uint8Array(t.length+ -64);o.set(i,0),o.set(t,64);let u=new Uint8Array(96);return u.set(s,0),u.set(rt(o),64),d.from(rt(u))}, -"digest")}},"update")}}var hr=G(()=>{"use strict";p();ts();rs();a(gu,"randomBytes");a(bu,"createHash"); -a(vu,"createHmac")});var it=T((Wf,pr)=>{"use strict";p();pr.exports={host:"localhost",user:m.platform==="win32"?m.env.USERNAME: +64);o.set(i,0),o.set(t,64);let u=new Uint8Array(96);return u.set(s,0),u.set(nt(o),64),d.from(nt(u))}, +"digest")}},"update")}}var pr=$(()=>{"use strict";p();rs();ns();a(bu,"randomBytes");a(vu,"createHash"); +a(xu,"createHmac")});var st=T((Gf,dr)=>{"use strict";p();dr.exports={host:"localhost",user:m.platform==="win32"?m.env.USERNAME: m.env.USER,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4, client_encoding:"",ssl:!1,application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1, statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1,connect_timeout:0, -keepalives:1,keepalives_idle:0};var Oe=tt(),xu=Oe.getTypeParser(20,"text"),Su=Oe.getTypeParser(1016, -"text");pr.exports.__defineSetter__("parseInt8",function(r){Oe.setTypeParser(20,"text",r?Oe.getTypeParser( -23,"text"):xu),Oe.setTypeParser(1016,"text",r?Oe.getTypeParser(1007,"text"):Su)})});var st=T((Hf,is)=>{"use strict";p();var Eu=(hr(),O(fr)),Au=it();function Cu(r){var e=r.replace(/\\/g, -"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(Cu,"escapeElement");function ns(r){for(var e="{",t=0;t< -r.length;t++)t>0&&(e=e+","),r[t]===null||typeof r[t]>"u"?e=e+"NULL":Array.isArray(r[t])?e=e+ns(r[t]): -r[t]instanceof d?e+="\\\\x"+r[t].toString("hex"):e+=Cu(Ct(r[t]));return e=e+"}",e}a(ns,"arrayString"); -var Ct=a(function(r,e){if(r==null)return null;if(r instanceof d)return r;if(ArrayBuffer.isView(r)){var t=d. +keepalives:1,keepalives_idle:0};var Oe=rt(),Su=Oe.getTypeParser(20,"text"),Eu=Oe.getTypeParser(1016, +"text");dr.exports.__defineSetter__("parseInt8",function(r){Oe.setTypeParser(20,"text",r?Oe.getTypeParser( +23,"text"):Su),Oe.setTypeParser(1016,"text",r?Oe.getTypeParser(1007,"text"):Eu)})});var ot=T((Vf,ss)=>{"use strict";p();var Au=(pr(),O(hr)),Cu=st();function _u(r){var e=r.replace(/\\/g, +"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(_u,"escapeElement");function is(r){for(var e="{",t=0;t< +r.length;t++)t>0&&(e=e+","),r[t]===null||typeof r[t]>"u"?e=e+"NULL":Array.isArray(r[t])?e=e+is(r[t]): +r[t]instanceof d?e+="\\\\x"+r[t].toString("hex"):e+=_u(_t(r[t]));return e=e+"}",e}a(is,"arrayString"); +var _t=a(function(r,e){if(r==null)return null;if(r instanceof d)return r;if(ArrayBuffer.isView(r)){var t=d. from(r.buffer,r.byteOffset,r.byteLength);return t.length===r.byteLength?t:t.slice(r.byteOffset,r.byteOffset+ -r.byteLength)}return r instanceof Date?Au.parseInputDatesAsUTC?Tu(r):Iu(r):Array.isArray(r)?ns(r):typeof r== -"object"?_u(r,e):r.toString()},"prepareValue");function _u(r,e){if(r&&typeof r.toPostgres=="function"){ +r.byteLength)}return r instanceof Date?Cu.parseInputDatesAsUTC?Pu(r):Tu(r):Array.isArray(r)?is(r):typeof r== +"object"?Iu(r,e):r.toString()},"prepareValue");function Iu(r,e){if(r&&typeof r.toPostgres=="function"){ if(e=e||[],e.indexOf(r)!==-1)throw new Error('circular reference detected while preparing "'+r+'" fo\ -r query');return e.push(r),Ct(r.toPostgres(Ct),e)}return JSON.stringify(r)}a(_u,"prepareObject");function N(r,e){ -for(r=""+r;r.lengthku});var ku,at=G(()=>{"use strict";p();ku={}});var ds=T((nh,ps)=>{"use strict";p();var wr=(hr(),O(fr));function Mu(r){if(r.indexOf("SCRAM-SHA-256")=== --1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=wr.randomBytes( +t),r}a(Ru,"normalizeQueryConfig");var yr=a(function(r){return Au.createHash("md5").update(r,"utf-8"). +digest("hex")},"md5"),Bu=a(function(r,e,t){var n=yr(e+r),i=yr(d.concat([d.from(n),t]));return"md5"+i}, +"postgresMd5PasswordHash");ss.exports={prepareValue:a(function(e){return _t(e)},"prepareValueWrapper"), +normalizeQueryConfig:Ru,postgresMd5PasswordHash:Bu,md5:yr}});var at={};te(at,{default:()=>Mu});var Mu,ut=$(()=>{"use strict";p();Mu={}});var ys=T((ah,ds)=>{"use strict";p();var gr=(pr(),O(hr));function Uu(r){if(r.indexOf("SCRAM-SHA-256")=== +-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=gr.randomBytes( 18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"\ -SASLInitialResponse"}}a(Mu,"startSession");function Uu(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( +SASLInitialResponse"}}a(Uu,"startSession");function Du(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( "SASL: Last message was not SASLInitialResponse");if(typeof e!="string")throw new Error("SASL: SCRAM\ -SERVER-FIRST-MESSAGE: client password must be a string");if(typeof t!="string")throw new Error("SAS\ -L: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=qu(t);if(n.nonce.startsWith(r.clientNonce)){ +L: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=Qu(t);if(n.nonce.startsWith(r.clientNonce)){ if(n.nonce.length===r.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server n\ once is too short")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not st\ -art with client nonce");var i=d.from(n.salt,"base64"),s=Wu(e,i,n.iteration),o=qe(s,"Client Key"),u=Nu( +art with client nonce");var i=d.from(n.salt,"base64"),s=ju(e,i,n.iteration),o=qe(s,"Client Key"),u=Wu( o),c="n=*,r="+r.clientNonce,l="r="+n.nonce+",s="+n.salt+",i="+n.iteration,f="c=biws,r="+n.nonce,y=c+ -","+l+","+f,g=qe(u,y),A=hs(o,g),C=A.toString("base64"),D=qe(s,"Server Key"),Y=qe(D,y);r.message="SAS\ -LResponse",r.serverSignature=Y.toString("base64"),r.response=f+",p="+C}a(Uu,"continueSession");function Du(r,e){ +","+l+","+f,g=qe(u,y),A=ps(o,g),C=A.toString("base64"),D=qe(s,"Server Key"),Y=qe(D,y);r.message="SAS\ +LResponse",r.serverSignature=Y.toString("base64"),r.response=f+",p="+C}a(Du,"continueSession");function Ou(r,e){ if(r.message!=="SASLResponse")throw new Error("SASL: Last message was not SASLResponse");if(typeof e!= -"string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=Qu( +"string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=Nu( e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does\ - not match")}a(Du,"finalizeSession");function Ou(r){if(typeof r!="string")throw new TypeError("SASL:\ + not match")}a(Ou,"finalizeSession");function qu(r){if(typeof r!="string")throw new TypeError("SASL:\ text must be a string");return r.split("").map((e,t)=>r.charCodeAt(t)).every(e=>e>=33&&e<=43||e>=45&& -e<=126)}a(Ou,"isPrintableChars");function ls(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(r)}a(ls,"isBase64");function fs(r){if(typeof r!="string")throw new TypeError("SASL: attribute p\ +e<=126)}a(qu,"isPrintableChars");function fs(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(r)}a(fs,"isBase64");function hs(r){if(typeof r!="string")throw new TypeError("SASL: attribute p\ airs text must be a string");return new Map(r.split(",").map(e=>{if(!/^.=/.test(e))throw new Error("\ -SASL: Invalid attribute pair entry");let t=e[0],n=e.substring(2);return[t,n]}))}a(fs,"parseAttribute\ -Pairs");function qu(r){let e=fs(r),t=e.get("r");if(t){if(!Ou(t))throw new Error("SASL: SCRAM-SERVER-\ +SASL: Invalid attribute pair entry");let t=e[0],n=e.substring(2);return[t,n]}))}a(hs,"parseAttribute\ +Pairs");function Qu(r){let e=hs(r),t=e.get("r");if(t){if(!qu(t))throw new Error("SASL: SCRAM-SERVER-\ FIRST-MESSAGE: nonce must only contain printable characters")}else throw new Error("SASL: SCRAM-SERV\ -ER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!ls(n))throw new Error("SASL: SCRAM-SERV\ +ER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!fs(n))throw new Error("SASL: SCRAM-SERV\ ER-FIRST-MESSAGE: salt must be base64")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt\ missing");let i=e.get("i");if(i){if(!/^[1-9][0-9]*$/.test(i))throw new Error("SASL: SCRAM-SERVER-FI\ RST-MESSAGE: invalid iteration count")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: itera\ -tion missing");let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(qu,"parseServerFirstMessage"); -function Qu(r){let t=fs(r).get("v");if(t){if(!ls(t))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAG\ +tion missing");let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(Qu,"parseServerFirstMessage"); +function Nu(r){let t=hs(r).get("v");if(t){if(!fs(t))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAG\ E: server signature must be base64")}else throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server \ -signature is missing");return{serverSignature:t}}a(Qu,"parseServerFinalMessage");function hs(r,e){if(!d. +signature is missing");return{serverSignature:t}}a(Nu,"parseServerFinalMessage");function ps(r,e){if(!d. isBuffer(r))throw new TypeError("first argument must be a Buffer");if(!d.isBuffer(e))throw new TypeError( "second argument must be a Buffer");if(r.length!==e.length)throw new Error("Buffer lengths must matc\ h");if(r.length===0)throw new Error("Buffers cannot be empty");return d.from(r.map((t,n)=>r[n]^e[n]))} -a(hs,"xorBuffers");function Nu(r){return wr.createHash("sha256").update(r).digest()}a(Nu,"sha256");function qe(r,e){ -return wr.createHmac("sha256",r).update(e).digest()}a(qe,"hmacSha256");function Wu(r,e,t){for(var n=qe( -r,d.concat([e,d.from([0,0,0,1])])),i=n,s=0;sju});function ju(...r){return r.join("/")}var br=G(()=>{"use strict";p();a( -ju,"join")});var vr={};te(vr,{stat:()=>Hu});function Hu(r,e){e(new Error("No filesystem"))}var xr=G(()=>{"use str\ -ict";p();a(Hu,"stat")});var Sr={};te(Sr,{default:()=>$u});var $u,Er=G(()=>{"use strict";p();$u={}});var ys={};te(ys,{StringDecoder:()=>Ar});var Cr,Ar,ms=G(()=>{"use strict";p();Cr=class Cr{constructor(e){ +a(ps,"xorBuffers");function Wu(r){return gr.createHash("sha256").update(r).digest()}a(Wu,"sha256");function qe(r,e){ +return gr.createHmac("sha256",r).update(e).digest()}a(qe,"hmacSha256");function ju(r,e,t){for(var n=qe( +r,d.concat([e,d.from([0,0,0,1])])),i=n,s=0;sHu});function Hu(...r){return r.join("/")}var vr=$(()=>{"use strict";p();a( +Hu,"join")});var xr={};te(xr,{stat:()=>Gu});function Gu(r,e){e(new Error("No filesystem"))}var Sr=$(()=>{"use str\ +ict";p();a(Gu,"stat")});var Er={};te(Er,{default:()=>$u});var $u,Ar=$(()=>{"use strict";p();$u={}});var ms={};te(ms,{StringDecoder:()=>Cr});var _r,Cr,ws=$(()=>{"use strict";p();_r=class _r{constructor(e){ E(this,"td");this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this. -td.decode(e)}};a(Cr,"StringDecoder");Ar=Cr});var vs=T((ph,bs)=>{"use strict";p();var{Transform:Gu}=(Er(),O(Sr)),{StringDecoder:Vu}=(ms(),O(ys)),Se=Symbol( -"last"),It=Symbol("decoder");function zu(r,e,t){let n;if(this.overflow){if(n=this[It].write(r).split( -this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Se]+=this[It].write(r),n= -this[Se].split(this.matcher);this[Se]=n.pop();for(let i=0;i{"use strict";p();var{Transform:Vu}=(Ar(),O(Er)),{StringDecoder:Ku}=(ws(),O(ms)),Se=Symbol( +"last"),Tt=Symbol("decoder");function zu(r,e,t){let n;if(this.overflow){if(n=this[Tt].write(r).split( +this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Se]+=this[Tt].write(r),n= +this[Se].split(this.matcher);this[Se]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( -"maximum buffer reached"));return}t()}a(zu,"transform");function Ku(r){if(this[Se]+=this[It].end(),this[Se]) -try{gs(this,this.mapper(this[Se]))}catch(e){return r(e)}r()}a(Ku,"flush");function gs(r,e){e!==void 0&& -r.push(e)}a(gs,"push");function ws(r){return r}a(ws,"noop");function Yu(r,e,t){switch(r=r||/\r?\n/,e= -e||ws,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r=="object"&&!(r instanceof +"maximum buffer reached"));return}t()}a(zu,"transform");function Yu(r){if(this[Se]+=this[Tt].end(),this[Se]) +try{bs(this,this.mapper(this[Se]))}catch(e){return r(e)}r()}a(Yu,"flush");function bs(r,e){e!==void 0&& +r.push(e)}a(bs,"push");function gs(r){return r}a(gs,"noop");function Zu(r,e,t){switch(r=r||/\r?\n/,e= +e||gs,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r=="object"&&!(r instanceof RegExp)&&!r[Symbol.split]&&(t=r,r=/\r?\n/);break;case 2:typeof r=="function"?(t=e,e=r,r=/\r?\n/):typeof e== -"object"&&(t=e,e=ws)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=zu,t.flush=Ku,t.readableObjectMode= -!0;let n=new Gu(t);return n[Se]="",n[It]=new Vu("utf8"),n.matcher=r,n.mapper=e,n.maxLength=t.maxLength, +"object"&&(t=e,e=gs)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=zu,t.flush=Yu,t.readableObjectMode= +!0;let n=new Vu(t);return n[Se]="",n[Tt]=new Ku("utf8"),n.matcher=r,n.mapper=e,n.maxLength=t.maxLength, n.skipOverflow=t.skipOverflow||!1,n.overflow=!1,n._destroy=function(i,s){this._writableState.errorEmitted= -!1,s(i)},n}a(Yu,"split");bs.exports=Yu});var Es=T((mh,ye)=>{"use strict";p();var xs=(br(),O(gr)),Zu=(Er(),O(Sr)).Stream,Ju=vs(),Ss=(at(),O(ot)), -Xu=5432,Tt=m.platform==="win32",ut=m.stderr,ec=56,tc=7,rc=61440,nc=32768;function ic(r){return(r&rc)== -nc}a(ic,"isRegFile");var Qe=["host","port","database","user","password"],_r=Qe.length,sc=Qe[_r-1];function Ir(){ -var r=ut instanceof Zu&&ut.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` -`);ut.write(Ss.format.apply(Ss,e))}}a(Ir,"warn");Object.defineProperty(ye.exports,"isWin",{get:a(function(){ -return Tt},"get"),set:a(function(r){Tt=r},"set")});ye.exports.warnTo=function(r){var e=ut;return ut= -r,e};ye.exports.getFileName=function(r){var e=r||m.env,t=e.PGPASSFILE||(Tt?xs.join(e.APPDATA||"./","\ -postgresql","pgpass.conf"):xs.join(e.HOME||"./",".pgpass"));return t};ye.exports.usePgPass=function(r,e){ -return Object.prototype.hasOwnProperty.call(m.env,"PGPASSWORD")?!1:Tt?!0:(e=e||"",ic(r.mode)?r. -mode&(ec|tc)?(Ir('WARNING: password file "%s" has group or world access; permissions should be u=rw \ -(0600) or less',e),!1):!0:(Ir('WARNING: password file "%s" is not a plain file',e),!1))};var oc=ye.exports. -match=function(r,e){return Qe.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||Xu)===Number( +!1,s(i)},n}a(Zu,"split");vs.exports=Zu});var As=T((vh,ye)=>{"use strict";p();var Ss=(vr(),O(br)),Ju=(Ar(),O(Er)).Stream,Xu=xs(),Es=(ut(),O(at)), +ec=5432,Pt=m.platform==="win32",ct=m.stderr,tc=56,rc=7,nc=61440,ic=32768;function sc(r){return(r&nc)== +ic}a(sc,"isRegFile");var Qe=["host","port","database","user","password"],Ir=Qe.length,oc=Qe[Ir-1];function Tr(){ +var r=ct instanceof Ju&&ct.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +`);ct.write(Es.format.apply(Es,e))}}a(Tr,"warn");Object.defineProperty(ye.exports,"isWin",{get:a(function(){ +return Pt},"get"),set:a(function(r){Pt=r},"set")});ye.exports.warnTo=function(r){var e=ct;return ct= +r,e};ye.exports.getFileName=function(r){var e=r||m.env,t=e.PGPASSFILE||(Pt?Ss.join(e.APPDATA||"./","\ +postgresql","pgpass.conf"):Ss.join(e.HOME||"./",".pgpass"));return t};ye.exports.usePgPass=function(r,e){ +return Object.prototype.hasOwnProperty.call(m.env,"PGPASSWORD")?!1:Pt?!0:(e=e||"",sc(r.mode)?r. +mode&(tc|rc)?(Tr('WARNING: password file "%s" has group or world access; permissions should be u=rw \ +(0600) or less',e),!1):!0:(Tr('WARNING: password file "%s" is not a plain file',e),!1))};var ac=ye.exports. +match=function(r,e){return Qe.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||ec)===Number( e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};ye.exports.getPassword=function(r,e,t){var n,i=e.pipe( -Ju());function s(c){var l=ac(c);l&&uc(l)&&oc(r,l)&&(n=l[sc],i.end())}a(s,"onLine");var o=a(function(){ -e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),Ir("WARNING: error on reading file: %s",c),t( -void 0)},"onErr");e.on("error",u),i.on("data",s).on("end",o).on("error",u)};var ac=ye.exports.parseLine= +Xu());function s(c){var l=uc(c);l&&cc(l)&&ac(r,l)&&(n=l[oc],i.end())}a(s,"onLine");var o=a(function(){ +e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),Tr("WARNING: error on reading file: %s",c),t( +void 0)},"onErr");e.on("error",u),i.on("data",s).on("end",o).on("error",u)};var uc=ye.exports.parseLine= function(r){if(r.length<11||r.match(/^\s+#/))return null;for(var e="",t="",n=0,i=0,s=0,o={},u=!1,c=a( function(f,y,g){var A=r.substring(y,g);Object.hasOwnProperty.call(m.env,"PGPASS_NO_DEESCAPE")||(A=A. replace(/\\([:\\])/g,"$1")),o[Qe[f]]=A},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). -length===_r?o:null,o},uc=ye.exports.isValidEntry=function(r){for(var e={0:function(o){return o.length> +l),u=n==Ir-1,u){c(n,i);break}l>=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). +length===Ir?o:null,o},cc=ye.exports.isValidEntry=function(r){for(var e={0:function(o){return o.length> 0},1:function(o){return o==="*"?!0:(o=Number(o),isFinite(o)&&o>0&&o<9007199254740992&&Math.floor(o)=== o)},2:function(o){return o.length>0},3:function(o){return o.length>0},4:function(o){return o.length> -0}},t=0;t{"use strict";p();var bh=(br(),O(gr)),As=(xr(),O(vr)),Pt=Es();Tr.exports=function(r,e){ -var t=Pt.getFileName();As.stat(t,function(n,i){if(n||!Pt.usePgPass(i,t))return e(void 0);var s=As.createReadStream( -t);Pt.getPassword(r,s,e)})};Tr.exports.warnTo=Pt.warnTo});var _s={};te(_s,{default:()=>cc});var cc,Is=G(()=>{"use strict";p();cc={}});var Ps=T((Eh,Ts)=>{"use strict";p();var lc=(Jt(),O(bi)),Pr=(xr(),O(vr));function Rr(r){if(r.charAt(0)=== -"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=lc.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i. +0}},t=0;t{"use strict";p();var Eh=(vr(),O(br)),Cs=(Sr(),O(xr)),Rt=As();Pr.exports=function(r,e){ +var t=Rt.getFileName();Cs.stat(t,function(n,i){if(n||!Rt.usePgPass(i,t))return e(void 0);var s=Cs.createReadStream( +t);Rt.getPassword(r,s,e)})};Pr.exports.warnTo=Rt.warnTo});var Is={};te(Is,{default:()=>lc});var lc,Ts=$(()=>{"use strict";p();lc={}});var Rs=T((Ih,Ps)=>{"use strict";p();var fc=(Xt(),O(vi)),Rr=(Sr(),O(xr));function Br(r){if(r.charAt(0)=== +"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=fc.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i. test(r)?encodeURI(r).replace(/\%25(\d\d)/g,"%$1"):r,!0),t=e.query;for(var n in t)Array.isArray(t[n])&& (t[n]=t[n][t[n].length-1]);var i=(e.auth||":").split(":");if(t.user=i[0],t.password=i.splice(1).join( ":"),t.port=e.port,e.protocol=="socket:")return t.host=decodeURI(e.pathname),t.database=e.query.db,t. @@ -756,20 +756,20 @@ client_encoding=e.query.encoding,t;t.host||(t.host=e.hostname);var s=e.pathname; test(s)){var o=s.split("/");t.host=decodeURIComponent(o[0]),s=o.splice(1).join("/")}switch(s&&s.charAt( 0)==="/"&&(s=s.slice(1)||null),t.database=s&&decodeURI(s),(t.ssl==="true"||t.ssl==="1")&&(t.ssl=!0), t.ssl==="0"&&(t.ssl=!1),(t.sslcert||t.sslkey||t.sslrootcert||t.sslmode)&&(t.ssl={}),t.sslcert&&(t.ssl. -cert=Pr.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=Pr.readFileSync(t.sslkey).toString()), -t.sslrootcert&&(t.ssl.ca=Pr.readFileSync(t.sslrootcert).toString()),t.sslmode){case"disable":{t.ssl= +cert=Rr.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=Rr.readFileSync(t.sslkey).toString()), +t.sslrootcert&&(t.ssl.ca=Rr.readFileSync(t.sslrootcert).toString()),t.sslmode){case"disable":{t.ssl= !1;break}case"prefer":case"require":case"verify-ca":case"verify-full":break;case"no-verify":{t.ssl.rejectUnauthorized= -!1;break}}return t}a(Rr,"parse");Ts.exports=Rr;Rr.parse=Rr});var Rt=T((_h,Ls)=>{"use strict";p();var fc=(Is(),O(_s)),Bs=it(),Rs=Ps().parse,H=a(function(r,e,t){return t=== -void 0?t=m.env["PG"+r.toUpperCase()]:t===!1||(t=m.env[t]),e[r]||t||Bs[r]},"val"),hc=a(function(){switch(m. +!1;break}}return t}a(Br,"parse");Ps.exports=Br;Br.parse=Br});var Bt=T((Rh,Fs)=>{"use strict";p();var hc=(Ts(),O(Is)),Ls=st(),Bs=Rs().parse,H=a(function(r,e,t){return t=== +void 0?t=m.env["PG"+r.toUpperCase()]:t===!1||(t=m.env[t]),e[r]||t||Ls[r]},"val"),pc=a(function(){switch(m. env.PGSSLMODE){case"disable":return!1;case"prefer":case"require":case"verify-ca":case"verify-full":return!0;case"\ -no-verify":return{rejectUnauthorized:!1}}return Bs.ssl},"readSSLConfigFromEnvironment"),Ne=a(function(r){ +no-verify":return{rejectUnauthorized:!1}}return Ls.ssl},"readSSLConfigFromEnvironment"),Ne=a(function(r){ return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),ie=a(function(r,e,t){ -var n=e[t];n!=null&&r.push(t+"="+Ne(n))},"add"),Lr=class Lr{constructor(e){e=typeof e=="string"?Rs(e): -e||{},e.connectionString&&(e=Object.assign({},e,Rs(e.connectionString))),this.user=H("user",e),this. +var n=e[t];n!=null&&r.push(t+"="+Ne(n))},"add"),Fr=class Fr{constructor(e){e=typeof e=="string"?Bs(e): +e||{},e.connectionString&&(e=Object.assign({},e,Bs(e.connectionString))),this.user=H("user",e),this. database=H("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(H("por\ t",e),10),this.host=H("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, writable:!0,value:H("password",e)}),this.binary=H("binary",e),this.options=H("options",e),this.ssl=typeof e. -ssl>"u"?hc():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="no-verify"&& +ssl>"u"?pc():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="no-verify"&& (this.ssl={rejectUnauthorized:!1}),this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}), this.client_encoding=H("client_encoding",e),this.replication=H("replication",e),this.isDomainSocket= !(this.host||"").indexOf("/"),this.application_name=H("application_name",e,"PGAPPNAME"),this.fallback_application_name= @@ -785,25 +785,25 @@ ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(ie(t,n,"sslmode"),ie(t, slkey"),ie(t,n,"sslcert"),ie(t,n,"sslrootcert"),this.database&&t.push("dbname="+Ne(this.database)),this. replication&&t.push("replication="+Ne(this.replication)),this.host&&t.push("host="+Ne(this.host)),this. isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+Ne(this.client_encoding)), -fc.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+Ne(s)),e(null,t.join(" ")))})}}; -a(Lr,"ConnectionParameters");var Br=Lr;Ls.exports=Br});var Ms=T((Ph,ks)=>{"use strict";p();var pc=tt(),Fs=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,kr=class kr{constructor(e,t){ +hc.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+Ne(s)),e(null,t.join(" ")))})}}; +a(Fr,"ConnectionParameters");var Lr=Fr;Fs.exports=Lr});var Us=T((Fh,Ms)=>{"use strict";p();var dc=rt(),ks=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,Mr=class Mr{constructor(e,t){ this.command=null,this.rowCount=null,this.oid=null,this.rows=[],this.fields=[],this._parsers=void 0, this._types=t,this.RowCtor=null,this.rowAsArray=e==="array",this.rowAsArray&&(this.parseRow=this._parseRowAsArray)}addCommandComplete(e){ -var t;e.text?t=Fs.exec(e.text):t=Fs.exec(e.command),t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2], +var t;e.text?t=ks.exec(e.text):t=ks.exec(e.command),t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2], 10),this.rowCount=parseInt(t[3],10)):t[2]&&(this.rowCount=parseInt(t[2],10)))}_parseRowAsArray(e){for(var t=new Array( e.length),n=0,i=e.length;n{"use strict";p();var{EventEmitter:dc}=ve(),Us=Ms(),Ds=st(),Ur=class Ur extends dc{constructor(e,t,n){ -super(),e=Ds.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this.rows=e.rows,this. +_types.getTypeParser(n.dataTypeID,n.format||"text"):this._parsers[t]=dc.getTypeParser(n.dataTypeID,n. +format||"text")}}};a(Mr,"Result");var kr=Mr;Ms.exports=kr});var Qs=T((Uh,qs)=>{"use strict";p();var{EventEmitter:yc}=ve(),Ds=Us(),Os=ot(),Dr=class Dr extends yc{constructor(e,t,n){ +super(),e=Os.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this.rows=e.rows,this. types=e.types,this.name=e.name,this.binary=e.binary,this.portal=e.portal||"",this.callback=e.callback, this._rowMode=e.rowMode,m.domain&&e.callback&&(this.callback=m.domain.bind(e.callback)),this._result= -new Us(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError= +new Ds(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError= !1,this._promise=null}requiresPreparation(){return this.name||this.rows?!0:!this.text||!this.values? !1:this.values.length>0}_checkForMultirow(){this._result.command&&(Array.isArray(this._results)||(this. -_results=[this._result]),this._result=new Us(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ +_results=[this._result]),this._result=new Ds(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ this._checkForMultirow(),this._result.addFields(e.fields),this._accumulateRows=this.callback||!this. listeners("row").length}handleDataRow(e){let t;if(!this._canceledDueToError){try{t=this._result.parseRow( e.fields)}catch(n){this._canceledDueToError=n;return}this.emit("row",t,this._result),this._accumulateRows&& @@ -820,10 +820,10 @@ ues must be an array"):(this.requiresPreparation()?this.prepare(e):e.query(this. return this.name&&e.parsedStatements[this.name]}handlePortalSuspended(e){this._getRows(e,this.rows)}_getRows(e,t){ e.execute({portal:this.portal,rows:t}),t?e.flush():e.sync()}prepare(e){this.isPreparedStatement=!0,this. hasBeenParsed(e)||e.parse({text:this.text,name:this.name,types:this.types});try{e.bind({portal:this. -portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:Ds.prepareValue})}catch(t){ +portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:Os.prepareValue})}catch(t){ this.handleError(t,e);return}e.describe({type:"P",name:this.portal||""}),this._getRows(e,this.rows)}handleCopyInResponse(e){ -e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(Ur,"Query");var Mr=Ur;Os.exports= -Mr});var hn=T(_=>{"use strict";p();Object.defineProperty(_,"__esModule",{value:!0});_.NoticeMessage=_.DataRowMessage= +e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(Dr,"Query");var Ur=Dr;qs.exports= +Ur});var pn=T(_=>{"use strict";p();Object.defineProperty(_,"__esModule",{value:!0});_.NoticeMessage=_.DataRowMessage= _.CommandCompleteMessage=_.ReadyForQueryMessage=_.NotificationResponseMessage=_.BackendKeyDataMessage= _.AuthenticationMD5Password=_.ParameterStatusMessage=_.ParameterDescriptionMessage=_.RowDescriptionMessage= _.Field=_.CopyResponse=_.CopyDataMessage=_.DatabaseError=_.copyDone=_.emptyQuery=_.replicationStart= @@ -831,30 +831,30 @@ _.portalSuspended=_.noData=_.closeComplete=_.bindComplete=_.parseComplete=void 0 parseComplete",length:5};_.bindComplete={name:"bindComplete",length:5};_.closeComplete={name:"closeC\ omplete",length:5};_.noData={name:"noData",length:5};_.portalSuspended={name:"portalSuspended",length:5}; _.replicationStart={name:"replicationStart",length:4};_.emptyQuery={name:"emptyQuery",length:4};_.copyDone= -{name:"copyDone",length:4};var Zr=class Zr extends Error{constructor(e,t,n){super(e),this.length=t,this. -name=n}};a(Zr,"DatabaseError");var Dr=Zr;_.DatabaseError=Dr;var Jr=class Jr{constructor(e,t){this.length= -e,this.chunk=t,this.name="copyData"}};a(Jr,"CopyDataMessage");var Or=Jr;_.CopyDataMessage=Or;var Xr=class Xr{constructor(e,t,n,i){ -this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Xr,"CopyResponse");var qr=Xr; -_.CopyResponse=qr;var en=class en{constructor(e,t,n,i,s,o,u){this.name=e,this.tableID=t,this.columnID= -n,this.dataTypeID=i,this.dataTypeSize=s,this.dataTypeModifier=o,this.format=u}};a(en,"Field");var Qr=en; -_.Field=Qr;var tn=class tn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ -n",this.fields=new Array(this.fieldCount)}};a(tn,"RowDescriptionMessage");var Nr=tn;_.RowDescriptionMessage= -Nr;var rn=class rn{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ -ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(rn,"ParameterDescriptionMessage");var Wr=rn; -_.ParameterDescriptionMessage=Wr;var nn=class nn{constructor(e,t,n){this.length=e,this.parameterName= -t,this.parameterValue=n,this.name="parameterStatus"}};a(nn,"ParameterStatusMessage");var jr=nn;_.ParameterStatusMessage= -jr;var sn=class sn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; -a(sn,"AuthenticationMD5Password");var Hr=sn;_.AuthenticationMD5Password=Hr;var on=class on{constructor(e,t,n){ -this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(on,"BackendKeyDataMes\ -sage");var $r=on;_.BackendKeyDataMessage=$r;var an=class an{constructor(e,t,n,i){this.length=e,this. -processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(an,"NotificationResponseMessa\ -ge");var Gr=an;_.NotificationResponseMessage=Gr;var un=class un{constructor(e,t){this.length=e,this. -status=t,this.name="readyForQuery"}};a(un,"ReadyForQueryMessage");var Vr=un;_.ReadyForQueryMessage=Vr; -var cn=class cn{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(cn,"Comma\ -ndCompleteMessage");var zr=cn;_.CommandCompleteMessage=zr;var ln=class ln{constructor(e,t){this.length= -e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(ln,"DataRowMessage");var Kr=ln;_.DataRowMessage= -Kr;var fn=class fn{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(fn,"NoticeMe\ -ssage");var Yr=fn;_.NoticeMessage=Yr});var Qs=T(Bt=>{"use strict";p();Object.defineProperty(Bt,"__esModule",{value:!0});Bt.Writer=void 0;var dn=class dn{constructor(e=256){ +{name:"copyDone",length:4};var Jr=class Jr extends Error{constructor(e,t,n){super(e),this.length=t,this. +name=n}};a(Jr,"DatabaseError");var Or=Jr;_.DatabaseError=Or;var Xr=class Xr{constructor(e,t){this.length= +e,this.chunk=t,this.name="copyData"}};a(Xr,"CopyDataMessage");var qr=Xr;_.CopyDataMessage=qr;var en=class en{constructor(e,t,n,i){ +this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(en,"CopyResponse");var Qr=en; +_.CopyResponse=Qr;var tn=class tn{constructor(e,t,n,i,s,o,u){this.name=e,this.tableID=t,this.columnID= +n,this.dataTypeID=i,this.dataTypeSize=s,this.dataTypeModifier=o,this.format=u}};a(tn,"Field");var Nr=tn; +_.Field=Nr;var rn=class rn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ +n",this.fields=new Array(this.fieldCount)}};a(rn,"RowDescriptionMessage");var Wr=rn;_.RowDescriptionMessage= +Wr;var nn=class nn{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ +ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(nn,"ParameterDescriptionMessage");var jr=nn; +_.ParameterDescriptionMessage=jr;var sn=class sn{constructor(e,t,n){this.length=e,this.parameterName= +t,this.parameterValue=n,this.name="parameterStatus"}};a(sn,"ParameterStatusMessage");var Hr=sn;_.ParameterStatusMessage= +Hr;var on=class on{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; +a(on,"AuthenticationMD5Password");var Gr=on;_.AuthenticationMD5Password=Gr;var an=class an{constructor(e,t,n){ +this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(an,"BackendKeyDataMes\ +sage");var $r=an;_.BackendKeyDataMessage=$r;var un=class un{constructor(e,t,n,i){this.length=e,this. +processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(un,"NotificationResponseMessa\ +ge");var Vr=un;_.NotificationResponseMessage=Vr;var cn=class cn{constructor(e,t){this.length=e,this. +status=t,this.name="readyForQuery"}};a(cn,"ReadyForQueryMessage");var Kr=cn;_.ReadyForQueryMessage=Kr; +var ln=class ln{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(ln,"Comma\ +ndCompleteMessage");var zr=ln;_.CommandCompleteMessage=zr;var fn=class fn{constructor(e,t){this.length= +e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(fn,"DataRowMessage");var Yr=fn;_.DataRowMessage= +Yr;var hn=class hn{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(hn,"NoticeMe\ +ssage");var Zr=hn;_.NoticeMessage=Zr});var Ns=T(Lt=>{"use strict";p();Object.defineProperty(Lt,"__esModule",{value:!0});Lt.Writer=void 0;var yn=class yn{constructor(e=256){ this.size=e,this.offset=5,this.headerPosition=0,this.buffer=d.allocUnsafe(e)}ensure(e){if(this.buffer. length-this.offset>1)+e;this.buffer=d.allocUnsafe(i),n.copy( this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this. @@ -866,48 +866,48 @@ return this.ensure(t),this.buffer.write(e,this.offset),this.offset+=t,this}add(e e.length),e.copy(this.buffer,this.offset),this.offset+=e.length,this}join(e){if(e){this.buffer[this. headerPosition]=e;let t=this.offset-(this.headerPosition+1);this.buffer.writeInt32BE(t,this.headerPosition+ 1)}return this.buffer.slice(e?0:5,this.offset)}flush(e){let t=this.join(e);return this.offset=5,this. -headerPosition=0,this.buffer=d.allocUnsafe(this.size),t}};a(dn,"Writer");var pn=dn;Bt.Writer=pn});var Ws=T(Ft=>{"use strict";p();Object.defineProperty(Ft,"__esModule",{value:!0});Ft.serialize=void 0; -var yn=Qs(),F=new yn.Writer,yc=a(r=>{F.addInt16(3).addInt16(0);for(let n of Object.keys(r))F.addCString( +headerPosition=0,this.buffer=d.allocUnsafe(this.size),t}};a(yn,"Writer");var dn=yn;Lt.Writer=dn});var js=T(kt=>{"use strict";p();Object.defineProperty(kt,"__esModule",{value:!0});kt.serialize=void 0; +var mn=Ns(),F=new mn.Writer,mc=a(r=>{F.addInt16(3).addInt16(0);for(let n of Object.keys(r))F.addCString( n).addCString(r[n]);F.addCString("client_encoding").addCString("UTF8");let e=F.addCString("").flush(), -t=e.length+4;return new yn.Writer().addInt32(t).add(e).flush()},"startup"),mc=a(()=>{let r=d.allocUnsafe( -8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),wc=a(r=>F.addCString(r).flush( -112),"password"),gc=a(function(r,e){return F.addCString(r).addInt32(d.byteLength(e)).addString(e),F. -flush(112)},"sendSASLInitialResponseMessage"),bc=a(function(r){return F.addString(r).flush(112)},"se\ -ndSCRAMClientFinalMessage"),vc=a(r=>F.addCString(r).flush(81),"query"),Ns=[],xc=a(r=>{let e=r.name|| +t=e.length+4;return new mn.Writer().addInt32(t).add(e).flush()},"startup"),wc=a(()=>{let r=d.allocUnsafe( +8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),gc=a(r=>F.addCString(r).flush( +112),"password"),bc=a(function(r,e){return F.addCString(r).addInt32(d.byteLength(e)).addString(e),F. +flush(112)},"sendSASLInitialResponseMessage"),vc=a(function(r){return F.addString(r).flush(112)},"se\ +ndSCRAMClientFinalMessage"),xc=a(r=>F.addCString(r).flush(81),"query"),Ws=[],Sc=a(r=>{let e=r.name|| "";e.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console. error("You supplied %s (%s)",e,e.length),console.error("This can cause conflicts and silent errors e\ -xecuting queries"));let t=r.types||Ns,n=t.length,i=F.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< -n;s++)i.addInt32(t[s]);return F.flush(80)},"parse"),We=new yn.Writer,Sc=a(function(r,e){for(let t=0;t< +xecuting queries"));let t=r.types||Ws,n=t.length,i=F.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< +n;s++)i.addInt32(t[s]);return F.flush(80)},"parse"),We=new mn.Writer,Ec=a(function(r,e){for(let t=0;t< r.length;t++){let n=e?e(r[t],t):r[t];n==null?(F.addInt16(0),We.addInt32(-1)):n instanceof d?(F.addInt16( 1),We.addInt32(n.length),We.add(n)):(F.addInt16(0),We.addInt32(d.byteLength(n)),We.addString(n))}},"\ -writeValues"),Ec=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Ns,s=i.length; -return F.addCString(e).addCString(t),F.addInt16(s),Sc(i,r.valueMapper),F.addInt16(s),F.add(We.flush()), -F.addInt16(n?1:0),F.flush(66)},"bind"),Ac=d.from([69,0,0,0,9,0,0,0,0,0]),Cc=a(r=>{if(!r||!r.portal&& -!r.rows)return Ac;let e=r.portal||"",t=r.rows||0,n=d.byteLength(e),i=4+n+1+4,s=d.allocUnsafe(1+i);return s[0]= -69,s.writeInt32BE(i,1),s.write(e,5,"utf-8"),s[n+5]=0,s.writeUInt32BE(t,s.length-4),s},"execute"),_c=a( +writeValues"),Ac=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Ws,s=i.length; +return F.addCString(e).addCString(t),F.addInt16(s),Ec(i,r.valueMapper),F.addInt16(s),F.add(We.flush()), +F.addInt16(n?1:0),F.flush(66)},"bind"),Cc=d.from([69,0,0,0,9,0,0,0,0,0]),_c=a(r=>{if(!r||!r.portal&& +!r.rows)return Cc;let e=r.portal||"",t=r.rows||0,n=d.byteLength(e),i=4+n+1+4,s=d.allocUnsafe(1+i);return s[0]= +69,s.writeInt32BE(i,1),s.write(e,5,"utf-8"),s[n+5]=0,s.writeUInt32BE(t,s.length-4),s},"execute"),Ic=a( (r,e)=>{let t=d.allocUnsafe(16);return t.writeInt32BE(16,0),t.writeInt16BE(1234,4),t.writeInt16BE(5678, -6),t.writeInt32BE(r,8),t.writeInt32BE(e,12),t},"cancel"),mn=a((r,e)=>{let n=4+d.byteLength(e)+1,i=d. +6),t.writeInt32BE(r,8),t.writeInt32BE(e,12),t},"cancel"),wn=a((r,e)=>{let n=4+d.byteLength(e)+1,i=d. allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i},"cstringMessage"), -Ic=F.addCString("P").flush(68),Tc=F.addCString("S").flush(68),Pc=a(r=>r.name?mn(68,`${r.type}${r.name|| -""}`):r.type==="P"?Ic:Tc,"describe"),Rc=a(r=>{let e=`${r.type}${r.name||""}`;return mn(67,e)},"close"), -Bc=a(r=>F.add(r).flush(100),"copyData"),Lc=a(r=>mn(102,r),"copyFail"),Lt=a(r=>d.from([r,0,0,0,4]),"c\ -odeOnlyBuffer"),Fc=Lt(72),kc=Lt(83),Mc=Lt(88),Uc=Lt(99),Dc={startup:yc,password:wc,requestSsl:mc,sendSASLInitialResponseMessage:gc, -sendSCRAMClientFinalMessage:bc,query:vc,parse:xc,bind:Ec,execute:Cc,describe:Pc,close:Rc,flush:a(()=>Fc, -"flush"),sync:a(()=>kc,"sync"),end:a(()=>Mc,"end"),copyData:Bc,copyDone:a(()=>Uc,"copyDone"),copyFail:Lc, -cancel:_c};Ft.serialize=Dc});var js=T(kt=>{"use strict";p();Object.defineProperty(kt,"__esModule",{value:!0});kt.BufferReader=void 0; -var Oc=d.allocUnsafe(0),gn=class gn{constructor(e=0){this.offset=e,this.buffer=Oc,this.encoding="utf\ +Tc=F.addCString("P").flush(68),Pc=F.addCString("S").flush(68),Rc=a(r=>r.name?wn(68,`${r.type}${r.name|| +""}`):r.type==="P"?Tc:Pc,"describe"),Bc=a(r=>{let e=`${r.type}${r.name||""}`;return wn(67,e)},"close"), +Lc=a(r=>F.add(r).flush(100),"copyData"),Fc=a(r=>wn(102,r),"copyFail"),Ft=a(r=>d.from([r,0,0,0,4]),"c\ +odeOnlyBuffer"),kc=Ft(72),Mc=Ft(83),Uc=Ft(88),Dc=Ft(99),Oc={startup:mc,password:gc,requestSsl:wc,sendSASLInitialResponseMessage:bc, +sendSCRAMClientFinalMessage:vc,query:xc,parse:Sc,bind:Ac,execute:_c,describe:Rc,close:Bc,flush:a(()=>kc, +"flush"),sync:a(()=>Mc,"sync"),end:a(()=>Uc,"end"),copyData:Lc,copyDone:a(()=>Dc,"copyDone"),copyFail:Fc, +cancel:Ic};kt.serialize=Oc});var Hs=T(Mt=>{"use strict";p();Object.defineProperty(Mt,"__esModule",{value:!0});Mt.BufferReader=void 0; +var qc=d.allocUnsafe(0),bn=class bn{constructor(e=0){this.offset=e,this.buffer=qc,this.encoding="utf\ -8"}setBuffer(e,t){this.offset=e,this.buffer=t}int16(){let e=this.buffer.readInt16BE(this.offset);return this. offset+=2,e}byte(){let e=this.buffer[this.offset];return this.offset++,e}int32(){let e=this.buffer.readInt32BE( this.offset);return this.offset+=4,e}uint32(){let e=this.buffer.readUInt32BE(this.offset);return this. offset+=4,e}string(e){let t=this.buffer.toString(this.encoding,this.offset,this.offset+e);return this. offset+=e,t}cstring(){let e=this.offset,t=e;for(;this.buffer[t++]!==0;);return this.offset=t,this.buffer. toString(this.encoding,e,t-1)}bytes(e){let t=this.buffer.slice(this.offset,this.offset+e);return this. -offset+=e,t}};a(gn,"BufferReader");var wn=gn;kt.BufferReader=wn});var Gs=T(Mt=>{"use strict";p();Object.defineProperty(Mt,"__esModule",{value:!0});Mt.Parser=void 0;var k=hn(), -qc=js(),bn=1,Qc=4,Hs=bn+Qc,$s=d.allocUnsafe(0),xn=class xn{constructor(e){if(this.buffer=$s,this.bufferLength= -0,this.bufferOffset=0,this.reader=new qc.BufferReader,e?.mode==="binary")throw new Error("Binary mod\ +offset+=e,t}};a(bn,"BufferReader");var gn=bn;Mt.BufferReader=gn});var Vs=T(Ut=>{"use strict";p();Object.defineProperty(Ut,"__esModule",{value:!0});Ut.Parser=void 0;var k=pn(), +Qc=Hs(),vn=1,Nc=4,Gs=vn+Nc,$s=d.allocUnsafe(0),Sn=class Sn{constructor(e){if(this.buffer=$s,this.bufferLength= +0,this.bufferOffset=0,this.reader=new Qc.BufferReader,e?.mode==="binary")throw new Error("Binary mod\ e not supported yet");this.mode=e?.mode||"text"}parse(e,t){this.mergeBuffer(e);let n=this.bufferOffset+ -this.bufferLength,i=this.bufferOffset;for(;i+Hs<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( -i+bn),u=bn+o;if(u+i<=n){let c=this.handlePacket(i+Hs,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. +this.bufferLength,i=this.bufferOffset;for(;i+Gs<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( +i+vn),u=vn+o;if(u+i<=n){let c=this.handlePacket(i+Gs,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. buffer=$s,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=n-i,this.bufferOffset=i)}mergeBuffer(e){ if(this.bufferLength>0){let t=this.bufferLength+e.byteLength;if(t+this.bufferOffset>this.buffer.byteLength){ let i;if(t<=this.buffer.byteLength&&this.bufferOffset>=this.bufferLength)i=this.buffer;else{let s=this. @@ -954,14 +954,14 @@ o=this.reader.string(1);for(;o!=="\0";)s[o]=this.reader.cstring(),o=this.reader. c=i==="notice"?new k.NoticeMessage(t,u):new k.DatabaseError(u,t,i);return c.severity=s.S,c.code=s.C, c.detail=s.D,c.hint=s.H,c.position=s.P,c.internalPosition=s.p,c.internalQuery=s.q,c.where=s.W,c.schema= s.s,c.table=s.t,c.column=s.c,c.dataType=s.d,c.constraint=s.n,c.file=s.F,c.line=s.L,c.routine=s.R,c}}; -a(xn,"Parser");var vn=xn;Mt.Parser=vn});var Sn=T(Ee=>{"use strict";p();Object.defineProperty(Ee,"__esModule",{value:!0});Ee.DatabaseError=Ee. -serialize=Ee.parse=void 0;var Nc=hn();Object.defineProperty(Ee,"DatabaseError",{enumerable:!0,get:a( -function(){return Nc.DatabaseError},"get")});var Wc=Ws();Object.defineProperty(Ee,"serialize",{enumerable:!0, -get:a(function(){return Wc.serialize},"get")});var jc=Gs();function Hc(r,e){let t=new jc.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(Hc,"parse");Ee.parse=Hc});var Vs={};te(Vs,{connect:()=>$c});function $c({socket:r,servername:e}){return r.startTls(e),r}var zs=G( -()=>{"use strict";p();a($c,"connect")});var Cn=T((tp,Zs)=>{"use strict";p();var Ks=(ke(),O(gi)),Gc=ve().EventEmitter,{parse:Vc,serialize:Q}=Sn(), -Ys=Q.flush(),zc=Q.sync(),Kc=Q.end(),An=class An extends Gc{constructor(e){super(),e=e||{},this.stream= -e.stream||new Ks.Socket,this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis, +a(Sn,"Parser");var xn=Sn;Ut.Parser=xn});var En=T(Ee=>{"use strict";p();Object.defineProperty(Ee,"__esModule",{value:!0});Ee.DatabaseError=Ee. +serialize=Ee.parse=void 0;var Wc=pn();Object.defineProperty(Ee,"DatabaseError",{enumerable:!0,get:a( +function(){return Wc.DatabaseError},"get")});var jc=js();Object.defineProperty(Ee,"serialize",{enumerable:!0, +get:a(function(){return jc.serialize},"get")});var Hc=Vs();function Gc(r,e){let t=new Hc.Parser;return r. +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(Gc,"parse");Ee.parse=Gc});var Ks={};te(Ks,{connect:()=>$c});function $c({socket:r,servername:e}){return r.startTls(e),r}var zs=$( +()=>{"use strict";p();a($c,"connect")});var _n=T((sp,Js)=>{"use strict";p();var Ys=(ke(),O(bi)),Vc=ve().EventEmitter,{parse:Kc,serialize:Q}=En(), +Zs=Q.flush(),zc=Q.sync(),Yc=Q.end(),Cn=class Cn extends Vc{constructor(e){super(),e=e||{},this.stream= +e.stream||new Ys.Socket,this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis, this.lastBuffer=!1,this.parsedStatements={},this.ssl=e.ssl||!1,this._ending=!1,this._emitMessage=!1; var t=this;this.on("newListener",function(n){n==="message"&&(t._emitMessage=!0)})}connect(e,t){var n=this; this._connecting=!0,this.stream.setNoDelay(!0),this.stream.connect(e,t),this.stream.once("connect",function(){ @@ -971,30 +971,30 @@ stream.on("error",i),this.stream.on("close",function(){n.emit("end")}),!this.ssl this.stream);this.stream.once("data",function(s){var o=s.toString("utf8");switch(o){case"S":break;case"\ N":return n.stream.end(),n.emit("error",new Error("The server does not support SSL connections"));default: return n.stream.end(),n.emit("error",new Error("There was an error establishing an SSL connection"))} -var u=(zs(),O(Vs));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= -n.ssl.key)),Ks.isIP(t)===0&&(c.servername=t);try{n.stream=u.connect(c)}catch(l){return n.emit("error", +var u=(zs(),O(Ks));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= +n.ssl.key)),Ys.isIP(t)===0&&(c.servername=t);try{n.stream=u.connect(c)}catch(l){return n.emit("error", l)}n.attachListeners(n.stream),n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){e.on( -"end",()=>{this.emit("end")}),Vc(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& +"end",()=>{this.emit("end")}),Kc(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(Q.requestSsl())}startup(e){this. stream.write(Q.startup(e))}cancel(e,t){this._send(Q.cancel(e,t))}password(e){this._send(Q.password(e))}sendSASLInitialResponseMessage(e,t){ this._send(Q.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(Q.sendSCRAMClientFinalMessage( e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(Q.query(e))}parse(e){ this._send(Q.parse(e))}bind(e){this._send(Q.bind(e))}execute(e){this._send(Q.execute(e))}flush(){this. -stream.writable&&this.stream.write(Ys)}sync(){this._ending=!0,this._send(Ys),this._send(zc)}ref(){this. +stream.writable&&this.stream.write(Zs)}sync(){this._ending=!0,this._send(Zs),this._send(zc)}ref(){this. stream.ref()}unref(){this.stream.unref()}end(){if(this._ending=!0,!this._connecting||!this.stream.writable){ -this.stream.end();return}return this.stream.write(Kc,()=>{this.stream.end()})}close(e){this._send(Q. +this.stream.end();return}return this.stream.write(Yc,()=>{this.stream.end()})}close(e){this._send(Q. close(e))}describe(e){this._send(Q.describe(e))}sendCopyFromChunk(e){this._send(Q.copyData(e))}endCopyFrom(){ -this._send(Q.copyDone())}sendCopyFail(e){this._send(Q.copyFail(e))}};a(An,"Connection");var En=An;Zs. -exports=En});var eo=T((sp,Xs)=>{"use strict";p();var Yc=ve().EventEmitter,ip=(at(),O(ot)),Zc=st(),_n=ds(),Jc=Cs(), -Xc=At(),el=Rt(),Js=qs(),tl=it(),rl=Cn(),In=class In extends Yc{constructor(e){super(),this.connectionParameters= -new el(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database, +this._send(Q.copyDone())}sendCopyFail(e){this._send(Q.copyFail(e))}};a(Cn,"Connection");var An=Cn;Js. +exports=An});var to=T((cp,eo)=>{"use strict";p();var Zc=ve().EventEmitter,up=(ut(),O(at)),Jc=ot(),In=ys(),Xc=_s(), +el=Ct(),tl=Bt(),Xs=Qs(),rl=st(),nl=_n(),Tn=class Tn extends Zc{constructor(e){super(),this.connectionParameters= +new tl(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database, this.port=this.connectionParameters.port,this.host=this.connectionParameters.host,Object.defineProperty( this,"password",{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}), this.replication=this.connectionParameters.replication;var t=e||{};this._Promise=t.Promise||b.Promise, -this._types=new Xc(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= -!1,this._queryable=!0,this.connection=t.connection||new rl({stream:t.stream,ssl:this.connectionParameters. +this._types=new el(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= +!1,this._queryable=!0,this.connection=t.connection||new nl({stream:t.stream,ssl:this.connectionParameters. ssl,keepAlive:t.keepAlive||!1,keepAliveInitialDelayMillis:t.keepAliveInitialDelayMillis||0,encoding:this. -connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t.binary||tl.binary,this. +connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t.binary||rl.binary,this. processID=null,this.secretKey=null,this.ssl=this.connectionParameters.ssl||!1,this.ssl&&this.ssl.key&& Object.defineProperty(this.ssl,"key",{enumerable:!1}),this._connectionTimeoutMillis=t.connectionTimeoutMillis|| 0}_errorAllQueries(e){let t=a(n=>{m.nextTick(()=>{n.handleError(e,this.connection)})},"enqueueError"); @@ -1025,14 +1025,14 @@ bind(this)),e.on("copyData",this._handleCopyData.bind(this)),e.on("notification" bind(this))}_checkPgPass(e){let t=this.connection;typeof this.password=="function"?this._Promise.resolve(). then(()=>this.password()).then(n=>{if(n!==void 0){if(typeof n!="string"){t.emit("error",new TypeError( "Password must be a string"));return}this.connectionParameters.password=this.password=n}else this.connectionParameters. -password=this.password=null;e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():Jc(this.connectionParameters, +password=this.password=null;e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():Xc(this.connectionParameters, n=>{n!==void 0&&(this.connectionParameters.password=this.password=n),e()})}_handleAuthCleartextPassword(e){ this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){this._checkPgPass( -()=>{let t=Zc.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ -this._checkPgPass(()=>{this.saslSession=_n.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( -this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){_n.continueSession( +()=>{let t=Jc.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ +this._checkPgPass(()=>{this.saslSession=In.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( +this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){In.continueSession( this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession. -response)}_handleAuthSASLFinal(e){_n.finalizeSession(this.saslSession,e.data),this.saslSession=null}_handleBackendKeyData(e){ +response)}_handleAuthSASLFinal(e){In.finalizeSession(this.saslSession,e.data),this.saslSession=null}_handleBackendKeyData(e){ this.processID=e.processID,this.secretKey=e.secretKey}_handleReadyForQuery(e){this._connecting&&(this. _connecting=!1,this._connected=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback&& (this._connectionCallback(null,this),this._connectionCallback=null),this.emit("connect"));let{activeQuery:t}=this; @@ -1066,7 +1066,7 @@ handleError(e,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}e (this.activeQuery=null,this.emit("drain"))}query(e,t,n){var i,s,o,u,c;if(e==null)throw new TypeError( "Client was passed a null or undefined query");return typeof e.submit=="function"?(o=e.query_timeout|| this.connectionParameters.query_timeout,s=i=e,typeof t=="function"&&(i.callback=i.callback||t)):(o=this. -connectionParameters.query_timeout,i=new Js(e,t,n),i.callback||(s=new this._Promise((l,f)=>{i.callback= +connectionParameters.query_timeout,i=new Xs(e,t,n),i.callback||(s=new this._Promise((l,f)=>{i.callback= (y,g)=>y?f(y):l(g)}))),o&&(c=i.callback,u=setTimeout(()=>{var l=new Error("Query read timeout");m.nextTick( ()=>{i.handleError(l,this.connection)}),c(l),i.callback=()=>{};var f=this.queryQueue.indexOf(i);f>-1&& this.queryQueue.splice(f,1),this._pulseQueryQueue()},o),i.callback=(l,f)=>{clearTimeout(u),c(l,f)}), @@ -1077,22 +1077,22 @@ handleError(new Error("Client has encountered a connection error and is not quer s)}ref(){this.connection.ref()}unref(){this.connection.unref()}end(e){if(this._ending=!0,!this.connection. _connecting)if(e)e();else return this._Promise.resolve();if(this.activeQuery||!this._queryable?this. connection.stream.destroy():this.connection.end(),e)this.connection.once("end",e);else return new this. -_Promise(t=>{this.connection.once("end",t)})}};a(In,"Client");var Ut=In;Ut.Query=Js;Xs.exports=Ut});var io=T((up,no)=>{"use strict";p();var nl=ve().EventEmitter,to=a(function(){},"NOOP"),ro=a((r,e)=>{ -let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),Rn=class Rn{constructor(e,t,n){ -this.client=e,this.idleListener=t,this.timeoutId=n}};a(Rn,"IdleItem");var Tn=Rn,Bn=class Bn{constructor(e){ -this.callback=e}};a(Bn,"PendingItem");var je=Bn;function il(){throw new Error("Release called on cli\ -ent which has already been released to the pool.")}a(il,"throwOnDoubleRelease");function Dt(r,e){if(e) +_Promise(t=>{this.connection.once("end",t)})}};a(Tn,"Client");var Dt=Tn;Dt.Query=Xs;eo.exports=Dt});var so=T((hp,io)=>{"use strict";p();var il=ve().EventEmitter,ro=a(function(){},"NOOP"),no=a((r,e)=>{ +let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),Bn=class Bn{constructor(e,t,n){ +this.client=e,this.idleListener=t,this.timeoutId=n}};a(Bn,"IdleItem");var Pn=Bn,Ln=class Ln{constructor(e){ +this.callback=e}};a(Ln,"PendingItem");var je=Ln;function sl(){throw new Error("Release called on cli\ +ent which has already been released to the pool.")}a(sl,"throwOnDoubleRelease");function Ot(r,e){if(e) return{callback:e,result:void 0};let t,n,i=a(function(o,u){o?t(o):n(u)},"cb"),s=new r(function(o,u){ -n=o,t=u}).catch(o=>{throw Error.captureStackTrace(o),o});return{callback:i,result:s}}a(Dt,"promisify"); -function sl(r,e){return a(function t(n){n.client=e,e.removeListener("error",t),e.on("error",()=>{r.log( +n=o,t=u}).catch(o=>{throw Error.captureStackTrace(o),o});return{callback:i,result:s}}a(Ot,"promisify"); +function ol(r,e){return a(function t(n){n.client=e,e.removeListener("error",t),e.on("error",()=>{r.log( "additional client error after disconnection due to error",n)}),r._remove(e),r.emit("error",n,e)},"i\ -dleListener")}a(sl,"makeIdleListener");var Ln=class Ln extends nl{constructor(e,t){super(),this.options= +dleListener")}a(ol,"makeIdleListener");var Fn=class Fn extends il{constructor(e,t){super(),this.options= Object.assign({},e),e!=null&&"password"in e&&Object.defineProperty(this.options,"password",{configurable:!0, enumerable:!1,writable:!0,value:e.password}),e!=null&&e.ssl&&e.ssl.key&&Object.defineProperty(this.options. ssl,"key",{enumerable:!1}),this.options.max=this.options.max||this.options.poolSize||10,this.options. min=this.options.min||0,this.options.maxUses=this.options.maxUses||1/0,this.options.allowExitOnIdle= this.options.allowExitOnIdle||!1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0, -this.log=this.options.log||function(){},this.Client=this.options.Client||t||ct().Client,this.Promise= +this.log=this.options.log||function(){},this.Client=this.options.Client||t||lt().Client,this.Promise= this.options.Promise||b.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this.options.idleTimeoutMillis= 1e4),this._clients=[],this._idle=[],this._expired=new WeakSet,this._pendingQueue=[],this._endCallback= void 0,this.ending=!1,this.ended=!1}_isFull(){return this._clients.length>=this.options.max}_isAboveMin(){ @@ -1102,47 +1102,47 @@ this._idle.slice().map(t=>{this._remove(t.client)}),this._clients.length||(this. return}if(!this._pendingQueue.length){this.log("no queued requests");return}if(!this._idle.length&&this. _isFull())return;let e=this._pendingQueue.shift();if(this._idle.length){let t=this._idle.pop();clearTimeout( t.timeoutId);let n=t.client;n.ref&&n.ref();let i=t.idleListener;return this._acquireClient(n,e,i,!1)} -if(!this._isFull())return this.newClient(e);throw new Error("unexpected condition")}_remove(e){let t=ro( +if(!this._isFull())return this.newClient(e);throw new Error("unexpected condition")}_remove(e){let t=no( this._idle,n=>n.client===e);t!==void 0&&clearTimeout(t.timeoutId),this._clients=this._clients.filter( n=>n!==e),e.end(),this.emit("remove",e)}connect(e){if(this.ending){let i=new Error("Cannot use a poo\ -l after calling end on the pool");return e?e(i):this.Promise.reject(i)}let t=Dt(this.Promise,e),n=t. +l after calling end on the pool");return e?e(i):this.Promise.reject(i)}let t=Ot(this.Promise,e),n=t. result;if(this._isFull()||this._idle.length){if(this._idle.length&&m.nextTick(()=>this._pulseQueue()), !this.options.connectionTimeoutMillis)return this._pendingQueue.push(new je(t.callback)),n;let i=a((u,c,l)=>{ -clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new je(i),o=setTimeout(()=>{ro(this._pendingQueue, +clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new je(i),o=setTimeout(()=>{no(this._pendingQueue, u=>u.callback===i),s.timedOut=!0,t.callback(new Error("timeout exceeded when trying to connect"))},this. options.connectionTimeoutMillis);return o.unref&&o.unref(),this._pendingQueue.push(s),n}return this. newClient(new je(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( -t);let n=sl(this,t);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&& +t);let n=ol(this,t);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&& (i=setTimeout(()=>{this.log("ending client due to timeout"),s=!0,t.connection?t.connection.stream.destroy(): t.end()},this.options.connectionTimeoutMillis)),this.log("connecting new client"),t.connect(o=>{if(i&& clearTimeout(i),t.on("error",n),o)this.log("client failed to connect",o),this._clients=this._clients. filter(u=>u!==t),s&&(o=new Error("Connection terminated due to connection timeout",{cause:o})),this. -_pulseQueue(),e.timedOut||e.callback(o,void 0,to);else{if(this.log("new client connected"),this.options. +_pulseQueue(),e.timedOut||e.callback(o,void 0,ro);else{if(this.log("new client connected"),this.options. maxLifetimeSeconds!==0){let u=setTimeout(()=>{this.log("ending client due to expired lifetime"),this. _expired.add(t),this._idle.findIndex(l=>l.client===t)!==-1&&this._acquireClient(t,new je((l,f,y)=>y()), n,!1)},this.options.maxLifetimeSeconds*1e3);u.unref(),t.once("end",()=>clearTimeout(u))}return this. _acquireClient(t,e,n,!0)}})}_acquireClient(e,t,n,i){i&&this.emit("connect",e),this.emit("acquire",e), e.release=this._releaseOnce(e,n),e.removeListener("error",n),t.timedOut?i&&this.options.verify?this. options.verify(e,e.release):e.release():i&&this.options.verify?this.options.verify(e,s=>{if(s)return e. -release(s),t.callback(s,void 0,to);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ -let n=!1;return i=>{n&&il(),n=!0,this._release(e,t,i)}}_release(e,t,n){if(e.on("error",t),e._poolUseCount= +release(s),t.callback(s,void 0,ro);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ +let n=!1;return i=>{n&&sl(),n=!0,this._release(e,t,i)}}_release(e,t,n){if(e.on("error",t),e._poolUseCount= (e._poolUseCount||0)+1,this.emit("release",n,e),n||this.ending||!e._queryable||e._ending||e._poolUseCount>= this.options.maxUses){e._poolUseCount>=this.options.maxUses&&this.log("remove expended client"),this. _remove(e),this._pulseQueue();return}if(this._expired.has(e)){this.log("remove expired client"),this. _expired.delete(e),this._remove(e),this._pulseQueue();return}let s;this.options.idleTimeoutMillis&&this. _isAboveMin()&&(s=setTimeout(()=>{this.log("remove idle client"),this._remove(e)},this.options.idleTimeoutMillis), -this.options.allowExitOnIdle&&s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new Tn( -e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=Dt(this.Promise,e);return v(function(){ +this.options.allowExitOnIdle&&s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new Pn( +e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=Ot(this.Promise,e);return v(function(){ return s.callback(new Error("Passing a function as the first parameter to pool.query is not supporte\ -d"))}),s.result}typeof t=="function"&&(n=t,t=void 0);let i=Dt(this.Promise,n);return n=i.callback,this. +d"))}),s.result}typeof t=="function"&&(n=t,t=void 0);let i=Ot(this.Promise,n);return n=i.callback,this. connect((s,o)=>{if(s)return n(s);let u=!1,c=a(l=>{u||(u=!0,o.release(l),n(l))},"onError");o.once("er\ ror",c),this.log("dispatching query");try{o.query(e,t,(l,f)=>{if(this.log("query dispatched"),o.removeListener( "error",c),!u)return u=!0,o.release(l),l?n(l):n(void 0,f)})}catch(l){return o.release(l),n(l)}}),i.result}end(e){ if(this.log("ending"),this.ending){let n=new Error("Called end on pool more than once");return e?e(n): -this.Promise.reject(n)}this.ending=!0;let t=Dt(this.Promise,e);return this._endCallback=t.callback,this. +this.Promise.reject(n)}this.ending=!0;let t=Ot(this.Promise,e);return this._endCallback=t.callback,this. _pulseQueue(),t.result}get waitingCount(){return this._pendingQueue.length}get idleCount(){return this. _idle.length}get expiredCount(){return this._clients.reduce((e,t)=>e+(this._expired.has(t)?1:0),0)}get totalCount(){ -return this._clients.length}};a(Ln,"Pool");var Pn=Ln;no.exports=Pn});var so={};te(so,{default:()=>ol});var ol,oo=G(()=>{"use strict";p();ol={}});var ao=T((hp,al)=>{al.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javas\ +return this._clients.length}};a(Fn,"Pool");var Rn=Fn;io.exports=Rn});var oo={};te(oo,{default:()=>al});var al,ao=$(()=>{"use strict";p();al={}});var uo=T((mp,ul)=>{ul.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javas\ cript & libpq with the same API",keywords:["database","libpq","pg","postgre","postgres","postgresql", "rdbms"],homepage:"https://github.com/brianc/node-postgres",repository:{type:"git",url:"git://github\ .com/brianc/node-postgres.git",directory:"packages/pg"},author:"Brian Carlson =3.0.1"},peerDependenciesMeta:{"pg-native":{optional:!0}},scripts:{test:"make test-all"},files:["li\ b","SPONSORS.md"],license:"MIT",engines:{node:">= 8.0.0"},gitHead:"c99fb2c127ddf8d712500db2c7b9a5491\ -a178655"}});var lo=T((pp,co)=>{"use strict";p();var uo=ve().EventEmitter,ul=(at(),O(ot)),Fn=st(),He=co.exports=function(r,e,t){ -uo.call(this),r=Fn.normalizeQueryConfig(r,e,t),this.text=r.text,this.values=r.values,this.name=r.name, +a178655"}});var fo=T((wp,lo)=>{"use strict";p();var co=ve().EventEmitter,cl=(ut(),O(at)),kn=ot(),He=lo.exports=function(r,e,t){ +co.call(this),r=kn.normalizeQueryConfig(r,e,t),this.text=r.text,this.values=r.values,this.name=r.name, this.callback=r.callback,this.state="new",this._arrayMode=r.rowMode==="array",this._emitRowEvents=!1, -this.on("newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};ul.inherits(He,uo); -var cl={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ +this.on("newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};cl.inherits(He,co); +var ll={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"\ file",sourceLine:"line",sourceFunction:"routine"};He.prototype.handleError=function(r){var e=this.native. -pq.resultErrorFields();if(e)for(var t in e){var n=cl[t]||t;r[n]=e[t]}this.callback?this.callback(r): +pq.resultErrorFields();if(e)for(var t in e){var n=ll[t]||t;r[n]=e[t]}this.callback?this.callback(r): this.emit("error",r),this.state="error"};He.prototype.then=function(r,e){return this._getPromise().then( r,e)};He.prototype.catch=function(r){return this._getPromise().catch(r)};He.prototype._getPromise=function(){ return this._promise?this._promise:(this._promise=new Promise(function(r,e){this._once("end",r),this. @@ -1169,80 +1169,80 @@ this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a(function(s,o,u){ nd",e.emit("end",u),e.callback&&e.callback(null,u)},"after");if(m.domain&&(t=m.domain.bind(t)),this. name){this.name.length>63&&(console.error("Warning! Postgres only supports 63 characters for query n\ ames."),console.error("You supplied %s (%s)",this.name,this.name.length),console.error("This can cau\ -se conflicts and silent errors executing queries"));var n=(this.values||[]).map(Fn.prepareValue);if(r. +se conflicts and silent errors executing queries"));var n=(this.values||[]).map(kn.prepareValue);if(r. namedQueries[this.name]){if(this.text&&r.namedQueries[this.name]!==this.text){let s=new Error(`Prepa\ red statements must be unique - '${this.name}' was used for a different statement`);return t(s)}return r. native.execute(this.name,n,t)}return r.native.prepare(this.name,this.text,n.length,function(s){return s? t(s):(r.namedQueries[e.name]=e.text,e.native.execute(e.name,n,t))})}else if(this.values){if(!Array.isArray( -this.values)){let s=new Error("Query values must be an array");return t(s)}var i=this.values.map(Fn. -prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var yo=T((wp,po)=>{"use strict";p();var ll=(oo(),O(so)),fl=At(),mp=ao(),fo=ve().EventEmitter,hl=(at(),O(ot)), -pl=Rt(),ho=lo(),K=po.exports=function(r){fo.call(this),r=r||{},this._Promise=r.Promise||b.Promise,this. -_types=new fl(r.types),this.native=new ll({types:this._types}),this._queryQueue=[],this._ending=!1,this. -_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new pl(r);this. +this.values)){let s=new Error("Query values must be an array");return t(s)}var i=this.values.map(kn. +prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var mo=T((xp,yo)=>{"use strict";p();var fl=(ao(),O(oo)),hl=Ct(),vp=uo(),ho=ve().EventEmitter,pl=(ut(),O(at)), +dl=Bt(),po=fo(),z=yo.exports=function(r){ho.call(this),r=r||{},this._Promise=r.Promise||b.Promise,this. +_types=new hl(r.types),this.native=new fl({types:this._types}),this._queryQueue=[],this._ending=!1,this. +_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new dl(r);this. user=e.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:e. -password}),this.database=e.database,this.host=e.host,this.port=e.port,this.namedQueries={}};K.Query= -ho;hl.inherits(K,fo);K.prototype._errorAllQueries=function(r){let e=a(t=>{m.nextTick(()=>{t.native=this. +password}),this.database=e.database,this.host=e.host,this.port=e.port,this.namedQueries={}};z.Query= +po;pl.inherits(z,ho);z.prototype._errorAllQueries=function(r){let e=a(t=>{m.nextTick(()=>{t.native=this. native,t.handleError(r)})},"enqueueError");this._hasActiveQuery()&&(e(this._activeQuery),this._activeQuery= -null),this._queryQueue.forEach(e),this._queryQueue.length=0};K.prototype._connect=function(r){var e=this; +null),this._queryQueue.forEach(e),this._queryQueue.length=0};z.prototype._connect=function(r){var e=this; if(this._connecting){m.nextTick(()=>r(new Error("Client has already been connected. You cannot reuse\ a client.")));return}this._connecting=!0,this.connectionParameters.getLibpqConnectionString(function(t,n){ if(t)return r(t);e.native.connect(n,function(i){if(i)return e.native.end(),r(i);e._connected=!0,e.native. on("error",function(s){e._queryable=!1,e._errorAllQueries(s),e.emit("error",s)}),e.native.on("notifi\ cation",function(s){e.emit("notification",{channel:s.relname,payload:s.extra})}),e.emit("connect"),e. -_pulseQueryQueue(!0),r()})})};K.prototype.connect=function(r){if(r){this._connect(r);return}return new this. -_Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};K.prototype.query=function(r,e,t){var n,i,s,o,u;if(r== +_pulseQueryQueue(!0),r()})})};z.prototype.connect=function(r){if(r){this._connect(r);return}return new this. +_Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};z.prototype.query=function(r,e,t){var n,i,s,o,u;if(r== null)throw new TypeError("Client was passed a null or undefined query");if(typeof r.submit=="functio\ n")s=r.query_timeout||this.connectionParameters.query_timeout,i=n=r,typeof e=="function"&&(r.callback= -e);else if(s=this.connectionParameters.query_timeout,n=new ho(r,e,t),!n.callback){let c,l;i=new this. +e);else if(s=this.connectionParameters.query_timeout,n=new po(r,e,t),!n.callback){let c,l;i=new this. _Promise((f,y)=>{c=f,l=y}),n.callback=(f,y)=>f?l(f):c(y)}return s&&(u=n.callback,o=setTimeout(()=>{var c=new Error( "Query read timeout");m.nextTick(()=>{n.handleError(c,this.connection)}),u(c),n.callback=()=>{};var l=this. _queryQueue.indexOf(n);l>-1&&this._queryQueue.splice(l,1),this._pulseQueryQueue()},s),n.callback=(c,l)=>{ clearTimeout(o),u(c,l)}),this._queryable?this._ending?(n.native=this.native,m.nextTick(()=>{n.handleError( new Error("Client was closed and is not queryable"))}),i):(this._queryQueue.push(n),this._pulseQueryQueue(), i):(n.native=this.native,m.nextTick(()=>{n.handleError(new Error("Client has encountered a connectio\ -n error and is not queryable"))}),i)};K.prototype.end=function(r){var e=this;this._ending=!0,this._connected|| +n error and is not queryable"))}),i)};z.prototype.end=function(r){var e=this;this._ending=!0,this._connected|| this.once("connect",this.end.bind(this,r));var t;return r||(t=new this._Promise(function(n,i){r=a(s=>s? i(s):n(),"cb")})),this.native.end(function(){e._errorAllQueries(new Error("Connection terminated")), -m.nextTick(()=>{e.emit("end"),r&&r()})}),t};K.prototype._hasActiveQuery=function(){return this._activeQuery&& -this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};K.prototype._pulseQueryQueue=function(r){ +m.nextTick(()=>{e.emit("end"),r&&r()})}),t};z.prototype._hasActiveQuery=function(){return this._activeQuery&& +this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};z.prototype._pulseQueryQueue=function(r){ if(this._connected&&!this._hasActiveQuery()){var e=this._queryQueue.shift();if(!e){r||this.emit("dra\ in");return}this._activeQuery=e,e.submit(this);var t=this;e.once("_done",function(){t._pulseQueryQueue()})}}; -K.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. -indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};K.prototype.ref=function(){}; -K.prototype.unref=function(){};K.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( -r,e,t)};K.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var kn=T((vp,mo)=>{"use strict";p();mo.exports=yo()});var ct=T((Sp,lt)=>{"use strict";p();var dl=eo(),yl=it(),ml=Cn(),wl=io(),{DatabaseError:gl}=Sn(),bl=a( -r=>{var e;return e=class extends wl{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),Mn=a( -function(r){this.defaults=yl,this.Client=r,this.Query=this.Client.Query,this.Pool=bl(this.Client),this. -_pools=[],this.Connection=ml,this.types=tt(),this.DatabaseError=gl},"PG");typeof m.env.NODE_PG_FORCE_NATIVE< -"u"?lt.exports=new Mn(kn()):(lt.exports=new Mn(dl),Object.defineProperty(lt.exports,"native",{configurable:!0, -enumerable:!1,get(){var r=null;try{r=new Mn(kn())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. -defineProperty(lt.exports,"native",{value:r}),r}}))});var Sl={};te(Sl,{Client:()=>$e,DatabaseError:()=>le.DatabaseError,NeonDbError:()=>de,NeonQueryPromise:()=>xe, -Pool:()=>Ot,SqlTemplate:()=>Me,UnsafeRawSql:()=>Ue,_bundleExt:()=>xl,defaults:()=>le.defaults,escapeIdentifier:()=>le.escapeIdentifier, -escapeLiteral:()=>le.escapeLiteral,neon:()=>yr,neonConfig:()=>se,types:()=>le.types,warnIfBrowser:()=>Ke}); -module.exports=O(Sl);p();p();ke();Jt();p();var pa=Object.defineProperty,da=Object.defineProperties,ya=Object.getOwnPropertyDescriptors,vi=Object. -getOwnPropertySymbols,ma=Object.prototype.hasOwnProperty,wa=Object.prototype.propertyIsEnumerable,xi=a( -(r,e,t)=>e in r?pa(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), -ga=a((r,e)=>{for(var t in e||(e={}))ma.call(e,t)&&xi(r,t,e[t]);if(vi)for(var t of vi(e))wa.call(e,t)&& -xi(r,t,e[t]);return r},"__spreadValues"),ba=a((r,e)=>da(r,ya(e)),"__spreadProps"),va=1008e3,Si=new Uint8Array( -new Uint16Array([258]).buffer)[0]===2,xa=new TextDecoder,Xt=new TextEncoder,mt=Xt.encode("0123456789\ -abcdef"),wt=Xt.encode("0123456789ABCDEF"),Sa=Xt.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ -stuvwxyz0123456789+/");var Ei=Sa.slice();Ei[62]=45;Ei[63]=95;var ze,gt;function Ea(r,{alphabet:e,scratchArr:t}={}){if(!ze)if(ze= -new Uint16Array(256),gt=new Uint16Array(256),Si)for(let C=0;C<256;C++)ze[C]=mt[C&15]<<8|mt[C>>>4],gt[C]= -wt[C&15]<<8|wt[C>>>4];else for(let C=0;C<256;C++)ze[C]=mt[C&15]|mt[C>>>4]<<8,gt[C]=wt[C&15]|wt[C>>>4]<< +z.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. +indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};z.prototype.ref=function(){}; +z.prototype.unref=function(){};z.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( +r,e,t)};z.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var Mn=T((Ap,wo)=>{"use strict";p();wo.exports=mo()});var lt=T((_p,ft)=>{"use strict";p();var yl=to(),ml=st(),wl=_n(),gl=so(),{DatabaseError:bl}=En(),vl=a( +r=>{var e;return e=class extends gl{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),Un=a( +function(r){this.defaults=ml,this.Client=r,this.Query=this.Client.Query,this.Pool=vl(this.Client),this. +_pools=[],this.Connection=wl,this.types=rt(),this.DatabaseError=bl},"PG");typeof m.env.NODE_PG_FORCE_NATIVE< +"u"?ft.exports=new Un(Mn()):(ft.exports=new Un(yl),Object.defineProperty(ft.exports,"native",{configurable:!0, +enumerable:!1,get(){var r=null;try{r=new Un(Mn())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. +defineProperty(ft.exports,"native",{value:r}),r}}))});var El={};te(El,{Client:()=>Ge,DatabaseError:()=>le.DatabaseError,NeonDbError:()=>de,NeonQueryPromise:()=>xe, +Pool:()=>qt,SqlTemplate:()=>Me,UnsafeRawSql:()=>Ue,_bundleExt:()=>Sl,defaults:()=>le.defaults,escapeIdentifier:()=>le.escapeIdentifier, +escapeLiteral:()=>le.escapeLiteral,neon:()=>mr,neonConfig:()=>se,types:()=>le.types,warnIfBrowser:()=>ze}); +module.exports=O(El);p();p();ke();Xt();p();var da=Object.defineProperty,ya=Object.defineProperties,ma=Object.getOwnPropertyDescriptors,xi=Object. +getOwnPropertySymbols,wa=Object.prototype.hasOwnProperty,ga=Object.prototype.propertyIsEnumerable,Si=a( +(r,e,t)=>e in r?da(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), +ba=a((r,e)=>{for(var t in e||(e={}))wa.call(e,t)&&Si(r,t,e[t]);if(xi)for(var t of xi(e))ga.call(e,t)&& +Si(r,t,e[t]);return r},"__spreadValues"),va=a((r,e)=>ya(r,ma(e)),"__spreadProps"),xa=1008e3,Ei=new Uint8Array( +new Uint16Array([258]).buffer)[0]===2,Sa=new TextDecoder,er=new TextEncoder,wt=er.encode("0123456789\ +abcdef"),gt=er.encode("0123456789ABCDEF"),Ea=er.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ +stuvwxyz0123456789+/");var Ai=Ea.slice();Ai[62]=45;Ai[63]=95;var Ke,bt;function Aa(r,{alphabet:e,scratchArr:t}={}){if(!Ke)if(Ke= +new Uint16Array(256),bt=new Uint16Array(256),Ei)for(let C=0;C<256;C++)Ke[C]=wt[C&15]<<8|wt[C>>>4],bt[C]= +gt[C&15]<<8|gt[C>>>4];else for(let C=0;C<256;C++)Ke[C]=wt[C&15]|wt[C>>>4]<<8,bt[C]=gt[C&15]|gt[C>>>4]<< 8;r.byteOffset%4!==0&&(r=new Uint8Array(r));let n=r.length,i=n>>>1,s=n>>>2,o=t||new Uint16Array(n),u=new Uint32Array( -r.buffer,r.byteOffset,s),c=new Uint32Array(o.buffer,o.byteOffset,i),l=e==="upper"?gt:ze,f=0,y=0,g;if(Si) +r.buffer,r.byteOffset,s),c=new Uint32Array(o.buffer,o.byteOffset,i),l=e==="upper"?bt:Ke,f=0,y=0,g;if(Ei) for(;f>>8&255]<<16|l[g&255],c[y++]=l[g>>>24]<<16|l[g>>>16&255];else for(;f>>24]<<16|l[g>>>16&255],c[y++]=l[g>>>8&255]<<16|l[g&255];for(f<<=2;f>>1,s=Math. -ceil(n/i),o=new Uint16Array(s>1?i:n);for(let u=0;u>>1,s=Math. +ceil(n/i),o=new Uint16Array(s>1?i:n);for(let u=0;uLu((0,cs.prepareValue)(n)))}}a(os,"prep\ -areQuery");function yr(r,{arrayMode:e,fullResults:t,fetchOptions:n,isolationLevel:i,readOnly:s,deferrable:o, +tackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,It)}};a( +It,"NeonDbError");var de=It,os="transaction() expects an array of queries, or a function returning a\ +n array of queries",Lu=["severity","code","detail","hint","position","internalPosition","internalQue\ +ry","where","schema","table","column","dataType","constraint","file","line","routine"];function Fu(r){ +return r instanceof d?"\\x"+Ci(r):r}a(Fu,"encodeBuffersAsBytea");function as(r){let{query:e,params:t}=r instanceof +Me?r.toParameterizedQuery():r;return{query:e,params:t.map(n=>Fu((0,ls.prepareValue)(n)))}}a(as,"prep\ +areQuery");function mr(r,{arrayMode:e,fullResults:t,fetchOptions:n,isolationLevel:i,readOnly:s,deferrable:o, authToken:u,disableWarningInBrowsers:c}={}){if(!r)throw new Error("No database connection string was\ - provided to `neon()`. Perhaps an environment variable has not been set?");let l;try{l=Zt(r)}catch{throw new Error( + provided to `neon()`. Perhaps an environment variable has not been set?");let l;try{l=Jt(r)}catch{throw new Error( "Database connection string provided to `neon()` is not a valid URL. Connection string: "+String(r))} let{protocol:f,username:y,hostname:g,port:A,pathname:C}=l;if(f!=="postgres:"&&f!=="postgresql:"||!y|| !g||!C)throw new Error("Database connection string format for `neon()` should be: postgresql://user:\ @@ -1279,84 +1279,85 @@ Array.isArray(I)))throw new Error('This function can now be called only as a tag n: sql`SELECT ${value}`, not sql("SELECT $1", [value], options). For a conventional function call wi\ th value placeholders ($1, $2, etc.), use sql.query("SELECT $1", [value], options).');return new xe( Y,new Me(P,I))}a(D,"templateFn"),D.query=(P,I,w)=>new xe(Y,{query:P,params:I??[]},w),D.unsafe=P=>new Ue( -P),D.transaction=async(P,I)=>{if(typeof P=="function"&&(P=P(D)),!Array.isArray(P))throw new Error(ss); -P.forEach(W=>{if(!(W instanceof xe))throw new Error(ss)});let w=P.map(W=>W.queryData),Z=P.map(W=>W.opts?? +P),D.transaction=async(P,I)=>{if(typeof P=="function"&&(P=P(D)),!Array.isArray(P))throw new Error(os); +P.forEach(W=>{if(!(W instanceof xe))throw new Error(os)});let w=P.map(W=>W.queryData),Z=P.map(W=>W.opts?? {});return Y(w,Z,I)};async function Y(P,I,w){let{fetchEndpoint:Z,fetchFunction:W}=se,J=Array.isArray( -P)?{queries:P.map(ee=>os(ee))}:os(P),X=n??{},oe=e??!1,ae=t??!1,B=i,j=s,fe=o;w!==void 0&&(w.fetchOptions!== +P)?{queries:P.map(ee=>as(ee))}:as(P),X=n??{},oe=e??!1,ae=t??!1,B=i,j=s,fe=o;w!==void 0&&(w.fetchOptions!== void 0&&(X={...X,...w.fetchOptions}),w.arrayMode!==void 0&&(oe=w.arrayMode),w.fullResults!==void 0&& (ae=w.fullResults),w.isolationLevel!==void 0&&(B=w.isolationLevel),w.readOnly!==void 0&&(j=w.readOnly), w.deferrable!==void 0&&(fe=w.deferrable)),I!==void 0&&!Array.isArray(I)&&I.fetchOptions!==void 0&&(X= -{...X,...I.fetchOptions});let me=u;!Array.isArray(I)&&I?.authToken!==void 0&&(me=I.authToken);let Ge=typeof Z== +{...X,...I.fetchOptions});let me=u;!Array.isArray(I)&&I?.authToken!==void 0&&(me=I.authToken);let $e=typeof Z== "function"?Z(g,A,{jwtAuth:me!==void 0}):Z,he={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"tru\ -e","Neon-Array-Mode":"true"},Ie=await Fu(me);Ie&&(he.Authorization=`Bearer ${Ie}`),Array.isArray(P)&& -(B!==void 0&&(he["Neon-Batch-Isolation-Level"]=B),j!==void 0&&(he["Neon-Batch-Read-Only"]=String(j)), -fe!==void 0&&(he["Neon-Batch-Deferrable"]=String(fe))),c||se.disableWarningInBrowsers||Ke();let we;try{ -we=await(W??fetch)(Ge,{method:"POST",body:JSON.stringify(J),headers:he,...X})}catch(ee){let M=new de( -`Error connecting to database: ${ee}`);throw M.sourceError=ee,M}if(we.ok){let ee=await we.json();if(Array. -isArray(P)){let M=ee.results;if(!Array.isArray(M))throw new de("Neon internal error: unexpected resu\ -lt format");return M.map(($,ge)=>{let qt=I[ge]??{},vo=qt.arrayMode??oe,xo=qt.fullResults??ae;return as( -$,{arrayMode:vo,fullResults:xo,types:qt.types})})}else{let M=I??{},$=M.arrayMode??oe,ge=M.fullResults?? -ae;return as(ee,{arrayMode:$,fullResults:ge,types:M.types})}}else{let{status:ee}=we;if(ee===400){let M=await we. -json(),$=new de(M.message);for(let ge of Bu)$[ge]=M[ge]??void 0;throw $}else{let M=await we.text();throw new de( -`Server error (HTTP status ${ee}): ${M}`)}}}return a(Y,"execute"),D}a(yr,"neon");var mr=class mr{constructor(e,t,n){ -this.execute=e;this.queryData=t;this.opts=n}then(e,t){return this.execute(this.queryData,this.opts). -then(e,t)}catch(e){return this.execute(this.queryData,this.opts).catch(e)}finally(e){return this.execute( -this.queryData,this.opts).finally(e)}};a(mr,"NeonQueryPromise");var xe=mr;function as(r,{arrayMode:e, -fullResults:t,types:n}){let i=new us.default(n),s=r.fields.map(c=>c.name),o=r.fields.map(c=>i.getTypeParser( -c.dataTypeID)),u=e===!0?r.rows.map(c=>c.map((l,f)=>l===null?null:o[f](l))):r.rows.map(c=>Object.fromEntries( -c.map((l,f)=>[s[f],l===null?null:o[f](l)])));return t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=u,r._parsers= -o,r._types=i,r):u}a(as,"processQueryResult");async function Fu(r){if(typeof r=="string")return r;if(typeof r== -"function")try{return await Promise.resolve(r())}catch(e){let t=new de("Error getting auth token."); -throw e instanceof Error&&(t=new de(`Error getting auth token: ${e.message}`)),t}}a(Fu,"getAuthToken");p();var go=Ae(ct());p();var wo=Ae(ct());var Un=class Un extends wo.Client{constructor(t){super(t);this.config=t}get neonConfig(){return this. -connection.stream}connect(t){let{neonConfig:n}=this;n.forceDisablePgSSL&&(this.ssl=this.connection.ssl= -!1),this.ssl&&n.useSecureWebSocket&&console.warn("SSL is enabled for both Postgres (e.g. ?sslmode=re\ -quire in the connection string + forceDisablePgSSL = false) and the WebSocket tunnel (useSecureWebSo\ -cket = true). Double encryption will increase latency and CPU usage. It may be appropriate to disabl\ -e SSL in the Postgres connection parameters or set forceDisablePgSSL = true.");let i=typeof this.config!= -"string"&&this.config?.host!==void 0||typeof this.config!="string"&&this.config?.connectionString!== -void 0||m.env.PGHOST!==void 0,s=m.env.USER??m.env.USERNAME;if(!i&&this.host==="localhost"&&this.user=== -s&&this.database===s&&this.password===null)throw new Error(`No database host or connection string wa\ -s set, and key parameters have default values (host: localhost, user: ${s}, db: ${s}, password: null\ -). Is an environment variable missing? Alternatively, if you intended to connect with these paramete\ -rs, please set the host to 'localhost' explicitly.`);let o=super.connect(t),u=n.pipelineTLS&&this.ssl, -c=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let l=this.connection;if(u&&l.on( -"connect",()=>l.stream.emit("data","S")),c){l.removeAllListeners("authenticationCleartextPassword"), -l.removeAllListeners("readyForQuery"),l.once("readyForQuery",()=>l.on("readyForQuery",this._handleReadyForQuery. -bind(this)));let f=this.ssl?"sslconnect":"connect";l.on(f,()=>{this.neonConfig.disableWarningInBrowsers|| -Ke(),this._handleAuthCleartextPassword(),this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){ -if(typeof crypto>"u"||crypto.subtle===void 0||crypto.subtle.importKey===void 0)throw new Error("Cann\ -ot use SASL auth when `crypto.subtle` is not defined");let n=crypto.subtle,i=this.saslSession,s=this. -password,o=t.data;if(i.message!=="SASLInitialResponse"||typeof s!="string"||typeof o!="string")throw new Error( -"SASL: protocol error");let u=Object.fromEntries(o.split(",").map(M=>{if(!/^.=/.test(M))throw new Error( -"SASL: Invalid attribute pair entry");let $=M[0],ge=M.substring(2);return[$,ge]})),c=u.r,l=u.s,f=u.i; -if(!c||!/^[!-+--~]+$/.test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unpri\ -ntable");if(!l||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(l))throw new Error( -"SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base64");if(!f||!/^[1-9][0-9]*$/.test(f))throw new Error( -"SASL: SCRAM-SERVER-FIRST-MESSAGE: missing/invalid iteration count");if(!c.startsWith(i.clientNonce)) -throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");if(c. -length===i.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too\ - short");let y=parseInt(f,10),g=d.from(l,"base64"),A=new TextEncoder,C=A.encode(s),D=await n.importKey( -"raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Y=new Uint8Array(await n.sign("HMAC",D,d.concat( -[g,d.from([0,0,0,1])]))),P=Y;for(var I=0;IP[$]^Y[$]));let w=P,Z=await n.importKey("raw",w,{name:"HMAC",hash:{name:"SHA-256"}},!1, -["sign"]),W=new Uint8Array(await n.sign("HMAC",Z,A.encode("Client Key"))),J=await n.digest("SHA-256", -W),X="n=*,r="+i.clientNonce,oe="r="+c+",s="+l+",i="+y,ae="c=biws,r="+c,B=X+","+oe+","+ae,j=await n.importKey( -"raw",J,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var fe=new Uint8Array(await n.sign("HMAC",j, -A.encode(B))),me=d.from(W.map((M,$)=>W[$]^fe[$])),Ge=me.toString("base64");let he=await n.importKey( -"raw",w,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Ie=await n.sign("HMAC",he,A.encode("Server \ -Key")),we=await n.importKey("raw",Ie,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var ee=d.from( -await n.sign("HMAC",we,A.encode(B)));i.message="SASLResponse",i.serverSignature=ee.toString("base64"), -i.response=ae+",p="+Ge,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}};a(Un, -"NeonClient");var $e=Un;ke();var bo=Ae(Rt());function vl(r,e){if(e)return{callback:e,result:void 0};let t,n,i=a(function(o,u){o?t(o):n(u)},"cb"), -s=new r(function(o,u){n=o,t=u});return{callback:i,result:s}}a(vl,"promisify");var Dn=class Dn extends go.Pool{constructor(){ -super(...arguments);E(this,"Client",$e);E(this,"hasFetchUnsupportedListeners",!1);E(this,"addListene\ +e","Neon-Array-Mode":"true","Neon-Client-Info":Ye},Ie=await ku(me);Ie&&(he.Authorization=`Bearer ${Ie}`), +Array.isArray(P)&&(B!==void 0&&(he["Neon-Batch-Isolation-Level"]=B),j!==void 0&&(he["Neon-Batch-Read\ +-Only"]=String(j)),fe!==void 0&&(he["Neon-Batch-Deferrable"]=String(fe))),c||se.disableWarningInBrowsers|| +ze();let we;try{we=await(W??fetch)($e,{method:"POST",body:JSON.stringify(J),headers:he,...X})}catch(ee){ +let M=new de(`Error connecting to database: ${ee}`);throw M.sourceError=ee,M}if(we.ok){let ee=await we. +json();if(Array.isArray(P)){let M=ee.results;if(!Array.isArray(M))throw new de("Neon internal error:\ + unexpected result format");return M.map((G,ge)=>{let Qt=I[ge]??{},xo=Qt.arrayMode??oe,So=Qt.fullResults?? +ae;return us(G,{arrayMode:xo,fullResults:So,types:Qt.types})})}else{let M=I??{},G=M.arrayMode??oe,ge=M. +fullResults??ae;return us(ee,{arrayMode:G,fullResults:ge,types:M.types})}}else{let{status:ee}=we;if(ee=== +400){let M=await we.json(),G=new de(M.message);for(let ge of Lu)G[ge]=M[ge]??void 0;throw G}else{let M=await we. +text();throw new de(`Server error (HTTP status ${ee}): ${M}`)}}}return a(Y,"execute"),D}a(mr,"neon"); +var wr=class wr{constructor(e,t,n){this.execute=e;this.queryData=t;this.opts=n}then(e,t){return this. +execute(this.queryData,this.opts).then(e,t)}catch(e){return this.execute(this.queryData,this.opts).catch( +e)}finally(e){return this.execute(this.queryData,this.opts).finally(e)}};a(wr,"NeonQueryPromise");var xe=wr; +function us(r,{arrayMode:e,fullResults:t,types:n}){let i=new cs.default(n),s=r.fields.map(c=>c.name), +o=r.fields.map(c=>i.getTypeParser(c.dataTypeID)),u=e===!0?r.rows.map(c=>c.map((l,f)=>l===null?null:o[f]( +l))):r.rows.map(c=>Object.fromEntries(c.map((l,f)=>[s[f],l===null?null:o[f](l)])));return t?(r.viaNeonFetch= +!0,r.rowAsArray=e,r.rows=u,r._parsers=o,r._types=i,r):u}a(us,"processQueryResult");async function ku(r){ +if(typeof r=="string")return r;if(typeof r=="function")try{return await Promise.resolve(r())}catch(e){ +let t=new de("Error getting auth token.");throw e instanceof Error&&(t=new de(`Error getting auth to\ +ken: ${e.message}`)),t}}a(ku,"getAuthToken");p();var bo=Ae(lt());p();var go=Ae(lt());var Dn=class Dn extends go.Client{constructor(t){super(typeof t=="string"?{connectionString:t,fallback_application_name:Ye}: +{fallback_application_name:Ye,...t});this.config=t}get neonConfig(){return this.connection.stream}connect(t){ +let{neonConfig:n}=this;n.forceDisablePgSSL&&(this.ssl=this.connection.ssl=!1),this.ssl&&n.useSecureWebSocket&& +console.warn("SSL is enabled for both Postgres (e.g. ?sslmode=require in the connection string + for\ +ceDisablePgSSL = false) and the WebSocket tunnel (useSecureWebSocket = true). Double encryption will\ + increase latency and CPU usage. It may be appropriate to disable SSL in the Postgres connection par\ +ameters or set forceDisablePgSSL = true.");let i=typeof this.config!="string"&&this.config?.host!==void 0|| +typeof this.config!="string"&&this.config?.connectionString!==void 0||m.env.PGHOST!==void 0,s=m.env. +USER??m.env.USERNAME;if(!i&&this.host==="localhost"&&this.user===s&&this.database===s&&this.password=== +null)throw new Error(`No database host or connection string was set, and key parameters have default\ + values (host: localhost, user: ${s}, db: ${s}, password: null). Is an environment variable missing?\ + Alternatively, if you intended to connect with these parameters, please set the host to 'localhost'\ + explicitly.`);let o=super.connect(t),u=n.pipelineTLS&&this.ssl,c=n.pipelineConnect==="password";if(!u&& +!n.pipelineConnect)return o;let l=this.connection;if(u&&l.on("connect",()=>l.stream.emit("data","S")), +c){l.removeAllListeners("authenticationCleartextPassword"),l.removeAllListeners("readyForQuery"),l.once( +"readyForQuery",()=>l.on("readyForQuery",this._handleReadyForQuery.bind(this)));let f=this.ssl?"sslc\ +onnect":"connect";l.on(f,()=>{this.neonConfig.disableWarningInBrowsers||ze(),this._handleAuthCleartextPassword(), +this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){if(typeof crypto>"u"||crypto. +subtle===void 0||crypto.subtle.importKey===void 0)throw new Error("Cannot use SASL auth when `crypto\ +.subtle` is not defined");let n=crypto.subtle,i=this.saslSession,s=this.password,o=t.data;if(i.message!== +"SASLInitialResponse"||typeof s!="string"||typeof o!="string")throw new Error("SASL: protocol error"); +let u=Object.fromEntries(o.split(",").map(M=>{if(!/^.=/.test(M))throw new Error("SASL: Invalid attri\ +bute pair entry");let G=M[0],ge=M.substring(2);return[G,ge]})),c=u.r,l=u.s,f=u.i;if(!c||!/^[!-+--~]+$/. +test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unprintable");if(!l||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(l))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base64");if(!f||!/^[1-9][0-9]*$/. +test(f))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: missing/invalid iteration count");if(!c.startsWith( +i.clientNonce))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with c\ +lient nonce");if(c.length===i.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: \ +server nonce is too short");let y=parseInt(f,10),g=d.from(l,"base64"),A=new TextEncoder,C=A.encode(s), +D=await n.importKey("raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Y=new Uint8Array(await n. +sign("HMAC",D,d.concat([g,d.from([0,0,0,1])]))),P=Y;for(var I=0;IP[G]^Y[G]));let w=P,Z=await n.importKey("raw",w,{name:"HMAC",hash:{ +name:"SHA-256"}},!1,["sign"]),W=new Uint8Array(await n.sign("HMAC",Z,A.encode("Client Key"))),J=await n. +digest("SHA-256",W),X="n=*,r="+i.clientNonce,oe="r="+c+",s="+l+",i="+y,ae="c=biws,r="+c,B=X+","+oe+"\ +,"+ae,j=await n.importKey("raw",J,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var fe=new Uint8Array( +await n.sign("HMAC",j,A.encode(B))),me=d.from(W.map((M,G)=>W[G]^fe[G])),$e=me.toString("base64");let he=await n. +importKey("raw",w,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Ie=await n.sign("HMAC",he,A.encode( +"Server Key")),we=await n.importKey("raw",Ie,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var ee=d. +from(await n.sign("HMAC",we,A.encode(B)));i.message="SASLResponse",i.serverSignature=ee.toString("ba\ +se64"),i.response=ae+",p="+$e,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; +a(Dn,"NeonClient");var Ge=Dn;ke();var vo=Ae(Bt());function xl(r,e){if(e)return{callback:e,result:void 0};let t,n,i=a(function(o,u){o?t(o):n(u)},"cb"), +s=new r(function(o,u){n=o,t=u});return{callback:i,result:s}}a(xl,"promisify");var On=class On extends bo.Pool{constructor(){ +super(...arguments);E(this,"Client",Ge);E(this,"hasFetchUnsupportedListeners",!1);E(this,"addListene\ r",this.on)}on(t,n){return t!=="error"&&(this.hasFetchUnsupportedListeners=!0),super.on(t,n)}query(t,n,i){ if(!se.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof t=="function")return super.query( -t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=vl(this.Promise,i);i=s.callback;try{let o=new bo.default( +t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=xl(this.Promise,i);i=s.callback;try{let o=new vo.default( this.options),u=encodeURIComponent,c=encodeURI,l=`postgresql://${u(o.user)}:${u(o.password)}@${u(o.host)}\ -/${c(o.database)}`,f=typeof t=="string"?t:t.text,y=n??t.values??[];yr(l,{fullResults:!0,arrayMode:t. +/${c(o.database)}`,f=typeof t=="string"?t:t.text,y=n??t.values??[];mr(l,{fullResults:!0,arrayMode:t. rowMode==="array"}).query(f,y,{types:t.types??this.options?.types}).then(A=>i(void 0,A)).catch(A=>i( -A))}catch(o){i(o)}return s.result}};a(Dn,"NeonPool");var Ot=Dn;ke();var le=Ae(ct()),xl="js"; +A))}catch(o){i(o)}return s.result}};a(On,"NeonPool");var qt=On;ke();var le=Ae(lt()),Sl="js"; /*! Bundled license information: ieee754/index.js: diff --git a/index.mjs b/index.mjs index afb13f9..dc047d4 100644 --- a/index.mjs +++ b/index.mjs @@ -1,72 +1,72 @@ /* @ts-self-types="./index.d.mts" */ -var So=Object.create;var Ie=Object.defineProperty;var Eo=Object.getOwnPropertyDescriptor;var Ao=Object.getOwnPropertyNames;var Co=Object.getPrototypeOf,_o=Object.prototype.hasOwnProperty;var Io=(r,e,t)=>e in r?Ie(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>Ie(r,"name",{value:e,configurable:!0});var G=(r,e)=>()=>(r&&(e=r(r=0)),e);var T=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ie=(r,e)=>{for(var t in e)Ie(r,t,{get:e[t], -enumerable:!0})},Dn=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ao(e))!_o. -call(r,i)&&i!==t&&Ie(r,i,{get:()=>e[i],enumerable:!(n=Eo(e,i))||n.enumerable});return r};var Se=(r,e,t)=>(t=r!=null?So(Co(r)):{},Dn(e||!r||!r.__esModule?Ie(t,"default",{value:r,enumerable:!0}): -t,r)),O=r=>Dn(Ie({},"__esModule",{value:!0}),r);var E=(r,e,t)=>Io(r,typeof e!="symbol"?e+"":e,t);var Qn=T(lt=>{"use strict";p();lt.byteLength=Po;lt.toByteArray=Bo;lt.fromByteArray=ko;var ae=[],te=[], -To=typeof Uint8Array<"u"?Uint8Array:Array,qt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ -23456789+/";for(Ee=0,On=qt.length;Ee0)throw new Error("Invalid string. Length 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(qn,"getLens"); -function Po(r){var e=qn(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Po,"byteLength");function Ro(r,e,t){return(e+ -t)*3/4-t}a(Ro,"_byteLength");function Bo(r){var e,t=qn(r),n=t[0],i=t[1],s=new To(Ro(r,n,i)),o=0,u=i> +var Eo=Object.create;var Ie=Object.defineProperty;var Ao=Object.getOwnPropertyDescriptor;var Co=Object.getOwnPropertyNames;var _o=Object.getPrototypeOf,Io=Object.prototype.hasOwnProperty;var To=(r,e,t)=>e in r?Ie(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>Ie(r,"name",{value:e,configurable:!0});var $=(r,e)=>()=>(r&&(e=r(r=0)),e);var T=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ie=(r,e)=>{for(var t in e)Ie(r,t,{get:e[t], +enumerable:!0})},On=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Co(e))!Io. +call(r,i)&&i!==t&&Ie(r,i,{get:()=>e[i],enumerable:!(n=Ao(e,i))||n.enumerable});return r};var Se=(r,e,t)=>(t=r!=null?Eo(_o(r)):{},On(e||!r||!r.__esModule?Ie(t,"default",{value:r,enumerable:!0}): +t,r)),O=r=>On(Ie({},"__esModule",{value:!0}),r);var E=(r,e,t)=>To(r,typeof e!="symbol"?e+"":e,t);var Nn=T(ft=>{"use strict";p();ft.byteLength=Ro;ft.toByteArray=Lo;ft.fromByteArray=Mo;var ae=[],te=[], +Po=typeof Uint8Array<"u"?Uint8Array:Array,Qt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ +23456789+/";for(Ee=0,qn=Qt.length;Ee0)throw new Error("Invalid string. Length 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(Qn,"getLens"); +function Ro(r){var e=Qn(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Ro,"byteLength");function Bo(r,e,t){return(e+ +t)*3/4-t}a(Bo,"_byteLength");function Lo(r){var e,t=Qn(r),n=t[0],i=t[1],s=new Po(Bo(r,n,i)),o=0,u=i> 0?n-4:n,c;for(c=0;c>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=te[r.charCodeAt( c)]<<2|te[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=te[r.charCodeAt(c)]<<10|te[r.charCodeAt(c+1)]<< -4|te[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(Bo,"toByteArray");function Lo(r){return ae[r>> -18&63]+ae[r>>12&63]+ae[r>>6&63]+ae[r&63]}a(Lo,"tripletToBase64");function Fo(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(Lo(n));return i.join("")}a(Fo,"en\ -codeChunk");function ko(r){for(var e,t=r.length,n=t%3,i=[],s=16383,o=0,u=t-n;o>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(Lo,"toByteArray");function Fo(r){return ae[r>> +18&63]+ae[r>>12&63]+ae[r>>6&63]+ae[r&63]}a(Fo,"tripletToBase64");function ko(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(Fo(n));return i.join("")}a(ko,"en\ +codeChunk");function Mo(r){for(var e,t=r.length,n=t%3,i=[],s=16383,o=0,u=t-n;ou?u:o+s));return n===1?(e=r[t-1],i.push(ae[e>>2]+ae[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1], -i.push(ae[e>>10]+ae[e>>4&63]+ae[e<<2&63]+"=")),i.join("")}a(ko,"fromByteArray")});var Nn=T(Qt=>{p();Qt.read=function(r,e,t,n,i){var s,o,u=i*8-n-1,c=(1<>1,f=-7,y=t?i-1:0,g=t? +i.push(ae[e>>10]+ae[e>>4&63]+ae[e<<2&63]+"=")),i.join("")}a(Mo,"fromByteArray")});var Wn=T(Nt=>{p();Nt.read=function(r,e,t,n,i){var s,o,u=i*8-n-1,c=(1<>1,f=-7,y=t?i-1:0,g=t? -1:1,A=r[e+y];for(y+=g,s=A&(1<<-f)-1,A>>=-f,f+=u;f>0;s=s*256+r[e+y],y+=g,f-=8);for(o=s&(1<<-f)-1,s>>= -f,f+=n;f>0;o=o*256+r[e+y],y+=g,f-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(A?-1:1)*(1/0);o=o+Math. -pow(2,n),s=s-l}return(A?-1:1)*o*Math.pow(2,s-n)};Qt.write=function(r,e,t,n,i,s){var o,u,c,l=s*8-i-1, +pow(2,n),s=s-l}return(A?-1:1)*o*Math.pow(2,s-n)};Nt.write=function(r,e,t,n,i,s){var o,u,c,l=s*8-i-1, f=(1<>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=n?0:s-1,C=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+y>=1?e+=g/c:e+=g*Math.pow(2,1-y),e*c>=2&&(o++,c/=2),o+y>=f?(u=0,o=f): o+y>=1?(u=(e*c-1)*Math.pow(2,i),o=o+y):(u=e*Math.pow(2,y-1)*Math.pow(2,i),o=0));i>=8;r[t+A]=u&255,A+= -C,u/=256,i-=8);for(o=o<0;r[t+A]=o&255,A+=C,o/=256,l-=8);r[t+A-C]|=D*128}});var ii=T(Be=>{"use strict";p();var Nt=Qn(),Pe=Nn(),Wn=typeof Symbol=="function"&&typeof Symbol.for== -"function"?Symbol.for("nodejs.util.inspect.custom"):null;Be.Buffer=h;Be.SlowBuffer=Qo;Be.INSPECT_MAX_BYTES= -50;var ft=2147483647;Be.kMaxLength=ft;h.TYPED_ARRAY_SUPPORT=Mo();!h.TYPED_ARRAY_SUPPORT&&typeof console< +C,u/=256,i-=8);for(o=o<0;r[t+A]=o&255,A+=C,o/=256,l-=8);r[t+A-C]|=D*128}});var si=T(Be=>{"use strict";p();var Wt=Nn(),Pe=Wn(),jn=typeof Symbol=="function"&&typeof Symbol.for== +"function"?Symbol.for("nodejs.util.inspect.custom"):null;Be.Buffer=h;Be.SlowBuffer=No;Be.INSPECT_MAX_BYTES= +50;var ht=2147483647;Be.kMaxLength=ht;h.TYPED_ARRAY_SUPPORT=Uo();!h.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 browser support.");function Mo(){ +pport which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Uo(){ try{let r=new Uint8Array(1),e={foo:a(function(){return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array. -prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}a(Mo,"typedArraySupport");Object. +prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}a(Uo,"typedArraySupport");Object. defineProperty(h.prototype,"parent",{enumerable:!0,get:a(function(){if(h.isBuffer(this))return this. buffer},"get")});Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:a(function(){if(h.isBuffer( -this))return this.byteOffset},"get")});function he(r){if(r>ft)throw new RangeError('The value "'+r+'\ +this))return this.byteOffset},"get")});function he(r){if(r>ht)throw new RangeError('The value "'+r+'\ " is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,h.prototype), e}a(he,"createBuffer");function h(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 $t(r)}return Gn(r,e,t)} -a(h,"Buffer");h.poolSize=8192;function Gn(r,e,t){if(typeof r=="string")return Do(r,e);if(ArrayBuffer. -isView(r))return Oo(r);if(r==null)throw new TypeError("The first argument must be one of type string\ +'The "string" argument must be of type string. Received type number');return $t(r)}return Vn(r,e,t)} +a(h,"Buffer");h.poolSize=8192;function Vn(r,e,t){if(typeof r=="string")return Oo(r,e);if(ArrayBuffer. +isView(r))return qo(r);if(r==null)throw new TypeError("The first argument must be one of type string\ , Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(ue(r,ArrayBuffer)|| r&&ue(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ue(r,SharedArrayBuffer)||r&&ue(r.buffer, -SharedArrayBuffer)))return jt(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument\ +SharedArrayBuffer)))return Ht(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument\ must not be of type number. Received type number');let n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return h. -from(n,e,t);let i=qo(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. +from(n,e,t);let i=Qo(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. toPrimitive]=="function")return h.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The\ first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Receiv\ -ed type "+typeof r)}a(Gn,"from");h.from=function(r,e,t){return Gn(r,e,t)};Object.setPrototypeOf(h.prototype, -Uint8Array.prototype);Object.setPrototypeOf(h,Uint8Array);function Vn(r){if(typeof r!="number")throw new TypeError( +ed type "+typeof r)}a(Vn,"from");h.from=function(r,e,t){return Vn(r,e,t)};Object.setPrototypeOf(h.prototype, +Uint8Array.prototype);Object.setPrototypeOf(h,Uint8Array);function Kn(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(Vn,"assertSize");function Uo(r,e,t){return Vn(r),r<=0?he(r):e!==void 0?typeof t== -"string"?he(r).fill(e,t):he(r).fill(e):he(r)}a(Uo,"alloc");h.alloc=function(r,e,t){return Uo(r,e,t)}; -function $t(r){return Vn(r),he(r<0?0:Gt(r)|0)}a($t,"allocUnsafe");h.allocUnsafe=function(r){return $t( -r)};h.allocUnsafeSlow=function(r){return $t(r)};function Do(r,e){if((typeof e!="string"||e==="")&&(e= +for option "size"')}a(Kn,"assertSize");function Do(r,e,t){return Kn(r),r<=0?he(r):e!==void 0?typeof t== +"string"?he(r).fill(e,t):he(r).fill(e):he(r)}a(Do,"alloc");h.alloc=function(r,e,t){return Do(r,e,t)}; +function $t(r){return Kn(r),he(r<0?0:Vt(r)|0)}a($t,"allocUnsafe");h.allocUnsafe=function(r){return $t( +r)};h.allocUnsafeSlow=function(r){return $t(r)};function Oo(r,e){if((typeof e!="string"||e==="")&&(e= "utf8"),!h.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=zn(r,e)|0,n=he(t),i=n.write( -r,e);return i!==t&&(n=n.slice(0,i)),n}a(Do,"fromString");function Wt(r){let e=r.length<0?0:Gt(r.length)| -0,t=he(e);for(let n=0;n=ft)throw new RangeError("Attempt to allocate Buffer larger t\ -han maximum size: 0x"+ft.toString(16)+" bytes");return r|0}a(Gt,"checked");function Qo(r){return+r!= -r&&(r=0),h.alloc(+r)}a(Qo,"SlowBuffer");h.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== +r,e,t),Object.setPrototypeOf(n,h.prototype),n}a(Ht,"fromArrayBuffer");function Qo(r){if(h.isBuffer(r)){ +let e=Vt(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"||zt(r.length)?he(0):jt(r);if(r.type==="Buffer"&&Array.isArray(r.data))return jt(r.data)} +a(Qo,"fromObject");function Vt(r){if(r>=ht)throw new RangeError("Attempt to allocate Buffer larger t\ +han maximum size: 0x"+ht.toString(16)+" bytes");return r|0}a(Vt,"checked");function No(r){return+r!= +r&&(r=0),h.alloc(+r)}a(No,"SlowBuffer");h.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== h.prototype},"isBuffer");h.compare=a(function(e,t){if(ue(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)), ue(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),!h.isBuffer(e)||!h.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, @@ -82,14 +82,14 @@ an Array of Buffers');s+=o.length}return i},"concat");function zn(r,e){if(h.isBu if(ArrayBuffer.isView(r)||ue(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 Ht(r).length;case"ucs2":case"\ -ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return ni(r).length;default: -if(i)return n?-1:Ht(r).length;e=(""+e).toLowerCase(),i=!0}}a(zn,"byteLength");h.byteLength=zn;function No(r,e,t){ +ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Gt(r).length;case"ucs2":case"\ +ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return ii(r).length;default: +if(i)return n?-1:Gt(r).length;e=(""+e).toLowerCase(),i=!0}}a(zn,"byteLength");h.byteLength=zn;function Wo(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 Zo(this,e,t);case"u\ -tf8":case"utf-8":return Yn(this,e,t);case"ascii":return Ko(this,e,t);case"latin1":case"binary":return Yo( -this,e,t);case"base64":return Vo(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Jo( -this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(No, +0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Jo(this,e,t);case"u\ +tf8":case"utf-8":return Zn(this,e,t);case"ascii":return Yo(this,e,t);case"latin1":case"binary":return Zo( +this,e,t);case"base64":return Ko(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xo( +this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(Wo, "slowToString");h.prototype._isBuffer=!0;function Ae(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(Ae,"swap"); h.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;tt&&(e+=" ... "),""},"inspect");Wn&&(h.prototype[Wn]=h.prototype.inspect);h.prototype.compare=a(function(e,t,n,i,s){ +er "+e+">"},"inspect");jn&&(h.prototype[jn]=h.prototype.inspect);h.prototype.compare=a(function(e,t,n,i,s){ if(ue(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(e))throw new TypeError('The "ta\ rget" argument must be one of type Buffer 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),l=this.slice( i,s),f=e.slice(t,n);for(let y=0;y2147483647? +compare");function Yn(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,zt(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=h.from( -e,n)),h.isBuffer(e))return e.length===0?-1:jn(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array. +e,n)),h.isBuffer(e))return e.length===0?-1:Hn(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):jn(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Kn,"bidire\ -ctionalIndexOf");function jn(r,e,t,n,i){let s=1,o=r.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(), +call(r,e,t):Hn(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Yn,"bidire\ +ctionalIndexOf");function Hn(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,y){return s===1?f[y]:f.readUInt16BE(y*s)}a(c,"read");let l;if(i){let f=-1;for(l= t;lo&&(t=o-u),l=t;l>=0;l--){let f=!0;for(let y=0;yi&&(n=i)):n=i;let s=e.length;n>s/2&&(n=s/2);let o;for(o= -0;o>>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 buf\ -fer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return Wo(this,e,t,n);case"utf8":case"\ -utf-8":return jo(this,e,t,n);case"ascii":case"latin1":case"binary":return Ho(this,e,t,n);case"base64": -return $o(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Go(this,e,t,n);default: +fer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return jo(this,e,t,n);case"utf8":case"\ +utf-8":return Ho(this,e,t,n);case"ascii":case"latin1":case"binary":return Go(this,e,t,n);case"base64": +return $o(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Vo(this,e,t,n);default: if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"write");h.prototype. toJSON=a(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSO\ -N");function Vo(r,e,t){return e===0&&t===r.length?Nt.fromByteArray(r):Nt.fromByteArray(r.slice(e,t))} -a(Vo,"base64Slice");function Yn(r,e,t){t=Math.min(r.length,t);let n=[],i=e;for(;i239?4:s>223?3:s>191?2:1;if(i+u<=t){let c,l,f,y;switch(u){case 1:s<128&&(o=s);break;case 2:c=r[i+ 1],(c&192)===128&&(y=(s&31)<<6|c&63,y>127&&(o=y));break;case 3:c=r[i+1],l=r[i+2],(c&192)===128&&(l&192)=== 128&&(y=(s&15)<<12|(c&63)<<6|l&63,y>2047&&(y<55296||y>57343)&&(o=y));break;case 4:c=r[i+1],l=r[i+2], f=r[i+3],(c&192)===128&&(l&192)===128&&(f&192)===128&&(y=(s&15)<<18|(c&63)<<12|(l&63)<<6|f&63,y>65535&& y<1114112&&(o=y))}}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 zo(n)}a(Yn,"utf8Slice");var Hn=4096;function zo(r){let e=r.length;if(e<=Hn)return String. +n.push(o),i+=u}return zo(n)}a(Zn,"utf8Slice");var Gn=4096;function zo(r){let e=r.length;if(e<=Gn)return String. fromCharCode.apply(String,r);let t="",n=0;for(;nn)&&(t=n);let i="";for(let s=e;sn)&&(t=n);let i="";for(let s=e;sn&&(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,h.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 \ @@ -208,14 +208,14 @@ e>>>8,t+2},"writeUInt16LE");h.prototype.writeUint16BE=h.prototype.writeUInt16BE= writeUint32LE=h.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||V(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");h.prototype. writeUint32BE=h.prototype.writeUInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||V(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 Zn(r,e,t,n,i){ -ri(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++]= +0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},"writeUInt32BE");function Jn(r,e,t,n,i){ +ni(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(Zn,"wrtBigUInt64LE");function Jn(r,e,t,n,i){ri(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295)); +8,r[t++]=o,t}a(Jn,"wrtBigUInt64LE");function Xn(r,e,t,n,i){ni(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(Jn,"wrtBigUInt64BE");h.prototype. -writeBigUInt64LE=we(a(function(e,t=0){return Zn(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ -riteBigUInt64LE"));h.prototype.writeBigUInt64BE=we(a(function(e,t=0){return Jn(this,e,t,BigInt(0),BigInt( +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(Xn,"wrtBigUInt64BE");h.prototype. +writeBigUInt64LE=we(a(function(e,t=0){return Jn(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ +riteBigUInt64LE"));h.prototype.writeBigUInt64BE=we(a(function(e,t=0){return Xn(this,e,t,BigInt(0),BigInt( "0xffffffffffffffff"))},"writeBigUInt64BE"));h.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>> 0,!i){let c=Math.pow(2,8*n-1);V(this,e,t,n,c-1,-c)}let s=0,o=1,u=0;for(this[t]=e&255;++s>0)-u&255;return t+n},"writeIntLE");h.prototype.writeIntBE= @@ -229,17 +229,17 @@ writeInt16BE=a(function(e,t,n){return e=+e,t=t>>>0,n||V(this,e,t,2,32767,-32768) 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");h.prototype.writeInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||V(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},"writeInt32BE");h.prototype.writeBigInt64LE=we(a(function(e,t=0){return Zn(this,e,t,-BigInt("0x\ +t+4},"writeInt32BE");h.prototype.writeBigInt64LE=we(a(function(e,t=0){return Jn(this,e,t,-BigInt("0x\ 8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));h.prototype.writeBigInt64BE=we( -a(function(e,t=0){return Jn(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"w\ -riteBigInt64BE"));function Xn(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(Xn,"checkIEEE754");function ei(r,e,t,n,i){return e= -+e,t=t>>>0,i||Xn(r,e,t,4,34028234663852886e22,-34028234663852886e22),Pe.write(r,e,t,n,23,4),t+4}a(ei, -"writeFloat");h.prototype.writeFloatLE=a(function(e,t,n){return ei(this,e,t,!0,n)},"writeFloatLE");h. -prototype.writeFloatBE=a(function(e,t,n){return ei(this,e,t,!1,n)},"writeFloatBE");function ti(r,e,t,n,i){ -return e=+e,t=t>>>0,i||Xn(r,e,t,8,17976931348623157e292,-17976931348623157e292),Pe.write(r,e,t,n,52, -8),t+8}a(ti,"writeDouble");h.prototype.writeDoubleLE=a(function(e,t,n){return ti(this,e,t,!0,n)},"wr\ -iteDoubleLE");h.prototype.writeDoubleBE=a(function(e,t,n){return ti(this,e,t,!1,n)},"writeDoubleBE"); +a(function(e,t=0){return Xn(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"w\ +riteBigInt64BE"));function ei(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(ei,"checkIEEE754");function ti(r,e,t,n,i){return e= ++e,t=t>>>0,i||ei(r,e,t,4,34028234663852886e22,-34028234663852886e22),Pe.write(r,e,t,n,23,4),t+4}a(ti, +"writeFloat");h.prototype.writeFloatLE=a(function(e,t,n){return ti(this,e,t,!0,n)},"writeFloatLE");h. +prototype.writeFloatBE=a(function(e,t,n){return ti(this,e,t,!1,n)},"writeFloatBE");function ri(r,e,t,n,i){ +return e=+e,t=t>>>0,i||ei(r,e,t,8,17976931348623157e292,-17976931348623157e292),Pe.write(r,e,t,n,52, +8),t+8}a(ri,"writeDouble");h.prototype.writeDoubleLE=a(function(e,t,n){return ri(this,e,t,!0,n)},"wr\ +iteDoubleLE");h.prototype.writeDoubleBE=a(function(e,t,n){return ri(this,e,t,!1,n)},"writeDoubleBE"); h.prototype.copy=a(function(e,t,n,i){if(!h.isBuffer(e))throw new TypeError("argument should be a Buf\ fer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i>>0,n=n===void 0?this.length:n>>> 0,e||(e=0);let s;if(typeof e=="number")for(s=t;s2**32?i=$n(String(t)):typeof t=="bigint"&&(i=String( t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=$n(i)),i+="n"),n+=` It must be ${e}. Re\ ceived ${i}`,n},RangeError);function $n(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($n,"addNumericalSeparator");function Xo(r,e,t){ -Re(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&je(e,r.length-(t+1))}a(Xo,"checkBounds");function ri(r,e,t,n,i,s){ +_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}a($n,"addNumericalSeparator");function ea(r,e,t){ +Re(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&je(e,r.length-(t+1))}a(ea,"checkBounds");function ni(r,e,t,n,i,s){ if(r>t||r3?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} a\ -nd <= ${t}${o}`,new Te.ERR_OUT_OF_RANGE("value",u,r)}Xo(n,i,s)}a(ri,"checkIntBI");function Re(r,e){if(typeof r!= +nd <= ${t}${o}`,new Te.ERR_OUT_OF_RANGE("value",u,r)}ea(n,i,s)}a(ni,"checkIntBI");function Re(r,e){if(typeof r!= "number")throw new Te.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Re,"validateNumber");function je(r,e,t){throw Math. floor(r)!==r?(Re(r,t),new Te.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new Te.ERR_BUFFER_OUT_OF_BOUNDS: -new Te.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(je,"boundsError");var ea=/[^+/0-9A-Za-z-_]/g; -function ta(r){if(r=r.split("=")[0],r=r.trim().replace(ea,""),r.length<2)return"";for(;r.length%4!== -0;)r=r+"=";return r}a(ta,"base64clean");function Ht(r,e){e=e||1/0;let t,n=r.length,i=null,s=[];for(let o=0;o< +new Te.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(je,"boundsError");var ta=/[^+/0-9A-Za-z-_]/g; +function ra(r){if(r=r.split("=")[0],r=r.trim().replace(ta,""),r.length<2)return"";for(;r.length%4!== +0;)r=r+"=";return r}a(ra,"base64clean");function Gt(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(Ht,"utf\ -8ToBytes");function ra(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(na,"utf16leToBytes");function ni(r){return Nt.toByteArray( -ta(r))}a(ni,"base64ToBytes");function ht(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) -e[i+t]=r[i];return i}a(ht,"blitBuffer");function ue(r,e){return r instanceof e||r!=null&&r.constructor!= +240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}a(Gt,"utf\ +8ToBytes");function na(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(ia,"utf16leToBytes");function ii(r){return Wt.toByteArray( +ra(r))}a(ii,"base64ToBytes");function pt(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) +e[i+t]=r[i];return i}a(pt,"blitBuffer");function ue(r,e){return r instanceof e||r!=null&&r.constructor!= null&&r.constructor.name!=null&&r.constructor.name===e.name}a(ue,"isInstance");function zt(r){return r!== -r}a(zt,"numberIsNaN");var ia=function(){let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){ +r}a(zt,"numberIsNaN");var sa=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 we(r){return typeof BigInt>"u"? -sa:r}a(we,"defineBigIntMethod");function sa(){throw new Error("BigInt not supported")}a(sa,"BufferBi\ -gIntNotDefined")});var b,v,x,d,m,p=G(()=>{"use strict";b=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),x=globalThis. +oa:r}a(we,"defineBigIntMethod");function oa(){throw new Error("BigInt not supported")}a(oa,"BufferBi\ +gIntNotDefined")});var b,v,x,d,m,p=$(()=>{"use strict";b=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),x=globalThis. clearImmediate??(r=>clearTimeout(r)),d=typeof globalThis.Buffer=="function"&&typeof globalThis.Buffer. -allocUnsafe=="function"?globalThis.Buffer:ii().Buffer,m=globalThis.process??{};m.env??(m.env={});try{ -m.nextTick(()=>{})}catch{let e=Promise.resolve();m.nextTick=e.then.bind(e)}});var ge=T((Bl,Kt)=>{"use strict";p();var Le=typeof Reflect=="object"?Reflect:null,si=Le&&typeof Le.apply== -"function"?Le.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),pt; -Le&&typeof Le.ownKeys=="function"?pt=Le.ownKeys:Object.getOwnPropertySymbols?pt=a(function(e){return Object. -getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):pt=a(function(e){return Object. -getOwnPropertyNames(e)},"ReflectOwnKeys");function oa(r){console&&console.warn&&console.warn(r)}a(oa, -"ProcessEmitWarning");var ai=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function R(){R. -init.call(this)}a(R,"EventEmitter");Kt.exports=R;Kt.exports.once=la;R.EventEmitter=R;R.prototype._events= -void 0;R.prototype._eventsCount=0;R.prototype._maxListeners=void 0;var oi=10;function dt(r){if(typeof r!= +allocUnsafe=="function"?globalThis.Buffer:si().Buffer,m=globalThis.process??{};m.env??(m.env={});try{ +m.nextTick(()=>{})}catch{let e=Promise.resolve();m.nextTick=e.then.bind(e)}});var ge=T((Ll,Yt)=>{"use strict";p();var Le=typeof Reflect=="object"?Reflect:null,oi=Le&&typeof Le.apply== +"function"?Le.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),dt; +Le&&typeof Le.ownKeys=="function"?dt=Le.ownKeys:Object.getOwnPropertySymbols?dt=a(function(e){return Object. +getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):dt=a(function(e){return Object. +getOwnPropertyNames(e)},"ReflectOwnKeys");function aa(r){console&&console.warn&&console.warn(r)}a(aa, +"ProcessEmitWarning");var ui=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function R(){R. +init.call(this)}a(R,"EventEmitter");Yt.exports=R;Yt.exports.once=fa;R.EventEmitter=R;R.prototype._events= +void 0;R.prototype._eventsCount=0;R.prototype._maxListeners=void 0;var ai=10;function yt(r){if(typeof r!= "function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)} -a(dt,"checkListener");Object.defineProperty(R,"defaultMaxListeners",{enumerable:!0,get:a(function(){ -return oi},"get"),set:a(function(r){if(typeof r!="number"||r<0||ai(r))throw new RangeError('The valu\ -e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");oi=r}, +a(yt,"checkListener");Object.defineProperty(R,"defaultMaxListeners",{enumerable:!0,get:a(function(){ +return ai},"get"),set:a(function(r){if(typeof r!="number"||r<0||ui(r))throw new RangeError('The valu\ +e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");ai=r}, "set")});R.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}; -R.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||ai(e))throw new RangeError('Th\ +R.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||ui(e))throw new RangeError('Th\ e value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners= -e,this},"setMaxListeners");function ui(r){return r._maxListeners===void 0?R.defaultMaxListeners:r._maxListeners} -a(ui,"_getMaxListeners");R.prototype.getMaxListeners=a(function(){return ui(this)},"getMaxListeners"); +e,this},"setMaxListeners");function ci(r){return r._maxListeners===void 0?R.defaultMaxListeners:r._maxListeners} +a(ci,"_getMaxListeners");R.prototype.getMaxListeners=a(function(){return ci(this)},"getMaxListeners"); R.prototype.emit=a(function(e){for(var t=[],n=1;n 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")si(c,this,t);else for(var l=c. -length,f=pi(c,l),n=0;n0&&o.length>i&&!o.warned){o.warned= +"function"?o=s[e]=n?[t,o]:[o,t]:n?o.unshift(t):o.push(t),i=ci(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,oa(u)}return r}a(ci,"_addListener");R.prototype.addListener=a(function(e,t){ -return ci(this,e,t,!1)},"addListener");R.prototype.on=R.prototype.addListener;R.prototype.prependListener= -a(function(e,t){return ci(this,e,t,!0)},"prependListener");function aa(){if(!this.fired)return this. +r,u.type=e,u.count=o.length,aa(u)}return r}a(li,"_addListener");R.prototype.addListener=a(function(e,t){ +return li(this,e,t,!1)},"addListener");R.prototype.on=R.prototype.addListener;R.prototype.prependListener= +a(function(e,t){return li(this,e,t,!0)},"prependListener");function ua(){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(aa,"onceWrapper");function li(r,e,t){var n={fired:!1, -wrapFn:void 0,target:r,type:e,listener:t},i=aa.bind(n);return i.listener=t,n.wrapFn=i,i}a(li,"_onceW\ -rap");R.prototype.once=a(function(e,t){return dt(t),this.on(e,li(this,e,t)),this},"once");R.prototype. -prependOnceListener=a(function(e,t){return dt(t),this.prependListener(e,li(this,e,t)),this},"prepend\ -OnceListener");R.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(dt(t),i=this._events,i=== +target):this.listener.apply(this.target,arguments)}a(ua,"onceWrapper");function fi(r,e,t){var n={fired:!1, +wrapFn:void 0,target:r,type:e,listener:t},i=ua.bind(n);return i.listener=t,n.wrapFn=i,i}a(fi,"_onceW\ +rap");R.prototype.once=a(function(e,t){return yt(t),this.on(e,fi(this,e,t)),this},"once");R.prototype. +prependOnceListener=a(function(e,t){return yt(t),this.prependListener(e,fi(this,e,t)),this},"prepend\ +OnceListener");R.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(yt(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("removeListener",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():ua(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== +listener,s=o;break}if(s<0)return this;s===0?n.shift():ca(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== void 0&&this.emit("removeListener",e,u||t)}return this},"removeListener");R.prototype.off=R.prototype. removeListener;R.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= @@ -341,25 +341,25 @@ if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.cr length===0){var s=Object.keys(n),o;for(i=0;i= -0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function fi(r,e,t){var n=r._events; +0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function hi(r,e,t){var n=r._events; if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t? -ca(i):pi(i,i.length)}a(fi,"_listeners");R.prototype.listeners=a(function(e){return fi(this,e,!0)},"l\ -isteners");R.prototype.rawListeners=a(function(e){return fi(this,e,!1)},"rawListeners");R.listenerCount= -function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):hi.call(r,e)};R.prototype. -listenerCount=hi;function hi(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(hi,"listenerCount");R.prototype.eventNames=a(function(){ -return this._eventsCount>0?pt(this._events):[]},"eventNames");function pi(r,e){for(var t=new Array(e), -n=0;n0?dt(this._events):[]},"eventNames");function di(r,e){for(var t=new Array(e), +n=0;nce,isIP:()=>ha});function ha(r){return 0}var mi,yi,S,ce,Fe=G(()=>{"use s\ -trict";p();mi=Se(ge(),1);a(ha,"isIP");yi=/^[^.]+\./,S=class S extends mi.EventEmitter{constructor(){ +ust be of type EventEmitter. Received type '+typeof r)}a(yi,"eventTargetAgnosticAddListener")});var gi={};ie(gi,{Socket:()=>ce,isIP:()=>pa});function pa(r){return 0}var wi,mi,S,ce,Fe=$(()=>{"use s\ +trict";p();wi=Se(ge(),1);a(pa,"isIP");mi=/^[^.]+\./,S=class S extends wi.EventEmitter{constructor(){ super(...arguments);E(this,"opts",{});E(this,"connecting",!1);E(this,"pending",!0);E(this,"writable", !0);E(this,"encrypted",!1);E(this,"authorized",!1);E(this,"destroyed",!1);E(this,"ws",null);E(this,"\ writeBuffer");E(this,"tlsState",0);E(this,"tlsRead");E(this,"tlsWrite")}static get poolQueryViaFetch(){ @@ -424,129 +424,129 @@ n}}write(t,n="utf8",i=s=>{}){return t.length===0?(i(),!0):(typeof t=="string"&&( tlsState===0?(this.rawWrite(t),i()):this.tlsState===1?this.once("secureConnection",()=>{this.write(t, n,i)}):(this.tlsWrite(t),i()),!0)}end(t=d.alloc(0),n="utf8",i=()=>{}){return this.write(t,n,()=>{this. ws.close(),i()}),this}destroy(){return this.destroyed=!0,this.end()}};a(S,"Socket"),E(S,"defaults",{ -poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{let s;return i?.jwtAuth?s=t.replace(yi,"apiauth."):s= -t.replace(yi,"api."),"https://"+s+"/sql"},"fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0, +poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{let s;return i?.jwtAuth?s=t.replace(mi,"apiauth."):s= +t.replace(mi,"api."),"https://"+s+"/sql"},"fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0, webSocketConstructor:void 0,wsProxy:a(t=>t+"/v2","wsProxy"),useSecureWebSocket:!0,forceDisablePgSSL:!0, coalesceWrites:!0,pipelineConnect:"password",subtls:void 0,rootCerts:"",pipelineTLS:!1,disableSNI:!1, -disableWarningInBrowsers:!1}),E(S,"opts",{});ce=S});var gi={};ie(gi,{parse:()=>Yt});function Yt(r,e=!1){let{protocol:t}=new URL(r),n="http:"+r.substring( +disableWarningInBrowsers:!1}),E(S,"opts",{});ce=S});var bi={};ie(bi,{parse:()=>Zt});function Zt(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:l,search:f,searchParams:y,hash:g}=new URL( n);s=decodeURIComponent(s),i=decodeURIComponent(i),l=decodeURIComponent(l);let A=i+":"+s,C=e?Object. fromEntries(y.entries()):f;return{href:r,protocol:t,auth:A,username:i,password:s,host:o,hostname:u,port:c, -pathname:l,search:f,query:C,hash:g}}var Zt=G(()=>{"use strict";p();a(Yt,"parse")});var tr=T(Ai=>{"use strict";p();Ai.parse=function(r,e){return new er(r,e).parse()};var vt=class vt{constructor(e,t){ -this.source=e,this.transform=t||Ca,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){ +pathname:l,search:f,query:C,hash:g}}var Jt=$(()=>{"use strict";p();a(Zt,"parse")});var rr=T(Ci=>{"use strict";p();Ci.parse=function(r,e){return new tr(r,e).parse()};var xt=class xt{constructor(e,t){ +this.source=e,this.transform=t||_a,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){ return this.position>=this.source.length}nextCharacter(){var e=this.source[this.position++];return e=== "\\"?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){this.recorded.push( e)}newEntry(e){var t;(this.recorded.length>0||e)&&(t=this.recorded.join(""),t==="NULL"&&!e&&(t=null), t!==null&&(t=this.transform(t)),this.entries.push(t),this.recorded=[])}consumeDimensions(){if(this.source[0]=== "[")for(;!this.isEof();){var e=this.nextCharacter();if(e.value==="=")break}}parse(e){var t,n,i;for(this. consumeDimensions();!this.isEof();)if(t=this.nextCharacter(),t.value==="{"&&!i)this.dimension++,this. -dimension>1&&(n=new vt(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse( +dimension>1&&(n=new xt(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse( !0)),this.position+=n.position-2);else if(t.value==="}"&&!i){if(this.dimension--,!this.dimension&&(this. newEntry(),e))return this.entries}else t.value==='"'&&!t.escaped?(i&&this.newEntry(!0),i=!i):t.value=== ","&&!i?this.newEntry():this.record(t.value);if(this.dimension!==0)throw new Error("array dimension \ -not balanced");return this.entries}};a(vt,"ArrayParser");var er=vt;function Ca(r){return r}a(Ca,"ide\ -ntity")});var rr=T((Zl,Ci)=>{p();var _a=tr();Ci.exports={create:a(function(r,e){return{parse:a(function(){return _a. -parse(r,e)},"parse")}},"create")}});var Ti=T((ef,Ii)=>{"use strict";p();var Ia=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, -Ta=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Pa=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Ra=/^-?infinity$/;Ii. -exports=a(function(e){if(Ra.test(e))return Number(e.replace("i","I"));var t=Ia.exec(e);if(!t)return Ba( -e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=_i(i));var s=parseInt(t[2],10)-1,o=t[3],u=parseInt(t[4], -10),c=parseInt(t[5],10),l=parseInt(t[6],10),f=t[7];f=f?1e3*parseFloat(f):0;var y,g=La(e);return g!=null? -(y=new Date(Date.UTC(i,s,o,u,c,l,f)),nr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= -new Date(i,s,o,u,c,l,f),nr(i)&&y.setFullYear(i)),y},"parseDate");function Ba(r){var e=Ta.exec(r);if(e){ -var t=parseInt(e[1],10),n=!!e[4];n&&(t=_i(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return nr( -t)&&o.setFullYear(t),o}}a(Ba,"getDate");function La(r){if(r.endsWith("+00"))return 0;var e=Pa.exec(r. +not balanced");return this.entries}};a(xt,"ArrayParser");var tr=xt;function _a(r){return r}a(_a,"ide\ +ntity")});var nr=T((ef,_i)=>{p();var Ia=rr();_i.exports={create:a(function(r,e){return{parse:a(function(){return Ia. +parse(r,e)},"parse")}},"create")}});var Pi=T((nf,Ti)=>{"use strict";p();var Ta=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, +Pa=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Ra=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Ba=/^-?infinity$/;Ti. +exports=a(function(e){if(Ba.test(e))return Number(e.replace("i","I"));var t=Ta.exec(e);if(!t)return La( +e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Ii(i));var s=parseInt(t[2],10)-1,o=t[3],u=parseInt(t[4], +10),c=parseInt(t[5],10),l=parseInt(t[6],10),f=t[7];f=f?1e3*parseFloat(f):0;var y,g=Fa(e);return g!=null? +(y=new Date(Date.UTC(i,s,o,u,c,l,f)),ir(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= +new Date(i,s,o,u,c,l,f),ir(i)&&y.setFullYear(i)),y},"parseDate");function La(r){var e=Pa.exec(r);if(e){ +var t=parseInt(e[1],10),n=!!e[4];n&&(t=Ii(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return ir( +t)&&o.setFullYear(t),o}}a(La,"getDate");function Fa(r){if(r.endsWith("+00"))return 0;var e=Ra.exec(r. split(" ")[1]);if(e){var t=e[1];if(t==="Z")return 0;var n=t==="-"?-1:1,i=parseInt(e[2],10)*3600+parseInt( -e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(La,"timeZoneOffset");function _i(r){return-(r- -1)}a(_i,"bcYearToNegativeYear");function nr(r){return r>=0&&r<100}a(nr,"is0To99")});var Ri=T((nf,Pi)=>{p();Pi.exports=ka;var Fa=Object.prototype.hasOwnProperty;function ka(r){for(var e=1;e< -arguments.length;e++){var t=arguments[e];for(var n in t)Fa.call(t,n)&&(r[n]=t[n])}return r}a(ka,"ext\ -end")});var Fi=T((af,Li)=>{"use strict";p();var Ma=Ri();Li.exports=ke;function ke(r){if(!(this instanceof ke)) -return new ke(r);Ma(this,Va(r))}a(ke,"PostgresInterval");var Ua=["seconds","minutes","hours","days", -"months","years"];ke.prototype.toPostgres=function(){var r=Ua.filter(this.hasOwnProperty,this);return this. +e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(Fa,"timeZoneOffset");function Ii(r){return-(r- +1)}a(Ii,"bcYearToNegativeYear");function ir(r){return r>=0&&r<100}a(ir,"is0To99")});var Bi=T((af,Ri)=>{p();Ri.exports=Ma;var ka=Object.prototype.hasOwnProperty;function Ma(r){for(var e=1;e< +arguments.length;e++){var t=arguments[e];for(var n in t)ka.call(t,n)&&(r[n]=t[n])}return r}a(Ma,"ext\ +end")});var ki=T((lf,Fi)=>{"use strict";p();var Ua=Bi();Fi.exports=ke;function ke(r){if(!(this instanceof ke)) +return new ke(r);Ua(this,Ka(r))}a(ke,"PostgresInterval");var Da=["seconds","minutes","hours","days", +"months","years"];ke.prototype.toPostgres=function(){var r=Da.filter(this.hasOwnProperty,this);return this. milliseconds&&r.indexOf("seconds")<0&&r.push("seconds"),r.length===0?"0":r.map(function(e){var t=this[e]|| 0;return e==="seconds"&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/, -"")),t+" "+e},this).join(" ")};var Da={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ -S"},Oa=["years","months","days"],qa=["hours","minutes","seconds"];ke.prototype.toISOString=ke.prototype. -toISO=function(){var r=Oa.map(t,this).join(""),e=qa.map(t,this).join("");return"P"+r+"T"+e;function t(n){ +"")),t+" "+e},this).join(" ")};var Oa={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ +S"},qa=["years","months","days"],Qa=["hours","minutes","seconds"];ke.prototype.toISOString=ke.prototype. +toISO=function(){var r=qa.map(t,this).join(""),e=Qa.map(t,this).join("");return"P"+r+"T"+e;function t(n){ var i=this[n]||0;return n==="seconds"&&this.milliseconds&&(i=(i+this.milliseconds/1e3).toFixed(6).replace( -/0+$/,"")),i+Da[n]}};var ir="([+-]?\\d+)",Qa=ir+"\\s+years?",Na=ir+"\\s+mons?",Wa=ir+"\\s+days?",ja="\ -([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",Ha=new RegExp([Qa,Na,Wa,ja].map(function(r){return"\ -("+r+")?"}).join("\\s*")),Bi={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, -$a=["hours","minutes","seconds","milliseconds"];function Ga(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}a(Ga,"parseMilliseconds");function Va(r){if(!r)return{};var e=Ha.exec(r),t=e[8]==="-";return Object. -keys(Bi).reduce(function(n,i){var s=Bi[i],o=e[s];return!o||(o=i==="milliseconds"?Ga(o):parseInt(o,10), -!o)||(t&&~$a.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(Va,"parse")});var Mi=T((lf,ki)=>{"use strict";p();ki.exports=a(function(e){if(/^\\x/.test(e))return new d(e.substr( +/0+$/,"")),i+Oa[n]}};var sr="([+-]?\\d+)",Na=sr+"\\s+years?",Wa=sr+"\\s+mons?",ja=sr+"\\s+days?",Ha="\ +([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",Ga=new RegExp([Na,Wa,ja,Ha].map(function(r){return"\ +("+r+")?"}).join("\\s*")),Li={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, +$a=["hours","minutes","seconds","milliseconds"];function Va(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(Va,"parseMilliseconds");function Ka(r){if(!r)return{};var e=Ga.exec(r),t=e[8]==="-";return Object. +keys(Li).reduce(function(n,i){var s=Li[i],o=e[s];return!o||(o=i==="milliseconds"?Va(o):parseInt(o,10), +!o)||(t&&~$a.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(Ka,"parse")});var Ui=T((pf,Mi)=>{"use strict";p();Mi.exports=a(function(e){if(/^\\x/.test(e))return new d(e.substr( 2),"hex");for(var t="",n=0;n{p();var Ve=tr(),ze=rr(),xt=Ti(),Di=Fi(),Oi=Mi();function St(r){return a(function(t){ -return t===null?t:r(t)},"nullAllowed")}a(St,"allowNull");function qi(r){return r===null?r:r==="TRUE"|| -r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(qi,"parseBool");function za(r){return r? -Ve.parse(r,qi):null}a(za,"parseBoolArray");function Ka(r){return parseInt(r,10)}a(Ka,"parseBaseTenIn\ -t");function sr(r){return r?Ve.parse(r,St(Ka)):null}a(sr,"parseIntegerArray");function Ya(r){return r? -Ve.parse(r,St(function(e){return Qi(e).trim()})):null}a(Ya,"parseBigIntegerArray");var Za=a(function(r){ -if(!r)return null;var e=ze.create(r,function(t){return t!==null&&(t=cr(t)),t});return e.parse()},"pa\ -rsePointArray"),or=a(function(r){if(!r)return null;var e=ze.create(r,function(t){return t!==null&&(t= +parseBytea")});var ji=T((mf,Wi)=>{p();var Ke=rr(),ze=nr(),St=Pi(),Oi=ki(),qi=Ui();function Et(r){return a(function(t){ +return t===null?t:r(t)},"nullAllowed")}a(Et,"allowNull");function Qi(r){return r===null?r:r==="TRUE"|| +r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(Qi,"parseBool");function za(r){return r? +Ke.parse(r,Qi):null}a(za,"parseBoolArray");function Ya(r){return parseInt(r,10)}a(Ya,"parseBaseTenIn\ +t");function or(r){return r?Ke.parse(r,Et(Ya)):null}a(or,"parseIntegerArray");function Za(r){return r? +Ke.parse(r,Et(function(e){return Ni(e).trim()})):null}a(Za,"parseBigIntegerArray");var Ja=a(function(r){ +if(!r)return null;var e=ze.create(r,function(t){return t!==null&&(t=lr(t)),t});return e.parse()},"pa\ +rsePointArray"),ar=a(function(r){if(!r)return null;var e=ze.create(r,function(t){return t!==null&&(t= parseFloat(t)),t});return e.parse()},"parseFloatArray"),re=a(function(r){if(!r)return null;var e=ze. -create(r);return e.parse()},"parseStringArray"),ar=a(function(r){if(!r)return null;var e=ze.create(r, -function(t){return t!==null&&(t=xt(t)),t});return e.parse()},"parseDateArray"),Ja=a(function(r){if(!r) -return null;var e=ze.create(r,function(t){return t!==null&&(t=Di(t)),t});return e.parse()},"parseInt\ -ervalArray"),Xa=a(function(r){return r?Ve.parse(r,St(Oi)):null},"parseByteAArray"),ur=a(function(r){ -return parseInt(r,10)},"parseInteger"),Qi=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ -parseBigInteger"),Ui=a(function(r){return r?Ve.parse(r,St(JSON.parse)):null},"parseJsonArray"),cr=a( +create(r);return e.parse()},"parseStringArray"),ur=a(function(r){if(!r)return null;var e=ze.create(r, +function(t){return t!==null&&(t=St(t)),t});return e.parse()},"parseDateArray"),Xa=a(function(r){if(!r) +return null;var e=ze.create(r,function(t){return t!==null&&(t=Oi(t)),t});return e.parse()},"parseInt\ +ervalArray"),eu=a(function(r){return r?Ke.parse(r,Et(qi)):null},"parseByteAArray"),cr=a(function(r){ +return parseInt(r,10)},"parseInteger"),Ni=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ +parseBigInteger"),Di=a(function(r){return r?Ke.parse(r,Et(JSON.parse)):null},"parseJsonArray"),lr=a( function(r){return r[0]!=="("?null:(r=r.substring(1,r.length-1).split(","),{x:parseFloat(r[0]),y:parseFloat( -r[1])})},"parsePoint"),eu=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, +r[1])})},"parsePoint"),tu=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, i=2;i{"use strict";p();var z=1e6;function ru(r){var e=r.readInt32BE(0),t=r.readUInt32BE( -4),n="";e<0&&(e=~e+(t===0),t=~t+1>>>0,n="-");var i="",s,o,u,c,l,f;{if(s=e%z,e=e/z>>>0,o=4294967296*s+ -t,t=o/z>>>0,u=""+(o-z*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f>>0,o=4294967296*s+t,t=o/z>>>0,u=""+(o-z*t),t===0&&e===0)return n+u+i;for(c="",l=6-u. -length,f=0;f>>0,o=4294967296*s+t,t=o/z>>>0,u=""+(o-z*t),t===0&& -e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var nu=Hi(),L=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(A,C,D){return A* +r[i])}var s=lr(e);return s.radius=parseFloat(t),s},"parseCircle"),ru=a(function(r){r(20,Ni),r(21,cr), +r(23,cr),r(26,cr),r(700,parseFloat),r(701,parseFloat),r(16,Qi),r(1082,St),r(1114,St),r(1184,St),r(600, +lr),r(651,re),r(718,tu),r(1e3,za),r(1001,eu),r(1005,or),r(1007,or),r(1028,or),r(1016,Za),r(1017,Ja), +r(1021,ar),r(1022,ar),r(1231,ar),r(1014,re),r(1015,re),r(1008,re),r(1009,re),r(1040,re),r(1041,re),r( +1115,ur),r(1182,ur),r(1185,ur),r(1186,Oi),r(1187,Xa),r(17,qi),r(114,JSON.parse.bind(JSON)),r(3802,JSON. +parse.bind(JSON)),r(199,Di),r(3807,Di),r(3907,re),r(2951,re),r(791,re),r(1183,re),r(1270,re)},"init"); +Wi.exports={init:ru}});var Gi=T((bf,Hi)=>{"use strict";p();var K=1e6;function nu(r){var e=r.readInt32BE(0),t=r.readUInt32BE( +4),n="";e<0&&(e=~e+(t===0),t=~t+1>>>0,n="-");var i="",s,o,u,c,l,f;{if(s=e%K,e=e/K>>>0,o=4294967296*s+ +t,t=o/K>>>0,u=""+(o-K*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f>>0,o=4294967296*s+t,t=o/K>>>0,u=""+(o-K*t),t===0&&e===0)return n+u+i;for(c="",l=6-u. +length,f=0;f>>0,o=4294967296*s+t,t=o/K>>>0,u=""+(o-K*t),t===0&& +e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var iu=Gi(),L=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(A,C,D){return A* Math.pow(2,D)+C};var s=t>>3,o=a(function(A){return n?~A&255:A},"inv"),u=255,c=8-t%8;e>t%8);var l=0;t%8+e>=8&&(l=i(0,o(r[s])&u,c));for(var f=e+t>>3,y=s+1;y0&&(l=i(l,o(r[f])>>8-g,g)),l},"parseBits"),Vi=a(function(r,e,t){var n=Math. +r[y]),8);var g=(e+t)%8;return g>0&&(l=i(l,o(r[f])>>8-g,g)),l},"parseBits"),Ki=a(function(r,e,t){var n=Math. pow(2,t-1)-1,i=L(r,1),s=L(r,t,1);if(s===0)return 0;var o=1,u=a(function(l,f,y){l===0&&(l=1);for(var g=1;g<= y;g++)o/=2,(f&1<0&&(l+=o);return l},"parsePrecisionBits"),c=L(r,e,t+1,!1,u);return s==Math.pow( -2,t+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1:-1)*Math.pow(2,s-n)*c},"parseFloatFromBits"),iu=a(function(r){ +2,t+1)-1?c===0?i===0?1/0:-1/0:NaN:(i===0?1:-1)*Math.pow(2,s-n)*c},"parseFloatFromBits"),su=a(function(r){ return L(r,1)==1?-1*(L(r,15,1,!0)+1):L(r,15,1)},"parseInt16"),$i=a(function(r){return L(r,1)==1?-1*(L( -r,31,1,!0)+1):L(r,31,1)},"parseInt32"),su=a(function(r){return Vi(r,23,8)},"parseFloat32"),ou=a(function(r){ -return Vi(r,52,11)},"parseFloat64"),au=a(function(r){var e=L(r,16,32);if(e==49152)return NaN;for(var t=Math. +r,31,1,!0)+1):L(r,31,1)},"parseInt32"),ou=a(function(r){return Ki(r,23,8)},"parseFloat32"),au=a(function(r){ +return Ki(r,52,11)},"parseFloat64"),uu=a(function(r){var e=L(r,16,32);if(e==49152)return NaN;for(var t=Math. pow(1e4,L(r,16,16)),n=0,i=[],s=L(r,16),o=0;o>3,(i+=f<<3)>>3),y;console.log("ERROR: ElementType no\ t implemented: "+l)},"parseElement"),c=a(function(l,f){var y=[],g;if(l.length>1){var A=l.shift();for(g= 0;g0},"parseBool"),lu=a(function(r){r(20,nu),r(21,iu),r(23,$i),r(26,$i),r(1700,au),r(700,su), -r(701,ou),r(16,cu),r(1114,Gi.bind(null,!1)),r(1184,Gi.bind(null,!0)),r(1e3,Ke),r(1007,Ke),r(1016,Ke), -r(1008,Ke),r(1009,Ke),r(25,uu)},"init");zi.exports={init:lu}});var Zi=T((Sf,Yi)=>{p();Yi.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25, +"parseArray"),cu=a(function(r){return r.toString("utf8")},"parseText"),lu=a(function(r){return r===null? +null:L(r,8)>0},"parseBool"),fu=a(function(r){r(20,iu),r(21,su),r(23,$i),r(26,$i),r(1700,uu),r(700,ou), +r(701,au),r(16,lu),r(1114,Vi.bind(null,!1)),r(1184,Vi.bind(null,!0)),r(1e3,Ye),r(1007,Ye),r(1016,Ye), +r(1008,Ye),r(1009,Ye),r(25,cu)},"init");zi.exports={init:fu}});var Ji=T((Cf,Zi)=>{p();Zi.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25, OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194,SMGR:210,PATH:602,POLYGON:604,CIDR:650, FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703,TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829, INET:869,ACLITEM:1033,BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186, TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203,REGOPERATOR:2204, REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220,PG_NDISTINCT:3361,PG_DEPENDENCIES:3402, TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642,REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089, -REGROLE:4096}});var Je=T(Ze=>{p();var fu=Wi(),hu=Ki(),pu=rr(),du=Zi();Ze.getTypeParser=yu;Ze.setTypeParser=mu;Ze.arrayParser= -pu;Ze.builtins=du;var Ye={text:{},binary:{}};function Ji(r){return String(r)}a(Ji,"noParse");function yu(r,e){ -return e=e||"text",Ye[e]&&Ye[e][r]||Ji}a(yu,"getTypeParser");function mu(r,e,t){typeof e=="function"&& -(t=e,e="text"),Ye[e][r]=t}a(mu,"setTypeParser");fu.init(function(r,e){Ye.text[r]=e});hu.init(function(r,e){ -Ye.binary[r]=e})});var At=T((If,Xi)=>{"use strict";p();var wu=Je();function Et(r){this._types=r||wu,this.text={},this.binary= -{}}a(Et,"TypeOverrides");Et.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ -binary":return this.binary;default:return{}}};Et.prototype.setTypeParser=function(r,e,t){typeof e=="\ -function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Et.prototype.getTypeParser=function(r,e){return e= -e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};Xi.exports=Et});function Xe(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119,o=2600822924,u=528734635, +REGROLE:4096}});var Xe=T(Je=>{p();var hu=ji(),pu=Yi(),du=nr(),yu=Ji();Je.getTypeParser=mu;Je.setTypeParser=wu;Je.arrayParser= +du;Je.builtins=yu;var Ze={text:{},binary:{}};function Xi(r){return String(r)}a(Xi,"noParse");function mu(r,e){ +return e=e||"text",Ze[e]&&Ze[e][r]||Xi}a(mu,"getTypeParser");function wu(r,e,t){typeof e=="function"&& +(t=e,e="text"),Ze[e][r]=t}a(wu,"setTypeParser");hu.init(function(r,e){Ze.text[r]=e});pu.init(function(r,e){ +Ze.binary[r]=e})});var Ct=T((Rf,es)=>{"use strict";p();var gu=Xe();function At(r){this._types=r||gu,this.text={},this.binary= +{}}a(At,"TypeOverrides");At.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ +binary":return this.binary;default:return{}}};At.prototype.setTypeParser=function(r,e,t){typeof e=="\ +function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};At.prototype.getTypeParser=function(r,e){return e= +e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};es.exports=At});function et(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119,o=2600822924,u=528734635, c=1541459225,l=0,f=0,y=[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, @@ -568,7 +568,7 @@ encode(I));for(let w=0;w>>8&255,w[15]=i&255,w[16]=s>>>24,w[17]=s>>>16&255,w[18]=s>>>8&255,w[19]=s&255,w[20]=o>>>24,w[21]= o>>>16&255,w[22]=o>>>8&255,w[23]=o&255,w[24]=u>>>24,w[25]=u>>>16&255,w[26]=u>>>8&255,w[27]=u&255,w[28]= c>>>24,w[29]=c>>>16&255,w[30]=c>>>8&255,w[31]=c&255,w},"digest");return r===void 0?{add:Y,digest:P}: -(Y(r),P())}var es=G(()=>{"use strict";p();a(Xe,"sha256")});var U,et,ts=G(()=>{"use strict";p();U=class U{constructor(){E(this,"_dataLength",0);E(this,"_bufferL\ +(Y(r),P())}var ts=$(()=>{"use strict";p();a(et,"sha256")});var U,tt,rs=$(()=>{"use strict";p();U=class U{constructor(){E(this,"_dataLength",0);E(this,"_bufferL\ ength",0);E(this,"_state",new Int32Array(4));E(this,"_buffer",new ArrayBuffer(68));E(this,"_buffer8"); E(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( @@ -630,126 +630,126 @@ o<=4294967295)i[14]=o;else{let u=o.toString(16).match(/(.*?)(.{0,8})$/);if(u===n u[2],16),l=parseInt(u[1],16)||0;i[14]=c,i[15]=l}return U._md5cycle(this._state,i),e?this._state:U._hex( this._state)}};a(U,"Md5"),E(U,"stateIdentity",new Int32Array([1732584193,-271733879,-1732584194,271733878])), E(U,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),E(U,"hexChars","0123456789\ -abcdef"),E(U,"hexOut",[]),E(U,"onePassHasher",new U);et=U});var lr={};ie(lr,{createHash:()=>bu,createHmac:()=>vu,randomBytes:()=>gu});function gu(r){return crypto. -getRandomValues(d.alloc(r))}function bu(r){if(r==="sha256")return{update:a(function(e){return{digest:a( -function(){return d.from(Xe(e))},"digest")}},"update")};if(r==="md5")return{update:a(function(e){return{ -digest:a(function(){return typeof e=="string"?et.hashStr(e):et.hashByteArray(e)},"digest")}},"update")}; -throw new Error(`Hash type '${r}' not supported`)}function vu(r,e){if(r!=="sha256")throw new Error(`\ +abcdef"),E(U,"hexOut",[]),E(U,"onePassHasher",new U);tt=U});var fr={};ie(fr,{createHash:()=>vu,createHmac:()=>xu,randomBytes:()=>bu});function bu(r){return crypto. +getRandomValues(d.alloc(r))}function vu(r){if(r==="sha256")return{update:a(function(e){return{digest:a( +function(){return d.from(et(e))},"digest")}},"update")};if(r==="md5")return{update:a(function(e){return{ +digest:a(function(){return typeof e=="string"?tt.hashStr(e):tt.hashByteArray(e)},"digest")}},"update")}; +throw new Error(`Hash type '${r}' not supported`)}function xu(r,e){if(r!=="sha256")throw new Error(`\ Only sha256 is supported (requested: '${r}')`);return{update:a(function(t){return{digest:a(function(){ typeof e=="string"&&(e=new TextEncoder().encode(e)),typeof t=="string"&&(t=new TextEncoder().encode( -t));let n=e.length;if(n>64)e=Xe(e);else if(n<64){let c=new Uint8Array(64);c.set(e),e=c}let i=new Uint8Array( +t));let n=e.length;if(n>64)e=et(e);else if(n<64){let c=new Uint8Array(64);c.set(e),e=c}let i=new Uint8Array( 64),s=new Uint8Array(64);for(let c=0;c<64;c++)i[c]=54^e[c],s[c]=92^e[c];let o=new Uint8Array(t.length+ -64);o.set(i,0),o.set(t,64);let u=new Uint8Array(96);return u.set(s,0),u.set(Xe(o),64),d.from(Xe(u))}, -"digest")}},"update")}}var fr=G(()=>{"use strict";p();es();ts();a(gu,"randomBytes");a(bu,"createHash"); -a(vu,"createHmac")});var tt=T((Qf,hr)=>{"use strict";p();hr.exports={host:"localhost",user:m.platform==="win32"?m.env.USERNAME: +64);o.set(i,0),o.set(t,64);let u=new Uint8Array(96);return u.set(s,0),u.set(et(o),64),d.from(et(u))}, +"digest")}},"update")}}var hr=$(()=>{"use strict";p();ts();rs();a(bu,"randomBytes");a(vu,"createHash"); +a(xu,"createHmac")});var rt=T((jf,pr)=>{"use strict";p();pr.exports={host:"localhost",user:m.platform==="win32"?m.env.USERNAME: m.env.USER,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4, client_encoding:"",ssl:!1,application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1, statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1,connect_timeout:0, -keepalives:1,keepalives_idle:0};var Me=Je(),xu=Me.getTypeParser(20,"text"),Su=Me.getTypeParser(1016, -"text");hr.exports.__defineSetter__("parseInt8",function(r){Me.setTypeParser(20,"text",r?Me.getTypeParser( -23,"text"):xu),Me.setTypeParser(1016,"text",r?Me.getTypeParser(1007,"text"):Su)})});var rt=T((Wf,ns)=>{"use strict";p();var Eu=(fr(),O(lr)),Au=tt();function Cu(r){var e=r.replace(/\\/g, -"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(Cu,"escapeElement");function rs(r){for(var e="{",t=0;t< -r.length;t++)t>0&&(e=e+","),r[t]===null||typeof r[t]>"u"?e=e+"NULL":Array.isArray(r[t])?e=e+rs(r[t]): -r[t]instanceof d?e+="\\\\x"+r[t].toString("hex"):e+=Cu(Ct(r[t]));return e=e+"}",e}a(rs,"arrayString"); -var Ct=a(function(r,e){if(r==null)return null;if(r instanceof d)return r;if(ArrayBuffer.isView(r)){var t=d. +keepalives:1,keepalives_idle:0};var Me=Xe(),Su=Me.getTypeParser(20,"text"),Eu=Me.getTypeParser(1016, +"text");pr.exports.__defineSetter__("parseInt8",function(r){Me.setTypeParser(20,"text",r?Me.getTypeParser( +23,"text"):Su),Me.setTypeParser(1016,"text",r?Me.getTypeParser(1007,"text"):Eu)})});var nt=T((Gf,is)=>{"use strict";p();var Au=(hr(),O(fr)),Cu=rt();function _u(r){var e=r.replace(/\\/g, +"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(_u,"escapeElement");function ns(r){for(var e="{",t=0;t< +r.length;t++)t>0&&(e=e+","),r[t]===null||typeof r[t]>"u"?e=e+"NULL":Array.isArray(r[t])?e=e+ns(r[t]): +r[t]instanceof d?e+="\\\\x"+r[t].toString("hex"):e+=_u(_t(r[t]));return e=e+"}",e}a(ns,"arrayString"); +var _t=a(function(r,e){if(r==null)return null;if(r instanceof d)return r;if(ArrayBuffer.isView(r)){var t=d. from(r.buffer,r.byteOffset,r.byteLength);return t.length===r.byteLength?t:t.slice(r.byteOffset,r.byteOffset+ -r.byteLength)}return r instanceof Date?Au.parseInputDatesAsUTC?Tu(r):Iu(r):Array.isArray(r)?rs(r):typeof r== -"object"?_u(r,e):r.toString()},"prepareValue");function _u(r,e){if(r&&typeof r.toPostgres=="function"){ +r.byteLength)}return r instanceof Date?Cu.parseInputDatesAsUTC?Pu(r):Tu(r):Array.isArray(r)?ns(r):typeof r== +"object"?Iu(r,e):r.toString()},"prepareValue");function Iu(r,e){if(r&&typeof r.toPostgres=="function"){ if(e=e||[],e.indexOf(r)!==-1)throw new Error('circular reference detected while preparing "'+r+'" fo\ -r query');return e.push(r),Ct(r.toPostgres(Ct),e)}return JSON.stringify(r)}a(_u,"prepareObject");function N(r,e){ -for(r=""+r;r.lengthku});var ku,it=G(()=>{"use strict";p();ku={}});var ds=T((th,ps)=>{"use strict";p();var yr=(fr(),O(lr));function Mu(r){if(r.indexOf("SCRAM-SHA-256")=== --1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=yr.randomBytes( +t),r}a(Ru,"normalizeQueryConfig");var dr=a(function(r){return Au.createHash("md5").update(r,"utf-8"). +digest("hex")},"md5"),Bu=a(function(r,e,t){var n=dr(e+r),i=dr(d.concat([d.from(n),t]));return"md5"+i}, +"postgresMd5PasswordHash");is.exports={prepareValue:a(function(e){return _t(e)},"prepareValueWrapper"), +normalizeQueryConfig:Ru,postgresMd5PasswordHash:Bu,md5:dr}});var it={};ie(it,{default:()=>Mu});var Mu,st=$(()=>{"use strict";p();Mu={}});var ys=T((sh,ds)=>{"use strict";p();var mr=(hr(),O(fr));function Uu(r){if(r.indexOf("SCRAM-SHA-256")=== +-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=mr.randomBytes( 18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"\ -SASLInitialResponse"}}a(Mu,"startSession");function Uu(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( +SASLInitialResponse"}}a(Uu,"startSession");function Du(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( "SASL: Last message was not SASLInitialResponse");if(typeof e!="string")throw new Error("SASL: SCRAM\ -SERVER-FIRST-MESSAGE: client password must be a string");if(typeof t!="string")throw new Error("SAS\ -L: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=qu(t);if(n.nonce.startsWith(r.clientNonce)){ +L: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=Qu(t);if(n.nonce.startsWith(r.clientNonce)){ if(n.nonce.length===r.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server n\ once is too short")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not st\ -art with client nonce");var i=d.from(n.salt,"base64"),s=Wu(e,i,n.iteration),o=Ue(s,"Client Key"),u=Nu( +art with client nonce");var i=d.from(n.salt,"base64"),s=ju(e,i,n.iteration),o=Ue(s,"Client Key"),u=Wu( o),c="n=*,r="+r.clientNonce,l="r="+n.nonce+",s="+n.salt+",i="+n.iteration,f="c=biws,r="+n.nonce,y=c+ -","+l+","+f,g=Ue(u,y),A=hs(o,g),C=A.toString("base64"),D=Ue(s,"Server Key"),Y=Ue(D,y);r.message="SAS\ -LResponse",r.serverSignature=Y.toString("base64"),r.response=f+",p="+C}a(Uu,"continueSession");function Du(r,e){ +","+l+","+f,g=Ue(u,y),A=ps(o,g),C=A.toString("base64"),D=Ue(s,"Server Key"),Y=Ue(D,y);r.message="SAS\ +LResponse",r.serverSignature=Y.toString("base64"),r.response=f+",p="+C}a(Du,"continueSession");function Ou(r,e){ if(r.message!=="SASLResponse")throw new Error("SASL: Last message was not SASLResponse");if(typeof e!= -"string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=Qu( +"string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=Nu( e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does\ - not match")}a(Du,"finalizeSession");function Ou(r){if(typeof r!="string")throw new TypeError("SASL:\ + not match")}a(Ou,"finalizeSession");function qu(r){if(typeof r!="string")throw new TypeError("SASL:\ text must be a string");return r.split("").map((e,t)=>r.charCodeAt(t)).every(e=>e>=33&&e<=43||e>=45&& -e<=126)}a(Ou,"isPrintableChars");function ls(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(r)}a(ls,"isBase64");function fs(r){if(typeof r!="string")throw new TypeError("SASL: attribute p\ +e<=126)}a(qu,"isPrintableChars");function fs(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(r)}a(fs,"isBase64");function hs(r){if(typeof r!="string")throw new TypeError("SASL: attribute p\ airs text must be a string");return new Map(r.split(",").map(e=>{if(!/^.=/.test(e))throw new Error("\ -SASL: Invalid attribute pair entry");let t=e[0],n=e.substring(2);return[t,n]}))}a(fs,"parseAttribute\ -Pairs");function qu(r){let e=fs(r),t=e.get("r");if(t){if(!Ou(t))throw new Error("SASL: SCRAM-SERVER-\ +SASL: Invalid attribute pair entry");let t=e[0],n=e.substring(2);return[t,n]}))}a(hs,"parseAttribute\ +Pairs");function Qu(r){let e=hs(r),t=e.get("r");if(t){if(!qu(t))throw new Error("SASL: SCRAM-SERVER-\ FIRST-MESSAGE: nonce must only contain printable characters")}else throw new Error("SASL: SCRAM-SERV\ -ER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!ls(n))throw new Error("SASL: SCRAM-SERV\ +ER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!fs(n))throw new Error("SASL: SCRAM-SERV\ ER-FIRST-MESSAGE: salt must be base64")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt\ missing");let i=e.get("i");if(i){if(!/^[1-9][0-9]*$/.test(i))throw new Error("SASL: SCRAM-SERVER-FI\ RST-MESSAGE: invalid iteration count")}else throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: itera\ -tion missing");let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(qu,"parseServerFirstMessage"); -function Qu(r){let t=fs(r).get("v");if(t){if(!ls(t))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAG\ +tion missing");let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(Qu,"parseServerFirstMessage"); +function Nu(r){let t=hs(r).get("v");if(t){if(!fs(t))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAG\ E: server signature must be base64")}else throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server \ -signature is missing");return{serverSignature:t}}a(Qu,"parseServerFinalMessage");function hs(r,e){if(!d. +signature is missing");return{serverSignature:t}}a(Nu,"parseServerFinalMessage");function ps(r,e){if(!d. isBuffer(r))throw new TypeError("first argument must be a Buffer");if(!d.isBuffer(e))throw new TypeError( "second argument must be a Buffer");if(r.length!==e.length)throw new Error("Buffer lengths must matc\ h");if(r.length===0)throw new Error("Buffers cannot be empty");return d.from(r.map((t,n)=>r[n]^e[n]))} -a(hs,"xorBuffers");function Nu(r){return yr.createHash("sha256").update(r).digest()}a(Nu,"sha256");function Ue(r,e){ -return yr.createHmac("sha256",r).update(e).digest()}a(Ue,"hmacSha256");function Wu(r,e,t){for(var n=Ue( -r,d.concat([e,d.from([0,0,0,1])])),i=n,s=0;sju});function ju(...r){return r.join("/")}var wr=G(()=>{"use strict";p();a( -ju,"join")});var gr={};ie(gr,{stat:()=>Hu});function Hu(r,e){e(new Error("No filesystem"))}var br=G(()=>{"use str\ -ict";p();a(Hu,"stat")});var vr={};ie(vr,{default:()=>$u});var $u,xr=G(()=>{"use strict";p();$u={}});var ys={};ie(ys,{StringDecoder:()=>Sr});var Er,Sr,ms=G(()=>{"use strict";p();Er=class Er{constructor(e){ +a(ps,"xorBuffers");function Wu(r){return mr.createHash("sha256").update(r).digest()}a(Wu,"sha256");function Ue(r,e){ +return mr.createHmac("sha256",r).update(e).digest()}a(Ue,"hmacSha256");function ju(r,e,t){for(var n=Ue( +r,d.concat([e,d.from([0,0,0,1])])),i=n,s=0;sHu});function Hu(...r){return r.join("/")}var gr=$(()=>{"use strict";p();a( +Hu,"join")});var br={};ie(br,{stat:()=>Gu});function Gu(r,e){e(new Error("No filesystem"))}var vr=$(()=>{"use str\ +ict";p();a(Gu,"stat")});var xr={};ie(xr,{default:()=>$u});var $u,Sr=$(()=>{"use strict";p();$u={}});var ms={};ie(ms,{StringDecoder:()=>Er});var Ar,Er,ws=$(()=>{"use strict";p();Ar=class Ar{constructor(e){ E(this,"td");this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this. -td.decode(e)}};a(Er,"StringDecoder");Sr=Er});var vs=T((fh,bs)=>{"use strict";p();var{Transform:Gu}=(xr(),O(vr)),{StringDecoder:Vu}=(ms(),O(ys)),ve=Symbol( -"last"),It=Symbol("decoder");function zu(r,e,t){let n;if(this.overflow){if(n=this[It].write(r).split( -this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[ve]+=this[It].write(r),n= -this[ve].split(this.matcher);this[ve]=n.pop();for(let i=0;i{"use strict";p();var{Transform:Vu}=(Sr(),O(xr)),{StringDecoder:Ku}=(ws(),O(ms)),ve=Symbol( +"last"),Tt=Symbol("decoder");function zu(r,e,t){let n;if(this.overflow){if(n=this[Tt].write(r).split( +this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[ve]+=this[Tt].write(r),n= +this[ve].split(this.matcher);this[ve]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( -"maximum buffer reached"));return}t()}a(zu,"transform");function Ku(r){if(this[ve]+=this[It].end(),this[ve]) -try{gs(this,this.mapper(this[ve]))}catch(e){return r(e)}r()}a(Ku,"flush");function gs(r,e){e!==void 0&& -r.push(e)}a(gs,"push");function ws(r){return r}a(ws,"noop");function Yu(r,e,t){switch(r=r||/\r?\n/,e= -e||ws,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r=="object"&&!(r instanceof +"maximum buffer reached"));return}t()}a(zu,"transform");function Yu(r){if(this[ve]+=this[Tt].end(),this[ve]) +try{bs(this,this.mapper(this[ve]))}catch(e){return r(e)}r()}a(Yu,"flush");function bs(r,e){e!==void 0&& +r.push(e)}a(bs,"push");function gs(r){return r}a(gs,"noop");function Zu(r,e,t){switch(r=r||/\r?\n/,e= +e||gs,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r=="object"&&!(r instanceof RegExp)&&!r[Symbol.split]&&(t=r,r=/\r?\n/);break;case 2:typeof r=="function"?(t=e,e=r,r=/\r?\n/):typeof e== -"object"&&(t=e,e=ws)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=zu,t.flush=Ku,t.readableObjectMode= -!0;let n=new Gu(t);return n[ve]="",n[It]=new Vu("utf8"),n.matcher=r,n.mapper=e,n.maxLength=t.maxLength, +"object"&&(t=e,e=gs)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=zu,t.flush=Yu,t.readableObjectMode= +!0;let n=new Vu(t);return n[ve]="",n[Tt]=new Ku("utf8"),n.matcher=r,n.mapper=e,n.maxLength=t.maxLength, n.skipOverflow=t.skipOverflow||!1,n.overflow=!1,n._destroy=function(i,s){this._writableState.errorEmitted= -!1,s(i)},n}a(Yu,"split");bs.exports=Yu});var Es=T((dh,pe)=>{"use strict";p();var xs=(wr(),O(mr)),Zu=(xr(),O(vr)).Stream,Ju=vs(),Ss=(it(),O(nt)), -Xu=5432,Tt=m.platform==="win32",st=m.stderr,ec=56,tc=7,rc=61440,nc=32768;function ic(r){return(r&rc)== -nc}a(ic,"isRegFile");var De=["host","port","database","user","password"],Ar=De.length,sc=De[Ar-1];function Cr(){ -var r=st instanceof Zu&&st.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` -`);st.write(Ss.format.apply(Ss,e))}}a(Cr,"warn");Object.defineProperty(pe.exports,"isWin",{get:a(function(){ -return Tt},"get"),set:a(function(r){Tt=r},"set")});pe.exports.warnTo=function(r){var e=st;return st= -r,e};pe.exports.getFileName=function(r){var e=r||m.env,t=e.PGPASSFILE||(Tt?xs.join(e.APPDATA||"./","\ -postgresql","pgpass.conf"):xs.join(e.HOME||"./",".pgpass"));return t};pe.exports.usePgPass=function(r,e){ -return Object.prototype.hasOwnProperty.call(m.env,"PGPASSWORD")?!1:Tt?!0:(e=e||"",ic(r.mode)?r. -mode&(ec|tc)?(Cr('WARNING: password file "%s" has group or world access; permissions should be u=rw \ -(0600) or less',e),!1):!0:(Cr('WARNING: password file "%s" is not a plain file',e),!1))};var oc=pe.exports. -match=function(r,e){return De.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||Xu)===Number( +!1,s(i)},n}a(Zu,"split");vs.exports=Zu});var As=T((gh,pe)=>{"use strict";p();var Ss=(gr(),O(wr)),Ju=(Sr(),O(xr)).Stream,Xu=xs(),Es=(st(),O(it)), +ec=5432,Pt=m.platform==="win32",ot=m.stderr,tc=56,rc=7,nc=61440,ic=32768;function sc(r){return(r&nc)== +ic}a(sc,"isRegFile");var De=["host","port","database","user","password"],Cr=De.length,oc=De[Cr-1];function _r(){ +var r=ot instanceof Ju&&ot.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +`);ot.write(Es.format.apply(Es,e))}}a(_r,"warn");Object.defineProperty(pe.exports,"isWin",{get:a(function(){ +return Pt},"get"),set:a(function(r){Pt=r},"set")});pe.exports.warnTo=function(r){var e=ot;return ot= +r,e};pe.exports.getFileName=function(r){var e=r||m.env,t=e.PGPASSFILE||(Pt?Ss.join(e.APPDATA||"./","\ +postgresql","pgpass.conf"):Ss.join(e.HOME||"./",".pgpass"));return t};pe.exports.usePgPass=function(r,e){ +return Object.prototype.hasOwnProperty.call(m.env,"PGPASSWORD")?!1:Pt?!0:(e=e||"",sc(r.mode)?r. +mode&(tc|rc)?(_r('WARNING: password file "%s" has group or world access; permissions should be u=rw \ +(0600) or less',e),!1):!0:(_r('WARNING: password file "%s" is not a plain file',e),!1))};var ac=pe.exports. +match=function(r,e){return De.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||ec)===Number( e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};pe.exports.getPassword=function(r,e,t){var n,i=e.pipe( -Ju());function s(c){var l=ac(c);l&&uc(l)&&oc(r,l)&&(n=l[sc],i.end())}a(s,"onLine");var o=a(function(){ -e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),Cr("WARNING: error on reading file: %s",c),t( -void 0)},"onErr");e.on("error",u),i.on("data",s).on("end",o).on("error",u)};var ac=pe.exports.parseLine= +Xu());function s(c){var l=uc(c);l&&cc(l)&&ac(r,l)&&(n=l[oc],i.end())}a(s,"onLine");var o=a(function(){ +e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),_r("WARNING: error on reading file: %s",c),t( +void 0)},"onErr");e.on("error",u),i.on("data",s).on("end",o).on("error",u)};var uc=pe.exports.parseLine= function(r){if(r.length<11||r.match(/^\s+#/))return null;for(var e="",t="",n=0,i=0,s=0,o={},u=!1,c=a( function(f,y,g){var A=r.substring(y,g);Object.hasOwnProperty.call(m.env,"PGPASS_NO_DEESCAPE")||(A=A. replace(/\\([:\\])/g,"$1")),o[De[f]]=A},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). -length===Ar?o:null,o},uc=pe.exports.isValidEntry=function(r){for(var e={0:function(o){return o.length> +l),u=n==Cr-1,u){c(n,i);break}l>=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). +length===Cr?o:null,o},cc=pe.exports.isValidEntry=function(r){for(var e={0:function(o){return o.length> 0},1:function(o){return o==="*"?!0:(o=Number(o),isFinite(o)&&o>0&&o<9007199254740992&&Math.floor(o)=== o)},2:function(o){return o.length>0},3:function(o){return o.length>0},4:function(o){return o.length> -0}},t=0;t{"use strict";p();var wh=(wr(),O(mr)),As=(br(),O(gr)),Pt=Es();_r.exports=function(r,e){ -var t=Pt.getFileName();As.stat(t,function(n,i){if(n||!Pt.usePgPass(i,t))return e(void 0);var s=As.createReadStream( -t);Pt.getPassword(r,s,e)})};_r.exports.warnTo=Pt.warnTo});var _s={};ie(_s,{default:()=>cc});var cc,Is=G(()=>{"use strict";p();cc={}});var Ps=T((xh,Ts)=>{"use strict";p();var lc=(Zt(),O(gi)),Ir=(br(),O(gr));function Tr(r){if(r.charAt(0)=== -"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=lc.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i. +0}},t=0;t{"use strict";p();var xh=(gr(),O(wr)),Cs=(vr(),O(br)),Rt=As();Ir.exports=function(r,e){ +var t=Rt.getFileName();Cs.stat(t,function(n,i){if(n||!Rt.usePgPass(i,t))return e(void 0);var s=Cs.createReadStream( +t);Rt.getPassword(r,s,e)})};Ir.exports.warnTo=Rt.warnTo});var Is={};ie(Is,{default:()=>lc});var lc,Ts=$(()=>{"use strict";p();lc={}});var Rs=T((Ch,Ps)=>{"use strict";p();var fc=(Jt(),O(bi)),Tr=(vr(),O(br));function Pr(r){if(r.charAt(0)=== +"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=fc.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i. test(r)?encodeURI(r).replace(/\%25(\d\d)/g,"%$1"):r,!0),t=e.query;for(var n in t)Array.isArray(t[n])&& (t[n]=t[n][t[n].length-1]);var i=(e.auth||":").split(":");if(t.user=i[0],t.password=i.splice(1).join( ":"),t.port=e.port,e.protocol=="socket:")return t.host=decodeURI(e.pathname),t.database=e.query.db,t. @@ -757,20 +757,20 @@ client_encoding=e.query.encoding,t;t.host||(t.host=e.hostname);var s=e.pathname; test(s)){var o=s.split("/");t.host=decodeURIComponent(o[0]),s=o.splice(1).join("/")}switch(s&&s.charAt( 0)==="/"&&(s=s.slice(1)||null),t.database=s&&decodeURI(s),(t.ssl==="true"||t.ssl==="1")&&(t.ssl=!0), t.ssl==="0"&&(t.ssl=!1),(t.sslcert||t.sslkey||t.sslrootcert||t.sslmode)&&(t.ssl={}),t.sslcert&&(t.ssl. -cert=Ir.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=Ir.readFileSync(t.sslkey).toString()), -t.sslrootcert&&(t.ssl.ca=Ir.readFileSync(t.sslrootcert).toString()),t.sslmode){case"disable":{t.ssl= +cert=Tr.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=Tr.readFileSync(t.sslkey).toString()), +t.sslrootcert&&(t.ssl.ca=Tr.readFileSync(t.sslrootcert).toString()),t.sslmode){case"disable":{t.ssl= !1;break}case"prefer":case"require":case"verify-ca":case"verify-full":break;case"no-verify":{t.ssl.rejectUnauthorized= -!1;break}}return t}a(Tr,"parse");Ts.exports=Tr;Tr.parse=Tr});var Rt=T((Ah,Ls)=>{"use strict";p();var fc=(Is(),O(_s)),Bs=tt(),Rs=Ps().parse,H=a(function(r,e,t){return t=== -void 0?t=m.env["PG"+r.toUpperCase()]:t===!1||(t=m.env[t]),e[r]||t||Bs[r]},"val"),hc=a(function(){switch(m. +!1;break}}return t}a(Pr,"parse");Ps.exports=Pr;Pr.parse=Pr});var Bt=T((Th,Fs)=>{"use strict";p();var hc=(Ts(),O(Is)),Ls=rt(),Bs=Rs().parse,H=a(function(r,e,t){return t=== +void 0?t=m.env["PG"+r.toUpperCase()]:t===!1||(t=m.env[t]),e[r]||t||Ls[r]},"val"),pc=a(function(){switch(m. env.PGSSLMODE){case"disable":return!1;case"prefer":case"require":case"verify-ca":case"verify-full":return!0;case"\ -no-verify":return{rejectUnauthorized:!1}}return Bs.ssl},"readSSLConfigFromEnvironment"),Oe=a(function(r){ +no-verify":return{rejectUnauthorized:!1}}return Ls.ssl},"readSSLConfigFromEnvironment"),Oe=a(function(r){ return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),ne=a(function(r,e,t){ -var n=e[t];n!=null&&r.push(t+"="+Oe(n))},"add"),Rr=class Rr{constructor(e){e=typeof e=="string"?Rs(e): -e||{},e.connectionString&&(e=Object.assign({},e,Rs(e.connectionString))),this.user=H("user",e),this. +var n=e[t];n!=null&&r.push(t+"="+Oe(n))},"add"),Br=class Br{constructor(e){e=typeof e=="string"?Bs(e): +e||{},e.connectionString&&(e=Object.assign({},e,Bs(e.connectionString))),this.user=H("user",e),this. database=H("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(H("por\ t",e),10),this.host=H("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, writable:!0,value:H("password",e)}),this.binary=H("binary",e),this.options=H("options",e),this.ssl=typeof e. -ssl>"u"?hc():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="no-verify"&& +ssl>"u"?pc():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="no-verify"&& (this.ssl={rejectUnauthorized:!1}),this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}), this.client_encoding=H("client_encoding",e),this.replication=H("replication",e),this.isDomainSocket= !(this.host||"").indexOf("/"),this.application_name=H("application_name",e,"PGAPPNAME"),this.fallback_application_name= @@ -786,25 +786,25 @@ ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(ne(t,n,"sslmode"),ne(t, slkey"),ne(t,n,"sslcert"),ne(t,n,"sslrootcert"),this.database&&t.push("dbname="+Oe(this.database)),this. replication&&t.push("replication="+Oe(this.replication)),this.host&&t.push("host="+Oe(this.host)),this. isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+Oe(this.client_encoding)), -fc.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+Oe(s)),e(null,t.join(" ")))})}}; -a(Rr,"ConnectionParameters");var Pr=Rr;Ls.exports=Pr});var Ms=T((Ih,ks)=>{"use strict";p();var pc=Je(),Fs=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,Lr=class Lr{constructor(e,t){ +hc.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+Oe(s)),e(null,t.join(" ")))})}}; +a(Br,"ConnectionParameters");var Rr=Br;Fs.exports=Rr});var Us=T((Bh,Ms)=>{"use strict";p();var dc=Xe(),ks=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,Fr=class Fr{constructor(e,t){ this.command=null,this.rowCount=null,this.oid=null,this.rows=[],this.fields=[],this._parsers=void 0, this._types=t,this.RowCtor=null,this.rowAsArray=e==="array",this.rowAsArray&&(this.parseRow=this._parseRowAsArray)}addCommandComplete(e){ -var t;e.text?t=Fs.exec(e.text):t=Fs.exec(e.command),t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2], +var t;e.text?t=ks.exec(e.text):t=ks.exec(e.command),t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2], 10),this.rowCount=parseInt(t[3],10)):t[2]&&(this.rowCount=parseInt(t[2],10)))}_parseRowAsArray(e){for(var t=new Array( e.length),n=0,i=e.length;n{"use strict";p();var{EventEmitter:dc}=ge(),Us=Ms(),Ds=rt(),kr=class kr extends dc{constructor(e,t,n){ -super(),e=Ds.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this.rows=e.rows,this. +_types.getTypeParser(n.dataTypeID,n.format||"text"):this._parsers[t]=dc.getTypeParser(n.dataTypeID,n. +format||"text")}}};a(Fr,"Result");var Lr=Fr;Ms.exports=Lr});var Qs=T((kh,qs)=>{"use strict";p();var{EventEmitter:yc}=ge(),Ds=Us(),Os=nt(),Mr=class Mr extends yc{constructor(e,t,n){ +super(),e=Os.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this.rows=e.rows,this. types=e.types,this.name=e.name,this.binary=e.binary,this.portal=e.portal||"",this.callback=e.callback, this._rowMode=e.rowMode,m.domain&&e.callback&&(this.callback=m.domain.bind(e.callback)),this._result= -new Us(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError= +new Ds(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError= !1,this._promise=null}requiresPreparation(){return this.name||this.rows?!0:!this.text||!this.values? !1:this.values.length>0}_checkForMultirow(){this._result.command&&(Array.isArray(this._results)||(this. -_results=[this._result]),this._result=new Us(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ +_results=[this._result]),this._result=new Ds(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ this._checkForMultirow(),this._result.addFields(e.fields),this._accumulateRows=this.callback||!this. listeners("row").length}handleDataRow(e){let t;if(!this._canceledDueToError){try{t=this._result.parseRow( e.fields)}catch(n){this._canceledDueToError=n;return}this.emit("row",t,this._result),this._accumulateRows&& @@ -821,10 +821,10 @@ ues must be an array"):(this.requiresPreparation()?this.prepare(e):e.query(this. return this.name&&e.parsedStatements[this.name]}handlePortalSuspended(e){this._getRows(e,this.rows)}_getRows(e,t){ e.execute({portal:this.portal,rows:t}),t?e.flush():e.sync()}prepare(e){this.isPreparedStatement=!0,this. hasBeenParsed(e)||e.parse({text:this.text,name:this.name,types:this.types});try{e.bind({portal:this. -portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:Ds.prepareValue})}catch(t){ +portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:Os.prepareValue})}catch(t){ this.handleError(t,e);return}e.describe({type:"P",name:this.portal||""}),this._getRows(e,this.rows)}handleCopyInResponse(e){ -e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(kr,"Query");var Fr=kr;Os.exports= -Fr});var ln=T(_=>{"use strict";p();Object.defineProperty(_,"__esModule",{value:!0});_.NoticeMessage=_.DataRowMessage= +e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(Mr,"Query");var kr=Mr;qs.exports= +kr});var fn=T(_=>{"use strict";p();Object.defineProperty(_,"__esModule",{value:!0});_.NoticeMessage=_.DataRowMessage= _.CommandCompleteMessage=_.ReadyForQueryMessage=_.NotificationResponseMessage=_.BackendKeyDataMessage= _.AuthenticationMD5Password=_.ParameterStatusMessage=_.ParameterDescriptionMessage=_.RowDescriptionMessage= _.Field=_.CopyResponse=_.CopyDataMessage=_.DatabaseError=_.copyDone=_.emptyQuery=_.replicationStart= @@ -832,30 +832,30 @@ _.portalSuspended=_.noData=_.closeComplete=_.bindComplete=_.parseComplete=void 0 parseComplete",length:5};_.bindComplete={name:"bindComplete",length:5};_.closeComplete={name:"closeC\ omplete",length:5};_.noData={name:"noData",length:5};_.portalSuspended={name:"portalSuspended",length:5}; _.replicationStart={name:"replicationStart",length:4};_.emptyQuery={name:"emptyQuery",length:4};_.copyDone= -{name:"copyDone",length:4};var Kr=class Kr extends Error{constructor(e,t,n){super(e),this.length=t,this. -name=n}};a(Kr,"DatabaseError");var Mr=Kr;_.DatabaseError=Mr;var Yr=class Yr{constructor(e,t){this.length= -e,this.chunk=t,this.name="copyData"}};a(Yr,"CopyDataMessage");var Ur=Yr;_.CopyDataMessage=Ur;var Zr=class Zr{constructor(e,t,n,i){ -this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Zr,"CopyResponse");var Dr=Zr; -_.CopyResponse=Dr;var Jr=class Jr{constructor(e,t,n,i,s,o,u){this.name=e,this.tableID=t,this.columnID= -n,this.dataTypeID=i,this.dataTypeSize=s,this.dataTypeModifier=o,this.format=u}};a(Jr,"Field");var Or=Jr; -_.Field=Or;var Xr=class Xr{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ -n",this.fields=new Array(this.fieldCount)}};a(Xr,"RowDescriptionMessage");var qr=Xr;_.RowDescriptionMessage= -qr;var en=class en{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ -ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(en,"ParameterDescriptionMessage");var Qr=en; -_.ParameterDescriptionMessage=Qr;var tn=class tn{constructor(e,t,n){this.length=e,this.parameterName= -t,this.parameterValue=n,this.name="parameterStatus"}};a(tn,"ParameterStatusMessage");var Nr=tn;_.ParameterStatusMessage= -Nr;var rn=class rn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; -a(rn,"AuthenticationMD5Password");var Wr=rn;_.AuthenticationMD5Password=Wr;var nn=class nn{constructor(e,t,n){ -this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(nn,"BackendKeyDataMes\ -sage");var jr=nn;_.BackendKeyDataMessage=jr;var sn=class sn{constructor(e,t,n,i){this.length=e,this. -processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(sn,"NotificationResponseMessa\ -ge");var Hr=sn;_.NotificationResponseMessage=Hr;var on=class on{constructor(e,t){this.length=e,this. -status=t,this.name="readyForQuery"}};a(on,"ReadyForQueryMessage");var $r=on;_.ReadyForQueryMessage=$r; -var an=class an{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(an,"Comma\ -ndCompleteMessage");var Gr=an;_.CommandCompleteMessage=Gr;var un=class un{constructor(e,t){this.length= -e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(un,"DataRowMessage");var Vr=un;_.DataRowMessage= -Vr;var cn=class cn{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(cn,"NoticeMe\ -ssage");var zr=cn;_.NoticeMessage=zr});var Qs=T(Bt=>{"use strict";p();Object.defineProperty(Bt,"__esModule",{value:!0});Bt.Writer=void 0;var hn=class hn{constructor(e=256){ +{name:"copyDone",length:4};var Yr=class Yr extends Error{constructor(e,t,n){super(e),this.length=t,this. +name=n}};a(Yr,"DatabaseError");var Ur=Yr;_.DatabaseError=Ur;var Zr=class Zr{constructor(e,t){this.length= +e,this.chunk=t,this.name="copyData"}};a(Zr,"CopyDataMessage");var Dr=Zr;_.CopyDataMessage=Dr;var Jr=class Jr{constructor(e,t,n,i){ +this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Jr,"CopyResponse");var Or=Jr; +_.CopyResponse=Or;var Xr=class Xr{constructor(e,t,n,i,s,o,u){this.name=e,this.tableID=t,this.columnID= +n,this.dataTypeID=i,this.dataTypeSize=s,this.dataTypeModifier=o,this.format=u}};a(Xr,"Field");var qr=Xr; +_.Field=qr;var en=class en{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ +n",this.fields=new Array(this.fieldCount)}};a(en,"RowDescriptionMessage");var Qr=en;_.RowDescriptionMessage= +Qr;var tn=class tn{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ +ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(tn,"ParameterDescriptionMessage");var Nr=tn; +_.ParameterDescriptionMessage=Nr;var rn=class rn{constructor(e,t,n){this.length=e,this.parameterName= +t,this.parameterValue=n,this.name="parameterStatus"}};a(rn,"ParameterStatusMessage");var Wr=rn;_.ParameterStatusMessage= +Wr;var nn=class nn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; +a(nn,"AuthenticationMD5Password");var jr=nn;_.AuthenticationMD5Password=jr;var sn=class sn{constructor(e,t,n){ +this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(sn,"BackendKeyDataMes\ +sage");var Hr=sn;_.BackendKeyDataMessage=Hr;var on=class on{constructor(e,t,n,i){this.length=e,this. +processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(on,"NotificationResponseMessa\ +ge");var Gr=on;_.NotificationResponseMessage=Gr;var an=class an{constructor(e,t){this.length=e,this. +status=t,this.name="readyForQuery"}};a(an,"ReadyForQueryMessage");var $r=an;_.ReadyForQueryMessage=$r; +var un=class un{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(un,"Comma\ +ndCompleteMessage");var Vr=un;_.CommandCompleteMessage=Vr;var cn=class cn{constructor(e,t){this.length= +e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(cn,"DataRowMessage");var Kr=cn;_.DataRowMessage= +Kr;var ln=class ln{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(ln,"NoticeMe\ +ssage");var zr=ln;_.NoticeMessage=zr});var Ns=T(Lt=>{"use strict";p();Object.defineProperty(Lt,"__esModule",{value:!0});Lt.Writer=void 0;var pn=class pn{constructor(e=256){ this.size=e,this.offset=5,this.headerPosition=0,this.buffer=d.allocUnsafe(e)}ensure(e){if(this.buffer. length-this.offset>1)+e;this.buffer=d.allocUnsafe(i),n.copy( this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this. @@ -867,48 +867,48 @@ return this.ensure(t),this.buffer.write(e,this.offset),this.offset+=t,this}add(e e.length),e.copy(this.buffer,this.offset),this.offset+=e.length,this}join(e){if(e){this.buffer[this. headerPosition]=e;let t=this.offset-(this.headerPosition+1);this.buffer.writeInt32BE(t,this.headerPosition+ 1)}return this.buffer.slice(e?0:5,this.offset)}flush(e){let t=this.join(e);return this.offset=5,this. -headerPosition=0,this.buffer=d.allocUnsafe(this.size),t}};a(hn,"Writer");var fn=hn;Bt.Writer=fn});var Ws=T(Ft=>{"use strict";p();Object.defineProperty(Ft,"__esModule",{value:!0});Ft.serialize=void 0; -var pn=Qs(),F=new pn.Writer,yc=a(r=>{F.addInt16(3).addInt16(0);for(let n of Object.keys(r))F.addCString( +headerPosition=0,this.buffer=d.allocUnsafe(this.size),t}};a(pn,"Writer");var hn=pn;Lt.Writer=hn});var js=T(kt=>{"use strict";p();Object.defineProperty(kt,"__esModule",{value:!0});kt.serialize=void 0; +var dn=Ns(),F=new dn.Writer,mc=a(r=>{F.addInt16(3).addInt16(0);for(let n of Object.keys(r))F.addCString( n).addCString(r[n]);F.addCString("client_encoding").addCString("UTF8");let e=F.addCString("").flush(), -t=e.length+4;return new pn.Writer().addInt32(t).add(e).flush()},"startup"),mc=a(()=>{let r=d.allocUnsafe( -8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),wc=a(r=>F.addCString(r).flush( -112),"password"),gc=a(function(r,e){return F.addCString(r).addInt32(d.byteLength(e)).addString(e),F. -flush(112)},"sendSASLInitialResponseMessage"),bc=a(function(r){return F.addString(r).flush(112)},"se\ -ndSCRAMClientFinalMessage"),vc=a(r=>F.addCString(r).flush(81),"query"),Ns=[],xc=a(r=>{let e=r.name|| +t=e.length+4;return new dn.Writer().addInt32(t).add(e).flush()},"startup"),wc=a(()=>{let r=d.allocUnsafe( +8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),gc=a(r=>F.addCString(r).flush( +112),"password"),bc=a(function(r,e){return F.addCString(r).addInt32(d.byteLength(e)).addString(e),F. +flush(112)},"sendSASLInitialResponseMessage"),vc=a(function(r){return F.addString(r).flush(112)},"se\ +ndSCRAMClientFinalMessage"),xc=a(r=>F.addCString(r).flush(81),"query"),Ws=[],Sc=a(r=>{let e=r.name|| "";e.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console. error("You supplied %s (%s)",e,e.length),console.error("This can cause conflicts and silent errors e\ -xecuting queries"));let t=r.types||Ns,n=t.length,i=F.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< -n;s++)i.addInt32(t[s]);return F.flush(80)},"parse"),qe=new pn.Writer,Sc=a(function(r,e){for(let t=0;t< +xecuting queries"));let t=r.types||Ws,n=t.length,i=F.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< +n;s++)i.addInt32(t[s]);return F.flush(80)},"parse"),qe=new dn.Writer,Ec=a(function(r,e){for(let t=0;t< r.length;t++){let n=e?e(r[t],t):r[t];n==null?(F.addInt16(0),qe.addInt32(-1)):n instanceof d?(F.addInt16( 1),qe.addInt32(n.length),qe.add(n)):(F.addInt16(0),qe.addInt32(d.byteLength(n)),qe.addString(n))}},"\ -writeValues"),Ec=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Ns,s=i.length; -return F.addCString(e).addCString(t),F.addInt16(s),Sc(i,r.valueMapper),F.addInt16(s),F.add(qe.flush()), -F.addInt16(n?1:0),F.flush(66)},"bind"),Ac=d.from([69,0,0,0,9,0,0,0,0,0]),Cc=a(r=>{if(!r||!r.portal&& -!r.rows)return Ac;let e=r.portal||"",t=r.rows||0,n=d.byteLength(e),i=4+n+1+4,s=d.allocUnsafe(1+i);return s[0]= -69,s.writeInt32BE(i,1),s.write(e,5,"utf-8"),s[n+5]=0,s.writeUInt32BE(t,s.length-4),s},"execute"),_c=a( +writeValues"),Ac=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Ws,s=i.length; +return F.addCString(e).addCString(t),F.addInt16(s),Ec(i,r.valueMapper),F.addInt16(s),F.add(qe.flush()), +F.addInt16(n?1:0),F.flush(66)},"bind"),Cc=d.from([69,0,0,0,9,0,0,0,0,0]),_c=a(r=>{if(!r||!r.portal&& +!r.rows)return Cc;let e=r.portal||"",t=r.rows||0,n=d.byteLength(e),i=4+n+1+4,s=d.allocUnsafe(1+i);return s[0]= +69,s.writeInt32BE(i,1),s.write(e,5,"utf-8"),s[n+5]=0,s.writeUInt32BE(t,s.length-4),s},"execute"),Ic=a( (r,e)=>{let t=d.allocUnsafe(16);return t.writeInt32BE(16,0),t.writeInt16BE(1234,4),t.writeInt16BE(5678, -6),t.writeInt32BE(r,8),t.writeInt32BE(e,12),t},"cancel"),dn=a((r,e)=>{let n=4+d.byteLength(e)+1,i=d. +6),t.writeInt32BE(r,8),t.writeInt32BE(e,12),t},"cancel"),yn=a((r,e)=>{let n=4+d.byteLength(e)+1,i=d. allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i},"cstringMessage"), -Ic=F.addCString("P").flush(68),Tc=F.addCString("S").flush(68),Pc=a(r=>r.name?dn(68,`${r.type}${r.name|| -""}`):r.type==="P"?Ic:Tc,"describe"),Rc=a(r=>{let e=`${r.type}${r.name||""}`;return dn(67,e)},"close"), -Bc=a(r=>F.add(r).flush(100),"copyData"),Lc=a(r=>dn(102,r),"copyFail"),Lt=a(r=>d.from([r,0,0,0,4]),"c\ -odeOnlyBuffer"),Fc=Lt(72),kc=Lt(83),Mc=Lt(88),Uc=Lt(99),Dc={startup:yc,password:wc,requestSsl:mc,sendSASLInitialResponseMessage:gc, -sendSCRAMClientFinalMessage:bc,query:vc,parse:xc,bind:Ec,execute:Cc,describe:Pc,close:Rc,flush:a(()=>Fc, -"flush"),sync:a(()=>kc,"sync"),end:a(()=>Mc,"end"),copyData:Bc,copyDone:a(()=>Uc,"copyDone"),copyFail:Lc, -cancel:_c};Ft.serialize=Dc});var js=T(kt=>{"use strict";p();Object.defineProperty(kt,"__esModule",{value:!0});kt.BufferReader=void 0; -var Oc=d.allocUnsafe(0),mn=class mn{constructor(e=0){this.offset=e,this.buffer=Oc,this.encoding="utf\ +Tc=F.addCString("P").flush(68),Pc=F.addCString("S").flush(68),Rc=a(r=>r.name?yn(68,`${r.type}${r.name|| +""}`):r.type==="P"?Tc:Pc,"describe"),Bc=a(r=>{let e=`${r.type}${r.name||""}`;return yn(67,e)},"close"), +Lc=a(r=>F.add(r).flush(100),"copyData"),Fc=a(r=>yn(102,r),"copyFail"),Ft=a(r=>d.from([r,0,0,0,4]),"c\ +odeOnlyBuffer"),kc=Ft(72),Mc=Ft(83),Uc=Ft(88),Dc=Ft(99),Oc={startup:mc,password:gc,requestSsl:wc,sendSASLInitialResponseMessage:bc, +sendSCRAMClientFinalMessage:vc,query:xc,parse:Sc,bind:Ac,execute:_c,describe:Rc,close:Bc,flush:a(()=>kc, +"flush"),sync:a(()=>Mc,"sync"),end:a(()=>Uc,"end"),copyData:Lc,copyDone:a(()=>Dc,"copyDone"),copyFail:Fc, +cancel:Ic};kt.serialize=Oc});var Hs=T(Mt=>{"use strict";p();Object.defineProperty(Mt,"__esModule",{value:!0});Mt.BufferReader=void 0; +var qc=d.allocUnsafe(0),wn=class wn{constructor(e=0){this.offset=e,this.buffer=qc,this.encoding="utf\ -8"}setBuffer(e,t){this.offset=e,this.buffer=t}int16(){let e=this.buffer.readInt16BE(this.offset);return this. offset+=2,e}byte(){let e=this.buffer[this.offset];return this.offset++,e}int32(){let e=this.buffer.readInt32BE( this.offset);return this.offset+=4,e}uint32(){let e=this.buffer.readUInt32BE(this.offset);return this. offset+=4,e}string(e){let t=this.buffer.toString(this.encoding,this.offset,this.offset+e);return this. offset+=e,t}cstring(){let e=this.offset,t=e;for(;this.buffer[t++]!==0;);return this.offset=t,this.buffer. toString(this.encoding,e,t-1)}bytes(e){let t=this.buffer.slice(this.offset,this.offset+e);return this. -offset+=e,t}};a(mn,"BufferReader");var yn=mn;kt.BufferReader=yn});var Gs=T(Mt=>{"use strict";p();Object.defineProperty(Mt,"__esModule",{value:!0});Mt.Parser=void 0;var k=ln(), -qc=js(),wn=1,Qc=4,Hs=wn+Qc,$s=d.allocUnsafe(0),bn=class bn{constructor(e){if(this.buffer=$s,this.bufferLength= -0,this.bufferOffset=0,this.reader=new qc.BufferReader,e?.mode==="binary")throw new Error("Binary mod\ +offset+=e,t}};a(wn,"BufferReader");var mn=wn;Mt.BufferReader=mn});var Vs=T(Ut=>{"use strict";p();Object.defineProperty(Ut,"__esModule",{value:!0});Ut.Parser=void 0;var k=fn(), +Qc=Hs(),gn=1,Nc=4,Gs=gn+Nc,$s=d.allocUnsafe(0),vn=class vn{constructor(e){if(this.buffer=$s,this.bufferLength= +0,this.bufferOffset=0,this.reader=new Qc.BufferReader,e?.mode==="binary")throw new Error("Binary mod\ e not supported yet");this.mode=e?.mode||"text"}parse(e,t){this.mergeBuffer(e);let n=this.bufferOffset+ -this.bufferLength,i=this.bufferOffset;for(;i+Hs<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( -i+wn),u=wn+o;if(u+i<=n){let c=this.handlePacket(i+Hs,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. +this.bufferLength,i=this.bufferOffset;for(;i+Gs<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( +i+gn),u=gn+o;if(u+i<=n){let c=this.handlePacket(i+Gs,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. buffer=$s,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=n-i,this.bufferOffset=i)}mergeBuffer(e){ if(this.bufferLength>0){let t=this.bufferLength+e.byteLength;if(t+this.bufferOffset>this.buffer.byteLength){ let i;if(t<=this.buffer.byteLength&&this.bufferOffset>=this.bufferLength)i=this.buffer;else{let s=this. @@ -955,14 +955,14 @@ o=this.reader.string(1);for(;o!=="\0";)s[o]=this.reader.cstring(),o=this.reader. c=i==="notice"?new k.NoticeMessage(t,u):new k.DatabaseError(u,t,i);return c.severity=s.S,c.code=s.C, c.detail=s.D,c.hint=s.H,c.position=s.P,c.internalPosition=s.p,c.internalQuery=s.q,c.where=s.W,c.schema= s.s,c.table=s.t,c.column=s.c,c.dataType=s.d,c.constraint=s.n,c.file=s.F,c.line=s.L,c.routine=s.R,c}}; -a(bn,"Parser");var gn=bn;Mt.Parser=gn});var vn=T(xe=>{"use strict";p();Object.defineProperty(xe,"__esModule",{value:!0});xe.DatabaseError=xe. -serialize=xe.parse=void 0;var Nc=ln();Object.defineProperty(xe,"DatabaseError",{enumerable:!0,get:a( -function(){return Nc.DatabaseError},"get")});var Wc=Ws();Object.defineProperty(xe,"serialize",{enumerable:!0, -get:a(function(){return Wc.serialize},"get")});var jc=Gs();function Hc(r,e){let t=new jc.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(Hc,"parse");xe.parse=Hc});var Vs={};ie(Vs,{connect:()=>$c});function $c({socket:r,servername:e}){return r.startTls(e),r}var zs=G( -()=>{"use strict";p();a($c,"connect")});var En=T((Xh,Zs)=>{"use strict";p();var Ks=(Fe(),O(wi)),Gc=ge().EventEmitter,{parse:Vc,serialize:Q}=vn(), -Ys=Q.flush(),zc=Q.sync(),Kc=Q.end(),Sn=class Sn extends Gc{constructor(e){super(),e=e||{},this.stream= -e.stream||new Ks.Socket,this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis, +a(vn,"Parser");var bn=vn;Ut.Parser=bn});var xn=T(xe=>{"use strict";p();Object.defineProperty(xe,"__esModule",{value:!0});xe.DatabaseError=xe. +serialize=xe.parse=void 0;var Wc=fn();Object.defineProperty(xe,"DatabaseError",{enumerable:!0,get:a( +function(){return Wc.DatabaseError},"get")});var jc=js();Object.defineProperty(xe,"serialize",{enumerable:!0, +get:a(function(){return jc.serialize},"get")});var Hc=Vs();function Gc(r,e){let t=new Hc.Parser;return r. +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(Gc,"parse");xe.parse=Gc});var Ks={};ie(Ks,{connect:()=>$c});function $c({socket:r,servername:e}){return r.startTls(e),r}var zs=$( +()=>{"use strict";p();a($c,"connect")});var An=T((np,Js)=>{"use strict";p();var Ys=(Fe(),O(gi)),Vc=ge().EventEmitter,{parse:Kc,serialize:Q}=xn(), +Zs=Q.flush(),zc=Q.sync(),Yc=Q.end(),En=class En extends Vc{constructor(e){super(),e=e||{},this.stream= +e.stream||new Ys.Socket,this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis, this.lastBuffer=!1,this.parsedStatements={},this.ssl=e.ssl||!1,this._ending=!1,this._emitMessage=!1; var t=this;this.on("newListener",function(n){n==="message"&&(t._emitMessage=!0)})}connect(e,t){var n=this; this._connecting=!0,this.stream.setNoDelay(!0),this.stream.connect(e,t),this.stream.once("connect",function(){ @@ -972,30 +972,30 @@ stream.on("error",i),this.stream.on("close",function(){n.emit("end")}),!this.ssl this.stream);this.stream.once("data",function(s){var o=s.toString("utf8");switch(o){case"S":break;case"\ N":return n.stream.end(),n.emit("error",new Error("The server does not support SSL connections"));default: return n.stream.end(),n.emit("error",new Error("There was an error establishing an SSL connection"))} -var u=(zs(),O(Vs));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= -n.ssl.key)),Ks.isIP(t)===0&&(c.servername=t);try{n.stream=u.connect(c)}catch(l){return n.emit("error", +var u=(zs(),O(Ks));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= +n.ssl.key)),Ys.isIP(t)===0&&(c.servername=t);try{n.stream=u.connect(c)}catch(l){return n.emit("error", l)}n.attachListeners(n.stream),n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){e.on( -"end",()=>{this.emit("end")}),Vc(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& +"end",()=>{this.emit("end")}),Kc(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(Q.requestSsl())}startup(e){this. stream.write(Q.startup(e))}cancel(e,t){this._send(Q.cancel(e,t))}password(e){this._send(Q.password(e))}sendSASLInitialResponseMessage(e,t){ this._send(Q.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(Q.sendSCRAMClientFinalMessage( e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(Q.query(e))}parse(e){ this._send(Q.parse(e))}bind(e){this._send(Q.bind(e))}execute(e){this._send(Q.execute(e))}flush(){this. -stream.writable&&this.stream.write(Ys)}sync(){this._ending=!0,this._send(Ys),this._send(zc)}ref(){this. +stream.writable&&this.stream.write(Zs)}sync(){this._ending=!0,this._send(Zs),this._send(zc)}ref(){this. stream.ref()}unref(){this.stream.unref()}end(){if(this._ending=!0,!this._connecting||!this.stream.writable){ -this.stream.end();return}return this.stream.write(Kc,()=>{this.stream.end()})}close(e){this._send(Q. +this.stream.end();return}return this.stream.write(Yc,()=>{this.stream.end()})}close(e){this._send(Q. close(e))}describe(e){this._send(Q.describe(e))}sendCopyFromChunk(e){this._send(Q.copyData(e))}endCopyFrom(){ -this._send(Q.copyDone())}sendCopyFail(e){this._send(Q.copyFail(e))}};a(Sn,"Connection");var xn=Sn;Zs. -exports=xn});var eo=T((np,Xs)=>{"use strict";p();var Yc=ge().EventEmitter,rp=(it(),O(nt)),Zc=rt(),An=ds(),Jc=Cs(), -Xc=At(),el=Rt(),Js=qs(),tl=tt(),rl=En(),Cn=class Cn extends Yc{constructor(e){super(),this.connectionParameters= -new el(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database, +this._send(Q.copyDone())}sendCopyFail(e){this._send(Q.copyFail(e))}};a(En,"Connection");var Sn=En;Js. +exports=Sn});var to=T((ap,eo)=>{"use strict";p();var Zc=ge().EventEmitter,op=(st(),O(it)),Jc=nt(),Cn=ys(),Xc=_s(), +el=Ct(),tl=Bt(),Xs=Qs(),rl=rt(),nl=An(),_n=class _n extends Zc{constructor(e){super(),this.connectionParameters= +new tl(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database, this.port=this.connectionParameters.port,this.host=this.connectionParameters.host,Object.defineProperty( this,"password",{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}), this.replication=this.connectionParameters.replication;var t=e||{};this._Promise=t.Promise||b.Promise, -this._types=new Xc(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= -!1,this._queryable=!0,this.connection=t.connection||new rl({stream:t.stream,ssl:this.connectionParameters. +this._types=new el(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= +!1,this._queryable=!0,this.connection=t.connection||new nl({stream:t.stream,ssl:this.connectionParameters. ssl,keepAlive:t.keepAlive||!1,keepAliveInitialDelayMillis:t.keepAliveInitialDelayMillis||0,encoding:this. -connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t.binary||tl.binary,this. +connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t.binary||rl.binary,this. processID=null,this.secretKey=null,this.ssl=this.connectionParameters.ssl||!1,this.ssl&&this.ssl.key&& Object.defineProperty(this.ssl,"key",{enumerable:!1}),this._connectionTimeoutMillis=t.connectionTimeoutMillis|| 0}_errorAllQueries(e){let t=a(n=>{m.nextTick(()=>{n.handleError(e,this.connection)})},"enqueueError"); @@ -1026,14 +1026,14 @@ bind(this)),e.on("copyData",this._handleCopyData.bind(this)),e.on("notification" bind(this))}_checkPgPass(e){let t=this.connection;typeof this.password=="function"?this._Promise.resolve(). then(()=>this.password()).then(n=>{if(n!==void 0){if(typeof n!="string"){t.emit("error",new TypeError( "Password must be a string"));return}this.connectionParameters.password=this.password=n}else this.connectionParameters. -password=this.password=null;e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():Jc(this.connectionParameters, +password=this.password=null;e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():Xc(this.connectionParameters, n=>{n!==void 0&&(this.connectionParameters.password=this.password=n),e()})}_handleAuthCleartextPassword(e){ this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){this._checkPgPass( -()=>{let t=Zc.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ -this._checkPgPass(()=>{this.saslSession=An.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( -this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){An.continueSession( +()=>{let t=Jc.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ +this._checkPgPass(()=>{this.saslSession=Cn.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( +this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){Cn.continueSession( this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession. -response)}_handleAuthSASLFinal(e){An.finalizeSession(this.saslSession,e.data),this.saslSession=null}_handleBackendKeyData(e){ +response)}_handleAuthSASLFinal(e){Cn.finalizeSession(this.saslSession,e.data),this.saslSession=null}_handleBackendKeyData(e){ this.processID=e.processID,this.secretKey=e.secretKey}_handleReadyForQuery(e){this._connecting&&(this. _connecting=!1,this._connected=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback&& (this._connectionCallback(null,this),this._connectionCallback=null),this.emit("connect"));let{activeQuery:t}=this; @@ -1067,7 +1067,7 @@ handleError(e,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}e (this.activeQuery=null,this.emit("drain"))}query(e,t,n){var i,s,o,u,c;if(e==null)throw new TypeError( "Client was passed a null or undefined query");return typeof e.submit=="function"?(o=e.query_timeout|| this.connectionParameters.query_timeout,s=i=e,typeof t=="function"&&(i.callback=i.callback||t)):(o=this. -connectionParameters.query_timeout,i=new Js(e,t,n),i.callback||(s=new this._Promise((l,f)=>{i.callback= +connectionParameters.query_timeout,i=new Xs(e,t,n),i.callback||(s=new this._Promise((l,f)=>{i.callback= (y,g)=>y?f(y):l(g)}))),o&&(c=i.callback,u=setTimeout(()=>{var l=new Error("Query read timeout");m.nextTick( ()=>{i.handleError(l,this.connection)}),c(l),i.callback=()=>{};var f=this.queryQueue.indexOf(i);f>-1&& this.queryQueue.splice(f,1),this._pulseQueryQueue()},o),i.callback=(l,f)=>{clearTimeout(u),c(l,f)}), @@ -1078,22 +1078,22 @@ handleError(new Error("Client has encountered a connection error and is not quer s)}ref(){this.connection.ref()}unref(){this.connection.unref()}end(e){if(this._ending=!0,!this.connection. _connecting)if(e)e();else return this._Promise.resolve();if(this.activeQuery||!this._queryable?this. connection.stream.destroy():this.connection.end(),e)this.connection.once("end",e);else return new this. -_Promise(t=>{this.connection.once("end",t)})}};a(Cn,"Client");var Ut=Cn;Ut.Query=Js;Xs.exports=Ut});var io=T((op,no)=>{"use strict";p();var nl=ge().EventEmitter,to=a(function(){},"NOOP"),ro=a((r,e)=>{ -let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),Tn=class Tn{constructor(e,t,n){ -this.client=e,this.idleListener=t,this.timeoutId=n}};a(Tn,"IdleItem");var _n=Tn,Pn=class Pn{constructor(e){ -this.callback=e}};a(Pn,"PendingItem");var Qe=Pn;function il(){throw new Error("Release called on cli\ -ent which has already been released to the pool.")}a(il,"throwOnDoubleRelease");function Dt(r,e){if(e) +_Promise(t=>{this.connection.once("end",t)})}};a(_n,"Client");var Dt=_n;Dt.Query=Xs;eo.exports=Dt});var so=T((lp,io)=>{"use strict";p();var il=ge().EventEmitter,ro=a(function(){},"NOOP"),no=a((r,e)=>{ +let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),Pn=class Pn{constructor(e,t,n){ +this.client=e,this.idleListener=t,this.timeoutId=n}};a(Pn,"IdleItem");var In=Pn,Rn=class Rn{constructor(e){ +this.callback=e}};a(Rn,"PendingItem");var Qe=Rn;function sl(){throw new Error("Release called on cli\ +ent which has already been released to the pool.")}a(sl,"throwOnDoubleRelease");function Ot(r,e){if(e) return{callback:e,result:void 0};let t,n,i=a(function(o,u){o?t(o):n(u)},"cb"),s=new r(function(o,u){ -n=o,t=u}).catch(o=>{throw Error.captureStackTrace(o),o});return{callback:i,result:s}}a(Dt,"promisify"); -function sl(r,e){return a(function t(n){n.client=e,e.removeListener("error",t),e.on("error",()=>{r.log( +n=o,t=u}).catch(o=>{throw Error.captureStackTrace(o),o});return{callback:i,result:s}}a(Ot,"promisify"); +function ol(r,e){return a(function t(n){n.client=e,e.removeListener("error",t),e.on("error",()=>{r.log( "additional client error after disconnection due to error",n)}),r._remove(e),r.emit("error",n,e)},"i\ -dleListener")}a(sl,"makeIdleListener");var Rn=class Rn extends nl{constructor(e,t){super(),this.options= +dleListener")}a(ol,"makeIdleListener");var Bn=class Bn extends il{constructor(e,t){super(),this.options= Object.assign({},e),e!=null&&"password"in e&&Object.defineProperty(this.options,"password",{configurable:!0, enumerable:!1,writable:!0,value:e.password}),e!=null&&e.ssl&&e.ssl.key&&Object.defineProperty(this.options. ssl,"key",{enumerable:!1}),this.options.max=this.options.max||this.options.poolSize||10,this.options. min=this.options.min||0,this.options.maxUses=this.options.maxUses||1/0,this.options.allowExitOnIdle= this.options.allowExitOnIdle||!1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0, -this.log=this.options.log||function(){},this.Client=this.options.Client||t||ot().Client,this.Promise= +this.log=this.options.log||function(){},this.Client=this.options.Client||t||at().Client,this.Promise= this.options.Promise||b.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this.options.idleTimeoutMillis= 1e4),this._clients=[],this._idle=[],this._expired=new WeakSet,this._pendingQueue=[],this._endCallback= void 0,this.ending=!1,this.ended=!1}_isFull(){return this._clients.length>=this.options.max}_isAboveMin(){ @@ -1103,47 +1103,47 @@ this._idle.slice().map(t=>{this._remove(t.client)}),this._clients.length||(this. return}if(!this._pendingQueue.length){this.log("no queued requests");return}if(!this._idle.length&&this. _isFull())return;let e=this._pendingQueue.shift();if(this._idle.length){let t=this._idle.pop();clearTimeout( t.timeoutId);let n=t.client;n.ref&&n.ref();let i=t.idleListener;return this._acquireClient(n,e,i,!1)} -if(!this._isFull())return this.newClient(e);throw new Error("unexpected condition")}_remove(e){let t=ro( +if(!this._isFull())return this.newClient(e);throw new Error("unexpected condition")}_remove(e){let t=no( this._idle,n=>n.client===e);t!==void 0&&clearTimeout(t.timeoutId),this._clients=this._clients.filter( n=>n!==e),e.end(),this.emit("remove",e)}connect(e){if(this.ending){let i=new Error("Cannot use a poo\ -l after calling end on the pool");return e?e(i):this.Promise.reject(i)}let t=Dt(this.Promise,e),n=t. +l after calling end on the pool");return e?e(i):this.Promise.reject(i)}let t=Ot(this.Promise,e),n=t. result;if(this._isFull()||this._idle.length){if(this._idle.length&&m.nextTick(()=>this._pulseQueue()), !this.options.connectionTimeoutMillis)return this._pendingQueue.push(new Qe(t.callback)),n;let i=a((u,c,l)=>{ -clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new Qe(i),o=setTimeout(()=>{ro(this._pendingQueue, +clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new Qe(i),o=setTimeout(()=>{no(this._pendingQueue, u=>u.callback===i),s.timedOut=!0,t.callback(new Error("timeout exceeded when trying to connect"))},this. options.connectionTimeoutMillis);return o.unref&&o.unref(),this._pendingQueue.push(s),n}return this. newClient(new Qe(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( -t);let n=sl(this,t);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&& +t);let n=ol(this,t);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&& (i=setTimeout(()=>{this.log("ending client due to timeout"),s=!0,t.connection?t.connection.stream.destroy(): t.end()},this.options.connectionTimeoutMillis)),this.log("connecting new client"),t.connect(o=>{if(i&& clearTimeout(i),t.on("error",n),o)this.log("client failed to connect",o),this._clients=this._clients. filter(u=>u!==t),s&&(o=new Error("Connection terminated due to connection timeout",{cause:o})),this. -_pulseQueue(),e.timedOut||e.callback(o,void 0,to);else{if(this.log("new client connected"),this.options. +_pulseQueue(),e.timedOut||e.callback(o,void 0,ro);else{if(this.log("new client connected"),this.options. maxLifetimeSeconds!==0){let u=setTimeout(()=>{this.log("ending client due to expired lifetime"),this. _expired.add(t),this._idle.findIndex(l=>l.client===t)!==-1&&this._acquireClient(t,new Qe((l,f,y)=>y()), n,!1)},this.options.maxLifetimeSeconds*1e3);u.unref(),t.once("end",()=>clearTimeout(u))}return this. _acquireClient(t,e,n,!0)}})}_acquireClient(e,t,n,i){i&&this.emit("connect",e),this.emit("acquire",e), e.release=this._releaseOnce(e,n),e.removeListener("error",n),t.timedOut?i&&this.options.verify?this. options.verify(e,e.release):e.release():i&&this.options.verify?this.options.verify(e,s=>{if(s)return e. -release(s),t.callback(s,void 0,to);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ -let n=!1;return i=>{n&&il(),n=!0,this._release(e,t,i)}}_release(e,t,n){if(e.on("error",t),e._poolUseCount= +release(s),t.callback(s,void 0,ro);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ +let n=!1;return i=>{n&&sl(),n=!0,this._release(e,t,i)}}_release(e,t,n){if(e.on("error",t),e._poolUseCount= (e._poolUseCount||0)+1,this.emit("release",n,e),n||this.ending||!e._queryable||e._ending||e._poolUseCount>= this.options.maxUses){e._poolUseCount>=this.options.maxUses&&this.log("remove expended client"),this. _remove(e),this._pulseQueue();return}if(this._expired.has(e)){this.log("remove expired client"),this. _expired.delete(e),this._remove(e),this._pulseQueue();return}let s;this.options.idleTimeoutMillis&&this. _isAboveMin()&&(s=setTimeout(()=>{this.log("remove idle client"),this._remove(e)},this.options.idleTimeoutMillis), -this.options.allowExitOnIdle&&s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new _n( -e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=Dt(this.Promise,e);return v(function(){ +this.options.allowExitOnIdle&&s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new In( +e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=Ot(this.Promise,e);return v(function(){ return s.callback(new Error("Passing a function as the first parameter to pool.query is not supporte\ -d"))}),s.result}typeof t=="function"&&(n=t,t=void 0);let i=Dt(this.Promise,n);return n=i.callback,this. +d"))}),s.result}typeof t=="function"&&(n=t,t=void 0);let i=Ot(this.Promise,n);return n=i.callback,this. connect((s,o)=>{if(s)return n(s);let u=!1,c=a(l=>{u||(u=!0,o.release(l),n(l))},"onError");o.once("er\ ror",c),this.log("dispatching query");try{o.query(e,t,(l,f)=>{if(this.log("query dispatched"),o.removeListener( "error",c),!u)return u=!0,o.release(l),l?n(l):n(void 0,f)})}catch(l){return o.release(l),n(l)}}),i.result}end(e){ if(this.log("ending"),this.ending){let n=new Error("Called end on pool more than once");return e?e(n): -this.Promise.reject(n)}this.ending=!0;let t=Dt(this.Promise,e);return this._endCallback=t.callback,this. +this.Promise.reject(n)}this.ending=!0;let t=Ot(this.Promise,e);return this._endCallback=t.callback,this. _pulseQueue(),t.result}get waitingCount(){return this._pendingQueue.length}get idleCount(){return this. _idle.length}get expiredCount(){return this._clients.reduce((e,t)=>e+(this._expired.has(t)?1:0),0)}get totalCount(){ -return this._clients.length}};a(Rn,"Pool");var In=Rn;no.exports=In});var so={};ie(so,{default:()=>ol});var ol,oo=G(()=>{"use strict";p();ol={}});var ao=T((lp,al)=>{al.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javas\ +return this._clients.length}};a(Bn,"Pool");var Tn=Bn;io.exports=Tn});var oo={};ie(oo,{default:()=>al});var al,ao=$(()=>{"use strict";p();al={}});var uo=T((dp,ul)=>{ul.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javas\ cript & libpq with the same API",keywords:["database","libpq","pg","postgre","postgres","postgresql", "rdbms"],homepage:"https://github.com/brianc/node-postgres",repository:{type:"git",url:"git://github\ .com/brianc/node-postgres.git",directory:"packages/pg"},author:"Brian Carlson =3.0.1"},peerDependenciesMeta:{"pg-native":{optional:!0}},scripts:{test:"make test-all"},files:["li\ b","SPONSORS.md"],license:"MIT",engines:{node:">= 8.0.0"},gitHead:"c99fb2c127ddf8d712500db2c7b9a5491\ -a178655"}});var lo=T((fp,co)=>{"use strict";p();var uo=ge().EventEmitter,ul=(it(),O(nt)),Bn=rt(),Ne=co.exports=function(r,e,t){ -uo.call(this),r=Bn.normalizeQueryConfig(r,e,t),this.text=r.text,this.values=r.values,this.name=r.name, +a178655"}});var fo=T((yp,lo)=>{"use strict";p();var co=ge().EventEmitter,cl=(st(),O(it)),Ln=nt(),Ne=lo.exports=function(r,e,t){ +co.call(this),r=Ln.normalizeQueryConfig(r,e,t),this.text=r.text,this.values=r.values,this.name=r.name, this.callback=r.callback,this.state="new",this._arrayMode=r.rowMode==="array",this._emitRowEvents=!1, -this.on("newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};ul.inherits(Ne,uo); -var cl={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ +this.on("newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};cl.inherits(Ne,co); +var ll={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"\ file",sourceLine:"line",sourceFunction:"routine"};Ne.prototype.handleError=function(r){var e=this.native. -pq.resultErrorFields();if(e)for(var t in e){var n=cl[t]||t;r[n]=e[t]}this.callback?this.callback(r): +pq.resultErrorFields();if(e)for(var t in e){var n=ll[t]||t;r[n]=e[t]}this.callback?this.callback(r): this.emit("error",r),this.state="error"};Ne.prototype.then=function(r,e){return this._getPromise().then( r,e)};Ne.prototype.catch=function(r){return this._getPromise().catch(r)};Ne.prototype._getPromise=function(){ return this._promise?this._promise:(this._promise=new Promise(function(r,e){this._once("end",r),this. @@ -1170,77 +1170,77 @@ this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a(function(s,o,u){ nd",e.emit("end",u),e.callback&&e.callback(null,u)},"after");if(m.domain&&(t=m.domain.bind(t)),this. name){this.name.length>63&&(console.error("Warning! Postgres only supports 63 characters for query n\ ames."),console.error("You supplied %s (%s)",this.name,this.name.length),console.error("This can cau\ -se conflicts and silent errors executing queries"));var n=(this.values||[]).map(Bn.prepareValue);if(r. +se conflicts and silent errors executing queries"));var n=(this.values||[]).map(Ln.prepareValue);if(r. namedQueries[this.name]){if(this.text&&r.namedQueries[this.name]!==this.text){let s=new Error(`Prepa\ red statements must be unique - '${this.name}' was used for a different statement`);return t(s)}return r. native.execute(this.name,n,t)}return r.native.prepare(this.name,this.text,n.length,function(s){return s? t(s):(r.namedQueries[e.name]=e.text,e.native.execute(e.name,n,t))})}else if(this.values){if(!Array.isArray( -this.values)){let s=new Error("Query values must be an array");return t(s)}var i=this.values.map(Bn. -prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var yo=T((yp,po)=>{"use strict";p();var ll=(oo(),O(so)),fl=At(),dp=ao(),fo=ge().EventEmitter,hl=(it(),O(nt)), -pl=Rt(),ho=lo(),K=po.exports=function(r){fo.call(this),r=r||{},this._Promise=r.Promise||b.Promise,this. -_types=new fl(r.types),this.native=new ll({types:this._types}),this._queryQueue=[],this._ending=!1,this. -_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new pl(r);this. +this.values)){let s=new Error("Query values must be an array");return t(s)}var i=this.values.map(Ln. +prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var mo=T((bp,yo)=>{"use strict";p();var fl=(ao(),O(oo)),hl=Ct(),gp=uo(),ho=ge().EventEmitter,pl=(st(),O(it)), +dl=Bt(),po=fo(),z=yo.exports=function(r){ho.call(this),r=r||{},this._Promise=r.Promise||b.Promise,this. +_types=new hl(r.types),this.native=new fl({types:this._types}),this._queryQueue=[],this._ending=!1,this. +_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new dl(r);this. user=e.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:e. -password}),this.database=e.database,this.host=e.host,this.port=e.port,this.namedQueries={}};K.Query= -ho;hl.inherits(K,fo);K.prototype._errorAllQueries=function(r){let e=a(t=>{m.nextTick(()=>{t.native=this. +password}),this.database=e.database,this.host=e.host,this.port=e.port,this.namedQueries={}};z.Query= +po;pl.inherits(z,ho);z.prototype._errorAllQueries=function(r){let e=a(t=>{m.nextTick(()=>{t.native=this. native,t.handleError(r)})},"enqueueError");this._hasActiveQuery()&&(e(this._activeQuery),this._activeQuery= -null),this._queryQueue.forEach(e),this._queryQueue.length=0};K.prototype._connect=function(r){var e=this; +null),this._queryQueue.forEach(e),this._queryQueue.length=0};z.prototype._connect=function(r){var e=this; if(this._connecting){m.nextTick(()=>r(new Error("Client has already been connected. You cannot reuse\ a client.")));return}this._connecting=!0,this.connectionParameters.getLibpqConnectionString(function(t,n){ if(t)return r(t);e.native.connect(n,function(i){if(i)return e.native.end(),r(i);e._connected=!0,e.native. on("error",function(s){e._queryable=!1,e._errorAllQueries(s),e.emit("error",s)}),e.native.on("notifi\ cation",function(s){e.emit("notification",{channel:s.relname,payload:s.extra})}),e.emit("connect"),e. -_pulseQueryQueue(!0),r()})})};K.prototype.connect=function(r){if(r){this._connect(r);return}return new this. -_Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};K.prototype.query=function(r,e,t){var n,i,s,o,u;if(r== +_pulseQueryQueue(!0),r()})})};z.prototype.connect=function(r){if(r){this._connect(r);return}return new this. +_Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};z.prototype.query=function(r,e,t){var n,i,s,o,u;if(r== null)throw new TypeError("Client was passed a null or undefined query");if(typeof r.submit=="functio\ n")s=r.query_timeout||this.connectionParameters.query_timeout,i=n=r,typeof e=="function"&&(r.callback= -e);else if(s=this.connectionParameters.query_timeout,n=new ho(r,e,t),!n.callback){let c,l;i=new this. +e);else if(s=this.connectionParameters.query_timeout,n=new po(r,e,t),!n.callback){let c,l;i=new this. _Promise((f,y)=>{c=f,l=y}),n.callback=(f,y)=>f?l(f):c(y)}return s&&(u=n.callback,o=setTimeout(()=>{var c=new Error( "Query read timeout");m.nextTick(()=>{n.handleError(c,this.connection)}),u(c),n.callback=()=>{};var l=this. _queryQueue.indexOf(n);l>-1&&this._queryQueue.splice(l,1),this._pulseQueryQueue()},s),n.callback=(c,l)=>{ clearTimeout(o),u(c,l)}),this._queryable?this._ending?(n.native=this.native,m.nextTick(()=>{n.handleError( new Error("Client was closed and is not queryable"))}),i):(this._queryQueue.push(n),this._pulseQueryQueue(), i):(n.native=this.native,m.nextTick(()=>{n.handleError(new Error("Client has encountered a connectio\ -n error and is not queryable"))}),i)};K.prototype.end=function(r){var e=this;this._ending=!0,this._connected|| +n error and is not queryable"))}),i)};z.prototype.end=function(r){var e=this;this._ending=!0,this._connected|| this.once("connect",this.end.bind(this,r));var t;return r||(t=new this._Promise(function(n,i){r=a(s=>s? i(s):n(),"cb")})),this.native.end(function(){e._errorAllQueries(new Error("Connection terminated")), -m.nextTick(()=>{e.emit("end"),r&&r()})}),t};K.prototype._hasActiveQuery=function(){return this._activeQuery&& -this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};K.prototype._pulseQueryQueue=function(r){ +m.nextTick(()=>{e.emit("end"),r&&r()})}),t};z.prototype._hasActiveQuery=function(){return this._activeQuery&& +this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};z.prototype._pulseQueryQueue=function(r){ if(this._connected&&!this._hasActiveQuery()){var e=this._queryQueue.shift();if(!e){r||this.emit("dra\ in");return}this._activeQuery=e,e.submit(this);var t=this;e.once("_done",function(){t._pulseQueryQueue()})}}; -K.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. -indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};K.prototype.ref=function(){}; -K.prototype.unref=function(){};K.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( -r,e,t)};K.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var Ln=T((gp,mo)=>{"use strict";p();mo.exports=yo()});var ot=T((vp,at)=>{"use strict";p();var dl=eo(),yl=tt(),ml=En(),wl=io(),{DatabaseError:gl}=vn(),bl=a( -r=>{var e;return e=class extends wl{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),Fn=a( -function(r){this.defaults=yl,this.Client=r,this.Query=this.Client.Query,this.Pool=bl(this.Client),this. -_pools=[],this.Connection=ml,this.types=Je(),this.DatabaseError=gl},"PG");typeof m.env.NODE_PG_FORCE_NATIVE< -"u"?at.exports=new Fn(Ln()):(at.exports=new Fn(dl),Object.defineProperty(at.exports,"native",{configurable:!0, -enumerable:!1,get(){var r=null;try{r=new Fn(Ln())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. -defineProperty(at.exports,"native",{value:r}),r}}))});p();p();Fe();Zt();p();var pa=Object.defineProperty,da=Object.defineProperties,ya=Object.getOwnPropertyDescriptors,bi=Object. -getOwnPropertySymbols,ma=Object.prototype.hasOwnProperty,wa=Object.prototype.propertyIsEnumerable,vi=a( -(r,e,t)=>e in r?pa(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), -ga=a((r,e)=>{for(var t in e||(e={}))ma.call(e,t)&&vi(r,t,e[t]);if(bi)for(var t of bi(e))wa.call(e,t)&& -vi(r,t,e[t]);return r},"__spreadValues"),ba=a((r,e)=>da(r,ya(e)),"__spreadProps"),va=1008e3,xi=new Uint8Array( -new Uint16Array([258]).buffer)[0]===2,xa=new TextDecoder,Jt=new TextEncoder,yt=Jt.encode("0123456789\ -abcdef"),mt=Jt.encode("0123456789ABCDEF"),Sa=Jt.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ -stuvwxyz0123456789+/");var Si=Sa.slice();Si[62]=45;Si[63]=95;var He,wt;function Ea(r,{alphabet:e,scratchArr:t}={}){if(!He)if(He= -new Uint16Array(256),wt=new Uint16Array(256),xi)for(let C=0;C<256;C++)He[C]=yt[C&15]<<8|yt[C>>>4],wt[C]= -mt[C&15]<<8|mt[C>>>4];else for(let C=0;C<256;C++)He[C]=yt[C&15]|yt[C>>>4]<<8,wt[C]=mt[C&15]|mt[C>>>4]<< +z.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. +indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};z.prototype.ref=function(){}; +z.prototype.unref=function(){};z.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( +r,e,t)};z.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var Fn=T((Sp,wo)=>{"use strict";p();wo.exports=mo()});var at=T((Ap,ut)=>{"use strict";p();var yl=to(),ml=rt(),wl=An(),gl=so(),{DatabaseError:bl}=xn(),vl=a( +r=>{var e;return e=class extends gl{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),kn=a( +function(r){this.defaults=ml,this.Client=r,this.Query=this.Client.Query,this.Pool=vl(this.Client),this. +_pools=[],this.Connection=wl,this.types=Xe(),this.DatabaseError=bl},"PG");typeof m.env.NODE_PG_FORCE_NATIVE< +"u"?ut.exports=new kn(Fn()):(ut.exports=new kn(yl),Object.defineProperty(ut.exports,"native",{configurable:!0, +enumerable:!1,get(){var r=null;try{r=new kn(Fn())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. +defineProperty(ut.exports,"native",{value:r}),r}}))});p();p();Fe();Jt();p();var da=Object.defineProperty,ya=Object.defineProperties,ma=Object.getOwnPropertyDescriptors,vi=Object. +getOwnPropertySymbols,wa=Object.prototype.hasOwnProperty,ga=Object.prototype.propertyIsEnumerable,xi=a( +(r,e,t)=>e in r?da(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), +ba=a((r,e)=>{for(var t in e||(e={}))wa.call(e,t)&&xi(r,t,e[t]);if(vi)for(var t of vi(e))ga.call(e,t)&& +xi(r,t,e[t]);return r},"__spreadValues"),va=a((r,e)=>ya(r,ma(e)),"__spreadProps"),xa=1008e3,Si=new Uint8Array( +new Uint16Array([258]).buffer)[0]===2,Sa=new TextDecoder,Xt=new TextEncoder,mt=Xt.encode("0123456789\ +abcdef"),wt=Xt.encode("0123456789ABCDEF"),Ea=Xt.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ +stuvwxyz0123456789+/");var Ei=Ea.slice();Ei[62]=45;Ei[63]=95;var He,gt;function Aa(r,{alphabet:e,scratchArr:t}={}){if(!He)if(He= +new Uint16Array(256),gt=new Uint16Array(256),Si)for(let C=0;C<256;C++)He[C]=mt[C&15]<<8|mt[C>>>4],gt[C]= +wt[C&15]<<8|wt[C>>>4];else for(let C=0;C<256;C++)He[C]=mt[C&15]|mt[C>>>4]<<8,gt[C]=wt[C&15]|wt[C>>>4]<< 8;r.byteOffset%4!==0&&(r=new Uint8Array(r));let n=r.length,i=n>>>1,s=n>>>2,o=t||new Uint16Array(n),u=new Uint32Array( -r.buffer,r.byteOffset,s),c=new Uint32Array(o.buffer,o.byteOffset,i),l=e==="upper"?wt:He,f=0,y=0,g;if(xi) +r.buffer,r.byteOffset,s),c=new Uint32Array(o.buffer,o.byteOffset,i),l=e==="upper"?gt:He,f=0,y=0,g;if(Si) for(;f>>8&255]<<16|l[g&255],c[y++]=l[g>>>24]<<16|l[g>>>16&255];else for(;f>>24]<<16|l[g>>>16&255],c[y++]=l[g>>>8&255]<<16|l[g&255];for(f<<=2;f>>1,s=Math. -ceil(n/i),o=new Uint16Array(s>1?i:n);for(let u=0;u>>1,s=Math. +ceil(n/i),o=new Uint16Array(s>1?i:n);for(let u=0;uLu((0,us.prepareValue)(n)))}}a(ss,"prep\ -areQuery");function cs(r,{arrayMode:e,fullResults:t,fetchOptions:n,isolationLevel:i,readOnly:s,deferrable:o, +tackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,It)}};a( +It,"NeonDbError");var be=It,ss="transaction() expects an array of queries, or a function returning a\ +n array of queries",Lu=["severity","code","detail","hint","position","internalPosition","internalQue\ +ry","where","schema","table","column","dataType","constraint","file","line","routine"];function Fu(r){ +return r instanceof d?"\\x"+Ai(r):r}a(Fu,"encodeBuffersAsBytea");function os(r){let{query:e,params:t}=r instanceof +Ge?r.toParameterizedQuery():r;return{query:e,params:t.map(n=>Fu((0,cs.prepareValue)(n)))}}a(os,"prep\ +areQuery");function ls(r,{arrayMode:e,fullResults:t,fetchOptions:n,isolationLevel:i,readOnly:s,deferrable:o, authToken:u,disableWarningInBrowsers:c}={}){if(!r)throw new Error("No database connection string was\ - provided to `neon()`. Perhaps an environment variable has not been set?");let l;try{l=Yt(r)}catch{throw new Error( + provided to `neon()`. Perhaps an environment variable has not been set?");let l;try{l=Zt(r)}catch{throw new Error( "Database connection string provided to `neon()` is not a valid URL. Connection string: "+String(r))} let{protocol:f,username:y,hostname:g,port:A,pathname:C}=l;if(f!=="postgres:"&&f!=="postgresql:"||!y|| !g||!C)throw new Error("Database connection string format for `neon()` should be: postgresql://user:\ @@ -1276,89 +1276,90 @@ password@host.tld/dbname?option=value");function D(P,...I){if(!(Array.isArray(P) Array.isArray(I)))throw new Error('This function can now be called only as a tagged-template functio\ n: sql`SELECT ${value}`, not sql("SELECT $1", [value], options). For a conventional function call wi\ th value placeholders ($1, $2, etc.), use sql.query("SELECT $1", [value], options).');return new Ce( -Y,new $e(P,I))}a(D,"templateFn"),D.query=(P,I,w)=>new Ce(Y,{query:P,params:I??[]},w),D.unsafe=P=>new Ge( -P),D.transaction=async(P,I)=>{if(typeof P=="function"&&(P=P(D)),!Array.isArray(P))throw new Error(is); -P.forEach(W=>{if(!(W instanceof Ce))throw new Error(is)});let w=P.map(W=>W.queryData),Z=P.map(W=>W.opts?? +Y,new Ge(P,I))}a(D,"templateFn"),D.query=(P,I,w)=>new Ce(Y,{query:P,params:I??[]},w),D.unsafe=P=>new $e( +P),D.transaction=async(P,I)=>{if(typeof P=="function"&&(P=P(D)),!Array.isArray(P))throw new Error(ss); +P.forEach(W=>{if(!(W instanceof Ce))throw new Error(ss)});let w=P.map(W=>W.queryData),Z=P.map(W=>W.opts?? {});return Y(w,Z,I)};async function Y(P,I,w){let{fetchEndpoint:Z,fetchFunction:W}=ce,J=Array.isArray( -P)?{queries:P.map(ee=>ss(ee))}:ss(P),X=n??{},se=e??!1,oe=t??!1,B=i,j=s,le=o;w!==void 0&&(w.fetchOptions!== +P)?{queries:P.map(ee=>os(ee))}:os(P),X=n??{},se=e??!1,oe=t??!1,B=i,j=s,le=o;w!==void 0&&(w.fetchOptions!== void 0&&(X={...X,...w.fetchOptions}),w.arrayMode!==void 0&&(se=w.arrayMode),w.fullResults!==void 0&& (oe=w.fullResults),w.isolationLevel!==void 0&&(B=w.isolationLevel),w.readOnly!==void 0&&(j=w.readOnly), w.deferrable!==void 0&&(le=w.deferrable)),I!==void 0&&!Array.isArray(I)&&I.fetchOptions!==void 0&&(X= {...X,...I.fetchOptions});let de=u;!Array.isArray(I)&&I?.authToken!==void 0&&(de=I.authToken);let We=typeof Z== "function"?Z(g,A,{jwtAuth:de!==void 0}):Z,fe={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"tru\ -e","Neon-Array-Mode":"true"},_e=await Fu(de);_e&&(fe.Authorization=`Bearer ${_e}`),Array.isArray(P)&& -(B!==void 0&&(fe["Neon-Batch-Isolation-Level"]=B),j!==void 0&&(fe["Neon-Batch-Read-Only"]=String(j)), -le!==void 0&&(fe["Neon-Batch-Deferrable"]=String(le))),c||ce.disableWarningInBrowsers||bt();let ye;try{ -ye=await(W??fetch)(We,{method:"POST",body:JSON.stringify(J),headers:fe,...X})}catch(ee){let M=new be( -`Error connecting to database: ${ee}`);throw M.sourceError=ee,M}if(ye.ok){let ee=await ye.json();if(Array. -isArray(P)){let M=ee.results;if(!Array.isArray(M))throw new be("Neon internal error: unexpected resu\ -lt format");return M.map(($,me)=>{let Ot=I[me]??{},vo=Ot.arrayMode??se,xo=Ot.fullResults??oe;return os( -$,{arrayMode:vo,fullResults:xo,types:Ot.types})})}else{let M=I??{},$=M.arrayMode??se,me=M.fullResults?? -oe;return os(ee,{arrayMode:$,fullResults:me,types:M.types})}}else{let{status:ee}=ye;if(ee===400){let M=await ye. -json(),$=new be(M.message);for(let me of Bu)$[me]=M[me]??void 0;throw $}else{let M=await ye.text();throw new be( -`Server error (HTTP status ${ee}): ${M}`)}}}return a(Y,"execute"),D}a(cs,"neon");var dr=class dr{constructor(e,t,n){ -this.execute=e;this.queryData=t;this.opts=n}then(e,t){return this.execute(this.queryData,this.opts). -then(e,t)}catch(e){return this.execute(this.queryData,this.opts).catch(e)}finally(e){return this.execute( -this.queryData,this.opts).finally(e)}};a(dr,"NeonQueryPromise");var Ce=dr;function os(r,{arrayMode:e, -fullResults:t,types:n}){let i=new as.default(n),s=r.fields.map(c=>c.name),o=r.fields.map(c=>i.getTypeParser( -c.dataTypeID)),u=e===!0?r.rows.map(c=>c.map((l,f)=>l===null?null:o[f](l))):r.rows.map(c=>Object.fromEntries( -c.map((l,f)=>[s[f],l===null?null:o[f](l)])));return t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=u,r._parsers= -o,r._types=i,r):u}a(os,"processQueryResult");async function Fu(r){if(typeof r=="string")return r;if(typeof r== -"function")try{return await Promise.resolve(r())}catch(e){let t=new be("Error getting auth token."); -throw e instanceof Error&&(t=new be(`Error getting auth token: ${e.message}`)),t}}a(Fu,"getAuthToken");p();var go=Se(ot());p();var wo=Se(ot());var kn=class kn extends wo.Client{constructor(t){super(t);this.config=t}get neonConfig(){return this. -connection.stream}connect(t){let{neonConfig:n}=this;n.forceDisablePgSSL&&(this.ssl=this.connection.ssl= -!1),this.ssl&&n.useSecureWebSocket&&console.warn("SSL is enabled for both Postgres (e.g. ?sslmode=re\ -quire in the connection string + forceDisablePgSSL = false) and the WebSocket tunnel (useSecureWebSo\ -cket = true). Double encryption will increase latency and CPU usage. It may be appropriate to disabl\ -e SSL in the Postgres connection parameters or set forceDisablePgSSL = true.");let i=typeof this.config!= -"string"&&this.config?.host!==void 0||typeof this.config!="string"&&this.config?.connectionString!== -void 0||m.env.PGHOST!==void 0,s=m.env.USER??m.env.USERNAME;if(!i&&this.host==="localhost"&&this.user=== -s&&this.database===s&&this.password===null)throw new Error(`No database host or connection string wa\ -s set, and key parameters have default values (host: localhost, user: ${s}, db: ${s}, password: null\ -). Is an environment variable missing? Alternatively, if you intended to connect with these paramete\ -rs, please set the host to 'localhost' explicitly.`);let o=super.connect(t),u=n.pipelineTLS&&this.ssl, -c=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let l=this.connection;if(u&&l.on( -"connect",()=>l.stream.emit("data","S")),c){l.removeAllListeners("authenticationCleartextPassword"), -l.removeAllListeners("readyForQuery"),l.once("readyForQuery",()=>l.on("readyForQuery",this._handleReadyForQuery. -bind(this)));let f=this.ssl?"sslconnect":"connect";l.on(f,()=>{this.neonConfig.disableWarningInBrowsers|| -bt(),this._handleAuthCleartextPassword(),this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){ -if(typeof crypto>"u"||crypto.subtle===void 0||crypto.subtle.importKey===void 0)throw new Error("Cann\ -ot use SASL auth when `crypto.subtle` is not defined");let n=crypto.subtle,i=this.saslSession,s=this. -password,o=t.data;if(i.message!=="SASLInitialResponse"||typeof s!="string"||typeof o!="string")throw new Error( -"SASL: protocol error");let u=Object.fromEntries(o.split(",").map(M=>{if(!/^.=/.test(M))throw new Error( -"SASL: Invalid attribute pair entry");let $=M[0],me=M.substring(2);return[$,me]})),c=u.r,l=u.s,f=u.i; -if(!c||!/^[!-+--~]+$/.test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unpri\ -ntable");if(!l||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(l))throw new Error( -"SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base64");if(!f||!/^[1-9][0-9]*$/.test(f))throw new Error( -"SASL: SCRAM-SERVER-FIRST-MESSAGE: missing/invalid iteration count");if(!c.startsWith(i.clientNonce)) -throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");if(c. -length===i.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too\ - short");let y=parseInt(f,10),g=d.from(l,"base64"),A=new TextEncoder,C=A.encode(s),D=await n.importKey( -"raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Y=new Uint8Array(await n.sign("HMAC",D,d.concat( -[g,d.from([0,0,0,1])]))),P=Y;for(var I=0;IP[$]^Y[$]));let w=P,Z=await n.importKey("raw",w,{name:"HMAC",hash:{name:"SHA-256"}},!1, -["sign"]),W=new Uint8Array(await n.sign("HMAC",Z,A.encode("Client Key"))),J=await n.digest("SHA-256", -W),X="n=*,r="+i.clientNonce,se="r="+c+",s="+l+",i="+y,oe="c=biws,r="+c,B=X+","+se+","+oe,j=await n.importKey( -"raw",J,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var le=new Uint8Array(await n.sign("HMAC",j, -A.encode(B))),de=d.from(W.map((M,$)=>W[$]^le[$])),We=de.toString("base64");let fe=await n.importKey( -"raw",w,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),_e=await n.sign("HMAC",fe,A.encode("Server \ -Key")),ye=await n.importKey("raw",_e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var ee=d.from( -await n.sign("HMAC",ye,A.encode(B)));i.message="SASLResponse",i.serverSignature=ee.toString("base64"), -i.response=oe+",p="+We,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}};a(kn, -"NeonClient");var ut=kn;Fe();var bo=Se(Rt());function vl(r,e){if(e)return{callback:e,result:void 0};let t,n,i=a(function(o,u){o?t(o):n(u)},"cb"), -s=new r(function(o,u){n=o,t=u});return{callback:i,result:s}}a(vl,"promisify");var Un=class Un extends go.Pool{constructor(){ -super(...arguments);E(this,"Client",ut);E(this,"hasFetchUnsupportedListeners",!1);E(this,"addListene\ +e","Neon-Array-Mode":"true","Neon-Client-Info":Ve},_e=await ku(de);_e&&(fe.Authorization=`Bearer ${_e}`), +Array.isArray(P)&&(B!==void 0&&(fe["Neon-Batch-Isolation-Level"]=B),j!==void 0&&(fe["Neon-Batch-Read\ +-Only"]=String(j)),le!==void 0&&(fe["Neon-Batch-Deferrable"]=String(le))),c||ce.disableWarningInBrowsers|| +vt();let ye;try{ye=await(W??fetch)(We,{method:"POST",body:JSON.stringify(J),headers:fe,...X})}catch(ee){ +let M=new be(`Error connecting to database: ${ee}`);throw M.sourceError=ee,M}if(ye.ok){let ee=await ye. +json();if(Array.isArray(P)){let M=ee.results;if(!Array.isArray(M))throw new be("Neon internal error:\ + unexpected result format");return M.map((G,me)=>{let qt=I[me]??{},xo=qt.arrayMode??se,So=qt.fullResults?? +oe;return as(G,{arrayMode:xo,fullResults:So,types:qt.types})})}else{let M=I??{},G=M.arrayMode??se,me=M. +fullResults??oe;return as(ee,{arrayMode:G,fullResults:me,types:M.types})}}else{let{status:ee}=ye;if(ee=== +400){let M=await ye.json(),G=new be(M.message);for(let me of Lu)G[me]=M[me]??void 0;throw G}else{let M=await ye. +text();throw new be(`Server error (HTTP status ${ee}): ${M}`)}}}return a(Y,"execute"),D}a(ls,"neon"); +var yr=class yr{constructor(e,t,n){this.execute=e;this.queryData=t;this.opts=n}then(e,t){return this. +execute(this.queryData,this.opts).then(e,t)}catch(e){return this.execute(this.queryData,this.opts).catch( +e)}finally(e){return this.execute(this.queryData,this.opts).finally(e)}};a(yr,"NeonQueryPromise");var Ce=yr; +function as(r,{arrayMode:e,fullResults:t,types:n}){let i=new us.default(n),s=r.fields.map(c=>c.name), +o=r.fields.map(c=>i.getTypeParser(c.dataTypeID)),u=e===!0?r.rows.map(c=>c.map((l,f)=>l===null?null:o[f]( +l))):r.rows.map(c=>Object.fromEntries(c.map((l,f)=>[s[f],l===null?null:o[f](l)])));return t?(r.viaNeonFetch= +!0,r.rowAsArray=e,r.rows=u,r._parsers=o,r._types=i,r):u}a(as,"processQueryResult");async function ku(r){ +if(typeof r=="string")return r;if(typeof r=="function")try{return await Promise.resolve(r())}catch(e){ +let t=new be("Error getting auth token.");throw e instanceof Error&&(t=new be(`Error getting auth to\ +ken: ${e.message}`)),t}}a(ku,"getAuthToken");p();var bo=Se(at());p();var go=Se(at());var Mn=class Mn extends go.Client{constructor(t){super(typeof t=="string"?{connectionString:t,fallback_application_name:Ve}: +{fallback_application_name:Ve,...t});this.config=t}get neonConfig(){return this.connection.stream}connect(t){ +let{neonConfig:n}=this;n.forceDisablePgSSL&&(this.ssl=this.connection.ssl=!1),this.ssl&&n.useSecureWebSocket&& +console.warn("SSL is enabled for both Postgres (e.g. ?sslmode=require in the connection string + for\ +ceDisablePgSSL = false) and the WebSocket tunnel (useSecureWebSocket = true). Double encryption will\ + increase latency and CPU usage. It may be appropriate to disable SSL in the Postgres connection par\ +ameters or set forceDisablePgSSL = true.");let i=typeof this.config!="string"&&this.config?.host!==void 0|| +typeof this.config!="string"&&this.config?.connectionString!==void 0||m.env.PGHOST!==void 0,s=m.env. +USER??m.env.USERNAME;if(!i&&this.host==="localhost"&&this.user===s&&this.database===s&&this.password=== +null)throw new Error(`No database host or connection string was set, and key parameters have default\ + values (host: localhost, user: ${s}, db: ${s}, password: null). Is an environment variable missing?\ + Alternatively, if you intended to connect with these parameters, please set the host to 'localhost'\ + explicitly.`);let o=super.connect(t),u=n.pipelineTLS&&this.ssl,c=n.pipelineConnect==="password";if(!u&& +!n.pipelineConnect)return o;let l=this.connection;if(u&&l.on("connect",()=>l.stream.emit("data","S")), +c){l.removeAllListeners("authenticationCleartextPassword"),l.removeAllListeners("readyForQuery"),l.once( +"readyForQuery",()=>l.on("readyForQuery",this._handleReadyForQuery.bind(this)));let f=this.ssl?"sslc\ +onnect":"connect";l.on(f,()=>{this.neonConfig.disableWarningInBrowsers||vt(),this._handleAuthCleartextPassword(), +this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){if(typeof crypto>"u"||crypto. +subtle===void 0||crypto.subtle.importKey===void 0)throw new Error("Cannot use SASL auth when `crypto\ +.subtle` is not defined");let n=crypto.subtle,i=this.saslSession,s=this.password,o=t.data;if(i.message!== +"SASLInitialResponse"||typeof s!="string"||typeof o!="string")throw new Error("SASL: protocol error"); +let u=Object.fromEntries(o.split(",").map(M=>{if(!/^.=/.test(M))throw new Error("SASL: Invalid attri\ +bute pair entry");let G=M[0],me=M.substring(2);return[G,me]})),c=u.r,l=u.s,f=u.i;if(!c||!/^[!-+--~]+$/. +test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unprintable");if(!l||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(l))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base64");if(!f||!/^[1-9][0-9]*$/. +test(f))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: missing/invalid iteration count");if(!c.startsWith( +i.clientNonce))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with c\ +lient nonce");if(c.length===i.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: \ +server nonce is too short");let y=parseInt(f,10),g=d.from(l,"base64"),A=new TextEncoder,C=A.encode(s), +D=await n.importKey("raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Y=new Uint8Array(await n. +sign("HMAC",D,d.concat([g,d.from([0,0,0,1])]))),P=Y;for(var I=0;IP[G]^Y[G]));let w=P,Z=await n.importKey("raw",w,{name:"HMAC",hash:{ +name:"SHA-256"}},!1,["sign"]),W=new Uint8Array(await n.sign("HMAC",Z,A.encode("Client Key"))),J=await n. +digest("SHA-256",W),X="n=*,r="+i.clientNonce,se="r="+c+",s="+l+",i="+y,oe="c=biws,r="+c,B=X+","+se+"\ +,"+oe,j=await n.importKey("raw",J,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var le=new Uint8Array( +await n.sign("HMAC",j,A.encode(B))),de=d.from(W.map((M,G)=>W[G]^le[G])),We=de.toString("base64");let fe=await n. +importKey("raw",w,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),_e=await n.sign("HMAC",fe,A.encode( +"Server Key")),ye=await n.importKey("raw",_e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var ee=d. +from(await n.sign("HMAC",ye,A.encode(B)));i.message="SASLResponse",i.serverSignature=ee.toString("ba\ +se64"),i.response=oe+",p="+We,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; +a(Mn,"NeonClient");var ct=Mn;Fe();var vo=Se(Bt());function xl(r,e){if(e)return{callback:e,result:void 0};let t,n,i=a(function(o,u){o?t(o):n(u)},"cb"), +s=new r(function(o,u){n=o,t=u});return{callback:i,result:s}}a(xl,"promisify");var Dn=class Dn extends bo.Pool{constructor(){ +super(...arguments);E(this,"Client",ct);E(this,"hasFetchUnsupportedListeners",!1);E(this,"addListene\ r",this.on)}on(t,n){return t!=="error"&&(this.hasFetchUnsupportedListeners=!0),super.on(t,n)}query(t,n,i){ if(!ce.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof t=="function")return super.query( -t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=vl(this.Promise,i);i=s.callback;try{let o=new bo.default( +t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=xl(this.Promise,i);i=s.callback;try{let o=new vo.default( this.options),u=encodeURIComponent,c=encodeURI,l=`postgresql://${u(o.user)}:${u(o.password)}@${u(o.host)}\ -/${c(o.database)}`,f=typeof t=="string"?t:t.text,y=n??t.values??[];cs(l,{fullResults:!0,arrayMode:t. +/${c(o.database)}`,f=typeof t=="string"?t:t.text,y=n??t.values??[];ls(l,{fullResults:!0,arrayMode:t. rowMode==="array"}).query(f,y,{types:t.types??this.options?.types}).then(A=>i(void 0,A)).catch(A=>i( -A))}catch(o){i(o)}return s.result}};a(Un,"NeonPool");var Mn=Un;Fe();var ct=Se(ot()),kp="mjs";var export_DatabaseError=ct.DatabaseError;var export_defaults=ct.defaults;var export_escapeIdentifier=ct.escapeIdentifier; -var export_escapeLiteral=ct.escapeLiteral;var export_types=ct.types;export{ut as Client,export_DatabaseError as DatabaseError, -be as NeonDbError,Ce as NeonQueryPromise,Mn as Pool,$e as SqlTemplate,Ge as UnsafeRawSql,kp as _bundleExt, +A))}catch(o){i(o)}return s.result}};a(Dn,"NeonPool");var Un=Dn;Fe();var lt=Se(at()),qp="mjs";var export_DatabaseError=lt.DatabaseError;var export_defaults=lt.defaults;var export_escapeIdentifier=lt.escapeIdentifier; +var export_escapeLiteral=lt.escapeLiteral;var export_types=lt.types;export{ct as Client,export_DatabaseError as DatabaseError, +be as NeonDbError,Ce as NeonQueryPromise,Un as Pool,Ge as SqlTemplate,$e as UnsafeRawSql,qp as _bundleExt, export_defaults as defaults,export_escapeIdentifier as escapeIdentifier,export_escapeLiteral as escapeLiteral, -cs as neon,ce as neonConfig,export_types as types,bt as warnIfBrowser}; +ls as neon,ce as neonConfig,export_types as types,vt as warnIfBrowser}; /*! Bundled license information: ieee754/index.js: diff --git a/src/client.ts b/src/client.ts index 740b35d..947afb9 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1,6 +1,7 @@ import { Client, Connection, type ClientConfig } from 'pg'; import { Socket } from './shims/net'; import { warnIfBrowser } from './utils'; +import { PACKAGE_URL } from './packageInfo'; export declare interface NeonClient { connection: Connection & { @@ -25,7 +26,11 @@ export class NeonClient extends Client { } constructor(public config?: string | ClientConfig) { - super(config); + super( + typeof config === 'string' + ? { connectionString: config, fallback_application_name: PACKAGE_URL } + : { fallback_application_name: PACKAGE_URL, ...config }, + ); } override connect(): Promise; diff --git a/src/httpQuery.ts b/src/httpQuery.ts index 335e951..c31d1df 100644 --- a/src/httpQuery.ts +++ b/src/httpQuery.ts @@ -28,6 +28,7 @@ import type { } from './httpTypes'; import { SqlTemplate, UnsafeRawSql } from './sqlTemplate'; import { warnIfBrowser } from './utils'; +import { PACKAGE_URL } from './packageInfo'; import { Socket as neonConfig } from './shims/net'; @@ -351,6 +352,7 @@ export function neon< 'Neon-Connection-String': connectionString, 'Neon-Raw-Text-Output': 'true', // because we do our own parsing with node-postgres 'Neon-Array-Mode': 'true', // this saves data and post-processing even if we return objects, not arrays + 'Neon-Client-Info': PACKAGE_URL, }; // --- add auth token to headers --- diff --git a/src/packageInfo.ts b/src/packageInfo.ts new file mode 100644 index 0000000..74e5221 --- /dev/null +++ b/src/packageInfo.ts @@ -0,0 +1,3 @@ +declare const PACKAGE_VERSION: string; + +export const PACKAGE_URL = `pkg:npm/%40neondatabase/serverless@${PACKAGE_VERSION}`; diff --git a/tests/cli/http.test.ts b/tests/cli/http.test.ts index 35b08b9..8c7c347 100644 --- a/tests/cli/http.test.ts +++ b/tests/cli/http.test.ts @@ -8,6 +8,7 @@ import { type FullQueryResults, } from '@neondatabase/serverless'; // see package.json: this points to 'file:.' import { sampleQueries } from './sampleQueries'; +import packageMetadata from '../../package.json'; const DATABASE_URL = process.env.VITE_NEON_DB_URL!; const sql = neon(DATABASE_URL); @@ -205,6 +206,31 @@ test('custom fetch', async () => { } }); +test('sends the package URL with HTTP queries', async () => { + const prevFetchFunction = neonConfig.fetchFunction; + try { + const fn = vi.fn(async () => + Response.json({ + fields: [], + rows: [], + command: 'SELECT', + rowCount: 0, + }), + ); + neonConfig.fetchFunction = fn; + + const mockedSql = neon('postgres://user@example.com/database'); + await mockedSql`SELECT`; + + expect(fn).toHaveBeenCalledOnce(); + expect(fn.mock.calls[0][1]?.headers).toMatchObject({ + 'Neon-Client-Info': `pkg:npm/%40neondatabase/serverless@${packageMetadata.version}`, + }); + } finally { + neonConfig.fetchFunction = prevFetchFunction; + } +}); + test('errors match WebSocket query errors', async () => { const q = 'SELECT 123 WHERE x'; diff --git a/tests/cli/ws.test.ts b/tests/cli/ws.test.ts index 2584ec0..0cf16d5 100644 --- a/tests/cli/ws.test.ts +++ b/tests/cli/ws.test.ts @@ -3,6 +3,7 @@ import { Pool as PgPool, type QueryResult } from 'pg'; import * as subtls from 'subtls'; import { sampleQueries } from './sampleQueries'; import { ISRGX1Cert } from './subtlsCert'; +import packageMetadata from '../../package.json'; import { neon, neonConfig, @@ -34,6 +35,19 @@ const DB_POOLER_URL = process.env.VITE_NEON_DB_POOLER_URL!; const pgPool = new PgPool({ connectionString: DB_DIRECT_URL }); +test('uses the package URL as the default application name', () => { + const expected = `pkg:npm/%40neondatabase/serverless@${packageMetadata.version}`; + + const defaultClient = new WsClient('postgres://user@example.com/database'); + expect(defaultClient.getStartupConf().application_name).toBe(expected); + + const namedClient = new WsClient({ + connectionString: 'postgres://user@example.com/database', + application_name: 'custom-client', + }); + expect(namedClient.getStartupConf().application_name).toBe('custom-client'); +}); + describe.each([ { DB_URL: DB_DIRECT_URL,