From 141dfad72a0e31eef37e3977ea29802547c939ae Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Wed, 19 Aug 2026 07:50:54 +0100 Subject: [PATCH 1/7] Add JSON and CBOR SQL streaming formats --- build.sh | 2 + index.d.mts | 12 +- index.d.ts | 12 +- index.js | 1839 +++++++++++++++++-------------- index.mjs | 1839 +++++++++++++++++-------------- package-lock.json | 134 +++ package.json | 1 + src/httpQuery.ts | 102 +- src/httpTypes.ts | 11 + tests/cli/httpStreaming.test.ts | 188 ++++ 10 files changed, 2448 insertions(+), 1692 deletions(-) create mode 100644 tests/cli/httpStreaming.test.ts diff --git a/build.sh b/build.sh index 4257275..fe82e26 100755 --- a/build.sh +++ b/build.sh @@ -18,6 +18,7 @@ npx esbuild src/index.ts \ --format=cjs \ --bundle \ --keep-names \ + --alias:cbor-x=cbor-x/decode \ --inject:src/shims/shims.js \ --define:BUNDLE_EXT=\"js\" \ --target=es2020 \ @@ -30,6 +31,7 @@ npx esbuild src/index.ts \ --format=esm \ --bundle \ --keep-names \ + --alias:cbor-x=cbor-x/decode \ --inject:src/shims/shims.js \ --define:BUNDLE_EXT=\"mjs\" \ --target=es2020 \ diff --git a/index.d.mts b/index.d.mts index 35a4427..26cdcb5 100644 --- a/index.d.mts +++ b/index.d.mts @@ -451,6 +451,14 @@ export declare interface HTTPQueryOptions; + /** + * Wire format requested from the SQL-over-HTTP endpoint. + * + * `jsonl` and `cbor-seq` are currently supported only for single queries. + * + * Default: `json` + */ + responseFormat?: HTTPResponseFormat; /** * JWT auth token to be passed as the Bearer token in the Authorization header. * Can be string, or a function (sync or async) returning a string. @@ -471,6 +479,8 @@ export declare interface HTTPQueryOptions extends HTTPQueryOptions { /** * Postgres transaction isolation level: see https://www.postgresql.org/docs/current/transaction-iso.html. @@ -572,7 +582,7 @@ export declare interface MessageConfig { * pass as `fetchOptions` an object which will be merged into the options * passed to `fetch`. */ -export declare function neon(connectionString: string, { arrayMode: neonOptArrayMode, fullResults: neonOptFullResults, fetchOptions: neonOptFetchOptions, isolationLevel: neonOptIsolationLevel, readOnly: neonOptReadOnly, deferrable: neonOptDeferrable, authToken, disableWarningInBrowsers, }?: HTTPTransactionOptions): NeonQueryFunction; +export declare function neon(connectionString: string, { arrayMode: neonOptArrayMode, fullResults: neonOptFullResults, fetchOptions: neonOptFetchOptions, responseFormat: neonOptResponseFormat, isolationLevel: neonOptIsolationLevel, readOnly: neonOptReadOnly, deferrable: neonOptDeferrable, authToken, disableWarningInBrowsers, }?: HTTPTransactionOptions): NeonQueryFunction; export declare interface NeonConfig { poolQueryViaFetch: boolean; diff --git a/index.d.ts b/index.d.ts index 35a4427..26cdcb5 100644 --- a/index.d.ts +++ b/index.d.ts @@ -451,6 +451,14 @@ export declare interface HTTPQueryOptions; + /** + * Wire format requested from the SQL-over-HTTP endpoint. + * + * `jsonl` and `cbor-seq` are currently supported only for single queries. + * + * Default: `json` + */ + responseFormat?: HTTPResponseFormat; /** * JWT auth token to be passed as the Bearer token in the Authorization header. * Can be string, or a function (sync or async) returning a string. @@ -471,6 +479,8 @@ export declare interface HTTPQueryOptions extends HTTPQueryOptions { /** * Postgres transaction isolation level: see https://www.postgresql.org/docs/current/transaction-iso.html. @@ -572,7 +582,7 @@ export declare interface MessageConfig { * pass as `fetchOptions` an object which will be merged into the options * passed to `fetch`. */ -export declare function neon(connectionString: string, { arrayMode: neonOptArrayMode, fullResults: neonOptFullResults, fetchOptions: neonOptFetchOptions, isolationLevel: neonOptIsolationLevel, readOnly: neonOptReadOnly, deferrable: neonOptDeferrable, authToken, disableWarningInBrowsers, }?: HTTPTransactionOptions): NeonQueryFunction; +export declare function neon(connectionString: string, { arrayMode: neonOptArrayMode, fullResults: neonOptFullResults, fetchOptions: neonOptFetchOptions, responseFormat: neonOptResponseFormat, isolationLevel: neonOptIsolationLevel, readOnly: neonOptReadOnly, deferrable: neonOptDeferrable, authToken, disableWarningInBrowsers, }?: HTTPTransactionOptions): NeonQueryFunction; export declare interface NeonConfig { poolQueryViaFetch: boolean; diff --git a/index.js b/index.js index 650ab34..76971d4 100644 --- a/index.js +++ b/index.js @@ -1,404 +1,404 @@ -"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> -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;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? --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, -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? +"use strict";var Aa=Object.create;var je=Object.defineProperty;var _a=Object.getOwnPropertyDescriptor;var Ca=Object.getOwnPropertyNames;var Ia=Object.getPrototypeOf,Ta=Object.prototype.hasOwnProperty;var Pa=(r,e,t)=>e in r?je(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>je(r,"name",{value:e,configurable:!0});var re=(r,e)=>()=>(r&&(e=r(r=0)),e);var R=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),he=(r,e)=>{for(var t in e)je(r,t,{get:e[t], +enumerable:!0})},Ci=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ca(e))!Ta. +call(r,i)&&i!==t&&je(r,i,{get:()=>e[i],enumerable:!(n=_a(e,i))||n.enumerable});return r};var De=(r,e,t)=>(t=r!=null?Aa(Ia(r)):{},Ci(e||!r||!r.__esModule?je(t,"default",{value:r,enumerable:!0}): +t,r)),j=r=>Ci(je({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Pa(r,typeof e!="symbol"?e+"":e,t);var Pi=R(Mt=>{"use strict";p();Mt.byteLength=Ba;Mt.toByteArray=ka;Mt.fromByteArray=Ua;var xe=[],de=[], +Ra=typeof Uint8Array<"u"?Uint8Array:Array,mr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ +23456789+/";for(Oe=0,Ii=mr.length;Oe0)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(Ti,"getLens"); +function Ba(r){var e=Ti(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Ba,"byteLength");function La(r,e,t){return(e+ +t)*3/4-t}a(La,"_byteLength");function ka(r){var e,t=Ti(r),n=t[0],i=t[1],s=new Ra(La(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=de[r.charCodeAt( +c)]<<2|de[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=de[r.charCodeAt(c)]<<10|de[r.charCodeAt(c+1)]<< +4|de[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(ka,"toByteArray");function Fa(r){return xe[r>> +18&63]+xe[r>>12&63]+xe[r>>6&63]+xe[r&63]}a(Fa,"tripletToBase64");function Ma(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(Fa(n));return i.join("")}a(Ma,"en\ +codeChunk");function Ua(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(xe[e>>2]+xe[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1], +i.push(xe[e>>10]+xe[e>>4&63]+xe[e<<2&63]+"=")),i.join("")}a(Ua,"fromByteArray")});var Ri=R(wr=>{p();wr.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,E=r[e+y];for(y+=g,s=E&(1<<-f)-1,E>>=-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:(E?-1:1)*(1/0);o=o+Math. +pow(2,n),s=s-l}return(E?-1:1)*o*Math.pow(2,s-n)};wr.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,E=n?0:s-1,C=n?1:-1,H=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< +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+E]=u&255,E+= +C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=H*128}});var Vi=R(Ge=>{"use strict";p();var gr=Pi(),He=Ri(),Bi=typeof Symbol=="function"&&typeof Symbol.for== +"function"?Symbol.for("nodejs.util.inspect.custom"):null;Ge.Buffer=d;Ge.SlowBuffer=ja;Ge.INSPECT_MAX_BYTES= +50;var Ut=2147483647;Ge.kMaxLength=Ut;d.TYPED_ARRAY_SUPPORT=Da();!d.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 Da(){ 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. -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+'\ -" 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\ -, 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\ - 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. -toPrimitive]=="function")return h.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The\ +prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}a(Da,"typedArraySupport");Object. +defineProperty(d.prototype,"parent",{enumerable:!0,get:a(function(){if(d.isBuffer(this))return this. +buffer},"get")});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:a(function(){if(d.isBuffer( +this))return this.byteOffset},"get")});function Ae(r){if(r>Ut)throw new RangeError('The value "'+r+'\ +" is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,d.prototype), +e}a(Ae,"createBuffer");function d(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 vr(r)}return Mi(r,e,t)} +a(d,"Buffer");d.poolSize=8192;function Mi(r,e,t){if(typeof r=="string")return Na(r,e);if(ArrayBuffer. +isView(r))return qa(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(Se(r,ArrayBuffer)|| +r&&Se(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Se(r,SharedArrayBuffer)||r&&Se(r.buffer, +SharedArrayBuffer)))return xr(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 d. +from(n,e,t);let i=Qa(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. +toPrimitive]=="function")return d.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, -Uint8Array.prototype);Object.setPrototypeOf(h,Uint8Array);function zn(r){if(typeof r!="number")throw new TypeError( +ed type "+typeof r)}a(Mi,"from");d.from=function(r,e,t){return Mi(r,e,t)};Object.setPrototypeOf(d.prototype, +Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Ui(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!== -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( +r,e,t),Object.setPrototypeOf(n,d.prototype),n}a(xr,"fromArrayBuffer");function Qa(r){if(d.isBuffer(r)){ +let e=Er(r.length)|0,t=Ae(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r. +length!="number"||_r(r.length)?Ae(0):br(r);if(r.type==="Buffer"&&Array.isArray(r.data))return br(r.data)} +a(Qa,"fromObject");function Er(r){if(r>=Ut)throw new RangeError("Attempt to allocate Buffer larger t\ +han maximum size: 0x"+Ut.toString(16)+" bytes");return r|0}a(Er,"checked");function ja(r){return+r!= +r&&(r=0),d.alloc(+r)}a(ja,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== +d.prototype},"isBuffer");d.compare=a(function(e,t){if(Se(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)), +Se(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.isBuffer(t))throw new TypeError( 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length, i=t.length;for(let s=0,o=Math.min(n,i);si.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; -if(ArrayBuffer.isView(r)||ce(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError( +utf-16le":return!0;default:return!1}},"isEncoding");d.concat=a(function(e,t){if(!Array.isArray(e))throw new TypeError( +'"list" argument must be an Array of Buffers');if(e.length===0)return d.alloc(0);let n;if(t===void 0) +for(t=0,n=0;ni.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(i,s)):Uint8Array.prototype. +set.call(i,o,s);else if(d.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 Di(r,e){if(d.isBuffer(r))return r.length; +if(ArrayBuffer.isView(r)||Se(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){ +ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Sr(r).length;case"ucs2":case"\ +ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Gi(r).length;default: +if(i)return n?-1:Sr(r).length;e=(""+e).toLowerCase(),i=!0}}a(Di,"byteLength");d.byteLength=Di;function Wa(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, -"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;t>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Xa(this,e,t);case"u\ +tf8":case"utf-8":return Ni(this,e,t);case"ascii":return Ja(this,e,t);case"latin1":case"binary":return Za( +this,e,t);case"base64":return za(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return eu( +this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(Wa, +"slowToString");d.prototype._isBuffer=!0;function Ne(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(Ne,"swap"); +d.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){ -if(ce(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(e))throw new TypeError('The "ta\ +er "+e+">"},"inspect");Bi&&(d.prototype[Bi]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ +if(Se(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.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. -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. +compare");function Oi(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,_r(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=d.from( +e,n)),d.isBuffer(e))return e.length===0?-1:Li(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):Li(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Oi,"bidire\ +ctionalIndexOf");function Li(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: -if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"write");h.prototype. +fer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return Ha(this,e,t,n);case"utf8":case"\ +utf-8":return $a(this,e,t,n);case"ascii":case"latin1":case"binary":return Ga(this,e,t,n);case"base64": +return Va(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ka(this,e,t,n);default: +if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"write");d.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 Ya(n)}a(Ni,"utf8Slice");var ki=4096;function Ya(r){let e=r.length;if(e<=ki)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){ +e&&(t=e);let i=this.subarray(e,t);return Object.setPrototypeOf(i,d.prototype),i},"slice");function V(r,e,t){ if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to \ -access beyond buffer length")}a(q,"checkOffset");h.prototype.readUintLE=h.prototype.readUIntLE=a(function(e,t,n){ -e=e>>>0,t=t>>>0,n||q(e,t,this.length);let i=this[e],s=1,o=0;for(;++o>>0,t=t>>>0,n||q(e, -t,this.length);let i=this[e+--t],s=1;for(;t>0&&(s*=256);)i+=this[e+--t]*s;return i},"readUIntBE");h. -prototype.readUint8=h.prototype.readUInt8=a(function(e,t){return e=e>>>0,t||q(e,1,this.length),this[e]}, -"readUInt8");h.prototype.readUint16LE=h.prototype.readUInt16LE=a(function(e,t){return e=e>>>0,t||q(e, -2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");h.prototype.readUint16BE=h.prototype.readUInt16BE= -a(function(e,t){return e=e>>>0,t||q(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");h.prototype. -readUint32LE=h.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||q(e,4,this.length),(this[e]| -this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");h.prototype.readUint32BE=h.prototype. -readUInt32BE=a(function(e,t){return e=e>>>0,t||q(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+ -2]<<8|this[e+3])},"readUInt32BE");h.prototype.readBigUInt64LE=be(a(function(e){e=e>>>0,Be(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Ve(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* +access beyond buffer length")}a(V,"checkOffset");d.prototype.readUintLE=d.prototype.readUIntLE=a(function(e,t,n){ +e=e>>>0,t=t>>>0,n||V(e,t,this.length);let i=this[e],s=1,o=0;for(;++o>>0,t=t>>>0,n||V(e, +t,this.length);let i=this[e+--t],s=1;for(;t>0&&(s*=256);)i+=this[e+--t]*s;return i},"readUIntBE");d. +prototype.readUint8=d.prototype.readUInt8=a(function(e,t){return e=e>>>0,t||V(e,1,this.length),this[e]}, +"readUInt8");d.prototype.readUint16LE=d.prototype.readUInt16LE=a(function(e,t){return e=e>>>0,t||V(e, +2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");d.prototype.readUint16BE=d.prototype.readUInt16BE= +a(function(e,t){return e=e>>>0,t||V(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");d.prototype. +readUint32LE=d.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||V(e,4,this.length),(this[e]| +this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");d.prototype.readUint32BE=d.prototype. +readUInt32BE=a(function(e,t){return e=e>>>0,t||V(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+ +2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Pe(a(function(e){e=e>>>0,$e(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ft(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* 2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<< -BigInt(32))},"readBigUInt64LE"));h.prototype.readBigUInt64BE=be(a(function(e){e=e>>>0,Be(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Ve(e,this.length-8);let i=t*2**24+this[++e]*2**16+ +BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Pe(a(function(e){e=e>>>0,$e(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ft(e,this.length-8);let i=t*2**24+this[++e]*2**16+ this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<>>0,t=t>>>0,n||q(e,t, +32))+BigInt(s)},"readBigUInt64BE"));d.prototype.readIntLE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||V(e,t, this.length);let i=this[e],s=1,o=0;for(;++o=s&&(i-=Math. -pow(2,8*t)),i},"readIntLE");h.prototype.readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this.length); +pow(2,8*t)),i},"readIntLE");d.prototype.readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||V(e,t,this.length); let i=t,s=1,o=this[e+--i];for(;i>0&&(s*=256);)o+=this[e+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8* -t)),o},"readIntBE");h.prototype.readInt8=a(function(e,t){return e=e>>>0,t||q(e,1,this.length),this[e]& -128?(255-this[e]+1)*-1:this[e]},"readInt8");h.prototype.readInt16LE=a(function(e,t){e=e>>>0,t||q(e,2, -this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");h.prototype.readInt16BE= -a(function(e,t){e=e>>>0,t||q(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760: -n},"readInt16BE");h.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||q(e,4,this.length),this[e]| -this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");h.prototype.readInt32BE=a(function(e,t){return e= -e>>>0,t||q(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");h.prototype. -readBigInt64LE=be(a(function(e){e=e>>>0,Be(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& -Ve(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,Be(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&Ve(e,this. +t)),o},"readIntBE");d.prototype.readInt8=a(function(e,t){return e=e>>>0,t||V(e,1,this.length),this[e]& +128?(255-this[e]+1)*-1:this[e]},"readInt8");d.prototype.readInt16LE=a(function(e,t){e=e>>>0,t||V(e,2, +this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");d.prototype.readInt16BE= +a(function(e,t){e=e>>>0,t||V(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760: +n},"readInt16BE");d.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||V(e,4,this.length),this[e]| +this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");d.prototype.readInt32BE=a(function(e,t){return e= +e>>>0,t||V(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");d.prototype. +readBigInt64LE=Pe(a(function(e){e=e>>>0,$e(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& +ft(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,$e(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ft(e,this. length-8);let i=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,t||q(e,4,this.length),Re.read(this,e,!0,23,4)},"readFloatLE");h.prototype.readFloatBE= -a(function(e,t){return e=e>>>0,t||q(e,4,this.length),Re.read(this,e,!1,23,4)},"readFloatBE");h.prototype. -readDoubleLE=a(function(e,t){return e=e>>>0,t||q(e,8,this.length),Re.read(this,e,!0,52,8)},"readDoub\ -leLE");h.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||q(e,8,this.length),Re.read(this,e, -!1,52,8)},"readDoubleBE");function V(r,e,t,n,i,s){if(!h.isBuffer(r))throw new TypeError('"buffer" ar\ -gument must be a Buffer instance');if(e>i||er.length)throw new RangeError("Index out of range")}a(V,"checkInt");h.prototype.writeUintLE= -h.prototype.writeUIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;V(this, +this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)},"readBigInt64BE"));d.prototype.readFloatLE=a(function(e,t){ +return e=e>>>0,t||V(e,4,this.length),He.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= +a(function(e,t){return e=e>>>0,t||V(e,4,this.length),He.read(this,e,!1,23,4)},"readFloatBE");d.prototype. +readDoubleLE=a(function(e,t){return e=e>>>0,t||V(e,8,this.length),He.read(this,e,!0,52,8)},"readDoub\ +leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||V(e,8,this.length),He.read(this,e, +!1,52,8)},"readDoubleBE");function ne(r,e,t,n,i,s){if(!d.isBuffer(r))throw new TypeError('"buffer" a\ +rgument must be a Buffer instance');if(e>i||er.length)throw new RangeError("Index out of range")}a(ne,"checkInt");d.prototype.writeUintLE= +d.prototype.writeUIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;ne(this, e,t,n,u,0)}let s=1,o=0;for(this[t]=e&255;++o>>0,n=n>>>0,!i){let u=Math. -pow(2,8*n)-1;V(this,e,t,n,u,0)}let s=n-1,o=1;for(this[t+s]=e&255;--s>=0&&(o*=256);)this[t+s]=e/o&255; -return t+n},"writeUIntBE");h.prototype.writeUint8=h.prototype.writeUInt8=a(function(e,t,n){return e= -+e,t=t>>>0,n||V(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");h.prototype.writeUint16LE=h.prototype. -writeUInt16LE=a(function(e,t,n){return e=+e,t=t>>>0,n||V(this,e,t,2,65535,0),this[t]=e&255,this[t+1]= -e>>>8,t+2},"writeUInt16LE");h.prototype.writeUint16BE=h.prototype.writeUInt16BE=a(function(e,t,n){return e= -+e,t=t>>>0,n||V(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");h.prototype. -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++]= +d.prototype.writeUintBE=d.prototype.writeUIntBE=a(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let u=Math. +pow(2,8*n)-1;ne(this,e,t,n,u,0)}let s=n-1,o=1;for(this[t+s]=e&255;--s>=0&&(o*=256);)this[t+s]=e/o&255; +return t+n},"writeUIntBE");d.prototype.writeUint8=d.prototype.writeUInt8=a(function(e,t,n){return e= ++e,t=t>>>0,n||ne(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");d.prototype.writeUint16LE=d.prototype. +writeUInt16LE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(this,e,t,2,65535,0),this[t]=e&255,this[t+1]= +e>>>8,t+2},"writeUInt16LE");d.prototype.writeUint16BE=d.prototype.writeUInt16BE=a(function(e,t,n){return e= ++e,t=t>>>0,n||ne(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");d.prototype. +writeUint32LE=d.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(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");d.prototype. +writeUint32BE=d.prototype.writeUInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(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 qi(r,e,t,n,i){ +$i(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(qi,"wrtBigUInt64LE");function Qi(r,e,t,n,i){$i(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( -"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= -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=n-1,o=1,u=0; -for(this[t+s]=e&255;--s>=0&&(o*=256);)e<0&&u===0&&this[t+s+1]!==0&&(u=1),this[t+s]=(e/o>>0)-u&255;return t+ -n},"writeIntBE");h.prototype.writeInt8=a(function(e,t,n){return e=+e,t=t>>>0,n||V(this,e,t,1,127,-128), -e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");h.prototype.writeInt16LE=a(function(e,t,n){return e= -+e,t=t>>>0,n||V(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeInt16LE");h.prototype. -writeInt16BE=a(function(e,t,n){return e=+e,t=t>>>0,n||V(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+ -1]=e&255,t+2},"writeInt16BE");h.prototype.writeInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||V(this, -e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},"\ -writeInt32LE");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\ -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"); -h.prototype.copy=a(function(e,t,n,i){if(!h.isBuffer(e))throw new TypeError("argument should be a Buf\ +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(Qi,"wrtBigUInt64BE");d.prototype. +writeBigUInt64LE=Pe(a(function(e,t=0){return qi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ +riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Pe(a(function(e,t=0){return Qi(this,e,t,BigInt(0),BigInt( +"0xffffffffffffffff"))},"writeBigUInt64BE"));d.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>> +0,!i){let c=Math.pow(2,8*n-1);ne(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");d.prototype.writeIntBE= +a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*n-1);ne(this,e,t,n,c-1,-c)}let s=n-1,o=1, +u=0;for(this[t+s]=e&255;--s>=0&&(o*=256);)e<0&&u===0&&this[t+s+1]!==0&&(u=1),this[t+s]=(e/o>>0)-u&255; +return t+n},"writeIntBE");d.prototype.writeInt8=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(this,e,t, +1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");d.prototype.writeInt16LE=a(function(e,t,n){ +return e=+e,t=t>>>0,n||ne(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeInt16LE"); +d.prototype.writeInt16BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(this,e,t,2,32767,-32768),this[t]= +e>>>8,this[t+1]=e&255,t+2},"writeInt16BE");d.prototype.writeInt32LE=a(function(e,t,n){return e=+e,t= +t>>>0,n||ne(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+ +3]=e>>>24,t+4},"writeInt32LE");d.prototype.writeInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne( +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");d.prototype.writeBigInt64LE=Pe(a(function(e,t=0){return qi( +this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));d.prototype. +writeBigInt64BE=Pe(a(function(e,t=0){return Qi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ +ffffffffffff"))},"writeBigInt64BE"));function ji(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(ji,"checkIEEE754");function Wi(r,e,t,n,i){ +return e=+e,t=t>>>0,i||ji(r,e,t,4,34028234663852886e22,-34028234663852886e22),He.write(r,e,t,n,23,4), +t+4}a(Wi,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return Wi(this,e,t,!0,n)},"writeFl\ +oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return Wi(this,e,t,!1,n)},"writeFloatBE");function Hi(r,e,t,n,i){ +return e=+e,t=t>>>0,i||ji(r,e,t,8,17976931348623157e292,-17976931348623157e292),He.write(r,e,t,n,52, +8),t+8}a(Hi,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return Hi(this,e,t,!0,n)},"wr\ +iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return Hi(this,e,t,!1,n)},"writeDoubleBE"); +d.prototype.copy=a(function(e,t,n,i){if(!d.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=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd \ out of bounds");i>this.length&&(i=this.length),e.length-t>>0,n=n===void 0?this.length:n>>> -0,e||(e=0);let s;if(typeof e=="number")for(s=t;s2**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){ +e ${typeof e}`},TypeError);Ar("ERR_OUT_OF_RANGE",function(r,e,t){let n=`The value of "${r}" is out o\ +f range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=Fi(String(t)):typeof t=="bigint"&&(i=String( +t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Fi(i)),i+="n"),n+=` It must be ${e}. Re\ +ceived ${i}`,n},RangeError);function Fi(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(Fi,"addNumericalSeparator");function tu(r,e,t){ +$e(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&ft(e,r.length-(t+1))}a(tu,"checkBounds");function $i(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!= -"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< +nd <= ${t}${o}`,new We.ERR_OUT_OF_RANGE("value",u,r)}tu(n,i,s)}a($i,"checkIntBI");function $e(r,e){if(typeof r!= +"number")throw new We.ERR_INVALID_ARG_TYPE(e,"number",r)}a($e,"validateNumber");function ft(r,e,t){throw Math. +floor(r)!==r?($e(r,t),new We.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new We.ERR_BUFFER_OUT_OF_BOUNDS: +new We.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(ft,"boundsError");var ru=/[^+/0-9A-Za-z-_]/g; +function nu(r){if(r=r.split("=")[0],r=r.trim().replace(ru,""),r.length<2)return"";for(;r.length%4!== +0;)r=r+"=";return r}a(nu,"base64clean");function Sr(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){ -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. -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!= +240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}a(Sr,"utf\ +8ToBytes");function iu(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(su,"utf16leToBytes");function Gi(r){return gr.toByteArray( +nu(r))}a(Gi,"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 Se(r,e){return r instanceof e||r!=null&&r.constructor!= +null&&r.constructor.name!=null&&r.constructor.name===e.name}a(Se,"isInstance");function _r(r){return r!== +r}a(_r,"numberIsNaN");var ou=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 Pe(r){return typeof BigInt>"u"? +au:r}a(Pe,"defineBigIntMethod");function au(){throw new Error("BigInt not supported")}a(au,"BufferBi\ +gIntNotDefined")});var S,v,A,m,w,p=re(()=>{"use strict";S=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),A= +globalThis.clearImmediate??(r=>clearTimeout(r)),m=typeof globalThis.Buffer=="function"&&typeof globalThis. +Buffer.allocUnsafe=="function"?globalThis.Buffer:Vi().Buffer,w=globalThis.process??{};w.env??(w.env= +{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Re=R((Jf,Cr)=>{"use strict";p();var Ve=typeof Reflect=="object"?Reflect:null,Ki=Ve&&typeof Ve.apply== +"function"?Ve.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Ot; +Ve&&typeof Ve.ownKeys=="function"?Ot=Ve.ownKeys:Object.getOwnPropertySymbols?Ot=a(function(e){return Object. +getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Ot=a(function(e){return Object. +getOwnPropertyNames(e)},"ReflectOwnKeys");function uu(r){console&&console.warn&&console.warn(r)}a(uu, +"ProcessEmitWarning");var Yi=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function F(){F. +init.call(this)}a(F,"EventEmitter");Cr.exports=F;Cr.exports.once=hu;F.EventEmitter=F;F.prototype._events= +void 0;F.prototype._eventsCount=0;F.prototype._maxListeners=void 0;var zi=10;function Nt(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}, -"set")});R.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&& +a(Nt,"checkListener");Object.defineProperty(F,"defaultMaxListeners",{enumerable:!0,get:a(function(){ +return zi},"get"),set:a(function(r){if(typeof r!="number"||r<0||Yi(r))throw new RangeError('The valu\ +e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");zi=r}, +"set")});F.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\ +F.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||Yi(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"); -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=Ji(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,uu(u)}return r}a(Zi,"_addListener");F.prototype.addListener=a(function(e,t){ +return Zi(this,e,t,!1)},"addListener");F.prototype.on=F.prototype.addListener;F.prototype.prependListener= +a(function(e,t){return Zi(this,e,t,!0)},"prependListener");function cu(){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(cu,"onceWrapper");function Xi(r,e,t){var n={fired:!1, +wrapFn:void 0,target:r,type:e,listener:t},i=cu.bind(n);return i.listener=t,n.wrapFn=i,i}a(Xi,"_onceW\ +rap");F.prototype.once=a(function(e,t){return Nt(t),this.on(e,Xi(this,e,t)),this},"once");F.prototype. +prependOnceListener=a(function(e,t){return Nt(t),this.prependListener(e,Xi(this,e,t)),this},"prepend\ +OnceListener");F.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(Nt(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!== -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; +listener,s=o;break}if(s<0)return this;s===0?n.shift():lu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== +void 0&&this.emit("removeListener",e,u||t)}return this},"removeListener");F.prototype.off=F.prototype. +removeListener;F.prototype.removeAllListeners=a(function(e){var t,n,i;if(n=this._events,n===void 0)return this; if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount= 0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments. length===0){var s=Object.keys(n),o;for(i=0;i= -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 es(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?Ot(this._events):[]},"eventNames");function rs(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(){ -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(){ -return S.opts.poolQueryViaFetch??S.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){S.opts. -poolQueryViaFetch=t}static get fetchEndpoint(){return S.opts.fetchEndpoint??S.defaults.fetchEndpoint}static set fetchEndpoint(t){ -S.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(t){ +ust be of type EventEmitter. Received type '+typeof r)}a(ns,"eventTargetAgnosticAddListener")});var os={};he(os,{Socket:()=>be,isIP:()=>pu});function pu(r){return 0}var ss,is,_,be,Ke=re(()=>{"use \ +strict";p();ss=De(Re(),1);a(pu,"isIP");is=/^[^.]+\./,_=class _ extends ss.EventEmitter{constructor(){ +super(...arguments);I(this,"opts",{});I(this,"connecting",!1);I(this,"pending",!0);I(this,"writable", +!0);I(this,"encrypted",!1);I(this,"authorized",!1);I(this,"destroyed",!1);I(this,"ws",null);I(this,"\ +writeBuffer");I(this,"tlsState",0);I(this,"tlsRead");I(this,"tlsWrite")}static get poolQueryViaFetch(){ +return _.opts.poolQueryViaFetch??_.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){_.opts. +poolQueryViaFetch=t}static get fetchEndpoint(){return _.opts.fetchEndpoint??_.defaults.fetchEndpoint}static set fetchEndpoint(t){ +_.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(t){ console.warn("The `fetchConnectionCache` option is deprecated (now always `true`)")}static get fetchFunction(){ -return S.opts.fetchFunction??S.defaults.fetchFunction}static set fetchFunction(t){S.opts.fetchFunction= -t}static get webSocketConstructor(){return S.opts.webSocketConstructor??S.defaults.webSocketConstructor}static set webSocketConstructor(t){ -S.opts.webSocketConstructor=t}get webSocketConstructor(){return this.opts.webSocketConstructor??S.webSocketConstructor}set webSocketConstructor(t){ -this.opts.webSocketConstructor=t}static get wsProxy(){return S.opts.wsProxy??S.defaults.wsProxy}static set wsProxy(t){ -S.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy??S.wsProxy}set wsProxy(t){this.opts.wsProxy= -t}static get coalesceWrites(){return S.opts.coalesceWrites??S.defaults.coalesceWrites}static set coalesceWrites(t){ -S.opts.coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??S.coalesceWrites}set coalesceWrites(t){ -this.opts.coalesceWrites=t}static get useSecureWebSocket(){return S.opts.useSecureWebSocket??S.defaults. -useSecureWebSocket}static set useSecureWebSocket(t){S.opts.useSecureWebSocket=t}get useSecureWebSocket(){ -return this.opts.useSecureWebSocket??S.useSecureWebSocket}set useSecureWebSocket(t){this.opts.useSecureWebSocket= -t}static get forceDisablePgSSL(){return S.opts.forceDisablePgSSL??S.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){ -S.opts.forceDisablePgSSL=t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??S.forceDisablePgSSL}set forceDisablePgSSL(t){ -this.opts.forceDisablePgSSL=t}static get disableSNI(){return S.opts.disableSNI??S.defaults.disableSNI}static set disableSNI(t){ -S.opts.disableSNI=t}get disableSNI(){return this.opts.disableSNI??S.disableSNI}set disableSNI(t){this. -opts.disableSNI=t}static get disableWarningInBrowsers(){return S.opts.disableWarningInBrowsers??S.defaults. -disableWarningInBrowsers}static set disableWarningInBrowsers(t){S.opts.disableWarningInBrowsers=t}get disableWarningInBrowsers(){ -return this.opts.disableWarningInBrowsers??S.disableWarningInBrowsers}set disableWarningInBrowsers(t){ -this.opts.disableWarningInBrowsers=t}static get pipelineConnect(){return S.opts.pipelineConnect??S.defaults. -pipelineConnect}static set pipelineConnect(t){S.opts.pipelineConnect=t}get pipelineConnect(){return this. -opts.pipelineConnect??S.pipelineConnect}set pipelineConnect(t){this.opts.pipelineConnect=t}static get subtls(){ -return S.opts.subtls??S.defaults.subtls}static set subtls(t){S.opts.subtls=t}get subtls(){return this. -opts.subtls??S.subtls}set subtls(t){this.opts.subtls=t}static get pipelineTLS(){return S.opts.pipelineTLS?? -S.defaults.pipelineTLS}static set pipelineTLS(t){S.opts.pipelineTLS=t}get pipelineTLS(){return this. -opts.pipelineTLS??S.pipelineTLS}set pipelineTLS(t){this.opts.pipelineTLS=t}static get rootCerts(){return S. -opts.rootCerts??S.defaults.rootCerts}static set rootCerts(t){S.opts.rootCerts=t}get rootCerts(){return this. -opts.rootCerts??S.rootCerts}set rootCerts(t){this.opts.rootCerts=t}wsProxyAddrForHost(t,n){let i=this. +return _.opts.fetchFunction??_.defaults.fetchFunction}static set fetchFunction(t){_.opts.fetchFunction= +t}static get webSocketConstructor(){return _.opts.webSocketConstructor??_.defaults.webSocketConstructor}static set webSocketConstructor(t){ +_.opts.webSocketConstructor=t}get webSocketConstructor(){return this.opts.webSocketConstructor??_.webSocketConstructor}set webSocketConstructor(t){ +this.opts.webSocketConstructor=t}static get wsProxy(){return _.opts.wsProxy??_.defaults.wsProxy}static set wsProxy(t){ +_.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy??_.wsProxy}set wsProxy(t){this.opts.wsProxy= +t}static get coalesceWrites(){return _.opts.coalesceWrites??_.defaults.coalesceWrites}static set coalesceWrites(t){ +_.opts.coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??_.coalesceWrites}set coalesceWrites(t){ +this.opts.coalesceWrites=t}static get useSecureWebSocket(){return _.opts.useSecureWebSocket??_.defaults. +useSecureWebSocket}static set useSecureWebSocket(t){_.opts.useSecureWebSocket=t}get useSecureWebSocket(){ +return this.opts.useSecureWebSocket??_.useSecureWebSocket}set useSecureWebSocket(t){this.opts.useSecureWebSocket= +t}static get forceDisablePgSSL(){return _.opts.forceDisablePgSSL??_.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){ +_.opts.forceDisablePgSSL=t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??_.forceDisablePgSSL}set forceDisablePgSSL(t){ +this.opts.forceDisablePgSSL=t}static get disableSNI(){return _.opts.disableSNI??_.defaults.disableSNI}static set disableSNI(t){ +_.opts.disableSNI=t}get disableSNI(){return this.opts.disableSNI??_.disableSNI}set disableSNI(t){this. +opts.disableSNI=t}static get disableWarningInBrowsers(){return _.opts.disableWarningInBrowsers??_.defaults. +disableWarningInBrowsers}static set disableWarningInBrowsers(t){_.opts.disableWarningInBrowsers=t}get disableWarningInBrowsers(){ +return this.opts.disableWarningInBrowsers??_.disableWarningInBrowsers}set disableWarningInBrowsers(t){ +this.opts.disableWarningInBrowsers=t}static get pipelineConnect(){return _.opts.pipelineConnect??_.defaults. +pipelineConnect}static set pipelineConnect(t){_.opts.pipelineConnect=t}get pipelineConnect(){return this. +opts.pipelineConnect??_.pipelineConnect}set pipelineConnect(t){this.opts.pipelineConnect=t}static get subtls(){ +return _.opts.subtls??_.defaults.subtls}static set subtls(t){_.opts.subtls=t}get subtls(){return this. +opts.subtls??_.subtls}set subtls(t){this.opts.subtls=t}static get pipelineTLS(){return _.opts.pipelineTLS?? +_.defaults.pipelineTLS}static set pipelineTLS(t){_.opts.pipelineTLS=t}get pipelineTLS(){return this. +opts.pipelineTLS??_.pipelineTLS}set pipelineTLS(t){this.opts.pipelineTLS=t}static get rootCerts(){return _. +opts.rootCerts??_.defaults.rootCerts}static set rootCerts(t){_.opts.rootCerts=t}get rootCerts(){return this. +opts.rootCerts??_.rootCerts}set rootCerts(t){this.opts.rootCerts=t}wsProxyAddrForHost(t,n){let i=this. wsProxy;if(i===void 0)throw new Error("No WebSocket proxy is configured. Please see https://github.c\ om/neondatabase/serverless/blob/main/CONFIG.md#wsproxy-string--host-string-port-number--string--stri\ ng");return typeof i=="function"?i(t,n):`${i}?address=${t}:${n}`}setNoDelay(){return this}setKeepAlive(){ return this}ref(){return this}unref(){return this}connect(t,n,i){this.connecting=!0,i&&this.once("co\ nnect",i);let s=a(()=>{this.connecting=!1,this.pending=!1,this.emit("connect"),this.emit("ready")},"\ handleWebSocketOpen"),o=a((c,l=!1)=>{c.binaryType="arraybuffer",c.addEventListener("error",f=>{this. -emit("error",f),this.emit("close")}),c.addEventListener("message",f=>{if(this.tlsState===0){let y=d. +emit("error",f),this.emit("close")}),c.addEventListener("message",f=>{if(this.tlsState===0){let y=m. from(f.data);this.emit("data",y)}}),c.addEventListener("close",()=>{this.emit("close")}),l?s():c.addEventListener( "open",s)},"configureWebSocket"),u;try{u=this.wsProxyAddrForHost(n,typeof t=="string"?parseInt(t,10): t)}catch(c){this.emit("error",c),this.emit("close");return}try{let l=(this.useSecureWebSocket?"wss:": @@ -415,164 +415,164 @@ subtls.TrustedCert.databaseFromPEM(this.rootCerts),i=new this.subtls.WebSocketRe read.bind(i),o=this.rawWrite.bind(this),{read:u,write:c}=await this.subtls.startTls(t,n,s,o,{useSNI:!this. disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead=u,this.tlsWrite= c,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){ -for(;;){let t=await this.tlsRead();if(t===void 0)break;{let n=d.from(t);this.emit("data",n)}}}rawWrite(t){ +for(;;){let t=await this.tlsRead();if(t===void 0)break;{let n=m.from(t);this.emit("data",n)}}}rawWrite(t){ if(!this.coalesceWrites){this.ws&&this.ws.send(t);return}if(this.writeBuffer===void 0)this.writeBuffer= t,setTimeout(()=>{this.ws&&this.ws.send(this.writeBuffer),this.writeBuffer=void 0},0);else{let n=new Uint8Array( this.writeBuffer.length+t.length);n.set(this.writeBuffer),n.set(t,this.writeBuffer.length),this.writeBuffer= -n}}write(t,n="utf8",i=s=>{}){return t.length===0?(i(),!0):(typeof t=="string"&&(t=d.from(t,n)),this. +n}}write(t,n="utf8",i=s=>{}){return t.length===0?(i(),!0):(typeof t=="string"&&(t=m.from(t,n)),this. 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, +n,i)}):(this.tlsWrite(t),i()),!0)}end(t=m.alloc(0),n="utf8",i=()=>{}){return this.write(t,n,()=>{this. +ws.close(),i()}),this}destroy(){return this.destroyed=!0,this.end()}};a(_,"Socket"),I(_,"defaults",{ +poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{let s;return i?.jwtAuth?s=t.replace(is,"apiauth."):s= +t.replace(is,"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}),I(_,"opts",{});be=_});var as={};he(as,{parse:()=>Ir});function Ir(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(){ +n);s=decodeURIComponent(s),i=decodeURIComponent(i),l=decodeURIComponent(l);let E=i+":"+s,C=e?Object. +fromEntries(y.entries()):f;return{href:r,protocol:t,auth:E,username:i,password:s,host:o,hostname:u,port:c, +pathname:l,search:f,query:C,hash:g}}var Tr=re(()=>{"use strict";p();a(Ir,"parse")});var Hr=R(Cs=>{"use strict";p();Cs.parse=function(r,e){return new Wr(r,e).parse()};var Kt=class Kt{constructor(e,t){ +this.source=e,this.transform=t||qu,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 Kt(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(Kt,"ArrayParser");var Wr=Kt;function qu(r){return r}a(qu,"ide\ +ntity")});var $r=R((vh,Is)=>{p();var Qu=Hr();Is.exports={create:a(function(r,e){return{parse:a(function(){return Qu. +parse(r,e)},"parse")}},"create")}});var Rs=R((_h,Ps)=>{"use strict";p();var ju=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, +Wu=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Hu=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,$u=/^-?infinity$/;Ps. +exports=a(function(e){if($u.test(e))return Number(e.replace("i","I"));var t=ju.exec(e);if(!t)return Gu( +e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Ts(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=Vu(e);return g!=null? +(y=new Date(Date.UTC(i,s,o,u,c,l,f)),Gr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= +new Date(i,s,o,u,c,l,f),Gr(i)&&y.setFullYear(i)),y},"parseDate");function Gu(r){var e=Wu.exec(r);if(e){ +var t=parseInt(e[1],10),n=!!e[4];n&&(t=Ts(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return Gr( +t)&&o.setFullYear(t),o}}a(Gu,"getDate");function Vu(r){if(r.endsWith("+00"))return 0;var e=Hu.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(Vu,"timeZoneOffset");function Ts(r){return-(r- +1)}a(Ts,"bcYearToNegativeYear");function Gr(r){return r>=0&&r<100}a(Gr,"is0To99")});var Ls=R((Th,Bs)=>{p();Bs.exports=zu;var Ku=Object.prototype.hasOwnProperty;function zu(r){for(var e=1;e< +arguments.length;e++){var t=arguments[e];for(var n in t)Ku.call(t,n)&&(r[n]=t[n])}return r}a(zu,"ext\ +end")});var Ms=R((Bh,Fs)=>{"use strict";p();var Yu=Ls();Fs.exports=tt;function tt(r){if(!(this instanceof tt)) +return new tt(r);Yu(this,uc(r))}a(tt,"PostgresInterval");var Ju=["seconds","minutes","hours","days", +"months","years"];tt.prototype.toPostgres=function(){var r=Ju.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 Zu={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ +S"},Xu=["years","months","days"],ec=["hours","minutes","seconds"];tt.prototype.toISOString=tt.prototype. +toISO=function(){var r=Xu.map(t,this).join(""),e=ec.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+Zu[n]}};var Vr="([+-]?\\d+)",tc=Vr+"\\s+years?",rc=Vr+"\\s+mons?",nc=Vr+"\\s+days?",ic="\ +([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",sc=new RegExp([tc,rc,nc,ic].map(function(r){return"\ +("+r+")?"}).join("\\s*")),ks={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, +oc=["hours","minutes","seconds","milliseconds"];function ac(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(ac,"parseMilliseconds");function uc(r){if(!r)return{};var e=sc.exec(r),t=e[8]==="-";return Object. +keys(ks).reduce(function(n,i){var s=ks[i],o=e[s];return!o||(o=i==="milliseconds"?ac(o):parseInt(o,10), +!o)||(t&&~oc.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(uc,"parse")});var Ds=R((Fh,Us)=>{"use strict";p();Us.exports=a(function(e){if(/^\\x/.test(e))return new m(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( +"\\";)i++;for(var s=0;s{p();var bt=Hr(),xt=$r(),zt=Rs(),Ns=Ms(),qs=Ds();function Yt(r){return a(function(t){ +return t===null?t:r(t)},"nullAllowed")}a(Yt,"allowNull");function Qs(r){return r===null?r:r==="TRUE"|| +r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(Qs,"parseBool");function cc(r){return r? +bt.parse(r,Qs):null}a(cc,"parseBoolArray");function lc(r){return parseInt(r,10)}a(lc,"parseBaseTenIn\ +t");function Kr(r){return r?bt.parse(r,Yt(lc)):null}a(Kr,"parseIntegerArray");function fc(r){return r? +bt.parse(r,Yt(function(e){return js(e).trim()})):null}a(fc,"parseBigIntegerArray");var hc=a(function(r){ +if(!r)return null;var e=xt.create(r,function(t){return t!==null&&(t=Zr(t)),t});return e.parse()},"pa\ +rsePointArray"),zr=a(function(r){if(!r)return null;var e=xt.create(r,function(t){return t!==null&&(t= +parseFloat(t)),t});return e.parse()},"parseFloatArray"),me=a(function(r){if(!r)return null;var e=xt. +create(r);return e.parse()},"parseStringArray"),Yr=a(function(r){if(!r)return null;var e=xt.create(r, +function(t){return t!==null&&(t=zt(t)),t});return e.parse()},"parseDateArray"),dc=a(function(r){if(!r) +return null;var e=xt.create(r,function(t){return t!==null&&(t=Ns(t)),t});return e.parse()},"parseInt\ +ervalArray"),pc=a(function(r){return r?bt.parse(r,Yt(qs)):null},"parseByteAArray"),Jr=a(function(r){ +return parseInt(r,10)},"parseInteger"),js=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ +parseBigInteger"),Os=a(function(r){return r?bt.parse(r,Yt(JSON.parse)):null},"parseJsonArray"),Zr=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"),yc=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* -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{"use strict";p();var se=1e6;function wc(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%se,e=e/se>>>0,o=4294967296* +s+t,t=o/se>>>0,u=""+(o-se*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/se>>>0,u=""+(o-se*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/se>>>0,u=""+(o- +se*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var gc=Gs(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,H){return E* +Math.pow(2,H)+C};var s=t>>3,o=a(function(E){return n?~E&255:E},"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. -pow(1e4,L(r,16,16)),n=0,i=[],s=L(r,16),o=0;o0&&(l=i(l,o(r[f])>>8-g,g)),l},"parseBits"),zs=a(function(r,e,t){var n=Math. +pow(2,t-1)-1,i=U(r,1),s=U(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=U(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"),bc=a(function(r){ +return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),Vs=a(function(r){return U(r,1)==1?-1*(U( +r,31,1,!0)+1):U(r,31,1)},"parseInt32"),xc=a(function(r){return zs(r,23,8)},"parseFloat32"),Sc=a(function(r){ +return zs(r,52,11)},"parseFloat64"),vc=a(function(r){var e=U(r,16,32);if(e==49152)return NaN;for(var t=Math. +pow(1e4,U(r,16,16)),n=0,i=[],s=U(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, +t implemented: "+l)},"parseElement"),c=a(function(l,f){var y=[],g;if(l.length>1){var E=l.shift();for(g= +0;g0},"parseBool"),_c=a(function(r){r(20,gc),r(21,bc),r(23,Vs),r(26,Vs),r(1700,vc),r(700,xc), +r(701,Sc),r(16,Ac),r(1114,Ks.bind(null,!1)),r(1184,Ks.bind(null,!0)),r(1e3,St),r(1007,St),r(1016,St), +r(1008,St),r(1009,St),r(25,Ec)},"init");Ys.exports={init:_c}});var Xs=R((Gh,Zs)=>{p();Zs.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 At=R(Et=>{p();var Cc=Hs(),Ic=Js(),Tc=$r(),Pc=Xs();Et.getTypeParser=Rc;Et.setTypeParser=Bc;Et.arrayParser= +Tc;Et.builtins=Pc;var vt={text:{},binary:{}};function eo(r){return String(r)}a(eo,"noParse");function Rc(r,e){ +return e=e||"text",vt[e]&&vt[e][r]||eo}a(Rc,"getTypeParser");function Bc(r,e,t){typeof e=="function"&& +(t=e,e="text"),vt[e][r]=t}a(Bc,"setTypeParser");Cc.init(function(r,e){vt.text[r]=e});Ic.init(function(r,e){ +vt.binary[r]=e})});var Zt=R((Jh,to)=>{"use strict";p();var Lc=At();function Jt(r){this._types=r||Lc,this.text={},this.binary= +{}}a(Jt,"TypeOverrides");Jt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ +binary":return this.binary;default:return{}}};Jt.prototype.setTypeParser=function(r,e,t){typeof e=="\ +function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Jt.prototype.getTypeParser=function(r,e){return e= +e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};to.exports=Jt});function _t(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, 3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700, 1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909, 275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222, -2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=a((I,w)=>I>>>w|I<<32- -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, -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& -255,C[f++]=I/4294967296&255,C[f++]=I>>>24,C[f++]=I>>>16&255,C[f++]=I>>>8&255,C[f++]=I&255,D();let w=new Uint8Array( -32);return w[0]=e>>>24,w[1]=e>>>16&255,w[2]=e>>>8&255,w[3]=e&255,w[4]=t>>>24,w[5]=t>>>16&255,w[6]=t>>> -8&255,w[7]=t&255,w[8]=n>>>24,w[9]=n>>>16&255,w[10]=n>>>8&255,w[11]=n&255,w[12]=i>>>24,w[13]=i>>>16&255, -w[14]=i>>>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\ -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. +2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=a((T,b)=>T>>>b|T<<32- +b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),H=a(()=>{for(let M=0,Z=0;M<16;M++,Z+=4)E[M]=C[Z]<< +24|C[Z+1]<<16|C[Z+2]<<8|C[Z+3];for(let M=16;M<64;M++){let Z=g(E[M-15],7)^g(E[M-15],18)^E[M-15]>>>3,Ee=g( +E[M-2],17)^g(E[M-2],19)^E[M-2]>>>10;E[M]=E[M-16]+Z+E[M-7]+Ee|0}let T=e,b=t,k=n,ae=i,$=s,Ie=o,fe=u,ue=c; +for(let M=0;M<64;M++){let Z=g($,6)^g($,11)^g($,25),Ee=$&Ie^~$&fe,Te=ue+Z+Ee+y[M]+E[M]|0,Fe=g(T,2)^g( +T,13)^g(T,22),Me=T&b^T&k^b&k,lt=Fe+Me|0;ue=fe,fe=Ie,Ie=$,$=ae+Te|0,ae=k,k=b,b=T,T=Te+lt|0}e=e+T|0,t= +t+b|0,n=n+k|0,i=i+ae|0,s=s+$|0,o=o+Ie|0,u=u+fe|0,c=c+ue|0,f=0},"process"),J=a(T=>{typeof T=="string"&& +(T=new TextEncoder().encode(T));for(let b=0;b{if(C[f++]=128,f==64&&H(),f+8>64){for(;f<64;)C[f++]=0;H()}for(;f<58;)C[f++]=0;let T=l*8;C[f++]= +T/1099511627776&255,C[f++]=T/4294967296&255,C[f++]=T>>>24,C[f++]=T>>>16&255,C[f++]=T>>>8&255,C[f++]= +T&255,H();let b=new Uint8Array(32);return b[0]=e>>>24,b[1]=e>>>16&255,b[2]=e>>>8&255,b[3]=e&255,b[4]= +t>>>24,b[5]=t>>>16&255,b[6]=t>>>8&255,b[7]=t&255,b[8]=n>>>24,b[9]=n>>>16&255,b[10]=n>>>8&255,b[11]=n& +255,b[12]=i>>>24,b[13]=i>>>16&255,b[14]=i>>>8&255,b[15]=i&255,b[16]=s>>>24,b[17]=s>>>16&255,b[18]=s>>> +8&255,b[19]=s&255,b[20]=o>>>24,b[21]=o>>>16&255,b[22]=o>>>8&255,b[23]=o&255,b[24]=u>>>24,b[25]=u>>>16& +255,b[26]=u>>>8&255,b[27]=u&255,b[28]=c>>>24,b[29]=c>>>16&255,b[30]=c>>>8&255,b[31]=c&255,b},"digest"); +return r===void 0?{add:J,digest:ge}:(J(r),ge())}var ro=re(()=>{"use strict";p();a(_t,"sha256")});var Q,Ct,no=re(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ +Length",0);I(this,"_state",new Int32Array(4));I(this,"_buffer",new ArrayBuffer(68));I(this,"_buffer8"); +I(this,"_buffer32");this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this. _buffer,0,17),this.start()}static hashByteArray(e,t=!1){return this.onePassHasher.start().appendByteArray( e).end(t)}static hashStr(e,t=!1){return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){ -return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){let t=U.hexChars,n=U.hexOut, +return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){let t=Q.hexChars,n=Q.hexOut, i,s,o,u;for(u=0;u<4;u+=1)for(s=u*8,i=e[u],o=0;o<8;o+=2)n[s+1+o]=t.charAt(i&15),i>>>=4,n[s+0+o]=t.charAt( i&15),i>>>=4;return n.join("")}static _md5cycle(e,t){let n=e[0],i=e[1],s=e[2],o=e[3];n+=(i&s|~i&o)+t[0]- 680876936|0,n=(n<<7|n>>>25)+i|0,o+=(n&i|~n&s)+t[1]-389564586|0,o=(o<<12|o>>>20)+n|0,s+=(o&n|~o&i)+t[2]+ @@ -608,147 +608,147 @@ o>>>22)+n|0,s+=(n^(o|~i))+t[10]-1051523|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~n))+t[1 0,i=(i<<21|i>>>11)+s|0,n+=(s^(i|~o))+t[4]-145523070|0,n=(n<<6|n>>>26)+i|0,o+=(i^(n|~s))+t[11]-1120210379| 0,o=(o<<10|o>>>22)+n|0,s+=(n^(o|~i))+t[2]+718787259|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~n))+t[9]-343485551| 0,i=(i<<21|i>>>11)+s|0,e[0]=n+e[0]|0,e[1]=i+e[1]|0,e[2]=s+e[2]|0,e[3]=o+e[3]|0}start(){return this._dataLength= -0,this._bufferLength=0,this._state.set(U.stateIdentity),this}appendStr(e){let t=this._buffer8,n=this. +0,this._bufferLength=0,this._state.set(Q.stateIdentity),this}appendStr(e){let t=this._buffer8,n=this. _buffer32,i=this._bufferLength,s,o;for(o=0;o>>6)+192,t[i++]=s&63|128;else if(s<55296||s>56319)t[i++]=(s>>>12)+224,t[i++]=s>>>6&63| 128,t[i++]=s&63|128;else{if(s=(s-55296)*1024+(e.charCodeAt(++o)-56320)+65536,s>1114111)throw new Error( "Unicode standard supports code points up to U+10FFFF");t[i++]=(s>>>18)+240,t[i++]=s>>>12&63|128,t[i++]= -s>>>6&63|128,t[i++]=s&63|128}i>=64&&(this._dataLength+=64,U._md5cycle(this._state,n),i-=64,n[0]=n[16])} +s>>>6&63|128,t[i++]=s&63|128}i>=64&&(this._dataLength+=64,Q._md5cycle(this._state,n),i-=64,n[0]=n[16])} return this._bufferLength=i,this}appendAsciiStr(e){let t=this._buffer8,n=this._buffer32,i=this._bufferLength, s,o=0;for(;;){for(s=Math.min(e.length-o,64-i);s--;)t[i++]=e.charCodeAt(o++);if(i<64)break;this._dataLength+= -64,U._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}appendByteArray(e){let t=this._buffer8, +64,Q._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}appendByteArray(e){let t=this._buffer8, n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(e.length-o,64-i);s--;)t[i++]=e[o++]; -if(i<64)break;this._dataLength+=64,U._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}getState(){ +if(i<64)break;this._dataLength+=64,Q._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}getState(){ let e=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this. _bufferLength,length:this._dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){let t=e.buffer,n=e.state, i=this._state,s;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=n[0],i[1]=n[1],i[2]=n[2], i[3]=n[3],s=0;s>2)+1;this._dataLength+=t;let o=this._dataLength*8;if(n[t]=128,n[t+1]= -n[t+2]=n[t+3]=0,i.set(U.buffer32Identity.subarray(s),s),t>55&&(U._md5cycle(this._state,i),i.set(U.buffer32Identity)), +n[t+2]=n[t+3]=0,i.set(Q.buffer32Identity.subarray(s),s),t>55&&(Q._md5cycle(this._state,i),i.set(Q.buffer32Identity)), o<=4294967295)i[14]=o;else{let u=o.toString(16).match(/(.*?)(.{0,8})$/);if(u===null)return;let c=parseInt( -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(`\ +u[2],16),l=parseInt(u[1],16)||0;i[14]=c,i[15]=l}return Q._md5cycle(this._state,i),e?this._state:Q._hex( +this._state)}};a(Q,"Md5"),I(Q,"stateIdentity",new Int32Array([1732584193,-271733879,-1732584194,271733878])), +I(Q,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),I(Q,"hexChars","0123456789\ +abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);Ct=Q});var Xr={};he(Xr,{createHash:()=>Fc,createHmac:()=>Mc,randomBytes:()=>kc});function kc(r){return crypto. +getRandomValues(m.alloc(r))}function Fc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( +function(){return m.from(_t(e))},"digest")}},"update")};if(r==="md5")return{update:a(function(e){return{ +digest:a(function(){return typeof e=="string"?Ct.hashStr(e):Ct.hashByteArray(e)},"digest")}},"update")}; +throw new Error(`Hash type '${r}' not supported`)}function Mc(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=_t(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: -m.env.USER,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4, +64);o.set(i,0),o.set(t,64);let u=new Uint8Array(96);return u.set(s,0),u.set(_t(o),64),m.from(_t(u))}, +"digest")}},"update")}}var en=re(()=>{"use strict";p();ro();no();a(kc,"randomBytes");a(Fc,"createHas\ +h");a(Mc,"createHmac")});var It=R((ld,tn)=>{"use strict";p();tn.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: +w.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 rt=At(),Uc=rt.getTypeParser(20,"text"),Dc=rt.getTypeParser(1016, +"text");tn.exports.__defineSetter__("parseInt8",function(r){rt.setTypeParser(20,"text",r?rt.getTypeParser( +23,"text"):Uc),rt.setTypeParser(1016,"text",r?rt.getTypeParser(1007,"text"):Dc)})});var Tt=R((hd,so)=>{"use strict";p();var Oc=(en(),j(Xr)),Nc=It();function qc(r){var e=r.replace(/\\/g, +"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(qc,"escapeElement");function io(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+io(r[t]): +r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=qc(Xt(r[t]));return e=e+"}",e}a(io,"arrayString"); +var Xt=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. 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?Nc.parseInputDatesAsUTC?Wc(r):jc(r):Array.isArray(r)?io(r):typeof r== +"object"?Qc(r,e):r.toString()},"prepareValue");function Qc(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(Hc,"normalizeQueryConfig");var rn=a(function(r){return Oc.createHash("md5").update(r,"utf-8"). +digest("hex")},"md5"),$c=a(function(r,e,t){var n=rn(e+r),i=rn(m.concat([m.from(n),t]));return"md5"+i}, +"postgresMd5PasswordHash");so.exports={prepareValue:a(function(e){return Xt(e)},"prepareValueWrapper"), +normalizeQueryConfig:Hc,postgresMd5PasswordHash:$c,md5:rn}});var Pt={};he(Pt,{default:()=>Jc});var Jc,Rt=re(()=>{"use strict";p();Jc={}});var wo=R((Cd,mo)=>{"use strict";p();var on=(en(),j(Xr));function Zc(r){if(r.indexOf("SCRAM-SHA-256")=== +-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=on.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(Zc,"startSession");function Xc(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=rl(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=m.from(n.salt,"base64"),s=sl(e,i,n.iteration),o=nt(s,"Client Key"),u=il( 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=nt(u,y),E=yo(o,g),C=E.toString("base64"),H=nt(s,"Server Key"),J=nt(H,y);r.message="SAS\ +LResponse",r.serverSignature=J.toString("base64"),r.response=f+",p="+C}a(Xc,"continueSession");function el(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}=nl( 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(el,"finalizeSession");function tl(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(tl,"isPrintableChars");function ho(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(r)}a(ho,"isBase64");function po(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(po,"parseAttribute\ +Pairs");function rl(r){let e=po(r),t=e.get("r");if(t){if(!tl(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(!ho(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(rl,"parseServerFirstMessage"); +function nl(r){let t=po(r).get("v");if(t){if(!ho(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. -isBuffer(r))throw new TypeError("first argument must be a Buffer");if(!d.isBuffer(e))throw new TypeError( +signature is missing");return{serverSignature:t}}a(nl,"parseServerFinalMessage");function yo(r,e){if(!m. +isBuffer(r))throw new TypeError("first argument must be a Buffer");if(!m.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){ -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;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 +h");if(r.length===0)throw new Error("Buffers cannot be empty");return m.from(r.map((t,n)=>r[n]^e[n]))} +a(yo,"xorBuffers");function il(r){return on.createHash("sha256").update(r).digest()}a(il,"sha256");function nt(r,e){ +return on.createHmac("sha256",r).update(e).digest()}a(nt,"hmacSha256");function sl(r,e,t){for(var n=nt( +r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sol});function ol(...r){return r.join("/")}var un=re(()=>{"use strict";p(); +a(ol,"join")});var cn={};he(cn,{stat:()=>al});function al(r,e){e(new Error("No filesystem"))}var ln=re(()=>{"use st\ +rict";p();a(al,"stat")});var fn={};he(fn,{default:()=>ul});var ul,hn=re(()=>{"use strict";p();ul={}});var go={};he(go,{StringDecoder:()=>dn});var pn,dn,bo=re(()=>{"use strict";p();pn=class pn{constructor(e){ +I(this,"td");this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this. +td.decode(e)}};a(pn,"StringDecoder");dn=pn});var Eo=R((Ud,vo)=>{"use strict";p();var{Transform:cl}=(hn(),j(fn)),{StringDecoder:ll}=(bo(),j(go)),Le=Symbol( +"last"),tr=Symbol("decoder");function fl(r,e,t){let n;if(this.overflow){if(n=this[tr].write(r).split( +this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Le]+=this[tr].write(r),n= +this[Le].split(this.matcher);this[Le]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( +"maximum buffer reached"));return}t()}a(fl,"transform");function hl(r){if(this[Le]+=this[tr].end(),this[Le]) +try{So(this,this.mapper(this[Le]))}catch(e){return r(e)}r()}a(hl,"flush");function So(r,e){e!==void 0&& +r.push(e)}a(So,"push");function xo(r){return r}a(xo,"noop");function dl(r,e,t){switch(r=r||/\r?\n/,e= +e||xo,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=xo)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=fl,t.flush=hl,t.readableObjectMode= +!0;let n=new cl(t);return n[Le]="",n[tr]=new ll("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( -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= +!1,s(i)},n}a(dl,"split");vo.exports=dl});var Co=R((Nd,Ce)=>{"use strict";p();var Ao=(un(),j(an)),pl=(hn(),j(fn)).Stream,yl=Eo(),_o=(Rt(),j(Pt)), +ml=5432,rr=w.platform==="win32",Bt=w.stderr,wl=56,gl=7,bl=61440,xl=32768;function Sl(r){return(r&bl)== +xl}a(Sl,"isRegFile");var it=["host","port","database","user","password"],yn=it.length,vl=it[yn-1];function mn(){ +var r=Bt instanceof pl&&Bt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +`);Bt.write(_o.format.apply(_o,e))}}a(mn,"warn");Object.defineProperty(Ce.exports,"isWin",{get:a(function(){ +return rr},"get"),set:a(function(r){rr=r},"set")});Ce.exports.warnTo=function(r){var e=Bt;return Bt= +r,e};Ce.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(rr?Ao.join(e.APPDATA||"./","\ +postgresql","pgpass.conf"):Ao.join(e.HOME||"./",".pgpass"));return t};Ce.exports.usePgPass=function(r,e){ +return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:rr?!0:(e=e||"",Sl(r.mode)?r. +mode&(wl|gl)?(mn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ +(0600) or less',e),!1):!0:(mn('WARNING: password file "%s" is not a plain file',e),!1))};var El=Ce.exports. +match=function(r,e){return it.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||ml)===Number( +e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};Ce.exports.getPassword=function(r,e,t){var n,i=e.pipe( +yl());function s(c){var l=Al(c);l&&_l(l)&&El(r,l)&&(n=l[vl],i.end())}a(s,"onLine");var o=a(function(){ +e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),mn("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 Al=Ce.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> +function(f,y,g){var E=r.substring(y,g);Object.hasOwnProperty.call(w.env,"PGPASS_NO_DEESCAPE")||(E=E. +replace(/\\([:\\])/g,"$1")),o[it[f]]=E},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). +length===yn?o:null,o},_l=Ce.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 jd=(un(),j(an)),Io=(ln(),j(cn)),nr=Co();wn.exports=function(r,e){ +var t=nr.getFileName();Io.stat(t,function(n,i){if(n||!nr.usePgPass(i,t))return e(void 0);var s=Io.createReadStream( +t);nr.getPassword(r,s,e)})};wn.exports.warnTo=nr.warnTo});var Po={};he(Po,{default:()=>Cl});var Cl,Ro=re(()=>{"use strict";p();Cl={}});var Lo=R((Gd,Bo)=>{"use strict";p();var Il=(Tr(),j(as)),gn=(ln(),j(cn));function bn(r){if(r.charAt(0)=== +"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Il.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,54 +756,54 @@ 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=gn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=gn.readFileSync(t.sslkey).toString()), +t.sslrootcert&&(t.ssl.ca=gn.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(bn,"parse");Bo.exports=bn;bn.parse=bn});var ir=R((zd,Mo)=>{"use strict";p();var Tl=(Ro(),j(Po)),Fo=It(),ko=Lo().parse,te=a(function(r,e,t){return t=== +void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Fo[r]},"val"),Pl=a(function(){switch(w. 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){ -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. -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"&& -(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= -H("fallback_application_name",e,!1),this.statement_timeout=H("statement_timeout",e,!1),this.lock_timeout= -H("lock_timeout",e,!1),this.idle_in_transaction_session_timeout=H("idle_in_transaction_session_timeo\ -ut",e,!1),this.query_timeout=H("query_timeout",e,!1),e.connectionTimeoutMillis===void 0?this.connect_timeout= -m.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/1e3),e.keepAlive=== -!1?this.keepalives=0:e.keepAlive===!0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis=="nu\ -mber"&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){ -var t=[];ie(t,this,"user"),ie(t,this,"password"),ie(t,this,"port"),ie(t,this,"application_name"),ie( -t,this,"fallback_application_name"),ie(t,this,"connect_timeout"),ie(t,this,"options");var n=typeof this. -ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(ie(t,n,"sslmode"),ie(t,n,"sslca"),ie(t,n,"s\ -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){ +no-verify":return{rejectUnauthorized:!1}}return Fo.ssl},"readSSLConfigFromEnvironment"),st=a(function(r){ +return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),we=a(function(r,e,t){ +var n=e[t];n!=null&&r.push(t+"="+st(n))},"add"),Sn=class Sn{constructor(e){e=typeof e=="string"?ko(e): +e||{},e.connectionString&&(e=Object.assign({},e,ko(e.connectionString))),this.user=te("user",e),this. +database=te("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(te("p\ +ort",e),10),this.host=te("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, +writable:!0,value:te("password",e)}),this.binary=te("binary",e),this.options=te("options",e),this.ssl= +typeof e.ssl>"u"?Pl():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=te("client_encoding",e),this.replication=te("replication", +e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=te("application_name",e,"\ +PGAPPNAME"),this.fallback_application_name=te("fallback_application_name",e,!1),this.statement_timeout= +te("statement_timeout",e,!1),this.lock_timeout=te("lock_timeout",e,!1),this.idle_in_transaction_session_timeout= +te("idle_in_transaction_session_timeout",e,!1),this.query_timeout=te("query_timeout",e,!1),e.connectionTimeoutMillis=== +void 0?this.connect_timeout=w.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/ +1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive===!0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis== +"number"&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){ +var t=[];we(t,this,"user"),we(t,this,"password"),we(t,this,"port"),we(t,this,"application_name"),we( +t,this,"fallback_application_name"),we(t,this,"connect_timeout"),we(t,this,"options");var n=typeof this. +ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(we(t,n,"sslmode"),we(t,n,"sslca"),we(t,n,"s\ +slkey"),we(t,n,"sslcert"),we(t,n,"sslrootcert"),this.database&&t.push("dbname="+st(this.database)),this. +replication&&t.push("replication="+st(this.replication)),this.host&&t.push("host="+st(this.host)),this. +isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+st(this.client_encoding)), +Tl.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+st(s)),e(null,t.join(" ")))})}}; +a(Sn,"ConnectionParameters");var xn=Sn;Mo.exports=xn});var Oo=R((Zd,Do)=>{"use strict";p();var Rl=At(),Uo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,En=class En{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=Uo.exec(e.text):t=Uo.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]=Rl.getTypeParser(n.dataTypeID,n. +format||"text")}}};a(En,"Result");var vn=En;Do.exports=vn});var jo=R((tp,Qo)=>{"use strict";p();var{EventEmitter:Bl}=Re(),No=Oo(),qo=Tt(),_n=class _n extends Bl{constructor(e,t,n){ +super(),e=qo.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= +this._rowMode=e.rowMode,w.domain&&e.callback&&(this.callback=w.domain.bind(e.callback)),this._result= +new No(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 No(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&& @@ -811,7 +811,7 @@ this._result.addRow(t)}}handleCommandComplete(e,t){this._checkForMultirow(),this e),this.rows&&t.sync()}handleEmptyQuery(e){this.rows&&e.sync()}handleError(e,t){if(this._canceledDueToError&& (e=this._canceledDueToError,this._canceledDueToError=!1),this.callback)return this.callback(e);this. emit("error",e)}handleReadyForQuery(e){if(this._canceledDueToError)return this.handleError(this._canceledDueToError, -e);if(this.callback)try{this.callback(null,this._results)}catch(t){m.nextTick(()=>{throw t})}this.emit( +e);if(this.callback)try{this.callback(null,this._results)}catch(t){w.nextTick(()=>{throw t})}this.emit( "end",this._results)}submit(e){if(typeof this.text!="string"&&typeof this.name!="string")return new Error( "A query must have either text or a name. Supplying neither is unsupported.");let t=e.parsedStatements[this. name];return this.text&&t&&this.text!==t?new Error(`Prepared statements must be unique - '${this.name}\ @@ -820,148 +820,148 @@ 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:qo.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= -_.CommandCompleteMessage=_.ReadyForQueryMessage=_.NotificationResponseMessage=_.BackendKeyDataMessage= -_.AuthenticationMD5Password=_.ParameterStatusMessage=_.ParameterDescriptionMessage=_.RowDescriptionMessage= -_.Field=_.CopyResponse=_.CopyDataMessage=_.DatabaseError=_.copyDone=_.emptyQuery=_.replicationStart= -_.portalSuspended=_.noData=_.closeComplete=_.bindComplete=_.parseComplete=void 0;_.parseComplete={name:"\ -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){ -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( +e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(_n,"Query");var An=_n;Qo.exports= +An});var ei=R(P=>{"use strict";p();Object.defineProperty(P,"__esModule",{value:!0});P.NoticeMessage=P.DataRowMessage= +P.CommandCompleteMessage=P.ReadyForQueryMessage=P.NotificationResponseMessage=P.BackendKeyDataMessage= +P.AuthenticationMD5Password=P.ParameterStatusMessage=P.ParameterDescriptionMessage=P.RowDescriptionMessage= +P.Field=P.CopyResponse=P.CopyDataMessage=P.DatabaseError=P.copyDone=P.emptyQuery=P.replicationStart= +P.portalSuspended=P.noData=P.closeComplete=P.bindComplete=P.parseComplete=void 0;P.parseComplete={name:"\ +parseComplete",length:5};P.bindComplete={name:"bindComplete",length:5};P.closeComplete={name:"closeC\ +omplete",length:5};P.noData={name:"noData",length:5};P.portalSuspended={name:"portalSuspended",length:5}; +P.replicationStart={name:"replicationStart",length:4};P.emptyQuery={name:"emptyQuery",length:4};P.copyDone= +{name:"copyDone",length:4};var qn=class qn extends Error{constructor(e,t,n){super(e),this.length=t,this. +name=n}};a(qn,"DatabaseError");var Cn=qn;P.DatabaseError=Cn;var Qn=class Qn{constructor(e,t){this.length= +e,this.chunk=t,this.name="copyData"}};a(Qn,"CopyDataMessage");var In=Qn;P.CopyDataMessage=In;var jn=class jn{constructor(e,t,n,i){ +this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(jn,"CopyResponse");var Tn=jn; +P.CopyResponse=Tn;var Wn=class Wn{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(Wn,"Field");var Pn=Wn; +P.Field=Pn;var Hn=class Hn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ +n",this.fields=new Array(this.fieldCount)}};a(Hn,"RowDescriptionMessage");var Rn=Hn;P.RowDescriptionMessage= +Rn;var $n=class $n{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ +ion",this.dataTypeIDs=new Array(this.parameterCount)}};a($n,"ParameterDescriptionMessage");var Bn=$n; +P.ParameterDescriptionMessage=Bn;var Gn=class Gn{constructor(e,t,n){this.length=e,this.parameterName= +t,this.parameterValue=n,this.name="parameterStatus"}};a(Gn,"ParameterStatusMessage");var Ln=Gn;P.ParameterStatusMessage= +Ln;var Vn=class Vn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; +a(Vn,"AuthenticationMD5Password");var kn=Vn;P.AuthenticationMD5Password=kn;var Kn=class Kn{constructor(e,t,n){ +this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Kn,"BackendKeyDataMes\ +sage");var Fn=Kn;P.BackendKeyDataMessage=Fn;var zn=class zn{constructor(e,t,n,i){this.length=e,this. +processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(zn,"NotificationResponseMessa\ +ge");var Mn=zn;P.NotificationResponseMessage=Mn;var Yn=class Yn{constructor(e,t){this.length=e,this. +status=t,this.name="readyForQuery"}};a(Yn,"ReadyForQueryMessage");var Un=Yn;P.ReadyForQueryMessage=Un; +var Jn=class Jn{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(Jn,"Comma\ +ndCompleteMessage");var Dn=Jn;P.CommandCompleteMessage=Dn;var Zn=class Zn{constructor(e,t){this.length= +e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(Zn,"DataRowMessage");var On=Zn;P.DataRowMessage= +On;var Xn=class Xn{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(Xn,"NoticeMe\ +ssage");var Nn=Xn;P.NoticeMessage=Nn});var Wo=R(sr=>{"use strict";p();Object.defineProperty(sr,"__esModule",{value:!0});sr.Writer=void 0;var ri=class ri{constructor(e=256){ +this.size=e,this.offset=5,this.headerPosition=0,this.buffer=m.allocUnsafe(e)}ensure(e){if(this.buffer. +length-this.offset>1)+e;this.buffer=m.allocUnsafe(i),n.copy( this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this. offset++]=e>>>16&255,this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addInt16(e){ return this.ensure(2),this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addCString(e){ -if(!e)this.ensure(1);else{let t=d.byteLength(e);this.ensure(t+1),this.buffer.write(e,this.offset,"ut\ -f-8"),this.offset+=t}return this.buffer[this.offset++]=0,this}addString(e=""){let t=d.byteLength(e); +if(!e)this.ensure(1);else{let t=m.byteLength(e);this.ensure(t+1),this.buffer.write(e,this.offset,"ut\ +f-8"),this.offset+=t}return this.buffer[this.offset++]=0,this}addString(e=""){let t=m.byteLength(e); return this.ensure(t),this.buffer.write(e,this.offset),this.offset+=t,this}add(e){return this.ensure( 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( -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|| +headerPosition=0,this.buffer=m.allocUnsafe(this.size),t}};a(ri,"Writer");var ti=ri;sr.Writer=ti});var $o=R(ar=>{"use strict";p();Object.defineProperty(ar,"__esModule",{value:!0});ar.serialize=void 0; +var ni=Wo(),D=new ni.Writer,Ll=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( +n).addCString(r[n]);D.addCString("client_encoding").addCString("UTF8");let e=D.addCString("").flush(), +t=e.length+4;return new ni.Writer().addInt32(t).add(e).flush()},"startup"),kl=a(()=>{let r=m.allocUnsafe( +8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Fl=a(r=>D.addCString(r).flush( +112),"password"),Ml=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. +flush(112)},"sendSASLInitialResponseMessage"),Ul=a(function(r){return D.addString(r).flush(112)},"se\ +ndSCRAMClientFinalMessage"),Dl=a(r=>D.addCString(r).flush(81),"query"),Ho=[],Ol=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< -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( -(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. +xecuting queries"));let t=r.types||Ho,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< +n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),ot=new ni.Writer,Nl=a(function(r,e){for(let t=0;t< +r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),ot.addInt32(-1)):n instanceof m?(D.addInt16( +1),ot.addInt32(n.length),ot.add(n)):(D.addInt16(0),ot.addInt32(m.byteLength(n)),ot.addString(n))}},"\ +writeValues"),ql=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Ho,s=i.length; +return D.addCString(e).addCString(t),D.addInt16(s),Nl(i,r.valueMapper),D.addInt16(s),D.add(ot.flush()), +D.addInt16(n?1:0),D.flush(66)},"bind"),Ql=m.from([69,0,0,0,9,0,0,0,0,0]),jl=a(r=>{if(!r||!r.portal&& +!r.rows)return Ql;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Wl=a( +(r,e)=>{let t=m.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"),ii=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. 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\ +Hl=D.addCString("P").flush(68),$l=D.addCString("S").flush(68),Gl=a(r=>r.name?ii(68,`${r.type}${r.name|| +""}`):r.type==="P"?Hl:$l,"describe"),Vl=a(r=>{let e=`${r.type}${r.name||""}`;return ii(67,e)},"close"), +Kl=a(r=>D.add(r).flush(100),"copyData"),zl=a(r=>ii(102,r),"copyFail"),or=a(r=>m.from([r,0,0,0,4]),"c\ +odeOnlyBuffer"),Yl=or(72),Jl=or(83),Zl=or(88),Xl=or(99),ef={startup:Ll,password:Fl,requestSsl:kl,sendSASLInitialResponseMessage:Ml, +sendSCRAMClientFinalMessage:Ul,query:Dl,parse:Ol,bind:ql,execute:jl,describe:Gl,close:Vl,flush:a(()=>Yl, +"flush"),sync:a(()=>Jl,"sync"),end:a(()=>Zl,"end"),copyData:Kl,copyDone:a(()=>Xl,"copyDone"),copyFail:zl, +cancel:Wl};ar.serialize=ef});var Go=R(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.BufferReader=void 0; +var tf=m.allocUnsafe(0),oi=class oi{constructor(e=0){this.offset=e,this.buffer=tf,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(oi,"BufferReader");var si=oi;ur.BufferReader=si});var zo=R(cr=>{"use strict";p();Object.defineProperty(cr,"__esModule",{value:!0});cr.Parser=void 0;var O=ei(), +rf=Go(),ai=1,nf=4,Vo=ai+nf,Ko=m.allocUnsafe(0),ci=class ci{constructor(e){if(this.buffer=Ko,this.bufferLength= +0,this.bufferOffset=0,this.reader=new rf.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. -buffer=$s,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=n-i,this.bufferOffset=i)}mergeBuffer(e){ +this.bufferLength,i=this.bufferOffset;for(;i+Vo<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( +i+ai),u=ai+o;if(u+i<=n){let c=this.handlePacket(i+Vo,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. +buffer=Ko,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. -buffer.byteLength*2;for(;t>=s;)s*=2;i=d.allocUnsafe(s)}this.buffer.copy(i,0,this.bufferOffset,this.bufferOffset+ +buffer.byteLength*2;for(;t>=s;)s*=2;i=m.allocUnsafe(s)}this.buffer.copy(i,0,this.bufferOffset,this.bufferOffset+ this.bufferLength),this.buffer=i,this.bufferOffset=0}e.copy(this.buffer,this.bufferOffset+this.bufferLength), this.bufferLength=t}else this.buffer=e,this.bufferOffset=0,this.bufferLength=e.byteLength}handlePacket(e,t,n,i){ -switch(t){case 50:return k.bindComplete;case 49:return k.parseComplete;case 51:return k.closeComplete;case 110: -return k.noData;case 115:return k.portalSuspended;case 99:return k.copyDone;case 87:return k.replicationStart;case 73: -return k.emptyQuery;case 68:return this.parseDataRowMessage(e,n,i);case 67:return this.parseCommandCompleteMessage( +switch(t){case 50:return O.bindComplete;case 49:return O.parseComplete;case 51:return O.closeComplete;case 110: +return O.noData;case 115:return O.portalSuspended;case 99:return O.copyDone;case 87:return O.replicationStart;case 73: +return O.emptyQuery;case 68:return this.parseDataRowMessage(e,n,i);case 67:return this.parseCommandCompleteMessage( e,n,i);case 90:return this.parseReadyForQueryMessage(e,n,i);case 65:return this.parseNotificationMessage( e,n,i);case 82:return this.parseAuthenticationResponse(e,n,i);case 83:return this.parseParameterStatusMessage( e,n,i);case 75:return this.parseBackendKeyData(e,n,i);case 69:return this.parseErrorMessage(e,n,i,"e\ rror");case 78:return this.parseErrorMessage(e,n,i,"notice");case 84:return this.parseRowDescriptionMessage( e,n,i);case 116:return this.parseParameterDescriptionMessage(e,n,i);case 71:return this.parseCopyInMessage( e,n,i);case 72:return this.parseCopyOutMessage(e,n,i);case 100:return this.parseCopyData(e,n,i);default: -return new k.DatabaseError("received invalid response: "+t.toString(16),n,"error")}}parseReadyForQueryMessage(e,t,n){ -this.reader.setBuffer(e,n);let i=this.reader.string(1);return new k.ReadyForQueryMessage(t,i)}parseCommandCompleteMessage(e,t,n){ -this.reader.setBuffer(e,n);let i=this.reader.cstring();return new k.CommandCompleteMessage(t,i)}parseCopyData(e,t,n){ -let i=n.slice(e,e+(t-4));return new k.CopyDataMessage(t,i)}parseCopyInMessage(e,t,n){return this.parseCopyMessage( +return new O.DatabaseError("received invalid response: "+t.toString(16),n,"error")}}parseReadyForQueryMessage(e,t,n){ +this.reader.setBuffer(e,n);let i=this.reader.string(1);return new O.ReadyForQueryMessage(t,i)}parseCommandCompleteMessage(e,t,n){ +this.reader.setBuffer(e,n);let i=this.reader.cstring();return new O.CommandCompleteMessage(t,i)}parseCopyData(e,t,n){ +let i=n.slice(e,e+(t-4));return new O.CopyDataMessage(t,i)}parseCopyInMessage(e,t,n){return this.parseCopyMessage( e,t,n,"copyInResponse")}parseCopyOutMessage(e,t,n){return this.parseCopyMessage(e,t,n,"copyOutRespon\ se")}parseCopyMessage(e,t,n,i){this.reader.setBuffer(e,n);let s=this.reader.byte()!==0,o=this.reader. -int16(),u=new k.CopyResponse(t,i,s,o);for(let c=0;c{"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(ci,"Parser");var ui=ci;cr.Parser=ui});var li=R(ke=>{"use strict";p();Object.defineProperty(ke,"__esModule",{value:!0});ke.DatabaseError=ke. +serialize=ke.parse=void 0;var sf=ei();Object.defineProperty(ke,"DatabaseError",{enumerable:!0,get:a( +function(){return sf.DatabaseError},"get")});var of=$o();Object.defineProperty(ke,"serialize",{enumerable:!0, +get:a(function(){return of.serialize},"get")});var af=zo();function uf(r,e){let t=new af.Parser;return r. +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(uf,"parse");ke.parse=uf});var Yo={};he(Yo,{connect:()=>cf});function cf({socket:r,servername:e}){return r.startTls(e),r}var Jo=re( +()=>{"use strict";p();a(cf,"connect")});var di=R((Ap,ea)=>{"use strict";p();var Zo=(Ke(),j(os)),lf=Re().EventEmitter,{parse:ff,serialize:z}=li(), +Xo=z.flush(),hf=z.sync(),df=z.end(),hi=class hi extends lf{constructor(e){super(),e=e||{},this.stream= +e.stream||new Zo.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,36 +971,36 @@ 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=(Jo(),j(Yo));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= +n.ssl.key)),Zo.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&& -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. +"end",()=>{this.emit("end")}),ff(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& +this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(z.requestSsl())}startup(e){this. +stream.write(z.startup(e))}cancel(e,t){this._send(z.cancel(e,t))}password(e){this._send(z.password(e))}sendSASLInitialResponseMessage(e,t){ +this._send(z.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(z.sendSCRAMClientFinalMessage( +e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(z.query(e))}parse(e){ +this._send(z.parse(e))}bind(e){this._send(z.bind(e))}execute(e){this._send(z.execute(e))}flush(){this. +stream.writable&&this.stream.write(Xo)}sync(){this._ending=!0,this._send(Xo),this._send(hf)}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. -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.stream.end();return}return this.stream.write(df,()=>{this.stream.end()})}close(e){this._send(z. +close(e))}describe(e){this._send(z.describe(e))}sendCopyFromChunk(e){this._send(z.copyData(e))}endCopyFrom(){ +this._send(z.copyDone())}sendCopyFail(e){this._send(z.copyFail(e))}};a(hi,"Connection");var fi=hi;ea. +exports=fi});var na=R((Tp,ra)=>{"use strict";p();var pf=Re().EventEmitter,Ip=(Rt(),j(Pt)),yf=Tt(),pi=wo(),mf=To(), +wf=Zt(),gf=ir(),ta=jo(),bf=It(),xf=di(),yi=class yi extends pf{constructor(e){super(),this.connectionParameters= +new gf(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.replication=this.connectionParameters.replication;var t=e||{};this._Promise=t.Promise||S.Promise, +this._types=new wf(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= +!1,this._queryable=!0,this.connection=t.connection||new xf({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||bf.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"); +0}_errorAllQueries(e){let t=a(n=>{w.nextTick(()=>{n.handleError(e,this.connection)})},"enqueueError"); this.activeQuery&&(t(this.activeQuery),this.activeQuery=null),this.queryQueue.forEach(t),this.queryQueue. length=0}_connect(e){var t=this,n=this.connection;if(this._connectionCallback=e,this._connecting||this. -_connected){let i=new Error("Client has already been connected. You cannot reuse a client.");m.nextTick( +_connected){let i=new Error("Client has already been connected. You cannot reuse a client.");w.nextTick( ()=>{e(i)});return}this._connecting=!0,this.connectionTimeoutHandle,this._connectionTimeoutMillis>0&& (this.connectionTimeoutHandle=setTimeout(()=>{n._ending=!0,n.stream.destroy(new Error("timeout expir\ ed"))},this._connectionTimeoutMillis)),this.host&&this.host.indexOf("/")===0?n.connect(this.host+"/.\ @@ -1009,7 +1009,7 @@ startup(t.getStartupConf())}),n.on("sslconnect",function(){n.startup(t.getStartu n),n.once("end",()=>{let i=this._ending?new Error("Connection terminated"):new Error("Connection ter\ minated unexpectedly");clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(i),this._ending|| (this._connecting&&!this._connectionError?this._connectionCallback?this._connectionCallback(i):this. -_handleErrorEvent(i):this._connectionError||this._handleErrorEvent(i)),m.nextTick(()=>{this.emit("en\ +_handleErrorEvent(i):this._connectionError||this._handleErrorEvent(i)),w.nextTick(()=>{this.emit("en\ d")})})}connect(e){if(e){this._connect(e);return}return new this._Promise((t,n)=>{this._connect(i=>{ i?n(i):t()})})}_attachListeners(e){e.on("authenticationCleartextPassword",this._handleAuthCleartextPassword. bind(this)),e.on("authenticationMD5Password",this._handleAuthMD5Password.bind(this)),e.on("authentic\ @@ -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():mf(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=yf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ +this._checkPgPass(()=>{this.saslSession=pi.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( +this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){pi.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){pi.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; @@ -1061,39 +1061,39 @@ return this._types.setTypeParser(e,t,n)}getTypeParser(e,t){return this._types.ge return'"'+e.replace(/"/g,'""')+'"'}escapeLiteral(e){for(var t=!1,n="'",i=0;i{this.activeQuery. +!1,this.hasExecuted=!0;let e=this.activeQuery.submit(this.connection);e&&w.nextTick(()=>{this.activeQuery. handleError(e,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&& (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= -(y,g)=>y?f(y):l(g)}))),o&&(c=i.callback,u=setTimeout(()=>{var l=new Error("Query read timeout");m.nextTick( +connectionParameters.query_timeout,i=new ta(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");w.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)}), this.binary&&!i.binary&&(i.binary=!0),i._result&&!i._result._types&&(i._result._types=this._types),this. -_queryable?this._ending?(m.nextTick(()=>{i.handleError(new Error("Client was closed and is not query\ -able"),this.connection)}),s):(this.queryQueue.push(i),this._pulseQueryQueue(),s):(m.nextTick(()=>{i. +_queryable?this._ending?(w.nextTick(()=>{i.handleError(new Error("Client was closed and is not query\ +able"),this.connection)}),s):(this.queryQueue.push(i),this._pulseQueryQueue(),s):(w.nextTick(()=>{i. handleError(new Error("Client has encountered a connection error and is not queryable"),this.connection)}), 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(yi,"Client");var lr=yi;lr.Query=ta;ra.exports=lr});var aa=R((Bp,oa)=>{"use strict";p();var Sf=Re().EventEmitter,ia=a(function(){},"NOOP"),sa=a((r,e)=>{ +let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),gi=class gi{constructor(e,t,n){ +this.client=e,this.idleListener=t,this.timeoutId=n}};a(gi,"IdleItem");var mi=gi,bi=class bi{constructor(e){ +this.callback=e}};a(bi,"PendingItem");var at=bi;function vf(){throw new Error("Release called on cli\ +ent which has already been released to the pool.")}a(vf,"throwOnDoubleRelease");function fr(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(fr,"promisify"); +function Ef(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(Ef,"makeIdleListener");var xi=class xi extends Sf{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.options.Promise||b.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this.options.idleTimeoutMillis= +this.log=this.options.log||function(){},this.Client=this.options.Client||t||Lt().Client,this.Promise= +this.options.Promise||S.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(){ return this._clients.length>this.options.min}_pulseQueue(){if(this.log("pulse queue"),this.ended){this. @@ -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=sa( 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. -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, +l after calling end on the pool");return e?e(i):this.Promise.reject(i)}let t=fr(this.Promise,e),n=t. +result;if(this._isFull()||this._idle.length){if(this._idle.length&&w.nextTick(()=>this._pulseQueue()), +!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new at(t.callback)),n;let i=a((u,c,l)=>{ +clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new at(i),o=setTimeout(()=>{sa(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&& +newClient(new at(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( +t);let n=Ef(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,ia);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()), +_expired.add(t),this._idle.findIndex(l=>l.client===t)!==-1&&this._acquireClient(t,new at((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,ia);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ +let n=!1;return i=>{n&&vf(),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 mi( +e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=fr(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=fr(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=fr(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(xi,"Pool");var wi=xi;oa.exports=wi});var ua={};he(ua,{default:()=>Af});var Af,ca=re(()=>{"use strict";p();Af={}});var la=R((Mp,_f)=>{_f.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 da=R((Up,ha)=>{"use strict";p();var fa=Re().EventEmitter,Cf=(Rt(),j(Pt)),Si=Tt(),ut=ha.exports=function(r,e,t){ +fa.call(this),r=Si.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))};Cf.inherits(ut,fa); +var If={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): -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(){ +file",sourceLine:"line",sourceFunction:"routine"};ut.prototype.handleError=function(r){var e=this.native. +pq.resultErrorFields();if(e)for(var t in e){var n=If[t]||t;r[n]=e[t]}this.callback?this.callback(r): +this.emit("error",r),this.state="error"};ut.prototype.then=function(r,e){return this._getPromise().then( +r,e)};ut.prototype.catch=function(r){return this._getPromise().catch(r)};ut.prototype._getPromise=function(){ return this._promise?this._promise:(this._promise=new Promise(function(r,e){this._once("end",r),this. -_once("error",e)}.bind(this)),this._promise)};He.prototype.submit=function(r){this.state="running";var e=this; +_once("error",e)}.bind(this)),this._promise)};ut.prototype.submit=function(r){this.state="running";var e=this; this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a(function(s,o,u){if(r.native.arrayMode= !1,v(function(){e.emit("_done")}),s)return e.handleError(s);e._emitRowEvents&&(u.length>1?o.forEach( (c,l)=>{c.forEach(f=>{e.emit("row",f,u[l])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="e\ -nd",e.emit("end",u),e.callback&&e.callback(null,u)},"after");if(m.domain&&(t=m.domain.bind(t)),this. +nd",e.emit("end",u),e.callback&&e.callback(null,u)},"after");if(w.domain&&(t=w.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(Si.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(Si. +prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var wa=R((qp,ma)=>{"use strict";p();var Tf=(ca(),j(ua)),Pf=Zt(),Np=la(),pa=Re().EventEmitter,Rf=(Rt(),j(Pt)), +Bf=ir(),ya=da(),oe=ma.exports=function(r){pa.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. +_types=new Pf(r.types),this.native=new Tf({types:this._types}),this._queryQueue=[],this._ending=!1,this. +_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Bf(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. -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; -if(this._connecting){m.nextTick(()=>r(new Error("Client has already been connected. You cannot reuse\ +password}),this.database=e.database,this.host=e.host,this.port=e.port,this.namedQueries={}};oe.Query= +ya;Rf.inherits(oe,pa);oe.prototype._errorAllQueries=function(r){let e=a(t=>{w.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};oe.prototype._connect=function(r){var e=this; +if(this._connecting){w.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== -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. +_pulseQueryQueue(!0),r()})})};oe.prototype.connect=function(r){if(r){this._connect(r);return}return new this. +_Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};oe.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=="f\ +unction")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 ya(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. +"Query read timeout");w.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( +clearTimeout(o),u(c,l)}),this._queryable?this._ending?(n.native=this.native,w.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|| +i):(n.native=this.native,w.nextTick(()=>{n.handleError(new Error("Client has encountered a connectio\ +n error and is not queryable"))}),i)};oe.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){ +w.nextTick(()=>{e.emit("end"),r&&r()})}),t};oe.prototype._hasActiveQuery=function(){return this._activeQuery&& +this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};oe.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]<< +oe.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. +indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};oe.prototype.ref=function(){}; +oe.prototype.unref=function(){};oe.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( +r,e,t)};oe.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var vi=R((Wp,ga)=>{"use strict";p();ga.exports=wa()});var Lt=R(($p,kt)=>{"use strict";p();var Lf=na(),kf=It(),Ff=di(),Mf=aa(),{DatabaseError:Uf}=li(),Df=a( +r=>{var e;return e=class extends Mf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),Ei=a( +function(r){this.defaults=kf,this.Client=r,this.Query=this.Client.Query,this.Pool=Df(this.Client),this. +_pools=[],this.Connection=Ff,this.types=At(),this.DatabaseError=Uf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< +"u"?kt.exports=new Ei(vi()):(kt.exports=new Ei(Lf),Object.defineProperty(kt.exports,"native",{configurable:!0, +enumerable:!1,get(){var r=null;try{r=new Ei(vi())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. +defineProperty(kt.exports,"native",{value:r}),r}}))});var qf={};he(qf,{Client:()=>ct,DatabaseError:()=>ve.DatabaseError,NeonDbError:()=>le,NeonQueryPromise:()=>Be, +Pool:()=>hr,SqlTemplate:()=>Xe,UnsafeRawSql:()=>et,_bundleExt:()=>Nf,defaults:()=>ve.defaults,escapeIdentifier:()=>ve.escapeIdentifier, +escapeLiteral:()=>ve.escapeLiteral,neon:()=>nn,neonConfig:()=>be,types:()=>ve.types,warnIfBrowser:()=>gt}); +module.exports=j(qf);p();p();Ke();Tr();p();var yu=Object.defineProperty,mu=Object.defineProperties,wu=Object.getOwnPropertyDescriptors,us=Object. +getOwnPropertySymbols,gu=Object.prototype.hasOwnProperty,bu=Object.prototype.propertyIsEnumerable,cs=a( +(r,e,t)=>e in r?yu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), +xu=a((r,e)=>{for(var t in e||(e={}))gu.call(e,t)&&cs(r,t,e[t]);if(us)for(var t of us(e))bu.call(e,t)&& +cs(r,t,e[t]);return r},"__spreadValues"),Su=a((r,e)=>mu(r,wu(e)),"__spreadProps"),vu=1008e3,ls=new Uint8Array( +new Uint16Array([258]).buffer)[0]===2,Eu=new TextDecoder,Pr=new TextEncoder,qt=Pr.encode("0123456789\ +abcdef"),Qt=Pr.encode("0123456789ABCDEF"),Au=Pr.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ +stuvwxyz0123456789+/");var fs=Au.slice();fs[62]=45;fs[63]=95;var ht,jt;function _u(r,{alphabet:e,scratchArr:t}={}){if(!ht)if(ht= +new Uint16Array(256),jt=new Uint16Array(256),ls)for(let C=0;C<256;C++)ht[C]=qt[C&15]<<8|qt[C>>>4],jt[C]= +Qt[C&15]<<8|Qt[C>>>4];else for(let C=0;C<256;C++)ht[C]=qt[C&15]|qt[C>>>4]<<8,jt[C]=Qt[C&15]|Qt[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"?jt:ht,f=0,y=0,g;if(ls) 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;ut[ye(this. +_mapKey.has(i)?this._mapKey.get(i):i)]=n),t}mapDecode(e,t){let n=this.decode(e);if(this._keyMap)switch(n. +constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return Es( +()=>(Or(),this?this.decode(e,t):yt.prototype.decode.call(ys,e,t)));Qe=t>-1?t:e.length,h=0,Lr=0,mt=0, +$t=null,Br=gs,W=null,x=e;try{ee=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ +throw x=null,e instanceof Uint8Array?n:new Error("Source must be a Uint8Array or Buffer but was a "+ +(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof yt){if(B=this,ie=this.sharedValues&& +(this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this. +structures)return N=this.structures,Wt();(!N||N.length>0)&&(N=[])}else B=ys,(!N||N.length>0)&&(N=[]), +ie=null;return Wt()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;wt=!0;let o=this?this.decode(e, +s):qr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=W.postBundlePosition){let e=new Error("Unexpected bundle pos\ +ition");throw e.incomplete=!0,e}h=W.postBundlePosition,W=null}if(h==Qe)N=null,x=null,pe&&(pe=null);else if(h> +Qe){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!wt)throw new Error( +"Data read, but end of buffer not reached");return r}catch(r){throw Or(),(r instanceof RangeError||r. +message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a(Wt,"checkedRead");function L(){ +let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return ku();r=ee. +getUint16(h),h+=2;break;case 26:if(e==7){let t=ee.getFloat32(h);if(B.useFloat32>2){let n=As[(x[h]&127)<< +1|x[h+1]>>7];return h+=4,(n*t+(t>0?.5:-.5)>>0)/n}return h+=4,t}if(r=ee.getUint32(h),h+=4,e===1)return-1- +r;break;case 27:if(e==7){let t=ee.getFloat64(h);return h+=8,t}if(e>1){if(ee.getUint32(h)>0)throw new Error( +"JavaScript does not support arrays, maps, or strings with length over 4294967295");r=ee.getUint32(h+ +4)}else B.int64AsNumber?(r=ee.getUint32(h)*4294967296,r+=ee.getUint32(h+4)):r=ee.getBigUint64(h);h+= +8;break;case 31:switch(e){case 2:case 3:throw new Error("Indefinite length not supported for byte or\ + text strings");case 4:let t=[],n,i=0;for(;(n=L())!=ze;){if(i>=dt)throw new Error(`Array length exce\ +eds ${dt}`);t[i++]=n}return e==4?t:e==3?t.join(""):m.concat(t);case 5:let s;if(B.mapsAsObjects){let o={}, +u=0;if(B.keyMap)for(;(s=L())!=ze;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[ye(B. +decodeKey(s))]=L()}else for(;(s=L())!=ze;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`); +o[ye(s)]=L()}return o}else{pt&&(B.mapsAsObjects=!0,pt=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s= +L())!=ze;){if(u++>=_e)throw new Error(`Map size exceeds ${_e}`);o.set(B.decodeKey(s),L())}}else{let u=0; +for(;(s=L())!=ze;){if(u++>=_e)throw new Error(`Map size exceeds ${_e}`);o.set(s,L())}}return o}case 7: +return ze;default:throw new Error("Invalid major type for indefinite length "+e)}default:throw new Error( +"Unknown token "+r)}switch(e){case 0:return r;case 1:return~r;case 2:return Lu(r);case 3:if(mt>=h)return $t. +slice(h-Gt,(h+=r)-Gt);if(mt==0&&Qe<140&&r<32){let i=r<16?xs(r):Bu(r);if(i!=null)return i}return Ru(r);case 4: +if(r>=dt)throw new Error(`Array length exceeds ${dt}`);let t=new Array(r);for(let i=0;i=_e)throw new Error(`Map size exceeds ${dt}`);if(B.mapsAsObjects){let i={};if(B. +keyMap)for(let s=0;s=ds){let i=N[r&8191];if(i)return i. +read||(i.read=Mr(i)),i.read();if(r<65536){if(r==Pu){let s=Je(),o=L(),u=L();Dr(o,u);let c={};if(B.keyMap) +for(let l=2;l23)switch(t){case 24: +t=x[h++];break;case 25:t=ee.getUint16(h),h+=2;break;case 26:t=ee.getUint32(h),h+=4;break;default:throw new Error( +"Expected array header, but got "+x[h-1])}let n=this.compiledReader;for(;n;){if(n.propertyCount===t) +return n(L);n=n.next}if(this.slowReads++>=bs){let s=this.length==t?this:this.slice(0,t);return n=B.keyMap? +new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>ms.test(o)?ye(o)+":r()":"["+JSON.stringify( +o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>ms.test(o)?ye(o)+":r()":"["+JSON.stringify( +o)+"]:r()").join(",")+"}"),this.compiledReader&&(n.next=this.compiledReader),n.propertyCount=t,this. +compiledReader=n,n(L)}let i={};if(B.keyMap)for(let s=0;s64&&Rr)return Rr.decode(x.subarray(h,h+=r));let t=h+ +r,n=[];for(e="";h=t||(x[h]& +192)!==128)n.push(65533);else{let s=x[h++]&63;n.push((i&31)<<6|s)}else if((i&240)===224){let s=h=t||(s&192)!==128||i===224&&s<160||i===237&&s>=160)n.push(65533);else if(h++,h>=t||(x[h]&192)!== +128)n.push(65533);else{let o=x[h++]&63;n.push((i&31)<<12|(s&63)<<6|o)}}else if((i&248)===240){let s=h< +t?x[h]:0;if(i>244||h>=t||(s&192)!==128||i===240&&s<144||i===244&&s>=144)n.push(65533);else if(h++,h>= +t||(x[h]&192)!==128)n.push(65533);else{let o=x[h++]&63;if(h>=t||(x[h]&192)!==128)n.push(65533);else{ +let u=x[h++]&63,c=(i&7)<<18|(s&63)<<12|o<<6|u;c-=65536,n.push(c>>>10&1023|55296),n.push(56320|c&1023)}}}else +n.push(65533);n.length>=4096&&(e+=K.apply(String,n),n.length=0)}return n.length>0&&(e+=K.apply(String, +n)),e}a(Ur,"readStringJS");var K=String.fromCharCode;function Bu(r){let e=h,t=new Array(r);for(let n=0;n< +r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return K.apply(String,t)}a(Bu,"longStringInJS"); +function xs(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return K(e)}}else{ +let e=x[h++],t=x[h++];if((e&128)>0||(t&128)>0){h-=2;return}if(r<3)return K(e,t);let n=x[h++];if((n&128)> +0){h-=3;return}return K(e,t,n)}else{let e=x[h++],t=x[h++],n=x[h++],i=x[h++];if((e&128)>0||(t&128)>0|| +(n&128)>0||(i&128)>0){h-=4;return}if(r<6){if(r===4)return K(e,t,n,i);{let s=x[h++];if((s&128)>0){h-= +5;return}return K(e,t,n,i,s)}}else if(r<8){let s=x[h++],o=x[h++];if((s&128)>0||(o&128)>0){h-=6;return} +if(r<7)return K(e,t,n,i,s,o);let u=x[h++];if((u&128)>0){h-=7;return}return K(e,t,n,i,s,o,u)}else{let s=x[h++], +o=x[h++],u=x[h++],c=x[h++];if((s&128)>0||(o&128)>0||(u&128)>0||(c&128)>0){h-=8;return}if(r<10){if(r=== +8)return K(e,t,n,i,s,o,u,c);{let l=x[h++];if((l&128)>0){h-=9;return}return K(e,t,n,i,s,o,u,c,l)}}else if(r< +12){let l=x[h++],f=x[h++];if((l&128)>0||(f&128)>0){h-=10;return}if(r<11)return K(e,t,n,i,s,o,u,c,l,f); +let y=x[h++];if((y&128)>0){h-=11;return}return K(e,t,n,i,s,o,u,c,l,f,y)}else{let l=x[h++],f=x[h++],y=x[h++], +g=x[h++];if((l&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return K(e,t, +n,i,s,o,u,c,l,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return K(e,t,n,i,s,o,u,c,l,f,y,g,E)}}else{ +let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return K(e,t,n,i,s,o,u,c,l,f,y,g, +E,C);let H=x[h++];if((H&128)>0){h-=15;return}return K(e,t,n,i,s,o,u,c,l,f,y,g,E,C,H)}}}}}a(xs,"short\ +StringInJS");function Lu(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( +h,h+=r)}a(Lu,"readBin");var Ss=new Float32Array(1),Ht=new Uint8Array(Ss.buffer,0,4);function ku(){let r=x[h++],e=x[h++],t=(r& +127)>>2;if(t===31)return e||r&3?NaN:r&128?-1/0:1/0;if(t===0){let n=((r&3)<<8|e)/16777216;return r&128? +-n:n}return Ht[3]=r&128|(t>>1)+56,Ht[2]=(r&7)<<5|e>>3,Ht[1]=e<<5,Ht[0]=0,Ss[0]}a(ku,"getFloat16");var ah=new Array( +4096);var Qr=class Qr{constructor(e,t){this.value=e,this.tag=t}};a(Qr,"Tag");var Ze=Qr;q[0]=r=>new Date(r); +q[1]=r=>new Date(Math.round(r*1e3));q[2]=r=>{let e=BigInt(0);for(let t=0,n=r.byteLength;tBigInt(-1)-q[2](r);q[4]=r=>+(r[1]+"e"+r[0]);q[5]=r=>r[1]*Math. +exp(r[0]*Math.log(2));var Dr=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. +restoreStructures=[]))[r]=t),N[r]=e,e.read=Mr(e)},"recordDefinition");q[Iu]=r=>{let e=r.length,t=r[1]; +Dr(r[0],t);let n={};for(let i=2;iW?W[0].slice( +W.position0,W.position0+=r):new Ze(r,14);q[15]=r=>W?W[1].slice(W.position1,W.position1+=r):new Ze(r, +15);var Fu={Error,RegExp};q[27]=r=>(Fu[r[0]]||Error)(r[1],r[2]);var vs=a(r=>{if(x[h++]!=132){let t=new Error( +"Packed values structure must be followed by a 4 element array");throw x.length{if(!ie)if(B.getShared)Nr();else return new Ze( +r,ps);if(typeof r=="number")return ie[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ +ger packed references yet");throw r===void 0&&(e.incomplete=!0),e};q[28]=r=>{pe||(pe=new Map,pe.id=0); +let e=pe.id++,t=h,n=x[h],i;n>>5==4?i=[]:i={};let s={target:i};pe.set(e,s);let o=r();return s.used?(Object. +getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(h=t,i=o,pe.set(e,{target:i}),o=r()),Object.assign(i,o)): +(s.target=o,o)};q[28].handlesRead=!0;q[29]=r=>{let e=pe.get(r);return e.used=!0,e.target};q[258]=r=>new Set( +r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,pt=!0),r())).handlesRead=!0;function Ye(r,e){return typeof r== +"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Ye,"combine");function qe(){if(!ie) +if(B.getShared)Nr();else throw new Error("No packed values available");return ie}a(qe,"getPackedValu\ +es");var Mu=1399353956;kr.push((r,e)=>{if(r>=225&&r<=255)return Ye(qe().prefixes[r-224],e);if(r>=28704&& +r<=32767)return Ye(qe().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return Ye(qe().prefixes[r- +1879048192],e);if(r>=216&&r<=223)return Ye(e,qe().suffixes[r-216]);if(r>=27647&&r<=28671)return Ye(e, +qe().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return Ye(e,qe().suffixes[r-1811939328]);if(r== +Mu)return{packedValues:ie,structures:N.slice(0),version:e};if(r==55799)return e});var Uu=new Uint8Array( +new Uint16Array([1]).buffer)[0]==1,ws=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> +"u"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"? +{name:"BigInt64Array"}:BigInt64Array,Float32Array,Float64Array],Du=[64,68,69,70,71,72,77,78,79,85,86]; +for(let r=0;r{if(!r)throw new Error("Could not find typed array for code "+e); +return!B.copyBuffers&&(n===1||n===2&&!(o.byteOffset&1)||n===4&&!(o.byteOffset&3)||n===8&&!(o.byteOffset& +7))?new r(o.buffer,o.byteOffset,o.byteLength>>s):new r(Uint8Array.prototype.slice.call(o,0).buffer)}: +o=>{if(!r)throw new Error("Could not find typed array for code "+e);let u=new DataView(o.buffer,o.byteOffset, +o.byteLength),c=o.length>>s,l=new r(c),f=u[t];for(let y=0;y23)switch(r){case 24:r=x[h++];break;case 25:r=ee.getUint16( +h),h+=2;break;case 26:r=ee.getUint32(h),h+=4;break}return r}a(Je,"readJustLength");function Nr(){if(B. +getShared){let r=Es(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ie= +B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(Nr, +"loadShared");function Es(r){let e=Qe,t=h,n=Lr,i=Gt,s=mt,o=$t,u=Br,c=pe,l=W,f=new Uint8Array(x.slice( +0,Qe)),y=N,g=B,E=wt,C=r();return Qe=e,h=t,Lr=n,Gt=i,mt=s,$t=o,Br=u,pe=c,W=l,x=f,wt=E,N=y,B=g,ee=new DataView( +x.buffer,x.byteOffset,x.byteLength),C}a(Es,"saveState");function Or(){x=null,pe=null,N=null}a(Or,"cl\ +earSource");var As=new Array(147);for(let r=0;r<256;r++)As[r]=+("1e"+Math.floor(45.15-r*.30103));var qr=new Fr({ +useRecords:!1}),uh=qr.decode,_s=qr.decodeMultiple;p();var Vt=class Vt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ let{strings:t,values:n}=this;for(let i=0,s=t.length;iLu((0,cs.prepareValue)(n)))}}a(os,"prep\ -areQuery");function yr(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( -"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:\ -password@host.tld/dbname?option=value");function D(P,...I){if(!(Array.isArray(P)&&Array.isArray(P.raw)&& -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 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?? -{});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!== -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== -"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){ + ************************************************************`)}a(gt,"warnIfBrowser");Ke();var co=De(Zt()),lo=De(Tt());var er=class er extends Error{constructor(t){super(t);I(this,"name","NeonDbError");I(this,"severity"); +I(this,"code");I(this,"detail");I(this,"hint");I(this,"position");I(this,"internalPosition");I(this, +"internalQuery");I(this,"where");I(this,"schema");I(this,"table");I(this,"column");I(this,"dataType"); +I(this,"constraint");I(this,"file");I(this,"line");I(this,"routine");I(this,"sourceError");"captureS\ +tackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,er)}};a( +er,"NeonDbError");var le=er,oo="transaction() expects an array of queries, or a function returning a\ +n array of queries",Gc=["severity","code","detail","hint","position","internalPosition","internalQue\ +ry","where","schema","table","column","dataType","constraint","file","line","routine"],Vc={json:"app\ +lication/json",jsonl:"application/vnd.neon.sql.v1+json","cbor-seq":"application/vnd.neon.sql.v1+cbor"}; +function fo(r){let e=new le(r.message);for(let t of Gc)e[t]=r[t]??void 0;return e}a(fo,"dbError");async function Kc(r,e){ +let t=e==="jsonl"?(await r.text()).split(` +`).filter(u=>u.length!==0).map(u=>JSON.parse(u)):_s(new Uint8Array(await r.arrayBuffer())),n=t.at(-1); +if(n?.type!=="end")throw new le("Neon internal error: streamed response ended without a terminal mes\ +sage");if(n.status==="error")throw fo(n.error);if(n.status!=="ok")throw new le("Neon internal error:\ + unexpected streamed response status");let i,s,o=[];for(let u of t.slice(0,-1))switch(u.type){case"c\ +olumns":i=u.columns;break;case"row":o.push(u.row);break;case"query":s=u.query;break;default:throw new le( +"Neon internal error: unexpected streamed response message")}if(!Array.isArray(i)||s===void 0)throw new le( +"Neon internal error: incomplete streamed response");return{fields:i,rows:o,command:s.command,rowCount:s. +rowCount}}a(Kc,"readStreamingResult");function zc(r){return r instanceof m?"\\x"+hs(r):r}a(zc,"encod\ +eBuffersAsBytea");function ao(r){let{query:e,params:t}=r instanceof Xe?r.toParameterizedQuery():r;return{ +query:e,params:t.map(n=>zc((0,lo.prepareValue)(n)))}}a(ao,"prepareQuery");function nn(r,{arrayMode:e, +fullResults:t,fetchOptions:n,responseFormat:i,isolationLevel:s,readOnly:o,deferrable:u,authToken:c,disableWarningInBrowsers:l}={}){ +if(!r)throw new Error("No database connection string was provided to `neon()`. Perhaps an environmen\ +t variable has not been set?");let f;try{f=Ir(r)}catch{throw new Error("Database connection string p\ +rovided to `neon()` is not a valid URL. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E, +port:C,pathname:H}=f;if(y!=="postgres:"&&y!=="postgresql:"||!g||!E||!H)throw new Error("Database con\ +nection string format for `neon()` should be: postgresql://user@host.tld/dbname?option=value");function J(T,...b){ +if(!(Array.isArray(T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can no\ +w be called only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], \ +options). For a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SE\ +LECT $1", [value], options).');return new Be(ge,new Xe(T,b))}a(J,"templateFn"),J.query=(T,b,k)=>new Be( +ge,{query:T,params:b??[]},k),J.unsafe=T=>new et(T),J.transaction=async(T,b)=>{if(typeof T=="function"&& +(T=T(J)),!Array.isArray(T))throw new Error(oo);T.forEach($=>{if(!($ instanceof Be))throw new Error(oo)}); +let k=T.map($=>$.queryData),ae=T.map($=>$.opts??{});return ge(k,ae,b)};async function ge(T,b,k){let{ +fetchEndpoint:ae,fetchFunction:$}=be,Ie=Array.isArray(T)?{queries:T.map(G=>ao(G))}:ao(T),fe=n??{},ue=i?? +"json",M=e??!1,Z=t??!1,Ee=s,Te=o,Fe=u;if(k!==void 0&&(k.fetchOptions!==void 0&&(fe={...fe,...k.fetchOptions}), +k.arrayMode!==void 0&&(M=k.arrayMode),k.fullResults!==void 0&&(Z=k.fullResults),k.responseFormat!==void 0&& +(ue=k.responseFormat),k.isolationLevel!==void 0&&(Ee=k.isolationLevel),k.readOnly!==void 0&&(Te=k.readOnly), +k.deferrable!==void 0&&(Fe=k.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!==void 0&&(fe= +{...fe,...b.fetchOptions}),b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(ue=b.responseFormat), +Array.isArray(T)&&ue!=="json")throw new Error("`jsonl` and `cbor-seq` response formats do not suppor\ +t transactions");let Me=c;!Array.isArray(b)&&b?.authToken!==void 0&&(Me=b.authToken);let lt=typeof ae== +"function"?ae(E,C,{jwtAuth:Me!==void 0}):ae,Ue={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ +rue","Neon-Array-Mode":"true",Accept:Vc[ue]},Ft=await Yc(Me);Ft&&(Ue.Authorization=`Bearer ${Ft}`),Array. +isArray(T)&&(Ee!==void 0&&(Ue["Neon-Batch-Isolation-Level"]=Ee),Te!==void 0&&(Ue["Neon-Batch-Read-On\ +ly"]=String(Te)),Fe!==void 0&&(Ue["Neon-Batch-Deferrable"]=String(Fe))),l||be.disableWarningInBrowsers|| +gt();let ce;try{ce=await($??fetch)(lt,{method:"POST",body:JSON.stringify(Ie),headers:Ue,...fe})}catch(G){ +let X=new le(`Error connecting to database: ${G}`);throw X.sourceError=G,X}if(ce.ok){let G=ue==="jso\ +n"?await ce.json():await Kc(ce,ue);if(Array.isArray(T)){let X=G.results;if(!Array.isArray(X))throw new le( +"Neon internal error: unexpected result format");return X.map((dr,pr)=>{let yr=b[pr]??{},va=yr.arrayMode?? +M,Ea=yr.fullResults??Z;return uo(dr,{arrayMode:va,fullResults:Ea,types:yr.types})})}else{let X=b??{}, +dr=X.arrayMode??M,pr=X.fullResults??Z;return uo(G,{arrayMode:dr,fullResults:pr,types:X.types})}}else{ +let{status:G}=ce;if(G===400){let X=await ce.json();throw fo(X)}else{let X=await ce.text();throw new le( +`Server error (HTTP status ${G}): ${X}`)}}}return a(ge,"execute"),J}a(nn,"neon");var sn=class sn{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( +this.queryData,this.opts).finally(e)}};a(sn,"NeonQueryPromise");var Be=sn;function uo(r,{arrayMode:e, +fullResults:t,types:n}){let i=new co.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. +o,r._types=i,r):u}a(uo,"processQueryResult");async function Yc(r){if(typeof r=="string")return r;if(typeof r== +"function")try{return await Promise.resolve(r())}catch(e){let t=new le("Error getting auth token."); +throw e instanceof Error&&(t=new le(`Error getting auth token: ${e.message}`)),t}}a(Yc,"getAuthToken");p();var xa=De(Lt());p();var ba=De(Lt());var Ai=class Ai extends ba.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=== +void 0||w.env.PGHOST!==void 0,s=w.env.USER??w.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\ @@ -1323,40 +1478,40 @@ c=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let l=this.c "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){ +gt(),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; +"SASL: protocol error");let u=Object.fromEntries(o.split(",").map(ce=>{if(!/^.=/.test(ce))throw new Error( +"SASL: Invalid attribute pair entry");let G=ce[0],X=ce.substring(2);return[G,X]})),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\ + short");let y=parseInt(f,10),g=m.from(l,"base64"),E=new TextEncoder,C=E.encode(s),H=await n.importKey( +"raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),J=new Uint8Array(await n.sign("HMAC",H,m.concat( +[g,m.from([0,0,0,1])]))),ge=J;for(var T=0;Tge[G]^J[G]));let b=ge,k=await n.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-2\ +56"}},!1,["sign"]),ae=new Uint8Array(await n.sign("HMAC",k,E.encode("Client Key"))),$=await n.digest( +"SHA-256",ae),Ie="n=*,r="+i.clientNonce,fe="r="+c+",s="+l+",i="+y,ue="c=biws,r="+c,M=Ie+","+fe+","+ue, +Z=await n.importKey("raw",$,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Ee=new Uint8Array(await n. +sign("HMAC",Z,E.encode(M))),Te=m.from(ae.map((ce,G)=>ae[G]^Ee[G])),Fe=Te.toString("base64");let Me=await n. +importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),lt=await n.sign("HMAC",Me,E.encode( +"Server Key")),Ue=await n.importKey("raw",lt,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Ft=m. +from(await n.sign("HMAC",Ue,E.encode(M)));i.message="SASLResponse",i.serverSignature=Ft.toString("ba\ +se64"),i.response=ue+",p="+Fe,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; +a(Ai,"NeonClient");var ct=Ai;Ke();var Sa=De(ir());function Of(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(Of,"promisify");var _i=class _i extends xa.Pool{constructor(){ +super(...arguments);I(this,"Client",ct);I(this,"hasFetchUnsupportedListeners",!1);I(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( +if(!be.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof t=="function")return super.query( +t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=Of(this.Promise,i);i=s.callback;try{let o=new Sa.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. -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"; +/${c(o.database)}`,f=typeof t=="string"?t:t.text,y=n??t.values??[];nn(l,{fullResults:!0,arrayMode:t. +rowMode==="array"}).query(f,y,{types:t.types??this.options?.types}).then(E=>i(void 0,E)).catch(E=>i( +E))}catch(o){i(o)}return s.result}};a(_i,"NeonPool");var hr=_i;Ke();var ve=De(Lt()),Nf="js"; /*! Bundled license information: ieee754/index.js: diff --git a/index.mjs b/index.mjs index afb13f9..fd32674 100644 --- a/index.mjs +++ b/index.mjs @@ -1,405 +1,405 @@ /* @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> -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;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? --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, -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? +var Aa=Object.create;var Qe=Object.defineProperty;var _a=Object.getOwnPropertyDescriptor;var Ca=Object.getOwnPropertyNames;var Ia=Object.getPrototypeOf,Ta=Object.prototype.hasOwnProperty;var Pa=(r,e,t)=>e in r?Qe(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>Qe(r,"name",{value:e,configurable:!0});var re=(r,e)=>()=>(r&&(e=r(r=0)),e);var R=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ge=(r,e)=>{for(var t in e)Qe(r,t,{get:e[t], +enumerable:!0})},_i=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ca(e))!Ta. +call(r,i)&&i!==t&&Qe(r,i,{get:()=>e[i],enumerable:!(n=_a(e,i))||n.enumerable});return r};var Me=(r,e,t)=>(t=r!=null?Aa(Ia(r)):{},_i(e||!r||!r.__esModule?Qe(t,"default",{value:r,enumerable:!0}): +t,r)),G=r=>_i(Qe({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Pa(r,typeof e!="symbol"?e+"":e,t);var Ti=R(Ft=>{"use strict";p();Ft.byteLength=Ba;Ft.toByteArray=ka;Ft.fromByteArray=Ua;var be=[],fe=[], +Ra=typeof Uint8Array<"u"?Uint8Array:Array,yr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ +23456789+/";for(Ue=0,Ci=yr.length;Ue0)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(Ii,"getLens"); +function Ba(r){var e=Ii(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Ba,"byteLength");function La(r,e,t){return(e+ +t)*3/4-t}a(La,"_byteLength");function ka(r){var e,t=Ii(r),n=t[0],i=t[1],s=new Ra(La(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=fe[r.charCodeAt( +c)]<<2|fe[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=fe[r.charCodeAt(c)]<<10|fe[r.charCodeAt(c+1)]<< +4|fe[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(ka,"toByteArray");function Fa(r){return be[r>> +18&63]+be[r>>12&63]+be[r>>6&63]+be[r&63]}a(Fa,"tripletToBase64");function Ma(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(Fa(n));return i.join("")}a(Ma,"en\ +codeChunk");function Ua(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(be[e>>2]+be[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1], +i.push(be[e>>10]+be[e>>4&63]+be[e<<2&63]+"=")),i.join("")}a(Ua,"fromByteArray")});var Pi=R(mr=>{p();mr.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,E=r[e+y];for(y+=g,s=E&(1<<-f)-1,E>>=-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:(E?-1:1)*(1/0);o=o+Math. +pow(2,n),s=s-l}return(E?-1:1)*o*Math.pow(2,s-n)};mr.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,E=n?0:s-1,C=n?1:-1,W=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< +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+E]=u&255,E+= +C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=W*128}});var Gi=R($e=>{"use strict";p();var wr=Ti(),We=Pi(),Ri=typeof Symbol=="function"&&typeof Symbol.for== +"function"?Symbol.for("nodejs.util.inspect.custom"):null;$e.Buffer=d;$e.SlowBuffer=ja;$e.INSPECT_MAX_BYTES= +50;var Mt=2147483647;$e.kMaxLength=Mt;d.TYPED_ARRAY_SUPPORT=Da();!d.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 Da(){ 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. -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+'\ -" 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\ -, 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\ - 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. -toPrimitive]=="function")return h.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The\ +prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}a(Da,"typedArraySupport");Object. +defineProperty(d.prototype,"parent",{enumerable:!0,get:a(function(){if(d.isBuffer(this))return this. +buffer},"get")});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:a(function(){if(d.isBuffer( +this))return this.byteOffset},"get")});function Ee(r){if(r>Mt)throw new RangeError('The value "'+r+'\ +" is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,d.prototype), +e}a(Ee,"createBuffer");function d(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 Sr(r)}return Fi(r,e,t)} +a(d,"Buffer");d.poolSize=8192;function Fi(r,e,t){if(typeof r=="string")return Na(r,e);if(ArrayBuffer. +isView(r))return qa(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(xe(r,ArrayBuffer)|| +r&&xe(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(xe(r,SharedArrayBuffer)||r&&xe(r.buffer, +SharedArrayBuffer)))return br(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 d. +from(n,e,t);let i=Qa(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. +toPrimitive]=="function")return d.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(Fi,"from");d.from=function(r,e,t){return Fi(r,e,t)};Object.setPrototypeOf(d.prototype, +Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Mi(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= -"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!== -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( +r,e,t),Object.setPrototypeOf(n,d.prototype),n}a(br,"fromArrayBuffer");function Qa(r){if(d.isBuffer(r)){ +let e=vr(r.length)|0,t=Ee(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r. +length!="number"||Ar(r.length)?Ee(0):gr(r);if(r.type==="Buffer"&&Array.isArray(r.data))return gr(r.data)} +a(Qa,"fromObject");function vr(r){if(r>=Mt)throw new RangeError("Attempt to allocate Buffer larger t\ +han maximum size: 0x"+Mt.toString(16)+" bytes");return r|0}a(vr,"checked");function ja(r){return+r!= +r&&(r=0),d.alloc(+r)}a(ja,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== +d.prototype},"isBuffer");d.compare=a(function(e,t){if(xe(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)), +xe(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.isBuffer(t))throw new TypeError( 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length, i=t.length;for(let s=0,o=Math.min(n,i);si.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 zn(r,e){if(h.isBuffer(r))return r.length; -if(ArrayBuffer.isView(r)||ue(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError( +utf-16le":return!0;default:return!1}},"isEncoding");d.concat=a(function(e,t){if(!Array.isArray(e))throw new TypeError( +'"list" argument must be an Array of Buffers');if(e.length===0)return d.alloc(0);let n;if(t===void 0) +for(t=0,n=0;ni.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(i,s)):Uint8Array.prototype. +set.call(i,o,s);else if(d.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 Ui(r,e){if(d.isBuffer(r))return r.length; +if(ArrayBuffer.isView(r)||xe(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 xr(r).length;case"ucs2":case"\ +ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return $i(r).length;default: +if(i)return n?-1:xr(r).length;e=(""+e).toLowerCase(),i=!0}}a(Ui,"byteLength");d.byteLength=Ui;function Wa(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, -"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;t>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Xa(this,e,t);case"u\ +tf8":case"utf-8":return Oi(this,e,t);case"ascii":return Ja(this,e,t);case"latin1":case"binary":return Za( +this,e,t);case"base64":return za(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return eu( +this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(Wa, +"slowToString");d.prototype._isBuffer=!0;function De(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(De,"swap"); +d.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){ -if(ue(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(e))throw new TypeError('The "ta\ +er "+e+">"},"inspect");Ri&&(d.prototype[Ri]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ +if(xe(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.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,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. +compare");function Di(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,Ar(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=d.from( +e,n)),d.isBuffer(e))return e.length===0?-1:Bi(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):Bi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Di,"bidire\ +ctionalIndexOf");function Bi(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: -if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"write");h.prototype. +fer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return Ha(this,e,t,n);case"utf8":case"\ +utf-8":return $a(this,e,t,n);case"ascii":case"latin1":case"binary":return Ga(this,e,t,n);case"base64": +return Va(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ka(this,e,t,n);default: +if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"write");d.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 Ya(n)}a(Oi,"utf8Slice");var Li=4096;function Ya(r){let e=r.length;if(e<=Li)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){ +e&&(t=e);let i=this.subarray(e,t);return Object.setPrototypeOf(i,d.prototype),i},"slice");function V(r,e,t){ if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to \ -access beyond buffer length")}a(q,"checkOffset");h.prototype.readUintLE=h.prototype.readUIntLE=a(function(e,t,n){ -e=e>>>0,t=t>>>0,n||q(e,t,this.length);let i=this[e],s=1,o=0;for(;++o>>0,t=t>>>0,n||q(e, -t,this.length);let i=this[e+--t],s=1;for(;t>0&&(s*=256);)i+=this[e+--t]*s;return i},"readUIntBE");h. -prototype.readUint8=h.prototype.readUInt8=a(function(e,t){return e=e>>>0,t||q(e,1,this.length),this[e]}, -"readUInt8");h.prototype.readUint16LE=h.prototype.readUInt16LE=a(function(e,t){return e=e>>>0,t||q(e, -2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");h.prototype.readUint16BE=h.prototype.readUInt16BE= -a(function(e,t){return e=e>>>0,t||q(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");h.prototype. -readUint32LE=h.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||q(e,4,this.length),(this[e]| -this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");h.prototype.readUint32BE=h.prototype. -readUInt32BE=a(function(e,t){return e=e>>>0,t||q(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+ -2]<<8|this[e+3])},"readUInt32BE");h.prototype.readBigUInt64LE=we(a(function(e){e=e>>>0,Re(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&je(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* +access beyond buffer length")}a(V,"checkOffset");d.prototype.readUintLE=d.prototype.readUIntLE=a(function(e,t,n){ +e=e>>>0,t=t>>>0,n||V(e,t,this.length);let i=this[e],s=1,o=0;for(;++o>>0,t=t>>>0,n||V(e, +t,this.length);let i=this[e+--t],s=1;for(;t>0&&(s*=256);)i+=this[e+--t]*s;return i},"readUIntBE");d. +prototype.readUint8=d.prototype.readUInt8=a(function(e,t){return e=e>>>0,t||V(e,1,this.length),this[e]}, +"readUInt8");d.prototype.readUint16LE=d.prototype.readUInt16LE=a(function(e,t){return e=e>>>0,t||V(e, +2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");d.prototype.readUint16BE=d.prototype.readUInt16BE= +a(function(e,t){return e=e>>>0,t||V(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");d.prototype. +readUint32LE=d.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||V(e,4,this.length),(this[e]| +this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");d.prototype.readUint32BE=d.prototype. +readUInt32BE=a(function(e,t){return e=e>>>0,t||V(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+ +2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Te(a(function(e){e=e>>>0,He(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&at(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* 2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<< -BigInt(32))},"readBigUInt64LE"));h.prototype.readBigUInt64BE=we(a(function(e){e=e>>>0,Re(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&je(e,this.length-8);let i=t*2**24+this[++e]*2**16+ +BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Te(a(function(e){e=e>>>0,He(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&at(e,this.length-8);let i=t*2**24+this[++e]*2**16+ this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<>>0,t=t>>>0,n||q(e,t, +32))+BigInt(s)},"readBigUInt64BE"));d.prototype.readIntLE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||V(e,t, this.length);let i=this[e],s=1,o=0;for(;++o=s&&(i-=Math. -pow(2,8*t)),i},"readIntLE");h.prototype.readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||q(e,t,this.length); +pow(2,8*t)),i},"readIntLE");d.prototype.readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||V(e,t,this.length); let i=t,s=1,o=this[e+--i];for(;i>0&&(s*=256);)o+=this[e+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8* -t)),o},"readIntBE");h.prototype.readInt8=a(function(e,t){return e=e>>>0,t||q(e,1,this.length),this[e]& -128?(255-this[e]+1)*-1:this[e]},"readInt8");h.prototype.readInt16LE=a(function(e,t){e=e>>>0,t||q(e,2, -this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");h.prototype.readInt16BE= -a(function(e,t){e=e>>>0,t||q(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760: -n},"readInt16BE");h.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||q(e,4,this.length),this[e]| -this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");h.prototype.readInt32BE=a(function(e,t){return e= -e>>>0,t||q(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");h.prototype. -readBigInt64LE=we(a(function(e){e=e>>>0,Re(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& -je(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,Re(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&je(e,this. +t)),o},"readIntBE");d.prototype.readInt8=a(function(e,t){return e=e>>>0,t||V(e,1,this.length),this[e]& +128?(255-this[e]+1)*-1:this[e]},"readInt8");d.prototype.readInt16LE=a(function(e,t){e=e>>>0,t||V(e,2, +this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");d.prototype.readInt16BE= +a(function(e,t){e=e>>>0,t||V(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760: +n},"readInt16BE");d.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||V(e,4,this.length),this[e]| +this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");d.prototype.readInt32BE=a(function(e,t){return e= +e>>>0,t||V(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");d.prototype. +readBigInt64LE=Te(a(function(e){e=e>>>0,He(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& +at(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,He(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&at(e,this. length-8);let i=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,t||q(e,4,this.length),Pe.read(this,e,!0,23,4)},"readFloatLE");h.prototype.readFloatBE= -a(function(e,t){return e=e>>>0,t||q(e,4,this.length),Pe.read(this,e,!1,23,4)},"readFloatBE");h.prototype. -readDoubleLE=a(function(e,t){return e=e>>>0,t||q(e,8,this.length),Pe.read(this,e,!0,52,8)},"readDoub\ -leLE");h.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||q(e,8,this.length),Pe.read(this,e, -!1,52,8)},"readDoubleBE");function V(r,e,t,n,i,s){if(!h.isBuffer(r))throw new TypeError('"buffer" ar\ -gument must be a Buffer instance');if(e>i||er.length)throw new RangeError("Index out of range")}a(V,"checkInt");h.prototype.writeUintLE= -h.prototype.writeUIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;V(this, +this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)},"readBigInt64BE"));d.prototype.readFloatLE=a(function(e,t){ +return e=e>>>0,t||V(e,4,this.length),We.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= +a(function(e,t){return e=e>>>0,t||V(e,4,this.length),We.read(this,e,!1,23,4)},"readFloatBE");d.prototype. +readDoubleLE=a(function(e,t){return e=e>>>0,t||V(e,8,this.length),We.read(this,e,!0,52,8)},"readDoub\ +leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||V(e,8,this.length),We.read(this,e, +!1,52,8)},"readDoubleBE");function ne(r,e,t,n,i,s){if(!d.isBuffer(r))throw new TypeError('"buffer" a\ +rgument must be a Buffer instance');if(e>i||er.length)throw new RangeError("Index out of range")}a(ne,"checkInt");d.prototype.writeUintLE= +d.prototype.writeUIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;ne(this, e,t,n,u,0)}let s=1,o=0;for(this[t]=e&255;++o>>0,n=n>>>0,!i){let u=Math. -pow(2,8*n)-1;V(this,e,t,n,u,0)}let s=n-1,o=1;for(this[t+s]=e&255;--s>=0&&(o*=256);)this[t+s]=e/o&255; -return t+n},"writeUIntBE");h.prototype.writeUint8=h.prototype.writeUInt8=a(function(e,t,n){return e= -+e,t=t>>>0,n||V(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");h.prototype.writeUint16LE=h.prototype. -writeUInt16LE=a(function(e,t,n){return e=+e,t=t>>>0,n||V(this,e,t,2,65535,0),this[t]=e&255,this[t+1]= -e>>>8,t+2},"writeUInt16LE");h.prototype.writeUint16BE=h.prototype.writeUInt16BE=a(function(e,t,n){return e= -+e,t=t>>>0,n||V(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");h.prototype. -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++]= +d.prototype.writeUintBE=d.prototype.writeUIntBE=a(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let u=Math. +pow(2,8*n)-1;ne(this,e,t,n,u,0)}let s=n-1,o=1;for(this[t+s]=e&255;--s>=0&&(o*=256);)this[t+s]=e/o&255; +return t+n},"writeUIntBE");d.prototype.writeUint8=d.prototype.writeUInt8=a(function(e,t,n){return e= ++e,t=t>>>0,n||ne(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");d.prototype.writeUint16LE=d.prototype. +writeUInt16LE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(this,e,t,2,65535,0),this[t]=e&255,this[t+1]= +e>>>8,t+2},"writeUInt16LE");d.prototype.writeUint16BE=d.prototype.writeUInt16BE=a(function(e,t,n){return e= ++e,t=t>>>0,n||ne(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");d.prototype. +writeUint32LE=d.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(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");d.prototype. +writeUint32BE=d.prototype.writeUInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(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 Ni(r,e,t,n,i){ +Hi(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(Ni,"wrtBigUInt64LE");function qi(r,e,t,n,i){Hi(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( -"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= -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=n-1,o=1,u=0; -for(this[t+s]=e&255;--s>=0&&(o*=256);)e<0&&u===0&&this[t+s+1]!==0&&(u=1),this[t+s]=(e/o>>0)-u&255;return t+ -n},"writeIntBE");h.prototype.writeInt8=a(function(e,t,n){return e=+e,t=t>>>0,n||V(this,e,t,1,127,-128), -e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");h.prototype.writeInt16LE=a(function(e,t,n){return e= -+e,t=t>>>0,n||V(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeInt16LE");h.prototype. -writeInt16BE=a(function(e,t,n){return e=+e,t=t>>>0,n||V(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+ -1]=e&255,t+2},"writeInt16BE");h.prototype.writeInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||V(this, -e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},"\ -writeInt32LE");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\ -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"); -h.prototype.copy=a(function(e,t,n,i){if(!h.isBuffer(e))throw new TypeError("argument should be a Buf\ +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(qi,"wrtBigUInt64BE");d.prototype. +writeBigUInt64LE=Te(a(function(e,t=0){return Ni(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ +riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Te(a(function(e,t=0){return qi(this,e,t,BigInt(0),BigInt( +"0xffffffffffffffff"))},"writeBigUInt64BE"));d.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>> +0,!i){let c=Math.pow(2,8*n-1);ne(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");d.prototype.writeIntBE= +a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*n-1);ne(this,e,t,n,c-1,-c)}let s=n-1,o=1, +u=0;for(this[t+s]=e&255;--s>=0&&(o*=256);)e<0&&u===0&&this[t+s+1]!==0&&(u=1),this[t+s]=(e/o>>0)-u&255; +return t+n},"writeIntBE");d.prototype.writeInt8=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(this,e,t, +1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");d.prototype.writeInt16LE=a(function(e,t,n){ +return e=+e,t=t>>>0,n||ne(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeInt16LE"); +d.prototype.writeInt16BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(this,e,t,2,32767,-32768),this[t]= +e>>>8,this[t+1]=e&255,t+2},"writeInt16BE");d.prototype.writeInt32LE=a(function(e,t,n){return e=+e,t= +t>>>0,n||ne(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+ +3]=e>>>24,t+4},"writeInt32LE");d.prototype.writeInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne( +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");d.prototype.writeBigInt64LE=Te(a(function(e,t=0){return Ni( +this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));d.prototype. +writeBigInt64BE=Te(a(function(e,t=0){return qi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ +ffffffffffff"))},"writeBigInt64BE"));function Qi(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(Qi,"checkIEEE754");function ji(r,e,t,n,i){ +return e=+e,t=t>>>0,i||Qi(r,e,t,4,34028234663852886e22,-34028234663852886e22),We.write(r,e,t,n,23,4), +t+4}a(ji,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return ji(this,e,t,!0,n)},"writeFl\ +oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return ji(this,e,t,!1,n)},"writeFloatBE");function Wi(r,e,t,n,i){ +return e=+e,t=t>>>0,i||Qi(r,e,t,8,17976931348623157e292,-17976931348623157e292),We.write(r,e,t,n,52, +8),t+8}a(Wi,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return Wi(this,e,t,!0,n)},"wr\ +iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return Wi(this,e,t,!1,n)},"writeDoubleBE"); +d.prototype.copy=a(function(e,t,n,i){if(!d.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=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd \ out of bounds");i>this.length&&(i=this.length),e.length-t>>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){ +e ${typeof e}`},TypeError);Er("ERR_OUT_OF_RANGE",function(r,e,t){let n=`The value of "${r}" is out o\ +f range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=ki(String(t)):typeof t=="bigint"&&(i=String( +t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=ki(i)),i+="n"),n+=` It must be ${e}. Re\ +ceived ${i}`,n},RangeError);function ki(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(ki,"addNumericalSeparator");function tu(r,e,t){ +He(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&at(e,r.length-(t+1))}a(tu,"checkBounds");function Hi(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!= -"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< +nd <= ${t}${o}`,new je.ERR_OUT_OF_RANGE("value",u,r)}tu(n,i,s)}a(Hi,"checkIntBI");function He(r,e){if(typeof r!= +"number")throw new je.ERR_INVALID_ARG_TYPE(e,"number",r)}a(He,"validateNumber");function at(r,e,t){throw Math. +floor(r)!==r?(He(r,t),new je.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new je.ERR_BUFFER_OUT_OF_BOUNDS: +new je.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(at,"boundsError");var ru=/[^+/0-9A-Za-z-_]/g; +function nu(r){if(r=r.split("=")[0],r=r.trim().replace(ru,""),r.length<2)return"";for(;r.length%4!== +0;)r=r+"=";return r}a(nu,"base64clean");function xr(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!= -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){ -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. -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!= +240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}a(xr,"utf\ +8ToBytes");function iu(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(su,"utf16leToBytes");function $i(r){return wr.toByteArray( +nu(r))}a($i,"base64ToBytes");function Ut(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) +e[i+t]=r[i];return i}a(Ut,"blitBuffer");function xe(r,e){return r instanceof e||r!=null&&r.constructor!= +null&&r.constructor.name!=null&&r.constructor.name===e.name}a(xe,"isInstance");function Ar(r){return r!== +r}a(Ar,"numberIsNaN");var ou=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 Te(r){return typeof BigInt>"u"? +au:r}a(Te,"defineBigIntMethod");function au(){throw new Error("BigInt not supported")}a(au,"BufferBi\ +gIntNotDefined")});var S,v,A,m,w,p=re(()=>{"use strict";S=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),A= +globalThis.clearImmediate??(r=>clearTimeout(r)),m=typeof globalThis.Buffer=="function"&&typeof globalThis. +Buffer.allocUnsafe=="function"?globalThis.Buffer:Gi().Buffer,w=globalThis.process??{};w.env??(w.env= +{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Pe=R((zf,_r)=>{"use strict";p();var Ge=typeof Reflect=="object"?Reflect:null,Vi=Ge&&typeof Ge.apply== +"function"?Ge.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Dt; +Ge&&typeof Ge.ownKeys=="function"?Dt=Ge.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 uu(r){console&&console.warn&&console.warn(r)}a(uu, +"ProcessEmitWarning");var zi=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function F(){F. +init.call(this)}a(F,"EventEmitter");_r.exports=F;_r.exports.once=hu;F.EventEmitter=F;F.prototype._events= +void 0;F.prototype._eventsCount=0;F.prototype._maxListeners=void 0;var Ki=10;function Ot(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}, -"set")});R.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&& +a(Ot,"checkListener");Object.defineProperty(F,"defaultMaxListeners",{enumerable:!0,get:a(function(){ +return Ki},"get"),set:a(function(r){if(typeof r!="number"||r<0||zi(r))throw new RangeError('The valu\ +e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Ki=r}, +"set")});F.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\ +F.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||zi(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"); -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=Yi(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,uu(u)}return r}a(Ji,"_addListener");F.prototype.addListener=a(function(e,t){ +return Ji(this,e,t,!1)},"addListener");F.prototype.on=F.prototype.addListener;F.prototype.prependListener= +a(function(e,t){return Ji(this,e,t,!0)},"prependListener");function cu(){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(cu,"onceWrapper");function Zi(r,e,t){var n={fired:!1, +wrapFn:void 0,target:r,type:e,listener:t},i=cu.bind(n);return i.listener=t,n.wrapFn=i,i}a(Zi,"_onceW\ +rap");F.prototype.once=a(function(e,t){return Ot(t),this.on(e,Zi(this,e,t)),this},"once");F.prototype. +prependOnceListener=a(function(e,t){return Ot(t),this.prependListener(e,Zi(this,e,t)),this},"prepend\ +OnceListener");F.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(Ot(t),i=this._events,i=== void 0)return this;if(n=i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0? this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("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!== -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; +listener,s=o;break}if(s<0)return this;s===0?n.shift():lu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== +void 0&&this.emit("removeListener",e,u||t)}return this},"removeListener");F.prototype.off=F.prototype. +removeListener;F.prototype.removeAllListeners=a(function(e){var t,n,i;if(n=this._events,n===void 0)return this; if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount= 0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments. length===0){var s=Object.keys(n),o;for(i=0;i= -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 Xi(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 ts(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(){ -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(){ -return S.opts.poolQueryViaFetch??S.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){S.opts. -poolQueryViaFetch=t}static get fetchEndpoint(){return S.opts.fetchEndpoint??S.defaults.fetchEndpoint}static set fetchEndpoint(t){ -S.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(t){ +ust be of type EventEmitter. Received type '+typeof r)}a(rs,"eventTargetAgnosticAddListener")});var ss={};ge(ss,{Socket:()=>Se,isIP:()=>pu});function pu(r){return 0}var is,ns,_,Se,Ve=re(()=>{"use \ +strict";p();is=Me(Pe(),1);a(pu,"isIP");ns=/^[^.]+\./,_=class _ extends is.EventEmitter{constructor(){ +super(...arguments);I(this,"opts",{});I(this,"connecting",!1);I(this,"pending",!0);I(this,"writable", +!0);I(this,"encrypted",!1);I(this,"authorized",!1);I(this,"destroyed",!1);I(this,"ws",null);I(this,"\ +writeBuffer");I(this,"tlsState",0);I(this,"tlsRead");I(this,"tlsWrite")}static get poolQueryViaFetch(){ +return _.opts.poolQueryViaFetch??_.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){_.opts. +poolQueryViaFetch=t}static get fetchEndpoint(){return _.opts.fetchEndpoint??_.defaults.fetchEndpoint}static set fetchEndpoint(t){ +_.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(t){ console.warn("The `fetchConnectionCache` option is deprecated (now always `true`)")}static get fetchFunction(){ -return S.opts.fetchFunction??S.defaults.fetchFunction}static set fetchFunction(t){S.opts.fetchFunction= -t}static get webSocketConstructor(){return S.opts.webSocketConstructor??S.defaults.webSocketConstructor}static set webSocketConstructor(t){ -S.opts.webSocketConstructor=t}get webSocketConstructor(){return this.opts.webSocketConstructor??S.webSocketConstructor}set webSocketConstructor(t){ -this.opts.webSocketConstructor=t}static get wsProxy(){return S.opts.wsProxy??S.defaults.wsProxy}static set wsProxy(t){ -S.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy??S.wsProxy}set wsProxy(t){this.opts.wsProxy= -t}static get coalesceWrites(){return S.opts.coalesceWrites??S.defaults.coalesceWrites}static set coalesceWrites(t){ -S.opts.coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??S.coalesceWrites}set coalesceWrites(t){ -this.opts.coalesceWrites=t}static get useSecureWebSocket(){return S.opts.useSecureWebSocket??S.defaults. -useSecureWebSocket}static set useSecureWebSocket(t){S.opts.useSecureWebSocket=t}get useSecureWebSocket(){ -return this.opts.useSecureWebSocket??S.useSecureWebSocket}set useSecureWebSocket(t){this.opts.useSecureWebSocket= -t}static get forceDisablePgSSL(){return S.opts.forceDisablePgSSL??S.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){ -S.opts.forceDisablePgSSL=t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??S.forceDisablePgSSL}set forceDisablePgSSL(t){ -this.opts.forceDisablePgSSL=t}static get disableSNI(){return S.opts.disableSNI??S.defaults.disableSNI}static set disableSNI(t){ -S.opts.disableSNI=t}get disableSNI(){return this.opts.disableSNI??S.disableSNI}set disableSNI(t){this. -opts.disableSNI=t}static get disableWarningInBrowsers(){return S.opts.disableWarningInBrowsers??S.defaults. -disableWarningInBrowsers}static set disableWarningInBrowsers(t){S.opts.disableWarningInBrowsers=t}get disableWarningInBrowsers(){ -return this.opts.disableWarningInBrowsers??S.disableWarningInBrowsers}set disableWarningInBrowsers(t){ -this.opts.disableWarningInBrowsers=t}static get pipelineConnect(){return S.opts.pipelineConnect??S.defaults. -pipelineConnect}static set pipelineConnect(t){S.opts.pipelineConnect=t}get pipelineConnect(){return this. -opts.pipelineConnect??S.pipelineConnect}set pipelineConnect(t){this.opts.pipelineConnect=t}static get subtls(){ -return S.opts.subtls??S.defaults.subtls}static set subtls(t){S.opts.subtls=t}get subtls(){return this. -opts.subtls??S.subtls}set subtls(t){this.opts.subtls=t}static get pipelineTLS(){return S.opts.pipelineTLS?? -S.defaults.pipelineTLS}static set pipelineTLS(t){S.opts.pipelineTLS=t}get pipelineTLS(){return this. -opts.pipelineTLS??S.pipelineTLS}set pipelineTLS(t){this.opts.pipelineTLS=t}static get rootCerts(){return S. -opts.rootCerts??S.defaults.rootCerts}static set rootCerts(t){S.opts.rootCerts=t}get rootCerts(){return this. -opts.rootCerts??S.rootCerts}set rootCerts(t){this.opts.rootCerts=t}wsProxyAddrForHost(t,n){let i=this. +return _.opts.fetchFunction??_.defaults.fetchFunction}static set fetchFunction(t){_.opts.fetchFunction= +t}static get webSocketConstructor(){return _.opts.webSocketConstructor??_.defaults.webSocketConstructor}static set webSocketConstructor(t){ +_.opts.webSocketConstructor=t}get webSocketConstructor(){return this.opts.webSocketConstructor??_.webSocketConstructor}set webSocketConstructor(t){ +this.opts.webSocketConstructor=t}static get wsProxy(){return _.opts.wsProxy??_.defaults.wsProxy}static set wsProxy(t){ +_.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy??_.wsProxy}set wsProxy(t){this.opts.wsProxy= +t}static get coalesceWrites(){return _.opts.coalesceWrites??_.defaults.coalesceWrites}static set coalesceWrites(t){ +_.opts.coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??_.coalesceWrites}set coalesceWrites(t){ +this.opts.coalesceWrites=t}static get useSecureWebSocket(){return _.opts.useSecureWebSocket??_.defaults. +useSecureWebSocket}static set useSecureWebSocket(t){_.opts.useSecureWebSocket=t}get useSecureWebSocket(){ +return this.opts.useSecureWebSocket??_.useSecureWebSocket}set useSecureWebSocket(t){this.opts.useSecureWebSocket= +t}static get forceDisablePgSSL(){return _.opts.forceDisablePgSSL??_.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){ +_.opts.forceDisablePgSSL=t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??_.forceDisablePgSSL}set forceDisablePgSSL(t){ +this.opts.forceDisablePgSSL=t}static get disableSNI(){return _.opts.disableSNI??_.defaults.disableSNI}static set disableSNI(t){ +_.opts.disableSNI=t}get disableSNI(){return this.opts.disableSNI??_.disableSNI}set disableSNI(t){this. +opts.disableSNI=t}static get disableWarningInBrowsers(){return _.opts.disableWarningInBrowsers??_.defaults. +disableWarningInBrowsers}static set disableWarningInBrowsers(t){_.opts.disableWarningInBrowsers=t}get disableWarningInBrowsers(){ +return this.opts.disableWarningInBrowsers??_.disableWarningInBrowsers}set disableWarningInBrowsers(t){ +this.opts.disableWarningInBrowsers=t}static get pipelineConnect(){return _.opts.pipelineConnect??_.defaults. +pipelineConnect}static set pipelineConnect(t){_.opts.pipelineConnect=t}get pipelineConnect(){return this. +opts.pipelineConnect??_.pipelineConnect}set pipelineConnect(t){this.opts.pipelineConnect=t}static get subtls(){ +return _.opts.subtls??_.defaults.subtls}static set subtls(t){_.opts.subtls=t}get subtls(){return this. +opts.subtls??_.subtls}set subtls(t){this.opts.subtls=t}static get pipelineTLS(){return _.opts.pipelineTLS?? +_.defaults.pipelineTLS}static set pipelineTLS(t){_.opts.pipelineTLS=t}get pipelineTLS(){return this. +opts.pipelineTLS??_.pipelineTLS}set pipelineTLS(t){this.opts.pipelineTLS=t}static get rootCerts(){return _. +opts.rootCerts??_.defaults.rootCerts}static set rootCerts(t){_.opts.rootCerts=t}get rootCerts(){return this. +opts.rootCerts??_.rootCerts}set rootCerts(t){this.opts.rootCerts=t}wsProxyAddrForHost(t,n){let i=this. wsProxy;if(i===void 0)throw new Error("No WebSocket proxy is configured. Please see https://github.c\ om/neondatabase/serverless/blob/main/CONFIG.md#wsproxy-string--host-string-port-number--string--stri\ ng");return typeof i=="function"?i(t,n):`${i}?address=${t}:${n}`}setNoDelay(){return this}setKeepAlive(){ return this}ref(){return this}unref(){return this}connect(t,n,i){this.connecting=!0,i&&this.once("co\ nnect",i);let s=a(()=>{this.connecting=!1,this.pending=!1,this.emit("connect"),this.emit("ready")},"\ handleWebSocketOpen"),o=a((c,l=!1)=>{c.binaryType="arraybuffer",c.addEventListener("error",f=>{this. -emit("error",f),this.emit("close")}),c.addEventListener("message",f=>{if(this.tlsState===0){let y=d. +emit("error",f),this.emit("close")}),c.addEventListener("message",f=>{if(this.tlsState===0){let y=m. from(f.data);this.emit("data",y)}}),c.addEventListener("close",()=>{this.emit("close")}),l?s():c.addEventListener( "open",s)},"configureWebSocket"),u;try{u=this.wsProxyAddrForHost(n,typeof t=="string"?parseInt(t,10): t)}catch(c){this.emit("error",c),this.emit("close");return}try{let l=(this.useSecureWebSocket?"wss:": @@ -416,164 +416,164 @@ subtls.TrustedCert.databaseFromPEM(this.rootCerts),i=new this.subtls.WebSocketRe read.bind(i),o=this.rawWrite.bind(this),{read:u,write:c}=await this.subtls.startTls(t,n,s,o,{useSNI:!this. disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead=u,this.tlsWrite= c,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){ -for(;;){let t=await this.tlsRead();if(t===void 0)break;{let n=d.from(t);this.emit("data",n)}}}rawWrite(t){ +for(;;){let t=await this.tlsRead();if(t===void 0)break;{let n=m.from(t);this.emit("data",n)}}}rawWrite(t){ if(!this.coalesceWrites){this.ws&&this.ws.send(t);return}if(this.writeBuffer===void 0)this.writeBuffer= t,setTimeout(()=>{this.ws&&this.ws.send(this.writeBuffer),this.writeBuffer=void 0},0);else{let n=new Uint8Array( this.writeBuffer.length+t.length);n.set(this.writeBuffer),n.set(t,this.writeBuffer.length),this.writeBuffer= -n}}write(t,n="utf8",i=s=>{}){return t.length===0?(i(),!0):(typeof t=="string"&&(t=d.from(t,n)),this. +n}}write(t,n="utf8",i=s=>{}){return t.length===0?(i(),!0):(typeof t=="string"&&(t=m.from(t,n)),this. 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, +n,i)}):(this.tlsWrite(t),i()),!0)}end(t=m.alloc(0),n="utf8",i=()=>{}){return this.write(t,n,()=>{this. +ws.close(),i()}),this}destroy(){return this.destroyed=!0,this.end()}};a(_,"Socket"),I(_,"defaults",{ +poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{let s;return i?.jwtAuth?s=t.replace(ns,"apiauth."):s= +t.replace(ns,"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}),I(_,"opts",{});Se=_});var os={};ge(os,{parse:()=>Cr});function Cr(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(){ +n);s=decodeURIComponent(s),i=decodeURIComponent(i),l=decodeURIComponent(l);let E=i+":"+s,C=e?Object. +fromEntries(y.entries()):f;return{href:r,protocol:t,auth:E,username:i,password:s,host:o,hostname:u,port:c, +pathname:l,search:f,query:C,hash:g}}var Ir=re(()=>{"use strict";p();a(Cr,"parse")});var Wr=R(_s=>{"use strict";p();_s.parse=function(r,e){return new jr(r,e).parse()};var Kt=class Kt{constructor(e,t){ +this.source=e,this.transform=t||qu,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 Kt(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(Kt,"ArrayParser");var jr=Kt;function qu(r){return r}a(qu,"ide\ +ntity")});var Hr=R((xh,Cs)=>{p();var Qu=Wr();Cs.exports={create:a(function(r,e){return{parse:a(function(){return Qu. +parse(r,e)},"parse")}},"create")}});var Ps=R((Eh,Ts)=>{"use strict";p();var ju=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, +Wu=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Hu=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,$u=/^-?infinity$/;Ts. +exports=a(function(e){if($u.test(e))return Number(e.replace("i","I"));var t=ju.exec(e);if(!t)return Gu( +e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Is(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=Vu(e);return g!=null? +(y=new Date(Date.UTC(i,s,o,u,c,l,f)),$r(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= +new Date(i,s,o,u,c,l,f),$r(i)&&y.setFullYear(i)),y},"parseDate");function Gu(r){var e=Wu.exec(r);if(e){ +var t=parseInt(e[1],10),n=!!e[4];n&&(t=Is(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return $r( +t)&&o.setFullYear(t),o}}a(Gu,"getDate");function Vu(r){if(r.endsWith("+00"))return 0;var e=Hu.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(Vu,"timeZoneOffset");function Is(r){return-(r- +1)}a(Is,"bcYearToNegativeYear");function $r(r){return r>=0&&r<100}a($r,"is0To99")});var Bs=R((Ch,Rs)=>{p();Rs.exports=zu;var Ku=Object.prototype.hasOwnProperty;function zu(r){for(var e=1;e< +arguments.length;e++){var t=arguments[e];for(var n in t)Ku.call(t,n)&&(r[n]=t[n])}return r}a(zu,"ext\ +end")});var Fs=R((Ph,ks)=>{"use strict";p();var Yu=Bs();ks.exports=Ze;function Ze(r){if(!(this instanceof Ze)) +return new Ze(r);Yu(this,uc(r))}a(Ze,"PostgresInterval");var Ju=["seconds","minutes","hours","days", +"months","years"];Ze.prototype.toPostgres=function(){var r=Ju.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 Zu={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ +S"},Xu=["years","months","days"],ec=["hours","minutes","seconds"];Ze.prototype.toISOString=Ze.prototype. +toISO=function(){var r=Xu.map(t,this).join(""),e=ec.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+Zu[n]}};var Gr="([+-]?\\d+)",tc=Gr+"\\s+years?",rc=Gr+"\\s+mons?",nc=Gr+"\\s+days?",ic="\ +([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",sc=new RegExp([tc,rc,nc,ic].map(function(r){return"\ +("+r+")?"}).join("\\s*")),Ls={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, +oc=["hours","minutes","seconds","milliseconds"];function ac(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(ac,"parseMilliseconds");function uc(r){if(!r)return{};var e=sc.exec(r),t=e[8]==="-";return Object. +keys(Ls).reduce(function(n,i){var s=Ls[i],o=e[s];return!o||(o=i==="milliseconds"?ac(o):parseInt(o,10), +!o)||(t&&~oc.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(uc,"parse")});var Us=R((Lh,Ms)=>{"use strict";p();Ms.exports=a(function(e){if(/^\\x/.test(e))return new m(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= -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( +"\\";)i++;for(var s=0;s{p();var mt=Wr(),wt=Hr(),zt=Ps(),Os=Fs(),Ns=Us();function Yt(r){return a(function(t){ +return t===null?t:r(t)},"nullAllowed")}a(Yt,"allowNull");function qs(r){return r===null?r:r==="TRUE"|| +r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(qs,"parseBool");function cc(r){return r? +mt.parse(r,qs):null}a(cc,"parseBoolArray");function lc(r){return parseInt(r,10)}a(lc,"parseBaseTenIn\ +t");function Vr(r){return r?mt.parse(r,Yt(lc)):null}a(Vr,"parseIntegerArray");function fc(r){return r? +mt.parse(r,Yt(function(e){return Qs(e).trim()})):null}a(fc,"parseBigIntegerArray");var hc=a(function(r){ +if(!r)return null;var e=wt.create(r,function(t){return t!==null&&(t=Jr(t)),t});return e.parse()},"pa\ +rsePointArray"),Kr=a(function(r){if(!r)return null;var e=wt.create(r,function(t){return t!==null&&(t= +parseFloat(t)),t});return e.parse()},"parseFloatArray"),pe=a(function(r){if(!r)return null;var e=wt. +create(r);return e.parse()},"parseStringArray"),zr=a(function(r){if(!r)return null;var e=wt.create(r, +function(t){return t!==null&&(t=zt(t)),t});return e.parse()},"parseDateArray"),dc=a(function(r){if(!r) +return null;var e=wt.create(r,function(t){return t!==null&&(t=Os(t)),t});return e.parse()},"parseInt\ +ervalArray"),pc=a(function(r){return r?mt.parse(r,Yt(Ns)):null},"parseByteAArray"),Yr=a(function(r){ +return parseInt(r,10)},"parseInteger"),Qs=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ +parseBigInteger"),Ds=a(function(r){return r?mt.parse(r,Yt(JSON.parse)):null},"parseJsonArray"),Jr=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"),yc=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* -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{"use strict";p();var se=1e6;function wc(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%se,e=e/se>>>0,o=4294967296* +s+t,t=o/se>>>0,u=""+(o-se*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/se>>>0,u=""+(o-se*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/se>>>0,u=""+(o- +se*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var gc=$s(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,W){return E* +Math.pow(2,W)+C};var s=t>>3,o=a(function(E){return n?~E&255:E},"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. -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"),$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. -pow(1e4,L(r,16,16)),n=0,i=[],s=L(r,16),o=0;o0&&(l=i(l,o(r[f])>>8-g,g)),l},"parseBits"),Ks=a(function(r,e,t){var n=Math. +pow(2,t-1)-1,i=U(r,1),s=U(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=U(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"),bc=a(function(r){ +return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),Gs=a(function(r){return U(r,1)==1?-1*(U( +r,31,1,!0)+1):U(r,31,1)},"parseInt32"),xc=a(function(r){return Ks(r,23,8)},"parseFloat32"),Sc=a(function(r){ +return Ks(r,52,11)},"parseFloat64"),vc=a(function(r){var e=U(r,16,32);if(e==49152)return NaN;for(var t=Math. +pow(1e4,U(r,16,16)),n=0,i=[],s=U(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, +t implemented: "+l)},"parseElement"),c=a(function(l,f){var y=[],g;if(l.length>1){var E=l.shift();for(g= +0;g0},"parseBool"),_c=a(function(r){r(20,gc),r(21,bc),r(23,Gs),r(26,Gs),r(1700,vc),r(700,xc), +r(701,Sc),r(16,Ac),r(1114,Vs.bind(null,!1)),r(1184,Vs.bind(null,!0)),r(1e3,gt),r(1007,gt),r(1016,gt), +r(1008,gt),r(1009,gt),r(25,Ec)},"init");zs.exports={init:_c}});var Zs=R((Hh,Js)=>{p();Js.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 St=R(xt=>{p();var Cc=Ws(),Ic=Ys(),Tc=Hr(),Pc=Zs();xt.getTypeParser=Rc;xt.setTypeParser=Bc;xt.arrayParser= +Tc;xt.builtins=Pc;var bt={text:{},binary:{}};function Xs(r){return String(r)}a(Xs,"noParse");function Rc(r,e){ +return e=e||"text",bt[e]&&bt[e][r]||Xs}a(Rc,"getTypeParser");function Bc(r,e,t){typeof e=="function"&& +(t=e,e="text"),bt[e][r]=t}a(Bc,"setTypeParser");Cc.init(function(r,e){bt.text[r]=e});Ic.init(function(r,e){ +bt.binary[r]=e})});var Zt=R((zh,eo)=>{"use strict";p();var Lc=St();function Jt(r){this._types=r||Lc,this.text={},this.binary= +{}}a(Jt,"TypeOverrides");Jt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ +binary":return this.binary;default:return{}}};Jt.prototype.setTypeParser=function(r,e,t){typeof e=="\ +function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Jt.prototype.getTypeParser=function(r,e){return e= +e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};eo.exports=Jt});function vt(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, 3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700, 1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909, 275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222, -2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=a((I,w)=>I>>>w|I<<32- -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,le=g( -A[B-2],17)^g(A[B-2],19)^A[B-2]>>>10;A[B]=A[B-16]+j+A[B-7]+le|0}let I=e,w=t,Z=n,W=i,J=s,X=o,se=u,oe=c; -for(let B=0;B<64;B++){let j=g(J,6)^g(J,11)^g(J,25),le=J&X^~J&se,de=oe+j+le+y[B]+A[B]|0,We=g(I,2)^g(I, -13)^g(I,22),fe=I&w^I&Z^w&Z,_e=We+fe|0;oe=se,se=X,X=J,J=W+de|0,W=Z,Z=w,w=I,I=de+_e|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+se|0,c=c+oe|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& -255,C[f++]=I/4294967296&255,C[f++]=I>>>24,C[f++]=I>>>16&255,C[f++]=I>>>8&255,C[f++]=I&255,D();let w=new Uint8Array( -32);return w[0]=e>>>24,w[1]=e>>>16&255,w[2]=e>>>8&255,w[3]=e&255,w[4]=t>>>24,w[5]=t>>>16&255,w[6]=t>>> -8&255,w[7]=t&255,w[8]=n>>>24,w[9]=n>>>16&255,w[10]=n>>>8&255,w[11]=n&255,w[12]=i>>>24,w[13]=i>>>16&255, -w[14]=i>>>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\ -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. +2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=a((T,b)=>T>>>b|T<<32- +b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),W=a(()=>{for(let M=0,Z=0;M<16;M++,Z+=4)E[M]=C[Z]<< +24|C[Z+1]<<16|C[Z+2]<<8|C[Z+3];for(let M=16;M<64;M++){let Z=g(E[M-15],7)^g(E[M-15],18)^E[M-15]>>>3,ve=g( +E[M-2],17)^g(E[M-2],19)^E[M-2]>>>10;E[M]=E[M-16]+Z+E[M-7]+ve|0}let T=e,b=t,k=n,ae=i,H=s,Ce=o,le=u,ue=c; +for(let M=0;M<64;M++){let Z=g(H,6)^g(H,11)^g(H,25),ve=H&Ce^~H&le,Ie=ue+Z+ve+y[M]+E[M]|0,Le=g(T,2)^g( +T,13)^g(T,22),ke=T&b^T&k^b&k,ot=Le+ke|0;ue=le,le=Ce,Ce=H,H=ae+Ie|0,ae=k,k=b,b=T,T=Ie+ot|0}e=e+T|0,t= +t+b|0,n=n+k|0,i=i+ae|0,s=s+H|0,o=o+Ce|0,u=u+le|0,c=c+ue|0,f=0},"process"),J=a(T=>{typeof T=="string"&& +(T=new TextEncoder().encode(T));for(let b=0;b{if(C[f++]=128,f==64&&W(),f+8>64){for(;f<64;)C[f++]=0;W()}for(;f<58;)C[f++]=0;let T=l*8;C[f++]= +T/1099511627776&255,C[f++]=T/4294967296&255,C[f++]=T>>>24,C[f++]=T>>>16&255,C[f++]=T>>>8&255,C[f++]= +T&255,W();let b=new Uint8Array(32);return b[0]=e>>>24,b[1]=e>>>16&255,b[2]=e>>>8&255,b[3]=e&255,b[4]= +t>>>24,b[5]=t>>>16&255,b[6]=t>>>8&255,b[7]=t&255,b[8]=n>>>24,b[9]=n>>>16&255,b[10]=n>>>8&255,b[11]=n& +255,b[12]=i>>>24,b[13]=i>>>16&255,b[14]=i>>>8&255,b[15]=i&255,b[16]=s>>>24,b[17]=s>>>16&255,b[18]=s>>> +8&255,b[19]=s&255,b[20]=o>>>24,b[21]=o>>>16&255,b[22]=o>>>8&255,b[23]=o&255,b[24]=u>>>24,b[25]=u>>>16& +255,b[26]=u>>>8&255,b[27]=u&255,b[28]=c>>>24,b[29]=c>>>16&255,b[30]=c>>>8&255,b[31]=c&255,b},"digest"); +return r===void 0?{add:J,digest:we}:(J(r),we())}var to=re(()=>{"use strict";p();a(vt,"sha256")});var Q,Et,ro=re(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ +Length",0);I(this,"_state",new Int32Array(4));I(this,"_buffer",new ArrayBuffer(68));I(this,"_buffer8"); +I(this,"_buffer32");this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this. _buffer,0,17),this.start()}static hashByteArray(e,t=!1){return this.onePassHasher.start().appendByteArray( e).end(t)}static hashStr(e,t=!1){return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){ -return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){let t=U.hexChars,n=U.hexOut, +return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){let t=Q.hexChars,n=Q.hexOut, i,s,o,u;for(u=0;u<4;u+=1)for(s=u*8,i=e[u],o=0;o<8;o+=2)n[s+1+o]=t.charAt(i&15),i>>>=4,n[s+0+o]=t.charAt( i&15),i>>>=4;return n.join("")}static _md5cycle(e,t){let n=e[0],i=e[1],s=e[2],o=e[3];n+=(i&s|~i&o)+t[0]- 680876936|0,n=(n<<7|n>>>25)+i|0,o+=(n&i|~n&s)+t[1]-389564586|0,o=(o<<12|o>>>20)+n|0,s+=(o&n|~o&i)+t[2]+ @@ -609,147 +609,147 @@ o>>>22)+n|0,s+=(n^(o|~i))+t[10]-1051523|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~n))+t[1 0,i=(i<<21|i>>>11)+s|0,n+=(s^(i|~o))+t[4]-145523070|0,n=(n<<6|n>>>26)+i|0,o+=(i^(n|~s))+t[11]-1120210379| 0,o=(o<<10|o>>>22)+n|0,s+=(n^(o|~i))+t[2]+718787259|0,s=(s<<15|s>>>17)+o|0,i+=(o^(s|~n))+t[9]-343485551| 0,i=(i<<21|i>>>11)+s|0,e[0]=n+e[0]|0,e[1]=i+e[1]|0,e[2]=s+e[2]|0,e[3]=o+e[3]|0}start(){return this._dataLength= -0,this._bufferLength=0,this._state.set(U.stateIdentity),this}appendStr(e){let t=this._buffer8,n=this. +0,this._bufferLength=0,this._state.set(Q.stateIdentity),this}appendStr(e){let t=this._buffer8,n=this. _buffer32,i=this._bufferLength,s,o;for(o=0;o>>6)+192,t[i++]=s&63|128;else if(s<55296||s>56319)t[i++]=(s>>>12)+224,t[i++]=s>>>6&63| 128,t[i++]=s&63|128;else{if(s=(s-55296)*1024+(e.charCodeAt(++o)-56320)+65536,s>1114111)throw new Error( "Unicode standard supports code points up to U+10FFFF");t[i++]=(s>>>18)+240,t[i++]=s>>>12&63|128,t[i++]= -s>>>6&63|128,t[i++]=s&63|128}i>=64&&(this._dataLength+=64,U._md5cycle(this._state,n),i-=64,n[0]=n[16])} +s>>>6&63|128,t[i++]=s&63|128}i>=64&&(this._dataLength+=64,Q._md5cycle(this._state,n),i-=64,n[0]=n[16])} return this._bufferLength=i,this}appendAsciiStr(e){let t=this._buffer8,n=this._buffer32,i=this._bufferLength, s,o=0;for(;;){for(s=Math.min(e.length-o,64-i);s--;)t[i++]=e.charCodeAt(o++);if(i<64)break;this._dataLength+= -64,U._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}appendByteArray(e){let t=this._buffer8, +64,Q._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}appendByteArray(e){let t=this._buffer8, n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(e.length-o,64-i);s--;)t[i++]=e[o++]; -if(i<64)break;this._dataLength+=64,U._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}getState(){ +if(i<64)break;this._dataLength+=64,Q._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}getState(){ let e=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this. _bufferLength,length:this._dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){let t=e.buffer,n=e.state, i=this._state,s;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=n[0],i[1]=n[1],i[2]=n[2], i[3]=n[3],s=0;s>2)+1;this._dataLength+=t;let o=this._dataLength*8;if(n[t]=128,n[t+1]= -n[t+2]=n[t+3]=0,i.set(U.buffer32Identity.subarray(s),s),t>55&&(U._md5cycle(this._state,i),i.set(U.buffer32Identity)), +n[t+2]=n[t+3]=0,i.set(Q.buffer32Identity.subarray(s),s),t>55&&(Q._md5cycle(this._state,i),i.set(Q.buffer32Identity)), o<=4294967295)i[14]=o;else{let u=o.toString(16).match(/(.*?)(.{0,8})$/);if(u===null)return;let c=parseInt( -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(`\ +u[2],16),l=parseInt(u[1],16)||0;i[14]=c,i[15]=l}return Q._md5cycle(this._state,i),e?this._state:Q._hex( +this._state)}};a(Q,"Md5"),I(Q,"stateIdentity",new Int32Array([1732584193,-271733879,-1732584194,271733878])), +I(Q,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),I(Q,"hexChars","0123456789\ +abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);Et=Q});var Zr={};ge(Zr,{createHash:()=>Fc,createHmac:()=>Mc,randomBytes:()=>kc});function kc(r){return crypto. +getRandomValues(m.alloc(r))}function Fc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( +function(){return m.from(vt(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 Mc(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=vt(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: -m.env.USER,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4, +64);o.set(i,0),o.set(t,64);let u=new Uint8Array(96);return u.set(s,0),u.set(vt(o),64),m.from(vt(u))}, +"digest")}},"update")}}var Xr=re(()=>{"use strict";p();to();ro();a(kc,"randomBytes");a(Fc,"createHas\ +h");a(Mc,"createHmac")});var At=R((ud,en)=>{"use strict";p();en.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: +w.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 Xe=St(),Uc=Xe.getTypeParser(20,"text"),Dc=Xe.getTypeParser(1016, +"text");en.exports.__defineSetter__("parseInt8",function(r){Xe.setTypeParser(20,"text",r?Xe.getTypeParser( +23,"text"):Uc),Xe.setTypeParser(1016,"text",r?Xe.getTypeParser(1007,"text"):Dc)})});var _t=R((ld,io)=>{"use strict";p();var Oc=(Xr(),G(Zr)),Nc=At();function qc(r){var e=r.replace(/\\/g, +"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(qc,"escapeElement");function no(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+no(r[t]): +r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=qc(Xt(r[t]));return e=e+"}",e}a(no,"arrayString"); +var Xt=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. 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?Nc.parseInputDatesAsUTC?Wc(r):jc(r):Array.isArray(r)?no(r):typeof r== +"object"?Qc(r,e):r.toString()},"prepareValue");function Qc(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(Hc,"normalizeQueryConfig");var tn=a(function(r){return Oc.createHash("md5").update(r,"utf-8"). +digest("hex")},"md5"),$c=a(function(r,e,t){var n=tn(e+r),i=tn(m.concat([m.from(n),t]));return"md5"+i}, +"postgresMd5PasswordHash");io.exports={prepareValue:a(function(e){return Xt(e)},"prepareValueWrapper"), +normalizeQueryConfig:Hc,postgresMd5PasswordHash:$c,md5:tn}});var Ct={};ge(Ct,{default:()=>Jc});var Jc,It=re(()=>{"use strict";p();Jc={}});var wo=R((Ad,mo)=>{"use strict";p();var nn=(Xr(),G(Zr));function Zc(r){if(r.indexOf("SCRAM-SHA-256")=== +-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=nn.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(Zc,"startSession");function Xc(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=rl(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=m.from(n.salt,"base64"),s=sl(e,i,n.iteration),o=et(s,"Client Key"),u=il( 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=et(u,y),E=yo(o,g),C=E.toString("base64"),W=et(s,"Server Key"),J=et(W,y);r.message="SAS\ +LResponse",r.serverSignature=J.toString("base64"),r.response=f+",p="+C}a(Xc,"continueSession");function el(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}=nl( 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(el,"finalizeSession");function tl(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(tl,"isPrintableChars");function ho(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(r)}a(ho,"isBase64");function po(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(po,"parseAttribute\ +Pairs");function rl(r){let e=po(r),t=e.get("r");if(t){if(!tl(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(!ho(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(rl,"parseServerFirstMessage"); +function nl(r){let t=po(r).get("v");if(t){if(!ho(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. -isBuffer(r))throw new TypeError("first argument must be a Buffer");if(!d.isBuffer(e))throw new TypeError( +signature is missing");return{serverSignature:t}}a(nl,"parseServerFinalMessage");function yo(r,e){if(!m. +isBuffer(r))throw new TypeError("first argument must be a Buffer");if(!m.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){ -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;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 +h");if(r.length===0)throw new Error("Buffers cannot be empty");return m.from(r.map((t,n)=>r[n]^e[n]))} +a(yo,"xorBuffers");function il(r){return nn.createHash("sha256").update(r).digest()}a(il,"sha256");function et(r,e){ +return nn.createHmac("sha256",r).update(e).digest()}a(et,"hmacSha256");function sl(r,e,t){for(var n=et( +r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sol});function ol(...r){return r.join("/")}var on=re(()=>{"use strict";p(); +a(ol,"join")});var an={};ge(an,{stat:()=>al});function al(r,e){e(new Error("No filesystem"))}var un=re(()=>{"use st\ +rict";p();a(al,"stat")});var cn={};ge(cn,{default:()=>ul});var ul,ln=re(()=>{"use strict";p();ul={}});var go={};ge(go,{StringDecoder:()=>fn});var hn,fn,bo=re(()=>{"use strict";p();hn=class hn{constructor(e){ +I(this,"td");this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this. +td.decode(e)}};a(hn,"StringDecoder");fn=hn});var Eo=R((Fd,vo)=>{"use strict";p();var{Transform:cl}=(ln(),G(cn)),{StringDecoder:ll}=(bo(),G(go)),Re=Symbol( +"last"),tr=Symbol("decoder");function fl(r,e,t){let n;if(this.overflow){if(n=this[tr].write(r).split( +this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Re]+=this[tr].write(r),n= +this[Re].split(this.matcher);this[Re]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( +"maximum buffer reached"));return}t()}a(fl,"transform");function hl(r){if(this[Re]+=this[tr].end(),this[Re]) +try{So(this,this.mapper(this[Re]))}catch(e){return r(e)}r()}a(hl,"flush");function So(r,e){e!==void 0&& +r.push(e)}a(So,"push");function xo(r){return r}a(xo,"noop");function dl(r,e,t){switch(r=r||/\r?\n/,e= +e||xo,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=xo)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=fl,t.flush=hl,t.readableObjectMode= +!0;let n=new cl(t);return n[Re]="",n[tr]=new ll("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( -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= +!1,s(i)},n}a(dl,"split");vo.exports=dl});var Co=R((Dd,_e)=>{"use strict";p();var Ao=(on(),G(sn)),pl=(ln(),G(cn)).Stream,yl=Eo(),_o=(It(),G(Ct)), +ml=5432,rr=w.platform==="win32",Tt=w.stderr,wl=56,gl=7,bl=61440,xl=32768;function Sl(r){return(r&bl)== +xl}a(Sl,"isRegFile");var tt=["host","port","database","user","password"],dn=tt.length,vl=tt[dn-1];function pn(){ +var r=Tt instanceof pl&&Tt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +`);Tt.write(_o.format.apply(_o,e))}}a(pn,"warn");Object.defineProperty(_e.exports,"isWin",{get:a(function(){ +return rr},"get"),set:a(function(r){rr=r},"set")});_e.exports.warnTo=function(r){var e=Tt;return Tt= +r,e};_e.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(rr?Ao.join(e.APPDATA||"./","\ +postgresql","pgpass.conf"):Ao.join(e.HOME||"./",".pgpass"));return t};_e.exports.usePgPass=function(r,e){ +return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:rr?!0:(e=e||"",Sl(r.mode)?r. +mode&(wl|gl)?(pn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ +(0600) or less',e),!1):!0:(pn('WARNING: password file "%s" is not a plain file',e),!1))};var El=_e.exports. +match=function(r,e){return tt.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||ml)===Number( +e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};_e.exports.getPassword=function(r,e,t){var n,i=e.pipe( +yl());function s(c){var l=Al(c);l&&_l(l)&&El(r,l)&&(n=l[vl],i.end())}a(s,"onLine");var o=a(function(){ +e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),pn("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 Al=_e.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> +function(f,y,g){var E=r.substring(y,g);Object.hasOwnProperty.call(w.env,"PGPASS_NO_DEESCAPE")||(E=E. +replace(/\\([:\\])/g,"$1")),o[tt[f]]=E},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). +length===dn?o:null,o},_l=_e.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 qd=(on(),G(sn)),Io=(un(),G(an)),nr=Co();yn.exports=function(r,e){ +var t=nr.getFileName();Io.stat(t,function(n,i){if(n||!nr.usePgPass(i,t))return e(void 0);var s=Io.createReadStream( +t);nr.getPassword(r,s,e)})};yn.exports.warnTo=nr.warnTo});var Po={};ge(Po,{default:()=>Cl});var Cl,Ro=re(()=>{"use strict";p();Cl={}});var Lo=R((Hd,Bo)=>{"use strict";p();var Il=(Ir(),G(os)),mn=(un(),G(an));function wn(r){if(r.charAt(0)=== +"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Il.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,54 +757,54 @@ 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=mn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=mn.readFileSync(t.sslkey).toString()), +t.sslrootcert&&(t.ssl.ca=mn.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(wn,"parse");Bo.exports=wn;wn.parse=wn});var ir=R((Vd,Mo)=>{"use strict";p();var Tl=(Ro(),G(Po)),Fo=At(),ko=Lo().parse,te=a(function(r,e,t){return t=== +void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Fo[r]},"val"),Pl=a(function(){switch(w. 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){ -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. -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"&& -(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= -H("fallback_application_name",e,!1),this.statement_timeout=H("statement_timeout",e,!1),this.lock_timeout= -H("lock_timeout",e,!1),this.idle_in_transaction_session_timeout=H("idle_in_transaction_session_timeo\ -ut",e,!1),this.query_timeout=H("query_timeout",e,!1),e.connectionTimeoutMillis===void 0?this.connect_timeout= -m.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/1e3),e.keepAlive=== -!1?this.keepalives=0:e.keepAlive===!0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis=="nu\ -mber"&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){ -var t=[];ne(t,this,"user"),ne(t,this,"password"),ne(t,this,"port"),ne(t,this,"application_name"),ne( -t,this,"fallback_application_name"),ne(t,this,"connect_timeout"),ne(t,this,"options");var n=typeof this. -ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(ne(t,n,"sslmode"),ne(t,n,"sslca"),ne(t,n,"s\ -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){ +no-verify":return{rejectUnauthorized:!1}}return Fo.ssl},"readSSLConfigFromEnvironment"),rt=a(function(r){ +return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),me=a(function(r,e,t){ +var n=e[t];n!=null&&r.push(t+"="+rt(n))},"add"),bn=class bn{constructor(e){e=typeof e=="string"?ko(e): +e||{},e.connectionString&&(e=Object.assign({},e,ko(e.connectionString))),this.user=te("user",e),this. +database=te("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(te("p\ +ort",e),10),this.host=te("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, +writable:!0,value:te("password",e)}),this.binary=te("binary",e),this.options=te("options",e),this.ssl= +typeof e.ssl>"u"?Pl():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=te("client_encoding",e),this.replication=te("replication", +e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=te("application_name",e,"\ +PGAPPNAME"),this.fallback_application_name=te("fallback_application_name",e,!1),this.statement_timeout= +te("statement_timeout",e,!1),this.lock_timeout=te("lock_timeout",e,!1),this.idle_in_transaction_session_timeout= +te("idle_in_transaction_session_timeout",e,!1),this.query_timeout=te("query_timeout",e,!1),e.connectionTimeoutMillis=== +void 0?this.connect_timeout=w.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/ +1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive===!0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis== +"number"&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){ +var t=[];me(t,this,"user"),me(t,this,"password"),me(t,this,"port"),me(t,this,"application_name"),me( +t,this,"fallback_application_name"),me(t,this,"connect_timeout"),me(t,this,"options");var n=typeof this. +ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(me(t,n,"sslmode"),me(t,n,"sslca"),me(t,n,"s\ +slkey"),me(t,n,"sslcert"),me(t,n,"sslrootcert"),this.database&&t.push("dbname="+rt(this.database)),this. +replication&&t.push("replication="+rt(this.replication)),this.host&&t.push("host="+rt(this.host)),this. +isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+rt(this.client_encoding)), +Tl.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+rt(s)),e(null,t.join(" ")))})}}; +a(bn,"ConnectionParameters");var gn=bn;Mo.exports=gn});var Oo=R((Yd,Do)=>{"use strict";p();var Rl=St(),Uo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,Sn=class Sn{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=Uo.exec(e.text):t=Uo.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]=Rl.getTypeParser(n.dataTypeID,n. +format||"text")}}};a(Sn,"Result");var xn=Sn;Do.exports=xn});var jo=R((Xd,Qo)=>{"use strict";p();var{EventEmitter:Bl}=Pe(),No=Oo(),qo=_t(),En=class En extends Bl{constructor(e,t,n){ +super(),e=qo.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= +this._rowMode=e.rowMode,w.domain&&e.callback&&(this.callback=w.domain.bind(e.callback)),this._result= +new No(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 No(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&& @@ -812,7 +812,7 @@ this._result.addRow(t)}}handleCommandComplete(e,t){this._checkForMultirow(),this e),this.rows&&t.sync()}handleEmptyQuery(e){this.rows&&e.sync()}handleError(e,t){if(this._canceledDueToError&& (e=this._canceledDueToError,this._canceledDueToError=!1),this.callback)return this.callback(e);this. emit("error",e)}handleReadyForQuery(e){if(this._canceledDueToError)return this.handleError(this._canceledDueToError, -e);if(this.callback)try{this.callback(null,this._results)}catch(t){m.nextTick(()=>{throw t})}this.emit( +e);if(this.callback)try{this.callback(null,this._results)}catch(t){w.nextTick(()=>{throw t})}this.emit( "end",this._results)}submit(e){if(typeof this.text!="string"&&typeof this.name!="string")return new Error( "A query must have either text or a name. Supplying neither is unsupported.");let t=e.parsedStatements[this. name];return this.text&&t&&this.text!==t?new Error(`Prepared statements must be unique - '${this.name}\ @@ -821,148 +821,148 @@ 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:qo.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= -_.CommandCompleteMessage=_.ReadyForQueryMessage=_.NotificationResponseMessage=_.BackendKeyDataMessage= -_.AuthenticationMD5Password=_.ParameterStatusMessage=_.ParameterDescriptionMessage=_.RowDescriptionMessage= -_.Field=_.CopyResponse=_.CopyDataMessage=_.DatabaseError=_.copyDone=_.emptyQuery=_.replicationStart= -_.portalSuspended=_.noData=_.closeComplete=_.bindComplete=_.parseComplete=void 0;_.parseComplete={name:"\ -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){ -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( +e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(En,"Query");var vn=En;Qo.exports= +vn});var Zn=R(P=>{"use strict";p();Object.defineProperty(P,"__esModule",{value:!0});P.NoticeMessage=P.DataRowMessage= +P.CommandCompleteMessage=P.ReadyForQueryMessage=P.NotificationResponseMessage=P.BackendKeyDataMessage= +P.AuthenticationMD5Password=P.ParameterStatusMessage=P.ParameterDescriptionMessage=P.RowDescriptionMessage= +P.Field=P.CopyResponse=P.CopyDataMessage=P.DatabaseError=P.copyDone=P.emptyQuery=P.replicationStart= +P.portalSuspended=P.noData=P.closeComplete=P.bindComplete=P.parseComplete=void 0;P.parseComplete={name:"\ +parseComplete",length:5};P.bindComplete={name:"bindComplete",length:5};P.closeComplete={name:"closeC\ +omplete",length:5};P.noData={name:"noData",length:5};P.portalSuspended={name:"portalSuspended",length:5}; +P.replicationStart={name:"replicationStart",length:4};P.emptyQuery={name:"emptyQuery",length:4};P.copyDone= +{name:"copyDone",length:4};var On=class On extends Error{constructor(e,t,n){super(e),this.length=t,this. +name=n}};a(On,"DatabaseError");var An=On;P.DatabaseError=An;var Nn=class Nn{constructor(e,t){this.length= +e,this.chunk=t,this.name="copyData"}};a(Nn,"CopyDataMessage");var _n=Nn;P.CopyDataMessage=_n;var qn=class qn{constructor(e,t,n,i){ +this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(qn,"CopyResponse");var Cn=qn; +P.CopyResponse=Cn;var Qn=class Qn{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(Qn,"Field");var In=Qn; +P.Field=In;var jn=class jn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ +n",this.fields=new Array(this.fieldCount)}};a(jn,"RowDescriptionMessage");var Tn=jn;P.RowDescriptionMessage= +Tn;var Wn=class Wn{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ +ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(Wn,"ParameterDescriptionMessage");var Pn=Wn; +P.ParameterDescriptionMessage=Pn;var Hn=class Hn{constructor(e,t,n){this.length=e,this.parameterName= +t,this.parameterValue=n,this.name="parameterStatus"}};a(Hn,"ParameterStatusMessage");var Rn=Hn;P.ParameterStatusMessage= +Rn;var $n=class $n{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; +a($n,"AuthenticationMD5Password");var Bn=$n;P.AuthenticationMD5Password=Bn;var Gn=class Gn{constructor(e,t,n){ +this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Gn,"BackendKeyDataMes\ +sage");var Ln=Gn;P.BackendKeyDataMessage=Ln;var Vn=class Vn{constructor(e,t,n,i){this.length=e,this. +processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(Vn,"NotificationResponseMessa\ +ge");var kn=Vn;P.NotificationResponseMessage=kn;var Kn=class Kn{constructor(e,t){this.length=e,this. +status=t,this.name="readyForQuery"}};a(Kn,"ReadyForQueryMessage");var Fn=Kn;P.ReadyForQueryMessage=Fn; +var zn=class zn{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(zn,"Comma\ +ndCompleteMessage");var Mn=zn;P.CommandCompleteMessage=Mn;var Yn=class Yn{constructor(e,t){this.length= +e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(Yn,"DataRowMessage");var Un=Yn;P.DataRowMessage= +Un;var Jn=class Jn{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(Jn,"NoticeMe\ +ssage");var Dn=Jn;P.NoticeMessage=Dn});var Wo=R(sr=>{"use strict";p();Object.defineProperty(sr,"__esModule",{value:!0});sr.Writer=void 0;var ei=class ei{constructor(e=256){ +this.size=e,this.offset=5,this.headerPosition=0,this.buffer=m.allocUnsafe(e)}ensure(e){if(this.buffer. +length-this.offset>1)+e;this.buffer=m.allocUnsafe(i),n.copy( this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this. offset++]=e>>>16&255,this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addInt16(e){ return this.ensure(2),this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addCString(e){ -if(!e)this.ensure(1);else{let t=d.byteLength(e);this.ensure(t+1),this.buffer.write(e,this.offset,"ut\ -f-8"),this.offset+=t}return this.buffer[this.offset++]=0,this}addString(e=""){let t=d.byteLength(e); +if(!e)this.ensure(1);else{let t=m.byteLength(e);this.ensure(t+1),this.buffer.write(e,this.offset,"ut\ +f-8"),this.offset+=t}return this.buffer[this.offset++]=0,this}addString(e=""){let t=m.byteLength(e); return this.ensure(t),this.buffer.write(e,this.offset),this.offset+=t,this}add(e){return this.ensure( 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( -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|| +headerPosition=0,this.buffer=m.allocUnsafe(this.size),t}};a(ei,"Writer");var Xn=ei;sr.Writer=Xn});var $o=R(ar=>{"use strict";p();Object.defineProperty(ar,"__esModule",{value:!0});ar.serialize=void 0; +var ti=Wo(),D=new ti.Writer,Ll=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( +n).addCString(r[n]);D.addCString("client_encoding").addCString("UTF8");let e=D.addCString("").flush(), +t=e.length+4;return new ti.Writer().addInt32(t).add(e).flush()},"startup"),kl=a(()=>{let r=m.allocUnsafe( +8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Fl=a(r=>D.addCString(r).flush( +112),"password"),Ml=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. +flush(112)},"sendSASLInitialResponseMessage"),Ul=a(function(r){return D.addString(r).flush(112)},"se\ +ndSCRAMClientFinalMessage"),Dl=a(r=>D.addCString(r).flush(81),"query"),Ho=[],Ol=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< -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( -(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. +xecuting queries"));let t=r.types||Ho,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< +n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),nt=new ti.Writer,Nl=a(function(r,e){for(let t=0;t< +r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),nt.addInt32(-1)):n instanceof m?(D.addInt16( +1),nt.addInt32(n.length),nt.add(n)):(D.addInt16(0),nt.addInt32(m.byteLength(n)),nt.addString(n))}},"\ +writeValues"),ql=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Ho,s=i.length; +return D.addCString(e).addCString(t),D.addInt16(s),Nl(i,r.valueMapper),D.addInt16(s),D.add(nt.flush()), +D.addInt16(n?1:0),D.flush(66)},"bind"),Ql=m.from([69,0,0,0,9,0,0,0,0,0]),jl=a(r=>{if(!r||!r.portal&& +!r.rows)return Ql;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Wl=a( +(r,e)=>{let t=m.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"),ri=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. 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\ +Hl=D.addCString("P").flush(68),$l=D.addCString("S").flush(68),Gl=a(r=>r.name?ri(68,`${r.type}${r.name|| +""}`):r.type==="P"?Hl:$l,"describe"),Vl=a(r=>{let e=`${r.type}${r.name||""}`;return ri(67,e)},"close"), +Kl=a(r=>D.add(r).flush(100),"copyData"),zl=a(r=>ri(102,r),"copyFail"),or=a(r=>m.from([r,0,0,0,4]),"c\ +odeOnlyBuffer"),Yl=or(72),Jl=or(83),Zl=or(88),Xl=or(99),ef={startup:Ll,password:Fl,requestSsl:kl,sendSASLInitialResponseMessage:Ml, +sendSCRAMClientFinalMessage:Ul,query:Dl,parse:Ol,bind:ql,execute:jl,describe:Gl,close:Vl,flush:a(()=>Yl, +"flush"),sync:a(()=>Jl,"sync"),end:a(()=>Zl,"end"),copyData:Kl,copyDone:a(()=>Xl,"copyDone"),copyFail:zl, +cancel:Wl};ar.serialize=ef});var Go=R(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.BufferReader=void 0; +var tf=m.allocUnsafe(0),ii=class ii{constructor(e=0){this.offset=e,this.buffer=tf,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(ii,"BufferReader");var ni=ii;ur.BufferReader=ni});var zo=R(cr=>{"use strict";p();Object.defineProperty(cr,"__esModule",{value:!0});cr.Parser=void 0;var O=Zn(), +rf=Go(),si=1,nf=4,Vo=si+nf,Ko=m.allocUnsafe(0),ai=class ai{constructor(e){if(this.buffer=Ko,this.bufferLength= +0,this.bufferOffset=0,this.reader=new rf.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. -buffer=$s,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=n-i,this.bufferOffset=i)}mergeBuffer(e){ +this.bufferLength,i=this.bufferOffset;for(;i+Vo<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( +i+si),u=si+o;if(u+i<=n){let c=this.handlePacket(i+Vo,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. +buffer=Ko,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. -buffer.byteLength*2;for(;t>=s;)s*=2;i=d.allocUnsafe(s)}this.buffer.copy(i,0,this.bufferOffset,this.bufferOffset+ +buffer.byteLength*2;for(;t>=s;)s*=2;i=m.allocUnsafe(s)}this.buffer.copy(i,0,this.bufferOffset,this.bufferOffset+ this.bufferLength),this.buffer=i,this.bufferOffset=0}e.copy(this.buffer,this.bufferOffset+this.bufferLength), this.bufferLength=t}else this.buffer=e,this.bufferOffset=0,this.bufferLength=e.byteLength}handlePacket(e,t,n,i){ -switch(t){case 50:return k.bindComplete;case 49:return k.parseComplete;case 51:return k.closeComplete;case 110: -return k.noData;case 115:return k.portalSuspended;case 99:return k.copyDone;case 87:return k.replicationStart;case 73: -return k.emptyQuery;case 68:return this.parseDataRowMessage(e,n,i);case 67:return this.parseCommandCompleteMessage( +switch(t){case 50:return O.bindComplete;case 49:return O.parseComplete;case 51:return O.closeComplete;case 110: +return O.noData;case 115:return O.portalSuspended;case 99:return O.copyDone;case 87:return O.replicationStart;case 73: +return O.emptyQuery;case 68:return this.parseDataRowMessage(e,n,i);case 67:return this.parseCommandCompleteMessage( e,n,i);case 90:return this.parseReadyForQueryMessage(e,n,i);case 65:return this.parseNotificationMessage( e,n,i);case 82:return this.parseAuthenticationResponse(e,n,i);case 83:return this.parseParameterStatusMessage( e,n,i);case 75:return this.parseBackendKeyData(e,n,i);case 69:return this.parseErrorMessage(e,n,i,"e\ rror");case 78:return this.parseErrorMessage(e,n,i,"notice");case 84:return this.parseRowDescriptionMessage( e,n,i);case 116:return this.parseParameterDescriptionMessage(e,n,i);case 71:return this.parseCopyInMessage( e,n,i);case 72:return this.parseCopyOutMessage(e,n,i);case 100:return this.parseCopyData(e,n,i);default: -return new k.DatabaseError("received invalid response: "+t.toString(16),n,"error")}}parseReadyForQueryMessage(e,t,n){ -this.reader.setBuffer(e,n);let i=this.reader.string(1);return new k.ReadyForQueryMessage(t,i)}parseCommandCompleteMessage(e,t,n){ -this.reader.setBuffer(e,n);let i=this.reader.cstring();return new k.CommandCompleteMessage(t,i)}parseCopyData(e,t,n){ -let i=n.slice(e,e+(t-4));return new k.CopyDataMessage(t,i)}parseCopyInMessage(e,t,n){return this.parseCopyMessage( +return new O.DatabaseError("received invalid response: "+t.toString(16),n,"error")}}parseReadyForQueryMessage(e,t,n){ +this.reader.setBuffer(e,n);let i=this.reader.string(1);return new O.ReadyForQueryMessage(t,i)}parseCommandCompleteMessage(e,t,n){ +this.reader.setBuffer(e,n);let i=this.reader.cstring();return new O.CommandCompleteMessage(t,i)}parseCopyData(e,t,n){ +let i=n.slice(e,e+(t-4));return new O.CopyDataMessage(t,i)}parseCopyInMessage(e,t,n){return this.parseCopyMessage( e,t,n,"copyInResponse")}parseCopyOutMessage(e,t,n){return this.parseCopyMessage(e,t,n,"copyOutRespon\ se")}parseCopyMessage(e,t,n,i){this.reader.setBuffer(e,n);let s=this.reader.byte()!==0,o=this.reader. -int16(),u=new k.CopyResponse(t,i,s,o);for(let c=0;c{"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(ai,"Parser");var oi=ai;cr.Parser=oi});var ui=R(Be=>{"use strict";p();Object.defineProperty(Be,"__esModule",{value:!0});Be.DatabaseError=Be. +serialize=Be.parse=void 0;var sf=Zn();Object.defineProperty(Be,"DatabaseError",{enumerable:!0,get:a( +function(){return sf.DatabaseError},"get")});var of=$o();Object.defineProperty(Be,"serialize",{enumerable:!0, +get:a(function(){return of.serialize},"get")});var af=zo();function uf(r,e){let t=new af.Parser;return r. +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(uf,"parse");Be.parse=uf});var Yo={};ge(Yo,{connect:()=>cf});function cf({socket:r,servername:e}){return r.startTls(e),r}var Jo=re( +()=>{"use strict";p();a(cf,"connect")});var fi=R((vp,ea)=>{"use strict";p();var Zo=(Ve(),G(ss)),lf=Pe().EventEmitter,{parse:ff,serialize:z}=ui(), +Xo=z.flush(),hf=z.sync(),df=z.end(),li=class li extends lf{constructor(e){super(),e=e||{},this.stream= +e.stream||new Zo.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,36 +972,36 @@ 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=(Jo(),G(Yo));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= +n.ssl.key)),Zo.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&& -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. +"end",()=>{this.emit("end")}),ff(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& +this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(z.requestSsl())}startup(e){this. +stream.write(z.startup(e))}cancel(e,t){this._send(z.cancel(e,t))}password(e){this._send(z.password(e))}sendSASLInitialResponseMessage(e,t){ +this._send(z.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(z.sendSCRAMClientFinalMessage( +e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(z.query(e))}parse(e){ +this._send(z.parse(e))}bind(e){this._send(z.bind(e))}execute(e){this._send(z.execute(e))}flush(){this. +stream.writable&&this.stream.write(Xo)}sync(){this._ending=!0,this._send(Xo),this._send(hf)}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. -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.stream.end();return}return this.stream.write(df,()=>{this.stream.end()})}close(e){this._send(z. +close(e))}describe(e){this._send(z.describe(e))}sendCopyFromChunk(e){this._send(z.copyData(e))}endCopyFrom(){ +this._send(z.copyDone())}sendCopyFail(e){this._send(z.copyFail(e))}};a(li,"Connection");var ci=li;ea. +exports=ci});var na=R((Cp,ra)=>{"use strict";p();var pf=Pe().EventEmitter,_p=(It(),G(Ct)),yf=_t(),hi=wo(),mf=To(), +wf=Zt(),gf=ir(),ta=jo(),bf=At(),xf=fi(),di=class di extends pf{constructor(e){super(),this.connectionParameters= +new gf(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.replication=this.connectionParameters.replication;var t=e||{};this._Promise=t.Promise||S.Promise, +this._types=new wf(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= +!1,this._queryable=!0,this.connection=t.connection||new xf({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||bf.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"); +0}_errorAllQueries(e){let t=a(n=>{w.nextTick(()=>{n.handleError(e,this.connection)})},"enqueueError"); this.activeQuery&&(t(this.activeQuery),this.activeQuery=null),this.queryQueue.forEach(t),this.queryQueue. length=0}_connect(e){var t=this,n=this.connection;if(this._connectionCallback=e,this._connecting||this. -_connected){let i=new Error("Client has already been connected. You cannot reuse a client.");m.nextTick( +_connected){let i=new Error("Client has already been connected. You cannot reuse a client.");w.nextTick( ()=>{e(i)});return}this._connecting=!0,this.connectionTimeoutHandle,this._connectionTimeoutMillis>0&& (this.connectionTimeoutHandle=setTimeout(()=>{n._ending=!0,n.stream.destroy(new Error("timeout expir\ ed"))},this._connectionTimeoutMillis)),this.host&&this.host.indexOf("/")===0?n.connect(this.host+"/.\ @@ -1010,7 +1010,7 @@ startup(t.getStartupConf())}),n.on("sslconnect",function(){n.startup(t.getStartu n),n.once("end",()=>{let i=this._ending?new Error("Connection terminated"):new Error("Connection ter\ minated unexpectedly");clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(i),this._ending|| (this._connecting&&!this._connectionError?this._connectionCallback?this._connectionCallback(i):this. -_handleErrorEvent(i):this._connectionError||this._handleErrorEvent(i)),m.nextTick(()=>{this.emit("en\ +_handleErrorEvent(i):this._connectionError||this._handleErrorEvent(i)),w.nextTick(()=>{this.emit("en\ d")})})}connect(e){if(e){this._connect(e);return}return new this._Promise((t,n)=>{this._connect(i=>{ i?n(i):t()})})}_attachListeners(e){e.on("authenticationCleartextPassword",this._handleAuthCleartextPassword. bind(this)),e.on("authenticationMD5Password",this._handleAuthMD5Password.bind(this)),e.on("authentic\ @@ -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():mf(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=yf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ +this._checkPgPass(()=>{this.saslSession=hi.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( +this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){hi.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){hi.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; @@ -1062,39 +1062,39 @@ return this._types.setTypeParser(e,t,n)}getTypeParser(e,t){return this._types.ge return'"'+e.replace(/"/g,'""')+'"'}escapeLiteral(e){for(var t=!1,n="'",i=0;i{this.activeQuery. +!1,this.hasExecuted=!0;let e=this.activeQuery.submit(this.connection);e&&w.nextTick(()=>{this.activeQuery. handleError(e,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&& (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= -(y,g)=>y?f(y):l(g)}))),o&&(c=i.callback,u=setTimeout(()=>{var l=new Error("Query read timeout");m.nextTick( +connectionParameters.query_timeout,i=new ta(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");w.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)}), this.binary&&!i.binary&&(i.binary=!0),i._result&&!i._result._types&&(i._result._types=this._types),this. -_queryable?this._ending?(m.nextTick(()=>{i.handleError(new Error("Client was closed and is not query\ -able"),this.connection)}),s):(this.queryQueue.push(i),this._pulseQueryQueue(),s):(m.nextTick(()=>{i. +_queryable?this._ending?(w.nextTick(()=>{i.handleError(new Error("Client was closed and is not query\ +able"),this.connection)}),s):(this.queryQueue.push(i),this._pulseQueryQueue(),s):(w.nextTick(()=>{i. handleError(new Error("Client has encountered a connection error and is not queryable"),this.connection)}), 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(di,"Client");var lr=di;lr.Query=ta;ra.exports=lr});var aa=R((Pp,oa)=>{"use strict";p();var Sf=Pe().EventEmitter,ia=a(function(){},"NOOP"),sa=a((r,e)=>{ +let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),mi=class mi{constructor(e,t,n){ +this.client=e,this.idleListener=t,this.timeoutId=n}};a(mi,"IdleItem");var pi=mi,wi=class wi{constructor(e){ +this.callback=e}};a(wi,"PendingItem");var it=wi;function vf(){throw new Error("Release called on cli\ +ent which has already been released to the pool.")}a(vf,"throwOnDoubleRelease");function fr(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(fr,"promisify"); +function Ef(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(Ef,"makeIdleListener");var gi=class gi extends Sf{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.options.Promise||b.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this.options.idleTimeoutMillis= +this.log=this.options.log||function(){},this.Client=this.options.Client||t||Pt().Client,this.Promise= +this.options.Promise||S.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(){ return this._clients.length>this.options.min}_pulseQueue(){if(this.log("pulse queue"),this.ended){this. @@ -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=sa( 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. -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, +l after calling end on the pool");return e?e(i):this.Promise.reject(i)}let t=fr(this.Promise,e),n=t. +result;if(this._isFull()||this._idle.length){if(this._idle.length&&w.nextTick(()=>this._pulseQueue()), +!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new it(t.callback)),n;let i=a((u,c,l)=>{ +clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new it(i),o=setTimeout(()=>{sa(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&& +newClient(new it(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( +t);let n=Ef(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,ia);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()), +_expired.add(t),this._idle.findIndex(l=>l.client===t)!==-1&&this._acquireClient(t,new it((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,ia);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ +let n=!1;return i=>{n&&vf(),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 pi( +e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=fr(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=fr(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=fr(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(gi,"Pool");var yi=gi;oa.exports=yi});var ua={};ge(ua,{default:()=>Af});var Af,ca=re(()=>{"use strict";p();Af={}});var la=R((kp,_f)=>{_f.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 da=R((Fp,ha)=>{"use strict";p();var fa=Pe().EventEmitter,Cf=(It(),G(Ct)),bi=_t(),st=ha.exports=function(r,e,t){ +fa.call(this),r=bi.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))};Cf.inherits(st,fa); +var If={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): -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(){ +file",sourceLine:"line",sourceFunction:"routine"};st.prototype.handleError=function(r){var e=this.native. +pq.resultErrorFields();if(e)for(var t in e){var n=If[t]||t;r[n]=e[t]}this.callback?this.callback(r): +this.emit("error",r),this.state="error"};st.prototype.then=function(r,e){return this._getPromise().then( +r,e)};st.prototype.catch=function(r){return this._getPromise().catch(r)};st.prototype._getPromise=function(){ return this._promise?this._promise:(this._promise=new Promise(function(r,e){this._once("end",r),this. -_once("error",e)}.bind(this)),this._promise)};Ne.prototype.submit=function(r){this.state="running";var e=this; +_once("error",e)}.bind(this)),this._promise)};st.prototype.submit=function(r){this.state="running";var e=this; this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a(function(s,o,u){if(r.native.arrayMode= !1,v(function(){e.emit("_done")}),s)return e.handleError(s);e._emitRowEvents&&(u.length>1?o.forEach( (c,l)=>{c.forEach(f=>{e.emit("row",f,u[l])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="e\ -nd",e.emit("end",u),e.callback&&e.callback(null,u)},"after");if(m.domain&&(t=m.domain.bind(t)),this. +nd",e.emit("end",u),e.callback&&e.callback(null,u)},"after");if(w.domain&&(t=w.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(bi.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(bi. +prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var wa=R((Op,ma)=>{"use strict";p();var Tf=(ca(),G(ua)),Pf=Zt(),Dp=la(),pa=Pe().EventEmitter,Rf=(It(),G(Ct)), +Bf=ir(),ya=da(),oe=ma.exports=function(r){pa.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. +_types=new Pf(r.types),this.native=new Tf({types:this._types}),this._queryQueue=[],this._ending=!1,this. +_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Bf(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. -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; -if(this._connecting){m.nextTick(()=>r(new Error("Client has already been connected. You cannot reuse\ +password}),this.database=e.database,this.host=e.host,this.port=e.port,this.namedQueries={}};oe.Query= +ya;Rf.inherits(oe,pa);oe.prototype._errorAllQueries=function(r){let e=a(t=>{w.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};oe.prototype._connect=function(r){var e=this; +if(this._connecting){w.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== -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. +_pulseQueryQueue(!0),r()})})};oe.prototype.connect=function(r){if(r){this._connect(r);return}return new this. +_Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};oe.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=="f\ +unction")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 ya(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. +"Query read timeout");w.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( +clearTimeout(o),u(c,l)}),this._queryable?this._ending?(n.native=this.native,w.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|| +i):(n.native=this.native,w.nextTick(()=>{n.handleError(new Error("Client has encountered a connectio\ +n error and is not queryable"))}),i)};oe.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){ +w.nextTick(()=>{e.emit("end"),r&&r()})}),t};oe.prototype._hasActiveQuery=function(){return this._activeQuery&& +this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};oe.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]<< +oe.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. +indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};oe.prototype.ref=function(){}; +oe.prototype.unref=function(){};oe.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( +r,e,t)};oe.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var xi=R((Qp,ga)=>{"use strict";p();ga.exports=wa()});var Pt=R((Wp,Rt)=>{"use strict";p();var Lf=na(),kf=At(),Ff=fi(),Mf=aa(),{DatabaseError:Uf}=ui(),Df=a( +r=>{var e;return e=class extends Mf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),Si=a( +function(r){this.defaults=kf,this.Client=r,this.Query=this.Client.Query,this.Pool=Df(this.Client),this. +_pools=[],this.Connection=Ff,this.types=St(),this.DatabaseError=Uf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< +"u"?Rt.exports=new Si(xi()):(Rt.exports=new Si(Lf),Object.defineProperty(Rt.exports,"native",{configurable:!0, +enumerable:!1,get(){var r=null;try{r=new Si(xi())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. +defineProperty(Rt.exports,"native",{value:r}),r}}))});p();p();Ve();Ir();p();var yu=Object.defineProperty,mu=Object.defineProperties,wu=Object.getOwnPropertyDescriptors,as=Object. +getOwnPropertySymbols,gu=Object.prototype.hasOwnProperty,bu=Object.prototype.propertyIsEnumerable,us=a( +(r,e,t)=>e in r?yu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), +xu=a((r,e)=>{for(var t in e||(e={}))gu.call(e,t)&&us(r,t,e[t]);if(as)for(var t of as(e))bu.call(e,t)&& +us(r,t,e[t]);return r},"__spreadValues"),Su=a((r,e)=>mu(r,wu(e)),"__spreadProps"),vu=1008e3,cs=new Uint8Array( +new Uint16Array([258]).buffer)[0]===2,Eu=new TextDecoder,Tr=new TextEncoder,Nt=Tr.encode("0123456789\ +abcdef"),qt=Tr.encode("0123456789ABCDEF"),Au=Tr.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ +stuvwxyz0123456789+/");var ls=Au.slice();ls[62]=45;ls[63]=95;var ut,Qt;function _u(r,{alphabet:e,scratchArr:t}={}){if(!ut)if(ut= +new Uint16Array(256),Qt=new Uint16Array(256),cs)for(let C=0;C<256;C++)ut[C]=Nt[C&15]<<8|Nt[C>>>4],Qt[C]= +qt[C&15]<<8|qt[C>>>4];else for(let C=0;C<256;C++)ut[C]=Nt[C&15]|Nt[C>>>4]<<8,Qt[C]=qt[C&15]|qt[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"?Qt:ut,f=0,y=0,g;if(cs) 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;ut[de(this. +_mapKey.has(i)?this._mapKey.get(i):i)]=n),t}mapDecode(e,t){let n=this.decode(e);if(this._keyMap)switch(n. +constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return vs( +()=>(Dr(),this?this.decode(e,t):ft.prototype.decode.call(ps,e,t)));Ne=t>-1?t:e.length,h=0,Br=0,ht=0, +Ht=null,Rr=ws,j=null,x=e;try{ee=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ +throw x=null,e instanceof Uint8Array?n:new Error("Source must be a Uint8Array or Buffer but was a "+ +(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof ft){if(B=this,ie=this.sharedValues&& +(this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this. +structures)return N=this.structures,jt();(!N||N.length>0)&&(N=[])}else B=ps,(!N||N.length>0)&&(N=[]), +ie=null;return jt()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;dt=!0;let o=this?this.decode(e, +s):Nr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=j.postBundlePosition){let e=new Error("Unexpected bundle pos\ +ition");throw e.incomplete=!0,e}h=j.postBundlePosition,j=null}if(h==Ne)N=null,x=null,he&&(he=null);else if(h> +Ne){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!dt)throw new Error( +"Data read, but end of buffer not reached");return r}catch(r){throw Dr(),(r instanceof RangeError||r. +message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a(jt,"checkedRead");function L(){ +let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return ku();r=ee. +getUint16(h),h+=2;break;case 26:if(e==7){let t=ee.getFloat32(h);if(B.useFloat32>2){let n=Es[(x[h]&127)<< +1|x[h+1]>>7];return h+=4,(n*t+(t>0?.5:-.5)>>0)/n}return h+=4,t}if(r=ee.getUint32(h),h+=4,e===1)return-1- +r;break;case 27:if(e==7){let t=ee.getFloat64(h);return h+=8,t}if(e>1){if(ee.getUint32(h)>0)throw new Error( +"JavaScript does not support arrays, maps, or strings with length over 4294967295");r=ee.getUint32(h+ +4)}else B.int64AsNumber?(r=ee.getUint32(h)*4294967296,r+=ee.getUint32(h+4)):r=ee.getBigUint64(h);h+= +8;break;case 31:switch(e){case 2:case 3:throw new Error("Indefinite length not supported for byte or\ + text strings");case 4:let t=[],n,i=0;for(;(n=L())!=Ke;){if(i>=ct)throw new Error(`Array length exce\ +eds ${ct}`);t[i++]=n}return e==4?t:e==3?t.join(""):m.concat(t);case 5:let s;if(B.mapsAsObjects){let o={}, +u=0;if(B.keyMap)for(;(s=L())!=Ke;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[de(B. +decodeKey(s))]=L()}else for(;(s=L())!=Ke;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`); +o[de(s)]=L()}return o}else{lt&&(B.mapsAsObjects=!0,lt=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s= +L())!=Ke;){if(u++>=Ae)throw new Error(`Map size exceeds ${Ae}`);o.set(B.decodeKey(s),L())}}else{let u=0; +for(;(s=L())!=Ke;){if(u++>=Ae)throw new Error(`Map size exceeds ${Ae}`);o.set(s,L())}}return o}case 7: +return Ke;default:throw new Error("Invalid major type for indefinite length "+e)}default:throw new Error( +"Unknown token "+r)}switch(e){case 0:return r;case 1:return~r;case 2:return Lu(r);case 3:if(ht>=h)return Ht. +slice(h-$t,(h+=r)-$t);if(ht==0&&Ne<140&&r<32){let i=r<16?bs(r):Bu(r);if(i!=null)return i}return Ru(r);case 4: +if(r>=ct)throw new Error(`Array length exceeds ${ct}`);let t=new Array(r);for(let i=0;i=Ae)throw new Error(`Map size exceeds ${ct}`);if(B.mapsAsObjects){let i={};if(B. +keyMap)for(let s=0;s=hs){let i=N[r&8191];if(i)return i. +read||(i.read=Fr(i)),i.read();if(r<65536){if(r==Pu){let s=Ye(),o=L(),u=L();Ur(o,u);let c={};if(B.keyMap) +for(let l=2;l23)switch(t){case 24: +t=x[h++];break;case 25:t=ee.getUint16(h),h+=2;break;case 26:t=ee.getUint32(h),h+=4;break;default:throw new Error( +"Expected array header, but got "+x[h-1])}let n=this.compiledReader;for(;n;){if(n.propertyCount===t) +return n(L);n=n.next}if(this.slowReads++>=gs){let s=this.length==t?this:this.slice(0,t);return n=B.keyMap? +new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>ys.test(o)?de(o)+":r()":"["+JSON.stringify( +o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>ys.test(o)?de(o)+":r()":"["+JSON.stringify( +o)+"]:r()").join(",")+"}"),this.compiledReader&&(n.next=this.compiledReader),n.propertyCount=t,this. +compiledReader=n,n(L)}let i={};if(B.keyMap)for(let s=0;s64&&Pr)return Pr.decode(x.subarray(h,h+=r));let t=h+ +r,n=[];for(e="";h=t||(x[h]& +192)!==128)n.push(65533);else{let s=x[h++]&63;n.push((i&31)<<6|s)}else if((i&240)===224){let s=h=t||(s&192)!==128||i===224&&s<160||i===237&&s>=160)n.push(65533);else if(h++,h>=t||(x[h]&192)!== +128)n.push(65533);else{let o=x[h++]&63;n.push((i&31)<<12|(s&63)<<6|o)}}else if((i&248)===240){let s=h< +t?x[h]:0;if(i>244||h>=t||(s&192)!==128||i===240&&s<144||i===244&&s>=144)n.push(65533);else if(h++,h>= +t||(x[h]&192)!==128)n.push(65533);else{let o=x[h++]&63;if(h>=t||(x[h]&192)!==128)n.push(65533);else{ +let u=x[h++]&63,c=(i&7)<<18|(s&63)<<12|o<<6|u;c-=65536,n.push(c>>>10&1023|55296),n.push(56320|c&1023)}}}else +n.push(65533);n.length>=4096&&(e+=K.apply(String,n),n.length=0)}return n.length>0&&(e+=K.apply(String, +n)),e}a(Mr,"readStringJS");var K=String.fromCharCode;function Bu(r){let e=h,t=new Array(r);for(let n=0;n< +r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return K.apply(String,t)}a(Bu,"longStringInJS"); +function bs(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return K(e)}}else{ +let e=x[h++],t=x[h++];if((e&128)>0||(t&128)>0){h-=2;return}if(r<3)return K(e,t);let n=x[h++];if((n&128)> +0){h-=3;return}return K(e,t,n)}else{let e=x[h++],t=x[h++],n=x[h++],i=x[h++];if((e&128)>0||(t&128)>0|| +(n&128)>0||(i&128)>0){h-=4;return}if(r<6){if(r===4)return K(e,t,n,i);{let s=x[h++];if((s&128)>0){h-= +5;return}return K(e,t,n,i,s)}}else if(r<8){let s=x[h++],o=x[h++];if((s&128)>0||(o&128)>0){h-=6;return} +if(r<7)return K(e,t,n,i,s,o);let u=x[h++];if((u&128)>0){h-=7;return}return K(e,t,n,i,s,o,u)}else{let s=x[h++], +o=x[h++],u=x[h++],c=x[h++];if((s&128)>0||(o&128)>0||(u&128)>0||(c&128)>0){h-=8;return}if(r<10){if(r=== +8)return K(e,t,n,i,s,o,u,c);{let l=x[h++];if((l&128)>0){h-=9;return}return K(e,t,n,i,s,o,u,c,l)}}else if(r< +12){let l=x[h++],f=x[h++];if((l&128)>0||(f&128)>0){h-=10;return}if(r<11)return K(e,t,n,i,s,o,u,c,l,f); +let y=x[h++];if((y&128)>0){h-=11;return}return K(e,t,n,i,s,o,u,c,l,f,y)}else{let l=x[h++],f=x[h++],y=x[h++], +g=x[h++];if((l&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return K(e,t, +n,i,s,o,u,c,l,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return K(e,t,n,i,s,o,u,c,l,f,y,g,E)}}else{ +let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return K(e,t,n,i,s,o,u,c,l,f,y,g, +E,C);let W=x[h++];if((W&128)>0){h-=15;return}return K(e,t,n,i,s,o,u,c,l,f,y,g,E,C,W)}}}}}a(bs,"short\ +StringInJS");function Lu(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( +h,h+=r)}a(Lu,"readBin");var xs=new Float32Array(1),Wt=new Uint8Array(xs.buffer,0,4);function ku(){let r=x[h++],e=x[h++],t=(r& +127)>>2;if(t===31)return e||r&3?NaN:r&128?-1/0:1/0;if(t===0){let n=((r&3)<<8|e)/16777216;return r&128? +-n:n}return Wt[3]=r&128|(t>>1)+56,Wt[2]=(r&7)<<5|e>>3,Wt[1]=e<<5,Wt[0]=0,xs[0]}a(ku,"getFloat16");var sh=new Array( +4096);var qr=class qr{constructor(e,t){this.value=e,this.tag=t}};a(qr,"Tag");var Je=qr;q[0]=r=>new Date(r); +q[1]=r=>new Date(Math.round(r*1e3));q[2]=r=>{let e=BigInt(0);for(let t=0,n=r.byteLength;tBigInt(-1)-q[2](r);q[4]=r=>+(r[1]+"e"+r[0]);q[5]=r=>r[1]*Math. +exp(r[0]*Math.log(2));var Ur=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. +restoreStructures=[]))[r]=t),N[r]=e,e.read=Fr(e)},"recordDefinition");q[Iu]=r=>{let e=r.length,t=r[1]; +Ur(r[0],t);let n={};for(let i=2;ij?j[0].slice( +j.position0,j.position0+=r):new Je(r,14);q[15]=r=>j?j[1].slice(j.position1,j.position1+=r):new Je(r, +15);var Fu={Error,RegExp};q[27]=r=>(Fu[r[0]]||Error)(r[1],r[2]);var Ss=a(r=>{if(x[h++]!=132){let t=new Error( +"Packed values structure must be followed by a 4 element array");throw x.length{if(!ie)if(B.getShared)Or();else return new Je( +r,ds);if(typeof r=="number")return ie[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ +ger packed references yet");throw r===void 0&&(e.incomplete=!0),e};q[28]=r=>{he||(he=new Map,he.id=0); +let e=he.id++,t=h,n=x[h],i;n>>5==4?i=[]:i={};let s={target:i};he.set(e,s);let o=r();return s.used?(Object. +getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(h=t,i=o,he.set(e,{target:i}),o=r()),Object.assign(i,o)): +(s.target=o,o)};q[28].handlesRead=!0;q[29]=r=>{let e=he.get(r);return e.used=!0,e.target};q[258]=r=>new Set( +r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,lt=!0),r())).handlesRead=!0;function ze(r,e){return typeof r== +"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(ze,"combine");function Oe(){if(!ie) +if(B.getShared)Or();else throw new Error("No packed values available");return ie}a(Oe,"getPackedValu\ +es");var Mu=1399353956;Lr.push((r,e)=>{if(r>=225&&r<=255)return ze(Oe().prefixes[r-224],e);if(r>=28704&& +r<=32767)return ze(Oe().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return ze(Oe().prefixes[r- +1879048192],e);if(r>=216&&r<=223)return ze(e,Oe().suffixes[r-216]);if(r>=27647&&r<=28671)return ze(e, +Oe().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return ze(e,Oe().suffixes[r-1811939328]);if(r== +Mu)return{packedValues:ie,structures:N.slice(0),version:e};if(r==55799)return e});var Uu=new Uint8Array( +new Uint16Array([1]).buffer)[0]==1,ms=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> +"u"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"? +{name:"BigInt64Array"}:BigInt64Array,Float32Array,Float64Array],Du=[64,68,69,70,71,72,77,78,79,85,86]; +for(let r=0;r{if(!r)throw new Error("Could not find typed array for code "+e); +return!B.copyBuffers&&(n===1||n===2&&!(o.byteOffset&1)||n===4&&!(o.byteOffset&3)||n===8&&!(o.byteOffset& +7))?new r(o.buffer,o.byteOffset,o.byteLength>>s):new r(Uint8Array.prototype.slice.call(o,0).buffer)}: +o=>{if(!r)throw new Error("Could not find typed array for code "+e);let u=new DataView(o.buffer,o.byteOffset, +o.byteLength),c=o.length>>s,l=new r(c),f=u[t];for(let y=0;y23)switch(r){case 24:r=x[h++];break;case 25:r=ee.getUint16( +h),h+=2;break;case 26:r=ee.getUint32(h),h+=4;break}return r}a(Ye,"readJustLength");function Or(){if(B. +getShared){let r=vs(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ie= +B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(Or, +"loadShared");function vs(r){let e=Ne,t=h,n=Br,i=$t,s=ht,o=Ht,u=Rr,c=he,l=j,f=new Uint8Array(x.slice( +0,Ne)),y=N,g=B,E=dt,C=r();return Ne=e,h=t,Br=n,$t=i,ht=s,Ht=o,Rr=u,he=c,j=l,x=f,dt=E,N=y,B=g,ee=new DataView( +x.buffer,x.byteOffset,x.byteLength),C}a(vs,"saveState");function Dr(){x=null,he=null,N=null}a(Dr,"cl\ +earSource");var Es=new Array(147);for(let r=0;r<256;r++)Es[r]=+("1e"+Math.floor(45.15-r*.30103));var Nr=new kr({ +useRecords:!1}),oh=Nr.decode,As=Nr.decodeMultiple;p();var Gt=class Gt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ let{strings:t,values:n}=this;for(let i=0,s=t.length;iLu((0,us.prepareValue)(n)))}}a(ss,"prep\ -areQuery");function cs(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( -"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:\ -password@host.tld/dbname?option=value");function D(P,...I){if(!(Array.isArray(P)&&Array.isArray(P.raw)&& -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?? -{});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!== -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){ + ************************************************************`)}a(Vt,"warnIfBrowser");Ve();var uo=Me(Zt()),co=Me(_t());var er=class er extends Error{constructor(t){super(t);I(this,"name","NeonDbError");I(this,"severity"); +I(this,"code");I(this,"detail");I(this,"hint");I(this,"position");I(this,"internalPosition");I(this, +"internalQuery");I(this,"where");I(this,"schema");I(this,"table");I(this,"column");I(this,"dataType"); +I(this,"constraint");I(this,"file");I(this,"line");I(this,"routine");I(this,"sourceError");"captureS\ +tackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,er)}};a( +er,"NeonDbError");var ye=er,so="transaction() expects an array of queries, or a function returning a\ +n array of queries",Gc=["severity","code","detail","hint","position","internalPosition","internalQue\ +ry","where","schema","table","column","dataType","constraint","file","line","routine"],Vc={json:"app\ +lication/json",jsonl:"application/vnd.neon.sql.v1+json","cbor-seq":"application/vnd.neon.sql.v1+cbor"}; +function lo(r){let e=new ye(r.message);for(let t of Gc)e[t]=r[t]??void 0;return e}a(lo,"dbError");async function Kc(r,e){ +let t=e==="jsonl"?(await r.text()).split(` +`).filter(u=>u.length!==0).map(u=>JSON.parse(u)):As(new Uint8Array(await r.arrayBuffer())),n=t.at(-1); +if(n?.type!=="end")throw new ye("Neon internal error: streamed response ended without a terminal mes\ +sage");if(n.status==="error")throw lo(n.error);if(n.status!=="ok")throw new ye("Neon internal error:\ + unexpected streamed response status");let i,s,o=[];for(let u of t.slice(0,-1))switch(u.type){case"c\ +olumns":i=u.columns;break;case"row":o.push(u.row);break;case"query":s=u.query;break;default:throw new ye( +"Neon internal error: unexpected streamed response message")}if(!Array.isArray(i)||s===void 0)throw new ye( +"Neon internal error: incomplete streamed response");return{fields:i,rows:o,command:s.command,rowCount:s. +rowCount}}a(Kc,"readStreamingResult");function zc(r){return r instanceof m?"\\x"+fs(r):r}a(zc,"encod\ +eBuffersAsBytea");function oo(r){let{query:e,params:t}=r instanceof pt?r.toParameterizedQuery():r;return{ +query:e,params:t.map(n=>zc((0,co.prepareValue)(n)))}}a(oo,"prepareQuery");function fo(r,{arrayMode:e, +fullResults:t,fetchOptions:n,responseFormat:i,isolationLevel:s,readOnly:o,deferrable:u,authToken:c,disableWarningInBrowsers:l}={}){ +if(!r)throw new Error("No database connection string was provided to `neon()`. Perhaps an environmen\ +t variable has not been set?");let f;try{f=Cr(r)}catch{throw new Error("Database connection string p\ +rovided to `neon()` is not a valid URL. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E, +port:C,pathname:W}=f;if(y!=="postgres:"&&y!=="postgresql:"||!g||!E||!W)throw new Error("Database con\ +nection string format for `neon()` should be: postgresql://user@host.tld/dbname?option=value");function J(T,...b){ +if(!(Array.isArray(T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can no\ +w be called only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], \ +options). For a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SE\ +LECT $1", [value], options).');return new qe(we,new pt(T,b))}a(J,"templateFn"),J.query=(T,b,k)=>new qe( +we,{query:T,params:b??[]},k),J.unsafe=T=>new yt(T),J.transaction=async(T,b)=>{if(typeof T=="function"&& +(T=T(J)),!Array.isArray(T))throw new Error(so);T.forEach(H=>{if(!(H instanceof qe))throw new Error(so)}); +let k=T.map(H=>H.queryData),ae=T.map(H=>H.opts??{});return we(k,ae,b)};async function we(T,b,k){let{ +fetchEndpoint:ae,fetchFunction:H}=Se,Ce=Array.isArray(T)?{queries:T.map($=>oo($))}:oo(T),le=n??{},ue=i?? +"json",M=e??!1,Z=t??!1,ve=s,Ie=o,Le=u;if(k!==void 0&&(k.fetchOptions!==void 0&&(le={...le,...k.fetchOptions}), +k.arrayMode!==void 0&&(M=k.arrayMode),k.fullResults!==void 0&&(Z=k.fullResults),k.responseFormat!==void 0&& +(ue=k.responseFormat),k.isolationLevel!==void 0&&(ve=k.isolationLevel),k.readOnly!==void 0&&(Ie=k.readOnly), +k.deferrable!==void 0&&(Le=k.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!==void 0&&(le= +{...le,...b.fetchOptions}),b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(ue=b.responseFormat), +Array.isArray(T)&&ue!=="json")throw new Error("`jsonl` and `cbor-seq` response formats do not suppor\ +t transactions");let ke=c;!Array.isArray(b)&&b?.authToken!==void 0&&(ke=b.authToken);let ot=typeof ae== +"function"?ae(E,C,{jwtAuth:ke!==void 0}):ae,Fe={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ +rue","Neon-Array-Mode":"true",Accept:Vc[ue]},kt=await Yc(ke);kt&&(Fe.Authorization=`Bearer ${kt}`),Array. +isArray(T)&&(ve!==void 0&&(Fe["Neon-Batch-Isolation-Level"]=ve),Ie!==void 0&&(Fe["Neon-Batch-Read-On\ +ly"]=String(Ie)),Le!==void 0&&(Fe["Neon-Batch-Deferrable"]=String(Le))),l||Se.disableWarningInBrowsers|| +Vt();let ce;try{ce=await(H??fetch)(ot,{method:"POST",body:JSON.stringify(Ce),headers:Fe,...le})}catch($){ +let X=new ye(`Error connecting to database: ${$}`);throw X.sourceError=$,X}if(ce.ok){let $=ue==="jso\ +n"?await ce.json():await Kc(ce,ue);if(Array.isArray(T)){let X=$.results;if(!Array.isArray(X))throw new ye( +"Neon internal error: unexpected result format");return X.map((hr,dr)=>{let pr=b[dr]??{},va=pr.arrayMode?? +M,Ea=pr.fullResults??Z;return ao(hr,{arrayMode:va,fullResults:Ea,types:pr.types})})}else{let X=b??{}, +hr=X.arrayMode??M,dr=X.fullResults??Z;return ao($,{arrayMode:hr,fullResults:dr,types:X.types})}}else{ +let{status:$}=ce;if($===400){let X=await ce.json();throw lo(X)}else{let X=await ce.text();throw new ye( +`Server error (HTTP status ${$}): ${X}`)}}}return a(we,"execute"),J}a(fo,"neon");var rn=class rn{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( +this.queryData,this.opts).finally(e)}};a(rn,"NeonQueryPromise");var qe=rn;function ao(r,{arrayMode:e, +fullResults:t,types:n}){let i=new uo.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. +o,r._types=i,r):u}a(ao,"processQueryResult");async function Yc(r){if(typeof r=="string")return r;if(typeof r== +"function")try{return await Promise.resolve(r())}catch(e){let t=new ye("Error getting auth token."); +throw e instanceof Error&&(t=new ye(`Error getting auth token: ${e.message}`)),t}}a(Yc,"getAuthToken");p();var xa=Me(Pt());p();var ba=Me(Pt());var vi=class vi extends ba.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=== +void 0||w.env.PGHOST!==void 0,s=w.env.USER??w.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\ @@ -1321,44 +1476,44 @@ c=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let l=this.c "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){ +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("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; +"SASL: protocol error");let u=Object.fromEntries(o.split(",").map(ce=>{if(!/^.=/.test(ce))throw new Error( +"SASL: Invalid attribute pair entry");let $=ce[0],X=ce.substring(2);return[$,X]})),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\ + short");let y=parseInt(f,10),g=m.from(l,"base64"),E=new TextEncoder,C=E.encode(s),W=await n.importKey( +"raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),J=new Uint8Array(await n.sign("HMAC",W,m.concat( +[g,m.from([0,0,0,1])]))),we=J;for(var T=0;Twe[$]^J[$]));let b=we,k=await n.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-2\ +56"}},!1,["sign"]),ae=new Uint8Array(await n.sign("HMAC",k,E.encode("Client Key"))),H=await n.digest( +"SHA-256",ae),Ce="n=*,r="+i.clientNonce,le="r="+c+",s="+l+",i="+y,ue="c=biws,r="+c,M=Ce+","+le+","+ue, +Z=await n.importKey("raw",H,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var ve=new Uint8Array(await n. +sign("HMAC",Z,E.encode(M))),Ie=m.from(ae.map((ce,$)=>ae[$]^ve[$])),Le=Ie.toString("base64");let ke=await n. +importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),ot=await n.sign("HMAC",ke,E.encode( +"Server Key")),Fe=await n.importKey("raw",ot,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var kt=m. +from(await n.sign("HMAC",Fe,E.encode(M)));i.message="SASLResponse",i.serverSignature=kt.toString("ba\ +se64"),i.response=ue+",p="+Le,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; +a(vi,"NeonClient");var Bt=vi;Ve();var Sa=Me(ir());function Of(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(Of,"promisify");var Ai=class Ai extends xa.Pool{constructor(){ +super(...arguments);I(this,"Client",Bt);I(this,"hasFetchUnsupportedListeners",!1);I(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( +if(!Se.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof t=="function")return super.query( +t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=Of(this.Promise,i);i=s.callback;try{let o=new Sa.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. -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, +/${c(o.database)}`,f=typeof t=="string"?t:t.text,y=n??t.values??[];fo(l,{fullResults:!0,arrayMode:t. +rowMode==="array"}).query(f,y,{types:t.types??this.options?.types}).then(E=>i(void 0,E)).catch(E=>i( +E))}catch(o){i(o)}return s.result}};a(Ai,"NeonPool");var Ei=Ai;Ve();var Lt=Me(Pt()),n0="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{Bt as Client,export_DatabaseError as DatabaseError, +ye as NeonDbError,qe as NeonQueryPromise,Ei as Pool,pt as SqlTemplate,yt as UnsafeRawSql,n0 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}; +fo as neon,Se as neonConfig,export_types as types,Vt as warnIfBrowser}; /*! Bundled license information: ieee754/index.js: diff --git a/package-lock.json b/package-lock.json index 20deeea..4149307 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "@vitest/browser": "^3.0.7", "assert": "file:src/shims/assert", "buffer": "^6.0.3", + "cbor-x": "^1.6.5", "crypto": "file:src/shims/crypto", "dns": "file:src/shims/dns", "drizzle-orm": "^0.44.2", @@ -96,6 +97,90 @@ "node": ">=6.9.0" } }, + "node_modules/@cbor-extract/cbor-extract-darwin-arm64": { + "version": "2.2.2", + "resolved": "https://npm-proxy.cloud.databricks.com/@cbor-extract/cbor-extract-darwin-arm64/-/cbor-extract-darwin-arm64-2.2.2.tgz", + "integrity": "sha512-ZKZ/F8US7JR92J4DMct6cLW/Y66o2K576+zjlEN/MevH70bFIsB10wkZEQPLzl2oNh2SMGy55xpJ9JoBRl5DOA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@cbor-extract/cbor-extract-darwin-x64": { + "version": "2.2.2", + "resolved": "https://npm-proxy.cloud.databricks.com/@cbor-extract/cbor-extract-darwin-x64/-/cbor-extract-darwin-x64-2.2.2.tgz", + "integrity": "sha512-32b1mgc+P61Js+KW9VZv/c+xRw5EfmOcPx990JbCBSkYJFY0l25VinvyyWfl+3KjibQmAcYwmyzKF9J4DyKP/Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@cbor-extract/cbor-extract-linux-arm": { + "version": "2.2.2", + "resolved": "https://npm-proxy.cloud.databricks.com/@cbor-extract/cbor-extract-linux-arm/-/cbor-extract-linux-arm-2.2.2.tgz", + "integrity": "sha512-tNg0za41TpQfkhWjptD+0gSD2fggMiDCSacuIeELyb2xZhr7PrhPe5h66Jc67B/5dmpIhI2QOUtv4SBsricyYQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@cbor-extract/cbor-extract-linux-arm64": { + "version": "2.2.2", + "resolved": "https://npm-proxy.cloud.databricks.com/@cbor-extract/cbor-extract-linux-arm64/-/cbor-extract-linux-arm64-2.2.2.tgz", + "integrity": "sha512-wfqgzqCAy/Vn8i6WVIh7qZd0DdBFaWBjPdB6ma+Wihcjv0gHqD/mw3ouVv7kbbUNrab6dKEx/w3xQZEdeXIlzg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@cbor-extract/cbor-extract-linux-x64": { + "version": "2.2.2", + "resolved": "https://npm-proxy.cloud.databricks.com/@cbor-extract/cbor-extract-linux-x64/-/cbor-extract-linux-x64-2.2.2.tgz", + "integrity": "sha512-rpiLnVEsqtPJ+mXTdx1rfz4RtUGYIUg2rUAZgd1KjiC1SehYUSkJN7Yh+aVfSjvCGtVP0/bfkQkXpPXKbmSUaA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@cbor-extract/cbor-extract-win32-x64": { + "version": "2.2.2", + "resolved": "https://npm-proxy.cloud.databricks.com/@cbor-extract/cbor-extract-win32-x64/-/cbor-extract-win32-x64-2.2.2.tgz", + "integrity": "sha512-dI+9P7cfWxkTQ+oE+7Aa6onEn92PHgfWXZivjNheCRmTBDBf2fx6RyTi0cmgpYLnD1KLZK9ZYrMxaPZ4oiXhGA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@cloudflare/kv-asset-handler": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.4.0.tgz", @@ -2294,6 +2379,39 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/cbor-extract": { + "version": "2.2.2", + "resolved": "https://npm-proxy.cloud.databricks.com/cbor-extract/-/cbor-extract-2.2.2.tgz", + "integrity": "sha512-hlSxxI9XO2yQfe9g6msd3g4xCfDqK5T5P0fRMLuaLHhxn4ViPrm+a+MUfhrvH2W962RGxcBwEGzLQyjbDG1gng==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "node-gyp-build-optional-packages": "5.1.1" + }, + "bin": { + "download-cbor-prebuilds": "bin/download-prebuilds.js" + }, + "optionalDependencies": { + "@cbor-extract/cbor-extract-darwin-arm64": "2.2.2", + "@cbor-extract/cbor-extract-darwin-x64": "2.2.2", + "@cbor-extract/cbor-extract-linux-arm": "2.2.2", + "@cbor-extract/cbor-extract-linux-arm64": "2.2.2", + "@cbor-extract/cbor-extract-linux-x64": "2.2.2", + "@cbor-extract/cbor-extract-win32-x64": "2.2.2" + } + }, + "node_modules/cbor-x": { + "version": "1.6.5", + "resolved": "https://npm-proxy.cloud.databricks.com/cbor-x/-/cbor-x-1.6.5.tgz", + "integrity": "sha512-yO64CxnSh6kp+pHNRK9IfwnMvCB+c8HvmUjQY/9l9YRF0/cAPka/tUHLwS64QqUpFCq3/OtbKziVJYXH2EaRig==", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "cbor-extract": "^2.2.2" + } + }, "node_modules/chai": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/chai/-/chai-5.2.0.tgz", @@ -4167,6 +4285,22 @@ "url": "https://opencollective.com/node-fetch" } }, + "node_modules/node-gyp-build-optional-packages": { + "version": "5.1.1", + "resolved": "https://npm-proxy.cloud.databricks.com/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.1.1.tgz", + "integrity": "sha512-+P72GAjVAbTxjjwUmwjVrqrdZROD4nf8KgpBoDxqXXTiYZZt/ud60dE5yvCSr9lRO8e8yv6kgJIC0K0PfZFVQw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "detect-libc": "^2.0.1" + }, + "bin": { + "node-gyp-build-optional-packages": "bin.js", + "node-gyp-build-optional-packages-optional": "optional.js", + "node-gyp-build-optional-packages-test": "build-test.js" + } + }, "node_modules/node-stream-zip": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/node-stream-zip/-/node-stream-zip-1.15.0.tgz", diff --git a/package.json b/package.json index 0e244ba..71c4306 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ "@vitest/browser": "^3.0.7", "assert": "file:src/shims/assert", "buffer": "^6.0.3", + "cbor-x": "^1.6.5", "crypto": "file:src/shims/crypto", "dns": "file:src/shims/dns", "drizzle-orm": "^0.44.2", diff --git a/src/httpQuery.ts b/src/httpQuery.ts index 335e951..7b8b41a 100644 --- a/src/httpQuery.ts +++ b/src/httpQuery.ts @@ -19,8 +19,10 @@ That is: import { Socket } from './shims/net'; import { parse } from './shims/url'; import { toHex } from 'hextreme'; +import { decodeMultiple } from 'cbor-x'; import type { HTTPQueryOptions, + HTTPResponseFormat, HTTPTransactionOptions, NeonQueryFunction, ProcessQueryResultOptions, @@ -92,6 +94,76 @@ const errorFields = [ 'routine', ] as const; +const responseFormatContentTypes: Record = { + json: 'application/json', + jsonl: 'application/vnd.neon.sql.v1+json', + 'cbor-seq': 'application/vnd.neon.sql.v1+cbor', +}; + +function dbError(error: any) { + const result = new NeonDbError(error.message); + for (const field of errorFields) result[field] = error[field] ?? undefined; + return result; +} + +async function readStreamingResult( + response: Response, + responseFormat: Exclude, +) { + const messages = + responseFormat === 'jsonl' + ? (await response.text()) + .split('\n') + .filter((line) => line.length !== 0) + .map((line) => JSON.parse(line)) + : (decodeMultiple(new Uint8Array(await response.arrayBuffer())) as any[]); + + const end = messages.at(-1); + if (end?.type !== 'end') { + throw new NeonDbError( + 'Neon internal error: streamed response ended without a terminal message', + ); + } + if (end.status === 'error') throw dbError(end.error); + if (end.status !== 'ok') { + throw new NeonDbError( + 'Neon internal error: unexpected streamed response status', + ); + } + + let fields; + let query; + const rows = []; + for (const message of messages.slice(0, -1)) { + switch (message.type) { + case 'columns': + fields = message.columns; + break; + case 'row': + rows.push(message.row); + break; + case 'query': + query = message.query; + break; + default: + throw new NeonDbError( + 'Neon internal error: unexpected streamed response message', + ); + } + } + + if (!Array.isArray(fields) || query === undefined) { + throw new NeonDbError('Neon internal error: incomplete streamed response'); + } + + return { + fields, + rows, + command: query.command, + rowCount: query.rowCount, + }; +} + function encodeBuffersAsBytea(value: unknown): unknown { // convert Buffer to bytea hex format: https://www.postgresql.org/docs/current/datatype-binary.html#DATATYPE-BINARY-BYTEA-HEX-FORMAT if (value instanceof Buffer) return '\\x' + toHex(value); @@ -191,6 +263,7 @@ export function neon< arrayMode: neonOptArrayMode, fullResults: neonOptFullResults, fetchOptions: neonOptFetchOptions, + responseFormat: neonOptResponseFormat, isolationLevel: neonOptIsolationLevel, readOnly: neonOptReadOnly, deferrable: neonOptDeferrable, @@ -223,7 +296,7 @@ export function neon< !pathname ) { throw new Error( - 'Database connection string format for `neon()` should be: postgresql://user:password@host.tld/dbname?option=value', + 'Database connection string format for `neon()` should be: postgresql://user@host.tld/dbname?option=value', ); } @@ -296,6 +369,7 @@ export function neon< // --- resolve options to transaction level --- let resolvedFetchOptions = neonOptFetchOptions ?? {}; + let resolvedResponseFormat = neonOptResponseFormat ?? 'json'; let resolvedArrayMode = neonOptArrayMode ?? false; let resolvedFullResults = neonOptFullResults ?? false; let resolvedIsolationLevel = neonOptIsolationLevel; // default is undefined @@ -313,6 +387,8 @@ export function neon< resolvedArrayMode = txnOpts.arrayMode; if (txnOpts.fullResults !== undefined) resolvedFullResults = txnOpts.fullResults; + if (txnOpts.responseFormat !== undefined) + resolvedResponseFormat = txnOpts.responseFormat; if (txnOpts.isolationLevel !== undefined) resolvedIsolationLevel = txnOpts.isolationLevel; if (txnOpts.readOnly !== undefined) resolvedReadOnly = txnOpts.readOnly; @@ -331,6 +407,19 @@ export function neon< ...allSqlOpts.fetchOptions, }; } + if ( + allSqlOpts !== undefined && + !Array.isArray(allSqlOpts) && + allSqlOpts.responseFormat !== undefined + ) { + resolvedResponseFormat = allSqlOpts.responseFormat; + } + + if (Array.isArray(queryData) && resolvedResponseFormat !== 'json') { + throw new Error( + '`jsonl` and `cbor-seq` response formats do not support transactions', + ); + } // --- resolve auth token usage --- let resolvedAuthToken = authToken; @@ -351,6 +440,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 + Accept: responseFormatContentTypes[resolvedResponseFormat], }; // --- add auth token to headers --- @@ -392,7 +482,10 @@ export function neon< } if (response.ok) { - const rawResults = (await response.json()) as any; + const rawResults = + resolvedResponseFormat === 'json' + ? ((await response.json()) as any) + : await readStreamingResult(response, resolvedResponseFormat); if (Array.isArray(queryData)) { // batch query @@ -428,10 +521,7 @@ export function neon< const { status } = response; if (status === 400) { const json = (await response.json()) as any; - const dbError = new NeonDbError(json.message); - for (const field of errorFields) - dbError[field] = json[field] ?? undefined; - throw dbError; + throw dbError(json); } else { const text = await response.text(); throw new NeonDbError(`Server error (HTTP status ${status}): ${text}`); diff --git a/src/httpTypes.ts b/src/httpTypes.ts index 47ec5f0..9e4ee65 100644 --- a/src/httpTypes.ts +++ b/src/httpTypes.ts @@ -20,6 +20,8 @@ export interface ParameterizedQuery { params: any[]; } +export type HTTPResponseFormat = 'json' | 'jsonl' | 'cbor-seq'; + export interface HTTPQueryOptions< ArrayMode extends boolean, FullResults extends boolean, @@ -52,6 +54,15 @@ export interface HTTPQueryOptions< */ fetchOptions?: Record; + /** + * Wire format requested from the SQL-over-HTTP endpoint. + * + * `jsonl` and `cbor-seq` are currently supported only for single queries. + * + * Default: `json` + */ + responseFormat?: HTTPResponseFormat; + /** * JWT auth token to be passed as the Bearer token in the Authorization header. * Can be string, or a function (sync or async) returning a string. diff --git a/tests/cli/httpStreaming.test.ts b/tests/cli/httpStreaming.test.ts new file mode 100644 index 0000000..bdc4ced --- /dev/null +++ b/tests/cli/httpStreaming.test.ts @@ -0,0 +1,188 @@ +import { encode } from 'cbor-x'; +import { afterEach, beforeEach, expect, test, vi } from 'vitest'; +import { neon, neonConfig } from '@neondatabase/serverless'; + +const connectionString = 'postgres://user@example.com/database'; + +const fields = [ + { + name: 'answer', + dataTypeID: 23, + tableID: 0, + columnID: 0, + dataTypeSize: 4, + dataTypeModifier: -1, + format: 'text', + }, +]; + +const successMessages = [ + { type: 'columns', columns: fields }, + { type: 'row', row: ['42'] }, + { type: 'query', query: { command: 'SELECT', rowCount: 1 } }, + { type: 'end', status: 'ok' }, +]; + +let previousFetchEndpoint: typeof neonConfig.fetchEndpoint; +let previousFetchFunction: typeof neonConfig.fetchFunction; + +beforeEach(() => { + previousFetchEndpoint = neonConfig.fetchEndpoint; + previousFetchFunction = neonConfig.fetchFunction; + neonConfig.fetchEndpoint = 'https://example.com/sql'; +}); + +afterEach(() => { + neonConfig.fetchEndpoint = previousFetchEndpoint; + neonConfig.fetchFunction = previousFetchFunction; +}); + +function cborSequence(messages: unknown[]) { + const encoded = messages.map((message) => encode(message)); + const result = new Uint8Array( + encoded.reduce((length, message) => length + message.byteLength, 0), + ); + let offset = 0; + for (const message of encoded) { + result.set(message, offset); + offset += message.byteLength; + } + return result; +} + +function mockResponse(body: BodyInit, expectedAccept: string) { + const fetchFunction = vi.fn(async (_url, init) => { + expect(init?.headers).toMatchObject({ Accept: expectedAccept }); + return new Response(body, { status: 200 }); + }); + neonConfig.fetchFunction = fetchFunction as any; + return fetchFunction; +} + +test('uses the legacy JSON protocol by default', async () => { + const fetchFunction = mockResponse( + JSON.stringify({ + fields, + rows: [['42']], + command: 'SELECT', + rowCount: 1, + }), + 'application/json', + ); + + const sql = neon(connectionString); + await expect(sql`SELECT 42 AS answer`).resolves.toStrictEqual([ + { answer: 42 }, + ]); + expect(fetchFunction).toHaveBeenCalledOnce(); +}); + +test.each([ + { + responseFormat: 'jsonl' as const, + accept: 'application/vnd.neon.sql.v1+json', + body: successMessages.map((message) => JSON.stringify(message)).join('\n'), + }, + { + responseFormat: 'cbor-seq' as const, + accept: 'application/vnd.neon.sql.v1+cbor', + body: cborSequence(successMessages), + }, +])( + 'decodes $responseFormat responses', + async ({ responseFormat, accept, body }) => { + mockResponse(body, accept); + + const sql = neon(connectionString, { responseFormat, fullResults: true }); + await expect(sql`SELECT 42 AS answer`).resolves.toMatchObject({ + fields, + rows: [{ answer: 42 }], + command: 'SELECT', + rowCount: 1, + }); + }, +); + +test('allows a streaming format per query', async () => { + mockResponse( + successMessages.map((message) => JSON.stringify(message)).join('\n'), + 'application/vnd.neon.sql.v1+json', + ); + + const sql = neon(connectionString); + await expect( + sql.query('SELECT 42 AS answer', [], { responseFormat: 'jsonl' }), + ).resolves.toStrictEqual([{ answer: 42 }]); +}); + +test('returns terminal streamed errors as database errors', async () => { + mockResponse( + cborSequence([ + { + type: 'end', + status: 'error', + error: { message: 'division by zero', code: '22012' }, + }, + ]), + 'application/vnd.neon.sql.v1+cbor', + ); + + const sql = neon(connectionString, { responseFormat: 'cbor-seq' }); + const error = await sql`SELECT 1 / 0`.catch((error) => error); + expect(error).toBeInstanceOf(Error); + expect(error).toMatchObject({ message: 'division by zero', code: '22012' }); +}); + +test.each([ + { + responseFormat: 'jsonl' as const, + accept: 'application/vnd.neon.sql.v1+json', + body: JSON.stringify(successMessages[0]), + }, + { + responseFormat: 'cbor-seq' as const, + accept: 'application/vnd.neon.sql.v1+cbor', + body: cborSequence([successMessages[0]]), + }, +])( + 'rejects $responseFormat responses without a terminal message', + async ({ responseFormat, accept, body }) => { + mockResponse(body, accept); + + const sql = neon(connectionString, { responseFormat }); + await expect(sql`SELECT 42 AS answer`).rejects.toThrow( + 'streamed response ended without a terminal message', + ); + }, +); + +test.each([ + { + responseFormat: 'jsonl' as const, + accept: 'application/vnd.neon.sql.v1+json', + body: successMessages + .map((message) => JSON.stringify(message)) + .join('\n') + .slice(0, -1), + }, + { + responseFormat: 'cbor-seq' as const, + accept: 'application/vnd.neon.sql.v1+cbor', + body: cborSequence(successMessages).slice(0, -1), + }, +])( + 'rejects torn $responseFormat messages', + async ({ responseFormat, accept, body }) => { + mockResponse(body, accept); + + const sql = neon(connectionString, { responseFormat }); + await expect(sql`SELECT 42 AS answer`).rejects.toThrow(); + }, +); + +test('keeps transactions on the JSON protocol', async () => { + const sql = neon(connectionString, { responseFormat: 'jsonl' }); + await expect(sql.transaction([sql`SELECT 1`])).rejects.toThrow( + 'response formats do not support transactions', + ); +}); From 93bd9448121f52c3c97a699af3c20fa9c1066610 Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Wed, 19 Aug 2026 07:52:22 +0100 Subject: [PATCH 2/7] Support streaming HTTP transactions --- index.d.mts | 2 - index.d.ts | 2 - index.js | 1415 +++++++++++++++--------------- index.mjs | 1422 ++++++++++++++++--------------- src/httpQuery.ts | 61 +- src/httpTypes.ts | 2 - tests/cli/httpStreaming.test.ts | 55 +- 7 files changed, 1508 insertions(+), 1451 deletions(-) diff --git a/index.d.mts b/index.d.mts index 26cdcb5..7b351fb 100644 --- a/index.d.mts +++ b/index.d.mts @@ -454,8 +454,6 @@ export declare interface HTTPQueryOptionse in r?je(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>je(r,"name",{value:e,configurable:!0});var re=(r,e)=>()=>(r&&(e=r(r=0)),e);var R=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),he=(r,e)=>{for(var t in e)je(r,t,{get:e[t], -enumerable:!0})},Ci=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ca(e))!Ta. -call(r,i)&&i!==t&&je(r,i,{get:()=>e[i],enumerable:!(n=_a(e,i))||n.enumerable});return r};var De=(r,e,t)=>(t=r!=null?Aa(Ia(r)):{},Ci(e||!r||!r.__esModule?je(t,"default",{value:r,enumerable:!0}): -t,r)),j=r=>Ci(je({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Pa(r,typeof e!="symbol"?e+"":e,t);var Pi=R(Mt=>{"use strict";p();Mt.byteLength=Ba;Mt.toByteArray=ka;Mt.fromByteArray=Ua;var xe=[],de=[], -Ra=typeof Uint8Array<"u"?Uint8Array:Array,mr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ -23456789+/";for(Oe=0,Ii=mr.length;Oe0)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(Ti,"getLens"); -function Ba(r){var e=Ti(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Ba,"byteLength");function La(r,e,t){return(e+ -t)*3/4-t}a(La,"_byteLength");function ka(r){var e,t=Ti(r),n=t[0],i=t[1],s=new Ra(La(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=de[r.charCodeAt( -c)]<<2|de[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=de[r.charCodeAt(c)]<<10|de[r.charCodeAt(c+1)]<< -4|de[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(ka,"toByteArray");function Fa(r){return xe[r>> -18&63]+xe[r>>12&63]+xe[r>>6&63]+xe[r&63]}a(Fa,"tripletToBase64");function Ma(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(Fa(n));return i.join("")}a(Ma,"en\ -codeChunk");function Ua(r){for(var e,t=r.length,n=t%3,i=[],s=16383,o=0,u=t-n;oe in r?He(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>He(r,"name",{value:e,configurable:!0});var re=(r,e)=>()=>(r&&(e=r(r=0)),e);var R=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fe=(r,e)=>{for(var t in e)He(r,t,{get:e[t], +enumerable:!0})},Ii=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ia(e))!Pa. +call(r,i)&&i!==t&&He(r,i,{get:()=>e[i],enumerable:!(n=Ca(e,i))||n.enumerable});return r};var Ne=(r,e,t)=>(t=r!=null?_a(Ta(r)):{},Ii(e||!r||!r.__esModule?He(t,"default",{value:r,enumerable:!0}): +t,r)),j=r=>Ii(He({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Ra(r,typeof e!="symbol"?e+"":e,t);var Ri=R(Mt=>{"use strict";p();Mt.byteLength=La;Mt.toByteArray=Fa;Mt.fromByteArray=Da;var xe=[],he=[], +Ba=typeof Uint8Array<"u"?Uint8Array:Array,wr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ +23456789+/";for(qe=0,Ti=wr.length;qe0)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(Pi,"getLens"); +function La(r){var e=Pi(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(La,"byteLength");function ka(r,e,t){return(e+ +t)*3/4-t}a(ka,"_byteLength");function Fa(r){var e,t=Pi(r),n=t[0],i=t[1],s=new Ba(ka(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=he[r.charCodeAt( +c)]<<2|he[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=he[r.charCodeAt(c)]<<10|he[r.charCodeAt(c+1)]<< +4|he[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(Fa,"toByteArray");function Ma(r){return xe[r>> +18&63]+xe[r>>12&63]+xe[r>>6&63]+xe[r&63]}a(Ma,"tripletToBase64");function Ua(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(Ma(n));return i.join("")}a(Ua,"en\ +codeChunk");function Da(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(xe[e>>2]+xe[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1], -i.push(xe[e>>10]+xe[e>>4&63]+xe[e<<2&63]+"=")),i.join("")}a(Ua,"fromByteArray")});var Ri=R(wr=>{p();wr.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(xe[e>>10]+xe[e>>4&63]+xe[e<<2&63]+"=")),i.join("")}a(Da,"fromByteArray")});var Bi=R(gr=>{p();gr.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,E=r[e+y];for(y+=g,s=E&(1<<-f)-1,E>>=-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:(E?-1:1)*(1/0);o=o+Math. -pow(2,n),s=s-l}return(E?-1:1)*o*Math.pow(2,s-n)};wr.write=function(r,e,t,n,i,s){var o,u,c,l=s*8-i-1, +pow(2,n),s=s-l}return(E?-1:1)*o*Math.pow(2,s-n)};gr.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,E=n?0:s-1,C=n?1:-1,H=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+E]=u&255,E+= -C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=H*128}});var Vi=R(Ge=>{"use strict";p();var gr=Pi(),He=Ri(),Bi=typeof Symbol=="function"&&typeof Symbol.for== -"function"?Symbol.for("nodejs.util.inspect.custom"):null;Ge.Buffer=d;Ge.SlowBuffer=ja;Ge.INSPECT_MAX_BYTES= -50;var Ut=2147483647;Ge.kMaxLength=Ut;d.TYPED_ARRAY_SUPPORT=Da();!d.TYPED_ARRAY_SUPPORT&&typeof console< +C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=H*128}});var Ki=R(Ke=>{"use strict";p();var br=Ri(),Ge=Bi(),Li=typeof Symbol=="function"&&typeof Symbol.for== +"function"?Symbol.for("nodejs.util.inspect.custom"):null;Ke.Buffer=d;Ke.SlowBuffer=Wa;Ke.INSPECT_MAX_BYTES= +50;var Ut=2147483647;Ke.kMaxLength=Ut;d.TYPED_ARRAY_SUPPORT=Oa();!d.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 Da(){ +pport which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Oa(){ 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(Da,"typedArraySupport");Object. +prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}a(Oa,"typedArraySupport");Object. defineProperty(d.prototype,"parent",{enumerable:!0,get:a(function(){if(d.isBuffer(this))return this. buffer},"get")});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:a(function(){if(d.isBuffer( this))return this.byteOffset},"get")});function Ae(r){if(r>Ut)throw new RangeError('The value "'+r+'\ " is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,d.prototype), e}a(Ae,"createBuffer");function d(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 vr(r)}return Mi(r,e,t)} -a(d,"Buffer");d.poolSize=8192;function Mi(r,e,t){if(typeof r=="string")return Na(r,e);if(ArrayBuffer. -isView(r))return qa(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 Er(r)}return Ui(r,e,t)} +a(d,"Buffer");d.poolSize=8192;function Ui(r,e,t){if(typeof r=="string")return qa(r,e);if(ArrayBuffer. +isView(r))return Qa(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(Se(r,ArrayBuffer)|| r&&Se(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Se(r,SharedArrayBuffer)||r&&Se(r.buffer, -SharedArrayBuffer)))return xr(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument\ +SharedArrayBuffer)))return Sr(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 d. -from(n,e,t);let i=Qa(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. +from(n,e,t);let i=ja(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. toPrimitive]=="function")return d.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(Mi,"from");d.from=function(r,e,t){return Mi(r,e,t)};Object.setPrototypeOf(d.prototype, -Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Ui(r){if(typeof r!="number")throw new TypeError( +ed type "+typeof r)}a(Ui,"from");d.from=function(r,e,t){return Ui(r,e,t)};Object.setPrototypeOf(d.prototype, +Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Di(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(Ui,"assertSize");function Oa(r,e,t){return Ui(r),r<=0?Ae(r):e!==void 0?typeof t== -"string"?Ae(r).fill(e,t):Ae(r).fill(e):Ae(r)}a(Oa,"alloc");d.alloc=function(r,e,t){return Oa(r,e,t)}; -function vr(r){return Ui(r),Ae(r<0?0:Er(r)|0)}a(vr,"allocUnsafe");d.allocUnsafe=function(r){return vr( -r)};d.allocUnsafeSlow=function(r){return vr(r)};function Na(r,e){if((typeof e!="string"||e==="")&&(e= -"utf8"),!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=Di(r,e)|0,n=Ae(t),i=n.write( -r,e);return i!==t&&(n=n.slice(0,i)),n}a(Na,"fromString");function br(r){let e=r.length<0?0:Er(r.length)| -0,t=Ae(e);for(let n=0;n=Ut)throw new RangeError("Attempt to allocate Buffer larger t\ -han maximum size: 0x"+Ut.toString(16)+" bytes");return r|0}a(Er,"checked");function ja(r){return+r!= -r&&(r=0),d.alloc(+r)}a(ja,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== +r,e,t),Object.setPrototypeOf(n,d.prototype),n}a(Sr,"fromArrayBuffer");function ja(r){if(d.isBuffer(r)){ +let e=Ar(r.length)|0,t=Ae(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r. +length!="number"||Cr(r.length)?Ae(0):xr(r);if(r.type==="Buffer"&&Array.isArray(r.data))return xr(r.data)} +a(ja,"fromObject");function Ar(r){if(r>=Ut)throw new RangeError("Attempt to allocate Buffer larger t\ +han maximum size: 0x"+Ut.toString(16)+" bytes");return r|0}a(Ar,"checked");function Wa(r){return+r!= +r&&(r=0),d.alloc(+r)}a(Wa,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== d.prototype},"isBuffer");d.compare=a(function(e,t){if(Se(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)), Se(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.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,121 +77,121 @@ utf-16le":return!0;default:return!1}},"isEncoding");d.concat=a(function(e,t){if( for(t=0,n=0;ni.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(i,s)):Uint8Array.prototype. set.call(i,o,s);else if(d.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 Di(r,e){if(d.isBuffer(r))return r.length; +an Array of Buffers');s+=o.length}return i},"concat");function Oi(r,e){if(d.isBuffer(r))return r.length; if(ArrayBuffer.isView(r)||Se(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 Sr(r).length;case"ucs2":case"\ -ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Gi(r).length;default: -if(i)return n?-1:Sr(r).length;e=(""+e).toLowerCase(),i=!0}}a(Di,"byteLength");d.byteLength=Di;function Wa(r,e,t){ +ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return vr(r).length;case"ucs2":case"\ +ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Vi(r).length;default: +if(i)return n?-1:vr(r).length;e=(""+e).toLowerCase(),i=!0}}a(Oi,"byteLength");d.byteLength=Oi;function Ha(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 Xa(this,e,t);case"u\ -tf8":case"utf-8":return Ni(this,e,t);case"ascii":return Ja(this,e,t);case"latin1":case"binary":return Za( -this,e,t);case"base64":return za(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return eu( -this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(Wa, -"slowToString");d.prototype._isBuffer=!0;function Ne(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(Ne,"swap"); +0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return eu(this,e,t);case"u\ +tf8":case"utf-8":return qi(this,e,t);case"ascii":return Za(this,e,t);case"latin1":case"binary":return Xa( +this,e,t);case"base64":return Ya(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tu( +this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(Ha, +"slowToString");d.prototype._isBuffer=!0;function Qe(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(Qe,"swap"); d.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");Bi&&(d.prototype[Bi]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ +er "+e+">"},"inspect");Li&&(d.prototype[Li]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ if(Se(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.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,_r(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r. +compare");function Ni(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,Cr(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=d.from( -e,n)),d.isBuffer(e))return e.length===0?-1:Li(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array. +e,n)),d.isBuffer(e))return e.length===0?-1:ki(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):Li(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Oi,"bidire\ -ctionalIndexOf");function Li(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):ki(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Ni,"bidire\ +ctionalIndexOf");function ki(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 Ha(this,e,t,n);case"utf8":case"\ -utf-8":return $a(this,e,t,n);case"ascii":case"latin1":case"binary":return Ga(this,e,t,n);case"base64": -return Va(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ka(this,e,t,n);default: +fer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return $a(this,e,t,n);case"utf8":case"\ +utf-8":return Ga(this,e,t,n);case"ascii":case"latin1":case"binary":return Va(this,e,t,n);case"base64": +return Ka(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return za(this,e,t,n);default: if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"write");d.prototype. toJSON=a(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSO\ -N");function za(r,e,t){return e===0&&t===r.length?gr.fromByteArray(r):gr.fromByteArray(r.slice(e,t))} -a(za,"base64Slice");function Ni(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 Ya(n)}a(Ni,"utf8Slice");var ki=4096;function Ya(r){let e=r.length;if(e<=ki)return String. +n.push(o),i+=u}return Ja(n)}a(qi,"utf8Slice");var Fi=4096;function Ja(r){let e=r.length;if(e<=Fi)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,d.prototype),i},"slice");function V(r,e,t){ +e&&(t=e);let i=this.subarray(e,t);return Object.setPrototypeOf(i,d.prototype),i},"slice");function G(r,e,t){ if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to \ -access beyond buffer length")}a(V,"checkOffset");d.prototype.readUintLE=d.prototype.readUIntLE=a(function(e,t,n){ -e=e>>>0,t=t>>>0,n||V(e,t,this.length);let i=this[e],s=1,o=0;for(;++o>>0,t=t>>>0,n||V(e, +access beyond buffer length")}a(G,"checkOffset");d.prototype.readUintLE=d.prototype.readUIntLE=a(function(e,t,n){ +e=e>>>0,t=t>>>0,n||G(e,t,this.length);let i=this[e],s=1,o=0;for(;++o>>0,t=t>>>0,n||G(e, t,this.length);let i=this[e+--t],s=1;for(;t>0&&(s*=256);)i+=this[e+--t]*s;return i},"readUIntBE");d. -prototype.readUint8=d.prototype.readUInt8=a(function(e,t){return e=e>>>0,t||V(e,1,this.length),this[e]}, -"readUInt8");d.prototype.readUint16LE=d.prototype.readUInt16LE=a(function(e,t){return e=e>>>0,t||V(e, +prototype.readUint8=d.prototype.readUInt8=a(function(e,t){return e=e>>>0,t||G(e,1,this.length),this[e]}, +"readUInt8");d.prototype.readUint16LE=d.prototype.readUInt16LE=a(function(e,t){return e=e>>>0,t||G(e, 2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");d.prototype.readUint16BE=d.prototype.readUInt16BE= -a(function(e,t){return e=e>>>0,t||V(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");d.prototype. -readUint32LE=d.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||V(e,4,this.length),(this[e]| +a(function(e,t){return e=e>>>0,t||G(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");d.prototype. +readUint32LE=d.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),(this[e]| this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");d.prototype.readUint32BE=d.prototype. -readUInt32BE=a(function(e,t){return e=e>>>0,t||V(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+ -2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Pe(a(function(e){e=e>>>0,$e(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ft(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* +readUInt32BE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+ +2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Re(a(function(e){e=e>>>0,Ve(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ht(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* 2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<< -BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Pe(a(function(e){e=e>>>0,$e(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ft(e,this.length-8);let i=t*2**24+this[++e]*2**16+ +BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Re(a(function(e){e=e>>>0,Ve(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ht(e,this.length-8);let i=t*2**24+this[++e]*2**16+ this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<>>0,t=t>>>0,n||V(e,t, +32))+BigInt(s)},"readBigUInt64BE"));d.prototype.readIntLE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||G(e,t, this.length);let i=this[e],s=1,o=0;for(;++o=s&&(i-=Math. -pow(2,8*t)),i},"readIntLE");d.prototype.readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||V(e,t,this.length); +pow(2,8*t)),i},"readIntLE");d.prototype.readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||G(e,t,this.length); let i=t,s=1,o=this[e+--i];for(;i>0&&(s*=256);)o+=this[e+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8* -t)),o},"readIntBE");d.prototype.readInt8=a(function(e,t){return e=e>>>0,t||V(e,1,this.length),this[e]& -128?(255-this[e]+1)*-1:this[e]},"readInt8");d.prototype.readInt16LE=a(function(e,t){e=e>>>0,t||V(e,2, +t)),o},"readIntBE");d.prototype.readInt8=a(function(e,t){return e=e>>>0,t||G(e,1,this.length),this[e]& +128?(255-this[e]+1)*-1:this[e]},"readInt8");d.prototype.readInt16LE=a(function(e,t){e=e>>>0,t||G(e,2, this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");d.prototype.readInt16BE= -a(function(e,t){e=e>>>0,t||V(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760: -n},"readInt16BE");d.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||V(e,4,this.length),this[e]| +a(function(e,t){e=e>>>0,t||G(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760: +n},"readInt16BE");d.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]| this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");d.prototype.readInt32BE=a(function(e,t){return e= -e>>>0,t||V(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");d.prototype. -readBigInt64LE=Pe(a(function(e){e=e>>>0,$e(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& -ft(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,t||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");d.prototype. +readBigInt64LE=Re(a(function(e){e=e>>>0,Ve(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& +ht(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,$e(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ft(e,this. +Re(a(function(e){e=e>>>0,Ve(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ht(e,this. length-8);let i=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,t||V(e,4,this.length),He.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= -a(function(e,t){return e=e>>>0,t||V(e,4,this.length),He.read(this,e,!1,23,4)},"readFloatBE");d.prototype. -readDoubleLE=a(function(e,t){return e=e>>>0,t||V(e,8,this.length),He.read(this,e,!0,52,8)},"readDoub\ -leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||V(e,8,this.length),He.read(this,e, +return e=e>>>0,t||G(e,4,this.length),Ge.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= +a(function(e,t){return e=e>>>0,t||G(e,4,this.length),Ge.read(this,e,!1,23,4)},"readFloatBE");d.prototype. +readDoubleLE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ge.read(this,e,!0,52,8)},"readDoub\ +leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ge.read(this,e, !1,52,8)},"readDoubleBE");function ne(r,e,t,n,i,s){if(!d.isBuffer(r))throw new TypeError('"buffer" a\ rgument must be a Buffer instance');if(e>i||er.length)throw new RangeError("Index out of range")}a(ne,"checkInt");d.prototype.writeUintLE= @@ -207,14 +207,14 @@ e>>>8,t+2},"writeUInt16LE");d.prototype.writeUint16BE=d.prototype.writeUInt16BE= writeUint32LE=d.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(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");d.prototype. writeUint32BE=d.prototype.writeUInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(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 qi(r,e,t,n,i){ -$i(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 Qi(r,e,t,n,i){ +Gi(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(qi,"wrtBigUInt64LE");function Qi(r,e,t,n,i){$i(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295)); +8,r[t++]=o,t}a(Qi,"wrtBigUInt64LE");function ji(r,e,t,n,i){Gi(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(Qi,"wrtBigUInt64BE");d.prototype. -writeBigUInt64LE=Pe(a(function(e,t=0){return qi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ -riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Pe(a(function(e,t=0){return Qi(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(ji,"wrtBigUInt64BE");d.prototype. +writeBigUInt64LE=Re(a(function(e,t=0){return Qi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ +riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Re(a(function(e,t=0){return ji(this,e,t,BigInt(0),BigInt( "0xffffffffffffffff"))},"writeBigUInt64BE"));d.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>> 0,!i){let c=Math.pow(2,8*n-1);ne(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");d.prototype.writeIntBE= @@ -228,17 +228,17 @@ e>>>8,this[t+1]=e&255,t+2},"writeInt16BE");d.prototype.writeInt32LE=a(function(e t>>>0,n||ne(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+ 3]=e>>>24,t+4},"writeInt32LE");d.prototype.writeInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne( 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");d.prototype.writeBigInt64LE=Pe(a(function(e,t=0){return qi( +e>>>8,this[t+3]=e&255,t+4},"writeInt32BE");d.prototype.writeBigInt64LE=Re(a(function(e,t=0){return Qi( this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));d.prototype. -writeBigInt64BE=Pe(a(function(e,t=0){return Qi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ -ffffffffffff"))},"writeBigInt64BE"));function ji(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(ji,"checkIEEE754");function Wi(r,e,t,n,i){ -return e=+e,t=t>>>0,i||ji(r,e,t,4,34028234663852886e22,-34028234663852886e22),He.write(r,e,t,n,23,4), -t+4}a(Wi,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return Wi(this,e,t,!0,n)},"writeFl\ -oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return Wi(this,e,t,!1,n)},"writeFloatBE");function Hi(r,e,t,n,i){ -return e=+e,t=t>>>0,i||ji(r,e,t,8,17976931348623157e292,-17976931348623157e292),He.write(r,e,t,n,52, -8),t+8}a(Hi,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return Hi(this,e,t,!0,n)},"wr\ -iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return Hi(this,e,t,!1,n)},"writeDoubleBE"); +writeBigInt64BE=Re(a(function(e,t=0){return ji(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ +ffffffffffff"))},"writeBigInt64BE"));function Wi(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(Wi,"checkIEEE754");function Hi(r,e,t,n,i){ +return e=+e,t=t>>>0,i||Wi(r,e,t,4,34028234663852886e22,-34028234663852886e22),Ge.write(r,e,t,n,23,4), +t+4}a(Hi,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return Hi(this,e,t,!0,n)},"writeFl\ +oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return Hi(this,e,t,!1,n)},"writeFloatBE");function $i(r,e,t,n,i){ +return e=+e,t=t>>>0,i||Wi(r,e,t,8,17976931348623157e292,-17976931348623157e292),Ge.write(r,e,t,n,52, +8),t+8}a($i,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return $i(this,e,t,!0,n)},"wr\ +iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return $i(this,e,t,!1,n)},"writeDoubleBE"); d.prototype.copy=a(function(e,t,n,i){if(!d.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=Fi(String(t)):typeof t=="bigint"&&(i=String( -t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Fi(i)),i+="n"),n+=` It must be ${e}. Re\ -ceived ${i}`,n},RangeError);function Fi(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(Fi,"addNumericalSeparator");function tu(r,e,t){ -$e(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&ft(e,r.length-(t+1))}a(tu,"checkBounds");function $i(r,e,t,n,i,s){ +e ${typeof e}`},TypeError);_r("ERR_OUT_OF_RANGE",function(r,e,t){let n=`The value of "${r}" is out o\ +f range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=Mi(String(t)):typeof t=="bigint"&&(i=String( +t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Mi(i)),i+="n"),n+=` It must be ${e}. Re\ +ceived ${i}`,n},RangeError);function Mi(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(Mi,"addNumericalSeparator");function ru(r,e,t){ +Ve(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&ht(e,r.length-(t+1))}a(ru,"checkBounds");function Gi(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 We.ERR_OUT_OF_RANGE("value",u,r)}tu(n,i,s)}a($i,"checkIntBI");function $e(r,e){if(typeof r!= -"number")throw new We.ERR_INVALID_ARG_TYPE(e,"number",r)}a($e,"validateNumber");function ft(r,e,t){throw Math. -floor(r)!==r?($e(r,t),new We.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new We.ERR_BUFFER_OUT_OF_BOUNDS: -new We.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(ft,"boundsError");var ru=/[^+/0-9A-Za-z-_]/g; -function nu(r){if(r=r.split("=")[0],r=r.trim().replace(ru,""),r.length<2)return"";for(;r.length%4!== -0;)r=r+"=";return r}a(nu,"base64clean");function Sr(r,e){e=e||1/0;let t,n=r.length,i=null,s=[];for(let o=0;o< +nd <= ${t}${o}`,new $e.ERR_OUT_OF_RANGE("value",u,r)}ru(n,i,s)}a(Gi,"checkIntBI");function Ve(r,e){if(typeof r!= +"number")throw new $e.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Ve,"validateNumber");function ht(r,e,t){throw Math. +floor(r)!==r?(Ve(r,t),new $e.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new $e.ERR_BUFFER_OUT_OF_BOUNDS: +new $e.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(ht,"boundsError");var nu=/[^+/0-9A-Za-z-_]/g; +function iu(r){if(r=r.split("=")[0],r=r.trim().replace(nu,""),r.length<2)return"";for(;r.length%4!== +0;)r=r+"=";return r}a(iu,"base64clean");function vr(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(Sr,"utf\ -8ToBytes");function iu(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(su,"utf16leToBytes");function Gi(r){return gr.toByteArray( -nu(r))}a(Gi,"base64ToBytes");function Dt(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) +240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}a(vr,"utf\ +8ToBytes");function su(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(ou,"utf16leToBytes");function Vi(r){return br.toByteArray( +iu(r))}a(Vi,"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 Se(r,e){return r instanceof e||r!=null&&r.constructor!= -null&&r.constructor.name!=null&&r.constructor.name===e.name}a(Se,"isInstance");function _r(r){return r!== -r}a(_r,"numberIsNaN");var ou=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 Pe(r){return typeof BigInt>"u"? -au:r}a(Pe,"defineBigIntMethod");function au(){throw new Error("BigInt not supported")}a(au,"BufferBi\ +null&&r.constructor.name!=null&&r.constructor.name===e.name}a(Se,"isInstance");function Cr(r){return r!== +r}a(Cr,"numberIsNaN");var au=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 Re(r){return typeof BigInt>"u"? +uu:r}a(Re,"defineBigIntMethod");function uu(){throw new Error("BigInt not supported")}a(uu,"BufferBi\ gIntNotDefined")});var S,v,A,m,w,p=re(()=>{"use strict";S=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),A= globalThis.clearImmediate??(r=>clearTimeout(r)),m=typeof globalThis.Buffer=="function"&&typeof globalThis. -Buffer.allocUnsafe=="function"?globalThis.Buffer:Vi().Buffer,w=globalThis.process??{};w.env??(w.env= -{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Re=R((Jf,Cr)=>{"use strict";p();var Ve=typeof Reflect=="object"?Reflect:null,Ki=Ve&&typeof Ve.apply== -"function"?Ve.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Ot; -Ve&&typeof Ve.ownKeys=="function"?Ot=Ve.ownKeys:Object.getOwnPropertySymbols?Ot=a(function(e){return Object. +Buffer.allocUnsafe=="function"?globalThis.Buffer:Ki().Buffer,w=globalThis.process??{};w.env??(w.env= +{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Be=R((Zf,Ir)=>{"use strict";p();var ze=typeof Reflect=="object"?Reflect:null,zi=ze&&typeof ze.apply== +"function"?ze.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Ot; +ze&&typeof ze.ownKeys=="function"?Ot=ze.ownKeys:Object.getOwnPropertySymbols?Ot=a(function(e){return Object. getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Ot=a(function(e){return Object. -getOwnPropertyNames(e)},"ReflectOwnKeys");function uu(r){console&&console.warn&&console.warn(r)}a(uu, -"ProcessEmitWarning");var Yi=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function F(){F. -init.call(this)}a(F,"EventEmitter");Cr.exports=F;Cr.exports.once=hu;F.EventEmitter=F;F.prototype._events= -void 0;F.prototype._eventsCount=0;F.prototype._maxListeners=void 0;var zi=10;function Nt(r){if(typeof r!= +getOwnPropertyNames(e)},"ReflectOwnKeys");function cu(r){console&&console.warn&&console.warn(r)}a(cu, +"ProcessEmitWarning");var Ji=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function M(){M. +init.call(this)}a(M,"EventEmitter");Ir.exports=M;Ir.exports.once=du;M.EventEmitter=M;M.prototype._events= +void 0;M.prototype._eventsCount=0;M.prototype._maxListeners=void 0;var Yi=10;function Nt(r){if(typeof r!= "function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)} -a(Nt,"checkListener");Object.defineProperty(F,"defaultMaxListeners",{enumerable:!0,get:a(function(){ -return zi},"get"),set:a(function(r){if(typeof r!="number"||r<0||Yi(r))throw new RangeError('The valu\ -e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");zi=r}, -"set")});F.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&& +a(Nt,"checkListener");Object.defineProperty(M,"defaultMaxListeners",{enumerable:!0,get:a(function(){ +return Yi},"get"),set:a(function(r){if(typeof r!="number"||r<0||Ji(r))throw new RangeError('The valu\ +e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Yi=r}, +"set")});M.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}; -F.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||Yi(e))throw new RangeError('Th\ +M.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||Ji(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 Ji(r){return r._maxListeners===void 0?F.defaultMaxListeners:r._maxListeners} -a(Ji,"_getMaxListeners");F.prototype.getMaxListeners=a(function(){return Ji(this)},"getMaxListeners"); -F.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")Ki(c,this,t);else for(var l=c. -length,f=rs(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=Zi(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,uu(u)}return r}a(Zi,"_addListener");F.prototype.addListener=a(function(e,t){ -return Zi(this,e,t,!1)},"addListener");F.prototype.on=F.prototype.addListener;F.prototype.prependListener= -a(function(e,t){return Zi(this,e,t,!0)},"prependListener");function cu(){if(!this.fired)return this. +r,u.type=e,u.count=o.length,cu(u)}return r}a(Xi,"_addListener");M.prototype.addListener=a(function(e,t){ +return Xi(this,e,t,!1)},"addListener");M.prototype.on=M.prototype.addListener;M.prototype.prependListener= +a(function(e,t){return Xi(this,e,t,!0)},"prependListener");function lu(){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(cu,"onceWrapper");function Xi(r,e,t){var n={fired:!1, -wrapFn:void 0,target:r,type:e,listener:t},i=cu.bind(n);return i.listener=t,n.wrapFn=i,i}a(Xi,"_onceW\ -rap");F.prototype.once=a(function(e,t){return Nt(t),this.on(e,Xi(this,e,t)),this},"once");F.prototype. -prependOnceListener=a(function(e,t){return Nt(t),this.prependListener(e,Xi(this,e,t)),this},"prepend\ -OnceListener");F.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(Nt(t),i=this._events,i=== +target):this.listener.apply(this.target,arguments)}a(lu,"onceWrapper");function es(r,e,t){var n={fired:!1, +wrapFn:void 0,target:r,type:e,listener:t},i=lu.bind(n);return i.listener=t,n.wrapFn=i,i}a(es,"_onceW\ +rap");M.prototype.once=a(function(e,t){return Nt(t),this.on(e,es(this,e,t)),this},"once");M.prototype. +prependOnceListener=a(function(e,t){return Nt(t),this.prependListener(e,es(this,e,t)),this},"prepend\ +OnceListener");M.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(Nt(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():lu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== -void 0&&this.emit("removeListener",e,u||t)}return this},"removeListener");F.prototype.off=F.prototype. -removeListener;F.prototype.removeAllListeners=a(function(e){var t,n,i;if(n=this._events,n===void 0)return this; +listener,s=o;break}if(s<0)return this;s===0?n.shift():fu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== +void 0&&this.emit("removeListener",e,u||t)}return this},"removeListener");M.prototype.off=M.prototype. +removeListener;M.prototype.removeAllListeners=a(function(e){var t,n,i;if(n=this._events,n===void 0)return this; if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount= 0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments. length===0){var s=Object.keys(n),o;for(i=0;i= -0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function es(r,e,t){var n=r._events; +0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function ts(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? -fu(i):rs(i,i.length)}a(es,"_listeners");F.prototype.listeners=a(function(e){return es(this,e,!0)},"l\ -isteners");F.prototype.rawListeners=a(function(e){return es(this,e,!1)},"rawListeners");F.listenerCount= -function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):ts.call(r,e)};F.prototype. -listenerCount=ts;function ts(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(ts,"listenerCount");F.prototype.eventNames=a(function(){ -return this._eventsCount>0?Ot(this._events):[]},"eventNames");function rs(r,e){for(var t=new Array(e), -n=0;n0?Ot(this._events):[]},"eventNames");function ns(r,e){for(var t=new Array(e), +n=0;nbe,isIP:()=>pu});function pu(r){return 0}var ss,is,_,be,Ke=re(()=>{"use \ -strict";p();ss=De(Re(),1);a(pu,"isIP");is=/^[^.]+\./,_=class _ extends ss.EventEmitter{constructor(){ +ust be of type EventEmitter. Received type '+typeof r)}a(is,"eventTargetAgnosticAddListener")});var as={};fe(as,{Socket:()=>be,isIP:()=>yu});function yu(r){return 0}var os,ss,_,be,Ye=re(()=>{"use \ +strict";p();os=Ne(Be(),1);a(yu,"isIP");ss=/^[^.]+\./,_=class _ extends os.EventEmitter{constructor(){ super(...arguments);I(this,"opts",{});I(this,"connecting",!1);I(this,"pending",!0);I(this,"writable", !0);I(this,"encrypted",!1);I(this,"authorized",!1);I(this,"destroyed",!1);I(this,"ws",null);I(this,"\ writeBuffer");I(this,"tlsState",0);I(this,"tlsRead");I(this,"tlsWrite")}static get poolQueryViaFetch(){ @@ -423,16 +423,16 @@ 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=m.alloc(0),n="utf8",i=()=>{}){return this.write(t,n,()=>{this. ws.close(),i()}),this}destroy(){return this.destroyed=!0,this.end()}};a(_,"Socket"),I(_,"defaults",{ -poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{let s;return i?.jwtAuth?s=t.replace(is,"apiauth."):s= -t.replace(is,"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(ss,"apiauth."):s= +t.replace(ss,"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}),I(_,"opts",{});be=_});var as={};he(as,{parse:()=>Ir});function Ir(r,e=!1){let{protocol:t}=new URL(r),n="http:"+r.substring( +disableWarningInBrowsers:!1}),I(_,"opts",{});be=_});var us={};fe(us,{parse:()=>Tr});function Tr(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 E=i+":"+s,C=e?Object. fromEntries(y.entries()):f;return{href:r,protocol:t,auth:E,username:i,password:s,host:o,hostname:u,port:c, -pathname:l,search:f,query:C,hash:g}}var Tr=re(()=>{"use strict";p();a(Ir,"parse")});var Hr=R(Cs=>{"use strict";p();Cs.parse=function(r,e){return new Wr(r,e).parse()};var Kt=class Kt{constructor(e,t){ -this.source=e,this.transform=t||qu,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){ +pathname:l,search:f,query:C,hash:g}}var Pr=re(()=>{"use strict";p();a(Tr,"parse")});var $r=R(Is=>{"use strict";p();Is.parse=function(r,e){return new Hr(r,e).parse()};var Kt=class Kt{constructor(e,t){ +this.source=e,this.transform=t||Qu,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), @@ -443,109 +443,109 @@ dimension>1&&(n=new Kt(this.source.substr(this.position-1),this.transform),this. !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(Kt,"ArrayParser");var Wr=Kt;function qu(r){return r}a(qu,"ide\ -ntity")});var $r=R((vh,Is)=>{p();var Qu=Hr();Is.exports={create:a(function(r,e){return{parse:a(function(){return Qu. -parse(r,e)},"parse")}},"create")}});var Rs=R((_h,Ps)=>{"use strict";p();var ju=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, -Wu=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Hu=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,$u=/^-?infinity$/;Ps. -exports=a(function(e){if($u.test(e))return Number(e.replace("i","I"));var t=ju.exec(e);if(!t)return Gu( -e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Ts(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=Vu(e);return g!=null? -(y=new Date(Date.UTC(i,s,o,u,c,l,f)),Gr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= -new Date(i,s,o,u,c,l,f),Gr(i)&&y.setFullYear(i)),y},"parseDate");function Gu(r){var e=Wu.exec(r);if(e){ -var t=parseInt(e[1],10),n=!!e[4];n&&(t=Ts(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return Gr( -t)&&o.setFullYear(t),o}}a(Gu,"getDate");function Vu(r){if(r.endsWith("+00"))return 0;var e=Hu.exec(r. +not balanced");return this.entries}};a(Kt,"ArrayParser");var Hr=Kt;function Qu(r){return r}a(Qu,"ide\ +ntity")});var Gr=R((Eh,Ts)=>{p();var ju=$r();Ts.exports={create:a(function(r,e){return{parse:a(function(){return ju. +parse(r,e)},"parse")}},"create")}});var Bs=R((Ch,Rs)=>{"use strict";p();var Wu=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, +Hu=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,$u=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Gu=/^-?infinity$/;Rs. +exports=a(function(e){if(Gu.test(e))return Number(e.replace("i","I"));var t=Wu.exec(e);if(!t)return Vu( +e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Ps(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=Ku(e);return g!=null? +(y=new Date(Date.UTC(i,s,o,u,c,l,f)),Vr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= +new Date(i,s,o,u,c,l,f),Vr(i)&&y.setFullYear(i)),y},"parseDate");function Vu(r){var e=Hu.exec(r);if(e){ +var t=parseInt(e[1],10),n=!!e[4];n&&(t=Ps(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return Vr( +t)&&o.setFullYear(t),o}}a(Vu,"getDate");function Ku(r){if(r.endsWith("+00"))return 0;var e=$u.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(Vu,"timeZoneOffset");function Ts(r){return-(r- -1)}a(Ts,"bcYearToNegativeYear");function Gr(r){return r>=0&&r<100}a(Gr,"is0To99")});var Ls=R((Th,Bs)=>{p();Bs.exports=zu;var Ku=Object.prototype.hasOwnProperty;function zu(r){for(var e=1;e< -arguments.length;e++){var t=arguments[e];for(var n in t)Ku.call(t,n)&&(r[n]=t[n])}return r}a(zu,"ext\ -end")});var Ms=R((Bh,Fs)=>{"use strict";p();var Yu=Ls();Fs.exports=tt;function tt(r){if(!(this instanceof tt)) -return new tt(r);Yu(this,uc(r))}a(tt,"PostgresInterval");var Ju=["seconds","minutes","hours","days", -"months","years"];tt.prototype.toPostgres=function(){var r=Ju.filter(this.hasOwnProperty,this);return this. +e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(Ku,"timeZoneOffset");function Ps(r){return-(r- +1)}a(Ps,"bcYearToNegativeYear");function Vr(r){return r>=0&&r<100}a(Vr,"is0To99")});var ks=R((Ph,Ls)=>{p();Ls.exports=Yu;var zu=Object.prototype.hasOwnProperty;function Yu(r){for(var e=1;e< +arguments.length;e++){var t=arguments[e];for(var n in t)zu.call(t,n)&&(r[n]=t[n])}return r}a(Yu,"ext\ +end")});var Us=R((Lh,Ms)=>{"use strict";p();var Ju=ks();Ms.exports=nt;function nt(r){if(!(this instanceof nt)) +return new nt(r);Ju(this,cc(r))}a(nt,"PostgresInterval");var Zu=["seconds","minutes","hours","days", +"months","years"];nt.prototype.toPostgres=function(){var r=Zu.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 Zu={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ -S"},Xu=["years","months","days"],ec=["hours","minutes","seconds"];tt.prototype.toISOString=tt.prototype. -toISO=function(){var r=Xu.map(t,this).join(""),e=ec.map(t,this).join("");return"P"+r+"T"+e;function t(n){ +"")),t+" "+e},this).join(" ")};var Xu={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ +S"},ec=["years","months","days"],tc=["hours","minutes","seconds"];nt.prototype.toISOString=nt.prototype. +toISO=function(){var r=ec.map(t,this).join(""),e=tc.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+Zu[n]}};var Vr="([+-]?\\d+)",tc=Vr+"\\s+years?",rc=Vr+"\\s+mons?",nc=Vr+"\\s+days?",ic="\ -([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",sc=new RegExp([tc,rc,nc,ic].map(function(r){return"\ -("+r+")?"}).join("\\s*")),ks={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, -oc=["hours","minutes","seconds","milliseconds"];function ac(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}a(ac,"parseMilliseconds");function uc(r){if(!r)return{};var e=sc.exec(r),t=e[8]==="-";return Object. -keys(ks).reduce(function(n,i){var s=ks[i],o=e[s];return!o||(o=i==="milliseconds"?ac(o):parseInt(o,10), -!o)||(t&&~oc.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(uc,"parse")});var Ds=R((Fh,Us)=>{"use strict";p();Us.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( +/0+$/,"")),i+Xu[n]}};var Kr="([+-]?\\d+)",rc=Kr+"\\s+years?",nc=Kr+"\\s+mons?",ic=Kr+"\\s+days?",sc="\ +([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",oc=new RegExp([rc,nc,ic,sc].map(function(r){return"\ +("+r+")?"}).join("\\s*")),Fs={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, +ac=["hours","minutes","seconds","milliseconds"];function uc(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(uc,"parseMilliseconds");function cc(r){if(!r)return{};var e=oc.exec(r),t=e[8]==="-";return Object. +keys(Fs).reduce(function(n,i){var s=Fs[i],o=e[s];return!o||(o=i==="milliseconds"?uc(o):parseInt(o,10), +!o)||(t&&~ac.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(cc,"parse")});var Os=R((Mh,Ds)=>{"use strict";p();Ds.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( 2),"hex");for(var t="",n=0;n{p();var bt=Hr(),xt=$r(),zt=Rs(),Ns=Ms(),qs=Ds();function Yt(r){return a(function(t){ -return t===null?t:r(t)},"nullAllowed")}a(Yt,"allowNull");function Qs(r){return r===null?r:r==="TRUE"|| -r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(Qs,"parseBool");function cc(r){return r? -bt.parse(r,Qs):null}a(cc,"parseBoolArray");function lc(r){return parseInt(r,10)}a(lc,"parseBaseTenIn\ -t");function Kr(r){return r?bt.parse(r,Yt(lc)):null}a(Kr,"parseIntegerArray");function fc(r){return r? -bt.parse(r,Yt(function(e){return js(e).trim()})):null}a(fc,"parseBigIntegerArray");var hc=a(function(r){ -if(!r)return null;var e=xt.create(r,function(t){return t!==null&&(t=Zr(t)),t});return e.parse()},"pa\ -rsePointArray"),zr=a(function(r){if(!r)return null;var e=xt.create(r,function(t){return t!==null&&(t= -parseFloat(t)),t});return e.parse()},"parseFloatArray"),me=a(function(r){if(!r)return null;var e=xt. -create(r);return e.parse()},"parseStringArray"),Yr=a(function(r){if(!r)return null;var e=xt.create(r, -function(t){return t!==null&&(t=zt(t)),t});return e.parse()},"parseDateArray"),dc=a(function(r){if(!r) -return null;var e=xt.create(r,function(t){return t!==null&&(t=Ns(t)),t});return e.parse()},"parseInt\ -ervalArray"),pc=a(function(r){return r?bt.parse(r,Yt(qs)):null},"parseByteAArray"),Jr=a(function(r){ -return parseInt(r,10)},"parseInteger"),js=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ -parseBigInteger"),Os=a(function(r){return r?bt.parse(r,Yt(JSON.parse)):null},"parseJsonArray"),Zr=a( +parseBytea")});var $s=R((Oh,Hs)=>{p();var xt=$r(),St=Gr(),zt=Bs(),qs=Us(),Qs=Os();function Yt(r){return a(function(t){ +return t===null?t:r(t)},"nullAllowed")}a(Yt,"allowNull");function js(r){return r===null?r:r==="TRUE"|| +r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(js,"parseBool");function lc(r){return r? +xt.parse(r,js):null}a(lc,"parseBoolArray");function fc(r){return parseInt(r,10)}a(fc,"parseBaseTenIn\ +t");function zr(r){return r?xt.parse(r,Yt(fc)):null}a(zr,"parseIntegerArray");function hc(r){return r? +xt.parse(r,Yt(function(e){return Ws(e).trim()})):null}a(hc,"parseBigIntegerArray");var dc=a(function(r){ +if(!r)return null;var e=St.create(r,function(t){return t!==null&&(t=Xr(t)),t});return e.parse()},"pa\ +rsePointArray"),Yr=a(function(r){if(!r)return null;var e=St.create(r,function(t){return t!==null&&(t= +parseFloat(t)),t});return e.parse()},"parseFloatArray"),ye=a(function(r){if(!r)return null;var e=St. +create(r);return e.parse()},"parseStringArray"),Jr=a(function(r){if(!r)return null;var e=St.create(r, +function(t){return t!==null&&(t=zt(t)),t});return e.parse()},"parseDateArray"),pc=a(function(r){if(!r) +return null;var e=St.create(r,function(t){return t!==null&&(t=qs(t)),t});return e.parse()},"parseInt\ +ervalArray"),yc=a(function(r){return r?xt.parse(r,Yt(Qs)):null},"parseByteAArray"),Zr=a(function(r){ +return parseInt(r,10)},"parseInteger"),Ws=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ +parseBigInteger"),Ns=a(function(r){return r?xt.parse(r,Yt(JSON.parse)):null},"parseJsonArray"),Xr=a( function(r){return r[0]!=="("?null:(r=r.substring(1,r.length-1).split(","),{x:parseFloat(r[0]),y:parseFloat( -r[1])})},"parsePoint"),yc=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, +r[1])})},"parsePoint"),mc=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, i=2;i{"use strict";p();var se=1e6;function wc(r){var e=r.readInt32BE(0),t=r.readUInt32BE( +r[i])}var s=Xr(e);return s.radius=parseFloat(t),s},"parseCircle"),wc=a(function(r){r(20,Ws),r(21,Zr), +r(23,Zr),r(26,Zr),r(700,parseFloat),r(701,parseFloat),r(16,js),r(1082,zt),r(1114,zt),r(1184,zt),r(600, +Xr),r(651,ye),r(718,mc),r(1e3,lc),r(1001,yc),r(1005,zr),r(1007,zr),r(1028,zr),r(1016,hc),r(1017,dc), +r(1021,Yr),r(1022,Yr),r(1231,Yr),r(1014,ye),r(1015,ye),r(1008,ye),r(1009,ye),r(1040,ye),r(1041,ye),r( +1115,Jr),r(1182,Jr),r(1185,Jr),r(1186,qs),r(1187,pc),r(17,Qs),r(114,JSON.parse.bind(JSON)),r(3802,JSON. +parse.bind(JSON)),r(199,Ns),r(3807,Ns),r(3907,ye),r(2951,ye),r(791,ye),r(1183,ye),r(1270,ye)},"init"); +Hs.exports={init:wc}});var Vs=R((Qh,Gs)=>{"use strict";p();var se=1e6;function gc(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%se,e=e/se>>>0,o=4294967296* s+t,t=o/se>>>0,u=""+(o-se*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/se>>>0,u=""+(o-se*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/se>>>0,u=""+(o- se*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var gc=Gs(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,H){return E* +s+t,u=""+o%se,n+u+i}a(gc,"readInt8");Gs.exports=gc});var Zs=R((Hh,Js)=>{p();var bc=Vs(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,H){return E* Math.pow(2,H)+C};var s=t>>3,o=a(function(E){return n?~E&255:E},"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"),zs=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"),Ys=a(function(r,e,t){var n=Math. pow(2,t-1)-1,i=U(r,1),s=U(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=U(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"),bc=a(function(r){ -return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),Vs=a(function(r){return U(r,1)==1?-1*(U( -r,31,1,!0)+1):U(r,31,1)},"parseInt32"),xc=a(function(r){return zs(r,23,8)},"parseFloat32"),Sc=a(function(r){ -return zs(r,52,11)},"parseFloat64"),vc=a(function(r){var e=U(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"),xc=a(function(r){ +return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),Ks=a(function(r){return U(r,1)==1?-1*(U( +r,31,1,!0)+1):U(r,31,1)},"parseInt32"),Sc=a(function(r){return Ys(r,23,8)},"parseFloat32"),vc=a(function(r){ +return Ys(r,52,11)},"parseFloat64"),Ec=a(function(r){var e=U(r,16,32);if(e==49152)return NaN;for(var t=Math. pow(1e4,U(r,16,16)),n=0,i=[],s=U(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 E=l.shift();for(g= 0;g0},"parseBool"),_c=a(function(r){r(20,gc),r(21,bc),r(23,Vs),r(26,Vs),r(1700,vc),r(700,xc), -r(701,Sc),r(16,Ac),r(1114,Ks.bind(null,!1)),r(1184,Ks.bind(null,!0)),r(1e3,St),r(1007,St),r(1016,St), -r(1008,St),r(1009,St),r(25,Ec)},"init");Ys.exports={init:_c}});var Xs=R((Gh,Zs)=>{p();Zs.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25, +"parseArray"),Ac=a(function(r){return r.toString("utf8")},"parseText"),_c=a(function(r){return r===null? +null:U(r,8)>0},"parseBool"),Cc=a(function(r){r(20,bc),r(21,xc),r(23,Ks),r(26,Ks),r(1700,Ec),r(700,Sc), +r(701,vc),r(16,_c),r(1114,zs.bind(null,!1)),r(1184,zs.bind(null,!0)),r(1e3,vt),r(1007,vt),r(1016,vt), +r(1008,vt),r(1009,vt),r(25,Ac)},"init");Js.exports={init:Cc}});var eo=R((Vh,Xs)=>{p();Xs.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 At=R(Et=>{p();var Cc=Hs(),Ic=Js(),Tc=$r(),Pc=Xs();Et.getTypeParser=Rc;Et.setTypeParser=Bc;Et.arrayParser= -Tc;Et.builtins=Pc;var vt={text:{},binary:{}};function eo(r){return String(r)}a(eo,"noParse");function Rc(r,e){ -return e=e||"text",vt[e]&&vt[e][r]||eo}a(Rc,"getTypeParser");function Bc(r,e,t){typeof e=="function"&& -(t=e,e="text"),vt[e][r]=t}a(Bc,"setTypeParser");Cc.init(function(r,e){vt.text[r]=e});Ic.init(function(r,e){ -vt.binary[r]=e})});var Zt=R((Jh,to)=>{"use strict";p();var Lc=At();function Jt(r){this._types=r||Lc,this.text={},this.binary= +REGROLE:4096}});var _t=R(At=>{p();var Ic=$s(),Tc=Zs(),Pc=Gr(),Rc=eo();At.getTypeParser=Bc;At.setTypeParser=Lc;At.arrayParser= +Pc;At.builtins=Rc;var Et={text:{},binary:{}};function to(r){return String(r)}a(to,"noParse");function Bc(r,e){ +return e=e||"text",Et[e]&&Et[e][r]||to}a(Bc,"getTypeParser");function Lc(r,e,t){typeof e=="function"&& +(t=e,e="text"),Et[e][r]=t}a(Lc,"setTypeParser");Ic.init(function(r,e){Et.text[r]=e});Tc.init(function(r,e){ +Et.binary[r]=e})});var Zt=R((Zh,ro)=>{"use strict";p();var kc=_t();function Jt(r){this._types=r||kc,this.text={},this.binary= {}}a(Jt,"TypeOverrides");Jt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ binary":return this.binary;default:return{}}};Jt.prototype.setTypeParser=function(r,e,t){typeof e=="\ function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Jt.prototype.getTypeParser=function(r,e){return e= -e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};to.exports=Jt});function _t(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119,o=2600822924,u=528734635, +e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};ro.exports=Jt});function Ct(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, @@ -553,21 +553,21 @@ c=1541459225,l=0,f=0,y=[1116352408,1899447441,3049323471,3921009573,961987163,15 1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909, 275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222, 2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=a((T,b)=>T>>>b|T<<32- -b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),H=a(()=>{for(let M=0,Z=0;M<16;M++,Z+=4)E[M]=C[Z]<< -24|C[Z+1]<<16|C[Z+2]<<8|C[Z+3];for(let M=16;M<64;M++){let Z=g(E[M-15],7)^g(E[M-15],18)^E[M-15]>>>3,Ee=g( -E[M-2],17)^g(E[M-2],19)^E[M-2]>>>10;E[M]=E[M-16]+Z+E[M-7]+Ee|0}let T=e,b=t,k=n,ae=i,$=s,Ie=o,fe=u,ue=c; -for(let M=0;M<64;M++){let Z=g($,6)^g($,11)^g($,25),Ee=$&Ie^~$&fe,Te=ue+Z+Ee+y[M]+E[M]|0,Fe=g(T,2)^g( -T,13)^g(T,22),Me=T&b^T&k^b&k,lt=Fe+Me|0;ue=fe,fe=Ie,Ie=$,$=ae+Te|0,ae=k,k=b,b=T,T=Te+lt|0}e=e+T|0,t= -t+b|0,n=n+k|0,i=i+ae|0,s=s+$|0,o=o+Ie|0,u=u+fe|0,c=c+ue|0,f=0},"process"),J=a(T=>{typeof T=="string"&& +b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),H=a(()=>{for(let k=0,Z=0;k<16;k++,Z+=4)E[k]=C[Z]<< +24|C[Z+1]<<16|C[Z+2]<<8|C[Z+3];for(let k=16;k<64;k++){let Z=g(E[k-15],7)^g(E[k-15],18)^E[k-15]>>>3,Ee=g( +E[k-2],17)^g(E[k-2],19)^E[k-2]>>>10;E[k]=E[k-16]+Z+E[k-7]+Ee|0}let T=e,b=t,F=n,ae=i,$=s,ge=o,Ie=u,ce=c; +for(let k=0;k<64;k++){let Z=g($,6)^g($,11)^g($,25),Ee=$&ge^~$&Ie,Te=ce+Z+Ee+y[k]+E[k]|0,Me=g(T,2)^g( +T,13)^g(T,22),Ue=T&b^T&F^b&F,De=Me+Ue|0;ce=Ie,Ie=ge,ge=$,$=ae+Te|0,ae=F,F=b,b=T,T=Te+De|0}e=e+T|0,t= +t+b|0,n=n+F|0,i=i+ae|0,s=s+$|0,o=o+ge|0,u=u+Ie|0,c=c+ce|0,f=0},"process"),J=a(T=>{typeof T=="string"&& (T=new TextEncoder().encode(T));for(let b=0;b{if(C[f++]=128,f==64&&H(),f+8>64){for(;f<64;)C[f++]=0;H()}for(;f<58;)C[f++]=0;let T=l*8;C[f++]= +we=a(()=>{if(C[f++]=128,f==64&&H(),f+8>64){for(;f<64;)C[f++]=0;H()}for(;f<58;)C[f++]=0;let T=l*8;C[f++]= T/1099511627776&255,C[f++]=T/4294967296&255,C[f++]=T>>>24,C[f++]=T>>>16&255,C[f++]=T>>>8&255,C[f++]= T&255,H();let b=new Uint8Array(32);return b[0]=e>>>24,b[1]=e>>>16&255,b[2]=e>>>8&255,b[3]=e&255,b[4]= t>>>24,b[5]=t>>>16&255,b[6]=t>>>8&255,b[7]=t&255,b[8]=n>>>24,b[9]=n>>>16&255,b[10]=n>>>8&255,b[11]=n& 255,b[12]=i>>>24,b[13]=i>>>16&255,b[14]=i>>>8&255,b[15]=i&255,b[16]=s>>>24,b[17]=s>>>16&255,b[18]=s>>> 8&255,b[19]=s&255,b[20]=o>>>24,b[21]=o>>>16&255,b[22]=o>>>8&255,b[23]=o&255,b[24]=u>>>24,b[25]=u>>>16& 255,b[26]=u>>>8&255,b[27]=u&255,b[28]=c>>>24,b[29]=c>>>16&255,b[30]=c>>>8&255,b[31]=c&255,b},"digest"); -return r===void 0?{add:J,digest:ge}:(J(r),ge())}var ro=re(()=>{"use strict";p();a(_t,"sha256")});var Q,Ct,no=re(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ +return r===void 0?{add:J,digest:we}:(J(r),we())}var no=re(()=>{"use strict";p();a(Ct,"sha256")});var Q,It,io=re(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ Length",0);I(this,"_state",new Int32Array(4));I(this,"_buffer",new ArrayBuffer(68));I(this,"_buffer8"); I(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 Q._md5cycle(this._state,i),e?this._state:Q._hex( this._state)}};a(Q,"Md5"),I(Q,"stateIdentity",new Int32Array([1732584193,-271733879,-1732584194,271733878])), I(Q,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),I(Q,"hexChars","0123456789\ -abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);Ct=Q});var Xr={};he(Xr,{createHash:()=>Fc,createHmac:()=>Mc,randomBytes:()=>kc});function kc(r){return crypto. -getRandomValues(m.alloc(r))}function Fc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( -function(){return m.from(_t(e))},"digest")}},"update")};if(r==="md5")return{update:a(function(e){return{ -digest:a(function(){return typeof e=="string"?Ct.hashStr(e):Ct.hashByteArray(e)},"digest")}},"update")}; -throw new Error(`Hash type '${r}' not supported`)}function Mc(r,e){if(r!=="sha256")throw new Error(`\ +abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);It=Q});var en={};fe(en,{createHash:()=>Mc,createHmac:()=>Uc,randomBytes:()=>Fc});function Fc(r){return crypto. +getRandomValues(m.alloc(r))}function Mc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( +function(){return m.from(Ct(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 Uc(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=_t(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=Ct(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(_t(o),64),m.from(_t(u))}, -"digest")}},"update")}}var en=re(()=>{"use strict";p();ro();no();a(kc,"randomBytes");a(Fc,"createHas\ -h");a(Mc,"createHmac")});var It=R((ld,tn)=>{"use strict";p();tn.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: +64);o.set(i,0),o.set(t,64);let u=new Uint8Array(96);return u.set(s,0),u.set(Ct(o),64),m.from(Ct(u))}, +"digest")}},"update")}}var tn=re(()=>{"use strict";p();no();io();a(Fc,"randomBytes");a(Mc,"createHas\ +h");a(Uc,"createHmac")});var Tt=R((fd,rn)=>{"use strict";p();rn.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: w.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 rt=At(),Uc=rt.getTypeParser(20,"text"),Dc=rt.getTypeParser(1016, -"text");tn.exports.__defineSetter__("parseInt8",function(r){rt.setTypeParser(20,"text",r?rt.getTypeParser( -23,"text"):Uc),rt.setTypeParser(1016,"text",r?rt.getTypeParser(1007,"text"):Dc)})});var Tt=R((hd,so)=>{"use strict";p();var Oc=(en(),j(Xr)),Nc=It();function qc(r){var e=r.replace(/\\/g, -"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(qc,"escapeElement");function io(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+io(r[t]): -r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=qc(Xt(r[t]));return e=e+"}",e}a(io,"arrayString"); +keepalives:1,keepalives_idle:0};var it=_t(),Dc=it.getTypeParser(20,"text"),Oc=it.getTypeParser(1016, +"text");rn.exports.__defineSetter__("parseInt8",function(r){it.setTypeParser(20,"text",r?it.getTypeParser( +23,"text"):Dc),it.setTypeParser(1016,"text",r?it.getTypeParser(1007,"text"):Oc)})});var Pt=R((dd,oo)=>{"use strict";p();var Nc=(tn(),j(en)),qc=Tt();function Qc(r){var e=r.replace(/\\/g, +"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(Qc,"escapeElement");function so(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+so(r[t]): +r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=Qc(Xt(r[t]));return e=e+"}",e}a(so,"arrayString"); var Xt=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. 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?Nc.parseInputDatesAsUTC?Wc(r):jc(r):Array.isArray(r)?io(r):typeof r== -"object"?Qc(r,e):r.toString()},"prepareValue");function Qc(r,e){if(r&&typeof r.toPostgres=="function"){ +r.byteLength)}return r instanceof Date?qc.parseInputDatesAsUTC?Hc(r):Wc(r):Array.isArray(r)?so(r):typeof r== +"object"?jc(r,e):r.toString()},"prepareValue");function jc(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),Xt(r.toPostgres(Xt),e)}return JSON.stringify(r)}a(Qc,"prepareObject");function Y(r,e){ -for(r=""+r;r.lengthJc});var Jc,Rt=re(()=>{"use strict";p();Jc={}});var wo=R((Cd,mo)=>{"use strict";p();var on=(en(),j(Xr));function Zc(r){if(r.indexOf("SCRAM-SHA-256")=== --1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=on.randomBytes( +t),r}a($c,"normalizeQueryConfig");var nn=a(function(r){return Nc.createHash("md5").update(r,"utf-8"). +digest("hex")},"md5"),Gc=a(function(r,e,t){var n=nn(e+r),i=nn(m.concat([m.from(n),t]));return"md5"+i}, +"postgresMd5PasswordHash");oo.exports={prepareValue:a(function(e){return Xt(e)},"prepareValueWrapper"), +normalizeQueryConfig:$c,postgresMd5PasswordHash:Gc,md5:nn}});var Rt={};fe(Rt,{default:()=>Zc});var Zc,Bt=re(()=>{"use strict";p();Zc={}});var go=R((Id,wo)=>{"use strict";p();var an=(tn(),j(en));function Xc(r){if(r.indexOf("SCRAM-SHA-256")=== +-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=an.randomBytes( 18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"\ -SASLInitialResponse"}}a(Zc,"startSession");function Xc(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( +SASLInitialResponse"}}a(Xc,"startSession");function el(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=rl(t);if(n.nonce.startsWith(r.clientNonce)){ +L: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=nl(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=m.from(n.salt,"base64"),s=sl(e,i,n.iteration),o=nt(s,"Client Key"),u=il( +art with client nonce");var i=m.from(n.salt,"base64"),s=ol(e,i,n.iteration),o=st(s,"Client Key"),u=sl( 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=nt(u,y),E=yo(o,g),C=E.toString("base64"),H=nt(s,"Server Key"),J=nt(H,y);r.message="SAS\ -LResponse",r.serverSignature=J.toString("base64"),r.response=f+",p="+C}a(Xc,"continueSession");function el(r,e){ +","+l+","+f,g=st(u,y),E=mo(o,g),C=E.toString("base64"),H=st(s,"Server Key"),J=st(H,y);r.message="SAS\ +LResponse",r.serverSignature=J.toString("base64"),r.response=f+",p="+C}a(el,"continueSession");function tl(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}=nl( +"string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=il( e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does\ - not match")}a(el,"finalizeSession");function tl(r){if(typeof r!="string")throw new TypeError("SASL:\ + not match")}a(tl,"finalizeSession");function rl(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(tl,"isPrintableChars");function ho(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(r)}a(ho,"isBase64");function po(r){if(typeof r!="string")throw new TypeError("SASL: attribute p\ +e<=126)}a(rl,"isPrintableChars");function po(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(r)}a(po,"isBase64");function yo(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(po,"parseAttribute\ -Pairs");function rl(r){let e=po(r),t=e.get("r");if(t){if(!tl(t))throw new Error("SASL: SCRAM-SERVER-\ +SASL: Invalid attribute pair entry");let t=e[0],n=e.substring(2);return[t,n]}))}a(yo,"parseAttribute\ +Pairs");function nl(r){let e=yo(r),t=e.get("r");if(t){if(!rl(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(!ho(n))throw new Error("SASL: SCRAM-SERV\ +ER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!po(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(rl,"parseServerFirstMessage"); -function nl(r){let t=po(r).get("v");if(t){if(!ho(t))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAG\ +tion missing");let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(nl,"parseServerFirstMessage"); +function il(r){let t=yo(r).get("v");if(t){if(!po(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(nl,"parseServerFinalMessage");function yo(r,e){if(!m. +signature is missing");return{serverSignature:t}}a(il,"parseServerFinalMessage");function mo(r,e){if(!m. isBuffer(r))throw new TypeError("first argument must be a Buffer");if(!m.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 m.from(r.map((t,n)=>r[n]^e[n]))} -a(yo,"xorBuffers");function il(r){return on.createHash("sha256").update(r).digest()}a(il,"sha256");function nt(r,e){ -return on.createHmac("sha256",r).update(e).digest()}a(nt,"hmacSha256");function sl(r,e,t){for(var n=nt( -r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sol});function ol(...r){return r.join("/")}var un=re(()=>{"use strict";p(); -a(ol,"join")});var cn={};he(cn,{stat:()=>al});function al(r,e){e(new Error("No filesystem"))}var ln=re(()=>{"use st\ -rict";p();a(al,"stat")});var fn={};he(fn,{default:()=>ul});var ul,hn=re(()=>{"use strict";p();ul={}});var go={};he(go,{StringDecoder:()=>dn});var pn,dn,bo=re(()=>{"use strict";p();pn=class pn{constructor(e){ +a(mo,"xorBuffers");function sl(r){return an.createHash("sha256").update(r).digest()}a(sl,"sha256");function st(r,e){ +return an.createHmac("sha256",r).update(e).digest()}a(st,"hmacSha256");function ol(r,e,t){for(var n=st( +r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sal});function al(...r){return r.join("/")}var cn=re(()=>{"use strict";p(); +a(al,"join")});var ln={};fe(ln,{stat:()=>ul});function ul(r,e){e(new Error("No filesystem"))}var fn=re(()=>{"use st\ +rict";p();a(ul,"stat")});var hn={};fe(hn,{default:()=>cl});var cl,dn=re(()=>{"use strict";p();cl={}});var bo={};fe(bo,{StringDecoder:()=>pn});var yn,pn,xo=re(()=>{"use strict";p();yn=class yn{constructor(e){ I(this,"td");this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this. -td.decode(e)}};a(pn,"StringDecoder");dn=pn});var Eo=R((Ud,vo)=>{"use strict";p();var{Transform:cl}=(hn(),j(fn)),{StringDecoder:ll}=(bo(),j(go)),Le=Symbol( -"last"),tr=Symbol("decoder");function fl(r,e,t){let n;if(this.overflow){if(n=this[tr].write(r).split( -this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Le]+=this[tr].write(r),n= -this[Le].split(this.matcher);this[Le]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( -"maximum buffer reached"));return}t()}a(fl,"transform");function hl(r){if(this[Le]+=this[tr].end(),this[Le]) -try{So(this,this.mapper(this[Le]))}catch(e){return r(e)}r()}a(hl,"flush");function So(r,e){e!==void 0&& -r.push(e)}a(So,"push");function xo(r){return r}a(xo,"noop");function dl(r,e,t){switch(r=r||/\r?\n/,e= -e||xo,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r=="object"&&!(r instanceof +td.decode(e)}};a(yn,"StringDecoder");pn=yn});var Ao=R((Dd,Eo)=>{"use strict";p();var{Transform:ll}=(dn(),j(hn)),{StringDecoder:fl}=(xo(),j(bo)),ke=Symbol( +"last"),tr=Symbol("decoder");function hl(r,e,t){let n;if(this.overflow){if(n=this[tr].write(r).split( +this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[ke]+=this[tr].write(r),n= +this[ke].split(this.matcher);this[ke]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( +"maximum buffer reached"));return}t()}a(hl,"transform");function dl(r){if(this[ke]+=this[tr].end(),this[ke]) +try{vo(this,this.mapper(this[ke]))}catch(e){return r(e)}r()}a(dl,"flush");function vo(r,e){e!==void 0&& +r.push(e)}a(vo,"push");function So(r){return r}a(So,"noop");function pl(r,e,t){switch(r=r||/\r?\n/,e= +e||So,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=xo)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=fl,t.flush=hl,t.readableObjectMode= -!0;let n=new cl(t);return n[Le]="",n[tr]=new ll("utf8"),n.matcher=r,n.mapper=e,n.maxLength=t.maxLength, +"object"&&(t=e,e=So)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=hl,t.flush=dl,t.readableObjectMode= +!0;let n=new ll(t);return n[ke]="",n[tr]=new fl("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(dl,"split");vo.exports=dl});var Co=R((Nd,Ce)=>{"use strict";p();var Ao=(un(),j(an)),pl=(hn(),j(fn)).Stream,yl=Eo(),_o=(Rt(),j(Pt)), -ml=5432,rr=w.platform==="win32",Bt=w.stderr,wl=56,gl=7,bl=61440,xl=32768;function Sl(r){return(r&bl)== -xl}a(Sl,"isRegFile");var it=["host","port","database","user","password"],yn=it.length,vl=it[yn-1];function mn(){ -var r=Bt instanceof pl&&Bt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` -`);Bt.write(_o.format.apply(_o,e))}}a(mn,"warn");Object.defineProperty(Ce.exports,"isWin",{get:a(function(){ -return rr},"get"),set:a(function(r){rr=r},"set")});Ce.exports.warnTo=function(r){var e=Bt;return Bt= -r,e};Ce.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(rr?Ao.join(e.APPDATA||"./","\ -postgresql","pgpass.conf"):Ao.join(e.HOME||"./",".pgpass"));return t};Ce.exports.usePgPass=function(r,e){ -return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:rr?!0:(e=e||"",Sl(r.mode)?r. -mode&(wl|gl)?(mn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ -(0600) or less',e),!1):!0:(mn('WARNING: password file "%s" is not a plain file',e),!1))};var El=Ce.exports. -match=function(r,e){return it.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||ml)===Number( +!1,s(i)},n}a(pl,"split");Eo.exports=pl});var Io=R((qd,Ce)=>{"use strict";p();var _o=(cn(),j(un)),yl=(dn(),j(hn)).Stream,ml=Ao(),Co=(Bt(),j(Rt)), +wl=5432,rr=w.platform==="win32",Lt=w.stderr,gl=56,bl=7,xl=61440,Sl=32768;function vl(r){return(r&xl)== +Sl}a(vl,"isRegFile");var ot=["host","port","database","user","password"],mn=ot.length,El=ot[mn-1];function wn(){ +var r=Lt instanceof yl&&Lt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +`);Lt.write(Co.format.apply(Co,e))}}a(wn,"warn");Object.defineProperty(Ce.exports,"isWin",{get:a(function(){ +return rr},"get"),set:a(function(r){rr=r},"set")});Ce.exports.warnTo=function(r){var e=Lt;return Lt= +r,e};Ce.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(rr?_o.join(e.APPDATA||"./","\ +postgresql","pgpass.conf"):_o.join(e.HOME||"./",".pgpass"));return t};Ce.exports.usePgPass=function(r,e){ +return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:rr?!0:(e=e||"",vl(r.mode)?r. +mode&(gl|bl)?(wn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ +(0600) or less',e),!1):!0:(wn('WARNING: password file "%s" is not a plain file',e),!1))};var Al=Ce.exports. +match=function(r,e){return ot.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||wl)===Number( e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};Ce.exports.getPassword=function(r,e,t){var n,i=e.pipe( -yl());function s(c){var l=Al(c);l&&_l(l)&&El(r,l)&&(n=l[vl],i.end())}a(s,"onLine");var o=a(function(){ -e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),mn("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 Al=Ce.exports.parseLine= +ml());function s(c){var l=_l(c);l&&Cl(l)&&Al(r,l)&&(n=l[El],i.end())}a(s,"onLine");var o=a(function(){ +e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),wn("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 _l=Ce.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 E=r.substring(y,g);Object.hasOwnProperty.call(w.env,"PGPASS_NO_DEESCAPE")||(E=E. -replace(/\\([:\\])/g,"$1")),o[it[f]]=E},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). -length===yn?o:null,o},_l=Ce.exports.isValidEntry=function(r){for(var e={0:function(o){return o.length> +replace(/\\([:\\])/g,"$1")),o[ot[f]]=E},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). +length===mn?o:null,o},Cl=Ce.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 jd=(un(),j(an)),Io=(ln(),j(cn)),nr=Co();wn.exports=function(r,e){ -var t=nr.getFileName();Io.stat(t,function(n,i){if(n||!nr.usePgPass(i,t))return e(void 0);var s=Io.createReadStream( -t);nr.getPassword(r,s,e)})};wn.exports.warnTo=nr.warnTo});var Po={};he(Po,{default:()=>Cl});var Cl,Ro=re(()=>{"use strict";p();Cl={}});var Lo=R((Gd,Bo)=>{"use strict";p();var Il=(Tr(),j(as)),gn=(ln(),j(cn));function bn(r){if(r.charAt(0)=== -"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Il.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i. +0}},t=0;t{"use strict";p();var Wd=(cn(),j(un)),To=(fn(),j(ln)),nr=Io();gn.exports=function(r,e){ +var t=nr.getFileName();To.stat(t,function(n,i){if(n||!nr.usePgPass(i,t))return e(void 0);var s=To.createReadStream( +t);nr.getPassword(r,s,e)})};gn.exports.warnTo=nr.warnTo});var Ro={};fe(Ro,{default:()=>Il});var Il,Bo=re(()=>{"use strict";p();Il={}});var ko=R((Vd,Lo)=>{"use strict";p();var Tl=(Pr(),j(us)),bn=(fn(),j(ln));function xn(r){if(r.charAt(0)=== +"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Tl.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=gn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=gn.readFileSync(t.sslkey).toString()), -t.sslrootcert&&(t.ssl.ca=gn.readFileSync(t.sslrootcert).toString()),t.sslmode){case"disable":{t.ssl= +cert=bn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=bn.readFileSync(t.sslkey).toString()), +t.sslrootcert&&(t.ssl.ca=bn.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(bn,"parse");Bo.exports=bn;bn.parse=bn});var ir=R((zd,Mo)=>{"use strict";p();var Tl=(Ro(),j(Po)),Fo=It(),ko=Lo().parse,te=a(function(r,e,t){return t=== -void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Fo[r]},"val"),Pl=a(function(){switch(w. +!1;break}}return t}a(xn,"parse");Lo.exports=xn;xn.parse=xn});var ir=R((Yd,Uo)=>{"use strict";p();var Pl=(Bo(),j(Ro)),Mo=Tt(),Fo=ko().parse,te=a(function(r,e,t){return t=== +void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Mo[r]},"val"),Rl=a(function(){switch(w. 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 Fo.ssl},"readSSLConfigFromEnvironment"),st=a(function(r){ -return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),we=a(function(r,e,t){ -var n=e[t];n!=null&&r.push(t+"="+st(n))},"add"),Sn=class Sn{constructor(e){e=typeof e=="string"?ko(e): -e||{},e.connectionString&&(e=Object.assign({},e,ko(e.connectionString))),this.user=te("user",e),this. +no-verify":return{rejectUnauthorized:!1}}return Mo.ssl},"readSSLConfigFromEnvironment"),at=a(function(r){ +return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),me=a(function(r,e,t){ +var n=e[t];n!=null&&r.push(t+"="+at(n))},"add"),vn=class vn{constructor(e){e=typeof e=="string"?Fo(e): +e||{},e.connectionString&&(e=Object.assign({},e,Fo(e.connectionString))),this.user=te("user",e),this. database=te("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(te("p\ ort",e),10),this.host=te("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, writable:!0,value:te("password",e)}),this.binary=te("binary",e),this.options=te("options",e),this.ssl= -typeof e.ssl>"u"?Pl():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="\ +typeof e.ssl>"u"?Rl():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=te("client_encoding",e),this.replication=te("replication", e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=te("application_name",e,"\ @@ -779,31 +779,31 @@ te("idle_in_transaction_session_timeout",e,!1),this.query_timeout=te("query_time void 0?this.connect_timeout=w.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/ 1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive===!0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis== "number"&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){ -var t=[];we(t,this,"user"),we(t,this,"password"),we(t,this,"port"),we(t,this,"application_name"),we( -t,this,"fallback_application_name"),we(t,this,"connect_timeout"),we(t,this,"options");var n=typeof this. -ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(we(t,n,"sslmode"),we(t,n,"sslca"),we(t,n,"s\ -slkey"),we(t,n,"sslcert"),we(t,n,"sslrootcert"),this.database&&t.push("dbname="+st(this.database)),this. -replication&&t.push("replication="+st(this.replication)),this.host&&t.push("host="+st(this.host)),this. -isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+st(this.client_encoding)), -Tl.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+st(s)),e(null,t.join(" ")))})}}; -a(Sn,"ConnectionParameters");var xn=Sn;Mo.exports=xn});var Oo=R((Zd,Do)=>{"use strict";p();var Rl=At(),Uo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,En=class En{constructor(e,t){ +var t=[];me(t,this,"user"),me(t,this,"password"),me(t,this,"port"),me(t,this,"application_name"),me( +t,this,"fallback_application_name"),me(t,this,"connect_timeout"),me(t,this,"options");var n=typeof this. +ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(me(t,n,"sslmode"),me(t,n,"sslca"),me(t,n,"s\ +slkey"),me(t,n,"sslcert"),me(t,n,"sslrootcert"),this.database&&t.push("dbname="+at(this.database)),this. +replication&&t.push("replication="+at(this.replication)),this.host&&t.push("host="+at(this.host)),this. +isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+at(this.client_encoding)), +Pl.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+at(s)),e(null,t.join(" ")))})}}; +a(vn,"ConnectionParameters");var Sn=vn;Uo.exports=Sn});var No=R((Xd,Oo)=>{"use strict";p();var Bl=_t(),Do=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,An=class An{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=Uo.exec(e.text):t=Uo.exec(e.command),t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2], +var t;e.text?t=Do.exec(e.text):t=Do.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:Bl}=Re(),No=Oo(),qo=Tt(),_n=class _n extends Bl{constructor(e,t,n){ -super(),e=qo.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]=Bl.getTypeParser(n.dataTypeID,n. +format||"text")}}};a(An,"Result");var En=An;Oo.exports=En});var Wo=R((rp,jo)=>{"use strict";p();var{EventEmitter:Ll}=Be(),qo=No(),Qo=Pt(),Cn=class Cn extends Ll{constructor(e,t,n){ +super(),e=Qo.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,w.domain&&e.callback&&(this.callback=w.domain.bind(e.callback)),this._result= -new No(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError= +new qo(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 No(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ +_results=[this._result]),this._result=new qo(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:qo.prepareValue})}catch(t){ +portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:Qo.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(_n,"Query");var An=_n;Qo.exports= -An});var ei=R(P=>{"use strict";p();Object.defineProperty(P,"__esModule",{value:!0});P.NoticeMessage=P.DataRowMessage= +e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(Cn,"Query");var _n=Cn;jo.exports= +_n});var ti=R(P=>{"use strict";p();Object.defineProperty(P,"__esModule",{value:!0});P.NoticeMessage=P.DataRowMessage= P.CommandCompleteMessage=P.ReadyForQueryMessage=P.NotificationResponseMessage=P.BackendKeyDataMessage= P.AuthenticationMD5Password=P.ParameterStatusMessage=P.ParameterDescriptionMessage=P.RowDescriptionMessage= P.Field=P.CopyResponse=P.CopyDataMessage=P.DatabaseError=P.copyDone=P.emptyQuery=P.replicationStart= @@ -831,30 +831,30 @@ P.portalSuspended=P.noData=P.closeComplete=P.bindComplete=P.parseComplete=void 0 parseComplete",length:5};P.bindComplete={name:"bindComplete",length:5};P.closeComplete={name:"closeC\ omplete",length:5};P.noData={name:"noData",length:5};P.portalSuspended={name:"portalSuspended",length:5}; P.replicationStart={name:"replicationStart",length:4};P.emptyQuery={name:"emptyQuery",length:4};P.copyDone= -{name:"copyDone",length:4};var qn=class qn extends Error{constructor(e,t,n){super(e),this.length=t,this. -name=n}};a(qn,"DatabaseError");var Cn=qn;P.DatabaseError=Cn;var Qn=class Qn{constructor(e,t){this.length= -e,this.chunk=t,this.name="copyData"}};a(Qn,"CopyDataMessage");var In=Qn;P.CopyDataMessage=In;var jn=class jn{constructor(e,t,n,i){ -this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(jn,"CopyResponse");var Tn=jn; -P.CopyResponse=Tn;var Wn=class Wn{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(Wn,"Field");var Pn=Wn; -P.Field=Pn;var Hn=class Hn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ -n",this.fields=new Array(this.fieldCount)}};a(Hn,"RowDescriptionMessage");var Rn=Hn;P.RowDescriptionMessage= -Rn;var $n=class $n{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ -ion",this.dataTypeIDs=new Array(this.parameterCount)}};a($n,"ParameterDescriptionMessage");var Bn=$n; -P.ParameterDescriptionMessage=Bn;var Gn=class Gn{constructor(e,t,n){this.length=e,this.parameterName= -t,this.parameterValue=n,this.name="parameterStatus"}};a(Gn,"ParameterStatusMessage");var Ln=Gn;P.ParameterStatusMessage= -Ln;var Vn=class Vn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; -a(Vn,"AuthenticationMD5Password");var kn=Vn;P.AuthenticationMD5Password=kn;var Kn=class Kn{constructor(e,t,n){ -this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Kn,"BackendKeyDataMes\ -sage");var Fn=Kn;P.BackendKeyDataMessage=Fn;var zn=class zn{constructor(e,t,n,i){this.length=e,this. -processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(zn,"NotificationResponseMessa\ -ge");var Mn=zn;P.NotificationResponseMessage=Mn;var Yn=class Yn{constructor(e,t){this.length=e,this. -status=t,this.name="readyForQuery"}};a(Yn,"ReadyForQueryMessage");var Un=Yn;P.ReadyForQueryMessage=Un; -var Jn=class Jn{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(Jn,"Comma\ -ndCompleteMessage");var Dn=Jn;P.CommandCompleteMessage=Dn;var Zn=class Zn{constructor(e,t){this.length= -e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(Zn,"DataRowMessage");var On=Zn;P.DataRowMessage= -On;var Xn=class Xn{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(Xn,"NoticeMe\ -ssage");var Nn=Xn;P.NoticeMessage=Nn});var Wo=R(sr=>{"use strict";p();Object.defineProperty(sr,"__esModule",{value:!0});sr.Writer=void 0;var ri=class ri{constructor(e=256){ +{name:"copyDone",length:4};var Qn=class Qn extends Error{constructor(e,t,n){super(e),this.length=t,this. +name=n}};a(Qn,"DatabaseError");var In=Qn;P.DatabaseError=In;var jn=class jn{constructor(e,t){this.length= +e,this.chunk=t,this.name="copyData"}};a(jn,"CopyDataMessage");var Tn=jn;P.CopyDataMessage=Tn;var Wn=class Wn{constructor(e,t,n,i){ +this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Wn,"CopyResponse");var Pn=Wn; +P.CopyResponse=Pn;var Hn=class Hn{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(Hn,"Field");var Rn=Hn; +P.Field=Rn;var $n=class $n{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ +n",this.fields=new Array(this.fieldCount)}};a($n,"RowDescriptionMessage");var Bn=$n;P.RowDescriptionMessage= +Bn;var Gn=class Gn{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ +ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(Gn,"ParameterDescriptionMessage");var Ln=Gn; +P.ParameterDescriptionMessage=Ln;var Vn=class Vn{constructor(e,t,n){this.length=e,this.parameterName= +t,this.parameterValue=n,this.name="parameterStatus"}};a(Vn,"ParameterStatusMessage");var kn=Vn;P.ParameterStatusMessage= +kn;var Kn=class Kn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; +a(Kn,"AuthenticationMD5Password");var Fn=Kn;P.AuthenticationMD5Password=Fn;var zn=class zn{constructor(e,t,n){ +this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(zn,"BackendKeyDataMes\ +sage");var Mn=zn;P.BackendKeyDataMessage=Mn;var Yn=class Yn{constructor(e,t,n,i){this.length=e,this. +processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(Yn,"NotificationResponseMessa\ +ge");var Un=Yn;P.NotificationResponseMessage=Un;var Jn=class Jn{constructor(e,t){this.length=e,this. +status=t,this.name="readyForQuery"}};a(Jn,"ReadyForQueryMessage");var Dn=Jn;P.ReadyForQueryMessage=Dn; +var Zn=class Zn{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(Zn,"Comma\ +ndCompleteMessage");var On=Zn;P.CommandCompleteMessage=On;var Xn=class Xn{constructor(e,t){this.length= +e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(Xn,"DataRowMessage");var Nn=Xn;P.DataRowMessage= +Nn;var ei=class ei{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(ei,"NoticeMe\ +ssage");var qn=ei;P.NoticeMessage=qn});var Ho=R(sr=>{"use strict";p();Object.defineProperty(sr,"__esModule",{value:!0});sr.Writer=void 0;var ni=class ni{constructor(e=256){ this.size=e,this.offset=5,this.headerPosition=0,this.buffer=m.allocUnsafe(e)}ensure(e){if(this.buffer. length-this.offset>1)+e;this.buffer=m.allocUnsafe(i),n.copy( this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this. @@ -866,49 +866,49 @@ 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=m.allocUnsafe(this.size),t}};a(ri,"Writer");var ti=ri;sr.Writer=ti});var $o=R(ar=>{"use strict";p();Object.defineProperty(ar,"__esModule",{value:!0});ar.serialize=void 0; -var ni=Wo(),D=new ni.Writer,Ll=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( +headerPosition=0,this.buffer=m.allocUnsafe(this.size),t}};a(ni,"Writer");var ri=ni;sr.Writer=ri});var Go=R(ar=>{"use strict";p();Object.defineProperty(ar,"__esModule",{value:!0});ar.serialize=void 0; +var ii=Ho(),D=new ii.Writer,kl=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( n).addCString(r[n]);D.addCString("client_encoding").addCString("UTF8");let e=D.addCString("").flush(), -t=e.length+4;return new ni.Writer().addInt32(t).add(e).flush()},"startup"),kl=a(()=>{let r=m.allocUnsafe( -8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Fl=a(r=>D.addCString(r).flush( -112),"password"),Ml=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. -flush(112)},"sendSASLInitialResponseMessage"),Ul=a(function(r){return D.addString(r).flush(112)},"se\ -ndSCRAMClientFinalMessage"),Dl=a(r=>D.addCString(r).flush(81),"query"),Ho=[],Ol=a(r=>{let e=r.name|| +t=e.length+4;return new ii.Writer().addInt32(t).add(e).flush()},"startup"),Fl=a(()=>{let r=m.allocUnsafe( +8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Ml=a(r=>D.addCString(r).flush( +112),"password"),Ul=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. +flush(112)},"sendSASLInitialResponseMessage"),Dl=a(function(r){return D.addString(r).flush(112)},"se\ +ndSCRAMClientFinalMessage"),Ol=a(r=>D.addCString(r).flush(81),"query"),$o=[],Nl=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||Ho,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< -n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),ot=new ni.Writer,Nl=a(function(r,e){for(let t=0;t< -r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),ot.addInt32(-1)):n instanceof m?(D.addInt16( -1),ot.addInt32(n.length),ot.add(n)):(D.addInt16(0),ot.addInt32(m.byteLength(n)),ot.addString(n))}},"\ -writeValues"),ql=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Ho,s=i.length; -return D.addCString(e).addCString(t),D.addInt16(s),Nl(i,r.valueMapper),D.addInt16(s),D.add(ot.flush()), -D.addInt16(n?1:0),D.flush(66)},"bind"),Ql=m.from([69,0,0,0,9,0,0,0,0,0]),jl=a(r=>{if(!r||!r.portal&& -!r.rows)return Ql;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Wl=a( +xecuting queries"));let t=r.types||$o,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< +n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),ut=new ii.Writer,ql=a(function(r,e){for(let t=0;t< +r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),ut.addInt32(-1)):n instanceof m?(D.addInt16( +1),ut.addInt32(n.length),ut.add(n)):(D.addInt16(0),ut.addInt32(m.byteLength(n)),ut.addString(n))}},"\ +writeValues"),Ql=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||$o,s=i.length; +return D.addCString(e).addCString(t),D.addInt16(s),ql(i,r.valueMapper),D.addInt16(s),D.add(ut.flush()), +D.addInt16(n?1:0),D.flush(66)},"bind"),jl=m.from([69,0,0,0,9,0,0,0,0,0]),Wl=a(r=>{if(!r||!r.portal&& +!r.rows)return jl;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Hl=a( (r,e)=>{let t=m.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"),ii=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. +6),t.writeInt32BE(r,8),t.writeInt32BE(e,12),t},"cancel"),si=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i},"cstringMessage"), -Hl=D.addCString("P").flush(68),$l=D.addCString("S").flush(68),Gl=a(r=>r.name?ii(68,`${r.type}${r.name|| -""}`):r.type==="P"?Hl:$l,"describe"),Vl=a(r=>{let e=`${r.type}${r.name||""}`;return ii(67,e)},"close"), -Kl=a(r=>D.add(r).flush(100),"copyData"),zl=a(r=>ii(102,r),"copyFail"),or=a(r=>m.from([r,0,0,0,4]),"c\ -odeOnlyBuffer"),Yl=or(72),Jl=or(83),Zl=or(88),Xl=or(99),ef={startup:Ll,password:Fl,requestSsl:kl,sendSASLInitialResponseMessage:Ml, -sendSCRAMClientFinalMessage:Ul,query:Dl,parse:Ol,bind:ql,execute:jl,describe:Gl,close:Vl,flush:a(()=>Yl, -"flush"),sync:a(()=>Jl,"sync"),end:a(()=>Zl,"end"),copyData:Kl,copyDone:a(()=>Xl,"copyDone"),copyFail:zl, -cancel:Wl};ar.serialize=ef});var Go=R(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.BufferReader=void 0; -var tf=m.allocUnsafe(0),oi=class oi{constructor(e=0){this.offset=e,this.buffer=tf,this.encoding="utf\ +$l=D.addCString("P").flush(68),Gl=D.addCString("S").flush(68),Vl=a(r=>r.name?si(68,`${r.type}${r.name|| +""}`):r.type==="P"?$l:Gl,"describe"),Kl=a(r=>{let e=`${r.type}${r.name||""}`;return si(67,e)},"close"), +zl=a(r=>D.add(r).flush(100),"copyData"),Yl=a(r=>si(102,r),"copyFail"),or=a(r=>m.from([r,0,0,0,4]),"c\ +odeOnlyBuffer"),Jl=or(72),Zl=or(83),Xl=or(88),ef=or(99),tf={startup:kl,password:Ml,requestSsl:Fl,sendSASLInitialResponseMessage:Ul, +sendSCRAMClientFinalMessage:Dl,query:Ol,parse:Nl,bind:Ql,execute:Wl,describe:Vl,close:Kl,flush:a(()=>Jl, +"flush"),sync:a(()=>Zl,"sync"),end:a(()=>Xl,"end"),copyData:zl,copyDone:a(()=>ef,"copyDone"),copyFail:Yl, +cancel:Hl};ar.serialize=tf});var Vo=R(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.BufferReader=void 0; +var rf=m.allocUnsafe(0),ai=class ai{constructor(e=0){this.offset=e,this.buffer=rf,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(oi,"BufferReader");var si=oi;ur.BufferReader=si});var zo=R(cr=>{"use strict";p();Object.defineProperty(cr,"__esModule",{value:!0});cr.Parser=void 0;var O=ei(), -rf=Go(),ai=1,nf=4,Vo=ai+nf,Ko=m.allocUnsafe(0),ci=class ci{constructor(e){if(this.buffer=Ko,this.bufferLength= -0,this.bufferOffset=0,this.reader=new rf.BufferReader,e?.mode==="binary")throw new Error("Binary mod\ +offset+=e,t}};a(ai,"BufferReader");var oi=ai;ur.BufferReader=oi});var Yo=R(cr=>{"use strict";p();Object.defineProperty(cr,"__esModule",{value:!0});cr.Parser=void 0;var O=ti(), +nf=Vo(),ui=1,sf=4,Ko=ui+sf,zo=m.allocUnsafe(0),li=class li{constructor(e){if(this.buffer=zo,this.bufferLength= +0,this.bufferOffset=0,this.reader=new nf.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+Vo<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( -i+ai),u=ai+o;if(u+i<=n){let c=this.handlePacket(i+Vo,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. -buffer=Ko,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=n-i,this.bufferOffset=i)}mergeBuffer(e){ +this.bufferLength,i=this.bufferOffset;for(;i+Ko<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( +i+ui),u=ui+o;if(u+i<=n){let c=this.handlePacket(i+Ko,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. +buffer=zo,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. buffer.byteLength*2;for(;t>=s;)s*=2;i=m.allocUnsafe(s)}this.buffer.copy(i,0,this.bufferOffset,this.bufferOffset+ @@ -954,14 +954,14 @@ o=this.reader.string(1);for(;o!=="\0";)s[o]=this.reader.cstring(),o=this.reader. c=i==="notice"?new O.NoticeMessage(t,u):new O.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(ci,"Parser");var ui=ci;cr.Parser=ui});var li=R(ke=>{"use strict";p();Object.defineProperty(ke,"__esModule",{value:!0});ke.DatabaseError=ke. -serialize=ke.parse=void 0;var sf=ei();Object.defineProperty(ke,"DatabaseError",{enumerable:!0,get:a( -function(){return sf.DatabaseError},"get")});var of=$o();Object.defineProperty(ke,"serialize",{enumerable:!0, -get:a(function(){return of.serialize},"get")});var af=zo();function uf(r,e){let t=new af.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(uf,"parse");ke.parse=uf});var Yo={};he(Yo,{connect:()=>cf});function cf({socket:r,servername:e}){return r.startTls(e),r}var Jo=re( -()=>{"use strict";p();a(cf,"connect")});var di=R((Ap,ea)=>{"use strict";p();var Zo=(Ke(),j(os)),lf=Re().EventEmitter,{parse:ff,serialize:z}=li(), -Xo=z.flush(),hf=z.sync(),df=z.end(),hi=class hi extends lf{constructor(e){super(),e=e||{},this.stream= -e.stream||new Zo.Socket,this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis, +a(li,"Parser");var ci=li;cr.Parser=ci});var fi=R(Fe=>{"use strict";p();Object.defineProperty(Fe,"__esModule",{value:!0});Fe.DatabaseError=Fe. +serialize=Fe.parse=void 0;var of=ti();Object.defineProperty(Fe,"DatabaseError",{enumerable:!0,get:a( +function(){return of.DatabaseError},"get")});var af=Go();Object.defineProperty(Fe,"serialize",{enumerable:!0, +get:a(function(){return af.serialize},"get")});var uf=Yo();function cf(r,e){let t=new uf.Parser;return r. +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(cf,"parse");Fe.parse=cf});var Jo={};fe(Jo,{connect:()=>lf});function lf({socket:r,servername:e}){return r.startTls(e),r}var Zo=re( +()=>{"use strict";p();a(lf,"connect")});var pi=R((_p,ta)=>{"use strict";p();var Xo=(Ye(),j(as)),ff=Be().EventEmitter,{parse:hf,serialize:K}=fi(), +ea=K.flush(),df=K.sync(),pf=K.end(),di=class di extends ff{constructor(e){super(),e=e||{},this.stream= +e.stream||new Xo.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=(Jo(),j(Yo));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= -n.ssl.key)),Zo.isIP(t)===0&&(c.servername=t);try{n.stream=u.connect(c)}catch(l){return n.emit("error", +var u=(Zo(),j(Jo));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= +n.ssl.key)),Xo.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")}),ff(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& -this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(z.requestSsl())}startup(e){this. -stream.write(z.startup(e))}cancel(e,t){this._send(z.cancel(e,t))}password(e){this._send(z.password(e))}sendSASLInitialResponseMessage(e,t){ -this._send(z.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(z.sendSCRAMClientFinalMessage( -e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(z.query(e))}parse(e){ -this._send(z.parse(e))}bind(e){this._send(z.bind(e))}execute(e){this._send(z.execute(e))}flush(){this. -stream.writable&&this.stream.write(Xo)}sync(){this._ending=!0,this._send(Xo),this._send(hf)}ref(){this. +"end",()=>{this.emit("end")}),hf(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& +this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(K.requestSsl())}startup(e){this. +stream.write(K.startup(e))}cancel(e,t){this._send(K.cancel(e,t))}password(e){this._send(K.password(e))}sendSASLInitialResponseMessage(e,t){ +this._send(K.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(K.sendSCRAMClientFinalMessage( +e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(K.query(e))}parse(e){ +this._send(K.parse(e))}bind(e){this._send(K.bind(e))}execute(e){this._send(K.execute(e))}flush(){this. +stream.writable&&this.stream.write(ea)}sync(){this._ending=!0,this._send(ea),this._send(df)}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(df,()=>{this.stream.end()})}close(e){this._send(z. -close(e))}describe(e){this._send(z.describe(e))}sendCopyFromChunk(e){this._send(z.copyData(e))}endCopyFrom(){ -this._send(z.copyDone())}sendCopyFail(e){this._send(z.copyFail(e))}};a(hi,"Connection");var fi=hi;ea. -exports=fi});var na=R((Tp,ra)=>{"use strict";p();var pf=Re().EventEmitter,Ip=(Rt(),j(Pt)),yf=Tt(),pi=wo(),mf=To(), -wf=Zt(),gf=ir(),ta=jo(),bf=It(),xf=di(),yi=class yi extends pf{constructor(e){super(),this.connectionParameters= -new gf(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database, +this.stream.end();return}return this.stream.write(pf,()=>{this.stream.end()})}close(e){this._send(K. +close(e))}describe(e){this._send(K.describe(e))}sendCopyFromChunk(e){this._send(K.copyData(e))}endCopyFrom(){ +this._send(K.copyDone())}sendCopyFail(e){this._send(K.copyFail(e))}};a(di,"Connection");var hi=di;ta. +exports=hi});var ia=R((Pp,na)=>{"use strict";p();var yf=Be().EventEmitter,Tp=(Bt(),j(Rt)),mf=Pt(),yi=go(),wf=Po(), +gf=Zt(),bf=ir(),ra=Wo(),xf=Tt(),Sf=pi(),mi=class mi extends yf{constructor(e){super(),this.connectionParameters= +new bf(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||S.Promise, -this._types=new wf(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= -!1,this._queryable=!0,this.connection=t.connection||new xf({stream:t.stream,ssl:this.connectionParameters. +this._types=new gf(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= +!1,this._queryable=!0,this.connection=t.connection||new Sf({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||bf.binary,this. +connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t.binary||xf.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=>{w.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():mf(this.connectionParameters, +password=this.password=null;e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():wf(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=yf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ -this._checkPgPass(()=>{this.saslSession=pi.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( -this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){pi.continueSession( +()=>{let t=mf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ +this._checkPgPass(()=>{this.saslSession=yi.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( +this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){yi.continueSession( this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession. -response)}_handleAuthSASLFinal(e){pi.finalizeSession(this.saslSession,e.data),this.saslSession=null}_handleBackendKeyData(e){ +response)}_handleAuthSASLFinal(e){yi.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 ta(e,t,n),i.callback||(s=new this._Promise((l,f)=>{i.callback= +connectionParameters.query_timeout,i=new ra(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");w.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(yi,"Client");var lr=yi;lr.Query=ta;ra.exports=lr});var aa=R((Bp,oa)=>{"use strict";p();var Sf=Re().EventEmitter,ia=a(function(){},"NOOP"),sa=a((r,e)=>{ -let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),gi=class gi{constructor(e,t,n){ -this.client=e,this.idleListener=t,this.timeoutId=n}};a(gi,"IdleItem");var mi=gi,bi=class bi{constructor(e){ -this.callback=e}};a(bi,"PendingItem");var at=bi;function vf(){throw new Error("Release called on cli\ -ent which has already been released to the pool.")}a(vf,"throwOnDoubleRelease");function fr(r,e){if(e) +_Promise(t=>{this.connection.once("end",t)})}};a(mi,"Client");var lr=mi;lr.Query=ra;na.exports=lr});var ua=R((Lp,aa)=>{"use strict";p();var vf=Be().EventEmitter,sa=a(function(){},"NOOP"),oa=a((r,e)=>{ +let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),bi=class bi{constructor(e,t,n){ +this.client=e,this.idleListener=t,this.timeoutId=n}};a(bi,"IdleItem");var wi=bi,xi=class xi{constructor(e){ +this.callback=e}};a(xi,"PendingItem");var ct=xi;function Ef(){throw new Error("Release called on cli\ +ent which has already been released to the pool.")}a(Ef,"throwOnDoubleRelease");function fr(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(fr,"promisify"); -function Ef(r,e){return a(function t(n){n.client=e,e.removeListener("error",t),e.on("error",()=>{r.log( +function Af(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(Ef,"makeIdleListener");var xi=class xi extends Sf{constructor(e,t){super(),this.options= +dleListener")}a(Af,"makeIdleListener");var Si=class Si extends vf{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||Lt().Client,this.Promise= +this.log=this.options.log||function(){},this.Client=this.options.Client||t||kt().Client,this.Promise= this.options.Promise||S.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,36 +1102,36 @@ 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=sa( +if(!this._isFull())return this.newClient(e);throw new Error("unexpected condition")}_remove(e){let t=oa( 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=fr(this.Promise,e),n=t. result;if(this._isFull()||this._idle.length){if(this._idle.length&&w.nextTick(()=>this._pulseQueue()), -!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new at(t.callback)),n;let i=a((u,c,l)=>{ -clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new at(i),o=setTimeout(()=>{sa(this._pendingQueue, +!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new ct(t.callback)),n;let i=a((u,c,l)=>{ +clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new ct(i),o=setTimeout(()=>{oa(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 at(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( -t);let n=Ef(this,t);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&& +newClient(new ct(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( +t);let n=Af(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,ia);else{if(this.log("new client connected"),this.options. +_pulseQueue(),e.timedOut||e.callback(o,void 0,sa);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 at((l,f,y)=>y()), +_expired.add(t),this._idle.findIndex(l=>l.client===t)!==-1&&this._acquireClient(t,new ct((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,ia);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ -let n=!1;return i=>{n&&vf(),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,sa);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ +let n=!1;return i=>{n&&Ef(),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 mi( +this.options.allowExitOnIdle&&s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new wi( e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=fr(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=fr(this.Promise,n);return n=i.callback,this. @@ -1142,7 +1142,7 @@ if(this.log("ending"),this.ending){let n=new Error("Called end on pool more than this.Promise.reject(n)}this.ending=!0;let t=fr(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(xi,"Pool");var wi=xi;oa.exports=wi});var ua={};he(ua,{default:()=>Af});var Af,ca=re(()=>{"use strict";p();Af={}});var la=R((Mp,_f)=>{_f.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javas\ +return this._clients.length}};a(Si,"Pool");var gi=Si;aa.exports=gi});var ca={};fe(ca,{default:()=>_f});var _f,la=re(()=>{"use strict";p();_f={}});var fa=R((Up,Cf)=>{Cf.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 da=R((Up,ha)=>{"use strict";p();var fa=Re().EventEmitter,Cf=(Rt(),j(Pt)),Si=Tt(),ut=ha.exports=function(r,e,t){ -fa.call(this),r=Si.normalizeQueryConfig(r,e,t),this.text=r.text,this.values=r.values,this.name=r.name, +a178655"}});var pa=R((Dp,da)=>{"use strict";p();var ha=Be().EventEmitter,If=(Bt(),j(Rt)),vi=Pt(),lt=da.exports=function(r,e,t){ +ha.call(this),r=vi.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))};Cf.inherits(ut,fa); -var If={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ +this.on("newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};If.inherits(lt,ha); +var Tf={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"\ -file",sourceLine:"line",sourceFunction:"routine"};ut.prototype.handleError=function(r){var e=this.native. -pq.resultErrorFields();if(e)for(var t in e){var n=If[t]||t;r[n]=e[t]}this.callback?this.callback(r): -this.emit("error",r),this.state="error"};ut.prototype.then=function(r,e){return this._getPromise().then( -r,e)};ut.prototype.catch=function(r){return this._getPromise().catch(r)};ut.prototype._getPromise=function(){ +file",sourceLine:"line",sourceFunction:"routine"};lt.prototype.handleError=function(r){var e=this.native. +pq.resultErrorFields();if(e)for(var t in e){var n=Tf[t]||t;r[n]=e[t]}this.callback?this.callback(r): +this.emit("error",r),this.state="error"};lt.prototype.then=function(r,e){return this._getPromise().then( +r,e)};lt.prototype.catch=function(r){return this._getPromise().catch(r)};lt.prototype._getPromise=function(){ return this._promise?this._promise:(this._promise=new Promise(function(r,e){this._once("end",r),this. -_once("error",e)}.bind(this)),this._promise)};ut.prototype.submit=function(r){this.state="running";var e=this; +_once("error",e)}.bind(this)),this._promise)};lt.prototype.submit=function(r){this.state="running";var e=this; this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a(function(s,o,u){if(r.native.arrayMode= !1,v(function(){e.emit("_done")}),s)return e.handleError(s);e._emitRowEvents&&(u.length>1?o.forEach( (c,l)=>{c.forEach(f=>{e.emit("row",f,u[l])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="e\ nd",e.emit("end",u),e.callback&&e.callback(null,u)},"after");if(w.domain&&(t=w.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(Si.prepareValue);if(r. +se conflicts and silent errors executing queries"));var n=(this.values||[]).map(vi.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(Si. -prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var wa=R((qp,ma)=>{"use strict";p();var Tf=(ca(),j(ua)),Pf=Zt(),Np=la(),pa=Re().EventEmitter,Rf=(Rt(),j(Pt)), -Bf=ir(),ya=da(),oe=ma.exports=function(r){pa.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. -_types=new Pf(r.types),this.native=new Tf({types:this._types}),this._queryQueue=[],this._ending=!1,this. -_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Bf(r);this. +this.values)){let s=new Error("Query values must be an array");return t(s)}var i=this.values.map(vi. +prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var ga=R((Qp,wa)=>{"use strict";p();var Pf=(la(),j(ca)),Rf=Zt(),qp=fa(),ya=Be().EventEmitter,Bf=(Bt(),j(Rt)), +Lf=ir(),ma=pa(),oe=wa.exports=function(r){ya.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. +_types=new Rf(r.types),this.native=new Pf({types:this._types}),this._queryQueue=[],this._ending=!1,this. +_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Lf(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={}};oe.Query= -ya;Rf.inherits(oe,pa);oe.prototype._errorAllQueries=function(r){let e=a(t=>{w.nextTick(()=>{t.native= +ma;Bf.inherits(oe,ya);oe.prototype._errorAllQueries=function(r){let e=a(t=>{w.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};oe.prototype._connect=function(r){var e=this; if(this._connecting){w.nextTick(()=>r(new Error("Client has already been connected. You cannot reuse\ @@ -1193,7 +1193,7 @@ _pulseQueryQueue(!0),r()})})};oe.prototype.connect=function(r){if(r){this._conne _Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};oe.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=="f\ unction")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 ya(r,e,t),!n.callback){let c,l;i=new this. +e);else if(s=this.connectionParameters.query_timeout,n=new ma(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");w.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)=>{ @@ -1210,34 +1210,34 @@ in");return}this._activeQuery=e,e.submit(this);var t=this;e.once("_done",functio oe.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};oe.prototype.ref=function(){}; oe.prototype.unref=function(){};oe.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( -r,e,t)};oe.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var vi=R((Wp,ga)=>{"use strict";p();ga.exports=wa()});var Lt=R(($p,kt)=>{"use strict";p();var Lf=na(),kf=It(),Ff=di(),Mf=aa(),{DatabaseError:Uf}=li(),Df=a( -r=>{var e;return e=class extends Mf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),Ei=a( -function(r){this.defaults=kf,this.Client=r,this.Query=this.Client.Query,this.Pool=Df(this.Client),this. -_pools=[],this.Connection=Ff,this.types=At(),this.DatabaseError=Uf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< -"u"?kt.exports=new Ei(vi()):(kt.exports=new Ei(Lf),Object.defineProperty(kt.exports,"native",{configurable:!0, -enumerable:!1,get(){var r=null;try{r=new Ei(vi())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. -defineProperty(kt.exports,"native",{value:r}),r}}))});var qf={};he(qf,{Client:()=>ct,DatabaseError:()=>ve.DatabaseError,NeonDbError:()=>le,NeonQueryPromise:()=>Be, -Pool:()=>hr,SqlTemplate:()=>Xe,UnsafeRawSql:()=>et,_bundleExt:()=>Nf,defaults:()=>ve.defaults,escapeIdentifier:()=>ve.escapeIdentifier, -escapeLiteral:()=>ve.escapeLiteral,neon:()=>nn,neonConfig:()=>be,types:()=>ve.types,warnIfBrowser:()=>gt}); -module.exports=j(qf);p();p();Ke();Tr();p();var yu=Object.defineProperty,mu=Object.defineProperties,wu=Object.getOwnPropertyDescriptors,us=Object. -getOwnPropertySymbols,gu=Object.prototype.hasOwnProperty,bu=Object.prototype.propertyIsEnumerable,cs=a( -(r,e,t)=>e in r?yu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), -xu=a((r,e)=>{for(var t in e||(e={}))gu.call(e,t)&&cs(r,t,e[t]);if(us)for(var t of us(e))bu.call(e,t)&& -cs(r,t,e[t]);return r},"__spreadValues"),Su=a((r,e)=>mu(r,wu(e)),"__spreadProps"),vu=1008e3,ls=new Uint8Array( -new Uint16Array([258]).buffer)[0]===2,Eu=new TextDecoder,Pr=new TextEncoder,qt=Pr.encode("0123456789\ -abcdef"),Qt=Pr.encode("0123456789ABCDEF"),Au=Pr.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ -stuvwxyz0123456789+/");var fs=Au.slice();fs[62]=45;fs[63]=95;var ht,jt;function _u(r,{alphabet:e,scratchArr:t}={}){if(!ht)if(ht= -new Uint16Array(256),jt=new Uint16Array(256),ls)for(let C=0;C<256;C++)ht[C]=qt[C&15]<<8|qt[C>>>4],jt[C]= -Qt[C&15]<<8|Qt[C>>>4];else for(let C=0;C<256;C++)ht[C]=qt[C&15]|qt[C>>>4]<<8,jt[C]=Qt[C&15]|Qt[C>>>4]<< +r,e,t)};oe.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var Ei=R((Hp,ba)=>{"use strict";p();ba.exports=ga()});var kt=R((Gp,Ft)=>{"use strict";p();var kf=ia(),Ff=Tt(),Mf=pi(),Uf=ua(),{DatabaseError:Df}=fi(),Of=a( +r=>{var e;return e=class extends Uf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),Ai=a( +function(r){this.defaults=Ff,this.Client=r,this.Query=this.Client.Query,this.Pool=Of(this.Client),this. +_pools=[],this.Connection=Mf,this.types=_t(),this.DatabaseError=Df},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< +"u"?Ft.exports=new Ai(Ei()):(Ft.exports=new Ai(kf),Object.defineProperty(Ft.exports,"native",{configurable:!0, +enumerable:!1,get(){var r=null;try{r=new Ai(Ei())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. +defineProperty(Ft.exports,"native",{value:r}),r}}))});var Qf={};fe(Qf,{Client:()=>ft,DatabaseError:()=>ve.DatabaseError,NeonDbError:()=>Y,NeonQueryPromise:()=>Le, +Pool:()=>hr,SqlTemplate:()=>tt,UnsafeRawSql:()=>rt,_bundleExt:()=>qf,defaults:()=>ve.defaults,escapeIdentifier:()=>ve.escapeIdentifier, +escapeLiteral:()=>ve.escapeLiteral,neon:()=>sn,neonConfig:()=>be,types:()=>ve.types,warnIfBrowser:()=>bt}); +module.exports=j(Qf);p();p();Ye();Pr();p();var mu=Object.defineProperty,wu=Object.defineProperties,gu=Object.getOwnPropertyDescriptors,cs=Object. +getOwnPropertySymbols,bu=Object.prototype.hasOwnProperty,xu=Object.prototype.propertyIsEnumerable,ls=a( +(r,e,t)=>e in r?mu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), +Su=a((r,e)=>{for(var t in e||(e={}))bu.call(e,t)&&ls(r,t,e[t]);if(cs)for(var t of cs(e))xu.call(e,t)&& +ls(r,t,e[t]);return r},"__spreadValues"),vu=a((r,e)=>wu(r,gu(e)),"__spreadProps"),Eu=1008e3,fs=new Uint8Array( +new Uint16Array([258]).buffer)[0]===2,Au=new TextDecoder,Rr=new TextEncoder,qt=Rr.encode("0123456789\ +abcdef"),Qt=Rr.encode("0123456789ABCDEF"),_u=Rr.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ +stuvwxyz0123456789+/");var hs=_u.slice();hs[62]=45;hs[63]=95;var dt,jt;function Cu(r,{alphabet:e,scratchArr:t}={}){if(!dt)if(dt= +new Uint16Array(256),jt=new Uint16Array(256),fs)for(let C=0;C<256;C++)dt[C]=qt[C&15]<<8|qt[C>>>4],jt[C]= +Qt[C&15]<<8|Qt[C>>>4];else for(let C=0;C<256;C++)dt[C]=qt[C&15]|qt[C>>>4]<<8,jt[C]=Qt[C&15]|Qt[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"?jt:ht,f=0,y=0,g;if(ls) +r.buffer,r.byteOffset,s),c=new Uint32Array(o.buffer,o.byteOffset,i),l=e==="upper"?jt:dt,f=0,y=0,g;if(fs) 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;ut[ye(this. +n,i]of Object.entries(this._keyMap))this._mapKey.set(i,n)}let t={};return e.forEach((n,i)=>t[pe(this. _mapKey.has(i)?this._mapKey.get(i):i)]=n),t}mapDecode(e,t){let n=this.decode(e);if(this._keyMap)switch(n. -constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return Es( -()=>(Or(),this?this.decode(e,t):yt.prototype.decode.call(ys,e,t)));Qe=t>-1?t:e.length,h=0,Lr=0,mt=0, -$t=null,Br=gs,W=null,x=e;try{ee=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ +constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return As( +()=>(Nr(),this?this.decode(e,t):mt.prototype.decode.call(ms,e,t)));We=t>-1?t:e.length,h=0,kr=0,wt=0, +$t=null,Lr=bs,W=null,x=e;try{ee=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ throw x=null,e instanceof Uint8Array?n:new Error("Source must be a Uint8Array or Buffer but was a "+ -(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof yt){if(B=this,ie=this.sharedValues&& +(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof mt){if(B=this,ie=this.sharedValues&& (this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this. -structures)return N=this.structures,Wt();(!N||N.length>0)&&(N=[])}else B=ys,(!N||N.length>0)&&(N=[]), -ie=null;return Wt()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;wt=!0;let o=this?this.decode(e, -s):qr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=W.postBundlePosition){let e=new Error("Unexpected bundle pos\ -ition");throw e.incomplete=!0,e}h=W.postBundlePosition,W=null}if(h==Qe)N=null,x=null,pe&&(pe=null);else if(h> -Qe){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!wt)throw new Error( -"Data read, but end of buffer not reached");return r}catch(r){throw Or(),(r instanceof RangeError||r. +structures)return N=this.structures,Wt();(!N||N.length>0)&&(N=[])}else B=ms,(!N||N.length>0)&&(N=[]), +ie=null;return Wt()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;gt=!0;let o=this?this.decode(e, +s):Qr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=W.postBundlePosition){let e=new Error("Unexpected bundle pos\ +ition");throw e.incomplete=!0,e}h=W.postBundlePosition,W=null}if(h==We)N=null,x=null,de&&(de=null);else if(h> +We){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!gt)throw new Error( +"Data read, but end of buffer not reached");return r}catch(r){throw Nr(),(r instanceof RangeError||r. message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a(Wt,"checkedRead");function L(){ -let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return ku();r=ee. -getUint16(h),h+=2;break;case 26:if(e==7){let t=ee.getFloat32(h);if(B.useFloat32>2){let n=As[(x[h]&127)<< +let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return Fu();r=ee. +getUint16(h),h+=2;break;case 26:if(e==7){let t=ee.getFloat32(h);if(B.useFloat32>2){let n=_s[(x[h]&127)<< 1|x[h+1]>>7];return h+=4,(n*t+(t>0?.5:-.5)>>0)/n}return h+=4,t}if(r=ee.getUint32(h),h+=4,e===1)return-1- r;break;case 27:if(e==7){let t=ee.getFloat64(h);return h+=8,t}if(e>1){if(ee.getUint32(h)>0)throw new Error( "JavaScript does not support arrays, maps, or strings with length over 4294967295");r=ee.getUint32(h+ 4)}else B.int64AsNumber?(r=ee.getUint32(h)*4294967296,r+=ee.getUint32(h+4)):r=ee.getBigUint64(h);h+= 8;break;case 31:switch(e){case 2:case 3:throw new Error("Indefinite length not supported for byte or\ - text strings");case 4:let t=[],n,i=0;for(;(n=L())!=ze;){if(i>=dt)throw new Error(`Array length exce\ -eds ${dt}`);t[i++]=n}return e==4?t:e==3?t.join(""):m.concat(t);case 5:let s;if(B.mapsAsObjects){let o={}, -u=0;if(B.keyMap)for(;(s=L())!=ze;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[ye(B. -decodeKey(s))]=L()}else for(;(s=L())!=ze;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`); -o[ye(s)]=L()}return o}else{pt&&(B.mapsAsObjects=!0,pt=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s= -L())!=ze;){if(u++>=_e)throw new Error(`Map size exceeds ${_e}`);o.set(B.decodeKey(s),L())}}else{let u=0; -for(;(s=L())!=ze;){if(u++>=_e)throw new Error(`Map size exceeds ${_e}`);o.set(s,L())}}return o}case 7: -return ze;default:throw new Error("Invalid major type for indefinite length "+e)}default:throw new Error( -"Unknown token "+r)}switch(e){case 0:return r;case 1:return~r;case 2:return Lu(r);case 3:if(mt>=h)return $t. -slice(h-Gt,(h+=r)-Gt);if(mt==0&&Qe<140&&r<32){let i=r<16?xs(r):Bu(r);if(i!=null)return i}return Ru(r);case 4: -if(r>=dt)throw new Error(`Array length exceeds ${dt}`);let t=new Array(r);for(let i=0;i=_e)throw new Error(`Map size exceeds ${dt}`);if(B.mapsAsObjects){let i={};if(B. -keyMap)for(let s=0;s=ds){let i=N[r&8191];if(i)return i. -read||(i.read=Mr(i)),i.read();if(r<65536){if(r==Pu){let s=Je(),o=L(),u=L();Dr(o,u);let c={};if(B.keyMap) -for(let l=2;l=pt)throw new Error(`Array length exce\ +eds ${pt}`);t[i++]=n}return e==4?t:e==3?t.join(""):m.concat(t);case 5:let s;if(B.mapsAsObjects){let o={}, +u=0;if(B.keyMap)for(;(s=L())!=Je;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[pe(B. +decodeKey(s))]=L()}else for(;(s=L())!=Je;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`); +o[pe(s)]=L()}return o}else{yt&&(B.mapsAsObjects=!0,yt=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s= +L())!=Je;){if(u++>=_e)throw new Error(`Map size exceeds ${_e}`);o.set(B.decodeKey(s),L())}}else{let u=0; +for(;(s=L())!=Je;){if(u++>=_e)throw new Error(`Map size exceeds ${_e}`);o.set(s,L())}}return o}case 7: +return Je;default:throw new Error("Invalid major type for indefinite length "+e)}default:throw new Error( +"Unknown token "+r)}switch(e){case 0:return r;case 1:return~r;case 2:return ku(r);case 3:if(wt>=h)return $t. +slice(h-Gt,(h+=r)-Gt);if(wt==0&&We<140&&r<32){let i=r<16?Ss(r):Lu(r);if(i!=null)return i}return Bu(r);case 4: +if(r>=pt)throw new Error(`Array length exceeds ${pt}`);let t=new Array(r);for(let i=0;i=_e)throw new Error(`Map size exceeds ${pt}`);if(B.mapsAsObjects){let i={};if(B. +keyMap)for(let s=0;s=ps){let i=N[r&8191];if(i)return i. +read||(i.read=Ur(i)),i.read();if(r<65536){if(r==Ru){let s=Xe(),o=L(),u=L();Or(o,u);let c={};if(B.keyMap) +for(let l=2;l23)switch(t){case 24: t=x[h++];break;case 25:t=ee.getUint16(h),h+=2;break;case 26:t=ee.getUint32(h),h+=4;break;default:throw new Error( "Expected array header, but got "+x[h-1])}let n=this.compiledReader;for(;n;){if(n.propertyCount===t) -return n(L);n=n.next}if(this.slowReads++>=bs){let s=this.length==t?this:this.slice(0,t);return n=B.keyMap? -new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>ms.test(o)?ye(o)+":r()":"["+JSON.stringify( -o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>ms.test(o)?ye(o)+":r()":"["+JSON.stringify( +return n(L);n=n.next}if(this.slowReads++>=xs){let s=this.length==t?this:this.slice(0,t);return n=B.keyMap? +new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>ws.test(o)?pe(o)+":r()":"["+JSON.stringify( +o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>ws.test(o)?pe(o)+":r()":"["+JSON.stringify( o)+"]:r()").join(",")+"}"),this.compiledReader&&(n.next=this.compiledReader),n.propertyCount=t,this. -compiledReader=n,n(L)}let i={};if(B.keyMap)for(let s=0;s64&&Rr)return Rr.decode(x.subarray(h,h+=r));let t=h+ +Invalid property name type "+typeof r)}a(pe,"safeKey");var Bu=Dr;function Dr(r){let e;if(r<16&&(e=Ss(r)))return e;if(r>64&&Br)return Br.decode(x.subarray(h,h+=r));let t=h+ r,n=[];for(e="";h=t||(x[h]& 192)!==128)n.push(65533);else{let s=x[h++]&63;n.push((i&31)<<6|s)}else if((i&240)===224){let s=h=t||(s&192)!==128||i===224&&s<160||i===237&&s>=160)n.push(65533);else if(h++,h>=t||(x[h]&192)!== @@ -1312,79 +1312,79 @@ r,n=[];for(e="";h244||h>=t||(s&192)!==128||i===240&&s<144||i===244&&s>=144)n.push(65533);else if(h++,h>= t||(x[h]&192)!==128)n.push(65533);else{let o=x[h++]&63;if(h>=t||(x[h]&192)!==128)n.push(65533);else{ let u=x[h++]&63,c=(i&7)<<18|(s&63)<<12|o<<6|u;c-=65536,n.push(c>>>10&1023|55296),n.push(56320|c&1023)}}}else -n.push(65533);n.length>=4096&&(e+=K.apply(String,n),n.length=0)}return n.length>0&&(e+=K.apply(String, -n)),e}a(Ur,"readStringJS");var K=String.fromCharCode;function Bu(r){let e=h,t=new Array(r);for(let n=0;n< -r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return K.apply(String,t)}a(Bu,"longStringInJS"); -function xs(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return K(e)}}else{ -let e=x[h++],t=x[h++];if((e&128)>0||(t&128)>0){h-=2;return}if(r<3)return K(e,t);let n=x[h++];if((n&128)> -0){h-=3;return}return K(e,t,n)}else{let e=x[h++],t=x[h++],n=x[h++],i=x[h++];if((e&128)>0||(t&128)>0|| -(n&128)>0||(i&128)>0){h-=4;return}if(r<6){if(r===4)return K(e,t,n,i);{let s=x[h++];if((s&128)>0){h-= -5;return}return K(e,t,n,i,s)}}else if(r<8){let s=x[h++],o=x[h++];if((s&128)>0||(o&128)>0){h-=6;return} -if(r<7)return K(e,t,n,i,s,o);let u=x[h++];if((u&128)>0){h-=7;return}return K(e,t,n,i,s,o,u)}else{let s=x[h++], +n.push(65533);n.length>=4096&&(e+=V.apply(String,n),n.length=0)}return n.length>0&&(e+=V.apply(String, +n)),e}a(Dr,"readStringJS");var V=String.fromCharCode;function Lu(r){let e=h,t=new Array(r);for(let n=0;n< +r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return V.apply(String,t)}a(Lu,"longStringInJS"); +function Ss(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return V(e)}}else{ +let e=x[h++],t=x[h++];if((e&128)>0||(t&128)>0){h-=2;return}if(r<3)return V(e,t);let n=x[h++];if((n&128)> +0){h-=3;return}return V(e,t,n)}else{let e=x[h++],t=x[h++],n=x[h++],i=x[h++];if((e&128)>0||(t&128)>0|| +(n&128)>0||(i&128)>0){h-=4;return}if(r<6){if(r===4)return V(e,t,n,i);{let s=x[h++];if((s&128)>0){h-= +5;return}return V(e,t,n,i,s)}}else if(r<8){let s=x[h++],o=x[h++];if((s&128)>0||(o&128)>0){h-=6;return} +if(r<7)return V(e,t,n,i,s,o);let u=x[h++];if((u&128)>0){h-=7;return}return V(e,t,n,i,s,o,u)}else{let s=x[h++], o=x[h++],u=x[h++],c=x[h++];if((s&128)>0||(o&128)>0||(u&128)>0||(c&128)>0){h-=8;return}if(r<10){if(r=== -8)return K(e,t,n,i,s,o,u,c);{let l=x[h++];if((l&128)>0){h-=9;return}return K(e,t,n,i,s,o,u,c,l)}}else if(r< -12){let l=x[h++],f=x[h++];if((l&128)>0||(f&128)>0){h-=10;return}if(r<11)return K(e,t,n,i,s,o,u,c,l,f); -let y=x[h++];if((y&128)>0){h-=11;return}return K(e,t,n,i,s,o,u,c,l,f,y)}else{let l=x[h++],f=x[h++],y=x[h++], -g=x[h++];if((l&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return K(e,t, -n,i,s,o,u,c,l,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return K(e,t,n,i,s,o,u,c,l,f,y,g,E)}}else{ -let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return K(e,t,n,i,s,o,u,c,l,f,y,g, -E,C);let H=x[h++];if((H&128)>0){h-=15;return}return K(e,t,n,i,s,o,u,c,l,f,y,g,E,C,H)}}}}}a(xs,"short\ -StringInJS");function Lu(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( -h,h+=r)}a(Lu,"readBin");var Ss=new Float32Array(1),Ht=new Uint8Array(Ss.buffer,0,4);function ku(){let r=x[h++],e=x[h++],t=(r& +8)return V(e,t,n,i,s,o,u,c);{let l=x[h++];if((l&128)>0){h-=9;return}return V(e,t,n,i,s,o,u,c,l)}}else if(r< +12){let l=x[h++],f=x[h++];if((l&128)>0||(f&128)>0){h-=10;return}if(r<11)return V(e,t,n,i,s,o,u,c,l,f); +let y=x[h++];if((y&128)>0){h-=11;return}return V(e,t,n,i,s,o,u,c,l,f,y)}else{let l=x[h++],f=x[h++],y=x[h++], +g=x[h++];if((l&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return V(e,t, +n,i,s,o,u,c,l,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E)}}else{ +let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return V(e,t,n,i,s,o,u,c,l,f,y,g, +E,C);let H=x[h++];if((H&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E,C,H)}}}}}a(Ss,"short\ +StringInJS");function ku(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( +h,h+=r)}a(ku,"readBin");var vs=new Float32Array(1),Ht=new Uint8Array(vs.buffer,0,4);function Fu(){let r=x[h++],e=x[h++],t=(r& 127)>>2;if(t===31)return e||r&3?NaN:r&128?-1/0:1/0;if(t===0){let n=((r&3)<<8|e)/16777216;return r&128? --n:n}return Ht[3]=r&128|(t>>1)+56,Ht[2]=(r&7)<<5|e>>3,Ht[1]=e<<5,Ht[0]=0,Ss[0]}a(ku,"getFloat16");var ah=new Array( -4096);var Qr=class Qr{constructor(e,t){this.value=e,this.tag=t}};a(Qr,"Tag");var Ze=Qr;q[0]=r=>new Date(r); +-n:n}return Ht[3]=r&128|(t>>1)+56,Ht[2]=(r&7)<<5|e>>3,Ht[1]=e<<5,Ht[0]=0,vs[0]}a(Fu,"getFloat16");var uh=new Array( +4096);var jr=class jr{constructor(e,t){this.value=e,this.tag=t}};a(jr,"Tag");var et=jr;q[0]=r=>new Date(r); q[1]=r=>new Date(Math.round(r*1e3));q[2]=r=>{let e=BigInt(0);for(let t=0,n=r.byteLength;tBigInt(-1)-q[2](r);q[4]=r=>+(r[1]+"e"+r[0]);q[5]=r=>r[1]*Math. -exp(r[0]*Math.log(2));var Dr=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. -restoreStructures=[]))[r]=t),N[r]=e,e.read=Mr(e)},"recordDefinition");q[Iu]=r=>{let e=r.length,t=r[1]; -Dr(r[0],t);let n={};for(let i=2;iW?W[0].slice( -W.position0,W.position0+=r):new Ze(r,14);q[15]=r=>W?W[1].slice(W.position1,W.position1+=r):new Ze(r, -15);var Fu={Error,RegExp};q[27]=r=>(Fu[r[0]]||Error)(r[1],r[2]);var vs=a(r=>{if(x[h++]!=132){let t=new Error( +exp(r[0]*Math.log(2));var Or=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. +restoreStructures=[]))[r]=t),N[r]=e,e.read=Ur(e)},"recordDefinition");q[Tu]=r=>{let e=r.length,t=r[1]; +Or(r[0],t);let n={};for(let i=2;iW?W[0].slice( +W.position0,W.position0+=r):new et(r,14);q[15]=r=>W?W[1].slice(W.position1,W.position1+=r):new et(r, +15);var Mu={Error,RegExp};q[27]=r=>(Mu[r[0]]||Error)(r[1],r[2]);var Es=a(r=>{if(x[h++]!=132){let t=new Error( "Packed values structure must be followed by a 4 element array");throw x.length{if(!ie)if(B.getShared)Nr();else return new Ze( -r,ps);if(typeof r=="number")return ie[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ -ger packed references yet");throw r===void 0&&(e.incomplete=!0),e};q[28]=r=>{pe||(pe=new Map,pe.id=0); -let e=pe.id++,t=h,n=x[h],i;n>>5==4?i=[]:i={};let s={target:i};pe.set(e,s);let o=r();return s.used?(Object. -getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(h=t,i=o,pe.set(e,{target:i}),o=r()),Object.assign(i,o)): -(s.target=o,o)};q[28].handlesRead=!0;q[29]=r=>{let e=pe.get(r);return e.used=!0,e.target};q[258]=r=>new Set( -r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,pt=!0),r())).handlesRead=!0;function Ye(r,e){return typeof r== -"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Ye,"combine");function qe(){if(!ie) -if(B.getShared)Nr();else throw new Error("No packed values available");return ie}a(qe,"getPackedValu\ -es");var Mu=1399353956;kr.push((r,e)=>{if(r>=225&&r<=255)return Ye(qe().prefixes[r-224],e);if(r>=28704&& -r<=32767)return Ye(qe().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return Ye(qe().prefixes[r- -1879048192],e);if(r>=216&&r<=223)return Ye(e,qe().suffixes[r-216]);if(r>=27647&&r<=28671)return Ye(e, -qe().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return Ye(e,qe().suffixes[r-1811939328]);if(r== -Mu)return{packedValues:ie,structures:N.slice(0),version:e};if(r==55799)return e});var Uu=new Uint8Array( -new Uint16Array([1]).buffer)[0]==1,ws=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> +r(),r()},"packedTable");Es.handlesRead=!0;q[51]=Es;q[ys]=r=>{if(!ie)if(B.getShared)qr();else return new et( +r,ys);if(typeof r=="number")return ie[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ +ger packed references yet");throw r===void 0&&(e.incomplete=!0),e};q[28]=r=>{de||(de=new Map,de.id=0); +let e=de.id++,t=h,n=x[h],i;n>>5==4?i=[]:i={};let s={target:i};de.set(e,s);let o=r();return s.used?(Object. +getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(h=t,i=o,de.set(e,{target:i}),o=r()),Object.assign(i,o)): +(s.target=o,o)};q[28].handlesRead=!0;q[29]=r=>{let e=de.get(r);return e.used=!0,e.target};q[258]=r=>new Set( +r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,yt=!0),r())).handlesRead=!0;function Ze(r,e){return typeof r== +"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Ze,"combine");function je(){if(!ie) +if(B.getShared)qr();else throw new Error("No packed values available");return ie}a(je,"getPackedValu\ +es");var Uu=1399353956;Fr.push((r,e)=>{if(r>=225&&r<=255)return Ze(je().prefixes[r-224],e);if(r>=28704&& +r<=32767)return Ze(je().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return Ze(je().prefixes[r- +1879048192],e);if(r>=216&&r<=223)return Ze(e,je().suffixes[r-216]);if(r>=27647&&r<=28671)return Ze(e, +je().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return Ze(e,je().suffixes[r-1811939328]);if(r== +Uu)return{packedValues:ie,structures:N.slice(0),version:e};if(r==55799)return e});var Du=new Uint8Array( +new Uint16Array([1]).buffer)[0]==1,gs=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> "u"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"? -{name:"BigInt64Array"}:BigInt64Array,Float32Array,Float64Array],Du=[64,68,69,70,71,72,77,78,79,85,86]; -for(let r=0;r{if(!r)throw new Error("Could not find typed array for code "+e); +2:n==8?3:0;q[i?e:e-4]=n==1||i==Du?o=>{if(!r)throw new Error("Could not find typed array for code "+e); return!B.copyBuffers&&(n===1||n===2&&!(o.byteOffset&1)||n===4&&!(o.byteOffset&3)||n===8&&!(o.byteOffset& 7))?new r(o.buffer,o.byteOffset,o.byteLength>>s):new r(Uint8Array.prototype.slice.call(o,0).buffer)}: o=>{if(!r)throw new Error("Could not find typed array for code "+e);let u=new DataView(o.buffer,o.byteOffset, o.byteLength),c=o.length>>s,l=new r(c),f=u[t];for(let y=0;y23)switch(r){case 24:r=x[h++];break;case 25:r=ee.getUint16( -h),h+=2;break;case 26:r=ee.getUint32(h),h+=4;break}return r}a(Je,"readJustLength");function Nr(){if(B. -getShared){let r=Es(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ie= -B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(Nr, -"loadShared");function Es(r){let e=Qe,t=h,n=Lr,i=Gt,s=mt,o=$t,u=Br,c=pe,l=W,f=new Uint8Array(x.slice( -0,Qe)),y=N,g=B,E=wt,C=r();return Qe=e,h=t,Lr=n,Gt=i,mt=s,$t=o,Br=u,pe=c,W=l,x=f,wt=E,N=y,B=g,ee=new DataView( -x.buffer,x.byteOffset,x.byteLength),C}a(Es,"saveState");function Or(){x=null,pe=null,N=null}a(Or,"cl\ -earSource");var As=new Array(147);for(let r=0;r<256;r++)As[r]=+("1e"+Math.floor(45.15-r*.30103));var qr=new Fr({ -useRecords:!1}),uh=qr.decode,_s=qr.decodeMultiple;p();var Vt=class Vt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ +Nu,"registerTypedArray");function qu(){let r=Xe(),e=h+L();for(let n=2;n23)switch(r){case 24:r=x[h++];break;case 25:r=ee.getUint16( +h),h+=2;break;case 26:r=ee.getUint32(h),h+=4;break}return r}a(Xe,"readJustLength");function qr(){if(B. +getShared){let r=As(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ie= +B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(qr, +"loadShared");function As(r){let e=We,t=h,n=kr,i=Gt,s=wt,o=$t,u=Lr,c=de,l=W,f=new Uint8Array(x.slice( +0,We)),y=N,g=B,E=gt,C=r();return We=e,h=t,kr=n,Gt=i,wt=s,$t=o,Lr=u,de=c,W=l,x=f,gt=E,N=y,B=g,ee=new DataView( +x.buffer,x.byteOffset,x.byteLength),C}a(As,"saveState");function Nr(){x=null,de=null,N=null}a(Nr,"cl\ +earSource");var _s=new Array(147);for(let r=0;r<256;r++)_s[r]=+("1e"+Math.floor(45.15-r*.30103));var Qr=new Mr({ +useRecords:!1}),ch=Qr.decode,Cs=Qr.decodeMultiple;p();var Vt=class Vt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ let{strings:t,values:n}=this;for(let i=0,s=t.length;iu.length!==0).map(u=>JSON.parse(u)):_s(new Uint8Array(await r.arrayBuffer())),n=t.at(-1); -if(n?.type!=="end")throw new le("Neon internal error: streamed response ended without a terminal mes\ -sage");if(n.status==="error")throw fo(n.error);if(n.status!=="ok")throw new le("Neon internal error:\ - unexpected streamed response status");let i,s,o=[];for(let u of t.slice(0,-1))switch(u.type){case"c\ -olumns":i=u.columns;break;case"row":o.push(u.row);break;case"query":s=u.query;break;default:throw new le( -"Neon internal error: unexpected streamed response message")}if(!Array.isArray(i)||s===void 0)throw new le( -"Neon internal error: incomplete streamed response");return{fields:i,rows:o,command:s.command,rowCount:s. -rowCount}}a(Kc,"readStreamingResult");function zc(r){return r instanceof m?"\\x"+hs(r):r}a(zc,"encod\ -eBuffersAsBytea");function ao(r){let{query:e,params:t}=r instanceof Xe?r.toParameterizedQuery():r;return{ -query:e,params:t.map(n=>zc((0,lo.prepareValue)(n)))}}a(ao,"prepareQuery");function nn(r,{arrayMode:e, +er,"NeonDbError");var Y=er,ao="transaction() expects an array of queries, or a function returning an\ + array of queries",Vc=["severity","code","detail","hint","position","internalPosition","internalQuer\ +y","where","schema","table","column","dataType","constraint","file","line","routine"],Kc={json:"appl\ +ication/json",jsonl:"application/vnd.neon.sql.v1+json","cbor-seq":"application/vnd.neon.sql.v1+cbor"}; +function ho(r){let e=new Y(r.message);for(let t of Vc)e[t]=r[t]??void 0;return e}a(ho,"dbError");async function zc(r,e,t){ +let n=e==="jsonl"?(await r.text()).split(` +`).filter(u=>u.length!==0).map(u=>JSON.parse(u)):Cs(new Uint8Array(await r.arrayBuffer())),i=n.at(-1); +if(i?.type!=="end")throw new Y("Neon internal error: streamed response ended without a terminal mess\ +age");if(i.status==="error")throw ho(i.error);if(i.status!=="ok")throw new Y("Neon internal error: u\ +nexpected streamed response status");let s=[],o;for(let u of n.slice(0,-1))switch(u.type){case"colum\ +ns":if(o!==void 0||!Array.isArray(u.columns))throw new Y("Neon internal error: unexpected streamed r\ +esponse message");o={fields:u.columns,rows:[]};break;case"row":if(o===void 0||!Array.isArray(u.row)) +throw new Y("Neon internal error: unexpected streamed response message");o.rows.push(u.row);break;case"\ +query":if(o===void 0||u.query===void 0)throw new Y("Neon internal error: unexpected streamed respons\ +e message");s.push({fields:o.fields,rows:o.rows,command:u.query.command,rowCount:u.query.rowCount}), +o=void 0;break;default:throw new Y("Neon internal error: unexpected streamed response message")}if(o!== +void 0||!t&&s.length!==1)throw new Y("Neon internal error: incomplete streamed response");return t?{ +results:s}:s[0]}a(zc,"readStreamingResult");function Yc(r){return r instanceof m?"\\x"+ds(r):r}a(Yc, +"encodeBuffersAsBytea");function uo(r){let{query:e,params:t}=r instanceof tt?r.toParameterizedQuery(): +r;return{query:e,params:t.map(n=>Yc((0,fo.prepareValue)(n)))}}a(uo,"prepareQuery");function sn(r,{arrayMode:e, fullResults:t,fetchOptions:n,responseFormat:i,isolationLevel:s,readOnly:o,deferrable:u,authToken:c,disableWarningInBrowsers:l}={}){ if(!r)throw new Error("No database connection string was provided to `neon()`. Perhaps an environmen\ -t variable has not been set?");let f;try{f=Ir(r)}catch{throw new Error("Database connection string p\ +t variable has not been set?");let f;try{f=Tr(r)}catch{throw new Error("Database connection string p\ rovided to `neon()` is not a valid URL. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E, port:C,pathname:H}=f;if(y!=="postgres:"&&y!=="postgresql:"||!g||!E||!H)throw new Error("Database con\ nection string format for `neon()` should be: postgresql://user@host.tld/dbname?option=value");function J(T,...b){ if(!(Array.isArray(T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can no\ w be called only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], \ options). For a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SE\ -LECT $1", [value], options).');return new Be(ge,new Xe(T,b))}a(J,"templateFn"),J.query=(T,b,k)=>new Be( -ge,{query:T,params:b??[]},k),J.unsafe=T=>new et(T),J.transaction=async(T,b)=>{if(typeof T=="function"&& -(T=T(J)),!Array.isArray(T))throw new Error(oo);T.forEach($=>{if(!($ instanceof Be))throw new Error(oo)}); -let k=T.map($=>$.queryData),ae=T.map($=>$.opts??{});return ge(k,ae,b)};async function ge(T,b,k){let{ -fetchEndpoint:ae,fetchFunction:$}=be,Ie=Array.isArray(T)?{queries:T.map(G=>ao(G))}:ao(T),fe=n??{},ue=i?? -"json",M=e??!1,Z=t??!1,Ee=s,Te=o,Fe=u;if(k!==void 0&&(k.fetchOptions!==void 0&&(fe={...fe,...k.fetchOptions}), -k.arrayMode!==void 0&&(M=k.arrayMode),k.fullResults!==void 0&&(Z=k.fullResults),k.responseFormat!==void 0&& -(ue=k.responseFormat),k.isolationLevel!==void 0&&(Ee=k.isolationLevel),k.readOnly!==void 0&&(Te=k.readOnly), -k.deferrable!==void 0&&(Fe=k.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!==void 0&&(fe= -{...fe,...b.fetchOptions}),b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(ue=b.responseFormat), -Array.isArray(T)&&ue!=="json")throw new Error("`jsonl` and `cbor-seq` response formats do not suppor\ -t transactions");let Me=c;!Array.isArray(b)&&b?.authToken!==void 0&&(Me=b.authToken);let lt=typeof ae== -"function"?ae(E,C,{jwtAuth:Me!==void 0}):ae,Ue={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ -rue","Neon-Array-Mode":"true",Accept:Vc[ue]},Ft=await Yc(Me);Ft&&(Ue.Authorization=`Bearer ${Ft}`),Array. -isArray(T)&&(Ee!==void 0&&(Ue["Neon-Batch-Isolation-Level"]=Ee),Te!==void 0&&(Ue["Neon-Batch-Read-On\ -ly"]=String(Te)),Fe!==void 0&&(Ue["Neon-Batch-Deferrable"]=String(Fe))),l||be.disableWarningInBrowsers|| -gt();let ce;try{ce=await($??fetch)(lt,{method:"POST",body:JSON.stringify(Ie),headers:Ue,...fe})}catch(G){ -let X=new le(`Error connecting to database: ${G}`);throw X.sourceError=G,X}if(ce.ok){let G=ue==="jso\ -n"?await ce.json():await Kc(ce,ue);if(Array.isArray(T)){let X=G.results;if(!Array.isArray(X))throw new le( -"Neon internal error: unexpected result format");return X.map((dr,pr)=>{let yr=b[pr]??{},va=yr.arrayMode?? -M,Ea=yr.fullResults??Z;return uo(dr,{arrayMode:va,fullResults:Ea,types:yr.types})})}else{let X=b??{}, -dr=X.arrayMode??M,pr=X.fullResults??Z;return uo(G,{arrayMode:dr,fullResults:pr,types:X.types})}}else{ -let{status:G}=ce;if(G===400){let X=await ce.json();throw fo(X)}else{let X=await ce.text();throw new le( -`Server error (HTTP status ${G}): ${X}`)}}}return a(ge,"execute"),J}a(nn,"neon");var sn=class sn{constructor(e,t,n){ +LECT $1", [value], options).');return new Le(we,new tt(T,b))}a(J,"templateFn"),J.query=(T,b,F)=>new Le( +we,{query:T,params:b??[]},F),J.unsafe=T=>new rt(T),J.transaction=async(T,b)=>{if(typeof T=="function"&& +(T=T(J)),!Array.isArray(T))throw new Error(ao);T.forEach($=>{if(!($ instanceof Le))throw new Error(ao)}); +let F=T.map($=>$.queryData),ae=T.map($=>$.opts??{});return we(F,ae,b)};async function we(T,b,F){let{ +fetchEndpoint:ae,fetchFunction:$}=be,ge=Array.isArray(T),Ie=ge?{queries:T.map(le=>uo(le))}:uo(T),ce=n?? +{},k=i??"json",Z=e??!1,Ee=t??!1,Te=s,Me=o,Ue=u;F!==void 0&&(F.fetchOptions!==void 0&&(ce={...ce,...F. +fetchOptions}),F.arrayMode!==void 0&&(Z=F.arrayMode),F.fullResults!==void 0&&(Ee=F.fullResults),F.responseFormat!== +void 0&&(k=F.responseFormat),F.isolationLevel!==void 0&&(Te=F.isolationLevel),F.readOnly!==void 0&&(Me= +F.readOnly),F.deferrable!==void 0&&(Ue=F.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!== +void 0&&(ce={...ce,...b.fetchOptions}),b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(k= +b.responseFormat);let De=c;!Array.isArray(b)&&b?.authToken!==void 0&&(De=b.authToken);let dr=typeof ae== +"function"?ae(E,C,{jwtAuth:De!==void 0}):ae,Oe={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ +rue","Neon-Array-Mode":"true",Accept:Kc[k]},Pe=await Jc(De);Pe&&(Oe.Authorization=`Bearer ${Pe}`),ge&& +(Te!==void 0&&(Oe["Neon-Batch-Isolation-Level"]=Te),Me!==void 0&&(Oe["Neon-Batch-Read-Only"]=String( +Me)),Ue!==void 0&&(Oe["Neon-Batch-Deferrable"]=String(Ue))),l||be.disableWarningInBrowsers||bt();let X; +try{X=await($??fetch)(dr,{method:"POST",body:JSON.stringify(Ie),headers:Oe,...ce})}catch(le){let ue=new Y( +`Error connecting to database: ${le}`);throw ue.sourceError=le,ue}if(X.ok){let le=k==="json"?await X. +json():await zc(X,k,ge);if(ge){let ue=le.results;if(!Array.isArray(ue))throw new Y("Neon internal er\ +ror: unexpected result format");return ue.map((pr,yr)=>{let mr=b[yr]??{},Ea=mr.arrayMode??Z,Aa=mr.fullResults?? +Ee;return co(pr,{arrayMode:Ea,fullResults:Aa,types:mr.types})})}else{let ue=b??{},pr=ue.arrayMode??Z, +yr=ue.fullResults??Ee;return co(le,{arrayMode:pr,fullResults:yr,types:ue.types})}}else{let{status:le}=X; +if(le===400){let ue=await X.json();throw ho(ue)}else{let ue=await X.text();throw new Y(`Server error\ + (HTTP status ${le}): ${ue}`)}}}return a(we,"execute"),J}a(sn,"neon");var on=class on{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(sn,"NeonQueryPromise");var Be=sn;function uo(r,{arrayMode:e, -fullResults:t,types:n}){let i=new co.default(n),s=r.fields.map(c=>c.name),o=r.fields.map(c=>i.getTypeParser( +this.queryData,this.opts).finally(e)}};a(on,"NeonQueryPromise");var Le=on;function co(r,{arrayMode:e, +fullResults:t,types:n}){let i=new lo.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(uo,"processQueryResult");async function Yc(r){if(typeof r=="string")return r;if(typeof r== -"function")try{return await Promise.resolve(r())}catch(e){let t=new le("Error getting auth token."); -throw e instanceof Error&&(t=new le(`Error getting auth token: ${e.message}`)),t}}a(Yc,"getAuthToken");p();var xa=De(Lt());p();var ba=De(Lt());var Ai=class Ai extends ba.Client{constructor(t){super(t);this.config=t}get neonConfig(){return this. +o,r._types=i,r):u}a(co,"processQueryResult");async function Jc(r){if(typeof r=="string")return r;if(typeof r== +"function")try{return await Promise.resolve(r())}catch(e){let t=new Y("Error getting auth token.");throw e instanceof +Error&&(t=new Y(`Error getting auth token: ${e.message}`)),t}}a(Jc,"getAuthToken");p();var Sa=Ne(kt());p();var xa=Ne(kt());var _i=class _i extends xa.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\ @@ -1478,40 +1481,40 @@ c=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let l=this.c "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|| -gt(),this._handleAuthCleartextPassword(),this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){ +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(ce=>{if(!/^.=/.test(ce))throw new Error( -"SASL: Invalid attribute pair entry");let G=ce[0],X=ce.substring(2);return[G,X]})),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: protocol error");let u=Object.fromEntries(o.split(",").map(Pe=>{if(!/^.=/.test(Pe))throw new Error( +"SASL: Invalid attribute pair entry");let X=Pe[0],le=Pe.substring(2);return[X,le]})),c=u.r,l=u.s,f=u. +i;if(!c||!/^[!-+--~]+$/.test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unp\ +rintable");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=m.from(l,"base64"),E=new TextEncoder,C=E.encode(s),H=await n.importKey( "raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),J=new Uint8Array(await n.sign("HMAC",H,m.concat( -[g,m.from([0,0,0,1])]))),ge=J;for(var T=0;Tge[G]^J[G]));let b=ge,k=await n.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-2\ -56"}},!1,["sign"]),ae=new Uint8Array(await n.sign("HMAC",k,E.encode("Client Key"))),$=await n.digest( -"SHA-256",ae),Ie="n=*,r="+i.clientNonce,fe="r="+c+",s="+l+",i="+y,ue="c=biws,r="+c,M=Ie+","+fe+","+ue, +[g,m.from([0,0,0,1])]))),we=J;for(var T=0;Twe[X]^J[X]));let b=we,F=await n.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-2\ +56"}},!1,["sign"]),ae=new Uint8Array(await n.sign("HMAC",F,E.encode("Client Key"))),$=await n.digest( +"SHA-256",ae),ge="n=*,r="+i.clientNonce,Ie="r="+c+",s="+l+",i="+y,ce="c=biws,r="+c,k=ge+","+Ie+","+ce, Z=await n.importKey("raw",$,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Ee=new Uint8Array(await n. -sign("HMAC",Z,E.encode(M))),Te=m.from(ae.map((ce,G)=>ae[G]^Ee[G])),Fe=Te.toString("base64");let Me=await n. -importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),lt=await n.sign("HMAC",Me,E.encode( -"Server Key")),Ue=await n.importKey("raw",lt,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Ft=m. -from(await n.sign("HMAC",Ue,E.encode(M)));i.message="SASLResponse",i.serverSignature=Ft.toString("ba\ -se64"),i.response=ue+",p="+Fe,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; -a(Ai,"NeonClient");var ct=Ai;Ke();var Sa=De(ir());function Of(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(Of,"promisify");var _i=class _i extends xa.Pool{constructor(){ -super(...arguments);I(this,"Client",ct);I(this,"hasFetchUnsupportedListeners",!1);I(this,"addListene\ +sign("HMAC",Z,E.encode(k))),Te=m.from(ae.map((Pe,X)=>ae[X]^Ee[X])),Me=Te.toString("base64");let Ue=await n. +importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),De=await n.sign("HMAC",Ue,E.encode( +"Server Key")),dr=await n.importKey("raw",De,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Oe=m. +from(await n.sign("HMAC",dr,E.encode(k)));i.message="SASLResponse",i.serverSignature=Oe.toString("ba\ +se64"),i.response=ce+",p="+Me,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; +a(_i,"NeonClient");var ft=_i;Ye();var va=Ne(ir());function Nf(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(Nf,"promisify");var Ci=class Ci extends Sa.Pool{constructor(){ +super(...arguments);I(this,"Client",ft);I(this,"hasFetchUnsupportedListeners",!1);I(this,"addListene\ r",this.on)}on(t,n){return t!=="error"&&(this.hasFetchUnsupportedListeners=!0),super.on(t,n)}query(t,n,i){ if(!be.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof t=="function")return super.query( -t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=Of(this.Promise,i);i=s.callback;try{let o=new Sa.default( +t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=Nf(this.Promise,i);i=s.callback;try{let o=new va.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??[];nn(l,{fullResults:!0,arrayMode:t. +/${c(o.database)}`,f=typeof t=="string"?t:t.text,y=n??t.values??[];sn(l,{fullResults:!0,arrayMode:t. rowMode==="array"}).query(f,y,{types:t.types??this.options?.types}).then(E=>i(void 0,E)).catch(E=>i( -E))}catch(o){i(o)}return s.result}};a(_i,"NeonPool");var hr=_i;Ke();var ve=De(Lt()),Nf="js"; +E))}catch(o){i(o)}return s.result}};a(Ci,"NeonPool");var hr=Ci;Ye();var ve=Ne(kt()),qf="js"; /*! Bundled license information: ieee754/index.js: diff --git a/index.mjs b/index.mjs index fd32674..a6760dc 100644 --- a/index.mjs +++ b/index.mjs @@ -1,72 +1,72 @@ /* @ts-self-types="./index.d.mts" */ -var Aa=Object.create;var Qe=Object.defineProperty;var _a=Object.getOwnPropertyDescriptor;var Ca=Object.getOwnPropertyNames;var Ia=Object.getPrototypeOf,Ta=Object.prototype.hasOwnProperty;var Pa=(r,e,t)=>e in r?Qe(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>Qe(r,"name",{value:e,configurable:!0});var re=(r,e)=>()=>(r&&(e=r(r=0)),e);var R=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ge=(r,e)=>{for(var t in e)Qe(r,t,{get:e[t], -enumerable:!0})},_i=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ca(e))!Ta. -call(r,i)&&i!==t&&Qe(r,i,{get:()=>e[i],enumerable:!(n=_a(e,i))||n.enumerable});return r};var Me=(r,e,t)=>(t=r!=null?Aa(Ia(r)):{},_i(e||!r||!r.__esModule?Qe(t,"default",{value:r,enumerable:!0}): -t,r)),G=r=>_i(Qe({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Pa(r,typeof e!="symbol"?e+"":e,t);var Ti=R(Ft=>{"use strict";p();Ft.byteLength=Ba;Ft.toByteArray=ka;Ft.fromByteArray=Ua;var be=[],fe=[], -Ra=typeof Uint8Array<"u"?Uint8Array:Array,yr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ -23456789+/";for(Ue=0,Ci=yr.length;Ue0)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(Ii,"getLens"); -function Ba(r){var e=Ii(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Ba,"byteLength");function La(r,e,t){return(e+ -t)*3/4-t}a(La,"_byteLength");function ka(r){var e,t=Ii(r),n=t[0],i=t[1],s=new Ra(La(r,n,i)),o=0,u=i> +var _a=Object.create;var We=Object.defineProperty;var Ca=Object.getOwnPropertyDescriptor;var Ia=Object.getOwnPropertyNames;var Ta=Object.getPrototypeOf,Pa=Object.prototype.hasOwnProperty;var Ra=(r,e,t)=>e in r?We(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>We(r,"name",{value:e,configurable:!0});var re=(r,e)=>()=>(r&&(e=r(r=0)),e);var R=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ge=(r,e)=>{for(var t in e)We(r,t,{get:e[t], +enumerable:!0})},Ci=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ia(e))!Pa. +call(r,i)&&i!==t&&We(r,i,{get:()=>e[i],enumerable:!(n=Ca(e,i))||n.enumerable});return r};var De=(r,e,t)=>(t=r!=null?_a(Ta(r)):{},Ci(e||!r||!r.__esModule?We(t,"default",{value:r,enumerable:!0}): +t,r)),$=r=>Ci(We({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Ra(r,typeof e!="symbol"?e+"":e,t);var Pi=R(Ft=>{"use strict";p();Ft.byteLength=La;Ft.toByteArray=Fa;Ft.fromByteArray=Da;var be=[],fe=[], +Ba=typeof Uint8Array<"u"?Uint8Array:Array,mr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ +23456789+/";for(Oe=0,Ii=mr.length;Oe0)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(Ti,"getLens"); +function La(r){var e=Ti(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(La,"byteLength");function ka(r,e,t){return(e+ +t)*3/4-t}a(ka,"_byteLength");function Fa(r){var e,t=Ti(r),n=t[0],i=t[1],s=new Ba(ka(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=fe[r.charCodeAt( c)]<<2|fe[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=fe[r.charCodeAt(c)]<<10|fe[r.charCodeAt(c+1)]<< -4|fe[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(ka,"toByteArray");function Fa(r){return be[r>> -18&63]+be[r>>12&63]+be[r>>6&63]+be[r&63]}a(Fa,"tripletToBase64");function Ma(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(Fa(n));return i.join("")}a(Ma,"en\ -codeChunk");function Ua(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(Fa,"toByteArray");function Ma(r){return be[r>> +18&63]+be[r>>12&63]+be[r>>6&63]+be[r&63]}a(Ma,"tripletToBase64");function Ua(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(Ma(n));return i.join("")}a(Ua,"en\ +codeChunk");function Da(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(be[e>>2]+be[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1], -i.push(be[e>>10]+be[e>>4&63]+be[e<<2&63]+"=")),i.join("")}a(Ua,"fromByteArray")});var Pi=R(mr=>{p();mr.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(be[e>>10]+be[e>>4&63]+be[e<<2&63]+"=")),i.join("")}a(Da,"fromByteArray")});var Ri=R(wr=>{p();wr.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,E=r[e+y];for(y+=g,s=E&(1<<-f)-1,E>>=-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:(E?-1:1)*(1/0);o=o+Math. -pow(2,n),s=s-l}return(E?-1:1)*o*Math.pow(2,s-n)};mr.write=function(r,e,t,n,i,s){var o,u,c,l=s*8-i-1, +pow(2,n),s=s-l}return(E?-1:1)*o*Math.pow(2,s-n)};wr.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,E=n?0:s-1,C=n?1:-1,W=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+E]=u&255,E+= -C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=W*128}});var Gi=R($e=>{"use strict";p();var wr=Ti(),We=Pi(),Ri=typeof Symbol=="function"&&typeof Symbol.for== -"function"?Symbol.for("nodejs.util.inspect.custom"):null;$e.Buffer=d;$e.SlowBuffer=ja;$e.INSPECT_MAX_BYTES= -50;var Mt=2147483647;$e.kMaxLength=Mt;d.TYPED_ARRAY_SUPPORT=Da();!d.TYPED_ARRAY_SUPPORT&&typeof console< +C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=W*128}});var Vi=R(Ve=>{"use strict";p();var gr=Pi(),$e=Ri(),Bi=typeof Symbol=="function"&&typeof Symbol.for== +"function"?Symbol.for("nodejs.util.inspect.custom"):null;Ve.Buffer=d;Ve.SlowBuffer=Wa;Ve.INSPECT_MAX_BYTES= +50;var Mt=2147483647;Ve.kMaxLength=Mt;d.TYPED_ARRAY_SUPPORT=Oa();!d.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 Da(){ +pport which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Oa(){ 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(Da,"typedArraySupport");Object. +prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}a(Oa,"typedArraySupport");Object. defineProperty(d.prototype,"parent",{enumerable:!0,get:a(function(){if(d.isBuffer(this))return this. buffer},"get")});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:a(function(){if(d.isBuffer( this))return this.byteOffset},"get")});function Ee(r){if(r>Mt)throw new RangeError('The value "'+r+'\ " is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,d.prototype), e}a(Ee,"createBuffer");function d(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 Sr(r)}return Fi(r,e,t)} -a(d,"Buffer");d.poolSize=8192;function Fi(r,e,t){if(typeof r=="string")return Na(r,e);if(ArrayBuffer. -isView(r))return qa(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 vr(r)}return Mi(r,e,t)} +a(d,"Buffer");d.poolSize=8192;function Mi(r,e,t){if(typeof r=="string")return qa(r,e);if(ArrayBuffer. +isView(r))return Qa(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(xe(r,ArrayBuffer)|| r&&xe(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(xe(r,SharedArrayBuffer)||r&&xe(r.buffer, -SharedArrayBuffer)))return br(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument\ +SharedArrayBuffer)))return xr(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 d. -from(n,e,t);let i=Qa(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. +from(n,e,t);let i=ja(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. toPrimitive]=="function")return d.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(Fi,"from");d.from=function(r,e,t){return Fi(r,e,t)};Object.setPrototypeOf(d.prototype, -Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Mi(r){if(typeof r!="number")throw new TypeError( +ed type "+typeof r)}a(Mi,"from");d.from=function(r,e,t){return Mi(r,e,t)};Object.setPrototypeOf(d.prototype, +Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Ui(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(Mi,"assertSize");function Oa(r,e,t){return Mi(r),r<=0?Ee(r):e!==void 0?typeof t== -"string"?Ee(r).fill(e,t):Ee(r).fill(e):Ee(r)}a(Oa,"alloc");d.alloc=function(r,e,t){return Oa(r,e,t)}; -function Sr(r){return Mi(r),Ee(r<0?0:vr(r)|0)}a(Sr,"allocUnsafe");d.allocUnsafe=function(r){return Sr( -r)};d.allocUnsafeSlow=function(r){return Sr(r)};function Na(r,e){if((typeof e!="string"||e==="")&&(e= -"utf8"),!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=Ui(r,e)|0,n=Ee(t),i=n.write( -r,e);return i!==t&&(n=n.slice(0,i)),n}a(Na,"fromString");function gr(r){let e=r.length<0?0:vr(r.length)| -0,t=Ee(e);for(let n=0;n=Mt)throw new RangeError("Attempt to allocate Buffer larger t\ -han maximum size: 0x"+Mt.toString(16)+" bytes");return r|0}a(vr,"checked");function ja(r){return+r!= -r&&(r=0),d.alloc(+r)}a(ja,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== +r,e,t),Object.setPrototypeOf(n,d.prototype),n}a(xr,"fromArrayBuffer");function ja(r){if(d.isBuffer(r)){ +let e=Er(r.length)|0,t=Ee(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r. +length!="number"||_r(r.length)?Ee(0):br(r);if(r.type==="Buffer"&&Array.isArray(r.data))return br(r.data)} +a(ja,"fromObject");function Er(r){if(r>=Mt)throw new RangeError("Attempt to allocate Buffer larger t\ +han maximum size: 0x"+Mt.toString(16)+" bytes");return r|0}a(Er,"checked");function Wa(r){return+r!= +r&&(r=0),d.alloc(+r)}a(Wa,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== d.prototype},"isBuffer");d.compare=a(function(e,t){if(xe(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)), xe(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.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, @@ -78,121 +78,121 @@ utf-16le":return!0;default:return!1}},"isEncoding");d.concat=a(function(e,t){if( for(t=0,n=0;ni.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(i,s)):Uint8Array.prototype. set.call(i,o,s);else if(d.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 Ui(r,e){if(d.isBuffer(r))return r.length; +an Array of Buffers');s+=o.length}return i},"concat");function Di(r,e){if(d.isBuffer(r))return r.length; if(ArrayBuffer.isView(r)||xe(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 xr(r).length;case"ucs2":case"\ -ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return $i(r).length;default: -if(i)return n?-1:xr(r).length;e=(""+e).toLowerCase(),i=!0}}a(Ui,"byteLength");d.byteLength=Ui;function Wa(r,e,t){ +ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Sr(r).length;case"ucs2":case"\ +ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Gi(r).length;default: +if(i)return n?-1:Sr(r).length;e=(""+e).toLowerCase(),i=!0}}a(Di,"byteLength");d.byteLength=Di;function Ha(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 Xa(this,e,t);case"u\ -tf8":case"utf-8":return Oi(this,e,t);case"ascii":return Ja(this,e,t);case"latin1":case"binary":return Za( -this,e,t);case"base64":return za(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return eu( -this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(Wa, -"slowToString");d.prototype._isBuffer=!0;function De(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(De,"swap"); +0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return eu(this,e,t);case"u\ +tf8":case"utf-8":return Ni(this,e,t);case"ascii":return Za(this,e,t);case"latin1":case"binary":return Xa( +this,e,t);case"base64":return Ya(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tu( +this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(Ha, +"slowToString");d.prototype._isBuffer=!0;function Ne(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(Ne,"swap"); d.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");Ri&&(d.prototype[Ri]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ +er "+e+">"},"inspect");Bi&&(d.prototype[Bi]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ if(xe(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.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,Ar(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r. +compare");function Oi(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,_r(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=d.from( -e,n)),d.isBuffer(e))return e.length===0?-1:Bi(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array. +e,n)),d.isBuffer(e))return e.length===0?-1:Li(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):Bi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Di,"bidire\ -ctionalIndexOf");function Bi(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):Li(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Oi,"bidire\ +ctionalIndexOf");function Li(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 Ha(this,e,t,n);case"utf8":case"\ -utf-8":return $a(this,e,t,n);case"ascii":case"latin1":case"binary":return Ga(this,e,t,n);case"base64": -return Va(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ka(this,e,t,n);default: +fer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return $a(this,e,t,n);case"utf8":case"\ +utf-8":return Ga(this,e,t,n);case"ascii":case"latin1":case"binary":return Va(this,e,t,n);case"base64": +return Ka(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return za(this,e,t,n);default: if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"write");d.prototype. toJSON=a(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSO\ -N");function za(r,e,t){return e===0&&t===r.length?wr.fromByteArray(r):wr.fromByteArray(r.slice(e,t))} -a(za,"base64Slice");function Oi(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 Ya(n)}a(Oi,"utf8Slice");var Li=4096;function Ya(r){let e=r.length;if(e<=Li)return String. +n.push(o),i+=u}return Ja(n)}a(Ni,"utf8Slice");var ki=4096;function Ja(r){let e=r.length;if(e<=ki)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,d.prototype),i},"slice");function V(r,e,t){ +e&&(t=e);let i=this.subarray(e,t);return Object.setPrototypeOf(i,d.prototype),i},"slice");function G(r,e,t){ if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to \ -access beyond buffer length")}a(V,"checkOffset");d.prototype.readUintLE=d.prototype.readUIntLE=a(function(e,t,n){ -e=e>>>0,t=t>>>0,n||V(e,t,this.length);let i=this[e],s=1,o=0;for(;++o>>0,t=t>>>0,n||V(e, +access beyond buffer length")}a(G,"checkOffset");d.prototype.readUintLE=d.prototype.readUIntLE=a(function(e,t,n){ +e=e>>>0,t=t>>>0,n||G(e,t,this.length);let i=this[e],s=1,o=0;for(;++o>>0,t=t>>>0,n||G(e, t,this.length);let i=this[e+--t],s=1;for(;t>0&&(s*=256);)i+=this[e+--t]*s;return i},"readUIntBE");d. -prototype.readUint8=d.prototype.readUInt8=a(function(e,t){return e=e>>>0,t||V(e,1,this.length),this[e]}, -"readUInt8");d.prototype.readUint16LE=d.prototype.readUInt16LE=a(function(e,t){return e=e>>>0,t||V(e, +prototype.readUint8=d.prototype.readUInt8=a(function(e,t){return e=e>>>0,t||G(e,1,this.length),this[e]}, +"readUInt8");d.prototype.readUint16LE=d.prototype.readUInt16LE=a(function(e,t){return e=e>>>0,t||G(e, 2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");d.prototype.readUint16BE=d.prototype.readUInt16BE= -a(function(e,t){return e=e>>>0,t||V(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");d.prototype. -readUint32LE=d.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||V(e,4,this.length),(this[e]| +a(function(e,t){return e=e>>>0,t||G(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");d.prototype. +readUint32LE=d.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),(this[e]| this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");d.prototype.readUint32BE=d.prototype. -readUInt32BE=a(function(e,t){return e=e>>>0,t||V(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+ -2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Te(a(function(e){e=e>>>0,He(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&at(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* +readUInt32BE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+ +2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Pe(a(function(e){e=e>>>0,Ge(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ut(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* 2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<< -BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Te(a(function(e){e=e>>>0,He(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&at(e,this.length-8);let i=t*2**24+this[++e]*2**16+ +BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Pe(a(function(e){e=e>>>0,Ge(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ut(e,this.length-8);let i=t*2**24+this[++e]*2**16+ this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<>>0,t=t>>>0,n||V(e,t, +32))+BigInt(s)},"readBigUInt64BE"));d.prototype.readIntLE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||G(e,t, this.length);let i=this[e],s=1,o=0;for(;++o=s&&(i-=Math. -pow(2,8*t)),i},"readIntLE");d.prototype.readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||V(e,t,this.length); +pow(2,8*t)),i},"readIntLE");d.prototype.readIntBE=a(function(e,t,n){e=e>>>0,t=t>>>0,n||G(e,t,this.length); let i=t,s=1,o=this[e+--i];for(;i>0&&(s*=256);)o+=this[e+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8* -t)),o},"readIntBE");d.prototype.readInt8=a(function(e,t){return e=e>>>0,t||V(e,1,this.length),this[e]& -128?(255-this[e]+1)*-1:this[e]},"readInt8");d.prototype.readInt16LE=a(function(e,t){e=e>>>0,t||V(e,2, +t)),o},"readIntBE");d.prototype.readInt8=a(function(e,t){return e=e>>>0,t||G(e,1,this.length),this[e]& +128?(255-this[e]+1)*-1:this[e]},"readInt8");d.prototype.readInt16LE=a(function(e,t){e=e>>>0,t||G(e,2, this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");d.prototype.readInt16BE= -a(function(e,t){e=e>>>0,t||V(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760: -n},"readInt16BE");d.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||V(e,4,this.length),this[e]| +a(function(e,t){e=e>>>0,t||G(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760: +n},"readInt16BE");d.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]| this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");d.prototype.readInt32BE=a(function(e,t){return e= -e>>>0,t||V(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");d.prototype. -readBigInt64LE=Te(a(function(e){e=e>>>0,He(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& -at(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,t||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");d.prototype. +readBigInt64LE=Pe(a(function(e){e=e>>>0,Ge(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& +ut(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,He(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&at(e,this. +Pe(a(function(e){e=e>>>0,Ge(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ut(e,this. length-8);let i=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,t||V(e,4,this.length),We.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= -a(function(e,t){return e=e>>>0,t||V(e,4,this.length),We.read(this,e,!1,23,4)},"readFloatBE");d.prototype. -readDoubleLE=a(function(e,t){return e=e>>>0,t||V(e,8,this.length),We.read(this,e,!0,52,8)},"readDoub\ -leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||V(e,8,this.length),We.read(this,e, +return e=e>>>0,t||G(e,4,this.length),$e.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= +a(function(e,t){return e=e>>>0,t||G(e,4,this.length),$e.read(this,e,!1,23,4)},"readFloatBE");d.prototype. +readDoubleLE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),$e.read(this,e,!0,52,8)},"readDoub\ +leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),$e.read(this,e, !1,52,8)},"readDoubleBE");function ne(r,e,t,n,i,s){if(!d.isBuffer(r))throw new TypeError('"buffer" a\ rgument must be a Buffer instance');if(e>i||er.length)throw new RangeError("Index out of range")}a(ne,"checkInt");d.prototype.writeUintLE= @@ -208,14 +208,14 @@ e>>>8,t+2},"writeUInt16LE");d.prototype.writeUint16BE=d.prototype.writeUInt16BE= writeUint32LE=d.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(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");d.prototype. writeUint32BE=d.prototype.writeUInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(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 Ni(r,e,t,n,i){ -Hi(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 qi(r,e,t,n,i){ +$i(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(Ni,"wrtBigUInt64LE");function qi(r,e,t,n,i){Hi(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295)); +8,r[t++]=o,t}a(qi,"wrtBigUInt64LE");function Qi(r,e,t,n,i){$i(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(qi,"wrtBigUInt64BE");d.prototype. -writeBigUInt64LE=Te(a(function(e,t=0){return Ni(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ -riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Te(a(function(e,t=0){return qi(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(Qi,"wrtBigUInt64BE");d.prototype. +writeBigUInt64LE=Pe(a(function(e,t=0){return qi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ +riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Pe(a(function(e,t=0){return Qi(this,e,t,BigInt(0),BigInt( "0xffffffffffffffff"))},"writeBigUInt64BE"));d.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>> 0,!i){let c=Math.pow(2,8*n-1);ne(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");d.prototype.writeIntBE= @@ -229,17 +229,17 @@ e>>>8,this[t+1]=e&255,t+2},"writeInt16BE");d.prototype.writeInt32LE=a(function(e t>>>0,n||ne(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+ 3]=e>>>24,t+4},"writeInt32LE");d.prototype.writeInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne( 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");d.prototype.writeBigInt64LE=Te(a(function(e,t=0){return Ni( +e>>>8,this[t+3]=e&255,t+4},"writeInt32BE");d.prototype.writeBigInt64LE=Pe(a(function(e,t=0){return qi( this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));d.prototype. -writeBigInt64BE=Te(a(function(e,t=0){return qi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ -ffffffffffff"))},"writeBigInt64BE"));function Qi(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(Qi,"checkIEEE754");function ji(r,e,t,n,i){ -return e=+e,t=t>>>0,i||Qi(r,e,t,4,34028234663852886e22,-34028234663852886e22),We.write(r,e,t,n,23,4), -t+4}a(ji,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return ji(this,e,t,!0,n)},"writeFl\ -oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return ji(this,e,t,!1,n)},"writeFloatBE");function Wi(r,e,t,n,i){ -return e=+e,t=t>>>0,i||Qi(r,e,t,8,17976931348623157e292,-17976931348623157e292),We.write(r,e,t,n,52, -8),t+8}a(Wi,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return Wi(this,e,t,!0,n)},"wr\ -iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return Wi(this,e,t,!1,n)},"writeDoubleBE"); +writeBigInt64BE=Pe(a(function(e,t=0){return Qi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ +ffffffffffff"))},"writeBigInt64BE"));function ji(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(ji,"checkIEEE754");function Wi(r,e,t,n,i){ +return e=+e,t=t>>>0,i||ji(r,e,t,4,34028234663852886e22,-34028234663852886e22),$e.write(r,e,t,n,23,4), +t+4}a(Wi,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return Wi(this,e,t,!0,n)},"writeFl\ +oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return Wi(this,e,t,!1,n)},"writeFloatBE");function Hi(r,e,t,n,i){ +return e=+e,t=t>>>0,i||ji(r,e,t,8,17976931348623157e292,-17976931348623157e292),$e.write(r,e,t,n,52, +8),t+8}a(Hi,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return Hi(this,e,t,!0,n)},"wr\ +iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return Hi(this,e,t,!1,n)},"writeDoubleBE"); d.prototype.copy=a(function(e,t,n,i){if(!d.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=ki(String(t)):typeof t=="bigint"&&(i=String( -t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=ki(i)),i+="n"),n+=` It must be ${e}. Re\ -ceived ${i}`,n},RangeError);function ki(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(ki,"addNumericalSeparator");function tu(r,e,t){ -He(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&at(e,r.length-(t+1))}a(tu,"checkBounds");function Hi(r,e,t,n,i,s){ +e ${typeof e}`},TypeError);Ar("ERR_OUT_OF_RANGE",function(r,e,t){let n=`The value of "${r}" is out o\ +f range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=Fi(String(t)):typeof t=="bigint"&&(i=String( +t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Fi(i)),i+="n"),n+=` It must be ${e}. Re\ +ceived ${i}`,n},RangeError);function Fi(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(Fi,"addNumericalSeparator");function ru(r,e,t){ +Ge(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&ut(e,r.length-(t+1))}a(ru,"checkBounds");function $i(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 je.ERR_OUT_OF_RANGE("value",u,r)}tu(n,i,s)}a(Hi,"checkIntBI");function He(r,e){if(typeof r!= -"number")throw new je.ERR_INVALID_ARG_TYPE(e,"number",r)}a(He,"validateNumber");function at(r,e,t){throw Math. -floor(r)!==r?(He(r,t),new je.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new je.ERR_BUFFER_OUT_OF_BOUNDS: -new je.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(at,"boundsError");var ru=/[^+/0-9A-Za-z-_]/g; -function nu(r){if(r=r.split("=")[0],r=r.trim().replace(ru,""),r.length<2)return"";for(;r.length%4!== -0;)r=r+"=";return r}a(nu,"base64clean");function xr(r,e){e=e||1/0;let t,n=r.length,i=null,s=[];for(let o=0;o< +nd <= ${t}${o}`,new He.ERR_OUT_OF_RANGE("value",u,r)}ru(n,i,s)}a($i,"checkIntBI");function Ge(r,e){if(typeof r!= +"number")throw new He.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Ge,"validateNumber");function ut(r,e,t){throw Math. +floor(r)!==r?(Ge(r,t),new He.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new He.ERR_BUFFER_OUT_OF_BOUNDS: +new He.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(ut,"boundsError");var nu=/[^+/0-9A-Za-z-_]/g; +function iu(r){if(r=r.split("=")[0],r=r.trim().replace(nu,""),r.length<2)return"";for(;r.length%4!== +0;)r=r+"=";return r}a(iu,"base64clean");function Sr(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(xr,"utf\ -8ToBytes");function iu(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(su,"utf16leToBytes");function $i(r){return wr.toByteArray( -nu(r))}a($i,"base64ToBytes");function Ut(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) +240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}a(Sr,"utf\ +8ToBytes");function su(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(ou,"utf16leToBytes");function Gi(r){return gr.toByteArray( +iu(r))}a(Gi,"base64ToBytes");function Ut(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) e[i+t]=r[i];return i}a(Ut,"blitBuffer");function xe(r,e){return r instanceof e||r!=null&&r.constructor!= -null&&r.constructor.name!=null&&r.constructor.name===e.name}a(xe,"isInstance");function Ar(r){return r!== -r}a(Ar,"numberIsNaN");var ou=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 Te(r){return typeof BigInt>"u"? -au:r}a(Te,"defineBigIntMethod");function au(){throw new Error("BigInt not supported")}a(au,"BufferBi\ +null&&r.constructor.name!=null&&r.constructor.name===e.name}a(xe,"isInstance");function _r(r){return r!== +r}a(_r,"numberIsNaN");var au=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 Pe(r){return typeof BigInt>"u"? +uu:r}a(Pe,"defineBigIntMethod");function uu(){throw new Error("BigInt not supported")}a(uu,"BufferBi\ gIntNotDefined")});var S,v,A,m,w,p=re(()=>{"use strict";S=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),A= globalThis.clearImmediate??(r=>clearTimeout(r)),m=typeof globalThis.Buffer=="function"&&typeof globalThis. -Buffer.allocUnsafe=="function"?globalThis.Buffer:Gi().Buffer,w=globalThis.process??{};w.env??(w.env= -{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Pe=R((zf,_r)=>{"use strict";p();var Ge=typeof Reflect=="object"?Reflect:null,Vi=Ge&&typeof Ge.apply== -"function"?Ge.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Dt; -Ge&&typeof Ge.ownKeys=="function"?Dt=Ge.ownKeys:Object.getOwnPropertySymbols?Dt=a(function(e){return Object. +Buffer.allocUnsafe=="function"?globalThis.Buffer:Vi().Buffer,w=globalThis.process??{};w.env??(w.env= +{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Re=R((Yf,Cr)=>{"use strict";p();var Ke=typeof Reflect=="object"?Reflect:null,Ki=Ke&&typeof Ke.apply== +"function"?Ke.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Dt; +Ke&&typeof Ke.ownKeys=="function"?Dt=Ke.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 uu(r){console&&console.warn&&console.warn(r)}a(uu, -"ProcessEmitWarning");var zi=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function F(){F. -init.call(this)}a(F,"EventEmitter");_r.exports=F;_r.exports.once=hu;F.EventEmitter=F;F.prototype._events= -void 0;F.prototype._eventsCount=0;F.prototype._maxListeners=void 0;var Ki=10;function Ot(r){if(typeof r!= +getOwnPropertyNames(e)},"ReflectOwnKeys");function cu(r){console&&console.warn&&console.warn(r)}a(cu, +"ProcessEmitWarning");var Yi=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function M(){M. +init.call(this)}a(M,"EventEmitter");Cr.exports=M;Cr.exports.once=du;M.EventEmitter=M;M.prototype._events= +void 0;M.prototype._eventsCount=0;M.prototype._maxListeners=void 0;var zi=10;function Ot(r){if(typeof r!= "function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)} -a(Ot,"checkListener");Object.defineProperty(F,"defaultMaxListeners",{enumerable:!0,get:a(function(){ -return Ki},"get"),set:a(function(r){if(typeof r!="number"||r<0||zi(r))throw new RangeError('The valu\ -e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Ki=r}, -"set")});F.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&& +a(Ot,"checkListener");Object.defineProperty(M,"defaultMaxListeners",{enumerable:!0,get:a(function(){ +return zi},"get"),set:a(function(r){if(typeof r!="number"||r<0||Yi(r))throw new RangeError('The valu\ +e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");zi=r}, +"set")});M.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}; -F.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||zi(e))throw new RangeError('Th\ +M.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||Yi(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 Yi(r){return r._maxListeners===void 0?F.defaultMaxListeners:r._maxListeners} -a(Yi,"_getMaxListeners");F.prototype.getMaxListeners=a(function(){return Yi(this)},"getMaxListeners"); -F.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")Vi(c,this,t);else for(var l=c. -length,f=ts(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=Ji(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,uu(u)}return r}a(Ji,"_addListener");F.prototype.addListener=a(function(e,t){ -return Ji(this,e,t,!1)},"addListener");F.prototype.on=F.prototype.addListener;F.prototype.prependListener= -a(function(e,t){return Ji(this,e,t,!0)},"prependListener");function cu(){if(!this.fired)return this. +r,u.type=e,u.count=o.length,cu(u)}return r}a(Zi,"_addListener");M.prototype.addListener=a(function(e,t){ +return Zi(this,e,t,!1)},"addListener");M.prototype.on=M.prototype.addListener;M.prototype.prependListener= +a(function(e,t){return Zi(this,e,t,!0)},"prependListener");function lu(){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(cu,"onceWrapper");function Zi(r,e,t){var n={fired:!1, -wrapFn:void 0,target:r,type:e,listener:t},i=cu.bind(n);return i.listener=t,n.wrapFn=i,i}a(Zi,"_onceW\ -rap");F.prototype.once=a(function(e,t){return Ot(t),this.on(e,Zi(this,e,t)),this},"once");F.prototype. -prependOnceListener=a(function(e,t){return Ot(t),this.prependListener(e,Zi(this,e,t)),this},"prepend\ -OnceListener");F.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(Ot(t),i=this._events,i=== +target):this.listener.apply(this.target,arguments)}a(lu,"onceWrapper");function Xi(r,e,t){var n={fired:!1, +wrapFn:void 0,target:r,type:e,listener:t},i=lu.bind(n);return i.listener=t,n.wrapFn=i,i}a(Xi,"_onceW\ +rap");M.prototype.once=a(function(e,t){return Ot(t),this.on(e,Xi(this,e,t)),this},"once");M.prototype. +prependOnceListener=a(function(e,t){return Ot(t),this.prependListener(e,Xi(this,e,t)),this},"prepend\ +OnceListener");M.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(Ot(t),i=this._events,i=== void 0)return this;if(n=i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0? this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("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():lu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== -void 0&&this.emit("removeListener",e,u||t)}return this},"removeListener");F.prototype.off=F.prototype. -removeListener;F.prototype.removeAllListeners=a(function(e){var t,n,i;if(n=this._events,n===void 0)return this; +listener,s=o;break}if(s<0)return this;s===0?n.shift():fu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== +void 0&&this.emit("removeListener",e,u||t)}return this},"removeListener");M.prototype.off=M.prototype. +removeListener;M.prototype.removeAllListeners=a(function(e){var t,n,i;if(n=this._events,n===void 0)return this; if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount= 0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments. length===0){var s=Object.keys(n),o;for(i=0;i= -0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function Xi(r,e,t){var n=r._events; +0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function es(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? -fu(i):ts(i,i.length)}a(Xi,"_listeners");F.prototype.listeners=a(function(e){return Xi(this,e,!0)},"l\ -isteners");F.prototype.rawListeners=a(function(e){return Xi(this,e,!1)},"rawListeners");F.listenerCount= -function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):es.call(r,e)};F.prototype. -listenerCount=es;function es(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(es,"listenerCount");F.prototype.eventNames=a(function(){ -return this._eventsCount>0?Dt(this._events):[]},"eventNames");function ts(r,e){for(var t=new Array(e), -n=0;n0?Dt(this._events):[]},"eventNames");function rs(r,e){for(var t=new Array(e), +n=0;nSe,isIP:()=>pu});function pu(r){return 0}var is,ns,_,Se,Ve=re(()=>{"use \ -strict";p();is=Me(Pe(),1);a(pu,"isIP");ns=/^[^.]+\./,_=class _ extends is.EventEmitter{constructor(){ +ust be of type EventEmitter. Received type '+typeof r)}a(ns,"eventTargetAgnosticAddListener")});var os={};ge(os,{Socket:()=>Se,isIP:()=>yu});function yu(r){return 0}var ss,is,_,Se,ze=re(()=>{"use \ +strict";p();ss=De(Re(),1);a(yu,"isIP");is=/^[^.]+\./,_=class _ extends ss.EventEmitter{constructor(){ super(...arguments);I(this,"opts",{});I(this,"connecting",!1);I(this,"pending",!0);I(this,"writable", !0);I(this,"encrypted",!1);I(this,"authorized",!1);I(this,"destroyed",!1);I(this,"ws",null);I(this,"\ writeBuffer");I(this,"tlsState",0);I(this,"tlsRead");I(this,"tlsWrite")}static get poolQueryViaFetch(){ @@ -424,16 +424,16 @@ 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=m.alloc(0),n="utf8",i=()=>{}){return this.write(t,n,()=>{this. ws.close(),i()}),this}destroy(){return this.destroyed=!0,this.end()}};a(_,"Socket"),I(_,"defaults",{ -poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{let s;return i?.jwtAuth?s=t.replace(ns,"apiauth."):s= -t.replace(ns,"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(is,"apiauth."):s= +t.replace(is,"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}),I(_,"opts",{});Se=_});var os={};ge(os,{parse:()=>Cr});function Cr(r,e=!1){let{protocol:t}=new URL(r),n="http:"+r.substring( +disableWarningInBrowsers:!1}),I(_,"opts",{});Se=_});var as={};ge(as,{parse:()=>Ir});function Ir(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 E=i+":"+s,C=e?Object. fromEntries(y.entries()):f;return{href:r,protocol:t,auth:E,username:i,password:s,host:o,hostname:u,port:c, -pathname:l,search:f,query:C,hash:g}}var Ir=re(()=>{"use strict";p();a(Cr,"parse")});var Wr=R(_s=>{"use strict";p();_s.parse=function(r,e){return new jr(r,e).parse()};var Kt=class Kt{constructor(e,t){ -this.source=e,this.transform=t||qu,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){ +pathname:l,search:f,query:C,hash:g}}var Tr=re(()=>{"use strict";p();a(Ir,"parse")});var Hr=R(Cs=>{"use strict";p();Cs.parse=function(r,e){return new Wr(r,e).parse()};var Kt=class Kt{constructor(e,t){ +this.source=e,this.transform=t||Qu,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), @@ -444,109 +444,109 @@ dimension>1&&(n=new Kt(this.source.substr(this.position-1),this.transform),this. !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(Kt,"ArrayParser");var jr=Kt;function qu(r){return r}a(qu,"ide\ -ntity")});var Hr=R((xh,Cs)=>{p();var Qu=Wr();Cs.exports={create:a(function(r,e){return{parse:a(function(){return Qu. -parse(r,e)},"parse")}},"create")}});var Ps=R((Eh,Ts)=>{"use strict";p();var ju=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, -Wu=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Hu=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,$u=/^-?infinity$/;Ts. -exports=a(function(e){if($u.test(e))return Number(e.replace("i","I"));var t=ju.exec(e);if(!t)return Gu( -e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Is(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=Vu(e);return g!=null? -(y=new Date(Date.UTC(i,s,o,u,c,l,f)),$r(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= -new Date(i,s,o,u,c,l,f),$r(i)&&y.setFullYear(i)),y},"parseDate");function Gu(r){var e=Wu.exec(r);if(e){ -var t=parseInt(e[1],10),n=!!e[4];n&&(t=Is(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return $r( -t)&&o.setFullYear(t),o}}a(Gu,"getDate");function Vu(r){if(r.endsWith("+00"))return 0;var e=Hu.exec(r. +not balanced");return this.entries}};a(Kt,"ArrayParser");var Wr=Kt;function Qu(r){return r}a(Qu,"ide\ +ntity")});var $r=R((Sh,Is)=>{p();var ju=Hr();Is.exports={create:a(function(r,e){return{parse:a(function(){return ju. +parse(r,e)},"parse")}},"create")}});var Rs=R((Ah,Ps)=>{"use strict";p();var Wu=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, +Hu=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,$u=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Gu=/^-?infinity$/;Ps. +exports=a(function(e){if(Gu.test(e))return Number(e.replace("i","I"));var t=Wu.exec(e);if(!t)return Vu( +e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Ts(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=Ku(e);return g!=null? +(y=new Date(Date.UTC(i,s,o,u,c,l,f)),Gr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= +new Date(i,s,o,u,c,l,f),Gr(i)&&y.setFullYear(i)),y},"parseDate");function Vu(r){var e=Hu.exec(r);if(e){ +var t=parseInt(e[1],10),n=!!e[4];n&&(t=Ts(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return Gr( +t)&&o.setFullYear(t),o}}a(Vu,"getDate");function Ku(r){if(r.endsWith("+00"))return 0;var e=$u.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(Vu,"timeZoneOffset");function Is(r){return-(r- -1)}a(Is,"bcYearToNegativeYear");function $r(r){return r>=0&&r<100}a($r,"is0To99")});var Bs=R((Ch,Rs)=>{p();Rs.exports=zu;var Ku=Object.prototype.hasOwnProperty;function zu(r){for(var e=1;e< -arguments.length;e++){var t=arguments[e];for(var n in t)Ku.call(t,n)&&(r[n]=t[n])}return r}a(zu,"ext\ -end")});var Fs=R((Ph,ks)=>{"use strict";p();var Yu=Bs();ks.exports=Ze;function Ze(r){if(!(this instanceof Ze)) -return new Ze(r);Yu(this,uc(r))}a(Ze,"PostgresInterval");var Ju=["seconds","minutes","hours","days", -"months","years"];Ze.prototype.toPostgres=function(){var r=Ju.filter(this.hasOwnProperty,this);return this. +e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(Ku,"timeZoneOffset");function Ts(r){return-(r- +1)}a(Ts,"bcYearToNegativeYear");function Gr(r){return r>=0&&r<100}a(Gr,"is0To99")});var Ls=R((Ih,Bs)=>{p();Bs.exports=Yu;var zu=Object.prototype.hasOwnProperty;function Yu(r){for(var e=1;e< +arguments.length;e++){var t=arguments[e];for(var n in t)zu.call(t,n)&&(r[n]=t[n])}return r}a(Yu,"ext\ +end")});var Ms=R((Rh,Fs)=>{"use strict";p();var Ju=Ls();Fs.exports=et;function et(r){if(!(this instanceof et)) +return new et(r);Ju(this,cc(r))}a(et,"PostgresInterval");var Zu=["seconds","minutes","hours","days", +"months","years"];et.prototype.toPostgres=function(){var r=Zu.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 Zu={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ -S"},Xu=["years","months","days"],ec=["hours","minutes","seconds"];Ze.prototype.toISOString=Ze.prototype. -toISO=function(){var r=Xu.map(t,this).join(""),e=ec.map(t,this).join("");return"P"+r+"T"+e;function t(n){ +"")),t+" "+e},this).join(" ")};var Xu={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ +S"},ec=["years","months","days"],tc=["hours","minutes","seconds"];et.prototype.toISOString=et.prototype. +toISO=function(){var r=ec.map(t,this).join(""),e=tc.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+Zu[n]}};var Gr="([+-]?\\d+)",tc=Gr+"\\s+years?",rc=Gr+"\\s+mons?",nc=Gr+"\\s+days?",ic="\ -([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",sc=new RegExp([tc,rc,nc,ic].map(function(r){return"\ -("+r+")?"}).join("\\s*")),Ls={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, -oc=["hours","minutes","seconds","milliseconds"];function ac(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}a(ac,"parseMilliseconds");function uc(r){if(!r)return{};var e=sc.exec(r),t=e[8]==="-";return Object. -keys(Ls).reduce(function(n,i){var s=Ls[i],o=e[s];return!o||(o=i==="milliseconds"?ac(o):parseInt(o,10), -!o)||(t&&~oc.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(uc,"parse")});var Us=R((Lh,Ms)=>{"use strict";p();Ms.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( +/0+$/,"")),i+Xu[n]}};var Vr="([+-]?\\d+)",rc=Vr+"\\s+years?",nc=Vr+"\\s+mons?",ic=Vr+"\\s+days?",sc="\ +([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",oc=new RegExp([rc,nc,ic,sc].map(function(r){return"\ +("+r+")?"}).join("\\s*")),ks={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, +ac=["hours","minutes","seconds","milliseconds"];function uc(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(uc,"parseMilliseconds");function cc(r){if(!r)return{};var e=oc.exec(r),t=e[8]==="-";return Object. +keys(ks).reduce(function(n,i){var s=ks[i],o=e[s];return!o||(o=i==="milliseconds"?uc(o):parseInt(o,10), +!o)||(t&&~ac.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(cc,"parse")});var Ds=R((kh,Us)=>{"use strict";p();Us.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( 2),"hex");for(var t="",n=0;n{p();var mt=Wr(),wt=Hr(),zt=Ps(),Os=Fs(),Ns=Us();function Yt(r){return a(function(t){ -return t===null?t:r(t)},"nullAllowed")}a(Yt,"allowNull");function qs(r){return r===null?r:r==="TRUE"|| -r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(qs,"parseBool");function cc(r){return r? -mt.parse(r,qs):null}a(cc,"parseBoolArray");function lc(r){return parseInt(r,10)}a(lc,"parseBaseTenIn\ -t");function Vr(r){return r?mt.parse(r,Yt(lc)):null}a(Vr,"parseIntegerArray");function fc(r){return r? -mt.parse(r,Yt(function(e){return Qs(e).trim()})):null}a(fc,"parseBigIntegerArray");var hc=a(function(r){ -if(!r)return null;var e=wt.create(r,function(t){return t!==null&&(t=Jr(t)),t});return e.parse()},"pa\ -rsePointArray"),Kr=a(function(r){if(!r)return null;var e=wt.create(r,function(t){return t!==null&&(t= -parseFloat(t)),t});return e.parse()},"parseFloatArray"),pe=a(function(r){if(!r)return null;var e=wt. -create(r);return e.parse()},"parseStringArray"),zr=a(function(r){if(!r)return null;var e=wt.create(r, -function(t){return t!==null&&(t=zt(t)),t});return e.parse()},"parseDateArray"),dc=a(function(r){if(!r) -return null;var e=wt.create(r,function(t){return t!==null&&(t=Os(t)),t});return e.parse()},"parseInt\ -ervalArray"),pc=a(function(r){return r?mt.parse(r,Yt(Ns)):null},"parseByteAArray"),Yr=a(function(r){ -return parseInt(r,10)},"parseInteger"),Qs=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ -parseBigInteger"),Ds=a(function(r){return r?mt.parse(r,Yt(JSON.parse)):null},"parseJsonArray"),Jr=a( +parseBytea")});var Hs=R((Uh,Ws)=>{p();var wt=Hr(),gt=$r(),zt=Rs(),Ns=Ms(),qs=Ds();function Yt(r){return a(function(t){ +return t===null?t:r(t)},"nullAllowed")}a(Yt,"allowNull");function Qs(r){return r===null?r:r==="TRUE"|| +r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(Qs,"parseBool");function lc(r){return r? +wt.parse(r,Qs):null}a(lc,"parseBoolArray");function fc(r){return parseInt(r,10)}a(fc,"parseBaseTenIn\ +t");function Kr(r){return r?wt.parse(r,Yt(fc)):null}a(Kr,"parseIntegerArray");function hc(r){return r? +wt.parse(r,Yt(function(e){return js(e).trim()})):null}a(hc,"parseBigIntegerArray");var dc=a(function(r){ +if(!r)return null;var e=gt.create(r,function(t){return t!==null&&(t=Zr(t)),t});return e.parse()},"pa\ +rsePointArray"),zr=a(function(r){if(!r)return null;var e=gt.create(r,function(t){return t!==null&&(t= +parseFloat(t)),t});return e.parse()},"parseFloatArray"),pe=a(function(r){if(!r)return null;var e=gt. +create(r);return e.parse()},"parseStringArray"),Yr=a(function(r){if(!r)return null;var e=gt.create(r, +function(t){return t!==null&&(t=zt(t)),t});return e.parse()},"parseDateArray"),pc=a(function(r){if(!r) +return null;var e=gt.create(r,function(t){return t!==null&&(t=Ns(t)),t});return e.parse()},"parseInt\ +ervalArray"),yc=a(function(r){return r?wt.parse(r,Yt(qs)):null},"parseByteAArray"),Jr=a(function(r){ +return parseInt(r,10)},"parseInteger"),js=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ +parseBigInteger"),Os=a(function(r){return r?wt.parse(r,Yt(JSON.parse)):null},"parseJsonArray"),Zr=a( function(r){return r[0]!=="("?null:(r=r.substring(1,r.length-1).split(","),{x:parseFloat(r[0]),y:parseFloat( -r[1])})},"parsePoint"),yc=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, +r[1])})},"parsePoint"),mc=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, i=2;i{"use strict";p();var se=1e6;function wc(r){var e=r.readInt32BE(0),t=r.readUInt32BE( +r[i])}var s=Zr(e);return s.radius=parseFloat(t),s},"parseCircle"),wc=a(function(r){r(20,js),r(21,Jr), +r(23,Jr),r(26,Jr),r(700,parseFloat),r(701,parseFloat),r(16,Qs),r(1082,zt),r(1114,zt),r(1184,zt),r(600, +Zr),r(651,pe),r(718,mc),r(1e3,lc),r(1001,yc),r(1005,Kr),r(1007,Kr),r(1028,Kr),r(1016,hc),r(1017,dc), +r(1021,zr),r(1022,zr),r(1231,zr),r(1014,pe),r(1015,pe),r(1008,pe),r(1009,pe),r(1040,pe),r(1041,pe),r( +1115,Yr),r(1182,Yr),r(1185,Yr),r(1186,Ns),r(1187,pc),r(17,qs),r(114,JSON.parse.bind(JSON)),r(3802,JSON. +parse.bind(JSON)),r(199,Os),r(3807,Os),r(3907,pe),r(2951,pe),r(791,pe),r(1183,pe),r(1270,pe)},"init"); +Ws.exports={init:wc}});var Gs=R((Nh,$s)=>{"use strict";p();var se=1e6;function gc(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%se,e=e/se>>>0,o=4294967296* s+t,t=o/se>>>0,u=""+(o-se*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/se>>>0,u=""+(o-se*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/se>>>0,u=""+(o- se*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var gc=$s(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,W){return E* +s+t,u=""+o%se,n+u+i}a(gc,"readInt8");$s.exports=gc});var Js=R((jh,Ys)=>{p();var bc=Gs(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,W){return E* Math.pow(2,W)+C};var s=t>>3,o=a(function(E){return n?~E&255:E},"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"),Ks=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"),zs=a(function(r,e,t){var n=Math. pow(2,t-1)-1,i=U(r,1),s=U(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=U(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"),bc=a(function(r){ -return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),Gs=a(function(r){return U(r,1)==1?-1*(U( -r,31,1,!0)+1):U(r,31,1)},"parseInt32"),xc=a(function(r){return Ks(r,23,8)},"parseFloat32"),Sc=a(function(r){ -return Ks(r,52,11)},"parseFloat64"),vc=a(function(r){var e=U(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"),xc=a(function(r){ +return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),Vs=a(function(r){return U(r,1)==1?-1*(U( +r,31,1,!0)+1):U(r,31,1)},"parseInt32"),Sc=a(function(r){return zs(r,23,8)},"parseFloat32"),vc=a(function(r){ +return zs(r,52,11)},"parseFloat64"),Ec=a(function(r){var e=U(r,16,32);if(e==49152)return NaN;for(var t=Math. pow(1e4,U(r,16,16)),n=0,i=[],s=U(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 E=l.shift();for(g= 0;g0},"parseBool"),_c=a(function(r){r(20,gc),r(21,bc),r(23,Gs),r(26,Gs),r(1700,vc),r(700,xc), -r(701,Sc),r(16,Ac),r(1114,Vs.bind(null,!1)),r(1184,Vs.bind(null,!0)),r(1e3,gt),r(1007,gt),r(1016,gt), -r(1008,gt),r(1009,gt),r(25,Ec)},"init");zs.exports={init:_c}});var Zs=R((Hh,Js)=>{p();Js.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25, +"parseArray"),Ac=a(function(r){return r.toString("utf8")},"parseText"),_c=a(function(r){return r===null? +null:U(r,8)>0},"parseBool"),Cc=a(function(r){r(20,bc),r(21,xc),r(23,Vs),r(26,Vs),r(1700,Ec),r(700,Sc), +r(701,vc),r(16,_c),r(1114,Ks.bind(null,!1)),r(1184,Ks.bind(null,!0)),r(1e3,bt),r(1007,bt),r(1016,bt), +r(1008,bt),r(1009,bt),r(25,Ac)},"init");Ys.exports={init:Cc}});var Xs=R(($h,Zs)=>{p();Zs.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 St=R(xt=>{p();var Cc=Ws(),Ic=Ys(),Tc=Hr(),Pc=Zs();xt.getTypeParser=Rc;xt.setTypeParser=Bc;xt.arrayParser= -Tc;xt.builtins=Pc;var bt={text:{},binary:{}};function Xs(r){return String(r)}a(Xs,"noParse");function Rc(r,e){ -return e=e||"text",bt[e]&&bt[e][r]||Xs}a(Rc,"getTypeParser");function Bc(r,e,t){typeof e=="function"&& -(t=e,e="text"),bt[e][r]=t}a(Bc,"setTypeParser");Cc.init(function(r,e){bt.text[r]=e});Ic.init(function(r,e){ -bt.binary[r]=e})});var Zt=R((zh,eo)=>{"use strict";p();var Lc=St();function Jt(r){this._types=r||Lc,this.text={},this.binary= +REGROLE:4096}});var vt=R(St=>{p();var Ic=Hs(),Tc=Js(),Pc=$r(),Rc=Xs();St.getTypeParser=Bc;St.setTypeParser=Lc;St.arrayParser= +Pc;St.builtins=Rc;var xt={text:{},binary:{}};function eo(r){return String(r)}a(eo,"noParse");function Bc(r,e){ +return e=e||"text",xt[e]&&xt[e][r]||eo}a(Bc,"getTypeParser");function Lc(r,e,t){typeof e=="function"&& +(t=e,e="text"),xt[e][r]=t}a(Lc,"setTypeParser");Ic.init(function(r,e){xt.text[r]=e});Tc.init(function(r,e){ +xt.binary[r]=e})});var Zt=R((Yh,to)=>{"use strict";p();var kc=vt();function Jt(r){this._types=r||kc,this.text={},this.binary= {}}a(Jt,"TypeOverrides");Jt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ binary":return this.binary;default:return{}}};Jt.prototype.setTypeParser=function(r,e,t){typeof e=="\ function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Jt.prototype.getTypeParser=function(r,e){return e= -e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};eo.exports=Jt});function vt(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119,o=2600822924,u=528734635, +e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};to.exports=Jt});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, @@ -554,21 +554,21 @@ c=1541459225,l=0,f=0,y=[1116352408,1899447441,3049323471,3921009573,961987163,15 1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909, 275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222, 2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=a((T,b)=>T>>>b|T<<32- -b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),W=a(()=>{for(let M=0,Z=0;M<16;M++,Z+=4)E[M]=C[Z]<< -24|C[Z+1]<<16|C[Z+2]<<8|C[Z+3];for(let M=16;M<64;M++){let Z=g(E[M-15],7)^g(E[M-15],18)^E[M-15]>>>3,ve=g( -E[M-2],17)^g(E[M-2],19)^E[M-2]>>>10;E[M]=E[M-16]+Z+E[M-7]+ve|0}let T=e,b=t,k=n,ae=i,H=s,Ce=o,le=u,ue=c; -for(let M=0;M<64;M++){let Z=g(H,6)^g(H,11)^g(H,25),ve=H&Ce^~H&le,Ie=ue+Z+ve+y[M]+E[M]|0,Le=g(T,2)^g( -T,13)^g(T,22),ke=T&b^T&k^b&k,ot=Le+ke|0;ue=le,le=Ce,Ce=H,H=ae+Ie|0,ae=k,k=b,b=T,T=Ie+ot|0}e=e+T|0,t= -t+b|0,n=n+k|0,i=i+ae|0,s=s+H|0,o=o+Ce|0,u=u+le|0,c=c+ue|0,f=0},"process"),J=a(T=>{typeof T=="string"&& +b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),W=a(()=>{for(let k=0,J=0;k<16;k++,J+=4)E[k]=C[J]<< +24|C[J+1]<<16|C[J+2]<<8|C[J+3];for(let k=16;k<64;k++){let J=g(E[k-15],7)^g(E[k-15],18)^E[k-15]>>>3,ve=g( +E[k-2],17)^g(E[k-2],19)^E[k-2]>>>10;E[k]=E[k-16]+J+E[k-7]+ve|0}let T=e,b=t,F=n,ae=i,H=s,we=o,Ce=u,ce=c; +for(let k=0;k<64;k++){let J=g(H,6)^g(H,11)^g(H,25),ve=H&we^~H&Ce,Ie=ce+J+ve+y[k]+E[k]|0,ke=g(T,2)^g( +T,13)^g(T,22),Fe=T&b^T&F^b&F,Me=ke+Fe|0;ce=Ce,Ce=we,we=H,H=ae+Ie|0,ae=F,F=b,b=T,T=Ie+Me|0}e=e+T|0,t= +t+b|0,n=n+F|0,i=i+ae|0,s=s+H|0,o=o+we|0,u=u+Ce|0,c=c+ce|0,f=0},"process"),Y=a(T=>{typeof T=="string"&& (T=new TextEncoder().encode(T));for(let b=0;b{if(C[f++]=128,f==64&&W(),f+8>64){for(;f<64;)C[f++]=0;W()}for(;f<58;)C[f++]=0;let T=l*8;C[f++]= +me=a(()=>{if(C[f++]=128,f==64&&W(),f+8>64){for(;f<64;)C[f++]=0;W()}for(;f<58;)C[f++]=0;let T=l*8;C[f++]= T/1099511627776&255,C[f++]=T/4294967296&255,C[f++]=T>>>24,C[f++]=T>>>16&255,C[f++]=T>>>8&255,C[f++]= T&255,W();let b=new Uint8Array(32);return b[0]=e>>>24,b[1]=e>>>16&255,b[2]=e>>>8&255,b[3]=e&255,b[4]= t>>>24,b[5]=t>>>16&255,b[6]=t>>>8&255,b[7]=t&255,b[8]=n>>>24,b[9]=n>>>16&255,b[10]=n>>>8&255,b[11]=n& 255,b[12]=i>>>24,b[13]=i>>>16&255,b[14]=i>>>8&255,b[15]=i&255,b[16]=s>>>24,b[17]=s>>>16&255,b[18]=s>>> 8&255,b[19]=s&255,b[20]=o>>>24,b[21]=o>>>16&255,b[22]=o>>>8&255,b[23]=o&255,b[24]=u>>>24,b[25]=u>>>16& 255,b[26]=u>>>8&255,b[27]=u&255,b[28]=c>>>24,b[29]=c>>>16&255,b[30]=c>>>8&255,b[31]=c&255,b},"digest"); -return r===void 0?{add:J,digest:we}:(J(r),we())}var to=re(()=>{"use strict";p();a(vt,"sha256")});var Q,Et,ro=re(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ +return r===void 0?{add:Y,digest:me}:(Y(r),me())}var ro=re(()=>{"use strict";p();a(Et,"sha256")});var Q,At,no=re(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ Length",0);I(this,"_state",new Int32Array(4));I(this,"_buffer",new ArrayBuffer(68));I(this,"_buffer8"); I(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 Q._md5cycle(this._state,i),e?this._state:Q._hex( this._state)}};a(Q,"Md5"),I(Q,"stateIdentity",new Int32Array([1732584193,-271733879,-1732584194,271733878])), I(Q,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),I(Q,"hexChars","0123456789\ -abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);Et=Q});var Zr={};ge(Zr,{createHash:()=>Fc,createHmac:()=>Mc,randomBytes:()=>kc});function kc(r){return crypto. -getRandomValues(m.alloc(r))}function Fc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( -function(){return m.from(vt(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 Mc(r,e){if(r!=="sha256")throw new Error(`\ +abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);At=Q});var Xr={};ge(Xr,{createHash:()=>Mc,createHmac:()=>Uc,randomBytes:()=>Fc});function Fc(r){return crypto. +getRandomValues(m.alloc(r))}function Mc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( +function(){return m.from(Et(e))},"digest")}},"update")};if(r==="md5")return{update:a(function(e){return{ +digest:a(function(){return typeof e=="string"?At.hashStr(e):At.hashByteArray(e)},"digest")}},"update")}; +throw new Error(`Hash type '${r}' not supported`)}function Uc(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=vt(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(vt(o),64),m.from(vt(u))}, -"digest")}},"update")}}var Xr=re(()=>{"use strict";p();to();ro();a(kc,"randomBytes");a(Fc,"createHas\ -h");a(Mc,"createHmac")});var At=R((ud,en)=>{"use strict";p();en.exports={host:"localhost",user:w.platform==="win32"?w.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),m.from(Et(u))}, +"digest")}},"update")}}var en=re(()=>{"use strict";p();ro();no();a(Fc,"randomBytes");a(Mc,"createHas\ +h");a(Uc,"createHmac")});var _t=R((cd,tn)=>{"use strict";p();tn.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: w.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 Xe=St(),Uc=Xe.getTypeParser(20,"text"),Dc=Xe.getTypeParser(1016, -"text");en.exports.__defineSetter__("parseInt8",function(r){Xe.setTypeParser(20,"text",r?Xe.getTypeParser( -23,"text"):Uc),Xe.setTypeParser(1016,"text",r?Xe.getTypeParser(1007,"text"):Dc)})});var _t=R((ld,io)=>{"use strict";p();var Oc=(Xr(),G(Zr)),Nc=At();function qc(r){var e=r.replace(/\\/g, -"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(qc,"escapeElement");function no(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+no(r[t]): -r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=qc(Xt(r[t]));return e=e+"}",e}a(no,"arrayString"); +keepalives:1,keepalives_idle:0};var tt=vt(),Dc=tt.getTypeParser(20,"text"),Oc=tt.getTypeParser(1016, +"text");tn.exports.__defineSetter__("parseInt8",function(r){tt.setTypeParser(20,"text",r?tt.getTypeParser( +23,"text"):Dc),tt.setTypeParser(1016,"text",r?tt.getTypeParser(1007,"text"):Oc)})});var Ct=R((fd,so)=>{"use strict";p();var Nc=(en(),$(Xr)),qc=_t();function Qc(r){var e=r.replace(/\\/g, +"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(Qc,"escapeElement");function io(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+io(r[t]): +r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=Qc(Xt(r[t]));return e=e+"}",e}a(io,"arrayString"); var Xt=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. 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?Nc.parseInputDatesAsUTC?Wc(r):jc(r):Array.isArray(r)?no(r):typeof r== -"object"?Qc(r,e):r.toString()},"prepareValue");function Qc(r,e){if(r&&typeof r.toPostgres=="function"){ +r.byteLength)}return r instanceof Date?qc.parseInputDatesAsUTC?Hc(r):Wc(r):Array.isArray(r)?io(r):typeof r== +"object"?jc(r,e):r.toString()},"prepareValue");function jc(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),Xt(r.toPostgres(Xt),e)}return JSON.stringify(r)}a(Qc,"prepareObject");function Y(r,e){ -for(r=""+r;r.lengthJc});var Jc,It=re(()=>{"use strict";p();Jc={}});var wo=R((Ad,mo)=>{"use strict";p();var nn=(Xr(),G(Zr));function Zc(r){if(r.indexOf("SCRAM-SHA-256")=== --1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=nn.randomBytes( +t),r}a($c,"normalizeQueryConfig");var rn=a(function(r){return Nc.createHash("md5").update(r,"utf-8"). +digest("hex")},"md5"),Gc=a(function(r,e,t){var n=rn(e+r),i=rn(m.concat([m.from(n),t]));return"md5"+i}, +"postgresMd5PasswordHash");so.exports={prepareValue:a(function(e){return Xt(e)},"prepareValueWrapper"), +normalizeQueryConfig:$c,postgresMd5PasswordHash:Gc,md5:rn}});var It={};ge(It,{default:()=>Zc});var Zc,Tt=re(()=>{"use strict";p();Zc={}});var go=R((_d,wo)=>{"use strict";p();var sn=(en(),$(Xr));function Xc(r){if(r.indexOf("SCRAM-SHA-256")=== +-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=sn.randomBytes( 18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"\ -SASLInitialResponse"}}a(Zc,"startSession");function Xc(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( +SASLInitialResponse"}}a(Xc,"startSession");function el(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=rl(t);if(n.nonce.startsWith(r.clientNonce)){ +L: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=nl(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=m.from(n.salt,"base64"),s=sl(e,i,n.iteration),o=et(s,"Client Key"),u=il( +art with client nonce");var i=m.from(n.salt,"base64"),s=ol(e,i,n.iteration),o=rt(s,"Client Key"),u=sl( 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=et(u,y),E=yo(o,g),C=E.toString("base64"),W=et(s,"Server Key"),J=et(W,y);r.message="SAS\ -LResponse",r.serverSignature=J.toString("base64"),r.response=f+",p="+C}a(Xc,"continueSession");function el(r,e){ +","+l+","+f,g=rt(u,y),E=mo(o,g),C=E.toString("base64"),W=rt(s,"Server Key"),Y=rt(W,y);r.message="SAS\ +LResponse",r.serverSignature=Y.toString("base64"),r.response=f+",p="+C}a(el,"continueSession");function tl(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}=nl( +"string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=il( e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does\ - not match")}a(el,"finalizeSession");function tl(r){if(typeof r!="string")throw new TypeError("SASL:\ + not match")}a(tl,"finalizeSession");function rl(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(tl,"isPrintableChars");function ho(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(r)}a(ho,"isBase64");function po(r){if(typeof r!="string")throw new TypeError("SASL: attribute p\ +e<=126)}a(rl,"isPrintableChars");function po(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(r)}a(po,"isBase64");function yo(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(po,"parseAttribute\ -Pairs");function rl(r){let e=po(r),t=e.get("r");if(t){if(!tl(t))throw new Error("SASL: SCRAM-SERVER-\ +SASL: Invalid attribute pair entry");let t=e[0],n=e.substring(2);return[t,n]}))}a(yo,"parseAttribute\ +Pairs");function nl(r){let e=yo(r),t=e.get("r");if(t){if(!rl(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(!ho(n))throw new Error("SASL: SCRAM-SERV\ +ER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!po(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(rl,"parseServerFirstMessage"); -function nl(r){let t=po(r).get("v");if(t){if(!ho(t))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAG\ +tion missing");let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(nl,"parseServerFirstMessage"); +function il(r){let t=yo(r).get("v");if(t){if(!po(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(nl,"parseServerFinalMessage");function yo(r,e){if(!m. +signature is missing");return{serverSignature:t}}a(il,"parseServerFinalMessage");function mo(r,e){if(!m. isBuffer(r))throw new TypeError("first argument must be a Buffer");if(!m.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 m.from(r.map((t,n)=>r[n]^e[n]))} -a(yo,"xorBuffers");function il(r){return nn.createHash("sha256").update(r).digest()}a(il,"sha256");function et(r,e){ -return nn.createHmac("sha256",r).update(e).digest()}a(et,"hmacSha256");function sl(r,e,t){for(var n=et( -r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sol});function ol(...r){return r.join("/")}var on=re(()=>{"use strict";p(); -a(ol,"join")});var an={};ge(an,{stat:()=>al});function al(r,e){e(new Error("No filesystem"))}var un=re(()=>{"use st\ -rict";p();a(al,"stat")});var cn={};ge(cn,{default:()=>ul});var ul,ln=re(()=>{"use strict";p();ul={}});var go={};ge(go,{StringDecoder:()=>fn});var hn,fn,bo=re(()=>{"use strict";p();hn=class hn{constructor(e){ +a(mo,"xorBuffers");function sl(r){return sn.createHash("sha256").update(r).digest()}a(sl,"sha256");function rt(r,e){ +return sn.createHmac("sha256",r).update(e).digest()}a(rt,"hmacSha256");function ol(r,e,t){for(var n=rt( +r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sal});function al(...r){return r.join("/")}var an=re(()=>{"use strict";p(); +a(al,"join")});var un={};ge(un,{stat:()=>ul});function ul(r,e){e(new Error("No filesystem"))}var cn=re(()=>{"use st\ +rict";p();a(ul,"stat")});var ln={};ge(ln,{default:()=>cl});var cl,fn=re(()=>{"use strict";p();cl={}});var bo={};ge(bo,{StringDecoder:()=>hn});var dn,hn,xo=re(()=>{"use strict";p();dn=class dn{constructor(e){ I(this,"td");this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this. -td.decode(e)}};a(hn,"StringDecoder");fn=hn});var Eo=R((Fd,vo)=>{"use strict";p();var{Transform:cl}=(ln(),G(cn)),{StringDecoder:ll}=(bo(),G(go)),Re=Symbol( -"last"),tr=Symbol("decoder");function fl(r,e,t){let n;if(this.overflow){if(n=this[tr].write(r).split( -this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Re]+=this[tr].write(r),n= -this[Re].split(this.matcher);this[Re]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( -"maximum buffer reached"));return}t()}a(fl,"transform");function hl(r){if(this[Re]+=this[tr].end(),this[Re]) -try{So(this,this.mapper(this[Re]))}catch(e){return r(e)}r()}a(hl,"flush");function So(r,e){e!==void 0&& -r.push(e)}a(So,"push");function xo(r){return r}a(xo,"noop");function dl(r,e,t){switch(r=r||/\r?\n/,e= -e||xo,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r=="object"&&!(r instanceof +td.decode(e)}};a(dn,"StringDecoder");hn=dn});var Ao=R((Md,Eo)=>{"use strict";p();var{Transform:ll}=(fn(),$(ln)),{StringDecoder:fl}=(xo(),$(bo)),Be=Symbol( +"last"),tr=Symbol("decoder");function hl(r,e,t){let n;if(this.overflow){if(n=this[tr].write(r).split( +this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Be]+=this[tr].write(r),n= +this[Be].split(this.matcher);this[Be]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( +"maximum buffer reached"));return}t()}a(hl,"transform");function dl(r){if(this[Be]+=this[tr].end(),this[Be]) +try{vo(this,this.mapper(this[Be]))}catch(e){return r(e)}r()}a(dl,"flush");function vo(r,e){e!==void 0&& +r.push(e)}a(vo,"push");function So(r){return r}a(So,"noop");function pl(r,e,t){switch(r=r||/\r?\n/,e= +e||So,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=xo)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=fl,t.flush=hl,t.readableObjectMode= -!0;let n=new cl(t);return n[Re]="",n[tr]=new ll("utf8"),n.matcher=r,n.mapper=e,n.maxLength=t.maxLength, +"object"&&(t=e,e=So)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=hl,t.flush=dl,t.readableObjectMode= +!0;let n=new ll(t);return n[Be]="",n[tr]=new fl("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(dl,"split");vo.exports=dl});var Co=R((Dd,_e)=>{"use strict";p();var Ao=(on(),G(sn)),pl=(ln(),G(cn)).Stream,yl=Eo(),_o=(It(),G(Ct)), -ml=5432,rr=w.platform==="win32",Tt=w.stderr,wl=56,gl=7,bl=61440,xl=32768;function Sl(r){return(r&bl)== -xl}a(Sl,"isRegFile");var tt=["host","port","database","user","password"],dn=tt.length,vl=tt[dn-1];function pn(){ -var r=Tt instanceof pl&&Tt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` -`);Tt.write(_o.format.apply(_o,e))}}a(pn,"warn");Object.defineProperty(_e.exports,"isWin",{get:a(function(){ -return rr},"get"),set:a(function(r){rr=r},"set")});_e.exports.warnTo=function(r){var e=Tt;return Tt= -r,e};_e.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(rr?Ao.join(e.APPDATA||"./","\ -postgresql","pgpass.conf"):Ao.join(e.HOME||"./",".pgpass"));return t};_e.exports.usePgPass=function(r,e){ -return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:rr?!0:(e=e||"",Sl(r.mode)?r. -mode&(wl|gl)?(pn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ -(0600) or less',e),!1):!0:(pn('WARNING: password file "%s" is not a plain file',e),!1))};var El=_e.exports. -match=function(r,e){return tt.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||ml)===Number( +!1,s(i)},n}a(pl,"split");Eo.exports=pl});var Io=R((Od,_e)=>{"use strict";p();var _o=(an(),$(on)),yl=(fn(),$(ln)).Stream,ml=Ao(),Co=(Tt(),$(It)), +wl=5432,rr=w.platform==="win32",Pt=w.stderr,gl=56,bl=7,xl=61440,Sl=32768;function vl(r){return(r&xl)== +Sl}a(vl,"isRegFile");var nt=["host","port","database","user","password"],pn=nt.length,El=nt[pn-1];function yn(){ +var r=Pt instanceof yl&&Pt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +`);Pt.write(Co.format.apply(Co,e))}}a(yn,"warn");Object.defineProperty(_e.exports,"isWin",{get:a(function(){ +return rr},"get"),set:a(function(r){rr=r},"set")});_e.exports.warnTo=function(r){var e=Pt;return Pt= +r,e};_e.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(rr?_o.join(e.APPDATA||"./","\ +postgresql","pgpass.conf"):_o.join(e.HOME||"./",".pgpass"));return t};_e.exports.usePgPass=function(r,e){ +return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:rr?!0:(e=e||"",vl(r.mode)?r. +mode&(gl|bl)?(yn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ +(0600) or less',e),!1):!0:(yn('WARNING: password file "%s" is not a plain file',e),!1))};var Al=_e.exports. +match=function(r,e){return nt.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||wl)===Number( e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};_e.exports.getPassword=function(r,e,t){var n,i=e.pipe( -yl());function s(c){var l=Al(c);l&&_l(l)&&El(r,l)&&(n=l[vl],i.end())}a(s,"onLine");var o=a(function(){ -e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),pn("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 Al=_e.exports.parseLine= +ml());function s(c){var l=_l(c);l&&Cl(l)&&Al(r,l)&&(n=l[El],i.end())}a(s,"onLine");var o=a(function(){ +e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),yn("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 _l=_e.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 E=r.substring(y,g);Object.hasOwnProperty.call(w.env,"PGPASS_NO_DEESCAPE")||(E=E. -replace(/\\([:\\])/g,"$1")),o[tt[f]]=E},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). -length===dn?o:null,o},_l=_e.exports.isValidEntry=function(r){for(var e={0:function(o){return o.length> +replace(/\\([:\\])/g,"$1")),o[nt[f]]=E},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). +length===pn?o:null,o},Cl=_e.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 qd=(on(),G(sn)),Io=(un(),G(an)),nr=Co();yn.exports=function(r,e){ -var t=nr.getFileName();Io.stat(t,function(n,i){if(n||!nr.usePgPass(i,t))return e(void 0);var s=Io.createReadStream( -t);nr.getPassword(r,s,e)})};yn.exports.warnTo=nr.warnTo});var Po={};ge(Po,{default:()=>Cl});var Cl,Ro=re(()=>{"use strict";p();Cl={}});var Lo=R((Hd,Bo)=>{"use strict";p();var Il=(Ir(),G(os)),mn=(un(),G(an));function wn(r){if(r.charAt(0)=== -"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Il.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i. +0}},t=0;t{"use strict";p();var Qd=(an(),$(on)),To=(cn(),$(un)),nr=Io();mn.exports=function(r,e){ +var t=nr.getFileName();To.stat(t,function(n,i){if(n||!nr.usePgPass(i,t))return e(void 0);var s=To.createReadStream( +t);nr.getPassword(r,s,e)})};mn.exports.warnTo=nr.warnTo});var Ro={};ge(Ro,{default:()=>Il});var Il,Bo=re(()=>{"use strict";p();Il={}});var ko=R(($d,Lo)=>{"use strict";p();var Tl=(Tr(),$(as)),wn=(cn(),$(un));function gn(r){if(r.charAt(0)=== +"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Tl.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=mn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=mn.readFileSync(t.sslkey).toString()), -t.sslrootcert&&(t.ssl.ca=mn.readFileSync(t.sslrootcert).toString()),t.sslmode){case"disable":{t.ssl= +cert=wn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=wn.readFileSync(t.sslkey).toString()), +t.sslrootcert&&(t.ssl.ca=wn.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(wn,"parse");Bo.exports=wn;wn.parse=wn});var ir=R((Vd,Mo)=>{"use strict";p();var Tl=(Ro(),G(Po)),Fo=At(),ko=Lo().parse,te=a(function(r,e,t){return t=== -void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Fo[r]},"val"),Pl=a(function(){switch(w. +!1;break}}return t}a(gn,"parse");Lo.exports=gn;gn.parse=gn});var ir=R((Kd,Uo)=>{"use strict";p();var Pl=(Bo(),$(Ro)),Mo=_t(),Fo=ko().parse,te=a(function(r,e,t){return t=== +void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Mo[r]},"val"),Rl=a(function(){switch(w. 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 Fo.ssl},"readSSLConfigFromEnvironment"),rt=a(function(r){ -return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),me=a(function(r,e,t){ -var n=e[t];n!=null&&r.push(t+"="+rt(n))},"add"),bn=class bn{constructor(e){e=typeof e=="string"?ko(e): -e||{},e.connectionString&&(e=Object.assign({},e,ko(e.connectionString))),this.user=te("user",e),this. +no-verify":return{rejectUnauthorized:!1}}return Mo.ssl},"readSSLConfigFromEnvironment"),it=a(function(r){ +return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),ye=a(function(r,e,t){ +var n=e[t];n!=null&&r.push(t+"="+it(n))},"add"),xn=class xn{constructor(e){e=typeof e=="string"?Fo(e): +e||{},e.connectionString&&(e=Object.assign({},e,Fo(e.connectionString))),this.user=te("user",e),this. database=te("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(te("p\ ort",e),10),this.host=te("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, writable:!0,value:te("password",e)}),this.binary=te("binary",e),this.options=te("options",e),this.ssl= -typeof e.ssl>"u"?Pl():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="\ +typeof e.ssl>"u"?Rl():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=te("client_encoding",e),this.replication=te("replication", e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=te("application_name",e,"\ @@ -780,31 +780,31 @@ te("idle_in_transaction_session_timeout",e,!1),this.query_timeout=te("query_time void 0?this.connect_timeout=w.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/ 1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive===!0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis== "number"&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){ -var t=[];me(t,this,"user"),me(t,this,"password"),me(t,this,"port"),me(t,this,"application_name"),me( -t,this,"fallback_application_name"),me(t,this,"connect_timeout"),me(t,this,"options");var n=typeof this. -ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(me(t,n,"sslmode"),me(t,n,"sslca"),me(t,n,"s\ -slkey"),me(t,n,"sslcert"),me(t,n,"sslrootcert"),this.database&&t.push("dbname="+rt(this.database)),this. -replication&&t.push("replication="+rt(this.replication)),this.host&&t.push("host="+rt(this.host)),this. -isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+rt(this.client_encoding)), -Tl.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+rt(s)),e(null,t.join(" ")))})}}; -a(bn,"ConnectionParameters");var gn=bn;Mo.exports=gn});var Oo=R((Yd,Do)=>{"use strict";p();var Rl=St(),Uo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,Sn=class Sn{constructor(e,t){ +var t=[];ye(t,this,"user"),ye(t,this,"password"),ye(t,this,"port"),ye(t,this,"application_name"),ye( +t,this,"fallback_application_name"),ye(t,this,"connect_timeout"),ye(t,this,"options");var n=typeof this. +ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(ye(t,n,"sslmode"),ye(t,n,"sslca"),ye(t,n,"s\ +slkey"),ye(t,n,"sslcert"),ye(t,n,"sslrootcert"),this.database&&t.push("dbname="+it(this.database)),this. +replication&&t.push("replication="+it(this.replication)),this.host&&t.push("host="+it(this.host)),this. +isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+it(this.client_encoding)), +Pl.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+it(s)),e(null,t.join(" ")))})}}; +a(xn,"ConnectionParameters");var bn=xn;Uo.exports=bn});var No=R((Jd,Oo)=>{"use strict";p();var Bl=vt(),Do=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,vn=class vn{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=Uo.exec(e.text):t=Uo.exec(e.command),t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2], +var t;e.text?t=Do.exec(e.text):t=Do.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:Bl}=Pe(),No=Oo(),qo=_t(),En=class En extends Bl{constructor(e,t,n){ -super(),e=qo.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]=Bl.getTypeParser(n.dataTypeID,n. +format||"text")}}};a(vn,"Result");var Sn=vn;Oo.exports=Sn});var Wo=R((ep,jo)=>{"use strict";p();var{EventEmitter:Ll}=Re(),qo=No(),Qo=Ct(),An=class An extends Ll{constructor(e,t,n){ +super(),e=Qo.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,w.domain&&e.callback&&(this.callback=w.domain.bind(e.callback)),this._result= -new No(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError= +new qo(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 No(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ +_results=[this._result]),this._result=new qo(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:qo.prepareValue})}catch(t){ +portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:Qo.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(En,"Query");var vn=En;Qo.exports= -vn});var Zn=R(P=>{"use strict";p();Object.defineProperty(P,"__esModule",{value:!0});P.NoticeMessage=P.DataRowMessage= +e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(An,"Query");var En=An;jo.exports= +En});var Xn=R(P=>{"use strict";p();Object.defineProperty(P,"__esModule",{value:!0});P.NoticeMessage=P.DataRowMessage= P.CommandCompleteMessage=P.ReadyForQueryMessage=P.NotificationResponseMessage=P.BackendKeyDataMessage= P.AuthenticationMD5Password=P.ParameterStatusMessage=P.ParameterDescriptionMessage=P.RowDescriptionMessage= P.Field=P.CopyResponse=P.CopyDataMessage=P.DatabaseError=P.copyDone=P.emptyQuery=P.replicationStart= @@ -832,30 +832,30 @@ P.portalSuspended=P.noData=P.closeComplete=P.bindComplete=P.parseComplete=void 0 parseComplete",length:5};P.bindComplete={name:"bindComplete",length:5};P.closeComplete={name:"closeC\ omplete",length:5};P.noData={name:"noData",length:5};P.portalSuspended={name:"portalSuspended",length:5}; P.replicationStart={name:"replicationStart",length:4};P.emptyQuery={name:"emptyQuery",length:4};P.copyDone= -{name:"copyDone",length:4};var On=class On extends Error{constructor(e,t,n){super(e),this.length=t,this. -name=n}};a(On,"DatabaseError");var An=On;P.DatabaseError=An;var Nn=class Nn{constructor(e,t){this.length= -e,this.chunk=t,this.name="copyData"}};a(Nn,"CopyDataMessage");var _n=Nn;P.CopyDataMessage=_n;var qn=class qn{constructor(e,t,n,i){ -this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(qn,"CopyResponse");var Cn=qn; -P.CopyResponse=Cn;var Qn=class Qn{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(Qn,"Field");var In=Qn; -P.Field=In;var jn=class jn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ -n",this.fields=new Array(this.fieldCount)}};a(jn,"RowDescriptionMessage");var Tn=jn;P.RowDescriptionMessage= -Tn;var Wn=class Wn{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ -ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(Wn,"ParameterDescriptionMessage");var Pn=Wn; -P.ParameterDescriptionMessage=Pn;var Hn=class Hn{constructor(e,t,n){this.length=e,this.parameterName= -t,this.parameterValue=n,this.name="parameterStatus"}};a(Hn,"ParameterStatusMessage");var Rn=Hn;P.ParameterStatusMessage= -Rn;var $n=class $n{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; -a($n,"AuthenticationMD5Password");var Bn=$n;P.AuthenticationMD5Password=Bn;var Gn=class Gn{constructor(e,t,n){ -this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Gn,"BackendKeyDataMes\ -sage");var Ln=Gn;P.BackendKeyDataMessage=Ln;var Vn=class Vn{constructor(e,t,n,i){this.length=e,this. -processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(Vn,"NotificationResponseMessa\ -ge");var kn=Vn;P.NotificationResponseMessage=kn;var Kn=class Kn{constructor(e,t){this.length=e,this. -status=t,this.name="readyForQuery"}};a(Kn,"ReadyForQueryMessage");var Fn=Kn;P.ReadyForQueryMessage=Fn; -var zn=class zn{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(zn,"Comma\ -ndCompleteMessage");var Mn=zn;P.CommandCompleteMessage=Mn;var Yn=class Yn{constructor(e,t){this.length= -e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(Yn,"DataRowMessage");var Un=Yn;P.DataRowMessage= -Un;var Jn=class Jn{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(Jn,"NoticeMe\ -ssage");var Dn=Jn;P.NoticeMessage=Dn});var Wo=R(sr=>{"use strict";p();Object.defineProperty(sr,"__esModule",{value:!0});sr.Writer=void 0;var ei=class ei{constructor(e=256){ +{name:"copyDone",length:4};var Nn=class Nn extends Error{constructor(e,t,n){super(e),this.length=t,this. +name=n}};a(Nn,"DatabaseError");var _n=Nn;P.DatabaseError=_n;var qn=class qn{constructor(e,t){this.length= +e,this.chunk=t,this.name="copyData"}};a(qn,"CopyDataMessage");var Cn=qn;P.CopyDataMessage=Cn;var Qn=class Qn{constructor(e,t,n,i){ +this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Qn,"CopyResponse");var In=Qn; +P.CopyResponse=In;var jn=class jn{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(jn,"Field");var Tn=jn; +P.Field=Tn;var Wn=class Wn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ +n",this.fields=new Array(this.fieldCount)}};a(Wn,"RowDescriptionMessage");var Pn=Wn;P.RowDescriptionMessage= +Pn;var Hn=class Hn{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ +ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(Hn,"ParameterDescriptionMessage");var Rn=Hn; +P.ParameterDescriptionMessage=Rn;var $n=class $n{constructor(e,t,n){this.length=e,this.parameterName= +t,this.parameterValue=n,this.name="parameterStatus"}};a($n,"ParameterStatusMessage");var Bn=$n;P.ParameterStatusMessage= +Bn;var Gn=class Gn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; +a(Gn,"AuthenticationMD5Password");var Ln=Gn;P.AuthenticationMD5Password=Ln;var Vn=class Vn{constructor(e,t,n){ +this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Vn,"BackendKeyDataMes\ +sage");var kn=Vn;P.BackendKeyDataMessage=kn;var Kn=class Kn{constructor(e,t,n,i){this.length=e,this. +processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(Kn,"NotificationResponseMessa\ +ge");var Fn=Kn;P.NotificationResponseMessage=Fn;var zn=class zn{constructor(e,t){this.length=e,this. +status=t,this.name="readyForQuery"}};a(zn,"ReadyForQueryMessage");var Mn=zn;P.ReadyForQueryMessage=Mn; +var Yn=class Yn{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(Yn,"Comma\ +ndCompleteMessage");var Un=Yn;P.CommandCompleteMessage=Un;var Jn=class Jn{constructor(e,t){this.length= +e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(Jn,"DataRowMessage");var Dn=Jn;P.DataRowMessage= +Dn;var Zn=class Zn{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(Zn,"NoticeMe\ +ssage");var On=Zn;P.NoticeMessage=On});var Ho=R(sr=>{"use strict";p();Object.defineProperty(sr,"__esModule",{value:!0});sr.Writer=void 0;var ti=class ti{constructor(e=256){ this.size=e,this.offset=5,this.headerPosition=0,this.buffer=m.allocUnsafe(e)}ensure(e){if(this.buffer. length-this.offset>1)+e;this.buffer=m.allocUnsafe(i),n.copy( this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this. @@ -867,49 +867,49 @@ 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=m.allocUnsafe(this.size),t}};a(ei,"Writer");var Xn=ei;sr.Writer=Xn});var $o=R(ar=>{"use strict";p();Object.defineProperty(ar,"__esModule",{value:!0});ar.serialize=void 0; -var ti=Wo(),D=new ti.Writer,Ll=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( +headerPosition=0,this.buffer=m.allocUnsafe(this.size),t}};a(ti,"Writer");var ei=ti;sr.Writer=ei});var Go=R(ar=>{"use strict";p();Object.defineProperty(ar,"__esModule",{value:!0});ar.serialize=void 0; +var ri=Ho(),D=new ri.Writer,kl=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( n).addCString(r[n]);D.addCString("client_encoding").addCString("UTF8");let e=D.addCString("").flush(), -t=e.length+4;return new ti.Writer().addInt32(t).add(e).flush()},"startup"),kl=a(()=>{let r=m.allocUnsafe( -8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Fl=a(r=>D.addCString(r).flush( -112),"password"),Ml=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. -flush(112)},"sendSASLInitialResponseMessage"),Ul=a(function(r){return D.addString(r).flush(112)},"se\ -ndSCRAMClientFinalMessage"),Dl=a(r=>D.addCString(r).flush(81),"query"),Ho=[],Ol=a(r=>{let e=r.name|| +t=e.length+4;return new ri.Writer().addInt32(t).add(e).flush()},"startup"),Fl=a(()=>{let r=m.allocUnsafe( +8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Ml=a(r=>D.addCString(r).flush( +112),"password"),Ul=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. +flush(112)},"sendSASLInitialResponseMessage"),Dl=a(function(r){return D.addString(r).flush(112)},"se\ +ndSCRAMClientFinalMessage"),Ol=a(r=>D.addCString(r).flush(81),"query"),$o=[],Nl=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||Ho,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< -n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),nt=new ti.Writer,Nl=a(function(r,e){for(let t=0;t< -r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),nt.addInt32(-1)):n instanceof m?(D.addInt16( -1),nt.addInt32(n.length),nt.add(n)):(D.addInt16(0),nt.addInt32(m.byteLength(n)),nt.addString(n))}},"\ -writeValues"),ql=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Ho,s=i.length; -return D.addCString(e).addCString(t),D.addInt16(s),Nl(i,r.valueMapper),D.addInt16(s),D.add(nt.flush()), -D.addInt16(n?1:0),D.flush(66)},"bind"),Ql=m.from([69,0,0,0,9,0,0,0,0,0]),jl=a(r=>{if(!r||!r.portal&& -!r.rows)return Ql;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Wl=a( +xecuting queries"));let t=r.types||$o,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< +n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),st=new ri.Writer,ql=a(function(r,e){for(let t=0;t< +r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),st.addInt32(-1)):n instanceof m?(D.addInt16( +1),st.addInt32(n.length),st.add(n)):(D.addInt16(0),st.addInt32(m.byteLength(n)),st.addString(n))}},"\ +writeValues"),Ql=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||$o,s=i.length; +return D.addCString(e).addCString(t),D.addInt16(s),ql(i,r.valueMapper),D.addInt16(s),D.add(st.flush()), +D.addInt16(n?1:0),D.flush(66)},"bind"),jl=m.from([69,0,0,0,9,0,0,0,0,0]),Wl=a(r=>{if(!r||!r.portal&& +!r.rows)return jl;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Hl=a( (r,e)=>{let t=m.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"),ri=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. +6),t.writeInt32BE(r,8),t.writeInt32BE(e,12),t},"cancel"),ni=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i},"cstringMessage"), -Hl=D.addCString("P").flush(68),$l=D.addCString("S").flush(68),Gl=a(r=>r.name?ri(68,`${r.type}${r.name|| -""}`):r.type==="P"?Hl:$l,"describe"),Vl=a(r=>{let e=`${r.type}${r.name||""}`;return ri(67,e)},"close"), -Kl=a(r=>D.add(r).flush(100),"copyData"),zl=a(r=>ri(102,r),"copyFail"),or=a(r=>m.from([r,0,0,0,4]),"c\ -odeOnlyBuffer"),Yl=or(72),Jl=or(83),Zl=or(88),Xl=or(99),ef={startup:Ll,password:Fl,requestSsl:kl,sendSASLInitialResponseMessage:Ml, -sendSCRAMClientFinalMessage:Ul,query:Dl,parse:Ol,bind:ql,execute:jl,describe:Gl,close:Vl,flush:a(()=>Yl, -"flush"),sync:a(()=>Jl,"sync"),end:a(()=>Zl,"end"),copyData:Kl,copyDone:a(()=>Xl,"copyDone"),copyFail:zl, -cancel:Wl};ar.serialize=ef});var Go=R(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.BufferReader=void 0; -var tf=m.allocUnsafe(0),ii=class ii{constructor(e=0){this.offset=e,this.buffer=tf,this.encoding="utf\ +$l=D.addCString("P").flush(68),Gl=D.addCString("S").flush(68),Vl=a(r=>r.name?ni(68,`${r.type}${r.name|| +""}`):r.type==="P"?$l:Gl,"describe"),Kl=a(r=>{let e=`${r.type}${r.name||""}`;return ni(67,e)},"close"), +zl=a(r=>D.add(r).flush(100),"copyData"),Yl=a(r=>ni(102,r),"copyFail"),or=a(r=>m.from([r,0,0,0,4]),"c\ +odeOnlyBuffer"),Jl=or(72),Zl=or(83),Xl=or(88),ef=or(99),tf={startup:kl,password:Ml,requestSsl:Fl,sendSASLInitialResponseMessage:Ul, +sendSCRAMClientFinalMessage:Dl,query:Ol,parse:Nl,bind:Ql,execute:Wl,describe:Vl,close:Kl,flush:a(()=>Jl, +"flush"),sync:a(()=>Zl,"sync"),end:a(()=>Xl,"end"),copyData:zl,copyDone:a(()=>ef,"copyDone"),copyFail:Yl, +cancel:Hl};ar.serialize=tf});var Vo=R(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.BufferReader=void 0; +var rf=m.allocUnsafe(0),si=class si{constructor(e=0){this.offset=e,this.buffer=rf,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(ii,"BufferReader");var ni=ii;ur.BufferReader=ni});var zo=R(cr=>{"use strict";p();Object.defineProperty(cr,"__esModule",{value:!0});cr.Parser=void 0;var O=Zn(), -rf=Go(),si=1,nf=4,Vo=si+nf,Ko=m.allocUnsafe(0),ai=class ai{constructor(e){if(this.buffer=Ko,this.bufferLength= -0,this.bufferOffset=0,this.reader=new rf.BufferReader,e?.mode==="binary")throw new Error("Binary mod\ +offset+=e,t}};a(si,"BufferReader");var ii=si;ur.BufferReader=ii});var Yo=R(cr=>{"use strict";p();Object.defineProperty(cr,"__esModule",{value:!0});cr.Parser=void 0;var O=Xn(), +nf=Vo(),oi=1,sf=4,Ko=oi+sf,zo=m.allocUnsafe(0),ui=class ui{constructor(e){if(this.buffer=zo,this.bufferLength= +0,this.bufferOffset=0,this.reader=new nf.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+Vo<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( -i+si),u=si+o;if(u+i<=n){let c=this.handlePacket(i+Vo,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. -buffer=Ko,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=n-i,this.bufferOffset=i)}mergeBuffer(e){ +this.bufferLength,i=this.bufferOffset;for(;i+Ko<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( +i+oi),u=oi+o;if(u+i<=n){let c=this.handlePacket(i+Ko,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. +buffer=zo,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. buffer.byteLength*2;for(;t>=s;)s*=2;i=m.allocUnsafe(s)}this.buffer.copy(i,0,this.bufferOffset,this.bufferOffset+ @@ -955,14 +955,14 @@ o=this.reader.string(1);for(;o!=="\0";)s[o]=this.reader.cstring(),o=this.reader. c=i==="notice"?new O.NoticeMessage(t,u):new O.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(ai,"Parser");var oi=ai;cr.Parser=oi});var ui=R(Be=>{"use strict";p();Object.defineProperty(Be,"__esModule",{value:!0});Be.DatabaseError=Be. -serialize=Be.parse=void 0;var sf=Zn();Object.defineProperty(Be,"DatabaseError",{enumerable:!0,get:a( -function(){return sf.DatabaseError},"get")});var of=$o();Object.defineProperty(Be,"serialize",{enumerable:!0, -get:a(function(){return of.serialize},"get")});var af=zo();function uf(r,e){let t=new af.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(uf,"parse");Be.parse=uf});var Yo={};ge(Yo,{connect:()=>cf});function cf({socket:r,servername:e}){return r.startTls(e),r}var Jo=re( -()=>{"use strict";p();a(cf,"connect")});var fi=R((vp,ea)=>{"use strict";p();var Zo=(Ve(),G(ss)),lf=Pe().EventEmitter,{parse:ff,serialize:z}=ui(), -Xo=z.flush(),hf=z.sync(),df=z.end(),li=class li extends lf{constructor(e){super(),e=e||{},this.stream= -e.stream||new Zo.Socket,this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis, +a(ui,"Parser");var ai=ui;cr.Parser=ai});var ci=R(Le=>{"use strict";p();Object.defineProperty(Le,"__esModule",{value:!0});Le.DatabaseError=Le. +serialize=Le.parse=void 0;var of=Xn();Object.defineProperty(Le,"DatabaseError",{enumerable:!0,get:a( +function(){return of.DatabaseError},"get")});var af=Go();Object.defineProperty(Le,"serialize",{enumerable:!0, +get:a(function(){return af.serialize},"get")});var uf=Yo();function cf(r,e){let t=new uf.Parser;return r. +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(cf,"parse");Le.parse=cf});var Jo={};ge(Jo,{connect:()=>lf});function lf({socket:r,servername:e}){return r.startTls(e),r}var Zo=re( +()=>{"use strict";p();a(lf,"connect")});var hi=R((Ep,ta)=>{"use strict";p();var Xo=(ze(),$(os)),ff=Re().EventEmitter,{parse:hf,serialize:K}=ci(), +ea=K.flush(),df=K.sync(),pf=K.end(),fi=class fi extends ff{constructor(e){super(),e=e||{},this.stream= +e.stream||new Xo.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=(Jo(),G(Yo));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= -n.ssl.key)),Zo.isIP(t)===0&&(c.servername=t);try{n.stream=u.connect(c)}catch(l){return n.emit("error", +var u=(Zo(),$(Jo));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= +n.ssl.key)),Xo.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")}),ff(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& -this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(z.requestSsl())}startup(e){this. -stream.write(z.startup(e))}cancel(e,t){this._send(z.cancel(e,t))}password(e){this._send(z.password(e))}sendSASLInitialResponseMessage(e,t){ -this._send(z.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(z.sendSCRAMClientFinalMessage( -e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(z.query(e))}parse(e){ -this._send(z.parse(e))}bind(e){this._send(z.bind(e))}execute(e){this._send(z.execute(e))}flush(){this. -stream.writable&&this.stream.write(Xo)}sync(){this._ending=!0,this._send(Xo),this._send(hf)}ref(){this. +"end",()=>{this.emit("end")}),hf(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& +this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(K.requestSsl())}startup(e){this. +stream.write(K.startup(e))}cancel(e,t){this._send(K.cancel(e,t))}password(e){this._send(K.password(e))}sendSASLInitialResponseMessage(e,t){ +this._send(K.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(K.sendSCRAMClientFinalMessage( +e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(K.query(e))}parse(e){ +this._send(K.parse(e))}bind(e){this._send(K.bind(e))}execute(e){this._send(K.execute(e))}flush(){this. +stream.writable&&this.stream.write(ea)}sync(){this._ending=!0,this._send(ea),this._send(df)}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(df,()=>{this.stream.end()})}close(e){this._send(z. -close(e))}describe(e){this._send(z.describe(e))}sendCopyFromChunk(e){this._send(z.copyData(e))}endCopyFrom(){ -this._send(z.copyDone())}sendCopyFail(e){this._send(z.copyFail(e))}};a(li,"Connection");var ci=li;ea. -exports=ci});var na=R((Cp,ra)=>{"use strict";p();var pf=Pe().EventEmitter,_p=(It(),G(Ct)),yf=_t(),hi=wo(),mf=To(), -wf=Zt(),gf=ir(),ta=jo(),bf=At(),xf=fi(),di=class di extends pf{constructor(e){super(),this.connectionParameters= -new gf(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database, +this.stream.end();return}return this.stream.write(pf,()=>{this.stream.end()})}close(e){this._send(K. +close(e))}describe(e){this._send(K.describe(e))}sendCopyFromChunk(e){this._send(K.copyData(e))}endCopyFrom(){ +this._send(K.copyDone())}sendCopyFail(e){this._send(K.copyFail(e))}};a(fi,"Connection");var li=fi;ta. +exports=li});var ia=R((Ip,na)=>{"use strict";p();var yf=Re().EventEmitter,Cp=(Tt(),$(It)),mf=Ct(),di=go(),wf=Po(), +gf=Zt(),bf=ir(),ra=Wo(),xf=_t(),Sf=hi(),pi=class pi extends yf{constructor(e){super(),this.connectionParameters= +new bf(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||S.Promise, -this._types=new wf(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= -!1,this._queryable=!0,this.connection=t.connection||new xf({stream:t.stream,ssl:this.connectionParameters. +this._types=new gf(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= +!1,this._queryable=!0,this.connection=t.connection||new Sf({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||bf.binary,this. +connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t.binary||xf.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=>{w.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():mf(this.connectionParameters, +password=this.password=null;e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():wf(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=yf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ -this._checkPgPass(()=>{this.saslSession=hi.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( -this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){hi.continueSession( +()=>{let t=mf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ +this._checkPgPass(()=>{this.saslSession=di.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( +this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){di.continueSession( this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession. -response)}_handleAuthSASLFinal(e){hi.finalizeSession(this.saslSession,e.data),this.saslSession=null}_handleBackendKeyData(e){ +response)}_handleAuthSASLFinal(e){di.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 ta(e,t,n),i.callback||(s=new this._Promise((l,f)=>{i.callback= +connectionParameters.query_timeout,i=new ra(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");w.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(di,"Client");var lr=di;lr.Query=ta;ra.exports=lr});var aa=R((Pp,oa)=>{"use strict";p();var Sf=Pe().EventEmitter,ia=a(function(){},"NOOP"),sa=a((r,e)=>{ -let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),mi=class mi{constructor(e,t,n){ -this.client=e,this.idleListener=t,this.timeoutId=n}};a(mi,"IdleItem");var pi=mi,wi=class wi{constructor(e){ -this.callback=e}};a(wi,"PendingItem");var it=wi;function vf(){throw new Error("Release called on cli\ -ent which has already been released to the pool.")}a(vf,"throwOnDoubleRelease");function fr(r,e){if(e) +_Promise(t=>{this.connection.once("end",t)})}};a(pi,"Client");var lr=pi;lr.Query=ra;na.exports=lr});var ua=R((Rp,aa)=>{"use strict";p();var vf=Re().EventEmitter,sa=a(function(){},"NOOP"),oa=a((r,e)=>{ +let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),wi=class wi{constructor(e,t,n){ +this.client=e,this.idleListener=t,this.timeoutId=n}};a(wi,"IdleItem");var yi=wi,gi=class gi{constructor(e){ +this.callback=e}};a(gi,"PendingItem");var ot=gi;function Ef(){throw new Error("Release called on cli\ +ent which has already been released to the pool.")}a(Ef,"throwOnDoubleRelease");function fr(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(fr,"promisify"); -function Ef(r,e){return a(function t(n){n.client=e,e.removeListener("error",t),e.on("error",()=>{r.log( +function Af(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(Ef,"makeIdleListener");var gi=class gi extends Sf{constructor(e,t){super(),this.options= +dleListener")}a(Af,"makeIdleListener");var bi=class bi extends vf{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||Pt().Client,this.Promise= +this.log=this.options.log||function(){},this.Client=this.options.Client||t||Rt().Client,this.Promise= this.options.Promise||S.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,36 +1103,36 @@ 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=sa( +if(!this._isFull())return this.newClient(e);throw new Error("unexpected condition")}_remove(e){let t=oa( 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=fr(this.Promise,e),n=t. result;if(this._isFull()||this._idle.length){if(this._idle.length&&w.nextTick(()=>this._pulseQueue()), -!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new it(t.callback)),n;let i=a((u,c,l)=>{ -clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new it(i),o=setTimeout(()=>{sa(this._pendingQueue, +!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new ot(t.callback)),n;let i=a((u,c,l)=>{ +clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new ot(i),o=setTimeout(()=>{oa(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 it(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( -t);let n=Ef(this,t);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&& +newClient(new ot(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( +t);let n=Af(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,ia);else{if(this.log("new client connected"),this.options. +_pulseQueue(),e.timedOut||e.callback(o,void 0,sa);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 it((l,f,y)=>y()), +_expired.add(t),this._idle.findIndex(l=>l.client===t)!==-1&&this._acquireClient(t,new ot((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,ia);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ -let n=!1;return i=>{n&&vf(),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,sa);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ +let n=!1;return i=>{n&&Ef(),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 pi( +this.options.allowExitOnIdle&&s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new yi( e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=fr(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=fr(this.Promise,n);return n=i.callback,this. @@ -1143,7 +1143,7 @@ if(this.log("ending"),this.ending){let n=new Error("Called end on pool more than this.Promise.reject(n)}this.ending=!0;let t=fr(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(gi,"Pool");var yi=gi;oa.exports=yi});var ua={};ge(ua,{default:()=>Af});var Af,ca=re(()=>{"use strict";p();Af={}});var la=R((kp,_f)=>{_f.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javas\ +return this._clients.length}};a(bi,"Pool");var mi=bi;aa.exports=mi});var ca={};ge(ca,{default:()=>_f});var _f,la=re(()=>{"use strict";p();_f={}});var fa=R((Fp,Cf)=>{Cf.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 da=R((Fp,ha)=>{"use strict";p();var fa=Pe().EventEmitter,Cf=(It(),G(Ct)),bi=_t(),st=ha.exports=function(r,e,t){ -fa.call(this),r=bi.normalizeQueryConfig(r,e,t),this.text=r.text,this.values=r.values,this.name=r.name, +a178655"}});var pa=R((Mp,da)=>{"use strict";p();var ha=Re().EventEmitter,If=(Tt(),$(It)),xi=Ct(),at=da.exports=function(r,e,t){ +ha.call(this),r=xi.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))};Cf.inherits(st,fa); -var If={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ +this.on("newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};If.inherits(at,ha); +var Tf={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"\ -file",sourceLine:"line",sourceFunction:"routine"};st.prototype.handleError=function(r){var e=this.native. -pq.resultErrorFields();if(e)for(var t in e){var n=If[t]||t;r[n]=e[t]}this.callback?this.callback(r): -this.emit("error",r),this.state="error"};st.prototype.then=function(r,e){return this._getPromise().then( -r,e)};st.prototype.catch=function(r){return this._getPromise().catch(r)};st.prototype._getPromise=function(){ +file",sourceLine:"line",sourceFunction:"routine"};at.prototype.handleError=function(r){var e=this.native. +pq.resultErrorFields();if(e)for(var t in e){var n=Tf[t]||t;r[n]=e[t]}this.callback?this.callback(r): +this.emit("error",r),this.state="error"};at.prototype.then=function(r,e){return this._getPromise().then( +r,e)};at.prototype.catch=function(r){return this._getPromise().catch(r)};at.prototype._getPromise=function(){ return this._promise?this._promise:(this._promise=new Promise(function(r,e){this._once("end",r),this. -_once("error",e)}.bind(this)),this._promise)};st.prototype.submit=function(r){this.state="running";var e=this; +_once("error",e)}.bind(this)),this._promise)};at.prototype.submit=function(r){this.state="running";var e=this; this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a(function(s,o,u){if(r.native.arrayMode= !1,v(function(){e.emit("_done")}),s)return e.handleError(s);e._emitRowEvents&&(u.length>1?o.forEach( (c,l)=>{c.forEach(f=>{e.emit("row",f,u[l])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="e\ nd",e.emit("end",u),e.callback&&e.callback(null,u)},"after");if(w.domain&&(t=w.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(bi.prepareValue);if(r. +se conflicts and silent errors executing queries"));var n=(this.values||[]).map(xi.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(bi. -prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var wa=R((Op,ma)=>{"use strict";p();var Tf=(ca(),G(ua)),Pf=Zt(),Dp=la(),pa=Pe().EventEmitter,Rf=(It(),G(Ct)), -Bf=ir(),ya=da(),oe=ma.exports=function(r){pa.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. -_types=new Pf(r.types),this.native=new Tf({types:this._types}),this._queryQueue=[],this._ending=!1,this. -_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Bf(r);this. +this.values)){let s=new Error("Query values must be an array");return t(s)}var i=this.values.map(xi. +prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var ga=R((Np,wa)=>{"use strict";p();var Pf=(la(),$(ca)),Rf=Zt(),Op=fa(),ya=Re().EventEmitter,Bf=(Tt(),$(It)), +Lf=ir(),ma=pa(),oe=wa.exports=function(r){ya.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. +_types=new Rf(r.types),this.native=new Pf({types:this._types}),this._queryQueue=[],this._ending=!1,this. +_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Lf(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={}};oe.Query= -ya;Rf.inherits(oe,pa);oe.prototype._errorAllQueries=function(r){let e=a(t=>{w.nextTick(()=>{t.native= +ma;Bf.inherits(oe,ya);oe.prototype._errorAllQueries=function(r){let e=a(t=>{w.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};oe.prototype._connect=function(r){var e=this; if(this._connecting){w.nextTick(()=>r(new Error("Client has already been connected. You cannot reuse\ @@ -1194,7 +1194,7 @@ _pulseQueryQueue(!0),r()})})};oe.prototype.connect=function(r){if(r){this._conne _Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};oe.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=="f\ unction")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 ya(r,e,t),!n.callback){let c,l;i=new this. +e);else if(s=this.connectionParameters.query_timeout,n=new ma(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");w.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)=>{ @@ -1211,31 +1211,31 @@ in");return}this._activeQuery=e,e.submit(this);var t=this;e.once("_done",functio oe.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};oe.prototype.ref=function(){}; oe.prototype.unref=function(){};oe.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( -r,e,t)};oe.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var xi=R((Qp,ga)=>{"use strict";p();ga.exports=wa()});var Pt=R((Wp,Rt)=>{"use strict";p();var Lf=na(),kf=At(),Ff=fi(),Mf=aa(),{DatabaseError:Uf}=ui(),Df=a( -r=>{var e;return e=class extends Mf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),Si=a( -function(r){this.defaults=kf,this.Client=r,this.Query=this.Client.Query,this.Pool=Df(this.Client),this. -_pools=[],this.Connection=Ff,this.types=St(),this.DatabaseError=Uf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< -"u"?Rt.exports=new Si(xi()):(Rt.exports=new Si(Lf),Object.defineProperty(Rt.exports,"native",{configurable:!0, -enumerable:!1,get(){var r=null;try{r=new Si(xi())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. -defineProperty(Rt.exports,"native",{value:r}),r}}))});p();p();Ve();Ir();p();var yu=Object.defineProperty,mu=Object.defineProperties,wu=Object.getOwnPropertyDescriptors,as=Object. -getOwnPropertySymbols,gu=Object.prototype.hasOwnProperty,bu=Object.prototype.propertyIsEnumerable,us=a( -(r,e,t)=>e in r?yu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), -xu=a((r,e)=>{for(var t in e||(e={}))gu.call(e,t)&&us(r,t,e[t]);if(as)for(var t of as(e))bu.call(e,t)&& -us(r,t,e[t]);return r},"__spreadValues"),Su=a((r,e)=>mu(r,wu(e)),"__spreadProps"),vu=1008e3,cs=new Uint8Array( -new Uint16Array([258]).buffer)[0]===2,Eu=new TextDecoder,Tr=new TextEncoder,Nt=Tr.encode("0123456789\ -abcdef"),qt=Tr.encode("0123456789ABCDEF"),Au=Tr.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ -stuvwxyz0123456789+/");var ls=Au.slice();ls[62]=45;ls[63]=95;var ut,Qt;function _u(r,{alphabet:e,scratchArr:t}={}){if(!ut)if(ut= -new Uint16Array(256),Qt=new Uint16Array(256),cs)for(let C=0;C<256;C++)ut[C]=Nt[C&15]<<8|Nt[C>>>4],Qt[C]= -qt[C&15]<<8|qt[C>>>4];else for(let C=0;C<256;C++)ut[C]=Nt[C&15]|Nt[C>>>4]<<8,Qt[C]=qt[C&15]|qt[C>>>4]<< +r,e,t)};oe.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var Si=R((jp,ba)=>{"use strict";p();ba.exports=ga()});var Rt=R((Hp,Bt)=>{"use strict";p();var kf=ia(),Ff=_t(),Mf=hi(),Uf=ua(),{DatabaseError:Df}=ci(),Of=a( +r=>{var e;return e=class extends Uf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),vi=a( +function(r){this.defaults=Ff,this.Client=r,this.Query=this.Client.Query,this.Pool=Of(this.Client),this. +_pools=[],this.Connection=Mf,this.types=vt(),this.DatabaseError=Df},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< +"u"?Bt.exports=new vi(Si()):(Bt.exports=new vi(kf),Object.defineProperty(Bt.exports,"native",{configurable:!0, +enumerable:!1,get(){var r=null;try{r=new vi(Si())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. +defineProperty(Bt.exports,"native",{value:r}),r}}))});p();p();ze();Tr();p();var mu=Object.defineProperty,wu=Object.defineProperties,gu=Object.getOwnPropertyDescriptors,us=Object. +getOwnPropertySymbols,bu=Object.prototype.hasOwnProperty,xu=Object.prototype.propertyIsEnumerable,cs=a( +(r,e,t)=>e in r?mu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), +Su=a((r,e)=>{for(var t in e||(e={}))bu.call(e,t)&&cs(r,t,e[t]);if(us)for(var t of us(e))xu.call(e,t)&& +cs(r,t,e[t]);return r},"__spreadValues"),vu=a((r,e)=>wu(r,gu(e)),"__spreadProps"),Eu=1008e3,ls=new Uint8Array( +new Uint16Array([258]).buffer)[0]===2,Au=new TextDecoder,Pr=new TextEncoder,Nt=Pr.encode("0123456789\ +abcdef"),qt=Pr.encode("0123456789ABCDEF"),_u=Pr.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ +stuvwxyz0123456789+/");var fs=_u.slice();fs[62]=45;fs[63]=95;var ct,Qt;function Cu(r,{alphabet:e,scratchArr:t}={}){if(!ct)if(ct= +new Uint16Array(256),Qt=new Uint16Array(256),ls)for(let C=0;C<256;C++)ct[C]=Nt[C&15]<<8|Nt[C>>>4],Qt[C]= +qt[C&15]<<8|qt[C>>>4];else for(let C=0;C<256;C++)ct[C]=Nt[C&15]|Nt[C>>>4]<<8,Qt[C]=qt[C&15]|qt[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"?Qt:ut,f=0,y=0,g;if(cs) +r.buffer,r.byteOffset,s),c=new Uint32Array(o.buffer,o.byteOffset,i),l=e==="upper"?Qt:ct,f=0,y=0,g;if(ls) 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;ut[de(this. _mapKey.has(i)?this._mapKey.get(i):i)]=n),t}mapDecode(e,t){let n=this.decode(e);if(this._keyMap)switch(n. -constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return vs( -()=>(Dr(),this?this.decode(e,t):ft.prototype.decode.call(ps,e,t)));Ne=t>-1?t:e.length,h=0,Br=0,ht=0, -Ht=null,Rr=ws,j=null,x=e;try{ee=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ +constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return Es( +()=>(Or(),this?this.decode(e,t):ht.prototype.decode.call(ys,e,t)));Qe=t>-1?t:e.length,h=0,Lr=0,dt=0, +Ht=null,Br=gs,j=null,x=e;try{X=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ throw x=null,e instanceof Uint8Array?n:new Error("Source must be a Uint8Array or Buffer but was a "+ -(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof ft){if(B=this,ie=this.sharedValues&& +(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof ht){if(B=this,ie=this.sharedValues&& (this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this. -structures)return N=this.structures,jt();(!N||N.length>0)&&(N=[])}else B=ps,(!N||N.length>0)&&(N=[]), -ie=null;return jt()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;dt=!0;let o=this?this.decode(e, -s):Nr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=j.postBundlePosition){let e=new Error("Unexpected bundle pos\ -ition");throw e.incomplete=!0,e}h=j.postBundlePosition,j=null}if(h==Ne)N=null,x=null,he&&(he=null);else if(h> -Ne){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!dt)throw new Error( -"Data read, but end of buffer not reached");return r}catch(r){throw Dr(),(r instanceof RangeError||r. +structures)return N=this.structures,jt();(!N||N.length>0)&&(N=[])}else B=ys,(!N||N.length>0)&&(N=[]), +ie=null;return jt()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;pt=!0;let o=this?this.decode(e, +s):qr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=j.postBundlePosition){let e=new Error("Unexpected bundle pos\ +ition");throw e.incomplete=!0,e}h=j.postBundlePosition,j=null}if(h==Qe)N=null,x=null,he&&(he=null);else if(h> +Qe){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!pt)throw new Error( +"Data read, but end of buffer not reached");return r}catch(r){throw Or(),(r instanceof RangeError||r. message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a(jt,"checkedRead");function L(){ -let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return ku();r=ee. -getUint16(h),h+=2;break;case 26:if(e==7){let t=ee.getFloat32(h);if(B.useFloat32>2){let n=Es[(x[h]&127)<< -1|x[h+1]>>7];return h+=4,(n*t+(t>0?.5:-.5)>>0)/n}return h+=4,t}if(r=ee.getUint32(h),h+=4,e===1)return-1- -r;break;case 27:if(e==7){let t=ee.getFloat64(h);return h+=8,t}if(e>1){if(ee.getUint32(h)>0)throw new Error( -"JavaScript does not support arrays, maps, or strings with length over 4294967295");r=ee.getUint32(h+ -4)}else B.int64AsNumber?(r=ee.getUint32(h)*4294967296,r+=ee.getUint32(h+4)):r=ee.getBigUint64(h);h+= -8;break;case 31:switch(e){case 2:case 3:throw new Error("Indefinite length not supported for byte or\ - text strings");case 4:let t=[],n,i=0;for(;(n=L())!=Ke;){if(i>=ct)throw new Error(`Array length exce\ -eds ${ct}`);t[i++]=n}return e==4?t:e==3?t.join(""):m.concat(t);case 5:let s;if(B.mapsAsObjects){let o={}, -u=0;if(B.keyMap)for(;(s=L())!=Ke;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[de(B. -decodeKey(s))]=L()}else for(;(s=L())!=Ke;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`); -o[de(s)]=L()}return o}else{lt&&(B.mapsAsObjects=!0,lt=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s= -L())!=Ke;){if(u++>=Ae)throw new Error(`Map size exceeds ${Ae}`);o.set(B.decodeKey(s),L())}}else{let u=0; -for(;(s=L())!=Ke;){if(u++>=Ae)throw new Error(`Map size exceeds ${Ae}`);o.set(s,L())}}return o}case 7: -return Ke;default:throw new Error("Invalid major type for indefinite length "+e)}default:throw new Error( -"Unknown token "+r)}switch(e){case 0:return r;case 1:return~r;case 2:return Lu(r);case 3:if(ht>=h)return Ht. -slice(h-$t,(h+=r)-$t);if(ht==0&&Ne<140&&r<32){let i=r<16?bs(r):Bu(r);if(i!=null)return i}return Ru(r);case 4: -if(r>=ct)throw new Error(`Array length exceeds ${ct}`);let t=new Array(r);for(let i=0;i=Ae)throw new Error(`Map size exceeds ${ct}`);if(B.mapsAsObjects){let i={};if(B. -keyMap)for(let s=0;s=hs){let i=N[r&8191];if(i)return i. -read||(i.read=Fr(i)),i.read();if(r<65536){if(r==Pu){let s=Ye(),o=L(),u=L();Ur(o,u);let c={};if(B.keyMap) -for(let l=2;l23)switch(t){case 24: -t=x[h++];break;case 25:t=ee.getUint16(h),h+=2;break;case 26:t=ee.getUint32(h),h+=4;break;default:throw new Error( -"Expected array header, but got "+x[h-1])}let n=this.compiledReader;for(;n;){if(n.propertyCount===t) -return n(L);n=n.next}if(this.slowReads++>=gs){let s=this.length==t?this:this.slice(0,t);return n=B.keyMap? -new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>ys.test(o)?de(o)+":r()":"["+JSON.stringify( -o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>ys.test(o)?de(o)+":r()":"["+JSON.stringify( -o)+"]:r()").join(",")+"}"),this.compiledReader&&(n.next=this.compiledReader),n.propertyCount=t,this. -compiledReader=n,n(L)}let i={};if(B.keyMap)for(let s=0;s64&&Pr)return Pr.decode(x.subarray(h,h+=r));let t=h+ +let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return Fu();r=X. +getUint16(h),h+=2;break;case 26:if(e==7){let t=X.getFloat32(h);if(B.useFloat32>2){let n=As[(x[h]&127)<< +1|x[h+1]>>7];return h+=4,(n*t+(t>0?.5:-.5)>>0)/n}return h+=4,t}if(r=X.getUint32(h),h+=4,e===1)return-1- +r;break;case 27:if(e==7){let t=X.getFloat64(h);return h+=8,t}if(e>1){if(X.getUint32(h)>0)throw new Error( +"JavaScript does not support arrays, maps, or strings with length over 4294967295");r=X.getUint32(h+ +4)}else B.int64AsNumber?(r=X.getUint32(h)*4294967296,r+=X.getUint32(h+4)):r=X.getBigUint64(h);h+=8;break;case 31: +switch(e){case 2:case 3:throw new Error("Indefinite length not supported for byte or text strings");case 4: +let t=[],n,i=0;for(;(n=L())!=Ye;){if(i>=lt)throw new Error(`Array length exceeds ${lt}`);t[i++]=n}return e== +4?t:e==3?t.join(""):m.concat(t);case 5:let s;if(B.mapsAsObjects){let o={},u=0;if(B.keyMap)for(;(s=L())!= +Ye;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[de(B.decodeKey(s))]=L()}else for(;(s= +L())!=Ye;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[de(s)]=L()}return o}else{ft&& +(B.mapsAsObjects=!0,ft=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s=L())!=Ye;){if(u++>=Ae)throw new Error( +`Map size exceeds ${Ae}`);o.set(B.decodeKey(s),L())}}else{let u=0;for(;(s=L())!=Ye;){if(u++>=Ae)throw new Error( +`Map size exceeds ${Ae}`);o.set(s,L())}}return o}case 7:return Ye;default:throw new Error("Invalid m\ +ajor type for indefinite length "+e)}default:throw new Error("Unknown token "+r)}switch(e){case 0:return r;case 1: +return~r;case 2:return ku(r);case 3:if(dt>=h)return Ht.slice(h-$t,(h+=r)-$t);if(dt==0&&Qe<140&&r<32){ +let i=r<16?xs(r):Lu(r);if(i!=null)return i}return Bu(r);case 4:if(r>=lt)throw new Error(`Array lengt\ +h exceeds ${lt}`);let t=new Array(r);for(let i=0;i=Ae)throw new Error( +`Map size exceeds ${lt}`);if(B.mapsAsObjects){let i={};if(B.keyMap)for(let s=0;s=ds){let i=N[r&8191];if(i)return i.read||(i.read=Mr(i)),i.read();if(r<65536){if(r== +Ru){let s=Ze(),o=L(),u=L();Dr(o,u);let c={};if(B.keyMap)for(let l=2;l23)switch(t){case 24:t=x[h++];break;case 25:t=X.getUint16(h),h+=2;break;case 26:t=X.getUint32( +h),h+=4;break;default:throw new Error("Expected array header, but got "+x[h-1])}let n=this.compiledReader; +for(;n;){if(n.propertyCount===t)return n(L);n=n.next}if(this.slowReads++>=bs){let s=this.length==t?this: +this.slice(0,t);return n=B.keyMap?new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>ms.test( +o)?de(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>ms. +test(o)?de(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"),this.compiledReader&&(n.next=this. +compiledReader),n.propertyCount=t,this.compiledReader=n,n(L)}let i={};if(B.keyMap)for(let s=0;s64&&Rr)return Rr.decode(x.subarray(h,h+=r));let t=h+ r,n=[];for(e="";h=t||(x[h]& 192)!==128)n.push(65533);else{let s=x[h++]&63;n.push((i&31)<<6|s)}else if((i&240)===224){let s=h=t||(s&192)!==128||i===224&&s<160||i===237&&s>=160)n.push(65533);else if(h++,h>=t||(x[h]&192)!== @@ -1310,79 +1309,79 @@ r,n=[];for(e="";h244||h>=t||(s&192)!==128||i===240&&s<144||i===244&&s>=144)n.push(65533);else if(h++,h>= t||(x[h]&192)!==128)n.push(65533);else{let o=x[h++]&63;if(h>=t||(x[h]&192)!==128)n.push(65533);else{ let u=x[h++]&63,c=(i&7)<<18|(s&63)<<12|o<<6|u;c-=65536,n.push(c>>>10&1023|55296),n.push(56320|c&1023)}}}else -n.push(65533);n.length>=4096&&(e+=K.apply(String,n),n.length=0)}return n.length>0&&(e+=K.apply(String, -n)),e}a(Mr,"readStringJS");var K=String.fromCharCode;function Bu(r){let e=h,t=new Array(r);for(let n=0;n< -r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return K.apply(String,t)}a(Bu,"longStringInJS"); -function bs(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return K(e)}}else{ -let e=x[h++],t=x[h++];if((e&128)>0||(t&128)>0){h-=2;return}if(r<3)return K(e,t);let n=x[h++];if((n&128)> -0){h-=3;return}return K(e,t,n)}else{let e=x[h++],t=x[h++],n=x[h++],i=x[h++];if((e&128)>0||(t&128)>0|| -(n&128)>0||(i&128)>0){h-=4;return}if(r<6){if(r===4)return K(e,t,n,i);{let s=x[h++];if((s&128)>0){h-= -5;return}return K(e,t,n,i,s)}}else if(r<8){let s=x[h++],o=x[h++];if((s&128)>0||(o&128)>0){h-=6;return} -if(r<7)return K(e,t,n,i,s,o);let u=x[h++];if((u&128)>0){h-=7;return}return K(e,t,n,i,s,o,u)}else{let s=x[h++], +n.push(65533);n.length>=4096&&(e+=V.apply(String,n),n.length=0)}return n.length>0&&(e+=V.apply(String, +n)),e}a(Ur,"readStringJS");var V=String.fromCharCode;function Lu(r){let e=h,t=new Array(r);for(let n=0;n< +r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return V.apply(String,t)}a(Lu,"longStringInJS"); +function xs(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return V(e)}}else{ +let e=x[h++],t=x[h++];if((e&128)>0||(t&128)>0){h-=2;return}if(r<3)return V(e,t);let n=x[h++];if((n&128)> +0){h-=3;return}return V(e,t,n)}else{let e=x[h++],t=x[h++],n=x[h++],i=x[h++];if((e&128)>0||(t&128)>0|| +(n&128)>0||(i&128)>0){h-=4;return}if(r<6){if(r===4)return V(e,t,n,i);{let s=x[h++];if((s&128)>0){h-= +5;return}return V(e,t,n,i,s)}}else if(r<8){let s=x[h++],o=x[h++];if((s&128)>0||(o&128)>0){h-=6;return} +if(r<7)return V(e,t,n,i,s,o);let u=x[h++];if((u&128)>0){h-=7;return}return V(e,t,n,i,s,o,u)}else{let s=x[h++], o=x[h++],u=x[h++],c=x[h++];if((s&128)>0||(o&128)>0||(u&128)>0||(c&128)>0){h-=8;return}if(r<10){if(r=== -8)return K(e,t,n,i,s,o,u,c);{let l=x[h++];if((l&128)>0){h-=9;return}return K(e,t,n,i,s,o,u,c,l)}}else if(r< -12){let l=x[h++],f=x[h++];if((l&128)>0||(f&128)>0){h-=10;return}if(r<11)return K(e,t,n,i,s,o,u,c,l,f); -let y=x[h++];if((y&128)>0){h-=11;return}return K(e,t,n,i,s,o,u,c,l,f,y)}else{let l=x[h++],f=x[h++],y=x[h++], -g=x[h++];if((l&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return K(e,t, -n,i,s,o,u,c,l,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return K(e,t,n,i,s,o,u,c,l,f,y,g,E)}}else{ -let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return K(e,t,n,i,s,o,u,c,l,f,y,g, -E,C);let W=x[h++];if((W&128)>0){h-=15;return}return K(e,t,n,i,s,o,u,c,l,f,y,g,E,C,W)}}}}}a(bs,"short\ -StringInJS");function Lu(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( -h,h+=r)}a(Lu,"readBin");var xs=new Float32Array(1),Wt=new Uint8Array(xs.buffer,0,4);function ku(){let r=x[h++],e=x[h++],t=(r& +8)return V(e,t,n,i,s,o,u,c);{let l=x[h++];if((l&128)>0){h-=9;return}return V(e,t,n,i,s,o,u,c,l)}}else if(r< +12){let l=x[h++],f=x[h++];if((l&128)>0||(f&128)>0){h-=10;return}if(r<11)return V(e,t,n,i,s,o,u,c,l,f); +let y=x[h++];if((y&128)>0){h-=11;return}return V(e,t,n,i,s,o,u,c,l,f,y)}else{let l=x[h++],f=x[h++],y=x[h++], +g=x[h++];if((l&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return V(e,t, +n,i,s,o,u,c,l,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E)}}else{ +let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return V(e,t,n,i,s,o,u,c,l,f,y,g, +E,C);let W=x[h++];if((W&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E,C,W)}}}}}a(xs,"short\ +StringInJS");function ku(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( +h,h+=r)}a(ku,"readBin");var Ss=new Float32Array(1),Wt=new Uint8Array(Ss.buffer,0,4);function Fu(){let r=x[h++],e=x[h++],t=(r& 127)>>2;if(t===31)return e||r&3?NaN:r&128?-1/0:1/0;if(t===0){let n=((r&3)<<8|e)/16777216;return r&128? --n:n}return Wt[3]=r&128|(t>>1)+56,Wt[2]=(r&7)<<5|e>>3,Wt[1]=e<<5,Wt[0]=0,xs[0]}a(ku,"getFloat16");var sh=new Array( -4096);var qr=class qr{constructor(e,t){this.value=e,this.tag=t}};a(qr,"Tag");var Je=qr;q[0]=r=>new Date(r); +-n:n}return Wt[3]=r&128|(t>>1)+56,Wt[2]=(r&7)<<5|e>>3,Wt[1]=e<<5,Wt[0]=0,Ss[0]}a(Fu,"getFloat16");var oh=new Array( +4096);var Qr=class Qr{constructor(e,t){this.value=e,this.tag=t}};a(Qr,"Tag");var Xe=Qr;q[0]=r=>new Date(r); q[1]=r=>new Date(Math.round(r*1e3));q[2]=r=>{let e=BigInt(0);for(let t=0,n=r.byteLength;tBigInt(-1)-q[2](r);q[4]=r=>+(r[1]+"e"+r[0]);q[5]=r=>r[1]*Math. -exp(r[0]*Math.log(2));var Ur=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. -restoreStructures=[]))[r]=t),N[r]=e,e.read=Fr(e)},"recordDefinition");q[Iu]=r=>{let e=r.length,t=r[1]; -Ur(r[0],t);let n={};for(let i=2;ij?j[0].slice( -j.position0,j.position0+=r):new Je(r,14);q[15]=r=>j?j[1].slice(j.position1,j.position1+=r):new Je(r, -15);var Fu={Error,RegExp};q[27]=r=>(Fu[r[0]]||Error)(r[1],r[2]);var Ss=a(r=>{if(x[h++]!=132){let t=new Error( +exp(r[0]*Math.log(2));var Dr=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. +restoreStructures=[]))[r]=t),N[r]=e,e.read=Mr(e)},"recordDefinition");q[Tu]=r=>{let e=r.length,t=r[1]; +Dr(r[0],t);let n={};for(let i=2;ij?j[0].slice( +j.position0,j.position0+=r):new Xe(r,14);q[15]=r=>j?j[1].slice(j.position1,j.position1+=r):new Xe(r, +15);var Mu={Error,RegExp};q[27]=r=>(Mu[r[0]]||Error)(r[1],r[2]);var vs=a(r=>{if(x[h++]!=132){let t=new Error( "Packed values structure must be followed by a 4 element array");throw x.length{if(!ie)if(B.getShared)Or();else return new Je( -r,ds);if(typeof r=="number")return ie[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ +r(),r()},"packedTable");vs.handlesRead=!0;q[51]=vs;q[ps]=r=>{if(!ie)if(B.getShared)Nr();else return new Xe( +r,ps);if(typeof r=="number")return ie[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ ger packed references yet");throw r===void 0&&(e.incomplete=!0),e};q[28]=r=>{he||(he=new Map,he.id=0); let e=he.id++,t=h,n=x[h],i;n>>5==4?i=[]:i={};let s={target:i};he.set(e,s);let o=r();return s.used?(Object. getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(h=t,i=o,he.set(e,{target:i}),o=r()),Object.assign(i,o)): (s.target=o,o)};q[28].handlesRead=!0;q[29]=r=>{let e=he.get(r);return e.used=!0,e.target};q[258]=r=>new Set( -r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,lt=!0),r())).handlesRead=!0;function ze(r,e){return typeof r== -"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(ze,"combine");function Oe(){if(!ie) -if(B.getShared)Or();else throw new Error("No packed values available");return ie}a(Oe,"getPackedValu\ -es");var Mu=1399353956;Lr.push((r,e)=>{if(r>=225&&r<=255)return ze(Oe().prefixes[r-224],e);if(r>=28704&& -r<=32767)return ze(Oe().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return ze(Oe().prefixes[r- -1879048192],e);if(r>=216&&r<=223)return ze(e,Oe().suffixes[r-216]);if(r>=27647&&r<=28671)return ze(e, -Oe().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return ze(e,Oe().suffixes[r-1811939328]);if(r== -Mu)return{packedValues:ie,structures:N.slice(0),version:e};if(r==55799)return e});var Uu=new Uint8Array( -new Uint16Array([1]).buffer)[0]==1,ms=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> +r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,ft=!0),r())).handlesRead=!0;function Je(r,e){return typeof r== +"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Je,"combine");function qe(){if(!ie) +if(B.getShared)Nr();else throw new Error("No packed values available");return ie}a(qe,"getPackedValu\ +es");var Uu=1399353956;kr.push((r,e)=>{if(r>=225&&r<=255)return Je(qe().prefixes[r-224],e);if(r>=28704&& +r<=32767)return Je(qe().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return Je(qe().prefixes[r- +1879048192],e);if(r>=216&&r<=223)return Je(e,qe().suffixes[r-216]);if(r>=27647&&r<=28671)return Je(e, +qe().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return Je(e,qe().suffixes[r-1811939328]);if(r== +Uu)return{packedValues:ie,structures:N.slice(0),version:e};if(r==55799)return e});var Du=new Uint8Array( +new Uint16Array([1]).buffer)[0]==1,ws=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> "u"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"? -{name:"BigInt64Array"}:BigInt64Array,Float32Array,Float64Array],Du=[64,68,69,70,71,72,77,78,79,85,86]; -for(let r=0;r{if(!r)throw new Error("Could not find typed array for code "+e); +2:n==8?3:0;q[i?e:e-4]=n==1||i==Du?o=>{if(!r)throw new Error("Could not find typed array for code "+e); return!B.copyBuffers&&(n===1||n===2&&!(o.byteOffset&1)||n===4&&!(o.byteOffset&3)||n===8&&!(o.byteOffset& 7))?new r(o.buffer,o.byteOffset,o.byteLength>>s):new r(Uint8Array.prototype.slice.call(o,0).buffer)}: o=>{if(!r)throw new Error("Could not find typed array for code "+e);let u=new DataView(o.buffer,o.byteOffset, o.byteLength),c=o.length>>s,l=new r(c),f=u[t];for(let y=0;y23)switch(r){case 24:r=x[h++];break;case 25:r=ee.getUint16( -h),h+=2;break;case 26:r=ee.getUint32(h),h+=4;break}return r}a(Ye,"readJustLength");function Or(){if(B. -getShared){let r=vs(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ie= -B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(Or, -"loadShared");function vs(r){let e=Ne,t=h,n=Br,i=$t,s=ht,o=Ht,u=Rr,c=he,l=j,f=new Uint8Array(x.slice( -0,Ne)),y=N,g=B,E=dt,C=r();return Ne=e,h=t,Br=n,$t=i,ht=s,Ht=o,Rr=u,he=c,j=l,x=f,dt=E,N=y,B=g,ee=new DataView( -x.buffer,x.byteOffset,x.byteLength),C}a(vs,"saveState");function Dr(){x=null,he=null,N=null}a(Dr,"cl\ -earSource");var Es=new Array(147);for(let r=0;r<256;r++)Es[r]=+("1e"+Math.floor(45.15-r*.30103));var Nr=new kr({ -useRecords:!1}),oh=Nr.decode,As=Nr.decodeMultiple;p();var Gt=class Gt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ +Nu,"registerTypedArray");function qu(){let r=Ze(),e=h+L();for(let n=2;n23)switch(r){case 24:r=x[h++];break;case 25:r=X.getUint16( +h),h+=2;break;case 26:r=X.getUint32(h),h+=4;break}return r}a(Ze,"readJustLength");function Nr(){if(B. +getShared){let r=Es(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ie= +B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(Nr, +"loadShared");function Es(r){let e=Qe,t=h,n=Lr,i=$t,s=dt,o=Ht,u=Br,c=he,l=j,f=new Uint8Array(x.slice( +0,Qe)),y=N,g=B,E=pt,C=r();return Qe=e,h=t,Lr=n,$t=i,dt=s,Ht=o,Br=u,he=c,j=l,x=f,pt=E,N=y,B=g,X=new DataView( +x.buffer,x.byteOffset,x.byteLength),C}a(Es,"saveState");function Or(){x=null,he=null,N=null}a(Or,"cl\ +earSource");var As=new Array(147);for(let r=0;r<256;r++)As[r]=+("1e"+Math.floor(45.15-r*.30103));var qr=new Fr({ +useRecords:!1}),ah=qr.decode,_s=qr.decodeMultiple;p();var Gt=class Gt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ let{strings:t,values:n}=this;for(let i=0,s=t.length;iu.length!==0).map(u=>JSON.parse(u)):As(new Uint8Array(await r.arrayBuffer())),n=t.at(-1); -if(n?.type!=="end")throw new ye("Neon internal error: streamed response ended without a terminal mes\ -sage");if(n.status==="error")throw lo(n.error);if(n.status!=="ok")throw new ye("Neon internal error:\ - unexpected streamed response status");let i,s,o=[];for(let u of t.slice(0,-1))switch(u.type){case"c\ -olumns":i=u.columns;break;case"row":o.push(u.row);break;case"query":s=u.query;break;default:throw new ye( -"Neon internal error: unexpected streamed response message")}if(!Array.isArray(i)||s===void 0)throw new ye( -"Neon internal error: incomplete streamed response");return{fields:i,rows:o,command:s.command,rowCount:s. -rowCount}}a(Kc,"readStreamingResult");function zc(r){return r instanceof m?"\\x"+fs(r):r}a(zc,"encod\ -eBuffersAsBytea");function oo(r){let{query:e,params:t}=r instanceof pt?r.toParameterizedQuery():r;return{ -query:e,params:t.map(n=>zc((0,co.prepareValue)(n)))}}a(oo,"prepareQuery");function fo(r,{arrayMode:e, +function fo(r){let e=new ee(r.message);for(let t of Vc)e[t]=r[t]??void 0;return e}a(fo,"dbError");async function zc(r,e,t){ +let n=e==="jsonl"?(await r.text()).split(` +`).filter(u=>u.length!==0).map(u=>JSON.parse(u)):_s(new Uint8Array(await r.arrayBuffer())),i=n.at(-1); +if(i?.type!=="end")throw new ee("Neon internal error: streamed response ended without a terminal mes\ +sage");if(i.status==="error")throw fo(i.error);if(i.status!=="ok")throw new ee("Neon internal error:\ + unexpected streamed response status");let s=[],o;for(let u of n.slice(0,-1))switch(u.type){case"col\ +umns":if(o!==void 0||!Array.isArray(u.columns))throw new ee("Neon internal error: unexpected streame\ +d response message");o={fields:u.columns,rows:[]};break;case"row":if(o===void 0||!Array.isArray(u.row)) +throw new ee("Neon internal error: unexpected streamed response message");o.rows.push(u.row);break;case"\ +query":if(o===void 0||u.query===void 0)throw new ee("Neon internal error: unexpected streamed respon\ +se message");s.push({fields:o.fields,rows:o.rows,command:u.query.command,rowCount:u.query.rowCount}), +o=void 0;break;default:throw new ee("Neon internal error: unexpected streamed response message")}if(o!== +void 0||!t&&s.length!==1)throw new ee("Neon internal error: incomplete streamed response");return t? +{results:s}:s[0]}a(zc,"readStreamingResult");function Yc(r){return r instanceof m?"\\x"+hs(r):r}a(Yc, +"encodeBuffersAsBytea");function ao(r){let{query:e,params:t}=r instanceof yt?r.toParameterizedQuery(): +r;return{query:e,params:t.map(n=>Yc((0,lo.prepareValue)(n)))}}a(ao,"prepareQuery");function ho(r,{arrayMode:e, fullResults:t,fetchOptions:n,responseFormat:i,isolationLevel:s,readOnly:o,deferrable:u,authToken:c,disableWarningInBrowsers:l}={}){ if(!r)throw new Error("No database connection string was provided to `neon()`. Perhaps an environmen\ -t variable has not been set?");let f;try{f=Cr(r)}catch{throw new Error("Database connection string p\ +t variable has not been set?");let f;try{f=Ir(r)}catch{throw new Error("Database connection string p\ rovided to `neon()` is not a valid URL. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E, port:C,pathname:W}=f;if(y!=="postgres:"&&y!=="postgresql:"||!g||!E||!W)throw new Error("Database con\ -nection string format for `neon()` should be: postgresql://user@host.tld/dbname?option=value");function J(T,...b){ +nection string format for `neon()` should be: postgresql://user@host.tld/dbname?option=value");function Y(T,...b){ if(!(Array.isArray(T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can no\ w be called only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], \ options). For a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SE\ -LECT $1", [value], options).');return new qe(we,new pt(T,b))}a(J,"templateFn"),J.query=(T,b,k)=>new qe( -we,{query:T,params:b??[]},k),J.unsafe=T=>new yt(T),J.transaction=async(T,b)=>{if(typeof T=="function"&& -(T=T(J)),!Array.isArray(T))throw new Error(so);T.forEach(H=>{if(!(H instanceof qe))throw new Error(so)}); -let k=T.map(H=>H.queryData),ae=T.map(H=>H.opts??{});return we(k,ae,b)};async function we(T,b,k){let{ -fetchEndpoint:ae,fetchFunction:H}=Se,Ce=Array.isArray(T)?{queries:T.map($=>oo($))}:oo(T),le=n??{},ue=i?? -"json",M=e??!1,Z=t??!1,ve=s,Ie=o,Le=u;if(k!==void 0&&(k.fetchOptions!==void 0&&(le={...le,...k.fetchOptions}), -k.arrayMode!==void 0&&(M=k.arrayMode),k.fullResults!==void 0&&(Z=k.fullResults),k.responseFormat!==void 0&& -(ue=k.responseFormat),k.isolationLevel!==void 0&&(ve=k.isolationLevel),k.readOnly!==void 0&&(Ie=k.readOnly), -k.deferrable!==void 0&&(Le=k.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!==void 0&&(le= -{...le,...b.fetchOptions}),b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(ue=b.responseFormat), -Array.isArray(T)&&ue!=="json")throw new Error("`jsonl` and `cbor-seq` response formats do not suppor\ -t transactions");let ke=c;!Array.isArray(b)&&b?.authToken!==void 0&&(ke=b.authToken);let ot=typeof ae== -"function"?ae(E,C,{jwtAuth:ke!==void 0}):ae,Fe={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ -rue","Neon-Array-Mode":"true",Accept:Vc[ue]},kt=await Yc(ke);kt&&(Fe.Authorization=`Bearer ${kt}`),Array. -isArray(T)&&(ve!==void 0&&(Fe["Neon-Batch-Isolation-Level"]=ve),Ie!==void 0&&(Fe["Neon-Batch-Read-On\ -ly"]=String(Ie)),Le!==void 0&&(Fe["Neon-Batch-Deferrable"]=String(Le))),l||Se.disableWarningInBrowsers|| -Vt();let ce;try{ce=await(H??fetch)(ot,{method:"POST",body:JSON.stringify(Ce),headers:Fe,...le})}catch($){ -let X=new ye(`Error connecting to database: ${$}`);throw X.sourceError=$,X}if(ce.ok){let $=ue==="jso\ -n"?await ce.json():await Kc(ce,ue);if(Array.isArray(T)){let X=$.results;if(!Array.isArray(X))throw new ye( -"Neon internal error: unexpected result format");return X.map((hr,dr)=>{let pr=b[dr]??{},va=pr.arrayMode?? -M,Ea=pr.fullResults??Z;return ao(hr,{arrayMode:va,fullResults:Ea,types:pr.types})})}else{let X=b??{}, -hr=X.arrayMode??M,dr=X.fullResults??Z;return ao($,{arrayMode:hr,fullResults:dr,types:X.types})}}else{ -let{status:$}=ce;if($===400){let X=await ce.json();throw lo(X)}else{let X=await ce.text();throw new ye( -`Server error (HTTP status ${$}): ${X}`)}}}return a(we,"execute"),J}a(fo,"neon");var rn=class rn{constructor(e,t,n){ +LECT $1", [value], options).');return new je(me,new yt(T,b))}a(Y,"templateFn"),Y.query=(T,b,F)=>new je( +me,{query:T,params:b??[]},F),Y.unsafe=T=>new mt(T),Y.transaction=async(T,b)=>{if(typeof T=="function"&& +(T=T(Y)),!Array.isArray(T))throw new Error(oo);T.forEach(H=>{if(!(H instanceof je))throw new Error(oo)}); +let F=T.map(H=>H.queryData),ae=T.map(H=>H.opts??{});return me(F,ae,b)};async function me(T,b,F){let{ +fetchEndpoint:ae,fetchFunction:H}=Se,we=Array.isArray(T),Ce=we?{queries:T.map(le=>ao(le))}:ao(T),ce=n?? +{},k=i??"json",J=e??!1,ve=t??!1,Ie=s,ke=o,Fe=u;F!==void 0&&(F.fetchOptions!==void 0&&(ce={...ce,...F. +fetchOptions}),F.arrayMode!==void 0&&(J=F.arrayMode),F.fullResults!==void 0&&(ve=F.fullResults),F.responseFormat!== +void 0&&(k=F.responseFormat),F.isolationLevel!==void 0&&(Ie=F.isolationLevel),F.readOnly!==void 0&&(ke= +F.readOnly),F.deferrable!==void 0&&(Fe=F.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!== +void 0&&(ce={...ce,...b.fetchOptions}),b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(k= +b.responseFormat);let Me=c;!Array.isArray(b)&&b?.authToken!==void 0&&(Me=b.authToken);let hr=typeof ae== +"function"?ae(E,C,{jwtAuth:Me!==void 0}):ae,Ue={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ +rue","Neon-Array-Mode":"true",Accept:Kc[k]},Te=await Jc(Me);Te&&(Ue.Authorization=`Bearer ${Te}`),we&& +(Ie!==void 0&&(Ue["Neon-Batch-Isolation-Level"]=Ie),ke!==void 0&&(Ue["Neon-Batch-Read-Only"]=String( +ke)),Fe!==void 0&&(Ue["Neon-Batch-Deferrable"]=String(Fe))),l||Se.disableWarningInBrowsers||Vt();let Z; +try{Z=await(H??fetch)(hr,{method:"POST",body:JSON.stringify(Ce),headers:Ue,...ce})}catch(le){let ue=new ee( +`Error connecting to database: ${le}`);throw ue.sourceError=le,ue}if(Z.ok){let le=k==="json"?await Z. +json():await zc(Z,k,we);if(we){let ue=le.results;if(!Array.isArray(ue))throw new ee("Neon internal e\ +rror: unexpected result format");return ue.map((dr,pr)=>{let yr=b[pr]??{},Ea=yr.arrayMode??J,Aa=yr.fullResults?? +ve;return uo(dr,{arrayMode:Ea,fullResults:Aa,types:yr.types})})}else{let ue=b??{},dr=ue.arrayMode??J, +pr=ue.fullResults??ve;return uo(le,{arrayMode:dr,fullResults:pr,types:ue.types})}}else{let{status:le}=Z; +if(le===400){let ue=await Z.json();throw fo(ue)}else{let ue=await Z.text();throw new ee(`Server erro\ +r (HTTP status ${le}): ${ue}`)}}}return a(me,"execute"),Y}a(ho,"neon");var nn=class nn{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(rn,"NeonQueryPromise");var qe=rn;function ao(r,{arrayMode:e, -fullResults:t,types:n}){let i=new uo.default(n),s=r.fields.map(c=>c.name),o=r.fields.map(c=>i.getTypeParser( +this.queryData,this.opts).finally(e)}};a(nn,"NeonQueryPromise");var je=nn;function uo(r,{arrayMode:e, +fullResults:t,types:n}){let i=new co.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(ao,"processQueryResult");async function Yc(r){if(typeof r=="string")return r;if(typeof r== -"function")try{return await Promise.resolve(r())}catch(e){let t=new ye("Error getting auth token."); -throw e instanceof Error&&(t=new ye(`Error getting auth token: ${e.message}`)),t}}a(Yc,"getAuthToken");p();var xa=Me(Pt());p();var ba=Me(Pt());var vi=class vi extends ba.Client{constructor(t){super(t);this.config=t}get neonConfig(){return this. +o,r._types=i,r):u}a(uo,"processQueryResult");async function Jc(r){if(typeof r=="string")return r;if(typeof r== +"function")try{return await Promise.resolve(r())}catch(e){let t=new ee("Error getting auth token."); +throw e instanceof Error&&(t=new ee(`Error getting auth token: ${e.message}`)),t}}a(Jc,"getAuthToken");p();var Sa=De(Rt());p();var xa=De(Rt());var Ei=class Ei extends xa.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\ @@ -1480,40 +1482,40 @@ Vt(),this._handleAuthCleartextPassword(),this._handleReadyForQuery()})}return o} 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(ce=>{if(!/^.=/.test(ce))throw new Error( -"SASL: Invalid attribute pair entry");let $=ce[0],X=ce.substring(2);return[$,X]})),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: protocol error");let u=Object.fromEntries(o.split(",").map(Te=>{if(!/^.=/.test(Te))throw new Error( +"SASL: Invalid attribute pair entry");let Z=Te[0],le=Te.substring(2);return[Z,le]})),c=u.r,l=u.s,f=u. +i;if(!c||!/^[!-+--~]+$/.test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unp\ +rintable");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=m.from(l,"base64"),E=new TextEncoder,C=E.encode(s),W=await n.importKey( -"raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),J=new Uint8Array(await n.sign("HMAC",W,m.concat( -[g,m.from([0,0,0,1])]))),we=J;for(var T=0;Twe[$]^J[$]));let b=we,k=await n.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-2\ -56"}},!1,["sign"]),ae=new Uint8Array(await n.sign("HMAC",k,E.encode("Client Key"))),H=await n.digest( -"SHA-256",ae),Ce="n=*,r="+i.clientNonce,le="r="+c+",s="+l+",i="+y,ue="c=biws,r="+c,M=Ce+","+le+","+ue, -Z=await n.importKey("raw",H,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var ve=new Uint8Array(await n. -sign("HMAC",Z,E.encode(M))),Ie=m.from(ae.map((ce,$)=>ae[$]^ve[$])),Le=Ie.toString("base64");let ke=await n. -importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),ot=await n.sign("HMAC",ke,E.encode( -"Server Key")),Fe=await n.importKey("raw",ot,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var kt=m. -from(await n.sign("HMAC",Fe,E.encode(M)));i.message="SASLResponse",i.serverSignature=kt.toString("ba\ -se64"),i.response=ue+",p="+Le,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; -a(vi,"NeonClient");var Bt=vi;Ve();var Sa=Me(ir());function Of(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(Of,"promisify");var Ai=class Ai extends xa.Pool{constructor(){ -super(...arguments);I(this,"Client",Bt);I(this,"hasFetchUnsupportedListeners",!1);I(this,"addListene\ +"raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Y=new Uint8Array(await n.sign("HMAC",W,m.concat( +[g,m.from([0,0,0,1])]))),me=Y;for(var T=0;Tme[Z]^Y[Z]));let b=me,F=await n.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-2\ +56"}},!1,["sign"]),ae=new Uint8Array(await n.sign("HMAC",F,E.encode("Client Key"))),H=await n.digest( +"SHA-256",ae),we="n=*,r="+i.clientNonce,Ce="r="+c+",s="+l+",i="+y,ce="c=biws,r="+c,k=we+","+Ce+","+ce, +J=await n.importKey("raw",H,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var ve=new Uint8Array(await n. +sign("HMAC",J,E.encode(k))),Ie=m.from(ae.map((Te,Z)=>ae[Z]^ve[Z])),ke=Ie.toString("base64");let Fe=await n. +importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Me=await n.sign("HMAC",Fe,E.encode( +"Server Key")),hr=await n.importKey("raw",Me,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Ue=m. +from(await n.sign("HMAC",hr,E.encode(k)));i.message="SASLResponse",i.serverSignature=Ue.toString("ba\ +se64"),i.response=ce+",p="+ke,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; +a(Ei,"NeonClient");var Lt=Ei;ze();var va=De(ir());function Nf(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(Nf,"promisify");var _i=class _i extends Sa.Pool{constructor(){ +super(...arguments);I(this,"Client",Lt);I(this,"hasFetchUnsupportedListeners",!1);I(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=Of(this.Promise,i);i=s.callback;try{let o=new Sa.default( +t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=Nf(this.Promise,i);i=s.callback;try{let o=new va.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??[];fo(l,{fullResults:!0,arrayMode:t. +/${c(o.database)}`,f=typeof t=="string"?t:t.text,y=n??t.values??[];ho(l,{fullResults:!0,arrayMode:t. rowMode==="array"}).query(f,y,{types:t.types??this.options?.types}).then(E=>i(void 0,E)).catch(E=>i( -E))}catch(o){i(o)}return s.result}};a(Ai,"NeonPool");var Ei=Ai;Ve();var Lt=Me(Pt()),n0="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{Bt as Client,export_DatabaseError as DatabaseError, -ye as NeonDbError,qe as NeonQueryPromise,Ei as Pool,pt as SqlTemplate,yt as UnsafeRawSql,n0 as _bundleExt, +E))}catch(o){i(o)}return s.result}};a(_i,"NeonPool");var Ai=_i;ze();var kt=De(Rt()),i0="mjs";var export_DatabaseError=kt.DatabaseError;var export_defaults=kt.defaults;var export_escapeIdentifier=kt.escapeIdentifier; +var export_escapeLiteral=kt.escapeLiteral;var export_types=kt.types;export{Lt as Client,export_DatabaseError as DatabaseError, +ee as NeonDbError,je as NeonQueryPromise,Ai as Pool,yt as SqlTemplate,mt as UnsafeRawSql,i0 as _bundleExt, export_defaults as defaults,export_escapeIdentifier as escapeIdentifier,export_escapeLiteral as escapeLiteral, -fo as neon,Se as neonConfig,export_types as types,Vt as warnIfBrowser}; +ho as neon,Se as neonConfig,export_types as types,Vt as warnIfBrowser}; /*! Bundled license information: ieee754/index.js: diff --git a/src/httpQuery.ts b/src/httpQuery.ts index 7b8b41a..31562bb 100644 --- a/src/httpQuery.ts +++ b/src/httpQuery.ts @@ -109,6 +109,7 @@ function dbError(error: any) { async function readStreamingResult( response: Response, responseFormat: Exclude, + batch: boolean, ) { const messages = responseFormat === 'jsonl' @@ -131,19 +132,39 @@ async function readStreamingResult( ); } - let fields; - let query; - const rows = []; + const results = []; + let current: { fields: any[]; rows: any[] } | undefined; for (const message of messages.slice(0, -1)) { switch (message.type) { case 'columns': - fields = message.columns; + if (current !== undefined || !Array.isArray(message.columns)) { + throw new NeonDbError( + 'Neon internal error: unexpected streamed response message', + ); + } + current = { fields: message.columns, rows: [] }; break; case 'row': - rows.push(message.row); + if (current === undefined || !Array.isArray(message.row)) { + throw new NeonDbError( + 'Neon internal error: unexpected streamed response message', + ); + } + current.rows.push(message.row); break; case 'query': - query = message.query; + if (current === undefined || message.query === undefined) { + throw new NeonDbError( + 'Neon internal error: unexpected streamed response message', + ); + } + results.push({ + fields: current.fields, + rows: current.rows, + command: message.query.command, + rowCount: message.query.rowCount, + }); + current = undefined; break; default: throw new NeonDbError( @@ -152,16 +173,11 @@ async function readStreamingResult( } } - if (!Array.isArray(fields) || query === undefined) { + if (current !== undefined || (!batch && results.length !== 1)) { throw new NeonDbError('Neon internal error: incomplete streamed response'); } - return { - fields, - rows, - command: query.command, - rowCount: query.rowCount, - }; + return batch ? { results } : results[0]; } function encodeBuffersAsBytea(value: unknown): unknown { @@ -361,8 +377,9 @@ export function neon< txnOpts?: HTTPTransactionOptions, ) { const { fetchEndpoint, fetchFunction } = Socket; + const isBatch = Array.isArray(queryData); - const bodyData = Array.isArray(queryData) + const bodyData = isBatch ? { queries: queryData.map((queryDatum) => prepareQuery(queryDatum)) } : prepareQuery(queryData); @@ -415,12 +432,6 @@ export function neon< resolvedResponseFormat = allSqlOpts.responseFormat; } - if (Array.isArray(queryData) && resolvedResponseFormat !== 'json') { - throw new Error( - '`jsonl` and `cbor-seq` response formats do not support transactions', - ); - } - // --- resolve auth token usage --- let resolvedAuthToken = authToken; if (!Array.isArray(allSqlOpts) && allSqlOpts?.authToken !== undefined) { @@ -449,7 +460,7 @@ export function neon< headers['Authorization'] = `Bearer ${validAuthToken}`; } - if (Array.isArray(queryData)) { + if (isBatch) { // only send these headers for batch queries, where they matter if (resolvedIsolationLevel !== undefined) headers['Neon-Batch-Isolation-Level'] = resolvedIsolationLevel; @@ -485,9 +496,13 @@ export function neon< const rawResults = resolvedResponseFormat === 'json' ? ((await response.json()) as any) - : await readStreamingResult(response, resolvedResponseFormat); + : await readStreamingResult( + response, + resolvedResponseFormat, + isBatch, + ); - if (Array.isArray(queryData)) { + if (isBatch) { // batch query const resultArray = rawResults.results; if (!Array.isArray(resultArray)) diff --git a/src/httpTypes.ts b/src/httpTypes.ts index 9e4ee65..34e8308 100644 --- a/src/httpTypes.ts +++ b/src/httpTypes.ts @@ -57,8 +57,6 @@ export interface HTTPQueryOptions< /** * Wire format requested from the SQL-over-HTTP endpoint. * - * `jsonl` and `cbor-seq` are currently supported only for single queries. - * * Default: `json` */ responseFormat?: HTTPResponseFormat; diff --git a/tests/cli/httpStreaming.test.ts b/tests/cli/httpStreaming.test.ts index bdc4ced..120a27f 100644 --- a/tests/cli/httpStreaming.test.ts +++ b/tests/cli/httpStreaming.test.ts @@ -16,6 +16,18 @@ const fields = [ }, ]; +const labelFields = [ + { + name: 'label', + dataTypeID: 25, + tableID: 0, + columnID: 0, + dataTypeSize: -1, + dataTypeModifier: -1, + format: 'text', + }, +]; + const successMessages = [ { type: 'columns', columns: fields }, { type: 'row', row: ['42'] }, @@ -23,6 +35,18 @@ const successMessages = [ { type: 'end', status: 'ok' }, ]; +const batchMessages = [ + { type: 'columns', columns: fields }, + { type: 'row', row: ['42'] }, + { type: 'row', row: ['43'] }, + { type: 'query', query: { command: 'SELECT', rowCount: 2 } }, + { type: 'columns', columns: labelFields }, + { type: 'row', row: ['hello'] }, + { type: 'row', row: ['world'] }, + { type: 'query', query: { command: 'SELECT', rowCount: 2 } }, + { type: 'end', status: 'ok' }, +]; + let previousFetchEndpoint: typeof neonConfig.fetchEndpoint; let previousFetchFunction: typeof neonConfig.fetchFunction; @@ -180,9 +204,28 @@ test.each([ }, ); -test('keeps transactions on the JSON protocol', async () => { - const sql = neon(connectionString, { responseFormat: 'jsonl' }); - await expect(sql.transaction([sql`SELECT 1`])).rejects.toThrow( - 'response formats do not support transactions', - ); -}); +test.each([ + { + responseFormat: 'jsonl' as const, + accept: 'application/vnd.neon.sql.v1+json', + body: batchMessages.map((message) => JSON.stringify(message)).join('\n'), + }, + { + responseFormat: 'cbor-seq' as const, + accept: 'application/vnd.neon.sql.v1+cbor', + body: cborSequence(batchMessages), + }, +])( + 'decodes $responseFormat transactions', + async ({ responseFormat, accept, body }) => { + mockResponse(body, accept); + + const sql = neon(connectionString, { responseFormat }); + await expect( + sql.transaction([sql`SELECT 42 AS answer`, sql`SELECT 'hello' AS label`]), + ).resolves.toStrictEqual([ + [{ answer: 42 }, { answer: 43 }], + [{ label: 'hello' }, { label: 'world' }], + ]); + }, +); From 5058eeb34eb63c9c8a57c90954fd9922afda2cd1 Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Wed, 19 Aug 2026 07:53:30 +0100 Subject: [PATCH 3/7] Decode compact SQL streaming messages --- index.js | 1372 +++++++++++++++---------------- index.mjs | 1353 +++++++++++++++--------------- src/httpQuery.ts | 65 +- tests/cli/httpStreaming.test.ts | 33 +- 4 files changed, 1411 insertions(+), 1412 deletions(-) diff --git a/index.js b/index.js index 77289f4..05b048d 100644 --- a/index.js +++ b/index.js @@ -1,71 +1,71 @@ -"use strict";var _a=Object.create;var He=Object.defineProperty;var Ca=Object.getOwnPropertyDescriptor;var Ia=Object.getOwnPropertyNames;var Ta=Object.getPrototypeOf,Pa=Object.prototype.hasOwnProperty;var Ra=(r,e,t)=>e in r?He(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>He(r,"name",{value:e,configurable:!0});var re=(r,e)=>()=>(r&&(e=r(r=0)),e);var R=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fe=(r,e)=>{for(var t in e)He(r,t,{get:e[t], -enumerable:!0})},Ii=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ia(e))!Pa. -call(r,i)&&i!==t&&He(r,i,{get:()=>e[i],enumerable:!(n=Ca(e,i))||n.enumerable});return r};var Ne=(r,e,t)=>(t=r!=null?_a(Ta(r)):{},Ii(e||!r||!r.__esModule?He(t,"default",{value:r,enumerable:!0}): -t,r)),j=r=>Ii(He({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Ra(r,typeof e!="symbol"?e+"":e,t);var Ri=R(Mt=>{"use strict";p();Mt.byteLength=La;Mt.toByteArray=Fa;Mt.fromByteArray=Da;var xe=[],he=[], -Ba=typeof Uint8Array<"u"?Uint8Array:Array,wr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ -23456789+/";for(qe=0,Ti=wr.length;qee in r?He(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>He(r,"name",{value:e,configurable:!0});var te=(r,e)=>()=>(r&&(e=r(r=0)),e);var P=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fe=(r,e)=>{for(var t in e)He(r,t,{get:e[t], +enumerable:!0})},Ti=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ta(e))!Pa. +call(r,i)&&i!==t&&He(r,i,{get:()=>e[i],enumerable:!(n=Ia(e,i))||n.enumerable});return r};var Ne=(r,e,t)=>(t=r!=null?Ca(Ra(r)):{},Ti(e||!r||!r.__esModule?He(t,"default",{value:r,enumerable:!0}): +t,r)),j=r=>Ti(He({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Ba(r,typeof e!="symbol"?e+"":e,t);var Bi=P(Ut=>{"use strict";p();Ut.byteLength=Fa;Ut.toByteArray=ka;Ut.fromByteArray=Oa;var xe=[],he=[], +La=typeof Uint8Array<"u"?Uint8Array:Array,gr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ +23456789+/";for(qe=0,Ri=gr.length;qe0)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(Pi,"getLens"); -function La(r){var e=Pi(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(La,"byteLength");function ka(r,e,t){return(e+ -t)*3/4-t}a(ka,"_byteLength");function Fa(r){var e,t=Pi(r),n=t[0],i=t[1],s=new Ba(ka(r,n,i)),o=0,u=i> +function Fa(r){var e=Pi(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Fa,"byteLength");function Ma(r,e,t){return(e+ +t)*3/4-t}a(Ma,"_byteLength");function ka(r){var e,t=Pi(r),n=t[0],i=t[1],s=new La(Ma(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=he[r.charCodeAt( c)]<<2|he[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=he[r.charCodeAt(c)]<<10|he[r.charCodeAt(c+1)]<< -4|he[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(Fa,"toByteArray");function Ma(r){return xe[r>> -18&63]+xe[r>>12&63]+xe[r>>6&63]+xe[r&63]}a(Ma,"tripletToBase64");function Ua(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(Ma(n));return i.join("")}a(Ua,"en\ -codeChunk");function Da(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(ka,"toByteArray");function Ua(r){return xe[r>> +18&63]+xe[r>>12&63]+xe[r>>6&63]+xe[r&63]}a(Ua,"tripletToBase64");function Da(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(Ua(n));return i.join("")}a(Da,"en\ +codeChunk");function Oa(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(xe[e>>2]+xe[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1], -i.push(xe[e>>10]+xe[e>>4&63]+xe[e<<2&63]+"=")),i.join("")}a(Da,"fromByteArray")});var Bi=R(gr=>{p();gr.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(xe[e>>10]+xe[e>>4&63]+xe[e<<2&63]+"=")),i.join("")}a(Oa,"fromByteArray")});var Li=P(br=>{p();br.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,E=r[e+y];for(y+=g,s=E&(1<<-f)-1,E>>=-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:(E?-1:1)*(1/0);o=o+Math. -pow(2,n),s=s-l}return(E?-1:1)*o*Math.pow(2,s-n)};gr.write=function(r,e,t,n,i,s){var o,u,c,l=s*8-i-1, +pow(2,n),s=s-l}return(E?-1:1)*o*Math.pow(2,s-n)};br.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,E=n?0:s-1,C=n?1:-1,H=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+E]=u&255,E+= -C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=H*128}});var Ki=R(Ke=>{"use strict";p();var br=Ri(),Ge=Bi(),Li=typeof Symbol=="function"&&typeof Symbol.for== -"function"?Symbol.for("nodejs.util.inspect.custom"):null;Ke.Buffer=d;Ke.SlowBuffer=Wa;Ke.INSPECT_MAX_BYTES= -50;var Ut=2147483647;Ke.kMaxLength=Ut;d.TYPED_ARRAY_SUPPORT=Oa();!d.TYPED_ARRAY_SUPPORT&&typeof console< +C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=H*128}});var zi=P(Ke=>{"use strict";p();var xr=Bi(),Ge=Li(),Fi=typeof Symbol=="function"&&typeof Symbol.for== +"function"?Symbol.for("nodejs.util.inspect.custom"):null;Ke.Buffer=d;Ke.SlowBuffer=Ha;Ke.INSPECT_MAX_BYTES= +50;var Dt=2147483647;Ke.kMaxLength=Dt;d.TYPED_ARRAY_SUPPORT=Na();!d.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 Oa(){ +pport which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Na(){ 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(Oa,"typedArraySupport");Object. +prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}a(Na,"typedArraySupport");Object. defineProperty(d.prototype,"parent",{enumerable:!0,get:a(function(){if(d.isBuffer(this))return this. buffer},"get")});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:a(function(){if(d.isBuffer( -this))return this.byteOffset},"get")});function Ae(r){if(r>Ut)throw new RangeError('The value "'+r+'\ +this))return this.byteOffset},"get")});function Ae(r){if(r>Dt)throw new RangeError('The value "'+r+'\ " is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,d.prototype), e}a(Ae,"createBuffer");function d(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 Er(r)}return Ui(r,e,t)} -a(d,"Buffer");d.poolSize=8192;function Ui(r,e,t){if(typeof r=="string")return qa(r,e);if(ArrayBuffer. -isView(r))return Qa(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 Ar(r)}return Di(r,e,t)} +a(d,"Buffer");d.poolSize=8192;function Di(r,e,t){if(typeof r=="string")return Qa(r,e);if(ArrayBuffer. +isView(r))return ja(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(Se(r,ArrayBuffer)|| r&&Se(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Se(r,SharedArrayBuffer)||r&&Se(r.buffer, -SharedArrayBuffer)))return Sr(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument\ +SharedArrayBuffer)))return vr(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 d. -from(n,e,t);let i=ja(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. +from(n,e,t);let i=Wa(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. toPrimitive]=="function")return d.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(Ui,"from");d.from=function(r,e,t){return Ui(r,e,t)};Object.setPrototypeOf(d.prototype, -Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Di(r){if(typeof r!="number")throw new TypeError( +ed type "+typeof r)}a(Di,"from");d.from=function(r,e,t){return Di(r,e,t)};Object.setPrototypeOf(d.prototype, +Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Oi(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(Di,"assertSize");function Na(r,e,t){return Di(r),r<=0?Ae(r):e!==void 0?typeof t== -"string"?Ae(r).fill(e,t):Ae(r).fill(e):Ae(r)}a(Na,"alloc");d.alloc=function(r,e,t){return Na(r,e,t)}; -function Er(r){return Di(r),Ae(r<0?0:Ar(r)|0)}a(Er,"allocUnsafe");d.allocUnsafe=function(r){return Er( -r)};d.allocUnsafeSlow=function(r){return Er(r)};function qa(r,e){if((typeof e!="string"||e==="")&&(e= -"utf8"),!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=Oi(r,e)|0,n=Ae(t),i=n.write( -r,e);return i!==t&&(n=n.slice(0,i)),n}a(qa,"fromString");function xr(r){let e=r.length<0?0:Ar(r.length)| -0,t=Ae(e);for(let n=0;n=Ut)throw new RangeError("Attempt to allocate Buffer larger t\ -han maximum size: 0x"+Ut.toString(16)+" bytes");return r|0}a(Ar,"checked");function Wa(r){return+r!= -r&&(r=0),d.alloc(+r)}a(Wa,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== +r,e,t),Object.setPrototypeOf(n,d.prototype),n}a(vr,"fromArrayBuffer");function Wa(r){if(d.isBuffer(r)){ +let e=_r(r.length)|0,t=Ae(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r. +length!="number"||Ir(r.length)?Ae(0):Sr(r);if(r.type==="Buffer"&&Array.isArray(r.data))return Sr(r.data)} +a(Wa,"fromObject");function _r(r){if(r>=Dt)throw new RangeError("Attempt to allocate Buffer larger t\ +han maximum size: 0x"+Dt.toString(16)+" bytes");return r|0}a(_r,"checked");function Ha(r){return+r!= +r&&(r=0),d.alloc(+r)}a(Ha,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== d.prototype},"isBuffer");d.compare=a(function(e,t){if(Se(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)), Se(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.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");d.concat=a(function(e,t){if( for(t=0,n=0;ni.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(i,s)):Uint8Array.prototype. set.call(i,o,s);else if(d.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 Oi(r,e){if(d.isBuffer(r))return r.length; +an Array of Buffers');s+=o.length}return i},"concat");function Ni(r,e){if(d.isBuffer(r))return r.length; if(ArrayBuffer.isView(r)||Se(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 vr(r).length;case"ucs2":case"\ -ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Vi(r).length;default: -if(i)return n?-1:vr(r).length;e=(""+e).toLowerCase(),i=!0}}a(Oi,"byteLength");d.byteLength=Oi;function Ha(r,e,t){ +ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Er(r).length;case"ucs2":case"\ +ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ki(r).length;default: +if(i)return n?-1:Er(r).length;e=(""+e).toLowerCase(),i=!0}}a(Ni,"byteLength");d.byteLength=Ni;function $a(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 eu(this,e,t);case"u\ -tf8":case"utf-8":return qi(this,e,t);case"ascii":return Za(this,e,t);case"latin1":case"binary":return Xa( -this,e,t);case"base64":return Ya(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tu( -this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(Ha, +0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return tu(this,e,t);case"u\ +tf8":case"utf-8":return Qi(this,e,t);case"ascii":return Xa(this,e,t);case"latin1":case"binary":return eu( +this,e,t);case"base64":return Ja(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ru( +this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a($a, "slowToString");d.prototype._isBuffer=!0;function Qe(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(Qe,"swap"); d.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");Li&&(d.prototype[Li]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ +er "+e+">"},"inspect");Fi&&(d.prototype[Fi]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ if(Se(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.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,Cr(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r. +compare");function qi(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,Ir(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=d.from( -e,n)),d.isBuffer(e))return e.length===0?-1:ki(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array. +e,n)),d.isBuffer(e))return e.length===0?-1:Mi(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):ki(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Ni,"bidire\ -ctionalIndexOf");function ki(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):Mi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(qi,"bidire\ +ctionalIndexOf");function Mi(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 $a(this,e,t,n);case"utf8":case"\ -utf-8":return Ga(this,e,t,n);case"ascii":case"latin1":case"binary":return Va(this,e,t,n);case"base64": -return Ka(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return za(this,e,t,n);default: +fer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return Ga(this,e,t,n);case"utf8":case"\ +utf-8":return Va(this,e,t,n);case"ascii":case"latin1":case"binary":return Ka(this,e,t,n);case"base64": +return za(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ya(this,e,t,n);default: if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"write");d.prototype. toJSON=a(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSO\ -N");function Ya(r,e,t){return e===0&&t===r.length?br.fromByteArray(r):br.fromByteArray(r.slice(e,t))} -a(Ya,"base64Slice");function qi(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 Ja(n)}a(qi,"utf8Slice");var Fi=4096;function Ja(r){let e=r.length;if(e<=Fi)return String. +n.push(o),i+=u}return Za(n)}a(Qi,"utf8Slice");var ki=4096;function Za(r){let e=r.length;if(e<=ki)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,d.prototype),i},"slice");function G(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 \ @@ -165,10 +165,10 @@ a(function(e,t){return e=e>>>0,t||G(e,2,this.length),this[e]<<8|this[e+1]},"read readUint32LE=d.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),(this[e]| this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");d.prototype.readUint32BE=d.prototype. readUInt32BE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+ -2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Re(a(function(e){e=e>>>0,Ve(e,"offset"); +2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Pe(a(function(e){e=e>>>0,Ve(e,"offset"); let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ht(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* 2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<< -BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Re(a(function(e){e=e>>>0,Ve(e,"offset"); +BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Pe(a(function(e){e=e>>>0,Ve(e,"offset"); let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ht(e,this.length-8);let i=t*2**24+this[++e]*2**16+ this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<>>0,t=t>>>0,n||G(e,t, @@ -182,63 +182,63 @@ a(function(e,t){e=e>>>0,t||G(e,2,this.length);let n=this[e+1]|this[e]<<8;return n},"readInt16BE");d.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]| this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");d.prototype.readInt32BE=a(function(e,t){return e= e>>>0,t||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");d.prototype. -readBigInt64LE=Re(a(function(e){e=e>>>0,Ve(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& +readBigInt64LE=Pe(a(function(e){e=e>>>0,Ve(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& ht(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,Ve(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ht(e,this. +Pe(a(function(e){e=e>>>0,Ve(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ht(e,this. length-8);let i=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,t||G(e,4,this.length),Ge.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= a(function(e,t){return e=e>>>0,t||G(e,4,this.length),Ge.read(this,e,!1,23,4)},"readFloatBE");d.prototype. readDoubleLE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ge.read(this,e,!0,52,8)},"readDoub\ leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ge.read(this,e, -!1,52,8)},"readDoubleBE");function ne(r,e,t,n,i,s){if(!d.isBuffer(r))throw new TypeError('"buffer" a\ +!1,52,8)},"readDoubleBE");function re(r,e,t,n,i,s){if(!d.isBuffer(r))throw new TypeError('"buffer" a\ rgument must be a Buffer instance');if(e>i||er.length)throw new RangeError("Index out of range")}a(ne,"checkInt");d.prototype.writeUintLE= -d.prototype.writeUIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;ne(this, +nds');if(t+n>r.length)throw new RangeError("Index out of range")}a(re,"checkInt");d.prototype.writeUintLE= +d.prototype.writeUIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;re(this, e,t,n,u,0)}let s=1,o=0;for(this[t]=e&255;++o>>0,n=n>>>0,!i){let u=Math. -pow(2,8*n)-1;ne(this,e,t,n,u,0)}let s=n-1,o=1;for(this[t+s]=e&255;--s>=0&&(o*=256);)this[t+s]=e/o&255; +pow(2,8*n)-1;re(this,e,t,n,u,0)}let s=n-1,o=1;for(this[t+s]=e&255;--s>=0&&(o*=256);)this[t+s]=e/o&255; return t+n},"writeUIntBE");d.prototype.writeUint8=d.prototype.writeUInt8=a(function(e,t,n){return e= -+e,t=t>>>0,n||ne(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");d.prototype.writeUint16LE=d.prototype. -writeUInt16LE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(this,e,t,2,65535,0),this[t]=e&255,this[t+1]= ++e,t=t>>>0,n||re(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");d.prototype.writeUint16LE=d.prototype. +writeUInt16LE=a(function(e,t,n){return e=+e,t=t>>>0,n||re(this,e,t,2,65535,0),this[t]=e&255,this[t+1]= e>>>8,t+2},"writeUInt16LE");d.prototype.writeUint16BE=d.prototype.writeUInt16BE=a(function(e,t,n){return e= -+e,t=t>>>0,n||ne(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");d.prototype. -writeUint32LE=d.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(this,e,t,4,4294967295, ++e,t=t>>>0,n||re(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");d.prototype. +writeUint32LE=d.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||re(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");d.prototype. -writeUint32BE=d.prototype.writeUInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(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 Qi(r,e,t,n,i){ -Gi(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++]= +writeUint32BE=d.prototype.writeUInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||re(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 ji(r,e,t,n,i){ +Vi(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(Qi,"wrtBigUInt64LE");function ji(r,e,t,n,i){Gi(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295)); +8,r[t++]=o,t}a(ji,"wrtBigUInt64LE");function Wi(r,e,t,n,i){Vi(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(ji,"wrtBigUInt64BE");d.prototype. -writeBigUInt64LE=Re(a(function(e,t=0){return Qi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ -riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Re(a(function(e,t=0){return ji(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(Wi,"wrtBigUInt64BE");d.prototype. +writeBigUInt64LE=Pe(a(function(e,t=0){return ji(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ +riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Pe(a(function(e,t=0){return Wi(this,e,t,BigInt(0),BigInt( "0xffffffffffffffff"))},"writeBigUInt64BE"));d.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>> -0,!i){let c=Math.pow(2,8*n-1);ne(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");d.prototype.writeIntBE= -a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*n-1);ne(this,e,t,n,c-1,-c)}let s=n-1,o=1, +a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*n-1);re(this,e,t,n,c-1,-c)}let s=n-1,o=1, u=0;for(this[t+s]=e&255;--s>=0&&(o*=256);)e<0&&u===0&&this[t+s+1]!==0&&(u=1),this[t+s]=(e/o>>0)-u&255; -return t+n},"writeIntBE");d.prototype.writeInt8=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(this,e,t, +return t+n},"writeIntBE");d.prototype.writeInt8=a(function(e,t,n){return e=+e,t=t>>>0,n||re(this,e,t, 1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");d.prototype.writeInt16LE=a(function(e,t,n){ -return e=+e,t=t>>>0,n||ne(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeInt16LE"); -d.prototype.writeInt16BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(this,e,t,2,32767,-32768),this[t]= +return e=+e,t=t>>>0,n||re(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeInt16LE"); +d.prototype.writeInt16BE=a(function(e,t,n){return e=+e,t=t>>>0,n||re(this,e,t,2,32767,-32768),this[t]= e>>>8,this[t+1]=e&255,t+2},"writeInt16BE");d.prototype.writeInt32LE=a(function(e,t,n){return e=+e,t= -t>>>0,n||ne(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+ -3]=e>>>24,t+4},"writeInt32LE");d.prototype.writeInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne( +t>>>0,n||re(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+ +3]=e>>>24,t+4},"writeInt32LE");d.prototype.writeInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||re( 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");d.prototype.writeBigInt64LE=Re(a(function(e,t=0){return Qi( +e>>>8,this[t+3]=e&255,t+4},"writeInt32BE");d.prototype.writeBigInt64LE=Pe(a(function(e,t=0){return ji( this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));d.prototype. -writeBigInt64BE=Re(a(function(e,t=0){return ji(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ -ffffffffffff"))},"writeBigInt64BE"));function Wi(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(Wi,"checkIEEE754");function Hi(r,e,t,n,i){ -return e=+e,t=t>>>0,i||Wi(r,e,t,4,34028234663852886e22,-34028234663852886e22),Ge.write(r,e,t,n,23,4), -t+4}a(Hi,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return Hi(this,e,t,!0,n)},"writeFl\ -oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return Hi(this,e,t,!1,n)},"writeFloatBE");function $i(r,e,t,n,i){ -return e=+e,t=t>>>0,i||Wi(r,e,t,8,17976931348623157e292,-17976931348623157e292),Ge.write(r,e,t,n,52, -8),t+8}a($i,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return $i(this,e,t,!0,n)},"wr\ -iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return $i(this,e,t,!1,n)},"writeDoubleBE"); +writeBigInt64BE=Pe(a(function(e,t=0){return Wi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ +ffffffffffff"))},"writeBigInt64BE"));function Hi(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(Hi,"checkIEEE754");function $i(r,e,t,n,i){ +return e=+e,t=t>>>0,i||Hi(r,e,t,4,34028234663852886e22,-34028234663852886e22),Ge.write(r,e,t,n,23,4), +t+4}a($i,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return $i(this,e,t,!0,n)},"writeFl\ +oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return $i(this,e,t,!1,n)},"writeFloatBE");function Gi(r,e,t,n,i){ +return e=+e,t=t>>>0,i||Hi(r,e,t,8,17976931348623157e292,-17976931348623157e292),Ge.write(r,e,t,n,52, +8),t+8}a(Gi,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return Gi(this,e,t,!0,n)},"wr\ +iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return Gi(this,e,t,!1,n)},"writeDoubleBE"); d.prototype.copy=a(function(e,t,n,i){if(!d.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=Mi(String(t)):typeof t=="bigint"&&(i=String( -t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Mi(i)),i+="n"),n+=` It must be ${e}. Re\ -ceived ${i}`,n},RangeError);function Mi(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(Mi,"addNumericalSeparator");function ru(r,e,t){ -Ve(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&ht(e,r.length-(t+1))}a(ru,"checkBounds");function Gi(r,e,t,n,i,s){ +e ${typeof e}`},TypeError);Cr("ERR_OUT_OF_RANGE",function(r,e,t){let n=`The value of "${r}" is out o\ +f range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=Ui(String(t)):typeof t=="bigint"&&(i=String( +t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Ui(i)),i+="n"),n+=` It must be ${e}. Re\ +ceived ${i}`,n},RangeError);function Ui(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(Ui,"addNumericalSeparator");function nu(r,e,t){ +Ve(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&ht(e,r.length-(t+1))}a(nu,"checkBounds");function Vi(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 $e.ERR_OUT_OF_RANGE("value",u,r)}ru(n,i,s)}a(Gi,"checkIntBI");function Ve(r,e){if(typeof r!= +nd <= ${t}${o}`,new $e.ERR_OUT_OF_RANGE("value",u,r)}nu(n,i,s)}a(Vi,"checkIntBI");function Ve(r,e){if(typeof r!= "number")throw new $e.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Ve,"validateNumber");function ht(r,e,t){throw Math. floor(r)!==r?(Ve(r,t),new $e.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new $e.ERR_BUFFER_OUT_OF_BOUNDS: -new $e.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(ht,"boundsError");var nu=/[^+/0-9A-Za-z-_]/g; -function iu(r){if(r=r.split("=")[0],r=r.trim().replace(nu,""),r.length<2)return"";for(;r.length%4!== -0;)r=r+"=";return r}a(iu,"base64clean");function vr(r,e){e=e||1/0;let t,n=r.length,i=null,s=[];for(let o=0;o< +new $e.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(ht,"boundsError");var iu=/[^+/0-9A-Za-z-_]/g; +function su(r){if(r=r.split("=")[0],r=r.trim().replace(iu,""),r.length<2)return"";for(;r.length%4!== +0;)r=r+"=";return r}a(su,"base64clean");function Er(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(vr,"utf\ -8ToBytes");function su(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(ou,"utf16leToBytes");function Vi(r){return br.toByteArray( -iu(r))}a(Vi,"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 Se(r,e){return r instanceof e||r!=null&&r.constructor!= -null&&r.constructor.name!=null&&r.constructor.name===e.name}a(Se,"isInstance");function Cr(r){return r!== -r}a(Cr,"numberIsNaN");var au=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 Re(r){return typeof BigInt>"u"? -uu:r}a(Re,"defineBigIntMethod");function uu(){throw new Error("BigInt not supported")}a(uu,"BufferBi\ -gIntNotDefined")});var S,v,A,m,w,p=re(()=>{"use strict";S=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),A= +240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}a(Er,"utf\ +8ToBytes");function ou(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(au,"utf16leToBytes");function Ki(r){return xr.toByteArray( +su(r))}a(Ki,"base64ToBytes");function Ot(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) +e[i+t]=r[i];return i}a(Ot,"blitBuffer");function Se(r,e){return r instanceof e||r!=null&&r.constructor!= +null&&r.constructor.name!=null&&r.constructor.name===e.name}a(Se,"isInstance");function Ir(r){return r!== +r}a(Ir,"numberIsNaN");var uu=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 Pe(r){return typeof BigInt>"u"? +cu:r}a(Pe,"defineBigIntMethod");function cu(){throw new Error("BigInt not supported")}a(cu,"BufferBi\ +gIntNotDefined")});var S,v,A,m,w,p=te(()=>{"use strict";S=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),A= globalThis.clearImmediate??(r=>clearTimeout(r)),m=typeof globalThis.Buffer=="function"&&typeof globalThis. -Buffer.allocUnsafe=="function"?globalThis.Buffer:Ki().Buffer,w=globalThis.process??{};w.env??(w.env= -{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Be=R((Zf,Ir)=>{"use strict";p();var ze=typeof Reflect=="object"?Reflect:null,zi=ze&&typeof ze.apply== -"function"?ze.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Ot; -ze&&typeof ze.ownKeys=="function"?Ot=ze.ownKeys:Object.getOwnPropertySymbols?Ot=a(function(e){return Object. -getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Ot=a(function(e){return Object. -getOwnPropertyNames(e)},"ReflectOwnKeys");function cu(r){console&&console.warn&&console.warn(r)}a(cu, -"ProcessEmitWarning");var Ji=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function M(){M. -init.call(this)}a(M,"EventEmitter");Ir.exports=M;Ir.exports.once=du;M.EventEmitter=M;M.prototype._events= -void 0;M.prototype._eventsCount=0;M.prototype._maxListeners=void 0;var Yi=10;function Nt(r){if(typeof r!= +Buffer.allocUnsafe=="function"?globalThis.Buffer:zi().Buffer,w=globalThis.process??{};w.env??(w.env= +{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Be=P((rh,Tr)=>{"use strict";p();var ze=typeof Reflect=="object"?Reflect:null,Yi=ze&&typeof ze.apply== +"function"?ze.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Nt; +ze&&typeof ze.ownKeys=="function"?Nt=ze.ownKeys:Object.getOwnPropertySymbols?Nt=a(function(e){return Object. +getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Nt=a(function(e){return Object. +getOwnPropertyNames(e)},"ReflectOwnKeys");function lu(r){console&&console.warn&&console.warn(r)}a(lu, +"ProcessEmitWarning");var Zi=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function k(){k. +init.call(this)}a(k,"EventEmitter");Tr.exports=k;Tr.exports.once=pu;k.EventEmitter=k;k.prototype._events= +void 0;k.prototype._eventsCount=0;k.prototype._maxListeners=void 0;var Ji=10;function qt(r){if(typeof r!= "function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)} -a(Nt,"checkListener");Object.defineProperty(M,"defaultMaxListeners",{enumerable:!0,get:a(function(){ -return Yi},"get"),set:a(function(r){if(typeof r!="number"||r<0||Ji(r))throw new RangeError('The valu\ -e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Yi=r}, -"set")});M.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&& +a(qt,"checkListener");Object.defineProperty(k,"defaultMaxListeners",{enumerable:!0,get:a(function(){ +return Ji},"get"),set:a(function(r){if(typeof r!="number"||r<0||Zi(r))throw new RangeError('The valu\ +e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Ji=r}, +"set")});k.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}; -M.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||Ji(e))throw new RangeError('Th\ +k.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||Zi(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 Zi(r){return r._maxListeners===void 0?M.defaultMaxListeners:r._maxListeners} -a(Zi,"_getMaxListeners");M.prototype.getMaxListeners=a(function(){return Zi(this)},"getMaxListeners"); -M.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")zi(c,this,t);else for(var l=c. -length,f=ns(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=Xi(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,cu(u)}return r}a(Xi,"_addListener");M.prototype.addListener=a(function(e,t){ -return Xi(this,e,t,!1)},"addListener");M.prototype.on=M.prototype.addListener;M.prototype.prependListener= -a(function(e,t){return Xi(this,e,t,!0)},"prependListener");function lu(){if(!this.fired)return this. +r,u.type=e,u.count=o.length,lu(u)}return r}a(es,"_addListener");k.prototype.addListener=a(function(e,t){ +return es(this,e,t,!1)},"addListener");k.prototype.on=k.prototype.addListener;k.prototype.prependListener= +a(function(e,t){return es(this,e,t,!0)},"prependListener");function fu(){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(lu,"onceWrapper");function es(r,e,t){var n={fired:!1, -wrapFn:void 0,target:r,type:e,listener:t},i=lu.bind(n);return i.listener=t,n.wrapFn=i,i}a(es,"_onceW\ -rap");M.prototype.once=a(function(e,t){return Nt(t),this.on(e,es(this,e,t)),this},"once");M.prototype. -prependOnceListener=a(function(e,t){return Nt(t),this.prependListener(e,es(this,e,t)),this},"prepend\ -OnceListener");M.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(Nt(t),i=this._events,i=== +target):this.listener.apply(this.target,arguments)}a(fu,"onceWrapper");function ts(r,e,t){var n={fired:!1, +wrapFn:void 0,target:r,type:e,listener:t},i=fu.bind(n);return i.listener=t,n.wrapFn=i,i}a(ts,"_onceW\ +rap");k.prototype.once=a(function(e,t){return qt(t),this.on(e,ts(this,e,t)),this},"once");k.prototype. +prependOnceListener=a(function(e,t){return qt(t),this.prependListener(e,ts(this,e,t)),this},"prepend\ +OnceListener");k.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(qt(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():fu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== -void 0&&this.emit("removeListener",e,u||t)}return this},"removeListener");M.prototype.off=M.prototype. -removeListener;M.prototype.removeAllListeners=a(function(e){var t,n,i;if(n=this._events,n===void 0)return this; +listener,s=o;break}if(s<0)return this;s===0?n.shift():hu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== +void 0&&this.emit("removeListener",e,u||t)}return this},"removeListener");k.prototype.off=k.prototype. +removeListener;k.prototype.removeAllListeners=a(function(e){var t,n,i;if(n=this._events,n===void 0)return this; if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount= 0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments. length===0){var s=Object.keys(n),o;for(i=0;i= -0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function ts(r,e,t){var n=r._events; +0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function rs(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? -hu(i):ns(i,i.length)}a(ts,"_listeners");M.prototype.listeners=a(function(e){return ts(this,e,!0)},"l\ -isteners");M.prototype.rawListeners=a(function(e){return ts(this,e,!1)},"rawListeners");M.listenerCount= -function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):rs.call(r,e)};M.prototype. -listenerCount=rs;function rs(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(rs,"listenerCount");M.prototype.eventNames=a(function(){ -return this._eventsCount>0?Ot(this._events):[]},"eventNames");function ns(r,e){for(var t=new Array(e), -n=0;n0?Nt(this._events):[]},"eventNames");function is(r,e){for(var t=new Array(e), +n=0;nbe,isIP:()=>yu});function yu(r){return 0}var os,ss,_,be,Ye=re(()=>{"use \ -strict";p();os=Ne(Be(),1);a(yu,"isIP");ss=/^[^.]+\./,_=class _ extends os.EventEmitter{constructor(){ +ust be of type EventEmitter. Received type '+typeof r)}a(ss,"eventTargetAgnosticAddListener")});var us={};fe(us,{Socket:()=>be,isIP:()=>mu});function mu(r){return 0}var as,os,_,be,Ye=te(()=>{"use \ +strict";p();as=Ne(Be(),1);a(mu,"isIP");os=/^[^.]+\./,_=class _ extends as.EventEmitter{constructor(){ super(...arguments);I(this,"opts",{});I(this,"connecting",!1);I(this,"pending",!0);I(this,"writable", !0);I(this,"encrypted",!1);I(this,"authorized",!1);I(this,"destroyed",!1);I(this,"ws",null);I(this,"\ writeBuffer");I(this,"tlsState",0);I(this,"tlsRead");I(this,"tlsWrite")}static get poolQueryViaFetch(){ @@ -423,102 +423,102 @@ 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=m.alloc(0),n="utf8",i=()=>{}){return this.write(t,n,()=>{this. ws.close(),i()}),this}destroy(){return this.destroyed=!0,this.end()}};a(_,"Socket"),I(_,"defaults",{ -poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{let s;return i?.jwtAuth?s=t.replace(ss,"apiauth."):s= -t.replace(ss,"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(os,"apiauth."):s= +t.replace(os,"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}),I(_,"opts",{});be=_});var us={};fe(us,{parse:()=>Tr});function Tr(r,e=!1){let{protocol:t}=new URL(r),n="http:"+r.substring( +disableWarningInBrowsers:!1}),I(_,"opts",{});be=_});var cs={};fe(cs,{parse:()=>Rr});function Rr(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 E=i+":"+s,C=e?Object. fromEntries(y.entries()):f;return{href:r,protocol:t,auth:E,username:i,password:s,host:o,hostname:u,port:c, -pathname:l,search:f,query:C,hash:g}}var Pr=re(()=>{"use strict";p();a(Tr,"parse")});var $r=R(Is=>{"use strict";p();Is.parse=function(r,e){return new Hr(r,e).parse()};var Kt=class Kt{constructor(e,t){ -this.source=e,this.transform=t||Qu,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){ +pathname:l,search:f,query:C,hash:g}}var Pr=te(()=>{"use strict";p();a(Rr,"parse")});var Gr=P(Ts=>{"use strict";p();Ts.parse=function(r,e){return new $r(r,e).parse()};var zt=class zt{constructor(e,t){ +this.source=e,this.transform=t||ju,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 Kt(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse( +dimension>1&&(n=new zt(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(Kt,"ArrayParser");var Hr=Kt;function Qu(r){return r}a(Qu,"ide\ -ntity")});var Gr=R((Eh,Ts)=>{p();var ju=$r();Ts.exports={create:a(function(r,e){return{parse:a(function(){return ju. -parse(r,e)},"parse")}},"create")}});var Bs=R((Ch,Rs)=>{"use strict";p();var Wu=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, -Hu=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,$u=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Gu=/^-?infinity$/;Rs. -exports=a(function(e){if(Gu.test(e))return Number(e.replace("i","I"));var t=Wu.exec(e);if(!t)return Vu( +not balanced");return this.entries}};a(zt,"ArrayParser");var $r=zt;function ju(r){return r}a(ju,"ide\ +ntity")});var Vr=P((Ih,Rs)=>{p();var Wu=Gr();Rs.exports={create:a(function(r,e){return{parse:a(function(){return Wu. +parse(r,e)},"parse")}},"create")}});var Ls=P((Ph,Bs)=>{"use strict";p();var Hu=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, +$u=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Gu=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Vu=/^-?infinity$/;Bs. +exports=a(function(e){if(Vu.test(e))return Number(e.replace("i","I"));var t=Hu.exec(e);if(!t)return Ku( e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Ps(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=Ku(e);return g!=null? -(y=new Date(Date.UTC(i,s,o,u,c,l,f)),Vr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= -new Date(i,s,o,u,c,l,f),Vr(i)&&y.setFullYear(i)),y},"parseDate");function Vu(r){var e=Hu.exec(r);if(e){ -var t=parseInt(e[1],10),n=!!e[4];n&&(t=Ps(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return Vr( -t)&&o.setFullYear(t),o}}a(Vu,"getDate");function Ku(r){if(r.endsWith("+00"))return 0;var e=$u.exec(r. +10),c=parseInt(t[5],10),l=parseInt(t[6],10),f=t[7];f=f?1e3*parseFloat(f):0;var y,g=zu(e);return g!=null? +(y=new Date(Date.UTC(i,s,o,u,c,l,f)),Kr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= +new Date(i,s,o,u,c,l,f),Kr(i)&&y.setFullYear(i)),y},"parseDate");function Ku(r){var e=$u.exec(r);if(e){ +var t=parseInt(e[1],10),n=!!e[4];n&&(t=Ps(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return Kr( +t)&&o.setFullYear(t),o}}a(Ku,"getDate");function zu(r){if(r.endsWith("+00"))return 0;var e=Gu.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(Ku,"timeZoneOffset");function Ps(r){return-(r- -1)}a(Ps,"bcYearToNegativeYear");function Vr(r){return r>=0&&r<100}a(Vr,"is0To99")});var ks=R((Ph,Ls)=>{p();Ls.exports=Yu;var zu=Object.prototype.hasOwnProperty;function Yu(r){for(var e=1;e< -arguments.length;e++){var t=arguments[e];for(var n in t)zu.call(t,n)&&(r[n]=t[n])}return r}a(Yu,"ext\ -end")});var Us=R((Lh,Ms)=>{"use strict";p();var Ju=ks();Ms.exports=nt;function nt(r){if(!(this instanceof nt)) -return new nt(r);Ju(this,cc(r))}a(nt,"PostgresInterval");var Zu=["seconds","minutes","hours","days", -"months","years"];nt.prototype.toPostgres=function(){var r=Zu.filter(this.hasOwnProperty,this);return this. +e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(zu,"timeZoneOffset");function Ps(r){return-(r- +1)}a(Ps,"bcYearToNegativeYear");function Kr(r){return r>=0&&r<100}a(Kr,"is0To99")});var Ms=P((Fh,Fs)=>{p();Fs.exports=Ju;var Yu=Object.prototype.hasOwnProperty;function Ju(r){for(var e=1;e< +arguments.length;e++){var t=arguments[e];for(var n in t)Yu.call(t,n)&&(r[n]=t[n])}return r}a(Ju,"ext\ +end")});var Ds=P((Uh,Us)=>{"use strict";p();var Zu=Ms();Us.exports=nt;function nt(r){if(!(this instanceof nt)) +return new nt(r);Zu(this,lc(r))}a(nt,"PostgresInterval");var Xu=["seconds","minutes","hours","days", +"months","years"];nt.prototype.toPostgres=function(){var r=Xu.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 Xu={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ -S"},ec=["years","months","days"],tc=["hours","minutes","seconds"];nt.prototype.toISOString=nt.prototype. -toISO=function(){var r=ec.map(t,this).join(""),e=tc.map(t,this).join("");return"P"+r+"T"+e;function t(n){ +"")),t+" "+e},this).join(" ")};var ec={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ +S"},tc=["years","months","days"],rc=["hours","minutes","seconds"];nt.prototype.toISOString=nt.prototype. +toISO=function(){var r=tc.map(t,this).join(""),e=rc.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+Xu[n]}};var Kr="([+-]?\\d+)",rc=Kr+"\\s+years?",nc=Kr+"\\s+mons?",ic=Kr+"\\s+days?",sc="\ -([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",oc=new RegExp([rc,nc,ic,sc].map(function(r){return"\ -("+r+")?"}).join("\\s*")),Fs={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, -ac=["hours","minutes","seconds","milliseconds"];function uc(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}a(uc,"parseMilliseconds");function cc(r){if(!r)return{};var e=oc.exec(r),t=e[8]==="-";return Object. -keys(Fs).reduce(function(n,i){var s=Fs[i],o=e[s];return!o||(o=i==="milliseconds"?uc(o):parseInt(o,10), -!o)||(t&&~ac.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(cc,"parse")});var Os=R((Mh,Ds)=>{"use strict";p();Ds.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( +/0+$/,"")),i+ec[n]}};var zr="([+-]?\\d+)",nc=zr+"\\s+years?",ic=zr+"\\s+mons?",sc=zr+"\\s+days?",oc="\ +([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",ac=new RegExp([nc,ic,sc,oc].map(function(r){return"\ +("+r+")?"}).join("\\s*")),ks={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, +uc=["hours","minutes","seconds","milliseconds"];function cc(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(cc,"parseMilliseconds");function lc(r){if(!r)return{};var e=ac.exec(r),t=e[8]==="-";return Object. +keys(ks).reduce(function(n,i){var s=ks[i],o=e[s];return!o||(o=i==="milliseconds"?cc(o):parseInt(o,10), +!o)||(t&&~uc.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(lc,"parse")});var Ns=P((Nh,Os)=>{"use strict";p();Os.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( 2),"hex");for(var t="",n=0;n{p();var xt=$r(),St=Gr(),zt=Bs(),qs=Us(),Qs=Os();function Yt(r){return a(function(t){ -return t===null?t:r(t)},"nullAllowed")}a(Yt,"allowNull");function js(r){return r===null?r:r==="TRUE"|| -r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(js,"parseBool");function lc(r){return r? -xt.parse(r,js):null}a(lc,"parseBoolArray");function fc(r){return parseInt(r,10)}a(fc,"parseBaseTenIn\ -t");function zr(r){return r?xt.parse(r,Yt(fc)):null}a(zr,"parseIntegerArray");function hc(r){return r? -xt.parse(r,Yt(function(e){return Ws(e).trim()})):null}a(hc,"parseBigIntegerArray");var dc=a(function(r){ -if(!r)return null;var e=St.create(r,function(t){return t!==null&&(t=Xr(t)),t});return e.parse()},"pa\ -rsePointArray"),Yr=a(function(r){if(!r)return null;var e=St.create(r,function(t){return t!==null&&(t= +parseBytea")});var Gs=P((jh,$s)=>{p();var xt=Gr(),St=Vr(),Yt=Ls(),Qs=Ds(),js=Ns();function Jt(r){return a(function(t){ +return t===null?t:r(t)},"nullAllowed")}a(Jt,"allowNull");function Ws(r){return r===null?r:r==="TRUE"|| +r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(Ws,"parseBool");function fc(r){return r? +xt.parse(r,Ws):null}a(fc,"parseBoolArray");function hc(r){return parseInt(r,10)}a(hc,"parseBaseTenIn\ +t");function Yr(r){return r?xt.parse(r,Jt(hc)):null}a(Yr,"parseIntegerArray");function dc(r){return r? +xt.parse(r,Jt(function(e){return Hs(e).trim()})):null}a(dc,"parseBigIntegerArray");var pc=a(function(r){ +if(!r)return null;var e=St.create(r,function(t){return t!==null&&(t=en(t)),t});return e.parse()},"pa\ +rsePointArray"),Jr=a(function(r){if(!r)return null;var e=St.create(r,function(t){return t!==null&&(t= parseFloat(t)),t});return e.parse()},"parseFloatArray"),ye=a(function(r){if(!r)return null;var e=St. -create(r);return e.parse()},"parseStringArray"),Jr=a(function(r){if(!r)return null;var e=St.create(r, -function(t){return t!==null&&(t=zt(t)),t});return e.parse()},"parseDateArray"),pc=a(function(r){if(!r) -return null;var e=St.create(r,function(t){return t!==null&&(t=qs(t)),t});return e.parse()},"parseInt\ -ervalArray"),yc=a(function(r){return r?xt.parse(r,Yt(Qs)):null},"parseByteAArray"),Zr=a(function(r){ -return parseInt(r,10)},"parseInteger"),Ws=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ -parseBigInteger"),Ns=a(function(r){return r?xt.parse(r,Yt(JSON.parse)):null},"parseJsonArray"),Xr=a( +create(r);return e.parse()},"parseStringArray"),Zr=a(function(r){if(!r)return null;var e=St.create(r, +function(t){return t!==null&&(t=Yt(t)),t});return e.parse()},"parseDateArray"),yc=a(function(r){if(!r) +return null;var e=St.create(r,function(t){return t!==null&&(t=Qs(t)),t});return e.parse()},"parseInt\ +ervalArray"),mc=a(function(r){return r?xt.parse(r,Jt(js)):null},"parseByteAArray"),Xr=a(function(r){ +return parseInt(r,10)},"parseInteger"),Hs=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ +parseBigInteger"),qs=a(function(r){return r?xt.parse(r,Jt(JSON.parse)):null},"parseJsonArray"),en=a( function(r){return r[0]!=="("?null:(r=r.substring(1,r.length-1).split(","),{x:parseFloat(r[0]),y:parseFloat( -r[1])})},"parsePoint"),mc=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, +r[1])})},"parsePoint"),wc=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, i=2;i{"use strict";p();var se=1e6;function gc(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%se,e=e/se>>>0,o=4294967296* -s+t,t=o/se>>>0,u=""+(o-se*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/se>>>0,u=""+(o-se*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/se>>>0,u=""+(o- -se*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var bc=Vs(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,H){return E* +r[i])}var s=en(e);return s.radius=parseFloat(t),s},"parseCircle"),gc=a(function(r){r(20,Hs),r(21,Xr), +r(23,Xr),r(26,Xr),r(700,parseFloat),r(701,parseFloat),r(16,Ws),r(1082,Yt),r(1114,Yt),r(1184,Yt),r(600, +en),r(651,ye),r(718,wc),r(1e3,fc),r(1001,mc),r(1005,Yr),r(1007,Yr),r(1028,Yr),r(1016,dc),r(1017,pc), +r(1021,Jr),r(1022,Jr),r(1231,Jr),r(1014,ye),r(1015,ye),r(1008,ye),r(1009,ye),r(1040,ye),r(1041,ye),r( +1115,Zr),r(1182,Zr),r(1185,Zr),r(1186,Qs),r(1187,yc),r(17,js),r(114,JSON.parse.bind(JSON)),r(3802,JSON. +parse.bind(JSON)),r(199,qs),r(3807,qs),r(3907,ye),r(2951,ye),r(791,ye),r(1183,ye),r(1270,ye)},"init"); +$s.exports={init:gc}});var Ks=P(($h,Vs)=>{"use strict";p();var ie=1e6;function bc(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%ie,e=e/ie>>>0,o=4294967296* +s+t,t=o/ie>>>0,u=""+(o-ie*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/ie>>>0,u=""+(o-ie*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/ie>>>0,u=""+(o- +ie*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var xc=Ks(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,H){return E* Math.pow(2,H)+C};var s=t>>3,o=a(function(E){return n?~E&255:E},"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"),Ys=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"),Js=a(function(r,e,t){var n=Math. pow(2,t-1)-1,i=U(r,1),s=U(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=U(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"),xc=a(function(r){ -return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),Ks=a(function(r){return U(r,1)==1?-1*(U( -r,31,1,!0)+1):U(r,31,1)},"parseInt32"),Sc=a(function(r){return Ys(r,23,8)},"parseFloat32"),vc=a(function(r){ -return Ys(r,52,11)},"parseFloat64"),Ec=a(function(r){var e=U(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"),Sc=a(function(r){ +return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),zs=a(function(r){return U(r,1)==1?-1*(U( +r,31,1,!0)+1):U(r,31,1)},"parseInt32"),vc=a(function(r){return Js(r,23,8)},"parseFloat32"),Ec=a(function(r){ +return Js(r,52,11)},"parseFloat64"),Ac=a(function(r){var e=U(r,16,32);if(e==49152)return NaN;for(var t=Math. pow(1e4,U(r,16,16)),n=0,i=[],s=U(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 E=l.shift();for(g= 0;g0},"parseBool"),Cc=a(function(r){r(20,bc),r(21,xc),r(23,Ks),r(26,Ks),r(1700,Ec),r(700,Sc), -r(701,vc),r(16,_c),r(1114,zs.bind(null,!1)),r(1184,zs.bind(null,!0)),r(1e3,vt),r(1007,vt),r(1016,vt), -r(1008,vt),r(1009,vt),r(25,Ac)},"init");Js.exports={init:Cc}});var eo=R((Vh,Xs)=>{p();Xs.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25, +"parseArray"),_c=a(function(r){return r.toString("utf8")},"parseText"),Cc=a(function(r){return r===null? +null:U(r,8)>0},"parseBool"),Ic=a(function(r){r(20,xc),r(21,Sc),r(23,zs),r(26,zs),r(1700,Ac),r(700,vc), +r(701,Ec),r(16,Cc),r(1114,Ys.bind(null,!1)),r(1184,Ys.bind(null,!0)),r(1e3,vt),r(1007,vt),r(1016,vt), +r(1008,vt),r(1009,vt),r(25,_c)},"init");Zs.exports={init:Ic}});var to=P((Jh,eo)=>{p();eo.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 _t=R(At=>{p();var Ic=$s(),Tc=Zs(),Pc=Gr(),Rc=eo();At.getTypeParser=Bc;At.setTypeParser=Lc;At.arrayParser= -Pc;At.builtins=Rc;var Et={text:{},binary:{}};function to(r){return String(r)}a(to,"noParse");function Bc(r,e){ -return e=e||"text",Et[e]&&Et[e][r]||to}a(Bc,"getTypeParser");function Lc(r,e,t){typeof e=="function"&& -(t=e,e="text"),Et[e][r]=t}a(Lc,"setTypeParser");Ic.init(function(r,e){Et.text[r]=e});Tc.init(function(r,e){ -Et.binary[r]=e})});var Zt=R((Zh,ro)=>{"use strict";p();var kc=_t();function Jt(r){this._types=r||kc,this.text={},this.binary= -{}}a(Jt,"TypeOverrides");Jt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ -binary":return this.binary;default:return{}}};Jt.prototype.setTypeParser=function(r,e,t){typeof e=="\ -function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Jt.prototype.getTypeParser=function(r,e){return e= -e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};ro.exports=Jt});function Ct(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119,o=2600822924,u=528734635, +REGROLE:4096}});var _t=P(At=>{p();var Tc=Gs(),Rc=Xs(),Pc=Vr(),Bc=to();At.getTypeParser=Lc;At.setTypeParser=Fc;At.arrayParser= +Pc;At.builtins=Bc;var Et={text:{},binary:{}};function ro(r){return String(r)}a(ro,"noParse");function Lc(r,e){ +return e=e||"text",Et[e]&&Et[e][r]||ro}a(Lc,"getTypeParser");function Fc(r,e,t){typeof e=="function"&& +(t=e,e="text"),Et[e][r]=t}a(Fc,"setTypeParser");Tc.init(function(r,e){Et.text[r]=e});Rc.init(function(r,e){ +Et.binary[r]=e})});var Xt=P((rd,no)=>{"use strict";p();var Mc=_t();function Zt(r){this._types=r||Mc,this.text={},this.binary= +{}}a(Zt,"TypeOverrides");Zt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ +binary":return this.binary;default:return{}}};Zt.prototype.setTypeParser=function(r,e,t){typeof e=="\ +function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Zt.prototype.getTypeParser=function(r,e){return e= +e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};no.exports=Zt});function Ct(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, @@ -553,12 +553,12 @@ c=1541459225,l=0,f=0,y=[1116352408,1899447441,3049323471,3921009573,961987163,15 1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909, 275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222, 2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=a((T,b)=>T>>>b|T<<32- -b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),H=a(()=>{for(let k=0,Z=0;k<16;k++,Z+=4)E[k]=C[Z]<< -24|C[Z+1]<<16|C[Z+2]<<8|C[Z+3];for(let k=16;k<64;k++){let Z=g(E[k-15],7)^g(E[k-15],18)^E[k-15]>>>3,Ee=g( -E[k-2],17)^g(E[k-2],19)^E[k-2]>>>10;E[k]=E[k-16]+Z+E[k-7]+Ee|0}let T=e,b=t,F=n,ae=i,$=s,ge=o,Ie=u,ce=c; -for(let k=0;k<64;k++){let Z=g($,6)^g($,11)^g($,25),Ee=$&ge^~$&Ie,Te=ce+Z+Ee+y[k]+E[k]|0,Me=g(T,2)^g( -T,13)^g(T,22),Ue=T&b^T&F^b&F,De=Me+Ue|0;ce=Ie,Ie=ge,ge=$,$=ae+Te|0,ae=F,F=b,b=T,T=Te+De|0}e=e+T|0,t= -t+b|0,n=n+F|0,i=i+ae|0,s=s+$|0,o=o+ge|0,u=u+Ie|0,c=c+ce|0,f=0},"process"),J=a(T=>{typeof T=="string"&& +b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),H=a(()=>{for(let F=0,J=0;F<16;F++,J+=4)E[F]=C[J]<< +24|C[J+1]<<16|C[J+2]<<8|C[J+3];for(let F=16;F<64;F++){let J=g(E[F-15],7)^g(E[F-15],18)^E[F-15]>>>3,Ee=g( +E[F-2],17)^g(E[F-2],19)^E[F-2]>>>10;E[F]=E[F-16]+J+E[F-7]+Ee|0}let T=e,b=t,M=n,oe=i,$=s,ge=o,Ie=u,ce=c; +for(let F=0;F<64;F++){let J=g($,6)^g($,11)^g($,25),Ee=$&ge^~$&Ie,Te=ce+J+Ee+y[F]+E[F]|0,ke=g(T,2)^g( +T,13)^g(T,22),Ue=T&b^T&M^b&M,De=ke+Ue|0;ce=Ie,Ie=ge,ge=$,$=oe+Te|0,oe=M,M=b,b=T,T=Te+De|0}e=e+T|0,t= +t+b|0,n=n+M|0,i=i+oe|0,s=s+$|0,o=o+ge|0,u=u+Ie|0,c=c+ce|0,f=0},"process"),Y=a(T=>{typeof T=="string"&& (T=new TextEncoder().encode(T));for(let b=0;b{if(C[f++]=128,f==64&&H(),f+8>64){for(;f<64;)C[f++]=0;H()}for(;f<58;)C[f++]=0;let T=l*8;C[f++]= T/1099511627776&255,C[f++]=T/4294967296&255,C[f++]=T>>>24,C[f++]=T>>>16&255,C[f++]=T>>>8&255,C[f++]= @@ -567,7 +567,7 @@ t>>>24,b[5]=t>>>16&255,b[6]=t>>>8&255,b[7]=t&255,b[8]=n>>>24,b[9]=n>>>16&255,b[1 255,b[12]=i>>>24,b[13]=i>>>16&255,b[14]=i>>>8&255,b[15]=i&255,b[16]=s>>>24,b[17]=s>>>16&255,b[18]=s>>> 8&255,b[19]=s&255,b[20]=o>>>24,b[21]=o>>>16&255,b[22]=o>>>8&255,b[23]=o&255,b[24]=u>>>24,b[25]=u>>>16& 255,b[26]=u>>>8&255,b[27]=u&255,b[28]=c>>>24,b[29]=c>>>16&255,b[30]=c>>>8&255,b[31]=c&255,b},"digest"); -return r===void 0?{add:J,digest:we}:(J(r),we())}var no=re(()=>{"use strict";p();a(Ct,"sha256")});var Q,It,io=re(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ +return r===void 0?{add:Y,digest:we}:(Y(r),we())}var io=te(()=>{"use strict";p();a(Ct,"sha256")});var Q,It,so=te(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ Length",0);I(this,"_state",new Int32Array(4));I(this,"_buffer",new ArrayBuffer(68));I(this,"_buffer8"); I(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 Q._md5cycle(this._state,i),e?this._state:Q._hex( this._state)}};a(Q,"Md5"),I(Q,"stateIdentity",new Int32Array([1732584193,-271733879,-1732584194,271733878])), I(Q,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),I(Q,"hexChars","0123456789\ -abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);It=Q});var en={};fe(en,{createHash:()=>Mc,createHmac:()=>Uc,randomBytes:()=>Fc});function Fc(r){return crypto. -getRandomValues(m.alloc(r))}function Mc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( +abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);It=Q});var tn={};fe(tn,{createHash:()=>Uc,createHmac:()=>Dc,randomBytes:()=>kc});function kc(r){return crypto. +getRandomValues(m.alloc(r))}function Uc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( function(){return m.from(Ct(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 Uc(r,e){if(r!=="sha256")throw new Error(`\ +throw new Error(`Hash type '${r}' not supported`)}function Dc(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=Ct(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(Ct(o),64),m.from(Ct(u))}, -"digest")}},"update")}}var tn=re(()=>{"use strict";p();no();io();a(Fc,"randomBytes");a(Mc,"createHas\ -h");a(Uc,"createHmac")});var Tt=R((fd,rn)=>{"use strict";p();rn.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: +"digest")}},"update")}}var rn=te(()=>{"use strict";p();io();so();a(kc,"randomBytes");a(Uc,"createHas\ +h");a(Dc,"createHmac")});var Tt=P((yd,nn)=>{"use strict";p();nn.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: w.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 it=_t(),Dc=it.getTypeParser(20,"text"),Oc=it.getTypeParser(1016, -"text");rn.exports.__defineSetter__("parseInt8",function(r){it.setTypeParser(20,"text",r?it.getTypeParser( -23,"text"):Dc),it.setTypeParser(1016,"text",r?it.getTypeParser(1007,"text"):Oc)})});var Pt=R((dd,oo)=>{"use strict";p();var Nc=(tn(),j(en)),qc=Tt();function Qc(r){var e=r.replace(/\\/g, -"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(Qc,"escapeElement");function so(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+so(r[t]): -r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=Qc(Xt(r[t]));return e=e+"}",e}a(so,"arrayString"); -var Xt=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. +keepalives:1,keepalives_idle:0};var it=_t(),Oc=it.getTypeParser(20,"text"),Nc=it.getTypeParser(1016, +"text");nn.exports.__defineSetter__("parseInt8",function(r){it.setTypeParser(20,"text",r?it.getTypeParser( +23,"text"):Oc),it.setTypeParser(1016,"text",r?it.getTypeParser(1007,"text"):Nc)})});var Rt=P((wd,ao)=>{"use strict";p();var qc=(rn(),j(tn)),Qc=Tt();function jc(r){var e=r.replace(/\\/g, +"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(jc,"escapeElement");function oo(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+oo(r[t]): +r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=jc(er(r[t]));return e=e+"}",e}a(oo,"arrayString"); +var er=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. 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?qc.parseInputDatesAsUTC?Hc(r):Wc(r):Array.isArray(r)?so(r):typeof r== -"object"?jc(r,e):r.toString()},"prepareValue");function jc(r,e){if(r&&typeof r.toPostgres=="function"){ +r.byteLength)}return r instanceof Date?Qc.parseInputDatesAsUTC?$c(r):Hc(r):Array.isArray(r)?oo(r):typeof r== +"object"?Wc(r,e):r.toString()},"prepareValue");function Wc(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),Xt(r.toPostgres(Xt),e)}return JSON.stringify(r)}a(jc,"prepareObject");function z(r,e){ -for(r=""+r;r.lengthZc});var Zc,Bt=re(()=>{"use strict";p();Zc={}});var go=R((Id,wo)=>{"use strict";p();var an=(tn(),j(en));function Xc(r){if(r.indexOf("SCRAM-SHA-256")=== --1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=an.randomBytes( +t),r}a(Gc,"normalizeQueryConfig");var sn=a(function(r){return qc.createHash("md5").update(r,"utf-8"). +digest("hex")},"md5"),Vc=a(function(r,e,t){var n=sn(e+r),i=sn(m.concat([m.from(n),t]));return"md5"+i}, +"postgresMd5PasswordHash");ao.exports={prepareValue:a(function(e){return er(e)},"prepareValueWrapper"), +normalizeQueryConfig:Gc,postgresMd5PasswordHash:Vc,md5:sn}});var Bt={};fe(Bt,{default:()=>rl});var rl,Lt=te(()=>{"use strict";p();rl={}});var bo=P((Bd,go)=>{"use strict";p();var un=(rn(),j(tn));function nl(r){if(r.indexOf("SCRAM-SHA-256")=== +-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=un.randomBytes( 18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"\ -SASLInitialResponse"}}a(Xc,"startSession");function el(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( +SASLInitialResponse"}}a(nl,"startSession");function il(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=nl(t);if(n.nonce.startsWith(r.clientNonce)){ +L: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=al(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=m.from(n.salt,"base64"),s=ol(e,i,n.iteration),o=st(s,"Client Key"),u=sl( +art with client nonce");var i=m.from(n.salt,"base64"),s=ll(e,i,n.iteration),o=st(s,"Client Key"),u=cl( 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=st(u,y),E=mo(o,g),C=E.toString("base64"),H=st(s,"Server Key"),J=st(H,y);r.message="SAS\ -LResponse",r.serverSignature=J.toString("base64"),r.response=f+",p="+C}a(el,"continueSession");function tl(r,e){ +","+l+","+f,g=st(u,y),E=wo(o,g),C=E.toString("base64"),H=st(s,"Server Key"),Y=st(H,y);r.message="SAS\ +LResponse",r.serverSignature=Y.toString("base64"),r.response=f+",p="+C}a(il,"continueSession");function sl(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}=il( +"string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=ul( e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does\ - not match")}a(tl,"finalizeSession");function rl(r){if(typeof r!="string")throw new TypeError("SASL:\ + not match")}a(sl,"finalizeSession");function ol(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(rl,"isPrintableChars");function po(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(r)}a(po,"isBase64");function yo(r){if(typeof r!="string")throw new TypeError("SASL: attribute p\ +e<=126)}a(ol,"isPrintableChars");function yo(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(r)}a(yo,"isBase64");function mo(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(yo,"parseAttribute\ -Pairs");function nl(r){let e=yo(r),t=e.get("r");if(t){if(!rl(t))throw new Error("SASL: SCRAM-SERVER-\ +SASL: Invalid attribute pair entry");let t=e[0],n=e.substring(2);return[t,n]}))}a(mo,"parseAttribute\ +Pairs");function al(r){let e=mo(r),t=e.get("r");if(t){if(!ol(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(!po(n))throw new Error("SASL: SCRAM-SERV\ +ER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!yo(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(nl,"parseServerFirstMessage"); -function il(r){let t=yo(r).get("v");if(t){if(!po(t))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAG\ +tion missing");let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(al,"parseServerFirstMessage"); +function ul(r){let t=mo(r).get("v");if(t){if(!yo(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(il,"parseServerFinalMessage");function mo(r,e){if(!m. +signature is missing");return{serverSignature:t}}a(ul,"parseServerFinalMessage");function wo(r,e){if(!m. isBuffer(r))throw new TypeError("first argument must be a Buffer");if(!m.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 m.from(r.map((t,n)=>r[n]^e[n]))} -a(mo,"xorBuffers");function sl(r){return an.createHash("sha256").update(r).digest()}a(sl,"sha256");function st(r,e){ -return an.createHmac("sha256",r).update(e).digest()}a(st,"hmacSha256");function ol(r,e,t){for(var n=st( -r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sal});function al(...r){return r.join("/")}var cn=re(()=>{"use strict";p(); -a(al,"join")});var ln={};fe(ln,{stat:()=>ul});function ul(r,e){e(new Error("No filesystem"))}var fn=re(()=>{"use st\ -rict";p();a(ul,"stat")});var hn={};fe(hn,{default:()=>cl});var cl,dn=re(()=>{"use strict";p();cl={}});var bo={};fe(bo,{StringDecoder:()=>pn});var yn,pn,xo=re(()=>{"use strict";p();yn=class yn{constructor(e){ +a(wo,"xorBuffers");function cl(r){return un.createHash("sha256").update(r).digest()}a(cl,"sha256");function st(r,e){ +return un.createHmac("sha256",r).update(e).digest()}a(st,"hmacSha256");function ll(r,e,t){for(var n=st( +r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sfl});function fl(...r){return r.join("/")}var ln=te(()=>{"use strict";p(); +a(fl,"join")});var fn={};fe(fn,{stat:()=>hl});function hl(r,e){e(new Error("No filesystem"))}var hn=te(()=>{"use st\ +rict";p();a(hl,"stat")});var dn={};fe(dn,{default:()=>dl});var dl,pn=te(()=>{"use strict";p();dl={}});var xo={};fe(xo,{StringDecoder:()=>yn});var mn,yn,So=te(()=>{"use strict";p();mn=class mn{constructor(e){ I(this,"td");this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this. -td.decode(e)}};a(yn,"StringDecoder");pn=yn});var Ao=R((Dd,Eo)=>{"use strict";p();var{Transform:ll}=(dn(),j(hn)),{StringDecoder:fl}=(xo(),j(bo)),ke=Symbol( -"last"),tr=Symbol("decoder");function hl(r,e,t){let n;if(this.overflow){if(n=this[tr].write(r).split( -this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[ke]+=this[tr].write(r),n= -this[ke].split(this.matcher);this[ke]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( -"maximum buffer reached"));return}t()}a(hl,"transform");function dl(r){if(this[ke]+=this[tr].end(),this[ke]) -try{vo(this,this.mapper(this[ke]))}catch(e){return r(e)}r()}a(dl,"flush");function vo(r,e){e!==void 0&& -r.push(e)}a(vo,"push");function So(r){return r}a(So,"noop");function pl(r,e,t){switch(r=r||/\r?\n/,e= -e||So,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r=="object"&&!(r instanceof +td.decode(e)}};a(mn,"StringDecoder");yn=mn});var _o=P((Qd,Ao)=>{"use strict";p();var{Transform:pl}=(pn(),j(dn)),{StringDecoder:yl}=(So(),j(xo)),Fe=Symbol( +"last"),rr=Symbol("decoder");function ml(r,e,t){let n;if(this.overflow){if(n=this[rr].write(r).split( +this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Fe]+=this[rr].write(r),n= +this[Fe].split(this.matcher);this[Fe]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( +"maximum buffer reached"));return}t()}a(ml,"transform");function wl(r){if(this[Fe]+=this[rr].end(),this[Fe]) +try{Eo(this,this.mapper(this[Fe]))}catch(e){return r(e)}r()}a(wl,"flush");function Eo(r,e){e!==void 0&& +r.push(e)}a(Eo,"push");function vo(r){return r}a(vo,"noop");function gl(r,e,t){switch(r=r||/\r?\n/,e= +e||vo,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=So)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=hl,t.flush=dl,t.readableObjectMode= -!0;let n=new ll(t);return n[ke]="",n[tr]=new fl("utf8"),n.matcher=r,n.mapper=e,n.maxLength=t.maxLength, +"object"&&(t=e,e=vo)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=ml,t.flush=wl,t.readableObjectMode= +!0;let n=new pl(t);return n[Fe]="",n[rr]=new yl("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(pl,"split");Eo.exports=pl});var Io=R((qd,Ce)=>{"use strict";p();var _o=(cn(),j(un)),yl=(dn(),j(hn)).Stream,ml=Ao(),Co=(Bt(),j(Rt)), -wl=5432,rr=w.platform==="win32",Lt=w.stderr,gl=56,bl=7,xl=61440,Sl=32768;function vl(r){return(r&xl)== -Sl}a(vl,"isRegFile");var ot=["host","port","database","user","password"],mn=ot.length,El=ot[mn-1];function wn(){ -var r=Lt instanceof yl&&Lt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` -`);Lt.write(Co.format.apply(Co,e))}}a(wn,"warn");Object.defineProperty(Ce.exports,"isWin",{get:a(function(){ -return rr},"get"),set:a(function(r){rr=r},"set")});Ce.exports.warnTo=function(r){var e=Lt;return Lt= -r,e};Ce.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(rr?_o.join(e.APPDATA||"./","\ -postgresql","pgpass.conf"):_o.join(e.HOME||"./",".pgpass"));return t};Ce.exports.usePgPass=function(r,e){ -return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:rr?!0:(e=e||"",vl(r.mode)?r. -mode&(gl|bl)?(wn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ -(0600) or less',e),!1):!0:(wn('WARNING: password file "%s" is not a plain file',e),!1))};var Al=Ce.exports. -match=function(r,e){return ot.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||wl)===Number( +!1,s(i)},n}a(gl,"split");Ao.exports=gl});var To=P((Hd,Ce)=>{"use strict";p();var Co=(ln(),j(cn)),bl=(pn(),j(dn)).Stream,xl=_o(),Io=(Lt(),j(Bt)), +Sl=5432,nr=w.platform==="win32",Ft=w.stderr,vl=56,El=7,Al=61440,_l=32768;function Cl(r){return(r&Al)== +_l}a(Cl,"isRegFile");var ot=["host","port","database","user","password"],wn=ot.length,Il=ot[wn-1];function gn(){ +var r=Ft instanceof bl&&Ft.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +`);Ft.write(Io.format.apply(Io,e))}}a(gn,"warn");Object.defineProperty(Ce.exports,"isWin",{get:a(function(){ +return nr},"get"),set:a(function(r){nr=r},"set")});Ce.exports.warnTo=function(r){var e=Ft;return Ft= +r,e};Ce.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(nr?Co.join(e.APPDATA||"./","\ +postgresql","pgpass.conf"):Co.join(e.HOME||"./",".pgpass"));return t};Ce.exports.usePgPass=function(r,e){ +return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:nr?!0:(e=e||"",Cl(r.mode)?r. +mode&(vl|El)?(gn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ +(0600) or less',e),!1):!0:(gn('WARNING: password file "%s" is not a plain file',e),!1))};var Tl=Ce.exports. +match=function(r,e){return ot.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||Sl)===Number( e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};Ce.exports.getPassword=function(r,e,t){var n,i=e.pipe( -ml());function s(c){var l=_l(c);l&&Cl(l)&&Al(r,l)&&(n=l[El],i.end())}a(s,"onLine");var o=a(function(){ -e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),wn("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 _l=Ce.exports.parseLine= +xl());function s(c){var l=Rl(c);l&&Pl(l)&&Tl(r,l)&&(n=l[Il],i.end())}a(s,"onLine");var o=a(function(){ +e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),gn("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 Rl=Ce.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 E=r.substring(y,g);Object.hasOwnProperty.call(w.env,"PGPASS_NO_DEESCAPE")||(E=E. replace(/\\([:\\])/g,"$1")),o[ot[f]]=E},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). -length===mn?o:null,o},Cl=Ce.exports.isValidEntry=function(r){for(var e={0:function(o){return o.length> +l),u=n==wn-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===wn?o:null,o},Pl=Ce.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 Wd=(cn(),j(un)),To=(fn(),j(ln)),nr=Io();gn.exports=function(r,e){ -var t=nr.getFileName();To.stat(t,function(n,i){if(n||!nr.usePgPass(i,t))return e(void 0);var s=To.createReadStream( -t);nr.getPassword(r,s,e)})};gn.exports.warnTo=nr.warnTo});var Ro={};fe(Ro,{default:()=>Il});var Il,Bo=re(()=>{"use strict";p();Il={}});var ko=R((Vd,Lo)=>{"use strict";p();var Tl=(Pr(),j(us)),bn=(fn(),j(ln));function xn(r){if(r.charAt(0)=== -"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Tl.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i. +0}},t=0;t{"use strict";p();var Vd=(ln(),j(cn)),Ro=(hn(),j(fn)),ir=To();bn.exports=function(r,e){ +var t=ir.getFileName();Ro.stat(t,function(n,i){if(n||!ir.usePgPass(i,t))return e(void 0);var s=Ro.createReadStream( +t);ir.getPassword(r,s,e)})};bn.exports.warnTo=ir.warnTo});var Bo={};fe(Bo,{default:()=>Bl});var Bl,Lo=te(()=>{"use strict";p();Bl={}});var Mo=P((Jd,Fo)=>{"use strict";p();var Ll=(Pr(),j(cs)),xn=(hn(),j(fn));function Sn(r){if(r.charAt(0)=== +"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Ll.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,26 +756,26 @@ 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=bn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=bn.readFileSync(t.sslkey).toString()), -t.sslrootcert&&(t.ssl.ca=bn.readFileSync(t.sslrootcert).toString()),t.sslmode){case"disable":{t.ssl= +cert=xn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=xn.readFileSync(t.sslkey).toString()), +t.sslrootcert&&(t.ssl.ca=xn.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(xn,"parse");Lo.exports=xn;xn.parse=xn});var ir=R((Yd,Uo)=>{"use strict";p();var Pl=(Bo(),j(Ro)),Mo=Tt(),Fo=ko().parse,te=a(function(r,e,t){return t=== -void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Mo[r]},"val"),Rl=a(function(){switch(w. +!1;break}}return t}a(Sn,"parse");Fo.exports=Sn;Sn.parse=Sn});var sr=P((ep,Do)=>{"use strict";p();var Fl=(Lo(),j(Bo)),Uo=Tt(),ko=Mo().parse,ee=a(function(r,e,t){return t=== +void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Uo[r]},"val"),Ml=a(function(){switch(w. 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 Mo.ssl},"readSSLConfigFromEnvironment"),at=a(function(r){ +no-verify":return{rejectUnauthorized:!1}}return Uo.ssl},"readSSLConfigFromEnvironment"),at=a(function(r){ return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),me=a(function(r,e,t){ -var n=e[t];n!=null&&r.push(t+"="+at(n))},"add"),vn=class vn{constructor(e){e=typeof e=="string"?Fo(e): -e||{},e.connectionString&&(e=Object.assign({},e,Fo(e.connectionString))),this.user=te("user",e),this. -database=te("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(te("p\ -ort",e),10),this.host=te("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, -writable:!0,value:te("password",e)}),this.binary=te("binary",e),this.options=te("options",e),this.ssl= -typeof e.ssl>"u"?Rl():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="\ +var n=e[t];n!=null&&r.push(t+"="+at(n))},"add"),En=class En{constructor(e){e=typeof e=="string"?ko(e): +e||{},e.connectionString&&(e=Object.assign({},e,ko(e.connectionString))),this.user=ee("user",e),this. +database=ee("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(ee("p\ +ort",e),10),this.host=ee("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, +writable:!0,value:ee("password",e)}),this.binary=ee("binary",e),this.options=ee("options",e),this.ssl= +typeof e.ssl>"u"?Ml():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=te("client_encoding",e),this.replication=te("replication", -e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=te("application_name",e,"\ -PGAPPNAME"),this.fallback_application_name=te("fallback_application_name",e,!1),this.statement_timeout= -te("statement_timeout",e,!1),this.lock_timeout=te("lock_timeout",e,!1),this.idle_in_transaction_session_timeout= -te("idle_in_transaction_session_timeout",e,!1),this.query_timeout=te("query_timeout",e,!1),e.connectionTimeoutMillis=== +"key",{enumerable:!1}),this.client_encoding=ee("client_encoding",e),this.replication=ee("replication", +e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=ee("application_name",e,"\ +PGAPPNAME"),this.fallback_application_name=ee("fallback_application_name",e,!1),this.statement_timeout= +ee("statement_timeout",e,!1),this.lock_timeout=ee("lock_timeout",e,!1),this.idle_in_transaction_session_timeout= +ee("idle_in_transaction_session_timeout",e,!1),this.query_timeout=ee("query_timeout",e,!1),e.connectionTimeoutMillis=== void 0?this.connect_timeout=w.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/ 1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive===!0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis== "number"&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){ @@ -785,25 +785,25 @@ ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(me(t,n,"sslmode"),me(t, slkey"),me(t,n,"sslcert"),me(t,n,"sslrootcert"),this.database&&t.push("dbname="+at(this.database)),this. replication&&t.push("replication="+at(this.replication)),this.host&&t.push("host="+at(this.host)),this. isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+at(this.client_encoding)), -Pl.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+at(s)),e(null,t.join(" ")))})}}; -a(vn,"ConnectionParameters");var Sn=vn;Uo.exports=Sn});var No=R((Xd,Oo)=>{"use strict";p();var Bl=_t(),Do=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,An=class An{constructor(e,t){ +Fl.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+at(s)),e(null,t.join(" ")))})}}; +a(En,"ConnectionParameters");var vn=En;Do.exports=vn});var qo=P((np,No)=>{"use strict";p();var kl=_t(),Oo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,_n=class _n{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=Do.exec(e.text):t=Do.exec(e.command),t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2], +var t;e.text?t=Oo.exec(e.text):t=Oo.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:Ll}=Be(),qo=No(),Qo=Pt(),Cn=class Cn extends Ll{constructor(e,t,n){ -super(),e=Qo.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]=kl.getTypeParser(n.dataTypeID,n. +format||"text")}}};a(_n,"Result");var An=_n;No.exports=An});var Ho=P((op,Wo)=>{"use strict";p();var{EventEmitter:Ul}=Be(),Qo=qo(),jo=Rt(),In=class In extends Ul{constructor(e,t,n){ +super(),e=jo.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,w.domain&&e.callback&&(this.callback=w.domain.bind(e.callback)),this._result= -new qo(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError= +new Qo(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 qo(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ +_results=[this._result]),this._result=new Qo(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,41 +820,41 @@ 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:Qo.prepareValue})}catch(t){ +portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:jo.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(Cn,"Query");var _n=Cn;jo.exports= -_n});var ti=R(P=>{"use strict";p();Object.defineProperty(P,"__esModule",{value:!0});P.NoticeMessage=P.DataRowMessage= -P.CommandCompleteMessage=P.ReadyForQueryMessage=P.NotificationResponseMessage=P.BackendKeyDataMessage= -P.AuthenticationMD5Password=P.ParameterStatusMessage=P.ParameterDescriptionMessage=P.RowDescriptionMessage= -P.Field=P.CopyResponse=P.CopyDataMessage=P.DatabaseError=P.copyDone=P.emptyQuery=P.replicationStart= -P.portalSuspended=P.noData=P.closeComplete=P.bindComplete=P.parseComplete=void 0;P.parseComplete={name:"\ -parseComplete",length:5};P.bindComplete={name:"bindComplete",length:5};P.closeComplete={name:"closeC\ -omplete",length:5};P.noData={name:"noData",length:5};P.portalSuspended={name:"portalSuspended",length:5}; -P.replicationStart={name:"replicationStart",length:4};P.emptyQuery={name:"emptyQuery",length:4};P.copyDone= -{name:"copyDone",length:4};var Qn=class Qn extends Error{constructor(e,t,n){super(e),this.length=t,this. -name=n}};a(Qn,"DatabaseError");var In=Qn;P.DatabaseError=In;var jn=class jn{constructor(e,t){this.length= -e,this.chunk=t,this.name="copyData"}};a(jn,"CopyDataMessage");var Tn=jn;P.CopyDataMessage=Tn;var Wn=class Wn{constructor(e,t,n,i){ -this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Wn,"CopyResponse");var Pn=Wn; -P.CopyResponse=Pn;var Hn=class Hn{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(Hn,"Field");var Rn=Hn; -P.Field=Rn;var $n=class $n{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ -n",this.fields=new Array(this.fieldCount)}};a($n,"RowDescriptionMessage");var Bn=$n;P.RowDescriptionMessage= -Bn;var Gn=class Gn{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ -ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(Gn,"ParameterDescriptionMessage");var Ln=Gn; -P.ParameterDescriptionMessage=Ln;var Vn=class Vn{constructor(e,t,n){this.length=e,this.parameterName= -t,this.parameterValue=n,this.name="parameterStatus"}};a(Vn,"ParameterStatusMessage");var kn=Vn;P.ParameterStatusMessage= -kn;var Kn=class Kn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; -a(Kn,"AuthenticationMD5Password");var Fn=Kn;P.AuthenticationMD5Password=Fn;var zn=class zn{constructor(e,t,n){ -this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(zn,"BackendKeyDataMes\ -sage");var Mn=zn;P.BackendKeyDataMessage=Mn;var Yn=class Yn{constructor(e,t,n,i){this.length=e,this. -processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(Yn,"NotificationResponseMessa\ -ge");var Un=Yn;P.NotificationResponseMessage=Un;var Jn=class Jn{constructor(e,t){this.length=e,this. -status=t,this.name="readyForQuery"}};a(Jn,"ReadyForQueryMessage");var Dn=Jn;P.ReadyForQueryMessage=Dn; -var Zn=class Zn{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(Zn,"Comma\ -ndCompleteMessage");var On=Zn;P.CommandCompleteMessage=On;var Xn=class Xn{constructor(e,t){this.length= -e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(Xn,"DataRowMessage");var Nn=Xn;P.DataRowMessage= -Nn;var ei=class ei{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(ei,"NoticeMe\ -ssage");var qn=ei;P.NoticeMessage=qn});var Ho=R(sr=>{"use strict";p();Object.defineProperty(sr,"__esModule",{value:!0});sr.Writer=void 0;var ni=class ni{constructor(e=256){ +e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(In,"Query");var Cn=In;Wo.exports= +Cn});var ri=P(R=>{"use strict";p();Object.defineProperty(R,"__esModule",{value:!0});R.NoticeMessage=R.DataRowMessage= +R.CommandCompleteMessage=R.ReadyForQueryMessage=R.NotificationResponseMessage=R.BackendKeyDataMessage= +R.AuthenticationMD5Password=R.ParameterStatusMessage=R.ParameterDescriptionMessage=R.RowDescriptionMessage= +R.Field=R.CopyResponse=R.CopyDataMessage=R.DatabaseError=R.copyDone=R.emptyQuery=R.replicationStart= +R.portalSuspended=R.noData=R.closeComplete=R.bindComplete=R.parseComplete=void 0;R.parseComplete={name:"\ +parseComplete",length:5};R.bindComplete={name:"bindComplete",length:5};R.closeComplete={name:"closeC\ +omplete",length:5};R.noData={name:"noData",length:5};R.portalSuspended={name:"portalSuspended",length:5}; +R.replicationStart={name:"replicationStart",length:4};R.emptyQuery={name:"emptyQuery",length:4};R.copyDone= +{name:"copyDone",length:4};var jn=class jn extends Error{constructor(e,t,n){super(e),this.length=t,this. +name=n}};a(jn,"DatabaseError");var Tn=jn;R.DatabaseError=Tn;var Wn=class Wn{constructor(e,t){this.length= +e,this.chunk=t,this.name="copyData"}};a(Wn,"CopyDataMessage");var Rn=Wn;R.CopyDataMessage=Rn;var Hn=class Hn{constructor(e,t,n,i){ +this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Hn,"CopyResponse");var Pn=Hn; +R.CopyResponse=Pn;var $n=class $n{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($n,"Field");var Bn=$n; +R.Field=Bn;var Gn=class Gn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ +n",this.fields=new Array(this.fieldCount)}};a(Gn,"RowDescriptionMessage");var Ln=Gn;R.RowDescriptionMessage= +Ln;var Vn=class Vn{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ +ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(Vn,"ParameterDescriptionMessage");var Fn=Vn; +R.ParameterDescriptionMessage=Fn;var Kn=class Kn{constructor(e,t,n){this.length=e,this.parameterName= +t,this.parameterValue=n,this.name="parameterStatus"}};a(Kn,"ParameterStatusMessage");var Mn=Kn;R.ParameterStatusMessage= +Mn;var zn=class zn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; +a(zn,"AuthenticationMD5Password");var kn=zn;R.AuthenticationMD5Password=kn;var Yn=class Yn{constructor(e,t,n){ +this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Yn,"BackendKeyDataMes\ +sage");var Un=Yn;R.BackendKeyDataMessage=Un;var Jn=class Jn{constructor(e,t,n,i){this.length=e,this. +processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(Jn,"NotificationResponseMessa\ +ge");var Dn=Jn;R.NotificationResponseMessage=Dn;var Zn=class Zn{constructor(e,t){this.length=e,this. +status=t,this.name="readyForQuery"}};a(Zn,"ReadyForQueryMessage");var On=Zn;R.ReadyForQueryMessage=On; +var Xn=class Xn{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(Xn,"Comma\ +ndCompleteMessage");var Nn=Xn;R.CommandCompleteMessage=Nn;var ei=class ei{constructor(e,t){this.length= +e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(ei,"DataRowMessage");var qn=ei;R.DataRowMessage= +qn;var ti=class ti{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(ti,"NoticeMe\ +ssage");var Qn=ti;R.NoticeMessage=Qn});var $o=P(or=>{"use strict";p();Object.defineProperty(or,"__esModule",{value:!0});or.Writer=void 0;var ii=class ii{constructor(e=256){ this.size=e,this.offset=5,this.headerPosition=0,this.buffer=m.allocUnsafe(e)}ensure(e){if(this.buffer. length-this.offset>1)+e;this.buffer=m.allocUnsafe(i),n.copy( this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this. @@ -866,49 +866,49 @@ 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=m.allocUnsafe(this.size),t}};a(ni,"Writer");var ri=ni;sr.Writer=ri});var Go=R(ar=>{"use strict";p();Object.defineProperty(ar,"__esModule",{value:!0});ar.serialize=void 0; -var ii=Ho(),D=new ii.Writer,kl=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( +headerPosition=0,this.buffer=m.allocUnsafe(this.size),t}};a(ii,"Writer");var ni=ii;or.Writer=ni});var Vo=P(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.serialize=void 0; +var si=$o(),D=new si.Writer,Dl=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( n).addCString(r[n]);D.addCString("client_encoding").addCString("UTF8");let e=D.addCString("").flush(), -t=e.length+4;return new ii.Writer().addInt32(t).add(e).flush()},"startup"),Fl=a(()=>{let r=m.allocUnsafe( -8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Ml=a(r=>D.addCString(r).flush( -112),"password"),Ul=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. -flush(112)},"sendSASLInitialResponseMessage"),Dl=a(function(r){return D.addString(r).flush(112)},"se\ -ndSCRAMClientFinalMessage"),Ol=a(r=>D.addCString(r).flush(81),"query"),$o=[],Nl=a(r=>{let e=r.name|| +t=e.length+4;return new si.Writer().addInt32(t).add(e).flush()},"startup"),Ol=a(()=>{let r=m.allocUnsafe( +8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Nl=a(r=>D.addCString(r).flush( +112),"password"),ql=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. +flush(112)},"sendSASLInitialResponseMessage"),Ql=a(function(r){return D.addString(r).flush(112)},"se\ +ndSCRAMClientFinalMessage"),jl=a(r=>D.addCString(r).flush(81),"query"),Go=[],Wl=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||$o,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< -n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),ut=new ii.Writer,ql=a(function(r,e){for(let t=0;t< +xecuting queries"));let t=r.types||Go,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< +n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),ut=new si.Writer,Hl=a(function(r,e){for(let t=0;t< r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),ut.addInt32(-1)):n instanceof m?(D.addInt16( 1),ut.addInt32(n.length),ut.add(n)):(D.addInt16(0),ut.addInt32(m.byteLength(n)),ut.addString(n))}},"\ -writeValues"),Ql=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||$o,s=i.length; -return D.addCString(e).addCString(t),D.addInt16(s),ql(i,r.valueMapper),D.addInt16(s),D.add(ut.flush()), -D.addInt16(n?1:0),D.flush(66)},"bind"),jl=m.from([69,0,0,0,9,0,0,0,0,0]),Wl=a(r=>{if(!r||!r.portal&& -!r.rows)return jl;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Hl=a( +writeValues"),$l=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Go,s=i.length; +return D.addCString(e).addCString(t),D.addInt16(s),Hl(i,r.valueMapper),D.addInt16(s),D.add(ut.flush()), +D.addInt16(n?1:0),D.flush(66)},"bind"),Gl=m.from([69,0,0,0,9,0,0,0,0,0]),Vl=a(r=>{if(!r||!r.portal&& +!r.rows)return Gl;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Kl=a( (r,e)=>{let t=m.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"),si=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. +6),t.writeInt32BE(r,8),t.writeInt32BE(e,12),t},"cancel"),oi=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i},"cstringMessage"), -$l=D.addCString("P").flush(68),Gl=D.addCString("S").flush(68),Vl=a(r=>r.name?si(68,`${r.type}${r.name|| -""}`):r.type==="P"?$l:Gl,"describe"),Kl=a(r=>{let e=`${r.type}${r.name||""}`;return si(67,e)},"close"), -zl=a(r=>D.add(r).flush(100),"copyData"),Yl=a(r=>si(102,r),"copyFail"),or=a(r=>m.from([r,0,0,0,4]),"c\ -odeOnlyBuffer"),Jl=or(72),Zl=or(83),Xl=or(88),ef=or(99),tf={startup:kl,password:Ml,requestSsl:Fl,sendSASLInitialResponseMessage:Ul, -sendSCRAMClientFinalMessage:Dl,query:Ol,parse:Nl,bind:Ql,execute:Wl,describe:Vl,close:Kl,flush:a(()=>Jl, -"flush"),sync:a(()=>Zl,"sync"),end:a(()=>Xl,"end"),copyData:zl,copyDone:a(()=>ef,"copyDone"),copyFail:Yl, -cancel:Hl};ar.serialize=tf});var Vo=R(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.BufferReader=void 0; -var rf=m.allocUnsafe(0),ai=class ai{constructor(e=0){this.offset=e,this.buffer=rf,this.encoding="utf\ +zl=D.addCString("P").flush(68),Yl=D.addCString("S").flush(68),Jl=a(r=>r.name?oi(68,`${r.type}${r.name|| +""}`):r.type==="P"?zl:Yl,"describe"),Zl=a(r=>{let e=`${r.type}${r.name||""}`;return oi(67,e)},"close"), +Xl=a(r=>D.add(r).flush(100),"copyData"),ef=a(r=>oi(102,r),"copyFail"),ar=a(r=>m.from([r,0,0,0,4]),"c\ +odeOnlyBuffer"),tf=ar(72),rf=ar(83),nf=ar(88),sf=ar(99),of={startup:Dl,password:Nl,requestSsl:Ol,sendSASLInitialResponseMessage:ql, +sendSCRAMClientFinalMessage:Ql,query:jl,parse:Wl,bind:$l,execute:Vl,describe:Jl,close:Zl,flush:a(()=>tf, +"flush"),sync:a(()=>rf,"sync"),end:a(()=>nf,"end"),copyData:Xl,copyDone:a(()=>sf,"copyDone"),copyFail:ef, +cancel:Kl};ur.serialize=of});var Ko=P(cr=>{"use strict";p();Object.defineProperty(cr,"__esModule",{value:!0});cr.BufferReader=void 0; +var af=m.allocUnsafe(0),ui=class ui{constructor(e=0){this.offset=e,this.buffer=af,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(ai,"BufferReader");var oi=ai;ur.BufferReader=oi});var Yo=R(cr=>{"use strict";p();Object.defineProperty(cr,"__esModule",{value:!0});cr.Parser=void 0;var O=ti(), -nf=Vo(),ui=1,sf=4,Ko=ui+sf,zo=m.allocUnsafe(0),li=class li{constructor(e){if(this.buffer=zo,this.bufferLength= -0,this.bufferOffset=0,this.reader=new nf.BufferReader,e?.mode==="binary")throw new Error("Binary mod\ +offset+=e,t}};a(ui,"BufferReader");var ai=ui;cr.BufferReader=ai});var Jo=P(lr=>{"use strict";p();Object.defineProperty(lr,"__esModule",{value:!0});lr.Parser=void 0;var O=ri(), +uf=Ko(),ci=1,cf=4,zo=ci+cf,Yo=m.allocUnsafe(0),fi=class fi{constructor(e){if(this.buffer=Yo,this.bufferLength= +0,this.bufferOffset=0,this.reader=new uf.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+Ko<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( -i+ui),u=ui+o;if(u+i<=n){let c=this.handlePacket(i+Ko,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. -buffer=zo,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=n-i,this.bufferOffset=i)}mergeBuffer(e){ +this.bufferLength,i=this.bufferOffset;for(;i+zo<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( +i+ci),u=ci+o;if(u+i<=n){let c=this.handlePacket(i+zo,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. +buffer=Yo,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. buffer.byteLength*2;for(;t>=s;)s*=2;i=m.allocUnsafe(s)}this.buffer.copy(i,0,this.bufferOffset,this.bufferOffset+ @@ -954,14 +954,14 @@ o=this.reader.string(1);for(;o!=="\0";)s[o]=this.reader.cstring(),o=this.reader. c=i==="notice"?new O.NoticeMessage(t,u):new O.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(li,"Parser");var ci=li;cr.Parser=ci});var fi=R(Fe=>{"use strict";p();Object.defineProperty(Fe,"__esModule",{value:!0});Fe.DatabaseError=Fe. -serialize=Fe.parse=void 0;var of=ti();Object.defineProperty(Fe,"DatabaseError",{enumerable:!0,get:a( -function(){return of.DatabaseError},"get")});var af=Go();Object.defineProperty(Fe,"serialize",{enumerable:!0, -get:a(function(){return af.serialize},"get")});var uf=Yo();function cf(r,e){let t=new uf.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(cf,"parse");Fe.parse=cf});var Jo={};fe(Jo,{connect:()=>lf});function lf({socket:r,servername:e}){return r.startTls(e),r}var Zo=re( -()=>{"use strict";p();a(lf,"connect")});var pi=R((_p,ta)=>{"use strict";p();var Xo=(Ye(),j(as)),ff=Be().EventEmitter,{parse:hf,serialize:K}=fi(), -ea=K.flush(),df=K.sync(),pf=K.end(),di=class di extends ff{constructor(e){super(),e=e||{},this.stream= -e.stream||new Xo.Socket,this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis, +a(fi,"Parser");var li=fi;lr.Parser=li});var hi=P(Me=>{"use strict";p();Object.defineProperty(Me,"__esModule",{value:!0});Me.DatabaseError=Me. +serialize=Me.parse=void 0;var lf=ri();Object.defineProperty(Me,"DatabaseError",{enumerable:!0,get:a( +function(){return lf.DatabaseError},"get")});var ff=Vo();Object.defineProperty(Me,"serialize",{enumerable:!0, +get:a(function(){return ff.serialize},"get")});var hf=Jo();function df(r,e){let t=new hf.Parser;return r. +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(df,"parse");Me.parse=df});var Zo={};fe(Zo,{connect:()=>pf});function pf({socket:r,servername:e}){return r.startTls(e),r}var Xo=te( +()=>{"use strict";p();a(pf,"connect")});var yi=P((Rp,ra)=>{"use strict";p();var ea=(Ye(),j(us)),yf=Be().EventEmitter,{parse:mf,serialize:K}=hi(), +ta=K.flush(),wf=K.sync(),gf=K.end(),pi=class pi extends yf{constructor(e){super(),e=e||{},this.stream= +e.stream||new ea.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=(Zo(),j(Jo));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= -n.ssl.key)),Xo.isIP(t)===0&&(c.servername=t);try{n.stream=u.connect(c)}catch(l){return n.emit("error", +var u=(Xo(),j(Zo));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= +n.ssl.key)),ea.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")}),hf(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& +"end",()=>{this.emit("end")}),mf(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(K.requestSsl())}startup(e){this. stream.write(K.startup(e))}cancel(e,t){this._send(K.cancel(e,t))}password(e){this._send(K.password(e))}sendSASLInitialResponseMessage(e,t){ this._send(K.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(K.sendSCRAMClientFinalMessage( e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(K.query(e))}parse(e){ this._send(K.parse(e))}bind(e){this._send(K.bind(e))}execute(e){this._send(K.execute(e))}flush(){this. -stream.writable&&this.stream.write(ea)}sync(){this._ending=!0,this._send(ea),this._send(df)}ref(){this. +stream.writable&&this.stream.write(ta)}sync(){this._ending=!0,this._send(ta),this._send(wf)}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(pf,()=>{this.stream.end()})}close(e){this._send(K. +this.stream.end();return}return this.stream.write(gf,()=>{this.stream.end()})}close(e){this._send(K. close(e))}describe(e){this._send(K.describe(e))}sendCopyFromChunk(e){this._send(K.copyData(e))}endCopyFrom(){ -this._send(K.copyDone())}sendCopyFail(e){this._send(K.copyFail(e))}};a(di,"Connection");var hi=di;ta. -exports=hi});var ia=R((Pp,na)=>{"use strict";p();var yf=Be().EventEmitter,Tp=(Bt(),j(Rt)),mf=Pt(),yi=go(),wf=Po(), -gf=Zt(),bf=ir(),ra=Wo(),xf=Tt(),Sf=pi(),mi=class mi extends yf{constructor(e){super(),this.connectionParameters= -new bf(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database, +this._send(K.copyDone())}sendCopyFail(e){this._send(K.copyFail(e))}};a(pi,"Connection");var di=pi;ra. +exports=di});var sa=P((Fp,ia)=>{"use strict";p();var bf=Be().EventEmitter,Lp=(Lt(),j(Bt)),xf=Rt(),mi=bo(),Sf=Po(), +vf=Xt(),Ef=sr(),na=Ho(),Af=Tt(),_f=yi(),wi=class wi extends bf{constructor(e){super(),this.connectionParameters= +new Ef(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||S.Promise, -this._types=new gf(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= -!1,this._queryable=!0,this.connection=t.connection||new Sf({stream:t.stream,ssl:this.connectionParameters. +this._types=new vf(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= +!1,this._queryable=!0,this.connection=t.connection||new _f({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||xf.binary,this. +connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t.binary||Af.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=>{w.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():wf(this.connectionParameters, +password=this.password=null;e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():Sf(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=mf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ -this._checkPgPass(()=>{this.saslSession=yi.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( -this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){yi.continueSession( +()=>{let t=xf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ +this._checkPgPass(()=>{this.saslSession=mi.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( +this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){mi.continueSession( this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession. -response)}_handleAuthSASLFinal(e){yi.finalizeSession(this.saslSession,e.data),this.saslSession=null}_handleBackendKeyData(e){ +response)}_handleAuthSASLFinal(e){mi.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 ra(e,t,n),i.callback||(s=new this._Promise((l,f)=>{i.callback= +connectionParameters.query_timeout,i=new na(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");w.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(mi,"Client");var lr=mi;lr.Query=ra;na.exports=lr});var ua=R((Lp,aa)=>{"use strict";p();var vf=Be().EventEmitter,sa=a(function(){},"NOOP"),oa=a((r,e)=>{ -let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),bi=class bi{constructor(e,t,n){ -this.client=e,this.idleListener=t,this.timeoutId=n}};a(bi,"IdleItem");var wi=bi,xi=class xi{constructor(e){ -this.callback=e}};a(xi,"PendingItem");var ct=xi;function Ef(){throw new Error("Release called on cli\ -ent which has already been released to the pool.")}a(Ef,"throwOnDoubleRelease");function fr(r,e){if(e) +_Promise(t=>{this.connection.once("end",t)})}};a(wi,"Client");var fr=wi;fr.Query=na;ia.exports=fr});var ca=P((Up,ua)=>{"use strict";p();var Cf=Be().EventEmitter,oa=a(function(){},"NOOP"),aa=a((r,e)=>{ +let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),xi=class xi{constructor(e,t,n){ +this.client=e,this.idleListener=t,this.timeoutId=n}};a(xi,"IdleItem");var gi=xi,Si=class Si{constructor(e){ +this.callback=e}};a(Si,"PendingItem");var ct=Si;function If(){throw new Error("Release called on cli\ +ent which has already been released to the pool.")}a(If,"throwOnDoubleRelease");function hr(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(fr,"promisify"); -function Af(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(hr,"promisify"); +function Tf(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(Af,"makeIdleListener");var Si=class Si extends vf{constructor(e,t){super(),this.options= +dleListener")}a(Tf,"makeIdleListener");var vi=class vi extends Cf{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||kt().Client,this.Promise= +this.log=this.options.log||function(){},this.Client=this.options.Client||t||Mt().Client,this.Promise= this.options.Promise||S.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=oa( +if(!this._isFull())return this.newClient(e);throw new Error("unexpected condition")}_remove(e){let t=aa( 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=fr(this.Promise,e),n=t. +l after calling end on the pool");return e?e(i):this.Promise.reject(i)}let t=hr(this.Promise,e),n=t. result;if(this._isFull()||this._idle.length){if(this._idle.length&&w.nextTick(()=>this._pulseQueue()), !this.options.connectionTimeoutMillis)return this._pendingQueue.push(new ct(t.callback)),n;let i=a((u,c,l)=>{ -clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new ct(i),o=setTimeout(()=>{oa(this._pendingQueue, +clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new ct(i),o=setTimeout(()=>{aa(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 ct(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( -t);let n=Af(this,t);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&& +t);let n=Tf(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,sa);else{if(this.log("new client connected"),this.options. +_pulseQueue(),e.timedOut||e.callback(o,void 0,oa);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 ct((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,sa);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ -let n=!1;return i=>{n&&Ef(),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,oa);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ +let n=!1;return i=>{n&&If(),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 wi( -e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=fr(this.Promise,e);return v(function(){ +this.options.allowExitOnIdle&&s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new gi( +e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=hr(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=fr(this.Promise,n);return n=i.callback,this. +d"))}),s.result}typeof t=="function"&&(n=t,t=void 0);let i=hr(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=fr(this.Promise,e);return this._endCallback=t.callback,this. +this.Promise.reject(n)}this.ending=!0;let t=hr(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(Si,"Pool");var gi=Si;aa.exports=gi});var ca={};fe(ca,{default:()=>_f});var _f,la=re(()=>{"use strict";p();_f={}});var fa=R((Up,Cf)=>{Cf.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javas\ +return this._clients.length}};a(vi,"Pool");var bi=vi;ua.exports=bi});var la={};fe(la,{default:()=>Rf});var Rf,fa=te(()=>{"use strict";p();Rf={}});var ha=P((qp,Pf)=>{Pf.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 pa=R((Dp,da)=>{"use strict";p();var ha=Be().EventEmitter,If=(Bt(),j(Rt)),vi=Pt(),lt=da.exports=function(r,e,t){ -ha.call(this),r=vi.normalizeQueryConfig(r,e,t),this.text=r.text,this.values=r.values,this.name=r.name, +a178655"}});var ya=P((Qp,pa)=>{"use strict";p();var da=Be().EventEmitter,Bf=(Lt(),j(Bt)),Ei=Rt(),lt=pa.exports=function(r,e,t){ +da.call(this),r=Ei.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))};If.inherits(lt,ha); -var Tf={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ +this.on("newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};Bf.inherits(lt,da); +var Lf={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"\ file",sourceLine:"line",sourceFunction:"routine"};lt.prototype.handleError=function(r){var e=this.native. -pq.resultErrorFields();if(e)for(var t in e){var n=Tf[t]||t;r[n]=e[t]}this.callback?this.callback(r): +pq.resultErrorFields();if(e)for(var t in e){var n=Lf[t]||t;r[n]=e[t]}this.callback?this.callback(r): this.emit("error",r),this.state="error"};lt.prototype.then=function(r,e){return this._getPromise().then( r,e)};lt.prototype.catch=function(r){return this._getPromise().catch(r)};lt.prototype._getPromise=function(){ return this._promise?this._promise:(this._promise=new Promise(function(r,e){this._once("end",r),this. @@ -1169,75 +1169,75 @@ 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(w.domain&&(t=w.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(vi.prepareValue);if(r. +se conflicts and silent errors executing queries"));var n=(this.values||[]).map(Ei.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(vi. -prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var ga=R((Qp,wa)=>{"use strict";p();var Pf=(la(),j(ca)),Rf=Zt(),qp=fa(),ya=Be().EventEmitter,Bf=(Bt(),j(Rt)), -Lf=ir(),ma=pa(),oe=wa.exports=function(r){ya.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. -_types=new Rf(r.types),this.native=new Pf({types:this._types}),this._queryQueue=[],this._ending=!1,this. -_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Lf(r);this. +this.values)){let s=new Error("Query values must be an array");return t(s)}var i=this.values.map(Ei. +prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var ba=P(($p,ga)=>{"use strict";p();var Ff=(fa(),j(la)),Mf=Xt(),Hp=ha(),ma=Be().EventEmitter,kf=(Lt(),j(Bt)), +Uf=sr(),wa=ya(),se=ga.exports=function(r){ma.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. +_types=new Mf(r.types),this.native=new Ff({types:this._types}),this._queryQueue=[],this._ending=!1,this. +_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Uf(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={}};oe.Query= -ma;Bf.inherits(oe,ya);oe.prototype._errorAllQueries=function(r){let e=a(t=>{w.nextTick(()=>{t.native= +password}),this.database=e.database,this.host=e.host,this.port=e.port,this.namedQueries={}};se.Query= +wa;kf.inherits(se,ma);se.prototype._errorAllQueries=function(r){let e=a(t=>{w.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};oe.prototype._connect=function(r){var e=this; +null),this._queryQueue.forEach(e),this._queryQueue.length=0};se.prototype._connect=function(r){var e=this; if(this._connecting){w.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()})})};oe.prototype.connect=function(r){if(r){this._connect(r);return}return new this. -_Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};oe.prototype.query=function(r,e,t){var n,i,s,o,u; +_pulseQueryQueue(!0),r()})})};se.prototype.connect=function(r){if(r){this._connect(r);return}return new this. +_Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};se.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=="f\ unction")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 ma(r,e,t),!n.callback){let c,l;i=new this. +e);else if(s=this.connectionParameters.query_timeout,n=new wa(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");w.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,w.nextTick(()=>{n.handleError( new Error("Client was closed and is not queryable"))}),i):(this._queryQueue.push(n),this._pulseQueryQueue(), i):(n.native=this.native,w.nextTick(()=>{n.handleError(new Error("Client has encountered a connectio\ -n error and is not queryable"))}),i)};oe.prototype.end=function(r){var e=this;this._ending=!0,this._connected|| +n error and is not queryable"))}),i)};se.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")), -w.nextTick(()=>{e.emit("end"),r&&r()})}),t};oe.prototype._hasActiveQuery=function(){return this._activeQuery&& -this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};oe.prototype._pulseQueryQueue=function(r){ +w.nextTick(()=>{e.emit("end"),r&&r()})}),t};se.prototype._hasActiveQuery=function(){return this._activeQuery&& +this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};se.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()})}}; -oe.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. -indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};oe.prototype.ref=function(){}; -oe.prototype.unref=function(){};oe.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( -r,e,t)};oe.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var Ei=R((Hp,ba)=>{"use strict";p();ba.exports=ga()});var kt=R((Gp,Ft)=>{"use strict";p();var kf=ia(),Ff=Tt(),Mf=pi(),Uf=ua(),{DatabaseError:Df}=fi(),Of=a( -r=>{var e;return e=class extends Uf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),Ai=a( -function(r){this.defaults=Ff,this.Client=r,this.Query=this.Client.Query,this.Pool=Of(this.Client),this. -_pools=[],this.Connection=Mf,this.types=_t(),this.DatabaseError=Df},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< -"u"?Ft.exports=new Ai(Ei()):(Ft.exports=new Ai(kf),Object.defineProperty(Ft.exports,"native",{configurable:!0, -enumerable:!1,get(){var r=null;try{r=new Ai(Ei())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. -defineProperty(Ft.exports,"native",{value:r}),r}}))});var Qf={};fe(Qf,{Client:()=>ft,DatabaseError:()=>ve.DatabaseError,NeonDbError:()=>Y,NeonQueryPromise:()=>Le, -Pool:()=>hr,SqlTemplate:()=>tt,UnsafeRawSql:()=>rt,_bundleExt:()=>qf,defaults:()=>ve.defaults,escapeIdentifier:()=>ve.escapeIdentifier, -escapeLiteral:()=>ve.escapeLiteral,neon:()=>sn,neonConfig:()=>be,types:()=>ve.types,warnIfBrowser:()=>bt}); -module.exports=j(Qf);p();p();Ye();Pr();p();var mu=Object.defineProperty,wu=Object.defineProperties,gu=Object.getOwnPropertyDescriptors,cs=Object. -getOwnPropertySymbols,bu=Object.prototype.hasOwnProperty,xu=Object.prototype.propertyIsEnumerable,ls=a( -(r,e,t)=>e in r?mu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), -Su=a((r,e)=>{for(var t in e||(e={}))bu.call(e,t)&&ls(r,t,e[t]);if(cs)for(var t of cs(e))xu.call(e,t)&& -ls(r,t,e[t]);return r},"__spreadValues"),vu=a((r,e)=>wu(r,gu(e)),"__spreadProps"),Eu=1008e3,fs=new Uint8Array( -new Uint16Array([258]).buffer)[0]===2,Au=new TextDecoder,Rr=new TextEncoder,qt=Rr.encode("0123456789\ -abcdef"),Qt=Rr.encode("0123456789ABCDEF"),_u=Rr.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ -stuvwxyz0123456789+/");var hs=_u.slice();hs[62]=45;hs[63]=95;var dt,jt;function Cu(r,{alphabet:e,scratchArr:t}={}){if(!dt)if(dt= -new Uint16Array(256),jt=new Uint16Array(256),fs)for(let C=0;C<256;C++)dt[C]=qt[C&15]<<8|qt[C>>>4],jt[C]= -Qt[C&15]<<8|Qt[C>>>4];else for(let C=0;C<256;C++)dt[C]=qt[C&15]|qt[C>>>4]<<8,jt[C]=Qt[C&15]|Qt[C>>>4]<< +se.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. +indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};se.prototype.ref=function(){}; +se.prototype.unref=function(){};se.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( +r,e,t)};se.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var Ai=P((Kp,xa)=>{"use strict";p();xa.exports=ba()});var Mt=P((Yp,kt)=>{"use strict";p();var Df=sa(),Of=Tt(),Nf=yi(),qf=ca(),{DatabaseError:Qf}=hi(),jf=a( +r=>{var e;return e=class extends qf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),_i=a( +function(r){this.defaults=Of,this.Client=r,this.Query=this.Client.Query,this.Pool=jf(this.Client),this. +_pools=[],this.Connection=Nf,this.types=_t(),this.DatabaseError=Qf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< +"u"?kt.exports=new _i(Ai()):(kt.exports=new _i(Df),Object.defineProperty(kt.exports,"native",{configurable:!0, +enumerable:!1,get(){var r=null;try{r=new _i(Ai())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. +defineProperty(kt.exports,"native",{value:r}),r}}))});var $f={};fe($f,{Client:()=>ft,DatabaseError:()=>ve.DatabaseError,NeonDbError:()=>ue,NeonQueryPromise:()=>Le, +Pool:()=>dr,SqlTemplate:()=>tt,UnsafeRawSql:()=>rt,_bundleExt:()=>Hf,defaults:()=>ve.defaults,escapeIdentifier:()=>ve.escapeIdentifier, +escapeLiteral:()=>ve.escapeLiteral,neon:()=>on,neonConfig:()=>be,types:()=>ve.types,warnIfBrowser:()=>bt}); +module.exports=j($f);p();p();Ye();Pr();p();var wu=Object.defineProperty,gu=Object.defineProperties,bu=Object.getOwnPropertyDescriptors,ls=Object. +getOwnPropertySymbols,xu=Object.prototype.hasOwnProperty,Su=Object.prototype.propertyIsEnumerable,fs=a( +(r,e,t)=>e in r?wu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), +vu=a((r,e)=>{for(var t in e||(e={}))xu.call(e,t)&&fs(r,t,e[t]);if(ls)for(var t of ls(e))Su.call(e,t)&& +fs(r,t,e[t]);return r},"__spreadValues"),Eu=a((r,e)=>gu(r,bu(e)),"__spreadProps"),Au=1008e3,hs=new Uint8Array( +new Uint16Array([258]).buffer)[0]===2,_u=new TextDecoder,Br=new TextEncoder,Qt=Br.encode("0123456789\ +abcdef"),jt=Br.encode("0123456789ABCDEF"),Cu=Br.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ +stuvwxyz0123456789+/");var ds=Cu.slice();ds[62]=45;ds[63]=95;var dt,Wt;function Iu(r,{alphabet:e,scratchArr:t}={}){if(!dt)if(dt= +new Uint16Array(256),Wt=new Uint16Array(256),hs)for(let C=0;C<256;C++)dt[C]=Qt[C&15]<<8|Qt[C>>>4],Wt[C]= +jt[C&15]<<8|jt[C>>>4];else for(let C=0;C<256;C++)dt[C]=Qt[C&15]|Qt[C>>>4]<<8,Wt[C]=jt[C&15]|jt[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"?jt:dt,f=0,y=0,g;if(fs) +r.buffer,r.byteOffset,s),c=new Uint32Array(o.buffer,o.byteOffset,i),l=e==="upper"?Wt:dt,f=0,y=0,g;if(hs) 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;ut[pe(this. _mapKey.has(i)?this._mapKey.get(i):i)]=n),t}mapDecode(e,t){let n=this.decode(e);if(this._keyMap)switch(n. -constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return As( -()=>(Nr(),this?this.decode(e,t):mt.prototype.decode.call(ms,e,t)));We=t>-1?t:e.length,h=0,kr=0,wt=0, -$t=null,Lr=bs,W=null,x=e;try{ee=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ +constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return _s( +()=>(qr(),this?this.decode(e,t):mt.prototype.decode.call(ws,e,t)));We=t>-1?t:e.length,h=0,Mr=0,wt=0, +Gt=null,Fr=xs,W=null,x=e;try{X=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ throw x=null,e instanceof Uint8Array?n:new Error("Source must be a Uint8Array or Buffer but was a "+ -(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof mt){if(B=this,ie=this.sharedValues&& +(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof mt){if(B=this,ne=this.sharedValues&& (this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this. -structures)return N=this.structures,Wt();(!N||N.length>0)&&(N=[])}else B=ms,(!N||N.length>0)&&(N=[]), -ie=null;return Wt()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;gt=!0;let o=this?this.decode(e, -s):Qr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=W.postBundlePosition){let e=new Error("Unexpected bundle pos\ +structures)return N=this.structures,Ht();(!N||N.length>0)&&(N=[])}else B=ws,(!N||N.length>0)&&(N=[]), +ne=null;return Ht()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;gt=!0;let o=this?this.decode(e, +s):jr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=W.postBundlePosition){let e=new Error("Unexpected bundle pos\ ition");throw e.incomplete=!0,e}h=W.postBundlePosition,W=null}if(h==We)N=null,x=null,de&&(de=null);else if(h> We){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!gt)throw new Error( -"Data read, but end of buffer not reached");return r}catch(r){throw Nr(),(r instanceof RangeError||r. -message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a(Wt,"checkedRead");function L(){ -let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return Fu();r=ee. -getUint16(h),h+=2;break;case 26:if(e==7){let t=ee.getFloat32(h);if(B.useFloat32>2){let n=_s[(x[h]&127)<< -1|x[h+1]>>7];return h+=4,(n*t+(t>0?.5:-.5)>>0)/n}return h+=4,t}if(r=ee.getUint32(h),h+=4,e===1)return-1- -r;break;case 27:if(e==7){let t=ee.getFloat64(h);return h+=8,t}if(e>1){if(ee.getUint32(h)>0)throw new Error( -"JavaScript does not support arrays, maps, or strings with length over 4294967295");r=ee.getUint32(h+ -4)}else B.int64AsNumber?(r=ee.getUint32(h)*4294967296,r+=ee.getUint32(h+4)):r=ee.getBigUint64(h);h+= -8;break;case 31:switch(e){case 2:case 3:throw new Error("Indefinite length not supported for byte or\ - text strings");case 4:let t=[],n,i=0;for(;(n=L())!=Je;){if(i>=pt)throw new Error(`Array length exce\ -eds ${pt}`);t[i++]=n}return e==4?t:e==3?t.join(""):m.concat(t);case 5:let s;if(B.mapsAsObjects){let o={}, -u=0;if(B.keyMap)for(;(s=L())!=Je;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[pe(B. -decodeKey(s))]=L()}else for(;(s=L())!=Je;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`); -o[pe(s)]=L()}return o}else{yt&&(B.mapsAsObjects=!0,yt=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s= -L())!=Je;){if(u++>=_e)throw new Error(`Map size exceeds ${_e}`);o.set(B.decodeKey(s),L())}}else{let u=0; -for(;(s=L())!=Je;){if(u++>=_e)throw new Error(`Map size exceeds ${_e}`);o.set(s,L())}}return o}case 7: -return Je;default:throw new Error("Invalid major type for indefinite length "+e)}default:throw new Error( -"Unknown token "+r)}switch(e){case 0:return r;case 1:return~r;case 2:return ku(r);case 3:if(wt>=h)return $t. -slice(h-Gt,(h+=r)-Gt);if(wt==0&&We<140&&r<32){let i=r<16?Ss(r):Lu(r);if(i!=null)return i}return Bu(r);case 4: -if(r>=pt)throw new Error(`Array length exceeds ${pt}`);let t=new Array(r);for(let i=0;i=_e)throw new Error(`Map size exceeds ${pt}`);if(B.mapsAsObjects){let i={};if(B. -keyMap)for(let s=0;s=ps){let i=N[r&8191];if(i)return i. -read||(i.read=Ur(i)),i.read();if(r<65536){if(r==Ru){let s=Xe(),o=L(),u=L();Or(o,u);let c={};if(B.keyMap) -for(let l=2;l23)switch(t){case 24: -t=x[h++];break;case 25:t=ee.getUint16(h),h+=2;break;case 26:t=ee.getUint32(h),h+=4;break;default:throw new Error( -"Expected array header, but got "+x[h-1])}let n=this.compiledReader;for(;n;){if(n.propertyCount===t) -return n(L);n=n.next}if(this.slowReads++>=xs){let s=this.length==t?this:this.slice(0,t);return n=B.keyMap? -new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>ws.test(o)?pe(o)+":r()":"["+JSON.stringify( -o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>ws.test(o)?pe(o)+":r()":"["+JSON.stringify( -o)+"]:r()").join(",")+"}"),this.compiledReader&&(n.next=this.compiledReader),n.propertyCount=t,this. -compiledReader=n,n(L)}let i={};if(B.keyMap)for(let s=0;s64&&Br)return Br.decode(x.subarray(h,h+=r));let t=h+ +"Data read, but end of buffer not reached");return r}catch(r){throw qr(),(r instanceof RangeError||r. +message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a(Ht,"checkedRead");function L(){ +let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return ku();r=X. +getUint16(h),h+=2;break;case 26:if(e==7){let t=X.getFloat32(h);if(B.useFloat32>2){let n=Cs[(x[h]&127)<< +1|x[h+1]>>7];return h+=4,(n*t+(t>0?.5:-.5)>>0)/n}return h+=4,t}if(r=X.getUint32(h),h+=4,e===1)return-1- +r;break;case 27:if(e==7){let t=X.getFloat64(h);return h+=8,t}if(e>1){if(X.getUint32(h)>0)throw new Error( +"JavaScript does not support arrays, maps, or strings with length over 4294967295");r=X.getUint32(h+ +4)}else B.int64AsNumber?(r=X.getUint32(h)*4294967296,r+=X.getUint32(h+4)):r=X.getBigUint64(h);h+=8;break;case 31: +switch(e){case 2:case 3:throw new Error("Indefinite length not supported for byte or text strings");case 4: +let t=[],n,i=0;for(;(n=L())!=Je;){if(i>=pt)throw new Error(`Array length exceeds ${pt}`);t[i++]=n}return e== +4?t:e==3?t.join(""):m.concat(t);case 5:let s;if(B.mapsAsObjects){let o={},u=0;if(B.keyMap)for(;(s=L())!= +Je;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[pe(B.decodeKey(s))]=L()}else for(;(s= +L())!=Je;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[pe(s)]=L()}return o}else{yt&& +(B.mapsAsObjects=!0,yt=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s=L())!=Je;){if(u++>=_e)throw new Error( +`Map size exceeds ${_e}`);o.set(B.decodeKey(s),L())}}else{let u=0;for(;(s=L())!=Je;){if(u++>=_e)throw new Error( +`Map size exceeds ${_e}`);o.set(s,L())}}return o}case 7:return Je;default:throw new Error("Invalid m\ +ajor type for indefinite length "+e)}default:throw new Error("Unknown token "+r)}switch(e){case 0:return r;case 1: +return~r;case 2:return Mu(r);case 3:if(wt>=h)return Gt.slice(h-Vt,(h+=r)-Vt);if(wt==0&&We<140&&r<32){ +let i=r<16?vs(r):Fu(r);if(i!=null)return i}return Lu(r);case 4:if(r>=pt)throw new Error(`Array lengt\ +h exceeds ${pt}`);let t=new Array(r);for(let i=0;i=_e)throw new Error( +`Map size exceeds ${pt}`);if(B.mapsAsObjects){let i={};if(B.keyMap)for(let s=0;s=ys){let i=N[r&8191];if(i)return i.read||(i.read=Dr(i)),i.read();if(r<65536){if(r== +Bu){let s=Xe(),o=L(),u=L();Nr(o,u);let c={};if(B.keyMap)for(let l=2;l23)switch(t){case 24:t=x[h++];break;case 25:t=X.getUint16(h),h+=2;break;case 26:t=X.getUint32( +h),h+=4;break;default:throw new Error("Expected array header, but got "+x[h-1])}let n=this.compiledReader; +for(;n;){if(n.propertyCount===t)return n(L);n=n.next}if(this.slowReads++>=Ss){let s=this.length==t?this: +this.slice(0,t);return n=B.keyMap?new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>gs.test( +o)?pe(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>gs. +test(o)?pe(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"),this.compiledReader&&(n.next=this. +compiledReader),n.propertyCount=t,this.compiledReader=n,n(L)}let i={};if(B.keyMap)for(let s=0;s64&&Lr)return Lr.decode(x.subarray(h,h+=r));let t=h+ r,n=[];for(e="";h=t||(x[h]& 192)!==128)n.push(65533);else{let s=x[h++]&63;n.push((i&31)<<6|s)}else if((i&240)===224){let s=h=t||(s&192)!==128||i===224&&s<160||i===237&&s>=160)n.push(65533);else if(h++,h>=t||(x[h]&192)!== @@ -1313,9 +1312,9 @@ t?x[h]:0;if(i>244||h>=t||(s&192)!==128||i===240&&s<144||i===244&&s>=144)n.push(6 t||(x[h]&192)!==128)n.push(65533);else{let o=x[h++]&63;if(h>=t||(x[h]&192)!==128)n.push(65533);else{ let u=x[h++]&63,c=(i&7)<<18|(s&63)<<12|o<<6|u;c-=65536,n.push(c>>>10&1023|55296),n.push(56320|c&1023)}}}else n.push(65533);n.length>=4096&&(e+=V.apply(String,n),n.length=0)}return n.length>0&&(e+=V.apply(String, -n)),e}a(Dr,"readStringJS");var V=String.fromCharCode;function Lu(r){let e=h,t=new Array(r);for(let n=0;n< -r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return V.apply(String,t)}a(Lu,"longStringInJS"); -function Ss(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return V(e)}}else{ +n)),e}a(Or,"readStringJS");var V=String.fromCharCode;function Fu(r){let e=h,t=new Array(r);for(let n=0;n< +r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return V.apply(String,t)}a(Fu,"longStringInJS"); +function vs(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return V(e)}}else{ let e=x[h++],t=x[h++];if((e&128)>0||(t&128)>0){h-=2;return}if(r<3)return V(e,t);let n=x[h++];if((n&128)> 0){h-=3;return}return V(e,t,n)}else{let e=x[h++],t=x[h++],n=x[h++],i=x[h++];if((e&128)>0||(t&128)>0|| (n&128)>0||(i&128)>0){h-=4;return}if(r<6){if(r===4)return V(e,t,n,i);{let s=x[h++];if((s&128)>0){h-= @@ -1328,63 +1327,63 @@ let y=x[h++];if((y&128)>0){h-=11;return}return V(e,t,n,i,s,o,u,c,l,f,y)}else{let g=x[h++];if((l&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return V(e,t, n,i,s,o,u,c,l,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E)}}else{ let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return V(e,t,n,i,s,o,u,c,l,f,y,g, -E,C);let H=x[h++];if((H&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E,C,H)}}}}}a(Ss,"short\ -StringInJS");function ku(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( -h,h+=r)}a(ku,"readBin");var vs=new Float32Array(1),Ht=new Uint8Array(vs.buffer,0,4);function Fu(){let r=x[h++],e=x[h++],t=(r& +E,C);let H=x[h++];if((H&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E,C,H)}}}}}a(vs,"short\ +StringInJS");function Mu(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( +h,h+=r)}a(Mu,"readBin");var Es=new Float32Array(1),$t=new Uint8Array(Es.buffer,0,4);function ku(){let r=x[h++],e=x[h++],t=(r& 127)>>2;if(t===31)return e||r&3?NaN:r&128?-1/0:1/0;if(t===0){let n=((r&3)<<8|e)/16777216;return r&128? --n:n}return Ht[3]=r&128|(t>>1)+56,Ht[2]=(r&7)<<5|e>>3,Ht[1]=e<<5,Ht[0]=0,vs[0]}a(Fu,"getFloat16");var uh=new Array( -4096);var jr=class jr{constructor(e,t){this.value=e,this.tag=t}};a(jr,"Tag");var et=jr;q[0]=r=>new Date(r); +-n:n}return $t[3]=r&128|(t>>1)+56,$t[2]=(r&7)<<5|e>>3,$t[1]=e<<5,$t[0]=0,Es[0]}a(ku,"getFloat16");var hh=new Array( +4096);var Wr=class Wr{constructor(e,t){this.value=e,this.tag=t}};a(Wr,"Tag");var et=Wr;q[0]=r=>new Date(r); q[1]=r=>new Date(Math.round(r*1e3));q[2]=r=>{let e=BigInt(0);for(let t=0,n=r.byteLength;tBigInt(-1)-q[2](r);q[4]=r=>+(r[1]+"e"+r[0]);q[5]=r=>r[1]*Math. -exp(r[0]*Math.log(2));var Or=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. -restoreStructures=[]))[r]=t),N[r]=e,e.read=Ur(e)},"recordDefinition");q[Tu]=r=>{let e=r.length,t=r[1]; -Or(r[0],t);let n={};for(let i=2;iW?W[0].slice( +exp(r[0]*Math.log(2));var Nr=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. +restoreStructures=[]))[r]=t),N[r]=e,e.read=Dr(e)},"recordDefinition");q[Ru]=r=>{let e=r.length,t=r[1]; +Nr(r[0],t);let n={};for(let i=2;iW?W[0].slice( W.position0,W.position0+=r):new et(r,14);q[15]=r=>W?W[1].slice(W.position1,W.position1+=r):new et(r, -15);var Mu={Error,RegExp};q[27]=r=>(Mu[r[0]]||Error)(r[1],r[2]);var Es=a(r=>{if(x[h++]!=132){let t=new Error( +15);var Uu={Error,RegExp};q[27]=r=>(Uu[r[0]]||Error)(r[1],r[2]);var As=a(r=>{if(x[h++]!=132){let t=new Error( "Packed values structure must be followed by a 4 element array");throw x.length{if(!ie)if(B.getShared)qr();else return new et( -r,ys);if(typeof r=="number")return ie[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ +nt array");throw t.incomplete=!0,t}return ne=ne?e.concat(ne.slice(e.length)):e,ne.prefixes=r(),ne.suffixes= +r(),r()},"packedTable");As.handlesRead=!0;q[51]=As;q[ms]=r=>{if(!ne)if(B.getShared)Qr();else return new et( +r,ms);if(typeof r=="number")return ne[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ ger packed references yet");throw r===void 0&&(e.incomplete=!0),e};q[28]=r=>{de||(de=new Map,de.id=0); let e=de.id++,t=h,n=x[h],i;n>>5==4?i=[]:i={};let s={target:i};de.set(e,s);let o=r();return s.used?(Object. getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(h=t,i=o,de.set(e,{target:i}),o=r()),Object.assign(i,o)): (s.target=o,o)};q[28].handlesRead=!0;q[29]=r=>{let e=de.get(r);return e.used=!0,e.target};q[258]=r=>new Set( r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,yt=!0),r())).handlesRead=!0;function Ze(r,e){return typeof r== -"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Ze,"combine");function je(){if(!ie) -if(B.getShared)qr();else throw new Error("No packed values available");return ie}a(je,"getPackedValu\ -es");var Uu=1399353956;Fr.push((r,e)=>{if(r>=225&&r<=255)return Ze(je().prefixes[r-224],e);if(r>=28704&& +"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Ze,"combine");function je(){if(!ne) +if(B.getShared)Qr();else throw new Error("No packed values available");return ne}a(je,"getPackedValu\ +es");var Du=1399353956;kr.push((r,e)=>{if(r>=225&&r<=255)return Ze(je().prefixes[r-224],e);if(r>=28704&& r<=32767)return Ze(je().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return Ze(je().prefixes[r- 1879048192],e);if(r>=216&&r<=223)return Ze(e,je().suffixes[r-216]);if(r>=27647&&r<=28671)return Ze(e, je().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return Ze(e,je().suffixes[r-1811939328]);if(r== -Uu)return{packedValues:ie,structures:N.slice(0),version:e};if(r==55799)return e});var Du=new Uint8Array( -new Uint16Array([1]).buffer)[0]==1,gs=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> +Du)return{packedValues:ne,structures:N.slice(0),version:e};if(r==55799)return e});var Ou=new Uint8Array( +new Uint16Array([1]).buffer)[0]==1,bs=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> "u"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"? -{name:"BigInt64Array"}:BigInt64Array,Float32Array,Float64Array],Ou=[64,68,69,70,71,72,77,78,79,85,86]; -for(let r=0;r{if(!r)throw new Error("Could not find typed array for code "+e); +2:n==8?3:0;q[i?e:e-4]=n==1||i==Ou?o=>{if(!r)throw new Error("Could not find typed array for code "+e); return!B.copyBuffers&&(n===1||n===2&&!(o.byteOffset&1)||n===4&&!(o.byteOffset&3)||n===8&&!(o.byteOffset& 7))?new r(o.buffer,o.byteOffset,o.byteLength>>s):new r(Uint8Array.prototype.slice.call(o,0).buffer)}: o=>{if(!r)throw new Error("Could not find typed array for code "+e);let u=new DataView(o.buffer,o.byteOffset, o.byteLength),c=o.length>>s,l=new r(c),f=u[t];for(let y=0;y23)switch(r){case 24:r=x[h++];break;case 25:r=ee.getUint16( -h),h+=2;break;case 26:r=ee.getUint32(h),h+=4;break}return r}a(Xe,"readJustLength");function qr(){if(B. -getShared){let r=As(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ie= -B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(qr, -"loadShared");function As(r){let e=We,t=h,n=kr,i=Gt,s=wt,o=$t,u=Lr,c=de,l=W,f=new Uint8Array(x.slice( -0,We)),y=N,g=B,E=gt,C=r();return We=e,h=t,kr=n,Gt=i,wt=s,$t=o,Lr=u,de=c,W=l,x=f,gt=E,N=y,B=g,ee=new DataView( -x.buffer,x.byteOffset,x.byteLength),C}a(As,"saveState");function Nr(){x=null,de=null,N=null}a(Nr,"cl\ -earSource");var _s=new Array(147);for(let r=0;r<256;r++)_s[r]=+("1e"+Math.floor(45.15-r*.30103));var Qr=new Mr({ -useRecords:!1}),ch=Qr.decode,Cs=Qr.decodeMultiple;p();var Vt=class Vt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ +qu,"registerTypedArray");function Qu(){let r=Xe(),e=h+L();for(let n=2;n23)switch(r){case 24:r=x[h++];break;case 25:r=X.getUint16( +h),h+=2;break;case 26:r=X.getUint32(h),h+=4;break}return r}a(Xe,"readJustLength");function Qr(){if(B. +getShared){let r=_s(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ne= +B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(Qr, +"loadShared");function _s(r){let e=We,t=h,n=Mr,i=Vt,s=wt,o=Gt,u=Fr,c=de,l=W,f=new Uint8Array(x.slice( +0,We)),y=N,g=B,E=gt,C=r();return We=e,h=t,Mr=n,Vt=i,wt=s,Gt=o,Fr=u,de=c,W=l,x=f,gt=E,N=y,B=g,X=new DataView( +x.buffer,x.byteOffset,x.byteLength),C}a(_s,"saveState");function qr(){x=null,de=null,N=null}a(qr,"cl\ +earSource");var Cs=new Array(147);for(let r=0;r<256;r++)Cs[r]=+("1e"+Math.floor(45.15-r*.30103));var jr=new Ur({ +useRecords:!1}),dh=jr.decode,Is=jr.decodeMultiple;p();var Kt=class Kt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ let{strings:t,values:n}=this;for(let i=0,s=t.length;iu.length!==0).map(u=>JSON.parse(u)):Cs(new Uint8Array(await r.arrayBuffer())),i=n.at(-1); -if(i?.type!=="end")throw new Y("Neon internal error: streamed response ended without a terminal mess\ -age");if(i.status==="error")throw ho(i.error);if(i.status!=="ok")throw new Y("Neon internal error: u\ -nexpected streamed response status");let s=[],o;for(let u of n.slice(0,-1))switch(u.type){case"colum\ -ns":if(o!==void 0||!Array.isArray(u.columns))throw new Y("Neon internal error: unexpected streamed r\ -esponse message");o={fields:u.columns,rows:[]};break;case"row":if(o===void 0||!Array.isArray(u.row)) -throw new Y("Neon internal error: unexpected streamed response message");o.rows.push(u.row);break;case"\ -query":if(o===void 0||u.query===void 0)throw new Y("Neon internal error: unexpected streamed respons\ -e message");s.push({fields:o.fields,rows:o.rows,command:u.query.command,rowCount:u.query.rowCount}), -o=void 0;break;default:throw new Y("Neon internal error: unexpected streamed response message")}if(o!== -void 0||!t&&s.length!==1)throw new Y("Neon internal error: incomplete streamed response");return t?{ -results:s}:s[0]}a(zc,"readStreamingResult");function Yc(r){return r instanceof m?"\\x"+ds(r):r}a(Yc, -"encodeBuffersAsBytea");function uo(r){let{query:e,params:t}=r instanceof tt?r.toParameterizedQuery(): -r;return{query:e,params:t.map(n=>Yc((0,fo.prepareValue)(n)))}}a(uo,"prepareQuery");function sn(r,{arrayMode:e, +tackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,tr)}};a( +tr,"NeonDbError");var ue=tr,uo="transaction() expects an array of queries, or a function returning a\ +n array of queries",Kc=["severity","code","detail","hint","position","internalPosition","internalQue\ +ry","where","schema","table","column","dataType","constraint","file","line","routine"],zc={json:"app\ +lication/json",jsonl:"application/vnd.neon.sql.v1+json","cbor-seq":"application/vnd.neon.sql.v1+cbor"}, +Yc=0,Jc=1,Zc=2;function po(r){let e=new ue(r.message);for(let t of Kc)e[t]=r[t]??void 0;return e}a(po, +"dbError");function Pt(){throw new ue("Neon internal error: unexpected streamed response message")}a( +Pt,"unexpectedStreamingMessage");async function Xc(r,e,t){let n=e==="jsonl"?(await r.text()).split(`\ + +`).filter(u=>u.length!==0).map(u=>JSON.parse(u)):Is(new Uint8Array(await r.arrayBuffer())),i=n.at(-1); +if(!Array.isArray(i)||i[0]!==3&&i[0]!==4)throw new ue("Neon internal error: streamed response ended \ +without a terminal message");if(i[0]===4&&i.length===2&&i[1]!==null&&typeof i[1]=="object")throw po( +i[1]);if(i[0]!==3||i.length!==1)throw new ue("Neon internal error: unexpected streamed response stat\ +us");let s=[],o;for(let u of n.slice(0,-1)){Array.isArray(u)||Pt();let[c,...l]=u;switch(c){case Jc:o!== +void 0&&Pt(),o={fields:l,rows:[]};break;case Yc:o===void 0&&Pt(),o.rows.push(l);break;case Zc:(o===void 0|| +l.length!==2)&&Pt(),s.push({fields:o.fields,rows:o.rows,command:l[0],rowCount:l[1]}),o=void 0;break;default: +Pt()}}if(o!==void 0||!t&&s.length!==1)throw new ue("Neon internal error: incomplete streamed respons\ +e");return t?{results:s}:s[0]}a(Xc,"readStreamingResult");function el(r){return r instanceof m?"\\x"+ +ps(r):r}a(el,"encodeBuffersAsBytea");function co(r){let{query:e,params:t}=r instanceof tt?r.toParameterizedQuery(): +r;return{query:e,params:t.map(n=>el((0,ho.prepareValue)(n)))}}a(co,"prepareQuery");function on(r,{arrayMode:e, fullResults:t,fetchOptions:n,responseFormat:i,isolationLevel:s,readOnly:o,deferrable:u,authToken:c,disableWarningInBrowsers:l}={}){ if(!r)throw new Error("No database connection string was provided to `neon()`. Perhaps an environmen\ -t variable has not been set?");let f;try{f=Tr(r)}catch{throw new Error("Database connection string p\ +t variable has not been set?");let f;try{f=Rr(r)}catch{throw new Error("Database connection string p\ rovided to `neon()` is not a valid URL. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E, port:C,pathname:H}=f;if(y!=="postgres:"&&y!=="postgresql:"||!g||!E||!H)throw new Error("Database con\ -nection string format for `neon()` should be: postgresql://user@host.tld/dbname?option=value");function J(T,...b){ +nection string format for `neon()` should be: postgresql://user@host.tld/dbname?option=value");function Y(T,...b){ if(!(Array.isArray(T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can no\ w be called only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], \ options). For a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SE\ -LECT $1", [value], options).');return new Le(we,new tt(T,b))}a(J,"templateFn"),J.query=(T,b,F)=>new Le( -we,{query:T,params:b??[]},F),J.unsafe=T=>new rt(T),J.transaction=async(T,b)=>{if(typeof T=="function"&& -(T=T(J)),!Array.isArray(T))throw new Error(ao);T.forEach($=>{if(!($ instanceof Le))throw new Error(ao)}); -let F=T.map($=>$.queryData),ae=T.map($=>$.opts??{});return we(F,ae,b)};async function we(T,b,F){let{ -fetchEndpoint:ae,fetchFunction:$}=be,ge=Array.isArray(T),Ie=ge?{queries:T.map(le=>uo(le))}:uo(T),ce=n?? -{},k=i??"json",Z=e??!1,Ee=t??!1,Te=s,Me=o,Ue=u;F!==void 0&&(F.fetchOptions!==void 0&&(ce={...ce,...F. -fetchOptions}),F.arrayMode!==void 0&&(Z=F.arrayMode),F.fullResults!==void 0&&(Ee=F.fullResults),F.responseFormat!== -void 0&&(k=F.responseFormat),F.isolationLevel!==void 0&&(Te=F.isolationLevel),F.readOnly!==void 0&&(Me= -F.readOnly),F.deferrable!==void 0&&(Ue=F.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!== -void 0&&(ce={...ce,...b.fetchOptions}),b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(k= -b.responseFormat);let De=c;!Array.isArray(b)&&b?.authToken!==void 0&&(De=b.authToken);let dr=typeof ae== -"function"?ae(E,C,{jwtAuth:De!==void 0}):ae,Oe={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ -rue","Neon-Array-Mode":"true",Accept:Kc[k]},Pe=await Jc(De);Pe&&(Oe.Authorization=`Bearer ${Pe}`),ge&& -(Te!==void 0&&(Oe["Neon-Batch-Isolation-Level"]=Te),Me!==void 0&&(Oe["Neon-Batch-Read-Only"]=String( -Me)),Ue!==void 0&&(Oe["Neon-Batch-Deferrable"]=String(Ue))),l||be.disableWarningInBrowsers||bt();let X; -try{X=await($??fetch)(dr,{method:"POST",body:JSON.stringify(Ie),headers:Oe,...ce})}catch(le){let ue=new Y( -`Error connecting to database: ${le}`);throw ue.sourceError=le,ue}if(X.ok){let le=k==="json"?await X. -json():await zc(X,k,ge);if(ge){let ue=le.results;if(!Array.isArray(ue))throw new Y("Neon internal er\ -ror: unexpected result format");return ue.map((pr,yr)=>{let mr=b[yr]??{},Ea=mr.arrayMode??Z,Aa=mr.fullResults?? -Ee;return co(pr,{arrayMode:Ea,fullResults:Aa,types:mr.types})})}else{let ue=b??{},pr=ue.arrayMode??Z, -yr=ue.fullResults??Ee;return co(le,{arrayMode:pr,fullResults:yr,types:ue.types})}}else{let{status:le}=X; -if(le===400){let ue=await X.json();throw ho(ue)}else{let ue=await X.text();throw new Y(`Server error\ - (HTTP status ${le}): ${ue}`)}}}return a(we,"execute"),J}a(sn,"neon");var on=class on{constructor(e,t,n){ +LECT $1", [value], options).');return new Le(we,new tt(T,b))}a(Y,"templateFn"),Y.query=(T,b,M)=>new Le( +we,{query:T,params:b??[]},M),Y.unsafe=T=>new rt(T),Y.transaction=async(T,b)=>{if(typeof T=="function"&& +(T=T(Y)),!Array.isArray(T))throw new Error(uo);T.forEach($=>{if(!($ instanceof Le))throw new Error(uo)}); +let M=T.map($=>$.queryData),oe=T.map($=>$.opts??{});return we(M,oe,b)};async function we(T,b,M){let{ +fetchEndpoint:oe,fetchFunction:$}=be,ge=Array.isArray(T),Ie=ge?{queries:T.map(le=>co(le))}:co(T),ce=n?? +{},F=i??"json",J=e??!1,Ee=t??!1,Te=s,ke=o,Ue=u;M!==void 0&&(M.fetchOptions!==void 0&&(ce={...ce,...M. +fetchOptions}),M.arrayMode!==void 0&&(J=M.arrayMode),M.fullResults!==void 0&&(Ee=M.fullResults),M.responseFormat!== +void 0&&(F=M.responseFormat),M.isolationLevel!==void 0&&(Te=M.isolationLevel),M.readOnly!==void 0&&(ke= +M.readOnly),M.deferrable!==void 0&&(Ue=M.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!== +void 0&&(ce={...ce,...b.fetchOptions}),b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(F= +b.responseFormat);let De=c;!Array.isArray(b)&&b?.authToken!==void 0&&(De=b.authToken);let pr=typeof oe== +"function"?oe(E,C,{jwtAuth:De!==void 0}):oe,Oe={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ +rue","Neon-Array-Mode":"true",Accept:zc[F]},Re=await tl(De);Re&&(Oe.Authorization=`Bearer ${Re}`),ge&& +(Te!==void 0&&(Oe["Neon-Batch-Isolation-Level"]=Te),ke!==void 0&&(Oe["Neon-Batch-Read-Only"]=String( +ke)),Ue!==void 0&&(Oe["Neon-Batch-Deferrable"]=String(Ue))),l||be.disableWarningInBrowsers||bt();let Z; +try{Z=await($??fetch)(pr,{method:"POST",body:JSON.stringify(Ie),headers:Oe,...ce})}catch(le){let ae=new ue( +`Error connecting to database: ${le}`);throw ae.sourceError=le,ae}if(Z.ok){let le=F==="json"?await Z. +json():await Xc(Z,F,ge);if(ge){let ae=le.results;if(!Array.isArray(ae))throw new ue("Neon internal e\ +rror: unexpected result format");return ae.map((yr,mr)=>{let wr=b[mr]??{},Aa=wr.arrayMode??J,_a=wr.fullResults?? +Ee;return lo(yr,{arrayMode:Aa,fullResults:_a,types:wr.types})})}else{let ae=b??{},yr=ae.arrayMode??J, +mr=ae.fullResults??Ee;return lo(le,{arrayMode:yr,fullResults:mr,types:ae.types})}}else{let{status:le}=Z; +if(le===400){let ae=await Z.json();throw po(ae)}else{let ae=await Z.text();throw new ue(`Server erro\ +r (HTTP status ${le}): ${ae}`)}}}return a(we,"execute"),Y}a(on,"neon");var an=class an{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(on,"NeonQueryPromise");var Le=on;function co(r,{arrayMode:e, -fullResults:t,types:n}){let i=new lo.default(n),s=r.fields.map(c=>c.name),o=r.fields.map(c=>i.getTypeParser( +this.queryData,this.opts).finally(e)}};a(an,"NeonQueryPromise");var Le=an;function lo(r,{arrayMode:e, +fullResults:t,types:n}){let i=new fo.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(co,"processQueryResult");async function Jc(r){if(typeof r=="string")return r;if(typeof r== -"function")try{return await Promise.resolve(r())}catch(e){let t=new Y("Error getting auth token.");throw e instanceof -Error&&(t=new Y(`Error getting auth token: ${e.message}`)),t}}a(Jc,"getAuthToken");p();var Sa=Ne(kt());p();var xa=Ne(kt());var _i=class _i extends xa.Client{constructor(t){super(t);this.config=t}get neonConfig(){return this. +o,r._types=i,r):u}a(lo,"processQueryResult");async function tl(r){if(typeof r=="string")return r;if(typeof r== +"function")try{return await Promise.resolve(r())}catch(e){let t=new ue("Error getting auth token."); +throw e instanceof Error&&(t=new ue(`Error getting auth token: ${e.message}`)),t}}a(tl,"getAuthToken");p();var va=Ne(Mt());p();var Sa=Ne(Mt());var Ci=class Ci extends Sa.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\ @@ -1485,8 +1483,8 @@ bt(),this._handleAuthCleartextPassword(),this._handleReadyForQuery()})}return o} 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(Pe=>{if(!/^.=/.test(Pe))throw new Error( -"SASL: Invalid attribute pair entry");let X=Pe[0],le=Pe.substring(2);return[X,le]})),c=u.r,l=u.s,f=u. +"SASL: protocol error");let u=Object.fromEntries(o.split(",").map(Re=>{if(!/^.=/.test(Re))throw new Error( +"SASL: Invalid attribute pair entry");let Z=Re[0],le=Re.substring(2);return[Z,le]})),c=u.r,l=u.s,f=u. i;if(!c||!/^[!-+--~]+$/.test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unp\ rintable");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( @@ -1494,27 +1492,27 @@ rintable");if(!l||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3} 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=m.from(l,"base64"),E=new TextEncoder,C=E.encode(s),H=await n.importKey( -"raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),J=new Uint8Array(await n.sign("HMAC",H,m.concat( -[g,m.from([0,0,0,1])]))),we=J;for(var T=0;Twe[X]^J[X]));let b=we,F=await n.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-2\ -56"}},!1,["sign"]),ae=new Uint8Array(await n.sign("HMAC",F,E.encode("Client Key"))),$=await n.digest( -"SHA-256",ae),ge="n=*,r="+i.clientNonce,Ie="r="+c+",s="+l+",i="+y,ce="c=biws,r="+c,k=ge+","+Ie+","+ce, -Z=await n.importKey("raw",$,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Ee=new Uint8Array(await n. -sign("HMAC",Z,E.encode(k))),Te=m.from(ae.map((Pe,X)=>ae[X]^Ee[X])),Me=Te.toString("base64");let Ue=await n. +"raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Y=new Uint8Array(await n.sign("HMAC",H,m.concat( +[g,m.from([0,0,0,1])]))),we=Y;for(var T=0;Twe[Z]^Y[Z]));let b=we,M=await n.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-2\ +56"}},!1,["sign"]),oe=new Uint8Array(await n.sign("HMAC",M,E.encode("Client Key"))),$=await n.digest( +"SHA-256",oe),ge="n=*,r="+i.clientNonce,Ie="r="+c+",s="+l+",i="+y,ce="c=biws,r="+c,F=ge+","+Ie+","+ce, +J=await n.importKey("raw",$,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Ee=new Uint8Array(await n. +sign("HMAC",J,E.encode(F))),Te=m.from(oe.map((Re,Z)=>oe[Z]^Ee[Z])),ke=Te.toString("base64");let Ue=await n. importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),De=await n.sign("HMAC",Ue,E.encode( -"Server Key")),dr=await n.importKey("raw",De,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Oe=m. -from(await n.sign("HMAC",dr,E.encode(k)));i.message="SASLResponse",i.serverSignature=Oe.toString("ba\ -se64"),i.response=ce+",p="+Me,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; -a(_i,"NeonClient");var ft=_i;Ye();var va=Ne(ir());function Nf(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(Nf,"promisify");var Ci=class Ci extends Sa.Pool{constructor(){ +"Server Key")),pr=await n.importKey("raw",De,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Oe=m. +from(await n.sign("HMAC",pr,E.encode(F)));i.message="SASLResponse",i.serverSignature=Oe.toString("ba\ +se64"),i.response=ce+",p="+ke,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; +a(Ci,"NeonClient");var ft=Ci;Ye();var Ea=Ne(sr());function Wf(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(Wf,"promisify");var Ii=class Ii extends va.Pool{constructor(){ super(...arguments);I(this,"Client",ft);I(this,"hasFetchUnsupportedListeners",!1);I(this,"addListene\ r",this.on)}on(t,n){return t!=="error"&&(this.hasFetchUnsupportedListeners=!0),super.on(t,n)}query(t,n,i){ if(!be.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof t=="function")return super.query( -t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=Nf(this.Promise,i);i=s.callback;try{let o=new va.default( +t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=Wf(this.Promise,i);i=s.callback;try{let o=new Ea.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??[];sn(l,{fullResults:!0,arrayMode:t. +/${c(o.database)}`,f=typeof t=="string"?t:t.text,y=n??t.values??[];on(l,{fullResults:!0,arrayMode:t. rowMode==="array"}).query(f,y,{types:t.types??this.options?.types}).then(E=>i(void 0,E)).catch(E=>i( -E))}catch(o){i(o)}return s.result}};a(Ci,"NeonPool");var hr=Ci;Ye();var ve=Ne(kt()),qf="js"; +E))}catch(o){i(o)}return s.result}};a(Ii,"NeonPool");var dr=Ii;Ye();var ve=Ne(Mt()),Hf="js"; /*! Bundled license information: ieee754/index.js: diff --git a/index.mjs b/index.mjs index a6760dc..4ebade4 100644 --- a/index.mjs +++ b/index.mjs @@ -1,72 +1,72 @@ /* @ts-self-types="./index.d.mts" */ -var _a=Object.create;var We=Object.defineProperty;var Ca=Object.getOwnPropertyDescriptor;var Ia=Object.getOwnPropertyNames;var Ta=Object.getPrototypeOf,Pa=Object.prototype.hasOwnProperty;var Ra=(r,e,t)=>e in r?We(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>We(r,"name",{value:e,configurable:!0});var re=(r,e)=>()=>(r&&(e=r(r=0)),e);var R=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ge=(r,e)=>{for(var t in e)We(r,t,{get:e[t], -enumerable:!0})},Ci=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ia(e))!Pa. -call(r,i)&&i!==t&&We(r,i,{get:()=>e[i],enumerable:!(n=Ca(e,i))||n.enumerable});return r};var De=(r,e,t)=>(t=r!=null?_a(Ta(r)):{},Ci(e||!r||!r.__esModule?We(t,"default",{value:r,enumerable:!0}): -t,r)),$=r=>Ci(We({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Ra(r,typeof e!="symbol"?e+"":e,t);var Pi=R(Ft=>{"use strict";p();Ft.byteLength=La;Ft.toByteArray=Fa;Ft.fromByteArray=Da;var be=[],fe=[], -Ba=typeof Uint8Array<"u"?Uint8Array:Array,mr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ -23456789+/";for(Oe=0,Ii=mr.length;Oe0)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(Ti,"getLens"); -function La(r){var e=Ti(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(La,"byteLength");function ka(r,e,t){return(e+ -t)*3/4-t}a(ka,"_byteLength");function Fa(r){var e,t=Ti(r),n=t[0],i=t[1],s=new Ba(ka(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=fe[r.charCodeAt( -c)]<<2|fe[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=fe[r.charCodeAt(c)]<<10|fe[r.charCodeAt(c+1)]<< -4|fe[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(Fa,"toByteArray");function Ma(r){return be[r>> -18&63]+be[r>>12&63]+be[r>>6&63]+be[r&63]}a(Ma,"tripletToBase64");function Ua(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(Ma(n));return i.join("")}a(Ua,"en\ -codeChunk");function Da(r){for(var e,t=r.length,n=t%3,i=[],s=16383,o=0,u=t-n;oe in r?We(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>We(r,"name",{value:e,configurable:!0});var te=(r,e)=>()=>(r&&(e=r(r=0)),e);var P=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ge=(r,e)=>{for(var t in e)We(r,t,{get:e[t], +enumerable:!0})},Ii=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ta(e))!Pa. +call(r,i)&&i!==t&&We(r,i,{get:()=>e[i],enumerable:!(n=Ia(e,i))||n.enumerable});return r};var De=(r,e,t)=>(t=r!=null?Ca(Ra(r)):{},Ii(e||!r||!r.__esModule?We(t,"default",{value:r,enumerable:!0}): +t,r)),$=r=>Ii(We({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Ba(r,typeof e!="symbol"?e+"":e,t);var Pi=P(kt=>{"use strict";p();kt.byteLength=Fa;kt.toByteArray=ka;kt.fromByteArray=Oa;var be=[],le=[], +La=typeof Uint8Array<"u"?Uint8Array:Array,wr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ +23456789+/";for(Oe=0,Ti=wr.length;Oe0)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(Ri,"getLens"); +function Fa(r){var e=Ri(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Fa,"byteLength");function Ma(r,e,t){return(e+ +t)*3/4-t}a(Ma,"_byteLength");function ka(r){var e,t=Ri(r),n=t[0],i=t[1],s=new La(Ma(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=le[r.charCodeAt( +c)]<<2|le[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=le[r.charCodeAt(c)]<<10|le[r.charCodeAt(c+1)]<< +4|le[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(ka,"toByteArray");function Ua(r){return be[r>> +18&63]+be[r>>12&63]+be[r>>6&63]+be[r&63]}a(Ua,"tripletToBase64");function Da(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(Ua(n));return i.join("")}a(Da,"en\ +codeChunk");function Oa(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(be[e>>2]+be[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1], -i.push(be[e>>10]+be[e>>4&63]+be[e<<2&63]+"=")),i.join("")}a(Da,"fromByteArray")});var Ri=R(wr=>{p();wr.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(be[e>>10]+be[e>>4&63]+be[e<<2&63]+"=")),i.join("")}a(Oa,"fromByteArray")});var Bi=P(gr=>{p();gr.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,E=r[e+y];for(y+=g,s=E&(1<<-f)-1,E>>=-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:(E?-1:1)*(1/0);o=o+Math. -pow(2,n),s=s-l}return(E?-1:1)*o*Math.pow(2,s-n)};wr.write=function(r,e,t,n,i,s){var o,u,c,l=s*8-i-1, +pow(2,n),s=s-l}return(E?-1:1)*o*Math.pow(2,s-n)};gr.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,E=n?0:s-1,C=n?1:-1,W=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+E]=u&255,E+= -C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=W*128}});var Vi=R(Ve=>{"use strict";p();var gr=Pi(),$e=Ri(),Bi=typeof Symbol=="function"&&typeof Symbol.for== -"function"?Symbol.for("nodejs.util.inspect.custom"):null;Ve.Buffer=d;Ve.SlowBuffer=Wa;Ve.INSPECT_MAX_BYTES= -50;var Mt=2147483647;Ve.kMaxLength=Mt;d.TYPED_ARRAY_SUPPORT=Oa();!d.TYPED_ARRAY_SUPPORT&&typeof console< +C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=W*128}});var Ki=P(Ve=>{"use strict";p();var br=Pi(),$e=Bi(),Li=typeof Symbol=="function"&&typeof Symbol.for== +"function"?Symbol.for("nodejs.util.inspect.custom"):null;Ve.Buffer=d;Ve.SlowBuffer=Ha;Ve.INSPECT_MAX_BYTES= +50;var Ut=2147483647;Ve.kMaxLength=Ut;d.TYPED_ARRAY_SUPPORT=Na();!d.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 Oa(){ +pport which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Na(){ 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(Oa,"typedArraySupport");Object. +prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}a(Na,"typedArraySupport");Object. defineProperty(d.prototype,"parent",{enumerable:!0,get:a(function(){if(d.isBuffer(this))return this. buffer},"get")});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:a(function(){if(d.isBuffer( -this))return this.byteOffset},"get")});function Ee(r){if(r>Mt)throw new RangeError('The value "'+r+'\ +this))return this.byteOffset},"get")});function Ee(r){if(r>Ut)throw new RangeError('The value "'+r+'\ " is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,d.prototype), e}a(Ee,"createBuffer");function d(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 vr(r)}return Mi(r,e,t)} -a(d,"Buffer");d.poolSize=8192;function Mi(r,e,t){if(typeof r=="string")return qa(r,e);if(ArrayBuffer. -isView(r))return Qa(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 Er(r)}return Ui(r,e,t)} +a(d,"Buffer");d.poolSize=8192;function Ui(r,e,t){if(typeof r=="string")return Qa(r,e);if(ArrayBuffer. +isView(r))return ja(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(xe(r,ArrayBuffer)|| r&&xe(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(xe(r,SharedArrayBuffer)||r&&xe(r.buffer, -SharedArrayBuffer)))return xr(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument\ +SharedArrayBuffer)))return Sr(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 d. -from(n,e,t);let i=ja(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. +from(n,e,t);let i=Wa(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. toPrimitive]=="function")return d.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(Mi,"from");d.from=function(r,e,t){return Mi(r,e,t)};Object.setPrototypeOf(d.prototype, -Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Ui(r){if(typeof r!="number")throw new TypeError( +ed type "+typeof r)}a(Ui,"from");d.from=function(r,e,t){return Ui(r,e,t)};Object.setPrototypeOf(d.prototype, +Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Di(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(Ui,"assertSize");function Na(r,e,t){return Ui(r),r<=0?Ee(r):e!==void 0?typeof t== -"string"?Ee(r).fill(e,t):Ee(r).fill(e):Ee(r)}a(Na,"alloc");d.alloc=function(r,e,t){return Na(r,e,t)}; -function vr(r){return Ui(r),Ee(r<0?0:Er(r)|0)}a(vr,"allocUnsafe");d.allocUnsafe=function(r){return vr( -r)};d.allocUnsafeSlow=function(r){return vr(r)};function qa(r,e){if((typeof e!="string"||e==="")&&(e= -"utf8"),!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=Di(r,e)|0,n=Ee(t),i=n.write( -r,e);return i!==t&&(n=n.slice(0,i)),n}a(qa,"fromString");function br(r){let e=r.length<0?0:Er(r.length)| -0,t=Ee(e);for(let n=0;n=Mt)throw new RangeError("Attempt to allocate Buffer larger t\ -han maximum size: 0x"+Mt.toString(16)+" bytes");return r|0}a(Er,"checked");function Wa(r){return+r!= -r&&(r=0),d.alloc(+r)}a(Wa,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== +r,e,t),Object.setPrototypeOf(n,d.prototype),n}a(Sr,"fromArrayBuffer");function Wa(r){if(d.isBuffer(r)){ +let e=Ar(r.length)|0,t=Ee(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r. +length!="number"||Cr(r.length)?Ee(0):xr(r);if(r.type==="Buffer"&&Array.isArray(r.data))return xr(r.data)} +a(Wa,"fromObject");function Ar(r){if(r>=Ut)throw new RangeError("Attempt to allocate Buffer larger t\ +han maximum size: 0x"+Ut.toString(16)+" bytes");return r|0}a(Ar,"checked");function Ha(r){return+r!= +r&&(r=0),d.alloc(+r)}a(Ha,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== d.prototype},"isBuffer");d.compare=a(function(e,t){if(xe(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)), xe(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.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, @@ -78,18 +78,18 @@ utf-16le":return!0;default:return!1}},"isEncoding");d.concat=a(function(e,t){if( for(t=0,n=0;ni.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(i,s)):Uint8Array.prototype. set.call(i,o,s);else if(d.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 Di(r,e){if(d.isBuffer(r))return r.length; +an Array of Buffers');s+=o.length}return i},"concat");function Oi(r,e){if(d.isBuffer(r))return r.length; if(ArrayBuffer.isView(r)||xe(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 Sr(r).length;case"ucs2":case"\ -ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Gi(r).length;default: -if(i)return n?-1:Sr(r).length;e=(""+e).toLowerCase(),i=!0}}a(Di,"byteLength");d.byteLength=Di;function Ha(r,e,t){ +ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return vr(r).length;case"ucs2":case"\ +ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Vi(r).length;default: +if(i)return n?-1:vr(r).length;e=(""+e).toLowerCase(),i=!0}}a(Oi,"byteLength");d.byteLength=Oi;function $a(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 eu(this,e,t);case"u\ -tf8":case"utf-8":return Ni(this,e,t);case"ascii":return Za(this,e,t);case"latin1":case"binary":return Xa( -this,e,t);case"base64":return Ya(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tu( -this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(Ha, +0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return tu(this,e,t);case"u\ +tf8":case"utf-8":return qi(this,e,t);case"ascii":return Xa(this,e,t);case"latin1":case"binary":return eu( +this,e,t);case"base64":return Ja(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ru( +this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a($a, "slowToString");d.prototype._isBuffer=!0;function Ne(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(Ne,"swap"); d.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");Bi&&(d.prototype[Bi]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ +er "+e+">"},"inspect");Li&&(d.prototype[Li]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ if(xe(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.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,_r(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r. +compare");function Ni(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,Cr(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=d.from( -e,n)),d.isBuffer(e))return e.length===0?-1:Li(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array. +e,n)),d.isBuffer(e))return e.length===0?-1:Fi(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):Li(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Oi,"bidire\ -ctionalIndexOf");function Li(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):Fi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Ni,"bidire\ +ctionalIndexOf");function Fi(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 $a(this,e,t,n);case"utf8":case"\ -utf-8":return Ga(this,e,t,n);case"ascii":case"latin1":case"binary":return Va(this,e,t,n);case"base64": -return Ka(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return za(this,e,t,n);default: +fer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return Ga(this,e,t,n);case"utf8":case"\ +utf-8":return Va(this,e,t,n);case"ascii":case"latin1":case"binary":return Ka(this,e,t,n);case"base64": +return za(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ya(this,e,t,n);default: if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"write");d.prototype. toJSON=a(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSO\ -N");function Ya(r,e,t){return e===0&&t===r.length?gr.fromByteArray(r):gr.fromByteArray(r.slice(e,t))} -a(Ya,"base64Slice");function Ni(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 Ja(n)}a(Ni,"utf8Slice");var ki=4096;function Ja(r){let e=r.length;if(e<=ki)return String. +n.push(o),i+=u}return Za(n)}a(qi,"utf8Slice");var Mi=4096;function Za(r){let e=r.length;if(e<=Mi)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,d.prototype),i},"slice");function G(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 \ @@ -166,10 +166,10 @@ a(function(e,t){return e=e>>>0,t||G(e,2,this.length),this[e]<<8|this[e+1]},"read readUint32LE=d.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),(this[e]| this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");d.prototype.readUint32BE=d.prototype. readUInt32BE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+ -2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Pe(a(function(e){e=e>>>0,Ge(e,"offset"); +2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Re(a(function(e){e=e>>>0,Ge(e,"offset"); let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ut(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* 2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<< -BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Pe(a(function(e){e=e>>>0,Ge(e,"offset"); +BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Re(a(function(e){e=e>>>0,Ge(e,"offset"); let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ut(e,this.length-8);let i=t*2**24+this[++e]*2**16+ this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<>>0,t=t>>>0,n||G(e,t, @@ -183,63 +183,63 @@ a(function(e,t){e=e>>>0,t||G(e,2,this.length);let n=this[e+1]|this[e]<<8;return n},"readInt16BE");d.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]| this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");d.prototype.readInt32BE=a(function(e,t){return e= e>>>0,t||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");d.prototype. -readBigInt64LE=Pe(a(function(e){e=e>>>0,Ge(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& +readBigInt64LE=Re(a(function(e){e=e>>>0,Ge(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& ut(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,Ge(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ut(e,this. +Re(a(function(e){e=e>>>0,Ge(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ut(e,this. length-8);let i=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,t||G(e,4,this.length),$e.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= a(function(e,t){return e=e>>>0,t||G(e,4,this.length),$e.read(this,e,!1,23,4)},"readFloatBE");d.prototype. readDoubleLE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),$e.read(this,e,!0,52,8)},"readDoub\ leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),$e.read(this,e, -!1,52,8)},"readDoubleBE");function ne(r,e,t,n,i,s){if(!d.isBuffer(r))throw new TypeError('"buffer" a\ +!1,52,8)},"readDoubleBE");function re(r,e,t,n,i,s){if(!d.isBuffer(r))throw new TypeError('"buffer" a\ rgument must be a Buffer instance');if(e>i||er.length)throw new RangeError("Index out of range")}a(ne,"checkInt");d.prototype.writeUintLE= -d.prototype.writeUIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;ne(this, +nds');if(t+n>r.length)throw new RangeError("Index out of range")}a(re,"checkInt");d.prototype.writeUintLE= +d.prototype.writeUIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;re(this, e,t,n,u,0)}let s=1,o=0;for(this[t]=e&255;++o>>0,n=n>>>0,!i){let u=Math. -pow(2,8*n)-1;ne(this,e,t,n,u,0)}let s=n-1,o=1;for(this[t+s]=e&255;--s>=0&&(o*=256);)this[t+s]=e/o&255; +pow(2,8*n)-1;re(this,e,t,n,u,0)}let s=n-1,o=1;for(this[t+s]=e&255;--s>=0&&(o*=256);)this[t+s]=e/o&255; return t+n},"writeUIntBE");d.prototype.writeUint8=d.prototype.writeUInt8=a(function(e,t,n){return e= -+e,t=t>>>0,n||ne(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");d.prototype.writeUint16LE=d.prototype. -writeUInt16LE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(this,e,t,2,65535,0),this[t]=e&255,this[t+1]= ++e,t=t>>>0,n||re(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");d.prototype.writeUint16LE=d.prototype. +writeUInt16LE=a(function(e,t,n){return e=+e,t=t>>>0,n||re(this,e,t,2,65535,0),this[t]=e&255,this[t+1]= e>>>8,t+2},"writeUInt16LE");d.prototype.writeUint16BE=d.prototype.writeUInt16BE=a(function(e,t,n){return e= -+e,t=t>>>0,n||ne(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");d.prototype. -writeUint32LE=d.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(this,e,t,4,4294967295, ++e,t=t>>>0,n||re(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");d.prototype. +writeUint32LE=d.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||re(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");d.prototype. -writeUint32BE=d.prototype.writeUInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(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 qi(r,e,t,n,i){ -$i(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++]= +writeUint32BE=d.prototype.writeUInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||re(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 Qi(r,e,t,n,i){ +Gi(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(qi,"wrtBigUInt64LE");function Qi(r,e,t,n,i){$i(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295)); +8,r[t++]=o,t}a(Qi,"wrtBigUInt64LE");function ji(r,e,t,n,i){Gi(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(Qi,"wrtBigUInt64BE");d.prototype. -writeBigUInt64LE=Pe(a(function(e,t=0){return qi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ -riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Pe(a(function(e,t=0){return Qi(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(ji,"wrtBigUInt64BE");d.prototype. +writeBigUInt64LE=Re(a(function(e,t=0){return Qi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ +riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Re(a(function(e,t=0){return ji(this,e,t,BigInt(0),BigInt( "0xffffffffffffffff"))},"writeBigUInt64BE"));d.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>> -0,!i){let c=Math.pow(2,8*n-1);ne(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");d.prototype.writeIntBE= -a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*n-1);ne(this,e,t,n,c-1,-c)}let s=n-1,o=1, +a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*n-1);re(this,e,t,n,c-1,-c)}let s=n-1,o=1, u=0;for(this[t+s]=e&255;--s>=0&&(o*=256);)e<0&&u===0&&this[t+s+1]!==0&&(u=1),this[t+s]=(e/o>>0)-u&255; -return t+n},"writeIntBE");d.prototype.writeInt8=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(this,e,t, +return t+n},"writeIntBE");d.prototype.writeInt8=a(function(e,t,n){return e=+e,t=t>>>0,n||re(this,e,t, 1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");d.prototype.writeInt16LE=a(function(e,t,n){ -return e=+e,t=t>>>0,n||ne(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeInt16LE"); -d.prototype.writeInt16BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(this,e,t,2,32767,-32768),this[t]= +return e=+e,t=t>>>0,n||re(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeInt16LE"); +d.prototype.writeInt16BE=a(function(e,t,n){return e=+e,t=t>>>0,n||re(this,e,t,2,32767,-32768),this[t]= e>>>8,this[t+1]=e&255,t+2},"writeInt16BE");d.prototype.writeInt32LE=a(function(e,t,n){return e=+e,t= -t>>>0,n||ne(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+ -3]=e>>>24,t+4},"writeInt32LE");d.prototype.writeInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne( +t>>>0,n||re(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+ +3]=e>>>24,t+4},"writeInt32LE");d.prototype.writeInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||re( 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");d.prototype.writeBigInt64LE=Pe(a(function(e,t=0){return qi( +e>>>8,this[t+3]=e&255,t+4},"writeInt32BE");d.prototype.writeBigInt64LE=Re(a(function(e,t=0){return Qi( this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));d.prototype. -writeBigInt64BE=Pe(a(function(e,t=0){return Qi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ -ffffffffffff"))},"writeBigInt64BE"));function ji(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(ji,"checkIEEE754");function Wi(r,e,t,n,i){ -return e=+e,t=t>>>0,i||ji(r,e,t,4,34028234663852886e22,-34028234663852886e22),$e.write(r,e,t,n,23,4), -t+4}a(Wi,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return Wi(this,e,t,!0,n)},"writeFl\ -oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return Wi(this,e,t,!1,n)},"writeFloatBE");function Hi(r,e,t,n,i){ -return e=+e,t=t>>>0,i||ji(r,e,t,8,17976931348623157e292,-17976931348623157e292),$e.write(r,e,t,n,52, -8),t+8}a(Hi,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return Hi(this,e,t,!0,n)},"wr\ -iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return Hi(this,e,t,!1,n)},"writeDoubleBE"); +writeBigInt64BE=Re(a(function(e,t=0){return ji(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ +ffffffffffff"))},"writeBigInt64BE"));function Wi(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(Wi,"checkIEEE754");function Hi(r,e,t,n,i){ +return e=+e,t=t>>>0,i||Wi(r,e,t,4,34028234663852886e22,-34028234663852886e22),$e.write(r,e,t,n,23,4), +t+4}a(Hi,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return Hi(this,e,t,!0,n)},"writeFl\ +oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return Hi(this,e,t,!1,n)},"writeFloatBE");function $i(r,e,t,n,i){ +return e=+e,t=t>>>0,i||Wi(r,e,t,8,17976931348623157e292,-17976931348623157e292),$e.write(r,e,t,n,52, +8),t+8}a($i,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return $i(this,e,t,!0,n)},"wr\ +iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return $i(this,e,t,!1,n)},"writeDoubleBE"); d.prototype.copy=a(function(e,t,n,i){if(!d.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=Fi(String(t)):typeof t=="bigint"&&(i=String( -t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Fi(i)),i+="n"),n+=` It must be ${e}. Re\ -ceived ${i}`,n},RangeError);function Fi(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(Fi,"addNumericalSeparator");function ru(r,e,t){ -Ge(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&ut(e,r.length-(t+1))}a(ru,"checkBounds");function $i(r,e,t,n,i,s){ +e ${typeof e}`},TypeError);_r("ERR_OUT_OF_RANGE",function(r,e,t){let n=`The value of "${r}" is out o\ +f range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=ki(String(t)):typeof t=="bigint"&&(i=String( +t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=ki(i)),i+="n"),n+=` It must be ${e}. Re\ +ceived ${i}`,n},RangeError);function ki(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(ki,"addNumericalSeparator");function nu(r,e,t){ +Ge(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&ut(e,r.length-(t+1))}a(nu,"checkBounds");function Gi(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 He.ERR_OUT_OF_RANGE("value",u,r)}ru(n,i,s)}a($i,"checkIntBI");function Ge(r,e){if(typeof r!= +nd <= ${t}${o}`,new He.ERR_OUT_OF_RANGE("value",u,r)}nu(n,i,s)}a(Gi,"checkIntBI");function Ge(r,e){if(typeof r!= "number")throw new He.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Ge,"validateNumber");function ut(r,e,t){throw Math. floor(r)!==r?(Ge(r,t),new He.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new He.ERR_BUFFER_OUT_OF_BOUNDS: -new He.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(ut,"boundsError");var nu=/[^+/0-9A-Za-z-_]/g; -function iu(r){if(r=r.split("=")[0],r=r.trim().replace(nu,""),r.length<2)return"";for(;r.length%4!== -0;)r=r+"=";return r}a(iu,"base64clean");function Sr(r,e){e=e||1/0;let t,n=r.length,i=null,s=[];for(let o=0;o< +new He.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(ut,"boundsError");var iu=/[^+/0-9A-Za-z-_]/g; +function su(r){if(r=r.split("=")[0],r=r.trim().replace(iu,""),r.length<2)return"";for(;r.length%4!== +0;)r=r+"=";return r}a(su,"base64clean");function vr(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(Sr,"utf\ -8ToBytes");function su(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(ou,"utf16leToBytes");function Gi(r){return gr.toByteArray( -iu(r))}a(Gi,"base64ToBytes");function Ut(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) -e[i+t]=r[i];return i}a(Ut,"blitBuffer");function xe(r,e){return r instanceof e||r!=null&&r.constructor!= -null&&r.constructor.name!=null&&r.constructor.name===e.name}a(xe,"isInstance");function _r(r){return r!== -r}a(_r,"numberIsNaN");var au=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 Pe(r){return typeof BigInt>"u"? -uu:r}a(Pe,"defineBigIntMethod");function uu(){throw new Error("BigInt not supported")}a(uu,"BufferBi\ -gIntNotDefined")});var S,v,A,m,w,p=re(()=>{"use strict";S=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),A= +240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}a(vr,"utf\ +8ToBytes");function ou(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(au,"utf16leToBytes");function Vi(r){return br.toByteArray( +su(r))}a(Vi,"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 xe(r,e){return r instanceof e||r!=null&&r.constructor!= +null&&r.constructor.name!=null&&r.constructor.name===e.name}a(xe,"isInstance");function Cr(r){return r!== +r}a(Cr,"numberIsNaN");var uu=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 Re(r){return typeof BigInt>"u"? +cu:r}a(Re,"defineBigIntMethod");function cu(){throw new Error("BigInt not supported")}a(cu,"BufferBi\ +gIntNotDefined")});var S,v,A,m,w,p=te(()=>{"use strict";S=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),A= globalThis.clearImmediate??(r=>clearTimeout(r)),m=typeof globalThis.Buffer=="function"&&typeof globalThis. -Buffer.allocUnsafe=="function"?globalThis.Buffer:Vi().Buffer,w=globalThis.process??{};w.env??(w.env= -{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Re=R((Yf,Cr)=>{"use strict";p();var Ke=typeof Reflect=="object"?Reflect:null,Ki=Ke&&typeof Ke.apply== -"function"?Ke.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Dt; -Ke&&typeof Ke.ownKeys=="function"?Dt=Ke.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 cu(r){console&&console.warn&&console.warn(r)}a(cu, -"ProcessEmitWarning");var Yi=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function M(){M. -init.call(this)}a(M,"EventEmitter");Cr.exports=M;Cr.exports.once=du;M.EventEmitter=M;M.prototype._events= -void 0;M.prototype._eventsCount=0;M.prototype._maxListeners=void 0;var zi=10;function Ot(r){if(typeof r!= +Buffer.allocUnsafe=="function"?globalThis.Buffer:Ki().Buffer,w=globalThis.process??{};w.env??(w.env= +{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Pe=P((eh,Ir)=>{"use strict";p();var Ke=typeof Reflect=="object"?Reflect:null,zi=Ke&&typeof Ke.apply== +"function"?Ke.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Ot; +Ke&&typeof Ke.ownKeys=="function"?Ot=Ke.ownKeys:Object.getOwnPropertySymbols?Ot=a(function(e){return Object. +getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Ot=a(function(e){return Object. +getOwnPropertyNames(e)},"ReflectOwnKeys");function lu(r){console&&console.warn&&console.warn(r)}a(lu, +"ProcessEmitWarning");var Ji=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function k(){k. +init.call(this)}a(k,"EventEmitter");Ir.exports=k;Ir.exports.once=pu;k.EventEmitter=k;k.prototype._events= +void 0;k.prototype._eventsCount=0;k.prototype._maxListeners=void 0;var Yi=10;function Nt(r){if(typeof r!= "function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)} -a(Ot,"checkListener");Object.defineProperty(M,"defaultMaxListeners",{enumerable:!0,get:a(function(){ -return zi},"get"),set:a(function(r){if(typeof r!="number"||r<0||Yi(r))throw new RangeError('The valu\ -e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");zi=r}, -"set")});M.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&& +a(Nt,"checkListener");Object.defineProperty(k,"defaultMaxListeners",{enumerable:!0,get:a(function(){ +return Yi},"get"),set:a(function(r){if(typeof r!="number"||r<0||Ji(r))throw new RangeError('The valu\ +e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Yi=r}, +"set")});k.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}; -M.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||Yi(e))throw new RangeError('Th\ +k.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||Ji(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 Ji(r){return r._maxListeners===void 0?M.defaultMaxListeners:r._maxListeners} -a(Ji,"_getMaxListeners");M.prototype.getMaxListeners=a(function(){return Ji(this)},"getMaxListeners"); -M.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")Ki(c,this,t);else for(var l=c. -length,f=rs(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=Zi(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,cu(u)}return r}a(Zi,"_addListener");M.prototype.addListener=a(function(e,t){ -return Zi(this,e,t,!1)},"addListener");M.prototype.on=M.prototype.addListener;M.prototype.prependListener= -a(function(e,t){return Zi(this,e,t,!0)},"prependListener");function lu(){if(!this.fired)return this. +r,u.type=e,u.count=o.length,lu(u)}return r}a(Xi,"_addListener");k.prototype.addListener=a(function(e,t){ +return Xi(this,e,t,!1)},"addListener");k.prototype.on=k.prototype.addListener;k.prototype.prependListener= +a(function(e,t){return Xi(this,e,t,!0)},"prependListener");function fu(){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(lu,"onceWrapper");function Xi(r,e,t){var n={fired:!1, -wrapFn:void 0,target:r,type:e,listener:t},i=lu.bind(n);return i.listener=t,n.wrapFn=i,i}a(Xi,"_onceW\ -rap");M.prototype.once=a(function(e,t){return Ot(t),this.on(e,Xi(this,e,t)),this},"once");M.prototype. -prependOnceListener=a(function(e,t){return Ot(t),this.prependListener(e,Xi(this,e,t)),this},"prepend\ -OnceListener");M.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(Ot(t),i=this._events,i=== +target):this.listener.apply(this.target,arguments)}a(fu,"onceWrapper");function es(r,e,t){var n={fired:!1, +wrapFn:void 0,target:r,type:e,listener:t},i=fu.bind(n);return i.listener=t,n.wrapFn=i,i}a(es,"_onceW\ +rap");k.prototype.once=a(function(e,t){return Nt(t),this.on(e,es(this,e,t)),this},"once");k.prototype. +prependOnceListener=a(function(e,t){return Nt(t),this.prependListener(e,es(this,e,t)),this},"prepend\ +OnceListener");k.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(Nt(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():fu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== -void 0&&this.emit("removeListener",e,u||t)}return this},"removeListener");M.prototype.off=M.prototype. -removeListener;M.prototype.removeAllListeners=a(function(e){var t,n,i;if(n=this._events,n===void 0)return this; +listener,s=o;break}if(s<0)return this;s===0?n.shift():hu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== +void 0&&this.emit("removeListener",e,u||t)}return this},"removeListener");k.prototype.off=k.prototype. +removeListener;k.prototype.removeAllListeners=a(function(e){var t,n,i;if(n=this._events,n===void 0)return this; if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount= 0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments. length===0){var s=Object.keys(n),o;for(i=0;i= -0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function es(r,e,t){var n=r._events; +0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function ts(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? -hu(i):rs(i,i.length)}a(es,"_listeners");M.prototype.listeners=a(function(e){return es(this,e,!0)},"l\ -isteners");M.prototype.rawListeners=a(function(e){return es(this,e,!1)},"rawListeners");M.listenerCount= -function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):ts.call(r,e)};M.prototype. -listenerCount=ts;function ts(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(ts,"listenerCount");M.prototype.eventNames=a(function(){ -return this._eventsCount>0?Dt(this._events):[]},"eventNames");function rs(r,e){for(var t=new Array(e), -n=0;n0?Ot(this._events):[]},"eventNames");function ns(r,e){for(var t=new Array(e), +n=0;nSe,isIP:()=>yu});function yu(r){return 0}var ss,is,_,Se,ze=re(()=>{"use \ -strict";p();ss=De(Re(),1);a(yu,"isIP");is=/^[^.]+\./,_=class _ extends ss.EventEmitter{constructor(){ +ust be of type EventEmitter. Received type '+typeof r)}a(is,"eventTargetAgnosticAddListener")});var as={};ge(as,{Socket:()=>Se,isIP:()=>mu});function mu(r){return 0}var os,ss,_,Se,ze=te(()=>{"use \ +strict";p();os=De(Pe(),1);a(mu,"isIP");ss=/^[^.]+\./,_=class _ extends os.EventEmitter{constructor(){ super(...arguments);I(this,"opts",{});I(this,"connecting",!1);I(this,"pending",!0);I(this,"writable", !0);I(this,"encrypted",!1);I(this,"authorized",!1);I(this,"destroyed",!1);I(this,"ws",null);I(this,"\ writeBuffer");I(this,"tlsState",0);I(this,"tlsRead");I(this,"tlsWrite")}static get poolQueryViaFetch(){ @@ -424,102 +424,102 @@ 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=m.alloc(0),n="utf8",i=()=>{}){return this.write(t,n,()=>{this. ws.close(),i()}),this}destroy(){return this.destroyed=!0,this.end()}};a(_,"Socket"),I(_,"defaults",{ -poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{let s;return i?.jwtAuth?s=t.replace(is,"apiauth."):s= -t.replace(is,"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(ss,"apiauth."):s= +t.replace(ss,"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}),I(_,"opts",{});Se=_});var as={};ge(as,{parse:()=>Ir});function Ir(r,e=!1){let{protocol:t}=new URL(r),n="http:"+r.substring( +disableWarningInBrowsers:!1}),I(_,"opts",{});Se=_});var us={};ge(us,{parse:()=>Tr});function Tr(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 E=i+":"+s,C=e?Object. fromEntries(y.entries()):f;return{href:r,protocol:t,auth:E,username:i,password:s,host:o,hostname:u,port:c, -pathname:l,search:f,query:C,hash:g}}var Tr=re(()=>{"use strict";p();a(Ir,"parse")});var Hr=R(Cs=>{"use strict";p();Cs.parse=function(r,e){return new Wr(r,e).parse()};var Kt=class Kt{constructor(e,t){ -this.source=e,this.transform=t||Qu,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){ +pathname:l,search:f,query:C,hash:g}}var Rr=te(()=>{"use strict";p();a(Tr,"parse")});var $r=P(Is=>{"use strict";p();Is.parse=function(r,e){return new Hr(r,e).parse()};var zt=class zt{constructor(e,t){ +this.source=e,this.transform=t||ju,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 Kt(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse( +dimension>1&&(n=new zt(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(Kt,"ArrayParser");var Wr=Kt;function Qu(r){return r}a(Qu,"ide\ -ntity")});var $r=R((Sh,Is)=>{p();var ju=Hr();Is.exports={create:a(function(r,e){return{parse:a(function(){return ju. -parse(r,e)},"parse")}},"create")}});var Rs=R((Ah,Ps)=>{"use strict";p();var Wu=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, -Hu=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,$u=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Gu=/^-?infinity$/;Ps. -exports=a(function(e){if(Gu.test(e))return Number(e.replace("i","I"));var t=Wu.exec(e);if(!t)return Vu( -e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Ts(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=Ku(e);return g!=null? -(y=new Date(Date.UTC(i,s,o,u,c,l,f)),Gr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= -new Date(i,s,o,u,c,l,f),Gr(i)&&y.setFullYear(i)),y},"parseDate");function Vu(r){var e=Hu.exec(r);if(e){ -var t=parseInt(e[1],10),n=!!e[4];n&&(t=Ts(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return Gr( -t)&&o.setFullYear(t),o}}a(Vu,"getDate");function Ku(r){if(r.endsWith("+00"))return 0;var e=$u.exec(r. +not balanced");return this.entries}};a(zt,"ArrayParser");var Hr=zt;function ju(r){return r}a(ju,"ide\ +ntity")});var Gr=P((_h,Ts)=>{p();var Wu=$r();Ts.exports={create:a(function(r,e){return{parse:a(function(){return Wu. +parse(r,e)},"parse")}},"create")}});var Bs=P((Th,Ps)=>{"use strict";p();var Hu=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, +$u=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Gu=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Vu=/^-?infinity$/;Ps. +exports=a(function(e){if(Vu.test(e))return Number(e.replace("i","I"));var t=Hu.exec(e);if(!t)return Ku( +e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Rs(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=zu(e);return g!=null? +(y=new Date(Date.UTC(i,s,o,u,c,l,f)),Vr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= +new Date(i,s,o,u,c,l,f),Vr(i)&&y.setFullYear(i)),y},"parseDate");function Ku(r){var e=$u.exec(r);if(e){ +var t=parseInt(e[1],10),n=!!e[4];n&&(t=Rs(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return Vr( +t)&&o.setFullYear(t),o}}a(Ku,"getDate");function zu(r){if(r.endsWith("+00"))return 0;var e=Gu.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(Ku,"timeZoneOffset");function Ts(r){return-(r- -1)}a(Ts,"bcYearToNegativeYear");function Gr(r){return r>=0&&r<100}a(Gr,"is0To99")});var Ls=R((Ih,Bs)=>{p();Bs.exports=Yu;var zu=Object.prototype.hasOwnProperty;function Yu(r){for(var e=1;e< -arguments.length;e++){var t=arguments[e];for(var n in t)zu.call(t,n)&&(r[n]=t[n])}return r}a(Yu,"ext\ -end")});var Ms=R((Rh,Fs)=>{"use strict";p();var Ju=Ls();Fs.exports=et;function et(r){if(!(this instanceof et)) -return new et(r);Ju(this,cc(r))}a(et,"PostgresInterval");var Zu=["seconds","minutes","hours","days", -"months","years"];et.prototype.toPostgres=function(){var r=Zu.filter(this.hasOwnProperty,this);return this. +e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(zu,"timeZoneOffset");function Rs(r){return-(r- +1)}a(Rs,"bcYearToNegativeYear");function Vr(r){return r>=0&&r<100}a(Vr,"is0To99")});var Fs=P((Bh,Ls)=>{p();Ls.exports=Ju;var Yu=Object.prototype.hasOwnProperty;function Ju(r){for(var e=1;e< +arguments.length;e++){var t=arguments[e];for(var n in t)Yu.call(t,n)&&(r[n]=t[n])}return r}a(Ju,"ext\ +end")});var Us=P((Mh,ks)=>{"use strict";p();var Zu=Fs();ks.exports=et;function et(r){if(!(this instanceof et)) +return new et(r);Zu(this,lc(r))}a(et,"PostgresInterval");var Xu=["seconds","minutes","hours","days", +"months","years"];et.prototype.toPostgres=function(){var r=Xu.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 Xu={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ -S"},ec=["years","months","days"],tc=["hours","minutes","seconds"];et.prototype.toISOString=et.prototype. -toISO=function(){var r=ec.map(t,this).join(""),e=tc.map(t,this).join("");return"P"+r+"T"+e;function t(n){ +"")),t+" "+e},this).join(" ")};var ec={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ +S"},tc=["years","months","days"],rc=["hours","minutes","seconds"];et.prototype.toISOString=et.prototype. +toISO=function(){var r=tc.map(t,this).join(""),e=rc.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+Xu[n]}};var Vr="([+-]?\\d+)",rc=Vr+"\\s+years?",nc=Vr+"\\s+mons?",ic=Vr+"\\s+days?",sc="\ -([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",oc=new RegExp([rc,nc,ic,sc].map(function(r){return"\ -("+r+")?"}).join("\\s*")),ks={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, -ac=["hours","minutes","seconds","milliseconds"];function uc(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}a(uc,"parseMilliseconds");function cc(r){if(!r)return{};var e=oc.exec(r),t=e[8]==="-";return Object. -keys(ks).reduce(function(n,i){var s=ks[i],o=e[s];return!o||(o=i==="milliseconds"?uc(o):parseInt(o,10), -!o)||(t&&~ac.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(cc,"parse")});var Ds=R((kh,Us)=>{"use strict";p();Us.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( +/0+$/,"")),i+ec[n]}};var Kr="([+-]?\\d+)",nc=Kr+"\\s+years?",ic=Kr+"\\s+mons?",sc=Kr+"\\s+days?",oc="\ +([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",ac=new RegExp([nc,ic,sc,oc].map(function(r){return"\ +("+r+")?"}).join("\\s*")),Ms={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, +uc=["hours","minutes","seconds","milliseconds"];function cc(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(cc,"parseMilliseconds");function lc(r){if(!r)return{};var e=ac.exec(r),t=e[8]==="-";return Object. +keys(Ms).reduce(function(n,i){var s=Ms[i],o=e[s];return!o||(o=i==="milliseconds"?cc(o):parseInt(o,10), +!o)||(t&&~uc.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(lc,"parse")});var Os=P((Dh,Ds)=>{"use strict";p();Ds.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( 2),"hex");for(var t="",n=0;n{p();var wt=Hr(),gt=$r(),zt=Rs(),Ns=Ms(),qs=Ds();function Yt(r){return a(function(t){ -return t===null?t:r(t)},"nullAllowed")}a(Yt,"allowNull");function Qs(r){return r===null?r:r==="TRUE"|| -r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(Qs,"parseBool");function lc(r){return r? -wt.parse(r,Qs):null}a(lc,"parseBoolArray");function fc(r){return parseInt(r,10)}a(fc,"parseBaseTenIn\ -t");function Kr(r){return r?wt.parse(r,Yt(fc)):null}a(Kr,"parseIntegerArray");function hc(r){return r? -wt.parse(r,Yt(function(e){return js(e).trim()})):null}a(hc,"parseBigIntegerArray");var dc=a(function(r){ -if(!r)return null;var e=gt.create(r,function(t){return t!==null&&(t=Zr(t)),t});return e.parse()},"pa\ -rsePointArray"),zr=a(function(r){if(!r)return null;var e=gt.create(r,function(t){return t!==null&&(t= -parseFloat(t)),t});return e.parse()},"parseFloatArray"),pe=a(function(r){if(!r)return null;var e=gt. -create(r);return e.parse()},"parseStringArray"),Yr=a(function(r){if(!r)return null;var e=gt.create(r, -function(t){return t!==null&&(t=zt(t)),t});return e.parse()},"parseDateArray"),pc=a(function(r){if(!r) -return null;var e=gt.create(r,function(t){return t!==null&&(t=Ns(t)),t});return e.parse()},"parseInt\ -ervalArray"),yc=a(function(r){return r?wt.parse(r,Yt(qs)):null},"parseByteAArray"),Jr=a(function(r){ -return parseInt(r,10)},"parseInteger"),js=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ -parseBigInteger"),Os=a(function(r){return r?wt.parse(r,Yt(JSON.parse)):null},"parseJsonArray"),Zr=a( +parseBytea")});var $s=P((qh,Hs)=>{p();var wt=$r(),gt=Gr(),Yt=Bs(),qs=Us(),Qs=Os();function Jt(r){return a(function(t){ +return t===null?t:r(t)},"nullAllowed")}a(Jt,"allowNull");function js(r){return r===null?r:r==="TRUE"|| +r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(js,"parseBool");function fc(r){return r? +wt.parse(r,js):null}a(fc,"parseBoolArray");function hc(r){return parseInt(r,10)}a(hc,"parseBaseTenIn\ +t");function zr(r){return r?wt.parse(r,Jt(hc)):null}a(zr,"parseIntegerArray");function dc(r){return r? +wt.parse(r,Jt(function(e){return Ws(e).trim()})):null}a(dc,"parseBigIntegerArray");var pc=a(function(r){ +if(!r)return null;var e=gt.create(r,function(t){return t!==null&&(t=Xr(t)),t});return e.parse()},"pa\ +rsePointArray"),Yr=a(function(r){if(!r)return null;var e=gt.create(r,function(t){return t!==null&&(t= +parseFloat(t)),t});return e.parse()},"parseFloatArray"),de=a(function(r){if(!r)return null;var e=gt. +create(r);return e.parse()},"parseStringArray"),Jr=a(function(r){if(!r)return null;var e=gt.create(r, +function(t){return t!==null&&(t=Yt(t)),t});return e.parse()},"parseDateArray"),yc=a(function(r){if(!r) +return null;var e=gt.create(r,function(t){return t!==null&&(t=qs(t)),t});return e.parse()},"parseInt\ +ervalArray"),mc=a(function(r){return r?wt.parse(r,Jt(Qs)):null},"parseByteAArray"),Zr=a(function(r){ +return parseInt(r,10)},"parseInteger"),Ws=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ +parseBigInteger"),Ns=a(function(r){return r?wt.parse(r,Jt(JSON.parse)):null},"parseJsonArray"),Xr=a( function(r){return r[0]!=="("?null:(r=r.substring(1,r.length-1).split(","),{x:parseFloat(r[0]),y:parseFloat( -r[1])})},"parsePoint"),mc=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, +r[1])})},"parsePoint"),wc=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, i=2;i{"use strict";p();var se=1e6;function gc(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%se,e=e/se>>>0,o=4294967296* -s+t,t=o/se>>>0,u=""+(o-se*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/se>>>0,u=""+(o-se*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/se>>>0,u=""+(o- -se*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var bc=Gs(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,W){return E* +r[i])}var s=Xr(e);return s.radius=parseFloat(t),s},"parseCircle"),gc=a(function(r){r(20,Ws),r(21,Zr), +r(23,Zr),r(26,Zr),r(700,parseFloat),r(701,parseFloat),r(16,js),r(1082,Yt),r(1114,Yt),r(1184,Yt),r(600, +Xr),r(651,de),r(718,wc),r(1e3,fc),r(1001,mc),r(1005,zr),r(1007,zr),r(1028,zr),r(1016,dc),r(1017,pc), +r(1021,Yr),r(1022,Yr),r(1231,Yr),r(1014,de),r(1015,de),r(1008,de),r(1009,de),r(1040,de),r(1041,de),r( +1115,Jr),r(1182,Jr),r(1185,Jr),r(1186,qs),r(1187,yc),r(17,Qs),r(114,JSON.parse.bind(JSON)),r(3802,JSON. +parse.bind(JSON)),r(199,Ns),r(3807,Ns),r(3907,de),r(2951,de),r(791,de),r(1183,de),r(1270,de)},"init"); +Hs.exports={init:gc}});var Vs=P((Wh,Gs)=>{"use strict";p();var ie=1e6;function bc(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%ie,e=e/ie>>>0,o=4294967296* +s+t,t=o/ie>>>0,u=""+(o-ie*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/ie>>>0,u=""+(o-ie*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/ie>>>0,u=""+(o- +ie*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var xc=Vs(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,W){return E* Math.pow(2,W)+C};var s=t>>3,o=a(function(E){return n?~E&255:E},"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"),zs=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"),Ys=a(function(r,e,t){var n=Math. pow(2,t-1)-1,i=U(r,1),s=U(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=U(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"),xc=a(function(r){ -return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),Vs=a(function(r){return U(r,1)==1?-1*(U( -r,31,1,!0)+1):U(r,31,1)},"parseInt32"),Sc=a(function(r){return zs(r,23,8)},"parseFloat32"),vc=a(function(r){ -return zs(r,52,11)},"parseFloat64"),Ec=a(function(r){var e=U(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"),Sc=a(function(r){ +return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),Ks=a(function(r){return U(r,1)==1?-1*(U( +r,31,1,!0)+1):U(r,31,1)},"parseInt32"),vc=a(function(r){return Ys(r,23,8)},"parseFloat32"),Ec=a(function(r){ +return Ys(r,52,11)},"parseFloat64"),Ac=a(function(r){var e=U(r,16,32);if(e==49152)return NaN;for(var t=Math. pow(1e4,U(r,16,16)),n=0,i=[],s=U(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 E=l.shift();for(g= 0;g0},"parseBool"),Cc=a(function(r){r(20,bc),r(21,xc),r(23,Vs),r(26,Vs),r(1700,Ec),r(700,Sc), -r(701,vc),r(16,_c),r(1114,Ks.bind(null,!1)),r(1184,Ks.bind(null,!0)),r(1e3,bt),r(1007,bt),r(1016,bt), -r(1008,bt),r(1009,bt),r(25,Ac)},"init");Ys.exports={init:Cc}});var Xs=R(($h,Zs)=>{p();Zs.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25, +"parseArray"),_c=a(function(r){return r.toString("utf8")},"parseText"),Cc=a(function(r){return r===null? +null:U(r,8)>0},"parseBool"),Ic=a(function(r){r(20,xc),r(21,Sc),r(23,Ks),r(26,Ks),r(1700,Ac),r(700,vc), +r(701,Ec),r(16,Cc),r(1114,zs.bind(null,!1)),r(1184,zs.bind(null,!0)),r(1e3,bt),r(1007,bt),r(1016,bt), +r(1008,bt),r(1009,bt),r(25,_c)},"init");Js.exports={init:Ic}});var eo=P((zh,Xs)=>{p();Xs.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 vt=R(St=>{p();var Ic=Hs(),Tc=Js(),Pc=$r(),Rc=Xs();St.getTypeParser=Bc;St.setTypeParser=Lc;St.arrayParser= -Pc;St.builtins=Rc;var xt={text:{},binary:{}};function eo(r){return String(r)}a(eo,"noParse");function Bc(r,e){ -return e=e||"text",xt[e]&&xt[e][r]||eo}a(Bc,"getTypeParser");function Lc(r,e,t){typeof e=="function"&& -(t=e,e="text"),xt[e][r]=t}a(Lc,"setTypeParser");Ic.init(function(r,e){xt.text[r]=e});Tc.init(function(r,e){ -xt.binary[r]=e})});var Zt=R((Yh,to)=>{"use strict";p();var kc=vt();function Jt(r){this._types=r||kc,this.text={},this.binary= -{}}a(Jt,"TypeOverrides");Jt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ -binary":return this.binary;default:return{}}};Jt.prototype.setTypeParser=function(r,e,t){typeof e=="\ -function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Jt.prototype.getTypeParser=function(r,e){return e= -e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};to.exports=Jt});function Et(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119,o=2600822924,u=528734635, +REGROLE:4096}});var vt=P(St=>{p();var Tc=$s(),Rc=Zs(),Pc=Gr(),Bc=eo();St.getTypeParser=Lc;St.setTypeParser=Fc;St.arrayParser= +Pc;St.builtins=Bc;var xt={text:{},binary:{}};function to(r){return String(r)}a(to,"noParse");function Lc(r,e){ +return e=e||"text",xt[e]&&xt[e][r]||to}a(Lc,"getTypeParser");function Fc(r,e,t){typeof e=="function"&& +(t=e,e="text"),xt[e][r]=t}a(Fc,"setTypeParser");Tc.init(function(r,e){xt.text[r]=e});Rc.init(function(r,e){ +xt.binary[r]=e})});var Xt=P((ed,ro)=>{"use strict";p();var Mc=vt();function Zt(r){this._types=r||Mc,this.text={},this.binary= +{}}a(Zt,"TypeOverrides");Zt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ +binary":return this.binary;default:return{}}};Zt.prototype.setTypeParser=function(r,e,t){typeof e=="\ +function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Zt.prototype.getTypeParser=function(r,e){return e= +e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};ro.exports=Zt});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, @@ -554,12 +554,12 @@ c=1541459225,l=0,f=0,y=[1116352408,1899447441,3049323471,3921009573,961987163,15 1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909, 275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222, 2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=a((T,b)=>T>>>b|T<<32- -b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),W=a(()=>{for(let k=0,J=0;k<16;k++,J+=4)E[k]=C[J]<< -24|C[J+1]<<16|C[J+2]<<8|C[J+3];for(let k=16;k<64;k++){let J=g(E[k-15],7)^g(E[k-15],18)^E[k-15]>>>3,ve=g( -E[k-2],17)^g(E[k-2],19)^E[k-2]>>>10;E[k]=E[k-16]+J+E[k-7]+ve|0}let T=e,b=t,F=n,ae=i,H=s,we=o,Ce=u,ce=c; -for(let k=0;k<64;k++){let J=g(H,6)^g(H,11)^g(H,25),ve=H&we^~H&Ce,Ie=ce+J+ve+y[k]+E[k]|0,ke=g(T,2)^g( -T,13)^g(T,22),Fe=T&b^T&F^b&F,Me=ke+Fe|0;ce=Ce,Ce=we,we=H,H=ae+Ie|0,ae=F,F=b,b=T,T=Ie+Me|0}e=e+T|0,t= -t+b|0,n=n+F|0,i=i+ae|0,s=s+H|0,o=o+we|0,u=u+Ce|0,c=c+ce|0,f=0},"process"),Y=a(T=>{typeof T=="string"&& +b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),W=a(()=>{for(let F=0,J=0;F<16;F++,J+=4)E[F]=C[J]<< +24|C[J+1]<<16|C[J+2]<<8|C[J+3];for(let F=16;F<64;F++){let J=g(E[F-15],7)^g(E[F-15],18)^E[F-15]>>>3,ve=g( +E[F-2],17)^g(E[F-2],19)^E[F-2]>>>10;E[F]=E[F-16]+J+E[F-7]+ve|0}let T=e,b=t,M=n,oe=i,H=s,we=o,Ce=u,ue=c; +for(let F=0;F<64;F++){let J=g(H,6)^g(H,11)^g(H,25),ve=H&we^~H&Ce,Ie=ue+J+ve+y[F]+E[F]|0,Fe=g(T,2)^g( +T,13)^g(T,22),Me=T&b^T&M^b&M,ke=Fe+Me|0;ue=Ce,Ce=we,we=H,H=oe+Ie|0,oe=M,M=b,b=T,T=Ie+ke|0}e=e+T|0,t= +t+b|0,n=n+M|0,i=i+oe|0,s=s+H|0,o=o+we|0,u=u+Ce|0,c=c+ue|0,f=0},"process"),Y=a(T=>{typeof T=="string"&& (T=new TextEncoder().encode(T));for(let b=0;b{if(C[f++]=128,f==64&&W(),f+8>64){for(;f<64;)C[f++]=0;W()}for(;f<58;)C[f++]=0;let T=l*8;C[f++]= T/1099511627776&255,C[f++]=T/4294967296&255,C[f++]=T>>>24,C[f++]=T>>>16&255,C[f++]=T>>>8&255,C[f++]= @@ -568,7 +568,7 @@ t>>>24,b[5]=t>>>16&255,b[6]=t>>>8&255,b[7]=t&255,b[8]=n>>>24,b[9]=n>>>16&255,b[1 255,b[12]=i>>>24,b[13]=i>>>16&255,b[14]=i>>>8&255,b[15]=i&255,b[16]=s>>>24,b[17]=s>>>16&255,b[18]=s>>> 8&255,b[19]=s&255,b[20]=o>>>24,b[21]=o>>>16&255,b[22]=o>>>8&255,b[23]=o&255,b[24]=u>>>24,b[25]=u>>>16& 255,b[26]=u>>>8&255,b[27]=u&255,b[28]=c>>>24,b[29]=c>>>16&255,b[30]=c>>>8&255,b[31]=c&255,b},"digest"); -return r===void 0?{add:Y,digest:me}:(Y(r),me())}var ro=re(()=>{"use strict";p();a(Et,"sha256")});var Q,At,no=re(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ +return r===void 0?{add:Y,digest:me}:(Y(r),me())}var no=te(()=>{"use strict";p();a(Et,"sha256")});var Q,At,io=te(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ Length",0);I(this,"_state",new Int32Array(4));I(this,"_buffer",new ArrayBuffer(68));I(this,"_buffer8"); I(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 Q._md5cycle(this._state,i),e?this._state:Q._hex( this._state)}};a(Q,"Md5"),I(Q,"stateIdentity",new Int32Array([1732584193,-271733879,-1732584194,271733878])), I(Q,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),I(Q,"hexChars","0123456789\ -abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);At=Q});var Xr={};ge(Xr,{createHash:()=>Mc,createHmac:()=>Uc,randomBytes:()=>Fc});function Fc(r){return crypto. -getRandomValues(m.alloc(r))}function Mc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( +abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);At=Q});var en={};ge(en,{createHash:()=>Uc,createHmac:()=>Dc,randomBytes:()=>kc});function kc(r){return crypto. +getRandomValues(m.alloc(r))}function Uc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( function(){return m.from(Et(e))},"digest")}},"update")};if(r==="md5")return{update:a(function(e){return{ digest:a(function(){return typeof e=="string"?At.hashStr(e):At.hashByteArray(e)},"digest")}},"update")}; -throw new Error(`Hash type '${r}' not supported`)}function Uc(r,e){if(r!=="sha256")throw new Error(`\ +throw new Error(`Hash type '${r}' not supported`)}function Dc(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=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(Et(o),64),m.from(Et(u))}, -"digest")}},"update")}}var en=re(()=>{"use strict";p();ro();no();a(Fc,"randomBytes");a(Mc,"createHas\ -h");a(Uc,"createHmac")});var _t=R((cd,tn)=>{"use strict";p();tn.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: +"digest")}},"update")}}var tn=te(()=>{"use strict";p();no();io();a(kc,"randomBytes");a(Uc,"createHas\ +h");a(Dc,"createHmac")});var _t=P((dd,rn)=>{"use strict";p();rn.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: w.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 tt=vt(),Dc=tt.getTypeParser(20,"text"),Oc=tt.getTypeParser(1016, -"text");tn.exports.__defineSetter__("parseInt8",function(r){tt.setTypeParser(20,"text",r?tt.getTypeParser( -23,"text"):Dc),tt.setTypeParser(1016,"text",r?tt.getTypeParser(1007,"text"):Oc)})});var Ct=R((fd,so)=>{"use strict";p();var Nc=(en(),$(Xr)),qc=_t();function Qc(r){var e=r.replace(/\\/g, -"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(Qc,"escapeElement");function io(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+io(r[t]): -r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=Qc(Xt(r[t]));return e=e+"}",e}a(io,"arrayString"); -var Xt=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. +keepalives:1,keepalives_idle:0};var tt=vt(),Oc=tt.getTypeParser(20,"text"),Nc=tt.getTypeParser(1016, +"text");rn.exports.__defineSetter__("parseInt8",function(r){tt.setTypeParser(20,"text",r?tt.getTypeParser( +23,"text"):Oc),tt.setTypeParser(1016,"text",r?tt.getTypeParser(1007,"text"):Nc)})});var Ct=P((yd,oo)=>{"use strict";p();var qc=(tn(),$(en)),Qc=_t();function jc(r){var e=r.replace(/\\/g, +"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(jc,"escapeElement");function so(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+so(r[t]): +r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=jc(er(r[t]));return e=e+"}",e}a(so,"arrayString"); +var er=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. 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?qc.parseInputDatesAsUTC?Hc(r):Wc(r):Array.isArray(r)?io(r):typeof r== -"object"?jc(r,e):r.toString()},"prepareValue");function jc(r,e){if(r&&typeof r.toPostgres=="function"){ +r.byteLength)}return r instanceof Date?Qc.parseInputDatesAsUTC?$c(r):Hc(r):Array.isArray(r)?so(r):typeof r== +"object"?Wc(r,e):r.toString()},"prepareValue");function Wc(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),Xt(r.toPostgres(Xt),e)}return JSON.stringify(r)}a(jc,"prepareObject");function z(r,e){ -for(r=""+r;r.lengthZc});var Zc,Tt=re(()=>{"use strict";p();Zc={}});var go=R((_d,wo)=>{"use strict";p();var sn=(en(),$(Xr));function Xc(r){if(r.indexOf("SCRAM-SHA-256")=== --1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=sn.randomBytes( +t),r}a(Gc,"normalizeQueryConfig");var nn=a(function(r){return qc.createHash("md5").update(r,"utf-8"). +digest("hex")},"md5"),Vc=a(function(r,e,t){var n=nn(e+r),i=nn(m.concat([m.from(n),t]));return"md5"+i}, +"postgresMd5PasswordHash");oo.exports={prepareValue:a(function(e){return er(e)},"prepareValueWrapper"), +normalizeQueryConfig:Gc,postgresMd5PasswordHash:Vc,md5:nn}});var Tt={};ge(Tt,{default:()=>rl});var rl,Rt=te(()=>{"use strict";p();rl={}});var bo=P((Rd,go)=>{"use strict";p();var on=(tn(),$(en));function nl(r){if(r.indexOf("SCRAM-SHA-256")=== +-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=on.randomBytes( 18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"\ -SASLInitialResponse"}}a(Xc,"startSession");function el(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( +SASLInitialResponse"}}a(nl,"startSession");function il(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=nl(t);if(n.nonce.startsWith(r.clientNonce)){ +L: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=al(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=m.from(n.salt,"base64"),s=ol(e,i,n.iteration),o=rt(s,"Client Key"),u=sl( +art with client nonce");var i=m.from(n.salt,"base64"),s=ll(e,i,n.iteration),o=rt(s,"Client Key"),u=cl( 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=rt(u,y),E=mo(o,g),C=E.toString("base64"),W=rt(s,"Server Key"),Y=rt(W,y);r.message="SAS\ -LResponse",r.serverSignature=Y.toString("base64"),r.response=f+",p="+C}a(el,"continueSession");function tl(r,e){ +","+l+","+f,g=rt(u,y),E=wo(o,g),C=E.toString("base64"),W=rt(s,"Server Key"),Y=rt(W,y);r.message="SAS\ +LResponse",r.serverSignature=Y.toString("base64"),r.response=f+",p="+C}a(il,"continueSession");function sl(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}=il( +"string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=ul( e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does\ - not match")}a(tl,"finalizeSession");function rl(r){if(typeof r!="string")throw new TypeError("SASL:\ + not match")}a(sl,"finalizeSession");function ol(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(rl,"isPrintableChars");function po(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(r)}a(po,"isBase64");function yo(r){if(typeof r!="string")throw new TypeError("SASL: attribute p\ +e<=126)}a(ol,"isPrintableChars");function yo(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(r)}a(yo,"isBase64");function mo(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(yo,"parseAttribute\ -Pairs");function nl(r){let e=yo(r),t=e.get("r");if(t){if(!rl(t))throw new Error("SASL: SCRAM-SERVER-\ +SASL: Invalid attribute pair entry");let t=e[0],n=e.substring(2);return[t,n]}))}a(mo,"parseAttribute\ +Pairs");function al(r){let e=mo(r),t=e.get("r");if(t){if(!ol(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(!po(n))throw new Error("SASL: SCRAM-SERV\ +ER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!yo(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(nl,"parseServerFirstMessage"); -function il(r){let t=yo(r).get("v");if(t){if(!po(t))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAG\ +tion missing");let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(al,"parseServerFirstMessage"); +function ul(r){let t=mo(r).get("v");if(t){if(!yo(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(il,"parseServerFinalMessage");function mo(r,e){if(!m. +signature is missing");return{serverSignature:t}}a(ul,"parseServerFinalMessage");function wo(r,e){if(!m. isBuffer(r))throw new TypeError("first argument must be a Buffer");if(!m.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 m.from(r.map((t,n)=>r[n]^e[n]))} -a(mo,"xorBuffers");function sl(r){return sn.createHash("sha256").update(r).digest()}a(sl,"sha256");function rt(r,e){ -return sn.createHmac("sha256",r).update(e).digest()}a(rt,"hmacSha256");function ol(r,e,t){for(var n=rt( -r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sal});function al(...r){return r.join("/")}var an=re(()=>{"use strict";p(); -a(al,"join")});var un={};ge(un,{stat:()=>ul});function ul(r,e){e(new Error("No filesystem"))}var cn=re(()=>{"use st\ -rict";p();a(ul,"stat")});var ln={};ge(ln,{default:()=>cl});var cl,fn=re(()=>{"use strict";p();cl={}});var bo={};ge(bo,{StringDecoder:()=>hn});var dn,hn,xo=re(()=>{"use strict";p();dn=class dn{constructor(e){ +a(wo,"xorBuffers");function cl(r){return on.createHash("sha256").update(r).digest()}a(cl,"sha256");function rt(r,e){ +return on.createHmac("sha256",r).update(e).digest()}a(rt,"hmacSha256");function ll(r,e,t){for(var n=rt( +r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sfl});function fl(...r){return r.join("/")}var un=te(()=>{"use strict";p(); +a(fl,"join")});var cn={};ge(cn,{stat:()=>hl});function hl(r,e){e(new Error("No filesystem"))}var ln=te(()=>{"use st\ +rict";p();a(hl,"stat")});var fn={};ge(fn,{default:()=>dl});var dl,hn=te(()=>{"use strict";p();dl={}});var xo={};ge(xo,{StringDecoder:()=>dn});var pn,dn,So=te(()=>{"use strict";p();pn=class pn{constructor(e){ I(this,"td");this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this. -td.decode(e)}};a(dn,"StringDecoder");hn=dn});var Ao=R((Md,Eo)=>{"use strict";p();var{Transform:ll}=(fn(),$(ln)),{StringDecoder:fl}=(xo(),$(bo)),Be=Symbol( -"last"),tr=Symbol("decoder");function hl(r,e,t){let n;if(this.overflow){if(n=this[tr].write(r).split( -this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Be]+=this[tr].write(r),n= -this[Be].split(this.matcher);this[Be]=n.pop();for(let i=0;i{"use strict";p();var{Transform:pl}=(hn(),$(fn)),{StringDecoder:yl}=(So(),$(xo)),Be=Symbol( +"last"),rr=Symbol("decoder");function ml(r,e,t){let n;if(this.overflow){if(n=this[rr].write(r).split( +this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Be]+=this[rr].write(r),n= +this[Be].split(this.matcher);this[Be]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( -"maximum buffer reached"));return}t()}a(hl,"transform");function dl(r){if(this[Be]+=this[tr].end(),this[Be]) -try{vo(this,this.mapper(this[Be]))}catch(e){return r(e)}r()}a(dl,"flush");function vo(r,e){e!==void 0&& -r.push(e)}a(vo,"push");function So(r){return r}a(So,"noop");function pl(r,e,t){switch(r=r||/\r?\n/,e= -e||So,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(ml,"transform");function wl(r){if(this[Be]+=this[rr].end(),this[Be]) +try{Eo(this,this.mapper(this[Be]))}catch(e){return r(e)}r()}a(wl,"flush");function Eo(r,e){e!==void 0&& +r.push(e)}a(Eo,"push");function vo(r){return r}a(vo,"noop");function gl(r,e,t){switch(r=r||/\r?\n/,e= +e||vo,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=So)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=hl,t.flush=dl,t.readableObjectMode= -!0;let n=new ll(t);return n[Be]="",n[tr]=new fl("utf8"),n.matcher=r,n.mapper=e,n.maxLength=t.maxLength, +"object"&&(t=e,e=vo)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=ml,t.flush=wl,t.readableObjectMode= +!0;let n=new pl(t);return n[Be]="",n[rr]=new yl("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(pl,"split");Eo.exports=pl});var Io=R((Od,_e)=>{"use strict";p();var _o=(an(),$(on)),yl=(fn(),$(ln)).Stream,ml=Ao(),Co=(Tt(),$(It)), -wl=5432,rr=w.platform==="win32",Pt=w.stderr,gl=56,bl=7,xl=61440,Sl=32768;function vl(r){return(r&xl)== -Sl}a(vl,"isRegFile");var nt=["host","port","database","user","password"],pn=nt.length,El=nt[pn-1];function yn(){ -var r=Pt instanceof yl&&Pt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` -`);Pt.write(Co.format.apply(Co,e))}}a(yn,"warn");Object.defineProperty(_e.exports,"isWin",{get:a(function(){ -return rr},"get"),set:a(function(r){rr=r},"set")});_e.exports.warnTo=function(r){var e=Pt;return Pt= -r,e};_e.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(rr?_o.join(e.APPDATA||"./","\ -postgresql","pgpass.conf"):_o.join(e.HOME||"./",".pgpass"));return t};_e.exports.usePgPass=function(r,e){ -return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:rr?!0:(e=e||"",vl(r.mode)?r. -mode&(gl|bl)?(yn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ -(0600) or less',e),!1):!0:(yn('WARNING: password file "%s" is not a plain file',e),!1))};var Al=_e.exports. -match=function(r,e){return nt.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||wl)===Number( +!1,s(i)},n}a(gl,"split");Ao.exports=gl});var To=P((jd,_e)=>{"use strict";p();var Co=(un(),$(an)),bl=(hn(),$(fn)).Stream,xl=_o(),Io=(Rt(),$(Tt)), +Sl=5432,nr=w.platform==="win32",Pt=w.stderr,vl=56,El=7,Al=61440,_l=32768;function Cl(r){return(r&Al)== +_l}a(Cl,"isRegFile");var nt=["host","port","database","user","password"],yn=nt.length,Il=nt[yn-1];function mn(){ +var r=Pt instanceof bl&&Pt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +`);Pt.write(Io.format.apply(Io,e))}}a(mn,"warn");Object.defineProperty(_e.exports,"isWin",{get:a(function(){ +return nr},"get"),set:a(function(r){nr=r},"set")});_e.exports.warnTo=function(r){var e=Pt;return Pt= +r,e};_e.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(nr?Co.join(e.APPDATA||"./","\ +postgresql","pgpass.conf"):Co.join(e.HOME||"./",".pgpass"));return t};_e.exports.usePgPass=function(r,e){ +return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:nr?!0:(e=e||"",Cl(r.mode)?r. +mode&(vl|El)?(mn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ +(0600) or less',e),!1):!0:(mn('WARNING: password file "%s" is not a plain file',e),!1))};var Tl=_e.exports. +match=function(r,e){return nt.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||Sl)===Number( e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};_e.exports.getPassword=function(r,e,t){var n,i=e.pipe( -ml());function s(c){var l=_l(c);l&&Cl(l)&&Al(r,l)&&(n=l[El],i.end())}a(s,"onLine");var o=a(function(){ -e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),yn("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 _l=_e.exports.parseLine= +xl());function s(c){var l=Rl(c);l&&Pl(l)&&Tl(r,l)&&(n=l[Il],i.end())}a(s,"onLine");var o=a(function(){ +e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),mn("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 Rl=_e.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 E=r.substring(y,g);Object.hasOwnProperty.call(w.env,"PGPASS_NO_DEESCAPE")||(E=E. replace(/\\([:\\])/g,"$1")),o[nt[f]]=E},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). -length===pn?o:null,o},Cl=_e.exports.isValidEntry=function(r){for(var e={0:function(o){return o.length> +l),u=n==yn-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===yn?o:null,o},Pl=_e.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 Qd=(an(),$(on)),To=(cn(),$(un)),nr=Io();mn.exports=function(r,e){ -var t=nr.getFileName();To.stat(t,function(n,i){if(n||!nr.usePgPass(i,t))return e(void 0);var s=To.createReadStream( -t);nr.getPassword(r,s,e)})};mn.exports.warnTo=nr.warnTo});var Ro={};ge(Ro,{default:()=>Il});var Il,Bo=re(()=>{"use strict";p();Il={}});var ko=R(($d,Lo)=>{"use strict";p();var Tl=(Tr(),$(as)),wn=(cn(),$(un));function gn(r){if(r.charAt(0)=== -"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Tl.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i. +0}},t=0;t{"use strict";p();var $d=(un(),$(an)),Ro=(ln(),$(cn)),ir=To();wn.exports=function(r,e){ +var t=ir.getFileName();Ro.stat(t,function(n,i){if(n||!ir.usePgPass(i,t))return e(void 0);var s=Ro.createReadStream( +t);ir.getPassword(r,s,e)})};wn.exports.warnTo=ir.warnTo});var Bo={};ge(Bo,{default:()=>Bl});var Bl,Lo=te(()=>{"use strict";p();Bl={}});var Mo=P((zd,Fo)=>{"use strict";p();var Ll=(Rr(),$(us)),gn=(ln(),$(cn));function bn(r){if(r.charAt(0)=== +"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Ll.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,26 +757,26 @@ 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=wn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=wn.readFileSync(t.sslkey).toString()), -t.sslrootcert&&(t.ssl.ca=wn.readFileSync(t.sslrootcert).toString()),t.sslmode){case"disable":{t.ssl= +cert=gn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=gn.readFileSync(t.sslkey).toString()), +t.sslrootcert&&(t.ssl.ca=gn.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(gn,"parse");Lo.exports=gn;gn.parse=gn});var ir=R((Kd,Uo)=>{"use strict";p();var Pl=(Bo(),$(Ro)),Mo=_t(),Fo=ko().parse,te=a(function(r,e,t){return t=== -void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Mo[r]},"val"),Rl=a(function(){switch(w. +!1;break}}return t}a(bn,"parse");Fo.exports=bn;bn.parse=bn});var sr=P((Zd,Do)=>{"use strict";p();var Fl=(Lo(),$(Bo)),Uo=_t(),ko=Mo().parse,ee=a(function(r,e,t){return t=== +void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Uo[r]},"val"),Ml=a(function(){switch(w. 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 Mo.ssl},"readSSLConfigFromEnvironment"),it=a(function(r){ +no-verify":return{rejectUnauthorized:!1}}return Uo.ssl},"readSSLConfigFromEnvironment"),it=a(function(r){ return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),ye=a(function(r,e,t){ -var n=e[t];n!=null&&r.push(t+"="+it(n))},"add"),xn=class xn{constructor(e){e=typeof e=="string"?Fo(e): -e||{},e.connectionString&&(e=Object.assign({},e,Fo(e.connectionString))),this.user=te("user",e),this. -database=te("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(te("p\ -ort",e),10),this.host=te("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, -writable:!0,value:te("password",e)}),this.binary=te("binary",e),this.options=te("options",e),this.ssl= -typeof e.ssl>"u"?Rl():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="\ +var n=e[t];n!=null&&r.push(t+"="+it(n))},"add"),Sn=class Sn{constructor(e){e=typeof e=="string"?ko(e): +e||{},e.connectionString&&(e=Object.assign({},e,ko(e.connectionString))),this.user=ee("user",e),this. +database=ee("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(ee("p\ +ort",e),10),this.host=ee("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, +writable:!0,value:ee("password",e)}),this.binary=ee("binary",e),this.options=ee("options",e),this.ssl= +typeof e.ssl>"u"?Ml():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=te("client_encoding",e),this.replication=te("replication", -e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=te("application_name",e,"\ -PGAPPNAME"),this.fallback_application_name=te("fallback_application_name",e,!1),this.statement_timeout= -te("statement_timeout",e,!1),this.lock_timeout=te("lock_timeout",e,!1),this.idle_in_transaction_session_timeout= -te("idle_in_transaction_session_timeout",e,!1),this.query_timeout=te("query_timeout",e,!1),e.connectionTimeoutMillis=== +"key",{enumerable:!1}),this.client_encoding=ee("client_encoding",e),this.replication=ee("replication", +e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=ee("application_name",e,"\ +PGAPPNAME"),this.fallback_application_name=ee("fallback_application_name",e,!1),this.statement_timeout= +ee("statement_timeout",e,!1),this.lock_timeout=ee("lock_timeout",e,!1),this.idle_in_transaction_session_timeout= +ee("idle_in_transaction_session_timeout",e,!1),this.query_timeout=ee("query_timeout",e,!1),e.connectionTimeoutMillis=== void 0?this.connect_timeout=w.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/ 1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive===!0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis== "number"&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){ @@ -786,25 +786,25 @@ ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(ye(t,n,"sslmode"),ye(t, slkey"),ye(t,n,"sslcert"),ye(t,n,"sslrootcert"),this.database&&t.push("dbname="+it(this.database)),this. replication&&t.push("replication="+it(this.replication)),this.host&&t.push("host="+it(this.host)),this. isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+it(this.client_encoding)), -Pl.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+it(s)),e(null,t.join(" ")))})}}; -a(xn,"ConnectionParameters");var bn=xn;Uo.exports=bn});var No=R((Jd,Oo)=>{"use strict";p();var Bl=vt(),Do=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,vn=class vn{constructor(e,t){ +Fl.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+it(s)),e(null,t.join(" ")))})}}; +a(Sn,"ConnectionParameters");var xn=Sn;Do.exports=xn});var qo=P((tp,No)=>{"use strict";p();var kl=vt(),Oo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,En=class En{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=Do.exec(e.text):t=Do.exec(e.command),t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2], +var t;e.text?t=Oo.exec(e.text):t=Oo.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:Ll}=Re(),qo=No(),Qo=Ct(),An=class An extends Ll{constructor(e,t,n){ -super(),e=Qo.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]=kl.getTypeParser(n.dataTypeID,n. +format||"text")}}};a(En,"Result");var vn=En;No.exports=vn});var Ho=P((ip,Wo)=>{"use strict";p();var{EventEmitter:Ul}=Pe(),Qo=qo(),jo=Ct(),_n=class _n extends Ul{constructor(e,t,n){ +super(),e=jo.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,w.domain&&e.callback&&(this.callback=w.domain.bind(e.callback)),this._result= -new qo(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError= +new Qo(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 qo(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ +_results=[this._result]),this._result=new Qo(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,41 +821,41 @@ 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:Qo.prepareValue})}catch(t){ +portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:jo.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(An,"Query");var En=An;jo.exports= -En});var Xn=R(P=>{"use strict";p();Object.defineProperty(P,"__esModule",{value:!0});P.NoticeMessage=P.DataRowMessage= -P.CommandCompleteMessage=P.ReadyForQueryMessage=P.NotificationResponseMessage=P.BackendKeyDataMessage= -P.AuthenticationMD5Password=P.ParameterStatusMessage=P.ParameterDescriptionMessage=P.RowDescriptionMessage= -P.Field=P.CopyResponse=P.CopyDataMessage=P.DatabaseError=P.copyDone=P.emptyQuery=P.replicationStart= -P.portalSuspended=P.noData=P.closeComplete=P.bindComplete=P.parseComplete=void 0;P.parseComplete={name:"\ -parseComplete",length:5};P.bindComplete={name:"bindComplete",length:5};P.closeComplete={name:"closeC\ -omplete",length:5};P.noData={name:"noData",length:5};P.portalSuspended={name:"portalSuspended",length:5}; -P.replicationStart={name:"replicationStart",length:4};P.emptyQuery={name:"emptyQuery",length:4};P.copyDone= -{name:"copyDone",length:4};var Nn=class Nn extends Error{constructor(e,t,n){super(e),this.length=t,this. -name=n}};a(Nn,"DatabaseError");var _n=Nn;P.DatabaseError=_n;var qn=class qn{constructor(e,t){this.length= -e,this.chunk=t,this.name="copyData"}};a(qn,"CopyDataMessage");var Cn=qn;P.CopyDataMessage=Cn;var Qn=class Qn{constructor(e,t,n,i){ -this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Qn,"CopyResponse");var In=Qn; -P.CopyResponse=In;var jn=class jn{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(jn,"Field");var Tn=jn; -P.Field=Tn;var Wn=class Wn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ -n",this.fields=new Array(this.fieldCount)}};a(Wn,"RowDescriptionMessage");var Pn=Wn;P.RowDescriptionMessage= -Pn;var Hn=class Hn{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ -ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(Hn,"ParameterDescriptionMessage");var Rn=Hn; -P.ParameterDescriptionMessage=Rn;var $n=class $n{constructor(e,t,n){this.length=e,this.parameterName= -t,this.parameterValue=n,this.name="parameterStatus"}};a($n,"ParameterStatusMessage");var Bn=$n;P.ParameterStatusMessage= -Bn;var Gn=class Gn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; -a(Gn,"AuthenticationMD5Password");var Ln=Gn;P.AuthenticationMD5Password=Ln;var Vn=class Vn{constructor(e,t,n){ -this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Vn,"BackendKeyDataMes\ -sage");var kn=Vn;P.BackendKeyDataMessage=kn;var Kn=class Kn{constructor(e,t,n,i){this.length=e,this. -processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(Kn,"NotificationResponseMessa\ -ge");var Fn=Kn;P.NotificationResponseMessage=Fn;var zn=class zn{constructor(e,t){this.length=e,this. -status=t,this.name="readyForQuery"}};a(zn,"ReadyForQueryMessage");var Mn=zn;P.ReadyForQueryMessage=Mn; -var Yn=class Yn{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(Yn,"Comma\ -ndCompleteMessage");var Un=Yn;P.CommandCompleteMessage=Un;var Jn=class Jn{constructor(e,t){this.length= -e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(Jn,"DataRowMessage");var Dn=Jn;P.DataRowMessage= -Dn;var Zn=class Zn{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(Zn,"NoticeMe\ -ssage");var On=Zn;P.NoticeMessage=On});var Ho=R(sr=>{"use strict";p();Object.defineProperty(sr,"__esModule",{value:!0});sr.Writer=void 0;var ti=class ti{constructor(e=256){ +e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(_n,"Query");var An=_n;Wo.exports= +An});var ei=P(R=>{"use strict";p();Object.defineProperty(R,"__esModule",{value:!0});R.NoticeMessage=R.DataRowMessage= +R.CommandCompleteMessage=R.ReadyForQueryMessage=R.NotificationResponseMessage=R.BackendKeyDataMessage= +R.AuthenticationMD5Password=R.ParameterStatusMessage=R.ParameterDescriptionMessage=R.RowDescriptionMessage= +R.Field=R.CopyResponse=R.CopyDataMessage=R.DatabaseError=R.copyDone=R.emptyQuery=R.replicationStart= +R.portalSuspended=R.noData=R.closeComplete=R.bindComplete=R.parseComplete=void 0;R.parseComplete={name:"\ +parseComplete",length:5};R.bindComplete={name:"bindComplete",length:5};R.closeComplete={name:"closeC\ +omplete",length:5};R.noData={name:"noData",length:5};R.portalSuspended={name:"portalSuspended",length:5}; +R.replicationStart={name:"replicationStart",length:4};R.emptyQuery={name:"emptyQuery",length:4};R.copyDone= +{name:"copyDone",length:4};var qn=class qn extends Error{constructor(e,t,n){super(e),this.length=t,this. +name=n}};a(qn,"DatabaseError");var Cn=qn;R.DatabaseError=Cn;var Qn=class Qn{constructor(e,t){this.length= +e,this.chunk=t,this.name="copyData"}};a(Qn,"CopyDataMessage");var In=Qn;R.CopyDataMessage=In;var jn=class jn{constructor(e,t,n,i){ +this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(jn,"CopyResponse");var Tn=jn; +R.CopyResponse=Tn;var Wn=class Wn{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(Wn,"Field");var Rn=Wn; +R.Field=Rn;var Hn=class Hn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ +n",this.fields=new Array(this.fieldCount)}};a(Hn,"RowDescriptionMessage");var Pn=Hn;R.RowDescriptionMessage= +Pn;var $n=class $n{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ +ion",this.dataTypeIDs=new Array(this.parameterCount)}};a($n,"ParameterDescriptionMessage");var Bn=$n; +R.ParameterDescriptionMessage=Bn;var Gn=class Gn{constructor(e,t,n){this.length=e,this.parameterName= +t,this.parameterValue=n,this.name="parameterStatus"}};a(Gn,"ParameterStatusMessage");var Ln=Gn;R.ParameterStatusMessage= +Ln;var Vn=class Vn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; +a(Vn,"AuthenticationMD5Password");var Fn=Vn;R.AuthenticationMD5Password=Fn;var Kn=class Kn{constructor(e,t,n){ +this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Kn,"BackendKeyDataMes\ +sage");var Mn=Kn;R.BackendKeyDataMessage=Mn;var zn=class zn{constructor(e,t,n,i){this.length=e,this. +processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(zn,"NotificationResponseMessa\ +ge");var kn=zn;R.NotificationResponseMessage=kn;var Yn=class Yn{constructor(e,t){this.length=e,this. +status=t,this.name="readyForQuery"}};a(Yn,"ReadyForQueryMessage");var Un=Yn;R.ReadyForQueryMessage=Un; +var Jn=class Jn{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(Jn,"Comma\ +ndCompleteMessage");var Dn=Jn;R.CommandCompleteMessage=Dn;var Zn=class Zn{constructor(e,t){this.length= +e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(Zn,"DataRowMessage");var On=Zn;R.DataRowMessage= +On;var Xn=class Xn{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(Xn,"NoticeMe\ +ssage");var Nn=Xn;R.NoticeMessage=Nn});var $o=P(or=>{"use strict";p();Object.defineProperty(or,"__esModule",{value:!0});or.Writer=void 0;var ri=class ri{constructor(e=256){ this.size=e,this.offset=5,this.headerPosition=0,this.buffer=m.allocUnsafe(e)}ensure(e){if(this.buffer. length-this.offset>1)+e;this.buffer=m.allocUnsafe(i),n.copy( this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this. @@ -867,49 +867,49 @@ 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=m.allocUnsafe(this.size),t}};a(ti,"Writer");var ei=ti;sr.Writer=ei});var Go=R(ar=>{"use strict";p();Object.defineProperty(ar,"__esModule",{value:!0});ar.serialize=void 0; -var ri=Ho(),D=new ri.Writer,kl=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( +headerPosition=0,this.buffer=m.allocUnsafe(this.size),t}};a(ri,"Writer");var ti=ri;or.Writer=ti});var Vo=P(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.serialize=void 0; +var ni=$o(),D=new ni.Writer,Dl=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( n).addCString(r[n]);D.addCString("client_encoding").addCString("UTF8");let e=D.addCString("").flush(), -t=e.length+4;return new ri.Writer().addInt32(t).add(e).flush()},"startup"),Fl=a(()=>{let r=m.allocUnsafe( -8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Ml=a(r=>D.addCString(r).flush( -112),"password"),Ul=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. -flush(112)},"sendSASLInitialResponseMessage"),Dl=a(function(r){return D.addString(r).flush(112)},"se\ -ndSCRAMClientFinalMessage"),Ol=a(r=>D.addCString(r).flush(81),"query"),$o=[],Nl=a(r=>{let e=r.name|| +t=e.length+4;return new ni.Writer().addInt32(t).add(e).flush()},"startup"),Ol=a(()=>{let r=m.allocUnsafe( +8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Nl=a(r=>D.addCString(r).flush( +112),"password"),ql=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. +flush(112)},"sendSASLInitialResponseMessage"),Ql=a(function(r){return D.addString(r).flush(112)},"se\ +ndSCRAMClientFinalMessage"),jl=a(r=>D.addCString(r).flush(81),"query"),Go=[],Wl=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||$o,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< -n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),st=new ri.Writer,ql=a(function(r,e){for(let t=0;t< +xecuting queries"));let t=r.types||Go,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< +n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),st=new ni.Writer,Hl=a(function(r,e){for(let t=0;t< r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),st.addInt32(-1)):n instanceof m?(D.addInt16( 1),st.addInt32(n.length),st.add(n)):(D.addInt16(0),st.addInt32(m.byteLength(n)),st.addString(n))}},"\ -writeValues"),Ql=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||$o,s=i.length; -return D.addCString(e).addCString(t),D.addInt16(s),ql(i,r.valueMapper),D.addInt16(s),D.add(st.flush()), -D.addInt16(n?1:0),D.flush(66)},"bind"),jl=m.from([69,0,0,0,9,0,0,0,0,0]),Wl=a(r=>{if(!r||!r.portal&& -!r.rows)return jl;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Hl=a( +writeValues"),$l=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Go,s=i.length; +return D.addCString(e).addCString(t),D.addInt16(s),Hl(i,r.valueMapper),D.addInt16(s),D.add(st.flush()), +D.addInt16(n?1:0),D.flush(66)},"bind"),Gl=m.from([69,0,0,0,9,0,0,0,0,0]),Vl=a(r=>{if(!r||!r.portal&& +!r.rows)return Gl;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Kl=a( (r,e)=>{let t=m.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"),ni=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. +6),t.writeInt32BE(r,8),t.writeInt32BE(e,12),t},"cancel"),ii=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i},"cstringMessage"), -$l=D.addCString("P").flush(68),Gl=D.addCString("S").flush(68),Vl=a(r=>r.name?ni(68,`${r.type}${r.name|| -""}`):r.type==="P"?$l:Gl,"describe"),Kl=a(r=>{let e=`${r.type}${r.name||""}`;return ni(67,e)},"close"), -zl=a(r=>D.add(r).flush(100),"copyData"),Yl=a(r=>ni(102,r),"copyFail"),or=a(r=>m.from([r,0,0,0,4]),"c\ -odeOnlyBuffer"),Jl=or(72),Zl=or(83),Xl=or(88),ef=or(99),tf={startup:kl,password:Ml,requestSsl:Fl,sendSASLInitialResponseMessage:Ul, -sendSCRAMClientFinalMessage:Dl,query:Ol,parse:Nl,bind:Ql,execute:Wl,describe:Vl,close:Kl,flush:a(()=>Jl, -"flush"),sync:a(()=>Zl,"sync"),end:a(()=>Xl,"end"),copyData:zl,copyDone:a(()=>ef,"copyDone"),copyFail:Yl, -cancel:Hl};ar.serialize=tf});var Vo=R(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.BufferReader=void 0; -var rf=m.allocUnsafe(0),si=class si{constructor(e=0){this.offset=e,this.buffer=rf,this.encoding="utf\ +zl=D.addCString("P").flush(68),Yl=D.addCString("S").flush(68),Jl=a(r=>r.name?ii(68,`${r.type}${r.name|| +""}`):r.type==="P"?zl:Yl,"describe"),Zl=a(r=>{let e=`${r.type}${r.name||""}`;return ii(67,e)},"close"), +Xl=a(r=>D.add(r).flush(100),"copyData"),ef=a(r=>ii(102,r),"copyFail"),ar=a(r=>m.from([r,0,0,0,4]),"c\ +odeOnlyBuffer"),tf=ar(72),rf=ar(83),nf=ar(88),sf=ar(99),of={startup:Dl,password:Nl,requestSsl:Ol,sendSASLInitialResponseMessage:ql, +sendSCRAMClientFinalMessage:Ql,query:jl,parse:Wl,bind:$l,execute:Vl,describe:Jl,close:Zl,flush:a(()=>tf, +"flush"),sync:a(()=>rf,"sync"),end:a(()=>nf,"end"),copyData:Xl,copyDone:a(()=>sf,"copyDone"),copyFail:ef, +cancel:Kl};ur.serialize=of});var Ko=P(cr=>{"use strict";p();Object.defineProperty(cr,"__esModule",{value:!0});cr.BufferReader=void 0; +var af=m.allocUnsafe(0),oi=class oi{constructor(e=0){this.offset=e,this.buffer=af,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(si,"BufferReader");var ii=si;ur.BufferReader=ii});var Yo=R(cr=>{"use strict";p();Object.defineProperty(cr,"__esModule",{value:!0});cr.Parser=void 0;var O=Xn(), -nf=Vo(),oi=1,sf=4,Ko=oi+sf,zo=m.allocUnsafe(0),ui=class ui{constructor(e){if(this.buffer=zo,this.bufferLength= -0,this.bufferOffset=0,this.reader=new nf.BufferReader,e?.mode==="binary")throw new Error("Binary mod\ +offset+=e,t}};a(oi,"BufferReader");var si=oi;cr.BufferReader=si});var Jo=P(lr=>{"use strict";p();Object.defineProperty(lr,"__esModule",{value:!0});lr.Parser=void 0;var O=ei(), +uf=Ko(),ai=1,cf=4,zo=ai+cf,Yo=m.allocUnsafe(0),ci=class ci{constructor(e){if(this.buffer=Yo,this.bufferLength= +0,this.bufferOffset=0,this.reader=new uf.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+Ko<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( -i+oi),u=oi+o;if(u+i<=n){let c=this.handlePacket(i+Ko,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. -buffer=zo,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=n-i,this.bufferOffset=i)}mergeBuffer(e){ +this.bufferLength,i=this.bufferOffset;for(;i+zo<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( +i+ai),u=ai+o;if(u+i<=n){let c=this.handlePacket(i+zo,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. +buffer=Yo,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. buffer.byteLength*2;for(;t>=s;)s*=2;i=m.allocUnsafe(s)}this.buffer.copy(i,0,this.bufferOffset,this.bufferOffset+ @@ -955,14 +955,14 @@ o=this.reader.string(1);for(;o!=="\0";)s[o]=this.reader.cstring(),o=this.reader. c=i==="notice"?new O.NoticeMessage(t,u):new O.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(ui,"Parser");var ai=ui;cr.Parser=ai});var ci=R(Le=>{"use strict";p();Object.defineProperty(Le,"__esModule",{value:!0});Le.DatabaseError=Le. -serialize=Le.parse=void 0;var of=Xn();Object.defineProperty(Le,"DatabaseError",{enumerable:!0,get:a( -function(){return of.DatabaseError},"get")});var af=Go();Object.defineProperty(Le,"serialize",{enumerable:!0, -get:a(function(){return af.serialize},"get")});var uf=Yo();function cf(r,e){let t=new uf.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(cf,"parse");Le.parse=cf});var Jo={};ge(Jo,{connect:()=>lf});function lf({socket:r,servername:e}){return r.startTls(e),r}var Zo=re( -()=>{"use strict";p();a(lf,"connect")});var hi=R((Ep,ta)=>{"use strict";p();var Xo=(ze(),$(os)),ff=Re().EventEmitter,{parse:hf,serialize:K}=ci(), -ea=K.flush(),df=K.sync(),pf=K.end(),fi=class fi extends ff{constructor(e){super(),e=e||{},this.stream= -e.stream||new Xo.Socket,this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis, +a(ci,"Parser");var ui=ci;lr.Parser=ui});var li=P(Le=>{"use strict";p();Object.defineProperty(Le,"__esModule",{value:!0});Le.DatabaseError=Le. +serialize=Le.parse=void 0;var lf=ei();Object.defineProperty(Le,"DatabaseError",{enumerable:!0,get:a( +function(){return lf.DatabaseError},"get")});var ff=Vo();Object.defineProperty(Le,"serialize",{enumerable:!0, +get:a(function(){return ff.serialize},"get")});var hf=Jo();function df(r,e){let t=new hf.Parser;return r. +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(df,"parse");Le.parse=df});var Zo={};ge(Zo,{connect:()=>pf});function pf({socket:r,servername:e}){return r.startTls(e),r}var Xo=te( +()=>{"use strict";p();a(pf,"connect")});var di=P((Ip,ra)=>{"use strict";p();var ea=(ze(),$(as)),yf=Pe().EventEmitter,{parse:mf,serialize:K}=li(), +ta=K.flush(),wf=K.sync(),gf=K.end(),hi=class hi extends yf{constructor(e){super(),e=e||{},this.stream= +e.stream||new ea.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=(Zo(),$(Jo));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= -n.ssl.key)),Xo.isIP(t)===0&&(c.servername=t);try{n.stream=u.connect(c)}catch(l){return n.emit("error", +var u=(Xo(),$(Zo));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= +n.ssl.key)),ea.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")}),hf(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& +"end",()=>{this.emit("end")}),mf(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(K.requestSsl())}startup(e){this. stream.write(K.startup(e))}cancel(e,t){this._send(K.cancel(e,t))}password(e){this._send(K.password(e))}sendSASLInitialResponseMessage(e,t){ this._send(K.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(K.sendSCRAMClientFinalMessage( e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(K.query(e))}parse(e){ this._send(K.parse(e))}bind(e){this._send(K.bind(e))}execute(e){this._send(K.execute(e))}flush(){this. -stream.writable&&this.stream.write(ea)}sync(){this._ending=!0,this._send(ea),this._send(df)}ref(){this. +stream.writable&&this.stream.write(ta)}sync(){this._ending=!0,this._send(ta),this._send(wf)}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(pf,()=>{this.stream.end()})}close(e){this._send(K. +this.stream.end();return}return this.stream.write(gf,()=>{this.stream.end()})}close(e){this._send(K. close(e))}describe(e){this._send(K.describe(e))}sendCopyFromChunk(e){this._send(K.copyData(e))}endCopyFrom(){ -this._send(K.copyDone())}sendCopyFail(e){this._send(K.copyFail(e))}};a(fi,"Connection");var li=fi;ta. -exports=li});var ia=R((Ip,na)=>{"use strict";p();var yf=Re().EventEmitter,Cp=(Tt(),$(It)),mf=Ct(),di=go(),wf=Po(), -gf=Zt(),bf=ir(),ra=Wo(),xf=_t(),Sf=hi(),pi=class pi extends yf{constructor(e){super(),this.connectionParameters= -new bf(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database, +this._send(K.copyDone())}sendCopyFail(e){this._send(K.copyFail(e))}};a(hi,"Connection");var fi=hi;ra. +exports=fi});var sa=P((Bp,ia)=>{"use strict";p();var bf=Pe().EventEmitter,Pp=(Rt(),$(Tt)),xf=Ct(),pi=bo(),Sf=Po(), +vf=Xt(),Ef=sr(),na=Ho(),Af=_t(),_f=di(),yi=class yi extends bf{constructor(e){super(),this.connectionParameters= +new Ef(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||S.Promise, -this._types=new gf(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= -!1,this._queryable=!0,this.connection=t.connection||new Sf({stream:t.stream,ssl:this.connectionParameters. +this._types=new vf(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= +!1,this._queryable=!0,this.connection=t.connection||new _f({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||xf.binary,this. +connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t.binary||Af.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=>{w.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():wf(this.connectionParameters, +password=this.password=null;e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():Sf(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=mf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ -this._checkPgPass(()=>{this.saslSession=di.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( -this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){di.continueSession( +()=>{let t=xf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ +this._checkPgPass(()=>{this.saslSession=pi.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( +this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){pi.continueSession( this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession. -response)}_handleAuthSASLFinal(e){di.finalizeSession(this.saslSession,e.data),this.saslSession=null}_handleBackendKeyData(e){ +response)}_handleAuthSASLFinal(e){pi.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 ra(e,t,n),i.callback||(s=new this._Promise((l,f)=>{i.callback= +connectionParameters.query_timeout,i=new na(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");w.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(pi,"Client");var lr=pi;lr.Query=ra;na.exports=lr});var ua=R((Rp,aa)=>{"use strict";p();var vf=Re().EventEmitter,sa=a(function(){},"NOOP"),oa=a((r,e)=>{ -let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),wi=class wi{constructor(e,t,n){ -this.client=e,this.idleListener=t,this.timeoutId=n}};a(wi,"IdleItem");var yi=wi,gi=class gi{constructor(e){ -this.callback=e}};a(gi,"PendingItem");var ot=gi;function Ef(){throw new Error("Release called on cli\ -ent which has already been released to the pool.")}a(Ef,"throwOnDoubleRelease");function fr(r,e){if(e) +_Promise(t=>{this.connection.once("end",t)})}};a(yi,"Client");var fr=yi;fr.Query=na;ia.exports=fr});var ca=P((Mp,ua)=>{"use strict";p();var Cf=Pe().EventEmitter,oa=a(function(){},"NOOP"),aa=a((r,e)=>{ +let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),gi=class gi{constructor(e,t,n){ +this.client=e,this.idleListener=t,this.timeoutId=n}};a(gi,"IdleItem");var mi=gi,bi=class bi{constructor(e){ +this.callback=e}};a(bi,"PendingItem");var ot=bi;function If(){throw new Error("Release called on cli\ +ent which has already been released to the pool.")}a(If,"throwOnDoubleRelease");function hr(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(fr,"promisify"); -function Af(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(hr,"promisify"); +function Tf(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(Af,"makeIdleListener");var bi=class bi extends vf{constructor(e,t){super(),this.options= +dleListener")}a(Tf,"makeIdleListener");var xi=class xi extends Cf{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||Rt().Client,this.Promise= +this.log=this.options.log||function(){},this.Client=this.options.Client||t||Bt().Client,this.Promise= this.options.Promise||S.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=oa( +if(!this._isFull())return this.newClient(e);throw new Error("unexpected condition")}_remove(e){let t=aa( 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=fr(this.Promise,e),n=t. +l after calling end on the pool");return e?e(i):this.Promise.reject(i)}let t=hr(this.Promise,e),n=t. result;if(this._isFull()||this._idle.length){if(this._idle.length&&w.nextTick(()=>this._pulseQueue()), !this.options.connectionTimeoutMillis)return this._pendingQueue.push(new ot(t.callback)),n;let i=a((u,c,l)=>{ -clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new ot(i),o=setTimeout(()=>{oa(this._pendingQueue, +clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new ot(i),o=setTimeout(()=>{aa(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 ot(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( -t);let n=Af(this,t);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&& +t);let n=Tf(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,sa);else{if(this.log("new client connected"),this.options. +_pulseQueue(),e.timedOut||e.callback(o,void 0,oa);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 ot((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,sa);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ -let n=!1;return i=>{n&&Ef(),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,oa);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ +let n=!1;return i=>{n&&If(),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 yi( -e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=fr(this.Promise,e);return v(function(){ +this.options.allowExitOnIdle&&s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new mi( +e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=hr(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=fr(this.Promise,n);return n=i.callback,this. +d"))}),s.result}typeof t=="function"&&(n=t,t=void 0);let i=hr(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=fr(this.Promise,e);return this._endCallback=t.callback,this. +this.Promise.reject(n)}this.ending=!0;let t=hr(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(bi,"Pool");var mi=bi;aa.exports=mi});var ca={};ge(ca,{default:()=>_f});var _f,la=re(()=>{"use strict";p();_f={}});var fa=R((Fp,Cf)=>{Cf.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javas\ +return this._clients.length}};a(xi,"Pool");var wi=xi;ua.exports=wi});var la={};ge(la,{default:()=>Rf});var Rf,fa=te(()=>{"use strict";p();Rf={}});var ha=P((Op,Pf)=>{Pf.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 pa=R((Mp,da)=>{"use strict";p();var ha=Re().EventEmitter,If=(Tt(),$(It)),xi=Ct(),at=da.exports=function(r,e,t){ -ha.call(this),r=xi.normalizeQueryConfig(r,e,t),this.text=r.text,this.values=r.values,this.name=r.name, +a178655"}});var ya=P((Np,pa)=>{"use strict";p();var da=Pe().EventEmitter,Bf=(Rt(),$(Tt)),Si=Ct(),at=pa.exports=function(r,e,t){ +da.call(this),r=Si.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))};If.inherits(at,ha); -var Tf={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ +this.on("newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};Bf.inherits(at,da); +var Lf={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"\ file",sourceLine:"line",sourceFunction:"routine"};at.prototype.handleError=function(r){var e=this.native. -pq.resultErrorFields();if(e)for(var t in e){var n=Tf[t]||t;r[n]=e[t]}this.callback?this.callback(r): +pq.resultErrorFields();if(e)for(var t in e){var n=Lf[t]||t;r[n]=e[t]}this.callback?this.callback(r): this.emit("error",r),this.state="error"};at.prototype.then=function(r,e){return this._getPromise().then( r,e)};at.prototype.catch=function(r){return this._getPromise().catch(r)};at.prototype._getPromise=function(){ return this._promise?this._promise:(this._promise=new Promise(function(r,e){this._once("end",r),this. @@ -1170,72 +1170,72 @@ 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(w.domain&&(t=w.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(xi.prepareValue);if(r. +se conflicts and silent errors executing queries"));var n=(this.values||[]).map(Si.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(xi. -prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var ga=R((Np,wa)=>{"use strict";p();var Pf=(la(),$(ca)),Rf=Zt(),Op=fa(),ya=Re().EventEmitter,Bf=(Tt(),$(It)), -Lf=ir(),ma=pa(),oe=wa.exports=function(r){ya.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. -_types=new Rf(r.types),this.native=new Pf({types:this._types}),this._queryQueue=[],this._ending=!1,this. -_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Lf(r);this. +this.values)){let s=new Error("Query values must be an array");return t(s)}var i=this.values.map(Si. +prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var ba=P((Wp,ga)=>{"use strict";p();var Ff=(fa(),$(la)),Mf=Xt(),jp=ha(),ma=Pe().EventEmitter,kf=(Rt(),$(Tt)), +Uf=sr(),wa=ya(),se=ga.exports=function(r){ma.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. +_types=new Mf(r.types),this.native=new Ff({types:this._types}),this._queryQueue=[],this._ending=!1,this. +_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Uf(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={}};oe.Query= -ma;Bf.inherits(oe,ya);oe.prototype._errorAllQueries=function(r){let e=a(t=>{w.nextTick(()=>{t.native= +password}),this.database=e.database,this.host=e.host,this.port=e.port,this.namedQueries={}};se.Query= +wa;kf.inherits(se,ma);se.prototype._errorAllQueries=function(r){let e=a(t=>{w.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};oe.prototype._connect=function(r){var e=this; +null),this._queryQueue.forEach(e),this._queryQueue.length=0};se.prototype._connect=function(r){var e=this; if(this._connecting){w.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()})})};oe.prototype.connect=function(r){if(r){this._connect(r);return}return new this. -_Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};oe.prototype.query=function(r,e,t){var n,i,s,o,u; +_pulseQueryQueue(!0),r()})})};se.prototype.connect=function(r){if(r){this._connect(r);return}return new this. +_Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};se.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=="f\ unction")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 ma(r,e,t),!n.callback){let c,l;i=new this. +e);else if(s=this.connectionParameters.query_timeout,n=new wa(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");w.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,w.nextTick(()=>{n.handleError( new Error("Client was closed and is not queryable"))}),i):(this._queryQueue.push(n),this._pulseQueryQueue(), i):(n.native=this.native,w.nextTick(()=>{n.handleError(new Error("Client has encountered a connectio\ -n error and is not queryable"))}),i)};oe.prototype.end=function(r){var e=this;this._ending=!0,this._connected|| +n error and is not queryable"))}),i)};se.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")), -w.nextTick(()=>{e.emit("end"),r&&r()})}),t};oe.prototype._hasActiveQuery=function(){return this._activeQuery&& -this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};oe.prototype._pulseQueryQueue=function(r){ +w.nextTick(()=>{e.emit("end"),r&&r()})}),t};se.prototype._hasActiveQuery=function(){return this._activeQuery&& +this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};se.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()})}}; -oe.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. -indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};oe.prototype.ref=function(){}; -oe.prototype.unref=function(){};oe.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( -r,e,t)};oe.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var Si=R((jp,ba)=>{"use strict";p();ba.exports=ga()});var Rt=R((Hp,Bt)=>{"use strict";p();var kf=ia(),Ff=_t(),Mf=hi(),Uf=ua(),{DatabaseError:Df}=ci(),Of=a( -r=>{var e;return e=class extends Uf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),vi=a( -function(r){this.defaults=Ff,this.Client=r,this.Query=this.Client.Query,this.Pool=Of(this.Client),this. -_pools=[],this.Connection=Mf,this.types=vt(),this.DatabaseError=Df},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< -"u"?Bt.exports=new vi(Si()):(Bt.exports=new vi(kf),Object.defineProperty(Bt.exports,"native",{configurable:!0, -enumerable:!1,get(){var r=null;try{r=new vi(Si())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. -defineProperty(Bt.exports,"native",{value:r}),r}}))});p();p();ze();Tr();p();var mu=Object.defineProperty,wu=Object.defineProperties,gu=Object.getOwnPropertyDescriptors,us=Object. -getOwnPropertySymbols,bu=Object.prototype.hasOwnProperty,xu=Object.prototype.propertyIsEnumerable,cs=a( -(r,e,t)=>e in r?mu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), -Su=a((r,e)=>{for(var t in e||(e={}))bu.call(e,t)&&cs(r,t,e[t]);if(us)for(var t of us(e))xu.call(e,t)&& -cs(r,t,e[t]);return r},"__spreadValues"),vu=a((r,e)=>wu(r,gu(e)),"__spreadProps"),Eu=1008e3,ls=new Uint8Array( -new Uint16Array([258]).buffer)[0]===2,Au=new TextDecoder,Pr=new TextEncoder,Nt=Pr.encode("0123456789\ -abcdef"),qt=Pr.encode("0123456789ABCDEF"),_u=Pr.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ -stuvwxyz0123456789+/");var fs=_u.slice();fs[62]=45;fs[63]=95;var ct,Qt;function Cu(r,{alphabet:e,scratchArr:t}={}){if(!ct)if(ct= -new Uint16Array(256),Qt=new Uint16Array(256),ls)for(let C=0;C<256;C++)ct[C]=Nt[C&15]<<8|Nt[C>>>4],Qt[C]= -qt[C&15]<<8|qt[C>>>4];else for(let C=0;C<256;C++)ct[C]=Nt[C&15]|Nt[C>>>4]<<8,Qt[C]=qt[C&15]|qt[C>>>4]<< +se.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. +indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};se.prototype.ref=function(){}; +se.prototype.unref=function(){};se.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( +r,e,t)};se.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var vi=P((Gp,xa)=>{"use strict";p();xa.exports=ba()});var Bt=P((Kp,Lt)=>{"use strict";p();var Df=sa(),Of=_t(),Nf=di(),qf=ca(),{DatabaseError:Qf}=li(),jf=a( +r=>{var e;return e=class extends qf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),Ei=a( +function(r){this.defaults=Of,this.Client=r,this.Query=this.Client.Query,this.Pool=jf(this.Client),this. +_pools=[],this.Connection=Nf,this.types=vt(),this.DatabaseError=Qf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< +"u"?Lt.exports=new Ei(vi()):(Lt.exports=new Ei(Df),Object.defineProperty(Lt.exports,"native",{configurable:!0, +enumerable:!1,get(){var r=null;try{r=new Ei(vi())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. +defineProperty(Lt.exports,"native",{value:r}),r}}))});p();p();ze();Rr();p();var wu=Object.defineProperty,gu=Object.defineProperties,bu=Object.getOwnPropertyDescriptors,cs=Object. +getOwnPropertySymbols,xu=Object.prototype.hasOwnProperty,Su=Object.prototype.propertyIsEnumerable,ls=a( +(r,e,t)=>e in r?wu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), +vu=a((r,e)=>{for(var t in e||(e={}))xu.call(e,t)&&ls(r,t,e[t]);if(cs)for(var t of cs(e))Su.call(e,t)&& +ls(r,t,e[t]);return r},"__spreadValues"),Eu=a((r,e)=>gu(r,bu(e)),"__spreadProps"),Au=1008e3,fs=new Uint8Array( +new Uint16Array([258]).buffer)[0]===2,_u=new TextDecoder,Pr=new TextEncoder,qt=Pr.encode("0123456789\ +abcdef"),Qt=Pr.encode("0123456789ABCDEF"),Cu=Pr.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ +stuvwxyz0123456789+/");var hs=Cu.slice();hs[62]=45;hs[63]=95;var ct,jt;function Iu(r,{alphabet:e,scratchArr:t}={}){if(!ct)if(ct= +new Uint16Array(256),jt=new Uint16Array(256),fs)for(let C=0;C<256;C++)ct[C]=qt[C&15]<<8|qt[C>>>4],jt[C]= +Qt[C&15]<<8|Qt[C>>>4];else for(let C=0;C<256;C++)ct[C]=qt[C&15]|qt[C>>>4]<<8,jt[C]=Qt[C&15]|Qt[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"?Qt:ct,f=0,y=0,g;if(ls) +r.buffer,r.byteOffset,s),c=new Uint32Array(o.buffer,o.byteOffset,i),l=e==="upper"?jt:ct,f=0,y=0,g;if(fs) 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;ut[de(this. +n,i]of Object.entries(this._keyMap))this._mapKey.set(i,n)}let t={};return e.forEach((n,i)=>t[he(this. _mapKey.has(i)?this._mapKey.get(i):i)]=n),t}mapDecode(e,t){let n=this.decode(e);if(this._keyMap)switch(n. -constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return Es( -()=>(Or(),this?this.decode(e,t):ht.prototype.decode.call(ys,e,t)));Qe=t>-1?t:e.length,h=0,Lr=0,dt=0, -Ht=null,Br=gs,j=null,x=e;try{X=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ +constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return As( +()=>(Nr(),this?this.decode(e,t):ht.prototype.decode.call(ms,e,t)));Qe=t>-1?t:e.length,h=0,Fr=0,dt=0, +$t=null,Lr=bs,j=null,x=e;try{X=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ throw x=null,e instanceof Uint8Array?n:new Error("Source must be a Uint8Array or Buffer but was a "+ -(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof ht){if(B=this,ie=this.sharedValues&& +(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof ht){if(B=this,ne=this.sharedValues&& (this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this. -structures)return N=this.structures,jt();(!N||N.length>0)&&(N=[])}else B=ys,(!N||N.length>0)&&(N=[]), -ie=null;return jt()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;pt=!0;let o=this?this.decode(e, -s):qr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=j.postBundlePosition){let e=new Error("Unexpected bundle pos\ -ition");throw e.incomplete=!0,e}h=j.postBundlePosition,j=null}if(h==Qe)N=null,x=null,he&&(he=null);else if(h> +structures)return N=this.structures,Wt();(!N||N.length>0)&&(N=[])}else B=ms,(!N||N.length>0)&&(N=[]), +ne=null;return Wt()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;pt=!0;let o=this?this.decode(e, +s):Qr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=j.postBundlePosition){let e=new Error("Unexpected bundle pos\ +ition");throw e.incomplete=!0,e}h=j.postBundlePosition,j=null}if(h==Qe)N=null,x=null,fe&&(fe=null);else if(h> Qe){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!pt)throw new Error( -"Data read, but end of buffer not reached");return r}catch(r){throw Or(),(r instanceof RangeError||r. -message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a(jt,"checkedRead");function L(){ -let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return Fu();r=X. -getUint16(h),h+=2;break;case 26:if(e==7){let t=X.getFloat32(h);if(B.useFloat32>2){let n=As[(x[h]&127)<< +"Data read, but end of buffer not reached");return r}catch(r){throw Nr(),(r instanceof RangeError||r. +message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a(Wt,"checkedRead");function L(){ +let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return ku();r=X. +getUint16(h),h+=2;break;case 26:if(e==7){let t=X.getFloat32(h);if(B.useFloat32>2){let n=_s[(x[h]&127)<< 1|x[h+1]>>7];return h+=4,(n*t+(t>0?.5:-.5)>>0)/n}return h+=4,t}if(r=X.getUint32(h),h+=4,e===1)return-1- r;break;case 27:if(e==7){let t=X.getFloat64(h);return h+=8,t}if(e>1){if(X.getUint32(h)>0)throw new Error( "JavaScript does not support arrays, maps, or strings with length over 4294967295");r=X.getUint32(h+ @@ -1269,39 +1269,39 @@ r;break;case 27:if(e==7){let t=X.getFloat64(h);return h+=8,t}if(e>1){if(X.getUin switch(e){case 2:case 3:throw new Error("Indefinite length not supported for byte or text strings");case 4: let t=[],n,i=0;for(;(n=L())!=Ye;){if(i>=lt)throw new Error(`Array length exceeds ${lt}`);t[i++]=n}return e== 4?t:e==3?t.join(""):m.concat(t);case 5:let s;if(B.mapsAsObjects){let o={},u=0;if(B.keyMap)for(;(s=L())!= -Ye;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[de(B.decodeKey(s))]=L()}else for(;(s= -L())!=Ye;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[de(s)]=L()}return o}else{ft&& +Ye;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[he(B.decodeKey(s))]=L()}else for(;(s= +L())!=Ye;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[he(s)]=L()}return o}else{ft&& (B.mapsAsObjects=!0,ft=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s=L())!=Ye;){if(u++>=Ae)throw new Error( `Map size exceeds ${Ae}`);o.set(B.decodeKey(s),L())}}else{let u=0;for(;(s=L())!=Ye;){if(u++>=Ae)throw new Error( `Map size exceeds ${Ae}`);o.set(s,L())}}return o}case 7:return Ye;default:throw new Error("Invalid m\ ajor type for indefinite length "+e)}default:throw new Error("Unknown token "+r)}switch(e){case 0:return r;case 1: -return~r;case 2:return ku(r);case 3:if(dt>=h)return Ht.slice(h-$t,(h+=r)-$t);if(dt==0&&Qe<140&&r<32){ -let i=r<16?xs(r):Lu(r);if(i!=null)return i}return Bu(r);case 4:if(r>=lt)throw new Error(`Array lengt\ +return~r;case 2:return Mu(r);case 3:if(dt>=h)return $t.slice(h-Gt,(h+=r)-Gt);if(dt==0&&Qe<140&&r<32){ +let i=r<16?Ss(r):Fu(r);if(i!=null)return i}return Lu(r);case 4:if(r>=lt)throw new Error(`Array lengt\ h exceeds ${lt}`);let t=new Array(r);for(let i=0;i=Ae)throw new Error( -`Map size exceeds ${lt}`);if(B.mapsAsObjects){let i={};if(B.keyMap)for(let s=0;s=ds){let i=N[r&8191];if(i)return i.read||(i.read=Mr(i)),i.read();if(r<65536){if(r== -Ru){let s=Ze(),o=L(),u=L();Dr(o,u);let c={};if(B.keyMap)for(let l=2;l=ps){let i=N[r&8191];if(i)return i.read||(i.read=Ur(i)),i.read();if(r<65536){if(r== +Bu){let s=Ze(),o=L(),u=L();Or(o,u);let c={};if(B.keyMap)for(let l=2;l23)switch(t){case 24:t=x[h++];break;case 25:t=X.getUint16(h),h+=2;break;case 26:t=X.getUint32( h),h+=4;break;default:throw new Error("Expected array header, but got "+x[h-1])}let n=this.compiledReader; -for(;n;){if(n.propertyCount===t)return n(L);n=n.next}if(this.slowReads++>=bs){let s=this.length==t?this: -this.slice(0,t);return n=B.keyMap?new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>ms.test( -o)?de(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>ms. -test(o)?de(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"),this.compiledReader&&(n.next=this. +for(;n;){if(n.propertyCount===t)return n(L);n=n.next}if(this.slowReads++>=xs){let s=this.length==t?this: +this.slice(0,t);return n=B.keyMap?new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>ws.test( +o)?he(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>ws. +test(o)?he(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"),this.compiledReader&&(n.next=this. compiledReader),n.propertyCount=t,this.compiledReader=n,n(L)}let i={};if(B.keyMap)for(let s=0;s64&&Rr)return Rr.decode(x.subarray(h,h+=r));let t=h+ +if(r==null)return r+"";throw new Error("Invalid property name type "+typeof r)}a(he,"safeKey");var Lu=Dr;function Dr(r){let e;if(r<16&&(e=Ss(r)))return e;if(r>64&&Br)return Br.decode(x.subarray(h,h+=r));let t=h+ r,n=[];for(e="";h=t||(x[h]& 192)!==128)n.push(65533);else{let s=x[h++]&63;n.push((i&31)<<6|s)}else if((i&240)===224){let s=h=t||(s&192)!==128||i===224&&s<160||i===237&&s>=160)n.push(65533);else if(h++,h>=t||(x[h]&192)!== @@ -1310,9 +1310,9 @@ t?x[h]:0;if(i>244||h>=t||(s&192)!==128||i===240&&s<144||i===244&&s>=144)n.push(6 t||(x[h]&192)!==128)n.push(65533);else{let o=x[h++]&63;if(h>=t||(x[h]&192)!==128)n.push(65533);else{ let u=x[h++]&63,c=(i&7)<<18|(s&63)<<12|o<<6|u;c-=65536,n.push(c>>>10&1023|55296),n.push(56320|c&1023)}}}else n.push(65533);n.length>=4096&&(e+=V.apply(String,n),n.length=0)}return n.length>0&&(e+=V.apply(String, -n)),e}a(Ur,"readStringJS");var V=String.fromCharCode;function Lu(r){let e=h,t=new Array(r);for(let n=0;n< -r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return V.apply(String,t)}a(Lu,"longStringInJS"); -function xs(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return V(e)}}else{ +n)),e}a(Dr,"readStringJS");var V=String.fromCharCode;function Fu(r){let e=h,t=new Array(r);for(let n=0;n< +r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return V.apply(String,t)}a(Fu,"longStringInJS"); +function Ss(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return V(e)}}else{ let e=x[h++],t=x[h++];if((e&128)>0||(t&128)>0){h-=2;return}if(r<3)return V(e,t);let n=x[h++];if((n&128)> 0){h-=3;return}return V(e,t,n)}else{let e=x[h++],t=x[h++],n=x[h++],i=x[h++];if((e&128)>0||(t&128)>0|| (n&128)>0||(i&128)>0){h-=4;return}if(r<6){if(r===4)return V(e,t,n,i);{let s=x[h++];if((s&128)>0){h-= @@ -1325,63 +1325,63 @@ let y=x[h++];if((y&128)>0){h-=11;return}return V(e,t,n,i,s,o,u,c,l,f,y)}else{let g=x[h++];if((l&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return V(e,t, n,i,s,o,u,c,l,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E)}}else{ let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return V(e,t,n,i,s,o,u,c,l,f,y,g, -E,C);let W=x[h++];if((W&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E,C,W)}}}}}a(xs,"short\ -StringInJS");function ku(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( -h,h+=r)}a(ku,"readBin");var Ss=new Float32Array(1),Wt=new Uint8Array(Ss.buffer,0,4);function Fu(){let r=x[h++],e=x[h++],t=(r& +E,C);let W=x[h++];if((W&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E,C,W)}}}}}a(Ss,"short\ +StringInJS");function Mu(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( +h,h+=r)}a(Mu,"readBin");var vs=new Float32Array(1),Ht=new Uint8Array(vs.buffer,0,4);function ku(){let r=x[h++],e=x[h++],t=(r& 127)>>2;if(t===31)return e||r&3?NaN:r&128?-1/0:1/0;if(t===0){let n=((r&3)<<8|e)/16777216;return r&128? --n:n}return Wt[3]=r&128|(t>>1)+56,Wt[2]=(r&7)<<5|e>>3,Wt[1]=e<<5,Wt[0]=0,Ss[0]}a(Fu,"getFloat16");var oh=new Array( -4096);var Qr=class Qr{constructor(e,t){this.value=e,this.tag=t}};a(Qr,"Tag");var Xe=Qr;q[0]=r=>new Date(r); +-n:n}return Ht[3]=r&128|(t>>1)+56,Ht[2]=(r&7)<<5|e>>3,Ht[1]=e<<5,Ht[0]=0,vs[0]}a(ku,"getFloat16");var lh=new Array( +4096);var jr=class jr{constructor(e,t){this.value=e,this.tag=t}};a(jr,"Tag");var Xe=jr;q[0]=r=>new Date(r); q[1]=r=>new Date(Math.round(r*1e3));q[2]=r=>{let e=BigInt(0);for(let t=0,n=r.byteLength;tBigInt(-1)-q[2](r);q[4]=r=>+(r[1]+"e"+r[0]);q[5]=r=>r[1]*Math. -exp(r[0]*Math.log(2));var Dr=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. -restoreStructures=[]))[r]=t),N[r]=e,e.read=Mr(e)},"recordDefinition");q[Tu]=r=>{let e=r.length,t=r[1]; -Dr(r[0],t);let n={};for(let i=2;ij?j[0].slice( +exp(r[0]*Math.log(2));var Or=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. +restoreStructures=[]))[r]=t),N[r]=e,e.read=Ur(e)},"recordDefinition");q[Ru]=r=>{let e=r.length,t=r[1]; +Or(r[0],t);let n={};for(let i=2;ij?j[0].slice( j.position0,j.position0+=r):new Xe(r,14);q[15]=r=>j?j[1].slice(j.position1,j.position1+=r):new Xe(r, -15);var Mu={Error,RegExp};q[27]=r=>(Mu[r[0]]||Error)(r[1],r[2]);var vs=a(r=>{if(x[h++]!=132){let t=new Error( +15);var Uu={Error,RegExp};q[27]=r=>(Uu[r[0]]||Error)(r[1],r[2]);var Es=a(r=>{if(x[h++]!=132){let t=new Error( "Packed values structure must be followed by a 4 element array");throw x.length{if(!ie)if(B.getShared)Nr();else return new Xe( -r,ps);if(typeof r=="number")return ie[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ -ger packed references yet");throw r===void 0&&(e.incomplete=!0),e};q[28]=r=>{he||(he=new Map,he.id=0); -let e=he.id++,t=h,n=x[h],i;n>>5==4?i=[]:i={};let s={target:i};he.set(e,s);let o=r();return s.used?(Object. -getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(h=t,i=o,he.set(e,{target:i}),o=r()),Object.assign(i,o)): -(s.target=o,o)};q[28].handlesRead=!0;q[29]=r=>{let e=he.get(r);return e.used=!0,e.target};q[258]=r=>new Set( +nt array");throw t.incomplete=!0,t}return ne=ne?e.concat(ne.slice(e.length)):e,ne.prefixes=r(),ne.suffixes= +r(),r()},"packedTable");Es.handlesRead=!0;q[51]=Es;q[ys]=r=>{if(!ne)if(B.getShared)qr();else return new Xe( +r,ys);if(typeof r=="number")return ne[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ +ger packed references yet");throw r===void 0&&(e.incomplete=!0),e};q[28]=r=>{fe||(fe=new Map,fe.id=0); +let e=fe.id++,t=h,n=x[h],i;n>>5==4?i=[]:i={};let s={target:i};fe.set(e,s);let o=r();return s.used?(Object. +getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(h=t,i=o,fe.set(e,{target:i}),o=r()),Object.assign(i,o)): +(s.target=o,o)};q[28].handlesRead=!0;q[29]=r=>{let e=fe.get(r);return e.used=!0,e.target};q[258]=r=>new Set( r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,ft=!0),r())).handlesRead=!0;function Je(r,e){return typeof r== -"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Je,"combine");function qe(){if(!ie) -if(B.getShared)Nr();else throw new Error("No packed values available");return ie}a(qe,"getPackedValu\ -es");var Uu=1399353956;kr.push((r,e)=>{if(r>=225&&r<=255)return Je(qe().prefixes[r-224],e);if(r>=28704&& +"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Je,"combine");function qe(){if(!ne) +if(B.getShared)qr();else throw new Error("No packed values available");return ne}a(qe,"getPackedValu\ +es");var Du=1399353956;Mr.push((r,e)=>{if(r>=225&&r<=255)return Je(qe().prefixes[r-224],e);if(r>=28704&& r<=32767)return Je(qe().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return Je(qe().prefixes[r- 1879048192],e);if(r>=216&&r<=223)return Je(e,qe().suffixes[r-216]);if(r>=27647&&r<=28671)return Je(e, qe().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return Je(e,qe().suffixes[r-1811939328]);if(r== -Uu)return{packedValues:ie,structures:N.slice(0),version:e};if(r==55799)return e});var Du=new Uint8Array( -new Uint16Array([1]).buffer)[0]==1,ws=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> +Du)return{packedValues:ne,structures:N.slice(0),version:e};if(r==55799)return e});var Ou=new Uint8Array( +new Uint16Array([1]).buffer)[0]==1,gs=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> "u"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"? -{name:"BigInt64Array"}:BigInt64Array,Float32Array,Float64Array],Ou=[64,68,69,70,71,72,77,78,79,85,86]; -for(let r=0;r{if(!r)throw new Error("Could not find typed array for code "+e); +2:n==8?3:0;q[i?e:e-4]=n==1||i==Ou?o=>{if(!r)throw new Error("Could not find typed array for code "+e); return!B.copyBuffers&&(n===1||n===2&&!(o.byteOffset&1)||n===4&&!(o.byteOffset&3)||n===8&&!(o.byteOffset& 7))?new r(o.buffer,o.byteOffset,o.byteLength>>s):new r(Uint8Array.prototype.slice.call(o,0).buffer)}: o=>{if(!r)throw new Error("Could not find typed array for code "+e);let u=new DataView(o.buffer,o.byteOffset, o.byteLength),c=o.length>>s,l=new r(c),f=u[t];for(let y=0;y23)switch(r){case 24:r=x[h++];break;case 25:r=X.getUint16( -h),h+=2;break;case 26:r=X.getUint32(h),h+=4;break}return r}a(Ze,"readJustLength");function Nr(){if(B. -getShared){let r=Es(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ie= -B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(Nr, -"loadShared");function Es(r){let e=Qe,t=h,n=Lr,i=$t,s=dt,o=Ht,u=Br,c=he,l=j,f=new Uint8Array(x.slice( -0,Qe)),y=N,g=B,E=pt,C=r();return Qe=e,h=t,Lr=n,$t=i,dt=s,Ht=o,Br=u,he=c,j=l,x=f,pt=E,N=y,B=g,X=new DataView( -x.buffer,x.byteOffset,x.byteLength),C}a(Es,"saveState");function Or(){x=null,he=null,N=null}a(Or,"cl\ -earSource");var As=new Array(147);for(let r=0;r<256;r++)As[r]=+("1e"+Math.floor(45.15-r*.30103));var qr=new Fr({ -useRecords:!1}),ah=qr.decode,_s=qr.decodeMultiple;p();var Gt=class Gt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ +h),h+=2;break;case 26:r=X.getUint32(h),h+=4;break}return r}a(Ze,"readJustLength");function qr(){if(B. +getShared){let r=As(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ne= +B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(qr, +"loadShared");function As(r){let e=Qe,t=h,n=Fr,i=Gt,s=dt,o=$t,u=Lr,c=fe,l=j,f=new Uint8Array(x.slice( +0,Qe)),y=N,g=B,E=pt,C=r();return Qe=e,h=t,Fr=n,Gt=i,dt=s,$t=o,Lr=u,fe=c,j=l,x=f,pt=E,N=y,B=g,X=new DataView( +x.buffer,x.byteOffset,x.byteLength),C}a(As,"saveState");function Nr(){x=null,fe=null,N=null}a(Nr,"cl\ +earSource");var _s=new Array(147);for(let r=0;r<256;r++)_s[r]=+("1e"+Math.floor(45.15-r*.30103));var Qr=new kr({ +useRecords:!1}),fh=Qr.decode,Cs=Qr.decodeMultiple;p();var Vt=class Vt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ let{strings:t,values:n}=this;for(let i=0,s=t.length;iu.length!==0).map(u=>JSON.parse(u)):_s(new Uint8Array(await r.arrayBuffer())),i=n.at(-1); -if(i?.type!=="end")throw new ee("Neon internal error: streamed response ended without a terminal mes\ -sage");if(i.status==="error")throw fo(i.error);if(i.status!=="ok")throw new ee("Neon internal error:\ - unexpected streamed response status");let s=[],o;for(let u of n.slice(0,-1))switch(u.type){case"col\ -umns":if(o!==void 0||!Array.isArray(u.columns))throw new ee("Neon internal error: unexpected streame\ -d response message");o={fields:u.columns,rows:[]};break;case"row":if(o===void 0||!Array.isArray(u.row)) -throw new ee("Neon internal error: unexpected streamed response message");o.rows.push(u.row);break;case"\ -query":if(o===void 0||u.query===void 0)throw new ee("Neon internal error: unexpected streamed respon\ -se message");s.push({fields:o.fields,rows:o.rows,command:u.query.command,rowCount:u.query.rowCount}), -o=void 0;break;default:throw new ee("Neon internal error: unexpected streamed response message")}if(o!== -void 0||!t&&s.length!==1)throw new ee("Neon internal error: incomplete streamed response");return t? -{results:s}:s[0]}a(zc,"readStreamingResult");function Yc(r){return r instanceof m?"\\x"+hs(r):r}a(Yc, -"encodeBuffersAsBytea");function ao(r){let{query:e,params:t}=r instanceof yt?r.toParameterizedQuery(): -r;return{query:e,params:t.map(n=>Yc((0,lo.prepareValue)(n)))}}a(ao,"prepareQuery");function ho(r,{arrayMode:e, +tackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,tr)}};a( +tr,"NeonDbError");var pe=tr,ao="transaction() expects an array of queries, or a function returning a\ +n array of queries",Kc=["severity","code","detail","hint","position","internalPosition","internalQue\ +ry","where","schema","table","column","dataType","constraint","file","line","routine"],zc={json:"app\ +lication/json",jsonl:"application/vnd.neon.sql.v1+json","cbor-seq":"application/vnd.neon.sql.v1+cbor"}, +Yc=0,Jc=1,Zc=2;function ho(r){let e=new pe(r.message);for(let t of Kc)e[t]=r[t]??void 0;return e}a(ho, +"dbError");function It(){throw new pe("Neon internal error: unexpected streamed response message")}a( +It,"unexpectedStreamingMessage");async function Xc(r,e,t){let n=e==="jsonl"?(await r.text()).split(`\ + +`).filter(u=>u.length!==0).map(u=>JSON.parse(u)):Cs(new Uint8Array(await r.arrayBuffer())),i=n.at(-1); +if(!Array.isArray(i)||i[0]!==3&&i[0]!==4)throw new pe("Neon internal error: streamed response ended \ +without a terminal message");if(i[0]===4&&i.length===2&&i[1]!==null&&typeof i[1]=="object")throw ho( +i[1]);if(i[0]!==3||i.length!==1)throw new pe("Neon internal error: unexpected streamed response stat\ +us");let s=[],o;for(let u of n.slice(0,-1)){Array.isArray(u)||It();let[c,...l]=u;switch(c){case Jc:o!== +void 0&&It(),o={fields:l,rows:[]};break;case Yc:o===void 0&&It(),o.rows.push(l);break;case Zc:(o===void 0|| +l.length!==2)&&It(),s.push({fields:o.fields,rows:o.rows,command:l[0],rowCount:l[1]}),o=void 0;break;default: +It()}}if(o!==void 0||!t&&s.length!==1)throw new pe("Neon internal error: incomplete streamed respons\ +e");return t?{results:s}:s[0]}a(Xc,"readStreamingResult");function el(r){return r instanceof m?"\\x"+ +ds(r):r}a(el,"encodeBuffersAsBytea");function uo(r){let{query:e,params:t}=r instanceof yt?r.toParameterizedQuery(): +r;return{query:e,params:t.map(n=>el((0,fo.prepareValue)(n)))}}a(uo,"prepareQuery");function po(r,{arrayMode:e, fullResults:t,fetchOptions:n,responseFormat:i,isolationLevel:s,readOnly:o,deferrable:u,authToken:c,disableWarningInBrowsers:l}={}){ if(!r)throw new Error("No database connection string was provided to `neon()`. Perhaps an environmen\ -t variable has not been set?");let f;try{f=Ir(r)}catch{throw new Error("Database connection string p\ +t variable has not been set?");let f;try{f=Tr(r)}catch{throw new Error("Database connection string p\ rovided to `neon()` is not a valid URL. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E, port:C,pathname:W}=f;if(y!=="postgres:"&&y!=="postgresql:"||!g||!E||!W)throw new Error("Database con\ nection string format for `neon()` should be: postgresql://user@host.tld/dbname?option=value");function Y(T,...b){ if(!(Array.isArray(T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can no\ w be called only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], \ options). For a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SE\ -LECT $1", [value], options).');return new je(me,new yt(T,b))}a(Y,"templateFn"),Y.query=(T,b,F)=>new je( -me,{query:T,params:b??[]},F),Y.unsafe=T=>new mt(T),Y.transaction=async(T,b)=>{if(typeof T=="function"&& -(T=T(Y)),!Array.isArray(T))throw new Error(oo);T.forEach(H=>{if(!(H instanceof je))throw new Error(oo)}); -let F=T.map(H=>H.queryData),ae=T.map(H=>H.opts??{});return me(F,ae,b)};async function me(T,b,F){let{ -fetchEndpoint:ae,fetchFunction:H}=Se,we=Array.isArray(T),Ce=we?{queries:T.map(le=>ao(le))}:ao(T),ce=n?? -{},k=i??"json",J=e??!1,ve=t??!1,Ie=s,ke=o,Fe=u;F!==void 0&&(F.fetchOptions!==void 0&&(ce={...ce,...F. -fetchOptions}),F.arrayMode!==void 0&&(J=F.arrayMode),F.fullResults!==void 0&&(ve=F.fullResults),F.responseFormat!== -void 0&&(k=F.responseFormat),F.isolationLevel!==void 0&&(Ie=F.isolationLevel),F.readOnly!==void 0&&(ke= -F.readOnly),F.deferrable!==void 0&&(Fe=F.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!== -void 0&&(ce={...ce,...b.fetchOptions}),b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(k= -b.responseFormat);let Me=c;!Array.isArray(b)&&b?.authToken!==void 0&&(Me=b.authToken);let hr=typeof ae== -"function"?ae(E,C,{jwtAuth:Me!==void 0}):ae,Ue={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ -rue","Neon-Array-Mode":"true",Accept:Kc[k]},Te=await Jc(Me);Te&&(Ue.Authorization=`Bearer ${Te}`),we&& -(Ie!==void 0&&(Ue["Neon-Batch-Isolation-Level"]=Ie),ke!==void 0&&(Ue["Neon-Batch-Read-Only"]=String( -ke)),Fe!==void 0&&(Ue["Neon-Batch-Deferrable"]=String(Fe))),l||Se.disableWarningInBrowsers||Vt();let Z; -try{Z=await(H??fetch)(hr,{method:"POST",body:JSON.stringify(Ce),headers:Ue,...ce})}catch(le){let ue=new ee( -`Error connecting to database: ${le}`);throw ue.sourceError=le,ue}if(Z.ok){let le=k==="json"?await Z. -json():await zc(Z,k,we);if(we){let ue=le.results;if(!Array.isArray(ue))throw new ee("Neon internal e\ -rror: unexpected result format");return ue.map((dr,pr)=>{let yr=b[pr]??{},Ea=yr.arrayMode??J,Aa=yr.fullResults?? -ve;return uo(dr,{arrayMode:Ea,fullResults:Aa,types:yr.types})})}else{let ue=b??{},dr=ue.arrayMode??J, -pr=ue.fullResults??ve;return uo(le,{arrayMode:dr,fullResults:pr,types:ue.types})}}else{let{status:le}=Z; -if(le===400){let ue=await Z.json();throw fo(ue)}else{let ue=await Z.text();throw new ee(`Server erro\ -r (HTTP status ${le}): ${ue}`)}}}return a(me,"execute"),Y}a(ho,"neon");var nn=class nn{constructor(e,t,n){ +LECT $1", [value], options).');return new je(me,new yt(T,b))}a(Y,"templateFn"),Y.query=(T,b,M)=>new je( +me,{query:T,params:b??[]},M),Y.unsafe=T=>new mt(T),Y.transaction=async(T,b)=>{if(typeof T=="function"&& +(T=T(Y)),!Array.isArray(T))throw new Error(ao);T.forEach(H=>{if(!(H instanceof je))throw new Error(ao)}); +let M=T.map(H=>H.queryData),oe=T.map(H=>H.opts??{});return me(M,oe,b)};async function me(T,b,M){let{ +fetchEndpoint:oe,fetchFunction:H}=Se,we=Array.isArray(T),Ce=we?{queries:T.map(ce=>uo(ce))}:uo(T),ue=n?? +{},F=i??"json",J=e??!1,ve=t??!1,Ie=s,Fe=o,Me=u;M!==void 0&&(M.fetchOptions!==void 0&&(ue={...ue,...M. +fetchOptions}),M.arrayMode!==void 0&&(J=M.arrayMode),M.fullResults!==void 0&&(ve=M.fullResults),M.responseFormat!== +void 0&&(F=M.responseFormat),M.isolationLevel!==void 0&&(Ie=M.isolationLevel),M.readOnly!==void 0&&(Fe= +M.readOnly),M.deferrable!==void 0&&(Me=M.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!== +void 0&&(ue={...ue,...b.fetchOptions}),b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(F= +b.responseFormat);let ke=c;!Array.isArray(b)&&b?.authToken!==void 0&&(ke=b.authToken);let dr=typeof oe== +"function"?oe(E,C,{jwtAuth:ke!==void 0}):oe,Ue={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ +rue","Neon-Array-Mode":"true",Accept:zc[F]},Te=await tl(ke);Te&&(Ue.Authorization=`Bearer ${Te}`),we&& +(Ie!==void 0&&(Ue["Neon-Batch-Isolation-Level"]=Ie),Fe!==void 0&&(Ue["Neon-Batch-Read-Only"]=String( +Fe)),Me!==void 0&&(Ue["Neon-Batch-Deferrable"]=String(Me))),l||Se.disableWarningInBrowsers||Kt();let Z; +try{Z=await(H??fetch)(dr,{method:"POST",body:JSON.stringify(Ce),headers:Ue,...ue})}catch(ce){let ae=new pe( +`Error connecting to database: ${ce}`);throw ae.sourceError=ce,ae}if(Z.ok){let ce=F==="json"?await Z. +json():await Xc(Z,F,we);if(we){let ae=ce.results;if(!Array.isArray(ae))throw new pe("Neon internal e\ +rror: unexpected result format");return ae.map((pr,yr)=>{let mr=b[yr]??{},Aa=mr.arrayMode??J,_a=mr.fullResults?? +ve;return co(pr,{arrayMode:Aa,fullResults:_a,types:mr.types})})}else{let ae=b??{},pr=ae.arrayMode??J, +yr=ae.fullResults??ve;return co(ce,{arrayMode:pr,fullResults:yr,types:ae.types})}}else{let{status:ce}=Z; +if(ce===400){let ae=await Z.json();throw ho(ae)}else{let ae=await Z.text();throw new pe(`Server erro\ +r (HTTP status ${ce}): ${ae}`)}}}return a(me,"execute"),Y}a(po,"neon");var sn=class sn{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(nn,"NeonQueryPromise");var je=nn;function uo(r,{arrayMode:e, -fullResults:t,types:n}){let i=new co.default(n),s=r.fields.map(c=>c.name),o=r.fields.map(c=>i.getTypeParser( +this.queryData,this.opts).finally(e)}};a(sn,"NeonQueryPromise");var je=sn;function co(r,{arrayMode:e, +fullResults:t,types:n}){let i=new lo.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(uo,"processQueryResult");async function Jc(r){if(typeof r=="string")return r;if(typeof r== -"function")try{return await Promise.resolve(r())}catch(e){let t=new ee("Error getting auth token."); -throw e instanceof Error&&(t=new ee(`Error getting auth token: ${e.message}`)),t}}a(Jc,"getAuthToken");p();var Sa=De(Rt());p();var xa=De(Rt());var Ei=class Ei extends xa.Client{constructor(t){super(t);this.config=t}get neonConfig(){return this. +o,r._types=i,r):u}a(co,"processQueryResult");async function tl(r){if(typeof r=="string")return r;if(typeof r== +"function")try{return await Promise.resolve(r())}catch(e){let t=new pe("Error getting auth token."); +throw e instanceof Error&&(t=new pe(`Error getting auth token: ${e.message}`)),t}}a(tl,"getAuthToken");p();var va=De(Bt());p();var Sa=De(Bt());var Ai=class Ai extends Sa.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\ @@ -1478,12 +1477,12 @@ c=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let l=this.c "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|| -Vt(),this._handleAuthCleartextPassword(),this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){ +Kt(),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(Te=>{if(!/^.=/.test(Te))throw new Error( -"SASL: Invalid attribute pair entry");let Z=Te[0],le=Te.substring(2);return[Z,le]})),c=u.r,l=u.s,f=u. +"SASL: Invalid attribute pair entry");let Z=Te[0],ce=Te.substring(2);return[Z,ce]})),c=u.r,l=u.s,f=u. i;if(!c||!/^[!-+--~]+$/.test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unp\ rintable");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( @@ -1493,29 +1492,29 @@ length===i.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: short");let y=parseInt(f,10),g=m.from(l,"base64"),E=new TextEncoder,C=E.encode(s),W=await n.importKey( "raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Y=new Uint8Array(await n.sign("HMAC",W,m.concat( [g,m.from([0,0,0,1])]))),me=Y;for(var T=0;Tme[Z]^Y[Z]));let b=me,F=await n.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-2\ -56"}},!1,["sign"]),ae=new Uint8Array(await n.sign("HMAC",F,E.encode("Client Key"))),H=await n.digest( -"SHA-256",ae),we="n=*,r="+i.clientNonce,Ce="r="+c+",s="+l+",i="+y,ce="c=biws,r="+c,k=we+","+Ce+","+ce, +from(me.map((Te,Z)=>me[Z]^Y[Z]));let b=me,M=await n.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-2\ +56"}},!1,["sign"]),oe=new Uint8Array(await n.sign("HMAC",M,E.encode("Client Key"))),H=await n.digest( +"SHA-256",oe),we="n=*,r="+i.clientNonce,Ce="r="+c+",s="+l+",i="+y,ue="c=biws,r="+c,F=we+","+Ce+","+ue, J=await n.importKey("raw",H,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var ve=new Uint8Array(await n. -sign("HMAC",J,E.encode(k))),Ie=m.from(ae.map((Te,Z)=>ae[Z]^ve[Z])),ke=Ie.toString("base64");let Fe=await n. -importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Me=await n.sign("HMAC",Fe,E.encode( -"Server Key")),hr=await n.importKey("raw",Me,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Ue=m. -from(await n.sign("HMAC",hr,E.encode(k)));i.message="SASLResponse",i.serverSignature=Ue.toString("ba\ -se64"),i.response=ce+",p="+ke,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; -a(Ei,"NeonClient");var Lt=Ei;ze();var va=De(ir());function Nf(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(Nf,"promisify");var _i=class _i extends Sa.Pool{constructor(){ -super(...arguments);I(this,"Client",Lt);I(this,"hasFetchUnsupportedListeners",!1);I(this,"addListene\ +sign("HMAC",J,E.encode(F))),Ie=m.from(oe.map((Te,Z)=>oe[Z]^ve[Z])),Fe=Ie.toString("base64");let Me=await n. +importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),ke=await n.sign("HMAC",Me,E.encode( +"Server Key")),dr=await n.importKey("raw",ke,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Ue=m. +from(await n.sign("HMAC",dr,E.encode(F)));i.message="SASLResponse",i.serverSignature=Ue.toString("ba\ +se64"),i.response=ue+",p="+Fe,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; +a(Ai,"NeonClient");var Ft=Ai;ze();var Ea=De(sr());function Wf(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(Wf,"promisify");var Ci=class Ci extends va.Pool{constructor(){ +super(...arguments);I(this,"Client",Ft);I(this,"hasFetchUnsupportedListeners",!1);I(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=Nf(this.Promise,i);i=s.callback;try{let o=new va.default( +t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=Wf(this.Promise,i);i=s.callback;try{let o=new Ea.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??[];ho(l,{fullResults:!0,arrayMode:t. +/${c(o.database)}`,f=typeof t=="string"?t:t.text,y=n??t.values??[];po(l,{fullResults:!0,arrayMode:t. rowMode==="array"}).query(f,y,{types:t.types??this.options?.types}).then(E=>i(void 0,E)).catch(E=>i( -E))}catch(o){i(o)}return s.result}};a(_i,"NeonPool");var Ai=_i;ze();var kt=De(Rt()),i0="mjs";var export_DatabaseError=kt.DatabaseError;var export_defaults=kt.defaults;var export_escapeIdentifier=kt.escapeIdentifier; -var export_escapeLiteral=kt.escapeLiteral;var export_types=kt.types;export{Lt as Client,export_DatabaseError as DatabaseError, -ee as NeonDbError,je as NeonQueryPromise,Ai as Pool,yt as SqlTemplate,mt as UnsafeRawSql,i0 as _bundleExt, +E))}catch(o){i(o)}return s.result}};a(Ci,"NeonPool");var _i=Ci;ze();var Mt=De(Bt()),u0="mjs";var export_DatabaseError=Mt.DatabaseError;var export_defaults=Mt.defaults;var export_escapeIdentifier=Mt.escapeIdentifier; +var export_escapeLiteral=Mt.escapeLiteral;var export_types=Mt.types;export{Ft as Client,export_DatabaseError as DatabaseError, +pe as NeonDbError,je as NeonQueryPromise,_i as Pool,yt as SqlTemplate,mt as UnsafeRawSql,u0 as _bundleExt, export_defaults as defaults,export_escapeIdentifier as escapeIdentifier,export_escapeLiteral as escapeLiteral, -ho as neon,Se as neonConfig,export_types as types,Vt as warnIfBrowser}; +po as neon,Se as neonConfig,export_types as types,Kt as warnIfBrowser}; /*! Bundled license information: ieee754/index.js: diff --git a/src/httpQuery.ts b/src/httpQuery.ts index 31562bb..66e5dbb 100644 --- a/src/httpQuery.ts +++ b/src/httpQuery.ts @@ -100,12 +100,22 @@ const responseFormatContentTypes: Record = { 'cbor-seq': 'application/vnd.neon.sql.v1+cbor', }; +const ROW_MESSAGE = 0; +const COLUMNS_MESSAGE = 1; +const QUERY_MESSAGE = 2; + function dbError(error: any) { const result = new NeonDbError(error.message); for (const field of errorFields) result[field] = error[field] ?? undefined; return result; } +function unexpectedStreamingMessage(): never { + throw new NeonDbError( + 'Neon internal error: unexpected streamed response message', + ); +} + async function readStreamingResult( response: Response, responseFormat: Exclude, @@ -120,13 +130,20 @@ async function readStreamingResult( : (decodeMultiple(new Uint8Array(await response.arrayBuffer())) as any[]); const end = messages.at(-1); - if (end?.type !== 'end') { + if (!Array.isArray(end) || (end[0] !== 3 && end[0] !== 4)) { throw new NeonDbError( 'Neon internal error: streamed response ended without a terminal message', ); } - if (end.status === 'error') throw dbError(end.error); - if (end.status !== 'ok') { + if ( + end[0] === 4 && + end.length === 2 && + end[1] !== null && + typeof end[1] === 'object' + ) { + throw dbError(end[1]); + } + if (end[0] !== 3 || end.length !== 1) { throw new NeonDbError( 'Neon internal error: unexpected streamed response status', ); @@ -135,41 +152,37 @@ async function readStreamingResult( const results = []; let current: { fields: any[]; rows: any[] } | undefined; for (const message of messages.slice(0, -1)) { - switch (message.type) { - case 'columns': - if (current !== undefined || !Array.isArray(message.columns)) { - throw new NeonDbError( - 'Neon internal error: unexpected streamed response message', - ); + if (!Array.isArray(message)) { + unexpectedStreamingMessage(); + } + const [type, ...payload] = message; + switch (type) { + case COLUMNS_MESSAGE: + if (current !== undefined) { + unexpectedStreamingMessage(); } - current = { fields: message.columns, rows: [] }; + current = { fields: payload, rows: [] }; break; - case 'row': - if (current === undefined || !Array.isArray(message.row)) { - throw new NeonDbError( - 'Neon internal error: unexpected streamed response message', - ); + case ROW_MESSAGE: + if (current === undefined) { + unexpectedStreamingMessage(); } - current.rows.push(message.row); + current.rows.push(payload); break; - case 'query': - if (current === undefined || message.query === undefined) { - throw new NeonDbError( - 'Neon internal error: unexpected streamed response message', - ); + case QUERY_MESSAGE: + if (current === undefined || payload.length !== 2) { + unexpectedStreamingMessage(); } results.push({ fields: current.fields, rows: current.rows, - command: message.query.command, - rowCount: message.query.rowCount, + command: payload[0], + rowCount: payload[1], }); current = undefined; break; default: - throw new NeonDbError( - 'Neon internal error: unexpected streamed response message', - ); + unexpectedStreamingMessage(); } } diff --git a/tests/cli/httpStreaming.test.ts b/tests/cli/httpStreaming.test.ts index 120a27f..ee3db46 100644 --- a/tests/cli/httpStreaming.test.ts +++ b/tests/cli/httpStreaming.test.ts @@ -28,23 +28,18 @@ const labelFields = [ }, ]; -const successMessages = [ - { type: 'columns', columns: fields }, - { type: 'row', row: ['42'] }, - { type: 'query', query: { command: 'SELECT', rowCount: 1 } }, - { type: 'end', status: 'ok' }, -]; +const successMessages = [[1, ...fields], [0, '42'], [2, 'SELECT', 1], [3]]; const batchMessages = [ - { type: 'columns', columns: fields }, - { type: 'row', row: ['42'] }, - { type: 'row', row: ['43'] }, - { type: 'query', query: { command: 'SELECT', rowCount: 2 } }, - { type: 'columns', columns: labelFields }, - { type: 'row', row: ['hello'] }, - { type: 'row', row: ['world'] }, - { type: 'query', query: { command: 'SELECT', rowCount: 2 } }, - { type: 'end', status: 'ok' }, + [1, ...fields], + [0, '42'], + [0, '43'], + [2, 'SELECT', 2], + [1, ...labelFields], + [0, 'hello'], + [0, 'world'], + [2, 'SELECT', 2], + [3], ]; let previousFetchEndpoint: typeof neonConfig.fetchEndpoint; @@ -141,13 +136,7 @@ test('allows a streaming format per query', async () => { test('returns terminal streamed errors as database errors', async () => { mockResponse( - cborSequence([ - { - type: 'end', - status: 'error', - error: { message: 'division by zero', code: '22012' }, - }, - ]), + cborSequence([[4, { message: 'division by zero', code: '22012' }]]), 'application/vnd.neon.sql.v1+cbor', ); From 911714f350a8b5ad2c5212bfeff1751475e20029 Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Wed, 19 Aug 2026 07:54:49 +0100 Subject: [PATCH 4/7] Decode partial SQL streaming rows --- index.js | 890 ++++++++++++++++---------------- index.mjs | 886 +++++++++++++++---------------- src/httpQuery.ts | 60 ++- tests/cli/httpStreaming.test.ts | 73 +++ 4 files changed, 1023 insertions(+), 886 deletions(-) diff --git a/index.js b/index.js index 05b048d..0f645d8 100644 --- a/index.js +++ b/index.js @@ -1,32 +1,32 @@ -"use strict";var Ca=Object.create;var He=Object.defineProperty;var Ia=Object.getOwnPropertyDescriptor;var Ta=Object.getOwnPropertyNames;var Ra=Object.getPrototypeOf,Pa=Object.prototype.hasOwnProperty;var Ba=(r,e,t)=>e in r?He(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>He(r,"name",{value:e,configurable:!0});var te=(r,e)=>()=>(r&&(e=r(r=0)),e);var P=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fe=(r,e)=>{for(var t in e)He(r,t,{get:e[t], +"use strict";var Ca=Object.create;var $e=Object.defineProperty;var Ia=Object.getOwnPropertyDescriptor;var Ta=Object.getOwnPropertyNames;var Ra=Object.getPrototypeOf,Pa=Object.prototype.hasOwnProperty;var Ba=(r,e,t)=>e in r?$e(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>$e(r,"name",{value:e,configurable:!0});var te=(r,e)=>()=>(r&&(e=r(r=0)),e);var P=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fe=(r,e)=>{for(var t in e)$e(r,t,{get:e[t], enumerable:!0})},Ti=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ta(e))!Pa. -call(r,i)&&i!==t&&He(r,i,{get:()=>e[i],enumerable:!(n=Ia(e,i))||n.enumerable});return r};var Ne=(r,e,t)=>(t=r!=null?Ca(Ra(r)):{},Ti(e||!r||!r.__esModule?He(t,"default",{value:r,enumerable:!0}): -t,r)),j=r=>Ti(He({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Ba(r,typeof e!="symbol"?e+"":e,t);var Bi=P(Ut=>{"use strict";p();Ut.byteLength=Fa;Ut.toByteArray=ka;Ut.fromByteArray=Oa;var xe=[],he=[], +call(r,i)&&i!==t&&$e(r,i,{get:()=>e[i],enumerable:!(n=Ia(e,i))||n.enumerable});return r};var qe=(r,e,t)=>(t=r!=null?Ca(Ra(r)):{},Ti(e||!r||!r.__esModule?$e(t,"default",{value:r,enumerable:!0}): +t,r)),j=r=>Ti($e({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Ba(r,typeof e!="symbol"?e+"":e,t);var Bi=P(Ut=>{"use strict";p();Ut.byteLength=Fa;Ut.toByteArray=ka;Ut.fromByteArray=Oa;var xe=[],he=[], La=typeof Uint8Array<"u"?Uint8Array:Array,gr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ -23456789+/";for(qe=0,Ri=gr.length;qe0)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(Pi,"getLens"); function Fa(r){var e=Pi(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Fa,"byteLength");function Ma(r,e,t){return(e+ t)*3/4-t}a(Ma,"_byteLength");function ka(r){var e,t=Pi(r),n=t[0],i=t[1],s=new La(Ma(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=he[r.charCodeAt( -c)]<<2|he[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=he[r.charCodeAt(c)]<<10|he[r.charCodeAt(c+1)]<< -4|he[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(ka,"toByteArray");function Ua(r){return xe[r>> +0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=he[r.charCodeAt( +l)]<<2|he[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=he[r.charCodeAt(l)]<<10|he[r.charCodeAt(l+1)]<< +4|he[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(ka,"toByteArray");function Ua(r){return xe[r>> 18&63]+xe[r>>12&63]+xe[r>>6&63]+xe[r&63]}a(Ua,"tripletToBase64");function Da(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(Ua(n));return i.join("")}a(Da,"en\ codeChunk");function Oa(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(xe[e>>2]+xe[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1], -i.push(xe[e>>10]+xe[e>>4&63]+xe[e<<2&63]+"=")),i.join("")}a(Oa,"fromByteArray")});var Li=P(br=>{p();br.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(xe[e>>10]+xe[e>>4&63]+xe[e<<2&63]+"=")),i.join("")}a(Oa,"fromByteArray")});var Li=P(br=>{p();br.read=function(r,e,t,n,i){var s,o,u=i*8-n-1,l=(1<>1,f=-7,y=t?i-1:0,g=t? -1:1,E=r[e+y];for(y+=g,s=E&(1<<-f)-1,E>>=-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:(E?-1:1)*(1/0);o=o+Math. -pow(2,n),s=s-l}return(E?-1:1)*o*Math.pow(2,s-n)};br.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,E=n?0:s-1,C=n?1:-1,H=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+E]=u&255,E+= -C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=H*128}});var zi=P(Ke=>{"use strict";p();var xr=Bi(),Ge=Li(),Fi=typeof Symbol=="function"&&typeof Symbol.for== -"function"?Symbol.for("nodejs.util.inspect.custom"):null;Ke.Buffer=d;Ke.SlowBuffer=Ha;Ke.INSPECT_MAX_BYTES= -50;var Dt=2147483647;Ke.kMaxLength=Dt;d.TYPED_ARRAY_SUPPORT=Na();!d.TYPED_ARRAY_SUPPORT&&typeof console< +-f,f+=n;f>0;o=o*256+r[e+y],y+=g,f-=8);if(s===0)s=1-c;else{if(s===l)return o?NaN:(E?-1:1)*(1/0);o=o+Math. +pow(2,n),s=s-c}return(E?-1:1)*o*Math.pow(2,s-n)};br.write=function(r,e,t,n,i,s){var o,u,l,c=s*8-i-1, +f=(1<>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:s-1,C=n?1:-1,H=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*(l= +Math.pow(2,-o))<1&&(o--,l*=2),o+y>=1?e+=g/l:e+=g*Math.pow(2,1-y),e*l>=2&&(o++,l/=2),o+y>=f?(u=0,o=f): +o+y>=1?(u=(e*l-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+E]=u&255,E+= +C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,c-=8);r[t+E-C]|=H*128}});var zi=P(ze=>{"use strict";p();var xr=Bi(),Ve=Li(),Fi=typeof Symbol=="function"&&typeof Symbol.for== +"function"?Symbol.for("nodejs.util.inspect.custom"):null;ze.Buffer=d;ze.SlowBuffer=Ha;ze.INSPECT_MAX_BYTES= +50;var Dt=2147483647;ze.kMaxLength=Dt;d.TYPED_ARRAY_SUPPORT=Na();!d.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 Na(){ try{let r=new Uint8Array(1),e={foo:a(function(){return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array. @@ -89,25 +89,25 @@ let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length) tf8":case"utf-8":return Qi(this,e,t);case"ascii":return Xa(this,e,t);case"latin1":case"binary":return eu( this,e,t);case"base64":return Ja(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ru( this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a($a, -"slowToString");d.prototype._isBuffer=!0;function Qe(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(Qe,"swap"); +"slowToString");d.prototype._isBuffer=!0;function je(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(je,"swap"); d.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");Fi&&(d.prototype[Fi]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ if(Se(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.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;y>>=0,n>>>=0,i>>>=0,s>>>=0,this===e)return 0;let o=s-i,u=n-t,l=Math.min(o,u),c=this.slice( +i,s),f=e.slice(t,n);for(let y=0;y2147483647? t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Ir(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=d.from( @@ -116,10 +116,10 @@ prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Ar call(r,e,t):Mi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(qi,"bidire\ ctionalIndexOf");function Mi(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;yo&&(t=o-u),c=t;c>=0;c--){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= @@ -138,10 +138,10 @@ if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}}," toJSON=a(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSO\ N");function Ja(r,e,t){return e===0&&t===r.length?xr.fromByteArray(r):xr.fromByteArray(r.slice(e,t))} a(Ja,"base64Slice");function Qi(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&& +u=s>239?4:s>223?3:s>191?2:1;if(i+u<=t){let l,c,f,y;switch(u){case 1:s<128&&(o=s);break;case 2:l=r[i+ +1],(l&192)===128&&(y=(s&31)<<6|l&63,y>127&&(o=y));break;case 3:l=r[i+1],c=r[i+2],(l&192)===128&&(c&192)=== +128&&(y=(s&15)<<12|(l&63)<<6|c&63,y>2047&&(y<55296||y>57343)&&(o=y));break;case 4:l=r[i+1],c=r[i+2], +f=r[i+3],(l&192)===128&&(c&192)===128&&(f&192)===128&&(y=(s&15)<<18|(l&63)<<12|(c&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 Za(n)}a(Qi,"utf8Slice");var ki=4096;function Za(r){let e=r.length;if(e<=ki)return String. fromCharCode.apply(String,r);let t="",n=0;for(;n>>0,t||G(e,2,this.length),this[e]<<8|this[e+1]},"read readUint32LE=d.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),(this[e]| this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");d.prototype.readUint32BE=d.prototype. readUInt32BE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+ -2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Pe(a(function(e){e=e>>>0,Ve(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ht(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* +2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Pe(a(function(e){e=e>>>0,Ke(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&dt(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* 2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<< -BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Pe(a(function(e){e=e>>>0,Ve(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ht(e,this.length-8);let i=t*2**24+this[++e]*2**16+ +BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Pe(a(function(e){e=e>>>0,Ke(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&dt(e,this.length-8);let i=t*2**24+this[++e]*2**16+ this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<>>0,t=t>>>0,n||G(e,t, this.length);let i=this[e],s=1,o=0;for(;++o=s&&(i-=Math. @@ -182,16 +182,16 @@ a(function(e,t){e=e>>>0,t||G(e,2,this.length);let n=this[e+1]|this[e]<<8;return n},"readInt16BE");d.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]| this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");d.prototype.readInt32BE=a(function(e,t){return e= e>>>0,t||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");d.prototype. -readBigInt64LE=Pe(a(function(e){e=e>>>0,Ve(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& -ht(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,Ke(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& +dt(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,Ve(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ht(e,this. +Pe(a(function(e){e=e>>>0,Ke(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&dt(e,this. length-8);let i=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,t||G(e,4,this.length),Ge.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= -a(function(e,t){return e=e>>>0,t||G(e,4,this.length),Ge.read(this,e,!1,23,4)},"readFloatBE");d.prototype. -readDoubleLE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ge.read(this,e,!0,52,8)},"readDoub\ -leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ge.read(this,e, +return e=e>>>0,t||G(e,4,this.length),Ve.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= +a(function(e,t){return e=e>>>0,t||G(e,4,this.length),Ve.read(this,e,!1,23,4)},"readFloatBE");d.prototype. +readDoubleLE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ve.read(this,e,!0,52,8)},"readDoub\ +leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ve.read(this,e, !1,52,8)},"readDoubleBE");function re(r,e,t,n,i,s){if(!d.isBuffer(r))throw new TypeError('"buffer" a\ rgument must be a Buffer instance');if(e>i||er.length)throw new RangeError("Index out of range")}a(re,"checkInt");d.prototype.writeUintLE= @@ -216,9 +216,9 @@ 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(Wi,"wrtBigUI writeBigUInt64LE=Pe(a(function(e,t=0){return ji(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Pe(a(function(e,t=0){return Wi(this,e,t,BigInt(0),BigInt( "0xffffffffffffffff"))},"writeBigUInt64BE"));d.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>> -0,!i){let c=Math.pow(2,8*n-1);re(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");d.prototype.writeIntBE= -a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*n-1);re(this,e,t,n,c-1,-c)}let s=n-1,o=1, +a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let l=Math.pow(2,8*n-1);re(this,e,t,n,l-1,-l)}let s=n-1,o=1, u=0;for(this[t+s]=e&255;--s>=0&&(o*=256);)e<0&&u===0&&this[t+s+1]!==0&&(u=1),this[t+s]=(e/o>>0)-u&255; return t+n},"writeIntBE");d.prototype.writeInt8=a(function(e,t,n){return e=+e,t=t>>>0,n||re(this,e,t, 1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");d.prototype.writeInt16LE=a(function(e,t,n){ @@ -233,10 +233,10 @@ this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigI writeBigInt64BE=Pe(a(function(e,t=0){return Wi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ ffffffffffff"))},"writeBigInt64BE"));function Hi(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(Hi,"checkIEEE754");function $i(r,e,t,n,i){ -return e=+e,t=t>>>0,i||Hi(r,e,t,4,34028234663852886e22,-34028234663852886e22),Ge.write(r,e,t,n,23,4), +return e=+e,t=t>>>0,i||Hi(r,e,t,4,34028234663852886e22,-34028234663852886e22),Ve.write(r,e,t,n,23,4), t+4}a($i,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return $i(this,e,t,!0,n)},"writeFl\ oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return $i(this,e,t,!1,n)},"writeFloatBE");function Gi(r,e,t,n,i){ -return e=+e,t=t>>>0,i||Hi(r,e,t,8,17976931348623157e292,-17976931348623157e292),Ge.write(r,e,t,n,52, +return e=+e,t=t>>>0,i||Hi(r,e,t,8,17976931348623157e292,-17976931348623157e292),Ve.write(r,e,t,n,52, 8),t+8}a(Gi,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return Gi(this,e,t,!0,n)},"wr\ iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return Gi(this,e,t,!1,n)},"writeDoubleBE"); d.prototype.copy=a(function(e,t,n,i){if(!d.isBuffer(e))throw new TypeError("argument should be a Buf\ @@ -253,7 +253,7 @@ o)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||t n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>> 0,e||(e=0);let s;if(typeof e=="number")for(s=t;s2**32?i=Ui(String(t)):type t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Ui(i)),i+="n"),n+=` It must be ${e}. Re\ ceived ${i}`,n},RangeError);function Ui(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(Ui,"addNumericalSeparator");function nu(r,e,t){ -Ve(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&ht(e,r.length-(t+1))}a(nu,"checkBounds");function Vi(r,e,t,n,i,s){ +Ke(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&dt(e,r.length-(t+1))}a(nu,"checkBounds");function Vi(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 $e.ERR_OUT_OF_RANGE("value",u,r)}nu(n,i,s)}a(Vi,"checkIntBI");function Ve(r,e){if(typeof r!= -"number")throw new $e.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Ve,"validateNumber");function ht(r,e,t){throw Math. -floor(r)!==r?(Ve(r,t),new $e.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new $e.ERR_BUFFER_OUT_OF_BOUNDS: -new $e.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(ht,"boundsError");var iu=/[^+/0-9A-Za-z-_]/g; +nd <= ${t}${o}`,new Ge.ERR_OUT_OF_RANGE("value",u,r)}nu(n,i,s)}a(Vi,"checkIntBI");function Ke(r,e){if(typeof r!= +"number")throw new Ge.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Ke,"validateNumber");function dt(r,e,t){throw Math. +floor(r)!==r?(Ke(r,t),new Ge.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new Ge.ERR_BUFFER_OUT_OF_BOUNDS: +new Ge.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(dt,"boundsError");var iu=/[^+/0-9A-Za-z-_]/g; function su(r){if(r=r.split("=")[0],r=r.trim().replace(iu,""),r.length<2)return"";for(;r.length%4!== 0;)r=r+"=";return r}a(su,"base64clean");function Er(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+ @@ -288,15 +288,15 @@ e[i+t]=r[i];return i}a(Ot,"blitBuffer");function Se(r,e){return r instanceof e|| null&&r.constructor.name!=null&&r.constructor.name===e.name}a(Se,"isInstance");function Ir(r){return r!== r}a(Ir,"numberIsNaN");var uu=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 Pe(r){return typeof BigInt>"u"? -cu:r}a(Pe,"defineBigIntMethod");function cu(){throw new Error("BigInt not supported")}a(cu,"BufferBi\ +lu:r}a(Pe,"defineBigIntMethod");function lu(){throw new Error("BigInt not supported")}a(lu,"BufferBi\ gIntNotDefined")});var S,v,A,m,w,p=te(()=>{"use strict";S=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),A= globalThis.clearImmediate??(r=>clearTimeout(r)),m=typeof globalThis.Buffer=="function"&&typeof globalThis. Buffer.allocUnsafe=="function"?globalThis.Buffer:zi().Buffer,w=globalThis.process??{};w.env??(w.env= -{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Be=P((rh,Tr)=>{"use strict";p();var ze=typeof Reflect=="object"?Reflect:null,Yi=ze&&typeof ze.apply== -"function"?ze.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Nt; -ze&&typeof ze.ownKeys=="function"?Nt=ze.ownKeys:Object.getOwnPropertySymbols?Nt=a(function(e){return Object. +{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Be=P((rh,Tr)=>{"use strict";p();var Ye=typeof Reflect=="object"?Reflect:null,Yi=Ye&&typeof Ye.apply== +"function"?Ye.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Nt; +Ye&&typeof Ye.ownKeys=="function"?Nt=Ye.ownKeys:Object.getOwnPropertySymbols?Nt=a(function(e){return Object. getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Nt=a(function(e){return Object. -getOwnPropertyNames(e)},"ReflectOwnKeys");function lu(r){console&&console.warn&&console.warn(r)}a(lu, +getOwnPropertyNames(e)},"ReflectOwnKeys");function cu(r){console&&console.warn&&console.warn(r)}a(cu, "ProcessEmitWarning");var Zi=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function k(){k. init.call(this)}a(k,"EventEmitter");Tr.exports=k;Tr.exports.once=pu;k.EventEmitter=k;k.prototype._events= void 0;k.prototype._eventsCount=0;k.prototype._maxListeners=void 0;var Ji=10;function qt(r){if(typeof r!= @@ -313,14 +313,14 @@ a(Xi,"_getMaxListeners");k.prototype.getMaxListeners=a(function(){return Xi(this k.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")Yi(c,this,t);else for(var l=c. -length,f=is(c,l),n=0;n0&&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,lu(u)}return r}a(es,"_addListener");k.prototype.addListener=a(function(e,t){ +r,u.type=e,u.count=o.length,cu(u)}return r}a(es,"_addListener");k.prototype.addListener=a(function(e,t){ return es(this,e,t,!1)},"addListener");k.prototype.on=k.prototype.addListener;k.prototype.prependListener= a(function(e,t){return es(this,e,t,!0)},"prependListener");function fu(){if(!this.fired)return this. target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this. @@ -357,8 +357,8 @@ yu(r,i,{once:!0})})}a(pu,"once");function yu(r,e,t){typeof r.on=="function"&&ss( "addErrorHandlerIfEventEmitter");function ss(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t): r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,a(function i(s){n.once&& r.removeEventListener(e,i),t(s)},"wrapListener"));else throw new TypeError('The "emitter" argument m\ -ust be of type EventEmitter. Received type '+typeof r)}a(ss,"eventTargetAgnosticAddListener")});var us={};fe(us,{Socket:()=>be,isIP:()=>mu});function mu(r){return 0}var as,os,_,be,Ye=te(()=>{"use \ -strict";p();as=Ne(Be(),1);a(mu,"isIP");os=/^[^.]+\./,_=class _ extends as.EventEmitter{constructor(){ +ust be of type EventEmitter. Received type '+typeof r)}a(ss,"eventTargetAgnosticAddListener")});var us={};fe(us,{Socket:()=>be,isIP:()=>mu});function mu(r){return 0}var as,os,_,be,Je=te(()=>{"use \ +strict";p();as=qe(Be(),1);a(mu,"isIP");os=/^[^.]+\./,_=class _ extends as.EventEmitter{constructor(){ super(...arguments);I(this,"opts",{});I(this,"connecting",!1);I(this,"pending",!0);I(this,"writable", !0);I(this,"encrypted",!1);I(this,"authorized",!1);I(this,"destroyed",!1);I(this,"ws",null);I(this,"\ writeBuffer");I(this,"tlsState",0);I(this,"tlsRead");I(this,"tlsWrite")}static get poolQueryViaFetch(){ @@ -397,24 +397,24 @@ om/neondatabase/serverless/blob/main/CONFIG.md#wsproxy-string--host-string-port- ng");return typeof i=="function"?i(t,n):`${i}?address=${t}:${n}`}setNoDelay(){return this}setKeepAlive(){ return this}ref(){return this}unref(){return this}connect(t,n,i){this.connecting=!0,i&&this.once("co\ nnect",i);let s=a(()=>{this.connecting=!1,this.pending=!1,this.emit("connect"),this.emit("ready")},"\ -handleWebSocketOpen"),o=a((c,l=!1)=>{c.binaryType="arraybuffer",c.addEventListener("error",f=>{this. -emit("error",f),this.emit("close")}),c.addEventListener("message",f=>{if(this.tlsState===0){let y=m. -from(f.data);this.emit("data",y)}}),c.addEventListener("close",()=>{this.emit("close")}),l?s():c.addEventListener( +handleWebSocketOpen"),o=a((l,c=!1)=>{l.binaryType="arraybuffer",l.addEventListener("error",f=>{this. +emit("error",f),this.emit("close")}),l.addEventListener("message",f=>{if(this.tlsState===0){let y=m. +from(f.data);this.emit("data",y)}}),l.addEventListener("close",()=>{this.emit("close")}),c?s():l.addEventListener( "open",s)},"configureWebSocket"),u;try{u=this.wsProxyAddrForHost(n,typeof t=="string"?parseInt(t,10): -t)}catch(c){this.emit("error",c),this.emit("close");return}try{let l=(this.useSecureWebSocket?"wss:": -"ws:")+"//"+u;if(this.webSocketConstructor!==void 0)this.ws=new this.webSocketConstructor(l),o(this. -ws);else try{this.ws=new WebSocket(l),o(this.ws)}catch{this.ws=new __unstable_WebSocket(l),o(this.ws)}}catch(c){ +t)}catch(l){this.emit("error",l),this.emit("close");return}try{let c=(this.useSecureWebSocket?"wss:": +"ws:")+"//"+u;if(this.webSocketConstructor!==void 0)this.ws=new this.webSocketConstructor(c),o(this. +ws);else try{this.ws=new WebSocket(c),o(this.ws)}catch{this.ws=new __unstable_WebSocket(c),o(this.ws)}}catch(l){ let f=(this.useSecureWebSocket?"https:":"http:")+"//"+u;fetch(f,{headers:{Upgrade:"websocket"}}).then( -y=>{if(this.ws=y.webSocket,this.ws==null)throw c;this.ws.accept(),o(this.ws,!0)}).catch(y=>{this.emit( +y=>{if(this.ws=y.webSocket,this.ws==null)throw l;this.ws.accept(),o(this.ws,!0)}).catch(y=>{this.emit( "error",new Error(`All attempts to open a WebSocket to connect to the database failed. Please refer \ to https://github.com/neondatabase/serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websoc\ ket--undefined. Details: ${y}`)),this.emit("close")})}}async startTls(t){if(this.subtls===void 0)throw new Error( "For Postgres SSL connections, you must set `neonConfig.subtls` to the subtls library. See https://g\ ithub.com/neondatabase/serverless/blob/main/CONFIG.md for more information.");this.tlsState=1;let n=await this. subtls.TrustedCert.databaseFromPEM(this.rootCerts),i=new this.subtls.WebSocketReadQueue(this.ws),s=i. -read.bind(i),o=this.rawWrite.bind(this),{read:u,write:c}=await this.subtls.startTls(t,n,s,o,{useSNI:!this. +read.bind(i),o=this.rawWrite.bind(this),{read:u,write:l}=await this.subtls.startTls(t,n,s,o,{useSNI:!this. disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead=u,this.tlsWrite= -c,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){ +l,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){ for(;;){let t=await this.tlsRead();if(t===void 0)break;{let n=m.from(t);this.emit("data",n)}}}rawWrite(t){ if(!this.coalesceWrites){this.ws&&this.ws.send(t);return}if(this.writeBuffer===void 0)this.writeBuffer= t,setTimeout(()=>{this.ws&&this.ws.send(this.writeBuffer),this.writeBuffer=void 0},0);else{let n=new Uint8Array( @@ -427,11 +427,11 @@ poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{let s;return i?.jwtAuth?s=t.repla t.replace(os,"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}),I(_,"opts",{});be=_});var cs={};fe(cs,{parse:()=>Rr});function Rr(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 E=i+":"+s,C=e?Object. -fromEntries(y.entries()):f;return{href:r,protocol:t,auth:E,username:i,password:s,host:o,hostname:u,port:c, -pathname:l,search:f,query:C,hash:g}}var Pr=te(()=>{"use strict";p();a(Rr,"parse")});var Gr=P(Ts=>{"use strict";p();Ts.parse=function(r,e){return new $r(r,e).parse()};var zt=class zt{constructor(e,t){ +disableWarningInBrowsers:!1}),I(_,"opts",{});be=_});var ls={};fe(ls,{parse:()=>Rr});function Rr(r,e=!1){let{protocol:t}=new URL(r),n="http:"+r.substring( +t.length),{username:i,password:s,host:o,hostname:u,port:l,pathname:c,search:f,searchParams:y,hash:g}=new URL( +n);s=decodeURIComponent(s),i=decodeURIComponent(i),c=decodeURIComponent(c);let E=i+":"+s,C=e?Object. +fromEntries(y.entries()):f;return{href:r,protocol:t,auth:E,username:i,password:s,host:o,hostname:u,port:l, +pathname:c,search:f,query:C,hash:g}}var Pr=te(()=>{"use strict";p();a(Rr,"parse")});var Gr=P(Ts=>{"use strict";p();Ts.parse=function(r,e){return new $r(r,e).parse()};var zt=class zt{constructor(e,t){ this.source=e,this.transform=t||ju,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( @@ -449,104 +449,104 @@ parse(r,e)},"parse")}},"create")}});var Ls=P((Ph,Bs)=>{"use strict";p();var Hu=/ $u=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Gu=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Vu=/^-?infinity$/;Bs. exports=a(function(e){if(Vu.test(e))return Number(e.replace("i","I"));var t=Hu.exec(e);if(!t)return Ku( e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Ps(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=zu(e);return g!=null? -(y=new Date(Date.UTC(i,s,o,u,c,l,f)),Kr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= -new Date(i,s,o,u,c,l,f),Kr(i)&&y.setFullYear(i)),y},"parseDate");function Ku(r){var e=$u.exec(r);if(e){ +10),l=parseInt(t[5],10),c=parseInt(t[6],10),f=t[7];f=f?1e3*parseFloat(f):0;var y,g=zu(e);return g!=null? +(y=new Date(Date.UTC(i,s,o,u,l,c,f)),Kr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= +new Date(i,s,o,u,l,c,f),Kr(i)&&y.setFullYear(i)),y},"parseDate");function Ku(r){var e=$u.exec(r);if(e){ var t=parseInt(e[1],10),n=!!e[4];n&&(t=Ps(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return Kr( t)&&o.setFullYear(t),o}}a(Ku,"getDate");function zu(r){if(r.endsWith("+00"))return 0;var e=Gu.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(zu,"timeZoneOffset");function Ps(r){return-(r- 1)}a(Ps,"bcYearToNegativeYear");function Kr(r){return r>=0&&r<100}a(Kr,"is0To99")});var Ms=P((Fh,Fs)=>{p();Fs.exports=Ju;var Yu=Object.prototype.hasOwnProperty;function Ju(r){for(var e=1;e< arguments.length;e++){var t=arguments[e];for(var n in t)Yu.call(t,n)&&(r[n]=t[n])}return r}a(Ju,"ext\ -end")});var Ds=P((Uh,Us)=>{"use strict";p();var Zu=Ms();Us.exports=nt;function nt(r){if(!(this instanceof nt)) -return new nt(r);Zu(this,lc(r))}a(nt,"PostgresInterval");var Xu=["seconds","minutes","hours","days", -"months","years"];nt.prototype.toPostgres=function(){var r=Xu.filter(this.hasOwnProperty,this);return this. +end")});var Ds=P((Uh,Us)=>{"use strict";p();var Zu=Ms();Us.exports=it;function it(r){if(!(this instanceof it)) +return new it(r);Zu(this,cl(r))}a(it,"PostgresInterval");var Xu=["seconds","minutes","hours","days", +"months","years"];it.prototype.toPostgres=function(){var r=Xu.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 ec={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ -S"},tc=["years","months","days"],rc=["hours","minutes","seconds"];nt.prototype.toISOString=nt.prototype. -toISO=function(){var r=tc.map(t,this).join(""),e=rc.map(t,this).join("");return"P"+r+"T"+e;function t(n){ +"")),t+" "+e},this).join(" ")};var el={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ +S"},tl=["years","months","days"],rl=["hours","minutes","seconds"];it.prototype.toISOString=it.prototype. +toISO=function(){var r=tl.map(t,this).join(""),e=rl.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+ec[n]}};var zr="([+-]?\\d+)",nc=zr+"\\s+years?",ic=zr+"\\s+mons?",sc=zr+"\\s+days?",oc="\ -([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",ac=new RegExp([nc,ic,sc,oc].map(function(r){return"\ +/0+$/,"")),i+el[n]}};var zr="([+-]?\\d+)",nl=zr+"\\s+years?",il=zr+"\\s+mons?",sl=zr+"\\s+days?",ol="\ +([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",al=new RegExp([nl,il,sl,ol].map(function(r){return"\ ("+r+")?"}).join("\\s*")),ks={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, -uc=["hours","minutes","seconds","milliseconds"];function cc(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}a(cc,"parseMilliseconds");function lc(r){if(!r)return{};var e=ac.exec(r),t=e[8]==="-";return Object. -keys(ks).reduce(function(n,i){var s=ks[i],o=e[s];return!o||(o=i==="milliseconds"?cc(o):parseInt(o,10), -!o)||(t&&~uc.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(lc,"parse")});var Ns=P((Nh,Os)=>{"use strict";p();Os.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( +ul=["hours","minutes","seconds","milliseconds"];function ll(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(ll,"parseMilliseconds");function cl(r){if(!r)return{};var e=al.exec(r),t=e[8]==="-";return Object. +keys(ks).reduce(function(n,i){var s=ks[i],o=e[s];return!o||(o=i==="milliseconds"?ll(o):parseInt(o,10), +!o)||(t&&~ul.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(cl,"parse")});var Ns=P((Nh,Os)=>{"use strict";p();Os.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( 2),"hex");for(var t="",n=0;n{p();var xt=Gr(),St=Vr(),Yt=Ls(),Qs=Ds(),js=Ns();function Jt(r){return a(function(t){ +parseBytea")});var Gs=P((jh,$s)=>{p();var St=Gr(),vt=Vr(),Yt=Ls(),Qs=Ds(),js=Ns();function Jt(r){return a(function(t){ return t===null?t:r(t)},"nullAllowed")}a(Jt,"allowNull");function Ws(r){return r===null?r:r==="TRUE"|| -r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(Ws,"parseBool");function fc(r){return r? -xt.parse(r,Ws):null}a(fc,"parseBoolArray");function hc(r){return parseInt(r,10)}a(hc,"parseBaseTenIn\ -t");function Yr(r){return r?xt.parse(r,Jt(hc)):null}a(Yr,"parseIntegerArray");function dc(r){return r? -xt.parse(r,Jt(function(e){return Hs(e).trim()})):null}a(dc,"parseBigIntegerArray");var pc=a(function(r){ -if(!r)return null;var e=St.create(r,function(t){return t!==null&&(t=en(t)),t});return e.parse()},"pa\ -rsePointArray"),Jr=a(function(r){if(!r)return null;var e=St.create(r,function(t){return t!==null&&(t= -parseFloat(t)),t});return e.parse()},"parseFloatArray"),ye=a(function(r){if(!r)return null;var e=St. -create(r);return e.parse()},"parseStringArray"),Zr=a(function(r){if(!r)return null;var e=St.create(r, -function(t){return t!==null&&(t=Yt(t)),t});return e.parse()},"parseDateArray"),yc=a(function(r){if(!r) -return null;var e=St.create(r,function(t){return t!==null&&(t=Qs(t)),t});return e.parse()},"parseInt\ -ervalArray"),mc=a(function(r){return r?xt.parse(r,Jt(js)):null},"parseByteAArray"),Xr=a(function(r){ +r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(Ws,"parseBool");function fl(r){return r? +St.parse(r,Ws):null}a(fl,"parseBoolArray");function hl(r){return parseInt(r,10)}a(hl,"parseBaseTenIn\ +t");function Yr(r){return r?St.parse(r,Jt(hl)):null}a(Yr,"parseIntegerArray");function dl(r){return r? +St.parse(r,Jt(function(e){return Hs(e).trim()})):null}a(dl,"parseBigIntegerArray");var pl=a(function(r){ +if(!r)return null;var e=vt.create(r,function(t){return t!==null&&(t=en(t)),t});return e.parse()},"pa\ +rsePointArray"),Jr=a(function(r){if(!r)return null;var e=vt.create(r,function(t){return t!==null&&(t= +parseFloat(t)),t});return e.parse()},"parseFloatArray"),ye=a(function(r){if(!r)return null;var e=vt. +create(r);return e.parse()},"parseStringArray"),Zr=a(function(r){if(!r)return null;var e=vt.create(r, +function(t){return t!==null&&(t=Yt(t)),t});return e.parse()},"parseDateArray"),yl=a(function(r){if(!r) +return null;var e=vt.create(r,function(t){return t!==null&&(t=Qs(t)),t});return e.parse()},"parseInt\ +ervalArray"),ml=a(function(r){return r?St.parse(r,Jt(js)):null},"parseByteAArray"),Xr=a(function(r){ return parseInt(r,10)},"parseInteger"),Hs=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ -parseBigInteger"),qs=a(function(r){return r?xt.parse(r,Jt(JSON.parse)):null},"parseJsonArray"),en=a( +parseBigInteger"),qs=a(function(r){return r?St.parse(r,Jt(JSON.parse)):null},"parseJsonArray"),en=a( function(r){return r[0]!=="("?null:(r=r.substring(1,r.length-1).split(","),{x:parseFloat(r[0]),y:parseFloat( -r[1])})},"parsePoint"),wc=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, +r[1])})},"parsePoint"),wl=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, i=2;i{"use strict";p();var ie=1e6;function bc(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%ie,e=e/ie>>>0,o=4294967296* -s+t,t=o/ie>>>0,u=""+(o-ie*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/ie>>>0,u=""+(o-ie*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/ie>>>0,u=""+(o- -ie*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var xc=Ks(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,H){return E* -Math.pow(2,H)+C};var s=t>>3,o=a(function(E){return n?~E&255:E},"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"),Js=a(function(r,e,t){var n=Math. -pow(2,t-1)-1,i=U(r,1),s=U(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=U(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"),Sc=a(function(r){ +$s.exports={init:gl}});var Ks=P(($h,Vs)=>{"use strict";p();var ie=1e6;function bl(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,l,c,f;{if(s=e%ie,e=e/ie>>>0,o=4294967296* +s+t,t=o/ie>>>0,u=""+(o-ie*t),t===0&&e===0)return n+u+i;for(l="",c=6-u.length,f=0;f>>0,o=4294967296*s+t,t=o/ie>>>0,u=""+(o-ie*t),t===0&&e===0)return n+u+i;for(l= +"",c=6-u.length,f=0;f>>0,o=4294967296*s+t,t=o/ie>>>0,u=""+(o- +ie*t),t===0&&e===0)return n+u+i;for(l="",c=6-u.length,f=0;f{p();var xl=Ks(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,H){return E* +Math.pow(2,H)+C};var s=t>>3,o=a(function(E){return n?~E&255:E},"inv"),u=255,l=8-t%8;e>t%8);var c=0;t%8+e>=8&&(c=i(0,o(r[s])&u,l));for(var f=e+t>>3,y=s+1;y0&&(c=i(c,o(r[f])>>8-g,g)),c},"parseBits"),Js=a(function(r,e,t){var n=Math. +pow(2,t-1)-1,i=U(r,1),s=U(r,t,1);if(s===0)return 0;var o=1,u=a(function(c,f,y){c===0&&(c=1);for(var g=1;g<= +y;g++)o/=2,(f&1<0&&(c+=o);return c},"parsePrecisionBits"),l=U(r,e,t+1,!1,u);return s==Math.pow( +2,t+1)-1?l===0?i===0?1/0:-1/0:NaN:(i===0?1:-1)*Math.pow(2,s-n)*l},"parseFloatFromBits"),Sl=a(function(r){ return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),zs=a(function(r){return U(r,1)==1?-1*(U( -r,31,1,!0)+1):U(r,31,1)},"parseInt32"),vc=a(function(r){return Js(r,23,8)},"parseFloat32"),Ec=a(function(r){ -return Js(r,52,11)},"parseFloat64"),Ac=a(function(r){var e=U(r,16,32);if(e==49152)return NaN;for(var t=Math. +r,31,1,!0)+1):U(r,31,1)},"parseInt32"),vl=a(function(r){return Js(r,23,8)},"parseFloat32"),El=a(function(r){ +return Js(r,52,11)},"parseFloat64"),Al=a(function(r){var e=U(r,16,32);if(e==49152)return NaN;for(var t=Math. pow(1e4,U(r,16,16)),n=0,i=[],s=U(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 E=l.shift();for(g= -0;g0},"parseBool"),Ic=a(function(r){r(20,xc),r(21,Sc),r(23,zs),r(26,zs),r(1700,Ac),r(700,vc), -r(701,Ec),r(16,Cc),r(1114,Ys.bind(null,!1)),r(1184,Ys.bind(null,!0)),r(1e3,vt),r(1007,vt),r(1016,vt), -r(1008,vt),r(1009,vt),r(25,_c)},"init");Zs.exports={init:Ic}});var to=P((Jh,eo)=>{p();eo.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25, +usec=s},i.getUTCMicroSeconds=function(){return this.usec},i},"parseDate"),Et=a(function(r){for(var e=U( +r,32),t=U(r,32,32),n=U(r,32,64),i=96,s=[],o=0;o>3,(i+=f<<3)>>3),y;console.log("ERROR: ElementType no\ +t implemented: "+c)},"parseElement"),l=a(function(c,f){var y=[],g;if(c.length>1){var E=c.shift();for(g= +0;g0},"parseBool"),Il=a(function(r){r(20,xl),r(21,Sl),r(23,zs),r(26,zs),r(1700,Al),r(700,vl), +r(701,El),r(16,Cl),r(1114,Ys.bind(null,!1)),r(1184,Ys.bind(null,!0)),r(1e3,Et),r(1007,Et),r(1016,Et), +r(1008,Et),r(1009,Et),r(25,_l)},"init");Zs.exports={init:Il}});var to=P((Jh,eo)=>{p();eo.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 _t=P(At=>{p();var Tc=Gs(),Rc=Xs(),Pc=Vr(),Bc=to();At.getTypeParser=Lc;At.setTypeParser=Fc;At.arrayParser= -Pc;At.builtins=Bc;var Et={text:{},binary:{}};function ro(r){return String(r)}a(ro,"noParse");function Lc(r,e){ -return e=e||"text",Et[e]&&Et[e][r]||ro}a(Lc,"getTypeParser");function Fc(r,e,t){typeof e=="function"&& -(t=e,e="text"),Et[e][r]=t}a(Fc,"setTypeParser");Tc.init(function(r,e){Et.text[r]=e});Rc.init(function(r,e){ -Et.binary[r]=e})});var Xt=P((rd,no)=>{"use strict";p();var Mc=_t();function Zt(r){this._types=r||Mc,this.text={},this.binary= +REGROLE:4096}});var Ct=P(_t=>{p();var Tl=Gs(),Rl=Xs(),Pl=Vr(),Bl=to();_t.getTypeParser=Ll;_t.setTypeParser=Fl;_t.arrayParser= +Pl;_t.builtins=Bl;var At={text:{},binary:{}};function ro(r){return String(r)}a(ro,"noParse");function Ll(r,e){ +return e=e||"text",At[e]&&At[e][r]||ro}a(Ll,"getTypeParser");function Fl(r,e,t){typeof e=="function"&& +(t=e,e="text"),At[e][r]=t}a(Fl,"setTypeParser");Tl.init(function(r,e){At.text[r]=e});Rl.init(function(r,e){ +At.binary[r]=e})});var Xt=P((rd,no)=>{"use strict";p();var Ml=Ct();function Zt(r){this._types=r||Ml,this.text={},this.binary= {}}a(Zt,"TypeOverrides");Zt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ binary":return this.binary;default:return{}}};Zt.prototype.setTypeParser=function(r,e,t){typeof e=="\ function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Zt.prototype.getTypeParser=function(r,e){return e= -e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};no.exports=Zt});function Ct(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, +e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};no.exports=Zt});function It(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119,o=2600822924,u=528734635, +l=1541459225,c=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, 3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700, @@ -555,19 +555,19 @@ c=1541459225,l=0,f=0,y=[1116352408,1899447441,3049323471,3921009573,961987163,15 2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=a((T,b)=>T>>>b|T<<32- b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),H=a(()=>{for(let F=0,J=0;F<16;F++,J+=4)E[F]=C[J]<< 24|C[J+1]<<16|C[J+2]<<8|C[J+3];for(let F=16;F<64;F++){let J=g(E[F-15],7)^g(E[F-15],18)^E[F-15]>>>3,Ee=g( -E[F-2],17)^g(E[F-2],19)^E[F-2]>>>10;E[F]=E[F-16]+J+E[F-7]+Ee|0}let T=e,b=t,M=n,oe=i,$=s,ge=o,Ie=u,ce=c; -for(let F=0;F<64;F++){let J=g($,6)^g($,11)^g($,25),Ee=$&ge^~$&Ie,Te=ce+J+Ee+y[F]+E[F]|0,ke=g(T,2)^g( -T,13)^g(T,22),Ue=T&b^T&M^b&M,De=ke+Ue|0;ce=Ie,Ie=ge,ge=$,$=oe+Te|0,oe=M,M=b,b=T,T=Te+De|0}e=e+T|0,t= -t+b|0,n=n+M|0,i=i+oe|0,s=s+$|0,o=o+ge|0,u=u+Ie|0,c=c+ce|0,f=0},"process"),Y=a(T=>{typeof T=="string"&& -(T=new TextEncoder().encode(T));for(let b=0;b{if(C[f++]=128,f==64&&H(),f+8>64){for(;f<64;)C[f++]=0;H()}for(;f<58;)C[f++]=0;let T=l*8;C[f++]= +E[F-2],17)^g(E[F-2],19)^E[F-2]>>>10;E[F]=E[F-16]+J+E[F-7]+Ee|0}let T=e,b=t,M=n,oe=i,$=s,ge=o,Ie=u,le=l; +for(let F=0;F<64;F++){let J=g($,6)^g($,11)^g($,25),Ee=$&ge^~$&Ie,Te=le+J+Ee+y[F]+E[F]|0,Ue=g(T,2)^g( +T,13)^g(T,22),De=T&b^T&M^b&M,Oe=Ue+De|0;le=Ie,Ie=ge,ge=$,$=oe+Te|0,oe=M,M=b,b=T,T=Te+Oe|0}e=e+T|0,t= +t+b|0,n=n+M|0,i=i+oe|0,s=s+$|0,o=o+ge|0,u=u+Ie|0,l=l+le|0,f=0},"process"),Y=a(T=>{typeof T=="string"&& +(T=new TextEncoder().encode(T));for(let b=0;b{if(C[f++]=128,f==64&&H(),f+8>64){for(;f<64;)C[f++]=0;H()}for(;f<58;)C[f++]=0;let T=c*8;C[f++]= T/1099511627776&255,C[f++]=T/4294967296&255,C[f++]=T>>>24,C[f++]=T>>>16&255,C[f++]=T>>>8&255,C[f++]= T&255,H();let b=new Uint8Array(32);return b[0]=e>>>24,b[1]=e>>>16&255,b[2]=e>>>8&255,b[3]=e&255,b[4]= t>>>24,b[5]=t>>>16&255,b[6]=t>>>8&255,b[7]=t&255,b[8]=n>>>24,b[9]=n>>>16&255,b[10]=n>>>8&255,b[11]=n& 255,b[12]=i>>>24,b[13]=i>>>16&255,b[14]=i>>>8&255,b[15]=i&255,b[16]=s>>>24,b[17]=s>>>16&255,b[18]=s>>> 8&255,b[19]=s&255,b[20]=o>>>24,b[21]=o>>>16&255,b[22]=o>>>8&255,b[23]=o&255,b[24]=u>>>24,b[25]=u>>>16& -255,b[26]=u>>>8&255,b[27]=u&255,b[28]=c>>>24,b[29]=c>>>16&255,b[30]=c>>>8&255,b[31]=c&255,b},"digest"); -return r===void 0?{add:Y,digest:we}:(Y(r),we())}var io=te(()=>{"use strict";p();a(Ct,"sha256")});var Q,It,so=te(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ +255,b[26]=u>>>8&255,b[27]=u&255,b[28]=l>>>24,b[29]=l>>>16&255,b[30]=l>>>8&255,b[31]=l&255,b},"digest"); +return r===void 0?{add:Y,digest:we}:(Y(r),we())}var io=te(()=>{"use strict";p();a(It,"sha256")});var Q,Tt,so=te(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ Length",0);I(this,"_state",new Int32Array(4));I(this,"_buffer",new ArrayBuffer(68));I(this,"_buffer8"); I(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( @@ -625,130 +625,130 @@ i=this._state,s;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=n i[3]=n[3],s=0;s>2)+1;this._dataLength+=t;let o=this._dataLength*8;if(n[t]=128,n[t+1]= n[t+2]=n[t+3]=0,i.set(Q.buffer32Identity.subarray(s),s),t>55&&(Q._md5cycle(this._state,i),i.set(Q.buffer32Identity)), -o<=4294967295)i[14]=o;else{let u=o.toString(16).match(/(.*?)(.{0,8})$/);if(u===null)return;let c=parseInt( -u[2],16),l=parseInt(u[1],16)||0;i[14]=c,i[15]=l}return Q._md5cycle(this._state,i),e?this._state:Q._hex( +o<=4294967295)i[14]=o;else{let u=o.toString(16).match(/(.*?)(.{0,8})$/);if(u===null)return;let l=parseInt( +u[2],16),c=parseInt(u[1],16)||0;i[14]=l,i[15]=c}return Q._md5cycle(this._state,i),e?this._state:Q._hex( this._state)}};a(Q,"Md5"),I(Q,"stateIdentity",new Int32Array([1732584193,-271733879,-1732584194,271733878])), I(Q,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),I(Q,"hexChars","0123456789\ -abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);It=Q});var tn={};fe(tn,{createHash:()=>Uc,createHmac:()=>Dc,randomBytes:()=>kc});function kc(r){return crypto. -getRandomValues(m.alloc(r))}function Uc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( -function(){return m.from(Ct(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 Dc(r,e){if(r!=="sha256")throw new Error(`\ +abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);Tt=Q});var tn={};fe(tn,{createHash:()=>Ul,createHmac:()=>Dl,randomBytes:()=>kl});function kl(r){return crypto. +getRandomValues(m.alloc(r))}function Ul(r){if(r==="sha256")return{update:a(function(e){return{digest:a( +function(){return m.from(It(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 Dl(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=Ct(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(Ct(o),64),m.from(Ct(u))}, -"digest")}},"update")}}var rn=te(()=>{"use strict";p();io();so();a(kc,"randomBytes");a(Uc,"createHas\ -h");a(Dc,"createHmac")});var Tt=P((yd,nn)=>{"use strict";p();nn.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: +t));let n=e.length;if(n>64)e=It(e);else if(n<64){let l=new Uint8Array(64);l.set(e),e=l}let i=new Uint8Array( +64),s=new Uint8Array(64);for(let l=0;l<64;l++)i[l]=54^e[l],s[l]=92^e[l];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(It(o),64),m.from(It(u))}, +"digest")}},"update")}}var rn=te(()=>{"use strict";p();io();so();a(kl,"randomBytes");a(Ul,"createHas\ +h");a(Dl,"createHmac")});var Rt=P((yd,nn)=>{"use strict";p();nn.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: w.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 it=_t(),Oc=it.getTypeParser(20,"text"),Nc=it.getTypeParser(1016, -"text");nn.exports.__defineSetter__("parseInt8",function(r){it.setTypeParser(20,"text",r?it.getTypeParser( -23,"text"):Oc),it.setTypeParser(1016,"text",r?it.getTypeParser(1007,"text"):Nc)})});var Rt=P((wd,ao)=>{"use strict";p();var qc=(rn(),j(tn)),Qc=Tt();function jc(r){var e=r.replace(/\\/g, -"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(jc,"escapeElement");function oo(r){for(var e="{",t=0;t< +keepalives:1,keepalives_idle:0};var st=Ct(),Ol=st.getTypeParser(20,"text"),Nl=st.getTypeParser(1016, +"text");nn.exports.__defineSetter__("parseInt8",function(r){st.setTypeParser(20,"text",r?st.getTypeParser( +23,"text"):Ol),st.setTypeParser(1016,"text",r?st.getTypeParser(1007,"text"):Nl)})});var Pt=P((wd,ao)=>{"use strict";p();var ql=(rn(),j(tn)),Ql=Rt();function jl(r){var e=r.replace(/\\/g, +"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(jl,"escapeElement");function oo(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+oo(r[t]): -r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=jc(er(r[t]));return e=e+"}",e}a(oo,"arrayString"); +r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=jl(er(r[t]));return e=e+"}",e}a(oo,"arrayString"); var er=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. 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?Qc.parseInputDatesAsUTC?$c(r):Hc(r):Array.isArray(r)?oo(r):typeof r== -"object"?Wc(r,e):r.toString()},"prepareValue");function Wc(r,e){if(r&&typeof r.toPostgres=="function"){ +r.byteLength)}return r instanceof Date?Ql.parseInputDatesAsUTC?$l(r):Hl(r):Array.isArray(r)?oo(r):typeof r== +"object"?Wl(r,e):r.toString()},"prepareValue");function Wl(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),er(r.toPostgres(er),e)}return JSON.stringify(r)}a(Wc,"prepareObject");function z(r,e){ -for(r=""+r;r.lengthrl});var rl,Lt=te(()=>{"use strict";p();rl={}});var bo=P((Bd,go)=>{"use strict";p();var un=(rn(),j(tn));function nl(r){if(r.indexOf("SCRAM-SHA-256")=== +normalizeQueryConfig:Gl,postgresMd5PasswordHash:Vl,md5:sn}});var Bt={};fe(Bt,{default:()=>rc});var rc,Lt=te(()=>{"use strict";p();rc={}});var bo=P((Bd,go)=>{"use strict";p();var un=(rn(),j(tn));function nc(r){if(r.indexOf("SCRAM-SHA-256")=== -1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=un.randomBytes( 18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"\ -SASLInitialResponse"}}a(nl,"startSession");function il(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( +SASLInitialResponse"}}a(nc,"startSession");function ic(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=al(t);if(n.nonce.startsWith(r.clientNonce)){ +L: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=ac(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=m.from(n.salt,"base64"),s=ll(e,i,n.iteration),o=st(s,"Client Key"),u=cl( -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=st(u,y),E=wo(o,g),C=E.toString("base64"),H=st(s,"Server Key"),Y=st(H,y);r.message="SAS\ -LResponse",r.serverSignature=Y.toString("base64"),r.response=f+",p="+C}a(il,"continueSession");function sl(r,e){ +art with client nonce");var i=m.from(n.salt,"base64"),s=cc(e,i,n.iteration),o=ot(s,"Client Key"),u=lc( +o),l="n=*,r="+r.clientNonce,c="r="+n.nonce+",s="+n.salt+",i="+n.iteration,f="c=biws,r="+n.nonce,y=l+ +","+c+","+f,g=ot(u,y),E=wo(o,g),C=E.toString("base64"),H=ot(s,"Server Key"),Y=ot(H,y);r.message="SAS\ +LResponse",r.serverSignature=Y.toString("base64"),r.response=f+",p="+C}a(ic,"continueSession");function sc(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}=ul( +"string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=uc( e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does\ - not match")}a(sl,"finalizeSession");function ol(r){if(typeof r!="string")throw new TypeError("SASL:\ + not match")}a(sc,"finalizeSession");function oc(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(ol,"isPrintableChars");function yo(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +e<=126)}a(oc,"isPrintableChars");function yo(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. test(r)}a(yo,"isBase64");function mo(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(mo,"parseAttribute\ -Pairs");function al(r){let e=mo(r),t=e.get("r");if(t){if(!ol(t))throw new Error("SASL: SCRAM-SERVER-\ +Pairs");function ac(r){let e=mo(r),t=e.get("r");if(t){if(!oc(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(!yo(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(al,"parseServerFirstMessage"); -function ul(r){let t=mo(r).get("v");if(t){if(!yo(t))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAG\ +tion missing");let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(ac,"parseServerFirstMessage"); +function uc(r){let t=mo(r).get("v");if(t){if(!yo(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(ul,"parseServerFinalMessage");function wo(r,e){if(!m. +signature is missing");return{serverSignature:t}}a(uc,"parseServerFinalMessage");function wo(r,e){if(!m. isBuffer(r))throw new TypeError("first argument must be a Buffer");if(!m.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 m.from(r.map((t,n)=>r[n]^e[n]))} -a(wo,"xorBuffers");function cl(r){return un.createHash("sha256").update(r).digest()}a(cl,"sha256");function st(r,e){ -return un.createHmac("sha256",r).update(e).digest()}a(st,"hmacSha256");function ll(r,e,t){for(var n=st( -r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sfl});function fl(...r){return r.join("/")}var ln=te(()=>{"use strict";p(); -a(fl,"join")});var fn={};fe(fn,{stat:()=>hl});function hl(r,e){e(new Error("No filesystem"))}var hn=te(()=>{"use st\ -rict";p();a(hl,"stat")});var dn={};fe(dn,{default:()=>dl});var dl,pn=te(()=>{"use strict";p();dl={}});var xo={};fe(xo,{StringDecoder:()=>yn});var mn,yn,So=te(()=>{"use strict";p();mn=class mn{constructor(e){ +a(wo,"xorBuffers");function lc(r){return un.createHash("sha256").update(r).digest()}a(lc,"sha256");function ot(r,e){ +return un.createHmac("sha256",r).update(e).digest()}a(ot,"hmacSha256");function cc(r,e,t){for(var n=ot( +r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sfc});function fc(...r){return r.join("/")}var cn=te(()=>{"use strict";p(); +a(fc,"join")});var fn={};fe(fn,{stat:()=>hc});function hc(r,e){e(new Error("No filesystem"))}var hn=te(()=>{"use st\ +rict";p();a(hc,"stat")});var dn={};fe(dn,{default:()=>dc});var dc,pn=te(()=>{"use strict";p();dc={}});var xo={};fe(xo,{StringDecoder:()=>yn});var mn,yn,So=te(()=>{"use strict";p();mn=class mn{constructor(e){ I(this,"td");this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this. -td.decode(e)}};a(mn,"StringDecoder");yn=mn});var _o=P((Qd,Ao)=>{"use strict";p();var{Transform:pl}=(pn(),j(dn)),{StringDecoder:yl}=(So(),j(xo)),Fe=Symbol( -"last"),rr=Symbol("decoder");function ml(r,e,t){let n;if(this.overflow){if(n=this[rr].write(r).split( -this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Fe]+=this[rr].write(r),n= -this[Fe].split(this.matcher);this[Fe]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( -"maximum buffer reached"));return}t()}a(ml,"transform");function wl(r){if(this[Fe]+=this[rr].end(),this[Fe]) -try{Eo(this,this.mapper(this[Fe]))}catch(e){return r(e)}r()}a(wl,"flush");function Eo(r,e){e!==void 0&& -r.push(e)}a(Eo,"push");function vo(r){return r}a(vo,"noop");function gl(r,e,t){switch(r=r||/\r?\n/,e= +td.decode(e)}};a(mn,"StringDecoder");yn=mn});var _o=P((Qd,Ao)=>{"use strict";p();var{Transform:pc}=(pn(),j(dn)),{StringDecoder:yc}=(So(),j(xo)),Me=Symbol( +"last"),rr=Symbol("decoder");function mc(r,e,t){let n;if(this.overflow){if(n=this[rr].write(r).split( +this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Me]+=this[rr].write(r),n= +this[Me].split(this.matcher);this[Me]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( +"maximum buffer reached"));return}t()}a(mc,"transform");function wc(r){if(this[Me]+=this[rr].end(),this[Me]) +try{Eo(this,this.mapper(this[Me]))}catch(e){return r(e)}r()}a(wc,"flush");function Eo(r,e){e!==void 0&& +r.push(e)}a(Eo,"push");function vo(r){return r}a(vo,"noop");function gc(r,e,t){switch(r=r||/\r?\n/,e= e||vo,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=vo)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=ml,t.flush=wl,t.readableObjectMode= -!0;let n=new pl(t);return n[Fe]="",n[rr]=new yl("utf8"),n.matcher=r,n.mapper=e,n.maxLength=t.maxLength, +"object"&&(t=e,e=vo)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=mc,t.flush=wc,t.readableObjectMode= +!0;let n=new pc(t);return n[Me]="",n[rr]=new yc("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(gl,"split");Ao.exports=gl});var To=P((Hd,Ce)=>{"use strict";p();var Co=(ln(),j(cn)),bl=(pn(),j(dn)).Stream,xl=_o(),Io=(Lt(),j(Bt)), -Sl=5432,nr=w.platform==="win32",Ft=w.stderr,vl=56,El=7,Al=61440,_l=32768;function Cl(r){return(r&Al)== -_l}a(Cl,"isRegFile");var ot=["host","port","database","user","password"],wn=ot.length,Il=ot[wn-1];function gn(){ -var r=Ft instanceof bl&&Ft.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +!1,s(i)},n}a(gc,"split");Ao.exports=gc});var To=P((Hd,Ce)=>{"use strict";p();var Co=(cn(),j(ln)),bc=(pn(),j(dn)).Stream,xc=_o(),Io=(Lt(),j(Bt)), +Sc=5432,nr=w.platform==="win32",Ft=w.stderr,vc=56,Ec=7,Ac=61440,_c=32768;function Cc(r){return(r&Ac)== +_c}a(Cc,"isRegFile");var at=["host","port","database","user","password"],wn=at.length,Ic=at[wn-1];function gn(){ +var r=Ft instanceof bc&&Ft.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` `);Ft.write(Io.format.apply(Io,e))}}a(gn,"warn");Object.defineProperty(Ce.exports,"isWin",{get:a(function(){ return nr},"get"),set:a(function(r){nr=r},"set")});Ce.exports.warnTo=function(r){var e=Ft;return Ft= r,e};Ce.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(nr?Co.join(e.APPDATA||"./","\ postgresql","pgpass.conf"):Co.join(e.HOME||"./",".pgpass"));return t};Ce.exports.usePgPass=function(r,e){ -return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:nr?!0:(e=e||"",Cl(r.mode)?r. -mode&(vl|El)?(gn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ -(0600) or less',e),!1):!0:(gn('WARNING: password file "%s" is not a plain file',e),!1))};var Tl=Ce.exports. -match=function(r,e){return ot.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||Sl)===Number( +return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:nr?!0:(e=e||"",Cc(r.mode)?r. +mode&(vc|Ec)?(gn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ +(0600) or less',e),!1):!0:(gn('WARNING: password file "%s" is not a plain file',e),!1))};var Tc=Ce.exports. +match=function(r,e){return at.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||Sc)===Number( e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};Ce.exports.getPassword=function(r,e,t){var n,i=e.pipe( -xl());function s(c){var l=Rl(c);l&&Pl(l)&&Tl(r,l)&&(n=l[Il],i.end())}a(s,"onLine");var o=a(function(){ -e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),gn("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 Rl=Ce.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( +xc());function s(l){var c=Rc(l);c&&Pc(c)&&Tc(r,c)&&(n=c[Ic],i.end())}a(s,"onLine");var o=a(function(){ +e.destroy(),t(n)},"onEnd"),u=a(function(l){e.destroy(),gn("WARNING: error on reading file: %s",l),t( +void 0)},"onErr");e.on("error",u),i.on("data",s).on("end",o).on("error",u)};var Rc=Ce.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,l=a( function(f,y,g){var E=r.substring(y,g);Object.hasOwnProperty.call(w.env,"PGPASS_NO_DEESCAPE")||(E=E. -replace(/\\([:\\])/g,"$1")),o[ot[f]]=E},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). -length===wn?o:null,o},Pl=Ce.exports.isValidEntry=function(r){for(var e={0:function(o){return o.length> +replace(/\\([:\\])/g,"$1")),o[at[f]]=E},"addToObj"),c=0;c=0&&e==":"&&t!=="\\"&&(l(n,i,c+1),i=c+2,n+=1)}return o=Object.keys(o). +length===wn?o:null,o},Pc=Ce.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 Vd=(ln(),j(cn)),Ro=(hn(),j(fn)),ir=To();bn.exports=function(r,e){ +0}},t=0;t{"use strict";p();var Vd=(cn(),j(ln)),Ro=(hn(),j(fn)),ir=To();bn.exports=function(r,e){ var t=ir.getFileName();Ro.stat(t,function(n,i){if(n||!ir.usePgPass(i,t))return e(void 0);var s=Ro.createReadStream( -t);ir.getPassword(r,s,e)})};bn.exports.warnTo=ir.warnTo});var Bo={};fe(Bo,{default:()=>Bl});var Bl,Lo=te(()=>{"use strict";p();Bl={}});var Mo=P((Jd,Fo)=>{"use strict";p();var Ll=(Pr(),j(cs)),xn=(hn(),j(fn));function Sn(r){if(r.charAt(0)=== -"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Ll.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i. +t);ir.getPassword(r,s,e)})};bn.exports.warnTo=ir.warnTo});var Bo={};fe(Bo,{default:()=>Bc});var Bc,Lo=te(()=>{"use strict";p();Bc={}});var Mo=P((Jd,Fo)=>{"use strict";p();var Lc=(Pr(),j(ls)),xn=(hn(),j(fn));function Sn(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. 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. @@ -759,17 +759,17 @@ t.ssl==="0"&&(t.ssl=!1),(t.sslcert||t.sslkey||t.sslrootcert||t.sslmode)&&(t.ssl= cert=xn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=xn.readFileSync(t.sslkey).toString()), t.sslrootcert&&(t.ssl.ca=xn.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(Sn,"parse");Fo.exports=Sn;Sn.parse=Sn});var sr=P((ep,Do)=>{"use strict";p();var Fl=(Lo(),j(Bo)),Uo=Tt(),ko=Mo().parse,ee=a(function(r,e,t){return t=== -void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Uo[r]},"val"),Ml=a(function(){switch(w. +!1;break}}return t}a(Sn,"parse");Fo.exports=Sn;Sn.parse=Sn});var sr=P((ep,Do)=>{"use strict";p();var Fc=(Lo(),j(Bo)),Uo=Rt(),ko=Mo().parse,ee=a(function(r,e,t){return t=== +void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Uo[r]},"val"),Mc=a(function(){switch(w. 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 Uo.ssl},"readSSLConfigFromEnvironment"),at=a(function(r){ +no-verify":return{rejectUnauthorized:!1}}return Uo.ssl},"readSSLConfigFromEnvironment"),ut=a(function(r){ return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),me=a(function(r,e,t){ -var n=e[t];n!=null&&r.push(t+"="+at(n))},"add"),En=class En{constructor(e){e=typeof e=="string"?ko(e): +var n=e[t];n!=null&&r.push(t+"="+ut(n))},"add"),En=class En{constructor(e){e=typeof e=="string"?ko(e): e||{},e.connectionString&&(e=Object.assign({},e,ko(e.connectionString))),this.user=ee("user",e),this. database=ee("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(ee("p\ ort",e),10),this.host=ee("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, writable:!0,value:ee("password",e)}),this.binary=ee("binary",e),this.options=ee("options",e),this.ssl= -typeof e.ssl>"u"?Ml():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="\ +typeof e.ssl>"u"?Mc():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=ee("client_encoding",e),this.replication=ee("replication", e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=ee("application_name",e,"\ @@ -782,11 +782,11 @@ void 0?this.connect_timeout=w.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math var t=[];me(t,this,"user"),me(t,this,"password"),me(t,this,"port"),me(t,this,"application_name"),me( t,this,"fallback_application_name"),me(t,this,"connect_timeout"),me(t,this,"options");var n=typeof this. ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(me(t,n,"sslmode"),me(t,n,"sslca"),me(t,n,"s\ -slkey"),me(t,n,"sslcert"),me(t,n,"sslrootcert"),this.database&&t.push("dbname="+at(this.database)),this. -replication&&t.push("replication="+at(this.replication)),this.host&&t.push("host="+at(this.host)),this. -isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+at(this.client_encoding)), -Fl.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+at(s)),e(null,t.join(" ")))})}}; -a(En,"ConnectionParameters");var vn=En;Do.exports=vn});var qo=P((np,No)=>{"use strict";p();var kl=_t(),Oo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,_n=class _n{constructor(e,t){ +slkey"),me(t,n,"sslcert"),me(t,n,"sslrootcert"),this.database&&t.push("dbname="+ut(this.database)),this. +replication&&t.push("replication="+ut(this.replication)),this.host&&t.push("host="+ut(this.host)),this. +isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+ut(this.client_encoding)), +Fc.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+ut(s)),e(null,t.join(" ")))})}}; +a(En,"ConnectionParameters");var vn=En;Do.exports=vn});var qo=P((np,No)=>{"use strict";p();var kc=Ct(),Oo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,_n=class _n{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=Oo.exec(e.text):t=Oo.exec(e.command),t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2], @@ -795,8 +795,8 @@ e.length),n=0,i=e.length;n{"use strict";p();var{EventEmitter:Ul}=Be(),Qo=qo(),jo=Rt(),In=class In extends Ul{constructor(e,t,n){ +_types.getTypeParser(n.dataTypeID,n.format||"text"):this._parsers[t]=kc.getTypeParser(n.dataTypeID,n. +format||"text")}}};a(_n,"Result");var An=_n;No.exports=An});var Ho=P((op,Wo)=>{"use strict";p();var{EventEmitter:Uc}=Be(),Qo=qo(),jo=Pt(),In=class In extends Uc{constructor(e,t,n){ super(),e=jo.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,w.domain&&e.callback&&(this.callback=w.domain.bind(e.callback)),this._result= @@ -867,34 +867,34 @@ e.length),e.copy(this.buffer,this.offset),this.offset+=e.length,this}join(e){if( 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=m.allocUnsafe(this.size),t}};a(ii,"Writer");var ni=ii;or.Writer=ni});var Vo=P(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.serialize=void 0; -var si=$o(),D=new si.Writer,Dl=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( +var si=$o(),D=new si.Writer,Dc=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( n).addCString(r[n]);D.addCString("client_encoding").addCString("UTF8");let e=D.addCString("").flush(), -t=e.length+4;return new si.Writer().addInt32(t).add(e).flush()},"startup"),Ol=a(()=>{let r=m.allocUnsafe( -8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Nl=a(r=>D.addCString(r).flush( -112),"password"),ql=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. -flush(112)},"sendSASLInitialResponseMessage"),Ql=a(function(r){return D.addString(r).flush(112)},"se\ -ndSCRAMClientFinalMessage"),jl=a(r=>D.addCString(r).flush(81),"query"),Go=[],Wl=a(r=>{let e=r.name|| +t=e.length+4;return new si.Writer().addInt32(t).add(e).flush()},"startup"),Oc=a(()=>{let r=m.allocUnsafe( +8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Nc=a(r=>D.addCString(r).flush( +112),"password"),qc=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. +flush(112)},"sendSASLInitialResponseMessage"),Qc=a(function(r){return D.addString(r).flush(112)},"se\ +ndSCRAMClientFinalMessage"),jc=a(r=>D.addCString(r).flush(81),"query"),Go=[],Wc=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||Go,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< -n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),ut=new si.Writer,Hl=a(function(r,e){for(let t=0;t< -r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),ut.addInt32(-1)):n instanceof m?(D.addInt16( -1),ut.addInt32(n.length),ut.add(n)):(D.addInt16(0),ut.addInt32(m.byteLength(n)),ut.addString(n))}},"\ -writeValues"),$l=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Go,s=i.length; -return D.addCString(e).addCString(t),D.addInt16(s),Hl(i,r.valueMapper),D.addInt16(s),D.add(ut.flush()), -D.addInt16(n?1:0),D.flush(66)},"bind"),Gl=m.from([69,0,0,0,9,0,0,0,0,0]),Vl=a(r=>{if(!r||!r.portal&& -!r.rows)return Gl;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Kl=a( +n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),lt=new si.Writer,Hc=a(function(r,e){for(let t=0;t< +r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),lt.addInt32(-1)):n instanceof m?(D.addInt16( +1),lt.addInt32(n.length),lt.add(n)):(D.addInt16(0),lt.addInt32(m.byteLength(n)),lt.addString(n))}},"\ +writeValues"),$c=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Go,s=i.length; +return D.addCString(e).addCString(t),D.addInt16(s),Hc(i,r.valueMapper),D.addInt16(s),D.add(lt.flush()), +D.addInt16(n?1:0),D.flush(66)},"bind"),Gc=m.from([69,0,0,0,9,0,0,0,0,0]),Vc=a(r=>{if(!r||!r.portal&& +!r.rows)return Gc;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Kc=a( (r,e)=>{let t=m.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"),oi=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i},"cstringMessage"), -zl=D.addCString("P").flush(68),Yl=D.addCString("S").flush(68),Jl=a(r=>r.name?oi(68,`${r.type}${r.name|| -""}`):r.type==="P"?zl:Yl,"describe"),Zl=a(r=>{let e=`${r.type}${r.name||""}`;return oi(67,e)},"close"), -Xl=a(r=>D.add(r).flush(100),"copyData"),ef=a(r=>oi(102,r),"copyFail"),ar=a(r=>m.from([r,0,0,0,4]),"c\ -odeOnlyBuffer"),tf=ar(72),rf=ar(83),nf=ar(88),sf=ar(99),of={startup:Dl,password:Nl,requestSsl:Ol,sendSASLInitialResponseMessage:ql, -sendSCRAMClientFinalMessage:Ql,query:jl,parse:Wl,bind:$l,execute:Vl,describe:Jl,close:Zl,flush:a(()=>tf, -"flush"),sync:a(()=>rf,"sync"),end:a(()=>nf,"end"),copyData:Xl,copyDone:a(()=>sf,"copyDone"),copyFail:ef, -cancel:Kl};ur.serialize=of});var Ko=P(cr=>{"use strict";p();Object.defineProperty(cr,"__esModule",{value:!0});cr.BufferReader=void 0; +zc=D.addCString("P").flush(68),Yc=D.addCString("S").flush(68),Jc=a(r=>r.name?oi(68,`${r.type}${r.name|| +""}`):r.type==="P"?zc:Yc,"describe"),Zc=a(r=>{let e=`${r.type}${r.name||""}`;return oi(67,e)},"close"), +Xc=a(r=>D.add(r).flush(100),"copyData"),ef=a(r=>oi(102,r),"copyFail"),ar=a(r=>m.from([r,0,0,0,4]),"c\ +odeOnlyBuffer"),tf=ar(72),rf=ar(83),nf=ar(88),sf=ar(99),of={startup:Dc,password:Nc,requestSsl:Oc,sendSASLInitialResponseMessage:qc, +sendSCRAMClientFinalMessage:Qc,query:jc,parse:Wc,bind:$c,execute:Vc,describe:Jc,close:Zc,flush:a(()=>tf, +"flush"),sync:a(()=>rf,"sync"),end:a(()=>nf,"end"),copyData:Xc,copyDone:a(()=>sf,"copyDone"),copyFail:ef, +cancel:Kc};ur.serialize=of});var Ko=P(lr=>{"use strict";p();Object.defineProperty(lr,"__esModule",{value:!0});lr.BufferReader=void 0; var af=m.allocUnsafe(0),ui=class ui{constructor(e=0){this.offset=e,this.buffer=af,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( @@ -902,12 +902,12 @@ this.offset);return this.offset+=4,e}uint32(){let e=this.buffer.readUInt32BE(thi 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(ui,"BufferReader");var ai=ui;cr.BufferReader=ai});var Jo=P(lr=>{"use strict";p();Object.defineProperty(lr,"__esModule",{value:!0});lr.Parser=void 0;var O=ri(), -uf=Ko(),ci=1,cf=4,zo=ci+cf,Yo=m.allocUnsafe(0),fi=class fi{constructor(e){if(this.buffer=Yo,this.bufferLength= +offset+=e,t}};a(ui,"BufferReader");var ai=ui;lr.BufferReader=ai});var Jo=P(cr=>{"use strict";p();Object.defineProperty(cr,"__esModule",{value:!0});cr.Parser=void 0;var O=ri(), +uf=Ko(),li=1,lf=4,zo=li+lf,Yo=m.allocUnsafe(0),fi=class fi{constructor(e){if(this.buffer=Yo,this.bufferLength= 0,this.bufferOffset=0,this.reader=new uf.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+zo<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( -i+ci),u=ci+o;if(u+i<=n){let c=this.handlePacket(i+zo,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. +i+li),u=li+o;if(u+i<=n){let l=this.handlePacket(i+zo,s,o,this.buffer);t(l),i+=u}else break}i===n?(this. buffer=Yo,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. @@ -929,7 +929,7 @@ this.reader.setBuffer(e,n);let i=this.reader.cstring();return new O.CommandCompl let i=n.slice(e,e+(t-4));return new O.CopyDataMessage(t,i)}parseCopyInMessage(e,t,n){return this.parseCopyMessage( e,t,n,"copyInResponse")}parseCopyOutMessage(e,t,n){return this.parseCopyMessage(e,t,n,"copyOutRespon\ se")}parseCopyMessage(e,t,n,i){this.reader.setBuffer(e,n);let s=this.reader.byte()!==0,o=this.reader. -int16(),u=new O.CopyResponse(t,i,s,o);for(let c=0;c{"use strict";p();Object.defineProperty(Me,"__esModule",{value:!0});Me.DatabaseError=Me. -serialize=Me.parse=void 0;var lf=ri();Object.defineProperty(Me,"DatabaseError",{enumerable:!0,get:a( -function(){return lf.DatabaseError},"get")});var ff=Vo();Object.defineProperty(Me,"serialize",{enumerable:!0, +l=i==="notice"?new O.NoticeMessage(t,u):new O.DatabaseError(u,t,i);return l.severity=s.S,l.code=s.C, +l.detail=s.D,l.hint=s.H,l.position=s.P,l.internalPosition=s.p,l.internalQuery=s.q,l.where=s.W,l.schema= +s.s,l.table=s.t,l.column=s.c,l.dataType=s.d,l.constraint=s.n,l.file=s.F,l.line=s.L,l.routine=s.R,l}}; +a(fi,"Parser");var ci=fi;cr.Parser=ci});var hi=P(ke=>{"use strict";p();Object.defineProperty(ke,"__esModule",{value:!0});ke.DatabaseError=ke. +serialize=ke.parse=void 0;var cf=ri();Object.defineProperty(ke,"DatabaseError",{enumerable:!0,get:a( +function(){return cf.DatabaseError},"get")});var ff=Vo();Object.defineProperty(ke,"serialize",{enumerable:!0, get:a(function(){return ff.serialize},"get")});var hf=Jo();function df(r,e){let t=new hf.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(df,"parse");Me.parse=df});var Zo={};fe(Zo,{connect:()=>pf});function pf({socket:r,servername:e}){return r.startTls(e),r}var Xo=te( -()=>{"use strict";p();a(pf,"connect")});var yi=P((Rp,ra)=>{"use strict";p();var ea=(Ye(),j(us)),yf=Be().EventEmitter,{parse:mf,serialize:K}=hi(), +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(df,"parse");ke.parse=df});var Zo={};fe(Zo,{connect:()=>pf});function pf({socket:r,servername:e}){return r.startTls(e),r}var Xo=te( +()=>{"use strict";p();a(pf,"connect")});var yi=P((Rp,ra)=>{"use strict";p();var ea=(Je(),j(us)),yf=Be().EventEmitter,{parse:mf,serialize:K}=hi(), ta=K.flush(),wf=K.sync(),gf=K.end(),pi=class pi extends yf{constructor(e){super(),e=e||{},this.stream= e.stream||new ea.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; @@ -971,9 +971,9 @@ 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=(Xo(),j(Zo));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= -n.ssl.key)),ea.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( +var u=(Xo(),j(Zo));let l={socket:n.stream};n.ssl!==!0&&(Object.assign(l,n.ssl),"key"in n.ssl&&(l.key= +n.ssl.key)),ea.isIP(t)===0&&(l.servername=t);try{n.stream=u.connect(l)}catch(c){return n.emit("error", +c)}n.attachListeners(n.stream),n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){e.on( "end",()=>{this.emit("end")}),mf(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(K.requestSsl())}startup(e){this. stream.write(K.startup(e))}cancel(e,t){this._send(K.cancel(e,t))}password(e){this._send(K.password(e))}sendSASLInitialResponseMessage(e,t){ @@ -985,8 +985,8 @@ stream.ref()}unref(){this.stream.unref()}end(){if(this._ending=!0,!this._connect this.stream.end();return}return this.stream.write(gf,()=>{this.stream.end()})}close(e){this._send(K. close(e))}describe(e){this._send(K.describe(e))}sendCopyFromChunk(e){this._send(K.copyData(e))}endCopyFrom(){ this._send(K.copyDone())}sendCopyFail(e){this._send(K.copyFail(e))}};a(pi,"Connection");var di=pi;ra. -exports=di});var sa=P((Fp,ia)=>{"use strict";p();var bf=Be().EventEmitter,Lp=(Lt(),j(Bt)),xf=Rt(),mi=bo(),Sf=Po(), -vf=Xt(),Ef=sr(),na=Ho(),Af=Tt(),_f=yi(),wi=class wi extends bf{constructor(e){super(),this.connectionParameters= +exports=di});var sa=P((Fp,ia)=>{"use strict";p();var bf=Be().EventEmitter,Lp=(Lt(),j(Bt)),xf=Pt(),mi=bo(),Sf=Po(), +vf=Xt(),Ef=sr(),na=Ho(),Af=Rt(),_f=yi(),wi=class wi extends bf{constructor(e){super(),this.connectionParameters= new Ef(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}), @@ -1063,13 +1063,13 @@ s==="'"?n+=s+s:s==="\\"?(n+=s+s,t=!0):n+=s}return n+="'",t===!0&&(n=" E"+n),n}_p readyForQuery===!0)if(this.activeQuery=this.queryQueue.shift(),this.activeQuery){this.readyForQuery= !1,this.hasExecuted=!0;let e=this.activeQuery.submit(this.connection);e&&w.nextTick(()=>{this.activeQuery. handleError(e,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&& -(this.activeQuery=null,this.emit("drain"))}query(e,t,n){var i,s,o,u,c;if(e==null)throw new TypeError( +(this.activeQuery=null,this.emit("drain"))}query(e,t,n){var i,s,o,u,l;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 na(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");w.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)}), +connectionParameters.query_timeout,i=new na(e,t,n),i.callback||(s=new this._Promise((c,f)=>{i.callback= +(y,g)=>y?f(y):c(g)}))),o&&(l=i.callback,u=setTimeout(()=>{var c=new Error("Query read timeout");w.nextTick( +()=>{i.handleError(c,this.connection)}),l(c),i.callback=()=>{};var f=this.queryQueue.indexOf(i);f>-1&& +this.queryQueue.splice(f,1),this._pulseQueryQueue()},o),i.callback=(c,f)=>{clearTimeout(u),l(c,f)}), this.binary&&!i.binary&&(i.binary=!0),i._result&&!i._result._types&&(i._result._types=this._types),this. _queryable?this._ending?(w.nextTick(()=>{i.handleError(new Error("Client was closed and is not query\ able"),this.connection)}),s):(this.queryQueue.push(i),this._pulseQueryQueue(),s):(w.nextTick(()=>{i. @@ -1077,7 +1077,7 @@ 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(wi,"Client");var fr=wi;fr.Query=na;ia.exports=fr});var ca=P((Up,ua)=>{"use strict";p();var Cf=Be().EventEmitter,oa=a(function(){},"NOOP"),aa=a((r,e)=>{ +_Promise(t=>{this.connection.once("end",t)})}};a(wi,"Client");var fr=wi;fr.Query=na;ia.exports=fr});var la=P((Up,ua)=>{"use strict";p();var Cf=Be().EventEmitter,oa=a(function(){},"NOOP"),aa=a((r,e)=>{ let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),xi=class xi{constructor(e,t,n){ this.client=e,this.idleListener=t,this.timeoutId=n}};a(xi,"IdleItem");var gi=xi,Si=class Si{constructor(e){ this.callback=e}};a(Si,"PendingItem");var ct=Si;function If(){throw new Error("Release called on cli\ @@ -1107,8 +1107,8 @@ this._idle,n=>n.client===e);t!==void 0&&clearTimeout(t.timeoutId),this._clients= 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=hr(this.Promise,e),n=t. result;if(this._isFull()||this._idle.length){if(this._idle.length&&w.nextTick(()=>this._pulseQueue()), -!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new ct(t.callback)),n;let i=a((u,c,l)=>{ -clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new ct(i),o=setTimeout(()=>{aa(this._pendingQueue, +!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new ct(t.callback)),n;let i=a((u,l,c)=>{ +clearTimeout(o),t.callback(u,l,c)},"queueCallback"),s=new ct(i),o=setTimeout(()=>{aa(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 ct(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( @@ -1119,7 +1119,7 @@ clearTimeout(i),t.on("error",n),o)this.log("client failed to connect",o),this._c 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,oa);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 ct((l,f,y)=>y()), +_expired.add(t),this._idle.findIndex(c=>c.client===t)!==-1&&this._acquireClient(t,new ct((c,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. @@ -1135,14 +1135,14 @@ this.options.allowExitOnIdle&&s.unref()),this.options.allowExitOnIdle&&e.unref() e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=hr(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=hr(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){ +connect((s,o)=>{if(s)return n(s);let u=!1,l=a(c=>{u||(u=!0,o.release(c),n(c))},"onError");o.once("er\ +ror",l),this.log("dispatching query");try{o.query(e,t,(c,f)=>{if(this.log("query dispatched"),o.removeListener( +"error",l),!u)return u=!0,o.release(c),c?n(c):n(void 0,f)})}catch(c){return o.release(c),n(c)}}),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=hr(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(vi,"Pool");var bi=vi;ua.exports=bi});var la={};fe(la,{default:()=>Rf});var Rf,fa=te(()=>{"use strict";p();Rf={}});var ha=P((qp,Pf)=>{Pf.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javas\ +return this._clients.length}};a(vi,"Pool");var bi=vi;ua.exports=bi});var ca={};fe(ca,{default:()=>Rf});var Rf,fa=te(()=>{"use strict";p();Rf={}});var ha=P((qp,Pf)=>{Pf.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 ya=P((Qp,pa)=>{"use strict";p();var da=Be().EventEmitter,Bf=(Lt(),j(Bt)),Ei=Rt(),lt=pa.exports=function(r,e,t){ +a178655"}});var ya=P((Qp,pa)=>{"use strict";p();var da=Be().EventEmitter,Bf=(Lt(),j(Bt)),Ei=Pt(),ft=pa.exports=function(r,e,t){ da.call(this),r=Ei.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))};Bf.inherits(lt,da); +this.on("newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};Bf.inherits(ft,da); var Lf={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"\ -file",sourceLine:"line",sourceFunction:"routine"};lt.prototype.handleError=function(r){var e=this.native. +file",sourceLine:"line",sourceFunction:"routine"};ft.prototype.handleError=function(r){var e=this.native. pq.resultErrorFields();if(e)for(var t in e){var n=Lf[t]||t;r[n]=e[t]}this.callback?this.callback(r): -this.emit("error",r),this.state="error"};lt.prototype.then=function(r,e){return this._getPromise().then( -r,e)};lt.prototype.catch=function(r){return this._getPromise().catch(r)};lt.prototype._getPromise=function(){ +this.emit("error",r),this.state="error"};ft.prototype.then=function(r,e){return this._getPromise().then( +r,e)};ft.prototype.catch=function(r){return this._getPromise().catch(r)};ft.prototype._getPromise=function(){ return this._promise?this._promise:(this._promise=new Promise(function(r,e){this._once("end",r),this. -_once("error",e)}.bind(this)),this._promise)};lt.prototype.submit=function(r){this.state="running";var e=this; +_once("error",e)}.bind(this)),this._promise)};ft.prototype.submit=function(r){this.state="running";var e=this; this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a(function(s,o,u){if(r.native.arrayMode= !1,v(function(){e.emit("_done")}),s)return e.handleError(s);e._emitRowEvents&&(u.length>1?o.forEach( -(c,l)=>{c.forEach(f=>{e.emit("row",f,u[l])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="e\ +(l,c)=>{l.forEach(f=>{e.emit("row",f,u[c])})}):o.forEach(function(l){e.emit("row",l,u)})),e.state="e\ nd",e.emit("end",u),e.callback&&e.callback(null,u)},"after");if(w.domain&&(t=w.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\ @@ -1175,7 +1175,7 @@ red statements must be unique - '${this.name}' was used for a different statemen 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(Ei. -prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var ba=P(($p,ga)=>{"use strict";p();var Ff=(fa(),j(la)),Mf=Xt(),Hp=ha(),ma=Be().EventEmitter,kf=(Lt(),j(Bt)), +prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var ba=P(($p,ga)=>{"use strict";p();var Ff=(fa(),j(ca)),Mf=Xt(),Hp=ha(),ma=Be().EventEmitter,kf=(Lt(),j(Bt)), Uf=sr(),wa=ya(),se=ga.exports=function(r){ma.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. _types=new Mf(r.types),this.native=new Ff({types:this._types}),this._queryQueue=[],this._ending=!1,this. _connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Uf(r);this. @@ -1193,11 +1193,11 @@ _pulseQueryQueue(!0),r()})})};se.prototype.connect=function(r){if(r){this._conne _Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};se.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=="f\ unction")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 wa(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");w.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,w.nextTick(()=>{n.handleError( +e);else if(s=this.connectionParameters.query_timeout,n=new wa(r,e,t),!n.callback){let l,c;i=new this. +_Promise((f,y)=>{l=f,c=y}),n.callback=(f,y)=>f?c(f):l(y)}return s&&(u=n.callback,o=setTimeout(()=>{var l=new Error( +"Query read timeout");w.nextTick(()=>{n.handleError(l,this.connection)}),u(l),n.callback=()=>{};var c=this. +_queryQueue.indexOf(n);c>-1&&this._queryQueue.splice(c,1),this._pulseQueryQueue()},s),n.callback=(l,c)=>{ +clearTimeout(o),u(l,c)}),this._queryable?this._ending?(n.native=this.native,w.nextTick(()=>{n.handleError( new Error("Client was closed and is not queryable"))}),i):(this._queryQueue.push(n),this._pulseQueryQueue(), i):(n.native=this.native,w.nextTick(()=>{n.handleError(new Error("Client has encountered a connectio\ n error and is not queryable"))}),i)};se.prototype.end=function(r){var e=this;this._ending=!0,this._connected|| @@ -1210,34 +1210,34 @@ in");return}this._activeQuery=e,e.submit(this);var t=this;e.once("_done",functio se.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};se.prototype.ref=function(){}; se.prototype.unref=function(){};se.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( -r,e,t)};se.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var Ai=P((Kp,xa)=>{"use strict";p();xa.exports=ba()});var Mt=P((Yp,kt)=>{"use strict";p();var Df=sa(),Of=Tt(),Nf=yi(),qf=ca(),{DatabaseError:Qf}=hi(),jf=a( +r,e,t)};se.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var Ai=P((Kp,xa)=>{"use strict";p();xa.exports=ba()});var Mt=P((Yp,kt)=>{"use strict";p();var Df=sa(),Of=Rt(),Nf=yi(),qf=la(),{DatabaseError:Qf}=hi(),jf=a( r=>{var e;return e=class extends qf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),_i=a( function(r){this.defaults=Of,this.Client=r,this.Query=this.Client.Query,this.Pool=jf(this.Client),this. -_pools=[],this.Connection=Nf,this.types=_t(),this.DatabaseError=Qf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< +_pools=[],this.Connection=Nf,this.types=Ct(),this.DatabaseError=Qf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< "u"?kt.exports=new _i(Ai()):(kt.exports=new _i(Df),Object.defineProperty(kt.exports,"native",{configurable:!0, enumerable:!1,get(){var r=null;try{r=new _i(Ai())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. -defineProperty(kt.exports,"native",{value:r}),r}}))});var $f={};fe($f,{Client:()=>ft,DatabaseError:()=>ve.DatabaseError,NeonDbError:()=>ue,NeonQueryPromise:()=>Le, -Pool:()=>dr,SqlTemplate:()=>tt,UnsafeRawSql:()=>rt,_bundleExt:()=>Hf,defaults:()=>ve.defaults,escapeIdentifier:()=>ve.escapeIdentifier, -escapeLiteral:()=>ve.escapeLiteral,neon:()=>on,neonConfig:()=>be,types:()=>ve.types,warnIfBrowser:()=>bt}); -module.exports=j($f);p();p();Ye();Pr();p();var wu=Object.defineProperty,gu=Object.defineProperties,bu=Object.getOwnPropertyDescriptors,ls=Object. +defineProperty(kt.exports,"native",{value:r}),r}}))});var $f={};fe($f,{Client:()=>ht,DatabaseError:()=>ve.DatabaseError,NeonDbError:()=>ue,NeonQueryPromise:()=>Le, +Pool:()=>dr,SqlTemplate:()=>rt,UnsafeRawSql:()=>nt,_bundleExt:()=>Hf,defaults:()=>ve.defaults,escapeIdentifier:()=>ve.escapeIdentifier, +escapeLiteral:()=>ve.escapeLiteral,neon:()=>on,neonConfig:()=>be,types:()=>ve.types,warnIfBrowser:()=>xt}); +module.exports=j($f);p();p();Je();Pr();p();var wu=Object.defineProperty,gu=Object.defineProperties,bu=Object.getOwnPropertyDescriptors,cs=Object. getOwnPropertySymbols,xu=Object.prototype.hasOwnProperty,Su=Object.prototype.propertyIsEnumerable,fs=a( (r,e,t)=>e in r?wu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), -vu=a((r,e)=>{for(var t in e||(e={}))xu.call(e,t)&&fs(r,t,e[t]);if(ls)for(var t of ls(e))Su.call(e,t)&& +vu=a((r,e)=>{for(var t in e||(e={}))xu.call(e,t)&&fs(r,t,e[t]);if(cs)for(var t of cs(e))Su.call(e,t)&& fs(r,t,e[t]);return r},"__spreadValues"),Eu=a((r,e)=>gu(r,bu(e)),"__spreadProps"),Au=1008e3,hs=new Uint8Array( new Uint16Array([258]).buffer)[0]===2,_u=new TextDecoder,Br=new TextEncoder,Qt=Br.encode("0123456789\ abcdef"),jt=Br.encode("0123456789ABCDEF"),Cu=Br.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ -stuvwxyz0123456789+/");var ds=Cu.slice();ds[62]=45;ds[63]=95;var dt,Wt;function Iu(r,{alphabet:e,scratchArr:t}={}){if(!dt)if(dt= -new Uint16Array(256),Wt=new Uint16Array(256),hs)for(let C=0;C<256;C++)dt[C]=Qt[C&15]<<8|Qt[C>>>4],Wt[C]= -jt[C&15]<<8|jt[C>>>4];else for(let C=0;C<256;C++)dt[C]=Qt[C&15]|Qt[C>>>4]<<8,Wt[C]=jt[C&15]|jt[C>>>4]<< +stuvwxyz0123456789+/");var ds=Cu.slice();ds[62]=45;ds[63]=95;var pt,Wt;function Iu(r,{alphabet:e,scratchArr:t}={}){if(!pt)if(pt= +new Uint16Array(256),Wt=new Uint16Array(256),hs)for(let C=0;C<256;C++)pt[C]=Qt[C&15]<<8|Qt[C>>>4],Wt[C]= +jt[C&15]<<8|jt[C>>>4];else for(let C=0;C<256;C++)pt[C]=Qt[C&15]|Qt[C>>>4]<<8,Wt[C]=jt[C&15]|jt[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:dt,f=0,y=0,g;if(hs) -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>>8&255]<<16|c[g&255],l[y++]=c[g>>>24]<<16|c[g>>>16&255];else for(;f>>24]<<16|c[g>>>16&255],l[y++]=c[g>>>8&255]<<16|c[g&255];for(f<<=2;f>>1,s=Math. -ceil(n/i),o=new Uint16Array(s>1?i:n);for(let u=0;u1?i:n);for(let u=0;ut[pe(this. _mapKey.has(i)?this._mapKey.get(i):i)]=n),t}mapDecode(e,t){let n=this.decode(e);if(this._keyMap)switch(n. constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return _s( -()=>(qr(),this?this.decode(e,t):mt.prototype.decode.call(ws,e,t)));We=t>-1?t:e.length,h=0,Mr=0,wt=0, +()=>(qr(),this?this.decode(e,t):wt.prototype.decode.call(ws,e,t)));He=t>-1?t:e.length,h=0,Mr=0,gt=0, Gt=null,Fr=xs,W=null,x=e;try{X=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ throw x=null,e instanceof Uint8Array?n:new Error("Source must be a Uint8Array or Buffer but was a "+ -(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof mt){if(B=this,ne=this.sharedValues&& +(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof wt){if(B=this,ne=this.sharedValues&& (this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this. structures)return N=this.structures,Ht();(!N||N.length>0)&&(N=[])}else B=ws,(!N||N.length>0)&&(N=[]), -ne=null;return Ht()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;gt=!0;let o=this?this.decode(e, +ne=null;return Ht()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;bt=!0;let o=this?this.decode(e, s):jr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=W.postBundlePosition){let e=new Error("Unexpected bundle pos\ -ition");throw e.incomplete=!0,e}h=W.postBundlePosition,W=null}if(h==We)N=null,x=null,de&&(de=null);else if(h> -We){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!gt)throw new Error( +i=h,n.push(Ht());return n}}catch(s){throw s.lastPosition=i,s.values=n,s}finally{bt=!1,qr()}}};a(wt,"\ +Decoder");var Ur=wt;function Ht(){try{let r=L();if(W){if(h>=W.postBundlePosition){let e=new Error("Unexpected bundle pos\ +ition");throw e.incomplete=!0,e}h=W.postBundlePosition,W=null}if(h==He)N=null,x=null,de&&(de=null);else if(h> +He){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!bt)throw new Error( "Data read, but end of buffer not reached");return r}catch(r){throw qr(),(r instanceof RangeError||r. message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a(Ht,"checkedRead");function L(){ let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return ku();r=X. @@ -1269,27 +1269,27 @@ r;break;case 27:if(e==7){let t=X.getFloat64(h);return h+=8,t}if(e>1){if(X.getUin "JavaScript does not support arrays, maps, or strings with length over 4294967295");r=X.getUint32(h+ 4)}else B.int64AsNumber?(r=X.getUint32(h)*4294967296,r+=X.getUint32(h+4)):r=X.getBigUint64(h);h+=8;break;case 31: switch(e){case 2:case 3:throw new Error("Indefinite length not supported for byte or text strings");case 4: -let t=[],n,i=0;for(;(n=L())!=Je;){if(i>=pt)throw new Error(`Array length exceeds ${pt}`);t[i++]=n}return e== +let t=[],n,i=0;for(;(n=L())!=Ze;){if(i>=yt)throw new Error(`Array length exceeds ${yt}`);t[i++]=n}return e== 4?t:e==3?t.join(""):m.concat(t);case 5:let s;if(B.mapsAsObjects){let o={},u=0;if(B.keyMap)for(;(s=L())!= -Je;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[pe(B.decodeKey(s))]=L()}else for(;(s= -L())!=Je;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[pe(s)]=L()}return o}else{yt&& -(B.mapsAsObjects=!0,yt=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s=L())!=Je;){if(u++>=_e)throw new Error( -`Map size exceeds ${_e}`);o.set(B.decodeKey(s),L())}}else{let u=0;for(;(s=L())!=Je;){if(u++>=_e)throw new Error( -`Map size exceeds ${_e}`);o.set(s,L())}}return o}case 7:return Je;default:throw new Error("Invalid m\ +Ze;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[pe(B.decodeKey(s))]=L()}else for(;(s= +L())!=Ze;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[pe(s)]=L()}return o}else{mt&& +(B.mapsAsObjects=!0,mt=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s=L())!=Ze;){if(u++>=_e)throw new Error( +`Map size exceeds ${_e}`);o.set(B.decodeKey(s),L())}}else{let u=0;for(;(s=L())!=Ze;){if(u++>=_e)throw new Error( +`Map size exceeds ${_e}`);o.set(s,L())}}return o}case 7:return Ze;default:throw new Error("Invalid m\ ajor type for indefinite length "+e)}default:throw new Error("Unknown token "+r)}switch(e){case 0:return r;case 1: -return~r;case 2:return Mu(r);case 3:if(wt>=h)return Gt.slice(h-Vt,(h+=r)-Vt);if(wt==0&&We<140&&r<32){ -let i=r<16?vs(r):Fu(r);if(i!=null)return i}return Lu(r);case 4:if(r>=pt)throw new Error(`Array lengt\ -h exceeds ${pt}`);let t=new Array(r);for(let i=0;i=_e)throw new Error( -`Map size exceeds ${pt}`);if(B.mapsAsObjects){let i={};if(B.keyMap)for(let s=0;s=h)return Gt.slice(h-Vt,(h+=r)-Vt);if(gt==0&&He<140&&r<32){ +let i=r<16?vs(r):Fu(r);if(i!=null)return i}return Lu(r);case 4:if(r>=yt)throw new Error(`Array lengt\ +h exceeds ${yt}`);let t=new Array(r);for(let i=0;i=_e)throw new Error( +`Map size exceeds ${yt}`);if(B.mapsAsObjects){let i={};if(B.keyMap)for(let s=0;s=ys){let i=N[r&8191];if(i)return i.read||(i.read=Dr(i)),i.read();if(r<65536){if(r== -Bu){let s=Xe(),o=L(),u=L();Nr(o,u);let c={};if(B.keyMap)for(let l=2;l244||h>=t||(s&192)!==128||i===240&&s<144||i===244&&s>=144)n.push(65533);else if(h++,h>= t||(x[h]&192)!==128)n.push(65533);else{let o=x[h++]&63;if(h>=t||(x[h]&192)!==128)n.push(65533);else{ -let u=x[h++]&63,c=(i&7)<<18|(s&63)<<12|o<<6|u;c-=65536,n.push(c>>>10&1023|55296),n.push(56320|c&1023)}}}else +let u=x[h++]&63,l=(i&7)<<18|(s&63)<<12|o<<6|u;l-=65536,n.push(l>>>10&1023|55296),n.push(56320|l&1023)}}}else n.push(65533);n.length>=4096&&(e+=V.apply(String,n),n.length=0)}return n.length>0&&(e+=V.apply(String, n)),e}a(Or,"readStringJS");var V=String.fromCharCode;function Fu(r){let e=h,t=new Array(r);for(let n=0;n< r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return V.apply(String,t)}a(Fu,"longStringInJS"); @@ -1320,42 +1320,42 @@ let e=x[h++],t=x[h++];if((e&128)>0||(t&128)>0){h-=2;return}if(r<3)return V(e,t); (n&128)>0||(i&128)>0){h-=4;return}if(r<6){if(r===4)return V(e,t,n,i);{let s=x[h++];if((s&128)>0){h-= 5;return}return V(e,t,n,i,s)}}else if(r<8){let s=x[h++],o=x[h++];if((s&128)>0||(o&128)>0){h-=6;return} if(r<7)return V(e,t,n,i,s,o);let u=x[h++];if((u&128)>0){h-=7;return}return V(e,t,n,i,s,o,u)}else{let s=x[h++], -o=x[h++],u=x[h++],c=x[h++];if((s&128)>0||(o&128)>0||(u&128)>0||(c&128)>0){h-=8;return}if(r<10){if(r=== -8)return V(e,t,n,i,s,o,u,c);{let l=x[h++];if((l&128)>0){h-=9;return}return V(e,t,n,i,s,o,u,c,l)}}else if(r< -12){let l=x[h++],f=x[h++];if((l&128)>0||(f&128)>0){h-=10;return}if(r<11)return V(e,t,n,i,s,o,u,c,l,f); -let y=x[h++];if((y&128)>0){h-=11;return}return V(e,t,n,i,s,o,u,c,l,f,y)}else{let l=x[h++],f=x[h++],y=x[h++], -g=x[h++];if((l&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return V(e,t, -n,i,s,o,u,c,l,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E)}}else{ -let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return V(e,t,n,i,s,o,u,c,l,f,y,g, -E,C);let H=x[h++];if((H&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E,C,H)}}}}}a(vs,"short\ +o=x[h++],u=x[h++],l=x[h++];if((s&128)>0||(o&128)>0||(u&128)>0||(l&128)>0){h-=8;return}if(r<10){if(r=== +8)return V(e,t,n,i,s,o,u,l);{let c=x[h++];if((c&128)>0){h-=9;return}return V(e,t,n,i,s,o,u,l,c)}}else if(r< +12){let c=x[h++],f=x[h++];if((c&128)>0||(f&128)>0){h-=10;return}if(r<11)return V(e,t,n,i,s,o,u,l,c,f); +let y=x[h++];if((y&128)>0){h-=11;return}return V(e,t,n,i,s,o,u,l,c,f,y)}else{let c=x[h++],f=x[h++],y=x[h++], +g=x[h++];if((c&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return V(e,t, +n,i,s,o,u,l,c,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return V(e,t,n,i,s,o,u,l,c,f,y,g,E)}}else{ +let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return V(e,t,n,i,s,o,u,l,c,f,y,g, +E,C);let H=x[h++];if((H&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,l,c,f,y,g,E,C,H)}}}}}a(vs,"short\ StringInJS");function Mu(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( h,h+=r)}a(Mu,"readBin");var Es=new Float32Array(1),$t=new Uint8Array(Es.buffer,0,4);function ku(){let r=x[h++],e=x[h++],t=(r& 127)>>2;if(t===31)return e||r&3?NaN:r&128?-1/0:1/0;if(t===0){let n=((r&3)<<8|e)/16777216;return r&128? -n:n}return $t[3]=r&128|(t>>1)+56,$t[2]=(r&7)<<5|e>>3,$t[1]=e<<5,$t[0]=0,Es[0]}a(ku,"getFloat16");var hh=new Array( -4096);var Wr=class Wr{constructor(e,t){this.value=e,this.tag=t}};a(Wr,"Tag");var et=Wr;q[0]=r=>new Date(r); +4096);var Wr=class Wr{constructor(e,t){this.value=e,this.tag=t}};a(Wr,"Tag");var tt=Wr;q[0]=r=>new Date(r); q[1]=r=>new Date(Math.round(r*1e3));q[2]=r=>{let e=BigInt(0);for(let t=0,n=r.byteLength;tBigInt(-1)-q[2](r);q[4]=r=>+(r[1]+"e"+r[0]);q[5]=r=>r[1]*Math. exp(r[0]*Math.log(2));var Nr=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. restoreStructures=[]))[r]=t),N[r]=e,e.read=Dr(e)},"recordDefinition");q[Ru]=r=>{let e=r.length,t=r[1]; Nr(r[0],t);let n={};for(let i=2;iW?W[0].slice( -W.position0,W.position0+=r):new et(r,14);q[15]=r=>W?W[1].slice(W.position1,W.position1+=r):new et(r, +W.position0,W.position0+=r):new tt(r,14);q[15]=r=>W?W[1].slice(W.position1,W.position1+=r):new tt(r, 15);var Uu={Error,RegExp};q[27]=r=>(Uu[r[0]]||Error)(r[1],r[2]);var As=a(r=>{if(x[h++]!=132){let t=new Error( "Packed values structure must be followed by a 4 element array");throw x.length{if(!ne)if(B.getShared)Qr();else return new et( +r(),r()},"packedTable");As.handlesRead=!0;q[51]=As;q[ms]=r=>{if(!ne)if(B.getShared)Qr();else return new tt( r,ms);if(typeof r=="number")return ne[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ ger packed references yet");throw r===void 0&&(e.incomplete=!0),e};q[28]=r=>{de||(de=new Map,de.id=0); let e=de.id++,t=h,n=x[h],i;n>>5==4?i=[]:i={};let s={target:i};de.set(e,s);let o=r();return s.used?(Object. getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(h=t,i=o,de.set(e,{target:i}),o=r()),Object.assign(i,o)): (s.target=o,o)};q[28].handlesRead=!0;q[29]=r=>{let e=de.get(r);return e.used=!0,e.target};q[258]=r=>new Set( -r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,yt=!0),r())).handlesRead=!0;function Ze(r,e){return typeof r== -"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Ze,"combine");function je(){if(!ne) -if(B.getShared)Qr();else throw new Error("No packed values available");return ne}a(je,"getPackedValu\ -es");var Du=1399353956;kr.push((r,e)=>{if(r>=225&&r<=255)return Ze(je().prefixes[r-224],e);if(r>=28704&& -r<=32767)return Ze(je().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return Ze(je().prefixes[r- -1879048192],e);if(r>=216&&r<=223)return Ze(e,je().suffixes[r-216]);if(r>=27647&&r<=28671)return Ze(e, -je().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return Ze(e,je().suffixes[r-1811939328]);if(r== +r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,mt=!0),r())).handlesRead=!0;function Xe(r,e){return typeof r== +"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Xe,"combine");function We(){if(!ne) +if(B.getShared)Qr();else throw new Error("No packed values available");return ne}a(We,"getPackedValu\ +es");var Du=1399353956;kr.push((r,e)=>{if(r>=225&&r<=255)return Xe(We().prefixes[r-224],e);if(r>=28704&& +r<=32767)return Xe(We().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return Xe(We().prefixes[r- +1879048192],e);if(r>=216&&r<=223)return Xe(e,We().suffixes[r-216]);if(r>=27647&&r<=28671)return Xe(e, +We().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return Xe(e,We().suffixes[r-1811939328]);if(r== Du)return{packedValues:ne,structures:N.slice(0),version:e};if(r==55799)return e});var Ou=new Uint8Array( new Uint16Array([1]).buffer)[0]==1,bs=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> "u"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"? @@ -1366,24 +1366,24 @@ for(let r=0;r>s):new r(Uint8Array.prototype.slice.call(o,0).buffer)}: o=>{if(!r)throw new Error("Could not find typed array for code "+e);let u=new DataView(o.buffer,o.byteOffset, -o.byteLength),c=o.length>>s,l=new r(c),f=u[t];for(let y=0;y23)switch(r){case 24:r=x[h++];break;case 25:r=X.getUint16( -h),h+=2;break;case 26:r=X.getUint32(h),h+=4;break}return r}a(Xe,"readJustLength");function Qr(){if(B. +o.byteLength),l=o.length>>s,c=new r(l),f=u[t];for(let y=0;y23)switch(r){case 24:r=x[h++];break;case 25:r=X.getUint16( +h),h+=2;break;case 26:r=X.getUint32(h),h+=4;break}return r}a(et,"readJustLength");function Qr(){if(B. getShared){let r=_s(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ne= B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(Qr, -"loadShared");function _s(r){let e=We,t=h,n=Mr,i=Vt,s=wt,o=Gt,u=Fr,c=de,l=W,f=new Uint8Array(x.slice( -0,We)),y=N,g=B,E=gt,C=r();return We=e,h=t,Mr=n,Vt=i,wt=s,Gt=o,Fr=u,de=c,W=l,x=f,gt=E,N=y,B=g,X=new DataView( +"loadShared");function _s(r){let e=He,t=h,n=Mr,i=Vt,s=gt,o=Gt,u=Fr,l=de,c=W,f=new Uint8Array(x.slice( +0,He)),y=N,g=B,E=bt,C=r();return He=e,h=t,Mr=n,Vt=i,gt=s,Gt=o,Fr=u,de=l,W=c,x=f,bt=E,N=y,B=g,X=new DataView( x.buffer,x.byteOffset,x.byteLength),C}a(_s,"saveState");function qr(){x=null,de=null,N=null}a(qr,"cl\ earSource");var Cs=new Array(147);for(let r=0;r<256;r++)Cs[r]=+("1e"+Math.floor(45.15-r*.30103));var jr=new Ur({ useRecords:!1}),dh=jr.decode,Is=jr.decodeMultiple;p();var Kt=class Kt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ let{strings:t,values:n}=this;for(let i=0,s=t.length;iu.length!==0).map(u=>JSON.parse(u)):Is(new Uint8Array(await r.arrayBuffer())),i=n.at(-1); if(!Array.isArray(i)||i[0]!==3&&i[0]!==4)throw new ue("Neon internal error: streamed response ended \ without a terminal message");if(i[0]===4&&i.length===2&&i[1]!==null&&typeof i[1]=="object")throw po( i[1]);if(i[0]!==3||i.length!==1)throw new ue("Neon internal error: unexpected streamed response stat\ -us");let s=[],o;for(let u of n.slice(0,-1)){Array.isArray(u)||Pt();let[c,...l]=u;switch(c){case Jc:o!== -void 0&&Pt(),o={fields:l,rows:[]};break;case Yc:o===void 0&&Pt(),o.rows.push(l);break;case Zc:(o===void 0|| -l.length!==2)&&Pt(),s.push({fields:o.fields,rows:o.rows,command:l[0],rowCount:l[1]}),o=void 0;break;default: -Pt()}}if(o!==void 0||!t&&s.length!==1)throw new ue("Neon internal error: incomplete streamed respons\ -e");return t?{results:s}:s[0]}a(Xc,"readStreamingResult");function el(r){return r instanceof m?"\\x"+ -ps(r):r}a(el,"encodeBuffersAsBytea");function co(r){let{query:e,params:t}=r instanceof tt?r.toParameterizedQuery(): -r;return{query:e,params:t.map(n=>el((0,ho.prepareValue)(n)))}}a(co,"prepareQuery");function on(r,{arrayMode:e, -fullResults:t,fetchOptions:n,responseFormat:i,isolationLevel:s,readOnly:o,deferrable:u,authToken:c,disableWarningInBrowsers:l}={}){ -if(!r)throw new Error("No database connection string was provided to `neon()`. Perhaps an environmen\ -t variable has not been set?");let f;try{f=Rr(r)}catch{throw new Error("Database connection string p\ -rovided to `neon()` is not a valid URL. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E, -port:C,pathname:H}=f;if(y!=="postgres:"&&y!=="postgresql:"||!g||!E||!H)throw new Error("Database con\ -nection string format for `neon()` should be: postgresql://user@host.tld/dbname?option=value");function Y(T,...b){ -if(!(Array.isArray(T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can no\ -w be called only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], \ -options). For a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SE\ -LECT $1", [value], options).');return new Le(we,new tt(T,b))}a(Y,"templateFn"),Y.query=(T,b,M)=>new Le( -we,{query:T,params:b??[]},M),Y.unsafe=T=>new rt(T),Y.transaction=async(T,b)=>{if(typeof T=="function"&& -(T=T(Y)),!Array.isArray(T))throw new Error(uo);T.forEach($=>{if(!($ instanceof Le))throw new Error(uo)}); -let M=T.map($=>$.queryData),oe=T.map($=>$.opts??{});return we(M,oe,b)};async function we(T,b,M){let{ -fetchEndpoint:oe,fetchFunction:$}=be,ge=Array.isArray(T),Ie=ge?{queries:T.map(le=>co(le))}:co(T),ce=n?? -{},F=i??"json",J=e??!1,Ee=t??!1,Te=s,ke=o,Ue=u;M!==void 0&&(M.fetchOptions!==void 0&&(ce={...ce,...M. -fetchOptions}),M.arrayMode!==void 0&&(J=M.arrayMode),M.fullResults!==void 0&&(Ee=M.fullResults),M.responseFormat!== -void 0&&(F=M.responseFormat),M.isolationLevel!==void 0&&(Te=M.isolationLevel),M.readOnly!==void 0&&(ke= -M.readOnly),M.deferrable!==void 0&&(Ue=M.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!== -void 0&&(ce={...ce,...b.fetchOptions}),b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(F= -b.responseFormat);let De=c;!Array.isArray(b)&&b?.authToken!==void 0&&(De=b.authToken);let pr=typeof oe== -"function"?oe(E,C,{jwtAuth:De!==void 0}):oe,Oe={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ -rue","Neon-Array-Mode":"true",Accept:zc[F]},Re=await tl(De);Re&&(Oe.Authorization=`Bearer ${Re}`),ge&& -(Te!==void 0&&(Oe["Neon-Batch-Isolation-Level"]=Te),ke!==void 0&&(Oe["Neon-Batch-Read-Only"]=String( -ke)),Ue!==void 0&&(Oe["Neon-Batch-Deferrable"]=String(Ue))),l||be.disableWarningInBrowsers||bt();let Z; -try{Z=await($??fetch)(pr,{method:"POST",body:JSON.stringify(Ie),headers:Oe,...ce})}catch(le){let ae=new ue( -`Error connecting to database: ${le}`);throw ae.sourceError=le,ae}if(Z.ok){let le=F==="json"?await Z. -json():await Xc(Z,F,ge);if(ge){let ae=le.results;if(!Array.isArray(ae))throw new ue("Neon internal e\ -rror: unexpected result format");return ae.map((yr,mr)=>{let wr=b[mr]??{},Aa=wr.arrayMode??J,_a=wr.fullResults?? -Ee;return lo(yr,{arrayMode:Aa,fullResults:_a,types:wr.types})})}else{let ae=b??{},yr=ae.arrayMode??J, -mr=ae.fullResults??Ee;return lo(le,{arrayMode:yr,fullResults:mr,types:ae.types})}}else{let{status:le}=Z; -if(le===400){let ae=await Z.json();throw po(ae)}else{let ae=await Z.text();throw new ue(`Server erro\ -r (HTTP status ${le}): ${ae}`)}}}return a(we,"execute"),Y}a(on,"neon");var an=class an{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(an,"NeonQueryPromise");var Le=an;function lo(r,{arrayMode:e, -fullResults:t,types:n}){let i=new fo.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(lo,"processQueryResult");async function tl(r){if(typeof r=="string")return r;if(typeof r== -"function")try{return await Promise.resolve(r())}catch(e){let t=new ue("Error getting auth token."); -throw e instanceof Error&&(t=new ue(`Error getting auth token: ${e.message}`)),t}}a(tl,"getAuthToken");p();var va=Ne(Mt());p();var Sa=Ne(Mt());var Ci=class Ci extends Sa.Client{constructor(t){super(t);this.config=t}get neonConfig(){return this. +us");let s=[],o;for(let u of n.slice(0,-1)){Array.isArray(u)||Fe();let[l,...c]=u;switch(l){case Jl:o!== +void 0&&Fe(),o={fields:c,rows:[]};break;case Yl:(o===void 0||c.length===0)&&Fe();let f=o.row??(o.row= +[]);for(let[y,g]of c.entries()){if((f.length>=o.fields.length||Array.isArray(g)&&(g.length!==1||typeof g[0]!= +"string")||!Array.isArray(g)&&g!==null&&typeof g!="string")&&Fe(),Array.isArray(g)){(o.partialText?? +(o.partialText=[])).push(g[0]);continue}g===null?(o.partialText!==void 0&&Fe(),f.push(null)):(o.partialText=== +void 0?f.push(g):(o.partialText.push(g),f.push(o.partialText.join(""))),o.partialText=void 0),f.length=== +o.fields.length&&(y!==c.length-1&&Fe(),o.rows.push(f),o.row=void 0)}break;case Zl:(o===void 0||o.row!== +void 0||o.partialText!==void 0||c.length!==2)&&Fe(),s.push({fields:o.fields,rows:o.rows,command:c[0], +rowCount:c[1]}),o=void 0;break;default:Fe()}}if(o!==void 0||!t&&s.length!==1)throw new ue("Neon inte\ +rnal error: incomplete streamed response");return t?{results:s}:s[0]}a(Xl,"readStreamingResult");function ec(r){ +return r instanceof m?"\\x"+ps(r):r}a(ec,"encodeBuffersAsBytea");function lo(r){let{query:e,params:t}=r instanceof +rt?r.toParameterizedQuery():r;return{query:e,params:t.map(n=>ec((0,ho.prepareValue)(n)))}}a(lo,"prep\ +areQuery");function on(r,{arrayMode:e,fullResults:t,fetchOptions:n,responseFormat:i,isolationLevel:s, +readOnly:o,deferrable:u,authToken:l,disableWarningInBrowsers:c}={}){if(!r)throw new Error("No databa\ +se connection string was provided to `neon()`. Perhaps an environment variable has not been set?");let f; +try{f=Rr(r)}catch{throw new Error("Database connection string provided to `neon()` is not a valid UR\ +L. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E,port:C,pathname:H}=f;if(y!== +"postgres:"&&y!=="postgresql:"||!g||!E||!H)throw new Error("Database connection string format for `n\ +eon()` should be: postgresql://user@host.tld/dbname?option=value");function Y(T,...b){if(!(Array.isArray( +T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can now be called only as\ + a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], options). For a con\ +ventional function call with value placeholders ($1, $2, etc.), use sql.query("SELECT $1", [value], \ +options).');return new Le(we,new rt(T,b))}a(Y,"templateFn"),Y.query=(T,b,M)=>new Le(we,{query:T,params:b?? +[]},M),Y.unsafe=T=>new nt(T),Y.transaction=async(T,b)=>{if(typeof T=="function"&&(T=T(Y)),!Array.isArray( +T))throw new Error(uo);T.forEach($=>{if(!($ instanceof Le))throw new Error(uo)});let M=T.map($=>$.queryData), +oe=T.map($=>$.opts??{});return we(M,oe,b)};async function we(T,b,M){let{fetchEndpoint:oe,fetchFunction:$}=be, +ge=Array.isArray(T),Ie=ge?{queries:T.map(ce=>lo(ce))}:lo(T),le=n??{},F=i??"json",J=e??!1,Ee=t??!1,Te=s, +Ue=o,De=u;M!==void 0&&(M.fetchOptions!==void 0&&(le={...le,...M.fetchOptions}),M.arrayMode!==void 0&& +(J=M.arrayMode),M.fullResults!==void 0&&(Ee=M.fullResults),M.responseFormat!==void 0&&(F=M.responseFormat), +M.isolationLevel!==void 0&&(Te=M.isolationLevel),M.readOnly!==void 0&&(Ue=M.readOnly),M.deferrable!== +void 0&&(De=M.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!==void 0&&(le={...le,...b.fetchOptions}), +b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(F=b.responseFormat);let Oe=l;!Array.isArray( +b)&&b?.authToken!==void 0&&(Oe=b.authToken);let pr=typeof oe=="function"?oe(E,C,{jwtAuth:Oe!==void 0}): +oe,Ne={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"true","Neon-Array-Mode":"true",Accept:zl[F]}, +Re=await tc(Oe);Re&&(Ne.Authorization=`Bearer ${Re}`),ge&&(Te!==void 0&&(Ne["Neon-Batch-Isolation-Le\ +vel"]=Te),Ue!==void 0&&(Ne["Neon-Batch-Read-Only"]=String(Ue)),De!==void 0&&(Ne["Neon-Batch-Deferrab\ +le"]=String(De))),c||be.disableWarningInBrowsers||xt();let Z;try{Z=await($??fetch)(pr,{method:"POST", +body:JSON.stringify(Ie),headers:Ne,...le})}catch(ce){let ae=new ue(`Error connecting to database: ${ce}`); +throw ae.sourceError=ce,ae}if(Z.ok){let ce=F==="json"?await Z.json():await Xl(Z,F,ge);if(ge){let ae=ce. +results;if(!Array.isArray(ae))throw new ue("Neon internal error: unexpected result format");return ae. +map((yr,mr)=>{let wr=b[mr]??{},Aa=wr.arrayMode??J,_a=wr.fullResults??Ee;return co(yr,{arrayMode:Aa,fullResults:_a, +types:wr.types})})}else{let ae=b??{},yr=ae.arrayMode??J,mr=ae.fullResults??Ee;return co(ce,{arrayMode:yr, +fullResults:mr,types:ae.types})}}else{let{status:ce}=Z;if(ce===400){let ae=await Z.json();throw po(ae)}else{ +let ae=await Z.text();throw new ue(`Server error (HTTP status ${ce}): ${ae}`)}}}return a(we,"execute"), +Y}a(on,"neon");var an=class an{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(an,"Neon\ +QueryPromise");var Le=an;function co(r,{arrayMode:e,fullResults:t,types:n}){let i=new fo.default(n), +s=r.fields.map(l=>l.name),o=r.fields.map(l=>i.getTypeParser(l.dataTypeID)),u=e===!0?r.rows.map(l=>l. +map((c,f)=>c===null?null:o[f](c))):r.rows.map(l=>Object.fromEntries(l.map((c,f)=>[s[f],c===null?null: +o[f](c)])));return t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=u,r._parsers=o,r._types=i,r):u}a(co,"p\ +rocessQueryResult");async function tc(r){if(typeof r=="string")return r;if(typeof r=="function")try{ +return await Promise.resolve(r())}catch(e){let t=new ue("Error getting auth token.");throw e instanceof +Error&&(t=new ue(`Error getting auth token: ${e.message}`)),t}}a(tc,"getAuthToken");p();var va=qe(Mt());p();var Sa=qe(Mt());var Ci=class Ci extends Sa.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\ @@ -1475,44 +1481,44 @@ s&&this.database===s&&this.password===null)throw new Error(`No database host or 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){ +l=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let c=this.connection;if(u&&c.on( +"connect",()=>c.stream.emit("data","S")),l){c.removeAllListeners("authenticationCleartextPassword"), +c.removeAllListeners("readyForQuery"),c.once("readyForQuery",()=>c.on("readyForQuery",this._handleReadyForQuery. +bind(this)));let f=this.ssl?"sslconnect":"connect";c.on(f,()=>{this.neonConfig.disableWarningInBrowsers|| +xt(),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(Re=>{if(!/^.=/.test(Re))throw new Error( -"SASL: Invalid attribute pair entry");let Z=Re[0],le=Re.substring(2);return[Z,le]})),c=u.r,l=u.s,f=u. -i;if(!c||!/^[!-+--~]+$/.test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unp\ -rintable");if(!l||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(l))throw new Error( +"SASL: Invalid attribute pair entry");let Z=Re[0],ce=Re.substring(2);return[Z,ce]})),l=u.r,c=u.s,f=u. +i;if(!l||!/^[!-+--~]+$/.test(l))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unp\ +rintable");if(!c||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(c))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. +"SASL: SCRAM-SERVER-FIRST-MESSAGE: missing/invalid iteration count");if(!l.startsWith(i.clientNonce)) +throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");if(l. length===i.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too\ - short");let y=parseInt(f,10),g=m.from(l,"base64"),E=new TextEncoder,C=E.encode(s),H=await n.importKey( + short");let y=parseInt(f,10),g=m.from(c,"base64"),E=new TextEncoder,C=E.encode(s),H=await n.importKey( "raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Y=new Uint8Array(await n.sign("HMAC",H,m.concat( [g,m.from([0,0,0,1])]))),we=Y;for(var T=0;Twe[Z]^Y[Z]));let b=we,M=await n.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-2\ 56"}},!1,["sign"]),oe=new Uint8Array(await n.sign("HMAC",M,E.encode("Client Key"))),$=await n.digest( -"SHA-256",oe),ge="n=*,r="+i.clientNonce,Ie="r="+c+",s="+l+",i="+y,ce="c=biws,r="+c,F=ge+","+Ie+","+ce, +"SHA-256",oe),ge="n=*,r="+i.clientNonce,Ie="r="+l+",s="+c+",i="+y,le="c=biws,r="+l,F=ge+","+Ie+","+le, J=await n.importKey("raw",$,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Ee=new Uint8Array(await n. -sign("HMAC",J,E.encode(F))),Te=m.from(oe.map((Re,Z)=>oe[Z]^Ee[Z])),ke=Te.toString("base64");let Ue=await n. -importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),De=await n.sign("HMAC",Ue,E.encode( -"Server Key")),pr=await n.importKey("raw",De,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Oe=m. -from(await n.sign("HMAC",pr,E.encode(F)));i.message="SASLResponse",i.serverSignature=Oe.toString("ba\ -se64"),i.response=ce+",p="+ke,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; -a(Ci,"NeonClient");var ft=Ci;Ye();var Ea=Ne(sr());function Wf(r,e){if(e)return{callback:e,result:void 0};let t,n,i=a(function(o,u){o?t(o):n(u)},"cb"), +sign("HMAC",J,E.encode(F))),Te=m.from(oe.map((Re,Z)=>oe[Z]^Ee[Z])),Ue=Te.toString("base64");let De=await n. +importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Oe=await n.sign("HMAC",De,E.encode( +"Server Key")),pr=await n.importKey("raw",Oe,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Ne=m. +from(await n.sign("HMAC",pr,E.encode(F)));i.message="SASLResponse",i.serverSignature=Ne.toString("ba\ +se64"),i.response=le+",p="+Ue,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; +a(Ci,"NeonClient");var ht=Ci;Je();var Ea=qe(sr());function Wf(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(Wf,"promisify");var Ii=class Ii extends va.Pool{constructor(){ -super(...arguments);I(this,"Client",ft);I(this,"hasFetchUnsupportedListeners",!1);I(this,"addListene\ +super(...arguments);I(this,"Client",ht);I(this,"hasFetchUnsupportedListeners",!1);I(this,"addListene\ r",this.on)}on(t,n){return t!=="error"&&(this.hasFetchUnsupportedListeners=!0),super.on(t,n)}query(t,n,i){ if(!be.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof t=="function")return super.query( t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=Wf(this.Promise,i);i=s.callback;try{let o=new Ea.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??[];on(l,{fullResults:!0,arrayMode:t. +this.options),u=encodeURIComponent,l=encodeURI,c=`postgresql://${u(o.user)}:${u(o.password)}@${u(o.host)}\ +/${l(o.database)}`,f=typeof t=="string"?t:t.text,y=n??t.values??[];on(c,{fullResults:!0,arrayMode:t. rowMode==="array"}).query(f,y,{types:t.types??this.options?.types}).then(E=>i(void 0,E)).catch(E=>i( -E))}catch(o){i(o)}return s.result}};a(Ii,"NeonPool");var dr=Ii;Ye();var ve=Ne(Mt()),Hf="js"; +E))}catch(o){i(o)}return s.result}};a(Ii,"NeonPool");var dr=Ii;Je();var ve=qe(Mt()),Hf="js"; /*! Bundled license information: ieee754/index.js: diff --git a/index.mjs b/index.mjs index 4ebade4..8e804cb 100644 --- a/index.mjs +++ b/index.mjs @@ -1,33 +1,33 @@ /* @ts-self-types="./index.d.mts" */ -var Ca=Object.create;var We=Object.defineProperty;var Ia=Object.getOwnPropertyDescriptor;var Ta=Object.getOwnPropertyNames;var Ra=Object.getPrototypeOf,Pa=Object.prototype.hasOwnProperty;var Ba=(r,e,t)=>e in r?We(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>We(r,"name",{value:e,configurable:!0});var te=(r,e)=>()=>(r&&(e=r(r=0)),e);var P=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ge=(r,e)=>{for(var t in e)We(r,t,{get:e[t], +var Ca=Object.create;var He=Object.defineProperty;var Ia=Object.getOwnPropertyDescriptor;var Ta=Object.getOwnPropertyNames;var Ra=Object.getPrototypeOf,Pa=Object.prototype.hasOwnProperty;var Ba=(r,e,t)=>e in r?He(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>He(r,"name",{value:e,configurable:!0});var te=(r,e)=>()=>(r&&(e=r(r=0)),e);var P=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ge=(r,e)=>{for(var t in e)He(r,t,{get:e[t], enumerable:!0})},Ii=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ta(e))!Pa. -call(r,i)&&i!==t&&We(r,i,{get:()=>e[i],enumerable:!(n=Ia(e,i))||n.enumerable});return r};var De=(r,e,t)=>(t=r!=null?Ca(Ra(r)):{},Ii(e||!r||!r.__esModule?We(t,"default",{value:r,enumerable:!0}): -t,r)),$=r=>Ii(We({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Ba(r,typeof e!="symbol"?e+"":e,t);var Pi=P(kt=>{"use strict";p();kt.byteLength=Fa;kt.toByteArray=ka;kt.fromByteArray=Oa;var be=[],le=[], +call(r,i)&&i!==t&&He(r,i,{get:()=>e[i],enumerable:!(n=Ia(e,i))||n.enumerable});return r};var Oe=(r,e,t)=>(t=r!=null?Ca(Ra(r)):{},Ii(e||!r||!r.__esModule?He(t,"default",{value:r,enumerable:!0}): +t,r)),$=r=>Ii(He({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Ba(r,typeof e!="symbol"?e+"":e,t);var Pi=P(kt=>{"use strict";p();kt.byteLength=Fa;kt.toByteArray=ka;kt.fromByteArray=Oa;var be=[],ce=[], La=typeof Uint8Array<"u"?Uint8Array:Array,wr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ -23456789+/";for(Oe=0,Ti=wr.length;Oe0)throw new Error("Invalid string. Length must be \ +23456789+/";for(Ne=0,Ti=wr.length;Ne0)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(Ri,"getLens"); function Fa(r){var e=Ri(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Fa,"byteLength");function Ma(r,e,t){return(e+ t)*3/4-t}a(Ma,"_byteLength");function ka(r){var e,t=Ri(r),n=t[0],i=t[1],s=new La(Ma(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=le[r.charCodeAt( -c)]<<2|le[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=le[r.charCodeAt(c)]<<10|le[r.charCodeAt(c+1)]<< -4|le[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(ka,"toByteArray");function Ua(r){return be[r>> +0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=ce[r.charCodeAt( +l)]<<2|ce[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=ce[r.charCodeAt(l)]<<10|ce[r.charCodeAt(l+1)]<< +4|ce[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(ka,"toByteArray");function Ua(r){return be[r>> 18&63]+be[r>>12&63]+be[r>>6&63]+be[r&63]}a(Ua,"tripletToBase64");function Da(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(Ua(n));return i.join("")}a(Da,"en\ codeChunk");function Oa(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(be[e>>2]+be[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1], -i.push(be[e>>10]+be[e>>4&63]+be[e<<2&63]+"=")),i.join("")}a(Oa,"fromByteArray")});var Bi=P(gr=>{p();gr.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(be[e>>10]+be[e>>4&63]+be[e<<2&63]+"=")),i.join("")}a(Oa,"fromByteArray")});var Bi=P(gr=>{p();gr.read=function(r,e,t,n,i){var s,o,u=i*8-n-1,l=(1<>1,f=-7,y=t?i-1:0,g=t? -1:1,E=r[e+y];for(y+=g,s=E&(1<<-f)-1,E>>=-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:(E?-1:1)*(1/0);o=o+Math. -pow(2,n),s=s-l}return(E?-1:1)*o*Math.pow(2,s-n)};gr.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,E=n?0:s-1,C=n?1:-1,W=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+E]=u&255,E+= -C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=W*128}});var Ki=P(Ve=>{"use strict";p();var br=Pi(),$e=Bi(),Li=typeof Symbol=="function"&&typeof Symbol.for== -"function"?Symbol.for("nodejs.util.inspect.custom"):null;Ve.Buffer=d;Ve.SlowBuffer=Ha;Ve.INSPECT_MAX_BYTES= -50;var Ut=2147483647;Ve.kMaxLength=Ut;d.TYPED_ARRAY_SUPPORT=Na();!d.TYPED_ARRAY_SUPPORT&&typeof console< +-f,f+=n;f>0;o=o*256+r[e+y],y+=g,f-=8);if(s===0)s=1-c;else{if(s===l)return o?NaN:(E?-1:1)*(1/0);o=o+Math. +pow(2,n),s=s-c}return(E?-1:1)*o*Math.pow(2,s-n)};gr.write=function(r,e,t,n,i,s){var o,u,l,c=s*8-i-1, +f=(1<>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:s-1,C=n?1:-1,W=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*(l= +Math.pow(2,-o))<1&&(o--,l*=2),o+y>=1?e+=g/l:e+=g*Math.pow(2,1-y),e*l>=2&&(o++,l/=2),o+y>=f?(u=0,o=f): +o+y>=1?(u=(e*l-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+E]=u&255,E+= +C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,c-=8);r[t+E-C]|=W*128}});var Ki=P(Ke=>{"use strict";p();var br=Pi(),Ge=Bi(),Li=typeof Symbol=="function"&&typeof Symbol.for== +"function"?Symbol.for("nodejs.util.inspect.custom"):null;Ke.Buffer=d;Ke.SlowBuffer=Ha;Ke.INSPECT_MAX_BYTES= +50;var Ut=2147483647;Ke.kMaxLength=Ut;d.TYPED_ARRAY_SUPPORT=Na();!d.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 Na(){ try{let r=new Uint8Array(1),e={foo:a(function(){return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array. @@ -90,25 +90,25 @@ let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length) tf8":case"utf-8":return qi(this,e,t);case"ascii":return Xa(this,e,t);case"latin1":case"binary":return eu( this,e,t);case"base64":return Ja(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ru( this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a($a, -"slowToString");d.prototype._isBuffer=!0;function Ne(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(Ne,"swap"); +"slowToString");d.prototype._isBuffer=!0;function qe(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(qe,"swap"); d.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");Li&&(d.prototype[Li]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ if(xe(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.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;y>>=0,n>>>=0,i>>>=0,s>>>=0,this===e)return 0;let o=s-i,u=n-t,l=Math.min(o,u),c=this.slice( +i,s),f=e.slice(t,n);for(let y=0;y2147483647? t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Cr(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=d.from( @@ -117,10 +117,10 @@ prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Ar call(r,e,t):Fi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Ni,"bidire\ ctionalIndexOf");function Fi(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;yo&&(t=o-u),c=t;c>=0;c--){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= @@ -139,10 +139,10 @@ if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}}," toJSON=a(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSO\ N");function Ja(r,e,t){return e===0&&t===r.length?br.fromByteArray(r):br.fromByteArray(r.slice(e,t))} a(Ja,"base64Slice");function qi(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&& +u=s>239?4:s>223?3:s>191?2:1;if(i+u<=t){let l,c,f,y;switch(u){case 1:s<128&&(o=s);break;case 2:l=r[i+ +1],(l&192)===128&&(y=(s&31)<<6|l&63,y>127&&(o=y));break;case 3:l=r[i+1],c=r[i+2],(l&192)===128&&(c&192)=== +128&&(y=(s&15)<<12|(l&63)<<6|c&63,y>2047&&(y<55296||y>57343)&&(o=y));break;case 4:l=r[i+1],c=r[i+2], +f=r[i+3],(l&192)===128&&(c&192)===128&&(f&192)===128&&(y=(s&15)<<18|(l&63)<<12|(c&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 Za(n)}a(qi,"utf8Slice");var Mi=4096;function Za(r){let e=r.length;if(e<=Mi)return String. fromCharCode.apply(String,r);let t="",n=0;for(;n>>0,t||G(e,2,this.length),this[e]<<8|this[e+1]},"read readUint32LE=d.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),(this[e]| this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");d.prototype.readUint32BE=d.prototype. readUInt32BE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+ -2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Re(a(function(e){e=e>>>0,Ge(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ut(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* +2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Re(a(function(e){e=e>>>0,Ve(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&<(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* 2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<< -BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Re(a(function(e){e=e>>>0,Ge(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ut(e,this.length-8);let i=t*2**24+this[++e]*2**16+ +BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Re(a(function(e){e=e>>>0,Ve(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&<(e,this.length-8);let i=t*2**24+this[++e]*2**16+ this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<>>0,t=t>>>0,n||G(e,t, this.length);let i=this[e],s=1,o=0;for(;++o=s&&(i-=Math. @@ -183,16 +183,16 @@ a(function(e,t){e=e>>>0,t||G(e,2,this.length);let n=this[e+1]|this[e]<<8;return n},"readInt16BE");d.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]| this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");d.prototype.readInt32BE=a(function(e,t){return e= e>>>0,t||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");d.prototype. -readBigInt64LE=Re(a(function(e){e=e>>>0,Ge(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& -ut(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,Ve(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& +lt(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,Ge(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ut(e,this. +Re(a(function(e){e=e>>>0,Ve(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&<(e,this. length-8);let i=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,t||G(e,4,this.length),$e.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= -a(function(e,t){return e=e>>>0,t||G(e,4,this.length),$e.read(this,e,!1,23,4)},"readFloatBE");d.prototype. -readDoubleLE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),$e.read(this,e,!0,52,8)},"readDoub\ -leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),$e.read(this,e, +return e=e>>>0,t||G(e,4,this.length),Ge.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= +a(function(e,t){return e=e>>>0,t||G(e,4,this.length),Ge.read(this,e,!1,23,4)},"readFloatBE");d.prototype. +readDoubleLE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ge.read(this,e,!0,52,8)},"readDoub\ +leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ge.read(this,e, !1,52,8)},"readDoubleBE");function re(r,e,t,n,i,s){if(!d.isBuffer(r))throw new TypeError('"buffer" a\ rgument must be a Buffer instance');if(e>i||er.length)throw new RangeError("Index out of range")}a(re,"checkInt");d.prototype.writeUintLE= @@ -217,9 +217,9 @@ 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(ji,"wrtBigUI writeBigUInt64LE=Re(a(function(e,t=0){return Qi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Re(a(function(e,t=0){return ji(this,e,t,BigInt(0),BigInt( "0xffffffffffffffff"))},"writeBigUInt64BE"));d.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>> -0,!i){let c=Math.pow(2,8*n-1);re(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");d.prototype.writeIntBE= -a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*n-1);re(this,e,t,n,c-1,-c)}let s=n-1,o=1, +a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let l=Math.pow(2,8*n-1);re(this,e,t,n,l-1,-l)}let s=n-1,o=1, u=0;for(this[t+s]=e&255;--s>=0&&(o*=256);)e<0&&u===0&&this[t+s+1]!==0&&(u=1),this[t+s]=(e/o>>0)-u&255; return t+n},"writeIntBE");d.prototype.writeInt8=a(function(e,t,n){return e=+e,t=t>>>0,n||re(this,e,t, 1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");d.prototype.writeInt16LE=a(function(e,t,n){ @@ -234,10 +234,10 @@ this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigI writeBigInt64BE=Re(a(function(e,t=0){return ji(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ ffffffffffff"))},"writeBigInt64BE"));function Wi(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(Wi,"checkIEEE754");function Hi(r,e,t,n,i){ -return e=+e,t=t>>>0,i||Wi(r,e,t,4,34028234663852886e22,-34028234663852886e22),$e.write(r,e,t,n,23,4), +return e=+e,t=t>>>0,i||Wi(r,e,t,4,34028234663852886e22,-34028234663852886e22),Ge.write(r,e,t,n,23,4), t+4}a(Hi,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return Hi(this,e,t,!0,n)},"writeFl\ oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return Hi(this,e,t,!1,n)},"writeFloatBE");function $i(r,e,t,n,i){ -return e=+e,t=t>>>0,i||Wi(r,e,t,8,17976931348623157e292,-17976931348623157e292),$e.write(r,e,t,n,52, +return e=+e,t=t>>>0,i||Wi(r,e,t,8,17976931348623157e292,-17976931348623157e292),Ge.write(r,e,t,n,52, 8),t+8}a($i,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return $i(this,e,t,!0,n)},"wr\ iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return $i(this,e,t,!1,n)},"writeDoubleBE"); d.prototype.copy=a(function(e,t,n,i){if(!d.isBuffer(e))throw new TypeError("argument should be a Buf\ @@ -254,7 +254,7 @@ o)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||t n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>> 0,e||(e=0);let s;if(typeof e=="number")for(s=t;s2**32?i=ki(String(t)):type t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=ki(i)),i+="n"),n+=` It must be ${e}. Re\ ceived ${i}`,n},RangeError);function ki(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(ki,"addNumericalSeparator");function nu(r,e,t){ -Ge(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&ut(e,r.length-(t+1))}a(nu,"checkBounds");function Gi(r,e,t,n,i,s){ +Ve(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&<(e,r.length-(t+1))}a(nu,"checkBounds");function Gi(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 He.ERR_OUT_OF_RANGE("value",u,r)}nu(n,i,s)}a(Gi,"checkIntBI");function Ge(r,e){if(typeof r!= -"number")throw new He.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Ge,"validateNumber");function ut(r,e,t){throw Math. -floor(r)!==r?(Ge(r,t),new He.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new He.ERR_BUFFER_OUT_OF_BOUNDS: -new He.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(ut,"boundsError");var iu=/[^+/0-9A-Za-z-_]/g; +nd <= ${t}${o}`,new $e.ERR_OUT_OF_RANGE("value",u,r)}nu(n,i,s)}a(Gi,"checkIntBI");function Ve(r,e){if(typeof r!= +"number")throw new $e.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Ve,"validateNumber");function lt(r,e,t){throw Math. +floor(r)!==r?(Ve(r,t),new $e.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new $e.ERR_BUFFER_OUT_OF_BOUNDS: +new $e.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(lt,"boundsError");var iu=/[^+/0-9A-Za-z-_]/g; function su(r){if(r=r.split("=")[0],r=r.trim().replace(iu,""),r.length<2)return"";for(;r.length%4!== 0;)r=r+"=";return r}a(su,"base64clean");function vr(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+ @@ -289,15 +289,15 @@ e[i+t]=r[i];return i}a(Dt,"blitBuffer");function xe(r,e){return r instanceof e|| null&&r.constructor.name!=null&&r.constructor.name===e.name}a(xe,"isInstance");function Cr(r){return r!== r}a(Cr,"numberIsNaN");var uu=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 Re(r){return typeof BigInt>"u"? -cu:r}a(Re,"defineBigIntMethod");function cu(){throw new Error("BigInt not supported")}a(cu,"BufferBi\ +lu:r}a(Re,"defineBigIntMethod");function lu(){throw new Error("BigInt not supported")}a(lu,"BufferBi\ gIntNotDefined")});var S,v,A,m,w,p=te(()=>{"use strict";S=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),A= globalThis.clearImmediate??(r=>clearTimeout(r)),m=typeof globalThis.Buffer=="function"&&typeof globalThis. Buffer.allocUnsafe=="function"?globalThis.Buffer:Ki().Buffer,w=globalThis.process??{};w.env??(w.env= -{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Pe=P((eh,Ir)=>{"use strict";p();var Ke=typeof Reflect=="object"?Reflect:null,zi=Ke&&typeof Ke.apply== -"function"?Ke.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Ot; -Ke&&typeof Ke.ownKeys=="function"?Ot=Ke.ownKeys:Object.getOwnPropertySymbols?Ot=a(function(e){return Object. +{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Pe=P((eh,Ir)=>{"use strict";p();var ze=typeof Reflect=="object"?Reflect:null,zi=ze&&typeof ze.apply== +"function"?ze.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Ot; +ze&&typeof ze.ownKeys=="function"?Ot=ze.ownKeys:Object.getOwnPropertySymbols?Ot=a(function(e){return Object. getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Ot=a(function(e){return Object. -getOwnPropertyNames(e)},"ReflectOwnKeys");function lu(r){console&&console.warn&&console.warn(r)}a(lu, +getOwnPropertyNames(e)},"ReflectOwnKeys");function cu(r){console&&console.warn&&console.warn(r)}a(cu, "ProcessEmitWarning");var Ji=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function k(){k. init.call(this)}a(k,"EventEmitter");Ir.exports=k;Ir.exports.once=pu;k.EventEmitter=k;k.prototype._events= void 0;k.prototype._eventsCount=0;k.prototype._maxListeners=void 0;var Yi=10;function Nt(r){if(typeof r!= @@ -314,14 +314,14 @@ a(Zi,"_getMaxListeners");k.prototype.getMaxListeners=a(function(){return Zi(this k.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")zi(c,this,t);else for(var l=c. -length,f=ns(c,l),n=0;n0&&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,lu(u)}return r}a(Xi,"_addListener");k.prototype.addListener=a(function(e,t){ +r,u.type=e,u.count=o.length,cu(u)}return r}a(Xi,"_addListener");k.prototype.addListener=a(function(e,t){ return Xi(this,e,t,!1)},"addListener");k.prototype.on=k.prototype.addListener;k.prototype.prependListener= a(function(e,t){return Xi(this,e,t,!0)},"prependListener");function fu(){if(!this.fired)return this. target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this. @@ -358,8 +358,8 @@ yu(r,i,{once:!0})})}a(pu,"once");function yu(r,e,t){typeof r.on=="function"&&is( "addErrorHandlerIfEventEmitter");function is(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t): r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,a(function i(s){n.once&& r.removeEventListener(e,i),t(s)},"wrapListener"));else throw new TypeError('The "emitter" argument m\ -ust be of type EventEmitter. Received type '+typeof r)}a(is,"eventTargetAgnosticAddListener")});var as={};ge(as,{Socket:()=>Se,isIP:()=>mu});function mu(r){return 0}var os,ss,_,Se,ze=te(()=>{"use \ -strict";p();os=De(Pe(),1);a(mu,"isIP");ss=/^[^.]+\./,_=class _ extends os.EventEmitter{constructor(){ +ust be of type EventEmitter. Received type '+typeof r)}a(is,"eventTargetAgnosticAddListener")});var as={};ge(as,{Socket:()=>Se,isIP:()=>mu});function mu(r){return 0}var os,ss,_,Se,Ye=te(()=>{"use \ +strict";p();os=Oe(Pe(),1);a(mu,"isIP");ss=/^[^.]+\./,_=class _ extends os.EventEmitter{constructor(){ super(...arguments);I(this,"opts",{});I(this,"connecting",!1);I(this,"pending",!0);I(this,"writable", !0);I(this,"encrypted",!1);I(this,"authorized",!1);I(this,"destroyed",!1);I(this,"ws",null);I(this,"\ writeBuffer");I(this,"tlsState",0);I(this,"tlsRead");I(this,"tlsWrite")}static get poolQueryViaFetch(){ @@ -398,24 +398,24 @@ om/neondatabase/serverless/blob/main/CONFIG.md#wsproxy-string--host-string-port- ng");return typeof i=="function"?i(t,n):`${i}?address=${t}:${n}`}setNoDelay(){return this}setKeepAlive(){ return this}ref(){return this}unref(){return this}connect(t,n,i){this.connecting=!0,i&&this.once("co\ nnect",i);let s=a(()=>{this.connecting=!1,this.pending=!1,this.emit("connect"),this.emit("ready")},"\ -handleWebSocketOpen"),o=a((c,l=!1)=>{c.binaryType="arraybuffer",c.addEventListener("error",f=>{this. -emit("error",f),this.emit("close")}),c.addEventListener("message",f=>{if(this.tlsState===0){let y=m. -from(f.data);this.emit("data",y)}}),c.addEventListener("close",()=>{this.emit("close")}),l?s():c.addEventListener( +handleWebSocketOpen"),o=a((l,c=!1)=>{l.binaryType="arraybuffer",l.addEventListener("error",f=>{this. +emit("error",f),this.emit("close")}),l.addEventListener("message",f=>{if(this.tlsState===0){let y=m. +from(f.data);this.emit("data",y)}}),l.addEventListener("close",()=>{this.emit("close")}),c?s():l.addEventListener( "open",s)},"configureWebSocket"),u;try{u=this.wsProxyAddrForHost(n,typeof t=="string"?parseInt(t,10): -t)}catch(c){this.emit("error",c),this.emit("close");return}try{let l=(this.useSecureWebSocket?"wss:": -"ws:")+"//"+u;if(this.webSocketConstructor!==void 0)this.ws=new this.webSocketConstructor(l),o(this. -ws);else try{this.ws=new WebSocket(l),o(this.ws)}catch{this.ws=new __unstable_WebSocket(l),o(this.ws)}}catch(c){ +t)}catch(l){this.emit("error",l),this.emit("close");return}try{let c=(this.useSecureWebSocket?"wss:": +"ws:")+"//"+u;if(this.webSocketConstructor!==void 0)this.ws=new this.webSocketConstructor(c),o(this. +ws);else try{this.ws=new WebSocket(c),o(this.ws)}catch{this.ws=new __unstable_WebSocket(c),o(this.ws)}}catch(l){ let f=(this.useSecureWebSocket?"https:":"http:")+"//"+u;fetch(f,{headers:{Upgrade:"websocket"}}).then( -y=>{if(this.ws=y.webSocket,this.ws==null)throw c;this.ws.accept(),o(this.ws,!0)}).catch(y=>{this.emit( +y=>{if(this.ws=y.webSocket,this.ws==null)throw l;this.ws.accept(),o(this.ws,!0)}).catch(y=>{this.emit( "error",new Error(`All attempts to open a WebSocket to connect to the database failed. Please refer \ to https://github.com/neondatabase/serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websoc\ ket--undefined. Details: ${y}`)),this.emit("close")})}}async startTls(t){if(this.subtls===void 0)throw new Error( "For Postgres SSL connections, you must set `neonConfig.subtls` to the subtls library. See https://g\ ithub.com/neondatabase/serverless/blob/main/CONFIG.md for more information.");this.tlsState=1;let n=await this. subtls.TrustedCert.databaseFromPEM(this.rootCerts),i=new this.subtls.WebSocketReadQueue(this.ws),s=i. -read.bind(i),o=this.rawWrite.bind(this),{read:u,write:c}=await this.subtls.startTls(t,n,s,o,{useSNI:!this. +read.bind(i),o=this.rawWrite.bind(this),{read:u,write:l}=await this.subtls.startTls(t,n,s,o,{useSNI:!this. disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead=u,this.tlsWrite= -c,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){ +l,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){ for(;;){let t=await this.tlsRead();if(t===void 0)break;{let n=m.from(t);this.emit("data",n)}}}rawWrite(t){ if(!this.coalesceWrites){this.ws&&this.ws.send(t);return}if(this.writeBuffer===void 0)this.writeBuffer= t,setTimeout(()=>{this.ws&&this.ws.send(this.writeBuffer),this.writeBuffer=void 0},0);else{let n=new Uint8Array( @@ -429,10 +429,10 @@ t.replace(ss,"api."),"https://"+s+"/sql"},"fetchEndpoint"),fetchConnectionCache: 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}),I(_,"opts",{});Se=_});var us={};ge(us,{parse:()=>Tr});function Tr(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 E=i+":"+s,C=e?Object. -fromEntries(y.entries()):f;return{href:r,protocol:t,auth:E,username:i,password:s,host:o,hostname:u,port:c, -pathname:l,search:f,query:C,hash:g}}var Rr=te(()=>{"use strict";p();a(Tr,"parse")});var $r=P(Is=>{"use strict";p();Is.parse=function(r,e){return new Hr(r,e).parse()};var zt=class zt{constructor(e,t){ +t.length),{username:i,password:s,host:o,hostname:u,port:l,pathname:c,search:f,searchParams:y,hash:g}=new URL( +n);s=decodeURIComponent(s),i=decodeURIComponent(i),c=decodeURIComponent(c);let E=i+":"+s,C=e?Object. +fromEntries(y.entries()):f;return{href:r,protocol:t,auth:E,username:i,password:s,host:o,hostname:u,port:l, +pathname:c,search:f,query:C,hash:g}}var Rr=te(()=>{"use strict";p();a(Tr,"parse")});var $r=P(Is=>{"use strict";p();Is.parse=function(r,e){return new Hr(r,e).parse()};var zt=class zt{constructor(e,t){ this.source=e,this.transform=t||ju,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( @@ -450,104 +450,104 @@ parse(r,e)},"parse")}},"create")}});var Bs=P((Th,Ps)=>{"use strict";p();var Hu=/ $u=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Gu=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Vu=/^-?infinity$/;Ps. exports=a(function(e){if(Vu.test(e))return Number(e.replace("i","I"));var t=Hu.exec(e);if(!t)return Ku( e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Rs(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=zu(e);return g!=null? -(y=new Date(Date.UTC(i,s,o,u,c,l,f)),Vr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= -new Date(i,s,o,u,c,l,f),Vr(i)&&y.setFullYear(i)),y},"parseDate");function Ku(r){var e=$u.exec(r);if(e){ +10),l=parseInt(t[5],10),c=parseInt(t[6],10),f=t[7];f=f?1e3*parseFloat(f):0;var y,g=zu(e);return g!=null? +(y=new Date(Date.UTC(i,s,o,u,l,c,f)),Vr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= +new Date(i,s,o,u,l,c,f),Vr(i)&&y.setFullYear(i)),y},"parseDate");function Ku(r){var e=$u.exec(r);if(e){ var t=parseInt(e[1],10),n=!!e[4];n&&(t=Rs(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return Vr( t)&&o.setFullYear(t),o}}a(Ku,"getDate");function zu(r){if(r.endsWith("+00"))return 0;var e=Gu.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(zu,"timeZoneOffset");function Rs(r){return-(r- 1)}a(Rs,"bcYearToNegativeYear");function Vr(r){return r>=0&&r<100}a(Vr,"is0To99")});var Fs=P((Bh,Ls)=>{p();Ls.exports=Ju;var Yu=Object.prototype.hasOwnProperty;function Ju(r){for(var e=1;e< arguments.length;e++){var t=arguments[e];for(var n in t)Yu.call(t,n)&&(r[n]=t[n])}return r}a(Ju,"ext\ -end")});var Us=P((Mh,ks)=>{"use strict";p();var Zu=Fs();ks.exports=et;function et(r){if(!(this instanceof et)) -return new et(r);Zu(this,lc(r))}a(et,"PostgresInterval");var Xu=["seconds","minutes","hours","days", -"months","years"];et.prototype.toPostgres=function(){var r=Xu.filter(this.hasOwnProperty,this);return this. +end")});var Us=P((Mh,ks)=>{"use strict";p();var Zu=Fs();ks.exports=tt;function tt(r){if(!(this instanceof tt)) +return new tt(r);Zu(this,cl(r))}a(tt,"PostgresInterval");var Xu=["seconds","minutes","hours","days", +"months","years"];tt.prototype.toPostgres=function(){var r=Xu.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 ec={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ -S"},tc=["years","months","days"],rc=["hours","minutes","seconds"];et.prototype.toISOString=et.prototype. -toISO=function(){var r=tc.map(t,this).join(""),e=rc.map(t,this).join("");return"P"+r+"T"+e;function t(n){ +"")),t+" "+e},this).join(" ")};var el={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ +S"},tl=["years","months","days"],rl=["hours","minutes","seconds"];tt.prototype.toISOString=tt.prototype. +toISO=function(){var r=tl.map(t,this).join(""),e=rl.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+ec[n]}};var Kr="([+-]?\\d+)",nc=Kr+"\\s+years?",ic=Kr+"\\s+mons?",sc=Kr+"\\s+days?",oc="\ -([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",ac=new RegExp([nc,ic,sc,oc].map(function(r){return"\ +/0+$/,"")),i+el[n]}};var Kr="([+-]?\\d+)",nl=Kr+"\\s+years?",il=Kr+"\\s+mons?",sl=Kr+"\\s+days?",ol="\ +([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",al=new RegExp([nl,il,sl,ol].map(function(r){return"\ ("+r+")?"}).join("\\s*")),Ms={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, -uc=["hours","minutes","seconds","milliseconds"];function cc(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}a(cc,"parseMilliseconds");function lc(r){if(!r)return{};var e=ac.exec(r),t=e[8]==="-";return Object. -keys(Ms).reduce(function(n,i){var s=Ms[i],o=e[s];return!o||(o=i==="milliseconds"?cc(o):parseInt(o,10), -!o)||(t&&~uc.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(lc,"parse")});var Os=P((Dh,Ds)=>{"use strict";p();Ds.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( +ul=["hours","minutes","seconds","milliseconds"];function ll(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(ll,"parseMilliseconds");function cl(r){if(!r)return{};var e=al.exec(r),t=e[8]==="-";return Object. +keys(Ms).reduce(function(n,i){var s=Ms[i],o=e[s];return!o||(o=i==="milliseconds"?ll(o):parseInt(o,10), +!o)||(t&&~ul.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(cl,"parse")});var Os=P((Dh,Ds)=>{"use strict";p();Ds.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( 2),"hex");for(var t="",n=0;n{p();var wt=$r(),gt=Gr(),Yt=Bs(),qs=Us(),Qs=Os();function Jt(r){return a(function(t){ +parseBytea")});var $s=P((qh,Hs)=>{p();var gt=$r(),bt=Gr(),Yt=Bs(),qs=Us(),Qs=Os();function Jt(r){return a(function(t){ return t===null?t:r(t)},"nullAllowed")}a(Jt,"allowNull");function js(r){return r===null?r:r==="TRUE"|| -r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(js,"parseBool");function fc(r){return r? -wt.parse(r,js):null}a(fc,"parseBoolArray");function hc(r){return parseInt(r,10)}a(hc,"parseBaseTenIn\ -t");function zr(r){return r?wt.parse(r,Jt(hc)):null}a(zr,"parseIntegerArray");function dc(r){return r? -wt.parse(r,Jt(function(e){return Ws(e).trim()})):null}a(dc,"parseBigIntegerArray");var pc=a(function(r){ -if(!r)return null;var e=gt.create(r,function(t){return t!==null&&(t=Xr(t)),t});return e.parse()},"pa\ -rsePointArray"),Yr=a(function(r){if(!r)return null;var e=gt.create(r,function(t){return t!==null&&(t= -parseFloat(t)),t});return e.parse()},"parseFloatArray"),de=a(function(r){if(!r)return null;var e=gt. -create(r);return e.parse()},"parseStringArray"),Jr=a(function(r){if(!r)return null;var e=gt.create(r, -function(t){return t!==null&&(t=Yt(t)),t});return e.parse()},"parseDateArray"),yc=a(function(r){if(!r) -return null;var e=gt.create(r,function(t){return t!==null&&(t=qs(t)),t});return e.parse()},"parseInt\ -ervalArray"),mc=a(function(r){return r?wt.parse(r,Jt(Qs)):null},"parseByteAArray"),Zr=a(function(r){ +r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(js,"parseBool");function fl(r){return r? +gt.parse(r,js):null}a(fl,"parseBoolArray");function hl(r){return parseInt(r,10)}a(hl,"parseBaseTenIn\ +t");function zr(r){return r?gt.parse(r,Jt(hl)):null}a(zr,"parseIntegerArray");function dl(r){return r? +gt.parse(r,Jt(function(e){return Ws(e).trim()})):null}a(dl,"parseBigIntegerArray");var pl=a(function(r){ +if(!r)return null;var e=bt.create(r,function(t){return t!==null&&(t=Xr(t)),t});return e.parse()},"pa\ +rsePointArray"),Yr=a(function(r){if(!r)return null;var e=bt.create(r,function(t){return t!==null&&(t= +parseFloat(t)),t});return e.parse()},"parseFloatArray"),de=a(function(r){if(!r)return null;var e=bt. +create(r);return e.parse()},"parseStringArray"),Jr=a(function(r){if(!r)return null;var e=bt.create(r, +function(t){return t!==null&&(t=Yt(t)),t});return e.parse()},"parseDateArray"),yl=a(function(r){if(!r) +return null;var e=bt.create(r,function(t){return t!==null&&(t=qs(t)),t});return e.parse()},"parseInt\ +ervalArray"),ml=a(function(r){return r?gt.parse(r,Jt(Qs)):null},"parseByteAArray"),Zr=a(function(r){ return parseInt(r,10)},"parseInteger"),Ws=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ -parseBigInteger"),Ns=a(function(r){return r?wt.parse(r,Jt(JSON.parse)):null},"parseJsonArray"),Xr=a( +parseBigInteger"),Ns=a(function(r){return r?gt.parse(r,Jt(JSON.parse)):null},"parseJsonArray"),Xr=a( function(r){return r[0]!=="("?null:(r=r.substring(1,r.length-1).split(","),{x:parseFloat(r[0]),y:parseFloat( -r[1])})},"parsePoint"),wc=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, +r[1])})},"parsePoint"),wl=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, i=2;i{"use strict";p();var ie=1e6;function bc(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%ie,e=e/ie>>>0,o=4294967296* -s+t,t=o/ie>>>0,u=""+(o-ie*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/ie>>>0,u=""+(o-ie*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/ie>>>0,u=""+(o- -ie*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var xc=Vs(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,W){return E* -Math.pow(2,W)+C};var s=t>>3,o=a(function(E){return n?~E&255:E},"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"),Ys=a(function(r,e,t){var n=Math. -pow(2,t-1)-1,i=U(r,1),s=U(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=U(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"),Sc=a(function(r){ +Hs.exports={init:gl}});var Vs=P((Wh,Gs)=>{"use strict";p();var ie=1e6;function bl(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,l,c,f;{if(s=e%ie,e=e/ie>>>0,o=4294967296* +s+t,t=o/ie>>>0,u=""+(o-ie*t),t===0&&e===0)return n+u+i;for(l="",c=6-u.length,f=0;f>>0,o=4294967296*s+t,t=o/ie>>>0,u=""+(o-ie*t),t===0&&e===0)return n+u+i;for(l= +"",c=6-u.length,f=0;f>>0,o=4294967296*s+t,t=o/ie>>>0,u=""+(o- +ie*t),t===0&&e===0)return n+u+i;for(l="",c=6-u.length,f=0;f{p();var xl=Vs(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,W){return E* +Math.pow(2,W)+C};var s=t>>3,o=a(function(E){return n?~E&255:E},"inv"),u=255,l=8-t%8;e>t%8);var c=0;t%8+e>=8&&(c=i(0,o(r[s])&u,l));for(var f=e+t>>3,y=s+1;y0&&(c=i(c,o(r[f])>>8-g,g)),c},"parseBits"),Ys=a(function(r,e,t){var n=Math. +pow(2,t-1)-1,i=U(r,1),s=U(r,t,1);if(s===0)return 0;var o=1,u=a(function(c,f,y){c===0&&(c=1);for(var g=1;g<= +y;g++)o/=2,(f&1<0&&(c+=o);return c},"parsePrecisionBits"),l=U(r,e,t+1,!1,u);return s==Math.pow( +2,t+1)-1?l===0?i===0?1/0:-1/0:NaN:(i===0?1:-1)*Math.pow(2,s-n)*l},"parseFloatFromBits"),Sl=a(function(r){ return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),Ks=a(function(r){return U(r,1)==1?-1*(U( -r,31,1,!0)+1):U(r,31,1)},"parseInt32"),vc=a(function(r){return Ys(r,23,8)},"parseFloat32"),Ec=a(function(r){ -return Ys(r,52,11)},"parseFloat64"),Ac=a(function(r){var e=U(r,16,32);if(e==49152)return NaN;for(var t=Math. +r,31,1,!0)+1):U(r,31,1)},"parseInt32"),vl=a(function(r){return Ys(r,23,8)},"parseFloat32"),El=a(function(r){ +return Ys(r,52,11)},"parseFloat64"),Al=a(function(r){var e=U(r,16,32);if(e==49152)return NaN;for(var t=Math. pow(1e4,U(r,16,16)),n=0,i=[],s=U(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 E=l.shift();for(g= -0;g0},"parseBool"),Ic=a(function(r){r(20,xc),r(21,Sc),r(23,Ks),r(26,Ks),r(1700,Ac),r(700,vc), -r(701,Ec),r(16,Cc),r(1114,zs.bind(null,!1)),r(1184,zs.bind(null,!0)),r(1e3,bt),r(1007,bt),r(1016,bt), -r(1008,bt),r(1009,bt),r(25,_c)},"init");Js.exports={init:Ic}});var eo=P((zh,Xs)=>{p();Xs.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25, +usec=s},i.getUTCMicroSeconds=function(){return this.usec},i},"parseDate"),xt=a(function(r){for(var e=U( +r,32),t=U(r,32,32),n=U(r,32,64),i=96,s=[],o=0;o>3,(i+=f<<3)>>3),y;console.log("ERROR: ElementType no\ +t implemented: "+c)},"parseElement"),l=a(function(c,f){var y=[],g;if(c.length>1){var E=c.shift();for(g= +0;g0},"parseBool"),Il=a(function(r){r(20,xl),r(21,Sl),r(23,Ks),r(26,Ks),r(1700,Al),r(700,vl), +r(701,El),r(16,Cl),r(1114,zs.bind(null,!1)),r(1184,zs.bind(null,!0)),r(1e3,xt),r(1007,xt),r(1016,xt), +r(1008,xt),r(1009,xt),r(25,_l)},"init");Js.exports={init:Il}});var eo=P((zh,Xs)=>{p();Xs.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 vt=P(St=>{p();var Tc=$s(),Rc=Zs(),Pc=Gr(),Bc=eo();St.getTypeParser=Lc;St.setTypeParser=Fc;St.arrayParser= -Pc;St.builtins=Bc;var xt={text:{},binary:{}};function to(r){return String(r)}a(to,"noParse");function Lc(r,e){ -return e=e||"text",xt[e]&&xt[e][r]||to}a(Lc,"getTypeParser");function Fc(r,e,t){typeof e=="function"&& -(t=e,e="text"),xt[e][r]=t}a(Fc,"setTypeParser");Tc.init(function(r,e){xt.text[r]=e});Rc.init(function(r,e){ -xt.binary[r]=e})});var Xt=P((ed,ro)=>{"use strict";p();var Mc=vt();function Zt(r){this._types=r||Mc,this.text={},this.binary= +REGROLE:4096}});var Et=P(vt=>{p();var Tl=$s(),Rl=Zs(),Pl=Gr(),Bl=eo();vt.getTypeParser=Ll;vt.setTypeParser=Fl;vt.arrayParser= +Pl;vt.builtins=Bl;var St={text:{},binary:{}};function to(r){return String(r)}a(to,"noParse");function Ll(r,e){ +return e=e||"text",St[e]&&St[e][r]||to}a(Ll,"getTypeParser");function Fl(r,e,t){typeof e=="function"&& +(t=e,e="text"),St[e][r]=t}a(Fl,"setTypeParser");Tl.init(function(r,e){St.text[r]=e});Rl.init(function(r,e){ +St.binary[r]=e})});var Xt=P((ed,ro)=>{"use strict";p();var Ml=Et();function Zt(r){this._types=r||Ml,this.text={},this.binary= {}}a(Zt,"TypeOverrides");Zt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ binary":return this.binary;default:return{}}};Zt.prototype.setTypeParser=function(r,e,t){typeof e=="\ function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Zt.prototype.getTypeParser=function(r,e){return e= -e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};ro.exports=Zt});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, +e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};ro.exports=Zt});function At(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119,o=2600822924,u=528734635, +l=1541459225,c=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, 3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700, @@ -556,19 +556,19 @@ c=1541459225,l=0,f=0,y=[1116352408,1899447441,3049323471,3921009573,961987163,15 2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=a((T,b)=>T>>>b|T<<32- b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),W=a(()=>{for(let F=0,J=0;F<16;F++,J+=4)E[F]=C[J]<< 24|C[J+1]<<16|C[J+2]<<8|C[J+3];for(let F=16;F<64;F++){let J=g(E[F-15],7)^g(E[F-15],18)^E[F-15]>>>3,ve=g( -E[F-2],17)^g(E[F-2],19)^E[F-2]>>>10;E[F]=E[F-16]+J+E[F-7]+ve|0}let T=e,b=t,M=n,oe=i,H=s,we=o,Ce=u,ue=c; -for(let F=0;F<64;F++){let J=g(H,6)^g(H,11)^g(H,25),ve=H&we^~H&Ce,Ie=ue+J+ve+y[F]+E[F]|0,Fe=g(T,2)^g( -T,13)^g(T,22),Me=T&b^T&M^b&M,ke=Fe+Me|0;ue=Ce,Ce=we,we=H,H=oe+Ie|0,oe=M,M=b,b=T,T=Ie+ke|0}e=e+T|0,t= -t+b|0,n=n+M|0,i=i+oe|0,s=s+H|0,o=o+we|0,u=u+Ce|0,c=c+ue|0,f=0},"process"),Y=a(T=>{typeof T=="string"&& -(T=new TextEncoder().encode(T));for(let b=0;b{if(C[f++]=128,f==64&&W(),f+8>64){for(;f<64;)C[f++]=0;W()}for(;f<58;)C[f++]=0;let T=l*8;C[f++]= +E[F-2],17)^g(E[F-2],19)^E[F-2]>>>10;E[F]=E[F-16]+J+E[F-7]+ve|0}let T=e,b=t,M=n,oe=i,H=s,we=o,Ce=u,ue=l; +for(let F=0;F<64;F++){let J=g(H,6)^g(H,11)^g(H,25),ve=H&we^~H&Ce,Ie=ue+J+ve+y[F]+E[F]|0,Me=g(T,2)^g( +T,13)^g(T,22),ke=T&b^T&M^b&M,Ue=Me+ke|0;ue=Ce,Ce=we,we=H,H=oe+Ie|0,oe=M,M=b,b=T,T=Ie+Ue|0}e=e+T|0,t= +t+b|0,n=n+M|0,i=i+oe|0,s=s+H|0,o=o+we|0,u=u+Ce|0,l=l+ue|0,f=0},"process"),Y=a(T=>{typeof T=="string"&& +(T=new TextEncoder().encode(T));for(let b=0;b{if(C[f++]=128,f==64&&W(),f+8>64){for(;f<64;)C[f++]=0;W()}for(;f<58;)C[f++]=0;let T=c*8;C[f++]= T/1099511627776&255,C[f++]=T/4294967296&255,C[f++]=T>>>24,C[f++]=T>>>16&255,C[f++]=T>>>8&255,C[f++]= T&255,W();let b=new Uint8Array(32);return b[0]=e>>>24,b[1]=e>>>16&255,b[2]=e>>>8&255,b[3]=e&255,b[4]= t>>>24,b[5]=t>>>16&255,b[6]=t>>>8&255,b[7]=t&255,b[8]=n>>>24,b[9]=n>>>16&255,b[10]=n>>>8&255,b[11]=n& 255,b[12]=i>>>24,b[13]=i>>>16&255,b[14]=i>>>8&255,b[15]=i&255,b[16]=s>>>24,b[17]=s>>>16&255,b[18]=s>>> 8&255,b[19]=s&255,b[20]=o>>>24,b[21]=o>>>16&255,b[22]=o>>>8&255,b[23]=o&255,b[24]=u>>>24,b[25]=u>>>16& -255,b[26]=u>>>8&255,b[27]=u&255,b[28]=c>>>24,b[29]=c>>>16&255,b[30]=c>>>8&255,b[31]=c&255,b},"digest"); -return r===void 0?{add:Y,digest:me}:(Y(r),me())}var no=te(()=>{"use strict";p();a(Et,"sha256")});var Q,At,io=te(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ +255,b[26]=u>>>8&255,b[27]=u&255,b[28]=l>>>24,b[29]=l>>>16&255,b[30]=l>>>8&255,b[31]=l&255,b},"digest"); +return r===void 0?{add:Y,digest:me}:(Y(r),me())}var no=te(()=>{"use strict";p();a(At,"sha256")});var Q,_t,io=te(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ Length",0);I(this,"_state",new Int32Array(4));I(this,"_buffer",new ArrayBuffer(68));I(this,"_buffer8"); I(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( @@ -626,130 +626,130 @@ i=this._state,s;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=n i[3]=n[3],s=0;s>2)+1;this._dataLength+=t;let o=this._dataLength*8;if(n[t]=128,n[t+1]= n[t+2]=n[t+3]=0,i.set(Q.buffer32Identity.subarray(s),s),t>55&&(Q._md5cycle(this._state,i),i.set(Q.buffer32Identity)), -o<=4294967295)i[14]=o;else{let u=o.toString(16).match(/(.*?)(.{0,8})$/);if(u===null)return;let c=parseInt( -u[2],16),l=parseInt(u[1],16)||0;i[14]=c,i[15]=l}return Q._md5cycle(this._state,i),e?this._state:Q._hex( +o<=4294967295)i[14]=o;else{let u=o.toString(16).match(/(.*?)(.{0,8})$/);if(u===null)return;let l=parseInt( +u[2],16),c=parseInt(u[1],16)||0;i[14]=l,i[15]=c}return Q._md5cycle(this._state,i),e?this._state:Q._hex( this._state)}};a(Q,"Md5"),I(Q,"stateIdentity",new Int32Array([1732584193,-271733879,-1732584194,271733878])), I(Q,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),I(Q,"hexChars","0123456789\ -abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);At=Q});var en={};ge(en,{createHash:()=>Uc,createHmac:()=>Dc,randomBytes:()=>kc});function kc(r){return crypto. -getRandomValues(m.alloc(r))}function Uc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( -function(){return m.from(Et(e))},"digest")}},"update")};if(r==="md5")return{update:a(function(e){return{ -digest:a(function(){return typeof e=="string"?At.hashStr(e):At.hashByteArray(e)},"digest")}},"update")}; -throw new Error(`Hash type '${r}' not supported`)}function Dc(r,e){if(r!=="sha256")throw new Error(`\ +abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);_t=Q});var en={};ge(en,{createHash:()=>Ul,createHmac:()=>Dl,randomBytes:()=>kl});function kl(r){return crypto. +getRandomValues(m.alloc(r))}function Ul(r){if(r==="sha256")return{update:a(function(e){return{digest:a( +function(){return m.from(At(e))},"digest")}},"update")};if(r==="md5")return{update:a(function(e){return{ +digest:a(function(){return typeof e=="string"?_t.hashStr(e):_t.hashByteArray(e)},"digest")}},"update")}; +throw new Error(`Hash type '${r}' not supported`)}function Dl(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=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(Et(o),64),m.from(Et(u))}, -"digest")}},"update")}}var tn=te(()=>{"use strict";p();no();io();a(kc,"randomBytes");a(Uc,"createHas\ -h");a(Dc,"createHmac")});var _t=P((dd,rn)=>{"use strict";p();rn.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: +t));let n=e.length;if(n>64)e=At(e);else if(n<64){let l=new Uint8Array(64);l.set(e),e=l}let i=new Uint8Array( +64),s=new Uint8Array(64);for(let l=0;l<64;l++)i[l]=54^e[l],s[l]=92^e[l];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(At(o),64),m.from(At(u))}, +"digest")}},"update")}}var tn=te(()=>{"use strict";p();no();io();a(kl,"randomBytes");a(Ul,"createHas\ +h");a(Dl,"createHmac")});var Ct=P((dd,rn)=>{"use strict";p();rn.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: w.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 tt=vt(),Oc=tt.getTypeParser(20,"text"),Nc=tt.getTypeParser(1016, -"text");rn.exports.__defineSetter__("parseInt8",function(r){tt.setTypeParser(20,"text",r?tt.getTypeParser( -23,"text"):Oc),tt.setTypeParser(1016,"text",r?tt.getTypeParser(1007,"text"):Nc)})});var Ct=P((yd,oo)=>{"use strict";p();var qc=(tn(),$(en)),Qc=_t();function jc(r){var e=r.replace(/\\/g, -"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(jc,"escapeElement");function so(r){for(var e="{",t=0;t< +keepalives:1,keepalives_idle:0};var rt=Et(),Ol=rt.getTypeParser(20,"text"),Nl=rt.getTypeParser(1016, +"text");rn.exports.__defineSetter__("parseInt8",function(r){rt.setTypeParser(20,"text",r?rt.getTypeParser( +23,"text"):Ol),rt.setTypeParser(1016,"text",r?rt.getTypeParser(1007,"text"):Nl)})});var It=P((yd,oo)=>{"use strict";p();var ql=(tn(),$(en)),Ql=Ct();function jl(r){var e=r.replace(/\\/g, +"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(jl,"escapeElement");function so(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+so(r[t]): -r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=jc(er(r[t]));return e=e+"}",e}a(so,"arrayString"); +r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=jl(er(r[t]));return e=e+"}",e}a(so,"arrayString"); var er=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. 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?Qc.parseInputDatesAsUTC?$c(r):Hc(r):Array.isArray(r)?so(r):typeof r== -"object"?Wc(r,e):r.toString()},"prepareValue");function Wc(r,e){if(r&&typeof r.toPostgres=="function"){ +r.byteLength)}return r instanceof Date?Ql.parseInputDatesAsUTC?$l(r):Hl(r):Array.isArray(r)?so(r):typeof r== +"object"?Wl(r,e):r.toString()},"prepareValue");function Wl(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),er(r.toPostgres(er),e)}return JSON.stringify(r)}a(Wc,"prepareObject");function z(r,e){ -for(r=""+r;r.lengthrl});var rl,Rt=te(()=>{"use strict";p();rl={}});var bo=P((Rd,go)=>{"use strict";p();var on=(tn(),$(en));function nl(r){if(r.indexOf("SCRAM-SHA-256")=== +normalizeQueryConfig:Gl,postgresMd5PasswordHash:Vl,md5:nn}});var Tt={};ge(Tt,{default:()=>rc});var rc,Rt=te(()=>{"use strict";p();rc={}});var bo=P((Rd,go)=>{"use strict";p();var on=(tn(),$(en));function nc(r){if(r.indexOf("SCRAM-SHA-256")=== -1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=on.randomBytes( 18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"\ -SASLInitialResponse"}}a(nl,"startSession");function il(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( +SASLInitialResponse"}}a(nc,"startSession");function ic(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=al(t);if(n.nonce.startsWith(r.clientNonce)){ +L: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=ac(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=m.from(n.salt,"base64"),s=ll(e,i,n.iteration),o=rt(s,"Client Key"),u=cl( -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=rt(u,y),E=wo(o,g),C=E.toString("base64"),W=rt(s,"Server Key"),Y=rt(W,y);r.message="SAS\ -LResponse",r.serverSignature=Y.toString("base64"),r.response=f+",p="+C}a(il,"continueSession");function sl(r,e){ +art with client nonce");var i=m.from(n.salt,"base64"),s=cc(e,i,n.iteration),o=nt(s,"Client Key"),u=lc( +o),l="n=*,r="+r.clientNonce,c="r="+n.nonce+",s="+n.salt+",i="+n.iteration,f="c=biws,r="+n.nonce,y=l+ +","+c+","+f,g=nt(u,y),E=wo(o,g),C=E.toString("base64"),W=nt(s,"Server Key"),Y=nt(W,y);r.message="SAS\ +LResponse",r.serverSignature=Y.toString("base64"),r.response=f+",p="+C}a(ic,"continueSession");function sc(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}=ul( +"string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=uc( e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does\ - not match")}a(sl,"finalizeSession");function ol(r){if(typeof r!="string")throw new TypeError("SASL:\ + not match")}a(sc,"finalizeSession");function oc(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(ol,"isPrintableChars");function yo(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +e<=126)}a(oc,"isPrintableChars");function yo(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. test(r)}a(yo,"isBase64");function mo(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(mo,"parseAttribute\ -Pairs");function al(r){let e=mo(r),t=e.get("r");if(t){if(!ol(t))throw new Error("SASL: SCRAM-SERVER-\ +Pairs");function ac(r){let e=mo(r),t=e.get("r");if(t){if(!oc(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(!yo(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(al,"parseServerFirstMessage"); -function ul(r){let t=mo(r).get("v");if(t){if(!yo(t))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAG\ +tion missing");let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(ac,"parseServerFirstMessage"); +function uc(r){let t=mo(r).get("v");if(t){if(!yo(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(ul,"parseServerFinalMessage");function wo(r,e){if(!m. +signature is missing");return{serverSignature:t}}a(uc,"parseServerFinalMessage");function wo(r,e){if(!m. isBuffer(r))throw new TypeError("first argument must be a Buffer");if(!m.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 m.from(r.map((t,n)=>r[n]^e[n]))} -a(wo,"xorBuffers");function cl(r){return on.createHash("sha256").update(r).digest()}a(cl,"sha256");function rt(r,e){ -return on.createHmac("sha256",r).update(e).digest()}a(rt,"hmacSha256");function ll(r,e,t){for(var n=rt( -r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sfl});function fl(...r){return r.join("/")}var un=te(()=>{"use strict";p(); -a(fl,"join")});var cn={};ge(cn,{stat:()=>hl});function hl(r,e){e(new Error("No filesystem"))}var ln=te(()=>{"use st\ -rict";p();a(hl,"stat")});var fn={};ge(fn,{default:()=>dl});var dl,hn=te(()=>{"use strict";p();dl={}});var xo={};ge(xo,{StringDecoder:()=>dn});var pn,dn,So=te(()=>{"use strict";p();pn=class pn{constructor(e){ +a(wo,"xorBuffers");function lc(r){return on.createHash("sha256").update(r).digest()}a(lc,"sha256");function nt(r,e){ +return on.createHmac("sha256",r).update(e).digest()}a(nt,"hmacSha256");function cc(r,e,t){for(var n=nt( +r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sfc});function fc(...r){return r.join("/")}var un=te(()=>{"use strict";p(); +a(fc,"join")});var ln={};ge(ln,{stat:()=>hc});function hc(r,e){e(new Error("No filesystem"))}var cn=te(()=>{"use st\ +rict";p();a(hc,"stat")});var fn={};ge(fn,{default:()=>dc});var dc,hn=te(()=>{"use strict";p();dc={}});var xo={};ge(xo,{StringDecoder:()=>dn});var pn,dn,So=te(()=>{"use strict";p();pn=class pn{constructor(e){ I(this,"td");this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this. -td.decode(e)}};a(pn,"StringDecoder");dn=pn});var _o=P((Nd,Ao)=>{"use strict";p();var{Transform:pl}=(hn(),$(fn)),{StringDecoder:yl}=(So(),$(xo)),Be=Symbol( -"last"),rr=Symbol("decoder");function ml(r,e,t){let n;if(this.overflow){if(n=this[rr].write(r).split( -this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Be]+=this[rr].write(r),n= -this[Be].split(this.matcher);this[Be]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( -"maximum buffer reached"));return}t()}a(ml,"transform");function wl(r){if(this[Be]+=this[rr].end(),this[Be]) -try{Eo(this,this.mapper(this[Be]))}catch(e){return r(e)}r()}a(wl,"flush");function Eo(r,e){e!==void 0&& -r.push(e)}a(Eo,"push");function vo(r){return r}a(vo,"noop");function gl(r,e,t){switch(r=r||/\r?\n/,e= +td.decode(e)}};a(pn,"StringDecoder");dn=pn});var _o=P((Nd,Ao)=>{"use strict";p();var{Transform:pc}=(hn(),$(fn)),{StringDecoder:yc}=(So(),$(xo)),Le=Symbol( +"last"),rr=Symbol("decoder");function mc(r,e,t){let n;if(this.overflow){if(n=this[rr].write(r).split( +this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Le]+=this[rr].write(r),n= +this[Le].split(this.matcher);this[Le]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( +"maximum buffer reached"));return}t()}a(mc,"transform");function wc(r){if(this[Le]+=this[rr].end(),this[Le]) +try{Eo(this,this.mapper(this[Le]))}catch(e){return r(e)}r()}a(wc,"flush");function Eo(r,e){e!==void 0&& +r.push(e)}a(Eo,"push");function vo(r){return r}a(vo,"noop");function gc(r,e,t){switch(r=r||/\r?\n/,e= e||vo,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=vo)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=ml,t.flush=wl,t.readableObjectMode= -!0;let n=new pl(t);return n[Be]="",n[rr]=new yl("utf8"),n.matcher=r,n.mapper=e,n.maxLength=t.maxLength, +"object"&&(t=e,e=vo)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=mc,t.flush=wc,t.readableObjectMode= +!0;let n=new pc(t);return n[Le]="",n[rr]=new yc("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(gl,"split");Ao.exports=gl});var To=P((jd,_e)=>{"use strict";p();var Co=(un(),$(an)),bl=(hn(),$(fn)).Stream,xl=_o(),Io=(Rt(),$(Tt)), -Sl=5432,nr=w.platform==="win32",Pt=w.stderr,vl=56,El=7,Al=61440,_l=32768;function Cl(r){return(r&Al)== -_l}a(Cl,"isRegFile");var nt=["host","port","database","user","password"],yn=nt.length,Il=nt[yn-1];function mn(){ -var r=Pt instanceof bl&&Pt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +!1,s(i)},n}a(gc,"split");Ao.exports=gc});var To=P((jd,_e)=>{"use strict";p();var Co=(un(),$(an)),bc=(hn(),$(fn)).Stream,xc=_o(),Io=(Rt(),$(Tt)), +Sc=5432,nr=w.platform==="win32",Pt=w.stderr,vc=56,Ec=7,Ac=61440,_c=32768;function Cc(r){return(r&Ac)== +_c}a(Cc,"isRegFile");var it=["host","port","database","user","password"],yn=it.length,Ic=it[yn-1];function mn(){ +var r=Pt instanceof bc&&Pt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` `);Pt.write(Io.format.apply(Io,e))}}a(mn,"warn");Object.defineProperty(_e.exports,"isWin",{get:a(function(){ return nr},"get"),set:a(function(r){nr=r},"set")});_e.exports.warnTo=function(r){var e=Pt;return Pt= r,e};_e.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(nr?Co.join(e.APPDATA||"./","\ postgresql","pgpass.conf"):Co.join(e.HOME||"./",".pgpass"));return t};_e.exports.usePgPass=function(r,e){ -return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:nr?!0:(e=e||"",Cl(r.mode)?r. -mode&(vl|El)?(mn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ -(0600) or less',e),!1):!0:(mn('WARNING: password file "%s" is not a plain file',e),!1))};var Tl=_e.exports. -match=function(r,e){return nt.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||Sl)===Number( +return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:nr?!0:(e=e||"",Cc(r.mode)?r. +mode&(vc|Ec)?(mn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ +(0600) or less',e),!1):!0:(mn('WARNING: password file "%s" is not a plain file',e),!1))};var Tc=_e.exports. +match=function(r,e){return it.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||Sc)===Number( e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};_e.exports.getPassword=function(r,e,t){var n,i=e.pipe( -xl());function s(c){var l=Rl(c);l&&Pl(l)&&Tl(r,l)&&(n=l[Il],i.end())}a(s,"onLine");var o=a(function(){ -e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),mn("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 Rl=_e.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( +xc());function s(l){var c=Rc(l);c&&Pc(c)&&Tc(r,c)&&(n=c[Ic],i.end())}a(s,"onLine");var o=a(function(){ +e.destroy(),t(n)},"onEnd"),u=a(function(l){e.destroy(),mn("WARNING: error on reading file: %s",l),t( +void 0)},"onErr");e.on("error",u),i.on("data",s).on("end",o).on("error",u)};var Rc=_e.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,l=a( function(f,y,g){var E=r.substring(y,g);Object.hasOwnProperty.call(w.env,"PGPASS_NO_DEESCAPE")||(E=E. -replace(/\\([:\\])/g,"$1")),o[nt[f]]=E},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). -length===yn?o:null,o},Pl=_e.exports.isValidEntry=function(r){for(var e={0:function(o){return o.length> +replace(/\\([:\\])/g,"$1")),o[it[f]]=E},"addToObj"),c=0;c=0&&e==":"&&t!=="\\"&&(l(n,i,c+1),i=c+2,n+=1)}return o=Object.keys(o). +length===yn?o:null,o},Pc=_e.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 $d=(un(),$(an)),Ro=(ln(),$(cn)),ir=To();wn.exports=function(r,e){ +0}},t=0;t{"use strict";p();var $d=(un(),$(an)),Ro=(cn(),$(ln)),ir=To();wn.exports=function(r,e){ var t=ir.getFileName();Ro.stat(t,function(n,i){if(n||!ir.usePgPass(i,t))return e(void 0);var s=Ro.createReadStream( -t);ir.getPassword(r,s,e)})};wn.exports.warnTo=ir.warnTo});var Bo={};ge(Bo,{default:()=>Bl});var Bl,Lo=te(()=>{"use strict";p();Bl={}});var Mo=P((zd,Fo)=>{"use strict";p();var Ll=(Rr(),$(us)),gn=(ln(),$(cn));function bn(r){if(r.charAt(0)=== -"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Ll.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i. +t);ir.getPassword(r,s,e)})};wn.exports.warnTo=ir.warnTo});var Bo={};ge(Bo,{default:()=>Bc});var Bc,Lo=te(()=>{"use strict";p();Bc={}});var Mo=P((zd,Fo)=>{"use strict";p();var Lc=(Rr(),$(us)),gn=(cn(),$(ln));function bn(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. 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. @@ -760,17 +760,17 @@ t.ssl==="0"&&(t.ssl=!1),(t.sslcert||t.sslkey||t.sslrootcert||t.sslmode)&&(t.ssl= cert=gn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=gn.readFileSync(t.sslkey).toString()), t.sslrootcert&&(t.ssl.ca=gn.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(bn,"parse");Fo.exports=bn;bn.parse=bn});var sr=P((Zd,Do)=>{"use strict";p();var Fl=(Lo(),$(Bo)),Uo=_t(),ko=Mo().parse,ee=a(function(r,e,t){return t=== -void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Uo[r]},"val"),Ml=a(function(){switch(w. +!1;break}}return t}a(bn,"parse");Fo.exports=bn;bn.parse=bn});var sr=P((Zd,Do)=>{"use strict";p();var Fc=(Lo(),$(Bo)),Uo=Ct(),ko=Mo().parse,ee=a(function(r,e,t){return t=== +void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Uo[r]},"val"),Mc=a(function(){switch(w. 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 Uo.ssl},"readSSLConfigFromEnvironment"),it=a(function(r){ +no-verify":return{rejectUnauthorized:!1}}return Uo.ssl},"readSSLConfigFromEnvironment"),st=a(function(r){ return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),ye=a(function(r,e,t){ -var n=e[t];n!=null&&r.push(t+"="+it(n))},"add"),Sn=class Sn{constructor(e){e=typeof e=="string"?ko(e): +var n=e[t];n!=null&&r.push(t+"="+st(n))},"add"),Sn=class Sn{constructor(e){e=typeof e=="string"?ko(e): e||{},e.connectionString&&(e=Object.assign({},e,ko(e.connectionString))),this.user=ee("user",e),this. database=ee("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(ee("p\ ort",e),10),this.host=ee("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, writable:!0,value:ee("password",e)}),this.binary=ee("binary",e),this.options=ee("options",e),this.ssl= -typeof e.ssl>"u"?Ml():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="\ +typeof e.ssl>"u"?Mc():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=ee("client_encoding",e),this.replication=ee("replication", e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=ee("application_name",e,"\ @@ -783,11 +783,11 @@ void 0?this.connect_timeout=w.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math var t=[];ye(t,this,"user"),ye(t,this,"password"),ye(t,this,"port"),ye(t,this,"application_name"),ye( t,this,"fallback_application_name"),ye(t,this,"connect_timeout"),ye(t,this,"options");var n=typeof this. ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(ye(t,n,"sslmode"),ye(t,n,"sslca"),ye(t,n,"s\ -slkey"),ye(t,n,"sslcert"),ye(t,n,"sslrootcert"),this.database&&t.push("dbname="+it(this.database)),this. -replication&&t.push("replication="+it(this.replication)),this.host&&t.push("host="+it(this.host)),this. -isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+it(this.client_encoding)), -Fl.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+it(s)),e(null,t.join(" ")))})}}; -a(Sn,"ConnectionParameters");var xn=Sn;Do.exports=xn});var qo=P((tp,No)=>{"use strict";p();var kl=vt(),Oo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,En=class En{constructor(e,t){ +slkey"),ye(t,n,"sslcert"),ye(t,n,"sslrootcert"),this.database&&t.push("dbname="+st(this.database)),this. +replication&&t.push("replication="+st(this.replication)),this.host&&t.push("host="+st(this.host)),this. +isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+st(this.client_encoding)), +Fc.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+st(s)),e(null,t.join(" ")))})}}; +a(Sn,"ConnectionParameters");var xn=Sn;Do.exports=xn});var qo=P((tp,No)=>{"use strict";p();var kc=Et(),Oo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,En=class En{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=Oo.exec(e.text):t=Oo.exec(e.command),t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2], @@ -796,8 +796,8 @@ e.length),n=0,i=e.length;n{"use strict";p();var{EventEmitter:Ul}=Pe(),Qo=qo(),jo=Ct(),_n=class _n extends Ul{constructor(e,t,n){ +_types.getTypeParser(n.dataTypeID,n.format||"text"):this._parsers[t]=kc.getTypeParser(n.dataTypeID,n. +format||"text")}}};a(En,"Result");var vn=En;No.exports=vn});var Ho=P((ip,Wo)=>{"use strict";p();var{EventEmitter:Uc}=Pe(),Qo=qo(),jo=It(),_n=class _n extends Uc{constructor(e,t,n){ super(),e=jo.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,w.domain&&e.callback&&(this.callback=w.domain.bind(e.callback)),this._result= @@ -868,34 +868,34 @@ e.length),e.copy(this.buffer,this.offset),this.offset+=e.length,this}join(e){if( 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=m.allocUnsafe(this.size),t}};a(ri,"Writer");var ti=ri;or.Writer=ti});var Vo=P(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.serialize=void 0; -var ni=$o(),D=new ni.Writer,Dl=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( +var ni=$o(),D=new ni.Writer,Dc=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( n).addCString(r[n]);D.addCString("client_encoding").addCString("UTF8");let e=D.addCString("").flush(), -t=e.length+4;return new ni.Writer().addInt32(t).add(e).flush()},"startup"),Ol=a(()=>{let r=m.allocUnsafe( -8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Nl=a(r=>D.addCString(r).flush( -112),"password"),ql=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. -flush(112)},"sendSASLInitialResponseMessage"),Ql=a(function(r){return D.addString(r).flush(112)},"se\ -ndSCRAMClientFinalMessage"),jl=a(r=>D.addCString(r).flush(81),"query"),Go=[],Wl=a(r=>{let e=r.name|| +t=e.length+4;return new ni.Writer().addInt32(t).add(e).flush()},"startup"),Oc=a(()=>{let r=m.allocUnsafe( +8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Nc=a(r=>D.addCString(r).flush( +112),"password"),qc=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. +flush(112)},"sendSASLInitialResponseMessage"),Qc=a(function(r){return D.addString(r).flush(112)},"se\ +ndSCRAMClientFinalMessage"),jc=a(r=>D.addCString(r).flush(81),"query"),Go=[],Wc=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||Go,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< -n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),st=new ni.Writer,Hl=a(function(r,e){for(let t=0;t< -r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),st.addInt32(-1)):n instanceof m?(D.addInt16( -1),st.addInt32(n.length),st.add(n)):(D.addInt16(0),st.addInt32(m.byteLength(n)),st.addString(n))}},"\ -writeValues"),$l=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Go,s=i.length; -return D.addCString(e).addCString(t),D.addInt16(s),Hl(i,r.valueMapper),D.addInt16(s),D.add(st.flush()), -D.addInt16(n?1:0),D.flush(66)},"bind"),Gl=m.from([69,0,0,0,9,0,0,0,0,0]),Vl=a(r=>{if(!r||!r.portal&& -!r.rows)return Gl;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Kl=a( +n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),ot=new ni.Writer,Hc=a(function(r,e){for(let t=0;t< +r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),ot.addInt32(-1)):n instanceof m?(D.addInt16( +1),ot.addInt32(n.length),ot.add(n)):(D.addInt16(0),ot.addInt32(m.byteLength(n)),ot.addString(n))}},"\ +writeValues"),$c=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Go,s=i.length; +return D.addCString(e).addCString(t),D.addInt16(s),Hc(i,r.valueMapper),D.addInt16(s),D.add(ot.flush()), +D.addInt16(n?1:0),D.flush(66)},"bind"),Gc=m.from([69,0,0,0,9,0,0,0,0,0]),Vc=a(r=>{if(!r||!r.portal&& +!r.rows)return Gc;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Kc=a( (r,e)=>{let t=m.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"),ii=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i},"cstringMessage"), -zl=D.addCString("P").flush(68),Yl=D.addCString("S").flush(68),Jl=a(r=>r.name?ii(68,`${r.type}${r.name|| -""}`):r.type==="P"?zl:Yl,"describe"),Zl=a(r=>{let e=`${r.type}${r.name||""}`;return ii(67,e)},"close"), -Xl=a(r=>D.add(r).flush(100),"copyData"),ef=a(r=>ii(102,r),"copyFail"),ar=a(r=>m.from([r,0,0,0,4]),"c\ -odeOnlyBuffer"),tf=ar(72),rf=ar(83),nf=ar(88),sf=ar(99),of={startup:Dl,password:Nl,requestSsl:Ol,sendSASLInitialResponseMessage:ql, -sendSCRAMClientFinalMessage:Ql,query:jl,parse:Wl,bind:$l,execute:Vl,describe:Jl,close:Zl,flush:a(()=>tf, -"flush"),sync:a(()=>rf,"sync"),end:a(()=>nf,"end"),copyData:Xl,copyDone:a(()=>sf,"copyDone"),copyFail:ef, -cancel:Kl};ur.serialize=of});var Ko=P(cr=>{"use strict";p();Object.defineProperty(cr,"__esModule",{value:!0});cr.BufferReader=void 0; +zc=D.addCString("P").flush(68),Yc=D.addCString("S").flush(68),Jc=a(r=>r.name?ii(68,`${r.type}${r.name|| +""}`):r.type==="P"?zc:Yc,"describe"),Zc=a(r=>{let e=`${r.type}${r.name||""}`;return ii(67,e)},"close"), +Xc=a(r=>D.add(r).flush(100),"copyData"),ef=a(r=>ii(102,r),"copyFail"),ar=a(r=>m.from([r,0,0,0,4]),"c\ +odeOnlyBuffer"),tf=ar(72),rf=ar(83),nf=ar(88),sf=ar(99),of={startup:Dc,password:Nc,requestSsl:Oc,sendSASLInitialResponseMessage:qc, +sendSCRAMClientFinalMessage:Qc,query:jc,parse:Wc,bind:$c,execute:Vc,describe:Jc,close:Zc,flush:a(()=>tf, +"flush"),sync:a(()=>rf,"sync"),end:a(()=>nf,"end"),copyData:Xc,copyDone:a(()=>sf,"copyDone"),copyFail:ef, +cancel:Kc};ur.serialize=of});var Ko=P(lr=>{"use strict";p();Object.defineProperty(lr,"__esModule",{value:!0});lr.BufferReader=void 0; var af=m.allocUnsafe(0),oi=class oi{constructor(e=0){this.offset=e,this.buffer=af,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( @@ -903,12 +903,12 @@ this.offset);return this.offset+=4,e}uint32(){let e=this.buffer.readUInt32BE(thi 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(oi,"BufferReader");var si=oi;cr.BufferReader=si});var Jo=P(lr=>{"use strict";p();Object.defineProperty(lr,"__esModule",{value:!0});lr.Parser=void 0;var O=ei(), -uf=Ko(),ai=1,cf=4,zo=ai+cf,Yo=m.allocUnsafe(0),ci=class ci{constructor(e){if(this.buffer=Yo,this.bufferLength= +offset+=e,t}};a(oi,"BufferReader");var si=oi;lr.BufferReader=si});var Jo=P(cr=>{"use strict";p();Object.defineProperty(cr,"__esModule",{value:!0});cr.Parser=void 0;var O=ei(), +uf=Ko(),ai=1,lf=4,zo=ai+lf,Yo=m.allocUnsafe(0),li=class li{constructor(e){if(this.buffer=Yo,this.bufferLength= 0,this.bufferOffset=0,this.reader=new uf.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+zo<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( -i+ai),u=ai+o;if(u+i<=n){let c=this.handlePacket(i+zo,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. +i+ai),u=ai+o;if(u+i<=n){let l=this.handlePacket(i+zo,s,o,this.buffer);t(l),i+=u}else break}i===n?(this. buffer=Yo,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. @@ -930,7 +930,7 @@ this.reader.setBuffer(e,n);let i=this.reader.cstring();return new O.CommandCompl let i=n.slice(e,e+(t-4));return new O.CopyDataMessage(t,i)}parseCopyInMessage(e,t,n){return this.parseCopyMessage( e,t,n,"copyInResponse")}parseCopyOutMessage(e,t,n){return this.parseCopyMessage(e,t,n,"copyOutRespon\ se")}parseCopyMessage(e,t,n,i){this.reader.setBuffer(e,n);let s=this.reader.byte()!==0,o=this.reader. -int16(),u=new O.CopyResponse(t,i,s,o);for(let c=0;c{"use strict";p();Object.defineProperty(Le,"__esModule",{value:!0});Le.DatabaseError=Le. -serialize=Le.parse=void 0;var lf=ei();Object.defineProperty(Le,"DatabaseError",{enumerable:!0,get:a( -function(){return lf.DatabaseError},"get")});var ff=Vo();Object.defineProperty(Le,"serialize",{enumerable:!0, +l=i==="notice"?new O.NoticeMessage(t,u):new O.DatabaseError(u,t,i);return l.severity=s.S,l.code=s.C, +l.detail=s.D,l.hint=s.H,l.position=s.P,l.internalPosition=s.p,l.internalQuery=s.q,l.where=s.W,l.schema= +s.s,l.table=s.t,l.column=s.c,l.dataType=s.d,l.constraint=s.n,l.file=s.F,l.line=s.L,l.routine=s.R,l}}; +a(li,"Parser");var ui=li;cr.Parser=ui});var ci=P(Fe=>{"use strict";p();Object.defineProperty(Fe,"__esModule",{value:!0});Fe.DatabaseError=Fe. +serialize=Fe.parse=void 0;var cf=ei();Object.defineProperty(Fe,"DatabaseError",{enumerable:!0,get:a( +function(){return cf.DatabaseError},"get")});var ff=Vo();Object.defineProperty(Fe,"serialize",{enumerable:!0, get:a(function(){return ff.serialize},"get")});var hf=Jo();function df(r,e){let t=new hf.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(df,"parse");Le.parse=df});var Zo={};ge(Zo,{connect:()=>pf});function pf({socket:r,servername:e}){return r.startTls(e),r}var Xo=te( -()=>{"use strict";p();a(pf,"connect")});var di=P((Ip,ra)=>{"use strict";p();var ea=(ze(),$(as)),yf=Pe().EventEmitter,{parse:mf,serialize:K}=li(), +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(df,"parse");Fe.parse=df});var Zo={};ge(Zo,{connect:()=>pf});function pf({socket:r,servername:e}){return r.startTls(e),r}var Xo=te( +()=>{"use strict";p();a(pf,"connect")});var di=P((Ip,ra)=>{"use strict";p();var ea=(Ye(),$(as)),yf=Pe().EventEmitter,{parse:mf,serialize:K}=ci(), ta=K.flush(),wf=K.sync(),gf=K.end(),hi=class hi extends yf{constructor(e){super(),e=e||{},this.stream= e.stream||new ea.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; @@ -972,9 +972,9 @@ 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=(Xo(),$(Zo));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= -n.ssl.key)),ea.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( +var u=(Xo(),$(Zo));let l={socket:n.stream};n.ssl!==!0&&(Object.assign(l,n.ssl),"key"in n.ssl&&(l.key= +n.ssl.key)),ea.isIP(t)===0&&(l.servername=t);try{n.stream=u.connect(l)}catch(c){return n.emit("error", +c)}n.attachListeners(n.stream),n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){e.on( "end",()=>{this.emit("end")}),mf(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(K.requestSsl())}startup(e){this. stream.write(K.startup(e))}cancel(e,t){this._send(K.cancel(e,t))}password(e){this._send(K.password(e))}sendSASLInitialResponseMessage(e,t){ @@ -986,8 +986,8 @@ stream.ref()}unref(){this.stream.unref()}end(){if(this._ending=!0,!this._connect this.stream.end();return}return this.stream.write(gf,()=>{this.stream.end()})}close(e){this._send(K. close(e))}describe(e){this._send(K.describe(e))}sendCopyFromChunk(e){this._send(K.copyData(e))}endCopyFrom(){ this._send(K.copyDone())}sendCopyFail(e){this._send(K.copyFail(e))}};a(hi,"Connection");var fi=hi;ra. -exports=fi});var sa=P((Bp,ia)=>{"use strict";p();var bf=Pe().EventEmitter,Pp=(Rt(),$(Tt)),xf=Ct(),pi=bo(),Sf=Po(), -vf=Xt(),Ef=sr(),na=Ho(),Af=_t(),_f=di(),yi=class yi extends bf{constructor(e){super(),this.connectionParameters= +exports=fi});var sa=P((Bp,ia)=>{"use strict";p();var bf=Pe().EventEmitter,Pp=(Rt(),$(Tt)),xf=It(),pi=bo(),Sf=Po(), +vf=Xt(),Ef=sr(),na=Ho(),Af=Ct(),_f=di(),yi=class yi extends bf{constructor(e){super(),this.connectionParameters= new Ef(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}), @@ -1064,13 +1064,13 @@ s==="'"?n+=s+s:s==="\\"?(n+=s+s,t=!0):n+=s}return n+="'",t===!0&&(n=" E"+n),n}_p readyForQuery===!0)if(this.activeQuery=this.queryQueue.shift(),this.activeQuery){this.readyForQuery= !1,this.hasExecuted=!0;let e=this.activeQuery.submit(this.connection);e&&w.nextTick(()=>{this.activeQuery. handleError(e,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&& -(this.activeQuery=null,this.emit("drain"))}query(e,t,n){var i,s,o,u,c;if(e==null)throw new TypeError( +(this.activeQuery=null,this.emit("drain"))}query(e,t,n){var i,s,o,u,l;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 na(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");w.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)}), +connectionParameters.query_timeout,i=new na(e,t,n),i.callback||(s=new this._Promise((c,f)=>{i.callback= +(y,g)=>y?f(y):c(g)}))),o&&(l=i.callback,u=setTimeout(()=>{var c=new Error("Query read timeout");w.nextTick( +()=>{i.handleError(c,this.connection)}),l(c),i.callback=()=>{};var f=this.queryQueue.indexOf(i);f>-1&& +this.queryQueue.splice(f,1),this._pulseQueryQueue()},o),i.callback=(c,f)=>{clearTimeout(u),l(c,f)}), this.binary&&!i.binary&&(i.binary=!0),i._result&&!i._result._types&&(i._result._types=this._types),this. _queryable?this._ending?(w.nextTick(()=>{i.handleError(new Error("Client was closed and is not query\ able"),this.connection)}),s):(this.queryQueue.push(i),this._pulseQueryQueue(),s):(w.nextTick(()=>{i. @@ -1078,10 +1078,10 @@ 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(yi,"Client");var fr=yi;fr.Query=na;ia.exports=fr});var ca=P((Mp,ua)=>{"use strict";p();var Cf=Pe().EventEmitter,oa=a(function(){},"NOOP"),aa=a((r,e)=>{ +_Promise(t=>{this.connection.once("end",t)})}};a(yi,"Client");var fr=yi;fr.Query=na;ia.exports=fr});var la=P((Mp,ua)=>{"use strict";p();var Cf=Pe().EventEmitter,oa=a(function(){},"NOOP"),aa=a((r,e)=>{ let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),gi=class gi{constructor(e,t,n){ this.client=e,this.idleListener=t,this.timeoutId=n}};a(gi,"IdleItem");var mi=gi,bi=class bi{constructor(e){ -this.callback=e}};a(bi,"PendingItem");var ot=bi;function If(){throw new Error("Release called on cli\ +this.callback=e}};a(bi,"PendingItem");var at=bi;function If(){throw new Error("Release called on cli\ ent which has already been released to the pool.")}a(If,"throwOnDoubleRelease");function hr(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(hr,"promisify"); @@ -1108,11 +1108,11 @@ this._idle,n=>n.client===e);t!==void 0&&clearTimeout(t.timeoutId),this._clients= 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=hr(this.Promise,e),n=t. result;if(this._isFull()||this._idle.length){if(this._idle.length&&w.nextTick(()=>this._pulseQueue()), -!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new ot(t.callback)),n;let i=a((u,c,l)=>{ -clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new ot(i),o=setTimeout(()=>{aa(this._pendingQueue, +!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new at(t.callback)),n;let i=a((u,l,c)=>{ +clearTimeout(o),t.callback(u,l,c)},"queueCallback"),s=new at(i),o=setTimeout(()=>{aa(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 ot(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( +newClient(new at(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( t);let n=Tf(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&& @@ -1120,7 +1120,7 @@ clearTimeout(i),t.on("error",n),o)this.log("client failed to connect",o),this._c 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,oa);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 ot((l,f,y)=>y()), +_expired.add(t),this._idle.findIndex(c=>c.client===t)!==-1&&this._acquireClient(t,new at((c,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. @@ -1136,14 +1136,14 @@ this.options.allowExitOnIdle&&s.unref()),this.options.allowExitOnIdle&&e.unref() e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=hr(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=hr(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){ +connect((s,o)=>{if(s)return n(s);let u=!1,l=a(c=>{u||(u=!0,o.release(c),n(c))},"onError");o.once("er\ +ror",l),this.log("dispatching query");try{o.query(e,t,(c,f)=>{if(this.log("query dispatched"),o.removeListener( +"error",l),!u)return u=!0,o.release(c),c?n(c):n(void 0,f)})}catch(c){return o.release(c),n(c)}}),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=hr(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(xi,"Pool");var wi=xi;ua.exports=wi});var la={};ge(la,{default:()=>Rf});var Rf,fa=te(()=>{"use strict";p();Rf={}});var ha=P((Op,Pf)=>{Pf.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javas\ +return this._clients.length}};a(xi,"Pool");var wi=xi;ua.exports=wi});var ca={};ge(ca,{default:()=>Rf});var Rf,fa=te(()=>{"use strict";p();Rf={}});var ha=P((Op,Pf)=>{Pf.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 ya=P((Np,pa)=>{"use strict";p();var da=Pe().EventEmitter,Bf=(Rt(),$(Tt)),Si=Ct(),at=pa.exports=function(r,e,t){ +a178655"}});var ya=P((Np,pa)=>{"use strict";p();var da=Pe().EventEmitter,Bf=(Rt(),$(Tt)),Si=It(),ut=pa.exports=function(r,e,t){ da.call(this),r=Si.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))};Bf.inherits(at,da); +this.on("newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};Bf.inherits(ut,da); var Lf={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"\ -file",sourceLine:"line",sourceFunction:"routine"};at.prototype.handleError=function(r){var e=this.native. +file",sourceLine:"line",sourceFunction:"routine"};ut.prototype.handleError=function(r){var e=this.native. pq.resultErrorFields();if(e)for(var t in e){var n=Lf[t]||t;r[n]=e[t]}this.callback?this.callback(r): -this.emit("error",r),this.state="error"};at.prototype.then=function(r,e){return this._getPromise().then( -r,e)};at.prototype.catch=function(r){return this._getPromise().catch(r)};at.prototype._getPromise=function(){ +this.emit("error",r),this.state="error"};ut.prototype.then=function(r,e){return this._getPromise().then( +r,e)};ut.prototype.catch=function(r){return this._getPromise().catch(r)};ut.prototype._getPromise=function(){ return this._promise?this._promise:(this._promise=new Promise(function(r,e){this._once("end",r),this. -_once("error",e)}.bind(this)),this._promise)};at.prototype.submit=function(r){this.state="running";var e=this; +_once("error",e)}.bind(this)),this._promise)};ut.prototype.submit=function(r){this.state="running";var e=this; this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a(function(s,o,u){if(r.native.arrayMode= !1,v(function(){e.emit("_done")}),s)return e.handleError(s);e._emitRowEvents&&(u.length>1?o.forEach( -(c,l)=>{c.forEach(f=>{e.emit("row",f,u[l])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="e\ +(l,c)=>{l.forEach(f=>{e.emit("row",f,u[c])})}):o.forEach(function(l){e.emit("row",l,u)})),e.state="e\ nd",e.emit("end",u),e.callback&&e.callback(null,u)},"after");if(w.domain&&(t=w.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\ @@ -1176,7 +1176,7 @@ red statements must be unique - '${this.name}' was used for a different statemen 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(Si. -prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var ba=P((Wp,ga)=>{"use strict";p();var Ff=(fa(),$(la)),Mf=Xt(),jp=ha(),ma=Pe().EventEmitter,kf=(Rt(),$(Tt)), +prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var ba=P((Wp,ga)=>{"use strict";p();var Ff=(fa(),$(ca)),Mf=Xt(),jp=ha(),ma=Pe().EventEmitter,kf=(Rt(),$(Tt)), Uf=sr(),wa=ya(),se=ga.exports=function(r){ma.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. _types=new Mf(r.types),this.native=new Ff({types:this._types}),this._queryQueue=[],this._ending=!1,this. _connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Uf(r);this. @@ -1194,11 +1194,11 @@ _pulseQueryQueue(!0),r()})})};se.prototype.connect=function(r){if(r){this._conne _Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};se.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=="f\ unction")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 wa(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");w.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,w.nextTick(()=>{n.handleError( +e);else if(s=this.connectionParameters.query_timeout,n=new wa(r,e,t),!n.callback){let l,c;i=new this. +_Promise((f,y)=>{l=f,c=y}),n.callback=(f,y)=>f?c(f):l(y)}return s&&(u=n.callback,o=setTimeout(()=>{var l=new Error( +"Query read timeout");w.nextTick(()=>{n.handleError(l,this.connection)}),u(l),n.callback=()=>{};var c=this. +_queryQueue.indexOf(n);c>-1&&this._queryQueue.splice(c,1),this._pulseQueryQueue()},s),n.callback=(l,c)=>{ +clearTimeout(o),u(l,c)}),this._queryable?this._ending?(n.native=this.native,w.nextTick(()=>{n.handleError( new Error("Client was closed and is not queryable"))}),i):(this._queryQueue.push(n),this._pulseQueryQueue(), i):(n.native=this.native,w.nextTick(()=>{n.handleError(new Error("Client has encountered a connectio\ n error and is not queryable"))}),i)};se.prototype.end=function(r){var e=this;this._ending=!0,this._connected|| @@ -1211,31 +1211,31 @@ in");return}this._activeQuery=e,e.submit(this);var t=this;e.once("_done",functio se.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};se.prototype.ref=function(){}; se.prototype.unref=function(){};se.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( -r,e,t)};se.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var vi=P((Gp,xa)=>{"use strict";p();xa.exports=ba()});var Bt=P((Kp,Lt)=>{"use strict";p();var Df=sa(),Of=_t(),Nf=di(),qf=ca(),{DatabaseError:Qf}=li(),jf=a( +r,e,t)};se.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var vi=P((Gp,xa)=>{"use strict";p();xa.exports=ba()});var Bt=P((Kp,Lt)=>{"use strict";p();var Df=sa(),Of=Ct(),Nf=di(),qf=la(),{DatabaseError:Qf}=ci(),jf=a( r=>{var e;return e=class extends qf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),Ei=a( function(r){this.defaults=Of,this.Client=r,this.Query=this.Client.Query,this.Pool=jf(this.Client),this. -_pools=[],this.Connection=Nf,this.types=vt(),this.DatabaseError=Qf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< +_pools=[],this.Connection=Nf,this.types=Et(),this.DatabaseError=Qf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< "u"?Lt.exports=new Ei(vi()):(Lt.exports=new Ei(Df),Object.defineProperty(Lt.exports,"native",{configurable:!0, enumerable:!1,get(){var r=null;try{r=new Ei(vi())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. -defineProperty(Lt.exports,"native",{value:r}),r}}))});p();p();ze();Rr();p();var wu=Object.defineProperty,gu=Object.defineProperties,bu=Object.getOwnPropertyDescriptors,cs=Object. -getOwnPropertySymbols,xu=Object.prototype.hasOwnProperty,Su=Object.prototype.propertyIsEnumerable,ls=a( +defineProperty(Lt.exports,"native",{value:r}),r}}))});p();p();Ye();Rr();p();var wu=Object.defineProperty,gu=Object.defineProperties,bu=Object.getOwnPropertyDescriptors,ls=Object. +getOwnPropertySymbols,xu=Object.prototype.hasOwnProperty,Su=Object.prototype.propertyIsEnumerable,cs=a( (r,e,t)=>e in r?wu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), -vu=a((r,e)=>{for(var t in e||(e={}))xu.call(e,t)&&ls(r,t,e[t]);if(cs)for(var t of cs(e))Su.call(e,t)&& -ls(r,t,e[t]);return r},"__spreadValues"),Eu=a((r,e)=>gu(r,bu(e)),"__spreadProps"),Au=1008e3,fs=new Uint8Array( +vu=a((r,e)=>{for(var t in e||(e={}))xu.call(e,t)&&cs(r,t,e[t]);if(ls)for(var t of ls(e))Su.call(e,t)&& +cs(r,t,e[t]);return r},"__spreadValues"),Eu=a((r,e)=>gu(r,bu(e)),"__spreadProps"),Au=1008e3,fs=new Uint8Array( new Uint16Array([258]).buffer)[0]===2,_u=new TextDecoder,Pr=new TextEncoder,qt=Pr.encode("0123456789\ abcdef"),Qt=Pr.encode("0123456789ABCDEF"),Cu=Pr.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ stuvwxyz0123456789+/");var hs=Cu.slice();hs[62]=45;hs[63]=95;var ct,jt;function Iu(r,{alphabet:e,scratchArr:t}={}){if(!ct)if(ct= new Uint16Array(256),jt=new Uint16Array(256),fs)for(let C=0;C<256;C++)ct[C]=qt[C&15]<<8|qt[C>>>4],jt[C]= Qt[C&15]<<8|Qt[C>>>4];else for(let C=0;C<256;C++)ct[C]=qt[C&15]|qt[C>>>4]<<8,jt[C]=Qt[C&15]|Qt[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"?jt:ct,f=0,y=0,g;if(fs) -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>>8&255]<<16|c[g&255],l[y++]=c[g>>>24]<<16|c[g>>>16&255];else for(;f>>24]<<16|c[g>>>16&255],l[y++]=c[g>>>8&255]<<16|c[g&255];for(f<<=2;f>>1,s=Math. -ceil(n/i),o=new Uint16Array(s>1?i:n);for(let u=0;u1?i:n);for(let u=0;ut[he(this. _mapKey.has(i)?this._mapKey.get(i):i)]=n),t}mapDecode(e,t){let n=this.decode(e);if(this._keyMap)switch(n. constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return As( -()=>(Nr(),this?this.decode(e,t):ht.prototype.decode.call(ms,e,t)));Qe=t>-1?t:e.length,h=0,Fr=0,dt=0, +()=>(Nr(),this?this.decode(e,t):dt.prototype.decode.call(ms,e,t)));je=t>-1?t:e.length,h=0,Fr=0,pt=0, $t=null,Lr=bs,j=null,x=e;try{X=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ throw x=null,e instanceof Uint8Array?n:new Error("Source must be a Uint8Array or Buffer but was a "+ -(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof ht){if(B=this,ne=this.sharedValues&& +(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof dt){if(B=this,ne=this.sharedValues&& (this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this. structures)return N=this.structures,Wt();(!N||N.length>0)&&(N=[])}else B=ms,(!N||N.length>0)&&(N=[]), -ne=null;return Wt()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;pt=!0;let o=this?this.decode(e, +ne=null;return Wt()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;yt=!0;let o=this?this.decode(e, s):Qr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=j.postBundlePosition){let e=new Error("Unexpected bundle pos\ -ition");throw e.incomplete=!0,e}h=j.postBundlePosition,j=null}if(h==Qe)N=null,x=null,fe&&(fe=null);else if(h> -Qe){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!pt)throw new Error( +i=h,n.push(Wt());return n}}catch(s){throw s.lastPosition=i,s.values=n,s}finally{yt=!1,Nr()}}};a(dt,"\ +Decoder");var kr=dt;function Wt(){try{let r=L();if(j){if(h>=j.postBundlePosition){let e=new Error("Unexpected bundle pos\ +ition");throw e.incomplete=!0,e}h=j.postBundlePosition,j=null}if(h==je)N=null,x=null,fe&&(fe=null);else if(h> +je){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!yt)throw new Error( "Data read, but end of buffer not reached");return r}catch(r){throw Nr(),(r instanceof RangeError||r. message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a(Wt,"checkedRead");function L(){ let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return ku();r=X. @@ -1267,27 +1267,27 @@ r;break;case 27:if(e==7){let t=X.getFloat64(h);return h+=8,t}if(e>1){if(X.getUin "JavaScript does not support arrays, maps, or strings with length over 4294967295");r=X.getUint32(h+ 4)}else B.int64AsNumber?(r=X.getUint32(h)*4294967296,r+=X.getUint32(h+4)):r=X.getBigUint64(h);h+=8;break;case 31: switch(e){case 2:case 3:throw new Error("Indefinite length not supported for byte or text strings");case 4: -let t=[],n,i=0;for(;(n=L())!=Ye;){if(i>=lt)throw new Error(`Array length exceeds ${lt}`);t[i++]=n}return e== +let t=[],n,i=0;for(;(n=L())!=Je;){if(i>=ft)throw new Error(`Array length exceeds ${ft}`);t[i++]=n}return e== 4?t:e==3?t.join(""):m.concat(t);case 5:let s;if(B.mapsAsObjects){let o={},u=0;if(B.keyMap)for(;(s=L())!= -Ye;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[he(B.decodeKey(s))]=L()}else for(;(s= -L())!=Ye;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[he(s)]=L()}return o}else{ft&& -(B.mapsAsObjects=!0,ft=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s=L())!=Ye;){if(u++>=Ae)throw new Error( -`Map size exceeds ${Ae}`);o.set(B.decodeKey(s),L())}}else{let u=0;for(;(s=L())!=Ye;){if(u++>=Ae)throw new Error( -`Map size exceeds ${Ae}`);o.set(s,L())}}return o}case 7:return Ye;default:throw new Error("Invalid m\ +Je;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[he(B.decodeKey(s))]=L()}else for(;(s= +L())!=Je;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[he(s)]=L()}return o}else{ht&& +(B.mapsAsObjects=!0,ht=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s=L())!=Je;){if(u++>=Ae)throw new Error( +`Map size exceeds ${Ae}`);o.set(B.decodeKey(s),L())}}else{let u=0;for(;(s=L())!=Je;){if(u++>=Ae)throw new Error( +`Map size exceeds ${Ae}`);o.set(s,L())}}return o}case 7:return Je;default:throw new Error("Invalid m\ ajor type for indefinite length "+e)}default:throw new Error("Unknown token "+r)}switch(e){case 0:return r;case 1: -return~r;case 2:return Mu(r);case 3:if(dt>=h)return $t.slice(h-Gt,(h+=r)-Gt);if(dt==0&&Qe<140&&r<32){ -let i=r<16?Ss(r):Fu(r);if(i!=null)return i}return Lu(r);case 4:if(r>=lt)throw new Error(`Array lengt\ -h exceeds ${lt}`);let t=new Array(r);for(let i=0;i=Ae)throw new Error( -`Map size exceeds ${lt}`);if(B.mapsAsObjects){let i={};if(B.keyMap)for(let s=0;s=h)return $t.slice(h-Gt,(h+=r)-Gt);if(pt==0&&je<140&&r<32){ +let i=r<16?Ss(r):Fu(r);if(i!=null)return i}return Lu(r);case 4:if(r>=ft)throw new Error(`Array lengt\ +h exceeds ${ft}`);let t=new Array(r);for(let i=0;i=Ae)throw new Error( +`Map size exceeds ${ft}`);if(B.mapsAsObjects){let i={};if(B.keyMap)for(let s=0;s=ps){let i=N[r&8191];if(i)return i.read||(i.read=Ur(i)),i.read();if(r<65536){if(r== -Bu){let s=Ze(),o=L(),u=L();Or(o,u);let c={};if(B.keyMap)for(let l=2;l244||h>=t||(s&192)!==128||i===240&&s<144||i===244&&s>=144)n.push(65533);else if(h++,h>= t||(x[h]&192)!==128)n.push(65533);else{let o=x[h++]&63;if(h>=t||(x[h]&192)!==128)n.push(65533);else{ -let u=x[h++]&63,c=(i&7)<<18|(s&63)<<12|o<<6|u;c-=65536,n.push(c>>>10&1023|55296),n.push(56320|c&1023)}}}else +let u=x[h++]&63,l=(i&7)<<18|(s&63)<<12|o<<6|u;l-=65536,n.push(l>>>10&1023|55296),n.push(56320|l&1023)}}}else n.push(65533);n.length>=4096&&(e+=V.apply(String,n),n.length=0)}return n.length>0&&(e+=V.apply(String, n)),e}a(Dr,"readStringJS");var V=String.fromCharCode;function Fu(r){let e=h,t=new Array(r);for(let n=0;n< r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return V.apply(String,t)}a(Fu,"longStringInJS"); @@ -1318,42 +1318,42 @@ let e=x[h++],t=x[h++];if((e&128)>0||(t&128)>0){h-=2;return}if(r<3)return V(e,t); (n&128)>0||(i&128)>0){h-=4;return}if(r<6){if(r===4)return V(e,t,n,i);{let s=x[h++];if((s&128)>0){h-= 5;return}return V(e,t,n,i,s)}}else if(r<8){let s=x[h++],o=x[h++];if((s&128)>0||(o&128)>0){h-=6;return} if(r<7)return V(e,t,n,i,s,o);let u=x[h++];if((u&128)>0){h-=7;return}return V(e,t,n,i,s,o,u)}else{let s=x[h++], -o=x[h++],u=x[h++],c=x[h++];if((s&128)>0||(o&128)>0||(u&128)>0||(c&128)>0){h-=8;return}if(r<10){if(r=== -8)return V(e,t,n,i,s,o,u,c);{let l=x[h++];if((l&128)>0){h-=9;return}return V(e,t,n,i,s,o,u,c,l)}}else if(r< -12){let l=x[h++],f=x[h++];if((l&128)>0||(f&128)>0){h-=10;return}if(r<11)return V(e,t,n,i,s,o,u,c,l,f); -let y=x[h++];if((y&128)>0){h-=11;return}return V(e,t,n,i,s,o,u,c,l,f,y)}else{let l=x[h++],f=x[h++],y=x[h++], -g=x[h++];if((l&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return V(e,t, -n,i,s,o,u,c,l,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E)}}else{ -let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return V(e,t,n,i,s,o,u,c,l,f,y,g, -E,C);let W=x[h++];if((W&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E,C,W)}}}}}a(Ss,"short\ +o=x[h++],u=x[h++],l=x[h++];if((s&128)>0||(o&128)>0||(u&128)>0||(l&128)>0){h-=8;return}if(r<10){if(r=== +8)return V(e,t,n,i,s,o,u,l);{let c=x[h++];if((c&128)>0){h-=9;return}return V(e,t,n,i,s,o,u,l,c)}}else if(r< +12){let c=x[h++],f=x[h++];if((c&128)>0||(f&128)>0){h-=10;return}if(r<11)return V(e,t,n,i,s,o,u,l,c,f); +let y=x[h++];if((y&128)>0){h-=11;return}return V(e,t,n,i,s,o,u,l,c,f,y)}else{let c=x[h++],f=x[h++],y=x[h++], +g=x[h++];if((c&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return V(e,t, +n,i,s,o,u,l,c,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return V(e,t,n,i,s,o,u,l,c,f,y,g,E)}}else{ +let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return V(e,t,n,i,s,o,u,l,c,f,y,g, +E,C);let W=x[h++];if((W&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,l,c,f,y,g,E,C,W)}}}}}a(Ss,"short\ StringInJS");function Mu(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( h,h+=r)}a(Mu,"readBin");var vs=new Float32Array(1),Ht=new Uint8Array(vs.buffer,0,4);function ku(){let r=x[h++],e=x[h++],t=(r& 127)>>2;if(t===31)return e||r&3?NaN:r&128?-1/0:1/0;if(t===0){let n=((r&3)<<8|e)/16777216;return r&128? --n:n}return Ht[3]=r&128|(t>>1)+56,Ht[2]=(r&7)<<5|e>>3,Ht[1]=e<<5,Ht[0]=0,vs[0]}a(ku,"getFloat16");var lh=new Array( -4096);var jr=class jr{constructor(e,t){this.value=e,this.tag=t}};a(jr,"Tag");var Xe=jr;q[0]=r=>new Date(r); +-n:n}return Ht[3]=r&128|(t>>1)+56,Ht[2]=(r&7)<<5|e>>3,Ht[1]=e<<5,Ht[0]=0,vs[0]}a(ku,"getFloat16");var ch=new Array( +4096);var jr=class jr{constructor(e,t){this.value=e,this.tag=t}};a(jr,"Tag");var et=jr;q[0]=r=>new Date(r); q[1]=r=>new Date(Math.round(r*1e3));q[2]=r=>{let e=BigInt(0);for(let t=0,n=r.byteLength;tBigInt(-1)-q[2](r);q[4]=r=>+(r[1]+"e"+r[0]);q[5]=r=>r[1]*Math. exp(r[0]*Math.log(2));var Or=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. restoreStructures=[]))[r]=t),N[r]=e,e.read=Ur(e)},"recordDefinition");q[Ru]=r=>{let e=r.length,t=r[1]; Or(r[0],t);let n={};for(let i=2;ij?j[0].slice( -j.position0,j.position0+=r):new Xe(r,14);q[15]=r=>j?j[1].slice(j.position1,j.position1+=r):new Xe(r, +j.position0,j.position0+=r):new et(r,14);q[15]=r=>j?j[1].slice(j.position1,j.position1+=r):new et(r, 15);var Uu={Error,RegExp};q[27]=r=>(Uu[r[0]]||Error)(r[1],r[2]);var Es=a(r=>{if(x[h++]!=132){let t=new Error( "Packed values structure must be followed by a 4 element array");throw x.length{if(!ne)if(B.getShared)qr();else return new Xe( +r(),r()},"packedTable");Es.handlesRead=!0;q[51]=Es;q[ys]=r=>{if(!ne)if(B.getShared)qr();else return new et( r,ys);if(typeof r=="number")return ne[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ ger packed references yet");throw r===void 0&&(e.incomplete=!0),e};q[28]=r=>{fe||(fe=new Map,fe.id=0); let e=fe.id++,t=h,n=x[h],i;n>>5==4?i=[]:i={};let s={target:i};fe.set(e,s);let o=r();return s.used?(Object. getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(h=t,i=o,fe.set(e,{target:i}),o=r()),Object.assign(i,o)): (s.target=o,o)};q[28].handlesRead=!0;q[29]=r=>{let e=fe.get(r);return e.used=!0,e.target};q[258]=r=>new Set( -r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,ft=!0),r())).handlesRead=!0;function Je(r,e){return typeof r== -"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Je,"combine");function qe(){if(!ne) -if(B.getShared)qr();else throw new Error("No packed values available");return ne}a(qe,"getPackedValu\ -es");var Du=1399353956;Mr.push((r,e)=>{if(r>=225&&r<=255)return Je(qe().prefixes[r-224],e);if(r>=28704&& -r<=32767)return Je(qe().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return Je(qe().prefixes[r- -1879048192],e);if(r>=216&&r<=223)return Je(e,qe().suffixes[r-216]);if(r>=27647&&r<=28671)return Je(e, -qe().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return Je(e,qe().suffixes[r-1811939328]);if(r== +r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,ht=!0),r())).handlesRead=!0;function Ze(r,e){return typeof r== +"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Ze,"combine");function Qe(){if(!ne) +if(B.getShared)qr();else throw new Error("No packed values available");return ne}a(Qe,"getPackedValu\ +es");var Du=1399353956;Mr.push((r,e)=>{if(r>=225&&r<=255)return Ze(Qe().prefixes[r-224],e);if(r>=28704&& +r<=32767)return Ze(Qe().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return Ze(Qe().prefixes[r- +1879048192],e);if(r>=216&&r<=223)return Ze(e,Qe().suffixes[r-216]);if(r>=27647&&r<=28671)return Ze(e, +Qe().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return Ze(e,Qe().suffixes[r-1811939328]);if(r== Du)return{packedValues:ne,structures:N.slice(0),version:e};if(r==55799)return e});var Ou=new Uint8Array( new Uint16Array([1]).buffer)[0]==1,gs=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> "u"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"? @@ -1364,24 +1364,24 @@ for(let r=0;r>s):new r(Uint8Array.prototype.slice.call(o,0).buffer)}: o=>{if(!r)throw new Error("Could not find typed array for code "+e);let u=new DataView(o.buffer,o.byteOffset, -o.byteLength),c=o.length>>s,l=new r(c),f=u[t];for(let y=0;y23)switch(r){case 24:r=x[h++];break;case 25:r=X.getUint16( -h),h+=2;break;case 26:r=X.getUint32(h),h+=4;break}return r}a(Ze,"readJustLength");function qr(){if(B. +o.byteLength),l=o.length>>s,c=new r(l),f=u[t];for(let y=0;y23)switch(r){case 24:r=x[h++];break;case 25:r=X.getUint16( +h),h+=2;break;case 26:r=X.getUint32(h),h+=4;break}return r}a(Xe,"readJustLength");function qr(){if(B. getShared){let r=As(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ne= B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(qr, -"loadShared");function As(r){let e=Qe,t=h,n=Fr,i=Gt,s=dt,o=$t,u=Lr,c=fe,l=j,f=new Uint8Array(x.slice( -0,Qe)),y=N,g=B,E=pt,C=r();return Qe=e,h=t,Fr=n,Gt=i,dt=s,$t=o,Lr=u,fe=c,j=l,x=f,pt=E,N=y,B=g,X=new DataView( +"loadShared");function As(r){let e=je,t=h,n=Fr,i=Gt,s=pt,o=$t,u=Lr,l=fe,c=j,f=new Uint8Array(x.slice( +0,je)),y=N,g=B,E=yt,C=r();return je=e,h=t,Fr=n,Gt=i,pt=s,$t=o,Lr=u,fe=l,j=c,x=f,yt=E,N=y,B=g,X=new DataView( x.buffer,x.byteOffset,x.byteLength),C}a(As,"saveState");function Nr(){x=null,fe=null,N=null}a(Nr,"cl\ earSource");var _s=new Array(147);for(let r=0;r<256;r++)_s[r]=+("1e"+Math.floor(45.15-r*.30103));var Qr=new kr({ useRecords:!1}),fh=Qr.decode,Cs=Qr.decodeMultiple;p();var Vt=class Vt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ let{strings:t,values:n}=this;for(let i=0,s=t.length;iu.length!==0).map(u=>JSON.parse(u)):Cs(new Uint8Array(await r.arrayBuffer())),i=n.at(-1); if(!Array.isArray(i)||i[0]!==3&&i[0]!==4)throw new pe("Neon internal error: streamed response ended \ without a terminal message");if(i[0]===4&&i.length===2&&i[1]!==null&&typeof i[1]=="object")throw ho( i[1]);if(i[0]!==3||i.length!==1)throw new pe("Neon internal error: unexpected streamed response stat\ -us");let s=[],o;for(let u of n.slice(0,-1)){Array.isArray(u)||It();let[c,...l]=u;switch(c){case Jc:o!== -void 0&&It(),o={fields:l,rows:[]};break;case Yc:o===void 0&&It(),o.rows.push(l);break;case Zc:(o===void 0|| -l.length!==2)&&It(),s.push({fields:o.fields,rows:o.rows,command:l[0],rowCount:l[1]}),o=void 0;break;default: -It()}}if(o!==void 0||!t&&s.length!==1)throw new pe("Neon internal error: incomplete streamed respons\ -e");return t?{results:s}:s[0]}a(Xc,"readStreamingResult");function el(r){return r instanceof m?"\\x"+ -ds(r):r}a(el,"encodeBuffersAsBytea");function uo(r){let{query:e,params:t}=r instanceof yt?r.toParameterizedQuery(): -r;return{query:e,params:t.map(n=>el((0,fo.prepareValue)(n)))}}a(uo,"prepareQuery");function po(r,{arrayMode:e, -fullResults:t,fetchOptions:n,responseFormat:i,isolationLevel:s,readOnly:o,deferrable:u,authToken:c,disableWarningInBrowsers:l}={}){ -if(!r)throw new Error("No database connection string was provided to `neon()`. Perhaps an environmen\ -t variable has not been set?");let f;try{f=Tr(r)}catch{throw new Error("Database connection string p\ -rovided to `neon()` is not a valid URL. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E, -port:C,pathname:W}=f;if(y!=="postgres:"&&y!=="postgresql:"||!g||!E||!W)throw new Error("Database con\ -nection string format for `neon()` should be: postgresql://user@host.tld/dbname?option=value");function Y(T,...b){ -if(!(Array.isArray(T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can no\ -w be called only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], \ -options). For a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SE\ -LECT $1", [value], options).');return new je(me,new yt(T,b))}a(Y,"templateFn"),Y.query=(T,b,M)=>new je( -me,{query:T,params:b??[]},M),Y.unsafe=T=>new mt(T),Y.transaction=async(T,b)=>{if(typeof T=="function"&& -(T=T(Y)),!Array.isArray(T))throw new Error(ao);T.forEach(H=>{if(!(H instanceof je))throw new Error(ao)}); -let M=T.map(H=>H.queryData),oe=T.map(H=>H.opts??{});return me(M,oe,b)};async function me(T,b,M){let{ -fetchEndpoint:oe,fetchFunction:H}=Se,we=Array.isArray(T),Ce=we?{queries:T.map(ce=>uo(ce))}:uo(T),ue=n?? -{},F=i??"json",J=e??!1,ve=t??!1,Ie=s,Fe=o,Me=u;M!==void 0&&(M.fetchOptions!==void 0&&(ue={...ue,...M. -fetchOptions}),M.arrayMode!==void 0&&(J=M.arrayMode),M.fullResults!==void 0&&(ve=M.fullResults),M.responseFormat!== -void 0&&(F=M.responseFormat),M.isolationLevel!==void 0&&(Ie=M.isolationLevel),M.readOnly!==void 0&&(Fe= -M.readOnly),M.deferrable!==void 0&&(Me=M.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!== -void 0&&(ue={...ue,...b.fetchOptions}),b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(F= -b.responseFormat);let ke=c;!Array.isArray(b)&&b?.authToken!==void 0&&(ke=b.authToken);let dr=typeof oe== -"function"?oe(E,C,{jwtAuth:ke!==void 0}):oe,Ue={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ -rue","Neon-Array-Mode":"true",Accept:zc[F]},Te=await tl(ke);Te&&(Ue.Authorization=`Bearer ${Te}`),we&& -(Ie!==void 0&&(Ue["Neon-Batch-Isolation-Level"]=Ie),Fe!==void 0&&(Ue["Neon-Batch-Read-Only"]=String( -Fe)),Me!==void 0&&(Ue["Neon-Batch-Deferrable"]=String(Me))),l||Se.disableWarningInBrowsers||Kt();let Z; -try{Z=await(H??fetch)(dr,{method:"POST",body:JSON.stringify(Ce),headers:Ue,...ue})}catch(ce){let ae=new pe( -`Error connecting to database: ${ce}`);throw ae.sourceError=ce,ae}if(Z.ok){let ce=F==="json"?await Z. -json():await Xc(Z,F,we);if(we){let ae=ce.results;if(!Array.isArray(ae))throw new pe("Neon internal e\ -rror: unexpected result format");return ae.map((pr,yr)=>{let mr=b[yr]??{},Aa=mr.arrayMode??J,_a=mr.fullResults?? -ve;return co(pr,{arrayMode:Aa,fullResults:_a,types:mr.types})})}else{let ae=b??{},pr=ae.arrayMode??J, -yr=ae.fullResults??ve;return co(ce,{arrayMode:pr,fullResults:yr,types:ae.types})}}else{let{status:ce}=Z; -if(ce===400){let ae=await Z.json();throw ho(ae)}else{let ae=await Z.text();throw new pe(`Server erro\ -r (HTTP status ${ce}): ${ae}`)}}}return a(me,"execute"),Y}a(po,"neon");var sn=class sn{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(sn,"NeonQueryPromise");var je=sn;function co(r,{arrayMode:e, -fullResults:t,types:n}){let i=new lo.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(co,"processQueryResult");async function tl(r){if(typeof r=="string")return r;if(typeof r== -"function")try{return await Promise.resolve(r())}catch(e){let t=new pe("Error getting auth token."); -throw e instanceof Error&&(t=new pe(`Error getting auth token: ${e.message}`)),t}}a(tl,"getAuthToken");p();var va=De(Bt());p();var Sa=De(Bt());var Ai=class Ai extends Sa.Client{constructor(t){super(t);this.config=t}get neonConfig(){return this. +us");let s=[],o;for(let u of n.slice(0,-1)){Array.isArray(u)||Be();let[l,...c]=u;switch(l){case Jl:o!== +void 0&&Be(),o={fields:c,rows:[]};break;case Yl:(o===void 0||c.length===0)&&Be();let f=o.row??(o.row= +[]);for(let[y,g]of c.entries()){if((f.length>=o.fields.length||Array.isArray(g)&&(g.length!==1||typeof g[0]!= +"string")||!Array.isArray(g)&&g!==null&&typeof g!="string")&&Be(),Array.isArray(g)){(o.partialText?? +(o.partialText=[])).push(g[0]);continue}g===null?(o.partialText!==void 0&&Be(),f.push(null)):(o.partialText=== +void 0?f.push(g):(o.partialText.push(g),f.push(o.partialText.join(""))),o.partialText=void 0),f.length=== +o.fields.length&&(y!==c.length-1&&Be(),o.rows.push(f),o.row=void 0)}break;case Zl:(o===void 0||o.row!== +void 0||o.partialText!==void 0||c.length!==2)&&Be(),s.push({fields:o.fields,rows:o.rows,command:c[0], +rowCount:c[1]}),o=void 0;break;default:Be()}}if(o!==void 0||!t&&s.length!==1)throw new pe("Neon inte\ +rnal error: incomplete streamed response");return t?{results:s}:s[0]}a(Xl,"readStreamingResult");function ec(r){ +return r instanceof m?"\\x"+ds(r):r}a(ec,"encodeBuffersAsBytea");function uo(r){let{query:e,params:t}=r instanceof +mt?r.toParameterizedQuery():r;return{query:e,params:t.map(n=>ec((0,fo.prepareValue)(n)))}}a(uo,"prep\ +areQuery");function po(r,{arrayMode:e,fullResults:t,fetchOptions:n,responseFormat:i,isolationLevel:s, +readOnly:o,deferrable:u,authToken:l,disableWarningInBrowsers:c}={}){if(!r)throw new Error("No databa\ +se connection string was provided to `neon()`. Perhaps an environment variable has not been set?");let f; +try{f=Tr(r)}catch{throw new Error("Database connection string provided to `neon()` is not a valid UR\ +L. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E,port:C,pathname:W}=f;if(y!== +"postgres:"&&y!=="postgresql:"||!g||!E||!W)throw new Error("Database connection string format for `n\ +eon()` should be: postgresql://user@host.tld/dbname?option=value");function Y(T,...b){if(!(Array.isArray( +T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can now be called only as\ + a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], options). For a con\ +ventional function call with value placeholders ($1, $2, etc.), use sql.query("SELECT $1", [value], \ +options).');return new We(me,new mt(T,b))}a(Y,"templateFn"),Y.query=(T,b,M)=>new We(me,{query:T,params:b?? +[]},M),Y.unsafe=T=>new wt(T),Y.transaction=async(T,b)=>{if(typeof T=="function"&&(T=T(Y)),!Array.isArray( +T))throw new Error(ao);T.forEach(H=>{if(!(H instanceof We))throw new Error(ao)});let M=T.map(H=>H.queryData), +oe=T.map(H=>H.opts??{});return me(M,oe,b)};async function me(T,b,M){let{fetchEndpoint:oe,fetchFunction:H}=Se, +we=Array.isArray(T),Ce=we?{queries:T.map(le=>uo(le))}:uo(T),ue=n??{},F=i??"json",J=e??!1,ve=t??!1,Ie=s, +Me=o,ke=u;M!==void 0&&(M.fetchOptions!==void 0&&(ue={...ue,...M.fetchOptions}),M.arrayMode!==void 0&& +(J=M.arrayMode),M.fullResults!==void 0&&(ve=M.fullResults),M.responseFormat!==void 0&&(F=M.responseFormat), +M.isolationLevel!==void 0&&(Ie=M.isolationLevel),M.readOnly!==void 0&&(Me=M.readOnly),M.deferrable!== +void 0&&(ke=M.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!==void 0&&(ue={...ue,...b.fetchOptions}), +b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(F=b.responseFormat);let Ue=l;!Array.isArray( +b)&&b?.authToken!==void 0&&(Ue=b.authToken);let dr=typeof oe=="function"?oe(E,C,{jwtAuth:Ue!==void 0}): +oe,De={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"true","Neon-Array-Mode":"true",Accept:zl[F]}, +Te=await tc(Ue);Te&&(De.Authorization=`Bearer ${Te}`),we&&(Ie!==void 0&&(De["Neon-Batch-Isolation-Le\ +vel"]=Ie),Me!==void 0&&(De["Neon-Batch-Read-Only"]=String(Me)),ke!==void 0&&(De["Neon-Batch-Deferrab\ +le"]=String(ke))),c||Se.disableWarningInBrowsers||Kt();let Z;try{Z=await(H??fetch)(dr,{method:"POST", +body:JSON.stringify(Ce),headers:De,...ue})}catch(le){let ae=new pe(`Error connecting to database: ${le}`); +throw ae.sourceError=le,ae}if(Z.ok){let le=F==="json"?await Z.json():await Xl(Z,F,we);if(we){let ae=le. +results;if(!Array.isArray(ae))throw new pe("Neon internal error: unexpected result format");return ae. +map((pr,yr)=>{let mr=b[yr]??{},Aa=mr.arrayMode??J,_a=mr.fullResults??ve;return lo(pr,{arrayMode:Aa,fullResults:_a, +types:mr.types})})}else{let ae=b??{},pr=ae.arrayMode??J,yr=ae.fullResults??ve;return lo(le,{arrayMode:pr, +fullResults:yr,types:ae.types})}}else{let{status:le}=Z;if(le===400){let ae=await Z.json();throw ho(ae)}else{ +let ae=await Z.text();throw new pe(`Server error (HTTP status ${le}): ${ae}`)}}}return a(me,"execute"), +Y}a(po,"neon");var sn=class sn{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(sn,"Neon\ +QueryPromise");var We=sn;function lo(r,{arrayMode:e,fullResults:t,types:n}){let i=new co.default(n), +s=r.fields.map(l=>l.name),o=r.fields.map(l=>i.getTypeParser(l.dataTypeID)),u=e===!0?r.rows.map(l=>l. +map((c,f)=>c===null?null:o[f](c))):r.rows.map(l=>Object.fromEntries(l.map((c,f)=>[s[f],c===null?null: +o[f](c)])));return t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=u,r._parsers=o,r._types=i,r):u}a(lo,"p\ +rocessQueryResult");async function tc(r){if(typeof r=="string")return r;if(typeof r=="function")try{ +return await Promise.resolve(r())}catch(e){let t=new pe("Error getting auth token.");throw e instanceof +Error&&(t=new pe(`Error getting auth token: ${e.message}`)),t}}a(tc,"getAuthToken");p();var va=Oe(Bt());p();var Sa=Oe(Bt());var Ai=class Ai extends Sa.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\ @@ -1473,46 +1479,46 @@ s&&this.database===s&&this.password===null)throw new Error(`No database host or 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|| +l=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let c=this.connection;if(u&&c.on( +"connect",()=>c.stream.emit("data","S")),l){c.removeAllListeners("authenticationCleartextPassword"), +c.removeAllListeners("readyForQuery"),c.once("readyForQuery",()=>c.on("readyForQuery",this._handleReadyForQuery. +bind(this)));let f=this.ssl?"sslconnect":"connect";c.on(f,()=>{this.neonConfig.disableWarningInBrowsers|| Kt(),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(Te=>{if(!/^.=/.test(Te))throw new Error( -"SASL: Invalid attribute pair entry");let Z=Te[0],ce=Te.substring(2);return[Z,ce]})),c=u.r,l=u.s,f=u. -i;if(!c||!/^[!-+--~]+$/.test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unp\ -rintable");if(!l||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(l))throw new Error( +"SASL: Invalid attribute pair entry");let Z=Te[0],le=Te.substring(2);return[Z,le]})),l=u.r,c=u.s,f=u. +i;if(!l||!/^[!-+--~]+$/.test(l))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unp\ +rintable");if(!c||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(c))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. +"SASL: SCRAM-SERVER-FIRST-MESSAGE: missing/invalid iteration count");if(!l.startsWith(i.clientNonce)) +throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");if(l. length===i.clientNonce.length)throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too\ - short");let y=parseInt(f,10),g=m.from(l,"base64"),E=new TextEncoder,C=E.encode(s),W=await n.importKey( + short");let y=parseInt(f,10),g=m.from(c,"base64"),E=new TextEncoder,C=E.encode(s),W=await n.importKey( "raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Y=new Uint8Array(await n.sign("HMAC",W,m.concat( [g,m.from([0,0,0,1])]))),me=Y;for(var T=0;Tme[Z]^Y[Z]));let b=me,M=await n.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-2\ 56"}},!1,["sign"]),oe=new Uint8Array(await n.sign("HMAC",M,E.encode("Client Key"))),H=await n.digest( -"SHA-256",oe),we="n=*,r="+i.clientNonce,Ce="r="+c+",s="+l+",i="+y,ue="c=biws,r="+c,F=we+","+Ce+","+ue, +"SHA-256",oe),we="n=*,r="+i.clientNonce,Ce="r="+l+",s="+c+",i="+y,ue="c=biws,r="+l,F=we+","+Ce+","+ue, J=await n.importKey("raw",H,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var ve=new Uint8Array(await n. -sign("HMAC",J,E.encode(F))),Ie=m.from(oe.map((Te,Z)=>oe[Z]^ve[Z])),Fe=Ie.toString("base64");let Me=await n. -importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),ke=await n.sign("HMAC",Me,E.encode( -"Server Key")),dr=await n.importKey("raw",ke,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Ue=m. -from(await n.sign("HMAC",dr,E.encode(F)));i.message="SASLResponse",i.serverSignature=Ue.toString("ba\ -se64"),i.response=ue+",p="+Fe,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; -a(Ai,"NeonClient");var Ft=Ai;ze();var Ea=De(sr());function Wf(r,e){if(e)return{callback:e,result:void 0};let t,n,i=a(function(o,u){o?t(o):n(u)},"cb"), +sign("HMAC",J,E.encode(F))),Ie=m.from(oe.map((Te,Z)=>oe[Z]^ve[Z])),Me=Ie.toString("base64");let ke=await n. +importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Ue=await n.sign("HMAC",ke,E.encode( +"Server Key")),dr=await n.importKey("raw",Ue,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var De=m. +from(await n.sign("HMAC",dr,E.encode(F)));i.message="SASLResponse",i.serverSignature=De.toString("ba\ +se64"),i.response=ue+",p="+Me,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; +a(Ai,"NeonClient");var Ft=Ai;Ye();var Ea=Oe(sr());function Wf(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(Wf,"promisify");var Ci=class Ci extends va.Pool{constructor(){ super(...arguments);I(this,"Client",Ft);I(this,"hasFetchUnsupportedListeners",!1);I(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=Wf(this.Promise,i);i=s.callback;try{let o=new Ea.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??[];po(l,{fullResults:!0,arrayMode:t. +this.options),u=encodeURIComponent,l=encodeURI,c=`postgresql://${u(o.user)}:${u(o.password)}@${u(o.host)}\ +/${l(o.database)}`,f=typeof t=="string"?t:t.text,y=n??t.values??[];po(c,{fullResults:!0,arrayMode:t. rowMode==="array"}).query(f,y,{types:t.types??this.options?.types}).then(E=>i(void 0,E)).catch(E=>i( -E))}catch(o){i(o)}return s.result}};a(Ci,"NeonPool");var _i=Ci;ze();var Mt=De(Bt()),u0="mjs";var export_DatabaseError=Mt.DatabaseError;var export_defaults=Mt.defaults;var export_escapeIdentifier=Mt.escapeIdentifier; +E))}catch(o){i(o)}return s.result}};a(Ci,"NeonPool");var _i=Ci;Ye();var Mt=Oe(Bt()),u0="mjs";var export_DatabaseError=Mt.DatabaseError;var export_defaults=Mt.defaults;var export_escapeIdentifier=Mt.escapeIdentifier; var export_escapeLiteral=Mt.escapeLiteral;var export_types=Mt.types;export{Ft as Client,export_DatabaseError as DatabaseError, -pe as NeonDbError,je as NeonQueryPromise,_i as Pool,yt as SqlTemplate,mt as UnsafeRawSql,u0 as _bundleExt, +pe as NeonDbError,We as NeonQueryPromise,_i as Pool,mt as SqlTemplate,wt as UnsafeRawSql,u0 as _bundleExt, export_defaults as defaults,export_escapeIdentifier as escapeIdentifier,export_escapeLiteral as escapeLiteral, po as neon,Se as neonConfig,export_types as types,Kt as warnIfBrowser}; /*! Bundled license information: diff --git a/src/httpQuery.ts b/src/httpQuery.ts index 66e5dbb..5eb2c90 100644 --- a/src/httpQuery.ts +++ b/src/httpQuery.ts @@ -150,7 +150,14 @@ async function readStreamingResult( } const results = []; - let current: { fields: any[]; rows: any[] } | undefined; + let current: + | { + fields: any[]; + rows: any[]; + row?: any[]; + partialText?: string[]; + } + | undefined; for (const message of messages.slice(0, -1)) { if (!Array.isArray(message)) { unexpectedStreamingMessage(); @@ -164,13 +171,58 @@ async function readStreamingResult( current = { fields: payload, rows: [] }; break; case ROW_MESSAGE: - if (current === undefined) { + if (current === undefined || payload.length === 0) { unexpectedStreamingMessage(); } - current.rows.push(payload); + const row = (current.row ??= []); + for (const [index, value] of payload.entries()) { + if ( + row.length >= current.fields.length || + (Array.isArray(value) && + (value.length !== 1 || typeof value[0] !== 'string')) || + (!Array.isArray(value) && + value !== null && + typeof value !== 'string') + ) { + unexpectedStreamingMessage(); + } + + if (Array.isArray(value)) { + (current.partialText ??= []).push(value[0]); + continue; + } + + if (value === null) { + if (current.partialText !== undefined) { + unexpectedStreamingMessage(); + } + row.push(null); + } else { + if (current.partialText === undefined) { + row.push(value); + } else { + current.partialText.push(value); + row.push(current.partialText.join('')); + } + current.partialText = undefined; + } + + if (row.length === current.fields.length) { + if (index !== payload.length - 1) { + unexpectedStreamingMessage(); + } + current.rows.push(row); + current.row = undefined; + } + } break; case QUERY_MESSAGE: - if (current === undefined || payload.length !== 2) { + if ( + current === undefined || + current.row !== undefined || + current.partialText !== undefined || + payload.length !== 2 + ) { unexpectedStreamingMessage(); } results.push({ diff --git a/tests/cli/httpStreaming.test.ts b/tests/cli/httpStreaming.test.ts index ee3db46..44b9410 100644 --- a/tests/cli/httpStreaming.test.ts +++ b/tests/cli/httpStreaming.test.ts @@ -122,6 +122,62 @@ test.each([ }, ); +test.each([ + { + responseFormat: 'jsonl' as const, + accept: 'application/vnd.neon.sql.v1+json', + encode: (messages: unknown[]) => + messages.map((message) => JSON.stringify(message)).join('\n'), + }, + { + responseFormat: 'cbor-seq' as const, + accept: 'application/vnd.neon.sql.v1+cbor', + encode: cborSequence, + }, +])( + 'assembles partial rows from $responseFormat responses', + async ({ responseFormat, accept, encode }) => { + const messages = [ + [1, fields[0], labelFields[0]], + [0, ['4']], + [0, '2', 'hello'], + [0, '43'], + [0, ['world']], + [0, ''], + [2, 'SELECT', 2], + [3], + ]; + mockResponse(encode(messages), accept); + + const sql = neon(connectionString, { responseFormat, fullResults: true }); + await expect(sql`SELECT answer, label`).resolves.toMatchObject({ + rows: [ + { answer: 42, label: 'hello' }, + { answer: 43, label: 'world' }, + ], + command: 'SELECT', + rowCount: 2, + }); + }, +); + +test.each([ + [[], 'empty row message'], + [[[null]], 'partial NULL'], + [[['unfinished']], 'unfinished row'], +])('rejects invalid streamed row fragments: %s', async (row, _description) => { + const messages = [[1, fields], [0, ...row], [2, 'SELECT', 1], [3]]; + mockResponse( + messages.map((message) => JSON.stringify(message)).join('\n'), + 'application/vnd.neon.sql.v1+json', + ); + + const sql = neon(connectionString, { responseFormat: 'jsonl' }); + await expect(sql`SELECT 42 AS answer`).rejects.toThrow( + 'unexpected streamed response message', + ); +}); + test('allows a streaming format per query', async () => { mockResponse( successMessages.map((message) => JSON.stringify(message)).join('\n'), @@ -146,6 +202,23 @@ test('returns terminal streamed errors as database errors', async () => { expect(error).toMatchObject({ message: 'division by zero', code: '22012' }); }); +test('discards partial rows before returning terminal errors', async () => { + mockResponse( + cborSequence([ + [1, ...fields], + [0, ['partial']], + [4, { message: 'division by zero', code: '22012' }], + ]), + 'application/vnd.neon.sql.v1+cbor', + ); + + const sql = neon(connectionString, { responseFormat: 'cbor-seq' }); + await expect(sql`SELECT 1 / 0`).rejects.toMatchObject({ + message: 'division by zero', + code: '22012', + }); +}); + test.each([ { responseFormat: 'jsonl' as const, From 201f80a64c21c78170012e9b5cf53ae820a2ba15 Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Wed, 19 Aug 2026 07:56:58 +0100 Subject: [PATCH 5/7] Harden SQL streaming response decoding --- index.js | 1645 ++++++++++++++++--------------- index.mjs | 1579 ++++++++++++++--------------- src/httpQuery.ts | 74 +- tests/cli/httpStreaming.test.ts | 137 ++- 4 files changed, 1798 insertions(+), 1637 deletions(-) diff --git a/index.js b/index.js index 0f645d8..8d0bb18 100644 --- a/index.js +++ b/index.js @@ -1,73 +1,73 @@ -"use strict";var Ca=Object.create;var $e=Object.defineProperty;var Ia=Object.getOwnPropertyDescriptor;var Ta=Object.getOwnPropertyNames;var Ra=Object.getPrototypeOf,Pa=Object.prototype.hasOwnProperty;var Ba=(r,e,t)=>e in r?$e(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>$e(r,"name",{value:e,configurable:!0});var te=(r,e)=>()=>(r&&(e=r(r=0)),e);var P=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),fe=(r,e)=>{for(var t in e)$e(r,t,{get:e[t], -enumerable:!0})},Ti=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ta(e))!Pa. -call(r,i)&&i!==t&&$e(r,i,{get:()=>e[i],enumerable:!(n=Ia(e,i))||n.enumerable});return r};var qe=(r,e,t)=>(t=r!=null?Ca(Ra(r)):{},Ti(e||!r||!r.__esModule?$e(t,"default",{value:r,enumerable:!0}): -t,r)),j=r=>Ti($e({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Ba(r,typeof e!="symbol"?e+"":e,t);var Bi=P(Ut=>{"use strict";p();Ut.byteLength=Fa;Ut.toByteArray=ka;Ut.fromByteArray=Oa;var xe=[],he=[], -La=typeof Uint8Array<"u"?Uint8Array:Array,gr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ -23456789+/";for(Qe=0,Ri=gr.length;Qe0)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(Pi,"getLens"); -function Fa(r){var e=Pi(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Fa,"byteLength");function Ma(r,e,t){return(e+ -t)*3/4-t}a(Ma,"_byteLength");function ka(r){var e,t=Pi(r),n=t[0],i=t[1],s=new La(Ma(r,n,i)),o=0,u=i> -0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=he[r.charCodeAt( -l)]<<2|he[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=he[r.charCodeAt(l)]<<10|he[r.charCodeAt(l+1)]<< -4|he[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(ka,"toByteArray");function Ua(r){return xe[r>> -18&63]+xe[r>>12&63]+xe[r>>6&63]+xe[r&63]}a(Ua,"tripletToBase64");function Da(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(Ua(n));return i.join("")}a(Da,"en\ -codeChunk");function Oa(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(xe[e>>2]+xe[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1], -i.push(xe[e>>10]+xe[e>>4&63]+xe[e<<2&63]+"=")),i.join("")}a(Oa,"fromByteArray")});var Li=P(br=>{p();br.read=function(r,e,t,n,i){var s,o,u=i*8-n-1,l=(1<>1,f=-7,y=t?i-1:0,g=t? +"use strict";var Ta=Object.create;var Ge=Object.defineProperty;var Ra=Object.getOwnPropertyDescriptor;var Pa=Object.getOwnPropertyNames;var Ba=Object.getPrototypeOf,La=Object.prototype.hasOwnProperty;var Fa=(r,e,t)=>e in r?Ge(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>Ge(r,"name",{value:e,configurable:!0});var re=(r,e)=>()=>(r&&(e=r(r=0)),e);var P=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),le=(r,e)=>{for(var t in e)Ge(r,t,{get:e[t], +enumerable:!0})},Pi=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Pa(e))!La. +call(r,i)&&i!==t&&Ge(r,i,{get:()=>e[i],enumerable:!(n=Ra(e,i))||n.enumerable});return r};var qe=(r,e,t)=>(t=r!=null?Ta(Ba(r)):{},Pi(e||!r||!r.__esModule?Ge(t,"default",{value:r,enumerable:!0}): +t,r)),j=r=>Pi(Ge({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Fa(r,typeof e!="symbol"?e+"":e,t);var Fi=P(Dt=>{"use strict";p();Dt.byteLength=Ma;Dt.toByteArray=Da;Dt.fromByteArray=qa;var be=[],fe=[], +ka=typeof Uint8Array<"u"?Uint8Array:Array,xr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ +23456789+/";for(Qe=0,Bi=xr.length;Qe0)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(Li,"getLens"); +function Ma(r){var e=Li(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Ma,"byteLength");function Ua(r,e,t){return(e+ +t)*3/4-t}a(Ua,"_byteLength");function Da(r){var e,t=Li(r),n=t[0],i=t[1],s=new ka(Ua(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=fe[r.charCodeAt( +c)]<<2|fe[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=fe[r.charCodeAt(c)]<<10|fe[r.charCodeAt(c+1)]<< +4|fe[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(Da,"toByteArray");function Oa(r){return be[r>> +18&63]+be[r>>12&63]+be[r>>6&63]+be[r&63]}a(Oa,"tripletToBase64");function Na(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(Oa(n));return i.join("")}a(Na,"en\ +codeChunk");function qa(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(be[e>>2]+be[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1], +i.push(be[e>>10]+be[e>>4&63]+be[e<<2&63]+"=")),i.join("")}a(qa,"fromByteArray")});var ki=P(Sr=>{p();Sr.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,E=r[e+y];for(y+=g,s=E&(1<<-f)-1,E>>=-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-c;else{if(s===l)return o?NaN:(E?-1:1)*(1/0);o=o+Math. -pow(2,n),s=s-c}return(E?-1:1)*o*Math.pow(2,s-n)};br.write=function(r,e,t,n,i,s){var o,u,l,c=s*8-i-1, -f=(1<>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:s-1,C=n?1:-1,H=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*(l= -Math.pow(2,-o))<1&&(o--,l*=2),o+y>=1?e+=g/l:e+=g*Math.pow(2,1-y),e*l>=2&&(o++,l/=2),o+y>=f?(u=0,o=f): -o+y>=1?(u=(e*l-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+E]=u&255,E+= -C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,c-=8);r[t+E-C]|=H*128}});var zi=P(ze=>{"use strict";p();var xr=Bi(),Ve=Li(),Fi=typeof Symbol=="function"&&typeof Symbol.for== -"function"?Symbol.for("nodejs.util.inspect.custom"):null;ze.Buffer=d;ze.SlowBuffer=Ha;ze.INSPECT_MAX_BYTES= -50;var Dt=2147483647;ze.kMaxLength=Dt;d.TYPED_ARRAY_SUPPORT=Na();!d.TYPED_ARRAY_SUPPORT&&typeof console< +-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:(E?-1:1)*(1/0);o=o+Math. +pow(2,n),s=s-l}return(E?-1:1)*o*Math.pow(2,s-n)};Sr.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,E=n?0:s-1,C=n?1:-1,H=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+E]=u&255,E+= +C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=H*128}});var Ji=P(Ye=>{"use strict";p();var vr=Fi(),Ke=ki(),Mi=typeof Symbol=="function"&&typeof Symbol.for== +"function"?Symbol.for("nodejs.util.inspect.custom"):null;Ye.Buffer=d;Ye.SlowBuffer=Ga;Ye.INSPECT_MAX_BYTES= +50;var Ot=2147483647;Ye.kMaxLength=Ot;d.TYPED_ARRAY_SUPPORT=Qa();!d.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 Na(){ +pport which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Qa(){ 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(Na,"typedArraySupport");Object. +prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}a(Qa,"typedArraySupport");Object. defineProperty(d.prototype,"parent",{enumerable:!0,get:a(function(){if(d.isBuffer(this))return this. buffer},"get")});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:a(function(){if(d.isBuffer( -this))return this.byteOffset},"get")});function Ae(r){if(r>Dt)throw new RangeError('The value "'+r+'\ +this))return this.byteOffset},"get")});function Ae(r){if(r>Ot)throw new RangeError('The value "'+r+'\ " is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,d.prototype), e}a(Ae,"createBuffer");function d(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 Ar(r)}return Di(r,e,t)} -a(d,"Buffer");d.poolSize=8192;function Di(r,e,t){if(typeof r=="string")return Qa(r,e);if(ArrayBuffer. -isView(r))return ja(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(Se(r,ArrayBuffer)|| -r&&Se(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Se(r,SharedArrayBuffer)||r&&Se(r.buffer, -SharedArrayBuffer)))return vr(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument\ +'The "string" argument must be of type string. Received type number');return Cr(r)}return Ni(r,e,t)} +a(d,"Buffer");d.poolSize=8192;function Ni(r,e,t){if(typeof r=="string")return Wa(r,e);if(ArrayBuffer. +isView(r))return Ha(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(xe(r,ArrayBuffer)|| +r&&xe(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(xe(r,SharedArrayBuffer)||r&&xe(r.buffer, +SharedArrayBuffer)))return Ar(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 d. -from(n,e,t);let i=Wa(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. +from(n,e,t);let i=$a(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. toPrimitive]=="function")return d.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(Di,"from");d.from=function(r,e,t){return Di(r,e,t)};Object.setPrototypeOf(d.prototype, -Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Oi(r){if(typeof r!="number")throw new TypeError( +ed type "+typeof r)}a(Ni,"from");d.from=function(r,e,t){return Ni(r,e,t)};Object.setPrototypeOf(d.prototype, +Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function qi(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(Oi,"assertSize");function qa(r,e,t){return Oi(r),r<=0?Ae(r):e!==void 0?typeof t== -"string"?Ae(r).fill(e,t):Ae(r).fill(e):Ae(r)}a(qa,"alloc");d.alloc=function(r,e,t){return qa(r,e,t)}; -function Ar(r){return Oi(r),Ae(r<0?0:_r(r)|0)}a(Ar,"allocUnsafe");d.allocUnsafe=function(r){return Ar( -r)};d.allocUnsafeSlow=function(r){return Ar(r)};function Qa(r,e){if((typeof e!="string"||e==="")&&(e= -"utf8"),!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=Ni(r,e)|0,n=Ae(t),i=n.write( -r,e);return i!==t&&(n=n.slice(0,i)),n}a(Qa,"fromString");function Sr(r){let e=r.length<0?0:_r(r.length)| -0,t=Ae(e);for(let n=0;n=Dt)throw new RangeError("Attempt to allocate Buffer larger t\ -han maximum size: 0x"+Dt.toString(16)+" bytes");return r|0}a(_r,"checked");function Ha(r){return+r!= -r&&(r=0),d.alloc(+r)}a(Ha,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== -d.prototype},"isBuffer");d.compare=a(function(e,t){if(Se(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)), -Se(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.isBuffer(t))throw new TypeError( +r,e,t),Object.setPrototypeOf(n,d.prototype),n}a(Ar,"fromArrayBuffer");function $a(r){if(d.isBuffer(r)){ +let e=Ir(r.length)|0,t=Ae(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r. +length!="number"||Rr(r.length)?Ae(0):Er(r);if(r.type==="Buffer"&&Array.isArray(r.data))return Er(r.data)} +a($a,"fromObject");function Ir(r){if(r>=Ot)throw new RangeError("Attempt to allocate Buffer larger t\ +han maximum size: 0x"+Ot.toString(16)+" bytes");return r|0}a(Ir,"checked");function Ga(r){return+r!= +r&&(r=0),d.alloc(+r)}a(Ga,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== +d.prototype},"isBuffer");d.compare=a(function(e,t){if(xe(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)), +xe(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.isBuffer(t))throw new TypeError( 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length, i=t.length;for(let s=0,o=Math.min(n,i);si.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(i,s)):Uint8Array.prototype. +if(xe(o,Uint8Array))s+o.length>i.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(i,s)):Uint8Array.prototype. set.call(i,o,s);else if(d.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 Ni(r,e){if(d.isBuffer(r))return r.length; -if(ArrayBuffer.isView(r)||Se(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError( +an Array of Buffers');s+=o.length}return i},"concat");function Qi(r,e){if(d.isBuffer(r))return r.length; +if(ArrayBuffer.isView(r)||xe(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 Er(r).length;case"ucs2":case"\ -ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ki(r).length;default: -if(i)return n?-1:Er(r).length;e=(""+e).toLowerCase(),i=!0}}a(Ni,"byteLength");d.byteLength=Ni;function $a(r,e,t){ +ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return _r(r).length;case"ucs2":case"\ +ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Yi(r).length;default: +if(i)return n?-1:_r(r).length;e=(""+e).toLowerCase(),i=!0}}a(Qi,"byteLength");d.byteLength=Qi;function Va(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 tu(this,e,t);case"u\ -tf8":case"utf-8":return Qi(this,e,t);case"ascii":return Xa(this,e,t);case"latin1":case"binary":return eu( -this,e,t);case"base64":return Ja(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ru( -this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a($a, +0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return nu(this,e,t);case"u\ +tf8":case"utf-8":return Wi(this,e,t);case"ascii":return tu(this,e,t);case"latin1":case"binary":return ru( +this,e,t);case"base64":return Xa(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return iu( +this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(Va, "slowToString");d.prototype._isBuffer=!0;function je(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(je,"swap"); d.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");Fi&&(d.prototype[Fi]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ -if(Se(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(e))throw new TypeError('The "ta\ +er "+e+">"},"inspect");Mi&&(d.prototype[Mi]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ +if(xe(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.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,l=Math.min(o,u),c=this.slice( -i,s),f=e.slice(t,n);for(let y=0;y2147483647? -t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Ir(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r. +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,Rr(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=d.from( -e,n)),d.isBuffer(e))return e.length===0?-1:Mi(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array. +e,n)),d.isBuffer(e))return e.length===0?-1:Ui(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):Mi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(qi,"bidire\ -ctionalIndexOf");function Mi(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):Ui(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(ji,"bidire\ +ctionalIndexOf");function Ui(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 l(f,y){return s===1?f[y]:f.readUInt16BE(y*s)}a(l,"read");let c;if(i){let f=-1;for(c= -t;co&&(t=o-u),c=t;c>=0;c--){let f=!0;for(let y=0;yo&&(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 Ga(this,e,t,n);case"utf8":case"\ -utf-8":return Va(this,e,t,n);case"ascii":case"latin1":case"binary":return Ka(this,e,t,n);case"base64": -return za(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ya(this,e,t,n);default: +fer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return Ka(this,e,t,n);case"utf8":case"\ +utf-8":return za(this,e,t,n);case"ascii":case"latin1":case"binary":return Ya(this,e,t,n);case"base64": +return Ja(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Za(this,e,t,n);default: if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"write");d.prototype. toJSON=a(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSO\ -N");function Ja(r,e,t){return e===0&&t===r.length?xr.fromByteArray(r):xr.fromByteArray(r.slice(e,t))} -a(Ja,"base64Slice");function Qi(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 l,c,f,y;switch(u){case 1:s<128&&(o=s);break;case 2:l=r[i+ -1],(l&192)===128&&(y=(s&31)<<6|l&63,y>127&&(o=y));break;case 3:l=r[i+1],c=r[i+2],(l&192)===128&&(c&192)=== -128&&(y=(s&15)<<12|(l&63)<<6|c&63,y>2047&&(y<55296||y>57343)&&(o=y));break;case 4:l=r[i+1],c=r[i+2], -f=r[i+3],(l&192)===128&&(c&192)===128&&(f&192)===128&&(y=(s&15)<<18|(l&63)<<12|(c&63)<<6|f&63,y>65535&& +N");function Xa(r,e,t){return e===0&&t===r.length?vr.fromByteArray(r):vr.fromByteArray(r.slice(e,t))} +a(Xa,"base64Slice");function Wi(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 Za(n)}a(Qi,"utf8Slice");var ki=4096;function Za(r){let e=r.length;if(e<=ki)return String. +n.push(o),i+=u}return eu(n)}a(Wi,"utf8Slice");var Di=4096;function eu(r){let e=r.length;if(e<=Di)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,d.prototype),i},"slice");function G(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 \ @@ -165,11 +165,11 @@ a(function(e,t){return e=e>>>0,t||G(e,2,this.length),this[e]<<8|this[e+1]},"read readUint32LE=d.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),(this[e]| this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");d.prototype.readUint32BE=d.prototype. readUInt32BE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+ -2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Pe(a(function(e){e=e>>>0,Ke(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&dt(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* +2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Pe(a(function(e){e=e>>>0,ze(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&pt(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* 2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<< -BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Pe(a(function(e){e=e>>>0,Ke(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&dt(e,this.length-8);let i=t*2**24+this[++e]*2**16+ +BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Pe(a(function(e){e=e>>>0,ze(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&pt(e,this.length-8);let i=t*2**24+this[++e]*2**16+ this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<>>0,t=t>>>0,n||G(e,t, this.length);let i=this[e],s=1,o=0;for(;++o=s&&(i-=Math. @@ -182,63 +182,63 @@ a(function(e,t){e=e>>>0,t||G(e,2,this.length);let n=this[e+1]|this[e]<<8;return n},"readInt16BE");d.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]| this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");d.prototype.readInt32BE=a(function(e,t){return e= e>>>0,t||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");d.prototype. -readBigInt64LE=Pe(a(function(e){e=e>>>0,Ke(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& -dt(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,ze(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& +pt(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,Ke(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&dt(e,this. +Pe(a(function(e){e=e>>>0,ze(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&pt(e,this. length-8);let i=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,t||G(e,4,this.length),Ve.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= -a(function(e,t){return e=e>>>0,t||G(e,4,this.length),Ve.read(this,e,!1,23,4)},"readFloatBE");d.prototype. -readDoubleLE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ve.read(this,e,!0,52,8)},"readDoub\ -leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ve.read(this,e, -!1,52,8)},"readDoubleBE");function re(r,e,t,n,i,s){if(!d.isBuffer(r))throw new TypeError('"buffer" a\ +return e=e>>>0,t||G(e,4,this.length),Ke.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= +a(function(e,t){return e=e>>>0,t||G(e,4,this.length),Ke.read(this,e,!1,23,4)},"readFloatBE");d.prototype. +readDoubleLE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ke.read(this,e,!0,52,8)},"readDoub\ +leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ke.read(this,e, +!1,52,8)},"readDoubleBE");function ne(r,e,t,n,i,s){if(!d.isBuffer(r))throw new TypeError('"buffer" a\ rgument must be a Buffer instance');if(e>i||er.length)throw new RangeError("Index out of range")}a(re,"checkInt");d.prototype.writeUintLE= -d.prototype.writeUIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;re(this, +nds');if(t+n>r.length)throw new RangeError("Index out of range")}a(ne,"checkInt");d.prototype.writeUintLE= +d.prototype.writeUIntLE=a(function(e,t,n,i){if(e=+e,t=t>>>0,n=n>>>0,!i){let u=Math.pow(2,8*n)-1;ne(this, e,t,n,u,0)}let s=1,o=0;for(this[t]=e&255;++o>>0,n=n>>>0,!i){let u=Math. -pow(2,8*n)-1;re(this,e,t,n,u,0)}let s=n-1,o=1;for(this[t+s]=e&255;--s>=0&&(o*=256);)this[t+s]=e/o&255; +pow(2,8*n)-1;ne(this,e,t,n,u,0)}let s=n-1,o=1;for(this[t+s]=e&255;--s>=0&&(o*=256);)this[t+s]=e/o&255; return t+n},"writeUIntBE");d.prototype.writeUint8=d.prototype.writeUInt8=a(function(e,t,n){return e= -+e,t=t>>>0,n||re(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");d.prototype.writeUint16LE=d.prototype. -writeUInt16LE=a(function(e,t,n){return e=+e,t=t>>>0,n||re(this,e,t,2,65535,0),this[t]=e&255,this[t+1]= ++e,t=t>>>0,n||ne(this,e,t,1,255,0),this[t]=e&255,t+1},"writeUInt8");d.prototype.writeUint16LE=d.prototype. +writeUInt16LE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(this,e,t,2,65535,0),this[t]=e&255,this[t+1]= e>>>8,t+2},"writeUInt16LE");d.prototype.writeUint16BE=d.prototype.writeUInt16BE=a(function(e,t,n){return e= -+e,t=t>>>0,n||re(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");d.prototype. -writeUint32LE=d.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||re(this,e,t,4,4294967295, ++e,t=t>>>0,n||ne(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},"writeUInt16BE");d.prototype. +writeUint32LE=d.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(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");d.prototype. -writeUint32BE=d.prototype.writeUInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||re(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 ji(r,e,t,n,i){ -Vi(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++]= +writeUint32BE=d.prototype.writeUInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(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 Hi(r,e,t,n,i){ +zi(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(ji,"wrtBigUInt64LE");function Wi(r,e,t,n,i){Vi(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295)); +8,r[t++]=o,t}a(Hi,"wrtBigUInt64LE");function $i(r,e,t,n,i){zi(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(Wi,"wrtBigUInt64BE");d.prototype. -writeBigUInt64LE=Pe(a(function(e,t=0){return ji(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ -riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Pe(a(function(e,t=0){return Wi(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($i,"wrtBigUInt64BE");d.prototype. +writeBigUInt64LE=Pe(a(function(e,t=0){return Hi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ +riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Pe(a(function(e,t=0){return $i(this,e,t,BigInt(0),BigInt( "0xffffffffffffffff"))},"writeBigUInt64BE"));d.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>> -0,!i){let l=Math.pow(2,8*n-1);re(this,e,t,n,l-1,-l)}let s=0,o=1,u=0;for(this[t]=e&255;++s>0)-u&255;return t+n},"writeIntLE");d.prototype.writeIntBE= -a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let l=Math.pow(2,8*n-1);re(this,e,t,n,l-1,-l)}let s=n-1,o=1, +a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*n-1);ne(this,e,t,n,c-1,-c)}let s=n-1,o=1, u=0;for(this[t+s]=e&255;--s>=0&&(o*=256);)e<0&&u===0&&this[t+s+1]!==0&&(u=1),this[t+s]=(e/o>>0)-u&255; -return t+n},"writeIntBE");d.prototype.writeInt8=a(function(e,t,n){return e=+e,t=t>>>0,n||re(this,e,t, +return t+n},"writeIntBE");d.prototype.writeInt8=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(this,e,t, 1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");d.prototype.writeInt16LE=a(function(e,t,n){ -return e=+e,t=t>>>0,n||re(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeInt16LE"); -d.prototype.writeInt16BE=a(function(e,t,n){return e=+e,t=t>>>0,n||re(this,e,t,2,32767,-32768),this[t]= +return e=+e,t=t>>>0,n||ne(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},"writeInt16LE"); +d.prototype.writeInt16BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(this,e,t,2,32767,-32768),this[t]= e>>>8,this[t+1]=e&255,t+2},"writeInt16BE");d.prototype.writeInt32LE=a(function(e,t,n){return e=+e,t= -t>>>0,n||re(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+ -3]=e>>>24,t+4},"writeInt32LE");d.prototype.writeInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||re( +t>>>0,n||ne(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+ +3]=e>>>24,t+4},"writeInt32LE");d.prototype.writeInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne( 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");d.prototype.writeBigInt64LE=Pe(a(function(e,t=0){return ji( +e>>>8,this[t+3]=e&255,t+4},"writeInt32BE");d.prototype.writeBigInt64LE=Pe(a(function(e,t=0){return Hi( this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));d.prototype. -writeBigInt64BE=Pe(a(function(e,t=0){return Wi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ -ffffffffffff"))},"writeBigInt64BE"));function Hi(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(Hi,"checkIEEE754");function $i(r,e,t,n,i){ -return e=+e,t=t>>>0,i||Hi(r,e,t,4,34028234663852886e22,-34028234663852886e22),Ve.write(r,e,t,n,23,4), -t+4}a($i,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return $i(this,e,t,!0,n)},"writeFl\ -oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return $i(this,e,t,!1,n)},"writeFloatBE");function Gi(r,e,t,n,i){ -return e=+e,t=t>>>0,i||Hi(r,e,t,8,17976931348623157e292,-17976931348623157e292),Ve.write(r,e,t,n,52, -8),t+8}a(Gi,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return Gi(this,e,t,!0,n)},"wr\ -iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return Gi(this,e,t,!1,n)},"writeDoubleBE"); +writeBigInt64BE=Pe(a(function(e,t=0){return $i(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ +ffffffffffff"))},"writeBigInt64BE"));function Gi(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(Gi,"checkIEEE754");function Vi(r,e,t,n,i){ +return e=+e,t=t>>>0,i||Gi(r,e,t,4,34028234663852886e22,-34028234663852886e22),Ke.write(r,e,t,n,23,4), +t+4}a(Vi,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return Vi(this,e,t,!0,n)},"writeFl\ +oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return Vi(this,e,t,!1,n)},"writeFloatBE");function Ki(r,e,t,n,i){ +return e=+e,t=t>>>0,i||Gi(r,e,t,8,17976931348623157e292,-17976931348623157e292),Ke.write(r,e,t,n,52, +8),t+8}a(Ki,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return Ki(this,e,t,!0,n)},"wr\ +iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return Ki(this,e,t,!1,n)},"writeDoubleBE"); d.prototype.copy=a(function(e,t,n,i){if(!d.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=Ui(String(t)):typeof t=="bigint"&&(i=String( -t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Ui(i)),i+="n"),n+=` It must be ${e}. Re\ -ceived ${i}`,n},RangeError);function Ui(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(Ui,"addNumericalSeparator");function nu(r,e,t){ -Ke(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&dt(e,r.length-(t+1))}a(nu,"checkBounds");function Vi(r,e,t,n,i,s){ +e ${typeof e}`},TypeError);Tr("ERR_OUT_OF_RANGE",function(r,e,t){let n=`The value of "${r}" is out o\ +f range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=Oi(String(t)):typeof t=="bigint"&&(i=String( +t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Oi(i)),i+="n"),n+=` It must be ${e}. Re\ +ceived ${i}`,n},RangeError);function Oi(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(Oi,"addNumericalSeparator");function su(r,e,t){ +ze(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&pt(e,r.length-(t+1))}a(su,"checkBounds");function zi(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 Ge.ERR_OUT_OF_RANGE("value",u,r)}nu(n,i,s)}a(Vi,"checkIntBI");function Ke(r,e){if(typeof r!= -"number")throw new Ge.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Ke,"validateNumber");function dt(r,e,t){throw Math. -floor(r)!==r?(Ke(r,t),new Ge.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new Ge.ERR_BUFFER_OUT_OF_BOUNDS: -new Ge.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(dt,"boundsError");var iu=/[^+/0-9A-Za-z-_]/g; -function su(r){if(r=r.split("=")[0],r=r.trim().replace(iu,""),r.length<2)return"";for(;r.length%4!== -0;)r=r+"=";return r}a(su,"base64clean");function Er(r,e){e=e||1/0;let t,n=r.length,i=null,s=[];for(let o=0;o< +nd <= ${t}${o}`,new Ve.ERR_OUT_OF_RANGE("value",u,r)}su(n,i,s)}a(zi,"checkIntBI");function ze(r,e){if(typeof r!= +"number")throw new Ve.ERR_INVALID_ARG_TYPE(e,"number",r)}a(ze,"validateNumber");function pt(r,e,t){throw Math. +floor(r)!==r?(ze(r,t),new Ve.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new Ve.ERR_BUFFER_OUT_OF_BOUNDS: +new Ve.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(pt,"boundsError");var ou=/[^+/0-9A-Za-z-_]/g; +function au(r){if(r=r.split("=")[0],r=r.trim().replace(ou,""),r.length<2)return"";for(;r.length%4!== +0;)r=r+"=";return r}a(au,"base64clean");function _r(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(Er,"utf\ -8ToBytes");function ou(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(au,"utf16leToBytes");function Ki(r){return xr.toByteArray( -su(r))}a(Ki,"base64ToBytes");function Ot(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) -e[i+t]=r[i];return i}a(Ot,"blitBuffer");function Se(r,e){return r instanceof e||r!=null&&r.constructor!= -null&&r.constructor.name!=null&&r.constructor.name===e.name}a(Se,"isInstance");function Ir(r){return r!== -r}a(Ir,"numberIsNaN");var uu=function(){let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){ +240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}a(_r,"utf\ +8ToBytes");function uu(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(cu,"utf16leToBytes");function Yi(r){return vr.toByteArray( +au(r))}a(Yi,"base64ToBytes");function Nt(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) +e[i+t]=r[i];return i}a(Nt,"blitBuffer");function xe(r,e){return r instanceof e||r!=null&&r.constructor!= +null&&r.constructor.name!=null&&r.constructor.name===e.name}a(xe,"isInstance");function Rr(r){return r!== +r}a(Rr,"numberIsNaN");var lu=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 Pe(r){return typeof BigInt>"u"? -lu:r}a(Pe,"defineBigIntMethod");function lu(){throw new Error("BigInt not supported")}a(lu,"BufferBi\ -gIntNotDefined")});var S,v,A,m,w,p=te(()=>{"use strict";S=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),A= +fu:r}a(Pe,"defineBigIntMethod");function fu(){throw new Error("BigInt not supported")}a(fu,"BufferBi\ +gIntNotDefined")});var S,v,A,m,w,p=re(()=>{"use strict";S=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),A= globalThis.clearImmediate??(r=>clearTimeout(r)),m=typeof globalThis.Buffer=="function"&&typeof globalThis. -Buffer.allocUnsafe=="function"?globalThis.Buffer:zi().Buffer,w=globalThis.process??{};w.env??(w.env= -{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Be=P((rh,Tr)=>{"use strict";p();var Ye=typeof Reflect=="object"?Reflect:null,Yi=Ye&&typeof Ye.apply== -"function"?Ye.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Nt; -Ye&&typeof Ye.ownKeys=="function"?Nt=Ye.ownKeys:Object.getOwnPropertySymbols?Nt=a(function(e){return Object. -getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Nt=a(function(e){return Object. -getOwnPropertyNames(e)},"ReflectOwnKeys");function cu(r){console&&console.warn&&console.warn(r)}a(cu, -"ProcessEmitWarning");var Zi=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function k(){k. -init.call(this)}a(k,"EventEmitter");Tr.exports=k;Tr.exports.once=pu;k.EventEmitter=k;k.prototype._events= -void 0;k.prototype._eventsCount=0;k.prototype._maxListeners=void 0;var Ji=10;function qt(r){if(typeof r!= +Buffer.allocUnsafe=="function"?globalThis.Buffer:Ji().Buffer,w=globalThis.process??{};w.env??(w.env= +{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Be=P((ih,Pr)=>{"use strict";p();var Je=typeof Reflect=="object"?Reflect:null,Zi=Je&&typeof Je.apply== +"function"?Je.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),qt; +Je&&typeof Je.ownKeys=="function"?qt=Je.ownKeys:Object.getOwnPropertySymbols?qt=a(function(e){return Object. +getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):qt=a(function(e){return Object. +getOwnPropertyNames(e)},"ReflectOwnKeys");function hu(r){console&&console.warn&&console.warn(r)}a(hu, +"ProcessEmitWarning");var es=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function k(){k. +init.call(this)}a(k,"EventEmitter");Pr.exports=k;Pr.exports.once=mu;k.EventEmitter=k;k.prototype._events= +void 0;k.prototype._eventsCount=0;k.prototype._maxListeners=void 0;var Xi=10;function Qt(r){if(typeof r!= "function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)} -a(qt,"checkListener");Object.defineProperty(k,"defaultMaxListeners",{enumerable:!0,get:a(function(){ -return Ji},"get"),set:a(function(r){if(typeof r!="number"||r<0||Zi(r))throw new RangeError('The valu\ -e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Ji=r}, +a(Qt,"checkListener");Object.defineProperty(k,"defaultMaxListeners",{enumerable:!0,get:a(function(){ +return Xi},"get"),set:a(function(r){if(typeof r!="number"||r<0||es(r))throw new RangeError('The valu\ +e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Xi=r}, "set")});k.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}; -k.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||Zi(e))throw new RangeError('Th\ +k.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||es(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 Xi(r){return r._maxListeners===void 0?k.defaultMaxListeners:r._maxListeners} -a(Xi,"_getMaxListeners");k.prototype.getMaxListeners=a(function(){return Xi(this)},"getMaxListeners"); +e,this},"setMaxListeners");function ts(r){return r._maxListeners===void 0?k.defaultMaxListeners:r._maxListeners} +a(ts,"_getMaxListeners");k.prototype.getMaxListeners=a(function(){return ts(this)},"getMaxListeners"); k.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 l=s[e];if(l===void 0)return!1;if(typeof l=="function")Yi(l,this,t);else for(var c=l. -length,f=is(l,c),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=ts(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,cu(u)}return r}a(es,"_addListener");k.prototype.addListener=a(function(e,t){ -return es(this,e,t,!1)},"addListener");k.prototype.on=k.prototype.addListener;k.prototype.prependListener= -a(function(e,t){return es(this,e,t,!0)},"prependListener");function fu(){if(!this.fired)return this. +r,u.type=e,u.count=o.length,hu(u)}return r}a(rs,"_addListener");k.prototype.addListener=a(function(e,t){ +return rs(this,e,t,!1)},"addListener");k.prototype.on=k.prototype.addListener;k.prototype.prependListener= +a(function(e,t){return rs(this,e,t,!0)},"prependListener");function du(){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(fu,"onceWrapper");function ts(r,e,t){var n={fired:!1, -wrapFn:void 0,target:r,type:e,listener:t},i=fu.bind(n);return i.listener=t,n.wrapFn=i,i}a(ts,"_onceW\ -rap");k.prototype.once=a(function(e,t){return qt(t),this.on(e,ts(this,e,t)),this},"once");k.prototype. -prependOnceListener=a(function(e,t){return qt(t),this.prependListener(e,ts(this,e,t)),this},"prepend\ -OnceListener");k.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(qt(t),i=this._events,i=== +target):this.listener.apply(this.target,arguments)}a(du,"onceWrapper");function ns(r,e,t){var n={fired:!1, +wrapFn:void 0,target:r,type:e,listener:t},i=du.bind(n);return i.listener=t,n.wrapFn=i,i}a(ns,"_onceW\ +rap");k.prototype.once=a(function(e,t){return Qt(t),this.on(e,ns(this,e,t)),this},"once");k.prototype. +prependOnceListener=a(function(e,t){return Qt(t),this.prependListener(e,ns(this,e,t)),this},"prepend\ +OnceListener");k.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(Qt(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():hu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== +listener,s=o;break}if(s<0)return this;s===0?n.shift():pu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== void 0&&this.emit("removeListener",e,u||t)}return this},"removeListener");k.prototype.off=k.prototype. removeListener;k.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 rs(r,e,t){var n=r._events; +0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function is(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? -du(i):is(i,i.length)}a(rs,"_listeners");k.prototype.listeners=a(function(e){return rs(this,e,!0)},"l\ -isteners");k.prototype.rawListeners=a(function(e){return rs(this,e,!1)},"rawListeners");k.listenerCount= -function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):ns.call(r,e)};k.prototype. -listenerCount=ns;function ns(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(ns,"listenerCount");k.prototype.eventNames=a(function(){ -return this._eventsCount>0?Nt(this._events):[]},"eventNames");function is(r,e){for(var t=new Array(e), -n=0;n0?qt(this._events):[]},"eventNames");function os(r,e){for(var t=new Array(e), +n=0;nbe,isIP:()=>mu});function mu(r){return 0}var as,os,_,be,Je=te(()=>{"use \ -strict";p();as=qe(Be(),1);a(mu,"isIP");os=/^[^.]+\./,_=class _ extends as.EventEmitter{constructor(){ +ust be of type EventEmitter. Received type '+typeof r)}a(as,"eventTargetAgnosticAddListener")});var ls={};le(ls,{Socket:()=>ge,isIP:()=>gu});function gu(r){return 0}var cs,us,_,ge,Ze=re(()=>{"use \ +strict";p();cs=qe(Be(),1);a(gu,"isIP");us=/^[^.]+\./,_=class _ extends cs.EventEmitter{constructor(){ super(...arguments);I(this,"opts",{});I(this,"connecting",!1);I(this,"pending",!0);I(this,"writable", !0);I(this,"encrypted",!1);I(this,"authorized",!1);I(this,"destroyed",!1);I(this,"ws",null);I(this,"\ writeBuffer");I(this,"tlsState",0);I(this,"tlsRead");I(this,"tlsWrite")}static get poolQueryViaFetch(){ @@ -397,24 +397,24 @@ om/neondatabase/serverless/blob/main/CONFIG.md#wsproxy-string--host-string-port- ng");return typeof i=="function"?i(t,n):`${i}?address=${t}:${n}`}setNoDelay(){return this}setKeepAlive(){ return this}ref(){return this}unref(){return this}connect(t,n,i){this.connecting=!0,i&&this.once("co\ nnect",i);let s=a(()=>{this.connecting=!1,this.pending=!1,this.emit("connect"),this.emit("ready")},"\ -handleWebSocketOpen"),o=a((l,c=!1)=>{l.binaryType="arraybuffer",l.addEventListener("error",f=>{this. -emit("error",f),this.emit("close")}),l.addEventListener("message",f=>{if(this.tlsState===0){let y=m. -from(f.data);this.emit("data",y)}}),l.addEventListener("close",()=>{this.emit("close")}),c?s():l.addEventListener( +handleWebSocketOpen"),o=a((c,l=!1)=>{c.binaryType="arraybuffer",c.addEventListener("error",f=>{this. +emit("error",f),this.emit("close")}),c.addEventListener("message",f=>{if(this.tlsState===0){let y=m. +from(f.data);this.emit("data",y)}}),c.addEventListener("close",()=>{this.emit("close")}),l?s():c.addEventListener( "open",s)},"configureWebSocket"),u;try{u=this.wsProxyAddrForHost(n,typeof t=="string"?parseInt(t,10): -t)}catch(l){this.emit("error",l),this.emit("close");return}try{let c=(this.useSecureWebSocket?"wss:": -"ws:")+"//"+u;if(this.webSocketConstructor!==void 0)this.ws=new this.webSocketConstructor(c),o(this. -ws);else try{this.ws=new WebSocket(c),o(this.ws)}catch{this.ws=new __unstable_WebSocket(c),o(this.ws)}}catch(l){ +t)}catch(c){this.emit("error",c),this.emit("close");return}try{let l=(this.useSecureWebSocket?"wss:": +"ws:")+"//"+u;if(this.webSocketConstructor!==void 0)this.ws=new this.webSocketConstructor(l),o(this. +ws);else try{this.ws=new WebSocket(l),o(this.ws)}catch{this.ws=new __unstable_WebSocket(l),o(this.ws)}}catch(c){ let f=(this.useSecureWebSocket?"https:":"http:")+"//"+u;fetch(f,{headers:{Upgrade:"websocket"}}).then( -y=>{if(this.ws=y.webSocket,this.ws==null)throw l;this.ws.accept(),o(this.ws,!0)}).catch(y=>{this.emit( +y=>{if(this.ws=y.webSocket,this.ws==null)throw c;this.ws.accept(),o(this.ws,!0)}).catch(y=>{this.emit( "error",new Error(`All attempts to open a WebSocket to connect to the database failed. Please refer \ to https://github.com/neondatabase/serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websoc\ ket--undefined. Details: ${y}`)),this.emit("close")})}}async startTls(t){if(this.subtls===void 0)throw new Error( "For Postgres SSL connections, you must set `neonConfig.subtls` to the subtls library. See https://g\ ithub.com/neondatabase/serverless/blob/main/CONFIG.md for more information.");this.tlsState=1;let n=await this. subtls.TrustedCert.databaseFromPEM(this.rootCerts),i=new this.subtls.WebSocketReadQueue(this.ws),s=i. -read.bind(i),o=this.rawWrite.bind(this),{read:u,write:l}=await this.subtls.startTls(t,n,s,o,{useSNI:!this. +read.bind(i),o=this.rawWrite.bind(this),{read:u,write:c}=await this.subtls.startTls(t,n,s,o,{useSNI:!this. disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead=u,this.tlsWrite= -l,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){ +c,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){ for(;;){let t=await this.tlsRead();if(t===void 0)break;{let n=m.from(t);this.emit("data",n)}}}rawWrite(t){ if(!this.coalesceWrites){this.ws&&this.ws.send(t);return}if(this.writeBuffer===void 0)this.writeBuffer= t,setTimeout(()=>{this.ws&&this.ws.send(this.writeBuffer),this.writeBuffer=void 0},0);else{let n=new Uint8Array( @@ -423,151 +423,151 @@ 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=m.alloc(0),n="utf8",i=()=>{}){return this.write(t,n,()=>{this. ws.close(),i()}),this}destroy(){return this.destroyed=!0,this.end()}};a(_,"Socket"),I(_,"defaults",{ -poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{let s;return i?.jwtAuth?s=t.replace(os,"apiauth."):s= -t.replace(os,"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(us,"apiauth."):s= +t.replace(us,"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}),I(_,"opts",{});be=_});var ls={};fe(ls,{parse:()=>Rr});function Rr(r,e=!1){let{protocol:t}=new URL(r),n="http:"+r.substring( -t.length),{username:i,password:s,host:o,hostname:u,port:l,pathname:c,search:f,searchParams:y,hash:g}=new URL( -n);s=decodeURIComponent(s),i=decodeURIComponent(i),c=decodeURIComponent(c);let E=i+":"+s,C=e?Object. -fromEntries(y.entries()):f;return{href:r,protocol:t,auth:E,username:i,password:s,host:o,hostname:u,port:l, -pathname:c,search:f,query:C,hash:g}}var Pr=te(()=>{"use strict";p();a(Rr,"parse")});var Gr=P(Ts=>{"use strict";p();Ts.parse=function(r,e){return new $r(r,e).parse()};var zt=class zt{constructor(e,t){ -this.source=e,this.transform=t||ju,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){ +disableWarningInBrowsers:!1}),I(_,"opts",{});ge=_});var fs={};le(fs,{parse:()=>Br});function Br(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 E=i+":"+s,C=e?Object. +fromEntries(y.entries()):f;return{href:r,protocol:t,auth:E,username:i,password:s,host:o,hostname:u,port:c, +pathname:l,search:f,query:C,hash:g}}var Lr=re(()=>{"use strict";p();a(Br,"parse")});var Kr=P(Ps=>{"use strict";p();Ps.parse=function(r,e){return new Vr(r,e).parse()};var Yt=class Yt{constructor(e,t){ +this.source=e,this.transform=t||Hu,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 zt(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse( +dimension>1&&(n=new Yt(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(zt,"ArrayParser");var $r=zt;function ju(r){return r}a(ju,"ide\ -ntity")});var Vr=P((Ih,Rs)=>{p();var Wu=Gr();Rs.exports={create:a(function(r,e){return{parse:a(function(){return Wu. -parse(r,e)},"parse")}},"create")}});var Ls=P((Ph,Bs)=>{"use strict";p();var Hu=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, -$u=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Gu=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Vu=/^-?infinity$/;Bs. -exports=a(function(e){if(Vu.test(e))return Number(e.replace("i","I"));var t=Hu.exec(e);if(!t)return Ku( -e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Ps(i));var s=parseInt(t[2],10)-1,o=t[3],u=parseInt(t[4], -10),l=parseInt(t[5],10),c=parseInt(t[6],10),f=t[7];f=f?1e3*parseFloat(f):0;var y,g=zu(e);return g!=null? -(y=new Date(Date.UTC(i,s,o,u,l,c,f)),Kr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= -new Date(i,s,o,u,l,c,f),Kr(i)&&y.setFullYear(i)),y},"parseDate");function Ku(r){var e=$u.exec(r);if(e){ -var t=parseInt(e[1],10),n=!!e[4];n&&(t=Ps(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return Kr( -t)&&o.setFullYear(t),o}}a(Ku,"getDate");function zu(r){if(r.endsWith("+00"))return 0;var e=Gu.exec(r. +not balanced");return this.entries}};a(Yt,"ArrayParser");var Vr=Yt;function Hu(r){return r}a(Hu,"ide\ +ntity")});var zr=P((Rh,Bs)=>{p();var $u=Kr();Bs.exports={create:a(function(r,e){return{parse:a(function(){return $u. +parse(r,e)},"parse")}},"create")}});var ks=P((Lh,Fs)=>{"use strict";p();var Gu=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, +Vu=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Ku=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,zu=/^-?infinity$/;Fs. +exports=a(function(e){if(zu.test(e))return Number(e.replace("i","I"));var t=Gu.exec(e);if(!t)return Yu( +e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Ls(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=Ju(e);return g!=null? +(y=new Date(Date.UTC(i,s,o,u,c,l,f)),Yr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= +new Date(i,s,o,u,c,l,f),Yr(i)&&y.setFullYear(i)),y},"parseDate");function Yu(r){var e=Vu.exec(r);if(e){ +var t=parseInt(e[1],10),n=!!e[4];n&&(t=Ls(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return Yr( +t)&&o.setFullYear(t),o}}a(Yu,"getDate");function Ju(r){if(r.endsWith("+00"))return 0;var e=Ku.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(zu,"timeZoneOffset");function Ps(r){return-(r- -1)}a(Ps,"bcYearToNegativeYear");function Kr(r){return r>=0&&r<100}a(Kr,"is0To99")});var Ms=P((Fh,Fs)=>{p();Fs.exports=Ju;var Yu=Object.prototype.hasOwnProperty;function Ju(r){for(var e=1;e< -arguments.length;e++){var t=arguments[e];for(var n in t)Yu.call(t,n)&&(r[n]=t[n])}return r}a(Ju,"ext\ -end")});var Ds=P((Uh,Us)=>{"use strict";p();var Zu=Ms();Us.exports=it;function it(r){if(!(this instanceof it)) -return new it(r);Zu(this,cl(r))}a(it,"PostgresInterval");var Xu=["seconds","minutes","hours","days", -"months","years"];it.prototype.toPostgres=function(){var r=Xu.filter(this.hasOwnProperty,this);return this. +e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(Ju,"timeZoneOffset");function Ls(r){return-(r- +1)}a(Ls,"bcYearToNegativeYear");function Yr(r){return r>=0&&r<100}a(Yr,"is0To99")});var Us=P((Mh,Ms)=>{p();Ms.exports=Xu;var Zu=Object.prototype.hasOwnProperty;function Xu(r){for(var e=1;e< +arguments.length;e++){var t=arguments[e];for(var n in t)Zu.call(t,n)&&(r[n]=t[n])}return r}a(Xu,"ext\ +end")});var Ns=P((Oh,Os)=>{"use strict";p();var ec=Us();Os.exports=st;function st(r){if(!(this instanceof st)) +return new st(r);ec(this,hc(r))}a(st,"PostgresInterval");var tc=["seconds","minutes","hours","days", +"months","years"];st.prototype.toPostgres=function(){var r=tc.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 el={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ -S"},tl=["years","months","days"],rl=["hours","minutes","seconds"];it.prototype.toISOString=it.prototype. -toISO=function(){var r=tl.map(t,this).join(""),e=rl.map(t,this).join("");return"P"+r+"T"+e;function t(n){ +"")),t+" "+e},this).join(" ")};var rc={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ +S"},nc=["years","months","days"],ic=["hours","minutes","seconds"];st.prototype.toISOString=st.prototype. +toISO=function(){var r=nc.map(t,this).join(""),e=ic.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+el[n]}};var zr="([+-]?\\d+)",nl=zr+"\\s+years?",il=zr+"\\s+mons?",sl=zr+"\\s+days?",ol="\ -([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",al=new RegExp([nl,il,sl,ol].map(function(r){return"\ -("+r+")?"}).join("\\s*")),ks={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, -ul=["hours","minutes","seconds","milliseconds"];function ll(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}a(ll,"parseMilliseconds");function cl(r){if(!r)return{};var e=al.exec(r),t=e[8]==="-";return Object. -keys(ks).reduce(function(n,i){var s=ks[i],o=e[s];return!o||(o=i==="milliseconds"?ll(o):parseInt(o,10), -!o)||(t&&~ul.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(cl,"parse")});var Ns=P((Nh,Os)=>{"use strict";p();Os.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( +/0+$/,"")),i+rc[n]}};var Jr="([+-]?\\d+)",sc=Jr+"\\s+years?",oc=Jr+"\\s+mons?",ac=Jr+"\\s+days?",uc="\ +([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",cc=new RegExp([sc,oc,ac,uc].map(function(r){return"\ +("+r+")?"}).join("\\s*")),Ds={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, +lc=["hours","minutes","seconds","milliseconds"];function fc(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(fc,"parseMilliseconds");function hc(r){if(!r)return{};var e=cc.exec(r),t=e[8]==="-";return Object. +keys(Ds).reduce(function(n,i){var s=Ds[i],o=e[s];return!o||(o=i==="milliseconds"?fc(o):parseInt(o,10), +!o)||(t&&~lc.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(hc,"parse")});var Qs=P((Qh,qs)=>{"use strict";p();qs.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( 2),"hex");for(var t="",n=0;n{p();var St=Gr(),vt=Vr(),Yt=Ls(),Qs=Ds(),js=Ns();function Jt(r){return a(function(t){ -return t===null?t:r(t)},"nullAllowed")}a(Jt,"allowNull");function Ws(r){return r===null?r:r==="TRUE"|| -r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(Ws,"parseBool");function fl(r){return r? -St.parse(r,Ws):null}a(fl,"parseBoolArray");function hl(r){return parseInt(r,10)}a(hl,"parseBaseTenIn\ -t");function Yr(r){return r?St.parse(r,Jt(hl)):null}a(Yr,"parseIntegerArray");function dl(r){return r? -St.parse(r,Jt(function(e){return Hs(e).trim()})):null}a(dl,"parseBigIntegerArray");var pl=a(function(r){ -if(!r)return null;var e=vt.create(r,function(t){return t!==null&&(t=en(t)),t});return e.parse()},"pa\ -rsePointArray"),Jr=a(function(r){if(!r)return null;var e=vt.create(r,function(t){return t!==null&&(t= -parseFloat(t)),t});return e.parse()},"parseFloatArray"),ye=a(function(r){if(!r)return null;var e=vt. -create(r);return e.parse()},"parseStringArray"),Zr=a(function(r){if(!r)return null;var e=vt.create(r, -function(t){return t!==null&&(t=Yt(t)),t});return e.parse()},"parseDateArray"),yl=a(function(r){if(!r) -return null;var e=vt.create(r,function(t){return t!==null&&(t=Qs(t)),t});return e.parse()},"parseInt\ -ervalArray"),ml=a(function(r){return r?St.parse(r,Jt(js)):null},"parseByteAArray"),Xr=a(function(r){ -return parseInt(r,10)},"parseInteger"),Hs=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ -parseBigInteger"),qs=a(function(r){return r?St.parse(r,Jt(JSON.parse)):null},"parseJsonArray"),en=a( +parseBytea")});var Ks=P((Hh,Vs)=>{p();var vt=Kr(),Et=zr(),Jt=ks(),Ws=Ns(),Hs=Qs();function Zt(r){return a(function(t){ +return t===null?t:r(t)},"nullAllowed")}a(Zt,"allowNull");function $s(r){return r===null?r:r==="TRUE"|| +r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a($s,"parseBool");function dc(r){return r? +vt.parse(r,$s):null}a(dc,"parseBoolArray");function pc(r){return parseInt(r,10)}a(pc,"parseBaseTenIn\ +t");function Zr(r){return r?vt.parse(r,Zt(pc)):null}a(Zr,"parseIntegerArray");function yc(r){return r? +vt.parse(r,Zt(function(e){return Gs(e).trim()})):null}a(yc,"parseBigIntegerArray");var mc=a(function(r){ +if(!r)return null;var e=Et.create(r,function(t){return t!==null&&(t=rn(t)),t});return e.parse()},"pa\ +rsePointArray"),Xr=a(function(r){if(!r)return null;var e=Et.create(r,function(t){return t!==null&&(t= +parseFloat(t)),t});return e.parse()},"parseFloatArray"),pe=a(function(r){if(!r)return null;var e=Et. +create(r);return e.parse()},"parseStringArray"),en=a(function(r){if(!r)return null;var e=Et.create(r, +function(t){return t!==null&&(t=Jt(t)),t});return e.parse()},"parseDateArray"),wc=a(function(r){if(!r) +return null;var e=Et.create(r,function(t){return t!==null&&(t=Ws(t)),t});return e.parse()},"parseInt\ +ervalArray"),gc=a(function(r){return r?vt.parse(r,Zt(Hs)):null},"parseByteAArray"),tn=a(function(r){ +return parseInt(r,10)},"parseInteger"),Gs=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ +parseBigInteger"),js=a(function(r){return r?vt.parse(r,Zt(JSON.parse)):null},"parseJsonArray"),rn=a( function(r){return r[0]!=="("?null:(r=r.substring(1,r.length-1).split(","),{x:parseFloat(r[0]),y:parseFloat( -r[1])})},"parsePoint"),wl=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, +r[1])})},"parsePoint"),bc=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, i=2;i{"use strict";p();var ie=1e6;function bl(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,l,c,f;{if(s=e%ie,e=e/ie>>>0,o=4294967296* -s+t,t=o/ie>>>0,u=""+(o-ie*t),t===0&&e===0)return n+u+i;for(l="",c=6-u.length,f=0;f>>0,o=4294967296*s+t,t=o/ie>>>0,u=""+(o-ie*t),t===0&&e===0)return n+u+i;for(l= -"",c=6-u.length,f=0;f>>0,o=4294967296*s+t,t=o/ie>>>0,u=""+(o- -ie*t),t===0&&e===0)return n+u+i;for(l="",c=6-u.length,f=0;f{p();var xl=Ks(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,H){return E* -Math.pow(2,H)+C};var s=t>>3,o=a(function(E){return n?~E&255:E},"inv"),u=255,l=8-t%8;e>t%8);var c=0;t%8+e>=8&&(c=i(0,o(r[s])&u,l));for(var f=e+t>>3,y=s+1;y0&&(c=i(c,o(r[f])>>8-g,g)),c},"parseBits"),Js=a(function(r,e,t){var n=Math. -pow(2,t-1)-1,i=U(r,1),s=U(r,t,1);if(s===0)return 0;var o=1,u=a(function(c,f,y){c===0&&(c=1);for(var g=1;g<= -y;g++)o/=2,(f&1<0&&(c+=o);return c},"parsePrecisionBits"),l=U(r,e,t+1,!1,u);return s==Math.pow( -2,t+1)-1?l===0?i===0?1/0:-1/0:NaN:(i===0?1:-1)*Math.pow(2,s-n)*l},"parseFloatFromBits"),Sl=a(function(r){ -return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),zs=a(function(r){return U(r,1)==1?-1*(U( -r,31,1,!0)+1):U(r,31,1)},"parseInt32"),vl=a(function(r){return Js(r,23,8)},"parseFloat32"),El=a(function(r){ -return Js(r,52,11)},"parseFloat64"),Al=a(function(r){var e=U(r,16,32);if(e==49152)return NaN;for(var t=Math. +r[i])}var s=rn(e);return s.radius=parseFloat(t),s},"parseCircle"),xc=a(function(r){r(20,Gs),r(21,tn), +r(23,tn),r(26,tn),r(700,parseFloat),r(701,parseFloat),r(16,$s),r(1082,Jt),r(1114,Jt),r(1184,Jt),r(600, +rn),r(651,pe),r(718,bc),r(1e3,dc),r(1001,gc),r(1005,Zr),r(1007,Zr),r(1028,Zr),r(1016,yc),r(1017,mc), +r(1021,Xr),r(1022,Xr),r(1231,Xr),r(1014,pe),r(1015,pe),r(1008,pe),r(1009,pe),r(1040,pe),r(1041,pe),r( +1115,en),r(1182,en),r(1185,en),r(1186,Ws),r(1187,wc),r(17,Hs),r(114,JSON.parse.bind(JSON)),r(3802,JSON. +parse.bind(JSON)),r(199,js),r(3807,js),r(3907,pe),r(2951,pe),r(791,pe),r(1183,pe),r(1270,pe)},"init"); +Vs.exports={init:xc}});var Ys=P((Vh,zs)=>{"use strict";p();var se=1e6;function Sc(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%se,e=e/se>>>0,o=4294967296* +s+t,t=o/se>>>0,u=""+(o-se*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/se>>>0,u=""+(o-se*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/se>>>0,u=""+(o- +se*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var vc=Ys(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,H){return E* +Math.pow(2,H)+C};var s=t>>3,o=a(function(E){return n?~E&255:E},"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"),Xs=a(function(r,e,t){var n=Math. +pow(2,t-1)-1,i=U(r,1),s=U(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=U(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"),Ec=a(function(r){ +return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),Js=a(function(r){return U(r,1)==1?-1*(U( +r,31,1,!0)+1):U(r,31,1)},"parseInt32"),Ac=a(function(r){return Xs(r,23,8)},"parseFloat32"),_c=a(function(r){ +return Xs(r,52,11)},"parseFloat64"),Cc=a(function(r){var e=U(r,16,32);if(e==49152)return NaN;for(var t=Math. pow(1e4,U(r,16,16)),n=0,i=[],s=U(r,16),o=0;o>3,(i+=f<<3)>>3),y;console.log("ERROR: ElementType no\ -t implemented: "+c)},"parseElement"),l=a(function(c,f){var y=[],g;if(c.length>1){var E=c.shift();for(g= -0;g0},"parseBool"),Il=a(function(r){r(20,xl),r(21,Sl),r(23,zs),r(26,zs),r(1700,Al),r(700,vl), -r(701,El),r(16,Cl),r(1114,Ys.bind(null,!1)),r(1184,Ys.bind(null,!0)),r(1e3,Et),r(1007,Et),r(1016,Et), -r(1008,Et),r(1009,Et),r(25,_l)},"init");Zs.exports={init:Il}});var to=P((Jh,eo)=>{p();eo.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25, +usec=s},i.getUTCMicroSeconds=function(){return this.usec},i},"parseDate"),At=a(function(r){for(var e=U( +r,32),t=U(r,32,32),n=U(r,32,64),i=96,s=[],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 E=l.shift();for(g= +0;g0},"parseBool"),Rc=a(function(r){r(20,vc),r(21,Ec),r(23,Js),r(26,Js),r(1700,Cc),r(700,Ac), +r(701,_c),r(16,Tc),r(1114,Zs.bind(null,!1)),r(1184,Zs.bind(null,!0)),r(1e3,At),r(1007,At),r(1016,At), +r(1008,At),r(1009,At),r(25,Ic)},"init");eo.exports={init:Rc}});var no=P((Xh,ro)=>{p();ro.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 Ct=P(_t=>{p();var Tl=Gs(),Rl=Xs(),Pl=Vr(),Bl=to();_t.getTypeParser=Ll;_t.setTypeParser=Fl;_t.arrayParser= -Pl;_t.builtins=Bl;var At={text:{},binary:{}};function ro(r){return String(r)}a(ro,"noParse");function Ll(r,e){ -return e=e||"text",At[e]&&At[e][r]||ro}a(Ll,"getTypeParser");function Fl(r,e,t){typeof e=="function"&& -(t=e,e="text"),At[e][r]=t}a(Fl,"setTypeParser");Tl.init(function(r,e){At.text[r]=e});Rl.init(function(r,e){ -At.binary[r]=e})});var Xt=P((rd,no)=>{"use strict";p();var Ml=Ct();function Zt(r){this._types=r||Ml,this.text={},this.binary= -{}}a(Zt,"TypeOverrides");Zt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ -binary":return this.binary;default:return{}}};Zt.prototype.setTypeParser=function(r,e,t){typeof e=="\ -function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Zt.prototype.getTypeParser=function(r,e){return e= -e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};no.exports=Zt});function It(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119,o=2600822924,u=528734635, -l=1541459225,c=0,f=0,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748, +REGROLE:4096}});var It=P(Ct=>{p();var Pc=Ks(),Bc=to(),Lc=zr(),Fc=no();Ct.getTypeParser=kc;Ct.setTypeParser=Mc;Ct.arrayParser= +Lc;Ct.builtins=Fc;var _t={text:{},binary:{}};function io(r){return String(r)}a(io,"noParse");function kc(r,e){ +return e=e||"text",_t[e]&&_t[e][r]||io}a(kc,"getTypeParser");function Mc(r,e,t){typeof e=="function"&& +(t=e,e="text"),_t[e][r]=t}a(Mc,"setTypeParser");Pc.init(function(r,e){_t.text[r]=e});Bc.init(function(r,e){ +_t.binary[r]=e})});var er=P((id,so)=>{"use strict";p();var Uc=It();function Xt(r){this._types=r||Uc,this.text={},this.binary= +{}}a(Xt,"TypeOverrides");Xt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ +binary":return this.binary;default:return{}}};Xt.prototype.setTypeParser=function(r,e,t){typeof e=="\ +function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Xt.prototype.getTypeParser=function(r,e){return e= +e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};so.exports=Xt});function Tt(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, 3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700, 1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909, 275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222, 2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=a((T,b)=>T>>>b|T<<32- -b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),H=a(()=>{for(let F=0,J=0;F<16;F++,J+=4)E[F]=C[J]<< -24|C[J+1]<<16|C[J+2]<<8|C[J+3];for(let F=16;F<64;F++){let J=g(E[F-15],7)^g(E[F-15],18)^E[F-15]>>>3,Ee=g( -E[F-2],17)^g(E[F-2],19)^E[F-2]>>>10;E[F]=E[F-16]+J+E[F-7]+Ee|0}let T=e,b=t,M=n,oe=i,$=s,ge=o,Ie=u,le=l; -for(let F=0;F<64;F++){let J=g($,6)^g($,11)^g($,25),Ee=$&ge^~$&Ie,Te=le+J+Ee+y[F]+E[F]|0,Ue=g(T,2)^g( -T,13)^g(T,22),De=T&b^T&M^b&M,Oe=Ue+De|0;le=Ie,Ie=ge,ge=$,$=oe+Te|0,oe=M,M=b,b=T,T=Te+Oe|0}e=e+T|0,t= -t+b|0,n=n+M|0,i=i+oe|0,s=s+$|0,o=o+ge|0,u=u+Ie|0,l=l+le|0,f=0},"process"),Y=a(T=>{typeof T=="string"&& -(T=new TextEncoder().encode(T));for(let b=0;b{if(C[f++]=128,f==64&&H(),f+8>64){for(;f<64;)C[f++]=0;H()}for(;f<58;)C[f++]=0;let T=c*8;C[f++]= +b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),H=a(()=>{for(let M=0,Z=0;M<16;M++,Z+=4)E[M]=C[Z]<< +24|C[Z+1]<<16|C[Z+2]<<8|C[Z+3];for(let M=16;M<64;M++){let Z=g(E[M-15],7)^g(E[M-15],18)^E[M-15]>>>3,ve=g( +E[M-2],17)^g(E[M-2],19)^E[M-2]>>>10;E[M]=E[M-16]+Z+E[M-7]+ve|0}let T=e,b=t,F=n,ae=i,$=s,we=o,Ie=u,ce=c; +for(let M=0;M<64;M++){let Z=g($,6)^g($,11)^g($,25),ve=$&we^~$&Ie,Te=ce+Z+ve+y[M]+E[M]|0,Ue=g(T,2)^g( +T,13)^g(T,22),De=T&b^T&F^b&F,Oe=Ue+De|0;ce=Ie,Ie=we,we=$,$=ae+Te|0,ae=F,F=b,b=T,T=Te+Oe|0}e=e+T|0,t= +t+b|0,n=n+F|0,i=i+ae|0,s=s+$|0,o=o+we|0,u=u+Ie|0,c=c+ce|0,f=0},"process"),J=a(T=>{typeof T=="string"&& +(T=new TextEncoder().encode(T));for(let b=0;b{if(C[f++]=128,f==64&&H(),f+8>64){for(;f<64;)C[f++]=0;H()}for(;f<58;)C[f++]=0;let T=l*8;C[f++]= T/1099511627776&255,C[f++]=T/4294967296&255,C[f++]=T>>>24,C[f++]=T>>>16&255,C[f++]=T>>>8&255,C[f++]= T&255,H();let b=new Uint8Array(32);return b[0]=e>>>24,b[1]=e>>>16&255,b[2]=e>>>8&255,b[3]=e&255,b[4]= t>>>24,b[5]=t>>>16&255,b[6]=t>>>8&255,b[7]=t&255,b[8]=n>>>24,b[9]=n>>>16&255,b[10]=n>>>8&255,b[11]=n& 255,b[12]=i>>>24,b[13]=i>>>16&255,b[14]=i>>>8&255,b[15]=i&255,b[16]=s>>>24,b[17]=s>>>16&255,b[18]=s>>> 8&255,b[19]=s&255,b[20]=o>>>24,b[21]=o>>>16&255,b[22]=o>>>8&255,b[23]=o&255,b[24]=u>>>24,b[25]=u>>>16& -255,b[26]=u>>>8&255,b[27]=u&255,b[28]=l>>>24,b[29]=l>>>16&255,b[30]=l>>>8&255,b[31]=l&255,b},"digest"); -return r===void 0?{add:Y,digest:we}:(Y(r),we())}var io=te(()=>{"use strict";p();a(It,"sha256")});var Q,Tt,so=te(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ +255,b[26]=u>>>8&255,b[27]=u&255,b[28]=c>>>24,b[29]=c>>>16&255,b[30]=c>>>8&255,b[31]=c&255,b},"digest"); +return r===void 0?{add:J,digest:me}:(J(r),me())}var oo=re(()=>{"use strict";p();a(Tt,"sha256")});var Q,Rt,ao=re(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ Length",0);I(this,"_state",new Int32Array(4));I(this,"_buffer",new ArrayBuffer(68));I(this,"_buffer8"); I(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( @@ -625,130 +625,130 @@ i=this._state,s;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=n i[3]=n[3],s=0;s>2)+1;this._dataLength+=t;let o=this._dataLength*8;if(n[t]=128,n[t+1]= n[t+2]=n[t+3]=0,i.set(Q.buffer32Identity.subarray(s),s),t>55&&(Q._md5cycle(this._state,i),i.set(Q.buffer32Identity)), -o<=4294967295)i[14]=o;else{let u=o.toString(16).match(/(.*?)(.{0,8})$/);if(u===null)return;let l=parseInt( -u[2],16),c=parseInt(u[1],16)||0;i[14]=l,i[15]=c}return Q._md5cycle(this._state,i),e?this._state:Q._hex( +o<=4294967295)i[14]=o;else{let u=o.toString(16).match(/(.*?)(.{0,8})$/);if(u===null)return;let c=parseInt( +u[2],16),l=parseInt(u[1],16)||0;i[14]=c,i[15]=l}return Q._md5cycle(this._state,i),e?this._state:Q._hex( this._state)}};a(Q,"Md5"),I(Q,"stateIdentity",new Int32Array([1732584193,-271733879,-1732584194,271733878])), I(Q,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),I(Q,"hexChars","0123456789\ -abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);Tt=Q});var tn={};fe(tn,{createHash:()=>Ul,createHmac:()=>Dl,randomBytes:()=>kl});function kl(r){return crypto. -getRandomValues(m.alloc(r))}function Ul(r){if(r==="sha256")return{update:a(function(e){return{digest:a( -function(){return m.from(It(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 Dl(r,e){if(r!=="sha256")throw new Error(`\ +abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);Rt=Q});var nn={};le(nn,{createHash:()=>Oc,createHmac:()=>Nc,randomBytes:()=>Dc});function Dc(r){return crypto. +getRandomValues(m.alloc(r))}function Oc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( +function(){return m.from(Tt(e))},"digest")}},"update")};if(r==="md5")return{update:a(function(e){return{ +digest:a(function(){return typeof e=="string"?Rt.hashStr(e):Rt.hashByteArray(e)},"digest")}},"update")}; +throw new Error(`Hash type '${r}' not supported`)}function Nc(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=It(e);else if(n<64){let l=new Uint8Array(64);l.set(e),e=l}let i=new Uint8Array( -64),s=new Uint8Array(64);for(let l=0;l<64;l++)i[l]=54^e[l],s[l]=92^e[l];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(It(o),64),m.from(It(u))}, -"digest")}},"update")}}var rn=te(()=>{"use strict";p();io();so();a(kl,"randomBytes");a(Ul,"createHas\ -h");a(Dl,"createHmac")});var Rt=P((yd,nn)=>{"use strict";p();nn.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: +t));let n=e.length;if(n>64)e=Tt(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(Tt(o),64),m.from(Tt(u))}, +"digest")}},"update")}}var sn=re(()=>{"use strict";p();oo();ao();a(Dc,"randomBytes");a(Oc,"createHas\ +h");a(Nc,"createHmac")});var Pt=P((wd,on)=>{"use strict";p();on.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: w.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 st=Ct(),Ol=st.getTypeParser(20,"text"),Nl=st.getTypeParser(1016, -"text");nn.exports.__defineSetter__("parseInt8",function(r){st.setTypeParser(20,"text",r?st.getTypeParser( -23,"text"):Ol),st.setTypeParser(1016,"text",r?st.getTypeParser(1007,"text"):Nl)})});var Pt=P((wd,ao)=>{"use strict";p();var ql=(rn(),j(tn)),Ql=Rt();function jl(r){var e=r.replace(/\\/g, -"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(jl,"escapeElement");function oo(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+oo(r[t]): -r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=jl(er(r[t]));return e=e+"}",e}a(oo,"arrayString"); -var er=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. +keepalives:1,keepalives_idle:0};var ot=It(),qc=ot.getTypeParser(20,"text"),Qc=ot.getTypeParser(1016, +"text");on.exports.__defineSetter__("parseInt8",function(r){ot.setTypeParser(20,"text",r?ot.getTypeParser( +23,"text"):qc),ot.setTypeParser(1016,"text",r?ot.getTypeParser(1007,"text"):Qc)})});var Bt=P((bd,co)=>{"use strict";p();var jc=(sn(),j(nn)),Wc=Pt();function Hc(r){var e=r.replace(/\\/g, +"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(Hc,"escapeElement");function uo(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+uo(r[t]): +r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=Hc(tr(r[t]));return e=e+"}",e}a(uo,"arrayString"); +var tr=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. 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?Ql.parseInputDatesAsUTC?$l(r):Hl(r):Array.isArray(r)?oo(r):typeof r== -"object"?Wl(r,e):r.toString()},"prepareValue");function Wl(r,e){if(r&&typeof r.toPostgres=="function"){ +r.byteLength)}return r instanceof Date?Wc.parseInputDatesAsUTC?Vc(r):Gc(r):Array.isArray(r)?uo(r):typeof r== +"object"?$c(r,e):r.toString()},"prepareValue");function $c(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),er(r.toPostgres(er),e)}return JSON.stringify(r)}a(Wl,"prepareObject");function z(r,e){ -for(r=""+r;r.lengthrc});var rc,Lt=te(()=>{"use strict";p();rc={}});var bo=P((Bd,go)=>{"use strict";p();var un=(rn(),j(tn));function nc(r){if(r.indexOf("SCRAM-SHA-256")=== --1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=un.randomBytes( +t),r}a(Kc,"normalizeQueryConfig");var an=a(function(r){return jc.createHash("md5").update(r,"utf-8"). +digest("hex")},"md5"),zc=a(function(r,e,t){var n=an(e+r),i=an(m.concat([m.from(n),t]));return"md5"+i}, +"postgresMd5PasswordHash");co.exports={prepareValue:a(function(e){return tr(e)},"prepareValueWrapper"), +normalizeQueryConfig:Kc,postgresMd5PasswordHash:zc,md5:an}});var Lt={};le(Lt,{default:()=>il});var il,Ft=re(()=>{"use strict";p();il={}});var So=P((Fd,xo)=>{"use strict";p();var ln=(sn(),j(nn));function sl(r){if(r.indexOf("SCRAM-SHA-256")=== +-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=ln.randomBytes( 18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"\ -SASLInitialResponse"}}a(nc,"startSession");function ic(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( +SASLInitialResponse"}}a(sl,"startSession");function ol(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=ac(t);if(n.nonce.startsWith(r.clientNonce)){ +L: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=cl(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=m.from(n.salt,"base64"),s=cc(e,i,n.iteration),o=ot(s,"Client Key"),u=lc( -o),l="n=*,r="+r.clientNonce,c="r="+n.nonce+",s="+n.salt+",i="+n.iteration,f="c=biws,r="+n.nonce,y=l+ -","+c+","+f,g=ot(u,y),E=wo(o,g),C=E.toString("base64"),H=ot(s,"Server Key"),Y=ot(H,y);r.message="SAS\ -LResponse",r.serverSignature=Y.toString("base64"),r.response=f+",p="+C}a(ic,"continueSession");function sc(r,e){ +art with client nonce");var i=m.from(n.salt,"base64"),s=hl(e,i,n.iteration),o=at(s,"Client Key"),u=fl( +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=at(u,y),E=bo(o,g),C=E.toString("base64"),H=at(s,"Server Key"),J=at(H,y);r.message="SAS\ +LResponse",r.serverSignature=J.toString("base64"),r.response=f+",p="+C}a(ol,"continueSession");function al(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}=uc( +"string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=ll( e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does\ - not match")}a(sc,"finalizeSession");function oc(r){if(typeof r!="string")throw new TypeError("SASL:\ + not match")}a(al,"finalizeSession");function ul(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(oc,"isPrintableChars");function yo(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(r)}a(yo,"isBase64");function mo(r){if(typeof r!="string")throw new TypeError("SASL: attribute p\ +e<=126)}a(ul,"isPrintableChars");function wo(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(r)}a(wo,"isBase64");function go(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(mo,"parseAttribute\ -Pairs");function ac(r){let e=mo(r),t=e.get("r");if(t){if(!oc(t))throw new Error("SASL: SCRAM-SERVER-\ +SASL: Invalid attribute pair entry");let t=e[0],n=e.substring(2);return[t,n]}))}a(go,"parseAttribute\ +Pairs");function cl(r){let e=go(r),t=e.get("r");if(t){if(!ul(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(!yo(n))throw new Error("SASL: SCRAM-SERV\ +ER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!wo(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(ac,"parseServerFirstMessage"); -function uc(r){let t=mo(r).get("v");if(t){if(!yo(t))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAG\ +tion missing");let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(cl,"parseServerFirstMessage"); +function ll(r){let t=go(r).get("v");if(t){if(!wo(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(uc,"parseServerFinalMessage");function wo(r,e){if(!m. +signature is missing");return{serverSignature:t}}a(ll,"parseServerFinalMessage");function bo(r,e){if(!m. isBuffer(r))throw new TypeError("first argument must be a Buffer");if(!m.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 m.from(r.map((t,n)=>r[n]^e[n]))} -a(wo,"xorBuffers");function lc(r){return un.createHash("sha256").update(r).digest()}a(lc,"sha256");function ot(r,e){ -return un.createHmac("sha256",r).update(e).digest()}a(ot,"hmacSha256");function cc(r,e,t){for(var n=ot( -r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sfc});function fc(...r){return r.join("/")}var cn=te(()=>{"use strict";p(); -a(fc,"join")});var fn={};fe(fn,{stat:()=>hc});function hc(r,e){e(new Error("No filesystem"))}var hn=te(()=>{"use st\ -rict";p();a(hc,"stat")});var dn={};fe(dn,{default:()=>dc});var dc,pn=te(()=>{"use strict";p();dc={}});var xo={};fe(xo,{StringDecoder:()=>yn});var mn,yn,So=te(()=>{"use strict";p();mn=class mn{constructor(e){ +a(bo,"xorBuffers");function fl(r){return ln.createHash("sha256").update(r).digest()}a(fl,"sha256");function at(r,e){ +return ln.createHmac("sha256",r).update(e).digest()}a(at,"hmacSha256");function hl(r,e,t){for(var n=at( +r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sdl});function dl(...r){return r.join("/")}var hn=re(()=>{"use strict";p(); +a(dl,"join")});var dn={};le(dn,{stat:()=>pl});function pl(r,e){e(new Error("No filesystem"))}var pn=re(()=>{"use st\ +rict";p();a(pl,"stat")});var yn={};le(yn,{default:()=>yl});var yl,mn=re(()=>{"use strict";p();yl={}});var vo={};le(vo,{StringDecoder:()=>wn});var gn,wn,Eo=re(()=>{"use strict";p();gn=class gn{constructor(e){ I(this,"td");this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this. -td.decode(e)}};a(mn,"StringDecoder");yn=mn});var _o=P((Qd,Ao)=>{"use strict";p();var{Transform:pc}=(pn(),j(dn)),{StringDecoder:yc}=(So(),j(xo)),Me=Symbol( -"last"),rr=Symbol("decoder");function mc(r,e,t){let n;if(this.overflow){if(n=this[rr].write(r).split( -this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Me]+=this[rr].write(r),n= -this[Me].split(this.matcher);this[Me]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( -"maximum buffer reached"));return}t()}a(mc,"transform");function wc(r){if(this[Me]+=this[rr].end(),this[Me]) -try{Eo(this,this.mapper(this[Me]))}catch(e){return r(e)}r()}a(wc,"flush");function Eo(r,e){e!==void 0&& -r.push(e)}a(Eo,"push");function vo(r){return r}a(vo,"noop");function gc(r,e,t){switch(r=r||/\r?\n/,e= -e||vo,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r=="object"&&!(r instanceof +td.decode(e)}};a(gn,"StringDecoder");wn=gn});var Io=P((Wd,Co)=>{"use strict";p();var{Transform:ml}=(mn(),j(yn)),{StringDecoder:wl}=(Eo(),j(vo)),ke=Symbol( +"last"),ir=Symbol("decoder");function gl(r,e,t){let n;if(this.overflow){if(n=this[ir].write(r).split( +this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[ke]+=this[ir].write(r),n= +this[ke].split(this.matcher);this[ke]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( +"maximum buffer reached"));return}t()}a(gl,"transform");function bl(r){if(this[ke]+=this[ir].end(),this[ke]) +try{_o(this,this.mapper(this[ke]))}catch(e){return r(e)}r()}a(bl,"flush");function _o(r,e){e!==void 0&& +r.push(e)}a(_o,"push");function Ao(r){return r}a(Ao,"noop");function xl(r,e,t){switch(r=r||/\r?\n/,e= +e||Ao,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=vo)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=mc,t.flush=wc,t.readableObjectMode= -!0;let n=new pc(t);return n[Me]="",n[rr]=new yc("utf8"),n.matcher=r,n.mapper=e,n.maxLength=t.maxLength, +"object"&&(t=e,e=Ao)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=gl,t.flush=bl,t.readableObjectMode= +!0;let n=new ml(t);return n[ke]="",n[ir]=new wl("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(gc,"split");Ao.exports=gc});var To=P((Hd,Ce)=>{"use strict";p();var Co=(cn(),j(ln)),bc=(pn(),j(dn)).Stream,xc=_o(),Io=(Lt(),j(Bt)), -Sc=5432,nr=w.platform==="win32",Ft=w.stderr,vc=56,Ec=7,Ac=61440,_c=32768;function Cc(r){return(r&Ac)== -_c}a(Cc,"isRegFile");var at=["host","port","database","user","password"],wn=at.length,Ic=at[wn-1];function gn(){ -var r=Ft instanceof bc&&Ft.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` -`);Ft.write(Io.format.apply(Io,e))}}a(gn,"warn");Object.defineProperty(Ce.exports,"isWin",{get:a(function(){ -return nr},"get"),set:a(function(r){nr=r},"set")});Ce.exports.warnTo=function(r){var e=Ft;return Ft= -r,e};Ce.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(nr?Co.join(e.APPDATA||"./","\ -postgresql","pgpass.conf"):Co.join(e.HOME||"./",".pgpass"));return t};Ce.exports.usePgPass=function(r,e){ -return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:nr?!0:(e=e||"",Cc(r.mode)?r. -mode&(vc|Ec)?(gn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ -(0600) or less',e),!1):!0:(gn('WARNING: password file "%s" is not a plain file',e),!1))};var Tc=Ce.exports. -match=function(r,e){return at.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||Sc)===Number( +!1,s(i)},n}a(xl,"split");Co.exports=xl});var Po=P((Gd,Ce)=>{"use strict";p();var To=(hn(),j(fn)),Sl=(mn(),j(yn)).Stream,vl=Io(),Ro=(Ft(),j(Lt)), +El=5432,sr=w.platform==="win32",kt=w.stderr,Al=56,_l=7,Cl=61440,Il=32768;function Tl(r){return(r&Cl)== +Il}a(Tl,"isRegFile");var ut=["host","port","database","user","password"],bn=ut.length,Rl=ut[bn-1];function xn(){ +var r=kt instanceof Sl&&kt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +`);kt.write(Ro.format.apply(Ro,e))}}a(xn,"warn");Object.defineProperty(Ce.exports,"isWin",{get:a(function(){ +return sr},"get"),set:a(function(r){sr=r},"set")});Ce.exports.warnTo=function(r){var e=kt;return kt= +r,e};Ce.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(sr?To.join(e.APPDATA||"./","\ +postgresql","pgpass.conf"):To.join(e.HOME||"./",".pgpass"));return t};Ce.exports.usePgPass=function(r,e){ +return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:sr?!0:(e=e||"",Tl(r.mode)?r. +mode&(Al|_l)?(xn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ +(0600) or less',e),!1):!0:(xn('WARNING: password file "%s" is not a plain file',e),!1))};var Pl=Ce.exports. +match=function(r,e){return ut.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||El)===Number( e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};Ce.exports.getPassword=function(r,e,t){var n,i=e.pipe( -xc());function s(l){var c=Rc(l);c&&Pc(c)&&Tc(r,c)&&(n=c[Ic],i.end())}a(s,"onLine");var o=a(function(){ -e.destroy(),t(n)},"onEnd"),u=a(function(l){e.destroy(),gn("WARNING: error on reading file: %s",l),t( -void 0)},"onErr");e.on("error",u),i.on("data",s).on("end",o).on("error",u)};var Rc=Ce.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,l=a( +vl());function s(c){var l=Bl(c);l&&Ll(l)&&Pl(r,l)&&(n=l[Rl],i.end())}a(s,"onLine");var o=a(function(){ +e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),xn("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 Bl=Ce.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 E=r.substring(y,g);Object.hasOwnProperty.call(w.env,"PGPASS_NO_DEESCAPE")||(E=E. -replace(/\\([:\\])/g,"$1")),o[at[f]]=E},"addToObj"),c=0;c=0&&e==":"&&t!=="\\"&&(l(n,i,c+1),i=c+2,n+=1)}return o=Object.keys(o). -length===wn?o:null,o},Pc=Ce.exports.isValidEntry=function(r){for(var e={0:function(o){return o.length> +replace(/\\([:\\])/g,"$1")),o[ut[f]]=E},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). +length===bn?o:null,o},Ll=Ce.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 Vd=(cn(),j(ln)),Ro=(hn(),j(fn)),ir=To();bn.exports=function(r,e){ -var t=ir.getFileName();Ro.stat(t,function(n,i){if(n||!ir.usePgPass(i,t))return e(void 0);var s=Ro.createReadStream( -t);ir.getPassword(r,s,e)})};bn.exports.warnTo=ir.warnTo});var Bo={};fe(Bo,{default:()=>Bc});var Bc,Lo=te(()=>{"use strict";p();Bc={}});var Mo=P((Jd,Fo)=>{"use strict";p();var Lc=(Pr(),j(ls)),xn=(hn(),j(fn));function Sn(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 zd=(hn(),j(fn)),Bo=(pn(),j(dn)),or=Po();Sn.exports=function(r,e){ +var t=or.getFileName();Bo.stat(t,function(n,i){if(n||!or.usePgPass(i,t))return e(void 0);var s=Bo.createReadStream( +t);or.getPassword(r,s,e)})};Sn.exports.warnTo=or.warnTo});var Fo={};le(Fo,{default:()=>Fl});var Fl,ko=re(()=>{"use strict";p();Fl={}});var Uo=P((Xd,Mo)=>{"use strict";p();var kl=(Lr(),j(fs)),vn=(pn(),j(dn));function En(r){if(r.charAt(0)=== +"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=kl.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,54 +756,54 @@ 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=xn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=xn.readFileSync(t.sslkey).toString()), -t.sslrootcert&&(t.ssl.ca=xn.readFileSync(t.sslrootcert).toString()),t.sslmode){case"disable":{t.ssl= +cert=vn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=vn.readFileSync(t.sslkey).toString()), +t.sslrootcert&&(t.ssl.ca=vn.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(Sn,"parse");Fo.exports=Sn;Sn.parse=Sn});var sr=P((ep,Do)=>{"use strict";p();var Fc=(Lo(),j(Bo)),Uo=Rt(),ko=Mo().parse,ee=a(function(r,e,t){return t=== -void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Uo[r]},"val"),Mc=a(function(){switch(w. +!1;break}}return t}a(En,"parse");Mo.exports=En;En.parse=En});var ar=P((rp,No)=>{"use strict";p();var Ml=(ko(),j(Fo)),Oo=Pt(),Do=Uo().parse,te=a(function(r,e,t){return t=== +void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Oo[r]},"val"),Ul=a(function(){switch(w. 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 Uo.ssl},"readSSLConfigFromEnvironment"),ut=a(function(r){ -return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),me=a(function(r,e,t){ -var n=e[t];n!=null&&r.push(t+"="+ut(n))},"add"),En=class En{constructor(e){e=typeof e=="string"?ko(e): -e||{},e.connectionString&&(e=Object.assign({},e,ko(e.connectionString))),this.user=ee("user",e),this. -database=ee("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(ee("p\ -ort",e),10),this.host=ee("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, -writable:!0,value:ee("password",e)}),this.binary=ee("binary",e),this.options=ee("options",e),this.ssl= -typeof e.ssl>"u"?Mc():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="\ +no-verify":return{rejectUnauthorized:!1}}return Oo.ssl},"readSSLConfigFromEnvironment"),ct=a(function(r){ +return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),ye=a(function(r,e,t){ +var n=e[t];n!=null&&r.push(t+"="+ct(n))},"add"),_n=class _n{constructor(e){e=typeof e=="string"?Do(e): +e||{},e.connectionString&&(e=Object.assign({},e,Do(e.connectionString))),this.user=te("user",e),this. +database=te("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(te("p\ +ort",e),10),this.host=te("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, +writable:!0,value:te("password",e)}),this.binary=te("binary",e),this.options=te("options",e),this.ssl= +typeof e.ssl>"u"?Ul():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=ee("client_encoding",e),this.replication=ee("replication", -e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=ee("application_name",e,"\ -PGAPPNAME"),this.fallback_application_name=ee("fallback_application_name",e,!1),this.statement_timeout= -ee("statement_timeout",e,!1),this.lock_timeout=ee("lock_timeout",e,!1),this.idle_in_transaction_session_timeout= -ee("idle_in_transaction_session_timeout",e,!1),this.query_timeout=ee("query_timeout",e,!1),e.connectionTimeoutMillis=== +"key",{enumerable:!1}),this.client_encoding=te("client_encoding",e),this.replication=te("replication", +e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=te("application_name",e,"\ +PGAPPNAME"),this.fallback_application_name=te("fallback_application_name",e,!1),this.statement_timeout= +te("statement_timeout",e,!1),this.lock_timeout=te("lock_timeout",e,!1),this.idle_in_transaction_session_timeout= +te("idle_in_transaction_session_timeout",e,!1),this.query_timeout=te("query_timeout",e,!1),e.connectionTimeoutMillis=== void 0?this.connect_timeout=w.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/ 1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive===!0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis== "number"&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){ -var t=[];me(t,this,"user"),me(t,this,"password"),me(t,this,"port"),me(t,this,"application_name"),me( -t,this,"fallback_application_name"),me(t,this,"connect_timeout"),me(t,this,"options");var n=typeof this. -ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(me(t,n,"sslmode"),me(t,n,"sslca"),me(t,n,"s\ -slkey"),me(t,n,"sslcert"),me(t,n,"sslrootcert"),this.database&&t.push("dbname="+ut(this.database)),this. -replication&&t.push("replication="+ut(this.replication)),this.host&&t.push("host="+ut(this.host)),this. -isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+ut(this.client_encoding)), -Fc.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+ut(s)),e(null,t.join(" ")))})}}; -a(En,"ConnectionParameters");var vn=En;Do.exports=vn});var qo=P((np,No)=>{"use strict";p();var kc=Ct(),Oo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,_n=class _n{constructor(e,t){ +var t=[];ye(t,this,"user"),ye(t,this,"password"),ye(t,this,"port"),ye(t,this,"application_name"),ye( +t,this,"fallback_application_name"),ye(t,this,"connect_timeout"),ye(t,this,"options");var n=typeof this. +ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(ye(t,n,"sslmode"),ye(t,n,"sslca"),ye(t,n,"s\ +slkey"),ye(t,n,"sslcert"),ye(t,n,"sslrootcert"),this.database&&t.push("dbname="+ct(this.database)),this. +replication&&t.push("replication="+ct(this.replication)),this.host&&t.push("host="+ct(this.host)),this. +isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+ct(this.client_encoding)), +Ml.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+ct(s)),e(null,t.join(" ")))})}}; +a(_n,"ConnectionParameters");var An=_n;No.exports=An});var jo=P((sp,Qo)=>{"use strict";p();var Dl=It(),qo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,In=class In{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=Oo.exec(e.text):t=Oo.exec(e.command),t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2], +var t;e.text?t=qo.exec(e.text):t=qo.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:Uc}=Be(),Qo=qo(),jo=Pt(),In=class In extends Uc{constructor(e,t,n){ -super(),e=jo.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]=Dl.getTypeParser(n.dataTypeID,n. +format||"text")}}};a(In,"Result");var Cn=In;Qo.exports=Cn});var Go=P((up,$o)=>{"use strict";p();var{EventEmitter:Ol}=Be(),Wo=jo(),Ho=Bt(),Rn=class Rn extends Ol{constructor(e,t,n){ +super(),e=Ho.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,w.domain&&e.callback&&(this.callback=w.domain.bind(e.callback)),this._result= -new Qo(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError= +new Wo(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 Qo(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ +_results=[this._result]),this._result=new Wo(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:jo.prepareValue})}catch(t){ +portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:Ho.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(In,"Query");var Cn=In;Wo.exports= -Cn});var ri=P(R=>{"use strict";p();Object.defineProperty(R,"__esModule",{value:!0});R.NoticeMessage=R.DataRowMessage= +e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(Rn,"Query");var Tn=Rn;$o.exports= +Tn});var ii=P(R=>{"use strict";p();Object.defineProperty(R,"__esModule",{value:!0});R.NoticeMessage=R.DataRowMessage= R.CommandCompleteMessage=R.ReadyForQueryMessage=R.NotificationResponseMessage=R.BackendKeyDataMessage= R.AuthenticationMD5Password=R.ParameterStatusMessage=R.ParameterDescriptionMessage=R.RowDescriptionMessage= R.Field=R.CopyResponse=R.CopyDataMessage=R.DatabaseError=R.copyDone=R.emptyQuery=R.replicationStart= @@ -831,30 +831,30 @@ R.portalSuspended=R.noData=R.closeComplete=R.bindComplete=R.parseComplete=void 0 parseComplete",length:5};R.bindComplete={name:"bindComplete",length:5};R.closeComplete={name:"closeC\ omplete",length:5};R.noData={name:"noData",length:5};R.portalSuspended={name:"portalSuspended",length:5}; R.replicationStart={name:"replicationStart",length:4};R.emptyQuery={name:"emptyQuery",length:4};R.copyDone= -{name:"copyDone",length:4};var jn=class jn extends Error{constructor(e,t,n){super(e),this.length=t,this. -name=n}};a(jn,"DatabaseError");var Tn=jn;R.DatabaseError=Tn;var Wn=class Wn{constructor(e,t){this.length= -e,this.chunk=t,this.name="copyData"}};a(Wn,"CopyDataMessage");var Rn=Wn;R.CopyDataMessage=Rn;var Hn=class Hn{constructor(e,t,n,i){ -this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Hn,"CopyResponse");var Pn=Hn; -R.CopyResponse=Pn;var $n=class $n{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($n,"Field");var Bn=$n; -R.Field=Bn;var Gn=class Gn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ -n",this.fields=new Array(this.fieldCount)}};a(Gn,"RowDescriptionMessage");var Ln=Gn;R.RowDescriptionMessage= -Ln;var Vn=class Vn{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ -ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(Vn,"ParameterDescriptionMessage");var Fn=Vn; -R.ParameterDescriptionMessage=Fn;var Kn=class Kn{constructor(e,t,n){this.length=e,this.parameterName= -t,this.parameterValue=n,this.name="parameterStatus"}};a(Kn,"ParameterStatusMessage");var Mn=Kn;R.ParameterStatusMessage= -Mn;var zn=class zn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; -a(zn,"AuthenticationMD5Password");var kn=zn;R.AuthenticationMD5Password=kn;var Yn=class Yn{constructor(e,t,n){ -this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Yn,"BackendKeyDataMes\ -sage");var Un=Yn;R.BackendKeyDataMessage=Un;var Jn=class Jn{constructor(e,t,n,i){this.length=e,this. -processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(Jn,"NotificationResponseMessa\ -ge");var Dn=Jn;R.NotificationResponseMessage=Dn;var Zn=class Zn{constructor(e,t){this.length=e,this. -status=t,this.name="readyForQuery"}};a(Zn,"ReadyForQueryMessage");var On=Zn;R.ReadyForQueryMessage=On; -var Xn=class Xn{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(Xn,"Comma\ -ndCompleteMessage");var Nn=Xn;R.CommandCompleteMessage=Nn;var ei=class ei{constructor(e,t){this.length= -e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(ei,"DataRowMessage");var qn=ei;R.DataRowMessage= -qn;var ti=class ti{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(ti,"NoticeMe\ -ssage");var Qn=ti;R.NoticeMessage=Qn});var $o=P(or=>{"use strict";p();Object.defineProperty(or,"__esModule",{value:!0});or.Writer=void 0;var ii=class ii{constructor(e=256){ +{name:"copyDone",length:4};var Hn=class Hn extends Error{constructor(e,t,n){super(e),this.length=t,this. +name=n}};a(Hn,"DatabaseError");var Pn=Hn;R.DatabaseError=Pn;var $n=class $n{constructor(e,t){this.length= +e,this.chunk=t,this.name="copyData"}};a($n,"CopyDataMessage");var Bn=$n;R.CopyDataMessage=Bn;var Gn=class Gn{constructor(e,t,n,i){ +this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Gn,"CopyResponse");var Ln=Gn; +R.CopyResponse=Ln;var Vn=class Vn{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(Vn,"Field");var Fn=Vn; +R.Field=Fn;var Kn=class Kn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ +n",this.fields=new Array(this.fieldCount)}};a(Kn,"RowDescriptionMessage");var kn=Kn;R.RowDescriptionMessage= +kn;var zn=class zn{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ +ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(zn,"ParameterDescriptionMessage");var Mn=zn; +R.ParameterDescriptionMessage=Mn;var Yn=class Yn{constructor(e,t,n){this.length=e,this.parameterName= +t,this.parameterValue=n,this.name="parameterStatus"}};a(Yn,"ParameterStatusMessage");var Un=Yn;R.ParameterStatusMessage= +Un;var Jn=class Jn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; +a(Jn,"AuthenticationMD5Password");var Dn=Jn;R.AuthenticationMD5Password=Dn;var Zn=class Zn{constructor(e,t,n){ +this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Zn,"BackendKeyDataMes\ +sage");var On=Zn;R.BackendKeyDataMessage=On;var Xn=class Xn{constructor(e,t,n,i){this.length=e,this. +processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(Xn,"NotificationResponseMessa\ +ge");var Nn=Xn;R.NotificationResponseMessage=Nn;var ei=class ei{constructor(e,t){this.length=e,this. +status=t,this.name="readyForQuery"}};a(ei,"ReadyForQueryMessage");var qn=ei;R.ReadyForQueryMessage=qn; +var ti=class ti{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(ti,"Comma\ +ndCompleteMessage");var Qn=ti;R.CommandCompleteMessage=Qn;var ri=class ri{constructor(e,t){this.length= +e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(ri,"DataRowMessage");var jn=ri;R.DataRowMessage= +jn;var ni=class ni{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(ni,"NoticeMe\ +ssage");var Wn=ni;R.NoticeMessage=Wn});var Vo=P(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.Writer=void 0;var oi=class oi{constructor(e=256){ this.size=e,this.offset=5,this.headerPosition=0,this.buffer=m.allocUnsafe(e)}ensure(e){if(this.buffer. length-this.offset>1)+e;this.buffer=m.allocUnsafe(i),n.copy( this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this. @@ -866,49 +866,49 @@ 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=m.allocUnsafe(this.size),t}};a(ii,"Writer");var ni=ii;or.Writer=ni});var Vo=P(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.serialize=void 0; -var si=$o(),D=new si.Writer,Dc=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( +headerPosition=0,this.buffer=m.allocUnsafe(this.size),t}};a(oi,"Writer");var si=oi;ur.Writer=si});var zo=P(lr=>{"use strict";p();Object.defineProperty(lr,"__esModule",{value:!0});lr.serialize=void 0; +var ai=Vo(),D=new ai.Writer,Nl=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( n).addCString(r[n]);D.addCString("client_encoding").addCString("UTF8");let e=D.addCString("").flush(), -t=e.length+4;return new si.Writer().addInt32(t).add(e).flush()},"startup"),Oc=a(()=>{let r=m.allocUnsafe( -8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Nc=a(r=>D.addCString(r).flush( -112),"password"),qc=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. -flush(112)},"sendSASLInitialResponseMessage"),Qc=a(function(r){return D.addString(r).flush(112)},"se\ -ndSCRAMClientFinalMessage"),jc=a(r=>D.addCString(r).flush(81),"query"),Go=[],Wc=a(r=>{let e=r.name|| +t=e.length+4;return new ai.Writer().addInt32(t).add(e).flush()},"startup"),ql=a(()=>{let r=m.allocUnsafe( +8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Ql=a(r=>D.addCString(r).flush( +112),"password"),jl=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. +flush(112)},"sendSASLInitialResponseMessage"),Wl=a(function(r){return D.addString(r).flush(112)},"se\ +ndSCRAMClientFinalMessage"),Hl=a(r=>D.addCString(r).flush(81),"query"),Ko=[],$l=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||Go,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< -n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),lt=new si.Writer,Hc=a(function(r,e){for(let t=0;t< +xecuting queries"));let t=r.types||Ko,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< +n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),lt=new ai.Writer,Gl=a(function(r,e){for(let t=0;t< r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),lt.addInt32(-1)):n instanceof m?(D.addInt16( 1),lt.addInt32(n.length),lt.add(n)):(D.addInt16(0),lt.addInt32(m.byteLength(n)),lt.addString(n))}},"\ -writeValues"),$c=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Go,s=i.length; -return D.addCString(e).addCString(t),D.addInt16(s),Hc(i,r.valueMapper),D.addInt16(s),D.add(lt.flush()), -D.addInt16(n?1:0),D.flush(66)},"bind"),Gc=m.from([69,0,0,0,9,0,0,0,0,0]),Vc=a(r=>{if(!r||!r.portal&& -!r.rows)return Gc;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Kc=a( +writeValues"),Vl=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Ko,s=i.length; +return D.addCString(e).addCString(t),D.addInt16(s),Gl(i,r.valueMapper),D.addInt16(s),D.add(lt.flush()), +D.addInt16(n?1:0),D.flush(66)},"bind"),Kl=m.from([69,0,0,0,9,0,0,0,0,0]),zl=a(r=>{if(!r||!r.portal&& +!r.rows)return Kl;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Yl=a( (r,e)=>{let t=m.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"),oi=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. +6),t.writeInt32BE(r,8),t.writeInt32BE(e,12),t},"cancel"),ui=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i},"cstringMessage"), -zc=D.addCString("P").flush(68),Yc=D.addCString("S").flush(68),Jc=a(r=>r.name?oi(68,`${r.type}${r.name|| -""}`):r.type==="P"?zc:Yc,"describe"),Zc=a(r=>{let e=`${r.type}${r.name||""}`;return oi(67,e)},"close"), -Xc=a(r=>D.add(r).flush(100),"copyData"),ef=a(r=>oi(102,r),"copyFail"),ar=a(r=>m.from([r,0,0,0,4]),"c\ -odeOnlyBuffer"),tf=ar(72),rf=ar(83),nf=ar(88),sf=ar(99),of={startup:Dc,password:Nc,requestSsl:Oc,sendSASLInitialResponseMessage:qc, -sendSCRAMClientFinalMessage:Qc,query:jc,parse:Wc,bind:$c,execute:Vc,describe:Jc,close:Zc,flush:a(()=>tf, -"flush"),sync:a(()=>rf,"sync"),end:a(()=>nf,"end"),copyData:Xc,copyDone:a(()=>sf,"copyDone"),copyFail:ef, -cancel:Kc};ur.serialize=of});var Ko=P(lr=>{"use strict";p();Object.defineProperty(lr,"__esModule",{value:!0});lr.BufferReader=void 0; -var af=m.allocUnsafe(0),ui=class ui{constructor(e=0){this.offset=e,this.buffer=af,this.encoding="utf\ +Jl=D.addCString("P").flush(68),Zl=D.addCString("S").flush(68),Xl=a(r=>r.name?ui(68,`${r.type}${r.name|| +""}`):r.type==="P"?Jl:Zl,"describe"),ef=a(r=>{let e=`${r.type}${r.name||""}`;return ui(67,e)},"close"), +tf=a(r=>D.add(r).flush(100),"copyData"),rf=a(r=>ui(102,r),"copyFail"),cr=a(r=>m.from([r,0,0,0,4]),"c\ +odeOnlyBuffer"),nf=cr(72),sf=cr(83),of=cr(88),af=cr(99),uf={startup:Nl,password:Ql,requestSsl:ql,sendSASLInitialResponseMessage:jl, +sendSCRAMClientFinalMessage:Wl,query:Hl,parse:$l,bind:Vl,execute:zl,describe:Xl,close:ef,flush:a(()=>nf, +"flush"),sync:a(()=>sf,"sync"),end:a(()=>of,"end"),copyData:tf,copyDone:a(()=>af,"copyDone"),copyFail:rf, +cancel:Yl};lr.serialize=uf});var Yo=P(fr=>{"use strict";p();Object.defineProperty(fr,"__esModule",{value:!0});fr.BufferReader=void 0; +var cf=m.allocUnsafe(0),li=class li{constructor(e=0){this.offset=e,this.buffer=cf,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(ui,"BufferReader");var ai=ui;lr.BufferReader=ai});var Jo=P(cr=>{"use strict";p();Object.defineProperty(cr,"__esModule",{value:!0});cr.Parser=void 0;var O=ri(), -uf=Ko(),li=1,lf=4,zo=li+lf,Yo=m.allocUnsafe(0),fi=class fi{constructor(e){if(this.buffer=Yo,this.bufferLength= -0,this.bufferOffset=0,this.reader=new uf.BufferReader,e?.mode==="binary")throw new Error("Binary mod\ +offset+=e,t}};a(li,"BufferReader");var ci=li;fr.BufferReader=ci});var Xo=P(hr=>{"use strict";p();Object.defineProperty(hr,"__esModule",{value:!0});hr.Parser=void 0;var O=ii(), +lf=Yo(),fi=1,ff=4,Jo=fi+ff,Zo=m.allocUnsafe(0),di=class di{constructor(e){if(this.buffer=Zo,this.bufferLength= +0,this.bufferOffset=0,this.reader=new lf.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+zo<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( -i+li),u=li+o;if(u+i<=n){let l=this.handlePacket(i+zo,s,o,this.buffer);t(l),i+=u}else break}i===n?(this. -buffer=Yo,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=n-i,this.bufferOffset=i)}mergeBuffer(e){ +this.bufferLength,i=this.bufferOffset;for(;i+Jo<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( +i+fi),u=fi+o;if(u+i<=n){let c=this.handlePacket(i+Jo,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. +buffer=Zo,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. buffer.byteLength*2;for(;t>=s;)s*=2;i=m.allocUnsafe(s)}this.buffer.copy(i,0,this.bufferOffset,this.bufferOffset+ @@ -929,7 +929,7 @@ this.reader.setBuffer(e,n);let i=this.reader.cstring();return new O.CommandCompl let i=n.slice(e,e+(t-4));return new O.CopyDataMessage(t,i)}parseCopyInMessage(e,t,n){return this.parseCopyMessage( e,t,n,"copyInResponse")}parseCopyOutMessage(e,t,n){return this.parseCopyMessage(e,t,n,"copyOutRespon\ se")}parseCopyMessage(e,t,n,i){this.reader.setBuffer(e,n);let s=this.reader.byte()!==0,o=this.reader. -int16(),u=new O.CopyResponse(t,i,s,o);for(let l=0;l{"use strict";p();Object.defineProperty(ke,"__esModule",{value:!0});ke.DatabaseError=ke. -serialize=ke.parse=void 0;var cf=ri();Object.defineProperty(ke,"DatabaseError",{enumerable:!0,get:a( -function(){return cf.DatabaseError},"get")});var ff=Vo();Object.defineProperty(ke,"serialize",{enumerable:!0, -get:a(function(){return ff.serialize},"get")});var hf=Jo();function df(r,e){let t=new hf.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(df,"parse");ke.parse=df});var Zo={};fe(Zo,{connect:()=>pf});function pf({socket:r,servername:e}){return r.startTls(e),r}var Xo=te( -()=>{"use strict";p();a(pf,"connect")});var yi=P((Rp,ra)=>{"use strict";p();var ea=(Je(),j(us)),yf=Be().EventEmitter,{parse:mf,serialize:K}=hi(), -ta=K.flush(),wf=K.sync(),gf=K.end(),pi=class pi extends yf{constructor(e){super(),e=e||{},this.stream= -e.stream||new ea.Socket,this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis, +c=i==="notice"?new O.NoticeMessage(t,u):new O.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(di,"Parser");var hi=di;hr.Parser=hi});var pi=P(Me=>{"use strict";p();Object.defineProperty(Me,"__esModule",{value:!0});Me.DatabaseError=Me. +serialize=Me.parse=void 0;var hf=ii();Object.defineProperty(Me,"DatabaseError",{enumerable:!0,get:a( +function(){return hf.DatabaseError},"get")});var df=zo();Object.defineProperty(Me,"serialize",{enumerable:!0, +get:a(function(){return df.serialize},"get")});var pf=Xo();function yf(r,e){let t=new pf.Parser;return r. +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(yf,"parse");Me.parse=yf});var ea={};le(ea,{connect:()=>mf});function mf({socket:r,servername:e}){return r.startTls(e),r}var ta=re( +()=>{"use strict";p();a(mf,"connect")});var wi=P((Bp,ia)=>{"use strict";p();var ra=(Ze(),j(ls)),wf=Be().EventEmitter,{parse:gf,serialize:K}=pi(), +na=K.flush(),bf=K.sync(),xf=K.end(),mi=class mi extends wf{constructor(e){super(),e=e||{},this.stream= +e.stream||new ra.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=(Xo(),j(Zo));let l={socket:n.stream};n.ssl!==!0&&(Object.assign(l,n.ssl),"key"in n.ssl&&(l.key= -n.ssl.key)),ea.isIP(t)===0&&(l.servername=t);try{n.stream=u.connect(l)}catch(c){return n.emit("error", -c)}n.attachListeners(n.stream),n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){e.on( -"end",()=>{this.emit("end")}),mf(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& +var u=(ta(),j(ea));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= +n.ssl.key)),ra.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")}),gf(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(K.requestSsl())}startup(e){this. stream.write(K.startup(e))}cancel(e,t){this._send(K.cancel(e,t))}password(e){this._send(K.password(e))}sendSASLInitialResponseMessage(e,t){ this._send(K.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(K.sendSCRAMClientFinalMessage( e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(K.query(e))}parse(e){ this._send(K.parse(e))}bind(e){this._send(K.bind(e))}execute(e){this._send(K.execute(e))}flush(){this. -stream.writable&&this.stream.write(ta)}sync(){this._ending=!0,this._send(ta),this._send(wf)}ref(){this. +stream.writable&&this.stream.write(na)}sync(){this._ending=!0,this._send(na),this._send(bf)}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(gf,()=>{this.stream.end()})}close(e){this._send(K. +this.stream.end();return}return this.stream.write(xf,()=>{this.stream.end()})}close(e){this._send(K. close(e))}describe(e){this._send(K.describe(e))}sendCopyFromChunk(e){this._send(K.copyData(e))}endCopyFrom(){ -this._send(K.copyDone())}sendCopyFail(e){this._send(K.copyFail(e))}};a(pi,"Connection");var di=pi;ra. -exports=di});var sa=P((Fp,ia)=>{"use strict";p();var bf=Be().EventEmitter,Lp=(Lt(),j(Bt)),xf=Pt(),mi=bo(),Sf=Po(), -vf=Xt(),Ef=sr(),na=Ho(),Af=Rt(),_f=yi(),wi=class wi extends bf{constructor(e){super(),this.connectionParameters= -new Ef(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database, +this._send(K.copyDone())}sendCopyFail(e){this._send(K.copyFail(e))}};a(mi,"Connection");var yi=mi;ia. +exports=yi});var aa=P((Mp,oa)=>{"use strict";p();var Sf=Be().EventEmitter,kp=(Ft(),j(Lt)),vf=Bt(),gi=So(),Ef=Lo(), +Af=er(),_f=ar(),sa=Go(),Cf=Pt(),If=wi(),bi=class bi extends Sf{constructor(e){super(),this.connectionParameters= +new _f(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||S.Promise, -this._types=new vf(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= -!1,this._queryable=!0,this.connection=t.connection||new _f({stream:t.stream,ssl:this.connectionParameters. +this._types=new Af(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= +!1,this._queryable=!0,this.connection=t.connection||new If({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||Af.binary,this. +connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t.binary||Cf.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=>{w.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():Sf(this.connectionParameters, +password=this.password=null;e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():Ef(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=xf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ -this._checkPgPass(()=>{this.saslSession=mi.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( -this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){mi.continueSession( +()=>{let t=vf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ +this._checkPgPass(()=>{this.saslSession=gi.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( +this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){gi.continueSession( this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession. -response)}_handleAuthSASLFinal(e){mi.finalizeSession(this.saslSession,e.data),this.saslSession=null}_handleBackendKeyData(e){ +response)}_handleAuthSASLFinal(e){gi.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; @@ -1063,13 +1063,13 @@ s==="'"?n+=s+s:s==="\\"?(n+=s+s,t=!0):n+=s}return n+="'",t===!0&&(n=" E"+n),n}_p readyForQuery===!0)if(this.activeQuery=this.queryQueue.shift(),this.activeQuery){this.readyForQuery= !1,this.hasExecuted=!0;let e=this.activeQuery.submit(this.connection);e&&w.nextTick(()=>{this.activeQuery. handleError(e,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&& -(this.activeQuery=null,this.emit("drain"))}query(e,t,n){var i,s,o,u,l;if(e==null)throw new TypeError( +(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 na(e,t,n),i.callback||(s=new this._Promise((c,f)=>{i.callback= -(y,g)=>y?f(y):c(g)}))),o&&(l=i.callback,u=setTimeout(()=>{var c=new Error("Query read timeout");w.nextTick( -()=>{i.handleError(c,this.connection)}),l(c),i.callback=()=>{};var f=this.queryQueue.indexOf(i);f>-1&& -this.queryQueue.splice(f,1),this._pulseQueryQueue()},o),i.callback=(c,f)=>{clearTimeout(u),l(c,f)}), +connectionParameters.query_timeout,i=new sa(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");w.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)}), this.binary&&!i.binary&&(i.binary=!0),i._result&&!i._result._types&&(i._result._types=this._types),this. _queryable?this._ending?(w.nextTick(()=>{i.handleError(new Error("Client was closed and is not query\ able"),this.connection)}),s):(this.queryQueue.push(i),this._pulseQueryQueue(),s):(w.nextTick(()=>{i. @@ -1077,16 +1077,16 @@ 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(wi,"Client");var fr=wi;fr.Query=na;ia.exports=fr});var la=P((Up,ua)=>{"use strict";p();var Cf=Be().EventEmitter,oa=a(function(){},"NOOP"),aa=a((r,e)=>{ -let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),xi=class xi{constructor(e,t,n){ -this.client=e,this.idleListener=t,this.timeoutId=n}};a(xi,"IdleItem");var gi=xi,Si=class Si{constructor(e){ -this.callback=e}};a(Si,"PendingItem");var ct=Si;function If(){throw new Error("Release called on cli\ -ent which has already been released to the pool.")}a(If,"throwOnDoubleRelease");function hr(r,e){if(e) +_Promise(t=>{this.connection.once("end",t)})}};a(bi,"Client");var dr=bi;dr.Query=sa;oa.exports=dr});var fa=P((Op,la)=>{"use strict";p();var Tf=Be().EventEmitter,ua=a(function(){},"NOOP"),ca=a((r,e)=>{ +let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),vi=class vi{constructor(e,t,n){ +this.client=e,this.idleListener=t,this.timeoutId=n}};a(vi,"IdleItem");var xi=vi,Ei=class Ei{constructor(e){ +this.callback=e}};a(Ei,"PendingItem");var ft=Ei;function Rf(){throw new Error("Release called on cli\ +ent which has already been released to the pool.")}a(Rf,"throwOnDoubleRelease");function pr(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(hr,"promisify"); -function Tf(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(pr,"promisify"); +function Pf(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(Tf,"makeIdleListener");var vi=class vi extends Cf{constructor(e,t){super(),this.options= +dleListener")}a(Pf,"makeIdleListener");var Ai=class Ai extends Tf{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. @@ -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=aa( +if(!this._isFull())return this.newClient(e);throw new Error("unexpected condition")}_remove(e){let t=ca( 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=hr(this.Promise,e),n=t. +l after calling end on the pool");return e?e(i):this.Promise.reject(i)}let t=pr(this.Promise,e),n=t. result;if(this._isFull()||this._idle.length){if(this._idle.length&&w.nextTick(()=>this._pulseQueue()), -!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new ct(t.callback)),n;let i=a((u,l,c)=>{ -clearTimeout(o),t.callback(u,l,c)},"queueCallback"),s=new ct(i),o=setTimeout(()=>{aa(this._pendingQueue, +!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new ft(t.callback)),n;let i=a((u,c,l)=>{ +clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new ft(i),o=setTimeout(()=>{ca(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 ct(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( -t);let n=Tf(this,t);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&& +newClient(new ft(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( +t);let n=Pf(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,oa);else{if(this.log("new client connected"),this.options. +_pulseQueue(),e.timedOut||e.callback(o,void 0,ua);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(c=>c.client===t)!==-1&&this._acquireClient(t,new ct((c,f,y)=>y()), +_expired.add(t),this._idle.findIndex(l=>l.client===t)!==-1&&this._acquireClient(t,new ft((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,oa);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ -let n=!1;return i=>{n&&If(),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,ua);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ +let n=!1;return i=>{n&&Rf(),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 gi( -e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=hr(this.Promise,e);return v(function(){ +this.options.allowExitOnIdle&&s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new xi( +e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=pr(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=hr(this.Promise,n);return n=i.callback,this. -connect((s,o)=>{if(s)return n(s);let u=!1,l=a(c=>{u||(u=!0,o.release(c),n(c))},"onError");o.once("er\ -ror",l),this.log("dispatching query");try{o.query(e,t,(c,f)=>{if(this.log("query dispatched"),o.removeListener( -"error",l),!u)return u=!0,o.release(c),c?n(c):n(void 0,f)})}catch(c){return o.release(c),n(c)}}),i.result}end(e){ +d"))}),s.result}typeof t=="function"&&(n=t,t=void 0);let i=pr(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=hr(this.Promise,e);return this._endCallback=t.callback,this. +this.Promise.reject(n)}this.ending=!0;let t=pr(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(vi,"Pool");var bi=vi;ua.exports=bi});var ca={};fe(ca,{default:()=>Rf});var Rf,fa=te(()=>{"use strict";p();Rf={}});var ha=P((qp,Pf)=>{Pf.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javas\ +return this._clients.length}};a(Ai,"Pool");var Si=Ai;la.exports=Si});var ha={};le(ha,{default:()=>Bf});var Bf,da=re(()=>{"use strict";p();Bf={}});var pa=P((jp,Lf)=>{Lf.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 ya=P((Qp,pa)=>{"use strict";p();var da=Be().EventEmitter,Bf=(Lt(),j(Bt)),Ei=Pt(),ft=pa.exports=function(r,e,t){ -da.call(this),r=Ei.normalizeQueryConfig(r,e,t),this.text=r.text,this.values=r.values,this.name=r.name, +a178655"}});var wa=P((Wp,ma)=>{"use strict";p();var ya=Be().EventEmitter,Ff=(Ft(),j(Lt)),_i=Bt(),ht=ma.exports=function(r,e,t){ +ya.call(this),r=_i.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))};Bf.inherits(ft,da); -var Lf={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ +this.on("newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};Ff.inherits(ht,ya); +var kf={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"\ -file",sourceLine:"line",sourceFunction:"routine"};ft.prototype.handleError=function(r){var e=this.native. -pq.resultErrorFields();if(e)for(var t in e){var n=Lf[t]||t;r[n]=e[t]}this.callback?this.callback(r): -this.emit("error",r),this.state="error"};ft.prototype.then=function(r,e){return this._getPromise().then( -r,e)};ft.prototype.catch=function(r){return this._getPromise().catch(r)};ft.prototype._getPromise=function(){ +file",sourceLine:"line",sourceFunction:"routine"};ht.prototype.handleError=function(r){var e=this.native. +pq.resultErrorFields();if(e)for(var t in e){var n=kf[t]||t;r[n]=e[t]}this.callback?this.callback(r): +this.emit("error",r),this.state="error"};ht.prototype.then=function(r,e){return this._getPromise().then( +r,e)};ht.prototype.catch=function(r){return this._getPromise().catch(r)};ht.prototype._getPromise=function(){ return this._promise?this._promise:(this._promise=new Promise(function(r,e){this._once("end",r),this. -_once("error",e)}.bind(this)),this._promise)};ft.prototype.submit=function(r){this.state="running";var e=this; +_once("error",e)}.bind(this)),this._promise)};ht.prototype.submit=function(r){this.state="running";var e=this; this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a(function(s,o,u){if(r.native.arrayMode= !1,v(function(){e.emit("_done")}),s)return e.handleError(s);e._emitRowEvents&&(u.length>1?o.forEach( -(l,c)=>{l.forEach(f=>{e.emit("row",f,u[c])})}):o.forEach(function(l){e.emit("row",l,u)})),e.state="e\ +(c,l)=>{c.forEach(f=>{e.emit("row",f,u[l])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="e\ nd",e.emit("end",u),e.callback&&e.callback(null,u)},"after");if(w.domain&&(t=w.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(Ei.prepareValue);if(r. +se conflicts and silent errors executing queries"));var n=(this.values||[]).map(_i.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(Ei. -prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var ba=P(($p,ga)=>{"use strict";p();var Ff=(fa(),j(ca)),Mf=Xt(),Hp=ha(),ma=Be().EventEmitter,kf=(Lt(),j(Bt)), -Uf=sr(),wa=ya(),se=ga.exports=function(r){ma.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. -_types=new Mf(r.types),this.native=new Ff({types:this._types}),this._queryQueue=[],this._ending=!1,this. -_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Uf(r);this. +this.values)){let s=new Error("Query values must be an array");return t(s)}var i=this.values.map(_i. +prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var Sa=P((Vp,xa)=>{"use strict";p();var Mf=(da(),j(ha)),Uf=er(),Gp=pa(),ga=Be().EventEmitter,Df=(Ft(),j(Lt)), +Of=ar(),ba=wa(),oe=xa.exports=function(r){ga.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. +_types=new Uf(r.types),this.native=new Mf({types:this._types}),this._queryQueue=[],this._ending=!1,this. +_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Of(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={}};se.Query= -wa;kf.inherits(se,ma);se.prototype._errorAllQueries=function(r){let e=a(t=>{w.nextTick(()=>{t.native= +password}),this.database=e.database,this.host=e.host,this.port=e.port,this.namedQueries={}};oe.Query= +ba;Df.inherits(oe,ga);oe.prototype._errorAllQueries=function(r){let e=a(t=>{w.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};se.prototype._connect=function(r){var e=this; +null),this._queryQueue.forEach(e),this._queryQueue.length=0};oe.prototype._connect=function(r){var e=this; if(this._connecting){w.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()})})};se.prototype.connect=function(r){if(r){this._connect(r);return}return new this. -_Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};se.prototype.query=function(r,e,t){var n,i,s,o,u; +_pulseQueryQueue(!0),r()})})};oe.prototype.connect=function(r){if(r){this._connect(r);return}return new this. +_Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};oe.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=="f\ unction")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 wa(r,e,t),!n.callback){let l,c;i=new this. -_Promise((f,y)=>{l=f,c=y}),n.callback=(f,y)=>f?c(f):l(y)}return s&&(u=n.callback,o=setTimeout(()=>{var l=new Error( -"Query read timeout");w.nextTick(()=>{n.handleError(l,this.connection)}),u(l),n.callback=()=>{};var c=this. -_queryQueue.indexOf(n);c>-1&&this._queryQueue.splice(c,1),this._pulseQueryQueue()},s),n.callback=(l,c)=>{ -clearTimeout(o),u(l,c)}),this._queryable?this._ending?(n.native=this.native,w.nextTick(()=>{n.handleError( +e);else if(s=this.connectionParameters.query_timeout,n=new ba(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");w.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,w.nextTick(()=>{n.handleError( new Error("Client was closed and is not queryable"))}),i):(this._queryQueue.push(n),this._pulseQueryQueue(), i):(n.native=this.native,w.nextTick(()=>{n.handleError(new Error("Client has encountered a connectio\ -n error and is not queryable"))}),i)};se.prototype.end=function(r){var e=this;this._ending=!0,this._connected|| +n error and is not queryable"))}),i)};oe.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")), -w.nextTick(()=>{e.emit("end"),r&&r()})}),t};se.prototype._hasActiveQuery=function(){return this._activeQuery&& -this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};se.prototype._pulseQueryQueue=function(r){ +w.nextTick(()=>{e.emit("end"),r&&r()})}),t};oe.prototype._hasActiveQuery=function(){return this._activeQuery&& +this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};oe.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()})}}; -se.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. -indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};se.prototype.ref=function(){}; -se.prototype.unref=function(){};se.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( -r,e,t)};se.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var Ai=P((Kp,xa)=>{"use strict";p();xa.exports=ba()});var Mt=P((Yp,kt)=>{"use strict";p();var Df=sa(),Of=Rt(),Nf=yi(),qf=la(),{DatabaseError:Qf}=hi(),jf=a( -r=>{var e;return e=class extends qf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),_i=a( -function(r){this.defaults=Of,this.Client=r,this.Query=this.Client.Query,this.Pool=jf(this.Client),this. -_pools=[],this.Connection=Nf,this.types=Ct(),this.DatabaseError=Qf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< -"u"?kt.exports=new _i(Ai()):(kt.exports=new _i(Df),Object.defineProperty(kt.exports,"native",{configurable:!0, -enumerable:!1,get(){var r=null;try{r=new _i(Ai())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. -defineProperty(kt.exports,"native",{value:r}),r}}))});var $f={};fe($f,{Client:()=>ht,DatabaseError:()=>ve.DatabaseError,NeonDbError:()=>ue,NeonQueryPromise:()=>Le, -Pool:()=>dr,SqlTemplate:()=>rt,UnsafeRawSql:()=>nt,_bundleExt:()=>Hf,defaults:()=>ve.defaults,escapeIdentifier:()=>ve.escapeIdentifier, -escapeLiteral:()=>ve.escapeLiteral,neon:()=>on,neonConfig:()=>be,types:()=>ve.types,warnIfBrowser:()=>xt}); -module.exports=j($f);p();p();Je();Pr();p();var wu=Object.defineProperty,gu=Object.defineProperties,bu=Object.getOwnPropertyDescriptors,cs=Object. -getOwnPropertySymbols,xu=Object.prototype.hasOwnProperty,Su=Object.prototype.propertyIsEnumerable,fs=a( -(r,e,t)=>e in r?wu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), -vu=a((r,e)=>{for(var t in e||(e={}))xu.call(e,t)&&fs(r,t,e[t]);if(cs)for(var t of cs(e))Su.call(e,t)&& -fs(r,t,e[t]);return r},"__spreadValues"),Eu=a((r,e)=>gu(r,bu(e)),"__spreadProps"),Au=1008e3,hs=new Uint8Array( -new Uint16Array([258]).buffer)[0]===2,_u=new TextDecoder,Br=new TextEncoder,Qt=Br.encode("0123456789\ -abcdef"),jt=Br.encode("0123456789ABCDEF"),Cu=Br.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ -stuvwxyz0123456789+/");var ds=Cu.slice();ds[62]=45;ds[63]=95;var pt,Wt;function Iu(r,{alphabet:e,scratchArr:t}={}){if(!pt)if(pt= -new Uint16Array(256),Wt=new Uint16Array(256),hs)for(let C=0;C<256;C++)pt[C]=Qt[C&15]<<8|Qt[C>>>4],Wt[C]= -jt[C&15]<<8|jt[C>>>4];else for(let C=0;C<256;C++)pt[C]=Qt[C&15]|Qt[C>>>4]<<8,Wt[C]=jt[C&15]|jt[C>>>4]<< +oe.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. +indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};oe.prototype.ref=function(){}; +oe.prototype.unref=function(){};oe.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( +r,e,t)};oe.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var Ci=P((Yp,va)=>{"use strict";p();va.exports=Sa()});var Mt=P((Zp,Ut)=>{"use strict";p();var Nf=aa(),qf=Pt(),Qf=wi(),jf=fa(),{DatabaseError:Wf}=pi(),Hf=a( +r=>{var e;return e=class extends jf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),Ii=a( +function(r){this.defaults=qf,this.Client=r,this.Query=this.Client.Query,this.Pool=Hf(this.Client),this. +_pools=[],this.Connection=Qf,this.types=It(),this.DatabaseError=Wf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< +"u"?Ut.exports=new Ii(Ci()):(Ut.exports=new Ii(Nf),Object.defineProperty(Ut.exports,"native",{configurable:!0, +enumerable:!1,get(){var r=null;try{r=new Ii(Ci())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. +defineProperty(Ut.exports,"native",{value:r}),r}}))});var Vf={};le(Vf,{Client:()=>dt,DatabaseError:()=>Se.DatabaseError,NeonDbError:()=>ee,NeonQueryPromise:()=>Le, +Pool:()=>yr,SqlTemplate:()=>nt,UnsafeRawSql:()=>it,_bundleExt:()=>Gf,defaults:()=>Se.defaults,escapeIdentifier:()=>Se.escapeIdentifier, +escapeLiteral:()=>Se.escapeLiteral,neon:()=>un,neonConfig:()=>ge,types:()=>Se.types,warnIfBrowser:()=>St}); +module.exports=j(Vf);p();p();Ze();Lr();p();var bu=Object.defineProperty,xu=Object.defineProperties,Su=Object.getOwnPropertyDescriptors,hs=Object. +getOwnPropertySymbols,vu=Object.prototype.hasOwnProperty,Eu=Object.prototype.propertyIsEnumerable,ds=a( +(r,e,t)=>e in r?bu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), +Au=a((r,e)=>{for(var t in e||(e={}))vu.call(e,t)&&ds(r,t,e[t]);if(hs)for(var t of hs(e))Eu.call(e,t)&& +ds(r,t,e[t]);return r},"__spreadValues"),_u=a((r,e)=>xu(r,Su(e)),"__spreadProps"),Cu=1008e3,ps=new Uint8Array( +new Uint16Array([258]).buffer)[0]===2,Iu=new TextDecoder,Fr=new TextEncoder,jt=Fr.encode("0123456789\ +abcdef"),Wt=Fr.encode("0123456789ABCDEF"),Tu=Fr.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ +stuvwxyz0123456789+/");var ys=Tu.slice();ys[62]=45;ys[63]=95;var yt,Ht;function Ru(r,{alphabet:e,scratchArr:t}={}){if(!yt)if(yt= +new Uint16Array(256),Ht=new Uint16Array(256),ps)for(let C=0;C<256;C++)yt[C]=jt[C&15]<<8|jt[C>>>4],Ht[C]= +Wt[C&15]<<8|Wt[C>>>4];else for(let C=0;C<256;C++)yt[C]=jt[C&15]|jt[C>>>4]<<8,Ht[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),l=new Uint32Array(o.buffer,o.byteOffset,i),c=e==="upper"?Wt:pt,f=0,y=0,g;if(hs) -for(;f>>8&255]<<16|c[g&255],l[y++]=c[g>>>24]<<16|c[g>>>16&255];else for(;f>>24]<<16|c[g>>>16&255],l[y++]=c[g>>>8&255]<<16|c[g&255];for(f<<=2;f>>1,s=Math. -ceil(n/i),o=new Uint16Array(s>1?i:n);for(let u=0;u>>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;ut[pe(this. +n,i]of Object.entries(this._keyMap))this._mapKey.set(i,n)}let t={};return e.forEach((n,i)=>t[de(this. _mapKey.has(i)?this._mapKey.get(i):i)]=n),t}mapDecode(e,t){let n=this.decode(e);if(this._keyMap)switch(n. -constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return _s( -()=>(qr(),this?this.decode(e,t):wt.prototype.decode.call(ws,e,t)));He=t>-1?t:e.length,h=0,Mr=0,gt=0, -Gt=null,Fr=xs,W=null,x=e;try{X=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ +constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return Is( +()=>(jr(),this?this.decode(e,t):gt.prototype.decode.call(bs,e,t)));He=t>-1?t:e.length,h=0,Ur=0,bt=0, +Vt=null,Mr=vs,W=null,x=e;try{X=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ throw x=null,e instanceof Uint8Array?n:new Error("Source must be a Uint8Array or Buffer but was a "+ -(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof wt){if(B=this,ne=this.sharedValues&& +(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof gt){if(B=this,ie=this.sharedValues&& (this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this. -structures)return N=this.structures,Ht();(!N||N.length>0)&&(N=[])}else B=ws,(!N||N.length>0)&&(N=[]), -ne=null;return Ht()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;bt=!0;let o=this?this.decode(e, -s):jr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=W.postBundlePosition){let e=new Error("Unexpected bundle pos\ -ition");throw e.incomplete=!0,e}h=W.postBundlePosition,W=null}if(h==He)N=null,x=null,de&&(de=null);else if(h> -He){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!bt)throw new Error( -"Data read, but end of buffer not reached");return r}catch(r){throw qr(),(r instanceof RangeError||r. -message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a(Ht,"checkedRead");function L(){ -let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return ku();r=X. -getUint16(h),h+=2;break;case 26:if(e==7){let t=X.getFloat32(h);if(B.useFloat32>2){let n=Cs[(x[h]&127)<< +structures)return N=this.structures,$t();(!N||N.length>0)&&(N=[])}else B=bs,(!N||N.length>0)&&(N=[]), +ie=null;return $t()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;xt=!0;let o=this?this.decode(e, +s):Hr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=W.postBundlePosition){let e=new Error("Unexpected bundle pos\ +ition");throw e.incomplete=!0,e}h=W.postBundlePosition,W=null}if(h==He)N=null,x=null,he&&(he=null);else if(h> +He){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!xt)throw new Error( +"Data read, but end of buffer not reached");return r}catch(r){throw jr(),(r instanceof RangeError||r. +message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a($t,"checkedRead");function L(){ +let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return Du();r=X. +getUint16(h),h+=2;break;case 26:if(e==7){let t=X.getFloat32(h);if(B.useFloat32>2){let n=Ts[(x[h]&127)<< 1|x[h+1]>>7];return h+=4,(n*t+(t>0?.5:-.5)>>0)/n}return h+=4,t}if(r=X.getUint32(h),h+=4,e===1)return-1- r;break;case 27:if(e==7){let t=X.getFloat64(h);return h+=8,t}if(e>1){if(X.getUint32(h)>0)throw new Error( "JavaScript does not support arrays, maps, or strings with length over 4294967295");r=X.getUint32(h+ 4)}else B.int64AsNumber?(r=X.getUint32(h)*4294967296,r+=X.getUint32(h+4)):r=X.getBigUint64(h);h+=8;break;case 31: switch(e){case 2:case 3:throw new Error("Indefinite length not supported for byte or text strings");case 4: -let t=[],n,i=0;for(;(n=L())!=Ze;){if(i>=yt)throw new Error(`Array length exceeds ${yt}`);t[i++]=n}return e== +let t=[],n,i=0;for(;(n=L())!=Xe;){if(i>=mt)throw new Error(`Array length exceeds ${mt}`);t[i++]=n}return e== 4?t:e==3?t.join(""):m.concat(t);case 5:let s;if(B.mapsAsObjects){let o={},u=0;if(B.keyMap)for(;(s=L())!= -Ze;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[pe(B.decodeKey(s))]=L()}else for(;(s= -L())!=Ze;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[pe(s)]=L()}return o}else{mt&& -(B.mapsAsObjects=!0,mt=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s=L())!=Ze;){if(u++>=_e)throw new Error( -`Map size exceeds ${_e}`);o.set(B.decodeKey(s),L())}}else{let u=0;for(;(s=L())!=Ze;){if(u++>=_e)throw new Error( -`Map size exceeds ${_e}`);o.set(s,L())}}return o}case 7:return Ze;default:throw new Error("Invalid m\ +Xe;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[de(B.decodeKey(s))]=L()}else for(;(s= +L())!=Xe;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[de(s)]=L()}return o}else{wt&& +(B.mapsAsObjects=!0,wt=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s=L())!=Xe;){if(u++>=_e)throw new Error( +`Map size exceeds ${_e}`);o.set(B.decodeKey(s),L())}}else{let u=0;for(;(s=L())!=Xe;){if(u++>=_e)throw new Error( +`Map size exceeds ${_e}`);o.set(s,L())}}return o}case 7:return Xe;default:throw new Error("Invalid m\ ajor type for indefinite length "+e)}default:throw new Error("Unknown token "+r)}switch(e){case 0:return r;case 1: -return~r;case 2:return Mu(r);case 3:if(gt>=h)return Gt.slice(h-Vt,(h+=r)-Vt);if(gt==0&&He<140&&r<32){ -let i=r<16?vs(r):Fu(r);if(i!=null)return i}return Lu(r);case 4:if(r>=yt)throw new Error(`Array lengt\ -h exceeds ${yt}`);let t=new Array(r);for(let i=0;i=_e)throw new Error( -`Map size exceeds ${yt}`);if(B.mapsAsObjects){let i={};if(B.keyMap)for(let s=0;s=h)return Vt.slice(h-Kt,(h+=r)-Kt);if(bt==0&&He<140&&r<32){ +let i=r<16?As(r):Mu(r);if(i!=null)return i}return ku(r);case 4:if(r>=mt)throw new Error(`Array lengt\ +h exceeds ${mt}`);let t=new Array(r);for(let i=0;i=_e)throw new Error( +`Map size exceeds ${mt}`);if(B.mapsAsObjects){let i={};if(B.keyMap)for(let s=0;s=ys){let i=N[r&8191];if(i)return i.read||(i.read=Dr(i)),i.read();if(r<65536){if(r== -Bu){let s=et(),o=L(),u=L();Nr(o,u);let l={};if(B.keyMap)for(let c=2;c=ws){let i=N[r&8191];if(i)return i.read||(i.read=Nr(i)),i.read();if(r<65536){if(r== +Fu){let s=tt(),o=L(),u=L();Qr(o,u);let c={};if(B.keyMap)for(let l=2;l23)switch(t){case 24:t=x[h++];break;case 25:t=X.getUint16(h),h+=2;break;case 26:t=X.getUint32( h),h+=4;break;default:throw new Error("Expected array header, but got "+x[h-1])}let n=this.compiledReader; -for(;n;){if(n.propertyCount===t)return n(L);n=n.next}if(this.slowReads++>=Ss){let s=this.length==t?this: -this.slice(0,t);return n=B.keyMap?new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>gs.test( -o)?pe(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>gs. -test(o)?pe(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"),this.compiledReader&&(n.next=this. +for(;n;){if(n.propertyCount===t)return n(L);n=n.next}if(this.slowReads++>=Es){let s=this.length==t?this: +this.slice(0,t);return n=B.keyMap?new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>xs.test( +o)?de(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>xs. +test(o)?de(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"),this.compiledReader&&(n.next=this. compiledReader),n.propertyCount=t,this.compiledReader=n,n(L)}let i={};if(B.keyMap)for(let s=0;s64&&Lr)return Lr.decode(x.subarray(h,h+=r));let t=h+ +if(r==null)return r+"";throw new Error("Invalid property name type "+typeof r)}a(de,"safeKey");var ku=qr;function qr(r){let e;if(r<16&&(e=As(r)))return e;if(r>64&&kr)return kr.decode(x.subarray(h,h+=r));let t=h+ r,n=[];for(e="";h=t||(x[h]& 192)!==128)n.push(65533);else{let s=x[h++]&63;n.push((i&31)<<6|s)}else if((i&240)===224){let s=h=t||(s&192)!==128||i===224&&s<160||i===237&&s>=160)n.push(65533);else if(h++,h>=t||(x[h]&192)!== 128)n.push(65533);else{let o=x[h++]&63;n.push((i&31)<<12|(s&63)<<6|o)}}else if((i&248)===240){let s=h< t?x[h]:0;if(i>244||h>=t||(s&192)!==128||i===240&&s<144||i===244&&s>=144)n.push(65533);else if(h++,h>= t||(x[h]&192)!==128)n.push(65533);else{let o=x[h++]&63;if(h>=t||(x[h]&192)!==128)n.push(65533);else{ -let u=x[h++]&63,l=(i&7)<<18|(s&63)<<12|o<<6|u;l-=65536,n.push(l>>>10&1023|55296),n.push(56320|l&1023)}}}else +let u=x[h++]&63,c=(i&7)<<18|(s&63)<<12|o<<6|u;c-=65536,n.push(c>>>10&1023|55296),n.push(56320|c&1023)}}}else n.push(65533);n.length>=4096&&(e+=V.apply(String,n),n.length=0)}return n.length>0&&(e+=V.apply(String, -n)),e}a(Or,"readStringJS");var V=String.fromCharCode;function Fu(r){let e=h,t=new Array(r);for(let n=0;n< -r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return V.apply(String,t)}a(Fu,"longStringInJS"); -function vs(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return V(e)}}else{ +n)),e}a(qr,"readStringJS");var V=String.fromCharCode;function Mu(r){let e=h,t=new Array(r);for(let n=0;n< +r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return V.apply(String,t)}a(Mu,"longStringInJS"); +function As(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return V(e)}}else{ let e=x[h++],t=x[h++];if((e&128)>0||(t&128)>0){h-=2;return}if(r<3)return V(e,t);let n=x[h++];if((n&128)> 0){h-=3;return}return V(e,t,n)}else{let e=x[h++],t=x[h++],n=x[h++],i=x[h++];if((e&128)>0||(t&128)>0|| (n&128)>0||(i&128)>0){h-=4;return}if(r<6){if(r===4)return V(e,t,n,i);{let s=x[h++];if((s&128)>0){h-= 5;return}return V(e,t,n,i,s)}}else if(r<8){let s=x[h++],o=x[h++];if((s&128)>0||(o&128)>0){h-=6;return} if(r<7)return V(e,t,n,i,s,o);let u=x[h++];if((u&128)>0){h-=7;return}return V(e,t,n,i,s,o,u)}else{let s=x[h++], -o=x[h++],u=x[h++],l=x[h++];if((s&128)>0||(o&128)>0||(u&128)>0||(l&128)>0){h-=8;return}if(r<10){if(r=== -8)return V(e,t,n,i,s,o,u,l);{let c=x[h++];if((c&128)>0){h-=9;return}return V(e,t,n,i,s,o,u,l,c)}}else if(r< -12){let c=x[h++],f=x[h++];if((c&128)>0||(f&128)>0){h-=10;return}if(r<11)return V(e,t,n,i,s,o,u,l,c,f); -let y=x[h++];if((y&128)>0){h-=11;return}return V(e,t,n,i,s,o,u,l,c,f,y)}else{let c=x[h++],f=x[h++],y=x[h++], -g=x[h++];if((c&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return V(e,t, -n,i,s,o,u,l,c,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return V(e,t,n,i,s,o,u,l,c,f,y,g,E)}}else{ -let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return V(e,t,n,i,s,o,u,l,c,f,y,g, -E,C);let H=x[h++];if((H&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,l,c,f,y,g,E,C,H)}}}}}a(vs,"short\ -StringInJS");function Mu(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( -h,h+=r)}a(Mu,"readBin");var Es=new Float32Array(1),$t=new Uint8Array(Es.buffer,0,4);function ku(){let r=x[h++],e=x[h++],t=(r& +o=x[h++],u=x[h++],c=x[h++];if((s&128)>0||(o&128)>0||(u&128)>0||(c&128)>0){h-=8;return}if(r<10){if(r=== +8)return V(e,t,n,i,s,o,u,c);{let l=x[h++];if((l&128)>0){h-=9;return}return V(e,t,n,i,s,o,u,c,l)}}else if(r< +12){let l=x[h++],f=x[h++];if((l&128)>0||(f&128)>0){h-=10;return}if(r<11)return V(e,t,n,i,s,o,u,c,l,f); +let y=x[h++];if((y&128)>0){h-=11;return}return V(e,t,n,i,s,o,u,c,l,f,y)}else{let l=x[h++],f=x[h++],y=x[h++], +g=x[h++];if((l&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return V(e,t, +n,i,s,o,u,c,l,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E)}}else{ +let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return V(e,t,n,i,s,o,u,c,l,f,y,g, +E,C);let H=x[h++];if((H&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E,C,H)}}}}}a(As,"short\ +StringInJS");function Uu(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( +h,h+=r)}a(Uu,"readBin");var _s=new Float32Array(1),Gt=new Uint8Array(_s.buffer,0,4);function Du(){let r=x[h++],e=x[h++],t=(r& 127)>>2;if(t===31)return e||r&3?NaN:r&128?-1/0:1/0;if(t===0){let n=((r&3)<<8|e)/16777216;return r&128? --n:n}return $t[3]=r&128|(t>>1)+56,$t[2]=(r&7)<<5|e>>3,$t[1]=e<<5,$t[0]=0,Es[0]}a(ku,"getFloat16");var hh=new Array( -4096);var Wr=class Wr{constructor(e,t){this.value=e,this.tag=t}};a(Wr,"Tag");var tt=Wr;q[0]=r=>new Date(r); +-n:n}return Gt[3]=r&128|(t>>1)+56,Gt[2]=(r&7)<<5|e>>3,Gt[1]=e<<5,Gt[0]=0,_s[0]}a(Du,"getFloat16");var ph=new Array( +4096);var $r=class $r{constructor(e,t){this.value=e,this.tag=t}};a($r,"Tag");var rt=$r;q[0]=r=>new Date(r); q[1]=r=>new Date(Math.round(r*1e3));q[2]=r=>{let e=BigInt(0);for(let t=0,n=r.byteLength;tBigInt(-1)-q[2](r);q[4]=r=>+(r[1]+"e"+r[0]);q[5]=r=>r[1]*Math. -exp(r[0]*Math.log(2));var Nr=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. -restoreStructures=[]))[r]=t),N[r]=e,e.read=Dr(e)},"recordDefinition");q[Ru]=r=>{let e=r.length,t=r[1]; -Nr(r[0],t);let n={};for(let i=2;iW?W[0].slice( -W.position0,W.position0+=r):new tt(r,14);q[15]=r=>W?W[1].slice(W.position1,W.position1+=r):new tt(r, -15);var Uu={Error,RegExp};q[27]=r=>(Uu[r[0]]||Error)(r[1],r[2]);var As=a(r=>{if(x[h++]!=132){let t=new Error( +exp(r[0]*Math.log(2));var Qr=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. +restoreStructures=[]))[r]=t),N[r]=e,e.read=Nr(e)},"recordDefinition");q[Bu]=r=>{let e=r.length,t=r[1]; +Qr(r[0],t);let n={};for(let i=2;iW?W[0].slice( +W.position0,W.position0+=r):new rt(r,14);q[15]=r=>W?W[1].slice(W.position1,W.position1+=r):new rt(r, +15);var Ou={Error,RegExp};q[27]=r=>(Ou[r[0]]||Error)(r[1],r[2]);var Cs=a(r=>{if(x[h++]!=132){let t=new Error( "Packed values structure must be followed by a 4 element array");throw x.length{if(!ne)if(B.getShared)Qr();else return new tt( -r,ms);if(typeof r=="number")return ne[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ -ger packed references yet");throw r===void 0&&(e.incomplete=!0),e};q[28]=r=>{de||(de=new Map,de.id=0); -let e=de.id++,t=h,n=x[h],i;n>>5==4?i=[]:i={};let s={target:i};de.set(e,s);let o=r();return s.used?(Object. -getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(h=t,i=o,de.set(e,{target:i}),o=r()),Object.assign(i,o)): -(s.target=o,o)};q[28].handlesRead=!0;q[29]=r=>{let e=de.get(r);return e.used=!0,e.target};q[258]=r=>new Set( -r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,mt=!0),r())).handlesRead=!0;function Xe(r,e){return typeof r== -"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Xe,"combine");function We(){if(!ne) -if(B.getShared)Qr();else throw new Error("No packed values available");return ne}a(We,"getPackedValu\ -es");var Du=1399353956;kr.push((r,e)=>{if(r>=225&&r<=255)return Xe(We().prefixes[r-224],e);if(r>=28704&& -r<=32767)return Xe(We().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return Xe(We().prefixes[r- -1879048192],e);if(r>=216&&r<=223)return Xe(e,We().suffixes[r-216]);if(r>=27647&&r<=28671)return Xe(e, -We().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return Xe(e,We().suffixes[r-1811939328]);if(r== -Du)return{packedValues:ne,structures:N.slice(0),version:e};if(r==55799)return e});var Ou=new Uint8Array( -new Uint16Array([1]).buffer)[0]==1,bs=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> +nt array");throw t.incomplete=!0,t}return ie=ie?e.concat(ie.slice(e.length)):e,ie.prefixes=r(),ie.suffixes= +r(),r()},"packedTable");Cs.handlesRead=!0;q[51]=Cs;q[gs]=r=>{if(!ie)if(B.getShared)Wr();else return new rt( +r,gs);if(typeof r=="number")return ie[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ +ger packed references yet");throw r===void 0&&(e.incomplete=!0),e};q[28]=r=>{he||(he=new Map,he.id=0); +let e=he.id++,t=h,n=x[h],i;n>>5==4?i=[]:i={};let s={target:i};he.set(e,s);let o=r();return s.used?(Object. +getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(h=t,i=o,he.set(e,{target:i}),o=r()),Object.assign(i,o)): +(s.target=o,o)};q[28].handlesRead=!0;q[29]=r=>{let e=he.get(r);return e.used=!0,e.target};q[258]=r=>new Set( +r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,wt=!0),r())).handlesRead=!0;function et(r,e){return typeof r== +"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(et,"combine");function We(){if(!ie) +if(B.getShared)Wr();else throw new Error("No packed values available");return ie}a(We,"getPackedValu\ +es");var Nu=1399353956;Dr.push((r,e)=>{if(r>=225&&r<=255)return et(We().prefixes[r-224],e);if(r>=28704&& +r<=32767)return et(We().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return et(We().prefixes[r- +1879048192],e);if(r>=216&&r<=223)return et(e,We().suffixes[r-216]);if(r>=27647&&r<=28671)return et(e, +We().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return et(e,We().suffixes[r-1811939328]);if(r== +Nu)return{packedValues:ie,structures:N.slice(0),version:e};if(r==55799)return e});var qu=new Uint8Array( +new Uint16Array([1]).buffer)[0]==1,Ss=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> "u"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"? -{name:"BigInt64Array"}:BigInt64Array,Float32Array,Float64Array],Nu=[64,68,69,70,71,72,77,78,79,85,86]; -for(let r=0;r{if(!r)throw new Error("Could not find typed array for code "+e); +2:n==8?3:0;q[i?e:e-4]=n==1||i==qu?o=>{if(!r)throw new Error("Could not find typed array for code "+e); return!B.copyBuffers&&(n===1||n===2&&!(o.byteOffset&1)||n===4&&!(o.byteOffset&3)||n===8&&!(o.byteOffset& 7))?new r(o.buffer,o.byteOffset,o.byteLength>>s):new r(Uint8Array.prototype.slice.call(o,0).buffer)}: o=>{if(!r)throw new Error("Could not find typed array for code "+e);let u=new DataView(o.buffer,o.byteOffset, -o.byteLength),l=o.length>>s,c=new r(l),f=u[t];for(let y=0;y23)switch(r){case 24:r=x[h++];break;case 25:r=X.getUint16( -h),h+=2;break;case 26:r=X.getUint32(h),h+=4;break}return r}a(et,"readJustLength");function Qr(){if(B. -getShared){let r=_s(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ne= -B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(Qr, -"loadShared");function _s(r){let e=He,t=h,n=Mr,i=Vt,s=gt,o=Gt,u=Fr,l=de,c=W,f=new Uint8Array(x.slice( -0,He)),y=N,g=B,E=bt,C=r();return He=e,h=t,Mr=n,Vt=i,gt=s,Gt=o,Fr=u,de=l,W=c,x=f,bt=E,N=y,B=g,X=new DataView( -x.buffer,x.byteOffset,x.byteLength),C}a(_s,"saveState");function qr(){x=null,de=null,N=null}a(qr,"cl\ -earSource");var Cs=new Array(147);for(let r=0;r<256;r++)Cs[r]=+("1e"+Math.floor(45.15-r*.30103));var jr=new Ur({ -useRecords:!1}),dh=jr.decode,Is=jr.decodeMultiple;p();var Kt=class Kt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ +o.byteLength),c=o.length>>s,l=new r(c),f=u[t];for(let y=0;y23)switch(r){case 24:r=x[h++];break;case 25:r=X.getUint16( +h),h+=2;break;case 26:r=X.getUint32(h),h+=4;break}return r}a(tt,"readJustLength");function Wr(){if(B. +getShared){let r=Is(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ie= +B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(Wr, +"loadShared");function Is(r){let e=He,t=h,n=Ur,i=Kt,s=bt,o=Vt,u=Mr,c=he,l=W,f=new Uint8Array(x.slice( +0,He)),y=N,g=B,E=xt,C=r();return He=e,h=t,Ur=n,Kt=i,bt=s,Vt=o,Mr=u,he=c,W=l,x=f,xt=E,N=y,B=g,X=new DataView( +x.buffer,x.byteOffset,x.byteLength),C}a(Is,"saveState");function jr(){x=null,he=null,N=null}a(jr,"cl\ +earSource");var Ts=new Array(147);for(let r=0;r<256;r++)Ts[r]=+("1e"+Math.floor(45.15-r*.30103));var Hr=new Or({ +useRecords:!1}),yh=Hr.decode,Rs=Hr.decodeMultiple;p();var zt=class zt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ let{strings:t,values:n}=this;for(let i=0,s=t.length;iu.length!==0).map(u=>JSON.parse(u)):Is(new Uint8Array(await r.arrayBuffer())),i=n.at(-1); -if(!Array.isArray(i)||i[0]!==3&&i[0]!==4)throw new ue("Neon internal error: streamed response ended \ -without a terminal message");if(i[0]===4&&i.length===2&&i[1]!==null&&typeof i[1]=="object")throw po( -i[1]);if(i[0]!==3||i.length!==1)throw new ue("Neon internal error: unexpected streamed response stat\ -us");let s=[],o;for(let u of n.slice(0,-1)){Array.isArray(u)||Fe();let[l,...c]=u;switch(l){case Jl:o!== -void 0&&Fe(),o={fields:c,rows:[]};break;case Yl:(o===void 0||c.length===0)&&Fe();let f=o.row??(o.row= -[]);for(let[y,g]of c.entries()){if((f.length>=o.fields.length||Array.isArray(g)&&(g.length!==1||typeof g[0]!= -"string")||!Array.isArray(g)&&g!==null&&typeof g!="string")&&Fe(),Array.isArray(g)){(o.partialText?? -(o.partialText=[])).push(g[0]);continue}g===null?(o.partialText!==void 0&&Fe(),f.push(null)):(o.partialText=== -void 0?f.push(g):(o.partialText.push(g),f.push(o.partialText.join(""))),o.partialText=void 0),f.length=== -o.fields.length&&(y!==c.length-1&&Fe(),o.rows.push(f),o.row=void 0)}break;case Zl:(o===void 0||o.row!== -void 0||o.partialText!==void 0||c.length!==2)&&Fe(),s.push({fields:o.fields,rows:o.rows,command:c[0], -rowCount:c[1]}),o=void 0;break;default:Fe()}}if(o!==void 0||!t&&s.length!==1)throw new ue("Neon inte\ -rnal error: incomplete streamed response");return t?{results:s}:s[0]}a(Xl,"readStreamingResult");function ec(r){ -return r instanceof m?"\\x"+ps(r):r}a(ec,"encodeBuffersAsBytea");function lo(r){let{query:e,params:t}=r instanceof -rt?r.toParameterizedQuery():r;return{query:e,params:t.map(n=>ec((0,ho.prepareValue)(n)))}}a(lo,"prep\ -areQuery");function on(r,{arrayMode:e,fullResults:t,fetchOptions:n,responseFormat:i,isolationLevel:s, -readOnly:o,deferrable:u,authToken:l,disableWarningInBrowsers:c}={}){if(!r)throw new Error("No databa\ -se connection string was provided to `neon()`. Perhaps an environment variable has not been set?");let f; -try{f=Rr(r)}catch{throw new Error("Database connection string provided to `neon()` is not a valid UR\ -L. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E,port:C,pathname:H}=f;if(y!== -"postgres:"&&y!=="postgresql:"||!g||!E||!H)throw new Error("Database connection string format for `n\ -eon()` should be: postgresql://user@host.tld/dbname?option=value");function Y(T,...b){if(!(Array.isArray( -T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can now be called only as\ - a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], options). For a con\ -ventional function call with value placeholders ($1, $2, etc.), use sql.query("SELECT $1", [value], \ -options).');return new Le(we,new rt(T,b))}a(Y,"templateFn"),Y.query=(T,b,M)=>new Le(we,{query:T,params:b?? -[]},M),Y.unsafe=T=>new nt(T),Y.transaction=async(T,b)=>{if(typeof T=="function"&&(T=T(Y)),!Array.isArray( -T))throw new Error(uo);T.forEach($=>{if(!($ instanceof Le))throw new Error(uo)});let M=T.map($=>$.queryData), -oe=T.map($=>$.opts??{});return we(M,oe,b)};async function we(T,b,M){let{fetchEndpoint:oe,fetchFunction:$}=be, -ge=Array.isArray(T),Ie=ge?{queries:T.map(ce=>lo(ce))}:lo(T),le=n??{},F=i??"json",J=e??!1,Ee=t??!1,Te=s, -Ue=o,De=u;M!==void 0&&(M.fetchOptions!==void 0&&(le={...le,...M.fetchOptions}),M.arrayMode!==void 0&& -(J=M.arrayMode),M.fullResults!==void 0&&(Ee=M.fullResults),M.responseFormat!==void 0&&(F=M.responseFormat), -M.isolationLevel!==void 0&&(Te=M.isolationLevel),M.readOnly!==void 0&&(Ue=M.readOnly),M.deferrable!== -void 0&&(De=M.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!==void 0&&(le={...le,...b.fetchOptions}), -b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(F=b.responseFormat);let Oe=l;!Array.isArray( -b)&&b?.authToken!==void 0&&(Oe=b.authToken);let pr=typeof oe=="function"?oe(E,C,{jwtAuth:Oe!==void 0}): -oe,Ne={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"true","Neon-Array-Mode":"true",Accept:zl[F]}, -Re=await tc(Oe);Re&&(Ne.Authorization=`Bearer ${Re}`),ge&&(Te!==void 0&&(Ne["Neon-Batch-Isolation-Le\ -vel"]=Te),Ue!==void 0&&(Ne["Neon-Batch-Read-Only"]=String(Ue)),De!==void 0&&(Ne["Neon-Batch-Deferrab\ -le"]=String(De))),c||be.disableWarningInBrowsers||xt();let Z;try{Z=await($??fetch)(pr,{method:"POST", -body:JSON.stringify(Ie),headers:Ne,...le})}catch(ce){let ae=new ue(`Error connecting to database: ${ce}`); -throw ae.sourceError=ce,ae}if(Z.ok){let ce=F==="json"?await Z.json():await Xl(Z,F,ge);if(ge){let ae=ce. -results;if(!Array.isArray(ae))throw new ue("Neon internal error: unexpected result format");return ae. -map((yr,mr)=>{let wr=b[mr]??{},Aa=wr.arrayMode??J,_a=wr.fullResults??Ee;return co(yr,{arrayMode:Aa,fullResults:_a, -types:wr.types})})}else{let ae=b??{},yr=ae.arrayMode??J,mr=ae.fullResults??Ee;return co(ce,{arrayMode:yr, -fullResults:mr,types:ae.types})}}else{let{status:ce}=Z;if(ce===400){let ae=await Z.json();throw po(ae)}else{ -let ae=await Z.text();throw new ue(`Server error (HTTP status ${ce}): ${ae}`)}}}return a(we,"execute"), -Y}a(on,"neon");var an=class an{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(an,"Neon\ -QueryPromise");var Le=an;function co(r,{arrayMode:e,fullResults:t,types:n}){let i=new fo.default(n), -s=r.fields.map(l=>l.name),o=r.fields.map(l=>i.getTypeParser(l.dataTypeID)),u=e===!0?r.rows.map(l=>l. -map((c,f)=>c===null?null:o[f](c))):r.rows.map(l=>Object.fromEntries(l.map((c,f)=>[s[f],c===null?null: -o[f](c)])));return t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=u,r._parsers=o,r._types=i,r):u}a(co,"p\ -rocessQueryResult");async function tc(r){if(typeof r=="string")return r;if(typeof r=="function")try{ -return await Promise.resolve(r())}catch(e){let t=new ue("Error getting auth token.");throw e instanceof -Error&&(t=new ue(`Error getting auth token: ${e.message}`)),t}}a(tc,"getAuthToken");p();var va=qe(Mt());p();var Sa=qe(Mt());var Ci=class Ci extends Sa.Client{constructor(t){super(t);this.config=t}get neonConfig(){return this. +Jc=0,Zc=1,Xc=2;function el(r){switch(r.headers.get("Content-Type")?.split(";",1)[0].trim().toLowerCase()){case rr. +json:return"json";case rr.jsonl:return"jsonl";case rr["cbor-seq"]:return"cbor-seq";default:return}}a( +el,"getResponseFormat");function mo(r){let e=new ee(r.message);for(let t of Yc)e[t]=r[t]??void 0;return e} +a(mo,"dbError");function Fe(){throw new ee("Neon internal error: unexpected streamed response messag\ +e")}a(Fe,"unexpectedStreamingMessage");async function tl(r,e,t){let n=e==="jsonl"?(await r.text()).split( +` +`).filter(u=>u.length!==0).map(u=>JSON.parse(u)):Rs(new Uint8Array(await r.arrayBuffer())),i=n.pop(); +if(i===null||typeof i!="object"||Array.isArray(i))throw new ee("Neon internal error: streamed respon\ +se ended without a terminal message");if("message"in i)throw typeof i.message!="string"?new ee("Neon\ + internal error: unexpected streamed response status"):mo(i);if(Object.keys(i).length!==0)throw new ee( +"Neon internal error: unexpected streamed response status");let s=[],o;for(let u of n){Array.isArray( +u)||Fe();let[c,...l]=u;switch(c){case Zc:o!==void 0&&Fe(),o={fields:l,rows:[]};break;case Jc:if((o=== +void 0||l.length===0&&o.fields.length!==0)&&Fe(),l.length===0){o.rows.push([]);break}let f=o.row??(o. +row=[]);for(let[y,g]of l.entries()){if((f.length>=o.fields.length||Array.isArray(g)&&(g.length!==1|| +typeof g[0]!="string")||!Array.isArray(g)&&g!==null&&typeof g!="string")&&Fe(),Array.isArray(g)){(o. +partialText??(o.partialText=[])).push(g[0]);continue}g===null?(o.partialText!==void 0&&Fe(),f.push(null)): +(o.partialText===void 0?f.push(g):(o.partialText.push(g),f.push(o.partialText.join(""))),o.partialText= +void 0),f.length===o.fields.length&&(y!==l.length-1&&Fe(),o.rows.push(f),o.row=void 0)}break;case Xc: +(o===void 0||o.row!==void 0||o.partialText!==void 0||l.length!==2)&&Fe(),s.push({fields:o.fields,rows:o. +rows,command:l[0],rowCount:l[1]}),o=void 0;break;default:Fe()}}if(o!==void 0||s.length!==(t??1))throw new ee( +"Neon internal error: incomplete streamed response");return t===void 0?s[0]:{results:s}}a(tl,"readSt\ +reamingResults");function rl(r){return r instanceof m?"\\x"+ms(r):r}a(rl,"encodeBuffersAsBytea");function fo(r){ +let{query:e,params:t}=r instanceof nt?r.toParameterizedQuery():r;return{query:e,params:t.map(n=>rl((0,yo.prepareValue)( +n)))}}a(fo,"prepareQuery");function un(r,{arrayMode:e,fullResults:t,fetchOptions:n,responseFormat:i, +isolationLevel:s,readOnly:o,deferrable:u,authToken:c,disableWarningInBrowsers:l}={}){if(!r)throw new Error( +"No database connection string was provided to `neon()`. Perhaps an environment variable has not bee\ +n set?");let f;try{f=Br(r)}catch{throw new Error("Database connection string provided to `neon()` is\ + not a valid URL. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E,port:C,pathname:H}=f; +if(y!=="postgres:"&&y!=="postgresql:"||!g||!E||!H)throw new Error("Database connection string format\ + for `neon()` should be: postgresql://user@host.tld/dbname?option=value");function J(T,...b){if(!(Array. +isArray(T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can now be called\ + only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], options). F\ +or a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SELECT $1", [\ +value], options).');return new Le(me,new nt(T,b))}a(J,"templateFn"),J.query=(T,b,F)=>new Le(me,{query:T, +params:b??[]},F),J.unsafe=T=>new it(T),J.transaction=async(T,b)=>{if(typeof T=="function"&&(T=T(J)), +!Array.isArray(T))throw new Error(lo);T.forEach($=>{if(!($ instanceof Le))throw new Error(lo)});let F=T. +map($=>$.queryData),ae=T.map($=>$.opts??{});return me(F,ae,b)};async function me(T,b,F){let{fetchEndpoint:ae, +fetchFunction:$}=ge,we=Array.isArray(T),Ie=we?{queries:T.map(Ee=>fo(Ee))}:fo(T),ce=n??{},M=i??"json", +Z=e??!1,ve=t??!1,Te=s,Ue=o,De=u;F!==void 0&&(F.fetchOptions!==void 0&&(ce={...ce,...F.fetchOptions}), +F.arrayMode!==void 0&&(Z=F.arrayMode),F.fullResults!==void 0&&(ve=F.fullResults),F.responseFormat!== +void 0&&(M=F.responseFormat),F.isolationLevel!==void 0&&(Te=F.isolationLevel),F.readOnly!==void 0&&(Ue= +F.readOnly),F.deferrable!==void 0&&(De=F.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!== +void 0&&(ce={...ce,...b.fetchOptions}),b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(M= +b.responseFormat);let Oe=c;!Array.isArray(b)&&b?.authToken!==void 0&&(Oe=b.authToken);let mr=typeof ae== +"function"?ae(E,C,{jwtAuth:Oe!==void 0}):ae,Ne={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ +rue","Neon-Array-Mode":"true",Accept:rr[M]},Re=await nl(Oe);Re&&(Ne.Authorization=`Bearer ${Re}`),we&& +(Te!==void 0&&(Ne["Neon-Batch-Isolation-Level"]=Te),Ue!==void 0&&(Ne["Neon-Batch-Read-Only"]=String( +Ue)),De!==void 0&&(Ne["Neon-Batch-Deferrable"]=String(De))),l||ge.disableWarningInBrowsers||St();let z; +try{z=await($??fetch)(mr,{method:"POST",body:JSON.stringify(Ie),headers:Ne,...ce})}catch(Ee){let ue=new ee( +`Error connecting to database: ${Ee}`);throw ue.sourceError=Ee,ue}let $e=el(z);if(z.ok){if($e===void 0) +throw new ee(`Neon internal error: unexpected response Content-Type: ${z.headers.get("Content-Type")?? +"missing"}`);let Ee=$e==="json"?await z.json():await tl(z,$e,we?T.length:void 0);if(we){let ue=Ee.results; +if(!Array.isArray(ue))throw new ee("Neon internal error: unexpected result format");return ue.map((wr,gr)=>{ +let br=b[gr]??{},Ca=br.arrayMode??Z,Ia=br.fullResults??ve;return ho(wr,{arrayMode:Ca,fullResults:Ia, +types:br.types})})}else{let ue=b??{},wr=ue.arrayMode??Z,gr=ue.fullResults??ve;return ho(Ee,{arrayMode:wr, +fullResults:gr,types:ue.types})}}else{let{status:Ee}=z;if($e==="json"){let ue=await z.json();throw mo( +ue)}else{let ue=await z.text();throw new ee(`Server error (HTTP status ${Ee}): ${ue}`)}}}return a(me, +"execute"),J}a(un,"neon");var cn=class cn{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(cn,"NeonQueryPromise");var Le=cn;function ho(r,{arrayMode:e,fullResults:t,types:n}){let i=new po.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(ho,"p\ +rocessQueryResult");async function nl(r){if(typeof r=="string")return r;if(typeof r=="function")try{ +return await Promise.resolve(r())}catch(e){let t=new ee("Error getting auth token.");throw e instanceof +Error&&(t=new ee(`Error getting auth token: ${e.message}`)),t}}a(nl,"getAuthToken");p();var Aa=qe(Mt());p();var Ea=qe(Mt());var Ti=class Ti extends Ea.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\ @@ -1481,44 +1486,44 @@ s&&this.database===s&&this.password===null)throw new Error(`No database host or 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, -l=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let c=this.connection;if(u&&c.on( -"connect",()=>c.stream.emit("data","S")),l){c.removeAllListeners("authenticationCleartextPassword"), -c.removeAllListeners("readyForQuery"),c.once("readyForQuery",()=>c.on("readyForQuery",this._handleReadyForQuery. -bind(this)));let f=this.ssl?"sslconnect":"connect";c.on(f,()=>{this.neonConfig.disableWarningInBrowsers|| -xt(),this._handleAuthCleartextPassword(),this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){ +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|| +St(),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(Re=>{if(!/^.=/.test(Re))throw new Error( -"SASL: Invalid attribute pair entry");let Z=Re[0],ce=Re.substring(2);return[Z,ce]})),l=u.r,c=u.s,f=u. -i;if(!l||!/^[!-+--~]+$/.test(l))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unp\ -rintable");if(!c||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(c))throw new Error( +"SASL: Invalid attribute pair entry");let z=Re[0],$e=Re.substring(2);return[z,$e]})),c=u.r,l=u.s,f=u. +i;if(!c||!/^[!-+--~]+$/.test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unp\ +rintable");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(!l.startsWith(i.clientNonce)) -throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");if(l. +"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=m.from(c,"base64"),E=new TextEncoder,C=E.encode(s),H=await n.importKey( -"raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Y=new Uint8Array(await n.sign("HMAC",H,m.concat( -[g,m.from([0,0,0,1])]))),we=Y;for(var T=0;Twe[Z]^Y[Z]));let b=we,M=await n.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-2\ -56"}},!1,["sign"]),oe=new Uint8Array(await n.sign("HMAC",M,E.encode("Client Key"))),$=await n.digest( -"SHA-256",oe),ge="n=*,r="+i.clientNonce,Ie="r="+l+",s="+c+",i="+y,le="c=biws,r="+l,F=ge+","+Ie+","+le, -J=await n.importKey("raw",$,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Ee=new Uint8Array(await n. -sign("HMAC",J,E.encode(F))),Te=m.from(oe.map((Re,Z)=>oe[Z]^Ee[Z])),Ue=Te.toString("base64");let De=await n. + short");let y=parseInt(f,10),g=m.from(l,"base64"),E=new TextEncoder,C=E.encode(s),H=await n.importKey( +"raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),J=new Uint8Array(await n.sign("HMAC",H,m.concat( +[g,m.from([0,0,0,1])]))),me=J;for(var T=0;Tme[z]^J[z]));let b=me,F=await n.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-2\ +56"}},!1,["sign"]),ae=new Uint8Array(await n.sign("HMAC",F,E.encode("Client Key"))),$=await n.digest( +"SHA-256",ae),we="n=*,r="+i.clientNonce,Ie="r="+c+",s="+l+",i="+y,ce="c=biws,r="+c,M=we+","+Ie+","+ce, +Z=await n.importKey("raw",$,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var ve=new Uint8Array(await n. +sign("HMAC",Z,E.encode(M))),Te=m.from(ae.map((Re,z)=>ae[z]^ve[z])),Ue=Te.toString("base64");let De=await n. importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Oe=await n.sign("HMAC",De,E.encode( -"Server Key")),pr=await n.importKey("raw",Oe,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Ne=m. -from(await n.sign("HMAC",pr,E.encode(F)));i.message="SASLResponse",i.serverSignature=Ne.toString("ba\ -se64"),i.response=le+",p="+Ue,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; -a(Ci,"NeonClient");var ht=Ci;Je();var Ea=qe(sr());function Wf(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(Wf,"promisify");var Ii=class Ii extends va.Pool{constructor(){ -super(...arguments);I(this,"Client",ht);I(this,"hasFetchUnsupportedListeners",!1);I(this,"addListene\ +"Server Key")),mr=await n.importKey("raw",Oe,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Ne=m. +from(await n.sign("HMAC",mr,E.encode(M)));i.message="SASLResponse",i.serverSignature=Ne.toString("ba\ +se64"),i.response=ce+",p="+Ue,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; +a(Ti,"NeonClient");var dt=Ti;Ze();var _a=qe(ar());function $f(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($f,"promisify");var Ri=class Ri extends Aa.Pool{constructor(){ +super(...arguments);I(this,"Client",dt);I(this,"hasFetchUnsupportedListeners",!1);I(this,"addListene\ r",this.on)}on(t,n){return t!=="error"&&(this.hasFetchUnsupportedListeners=!0),super.on(t,n)}query(t,n,i){ -if(!be.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof t=="function")return super.query( -t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=Wf(this.Promise,i);i=s.callback;try{let o=new Ea.default( -this.options),u=encodeURIComponent,l=encodeURI,c=`postgresql://${u(o.user)}:${u(o.password)}@${u(o.host)}\ -/${l(o.database)}`,f=typeof t=="string"?t:t.text,y=n??t.values??[];on(c,{fullResults:!0,arrayMode:t. +if(!ge.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof t=="function")return super.query( +t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=$f(this.Promise,i);i=s.callback;try{let o=new _a.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??[];un(l,{fullResults:!0,arrayMode:t. rowMode==="array"}).query(f,y,{types:t.types??this.options?.types}).then(E=>i(void 0,E)).catch(E=>i( -E))}catch(o){i(o)}return s.result}};a(Ii,"NeonPool");var dr=Ii;Je();var ve=qe(Mt()),Hf="js"; +E))}catch(o){i(o)}return s.result}};a(Ri,"NeonPool");var yr=Ri;Ze();var Se=qe(Mt()),Gf="js"; /*! Bundled license information: ieee754/index.js: diff --git a/index.mjs b/index.mjs index 8e804cb..950c0e0 100644 --- a/index.mjs +++ b/index.mjs @@ -1,74 +1,74 @@ /* @ts-self-types="./index.d.mts" */ -var Ca=Object.create;var He=Object.defineProperty;var Ia=Object.getOwnPropertyDescriptor;var Ta=Object.getOwnPropertyNames;var Ra=Object.getPrototypeOf,Pa=Object.prototype.hasOwnProperty;var Ba=(r,e,t)=>e in r?He(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>He(r,"name",{value:e,configurable:!0});var te=(r,e)=>()=>(r&&(e=r(r=0)),e);var P=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ge=(r,e)=>{for(var t in e)He(r,t,{get:e[t], -enumerable:!0})},Ii=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ta(e))!Pa. -call(r,i)&&i!==t&&He(r,i,{get:()=>e[i],enumerable:!(n=Ia(e,i))||n.enumerable});return r};var Oe=(r,e,t)=>(t=r!=null?Ca(Ra(r)):{},Ii(e||!r||!r.__esModule?He(t,"default",{value:r,enumerable:!0}): -t,r)),$=r=>Ii(He({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Ba(r,typeof e!="symbol"?e+"":e,t);var Pi=P(kt=>{"use strict";p();kt.byteLength=Fa;kt.toByteArray=ka;kt.fromByteArray=Oa;var be=[],ce=[], -La=typeof Uint8Array<"u"?Uint8Array:Array,wr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ -23456789+/";for(Ne=0,Ti=wr.length;Ne0)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(Ri,"getLens"); -function Fa(r){var e=Ri(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Fa,"byteLength");function Ma(r,e,t){return(e+ -t)*3/4-t}a(Ma,"_byteLength");function ka(r){var e,t=Ri(r),n=t[0],i=t[1],s=new La(Ma(r,n,i)),o=0,u=i> -0?n-4:n,l;for(l=0;l>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=ce[r.charCodeAt( -l)]<<2|ce[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=ce[r.charCodeAt(l)]<<10|ce[r.charCodeAt(l+1)]<< -4|ce[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(ka,"toByteArray");function Ua(r){return be[r>> -18&63]+be[r>>12&63]+be[r>>6&63]+be[r&63]}a(Ua,"tripletToBase64");function Da(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(Ua(n));return i.join("")}a(Da,"en\ -codeChunk");function Oa(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(be[e>>2]+be[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1], -i.push(be[e>>10]+be[e>>4&63]+be[e<<2&63]+"=")),i.join("")}a(Oa,"fromByteArray")});var Bi=P(gr=>{p();gr.read=function(r,e,t,n,i){var s,o,u=i*8-n-1,l=(1<>1,f=-7,y=t?i-1:0,g=t? +var Ta=Object.create;var $e=Object.defineProperty;var Ra=Object.getOwnPropertyDescriptor;var Pa=Object.getOwnPropertyNames;var Ba=Object.getPrototypeOf,La=Object.prototype.hasOwnProperty;var Fa=(r,e,t)=>e in r?$e(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>$e(r,"name",{value:e,configurable:!0});var te=(r,e)=>()=>(r&&(e=r(r=0)),e);var P=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),we=(r,e)=>{for(var t in e)$e(r,t,{get:e[t], +enumerable:!0})},Ri=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Pa(e))!La. +call(r,i)&&i!==t&&$e(r,i,{get:()=>e[i],enumerable:!(n=Ra(e,i))||n.enumerable});return r};var Oe=(r,e,t)=>(t=r!=null?Ta(Ba(r)):{},Ri(e||!r||!r.__esModule?$e(t,"default",{value:r,enumerable:!0}): +t,r)),$=r=>Ri($e({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Fa(r,typeof e!="symbol"?e+"":e,t);var Li=P(Ut=>{"use strict";p();Ut.byteLength=Ma;Ut.toByteArray=Da;Ut.fromByteArray=qa;var ge=[],le=[], +ka=typeof Uint8Array<"u"?Uint8Array:Array,br="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ +23456789+/";for(Ne=0,Pi=br.length;Ne0)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(Bi,"getLens"); +function Ma(r){var e=Bi(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Ma,"byteLength");function Ua(r,e,t){return(e+ +t)*3/4-t}a(Ua,"_byteLength");function Da(r){var e,t=Bi(r),n=t[0],i=t[1],s=new ka(Ua(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=le[r.charCodeAt( +c)]<<2|le[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=le[r.charCodeAt(c)]<<10|le[r.charCodeAt(c+1)]<< +4|le[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(Da,"toByteArray");function Oa(r){return ge[r>> +18&63]+ge[r>>12&63]+ge[r>>6&63]+ge[r&63]}a(Oa,"tripletToBase64");function Na(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(Oa(n));return i.join("")}a(Na,"en\ +codeChunk");function qa(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(ge[e>>2]+ge[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1], +i.push(ge[e>>10]+ge[e>>4&63]+ge[e<<2&63]+"=")),i.join("")}a(qa,"fromByteArray")});var Fi=P(xr=>{p();xr.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,E=r[e+y];for(y+=g,s=E&(1<<-f)-1,E>>=-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-c;else{if(s===l)return o?NaN:(E?-1:1)*(1/0);o=o+Math. -pow(2,n),s=s-c}return(E?-1:1)*o*Math.pow(2,s-n)};gr.write=function(r,e,t,n,i,s){var o,u,l,c=s*8-i-1, -f=(1<>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:s-1,C=n?1:-1,W=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*(l= -Math.pow(2,-o))<1&&(o--,l*=2),o+y>=1?e+=g/l:e+=g*Math.pow(2,1-y),e*l>=2&&(o++,l/=2),o+y>=f?(u=0,o=f): -o+y>=1?(u=(e*l-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+E]=u&255,E+= -C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,c-=8);r[t+E-C]|=W*128}});var Ki=P(Ke=>{"use strict";p();var br=Pi(),Ge=Bi(),Li=typeof Symbol=="function"&&typeof Symbol.for== -"function"?Symbol.for("nodejs.util.inspect.custom"):null;Ke.Buffer=d;Ke.SlowBuffer=Ha;Ke.INSPECT_MAX_BYTES= -50;var Ut=2147483647;Ke.kMaxLength=Ut;d.TYPED_ARRAY_SUPPORT=Na();!d.TYPED_ARRAY_SUPPORT&&typeof console< +-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:(E?-1:1)*(1/0);o=o+Math. +pow(2,n),s=s-l}return(E?-1:1)*o*Math.pow(2,s-n)};xr.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,E=n?0:s-1,C=n?1:-1,W=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+E]=u&255,E+= +C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=W*128}});var Yi=P(ze=>{"use strict";p();var Sr=Li(),Ve=Fi(),ki=typeof Symbol=="function"&&typeof Symbol.for== +"function"?Symbol.for("nodejs.util.inspect.custom"):null;ze.Buffer=d;ze.SlowBuffer=Ga;ze.INSPECT_MAX_BYTES= +50;var Dt=2147483647;ze.kMaxLength=Dt;d.TYPED_ARRAY_SUPPORT=Qa();!d.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 Na(){ +pport which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Qa(){ 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(Na,"typedArraySupport");Object. +prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}a(Qa,"typedArraySupport");Object. defineProperty(d.prototype,"parent",{enumerable:!0,get:a(function(){if(d.isBuffer(this))return this. buffer},"get")});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:a(function(){if(d.isBuffer( -this))return this.byteOffset},"get")});function Ee(r){if(r>Ut)throw new RangeError('The value "'+r+'\ +this))return this.byteOffset},"get")});function Ee(r){if(r>Dt)throw new RangeError('The value "'+r+'\ " is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,d.prototype), e}a(Ee,"createBuffer");function d(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 Er(r)}return Ui(r,e,t)} -a(d,"Buffer");d.poolSize=8192;function Ui(r,e,t){if(typeof r=="string")return Qa(r,e);if(ArrayBuffer. -isView(r))return ja(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(xe(r,ArrayBuffer)|| -r&&xe(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(xe(r,SharedArrayBuffer)||r&&xe(r.buffer, -SharedArrayBuffer)))return Sr(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument\ +'The "string" argument must be of type string. Received type number');return _r(r)}return Oi(r,e,t)} +a(d,"Buffer");d.poolSize=8192;function Oi(r,e,t){if(typeof r=="string")return Wa(r,e);if(ArrayBuffer. +isView(r))return Ha(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(be(r,ArrayBuffer)|| +r&&be(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(be(r,SharedArrayBuffer)||r&&be(r.buffer, +SharedArrayBuffer)))return Er(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 d. -from(n,e,t);let i=Wa(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. +from(n,e,t);let i=$a(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. toPrimitive]=="function")return d.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(Ui,"from");d.from=function(r,e,t){return Ui(r,e,t)};Object.setPrototypeOf(d.prototype, -Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Di(r){if(typeof r!="number")throw new TypeError( +ed type "+typeof r)}a(Oi,"from");d.from=function(r,e,t){return Oi(r,e,t)};Object.setPrototypeOf(d.prototype, +Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Ni(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(Di,"assertSize");function qa(r,e,t){return Di(r),r<=0?Ee(r):e!==void 0?typeof t== -"string"?Ee(r).fill(e,t):Ee(r).fill(e):Ee(r)}a(qa,"alloc");d.alloc=function(r,e,t){return qa(r,e,t)}; -function Er(r){return Di(r),Ee(r<0?0:Ar(r)|0)}a(Er,"allocUnsafe");d.allocUnsafe=function(r){return Er( -r)};d.allocUnsafeSlow=function(r){return Er(r)};function Qa(r,e){if((typeof e!="string"||e==="")&&(e= -"utf8"),!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=Oi(r,e)|0,n=Ee(t),i=n.write( -r,e);return i!==t&&(n=n.slice(0,i)),n}a(Qa,"fromString");function xr(r){let e=r.length<0?0:Ar(r.length)| -0,t=Ee(e);for(let n=0;n=Ut)throw new RangeError("Attempt to allocate Buffer larger t\ -han maximum size: 0x"+Ut.toString(16)+" bytes");return r|0}a(Ar,"checked");function Ha(r){return+r!= -r&&(r=0),d.alloc(+r)}a(Ha,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== -d.prototype},"isBuffer");d.compare=a(function(e,t){if(xe(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)), -xe(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.isBuffer(t))throw new TypeError( +r,e,t),Object.setPrototypeOf(n,d.prototype),n}a(Er,"fromArrayBuffer");function $a(r){if(d.isBuffer(r)){ +let e=Cr(r.length)|0,t=Ee(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r. +length!="number"||Tr(r.length)?Ee(0):vr(r);if(r.type==="Buffer"&&Array.isArray(r.data))return vr(r.data)} +a($a,"fromObject");function Cr(r){if(r>=Dt)throw new RangeError("Attempt to allocate Buffer larger t\ +han maximum size: 0x"+Dt.toString(16)+" bytes");return r|0}a(Cr,"checked");function Ga(r){return+r!= +r&&(r=0),d.alloc(+r)}a(Ga,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== +d.prototype},"isBuffer");d.compare=a(function(e,t){if(be(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)), +be(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.isBuffer(t))throw new TypeError( 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length, i=t.length;for(let s=0,o=Math.min(n,i);si.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(i,s)):Uint8Array.prototype. +if(be(o,Uint8Array))s+o.length>i.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(i,s)):Uint8Array.prototype. set.call(i,o,s);else if(d.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 Oi(r,e){if(d.isBuffer(r))return r.length; -if(ArrayBuffer.isView(r)||xe(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError( +an Array of Buffers');s+=o.length}return i},"concat");function qi(r,e){if(d.isBuffer(r))return r.length; +if(ArrayBuffer.isView(r)||be(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 vr(r).length;case"ucs2":case"\ -ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Vi(r).length;default: -if(i)return n?-1:vr(r).length;e=(""+e).toLowerCase(),i=!0}}a(Oi,"byteLength");d.byteLength=Oi;function $a(r,e,t){ +ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Ar(r).length;case"ucs2":case"\ +ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return zi(r).length;default: +if(i)return n?-1:Ar(r).length;e=(""+e).toLowerCase(),i=!0}}a(qi,"byteLength");d.byteLength=qi;function Va(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 tu(this,e,t);case"u\ -tf8":case"utf-8":return qi(this,e,t);case"ascii":return Xa(this,e,t);case"latin1":case"binary":return eu( -this,e,t);case"base64":return Ja(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ru( -this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a($a, +0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return nu(this,e,t);case"u\ +tf8":case"utf-8":return ji(this,e,t);case"ascii":return tu(this,e,t);case"latin1":case"binary":return ru( +this,e,t);case"base64":return Xa(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return iu( +this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(Va, "slowToString");d.prototype._isBuffer=!0;function qe(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(qe,"swap"); d.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");Li&&(d.prototype[Li]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ -if(xe(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(e))throw new TypeError('The "ta\ +er "+e+">"},"inspect");ki&&(d.prototype[ki]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ +if(be(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.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,l=Math.min(o,u),c=this.slice( -i,s),f=e.slice(t,n);for(let y=0;y2147483647? -t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Cr(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r. +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,Tr(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=d.from( -e,n)),d.isBuffer(e))return e.length===0?-1:Fi(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array. +e,n)),d.isBuffer(e))return e.length===0?-1:Mi(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):Fi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Ni,"bidire\ -ctionalIndexOf");function Fi(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):Mi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Qi,"bidire\ +ctionalIndexOf");function Mi(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 l(f,y){return s===1?f[y]:f.readUInt16BE(y*s)}a(l,"read");let c;if(i){let f=-1;for(c= -t;co&&(t=o-u),c=t;c>=0;c--){let f=!0;for(let y=0;yo&&(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 Ga(this,e,t,n);case"utf8":case"\ -utf-8":return Va(this,e,t,n);case"ascii":case"latin1":case"binary":return Ka(this,e,t,n);case"base64": -return za(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ya(this,e,t,n);default: +fer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return Ka(this,e,t,n);case"utf8":case"\ +utf-8":return za(this,e,t,n);case"ascii":case"latin1":case"binary":return Ya(this,e,t,n);case"base64": +return Ja(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Za(this,e,t,n);default: if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"write");d.prototype. toJSON=a(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSO\ -N");function Ja(r,e,t){return e===0&&t===r.length?br.fromByteArray(r):br.fromByteArray(r.slice(e,t))} -a(Ja,"base64Slice");function qi(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 l,c,f,y;switch(u){case 1:s<128&&(o=s);break;case 2:l=r[i+ -1],(l&192)===128&&(y=(s&31)<<6|l&63,y>127&&(o=y));break;case 3:l=r[i+1],c=r[i+2],(l&192)===128&&(c&192)=== -128&&(y=(s&15)<<12|(l&63)<<6|c&63,y>2047&&(y<55296||y>57343)&&(o=y));break;case 4:l=r[i+1],c=r[i+2], -f=r[i+3],(l&192)===128&&(c&192)===128&&(f&192)===128&&(y=(s&15)<<18|(l&63)<<12|(c&63)<<6|f&63,y>65535&& +N");function Xa(r,e,t){return e===0&&t===r.length?Sr.fromByteArray(r):Sr.fromByteArray(r.slice(e,t))} +a(Xa,"base64Slice");function ji(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 Za(n)}a(qi,"utf8Slice");var Mi=4096;function Za(r){let e=r.length;if(e<=Mi)return String. +n.push(o),i+=u}return eu(n)}a(ji,"utf8Slice");var Ui=4096;function eu(r){let e=r.length;if(e<=Ui)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,d.prototype),i},"slice");function G(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 \ @@ -166,10 +166,10 @@ a(function(e,t){return e=e>>>0,t||G(e,2,this.length),this[e]<<8|this[e+1]},"read readUint32LE=d.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),(this[e]| this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");d.prototype.readUint32BE=d.prototype. readUInt32BE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+ -2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Re(a(function(e){e=e>>>0,Ve(e,"offset"); +2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Re(a(function(e){e=e>>>0,Ke(e,"offset"); let t=this[e],n=this[e+7];(t===void 0||n===void 0)&<(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* 2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<< -BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Re(a(function(e){e=e>>>0,Ve(e,"offset"); +BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Re(a(function(e){e=e>>>0,Ke(e,"offset"); let t=this[e],n=this[e+7];(t===void 0||n===void 0)&<(e,this.length-8);let i=t*2**24+this[++e]*2**16+ this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<>>0,t=t>>>0,n||G(e,t, @@ -183,16 +183,16 @@ a(function(e,t){e=e>>>0,t||G(e,2,this.length);let n=this[e+1]|this[e]<<8;return n},"readInt16BE");d.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]| this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");d.prototype.readInt32BE=a(function(e,t){return e= e>>>0,t||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");d.prototype. -readBigInt64LE=Re(a(function(e){e=e>>>0,Ve(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& +readBigInt64LE=Re(a(function(e){e=e>>>0,Ke(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& lt(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,Ve(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&<(e,this. +Re(a(function(e){e=e>>>0,Ke(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&<(e,this. length-8);let i=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,t||G(e,4,this.length),Ge.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= -a(function(e,t){return e=e>>>0,t||G(e,4,this.length),Ge.read(this,e,!1,23,4)},"readFloatBE");d.prototype. -readDoubleLE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ge.read(this,e,!0,52,8)},"readDoub\ -leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ge.read(this,e, +return e=e>>>0,t||G(e,4,this.length),Ve.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= +a(function(e,t){return e=e>>>0,t||G(e,4,this.length),Ve.read(this,e,!1,23,4)},"readFloatBE");d.prototype. +readDoubleLE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ve.read(this,e,!0,52,8)},"readDoub\ +leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ve.read(this,e, !1,52,8)},"readDoubleBE");function re(r,e,t,n,i,s){if(!d.isBuffer(r))throw new TypeError('"buffer" a\ rgument must be a Buffer instance');if(e>i||er.length)throw new RangeError("Index out of range")}a(re,"checkInt");d.prototype.writeUintLE= @@ -208,18 +208,18 @@ e>>>8,t+2},"writeUInt16LE");d.prototype.writeUint16BE=d.prototype.writeUInt16BE= writeUint32LE=d.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||re(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");d.prototype. writeUint32BE=d.prototype.writeUInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||re(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 Qi(r,e,t,n,i){ -Gi(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 Wi(r,e,t,n,i){ +Ki(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(Qi,"wrtBigUInt64LE");function ji(r,e,t,n,i){Gi(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295)); +8,r[t++]=o,t}a(Wi,"wrtBigUInt64LE");function Hi(r,e,t,n,i){Ki(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(ji,"wrtBigUInt64BE");d.prototype. -writeBigUInt64LE=Re(a(function(e,t=0){return Qi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ -riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Re(a(function(e,t=0){return ji(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(Hi,"wrtBigUInt64BE");d.prototype. +writeBigUInt64LE=Re(a(function(e,t=0){return Wi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ +riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Re(a(function(e,t=0){return Hi(this,e,t,BigInt(0),BigInt( "0xffffffffffffffff"))},"writeBigUInt64BE"));d.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>> -0,!i){let l=Math.pow(2,8*n-1);re(this,e,t,n,l-1,-l)}let s=0,o=1,u=0;for(this[t]=e&255;++s>0)-u&255;return t+n},"writeIntLE");d.prototype.writeIntBE= -a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let l=Math.pow(2,8*n-1);re(this,e,t,n,l-1,-l)}let s=n-1,o=1, +a(function(e,t,n,i){if(e=+e,t=t>>>0,!i){let c=Math.pow(2,8*n-1);re(this,e,t,n,c-1,-c)}let s=n-1,o=1, u=0;for(this[t+s]=e&255;--s>=0&&(o*=256);)e<0&&u===0&&this[t+s+1]!==0&&(u=1),this[t+s]=(e/o>>0)-u&255; return t+n},"writeIntBE");d.prototype.writeInt8=a(function(e,t,n){return e=+e,t=t>>>0,n||re(this,e,t, 1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},"writeInt8");d.prototype.writeInt16LE=a(function(e,t,n){ @@ -229,17 +229,17 @@ e>>>8,this[t+1]=e&255,t+2},"writeInt16BE");d.prototype.writeInt32LE=a(function(e t>>>0,n||re(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+ 3]=e>>>24,t+4},"writeInt32LE");d.prototype.writeInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||re( 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");d.prototype.writeBigInt64LE=Re(a(function(e,t=0){return Qi( +e>>>8,this[t+3]=e&255,t+4},"writeInt32BE");d.prototype.writeBigInt64LE=Re(a(function(e,t=0){return Wi( this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));d.prototype. -writeBigInt64BE=Re(a(function(e,t=0){return ji(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ -ffffffffffff"))},"writeBigInt64BE"));function Wi(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(Wi,"checkIEEE754");function Hi(r,e,t,n,i){ -return e=+e,t=t>>>0,i||Wi(r,e,t,4,34028234663852886e22,-34028234663852886e22),Ge.write(r,e,t,n,23,4), -t+4}a(Hi,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return Hi(this,e,t,!0,n)},"writeFl\ -oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return Hi(this,e,t,!1,n)},"writeFloatBE");function $i(r,e,t,n,i){ -return e=+e,t=t>>>0,i||Wi(r,e,t,8,17976931348623157e292,-17976931348623157e292),Ge.write(r,e,t,n,52, -8),t+8}a($i,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return $i(this,e,t,!0,n)},"wr\ -iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return $i(this,e,t,!1,n)},"writeDoubleBE"); +writeBigInt64BE=Re(a(function(e,t=0){return Hi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ +ffffffffffff"))},"writeBigInt64BE"));function $i(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($i,"checkIEEE754");function Gi(r,e,t,n,i){ +return e=+e,t=t>>>0,i||$i(r,e,t,4,34028234663852886e22,-34028234663852886e22),Ve.write(r,e,t,n,23,4), +t+4}a(Gi,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return Gi(this,e,t,!0,n)},"writeFl\ +oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return Gi(this,e,t,!1,n)},"writeFloatBE");function Vi(r,e,t,n,i){ +return e=+e,t=t>>>0,i||$i(r,e,t,8,17976931348623157e292,-17976931348623157e292),Ve.write(r,e,t,n,52, +8),t+8}a(Vi,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return Vi(this,e,t,!0,n)},"wr\ +iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return Vi(this,e,t,!1,n)},"writeDoubleBE"); d.prototype.copy=a(function(e,t,n,i){if(!d.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=ki(String(t)):typeof t=="bigint"&&(i=String( -t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=ki(i)),i+="n"),n+=` It must be ${e}. Re\ -ceived ${i}`,n},RangeError);function ki(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(ki,"addNumericalSeparator");function nu(r,e,t){ -Ve(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&<(e,r.length-(t+1))}a(nu,"checkBounds");function Gi(r,e,t,n,i,s){ +e ${typeof e}`},TypeError);Ir("ERR_OUT_OF_RANGE",function(r,e,t){let n=`The value of "${r}" is out o\ +f range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=Di(String(t)):typeof t=="bigint"&&(i=String( +t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Di(i)),i+="n"),n+=` It must be ${e}. Re\ +ceived ${i}`,n},RangeError);function Di(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(Di,"addNumericalSeparator");function su(r,e,t){ +Ke(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&<(e,r.length-(t+1))}a(su,"checkBounds");function Ki(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 $e.ERR_OUT_OF_RANGE("value",u,r)}nu(n,i,s)}a(Gi,"checkIntBI");function Ve(r,e){if(typeof r!= -"number")throw new $e.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Ve,"validateNumber");function lt(r,e,t){throw Math. -floor(r)!==r?(Ve(r,t),new $e.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new $e.ERR_BUFFER_OUT_OF_BOUNDS: -new $e.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(lt,"boundsError");var iu=/[^+/0-9A-Za-z-_]/g; -function su(r){if(r=r.split("=")[0],r=r.trim().replace(iu,""),r.length<2)return"";for(;r.length%4!== -0;)r=r+"=";return r}a(su,"base64clean");function vr(r,e){e=e||1/0;let t,n=r.length,i=null,s=[];for(let o=0;o< +nd <= ${t}${o}`,new Ge.ERR_OUT_OF_RANGE("value",u,r)}su(n,i,s)}a(Ki,"checkIntBI");function Ke(r,e){if(typeof r!= +"number")throw new Ge.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Ke,"validateNumber");function lt(r,e,t){throw Math. +floor(r)!==r?(Ke(r,t),new Ge.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new Ge.ERR_BUFFER_OUT_OF_BOUNDS: +new Ge.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(lt,"boundsError");var ou=/[^+/0-9A-Za-z-_]/g; +function au(r){if(r=r.split("=")[0],r=r.trim().replace(ou,""),r.length<2)return"";for(;r.length%4!== +0;)r=r+"=";return r}a(au,"base64clean");function Ar(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(vr,"utf\ -8ToBytes");function ou(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(au,"utf16leToBytes");function Vi(r){return br.toByteArray( -su(r))}a(Vi,"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 xe(r,e){return r instanceof e||r!=null&&r.constructor!= -null&&r.constructor.name!=null&&r.constructor.name===e.name}a(xe,"isInstance");function Cr(r){return r!== -r}a(Cr,"numberIsNaN");var uu=function(){let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){ +240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}a(Ar,"utf\ +8ToBytes");function uu(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(cu,"utf16leToBytes");function zi(r){return Sr.toByteArray( +au(r))}a(zi,"base64ToBytes");function Ot(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) +e[i+t]=r[i];return i}a(Ot,"blitBuffer");function be(r,e){return r instanceof e||r!=null&&r.constructor!= +null&&r.constructor.name!=null&&r.constructor.name===e.name}a(be,"isInstance");function Tr(r){return r!== +r}a(Tr,"numberIsNaN");var lu=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 Re(r){return typeof BigInt>"u"? -lu:r}a(Re,"defineBigIntMethod");function lu(){throw new Error("BigInt not supported")}a(lu,"BufferBi\ +fu:r}a(Re,"defineBigIntMethod");function fu(){throw new Error("BigInt not supported")}a(fu,"BufferBi\ gIntNotDefined")});var S,v,A,m,w,p=te(()=>{"use strict";S=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),A= globalThis.clearImmediate??(r=>clearTimeout(r)),m=typeof globalThis.Buffer=="function"&&typeof globalThis. -Buffer.allocUnsafe=="function"?globalThis.Buffer:Ki().Buffer,w=globalThis.process??{};w.env??(w.env= -{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Pe=P((eh,Ir)=>{"use strict";p();var ze=typeof Reflect=="object"?Reflect:null,zi=ze&&typeof ze.apply== -"function"?ze.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Ot; -ze&&typeof ze.ownKeys=="function"?Ot=ze.ownKeys:Object.getOwnPropertySymbols?Ot=a(function(e){return Object. -getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Ot=a(function(e){return Object. -getOwnPropertyNames(e)},"ReflectOwnKeys");function cu(r){console&&console.warn&&console.warn(r)}a(cu, -"ProcessEmitWarning");var Ji=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function k(){k. -init.call(this)}a(k,"EventEmitter");Ir.exports=k;Ir.exports.once=pu;k.EventEmitter=k;k.prototype._events= -void 0;k.prototype._eventsCount=0;k.prototype._maxListeners=void 0;var Yi=10;function Nt(r){if(typeof r!= +Buffer.allocUnsafe=="function"?globalThis.Buffer:Yi().Buffer,w=globalThis.process??{};w.env??(w.env= +{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Pe=P((rh,Rr)=>{"use strict";p();var Ye=typeof Reflect=="object"?Reflect:null,Ji=Ye&&typeof Ye.apply== +"function"?Ye.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Nt; +Ye&&typeof Ye.ownKeys=="function"?Nt=Ye.ownKeys:Object.getOwnPropertySymbols?Nt=a(function(e){return Object. +getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Nt=a(function(e){return Object. +getOwnPropertyNames(e)},"ReflectOwnKeys");function hu(r){console&&console.warn&&console.warn(r)}a(hu, +"ProcessEmitWarning");var Xi=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function k(){k. +init.call(this)}a(k,"EventEmitter");Rr.exports=k;Rr.exports.once=mu;k.EventEmitter=k;k.prototype._events= +void 0;k.prototype._eventsCount=0;k.prototype._maxListeners=void 0;var Zi=10;function qt(r){if(typeof r!= "function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)} -a(Nt,"checkListener");Object.defineProperty(k,"defaultMaxListeners",{enumerable:!0,get:a(function(){ -return Yi},"get"),set:a(function(r){if(typeof r!="number"||r<0||Ji(r))throw new RangeError('The valu\ -e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Yi=r}, +a(qt,"checkListener");Object.defineProperty(k,"defaultMaxListeners",{enumerable:!0,get:a(function(){ +return Zi},"get"),set:a(function(r){if(typeof r!="number"||r<0||Xi(r))throw new RangeError('The valu\ +e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Zi=r}, "set")});k.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}; -k.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||Ji(e))throw new RangeError('Th\ +k.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||Xi(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 Zi(r){return r._maxListeners===void 0?k.defaultMaxListeners:r._maxListeners} -a(Zi,"_getMaxListeners");k.prototype.getMaxListeners=a(function(){return Zi(this)},"getMaxListeners"); +e,this},"setMaxListeners");function es(r){return r._maxListeners===void 0?k.defaultMaxListeners:r._maxListeners} +a(es,"_getMaxListeners");k.prototype.getMaxListeners=a(function(){return es(this)},"getMaxListeners"); k.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 l=s[e];if(l===void 0)return!1;if(typeof l=="function")zi(l,this,t);else for(var c=l. -length,f=ns(l,c),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=es(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,cu(u)}return r}a(Xi,"_addListener");k.prototype.addListener=a(function(e,t){ -return Xi(this,e,t,!1)},"addListener");k.prototype.on=k.prototype.addListener;k.prototype.prependListener= -a(function(e,t){return Xi(this,e,t,!0)},"prependListener");function fu(){if(!this.fired)return this. +r,u.type=e,u.count=o.length,hu(u)}return r}a(ts,"_addListener");k.prototype.addListener=a(function(e,t){ +return ts(this,e,t,!1)},"addListener");k.prototype.on=k.prototype.addListener;k.prototype.prependListener= +a(function(e,t){return ts(this,e,t,!0)},"prependListener");function du(){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(fu,"onceWrapper");function es(r,e,t){var n={fired:!1, -wrapFn:void 0,target:r,type:e,listener:t},i=fu.bind(n);return i.listener=t,n.wrapFn=i,i}a(es,"_onceW\ -rap");k.prototype.once=a(function(e,t){return Nt(t),this.on(e,es(this,e,t)),this},"once");k.prototype. -prependOnceListener=a(function(e,t){return Nt(t),this.prependListener(e,es(this,e,t)),this},"prepend\ -OnceListener");k.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(Nt(t),i=this._events,i=== +target):this.listener.apply(this.target,arguments)}a(du,"onceWrapper");function rs(r,e,t){var n={fired:!1, +wrapFn:void 0,target:r,type:e,listener:t},i=du.bind(n);return i.listener=t,n.wrapFn=i,i}a(rs,"_onceW\ +rap");k.prototype.once=a(function(e,t){return qt(t),this.on(e,rs(this,e,t)),this},"once");k.prototype. +prependOnceListener=a(function(e,t){return qt(t),this.prependListener(e,rs(this,e,t)),this},"prepend\ +OnceListener");k.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(qt(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():hu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== +listener,s=o;break}if(s<0)return this;s===0?n.shift():pu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== void 0&&this.emit("removeListener",e,u||t)}return this},"removeListener");k.prototype.off=k.prototype. removeListener;k.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 ts(r,e,t){var n=r._events; +0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function ns(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? -du(i):ns(i,i.length)}a(ts,"_listeners");k.prototype.listeners=a(function(e){return ts(this,e,!0)},"l\ -isteners");k.prototype.rawListeners=a(function(e){return ts(this,e,!1)},"rawListeners");k.listenerCount= -function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):rs.call(r,e)};k.prototype. -listenerCount=rs;function rs(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(rs,"listenerCount");k.prototype.eventNames=a(function(){ -return this._eventsCount>0?Ot(this._events):[]},"eventNames");function ns(r,e){for(var t=new Array(e), -n=0;n0?Nt(this._events):[]},"eventNames");function ss(r,e){for(var t=new Array(e), +n=0;nSe,isIP:()=>mu});function mu(r){return 0}var os,ss,_,Se,Ye=te(()=>{"use \ -strict";p();os=Oe(Pe(),1);a(mu,"isIP");ss=/^[^.]+\./,_=class _ extends os.EventEmitter{constructor(){ +ust be of type EventEmitter. Received type '+typeof r)}a(os,"eventTargetAgnosticAddListener")});var cs={};we(cs,{Socket:()=>xe,isIP:()=>gu});function gu(r){return 0}var us,as,_,xe,Je=te(()=>{"use \ +strict";p();us=Oe(Pe(),1);a(gu,"isIP");as=/^[^.]+\./,_=class _ extends us.EventEmitter{constructor(){ super(...arguments);I(this,"opts",{});I(this,"connecting",!1);I(this,"pending",!0);I(this,"writable", !0);I(this,"encrypted",!1);I(this,"authorized",!1);I(this,"destroyed",!1);I(this,"ws",null);I(this,"\ writeBuffer");I(this,"tlsState",0);I(this,"tlsRead");I(this,"tlsWrite")}static get poolQueryViaFetch(){ @@ -398,24 +398,24 @@ om/neondatabase/serverless/blob/main/CONFIG.md#wsproxy-string--host-string-port- ng");return typeof i=="function"?i(t,n):`${i}?address=${t}:${n}`}setNoDelay(){return this}setKeepAlive(){ return this}ref(){return this}unref(){return this}connect(t,n,i){this.connecting=!0,i&&this.once("co\ nnect",i);let s=a(()=>{this.connecting=!1,this.pending=!1,this.emit("connect"),this.emit("ready")},"\ -handleWebSocketOpen"),o=a((l,c=!1)=>{l.binaryType="arraybuffer",l.addEventListener("error",f=>{this. -emit("error",f),this.emit("close")}),l.addEventListener("message",f=>{if(this.tlsState===0){let y=m. -from(f.data);this.emit("data",y)}}),l.addEventListener("close",()=>{this.emit("close")}),c?s():l.addEventListener( +handleWebSocketOpen"),o=a((c,l=!1)=>{c.binaryType="arraybuffer",c.addEventListener("error",f=>{this. +emit("error",f),this.emit("close")}),c.addEventListener("message",f=>{if(this.tlsState===0){let y=m. +from(f.data);this.emit("data",y)}}),c.addEventListener("close",()=>{this.emit("close")}),l?s():c.addEventListener( "open",s)},"configureWebSocket"),u;try{u=this.wsProxyAddrForHost(n,typeof t=="string"?parseInt(t,10): -t)}catch(l){this.emit("error",l),this.emit("close");return}try{let c=(this.useSecureWebSocket?"wss:": -"ws:")+"//"+u;if(this.webSocketConstructor!==void 0)this.ws=new this.webSocketConstructor(c),o(this. -ws);else try{this.ws=new WebSocket(c),o(this.ws)}catch{this.ws=new __unstable_WebSocket(c),o(this.ws)}}catch(l){ +t)}catch(c){this.emit("error",c),this.emit("close");return}try{let l=(this.useSecureWebSocket?"wss:": +"ws:")+"//"+u;if(this.webSocketConstructor!==void 0)this.ws=new this.webSocketConstructor(l),o(this. +ws);else try{this.ws=new WebSocket(l),o(this.ws)}catch{this.ws=new __unstable_WebSocket(l),o(this.ws)}}catch(c){ let f=(this.useSecureWebSocket?"https:":"http:")+"//"+u;fetch(f,{headers:{Upgrade:"websocket"}}).then( -y=>{if(this.ws=y.webSocket,this.ws==null)throw l;this.ws.accept(),o(this.ws,!0)}).catch(y=>{this.emit( +y=>{if(this.ws=y.webSocket,this.ws==null)throw c;this.ws.accept(),o(this.ws,!0)}).catch(y=>{this.emit( "error",new Error(`All attempts to open a WebSocket to connect to the database failed. Please refer \ to https://github.com/neondatabase/serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websoc\ ket--undefined. Details: ${y}`)),this.emit("close")})}}async startTls(t){if(this.subtls===void 0)throw new Error( "For Postgres SSL connections, you must set `neonConfig.subtls` to the subtls library. See https://g\ ithub.com/neondatabase/serverless/blob/main/CONFIG.md for more information.");this.tlsState=1;let n=await this. subtls.TrustedCert.databaseFromPEM(this.rootCerts),i=new this.subtls.WebSocketReadQueue(this.ws),s=i. -read.bind(i),o=this.rawWrite.bind(this),{read:u,write:l}=await this.subtls.startTls(t,n,s,o,{useSNI:!this. +read.bind(i),o=this.rawWrite.bind(this),{read:u,write:c}=await this.subtls.startTls(t,n,s,o,{useSNI:!this. disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead=u,this.tlsWrite= -l,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){ +c,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){ for(;;){let t=await this.tlsRead();if(t===void 0)break;{let n=m.from(t);this.emit("data",n)}}}rawWrite(t){ if(!this.coalesceWrites){this.ws&&this.ws.send(t);return}if(this.writeBuffer===void 0)this.writeBuffer= t,setTimeout(()=>{this.ws&&this.ws.send(this.writeBuffer),this.writeBuffer=void 0},0);else{let n=new Uint8Array( @@ -424,151 +424,151 @@ 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=m.alloc(0),n="utf8",i=()=>{}){return this.write(t,n,()=>{this. ws.close(),i()}),this}destroy(){return this.destroyed=!0,this.end()}};a(_,"Socket"),I(_,"defaults",{ -poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{let s;return i?.jwtAuth?s=t.replace(ss,"apiauth."):s= -t.replace(ss,"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(as,"apiauth."):s= +t.replace(as,"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}),I(_,"opts",{});Se=_});var us={};ge(us,{parse:()=>Tr});function Tr(r,e=!1){let{protocol:t}=new URL(r),n="http:"+r.substring( -t.length),{username:i,password:s,host:o,hostname:u,port:l,pathname:c,search:f,searchParams:y,hash:g}=new URL( -n);s=decodeURIComponent(s),i=decodeURIComponent(i),c=decodeURIComponent(c);let E=i+":"+s,C=e?Object. -fromEntries(y.entries()):f;return{href:r,protocol:t,auth:E,username:i,password:s,host:o,hostname:u,port:l, -pathname:c,search:f,query:C,hash:g}}var Rr=te(()=>{"use strict";p();a(Tr,"parse")});var $r=P(Is=>{"use strict";p();Is.parse=function(r,e){return new Hr(r,e).parse()};var zt=class zt{constructor(e,t){ -this.source=e,this.transform=t||ju,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){ +disableWarningInBrowsers:!1}),I(_,"opts",{});xe=_});var ls={};we(ls,{parse:()=>Pr});function Pr(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 E=i+":"+s,C=e?Object. +fromEntries(y.entries()):f;return{href:r,protocol:t,auth:E,username:i,password:s,host:o,hostname:u,port:c, +pathname:l,search:f,query:C,hash:g}}var Br=te(()=>{"use strict";p();a(Pr,"parse")});var Vr=P(Rs=>{"use strict";p();Rs.parse=function(r,e){return new Gr(r,e).parse()};var Yt=class Yt{constructor(e,t){ +this.source=e,this.transform=t||Hu,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 zt(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse( +dimension>1&&(n=new Yt(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(zt,"ArrayParser");var Hr=zt;function ju(r){return r}a(ju,"ide\ -ntity")});var Gr=P((_h,Ts)=>{p();var Wu=$r();Ts.exports={create:a(function(r,e){return{parse:a(function(){return Wu. -parse(r,e)},"parse")}},"create")}});var Bs=P((Th,Ps)=>{"use strict";p();var Hu=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, -$u=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Gu=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Vu=/^-?infinity$/;Ps. -exports=a(function(e){if(Vu.test(e))return Number(e.replace("i","I"));var t=Hu.exec(e);if(!t)return Ku( -e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Rs(i));var s=parseInt(t[2],10)-1,o=t[3],u=parseInt(t[4], -10),l=parseInt(t[5],10),c=parseInt(t[6],10),f=t[7];f=f?1e3*parseFloat(f):0;var y,g=zu(e);return g!=null? -(y=new Date(Date.UTC(i,s,o,u,l,c,f)),Vr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= -new Date(i,s,o,u,l,c,f),Vr(i)&&y.setFullYear(i)),y},"parseDate");function Ku(r){var e=$u.exec(r);if(e){ -var t=parseInt(e[1],10),n=!!e[4];n&&(t=Rs(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return Vr( -t)&&o.setFullYear(t),o}}a(Ku,"getDate");function zu(r){if(r.endsWith("+00"))return 0;var e=Gu.exec(r. +not balanced");return this.entries}};a(Yt,"ArrayParser");var Gr=Yt;function Hu(r){return r}a(Hu,"ide\ +ntity")});var Kr=P((Ih,Ps)=>{p();var $u=Vr();Ps.exports={create:a(function(r,e){return{parse:a(function(){return $u. +parse(r,e)},"parse")}},"create")}});var Fs=P((Ph,Ls)=>{"use strict";p();var Gu=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, +Vu=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Ku=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,zu=/^-?infinity$/;Ls. +exports=a(function(e){if(zu.test(e))return Number(e.replace("i","I"));var t=Gu.exec(e);if(!t)return Yu( +e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Bs(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=Ju(e);return g!=null? +(y=new Date(Date.UTC(i,s,o,u,c,l,f)),zr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= +new Date(i,s,o,u,c,l,f),zr(i)&&y.setFullYear(i)),y},"parseDate");function Yu(r){var e=Vu.exec(r);if(e){ +var t=parseInt(e[1],10),n=!!e[4];n&&(t=Bs(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return zr( +t)&&o.setFullYear(t),o}}a(Yu,"getDate");function Ju(r){if(r.endsWith("+00"))return 0;var e=Ku.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(zu,"timeZoneOffset");function Rs(r){return-(r- -1)}a(Rs,"bcYearToNegativeYear");function Vr(r){return r>=0&&r<100}a(Vr,"is0To99")});var Fs=P((Bh,Ls)=>{p();Ls.exports=Ju;var Yu=Object.prototype.hasOwnProperty;function Ju(r){for(var e=1;e< -arguments.length;e++){var t=arguments[e];for(var n in t)Yu.call(t,n)&&(r[n]=t[n])}return r}a(Ju,"ext\ -end")});var Us=P((Mh,ks)=>{"use strict";p();var Zu=Fs();ks.exports=tt;function tt(r){if(!(this instanceof tt)) -return new tt(r);Zu(this,cl(r))}a(tt,"PostgresInterval");var Xu=["seconds","minutes","hours","days", -"months","years"];tt.prototype.toPostgres=function(){var r=Xu.filter(this.hasOwnProperty,this);return this. +e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(Ju,"timeZoneOffset");function Bs(r){return-(r- +1)}a(Bs,"bcYearToNegativeYear");function zr(r){return r>=0&&r<100}a(zr,"is0To99")});var Ms=P((Fh,ks)=>{p();ks.exports=Xu;var Zu=Object.prototype.hasOwnProperty;function Xu(r){for(var e=1;e< +arguments.length;e++){var t=arguments[e];for(var n in t)Zu.call(t,n)&&(r[n]=t[n])}return r}a(Xu,"ext\ +end")});var Os=P((Uh,Ds)=>{"use strict";p();var ec=Ms();Ds.exports=rt;function rt(r){if(!(this instanceof rt)) +return new rt(r);ec(this,hc(r))}a(rt,"PostgresInterval");var tc=["seconds","minutes","hours","days", +"months","years"];rt.prototype.toPostgres=function(){var r=tc.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 el={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ -S"},tl=["years","months","days"],rl=["hours","minutes","seconds"];tt.prototype.toISOString=tt.prototype. -toISO=function(){var r=tl.map(t,this).join(""),e=rl.map(t,this).join("");return"P"+r+"T"+e;function t(n){ +"")),t+" "+e},this).join(" ")};var rc={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ +S"},nc=["years","months","days"],ic=["hours","minutes","seconds"];rt.prototype.toISOString=rt.prototype. +toISO=function(){var r=nc.map(t,this).join(""),e=ic.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+el[n]}};var Kr="([+-]?\\d+)",nl=Kr+"\\s+years?",il=Kr+"\\s+mons?",sl=Kr+"\\s+days?",ol="\ -([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",al=new RegExp([nl,il,sl,ol].map(function(r){return"\ -("+r+")?"}).join("\\s*")),Ms={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, -ul=["hours","minutes","seconds","milliseconds"];function ll(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}a(ll,"parseMilliseconds");function cl(r){if(!r)return{};var e=al.exec(r),t=e[8]==="-";return Object. -keys(Ms).reduce(function(n,i){var s=Ms[i],o=e[s];return!o||(o=i==="milliseconds"?ll(o):parseInt(o,10), -!o)||(t&&~ul.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(cl,"parse")});var Os=P((Dh,Ds)=>{"use strict";p();Ds.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( +/0+$/,"")),i+rc[n]}};var Yr="([+-]?\\d+)",sc=Yr+"\\s+years?",oc=Yr+"\\s+mons?",ac=Yr+"\\s+days?",uc="\ +([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",cc=new RegExp([sc,oc,ac,uc].map(function(r){return"\ +("+r+")?"}).join("\\s*")),Us={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, +lc=["hours","minutes","seconds","milliseconds"];function fc(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(fc,"parseMilliseconds");function hc(r){if(!r)return{};var e=cc.exec(r),t=e[8]==="-";return Object. +keys(Us).reduce(function(n,i){var s=Us[i],o=e[s];return!o||(o=i==="milliseconds"?fc(o):parseInt(o,10), +!o)||(t&&~lc.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(hc,"parse")});var qs=P((Nh,Ns)=>{"use strict";p();Ns.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( 2),"hex");for(var t="",n=0;n{p();var gt=$r(),bt=Gr(),Yt=Bs(),qs=Us(),Qs=Os();function Jt(r){return a(function(t){ -return t===null?t:r(t)},"nullAllowed")}a(Jt,"allowNull");function js(r){return r===null?r:r==="TRUE"|| -r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(js,"parseBool");function fl(r){return r? -gt.parse(r,js):null}a(fl,"parseBoolArray");function hl(r){return parseInt(r,10)}a(hl,"parseBaseTenIn\ -t");function zr(r){return r?gt.parse(r,Jt(hl)):null}a(zr,"parseIntegerArray");function dl(r){return r? -gt.parse(r,Jt(function(e){return Ws(e).trim()})):null}a(dl,"parseBigIntegerArray");var pl=a(function(r){ -if(!r)return null;var e=bt.create(r,function(t){return t!==null&&(t=Xr(t)),t});return e.parse()},"pa\ -rsePointArray"),Yr=a(function(r){if(!r)return null;var e=bt.create(r,function(t){return t!==null&&(t= -parseFloat(t)),t});return e.parse()},"parseFloatArray"),de=a(function(r){if(!r)return null;var e=bt. -create(r);return e.parse()},"parseStringArray"),Jr=a(function(r){if(!r)return null;var e=bt.create(r, -function(t){return t!==null&&(t=Yt(t)),t});return e.parse()},"parseDateArray"),yl=a(function(r){if(!r) -return null;var e=bt.create(r,function(t){return t!==null&&(t=qs(t)),t});return e.parse()},"parseInt\ -ervalArray"),ml=a(function(r){return r?gt.parse(r,Jt(Qs)):null},"parseByteAArray"),Zr=a(function(r){ -return parseInt(r,10)},"parseInteger"),Ws=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ -parseBigInteger"),Ns=a(function(r){return r?gt.parse(r,Jt(JSON.parse)):null},"parseJsonArray"),Xr=a( +parseBytea")});var Vs=P((jh,Gs)=>{p();var bt=Vr(),xt=Kr(),Jt=Fs(),js=Os(),Ws=qs();function Zt(r){return a(function(t){ +return t===null?t:r(t)},"nullAllowed")}a(Zt,"allowNull");function Hs(r){return r===null?r:r==="TRUE"|| +r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(Hs,"parseBool");function dc(r){return r? +bt.parse(r,Hs):null}a(dc,"parseBoolArray");function pc(r){return parseInt(r,10)}a(pc,"parseBaseTenIn\ +t");function Jr(r){return r?bt.parse(r,Zt(pc)):null}a(Jr,"parseIntegerArray");function yc(r){return r? +bt.parse(r,Zt(function(e){return $s(e).trim()})):null}a(yc,"parseBigIntegerArray");var mc=a(function(r){ +if(!r)return null;var e=xt.create(r,function(t){return t!==null&&(t=tn(t)),t});return e.parse()},"pa\ +rsePointArray"),Zr=a(function(r){if(!r)return null;var e=xt.create(r,function(t){return t!==null&&(t= +parseFloat(t)),t});return e.parse()},"parseFloatArray"),de=a(function(r){if(!r)return null;var e=xt. +create(r);return e.parse()},"parseStringArray"),Xr=a(function(r){if(!r)return null;var e=xt.create(r, +function(t){return t!==null&&(t=Jt(t)),t});return e.parse()},"parseDateArray"),wc=a(function(r){if(!r) +return null;var e=xt.create(r,function(t){return t!==null&&(t=js(t)),t});return e.parse()},"parseInt\ +ervalArray"),gc=a(function(r){return r?bt.parse(r,Zt(Ws)):null},"parseByteAArray"),en=a(function(r){ +return parseInt(r,10)},"parseInteger"),$s=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ +parseBigInteger"),Qs=a(function(r){return r?bt.parse(r,Zt(JSON.parse)):null},"parseJsonArray"),tn=a( function(r){return r[0]!=="("?null:(r=r.substring(1,r.length-1).split(","),{x:parseFloat(r[0]),y:parseFloat( -r[1])})},"parsePoint"),wl=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, +r[1])})},"parsePoint"),bc=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, i=2;i{"use strict";p();var ie=1e6;function bl(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,l,c,f;{if(s=e%ie,e=e/ie>>>0,o=4294967296* -s+t,t=o/ie>>>0,u=""+(o-ie*t),t===0&&e===0)return n+u+i;for(l="",c=6-u.length,f=0;f>>0,o=4294967296*s+t,t=o/ie>>>0,u=""+(o-ie*t),t===0&&e===0)return n+u+i;for(l= -"",c=6-u.length,f=0;f>>0,o=4294967296*s+t,t=o/ie>>>0,u=""+(o- -ie*t),t===0&&e===0)return n+u+i;for(l="",c=6-u.length,f=0;f{p();var xl=Vs(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,W){return E* -Math.pow(2,W)+C};var s=t>>3,o=a(function(E){return n?~E&255:E},"inv"),u=255,l=8-t%8;e>t%8);var c=0;t%8+e>=8&&(c=i(0,o(r[s])&u,l));for(var f=e+t>>3,y=s+1;y0&&(c=i(c,o(r[f])>>8-g,g)),c},"parseBits"),Ys=a(function(r,e,t){var n=Math. -pow(2,t-1)-1,i=U(r,1),s=U(r,t,1);if(s===0)return 0;var o=1,u=a(function(c,f,y){c===0&&(c=1);for(var g=1;g<= -y;g++)o/=2,(f&1<0&&(c+=o);return c},"parsePrecisionBits"),l=U(r,e,t+1,!1,u);return s==Math.pow( -2,t+1)-1?l===0?i===0?1/0:-1/0:NaN:(i===0?1:-1)*Math.pow(2,s-n)*l},"parseFloatFromBits"),Sl=a(function(r){ -return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),Ks=a(function(r){return U(r,1)==1?-1*(U( -r,31,1,!0)+1):U(r,31,1)},"parseInt32"),vl=a(function(r){return Ys(r,23,8)},"parseFloat32"),El=a(function(r){ -return Ys(r,52,11)},"parseFloat64"),Al=a(function(r){var e=U(r,16,32);if(e==49152)return NaN;for(var t=Math. +r[i])}var s=tn(e);return s.radius=parseFloat(t),s},"parseCircle"),xc=a(function(r){r(20,$s),r(21,en), +r(23,en),r(26,en),r(700,parseFloat),r(701,parseFloat),r(16,Hs),r(1082,Jt),r(1114,Jt),r(1184,Jt),r(600, +tn),r(651,de),r(718,bc),r(1e3,dc),r(1001,gc),r(1005,Jr),r(1007,Jr),r(1028,Jr),r(1016,yc),r(1017,mc), +r(1021,Zr),r(1022,Zr),r(1231,Zr),r(1014,de),r(1015,de),r(1008,de),r(1009,de),r(1040,de),r(1041,de),r( +1115,Xr),r(1182,Xr),r(1185,Xr),r(1186,js),r(1187,wc),r(17,Ws),r(114,JSON.parse.bind(JSON)),r(3802,JSON. +parse.bind(JSON)),r(199,Qs),r(3807,Qs),r(3907,de),r(2951,de),r(791,de),r(1183,de),r(1270,de)},"init"); +Gs.exports={init:xc}});var zs=P(($h,Ks)=>{"use strict";p();var ie=1e6;function Sc(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%ie,e=e/ie>>>0,o=4294967296* +s+t,t=o/ie>>>0,u=""+(o-ie*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/ie>>>0,u=""+(o-ie*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/ie>>>0,u=""+(o- +ie*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var vc=zs(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,W){return E* +Math.pow(2,W)+C};var s=t>>3,o=a(function(E){return n?~E&255:E},"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"),Zs=a(function(r,e,t){var n=Math. +pow(2,t-1)-1,i=U(r,1),s=U(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=U(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"),Ec=a(function(r){ +return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),Ys=a(function(r){return U(r,1)==1?-1*(U( +r,31,1,!0)+1):U(r,31,1)},"parseInt32"),Ac=a(function(r){return Zs(r,23,8)},"parseFloat32"),_c=a(function(r){ +return Zs(r,52,11)},"parseFloat64"),Cc=a(function(r){var e=U(r,16,32);if(e==49152)return NaN;for(var t=Math. pow(1e4,U(r,16,16)),n=0,i=[],s=U(r,16),o=0;o>3,(i+=f<<3)>>3),y;console.log("ERROR: ElementType no\ -t implemented: "+c)},"parseElement"),l=a(function(c,f){var y=[],g;if(c.length>1){var E=c.shift();for(g= -0;g0},"parseBool"),Il=a(function(r){r(20,xl),r(21,Sl),r(23,Ks),r(26,Ks),r(1700,Al),r(700,vl), -r(701,El),r(16,Cl),r(1114,zs.bind(null,!1)),r(1184,zs.bind(null,!0)),r(1e3,xt),r(1007,xt),r(1016,xt), -r(1008,xt),r(1009,xt),r(25,_l)},"init");Js.exports={init:Il}});var eo=P((zh,Xs)=>{p();Xs.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25, +usec=s},i.getUTCMicroSeconds=function(){return this.usec},i},"parseDate"),St=a(function(r){for(var e=U( +r,32),t=U(r,32,32),n=U(r,32,64),i=96,s=[],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 E=l.shift();for(g= +0;g0},"parseBool"),Rc=a(function(r){r(20,vc),r(21,Ec),r(23,Ys),r(26,Ys),r(1700,Cc),r(700,Ac), +r(701,_c),r(16,Tc),r(1114,Js.bind(null,!1)),r(1184,Js.bind(null,!0)),r(1e3,St),r(1007,St),r(1016,St), +r(1008,St),r(1009,St),r(25,Ic)},"init");Xs.exports={init:Rc}});var ro=P((Jh,to)=>{p();to.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 Et=P(vt=>{p();var Tl=$s(),Rl=Zs(),Pl=Gr(),Bl=eo();vt.getTypeParser=Ll;vt.setTypeParser=Fl;vt.arrayParser= -Pl;vt.builtins=Bl;var St={text:{},binary:{}};function to(r){return String(r)}a(to,"noParse");function Ll(r,e){ -return e=e||"text",St[e]&&St[e][r]||to}a(Ll,"getTypeParser");function Fl(r,e,t){typeof e=="function"&& -(t=e,e="text"),St[e][r]=t}a(Fl,"setTypeParser");Tl.init(function(r,e){St.text[r]=e});Rl.init(function(r,e){ -St.binary[r]=e})});var Xt=P((ed,ro)=>{"use strict";p();var Ml=Et();function Zt(r){this._types=r||Ml,this.text={},this.binary= -{}}a(Zt,"TypeOverrides");Zt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ -binary":return this.binary;default:return{}}};Zt.prototype.setTypeParser=function(r,e,t){typeof e=="\ -function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Zt.prototype.getTypeParser=function(r,e){return e= -e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};ro.exports=Zt});function At(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119,o=2600822924,u=528734635, -l=1541459225,c=0,f=0,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748, +REGROLE:4096}});var At=P(Et=>{p();var Pc=Vs(),Bc=eo(),Lc=Kr(),Fc=ro();Et.getTypeParser=kc;Et.setTypeParser=Mc;Et.arrayParser= +Lc;Et.builtins=Fc;var vt={text:{},binary:{}};function no(r){return String(r)}a(no,"noParse");function kc(r,e){ +return e=e||"text",vt[e]&&vt[e][r]||no}a(kc,"getTypeParser");function Mc(r,e,t){typeof e=="function"&& +(t=e,e="text"),vt[e][r]=t}a(Mc,"setTypeParser");Pc.init(function(r,e){vt.text[r]=e});Bc.init(function(r,e){ +vt.binary[r]=e})});var er=P((rd,io)=>{"use strict";p();var Uc=At();function Xt(r){this._types=r||Uc,this.text={},this.binary= +{}}a(Xt,"TypeOverrides");Xt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ +binary":return this.binary;default:return{}}};Xt.prototype.setTypeParser=function(r,e,t){typeof e=="\ +function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Xt.prototype.getTypeParser=function(r,e){return e= +e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};io.exports=Xt});function _t(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, 3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700, 1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909, 275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222, 2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=a((T,b)=>T>>>b|T<<32- -b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),W=a(()=>{for(let F=0,J=0;F<16;F++,J+=4)E[F]=C[J]<< -24|C[J+1]<<16|C[J+2]<<8|C[J+3];for(let F=16;F<64;F++){let J=g(E[F-15],7)^g(E[F-15],18)^E[F-15]>>>3,ve=g( -E[F-2],17)^g(E[F-2],19)^E[F-2]>>>10;E[F]=E[F-16]+J+E[F-7]+ve|0}let T=e,b=t,M=n,oe=i,H=s,we=o,Ce=u,ue=l; -for(let F=0;F<64;F++){let J=g(H,6)^g(H,11)^g(H,25),ve=H&we^~H&Ce,Ie=ue+J+ve+y[F]+E[F]|0,Me=g(T,2)^g( -T,13)^g(T,22),ke=T&b^T&M^b&M,Ue=Me+ke|0;ue=Ce,Ce=we,we=H,H=oe+Ie|0,oe=M,M=b,b=T,T=Ie+Ue|0}e=e+T|0,t= -t+b|0,n=n+M|0,i=i+oe|0,s=s+H|0,o=o+we|0,u=u+Ce|0,l=l+ue|0,f=0},"process"),Y=a(T=>{typeof T=="string"&& -(T=new TextEncoder().encode(T));for(let b=0;b{if(C[f++]=128,f==64&&W(),f+8>64){for(;f<64;)C[f++]=0;W()}for(;f<58;)C[f++]=0;let T=c*8;C[f++]= +b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),W=a(()=>{for(let M=0,Z=0;M<16;M++,Z+=4)E[M]=C[Z]<< +24|C[Z+1]<<16|C[Z+2]<<8|C[Z+3];for(let M=16;M<64;M++){let Z=g(E[M-15],7)^g(E[M-15],18)^E[M-15]>>>3,Se=g( +E[M-2],17)^g(E[M-2],19)^E[M-2]>>>10;E[M]=E[M-16]+Z+E[M-7]+Se|0}let T=e,b=t,F=n,ae=i,H=s,me=o,Ce=u,ce=c; +for(let M=0;M<64;M++){let Z=g(H,6)^g(H,11)^g(H,25),Se=H&me^~H&Ce,Ie=ce+Z+Se+y[M]+E[M]|0,ke=g(T,2)^g( +T,13)^g(T,22),Me=T&b^T&F^b&F,Ue=ke+Me|0;ce=Ce,Ce=me,me=H,H=ae+Ie|0,ae=F,F=b,b=T,T=Ie+Ue|0}e=e+T|0,t= +t+b|0,n=n+F|0,i=i+ae|0,s=s+H|0,o=o+me|0,u=u+Ce|0,c=c+ce|0,f=0},"process"),J=a(T=>{typeof T=="string"&& +(T=new TextEncoder().encode(T));for(let b=0;b{if(C[f++]=128,f==64&&W(),f+8>64){for(;f<64;)C[f++]=0;W()}for(;f<58;)C[f++]=0;let T=l*8;C[f++]= T/1099511627776&255,C[f++]=T/4294967296&255,C[f++]=T>>>24,C[f++]=T>>>16&255,C[f++]=T>>>8&255,C[f++]= T&255,W();let b=new Uint8Array(32);return b[0]=e>>>24,b[1]=e>>>16&255,b[2]=e>>>8&255,b[3]=e&255,b[4]= t>>>24,b[5]=t>>>16&255,b[6]=t>>>8&255,b[7]=t&255,b[8]=n>>>24,b[9]=n>>>16&255,b[10]=n>>>8&255,b[11]=n& 255,b[12]=i>>>24,b[13]=i>>>16&255,b[14]=i>>>8&255,b[15]=i&255,b[16]=s>>>24,b[17]=s>>>16&255,b[18]=s>>> 8&255,b[19]=s&255,b[20]=o>>>24,b[21]=o>>>16&255,b[22]=o>>>8&255,b[23]=o&255,b[24]=u>>>24,b[25]=u>>>16& -255,b[26]=u>>>8&255,b[27]=u&255,b[28]=l>>>24,b[29]=l>>>16&255,b[30]=l>>>8&255,b[31]=l&255,b},"digest"); -return r===void 0?{add:Y,digest:me}:(Y(r),me())}var no=te(()=>{"use strict";p();a(At,"sha256")});var Q,_t,io=te(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ +255,b[26]=u>>>8&255,b[27]=u&255,b[28]=c>>>24,b[29]=c>>>16&255,b[30]=c>>>8&255,b[31]=c&255,b},"digest"); +return r===void 0?{add:J,digest:ye}:(J(r),ye())}var so=te(()=>{"use strict";p();a(_t,"sha256")});var Q,Ct,oo=te(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ Length",0);I(this,"_state",new Int32Array(4));I(this,"_buffer",new ArrayBuffer(68));I(this,"_buffer8"); I(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( @@ -626,130 +626,130 @@ i=this._state,s;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=n i[3]=n[3],s=0;s>2)+1;this._dataLength+=t;let o=this._dataLength*8;if(n[t]=128,n[t+1]= n[t+2]=n[t+3]=0,i.set(Q.buffer32Identity.subarray(s),s),t>55&&(Q._md5cycle(this._state,i),i.set(Q.buffer32Identity)), -o<=4294967295)i[14]=o;else{let u=o.toString(16).match(/(.*?)(.{0,8})$/);if(u===null)return;let l=parseInt( -u[2],16),c=parseInt(u[1],16)||0;i[14]=l,i[15]=c}return Q._md5cycle(this._state,i),e?this._state:Q._hex( +o<=4294967295)i[14]=o;else{let u=o.toString(16).match(/(.*?)(.{0,8})$/);if(u===null)return;let c=parseInt( +u[2],16),l=parseInt(u[1],16)||0;i[14]=c,i[15]=l}return Q._md5cycle(this._state,i),e?this._state:Q._hex( this._state)}};a(Q,"Md5"),I(Q,"stateIdentity",new Int32Array([1732584193,-271733879,-1732584194,271733878])), I(Q,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),I(Q,"hexChars","0123456789\ -abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);_t=Q});var en={};ge(en,{createHash:()=>Ul,createHmac:()=>Dl,randomBytes:()=>kl});function kl(r){return crypto. -getRandomValues(m.alloc(r))}function Ul(r){if(r==="sha256")return{update:a(function(e){return{digest:a( -function(){return m.from(At(e))},"digest")}},"update")};if(r==="md5")return{update:a(function(e){return{ -digest:a(function(){return typeof e=="string"?_t.hashStr(e):_t.hashByteArray(e)},"digest")}},"update")}; -throw new Error(`Hash type '${r}' not supported`)}function Dl(r,e){if(r!=="sha256")throw new Error(`\ +abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);Ct=Q});var rn={};we(rn,{createHash:()=>Oc,createHmac:()=>Nc,randomBytes:()=>Dc});function Dc(r){return crypto. +getRandomValues(m.alloc(r))}function Oc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( +function(){return m.from(_t(e))},"digest")}},"update")};if(r==="md5")return{update:a(function(e){return{ +digest:a(function(){return typeof e=="string"?Ct.hashStr(e):Ct.hashByteArray(e)},"digest")}},"update")}; +throw new Error(`Hash type '${r}' not supported`)}function Nc(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=At(e);else if(n<64){let l=new Uint8Array(64);l.set(e),e=l}let i=new Uint8Array( -64),s=new Uint8Array(64);for(let l=0;l<64;l++)i[l]=54^e[l],s[l]=92^e[l];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(At(o),64),m.from(At(u))}, -"digest")}},"update")}}var tn=te(()=>{"use strict";p();no();io();a(kl,"randomBytes");a(Ul,"createHas\ -h");a(Dl,"createHmac")});var Ct=P((dd,rn)=>{"use strict";p();rn.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: +t));let n=e.length;if(n>64)e=_t(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(_t(o),64),m.from(_t(u))}, +"digest")}},"update")}}var nn=te(()=>{"use strict";p();so();oo();a(Dc,"randomBytes");a(Oc,"createHas\ +h");a(Nc,"createHmac")});var It=P((yd,sn)=>{"use strict";p();sn.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: w.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 rt=Et(),Ol=rt.getTypeParser(20,"text"),Nl=rt.getTypeParser(1016, -"text");rn.exports.__defineSetter__("parseInt8",function(r){rt.setTypeParser(20,"text",r?rt.getTypeParser( -23,"text"):Ol),rt.setTypeParser(1016,"text",r?rt.getTypeParser(1007,"text"):Nl)})});var It=P((yd,oo)=>{"use strict";p();var ql=(tn(),$(en)),Ql=Ct();function jl(r){var e=r.replace(/\\/g, -"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(jl,"escapeElement");function so(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+so(r[t]): -r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=jl(er(r[t]));return e=e+"}",e}a(so,"arrayString"); -var er=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. +keepalives:1,keepalives_idle:0};var nt=At(),qc=nt.getTypeParser(20,"text"),Qc=nt.getTypeParser(1016, +"text");sn.exports.__defineSetter__("parseInt8",function(r){nt.setTypeParser(20,"text",r?nt.getTypeParser( +23,"text"):qc),nt.setTypeParser(1016,"text",r?nt.getTypeParser(1007,"text"):Qc)})});var Tt=P((wd,uo)=>{"use strict";p();var jc=(nn(),$(rn)),Wc=It();function Hc(r){var e=r.replace(/\\/g, +"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(Hc,"escapeElement");function ao(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+ao(r[t]): +r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=Hc(tr(r[t]));return e=e+"}",e}a(ao,"arrayString"); +var tr=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. 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?Ql.parseInputDatesAsUTC?$l(r):Hl(r):Array.isArray(r)?so(r):typeof r== -"object"?Wl(r,e):r.toString()},"prepareValue");function Wl(r,e){if(r&&typeof r.toPostgres=="function"){ +r.byteLength)}return r instanceof Date?Wc.parseInputDatesAsUTC?Vc(r):Gc(r):Array.isArray(r)?ao(r):typeof r== +"object"?$c(r,e):r.toString()},"prepareValue");function $c(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),er(r.toPostgres(er),e)}return JSON.stringify(r)}a(Wl,"prepareObject");function z(r,e){ -for(r=""+r;r.lengthrc});var rc,Rt=te(()=>{"use strict";p();rc={}});var bo=P((Rd,go)=>{"use strict";p();var on=(tn(),$(en));function nc(r){if(r.indexOf("SCRAM-SHA-256")=== --1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=on.randomBytes( +t),r}a(Kc,"normalizeQueryConfig");var on=a(function(r){return jc.createHash("md5").update(r,"utf-8"). +digest("hex")},"md5"),zc=a(function(r,e,t){var n=on(e+r),i=on(m.concat([m.from(n),t]));return"md5"+i}, +"postgresMd5PasswordHash");uo.exports={prepareValue:a(function(e){return tr(e)},"prepareValueWrapper"), +normalizeQueryConfig:Kc,postgresMd5PasswordHash:zc,md5:on}});var Rt={};we(Rt,{default:()=>il});var il,Pt=te(()=>{"use strict";p();il={}});var So=P((Bd,xo)=>{"use strict";p();var un=(nn(),$(rn));function sl(r){if(r.indexOf("SCRAM-SHA-256")=== +-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=un.randomBytes( 18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"\ -SASLInitialResponse"}}a(nc,"startSession");function ic(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( +SASLInitialResponse"}}a(sl,"startSession");function ol(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=ac(t);if(n.nonce.startsWith(r.clientNonce)){ +L: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=cl(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=m.from(n.salt,"base64"),s=cc(e,i,n.iteration),o=nt(s,"Client Key"),u=lc( -o),l="n=*,r="+r.clientNonce,c="r="+n.nonce+",s="+n.salt+",i="+n.iteration,f="c=biws,r="+n.nonce,y=l+ -","+c+","+f,g=nt(u,y),E=wo(o,g),C=E.toString("base64"),W=nt(s,"Server Key"),Y=nt(W,y);r.message="SAS\ -LResponse",r.serverSignature=Y.toString("base64"),r.response=f+",p="+C}a(ic,"continueSession");function sc(r,e){ +art with client nonce");var i=m.from(n.salt,"base64"),s=hl(e,i,n.iteration),o=it(s,"Client Key"),u=fl( +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=it(u,y),E=bo(o,g),C=E.toString("base64"),W=it(s,"Server Key"),J=it(W,y);r.message="SAS\ +LResponse",r.serverSignature=J.toString("base64"),r.response=f+",p="+C}a(ol,"continueSession");function al(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}=uc( +"string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=ll( e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does\ - not match")}a(sc,"finalizeSession");function oc(r){if(typeof r!="string")throw new TypeError("SASL:\ + not match")}a(al,"finalizeSession");function ul(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(oc,"isPrintableChars");function yo(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(r)}a(yo,"isBase64");function mo(r){if(typeof r!="string")throw new TypeError("SASL: attribute p\ +e<=126)}a(ul,"isPrintableChars");function wo(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(r)}a(wo,"isBase64");function go(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(mo,"parseAttribute\ -Pairs");function ac(r){let e=mo(r),t=e.get("r");if(t){if(!oc(t))throw new Error("SASL: SCRAM-SERVER-\ +SASL: Invalid attribute pair entry");let t=e[0],n=e.substring(2);return[t,n]}))}a(go,"parseAttribute\ +Pairs");function cl(r){let e=go(r),t=e.get("r");if(t){if(!ul(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(!yo(n))throw new Error("SASL: SCRAM-SERV\ +ER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!wo(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(ac,"parseServerFirstMessage"); -function uc(r){let t=mo(r).get("v");if(t){if(!yo(t))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAG\ +tion missing");let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(cl,"parseServerFirstMessage"); +function ll(r){let t=go(r).get("v");if(t){if(!wo(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(uc,"parseServerFinalMessage");function wo(r,e){if(!m. +signature is missing");return{serverSignature:t}}a(ll,"parseServerFinalMessage");function bo(r,e){if(!m. isBuffer(r))throw new TypeError("first argument must be a Buffer");if(!m.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 m.from(r.map((t,n)=>r[n]^e[n]))} -a(wo,"xorBuffers");function lc(r){return on.createHash("sha256").update(r).digest()}a(lc,"sha256");function nt(r,e){ -return on.createHmac("sha256",r).update(e).digest()}a(nt,"hmacSha256");function cc(r,e,t){for(var n=nt( -r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sfc});function fc(...r){return r.join("/")}var un=te(()=>{"use strict";p(); -a(fc,"join")});var ln={};ge(ln,{stat:()=>hc});function hc(r,e){e(new Error("No filesystem"))}var cn=te(()=>{"use st\ -rict";p();a(hc,"stat")});var fn={};ge(fn,{default:()=>dc});var dc,hn=te(()=>{"use strict";p();dc={}});var xo={};ge(xo,{StringDecoder:()=>dn});var pn,dn,So=te(()=>{"use strict";p();pn=class pn{constructor(e){ +a(bo,"xorBuffers");function fl(r){return un.createHash("sha256").update(r).digest()}a(fl,"sha256");function it(r,e){ +return un.createHmac("sha256",r).update(e).digest()}a(it,"hmacSha256");function hl(r,e,t){for(var n=it( +r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sdl});function dl(...r){return r.join("/")}var ln=te(()=>{"use strict";p(); +a(dl,"join")});var fn={};we(fn,{stat:()=>pl});function pl(r,e){e(new Error("No filesystem"))}var hn=te(()=>{"use st\ +rict";p();a(pl,"stat")});var dn={};we(dn,{default:()=>yl});var yl,pn=te(()=>{"use strict";p();yl={}});var vo={};we(vo,{StringDecoder:()=>yn});var mn,yn,Eo=te(()=>{"use strict";p();mn=class mn{constructor(e){ I(this,"td");this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this. -td.decode(e)}};a(pn,"StringDecoder");dn=pn});var _o=P((Nd,Ao)=>{"use strict";p();var{Transform:pc}=(hn(),$(fn)),{StringDecoder:yc}=(So(),$(xo)),Le=Symbol( -"last"),rr=Symbol("decoder");function mc(r,e,t){let n;if(this.overflow){if(n=this[rr].write(r).split( -this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Le]+=this[rr].write(r),n= -this[Le].split(this.matcher);this[Le]=n.pop();for(let i=0;i{"use strict";p();var{Transform:ml}=(pn(),$(dn)),{StringDecoder:wl}=(Eo(),$(vo)),Le=Symbol( +"last"),ir=Symbol("decoder");function gl(r,e,t){let n;if(this.overflow){if(n=this[ir].write(r).split( +this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Le]+=this[ir].write(r),n= +this[Le].split(this.matcher);this[Le]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( -"maximum buffer reached"));return}t()}a(mc,"transform");function wc(r){if(this[Le]+=this[rr].end(),this[Le]) -try{Eo(this,this.mapper(this[Le]))}catch(e){return r(e)}r()}a(wc,"flush");function Eo(r,e){e!==void 0&& -r.push(e)}a(Eo,"push");function vo(r){return r}a(vo,"noop");function gc(r,e,t){switch(r=r||/\r?\n/,e= -e||vo,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(gl,"transform");function bl(r){if(this[Le]+=this[ir].end(),this[Le]) +try{_o(this,this.mapper(this[Le]))}catch(e){return r(e)}r()}a(bl,"flush");function _o(r,e){e!==void 0&& +r.push(e)}a(_o,"push");function Ao(r){return r}a(Ao,"noop");function xl(r,e,t){switch(r=r||/\r?\n/,e= +e||Ao,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=vo)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=mc,t.flush=wc,t.readableObjectMode= -!0;let n=new pc(t);return n[Le]="",n[rr]=new yc("utf8"),n.matcher=r,n.mapper=e,n.maxLength=t.maxLength, +"object"&&(t=e,e=Ao)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=gl,t.flush=bl,t.readableObjectMode= +!0;let n=new ml(t);return n[Le]="",n[ir]=new wl("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(gc,"split");Ao.exports=gc});var To=P((jd,_e)=>{"use strict";p();var Co=(un(),$(an)),bc=(hn(),$(fn)).Stream,xc=_o(),Io=(Rt(),$(Tt)), -Sc=5432,nr=w.platform==="win32",Pt=w.stderr,vc=56,Ec=7,Ac=61440,_c=32768;function Cc(r){return(r&Ac)== -_c}a(Cc,"isRegFile");var it=["host","port","database","user","password"],yn=it.length,Ic=it[yn-1];function mn(){ -var r=Pt instanceof bc&&Pt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` -`);Pt.write(Io.format.apply(Io,e))}}a(mn,"warn");Object.defineProperty(_e.exports,"isWin",{get:a(function(){ -return nr},"get"),set:a(function(r){nr=r},"set")});_e.exports.warnTo=function(r){var e=Pt;return Pt= -r,e};_e.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(nr?Co.join(e.APPDATA||"./","\ -postgresql","pgpass.conf"):Co.join(e.HOME||"./",".pgpass"));return t};_e.exports.usePgPass=function(r,e){ -return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:nr?!0:(e=e||"",Cc(r.mode)?r. -mode&(vc|Ec)?(mn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ -(0600) or less',e),!1):!0:(mn('WARNING: password file "%s" is not a plain file',e),!1))};var Tc=_e.exports. -match=function(r,e){return it.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||Sc)===Number( +!1,s(i)},n}a(xl,"split");Co.exports=xl});var Po=P((Hd,_e)=>{"use strict";p();var To=(ln(),$(cn)),Sl=(pn(),$(dn)).Stream,vl=Io(),Ro=(Pt(),$(Rt)), +El=5432,sr=w.platform==="win32",Bt=w.stderr,Al=56,_l=7,Cl=61440,Il=32768;function Tl(r){return(r&Cl)== +Il}a(Tl,"isRegFile");var st=["host","port","database","user","password"],wn=st.length,Rl=st[wn-1];function gn(){ +var r=Bt instanceof Sl&&Bt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +`);Bt.write(Ro.format.apply(Ro,e))}}a(gn,"warn");Object.defineProperty(_e.exports,"isWin",{get:a(function(){ +return sr},"get"),set:a(function(r){sr=r},"set")});_e.exports.warnTo=function(r){var e=Bt;return Bt= +r,e};_e.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(sr?To.join(e.APPDATA||"./","\ +postgresql","pgpass.conf"):To.join(e.HOME||"./",".pgpass"));return t};_e.exports.usePgPass=function(r,e){ +return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:sr?!0:(e=e||"",Tl(r.mode)?r. +mode&(Al|_l)?(gn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ +(0600) or less',e),!1):!0:(gn('WARNING: password file "%s" is not a plain file',e),!1))};var Pl=_e.exports. +match=function(r,e){return st.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||El)===Number( e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};_e.exports.getPassword=function(r,e,t){var n,i=e.pipe( -xc());function s(l){var c=Rc(l);c&&Pc(c)&&Tc(r,c)&&(n=c[Ic],i.end())}a(s,"onLine");var o=a(function(){ -e.destroy(),t(n)},"onEnd"),u=a(function(l){e.destroy(),mn("WARNING: error on reading file: %s",l),t( -void 0)},"onErr");e.on("error",u),i.on("data",s).on("end",o).on("error",u)};var Rc=_e.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,l=a( +vl());function s(c){var l=Bl(c);l&&Ll(l)&&Pl(r,l)&&(n=l[Rl],i.end())}a(s,"onLine");var o=a(function(){ +e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),gn("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 Bl=_e.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 E=r.substring(y,g);Object.hasOwnProperty.call(w.env,"PGPASS_NO_DEESCAPE")||(E=E. -replace(/\\([:\\])/g,"$1")),o[it[f]]=E},"addToObj"),c=0;c=0&&e==":"&&t!=="\\"&&(l(n,i,c+1),i=c+2,n+=1)}return o=Object.keys(o). -length===yn?o:null,o},Pc=_e.exports.isValidEntry=function(r){for(var e={0:function(o){return o.length> +replace(/\\([:\\])/g,"$1")),o[st[f]]=E},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). +length===wn?o:null,o},Ll=_e.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 $d=(un(),$(an)),Ro=(cn(),$(ln)),ir=To();wn.exports=function(r,e){ -var t=ir.getFileName();Ro.stat(t,function(n,i){if(n||!ir.usePgPass(i,t))return e(void 0);var s=Ro.createReadStream( -t);ir.getPassword(r,s,e)})};wn.exports.warnTo=ir.warnTo});var Bo={};ge(Bo,{default:()=>Bc});var Bc,Lo=te(()=>{"use strict";p();Bc={}});var Mo=P((zd,Fo)=>{"use strict";p();var Lc=(Rr(),$(us)),gn=(cn(),$(ln));function bn(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 Vd=(ln(),$(cn)),Bo=(hn(),$(fn)),or=Po();bn.exports=function(r,e){ +var t=or.getFileName();Bo.stat(t,function(n,i){if(n||!or.usePgPass(i,t))return e(void 0);var s=Bo.createReadStream( +t);or.getPassword(r,s,e)})};bn.exports.warnTo=or.warnTo});var Fo={};we(Fo,{default:()=>Fl});var Fl,ko=te(()=>{"use strict";p();Fl={}});var Uo=P((Jd,Mo)=>{"use strict";p();var kl=(Br(),$(ls)),xn=(hn(),$(fn));function Sn(r){if(r.charAt(0)=== +"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=kl.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=gn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=gn.readFileSync(t.sslkey).toString()), -t.sslrootcert&&(t.ssl.ca=gn.readFileSync(t.sslrootcert).toString()),t.sslmode){case"disable":{t.ssl= +cert=xn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=xn.readFileSync(t.sslkey).toString()), +t.sslrootcert&&(t.ssl.ca=xn.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(bn,"parse");Fo.exports=bn;bn.parse=bn});var sr=P((Zd,Do)=>{"use strict";p();var Fc=(Lo(),$(Bo)),Uo=Ct(),ko=Mo().parse,ee=a(function(r,e,t){return t=== -void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Uo[r]},"val"),Mc=a(function(){switch(w. +!1;break}}return t}a(Sn,"parse");Mo.exports=Sn;Sn.parse=Sn});var ar=P((ep,No)=>{"use strict";p();var Ml=(ko(),$(Fo)),Oo=It(),Do=Uo().parse,ee=a(function(r,e,t){return t=== +void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Oo[r]},"val"),Ul=a(function(){switch(w. 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 Uo.ssl},"readSSLConfigFromEnvironment"),st=a(function(r){ -return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),ye=a(function(r,e,t){ -var n=e[t];n!=null&&r.push(t+"="+st(n))},"add"),Sn=class Sn{constructor(e){e=typeof e=="string"?ko(e): -e||{},e.connectionString&&(e=Object.assign({},e,ko(e.connectionString))),this.user=ee("user",e),this. +no-verify":return{rejectUnauthorized:!1}}return Oo.ssl},"readSSLConfigFromEnvironment"),ot=a(function(r){ +return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),pe=a(function(r,e,t){ +var n=e[t];n!=null&&r.push(t+"="+ot(n))},"add"),En=class En{constructor(e){e=typeof e=="string"?Do(e): +e||{},e.connectionString&&(e=Object.assign({},e,Do(e.connectionString))),this.user=ee("user",e),this. database=ee("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(ee("p\ ort",e),10),this.host=ee("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, writable:!0,value:ee("password",e)}),this.binary=ee("binary",e),this.options=ee("options",e),this.ssl= -typeof e.ssl>"u"?Mc():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="\ +typeof e.ssl>"u"?Ul():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=ee("client_encoding",e),this.replication=ee("replication", e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=ee("application_name",e,"\ @@ -780,31 +780,31 @@ ee("idle_in_transaction_session_timeout",e,!1),this.query_timeout=ee("query_time void 0?this.connect_timeout=w.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/ 1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive===!0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis== "number"&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){ -var t=[];ye(t,this,"user"),ye(t,this,"password"),ye(t,this,"port"),ye(t,this,"application_name"),ye( -t,this,"fallback_application_name"),ye(t,this,"connect_timeout"),ye(t,this,"options");var n=typeof this. -ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(ye(t,n,"sslmode"),ye(t,n,"sslca"),ye(t,n,"s\ -slkey"),ye(t,n,"sslcert"),ye(t,n,"sslrootcert"),this.database&&t.push("dbname="+st(this.database)),this. -replication&&t.push("replication="+st(this.replication)),this.host&&t.push("host="+st(this.host)),this. -isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+st(this.client_encoding)), -Fc.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+st(s)),e(null,t.join(" ")))})}}; -a(Sn,"ConnectionParameters");var xn=Sn;Do.exports=xn});var qo=P((tp,No)=>{"use strict";p();var kc=Et(),Oo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,En=class En{constructor(e,t){ +var t=[];pe(t,this,"user"),pe(t,this,"password"),pe(t,this,"port"),pe(t,this,"application_name"),pe( +t,this,"fallback_application_name"),pe(t,this,"connect_timeout"),pe(t,this,"options");var n=typeof this. +ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(pe(t,n,"sslmode"),pe(t,n,"sslca"),pe(t,n,"s\ +slkey"),pe(t,n,"sslcert"),pe(t,n,"sslrootcert"),this.database&&t.push("dbname="+ot(this.database)),this. +replication&&t.push("replication="+ot(this.replication)),this.host&&t.push("host="+ot(this.host)),this. +isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+ot(this.client_encoding)), +Ml.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+ot(s)),e(null,t.join(" ")))})}}; +a(En,"ConnectionParameters");var vn=En;No.exports=vn});var jo=P((np,Qo)=>{"use strict";p();var Dl=At(),qo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,_n=class _n{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=Oo.exec(e.text):t=Oo.exec(e.command),t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2], +var t;e.text?t=qo.exec(e.text):t=qo.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:Uc}=Pe(),Qo=qo(),jo=It(),_n=class _n extends Uc{constructor(e,t,n){ -super(),e=jo.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]=Dl.getTypeParser(n.dataTypeID,n. +format||"text")}}};a(_n,"Result");var An=_n;Qo.exports=An});var Go=P((op,$o)=>{"use strict";p();var{EventEmitter:Ol}=Pe(),Wo=jo(),Ho=Tt(),In=class In extends Ol{constructor(e,t,n){ +super(),e=Ho.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,w.domain&&e.callback&&(this.callback=w.domain.bind(e.callback)),this._result= -new Qo(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError= +new Wo(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 Qo(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ +_results=[this._result]),this._result=new Wo(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:jo.prepareValue})}catch(t){ +portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:Ho.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(_n,"Query");var An=_n;Wo.exports= -An});var ei=P(R=>{"use strict";p();Object.defineProperty(R,"__esModule",{value:!0});R.NoticeMessage=R.DataRowMessage= +e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(In,"Query");var Cn=In;$o.exports= +Cn});var ri=P(R=>{"use strict";p();Object.defineProperty(R,"__esModule",{value:!0});R.NoticeMessage=R.DataRowMessage= R.CommandCompleteMessage=R.ReadyForQueryMessage=R.NotificationResponseMessage=R.BackendKeyDataMessage= R.AuthenticationMD5Password=R.ParameterStatusMessage=R.ParameterDescriptionMessage=R.RowDescriptionMessage= R.Field=R.CopyResponse=R.CopyDataMessage=R.DatabaseError=R.copyDone=R.emptyQuery=R.replicationStart= @@ -832,30 +832,30 @@ R.portalSuspended=R.noData=R.closeComplete=R.bindComplete=R.parseComplete=void 0 parseComplete",length:5};R.bindComplete={name:"bindComplete",length:5};R.closeComplete={name:"closeC\ omplete",length:5};R.noData={name:"noData",length:5};R.portalSuspended={name:"portalSuspended",length:5}; R.replicationStart={name:"replicationStart",length:4};R.emptyQuery={name:"emptyQuery",length:4};R.copyDone= -{name:"copyDone",length:4};var qn=class qn extends Error{constructor(e,t,n){super(e),this.length=t,this. -name=n}};a(qn,"DatabaseError");var Cn=qn;R.DatabaseError=Cn;var Qn=class Qn{constructor(e,t){this.length= -e,this.chunk=t,this.name="copyData"}};a(Qn,"CopyDataMessage");var In=Qn;R.CopyDataMessage=In;var jn=class jn{constructor(e,t,n,i){ -this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(jn,"CopyResponse");var Tn=jn; -R.CopyResponse=Tn;var Wn=class Wn{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(Wn,"Field");var Rn=Wn; -R.Field=Rn;var Hn=class Hn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ -n",this.fields=new Array(this.fieldCount)}};a(Hn,"RowDescriptionMessage");var Pn=Hn;R.RowDescriptionMessage= -Pn;var $n=class $n{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ -ion",this.dataTypeIDs=new Array(this.parameterCount)}};a($n,"ParameterDescriptionMessage");var Bn=$n; -R.ParameterDescriptionMessage=Bn;var Gn=class Gn{constructor(e,t,n){this.length=e,this.parameterName= -t,this.parameterValue=n,this.name="parameterStatus"}};a(Gn,"ParameterStatusMessage");var Ln=Gn;R.ParameterStatusMessage= -Ln;var Vn=class Vn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; -a(Vn,"AuthenticationMD5Password");var Fn=Vn;R.AuthenticationMD5Password=Fn;var Kn=class Kn{constructor(e,t,n){ -this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Kn,"BackendKeyDataMes\ -sage");var Mn=Kn;R.BackendKeyDataMessage=Mn;var zn=class zn{constructor(e,t,n,i){this.length=e,this. -processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(zn,"NotificationResponseMessa\ -ge");var kn=zn;R.NotificationResponseMessage=kn;var Yn=class Yn{constructor(e,t){this.length=e,this. -status=t,this.name="readyForQuery"}};a(Yn,"ReadyForQueryMessage");var Un=Yn;R.ReadyForQueryMessage=Un; -var Jn=class Jn{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(Jn,"Comma\ -ndCompleteMessage");var Dn=Jn;R.CommandCompleteMessage=Dn;var Zn=class Zn{constructor(e,t){this.length= -e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(Zn,"DataRowMessage");var On=Zn;R.DataRowMessage= -On;var Xn=class Xn{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(Xn,"NoticeMe\ -ssage");var Nn=Xn;R.NoticeMessage=Nn});var $o=P(or=>{"use strict";p();Object.defineProperty(or,"__esModule",{value:!0});or.Writer=void 0;var ri=class ri{constructor(e=256){ +{name:"copyDone",length:4};var jn=class jn extends Error{constructor(e,t,n){super(e),this.length=t,this. +name=n}};a(jn,"DatabaseError");var Tn=jn;R.DatabaseError=Tn;var Wn=class Wn{constructor(e,t){this.length= +e,this.chunk=t,this.name="copyData"}};a(Wn,"CopyDataMessage");var Rn=Wn;R.CopyDataMessage=Rn;var Hn=class Hn{constructor(e,t,n,i){ +this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Hn,"CopyResponse");var Pn=Hn; +R.CopyResponse=Pn;var $n=class $n{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($n,"Field");var Bn=$n; +R.Field=Bn;var Gn=class Gn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ +n",this.fields=new Array(this.fieldCount)}};a(Gn,"RowDescriptionMessage");var Ln=Gn;R.RowDescriptionMessage= +Ln;var Vn=class Vn{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ +ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(Vn,"ParameterDescriptionMessage");var Fn=Vn; +R.ParameterDescriptionMessage=Fn;var Kn=class Kn{constructor(e,t,n){this.length=e,this.parameterName= +t,this.parameterValue=n,this.name="parameterStatus"}};a(Kn,"ParameterStatusMessage");var kn=Kn;R.ParameterStatusMessage= +kn;var zn=class zn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; +a(zn,"AuthenticationMD5Password");var Mn=zn;R.AuthenticationMD5Password=Mn;var Yn=class Yn{constructor(e,t,n){ +this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Yn,"BackendKeyDataMes\ +sage");var Un=Yn;R.BackendKeyDataMessage=Un;var Jn=class Jn{constructor(e,t,n,i){this.length=e,this. +processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(Jn,"NotificationResponseMessa\ +ge");var Dn=Jn;R.NotificationResponseMessage=Dn;var Zn=class Zn{constructor(e,t){this.length=e,this. +status=t,this.name="readyForQuery"}};a(Zn,"ReadyForQueryMessage");var On=Zn;R.ReadyForQueryMessage=On; +var Xn=class Xn{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(Xn,"Comma\ +ndCompleteMessage");var Nn=Xn;R.CommandCompleteMessage=Nn;var ei=class ei{constructor(e,t){this.length= +e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(ei,"DataRowMessage");var qn=ei;R.DataRowMessage= +qn;var ti=class ti{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(ti,"NoticeMe\ +ssage");var Qn=ti;R.NoticeMessage=Qn});var Vo=P(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.Writer=void 0;var ii=class ii{constructor(e=256){ this.size=e,this.offset=5,this.headerPosition=0,this.buffer=m.allocUnsafe(e)}ensure(e){if(this.buffer. length-this.offset>1)+e;this.buffer=m.allocUnsafe(i),n.copy( this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this. @@ -867,49 +867,49 @@ 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=m.allocUnsafe(this.size),t}};a(ri,"Writer");var ti=ri;or.Writer=ti});var Vo=P(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.serialize=void 0; -var ni=$o(),D=new ni.Writer,Dc=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( +headerPosition=0,this.buffer=m.allocUnsafe(this.size),t}};a(ii,"Writer");var ni=ii;ur.Writer=ni});var zo=P(lr=>{"use strict";p();Object.defineProperty(lr,"__esModule",{value:!0});lr.serialize=void 0; +var si=Vo(),D=new si.Writer,Nl=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( n).addCString(r[n]);D.addCString("client_encoding").addCString("UTF8");let e=D.addCString("").flush(), -t=e.length+4;return new ni.Writer().addInt32(t).add(e).flush()},"startup"),Oc=a(()=>{let r=m.allocUnsafe( -8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Nc=a(r=>D.addCString(r).flush( -112),"password"),qc=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. -flush(112)},"sendSASLInitialResponseMessage"),Qc=a(function(r){return D.addString(r).flush(112)},"se\ -ndSCRAMClientFinalMessage"),jc=a(r=>D.addCString(r).flush(81),"query"),Go=[],Wc=a(r=>{let e=r.name|| +t=e.length+4;return new si.Writer().addInt32(t).add(e).flush()},"startup"),ql=a(()=>{let r=m.allocUnsafe( +8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Ql=a(r=>D.addCString(r).flush( +112),"password"),jl=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. +flush(112)},"sendSASLInitialResponseMessage"),Wl=a(function(r){return D.addString(r).flush(112)},"se\ +ndSCRAMClientFinalMessage"),Hl=a(r=>D.addCString(r).flush(81),"query"),Ko=[],$l=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||Go,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< -n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),ot=new ni.Writer,Hc=a(function(r,e){for(let t=0;t< -r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),ot.addInt32(-1)):n instanceof m?(D.addInt16( -1),ot.addInt32(n.length),ot.add(n)):(D.addInt16(0),ot.addInt32(m.byteLength(n)),ot.addString(n))}},"\ -writeValues"),$c=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Go,s=i.length; -return D.addCString(e).addCString(t),D.addInt16(s),Hc(i,r.valueMapper),D.addInt16(s),D.add(ot.flush()), -D.addInt16(n?1:0),D.flush(66)},"bind"),Gc=m.from([69,0,0,0,9,0,0,0,0,0]),Vc=a(r=>{if(!r||!r.portal&& -!r.rows)return Gc;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Kc=a( +xecuting queries"));let t=r.types||Ko,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< +n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),at=new si.Writer,Gl=a(function(r,e){for(let t=0;t< +r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),at.addInt32(-1)):n instanceof m?(D.addInt16( +1),at.addInt32(n.length),at.add(n)):(D.addInt16(0),at.addInt32(m.byteLength(n)),at.addString(n))}},"\ +writeValues"),Vl=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Ko,s=i.length; +return D.addCString(e).addCString(t),D.addInt16(s),Gl(i,r.valueMapper),D.addInt16(s),D.add(at.flush()), +D.addInt16(n?1:0),D.flush(66)},"bind"),Kl=m.from([69,0,0,0,9,0,0,0,0,0]),zl=a(r=>{if(!r||!r.portal&& +!r.rows)return Kl;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Yl=a( (r,e)=>{let t=m.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"),ii=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. +6),t.writeInt32BE(r,8),t.writeInt32BE(e,12),t},"cancel"),oi=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i},"cstringMessage"), -zc=D.addCString("P").flush(68),Yc=D.addCString("S").flush(68),Jc=a(r=>r.name?ii(68,`${r.type}${r.name|| -""}`):r.type==="P"?zc:Yc,"describe"),Zc=a(r=>{let e=`${r.type}${r.name||""}`;return ii(67,e)},"close"), -Xc=a(r=>D.add(r).flush(100),"copyData"),ef=a(r=>ii(102,r),"copyFail"),ar=a(r=>m.from([r,0,0,0,4]),"c\ -odeOnlyBuffer"),tf=ar(72),rf=ar(83),nf=ar(88),sf=ar(99),of={startup:Dc,password:Nc,requestSsl:Oc,sendSASLInitialResponseMessage:qc, -sendSCRAMClientFinalMessage:Qc,query:jc,parse:Wc,bind:$c,execute:Vc,describe:Jc,close:Zc,flush:a(()=>tf, -"flush"),sync:a(()=>rf,"sync"),end:a(()=>nf,"end"),copyData:Xc,copyDone:a(()=>sf,"copyDone"),copyFail:ef, -cancel:Kc};ur.serialize=of});var Ko=P(lr=>{"use strict";p();Object.defineProperty(lr,"__esModule",{value:!0});lr.BufferReader=void 0; -var af=m.allocUnsafe(0),oi=class oi{constructor(e=0){this.offset=e,this.buffer=af,this.encoding="utf\ +Jl=D.addCString("P").flush(68),Zl=D.addCString("S").flush(68),Xl=a(r=>r.name?oi(68,`${r.type}${r.name|| +""}`):r.type==="P"?Jl:Zl,"describe"),ef=a(r=>{let e=`${r.type}${r.name||""}`;return oi(67,e)},"close"), +tf=a(r=>D.add(r).flush(100),"copyData"),rf=a(r=>oi(102,r),"copyFail"),cr=a(r=>m.from([r,0,0,0,4]),"c\ +odeOnlyBuffer"),nf=cr(72),sf=cr(83),of=cr(88),af=cr(99),uf={startup:Nl,password:Ql,requestSsl:ql,sendSASLInitialResponseMessage:jl, +sendSCRAMClientFinalMessage:Wl,query:Hl,parse:$l,bind:Vl,execute:zl,describe:Xl,close:ef,flush:a(()=>nf, +"flush"),sync:a(()=>sf,"sync"),end:a(()=>of,"end"),copyData:tf,copyDone:a(()=>af,"copyDone"),copyFail:rf, +cancel:Yl};lr.serialize=uf});var Yo=P(fr=>{"use strict";p();Object.defineProperty(fr,"__esModule",{value:!0});fr.BufferReader=void 0; +var cf=m.allocUnsafe(0),ui=class ui{constructor(e=0){this.offset=e,this.buffer=cf,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(oi,"BufferReader");var si=oi;lr.BufferReader=si});var Jo=P(cr=>{"use strict";p();Object.defineProperty(cr,"__esModule",{value:!0});cr.Parser=void 0;var O=ei(), -uf=Ko(),ai=1,lf=4,zo=ai+lf,Yo=m.allocUnsafe(0),li=class li{constructor(e){if(this.buffer=Yo,this.bufferLength= -0,this.bufferOffset=0,this.reader=new uf.BufferReader,e?.mode==="binary")throw new Error("Binary mod\ +offset+=e,t}};a(ui,"BufferReader");var ai=ui;fr.BufferReader=ai});var Xo=P(hr=>{"use strict";p();Object.defineProperty(hr,"__esModule",{value:!0});hr.Parser=void 0;var O=ri(), +lf=Yo(),ci=1,ff=4,Jo=ci+ff,Zo=m.allocUnsafe(0),fi=class fi{constructor(e){if(this.buffer=Zo,this.bufferLength= +0,this.bufferOffset=0,this.reader=new lf.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+zo<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( -i+ai),u=ai+o;if(u+i<=n){let l=this.handlePacket(i+zo,s,o,this.buffer);t(l),i+=u}else break}i===n?(this. -buffer=Yo,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=n-i,this.bufferOffset=i)}mergeBuffer(e){ +this.bufferLength,i=this.bufferOffset;for(;i+Jo<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( +i+ci),u=ci+o;if(u+i<=n){let c=this.handlePacket(i+Jo,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. +buffer=Zo,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. buffer.byteLength*2;for(;t>=s;)s*=2;i=m.allocUnsafe(s)}this.buffer.copy(i,0,this.bufferOffset,this.bufferOffset+ @@ -930,7 +930,7 @@ this.reader.setBuffer(e,n);let i=this.reader.cstring();return new O.CommandCompl let i=n.slice(e,e+(t-4));return new O.CopyDataMessage(t,i)}parseCopyInMessage(e,t,n){return this.parseCopyMessage( e,t,n,"copyInResponse")}parseCopyOutMessage(e,t,n){return this.parseCopyMessage(e,t,n,"copyOutRespon\ se")}parseCopyMessage(e,t,n,i){this.reader.setBuffer(e,n);let s=this.reader.byte()!==0,o=this.reader. -int16(),u=new O.CopyResponse(t,i,s,o);for(let l=0;l{"use strict";p();Object.defineProperty(Fe,"__esModule",{value:!0});Fe.DatabaseError=Fe. -serialize=Fe.parse=void 0;var cf=ei();Object.defineProperty(Fe,"DatabaseError",{enumerable:!0,get:a( -function(){return cf.DatabaseError},"get")});var ff=Vo();Object.defineProperty(Fe,"serialize",{enumerable:!0, -get:a(function(){return ff.serialize},"get")});var hf=Jo();function df(r,e){let t=new hf.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(df,"parse");Fe.parse=df});var Zo={};ge(Zo,{connect:()=>pf});function pf({socket:r,servername:e}){return r.startTls(e),r}var Xo=te( -()=>{"use strict";p();a(pf,"connect")});var di=P((Ip,ra)=>{"use strict";p();var ea=(Ye(),$(as)),yf=Pe().EventEmitter,{parse:mf,serialize:K}=ci(), -ta=K.flush(),wf=K.sync(),gf=K.end(),hi=class hi extends yf{constructor(e){super(),e=e||{},this.stream= -e.stream||new ea.Socket,this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis, +c=i==="notice"?new O.NoticeMessage(t,u):new O.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(fi,"Parser");var li=fi;hr.Parser=li});var hi=P(Fe=>{"use strict";p();Object.defineProperty(Fe,"__esModule",{value:!0});Fe.DatabaseError=Fe. +serialize=Fe.parse=void 0;var hf=ri();Object.defineProperty(Fe,"DatabaseError",{enumerable:!0,get:a( +function(){return hf.DatabaseError},"get")});var df=zo();Object.defineProperty(Fe,"serialize",{enumerable:!0, +get:a(function(){return df.serialize},"get")});var pf=Xo();function yf(r,e){let t=new pf.Parser;return r. +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(yf,"parse");Fe.parse=yf});var ea={};we(ea,{connect:()=>mf});function mf({socket:r,servername:e}){return r.startTls(e),r}var ta=te( +()=>{"use strict";p();a(mf,"connect")});var yi=P((Rp,ia)=>{"use strict";p();var ra=(Je(),$(cs)),wf=Pe().EventEmitter,{parse:gf,serialize:K}=hi(), +na=K.flush(),bf=K.sync(),xf=K.end(),pi=class pi extends wf{constructor(e){super(),e=e||{},this.stream= +e.stream||new ra.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=(Xo(),$(Zo));let l={socket:n.stream};n.ssl!==!0&&(Object.assign(l,n.ssl),"key"in n.ssl&&(l.key= -n.ssl.key)),ea.isIP(t)===0&&(l.servername=t);try{n.stream=u.connect(l)}catch(c){return n.emit("error", -c)}n.attachListeners(n.stream),n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){e.on( -"end",()=>{this.emit("end")}),mf(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& +var u=(ta(),$(ea));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= +n.ssl.key)),ra.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")}),gf(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(K.requestSsl())}startup(e){this. stream.write(K.startup(e))}cancel(e,t){this._send(K.cancel(e,t))}password(e){this._send(K.password(e))}sendSASLInitialResponseMessage(e,t){ this._send(K.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(K.sendSCRAMClientFinalMessage( e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(K.query(e))}parse(e){ this._send(K.parse(e))}bind(e){this._send(K.bind(e))}execute(e){this._send(K.execute(e))}flush(){this. -stream.writable&&this.stream.write(ta)}sync(){this._ending=!0,this._send(ta),this._send(wf)}ref(){this. +stream.writable&&this.stream.write(na)}sync(){this._ending=!0,this._send(na),this._send(bf)}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(gf,()=>{this.stream.end()})}close(e){this._send(K. +this.stream.end();return}return this.stream.write(xf,()=>{this.stream.end()})}close(e){this._send(K. close(e))}describe(e){this._send(K.describe(e))}sendCopyFromChunk(e){this._send(K.copyData(e))}endCopyFrom(){ -this._send(K.copyDone())}sendCopyFail(e){this._send(K.copyFail(e))}};a(hi,"Connection");var fi=hi;ra. -exports=fi});var sa=P((Bp,ia)=>{"use strict";p();var bf=Pe().EventEmitter,Pp=(Rt(),$(Tt)),xf=It(),pi=bo(),Sf=Po(), -vf=Xt(),Ef=sr(),na=Ho(),Af=Ct(),_f=di(),yi=class yi extends bf{constructor(e){super(),this.connectionParameters= -new Ef(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database, +this._send(K.copyDone())}sendCopyFail(e){this._send(K.copyFail(e))}};a(pi,"Connection");var di=pi;ia. +exports=di});var aa=P((Fp,oa)=>{"use strict";p();var Sf=Pe().EventEmitter,Lp=(Pt(),$(Rt)),vf=Tt(),mi=So(),Ef=Lo(), +Af=er(),_f=ar(),sa=Go(),Cf=It(),If=yi(),wi=class wi extends Sf{constructor(e){super(),this.connectionParameters= +new _f(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||S.Promise, -this._types=new vf(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= -!1,this._queryable=!0,this.connection=t.connection||new _f({stream:t.stream,ssl:this.connectionParameters. +this._types=new Af(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= +!1,this._queryable=!0,this.connection=t.connection||new If({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||Af.binary,this. +connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t.binary||Cf.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=>{w.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():Sf(this.connectionParameters, +password=this.password=null;e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():Ef(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=xf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ -this._checkPgPass(()=>{this.saslSession=pi.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( -this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){pi.continueSession( +()=>{let t=vf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ +this._checkPgPass(()=>{this.saslSession=mi.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( +this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){mi.continueSession( this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession. -response)}_handleAuthSASLFinal(e){pi.finalizeSession(this.saslSession,e.data),this.saslSession=null}_handleBackendKeyData(e){ +response)}_handleAuthSASLFinal(e){mi.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; @@ -1064,13 +1064,13 @@ s==="'"?n+=s+s:s==="\\"?(n+=s+s,t=!0):n+=s}return n+="'",t===!0&&(n=" E"+n),n}_p readyForQuery===!0)if(this.activeQuery=this.queryQueue.shift(),this.activeQuery){this.readyForQuery= !1,this.hasExecuted=!0;let e=this.activeQuery.submit(this.connection);e&&w.nextTick(()=>{this.activeQuery. handleError(e,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&& -(this.activeQuery=null,this.emit("drain"))}query(e,t,n){var i,s,o,u,l;if(e==null)throw new TypeError( +(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 na(e,t,n),i.callback||(s=new this._Promise((c,f)=>{i.callback= -(y,g)=>y?f(y):c(g)}))),o&&(l=i.callback,u=setTimeout(()=>{var c=new Error("Query read timeout");w.nextTick( -()=>{i.handleError(c,this.connection)}),l(c),i.callback=()=>{};var f=this.queryQueue.indexOf(i);f>-1&& -this.queryQueue.splice(f,1),this._pulseQueryQueue()},o),i.callback=(c,f)=>{clearTimeout(u),l(c,f)}), +connectionParameters.query_timeout,i=new sa(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");w.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)}), this.binary&&!i.binary&&(i.binary=!0),i._result&&!i._result._types&&(i._result._types=this._types),this. _queryable?this._ending?(w.nextTick(()=>{i.handleError(new Error("Client was closed and is not query\ able"),this.connection)}),s):(this.queryQueue.push(i),this._pulseQueryQueue(),s):(w.nextTick(()=>{i. @@ -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(yi,"Client");var fr=yi;fr.Query=na;ia.exports=fr});var la=P((Mp,ua)=>{"use strict";p();var Cf=Pe().EventEmitter,oa=a(function(){},"NOOP"),aa=a((r,e)=>{ -let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),gi=class gi{constructor(e,t,n){ -this.client=e,this.idleListener=t,this.timeoutId=n}};a(gi,"IdleItem");var mi=gi,bi=class bi{constructor(e){ -this.callback=e}};a(bi,"PendingItem");var at=bi;function If(){throw new Error("Release called on cli\ -ent which has already been released to the pool.")}a(If,"throwOnDoubleRelease");function hr(r,e){if(e) +_Promise(t=>{this.connection.once("end",t)})}};a(wi,"Client");var dr=wi;dr.Query=sa;oa.exports=dr});var fa=P((Up,la)=>{"use strict";p();var Tf=Pe().EventEmitter,ua=a(function(){},"NOOP"),ca=a((r,e)=>{ +let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),xi=class xi{constructor(e,t,n){ +this.client=e,this.idleListener=t,this.timeoutId=n}};a(xi,"IdleItem");var gi=xi,Si=class Si{constructor(e){ +this.callback=e}};a(Si,"PendingItem");var ut=Si;function Rf(){throw new Error("Release called on cli\ +ent which has already been released to the pool.")}a(Rf,"throwOnDoubleRelease");function pr(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(hr,"promisify"); -function Tf(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(pr,"promisify"); +function Pf(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(Tf,"makeIdleListener");var xi=class xi extends Cf{constructor(e,t){super(),this.options= +dleListener")}a(Pf,"makeIdleListener");var vi=class vi extends Tf{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||Bt().Client,this.Promise= +this.log=this.options.log||function(){},this.Client=this.options.Client||t||Lt().Client,this.Promise= this.options.Promise||S.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=aa( +if(!this._isFull())return this.newClient(e);throw new Error("unexpected condition")}_remove(e){let t=ca( 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=hr(this.Promise,e),n=t. +l after calling end on the pool");return e?e(i):this.Promise.reject(i)}let t=pr(this.Promise,e),n=t. result;if(this._isFull()||this._idle.length){if(this._idle.length&&w.nextTick(()=>this._pulseQueue()), -!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new at(t.callback)),n;let i=a((u,l,c)=>{ -clearTimeout(o),t.callback(u,l,c)},"queueCallback"),s=new at(i),o=setTimeout(()=>{aa(this._pendingQueue, +!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new ut(t.callback)),n;let i=a((u,c,l)=>{ +clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new ut(i),o=setTimeout(()=>{ca(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 at(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( -t);let n=Tf(this,t);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&& +newClient(new ut(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( +t);let n=Pf(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,oa);else{if(this.log("new client connected"),this.options. +_pulseQueue(),e.timedOut||e.callback(o,void 0,ua);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(c=>c.client===t)!==-1&&this._acquireClient(t,new at((c,f,y)=>y()), +_expired.add(t),this._idle.findIndex(l=>l.client===t)!==-1&&this._acquireClient(t,new ut((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,oa);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ -let n=!1;return i=>{n&&If(),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,ua);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ +let n=!1;return i=>{n&&Rf(),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 mi( -e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=hr(this.Promise,e);return v(function(){ +this.options.allowExitOnIdle&&s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new gi( +e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=pr(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=hr(this.Promise,n);return n=i.callback,this. -connect((s,o)=>{if(s)return n(s);let u=!1,l=a(c=>{u||(u=!0,o.release(c),n(c))},"onError");o.once("er\ -ror",l),this.log("dispatching query");try{o.query(e,t,(c,f)=>{if(this.log("query dispatched"),o.removeListener( -"error",l),!u)return u=!0,o.release(c),c?n(c):n(void 0,f)})}catch(c){return o.release(c),n(c)}}),i.result}end(e){ +d"))}),s.result}typeof t=="function"&&(n=t,t=void 0);let i=pr(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=hr(this.Promise,e);return this._endCallback=t.callback,this. +this.Promise.reject(n)}this.ending=!0;let t=pr(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(xi,"Pool");var wi=xi;ua.exports=wi});var ca={};ge(ca,{default:()=>Rf});var Rf,fa=te(()=>{"use strict";p();Rf={}});var ha=P((Op,Pf)=>{Pf.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javas\ +return this._clients.length}};a(vi,"Pool");var bi=vi;la.exports=bi});var ha={};we(ha,{default:()=>Bf});var Bf,da=te(()=>{"use strict";p();Bf={}});var pa=P((qp,Lf)=>{Lf.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 ya=P((Np,pa)=>{"use strict";p();var da=Pe().EventEmitter,Bf=(Rt(),$(Tt)),Si=It(),ut=pa.exports=function(r,e,t){ -da.call(this),r=Si.normalizeQueryConfig(r,e,t),this.text=r.text,this.values=r.values,this.name=r.name, +a178655"}});var wa=P((Qp,ma)=>{"use strict";p();var ya=Pe().EventEmitter,Ff=(Pt(),$(Rt)),Ei=Tt(),ct=ma.exports=function(r,e,t){ +ya.call(this),r=Ei.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))};Bf.inherits(ut,da); -var Lf={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ +this.on("newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};Ff.inherits(ct,ya); +var kf={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"\ -file",sourceLine:"line",sourceFunction:"routine"};ut.prototype.handleError=function(r){var e=this.native. -pq.resultErrorFields();if(e)for(var t in e){var n=Lf[t]||t;r[n]=e[t]}this.callback?this.callback(r): -this.emit("error",r),this.state="error"};ut.prototype.then=function(r,e){return this._getPromise().then( -r,e)};ut.prototype.catch=function(r){return this._getPromise().catch(r)};ut.prototype._getPromise=function(){ +file",sourceLine:"line",sourceFunction:"routine"};ct.prototype.handleError=function(r){var e=this.native. +pq.resultErrorFields();if(e)for(var t in e){var n=kf[t]||t;r[n]=e[t]}this.callback?this.callback(r): +this.emit("error",r),this.state="error"};ct.prototype.then=function(r,e){return this._getPromise().then( +r,e)};ct.prototype.catch=function(r){return this._getPromise().catch(r)};ct.prototype._getPromise=function(){ return this._promise?this._promise:(this._promise=new Promise(function(r,e){this._once("end",r),this. -_once("error",e)}.bind(this)),this._promise)};ut.prototype.submit=function(r){this.state="running";var e=this; +_once("error",e)}.bind(this)),this._promise)};ct.prototype.submit=function(r){this.state="running";var e=this; this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a(function(s,o,u){if(r.native.arrayMode= !1,v(function(){e.emit("_done")}),s)return e.handleError(s);e._emitRowEvents&&(u.length>1?o.forEach( -(l,c)=>{l.forEach(f=>{e.emit("row",f,u[c])})}):o.forEach(function(l){e.emit("row",l,u)})),e.state="e\ +(c,l)=>{c.forEach(f=>{e.emit("row",f,u[l])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="e\ nd",e.emit("end",u),e.callback&&e.callback(null,u)},"after");if(w.domain&&(t=w.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(Si.prepareValue);if(r. +se conflicts and silent errors executing queries"));var n=(this.values||[]).map(Ei.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(Si. -prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var ba=P((Wp,ga)=>{"use strict";p();var Ff=(fa(),$(ca)),Mf=Xt(),jp=ha(),ma=Pe().EventEmitter,kf=(Rt(),$(Tt)), -Uf=sr(),wa=ya(),se=ga.exports=function(r){ma.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. -_types=new Mf(r.types),this.native=new Ff({types:this._types}),this._queryQueue=[],this._ending=!1,this. -_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Uf(r);this. +this.values)){let s=new Error("Query values must be an array");return t(s)}var i=this.values.map(Ei. +prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var Sa=P(($p,xa)=>{"use strict";p();var Mf=(da(),$(ha)),Uf=er(),Hp=pa(),ga=Pe().EventEmitter,Df=(Pt(),$(Rt)), +Of=ar(),ba=wa(),oe=xa.exports=function(r){ga.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. +_types=new Uf(r.types),this.native=new Mf({types:this._types}),this._queryQueue=[],this._ending=!1,this. +_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Of(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={}};se.Query= -wa;kf.inherits(se,ma);se.prototype._errorAllQueries=function(r){let e=a(t=>{w.nextTick(()=>{t.native= +password}),this.database=e.database,this.host=e.host,this.port=e.port,this.namedQueries={}};oe.Query= +ba;Df.inherits(oe,ga);oe.prototype._errorAllQueries=function(r){let e=a(t=>{w.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};se.prototype._connect=function(r){var e=this; +null),this._queryQueue.forEach(e),this._queryQueue.length=0};oe.prototype._connect=function(r){var e=this; if(this._connecting){w.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()})})};se.prototype.connect=function(r){if(r){this._connect(r);return}return new this. -_Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};se.prototype.query=function(r,e,t){var n,i,s,o,u; +_pulseQueryQueue(!0),r()})})};oe.prototype.connect=function(r){if(r){this._connect(r);return}return new this. +_Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};oe.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=="f\ unction")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 wa(r,e,t),!n.callback){let l,c;i=new this. -_Promise((f,y)=>{l=f,c=y}),n.callback=(f,y)=>f?c(f):l(y)}return s&&(u=n.callback,o=setTimeout(()=>{var l=new Error( -"Query read timeout");w.nextTick(()=>{n.handleError(l,this.connection)}),u(l),n.callback=()=>{};var c=this. -_queryQueue.indexOf(n);c>-1&&this._queryQueue.splice(c,1),this._pulseQueryQueue()},s),n.callback=(l,c)=>{ -clearTimeout(o),u(l,c)}),this._queryable?this._ending?(n.native=this.native,w.nextTick(()=>{n.handleError( +e);else if(s=this.connectionParameters.query_timeout,n=new ba(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");w.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,w.nextTick(()=>{n.handleError( new Error("Client was closed and is not queryable"))}),i):(this._queryQueue.push(n),this._pulseQueryQueue(), i):(n.native=this.native,w.nextTick(()=>{n.handleError(new Error("Client has encountered a connectio\ -n error and is not queryable"))}),i)};se.prototype.end=function(r){var e=this;this._ending=!0,this._connected|| +n error and is not queryable"))}),i)};oe.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")), -w.nextTick(()=>{e.emit("end"),r&&r()})}),t};se.prototype._hasActiveQuery=function(){return this._activeQuery&& -this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};se.prototype._pulseQueryQueue=function(r){ +w.nextTick(()=>{e.emit("end"),r&&r()})}),t};oe.prototype._hasActiveQuery=function(){return this._activeQuery&& +this._activeQuery.state!=="error"&&this._activeQuery.state!=="end"};oe.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()})}}; -se.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. -indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};se.prototype.ref=function(){}; -se.prototype.unref=function(){};se.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( -r,e,t)};se.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var vi=P((Gp,xa)=>{"use strict";p();xa.exports=ba()});var Bt=P((Kp,Lt)=>{"use strict";p();var Df=sa(),Of=Ct(),Nf=di(),qf=la(),{DatabaseError:Qf}=ci(),jf=a( -r=>{var e;return e=class extends qf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),Ei=a( -function(r){this.defaults=Of,this.Client=r,this.Query=this.Client.Query,this.Pool=jf(this.Client),this. -_pools=[],this.Connection=Nf,this.types=Et(),this.DatabaseError=Qf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< -"u"?Lt.exports=new Ei(vi()):(Lt.exports=new Ei(Df),Object.defineProperty(Lt.exports,"native",{configurable:!0, -enumerable:!1,get(){var r=null;try{r=new Ei(vi())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. -defineProperty(Lt.exports,"native",{value:r}),r}}))});p();p();Ye();Rr();p();var wu=Object.defineProperty,gu=Object.defineProperties,bu=Object.getOwnPropertyDescriptors,ls=Object. -getOwnPropertySymbols,xu=Object.prototype.hasOwnProperty,Su=Object.prototype.propertyIsEnumerable,cs=a( -(r,e,t)=>e in r?wu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), -vu=a((r,e)=>{for(var t in e||(e={}))xu.call(e,t)&&cs(r,t,e[t]);if(ls)for(var t of ls(e))Su.call(e,t)&& -cs(r,t,e[t]);return r},"__spreadValues"),Eu=a((r,e)=>gu(r,bu(e)),"__spreadProps"),Au=1008e3,fs=new Uint8Array( -new Uint16Array([258]).buffer)[0]===2,_u=new TextDecoder,Pr=new TextEncoder,qt=Pr.encode("0123456789\ -abcdef"),Qt=Pr.encode("0123456789ABCDEF"),Cu=Pr.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ -stuvwxyz0123456789+/");var hs=Cu.slice();hs[62]=45;hs[63]=95;var ct,jt;function Iu(r,{alphabet:e,scratchArr:t}={}){if(!ct)if(ct= -new Uint16Array(256),jt=new Uint16Array(256),fs)for(let C=0;C<256;C++)ct[C]=qt[C&15]<<8|qt[C>>>4],jt[C]= -Qt[C&15]<<8|Qt[C>>>4];else for(let C=0;C<256;C++)ct[C]=qt[C&15]|qt[C>>>4]<<8,jt[C]=Qt[C&15]|Qt[C>>>4]<< +oe.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. +indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};oe.prototype.ref=function(){}; +oe.prototype.unref=function(){};oe.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( +r,e,t)};oe.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var Ai=P((Kp,va)=>{"use strict";p();va.exports=Sa()});var Lt=P((Yp,Ft)=>{"use strict";p();var Nf=aa(),qf=It(),Qf=yi(),jf=fa(),{DatabaseError:Wf}=hi(),Hf=a( +r=>{var e;return e=class extends jf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),_i=a( +function(r){this.defaults=qf,this.Client=r,this.Query=this.Client.Query,this.Pool=Hf(this.Client),this. +_pools=[],this.Connection=Qf,this.types=At(),this.DatabaseError=Wf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< +"u"?Ft.exports=new _i(Ai()):(Ft.exports=new _i(Nf),Object.defineProperty(Ft.exports,"native",{configurable:!0, +enumerable:!1,get(){var r=null;try{r=new _i(Ai())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. +defineProperty(Ft.exports,"native",{value:r}),r}}))});p();p();Je();Br();p();var bu=Object.defineProperty,xu=Object.defineProperties,Su=Object.getOwnPropertyDescriptors,fs=Object. +getOwnPropertySymbols,vu=Object.prototype.hasOwnProperty,Eu=Object.prototype.propertyIsEnumerable,hs=a( +(r,e,t)=>e in r?bu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), +Au=a((r,e)=>{for(var t in e||(e={}))vu.call(e,t)&&hs(r,t,e[t]);if(fs)for(var t of fs(e))Eu.call(e,t)&& +hs(r,t,e[t]);return r},"__spreadValues"),_u=a((r,e)=>xu(r,Su(e)),"__spreadProps"),Cu=1008e3,ds=new Uint8Array( +new Uint16Array([258]).buffer)[0]===2,Iu=new TextDecoder,Lr=new TextEncoder,Qt=Lr.encode("0123456789\ +abcdef"),jt=Lr.encode("0123456789ABCDEF"),Tu=Lr.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ +stuvwxyz0123456789+/");var ps=Tu.slice();ps[62]=45;ps[63]=95;var ft,Wt;function Ru(r,{alphabet:e,scratchArr:t}={}){if(!ft)if(ft= +new Uint16Array(256),Wt=new Uint16Array(256),ds)for(let C=0;C<256;C++)ft[C]=Qt[C&15]<<8|Qt[C>>>4],Wt[C]= +jt[C&15]<<8|jt[C>>>4];else for(let C=0;C<256;C++)ft[C]=Qt[C&15]|Qt[C>>>4]<<8,Wt[C]=jt[C&15]|jt[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),l=new Uint32Array(o.buffer,o.byteOffset,i),c=e==="upper"?jt:ct,f=0,y=0,g;if(fs) -for(;f>>8&255]<<16|c[g&255],l[y++]=c[g>>>24]<<16|c[g>>>16&255];else for(;f>>24]<<16|c[g>>>16&255],l[y++]=c[g>>>8&255]<<16|c[g&255];for(f<<=2;f>>1,s=Math. -ceil(n/i),o=new Uint16Array(s>1?i:n);for(let u=0;u>>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;ut[he(this. _mapKey.has(i)?this._mapKey.get(i):i)]=n),t}mapDecode(e,t){let n=this.decode(e);if(this._keyMap)switch(n. -constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return As( -()=>(Nr(),this?this.decode(e,t):dt.prototype.decode.call(ms,e,t)));je=t>-1?t:e.length,h=0,Fr=0,pt=0, -$t=null,Lr=bs,j=null,x=e;try{X=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ +constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return Cs( +()=>(Qr(),this?this.decode(e,t):pt.prototype.decode.call(gs,e,t)));je=t>-1?t:e.length,h=0,Mr=0,yt=0, +Gt=null,kr=Ss,j=null,x=e;try{X=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ throw x=null,e instanceof Uint8Array?n:new Error("Source must be a Uint8Array or Buffer but was a "+ -(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof dt){if(B=this,ne=this.sharedValues&& +(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof pt){if(B=this,ne=this.sharedValues&& (this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this. -structures)return N=this.structures,Wt();(!N||N.length>0)&&(N=[])}else B=ms,(!N||N.length>0)&&(N=[]), -ne=null;return Wt()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;yt=!0;let o=this?this.decode(e, -s):Qr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=j.postBundlePosition){let e=new Error("Unexpected bundle pos\ +structures)return N=this.structures,Ht();(!N||N.length>0)&&(N=[])}else B=gs,(!N||N.length>0)&&(N=[]), +ne=null;return Ht()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;mt=!0;let o=this?this.decode(e, +s):Wr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=j.postBundlePosition){let e=new Error("Unexpected bundle pos\ ition");throw e.incomplete=!0,e}h=j.postBundlePosition,j=null}if(h==je)N=null,x=null,fe&&(fe=null);else if(h> -je){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!yt)throw new Error( -"Data read, but end of buffer not reached");return r}catch(r){throw Nr(),(r instanceof RangeError||r. -message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a(Wt,"checkedRead");function L(){ -let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return ku();r=X. -getUint16(h),h+=2;break;case 26:if(e==7){let t=X.getFloat32(h);if(B.useFloat32>2){let n=_s[(x[h]&127)<< +je){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!mt)throw new Error( +"Data read, but end of buffer not reached");return r}catch(r){throw Qr(),(r instanceof RangeError||r. +message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a(Ht,"checkedRead");function L(){ +let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return Du();r=X. +getUint16(h),h+=2;break;case 26:if(e==7){let t=X.getFloat32(h);if(B.useFloat32>2){let n=Is[(x[h]&127)<< 1|x[h+1]>>7];return h+=4,(n*t+(t>0?.5:-.5)>>0)/n}return h+=4,t}if(r=X.getUint32(h),h+=4,e===1)return-1- r;break;case 27:if(e==7){let t=X.getFloat64(h);return h+=8,t}if(e>1){if(X.getUint32(h)>0)throw new Error( "JavaScript does not support arrays, maps, or strings with length over 4294967295");r=X.getUint32(h+ 4)}else B.int64AsNumber?(r=X.getUint32(h)*4294967296,r+=X.getUint32(h+4)):r=X.getBigUint64(h);h+=8;break;case 31: switch(e){case 2:case 3:throw new Error("Indefinite length not supported for byte or text strings");case 4: -let t=[],n,i=0;for(;(n=L())!=Je;){if(i>=ft)throw new Error(`Array length exceeds ${ft}`);t[i++]=n}return e== +let t=[],n,i=0;for(;(n=L())!=Ze;){if(i>=ht)throw new Error(`Array length exceeds ${ht}`);t[i++]=n}return e== 4?t:e==3?t.join(""):m.concat(t);case 5:let s;if(B.mapsAsObjects){let o={},u=0;if(B.keyMap)for(;(s=L())!= -Je;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[he(B.decodeKey(s))]=L()}else for(;(s= -L())!=Je;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[he(s)]=L()}return o}else{ht&& -(B.mapsAsObjects=!0,ht=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s=L())!=Je;){if(u++>=Ae)throw new Error( -`Map size exceeds ${Ae}`);o.set(B.decodeKey(s),L())}}else{let u=0;for(;(s=L())!=Je;){if(u++>=Ae)throw new Error( -`Map size exceeds ${Ae}`);o.set(s,L())}}return o}case 7:return Je;default:throw new Error("Invalid m\ +Ze;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[he(B.decodeKey(s))]=L()}else for(;(s= +L())!=Ze;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[he(s)]=L()}return o}else{dt&& +(B.mapsAsObjects=!0,dt=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s=L())!=Ze;){if(u++>=Ae)throw new Error( +`Map size exceeds ${Ae}`);o.set(B.decodeKey(s),L())}}else{let u=0;for(;(s=L())!=Ze;){if(u++>=Ae)throw new Error( +`Map size exceeds ${Ae}`);o.set(s,L())}}return o}case 7:return Ze;default:throw new Error("Invalid m\ ajor type for indefinite length "+e)}default:throw new Error("Unknown token "+r)}switch(e){case 0:return r;case 1: -return~r;case 2:return Mu(r);case 3:if(pt>=h)return $t.slice(h-Gt,(h+=r)-Gt);if(pt==0&&je<140&&r<32){ -let i=r<16?Ss(r):Fu(r);if(i!=null)return i}return Lu(r);case 4:if(r>=ft)throw new Error(`Array lengt\ -h exceeds ${ft}`);let t=new Array(r);for(let i=0;i=Ae)throw new Error( -`Map size exceeds ${ft}`);if(B.mapsAsObjects){let i={};if(B.keyMap)for(let s=0;s=h)return Gt.slice(h-Vt,(h+=r)-Vt);if(yt==0&&je<140&&r<32){ +let i=r<16?Es(r):Mu(r);if(i!=null)return i}return ku(r);case 4:if(r>=ht)throw new Error(`Array lengt\ +h exceeds ${ht}`);let t=new Array(r);for(let i=0;i=Ae)throw new Error( +`Map size exceeds ${ht}`);if(B.mapsAsObjects){let i={};if(B.keyMap)for(let s=0;s=ps){let i=N[r&8191];if(i)return i.read||(i.read=Ur(i)),i.read();if(r<65536){if(r== -Bu){let s=Xe(),o=L(),u=L();Or(o,u);let l={};if(B.keyMap)for(let c=2;c=ms){let i=N[r&8191];if(i)return i.read||(i.read=Or(i)),i.read();if(r<65536){if(r== +Fu){let s=et(),o=L(),u=L();qr(o,u);let c={};if(B.keyMap)for(let l=2;l23)switch(t){case 24:t=x[h++];break;case 25:t=X.getUint16(h),h+=2;break;case 26:t=X.getUint32( h),h+=4;break;default:throw new Error("Expected array header, but got "+x[h-1])}let n=this.compiledReader; -for(;n;){if(n.propertyCount===t)return n(L);n=n.next}if(this.slowReads++>=xs){let s=this.length==t?this: -this.slice(0,t);return n=B.keyMap?new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>ws.test( -o)?he(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>ws. +for(;n;){if(n.propertyCount===t)return n(L);n=n.next}if(this.slowReads++>=vs){let s=this.length==t?this: +this.slice(0,t);return n=B.keyMap?new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>bs.test( +o)?he(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>bs. test(o)?he(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"),this.compiledReader&&(n.next=this. compiledReader),n.propertyCount=t,this.compiledReader=n,n(L)}let i={};if(B.keyMap)for(let s=0;s64&&Br)return Br.decode(x.subarray(h,h+=r));let t=h+ +if(r==null)return r+"";throw new Error("Invalid property name type "+typeof r)}a(he,"safeKey");var ku=Nr;function Nr(r){let e;if(r<16&&(e=Es(r)))return e;if(r>64&&Fr)return Fr.decode(x.subarray(h,h+=r));let t=h+ r,n=[];for(e="";h=t||(x[h]& 192)!==128)n.push(65533);else{let s=x[h++]&63;n.push((i&31)<<6|s)}else if((i&240)===224){let s=h=t||(s&192)!==128||i===224&&s<160||i===237&&s>=160)n.push(65533);else if(h++,h>=t||(x[h]&192)!== 128)n.push(65533);else{let o=x[h++]&63;n.push((i&31)<<12|(s&63)<<6|o)}}else if((i&248)===240){let s=h< t?x[h]:0;if(i>244||h>=t||(s&192)!==128||i===240&&s<144||i===244&&s>=144)n.push(65533);else if(h++,h>= t||(x[h]&192)!==128)n.push(65533);else{let o=x[h++]&63;if(h>=t||(x[h]&192)!==128)n.push(65533);else{ -let u=x[h++]&63,l=(i&7)<<18|(s&63)<<12|o<<6|u;l-=65536,n.push(l>>>10&1023|55296),n.push(56320|l&1023)}}}else +let u=x[h++]&63,c=(i&7)<<18|(s&63)<<12|o<<6|u;c-=65536,n.push(c>>>10&1023|55296),n.push(56320|c&1023)}}}else n.push(65533);n.length>=4096&&(e+=V.apply(String,n),n.length=0)}return n.length>0&&(e+=V.apply(String, -n)),e}a(Dr,"readStringJS");var V=String.fromCharCode;function Fu(r){let e=h,t=new Array(r);for(let n=0;n< -r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return V.apply(String,t)}a(Fu,"longStringInJS"); -function Ss(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return V(e)}}else{ +n)),e}a(Nr,"readStringJS");var V=String.fromCharCode;function Mu(r){let e=h,t=new Array(r);for(let n=0;n< +r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return V.apply(String,t)}a(Mu,"longStringInJS"); +function Es(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return V(e)}}else{ let e=x[h++],t=x[h++];if((e&128)>0||(t&128)>0){h-=2;return}if(r<3)return V(e,t);let n=x[h++];if((n&128)> 0){h-=3;return}return V(e,t,n)}else{let e=x[h++],t=x[h++],n=x[h++],i=x[h++];if((e&128)>0||(t&128)>0|| (n&128)>0||(i&128)>0){h-=4;return}if(r<6){if(r===4)return V(e,t,n,i);{let s=x[h++];if((s&128)>0){h-= 5;return}return V(e,t,n,i,s)}}else if(r<8){let s=x[h++],o=x[h++];if((s&128)>0||(o&128)>0){h-=6;return} if(r<7)return V(e,t,n,i,s,o);let u=x[h++];if((u&128)>0){h-=7;return}return V(e,t,n,i,s,o,u)}else{let s=x[h++], -o=x[h++],u=x[h++],l=x[h++];if((s&128)>0||(o&128)>0||(u&128)>0||(l&128)>0){h-=8;return}if(r<10){if(r=== -8)return V(e,t,n,i,s,o,u,l);{let c=x[h++];if((c&128)>0){h-=9;return}return V(e,t,n,i,s,o,u,l,c)}}else if(r< -12){let c=x[h++],f=x[h++];if((c&128)>0||(f&128)>0){h-=10;return}if(r<11)return V(e,t,n,i,s,o,u,l,c,f); -let y=x[h++];if((y&128)>0){h-=11;return}return V(e,t,n,i,s,o,u,l,c,f,y)}else{let c=x[h++],f=x[h++],y=x[h++], -g=x[h++];if((c&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return V(e,t, -n,i,s,o,u,l,c,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return V(e,t,n,i,s,o,u,l,c,f,y,g,E)}}else{ -let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return V(e,t,n,i,s,o,u,l,c,f,y,g, -E,C);let W=x[h++];if((W&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,l,c,f,y,g,E,C,W)}}}}}a(Ss,"short\ -StringInJS");function Mu(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( -h,h+=r)}a(Mu,"readBin");var vs=new Float32Array(1),Ht=new Uint8Array(vs.buffer,0,4);function ku(){let r=x[h++],e=x[h++],t=(r& +o=x[h++],u=x[h++],c=x[h++];if((s&128)>0||(o&128)>0||(u&128)>0||(c&128)>0){h-=8;return}if(r<10){if(r=== +8)return V(e,t,n,i,s,o,u,c);{let l=x[h++];if((l&128)>0){h-=9;return}return V(e,t,n,i,s,o,u,c,l)}}else if(r< +12){let l=x[h++],f=x[h++];if((l&128)>0||(f&128)>0){h-=10;return}if(r<11)return V(e,t,n,i,s,o,u,c,l,f); +let y=x[h++];if((y&128)>0){h-=11;return}return V(e,t,n,i,s,o,u,c,l,f,y)}else{let l=x[h++],f=x[h++],y=x[h++], +g=x[h++];if((l&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return V(e,t, +n,i,s,o,u,c,l,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E)}}else{ +let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return V(e,t,n,i,s,o,u,c,l,f,y,g, +E,C);let W=x[h++];if((W&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E,C,W)}}}}}a(Es,"short\ +StringInJS");function Uu(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( +h,h+=r)}a(Uu,"readBin");var As=new Float32Array(1),$t=new Uint8Array(As.buffer,0,4);function Du(){let r=x[h++],e=x[h++],t=(r& 127)>>2;if(t===31)return e||r&3?NaN:r&128?-1/0:1/0;if(t===0){let n=((r&3)<<8|e)/16777216;return r&128? --n:n}return Ht[3]=r&128|(t>>1)+56,Ht[2]=(r&7)<<5|e>>3,Ht[1]=e<<5,Ht[0]=0,vs[0]}a(ku,"getFloat16");var ch=new Array( -4096);var jr=class jr{constructor(e,t){this.value=e,this.tag=t}};a(jr,"Tag");var et=jr;q[0]=r=>new Date(r); +-n:n}return $t[3]=r&128|(t>>1)+56,$t[2]=(r&7)<<5|e>>3,$t[1]=e<<5,$t[0]=0,As[0]}a(Du,"getFloat16");var hh=new Array( +4096);var Hr=class Hr{constructor(e,t){this.value=e,this.tag=t}};a(Hr,"Tag");var tt=Hr;q[0]=r=>new Date(r); q[1]=r=>new Date(Math.round(r*1e3));q[2]=r=>{let e=BigInt(0);for(let t=0,n=r.byteLength;tBigInt(-1)-q[2](r);q[4]=r=>+(r[1]+"e"+r[0]);q[5]=r=>r[1]*Math. -exp(r[0]*Math.log(2));var Or=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. -restoreStructures=[]))[r]=t),N[r]=e,e.read=Ur(e)},"recordDefinition");q[Ru]=r=>{let e=r.length,t=r[1]; -Or(r[0],t);let n={};for(let i=2;ij?j[0].slice( -j.position0,j.position0+=r):new et(r,14);q[15]=r=>j?j[1].slice(j.position1,j.position1+=r):new et(r, -15);var Uu={Error,RegExp};q[27]=r=>(Uu[r[0]]||Error)(r[1],r[2]);var Es=a(r=>{if(x[h++]!=132){let t=new Error( +exp(r[0]*Math.log(2));var qr=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. +restoreStructures=[]))[r]=t),N[r]=e,e.read=Or(e)},"recordDefinition");q[Bu]=r=>{let e=r.length,t=r[1]; +qr(r[0],t);let n={};for(let i=2;ij?j[0].slice( +j.position0,j.position0+=r):new tt(r,14);q[15]=r=>j?j[1].slice(j.position1,j.position1+=r):new tt(r, +15);var Ou={Error,RegExp};q[27]=r=>(Ou[r[0]]||Error)(r[1],r[2]);var _s=a(r=>{if(x[h++]!=132){let t=new Error( "Packed values structure must be followed by a 4 element array");throw x.length{if(!ne)if(B.getShared)qr();else return new et( -r,ys);if(typeof r=="number")return ne[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ +r(),r()},"packedTable");_s.handlesRead=!0;q[51]=_s;q[ws]=r=>{if(!ne)if(B.getShared)jr();else return new tt( +r,ws);if(typeof r=="number")return ne[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ ger packed references yet");throw r===void 0&&(e.incomplete=!0),e};q[28]=r=>{fe||(fe=new Map,fe.id=0); let e=fe.id++,t=h,n=x[h],i;n>>5==4?i=[]:i={};let s={target:i};fe.set(e,s);let o=r();return s.used?(Object. getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(h=t,i=o,fe.set(e,{target:i}),o=r()),Object.assign(i,o)): (s.target=o,o)};q[28].handlesRead=!0;q[29]=r=>{let e=fe.get(r);return e.used=!0,e.target};q[258]=r=>new Set( -r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,ht=!0),r())).handlesRead=!0;function Ze(r,e){return typeof r== -"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Ze,"combine");function Qe(){if(!ne) -if(B.getShared)qr();else throw new Error("No packed values available");return ne}a(Qe,"getPackedValu\ -es");var Du=1399353956;Mr.push((r,e)=>{if(r>=225&&r<=255)return Ze(Qe().prefixes[r-224],e);if(r>=28704&& -r<=32767)return Ze(Qe().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return Ze(Qe().prefixes[r- -1879048192],e);if(r>=216&&r<=223)return Ze(e,Qe().suffixes[r-216]);if(r>=27647&&r<=28671)return Ze(e, -Qe().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return Ze(e,Qe().suffixes[r-1811939328]);if(r== -Du)return{packedValues:ne,structures:N.slice(0),version:e};if(r==55799)return e});var Ou=new Uint8Array( -new Uint16Array([1]).buffer)[0]==1,gs=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> +r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,dt=!0),r())).handlesRead=!0;function Xe(r,e){return typeof r== +"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Xe,"combine");function Qe(){if(!ne) +if(B.getShared)jr();else throw new Error("No packed values available");return ne}a(Qe,"getPackedValu\ +es");var Nu=1399353956;Ur.push((r,e)=>{if(r>=225&&r<=255)return Xe(Qe().prefixes[r-224],e);if(r>=28704&& +r<=32767)return Xe(Qe().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return Xe(Qe().prefixes[r- +1879048192],e);if(r>=216&&r<=223)return Xe(e,Qe().suffixes[r-216]);if(r>=27647&&r<=28671)return Xe(e, +Qe().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return Xe(e,Qe().suffixes[r-1811939328]);if(r== +Nu)return{packedValues:ne,structures:N.slice(0),version:e};if(r==55799)return e});var qu=new Uint8Array( +new Uint16Array([1]).buffer)[0]==1,xs=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> "u"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"? -{name:"BigInt64Array"}:BigInt64Array,Float32Array,Float64Array],Nu=[64,68,69,70,71,72,77,78,79,85,86]; -for(let r=0;r{if(!r)throw new Error("Could not find typed array for code "+e); +2:n==8?3:0;q[i?e:e-4]=n==1||i==qu?o=>{if(!r)throw new Error("Could not find typed array for code "+e); return!B.copyBuffers&&(n===1||n===2&&!(o.byteOffset&1)||n===4&&!(o.byteOffset&3)||n===8&&!(o.byteOffset& 7))?new r(o.buffer,o.byteOffset,o.byteLength>>s):new r(Uint8Array.prototype.slice.call(o,0).buffer)}: o=>{if(!r)throw new Error("Could not find typed array for code "+e);let u=new DataView(o.buffer,o.byteOffset, -o.byteLength),l=o.length>>s,c=new r(l),f=u[t];for(let y=0;y23)switch(r){case 24:r=x[h++];break;case 25:r=X.getUint16( -h),h+=2;break;case 26:r=X.getUint32(h),h+=4;break}return r}a(Xe,"readJustLength");function qr(){if(B. -getShared){let r=As(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ne= -B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(qr, -"loadShared");function As(r){let e=je,t=h,n=Fr,i=Gt,s=pt,o=$t,u=Lr,l=fe,c=j,f=new Uint8Array(x.slice( -0,je)),y=N,g=B,E=yt,C=r();return je=e,h=t,Fr=n,Gt=i,pt=s,$t=o,Lr=u,fe=l,j=c,x=f,yt=E,N=y,B=g,X=new DataView( -x.buffer,x.byteOffset,x.byteLength),C}a(As,"saveState");function Nr(){x=null,fe=null,N=null}a(Nr,"cl\ -earSource");var _s=new Array(147);for(let r=0;r<256;r++)_s[r]=+("1e"+Math.floor(45.15-r*.30103));var Qr=new kr({ -useRecords:!1}),fh=Qr.decode,Cs=Qr.decodeMultiple;p();var Vt=class Vt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ +o.byteLength),c=o.length>>s,l=new r(c),f=u[t];for(let y=0;y23)switch(r){case 24:r=x[h++];break;case 25:r=X.getUint16( +h),h+=2;break;case 26:r=X.getUint32(h),h+=4;break}return r}a(et,"readJustLength");function jr(){if(B. +getShared){let r=Cs(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ne= +B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(jr, +"loadShared");function Cs(r){let e=je,t=h,n=Mr,i=Vt,s=yt,o=Gt,u=kr,c=fe,l=j,f=new Uint8Array(x.slice( +0,je)),y=N,g=B,E=mt,C=r();return je=e,h=t,Mr=n,Vt=i,yt=s,Gt=o,kr=u,fe=c,j=l,x=f,mt=E,N=y,B=g,X=new DataView( +x.buffer,x.byteOffset,x.byteLength),C}a(Cs,"saveState");function Qr(){x=null,fe=null,N=null}a(Qr,"cl\ +earSource");var Is=new Array(147);for(let r=0;r<256;r++)Is[r]=+("1e"+Math.floor(45.15-r*.30103));var Wr=new Dr({ +useRecords:!1}),dh=Wr.decode,Ts=Wr.decodeMultiple;p();var Kt=class Kt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ let{strings:t,values:n}=this;for(let i=0,s=t.length;iu.length!==0).map(u=>JSON.parse(u)):Cs(new Uint8Array(await r.arrayBuffer())),i=n.at(-1); -if(!Array.isArray(i)||i[0]!==3&&i[0]!==4)throw new pe("Neon internal error: streamed response ended \ -without a terminal message");if(i[0]===4&&i.length===2&&i[1]!==null&&typeof i[1]=="object")throw ho( -i[1]);if(i[0]!==3||i.length!==1)throw new pe("Neon internal error: unexpected streamed response stat\ -us");let s=[],o;for(let u of n.slice(0,-1)){Array.isArray(u)||Be();let[l,...c]=u;switch(l){case Jl:o!== -void 0&&Be(),o={fields:c,rows:[]};break;case Yl:(o===void 0||c.length===0)&&Be();let f=o.row??(o.row= -[]);for(let[y,g]of c.entries()){if((f.length>=o.fields.length||Array.isArray(g)&&(g.length!==1||typeof g[0]!= -"string")||!Array.isArray(g)&&g!==null&&typeof g!="string")&&Be(),Array.isArray(g)){(o.partialText?? -(o.partialText=[])).push(g[0]);continue}g===null?(o.partialText!==void 0&&Be(),f.push(null)):(o.partialText=== -void 0?f.push(g):(o.partialText.push(g),f.push(o.partialText.join(""))),o.partialText=void 0),f.length=== -o.fields.length&&(y!==c.length-1&&Be(),o.rows.push(f),o.row=void 0)}break;case Zl:(o===void 0||o.row!== -void 0||o.partialText!==void 0||c.length!==2)&&Be(),s.push({fields:o.fields,rows:o.rows,command:c[0], -rowCount:c[1]}),o=void 0;break;default:Be()}}if(o!==void 0||!t&&s.length!==1)throw new pe("Neon inte\ -rnal error: incomplete streamed response");return t?{results:s}:s[0]}a(Xl,"readStreamingResult");function ec(r){ -return r instanceof m?"\\x"+ds(r):r}a(ec,"encodeBuffersAsBytea");function uo(r){let{query:e,params:t}=r instanceof -mt?r.toParameterizedQuery():r;return{query:e,params:t.map(n=>ec((0,fo.prepareValue)(n)))}}a(uo,"prep\ -areQuery");function po(r,{arrayMode:e,fullResults:t,fetchOptions:n,responseFormat:i,isolationLevel:s, -readOnly:o,deferrable:u,authToken:l,disableWarningInBrowsers:c}={}){if(!r)throw new Error("No databa\ -se connection string was provided to `neon()`. Perhaps an environment variable has not been set?");let f; -try{f=Tr(r)}catch{throw new Error("Database connection string provided to `neon()` is not a valid UR\ -L. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E,port:C,pathname:W}=f;if(y!== -"postgres:"&&y!=="postgresql:"||!g||!E||!W)throw new Error("Database connection string format for `n\ -eon()` should be: postgresql://user@host.tld/dbname?option=value");function Y(T,...b){if(!(Array.isArray( -T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can now be called only as\ - a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], options). For a con\ -ventional function call with value placeholders ($1, $2, etc.), use sql.query("SELECT $1", [value], \ -options).');return new We(me,new mt(T,b))}a(Y,"templateFn"),Y.query=(T,b,M)=>new We(me,{query:T,params:b?? -[]},M),Y.unsafe=T=>new wt(T),Y.transaction=async(T,b)=>{if(typeof T=="function"&&(T=T(Y)),!Array.isArray( -T))throw new Error(ao);T.forEach(H=>{if(!(H instanceof We))throw new Error(ao)});let M=T.map(H=>H.queryData), -oe=T.map(H=>H.opts??{});return me(M,oe,b)};async function me(T,b,M){let{fetchEndpoint:oe,fetchFunction:H}=Se, -we=Array.isArray(T),Ce=we?{queries:T.map(le=>uo(le))}:uo(T),ue=n??{},F=i??"json",J=e??!1,ve=t??!1,Ie=s, -Me=o,ke=u;M!==void 0&&(M.fetchOptions!==void 0&&(ue={...ue,...M.fetchOptions}),M.arrayMode!==void 0&& -(J=M.arrayMode),M.fullResults!==void 0&&(ve=M.fullResults),M.responseFormat!==void 0&&(F=M.responseFormat), -M.isolationLevel!==void 0&&(Ie=M.isolationLevel),M.readOnly!==void 0&&(Me=M.readOnly),M.deferrable!== -void 0&&(ke=M.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!==void 0&&(ue={...ue,...b.fetchOptions}), -b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(F=b.responseFormat);let Ue=l;!Array.isArray( -b)&&b?.authToken!==void 0&&(Ue=b.authToken);let dr=typeof oe=="function"?oe(E,C,{jwtAuth:Ue!==void 0}): -oe,De={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"true","Neon-Array-Mode":"true",Accept:zl[F]}, -Te=await tc(Ue);Te&&(De.Authorization=`Bearer ${Te}`),we&&(Ie!==void 0&&(De["Neon-Batch-Isolation-Le\ -vel"]=Ie),Me!==void 0&&(De["Neon-Batch-Read-Only"]=String(Me)),ke!==void 0&&(De["Neon-Batch-Deferrab\ -le"]=String(ke))),c||Se.disableWarningInBrowsers||Kt();let Z;try{Z=await(H??fetch)(dr,{method:"POST", -body:JSON.stringify(Ce),headers:De,...ue})}catch(le){let ae=new pe(`Error connecting to database: ${le}`); -throw ae.sourceError=le,ae}if(Z.ok){let le=F==="json"?await Z.json():await Xl(Z,F,we);if(we){let ae=le. -results;if(!Array.isArray(ae))throw new pe("Neon internal error: unexpected result format");return ae. -map((pr,yr)=>{let mr=b[yr]??{},Aa=mr.arrayMode??J,_a=mr.fullResults??ve;return lo(pr,{arrayMode:Aa,fullResults:_a, -types:mr.types})})}else{let ae=b??{},pr=ae.arrayMode??J,yr=ae.fullResults??ve;return lo(le,{arrayMode:pr, -fullResults:yr,types:ae.types})}}else{let{status:le}=Z;if(le===400){let ae=await Z.json();throw ho(ae)}else{ -let ae=await Z.text();throw new pe(`Server error (HTTP status ${le}): ${ae}`)}}}return a(me,"execute"), -Y}a(po,"neon");var sn=class sn{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(sn,"Neon\ -QueryPromise");var We=sn;function lo(r,{arrayMode:e,fullResults:t,types:n}){let i=new co.default(n), -s=r.fields.map(l=>l.name),o=r.fields.map(l=>i.getTypeParser(l.dataTypeID)),u=e===!0?r.rows.map(l=>l. -map((c,f)=>c===null?null:o[f](c))):r.rows.map(l=>Object.fromEntries(l.map((c,f)=>[s[f],c===null?null: -o[f](c)])));return t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=u,r._parsers=o,r._types=i,r):u}a(lo,"p\ -rocessQueryResult");async function tc(r){if(typeof r=="string")return r;if(typeof r=="function")try{ -return await Promise.resolve(r())}catch(e){let t=new pe("Error getting auth token.");throw e instanceof -Error&&(t=new pe(`Error getting auth token: ${e.message}`)),t}}a(tc,"getAuthToken");p();var va=Oe(Bt());p();var Sa=Oe(Bt());var Ai=class Ai extends Sa.Client{constructor(t){super(t);this.config=t}get neonConfig(){return this. +Jc=0,Zc=1,Xc=2;function el(r){switch(r.headers.get("Content-Type")?.split(";",1)[0].trim().toLowerCase()){case rr. +json:return"json";case rr.jsonl:return"jsonl";case rr["cbor-seq"]:return"cbor-seq";default:return}}a( +el,"getResponseFormat");function yo(r){let e=new se(r.message);for(let t of Yc)e[t]=r[t]??void 0;return e} +a(yo,"dbError");function Be(){throw new se("Neon internal error: unexpected streamed response messag\ +e")}a(Be,"unexpectedStreamingMessage");async function tl(r,e,t){let n=e==="jsonl"?(await r.text()).split( +` +`).filter(u=>u.length!==0).map(u=>JSON.parse(u)):Ts(new Uint8Array(await r.arrayBuffer())),i=n.pop(); +if(i===null||typeof i!="object"||Array.isArray(i))throw new se("Neon internal error: streamed respon\ +se ended without a terminal message");if("message"in i)throw typeof i.message!="string"?new se("Neon\ + internal error: unexpected streamed response status"):yo(i);if(Object.keys(i).length!==0)throw new se( +"Neon internal error: unexpected streamed response status");let s=[],o;for(let u of n){Array.isArray( +u)||Be();let[c,...l]=u;switch(c){case Zc:o!==void 0&&Be(),o={fields:l,rows:[]};break;case Jc:if((o=== +void 0||l.length===0&&o.fields.length!==0)&&Be(),l.length===0){o.rows.push([]);break}let f=o.row??(o. +row=[]);for(let[y,g]of l.entries()){if((f.length>=o.fields.length||Array.isArray(g)&&(g.length!==1|| +typeof g[0]!="string")||!Array.isArray(g)&&g!==null&&typeof g!="string")&&Be(),Array.isArray(g)){(o. +partialText??(o.partialText=[])).push(g[0]);continue}g===null?(o.partialText!==void 0&&Be(),f.push(null)): +(o.partialText===void 0?f.push(g):(o.partialText.push(g),f.push(o.partialText.join(""))),o.partialText= +void 0),f.length===o.fields.length&&(y!==l.length-1&&Be(),o.rows.push(f),o.row=void 0)}break;case Xc: +(o===void 0||o.row!==void 0||o.partialText!==void 0||l.length!==2)&&Be(),s.push({fields:o.fields,rows:o. +rows,command:l[0],rowCount:l[1]}),o=void 0;break;default:Be()}}if(o!==void 0||s.length!==(t??1))throw new se( +"Neon internal error: incomplete streamed response");return t===void 0?s[0]:{results:s}}a(tl,"readSt\ +reamingResults");function rl(r){return r instanceof m?"\\x"+ys(r):r}a(rl,"encodeBuffersAsBytea");function lo(r){ +let{query:e,params:t}=r instanceof wt?r.toParameterizedQuery():r;return{query:e,params:t.map(n=>rl((0,po.prepareValue)( +n)))}}a(lo,"prepareQuery");function mo(r,{arrayMode:e,fullResults:t,fetchOptions:n,responseFormat:i, +isolationLevel:s,readOnly:o,deferrable:u,authToken:c,disableWarningInBrowsers:l}={}){if(!r)throw new Error( +"No database connection string was provided to `neon()`. Perhaps an environment variable has not bee\ +n set?");let f;try{f=Pr(r)}catch{throw new Error("Database connection string provided to `neon()` is\ + not a valid URL. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E,port:C,pathname:W}=f; +if(y!=="postgres:"&&y!=="postgresql:"||!g||!E||!W)throw new Error("Database connection string format\ + for `neon()` should be: postgresql://user@host.tld/dbname?option=value");function J(T,...b){if(!(Array. +isArray(T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can now be called\ + only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], options). F\ +or a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SELECT $1", [\ +value], options).');return new We(ye,new wt(T,b))}a(J,"templateFn"),J.query=(T,b,F)=>new We(ye,{query:T, +params:b??[]},F),J.unsafe=T=>new gt(T),J.transaction=async(T,b)=>{if(typeof T=="function"&&(T=T(J)), +!Array.isArray(T))throw new Error(co);T.forEach(H=>{if(!(H instanceof We))throw new Error(co)});let F=T. +map(H=>H.queryData),ae=T.map(H=>H.opts??{});return ye(F,ae,b)};async function ye(T,b,F){let{fetchEndpoint:ae, +fetchFunction:H}=xe,me=Array.isArray(T),Ce=me?{queries:T.map(ve=>lo(ve))}:lo(T),ce=n??{},M=i??"json", +Z=e??!1,Se=t??!1,Ie=s,ke=o,Me=u;F!==void 0&&(F.fetchOptions!==void 0&&(ce={...ce,...F.fetchOptions}), +F.arrayMode!==void 0&&(Z=F.arrayMode),F.fullResults!==void 0&&(Se=F.fullResults),F.responseFormat!== +void 0&&(M=F.responseFormat),F.isolationLevel!==void 0&&(Ie=F.isolationLevel),F.readOnly!==void 0&&(ke= +F.readOnly),F.deferrable!==void 0&&(Me=F.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!== +void 0&&(ce={...ce,...b.fetchOptions}),b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(M= +b.responseFormat);let Ue=c;!Array.isArray(b)&&b?.authToken!==void 0&&(Ue=b.authToken);let yr=typeof ae== +"function"?ae(E,C,{jwtAuth:Ue!==void 0}):ae,De={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ +rue","Neon-Array-Mode":"true",Accept:rr[M]},Te=await nl(Ue);Te&&(De.Authorization=`Bearer ${Te}`),me&& +(Ie!==void 0&&(De["Neon-Batch-Isolation-Level"]=Ie),ke!==void 0&&(De["Neon-Batch-Read-Only"]=String( +ke)),Me!==void 0&&(De["Neon-Batch-Deferrable"]=String(Me))),l||xe.disableWarningInBrowsers||zt();let z; +try{z=await(H??fetch)(yr,{method:"POST",body:JSON.stringify(Ce),headers:De,...ce})}catch(ve){let ue=new se( +`Error connecting to database: ${ve}`);throw ue.sourceError=ve,ue}let He=el(z);if(z.ok){if(He===void 0) +throw new se(`Neon internal error: unexpected response Content-Type: ${z.headers.get("Content-Type")?? +"missing"}`);let ve=He==="json"?await z.json():await tl(z,He,me?T.length:void 0);if(me){let ue=ve.results; +if(!Array.isArray(ue))throw new se("Neon internal error: unexpected result format");return ue.map((mr,wr)=>{ +let gr=b[wr]??{},Ca=gr.arrayMode??Z,Ia=gr.fullResults??Se;return fo(mr,{arrayMode:Ca,fullResults:Ia, +types:gr.types})})}else{let ue=b??{},mr=ue.arrayMode??Z,wr=ue.fullResults??Se;return fo(ve,{arrayMode:mr, +fullResults:wr,types:ue.types})}}else{let{status:ve}=z;if(He==="json"){let ue=await z.json();throw yo( +ue)}else{let ue=await z.text();throw new se(`Server error (HTTP status ${ve}): ${ue}`)}}}return a(ye, +"execute"),J}a(mo,"neon");var an=class an{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(an,"NeonQueryPromise");var We=an;function fo(r,{arrayMode:e,fullResults:t,types:n}){let i=new ho.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(fo,"p\ +rocessQueryResult");async function nl(r){if(typeof r=="string")return r;if(typeof r=="function")try{ +return await Promise.resolve(r())}catch(e){let t=new se("Error getting auth token.");throw e instanceof +Error&&(t=new se(`Error getting auth token: ${e.message}`)),t}}a(nl,"getAuthToken");p();var Aa=Oe(Lt());p();var Ea=Oe(Lt());var Ci=class Ci extends Ea.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\ @@ -1479,48 +1484,48 @@ s&&this.database===s&&this.password===null)throw new Error(`No database host or 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, -l=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let c=this.connection;if(u&&c.on( -"connect",()=>c.stream.emit("data","S")),l){c.removeAllListeners("authenticationCleartextPassword"), -c.removeAllListeners("readyForQuery"),c.once("readyForQuery",()=>c.on("readyForQuery",this._handleReadyForQuery. -bind(this)));let f=this.ssl?"sslconnect":"connect";c.on(f,()=>{this.neonConfig.disableWarningInBrowsers|| -Kt(),this._handleAuthCleartextPassword(),this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){ +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|| +zt(),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(Te=>{if(!/^.=/.test(Te))throw new Error( -"SASL: Invalid attribute pair entry");let Z=Te[0],le=Te.substring(2);return[Z,le]})),l=u.r,c=u.s,f=u. -i;if(!l||!/^[!-+--~]+$/.test(l))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unp\ -rintable");if(!c||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(c))throw new Error( +"SASL: Invalid attribute pair entry");let z=Te[0],He=Te.substring(2);return[z,He]})),c=u.r,l=u.s,f=u. +i;if(!c||!/^[!-+--~]+$/.test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unp\ +rintable");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(!l.startsWith(i.clientNonce)) -throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");if(l. +"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=m.from(c,"base64"),E=new TextEncoder,C=E.encode(s),W=await n.importKey( -"raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Y=new Uint8Array(await n.sign("HMAC",W,m.concat( -[g,m.from([0,0,0,1])]))),me=Y;for(var T=0;Tme[Z]^Y[Z]));let b=me,M=await n.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-2\ -56"}},!1,["sign"]),oe=new Uint8Array(await n.sign("HMAC",M,E.encode("Client Key"))),H=await n.digest( -"SHA-256",oe),we="n=*,r="+i.clientNonce,Ce="r="+l+",s="+c+",i="+y,ue="c=biws,r="+l,F=we+","+Ce+","+ue, -J=await n.importKey("raw",H,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var ve=new Uint8Array(await n. -sign("HMAC",J,E.encode(F))),Ie=m.from(oe.map((Te,Z)=>oe[Z]^ve[Z])),Me=Ie.toString("base64");let ke=await n. -importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Ue=await n.sign("HMAC",ke,E.encode( -"Server Key")),dr=await n.importKey("raw",Ue,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var De=m. -from(await n.sign("HMAC",dr,E.encode(F)));i.message="SASLResponse",i.serverSignature=De.toString("ba\ -se64"),i.response=ue+",p="+Me,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; -a(Ai,"NeonClient");var Ft=Ai;Ye();var Ea=Oe(sr());function Wf(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(Wf,"promisify");var Ci=class Ci extends va.Pool{constructor(){ -super(...arguments);I(this,"Client",Ft);I(this,"hasFetchUnsupportedListeners",!1);I(this,"addListene\ + short");let y=parseInt(f,10),g=m.from(l,"base64"),E=new TextEncoder,C=E.encode(s),W=await n.importKey( +"raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),J=new Uint8Array(await n.sign("HMAC",W,m.concat( +[g,m.from([0,0,0,1])]))),ye=J;for(var T=0;Tye[z]^J[z]));let b=ye,F=await n.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-2\ +56"}},!1,["sign"]),ae=new Uint8Array(await n.sign("HMAC",F,E.encode("Client Key"))),H=await n.digest( +"SHA-256",ae),me="n=*,r="+i.clientNonce,Ce="r="+c+",s="+l+",i="+y,ce="c=biws,r="+c,M=me+","+Ce+","+ce, +Z=await n.importKey("raw",H,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Se=new Uint8Array(await n. +sign("HMAC",Z,E.encode(M))),Ie=m.from(ae.map((Te,z)=>ae[z]^Se[z])),ke=Ie.toString("base64");let Me=await n. +importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Ue=await n.sign("HMAC",Me,E.encode( +"Server Key")),yr=await n.importKey("raw",Ue,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var De=m. +from(await n.sign("HMAC",yr,E.encode(M)));i.message="SASLResponse",i.serverSignature=De.toString("ba\ +se64"),i.response=ce+",p="+ke,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; +a(Ci,"NeonClient");var kt=Ci;Je();var _a=Oe(ar());function $f(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($f,"promisify");var Ti=class Ti extends Aa.Pool{constructor(){ +super(...arguments);I(this,"Client",kt);I(this,"hasFetchUnsupportedListeners",!1);I(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=Wf(this.Promise,i);i=s.callback;try{let o=new Ea.default( -this.options),u=encodeURIComponent,l=encodeURI,c=`postgresql://${u(o.user)}:${u(o.password)}@${u(o.host)}\ -/${l(o.database)}`,f=typeof t=="string"?t:t.text,y=n??t.values??[];po(c,{fullResults:!0,arrayMode:t. +if(!xe.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof t=="function")return super.query( +t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=$f(this.Promise,i);i=s.callback;try{let o=new _a.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??[];mo(l,{fullResults:!0,arrayMode:t. rowMode==="array"}).query(f,y,{types:t.types??this.options?.types}).then(E=>i(void 0,E)).catch(E=>i( -E))}catch(o){i(o)}return s.result}};a(Ci,"NeonPool");var _i=Ci;Ye();var Mt=Oe(Bt()),u0="mjs";var export_DatabaseError=Mt.DatabaseError;var export_defaults=Mt.defaults;var export_escapeIdentifier=Mt.escapeIdentifier; -var export_escapeLiteral=Mt.escapeLiteral;var export_types=Mt.types;export{Ft as Client,export_DatabaseError as DatabaseError, -pe as NeonDbError,We as NeonQueryPromise,_i as Pool,mt as SqlTemplate,wt as UnsafeRawSql,u0 as _bundleExt, +E))}catch(o){i(o)}return s.result}};a(Ti,"NeonPool");var Ii=Ti;Je();var Mt=Oe(Lt()),l0="mjs";var export_DatabaseError=Mt.DatabaseError;var export_defaults=Mt.defaults;var export_escapeIdentifier=Mt.escapeIdentifier; +var export_escapeLiteral=Mt.escapeLiteral;var export_types=Mt.types;export{kt as Client,export_DatabaseError as DatabaseError, +se as NeonDbError,We as NeonQueryPromise,Ii as Pool,wt as SqlTemplate,gt as UnsafeRawSql,l0 as _bundleExt, export_defaults as defaults,export_escapeIdentifier as escapeIdentifier,export_escapeLiteral as escapeLiteral, -po as neon,Se as neonConfig,export_types as types,Kt as warnIfBrowser}; +mo as neon,xe as neonConfig,export_types as types,zt as warnIfBrowser}; /*! Bundled license information: ieee754/index.js: diff --git a/src/httpQuery.ts b/src/httpQuery.ts index 5eb2c90..0716656 100644 --- a/src/httpQuery.ts +++ b/src/httpQuery.ts @@ -104,6 +104,25 @@ const ROW_MESSAGE = 0; const COLUMNS_MESSAGE = 1; const QUERY_MESSAGE = 2; +function getResponseFormat(response: Response): HTTPResponseFormat | undefined { + const contentType = response.headers + .get('Content-Type') + ?.split(';', 1)[0] + .trim() + .toLowerCase(); + + switch (contentType) { + case responseFormatContentTypes.json: + return 'json'; + case responseFormatContentTypes.jsonl: + return 'jsonl'; + case responseFormatContentTypes['cbor-seq']: + return 'cbor-seq'; + default: + return undefined; + } +} + function dbError(error: any) { const result = new NeonDbError(error.message); for (const field of errorFields) result[field] = error[field] ?? undefined; @@ -116,10 +135,10 @@ function unexpectedStreamingMessage(): never { ); } -async function readStreamingResult( +async function readStreamingResults( response: Response, responseFormat: Exclude, - batch: boolean, + batchQueryCount: number | undefined, ) { const messages = responseFormat === 'jsonl' @@ -129,21 +148,21 @@ async function readStreamingResult( .map((line) => JSON.parse(line)) : (decodeMultiple(new Uint8Array(await response.arrayBuffer())) as any[]); - const end = messages.at(-1); - if (!Array.isArray(end) || (end[0] !== 3 && end[0] !== 4)) { + const end = messages.pop(); + if (end === null || typeof end !== 'object' || Array.isArray(end)) { throw new NeonDbError( 'Neon internal error: streamed response ended without a terminal message', ); } - if ( - end[0] === 4 && - end.length === 2 && - end[1] !== null && - typeof end[1] === 'object' - ) { - throw dbError(end[1]); + if ('message' in end) { + if (typeof end.message !== 'string') { + throw new NeonDbError( + 'Neon internal error: unexpected streamed response status', + ); + } + throw dbError(end); } - if (end[0] !== 3 || end.length !== 1) { + if (Object.keys(end).length !== 0) { throw new NeonDbError( 'Neon internal error: unexpected streamed response status', ); @@ -158,7 +177,7 @@ async function readStreamingResult( partialText?: string[]; } | undefined; - for (const message of messages.slice(0, -1)) { + for (const message of messages) { if (!Array.isArray(message)) { unexpectedStreamingMessage(); } @@ -171,9 +190,16 @@ async function readStreamingResult( current = { fields: payload, rows: [] }; break; case ROW_MESSAGE: - if (current === undefined || payload.length === 0) { + if ( + current === undefined || + (payload.length === 0 && current.fields.length !== 0) + ) { unexpectedStreamingMessage(); } + if (payload.length === 0) { + current.rows.push([]); + break; + } const row = (current.row ??= []); for (const [index, value] of payload.entries()) { if ( @@ -238,11 +264,11 @@ async function readStreamingResult( } } - if (current !== undefined || (!batch && results.length !== 1)) { + if (current !== undefined || results.length !== (batchQueryCount ?? 1)) { throw new NeonDbError('Neon internal error: incomplete streamed response'); } - return batch ? { results } : results[0]; + return batchQueryCount === undefined ? results[0] : { results }; } function encodeBuffersAsBytea(value: unknown): unknown { @@ -557,14 +583,20 @@ export function neon< throw connectErr; } + const responseFormat = getResponseFormat(response); if (response.ok) { + if (responseFormat === undefined) { + throw new NeonDbError( + `Neon internal error: unexpected response Content-Type: ${response.headers.get('Content-Type') ?? 'missing'}`, + ); + } const rawResults = - resolvedResponseFormat === 'json' + responseFormat === 'json' ? ((await response.json()) as any) - : await readStreamingResult( + : await readStreamingResults( response, - resolvedResponseFormat, - isBatch, + responseFormat, + isBatch ? queryData.length : undefined, ); if (isBatch) { @@ -599,7 +631,7 @@ export function neon< } } else { const { status } = response; - if (status === 400) { + if (responseFormat === 'json') { const json = (await response.json()) as any; throw dbError(json); } else { diff --git a/tests/cli/httpStreaming.test.ts b/tests/cli/httpStreaming.test.ts index 44b9410..4a0d08e 100644 --- a/tests/cli/httpStreaming.test.ts +++ b/tests/cli/httpStreaming.test.ts @@ -28,7 +28,7 @@ const labelFields = [ }, ]; -const successMessages = [[1, ...fields], [0, '42'], [2, 'SELECT', 1], [3]]; +const successMessages = [[1, ...fields], [0, '42'], [2, 'SELECT', 1], {}]; const batchMessages = [ [1, ...fields], @@ -39,7 +39,7 @@ const batchMessages = [ [0, 'hello'], [0, 'world'], [2, 'SELECT', 2], - [3], + {}, ]; let previousFetchEndpoint: typeof neonConfig.fetchEndpoint; @@ -69,10 +69,18 @@ function cborSequence(messages: unknown[]) { return result; } -function mockResponse(body: BodyInit, expectedAccept: string) { +function mockResponse( + body: BodyInit, + expectedAccept: string, + responseContentType = expectedAccept, + status = 200, +) { const fetchFunction = vi.fn(async (_url, init) => { expect(init?.headers).toMatchObject({ Accept: expectedAccept }); - return new Response(body, { status: 200 }); + return new Response(body, { + status, + headers: { 'Content-Type': responseContentType }, + }); }); neonConfig.fetchFunction = fetchFunction as any; return fetchFunction; @@ -122,6 +130,70 @@ test.each([ }, ); +test.each([ + { + responseFormat: 'cbor-seq' as const, + accept: 'application/vnd.neon.sql.v1+cbor', + contentType: 'application/vnd.neon.sql.v1+json; charset=utf-8', + body: successMessages.map((message) => JSON.stringify(message)).join('\n'), + }, + { + responseFormat: 'jsonl' as const, + accept: 'application/vnd.neon.sql.v1+json', + contentType: 'application/vnd.neon.sql.v1+cbor', + body: cborSequence(successMessages), + }, + { + responseFormat: 'cbor-seq' as const, + accept: 'application/vnd.neon.sql.v1+cbor', + contentType: 'application/json', + body: JSON.stringify({ + fields, + rows: [['42']], + command: 'SELECT', + rowCount: 1, + }), + }, +])( + 'decodes the returned $contentType instead of the requested $responseFormat', + async ({ responseFormat, accept, contentType, body }) => { + mockResponse(body, accept, contentType); + + const sql = neon(connectionString, { responseFormat }); + await expect(sql`SELECT 42 AS answer`).resolves.toStrictEqual([ + { answer: 42 }, + ]); + }, +); + +test('decodes JSON errors returned for CBOR requests', async () => { + mockResponse( + JSON.stringify({ message: 'invalid request', code: '08P01' }), + 'application/vnd.neon.sql.v1+cbor', + 'application/json; charset=utf-8', + 400, + ); + + const sql = neon(connectionString, { responseFormat: 'cbor-seq' }); + await expect(sql`SELECT`).rejects.toMatchObject({ + message: 'invalid request', + code: '08P01', + }); +}); + +test('rejects successful responses with an unknown Content-Type', async () => { + mockResponse( + JSON.stringify({}), + 'application/vnd.neon.sql.v1+cbor', + 'text/plain', + ); + + const sql = neon(connectionString, { responseFormat: 'cbor-seq' }); + await expect(sql`SELECT`).rejects.toThrow( + 'unexpected response Content-Type: text/plain', + ); +}); + test.each([ { responseFormat: 'jsonl' as const, @@ -145,7 +217,7 @@ test.each([ [0, ['world']], [0, ''], [2, 'SELECT', 2], - [3], + {}, ]; mockResponse(encode(messages), accept); @@ -162,11 +234,10 @@ test.each([ ); test.each([ - [[], 'empty row message'], [[[null]], 'partial NULL'], [[['unfinished']], 'unfinished row'], ])('rejects invalid streamed row fragments: %s', async (row, _description) => { - const messages = [[1, fields], [0, ...row], [2, 'SELECT', 1], [3]]; + const messages = [[1, ...fields], [0, ...row], [2, 'SELECT', 1], {}]; mockResponse( messages.map((message) => JSON.stringify(message)).join('\n'), 'application/vnd.neon.sql.v1+json', @@ -178,6 +249,20 @@ test.each([ ); }); +test('decodes zero-column rows', async () => { + const messages = [[1], [0], [2, 'SELECT', 1], {}]; + mockResponse( + messages.map((message) => JSON.stringify(message)).join('\n'), + 'application/vnd.neon.sql.v1+json', + ); + + const sql = neon(connectionString, { + responseFormat: 'jsonl', + arrayMode: true, + }); + await expect(sql`SELECT`).resolves.toStrictEqual([[]]); +}); + test('allows a streaming format per query', async () => { mockResponse( successMessages.map((message) => JSON.stringify(message)).join('\n'), @@ -192,7 +277,7 @@ test('allows a streaming format per query', async () => { test('returns terminal streamed errors as database errors', async () => { mockResponse( - cborSequence([[4, { message: 'division by zero', code: '22012' }]]), + cborSequence([{ message: 'division by zero', code: '22012' }]), 'application/vnd.neon.sql.v1+cbor', ); @@ -207,7 +292,7 @@ test('discards partial rows before returning terminal errors', async () => { cborSequence([ [1, ...fields], [0, ['partial']], - [4, { message: 'division by zero', code: '22012' }], + { message: 'division by zero', code: '22012' }, ]), 'application/vnd.neon.sql.v1+cbor', ); @@ -242,6 +327,40 @@ test.each([ }, ); +test.each([ + [[3], 'streamed response ended without a terminal message'], + [{ code: '22012' }, 'unexpected streamed response status'], + [{ message: 42 }, 'unexpected streamed response status'], +])('rejects invalid terminal messages: %j', async (terminal, expectedError) => { + const messages = [...successMessages.slice(0, -1), terminal]; + mockResponse( + messages.map((message) => JSON.stringify(message)).join('\n'), + 'application/vnd.neon.sql.v1+json', + ); + + const sql = neon(connectionString, { responseFormat: 'jsonl' }); + await expect(sql`SELECT 42 AS answer`).rejects.toThrow(expectedError); +}); + +test.each([ + ['too few', 2, successMessages], + ['too many', 1, batchMessages], +])( + 'rejects transactions with %s streamed results', + async (_description, queryCount, messages) => { + mockResponse( + messages.map((message) => JSON.stringify(message)).join('\n'), + 'application/vnd.neon.sql.v1+json', + ); + + const sql = neon(connectionString, { responseFormat: 'jsonl' }); + const queries = Array.from({ length: queryCount }, () => sql`SELECT 42`); + await expect(sql.transaction(queries)).rejects.toThrow( + 'incomplete streamed response', + ); + }, +); + test.each([ { responseFormat: 'jsonl' as const, From cace2836f50bf1c6a112f5b2193967327871de62 Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Wed, 19 Aug 2026 07:57:53 +0100 Subject: [PATCH 6/7] Decode value-oriented SQL streams --- index.js | 1278 ++++++++++++++++--------------- index.mjs | 1278 ++++++++++++++++--------------- src/httpQuery.ts | 223 +++--- tests/cli/httpStreaming.test.ts | 130 +++- 4 files changed, 1491 insertions(+), 1418 deletions(-) diff --git a/index.js b/index.js index 8d0bb18..1cec6b9 100644 --- a/index.js +++ b/index.js @@ -1,22 +1,22 @@ -"use strict";var Ta=Object.create;var Ge=Object.defineProperty;var Ra=Object.getOwnPropertyDescriptor;var Pa=Object.getOwnPropertyNames;var Ba=Object.getPrototypeOf,La=Object.prototype.hasOwnProperty;var Fa=(r,e,t)=>e in r?Ge(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>Ge(r,"name",{value:e,configurable:!0});var re=(r,e)=>()=>(r&&(e=r(r=0)),e);var P=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),le=(r,e)=>{for(var t in e)Ge(r,t,{get:e[t], -enumerable:!0})},Pi=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Pa(e))!La. -call(r,i)&&i!==t&&Ge(r,i,{get:()=>e[i],enumerable:!(n=Ra(e,i))||n.enumerable});return r};var qe=(r,e,t)=>(t=r!=null?Ta(Ba(r)):{},Pi(e||!r||!r.__esModule?Ge(t,"default",{value:r,enumerable:!0}): -t,r)),j=r=>Pi(Ge({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Fa(r,typeof e!="symbol"?e+"":e,t);var Fi=P(Dt=>{"use strict";p();Dt.byteLength=Ma;Dt.toByteArray=Da;Dt.fromByteArray=qa;var be=[],fe=[], -ka=typeof Uint8Array<"u"?Uint8Array:Array,xr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ -23456789+/";for(Qe=0,Bi=xr.length;Qe0)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(Li,"getLens"); -function Ma(r){var e=Li(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Ma,"byteLength");function Ua(r,e,t){return(e+ -t)*3/4-t}a(Ua,"_byteLength");function Da(r){var e,t=Li(r),n=t[0],i=t[1],s=new ka(Ua(r,n,i)),o=0,u=i> +"use strict";var Pa=Object.create;var $e=Object.defineProperty;var Ba=Object.getOwnPropertyDescriptor;var La=Object.getOwnPropertyNames;var Fa=Object.getPrototypeOf,ka=Object.prototype.hasOwnProperty;var Ma=(r,e,t)=>e in r?$e(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>$e(r,"name",{value:e,configurable:!0});var re=(r,e)=>()=>(r&&(e=r(r=0)),e);var P=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),le=(r,e)=>{for(var t in e)$e(r,t,{get:e[t], +enumerable:!0})},Bi=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of La(e))!ka. +call(r,i)&&i!==t&&$e(r,i,{get:()=>e[i],enumerable:!(n=Ba(e,i))||n.enumerable});return r};var Ne=(r,e,t)=>(t=r!=null?Pa(Fa(r)):{},Bi(e||!r||!r.__esModule?$e(t,"default",{value:r,enumerable:!0}): +t,r)),j=r=>Bi($e({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Ma(r,typeof e!="symbol"?e+"":e,t);var ki=P(Ut=>{"use strict";p();Ut.byteLength=Da;Ut.toByteArray=Na;Ut.fromByteArray=ja;var be=[],fe=[], +Ua=typeof Uint8Array<"u"?Uint8Array:Array,xr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ +23456789+/";for(qe=0,Li=xr.length;qe0)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(Fi,"getLens"); +function Da(r){var e=Fi(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Da,"byteLength");function Oa(r,e,t){return(e+ +t)*3/4-t}a(Oa,"_byteLength");function Na(r){var e,t=Fi(r),n=t[0],i=t[1],s=new Ua(Oa(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=fe[r.charCodeAt( c)]<<2|fe[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=fe[r.charCodeAt(c)]<<10|fe[r.charCodeAt(c+1)]<< -4|fe[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(Da,"toByteArray");function Oa(r){return be[r>> -18&63]+be[r>>12&63]+be[r>>6&63]+be[r&63]}a(Oa,"tripletToBase64");function Na(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(Oa(n));return i.join("")}a(Na,"en\ -codeChunk");function qa(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(Na,"toByteArray");function qa(r){return be[r>> +18&63]+be[r>>12&63]+be[r>>6&63]+be[r&63]}a(qa,"tripletToBase64");function Qa(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(qa(n));return i.join("")}a(Qa,"en\ +codeChunk");function ja(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(be[e>>2]+be[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1], -i.push(be[e>>10]+be[e>>4&63]+be[e<<2&63]+"=")),i.join("")}a(qa,"fromByteArray")});var ki=P(Sr=>{p();Sr.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(be[e>>10]+be[e>>4&63]+be[e<<2&63]+"=")),i.join("")}a(ja,"fromByteArray")});var Mi=P(Sr=>{p();Sr.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,E=r[e+y];for(y+=g,s=E&(1<<-f)-1,E>>=-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:(E?-1:1)*(1/0);o=o+Math. pow(2,n),s=s-l}return(E?-1:1)*o*Math.pow(2,s-n)};Sr.write=function(r,e,t,n,i,s){var o,u,c,l=s*8-i-1, @@ -24,48 +24,48 @@ f=(1<>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:s-1,C=n?1:-1, 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+E]=u&255,E+= -C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=H*128}});var Ji=P(Ye=>{"use strict";p();var vr=Fi(),Ke=ki(),Mi=typeof Symbol=="function"&&typeof Symbol.for== -"function"?Symbol.for("nodejs.util.inspect.custom"):null;Ye.Buffer=d;Ye.SlowBuffer=Ga;Ye.INSPECT_MAX_BYTES= -50;var Ot=2147483647;Ye.kMaxLength=Ot;d.TYPED_ARRAY_SUPPORT=Qa();!d.TYPED_ARRAY_SUPPORT&&typeof console< +C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=H*128}});var Zi=P(ze=>{"use strict";p();var vr=ki(),Ve=Mi(),Ui=typeof Symbol=="function"&&typeof Symbol.for== +"function"?Symbol.for("nodejs.util.inspect.custom"):null;ze.Buffer=d;ze.SlowBuffer=Ka;ze.INSPECT_MAX_BYTES= +50;var Dt=2147483647;ze.kMaxLength=Dt;d.TYPED_ARRAY_SUPPORT=Wa();!d.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 Qa(){ +pport which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Wa(){ 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(Qa,"typedArraySupport");Object. +prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}a(Wa,"typedArraySupport");Object. defineProperty(d.prototype,"parent",{enumerable:!0,get:a(function(){if(d.isBuffer(this))return this. buffer},"get")});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:a(function(){if(d.isBuffer( -this))return this.byteOffset},"get")});function Ae(r){if(r>Ot)throw new RangeError('The value "'+r+'\ +this))return this.byteOffset},"get")});function Ae(r){if(r>Dt)throw new RangeError('The value "'+r+'\ " is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,d.prototype), e}a(Ae,"createBuffer");function d(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 Cr(r)}return Ni(r,e,t)} -a(d,"Buffer");d.poolSize=8192;function Ni(r,e,t){if(typeof r=="string")return Wa(r,e);if(ArrayBuffer. -isView(r))return Ha(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 Cr(r)}return qi(r,e,t)} +a(d,"Buffer");d.poolSize=8192;function qi(r,e,t){if(typeof r=="string")return $a(r,e);if(ArrayBuffer. +isView(r))return Ga(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(xe(r,ArrayBuffer)|| r&&xe(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(xe(r,SharedArrayBuffer)||r&&xe(r.buffer, SharedArrayBuffer)))return Ar(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 d. -from(n,e,t);let i=$a(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. +from(n,e,t);let i=Va(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. toPrimitive]=="function")return d.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(Ni,"from");d.from=function(r,e,t){return Ni(r,e,t)};Object.setPrototypeOf(d.prototype, -Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function qi(r){if(typeof r!="number")throw new TypeError( +ed type "+typeof r)}a(qi,"from");d.from=function(r,e,t){return qi(r,e,t)};Object.setPrototypeOf(d.prototype, +Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Qi(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(qi,"assertSize");function ja(r,e,t){return qi(r),r<=0?Ae(r):e!==void 0?typeof t== -"string"?Ae(r).fill(e,t):Ae(r).fill(e):Ae(r)}a(ja,"alloc");d.alloc=function(r,e,t){return ja(r,e,t)}; -function Cr(r){return qi(r),Ae(r<0?0:Ir(r)|0)}a(Cr,"allocUnsafe");d.allocUnsafe=function(r){return Cr( -r)};d.allocUnsafeSlow=function(r){return Cr(r)};function Wa(r,e){if((typeof e!="string"||e==="")&&(e= -"utf8"),!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=Qi(r,e)|0,n=Ae(t),i=n.write( -r,e);return i!==t&&(n=n.slice(0,i)),n}a(Wa,"fromString");function Er(r){let e=r.length<0?0:Ir(r.length)| -0,t=Ae(e);for(let n=0;n=Ot)throw new RangeError("Attempt to allocate Buffer larger t\ -han maximum size: 0x"+Ot.toString(16)+" bytes");return r|0}a(Ir,"checked");function Ga(r){return+r!= -r&&(r=0),d.alloc(+r)}a(Ga,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== +a(Va,"fromObject");function Ir(r){if(r>=Dt)throw new RangeError("Attempt to allocate Buffer larger t\ +han maximum size: 0x"+Dt.toString(16)+" bytes");return r|0}a(Ir,"checked");function Ka(r){return+r!= +r&&(r=0),d.alloc(+r)}a(Ka,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== d.prototype},"isBuffer");d.compare=a(function(e,t){if(xe(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)), xe(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.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,80 +77,80 @@ utf-16le":return!0;default:return!1}},"isEncoding");d.concat=a(function(e,t){if( for(t=0,n=0;ni.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(i,s)):Uint8Array.prototype. set.call(i,o,s);else if(d.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 Qi(r,e){if(d.isBuffer(r))return r.length; +an Array of Buffers');s+=o.length}return i},"concat");function ji(r,e){if(d.isBuffer(r))return r.length; if(ArrayBuffer.isView(r)||xe(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 _r(r).length;case"ucs2":case"\ -ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Yi(r).length;default: -if(i)return n?-1:_r(r).length;e=(""+e).toLowerCase(),i=!0}}a(Qi,"byteLength");d.byteLength=Qi;function Va(r,e,t){ +ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ji(r).length;default: +if(i)return n?-1:_r(r).length;e=(""+e).toLowerCase(),i=!0}}a(ji,"byteLength");d.byteLength=ji;function za(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 nu(this,e,t);case"u\ -tf8":case"utf-8":return Wi(this,e,t);case"ascii":return tu(this,e,t);case"latin1":case"binary":return ru( -this,e,t);case"base64":return Xa(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return iu( -this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(Va, -"slowToString");d.prototype._isBuffer=!0;function je(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(je,"swap"); +0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return su(this,e,t);case"u\ +tf8":case"utf-8":return Hi(this,e,t);case"ascii":return nu(this,e,t);case"latin1":case"binary":return iu( +this,e,t);case"base64":return tu(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ou( +this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(za, +"slowToString");d.prototype._isBuffer=!0;function Qe(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(Qe,"swap"); d.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");Mi&&(d.prototype[Mi]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ +er "+e+">"},"inspect");Ui&&(d.prototype[Ui]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ if(xe(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.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 Wi(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,Rr(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=d.from( -e,n)),d.isBuffer(e))return e.length===0?-1:Ui(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array. +e,n)),d.isBuffer(e))return e.length===0?-1:Di(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):Ui(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(ji,"bidire\ -ctionalIndexOf");function Ui(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):Di(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Wi,"bidire\ +ctionalIndexOf");function Di(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 Ka(this,e,t,n);case"utf8":case"\ -utf-8":return za(this,e,t,n);case"ascii":case"latin1":case"binary":return Ya(this,e,t,n);case"base64": -return Ja(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Za(this,e,t,n);default: +fer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return Ya(this,e,t,n);case"utf8":case"\ +utf-8":return Ja(this,e,t,n);case"ascii":case"latin1":case"binary":return Za(this,e,t,n);case"base64": +return Xa(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return eu(this,e,t,n);default: if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"write");d.prototype. toJSON=a(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSO\ -N");function Xa(r,e,t){return e===0&&t===r.length?vr.fromByteArray(r):vr.fromByteArray(r.slice(e,t))} -a(Xa,"base64Slice");function Wi(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 eu(n)}a(Wi,"utf8Slice");var Di=4096;function eu(r){let e=r.length;if(e<=Di)return String. +n.push(o),i+=u}return ru(n)}a(Hi,"utf8Slice");var Oi=4096;function ru(r){let e=r.length;if(e<=Oi)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,d.prototype),i},"slice");function G(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 \ @@ -165,11 +165,11 @@ a(function(e,t){return e=e>>>0,t||G(e,2,this.length),this[e]<<8|this[e+1]},"read readUint32LE=d.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),(this[e]| this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");d.prototype.readUint32BE=d.prototype. readUInt32BE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+ -2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Pe(a(function(e){e=e>>>0,ze(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&pt(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* +2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Pe(a(function(e){e=e>>>0,Ke(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&dt(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* 2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<< -BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Pe(a(function(e){e=e>>>0,ze(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&pt(e,this.length-8);let i=t*2**24+this[++e]*2**16+ +BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Pe(a(function(e){e=e>>>0,Ke(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&dt(e,this.length-8);let i=t*2**24+this[++e]*2**16+ this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<>>0,t=t>>>0,n||G(e,t, this.length);let i=this[e],s=1,o=0;for(;++o=s&&(i-=Math. @@ -182,16 +182,16 @@ a(function(e,t){e=e>>>0,t||G(e,2,this.length);let n=this[e+1]|this[e]<<8;return n},"readInt16BE");d.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]| this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");d.prototype.readInt32BE=a(function(e,t){return e= e>>>0,t||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");d.prototype. -readBigInt64LE=Pe(a(function(e){e=e>>>0,ze(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& -pt(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,Ke(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& +dt(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,ze(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&pt(e,this. +Pe(a(function(e){e=e>>>0,Ke(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&dt(e,this. length-8);let i=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,t||G(e,4,this.length),Ke.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= -a(function(e,t){return e=e>>>0,t||G(e,4,this.length),Ke.read(this,e,!1,23,4)},"readFloatBE");d.prototype. -readDoubleLE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ke.read(this,e,!0,52,8)},"readDoub\ -leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ke.read(this,e, +return e=e>>>0,t||G(e,4,this.length),Ve.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= +a(function(e,t){return e=e>>>0,t||G(e,4,this.length),Ve.read(this,e,!1,23,4)},"readFloatBE");d.prototype. +readDoubleLE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ve.read(this,e,!0,52,8)},"readDoub\ +leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ve.read(this,e, !1,52,8)},"readDoubleBE");function ne(r,e,t,n,i,s){if(!d.isBuffer(r))throw new TypeError('"buffer" a\ rgument must be a Buffer instance');if(e>i||er.length)throw new RangeError("Index out of range")}a(ne,"checkInt");d.prototype.writeUintLE= @@ -207,14 +207,14 @@ e>>>8,t+2},"writeUInt16LE");d.prototype.writeUint16BE=d.prototype.writeUInt16BE= writeUint32LE=d.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(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");d.prototype. writeUint32BE=d.prototype.writeUInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne(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 Hi(r,e,t,n,i){ -zi(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 $i(r,e,t,n,i){ +Yi(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(Hi,"wrtBigUInt64LE");function $i(r,e,t,n,i){zi(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295)); +8,r[t++]=o,t}a($i,"wrtBigUInt64LE");function Gi(r,e,t,n,i){Yi(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($i,"wrtBigUInt64BE");d.prototype. -writeBigUInt64LE=Pe(a(function(e,t=0){return Hi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ -riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Pe(a(function(e,t=0){return $i(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(Gi,"wrtBigUInt64BE");d.prototype. +writeBigUInt64LE=Pe(a(function(e,t=0){return $i(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ +riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Pe(a(function(e,t=0){return Gi(this,e,t,BigInt(0),BigInt( "0xffffffffffffffff"))},"writeBigUInt64BE"));d.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>> 0,!i){let c=Math.pow(2,8*n-1);ne(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");d.prototype.writeIntBE= @@ -228,17 +228,17 @@ e>>>8,this[t+1]=e&255,t+2},"writeInt16BE");d.prototype.writeInt32LE=a(function(e t>>>0,n||ne(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+ 3]=e>>>24,t+4},"writeInt32LE");d.prototype.writeInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||ne( 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");d.prototype.writeBigInt64LE=Pe(a(function(e,t=0){return Hi( +e>>>8,this[t+3]=e&255,t+4},"writeInt32BE");d.prototype.writeBigInt64LE=Pe(a(function(e,t=0){return $i( this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));d.prototype. -writeBigInt64BE=Pe(a(function(e,t=0){return $i(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ -ffffffffffff"))},"writeBigInt64BE"));function Gi(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(Gi,"checkIEEE754");function Vi(r,e,t,n,i){ -return e=+e,t=t>>>0,i||Gi(r,e,t,4,34028234663852886e22,-34028234663852886e22),Ke.write(r,e,t,n,23,4), -t+4}a(Vi,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return Vi(this,e,t,!0,n)},"writeFl\ -oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return Vi(this,e,t,!1,n)},"writeFloatBE");function Ki(r,e,t,n,i){ -return e=+e,t=t>>>0,i||Gi(r,e,t,8,17976931348623157e292,-17976931348623157e292),Ke.write(r,e,t,n,52, -8),t+8}a(Ki,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return Ki(this,e,t,!0,n)},"wr\ -iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return Ki(this,e,t,!1,n)},"writeDoubleBE"); +writeBigInt64BE=Pe(a(function(e,t=0){return Gi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ +ffffffffffff"))},"writeBigInt64BE"));function Vi(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(Vi,"checkIEEE754");function Ki(r,e,t,n,i){ +return e=+e,t=t>>>0,i||Vi(r,e,t,4,34028234663852886e22,-34028234663852886e22),Ve.write(r,e,t,n,23,4), +t+4}a(Ki,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return Ki(this,e,t,!0,n)},"writeFl\ +oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return Ki(this,e,t,!1,n)},"writeFloatBE");function zi(r,e,t,n,i){ +return e=+e,t=t>>>0,i||Vi(r,e,t,8,17976931348623157e292,-17976931348623157e292),Ve.write(r,e,t,n,52, +8),t+8}a(zi,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return zi(this,e,t,!0,n)},"wr\ +iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return zi(this,e,t,!1,n)},"writeDoubleBE"); d.prototype.copy=a(function(e,t,n,i){if(!d.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=Oi(String(t)):typeof t=="bigint"&&(i=String( -t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Oi(i)),i+="n"),n+=` It must be ${e}. Re\ -ceived ${i}`,n},RangeError);function Oi(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(Oi,"addNumericalSeparator");function su(r,e,t){ -ze(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&pt(e,r.length-(t+1))}a(su,"checkBounds");function zi(r,e,t,n,i,s){ +f range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=Ni(String(t)):typeof t=="bigint"&&(i=String( +t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Ni(i)),i+="n"),n+=` It must be ${e}. Re\ +ceived ${i}`,n},RangeError);function Ni(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(Ni,"addNumericalSeparator");function au(r,e,t){ +Ke(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&dt(e,r.length-(t+1))}a(au,"checkBounds");function Yi(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 Ve.ERR_OUT_OF_RANGE("value",u,r)}su(n,i,s)}a(zi,"checkIntBI");function ze(r,e){if(typeof r!= -"number")throw new Ve.ERR_INVALID_ARG_TYPE(e,"number",r)}a(ze,"validateNumber");function pt(r,e,t){throw Math. -floor(r)!==r?(ze(r,t),new Ve.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new Ve.ERR_BUFFER_OUT_OF_BOUNDS: -new Ve.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(pt,"boundsError");var ou=/[^+/0-9A-Za-z-_]/g; -function au(r){if(r=r.split("=")[0],r=r.trim().replace(ou,""),r.length<2)return"";for(;r.length%4!== -0;)r=r+"=";return r}a(au,"base64clean");function _r(r,e){e=e||1/0;let t,n=r.length,i=null,s=[];for(let o=0;o< +nd <= ${t}${o}`,new Ge.ERR_OUT_OF_RANGE("value",u,r)}au(n,i,s)}a(Yi,"checkIntBI");function Ke(r,e){if(typeof r!= +"number")throw new Ge.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Ke,"validateNumber");function dt(r,e,t){throw Math. +floor(r)!==r?(Ke(r,t),new Ge.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new Ge.ERR_BUFFER_OUT_OF_BOUNDS: +new Ge.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(dt,"boundsError");var uu=/[^+/0-9A-Za-z-_]/g; +function cu(r){if(r=r.split("=")[0],r=r.trim().replace(uu,""),r.length<2)return"";for(;r.length%4!== +0;)r=r+"=";return r}a(cu,"base64clean");function _r(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(_r,"utf\ -8ToBytes");function uu(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(cu,"utf16leToBytes");function Yi(r){return vr.toByteArray( -au(r))}a(Yi,"base64ToBytes");function Nt(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) -e[i+t]=r[i];return i}a(Nt,"blitBuffer");function xe(r,e){return r instanceof e||r!=null&&r.constructor!= +8ToBytes");function lu(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(fu,"utf16leToBytes");function Ji(r){return vr.toByteArray( +cu(r))}a(Ji,"base64ToBytes");function Ot(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) +e[i+t]=r[i];return i}a(Ot,"blitBuffer");function xe(r,e){return r instanceof e||r!=null&&r.constructor!= null&&r.constructor.name!=null&&r.constructor.name===e.name}a(xe,"isInstance");function Rr(r){return r!== -r}a(Rr,"numberIsNaN");var lu=function(){let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){ +r}a(Rr,"numberIsNaN");var hu=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 Pe(r){return typeof BigInt>"u"? -fu:r}a(Pe,"defineBigIntMethod");function fu(){throw new Error("BigInt not supported")}a(fu,"BufferBi\ +du:r}a(Pe,"defineBigIntMethod");function du(){throw new Error("BigInt not supported")}a(du,"BufferBi\ gIntNotDefined")});var S,v,A,m,w,p=re(()=>{"use strict";S=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),A= globalThis.clearImmediate??(r=>clearTimeout(r)),m=typeof globalThis.Buffer=="function"&&typeof globalThis. -Buffer.allocUnsafe=="function"?globalThis.Buffer:Ji().Buffer,w=globalThis.process??{};w.env??(w.env= -{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Be=P((ih,Pr)=>{"use strict";p();var Je=typeof Reflect=="object"?Reflect:null,Zi=Je&&typeof Je.apply== -"function"?Je.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),qt; -Je&&typeof Je.ownKeys=="function"?qt=Je.ownKeys:Object.getOwnPropertySymbols?qt=a(function(e){return Object. -getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):qt=a(function(e){return Object. -getOwnPropertyNames(e)},"ReflectOwnKeys");function hu(r){console&&console.warn&&console.warn(r)}a(hu, -"ProcessEmitWarning");var es=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function k(){k. -init.call(this)}a(k,"EventEmitter");Pr.exports=k;Pr.exports.once=mu;k.EventEmitter=k;k.prototype._events= -void 0;k.prototype._eventsCount=0;k.prototype._maxListeners=void 0;var Xi=10;function Qt(r){if(typeof r!= +Buffer.allocUnsafe=="function"?globalThis.Buffer:Zi().Buffer,w=globalThis.process??{};w.env??(w.env= +{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Be=P((uh,Pr)=>{"use strict";p();var Ye=typeof Reflect=="object"?Reflect:null,Xi=Ye&&typeof Ye.apply== +"function"?Ye.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Nt; +Ye&&typeof Ye.ownKeys=="function"?Nt=Ye.ownKeys:Object.getOwnPropertySymbols?Nt=a(function(e){return Object. +getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Nt=a(function(e){return Object. +getOwnPropertyNames(e)},"ReflectOwnKeys");function pu(r){console&&console.warn&&console.warn(r)}a(pu, +"ProcessEmitWarning");var ts=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function k(){k. +init.call(this)}a(k,"EventEmitter");Pr.exports=k;Pr.exports.once=gu;k.EventEmitter=k;k.prototype._events= +void 0;k.prototype._eventsCount=0;k.prototype._maxListeners=void 0;var es=10;function qt(r){if(typeof r!= "function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)} -a(Qt,"checkListener");Object.defineProperty(k,"defaultMaxListeners",{enumerable:!0,get:a(function(){ -return Xi},"get"),set:a(function(r){if(typeof r!="number"||r<0||es(r))throw new RangeError('The valu\ -e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Xi=r}, +a(qt,"checkListener");Object.defineProperty(k,"defaultMaxListeners",{enumerable:!0,get:a(function(){ +return es},"get"),set:a(function(r){if(typeof r!="number"||r<0||ts(r))throw new RangeError('The valu\ +e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");es=r}, "set")});k.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}; -k.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||es(e))throw new RangeError('Th\ +k.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||ts(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 ts(r){return r._maxListeners===void 0?k.defaultMaxListeners:r._maxListeners} -a(ts,"_getMaxListeners");k.prototype.getMaxListeners=a(function(){return ts(this)},"getMaxListeners"); +e,this},"setMaxListeners");function rs(r){return r._maxListeners===void 0?k.defaultMaxListeners:r._maxListeners} +a(rs,"_getMaxListeners");k.prototype.getMaxListeners=a(function(){return rs(this)},"getMaxListeners"); k.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")Zi(c,this,t);else for(var l=c. -length,f=os(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=rs(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,hu(u)}return r}a(rs,"_addListener");k.prototype.addListener=a(function(e,t){ -return rs(this,e,t,!1)},"addListener");k.prototype.on=k.prototype.addListener;k.prototype.prependListener= -a(function(e,t){return rs(this,e,t,!0)},"prependListener");function du(){if(!this.fired)return this. +r,u.type=e,u.count=o.length,pu(u)}return r}a(ns,"_addListener");k.prototype.addListener=a(function(e,t){ +return ns(this,e,t,!1)},"addListener");k.prototype.on=k.prototype.addListener;k.prototype.prependListener= +a(function(e,t){return ns(this,e,t,!0)},"prependListener");function yu(){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(du,"onceWrapper");function ns(r,e,t){var n={fired:!1, -wrapFn:void 0,target:r,type:e,listener:t},i=du.bind(n);return i.listener=t,n.wrapFn=i,i}a(ns,"_onceW\ -rap");k.prototype.once=a(function(e,t){return Qt(t),this.on(e,ns(this,e,t)),this},"once");k.prototype. -prependOnceListener=a(function(e,t){return Qt(t),this.prependListener(e,ns(this,e,t)),this},"prepend\ -OnceListener");k.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(Qt(t),i=this._events,i=== +target):this.listener.apply(this.target,arguments)}a(yu,"onceWrapper");function is(r,e,t){var n={fired:!1, +wrapFn:void 0,target:r,type:e,listener:t},i=yu.bind(n);return i.listener=t,n.wrapFn=i,i}a(is,"_onceW\ +rap");k.prototype.once=a(function(e,t){return qt(t),this.on(e,is(this,e,t)),this},"once");k.prototype. +prependOnceListener=a(function(e,t){return qt(t),this.prependListener(e,is(this,e,t)),this},"prepend\ +OnceListener");k.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(qt(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():pu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== +listener,s=o;break}if(s<0)return this;s===0?n.shift():mu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== void 0&&this.emit("removeListener",e,u||t)}return this},"removeListener");k.prototype.off=k.prototype. removeListener;k.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 is(r,e,t){var n=r._events; +0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function ss(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? -yu(i):os(i,i.length)}a(is,"_listeners");k.prototype.listeners=a(function(e){return is(this,e,!0)},"l\ -isteners");k.prototype.rawListeners=a(function(e){return is(this,e,!1)},"rawListeners");k.listenerCount= -function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):ss.call(r,e)};k.prototype. -listenerCount=ss;function ss(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(ss,"listenerCount");k.prototype.eventNames=a(function(){ -return this._eventsCount>0?qt(this._events):[]},"eventNames");function os(r,e){for(var t=new Array(e), -n=0;n0?Nt(this._events):[]},"eventNames");function as(r,e){for(var t=new Array(e), +n=0;nge,isIP:()=>gu});function gu(r){return 0}var cs,us,_,ge,Ze=re(()=>{"use \ -strict";p();cs=qe(Be(),1);a(gu,"isIP");us=/^[^.]+\./,_=class _ extends cs.EventEmitter{constructor(){ +ust be of type EventEmitter. Received type '+typeof r)}a(us,"eventTargetAgnosticAddListener")});var fs={};le(fs,{Socket:()=>ge,isIP:()=>xu});function xu(r){return 0}var ls,cs,_,ge,Je=re(()=>{"use \ +strict";p();ls=Ne(Be(),1);a(xu,"isIP");cs=/^[^.]+\./,_=class _ extends ls.EventEmitter{constructor(){ super(...arguments);I(this,"opts",{});I(this,"connecting",!1);I(this,"pending",!0);I(this,"writable", !0);I(this,"encrypted",!1);I(this,"authorized",!1);I(this,"destroyed",!1);I(this,"ws",null);I(this,"\ writeBuffer");I(this,"tlsState",0);I(this,"tlsRead");I(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=m.alloc(0),n="utf8",i=()=>{}){return this.write(t,n,()=>{this. ws.close(),i()}),this}destroy(){return this.destroyed=!0,this.end()}};a(_,"Socket"),I(_,"defaults",{ -poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{let s;return i?.jwtAuth?s=t.replace(us,"apiauth."):s= -t.replace(us,"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(cs,"apiauth."):s= +t.replace(cs,"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}),I(_,"opts",{});ge=_});var fs={};le(fs,{parse:()=>Br});function Br(r,e=!1){let{protocol:t}=new URL(r),n="http:"+r.substring( +disableWarningInBrowsers:!1}),I(_,"opts",{});ge=_});var hs={};le(hs,{parse:()=>Br});function Br(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 E=i+":"+s,C=e?Object. fromEntries(y.entries()):f;return{href:r,protocol:t,auth:E,username:i,password:s,host:o,hostname:u,port:c, -pathname:l,search:f,query:C,hash:g}}var Lr=re(()=>{"use strict";p();a(Br,"parse")});var Kr=P(Ps=>{"use strict";p();Ps.parse=function(r,e){return new Vr(r,e).parse()};var Yt=class Yt{constructor(e,t){ -this.source=e,this.transform=t||Hu,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){ +pathname:l,search:f,query:C,hash:g}}var Lr=re(()=>{"use strict";p();a(Br,"parse")});var Kr=P(Bs=>{"use strict";p();Bs.parse=function(r,e){return new Vr(r,e).parse()};var zt=class zt{constructor(e,t){ +this.source=e,this.transform=t||Gu,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 Yt(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse( +dimension>1&&(n=new zt(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(Yt,"ArrayParser");var Vr=Yt;function Hu(r){return r}a(Hu,"ide\ -ntity")});var zr=P((Rh,Bs)=>{p();var $u=Kr();Bs.exports={create:a(function(r,e){return{parse:a(function(){return $u. -parse(r,e)},"parse")}},"create")}});var ks=P((Lh,Fs)=>{"use strict";p();var Gu=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, -Vu=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Ku=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,zu=/^-?infinity$/;Fs. -exports=a(function(e){if(zu.test(e))return Number(e.replace("i","I"));var t=Gu.exec(e);if(!t)return Yu( -e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Ls(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=Ju(e);return g!=null? +not balanced");return this.entries}};a(zt,"ArrayParser");var Vr=zt;function Gu(r){return r}a(Gu,"ide\ +ntity")});var zr=P((Fh,Ls)=>{p();var Vu=Kr();Ls.exports={create:a(function(r,e){return{parse:a(function(){return Vu. +parse(r,e)},"parse")}},"create")}});var Ms=P((Uh,ks)=>{"use strict";p();var Ku=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, +zu=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Yu=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Ju=/^-?infinity$/;ks. +exports=a(function(e){if(Ju.test(e))return Number(e.replace("i","I"));var t=Ku.exec(e);if(!t)return Zu( +e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Fs(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=Xu(e);return g!=null? (y=new Date(Date.UTC(i,s,o,u,c,l,f)),Yr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= -new Date(i,s,o,u,c,l,f),Yr(i)&&y.setFullYear(i)),y},"parseDate");function Yu(r){var e=Vu.exec(r);if(e){ -var t=parseInt(e[1],10),n=!!e[4];n&&(t=Ls(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return Yr( -t)&&o.setFullYear(t),o}}a(Yu,"getDate");function Ju(r){if(r.endsWith("+00"))return 0;var e=Ku.exec(r. +new Date(i,s,o,u,c,l,f),Yr(i)&&y.setFullYear(i)),y},"parseDate");function Zu(r){var e=zu.exec(r);if(e){ +var t=parseInt(e[1],10),n=!!e[4];n&&(t=Fs(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return Yr( +t)&&o.setFullYear(t),o}}a(Zu,"getDate");function Xu(r){if(r.endsWith("+00"))return 0;var e=Yu.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(Ju,"timeZoneOffset");function Ls(r){return-(r- -1)}a(Ls,"bcYearToNegativeYear");function Yr(r){return r>=0&&r<100}a(Yr,"is0To99")});var Us=P((Mh,Ms)=>{p();Ms.exports=Xu;var Zu=Object.prototype.hasOwnProperty;function Xu(r){for(var e=1;e< -arguments.length;e++){var t=arguments[e];for(var n in t)Zu.call(t,n)&&(r[n]=t[n])}return r}a(Xu,"ext\ -end")});var Ns=P((Oh,Os)=>{"use strict";p();var ec=Us();Os.exports=st;function st(r){if(!(this instanceof st)) -return new st(r);ec(this,hc(r))}a(st,"PostgresInterval");var tc=["seconds","minutes","hours","days", -"months","years"];st.prototype.toPostgres=function(){var r=tc.filter(this.hasOwnProperty,this);return this. +e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(Xu,"timeZoneOffset");function Fs(r){return-(r- +1)}a(Fs,"bcYearToNegativeYear");function Yr(r){return r>=0&&r<100}a(Yr,"is0To99")});var Ds=P((Nh,Us)=>{p();Us.exports=tc;var ec=Object.prototype.hasOwnProperty;function tc(r){for(var e=1;e< +arguments.length;e++){var t=arguments[e];for(var n in t)ec.call(t,n)&&(r[n]=t[n])}return r}a(tc,"ext\ +end")});var qs=P((jh,Ns)=>{"use strict";p();var rc=Ds();Ns.exports=it;function it(r){if(!(this instanceof it)) +return new it(r);rc(this,pc(r))}a(it,"PostgresInterval");var nc=["seconds","minutes","hours","days", +"months","years"];it.prototype.toPostgres=function(){var r=nc.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 rc={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ -S"},nc=["years","months","days"],ic=["hours","minutes","seconds"];st.prototype.toISOString=st.prototype. -toISO=function(){var r=nc.map(t,this).join(""),e=ic.map(t,this).join("");return"P"+r+"T"+e;function t(n){ +"")),t+" "+e},this).join(" ")};var ic={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ +S"},sc=["years","months","days"],oc=["hours","minutes","seconds"];it.prototype.toISOString=it.prototype. +toISO=function(){var r=sc.map(t,this).join(""),e=oc.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+rc[n]}};var Jr="([+-]?\\d+)",sc=Jr+"\\s+years?",oc=Jr+"\\s+mons?",ac=Jr+"\\s+days?",uc="\ -([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",cc=new RegExp([sc,oc,ac,uc].map(function(r){return"\ -("+r+")?"}).join("\\s*")),Ds={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, -lc=["hours","minutes","seconds","milliseconds"];function fc(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}a(fc,"parseMilliseconds");function hc(r){if(!r)return{};var e=cc.exec(r),t=e[8]==="-";return Object. -keys(Ds).reduce(function(n,i){var s=Ds[i],o=e[s];return!o||(o=i==="milliseconds"?fc(o):parseInt(o,10), -!o)||(t&&~lc.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(hc,"parse")});var Qs=P((Qh,qs)=>{"use strict";p();qs.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( +/0+$/,"")),i+ic[n]}};var Jr="([+-]?\\d+)",ac=Jr+"\\s+years?",uc=Jr+"\\s+mons?",cc=Jr+"\\s+days?",lc="\ +([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",fc=new RegExp([ac,uc,cc,lc].map(function(r){return"\ +("+r+")?"}).join("\\s*")),Os={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, +hc=["hours","minutes","seconds","milliseconds"];function dc(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(dc,"parseMilliseconds");function pc(r){if(!r)return{};var e=fc.exec(r),t=e[8]==="-";return Object. +keys(Os).reduce(function(n,i){var s=Os[i],o=e[s];return!o||(o=i==="milliseconds"?dc(o):parseInt(o,10), +!o)||(t&&~hc.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(pc,"parse")});var js=P(($h,Qs)=>{"use strict";p();Qs.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( 2),"hex");for(var t="",n=0;n{p();var vt=Kr(),Et=zr(),Jt=ks(),Ws=Ns(),Hs=Qs();function Zt(r){return a(function(t){ -return t===null?t:r(t)},"nullAllowed")}a(Zt,"allowNull");function $s(r){return r===null?r:r==="TRUE"|| -r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a($s,"parseBool");function dc(r){return r? -vt.parse(r,$s):null}a(dc,"parseBoolArray");function pc(r){return parseInt(r,10)}a(pc,"parseBaseTenIn\ -t");function Zr(r){return r?vt.parse(r,Zt(pc)):null}a(Zr,"parseIntegerArray");function yc(r){return r? -vt.parse(r,Zt(function(e){return Gs(e).trim()})):null}a(yc,"parseBigIntegerArray");var mc=a(function(r){ -if(!r)return null;var e=Et.create(r,function(t){return t!==null&&(t=rn(t)),t});return e.parse()},"pa\ -rsePointArray"),Xr=a(function(r){if(!r)return null;var e=Et.create(r,function(t){return t!==null&&(t= -parseFloat(t)),t});return e.parse()},"parseFloatArray"),pe=a(function(r){if(!r)return null;var e=Et. -create(r);return e.parse()},"parseStringArray"),en=a(function(r){if(!r)return null;var e=Et.create(r, -function(t){return t!==null&&(t=Jt(t)),t});return e.parse()},"parseDateArray"),wc=a(function(r){if(!r) -return null;var e=Et.create(r,function(t){return t!==null&&(t=Ws(t)),t});return e.parse()},"parseInt\ -ervalArray"),gc=a(function(r){return r?vt.parse(r,Zt(Hs)):null},"parseByteAArray"),tn=a(function(r){ -return parseInt(r,10)},"parseInteger"),Gs=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ -parseBigInteger"),js=a(function(r){return r?vt.parse(r,Zt(JSON.parse)):null},"parseJsonArray"),rn=a( +parseBytea")});var zs=P((Kh,Ks)=>{p();var St=Kr(),vt=zr(),Yt=Ms(),Hs=qs(),$s=js();function Jt(r){return a(function(t){ +return t===null?t:r(t)},"nullAllowed")}a(Jt,"allowNull");function Gs(r){return r===null?r:r==="TRUE"|| +r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(Gs,"parseBool");function yc(r){return r? +St.parse(r,Gs):null}a(yc,"parseBoolArray");function mc(r){return parseInt(r,10)}a(mc,"parseBaseTenIn\ +t");function Zr(r){return r?St.parse(r,Jt(mc)):null}a(Zr,"parseIntegerArray");function wc(r){return r? +St.parse(r,Jt(function(e){return Vs(e).trim()})):null}a(wc,"parseBigIntegerArray");var gc=a(function(r){ +if(!r)return null;var e=vt.create(r,function(t){return t!==null&&(t=rn(t)),t});return e.parse()},"pa\ +rsePointArray"),Xr=a(function(r){if(!r)return null;var e=vt.create(r,function(t){return t!==null&&(t= +parseFloat(t)),t});return e.parse()},"parseFloatArray"),pe=a(function(r){if(!r)return null;var e=vt. +create(r);return e.parse()},"parseStringArray"),en=a(function(r){if(!r)return null;var e=vt.create(r, +function(t){return t!==null&&(t=Yt(t)),t});return e.parse()},"parseDateArray"),bc=a(function(r){if(!r) +return null;var e=vt.create(r,function(t){return t!==null&&(t=Hs(t)),t});return e.parse()},"parseInt\ +ervalArray"),xc=a(function(r){return r?St.parse(r,Jt($s)):null},"parseByteAArray"),tn=a(function(r){ +return parseInt(r,10)},"parseInteger"),Vs=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ +parseBigInteger"),Ws=a(function(r){return r?St.parse(r,Jt(JSON.parse)):null},"parseJsonArray"),rn=a( function(r){return r[0]!=="("?null:(r=r.substring(1,r.length-1).split(","),{x:parseFloat(r[0]),y:parseFloat( -r[1])})},"parsePoint"),bc=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, +r[1])})},"parsePoint"),Sc=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, i=2;i{"use strict";p();var se=1e6;function Sc(r){var e=r.readInt32BE(0),t=r.readUInt32BE( +1115,en),r(1182,en),r(1185,en),r(1186,Hs),r(1187,bc),r(17,$s),r(114,JSON.parse.bind(JSON)),r(3802,JSON. +parse.bind(JSON)),r(199,Ws),r(3807,Ws),r(3907,pe),r(2951,pe),r(791,pe),r(1183,pe),r(1270,pe)},"init"); +Ks.exports={init:vc}});var Js=P((Jh,Ys)=>{"use strict";p();var se=1e6;function Ec(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%se,e=e/se>>>0,o=4294967296* s+t,t=o/se>>>0,u=""+(o-se*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/se>>>0,u=""+(o-se*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/se>>>0,u=""+(o- se*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var vc=Ys(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,H){return E* +s+t,u=""+o%se,n+u+i}a(Ec,"readInt8");Ys.exports=Ec});var ro=P((ed,to)=>{p();var Ac=Js(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,H){return E* Math.pow(2,H)+C};var s=t>>3,o=a(function(E){return n?~E&255:E},"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"),Xs=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"),eo=a(function(r,e,t){var n=Math. pow(2,t-1)-1,i=U(r,1),s=U(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=U(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"),Ec=a(function(r){ -return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),Js=a(function(r){return U(r,1)==1?-1*(U( -r,31,1,!0)+1):U(r,31,1)},"parseInt32"),Ac=a(function(r){return Xs(r,23,8)},"parseFloat32"),_c=a(function(r){ -return Xs(r,52,11)},"parseFloat64"),Cc=a(function(r){var e=U(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"),_c=a(function(r){ +return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),Zs=a(function(r){return U(r,1)==1?-1*(U( +r,31,1,!0)+1):U(r,31,1)},"parseInt32"),Cc=a(function(r){return eo(r,23,8)},"parseFloat32"),Ic=a(function(r){ +return eo(r,52,11)},"parseFloat64"),Tc=a(function(r){var e=U(r,16,32);if(e==49152)return NaN;for(var t=Math. pow(1e4,U(r,16,16)),n=0,i=[],s=U(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 E=l.shift();for(g= 0;g0},"parseBool"),Rc=a(function(r){r(20,vc),r(21,Ec),r(23,Js),r(26,Js),r(1700,Cc),r(700,Ac), -r(701,_c),r(16,Tc),r(1114,Zs.bind(null,!1)),r(1184,Zs.bind(null,!0)),r(1e3,At),r(1007,At),r(1016,At), -r(1008,At),r(1009,At),r(25,Ic)},"init");eo.exports={init:Rc}});var no=P((Xh,ro)=>{p();ro.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25, +"parseArray"),Rc=a(function(r){return r.toString("utf8")},"parseText"),Pc=a(function(r){return r===null? +null:U(r,8)>0},"parseBool"),Bc=a(function(r){r(20,Ac),r(21,_c),r(23,Zs),r(26,Zs),r(1700,Tc),r(700,Cc), +r(701,Ic),r(16,Pc),r(1114,Xs.bind(null,!1)),r(1184,Xs.bind(null,!0)),r(1e3,Et),r(1007,Et),r(1016,Et), +r(1008,Et),r(1009,Et),r(25,Rc)},"init");to.exports={init:Bc}});var io=P((nd,no)=>{p();no.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 It=P(Ct=>{p();var Pc=Ks(),Bc=to(),Lc=zr(),Fc=no();Ct.getTypeParser=kc;Ct.setTypeParser=Mc;Ct.arrayParser= -Lc;Ct.builtins=Fc;var _t={text:{},binary:{}};function io(r){return String(r)}a(io,"noParse");function kc(r,e){ -return e=e||"text",_t[e]&&_t[e][r]||io}a(kc,"getTypeParser");function Mc(r,e,t){typeof e=="function"&& -(t=e,e="text"),_t[e][r]=t}a(Mc,"setTypeParser");Pc.init(function(r,e){_t.text[r]=e});Bc.init(function(r,e){ -_t.binary[r]=e})});var er=P((id,so)=>{"use strict";p();var Uc=It();function Xt(r){this._types=r||Uc,this.text={},this.binary= -{}}a(Xt,"TypeOverrides");Xt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ -binary":return this.binary;default:return{}}};Xt.prototype.setTypeParser=function(r,e,t){typeof e=="\ -function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Xt.prototype.getTypeParser=function(r,e){return e= -e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};so.exports=Xt});function Tt(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119,o=2600822924,u=528734635, +REGROLE:4096}});var Ct=P(_t=>{p();var Lc=zs(),Fc=ro(),kc=zr(),Mc=io();_t.getTypeParser=Uc;_t.setTypeParser=Dc;_t.arrayParser= +kc;_t.builtins=Mc;var At={text:{},binary:{}};function so(r){return String(r)}a(so,"noParse");function Uc(r,e){ +return e=e||"text",At[e]&&At[e][r]||so}a(Uc,"getTypeParser");function Dc(r,e,t){typeof e=="function"&& +(t=e,e="text"),At[e][r]=t}a(Dc,"setTypeParser");Lc.init(function(r,e){At.text[r]=e});Fc.init(function(r,e){ +At.binary[r]=e})});var Xt=P((ud,oo)=>{"use strict";p();var Oc=Ct();function Zt(r){this._types=r||Oc,this.text={},this.binary= +{}}a(Zt,"TypeOverrides");Zt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ +binary":return this.binary;default:return{}}};Zt.prototype.setTypeParser=function(r,e,t){typeof e=="\ +function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Zt.prototype.getTypeParser=function(r,e){return e= +e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};oo.exports=Zt});function It(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 b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),H=a(()=>{for(let M=0,Z=0;M<16;M++,Z+=4)E[M]=C[Z]<< 24|C[Z+1]<<16|C[Z+2]<<8|C[Z+3];for(let M=16;M<64;M++){let Z=g(E[M-15],7)^g(E[M-15],18)^E[M-15]>>>3,ve=g( E[M-2],17)^g(E[M-2],19)^E[M-2]>>>10;E[M]=E[M-16]+Z+E[M-7]+ve|0}let T=e,b=t,F=n,ae=i,$=s,we=o,Ie=u,ce=c; -for(let M=0;M<64;M++){let Z=g($,6)^g($,11)^g($,25),ve=$&we^~$&Ie,Te=ce+Z+ve+y[M]+E[M]|0,Ue=g(T,2)^g( -T,13)^g(T,22),De=T&b^T&F^b&F,Oe=Ue+De|0;ce=Ie,Ie=we,we=$,$=ae+Te|0,ae=F,F=b,b=T,T=Te+Oe|0}e=e+T|0,t= +for(let M=0;M<64;M++){let Z=g($,6)^g($,11)^g($,25),ve=$&we^~$&Ie,Te=ce+Z+ve+y[M]+E[M]|0,Me=g(T,2)^g( +T,13)^g(T,22),Ue=T&b^T&F^b&F,De=Me+Ue|0;ce=Ie,Ie=we,we=$,$=ae+Te|0,ae=F,F=b,b=T,T=Te+De|0}e=e+T|0,t= t+b|0,n=n+F|0,i=i+ae|0,s=s+$|0,o=o+we|0,u=u+Ie|0,c=c+ce|0,f=0},"process"),J=a(T=>{typeof T=="string"&& (T=new TextEncoder().encode(T));for(let b=0;b{if(C[f++]=128,f==64&&H(),f+8>64){for(;f<64;)C[f++]=0;H()}for(;f<58;)C[f++]=0;let T=l*8;C[f++]= @@ -567,7 +567,7 @@ t>>>24,b[5]=t>>>16&255,b[6]=t>>>8&255,b[7]=t&255,b[8]=n>>>24,b[9]=n>>>16&255,b[1 255,b[12]=i>>>24,b[13]=i>>>16&255,b[14]=i>>>8&255,b[15]=i&255,b[16]=s>>>24,b[17]=s>>>16&255,b[18]=s>>> 8&255,b[19]=s&255,b[20]=o>>>24,b[21]=o>>>16&255,b[22]=o>>>8&255,b[23]=o&255,b[24]=u>>>24,b[25]=u>>>16& 255,b[26]=u>>>8&255,b[27]=u&255,b[28]=c>>>24,b[29]=c>>>16&255,b[30]=c>>>8&255,b[31]=c&255,b},"digest"); -return r===void 0?{add:J,digest:me}:(J(r),me())}var oo=re(()=>{"use strict";p();a(Tt,"sha256")});var Q,Rt,ao=re(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ +return r===void 0?{add:J,digest:me}:(J(r),me())}var ao=re(()=>{"use strict";p();a(It,"sha256")});var Q,Tt,uo=re(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ Length",0);I(this,"_state",new Int32Array(4));I(this,"_buffer",new ArrayBuffer(68));I(this,"_buffer8"); I(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 Q._md5cycle(this._state,i),e?this._state:Q._hex( this._state)}};a(Q,"Md5"),I(Q,"stateIdentity",new Int32Array([1732584193,-271733879,-1732584194,271733878])), I(Q,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),I(Q,"hexChars","0123456789\ -abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);Rt=Q});var nn={};le(nn,{createHash:()=>Oc,createHmac:()=>Nc,randomBytes:()=>Dc});function Dc(r){return crypto. -getRandomValues(m.alloc(r))}function Oc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( -function(){return m.from(Tt(e))},"digest")}},"update")};if(r==="md5")return{update:a(function(e){return{ -digest:a(function(){return typeof e=="string"?Rt.hashStr(e):Rt.hashByteArray(e)},"digest")}},"update")}; -throw new Error(`Hash type '${r}' not supported`)}function Nc(r,e){if(r!=="sha256")throw new Error(`\ +abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);Tt=Q});var nn={};le(nn,{createHash:()=>qc,createHmac:()=>Qc,randomBytes:()=>Nc});function Nc(r){return crypto. +getRandomValues(m.alloc(r))}function qc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( +function(){return m.from(It(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 Qc(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=Tt(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=It(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(Tt(o),64),m.from(Tt(u))}, -"digest")}},"update")}}var sn=re(()=>{"use strict";p();oo();ao();a(Dc,"randomBytes");a(Oc,"createHas\ -h");a(Nc,"createHmac")});var Pt=P((wd,on)=>{"use strict";p();on.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: +64);o.set(i,0),o.set(t,64);let u=new Uint8Array(96);return u.set(s,0),u.set(It(o),64),m.from(It(u))}, +"digest")}},"update")}}var sn=re(()=>{"use strict";p();ao();uo();a(Nc,"randomBytes");a(qc,"createHas\ +h");a(Qc,"createHmac")});var Rt=P((Sd,on)=>{"use strict";p();on.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: w.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 ot=It(),qc=ot.getTypeParser(20,"text"),Qc=ot.getTypeParser(1016, -"text");on.exports.__defineSetter__("parseInt8",function(r){ot.setTypeParser(20,"text",r?ot.getTypeParser( -23,"text"):qc),ot.setTypeParser(1016,"text",r?ot.getTypeParser(1007,"text"):Qc)})});var Bt=P((bd,co)=>{"use strict";p();var jc=(sn(),j(nn)),Wc=Pt();function Hc(r){var e=r.replace(/\\/g, -"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(Hc,"escapeElement");function uo(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+uo(r[t]): -r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=Hc(tr(r[t]));return e=e+"}",e}a(uo,"arrayString"); -var tr=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. +keepalives:1,keepalives_idle:0};var st=Ct(),jc=st.getTypeParser(20,"text"),Wc=st.getTypeParser(1016, +"text");on.exports.__defineSetter__("parseInt8",function(r){st.setTypeParser(20,"text",r?st.getTypeParser( +23,"text"):jc),st.setTypeParser(1016,"text",r?st.getTypeParser(1007,"text"):Wc)})});var Pt=P((Ed,lo)=>{"use strict";p();var Hc=(sn(),j(nn)),$c=Rt();function Gc(r){var e=r.replace(/\\/g, +"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(Gc,"escapeElement");function co(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+co(r[t]): +r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=Gc(er(r[t]));return e=e+"}",e}a(co,"arrayString"); +var er=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. 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?Wc.parseInputDatesAsUTC?Vc(r):Gc(r):Array.isArray(r)?uo(r):typeof r== -"object"?$c(r,e):r.toString()},"prepareValue");function $c(r,e){if(r&&typeof r.toPostgres=="function"){ +r.byteLength)}return r instanceof Date?$c.parseInputDatesAsUTC?zc(r):Kc(r):Array.isArray(r)?co(r):typeof r== +"object"?Vc(r,e):r.toString()},"prepareValue");function Vc(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),tr(r.toPostgres(tr),e)}return JSON.stringify(r)}a($c,"prepareObject");function Y(r,e){ -for(r=""+r;r.lengthil});var il,Ft=re(()=>{"use strict";p();il={}});var So=P((Fd,xo)=>{"use strict";p();var ln=(sn(),j(nn));function sl(r){if(r.indexOf("SCRAM-SHA-256")=== --1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=ln.randomBytes( +t),r}a(Yc,"normalizeQueryConfig");var an=a(function(r){return Hc.createHash("md5").update(r,"utf-8"). +digest("hex")},"md5"),Jc=a(function(r,e,t){var n=an(e+r),i=an(m.concat([m.from(n),t]));return"md5"+i}, +"postgresMd5PasswordHash");lo.exports={prepareValue:a(function(e){return er(e)},"prepareValueWrapper"), +normalizeQueryConfig:Yc,postgresMd5PasswordHash:Jc,md5:an}});var Bt={};le(Bt,{default:()=>ul});var ul,Lt=re(()=>{"use strict";p();ul={}});var Eo=P((Dd,vo)=>{"use strict";p();var fn=(sn(),j(nn));function cl(r){if(r.indexOf("SCRAM-SHA-256")=== +-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=fn.randomBytes( 18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"\ -SASLInitialResponse"}}a(sl,"startSession");function ol(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( +SASLInitialResponse"}}a(cl,"startSession");function ll(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=cl(t);if(n.nonce.startsWith(r.clientNonce)){ +L: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=dl(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=m.from(n.salt,"base64"),s=hl(e,i,n.iteration),o=at(s,"Client Key"),u=fl( +art with client nonce");var i=m.from(n.salt,"base64"),s=ml(e,i,n.iteration),o=ot(s,"Client Key"),u=yl( 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=at(u,y),E=bo(o,g),C=E.toString("base64"),H=at(s,"Server Key"),J=at(H,y);r.message="SAS\ -LResponse",r.serverSignature=J.toString("base64"),r.response=f+",p="+C}a(ol,"continueSession");function al(r,e){ +","+l+","+f,g=ot(u,y),E=So(o,g),C=E.toString("base64"),H=ot(s,"Server Key"),J=ot(H,y);r.message="SAS\ +LResponse",r.serverSignature=J.toString("base64"),r.response=f+",p="+C}a(ll,"continueSession");function fl(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}=ll( +"string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=pl( e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does\ - not match")}a(al,"finalizeSession");function ul(r){if(typeof r!="string")throw new TypeError("SASL:\ + not match")}a(fl,"finalizeSession");function hl(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(ul,"isPrintableChars");function wo(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(r)}a(wo,"isBase64");function go(r){if(typeof r!="string")throw new TypeError("SASL: attribute p\ +e<=126)}a(hl,"isPrintableChars");function bo(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(r)}a(bo,"isBase64");function xo(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(go,"parseAttribute\ -Pairs");function cl(r){let e=go(r),t=e.get("r");if(t){if(!ul(t))throw new Error("SASL: SCRAM-SERVER-\ +SASL: Invalid attribute pair entry");let t=e[0],n=e.substring(2);return[t,n]}))}a(xo,"parseAttribute\ +Pairs");function dl(r){let e=xo(r),t=e.get("r");if(t){if(!hl(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(!wo(n))throw new Error("SASL: SCRAM-SERV\ +ER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!bo(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(cl,"parseServerFirstMessage"); -function ll(r){let t=go(r).get("v");if(t){if(!wo(t))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAG\ +tion missing");let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(dl,"parseServerFirstMessage"); +function pl(r){let t=xo(r).get("v");if(t){if(!bo(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(ll,"parseServerFinalMessage");function bo(r,e){if(!m. +signature is missing");return{serverSignature:t}}a(pl,"parseServerFinalMessage");function So(r,e){if(!m. isBuffer(r))throw new TypeError("first argument must be a Buffer");if(!m.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 m.from(r.map((t,n)=>r[n]^e[n]))} -a(bo,"xorBuffers");function fl(r){return ln.createHash("sha256").update(r).digest()}a(fl,"sha256");function at(r,e){ -return ln.createHmac("sha256",r).update(e).digest()}a(at,"hmacSha256");function hl(r,e,t){for(var n=at( -r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sdl});function dl(...r){return r.join("/")}var hn=re(()=>{"use strict";p(); -a(dl,"join")});var dn={};le(dn,{stat:()=>pl});function pl(r,e){e(new Error("No filesystem"))}var pn=re(()=>{"use st\ -rict";p();a(pl,"stat")});var yn={};le(yn,{default:()=>yl});var yl,mn=re(()=>{"use strict";p();yl={}});var vo={};le(vo,{StringDecoder:()=>wn});var gn,wn,Eo=re(()=>{"use strict";p();gn=class gn{constructor(e){ +a(So,"xorBuffers");function yl(r){return fn.createHash("sha256").update(r).digest()}a(yl,"sha256");function ot(r,e){ +return fn.createHmac("sha256",r).update(e).digest()}a(ot,"hmacSha256");function ml(r,e,t){for(var n=ot( +r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;swl});function wl(...r){return r.join("/")}var dn=re(()=>{"use strict";p(); +a(wl,"join")});var pn={};le(pn,{stat:()=>gl});function gl(r,e){e(new Error("No filesystem"))}var yn=re(()=>{"use st\ +rict";p();a(gl,"stat")});var mn={};le(mn,{default:()=>bl});var bl,wn=re(()=>{"use strict";p();bl={}});var Ao={};le(Ao,{StringDecoder:()=>gn});var bn,gn,_o=re(()=>{"use strict";p();bn=class bn{constructor(e){ I(this,"td");this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this. -td.decode(e)}};a(gn,"StringDecoder");wn=gn});var Io=P((Wd,Co)=>{"use strict";p();var{Transform:ml}=(mn(),j(yn)),{StringDecoder:wl}=(Eo(),j(vo)),ke=Symbol( -"last"),ir=Symbol("decoder");function gl(r,e,t){let n;if(this.overflow){if(n=this[ir].write(r).split( -this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[ke]+=this[ir].write(r),n= -this[ke].split(this.matcher);this[ke]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( -"maximum buffer reached"));return}t()}a(gl,"transform");function bl(r){if(this[ke]+=this[ir].end(),this[ke]) -try{_o(this,this.mapper(this[ke]))}catch(e){return r(e)}r()}a(bl,"flush");function _o(r,e){e!==void 0&& -r.push(e)}a(_o,"push");function Ao(r){return r}a(Ao,"noop");function xl(r,e,t){switch(r=r||/\r?\n/,e= -e||Ao,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r=="object"&&!(r instanceof +td.decode(e)}};a(bn,"StringDecoder");gn=bn});var Ro=P((Vd,To)=>{"use strict";p();var{Transform:xl}=(wn(),j(mn)),{StringDecoder:Sl}=(_o(),j(Ao)),Fe=Symbol( +"last"),ir=Symbol("decoder");function vl(r,e,t){let n;if(this.overflow){if(n=this[ir].write(r).split( +this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Fe]+=this[ir].write(r),n= +this[Fe].split(this.matcher);this[Fe]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( +"maximum buffer reached"));return}t()}a(vl,"transform");function El(r){if(this[Fe]+=this[ir].end(),this[Fe]) +try{Io(this,this.mapper(this[Fe]))}catch(e){return r(e)}r()}a(El,"flush");function Io(r,e){e!==void 0&& +r.push(e)}a(Io,"push");function Co(r){return r}a(Co,"noop");function Al(r,e,t){switch(r=r||/\r?\n/,e= +e||Co,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=Ao)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=gl,t.flush=bl,t.readableObjectMode= -!0;let n=new ml(t);return n[ke]="",n[ir]=new wl("utf8"),n.matcher=r,n.mapper=e,n.maxLength=t.maxLength, +"object"&&(t=e,e=Co)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=vl,t.flush=El,t.readableObjectMode= +!0;let n=new xl(t);return n[Fe]="",n[ir]=new Sl("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(xl,"split");Co.exports=xl});var Po=P((Gd,Ce)=>{"use strict";p();var To=(hn(),j(fn)),Sl=(mn(),j(yn)).Stream,vl=Io(),Ro=(Ft(),j(Lt)), -El=5432,sr=w.platform==="win32",kt=w.stderr,Al=56,_l=7,Cl=61440,Il=32768;function Tl(r){return(r&Cl)== -Il}a(Tl,"isRegFile");var ut=["host","port","database","user","password"],bn=ut.length,Rl=ut[bn-1];function xn(){ -var r=kt instanceof Sl&&kt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` -`);kt.write(Ro.format.apply(Ro,e))}}a(xn,"warn");Object.defineProperty(Ce.exports,"isWin",{get:a(function(){ -return sr},"get"),set:a(function(r){sr=r},"set")});Ce.exports.warnTo=function(r){var e=kt;return kt= -r,e};Ce.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(sr?To.join(e.APPDATA||"./","\ -postgresql","pgpass.conf"):To.join(e.HOME||"./",".pgpass"));return t};Ce.exports.usePgPass=function(r,e){ -return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:sr?!0:(e=e||"",Tl(r.mode)?r. -mode&(Al|_l)?(xn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ -(0600) or less',e),!1):!0:(xn('WARNING: password file "%s" is not a plain file',e),!1))};var Pl=Ce.exports. -match=function(r,e){return ut.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||El)===Number( +!1,s(i)},n}a(Al,"split");To.exports=Al});var Lo=P((Yd,Ce)=>{"use strict";p();var Po=(dn(),j(hn)),_l=(wn(),j(mn)).Stream,Cl=Ro(),Bo=(Lt(),j(Bt)), +Il=5432,sr=w.platform==="win32",Ft=w.stderr,Tl=56,Rl=7,Pl=61440,Bl=32768;function Ll(r){return(r&Pl)== +Bl}a(Ll,"isRegFile");var at=["host","port","database","user","password"],xn=at.length,Fl=at[xn-1];function Sn(){ +var r=Ft instanceof _l&&Ft.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +`);Ft.write(Bo.format.apply(Bo,e))}}a(Sn,"warn");Object.defineProperty(Ce.exports,"isWin",{get:a(function(){ +return sr},"get"),set:a(function(r){sr=r},"set")});Ce.exports.warnTo=function(r){var e=Ft;return Ft= +r,e};Ce.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(sr?Po.join(e.APPDATA||"./","\ +postgresql","pgpass.conf"):Po.join(e.HOME||"./",".pgpass"));return t};Ce.exports.usePgPass=function(r,e){ +return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:sr?!0:(e=e||"",Ll(r.mode)?r. +mode&(Tl|Rl)?(Sn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ +(0600) or less',e),!1):!0:(Sn('WARNING: password file "%s" is not a plain file',e),!1))};var kl=Ce.exports. +match=function(r,e){return at.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||Il)===Number( e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};Ce.exports.getPassword=function(r,e,t){var n,i=e.pipe( -vl());function s(c){var l=Bl(c);l&&Ll(l)&&Pl(r,l)&&(n=l[Rl],i.end())}a(s,"onLine");var o=a(function(){ -e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),xn("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 Bl=Ce.exports.parseLine= +Cl());function s(c){var l=Ml(c);l&&Ul(l)&&kl(r,l)&&(n=l[Fl],i.end())}a(s,"onLine");var o=a(function(){ +e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),Sn("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 Ml=Ce.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 E=r.substring(y,g);Object.hasOwnProperty.call(w.env,"PGPASS_NO_DEESCAPE")||(E=E. -replace(/\\([:\\])/g,"$1")),o[ut[f]]=E},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). -length===bn?o:null,o},Ll=Ce.exports.isValidEntry=function(r){for(var e={0:function(o){return o.length> +replace(/\\([:\\])/g,"$1")),o[at[f]]=E},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). +length===xn?o:null,o},Ul=Ce.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 zd=(hn(),j(fn)),Bo=(pn(),j(dn)),or=Po();Sn.exports=function(r,e){ -var t=or.getFileName();Bo.stat(t,function(n,i){if(n||!or.usePgPass(i,t))return e(void 0);var s=Bo.createReadStream( -t);or.getPassword(r,s,e)})};Sn.exports.warnTo=or.warnTo});var Fo={};le(Fo,{default:()=>Fl});var Fl,ko=re(()=>{"use strict";p();Fl={}});var Uo=P((Xd,Mo)=>{"use strict";p();var kl=(Lr(),j(fs)),vn=(pn(),j(dn));function En(r){if(r.charAt(0)=== -"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=kl.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i. +0}},t=0;t{"use strict";p();var Xd=(dn(),j(hn)),Fo=(yn(),j(pn)),or=Lo();vn.exports=function(r,e){ +var t=or.getFileName();Fo.stat(t,function(n,i){if(n||!or.usePgPass(i,t))return e(void 0);var s=Fo.createReadStream( +t);or.getPassword(r,s,e)})};vn.exports.warnTo=or.warnTo});var Mo={};le(Mo,{default:()=>Dl});var Dl,Uo=re(()=>{"use strict";p();Dl={}});var Oo=P((np,Do)=>{"use strict";p();var Ol=(Lr(),j(hs)),En=(yn(),j(pn));function An(r){if(r.charAt(0)=== +"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Ol.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=vn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=vn.readFileSync(t.sslkey).toString()), -t.sslrootcert&&(t.ssl.ca=vn.readFileSync(t.sslrootcert).toString()),t.sslmode){case"disable":{t.ssl= +cert=En.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=En.readFileSync(t.sslkey).toString()), +t.sslrootcert&&(t.ssl.ca=En.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(En,"parse");Mo.exports=En;En.parse=En});var ar=P((rp,No)=>{"use strict";p();var Ml=(ko(),j(Fo)),Oo=Pt(),Do=Uo().parse,te=a(function(r,e,t){return t=== -void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Oo[r]},"val"),Ul=a(function(){switch(w. +!1;break}}return t}a(An,"parse");Do.exports=An;An.parse=An});var ar=P((op,Qo)=>{"use strict";p();var Nl=(Uo(),j(Mo)),qo=Rt(),No=Oo().parse,te=a(function(r,e,t){return t=== +void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||qo[r]},"val"),ql=a(function(){switch(w. 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 Oo.ssl},"readSSLConfigFromEnvironment"),ct=a(function(r){ +no-verify":return{rejectUnauthorized:!1}}return qo.ssl},"readSSLConfigFromEnvironment"),ut=a(function(r){ return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),ye=a(function(r,e,t){ -var n=e[t];n!=null&&r.push(t+"="+ct(n))},"add"),_n=class _n{constructor(e){e=typeof e=="string"?Do(e): -e||{},e.connectionString&&(e=Object.assign({},e,Do(e.connectionString))),this.user=te("user",e),this. +var n=e[t];n!=null&&r.push(t+"="+ut(n))},"add"),Cn=class Cn{constructor(e){e=typeof e=="string"?No(e): +e||{},e.connectionString&&(e=Object.assign({},e,No(e.connectionString))),this.user=te("user",e),this. database=te("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(te("p\ ort",e),10),this.host=te("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, writable:!0,value:te("password",e)}),this.binary=te("binary",e),this.options=te("options",e),this.ssl= -typeof e.ssl>"u"?Ul():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="\ +typeof e.ssl>"u"?ql():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=te("client_encoding",e),this.replication=te("replication", e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=te("application_name",e,"\ @@ -782,28 +782,28 @@ void 0?this.connect_timeout=w.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math var t=[];ye(t,this,"user"),ye(t,this,"password"),ye(t,this,"port"),ye(t,this,"application_name"),ye( t,this,"fallback_application_name"),ye(t,this,"connect_timeout"),ye(t,this,"options");var n=typeof this. ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(ye(t,n,"sslmode"),ye(t,n,"sslca"),ye(t,n,"s\ -slkey"),ye(t,n,"sslcert"),ye(t,n,"sslrootcert"),this.database&&t.push("dbname="+ct(this.database)),this. -replication&&t.push("replication="+ct(this.replication)),this.host&&t.push("host="+ct(this.host)),this. -isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+ct(this.client_encoding)), -Ml.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+ct(s)),e(null,t.join(" ")))})}}; -a(_n,"ConnectionParameters");var An=_n;No.exports=An});var jo=P((sp,Qo)=>{"use strict";p();var Dl=It(),qo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,In=class In{constructor(e,t){ +slkey"),ye(t,n,"sslcert"),ye(t,n,"sslrootcert"),this.database&&t.push("dbname="+ut(this.database)),this. +replication&&t.push("replication="+ut(this.replication)),this.host&&t.push("host="+ut(this.host)),this. +isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+ut(this.client_encoding)), +Nl.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+ut(s)),e(null,t.join(" ")))})}}; +a(Cn,"ConnectionParameters");var _n=Cn;Qo.exports=_n});var Ho=P((cp,Wo)=>{"use strict";p();var Ql=Ct(),jo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,Tn=class Tn{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=qo.exec(e.text):t=qo.exec(e.command),t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2], +var t;e.text?t=jo.exec(e.text):t=jo.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:Ol}=Be(),Wo=jo(),Ho=Bt(),Rn=class Rn extends Ol{constructor(e,t,n){ -super(),e=Ho.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]=Ql.getTypeParser(n.dataTypeID,n. +format||"text")}}};a(Tn,"Result");var In=Tn;Wo.exports=In});var Ko=P((hp,Vo)=>{"use strict";p();var{EventEmitter:jl}=Be(),$o=Ho(),Go=Pt(),Pn=class Pn extends jl{constructor(e,t,n){ +super(),e=Go.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,w.domain&&e.callback&&(this.callback=w.domain.bind(e.callback)),this._result= -new Wo(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError= +new $o(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 Wo(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ +_results=[this._result]),this._result=new $o(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:Ho.prepareValue})}catch(t){ +portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:Go.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(Rn,"Query");var Tn=Rn;$o.exports= -Tn});var ii=P(R=>{"use strict";p();Object.defineProperty(R,"__esModule",{value:!0});R.NoticeMessage=R.DataRowMessage= +e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(Pn,"Query");var Rn=Pn;Vo.exports= +Rn});var si=P(R=>{"use strict";p();Object.defineProperty(R,"__esModule",{value:!0});R.NoticeMessage=R.DataRowMessage= R.CommandCompleteMessage=R.ReadyForQueryMessage=R.NotificationResponseMessage=R.BackendKeyDataMessage= R.AuthenticationMD5Password=R.ParameterStatusMessage=R.ParameterDescriptionMessage=R.RowDescriptionMessage= R.Field=R.CopyResponse=R.CopyDataMessage=R.DatabaseError=R.copyDone=R.emptyQuery=R.replicationStart= @@ -831,30 +831,30 @@ R.portalSuspended=R.noData=R.closeComplete=R.bindComplete=R.parseComplete=void 0 parseComplete",length:5};R.bindComplete={name:"bindComplete",length:5};R.closeComplete={name:"closeC\ omplete",length:5};R.noData={name:"noData",length:5};R.portalSuspended={name:"portalSuspended",length:5}; R.replicationStart={name:"replicationStart",length:4};R.emptyQuery={name:"emptyQuery",length:4};R.copyDone= -{name:"copyDone",length:4};var Hn=class Hn extends Error{constructor(e,t,n){super(e),this.length=t,this. -name=n}};a(Hn,"DatabaseError");var Pn=Hn;R.DatabaseError=Pn;var $n=class $n{constructor(e,t){this.length= -e,this.chunk=t,this.name="copyData"}};a($n,"CopyDataMessage");var Bn=$n;R.CopyDataMessage=Bn;var Gn=class Gn{constructor(e,t,n,i){ -this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Gn,"CopyResponse");var Ln=Gn; -R.CopyResponse=Ln;var Vn=class Vn{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(Vn,"Field");var Fn=Vn; -R.Field=Fn;var Kn=class Kn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ -n",this.fields=new Array(this.fieldCount)}};a(Kn,"RowDescriptionMessage");var kn=Kn;R.RowDescriptionMessage= -kn;var zn=class zn{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ -ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(zn,"ParameterDescriptionMessage");var Mn=zn; -R.ParameterDescriptionMessage=Mn;var Yn=class Yn{constructor(e,t,n){this.length=e,this.parameterName= -t,this.parameterValue=n,this.name="parameterStatus"}};a(Yn,"ParameterStatusMessage");var Un=Yn;R.ParameterStatusMessage= -Un;var Jn=class Jn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; -a(Jn,"AuthenticationMD5Password");var Dn=Jn;R.AuthenticationMD5Password=Dn;var Zn=class Zn{constructor(e,t,n){ -this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Zn,"BackendKeyDataMes\ -sage");var On=Zn;R.BackendKeyDataMessage=On;var Xn=class Xn{constructor(e,t,n,i){this.length=e,this. -processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(Xn,"NotificationResponseMessa\ -ge");var Nn=Xn;R.NotificationResponseMessage=Nn;var ei=class ei{constructor(e,t){this.length=e,this. -status=t,this.name="readyForQuery"}};a(ei,"ReadyForQueryMessage");var qn=ei;R.ReadyForQueryMessage=qn; -var ti=class ti{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(ti,"Comma\ -ndCompleteMessage");var Qn=ti;R.CommandCompleteMessage=Qn;var ri=class ri{constructor(e,t){this.length= -e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(ri,"DataRowMessage");var jn=ri;R.DataRowMessage= -jn;var ni=class ni{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(ni,"NoticeMe\ -ssage");var Wn=ni;R.NoticeMessage=Wn});var Vo=P(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.Writer=void 0;var oi=class oi{constructor(e=256){ +{name:"copyDone",length:4};var $n=class $n extends Error{constructor(e,t,n){super(e),this.length=t,this. +name=n}};a($n,"DatabaseError");var Bn=$n;R.DatabaseError=Bn;var Gn=class Gn{constructor(e,t){this.length= +e,this.chunk=t,this.name="copyData"}};a(Gn,"CopyDataMessage");var Ln=Gn;R.CopyDataMessage=Ln;var Vn=class Vn{constructor(e,t,n,i){ +this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Vn,"CopyResponse");var Fn=Vn; +R.CopyResponse=Fn;var Kn=class Kn{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(Kn,"Field");var kn=Kn; +R.Field=kn;var zn=class zn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ +n",this.fields=new Array(this.fieldCount)}};a(zn,"RowDescriptionMessage");var Mn=zn;R.RowDescriptionMessage= +Mn;var Yn=class Yn{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ +ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(Yn,"ParameterDescriptionMessage");var Un=Yn; +R.ParameterDescriptionMessage=Un;var Jn=class Jn{constructor(e,t,n){this.length=e,this.parameterName= +t,this.parameterValue=n,this.name="parameterStatus"}};a(Jn,"ParameterStatusMessage");var Dn=Jn;R.ParameterStatusMessage= +Dn;var Zn=class Zn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; +a(Zn,"AuthenticationMD5Password");var On=Zn;R.AuthenticationMD5Password=On;var Xn=class Xn{constructor(e,t,n){ +this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Xn,"BackendKeyDataMes\ +sage");var Nn=Xn;R.BackendKeyDataMessage=Nn;var ei=class ei{constructor(e,t,n,i){this.length=e,this. +processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(ei,"NotificationResponseMessa\ +ge");var qn=ei;R.NotificationResponseMessage=qn;var ti=class ti{constructor(e,t){this.length=e,this. +status=t,this.name="readyForQuery"}};a(ti,"ReadyForQueryMessage");var Qn=ti;R.ReadyForQueryMessage=Qn; +var ri=class ri{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(ri,"Comma\ +ndCompleteMessage");var jn=ri;R.CommandCompleteMessage=jn;var ni=class ni{constructor(e,t){this.length= +e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(ni,"DataRowMessage");var Wn=ni;R.DataRowMessage= +Wn;var ii=class ii{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(ii,"NoticeMe\ +ssage");var Hn=ii;R.NoticeMessage=Hn});var zo=P(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.Writer=void 0;var ai=class ai{constructor(e=256){ this.size=e,this.offset=5,this.headerPosition=0,this.buffer=m.allocUnsafe(e)}ensure(e){if(this.buffer. length-this.offset>1)+e;this.buffer=m.allocUnsafe(i),n.copy( this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this. @@ -866,49 +866,49 @@ 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=m.allocUnsafe(this.size),t}};a(oi,"Writer");var si=oi;ur.Writer=si});var zo=P(lr=>{"use strict";p();Object.defineProperty(lr,"__esModule",{value:!0});lr.serialize=void 0; -var ai=Vo(),D=new ai.Writer,Nl=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( +headerPosition=0,this.buffer=m.allocUnsafe(this.size),t}};a(ai,"Writer");var oi=ai;ur.Writer=oi});var Jo=P(lr=>{"use strict";p();Object.defineProperty(lr,"__esModule",{value:!0});lr.serialize=void 0; +var ui=zo(),D=new ui.Writer,Wl=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( n).addCString(r[n]);D.addCString("client_encoding").addCString("UTF8");let e=D.addCString("").flush(), -t=e.length+4;return new ai.Writer().addInt32(t).add(e).flush()},"startup"),ql=a(()=>{let r=m.allocUnsafe( -8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Ql=a(r=>D.addCString(r).flush( -112),"password"),jl=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. -flush(112)},"sendSASLInitialResponseMessage"),Wl=a(function(r){return D.addString(r).flush(112)},"se\ -ndSCRAMClientFinalMessage"),Hl=a(r=>D.addCString(r).flush(81),"query"),Ko=[],$l=a(r=>{let e=r.name|| +t=e.length+4;return new ui.Writer().addInt32(t).add(e).flush()},"startup"),Hl=a(()=>{let r=m.allocUnsafe( +8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),$l=a(r=>D.addCString(r).flush( +112),"password"),Gl=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. +flush(112)},"sendSASLInitialResponseMessage"),Vl=a(function(r){return D.addString(r).flush(112)},"se\ +ndSCRAMClientFinalMessage"),Kl=a(r=>D.addCString(r).flush(81),"query"),Yo=[],zl=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||Ko,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< -n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),lt=new ai.Writer,Gl=a(function(r,e){for(let t=0;t< -r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),lt.addInt32(-1)):n instanceof m?(D.addInt16( -1),lt.addInt32(n.length),lt.add(n)):(D.addInt16(0),lt.addInt32(m.byteLength(n)),lt.addString(n))}},"\ -writeValues"),Vl=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Ko,s=i.length; -return D.addCString(e).addCString(t),D.addInt16(s),Gl(i,r.valueMapper),D.addInt16(s),D.add(lt.flush()), -D.addInt16(n?1:0),D.flush(66)},"bind"),Kl=m.from([69,0,0,0,9,0,0,0,0,0]),zl=a(r=>{if(!r||!r.portal&& -!r.rows)return Kl;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Yl=a( +xecuting queries"));let t=r.types||Yo,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< +n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),ct=new ui.Writer,Yl=a(function(r,e){for(let t=0;t< +r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),ct.addInt32(-1)):n instanceof m?(D.addInt16( +1),ct.addInt32(n.length),ct.add(n)):(D.addInt16(0),ct.addInt32(m.byteLength(n)),ct.addString(n))}},"\ +writeValues"),Jl=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Yo,s=i.length; +return D.addCString(e).addCString(t),D.addInt16(s),Yl(i,r.valueMapper),D.addInt16(s),D.add(ct.flush()), +D.addInt16(n?1:0),D.flush(66)},"bind"),Zl=m.from([69,0,0,0,9,0,0,0,0,0]),Xl=a(r=>{if(!r||!r.portal&& +!r.rows)return Zl;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),ef=a( (r,e)=>{let t=m.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"),ui=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. +6),t.writeInt32BE(r,8),t.writeInt32BE(e,12),t},"cancel"),ci=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i},"cstringMessage"), -Jl=D.addCString("P").flush(68),Zl=D.addCString("S").flush(68),Xl=a(r=>r.name?ui(68,`${r.type}${r.name|| -""}`):r.type==="P"?Jl:Zl,"describe"),ef=a(r=>{let e=`${r.type}${r.name||""}`;return ui(67,e)},"close"), -tf=a(r=>D.add(r).flush(100),"copyData"),rf=a(r=>ui(102,r),"copyFail"),cr=a(r=>m.from([r,0,0,0,4]),"c\ -odeOnlyBuffer"),nf=cr(72),sf=cr(83),of=cr(88),af=cr(99),uf={startup:Nl,password:Ql,requestSsl:ql,sendSASLInitialResponseMessage:jl, -sendSCRAMClientFinalMessage:Wl,query:Hl,parse:$l,bind:Vl,execute:zl,describe:Xl,close:ef,flush:a(()=>nf, -"flush"),sync:a(()=>sf,"sync"),end:a(()=>of,"end"),copyData:tf,copyDone:a(()=>af,"copyDone"),copyFail:rf, -cancel:Yl};lr.serialize=uf});var Yo=P(fr=>{"use strict";p();Object.defineProperty(fr,"__esModule",{value:!0});fr.BufferReader=void 0; -var cf=m.allocUnsafe(0),li=class li{constructor(e=0){this.offset=e,this.buffer=cf,this.encoding="utf\ +tf=D.addCString("P").flush(68),rf=D.addCString("S").flush(68),nf=a(r=>r.name?ci(68,`${r.type}${r.name|| +""}`):r.type==="P"?tf:rf,"describe"),sf=a(r=>{let e=`${r.type}${r.name||""}`;return ci(67,e)},"close"), +of=a(r=>D.add(r).flush(100),"copyData"),af=a(r=>ci(102,r),"copyFail"),cr=a(r=>m.from([r,0,0,0,4]),"c\ +odeOnlyBuffer"),uf=cr(72),cf=cr(83),lf=cr(88),ff=cr(99),hf={startup:Wl,password:$l,requestSsl:Hl,sendSASLInitialResponseMessage:Gl, +sendSCRAMClientFinalMessage:Vl,query:Kl,parse:zl,bind:Jl,execute:Xl,describe:nf,close:sf,flush:a(()=>uf, +"flush"),sync:a(()=>cf,"sync"),end:a(()=>lf,"end"),copyData:of,copyDone:a(()=>ff,"copyDone"),copyFail:af, +cancel:ef};lr.serialize=hf});var Zo=P(fr=>{"use strict";p();Object.defineProperty(fr,"__esModule",{value:!0});fr.BufferReader=void 0; +var df=m.allocUnsafe(0),fi=class fi{constructor(e=0){this.offset=e,this.buffer=df,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(li,"BufferReader");var ci=li;fr.BufferReader=ci});var Xo=P(hr=>{"use strict";p();Object.defineProperty(hr,"__esModule",{value:!0});hr.Parser=void 0;var O=ii(), -lf=Yo(),fi=1,ff=4,Jo=fi+ff,Zo=m.allocUnsafe(0),di=class di{constructor(e){if(this.buffer=Zo,this.bufferLength= -0,this.bufferOffset=0,this.reader=new lf.BufferReader,e?.mode==="binary")throw new Error("Binary mod\ +offset+=e,t}};a(fi,"BufferReader");var li=fi;fr.BufferReader=li});var ta=P(hr=>{"use strict";p();Object.defineProperty(hr,"__esModule",{value:!0});hr.Parser=void 0;var O=si(), +pf=Zo(),hi=1,yf=4,Xo=hi+yf,ea=m.allocUnsafe(0),pi=class pi{constructor(e){if(this.buffer=ea,this.bufferLength= +0,this.bufferOffset=0,this.reader=new pf.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+Jo<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( -i+fi),u=fi+o;if(u+i<=n){let c=this.handlePacket(i+Jo,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. -buffer=Zo,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=n-i,this.bufferOffset=i)}mergeBuffer(e){ +this.bufferLength,i=this.bufferOffset;for(;i+Xo<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( +i+hi),u=hi+o;if(u+i<=n){let c=this.handlePacket(i+Xo,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. +buffer=ea,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. buffer.byteLength*2;for(;t>=s;)s*=2;i=m.allocUnsafe(s)}this.buffer.copy(i,0,this.bufferOffset,this.bufferOffset+ @@ -954,14 +954,14 @@ o=this.reader.string(1);for(;o!=="\0";)s[o]=this.reader.cstring(),o=this.reader. c=i==="notice"?new O.NoticeMessage(t,u):new O.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(di,"Parser");var hi=di;hr.Parser=hi});var pi=P(Me=>{"use strict";p();Object.defineProperty(Me,"__esModule",{value:!0});Me.DatabaseError=Me. -serialize=Me.parse=void 0;var hf=ii();Object.defineProperty(Me,"DatabaseError",{enumerable:!0,get:a( -function(){return hf.DatabaseError},"get")});var df=zo();Object.defineProperty(Me,"serialize",{enumerable:!0, -get:a(function(){return df.serialize},"get")});var pf=Xo();function yf(r,e){let t=new pf.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(yf,"parse");Me.parse=yf});var ea={};le(ea,{connect:()=>mf});function mf({socket:r,servername:e}){return r.startTls(e),r}var ta=re( -()=>{"use strict";p();a(mf,"connect")});var wi=P((Bp,ia)=>{"use strict";p();var ra=(Ze(),j(ls)),wf=Be().EventEmitter,{parse:gf,serialize:K}=pi(), -na=K.flush(),bf=K.sync(),xf=K.end(),mi=class mi extends wf{constructor(e){super(),e=e||{},this.stream= -e.stream||new ra.Socket,this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis, +a(pi,"Parser");var di=pi;hr.Parser=di});var yi=P(ke=>{"use strict";p();Object.defineProperty(ke,"__esModule",{value:!0});ke.DatabaseError=ke. +serialize=ke.parse=void 0;var mf=si();Object.defineProperty(ke,"DatabaseError",{enumerable:!0,get:a( +function(){return mf.DatabaseError},"get")});var wf=Jo();Object.defineProperty(ke,"serialize",{enumerable:!0, +get:a(function(){return wf.serialize},"get")});var gf=ta();function bf(r,e){let t=new gf.Parser;return r. +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(bf,"parse");ke.parse=bf});var ra={};le(ra,{connect:()=>xf});function xf({socket:r,servername:e}){return r.startTls(e),r}var na=re( +()=>{"use strict";p();a(xf,"connect")});var gi=P((Mp,oa)=>{"use strict";p();var ia=(Je(),j(fs)),Sf=Be().EventEmitter,{parse:vf,serialize:K}=yi(), +sa=K.flush(),Ef=K.sync(),Af=K.end(),wi=class wi extends Sf{constructor(e){super(),e=e||{},this.stream= +e.stream||new ia.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=(ta(),j(ea));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= -n.ssl.key)),ra.isIP(t)===0&&(c.servername=t);try{n.stream=u.connect(c)}catch(l){return n.emit("error", +var u=(na(),j(ra));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= +n.ssl.key)),ia.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")}),gf(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& +"end",()=>{this.emit("end")}),vf(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(K.requestSsl())}startup(e){this. stream.write(K.startup(e))}cancel(e,t){this._send(K.cancel(e,t))}password(e){this._send(K.password(e))}sendSASLInitialResponseMessage(e,t){ this._send(K.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(K.sendSCRAMClientFinalMessage( e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(K.query(e))}parse(e){ this._send(K.parse(e))}bind(e){this._send(K.bind(e))}execute(e){this._send(K.execute(e))}flush(){this. -stream.writable&&this.stream.write(na)}sync(){this._ending=!0,this._send(na),this._send(bf)}ref(){this. +stream.writable&&this.stream.write(sa)}sync(){this._ending=!0,this._send(sa),this._send(Ef)}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(xf,()=>{this.stream.end()})}close(e){this._send(K. +this.stream.end();return}return this.stream.write(Af,()=>{this.stream.end()})}close(e){this._send(K. close(e))}describe(e){this._send(K.describe(e))}sendCopyFromChunk(e){this._send(K.copyData(e))}endCopyFrom(){ -this._send(K.copyDone())}sendCopyFail(e){this._send(K.copyFail(e))}};a(mi,"Connection");var yi=mi;ia. -exports=yi});var aa=P((Mp,oa)=>{"use strict";p();var Sf=Be().EventEmitter,kp=(Ft(),j(Lt)),vf=Bt(),gi=So(),Ef=Lo(), -Af=er(),_f=ar(),sa=Go(),Cf=Pt(),If=wi(),bi=class bi extends Sf{constructor(e){super(),this.connectionParameters= -new _f(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database, +this._send(K.copyDone())}sendCopyFail(e){this._send(K.copyFail(e))}};a(wi,"Connection");var mi=wi;oa. +exports=mi});var ca=P((Np,ua)=>{"use strict";p();var _f=Be().EventEmitter,Op=(Lt(),j(Bt)),Cf=Pt(),bi=Eo(),If=ko(), +Tf=Xt(),Rf=ar(),aa=Ko(),Pf=Rt(),Bf=gi(),xi=class xi extends _f{constructor(e){super(),this.connectionParameters= +new Rf(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||S.Promise, -this._types=new Af(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= -!1,this._queryable=!0,this.connection=t.connection||new If({stream:t.stream,ssl:this.connectionParameters. +this._types=new Tf(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= +!1,this._queryable=!0,this.connection=t.connection||new Bf({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||Cf.binary,this. +connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t.binary||Pf.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=>{w.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():Ef(this.connectionParameters, +password=this.password=null;e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():If(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=vf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ -this._checkPgPass(()=>{this.saslSession=gi.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( -this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){gi.continueSession( +()=>{let t=Cf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ +this._checkPgPass(()=>{this.saslSession=bi.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( +this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){bi.continueSession( this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession. -response)}_handleAuthSASLFinal(e){gi.finalizeSession(this.saslSession,e.data),this.saslSession=null}_handleBackendKeyData(e){ +response)}_handleAuthSASLFinal(e){bi.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 sa(e,t,n),i.callback||(s=new this._Promise((l,f)=>{i.callback= +connectionParameters.query_timeout,i=new aa(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");w.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(bi,"Client");var dr=bi;dr.Query=sa;oa.exports=dr});var fa=P((Op,la)=>{"use strict";p();var Tf=Be().EventEmitter,ua=a(function(){},"NOOP"),ca=a((r,e)=>{ -let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),vi=class vi{constructor(e,t,n){ -this.client=e,this.idleListener=t,this.timeoutId=n}};a(vi,"IdleItem");var xi=vi,Ei=class Ei{constructor(e){ -this.callback=e}};a(Ei,"PendingItem");var ft=Ei;function Rf(){throw new Error("Release called on cli\ -ent which has already been released to the pool.")}a(Rf,"throwOnDoubleRelease");function pr(r,e){if(e) +_Promise(t=>{this.connection.once("end",t)})}};a(xi,"Client");var dr=xi;dr.Query=aa;ua.exports=dr});var da=P((jp,ha)=>{"use strict";p();var Lf=Be().EventEmitter,la=a(function(){},"NOOP"),fa=a((r,e)=>{ +let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),Ei=class Ei{constructor(e,t,n){ +this.client=e,this.idleListener=t,this.timeoutId=n}};a(Ei,"IdleItem");var Si=Ei,Ai=class Ai{constructor(e){ +this.callback=e}};a(Ai,"PendingItem");var lt=Ai;function Ff(){throw new Error("Release called on cli\ +ent which has already been released to the pool.")}a(Ff,"throwOnDoubleRelease");function pr(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(pr,"promisify"); -function Pf(r,e){return a(function t(n){n.client=e,e.removeListener("error",t),e.on("error",()=>{r.log( +function kf(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(Pf,"makeIdleListener");var Ai=class Ai extends Tf{constructor(e,t){super(),this.options= +dleListener")}a(kf,"makeIdleListener");var _i=class _i extends Lf{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||Mt().Client,this.Promise= +this.log=this.options.log||function(){},this.Client=this.options.Client||t||kt().Client,this.Promise= this.options.Promise||S.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,36 +1102,36 @@ 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=ca( +if(!this._isFull())return this.newClient(e);throw new Error("unexpected condition")}_remove(e){let t=fa( 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=pr(this.Promise,e),n=t. result;if(this._isFull()||this._idle.length){if(this._idle.length&&w.nextTick(()=>this._pulseQueue()), -!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new ft(t.callback)),n;let i=a((u,c,l)=>{ -clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new ft(i),o=setTimeout(()=>{ca(this._pendingQueue, +!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new lt(t.callback)),n;let i=a((u,c,l)=>{ +clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new lt(i),o=setTimeout(()=>{fa(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 ft(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( -t);let n=Pf(this,t);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&& +newClient(new lt(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( +t);let n=kf(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,ua);else{if(this.log("new client connected"),this.options. +_pulseQueue(),e.timedOut||e.callback(o,void 0,la);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 ft((l,f,y)=>y()), +_expired.add(t),this._idle.findIndex(l=>l.client===t)!==-1&&this._acquireClient(t,new lt((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,ua);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ -let n=!1;return i=>{n&&Rf(),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,la);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ +let n=!1;return i=>{n&&Ff(),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 xi( +this.options.allowExitOnIdle&&s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new Si( e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=pr(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=pr(this.Promise,n);return n=i.callback,this. @@ -1142,7 +1142,7 @@ if(this.log("ending"),this.ending){let n=new Error("Called end on pool more than this.Promise.reject(n)}this.ending=!0;let t=pr(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(Ai,"Pool");var Si=Ai;la.exports=Si});var ha={};le(ha,{default:()=>Bf});var Bf,da=re(()=>{"use strict";p();Bf={}});var pa=P((jp,Lf)=>{Lf.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javas\ +return this._clients.length}};a(_i,"Pool");var vi=_i;ha.exports=vi});var pa={};le(pa,{default:()=>Mf});var Mf,ya=re(()=>{"use strict";p();Mf={}});var ma=P((Gp,Uf)=>{Uf.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 wa=P((Wp,ma)=>{"use strict";p();var ya=Be().EventEmitter,Ff=(Ft(),j(Lt)),_i=Bt(),ht=ma.exports=function(r,e,t){ -ya.call(this),r=_i.normalizeQueryConfig(r,e,t),this.text=r.text,this.values=r.values,this.name=r.name, +a178655"}});var ba=P((Vp,ga)=>{"use strict";p();var wa=Be().EventEmitter,Df=(Lt(),j(Bt)),Ci=Pt(),ft=ga.exports=function(r,e,t){ +wa.call(this),r=Ci.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))};Ff.inherits(ht,ya); -var kf={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ +this.on("newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};Df.inherits(ft,wa); +var Of={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"\ -file",sourceLine:"line",sourceFunction:"routine"};ht.prototype.handleError=function(r){var e=this.native. -pq.resultErrorFields();if(e)for(var t in e){var n=kf[t]||t;r[n]=e[t]}this.callback?this.callback(r): -this.emit("error",r),this.state="error"};ht.prototype.then=function(r,e){return this._getPromise().then( -r,e)};ht.prototype.catch=function(r){return this._getPromise().catch(r)};ht.prototype._getPromise=function(){ +file",sourceLine:"line",sourceFunction:"routine"};ft.prototype.handleError=function(r){var e=this.native. +pq.resultErrorFields();if(e)for(var t in e){var n=Of[t]||t;r[n]=e[t]}this.callback?this.callback(r): +this.emit("error",r),this.state="error"};ft.prototype.then=function(r,e){return this._getPromise().then( +r,e)};ft.prototype.catch=function(r){return this._getPromise().catch(r)};ft.prototype._getPromise=function(){ return this._promise?this._promise:(this._promise=new Promise(function(r,e){this._once("end",r),this. -_once("error",e)}.bind(this)),this._promise)};ht.prototype.submit=function(r){this.state="running";var e=this; +_once("error",e)}.bind(this)),this._promise)};ft.prototype.submit=function(r){this.state="running";var e=this; this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a(function(s,o,u){if(r.native.arrayMode= !1,v(function(){e.emit("_done")}),s)return e.handleError(s);e._emitRowEvents&&(u.length>1?o.forEach( (c,l)=>{c.forEach(f=>{e.emit("row",f,u[l])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="e\ nd",e.emit("end",u),e.callback&&e.callback(null,u)},"after");if(w.domain&&(t=w.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(_i.prepareValue);if(r. +se conflicts and silent errors executing queries"));var n=(this.values||[]).map(Ci.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(_i. -prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var Sa=P((Vp,xa)=>{"use strict";p();var Mf=(da(),j(ha)),Uf=er(),Gp=pa(),ga=Be().EventEmitter,Df=(Ft(),j(Lt)), -Of=ar(),ba=wa(),oe=xa.exports=function(r){ga.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. -_types=new Uf(r.types),this.native=new Mf({types:this._types}),this._queryQueue=[],this._ending=!1,this. -_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Of(r);this. +this.values)){let s=new Error("Query values must be an array");return t(s)}var i=this.values.map(Ci. +prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var Ea=P((Jp,va)=>{"use strict";p();var Nf=(ya(),j(pa)),qf=Xt(),Yp=ma(),xa=Be().EventEmitter,Qf=(Lt(),j(Bt)), +jf=ar(),Sa=ba(),oe=va.exports=function(r){xa.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. +_types=new qf(r.types),this.native=new Nf({types:this._types}),this._queryQueue=[],this._ending=!1,this. +_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new jf(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={}};oe.Query= -ba;Df.inherits(oe,ga);oe.prototype._errorAllQueries=function(r){let e=a(t=>{w.nextTick(()=>{t.native= +Sa;Qf.inherits(oe,xa);oe.prototype._errorAllQueries=function(r){let e=a(t=>{w.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};oe.prototype._connect=function(r){var e=this; if(this._connecting){w.nextTick(()=>r(new Error("Client has already been connected. You cannot reuse\ @@ -1193,7 +1193,7 @@ _pulseQueryQueue(!0),r()})})};oe.prototype.connect=function(r){if(r){this._conne _Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};oe.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=="f\ unction")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 ba(r,e,t),!n.callback){let c,l;i=new this. +e);else if(s=this.connectionParameters.query_timeout,n=new Sa(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");w.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)=>{ @@ -1210,34 +1210,34 @@ in");return}this._activeQuery=e,e.submit(this);var t=this;e.once("_done",functio oe.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};oe.prototype.ref=function(){}; oe.prototype.unref=function(){};oe.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( -r,e,t)};oe.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var Ci=P((Yp,va)=>{"use strict";p();va.exports=Sa()});var Mt=P((Zp,Ut)=>{"use strict";p();var Nf=aa(),qf=Pt(),Qf=wi(),jf=fa(),{DatabaseError:Wf}=pi(),Hf=a( -r=>{var e;return e=class extends jf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),Ii=a( -function(r){this.defaults=qf,this.Client=r,this.Query=this.Client.Query,this.Pool=Hf(this.Client),this. -_pools=[],this.Connection=Qf,this.types=It(),this.DatabaseError=Wf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< -"u"?Ut.exports=new Ii(Ci()):(Ut.exports=new Ii(Nf),Object.defineProperty(Ut.exports,"native",{configurable:!0, -enumerable:!1,get(){var r=null;try{r=new Ii(Ci())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. -defineProperty(Ut.exports,"native",{value:r}),r}}))});var Vf={};le(Vf,{Client:()=>dt,DatabaseError:()=>Se.DatabaseError,NeonDbError:()=>ee,NeonQueryPromise:()=>Le, -Pool:()=>yr,SqlTemplate:()=>nt,UnsafeRawSql:()=>it,_bundleExt:()=>Gf,defaults:()=>Se.defaults,escapeIdentifier:()=>Se.escapeIdentifier, -escapeLiteral:()=>Se.escapeLiteral,neon:()=>un,neonConfig:()=>ge,types:()=>Se.types,warnIfBrowser:()=>St}); -module.exports=j(Vf);p();p();Ze();Lr();p();var bu=Object.defineProperty,xu=Object.defineProperties,Su=Object.getOwnPropertyDescriptors,hs=Object. -getOwnPropertySymbols,vu=Object.prototype.hasOwnProperty,Eu=Object.prototype.propertyIsEnumerable,ds=a( -(r,e,t)=>e in r?bu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), -Au=a((r,e)=>{for(var t in e||(e={}))vu.call(e,t)&&ds(r,t,e[t]);if(hs)for(var t of hs(e))Eu.call(e,t)&& -ds(r,t,e[t]);return r},"__spreadValues"),_u=a((r,e)=>xu(r,Su(e)),"__spreadProps"),Cu=1008e3,ps=new Uint8Array( -new Uint16Array([258]).buffer)[0]===2,Iu=new TextDecoder,Fr=new TextEncoder,jt=Fr.encode("0123456789\ -abcdef"),Wt=Fr.encode("0123456789ABCDEF"),Tu=Fr.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ -stuvwxyz0123456789+/");var ys=Tu.slice();ys[62]=45;ys[63]=95;var yt,Ht;function Ru(r,{alphabet:e,scratchArr:t}={}){if(!yt)if(yt= -new Uint16Array(256),Ht=new Uint16Array(256),ps)for(let C=0;C<256;C++)yt[C]=jt[C&15]<<8|jt[C>>>4],Ht[C]= -Wt[C&15]<<8|Wt[C>>>4];else for(let C=0;C<256;C++)yt[C]=jt[C&15]|jt[C>>>4]<<8,Ht[C]=Wt[C&15]|Wt[C>>>4]<< +r,e,t)};oe.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var Ii=P((e0,Aa)=>{"use strict";p();Aa.exports=Ea()});var kt=P((r0,Mt)=>{"use strict";p();var Wf=ca(),Hf=Rt(),$f=gi(),Gf=da(),{DatabaseError:Vf}=yi(),Kf=a( +r=>{var e;return e=class extends Gf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),Ti=a( +function(r){this.defaults=Hf,this.Client=r,this.Query=this.Client.Query,this.Pool=Kf(this.Client),this. +_pools=[],this.Connection=$f,this.types=Ct(),this.DatabaseError=Vf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< +"u"?Mt.exports=new Ti(Ii()):(Mt.exports=new Ti(Wf),Object.defineProperty(Mt.exports,"native",{configurable:!0, +enumerable:!1,get(){var r=null;try{r=new Ti(Ii())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. +defineProperty(Mt.exports,"native",{value:r}),r}}))});var Jf={};le(Jf,{Client:()=>ht,DatabaseError:()=>Se.DatabaseError,NeonDbError:()=>ee,NeonQueryPromise:()=>Le, +Pool:()=>yr,SqlTemplate:()=>rt,UnsafeRawSql:()=>nt,_bundleExt:()=>Yf,defaults:()=>Se.defaults,escapeIdentifier:()=>Se.escapeIdentifier, +escapeLiteral:()=>Se.escapeLiteral,neon:()=>cn,neonConfig:()=>ge,types:()=>Se.types,warnIfBrowser:()=>xt}); +module.exports=j(Jf);p();p();Je();Lr();p();var Su=Object.defineProperty,vu=Object.defineProperties,Eu=Object.getOwnPropertyDescriptors,ds=Object. +getOwnPropertySymbols,Au=Object.prototype.hasOwnProperty,_u=Object.prototype.propertyIsEnumerable,ps=a( +(r,e,t)=>e in r?Su(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), +Cu=a((r,e)=>{for(var t in e||(e={}))Au.call(e,t)&&ps(r,t,e[t]);if(ds)for(var t of ds(e))_u.call(e,t)&& +ps(r,t,e[t]);return r},"__spreadValues"),Iu=a((r,e)=>vu(r,Eu(e)),"__spreadProps"),Tu=1008e3,ys=new Uint8Array( +new Uint16Array([258]).buffer)[0]===2,Ru=new TextDecoder,Fr=new TextEncoder,Qt=Fr.encode("0123456789\ +abcdef"),jt=Fr.encode("0123456789ABCDEF"),Pu=Fr.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ +stuvwxyz0123456789+/");var ms=Pu.slice();ms[62]=45;ms[63]=95;var pt,Wt;function Bu(r,{alphabet:e,scratchArr:t}={}){if(!pt)if(pt= +new Uint16Array(256),Wt=new Uint16Array(256),ys)for(let C=0;C<256;C++)pt[C]=Qt[C&15]<<8|Qt[C>>>4],Wt[C]= +jt[C&15]<<8|jt[C>>>4];else for(let C=0;C<256;C++)pt[C]=Qt[C&15]|Qt[C>>>4]<<8,Wt[C]=jt[C&15]|jt[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"?Ht:yt,f=0,y=0,g;if(ps) +r.buffer,r.byteOffset,s),c=new Uint32Array(o.buffer,o.byteOffset,i),l=e==="upper"?Wt:pt,f=0,y=0,g;if(ys) 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;ut[de(this. _mapKey.has(i)?this._mapKey.get(i):i)]=n),t}mapDecode(e,t){let n=this.decode(e);if(this._keyMap)switch(n. -constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return Is( -()=>(jr(),this?this.decode(e,t):gt.prototype.decode.call(bs,e,t)));He=t>-1?t:e.length,h=0,Ur=0,bt=0, -Vt=null,Mr=vs,W=null,x=e;try{X=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ +constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return Ts( +()=>(jr(),this?this.decode(e,t):wt.prototype.decode.call(xs,e,t)));We=t>-1?t:e.length,h=0,Ur=0,gt=0, +Gt=null,Mr=Es,W=null,x=e;try{X=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ throw x=null,e instanceof Uint8Array?n:new Error("Source must be a Uint8Array or Buffer but was a "+ -(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof gt){if(B=this,ie=this.sharedValues&& +(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof wt){if(B=this,ie=this.sharedValues&& (this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this. -structures)return N=this.structures,$t();(!N||N.length>0)&&(N=[])}else B=bs,(!N||N.length>0)&&(N=[]), -ie=null;return $t()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;xt=!0;let o=this?this.decode(e, -s):Hr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=W.postBundlePosition){let e=new Error("Unexpected bundle pos\ -ition");throw e.incomplete=!0,e}h=W.postBundlePosition,W=null}if(h==He)N=null,x=null,he&&(he=null);else if(h> -He){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!xt)throw new Error( +structures)return N=this.structures,Ht();(!N||N.length>0)&&(N=[])}else B=xs,(!N||N.length>0)&&(N=[]), +ie=null;return Ht()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;bt=!0;let o=this?this.decode(e, +s):Hr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=W.postBundlePosition){let e=new Error("Unexpected bundle pos\ +ition");throw e.incomplete=!0,e}h=W.postBundlePosition,W=null}if(h==We)N=null,x=null,he&&(he=null);else if(h> +We){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!bt)throw new Error( "Data read, but end of buffer not reached");return r}catch(r){throw jr(),(r instanceof RangeError||r. -message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a($t,"checkedRead");function L(){ -let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return Du();r=X. -getUint16(h),h+=2;break;case 26:if(e==7){let t=X.getFloat32(h);if(B.useFloat32>2){let n=Ts[(x[h]&127)<< +message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a(Ht,"checkedRead");function L(){ +let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return Nu();r=X. +getUint16(h),h+=2;break;case 26:if(e==7){let t=X.getFloat32(h);if(B.useFloat32>2){let n=Rs[(x[h]&127)<< 1|x[h+1]>>7];return h+=4,(n*t+(t>0?.5:-.5)>>0)/n}return h+=4,t}if(r=X.getUint32(h),h+=4,e===1)return-1- r;break;case 27:if(e==7){let t=X.getFloat64(h);return h+=8,t}if(e>1){if(X.getUint32(h)>0)throw new Error( "JavaScript does not support arrays, maps, or strings with length over 4294967295");r=X.getUint32(h+ 4)}else B.int64AsNumber?(r=X.getUint32(h)*4294967296,r+=X.getUint32(h+4)):r=X.getBigUint64(h);h+=8;break;case 31: switch(e){case 2:case 3:throw new Error("Indefinite length not supported for byte or text strings");case 4: -let t=[],n,i=0;for(;(n=L())!=Xe;){if(i>=mt)throw new Error(`Array length exceeds ${mt}`);t[i++]=n}return e== +let t=[],n,i=0;for(;(n=L())!=Ze;){if(i>=yt)throw new Error(`Array length exceeds ${yt}`);t[i++]=n}return e== 4?t:e==3?t.join(""):m.concat(t);case 5:let s;if(B.mapsAsObjects){let o={},u=0;if(B.keyMap)for(;(s=L())!= -Xe;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[de(B.decodeKey(s))]=L()}else for(;(s= -L())!=Xe;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[de(s)]=L()}return o}else{wt&& -(B.mapsAsObjects=!0,wt=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s=L())!=Xe;){if(u++>=_e)throw new Error( -`Map size exceeds ${_e}`);o.set(B.decodeKey(s),L())}}else{let u=0;for(;(s=L())!=Xe;){if(u++>=_e)throw new Error( -`Map size exceeds ${_e}`);o.set(s,L())}}return o}case 7:return Xe;default:throw new Error("Invalid m\ +Ze;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[de(B.decodeKey(s))]=L()}else for(;(s= +L())!=Ze;){if(u++>=_e)throw new Error(`Property count exceeds ${_e}`);o[de(s)]=L()}return o}else{mt&& +(B.mapsAsObjects=!0,mt=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s=L())!=Ze;){if(u++>=_e)throw new Error( +`Map size exceeds ${_e}`);o.set(B.decodeKey(s),L())}}else{let u=0;for(;(s=L())!=Ze;){if(u++>=_e)throw new Error( +`Map size exceeds ${_e}`);o.set(s,L())}}return o}case 7:return Ze;default:throw new Error("Invalid m\ ajor type for indefinite length "+e)}default:throw new Error("Unknown token "+r)}switch(e){case 0:return r;case 1: -return~r;case 2:return Uu(r);case 3:if(bt>=h)return Vt.slice(h-Kt,(h+=r)-Kt);if(bt==0&&He<140&&r<32){ -let i=r<16?As(r):Mu(r);if(i!=null)return i}return ku(r);case 4:if(r>=mt)throw new Error(`Array lengt\ -h exceeds ${mt}`);let t=new Array(r);for(let i=0;i=_e)throw new Error( -`Map size exceeds ${mt}`);if(B.mapsAsObjects){let i={};if(B.keyMap)for(let s=0;s=h)return Gt.slice(h-Vt,(h+=r)-Vt);if(gt==0&&We<140&&r<32){ +let i=r<16?_s(r):Du(r);if(i!=null)return i}return Uu(r);case 4:if(r>=yt)throw new Error(`Array lengt\ +h exceeds ${yt}`);let t=new Array(r);for(let i=0;i=_e)throw new Error( +`Map size exceeds ${yt}`);if(B.mapsAsObjects){let i={};if(B.keyMap)for(let s=0;s=ws){let i=N[r&8191];if(i)return i.read||(i.read=Nr(i)),i.read();if(r<65536){if(r== -Fu){let s=tt(),o=L(),u=L();Qr(o,u);let c={};if(B.keyMap)for(let l=2;l=gs){let i=N[r&8191];if(i)return i.read||(i.read=Nr(i)),i.read();if(r<65536){if(r== +Mu){let s=et(),o=L(),u=L();Qr(o,u);let c={};if(B.keyMap)for(let l=2;l23)switch(t){case 24:t=x[h++];break;case 25:t=X.getUint16(h),h+=2;break;case 26:t=X.getUint32( h),h+=4;break;default:throw new Error("Expected array header, but got "+x[h-1])}let n=this.compiledReader; -for(;n;){if(n.propertyCount===t)return n(L);n=n.next}if(this.slowReads++>=Es){let s=this.length==t?this: -this.slice(0,t);return n=B.keyMap?new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>xs.test( -o)?de(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>xs. +for(;n;){if(n.propertyCount===t)return n(L);n=n.next}if(this.slowReads++>=As){let s=this.length==t?this: +this.slice(0,t);return n=B.keyMap?new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>Ss.test( +o)?de(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>Ss. test(o)?de(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"),this.compiledReader&&(n.next=this. compiledReader),n.propertyCount=t,this.compiledReader=n,n(L)}let i={};if(B.keyMap)for(let s=0;s64&&kr)return kr.decode(x.subarray(h,h+=r));let t=h+ +if(r==null)return r+"";throw new Error("Invalid property name type "+typeof r)}a(de,"safeKey");var Uu=qr;function qr(r){let e;if(r<16&&(e=_s(r)))return e;if(r>64&&kr)return kr.decode(x.subarray(h,h+=r));let t=h+ r,n=[];for(e="";h=t||(x[h]& 192)!==128)n.push(65533);else{let s=x[h++]&63;n.push((i&31)<<6|s)}else if((i&240)===224){let s=h=t||(s&192)!==128||i===224&&s<160||i===237&&s>=160)n.push(65533);else if(h++,h>=t||(x[h]&192)!== @@ -1312,9 +1312,9 @@ t?x[h]:0;if(i>244||h>=t||(s&192)!==128||i===240&&s<144||i===244&&s>=144)n.push(6 t||(x[h]&192)!==128)n.push(65533);else{let o=x[h++]&63;if(h>=t||(x[h]&192)!==128)n.push(65533);else{ let u=x[h++]&63,c=(i&7)<<18|(s&63)<<12|o<<6|u;c-=65536,n.push(c>>>10&1023|55296),n.push(56320|c&1023)}}}else n.push(65533);n.length>=4096&&(e+=V.apply(String,n),n.length=0)}return n.length>0&&(e+=V.apply(String, -n)),e}a(qr,"readStringJS");var V=String.fromCharCode;function Mu(r){let e=h,t=new Array(r);for(let n=0;n< -r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return V.apply(String,t)}a(Mu,"longStringInJS"); -function As(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return V(e)}}else{ +n)),e}a(qr,"readStringJS");var V=String.fromCharCode;function Du(r){let e=h,t=new Array(r);for(let n=0;n< +r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return V.apply(String,t)}a(Du,"longStringInJS"); +function _s(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return V(e)}}else{ let e=x[h++],t=x[h++];if((e&128)>0||(t&128)>0){h-=2;return}if(r<3)return V(e,t);let n=x[h++];if((n&128)> 0){h-=3;return}return V(e,t,n)}else{let e=x[h++],t=x[h++],n=x[h++],i=x[h++];if((e&128)>0||(t&128)>0|| (n&128)>0||(i&128)>0){h-=4;return}if(r<6){if(r===4)return V(e,t,n,i);{let s=x[h++];if((s&128)>0){h-= @@ -1327,63 +1327,63 @@ let y=x[h++];if((y&128)>0){h-=11;return}return V(e,t,n,i,s,o,u,c,l,f,y)}else{let g=x[h++];if((l&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return V(e,t, n,i,s,o,u,c,l,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E)}}else{ let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return V(e,t,n,i,s,o,u,c,l,f,y,g, -E,C);let H=x[h++];if((H&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E,C,H)}}}}}a(As,"short\ -StringInJS");function Uu(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( -h,h+=r)}a(Uu,"readBin");var _s=new Float32Array(1),Gt=new Uint8Array(_s.buffer,0,4);function Du(){let r=x[h++],e=x[h++],t=(r& +E,C);let H=x[h++];if((H&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E,C,H)}}}}}a(_s,"short\ +StringInJS");function Ou(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( +h,h+=r)}a(Ou,"readBin");var Cs=new Float32Array(1),$t=new Uint8Array(Cs.buffer,0,4);function Nu(){let r=x[h++],e=x[h++],t=(r& 127)>>2;if(t===31)return e||r&3?NaN:r&128?-1/0:1/0;if(t===0){let n=((r&3)<<8|e)/16777216;return r&128? --n:n}return Gt[3]=r&128|(t>>1)+56,Gt[2]=(r&7)<<5|e>>3,Gt[1]=e<<5,Gt[0]=0,_s[0]}a(Du,"getFloat16");var ph=new Array( -4096);var $r=class $r{constructor(e,t){this.value=e,this.tag=t}};a($r,"Tag");var rt=$r;q[0]=r=>new Date(r); +-n:n}return $t[3]=r&128|(t>>1)+56,$t[2]=(r&7)<<5|e>>3,$t[1]=e<<5,$t[0]=0,Cs[0]}a(Nu,"getFloat16");var gh=new Array( +4096);var $r=class $r{constructor(e,t){this.value=e,this.tag=t}};a($r,"Tag");var tt=$r;q[0]=r=>new Date(r); q[1]=r=>new Date(Math.round(r*1e3));q[2]=r=>{let e=BigInt(0);for(let t=0,n=r.byteLength;tBigInt(-1)-q[2](r);q[4]=r=>+(r[1]+"e"+r[0]);q[5]=r=>r[1]*Math. exp(r[0]*Math.log(2));var Qr=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. -restoreStructures=[]))[r]=t),N[r]=e,e.read=Nr(e)},"recordDefinition");q[Bu]=r=>{let e=r.length,t=r[1]; +restoreStructures=[]))[r]=t),N[r]=e,e.read=Nr(e)},"recordDefinition");q[Fu]=r=>{let e=r.length,t=r[1]; Qr(r[0],t);let n={};for(let i=2;iW?W[0].slice( -W.position0,W.position0+=r):new rt(r,14);q[15]=r=>W?W[1].slice(W.position1,W.position1+=r):new rt(r, -15);var Ou={Error,RegExp};q[27]=r=>(Ou[r[0]]||Error)(r[1],r[2]);var Cs=a(r=>{if(x[h++]!=132){let t=new Error( +W.position0,W.position0+=r):new tt(r,14);q[15]=r=>W?W[1].slice(W.position1,W.position1+=r):new tt(r, +15);var qu={Error,RegExp};q[27]=r=>(qu[r[0]]||Error)(r[1],r[2]);var Is=a(r=>{if(x[h++]!=132){let t=new Error( "Packed values structure must be followed by a 4 element array");throw x.length{if(!ie)if(B.getShared)Wr();else return new rt( -r,gs);if(typeof r=="number")return ie[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ +r(),r()},"packedTable");Is.handlesRead=!0;q[51]=Is;q[bs]=r=>{if(!ie)if(B.getShared)Wr();else return new tt( +r,bs);if(typeof r=="number")return ie[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ ger packed references yet");throw r===void 0&&(e.incomplete=!0),e};q[28]=r=>{he||(he=new Map,he.id=0); let e=he.id++,t=h,n=x[h],i;n>>5==4?i=[]:i={};let s={target:i};he.set(e,s);let o=r();return s.used?(Object. getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(h=t,i=o,he.set(e,{target:i}),o=r()),Object.assign(i,o)): (s.target=o,o)};q[28].handlesRead=!0;q[29]=r=>{let e=he.get(r);return e.used=!0,e.target};q[258]=r=>new Set( -r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,wt=!0),r())).handlesRead=!0;function et(r,e){return typeof r== -"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(et,"combine");function We(){if(!ie) -if(B.getShared)Wr();else throw new Error("No packed values available");return ie}a(We,"getPackedValu\ -es");var Nu=1399353956;Dr.push((r,e)=>{if(r>=225&&r<=255)return et(We().prefixes[r-224],e);if(r>=28704&& -r<=32767)return et(We().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return et(We().prefixes[r- -1879048192],e);if(r>=216&&r<=223)return et(e,We().suffixes[r-216]);if(r>=27647&&r<=28671)return et(e, -We().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return et(e,We().suffixes[r-1811939328]);if(r== -Nu)return{packedValues:ie,structures:N.slice(0),version:e};if(r==55799)return e});var qu=new Uint8Array( -new Uint16Array([1]).buffer)[0]==1,Ss=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> +r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,mt=!0),r())).handlesRead=!0;function Xe(r,e){return typeof r== +"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Xe,"combine");function je(){if(!ie) +if(B.getShared)Wr();else throw new Error("No packed values available");return ie}a(je,"getPackedValu\ +es");var Qu=1399353956;Dr.push((r,e)=>{if(r>=225&&r<=255)return Xe(je().prefixes[r-224],e);if(r>=28704&& +r<=32767)return Xe(je().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return Xe(je().prefixes[r- +1879048192],e);if(r>=216&&r<=223)return Xe(e,je().suffixes[r-216]);if(r>=27647&&r<=28671)return Xe(e, +je().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return Xe(e,je().suffixes[r-1811939328]);if(r== +Qu)return{packedValues:ie,structures:N.slice(0),version:e};if(r==55799)return e});var ju=new Uint8Array( +new Uint16Array([1]).buffer)[0]==1,vs=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> "u"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"? -{name:"BigInt64Array"}:BigInt64Array,Float32Array,Float64Array],Qu=[64,68,69,70,71,72,77,78,79,85,86]; -for(let r=0;r{if(!r)throw new Error("Could not find typed array for code "+e); +2:n==8?3:0;q[i?e:e-4]=n==1||i==ju?o=>{if(!r)throw new Error("Could not find typed array for code "+e); return!B.copyBuffers&&(n===1||n===2&&!(o.byteOffset&1)||n===4&&!(o.byteOffset&3)||n===8&&!(o.byteOffset& 7))?new r(o.buffer,o.byteOffset,o.byteLength>>s):new r(Uint8Array.prototype.slice.call(o,0).buffer)}: o=>{if(!r)throw new Error("Could not find typed array for code "+e);let u=new DataView(o.buffer,o.byteOffset, o.byteLength),c=o.length>>s,l=new r(c),f=u[t];for(let y=0;y23)switch(r){case 24:r=x[h++];break;case 25:r=X.getUint16( -h),h+=2;break;case 26:r=X.getUint32(h),h+=4;break}return r}a(tt,"readJustLength");function Wr(){if(B. -getShared){let r=Is(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ie= +Hu,"registerTypedArray");function $u(){let r=et(),e=h+L();for(let n=2;n23)switch(r){case 24:r=x[h++];break;case 25:r=X.getUint16( +h),h+=2;break;case 26:r=X.getUint32(h),h+=4;break}return r}a(et,"readJustLength");function Wr(){if(B. +getShared){let r=Ts(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ie= B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(Wr, -"loadShared");function Is(r){let e=He,t=h,n=Ur,i=Kt,s=bt,o=Vt,u=Mr,c=he,l=W,f=new Uint8Array(x.slice( -0,He)),y=N,g=B,E=xt,C=r();return He=e,h=t,Ur=n,Kt=i,bt=s,Vt=o,Mr=u,he=c,W=l,x=f,xt=E,N=y,B=g,X=new DataView( -x.buffer,x.byteOffset,x.byteLength),C}a(Is,"saveState");function jr(){x=null,he=null,N=null}a(jr,"cl\ -earSource");var Ts=new Array(147);for(let r=0;r<256;r++)Ts[r]=+("1e"+Math.floor(45.15-r*.30103));var Hr=new Or({ -useRecords:!1}),yh=Hr.decode,Rs=Hr.decodeMultiple;p();var zt=class zt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ +"loadShared");function Ts(r){let e=We,t=h,n=Ur,i=Vt,s=gt,o=Gt,u=Mr,c=he,l=W,f=new Uint8Array(x.slice( +0,We)),y=N,g=B,E=bt,C=r();return We=e,h=t,Ur=n,Vt=i,gt=s,Gt=o,Mr=u,he=c,W=l,x=f,bt=E,N=y,B=g,X=new DataView( +x.buffer,x.byteOffset,x.byteLength),C}a(Ts,"saveState");function jr(){x=null,he=null,N=null}a(jr,"cl\ +earSource");var Rs=new Array(147);for(let r=0;r<256;r++)Rs[r]=+("1e"+Math.floor(45.15-r*.30103));var Hr=new Or({ +useRecords:!1}),bh=Hr.decode,Ps=Hr.decodeMultiple;p();var Kt=class Kt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ let{strings:t,values:n}=this;for(let i=0,s=t.length;iu.length!==0).map(u=>JSON.parse(u)):Rs(new Uint8Array(await r.arrayBuffer())),i=n.pop(); -if(i===null||typeof i!="object"||Array.isArray(i))throw new ee("Neon internal error: streamed respon\ -se ended without a terminal message");if("message"in i)throw typeof i.message!="string"?new ee("Neon\ - internal error: unexpected streamed response status"):mo(i);if(Object.keys(i).length!==0)throw new ee( -"Neon internal error: unexpected streamed response status");let s=[],o;for(let u of n){Array.isArray( -u)||Fe();let[c,...l]=u;switch(c){case Zc:o!==void 0&&Fe(),o={fields:l,rows:[]};break;case Jc:if((o=== -void 0||l.length===0&&o.fields.length!==0)&&Fe(),l.length===0){o.rows.push([]);break}let f=o.row??(o. -row=[]);for(let[y,g]of l.entries()){if((f.length>=o.fields.length||Array.isArray(g)&&(g.length!==1|| -typeof g[0]!="string")||!Array.isArray(g)&&g!==null&&typeof g!="string")&&Fe(),Array.isArray(g)){(o. -partialText??(o.partialText=[])).push(g[0]);continue}g===null?(o.partialText!==void 0&&Fe(),f.push(null)): -(o.partialText===void 0?f.push(g):(o.partialText.push(g),f.push(o.partialText.join(""))),o.partialText= -void 0),f.length===o.fields.length&&(y!==l.length-1&&Fe(),o.rows.push(f),o.row=void 0)}break;case Xc: -(o===void 0||o.row!==void 0||o.partialText!==void 0||l.length!==2)&&Fe(),s.push({fields:o.fields,rows:o. -rows,command:l[0],rowCount:l[1]}),o=void 0;break;default:Fe()}}if(o!==void 0||s.length!==(t??1))throw new ee( -"Neon internal error: incomplete streamed response");return t===void 0?s[0]:{results:s}}a(tl,"readSt\ -reamingResults");function rl(r){return r instanceof m?"\\x"+ms(r):r}a(rl,"encodeBuffersAsBytea");function fo(r){ -let{query:e,params:t}=r instanceof nt?r.toParameterizedQuery():r;return{query:e,params:t.map(n=>rl((0,yo.prepareValue)( -n)))}}a(fo,"prepareQuery");function un(r,{arrayMode:e,fullResults:t,fetchOptions:n,responseFormat:i, -isolationLevel:s,readOnly:o,deferrable:u,authToken:c,disableWarningInBrowsers:l}={}){if(!r)throw new Error( -"No database connection string was provided to `neon()`. Perhaps an environment variable has not bee\ -n set?");let f;try{f=Br(r)}catch{throw new Error("Database connection string provided to `neon()` is\ - not a valid URL. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E,port:C,pathname:H}=f; -if(y!=="postgres:"&&y!=="postgresql:"||!g||!E||!H)throw new Error("Database connection string format\ - for `neon()` should be: postgresql://user@host.tld/dbname?option=value");function J(T,...b){if(!(Array. -isArray(T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can now be called\ - only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], options). F\ -or a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SELECT $1", [\ -value], options).');return new Le(me,new nt(T,b))}a(J,"templateFn"),J.query=(T,b,F)=>new Le(me,{query:T, -params:b??[]},F),J.unsafe=T=>new it(T),J.transaction=async(T,b)=>{if(typeof T=="function"&&(T=T(J)), -!Array.isArray(T))throw new Error(lo);T.forEach($=>{if(!($ instanceof Le))throw new Error(lo)});let F=T. -map($=>$.queryData),ae=T.map($=>$.opts??{});return me(F,ae,b)};async function me(T,b,F){let{fetchEndpoint:ae, -fetchFunction:$}=ge,we=Array.isArray(T),Ie=we?{queries:T.map(Ee=>fo(Ee))}:fo(T),ce=n??{},M=i??"json", -Z=e??!1,ve=t??!1,Te=s,Ue=o,De=u;F!==void 0&&(F.fetchOptions!==void 0&&(ce={...ce,...F.fetchOptions}), -F.arrayMode!==void 0&&(Z=F.arrayMode),F.fullResults!==void 0&&(ve=F.fullResults),F.responseFormat!== -void 0&&(M=F.responseFormat),F.isolationLevel!==void 0&&(Te=F.isolationLevel),F.readOnly!==void 0&&(Ue= -F.readOnly),F.deferrable!==void 0&&(De=F.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!== +nr,"NeonDbError");var ee=nr,fo="transaction() expects an array of queries, or a function returning a\ +n array of queries",Zc=["severity","code","detail","hint","position","internalPosition","internalQue\ +ry","where","schema","table","column","dataType","constraint","file","line","routine"],tr={json:"app\ +lication/json",jsonl:"application/vnd.neon.sql.v1+json","cbor-seq":"application/vnd.neon.sql.v1+cbor"}; +function Xc(r){switch(r.headers.get("Content-Type")?.split(";",1)[0].trim().toLowerCase()){case tr.json: +return"json";case tr.jsonl:return"jsonl";case tr["cbor-seq"]:return"cbor-seq";default:return}}a(Xc,"\ +getResponseFormat");function wo(r){let e=new ee(r.message);for(let t of Zc)e[t]=r[t]??void 0;return e} +a(wo,"dbError");function rr(){throw new ee("Neon internal error: unexpected streamed response messag\ +e")}a(rr,"unexpectedStreamingMessage");function go(){throw new ee("Neon internal error: incomplete s\ +treamed response")}a(go,"incompleteStreamingResponse");function un(r){let e=r.next();return e.done&& +go(),e.value}a(un,"nextStreamingMessage");function el(r){return r!==null&&typeof r=="object"&&!Array. +isArray(r)&&typeof r.command=="string"&&"rowCount"in r}a(el,"isQueryMessage");function tl(r,e){if(r=== +null||typeof r=="string")return r;(!Array.isArray(r)||r.length!==1||typeof r[0]!="string")&&rr();let t=[ +r[0]];for(;;){let n=un(e);if(typeof n=="string")return t.push(n),t.join("");(!Array.isArray(n)||n.length!== +1||typeof n[0]!="string")&&rr(),t.push(n[0])}}a(tl,"readStreamingValue");function rl(r,e){(r===null|| +typeof r!="object"||Array.isArray(r)||!Array.isArray(r.fields))&&rr();let t=r.fields,n=[];for(;;){let i=un( +e);if(el(i))return{fields:t,rows:n,command:i.command,rowCount:i.rowCount};if(t.length===0){(!Array.isArray( +i)||i.length!==0)&&rr(),n.push([]);continue}let s=[];for(let o=0;os.length!==0).map(s=>JSON.parse(s)):Ps(new Uint8Array(await r.arrayBuffer())),i=n.pop(); +if(i===null||typeof i!="object"||Array.isArray(i)||"fields"in i||"command"in i)throw new ee("Neon in\ +ternal error: streamed response ended without a terminal message");if("message"in i)throw typeof i.message!= +"string"?new ee("Neon internal error: unexpected streamed response status"):wo(i);if(Object.keys(i). +length!==0)throw new ee("Neon internal error: unexpected streamed response status");return il(n,t)}a( +sl,"readStreamingResults");function ol(r){return r instanceof m?"\\x"+ws(r):r}a(ol,"encodeBuffersAsB\ +ytea");function ho(r){let{query:e,params:t}=r instanceof rt?r.toParameterizedQuery():r;return{query:e, +params:t.map(n=>ol((0,mo.prepareValue)(n)))}}a(ho,"prepareQuery");function cn(r,{arrayMode:e,fullResults:t, +fetchOptions:n,responseFormat:i,isolationLevel:s,readOnly:o,deferrable:u,authToken:c,disableWarningInBrowsers:l}={}){ +if(!r)throw new Error("No database connection string was provided to `neon()`. Perhaps an environmen\ +t variable has not been set?");let f;try{f=Br(r)}catch{throw new Error("Database connection string p\ +rovided to `neon()` is not a valid URL. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E, +port:C,pathname:H}=f;if(y!=="postgres:"&&y!=="postgresql:"||!g||!E||!H)throw new Error("Database con\ +nection string format for `neon()` should be: postgresql://user@host.tld/dbname?option=value");function J(T,...b){ +if(!(Array.isArray(T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can no\ +w be called only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], \ +options). For a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SE\ +LECT $1", [value], options).');return new Le(me,new rt(T,b))}a(J,"templateFn"),J.query=(T,b,F)=>new Le( +me,{query:T,params:b??[]},F),J.unsafe=T=>new nt(T),J.transaction=async(T,b)=>{if(typeof T=="function"&& +(T=T(J)),!Array.isArray(T))throw new Error(fo);T.forEach($=>{if(!($ instanceof Le))throw new Error(fo)}); +let F=T.map($=>$.queryData),ae=T.map($=>$.opts??{});return me(F,ae,b)};async function me(T,b,F){let{ +fetchEndpoint:ae,fetchFunction:$}=ge,we=Array.isArray(T),Ie=we?{queries:T.map(Ee=>ho(Ee))}:ho(T),ce=n?? +{},M=i??"json",Z=e??!1,ve=t??!1,Te=s,Me=o,Ue=u;F!==void 0&&(F.fetchOptions!==void 0&&(ce={...ce,...F. +fetchOptions}),F.arrayMode!==void 0&&(Z=F.arrayMode),F.fullResults!==void 0&&(ve=F.fullResults),F.responseFormat!== +void 0&&(M=F.responseFormat),F.isolationLevel!==void 0&&(Te=F.isolationLevel),F.readOnly!==void 0&&(Me= +F.readOnly),F.deferrable!==void 0&&(Ue=F.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!== void 0&&(ce={...ce,...b.fetchOptions}),b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(M= -b.responseFormat);let Oe=c;!Array.isArray(b)&&b?.authToken!==void 0&&(Oe=b.authToken);let mr=typeof ae== -"function"?ae(E,C,{jwtAuth:Oe!==void 0}):ae,Ne={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ -rue","Neon-Array-Mode":"true",Accept:rr[M]},Re=await nl(Oe);Re&&(Ne.Authorization=`Bearer ${Re}`),we&& -(Te!==void 0&&(Ne["Neon-Batch-Isolation-Level"]=Te),Ue!==void 0&&(Ne["Neon-Batch-Read-Only"]=String( -Ue)),De!==void 0&&(Ne["Neon-Batch-Deferrable"]=String(De))),l||ge.disableWarningInBrowsers||St();let z; -try{z=await($??fetch)(mr,{method:"POST",body:JSON.stringify(Ie),headers:Ne,...ce})}catch(Ee){let ue=new ee( -`Error connecting to database: ${Ee}`);throw ue.sourceError=Ee,ue}let $e=el(z);if(z.ok){if($e===void 0) +b.responseFormat);let De=c;!Array.isArray(b)&&b?.authToken!==void 0&&(De=b.authToken);let mr=typeof ae== +"function"?ae(E,C,{jwtAuth:De!==void 0}):ae,Oe={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ +rue","Neon-Array-Mode":"true",Accept:tr[M]},Re=await al(De);Re&&(Oe.Authorization=`Bearer ${Re}`),we&& +(Te!==void 0&&(Oe["Neon-Batch-Isolation-Level"]=Te),Me!==void 0&&(Oe["Neon-Batch-Read-Only"]=String( +Me)),Ue!==void 0&&(Oe["Neon-Batch-Deferrable"]=String(Ue))),l||ge.disableWarningInBrowsers||xt();let z; +try{z=await($??fetch)(mr,{method:"POST",body:JSON.stringify(Ie),headers:Oe,...ce})}catch(Ee){let ue=new ee( +`Error connecting to database: ${Ee}`);throw ue.sourceError=Ee,ue}let He=Xc(z);if(z.ok){if(He===void 0) throw new ee(`Neon internal error: unexpected response Content-Type: ${z.headers.get("Content-Type")?? -"missing"}`);let Ee=$e==="json"?await z.json():await tl(z,$e,we?T.length:void 0);if(we){let ue=Ee.results; +"missing"}`);let Ee=He==="json"?await z.json():await sl(z,He,we?T.length:void 0);if(we){let ue=Ee.results; if(!Array.isArray(ue))throw new ee("Neon internal error: unexpected result format");return ue.map((wr,gr)=>{ -let br=b[gr]??{},Ca=br.arrayMode??Z,Ia=br.fullResults??ve;return ho(wr,{arrayMode:Ca,fullResults:Ia, -types:br.types})})}else{let ue=b??{},wr=ue.arrayMode??Z,gr=ue.fullResults??ve;return ho(Ee,{arrayMode:wr, -fullResults:gr,types:ue.types})}}else{let{status:Ee}=z;if($e==="json"){let ue=await z.json();throw mo( +let br=b[gr]??{},Ta=br.arrayMode??Z,Ra=br.fullResults??ve;return po(wr,{arrayMode:Ta,fullResults:Ra, +types:br.types})})}else{let ue=b??{},wr=ue.arrayMode??Z,gr=ue.fullResults??ve;return po(Ee,{arrayMode:wr, +fullResults:gr,types:ue.types})}}else{let{status:Ee}=z;if(He==="json"){let ue=await z.json();throw wo( ue)}else{let ue=await z.text();throw new ee(`Server error (HTTP status ${Ee}): ${ue}`)}}}return a(me, -"execute"),J}a(un,"neon");var cn=class cn{constructor(e,t,n){this.execute=e;this.queryData=t;this.opts= +"execute"),J}a(cn,"neon");var ln=class ln{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(cn,"NeonQueryPromise");var Le=cn;function ho(r,{arrayMode:e,fullResults:t,types:n}){let i=new po.default( +a(ln,"NeonQueryPromise");var Le=ln;function po(r,{arrayMode:e,fullResults:t,types:n}){let i=new yo.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(ho,"p\ -rocessQueryResult");async function nl(r){if(typeof r=="string")return r;if(typeof r=="function")try{ +o[f](l)])));return t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=u,r._parsers=o,r._types=i,r):u}a(po,"p\ +rocessQueryResult");async function al(r){if(typeof r=="string")return r;if(typeof r=="function")try{ return await Promise.resolve(r())}catch(e){let t=new ee("Error getting auth token.");throw e instanceof -Error&&(t=new ee(`Error getting auth token: ${e.message}`)),t}}a(nl,"getAuthToken");p();var Aa=qe(Mt());p();var Ea=qe(Mt());var Ti=class Ti extends Ea.Client{constructor(t){super(t);this.config=t}get neonConfig(){return this. +Error&&(t=new ee(`Error getting auth token: ${e.message}`)),t}}a(al,"getAuthToken");p();var Ca=Ne(kt());p();var _a=Ne(kt());var Ri=class Ri extends _a.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\ @@ -1490,12 +1492,12 @@ c=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let l=this.c "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|| -St(),this._handleAuthCleartextPassword(),this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){ +xt(),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(Re=>{if(!/^.=/.test(Re))throw new Error( -"SASL: Invalid attribute pair entry");let z=Re[0],$e=Re.substring(2);return[z,$e]})),c=u.r,l=u.s,f=u. +"SASL: Invalid attribute pair entry");let z=Re[0],He=Re.substring(2);return[z,He]})),c=u.r,l=u.s,f=u. i;if(!c||!/^[!-+--~]+$/.test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unp\ rintable");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( @@ -1509,21 +1511,21 @@ from(me.map((Re,z)=>me[z]^J[z]));let b=me,F=await n.importKey("raw",b,{name:"HMA 56"}},!1,["sign"]),ae=new Uint8Array(await n.sign("HMAC",F,E.encode("Client Key"))),$=await n.digest( "SHA-256",ae),we="n=*,r="+i.clientNonce,Ie="r="+c+",s="+l+",i="+y,ce="c=biws,r="+c,M=we+","+Ie+","+ce, Z=await n.importKey("raw",$,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var ve=new Uint8Array(await n. -sign("HMAC",Z,E.encode(M))),Te=m.from(ae.map((Re,z)=>ae[z]^ve[z])),Ue=Te.toString("base64");let De=await n. -importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Oe=await n.sign("HMAC",De,E.encode( -"Server Key")),mr=await n.importKey("raw",Oe,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Ne=m. -from(await n.sign("HMAC",mr,E.encode(M)));i.message="SASLResponse",i.serverSignature=Ne.toString("ba\ -se64"),i.response=ce+",p="+Ue,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; -a(Ti,"NeonClient");var dt=Ti;Ze();var _a=qe(ar());function $f(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($f,"promisify");var Ri=class Ri extends Aa.Pool{constructor(){ -super(...arguments);I(this,"Client",dt);I(this,"hasFetchUnsupportedListeners",!1);I(this,"addListene\ +sign("HMAC",Z,E.encode(M))),Te=m.from(ae.map((Re,z)=>ae[z]^ve[z])),Me=Te.toString("base64");let Ue=await n. +importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),De=await n.sign("HMAC",Ue,E.encode( +"Server Key")),mr=await n.importKey("raw",De,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Oe=m. +from(await n.sign("HMAC",mr,E.encode(M)));i.message="SASLResponse",i.serverSignature=Oe.toString("ba\ +se64"),i.response=ce+",p="+Me,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; +a(Ri,"NeonClient");var ht=Ri;Je();var Ia=Ne(ar());function zf(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(zf,"promisify");var Pi=class Pi extends Ca.Pool{constructor(){ +super(...arguments);I(this,"Client",ht);I(this,"hasFetchUnsupportedListeners",!1);I(this,"addListene\ r",this.on)}on(t,n){return t!=="error"&&(this.hasFetchUnsupportedListeners=!0),super.on(t,n)}query(t,n,i){ if(!ge.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof t=="function")return super.query( -t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=$f(this.Promise,i);i=s.callback;try{let o=new _a.default( +t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=zf(this.Promise,i);i=s.callback;try{let o=new Ia.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??[];un(l,{fullResults:!0,arrayMode:t. +/${c(o.database)}`,f=typeof t=="string"?t:t.text,y=n??t.values??[];cn(l,{fullResults:!0,arrayMode:t. rowMode==="array"}).query(f,y,{types:t.types??this.options?.types}).then(E=>i(void 0,E)).catch(E=>i( -E))}catch(o){i(o)}return s.result}};a(Ri,"NeonPool");var yr=Ri;Ze();var Se=qe(Mt()),Gf="js"; +E))}catch(o){i(o)}return s.result}};a(Pi,"NeonPool");var yr=Pi;Je();var Se=Ne(kt()),Yf="js"; /*! Bundled license information: ieee754/index.js: diff --git a/index.mjs b/index.mjs index 950c0e0..1283f14 100644 --- a/index.mjs +++ b/index.mjs @@ -1,23 +1,23 @@ /* @ts-self-types="./index.d.mts" */ -var Ta=Object.create;var $e=Object.defineProperty;var Ra=Object.getOwnPropertyDescriptor;var Pa=Object.getOwnPropertyNames;var Ba=Object.getPrototypeOf,La=Object.prototype.hasOwnProperty;var Fa=(r,e,t)=>e in r?$e(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>$e(r,"name",{value:e,configurable:!0});var te=(r,e)=>()=>(r&&(e=r(r=0)),e);var P=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),we=(r,e)=>{for(var t in e)$e(r,t,{get:e[t], -enumerable:!0})},Ri=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Pa(e))!La. -call(r,i)&&i!==t&&$e(r,i,{get:()=>e[i],enumerable:!(n=Ra(e,i))||n.enumerable});return r};var Oe=(r,e,t)=>(t=r!=null?Ta(Ba(r)):{},Ri(e||!r||!r.__esModule?$e(t,"default",{value:r,enumerable:!0}): -t,r)),$=r=>Ri($e({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Fa(r,typeof e!="symbol"?e+"":e,t);var Li=P(Ut=>{"use strict";p();Ut.byteLength=Ma;Ut.toByteArray=Da;Ut.fromByteArray=qa;var ge=[],le=[], -ka=typeof Uint8Array<"u"?Uint8Array:Array,br="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ -23456789+/";for(Ne=0,Pi=br.length;Ne0)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(Bi,"getLens"); -function Ma(r){var e=Bi(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Ma,"byteLength");function Ua(r,e,t){return(e+ -t)*3/4-t}a(Ua,"_byteLength");function Da(r){var e,t=Bi(r),n=t[0],i=t[1],s=new ka(Ua(r,n,i)),o=0,u=i> +var Pa=Object.create;var He=Object.defineProperty;var Ba=Object.getOwnPropertyDescriptor;var La=Object.getOwnPropertyNames;var Fa=Object.getPrototypeOf,ka=Object.prototype.hasOwnProperty;var Ma=(r,e,t)=>e in r?He(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>He(r,"name",{value:e,configurable:!0});var te=(r,e)=>()=>(r&&(e=r(r=0)),e);var P=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),we=(r,e)=>{for(var t in e)He(r,t,{get:e[t], +enumerable:!0})},Pi=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of La(e))!ka. +call(r,i)&&i!==t&&He(r,i,{get:()=>e[i],enumerable:!(n=Ba(e,i))||n.enumerable});return r};var De=(r,e,t)=>(t=r!=null?Pa(Fa(r)):{},Pi(e||!r||!r.__esModule?He(t,"default",{value:r,enumerable:!0}): +t,r)),$=r=>Pi(He({},"__esModule",{value:!0}),r);var I=(r,e,t)=>Ma(r,typeof e!="symbol"?e+"":e,t);var Fi=P(Mt=>{"use strict";p();Mt.byteLength=Da;Mt.toByteArray=Na;Mt.fromByteArray=ja;var ge=[],le=[], +Ua=typeof Uint8Array<"u"?Uint8Array:Array,br="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01\ +23456789+/";for(Oe=0,Bi=br.length;Oe0)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(Li,"getLens"); +function Da(r){var e=Li(r),t=e[0],n=e[1];return(t+n)*3/4-n}a(Da,"byteLength");function Oa(r,e,t){return(e+ +t)*3/4-t}a(Oa,"_byteLength");function Na(r){var e,t=Li(r),n=t[0],i=t[1],s=new Ua(Oa(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=le[r.charCodeAt( c)]<<2|le[r.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=le[r.charCodeAt(c)]<<10|le[r.charCodeAt(c+1)]<< -4|le[r.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}a(Da,"toByteArray");function Oa(r){return ge[r>> -18&63]+ge[r>>12&63]+ge[r>>6&63]+ge[r&63]}a(Oa,"tripletToBase64");function Na(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(Oa(n));return i.join("")}a(Na,"en\ -codeChunk");function qa(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(Na,"toByteArray");function qa(r){return ge[r>> +18&63]+ge[r>>12&63]+ge[r>>6&63]+ge[r&63]}a(qa,"tripletToBase64");function Qa(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(qa(n));return i.join("")}a(Qa,"en\ +codeChunk");function ja(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(ge[e>>2]+ge[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1], -i.push(ge[e>>10]+ge[e>>4&63]+ge[e<<2&63]+"=")),i.join("")}a(qa,"fromByteArray")});var Fi=P(xr=>{p();xr.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(ge[e>>10]+ge[e>>4&63]+ge[e<<2&63]+"=")),i.join("")}a(ja,"fromByteArray")});var ki=P(xr=>{p();xr.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,E=r[e+y];for(y+=g,s=E&(1<<-f)-1,E>>=-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:(E?-1:1)*(1/0);o=o+Math. pow(2,n),s=s-l}return(E?-1:1)*o*Math.pow(2,s-n)};xr.write=function(r,e,t,n,i,s){var o,u,c,l=s*8-i-1, @@ -25,48 +25,48 @@ f=(1<>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:s-1,C=n?1:-1, 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+E]=u&255,E+= -C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=W*128}});var Yi=P(ze=>{"use strict";p();var Sr=Li(),Ve=Fi(),ki=typeof Symbol=="function"&&typeof Symbol.for== -"function"?Symbol.for("nodejs.util.inspect.custom"):null;ze.Buffer=d;ze.SlowBuffer=Ga;ze.INSPECT_MAX_BYTES= -50;var Dt=2147483647;ze.kMaxLength=Dt;d.TYPED_ARRAY_SUPPORT=Qa();!d.TYPED_ARRAY_SUPPORT&&typeof console< +C,u/=256,i-=8);for(o=o<0;r[t+E]=o&255,E+=C,o/=256,l-=8);r[t+E-C]|=W*128}});var Ji=P(Ke=>{"use strict";p();var Sr=Fi(),Ge=ki(),Mi=typeof Symbol=="function"&&typeof Symbol.for== +"function"?Symbol.for("nodejs.util.inspect.custom"):null;Ke.Buffer=d;Ke.SlowBuffer=Ka;Ke.INSPECT_MAX_BYTES= +50;var Ut=2147483647;Ke.kMaxLength=Ut;d.TYPED_ARRAY_SUPPORT=Wa();!d.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 Qa(){ +pport which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Wa(){ 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(Qa,"typedArraySupport");Object. +prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}a(Wa,"typedArraySupport");Object. defineProperty(d.prototype,"parent",{enumerable:!0,get:a(function(){if(d.isBuffer(this))return this. buffer},"get")});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:a(function(){if(d.isBuffer( -this))return this.byteOffset},"get")});function Ee(r){if(r>Dt)throw new RangeError('The value "'+r+'\ +this))return this.byteOffset},"get")});function Ee(r){if(r>Ut)throw new RangeError('The value "'+r+'\ " is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,d.prototype), e}a(Ee,"createBuffer");function d(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 _r(r)}return Oi(r,e,t)} -a(d,"Buffer");d.poolSize=8192;function Oi(r,e,t){if(typeof r=="string")return Wa(r,e);if(ArrayBuffer. -isView(r))return Ha(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 _r(r)}return Ni(r,e,t)} +a(d,"Buffer");d.poolSize=8192;function Ni(r,e,t){if(typeof r=="string")return $a(r,e);if(ArrayBuffer. +isView(r))return Ga(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(be(r,ArrayBuffer)|| r&&be(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(be(r,SharedArrayBuffer)||r&&be(r.buffer, SharedArrayBuffer)))return Er(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 d. -from(n,e,t);let i=$a(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. +from(n,e,t);let i=Va(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol. toPrimitive]=="function")return d.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(Oi,"from");d.from=function(r,e,t){return Oi(r,e,t)};Object.setPrototypeOf(d.prototype, -Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Ni(r){if(typeof r!="number")throw new TypeError( +ed type "+typeof r)}a(Ni,"from");d.from=function(r,e,t){return Ni(r,e,t)};Object.setPrototypeOf(d.prototype, +Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function qi(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(Ni,"assertSize");function ja(r,e,t){return Ni(r),r<=0?Ee(r):e!==void 0?typeof t== -"string"?Ee(r).fill(e,t):Ee(r).fill(e):Ee(r)}a(ja,"alloc");d.alloc=function(r,e,t){return ja(r,e,t)}; -function _r(r){return Ni(r),Ee(r<0?0:Cr(r)|0)}a(_r,"allocUnsafe");d.allocUnsafe=function(r){return _r( -r)};d.allocUnsafeSlow=function(r){return _r(r)};function Wa(r,e){if((typeof e!="string"||e==="")&&(e= -"utf8"),!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=qi(r,e)|0,n=Ee(t),i=n.write( -r,e);return i!==t&&(n=n.slice(0,i)),n}a(Wa,"fromString");function vr(r){let e=r.length<0?0:Cr(r.length)| -0,t=Ee(e);for(let n=0;n=Dt)throw new RangeError("Attempt to allocate Buffer larger t\ -han maximum size: 0x"+Dt.toString(16)+" bytes");return r|0}a(Cr,"checked");function Ga(r){return+r!= -r&&(r=0),d.alloc(+r)}a(Ga,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== +a(Va,"fromObject");function Cr(r){if(r>=Ut)throw new RangeError("Attempt to allocate Buffer larger t\ +han maximum size: 0x"+Ut.toString(16)+" bytes");return r|0}a(Cr,"checked");function Ka(r){return+r!= +r&&(r=0),d.alloc(+r)}a(Ka,"SlowBuffer");d.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!== d.prototype},"isBuffer");d.compare=a(function(e,t){if(be(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)), be(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.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, @@ -78,80 +78,80 @@ utf-16le":return!0;default:return!1}},"isEncoding");d.concat=a(function(e,t){if( for(t=0,n=0;ni.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(i,s)):Uint8Array.prototype. set.call(i,o,s);else if(d.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 qi(r,e){if(d.isBuffer(r))return r.length; +an Array of Buffers');s+=o.length}return i},"concat");function Qi(r,e){if(d.isBuffer(r))return r.length; if(ArrayBuffer.isView(r)||be(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 Ar(r).length;case"ucs2":case"\ -ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return zi(r).length;default: -if(i)return n?-1:Ar(r).length;e=(""+e).toLowerCase(),i=!0}}a(qi,"byteLength");d.byteLength=qi;function Va(r,e,t){ +ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Yi(r).length;default: +if(i)return n?-1:Ar(r).length;e=(""+e).toLowerCase(),i=!0}}a(Qi,"byteLength");d.byteLength=Qi;function za(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 nu(this,e,t);case"u\ -tf8":case"utf-8":return ji(this,e,t);case"ascii":return tu(this,e,t);case"latin1":case"binary":return ru( -this,e,t);case"base64":return Xa(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return iu( -this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(Va, -"slowToString");d.prototype._isBuffer=!0;function qe(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(qe,"swap"); +0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return su(this,e,t);case"u\ +tf8":case"utf-8":return Wi(this,e,t);case"ascii":return nu(this,e,t);case"latin1":case"binary":return iu( +this,e,t);case"base64":return tu(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ou( +this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}a(za, +"slowToString");d.prototype._isBuffer=!0;function Ne(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}a(Ne,"swap"); d.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");ki&&(d.prototype[ki]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ +er "+e+">"},"inspect");Mi&&(d.prototype[Mi]=d.prototype.inspect);d.prototype.compare=a(function(e,t,n,i,s){ if(be(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.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 ji(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,Tr(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=d.from( -e,n)),d.isBuffer(e))return e.length===0?-1:Mi(r,e,t,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array. +e,n)),d.isBuffer(e))return e.length===0?-1:Ui(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):Mi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(Qi,"bidire\ -ctionalIndexOf");function Mi(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):Ui(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}a(ji,"bidire\ +ctionalIndexOf");function Ui(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 Ka(this,e,t,n);case"utf8":case"\ -utf-8":return za(this,e,t,n);case"ascii":case"latin1":case"binary":return Ya(this,e,t,n);case"base64": -return Ja(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Za(this,e,t,n);default: +fer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return Ya(this,e,t,n);case"utf8":case"\ +utf-8":return Ja(this,e,t,n);case"ascii":case"latin1":case"binary":return Za(this,e,t,n);case"base64": +return Xa(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return eu(this,e,t,n);default: if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},"write");d.prototype. toJSON=a(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSO\ -N");function Xa(r,e,t){return e===0&&t===r.length?Sr.fromByteArray(r):Sr.fromByteArray(r.slice(e,t))} -a(Xa,"base64Slice");function ji(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 eu(n)}a(ji,"utf8Slice");var Ui=4096;function eu(r){let e=r.length;if(e<=Ui)return String. +n.push(o),i+=u}return ru(n)}a(Wi,"utf8Slice");var Di=4096;function ru(r){let e=r.length;if(e<=Di)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,d.prototype),i},"slice");function G(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 \ @@ -166,11 +166,11 @@ a(function(e,t){return e=e>>>0,t||G(e,2,this.length),this[e]<<8|this[e+1]},"read readUint32LE=d.prototype.readUInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),(this[e]| this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");d.prototype.readUint32BE=d.prototype. readUInt32BE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+ -2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Re(a(function(e){e=e>>>0,Ke(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&<(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* +2]<<8|this[e+3])},"readUInt32BE");d.prototype.readBigUInt64LE=Re(a(function(e){e=e>>>0,Ve(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ct(e,this.length-8);let i=t+this[++e]*2**8+this[++e]* 2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<< -BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Re(a(function(e){e=e>>>0,Ke(e,"offset"); -let t=this[e],n=this[e+7];(t===void 0||n===void 0)&<(e,this.length-8);let i=t*2**24+this[++e]*2**16+ +BigInt(32))},"readBigUInt64LE"));d.prototype.readBigUInt64BE=Re(a(function(e){e=e>>>0,Ve(e,"offset"); +let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ct(e,this.length-8);let i=t*2**24+this[++e]*2**16+ this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<>>0,t=t>>>0,n||G(e,t, this.length);let i=this[e],s=1,o=0;for(;++o=s&&(i-=Math. @@ -183,16 +183,16 @@ a(function(e,t){e=e>>>0,t||G(e,2,this.length);let n=this[e+1]|this[e]<<8;return n},"readInt16BE");d.prototype.readInt32LE=a(function(e,t){return e=e>>>0,t||G(e,4,this.length),this[e]| this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");d.prototype.readInt32BE=a(function(e,t){return e= e>>>0,t||G(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");d.prototype. -readBigInt64LE=Re(a(function(e){e=e>>>0,Ke(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& -lt(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,Ve(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&& +ct(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<>>0,Ke(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&<(e,this. +Re(a(function(e){e=e>>>0,Ve(e,"offset");let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&ct(e,this. length-8);let i=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,t||G(e,4,this.length),Ve.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= -a(function(e,t){return e=e>>>0,t||G(e,4,this.length),Ve.read(this,e,!1,23,4)},"readFloatBE");d.prototype. -readDoubleLE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ve.read(this,e,!0,52,8)},"readDoub\ -leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ve.read(this,e, +return e=e>>>0,t||G(e,4,this.length),Ge.read(this,e,!0,23,4)},"readFloatLE");d.prototype.readFloatBE= +a(function(e,t){return e=e>>>0,t||G(e,4,this.length),Ge.read(this,e,!1,23,4)},"readFloatBE");d.prototype. +readDoubleLE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ge.read(this,e,!0,52,8)},"readDoub\ +leLE");d.prototype.readDoubleBE=a(function(e,t){return e=e>>>0,t||G(e,8,this.length),Ge.read(this,e, !1,52,8)},"readDoubleBE");function re(r,e,t,n,i,s){if(!d.isBuffer(r))throw new TypeError('"buffer" a\ rgument must be a Buffer instance');if(e>i||er.length)throw new RangeError("Index out of range")}a(re,"checkInt");d.prototype.writeUintLE= @@ -208,14 +208,14 @@ e>>>8,t+2},"writeUInt16LE");d.prototype.writeUint16BE=d.prototype.writeUInt16BE= writeUint32LE=d.prototype.writeUInt32LE=a(function(e,t,n){return e=+e,t=t>>>0,n||re(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");d.prototype. writeUint32BE=d.prototype.writeUInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||re(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 Wi(r,e,t,n,i){ -Ki(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 Hi(r,e,t,n,i){ +zi(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(Wi,"wrtBigUInt64LE");function Hi(r,e,t,n,i){Ki(e,n,i,r,t,7);let s=Number(e&BigInt(4294967295)); +8,r[t++]=o,t}a(Hi,"wrtBigUInt64LE");function $i(r,e,t,n,i){zi(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(Hi,"wrtBigUInt64BE");d.prototype. -writeBigUInt64LE=Re(a(function(e,t=0){return Wi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ -riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Re(a(function(e,t=0){return Hi(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($i,"wrtBigUInt64BE");d.prototype. +writeBigUInt64LE=Re(a(function(e,t=0){return Hi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"w\ +riteBigUInt64LE"));d.prototype.writeBigUInt64BE=Re(a(function(e,t=0){return $i(this,e,t,BigInt(0),BigInt( "0xffffffffffffffff"))},"writeBigUInt64BE"));d.prototype.writeIntLE=a(function(e,t,n,i){if(e=+e,t=t>>> 0,!i){let c=Math.pow(2,8*n-1);re(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");d.prototype.writeIntBE= @@ -229,17 +229,17 @@ e>>>8,this[t+1]=e&255,t+2},"writeInt16BE");d.prototype.writeInt32LE=a(function(e t>>>0,n||re(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+ 3]=e>>>24,t+4},"writeInt32LE");d.prototype.writeInt32BE=a(function(e,t,n){return e=+e,t=t>>>0,n||re( 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");d.prototype.writeBigInt64LE=Re(a(function(e,t=0){return Wi( +e>>>8,this[t+3]=e&255,t+4},"writeInt32BE");d.prototype.writeBigInt64LE=Re(a(function(e,t=0){return Hi( this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));d.prototype. -writeBigInt64BE=Re(a(function(e,t=0){return Hi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ -ffffffffffff"))},"writeBigInt64BE"));function $i(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($i,"checkIEEE754");function Gi(r,e,t,n,i){ -return e=+e,t=t>>>0,i||$i(r,e,t,4,34028234663852886e22,-34028234663852886e22),Ve.write(r,e,t,n,23,4), -t+4}a(Gi,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return Gi(this,e,t,!0,n)},"writeFl\ -oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return Gi(this,e,t,!1,n)},"writeFloatBE");function Vi(r,e,t,n,i){ -return e=+e,t=t>>>0,i||$i(r,e,t,8,17976931348623157e292,-17976931348623157e292),Ve.write(r,e,t,n,52, -8),t+8}a(Vi,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return Vi(this,e,t,!0,n)},"wr\ -iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return Vi(this,e,t,!1,n)},"writeDoubleBE"); +writeBigInt64BE=Re(a(function(e,t=0){return $i(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fff\ +ffffffffffff"))},"writeBigInt64BE"));function Gi(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(Gi,"checkIEEE754");function Vi(r,e,t,n,i){ +return e=+e,t=t>>>0,i||Gi(r,e,t,4,34028234663852886e22,-34028234663852886e22),Ge.write(r,e,t,n,23,4), +t+4}a(Vi,"writeFloat");d.prototype.writeFloatLE=a(function(e,t,n){return Vi(this,e,t,!0,n)},"writeFl\ +oatLE");d.prototype.writeFloatBE=a(function(e,t,n){return Vi(this,e,t,!1,n)},"writeFloatBE");function Ki(r,e,t,n,i){ +return e=+e,t=t>>>0,i||Gi(r,e,t,8,17976931348623157e292,-17976931348623157e292),Ge.write(r,e,t,n,52, +8),t+8}a(Ki,"writeDouble");d.prototype.writeDoubleLE=a(function(e,t,n){return Ki(this,e,t,!0,n)},"wr\ +iteDoubleLE");d.prototype.writeDoubleBE=a(function(e,t,n){return Ki(this,e,t,!1,n)},"writeDoubleBE"); d.prototype.copy=a(function(e,t,n,i){if(!d.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=Di(String(t)):typeof t=="bigint"&&(i=String( -t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Di(i)),i+="n"),n+=` It must be ${e}. Re\ -ceived ${i}`,n},RangeError);function Di(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(Di,"addNumericalSeparator");function su(r,e,t){ -Ke(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&<(e,r.length-(t+1))}a(su,"checkBounds");function Ki(r,e,t,n,i,s){ +f range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=Oi(String(t)):typeof t=="bigint"&&(i=String( +t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Oi(i)),i+="n"),n+=` It must be ${e}. Re\ +ceived ${i}`,n},RangeError);function Oi(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(Oi,"addNumericalSeparator");function au(r,e,t){ +Ve(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&ct(e,r.length-(t+1))}a(au,"checkBounds");function zi(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 Ge.ERR_OUT_OF_RANGE("value",u,r)}su(n,i,s)}a(Ki,"checkIntBI");function Ke(r,e){if(typeof r!= -"number")throw new Ge.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Ke,"validateNumber");function lt(r,e,t){throw Math. -floor(r)!==r?(Ke(r,t),new Ge.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new Ge.ERR_BUFFER_OUT_OF_BOUNDS: -new Ge.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(lt,"boundsError");var ou=/[^+/0-9A-Za-z-_]/g; -function au(r){if(r=r.split("=")[0],r=r.trim().replace(ou,""),r.length<2)return"";for(;r.length%4!== -0;)r=r+"=";return r}a(au,"base64clean");function Ar(r,e){e=e||1/0;let t,n=r.length,i=null,s=[];for(let o=0;o< +nd <= ${t}${o}`,new $e.ERR_OUT_OF_RANGE("value",u,r)}au(n,i,s)}a(zi,"checkIntBI");function Ve(r,e){if(typeof r!= +"number")throw new $e.ERR_INVALID_ARG_TYPE(e,"number",r)}a(Ve,"validateNumber");function ct(r,e,t){throw Math. +floor(r)!==r?(Ve(r,t),new $e.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new $e.ERR_BUFFER_OUT_OF_BOUNDS: +new $e.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}a(ct,"boundsError");var uu=/[^+/0-9A-Za-z-_]/g; +function cu(r){if(r=r.split("=")[0],r=r.trim().replace(uu,""),r.length<2)return"";for(;r.length%4!== +0;)r=r+"=";return r}a(cu,"base64clean");function Ar(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(Ar,"utf\ -8ToBytes");function uu(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(cu,"utf16leToBytes");function zi(r){return Sr.toByteArray( -au(r))}a(zi,"base64ToBytes");function Ot(r,e,t,n){let i;for(i=0;i=e.length||i>=r.length);++i) -e[i+t]=r[i];return i}a(Ot,"blitBuffer");function be(r,e){return r instanceof e||r!=null&&r.constructor!= +8ToBytes");function lu(r){let e=[];for(let t=0;t>8,i=t%256,s.push(i),s.push(n);return s}a(fu,"utf16leToBytes");function Yi(r){return Sr.toByteArray( +cu(r))}a(Yi,"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 be(r,e){return r instanceof e||r!=null&&r.constructor!= null&&r.constructor.name!=null&&r.constructor.name===e.name}a(be,"isInstance");function Tr(r){return r!== -r}a(Tr,"numberIsNaN");var lu=function(){let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){ +r}a(Tr,"numberIsNaN");var hu=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 Re(r){return typeof BigInt>"u"? -fu:r}a(Re,"defineBigIntMethod");function fu(){throw new Error("BigInt not supported")}a(fu,"BufferBi\ +du:r}a(Re,"defineBigIntMethod");function du(){throw new Error("BigInt not supported")}a(du,"BufferBi\ gIntNotDefined")});var S,v,A,m,w,p=te(()=>{"use strict";S=globalThis,v=globalThis.setImmediate??(r=>setTimeout(r,0)),A= globalThis.clearImmediate??(r=>clearTimeout(r)),m=typeof globalThis.Buffer=="function"&&typeof globalThis. -Buffer.allocUnsafe=="function"?globalThis.Buffer:Yi().Buffer,w=globalThis.process??{};w.env??(w.env= -{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Pe=P((rh,Rr)=>{"use strict";p();var Ye=typeof Reflect=="object"?Reflect:null,Ji=Ye&&typeof Ye.apply== -"function"?Ye.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Nt; -Ye&&typeof Ye.ownKeys=="function"?Nt=Ye.ownKeys:Object.getOwnPropertySymbols?Nt=a(function(e){return Object. -getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Nt=a(function(e){return Object. -getOwnPropertyNames(e)},"ReflectOwnKeys");function hu(r){console&&console.warn&&console.warn(r)}a(hu, -"ProcessEmitWarning");var Xi=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function k(){k. -init.call(this)}a(k,"EventEmitter");Rr.exports=k;Rr.exports.once=mu;k.EventEmitter=k;k.prototype._events= -void 0;k.prototype._eventsCount=0;k.prototype._maxListeners=void 0;var Zi=10;function qt(r){if(typeof r!= +Buffer.allocUnsafe=="function"?globalThis.Buffer:Ji().Buffer,w=globalThis.process??{};w.env??(w.env= +{});try{w.nextTick(()=>{})}catch{let e=Promise.resolve();w.nextTick=e.then.bind(e)}});var Pe=P((oh,Rr)=>{"use strict";p();var ze=typeof Reflect=="object"?Reflect:null,Zi=ze&&typeof ze.apply== +"function"?ze.apply:a(function(e,t,n){return Function.prototype.apply.call(e,t,n)},"ReflectApply"),Ot; +ze&&typeof ze.ownKeys=="function"?Ot=ze.ownKeys:Object.getOwnPropertySymbols?Ot=a(function(e){return Object. +getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Ot=a(function(e){return Object. +getOwnPropertyNames(e)},"ReflectOwnKeys");function pu(r){console&&console.warn&&console.warn(r)}a(pu, +"ProcessEmitWarning");var es=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function k(){k. +init.call(this)}a(k,"EventEmitter");Rr.exports=k;Rr.exports.once=gu;k.EventEmitter=k;k.prototype._events= +void 0;k.prototype._eventsCount=0;k.prototype._maxListeners=void 0;var Xi=10;function Nt(r){if(typeof r!= "function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)} -a(qt,"checkListener");Object.defineProperty(k,"defaultMaxListeners",{enumerable:!0,get:a(function(){ -return Zi},"get"),set:a(function(r){if(typeof r!="number"||r<0||Xi(r))throw new RangeError('The valu\ -e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Zi=r}, +a(Nt,"checkListener");Object.defineProperty(k,"defaultMaxListeners",{enumerable:!0,get:a(function(){ +return Xi},"get"),set:a(function(r){if(typeof r!="number"||r<0||es(r))throw new RangeError('The valu\ +e of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Xi=r}, "set")});k.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}; -k.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||Xi(e))throw new RangeError('Th\ +k.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||es(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 es(r){return r._maxListeners===void 0?k.defaultMaxListeners:r._maxListeners} -a(es,"_getMaxListeners");k.prototype.getMaxListeners=a(function(){return es(this)},"getMaxListeners"); +e,this},"setMaxListeners");function ts(r){return r._maxListeners===void 0?k.defaultMaxListeners:r._maxListeners} +a(ts,"_getMaxListeners");k.prototype.getMaxListeners=a(function(){return ts(this)},"getMaxListeners"); k.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")Ji(c,this,t);else for(var l=c. -length,f=ss(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=ts(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,hu(u)}return r}a(ts,"_addListener");k.prototype.addListener=a(function(e,t){ -return ts(this,e,t,!1)},"addListener");k.prototype.on=k.prototype.addListener;k.prototype.prependListener= -a(function(e,t){return ts(this,e,t,!0)},"prependListener");function du(){if(!this.fired)return this. +r,u.type=e,u.count=o.length,pu(u)}return r}a(rs,"_addListener");k.prototype.addListener=a(function(e,t){ +return rs(this,e,t,!1)},"addListener");k.prototype.on=k.prototype.addListener;k.prototype.prependListener= +a(function(e,t){return rs(this,e,t,!0)},"prependListener");function yu(){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(du,"onceWrapper");function rs(r,e,t){var n={fired:!1, -wrapFn:void 0,target:r,type:e,listener:t},i=du.bind(n);return i.listener=t,n.wrapFn=i,i}a(rs,"_onceW\ -rap");k.prototype.once=a(function(e,t){return qt(t),this.on(e,rs(this,e,t)),this},"once");k.prototype. -prependOnceListener=a(function(e,t){return qt(t),this.prependListener(e,rs(this,e,t)),this},"prepend\ -OnceListener");k.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(qt(t),i=this._events,i=== +target):this.listener.apply(this.target,arguments)}a(yu,"onceWrapper");function ns(r,e,t){var n={fired:!1, +wrapFn:void 0,target:r,type:e,listener:t},i=yu.bind(n);return i.listener=t,n.wrapFn=i,i}a(ns,"_onceW\ +rap");k.prototype.once=a(function(e,t){return Nt(t),this.on(e,ns(this,e,t)),this},"once");k.prototype. +prependOnceListener=a(function(e,t){return Nt(t),this.prependListener(e,ns(this,e,t)),this},"prepend\ +OnceListener");k.prototype.removeListener=a(function(e,t){var n,i,s,o,u;if(Nt(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():pu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== +listener,s=o;break}if(s<0)return this;s===0?n.shift():mu(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!== void 0&&this.emit("removeListener",e,u||t)}return this},"removeListener");k.prototype.off=k.prototype. removeListener;k.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 ns(r,e,t){var n=r._events; +0;i--)this.removeListener(e,t[i]);return this},"removeAllListeners");function is(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? -yu(i):ss(i,i.length)}a(ns,"_listeners");k.prototype.listeners=a(function(e){return ns(this,e,!0)},"l\ -isteners");k.prototype.rawListeners=a(function(e){return ns(this,e,!1)},"rawListeners");k.listenerCount= -function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):is.call(r,e)};k.prototype. -listenerCount=is;function is(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(is,"listenerCount");k.prototype.eventNames=a(function(){ -return this._eventsCount>0?Nt(this._events):[]},"eventNames");function ss(r,e){for(var t=new Array(e), -n=0;n0?Ot(this._events):[]},"eventNames");function os(r,e){for(var t=new Array(e), +n=0;nxe,isIP:()=>gu});function gu(r){return 0}var us,as,_,xe,Je=te(()=>{"use \ -strict";p();us=Oe(Pe(),1);a(gu,"isIP");as=/^[^.]+\./,_=class _ extends us.EventEmitter{constructor(){ +ust be of type EventEmitter. Received type '+typeof r)}a(as,"eventTargetAgnosticAddListener")});var ls={};we(ls,{Socket:()=>xe,isIP:()=>xu});function xu(r){return 0}var cs,us,_,xe,Ye=te(()=>{"use \ +strict";p();cs=De(Pe(),1);a(xu,"isIP");us=/^[^.]+\./,_=class _ extends cs.EventEmitter{constructor(){ super(...arguments);I(this,"opts",{});I(this,"connecting",!1);I(this,"pending",!0);I(this,"writable", !0);I(this,"encrypted",!1);I(this,"authorized",!1);I(this,"destroyed",!1);I(this,"ws",null);I(this,"\ writeBuffer");I(this,"tlsState",0);I(this,"tlsRead");I(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=m.alloc(0),n="utf8",i=()=>{}){return this.write(t,n,()=>{this. ws.close(),i()}),this}destroy(){return this.destroyed=!0,this.end()}};a(_,"Socket"),I(_,"defaults",{ -poolQueryViaFetch:!1,fetchEndpoint:a((t,n,i)=>{let s;return i?.jwtAuth?s=t.replace(as,"apiauth."):s= -t.replace(as,"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(us,"apiauth."):s= +t.replace(us,"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}),I(_,"opts",{});xe=_});var ls={};we(ls,{parse:()=>Pr});function Pr(r,e=!1){let{protocol:t}=new URL(r),n="http:"+r.substring( +disableWarningInBrowsers:!1}),I(_,"opts",{});xe=_});var fs={};we(fs,{parse:()=>Pr});function Pr(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 E=i+":"+s,C=e?Object. fromEntries(y.entries()):f;return{href:r,protocol:t,auth:E,username:i,password:s,host:o,hostname:u,port:c, -pathname:l,search:f,query:C,hash:g}}var Br=te(()=>{"use strict";p();a(Pr,"parse")});var Vr=P(Rs=>{"use strict";p();Rs.parse=function(r,e){return new Gr(r,e).parse()};var Yt=class Yt{constructor(e,t){ -this.source=e,this.transform=t||Hu,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){ +pathname:l,search:f,query:C,hash:g}}var Br=te(()=>{"use strict";p();a(Pr,"parse")});var Vr=P(Ps=>{"use strict";p();Ps.parse=function(r,e){return new Gr(r,e).parse()};var zt=class zt{constructor(e,t){ +this.source=e,this.transform=t||Gu,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 Yt(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse( +dimension>1&&(n=new zt(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(Yt,"ArrayParser");var Gr=Yt;function Hu(r){return r}a(Hu,"ide\ -ntity")});var Kr=P((Ih,Ps)=>{p();var $u=Vr();Ps.exports={create:a(function(r,e){return{parse:a(function(){return $u. -parse(r,e)},"parse")}},"create")}});var Fs=P((Ph,Ls)=>{"use strict";p();var Gu=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, -Vu=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Ku=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,zu=/^-?infinity$/;Ls. -exports=a(function(e){if(zu.test(e))return Number(e.replace("i","I"));var t=Gu.exec(e);if(!t)return Yu( -e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Bs(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=Ju(e);return g!=null? +not balanced");return this.entries}};a(zt,"ArrayParser");var Gr=zt;function Gu(r){return r}a(Gu,"ide\ +ntity")});var Kr=P((Bh,Bs)=>{p();var Vu=Vr();Bs.exports={create:a(function(r,e){return{parse:a(function(){return Vu. +parse(r,e)},"parse")}},"create")}});var ks=P((kh,Fs)=>{"use strict";p();var Ku=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/, +zu=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,Yu=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,Ju=/^-?infinity$/;Fs. +exports=a(function(e){if(Ju.test(e))return Number(e.replace("i","I"));var t=Ku.exec(e);if(!t)return Zu( +e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=Ls(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=Xu(e);return g!=null? (y=new Date(Date.UTC(i,s,o,u,c,l,f)),zr(i)&&y.setUTCFullYear(i),g!==0&&y.setTime(y.getTime()-g)):(y= -new Date(i,s,o,u,c,l,f),zr(i)&&y.setFullYear(i)),y},"parseDate");function Yu(r){var e=Vu.exec(r);if(e){ -var t=parseInt(e[1],10),n=!!e[4];n&&(t=Bs(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return zr( -t)&&o.setFullYear(t),o}}a(Yu,"getDate");function Ju(r){if(r.endsWith("+00"))return 0;var e=Ku.exec(r. +new Date(i,s,o,u,c,l,f),zr(i)&&y.setFullYear(i)),y},"parseDate");function Zu(r){var e=zu.exec(r);if(e){ +var t=parseInt(e[1],10),n=!!e[4];n&&(t=Ls(t));var i=parseInt(e[2],10)-1,s=e[3],o=new Date(t,i,s);return zr( +t)&&o.setFullYear(t),o}}a(Zu,"getDate");function Xu(r){if(r.endsWith("+00"))return 0;var e=Yu.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(Ju,"timeZoneOffset");function Bs(r){return-(r- -1)}a(Bs,"bcYearToNegativeYear");function zr(r){return r>=0&&r<100}a(zr,"is0To99")});var Ms=P((Fh,ks)=>{p();ks.exports=Xu;var Zu=Object.prototype.hasOwnProperty;function Xu(r){for(var e=1;e< -arguments.length;e++){var t=arguments[e];for(var n in t)Zu.call(t,n)&&(r[n]=t[n])}return r}a(Xu,"ext\ -end")});var Os=P((Uh,Ds)=>{"use strict";p();var ec=Ms();Ds.exports=rt;function rt(r){if(!(this instanceof rt)) -return new rt(r);ec(this,hc(r))}a(rt,"PostgresInterval");var tc=["seconds","minutes","hours","days", -"months","years"];rt.prototype.toPostgres=function(){var r=tc.filter(this.hasOwnProperty,this);return this. +e[3]||0,10)*60+parseInt(e[4]||0,10);return i*n*1e3}}a(Xu,"timeZoneOffset");function Ls(r){return-(r- +1)}a(Ls,"bcYearToNegativeYear");function zr(r){return r>=0&&r<100}a(zr,"is0To99")});var Us=P((Dh,Ms)=>{p();Ms.exports=tc;var ec=Object.prototype.hasOwnProperty;function tc(r){for(var e=1;e< +arguments.length;e++){var t=arguments[e];for(var n in t)ec.call(t,n)&&(r[n]=t[n])}return r}a(tc,"ext\ +end")});var Ns=P((qh,Os)=>{"use strict";p();var rc=Us();Os.exports=tt;function tt(r){if(!(this instanceof tt)) +return new tt(r);rc(this,pc(r))}a(tt,"PostgresInterval");var nc=["seconds","minutes","hours","days", +"months","years"];tt.prototype.toPostgres=function(){var r=nc.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 rc={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ -S"},nc=["years","months","days"],ic=["hours","minutes","seconds"];rt.prototype.toISOString=rt.prototype. -toISO=function(){var r=nc.map(t,this).join(""),e=ic.map(t,this).join("");return"P"+r+"T"+e;function t(n){ +"")),t+" "+e},this).join(" ")};var ic={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"\ +S"},sc=["years","months","days"],oc=["hours","minutes","seconds"];tt.prototype.toISOString=tt.prototype. +toISO=function(){var r=sc.map(t,this).join(""),e=oc.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+rc[n]}};var Yr="([+-]?\\d+)",sc=Yr+"\\s+years?",oc=Yr+"\\s+mons?",ac=Yr+"\\s+days?",uc="\ -([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",cc=new RegExp([sc,oc,ac,uc].map(function(r){return"\ -("+r+")?"}).join("\\s*")),Us={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, -lc=["hours","minutes","seconds","milliseconds"];function fc(r){var e=r+"000000".slice(r.length);return parseInt( -e,10)/1e3}a(fc,"parseMilliseconds");function hc(r){if(!r)return{};var e=cc.exec(r),t=e[8]==="-";return Object. -keys(Us).reduce(function(n,i){var s=Us[i],o=e[s];return!o||(o=i==="milliseconds"?fc(o):parseInt(o,10), -!o)||(t&&~lc.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(hc,"parse")});var qs=P((Nh,Ns)=>{"use strict";p();Ns.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( +/0+$/,"")),i+ic[n]}};var Yr="([+-]?\\d+)",ac=Yr+"\\s+years?",uc=Yr+"\\s+mons?",cc=Yr+"\\s+days?",lc="\ +([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?",fc=new RegExp([ac,uc,cc,lc].map(function(r){return"\ +("+r+")?"}).join("\\s*")),Ds={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12}, +hc=["hours","minutes","seconds","milliseconds"];function dc(r){var e=r+"000000".slice(r.length);return parseInt( +e,10)/1e3}a(dc,"parseMilliseconds");function pc(r){if(!r)return{};var e=fc.exec(r),t=e[8]==="-";return Object. +keys(Ds).reduce(function(n,i){var s=Ds[i],o=e[s];return!o||(o=i==="milliseconds"?dc(o):parseInt(o,10), +!o)||(t&&~hc.indexOf(i)&&(o*=-1),n[i]=o),n},{})}a(pc,"parse")});var Qs=P((Wh,qs)=>{"use strict";p();qs.exports=a(function(e){if(/^\\x/.test(e))return new m(e.substr( 2),"hex");for(var t="",n=0;n{p();var bt=Vr(),xt=Kr(),Jt=Fs(),js=Os(),Ws=qs();function Zt(r){return a(function(t){ -return t===null?t:r(t)},"nullAllowed")}a(Zt,"allowNull");function Hs(r){return r===null?r:r==="TRUE"|| -r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a(Hs,"parseBool");function dc(r){return r? -bt.parse(r,Hs):null}a(dc,"parseBoolArray");function pc(r){return parseInt(r,10)}a(pc,"parseBaseTenIn\ -t");function Jr(r){return r?bt.parse(r,Zt(pc)):null}a(Jr,"parseIntegerArray");function yc(r){return r? -bt.parse(r,Zt(function(e){return $s(e).trim()})):null}a(yc,"parseBigIntegerArray");var mc=a(function(r){ -if(!r)return null;var e=xt.create(r,function(t){return t!==null&&(t=tn(t)),t});return e.parse()},"pa\ -rsePointArray"),Zr=a(function(r){if(!r)return null;var e=xt.create(r,function(t){return t!==null&&(t= -parseFloat(t)),t});return e.parse()},"parseFloatArray"),de=a(function(r){if(!r)return null;var e=xt. -create(r);return e.parse()},"parseStringArray"),Xr=a(function(r){if(!r)return null;var e=xt.create(r, -function(t){return t!==null&&(t=Jt(t)),t});return e.parse()},"parseDateArray"),wc=a(function(r){if(!r) -return null;var e=xt.create(r,function(t){return t!==null&&(t=js(t)),t});return e.parse()},"parseInt\ -ervalArray"),gc=a(function(r){return r?bt.parse(r,Zt(Ws)):null},"parseByteAArray"),en=a(function(r){ -return parseInt(r,10)},"parseInteger"),$s=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ -parseBigInteger"),Qs=a(function(r){return r?bt.parse(r,Zt(JSON.parse)):null},"parseJsonArray"),tn=a( +parseBytea")});var Ks=P((Gh,Vs)=>{p();var gt=Vr(),bt=Kr(),Yt=ks(),Ws=Ns(),Hs=Qs();function Jt(r){return a(function(t){ +return t===null?t:r(t)},"nullAllowed")}a(Jt,"allowNull");function $s(r){return r===null?r:r==="TRUE"|| +r==="t"||r==="true"||r==="y"||r==="yes"||r==="on"||r==="1"}a($s,"parseBool");function yc(r){return r? +gt.parse(r,$s):null}a(yc,"parseBoolArray");function mc(r){return parseInt(r,10)}a(mc,"parseBaseTenIn\ +t");function Jr(r){return r?gt.parse(r,Jt(mc)):null}a(Jr,"parseIntegerArray");function wc(r){return r? +gt.parse(r,Jt(function(e){return Gs(e).trim()})):null}a(wc,"parseBigIntegerArray");var gc=a(function(r){ +if(!r)return null;var e=bt.create(r,function(t){return t!==null&&(t=tn(t)),t});return e.parse()},"pa\ +rsePointArray"),Zr=a(function(r){if(!r)return null;var e=bt.create(r,function(t){return t!==null&&(t= +parseFloat(t)),t});return e.parse()},"parseFloatArray"),de=a(function(r){if(!r)return null;var e=bt. +create(r);return e.parse()},"parseStringArray"),Xr=a(function(r){if(!r)return null;var e=bt.create(r, +function(t){return t!==null&&(t=Yt(t)),t});return e.parse()},"parseDateArray"),bc=a(function(r){if(!r) +return null;var e=bt.create(r,function(t){return t!==null&&(t=Ws(t)),t});return e.parse()},"parseInt\ +ervalArray"),xc=a(function(r){return r?gt.parse(r,Jt(Hs)):null},"parseByteAArray"),en=a(function(r){ +return parseInt(r,10)},"parseInteger"),Gs=a(function(r){var e=String(r);return/^\d+$/.test(e)?e:r},"\ +parseBigInteger"),js=a(function(r){return r?gt.parse(r,Jt(JSON.parse)):null},"parseJsonArray"),tn=a( function(r){return r[0]!=="("?null:(r=r.substring(1,r.length-1).split(","),{x:parseFloat(r[0]),y:parseFloat( -r[1])})},"parsePoint"),bc=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, +r[1])})},"parsePoint"),Sc=a(function(r){if(r[0]!=="<"&&r[1]!=="(")return null;for(var e="(",t="",n=!1, i=2;i{"use strict";p();var ie=1e6;function Sc(r){var e=r.readInt32BE(0),t=r.readUInt32BE( +1115,Xr),r(1182,Xr),r(1185,Xr),r(1186,Ws),r(1187,bc),r(17,Hs),r(114,JSON.parse.bind(JSON)),r(3802,JSON. +parse.bind(JSON)),r(199,js),r(3807,js),r(3907,de),r(2951,de),r(791,de),r(1183,de),r(1270,de)},"init"); +Vs.exports={init:vc}});var Ys=P((zh,zs)=>{"use strict";p();var ie=1e6;function Ec(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%ie,e=e/ie>>>0,o=4294967296* s+t,t=o/ie>>>0,u=""+(o-ie*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/ie>>>0,u=""+(o-ie*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/ie>>>0,u=""+(o- ie*t),t===0&&e===0)return n+u+i;for(c="",l=6-u.length,f=0;f{p();var vc=zs(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,W){return E* +s+t,u=""+o%ie,n+u+i}a(Ec,"readInt8");zs.exports=Ec});var to=P((Zh,eo)=>{p();var Ac=Ys(),U=a(function(r,e,t,n,i){t=t||0,n=n||!1,i=i||function(E,C,W){return E* Math.pow(2,W)+C};var s=t>>3,o=a(function(E){return n?~E&255:E},"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"),Zs=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"),Xs=a(function(r,e,t){var n=Math. pow(2,t-1)-1,i=U(r,1),s=U(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=U(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"),Ec=a(function(r){ -return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),Ys=a(function(r){return U(r,1)==1?-1*(U( -r,31,1,!0)+1):U(r,31,1)},"parseInt32"),Ac=a(function(r){return Zs(r,23,8)},"parseFloat32"),_c=a(function(r){ -return Zs(r,52,11)},"parseFloat64"),Cc=a(function(r){var e=U(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"),_c=a(function(r){ +return U(r,1)==1?-1*(U(r,15,1,!0)+1):U(r,15,1)},"parseInt16"),Js=a(function(r){return U(r,1)==1?-1*(U( +r,31,1,!0)+1):U(r,31,1)},"parseInt32"),Cc=a(function(r){return Xs(r,23,8)},"parseFloat32"),Ic=a(function(r){ +return Xs(r,52,11)},"parseFloat64"),Tc=a(function(r){var e=U(r,16,32);if(e==49152)return NaN;for(var t=Math. pow(1e4,U(r,16,16)),n=0,i=[],s=U(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 E=l.shift();for(g= 0;g0},"parseBool"),Rc=a(function(r){r(20,vc),r(21,Ec),r(23,Ys),r(26,Ys),r(1700,Cc),r(700,Ac), -r(701,_c),r(16,Tc),r(1114,Js.bind(null,!1)),r(1184,Js.bind(null,!0)),r(1e3,St),r(1007,St),r(1016,St), -r(1008,St),r(1009,St),r(25,Ic)},"init");Xs.exports={init:Rc}});var ro=P((Jh,to)=>{p();to.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25, +"parseArray"),Rc=a(function(r){return r.toString("utf8")},"parseText"),Pc=a(function(r){return r===null? +null:U(r,8)>0},"parseBool"),Bc=a(function(r){r(20,Ac),r(21,_c),r(23,Js),r(26,Js),r(1700,Tc),r(700,Cc), +r(701,Ic),r(16,Pc),r(1114,Zs.bind(null,!1)),r(1184,Zs.bind(null,!0)),r(1e3,xt),r(1007,xt),r(1016,xt), +r(1008,xt),r(1009,xt),r(25,Rc)},"init");eo.exports={init:Bc}});var no=P((td,ro)=>{p();ro.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 At=P(Et=>{p();var Pc=Vs(),Bc=eo(),Lc=Kr(),Fc=ro();Et.getTypeParser=kc;Et.setTypeParser=Mc;Et.arrayParser= -Lc;Et.builtins=Fc;var vt={text:{},binary:{}};function no(r){return String(r)}a(no,"noParse");function kc(r,e){ -return e=e||"text",vt[e]&&vt[e][r]||no}a(kc,"getTypeParser");function Mc(r,e,t){typeof e=="function"&& -(t=e,e="text"),vt[e][r]=t}a(Mc,"setTypeParser");Pc.init(function(r,e){vt.text[r]=e});Bc.init(function(r,e){ -vt.binary[r]=e})});var er=P((rd,io)=>{"use strict";p();var Uc=At();function Xt(r){this._types=r||Uc,this.text={},this.binary= -{}}a(Xt,"TypeOverrides");Xt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ -binary":return this.binary;default:return{}}};Xt.prototype.setTypeParser=function(r,e,t){typeof e=="\ -function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Xt.prototype.getTypeParser=function(r,e){return e= -e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};io.exports=Xt});function _t(r){let e=1779033703,t=3144134277,n=1013904242,i=2773480762,s=1359893119,o=2600822924,u=528734635, +REGROLE:4096}});var Et=P(vt=>{p();var Lc=Ks(),Fc=to(),kc=Kr(),Mc=no();vt.getTypeParser=Uc;vt.setTypeParser=Dc;vt.arrayParser= +kc;vt.builtins=Mc;var St={text:{},binary:{}};function io(r){return String(r)}a(io,"noParse");function Uc(r,e){ +return e=e||"text",St[e]&&St[e][r]||io}a(Uc,"getTypeParser");function Dc(r,e,t){typeof e=="function"&& +(t=e,e="text"),St[e][r]=t}a(Dc,"setTypeParser");Lc.init(function(r,e){St.text[r]=e});Fc.init(function(r,e){ +St.binary[r]=e})});var Xt=P((od,so)=>{"use strict";p();var Oc=Et();function Zt(r){this._types=r||Oc,this.text={},this.binary= +{}}a(Zt,"TypeOverrides");Zt.prototype.getOverrides=function(r){switch(r){case"text":return this.text;case"\ +binary":return this.binary;default:return{}}};Zt.prototype.setTypeParser=function(r,e,t){typeof e=="\ +function"&&(t=e,e="text"),this.getOverrides(e)[r]=t};Zt.prototype.getTypeParser=function(r,e){return e= +e||"text",this.getOverrides(e)[r]||this._types.getTypeParser(r,e)};so.exports=Zt});function At(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, @@ -557,8 +557,8 @@ c=1541459225,l=0,f=0,y=[1116352408,1899447441,3049323471,3921009573,961987163,15 b,"rrot"),E=new Uint32Array(64),C=new Uint8Array(64),W=a(()=>{for(let M=0,Z=0;M<16;M++,Z+=4)E[M]=C[Z]<< 24|C[Z+1]<<16|C[Z+2]<<8|C[Z+3];for(let M=16;M<64;M++){let Z=g(E[M-15],7)^g(E[M-15],18)^E[M-15]>>>3,Se=g( E[M-2],17)^g(E[M-2],19)^E[M-2]>>>10;E[M]=E[M-16]+Z+E[M-7]+Se|0}let T=e,b=t,F=n,ae=i,H=s,me=o,Ce=u,ce=c; -for(let M=0;M<64;M++){let Z=g(H,6)^g(H,11)^g(H,25),Se=H&me^~H&Ce,Ie=ce+Z+Se+y[M]+E[M]|0,ke=g(T,2)^g( -T,13)^g(T,22),Me=T&b^T&F^b&F,Ue=ke+Me|0;ce=Ce,Ce=me,me=H,H=ae+Ie|0,ae=F,F=b,b=T,T=Ie+Ue|0}e=e+T|0,t= +for(let M=0;M<64;M++){let Z=g(H,6)^g(H,11)^g(H,25),Se=H&me^~H&Ce,Ie=ce+Z+Se+y[M]+E[M]|0,Fe=g(T,2)^g( +T,13)^g(T,22),ke=T&b^T&F^b&F,Me=Fe+ke|0;ce=Ce,Ce=me,me=H,H=ae+Ie|0,ae=F,F=b,b=T,T=Ie+Me|0}e=e+T|0,t= t+b|0,n=n+F|0,i=i+ae|0,s=s+H|0,o=o+me|0,u=u+Ce|0,c=c+ce|0,f=0},"process"),J=a(T=>{typeof T=="string"&& (T=new TextEncoder().encode(T));for(let b=0;b{if(C[f++]=128,f==64&&W(),f+8>64){for(;f<64;)C[f++]=0;W()}for(;f<58;)C[f++]=0;let T=l*8;C[f++]= @@ -568,7 +568,7 @@ t>>>24,b[5]=t>>>16&255,b[6]=t>>>8&255,b[7]=t&255,b[8]=n>>>24,b[9]=n>>>16&255,b[1 255,b[12]=i>>>24,b[13]=i>>>16&255,b[14]=i>>>8&255,b[15]=i&255,b[16]=s>>>24,b[17]=s>>>16&255,b[18]=s>>> 8&255,b[19]=s&255,b[20]=o>>>24,b[21]=o>>>16&255,b[22]=o>>>8&255,b[23]=o&255,b[24]=u>>>24,b[25]=u>>>16& 255,b[26]=u>>>8&255,b[27]=u&255,b[28]=c>>>24,b[29]=c>>>16&255,b[30]=c>>>8&255,b[31]=c&255,b},"digest"); -return r===void 0?{add:J,digest:ye}:(J(r),ye())}var so=te(()=>{"use strict";p();a(_t,"sha256")});var Q,Ct,oo=te(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ +return r===void 0?{add:J,digest:ye}:(J(r),ye())}var oo=te(()=>{"use strict";p();a(At,"sha256")});var Q,_t,ao=te(()=>{"use strict";p();Q=class Q{constructor(){I(this,"_dataLength",0);I(this,"_buffer\ Length",0);I(this,"_state",new Int32Array(4));I(this,"_buffer",new ArrayBuffer(68));I(this,"_buffer8"); I(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 Q._md5cycle(this._state,i),e?this._state:Q._hex( this._state)}};a(Q,"Md5"),I(Q,"stateIdentity",new Int32Array([1732584193,-271733879,-1732584194,271733878])), I(Q,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),I(Q,"hexChars","0123456789\ -abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);Ct=Q});var rn={};we(rn,{createHash:()=>Oc,createHmac:()=>Nc,randomBytes:()=>Dc});function Dc(r){return crypto. -getRandomValues(m.alloc(r))}function Oc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( -function(){return m.from(_t(e))},"digest")}},"update")};if(r==="md5")return{update:a(function(e){return{ -digest:a(function(){return typeof e=="string"?Ct.hashStr(e):Ct.hashByteArray(e)},"digest")}},"update")}; -throw new Error(`Hash type '${r}' not supported`)}function Nc(r,e){if(r!=="sha256")throw new Error(`\ +abcdef"),I(Q,"hexOut",[]),I(Q,"onePassHasher",new Q);_t=Q});var rn={};we(rn,{createHash:()=>qc,createHmac:()=>Qc,randomBytes:()=>Nc});function Nc(r){return crypto. +getRandomValues(m.alloc(r))}function qc(r){if(r==="sha256")return{update:a(function(e){return{digest:a( +function(){return m.from(At(e))},"digest")}},"update")};if(r==="md5")return{update:a(function(e){return{ +digest:a(function(){return typeof e=="string"?_t.hashStr(e):_t.hashByteArray(e)},"digest")}},"update")}; +throw new Error(`Hash type '${r}' not supported`)}function Qc(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=_t(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=At(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(_t(o),64),m.from(_t(u))}, -"digest")}},"update")}}var nn=te(()=>{"use strict";p();so();oo();a(Dc,"randomBytes");a(Oc,"createHas\ -h");a(Nc,"createHmac")});var It=P((yd,sn)=>{"use strict";p();sn.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: +64);o.set(i,0),o.set(t,64);let u=new Uint8Array(96);return u.set(s,0),u.set(At(o),64),m.from(At(u))}, +"digest")}},"update")}}var nn=te(()=>{"use strict";p();oo();ao();a(Nc,"randomBytes");a(qc,"createHas\ +h");a(Qc,"createHmac")});var Ct=P((bd,sn)=>{"use strict";p();sn.exports={host:"localhost",user:w.platform==="win32"?w.env.USERNAME: w.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 nt=At(),qc=nt.getTypeParser(20,"text"),Qc=nt.getTypeParser(1016, -"text");sn.exports.__defineSetter__("parseInt8",function(r){nt.setTypeParser(20,"text",r?nt.getTypeParser( -23,"text"):qc),nt.setTypeParser(1016,"text",r?nt.getTypeParser(1007,"text"):Qc)})});var Tt=P((wd,uo)=>{"use strict";p();var jc=(nn(),$(rn)),Wc=It();function Hc(r){var e=r.replace(/\\/g, -"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(Hc,"escapeElement");function ao(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+ao(r[t]): -r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=Hc(tr(r[t]));return e=e+"}",e}a(ao,"arrayString"); -var tr=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. +keepalives:1,keepalives_idle:0};var rt=Et(),jc=rt.getTypeParser(20,"text"),Wc=rt.getTypeParser(1016, +"text");sn.exports.__defineSetter__("parseInt8",function(r){rt.setTypeParser(20,"text",r?rt.getTypeParser( +23,"text"):jc),rt.setTypeParser(1016,"text",r?rt.getTypeParser(1007,"text"):Wc)})});var It=P((Sd,co)=>{"use strict";p();var Hc=(nn(),$(rn)),$c=Ct();function Gc(r){var e=r.replace(/\\/g, +"\\\\").replace(/"/g,'\\"');return'"'+e+'"'}a(Gc,"escapeElement");function uo(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+uo(r[t]): +r[t]instanceof m?e+="\\\\x"+r[t].toString("hex"):e+=Gc(er(r[t]));return e=e+"}",e}a(uo,"arrayString"); +var er=a(function(r,e){if(r==null)return null;if(r instanceof m)return r;if(ArrayBuffer.isView(r)){var t=m. 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?Wc.parseInputDatesAsUTC?Vc(r):Gc(r):Array.isArray(r)?ao(r):typeof r== -"object"?$c(r,e):r.toString()},"prepareValue");function $c(r,e){if(r&&typeof r.toPostgres=="function"){ +r.byteLength)}return r instanceof Date?$c.parseInputDatesAsUTC?zc(r):Kc(r):Array.isArray(r)?uo(r):typeof r== +"object"?Vc(r,e):r.toString()},"prepareValue");function Vc(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),tr(r.toPostgres(tr),e)}return JSON.stringify(r)}a($c,"prepareObject");function Y(r,e){ -for(r=""+r;r.lengthil});var il,Pt=te(()=>{"use strict";p();il={}});var So=P((Bd,xo)=>{"use strict";p();var un=(nn(),$(rn));function sl(r){if(r.indexOf("SCRAM-SHA-256")=== --1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=un.randomBytes( +t),r}a(Yc,"normalizeQueryConfig");var on=a(function(r){return Hc.createHash("md5").update(r,"utf-8"). +digest("hex")},"md5"),Jc=a(function(r,e,t){var n=on(e+r),i=on(m.concat([m.from(n),t]));return"md5"+i}, +"postgresMd5PasswordHash");co.exports={prepareValue:a(function(e){return er(e)},"prepareValueWrapper"), +normalizeQueryConfig:Yc,postgresMd5PasswordHash:Jc,md5:on}});var Tt={};we(Tt,{default:()=>ul});var ul,Rt=te(()=>{"use strict";p();ul={}});var Eo=P((Md,vo)=>{"use strict";p();var cn=(nn(),$(rn));function cl(r){if(r.indexOf("SCRAM-SHA-256")=== +-1)throw new Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let e=cn.randomBytes( 18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:e,response:"n,,n=*,r="+e,message:"\ -SASLInitialResponse"}}a(sl,"startSession");function ol(r,e,t){if(r.message!=="SASLInitialResponse")throw new Error( +SASLInitialResponse"}}a(cl,"startSession");function ll(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=cl(t);if(n.nonce.startsWith(r.clientNonce)){ +L: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=dl(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=m.from(n.salt,"base64"),s=hl(e,i,n.iteration),o=it(s,"Client Key"),u=fl( +art with client nonce");var i=m.from(n.salt,"base64"),s=ml(e,i,n.iteration),o=nt(s,"Client Key"),u=yl( 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=it(u,y),E=bo(o,g),C=E.toString("base64"),W=it(s,"Server Key"),J=it(W,y);r.message="SAS\ -LResponse",r.serverSignature=J.toString("base64"),r.response=f+",p="+C}a(ol,"continueSession");function al(r,e){ +","+l+","+f,g=nt(u,y),E=So(o,g),C=E.toString("base64"),W=nt(s,"Server Key"),J=nt(W,y);r.message="SAS\ +LResponse",r.serverSignature=J.toString("base64"),r.response=f+",p="+C}a(ll,"continueSession");function fl(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}=ll( +"string")throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:t}=pl( e);if(t!==r.serverSignature)throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does\ - not match")}a(al,"finalizeSession");function ul(r){if(typeof r!="string")throw new TypeError("SASL:\ + not match")}a(fl,"finalizeSession");function hl(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(ul,"isPrintableChars");function wo(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. -test(r)}a(wo,"isBase64");function go(r){if(typeof r!="string")throw new TypeError("SASL: attribute p\ +e<=126)}a(hl,"isPrintableChars");function bo(r){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/. +test(r)}a(bo,"isBase64");function xo(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(go,"parseAttribute\ -Pairs");function cl(r){let e=go(r),t=e.get("r");if(t){if(!ul(t))throw new Error("SASL: SCRAM-SERVER-\ +SASL: Invalid attribute pair entry");let t=e[0],n=e.substring(2);return[t,n]}))}a(xo,"parseAttribute\ +Pairs");function dl(r){let e=xo(r),t=e.get("r");if(t){if(!hl(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(!wo(n))throw new Error("SASL: SCRAM-SERV\ +ER-FIRST-MESSAGE: nonce missing");let n=e.get("s");if(n){if(!bo(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(cl,"parseServerFirstMessage"); -function ll(r){let t=go(r).get("v");if(t){if(!wo(t))throw new Error("SASL: SCRAM-SERVER-FINAL-MESSAG\ +tion missing");let s=parseInt(i,10);return{nonce:t,salt:n,iteration:s}}a(dl,"parseServerFirstMessage"); +function pl(r){let t=xo(r).get("v");if(t){if(!bo(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(ll,"parseServerFinalMessage");function bo(r,e){if(!m. +signature is missing");return{serverSignature:t}}a(pl,"parseServerFinalMessage");function So(r,e){if(!m. isBuffer(r))throw new TypeError("first argument must be a Buffer");if(!m.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 m.from(r.map((t,n)=>r[n]^e[n]))} -a(bo,"xorBuffers");function fl(r){return un.createHash("sha256").update(r).digest()}a(fl,"sha256");function it(r,e){ -return un.createHmac("sha256",r).update(e).digest()}a(it,"hmacSha256");function hl(r,e,t){for(var n=it( -r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;sdl});function dl(...r){return r.join("/")}var ln=te(()=>{"use strict";p(); -a(dl,"join")});var fn={};we(fn,{stat:()=>pl});function pl(r,e){e(new Error("No filesystem"))}var hn=te(()=>{"use st\ -rict";p();a(pl,"stat")});var dn={};we(dn,{default:()=>yl});var yl,pn=te(()=>{"use strict";p();yl={}});var vo={};we(vo,{StringDecoder:()=>yn});var mn,yn,Eo=te(()=>{"use strict";p();mn=class mn{constructor(e){ +a(So,"xorBuffers");function yl(r){return cn.createHash("sha256").update(r).digest()}a(yl,"sha256");function nt(r,e){ +return cn.createHmac("sha256",r).update(e).digest()}a(nt,"hmacSha256");function ml(r,e,t){for(var n=nt( +r,m.concat([e,m.from([0,0,0,1])])),i=n,s=0;swl});function wl(...r){return r.join("/")}var fn=te(()=>{"use strict";p(); +a(wl,"join")});var hn={};we(hn,{stat:()=>gl});function gl(r,e){e(new Error("No filesystem"))}var dn=te(()=>{"use st\ +rict";p();a(gl,"stat")});var pn={};we(pn,{default:()=>bl});var bl,yn=te(()=>{"use strict";p();bl={}});var Ao={};we(Ao,{StringDecoder:()=>mn});var wn,mn,_o=te(()=>{"use strict";p();wn=class wn{constructor(e){ I(this,"td");this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this. -td.decode(e)}};a(mn,"StringDecoder");yn=mn});var Io=P((Qd,Co)=>{"use strict";p();var{Transform:ml}=(pn(),$(dn)),{StringDecoder:wl}=(Eo(),$(vo)),Le=Symbol( -"last"),ir=Symbol("decoder");function gl(r,e,t){let n;if(this.overflow){if(n=this[ir].write(r).split( -this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Le]+=this[ir].write(r),n= -this[Le].split(this.matcher);this[Le]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( -"maximum buffer reached"));return}t()}a(gl,"transform");function bl(r){if(this[Le]+=this[ir].end(),this[Le]) -try{_o(this,this.mapper(this[Le]))}catch(e){return r(e)}r()}a(bl,"flush");function _o(r,e){e!==void 0&& -r.push(e)}a(_o,"push");function Ao(r){return r}a(Ao,"noop");function xl(r,e,t){switch(r=r||/\r?\n/,e= -e||Ao,t=t||{},arguments.length){case 1:typeof r=="function"?(e=r,r=/\r?\n/):typeof r=="object"&&!(r instanceof +td.decode(e)}};a(wn,"StringDecoder");mn=wn});var Ro=P(($d,To)=>{"use strict";p();var{Transform:xl}=(yn(),$(pn)),{StringDecoder:Sl}=(_o(),$(Ao)),Be=Symbol( +"last"),ir=Symbol("decoder");function vl(r,e,t){let n;if(this.overflow){if(n=this[ir].write(r).split( +this.matcher),n.length===1)return t();n.shift(),this.overflow=!1}else this[Be]+=this[ir].write(r),n= +this[Be].split(this.matcher);this[Be]=n.pop();for(let i=0;ithis.maxLength,this.overflow&&!this.skipOverflow){t(new Error( +"maximum buffer reached"));return}t()}a(vl,"transform");function El(r){if(this[Be]+=this[ir].end(),this[Be]) +try{Io(this,this.mapper(this[Be]))}catch(e){return r(e)}r()}a(El,"flush");function Io(r,e){e!==void 0&& +r.push(e)}a(Io,"push");function Co(r){return r}a(Co,"noop");function Al(r,e,t){switch(r=r||/\r?\n/,e= +e||Co,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=Ao)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=gl,t.flush=bl,t.readableObjectMode= -!0;let n=new ml(t);return n[Le]="",n[ir]=new wl("utf8"),n.matcher=r,n.mapper=e,n.maxLength=t.maxLength, +"object"&&(t=e,e=Co)}t=Object.assign({},t),t.autoDestroy=!0,t.transform=vl,t.flush=El,t.readableObjectMode= +!0;let n=new xl(t);return n[Be]="",n[ir]=new Sl("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(xl,"split");Co.exports=xl});var Po=P((Hd,_e)=>{"use strict";p();var To=(ln(),$(cn)),Sl=(pn(),$(dn)).Stream,vl=Io(),Ro=(Pt(),$(Rt)), -El=5432,sr=w.platform==="win32",Bt=w.stderr,Al=56,_l=7,Cl=61440,Il=32768;function Tl(r){return(r&Cl)== -Il}a(Tl,"isRegFile");var st=["host","port","database","user","password"],wn=st.length,Rl=st[wn-1];function gn(){ -var r=Bt instanceof Sl&&Bt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` -`);Bt.write(Ro.format.apply(Ro,e))}}a(gn,"warn");Object.defineProperty(_e.exports,"isWin",{get:a(function(){ -return sr},"get"),set:a(function(r){sr=r},"set")});_e.exports.warnTo=function(r){var e=Bt;return Bt= -r,e};_e.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(sr?To.join(e.APPDATA||"./","\ -postgresql","pgpass.conf"):To.join(e.HOME||"./",".pgpass"));return t};_e.exports.usePgPass=function(r,e){ -return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:sr?!0:(e=e||"",Tl(r.mode)?r. -mode&(Al|_l)?(gn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ -(0600) or less',e),!1):!0:(gn('WARNING: password file "%s" is not a plain file',e),!1))};var Pl=_e.exports. -match=function(r,e){return st.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||El)===Number( +!1,s(i)},n}a(Al,"split");To.exports=Al});var Lo=P((Kd,_e)=>{"use strict";p();var Po=(fn(),$(ln)),_l=(yn(),$(pn)).Stream,Cl=Ro(),Bo=(Rt(),$(Tt)), +Il=5432,sr=w.platform==="win32",Pt=w.stderr,Tl=56,Rl=7,Pl=61440,Bl=32768;function Ll(r){return(r&Pl)== +Bl}a(Ll,"isRegFile");var it=["host","port","database","user","password"],gn=it.length,Fl=it[gn-1];function bn(){ +var r=Pt instanceof _l&&Pt.writable===!0;if(r){var e=Array.prototype.slice.call(arguments).concat(` +`);Pt.write(Bo.format.apply(Bo,e))}}a(bn,"warn");Object.defineProperty(_e.exports,"isWin",{get:a(function(){ +return sr},"get"),set:a(function(r){sr=r},"set")});_e.exports.warnTo=function(r){var e=Pt;return Pt= +r,e};_e.exports.getFileName=function(r){var e=r||w.env,t=e.PGPASSFILE||(sr?Po.join(e.APPDATA||"./","\ +postgresql","pgpass.conf"):Po.join(e.HOME||"./",".pgpass"));return t};_e.exports.usePgPass=function(r,e){ +return Object.prototype.hasOwnProperty.call(w.env,"PGPASSWORD")?!1:sr?!0:(e=e||"",Ll(r.mode)?r. +mode&(Tl|Rl)?(bn('WARNING: password file "%s" has group or world access; permissions should be u=rw \ +(0600) or less',e),!1):!0:(bn('WARNING: password file "%s" is not a plain file',e),!1))};var kl=_e.exports. +match=function(r,e){return it.slice(0,-1).reduce(function(t,n,i){return i==1&&Number(r[n]||Il)===Number( e[n])?t&&!0:t&&(e[n]==="*"||e[n]===r[n])},!0)};_e.exports.getPassword=function(r,e,t){var n,i=e.pipe( -vl());function s(c){var l=Bl(c);l&&Ll(l)&&Pl(r,l)&&(n=l[Rl],i.end())}a(s,"onLine");var o=a(function(){ -e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),gn("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 Bl=_e.exports.parseLine= +Cl());function s(c){var l=Ml(c);l&&Ul(l)&&kl(r,l)&&(n=l[Fl],i.end())}a(s,"onLine");var o=a(function(){ +e.destroy(),t(n)},"onEnd"),u=a(function(c){e.destroy(),bn("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 Ml=_e.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 E=r.substring(y,g);Object.hasOwnProperty.call(w.env,"PGPASS_NO_DEESCAPE")||(E=E. -replace(/\\([:\\])/g,"$1")),o[st[f]]=E},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). -length===wn?o:null,o},Ll=_e.exports.isValidEntry=function(r){for(var e={0:function(o){return o.length> +replace(/\\([:\\])/g,"$1")),o[it[f]]=E},"addToObj"),l=0;l=0&&e==":"&&t!=="\\"&&(c(n,i,l+1),i=l+2,n+=1)}return o=Object.keys(o). +length===gn?o:null,o},Ul=_e.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 Vd=(ln(),$(cn)),Bo=(hn(),$(fn)),or=Po();bn.exports=function(r,e){ -var t=or.getFileName();Bo.stat(t,function(n,i){if(n||!or.usePgPass(i,t))return e(void 0);var s=Bo.createReadStream( -t);or.getPassword(r,s,e)})};bn.exports.warnTo=or.warnTo});var Fo={};we(Fo,{default:()=>Fl});var Fl,ko=te(()=>{"use strict";p();Fl={}});var Uo=P((Jd,Mo)=>{"use strict";p();var kl=(Br(),$(ls)),xn=(hn(),$(fn));function Sn(r){if(r.charAt(0)=== -"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=kl.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i. +0}},t=0;t{"use strict";p();var Jd=(fn(),$(ln)),Fo=(dn(),$(hn)),or=Lo();xn.exports=function(r,e){ +var t=or.getFileName();Fo.stat(t,function(n,i){if(n||!or.usePgPass(i,t))return e(void 0);var s=Fo.createReadStream( +t);or.getPassword(r,s,e)})};xn.exports.warnTo=or.warnTo});var Mo={};we(Mo,{default:()=>Dl});var Dl,Uo=te(()=>{"use strict";p();Dl={}});var Oo=P((tp,Do)=>{"use strict";p();var Ol=(Br(),$(fs)),Sn=(dn(),$(hn));function vn(r){if(r.charAt(0)=== +"/"){var t=r.split(" ");return{host:t[0],database:t[1]}}var e=Ol.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=xn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=xn.readFileSync(t.sslkey).toString()), -t.sslrootcert&&(t.ssl.ca=xn.readFileSync(t.sslrootcert).toString()),t.sslmode){case"disable":{t.ssl= +cert=Sn.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=Sn.readFileSync(t.sslkey).toString()), +t.sslrootcert&&(t.ssl.ca=Sn.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(Sn,"parse");Mo.exports=Sn;Sn.parse=Sn});var ar=P((ep,No)=>{"use strict";p();var Ml=(ko(),$(Fo)),Oo=It(),Do=Uo().parse,ee=a(function(r,e,t){return t=== -void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||Oo[r]},"val"),Ul=a(function(){switch(w. +!1;break}}return t}a(vn,"parse");Do.exports=vn;vn.parse=vn});var ar=P((ip,Qo)=>{"use strict";p();var Nl=(Uo(),$(Mo)),qo=Ct(),No=Oo().parse,ee=a(function(r,e,t){return t=== +void 0?t=w.env["PG"+r.toUpperCase()]:t===!1||(t=w.env[t]),e[r]||t||qo[r]},"val"),ql=a(function(){switch(w. 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 Oo.ssl},"readSSLConfigFromEnvironment"),ot=a(function(r){ +no-verify":return{rejectUnauthorized:!1}}return qo.ssl},"readSSLConfigFromEnvironment"),st=a(function(r){ return"'"+(""+r).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),pe=a(function(r,e,t){ -var n=e[t];n!=null&&r.push(t+"="+ot(n))},"add"),En=class En{constructor(e){e=typeof e=="string"?Do(e): -e||{},e.connectionString&&(e=Object.assign({},e,Do(e.connectionString))),this.user=ee("user",e),this. +var n=e[t];n!=null&&r.push(t+"="+st(n))},"add"),An=class An{constructor(e){e=typeof e=="string"?No(e): +e||{},e.connectionString&&(e=Object.assign({},e,No(e.connectionString))),this.user=ee("user",e),this. database=ee("database",e),this.database===void 0&&(this.database=this.user),this.port=parseInt(ee("p\ ort",e),10),this.host=ee("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1, writable:!0,value:ee("password",e)}),this.binary=ee("binary",e),this.options=ee("options",e),this.ssl= -typeof e.ssl>"u"?Ul():e.ssl,typeof this.ssl=="string"&&this.ssl==="true"&&(this.ssl=!0),this.ssl==="\ +typeof e.ssl>"u"?ql():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=ee("client_encoding",e),this.replication=ee("replication", e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=ee("application_name",e,"\ @@ -783,28 +783,28 @@ void 0?this.connect_timeout=w.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math var t=[];pe(t,this,"user"),pe(t,this,"password"),pe(t,this,"port"),pe(t,this,"application_name"),pe( t,this,"fallback_application_name"),pe(t,this,"connect_timeout"),pe(t,this,"options");var n=typeof this. ssl=="object"?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(pe(t,n,"sslmode"),pe(t,n,"sslca"),pe(t,n,"s\ -slkey"),pe(t,n,"sslcert"),pe(t,n,"sslrootcert"),this.database&&t.push("dbname="+ot(this.database)),this. -replication&&t.push("replication="+ot(this.replication)),this.host&&t.push("host="+ot(this.host)),this. -isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+ot(this.client_encoding)), -Ml.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+ot(s)),e(null,t.join(" ")))})}}; -a(En,"ConnectionParameters");var vn=En;No.exports=vn});var jo=P((np,Qo)=>{"use strict";p();var Dl=At(),qo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,_n=class _n{constructor(e,t){ +slkey"),pe(t,n,"sslcert"),pe(t,n,"sslrootcert"),this.database&&t.push("dbname="+st(this.database)),this. +replication&&t.push("replication="+st(this.replication)),this.host&&t.push("host="+st(this.host)),this. +isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+st(this.client_encoding)), +Nl.lookup(this.host,function(i,s){return i?e(i,null):(t.push("hostaddr="+st(s)),e(null,t.join(" ")))})}}; +a(An,"ConnectionParameters");var En=An;Qo.exports=En});var Ho=P((ap,Wo)=>{"use strict";p();var Ql=Et(),jo=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,Cn=class Cn{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=qo.exec(e.text):t=qo.exec(e.command),t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2], +var t;e.text?t=jo.exec(e.text):t=jo.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:Ol}=Pe(),Wo=jo(),Ho=Tt(),In=class In extends Ol{constructor(e,t,n){ -super(),e=Ho.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]=Ql.getTypeParser(n.dataTypeID,n. +format||"text")}}};a(Cn,"Result");var _n=Cn;Wo.exports=_n});var Ko=P((lp,Vo)=>{"use strict";p();var{EventEmitter:jl}=Pe(),$o=Ho(),Go=It(),Tn=class Tn extends jl{constructor(e,t,n){ +super(),e=Go.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,w.domain&&e.callback&&(this.callback=w.domain.bind(e.callback)),this._result= -new Wo(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError= +new $o(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 Wo(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){ +_results=[this._result]),this._result=new $o(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:Ho.prepareValue})}catch(t){ +portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:Go.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(In,"Query");var Cn=In;$o.exports= -Cn});var ri=P(R=>{"use strict";p();Object.defineProperty(R,"__esModule",{value:!0});R.NoticeMessage=R.DataRowMessage= +e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};a(Tn,"Query");var In=Tn;Vo.exports= +In});var ni=P(R=>{"use strict";p();Object.defineProperty(R,"__esModule",{value:!0});R.NoticeMessage=R.DataRowMessage= R.CommandCompleteMessage=R.ReadyForQueryMessage=R.NotificationResponseMessage=R.BackendKeyDataMessage= R.AuthenticationMD5Password=R.ParameterStatusMessage=R.ParameterDescriptionMessage=R.RowDescriptionMessage= R.Field=R.CopyResponse=R.CopyDataMessage=R.DatabaseError=R.copyDone=R.emptyQuery=R.replicationStart= @@ -832,30 +832,30 @@ R.portalSuspended=R.noData=R.closeComplete=R.bindComplete=R.parseComplete=void 0 parseComplete",length:5};R.bindComplete={name:"bindComplete",length:5};R.closeComplete={name:"closeC\ omplete",length:5};R.noData={name:"noData",length:5};R.portalSuspended={name:"portalSuspended",length:5}; R.replicationStart={name:"replicationStart",length:4};R.emptyQuery={name:"emptyQuery",length:4};R.copyDone= -{name:"copyDone",length:4};var jn=class jn extends Error{constructor(e,t,n){super(e),this.length=t,this. -name=n}};a(jn,"DatabaseError");var Tn=jn;R.DatabaseError=Tn;var Wn=class Wn{constructor(e,t){this.length= -e,this.chunk=t,this.name="copyData"}};a(Wn,"CopyDataMessage");var Rn=Wn;R.CopyDataMessage=Rn;var Hn=class Hn{constructor(e,t,n,i){ -this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a(Hn,"CopyResponse");var Pn=Hn; -R.CopyResponse=Pn;var $n=class $n{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($n,"Field");var Bn=$n; -R.Field=Bn;var Gn=class Gn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ -n",this.fields=new Array(this.fieldCount)}};a(Gn,"RowDescriptionMessage");var Ln=Gn;R.RowDescriptionMessage= -Ln;var Vn=class Vn{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ -ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(Vn,"ParameterDescriptionMessage");var Fn=Vn; -R.ParameterDescriptionMessage=Fn;var Kn=class Kn{constructor(e,t,n){this.length=e,this.parameterName= -t,this.parameterValue=n,this.name="parameterStatus"}};a(Kn,"ParameterStatusMessage");var kn=Kn;R.ParameterStatusMessage= -kn;var zn=class zn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; -a(zn,"AuthenticationMD5Password");var Mn=zn;R.AuthenticationMD5Password=Mn;var Yn=class Yn{constructor(e,t,n){ -this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Yn,"BackendKeyDataMes\ -sage");var Un=Yn;R.BackendKeyDataMessage=Un;var Jn=class Jn{constructor(e,t,n,i){this.length=e,this. -processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(Jn,"NotificationResponseMessa\ -ge");var Dn=Jn;R.NotificationResponseMessage=Dn;var Zn=class Zn{constructor(e,t){this.length=e,this. -status=t,this.name="readyForQuery"}};a(Zn,"ReadyForQueryMessage");var On=Zn;R.ReadyForQueryMessage=On; -var Xn=class Xn{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(Xn,"Comma\ -ndCompleteMessage");var Nn=Xn;R.CommandCompleteMessage=Nn;var ei=class ei{constructor(e,t){this.length= -e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(ei,"DataRowMessage");var qn=ei;R.DataRowMessage= -qn;var ti=class ti{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(ti,"NoticeMe\ -ssage");var Qn=ti;R.NoticeMessage=Qn});var Vo=P(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.Writer=void 0;var ii=class ii{constructor(e=256){ +{name:"copyDone",length:4};var Wn=class Wn extends Error{constructor(e,t,n){super(e),this.length=t,this. +name=n}};a(Wn,"DatabaseError");var Rn=Wn;R.DatabaseError=Rn;var Hn=class Hn{constructor(e,t){this.length= +e,this.chunk=t,this.name="copyData"}};a(Hn,"CopyDataMessage");var Pn=Hn;R.CopyDataMessage=Pn;var $n=class $n{constructor(e,t,n,i){ +this.length=e,this.name=t,this.binary=n,this.columnTypes=new Array(i)}};a($n,"CopyResponse");var Bn=$n; +R.CopyResponse=Bn;var Gn=class Gn{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(Gn,"Field");var Ln=Gn; +R.Field=Ln;var Vn=class Vn{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescriptio\ +n",this.fields=new Array(this.fieldCount)}};a(Vn,"RowDescriptionMessage");var Fn=Vn;R.RowDescriptionMessage= +Fn;var Kn=class Kn{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescript\ +ion",this.dataTypeIDs=new Array(this.parameterCount)}};a(Kn,"ParameterDescriptionMessage");var kn=Kn; +R.ParameterDescriptionMessage=kn;var zn=class zn{constructor(e,t,n){this.length=e,this.parameterName= +t,this.parameterValue=n,this.name="parameterStatus"}};a(zn,"ParameterStatusMessage");var Mn=zn;R.ParameterStatusMessage= +Mn;var Yn=class Yn{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}}; +a(Yn,"AuthenticationMD5Password");var Un=Yn;R.AuthenticationMD5Password=Un;var Jn=class Jn{constructor(e,t,n){ +this.length=e,this.processID=t,this.secretKey=n,this.name="backendKeyData"}};a(Jn,"BackendKeyDataMes\ +sage");var Dn=Jn;R.BackendKeyDataMessage=Dn;var Zn=class Zn{constructor(e,t,n,i){this.length=e,this. +processId=t,this.channel=n,this.payload=i,this.name="notification"}};a(Zn,"NotificationResponseMessa\ +ge");var On=Zn;R.NotificationResponseMessage=On;var Xn=class Xn{constructor(e,t){this.length=e,this. +status=t,this.name="readyForQuery"}};a(Xn,"ReadyForQueryMessage");var Nn=Xn;R.ReadyForQueryMessage=Nn; +var ei=class ei{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};a(ei,"Comma\ +ndCompleteMessage");var qn=ei;R.CommandCompleteMessage=qn;var ti=class ti{constructor(e,t){this.length= +e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};a(ti,"DataRowMessage");var Qn=ti;R.DataRowMessage= +Qn;var ri=class ri{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};a(ri,"NoticeMe\ +ssage");var jn=ri;R.NoticeMessage=jn});var zo=P(ur=>{"use strict";p();Object.defineProperty(ur,"__esModule",{value:!0});ur.Writer=void 0;var si=class si{constructor(e=256){ this.size=e,this.offset=5,this.headerPosition=0,this.buffer=m.allocUnsafe(e)}ensure(e){if(this.buffer. length-this.offset>1)+e;this.buffer=m.allocUnsafe(i),n.copy( this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this. @@ -867,49 +867,49 @@ 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=m.allocUnsafe(this.size),t}};a(ii,"Writer");var ni=ii;ur.Writer=ni});var zo=P(lr=>{"use strict";p();Object.defineProperty(lr,"__esModule",{value:!0});lr.serialize=void 0; -var si=Vo(),D=new si.Writer,Nl=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( +headerPosition=0,this.buffer=m.allocUnsafe(this.size),t}};a(si,"Writer");var ii=si;ur.Writer=ii});var Jo=P(lr=>{"use strict";p();Object.defineProperty(lr,"__esModule",{value:!0});lr.serialize=void 0; +var oi=zo(),D=new oi.Writer,Wl=a(r=>{D.addInt16(3).addInt16(0);for(let n of Object.keys(r))D.addCString( n).addCString(r[n]);D.addCString("client_encoding").addCString("UTF8");let e=D.addCString("").flush(), -t=e.length+4;return new si.Writer().addInt32(t).add(e).flush()},"startup"),ql=a(()=>{let r=m.allocUnsafe( -8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),Ql=a(r=>D.addCString(r).flush( -112),"password"),jl=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. -flush(112)},"sendSASLInitialResponseMessage"),Wl=a(function(r){return D.addString(r).flush(112)},"se\ -ndSCRAMClientFinalMessage"),Hl=a(r=>D.addCString(r).flush(81),"query"),Ko=[],$l=a(r=>{let e=r.name|| +t=e.length+4;return new oi.Writer().addInt32(t).add(e).flush()},"startup"),Hl=a(()=>{let r=m.allocUnsafe( +8);return r.writeInt32BE(8,0),r.writeInt32BE(80877103,4),r},"requestSsl"),$l=a(r=>D.addCString(r).flush( +112),"password"),Gl=a(function(r,e){return D.addCString(r).addInt32(m.byteLength(e)).addString(e),D. +flush(112)},"sendSASLInitialResponseMessage"),Vl=a(function(r){return D.addString(r).flush(112)},"se\ +ndSCRAMClientFinalMessage"),Kl=a(r=>D.addCString(r).flush(81),"query"),Yo=[],zl=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||Ko,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< -n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),at=new si.Writer,Gl=a(function(r,e){for(let t=0;t< -r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),at.addInt32(-1)):n instanceof m?(D.addInt16( -1),at.addInt32(n.length),at.add(n)):(D.addInt16(0),at.addInt32(m.byteLength(n)),at.addString(n))}},"\ -writeValues"),Vl=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Ko,s=i.length; -return D.addCString(e).addCString(t),D.addInt16(s),Gl(i,r.valueMapper),D.addInt16(s),D.add(at.flush()), -D.addInt16(n?1:0),D.flush(66)},"bind"),Kl=m.from([69,0,0,0,9,0,0,0,0,0]),zl=a(r=>{if(!r||!r.portal&& -!r.rows)return Kl;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),Yl=a( +xecuting queries"));let t=r.types||Yo,n=t.length,i=D.addCString(e).addCString(r.text).addInt16(n);for(let s=0;s< +n;s++)i.addInt32(t[s]);return D.flush(80)},"parse"),ot=new oi.Writer,Yl=a(function(r,e){for(let t=0;t< +r.length;t++){let n=e?e(r[t],t):r[t];n==null?(D.addInt16(0),ot.addInt32(-1)):n instanceof m?(D.addInt16( +1),ot.addInt32(n.length),ot.add(n)):(D.addInt16(0),ot.addInt32(m.byteLength(n)),ot.addString(n))}},"\ +writeValues"),Jl=a((r={})=>{let e=r.portal||"",t=r.statement||"",n=r.binary||!1,i=r.values||Yo,s=i.length; +return D.addCString(e).addCString(t),D.addInt16(s),Yl(i,r.valueMapper),D.addInt16(s),D.add(ot.flush()), +D.addInt16(n?1:0),D.flush(66)},"bind"),Zl=m.from([69,0,0,0,9,0,0,0,0,0]),Xl=a(r=>{if(!r||!r.portal&& +!r.rows)return Zl;let e=r.portal||"",t=r.rows||0,n=m.byteLength(e),i=4+n+1+4,s=m.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"),ef=a( (r,e)=>{let t=m.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"),oi=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. +6),t.writeInt32BE(r,8),t.writeInt32BE(e,12),t},"cancel"),ai=a((r,e)=>{let n=4+m.byteLength(e)+1,i=m. allocUnsafe(1+n);return i[0]=r,i.writeInt32BE(n,1),i.write(e,5,"utf-8"),i[n]=0,i},"cstringMessage"), -Jl=D.addCString("P").flush(68),Zl=D.addCString("S").flush(68),Xl=a(r=>r.name?oi(68,`${r.type}${r.name|| -""}`):r.type==="P"?Jl:Zl,"describe"),ef=a(r=>{let e=`${r.type}${r.name||""}`;return oi(67,e)},"close"), -tf=a(r=>D.add(r).flush(100),"copyData"),rf=a(r=>oi(102,r),"copyFail"),cr=a(r=>m.from([r,0,0,0,4]),"c\ -odeOnlyBuffer"),nf=cr(72),sf=cr(83),of=cr(88),af=cr(99),uf={startup:Nl,password:Ql,requestSsl:ql,sendSASLInitialResponseMessage:jl, -sendSCRAMClientFinalMessage:Wl,query:Hl,parse:$l,bind:Vl,execute:zl,describe:Xl,close:ef,flush:a(()=>nf, -"flush"),sync:a(()=>sf,"sync"),end:a(()=>of,"end"),copyData:tf,copyDone:a(()=>af,"copyDone"),copyFail:rf, -cancel:Yl};lr.serialize=uf});var Yo=P(fr=>{"use strict";p();Object.defineProperty(fr,"__esModule",{value:!0});fr.BufferReader=void 0; -var cf=m.allocUnsafe(0),ui=class ui{constructor(e=0){this.offset=e,this.buffer=cf,this.encoding="utf\ +tf=D.addCString("P").flush(68),rf=D.addCString("S").flush(68),nf=a(r=>r.name?ai(68,`${r.type}${r.name|| +""}`):r.type==="P"?tf:rf,"describe"),sf=a(r=>{let e=`${r.type}${r.name||""}`;return ai(67,e)},"close"), +of=a(r=>D.add(r).flush(100),"copyData"),af=a(r=>ai(102,r),"copyFail"),cr=a(r=>m.from([r,0,0,0,4]),"c\ +odeOnlyBuffer"),uf=cr(72),cf=cr(83),lf=cr(88),ff=cr(99),hf={startup:Wl,password:$l,requestSsl:Hl,sendSASLInitialResponseMessage:Gl, +sendSCRAMClientFinalMessage:Vl,query:Kl,parse:zl,bind:Jl,execute:Xl,describe:nf,close:sf,flush:a(()=>uf, +"flush"),sync:a(()=>cf,"sync"),end:a(()=>lf,"end"),copyData:of,copyDone:a(()=>ff,"copyDone"),copyFail:af, +cancel:ef};lr.serialize=hf});var Zo=P(fr=>{"use strict";p();Object.defineProperty(fr,"__esModule",{value:!0});fr.BufferReader=void 0; +var df=m.allocUnsafe(0),ci=class ci{constructor(e=0){this.offset=e,this.buffer=df,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(ui,"BufferReader");var ai=ui;fr.BufferReader=ai});var Xo=P(hr=>{"use strict";p();Object.defineProperty(hr,"__esModule",{value:!0});hr.Parser=void 0;var O=ri(), -lf=Yo(),ci=1,ff=4,Jo=ci+ff,Zo=m.allocUnsafe(0),fi=class fi{constructor(e){if(this.buffer=Zo,this.bufferLength= -0,this.bufferOffset=0,this.reader=new lf.BufferReader,e?.mode==="binary")throw new Error("Binary mod\ +offset+=e,t}};a(ci,"BufferReader");var ui=ci;fr.BufferReader=ui});var ta=P(hr=>{"use strict";p();Object.defineProperty(hr,"__esModule",{value:!0});hr.Parser=void 0;var O=ni(), +pf=Zo(),li=1,yf=4,Xo=li+yf,ea=m.allocUnsafe(0),hi=class hi{constructor(e){if(this.buffer=ea,this.bufferLength= +0,this.bufferOffset=0,this.reader=new pf.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+Jo<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( -i+ci),u=ci+o;if(u+i<=n){let c=this.handlePacket(i+Jo,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. -buffer=Zo,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=n-i,this.bufferOffset=i)}mergeBuffer(e){ +this.bufferLength,i=this.bufferOffset;for(;i+Xo<=n;){let s=this.buffer[i],o=this.buffer.readUInt32BE( +i+li),u=li+o;if(u+i<=n){let c=this.handlePacket(i+Xo,s,o,this.buffer);t(c),i+=u}else break}i===n?(this. +buffer=ea,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. buffer.byteLength*2;for(;t>=s;)s*=2;i=m.allocUnsafe(s)}this.buffer.copy(i,0,this.bufferOffset,this.bufferOffset+ @@ -955,14 +955,14 @@ o=this.reader.string(1);for(;o!=="\0";)s[o]=this.reader.cstring(),o=this.reader. c=i==="notice"?new O.NoticeMessage(t,u):new O.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(fi,"Parser");var li=fi;hr.Parser=li});var hi=P(Fe=>{"use strict";p();Object.defineProperty(Fe,"__esModule",{value:!0});Fe.DatabaseError=Fe. -serialize=Fe.parse=void 0;var hf=ri();Object.defineProperty(Fe,"DatabaseError",{enumerable:!0,get:a( -function(){return hf.DatabaseError},"get")});var df=zo();Object.defineProperty(Fe,"serialize",{enumerable:!0, -get:a(function(){return df.serialize},"get")});var pf=Xo();function yf(r,e){let t=new pf.Parser;return r. -on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(yf,"parse");Fe.parse=yf});var ea={};we(ea,{connect:()=>mf});function mf({socket:r,servername:e}){return r.startTls(e),r}var ta=te( -()=>{"use strict";p();a(mf,"connect")});var yi=P((Rp,ia)=>{"use strict";p();var ra=(Je(),$(cs)),wf=Pe().EventEmitter,{parse:gf,serialize:K}=hi(), -na=K.flush(),bf=K.sync(),xf=K.end(),pi=class pi extends wf{constructor(e){super(),e=e||{},this.stream= -e.stream||new ra.Socket,this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis, +a(hi,"Parser");var fi=hi;hr.Parser=fi});var di=P(Le=>{"use strict";p();Object.defineProperty(Le,"__esModule",{value:!0});Le.DatabaseError=Le. +serialize=Le.parse=void 0;var mf=ni();Object.defineProperty(Le,"DatabaseError",{enumerable:!0,get:a( +function(){return mf.DatabaseError},"get")});var wf=Jo();Object.defineProperty(Le,"serialize",{enumerable:!0, +get:a(function(){return wf.serialize},"get")});var gf=ta();function bf(r,e){let t=new gf.Parser;return r. +on("data",n=>t.parse(n,e)),new Promise(n=>r.on("end",()=>n()))}a(bf,"parse");Le.parse=bf});var ra={};we(ra,{connect:()=>xf});function xf({socket:r,servername:e}){return r.startTls(e),r}var na=te( +()=>{"use strict";p();a(xf,"connect")});var mi=P((Fp,oa)=>{"use strict";p();var ia=(Ye(),$(ls)),Sf=Pe().EventEmitter,{parse:vf,serialize:K}=di(), +sa=K.flush(),Ef=K.sync(),Af=K.end(),yi=class yi extends Sf{constructor(e){super(),e=e||{},this.stream= +e.stream||new ia.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=(ta(),$(ea));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= -n.ssl.key)),ra.isIP(t)===0&&(c.servername=t);try{n.stream=u.connect(c)}catch(l){return n.emit("error", +var u=(na(),$(ra));let c={socket:n.stream};n.ssl!==!0&&(Object.assign(c,n.ssl),"key"in n.ssl&&(c.key= +n.ssl.key)),ia.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")}),gf(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& +"end",()=>{this.emit("end")}),vf(e,t=>{var n=t.name==="error"?"errorMessage":t.name;this._emitMessage&& this.emit("message",t),this.emit(n,t)})}requestSsl(){this.stream.write(K.requestSsl())}startup(e){this. stream.write(K.startup(e))}cancel(e,t){this._send(K.cancel(e,t))}password(e){this._send(K.password(e))}sendSASLInitialResponseMessage(e,t){ this._send(K.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(K.sendSCRAMClientFinalMessage( e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(K.query(e))}parse(e){ this._send(K.parse(e))}bind(e){this._send(K.bind(e))}execute(e){this._send(K.execute(e))}flush(){this. -stream.writable&&this.stream.write(na)}sync(){this._ending=!0,this._send(na),this._send(bf)}ref(){this. +stream.writable&&this.stream.write(sa)}sync(){this._ending=!0,this._send(sa),this._send(Ef)}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(xf,()=>{this.stream.end()})}close(e){this._send(K. +this.stream.end();return}return this.stream.write(Af,()=>{this.stream.end()})}close(e){this._send(K. close(e))}describe(e){this._send(K.describe(e))}sendCopyFromChunk(e){this._send(K.copyData(e))}endCopyFrom(){ -this._send(K.copyDone())}sendCopyFail(e){this._send(K.copyFail(e))}};a(pi,"Connection");var di=pi;ia. -exports=di});var aa=P((Fp,oa)=>{"use strict";p();var Sf=Pe().EventEmitter,Lp=(Pt(),$(Rt)),vf=Tt(),mi=So(),Ef=Lo(), -Af=er(),_f=ar(),sa=Go(),Cf=It(),If=yi(),wi=class wi extends Sf{constructor(e){super(),this.connectionParameters= -new _f(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database, +this._send(K.copyDone())}sendCopyFail(e){this._send(K.copyFail(e))}};a(yi,"Connection");var pi=yi;oa. +exports=pi});var ca=P((Dp,ua)=>{"use strict";p();var _f=Pe().EventEmitter,Up=(Rt(),$(Tt)),Cf=It(),wi=Eo(),If=ko(), +Tf=Xt(),Rf=ar(),aa=Ko(),Pf=Ct(),Bf=mi(),gi=class gi extends _f{constructor(e){super(),this.connectionParameters= +new Rf(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||S.Promise, -this._types=new Af(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= -!1,this._queryable=!0,this.connection=t.connection||new If({stream:t.stream,ssl:this.connectionParameters. +this._types=new Tf(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError= +!1,this._queryable=!0,this.connection=t.connection||new Bf({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||Cf.binary,this. +connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t.binary||Pf.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=>{w.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():Ef(this.connectionParameters, +password=this.password=null;e()}).catch(n=>{t.emit("error",n)}):this.password!==null?e():If(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=vf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ -this._checkPgPass(()=>{this.saslSession=mi.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( -this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){mi.continueSession( +()=>{let t=Cf.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){ +this._checkPgPass(()=>{this.saslSession=wi.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage( +this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){wi.continueSession( this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession. -response)}_handleAuthSASLFinal(e){mi.finalizeSession(this.saslSession,e.data),this.saslSession=null}_handleBackendKeyData(e){ +response)}_handleAuthSASLFinal(e){wi.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 sa(e,t,n),i.callback||(s=new this._Promise((l,f)=>{i.callback= +connectionParameters.query_timeout,i=new aa(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");w.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(wi,"Client");var dr=wi;dr.Query=sa;oa.exports=dr});var fa=P((Up,la)=>{"use strict";p();var Tf=Pe().EventEmitter,ua=a(function(){},"NOOP"),ca=a((r,e)=>{ -let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),xi=class xi{constructor(e,t,n){ -this.client=e,this.idleListener=t,this.timeoutId=n}};a(xi,"IdleItem");var gi=xi,Si=class Si{constructor(e){ -this.callback=e}};a(Si,"PendingItem");var ut=Si;function Rf(){throw new Error("Release called on cli\ -ent which has already been released to the pool.")}a(Rf,"throwOnDoubleRelease");function pr(r,e){if(e) +_Promise(t=>{this.connection.once("end",t)})}};a(gi,"Client");var dr=gi;dr.Query=aa;ua.exports=dr});var da=P((qp,ha)=>{"use strict";p();var Lf=Pe().EventEmitter,la=a(function(){},"NOOP"),fa=a((r,e)=>{ +let t=r.findIndex(e);return t===-1?void 0:r.splice(t,1)[0]},"removeWhere"),Si=class Si{constructor(e,t,n){ +this.client=e,this.idleListener=t,this.timeoutId=n}};a(Si,"IdleItem");var bi=Si,vi=class vi{constructor(e){ +this.callback=e}};a(vi,"PendingItem");var at=vi;function Ff(){throw new Error("Release called on cli\ +ent which has already been released to the pool.")}a(Ff,"throwOnDoubleRelease");function pr(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(pr,"promisify"); -function Pf(r,e){return a(function t(n){n.client=e,e.removeListener("error",t),e.on("error",()=>{r.log( +function kf(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(Pf,"makeIdleListener");var vi=class vi extends Tf{constructor(e,t){super(),this.options= +dleListener")}a(kf,"makeIdleListener");var Ei=class Ei extends Lf{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||Lt().Client,this.Promise= +this.log=this.options.log||function(){},this.Client=this.options.Client||t||Bt().Client,this.Promise= this.options.Promise||S.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,36 +1103,36 @@ 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=ca( +if(!this._isFull())return this.newClient(e);throw new Error("unexpected condition")}_remove(e){let t=fa( 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=pr(this.Promise,e),n=t. result;if(this._isFull()||this._idle.length){if(this._idle.length&&w.nextTick(()=>this._pulseQueue()), -!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new ut(t.callback)),n;let i=a((u,c,l)=>{ -clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new ut(i),o=setTimeout(()=>{ca(this._pendingQueue, +!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new at(t.callback)),n;let i=a((u,c,l)=>{ +clearTimeout(o),t.callback(u,c,l)},"queueCallback"),s=new at(i),o=setTimeout(()=>{fa(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 ut(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( -t);let n=Pf(this,t);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&& +newClient(new at(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push( +t);let n=kf(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,ua);else{if(this.log("new client connected"),this.options. +_pulseQueue(),e.timedOut||e.callback(o,void 0,la);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 ut((l,f,y)=>y()), +_expired.add(t),this._idle.findIndex(l=>l.client===t)!==-1&&this._acquireClient(t,new at((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,ua);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ -let n=!1;return i=>{n&&Rf(),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,la);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){ +let n=!1;return i=>{n&&Ff(),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 gi( +this.options.allowExitOnIdle&&s.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new bi( e,t,s)),this._pulseQueue()}query(e,t,n){if(typeof e=="function"){let s=pr(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=pr(this.Promise,n);return n=i.callback,this. @@ -1143,7 +1143,7 @@ if(this.log("ending"),this.ending){let n=new Error("Called end on pool more than this.Promise.reject(n)}this.ending=!0;let t=pr(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(vi,"Pool");var bi=vi;la.exports=bi});var ha={};we(ha,{default:()=>Bf});var Bf,da=te(()=>{"use strict";p();Bf={}});var pa=P((qp,Lf)=>{Lf.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javas\ +return this._clients.length}};a(Ei,"Pool");var xi=Ei;ha.exports=xi});var pa={};we(pa,{default:()=>Mf});var Mf,ya=te(()=>{"use strict";p();Mf={}});var ma=P((Hp,Uf)=>{Uf.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 wa=P((Qp,ma)=>{"use strict";p();var ya=Pe().EventEmitter,Ff=(Pt(),$(Rt)),Ei=Tt(),ct=ma.exports=function(r,e,t){ -ya.call(this),r=Ei.normalizeQueryConfig(r,e,t),this.text=r.text,this.values=r.values,this.name=r.name, +a178655"}});var ba=P(($p,ga)=>{"use strict";p();var wa=Pe().EventEmitter,Df=(Rt(),$(Tt)),Ai=It(),ut=ga.exports=function(r,e,t){ +wa.call(this),r=Ai.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))};Ff.inherits(ct,ya); -var kf={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ +this.on("newListener",function(n){n==="row"&&(this._emitRowEvents=!0)}.bind(this))};Df.inherits(ut,wa); +var Of={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"\ schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"\ -file",sourceLine:"line",sourceFunction:"routine"};ct.prototype.handleError=function(r){var e=this.native. -pq.resultErrorFields();if(e)for(var t in e){var n=kf[t]||t;r[n]=e[t]}this.callback?this.callback(r): -this.emit("error",r),this.state="error"};ct.prototype.then=function(r,e){return this._getPromise().then( -r,e)};ct.prototype.catch=function(r){return this._getPromise().catch(r)};ct.prototype._getPromise=function(){ +file",sourceLine:"line",sourceFunction:"routine"};ut.prototype.handleError=function(r){var e=this.native. +pq.resultErrorFields();if(e)for(var t in e){var n=Of[t]||t;r[n]=e[t]}this.callback?this.callback(r): +this.emit("error",r),this.state="error"};ut.prototype.then=function(r,e){return this._getPromise().then( +r,e)};ut.prototype.catch=function(r){return this._getPromise().catch(r)};ut.prototype._getPromise=function(){ return this._promise?this._promise:(this._promise=new Promise(function(r,e){this._once("end",r),this. -_once("error",e)}.bind(this)),this._promise)};ct.prototype.submit=function(r){this.state="running";var e=this; +_once("error",e)}.bind(this)),this._promise)};ut.prototype.submit=function(r){this.state="running";var e=this; this.native=r.native,r.native.arrayMode=this._arrayMode;var t=a(function(s,o,u){if(r.native.arrayMode= !1,v(function(){e.emit("_done")}),s)return e.handleError(s);e._emitRowEvents&&(u.length>1?o.forEach( (c,l)=>{c.forEach(f=>{e.emit("row",f,u[l])})}):o.forEach(function(c){e.emit("row",c,u)})),e.state="e\ nd",e.emit("end",u),e.callback&&e.callback(null,u)},"after");if(w.domain&&(t=w.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(Ei.prepareValue);if(r. +se conflicts and silent errors executing queries"));var n=(this.values||[]).map(Ai.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(Ei. -prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var Sa=P(($p,xa)=>{"use strict";p();var Mf=(da(),$(ha)),Uf=er(),Hp=pa(),ga=Pe().EventEmitter,Df=(Pt(),$(Rt)), -Of=ar(),ba=wa(),oe=xa.exports=function(r){ga.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. -_types=new Uf(r.types),this.native=new Mf({types:this._types}),this._queryQueue=[],this._ending=!1,this. -_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new Of(r);this. +this.values)){let s=new Error("Query values must be an array");return t(s)}var i=this.values.map(Ai. +prepareValue);r.native.query(this.text,i,t)}else r.native.query(this.text,t)}});var Ea=P((zp,va)=>{"use strict";p();var Nf=(ya(),$(pa)),qf=Xt(),Kp=ma(),xa=Pe().EventEmitter,Qf=(Rt(),$(Tt)), +jf=ar(),Sa=ba(),oe=va.exports=function(r){xa.call(this),r=r||{},this._Promise=r.Promise||S.Promise,this. +_types=new qf(r.types),this.native=new Nf({types:this._types}),this._queryQueue=[],this._ending=!1,this. +_connecting=!1,this._connected=!1,this._queryable=!0;var e=this.connectionParameters=new jf(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={}};oe.Query= -ba;Df.inherits(oe,ga);oe.prototype._errorAllQueries=function(r){let e=a(t=>{w.nextTick(()=>{t.native= +Sa;Qf.inherits(oe,xa);oe.prototype._errorAllQueries=function(r){let e=a(t=>{w.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};oe.prototype._connect=function(r){var e=this; if(this._connecting){w.nextTick(()=>r(new Error("Client has already been connected. You cannot reuse\ @@ -1194,7 +1194,7 @@ _pulseQueryQueue(!0),r()})})};oe.prototype.connect=function(r){if(r){this._conne _Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})};oe.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=="f\ unction")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 ba(r,e,t),!n.callback){let c,l;i=new this. +e);else if(s=this.connectionParameters.query_timeout,n=new Sa(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");w.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)=>{ @@ -1211,31 +1211,31 @@ in");return}this._activeQuery=e,e.submit(this);var t=this;e.once("_done",functio oe.prototype.cancel=function(r){this._activeQuery===r?this.native.cancel(function(){}):this._queryQueue. indexOf(r)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(r),1)};oe.prototype.ref=function(){}; oe.prototype.unref=function(){};oe.prototype.setTypeParser=function(r,e,t){return this._types.setTypeParser( -r,e,t)};oe.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var Ai=P((Kp,va)=>{"use strict";p();va.exports=Sa()});var Lt=P((Yp,Ft)=>{"use strict";p();var Nf=aa(),qf=It(),Qf=yi(),jf=fa(),{DatabaseError:Wf}=hi(),Hf=a( -r=>{var e;return e=class extends jf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),_i=a( -function(r){this.defaults=qf,this.Client=r,this.Query=this.Client.Query,this.Pool=Hf(this.Client),this. -_pools=[],this.Connection=Qf,this.types=At(),this.DatabaseError=Wf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< -"u"?Ft.exports=new _i(Ai()):(Ft.exports=new _i(Nf),Object.defineProperty(Ft.exports,"native",{configurable:!0, -enumerable:!1,get(){var r=null;try{r=new _i(Ai())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. -defineProperty(Ft.exports,"native",{value:r}),r}}))});p();p();Je();Br();p();var bu=Object.defineProperty,xu=Object.defineProperties,Su=Object.getOwnPropertyDescriptors,fs=Object. -getOwnPropertySymbols,vu=Object.prototype.hasOwnProperty,Eu=Object.prototype.propertyIsEnumerable,hs=a( -(r,e,t)=>e in r?bu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), -Au=a((r,e)=>{for(var t in e||(e={}))vu.call(e,t)&&hs(r,t,e[t]);if(fs)for(var t of fs(e))Eu.call(e,t)&& -hs(r,t,e[t]);return r},"__spreadValues"),_u=a((r,e)=>xu(r,Su(e)),"__spreadProps"),Cu=1008e3,ds=new Uint8Array( -new Uint16Array([258]).buffer)[0]===2,Iu=new TextDecoder,Lr=new TextEncoder,Qt=Lr.encode("0123456789\ -abcdef"),jt=Lr.encode("0123456789ABCDEF"),Tu=Lr.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ -stuvwxyz0123456789+/");var ps=Tu.slice();ps[62]=45;ps[63]=95;var ft,Wt;function Ru(r,{alphabet:e,scratchArr:t}={}){if(!ft)if(ft= -new Uint16Array(256),Wt=new Uint16Array(256),ds)for(let C=0;C<256;C++)ft[C]=Qt[C&15]<<8|Qt[C>>>4],Wt[C]= -jt[C&15]<<8|jt[C>>>4];else for(let C=0;C<256;C++)ft[C]=Qt[C&15]|Qt[C>>>4]<<8,Wt[C]=jt[C&15]|jt[C>>>4]<< +r,e,t)};oe.prototype.getTypeParser=function(r,e){return this._types.getTypeParser(r,e)}});var _i=P((Zp,Aa)=>{"use strict";p();Aa.exports=Ea()});var Bt=P((e0,Lt)=>{"use strict";p();var Wf=ca(),Hf=Ct(),$f=mi(),Gf=da(),{DatabaseError:Vf}=di(),Kf=a( +r=>{var e;return e=class extends Gf{constructor(n){super(n,r)}},a(e,"BoundPool"),e},"poolFactory"),Ci=a( +function(r){this.defaults=Hf,this.Client=r,this.Query=this.Client.Query,this.Pool=Kf(this.Client),this. +_pools=[],this.Connection=$f,this.types=Et(),this.DatabaseError=Vf},"PG");typeof w.env.NODE_PG_FORCE_NATIVE< +"u"?Lt.exports=new Ci(_i()):(Lt.exports=new Ci(Wf),Object.defineProperty(Lt.exports,"native",{configurable:!0, +enumerable:!1,get(){var r=null;try{r=new Ci(_i())}catch(e){if(e.code!=="MODULE_NOT_FOUND")throw e}return Object. +defineProperty(Lt.exports,"native",{value:r}),r}}))});p();p();Ye();Br();p();var Su=Object.defineProperty,vu=Object.defineProperties,Eu=Object.getOwnPropertyDescriptors,hs=Object. +getOwnPropertySymbols,Au=Object.prototype.hasOwnProperty,_u=Object.prototype.propertyIsEnumerable,ds=a( +(r,e,t)=>e in r?Su(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,"__defNormalProp"), +Cu=a((r,e)=>{for(var t in e||(e={}))Au.call(e,t)&&ds(r,t,e[t]);if(hs)for(var t of hs(e))_u.call(e,t)&& +ds(r,t,e[t]);return r},"__spreadValues"),Iu=a((r,e)=>vu(r,Eu(e)),"__spreadProps"),Tu=1008e3,ps=new Uint8Array( +new Uint16Array([258]).buffer)[0]===2,Ru=new TextDecoder,Lr=new TextEncoder,qt=Lr.encode("0123456789\ +abcdef"),Qt=Lr.encode("0123456789ABCDEF"),Pu=Lr.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr\ +stuvwxyz0123456789+/");var ys=Pu.slice();ys[62]=45;ys[63]=95;var lt,jt;function Bu(r,{alphabet:e,scratchArr:t}={}){if(!lt)if(lt= +new Uint16Array(256),jt=new Uint16Array(256),ps)for(let C=0;C<256;C++)lt[C]=qt[C&15]<<8|qt[C>>>4],jt[C]= +Qt[C&15]<<8|Qt[C>>>4];else for(let C=0;C<256;C++)lt[C]=qt[C&15]|qt[C>>>4]<<8,jt[C]=Qt[C&15]|Qt[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:ft,f=0,y=0,g;if(ds) +r.buffer,r.byteOffset,s),c=new Uint32Array(o.buffer,o.byteOffset,i),l=e==="upper"?jt:lt,f=0,y=0,g;if(ps) 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;ut[he(this. _mapKey.has(i)?this._mapKey.get(i):i)]=n),t}mapDecode(e,t){let n=this.decode(e);if(this._keyMap)switch(n. -constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return Cs( -()=>(Qr(),this?this.decode(e,t):pt.prototype.decode.call(gs,e,t)));je=t>-1?t:e.length,h=0,Mr=0,yt=0, -Gt=null,kr=Ss,j=null,x=e;try{X=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ +constructor.name){case"Array":return n.map(i=>this.decodeKeys(i))}return n}decode(e,t){if(x)return Is( +()=>(Qr(),this?this.decode(e,t):dt.prototype.decode.call(bs,e,t)));Qe=t>-1?t:e.length,h=0,Mr=0,pt=0, +$t=null,kr=vs,j=null,x=e;try{X=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){ throw x=null,e instanceof Uint8Array?n:new Error("Source must be a Uint8Array or Buffer but was a "+ -(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof pt){if(B=this,ne=this.sharedValues&& +(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof dt){if(B=this,ne=this.sharedValues&& (this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this. -structures)return N=this.structures,Ht();(!N||N.length>0)&&(N=[])}else B=gs,(!N||N.length>0)&&(N=[]), -ne=null;return Ht()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;mt=!0;let o=this?this.decode(e, -s):Wr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=j.postBundlePosition){let e=new Error("Unexpected bundle pos\ -ition");throw e.incomplete=!0,e}h=j.postBundlePosition,j=null}if(h==je)N=null,x=null,fe&&(fe=null);else if(h> -je){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!mt)throw new Error( +structures)return N=this.structures,Wt();(!N||N.length>0)&&(N=[])}else B=bs,(!N||N.length>0)&&(N=[]), +ne=null;return Wt()}decodeMultiple(e,t){let n,i=0;try{let s=e.length;yt=!0;let o=this?this.decode(e, +s):Wr.decode(e,s);if(t){if(t(o)===!1)return;for(;h=j.postBundlePosition){let e=new Error("Unexpected bundle pos\ +ition");throw e.incomplete=!0,e}h=j.postBundlePosition,j=null}if(h==Qe)N=null,x=null,fe&&(fe=null);else if(h> +Qe){let e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else if(!yt)throw new Error( "Data read, but end of buffer not reached");return r}catch(r){throw Qr(),(r instanceof RangeError||r. -message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a(Ht,"checkedRead");function L(){ -let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return Du();r=X. -getUint16(h),h+=2;break;case 26:if(e==7){let t=X.getFloat32(h);if(B.useFloat32>2){let n=Is[(x[h]&127)<< +message.startsWith("Unexpected end of buffer"))&&(r.incomplete=!0),r}}a(Wt,"checkedRead");function L(){ +let r=x[h++],e=r>>5;if(r=r&31,r>23)switch(r){case 24:r=x[h++];break;case 25:if(e==7)return Nu();r=X. +getUint16(h),h+=2;break;case 26:if(e==7){let t=X.getFloat32(h);if(B.useFloat32>2){let n=Ts[(x[h]&127)<< 1|x[h+1]>>7];return h+=4,(n*t+(t>0?.5:-.5)>>0)/n}return h+=4,t}if(r=X.getUint32(h),h+=4,e===1)return-1- r;break;case 27:if(e==7){let t=X.getFloat64(h);return h+=8,t}if(e>1){if(X.getUint32(h)>0)throw new Error( "JavaScript does not support arrays, maps, or strings with length over 4294967295");r=X.getUint32(h+ 4)}else B.int64AsNumber?(r=X.getUint32(h)*4294967296,r+=X.getUint32(h+4)):r=X.getBigUint64(h);h+=8;break;case 31: switch(e){case 2:case 3:throw new Error("Indefinite length not supported for byte or text strings");case 4: -let t=[],n,i=0;for(;(n=L())!=Ze;){if(i>=ht)throw new Error(`Array length exceeds ${ht}`);t[i++]=n}return e== +let t=[],n,i=0;for(;(n=L())!=Je;){if(i>=ft)throw new Error(`Array length exceeds ${ft}`);t[i++]=n}return e== 4?t:e==3?t.join(""):m.concat(t);case 5:let s;if(B.mapsAsObjects){let o={},u=0;if(B.keyMap)for(;(s=L())!= -Ze;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[he(B.decodeKey(s))]=L()}else for(;(s= -L())!=Ze;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[he(s)]=L()}return o}else{dt&& -(B.mapsAsObjects=!0,dt=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s=L())!=Ze;){if(u++>=Ae)throw new Error( -`Map size exceeds ${Ae}`);o.set(B.decodeKey(s),L())}}else{let u=0;for(;(s=L())!=Ze;){if(u++>=Ae)throw new Error( -`Map size exceeds ${Ae}`);o.set(s,L())}}return o}case 7:return Ze;default:throw new Error("Invalid m\ +Je;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[he(B.decodeKey(s))]=L()}else for(;(s= +L())!=Je;){if(u++>=Ae)throw new Error(`Property count exceeds ${Ae}`);o[he(s)]=L()}return o}else{ht&& +(B.mapsAsObjects=!0,ht=!1);let o=new Map;if(B.keyMap){let u=0;for(;(s=L())!=Je;){if(u++>=Ae)throw new Error( +`Map size exceeds ${Ae}`);o.set(B.decodeKey(s),L())}}else{let u=0;for(;(s=L())!=Je;){if(u++>=Ae)throw new Error( +`Map size exceeds ${Ae}`);o.set(s,L())}}return o}case 7:return Je;default:throw new Error("Invalid m\ ajor type for indefinite length "+e)}default:throw new Error("Unknown token "+r)}switch(e){case 0:return r;case 1: -return~r;case 2:return Uu(r);case 3:if(yt>=h)return Gt.slice(h-Vt,(h+=r)-Vt);if(yt==0&&je<140&&r<32){ -let i=r<16?Es(r):Mu(r);if(i!=null)return i}return ku(r);case 4:if(r>=ht)throw new Error(`Array lengt\ -h exceeds ${ht}`);let t=new Array(r);for(let i=0;i=Ae)throw new Error( -`Map size exceeds ${ht}`);if(B.mapsAsObjects){let i={};if(B.keyMap)for(let s=0;s=h)return $t.slice(h-Gt,(h+=r)-Gt);if(pt==0&&Qe<140&&r<32){ +let i=r<16?As(r):Du(r);if(i!=null)return i}return Uu(r);case 4:if(r>=ft)throw new Error(`Array lengt\ +h exceeds ${ft}`);let t=new Array(r);for(let i=0;i=Ae)throw new Error( +`Map size exceeds ${ft}`);if(B.mapsAsObjects){let i={};if(B.keyMap)for(let s=0;s=ms){let i=N[r&8191];if(i)return i.read||(i.read=Or(i)),i.read();if(r<65536){if(r== -Fu){let s=et(),o=L(),u=L();qr(o,u);let c={};if(B.keyMap)for(let l=2;l=ws){let i=N[r&8191];if(i)return i.read||(i.read=Or(i)),i.read();if(r<65536){if(r== +Mu){let s=Xe(),o=L(),u=L();qr(o,u);let c={};if(B.keyMap)for(let l=2;l23)switch(t){case 24:t=x[h++];break;case 25:t=X.getUint16(h),h+=2;break;case 26:t=X.getUint32( h),h+=4;break;default:throw new Error("Expected array header, but got "+x[h-1])}let n=this.compiledReader; -for(;n;){if(n.propertyCount===t)return n(L);n=n.next}if(this.slowReads++>=vs){let s=this.length==t?this: -this.slice(0,t);return n=B.keyMap?new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>bs.test( -o)?he(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>bs. +for(;n;){if(n.propertyCount===t)return n(L);n=n.next}if(this.slowReads++>=Es){let s=this.length==t?this: +this.slice(0,t);return n=B.keyMap?new Function("r","return {"+s.map(o=>B.decodeKey(o)).map(o=>xs.test( +o)?he(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"):new Function("r","return {"+s.map(o=>xs. test(o)?he(o)+":r()":"["+JSON.stringify(o)+"]:r()").join(",")+"}"),this.compiledReader&&(n.next=this. compiledReader),n.propertyCount=t,this.compiledReader=n,n(L)}let i={};if(B.keyMap)for(let s=0;s64&&Fr)return Fr.decode(x.subarray(h,h+=r));let t=h+ +if(r==null)return r+"";throw new Error("Invalid property name type "+typeof r)}a(he,"safeKey");var Uu=Nr;function Nr(r){let e;if(r<16&&(e=As(r)))return e;if(r>64&&Fr)return Fr.decode(x.subarray(h,h+=r));let t=h+ r,n=[];for(e="";h=t||(x[h]& 192)!==128)n.push(65533);else{let s=x[h++]&63;n.push((i&31)<<6|s)}else if((i&240)===224){let s=h=t||(s&192)!==128||i===224&&s<160||i===237&&s>=160)n.push(65533);else if(h++,h>=t||(x[h]&192)!== @@ -1310,9 +1310,9 @@ t?x[h]:0;if(i>244||h>=t||(s&192)!==128||i===240&&s<144||i===244&&s>=144)n.push(6 t||(x[h]&192)!==128)n.push(65533);else{let o=x[h++]&63;if(h>=t||(x[h]&192)!==128)n.push(65533);else{ let u=x[h++]&63,c=(i&7)<<18|(s&63)<<12|o<<6|u;c-=65536,n.push(c>>>10&1023|55296),n.push(56320|c&1023)}}}else n.push(65533);n.length>=4096&&(e+=V.apply(String,n),n.length=0)}return n.length>0&&(e+=V.apply(String, -n)),e}a(Nr,"readStringJS");var V=String.fromCharCode;function Mu(r){let e=h,t=new Array(r);for(let n=0;n< -r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return V.apply(String,t)}a(Mu,"longStringInJS"); -function Es(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return V(e)}}else{ +n)),e}a(Nr,"readStringJS");var V=String.fromCharCode;function Du(r){let e=h,t=new Array(r);for(let n=0;n< +r;n++){let i=x[h++];if((i&128)>0){h=e;return}t[n]=i}return V.apply(String,t)}a(Du,"longStringInJS"); +function As(r){if(r<4)if(r<2){if(r===0)return"";{let e=x[h++];if((e&128)>1){h-=1;return}return V(e)}}else{ let e=x[h++],t=x[h++];if((e&128)>0||(t&128)>0){h-=2;return}if(r<3)return V(e,t);let n=x[h++];if((n&128)> 0){h-=3;return}return V(e,t,n)}else{let e=x[h++],t=x[h++],n=x[h++],i=x[h++];if((e&128)>0||(t&128)>0|| (n&128)>0||(i&128)>0){h-=4;return}if(r<6){if(r===4)return V(e,t,n,i);{let s=x[h++];if((s&128)>0){h-= @@ -1325,63 +1325,63 @@ let y=x[h++];if((y&128)>0){h-=11;return}return V(e,t,n,i,s,o,u,c,l,f,y)}else{let g=x[h++];if((l&128)>0||(f&128)>0||(y&128)>0||(g&128)>0){h-=12;return}if(r<14){if(r===12)return V(e,t, n,i,s,o,u,c,l,f,y,g);{let E=x[h++];if((E&128)>0){h-=13;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E)}}else{ let E=x[h++],C=x[h++];if((E&128)>0||(C&128)>0){h-=14;return}if(r<15)return V(e,t,n,i,s,o,u,c,l,f,y,g, -E,C);let W=x[h++];if((W&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E,C,W)}}}}}a(Es,"short\ -StringInJS");function Uu(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( -h,h+=r)}a(Uu,"readBin");var As=new Float32Array(1),$t=new Uint8Array(As.buffer,0,4);function Du(){let r=x[h++],e=x[h++],t=(r& +E,C);let W=x[h++];if((W&128)>0){h-=15;return}return V(e,t,n,i,s,o,u,c,l,f,y,g,E,C,W)}}}}}a(As,"short\ +StringInJS");function Ou(r){return B.copyBuffers?Uint8Array.prototype.slice.call(x,h,h+=r):x.subarray( +h,h+=r)}a(Ou,"readBin");var _s=new Float32Array(1),Ht=new Uint8Array(_s.buffer,0,4);function Nu(){let r=x[h++],e=x[h++],t=(r& 127)>>2;if(t===31)return e||r&3?NaN:r&128?-1/0:1/0;if(t===0){let n=((r&3)<<8|e)/16777216;return r&128? --n:n}return $t[3]=r&128|(t>>1)+56,$t[2]=(r&7)<<5|e>>3,$t[1]=e<<5,$t[0]=0,As[0]}a(Du,"getFloat16");var hh=new Array( -4096);var Hr=class Hr{constructor(e,t){this.value=e,this.tag=t}};a(Hr,"Tag");var tt=Hr;q[0]=r=>new Date(r); +-n:n}return Ht[3]=r&128|(t>>1)+56,Ht[2]=(r&7)<<5|e>>3,Ht[1]=e<<5,Ht[0]=0,_s[0]}a(Nu,"getFloat16");var mh=new Array( +4096);var Hr=class Hr{constructor(e,t){this.value=e,this.tag=t}};a(Hr,"Tag");var et=Hr;q[0]=r=>new Date(r); q[1]=r=>new Date(Math.round(r*1e3));q[2]=r=>{let e=BigInt(0);for(let t=0,n=r.byteLength;tBigInt(-1)-q[2](r);q[4]=r=>+(r[1]+"e"+r[0]);q[5]=r=>r[1]*Math. exp(r[0]*Math.log(2));var qr=a((r,e)=>{r=r-57344;let t=N[r];t&&t.isShared&&((N.restoreStructures||(N. -restoreStructures=[]))[r]=t),N[r]=e,e.read=Or(e)},"recordDefinition");q[Bu]=r=>{let e=r.length,t=r[1]; +restoreStructures=[]))[r]=t),N[r]=e,e.read=Or(e)},"recordDefinition");q[Fu]=r=>{let e=r.length,t=r[1]; qr(r[0],t);let n={};for(let i=2;ij?j[0].slice( -j.position0,j.position0+=r):new tt(r,14);q[15]=r=>j?j[1].slice(j.position1,j.position1+=r):new tt(r, -15);var Ou={Error,RegExp};q[27]=r=>(Ou[r[0]]||Error)(r[1],r[2]);var _s=a(r=>{if(x[h++]!=132){let t=new Error( +j.position0,j.position0+=r):new et(r,14);q[15]=r=>j?j[1].slice(j.position1,j.position1+=r):new et(r, +15);var qu={Error,RegExp};q[27]=r=>(qu[r[0]]||Error)(r[1],r[2]);var Cs=a(r=>{if(x[h++]!=132){let t=new Error( "Packed values structure must be followed by a 4 element array");throw x.length{if(!ne)if(B.getShared)jr();else return new tt( -r,ws);if(typeof r=="number")return ne[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ +r(),r()},"packedTable");Cs.handlesRead=!0;q[51]=Cs;q[gs]=r=>{if(!ne)if(B.getShared)jr();else return new et( +r,gs);if(typeof r=="number")return ne[16+(r>=0?2*r:-2*r-1)];let e=new Error("No support for non-inte\ ger packed references yet");throw r===void 0&&(e.incomplete=!0),e};q[28]=r=>{fe||(fe=new Map,fe.id=0); let e=fe.id++,t=h,n=x[h],i;n>>5==4?i=[]:i={};let s={target:i};fe.set(e,s);let o=r();return s.used?(Object. getPrototypeOf(i)!==Object.getPrototypeOf(o)&&(h=t,i=o,fe.set(e,{target:i}),o=r()),Object.assign(i,o)): (s.target=o,o)};q[28].handlesRead=!0;q[29]=r=>{let e=fe.get(r);return e.used=!0,e.target};q[258]=r=>new Set( -r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,dt=!0),r())).handlesRead=!0;function Xe(r,e){return typeof r== -"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Xe,"combine");function Qe(){if(!ne) -if(B.getShared)jr();else throw new Error("No packed values available");return ne}a(Qe,"getPackedValu\ -es");var Nu=1399353956;Ur.push((r,e)=>{if(r>=225&&r<=255)return Xe(Qe().prefixes[r-224],e);if(r>=28704&& -r<=32767)return Xe(Qe().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return Xe(Qe().prefixes[r- -1879048192],e);if(r>=216&&r<=223)return Xe(e,Qe().suffixes[r-216]);if(r>=27647&&r<=28671)return Xe(e, -Qe().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return Xe(e,Qe().suffixes[r-1811939328]);if(r== -Nu)return{packedValues:ne,structures:N.slice(0),version:e};if(r==55799)return e});var qu=new Uint8Array( -new Uint16Array([1]).buffer)[0]==1,xs=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> +r);(q[259]=r=>(B.mapsAsObjects&&(B.mapsAsObjects=!1,ht=!0),r())).handlesRead=!0;function Ze(r,e){return typeof r== +"string"?r+e:r instanceof Array?r.concat(e):Object.assign({},r,e)}a(Ze,"combine");function qe(){if(!ne) +if(B.getShared)jr();else throw new Error("No packed values available");return ne}a(qe,"getPackedValu\ +es");var Qu=1399353956;Ur.push((r,e)=>{if(r>=225&&r<=255)return Ze(qe().prefixes[r-224],e);if(r>=28704&& +r<=32767)return Ze(qe().prefixes[r-28672],e);if(r>=1879052288&&r<=2147483647)return Ze(qe().prefixes[r- +1879048192],e);if(r>=216&&r<=223)return Ze(e,qe().suffixes[r-216]);if(r>=27647&&r<=28671)return Ze(e, +qe().suffixes[r-27639]);if(r>=1811940352&&r<=1879048191)return Ze(e,qe().suffixes[r-1811939328]);if(r== +Qu)return{packedValues:ne,structures:N.slice(0),version:e};if(r==55799)return e});var ju=new Uint8Array( +new Uint16Array([1]).buffer)[0]==1,Ss=[Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,typeof BigUint64Array> "u"?{name:"BigUint64Array"}:BigUint64Array,Int8Array,Int16Array,Int32Array,typeof BigInt64Array>"u"? -{name:"BigInt64Array"}:BigInt64Array,Float32Array,Float64Array],Qu=[64,68,69,70,71,72,77,78,79,85,86]; -for(let r=0;r{if(!r)throw new Error("Could not find typed array for code "+e); +2:n==8?3:0;q[i?e:e-4]=n==1||i==ju?o=>{if(!r)throw new Error("Could not find typed array for code "+e); return!B.copyBuffers&&(n===1||n===2&&!(o.byteOffset&1)||n===4&&!(o.byteOffset&3)||n===8&&!(o.byteOffset& 7))?new r(o.buffer,o.byteOffset,o.byteLength>>s):new r(Uint8Array.prototype.slice.call(o,0).buffer)}: o=>{if(!r)throw new Error("Could not find typed array for code "+e);let u=new DataView(o.buffer,o.byteOffset, o.byteLength),c=o.length>>s,l=new r(c),f=u[t];for(let y=0;y23)switch(r){case 24:r=x[h++];break;case 25:r=X.getUint16( -h),h+=2;break;case 26:r=X.getUint32(h),h+=4;break}return r}a(et,"readJustLength");function jr(){if(B. -getShared){let r=Cs(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ne= +Hu,"registerTypedArray");function $u(){let r=Xe(),e=h+L();for(let n=2;n23)switch(r){case 24:r=x[h++];break;case 25:r=X.getUint16( +h),h+=2;break;case 26:r=X.getUint32(h),h+=4;break}return r}a(Xe,"readJustLength");function jr(){if(B. +getShared){let r=Is(()=>(x=null,B.getShared()))||{},e=r.structures||[];B.sharedVersion=r.version,ne= B.sharedValues=r.packedValues,N===!0?B.structures=N=e:N.splice.apply(N,[0,e.length].concat(e))}}a(jr, -"loadShared");function Cs(r){let e=je,t=h,n=Mr,i=Vt,s=yt,o=Gt,u=kr,c=fe,l=j,f=new Uint8Array(x.slice( -0,je)),y=N,g=B,E=mt,C=r();return je=e,h=t,Mr=n,Vt=i,yt=s,Gt=o,kr=u,fe=c,j=l,x=f,mt=E,N=y,B=g,X=new DataView( -x.buffer,x.byteOffset,x.byteLength),C}a(Cs,"saveState");function Qr(){x=null,fe=null,N=null}a(Qr,"cl\ -earSource");var Is=new Array(147);for(let r=0;r<256;r++)Is[r]=+("1e"+Math.floor(45.15-r*.30103));var Wr=new Dr({ -useRecords:!1}),dh=Wr.decode,Ts=Wr.decodeMultiple;p();var Kt=class Kt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ +"loadShared");function Is(r){let e=Qe,t=h,n=Mr,i=Gt,s=pt,o=$t,u=kr,c=fe,l=j,f=new Uint8Array(x.slice( +0,Qe)),y=N,g=B,E=yt,C=r();return Qe=e,h=t,Mr=n,Gt=i,pt=s,$t=o,kr=u,fe=c,j=l,x=f,yt=E,N=y,B=g,X=new DataView( +x.buffer,x.byteOffset,x.byteLength),C}a(Is,"saveState");function Qr(){x=null,fe=null,N=null}a(Qr,"cl\ +earSource");var Ts=new Array(147);for(let r=0;r<256;r++)Ts[r]=+("1e"+Math.floor(45.15-r*.30103));var Wr=new Dr({ +useRecords:!1}),wh=Wr.decode,Rs=Wr.decodeMultiple;p();var Vt=class Vt{constructor(e,t){this.strings=e;this.values=t}toParameterizedQuery(e={query:"",params:[]}){ let{strings:t,values:n}=this;for(let i=0,s=t.length;iu.length!==0).map(u=>JSON.parse(u)):Ts(new Uint8Array(await r.arrayBuffer())),i=n.pop(); -if(i===null||typeof i!="object"||Array.isArray(i))throw new se("Neon internal error: streamed respon\ -se ended without a terminal message");if("message"in i)throw typeof i.message!="string"?new se("Neon\ - internal error: unexpected streamed response status"):yo(i);if(Object.keys(i).length!==0)throw new se( -"Neon internal error: unexpected streamed response status");let s=[],o;for(let u of n){Array.isArray( -u)||Be();let[c,...l]=u;switch(c){case Zc:o!==void 0&&Be(),o={fields:l,rows:[]};break;case Jc:if((o=== -void 0||l.length===0&&o.fields.length!==0)&&Be(),l.length===0){o.rows.push([]);break}let f=o.row??(o. -row=[]);for(let[y,g]of l.entries()){if((f.length>=o.fields.length||Array.isArray(g)&&(g.length!==1|| -typeof g[0]!="string")||!Array.isArray(g)&&g!==null&&typeof g!="string")&&Be(),Array.isArray(g)){(o. -partialText??(o.partialText=[])).push(g[0]);continue}g===null?(o.partialText!==void 0&&Be(),f.push(null)): -(o.partialText===void 0?f.push(g):(o.partialText.push(g),f.push(o.partialText.join(""))),o.partialText= -void 0),f.length===o.fields.length&&(y!==l.length-1&&Be(),o.rows.push(f),o.row=void 0)}break;case Xc: -(o===void 0||o.row!==void 0||o.partialText!==void 0||l.length!==2)&&Be(),s.push({fields:o.fields,rows:o. -rows,command:l[0],rowCount:l[1]}),o=void 0;break;default:Be()}}if(o!==void 0||s.length!==(t??1))throw new se( -"Neon internal error: incomplete streamed response");return t===void 0?s[0]:{results:s}}a(tl,"readSt\ -reamingResults");function rl(r){return r instanceof m?"\\x"+ys(r):r}a(rl,"encodeBuffersAsBytea");function lo(r){ -let{query:e,params:t}=r instanceof wt?r.toParameterizedQuery():r;return{query:e,params:t.map(n=>rl((0,po.prepareValue)( -n)))}}a(lo,"prepareQuery");function mo(r,{arrayMode:e,fullResults:t,fetchOptions:n,responseFormat:i, -isolationLevel:s,readOnly:o,deferrable:u,authToken:c,disableWarningInBrowsers:l}={}){if(!r)throw new Error( -"No database connection string was provided to `neon()`. Perhaps an environment variable has not bee\ -n set?");let f;try{f=Pr(r)}catch{throw new Error("Database connection string provided to `neon()` is\ - not a valid URL. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E,port:C,pathname:W}=f; -if(y!=="postgres:"&&y!=="postgresql:"||!g||!E||!W)throw new Error("Database connection string format\ - for `neon()` should be: postgresql://user@host.tld/dbname?option=value");function J(T,...b){if(!(Array. -isArray(T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can now be called\ - only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], options). F\ -or a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SELECT $1", [\ -value], options).');return new We(ye,new wt(T,b))}a(J,"templateFn"),J.query=(T,b,F)=>new We(ye,{query:T, -params:b??[]},F),J.unsafe=T=>new gt(T),J.transaction=async(T,b)=>{if(typeof T=="function"&&(T=T(J)), -!Array.isArray(T))throw new Error(co);T.forEach(H=>{if(!(H instanceof We))throw new Error(co)});let F=T. -map(H=>H.queryData),ae=T.map(H=>H.opts??{});return ye(F,ae,b)};async function ye(T,b,F){let{fetchEndpoint:ae, -fetchFunction:H}=xe,me=Array.isArray(T),Ce=me?{queries:T.map(ve=>lo(ve))}:lo(T),ce=n??{},M=i??"json", -Z=e??!1,Se=t??!1,Ie=s,ke=o,Me=u;F!==void 0&&(F.fetchOptions!==void 0&&(ce={...ce,...F.fetchOptions}), -F.arrayMode!==void 0&&(Z=F.arrayMode),F.fullResults!==void 0&&(Se=F.fullResults),F.responseFormat!== -void 0&&(M=F.responseFormat),F.isolationLevel!==void 0&&(Ie=F.isolationLevel),F.readOnly!==void 0&&(ke= -F.readOnly),F.deferrable!==void 0&&(Me=F.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!== +nr,"NeonDbError");var se=nr,lo="transaction() expects an array of queries, or a function returning a\ +n array of queries",Zc=["severity","code","detail","hint","position","internalPosition","internalQue\ +ry","where","schema","table","column","dataType","constraint","file","line","routine"],tr={json:"app\ +lication/json",jsonl:"application/vnd.neon.sql.v1+json","cbor-seq":"application/vnd.neon.sql.v1+cbor"}; +function Xc(r){switch(r.headers.get("Content-Type")?.split(";",1)[0].trim().toLowerCase()){case tr.json: +return"json";case tr.jsonl:return"jsonl";case tr["cbor-seq"]:return"cbor-seq";default:return}}a(Xc,"\ +getResponseFormat");function mo(r){let e=new se(r.message);for(let t of Zc)e[t]=r[t]??void 0;return e} +a(mo,"dbError");function rr(){throw new se("Neon internal error: unexpected streamed response messag\ +e")}a(rr,"unexpectedStreamingMessage");function wo(){throw new se("Neon internal error: incomplete s\ +treamed response")}a(wo,"incompleteStreamingResponse");function an(r){let e=r.next();return e.done&& +wo(),e.value}a(an,"nextStreamingMessage");function el(r){return r!==null&&typeof r=="object"&&!Array. +isArray(r)&&typeof r.command=="string"&&"rowCount"in r}a(el,"isQueryMessage");function tl(r,e){if(r=== +null||typeof r=="string")return r;(!Array.isArray(r)||r.length!==1||typeof r[0]!="string")&&rr();let t=[ +r[0]];for(;;){let n=an(e);if(typeof n=="string")return t.push(n),t.join("");(!Array.isArray(n)||n.length!== +1||typeof n[0]!="string")&&rr(),t.push(n[0])}}a(tl,"readStreamingValue");function rl(r,e){(r===null|| +typeof r!="object"||Array.isArray(r)||!Array.isArray(r.fields))&&rr();let t=r.fields,n=[];for(;;){let i=an( +e);if(el(i))return{fields:t,rows:n,command:i.command,rowCount:i.rowCount};if(t.length===0){(!Array.isArray( +i)||i.length!==0)&&rr(),n.push([]);continue}let s=[];for(let o=0;os.length!==0).map(s=>JSON.parse(s)):Rs(new Uint8Array(await r.arrayBuffer())),i=n.pop(); +if(i===null||typeof i!="object"||Array.isArray(i)||"fields"in i||"command"in i)throw new se("Neon in\ +ternal error: streamed response ended without a terminal message");if("message"in i)throw typeof i.message!= +"string"?new se("Neon internal error: unexpected streamed response status"):mo(i);if(Object.keys(i). +length!==0)throw new se("Neon internal error: unexpected streamed response status");return il(n,t)}a( +sl,"readStreamingResults");function ol(r){return r instanceof m?"\\x"+ms(r):r}a(ol,"encodeBuffersAsB\ +ytea");function fo(r){let{query:e,params:t}=r instanceof mt?r.toParameterizedQuery():r;return{query:e, +params:t.map(n=>ol((0,yo.prepareValue)(n)))}}a(fo,"prepareQuery");function go(r,{arrayMode:e,fullResults:t, +fetchOptions:n,responseFormat:i,isolationLevel:s,readOnly:o,deferrable:u,authToken:c,disableWarningInBrowsers:l}={}){ +if(!r)throw new Error("No database connection string was provided to `neon()`. Perhaps an environmen\ +t variable has not been set?");let f;try{f=Pr(r)}catch{throw new Error("Database connection string p\ +rovided to `neon()` is not a valid URL. Connection string: "+String(r))}let{protocol:y,username:g,hostname:E, +port:C,pathname:W}=f;if(y!=="postgres:"&&y!=="postgresql:"||!g||!E||!W)throw new Error("Database con\ +nection string format for `neon()` should be: postgresql://user@host.tld/dbname?option=value");function J(T,...b){ +if(!(Array.isArray(T)&&Array.isArray(T.raw)&&Array.isArray(b)))throw new Error('This function can no\ +w be called only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], \ +options). For a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SE\ +LECT $1", [value], options).');return new je(ye,new mt(T,b))}a(J,"templateFn"),J.query=(T,b,F)=>new je( +ye,{query:T,params:b??[]},F),J.unsafe=T=>new wt(T),J.transaction=async(T,b)=>{if(typeof T=="function"&& +(T=T(J)),!Array.isArray(T))throw new Error(lo);T.forEach(H=>{if(!(H instanceof je))throw new Error(lo)}); +let F=T.map(H=>H.queryData),ae=T.map(H=>H.opts??{});return ye(F,ae,b)};async function ye(T,b,F){let{ +fetchEndpoint:ae,fetchFunction:H}=xe,me=Array.isArray(T),Ce=me?{queries:T.map(ve=>fo(ve))}:fo(T),ce=n?? +{},M=i??"json",Z=e??!1,Se=t??!1,Ie=s,Fe=o,ke=u;F!==void 0&&(F.fetchOptions!==void 0&&(ce={...ce,...F. +fetchOptions}),F.arrayMode!==void 0&&(Z=F.arrayMode),F.fullResults!==void 0&&(Se=F.fullResults),F.responseFormat!== +void 0&&(M=F.responseFormat),F.isolationLevel!==void 0&&(Ie=F.isolationLevel),F.readOnly!==void 0&&(Fe= +F.readOnly),F.deferrable!==void 0&&(ke=F.deferrable)),b!==void 0&&!Array.isArray(b)&&b.fetchOptions!== void 0&&(ce={...ce,...b.fetchOptions}),b!==void 0&&!Array.isArray(b)&&b.responseFormat!==void 0&&(M= -b.responseFormat);let Ue=c;!Array.isArray(b)&&b?.authToken!==void 0&&(Ue=b.authToken);let yr=typeof ae== -"function"?ae(E,C,{jwtAuth:Ue!==void 0}):ae,De={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ -rue","Neon-Array-Mode":"true",Accept:rr[M]},Te=await nl(Ue);Te&&(De.Authorization=`Bearer ${Te}`),me&& -(Ie!==void 0&&(De["Neon-Batch-Isolation-Level"]=Ie),ke!==void 0&&(De["Neon-Batch-Read-Only"]=String( -ke)),Me!==void 0&&(De["Neon-Batch-Deferrable"]=String(Me))),l||xe.disableWarningInBrowsers||zt();let z; -try{z=await(H??fetch)(yr,{method:"POST",body:JSON.stringify(Ce),headers:De,...ce})}catch(ve){let ue=new se( -`Error connecting to database: ${ve}`);throw ue.sourceError=ve,ue}let He=el(z);if(z.ok){if(He===void 0) +b.responseFormat);let Me=c;!Array.isArray(b)&&b?.authToken!==void 0&&(Me=b.authToken);let yr=typeof ae== +"function"?ae(E,C,{jwtAuth:Me!==void 0}):ae,Ue={"Neon-Connection-String":r,"Neon-Raw-Text-Output":"t\ +rue","Neon-Array-Mode":"true",Accept:tr[M]},Te=await al(Me);Te&&(Ue.Authorization=`Bearer ${Te}`),me&& +(Ie!==void 0&&(Ue["Neon-Batch-Isolation-Level"]=Ie),Fe!==void 0&&(Ue["Neon-Batch-Read-Only"]=String( +Fe)),ke!==void 0&&(Ue["Neon-Batch-Deferrable"]=String(ke))),l||xe.disableWarningInBrowsers||Kt();let z; +try{z=await(H??fetch)(yr,{method:"POST",body:JSON.stringify(Ce),headers:Ue,...ce})}catch(ve){let ue=new se( +`Error connecting to database: ${ve}`);throw ue.sourceError=ve,ue}let We=Xc(z);if(z.ok){if(We===void 0) throw new se(`Neon internal error: unexpected response Content-Type: ${z.headers.get("Content-Type")?? -"missing"}`);let ve=He==="json"?await z.json():await tl(z,He,me?T.length:void 0);if(me){let ue=ve.results; +"missing"}`);let ve=We==="json"?await z.json():await sl(z,We,me?T.length:void 0);if(me){let ue=ve.results; if(!Array.isArray(ue))throw new se("Neon internal error: unexpected result format");return ue.map((mr,wr)=>{ -let gr=b[wr]??{},Ca=gr.arrayMode??Z,Ia=gr.fullResults??Se;return fo(mr,{arrayMode:Ca,fullResults:Ia, -types:gr.types})})}else{let ue=b??{},mr=ue.arrayMode??Z,wr=ue.fullResults??Se;return fo(ve,{arrayMode:mr, -fullResults:wr,types:ue.types})}}else{let{status:ve}=z;if(He==="json"){let ue=await z.json();throw yo( +let gr=b[wr]??{},Ta=gr.arrayMode??Z,Ra=gr.fullResults??Se;return ho(mr,{arrayMode:Ta,fullResults:Ra, +types:gr.types})})}else{let ue=b??{},mr=ue.arrayMode??Z,wr=ue.fullResults??Se;return ho(ve,{arrayMode:mr, +fullResults:wr,types:ue.types})}}else{let{status:ve}=z;if(We==="json"){let ue=await z.json();throw mo( ue)}else{let ue=await z.text();throw new se(`Server error (HTTP status ${ve}): ${ue}`)}}}return a(ye, -"execute"),J}a(mo,"neon");var an=class an{constructor(e,t,n){this.execute=e;this.queryData=t;this.opts= +"execute"),J}a(go,"neon");var un=class un{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(an,"NeonQueryPromise");var We=an;function fo(r,{arrayMode:e,fullResults:t,types:n}){let i=new ho.default( +a(un,"NeonQueryPromise");var je=un;function ho(r,{arrayMode:e,fullResults:t,types:n}){let i=new po.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(fo,"p\ -rocessQueryResult");async function nl(r){if(typeof r=="string")return r;if(typeof r=="function")try{ +o[f](l)])));return t?(r.viaNeonFetch=!0,r.rowAsArray=e,r.rows=u,r._parsers=o,r._types=i,r):u}a(ho,"p\ +rocessQueryResult");async function al(r){if(typeof r=="string")return r;if(typeof r=="function")try{ return await Promise.resolve(r())}catch(e){let t=new se("Error getting auth token.");throw e instanceof -Error&&(t=new se(`Error getting auth token: ${e.message}`)),t}}a(nl,"getAuthToken");p();var Aa=Oe(Lt());p();var Ea=Oe(Lt());var Ci=class Ci extends Ea.Client{constructor(t){super(t);this.config=t}get neonConfig(){return this. +Error&&(t=new se(`Error getting auth token: ${e.message}`)),t}}a(al,"getAuthToken");p();var Ca=De(Bt());p();var _a=De(Bt());var Ii=class Ii extends _a.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\ @@ -1488,12 +1490,12 @@ c=n.pipelineConnect==="password";if(!u&&!n.pipelineConnect)return o;let l=this.c "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|| -zt(),this._handleAuthCleartextPassword(),this._handleReadyForQuery()})}return o}async _handleAuthSASLContinue(t){ +Kt(),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(Te=>{if(!/^.=/.test(Te))throw new Error( -"SASL: Invalid attribute pair entry");let z=Te[0],He=Te.substring(2);return[z,He]})),c=u.r,l=u.s,f=u. +"SASL: Invalid attribute pair entry");let z=Te[0],We=Te.substring(2);return[z,We]})),c=u.r,l=u.s,f=u. i;if(!c||!/^[!-+--~]+$/.test(c))throw new Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unp\ rintable");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( @@ -1507,25 +1509,25 @@ from(ye.map((Te,z)=>ye[z]^J[z]));let b=ye,F=await n.importKey("raw",b,{name:"HMA 56"}},!1,["sign"]),ae=new Uint8Array(await n.sign("HMAC",F,E.encode("Client Key"))),H=await n.digest( "SHA-256",ae),me="n=*,r="+i.clientNonce,Ce="r="+c+",s="+l+",i="+y,ce="c=biws,r="+c,M=me+","+Ce+","+ce, Z=await n.importKey("raw",H,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Se=new Uint8Array(await n. -sign("HMAC",Z,E.encode(M))),Ie=m.from(ae.map((Te,z)=>ae[z]^Se[z])),ke=Ie.toString("base64");let Me=await n. -importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Ue=await n.sign("HMAC",Me,E.encode( -"Server Key")),yr=await n.importKey("raw",Ue,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var De=m. -from(await n.sign("HMAC",yr,E.encode(M)));i.message="SASLResponse",i.serverSignature=De.toString("ba\ -se64"),i.response=ce+",p="+ke,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; -a(Ci,"NeonClient");var kt=Ci;Je();var _a=Oe(ar());function $f(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($f,"promisify");var Ti=class Ti extends Aa.Pool{constructor(){ -super(...arguments);I(this,"Client",kt);I(this,"hasFetchUnsupportedListeners",!1);I(this,"addListene\ +sign("HMAC",Z,E.encode(M))),Ie=m.from(ae.map((Te,z)=>ae[z]^Se[z])),Fe=Ie.toString("base64");let ke=await n. +importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),Me=await n.sign("HMAC",ke,E.encode( +"Server Key")),yr=await n.importKey("raw",Me,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var Ue=m. +from(await n.sign("HMAC",yr,E.encode(M)));i.message="SASLResponse",i.serverSignature=Ue.toString("ba\ +se64"),i.response=ce+",p="+Fe,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}}; +a(Ii,"NeonClient");var Ft=Ii;Ye();var Ia=De(ar());function zf(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(zf,"promisify");var Ri=class Ri extends Ca.Pool{constructor(){ +super(...arguments);I(this,"Client",Ft);I(this,"hasFetchUnsupportedListeners",!1);I(this,"addListene\ r",this.on)}on(t,n){return t!=="error"&&(this.hasFetchUnsupportedListeners=!0),super.on(t,n)}query(t,n,i){ if(!xe.poolQueryViaFetch||this.hasFetchUnsupportedListeners||typeof t=="function")return super.query( -t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=$f(this.Promise,i);i=s.callback;try{let o=new _a.default( +t,n,i);typeof n=="function"&&(i=n,n=void 0);let s=zf(this.Promise,i);i=s.callback;try{let o=new Ia.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??[];mo(l,{fullResults:!0,arrayMode:t. +/${c(o.database)}`,f=typeof t=="string"?t:t.text,y=n??t.values??[];go(l,{fullResults:!0,arrayMode:t. rowMode==="array"}).query(f,y,{types:t.types??this.options?.types}).then(E=>i(void 0,E)).catch(E=>i( -E))}catch(o){i(o)}return s.result}};a(Ti,"NeonPool");var Ii=Ti;Je();var Mt=Oe(Lt()),l0="mjs";var export_DatabaseError=Mt.DatabaseError;var export_defaults=Mt.defaults;var export_escapeIdentifier=Mt.escapeIdentifier; -var export_escapeLiteral=Mt.escapeLiteral;var export_types=Mt.types;export{kt as Client,export_DatabaseError as DatabaseError, -se as NeonDbError,We as NeonQueryPromise,Ii as Pool,wt as SqlTemplate,gt as UnsafeRawSql,l0 as _bundleExt, +E))}catch(o){i(o)}return s.result}};a(Ri,"NeonPool");var Ti=Ri;Ye();var kt=De(Bt()),p0="mjs";var export_DatabaseError=kt.DatabaseError;var export_defaults=kt.defaults;var export_escapeIdentifier=kt.escapeIdentifier; +var export_escapeLiteral=kt.escapeLiteral;var export_types=kt.types;export{Ft as Client,export_DatabaseError as DatabaseError, +se as NeonDbError,je as NeonQueryPromise,Ti as Pool,mt as SqlTemplate,wt as UnsafeRawSql,p0 as _bundleExt, export_defaults as defaults,export_escapeIdentifier as escapeIdentifier,export_escapeLiteral as escapeLiteral, -mo as neon,xe as neonConfig,export_types as types,zt as warnIfBrowser}; +go as neon,xe as neonConfig,export_types as types,Kt as warnIfBrowser}; /*! Bundled license information: ieee754/index.js: diff --git a/src/httpQuery.ts b/src/httpQuery.ts index 0716656..3240cf6 100644 --- a/src/httpQuery.ts +++ b/src/httpQuery.ts @@ -100,10 +100,6 @@ const responseFormatContentTypes: Record = { 'cbor-seq': 'application/vnd.neon.sql.v1+cbor', }; -const ROW_MESSAGE = 0; -const COLUMNS_MESSAGE = 1; -const QUERY_MESSAGE = 2; - function getResponseFormat(response: Response): HTTPResponseFormat | undefined { const contentType = response.headers .get('Content-Type') @@ -135,6 +131,115 @@ function unexpectedStreamingMessage(): never { ); } +function incompleteStreamingResponse(): never { + throw new NeonDbError('Neon internal error: incomplete streamed response'); +} + +function nextStreamingMessage(messages: Iterator) { + const message = messages.next(); + if (message.done) incompleteStreamingResponse(); + return message.value; +} + +function isQueryMessage(message: any) { + return ( + message !== null && + typeof message === 'object' && + !Array.isArray(message) && + typeof message.command === 'string' && + 'rowCount' in message + ); +} + +function readStreamingValue(firstMessage: any, messages: Iterator) { + if (firstMessage === null || typeof firstMessage === 'string') { + return firstMessage; + } + if ( + !Array.isArray(firstMessage) || + firstMessage.length !== 1 || + typeof firstMessage[0] !== 'string' + ) { + unexpectedStreamingMessage(); + } + + const chunks = [firstMessage[0]]; + while (true) { + const message = nextStreamingMessage(messages); + if (typeof message === 'string') { + chunks.push(message); + return chunks.join(''); + } + if ( + !Array.isArray(message) || + message.length !== 1 || + typeof message[0] !== 'string' + ) { + unexpectedStreamingMessage(); + } + chunks.push(message[0]); + } +} + +function readStreamingQuery(firstMessage: any, messages: Iterator) { + if ( + firstMessage === null || + typeof firstMessage !== 'object' || + Array.isArray(firstMessage) || + !Array.isArray(firstMessage.fields) + ) { + unexpectedStreamingMessage(); + } + + const fields = firstMessage.fields; + const rows = []; + while (true) { + const firstRowMessage = nextStreamingMessage(messages); + if (isQueryMessage(firstRowMessage)) { + return { + fields, + rows, + command: firstRowMessage.command, + rowCount: firstRowMessage.rowCount, + }; + } + + if (fields.length === 0) { + if (!Array.isArray(firstRowMessage) || firstRowMessage.length !== 0) { + unexpectedStreamingMessage(); + } + rows.push([]); + continue; + } + + const row = []; + for (let column = 0; column < fields.length; column++) { + const firstValueMessage = + column === 0 ? firstRowMessage : nextStreamingMessage(messages); + row.push(readStreamingValue(firstValueMessage, messages)); + } + rows.push(row); + } +} + +function* readStreamingQueries(messages: any[]) { + const iterator = messages[Symbol.iterator](); + for (const firstMessage of iterator) { + yield readStreamingQuery(firstMessage, iterator); + } +} + +function assembleStreamingResults( + messages: any[], + batchQueryCount: number | undefined, +) { + const results = [...readStreamingQueries(messages)]; + if (results.length !== (batchQueryCount ?? 1)) { + incompleteStreamingResponse(); + } + return batchQueryCount === undefined ? results[0] : { results }; +} + async function readStreamingResults( response: Response, responseFormat: Exclude, @@ -149,7 +254,13 @@ async function readStreamingResults( : (decodeMultiple(new Uint8Array(await response.arrayBuffer())) as any[]); const end = messages.pop(); - if (end === null || typeof end !== 'object' || Array.isArray(end)) { + if ( + end === null || + typeof end !== 'object' || + Array.isArray(end) || + 'fields' in end || + 'command' in end + ) { throw new NeonDbError( 'Neon internal error: streamed response ended without a terminal message', ); @@ -168,107 +279,7 @@ async function readStreamingResults( ); } - const results = []; - let current: - | { - fields: any[]; - rows: any[]; - row?: any[]; - partialText?: string[]; - } - | undefined; - for (const message of messages) { - if (!Array.isArray(message)) { - unexpectedStreamingMessage(); - } - const [type, ...payload] = message; - switch (type) { - case COLUMNS_MESSAGE: - if (current !== undefined) { - unexpectedStreamingMessage(); - } - current = { fields: payload, rows: [] }; - break; - case ROW_MESSAGE: - if ( - current === undefined || - (payload.length === 0 && current.fields.length !== 0) - ) { - unexpectedStreamingMessage(); - } - if (payload.length === 0) { - current.rows.push([]); - break; - } - const row = (current.row ??= []); - for (const [index, value] of payload.entries()) { - if ( - row.length >= current.fields.length || - (Array.isArray(value) && - (value.length !== 1 || typeof value[0] !== 'string')) || - (!Array.isArray(value) && - value !== null && - typeof value !== 'string') - ) { - unexpectedStreamingMessage(); - } - - if (Array.isArray(value)) { - (current.partialText ??= []).push(value[0]); - continue; - } - - if (value === null) { - if (current.partialText !== undefined) { - unexpectedStreamingMessage(); - } - row.push(null); - } else { - if (current.partialText === undefined) { - row.push(value); - } else { - current.partialText.push(value); - row.push(current.partialText.join('')); - } - current.partialText = undefined; - } - - if (row.length === current.fields.length) { - if (index !== payload.length - 1) { - unexpectedStreamingMessage(); - } - current.rows.push(row); - current.row = undefined; - } - } - break; - case QUERY_MESSAGE: - if ( - current === undefined || - current.row !== undefined || - current.partialText !== undefined || - payload.length !== 2 - ) { - unexpectedStreamingMessage(); - } - results.push({ - fields: current.fields, - rows: current.rows, - command: payload[0], - rowCount: payload[1], - }); - current = undefined; - break; - default: - unexpectedStreamingMessage(); - } - } - - if (current !== undefined || results.length !== (batchQueryCount ?? 1)) { - throw new NeonDbError('Neon internal error: incomplete streamed response'); - } - - return batchQueryCount === undefined ? results[0] : { results }; + return assembleStreamingResults(messages, batchQueryCount); } function encodeBuffersAsBytea(value: unknown): unknown { diff --git a/tests/cli/httpStreaming.test.ts b/tests/cli/httpStreaming.test.ts index 4a0d08e..6ea9a8a 100644 --- a/tests/cli/httpStreaming.test.ts +++ b/tests/cli/httpStreaming.test.ts @@ -28,17 +28,22 @@ const labelFields = [ }, ]; -const successMessages = [[1, ...fields], [0, '42'], [2, 'SELECT', 1], {}]; +const successMessages = [ + { fields }, + '42', + { command: 'SELECT', rowCount: 1 }, + {}, +]; const batchMessages = [ - [1, ...fields], - [0, '42'], - [0, '43'], - [2, 'SELECT', 2], - [1, ...labelFields], - [0, 'hello'], - [0, 'world'], - [2, 'SELECT', 2], + { fields }, + '42', + '43', + { command: 'SELECT', rowCount: 2 }, + { fields: labelFields }, + 'hello', + 'world', + { command: 'SELECT', rowCount: 2 }, {}, ]; @@ -200,25 +205,37 @@ test.each([ accept: 'application/vnd.neon.sql.v1+json', encode: (messages: unknown[]) => messages.map((message) => JSON.stringify(message)).join('\n'), + messages: [ + { fields: [fields[0], labelFields[0]] }, + ['4'], + '2', + 'hello', + '43', + ['world'], + '', + { command: 'SELECT', rowCount: 2 }, + {}, + ], }, { responseFormat: 'cbor-seq' as const, accept: 'application/vnd.neon.sql.v1+cbor', encode: cborSequence, + messages: [ + { fields: [fields[0], labelFields[0]] }, + ['4'], + '2', + 'hello', + '43', + ['world'], + '', + { command: 'SELECT', rowCount: 2 }, + {}, + ], }, ])( 'assembles partial rows from $responseFormat responses', - async ({ responseFormat, accept, encode }) => { - const messages = [ - [1, fields[0], labelFields[0]], - [0, ['4']], - [0, '2', 'hello'], - [0, '43'], - [0, ['world']], - [0, ''], - [2, 'SELECT', 2], - {}, - ]; + async ({ responseFormat, accept, encode, messages }) => { mockResponse(encode(messages), accept); const sql = neon(connectionString, { responseFormat, fullResults: true }); @@ -234,23 +251,31 @@ test.each([ ); test.each([ - [[[null]], 'partial NULL'], - [[['unfinished']], 'unfinished row'], -])('rejects invalid streamed row fragments: %s', async (row, _description) => { - const messages = [[1, ...fields], [0, ...row], [2, 'SELECT', 1], {}]; - mockResponse( - messages.map((message) => JSON.stringify(message)).join('\n'), - 'application/vnd.neon.sql.v1+json', - ); + [[null], 'partial NULL'], + [['unfinished'], 'unfinished row'], +])( + 'rejects invalid streamed row fragments: %s', + async (fragment, _description) => { + const messages = [ + { fields }, + fragment, + { command: 'SELECT', rowCount: 1 }, + {}, + ]; + mockResponse( + messages.map((message) => JSON.stringify(message)).join('\n'), + 'application/vnd.neon.sql.v1+json', + ); - const sql = neon(connectionString, { responseFormat: 'jsonl' }); - await expect(sql`SELECT 42 AS answer`).rejects.toThrow( - 'unexpected streamed response message', - ); -}); + const sql = neon(connectionString, { responseFormat: 'jsonl' }); + await expect(sql`SELECT 42 AS answer`).rejects.toThrow( + 'unexpected streamed response message', + ); + }, +); test('decodes zero-column rows', async () => { - const messages = [[1], [0], [2, 'SELECT', 1], {}]; + const messages = [{ fields: [] }, [], { command: 'SELECT', rowCount: 1 }, {}]; mockResponse( messages.map((message) => JSON.stringify(message)).join('\n'), 'application/vnd.neon.sql.v1+json', @@ -263,6 +288,39 @@ test('decodes zero-column rows', async () => { await expect(sql`SELECT`).resolves.toStrictEqual([[]]); }); +test('decodes multiple zero-column CBOR rows', async () => { + const messages = [ + { fields: [] }, + [], + [], + [], + { command: 'SELECT', rowCount: 3 }, + {}, + ]; + mockResponse(cborSequence(messages), 'application/vnd.neon.sql.v1+cbor'); + + const sql = neon(connectionString, { + responseFormat: 'cbor-seq', + arrayMode: true, + }); + await expect(sql`SELECT FROM generate_series(1, 3)`).resolves.toStrictEqual([ + [], + [], + [], + ]); +}); + +test('does not confuse affected rows with zero-column CBOR rows', async () => { + const messages = [{ fields: [] }, { command: 'UPDATE', rowCount: 3 }, {}]; + mockResponse(cborSequence(messages), 'application/vnd.neon.sql.v1+cbor'); + + const sql = neon(connectionString, { + responseFormat: 'cbor-seq', + arrayMode: true, + }); + await expect(sql`UPDATE example SET value = 1`).resolves.toStrictEqual([]); +}); + test('allows a streaming format per query', async () => { mockResponse( successMessages.map((message) => JSON.stringify(message)).join('\n'), @@ -290,8 +348,8 @@ test('returns terminal streamed errors as database errors', async () => { test('discards partial rows before returning terminal errors', async () => { mockResponse( cborSequence([ - [1, ...fields], - [0, ['partial']], + { fields }, + ['partial'], { message: 'division by zero', code: '22012' }, ]), 'application/vnd.neon.sql.v1+cbor', From bbf88e5f81c7c5b94e7818f22eee0ea27c8822e5 Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Wed, 19 Aug 2026 07:58:09 +0100 Subject: [PATCH 7/7] Document SQL streaming formats --- CONFIG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CONFIG.md b/CONFIG.md index d0027b0..9c7348d 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -119,6 +119,24 @@ const rows = await sql.query('SELECT * FROM posts WHERE id = $1', [postId], { clearTimeout(timeout); ``` +### `responseFormat: 'json' | 'jsonl' | 'cbor-seq'` + +The `responseFormat` option selects the wire format used by SQL-over-HTTP. The +default, `json`, uses the existing `application/json` response. The experimental +`jsonl` and `cbor-seq` formats request a sequence of independently encoded +messages using the versioned `application/vnd.neon.sql.v1+json` and +`application/vnd.neon.sql.v1+cbor` media types, and buffer the complete +response before decoding it. + +```typescript +const sql = neon(process.env.DATABASE_URL, { + responseFormat: 'cbor-seq', +}); +``` + +Streaming response formats support both single queries and `transaction()` +batches. + ### `types: CustomTypesConfig` The `types` option can be passed to `neon(...)` to override the default PostgreSQL type parsers provided by `PgTypes`. This is useful if you want to define custom parsing behavior for specific PostgreSQL data types, allowing you to control how data is converted when retrieved from the database. Learn more in the [PgTypes official documentation](https://github.com/brianc/node-pg-types).