@superinterface/server 1.0.20 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/eslint/.cache_btwyo7 +1 -1
  5. package/.next/fallback-build-manifest.json +2 -2
  6. package/.next/server/app/_not-found.html +1 -1
  7. package/.next/server/app/_not-found.rsc +1 -1
  8. package/.next/server/app/index.html +1 -1
  9. package/.next/server/app/index.rsc +1 -1
  10. package/.next/server/chunks/[root-of-the-server]__228bff78._.js +10 -10
  11. package/.next/server/chunks/[root-of-the-server]__228bff78._.js.map +1 -1
  12. package/.next/server/chunks/[root-of-the-server]__3307123c._.js +10 -10
  13. package/.next/server/chunks/[root-of-the-server]__3307123c._.js.map +1 -1
  14. package/.next/server/chunks/[root-of-the-server]__50c5f12c._.js +10 -10
  15. package/.next/server/chunks/[root-of-the-server]__50c5f12c._.js.map +1 -1
  16. package/.next/server/chunks/[root-of-the-server]__6b8ba839._.js +10 -10
  17. package/.next/server/chunks/[root-of-the-server]__6b8ba839._.js.map +1 -1
  18. package/.next/server/chunks/[root-of-the-server]__e7819e95._.js +10 -10
  19. package/.next/server/chunks/[root-of-the-server]__e7819e95._.js.map +1 -1
  20. package/.next/server/chunks/[root-of-the-server]__f0dfab03._.js +10 -10
  21. package/.next/server/chunks/[root-of-the-server]__f0dfab03._.js.map +1 -1
  22. package/.next/server/chunks/[root-of-the-server]__ff90af03._.js +10 -10
  23. package/.next/server/chunks/[root-of-the-server]__ff90af03._.js.map +1 -1
  24. package/.next/server/pages/404.html +1 -1
  25. package/.next/server/pages/500.html +1 -1
  26. package/.next/trace +1 -1
  27. package/dist/lib/prisma/index.d.ts +1 -2
  28. package/dist/lib/prisma/index.d.ts.map +1 -1
  29. package/dist/lib/prisma/index.js +32 -6
  30. package/package.json +1 -1
  31. /package/.next/static/{Ggpv5PXa7pPyxP1NXVbh6 → F76hCvc-i5ZvQskAGNyuc}/_buildManifest.js +0 -0
  32. /package/.next/static/{Ggpv5PXa7pPyxP1NXVbh6 → F76hCvc-i5ZvQskAGNyuc}/_clientMiddlewareManifest.json +0 -0
  33. /package/.next/static/{Ggpv5PXa7pPyxP1NXVbh6 → F76hCvc-i5ZvQskAGNyuc}/_ssgManifest.js +0 -0
@@ -16,23 +16,23 @@ module.exports=[61724,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/ap
16
16
  `)}}},89193,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{RequestCookies:function(){return n.RequestCookies},ResponseCookies:function(){return n.ResponseCookies},stringifyCookie:function(){return n.stringifyCookie}});let n=e.r(18780)},60306,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{INTERNALS:function(){return a},NextRequest:function(){return u}});let n=e.r(95340),i=e.r(68794),s=e.r(31048),o=e.r(89193),a=Symbol("internal request");class u extends Request{constructor(e,t={}){let r="string"!=typeof e&&"url"in e?e.url:String(e);(0,i.validateURL)(r),t.body&&"half"!==t.duplex&&(t.duplex="half"),e instanceof Request?super(e,t):super(r,t);let s=new n.NextURL(r,{headers:(0,i.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:t.nextConfig});this[a]={cookies:new o.RequestCookies(this.headers),nextUrl:s,url:s.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[a].cookies}get nextUrl(){return this[a].nextUrl}get page(){throw new s.RemovedPageError}get ua(){throw new s.RemovedUAError}get url(){return this[a].url}}},99667,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ReflectAdapter",{enumerable:!0,get:function(){return n}});class n{static get(e,t,r){let n=Reflect.get(e,t,r);return"function"==typeof n?n.bind(e):n}static set(e,t,r,n){return Reflect.set(e,t,r,n)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}},24173,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"NextResponse",{enumerable:!0,get:function(){return h}});let n=e.r(89193),i=e.r(95340),s=e.r(68794),o=e.r(99667),a=e.r(89193),u=Symbol("internal response"),c=new Set([301,302,303,307,308]);function l(e,t){var r;if(null==e||null==(r=e.request)?void 0:r.headers){if(!(e.request.headers instanceof Headers))throw Object.defineProperty(Error("request.headers must be an instance of Headers"),"__NEXT_ERROR_CODE",{value:"E119",enumerable:!1,configurable:!0});let r=[];for(let[n,i]of e.request.headers)t.set("x-middleware-request-"+n,i),r.push(n);t.set("x-middleware-override-headers",r.join(","))}}class h extends Response{constructor(e,t={}){super(e,t);let r=this.headers,c=new Proxy(new a.ResponseCookies(r),{get(e,i,s){switch(i){case"delete":case"set":return(...s)=>{let o=Reflect.apply(e[i],e,s),u=new Headers(r);return o instanceof a.ResponseCookies&&r.set("x-middleware-set-cookie",o.getAll().map(e=>(0,n.stringifyCookie)(e)).join(",")),l(t,u),o};default:return o.ReflectAdapter.get(e,i,s)}}});this[u]={cookies:c,url:t.url?new i.NextURL(t.url,{headers:(0,s.toNodeOutgoingHttpHeaders)(r),nextConfig:t.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[u].cookies}static json(e,t){let r=Response.json(e,t);return new h(r.body,r)}static redirect(e,t){let r="number"==typeof t?t:(null==t?void 0:t.status)??307;if(!c.has(r))throw Object.defineProperty(RangeError('Failed to execute "redirect" on "response": Invalid status code'),"__NEXT_ERROR_CODE",{value:"E529",enumerable:!1,configurable:!0});let n="object"==typeof t?t:{},i=new Headers(null==n?void 0:n.headers);return i.set("Location",(0,s.validateURL)(e)),new h(null,{...n,headers:i,status:r})}static rewrite(e,t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-rewrite",(0,s.validateURL)(e)),l(t,r),new h(null,{...t,headers:r})}static next(e){let t=new Headers(null==e?void 0:e.headers);return t.set("x-middleware-next","1"),l(e,t),new h(null,{...e,headers:t})}}},17878,(e,t,r)=>{"use strict";function n(){throw Object.defineProperty(Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead'),"__NEXT_ERROR_CODE",{value:"E183",enumerable:!1,configurable:!0})}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ImageResponse",{enumerable:!0,get:function(){return n}})},35235,(e,t,r)=>{(()=>{var r={226:function(t,r){!function(n,i){"use strict";var s="function",o="undefined",a="object",u="string",c="major",l="model",h="name",f="type",d="vendor",p="version",g="architecture",m="console",y="mobile",b="tablet",v="smarttv",_="wearable",w="embedded",E="Amazon",S="Apple",R="ASUS",x="BlackBerry",A="Browser",T="Chrome",P="Firefox",O="Google",C="Huawei",I="Microsoft",N="Motorola",L="Opera",M="Samsung",D="Sharp",k="Sony",B="Xiaomi",j="Zebra",U="Facebook",F="Chromium OS",q="Mac OS",$=function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},G=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},H=function(e,t){return typeof e===u&&-1!==V(t).indexOf(V(e))},V=function(e){return e.toLowerCase()},W=function(e,t){if(typeof e===u)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},Q=function(e,t){for(var r,n,o,u,c,l,h=0;h<t.length&&!c;){var f=t[h],d=t[h+1];for(r=n=0;r<f.length&&!c&&f[r];)if(c=f[r++].exec(e))for(o=0;o<d.length;o++)l=c[++n],typeof(u=d[o])===a&&u.length>0?2===u.length?typeof u[1]==s?this[u[0]]=u[1].call(this,l):this[u[0]]=u[1]:3===u.length?typeof u[1]!==s||u[1].exec&&u[1].test?this[u[0]]=l?l.replace(u[1],u[2]):void 0:this[u[0]]=l?u[1].call(this,l,u[2]):void 0:4===u.length&&(this[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):i):this[u]=l||i;h+=2}},Y=function(e,t){for(var r in t)if(typeof t[r]===a&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(H(t[r][n],e))return"?"===r?i:r}else if(H(t[r],e))return"?"===r?i:r;return e},X={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},z={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,p],[/opios[\/ ]+([\w\.]+)/i],[p,[h,L+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[h,L]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[h,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[h,"UC"+A]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[p,[h,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[h,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+A],p],[/\bfocus\/([\w\.]+)/i],[p,[h,P+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[h,L+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[h,L+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[h,"MIUI "+A]],[/fxios\/([-\w\.]+)/i],[p,[h,P]],[/\bqihu|(qi?ho?o?|360)browser/i],[[h,"360 "+A]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1 "+A],p],[/(comodo_dragon)\/([\w\.]+)/i],[[h,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[h,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,U],p],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[h,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[h,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[h,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[h,T+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,T+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[h,"Android "+A]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[p,Y,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[h,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[h,P+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[h,p],[/(cobalt)\/([\w\.]+)/i],[h,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,V]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[d,M],[f,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[d,M],[f,y]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[d,S],[f,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[d,S],[f,b]],[/(macintosh);/i],[l,[d,S]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[d,D],[f,y]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[d,C],[f,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[d,C],[f,y]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[d,B],[f,y]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[d,B],[f,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[d,"OPPO"],[f,y]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[d,"Vivo"],[f,y]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[d,"Realme"],[f,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[d,N],[f,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[d,N],[f,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[d,"LG"],[f,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[d,"LG"],[f,y]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[d,"Lenovo"],[f,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[d,"Nokia"],[f,y]],[/(pixel c)\b/i],[l,[d,O],[f,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[d,O],[f,y]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[d,k],[f,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[d,k],[f,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[d,"OnePlus"],[f,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[d,E],[f,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[d,E],[f,y]],[/(playbook);[-\w\),; ]+(rim)/i],[l,d,[f,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[d,x],[f,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[d,R],[f,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[d,R],[f,y]],[/(nexus 9)/i],[l,[d,"HTC"],[f,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[l,/_/g," "],[f,y]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[d,"Acer"],[f,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[d,"Meizu"],[f,y]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,l,[f,y]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,l,[f,b]],[/(surface duo)/i],[l,[d,I],[f,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[d,"Fairphone"],[f,y]],[/(u304aa)/i],[l,[d,"AT&T"],[f,y]],[/\bsie-(\w*)/i],[l,[d,"Siemens"],[f,y]],[/\b(rct\w+) b/i],[l,[d,"RCA"],[f,b]],[/\b(venue[\d ]{2,7}) b/i],[l,[d,"Dell"],[f,b]],[/\b(q(?:mv|ta)\w+) b/i],[l,[d,"Verizon"],[f,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[d,"Barnes & Noble"],[f,b]],[/\b(tm\d{3}\w+) b/i],[l,[d,"NuVision"],[f,b]],[/\b(k88) b/i],[l,[d,"ZTE"],[f,b]],[/\b(nx\d{3}j) b/i],[l,[d,"ZTE"],[f,y]],[/\b(gen\d{3}) b.+49h/i],[l,[d,"Swiss"],[f,y]],[/\b(zur\d{3}) b/i],[l,[d,"Swiss"],[f,b]],[/\b((zeki)?tb.*\b) b/i],[l,[d,"Zeki"],[f,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],l,[f,b]],[/\b(ns-?\w{0,9}) b/i],[l,[d,"Insignia"],[f,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[d,"NextBook"],[f,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],l,[f,y]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],l,[f,y]],[/\b(ph-1) /i],[l,[d,"Essential"],[f,y]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[d,"Envizen"],[f,b]],[/\b(trio[-\w\. ]+) b/i],[l,[d,"MachSpeed"],[f,b]],[/\btu_(1491) b/i],[l,[d,"Rotor"],[f,b]],[/(shield[\w ]+) b/i],[l,[d,"Nvidia"],[f,b]],[/(sprint) (\w+)/i],[d,l,[f,y]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[d,I],[f,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[d,j],[f,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[d,j],[f,y]],[/smart-tv.+(samsung)/i],[d,[f,v]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[d,M],[f,v]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,"LG"],[f,v]],[/(apple) ?tv/i],[d,[l,S+" TV"],[f,v]],[/crkey/i],[[l,T+"cast"],[d,O],[f,v]],[/droid.+aft(\w)( bui|\))/i],[l,[d,E],[f,v]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[d,D],[f,v]],[/(bravia[\w ]+)( bui|\))/i],[l,[d,k],[f,v]],[/(mitv-\w{5}) bui/i],[l,[d,B],[f,v]],[/Hbbtv.*(technisat) (.*);/i],[d,l,[f,v]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,W],[l,W],[f,v]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[f,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,l,[f,m]],[/droid.+; (shield) bui/i],[l,[d,"Nvidia"],[f,m]],[/(playstation [345portablevi]+)/i],[l,[d,k],[f,m]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[d,I],[f,m]],[/((pebble))app/i],[d,l,[f,_]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[d,S],[f,_]],[/droid.+; (glass) \d/i],[l,[d,O],[f,_]],[/droid.+; (wt63?0{2,3})\)/i],[l,[d,j],[f,_]],[/(quest( 2| pro)?)/i],[l,[d,U],[f,_]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[f,w]],[/(aeobc)\b/i],[l,[d,E],[f,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[f,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[f,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[f,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[f,y]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[h,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[h,[p,Y,X]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[h,"Windows"],[p,Y,X]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,q],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,h],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[h,p],[/\(bb(10);/i],[p,[h,x]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[h,P+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[h,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[h,T+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,F],p],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,p],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,p]]},K=function(e,t){if(typeof e===a&&(t=e,e=i),!(this instanceof K))return new K(e,t).getResult();var r=typeof n!==o&&n.navigator?n.navigator:i,m=e||(r&&r.userAgent?r.userAgent:""),v=r&&r.userAgentData?r.userAgentData:i,_=t?$(z,t):z,w=r&&r.userAgent==m;return this.getBrowser=function(){var e,t={};return t[h]=i,t[p]=i,Q.call(t,m,_.browser),t[c]=typeof(e=t[p])===u?e.replace(/[^\d\.]/g,"").split(".")[0]:i,w&&r&&r.brave&&typeof r.brave.isBrave==s&&(t[h]="Brave"),t},this.getCPU=function(){var e={};return e[g]=i,Q.call(e,m,_.cpu),e},this.getDevice=function(){var e={};return e[d]=i,e[l]=i,e[f]=i,Q.call(e,m,_.device),w&&!e[f]&&v&&v.mobile&&(e[f]=y),w&&"Macintosh"==e[l]&&r&&typeof r.standalone!==o&&r.maxTouchPoints&&r.maxTouchPoints>2&&(e[l]="iPad",e[f]=b),e},this.getEngine=function(){var e={};return e[h]=i,e[p]=i,Q.call(e,m,_.engine),e},this.getOS=function(){var e={};return e[h]=i,e[p]=i,Q.call(e,m,_.os),w&&!e[h]&&v&&"Unknown"!=v.platform&&(e[h]=v.platform.replace(/chrome os/i,F).replace(/macos/i,q)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return m},this.setUA=function(e){return m=typeof e===u&&e.length>350?W(e,350):e,this},this.setUA(m),this};if(K.VERSION="1.0.35",K.BROWSER=G([h,p,c]),K.CPU=G([g]),K.DEVICE=G([l,d,f,m,y,v,b,_,w]),K.ENGINE=K.OS=G([h,p]),typeof r!==o)t.exports&&(r=t.exports=K),r.UAParser=K;else if(typeof define===s&&define.amd)e.r,void 0!==K&&e.v(K);else typeof n!==o&&(n.UAParser=K);var J=typeof n!==o&&(n.jQuery||n.Zepto);if(J&&!J.ua){var Z=new K;J.ua=Z.getResult(),J.ua.get=function(){return Z.getUA()},J.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var r in t)J.ua[r]=t[r]}}}(this)}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={exports:{}},o=!0;try{r[e].call(s.exports,s,s.exports,i),o=!1}finally{o&&delete n[e]}return s.exports}i.ab="/ROOT/supercorp/superinterface/node_modules/next/dist/compiled/ua-parser-js/",t.exports=i(226)})()},43632,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{isBot:function(){return i},userAgent:function(){return o},userAgentFromString:function(){return s}});let n=function(e){return e&&e.__esModule?e:{default:e}}(e.r(35235));function i(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(e)}function s(e){return{...(0,n.default)(e),isBot:void 0!==e&&i(e)}}function o({headers:e}){return s(e.get("user-agent")||void 0)}},95437,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"URLPattern",{enumerable:!0,get:function(){return n}});let n="undefined"==typeof URLPattern?void 0:URLPattern},92028,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"after",{enumerable:!0,get:function(){return i}});let n=e.r(56704);function i(e){let t=n.workAsyncStorage.getStore();if(!t)throw Object.defineProperty(Error("`after` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context"),"__NEXT_ERROR_CODE",{value:"E468",enumerable:!1,configurable:!0});let{afterContext:r}=t;return r.after(e)}},33062,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e,t){Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})})}(e.r(92028),r)},94059,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{DynamicServerError:function(){return i},isDynamicServerError:function(){return s}});let n="DYNAMIC_SERVER_USAGE";class i extends Error{constructor(e){super("Dynamic server usage: "+e),this.description=e,this.digest=n}}function s(e){return"object"==typeof e&&null!==e&&"digest"in e&&"string"==typeof e.digest&&e.digest===n}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},78506,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{StaticGenBailoutError:function(){return i},isStaticGenBailoutError:function(){return s}});let n="NEXT_STATIC_GEN_BAILOUT";class i extends Error{constructor(...e){super(...e),this.code=n}}function s(e){return"object"==typeof e&&null!==e&&"code"in e&&e.code===n}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},53920,(e,t,r)=>{"use strict";function n(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===i}Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{isHangingPromiseRejectionError:function(){return n},makeDevtoolsIOAwarePromise:function(){return c},makeHangingPromise:function(){return a}});let i="HANGING_PROMISE_REJECTION";class s extends Error{constructor(e,t){super(`During prerendering, ${t} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${t} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context. This occurred at route "${e}".`),this.route=e,this.expression=t,this.digest=i}}let o=new WeakMap;function a(e,t,r){if(e.aborted)return Promise.reject(new s(t,r));{let n=new Promise((n,i)=>{let a=i.bind(null,new s(t,r)),u=o.get(e);if(u)u.push(a);else{let t=[a];o.set(e,t),e.addEventListener("abort",()=>{for(let e=0;e<t.length;e++)t[e]()},{once:!0})}});return n.catch(u),n}}function u(){}function c(e){return new Promise(t=>{setTimeout(()=>{t(e)},0)})}},25812,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{METADATA_BOUNDARY_NAME:function(){return n},OUTLET_BOUNDARY_NAME:function(){return s},ROOT_LAYOUT_BOUNDARY_NAME:function(){return o},VIEWPORT_BOUNDARY_NAME:function(){return i}});let n="__next_metadata_boundary__",i="__next_viewport_boundary__",s="__next_outlet_boundary__",o="__next_root_layout_boundary__"},64244,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{atLeastOneTask:function(){return s},scheduleImmediate:function(){return i},scheduleOnNextTick:function(){return n},waitAtLeastOneReactRenderTask:function(){return o}});let n=e=>{Promise.resolve().then(()=>{process.nextTick(e)})},i=e=>{setImmediate(e)};function s(){return new Promise(e=>i(e))}function o(){return new Promise(e=>setImmediate(e))}},79920,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{BailoutToCSRError:function(){return i},isBailoutToCSRError:function(){return s}});let n="BAILOUT_TO_CLIENT_SIDE_RENDERING";class i extends Error{constructor(e){super("Bail out to client-side rendering: "+e),this.reason=e,this.digest=n}}function s(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===n}},4784,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"InvariantError",{enumerable:!0,get:function(){return n}});class n extends Error{constructor(e,t){super("Invariant: "+(e.endsWith(".")?e:e+".")+" This is a bug in Next.js.",t),this.name="InvariantError"}}},30810,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{Postpone:function(){return A},PreludeState:function(){return Q},abortAndThrowOnSynchronousRequestDataAccess:function(){return S},abortOnSynchronousPlatformIOAccess:function(){return w},accessedDynamicData:function(){return M},annotateDynamicAccess:function(){return U},consumeDynamicAccess:function(){return D},createDynamicTrackingState:function(){return p},createDynamicValidationState:function(){return g},createHangingInputAbortSignal:function(){return j},createRenderInBrowserAbortSignal:function(){return B},delayUntilRuntimeStage:function(){return z},formatDynamicAPIAccesses:function(){return k},getFirstDynamicReason:function(){return m},isDynamicPostpone:function(){return O},isPrerenderInterruptedError:function(){return L},logDisallowedDynamicError:function(){return Y},markCurrentScopeAsDynamic:function(){return y},postponeWithTracking:function(){return T},throwIfDisallowedDynamic:function(){return X},throwToInterruptStaticGeneration:function(){return b},trackAllowedDynamicAccess:function(){return W},trackDynamicDataInDynamicRender:function(){return v},trackSynchronousPlatformIOAccessInDev:function(){return E},trackSynchronousRequestDataAccessInDev:function(){return x},useDynamicRouteParams:function(){return F},warnOnSyncDynamicError:function(){return R}});let n=function(e){return e&&e.__esModule?e:{default:e}}(e.r(41141)),i=e.r(94059),s=e.r(78506),o=e.r(32319),a=e.r(56704),u=e.r(53920),c=e.r(25812),l=e.r(64244),h=e.r(79920),f=e.r(4784),d="function"==typeof n.default.unstable_postpone;function p(e){return{isDebugDynamicAccesses:e,dynamicAccesses:[],syncDynamicErrorWithStack:null}}function g(){return{hasSuspenseAboveBody:!1,hasDynamicMetadata:!1,hasDynamicViewport:!1,hasAllowedDynamic:!1,dynamicErrors:[]}}function m(e){var t;return null==(t=e.dynamicAccesses[0])?void 0:t.expression}function y(e,t,r){if(t)switch(t.type){case"cache":case"unstable-cache":case"private-cache":return}if(!e.forceDynamic&&!e.forceStatic){if(e.dynamicShouldError)throw Object.defineProperty(new s.StaticGenBailoutError(`Route ${e.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${r}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(t)switch(t.type){case"prerender-ppr":return T(e.route,r,t.dynamicTracking);case"prerender-legacy":t.revalidate=0;let n=Object.defineProperty(new i.DynamicServerError(`Route ${e.route} couldn't be rendered statically because it used ${r}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E550",enumerable:!1,configurable:!0});throw e.dynamicUsageDescription=r,e.dynamicUsageStack=n.stack,n}}}function b(e,t,r){let n=Object.defineProperty(new i.DynamicServerError(`Route ${t.route} couldn't be rendered statically because it used \`${e}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw r.revalidate=0,t.dynamicUsageDescription=e,t.dynamicUsageStack=n.stack,n}function v(e){switch(e.type){case"cache":case"unstable-cache":case"private-cache":return}}function _(e,t,r){let n=N(`Route ${e} needs to bail out of prerendering at this point because it used ${t}.`);r.controller.abort(n);let i=r.dynamicTracking;i&&i.dynamicAccesses.push({stack:i.isDebugDynamicAccesses?Error().stack:void 0,expression:t})}function w(e,t,r,n){let i=n.dynamicTracking;_(e,t,n),i&&null===i.syncDynamicErrorWithStack&&(i.syncDynamicErrorWithStack=r)}function E(e){e.prerenderPhase=!1}function S(e,t,r,n){if(!1===n.controller.signal.aborted){_(e,t,n);let i=n.dynamicTracking;i&&null===i.syncDynamicErrorWithStack&&(i.syncDynamicErrorWithStack=r)}throw N(`Route ${e} needs to bail out of prerendering at this point because it used ${t}.`)}function R(e){e.syncDynamicErrorWithStack&&console.error(e.syncDynamicErrorWithStack)}let x=E;function A({reason:e,route:t}){let r=o.workUnitAsyncStorage.getStore();T(t,e,r&&"prerender-ppr"===r.type?r.dynamicTracking:null)}function T(e,t,r){(function(){if(!d)throw Object.defineProperty(Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E224",enumerable:!1,configurable:!0})})(),r&&r.dynamicAccesses.push({stack:r.isDebugDynamicAccesses?Error().stack:void 0,expression:t}),n.default.unstable_postpone(P(e,t))}function P(e,t){return`Route ${e} needs to bail out of prerendering at this point because it used ${t}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`}function O(e){return"object"==typeof e&&null!==e&&"string"==typeof e.message&&C(e.message)}function C(e){return e.includes("needs to bail out of prerendering at this point because it used")&&e.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error")}if(!1===C(P("%%%","^^^")))throw Object.defineProperty(Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E296",enumerable:!1,configurable:!0});let I="NEXT_PRERENDER_INTERRUPTED";function N(e){let t=Object.defineProperty(Error(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t.digest=I,t}function L(e){return"object"==typeof e&&null!==e&&e.digest===I&&"name"in e&&"message"in e&&e instanceof Error}function M(e){return e.length>0}function D(e,t){return e.dynamicAccesses.push(...t.dynamicAccesses),e.dynamicAccesses}function k(e){return e.filter(e=>"string"==typeof e.stack&&e.stack.length>0).map(({expression:e,stack:t})=>(t=t.split("\n").slice(4).filter(e=>!(e.includes("node_modules/next/")||e.includes(" (<anonymous>)")||e.includes(" (node:"))).join("\n"),`Dynamic API Usage Debug - ${e}:
17
17
  ${t}`))}function B(){let e=new AbortController;return e.abort(Object.defineProperty(new h.BailoutToCSRError("Render in Browser"),"__NEXT_ERROR_CODE",{value:"E721",enumerable:!1,configurable:!0})),e.signal}function j(e){switch(e.type){case"prerender":case"prerender-runtime":let t=new AbortController;if(e.cacheSignal)e.cacheSignal.inputReady().then(()=>{t.abort()});else{let r=(0,o.getRuntimeStagePromise)(e);r?r.then(()=>(0,l.scheduleOnNextTick)(()=>t.abort())):(0,l.scheduleOnNextTick)(()=>t.abort())}return t.signal;case"prerender-client":case"prerender-ppr":case"prerender-legacy":case"request":case"cache":case"private-cache":case"unstable-cache":return}}function U(e,t){let r=t.dynamicTracking;r&&r.dynamicAccesses.push({stack:r.isDebugDynamicAccesses?Error().stack:void 0,expression:e})}function F(e){let t=a.workAsyncStorage.getStore(),r=o.workUnitAsyncStorage.getStore();if(t&&r)switch(r.type){case"prerender-client":case"prerender":{let i=r.fallbackRouteParams;i&&i.size>0&&n.default.use((0,u.makeHangingPromise)(r.renderSignal,t.route,e));break}case"prerender-ppr":{let n=r.fallbackRouteParams;if(n&&n.size>0)return T(t.route,e,r.dynamicTracking);break}case"prerender-runtime":throw Object.defineProperty(new f.InvariantError(`\`${e}\` was called during a runtime prerender. Next.js should be preventing ${e} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E771",enumerable:!1,configurable:!0});case"cache":case"private-cache":throw Object.defineProperty(new f.InvariantError(`\`${e}\` was called inside a cache scope. Next.js should be preventing ${e} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E745",enumerable:!1,configurable:!0})}}let q=/\n\s+at Suspense \(<anonymous>\)/,$=RegExp(`\\n\\s+at Suspense \\(<anonymous>\\)(?:(?!\\n\\s+at (?:body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6) \\(<anonymous>\\))[\\s\\S])*?\\n\\s+at ${c.ROOT_LAYOUT_BOUNDARY_NAME} \\([^\\n]*\\)`),G=RegExp(`\\n\\s+at ${c.METADATA_BOUNDARY_NAME}[\\n\\s]`),H=RegExp(`\\n\\s+at ${c.VIEWPORT_BOUNDARY_NAME}[\\n\\s]`),V=RegExp(`\\n\\s+at ${c.OUTLET_BOUNDARY_NAME}[\\n\\s]`);function W(e,t,r,n){if(!V.test(t)){if(G.test(t)){r.hasDynamicMetadata=!0;return}if(H.test(t)){r.hasDynamicViewport=!0;return}if($.test(t)){r.hasAllowedDynamic=!0,r.hasSuspenseAboveBody=!0;return}else if(q.test(t)){r.hasAllowedDynamic=!0;return}else{if(n.syncDynamicErrorWithStack)return void r.dynamicErrors.push(n.syncDynamicErrorWithStack);let i=function(e,t){let r=Object.defineProperty(Error(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return r.stack=r.name+": "+e+t,r}(`Route "${e.route}": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`,t);return void r.dynamicErrors.push(i)}}}var Q=function(e){return e[e.Full=0]="Full",e[e.Empty=1]="Empty",e[e.Errored=2]="Errored",e}({});function Y(e,t){console.error(t),e.dev||(e.hasReadableErrorStacks?console.error(`To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "${e.route}" in your browser to investigate the error.`):console.error(`To get a more detailed stack trace and pinpoint the issue, try one of the following:
18
18
  - Start the app in development mode by running \`next dev\`, then open "${e.route}" in your browser to investigate the error.
19
- - Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.`))}function X(e,t,r,n){if(0!==t){if(r.hasSuspenseAboveBody)return;if(n.syncDynamicErrorWithStack)throw Y(e,n.syncDynamicErrorWithStack),new s.StaticGenBailoutError;let i=r.dynamicErrors;if(i.length>0){for(let t=0;t<i.length;t++)Y(e,i[t]);throw new s.StaticGenBailoutError}if(r.hasDynamicViewport)throw console.error(`Route "${e.route}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`),new s.StaticGenBailoutError;if(1===t)throw console.error(`Route "${e.route}" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`),new s.StaticGenBailoutError}else if(!1===r.hasAllowedDynamic&&r.hasDynamicMetadata)throw console.error(`Route "${e.route}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`),new s.StaticGenBailoutError}function z(e,t){return e.runtimeStagePromise?e.runtimeStagePromise.then(()=>t):t}},44261,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{isRequestAPICallableInsideAfter:function(){return u},throwForSearchParamsAccessInUseCache:function(){return a},throwWithStaticGenerationBailoutError:function(){return s},throwWithStaticGenerationBailoutErrorWithDynamicError:function(){return o}});let n=e.r(78506),i=e.r(24725);function s(e,t){throw Object.defineProperty(new n.StaticGenBailoutError(`Route ${e} couldn't be rendered statically because it used ${t}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E576",enumerable:!1,configurable:!0})}function o(e,t){throw Object.defineProperty(new n.StaticGenBailoutError(`Route ${e} with \`dynamic = "error"\` couldn't be rendered statically because it used ${t}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E543",enumerable:!1,configurable:!0})}function a(e,t){let r=Object.defineProperty(Error(`Route ${e.route} used "searchParams" inside "use cache". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await "searchParams" outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E779",enumerable:!1,configurable:!0});throw Error.captureStackTrace(r,t),e.invalidDynamicUsageError??=r,r}function u(){let e=i.afterTaskAsyncStorage.getStore();return(null==e?void 0:e.rootTaskSpawnPhase)==="action"}},20955,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"connection",{enumerable:!0,get:function(){return c}});let n=e.r(56704),i=e.r(32319),s=e.r(30810),o=e.r(78506),a=e.r(53920),u=e.r(44261);function c(){let e=n.workAsyncStorage.getStore(),t=i.workUnitAsyncStorage.getStore();if(e){if(t&&"after"===t.phase&&!(0,u.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${e.route} used "connection" inside "after(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but "after(...)" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E186",enumerable:!1,configurable:!0});if(e.forceStatic)return Promise.resolve(void 0);if(e.dynamicShouldError)throw Object.defineProperty(new o.StaticGenBailoutError(`Route ${e.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`connection\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E562",enumerable:!1,configurable:!0});if(t)switch(t.type){case"cache":{let t=Object.defineProperty(Error(`Route ${e.route} used "connection" inside "use cache". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual request, but caches must be able to be produced before a request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E752",enumerable:!1,configurable:!0});throw Error.captureStackTrace(t,c),e.invalidDynamicUsageError??=t,t}case"private-cache":{let t=Object.defineProperty(Error(`Route ${e.route} used "connection" inside "use cache: private". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual navigation request, but caches must be able to be produced before a navigation request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E753",enumerable:!1,configurable:!0});throw Error.captureStackTrace(t,c),e.invalidDynamicUsageError??=t,t}case"unstable-cache":throw Object.defineProperty(Error(`Route ${e.route} used "connection" inside a function cached with "unstable_cache(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E1",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-runtime":return(0,a.makeHangingPromise)(t.renderSignal,e.route,"`connection()`");case"prerender-ppr":return(0,s.postponeWithTracking)(e.route,"connection",t.dynamicTracking);case"prerender-legacy":return(0,s.throwToInterruptStaticGeneration)("connection",e,t);case"request":return(0,s.trackDynamicDataInDynamicRender)(t),Promise.resolve(void 0)}}(0,i.throwForMissingRequestStore)("connection")}},73298,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{describeHasCheckingStringProperty:function(){return s},describeStringPropertyAccess:function(){return i},wellKnownProperties:function(){return o}});let n=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function i(e,t){return n.test(t)?"`"+e+"."+t+"`":"`"+e+"["+JSON.stringify(t)+"]`"}function s(e,t){let r=JSON.stringify(t);return"`Reflect.has("+e+", "+r+")`, `"+r+" in "+e+"`, or similar"}let o=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf","toLocaleString","then","catch","finally","status","displayName","_debugInfo","toJSON","$$typeof","__esModule"])},30548,(e,t,r)=>{"use strict";var n;Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{bgBlack:function(){return T},bgBlue:function(){return I},bgCyan:function(){return L},bgGreen:function(){return O},bgMagenta:function(){return N},bgRed:function(){return P},bgWhite:function(){return M},bgYellow:function(){return C},black:function(){return y},blue:function(){return w},bold:function(){return l},cyan:function(){return R},dim:function(){return h},gray:function(){return A},green:function(){return v},hidden:function(){return g},inverse:function(){return p},italic:function(){return f},magenta:function(){return E},purple:function(){return S},red:function(){return b},reset:function(){return c},strikethrough:function(){return m},underline:function(){return d},white:function(){return x},yellow:function(){return _}});let{env:i,stdout:s}=(null==(n=globalThis)?void 0:n.process)??{},o=i&&!i.NO_COLOR&&(i.FORCE_COLOR||(null==s?void 0:s.isTTY)&&!i.CI&&"dumb"!==i.TERM),a=(e,t,r,n)=>{let i=e.substring(0,n)+r,s=e.substring(n+t.length),o=s.indexOf(t);return~o?i+a(s,t,r,o):i+s},u=(e,t,r=e)=>o?n=>{let i=""+n,s=i.indexOf(t,e.length);return~s?e+a(i,t,r,s)+t:e+i+t}:String,c=o?e=>`\x1b[0m${e}\x1b[0m`:String,l=u("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m"),h=u("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"),f=u("\x1b[3m","\x1b[23m"),d=u("\x1b[4m","\x1b[24m"),p=u("\x1b[7m","\x1b[27m"),g=u("\x1b[8m","\x1b[28m"),m=u("\x1b[9m","\x1b[29m"),y=u("\x1b[30m","\x1b[39m"),b=u("\x1b[31m","\x1b[39m"),v=u("\x1b[32m","\x1b[39m"),_=u("\x1b[33m","\x1b[39m"),w=u("\x1b[34m","\x1b[39m"),E=u("\x1b[35m","\x1b[39m"),S=u("\x1b[38;2;173;127;168m","\x1b[39m"),R=u("\x1b[36m","\x1b[39m"),x=u("\x1b[37m","\x1b[39m"),A=u("\x1b[90m","\x1b[39m"),T=u("\x1b[40m","\x1b[49m"),P=u("\x1b[41m","\x1b[49m"),O=u("\x1b[42m","\x1b[49m"),C=u("\x1b[43m","\x1b[49m"),I=u("\x1b[44m","\x1b[49m"),N=u("\x1b[45m","\x1b[49m"),L=u("\x1b[46m","\x1b[49m"),M=u("\x1b[47m","\x1b[49m")},65477,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"LRUCache",{enumerable:!0,get:function(){return s}});class n{constructor(e,t,r){this.prev=null,this.next=null,this.key=e,this.data=t,this.size=r}}class i{constructor(){this.prev=null,this.next=null}}class s{constructor(e,t){this.cache=new Map,this.totalSize=0,this.maxSize=e,this.calculateSize=t,this.head=new i,this.tail=new i,this.head.next=this.tail,this.tail.prev=this.head}addToHead(e){e.prev=this.head,e.next=this.head.next,this.head.next.prev=e,this.head.next=e}removeNode(e){e.prev.next=e.next,e.next.prev=e.prev}moveToHead(e){this.removeNode(e),this.addToHead(e)}removeTail(){let e=this.tail.prev;return this.removeNode(e),e}set(e,t){let r=(null==this.calculateSize?void 0:this.calculateSize.call(this,t))??1;if(r>this.maxSize)return void console.warn("Single item size exceeds maxSize");let i=this.cache.get(e);if(i)i.data=t,this.totalSize=this.totalSize-i.size+r,i.size=r,this.moveToHead(i);else{let i=new n(e,t,r);this.cache.set(e,i),this.addToHead(i),this.totalSize+=r}for(;this.totalSize>this.maxSize&&this.cache.size>0;){let e=this.removeTail();this.cache.delete(e.key),this.totalSize-=e.size}}has(e){return this.cache.has(e)}get(e){let t=this.cache.get(e);if(t)return this.moveToHead(t),t.data}*[Symbol.iterator](){let e=this.head.next;for(;e&&e!==this.tail;){let t=e;yield[t.key,t.data],e=e.next}}remove(e){let t=this.cache.get(e);t&&(this.removeNode(t),this.cache.delete(e),this.totalSize-=t.size)}get size(){return this.cache.size}get currentSize(){return this.totalSize}}},40463,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{bootstrap:function(){return u},error:function(){return l},event:function(){return p},info:function(){return d},prefixes:function(){return s},ready:function(){return f},trace:function(){return g},wait:function(){return c},warn:function(){return h},warnOnce:function(){return y}});let n=e.r(30548),i=e.r(65477),s={wait:(0,n.white)((0,n.bold)("○")),error:(0,n.red)((0,n.bold)("⨯")),warn:(0,n.yellow)((0,n.bold)("⚠")),ready:"▲",info:(0,n.white)((0,n.bold)(" ")),event:(0,n.green)((0,n.bold)("✓")),trace:(0,n.magenta)((0,n.bold)("»"))},o={log:"log",warn:"warn",error:"error"};function a(e,...t){(""===t[0]||void 0===t[0])&&1===t.length&&t.shift();let r=e in o?o[e]:"log",n=s[e];0===t.length?console[r](""):1===t.length&&"string"==typeof t[0]?console[r](" "+n+" "+t[0]):console[r](" "+n,...t)}function u(...e){console.log(" "+e.join(" "))}function c(...e){a("wait",...e)}function l(...e){a("error",...e)}function h(...e){a("warn",...e)}function f(...e){a("ready",...e)}function d(...e){a("info",...e)}function p(...e){a("event",...e)}function g(...e){a("trace",...e)}let m=new i.LRUCache(1e4,e=>e.length);function y(...e){let t=e.join(" ");m.has(t)||(m.set(t,t),h(...e))}},70808,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{getRootParam:function(){return d},unstable_rootParams:function(){return f}});let n=e.r(4784),i=e.r(30810),s=e.r(56704),o=e.r(32319),a=e.r(53920),u=e.r(73298),c=e.r(20635),l=e.r(40463),h=new WeakMap;async function f(){(0,l.warnOnce)("`unstable_rootParams()` is deprecated and will be removed in an upcoming major release. Import specific root params from `next/root-params` instead.");let e=s.workAsyncStorage.getStore();if(!e)throw Object.defineProperty(new n.InvariantError("Missing workStore in unstable_rootParams"),"__NEXT_ERROR_CODE",{value:"E615",enumerable:!1,configurable:!0});let t=o.workUnitAsyncStorage.getStore();if(!t)throw Object.defineProperty(Error(`Route ${e.route} used \`unstable_rootParams()\` in Pages Router. This API is only available within App Router.`),"__NEXT_ERROR_CODE",{value:"E641",enumerable:!1,configurable:!0});switch(t.type){case"cache":case"unstable-cache":throw Object.defineProperty(Error(`Route ${e.route} used \`unstable_rootParams()\` inside \`"use cache"\` or \`unstable_cache\`. Support for this API inside cache scopes is planned for a future version of Next.js.`),"__NEXT_ERROR_CODE",{value:"E642",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":return function(e,t,r){switch(r.type){case"prerender-client":{let e="`unstable_rootParams`";throw Object.defineProperty(new n.InvariantError(`${e} must not be used within a client component. Next.js should be preventing ${e} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0})}case"prerender":{let n=r.fallbackRouteParams;if(n){for(let i in e)if(n.has(i)){let n=h.get(e);if(n)return n;let i=(0,a.makeHangingPromise)(r.renderSignal,t.route,"`unstable_rootParams`");return h.set(e,i),i}}break}case"prerender-ppr":{let n=r.fallbackRouteParams;if(n){for(let s in e)if(n.has(s))return function(e,t,r,n){let s=h.get(e);if(s)return s;let o={...e},a=Promise.resolve(o);return h.set(e,a),Object.keys(e).forEach(s=>{u.wellKnownProperties.has(s)||(t.has(s)?Object.defineProperty(o,s,{get(){let e=(0,u.describeStringPropertyAccess)("unstable_rootParams",s);"prerender-ppr"===n.type?(0,i.postponeWithTracking)(r.route,e,n.dynamicTracking):(0,i.throwToInterruptStaticGeneration)(e,r,n)},enumerable:!0}):a[s]=e[s])}),a}(e,n,t,r)}}}return Promise.resolve(e)}(t.rootParams,e,t);case"private-cache":case"prerender-runtime":case"request":return Promise.resolve(t.rootParams);default:return t}}function d(e){let t=`\`import('next/root-params').${e}()\``,r=s.workAsyncStorage.getStore();if(!r)throw Object.defineProperty(new n.InvariantError(`Missing workStore in ${t}`),"__NEXT_ERROR_CODE",{value:"E764",enumerable:!1,configurable:!0});let i=o.workUnitAsyncStorage.getStore();if(!i)throw Object.defineProperty(Error(`Route ${r.route} used ${t} outside of a Server Component. This is not allowed.`),"__NEXT_ERROR_CODE",{value:"E774",enumerable:!1,configurable:!0});let u=c.actionAsyncStorage.getStore();if(u){if(u.isAppRoute)throw Object.defineProperty(Error(`Route ${r.route} used ${t} inside a Route Handler. Support for this API in Route Handlers is planned for a future version of Next.js.`),"__NEXT_ERROR_CODE",{value:"E765",enumerable:!1,configurable:!0});if(u.isAction&&"action"===i.phase)throw Object.defineProperty(Error(`${t} was used inside a Server Action. This is not supported. Functions from 'next/root-params' can only be called in the context of a route.`),"__NEXT_ERROR_CODE",{value:"E766",enumerable:!1,configurable:!0})}switch(i.type){case"unstable-cache":case"cache":throw Object.defineProperty(Error(`Route ${r.route} used ${t} inside \`"use cache"\` or \`unstable_cache\`. Support for this API inside cache scopes is planned for a future version of Next.js.`),"__NEXT_ERROR_CODE",{value:"E760",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":var l=e,h=r,f=i,d=t;if("prerender-client"===f.type)throw Object.defineProperty(new n.InvariantError(`${d} must not be used within a client component. Next.js should be preventing ${d} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0});let g=f.rootParams;switch(f.type){case"prerender":if(f.fallbackRouteParams&&f.fallbackRouteParams.has(l))return(0,a.makeHangingPromise)(f.renderSignal,h.route,d);break;case"prerender-ppr":if(f.fallbackRouteParams&&f.fallbackRouteParams.has(l))return p(l,h,f,d)}return Promise.resolve(g[l])}return Promise.resolve(i.rootParams[e])}async function p(e,t,r,n){let s=(0,u.describeStringPropertyAccess)(n,e);switch(r.type){case"prerender-ppr":return(0,i.postponeWithTracking)(t.route,s,r.dynamicTracking);case"prerender-legacy":return(0,i.throwToInterruptStaticGeneration)(s,t,r)}}},49493,(e,t,r)=>{let n={NextRequest:e.r(60306).NextRequest,NextResponse:e.r(24173).NextResponse,ImageResponse:e.r(17878).ImageResponse,userAgentFromString:e.r(43632).userAgentFromString,userAgent:e.r(43632).userAgent,URLPattern:e.r(95437).URLPattern,after:e.r(33062).after,connection:e.r(20955).connection,unstable_rootParams:e.r(70808).unstable_rootParams};t.exports=n,r.NextRequest=n.NextRequest,r.NextResponse=n.NextResponse,r.ImageResponse=n.ImageResponse,r.userAgentFromString=n.userAgentFromString,r.userAgent=n.userAgent,r.URLPattern=n.URLPattern,r.after=n.after,r.connection=n.connection,r.unstable_rootParams=n.unstable_rootParams},29173,(e,t,r)=>{t.exports=e.x("@prisma/client",()=>require("@prisma/client"))},81962,(e,t,r)=>{"use strict";function n(e){let t=null!=e;return function(r){let n=r.length-1;if(1===n)return[];if("}"!==r[n])throw Error("Invalid array text - must end with }");let i=0;if("["===r[0]&&(i=r.indexOf("=")+1),"{"!==r[i++])throw Error("Invalid array text - must start with {");let s=[],o=s,a=[],u=i,c="",l=!0;for(;i<n;++i){let s=r[i];if('"'===s){u=++i;let n=r.indexOf('"',u),s=r.indexOf("\\",u);for(;-1!==s&&s<n;)i=s,c+=r.slice(u,i),u=++i,n===i++&&(n=r.indexOf('"',i)),s=r.indexOf("\\",i);i=n,c+=r.slice(u,i),o.push(t?e(c):c),c="",l=!1}else if("{"===s){let e=[];o.push(e),a.push(o),o=e,u=i+1,l=!0}else if(","===s)l=!0;else if("}"===s){l=!1;let e=a.pop();if(void 0===e)throw Error("Invalid array text - too many '}'");o=e}else if(l){for(u=i;","!==(s=r[i])&&"}"!==s&&i<n;)++i;let a=r.slice(u,i--);o.push("NULL"===a?null:t?e(a):a),l=!1}else throw Error("Was expecting delimeter")}return s}}let i=n();r.parse=(e,t)=>null!=t?n(t)(e):i(e)},24493,e=>{"use strict";e.s(["getPrisma",()=>rB,"prisma",()=>rj],24493);var t,r,n,i,s,o,a,u,c,l,h=Object.create,f=Object.defineProperty,d=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,g=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty,y=(e,t)=>f(e,"name",{value:t,configurable:!0}),b=(e,t)=>()=>(e&&(t=e(e=0)),t),v=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_=(e,t)=>{for(var r in t)f(e,r,{get:t[r],enumerable:!0})},w=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of p(t))m.call(e,i)||i===r||f(e,i,{get:()=>t[i],enumerable:!(n=d(t,i))||n.enumerable});return e},E=(e,t,r)=>(r=null!=e?h(g(e)):{},w(!t&&e&&e.__esModule?r:f(r,"default",{value:e,enumerable:!0}),e)),S=e=>w(f({},"__esModule",{value:!0}),e),R=(e,t,r)=>((e,t,r)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),x=v(e=>{P(),e.byteLength=u,e.toByteArray=l,e.fromByteArray=d;var t,r,n=[],i=[],s="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(t=0,r=o.length;t<r;++t)n[t]=o[t],i[o.charCodeAt(t)]=t;function a(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function u(e){var t=a(e),r=t[0],n=t[1];return(r+n)*3/4-n}function c(e,t,r){return(t+r)*3/4-r}function l(e){var t,r,n=a(e),o=n[0],u=n[1],l=new s(c(e,o,u)),h=0,f=u>0?o-4:o;for(r=0;r<f;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],l[h++]=t>>16&255,l[h++]=t>>8&255,l[h++]=255&t;return 2===u&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,l[h++]=255&t),1===u&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,l[h++]=t>>8&255,l[h++]=255&t),l}function h(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function f(e,t,r){for(var n=[],i=t;i<r;i+=3)n.push(h((e[i]<<16&0xff0000)+(e[i+1]<<8&65280)+(255&e[i+2])));return n.join("")}function d(e){for(var t,r=e.length,i=r%3,s=[],o=0,a=r-i;o<a;o+=16383)s.push(f(e,o,o+16383>a?a:o+16383));return 1===i?s.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===i&&s.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),s.join("")}i[45]=62,i[95]=63,y(a,"getLens"),y(u,"byteLength"),y(c,"_byteLength"),y(l,"toByteArray"),y(h,"tripletToBase64"),y(f,"encodeChunk"),y(d,"fromByteArray")}),A=v(e=>{P(),e.read=function(e,t,r,n,i){var s,o,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,h=r?i-1:0,f=r?-1:1,d=e[t+h];for(h+=f,s=d&(1<<-l)-1,d>>=-l,l+=a;l>0;s=256*s+e[t+h],h+=f,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+e[t+h],h+=f,l-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),s-=c}return(d?-1:1)*o*Math.pow(2,s-n)},e.write=function(e,t,r,n,i,s){var o,a,u,c=8*s-i-1,l=(1<<c)-1,h=l>>1,f=5960464477539062e-23*(23===i),d=n?0:s-1,p=n?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(a=+!!isNaN(t),o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+h>=1?t+=f/u:t+=f*Math.pow(2,1-h),t*u>=2&&(o++,u/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(t*u-1)*Math.pow(2,i),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;e[r+d]=255&o,d+=p,o/=256,c-=8);e[r+d-p]|=128*g}}),T=v(e=>{P();var t=x(),r=A(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function i(){try{let e=new Uint8Array(1),t={foo:y(function(){return 42},"foo")};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}function s(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return l(e)}return a(e,t,r)}function a(e,t,r){if("string"==typeof e)return h(e,t);if(ArrayBuffer.isView(e))return d(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(eo(e,ArrayBuffer)||e&&eo(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(eo(e,SharedArrayBuffer)||e&&eo(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);let i=g(e);if(i)return i;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e,t,r){return u(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}function l(e){return u(e),s(e<0?0:0|m(e))}function h(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!o.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=0|v(e,t),n=s(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function f(e){let t=e.length<0?0:0|m(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e){if(eo(e,Uint8Array)){let t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}function p(e,t,r){let n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),n}function g(e){if(o.isBuffer(e)){let t=0|m(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||ea(e.length)?s(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}function m(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function b(e){return+e!=e&&(e=0),o.alloc(+e)}function v(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||eo(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return et(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ei(e).length;default:if(i)return n?-1:et(e).length;t=(""+t).toLowerCase(),i=!0}}function _(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return D(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return N(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(n)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function w(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function E(e,t,r,n,i){if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),ea(r*=1)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return -1;r=e.length-1}else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:S(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):S(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function S(e,t,r,n,i){let s,o=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;o=2,a/=2,u/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(y(c,"read"),i){let n=-1;for(s=r;s<a;s++)if(c(e,s)===c(t,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===u)return n*o}else -1!==n&&(s-=s-n),n=-1}else for(r+u>a&&(r=a-u),s=r;s>=0;s--){let r=!0;for(let n=0;n<u;n++)if(c(e,s+n)!==c(t,n)){r=!1;break}if(r)return s}return -1}function R(e,t,r,n){let i;r=Number(r)||0;let s=e.length-r;n?(n=Number(n))>s&&(n=s):n=s;let o=t.length;for(n>o/2&&(n=o/2),i=0;i<n;++i){let n=parseInt(t.substr(2*i,2),16);if(ea(n))break;e[r+i]=n}return i}function T(e,t,r,n){return es(et(t,e.length-r),e,r,n)}function O(e,t,r,n){return es(er(t),e,r,n)}function C(e,t,r,n){return es(ei(t),e,r,n)}function I(e,t,r,n){return es(en(t,e.length-r),e,r,n)}function N(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function L(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let t=e[i],s=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,a,u;switch(o){case 1:t<128&&(s=t);break;case 2:(192&(r=e[i+1]))==128&&(u=(31&t)<<6|63&r)>127&&(s=u);break;case 3:r=e[i+1],n=e[i+2],(192&r)==128&&(192&n)==128&&(u=(15&t)<<12|(63&r)<<6|63&n)>2047&&(u<55296||u>57343)&&(s=u);break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],(192&r)==128&&(192&n)==128&&(192&a)==128&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a)>65535&&u<1114112&&(s=u)}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=o}return M(n)}function M(e){let t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}function D(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function k(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function B(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=eu[e[n]];return i}function j(e,t,r){let n=e.slice(t,r),i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function U(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function F(e,t,r,n,i,s){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function q(e,t,r,n,i){z(t,n,i,e,r,7);let s=Number(t&BigInt(0xffffffff));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function $(e,t,r,n,i){z(t,n,i,e,r,7);let s=Number(t&BigInt(0xffffffff));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function G(e,t,r,n,i,s){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function H(e,t,n,i,s){return t*=1,n>>>=0,s||G(e,t,n,4,34028234663852886e22,-34028234663852886e22),r.write(e,t,n,i,23,4),n+4}function V(e,t,n,i,s){return t*=1,n>>>=0,s||G(e,t,n,8,17976931348623157e292,-17976931348623157e292),r.write(e,t,n,i,52,8),n+8}e.Buffer=o,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50,e.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),y(i,"typedArraySupport"),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:y(function(){if(o.isBuffer(this))return this.buffer},"get")}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:y(function(){if(o.isBuffer(this))return this.byteOffset},"get")}),y(s,"createBuffer"),y(o,"Buffer"),o.poolSize=8192,y(a,"from"),o.from=function(e,t,r){return a(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),y(u,"assertSize"),y(c,"alloc"),o.alloc=function(e,t,r){return c(e,t,r)},y(l,"allocUnsafe"),o.allocUnsafe=function(e){return l(e)},o.allocUnsafeSlow=function(e){return l(e)},y(h,"fromString"),y(f,"fromArrayLike"),y(d,"fromArrayView"),y(p,"fromArrayBuffer"),y(g,"fromObject"),y(m,"checked"),y(b,"SlowBuffer"),o.isBuffer=y(function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},"isBuffer"),o.compare=y(function(e,t){if(eo(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),eo(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},"compare"),o.isEncoding=y(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding"),o.concat=y(function(e,t){let r;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;let n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){let t=e[r];if(eo(t,Uint8Array))i+t.length>n.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else if(o.isBuffer(t))t.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=t.length}return n},"concat"),y(v,"byteLength"),o.byteLength=v,y(_,"slowToString"),o.prototype._isBuffer=!0,y(w,"swap"),o.prototype.swap16=y(function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)w(this,t,t+1);return this},"swap16"),o.prototype.swap32=y(function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)w(this,t,t+3),w(this,t+1,t+2);return this},"swap32"),o.prototype.swap64=y(function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)w(this,t,t+7),w(this,t+1,t+6),w(this,t+2,t+5),w(this,t+3,t+4);return this},"swap64"),o.prototype.toString=y(function(){let e=this.length;return 0===e?"":0==arguments.length?L(this,0,e):_.apply(this,arguments)},"toString"),o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=y(function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},"equals"),o.prototype.inspect=y(function(){let t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},"inspect"),n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=y(function(e,t,r,n,i){if(eo(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let s=i-n,a=r-t,u=Math.min(s,a),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<u;++e)if(c[e]!==l[e]){s=c[e],a=l[e];break}return s<a?-1:+(a<s)},"compare"),y(E,"bidirectionalIndexOf"),y(S,"arrayIndexOf"),o.prototype.includes=y(function(e,t,r){return -1!==this.indexOf(e,t,r)},"includes"),o.prototype.indexOf=y(function(e,t,r){return E(this,e,t,r,!0)},"indexOf"),o.prototype.lastIndexOf=y(function(e,t,r){return E(this,e,t,r,!1)},"lastIndexOf"),y(R,"hexWrite"),y(T,"utf8Write"),y(O,"asciiWrite"),y(C,"base64Write"),y(I,"ucs2Write"),o.prototype.write=y(function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return R(this,e,t,r);case"utf8":case"utf-8":return T(this,e,t,r);case"ascii":case"latin1":case"binary":return O(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(s)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},"write"),o.prototype.toJSON=y(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON"),y(N,"base64Slice"),y(L,"utf8Slice"),y(M,"decodeCodePointsArray"),y(D,"asciiSlice"),y(k,"latin1Slice"),y(B,"hexSlice"),y(j,"utf16leSlice"),o.prototype.slice=y(function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},"slice"),y(U,"checkOffset"),o.prototype.readUintLE=o.prototype.readUIntLE=y(function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n},"readUIntLE"),o.prototype.readUintBE=o.prototype.readUIntBE=y(function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},"readUIntBE"),o.prototype.readUint8=o.prototype.readUInt8=y(function(e,t){return e>>>=0,t||U(e,1,this.length),this[e]},"readUInt8"),o.prototype.readUint16LE=o.prototype.readUInt16LE=y(function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE"),o.prototype.readUint16BE=o.prototype.readUInt16BE=y(function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE"),o.prototype.readUint32LE=o.prototype.readUInt32LE=y(function(e,t){return e>>>=0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},"readUInt32LE"),o.prototype.readUint32BE=o.prototype.readUInt32BE=y(function(e,t){return e>>>=0,t||U(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE"),o.prototype.readBigUInt64LE=ec(y(function(e){K(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&J(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+0x1000000*this[++e],i=this[++e]+256*this[++e]+65536*this[++e]+0x1000000*r;return BigInt(n)+(BigInt(i)<<BigInt(32))},"readBigUInt64LE")),o.prototype.readBigUInt64BE=ec(y(function(e){K(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&J(e,this.length-8);let n=0x1000000*t+65536*this[++e]+256*this[++e]+this[++e],i=0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)},"readBigUInt64BE")),o.prototype.readIntLE=y(function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},"readIntLE"),o.prototype.readIntBE=y(function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=t,i=1,s=this[e+--n];for(;n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},"readIntBE"),o.prototype.readInt8=y(function(e,t){return e>>>=0,t||U(e,1,this.length),128&this[e]?-((255-this[e]+1)*1):this[e]},"readInt8"),o.prototype.readInt16LE=y(function(e,t){e>>>=0,t||U(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},"readInt16LE"),o.prototype.readInt16BE=y(function(e,t){e>>>=0,t||U(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},"readInt16BE"),o.prototype.readInt32LE=y(function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE"),o.prototype.readInt32BE=y(function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE"),o.prototype.readBigInt64LE=ec(y(function(e){K(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&J(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+0x1000000*this[++e])},"readBigInt64LE")),o.prototype.readBigInt64BE=ec(y(function(e){K(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&J(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r)},"readBigInt64BE")),o.prototype.readFloatLE=y(function(e,t){return e>>>=0,t||U(e,4,this.length),r.read(this,e,!0,23,4)},"readFloatLE"),o.prototype.readFloatBE=y(function(e,t){return e>>>=0,t||U(e,4,this.length),r.read(this,e,!1,23,4)},"readFloatBE"),o.prototype.readDoubleLE=y(function(e,t){return e>>>=0,t||U(e,8,this.length),r.read(this,e,!0,52,8)},"readDoubleLE"),o.prototype.readDoubleBE=y(function(e,t){return e>>>=0,t||U(e,8,this.length),r.read(this,e,!1,52,8)},"readDoubleBE"),y(F,"checkInt"),o.prototype.writeUintLE=o.prototype.writeUIntLE=y(function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;F(this,e,t,r,n,0)}let i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},"writeUIntLE"),o.prototype.writeUintBE=o.prototype.writeUIntBE=y(function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;F(this,e,t,r,n,0)}let i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},"writeUIntBE"),o.prototype.writeUint8=o.prototype.writeUInt8=y(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,1,255,0),this[t]=255&e,t+1},"writeUInt8"),o.prototype.writeUint16LE=o.prototype.writeUInt16LE=y(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},"writeUInt16LE"),o.prototype.writeUint16BE=o.prototype.writeUInt16BE=y(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},"writeUInt16BE"),o.prototype.writeUint32LE=o.prototype.writeUInt32LE=y(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},"writeUInt32LE"),o.prototype.writeUint32BE=o.prototype.writeUInt32BE=y(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},"writeUInt32BE"),y(q,"wrtBigUInt64LE"),y($,"wrtBigUInt64BE"),o.prototype.writeBigUInt64LE=ec(y(function(e,t=0){return q(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE")),o.prototype.writeBigUInt64BE=ec(y(function(e,t=0){return $(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE")),o.prototype.writeIntLE=y(function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);F(this,e,t,r,n-1,-n)}let i=0,s=1,o=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},"writeIntLE"),o.prototype.writeIntBE=y(function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);F(this,e,t,r,n-1,-n)}let i=r-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},"writeIntBE"),o.prototype.writeInt8=y(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},"writeInt8"),o.prototype.writeInt16LE=y(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},"writeInt16LE"),o.prototype.writeInt16BE=y(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},"writeInt16BE"),o.prototype.writeInt32LE=y(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE"),o.prototype.writeInt32BE=y(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},"writeInt32BE"),o.prototype.writeBigInt64LE=ec(y(function(e,t=0){return q(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE")),o.prototype.writeBigInt64BE=ec(y(function(e,t=0){return $(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE")),y(G,"checkIEEE754"),y(H,"writeFloat"),o.prototype.writeFloatLE=y(function(e,t,r){return H(this,e,t,!0,r)},"writeFloatLE"),o.prototype.writeFloatBE=y(function(e,t,r){return H(this,e,t,!1,r)},"writeFloatBE"),y(V,"writeDouble"),o.prototype.writeDoubleLE=y(function(e,t,r){return V(this,e,t,!0,r)},"writeDoubleLE"),o.prototype.writeDoubleBE=y(function(e,t,r){return V(this,e,t,!1,r)},"writeDoubleBE"),o.prototype.copy=y(function(e,t,r,n){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},"copy"),o.prototype.fill=y(function(e,t,r,n){let i;if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{let s=o.isBuffer(e)?e:o.from(e,n),a=s.length;if(0===a)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this},"fill");var W={};function Q(e,t,r){var n;W[e]=(y(n=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}\
19
+ - Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.`))}function X(e,t,r,n){if(0!==t){if(r.hasSuspenseAboveBody)return;if(n.syncDynamicErrorWithStack)throw Y(e,n.syncDynamicErrorWithStack),new s.StaticGenBailoutError;let i=r.dynamicErrors;if(i.length>0){for(let t=0;t<i.length;t++)Y(e,i[t]);throw new s.StaticGenBailoutError}if(r.hasDynamicViewport)throw console.error(`Route "${e.route}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`),new s.StaticGenBailoutError;if(1===t)throw console.error(`Route "${e.route}" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`),new s.StaticGenBailoutError}else if(!1===r.hasAllowedDynamic&&r.hasDynamicMetadata)throw console.error(`Route "${e.route}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`),new s.StaticGenBailoutError}function z(e,t){return e.runtimeStagePromise?e.runtimeStagePromise.then(()=>t):t}},44261,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{isRequestAPICallableInsideAfter:function(){return u},throwForSearchParamsAccessInUseCache:function(){return a},throwWithStaticGenerationBailoutError:function(){return s},throwWithStaticGenerationBailoutErrorWithDynamicError:function(){return o}});let n=e.r(78506),i=e.r(24725);function s(e,t){throw Object.defineProperty(new n.StaticGenBailoutError(`Route ${e} couldn't be rendered statically because it used ${t}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E576",enumerable:!1,configurable:!0})}function o(e,t){throw Object.defineProperty(new n.StaticGenBailoutError(`Route ${e} with \`dynamic = "error"\` couldn't be rendered statically because it used ${t}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E543",enumerable:!1,configurable:!0})}function a(e,t){let r=Object.defineProperty(Error(`Route ${e.route} used "searchParams" inside "use cache". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await "searchParams" outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E779",enumerable:!1,configurable:!0});throw Error.captureStackTrace(r,t),e.invalidDynamicUsageError??=r,r}function u(){let e=i.afterTaskAsyncStorage.getStore();return(null==e?void 0:e.rootTaskSpawnPhase)==="action"}},20955,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"connection",{enumerable:!0,get:function(){return c}});let n=e.r(56704),i=e.r(32319),s=e.r(30810),o=e.r(78506),a=e.r(53920),u=e.r(44261);function c(){let e=n.workAsyncStorage.getStore(),t=i.workUnitAsyncStorage.getStore();if(e){if(t&&"after"===t.phase&&!(0,u.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error(`Route ${e.route} used "connection" inside "after(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but "after(...)" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`),"__NEXT_ERROR_CODE",{value:"E186",enumerable:!1,configurable:!0});if(e.forceStatic)return Promise.resolve(void 0);if(e.dynamicShouldError)throw Object.defineProperty(new o.StaticGenBailoutError(`Route ${e.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`connection\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E562",enumerable:!1,configurable:!0});if(t)switch(t.type){case"cache":{let t=Object.defineProperty(Error(`Route ${e.route} used "connection" inside "use cache". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual request, but caches must be able to be produced before a request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E752",enumerable:!1,configurable:!0});throw Error.captureStackTrace(t,c),e.invalidDynamicUsageError??=t,t}case"private-cache":{let t=Object.defineProperty(Error(`Route ${e.route} used "connection" inside "use cache: private". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual navigation request, but caches must be able to be produced before a navigation request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E753",enumerable:!1,configurable:!0});throw Error.captureStackTrace(t,c),e.invalidDynamicUsageError??=t,t}case"unstable-cache":throw Object.defineProperty(Error(`Route ${e.route} used "connection" inside a function cached with "unstable_cache(...)". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`),"__NEXT_ERROR_CODE",{value:"E1",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-runtime":return(0,a.makeHangingPromise)(t.renderSignal,e.route,"`connection()`");case"prerender-ppr":return(0,s.postponeWithTracking)(e.route,"connection",t.dynamicTracking);case"prerender-legacy":return(0,s.throwToInterruptStaticGeneration)("connection",e,t);case"request":return(0,s.trackDynamicDataInDynamicRender)(t),Promise.resolve(void 0)}}(0,i.throwForMissingRequestStore)("connection")}},73298,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{describeHasCheckingStringProperty:function(){return s},describeStringPropertyAccess:function(){return i},wellKnownProperties:function(){return o}});let n=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function i(e,t){return n.test(t)?"`"+e+"."+t+"`":"`"+e+"["+JSON.stringify(t)+"]`"}function s(e,t){let r=JSON.stringify(t);return"`Reflect.has("+e+", "+r+")`, `"+r+" in "+e+"`, or similar"}let o=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf","toLocaleString","then","catch","finally","status","displayName","_debugInfo","toJSON","$$typeof","__esModule"])},30548,(e,t,r)=>{"use strict";var n;Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{bgBlack:function(){return T},bgBlue:function(){return I},bgCyan:function(){return L},bgGreen:function(){return O},bgMagenta:function(){return N},bgRed:function(){return P},bgWhite:function(){return M},bgYellow:function(){return C},black:function(){return y},blue:function(){return w},bold:function(){return l},cyan:function(){return R},dim:function(){return h},gray:function(){return A},green:function(){return v},hidden:function(){return g},inverse:function(){return p},italic:function(){return f},magenta:function(){return E},purple:function(){return S},red:function(){return b},reset:function(){return c},strikethrough:function(){return m},underline:function(){return d},white:function(){return x},yellow:function(){return _}});let{env:i,stdout:s}=(null==(n=globalThis)?void 0:n.process)??{},o=i&&!i.NO_COLOR&&(i.FORCE_COLOR||(null==s?void 0:s.isTTY)&&!i.CI&&"dumb"!==i.TERM),a=(e,t,r,n)=>{let i=e.substring(0,n)+r,s=e.substring(n+t.length),o=s.indexOf(t);return~o?i+a(s,t,r,o):i+s},u=(e,t,r=e)=>o?n=>{let i=""+n,s=i.indexOf(t,e.length);return~s?e+a(i,t,r,s)+t:e+i+t}:String,c=o?e=>`\x1b[0m${e}\x1b[0m`:String,l=u("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m"),h=u("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"),f=u("\x1b[3m","\x1b[23m"),d=u("\x1b[4m","\x1b[24m"),p=u("\x1b[7m","\x1b[27m"),g=u("\x1b[8m","\x1b[28m"),m=u("\x1b[9m","\x1b[29m"),y=u("\x1b[30m","\x1b[39m"),b=u("\x1b[31m","\x1b[39m"),v=u("\x1b[32m","\x1b[39m"),_=u("\x1b[33m","\x1b[39m"),w=u("\x1b[34m","\x1b[39m"),E=u("\x1b[35m","\x1b[39m"),S=u("\x1b[38;2;173;127;168m","\x1b[39m"),R=u("\x1b[36m","\x1b[39m"),x=u("\x1b[37m","\x1b[39m"),A=u("\x1b[90m","\x1b[39m"),T=u("\x1b[40m","\x1b[49m"),P=u("\x1b[41m","\x1b[49m"),O=u("\x1b[42m","\x1b[49m"),C=u("\x1b[43m","\x1b[49m"),I=u("\x1b[44m","\x1b[49m"),N=u("\x1b[45m","\x1b[49m"),L=u("\x1b[46m","\x1b[49m"),M=u("\x1b[47m","\x1b[49m")},65477,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"LRUCache",{enumerable:!0,get:function(){return s}});class n{constructor(e,t,r){this.prev=null,this.next=null,this.key=e,this.data=t,this.size=r}}class i{constructor(){this.prev=null,this.next=null}}class s{constructor(e,t){this.cache=new Map,this.totalSize=0,this.maxSize=e,this.calculateSize=t,this.head=new i,this.tail=new i,this.head.next=this.tail,this.tail.prev=this.head}addToHead(e){e.prev=this.head,e.next=this.head.next,this.head.next.prev=e,this.head.next=e}removeNode(e){e.prev.next=e.next,e.next.prev=e.prev}moveToHead(e){this.removeNode(e),this.addToHead(e)}removeTail(){let e=this.tail.prev;return this.removeNode(e),e}set(e,t){let r=(null==this.calculateSize?void 0:this.calculateSize.call(this,t))??1;if(r>this.maxSize)return void console.warn("Single item size exceeds maxSize");let i=this.cache.get(e);if(i)i.data=t,this.totalSize=this.totalSize-i.size+r,i.size=r,this.moveToHead(i);else{let i=new n(e,t,r);this.cache.set(e,i),this.addToHead(i),this.totalSize+=r}for(;this.totalSize>this.maxSize&&this.cache.size>0;){let e=this.removeTail();this.cache.delete(e.key),this.totalSize-=e.size}}has(e){return this.cache.has(e)}get(e){let t=this.cache.get(e);if(t)return this.moveToHead(t),t.data}*[Symbol.iterator](){let e=this.head.next;for(;e&&e!==this.tail;){let t=e;yield[t.key,t.data],e=e.next}}remove(e){let t=this.cache.get(e);t&&(this.removeNode(t),this.cache.delete(e),this.totalSize-=t.size)}get size(){return this.cache.size}get currentSize(){return this.totalSize}}},40463,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{bootstrap:function(){return u},error:function(){return l},event:function(){return p},info:function(){return d},prefixes:function(){return s},ready:function(){return f},trace:function(){return g},wait:function(){return c},warn:function(){return h},warnOnce:function(){return y}});let n=e.r(30548),i=e.r(65477),s={wait:(0,n.white)((0,n.bold)("○")),error:(0,n.red)((0,n.bold)("⨯")),warn:(0,n.yellow)((0,n.bold)("⚠")),ready:"▲",info:(0,n.white)((0,n.bold)(" ")),event:(0,n.green)((0,n.bold)("✓")),trace:(0,n.magenta)((0,n.bold)("»"))},o={log:"log",warn:"warn",error:"error"};function a(e,...t){(""===t[0]||void 0===t[0])&&1===t.length&&t.shift();let r=e in o?o[e]:"log",n=s[e];0===t.length?console[r](""):1===t.length&&"string"==typeof t[0]?console[r](" "+n+" "+t[0]):console[r](" "+n,...t)}function u(...e){console.log(" "+e.join(" "))}function c(...e){a("wait",...e)}function l(...e){a("error",...e)}function h(...e){a("warn",...e)}function f(...e){a("ready",...e)}function d(...e){a("info",...e)}function p(...e){a("event",...e)}function g(...e){a("trace",...e)}let m=new i.LRUCache(1e4,e=>e.length);function y(...e){let t=e.join(" ");m.has(t)||(m.set(t,t),h(...e))}},70808,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{getRootParam:function(){return d},unstable_rootParams:function(){return f}});let n=e.r(4784),i=e.r(30810),s=e.r(56704),o=e.r(32319),a=e.r(53920),u=e.r(73298),c=e.r(20635),l=e.r(40463),h=new WeakMap;async function f(){(0,l.warnOnce)("`unstable_rootParams()` is deprecated and will be removed in an upcoming major release. Import specific root params from `next/root-params` instead.");let e=s.workAsyncStorage.getStore();if(!e)throw Object.defineProperty(new n.InvariantError("Missing workStore in unstable_rootParams"),"__NEXT_ERROR_CODE",{value:"E615",enumerable:!1,configurable:!0});let t=o.workUnitAsyncStorage.getStore();if(!t)throw Object.defineProperty(Error(`Route ${e.route} used \`unstable_rootParams()\` in Pages Router. This API is only available within App Router.`),"__NEXT_ERROR_CODE",{value:"E641",enumerable:!1,configurable:!0});switch(t.type){case"cache":case"unstable-cache":throw Object.defineProperty(Error(`Route ${e.route} used \`unstable_rootParams()\` inside \`"use cache"\` or \`unstable_cache\`. Support for this API inside cache scopes is planned for a future version of Next.js.`),"__NEXT_ERROR_CODE",{value:"E642",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":return function(e,t,r){switch(r.type){case"prerender-client":{let e="`unstable_rootParams`";throw Object.defineProperty(new n.InvariantError(`${e} must not be used within a client component. Next.js should be preventing ${e} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0})}case"prerender":{let n=r.fallbackRouteParams;if(n){for(let i in e)if(n.has(i)){let n=h.get(e);if(n)return n;let i=(0,a.makeHangingPromise)(r.renderSignal,t.route,"`unstable_rootParams`");return h.set(e,i),i}}break}case"prerender-ppr":{let n=r.fallbackRouteParams;if(n){for(let s in e)if(n.has(s))return function(e,t,r,n){let s=h.get(e);if(s)return s;let o={...e},a=Promise.resolve(o);return h.set(e,a),Object.keys(e).forEach(s=>{u.wellKnownProperties.has(s)||(t.has(s)?Object.defineProperty(o,s,{get(){let e=(0,u.describeStringPropertyAccess)("unstable_rootParams",s);"prerender-ppr"===n.type?(0,i.postponeWithTracking)(r.route,e,n.dynamicTracking):(0,i.throwToInterruptStaticGeneration)(e,r,n)},enumerable:!0}):a[s]=e[s])}),a}(e,n,t,r)}}}return Promise.resolve(e)}(t.rootParams,e,t);case"private-cache":case"prerender-runtime":case"request":return Promise.resolve(t.rootParams);default:return t}}function d(e){let t=`\`import('next/root-params').${e}()\``,r=s.workAsyncStorage.getStore();if(!r)throw Object.defineProperty(new n.InvariantError(`Missing workStore in ${t}`),"__NEXT_ERROR_CODE",{value:"E764",enumerable:!1,configurable:!0});let i=o.workUnitAsyncStorage.getStore();if(!i)throw Object.defineProperty(Error(`Route ${r.route} used ${t} outside of a Server Component. This is not allowed.`),"__NEXT_ERROR_CODE",{value:"E774",enumerable:!1,configurable:!0});let u=c.actionAsyncStorage.getStore();if(u){if(u.isAppRoute)throw Object.defineProperty(Error(`Route ${r.route} used ${t} inside a Route Handler. Support for this API in Route Handlers is planned for a future version of Next.js.`),"__NEXT_ERROR_CODE",{value:"E765",enumerable:!1,configurable:!0});if(u.isAction&&"action"===i.phase)throw Object.defineProperty(Error(`${t} was used inside a Server Action. This is not supported. Functions from 'next/root-params' can only be called in the context of a route.`),"__NEXT_ERROR_CODE",{value:"E766",enumerable:!1,configurable:!0})}switch(i.type){case"unstable-cache":case"cache":throw Object.defineProperty(Error(`Route ${r.route} used ${t} inside \`"use cache"\` or \`unstable_cache\`. Support for this API inside cache scopes is planned for a future version of Next.js.`),"__NEXT_ERROR_CODE",{value:"E760",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":var l=e,h=r,f=i,d=t;if("prerender-client"===f.type)throw Object.defineProperty(new n.InvariantError(`${d} must not be used within a client component. Next.js should be preventing ${d} from being included in client components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0});let g=f.rootParams;switch(f.type){case"prerender":if(f.fallbackRouteParams&&f.fallbackRouteParams.has(l))return(0,a.makeHangingPromise)(f.renderSignal,h.route,d);break;case"prerender-ppr":if(f.fallbackRouteParams&&f.fallbackRouteParams.has(l))return p(l,h,f,d)}return Promise.resolve(g[l])}return Promise.resolve(i.rootParams[e])}async function p(e,t,r,n){let s=(0,u.describeStringPropertyAccess)(n,e);switch(r.type){case"prerender-ppr":return(0,i.postponeWithTracking)(t.route,s,r.dynamicTracking);case"prerender-legacy":return(0,i.throwToInterruptStaticGeneration)(s,t,r)}}},49493,(e,t,r)=>{let n={NextRequest:e.r(60306).NextRequest,NextResponse:e.r(24173).NextResponse,ImageResponse:e.r(17878).ImageResponse,userAgentFromString:e.r(43632).userAgentFromString,userAgent:e.r(43632).userAgent,URLPattern:e.r(95437).URLPattern,after:e.r(33062).after,connection:e.r(20955).connection,unstable_rootParams:e.r(70808).unstable_rootParams};t.exports=n,r.NextRequest=n.NextRequest,r.NextResponse=n.NextResponse,r.ImageResponse=n.ImageResponse,r.userAgentFromString=n.userAgentFromString,r.userAgent=n.userAgent,r.URLPattern=n.URLPattern,r.after=n.after,r.connection=n.connection,r.unstable_rootParams=n.unstable_rootParams},29173,(e,t,r)=>{t.exports=e.x("@prisma/client",()=>require("@prisma/client"))},81962,(e,t,r)=>{"use strict";function n(e){let t=null!=e;return function(r){let n=r.length-1;if(1===n)return[];if("}"!==r[n])throw Error("Invalid array text - must end with }");let i=0;if("["===r[0]&&(i=r.indexOf("=")+1),"{"!==r[i++])throw Error("Invalid array text - must start with {");let s=[],o=s,a=[],u=i,c="",l=!0;for(;i<n;++i){let s=r[i];if('"'===s){u=++i;let n=r.indexOf('"',u),s=r.indexOf("\\",u);for(;-1!==s&&s<n;)i=s,c+=r.slice(u,i),u=++i,n===i++&&(n=r.indexOf('"',i)),s=r.indexOf("\\",i);i=n,c+=r.slice(u,i),o.push(t?e(c):c),c="",l=!1}else if("{"===s){let e=[];o.push(e),a.push(o),o=e,u=i+1,l=!0}else if(","===s)l=!0;else if("}"===s){l=!1;let e=a.pop();if(void 0===e)throw Error("Invalid array text - too many '}'");o=e}else if(l){for(u=i;","!==(s=r[i])&&"}"!==s&&i<n;)++i;let a=r.slice(u,i--);o.push("NULL"===a?null:t?e(a):a),l=!1}else throw Error("Was expecting delimeter")}return s}}let i=n();r.parse=(e,t)=>null!=t?n(t)(e):i(e)},24493,e=>{"use strict";let t;e.s(["getPrisma",()=>rj,"prisma",()=>rF],24493);var r,n,i,s,o,a,u,c,l,h,f=Object.create,d=Object.defineProperty,p=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,m=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty,b=(e,t)=>d(e,"name",{value:t,configurable:!0}),v=(e,t)=>()=>(e&&(t=e(e=0)),t),_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),w=(e,t)=>{for(var r in t)d(e,r,{get:t[r],enumerable:!0})},E=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of g(t))y.call(e,i)||i===r||d(e,i,{get:()=>t[i],enumerable:!(n=p(t,i))||n.enumerable});return e},S=(e,t,r)=>(r=null!=e?f(m(e)):{},E(!t&&e&&e.__esModule?r:d(r,"default",{value:e,enumerable:!0}),e)),R=e=>E(d({},"__esModule",{value:!0}),e),x=(e,t,r)=>((e,t,r)=>t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),A=_(e=>{O(),e.byteLength=u,e.toByteArray=l,e.fromByteArray=d;var t,r,n=[],i=[],s="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(t=0,r=o.length;t<r;++t)n[t]=o[t],i[o.charCodeAt(t)]=t;function a(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function u(e){var t=a(e),r=t[0],n=t[1];return(r+n)*3/4-n}function c(e,t,r){return(t+r)*3/4-r}function l(e){var t,r,n=a(e),o=n[0],u=n[1],l=new s(c(e,o,u)),h=0,f=u>0?o-4:o;for(r=0;r<f;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],l[h++]=t>>16&255,l[h++]=t>>8&255,l[h++]=255&t;return 2===u&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,l[h++]=255&t),1===u&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,l[h++]=t>>8&255,l[h++]=255&t),l}function h(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function f(e,t,r){for(var n=[],i=t;i<r;i+=3)n.push(h((e[i]<<16&0xff0000)+(e[i+1]<<8&65280)+(255&e[i+2])));return n.join("")}function d(e){for(var t,r=e.length,i=r%3,s=[],o=0,a=r-i;o<a;o+=16383)s.push(f(e,o,o+16383>a?a:o+16383));return 1===i?s.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===i&&s.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),s.join("")}i[45]=62,i[95]=63,b(a,"getLens"),b(u,"byteLength"),b(c,"_byteLength"),b(l,"toByteArray"),b(h,"tripletToBase64"),b(f,"encodeChunk"),b(d,"fromByteArray")}),T=_(e=>{O(),e.read=function(e,t,r,n,i){var s,o,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,h=r?i-1:0,f=r?-1:1,d=e[t+h];for(h+=f,s=d&(1<<-l)-1,d>>=-l,l+=a;l>0;s=256*s+e[t+h],h+=f,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+e[t+h],h+=f,l-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),s-=c}return(d?-1:1)*o*Math.pow(2,s-n)},e.write=function(e,t,r,n,i,s){var o,a,u,c=8*s-i-1,l=(1<<c)-1,h=l>>1,f=5960464477539062e-23*(23===i),d=n?0:s-1,p=n?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(a=+!!isNaN(t),o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+h>=1?t+=f/u:t+=f*Math.pow(2,1-h),t*u>=2&&(o++,u/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(t*u-1)*Math.pow(2,i),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;e[r+d]=255&o,d+=p,o/=256,c-=8);e[r+d-p]|=128*g}}),P=_(e=>{O();var t=A(),r=T(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function i(){try{let e=new Uint8Array(1),t={foo:b(function(){return 42},"foo")};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}function s(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return l(e)}return a(e,t,r)}function a(e,t,r){if("string"==typeof e)return h(e,t);if(ArrayBuffer.isView(e))return d(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(eo(e,ArrayBuffer)||e&&eo(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(eo(e,SharedArrayBuffer)||e&&eo(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);let i=g(e);if(i)return i;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e,t,r){return u(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}function l(e){return u(e),s(e<0?0:0|m(e))}function h(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!o.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=0|v(e,t),n=s(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function f(e){let t=e.length<0?0:0|m(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e){if(eo(e,Uint8Array)){let t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}function p(e,t,r){let n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),n}function g(e){if(o.isBuffer(e)){let t=0|m(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||ea(e.length)?s(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}function m(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function y(e){return+e!=e&&(e=0),o.alloc(+e)}function v(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||eo(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return et(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ei(e).length;default:if(i)return n?-1:et(e).length;t=(""+t).toLowerCase(),i=!0}}function _(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return D(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return N(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(n)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function w(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function E(e,t,r,n,i){if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),ea(r*=1)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return -1;r=e.length-1}else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:S(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):S(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function S(e,t,r,n,i){let s,o=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;o=2,a/=2,u/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(b(c,"read"),i){let n=-1;for(s=r;s<a;s++)if(c(e,s)===c(t,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===u)return n*o}else -1!==n&&(s-=s-n),n=-1}else for(r+u>a&&(r=a-u),s=r;s>=0;s--){let r=!0;for(let n=0;n<u;n++)if(c(e,s+n)!==c(t,n)){r=!1;break}if(r)return s}return -1}function R(e,t,r,n){let i;r=Number(r)||0;let s=e.length-r;n?(n=Number(n))>s&&(n=s):n=s;let o=t.length;for(n>o/2&&(n=o/2),i=0;i<n;++i){let n=parseInt(t.substr(2*i,2),16);if(ea(n))break;e[r+i]=n}return i}function x(e,t,r,n){return es(et(t,e.length-r),e,r,n)}function P(e,t,r,n){return es(er(t),e,r,n)}function C(e,t,r,n){return es(ei(t),e,r,n)}function I(e,t,r,n){return es(en(t,e.length-r),e,r,n)}function N(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function L(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let t=e[i],s=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,a,u;switch(o){case 1:t<128&&(s=t);break;case 2:(192&(r=e[i+1]))==128&&(u=(31&t)<<6|63&r)>127&&(s=u);break;case 3:r=e[i+1],n=e[i+2],(192&r)==128&&(192&n)==128&&(u=(15&t)<<12|(63&r)<<6|63&n)>2047&&(u<55296||u>57343)&&(s=u);break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],(192&r)==128&&(192&n)==128&&(192&a)==128&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a)>65535&&u<1114112&&(s=u)}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=o}return M(n)}function M(e){let t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}function D(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function k(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function B(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=eu[e[n]];return i}function j(e,t,r){let n=e.slice(t,r),i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function U(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function F(e,t,r,n,i,s){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function q(e,t,r,n,i){z(t,n,i,e,r,7);let s=Number(t&BigInt(0xffffffff));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function $(e,t,r,n,i){z(t,n,i,e,r,7);let s=Number(t&BigInt(0xffffffff));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function G(e,t,r,n,i,s){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function H(e,t,n,i,s){return t*=1,n>>>=0,s||G(e,t,n,4,34028234663852886e22,-34028234663852886e22),r.write(e,t,n,i,23,4),n+4}function V(e,t,n,i,s){return t*=1,n>>>=0,s||G(e,t,n,8,17976931348623157e292,-17976931348623157e292),r.write(e,t,n,i,52,8),n+8}e.Buffer=o,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,e.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),b(i,"typedArraySupport"),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:b(function(){if(o.isBuffer(this))return this.buffer},"get")}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:b(function(){if(o.isBuffer(this))return this.byteOffset},"get")}),b(s,"createBuffer"),b(o,"Buffer"),o.poolSize=8192,b(a,"from"),o.from=function(e,t,r){return a(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),b(u,"assertSize"),b(c,"alloc"),o.alloc=function(e,t,r){return c(e,t,r)},b(l,"allocUnsafe"),o.allocUnsafe=function(e){return l(e)},o.allocUnsafeSlow=function(e){return l(e)},b(h,"fromString"),b(f,"fromArrayLike"),b(d,"fromArrayView"),b(p,"fromArrayBuffer"),b(g,"fromObject"),b(m,"checked"),b(y,"SlowBuffer"),o.isBuffer=b(function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},"isBuffer"),o.compare=b(function(e,t){if(eo(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),eo(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},"compare"),o.isEncoding=b(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding"),o.concat=b(function(e,t){let r;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;let n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){let t=e[r];if(eo(t,Uint8Array))i+t.length>n.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else if(o.isBuffer(t))t.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=t.length}return n},"concat"),b(v,"byteLength"),o.byteLength=v,b(_,"slowToString"),o.prototype._isBuffer=!0,b(w,"swap"),o.prototype.swap16=b(function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)w(this,t,t+1);return this},"swap16"),o.prototype.swap32=b(function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)w(this,t,t+3),w(this,t+1,t+2);return this},"swap32"),o.prototype.swap64=b(function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)w(this,t,t+7),w(this,t+1,t+6),w(this,t+2,t+5),w(this,t+3,t+4);return this},"swap64"),o.prototype.toString=b(function(){let e=this.length;return 0===e?"":0==arguments.length?L(this,0,e):_.apply(this,arguments)},"toString"),o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=b(function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},"equals"),o.prototype.inspect=b(function(){let t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},"inspect"),n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=b(function(e,t,r,n,i){if(eo(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let s=i-n,a=r-t,u=Math.min(s,a),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<u;++e)if(c[e]!==l[e]){s=c[e],a=l[e];break}return s<a?-1:+(a<s)},"compare"),b(E,"bidirectionalIndexOf"),b(S,"arrayIndexOf"),o.prototype.includes=b(function(e,t,r){return -1!==this.indexOf(e,t,r)},"includes"),o.prototype.indexOf=b(function(e,t,r){return E(this,e,t,r,!0)},"indexOf"),o.prototype.lastIndexOf=b(function(e,t,r){return E(this,e,t,r,!1)},"lastIndexOf"),b(R,"hexWrite"),b(x,"utf8Write"),b(P,"asciiWrite"),b(C,"base64Write"),b(I,"ucs2Write"),o.prototype.write=b(function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return R(this,e,t,r);case"utf8":case"utf-8":return x(this,e,t,r);case"ascii":case"latin1":case"binary":return P(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(s)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},"write"),o.prototype.toJSON=b(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON"),b(N,"base64Slice"),b(L,"utf8Slice"),b(M,"decodeCodePointsArray"),b(D,"asciiSlice"),b(k,"latin1Slice"),b(B,"hexSlice"),b(j,"utf16leSlice"),o.prototype.slice=b(function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},"slice"),b(U,"checkOffset"),o.prototype.readUintLE=o.prototype.readUIntLE=b(function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n},"readUIntLE"),o.prototype.readUintBE=o.prototype.readUIntBE=b(function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},"readUIntBE"),o.prototype.readUint8=o.prototype.readUInt8=b(function(e,t){return e>>>=0,t||U(e,1,this.length),this[e]},"readUInt8"),o.prototype.readUint16LE=o.prototype.readUInt16LE=b(function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE"),o.prototype.readUint16BE=o.prototype.readUInt16BE=b(function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE"),o.prototype.readUint32LE=o.prototype.readUInt32LE=b(function(e,t){return e>>>=0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},"readUInt32LE"),o.prototype.readUint32BE=o.prototype.readUInt32BE=b(function(e,t){return e>>>=0,t||U(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE"),o.prototype.readBigUInt64LE=ec(b(function(e){K(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&J(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+0x1000000*this[++e],i=this[++e]+256*this[++e]+65536*this[++e]+0x1000000*r;return BigInt(n)+(BigInt(i)<<BigInt(32))},"readBigUInt64LE")),o.prototype.readBigUInt64BE=ec(b(function(e){K(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&J(e,this.length-8);let n=0x1000000*t+65536*this[++e]+256*this[++e]+this[++e],i=0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)},"readBigUInt64BE")),o.prototype.readIntLE=b(function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},"readIntLE"),o.prototype.readIntBE=b(function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=t,i=1,s=this[e+--n];for(;n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},"readIntBE"),o.prototype.readInt8=b(function(e,t){return e>>>=0,t||U(e,1,this.length),128&this[e]?-((255-this[e]+1)*1):this[e]},"readInt8"),o.prototype.readInt16LE=b(function(e,t){e>>>=0,t||U(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},"readInt16LE"),o.prototype.readInt16BE=b(function(e,t){e>>>=0,t||U(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},"readInt16BE"),o.prototype.readInt32LE=b(function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE"),o.prototype.readInt32BE=b(function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE"),o.prototype.readBigInt64LE=ec(b(function(e){K(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&J(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+0x1000000*this[++e])},"readBigInt64LE")),o.prototype.readBigInt64BE=ec(b(function(e){K(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&J(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r)},"readBigInt64BE")),o.prototype.readFloatLE=b(function(e,t){return e>>>=0,t||U(e,4,this.length),r.read(this,e,!0,23,4)},"readFloatLE"),o.prototype.readFloatBE=b(function(e,t){return e>>>=0,t||U(e,4,this.length),r.read(this,e,!1,23,4)},"readFloatBE"),o.prototype.readDoubleLE=b(function(e,t){return e>>>=0,t||U(e,8,this.length),r.read(this,e,!0,52,8)},"readDoubleLE"),o.prototype.readDoubleBE=b(function(e,t){return e>>>=0,t||U(e,8,this.length),r.read(this,e,!1,52,8)},"readDoubleBE"),b(F,"checkInt"),o.prototype.writeUintLE=o.prototype.writeUIntLE=b(function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;F(this,e,t,r,n,0)}let i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},"writeUIntLE"),o.prototype.writeUintBE=o.prototype.writeUIntBE=b(function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;F(this,e,t,r,n,0)}let i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},"writeUIntBE"),o.prototype.writeUint8=o.prototype.writeUInt8=b(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,1,255,0),this[t]=255&e,t+1},"writeUInt8"),o.prototype.writeUint16LE=o.prototype.writeUInt16LE=b(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},"writeUInt16LE"),o.prototype.writeUint16BE=o.prototype.writeUInt16BE=b(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},"writeUInt16BE"),o.prototype.writeUint32LE=o.prototype.writeUInt32LE=b(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},"writeUInt32LE"),o.prototype.writeUint32BE=o.prototype.writeUInt32BE=b(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},"writeUInt32BE"),b(q,"wrtBigUInt64LE"),b($,"wrtBigUInt64BE"),o.prototype.writeBigUInt64LE=ec(b(function(e,t=0){return q(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE")),o.prototype.writeBigUInt64BE=ec(b(function(e,t=0){return $(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE")),o.prototype.writeIntLE=b(function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);F(this,e,t,r,n-1,-n)}let i=0,s=1,o=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},"writeIntLE"),o.prototype.writeIntBE=b(function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);F(this,e,t,r,n-1,-n)}let i=r-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},"writeIntBE"),o.prototype.writeInt8=b(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},"writeInt8"),o.prototype.writeInt16LE=b(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},"writeInt16LE"),o.prototype.writeInt16BE=b(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},"writeInt16BE"),o.prototype.writeInt32LE=b(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE"),o.prototype.writeInt32BE=b(function(e,t,r){return e*=1,t>>>=0,r||F(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},"writeInt32BE"),o.prototype.writeBigInt64LE=ec(b(function(e,t=0){return q(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE")),o.prototype.writeBigInt64BE=ec(b(function(e,t=0){return $(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE")),b(G,"checkIEEE754"),b(H,"writeFloat"),o.prototype.writeFloatLE=b(function(e,t,r){return H(this,e,t,!0,r)},"writeFloatLE"),o.prototype.writeFloatBE=b(function(e,t,r){return H(this,e,t,!1,r)},"writeFloatBE"),b(V,"writeDouble"),o.prototype.writeDoubleLE=b(function(e,t,r){return V(this,e,t,!0,r)},"writeDoubleLE"),o.prototype.writeDoubleBE=b(function(e,t,r){return V(this,e,t,!1,r)},"writeDoubleBE"),o.prototype.copy=b(function(e,t,r,n){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},"copy"),o.prototype.fill=b(function(e,t,r,n){let i;if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{let s=o.isBuffer(e)?e:o.from(e,n),a=s.length;if(0===a)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this},"fill");var W={};function Q(e,t,r){var n;W[e]=(b(n=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}\
20
20
  ]: ${this.message}`}},"NodeError"),n)}function Y(e){let t="",r=e.length,n=+("-"===e[0]);for(;r>=n+4;r-=3)t=`\
21
21
  _${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function X(e,t,r){K(t,"offset"),(void 0===e[t]||void 0===e[t+r])&&J(t,e.length-(r+1))}function z(e,t,r,n,i,s){if(e>r||e<t){let n="bigint"==typeof t?"n":"",i;throw i=s>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n}\
22
22
  ** ${(s+1)*8}${n}`:`>= -(2${n} ** ${(s+1)*8-1}${n}) and < 2 ** ${(s+1)*8-1}${n}`:`>= ${t}${n} a\
23
- nd <= ${r}${n}`,new W.ERR_OUT_OF_RANGE("value",i,e)}X(n,i,s)}function K(e,t){if("number"!=typeof e)throw new W.ERR_INVALID_ARG_TYPE(t,"number",e)}function J(e,t,r){throw Math.floor(e)!==e?(K(e,r),new W.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new W.ERR_BUFFER_OUT_OF_BOUNDS:new W.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${t}`,e)}y(Q,"E"),Q("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Q("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received typ\
23
+ nd <= ${r}${n}`,new W.ERR_OUT_OF_RANGE("value",i,e)}X(n,i,s)}function K(e,t){if("number"!=typeof e)throw new W.ERR_INVALID_ARG_TYPE(t,"number",e)}function J(e,t,r){throw Math.floor(e)!==e?(K(e,r),new W.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new W.ERR_BUFFER_OUT_OF_BOUNDS:new W.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${t}`,e)}b(Q,"E"),Q("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Q("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received typ\
24
24
  e ${typeof t}`},TypeError),Q("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out o\
25
25
  f range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?i=Y(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Y(i)),i+="n"),n+=` It must be ${t}. Re\
26
- ceived ${i}`},RangeError),y(Y,"addNumericalSeparator"),y(X,"checkBounds"),y(z,"checkIntBI"),y(K,"validateNumber"),y(J,"boundsError");var Z=/[^+/0-9A-Za-z-_]/g;function ee(e){if((e=(e=e.split("=")[0]).trim().replace(Z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function et(e,t){t=t||1/0;let r,n=e.length,i=null,s=[];for(let o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319||o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function er(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function en(e,t){let r,n,i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i.push(r%256),i.push(n);return i}function ei(e){return t.toByteArray(ee(e))}function es(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function eo(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function ea(e){return e!=e}y(ee,"base64clean"),y(et,"utf8ToBytes"),y(er,"asciiToBytes"),y(en,"utf16leToBytes"),y(ei,"base64ToBytes"),y(es,"blitBuffer"),y(eo,"isInstance"),y(ea,"numberIsNaN");var eu=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function ec(e){return typeof BigInt>"u"?el:e}function el(){throw Error("BigInt not supported")}y(ec,"defineBigIntMethod"),y(el,"BufferBigIntNotDefined")}),P=b(()=>{a=globalThis,u=globalThis.setImmediate??(e=>setTimeout(e,0)),globalThis.clearImmediate??(e=>clearTimeout(e)),c="function"==typeof globalThis.Buffer&&"function"==typeof globalThis.Buffer.allocUnsafe?globalThis.Buffer:T().Buffer,(l=globalThis.process??{}).env??(l.env={});try{l.nextTick(()=>{})}catch{let e=Promise.resolve();l.nextTick=e.then.bind(e)}}),O=v((e,t)=>{P();var r,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:y(function(e,t,r){return Function.prototype.apply.call(e,t,r)},"ReflectApply");function s(e){console&&console.warn&&console.warn(e)}r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?y(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):y(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys"),y(s,"ProcessEmitWarning");var o=Number.isNaN||y(function(e){return e!=e},"NumberIsNaN");function a(){a.init.call(this)}y(a,"EventEmitter"),t.exports=a,t.exports.once=_,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function h(e,t,r,n){var i,o,a;if(c(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s(u)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?v(i):m(i,i.length)}function g(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r}function b(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function _(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,s),n(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}y(i,"errorListener"),y(s,"resolver"),E(e,t,s,{once:!0}),"error"!==t&&w(e,i,{once:!0})})}function w(e,t,r){"function"==typeof e.on&&E(e,"error",t,r)}function E(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else if("function"==typeof e.addEventListener)e.addEventListener(t,y(function i(s){n.once&&e.removeEventListener(t,i),r(s)},"wrapListener"));else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}y(c,"checkListener"),Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:y(function(){return u},"get"),set:y(function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e},"set")}),a.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=y(function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners"),y(l,"_getMaxListeners"),a.prototype.getMaxListeners=y(function(){return l(this)},"getMaxListeners"),a.prototype.emit=y(function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var o,a=Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var u=s[e];if(void 0===u)return!1;if("function"==typeof u)i(u,this,t);else for(var c=u.length,l=m(u,c),r=0;r<c;++r)i(l[r],this,t);return!0},"emit"),y(h,"_addListener"),a.prototype.addListener=y(function(e,t){return h(this,e,t,!1)},"addListener"),a.prototype.on=a.prototype.addListener,a.prototype.prependListener=y(function(e,t){return h(this,e,t,!0)},"prependListener"),y(f,"onceWrapper"),y(d,"_onceWrap"),a.prototype.once=y(function(e,t){return c(t),this.on(e,d(this,e,t)),this},"once"),a.prototype.prependOnceListener=y(function(e,t){return c(t),this.prependListener(e,d(this,e,t)),this},"prependOnceListener"),a.prototype.removeListener=y(function(e,t){var r,n,i,s,o;if(c(t),void 0===(n=this._events)||void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,i=s;break}if(i<0)return this;0===i?r.shift():b(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},"removeListener"),a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=y(function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var i,s=Object.keys(r);for(n=0;n<s.length;++n)"removeListener"!==(i=s[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},"removeAllListeners"),y(p,"_listeners"),a.prototype.listeners=y(function(e){return p(this,e,!0)},"listeners"),a.prototype.rawListeners=y(function(e){return p(this,e,!1)},"rawListeners"),a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},a.prototype.listenerCount=g,y(g,"listenerCount"),a.prototype.eventNames=y(function(){return this._eventsCount>0?r(this._events):[]},"eventNames"),y(m,"arrayClone"),y(b,"spliceOne"),y(v,"unwrapListeners"),y(_,"once"),y(w,"addErrorHandlerIfEventEmitter"),y(E,"eventTargetAgnosticAddListener")}),C={};function I(e){return 0}_(C,{Socket:()=>D,isIP:()=>I});var N,L,M,D,k=b(()=>{P(),N=E(O(),1),y(I,"isIP"),L=/^[^.]+\./,M=class e extends N.EventEmitter{constructor(){super(...arguments),R(this,"opts",{}),R(this,"connecting",!1),R(this,"pending",!0),R(this,"writable",!0),R(this,"encrypted",!1),R(this,"authorized",!1),R(this,"destroyed",!1),R(this,"ws",null),R(this,"writeBuffer"),R(this,"tlsState",0),R(this,"tlsRead"),R(this,"tlsWrite")}static get poolQueryViaFetch(){return e.opts.poolQueryViaFetch??e.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){e.opts.poolQueryViaFetch=t}static get fetchEndpoint(){return e.opts.fetchEndpoint??e.defaults.fetchEndpoint}static set fetchEndpoint(t){e.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(e){console.warn("The `fetchConnectionCache` option is deprecated (now always `true`)")}static get fetchFunction(){return e.opts.fetchFunction??e.defaults.fetchFunction}static set fetchFunction(t){e.opts.fetchFunction=t}static get webSocketConstructor(){return e.opts.webSocketConstructor??e.defaults.webSocketConstructor}static set webSocketConstructor(t){e.opts.webSocketConstructor=t}get webSocketConstructor(){return this.opts.webSocketConstructor??e.webSocketConstructor}set webSocketConstructor(e){this.opts.webSocketConstructor=e}static get wsProxy(){return e.opts.wsProxy??e.defaults.wsProxy}static set wsProxy(t){e.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy??e.wsProxy}set wsProxy(e){this.opts.wsProxy=e}static get coalesceWrites(){return e.opts.coalesceWrites??e.defaults.coalesceWrites}static set coalesceWrites(t){e.opts.coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??e.coalesceWrites}set coalesceWrites(e){this.opts.coalesceWrites=e}static get useSecureWebSocket(){return e.opts.useSecureWebSocket??e.defaults.useSecureWebSocket}static set useSecureWebSocket(t){e.opts.useSecureWebSocket=t}get useSecureWebSocket(){return this.opts.useSecureWebSocket??e.useSecureWebSocket}set useSecureWebSocket(e){this.opts.useSecureWebSocket=e}static get forceDisablePgSSL(){return e.opts.forceDisablePgSSL??e.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){e.opts.forceDisablePgSSL=t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??e.forceDisablePgSSL}set forceDisablePgSSL(e){this.opts.forceDisablePgSSL=e}static get disableSNI(){return e.opts.disableSNI??e.defaults.disableSNI}static set disableSNI(t){e.opts.disableSNI=t}get disableSNI(){return this.opts.disableSNI??e.disableSNI}set disableSNI(e){this.opts.disableSNI=e}static get disableWarningInBrowsers(){return e.opts.disableWarningInBrowsers??e.defaults.disableWarningInBrowsers}static set disableWarningInBrowsers(t){e.opts.disableWarningInBrowsers=t}get disableWarningInBrowsers(){return this.opts.disableWarningInBrowsers??e.disableWarningInBrowsers}set disableWarningInBrowsers(e){this.opts.disableWarningInBrowsers=e}static get pipelineConnect(){return e.opts.pipelineConnect??e.defaults.pipelineConnect}static set pipelineConnect(t){e.opts.pipelineConnect=t}get pipelineConnect(){return this.opts.pipelineConnect??e.pipelineConnect}set pipelineConnect(e){this.opts.pipelineConnect=e}static get subtls(){return e.opts.subtls??e.defaults.subtls}static set subtls(t){e.opts.subtls=t}get subtls(){return this.opts.subtls??e.subtls}set subtls(e){this.opts.subtls=e}static get pipelineTLS(){return e.opts.pipelineTLS??e.defaults.pipelineTLS}static set pipelineTLS(t){e.opts.pipelineTLS=t}get pipelineTLS(){return this.opts.pipelineTLS??e.pipelineTLS}set pipelineTLS(e){this.opts.pipelineTLS=e}static get rootCerts(){return e.opts.rootCerts??e.defaults.rootCerts}static set rootCerts(t){e.opts.rootCerts=t}get rootCerts(){return this.opts.rootCerts??e.rootCerts}set rootCerts(e){this.opts.rootCerts=e}wsProxyAddrForHost(e,t){let r=this.wsProxy;if(void 0===r)throw Error("No WebSocket proxy is configured. Please see https://github.com/neondatabase/serverless/blob/main/CONFIG.md#wsproxy-string--host-string-port-number--string--string");return"function"==typeof r?r(e,t):`${r}?address=${e}:${t}`}setNoDelay(){return this}setKeepAlive(){return this}ref(){return this}unref(){return this}connect(e,t,r){this.connecting=!0,r&&this.once("connect",r);let n=y(()=>{this.connecting=!1,this.pending=!1,this.emit("connect"),this.emit("ready")},"handleWebSocketOpen"),i=y((e,t=!1)=>{e.binaryType="arraybuffer",e.addEventListener("error",e=>{this.emit("error",e),this.emit("close")}),e.addEventListener("message",e=>{if(0===this.tlsState){let t=c.from(e.data);this.emit("data",t)}}),e.addEventListener("close",()=>{this.emit("close")}),t?n():e.addEventListener("open",n)},"configureWebSocket"),s;try{s=this.wsProxyAddrForHost(t,"string"==typeof e?parseInt(e,10):e)}catch(e){this.emit("error",e),this.emit("close");return}try{let e=(this.useSecureWebSocket?"wss:":"ws:")+"//"+s;if(void 0!==this.webSocketConstructor)this.ws=new this.webSocketConstructor(e),i(this.ws);else try{this.ws=new WebSocket(e),i(this.ws)}catch{this.ws=new __unstable_WebSocket(e),i(this.ws)}}catch(e){fetch((this.useSecureWebSocket?"https:":"http:")+"//"+s,{headers:{Upgrade:"websocket"}}).then(t=>{if(this.ws=t.webSocket,null==this.ws)throw e;this.ws.accept(),i(this.ws,!0)}).catch(e=>{this.emit("error",Error(`All attempts to open a WebSocket to connect to the database failed. Please refer \
26
+ ceived ${i}`},RangeError),b(Y,"addNumericalSeparator"),b(X,"checkBounds"),b(z,"checkIntBI"),b(K,"validateNumber"),b(J,"boundsError");var Z=/[^+/0-9A-Za-z-_]/g;function ee(e){if((e=(e=e.split("=")[0]).trim().replace(Z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function et(e,t){t=t||1/0;let r,n=e.length,i=null,s=[];for(let o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319||o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function er(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function en(e,t){let r,n,i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i.push(r%256),i.push(n);return i}function ei(e){return t.toByteArray(ee(e))}function es(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function eo(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function ea(e){return e!=e}b(ee,"base64clean"),b(et,"utf8ToBytes"),b(er,"asciiToBytes"),b(en,"utf16leToBytes"),b(ei,"base64ToBytes"),b(es,"blitBuffer"),b(eo,"isInstance"),b(ea,"numberIsNaN");var eu=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function ec(e){return typeof BigInt>"u"?el:e}function el(){throw Error("BigInt not supported")}b(ec,"defineBigIntMethod"),b(el,"BufferBigIntNotDefined")}),O=v(()=>{u=globalThis,c=globalThis.setImmediate??(e=>setTimeout(e,0)),globalThis.clearImmediate??(e=>clearTimeout(e)),l="function"==typeof globalThis.Buffer&&"function"==typeof globalThis.Buffer.allocUnsafe?globalThis.Buffer:P().Buffer,(h=globalThis.process??{}).env??(h.env={});try{h.nextTick(()=>{})}catch{let e=Promise.resolve();h.nextTick=e.then.bind(e)}}),C=_((e,t)=>{O();var r,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:b(function(e,t,r){return Function.prototype.apply.call(e,t,r)},"ReflectApply");function s(e){console&&console.warn&&console.warn(e)}r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?b(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):b(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys"),b(s,"ProcessEmitWarning");var o=Number.isNaN||b(function(e){return e!=e},"NumberIsNaN");function a(){a.init.call(this)}b(a,"EventEmitter"),t.exports=a,t.exports.once=_,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function h(e,t,r,n){var i,o,a;if(c(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s(u)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?v(i):m(i,i.length)}function g(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function _(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,s),n(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}b(i,"errorListener"),b(s,"resolver"),E(e,t,s,{once:!0}),"error"!==t&&w(e,i,{once:!0})})}function w(e,t,r){"function"==typeof e.on&&E(e,"error",t,r)}function E(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else if("function"==typeof e.addEventListener)e.addEventListener(t,b(function i(s){n.once&&e.removeEventListener(t,i),r(s)},"wrapListener"));else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}b(c,"checkListener"),Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:b(function(){return u},"get"),set:b(function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e},"set")}),a.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=b(function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners"),b(l,"_getMaxListeners"),a.prototype.getMaxListeners=b(function(){return l(this)},"getMaxListeners"),a.prototype.emit=b(function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var o,a=Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var u=s[e];if(void 0===u)return!1;if("function"==typeof u)i(u,this,t);else for(var c=u.length,l=m(u,c),r=0;r<c;++r)i(l[r],this,t);return!0},"emit"),b(h,"_addListener"),a.prototype.addListener=b(function(e,t){return h(this,e,t,!1)},"addListener"),a.prototype.on=a.prototype.addListener,a.prototype.prependListener=b(function(e,t){return h(this,e,t,!0)},"prependListener"),b(f,"onceWrapper"),b(d,"_onceWrap"),a.prototype.once=b(function(e,t){return c(t),this.on(e,d(this,e,t)),this},"once"),a.prototype.prependOnceListener=b(function(e,t){return c(t),this.prependListener(e,d(this,e,t)),this},"prependOnceListener"),a.prototype.removeListener=b(function(e,t){var r,n,i,s,o;if(c(t),void 0===(n=this._events)||void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,i=s;break}if(i<0)return this;0===i?r.shift():y(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},"removeListener"),a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=b(function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var i,s=Object.keys(r);for(n=0;n<s.length;++n)"removeListener"!==(i=s[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},"removeAllListeners"),b(p,"_listeners"),a.prototype.listeners=b(function(e){return p(this,e,!0)},"listeners"),a.prototype.rawListeners=b(function(e){return p(this,e,!1)},"rawListeners"),a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},a.prototype.listenerCount=g,b(g,"listenerCount"),a.prototype.eventNames=b(function(){return this._eventsCount>0?r(this._events):[]},"eventNames"),b(m,"arrayClone"),b(y,"spliceOne"),b(v,"unwrapListeners"),b(_,"once"),b(w,"addErrorHandlerIfEventEmitter"),b(E,"eventTargetAgnosticAddListener")}),I={};function N(e){return 0}w(I,{Socket:()=>k,isIP:()=>N});var L,M,D,k,B=v(()=>{O(),L=S(C(),1),b(N,"isIP"),M=/^[^.]+\./,D=class e extends L.EventEmitter{constructor(){super(...arguments),x(this,"opts",{}),x(this,"connecting",!1),x(this,"pending",!0),x(this,"writable",!0),x(this,"encrypted",!1),x(this,"authorized",!1),x(this,"destroyed",!1),x(this,"ws",null),x(this,"writeBuffer"),x(this,"tlsState",0),x(this,"tlsRead"),x(this,"tlsWrite")}static get poolQueryViaFetch(){return e.opts.poolQueryViaFetch??e.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){e.opts.poolQueryViaFetch=t}static get fetchEndpoint(){return e.opts.fetchEndpoint??e.defaults.fetchEndpoint}static set fetchEndpoint(t){e.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(e){console.warn("The `fetchConnectionCache` option is deprecated (now always `true`)")}static get fetchFunction(){return e.opts.fetchFunction??e.defaults.fetchFunction}static set fetchFunction(t){e.opts.fetchFunction=t}static get webSocketConstructor(){return e.opts.webSocketConstructor??e.defaults.webSocketConstructor}static set webSocketConstructor(t){e.opts.webSocketConstructor=t}get webSocketConstructor(){return this.opts.webSocketConstructor??e.webSocketConstructor}set webSocketConstructor(e){this.opts.webSocketConstructor=e}static get wsProxy(){return e.opts.wsProxy??e.defaults.wsProxy}static set wsProxy(t){e.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy??e.wsProxy}set wsProxy(e){this.opts.wsProxy=e}static get coalesceWrites(){return e.opts.coalesceWrites??e.defaults.coalesceWrites}static set coalesceWrites(t){e.opts.coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??e.coalesceWrites}set coalesceWrites(e){this.opts.coalesceWrites=e}static get useSecureWebSocket(){return e.opts.useSecureWebSocket??e.defaults.useSecureWebSocket}static set useSecureWebSocket(t){e.opts.useSecureWebSocket=t}get useSecureWebSocket(){return this.opts.useSecureWebSocket??e.useSecureWebSocket}set useSecureWebSocket(e){this.opts.useSecureWebSocket=e}static get forceDisablePgSSL(){return e.opts.forceDisablePgSSL??e.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){e.opts.forceDisablePgSSL=t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??e.forceDisablePgSSL}set forceDisablePgSSL(e){this.opts.forceDisablePgSSL=e}static get disableSNI(){return e.opts.disableSNI??e.defaults.disableSNI}static set disableSNI(t){e.opts.disableSNI=t}get disableSNI(){return this.opts.disableSNI??e.disableSNI}set disableSNI(e){this.opts.disableSNI=e}static get disableWarningInBrowsers(){return e.opts.disableWarningInBrowsers??e.defaults.disableWarningInBrowsers}static set disableWarningInBrowsers(t){e.opts.disableWarningInBrowsers=t}get disableWarningInBrowsers(){return this.opts.disableWarningInBrowsers??e.disableWarningInBrowsers}set disableWarningInBrowsers(e){this.opts.disableWarningInBrowsers=e}static get pipelineConnect(){return e.opts.pipelineConnect??e.defaults.pipelineConnect}static set pipelineConnect(t){e.opts.pipelineConnect=t}get pipelineConnect(){return this.opts.pipelineConnect??e.pipelineConnect}set pipelineConnect(e){this.opts.pipelineConnect=e}static get subtls(){return e.opts.subtls??e.defaults.subtls}static set subtls(t){e.opts.subtls=t}get subtls(){return this.opts.subtls??e.subtls}set subtls(e){this.opts.subtls=e}static get pipelineTLS(){return e.opts.pipelineTLS??e.defaults.pipelineTLS}static set pipelineTLS(t){e.opts.pipelineTLS=t}get pipelineTLS(){return this.opts.pipelineTLS??e.pipelineTLS}set pipelineTLS(e){this.opts.pipelineTLS=e}static get rootCerts(){return e.opts.rootCerts??e.defaults.rootCerts}static set rootCerts(t){e.opts.rootCerts=t}get rootCerts(){return this.opts.rootCerts??e.rootCerts}set rootCerts(e){this.opts.rootCerts=e}wsProxyAddrForHost(e,t){let r=this.wsProxy;if(void 0===r)throw Error("No WebSocket proxy is configured. Please see https://github.com/neondatabase/serverless/blob/main/CONFIG.md#wsproxy-string--host-string-port-number--string--string");return"function"==typeof r?r(e,t):`${r}?address=${e}:${t}`}setNoDelay(){return this}setKeepAlive(){return this}ref(){return this}unref(){return this}connect(e,t,r){this.connecting=!0,r&&this.once("connect",r);let n=b(()=>{this.connecting=!1,this.pending=!1,this.emit("connect"),this.emit("ready")},"handleWebSocketOpen"),i=b((e,t=!1)=>{e.binaryType="arraybuffer",e.addEventListener("error",e=>{this.emit("error",e),this.emit("close")}),e.addEventListener("message",e=>{if(0===this.tlsState){let t=l.from(e.data);this.emit("data",t)}}),e.addEventListener("close",()=>{this.emit("close")}),t?n():e.addEventListener("open",n)},"configureWebSocket"),s;try{s=this.wsProxyAddrForHost(t,"string"==typeof e?parseInt(e,10):e)}catch(e){this.emit("error",e),this.emit("close");return}try{let e=(this.useSecureWebSocket?"wss:":"ws:")+"//"+s;if(void 0!==this.webSocketConstructor)this.ws=new this.webSocketConstructor(e),i(this.ws);else try{this.ws=new WebSocket(e),i(this.ws)}catch{this.ws=new __unstable_WebSocket(e),i(this.ws)}}catch(e){fetch((this.useSecureWebSocket?"https:":"http:")+"//"+s,{headers:{Upgrade:"websocket"}}).then(t=>{if(this.ws=t.webSocket,null==this.ws)throw e;this.ws.accept(),i(this.ws,!0)}).catch(e=>{this.emit("error",Error(`All attempts to open a WebSocket to connect to the database failed. Please refer \
27
27
  to https://github.com/neondatabase/serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websoc\
28
- ket--undefined. Details: ${e}`)),this.emit("close")})}}async startTls(e){if(void 0===this.subtls)throw Error("For Postgres SSL connections, you must set `neonConfig.subtls` to the subtls library. See https://github.com/neondatabase/serverless/blob/main/CONFIG.md for more information.");this.tlsState=1;let t=await this.subtls.TrustedCert.databaseFromPEM(this.rootCerts),r=new this.subtls.WebSocketReadQueue(this.ws),n=r.read.bind(r),i=this.rawWrite.bind(this),{read:s,write:o}=await this.subtls.startTls(e,t,n,i,{useSNI:!this.disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead=s,this.tlsWrite=o,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){for(;;){let e=await this.tlsRead();if(void 0===e)break;{let t=c.from(e);this.emit("data",t)}}}rawWrite(e){if(!this.coalesceWrites){this.ws&&this.ws.send(e);return}if(void 0===this.writeBuffer)this.writeBuffer=e,setTimeout(()=>{this.ws&&this.ws.send(this.writeBuffer),this.writeBuffer=void 0},0);else{let t=new Uint8Array(this.writeBuffer.length+e.length);t.set(this.writeBuffer),t.set(e,this.writeBuffer.length),this.writeBuffer=t}}write(e,t="utf8",r=e=>{}){return 0===e.length?r():("string"==typeof e&&(e=c.from(e,t)),0===this.tlsState?(this.rawWrite(e),r()):1===this.tlsState?this.once("secureConnection",()=>{this.write(e,t,r)}):(this.tlsWrite(e),r())),!0}end(e=c.alloc(0),t="utf8",r=()=>{}){return this.write(e,t,()=>{this.ws.close(),r()}),this}destroy(){return this.destroyed=!0,this.end()}},y(M,"Socket"),R(M,"defaults",{poolQueryViaFetch:!1,fetchEndpoint:y((e,t,r)=>"https://"+(r?.jwtAuth?e.replace(L,"apiauth."):e.replace(L,"api."))+"/sql","fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0,webSocketConstructor:void 0,wsProxy:y(e=>e+"/v2","wsProxy"),useSecureWebSocket:!0,forceDisablePgSSL:!0,coalesceWrites:!0,pipelineConnect:"password",subtls:void 0,rootCerts:"",pipelineTLS:!1,disableSNI:!1,disableWarningInBrowsers:!1}),R(M,"opts",{}),D=M}),B={};function j(e,t=!1){let{protocol:r}=new URL(e),{username:n,password:i,host:s,hostname:o,port:a,pathname:u,search:c,searchParams:l,hash:h}=new URL("http:"+e.substring(r.length));i=decodeURIComponent(i),n=decodeURIComponent(n),u=decodeURIComponent(u);let f=n+":"+i,d=t?Object.fromEntries(l.entries()):c;return{href:e,protocol:r,auth:f,username:n,password:i,host:s,hostname:o,port:a,pathname:u,search:c,query:d,hash:h}}_(B,{parse:()=>j});var U=b(()=>{P(),y(j,"parse")}),F=v(e=>{P(),e.parse=function(e,t){return new r(e,t).parse()};var t=class e{constructor(e,t){this.source=e,this.transform=t||n,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)&&("NULL"!==(t=this.recorded.join(""))||e||(t=null),null!==t&&(t=this.transform(t)),this.entries.push(t),this.recorded=[])}consumeDimensions(){if("["===this.source[0])for(;!this.isEof()&&"="!==this.nextCharacter().value;);}parse(t){var r,n,i;for(this.consumeDimensions();!this.isEof();)if("{"!==(r=this.nextCharacter()).value||i){if("}"!==r.value||i)'"'!==r.value||r.escaped?","!==r.value||i?this.record(r.value):this.newEntry():(i&&this.newEntry(!0),i=!i);else if(this.dimension--,!this.dimension&&(this.newEntry(),t))return this.entries}else this.dimension++,this.dimension>1&&(n=new e(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse(!0)),this.position+=n.position-2);if(0!==this.dimension)throw Error("array dimension not balanced");return this.entries}};y(t,"ArrayParser");var r=t;function n(e){return e}y(n,"identity")}),q=v((e,t)=>{P();var r=F();t.exports={create:y(function(e,t){return{parse:y(function(){return r.parse(e,t)},"parse")}},"create")}}),$=v((e,t)=>{P();var r=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,n=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,i=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,s=/^-?infinity$/;function o(e){var t=n.exec(e);if(t){var r=parseInt(t[1],10);t[4]&&(r=u(r));var i=new Date(r,parseInt(t[2],10)-1,t[3]);return c(r)&&i.setFullYear(r),i}}function a(e){if(e.endsWith("+00"))return 0;var t=i.exec(e.split(" ")[1]);if(t){var r=t[1];return"Z"===r?0:(3600*parseInt(t[2],10)+60*parseInt(t[3]||0,10)+parseInt(t[4]||0,10))*("-"===r?-1:1)*1e3}}function u(e){return-(e-1)}function c(e){return e>=0&&e<100}t.exports=y(function(e){if(s.test(e))return Number(e.replace("i","I"));var t=r.exec(e);if(!t)return o(e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=u(i));var l=parseInt(t[2],10)-1,h=t[3],f=parseInt(t[4],10),d=parseInt(t[5],10),p=parseInt(t[6],10),g=t[7];g=g?1e3*parseFloat(g):0;var m,y=a(e);return null!=y?(m=new Date(Date.UTC(i,l,h,f,d,p,g)),c(i)&&m.setUTCFullYear(i),0!==y&&m.setTime(m.getTime()-y)):(m=new Date(i,l,h,f,d,p,g),c(i)&&m.setFullYear(i)),m},"parseDate"),y(o,"getDate"),y(a,"timeZoneOffset"),y(u,"bcYearToNegativeYear"),y(c,"is0To99")}),G=v((e,t)=>{P(),t.exports=n;var r=Object.prototype.hasOwnProperty;function n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)r.call(n,i)&&(e[i]=n[i])}return e}y(n,"extend")}),H=v((e,t)=>{P();var r=G();function n(e){if(!(this instanceof n))return new n(e);r(this,d(e))}t.exports=n,y(n,"PostgresInterval");var i=["seconds","minutes","hours","days","months","years"];n.prototype.toPostgres=function(){var e=i.filter(this.hasOwnProperty,this);return this.milliseconds&&0>e.indexOf("seconds")&&e.push("seconds"),0===e.length?"0":e.map(function(e){var t=this[e]||0;return"seconds"===e&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/,"")),t+" "+e},this).join(" ")};var s={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"S"},o=["years","months","days"],a=["hours","minutes","seconds"];n.prototype.toISOString=n.prototype.toISO=function(){return"P"+o.map(e,this).join("")+"T"+a.map(e,this).join("");function e(e){var t=this[e]||0;return"seconds"===e&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/0+$/,"")),t+s[e]}};var u="([+-]?\\d+)",c=new RegExp([u+"\\s+years?",u+"\\s+mons?",u+"\\s+days?","([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?"].map(function(e){return"("+e+")?"}).join("\\s*")),l={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},h=["hours","minutes","seconds","milliseconds"];function f(e){return parseInt(e+"000000".slice(e.length),10)/1e3}function d(e){if(!e)return{};var t=c.exec(e),r="-"===t[8];return Object.keys(l).reduce(function(e,n){var i=t[l[n]];return i&&(i="milliseconds"===n?f(i):parseInt(i,10))&&(r&&~h.indexOf(n)&&(i*=-1),e[n]=i),e},{})}y(f,"parseMilliseconds"),y(d,"parse")}),V=v((e,t)=>{P(),t.exports=y(function(e){if(/^\\x/.test(e))return new c(e.substr(2),"hex");for(var t="",r=0;r<e.length;)if("\\"!==e[r])t+=e[r],++r;else if(/[0-7]{3}/.test(e.substr(r+1,3)))t+=String.fromCharCode(parseInt(e.substr(r+1,3),8)),r+=4;else{for(var n=1;r+n<e.length&&"\\"===e[r+n];)n++;for(var i=0;i<Math.floor(n/2);++i)t+="\\";r+=2*Math.floor(n/2)}return new c(t,"binary")},"parseBytea")}),W=v((e,t)=>{P();var r=F(),n=q(),i=$(),s=H(),o=V();function a(e){return y(function(t){return null===t?t:e(t)},"nullAllowed")}function u(e){return null===e?e:"TRUE"===e||"t"===e||"true"===e||"y"===e||"yes"===e||"on"===e||"1"===e}function c(e){return e?r.parse(e,u):null}function l(e){return parseInt(e,10)}function h(e){return e?r.parse(e,a(l)):null}function f(e){return e?r.parse(e,a(function(e){return w(e).trim()})):null}y(a,"allowNull"),y(u,"parseBool"),y(c,"parseBoolArray"),y(l,"parseBaseTenInt"),y(h,"parseIntegerArray"),y(f,"parseBigIntegerArray");var d=y(function(e){return e?n.create(e,function(e){return null!==e&&(e=S(e)),e}).parse():null},"parsePointArray"),p=y(function(e){return e?n.create(e,function(e){return null!==e&&(e=parseFloat(e)),e}).parse():null},"parseFloatArray"),g=y(function(e){return e?n.create(e).parse():null},"parseStringArray"),m=y(function(e){return e?n.create(e,function(e){return null!==e&&(e=i(e)),e}).parse():null},"parseDateArray"),b=y(function(e){return e?n.create(e,function(e){return null!==e&&(e=s(e)),e}).parse():null},"parseIntervalArray"),v=y(function(e){return e?r.parse(e,a(o)):null},"parseByteAArray"),_=y(function(e){return parseInt(e,10)},"parseInteger"),w=y(function(e){var t=String(e);return/^\d+$/.test(t)?t:e},"parseBigInteger"),E=y(function(e){return e?r.parse(e,a(JSON.parse)):null},"parseJsonArray"),S=y(function(e){return"("!==e[0]?null:{x:parseFloat((e=e.substring(1,e.length-1).split(","))[0]),y:parseFloat(e[1])}},"parsePoint"),R=y(function(e){if("<"!==e[0]&&"("!==e[1])return null;for(var t="(",r="",n=!1,i=2;i<e.length-1;i++){if(n||(t+=e[i]),")"===e[i]){n=!0;continue}n&&","!==e[i]&&(r+=e[i])}var s=S(t);return s.radius=parseFloat(r),s},"parseCircle");t.exports={init:y(function(e){e(20,w),e(21,_),e(23,_),e(26,_),e(700,parseFloat),e(701,parseFloat),e(16,u),e(1082,i),e(1114,i),e(1184,i),e(600,S),e(651,g),e(718,R),e(1e3,c),e(1001,v),e(1005,h),e(1007,h),e(1028,h),e(1016,f),e(1017,d),e(1021,p),e(1022,p),e(1231,p),e(1014,g),e(1015,g),e(1008,g),e(1009,g),e(1040,g),e(1041,g),e(1115,m),e(1182,m),e(1185,m),e(1186,s),e(1187,b),e(17,o),e(114,JSON.parse.bind(JSON)),e(3802,JSON.parse.bind(JSON)),e(199,E),e(3807,E),e(3907,g),e(2951,g),e(791,g),e(1183,g),e(1270,g)},"init")}}),Q=v((e,t)=>{function r(e){var t=e.readInt32BE(0),r=e.readUInt32BE(4),n="";t<0&&(t=~t+(0===r),r=~r+1>>>0,n="-");var i,s,o,a,u,c,l="";if(i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";if(l=a+o+l,i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";if(l=a+o+l,i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";return l=a+o+l,n+(o=""+(s=0x100000000*(i=t%1e6)+r)%1e6)+l}P(),y(r,"readInt8"),t.exports=r}),Y=v((e,t)=>{P();var r=Q(),n=y(function(e,t,r,n,i){r=r||0,n=n||!1,i=i||function(e,t,r){return e*Math.pow(2,r)+t};var s=r>>3,o=y(function(e){return n?255&~e:e},"inv"),a=255,u=8-r%8;t<u&&(a=255<<8-t&255,u=t),r&&(a>>=r%8);var c=0;r%8+t>=8&&(c=i(0,o(e[s])&a,u));for(var l=t+r>>3,h=s+1;h<l;h++)c=i(c,o(e[h]),8);var f=(t+r)%8;return f>0&&(c=i(c,o(e[l])>>8-f,f)),c},"parseBits"),i=y(function(e,t,r){var i=Math.pow(2,r-1)-1,s=n(e,1),o=n(e,r,1);if(0===o)return 0;var a=1,u=n(e,t,r+1,!1,y(function(e,t,r){0===e&&(e=1);for(var n=1;n<=r;n++)a/=2,(t&1<<r-n)>0&&(e+=a);return e},"parsePrecisionBits"));return o==Math.pow(2,r+1)-1?0===u?0===s?1/0:-1/0:NaN:(0===s?1:-1)*Math.pow(2,o-i)*u},"parseFloatFromBits"),s=y(function(e){return 1==n(e,1)?-1*(n(e,15,1,!0)+1):n(e,15,1)},"parseInt16"),o=y(function(e){return 1==n(e,1)?-1*(n(e,31,1,!0)+1):n(e,31,1)},"parseInt32"),a=y(function(e){return i(e,23,8)},"parseFloat32"),u=y(function(e){return i(e,52,11)},"parseFloat64"),c=y(function(e){var t=n(e,16,32);if(49152==t)return NaN;for(var r=Math.pow(1e4,n(e,16,16)),i=0,s=n(e,16),o=0;o<s;o++)i+=n(e,16,64+16*o)*r,r/=1e4;var a=Math.pow(10,n(e,16,48));return(0===t?1:-1)*Math.round(i*a)/a},"parseNumeric"),l=y(function(e,t){var r=n(t,1),i=n(t,63,1),s=new Date((0===r?1:-1)*i/1e3+9466848e5);return e||s.setTime(s.getTime()+6e4*s.getTimezoneOffset()),s.usec=i%1e3,s.getMicroSeconds=function(){return this.usec},s.setMicroSeconds=function(e){this.usec=e},s.getUTCMicroSeconds=function(){return this.usec},s},"parseDate"),h=y(function(e){for(var t=n(e,32),r=(n(e,32,32),n(e,32,64)),i=96,s=[],o=0;o<t;o++)s[o]=n(e,32,i),i+=64;var a=y(function(t){var r,s=n(e,32,i);return(i+=32,0xffffffff==s)?null:23==t||20==t?(r=n(e,8*s,i),i+=8*s,r):25==t?e.toString(this.encoding,i>>3,(i+=s<<3)>>3):void console.log("ERROR: ElementType not implemented: "+t)},"parseElement"),u=y(function(e,t){var r,n=[];if(e.length>1){var i=e.shift();for(r=0;r<i;r++)n[r]=u(e,t);e.unshift(i)}else for(r=0;r<e[0];r++)n[r]=a(t);return n},"parse");return u(s,r)},"parseArray"),f=y(function(e){return e.toString("utf8")},"parseText"),d=y(function(e){return null===e?null:n(e,8)>0},"parseBool");t.exports={init:y(function(e){e(20,r),e(21,s),e(23,o),e(26,o),e(1700,c),e(700,a),e(701,u),e(16,d),e(1114,l.bind(null,!1)),e(1184,l.bind(null,!0)),e(1e3,h),e(1007,h),e(1016,h),e(1008,h),e(1009,h),e(25,f)},"init")}}),X=v((e,t)=>{P(),t.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}}),z=v(e=>{P();var t=W(),r=Y(),n=q(),i=X();e.getTypeParser=a,e.setTypeParser=u,e.arrayParser=n,e.builtins=i;var s={text:{},binary:{}};function o(e){return String(e)}function a(e,t){return s[t=t||"text"]&&s[t][e]||o}function u(e,t,r){"function"==typeof t&&(r=t,t="text"),s[t][e]=r}y(o,"noParse"),y(a,"getTypeParser"),y(u,"setTypeParser"),t.init(function(e,t){s.text[e]=t}),r.init(function(e,t){s.binary[e]=t})}),K=v((e,t)=>{P();var r=z();function n(e){this._types=e||r,this.text={},this.binary={}}y(n,"TypeOverrides"),n.prototype.getOverrides=function(e){switch(e){case"text":return this.text;case"binary":return this.binary;default:return{}}},n.prototype.setTypeParser=function(e,t,r){"function"==typeof t&&(r=t,t="text"),this.getOverrides(t)[e]=r},n.prototype.getTypeParser=function(e,t){return t=t||"text",this.getOverrides(t)[e]||this._types.getTypeParser(e,t)},t.exports=n});function J(e){let t=0x6a09e667,r=0xbb67ae85,n=0x3c6ef372,i=0xa54ff53a,s=0x510e527f,o=0x9b05688c,a=0x1f83d9ab,u=0x5be0cd19,c=0,l=0,h=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],f=y((e,t)=>e>>>t|e<<32-t,"rrot"),d=new Uint32Array(64),p=new Uint8Array(64),g=y(()=>{for(let e=0,t=0;e<16;e++,t+=4)d[e]=p[t]<<24|p[t+1]<<16|p[t+2]<<8|p[t+3];for(let e=16;e<64;e++){let t=f(d[e-15],7)^f(d[e-15],18)^d[e-15]>>>3,r=f(d[e-2],17)^f(d[e-2],19)^d[e-2]>>>10;d[e]=d[e-16]+t+d[e-7]+r|0}let e=t,c=r,g=n,m=i,y=s,b=o,v=a,_=u;for(let t=0;t<64;t++){let r=_+(f(y,6)^f(y,11)^f(y,25))+(y&b^~y&v)+h[t]+d[t]|0,n=(f(e,2)^f(e,13)^f(e,22))+(e&c^e&g^c&g)|0;_=v,v=b,b=y,y=m+r|0,m=g,g=c,c=e,e=r+n|0}t=t+e|0,r=r+c|0,n=n+g|0,i=i+m|0,s=s+y|0,o=o+b|0,a=a+v|0,u=u+_|0,l=0},"process"),m=y(e=>{"string"==typeof e&&(e=new TextEncoder().encode(e));for(let t=0;t<e.length;t++)p[l++]=e[t],64===l&&g();c+=e.length},"add"),b=y(()=>{if(p[l++]=128,64==l&&g(),l+8>64){for(;l<64;)p[l++]=0;g()}for(;l<58;)p[l++]=0;let e=8*c;p[l++]=e/0x10000000000&255,p[l++]=e/0x100000000&255,p[l++]=e>>>24,p[l++]=e>>>16&255,p[l++]=e>>>8&255,p[l++]=255&e,g();let h=new Uint8Array(32);return h[0]=t>>>24,h[1]=t>>>16&255,h[2]=t>>>8&255,h[3]=255&t,h[4]=r>>>24,h[5]=r>>>16&255,h[6]=r>>>8&255,h[7]=255&r,h[8]=n>>>24,h[9]=n>>>16&255,h[10]=n>>>8&255,h[11]=255&n,h[12]=i>>>24,h[13]=i>>>16&255,h[14]=i>>>8&255,h[15]=255&i,h[16]=s>>>24,h[17]=s>>>16&255,h[18]=s>>>8&255,h[19]=255&s,h[20]=o>>>24,h[21]=o>>>16&255,h[22]=o>>>8&255,h[23]=255&o,h[24]=a>>>24,h[25]=a>>>16&255,h[26]=a>>>8&255,h[27]=255&a,h[28]=u>>>24,h[29]=u>>>16&255,h[30]=u>>>8&255,h[31]=255&u,h},"digest");return void 0===e?{add:m,digest:b}:(m(e),b())}var Z,ee,et=b(()=>{P(),y(J,"sha256")}),er=b(()=>{P(),y(Z=class e{constructor(){R(this,"_dataLength",0),R(this,"_bufferLength",0),R(this,"_state",new Int32Array(4)),R(this,"_buffer",new ArrayBuffer(68)),R(this,"_buffer8"),R(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(t){let r=e.hexChars,n=e.hexOut,i,s,o,a;for(a=0;a<4;a+=1)for(s=8*a,i=t[a],o=0;o<8;o+=2)n[s+1+o]=r.charAt(15&i),i>>>=4,n[s+0+o]=r.charAt(15&i),i>>>=4;return n.join("")}static _md5cycle(e,t){let r=e[0],n=e[1],i=e[2],s=e[3];r+=(n&i|~n&s)+t[0]-0x28955b88|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[1]-0x173848aa|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[2]+0x242070db|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[3]-0x3e423112|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[4]-0xa83f051|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[5]+0x4787c62a|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[6]-0x57cfb9ed|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[7]-0x2b96aff|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[8]+0x698098d8|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[9]-0x74bb0851|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[10]-42063|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[11]-0x76a32842|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[12]+0x6b901122|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[13]-0x2678e6d|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[14]-0x5986bc72|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[15]+0x49b40821|0,r+=((n=(n<<22|n>>>10)+i|0)&s|i&~s)+t[1]-0x9e1da9e|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[6]-0x3fbf4cc0|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[11]+0x265e5a51|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[0]-0x16493856|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[5]-0x29d0efa3|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[10]+0x2441453|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[15]-0x275e197f|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[4]-0x182c0438|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[9]+0x21e1cde6|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[14]-0x3cc8f82a|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[3]-0xb2af279|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[8]+0x455a14ed|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[13]-0x561c16fb|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[2]-0x3105c08|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[7]+0x676f02d9|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[12]-0x72d5b376|0,r+=((n=(n<<20|n>>>12)+i|0)^i^s)+t[5]-378558|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[8]-0x788e097f|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[11]+0x6d9d6122|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[14]-0x21ac7f4|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[1]-0x5b4115bc|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[4]+0x4bdecfa9|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[7]-0x944b4a0|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[10]-0x41404390|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[13]+0x289b7ec6|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[0]-0x155ed806|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[3]-0x2b10cf7b|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[6]+0x4881d05|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[9]-0x262b2fc7|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[12]-0x1924661b|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[15]+0x1fa27cf8|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[2]-0x3b53a99b|0,n=(n<<23|n>>>9)+i|0,r+=(i^(n|~s))+t[0]-0xbd6ddbc|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[7]+0x432aff97|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[14]-0x546bdc59|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[5]-0x36c5fc7|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[12]+0x655b59c3|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[3]-0x70f3336e|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[10]-1051523|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[1]-0x7a7ba22f|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[8]+0x6fa87e4f|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[15]-0x1d31920|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[6]-0x5cfebcec|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[13]+0x4e0811a1|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[4]-0x8ac817e|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[11]-0x42c50dcb|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[2]+0x2ad7d2bb|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[9]-0x14792c6f|0,n=(n<<21|n>>>11)+i|0,e[0]=r+e[0]|0,e[1]=n+e[1]|0,e[2]=i+e[2]|0,e[3]=s+e[3]|0}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(e.stateIdentity),this}appendStr(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o;for(o=0;o<t.length;o+=1){if((s=t.charCodeAt(o))<128)r[i++]=s;else if(s<2048)r[i++]=(s>>>6)+192,r[i++]=63&s|128;else if(s<55296||s>56319)r[i++]=(s>>>12)+224,r[i++]=s>>>6&63|128,r[i++]=63&s|128;else{if((s=(s-55296)*1024+(t.charCodeAt(++o)-56320)+65536)>1114111)throw Error("Unicode standard supports code points up to U+10FFFF");r[i++]=(s>>>18)+240,r[i++]=s>>>12&63|128,r[i++]=s>>>6&63|128,r[i++]=63&s|128}i>=64&&(this._dataLength+=64,e._md5cycle(this._state,n),i-=64,n[0]=n[16])}return this._bufferLength=i,this}appendAsciiStr(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(t.length-o,64-i);s--;)r[i++]=t.charCodeAt(o++);if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}appendByteArray(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(t.length-o,64-i);s--;)r[i++]=t[o++];if(i<64)break;this._dataLength+=64,e._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,r=e.state,n=this._state,i;for(this._dataLength=e.length,this._bufferLength=e.buflen,n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],i=0;i<t.length;i+=1)this._buffer8[i]=t.charCodeAt(i)}end(t=!1){let r=this._bufferLength,n=this._buffer8,i=this._buffer32,s=(r>>2)+1;this._dataLength+=r;let o=8*this._dataLength;if(n[r]=128,n[r+1]=n[r+2]=n[r+3]=0,i.set(e.buffer32Identity.subarray(s),s),r>55&&(e._md5cycle(this._state,i),i.set(e.buffer32Identity)),o<=0xffffffff)i[14]=o;else{let e=o.toString(16).match(/(.*?)(.{0,8})$/);if(null===e)return;let t=parseInt(e[2],16),r=parseInt(e[1],16)||0;i[14]=t,i[15]=r}return e._md5cycle(this._state,i),t?this._state:e._hex(this._state)}},"Md5"),R(Z,"stateIdentity",new Int32Array([0x67452301,-0x10325477,-0x67452302,0x10325476])),R(Z,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),R(Z,"hexChars","0123456789abcdef"),R(Z,"hexOut",[]),R(Z,"onePassHasher",new Z),ee=Z}),en={};function ei(e){return crypto.getRandomValues(c.alloc(e))}function es(e){if("sha256"===e)return{update:y(function(e){return{digest:y(function(){return c.from(J(e))},"digest")}},"update")};if("md5"===e)return{update:y(function(e){return{digest:y(function(){return"string"==typeof e?ee.hashStr(e):ee.hashByteArray(e)},"digest")}},"update")};throw Error(`Hash type '${e}' not supported`)}function eo(e,t){if("sha256"!==e)throw Error(`\
29
- Only sha256 is supported (requested: '${e}')`);return{update:y(function(e){return{digest:y(function(){"string"==typeof t&&(t=new TextEncoder().encode(t)),"string"==typeof e&&(e=new TextEncoder().encode(e));let r=t.length;if(r>64)t=J(t);else if(r<64){let e=new Uint8Array(64);e.set(t),t=e}let n=new Uint8Array(64),i=new Uint8Array(64);for(let e=0;e<64;e++)n[e]=54^t[e],i[e]=92^t[e];let s=new Uint8Array(e.length+64);s.set(n,0),s.set(e,64);let o=new Uint8Array(96);return o.set(i,0),o.set(J(s),64),c.from(J(o))},"digest")}},"update")}}_(en,{createHash:()=>es,createHmac:()=>eo,randomBytes:()=>ei});var ea=b(()=>{P(),et(),er(),y(ei,"randomBytes"),y(es,"createHash"),y(eo,"createHmac")}),eu=v((e,t)=>{P(),t.exports={host:"localhost",user:"win32"===l.platform?l.env.USERNAME:l.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 r=z(),n=r.getTypeParser(20,"text"),i=r.getTypeParser(1016,"text");t.exports.__defineSetter__("parseInt8",function(e){r.setTypeParser(20,"text",e?r.getTypeParser(23,"text"):n),r.setTypeParser(1016,"text",e?r.getTypeParser(1007,"text"):i)})}),ec=v((e,t)=>{P();var r=(ea(),S(en)),n=eu();function i(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function s(e){for(var t="{",r=0;r<e.length;r++)r>0&&(t+=","),null===e[r]||typeof e[r]>"u"?t+="NULL":Array.isArray(e[r])?t+=s(e[r]):e[r]instanceof c?t+="\\\\x"+e[r].toString("hex"):t+=i(o(e[r]));return t+"}"}y(i,"escapeElement"),y(s,"arrayString");var o=y(function(e,t){if(null==e)return null;if(e instanceof c)return e;if(ArrayBuffer.isView(e)){var r=c.from(e.buffer,e.byteOffset,e.byteLength);return r.length===e.byteLength?r:r.slice(e.byteOffset,e.byteOffset+e.byteLength)}return e instanceof Date?n.parseInputDatesAsUTC?h(e):l(e):Array.isArray(e)?s(e):"object"==typeof e?a(e,t):e.toString()},"prepareValue");function a(e,t){if(e&&"function"==typeof e.toPostgres){if(-1!==(t=t||[]).indexOf(e))throw Error('circular reference detected while preparing "'+e+'" for query');return t.push(e),o(e.toPostgres(o),t)}return JSON.stringify(e)}function u(e,t){for(e=""+e;e.length<t;)e="0"+e;return e}function l(e){var t=-e.getTimezoneOffset(),r=e.getFullYear(),n=r<1;n&&(r=Math.abs(r)+1);var i=u(r,4)+"-"+u(e.getMonth()+1,2)+"-"+u(e.getDate(),2)+"T"+u(e.getHours(),2)+":"+u(e.getMinutes(),2)+":"+u(e.getSeconds(),2)+"."+u(e.getMilliseconds(),3);return t<0?(i+="-",t*=-1):i+="+",i+=u(Math.floor(t/60),2)+":"+u(t%60,2),n&&(i+=" BC"),i}function h(e){var t=e.getUTCFullYear(),r=t<1;r&&(t=Math.abs(t)+1);var n=u(t,4)+"-"+u(e.getUTCMonth()+1,2)+"-"+u(e.getUTCDate(),2)+"T"+u(e.getUTCHours(),2)+":"+u(e.getUTCMinutes(),2)+":"+u(e.getUTCSeconds(),2)+"."+u(e.getUTCMilliseconds(),3);return n+="+00:00",r&&(n+=" BC"),n}function f(e,t,r){return e="string"==typeof e?{text:e}:e,t&&("function"==typeof t?e.callback=t:e.values=t),r&&(e.callback=r),e}y(a,"prepareObject"),y(u,"pad"),y(l,"dateToString"),y(h,"dateToStringUTC"),y(f,"normalizeQueryConfig");var d=y(function(e){return r.createHash("md5").update(e,"utf-8").digest("hex")},"md5"),p=y(function(e,t,r){var n=d(t+e);return"md5"+d(c.concat([c.from(n),r]))},"postgresMd5PasswordHash");t.exports={prepareValue:y(function(e){return o(e)},"prepareValueWrapper"),normalizeQueryConfig:f,postgresMd5PasswordHash:p,md5:d}}),el={};_(el,{default:()=>eh});var eh,ef=b(()=>{P(),eh={}}),ed=v((e,t)=>{P();var r=(ea(),S(en));function n(e){if(-1===e.indexOf("SCRAM-SHA-256"))throw Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let t=r.randomBytes(18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:t,response:"n,,n=*,r="+t,message:"SASLInitialResponse"}}function i(e,t,r){if("SASLInitialResponse"!==e.message)throw Error("SASL: Last message was not SASLInitialResponse");if("string"!=typeof t)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if("string"!=typeof r)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=l(r);if(n.nonce.startsWith(e.clientNonce)){if(n.nonce.length===e.clientNonce.length)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");var i=g(t,c.from(n.salt,"base64"),n.iteration),s=p(i,"Client Key"),o=d(s),a="n=*,r="+e.clientNonce,u="r="+n.nonce+",s="+n.salt+",i="+n.iteration,h="c=biws,r="+n.nonce,m=a+","+u+","+h,y=f(s,p(o,m)).toString("base64"),b=p(i,"Server Key"),v=p(b,m);e.message="SASLResponse",e.serverSignature=v.toString("base64"),e.response=h+",p="+y}function s(e,t){if("SASLResponse"!==e.message)throw Error("SASL: Last message was not SASLResponse");if("string"!=typeof t)throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:r}=h(t);if(r!==e.serverSignature)throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match")}function o(e){if("string"!=typeof e)throw TypeError("SASL: text must be a string");return e.split("").map((t,r)=>e.charCodeAt(r)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}function a(e){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(e)}function u(e){if("string"!=typeof e)throw TypeError("SASL: attribute pairs text must be a string");return new Map(e.split(",").map(e=>{if(!/^.=/.test(e))throw Error("SASL: Invalid attribute pair entry");return[e[0],e.substring(2)]}))}function l(e){let t=u(e),r=t.get("r");if(r){if(!o(r))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing");let n=t.get("s");if(n){if(!a(n))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let i=t.get("i");if(i){if(!/^[1-9][0-9]*$/.test(i))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing");return{nonce:r,salt:n,iteration:parseInt(i,10)}}function h(e){let t=u(e).get("v");if(t){if(!a(t))throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:t}}function f(e,t){if(!c.isBuffer(e))throw TypeError("first argument must be a Buffer");if(!c.isBuffer(t))throw TypeError("second argument must be a Buffer");if(e.length!==t.length)throw Error("Buffer lengths must match");if(0===e.length)throw Error("Buffers cannot be empty");return c.from(e.map((r,n)=>e[n]^t[n]))}function d(e){return r.createHash("sha256").update(e).digest()}function p(e,t){return r.createHmac("sha256",e).update(t).digest()}function g(e,t,r){for(var n=p(e,c.concat([t,c.from([0,0,0,1])])),i=n,s=0;s<r-1;s++)i=f(i,n=p(e,n));return i}y(n,"startSession"),y(i,"continueSession"),y(s,"finalizeSession"),y(o,"isPrintableChars"),y(a,"isBase64"),y(u,"parseAttributePairs"),y(l,"parseServerFirstMessage"),y(h,"parseServerFinalMessage"),y(f,"xorBuffers"),y(d,"sha256"),y(p,"hmacSha256"),y(g,"Hi"),t.exports={startSession:n,continueSession:i,finalizeSession:s}}),ep={};function eg(...e){return e.join("/")}_(ep,{join:()=>eg});var em=b(()=>{P(),y(eg,"join")}),ey={};function eb(e,t){t(Error("No filesystem"))}_(ey,{stat:()=>eb});var ev=b(()=>{P(),y(eb,"stat")}),e_={};_(e_,{default:()=>ew});var ew,eE=b(()=>{P(),ew={}}),eS={};_(eS,{StringDecoder:()=>ex});var eR,ex,eA=b(()=>{P(),y(eR=class{constructor(e){R(this,"td"),this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this.td.decode(e)}},"StringDecoder"),ex=eR}),eT=v((e,t)=>{P();var{Transform:r}=(eE(),S(e_)),{StringDecoder:n}=(eA(),S(eS)),i=Symbol("last"),s=Symbol("decoder");function o(e,t,r){let n;if(this.overflow){if(1===(n=this[s].write(e).split(this.matcher)).length)return r();n.shift(),this.overflow=!1}else this[i]+=this[s].write(e),n=this[i].split(this.matcher);this[i]=n.pop();for(let e=0;e<n.length;e++)try{u(this,this.mapper(n[e]))}catch(e){return r(e)}if(this.overflow=this[i].length>this.maxLength,this.overflow&&!this.skipOverflow)return void r(Error("maximum buffer reached"));r()}function a(e){if(this[i]+=this[s].end(),this[i])try{u(this,this.mapper(this[i]))}catch(t){return e(t)}e()}function u(e,t){void 0!==t&&e.push(t)}function c(e){return e}function l(e,t,u){switch(e=e||/\r?\n/,t=t||c,u=u||{},arguments.length){case 1:"function"==typeof e?(t=e,e=/\r?\n/):"object"!=typeof e||e instanceof RegExp||e[Symbol.split]||(u=e,e=/\r?\n/);break;case 2:"function"==typeof e?(u=t,t=e,e=/\r?\n/):"object"==typeof t&&(u=t,t=c)}(u=Object.assign({},u)).autoDestroy=!0,u.transform=o,u.flush=a,u.readableObjectMode=!0;let l=new r(u);return l[i]="",l[s]=new n("utf8"),l.matcher=e,l.mapper=t,l.maxLength=u.maxLength,l.skipOverflow=u.skipOverflow||!1,l.overflow=!1,l._destroy=function(e,t){this._writableState.errorEmitted=!1,t(e)},l}y(o,"transform"),y(a,"flush"),y(u,"push"),y(c,"noop"),y(l,"split"),t.exports=l}),eP=v((e,t)=>{P();var r=(em(),S(ep)),n=(eE(),S(e_)).Stream,i=eT(),s=(ef(),S(el)),o="win32"===l.platform,a=l.stderr;function u(e){return(61440&e)==32768}y(u,"isRegFile");var c=["host","port","database","user","password"],h=c.length,f=c[h-1];function d(){if(a instanceof n&&!0===a.writable){var e=Array.prototype.slice.call(arguments).concat(`
30
- `);a.write(s.format.apply(s,e))}}y(d,"warn"),Object.defineProperty(t.exports,"isWin",{get:y(function(){return o},"get"),set:y(function(e){o=e},"set")}),t.exports.warnTo=function(e){var t=a;return a=e,t},t.exports.getFileName=function(e){var t=e||l.env;return t.PGPASSFILE||(o?r.join(t.APPDATA||"./","postgresql","pgpass.conf"):r.join(t.HOME||"./",".pgpass"))},t.exports.usePgPass=function(e,t){return!Object.prototype.hasOwnProperty.call(l.env,"PGPASSWORD")&&(!!o||(t=t||"<unkn>",u(e.mode)?!(63&e.mode)||(d('WARNING: password file "%s" has group or world access; permissions should be u=rw (0600) or less',t),!1):(d('WARNING: password file "%s" is not a plain file',t),!1)))};var p=t.exports.match=function(e,t){return c.slice(0,-1).reduce(function(r,n,i){return 1==i&&Number(e[n]||5432)===Number(t[n])?r&&!0:r&&("*"===t[n]||t[n]===e[n])},!0)};t.exports.getPassword=function(e,t,r){var n,s=t.pipe(i());function o(t){var r=g(t);r&&m(r)&&p(e,r)&&(n=r[f],s.end())}y(o,"onLine");var a=y(function(){t.destroy(),r(n)},"onEnd"),u=y(function(e){t.destroy(),d("WARNING: error on reading file: %s",e),r(void 0)},"onErr");t.on("error",u),s.on("data",o).on("end",a).on("error",u)};var g=t.exports.parseLine=function(e){if(e.length<11||e.match(/^\s+#/))return null;for(var t="",r="",n=0,i=0,s={},o=y(function(t,r,n){var i=e.substring(r,n);Object.hasOwnProperty.call(l.env,"PGPASS_NO_DEESCAPE")||(i=i.replace(/\\([:\\])/g,"$1")),s[c[t]]=i},"addToObj"),a=0;a<e.length-1;a+=1){if(t=e.charAt(a+1),r=e.charAt(a),n==h-1){o(n,i);break}a>=0&&":"==t&&"\\"!==r&&(o(n,i,a+1),i=a+2,n+=1)}return s=Object.keys(s).length===h?s:null},m=t.exports.isValidEntry=function(e){for(var t={0:function(e){return e.length>0},1:function(e){return"*"===e||isFinite(e=Number(e))&&e>0&&e<0x20000000000000&&Math.floor(e)===e},2:function(e){return e.length>0},3:function(e){return e.length>0},4:function(e){return e.length>0}},r=0;r<c.length;r+=1)if(!(0,t[r])(e[c[r]]||""))return!1;return!0}}),eO=v((e,t)=>{P(),em(),S(ep);var r=(ev(),S(ey)),n=eP();t.exports=function(e,t){var i=n.getFileName();r.stat(i,function(s,o){if(s||!n.usePgPass(o,i))return t(void 0);var a=r.createReadStream(i);n.getPassword(e,a,t)})},t.exports.warnTo=n.warnTo}),eC={};_(eC,{default:()=>eI});var eI,eN=b(()=>{P(),eI={}}),eL=v((e,t)=>{P();var r=(U(),S(B)),n=(ev(),S(ey));function i(e){if("/"===e.charAt(0)){var t=e.split(" ");return{host:t[0],database:t[1]}}var i=r.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(e)?encodeURI(e).replace(/\%25(\d\d)/g,"%$1"):e,!0),t=i.query;for(var s in t)Array.isArray(t[s])&&(t[s]=t[s][t[s].length-1]);var o=(i.auth||":").split(":");if(t.user=o[0],t.password=o.splice(1).join(":"),t.port=i.port,"socket:"==i.protocol)return t.host=decodeURI(i.pathname),t.database=i.query.db,t.client_encoding=i.query.encoding,t;t.host||(t.host=i.hostname);var a=i.pathname;if(!t.host&&a&&/^%2f/i.test(a)){var u=a.split("/");t.host=decodeURIComponent(u[0]),a=u.splice(1).join("/")}switch(a&&"/"===a.charAt(0)&&(a=a.slice(1)||null),t.database=a&&decodeURI(a),("true"===t.ssl||"1"===t.ssl)&&(t.ssl=!0),"0"===t.ssl&&(t.ssl=!1),(t.sslcert||t.sslkey||t.sslrootcert||t.sslmode)&&(t.ssl={}),t.sslcert&&(t.ssl.cert=n.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=n.readFileSync(t.sslkey).toString()),t.sslrootcert&&(t.ssl.ca=n.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}return t}y(i,"parse"),t.exports=i,i.parse=i}),eM=v((e,t)=>{P();var r=(eN(),S(eC)),n=eu(),i=eL().parse,s=y(function(e,t,r){return void 0===r?r=l.env["PG"+e.toUpperCase()]:!1===r||(r=l.env[r]),t[e]||r||n[e]},"val"),o=y(function(){switch(l.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 n.ssl},"readSSLConfigFromEnvironment"),a=y(function(e){return"'"+(""+e).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),u=y(function(e,t,r){var n=t[r];null!=n&&e.push(r+"="+a(n))},"add"),c=class{constructor(e){(e="string"==typeof e?i(e):e||{}).connectionString&&(e=Object.assign({},e,i(e.connectionString))),this.user=s("user",e),this.database=s("database",e),void 0===this.database&&(this.database=this.user),this.port=parseInt(s("port",e),10),this.host=s("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:s("password",e)}),this.binary=s("binary",e),this.options=s("options",e),this.ssl=typeof e.ssl>"u"?o():e.ssl,"string"==typeof this.ssl&&"true"===this.ssl&&(this.ssl=!0),"no-verify"===this.ssl&&(this.ssl={rejectUnauthorized:!1}),this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this.client_encoding=s("client_encoding",e),this.replication=s("replication",e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=s("application_name",e,"PGAPPNAME"),this.fallback_application_name=s("fallback_application_name",e,!1),this.statement_timeout=s("statement_timeout",e,!1),this.lock_timeout=s("lock_timeout",e,!1),this.idle_in_transaction_session_timeout=s("idle_in_transaction_session_timeout",e,!1),this.query_timeout=s("query_timeout",e,!1),void 0===e.connectionTimeoutMillis?this.connect_timeout=l.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/1e3),!1===e.keepAlive?this.keepalives=0:!0===e.keepAlive&&(this.keepalives=1),"number"==typeof e.keepAliveInitialDelayMillis&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){var t=[];u(t,this,"user"),u(t,this,"password"),u(t,this,"port"),u(t,this,"application_name"),u(t,this,"fallback_application_name"),u(t,this,"connect_timeout"),u(t,this,"options");var n="object"==typeof this.ssl?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(u(t,n,"sslmode"),u(t,n,"sslca"),u(t,n,"sslkey"),u(t,n,"sslcert"),u(t,n,"sslrootcert"),this.database&&t.push("dbname="+a(this.database)),this.replication&&t.push("replication="+a(this.replication)),this.host&&t.push("host="+a(this.host)),this.isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+a(this.client_encoding)),r.lookup(this.host,function(r,n){return r?e(r,null):(t.push("hostaddr="+a(n)),e(null,t.join(" ")))})}};y(c,"ConnectionParameters"),t.exports=c}),eD=v((e,t)=>{P();var r=z(),n=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,i=class{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="array"===e,this.rowAsArray&&(this.parseRow=this._parseRowAsArray)}addCommandComplete(e){var t;(t=e.text?n.exec(e.text):n.exec(e.command))&&(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=Array(e.length),r=0,n=e.length;r<n;r++){var i=e[r];null!==i?t[r]=this._parsers[r](i):t[r]=null}return t}parseRow(e){for(var t={},r=0,n=e.length;r<n;r++){var i=e[r],s=this.fields[r].name;null!==i?t[s]=this._parsers[r](i):t[s]=null}return t}addRow(e){this.rows.push(e)}addFields(e){this.fields=e,this.fields.length&&(this._parsers=Array(e.length));for(var t=0;t<e.length;t++){var n=e[t];this._types?this._parsers[t]=this._types.getTypeParser(n.dataTypeID,n.format||"text"):this._parsers[t]=r.getTypeParser(n.dataTypeID,n.format||"text")}}};y(i,"Result"),t.exports=i}),ek=v((e,t)=>{P();var{EventEmitter:r}=O(),n=eD(),i=ec(),s=class extends r{constructor(e,t,r){super(),e=i.normalizeQueryConfig(e,t,r),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,l.domain&&e.callback&&(this.callback=l.domain.bind(e.callback)),this._result=new n(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError=!1,this._promise=null}requiresPreparation(){return!!this.name||!!this.rows||!!this.text&&!!this.values&&this.values.length>0}_checkForMultirow(){this._result.command&&(Array.isArray(this._results)||(this._results=[this._result]),this._result=new n(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(e){this._canceledDueToError=e;return}this.emit("row",t,this._result),this._accumulateRows&&this._result.addRow(t)}}handleCommandComplete(e,t){this._checkForMultirow(),this._result.addCommandComplete(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(e){l.nextTick(()=>{throw e})}this.emit("end",this._results)}submit(e){if("string"!=typeof this.text&&"string"!=typeof this.name)return 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?Error(`Prepared statements must be unique - '${this.name}\
31
- ' was used for a different statement`):this.values&&!Array.isArray(this.values)?Error("Query values must be an array"):(this.requiresPreparation()?this.prepare(e):e.query(this.text),null)}hasBeenParsed(e){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:i.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){}};y(s,"Query"),t.exports=s}),eB=v(e=>{P(),Object.defineProperty(e,"__esModule",{value:!0}),e.NoticeMessage=e.DataRowMessage=e.CommandCompleteMessage=e.ReadyForQueryMessage=e.NotificationResponseMessage=e.BackendKeyDataMessage=e.AuthenticationMD5Password=e.ParameterStatusMessage=e.ParameterDescriptionMessage=e.RowDescriptionMessage=e.Field=e.CopyResponse=e.CopyDataMessage=e.DatabaseError=e.copyDone=e.emptyQuery=e.replicationStart=e.portalSuspended=e.noData=e.closeComplete=e.bindComplete=e.parseComplete=void 0,e.parseComplete={name:"parseComplete",length:5},e.bindComplete={name:"bindComplete",length:5},e.closeComplete={name:"closeComplete",length:5},e.noData={name:"noData",length:5},e.portalSuspended={name:"portalSuspended",length:5},e.replicationStart={name:"replicationStart",length:4},e.emptyQuery={name:"emptyQuery",length:4},e.copyDone={name:"copyDone",length:4};var t=class extends Error{constructor(e,t,r){super(e),this.length=t,this.name=r}};y(t,"DatabaseError"),e.DatabaseError=t;var r=class{constructor(e,t){this.length=e,this.chunk=t,this.name="copyData"}};y(r,"CopyDataMessage"),e.CopyDataMessage=r;var n=class{constructor(e,t,r,n){this.length=e,this.name=t,this.binary=r,this.columnTypes=Array(n)}};y(n,"CopyResponse"),e.CopyResponse=n;var i=class{constructor(e,t,r,n,i,s,o){this.name=e,this.tableID=t,this.columnID=r,this.dataTypeID=n,this.dataTypeSize=i,this.dataTypeModifier=s,this.format=o}};y(i,"Field"),e.Field=i;var s=class{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescription",this.fields=Array(this.fieldCount)}};y(s,"RowDescriptionMessage"),e.RowDescriptionMessage=s;var o=class{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescription",this.dataTypeIDs=Array(this.parameterCount)}};y(o,"ParameterDescriptionMessage"),e.ParameterDescriptionMessage=o;var a=class{constructor(e,t,r){this.length=e,this.parameterName=t,this.parameterValue=r,this.name="parameterStatus"}};y(a,"ParameterStatusMessage"),e.ParameterStatusMessage=a;var u=class{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}};y(u,"AuthenticationMD5Password"),e.AuthenticationMD5Password=u;var c=class{constructor(e,t,r){this.length=e,this.processID=t,this.secretKey=r,this.name="backendKeyData"}};y(c,"BackendKeyDataMessage"),e.BackendKeyDataMessage=c;var l=class{constructor(e,t,r,n){this.length=e,this.processId=t,this.channel=r,this.payload=n,this.name="notification"}};y(l,"NotificationResponseMessage"),e.NotificationResponseMessage=l;var h=class{constructor(e,t){this.length=e,this.status=t,this.name="readyForQuery"}};y(h,"ReadyForQueryMessage"),e.ReadyForQueryMessage=h;var f=class{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};y(f,"CommandCompleteMessage"),e.CommandCompleteMessage=f;var d=class{constructor(e,t){this.length=e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};y(d,"DataRowMessage"),e.DataRowMessage=d;var p=class{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};y(p,"NoticeMessage"),e.NoticeMessage=p}),ej=v(e=>{P(),Object.defineProperty(e,"__esModule",{value:!0}),e.Writer=void 0;var t=class{constructor(e=256){this.size=e,this.offset=5,this.headerPosition=0,this.buffer=c.allocUnsafe(e)}ensure(e){if(this.buffer.length-this.offset<e){let t=this.buffer,r=t.length+(t.length>>1)+e;this.buffer=c.allocUnsafe(r),t.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){let t=c.byteLength(e);this.ensure(t+1),this.buffer.write(e,this.offset,"utf-8"),this.offset+=t}else this.ensure(1);return this.buffer[this.offset++]=0,this}addString(e=""){let t=c.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(5*!e,this.offset)}flush(e){let t=this.join(e);return this.offset=5,this.headerPosition=0,this.buffer=c.allocUnsafe(this.size),t}};y(t,"Writer"),e.Writer=t}),eU=v(e=>{P(),Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=void 0;var t=ej(),r=new t.Writer,n=y(e=>{for(let t of(r.addInt16(3).addInt16(0),Object.keys(e)))r.addCString(t).addCString(e[t]);r.addCString("client_encoding").addCString("UTF8");let n=r.addCString("").flush(),i=n.length+4;return new t.Writer().addInt32(i).add(n).flush()},"startup"),i=y(()=>{let e=c.allocUnsafe(8);return e.writeInt32BE(8,0),e.writeInt32BE(0x4d2162f,4),e},"requestSsl"),s=y(e=>r.addCString(e).flush(112),"password"),o=y(function(e,t){return r.addCString(e).addInt32(c.byteLength(t)).addString(t),r.flush(112)},"sendSASLInitialResponseMessage"),a=y(function(e){return r.addString(e).flush(112)},"sendSCRAMClientFinalMessage"),u=y(e=>r.addCString(e).flush(81),"query"),l=[],h=y(e=>{let t=e.name||"";t.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",t,t.length),console.error("This can cause conflicts and silent errors executing queries"));let n=e.types||l,i=n.length,s=r.addCString(t).addCString(e.text).addInt16(i);for(let e=0;e<i;e++)s.addInt32(n[e]);return r.flush(80)},"parse"),f=new t.Writer,d=y(function(e,t){for(let n=0;n<e.length;n++){let i=t?t(e[n],n):e[n];null==i?(r.addInt16(0),f.addInt32(-1)):i instanceof c?(r.addInt16(1),f.addInt32(i.length),f.add(i)):(r.addInt16(0),f.addInt32(c.byteLength(i)),f.addString(i))}},"writeValues"),p=y((e={})=>{let t=e.portal||"",n=e.statement||"",i=e.binary||!1,s=e.values||l,o=s.length;return r.addCString(t).addCString(n),r.addInt16(o),d(s,e.valueMapper),r.addInt16(o),r.add(f.flush()),r.addInt16(+!!i),r.flush(66)},"bind"),g=c.from([69,0,0,0,9,0,0,0,0,0]),m=y(e=>{if(!e||!e.portal&&!e.rows)return g;let t=e.portal||"",r=e.rows||0,n=c.byteLength(t),i=4+n+1+4,s=c.allocUnsafe(1+i);return s[0]=69,s.writeInt32BE(i,1),s.write(t,5,"utf-8"),s[n+5]=0,s.writeUInt32BE(r,s.length-4),s},"execute"),b=y((e,t)=>{let r=c.allocUnsafe(16);return r.writeInt32BE(16,0),r.writeInt16BE(1234,4),r.writeInt16BE(5678,6),r.writeInt32BE(e,8),r.writeInt32BE(t,12),r},"cancel"),v=y((e,t)=>{let r=4+c.byteLength(t)+1,n=c.allocUnsafe(1+r);return n[0]=e,n.writeInt32BE(r,1),n.write(t,5,"utf-8"),n[r]=0,n},"cstringMessage"),_=r.addCString("P").flush(68),w=r.addCString("S").flush(68),E=y(e=>e.name?v(68,`${e.type}${e.name||""}`):"P"===e.type?_:w,"describe"),S=y(e=>v(67,`${e.type}${e.name||""}`),"close"),R=y(e=>r.add(e).flush(100),"copyData"),x=y(e=>v(102,e),"copyFail"),A=y(e=>c.from([e,0,0,0,4]),"codeOnlyBuffer"),T=A(72),O=A(83),C=A(88),I=A(99);e.serialize={startup:n,password:s,requestSsl:i,sendSASLInitialResponseMessage:o,sendSCRAMClientFinalMessage:a,query:u,parse:h,bind:p,execute:m,describe:E,close:S,flush:y(()=>T,"flush"),sync:y(()=>O,"sync"),end:y(()=>C,"end"),copyData:R,copyDone:y(()=>I,"copyDone"),copyFail:x,cancel:b}}),eF=v(e=>{P(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferReader=void 0;var t=c.allocUnsafe(0),r=class{constructor(e=0){this.offset=e,this.buffer=t,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(;0!==this.buffer[t++];);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}};y(r,"BufferReader"),e.BufferReader=r}),eq=v(e=>{P(),Object.defineProperty(e,"__esModule",{value:!0}),e.Parser=void 0;var t=eB(),r=eF(),n=c.allocUnsafe(0),i=class{constructor(e){if(this.buffer=n,this.bufferLength=0,this.bufferOffset=0,this.reader=new r.BufferReader,e?.mode==="binary")throw Error("Binary mode not supported yet");this.mode=e?.mode||"text"}parse(e,t){this.mergeBuffer(e);let r=this.bufferOffset+this.bufferLength,i=this.bufferOffset;for(;i+5<=r;){let e=this.buffer[i],n=this.buffer.readUInt32BE(i+1),s=1+n;if(s+i<=r)t(this.handlePacket(i+5,e,n,this.buffer)),i+=s;else break}i===r?(this.buffer=n,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=r-i,this.bufferOffset=i)}mergeBuffer(e){if(this.bufferLength>0){let t=this.bufferLength+e.byteLength;if(t+this.bufferOffset>this.buffer.byteLength){let e;if(t<=this.buffer.byteLength&&this.bufferOffset>=this.bufferLength)e=this.buffer;else{let r=2*this.buffer.byteLength;for(;t>=r;)r*=2;e=c.allocUnsafe(r)}this.buffer.copy(e,0,this.bufferOffset,this.bufferOffset+this.bufferLength),this.buffer=e,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,r,n,i){switch(r){case 50:return t.bindComplete;case 49:return t.parseComplete;case 51:return t.closeComplete;case 110:return t.noData;case 115:return t.portalSuspended;case 99:return t.copyDone;case 87:return t.replicationStart;case 73:return t.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,"error");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 t.DatabaseError("received invalid response: "+r.toString(16),n,"error")}}parseReadyForQueryMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.string(1);return new t.ReadyForQueryMessage(r,i)}parseCommandCompleteMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.cstring();return new t.CommandCompleteMessage(r,i)}parseCopyData(e,r,n){let i=n.slice(e,e+(r-4));return new t.CopyDataMessage(r,i)}parseCopyInMessage(e,t,r){return this.parseCopyMessage(e,t,r,"copyInResponse")}parseCopyOutMessage(e,t,r){return this.parseCopyMessage(e,t,r,"copyOutResponse")}parseCopyMessage(e,r,n,i){this.reader.setBuffer(e,n);let s=0!==this.reader.byte(),o=this.reader.int16(),a=new t.CopyResponse(r,i,s,o);for(let e=0;e<o;e++)a.columnTypes[e]=this.reader.int16();return a}parseNotificationMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s=this.reader.cstring(),o=this.reader.cstring();return new t.NotificationResponseMessage(r,i,s,o)}parseRowDescriptionMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=new t.RowDescriptionMessage(r,i);for(let e=0;e<i;e++)s.fields[e]=this.parseField();return s}parseField(){let e=this.reader.cstring(),r=this.reader.uint32(),n=this.reader.int16(),i=this.reader.uint32(),s=this.reader.int16(),o=this.reader.int32(),a=0===this.reader.int16()?"text":"binary";return new t.Field(e,r,n,i,s,o,a)}parseParameterDescriptionMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=new t.ParameterDescriptionMessage(r,i);for(let e=0;e<i;e++)s.dataTypeIDs[e]=this.reader.int32();return s}parseDataRowMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=Array(i);for(let e=0;e<i;e++){let t=this.reader.int32();s[e]=-1===t?null:this.reader.string(t)}return new t.DataRowMessage(r,s)}parseParameterStatusMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.cstring(),s=this.reader.cstring();return new t.ParameterStatusMessage(r,i,s)}parseBackendKeyData(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s=this.reader.int32();return new t.BackendKeyDataMessage(r,i,s)}parseAuthenticationResponse(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s={name:"authenticationOk",length:r};switch(i){case 0:break;case 3:8===s.length&&(s.name="authenticationCleartextPassword");break;case 5:if(12===s.length){s.name="authenticationMD5Password";let e=this.reader.bytes(4);return new t.AuthenticationMD5Password(r,e)}break;case 10:{let e;s.name="authenticationSASL",s.mechanisms=[];do(e=this.reader.cstring())&&s.mechanisms.push(e);while(e)}break;case 11:s.name="authenticationSASLContinue",s.data=this.reader.string(r-8);break;case 12:s.name="authenticationSASLFinal",s.data=this.reader.string(r-8);break;default:throw Error("Unknown authenticationOk message type "+i)}return s}parseErrorMessage(e,r,n,i){this.reader.setBuffer(e,n);let s={},o=this.reader.string(1);for(;"\0"!==o;)s[o]=this.reader.cstring(),o=this.reader.string(1);let a=s.M,u="notice"===i?new t.NoticeMessage(r,a):new t.DatabaseError(a,r,i);return u.severity=s.S,u.code=s.C,u.detail=s.D,u.hint=s.H,u.position=s.P,u.internalPosition=s.p,u.internalQuery=s.q,u.where=s.W,u.schema=s.s,u.table=s.t,u.column=s.c,u.dataType=s.d,u.constraint=s.n,u.file=s.F,u.line=s.L,u.routine=s.R,u}};y(i,"Parser"),e.Parser=i}),e$=v(e=>{P(),Object.defineProperty(e,"__esModule",{value:!0}),e.DatabaseError=e.serialize=e.parse=void 0;var t=eB();Object.defineProperty(e,"DatabaseError",{enumerable:!0,get:y(function(){return t.DatabaseError},"get")});var r=eU();Object.defineProperty(e,"serialize",{enumerable:!0,get:y(function(){return r.serialize},"get")});var n=eq();function i(e,t){let r=new n.Parser;return e.on("data",e=>r.parse(e,t)),new Promise(t=>e.on("end",()=>t()))}y(i,"parse"),e.parse=i}),eG={};function eH({socket:e,servername:t}){return e.startTls(t),e}_(eG,{connect:()=>eH});var eV=b(()=>{P(),y(eH,"connect")}),eW=v((e,t)=>{P();var r=(k(),S(C)),n=O().EventEmitter,{parse:i,serialize:s}=e$(),o=s.flush(),a=s.sync(),u=s.end(),c=class extends n{constructor(e){super(),e=e||{},this.stream=e.stream||new r.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(e){"message"===e&&(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(){n._keepAlive&&n.stream.setKeepAlive(!0,n._keepAliveInitialDelayMillis),n.emit("connect")});let i=y(function(e){n._ending&&("ECONNRESET"===e.code||"EPIPE"===e.code)||n.emit("error",e)},"reportStreamError");if(this.stream.on("error",i),this.stream.on("close",function(){n.emit("end")}),!this.ssl)return this.attachListeners(this.stream);this.stream.once("data",function(e){switch(e.toString("utf8")){case"S":break;case"N":return n.stream.end(),n.emit("error",Error("The server does not support SSL connections"));default:return n.stream.end(),n.emit("error",Error("There was an error establishing an SSL connection"))}var s=(eV(),S(eG));let o={socket:n.stream};!0!==n.ssl&&(Object.assign(o,n.ssl),"key"in n.ssl&&(o.key=n.ssl.key)),0===r.isIP(t)&&(o.servername=t);try{n.stream=s.connect(o)}catch(e){return n.emit("error",e)}n.attachListeners(n.stream),n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){e.on("end",()=>{this.emit("end")}),i(e,e=>{var t="error"===e.name?"errorMessage":e.name;this._emitMessage&&this.emit("message",e),this.emit(t,e)})}requestSsl(){this.stream.write(s.requestSsl())}startup(e){this.stream.write(s.startup(e))}cancel(e,t){this._send(s.cancel(e,t))}password(e){this._send(s.password(e))}sendSASLInitialResponseMessage(e,t){this._send(s.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(s.sendSCRAMClientFinalMessage(e))}_send(e){return!!this.stream.writable&&this.stream.write(e)}query(e){this._send(s.query(e))}parse(e){this._send(s.parse(e))}bind(e){this._send(s.bind(e))}execute(e){this._send(s.execute(e))}flush(){this.stream.writable&&this.stream.write(o)}sync(){this._ending=!0,this._send(o),this._send(a)}ref(){this.stream.ref()}unref(){this.stream.unref()}end(){return(this._ending=!0,this._connecting&&this.stream.writable)?this.stream.write(u,()=>{this.stream.end()}):void this.stream.end()}close(e){this._send(s.close(e))}describe(e){this._send(s.describe(e))}sendCopyFromChunk(e){this._send(s.copyData(e))}endCopyFrom(){this._send(s.copyDone())}sendCopyFail(e){this._send(s.copyFail(e))}};y(c,"Connection"),t.exports=c}),eQ=v((e,t)=>{P();var r=O().EventEmitter,n=(ef(),S(el),ec()),i=ed(),s=eO(),o=K(),u=eM(),c=ek(),h=eu(),f=eW(),d=class extends r{constructor(e){super(),this.connectionParameters=new u(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||a.Promise,this._types=new o(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||h.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=y(t=>{l.nextTick(()=>{t.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,r=this.connection;if(this._connectionCallback=e,this._connecting||this._connected){let t=Error("Client has already been connected. You cannot reuse a client.");l.nextTick(()=>{e(t)});return}this._connecting=!0,this.connectionTimeoutHandle,this._connectionTimeoutMillis>0&&(this.connectionTimeoutHandle=setTimeout(()=>{r._ending=!0,r.stream.destroy(Error("timeout expired"))},this._connectionTimeoutMillis)),this.host&&0===this.host.indexOf("/")?r.connect(this.host+"/.s.PGSQL."+this.port):r.connect(this.port,this.host),r.on("connect",function(){t.ssl?r.requestSsl():r.startup(t.getStartupConf())}),r.on("sslconnect",function(){r.startup(t.getStartupConf())}),this._attachListeners(r),r.once("end",()=>{let e=this._ending?Error("Connection terminated"):Error("Connection terminated unexpectedly");clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(e),this._ending||(this._connecting&&!this._connectionError?this._connectionCallback?this._connectionCallback(e):this._handleErrorEvent(e):this._connectionError||this._handleErrorEvent(e)),l.nextTick(()=>{this.emit("end")})})}connect(e){return e?void this._connect(e):new this._Promise((e,t)=>{this._connect(r=>{r?t(r):e()})})}_attachListeners(e){e.on("authenticationCleartextPassword",this._handleAuthCleartextPassword.bind(this)),e.on("authenticationMD5Password",this._handleAuthMD5Password.bind(this)),e.on("authenticationSASL",this._handleAuthSASL.bind(this)),e.on("authenticationSASLContinue",this._handleAuthSASLContinue.bind(this)),e.on("authenticationSASLFinal",this._handleAuthSASLFinal.bind(this)),e.on("backendKeyData",this._handleBackendKeyData.bind(this)),e.on("error",this._handleErrorEvent.bind(this)),e.on("errorMessage",this._handleErrorMessage.bind(this)),e.on("readyForQuery",this._handleReadyForQuery.bind(this)),e.on("notice",this._handleNotice.bind(this)),e.on("rowDescription",this._handleRowDescription.bind(this)),e.on("dataRow",this._handleDataRow.bind(this)),e.on("portalSuspended",this._handlePortalSuspended.bind(this)),e.on("emptyQuery",this._handleEmptyQuery.bind(this)),e.on("commandComplete",this._handleCommandComplete.bind(this)),e.on("parseComplete",this._handleParseComplete.bind(this)),e.on("copyInResponse",this._handleCopyInResponse.bind(this)),e.on("copyData",this._handleCopyData.bind(this)),e.on("notification",this._handleNotification.bind(this))}_checkPgPass(e){let t=this.connection;"function"==typeof this.password?this._Promise.resolve().then(()=>this.password()).then(r=>{if(void 0!==r){if("string"!=typeof r)return void t.emit("error",TypeError("Password must be a string"));this.connectionParameters.password=this.password=r}else this.connectionParameters.password=this.password=null;e()}).catch(e=>{t.emit("error",e)}):null!==this.password?e():s(this.connectionParameters,t=>{void 0!==t&&(this.connectionParameters.password=this.password=t),e()})}_handleAuthCleartextPassword(e){this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){this._checkPgPass(()=>{let t=n.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){this._checkPgPass(()=>{this.saslSession=i.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){i.continueSession(this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}_handleAuthSASLFinal(e){i.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;this.activeQuery=null,this.readyForQuery=!0,t&&t.handleReadyForQuery(this.connection),this._pulseQueryQueue()}_handleErrorWhileConnecting(e){if(!this._connectionError){if(this._connectionError=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback)return this._connectionCallback(e);this.emit("error",e)}}_handleErrorEvent(e){if(this._connecting)return this._handleErrorWhileConnecting(e);this._queryable=!1,this._errorAllQueries(e),this.emit("error",e)}_handleErrorMessage(e){if(this._connecting)return this._handleErrorWhileConnecting(e);let t=this.activeQuery;if(!t)return void this._handleErrorEvent(e);this.activeQuery=null,t.handleError(e,this.connection)}_handleRowDescription(e){this.activeQuery.handleRowDescription(e)}_handleDataRow(e){this.activeQuery.handleDataRow(e)}_handlePortalSuspended(e){this.activeQuery.handlePortalSuspended(this.connection)}_handleEmptyQuery(e){this.activeQuery.handleEmptyQuery(this.connection)}_handleCommandComplete(e){this.activeQuery.handleCommandComplete(e,this.connection)}_handleParseComplete(e){this.activeQuery.name&&(this.connection.parsedStatements[this.activeQuery.name]=this.activeQuery.text)}_handleCopyInResponse(e){this.activeQuery.handleCopyInResponse(this.connection)}_handleCopyData(e){this.activeQuery.handleCopyData(e,this.connection)}_handleNotification(e){this.emit("notification",e)}_handleNotice(e){this.emit("notice",e)}getStartupConf(){var e=this.connectionParameters,t={user:e.user,database:e.database},r=e.application_name||e.fallback_application_name;return r&&(t.application_name=r),e.replication&&(t.replication=""+e.replication),e.statement_timeout&&(t.statement_timeout=String(parseInt(e.statement_timeout,10))),e.lock_timeout&&(t.lock_timeout=String(parseInt(e.lock_timeout,10))),e.idle_in_transaction_session_timeout&&(t.idle_in_transaction_session_timeout=String(parseInt(e.idle_in_transaction_session_timeout,10))),e.options&&(t.options=e.options),t}cancel(e,t){if(e.activeQuery===t){var r=this.connection;this.host&&0===this.host.indexOf("/")?r.connect(this.host+"/.s.PGSQL."+this.port):r.connect(this.port,this.host),r.on("connect",function(){r.cancel(e.processID,e.secretKey)})}else -1!==e.queryQueue.indexOf(t)&&e.queryQueue.splice(e.queryQueue.indexOf(t),1)}setTypeParser(e,t,r){return this._types.setTypeParser(e,t,r)}getTypeParser(e,t){return this._types.getTypeParser(e,t)}escapeIdentifier(e){return'"'+e.replace(/"/g,'""')+'"'}escapeLiteral(e){for(var t=!1,r="'",n=0;n<e.length;n++){var i=e[n];"'"===i?r+=i+i:"\\"===i?(r+=i+i,t=!0):r+=i}return r+="'",!0===t&&(r=" E"+r),r}_pulseQueryQueue(){if(!0===this.readyForQuery)if(this.activeQuery=this.queryQueue.shift(),this.activeQuery){this.readyForQuery=!1,this.hasExecuted=!0;let e=this.activeQuery.submit(this.connection);e&&l.nextTick(()=>{this.activeQuery.handleError(e,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&&(this.activeQuery=null,this.emit("drain"))}query(e,t,r){var n,i,s,o,a;if(null==e)throw TypeError("Client was passed a null or undefined query");return"function"==typeof e.submit?(s=e.query_timeout||this.connectionParameters.query_timeout,i=n=e,"function"==typeof t&&(n.callback=n.callback||t)):(s=this.connectionParameters.query_timeout,(n=new c(e,t,r)).callback||(i=new this._Promise((e,t)=>{n.callback=(r,n)=>r?t(r):e(n)}))),s&&(a=n.callback,o=setTimeout(()=>{var e=Error("Query read timeout");l.nextTick(()=>{n.handleError(e,this.connection)}),a(e),n.callback=()=>{};var t=this.queryQueue.indexOf(n);t>-1&&this.queryQueue.splice(t,1),this._pulseQueryQueue()},s),n.callback=(e,t)=>{clearTimeout(o),a(e,t)}),this.binary&&!n.binary&&(n.binary=!0),n._result&&!n._result._types&&(n._result._types=this._types),this._queryable?this._ending?l.nextTick(()=>{n.handleError(Error("Client was closed and is not queryable"),this.connection)}):(this.queryQueue.push(n),this._pulseQueryQueue()):l.nextTick(()=>{n.handleError(Error("Client has encountered a connection error and is not queryable"),this.connection)}),i}ref(){this.connection.ref()}unref(){this.connection.unref()}end(e){if(this._ending=!0,!this.connection._connecting)if(!e)return this._Promise.resolve();else e();if(this.activeQuery||!this._queryable?this.connection.stream.destroy():this.connection.end(),!e)return new this._Promise(e=>{this.connection.once("end",e)});this.connection.once("end",e)}};y(d,"Client"),d.Query=c,t.exports=d}),eY=v((e,t)=>{P();var r=O().EventEmitter,n=y(function(){},"NOOP"),i=y((e,t)=>{let r=e.findIndex(t);return -1===r?void 0:e.splice(r,1)[0]},"removeWhere"),s=class{constructor(e,t,r){this.client=e,this.idleListener=t,this.timeoutId=r}};y(s,"IdleItem");var o=class{constructor(e){this.callback=e}};function c(){throw Error("Release called on client which has already been released to the pool.")}function h(e,t){let r,n;return t?{callback:t,result:void 0}:{callback:y(function(e,t){e?r(e):n(t)},"cb"),result:new e(function(e,t){n=e,r=t}).catch(e=>{throw Error.captureStackTrace(e),e})}}function f(e,t){return y(function r(n){n.client=t,t.removeListener("error",r),t.on("error",()=>{e.log("additional client error after disconnection due to error",n)}),e._remove(t),e.emit("error",n,t)},"idleListener")}y(o,"PendingItem"),y(c,"throwOnDoubleRelease"),y(h,"promisify"),y(f,"makeIdleListener");var d=class extends r{constructor(e,t){super(),this.options=Object.assign({},e),null!=e&&"password"in e&&Object.defineProperty(this.options,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}),null!=e&&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||e2().Client,this.Promise=this.options.Promise||a.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)return void this.log("pulse queue ended");if(this.ending){this.log("pulse queue on ending"),this._idle.length&&this._idle.slice().map(e=>{this._remove(e.client)}),this._clients.length||(this.ended=!0,this._endCallback());return}if(!this._pendingQueue.length)return void this.log("no queued requests");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 r=t.client;r.ref&&r.ref();let n=t.idleListener;return this._acquireClient(r,e,n,!1)}if(!this._isFull())return this.newClient(e);throw Error("unexpected condition")}_remove(e){let t=i(this._idle,t=>t.client===e);void 0!==t&&clearTimeout(t.timeoutId),this._clients=this._clients.filter(t=>t!==e),e.end(),this.emit("remove",e)}connect(e){if(this.ending){let t=Error("Cannot use a pool after calling end on the pool");return e?e(t):this.Promise.reject(t)}let t=h(this.Promise,e),r=t.result;if(this._isFull()||this._idle.length){if(this._idle.length&&l.nextTick(()=>this._pulseQueue()),!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new o(t.callback)),r;let e=y((e,r,n)=>{clearTimeout(s),t.callback(e,r,n)},"queueCallback"),n=new o(e),s=setTimeout(()=>{i(this._pendingQueue,t=>t.callback===e),n.timedOut=!0,t.callback(Error("timeout exceeded when trying to connect"))},this.options.connectionTimeoutMillis);return s.unref&&s.unref(),this._pendingQueue.push(n),r}return this.newClient(new o(t.callback)),r}newClient(e){let t=new this.Client(this.options);this._clients.push(t);let r=f(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(a=>{if(i&&clearTimeout(i),t.on("error",r),a)this.log("client failed to connect",a),this._clients=this._clients.filter(e=>e!==t),s&&(a=Error("Connection terminated due to connection timeout",{cause:a})),this._pulseQueue(),e.timedOut||e.callback(a,void 0,n);else{if(this.log("new client connected"),0!==this.options.maxLifetimeSeconds){let e=setTimeout(()=>{this.log("ending client due to expired lifetime"),this._expired.add(t),-1!==this._idle.findIndex(e=>e.client===t)&&this._acquireClient(t,new o((e,t,r)=>r()),r,!1)},1e3*this.options.maxLifetimeSeconds);e.unref(),t.once("end",()=>clearTimeout(e))}return this._acquireClient(t,e,r,!0)}})}_acquireClient(e,t,r,i){i&&this.emit("connect",e),this.emit("acquire",e),e.release=this._releaseOnce(e,r),e.removeListener("error",r),t.timedOut?i&&this.options.verify?this.options.verify(e,e.release):e.release():i&&this.options.verify?this.options.verify(e,r=>{if(r)return e.release(r),t.callback(r,void 0,n);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){let r=!1;return n=>{r&&c(),r=!0,this._release(e,t,n)}}_release(e,t,r){let n;if(e.on("error",t),e._poolUseCount=(e._poolUseCount||0)+1,this.emit("release",r,e),r||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}this.options.idleTimeoutMillis&&this._isAboveMin()&&(n=setTimeout(()=>{this.log("remove idle client"),this._remove(e)},this.options.idleTimeoutMillis),this.options.allowExitOnIdle&&n.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new s(e,t,n)),this._pulseQueue()}query(e,t,r){if("function"==typeof e){let t=h(this.Promise,e);return u(function(){return t.callback(Error("Passing a function as the first parameter to pool.query is not supported"))}),t.result}"function"==typeof t&&(r=t,t=void 0);let n=h(this.Promise,r);return r=n.callback,this.connect((n,i)=>{if(n)return r(n);let s=!1,o=y(e=>{s||(s=!0,i.release(e),r(e))},"onError");i.once("error",o),this.log("dispatching query");try{i.query(e,t,(e,t)=>{if(this.log("query dispatched"),i.removeListener("error",o),!s)return s=!0,i.release(e),e?r(e):r(void 0,t)})}catch(e){return i.release(e),r(e)}}),n.result}end(e){if(this.log("ending"),this.ending){let t=Error("Called end on pool more than once");return e?e(t):this.Promise.reject(t)}this.ending=!0;let t=h(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),0)}get totalCount(){return this._clients.length}};y(d,"Pool"),t.exports=d}),eX={};_(eX,{default:()=>ez});var ez,eK=b(()=>{P(),ez={}}),eJ=v((e,t)=>{t.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javascript & 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 <brian.m.carlson@gmail.com>",main:"./lib",dependencies:{"buffer-writer":"2.0.0","packet-reader":"1.0.0","pg-connection-string":"^2.5.0","pg-pool":"^3.5.2","pg-protocol":"^1.5.0","pg-types":"^2.1.0",pgpass:"1.x"},devDependencies:{async:"2.6.4",bluebird:"3.5.2",co:"4.6.0","pg-copy-streams":"0.3.0"},peerDependencies:{"pg-native":">=3.0.1"},peerDependenciesMeta:{"pg-native":{optional:!0}},scripts:{test:"make test-all"},files:["lib","SPONSORS.md"],license:"MIT",engines:{node:">= 8.0.0"},gitHead:"c99fb2c127ddf8d712500db2c7b9a5491a178655"}}),eZ=v((e,t)=>{P();var r=O().EventEmitter,n=(ef(),S(el)),i=ec(),s=t.exports=function(e,t,n){r.call(this),e=i.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this.name=e.name,this.callback=e.callback,this.state="new",this._arrayMode="array"===e.rowMode,this._emitRowEvents=!1,this.on("newListener",(function(e){"row"===e&&(this._emitRowEvents=!0)}).bind(this))};n.inherits(s,r);var o={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"file",sourceLine:"line",sourceFunction:"routine"};s.prototype.handleError=function(e){var t=this.native.pq.resultErrorFields();if(t)for(var r in t)e[o[r]||r]=t[r];this.callback?this.callback(e):this.emit("error",e),this.state="error"},s.prototype.then=function(e,t){return this._getPromise().then(e,t)},s.prototype.catch=function(e){return this._getPromise().catch(e)},s.prototype._getPromise=function(){return this._promise||(this._promise=new Promise((function(e,t){this._once("end",e),this._once("error",t)}).bind(this))),this._promise},s.prototype.submit=function(e){this.state="running";var t=this;this.native=e.native,e.native.arrayMode=this._arrayMode;var r=y(function(r,n,i){if(e.native.arrayMode=!1,u(function(){t.emit("_done")}),r)return t.handleError(r);t._emitRowEvents&&(i.length>1?n.forEach((e,r)=>{e.forEach(e=>{t.emit("row",e,i[r])})}):n.forEach(function(e){t.emit("row",e,i)})),t.state="end",t.emit("end",i),t.callback&&t.callback(null,i)},"after");if(l.domain&&(r=l.domain.bind(r)),this.name){this.name.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",this.name,this.name.length),console.error("This can cause conflicts and silent errors executing queries"));var n=(this.values||[]).map(i.prepareValue);if(e.namedQueries[this.name]){if(this.text&&e.namedQueries[this.name]!==this.text){let e=Error(`Prepa\
32
- red statements must be unique - '${this.name}' was used for a different statement`);return r(e)}return e.native.execute(this.name,n,r)}return e.native.prepare(this.name,this.text,n.length,function(i){return i?r(i):(e.namedQueries[t.name]=t.text,t.native.execute(t.name,n,r))})}if(this.values){if(!Array.isArray(this.values)){let e=Error("Query values must be an array");return r(e)}var s=this.values.map(i.prepareValue);e.native.query(this.text,s,r)}else e.native.query(this.text,r)}}),e0=v((e,t)=>{P();var r=(eK(),S(eX)),n=K(),i=(eJ(),O().EventEmitter),s=(ef(),S(el)),o=eM(),u=eZ(),c=t.exports=function(e){i.call(this),e=e||{},this._Promise=e.Promise||a.Promise,this._types=new n(e.types),this.native=new r({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting=!1,this._connected=!1,this._queryable=!0;var t=this.connectionParameters=new o(e);this.user=t.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:t.password}),this.database=t.database,this.host=t.host,this.port=t.port,this.namedQueries={}};c.Query=u,s.inherits(c,i),c.prototype._errorAllQueries=function(e){let t=y(t=>{l.nextTick(()=>{t.native=this.native,t.handleError(e)})},"enqueueError");this._hasActiveQuery()&&(t(this._activeQuery),this._activeQuery=null),this._queryQueue.forEach(t),this._queryQueue.length=0},c.prototype._connect=function(e){var t=this;if(this._connecting)return void l.nextTick(()=>e(Error("Client has already been connected. You cannot reuse a client.")));this._connecting=!0,this.connectionParameters.getLibpqConnectionString(function(r,n){if(r)return e(r);t.native.connect(n,function(r){if(r)return t.native.end(),e(r);t._connected=!0,t.native.on("error",function(e){t._queryable=!1,t._errorAllQueries(e),t.emit("error",e)}),t.native.on("notification",function(e){t.emit("notification",{channel:e.relname,payload:e.extra})}),t.emit("connect"),t._pulseQueryQueue(!0),e()})})},c.prototype.connect=function(e){return e?void this._connect(e):new this._Promise((e,t)=>{this._connect(r=>{r?t(r):e()})})},c.prototype.query=function(e,t,r){var n,i,s,o,a;if(null==e)throw TypeError("Client was passed a null or undefined query");if("function"==typeof e.submit)s=e.query_timeout||this.connectionParameters.query_timeout,i=n=e,"function"==typeof t&&(e.callback=t);else if(s=this.connectionParameters.query_timeout,!(n=new u(e,t,r)).callback){let e,t;i=new this._Promise((r,n)=>{e=r,t=n}),n.callback=(r,n)=>r?t(r):e(n)}return s&&(a=n.callback,o=setTimeout(()=>{var e=Error("Query read timeout");l.nextTick(()=>{n.handleError(e,this.connection)}),a(e),n.callback=()=>{};var t=this._queryQueue.indexOf(n);t>-1&&this._queryQueue.splice(t,1),this._pulseQueryQueue()},s),n.callback=(e,t)=>{clearTimeout(o),a(e,t)}),this._queryable?this._ending?(n.native=this.native,l.nextTick(()=>{n.handleError(Error("Client was closed and is not queryable"))})):(this._queryQueue.push(n),this._pulseQueryQueue()):(n.native=this.native,l.nextTick(()=>{n.handleError(Error("Client has encountered a connection error and is not queryable"))})),i},c.prototype.end=function(e){var t,r=this;return this._ending=!0,this._connected||this.once("connect",this.end.bind(this,e)),e||(t=new this._Promise(function(t,r){e=y(e=>e?r(e):t(),"cb")})),this.native.end(function(){r._errorAllQueries(Error("Connection terminated")),l.nextTick(()=>{r.emit("end"),e&&e()})}),t},c.prototype._hasActiveQuery=function(){return this._activeQuery&&"error"!==this._activeQuery.state&&"end"!==this._activeQuery.state},c.prototype._pulseQueryQueue=function(e){if(this._connected&&!this._hasActiveQuery()){var t=this._queryQueue.shift();if(!t){e||this.emit("drain");return}this._activeQuery=t,t.submit(this);var r=this;t.once("_done",function(){r._pulseQueryQueue()})}},c.prototype.cancel=function(e){this._activeQuery===e?this.native.cancel(function(){}):-1!==this._queryQueue.indexOf(e)&&this._queryQueue.splice(this._queryQueue.indexOf(e),1)},c.prototype.ref=function(){},c.prototype.unref=function(){},c.prototype.setTypeParser=function(e,t,r){return this._types.setTypeParser(e,t,r)},c.prototype.getTypeParser=function(e,t){return this._types.getTypeParser(e,t)}}),e1=v((e,t)=>{P(),t.exports=e0()}),e2=v((e,t)=>{P();var r=eQ(),n=eu(),i=eW(),s=eY(),{DatabaseError:o}=e$(),a=y(e=>{var t;return y(t=class extends s{constructor(t){super(t,e)}},"BoundPool"),t},"poolFactory"),u=y(function(e){this.defaults=n,this.Client=e,this.Query=this.Client.Query,this.Pool=a(this.Client),this._pools=[],this.Connection=i,this.types=z(),this.DatabaseError=o},"PG");"u">typeof l.env.NODE_PG_FORCE_NATIVE?t.exports=new u(e1()):(t.exports=new u(r),Object.defineProperty(t.exports,"native",{configurable:!0,enumerable:!1,get(){var e=null;try{e=new u(e1())}catch(e){if("MODULE_NOT_FOUND"!==e.code)throw e}return Object.defineProperty(t.exports,"native",{value:e}),e}}))});P(),P(),k(),U(),P();var e6=Object.defineProperty,e3=Object.defineProperties,e5=Object.getOwnPropertyDescriptors,e4=Object.getOwnPropertySymbols,e8=Object.prototype.hasOwnProperty,e9=Object.prototype.propertyIsEnumerable,e7=y((e,t,r)=>t in e?e6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),te=y((e,t)=>{for(var r in t||(t={}))e8.call(t,r)&&e7(e,r,t[r]);if(e4)for(var r of e4(t))e9.call(t,r)&&e7(e,r,t[r]);return e},"__spreadValues"),tt=y((e,t)=>e3(e,e5(t)),"__spreadProps"),tr=2===new Uint8Array(new Uint16Array([258]).buffer)[0],tn=new TextDecoder,ti=new TextEncoder,ts=ti.encode("0123456789abcdef"),to=ti.encode("0123456789ABCDEF"),ta=ti.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").slice();function tu(e,{alphabet:n,scratchArr:i}={}){if(!t)if(t=new Uint16Array(256),r=new Uint16Array(256),tr)for(let e=0;e<256;e++)t[e]=ts[15&e]<<8|ts[e>>>4],r[e]=to[15&e]<<8|to[e>>>4];else for(let e=0;e<256;e++)t[e]=ts[15&e]|ts[e>>>4]<<8,r[e]=to[15&e]|to[e>>>4]<<8;e.byteOffset%4!=0&&(e=new Uint8Array(e));let s=e.length,o=s>>>2,a=i||new Uint16Array(s),u=new Uint32Array(e.buffer,e.byteOffset,o),c=new Uint32Array(a.buffer,a.byteOffset,s>>>1),l="upper"===n?r:t,h=0,f=0,d;if(tr)for(;h<o;)d=u[h++],c[f++]=l[d>>>8&255]<<16|l[255&d],c[f++]=l[d>>>24]<<16|l[d>>>16&255];else for(;h<o;)d=u[h++],c[f++]=l[d>>>24]<<16|l[d>>>16&255],c[f++]=l[d>>>8&255]<<16|l[255&d];for(h<<=2;h<s;)a[h]=l[e[h++]];return tn.decode(a.subarray(0,s))}function tc(e,t={}){let r="",n=e.length,i=Math.ceil(n/504e3),s=new Uint16Array(i>1?504e3:n);for(let n=0;n<i;n++){let i=504e3*n,o=i+504e3;r+=tu(e.subarray(i,o),tt(te({},t),{scratchArr:s}))}return r}function tl(e,t={}){return"upper"!==t.alphabet&&"function"==typeof e.toHex?e.toHex():tc(e,t)}ta[62]=45,ta[63]=95,y(tu,"_toHex"),y(tc,"_toHexChunked"),y(tl,"toHex"),P();var th=class e{constructor(e,t){this.strings=e,this.values=t}toParameterizedQuery(t={query:"",params:[]}){let{strings:r,values:n}=this;for(let i=0,s=r.length;i<s;i++)if(t.query+=r[i],i<n.length){let r=n[i];if(r instanceof td)t.query+=r.sql;else if(r instanceof tR)if(r.queryData instanceof e)r.queryData.toParameterizedQuery(t);else{if(r.queryData.params?.length)throw Error("This query is not composable");t.query+=r.queryData.query}else{let{params:e}=t;e.push(r),t.query+="$"+e.length,(r instanceof c||ArrayBuffer.isView(r))&&(t.query+="::bytea")}}return t}};y(th,"SqlTemplate");var tf=class{constructor(e){this.sql=e}};y(tf,"UnsafeRawSql");var td=tf;function tp(){}P(),y(tp,"warnIfBrowser"),k();var tg=E(K()),tm=E(ec()),ty=class e extends Error{constructor(t){super(t),R(this,"name","NeonDbError"),R(this,"severity"),R(this,"code"),R(this,"detail"),R(this,"hint"),R(this,"position"),R(this,"internalPosition"),R(this,"internalQuery"),R(this,"where"),R(this,"schema"),R(this,"table"),R(this,"column"),R(this,"dataType"),R(this,"constraint"),R(this,"file"),R(this,"line"),R(this,"routine"),R(this,"sourceError"),"captureStackTrace"in Error&&"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}};y(ty,"NeonDbError");var tb="transaction() expects an array of queries, or a function returning an array of queries",tv=["severity","code","detail","hint","position","internalPosition","internalQuery","where","schema","table","column","dataType","constraint","file","line","routine"];function t_(e){return e instanceof c?"\\x"+tl(e):e}function tw(e){let{query:t,params:r}=e instanceof th?e.toParameterizedQuery():e;return{query:t,params:r.map(e=>t_((0,tm.prepareValue)(e)))}}function tE(e,{arrayMode:t,fullResults:r,fetchOptions:n,isolationLevel:i,readOnly:s,deferrable:o,authToken:a,disableWarningInBrowsers:u}={}){let c;if(!e)throw Error("No database connection string was provided to `neon()`. Perhaps an environment variable has not been set?");try{c=j(e)}catch{throw Error("Database connection string provided to `neon()` is not a valid URL. Connection string: "+String(e))}let{protocol:l,username:h,hostname:f,port:d,pathname:p}=c;if("postgres:"!==l&&"postgresql:"!==l||!h||!f||!p)throw Error("Database connection string format for `neon()` should be: postgresql://user:password@host.tld/dbname?option=value");function g(e,...t){if(!(Array.isArray(e)&&Array.isArray(e.raw)&&Array.isArray(t)))throw Error('This function can now 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("SELECT $1", [value], options).');return new tR(m,new th(e,t))}async function m(c,l,h){let p,{fetchEndpoint:g,fetchFunction:m}=D,y=Array.isArray(c)?{queries:c.map(e=>tw(e))}:tw(c),b=n??{},v=t??!1,_=r??!1,w=i,E=s,S=o;void 0!==h&&(void 0!==h.fetchOptions&&(b={...b,...h.fetchOptions}),void 0!==h.arrayMode&&(v=h.arrayMode),void 0!==h.fullResults&&(_=h.fullResults),void 0!==h.isolationLevel&&(w=h.isolationLevel),void 0!==h.readOnly&&(E=h.readOnly),void 0!==h.deferrable&&(S=h.deferrable)),void 0===l||Array.isArray(l)||void 0===l.fetchOptions||(b={...b,...l.fetchOptions});let R=a;Array.isArray(l)||l?.authToken===void 0||(R=l.authToken);let x="function"==typeof g?g(f,d,{jwtAuth:void 0!==R}):g,A={"Neon-Connection-String":e,"Neon-Raw-Text-Output":"true","Neon-Array-Mode":"true"},T=await tA(R);T&&(A.Authorization=`Bearer ${T}`),Array.isArray(c)&&(void 0!==w&&(A["Neon-Batch-Isolation-Level"]=w),void 0!==E&&(A["Neon-Batch-Read-Only"]=String(E)),void 0!==S&&(A["Neon-Batch-Deferrable"]=String(S))),u||D.disableWarningInBrowsers||tp();try{p=await (m??fetch)(x,{method:"POST",body:JSON.stringify(y),headers:A,...b})}catch(t){let e=new ty(`Error connecting to database: ${t}`);throw e.sourceError=t,e}if(p.ok){let e=await p.json();if(Array.isArray(c)){let t=e.results;if(!Array.isArray(t))throw new ty("Neon internal error: unexpected result format");return t.map((e,t)=>{let r=l[t]??{};return tx(e,{arrayMode:r.arrayMode??v,fullResults:r.fullResults??_,types:r.types})})}{let t=l??{};return tx(e,{arrayMode:t.arrayMode??v,fullResults:t.fullResults??_,types:t.types})}}{let{status:e}=p;if(400===e){let e=await p.json(),t=new ty(e.message);for(let r of tv)t[r]=e[r]??void 0;throw t}{let t=await p.text();throw new ty(`Server error (HTTP status ${e}): ${t}`)}}}return y(g,"templateFn"),g.query=(e,t,r)=>new tR(m,{query:e,params:t??[]},r),g.unsafe=e=>new td(e),g.transaction=async(e,t)=>{if("function"==typeof e&&(e=e(g)),!Array.isArray(e))throw Error(tb);return e.forEach(e=>{if(!(e instanceof tR))throw Error(tb)}),m(e.map(e=>e.queryData),e.map(e=>e.opts??{}),t)},y(m,"execute"),g}y(t_,"encodeBuffersAsBytea"),y(tw,"prepareQuery"),y(tE,"neon");var tS=class{constructor(e,t,r){this.execute=e,this.queryData=t,this.opts=r}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)}};y(tS,"NeonQueryPromise");var tR=tS;function tx(e,{arrayMode:t,fullResults:r,types:n}){let i=new tg.default(n),s=e.fields.map(e=>e.name),o=e.fields.map(e=>i.getTypeParser(e.dataTypeID)),a=!0===t?e.rows.map(e=>e.map((e,t)=>null===e?null:o[t](e))):e.rows.map(e=>Object.fromEntries(e.map((e,t)=>[s[t],null===e?null:o[t](e)])));return r?(e.viaNeonFetch=!0,e.rowAsArray=t,e.rows=a,e._parsers=o,e._types=i,e):a}async function tA(e){if("string"==typeof e)return e;if("function"==typeof e)try{return await Promise.resolve(e())}catch(t){let e=new ty("Error getting auth token.");throw t instanceof Error&&(e=new ty(`Error getting auth token: ${t.message}`)),e}}y(tx,"processQueryResult"),y(tA,"getAuthToken"),P();var tT=E(e2());P();var tP=E(e2()),tO=class extends tP.Client{constructor(e){super(e),this.config=e}get neonConfig(){return this.connection.stream}connect(e){let{neonConfig:t}=this;t.forceDisablePgSSL&&(this.ssl=this.connection.ssl=!1),this.ssl&&t.useSecureWebSocket&&console.warn("SSL is enabled for both Postgres (e.g. ?sslmode=require in the connection string + forceDisablePgSSL = false) and the WebSocket tunnel (useSecureWebSocket = true). Double encryption will increase latency and CPU usage. It may be appropriate to disable SSL in the Postgres connection parameters or set forceDisablePgSSL = true.");let r="string"!=typeof this.config&&this.config?.host!==void 0||"string"!=typeof this.config&&this.config?.connectionString!==void 0||void 0!==l.env.PGHOST,n=l.env.USER??l.env.USERNAME;if(!r&&"localhost"===this.host&&this.user===n&&this.database===n&&null===this.password)throw Error(`No database host or connection string wa\
28
+ ket--undefined. Details: ${e}`)),this.emit("close")})}}async startTls(e){if(void 0===this.subtls)throw Error("For Postgres SSL connections, you must set `neonConfig.subtls` to the subtls library. See https://github.com/neondatabase/serverless/blob/main/CONFIG.md for more information.");this.tlsState=1;let t=await this.subtls.TrustedCert.databaseFromPEM(this.rootCerts),r=new this.subtls.WebSocketReadQueue(this.ws),n=r.read.bind(r),i=this.rawWrite.bind(this),{read:s,write:o}=await this.subtls.startTls(e,t,n,i,{useSNI:!this.disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead=s,this.tlsWrite=o,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){for(;;){let e=await this.tlsRead();if(void 0===e)break;{let t=l.from(e);this.emit("data",t)}}}rawWrite(e){if(!this.coalesceWrites){this.ws&&this.ws.send(e);return}if(void 0===this.writeBuffer)this.writeBuffer=e,setTimeout(()=>{this.ws&&this.ws.send(this.writeBuffer),this.writeBuffer=void 0},0);else{let t=new Uint8Array(this.writeBuffer.length+e.length);t.set(this.writeBuffer),t.set(e,this.writeBuffer.length),this.writeBuffer=t}}write(e,t="utf8",r=e=>{}){return 0===e.length?r():("string"==typeof e&&(e=l.from(e,t)),0===this.tlsState?(this.rawWrite(e),r()):1===this.tlsState?this.once("secureConnection",()=>{this.write(e,t,r)}):(this.tlsWrite(e),r())),!0}end(e=l.alloc(0),t="utf8",r=()=>{}){return this.write(e,t,()=>{this.ws.close(),r()}),this}destroy(){return this.destroyed=!0,this.end()}},b(D,"Socket"),x(D,"defaults",{poolQueryViaFetch:!1,fetchEndpoint:b((e,t,r)=>"https://"+(r?.jwtAuth?e.replace(M,"apiauth."):e.replace(M,"api."))+"/sql","fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0,webSocketConstructor:void 0,wsProxy:b(e=>e+"/v2","wsProxy"),useSecureWebSocket:!0,forceDisablePgSSL:!0,coalesceWrites:!0,pipelineConnect:"password",subtls:void 0,rootCerts:"",pipelineTLS:!1,disableSNI:!1,disableWarningInBrowsers:!1}),x(D,"opts",{}),k=D}),j={};function U(e,t=!1){let{protocol:r}=new URL(e),{username:n,password:i,host:s,hostname:o,port:a,pathname:u,search:c,searchParams:l,hash:h}=new URL("http:"+e.substring(r.length));i=decodeURIComponent(i),n=decodeURIComponent(n),u=decodeURIComponent(u);let f=n+":"+i,d=t?Object.fromEntries(l.entries()):c;return{href:e,protocol:r,auth:f,username:n,password:i,host:s,hostname:o,port:a,pathname:u,search:c,query:d,hash:h}}w(j,{parse:()=>U});var F=v(()=>{O(),b(U,"parse")}),q=_(e=>{O(),e.parse=function(e,t){return new r(e,t).parse()};var t=class e{constructor(e,t){this.source=e,this.transform=t||n,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)&&("NULL"!==(t=this.recorded.join(""))||e||(t=null),null!==t&&(t=this.transform(t)),this.entries.push(t),this.recorded=[])}consumeDimensions(){if("["===this.source[0])for(;!this.isEof()&&"="!==this.nextCharacter().value;);}parse(t){var r,n,i;for(this.consumeDimensions();!this.isEof();)if("{"!==(r=this.nextCharacter()).value||i){if("}"!==r.value||i)'"'!==r.value||r.escaped?","!==r.value||i?this.record(r.value):this.newEntry():(i&&this.newEntry(!0),i=!i);else if(this.dimension--,!this.dimension&&(this.newEntry(),t))return this.entries}else this.dimension++,this.dimension>1&&(n=new e(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse(!0)),this.position+=n.position-2);if(0!==this.dimension)throw Error("array dimension not balanced");return this.entries}};b(t,"ArrayParser");var r=t;function n(e){return e}b(n,"identity")}),$=_((e,t)=>{O();var r=q();t.exports={create:b(function(e,t){return{parse:b(function(){return r.parse(e,t)},"parse")}},"create")}}),G=_((e,t)=>{O();var r=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,n=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,i=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,s=/^-?infinity$/;function o(e){var t=n.exec(e);if(t){var r=parseInt(t[1],10);t[4]&&(r=u(r));var i=new Date(r,parseInt(t[2],10)-1,t[3]);return c(r)&&i.setFullYear(r),i}}function a(e){if(e.endsWith("+00"))return 0;var t=i.exec(e.split(" ")[1]);if(t){var r=t[1];return"Z"===r?0:(3600*parseInt(t[2],10)+60*parseInt(t[3]||0,10)+parseInt(t[4]||0,10))*("-"===r?-1:1)*1e3}}function u(e){return-(e-1)}function c(e){return e>=0&&e<100}t.exports=b(function(e){if(s.test(e))return Number(e.replace("i","I"));var t=r.exec(e);if(!t)return o(e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=u(i));var l=parseInt(t[2],10)-1,h=t[3],f=parseInt(t[4],10),d=parseInt(t[5],10),p=parseInt(t[6],10),g=t[7];g=g?1e3*parseFloat(g):0;var m,y=a(e);return null!=y?(m=new Date(Date.UTC(i,l,h,f,d,p,g)),c(i)&&m.setUTCFullYear(i),0!==y&&m.setTime(m.getTime()-y)):(m=new Date(i,l,h,f,d,p,g),c(i)&&m.setFullYear(i)),m},"parseDate"),b(o,"getDate"),b(a,"timeZoneOffset"),b(u,"bcYearToNegativeYear"),b(c,"is0To99")}),H=_((e,t)=>{O(),t.exports=n;var r=Object.prototype.hasOwnProperty;function n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)r.call(n,i)&&(e[i]=n[i])}return e}b(n,"extend")}),V=_((e,t)=>{O();var r=H();function n(e){if(!(this instanceof n))return new n(e);r(this,d(e))}t.exports=n,b(n,"PostgresInterval");var i=["seconds","minutes","hours","days","months","years"];n.prototype.toPostgres=function(){var e=i.filter(this.hasOwnProperty,this);return this.milliseconds&&0>e.indexOf("seconds")&&e.push("seconds"),0===e.length?"0":e.map(function(e){var t=this[e]||0;return"seconds"===e&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/,"")),t+" "+e},this).join(" ")};var s={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"S"},o=["years","months","days"],a=["hours","minutes","seconds"];n.prototype.toISOString=n.prototype.toISO=function(){return"P"+o.map(e,this).join("")+"T"+a.map(e,this).join("");function e(e){var t=this[e]||0;return"seconds"===e&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/0+$/,"")),t+s[e]}};var u="([+-]?\\d+)",c=new RegExp([u+"\\s+years?",u+"\\s+mons?",u+"\\s+days?","([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?"].map(function(e){return"("+e+")?"}).join("\\s*")),l={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},h=["hours","minutes","seconds","milliseconds"];function f(e){return parseInt(e+"000000".slice(e.length),10)/1e3}function d(e){if(!e)return{};var t=c.exec(e),r="-"===t[8];return Object.keys(l).reduce(function(e,n){var i=t[l[n]];return i&&(i="milliseconds"===n?f(i):parseInt(i,10))&&(r&&~h.indexOf(n)&&(i*=-1),e[n]=i),e},{})}b(f,"parseMilliseconds"),b(d,"parse")}),W=_((e,t)=>{O(),t.exports=b(function(e){if(/^\\x/.test(e))return new l(e.substr(2),"hex");for(var t="",r=0;r<e.length;)if("\\"!==e[r])t+=e[r],++r;else if(/[0-7]{3}/.test(e.substr(r+1,3)))t+=String.fromCharCode(parseInt(e.substr(r+1,3),8)),r+=4;else{for(var n=1;r+n<e.length&&"\\"===e[r+n];)n++;for(var i=0;i<Math.floor(n/2);++i)t+="\\";r+=2*Math.floor(n/2)}return new l(t,"binary")},"parseBytea")}),Q=_((e,t)=>{O();var r=q(),n=$(),i=G(),s=V(),o=W();function a(e){return b(function(t){return null===t?t:e(t)},"nullAllowed")}function u(e){return null===e?e:"TRUE"===e||"t"===e||"true"===e||"y"===e||"yes"===e||"on"===e||"1"===e}function c(e){return e?r.parse(e,u):null}function l(e){return parseInt(e,10)}function h(e){return e?r.parse(e,a(l)):null}function f(e){return e?r.parse(e,a(function(e){return w(e).trim()})):null}b(a,"allowNull"),b(u,"parseBool"),b(c,"parseBoolArray"),b(l,"parseBaseTenInt"),b(h,"parseIntegerArray"),b(f,"parseBigIntegerArray");var d=b(function(e){return e?n.create(e,function(e){return null!==e&&(e=S(e)),e}).parse():null},"parsePointArray"),p=b(function(e){return e?n.create(e,function(e){return null!==e&&(e=parseFloat(e)),e}).parse():null},"parseFloatArray"),g=b(function(e){return e?n.create(e).parse():null},"parseStringArray"),m=b(function(e){return e?n.create(e,function(e){return null!==e&&(e=i(e)),e}).parse():null},"parseDateArray"),y=b(function(e){return e?n.create(e,function(e){return null!==e&&(e=s(e)),e}).parse():null},"parseIntervalArray"),v=b(function(e){return e?r.parse(e,a(o)):null},"parseByteAArray"),_=b(function(e){return parseInt(e,10)},"parseInteger"),w=b(function(e){var t=String(e);return/^\d+$/.test(t)?t:e},"parseBigInteger"),E=b(function(e){return e?r.parse(e,a(JSON.parse)):null},"parseJsonArray"),S=b(function(e){return"("!==e[0]?null:{x:parseFloat((e=e.substring(1,e.length-1).split(","))[0]),y:parseFloat(e[1])}},"parsePoint"),R=b(function(e){if("<"!==e[0]&&"("!==e[1])return null;for(var t="(",r="",n=!1,i=2;i<e.length-1;i++){if(n||(t+=e[i]),")"===e[i]){n=!0;continue}n&&","!==e[i]&&(r+=e[i])}var s=S(t);return s.radius=parseFloat(r),s},"parseCircle");t.exports={init:b(function(e){e(20,w),e(21,_),e(23,_),e(26,_),e(700,parseFloat),e(701,parseFloat),e(16,u),e(1082,i),e(1114,i),e(1184,i),e(600,S),e(651,g),e(718,R),e(1e3,c),e(1001,v),e(1005,h),e(1007,h),e(1028,h),e(1016,f),e(1017,d),e(1021,p),e(1022,p),e(1231,p),e(1014,g),e(1015,g),e(1008,g),e(1009,g),e(1040,g),e(1041,g),e(1115,m),e(1182,m),e(1185,m),e(1186,s),e(1187,y),e(17,o),e(114,JSON.parse.bind(JSON)),e(3802,JSON.parse.bind(JSON)),e(199,E),e(3807,E),e(3907,g),e(2951,g),e(791,g),e(1183,g),e(1270,g)},"init")}}),Y=_((e,t)=>{function r(e){var t=e.readInt32BE(0),r=e.readUInt32BE(4),n="";t<0&&(t=~t+(0===r),r=~r+1>>>0,n="-");var i,s,o,a,u,c,l="";if(i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";if(l=a+o+l,i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";if(l=a+o+l,i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";return l=a+o+l,n+(o=""+(s=0x100000000*(i=t%1e6)+r)%1e6)+l}O(),b(r,"readInt8"),t.exports=r}),X=_((e,t)=>{O();var r=Y(),n=b(function(e,t,r,n,i){r=r||0,n=n||!1,i=i||function(e,t,r){return e*Math.pow(2,r)+t};var s=r>>3,o=b(function(e){return n?255&~e:e},"inv"),a=255,u=8-r%8;t<u&&(a=255<<8-t&255,u=t),r&&(a>>=r%8);var c=0;r%8+t>=8&&(c=i(0,o(e[s])&a,u));for(var l=t+r>>3,h=s+1;h<l;h++)c=i(c,o(e[h]),8);var f=(t+r)%8;return f>0&&(c=i(c,o(e[l])>>8-f,f)),c},"parseBits"),i=b(function(e,t,r){var i=Math.pow(2,r-1)-1,s=n(e,1),o=n(e,r,1);if(0===o)return 0;var a=1,u=n(e,t,r+1,!1,b(function(e,t,r){0===e&&(e=1);for(var n=1;n<=r;n++)a/=2,(t&1<<r-n)>0&&(e+=a);return e},"parsePrecisionBits"));return o==Math.pow(2,r+1)-1?0===u?0===s?1/0:-1/0:NaN:(0===s?1:-1)*Math.pow(2,o-i)*u},"parseFloatFromBits"),s=b(function(e){return 1==n(e,1)?-1*(n(e,15,1,!0)+1):n(e,15,1)},"parseInt16"),o=b(function(e){return 1==n(e,1)?-1*(n(e,31,1,!0)+1):n(e,31,1)},"parseInt32"),a=b(function(e){return i(e,23,8)},"parseFloat32"),u=b(function(e){return i(e,52,11)},"parseFloat64"),c=b(function(e){var t=n(e,16,32);if(49152==t)return NaN;for(var r=Math.pow(1e4,n(e,16,16)),i=0,s=n(e,16),o=0;o<s;o++)i+=n(e,16,64+16*o)*r,r/=1e4;var a=Math.pow(10,n(e,16,48));return(0===t?1:-1)*Math.round(i*a)/a},"parseNumeric"),l=b(function(e,t){var r=n(t,1),i=n(t,63,1),s=new Date((0===r?1:-1)*i/1e3+9466848e5);return e||s.setTime(s.getTime()+6e4*s.getTimezoneOffset()),s.usec=i%1e3,s.getMicroSeconds=function(){return this.usec},s.setMicroSeconds=function(e){this.usec=e},s.getUTCMicroSeconds=function(){return this.usec},s},"parseDate"),h=b(function(e){for(var t=n(e,32),r=(n(e,32,32),n(e,32,64)),i=96,s=[],o=0;o<t;o++)s[o]=n(e,32,i),i+=64;var a=b(function(t){var r,s=n(e,32,i);return(i+=32,0xffffffff==s)?null:23==t||20==t?(r=n(e,8*s,i),i+=8*s,r):25==t?e.toString(this.encoding,i>>3,(i+=s<<3)>>3):void console.log("ERROR: ElementType not implemented: "+t)},"parseElement"),u=b(function(e,t){var r,n=[];if(e.length>1){var i=e.shift();for(r=0;r<i;r++)n[r]=u(e,t);e.unshift(i)}else for(r=0;r<e[0];r++)n[r]=a(t);return n},"parse");return u(s,r)},"parseArray"),f=b(function(e){return e.toString("utf8")},"parseText"),d=b(function(e){return null===e?null:n(e,8)>0},"parseBool");t.exports={init:b(function(e){e(20,r),e(21,s),e(23,o),e(26,o),e(1700,c),e(700,a),e(701,u),e(16,d),e(1114,l.bind(null,!1)),e(1184,l.bind(null,!0)),e(1e3,h),e(1007,h),e(1016,h),e(1008,h),e(1009,h),e(25,f)},"init")}}),z=_((e,t)=>{O(),t.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}}),K=_(e=>{O();var t=Q(),r=X(),n=$(),i=z();e.getTypeParser=a,e.setTypeParser=u,e.arrayParser=n,e.builtins=i;var s={text:{},binary:{}};function o(e){return String(e)}function a(e,t){return s[t=t||"text"]&&s[t][e]||o}function u(e,t,r){"function"==typeof t&&(r=t,t="text"),s[t][e]=r}b(o,"noParse"),b(a,"getTypeParser"),b(u,"setTypeParser"),t.init(function(e,t){s.text[e]=t}),r.init(function(e,t){s.binary[e]=t})}),J=_((e,t)=>{O();var r=K();function n(e){this._types=e||r,this.text={},this.binary={}}b(n,"TypeOverrides"),n.prototype.getOverrides=function(e){switch(e){case"text":return this.text;case"binary":return this.binary;default:return{}}},n.prototype.setTypeParser=function(e,t,r){"function"==typeof t&&(r=t,t="text"),this.getOverrides(t)[e]=r},n.prototype.getTypeParser=function(e,t){return t=t||"text",this.getOverrides(t)[e]||this._types.getTypeParser(e,t)},t.exports=n});function Z(e){let t=0x6a09e667,r=0xbb67ae85,n=0x3c6ef372,i=0xa54ff53a,s=0x510e527f,o=0x9b05688c,a=0x1f83d9ab,u=0x5be0cd19,c=0,l=0,h=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],f=b((e,t)=>e>>>t|e<<32-t,"rrot"),d=new Uint32Array(64),p=new Uint8Array(64),g=b(()=>{for(let e=0,t=0;e<16;e++,t+=4)d[e]=p[t]<<24|p[t+1]<<16|p[t+2]<<8|p[t+3];for(let e=16;e<64;e++){let t=f(d[e-15],7)^f(d[e-15],18)^d[e-15]>>>3,r=f(d[e-2],17)^f(d[e-2],19)^d[e-2]>>>10;d[e]=d[e-16]+t+d[e-7]+r|0}let e=t,c=r,g=n,m=i,y=s,b=o,v=a,_=u;for(let t=0;t<64;t++){let r=_+(f(y,6)^f(y,11)^f(y,25))+(y&b^~y&v)+h[t]+d[t]|0,n=(f(e,2)^f(e,13)^f(e,22))+(e&c^e&g^c&g)|0;_=v,v=b,b=y,y=m+r|0,m=g,g=c,c=e,e=r+n|0}t=t+e|0,r=r+c|0,n=n+g|0,i=i+m|0,s=s+y|0,o=o+b|0,a=a+v|0,u=u+_|0,l=0},"process"),m=b(e=>{"string"==typeof e&&(e=new TextEncoder().encode(e));for(let t=0;t<e.length;t++)p[l++]=e[t],64===l&&g();c+=e.length},"add"),y=b(()=>{if(p[l++]=128,64==l&&g(),l+8>64){for(;l<64;)p[l++]=0;g()}for(;l<58;)p[l++]=0;let e=8*c;p[l++]=e/0x10000000000&255,p[l++]=e/0x100000000&255,p[l++]=e>>>24,p[l++]=e>>>16&255,p[l++]=e>>>8&255,p[l++]=255&e,g();let h=new Uint8Array(32);return h[0]=t>>>24,h[1]=t>>>16&255,h[2]=t>>>8&255,h[3]=255&t,h[4]=r>>>24,h[5]=r>>>16&255,h[6]=r>>>8&255,h[7]=255&r,h[8]=n>>>24,h[9]=n>>>16&255,h[10]=n>>>8&255,h[11]=255&n,h[12]=i>>>24,h[13]=i>>>16&255,h[14]=i>>>8&255,h[15]=255&i,h[16]=s>>>24,h[17]=s>>>16&255,h[18]=s>>>8&255,h[19]=255&s,h[20]=o>>>24,h[21]=o>>>16&255,h[22]=o>>>8&255,h[23]=255&o,h[24]=a>>>24,h[25]=a>>>16&255,h[26]=a>>>8&255,h[27]=255&a,h[28]=u>>>24,h[29]=u>>>16&255,h[30]=u>>>8&255,h[31]=255&u,h},"digest");return void 0===e?{add:m,digest:y}:(m(e),y())}var ee,et,er=v(()=>{O(),b(Z,"sha256")}),en=v(()=>{O(),b(ee=class e{constructor(){x(this,"_dataLength",0),x(this,"_bufferLength",0),x(this,"_state",new Int32Array(4)),x(this,"_buffer",new ArrayBuffer(68)),x(this,"_buffer8"),x(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(t){let r=e.hexChars,n=e.hexOut,i,s,o,a;for(a=0;a<4;a+=1)for(s=8*a,i=t[a],o=0;o<8;o+=2)n[s+1+o]=r.charAt(15&i),i>>>=4,n[s+0+o]=r.charAt(15&i),i>>>=4;return n.join("")}static _md5cycle(e,t){let r=e[0],n=e[1],i=e[2],s=e[3];r+=(n&i|~n&s)+t[0]-0x28955b88|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[1]-0x173848aa|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[2]+0x242070db|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[3]-0x3e423112|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[4]-0xa83f051|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[5]+0x4787c62a|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[6]-0x57cfb9ed|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[7]-0x2b96aff|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[8]+0x698098d8|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[9]-0x74bb0851|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[10]-42063|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[11]-0x76a32842|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[12]+0x6b901122|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[13]-0x2678e6d|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[14]-0x5986bc72|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[15]+0x49b40821|0,r+=((n=(n<<22|n>>>10)+i|0)&s|i&~s)+t[1]-0x9e1da9e|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[6]-0x3fbf4cc0|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[11]+0x265e5a51|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[0]-0x16493856|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[5]-0x29d0efa3|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[10]+0x2441453|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[15]-0x275e197f|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[4]-0x182c0438|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[9]+0x21e1cde6|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[14]-0x3cc8f82a|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[3]-0xb2af279|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[8]+0x455a14ed|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[13]-0x561c16fb|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[2]-0x3105c08|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[7]+0x676f02d9|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[12]-0x72d5b376|0,r+=((n=(n<<20|n>>>12)+i|0)^i^s)+t[5]-378558|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[8]-0x788e097f|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[11]+0x6d9d6122|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[14]-0x21ac7f4|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[1]-0x5b4115bc|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[4]+0x4bdecfa9|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[7]-0x944b4a0|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[10]-0x41404390|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[13]+0x289b7ec6|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[0]-0x155ed806|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[3]-0x2b10cf7b|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[6]+0x4881d05|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[9]-0x262b2fc7|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[12]-0x1924661b|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[15]+0x1fa27cf8|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[2]-0x3b53a99b|0,n=(n<<23|n>>>9)+i|0,r+=(i^(n|~s))+t[0]-0xbd6ddbc|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[7]+0x432aff97|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[14]-0x546bdc59|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[5]-0x36c5fc7|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[12]+0x655b59c3|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[3]-0x70f3336e|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[10]-1051523|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[1]-0x7a7ba22f|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[8]+0x6fa87e4f|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[15]-0x1d31920|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[6]-0x5cfebcec|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[13]+0x4e0811a1|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[4]-0x8ac817e|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[11]-0x42c50dcb|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[2]+0x2ad7d2bb|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[9]-0x14792c6f|0,n=(n<<21|n>>>11)+i|0,e[0]=r+e[0]|0,e[1]=n+e[1]|0,e[2]=i+e[2]|0,e[3]=s+e[3]|0}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(e.stateIdentity),this}appendStr(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o;for(o=0;o<t.length;o+=1){if((s=t.charCodeAt(o))<128)r[i++]=s;else if(s<2048)r[i++]=(s>>>6)+192,r[i++]=63&s|128;else if(s<55296||s>56319)r[i++]=(s>>>12)+224,r[i++]=s>>>6&63|128,r[i++]=63&s|128;else{if((s=(s-55296)*1024+(t.charCodeAt(++o)-56320)+65536)>1114111)throw Error("Unicode standard supports code points up to U+10FFFF");r[i++]=(s>>>18)+240,r[i++]=s>>>12&63|128,r[i++]=s>>>6&63|128,r[i++]=63&s|128}i>=64&&(this._dataLength+=64,e._md5cycle(this._state,n),i-=64,n[0]=n[16])}return this._bufferLength=i,this}appendAsciiStr(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(t.length-o,64-i);s--;)r[i++]=t.charCodeAt(o++);if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}appendByteArray(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(t.length-o,64-i);s--;)r[i++]=t[o++];if(i<64)break;this._dataLength+=64,e._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,r=e.state,n=this._state,i;for(this._dataLength=e.length,this._bufferLength=e.buflen,n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],i=0;i<t.length;i+=1)this._buffer8[i]=t.charCodeAt(i)}end(t=!1){let r=this._bufferLength,n=this._buffer8,i=this._buffer32,s=(r>>2)+1;this._dataLength+=r;let o=8*this._dataLength;if(n[r]=128,n[r+1]=n[r+2]=n[r+3]=0,i.set(e.buffer32Identity.subarray(s),s),r>55&&(e._md5cycle(this._state,i),i.set(e.buffer32Identity)),o<=0xffffffff)i[14]=o;else{let e=o.toString(16).match(/(.*?)(.{0,8})$/);if(null===e)return;let t=parseInt(e[2],16),r=parseInt(e[1],16)||0;i[14]=t,i[15]=r}return e._md5cycle(this._state,i),t?this._state:e._hex(this._state)}},"Md5"),x(ee,"stateIdentity",new Int32Array([0x67452301,-0x10325477,-0x67452302,0x10325476])),x(ee,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),x(ee,"hexChars","0123456789abcdef"),x(ee,"hexOut",[]),x(ee,"onePassHasher",new ee),et=ee}),ei={};function es(e){return crypto.getRandomValues(l.alloc(e))}function eo(e){if("sha256"===e)return{update:b(function(e){return{digest:b(function(){return l.from(Z(e))},"digest")}},"update")};if("md5"===e)return{update:b(function(e){return{digest:b(function(){return"string"==typeof e?et.hashStr(e):et.hashByteArray(e)},"digest")}},"update")};throw Error(`Hash type '${e}' not supported`)}function ea(e,t){if("sha256"!==e)throw Error(`\
29
+ Only sha256 is supported (requested: '${e}')`);return{update:b(function(e){return{digest:b(function(){"string"==typeof t&&(t=new TextEncoder().encode(t)),"string"==typeof e&&(e=new TextEncoder().encode(e));let r=t.length;if(r>64)t=Z(t);else if(r<64){let e=new Uint8Array(64);e.set(t),t=e}let n=new Uint8Array(64),i=new Uint8Array(64);for(let e=0;e<64;e++)n[e]=54^t[e],i[e]=92^t[e];let s=new Uint8Array(e.length+64);s.set(n,0),s.set(e,64);let o=new Uint8Array(96);return o.set(i,0),o.set(Z(s),64),l.from(Z(o))},"digest")}},"update")}}w(ei,{createHash:()=>eo,createHmac:()=>ea,randomBytes:()=>es});var eu=v(()=>{O(),er(),en(),b(es,"randomBytes"),b(eo,"createHash"),b(ea,"createHmac")}),ec=_((e,t)=>{O(),t.exports={host:"localhost",user:"win32"===h.platform?h.env.USERNAME:h.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 r=K(),n=r.getTypeParser(20,"text"),i=r.getTypeParser(1016,"text");t.exports.__defineSetter__("parseInt8",function(e){r.setTypeParser(20,"text",e?r.getTypeParser(23,"text"):n),r.setTypeParser(1016,"text",e?r.getTypeParser(1007,"text"):i)})}),el=_((e,t)=>{O();var r=(eu(),R(ei)),n=ec();function i(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function s(e){for(var t="{",r=0;r<e.length;r++)r>0&&(t+=","),null===e[r]||typeof e[r]>"u"?t+="NULL":Array.isArray(e[r])?t+=s(e[r]):e[r]instanceof l?t+="\\\\x"+e[r].toString("hex"):t+=i(o(e[r]));return t+"}"}b(i,"escapeElement"),b(s,"arrayString");var o=b(function(e,t){if(null==e)return null;if(e instanceof l)return e;if(ArrayBuffer.isView(e)){var r=l.from(e.buffer,e.byteOffset,e.byteLength);return r.length===e.byteLength?r:r.slice(e.byteOffset,e.byteOffset+e.byteLength)}return e instanceof Date?n.parseInputDatesAsUTC?h(e):c(e):Array.isArray(e)?s(e):"object"==typeof e?a(e,t):e.toString()},"prepareValue");function a(e,t){if(e&&"function"==typeof e.toPostgres){if(-1!==(t=t||[]).indexOf(e))throw Error('circular reference detected while preparing "'+e+'" for query');return t.push(e),o(e.toPostgres(o),t)}return JSON.stringify(e)}function u(e,t){for(e=""+e;e.length<t;)e="0"+e;return e}function c(e){var t=-e.getTimezoneOffset(),r=e.getFullYear(),n=r<1;n&&(r=Math.abs(r)+1);var i=u(r,4)+"-"+u(e.getMonth()+1,2)+"-"+u(e.getDate(),2)+"T"+u(e.getHours(),2)+":"+u(e.getMinutes(),2)+":"+u(e.getSeconds(),2)+"."+u(e.getMilliseconds(),3);return t<0?(i+="-",t*=-1):i+="+",i+=u(Math.floor(t/60),2)+":"+u(t%60,2),n&&(i+=" BC"),i}function h(e){var t=e.getUTCFullYear(),r=t<1;r&&(t=Math.abs(t)+1);var n=u(t,4)+"-"+u(e.getUTCMonth()+1,2)+"-"+u(e.getUTCDate(),2)+"T"+u(e.getUTCHours(),2)+":"+u(e.getUTCMinutes(),2)+":"+u(e.getUTCSeconds(),2)+"."+u(e.getUTCMilliseconds(),3);return n+="+00:00",r&&(n+=" BC"),n}function f(e,t,r){return e="string"==typeof e?{text:e}:e,t&&("function"==typeof t?e.callback=t:e.values=t),r&&(e.callback=r),e}b(a,"prepareObject"),b(u,"pad"),b(c,"dateToString"),b(h,"dateToStringUTC"),b(f,"normalizeQueryConfig");var d=b(function(e){return r.createHash("md5").update(e,"utf-8").digest("hex")},"md5"),p=b(function(e,t,r){var n=d(t+e);return"md5"+d(l.concat([l.from(n),r]))},"postgresMd5PasswordHash");t.exports={prepareValue:b(function(e){return o(e)},"prepareValueWrapper"),normalizeQueryConfig:f,postgresMd5PasswordHash:p,md5:d}}),eh={};w(eh,{default:()=>ef});var ef,ed=v(()=>{O(),ef={}}),ep=_((e,t)=>{O();var r=(eu(),R(ei));function n(e){if(-1===e.indexOf("SCRAM-SHA-256"))throw Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let t=r.randomBytes(18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:t,response:"n,,n=*,r="+t,message:"SASLInitialResponse"}}function i(e,t,r){if("SASLInitialResponse"!==e.message)throw Error("SASL: Last message was not SASLInitialResponse");if("string"!=typeof t)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if("string"!=typeof r)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=c(r);if(n.nonce.startsWith(e.clientNonce)){if(n.nonce.length===e.clientNonce.length)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");var i=g(t,l.from(n.salt,"base64"),n.iteration),s=p(i,"Client Key"),o=d(s),a="n=*,r="+e.clientNonce,u="r="+n.nonce+",s="+n.salt+",i="+n.iteration,h="c=biws,r="+n.nonce,m=a+","+u+","+h,y=f(s,p(o,m)).toString("base64"),b=p(i,"Server Key"),v=p(b,m);e.message="SASLResponse",e.serverSignature=v.toString("base64"),e.response=h+",p="+y}function s(e,t){if("SASLResponse"!==e.message)throw Error("SASL: Last message was not SASLResponse");if("string"!=typeof t)throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:r}=h(t);if(r!==e.serverSignature)throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match")}function o(e){if("string"!=typeof e)throw TypeError("SASL: text must be a string");return e.split("").map((t,r)=>e.charCodeAt(r)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}function a(e){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(e)}function u(e){if("string"!=typeof e)throw TypeError("SASL: attribute pairs text must be a string");return new Map(e.split(",").map(e=>{if(!/^.=/.test(e))throw Error("SASL: Invalid attribute pair entry");return[e[0],e.substring(2)]}))}function c(e){let t=u(e),r=t.get("r");if(r){if(!o(r))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing");let n=t.get("s");if(n){if(!a(n))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let i=t.get("i");if(i){if(!/^[1-9][0-9]*$/.test(i))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing");return{nonce:r,salt:n,iteration:parseInt(i,10)}}function h(e){let t=u(e).get("v");if(t){if(!a(t))throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:t}}function f(e,t){if(!l.isBuffer(e))throw TypeError("first argument must be a Buffer");if(!l.isBuffer(t))throw TypeError("second argument must be a Buffer");if(e.length!==t.length)throw Error("Buffer lengths must match");if(0===e.length)throw Error("Buffers cannot be empty");return l.from(e.map((r,n)=>e[n]^t[n]))}function d(e){return r.createHash("sha256").update(e).digest()}function p(e,t){return r.createHmac("sha256",e).update(t).digest()}function g(e,t,r){for(var n=p(e,l.concat([t,l.from([0,0,0,1])])),i=n,s=0;s<r-1;s++)i=f(i,n=p(e,n));return i}b(n,"startSession"),b(i,"continueSession"),b(s,"finalizeSession"),b(o,"isPrintableChars"),b(a,"isBase64"),b(u,"parseAttributePairs"),b(c,"parseServerFirstMessage"),b(h,"parseServerFinalMessage"),b(f,"xorBuffers"),b(d,"sha256"),b(p,"hmacSha256"),b(g,"Hi"),t.exports={startSession:n,continueSession:i,finalizeSession:s}}),eg={};function em(...e){return e.join("/")}w(eg,{join:()=>em});var ey=v(()=>{O(),b(em,"join")}),eb={};function ev(e,t){t(Error("No filesystem"))}w(eb,{stat:()=>ev});var e_=v(()=>{O(),b(ev,"stat")}),ew={};w(ew,{default:()=>eE});var eE,eS=v(()=>{O(),eE={}}),eR={};w(eR,{StringDecoder:()=>eA});var ex,eA,eT=v(()=>{O(),b(ex=class{constructor(e){x(this,"td"),this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this.td.decode(e)}},"StringDecoder"),eA=ex}),eP=_((e,t)=>{O();var{Transform:r}=(eS(),R(ew)),{StringDecoder:n}=(eT(),R(eR)),i=Symbol("last"),s=Symbol("decoder");function o(e,t,r){let n;if(this.overflow){if(1===(n=this[s].write(e).split(this.matcher)).length)return r();n.shift(),this.overflow=!1}else this[i]+=this[s].write(e),n=this[i].split(this.matcher);this[i]=n.pop();for(let e=0;e<n.length;e++)try{u(this,this.mapper(n[e]))}catch(e){return r(e)}if(this.overflow=this[i].length>this.maxLength,this.overflow&&!this.skipOverflow)return void r(Error("maximum buffer reached"));r()}function a(e){if(this[i]+=this[s].end(),this[i])try{u(this,this.mapper(this[i]))}catch(t){return e(t)}e()}function u(e,t){void 0!==t&&e.push(t)}function c(e){return e}function l(e,t,u){switch(e=e||/\r?\n/,t=t||c,u=u||{},arguments.length){case 1:"function"==typeof e?(t=e,e=/\r?\n/):"object"!=typeof e||e instanceof RegExp||e[Symbol.split]||(u=e,e=/\r?\n/);break;case 2:"function"==typeof e?(u=t,t=e,e=/\r?\n/):"object"==typeof t&&(u=t,t=c)}(u=Object.assign({},u)).autoDestroy=!0,u.transform=o,u.flush=a,u.readableObjectMode=!0;let l=new r(u);return l[i]="",l[s]=new n("utf8"),l.matcher=e,l.mapper=t,l.maxLength=u.maxLength,l.skipOverflow=u.skipOverflow||!1,l.overflow=!1,l._destroy=function(e,t){this._writableState.errorEmitted=!1,t(e)},l}b(o,"transform"),b(a,"flush"),b(u,"push"),b(c,"noop"),b(l,"split"),t.exports=l}),eO=_((e,t)=>{O();var r=(ey(),R(eg)),n=(eS(),R(ew)).Stream,i=eP(),s=(ed(),R(eh)),o="win32"===h.platform,a=h.stderr;function u(e){return(61440&e)==32768}b(u,"isRegFile");var c=["host","port","database","user","password"],l=c.length,f=c[l-1];function d(){if(a instanceof n&&!0===a.writable){var e=Array.prototype.slice.call(arguments).concat(`
30
+ `);a.write(s.format.apply(s,e))}}b(d,"warn"),Object.defineProperty(t.exports,"isWin",{get:b(function(){return o},"get"),set:b(function(e){o=e},"set")}),t.exports.warnTo=function(e){var t=a;return a=e,t},t.exports.getFileName=function(e){var t=e||h.env;return t.PGPASSFILE||(o?r.join(t.APPDATA||"./","postgresql","pgpass.conf"):r.join(t.HOME||"./",".pgpass"))},t.exports.usePgPass=function(e,t){return!Object.prototype.hasOwnProperty.call(h.env,"PGPASSWORD")&&(!!o||(t=t||"<unkn>",u(e.mode)?!(63&e.mode)||(d('WARNING: password file "%s" has group or world access; permissions should be u=rw (0600) or less',t),!1):(d('WARNING: password file "%s" is not a plain file',t),!1)))};var p=t.exports.match=function(e,t){return c.slice(0,-1).reduce(function(r,n,i){return 1==i&&Number(e[n]||5432)===Number(t[n])?r&&!0:r&&("*"===t[n]||t[n]===e[n])},!0)};t.exports.getPassword=function(e,t,r){var n,s=t.pipe(i());function o(t){var r=g(t);r&&m(r)&&p(e,r)&&(n=r[f],s.end())}b(o,"onLine");var a=b(function(){t.destroy(),r(n)},"onEnd"),u=b(function(e){t.destroy(),d("WARNING: error on reading file: %s",e),r(void 0)},"onErr");t.on("error",u),s.on("data",o).on("end",a).on("error",u)};var g=t.exports.parseLine=function(e){if(e.length<11||e.match(/^\s+#/))return null;for(var t="",r="",n=0,i=0,s={},o=b(function(t,r,n){var i=e.substring(r,n);Object.hasOwnProperty.call(h.env,"PGPASS_NO_DEESCAPE")||(i=i.replace(/\\([:\\])/g,"$1")),s[c[t]]=i},"addToObj"),a=0;a<e.length-1;a+=1){if(t=e.charAt(a+1),r=e.charAt(a),n==l-1){o(n,i);break}a>=0&&":"==t&&"\\"!==r&&(o(n,i,a+1),i=a+2,n+=1)}return s=Object.keys(s).length===l?s:null},m=t.exports.isValidEntry=function(e){for(var t={0:function(e){return e.length>0},1:function(e){return"*"===e||isFinite(e=Number(e))&&e>0&&e<0x20000000000000&&Math.floor(e)===e},2:function(e){return e.length>0},3:function(e){return e.length>0},4:function(e){return e.length>0}},r=0;r<c.length;r+=1)if(!(0,t[r])(e[c[r]]||""))return!1;return!0}}),eC=_((e,t)=>{O(),ey(),R(eg);var r=(e_(),R(eb)),n=eO();t.exports=function(e,t){var i=n.getFileName();r.stat(i,function(s,o){if(s||!n.usePgPass(o,i))return t(void 0);var a=r.createReadStream(i);n.getPassword(e,a,t)})},t.exports.warnTo=n.warnTo}),eI={};w(eI,{default:()=>eN});var eN,eL=v(()=>{O(),eN={}}),eM=_((e,t)=>{O();var r=(F(),R(j)),n=(e_(),R(eb));function i(e){if("/"===e.charAt(0)){var t=e.split(" ");return{host:t[0],database:t[1]}}var i=r.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(e)?encodeURI(e).replace(/\%25(\d\d)/g,"%$1"):e,!0),t=i.query;for(var s in t)Array.isArray(t[s])&&(t[s]=t[s][t[s].length-1]);var o=(i.auth||":").split(":");if(t.user=o[0],t.password=o.splice(1).join(":"),t.port=i.port,"socket:"==i.protocol)return t.host=decodeURI(i.pathname),t.database=i.query.db,t.client_encoding=i.query.encoding,t;t.host||(t.host=i.hostname);var a=i.pathname;if(!t.host&&a&&/^%2f/i.test(a)){var u=a.split("/");t.host=decodeURIComponent(u[0]),a=u.splice(1).join("/")}switch(a&&"/"===a.charAt(0)&&(a=a.slice(1)||null),t.database=a&&decodeURI(a),("true"===t.ssl||"1"===t.ssl)&&(t.ssl=!0),"0"===t.ssl&&(t.ssl=!1),(t.sslcert||t.sslkey||t.sslrootcert||t.sslmode)&&(t.ssl={}),t.sslcert&&(t.ssl.cert=n.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=n.readFileSync(t.sslkey).toString()),t.sslrootcert&&(t.ssl.ca=n.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}return t}b(i,"parse"),t.exports=i,i.parse=i}),eD=_((e,t)=>{O();var r=(eL(),R(eI)),n=ec(),i=eM().parse,s=b(function(e,t,r){return void 0===r?r=h.env["PG"+e.toUpperCase()]:!1===r||(r=h.env[r]),t[e]||r||n[e]},"val"),o=b(function(){switch(h.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 n.ssl},"readSSLConfigFromEnvironment"),a=b(function(e){return"'"+(""+e).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),u=b(function(e,t,r){var n=t[r];null!=n&&e.push(r+"="+a(n))},"add"),c=class{constructor(e){(e="string"==typeof e?i(e):e||{}).connectionString&&(e=Object.assign({},e,i(e.connectionString))),this.user=s("user",e),this.database=s("database",e),void 0===this.database&&(this.database=this.user),this.port=parseInt(s("port",e),10),this.host=s("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:s("password",e)}),this.binary=s("binary",e),this.options=s("options",e),this.ssl=typeof e.ssl>"u"?o():e.ssl,"string"==typeof this.ssl&&"true"===this.ssl&&(this.ssl=!0),"no-verify"===this.ssl&&(this.ssl={rejectUnauthorized:!1}),this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this.client_encoding=s("client_encoding",e),this.replication=s("replication",e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=s("application_name",e,"PGAPPNAME"),this.fallback_application_name=s("fallback_application_name",e,!1),this.statement_timeout=s("statement_timeout",e,!1),this.lock_timeout=s("lock_timeout",e,!1),this.idle_in_transaction_session_timeout=s("idle_in_transaction_session_timeout",e,!1),this.query_timeout=s("query_timeout",e,!1),void 0===e.connectionTimeoutMillis?this.connect_timeout=h.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/1e3),!1===e.keepAlive?this.keepalives=0:!0===e.keepAlive&&(this.keepalives=1),"number"==typeof e.keepAliveInitialDelayMillis&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){var t=[];u(t,this,"user"),u(t,this,"password"),u(t,this,"port"),u(t,this,"application_name"),u(t,this,"fallback_application_name"),u(t,this,"connect_timeout"),u(t,this,"options");var n="object"==typeof this.ssl?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(u(t,n,"sslmode"),u(t,n,"sslca"),u(t,n,"sslkey"),u(t,n,"sslcert"),u(t,n,"sslrootcert"),this.database&&t.push("dbname="+a(this.database)),this.replication&&t.push("replication="+a(this.replication)),this.host&&t.push("host="+a(this.host)),this.isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+a(this.client_encoding)),r.lookup(this.host,function(r,n){return r?e(r,null):(t.push("hostaddr="+a(n)),e(null,t.join(" ")))})}};b(c,"ConnectionParameters"),t.exports=c}),ek=_((e,t)=>{O();var r=K(),n=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,i=class{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="array"===e,this.rowAsArray&&(this.parseRow=this._parseRowAsArray)}addCommandComplete(e){var t;(t=e.text?n.exec(e.text):n.exec(e.command))&&(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=Array(e.length),r=0,n=e.length;r<n;r++){var i=e[r];null!==i?t[r]=this._parsers[r](i):t[r]=null}return t}parseRow(e){for(var t={},r=0,n=e.length;r<n;r++){var i=e[r],s=this.fields[r].name;null!==i?t[s]=this._parsers[r](i):t[s]=null}return t}addRow(e){this.rows.push(e)}addFields(e){this.fields=e,this.fields.length&&(this._parsers=Array(e.length));for(var t=0;t<e.length;t++){var n=e[t];this._types?this._parsers[t]=this._types.getTypeParser(n.dataTypeID,n.format||"text"):this._parsers[t]=r.getTypeParser(n.dataTypeID,n.format||"text")}}};b(i,"Result"),t.exports=i}),eB=_((e,t)=>{O();var{EventEmitter:r}=C(),n=ek(),i=el(),s=class extends r{constructor(e,t,r){super(),e=i.normalizeQueryConfig(e,t,r),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,h.domain&&e.callback&&(this.callback=h.domain.bind(e.callback)),this._result=new n(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError=!1,this._promise=null}requiresPreparation(){return!!this.name||!!this.rows||!!this.text&&!!this.values&&this.values.length>0}_checkForMultirow(){this._result.command&&(Array.isArray(this._results)||(this._results=[this._result]),this._result=new n(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(e){this._canceledDueToError=e;return}this.emit("row",t,this._result),this._accumulateRows&&this._result.addRow(t)}}handleCommandComplete(e,t){this._checkForMultirow(),this._result.addCommandComplete(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(e){h.nextTick(()=>{throw e})}this.emit("end",this._results)}submit(e){if("string"!=typeof this.text&&"string"!=typeof this.name)return 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?Error(`Prepared statements must be unique - '${this.name}\
31
+ ' was used for a different statement`):this.values&&!Array.isArray(this.values)?Error("Query values must be an array"):(this.requiresPreparation()?this.prepare(e):e.query(this.text),null)}hasBeenParsed(e){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:i.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){}};b(s,"Query"),t.exports=s}),ej=_(e=>{O(),Object.defineProperty(e,"__esModule",{value:!0}),e.NoticeMessage=e.DataRowMessage=e.CommandCompleteMessage=e.ReadyForQueryMessage=e.NotificationResponseMessage=e.BackendKeyDataMessage=e.AuthenticationMD5Password=e.ParameterStatusMessage=e.ParameterDescriptionMessage=e.RowDescriptionMessage=e.Field=e.CopyResponse=e.CopyDataMessage=e.DatabaseError=e.copyDone=e.emptyQuery=e.replicationStart=e.portalSuspended=e.noData=e.closeComplete=e.bindComplete=e.parseComplete=void 0,e.parseComplete={name:"parseComplete",length:5},e.bindComplete={name:"bindComplete",length:5},e.closeComplete={name:"closeComplete",length:5},e.noData={name:"noData",length:5},e.portalSuspended={name:"portalSuspended",length:5},e.replicationStart={name:"replicationStart",length:4},e.emptyQuery={name:"emptyQuery",length:4},e.copyDone={name:"copyDone",length:4};var t=class extends Error{constructor(e,t,r){super(e),this.length=t,this.name=r}};b(t,"DatabaseError"),e.DatabaseError=t;var r=class{constructor(e,t){this.length=e,this.chunk=t,this.name="copyData"}};b(r,"CopyDataMessage"),e.CopyDataMessage=r;var n=class{constructor(e,t,r,n){this.length=e,this.name=t,this.binary=r,this.columnTypes=Array(n)}};b(n,"CopyResponse"),e.CopyResponse=n;var i=class{constructor(e,t,r,n,i,s,o){this.name=e,this.tableID=t,this.columnID=r,this.dataTypeID=n,this.dataTypeSize=i,this.dataTypeModifier=s,this.format=o}};b(i,"Field"),e.Field=i;var s=class{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescription",this.fields=Array(this.fieldCount)}};b(s,"RowDescriptionMessage"),e.RowDescriptionMessage=s;var o=class{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescription",this.dataTypeIDs=Array(this.parameterCount)}};b(o,"ParameterDescriptionMessage"),e.ParameterDescriptionMessage=o;var a=class{constructor(e,t,r){this.length=e,this.parameterName=t,this.parameterValue=r,this.name="parameterStatus"}};b(a,"ParameterStatusMessage"),e.ParameterStatusMessage=a;var u=class{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}};b(u,"AuthenticationMD5Password"),e.AuthenticationMD5Password=u;var c=class{constructor(e,t,r){this.length=e,this.processID=t,this.secretKey=r,this.name="backendKeyData"}};b(c,"BackendKeyDataMessage"),e.BackendKeyDataMessage=c;var l=class{constructor(e,t,r,n){this.length=e,this.processId=t,this.channel=r,this.payload=n,this.name="notification"}};b(l,"NotificationResponseMessage"),e.NotificationResponseMessage=l;var h=class{constructor(e,t){this.length=e,this.status=t,this.name="readyForQuery"}};b(h,"ReadyForQueryMessage"),e.ReadyForQueryMessage=h;var f=class{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};b(f,"CommandCompleteMessage"),e.CommandCompleteMessage=f;var d=class{constructor(e,t){this.length=e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};b(d,"DataRowMessage"),e.DataRowMessage=d;var p=class{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};b(p,"NoticeMessage"),e.NoticeMessage=p}),eU=_(e=>{O(),Object.defineProperty(e,"__esModule",{value:!0}),e.Writer=void 0;var t=class{constructor(e=256){this.size=e,this.offset=5,this.headerPosition=0,this.buffer=l.allocUnsafe(e)}ensure(e){if(this.buffer.length-this.offset<e){let t=this.buffer,r=t.length+(t.length>>1)+e;this.buffer=l.allocUnsafe(r),t.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){let t=l.byteLength(e);this.ensure(t+1),this.buffer.write(e,this.offset,"utf-8"),this.offset+=t}else this.ensure(1);return this.buffer[this.offset++]=0,this}addString(e=""){let t=l.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(5*!e,this.offset)}flush(e){let t=this.join(e);return this.offset=5,this.headerPosition=0,this.buffer=l.allocUnsafe(this.size),t}};b(t,"Writer"),e.Writer=t}),eF=_(e=>{O(),Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=void 0;var t=eU(),r=new t.Writer,n=b(e=>{for(let t of(r.addInt16(3).addInt16(0),Object.keys(e)))r.addCString(t).addCString(e[t]);r.addCString("client_encoding").addCString("UTF8");let n=r.addCString("").flush(),i=n.length+4;return new t.Writer().addInt32(i).add(n).flush()},"startup"),i=b(()=>{let e=l.allocUnsafe(8);return e.writeInt32BE(8,0),e.writeInt32BE(0x4d2162f,4),e},"requestSsl"),s=b(e=>r.addCString(e).flush(112),"password"),o=b(function(e,t){return r.addCString(e).addInt32(l.byteLength(t)).addString(t),r.flush(112)},"sendSASLInitialResponseMessage"),a=b(function(e){return r.addString(e).flush(112)},"sendSCRAMClientFinalMessage"),u=b(e=>r.addCString(e).flush(81),"query"),c=[],h=b(e=>{let t=e.name||"";t.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",t,t.length),console.error("This can cause conflicts and silent errors executing queries"));let n=e.types||c,i=n.length,s=r.addCString(t).addCString(e.text).addInt16(i);for(let e=0;e<i;e++)s.addInt32(n[e]);return r.flush(80)},"parse"),f=new t.Writer,d=b(function(e,t){for(let n=0;n<e.length;n++){let i=t?t(e[n],n):e[n];null==i?(r.addInt16(0),f.addInt32(-1)):i instanceof l?(r.addInt16(1),f.addInt32(i.length),f.add(i)):(r.addInt16(0),f.addInt32(l.byteLength(i)),f.addString(i))}},"writeValues"),p=b((e={})=>{let t=e.portal||"",n=e.statement||"",i=e.binary||!1,s=e.values||c,o=s.length;return r.addCString(t).addCString(n),r.addInt16(o),d(s,e.valueMapper),r.addInt16(o),r.add(f.flush()),r.addInt16(+!!i),r.flush(66)},"bind"),g=l.from([69,0,0,0,9,0,0,0,0,0]),m=b(e=>{if(!e||!e.portal&&!e.rows)return g;let t=e.portal||"",r=e.rows||0,n=l.byteLength(t),i=4+n+1+4,s=l.allocUnsafe(1+i);return s[0]=69,s.writeInt32BE(i,1),s.write(t,5,"utf-8"),s[n+5]=0,s.writeUInt32BE(r,s.length-4),s},"execute"),y=b((e,t)=>{let r=l.allocUnsafe(16);return r.writeInt32BE(16,0),r.writeInt16BE(1234,4),r.writeInt16BE(5678,6),r.writeInt32BE(e,8),r.writeInt32BE(t,12),r},"cancel"),v=b((e,t)=>{let r=4+l.byteLength(t)+1,n=l.allocUnsafe(1+r);return n[0]=e,n.writeInt32BE(r,1),n.write(t,5,"utf-8"),n[r]=0,n},"cstringMessage"),_=r.addCString("P").flush(68),w=r.addCString("S").flush(68),E=b(e=>e.name?v(68,`${e.type}${e.name||""}`):"P"===e.type?_:w,"describe"),S=b(e=>v(67,`${e.type}${e.name||""}`),"close"),R=b(e=>r.add(e).flush(100),"copyData"),x=b(e=>v(102,e),"copyFail"),A=b(e=>l.from([e,0,0,0,4]),"codeOnlyBuffer"),T=A(72),P=A(83),C=A(88),I=A(99);e.serialize={startup:n,password:s,requestSsl:i,sendSASLInitialResponseMessage:o,sendSCRAMClientFinalMessage:a,query:u,parse:h,bind:p,execute:m,describe:E,close:S,flush:b(()=>T,"flush"),sync:b(()=>P,"sync"),end:b(()=>C,"end"),copyData:R,copyDone:b(()=>I,"copyDone"),copyFail:x,cancel:y}}),eq=_(e=>{O(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferReader=void 0;var t=l.allocUnsafe(0),r=class{constructor(e=0){this.offset=e,this.buffer=t,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(;0!==this.buffer[t++];);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}};b(r,"BufferReader"),e.BufferReader=r}),e$=_(e=>{O(),Object.defineProperty(e,"__esModule",{value:!0}),e.Parser=void 0;var t=ej(),r=eq(),n=l.allocUnsafe(0),i=class{constructor(e){if(this.buffer=n,this.bufferLength=0,this.bufferOffset=0,this.reader=new r.BufferReader,e?.mode==="binary")throw Error("Binary mode not supported yet");this.mode=e?.mode||"text"}parse(e,t){this.mergeBuffer(e);let r=this.bufferOffset+this.bufferLength,i=this.bufferOffset;for(;i+5<=r;){let e=this.buffer[i],n=this.buffer.readUInt32BE(i+1),s=1+n;if(s+i<=r)t(this.handlePacket(i+5,e,n,this.buffer)),i+=s;else break}i===r?(this.buffer=n,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=r-i,this.bufferOffset=i)}mergeBuffer(e){if(this.bufferLength>0){let t=this.bufferLength+e.byteLength;if(t+this.bufferOffset>this.buffer.byteLength){let e;if(t<=this.buffer.byteLength&&this.bufferOffset>=this.bufferLength)e=this.buffer;else{let r=2*this.buffer.byteLength;for(;t>=r;)r*=2;e=l.allocUnsafe(r)}this.buffer.copy(e,0,this.bufferOffset,this.bufferOffset+this.bufferLength),this.buffer=e,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,r,n,i){switch(r){case 50:return t.bindComplete;case 49:return t.parseComplete;case 51:return t.closeComplete;case 110:return t.noData;case 115:return t.portalSuspended;case 99:return t.copyDone;case 87:return t.replicationStart;case 73:return t.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,"error");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 t.DatabaseError("received invalid response: "+r.toString(16),n,"error")}}parseReadyForQueryMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.string(1);return new t.ReadyForQueryMessage(r,i)}parseCommandCompleteMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.cstring();return new t.CommandCompleteMessage(r,i)}parseCopyData(e,r,n){let i=n.slice(e,e+(r-4));return new t.CopyDataMessage(r,i)}parseCopyInMessage(e,t,r){return this.parseCopyMessage(e,t,r,"copyInResponse")}parseCopyOutMessage(e,t,r){return this.parseCopyMessage(e,t,r,"copyOutResponse")}parseCopyMessage(e,r,n,i){this.reader.setBuffer(e,n);let s=0!==this.reader.byte(),o=this.reader.int16(),a=new t.CopyResponse(r,i,s,o);for(let e=0;e<o;e++)a.columnTypes[e]=this.reader.int16();return a}parseNotificationMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s=this.reader.cstring(),o=this.reader.cstring();return new t.NotificationResponseMessage(r,i,s,o)}parseRowDescriptionMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=new t.RowDescriptionMessage(r,i);for(let e=0;e<i;e++)s.fields[e]=this.parseField();return s}parseField(){let e=this.reader.cstring(),r=this.reader.uint32(),n=this.reader.int16(),i=this.reader.uint32(),s=this.reader.int16(),o=this.reader.int32(),a=0===this.reader.int16()?"text":"binary";return new t.Field(e,r,n,i,s,o,a)}parseParameterDescriptionMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=new t.ParameterDescriptionMessage(r,i);for(let e=0;e<i;e++)s.dataTypeIDs[e]=this.reader.int32();return s}parseDataRowMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=Array(i);for(let e=0;e<i;e++){let t=this.reader.int32();s[e]=-1===t?null:this.reader.string(t)}return new t.DataRowMessage(r,s)}parseParameterStatusMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.cstring(),s=this.reader.cstring();return new t.ParameterStatusMessage(r,i,s)}parseBackendKeyData(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s=this.reader.int32();return new t.BackendKeyDataMessage(r,i,s)}parseAuthenticationResponse(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s={name:"authenticationOk",length:r};switch(i){case 0:break;case 3:8===s.length&&(s.name="authenticationCleartextPassword");break;case 5:if(12===s.length){s.name="authenticationMD5Password";let e=this.reader.bytes(4);return new t.AuthenticationMD5Password(r,e)}break;case 10:{let e;s.name="authenticationSASL",s.mechanisms=[];do(e=this.reader.cstring())&&s.mechanisms.push(e);while(e)}break;case 11:s.name="authenticationSASLContinue",s.data=this.reader.string(r-8);break;case 12:s.name="authenticationSASLFinal",s.data=this.reader.string(r-8);break;default:throw Error("Unknown authenticationOk message type "+i)}return s}parseErrorMessage(e,r,n,i){this.reader.setBuffer(e,n);let s={},o=this.reader.string(1);for(;"\0"!==o;)s[o]=this.reader.cstring(),o=this.reader.string(1);let a=s.M,u="notice"===i?new t.NoticeMessage(r,a):new t.DatabaseError(a,r,i);return u.severity=s.S,u.code=s.C,u.detail=s.D,u.hint=s.H,u.position=s.P,u.internalPosition=s.p,u.internalQuery=s.q,u.where=s.W,u.schema=s.s,u.table=s.t,u.column=s.c,u.dataType=s.d,u.constraint=s.n,u.file=s.F,u.line=s.L,u.routine=s.R,u}};b(i,"Parser"),e.Parser=i}),eG=_(e=>{O(),Object.defineProperty(e,"__esModule",{value:!0}),e.DatabaseError=e.serialize=e.parse=void 0;var t=ej();Object.defineProperty(e,"DatabaseError",{enumerable:!0,get:b(function(){return t.DatabaseError},"get")});var r=eF();Object.defineProperty(e,"serialize",{enumerable:!0,get:b(function(){return r.serialize},"get")});var n=e$();function i(e,t){let r=new n.Parser;return e.on("data",e=>r.parse(e,t)),new Promise(t=>e.on("end",()=>t()))}b(i,"parse"),e.parse=i}),eH={};function eV({socket:e,servername:t}){return e.startTls(t),e}w(eH,{connect:()=>eV});var eW=v(()=>{O(),b(eV,"connect")}),eQ=_((e,t)=>{O();var r=(B(),R(I)),n=C().EventEmitter,{parse:i,serialize:s}=eG(),o=s.flush(),a=s.sync(),u=s.end(),c=class extends n{constructor(e){super(),e=e||{},this.stream=e.stream||new r.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(e){"message"===e&&(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(){n._keepAlive&&n.stream.setKeepAlive(!0,n._keepAliveInitialDelayMillis),n.emit("connect")});let i=b(function(e){n._ending&&("ECONNRESET"===e.code||"EPIPE"===e.code)||n.emit("error",e)},"reportStreamError");if(this.stream.on("error",i),this.stream.on("close",function(){n.emit("end")}),!this.ssl)return this.attachListeners(this.stream);this.stream.once("data",function(e){switch(e.toString("utf8")){case"S":break;case"N":return n.stream.end(),n.emit("error",Error("The server does not support SSL connections"));default:return n.stream.end(),n.emit("error",Error("There was an error establishing an SSL connection"))}var s=(eW(),R(eH));let o={socket:n.stream};!0!==n.ssl&&(Object.assign(o,n.ssl),"key"in n.ssl&&(o.key=n.ssl.key)),0===r.isIP(t)&&(o.servername=t);try{n.stream=s.connect(o)}catch(e){return n.emit("error",e)}n.attachListeners(n.stream),n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){e.on("end",()=>{this.emit("end")}),i(e,e=>{var t="error"===e.name?"errorMessage":e.name;this._emitMessage&&this.emit("message",e),this.emit(t,e)})}requestSsl(){this.stream.write(s.requestSsl())}startup(e){this.stream.write(s.startup(e))}cancel(e,t){this._send(s.cancel(e,t))}password(e){this._send(s.password(e))}sendSASLInitialResponseMessage(e,t){this._send(s.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(s.sendSCRAMClientFinalMessage(e))}_send(e){return!!this.stream.writable&&this.stream.write(e)}query(e){this._send(s.query(e))}parse(e){this._send(s.parse(e))}bind(e){this._send(s.bind(e))}execute(e){this._send(s.execute(e))}flush(){this.stream.writable&&this.stream.write(o)}sync(){this._ending=!0,this._send(o),this._send(a)}ref(){this.stream.ref()}unref(){this.stream.unref()}end(){return(this._ending=!0,this._connecting&&this.stream.writable)?this.stream.write(u,()=>{this.stream.end()}):void this.stream.end()}close(e){this._send(s.close(e))}describe(e){this._send(s.describe(e))}sendCopyFromChunk(e){this._send(s.copyData(e))}endCopyFrom(){this._send(s.copyDone())}sendCopyFail(e){this._send(s.copyFail(e))}};b(c,"Connection"),t.exports=c}),eY=_((e,t)=>{O();var r=C().EventEmitter,n=(ed(),R(eh),el()),i=ep(),s=eC(),o=J(),a=eD(),c=eB(),l=ec(),f=eQ(),d=class extends r{constructor(e){super(),this.connectionParameters=new a(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||u.Promise,this._types=new o(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||l.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=b(t=>{h.nextTick(()=>{t.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,r=this.connection;if(this._connectionCallback=e,this._connecting||this._connected){let t=Error("Client has already been connected. You cannot reuse a client.");h.nextTick(()=>{e(t)});return}this._connecting=!0,this.connectionTimeoutHandle,this._connectionTimeoutMillis>0&&(this.connectionTimeoutHandle=setTimeout(()=>{r._ending=!0,r.stream.destroy(Error("timeout expired"))},this._connectionTimeoutMillis)),this.host&&0===this.host.indexOf("/")?r.connect(this.host+"/.s.PGSQL."+this.port):r.connect(this.port,this.host),r.on("connect",function(){t.ssl?r.requestSsl():r.startup(t.getStartupConf())}),r.on("sslconnect",function(){r.startup(t.getStartupConf())}),this._attachListeners(r),r.once("end",()=>{let e=this._ending?Error("Connection terminated"):Error("Connection terminated unexpectedly");clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(e),this._ending||(this._connecting&&!this._connectionError?this._connectionCallback?this._connectionCallback(e):this._handleErrorEvent(e):this._connectionError||this._handleErrorEvent(e)),h.nextTick(()=>{this.emit("end")})})}connect(e){return e?void this._connect(e):new this._Promise((e,t)=>{this._connect(r=>{r?t(r):e()})})}_attachListeners(e){e.on("authenticationCleartextPassword",this._handleAuthCleartextPassword.bind(this)),e.on("authenticationMD5Password",this._handleAuthMD5Password.bind(this)),e.on("authenticationSASL",this._handleAuthSASL.bind(this)),e.on("authenticationSASLContinue",this._handleAuthSASLContinue.bind(this)),e.on("authenticationSASLFinal",this._handleAuthSASLFinal.bind(this)),e.on("backendKeyData",this._handleBackendKeyData.bind(this)),e.on("error",this._handleErrorEvent.bind(this)),e.on("errorMessage",this._handleErrorMessage.bind(this)),e.on("readyForQuery",this._handleReadyForQuery.bind(this)),e.on("notice",this._handleNotice.bind(this)),e.on("rowDescription",this._handleRowDescription.bind(this)),e.on("dataRow",this._handleDataRow.bind(this)),e.on("portalSuspended",this._handlePortalSuspended.bind(this)),e.on("emptyQuery",this._handleEmptyQuery.bind(this)),e.on("commandComplete",this._handleCommandComplete.bind(this)),e.on("parseComplete",this._handleParseComplete.bind(this)),e.on("copyInResponse",this._handleCopyInResponse.bind(this)),e.on("copyData",this._handleCopyData.bind(this)),e.on("notification",this._handleNotification.bind(this))}_checkPgPass(e){let t=this.connection;"function"==typeof this.password?this._Promise.resolve().then(()=>this.password()).then(r=>{if(void 0!==r){if("string"!=typeof r)return void t.emit("error",TypeError("Password must be a string"));this.connectionParameters.password=this.password=r}else this.connectionParameters.password=this.password=null;e()}).catch(e=>{t.emit("error",e)}):null!==this.password?e():s(this.connectionParameters,t=>{void 0!==t&&(this.connectionParameters.password=this.password=t),e()})}_handleAuthCleartextPassword(e){this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){this._checkPgPass(()=>{let t=n.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){this._checkPgPass(()=>{this.saslSession=i.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){i.continueSession(this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}_handleAuthSASLFinal(e){i.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;this.activeQuery=null,this.readyForQuery=!0,t&&t.handleReadyForQuery(this.connection),this._pulseQueryQueue()}_handleErrorWhileConnecting(e){if(!this._connectionError){if(this._connectionError=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback)return this._connectionCallback(e);this.emit("error",e)}}_handleErrorEvent(e){if(this._connecting)return this._handleErrorWhileConnecting(e);this._queryable=!1,this._errorAllQueries(e),this.emit("error",e)}_handleErrorMessage(e){if(this._connecting)return this._handleErrorWhileConnecting(e);let t=this.activeQuery;if(!t)return void this._handleErrorEvent(e);this.activeQuery=null,t.handleError(e,this.connection)}_handleRowDescription(e){this.activeQuery.handleRowDescription(e)}_handleDataRow(e){this.activeQuery.handleDataRow(e)}_handlePortalSuspended(e){this.activeQuery.handlePortalSuspended(this.connection)}_handleEmptyQuery(e){this.activeQuery.handleEmptyQuery(this.connection)}_handleCommandComplete(e){this.activeQuery.handleCommandComplete(e,this.connection)}_handleParseComplete(e){this.activeQuery.name&&(this.connection.parsedStatements[this.activeQuery.name]=this.activeQuery.text)}_handleCopyInResponse(e){this.activeQuery.handleCopyInResponse(this.connection)}_handleCopyData(e){this.activeQuery.handleCopyData(e,this.connection)}_handleNotification(e){this.emit("notification",e)}_handleNotice(e){this.emit("notice",e)}getStartupConf(){var e=this.connectionParameters,t={user:e.user,database:e.database},r=e.application_name||e.fallback_application_name;return r&&(t.application_name=r),e.replication&&(t.replication=""+e.replication),e.statement_timeout&&(t.statement_timeout=String(parseInt(e.statement_timeout,10))),e.lock_timeout&&(t.lock_timeout=String(parseInt(e.lock_timeout,10))),e.idle_in_transaction_session_timeout&&(t.idle_in_transaction_session_timeout=String(parseInt(e.idle_in_transaction_session_timeout,10))),e.options&&(t.options=e.options),t}cancel(e,t){if(e.activeQuery===t){var r=this.connection;this.host&&0===this.host.indexOf("/")?r.connect(this.host+"/.s.PGSQL."+this.port):r.connect(this.port,this.host),r.on("connect",function(){r.cancel(e.processID,e.secretKey)})}else -1!==e.queryQueue.indexOf(t)&&e.queryQueue.splice(e.queryQueue.indexOf(t),1)}setTypeParser(e,t,r){return this._types.setTypeParser(e,t,r)}getTypeParser(e,t){return this._types.getTypeParser(e,t)}escapeIdentifier(e){return'"'+e.replace(/"/g,'""')+'"'}escapeLiteral(e){for(var t=!1,r="'",n=0;n<e.length;n++){var i=e[n];"'"===i?r+=i+i:"\\"===i?(r+=i+i,t=!0):r+=i}return r+="'",!0===t&&(r=" E"+r),r}_pulseQueryQueue(){if(!0===this.readyForQuery)if(this.activeQuery=this.queryQueue.shift(),this.activeQuery){this.readyForQuery=!1,this.hasExecuted=!0;let e=this.activeQuery.submit(this.connection);e&&h.nextTick(()=>{this.activeQuery.handleError(e,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&&(this.activeQuery=null,this.emit("drain"))}query(e,t,r){var n,i,s,o,a;if(null==e)throw TypeError("Client was passed a null or undefined query");return"function"==typeof e.submit?(s=e.query_timeout||this.connectionParameters.query_timeout,i=n=e,"function"==typeof t&&(n.callback=n.callback||t)):(s=this.connectionParameters.query_timeout,(n=new c(e,t,r)).callback||(i=new this._Promise((e,t)=>{n.callback=(r,n)=>r?t(r):e(n)}))),s&&(a=n.callback,o=setTimeout(()=>{var e=Error("Query read timeout");h.nextTick(()=>{n.handleError(e,this.connection)}),a(e),n.callback=()=>{};var t=this.queryQueue.indexOf(n);t>-1&&this.queryQueue.splice(t,1),this._pulseQueryQueue()},s),n.callback=(e,t)=>{clearTimeout(o),a(e,t)}),this.binary&&!n.binary&&(n.binary=!0),n._result&&!n._result._types&&(n._result._types=this._types),this._queryable?this._ending?h.nextTick(()=>{n.handleError(Error("Client was closed and is not queryable"),this.connection)}):(this.queryQueue.push(n),this._pulseQueryQueue()):h.nextTick(()=>{n.handleError(Error("Client has encountered a connection error and is not queryable"),this.connection)}),i}ref(){this.connection.ref()}unref(){this.connection.unref()}end(e){if(this._ending=!0,!this.connection._connecting)if(!e)return this._Promise.resolve();else e();if(this.activeQuery||!this._queryable?this.connection.stream.destroy():this.connection.end(),!e)return new this._Promise(e=>{this.connection.once("end",e)});this.connection.once("end",e)}};b(d,"Client"),d.Query=c,t.exports=d}),eX=_((e,t)=>{O();var r=C().EventEmitter,n=b(function(){},"NOOP"),i=b((e,t)=>{let r=e.findIndex(t);return -1===r?void 0:e.splice(r,1)[0]},"removeWhere"),s=class{constructor(e,t,r){this.client=e,this.idleListener=t,this.timeoutId=r}};b(s,"IdleItem");var o=class{constructor(e){this.callback=e}};function a(){throw Error("Release called on client which has already been released to the pool.")}function l(e,t){let r,n;return t?{callback:t,result:void 0}:{callback:b(function(e,t){e?r(e):n(t)},"cb"),result:new e(function(e,t){n=e,r=t}).catch(e=>{throw Error.captureStackTrace(e),e})}}function f(e,t){return b(function r(n){n.client=t,t.removeListener("error",r),t.on("error",()=>{e.log("additional client error after disconnection due to error",n)}),e._remove(t),e.emit("error",n,t)},"idleListener")}b(o,"PendingItem"),b(a,"throwOnDoubleRelease"),b(l,"promisify"),b(f,"makeIdleListener");var d=class extends r{constructor(e,t){super(),this.options=Object.assign({},e),null!=e&&"password"in e&&Object.defineProperty(this.options,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}),null!=e&&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||e6().Client,this.Promise=this.options.Promise||u.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)return void this.log("pulse queue ended");if(this.ending){this.log("pulse queue on ending"),this._idle.length&&this._idle.slice().map(e=>{this._remove(e.client)}),this._clients.length||(this.ended=!0,this._endCallback());return}if(!this._pendingQueue.length)return void this.log("no queued requests");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 r=t.client;r.ref&&r.ref();let n=t.idleListener;return this._acquireClient(r,e,n,!1)}if(!this._isFull())return this.newClient(e);throw Error("unexpected condition")}_remove(e){let t=i(this._idle,t=>t.client===e);void 0!==t&&clearTimeout(t.timeoutId),this._clients=this._clients.filter(t=>t!==e),e.end(),this.emit("remove",e)}connect(e){if(this.ending){let t=Error("Cannot use a pool after calling end on the pool");return e?e(t):this.Promise.reject(t)}let t=l(this.Promise,e),r=t.result;if(this._isFull()||this._idle.length){if(this._idle.length&&h.nextTick(()=>this._pulseQueue()),!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new o(t.callback)),r;let e=b((e,r,n)=>{clearTimeout(s),t.callback(e,r,n)},"queueCallback"),n=new o(e),s=setTimeout(()=>{i(this._pendingQueue,t=>t.callback===e),n.timedOut=!0,t.callback(Error("timeout exceeded when trying to connect"))},this.options.connectionTimeoutMillis);return s.unref&&s.unref(),this._pendingQueue.push(n),r}return this.newClient(new o(t.callback)),r}newClient(e){let t=new this.Client(this.options);this._clients.push(t);let r=f(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(a=>{if(i&&clearTimeout(i),t.on("error",r),a)this.log("client failed to connect",a),this._clients=this._clients.filter(e=>e!==t),s&&(a=Error("Connection terminated due to connection timeout",{cause:a})),this._pulseQueue(),e.timedOut||e.callback(a,void 0,n);else{if(this.log("new client connected"),0!==this.options.maxLifetimeSeconds){let e=setTimeout(()=>{this.log("ending client due to expired lifetime"),this._expired.add(t),-1!==this._idle.findIndex(e=>e.client===t)&&this._acquireClient(t,new o((e,t,r)=>r()),r,!1)},1e3*this.options.maxLifetimeSeconds);e.unref(),t.once("end",()=>clearTimeout(e))}return this._acquireClient(t,e,r,!0)}})}_acquireClient(e,t,r,i){i&&this.emit("connect",e),this.emit("acquire",e),e.release=this._releaseOnce(e,r),e.removeListener("error",r),t.timedOut?i&&this.options.verify?this.options.verify(e,e.release):e.release():i&&this.options.verify?this.options.verify(e,r=>{if(r)return e.release(r),t.callback(r,void 0,n);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){let r=!1;return n=>{r&&a(),r=!0,this._release(e,t,n)}}_release(e,t,r){let n;if(e.on("error",t),e._poolUseCount=(e._poolUseCount||0)+1,this.emit("release",r,e),r||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}this.options.idleTimeoutMillis&&this._isAboveMin()&&(n=setTimeout(()=>{this.log("remove idle client"),this._remove(e)},this.options.idleTimeoutMillis),this.options.allowExitOnIdle&&n.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new s(e,t,n)),this._pulseQueue()}query(e,t,r){if("function"==typeof e){let t=l(this.Promise,e);return c(function(){return t.callback(Error("Passing a function as the first parameter to pool.query is not supported"))}),t.result}"function"==typeof t&&(r=t,t=void 0);let n=l(this.Promise,r);return r=n.callback,this.connect((n,i)=>{if(n)return r(n);let s=!1,o=b(e=>{s||(s=!0,i.release(e),r(e))},"onError");i.once("error",o),this.log("dispatching query");try{i.query(e,t,(e,t)=>{if(this.log("query dispatched"),i.removeListener("error",o),!s)return s=!0,i.release(e),e?r(e):r(void 0,t)})}catch(e){return i.release(e),r(e)}}),n.result}end(e){if(this.log("ending"),this.ending){let t=Error("Called end on pool more than once");return e?e(t):this.Promise.reject(t)}this.ending=!0;let t=l(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),0)}get totalCount(){return this._clients.length}};b(d,"Pool"),t.exports=d}),ez={};w(ez,{default:()=>eK});var eK,eJ=v(()=>{O(),eK={}}),eZ=_((e,t)=>{t.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javascript & 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 <brian.m.carlson@gmail.com>",main:"./lib",dependencies:{"buffer-writer":"2.0.0","packet-reader":"1.0.0","pg-connection-string":"^2.5.0","pg-pool":"^3.5.2","pg-protocol":"^1.5.0","pg-types":"^2.1.0",pgpass:"1.x"},devDependencies:{async:"2.6.4",bluebird:"3.5.2",co:"4.6.0","pg-copy-streams":"0.3.0"},peerDependencies:{"pg-native":">=3.0.1"},peerDependenciesMeta:{"pg-native":{optional:!0}},scripts:{test:"make test-all"},files:["lib","SPONSORS.md"],license:"MIT",engines:{node:">= 8.0.0"},gitHead:"c99fb2c127ddf8d712500db2c7b9a5491a178655"}}),e0=_((e,t)=>{O();var r=C().EventEmitter,n=(ed(),R(eh)),i=el(),s=t.exports=function(e,t,n){r.call(this),e=i.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this.name=e.name,this.callback=e.callback,this.state="new",this._arrayMode="array"===e.rowMode,this._emitRowEvents=!1,this.on("newListener",(function(e){"row"===e&&(this._emitRowEvents=!0)}).bind(this))};n.inherits(s,r);var o={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"file",sourceLine:"line",sourceFunction:"routine"};s.prototype.handleError=function(e){var t=this.native.pq.resultErrorFields();if(t)for(var r in t)e[o[r]||r]=t[r];this.callback?this.callback(e):this.emit("error",e),this.state="error"},s.prototype.then=function(e,t){return this._getPromise().then(e,t)},s.prototype.catch=function(e){return this._getPromise().catch(e)},s.prototype._getPromise=function(){return this._promise||(this._promise=new Promise((function(e,t){this._once("end",e),this._once("error",t)}).bind(this))),this._promise},s.prototype.submit=function(e){this.state="running";var t=this;this.native=e.native,e.native.arrayMode=this._arrayMode;var r=b(function(r,n,i){if(e.native.arrayMode=!1,c(function(){t.emit("_done")}),r)return t.handleError(r);t._emitRowEvents&&(i.length>1?n.forEach((e,r)=>{e.forEach(e=>{t.emit("row",e,i[r])})}):n.forEach(function(e){t.emit("row",e,i)})),t.state="end",t.emit("end",i),t.callback&&t.callback(null,i)},"after");if(h.domain&&(r=h.domain.bind(r)),this.name){this.name.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",this.name,this.name.length),console.error("This can cause conflicts and silent errors executing queries"));var n=(this.values||[]).map(i.prepareValue);if(e.namedQueries[this.name]){if(this.text&&e.namedQueries[this.name]!==this.text){let e=Error(`Prepa\
32
+ red statements must be unique - '${this.name}' was used for a different statement`);return r(e)}return e.native.execute(this.name,n,r)}return e.native.prepare(this.name,this.text,n.length,function(i){return i?r(i):(e.namedQueries[t.name]=t.text,t.native.execute(t.name,n,r))})}if(this.values){if(!Array.isArray(this.values)){let e=Error("Query values must be an array");return r(e)}var s=this.values.map(i.prepareValue);e.native.query(this.text,s,r)}else e.native.query(this.text,r)}}),e1=_((e,t)=>{O();var r=(eJ(),R(ez)),n=J(),i=(eZ(),C().EventEmitter),s=(ed(),R(eh)),o=eD(),a=e0(),c=t.exports=function(e){i.call(this),e=e||{},this._Promise=e.Promise||u.Promise,this._types=new n(e.types),this.native=new r({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting=!1,this._connected=!1,this._queryable=!0;var t=this.connectionParameters=new o(e);this.user=t.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:t.password}),this.database=t.database,this.host=t.host,this.port=t.port,this.namedQueries={}};c.Query=a,s.inherits(c,i),c.prototype._errorAllQueries=function(e){let t=b(t=>{h.nextTick(()=>{t.native=this.native,t.handleError(e)})},"enqueueError");this._hasActiveQuery()&&(t(this._activeQuery),this._activeQuery=null),this._queryQueue.forEach(t),this._queryQueue.length=0},c.prototype._connect=function(e){var t=this;if(this._connecting)return void h.nextTick(()=>e(Error("Client has already been connected. You cannot reuse a client.")));this._connecting=!0,this.connectionParameters.getLibpqConnectionString(function(r,n){if(r)return e(r);t.native.connect(n,function(r){if(r)return t.native.end(),e(r);t._connected=!0,t.native.on("error",function(e){t._queryable=!1,t._errorAllQueries(e),t.emit("error",e)}),t.native.on("notification",function(e){t.emit("notification",{channel:e.relname,payload:e.extra})}),t.emit("connect"),t._pulseQueryQueue(!0),e()})})},c.prototype.connect=function(e){return e?void this._connect(e):new this._Promise((e,t)=>{this._connect(r=>{r?t(r):e()})})},c.prototype.query=function(e,t,r){var n,i,s,o,u;if(null==e)throw TypeError("Client was passed a null or undefined query");if("function"==typeof e.submit)s=e.query_timeout||this.connectionParameters.query_timeout,i=n=e,"function"==typeof t&&(e.callback=t);else if(s=this.connectionParameters.query_timeout,!(n=new a(e,t,r)).callback){let e,t;i=new this._Promise((r,n)=>{e=r,t=n}),n.callback=(r,n)=>r?t(r):e(n)}return s&&(u=n.callback,o=setTimeout(()=>{var e=Error("Query read timeout");h.nextTick(()=>{n.handleError(e,this.connection)}),u(e),n.callback=()=>{};var t=this._queryQueue.indexOf(n);t>-1&&this._queryQueue.splice(t,1),this._pulseQueryQueue()},s),n.callback=(e,t)=>{clearTimeout(o),u(e,t)}),this._queryable?this._ending?(n.native=this.native,h.nextTick(()=>{n.handleError(Error("Client was closed and is not queryable"))})):(this._queryQueue.push(n),this._pulseQueryQueue()):(n.native=this.native,h.nextTick(()=>{n.handleError(Error("Client has encountered a connection error and is not queryable"))})),i},c.prototype.end=function(e){var t,r=this;return this._ending=!0,this._connected||this.once("connect",this.end.bind(this,e)),e||(t=new this._Promise(function(t,r){e=b(e=>e?r(e):t(),"cb")})),this.native.end(function(){r._errorAllQueries(Error("Connection terminated")),h.nextTick(()=>{r.emit("end"),e&&e()})}),t},c.prototype._hasActiveQuery=function(){return this._activeQuery&&"error"!==this._activeQuery.state&&"end"!==this._activeQuery.state},c.prototype._pulseQueryQueue=function(e){if(this._connected&&!this._hasActiveQuery()){var t=this._queryQueue.shift();if(!t){e||this.emit("drain");return}this._activeQuery=t,t.submit(this);var r=this;t.once("_done",function(){r._pulseQueryQueue()})}},c.prototype.cancel=function(e){this._activeQuery===e?this.native.cancel(function(){}):-1!==this._queryQueue.indexOf(e)&&this._queryQueue.splice(this._queryQueue.indexOf(e),1)},c.prototype.ref=function(){},c.prototype.unref=function(){},c.prototype.setTypeParser=function(e,t,r){return this._types.setTypeParser(e,t,r)},c.prototype.getTypeParser=function(e,t){return this._types.getTypeParser(e,t)}}),e2=_((e,t)=>{O(),t.exports=e1()}),e6=_((e,t)=>{O();var r=eY(),n=ec(),i=eQ(),s=eX(),{DatabaseError:o}=eG(),a=b(e=>{var t;return b(t=class extends s{constructor(t){super(t,e)}},"BoundPool"),t},"poolFactory"),u=b(function(e){this.defaults=n,this.Client=e,this.Query=this.Client.Query,this.Pool=a(this.Client),this._pools=[],this.Connection=i,this.types=K(),this.DatabaseError=o},"PG");"u">typeof h.env.NODE_PG_FORCE_NATIVE?t.exports=new u(e2()):(t.exports=new u(r),Object.defineProperty(t.exports,"native",{configurable:!0,enumerable:!1,get(){var e=null;try{e=new u(e2())}catch(e){if("MODULE_NOT_FOUND"!==e.code)throw e}return Object.defineProperty(t.exports,"native",{value:e}),e}}))});O(),O(),B(),F(),O();var e3=Object.defineProperty,e5=Object.defineProperties,e4=Object.getOwnPropertyDescriptors,e8=Object.getOwnPropertySymbols,e9=Object.prototype.hasOwnProperty,e7=Object.prototype.propertyIsEnumerable,te=b((e,t,r)=>t in e?e3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),tt=b((e,t)=>{for(var r in t||(t={}))e9.call(t,r)&&te(e,r,t[r]);if(e8)for(var r of e8(t))e7.call(t,r)&&te(e,r,t[r]);return e},"__spreadValues"),tr=b((e,t)=>e5(e,e4(t)),"__spreadProps"),tn=2===new Uint8Array(new Uint16Array([258]).buffer)[0],ti=new TextDecoder,ts=new TextEncoder,to=ts.encode("0123456789abcdef"),ta=ts.encode("0123456789ABCDEF"),tu=ts.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").slice();function tc(e,{alphabet:t,scratchArr:i}={}){if(!r)if(r=new Uint16Array(256),n=new Uint16Array(256),tn)for(let e=0;e<256;e++)r[e]=to[15&e]<<8|to[e>>>4],n[e]=ta[15&e]<<8|ta[e>>>4];else for(let e=0;e<256;e++)r[e]=to[15&e]|to[e>>>4]<<8,n[e]=ta[15&e]|ta[e>>>4]<<8;e.byteOffset%4!=0&&(e=new Uint8Array(e));let s=e.length,o=s>>>2,a=i||new Uint16Array(s),u=new Uint32Array(e.buffer,e.byteOffset,o),c=new Uint32Array(a.buffer,a.byteOffset,s>>>1),l="upper"===t?n:r,h=0,f=0,d;if(tn)for(;h<o;)d=u[h++],c[f++]=l[d>>>8&255]<<16|l[255&d],c[f++]=l[d>>>24]<<16|l[d>>>16&255];else for(;h<o;)d=u[h++],c[f++]=l[d>>>24]<<16|l[d>>>16&255],c[f++]=l[d>>>8&255]<<16|l[255&d];for(h<<=2;h<s;)a[h]=l[e[h++]];return ti.decode(a.subarray(0,s))}function tl(e,t={}){let r="",n=e.length,i=Math.ceil(n/504e3),s=new Uint16Array(i>1?504e3:n);for(let n=0;n<i;n++){let i=504e3*n,o=i+504e3;r+=tc(e.subarray(i,o),tr(tt({},t),{scratchArr:s}))}return r}function th(e,t={}){return"upper"!==t.alphabet&&"function"==typeof e.toHex?e.toHex():tl(e,t)}tu[62]=45,tu[63]=95,b(tc,"_toHex"),b(tl,"_toHexChunked"),b(th,"toHex"),O();var tf=class e{constructor(e,t){this.strings=e,this.values=t}toParameterizedQuery(t={query:"",params:[]}){let{strings:r,values:n}=this;for(let i=0,s=r.length;i<s;i++)if(t.query+=r[i],i<n.length){let r=n[i];if(r instanceof tp)t.query+=r.sql;else if(r instanceof tx)if(r.queryData instanceof e)r.queryData.toParameterizedQuery(t);else{if(r.queryData.params?.length)throw Error("This query is not composable");t.query+=r.queryData.query}else{let{params:e}=t;e.push(r),t.query+="$"+e.length,(r instanceof l||ArrayBuffer.isView(r))&&(t.query+="::bytea")}}return t}};b(tf,"SqlTemplate");var td=class{constructor(e){this.sql=e}};b(td,"UnsafeRawSql");var tp=td;function tg(){}O(),b(tg,"warnIfBrowser"),B();var tm=S(J()),ty=S(el()),tb=class e extends Error{constructor(t){super(t),x(this,"name","NeonDbError"),x(this,"severity"),x(this,"code"),x(this,"detail"),x(this,"hint"),x(this,"position"),x(this,"internalPosition"),x(this,"internalQuery"),x(this,"where"),x(this,"schema"),x(this,"table"),x(this,"column"),x(this,"dataType"),x(this,"constraint"),x(this,"file"),x(this,"line"),x(this,"routine"),x(this,"sourceError"),"captureStackTrace"in Error&&"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}};b(tb,"NeonDbError");var tv="transaction() expects an array of queries, or a function returning an array of queries",t_=["severity","code","detail","hint","position","internalPosition","internalQuery","where","schema","table","column","dataType","constraint","file","line","routine"];function tw(e){return e instanceof l?"\\x"+th(e):e}function tE(e){let{query:t,params:r}=e instanceof tf?e.toParameterizedQuery():e;return{query:t,params:r.map(e=>tw((0,ty.prepareValue)(e)))}}function tS(e,{arrayMode:t,fullResults:r,fetchOptions:n,isolationLevel:i,readOnly:s,deferrable:o,authToken:a,disableWarningInBrowsers:u}={}){let c;if(!e)throw Error("No database connection string was provided to `neon()`. Perhaps an environment variable has not been set?");try{c=U(e)}catch{throw Error("Database connection string provided to `neon()` is not a valid URL. Connection string: "+String(e))}let{protocol:l,username:h,hostname:f,port:d,pathname:p}=c;if("postgres:"!==l&&"postgresql:"!==l||!h||!f||!p)throw Error("Database connection string format for `neon()` should be: postgresql://user:password@host.tld/dbname?option=value");function g(e,...t){if(!(Array.isArray(e)&&Array.isArray(e.raw)&&Array.isArray(t)))throw Error('This function can now 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("SELECT $1", [value], options).');return new tx(m,new tf(e,t))}async function m(c,l,h){let p,{fetchEndpoint:g,fetchFunction:m}=k,y=Array.isArray(c)?{queries:c.map(e=>tE(e))}:tE(c),b=n??{},v=t??!1,_=r??!1,w=i,E=s,S=o;void 0!==h&&(void 0!==h.fetchOptions&&(b={...b,...h.fetchOptions}),void 0!==h.arrayMode&&(v=h.arrayMode),void 0!==h.fullResults&&(_=h.fullResults),void 0!==h.isolationLevel&&(w=h.isolationLevel),void 0!==h.readOnly&&(E=h.readOnly),void 0!==h.deferrable&&(S=h.deferrable)),void 0===l||Array.isArray(l)||void 0===l.fetchOptions||(b={...b,...l.fetchOptions});let R=a;Array.isArray(l)||l?.authToken===void 0||(R=l.authToken);let x="function"==typeof g?g(f,d,{jwtAuth:void 0!==R}):g,A={"Neon-Connection-String":e,"Neon-Raw-Text-Output":"true","Neon-Array-Mode":"true"},T=await tT(R);T&&(A.Authorization=`Bearer ${T}`),Array.isArray(c)&&(void 0!==w&&(A["Neon-Batch-Isolation-Level"]=w),void 0!==E&&(A["Neon-Batch-Read-Only"]=String(E)),void 0!==S&&(A["Neon-Batch-Deferrable"]=String(S))),u||k.disableWarningInBrowsers||tg();try{p=await (m??fetch)(x,{method:"POST",body:JSON.stringify(y),headers:A,...b})}catch(t){let e=new tb(`Error connecting to database: ${t}`);throw e.sourceError=t,e}if(p.ok){let e=await p.json();if(Array.isArray(c)){let t=e.results;if(!Array.isArray(t))throw new tb("Neon internal error: unexpected result format");return t.map((e,t)=>{let r=l[t]??{};return tA(e,{arrayMode:r.arrayMode??v,fullResults:r.fullResults??_,types:r.types})})}{let t=l??{};return tA(e,{arrayMode:t.arrayMode??v,fullResults:t.fullResults??_,types:t.types})}}{let{status:e}=p;if(400===e){let e=await p.json(),t=new tb(e.message);for(let r of t_)t[r]=e[r]??void 0;throw t}{let t=await p.text();throw new tb(`Server error (HTTP status ${e}): ${t}`)}}}return b(g,"templateFn"),g.query=(e,t,r)=>new tx(m,{query:e,params:t??[]},r),g.unsafe=e=>new tp(e),g.transaction=async(e,t)=>{if("function"==typeof e&&(e=e(g)),!Array.isArray(e))throw Error(tv);return e.forEach(e=>{if(!(e instanceof tx))throw Error(tv)}),m(e.map(e=>e.queryData),e.map(e=>e.opts??{}),t)},b(m,"execute"),g}b(tw,"encodeBuffersAsBytea"),b(tE,"prepareQuery"),b(tS,"neon");var tR=class{constructor(e,t,r){this.execute=e,this.queryData=t,this.opts=r}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)}};b(tR,"NeonQueryPromise");var tx=tR;function tA(e,{arrayMode:t,fullResults:r,types:n}){let i=new tm.default(n),s=e.fields.map(e=>e.name),o=e.fields.map(e=>i.getTypeParser(e.dataTypeID)),a=!0===t?e.rows.map(e=>e.map((e,t)=>null===e?null:o[t](e))):e.rows.map(e=>Object.fromEntries(e.map((e,t)=>[s[t],null===e?null:o[t](e)])));return r?(e.viaNeonFetch=!0,e.rowAsArray=t,e.rows=a,e._parsers=o,e._types=i,e):a}async function tT(e){if("string"==typeof e)return e;if("function"==typeof e)try{return await Promise.resolve(e())}catch(t){let e=new tb("Error getting auth token.");throw t instanceof Error&&(e=new tb(`Error getting auth token: ${t.message}`)),e}}b(tA,"processQueryResult"),b(tT,"getAuthToken"),O();var tP=S(e6());O();var tO=S(e6()),tC=class extends tO.Client{constructor(e){super(e),this.config=e}get neonConfig(){return this.connection.stream}connect(e){let{neonConfig:t}=this;t.forceDisablePgSSL&&(this.ssl=this.connection.ssl=!1),this.ssl&&t.useSecureWebSocket&&console.warn("SSL is enabled for both Postgres (e.g. ?sslmode=require in the connection string + forceDisablePgSSL = false) and the WebSocket tunnel (useSecureWebSocket = true). Double encryption will increase latency and CPU usage. It may be appropriate to disable SSL in the Postgres connection parameters or set forceDisablePgSSL = true.");let r="string"!=typeof this.config&&this.config?.host!==void 0||"string"!=typeof this.config&&this.config?.connectionString!==void 0||void 0!==h.env.PGHOST,n=h.env.USER??h.env.USERNAME;if(!r&&"localhost"===this.host&&this.user===n&&this.database===n&&null===this.password)throw Error(`No database host or connection string wa\
33
33
  s set, and key parameters have default values (host: localhost, user: ${n}, db: ${n}, password: null\
34
34
  ). Is an environment variable missing? Alternatively, if you intended to connect with these paramete\
35
- rs, please set the host to 'localhost' explicitly.`);let i=super.connect(e),s=t.pipelineTLS&&this.ssl,o="password"===t.pipelineConnect;if(!s&&!t.pipelineConnect)return i;let a=this.connection;if(s&&a.on("connect",()=>a.stream.emit("data","S")),o){a.removeAllListeners("authenticationCleartextPassword"),a.removeAllListeners("readyForQuery"),a.once("readyForQuery",()=>a.on("readyForQuery",this._handleReadyForQuery.bind(this)));let e=this.ssl?"sslconnect":"connect";a.on(e,()=>{this.neonConfig.disableWarningInBrowsers||tp(),this._handleAuthCleartextPassword(),this._handleReadyForQuery()})}return i}async _handleAuthSASLContinue(e){if(typeof crypto>"u"||void 0===crypto.subtle||void 0===crypto.subtle.importKey)throw Error("Cannot use SASL auth when `crypto.subtle` is not defined");let t=crypto.subtle,r=this.saslSession,n=this.password,i=e.data;if("SASLInitialResponse"!==r.message||"string"!=typeof n||"string"!=typeof i)throw Error("SASL: protocol error");let s=Object.fromEntries(i.split(",").map(e=>{if(!/^.=/.test(e))throw Error("SASL: Invalid attribute pair entry");return[e[0],e.substring(2)]})),o=s.r,a=s.s,u=s.i;if(!o||!/^[!-+--~]+$/.test(o))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unprintable");if(!a||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(a))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base64");if(!u||!/^[1-9][0-9]*$/.test(u))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: missing/invalid iteration count");if(!o.startsWith(r.clientNonce))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");if(o.length===r.clientNonce.length)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short");let l=parseInt(u,10),h=c.from(a,"base64"),f=new TextEncoder,d=f.encode(n),p=await t.importKey("raw",d,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),g=new Uint8Array(await t.sign("HMAC",p,c.concat([h,c.from([0,0,0,1])]))),m=g;for(var y=0;y<l-1;y++)g=new Uint8Array(await t.sign("HMAC",p,g)),m=c.from(m.map((e,t)=>m[t]^g[t]));let b=m,v=await t.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),_=new Uint8Array(await t.sign("HMAC",v,f.encode("Client Key"))),w=await t.digest("SHA-256",_),E="n=*,r="+r.clientNonce,S="r="+o+",s="+a+",i="+l,R="c=biws,r="+o,x=E+","+S+","+R,A=await t.importKey("raw",w,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var T=new Uint8Array(await t.sign("HMAC",A,f.encode(x))),P=c.from(_.map((e,t)=>_[t]^T[t])).toString("base64");let O=await t.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),C=await t.sign("HMAC",O,f.encode("Server Key")),I=await t.importKey("raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var N=c.from(await t.sign("HMAC",I,f.encode(x)));r.message="SASLResponse",r.serverSignature=N.toString("base64"),r.response=R+",p="+P,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}};y(tO,"NeonClient"),k();var tC=E(eM());function tI(e,t){let r,n;return t?{callback:t,result:void 0}:{callback:y(function(e,t){e?r(e):n(t)},"cb"),result:new e(function(e,t){n=e,r=t})}}y(tI,"promisify");var tN=class extends tT.Pool{constructor(){super(...arguments),R(this,"Client",tO),R(this,"hasFetchUnsupportedListeners",!1),R(this,"addListener",this.on)}on(e,t){return"error"!==e&&(this.hasFetchUnsupportedListeners=!0),super.on(e,t)}query(e,t,r){if(!D.poolQueryViaFetch||this.hasFetchUnsupportedListeners||"function"==typeof e)return super.query(e,t,r);"function"==typeof t&&(r=t,t=void 0);let n=tI(this.Promise,r);r=n.callback;try{let n=new tC.default(this.options),i=encodeURIComponent,s=encodeURI,o=`postgresql://${i(n.user)}:${i(n.password)}@${i(n.host)}\
36
- /${s(n.database)}`,a="string"==typeof e?e:e.text,u=t??e.values??[];tE(o,{fullResults:!0,arrayMode:"array"===e.rowMode}).query(a,u,{types:e.types??this.options?.types}).then(e=>r(void 0,e)).catch(e=>r(e))}catch(e){r(e)}return n.result}};y(tN,"NeonPool"),k();var tL=E(e2());tL.DatabaseError,tL.defaults,tL.escapeIdentifier,tL.escapeLiteral;var tM=tL.types,tD=Object.defineProperty,tk={};((e,t)=>{for(var r in t)tD(e,r,{get:t[r],enumerable:!0})})(tk,{$:()=>tj,bgBlack:()=>t3,bgBlue:()=>t9,bgCyan:()=>re,bgGreen:()=>t4,bgMagenta:()=>t7,bgRed:()=>t5,bgWhite:()=>rt,bgYellow:()=>t8,black:()=>tY,blue:()=>tJ,bold:()=>tq,cyan:()=>t0,dim:()=>t$,gray:()=>t2,green:()=>tz,grey:()=>t6,hidden:()=>tW,inverse:()=>tV,italic:()=>tG,magenta:()=>tZ,red:()=>tX,reset:()=>tF,strikethrough:()=>tQ,underline:()=>tH,white:()=>t1,yellow:()=>tK});var tB=!0;"undefined"!=typeof process&&({FORCE_COLOR:n,NODE_DISABLE_COLORS:i,NO_COLOR:s,TERM:o}=process.env||{},tB=process.stdout&&process.stdout.isTTY);var tj={enabled:!i&&null==s&&"dumb"!==o&&(null!=n&&"0"!==n||tB)};function tU(e,t){let r=RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1b[${e}m`,i=`\x1b[${t}m`;return function(e){return tj.enabled&&null!=e?n+(~(""+e).indexOf(i)?e.replace(r,i+n):e)+i:e}}var tF=tU(0,0),tq=tU(1,22),t$=tU(2,22),tG=tU(3,23),tH=tU(4,24),tV=tU(7,27),tW=tU(8,28),tQ=tU(9,29),tY=tU(30,39),tX=tU(31,39),tz=tU(32,39),tK=tU(33,39),tJ=tU(34,39),tZ=tU(35,39),t0=tU(36,39),t1=tU(37,39),t2=tU(90,39),t6=tU(90,39),t3=tU(40,49),t5=tU(41,49),t4=tU(42,49),t8=tU(43,49),t9=tU(44,49),t7=tU(45,49),re=tU(46,49),rt=tU(47,49),rr=["green","yellow","blue","magenta","cyan","red"],rn=[],ri=Date.now(),rs=0,ro="undefined"!=typeof process?process.env:{};globalThis.DEBUG??=ro.DEBUG??"",globalThis.DEBUG_COLORS??=!ro.DEBUG_COLORS||"true"===ro.DEBUG_COLORS;var ra={enable(e){"string"==typeof e&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(e=>e.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(t=>""!==t&&"-"!==t[0]&&e.match(RegExp(t.split("*").join(".*")+"$"))),n=t.some(t=>""!==t&&"-"===t[0]&&e.match(RegExp(t.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}},ru=new Proxy(function(e){let t={color:rr[rs++%rr.length],enabled:ra.enabled(e),namespace:e,log:ra.log,extend:()=>{}};return new Proxy((...e)=>{let{enabled:r,namespace:n,color:i,log:s}=t;if(0!==e.length&&rn.push([n,...e]),rn.length>100&&rn.shift(),ra.enabled(n)||r){let t=e.map(e=>"string"==typeof e?e:function(e,t=2){let r=new Set;return JSON.stringify(e,(e,t)=>{if("object"==typeof t&&null!==t){if(r.has(t))return"[Circular *]";r.add(t)}else if("bigint"==typeof t)return t.toString();return t},t)}(e)),r=`+${Date.now()-ri}ms`;ri=Date.now(),globalThis.DEBUG_COLORS?s(tk[i](tq(n)),...t,tk[i](r)):s(n,...t,r)}},{get:(e,r)=>t[r],set:(e,r,n)=>t[r]=n})},{get:(e,t)=>ra[t],set:(e,t,r)=>ra[t]=r}),rc=class extends Error{name="DriverAdapterError";cause;constructor(e){super("string"==typeof e.message?e.message:e.kind),this.cause=e}};ru("driver-adapter-utils");var rl={Int32:0,Int64:1,Float:2,Double:3,Numeric:4,Boolean:5,Text:7,Date:8,Time:9,DateTime:10,Json:11,Bytes:13,Uuid:15,Int32Array:64,Int64Array:65,FloatArray:66,DoubleArray:67,NumericArray:68,BooleanArray:69,CharacterArray:70,TextArray:71,DateArray:72,TimeArray:73,DateTimeArray:74,JsonArray:75,BytesArray:77,UuidArray:78};Error("Not implemented: queryRaw"),Error("Not implemented: executeRaw"),Error("Not implemented: startTransaction"),Error("Not implemented: executeScript"),Error("Not implemented: dispose");var rh=e.i(81962),rf="@prisma/adapter-neon",{builtins:rd,getTypeParser:rp}=tM,rg={BIT_ARRAY:1561,BOOL_ARRAY:1e3,BYTEA_ARRAY:1001,BPCHAR_ARRAY:1014,CHAR_ARRAY:1002,CIDR_ARRAY:651,DATE_ARRAY:1182,FLOAT4_ARRAY:1021,FLOAT8_ARRAY:1022,INET_ARRAY:1041,INT2_ARRAY:1005,INT4_ARRAY:1007,INT8_ARRAY:1016,JSONB_ARRAY:3807,JSON_ARRAY:199,MONEY_ARRAY:791,NUMERIC_ARRAY:1231,OID_ARRAY:1028,TEXT_ARRAY:1009,TIMESTAMP_ARRAY:1115,TIME_ARRAY:1183,UUID_ARRAY:2951,VARBIT_ARRAY:1563,VARCHAR_ARRAY:1015,XML_ARRAY:143},rm=class e extends Error{static typeNames={16:"bool",17:"bytea",18:"char",19:"name",20:"int8",21:"int2",22:"int2vector",23:"int4",24:"regproc",25:"text",26:"oid",27:"tid",28:"xid",29:"cid",30:"oidvector",32:"pg_ddl_command",71:"pg_type",75:"pg_attribute",81:"pg_proc",83:"pg_class",114:"json",142:"xml",194:"pg_node_tree",269:"table_am_handler",325:"index_am_handler",600:"point",601:"lseg",602:"path",603:"box",604:"polygon",628:"line",650:"cidr",700:"float4",701:"float8",705:"unknown",718:"circle",774:"macaddr8",790:"money",829:"macaddr",869:"inet",1033:"aclitem",1042:"bpchar",1043:"varchar",1082:"date",1083:"time",1114:"timestamp",1184:"timestamptz",1186:"interval",1266:"timetz",1560:"bit",1562:"varbit",1700:"numeric",1790:"refcursor",2202:"regprocedure",2203:"regoper",2204:"regoperator",2205:"regclass",2206:"regtype",2249:"record",2275:"cstring",2276:"any",2277:"anyarray",2278:"void",2279:"trigger",2280:"language_handler",2281:"internal",2283:"anyelement",2287:"_record",2776:"anynonarray",2950:"uuid",2970:"txid_snapshot",3115:"fdw_handler",3220:"pg_lsn",3310:"tsm_handler",3361:"pg_ndistinct",3402:"pg_dependencies",3500:"anyenum",3614:"tsvector",3615:"tsquery",3642:"gtsvector",3734:"regconfig",3769:"regdictionary",3802:"jsonb",3831:"anyrange",3838:"event_trigger",3904:"int4range",3906:"numrange",3908:"tsrange",3910:"tstzrange",3912:"daterange",3926:"int8range",4072:"jsonpath",4089:"regnamespace",4096:"regrole",4191:"regcollation",4451:"int4multirange",4532:"nummultirange",4533:"tsmultirange",4534:"tstzmultirange",4535:"datemultirange",4536:"int8multirange",4537:"anymultirange",4538:"anycompatiblemultirange",4600:"pg_brin_bloom_summary",4601:"pg_brin_minmax_multi_summary",5017:"pg_mcv_list",5038:"pg_snapshot",5069:"xid8",5077:"anycompatible",5078:"anycompatiblearray",5079:"anycompatiblenonarray",5080:"anycompatiblerange"};type;constructor(t){super(),this.type=e.typeNames[t]||"Unknown",this.message=`Unsupported column type ${this.type}`}};function ry(e){return t=>(0,rh.parse)(t,e)}function rb(e){return e}function rv(e){return e}function r_(e){return new Date(`${e}Z`).toISOString().replace(/(\.000)?Z$/,"+00:00")}function rw(e){return e}function rE(e){return e.slice(1)}function rS(e){return e}function rR(e){return Array.from(new Uint8Array(e))}var rx=rp(rd.BYTEA),rA=rp(rg.BYTEA_ARRAY);function rT(e){return e}var rP={[rd.NUMERIC]:rb,[rg.NUMERIC_ARRAY]:ry(rb),[rd.TIME]:rw,[rg.TIME_ARRAY]:ry(rw),[rd.TIMETZ]:function(e){return e.replace(/[+-]\d{2}(:\d{2})?$/,"")},[rd.DATE]:rv,[rg.DATE_ARRAY]:ry(rv),[rd.TIMESTAMP]:r_,[rg.TIMESTAMP_ARRAY]:ry(r_),[rd.TIMESTAMPTZ]:function(e){return new Date(e.replace(/[+-]\d{2}(:\d{2})?$/,"Z")).toISOString().replace(/(\.000)?Z$/,"+00:00")},[rd.MONEY]:rE,[rg.MONEY_ARRAY]:ry(rE),[rd.JSON]:rS,[rg.JSON_ARRAY]:ry(rS),[rd.JSONB]:rS,[rg.JSONB_ARRAY]:ry(rS),[rd.BYTEA]:function(e){return rR(rx(e))},[rg.BYTEA_ARRAY]:function(e){return rA(e).map(e=>e?rR(e):null)},[rg.BIT_ARRAY]:ry(rT),[rg.VARBIT_ARRAY]:ry(rT),[rg.XML_ARRAY]:ry(function(e){return e})},rO=ru("prisma:driver-adapter:neon"),rC=class{provider="postgres";adapterName=rf;async queryRaw(e){rO("[js::query_raw] %O",e);let{fields:t,rows:r}=await this.performIO(e),n=t.map(e=>e.name),i=[];try{i=t.map(e=>(function(e){switch(e){case rd.INT2:case rd.INT4:return rl.Int32;case rd.INT8:return rl.Int64;case rd.FLOAT4:return rl.Float;case rd.FLOAT8:return rl.Double;case rd.BOOL:return rl.Boolean;case rd.DATE:return rl.Date;case rd.TIME:case rd.TIMETZ:return rl.Time;case rd.TIMESTAMP:case rd.TIMESTAMPTZ:return rl.DateTime;case rd.NUMERIC:case rd.MONEY:return rl.Numeric;case rd.JSON:case rd.JSONB:return rl.Json;case rd.UUID:return rl.Uuid;case rd.OID:return rl.Int64;case rd.BPCHAR:case rd.TEXT:case rd.VARCHAR:case rd.BIT:case rd.VARBIT:case rd.INET:case rd.CIDR:case rd.XML:return rl.Text;case rd.BYTEA:return rl.Bytes;case rg.INT2_ARRAY:case rg.INT4_ARRAY:return rl.Int32Array;case rg.FLOAT4_ARRAY:return rl.FloatArray;case rg.FLOAT8_ARRAY:return rl.DoubleArray;case rg.NUMERIC_ARRAY:case rg.MONEY_ARRAY:return rl.NumericArray;case rg.BOOL_ARRAY:return rl.BooleanArray;case rg.CHAR_ARRAY:return rl.CharacterArray;case rg.BPCHAR_ARRAY:case rg.TEXT_ARRAY:case rg.VARCHAR_ARRAY:case rg.VARBIT_ARRAY:case rg.BIT_ARRAY:case rg.INET_ARRAY:case rg.CIDR_ARRAY:case rg.XML_ARRAY:return rl.TextArray;case rg.DATE_ARRAY:return rl.DateArray;case rg.TIME_ARRAY:return rl.TimeArray;case rg.TIMESTAMP_ARRAY:return rl.DateTimeArray;case rg.JSON_ARRAY:case rg.JSONB_ARRAY:return rl.JsonArray;case rg.BYTEA_ARRAY:return rl.BytesArray;case rg.UUID_ARRAY:return rl.UuidArray;case rg.INT8_ARRAY:case rg.OID_ARRAY:return rl.Int64Array;default:if(e>=1e4)return rl.Text;throw new rm(e)}})(e.dataTypeID))}catch(e){if(e instanceof rm)throw new rc({kind:"UnsupportedNativeDataType",type:e.type});throw e}return{columnNames:n,columnTypes:i,rows:r}}async executeRaw(e){return rO("[js::execute_raw] %O",e),(await this.performIO(e)).rowCount??0}},rI=class extends rC{constructor(e){super(),this.client=e}async performIO(e){let{sql:t,args:r}=e;try{return await this.client.query({text:t,rowMode:"array",types:{getTypeParser:(e,t)=>"text"===t&&rP[e]?rP[e]:tM.getTypeParser(e,t)}},r.map((t,r)=>(function e(t,r){if(null===t)return null;if(Array.isArray(t)&&"list"===r.arity)return t.map(t=>e(t,r));if("string"==typeof t&&"datetime"===r.scalarType&&(t=new Date(t)),t instanceof Date)switch(r.dbType){case"TIME":case"TIMETZ":var n=t;let i=(e,t=2)=>String(e).padStart(t,"0"),s=n.getUTCMilliseconds();return i(n.getUTCHours())+":"+i(n.getUTCMinutes())+":"+i(n.getUTCSeconds())+(s?"."+String(s).padStart(3,"0"):"");case"DATE":var o=t;let a=(e,t=2)=>String(e).padStart(t,"0");return o.getUTCFullYear()+"-"+a(o.getUTCMonth()+1)+"-"+a(o.getUTCDate());default:var u=t;let c=(e,t=2)=>String(e).padStart(t,"0"),l=u.getUTCMilliseconds();return u.getUTCFullYear()+"-"+c(u.getUTCMonth()+1)+"-"+c(u.getUTCDate())+" "+c(u.getUTCHours())+":"+c(u.getUTCMinutes())+":"+c(u.getUTCSeconds())+(l?"."+String(l).padStart(3,"0"):"")}return"string"==typeof t&&"bytes"===r.scalarType?Buffer.from(t,"base64"):Array.isArray(t)&&"bytes"===r.scalarType?Buffer.from(t):ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength):t})(t,e.argTypes[r])))}catch(e){this.onError(e)}}onError(e){throw rO("Error in onError: %O",e),new rc(function(e){var t;if("string"==typeof(t=e).code&&"string"==typeof t.message&&"string"==typeof t.severity&&("string"==typeof t.detail||void 0===t.detail)&&("string"==typeof t.column||void 0===t.column)&&("string"==typeof t.hint||void 0===t.hint))return{originalCode:e.code,originalMessage:e.message,...function(e){switch(e.code){case"22001":return{kind:"LengthMismatch",column:e.column};case"22003":return{kind:"ValueOutOfRange",cause:e.message};case"23505":{let t=e.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");return{kind:"UniqueConstraintViolation",constraint:void 0!==t?{fields:t}:void 0}}case"23502":{let t=e.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");return{kind:"NullConstraintViolation",constraint:void 0!==t?{fields:t}:void 0}}case"23503":{let t;return e.column?t={fields:[e.column]}:e.constraint&&(t={index:e.constraint}),{kind:"ForeignKeyConstraintViolation",constraint:t}}case"3D000":return{kind:"DatabaseDoesNotExist",db:e.message.split(" ").at(1)?.split('"').at(1)};case"28000":return{kind:"DatabaseAccessDenied",db:e.message.split(",").find(e=>e.startsWith(" database"))?.split('"').at(1)};case"28P01":return{kind:"AuthenticationFailed",user:e.message.split(" ").pop()?.split('"').at(1)};case"40001":return{kind:"TransactionWriteConflict"};case"42P01":return{kind:"TableDoesNotExist",table:e.message.split(" ").at(1)?.split('"').at(1)};case"42703":return{kind:"ColumnNotFound",column:e.message.split(" ").at(1)?.split('"').at(1)};case"42P04":return{kind:"DatabaseAlreadyExists",db:e.message.split(" ").at(1)?.split('"').at(1)};case"53300":return{kind:"TooManyConnections",cause:e.message};default:return{kind:"postgres",code:e.code??"N/A",severity:e.severity??"N/A",message:e.message,detail:e.detail,column:e.column,hint:e.hint}}}(e)};throw e}(e))}},rN=class extends rI{constructor(e,t){super(e),this.options=t}async commit(){rO("[js::commit]"),this.client.release()}async rollback(){rO("[js::rollback]"),this.client.release()}},rL=class extends rI{constructor(e,t){super(e),this.options=t}isRunning=!0;executeScript(e){throw Error("Not implemented yet")}async startTransaction(e){let t={usePhantomQuery:!1};rO("%s options: %O","[js::startTransaction]",t);let r=await this.client.connect().catch(e=>this.onError(e));r.on("error",e=>{rO(`Error from pool connection: ${e.message} %O`,e),this.options?.onConnectionError?.(e)});try{let n=new rN(r,t);return await n.executeRaw({sql:"BEGIN",args:[],argTypes:[]}),e&&await n.executeRaw({sql:`SET TRANSACTION ISOLATION LEVEL ${e}`,args:[],argTypes:[]}),n}catch(e){r.release(e),this.onError(e)}}getConnectionInfo(){return{schemaName:this.options?.schema,supportsRelationJoins:!0}}async dispose(){this.isRunning&&(await this.client.end(),this.isRunning=!1)}underlyingDriver(){return this.client}},rM=class{constructor(e,t){this.config=e,this.options=t}provider="postgres";adapterName=rf;async connect(){let e=new tN(this.config);return e.on("error",e=>{rO(`Error from pool client: ${e.message} %O`,e),this.options?.onPoolError?.(e)}),new rL(e,this.options)}},rD=e.i(29173);let rk="__superinterfaceServerPrisma",rB=()=>{let e=globalThis;if(e[rk])return e[rk];if(e.prisma)return e[rk]=e.prisma,e.prisma;let t=(()=>{let e=new rM({connectionString:`${process.env.DATABASE_URL}`});return new rD.PrismaClient({adapter:e,transactionOptions:{timeout:15e3}})})();return e[rk]=t,e.prisma||(e.prisma=t),t},rj=rB()},55897,e=>{"use strict";e.s(["validate",()=>r],55897);let t=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i,r=function(e){return"string"==typeof e&&t.test(e)}}];
35
+ rs, please set the host to 'localhost' explicitly.`);let i=super.connect(e),s=t.pipelineTLS&&this.ssl,o="password"===t.pipelineConnect;if(!s&&!t.pipelineConnect)return i;let a=this.connection;if(s&&a.on("connect",()=>a.stream.emit("data","S")),o){a.removeAllListeners("authenticationCleartextPassword"),a.removeAllListeners("readyForQuery"),a.once("readyForQuery",()=>a.on("readyForQuery",this._handleReadyForQuery.bind(this)));let e=this.ssl?"sslconnect":"connect";a.on(e,()=>{this.neonConfig.disableWarningInBrowsers||tg(),this._handleAuthCleartextPassword(),this._handleReadyForQuery()})}return i}async _handleAuthSASLContinue(e){if(typeof crypto>"u"||void 0===crypto.subtle||void 0===crypto.subtle.importKey)throw Error("Cannot use SASL auth when `crypto.subtle` is not defined");let t=crypto.subtle,r=this.saslSession,n=this.password,i=e.data;if("SASLInitialResponse"!==r.message||"string"!=typeof n||"string"!=typeof i)throw Error("SASL: protocol error");let s=Object.fromEntries(i.split(",").map(e=>{if(!/^.=/.test(e))throw Error("SASL: Invalid attribute pair entry");return[e[0],e.substring(2)]})),o=s.r,a=s.s,u=s.i;if(!o||!/^[!-+--~]+$/.test(o))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unprintable");if(!a||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(a))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base64");if(!u||!/^[1-9][0-9]*$/.test(u))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: missing/invalid iteration count");if(!o.startsWith(r.clientNonce))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");if(o.length===r.clientNonce.length)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short");let c=parseInt(u,10),h=l.from(a,"base64"),f=new TextEncoder,d=f.encode(n),p=await t.importKey("raw",d,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),g=new Uint8Array(await t.sign("HMAC",p,l.concat([h,l.from([0,0,0,1])]))),m=g;for(var y=0;y<c-1;y++)g=new Uint8Array(await t.sign("HMAC",p,g)),m=l.from(m.map((e,t)=>m[t]^g[t]));let b=m,v=await t.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),_=new Uint8Array(await t.sign("HMAC",v,f.encode("Client Key"))),w=await t.digest("SHA-256",_),E="n=*,r="+r.clientNonce,S="r="+o+",s="+a+",i="+c,R="c=biws,r="+o,x=E+","+S+","+R,A=await t.importKey("raw",w,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var T=new Uint8Array(await t.sign("HMAC",A,f.encode(x))),P=l.from(_.map((e,t)=>_[t]^T[t])).toString("base64");let O=await t.importKey("raw",b,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),C=await t.sign("HMAC",O,f.encode("Server Key")),I=await t.importKey("raw",C,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var N=l.from(await t.sign("HMAC",I,f.encode(x)));r.message="SASLResponse",r.serverSignature=N.toString("base64"),r.response=R+",p="+P,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}};b(tC,"NeonClient"),B();var tI=S(eD());function tN(e,t){let r,n;return t?{callback:t,result:void 0}:{callback:b(function(e,t){e?r(e):n(t)},"cb"),result:new e(function(e,t){n=e,r=t})}}b(tN,"promisify");var tL=class extends tP.Pool{constructor(){super(...arguments),x(this,"Client",tC),x(this,"hasFetchUnsupportedListeners",!1),x(this,"addListener",this.on)}on(e,t){return"error"!==e&&(this.hasFetchUnsupportedListeners=!0),super.on(e,t)}query(e,t,r){if(!k.poolQueryViaFetch||this.hasFetchUnsupportedListeners||"function"==typeof e)return super.query(e,t,r);"function"==typeof t&&(r=t,t=void 0);let n=tN(this.Promise,r);r=n.callback;try{let n=new tI.default(this.options),i=encodeURIComponent,s=encodeURI,o=`postgresql://${i(n.user)}:${i(n.password)}@${i(n.host)}\
36
+ /${s(n.database)}`,a="string"==typeof e?e:e.text,u=t??e.values??[];tS(o,{fullResults:!0,arrayMode:"array"===e.rowMode}).query(a,u,{types:e.types??this.options?.types}).then(e=>r(void 0,e)).catch(e=>r(e))}catch(e){r(e)}return n.result}};b(tL,"NeonPool"),B();var tM=S(e6());tM.DatabaseError,tM.defaults,tM.escapeIdentifier,tM.escapeLiteral;var tD=tM.types,tk=Object.defineProperty,tB={};((e,t)=>{for(var r in t)tk(e,r,{get:t[r],enumerable:!0})})(tB,{$:()=>tU,bgBlack:()=>t5,bgBlue:()=>t7,bgCyan:()=>rt,bgGreen:()=>t8,bgMagenta:()=>re,bgRed:()=>t4,bgWhite:()=>rr,bgYellow:()=>t9,black:()=>tX,blue:()=>tZ,bold:()=>t$,cyan:()=>t1,dim:()=>tG,gray:()=>t6,green:()=>tK,grey:()=>t3,hidden:()=>tQ,inverse:()=>tW,italic:()=>tH,magenta:()=>t0,red:()=>tz,reset:()=>tq,strikethrough:()=>tY,underline:()=>tV,white:()=>t2,yellow:()=>tJ});var tj=!0;"undefined"!=typeof process&&({FORCE_COLOR:i,NODE_DISABLE_COLORS:s,NO_COLOR:o,TERM:a}=process.env||{},tj=process.stdout&&process.stdout.isTTY);var tU={enabled:!s&&null==o&&"dumb"!==a&&(null!=i&&"0"!==i||tj)};function tF(e,t){let r=RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1b[${e}m`,i=`\x1b[${t}m`;return function(e){return tU.enabled&&null!=e?n+(~(""+e).indexOf(i)?e.replace(r,i+n):e)+i:e}}var tq=tF(0,0),t$=tF(1,22),tG=tF(2,22),tH=tF(3,23),tV=tF(4,24),tW=tF(7,27),tQ=tF(8,28),tY=tF(9,29),tX=tF(30,39),tz=tF(31,39),tK=tF(32,39),tJ=tF(33,39),tZ=tF(34,39),t0=tF(35,39),t1=tF(36,39),t2=tF(37,39),t6=tF(90,39),t3=tF(90,39),t5=tF(40,49),t4=tF(41,49),t8=tF(42,49),t9=tF(43,49),t7=tF(44,49),re=tF(45,49),rt=tF(46,49),rr=tF(47,49),rn=["green","yellow","blue","magenta","cyan","red"],ri=[],rs=Date.now(),ro=0,ra="undefined"!=typeof process?process.env:{};globalThis.DEBUG??=ra.DEBUG??"",globalThis.DEBUG_COLORS??=!ra.DEBUG_COLORS||"true"===ra.DEBUG_COLORS;var ru={enable(e){"string"==typeof e&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(e=>e.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(t=>""!==t&&"-"!==t[0]&&e.match(RegExp(t.split("*").join(".*")+"$"))),n=t.some(t=>""!==t&&"-"===t[0]&&e.match(RegExp(t.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}},rc=new Proxy(function(e){let t={color:rn[ro++%rn.length],enabled:ru.enabled(e),namespace:e,log:ru.log,extend:()=>{}};return new Proxy((...e)=>{let{enabled:r,namespace:n,color:i,log:s}=t;if(0!==e.length&&ri.push([n,...e]),ri.length>100&&ri.shift(),ru.enabled(n)||r){let t=e.map(e=>"string"==typeof e?e:function(e,t=2){let r=new Set;return JSON.stringify(e,(e,t)=>{if("object"==typeof t&&null!==t){if(r.has(t))return"[Circular *]";r.add(t)}else if("bigint"==typeof t)return t.toString();return t},t)}(e)),r=`+${Date.now()-rs}ms`;rs=Date.now(),globalThis.DEBUG_COLORS?s(tB[i](t$(n)),...t,tB[i](r)):s(n,...t,r)}},{get:(e,r)=>t[r],set:(e,r,n)=>t[r]=n})},{get:(e,t)=>ru[t],set:(e,t,r)=>ru[t]=r}),rl=class extends Error{name="DriverAdapterError";cause;constructor(e){super("string"==typeof e.message?e.message:e.kind),this.cause=e}};rc("driver-adapter-utils");var rh={Int32:0,Int64:1,Float:2,Double:3,Numeric:4,Boolean:5,Text:7,Date:8,Time:9,DateTime:10,Json:11,Bytes:13,Uuid:15,Int32Array:64,Int64Array:65,FloatArray:66,DoubleArray:67,NumericArray:68,BooleanArray:69,CharacterArray:70,TextArray:71,DateArray:72,TimeArray:73,DateTimeArray:74,JsonArray:75,BytesArray:77,UuidArray:78};Error("Not implemented: queryRaw"),Error("Not implemented: executeRaw"),Error("Not implemented: startTransaction"),Error("Not implemented: executeScript"),Error("Not implemented: dispose");var rf=e.i(81962),rd="@prisma/adapter-neon",{builtins:rp,getTypeParser:rg}=tD,rm={BIT_ARRAY:1561,BOOL_ARRAY:1e3,BYTEA_ARRAY:1001,BPCHAR_ARRAY:1014,CHAR_ARRAY:1002,CIDR_ARRAY:651,DATE_ARRAY:1182,FLOAT4_ARRAY:1021,FLOAT8_ARRAY:1022,INET_ARRAY:1041,INT2_ARRAY:1005,INT4_ARRAY:1007,INT8_ARRAY:1016,JSONB_ARRAY:3807,JSON_ARRAY:199,MONEY_ARRAY:791,NUMERIC_ARRAY:1231,OID_ARRAY:1028,TEXT_ARRAY:1009,TIMESTAMP_ARRAY:1115,TIME_ARRAY:1183,UUID_ARRAY:2951,VARBIT_ARRAY:1563,VARCHAR_ARRAY:1015,XML_ARRAY:143},ry=class e extends Error{static typeNames={16:"bool",17:"bytea",18:"char",19:"name",20:"int8",21:"int2",22:"int2vector",23:"int4",24:"regproc",25:"text",26:"oid",27:"tid",28:"xid",29:"cid",30:"oidvector",32:"pg_ddl_command",71:"pg_type",75:"pg_attribute",81:"pg_proc",83:"pg_class",114:"json",142:"xml",194:"pg_node_tree",269:"table_am_handler",325:"index_am_handler",600:"point",601:"lseg",602:"path",603:"box",604:"polygon",628:"line",650:"cidr",700:"float4",701:"float8",705:"unknown",718:"circle",774:"macaddr8",790:"money",829:"macaddr",869:"inet",1033:"aclitem",1042:"bpchar",1043:"varchar",1082:"date",1083:"time",1114:"timestamp",1184:"timestamptz",1186:"interval",1266:"timetz",1560:"bit",1562:"varbit",1700:"numeric",1790:"refcursor",2202:"regprocedure",2203:"regoper",2204:"regoperator",2205:"regclass",2206:"regtype",2249:"record",2275:"cstring",2276:"any",2277:"anyarray",2278:"void",2279:"trigger",2280:"language_handler",2281:"internal",2283:"anyelement",2287:"_record",2776:"anynonarray",2950:"uuid",2970:"txid_snapshot",3115:"fdw_handler",3220:"pg_lsn",3310:"tsm_handler",3361:"pg_ndistinct",3402:"pg_dependencies",3500:"anyenum",3614:"tsvector",3615:"tsquery",3642:"gtsvector",3734:"regconfig",3769:"regdictionary",3802:"jsonb",3831:"anyrange",3838:"event_trigger",3904:"int4range",3906:"numrange",3908:"tsrange",3910:"tstzrange",3912:"daterange",3926:"int8range",4072:"jsonpath",4089:"regnamespace",4096:"regrole",4191:"regcollation",4451:"int4multirange",4532:"nummultirange",4533:"tsmultirange",4534:"tstzmultirange",4535:"datemultirange",4536:"int8multirange",4537:"anymultirange",4538:"anycompatiblemultirange",4600:"pg_brin_bloom_summary",4601:"pg_brin_minmax_multi_summary",5017:"pg_mcv_list",5038:"pg_snapshot",5069:"xid8",5077:"anycompatible",5078:"anycompatiblearray",5079:"anycompatiblenonarray",5080:"anycompatiblerange"};type;constructor(t){super(),this.type=e.typeNames[t]||"Unknown",this.message=`Unsupported column type ${this.type}`}};function rb(e){return t=>(0,rf.parse)(t,e)}function rv(e){return e}function r_(e){return e}function rw(e){return new Date(`${e}Z`).toISOString().replace(/(\.000)?Z$/,"+00:00")}function rE(e){return e}function rS(e){return e.slice(1)}function rR(e){return e}function rx(e){return Array.from(new Uint8Array(e))}var rA=rg(rp.BYTEA),rT=rg(rm.BYTEA_ARRAY);function rP(e){return e}var rO={[rp.NUMERIC]:rv,[rm.NUMERIC_ARRAY]:rb(rv),[rp.TIME]:rE,[rm.TIME_ARRAY]:rb(rE),[rp.TIMETZ]:function(e){return e.replace(/[+-]\d{2}(:\d{2})?$/,"")},[rp.DATE]:r_,[rm.DATE_ARRAY]:rb(r_),[rp.TIMESTAMP]:rw,[rm.TIMESTAMP_ARRAY]:rb(rw),[rp.TIMESTAMPTZ]:function(e){return new Date(e.replace(/[+-]\d{2}(:\d{2})?$/,"Z")).toISOString().replace(/(\.000)?Z$/,"+00:00")},[rp.MONEY]:rS,[rm.MONEY_ARRAY]:rb(rS),[rp.JSON]:rR,[rm.JSON_ARRAY]:rb(rR),[rp.JSONB]:rR,[rm.JSONB_ARRAY]:rb(rR),[rp.BYTEA]:function(e){return rx(rA(e))},[rm.BYTEA_ARRAY]:function(e){return rT(e).map(e=>e?rx(e):null)},[rm.BIT_ARRAY]:rb(rP),[rm.VARBIT_ARRAY]:rb(rP),[rm.XML_ARRAY]:rb(function(e){return e})},rC=rc("prisma:driver-adapter:neon"),rI=class{provider="postgres";adapterName=rd;async queryRaw(e){rC("[js::query_raw] %O",e);let{fields:t,rows:r}=await this.performIO(e),n=t.map(e=>e.name),i=[];try{i=t.map(e=>(function(e){switch(e){case rp.INT2:case rp.INT4:return rh.Int32;case rp.INT8:return rh.Int64;case rp.FLOAT4:return rh.Float;case rp.FLOAT8:return rh.Double;case rp.BOOL:return rh.Boolean;case rp.DATE:return rh.Date;case rp.TIME:case rp.TIMETZ:return rh.Time;case rp.TIMESTAMP:case rp.TIMESTAMPTZ:return rh.DateTime;case rp.NUMERIC:case rp.MONEY:return rh.Numeric;case rp.JSON:case rp.JSONB:return rh.Json;case rp.UUID:return rh.Uuid;case rp.OID:return rh.Int64;case rp.BPCHAR:case rp.TEXT:case rp.VARCHAR:case rp.BIT:case rp.VARBIT:case rp.INET:case rp.CIDR:case rp.XML:return rh.Text;case rp.BYTEA:return rh.Bytes;case rm.INT2_ARRAY:case rm.INT4_ARRAY:return rh.Int32Array;case rm.FLOAT4_ARRAY:return rh.FloatArray;case rm.FLOAT8_ARRAY:return rh.DoubleArray;case rm.NUMERIC_ARRAY:case rm.MONEY_ARRAY:return rh.NumericArray;case rm.BOOL_ARRAY:return rh.BooleanArray;case rm.CHAR_ARRAY:return rh.CharacterArray;case rm.BPCHAR_ARRAY:case rm.TEXT_ARRAY:case rm.VARCHAR_ARRAY:case rm.VARBIT_ARRAY:case rm.BIT_ARRAY:case rm.INET_ARRAY:case rm.CIDR_ARRAY:case rm.XML_ARRAY:return rh.TextArray;case rm.DATE_ARRAY:return rh.DateArray;case rm.TIME_ARRAY:return rh.TimeArray;case rm.TIMESTAMP_ARRAY:return rh.DateTimeArray;case rm.JSON_ARRAY:case rm.JSONB_ARRAY:return rh.JsonArray;case rm.BYTEA_ARRAY:return rh.BytesArray;case rm.UUID_ARRAY:return rh.UuidArray;case rm.INT8_ARRAY:case rm.OID_ARRAY:return rh.Int64Array;default:if(e>=1e4)return rh.Text;throw new ry(e)}})(e.dataTypeID))}catch(e){if(e instanceof ry)throw new rl({kind:"UnsupportedNativeDataType",type:e.type});throw e}return{columnNames:n,columnTypes:i,rows:r}}async executeRaw(e){return rC("[js::execute_raw] %O",e),(await this.performIO(e)).rowCount??0}},rN=class extends rI{constructor(e){super(),this.client=e}async performIO(e){let{sql:t,args:r}=e;try{return await this.client.query({text:t,rowMode:"array",types:{getTypeParser:(e,t)=>"text"===t&&rO[e]?rO[e]:tD.getTypeParser(e,t)}},r.map((t,r)=>(function e(t,r){if(null===t)return null;if(Array.isArray(t)&&"list"===r.arity)return t.map(t=>e(t,r));if("string"==typeof t&&"datetime"===r.scalarType&&(t=new Date(t)),t instanceof Date)switch(r.dbType){case"TIME":case"TIMETZ":var n=t;let i=(e,t=2)=>String(e).padStart(t,"0"),s=n.getUTCMilliseconds();return i(n.getUTCHours())+":"+i(n.getUTCMinutes())+":"+i(n.getUTCSeconds())+(s?"."+String(s).padStart(3,"0"):"");case"DATE":var o=t;let a=(e,t=2)=>String(e).padStart(t,"0");return o.getUTCFullYear()+"-"+a(o.getUTCMonth()+1)+"-"+a(o.getUTCDate());default:var u=t;let c=(e,t=2)=>String(e).padStart(t,"0"),l=u.getUTCMilliseconds();return u.getUTCFullYear()+"-"+c(u.getUTCMonth()+1)+"-"+c(u.getUTCDate())+" "+c(u.getUTCHours())+":"+c(u.getUTCMinutes())+":"+c(u.getUTCSeconds())+(l?"."+String(l).padStart(3,"0"):"")}return"string"==typeof t&&"bytes"===r.scalarType?Buffer.from(t,"base64"):Array.isArray(t)&&"bytes"===r.scalarType?Buffer.from(t):ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength):t})(t,e.argTypes[r])))}catch(e){this.onError(e)}}onError(e){throw rC("Error in onError: %O",e),new rl(function(e){var t;if("string"==typeof(t=e).code&&"string"==typeof t.message&&"string"==typeof t.severity&&("string"==typeof t.detail||void 0===t.detail)&&("string"==typeof t.column||void 0===t.column)&&("string"==typeof t.hint||void 0===t.hint))return{originalCode:e.code,originalMessage:e.message,...function(e){switch(e.code){case"22001":return{kind:"LengthMismatch",column:e.column};case"22003":return{kind:"ValueOutOfRange",cause:e.message};case"23505":{let t=e.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");return{kind:"UniqueConstraintViolation",constraint:void 0!==t?{fields:t}:void 0}}case"23502":{let t=e.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");return{kind:"NullConstraintViolation",constraint:void 0!==t?{fields:t}:void 0}}case"23503":{let t;return e.column?t={fields:[e.column]}:e.constraint&&(t={index:e.constraint}),{kind:"ForeignKeyConstraintViolation",constraint:t}}case"3D000":return{kind:"DatabaseDoesNotExist",db:e.message.split(" ").at(1)?.split('"').at(1)};case"28000":return{kind:"DatabaseAccessDenied",db:e.message.split(",").find(e=>e.startsWith(" database"))?.split('"').at(1)};case"28P01":return{kind:"AuthenticationFailed",user:e.message.split(" ").pop()?.split('"').at(1)};case"40001":return{kind:"TransactionWriteConflict"};case"42P01":return{kind:"TableDoesNotExist",table:e.message.split(" ").at(1)?.split('"').at(1)};case"42703":return{kind:"ColumnNotFound",column:e.message.split(" ").at(1)?.split('"').at(1)};case"42P04":return{kind:"DatabaseAlreadyExists",db:e.message.split(" ").at(1)?.split('"').at(1)};case"53300":return{kind:"TooManyConnections",cause:e.message};default:return{kind:"postgres",code:e.code??"N/A",severity:e.severity??"N/A",message:e.message,detail:e.detail,column:e.column,hint:e.hint}}}(e)};throw e}(e))}},rL=class extends rN{constructor(e,t){super(e),this.options=t}async commit(){rC("[js::commit]"),this.client.release()}async rollback(){rC("[js::rollback]"),this.client.release()}},rM=class extends rN{constructor(e,t){super(e),this.options=t}isRunning=!0;executeScript(e){throw Error("Not implemented yet")}async startTransaction(e){let t={usePhantomQuery:!1};rC("%s options: %O","[js::startTransaction]",t);let r=await this.client.connect().catch(e=>this.onError(e));r.on("error",e=>{rC(`Error from pool connection: ${e.message} %O`,e),this.options?.onConnectionError?.(e)});try{let n=new rL(r,t);return await n.executeRaw({sql:"BEGIN",args:[],argTypes:[]}),e&&await n.executeRaw({sql:`SET TRANSACTION ISOLATION LEVEL ${e}`,args:[],argTypes:[]}),n}catch(e){r.release(e),this.onError(e)}}getConnectionInfo(){return{schemaName:this.options?.schema,supportsRelationJoins:!0}}async dispose(){this.isRunning&&(await this.client.end(),this.isRunning=!1)}underlyingDriver(){return this.client}},rD=class{constructor(e,t){this.config=e,this.options=t}provider="postgres";adapterName=rd;async connect(){let e=new tL(this.config);return e.on("error",e=>{rC(`Error from pool client: ${e.message} %O`,e),this.options?.onPoolError?.(e)}),new rM(e,this.options)}},rk=e.i(29173);let rB=Symbol.for("superinterface.server.prisma"),rj=()=>{let e=globalThis;if(e[rB])return e[rB];if(e.prisma)return e[rB]=e.prisma,e.prisma;let t=(()=>{let e=new rD({connectionString:`${process.env.DATABASE_URL}`});return new rk.PrismaClient({adapter:e,transactionOptions:{timeout:15e3}})})();return e[rB]=t,e.prisma||(e.prisma=t),t},rU=()=>rj(),rF=new Proxy({},{get(e,r,n){let i=t??(t=rU()),s=Reflect.get(i,r,n);return"function"==typeof s?s.bind(i):s},set:(e,r,n,i)=>Reflect.set(t??(t=rU()),r,n,i),has:(e,r)=>Reflect.has(t??(t=rU()),r),ownKeys:()=>Reflect.ownKeys(t??(t=rU())),getOwnPropertyDescriptor:(e,r)=>Reflect.getOwnPropertyDescriptor(t??(t=rU()),r)})},55897,e=>{"use strict";e.s(["validate",()=>r],55897);let t=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i,r=function(e){return"string"==typeof e&&t.test(e)}}];
37
37
 
38
38
  //# sourceMappingURL=%5Broot-of-the-server%5D__f0dfab03._.js.map