@kyro-cms/core 0.12.43 → 0.12.45
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.
- package/dist/{WebhookService-C19xR8qE.d.ts → WebhookService-CZf_na-J.d.ts} +1 -1
- package/dist/{WebhookService-BBcCHBo8.d.cts → WebhookService-DgIx21X-.d.cts} +1 -1
- package/dist/api-handler-graphql.cjs +1 -1
- package/dist/api-handler-graphql.js +2 -1
- package/dist/api-handler-trpc.cjs +1 -1
- package/dist/api-handler-trpc.js +2 -1
- package/dist/api-handler.cjs +1 -1
- package/dist/api-handler.js +1 -1
- package/dist/{base-yXdYZxFK.d.ts → base-7vJMzr4V.d.ts} +1 -1
- package/dist/{base-C2iwjdJQ.d.cts → base-DDEmdRqV.d.cts} +1 -1
- package/dist/bcryptjs-AZA6WEN2.js +2 -0
- package/dist/bcryptjs-WIQSWJGK.cjs +1 -0
- package/dist/better-sqlite3-42Q3FG3E.js +2 -0
- package/dist/better-sqlite3-5IISPX34.cjs +1 -0
- package/dist/bootstrap-7CI3NVSY.js +1 -0
- package/dist/bootstrap-DOOM2CNQ.cjs +1 -0
- package/dist/bowser-FI5JQGKZ.js +11 -0
- package/dist/bowser-VX6B6ZSE.cjs +10 -0
- package/dist/chokidar-24HVS6XD.cjs +5 -0
- package/dist/chokidar-43DT7CVN.js +6 -0
- package/dist/chunk-26Q7JXM4.cjs +3 -0
- package/dist/chunk-2BUODBE2.js +2 -0
- package/dist/chunk-2WFTETFB.js +2 -0
- package/dist/chunk-35PGCW3S.cjs +1 -0
- package/dist/chunk-3VXEK5ZW.cjs +1 -0
- package/dist/chunk-45TJAB5X.js +301 -0
- package/dist/chunk-5DWYVUQR.cjs +1 -0
- package/dist/chunk-5LPNEYK5.cjs +1 -0
- package/dist/chunk-66BJXVFJ.js +2 -0
- package/dist/chunk-6KRR7YHA.js +2 -0
- package/dist/chunk-6KUL2BSA.cjs +133 -0
- package/dist/chunk-6MSS5X77.js +2 -0
- package/dist/chunk-6QWLXJ7L.js +2 -0
- package/dist/chunk-6V3AP7HR.cjs +269 -0
- package/dist/chunk-73D2PNHD.cjs +7 -0
- package/dist/chunk-7ACHOBWY.cjs +13 -0
- package/dist/chunk-7AQSH3KR.js +2 -0
- package/dist/chunk-7GGZA5YU.cjs +2 -0
- package/dist/chunk-7I6URA6F.js +4 -0
- package/dist/chunk-7JWQ2PZP.cjs +1 -0
- package/dist/chunk-7SSFHJTR.js +57 -0
- package/dist/chunk-7T35572E.js +75 -0
- package/dist/chunk-7V67ONUD.js +4 -0
- package/dist/chunk-7WMMKGEO.cjs +1 -0
- package/dist/chunk-A73AVVFR.js +11 -0
- package/dist/chunk-AK754S3T.cjs +2 -0
- package/dist/chunk-AMGJ5AFH.cjs +1 -0
- package/dist/chunk-ATBH763U.js +2 -0
- package/dist/chunk-B3GDQ7UI.cjs +114 -0
- package/dist/chunk-BAVN7VDR.cjs +1 -0
- package/dist/chunk-BCEE4NBZ.cjs +2 -0
- package/dist/{chunk-J4252I5B.cjs → chunk-BHR7OAU4.cjs} +4 -4
- package/dist/chunk-BLH2MRK4.js +2 -0
- package/dist/chunk-BPMA2ECA.js +10 -0
- package/dist/chunk-BUNLC3II.cjs +1 -0
- package/dist/chunk-C2PXMVR5.js +2 -0
- package/dist/chunk-CGPAS4U5.js +4 -0
- package/dist/chunk-DS5DE5BU.js +2 -0
- package/dist/chunk-DUO523BH.cjs +1 -0
- package/dist/chunk-DVWYO3KK.cjs +1 -0
- package/dist/chunk-E27KEZPT.js +2 -0
- package/dist/chunk-EHWUALGH.cjs +1 -0
- package/dist/chunk-EN65ZEK2.cjs +2 -0
- package/dist/chunk-EOOZDOL7.js +3 -0
- package/dist/chunk-EZIDQBXI.cjs +1 -0
- package/dist/chunk-F4ITQ6XQ.cjs +3 -0
- package/dist/chunk-FLM37UVD.js +2 -0
- package/dist/chunk-GIS6X43A.cjs +3 -0
- package/dist/chunk-GNEVCEJU.cjs +3 -0
- package/dist/chunk-GNOSG3PK.cjs +1 -0
- package/dist/chunk-HLAEJB5R.js +384 -0
- package/dist/chunk-HPYH7GTS.cjs +1 -0
- package/dist/chunk-HT44I66C.js +24 -0
- package/dist/chunk-HTYVI2HK.cjs +9 -0
- package/dist/chunk-ICVQWR2A.js +2 -0
- package/dist/chunk-IP6JUEH3.js +3 -0
- package/dist/chunk-IPXOY4RI.js +2 -0
- package/dist/chunk-J6U5LWZ7.js +11 -0
- package/dist/{chunk-UHFDH3PG.js → chunk-JT36FTHY.cjs} +4 -4
- package/dist/chunk-JUJZOG6P.js +2 -0
- package/dist/{chunk-2BTRHVT3.cjs → chunk-K7YNEKVE.js} +5 -4
- package/dist/chunk-KCHPADCH.cjs +7 -0
- package/dist/chunk-KH7LM52S.js +3 -0
- package/dist/chunk-LEBM6ZSZ.cjs +10 -0
- package/dist/chunk-LQ3YZTPU.cjs +15 -0
- package/dist/chunk-LY7N3UHH.cjs +23 -0
- package/dist/chunk-M6ESQ5TE.cjs +56 -0
- package/dist/chunk-MCZ3YZ2L.js +2 -0
- package/dist/chunk-MP5VC5ER.cjs +1 -0
- package/dist/chunk-MVX2PYJJ.cjs +1 -0
- package/dist/chunk-MY42EWZP.js +2 -0
- package/dist/chunk-MZOWPV4D.js +20 -0
- package/dist/chunk-NGNJSUGL.cjs +1 -0
- package/dist/chunk-NWCREF47.js +3 -0
- package/dist/chunk-OMWQVPV7.js +14 -0
- package/dist/chunk-ORG67NXX.js +3 -0
- package/dist/chunk-OSAVAYJZ.js +16 -0
- package/dist/chunk-P7XYIKL6.cjs +300 -0
- package/dist/chunk-PBOZJOKN.js +2 -0
- package/dist/chunk-PITMDQYN.cjs +18 -0
- package/dist/chunk-PL5AIE6F.js +2 -0
- package/dist/chunk-QC4YXUBT.cjs +383 -0
- package/dist/chunk-QDHP5E4P.cjs +2 -0
- package/dist/chunk-QYI3GOHF.cjs +1 -0
- package/dist/chunk-R3NEPC4I.js +3 -0
- package/dist/chunk-R4LXRAMX.js +2 -0
- package/dist/chunk-S5HTTLN7.cjs +2 -0
- package/dist/chunk-STX5V7HG.cjs +20 -0
- package/dist/chunk-SVYUTQVE.js +115 -0
- package/dist/chunk-SYEP5QLG.js +19 -0
- package/dist/chunk-TR3ZS3T3.js +3 -0
- package/dist/chunk-UB5TJHQR.js +2 -0
- package/dist/chunk-UD6ZPO7T.js +2 -0
- package/dist/chunk-UK43ADRO.js +270 -0
- package/dist/chunk-UNYXWPLZ.cjs +2 -0
- package/dist/chunk-VBPAAQEF.js +2 -0
- package/dist/chunk-VIUU4D5I.js +2 -0
- package/dist/chunk-VJ2WMKPK.js +21 -0
- package/dist/chunk-VOQUO2EZ.cjs +74 -0
- package/dist/chunk-VQ53TFYA.cjs +1 -0
- package/dist/chunk-VRZC4TTF.cjs +1 -0
- package/dist/chunk-W46LZ4MY.js +2 -0
- package/dist/chunk-WCFHS7EZ.cjs +1 -0
- package/dist/chunk-WGESLAWV.js +8 -0
- package/dist/chunk-WSP7PSXC.js +8 -0
- package/dist/chunk-X54XZACS.cjs +10 -0
- package/dist/{chunk-Q2UYCYKV.js → chunk-XBH4YMC7.js} +5 -4
- package/dist/chunk-XDE7CFV6.cjs +19 -0
- package/dist/chunk-XOACKBG7.js +4 -0
- package/dist/chunk-XPPVX4GQ.cjs +1 -0
- package/dist/chunk-ZJE3VAAW.js +134 -0
- package/dist/chunk-ZO3YB5DK.cjs +1 -0
- package/dist/chunk-ZOVH6QT5.cjs +1 -0
- package/dist/chunk-ZYDOF65Q.cjs +1 -0
- package/dist/cli/index.cjs +197 -78
- package/dist/cli/index.js +198 -78
- package/dist/client.cjs +1 -1
- package/dist/client.d.cts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +2 -1
- package/dist/d1-5ZQJOFDX.cjs +1 -0
- package/dist/d1-VPH75GI2.js +2 -0
- package/dist/dist-es-3SSNUZST.cjs +1 -0
- package/dist/dist-es-6SVFVYN3.js +1 -0
- package/dist/dist-es-6TQTDPE7.js +2 -0
- package/dist/dist-es-A5OF2STN.cjs +2 -0
- package/dist/dist-es-BOW5V247.cjs +6 -0
- package/dist/dist-es-CRIMATLL.cjs +2 -0
- package/dist/dist-es-DL3VLVP6.cjs +1 -0
- package/dist/dist-es-EMUQ6ZNZ.js +3 -0
- package/dist/dist-es-MNIQZC4U.js +2 -0
- package/dist/dist-es-P25IKLBI.cjs +1 -0
- package/dist/dist-es-SJ76GYCI.js +2 -0
- package/dist/dist-es-SRPWSAF4.cjs +1 -0
- package/dist/dist-es-T2H2W5BX.cjs +3 -0
- package/dist/dist-es-TX4DBXEW.js +3 -0
- package/dist/dist-es-U4ZB3ZDA.js +7 -0
- package/dist/dist-es-XZBHIIKY.js +4 -0
- package/dist/drizzle/index.cjs +1 -1
- package/dist/drizzle/index.d.cts +2 -2
- package/dist/drizzle/index.d.ts +2 -2
- package/dist/drizzle/index.js +1 -1
- package/dist/drizzle-orm-47ELDEM6.cjs +1 -0
- package/dist/drizzle-orm-7YTX5NTT.js +1 -0
- package/dist/event-streams-25YJ2Z6R.js +1 -0
- package/dist/event-streams-JBMWCI2O.cjs +1 -0
- package/dist/fields/index.cjs +1 -1
- package/dist/fields/index.js +1 -1
- package/dist/fs-DGKZLRM6.cjs +1 -0
- package/dist/fs-YZJ5FM6J.js +2 -0
- package/dist/graphql/index.cjs +1 -1
- package/dist/graphql/index.d.cts +2 -2
- package/dist/graphql/index.d.ts +2 -2
- package/dist/graphql/index.js +1 -1
- package/dist/{index-DTz6u7w9.d.cts → index-BJ1rwHxk.d.cts} +1 -1
- package/dist/{index-BeQtbl3z.d.ts → index-BTjlptCL.d.ts} +1 -1
- package/dist/index.cjs +28 -46
- package/dist/index.d.cts +23 -9
- package/dist/index.d.ts +23 -9
- package/dist/index.js +29 -46
- package/dist/integration.cjs +1 -1
- package/dist/integration.js +1 -1
- package/dist/jsonwebtoken-DFB6ZBZA.cjs +8 -0
- package/dist/jsonwebtoken-S7BG2YWK.js +9 -0
- package/dist/lib-5QYYN6ML.cjs +12 -0
- package/dist/lib-IYW32OER.js +13 -0
- package/dist/loadSso-JY4WDQPS.cjs +2 -0
- package/dist/loadSso-YTG2GQGW.js +3 -0
- package/dist/local-VDCSEMC2.js +1 -0
- package/dist/local-YCWBUF3R.cjs +1 -0
- package/dist/media-3Z6YW5J4.cjs +1 -0
- package/dist/media-HK2IZMUZ.js +1 -0
- package/dist/mongo-auth-adapter-7K64Y2QM.cjs +1 -0
- package/dist/mongo-auth-adapter-BUKINEZL.js +1 -0
- package/dist/mongodb/index.cjs +1 -1
- package/dist/mongodb/index.d.cts +2 -2
- package/dist/mongodb/index.d.ts +2 -2
- package/dist/mongodb/index.js +1 -1
- package/dist/nodemailer-AXROO37D.js +54 -0
- package/dist/nodemailer-IDML4L6W.cjs +53 -0
- package/dist/postgres-auth-adapter-2M4RNEY3.cjs +1 -0
- package/dist/postgres-auth-adapter-MKSHIJDL.js +1 -0
- package/dist/postgres-js-3Y54EXVQ.cjs +1 -0
- package/dist/postgres-js-INQPBHJP.js +1 -0
- package/dist/redis-adapter-EGMUN65D.cjs +1 -0
- package/dist/redis-adapter-SXOXLHNH.js +1 -0
- package/dist/rest/index.cjs +1 -1
- package/dist/rest/index.d.cts +5 -5
- package/dist/rest/index.d.ts +5 -5
- package/dist/rest/index.js +1 -1
- package/dist/schema-RT6WSUYC.cjs +1 -0
- package/dist/schema-XC5ISGNR.js +2 -0
- package/dist/signin-KZBIAHGS.js +3 -0
- package/dist/signin-VFBLX7EL.cjs +2 -0
- package/dist/sqlite-adapter-DV7ZX2EJ.js +1 -0
- package/dist/sqlite-adapter-ZTABLT2X.cjs +1 -0
- package/dist/src-6LAUXXDM.cjs +1 -0
- package/dist/src-GZRZ4VAO.js +1 -0
- package/dist/sso-oidc-54BIRYR6.cjs +2 -0
- package/dist/sso-oidc-SX5OIQGG.js +3 -0
- package/dist/sts-HVGDJYIF.js +3 -0
- package/dist/sts-YLXXIB3X.cjs +2 -0
- package/dist/templates/index.cjs +1 -1
- package/dist/templates/index.d.cts +1 -1
- package/dist/templates/index.d.ts +1 -1
- package/dist/templates/index.js +1 -1
- package/dist/trpc/index.cjs +1 -1
- package/dist/trpc/index.d.cts +7 -7
- package/dist/trpc/index.d.ts +7 -7
- package/dist/trpc/index.js +1 -1
- package/dist/{types-CaXXmV9h.d.ts → types-CYGXsNcJ.d.ts} +5 -5
- package/dist/{types-BjivdGbU.d.cts → types-DOKMyC3y.d.cts} +5 -5
- package/dist/ws/index.cjs +1 -1
- package/dist/ws/index.js +1 -1
- package/package.json +2 -2
- package/dist/bootstrap-ROSTPMVL.js +0 -1
- package/dist/bootstrap-WW5NJ6EB.cjs +0 -1
- package/dist/chunk-3CVLI5C5.cjs +0 -3
- package/dist/chunk-3Q2WUG63.cjs +0 -2
- package/dist/chunk-3RSMK4DA.cjs +0 -2
- package/dist/chunk-4IGWJMBY.cjs +0 -2
- package/dist/chunk-4ORJMSJU.cjs +0 -1
- package/dist/chunk-4RMFCTWH.js +0 -1
- package/dist/chunk-5B6X2GBJ.js +0 -2
- package/dist/chunk-5J6HXUF6.js +0 -1
- package/dist/chunk-5KOQYQEE.js +0 -1
- package/dist/chunk-5SEHX7ON.js +0 -1
- package/dist/chunk-6ROHVUXF.js +0 -1
- package/dist/chunk-6SPPR5JZ.js +0 -3
- package/dist/chunk-7IVN6TTY.js +0 -133
- package/dist/chunk-AHSFSERC.cjs +0 -1
- package/dist/chunk-B5XWYVWK.js +0 -1
- package/dist/chunk-BGX27ZRG.cjs +0 -300
- package/dist/chunk-C2W5PSHC.js +0 -300
- package/dist/chunk-CCUQZ66T.cjs +0 -133
- package/dist/chunk-D5P2IPGX.cjs +0 -3
- package/dist/chunk-EPMGPNBE.js +0 -1
- package/dist/chunk-FHJJKFAU.cjs +0 -1
- package/dist/chunk-FVZ5RFLO.js +0 -2
- package/dist/chunk-FZ6Q2EBJ.cjs +0 -20
- package/dist/chunk-G3J2EU5D.cjs +0 -1
- package/dist/chunk-G7SSHELM.cjs +0 -1
- package/dist/chunk-GKYEJ2UF.js +0 -1
- package/dist/chunk-GO34AOBZ.cjs +0 -1
- package/dist/chunk-GYQMNXXW.cjs +0 -114
- package/dist/chunk-HLSB2MCK.js +0 -1
- package/dist/chunk-HQP2Y7QQ.js +0 -251
- package/dist/chunk-HS2KNFAB.cjs +0 -2
- package/dist/chunk-HVXO3OFB.cjs +0 -1
- package/dist/chunk-IETGL7WJ.js +0 -1
- package/dist/chunk-IFJ73O3A.cjs +0 -1
- package/dist/chunk-ILEZ3NYX.cjs +0 -2
- package/dist/chunk-INB4LNA6.js +0 -90
- package/dist/chunk-K6WUOU6P.js +0 -1
- package/dist/chunk-KD7LUCFY.cjs +0 -1
- package/dist/chunk-KDNYHLD2.js +0 -1
- package/dist/chunk-LHW4R367.js +0 -1
- package/dist/chunk-MIOMMB23.cjs +0 -1
- package/dist/chunk-N5VNHUJS.cjs +0 -4
- package/dist/chunk-NRLIGDYF.js +0 -1
- package/dist/chunk-NY47CFVP.cjs +0 -1
- package/dist/chunk-NZJAGASC.cjs +0 -251
- package/dist/chunk-OG7CNQGU.js +0 -1
- package/dist/chunk-PP5S2UBV.js +0 -0
- package/dist/chunk-PP7W5UKL.js +0 -2
- package/dist/chunk-Q3Q7BJVQ.cjs +0 -1
- package/dist/chunk-QCA3AP3M.cjs +0 -1
- package/dist/chunk-QOCHBPMK.js +0 -2
- package/dist/chunk-QYFU5Y7S.js +0 -3
- package/dist/chunk-RHCWCG3O.js +0 -114
- package/dist/chunk-SK2Q4PRV.cjs +0 -90
- package/dist/chunk-TFBHE5FF.cjs +0 -1
- package/dist/chunk-UBRYJP2G.js +0 -1
- package/dist/chunk-V65NPSR5.cjs +0 -1
- package/dist/chunk-VGQ4VUG6.js +0 -2
- package/dist/chunk-W7C6SJXZ.js +0 -20
- package/dist/chunk-WIZ6C5QZ.cjs +0 -1
- package/dist/chunk-ZIWJJRWQ.js +0 -4
- package/dist/chunk-ZUVP4UK7.cjs +0 -1
- package/dist/media-L5XDD47D.js +0 -1
- package/dist/media-OUBQTIQP.cjs +0 -1
- package/dist/mongo-auth-adapter-5TJO5J5U.js +0 -1
- package/dist/mongo-auth-adapter-JVE5M3S4.cjs +0 -1
- package/dist/postgres-auth-adapter-33QOIRXT.js +0 -1
- package/dist/postgres-auth-adapter-JKDYYULH.cjs +0 -1
- package/dist/redis-adapter-NN3H4GRX.js +0 -1
- package/dist/redis-adapter-OUKQGYCH.cjs +0 -1
- package/dist/schema-HIUSHSUI.cjs +0 -1
- package/dist/schema-KFYUM674.js +0 -1
- package/dist/sqlite-adapter-GTTVSXRV.cjs +0 -1
- package/dist/sqlite-adapter-UPANATIW.js +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';var chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');var C=chunkBUNLC3II_cjs.c((br,He)=>{chunkBUNLC3II_cjs.h();var Ve=["nodebuffer","arraybuffer","fragments"],ze=typeof Blob<"u";ze&&Ve.push("blob");He.exports={BINARY_TYPES:Ve,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:ze,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}};});var Q=chunkBUNLC3II_cjs.c((Or,ne)=>{chunkBUNLC3II_cjs.h();var{EMPTY_BUFFER:Xt}=C(),Ee=Buffer[Symbol.species];function Zt(t,e){if(t.length===0)return Xt;if(t.length===1)return t[0];let s=Buffer.allocUnsafe(e),r=0;for(let i=0;i<t.length;i++){let n=t[i];s.set(n,r),r+=n.length;}return r<e?new Ee(s.buffer,s.byteOffset,r):s}function Ye(t,e,s,r,i){for(let n=0;n<i;n++)s[r+n]=t[n]^e[n&3];}function Ke(t,e){for(let s=0;s<t.length;s++)t[s]^=e[s&3];}function Qt(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.length)}function ve(t){if(ve.readOnly=true,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=new Ee(t):ArrayBuffer.isView(t)?e=new Ee(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),ve.readOnly=false),e}ne.exports={concat:Zt,mask:Ye,toArrayBuffer:Qt,toBuffer:ve,unmask:Ke};if(!process.env.WS_NO_BUFFER_UTIL)try{let t=chunkBUNLC3II_cjs.a("bufferutil");ne.exports.mask=function(e,s,r,i,n){n<48?Ye(e,s,r,i,n):t.mask(e,s,r,i,n);},ne.exports.unmask=function(e,s){e.length<32?Ke(e,s):t.unmask(e,s);};}catch{}});var Qe=chunkBUNLC3II_cjs.c((kr,Ze)=>{chunkBUNLC3II_cjs.h();var Xe=Symbol("kDone"),be=Symbol("kRun"),we=class{constructor(e){this[Xe]=()=>{this.pending--,this[be]();},this.concurrency=e||1/0,this.jobs=[],this.pending=0;}add(e){this.jobs.push(e),this[be]();}[be](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[Xe]);}}};Ze.exports=we;});var j=chunkBUNLC3II_cjs.c((Lr,st)=>{chunkBUNLC3II_cjs.h();var J=chunkBUNLC3II_cjs.a("zlib"),Je=Q(),Jt=Qe(),{kStatusCode:et}=C(),es=Buffer[Symbol.species],ts=Buffer.from([0,0,255,255]),ae=Symbol("permessage-deflate"),L=Symbol("total-length"),G=Symbol("callback"),R=Symbol("buffers"),$=Symbol("error"),oe,Oe=class{constructor(e){if(this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!oe){let s=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;oe=new Jt(s);}}static get extensionName(){return "permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=true),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=true),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=true),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[G];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"));}}acceptAsServer(e){let s=this._options,r=e.find(i=>!(s.serverNoContextTakeover===false&&i.server_no_context_takeover||i.server_max_window_bits&&(s.serverMaxWindowBits===false||typeof s.serverMaxWindowBits=="number"&&s.serverMaxWindowBits>i.server_max_window_bits)||typeof s.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!r)throw new Error("None of the extension offers can be accepted");return s.serverNoContextTakeover&&(r.server_no_context_takeover=true),s.clientNoContextTakeover&&(r.client_no_context_takeover=true),typeof s.serverMaxWindowBits=="number"&&(r.server_max_window_bits=s.serverMaxWindowBits),typeof s.clientMaxWindowBits=="number"?r.client_max_window_bits=s.clientMaxWindowBits:(r.client_max_window_bits===true||s.clientMaxWindowBits===false)&&delete r.client_max_window_bits,r}acceptAsClient(e){let s=e[0];if(this._options.clientNoContextTakeover===false&&s.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!s.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(s.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===false||typeof this._options.clientMaxWindowBits=="number"&&s.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return s}normalizeParams(e){return e.forEach(s=>{Object.keys(s).forEach(r=>{let i=s[r];if(i.length>1)throw new Error(`Parameter "${r}" must have only a single value`);if(i=i[0],r==="client_max_window_bits"){if(i!==true){let n=+i;if(!Number.isInteger(n)||n<8||n>15)throw new TypeError(`Invalid value for parameter "${r}": ${i}`);i=n;}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${r}": ${i}`)}else if(r==="server_max_window_bits"){let n=+i;if(!Number.isInteger(n)||n<8||n>15)throw new TypeError(`Invalid value for parameter "${r}": ${i}`);i=n;}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){if(i!==true)throw new TypeError(`Invalid value for parameter "${r}": ${i}`)}else throw new Error(`Unknown parameter "${r}"`);s[r]=i;});}),e}decompress(e,s,r){oe.add(i=>{this._decompress(e,s,(n,o)=>{i(),r(n,o);});});}compress(e,s,r){oe.add(i=>{this._compress(e,s,(n,o)=>{i(),r(n,o);});});}_decompress(e,s,r){let i=this._isServer?"client":"server";if(!this._inflate){let n=`${i}_max_window_bits`,o=typeof this.params[n]!="number"?J.Z_DEFAULT_WINDOWBITS:this.params[n];this._inflate=J.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[ae]=this,this._inflate[L]=0,this._inflate[R]=[],this._inflate.on("error",rs),this._inflate.on("data",tt);}this._inflate[G]=r,this._inflate.write(e),s&&this._inflate.write(ts),this._inflate.flush(()=>{let n=this._inflate[$];if(n){this._inflate.close(),this._inflate=null,r(n);return}let o=Je.concat(this._inflate[R],this._inflate[L]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[L]=0,this._inflate[R]=[],s&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),r(null,o);});}_compress(e,s,r){let i=this._isServer?"server":"client";if(!this._deflate){let n=`${i}_max_window_bits`,o=typeof this.params[n]!="number"?J.Z_DEFAULT_WINDOWBITS:this.params[n];this._deflate=J.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[L]=0,this._deflate[R]=[],this._deflate.on("data",ss);}this._deflate[G]=r,this._deflate.write(e),this._deflate.flush(J.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let n=Je.concat(this._deflate[R],this._deflate[L]);s&&(n=new es(n.buffer,n.byteOffset,n.length-4)),this._deflate[G]=null,this._deflate[L]=0,this._deflate[R]=[],s&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),r(null,n);});}};st.exports=Oe;function ss(t){this[R].push(t),this[L]+=t.length;}function tt(t){if(this[L]+=t.length,this[ae]._maxPayload<1||this[L]<=this[ae]._maxPayload){this[R].push(t);return}this[$]=new RangeError("Max payload size exceeded"),this[$].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[$][et]=1009,this.removeListener("data",tt),this.reset();}function rs(t){if(this[ae]._inflate=null,this[$]){this[G](this[$]);return}t[et]=1007,this[G](t);}});var V=chunkBUNLC3II_cjs.c((Pr,fe)=>{chunkBUNLC3II_cjs.h();var{isUtf8:rt}=chunkBUNLC3II_cjs.a("buffer"),{hasBlob:is}=C(),ns=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function os(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function Te(t){let e=t.length,s=0;for(;s<e;)if((t[s]&128)===0)s++;else if((t[s]&224)===192){if(s+1===e||(t[s+1]&192)!==128||(t[s]&254)===192)return false;s+=2;}else if((t[s]&240)===224){if(s+2>=e||(t[s+1]&192)!==128||(t[s+2]&192)!==128||t[s]===224&&(t[s+1]&224)===128||t[s]===237&&(t[s+1]&224)===160)return false;s+=3;}else if((t[s]&248)===240){if(s+3>=e||(t[s+1]&192)!==128||(t[s+2]&192)!==128||(t[s+3]&192)!==128||t[s]===240&&(t[s+1]&240)===128||t[s]===244&&t[s+1]>143||t[s]>244)return false;s+=4;}else return false;return true}function as(t){return is&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]==="Blob"||t[Symbol.toStringTag]==="File")}fe.exports={isBlob:as,isValidStatusCode:os,isValidUTF8:Te,tokenChars:ns};if(rt)fe.exports.isValidUTF8=function(t){return t.length<24?Te(t):rt(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=chunkBUNLC3II_cjs.a("utf-8-validate");fe.exports.isValidUTF8=function(e){return e.length<32?Te(e):t(e)};}catch{}});var Pe=chunkBUNLC3II_cjs.c((Rr,ht)=>{chunkBUNLC3II_cjs.h();var{Writable:fs}=chunkBUNLC3II_cjs.a("stream"),it=j(),{BINARY_TYPES:ls,EMPTY_BUFFER:nt,kStatusCode:hs,kWebSocket:cs}=C(),{concat:ke,toArrayBuffer:us,unmask:ds}=Q(),{isValidStatusCode:_s,isValidUTF8:ot}=V(),le=Buffer[Symbol.species],w=0,at=1,ft=2,lt=3,Ce=4,Le=5,he=6,Ne=class extends fs{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:true,this._binaryType=e.binaryType||ls[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxBufferedChunks=e.maxBufferedChunks|0,this._maxFragments=e.maxFragments|0,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[cs]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=false,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=false,this._fin=false,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._numFragments=0,this._fragments=[],this._errored=false,this._loop=false,this._state=w;}_write(e,s,r){if(this._opcode===8&&this._state==w)return r();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){r(this.createError(RangeError,"Too many buffered chunks",false,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(r);}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let r=this._buffers[0];return this._buffers[0]=new le(r.buffer,r.byteOffset+e,r.length-e),new le(r.buffer,r.byteOffset,e)}let s=Buffer.allocUnsafe(e);do{let r=this._buffers[0],i=s.length-e;e>=r.length?s.set(this._buffers.shift(),i):(s.set(new Uint8Array(r.buffer,r.byteOffset,e),i),this._buffers[0]=new le(r.buffer,r.byteOffset+e,r.length-e)),e-=r.length;}while(e>0);return s}startLoop(e){this._loop=true;do switch(this._state){case w:this.getInfo(e);break;case at:this.getPayloadLength16(e);break;case ft:this.getPayloadLength64(e);break;case lt:this.getMask();break;case Ce:this.getData(e);break;case Le:case he:this._loop=false;return}while(this._loop);this._errored||e();}getInfo(e){if(this._bufferedBytes<2){this._loop=false;return}let s=this.consume(2);if((s[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let r=(s[0]&64)===64;if(r&&!this._extensions[it.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(s[0]&128)===128,this._opcode=s[0]&15,this._payloadLength=s[1]&127,this._opcode===0){if(r){let i=this.createError(RangeError,"RSV1 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",true,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._opcode=this._fragmented;}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,true,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=r;}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",true,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(r){let i=this.createError(RangeError,"RSV1 must be clear",true,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,true,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else {let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,true,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(s[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",true,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",true,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=at:this._payloadLength===127?this._state=ft:this.haveLength(e);}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=false;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e);}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=false;return}let s=this.consume(8),r=s.readUInt32BE(0);if(r>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",false,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}this._payloadLength=r*Math.pow(2,32)+s.readUInt32BE(4),this.haveLength(e);}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let s=this.createError(RangeError,"Max payload size exceeded",false,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(s);return}this._masked?this._state=lt:this._state=Ce;}getMask(){if(this._bufferedBytes<4){this._loop=false;return}this._mask=this.consume(4),this._state=Ce;}getData(e){let s=nt;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=false;return}s=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&ds(s,this._mask);}if(this._opcode>7){this.controlMessage(s,e);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){let r=this.createError(RangeError,"Too many message fragments",false,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");e(r);return}if(this._compressed){this._state=Le,this.decompress(s,e);return}s.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(s)),this.dataMessage(e);}decompress(e,s){this._extensions[it.extensionName].decompress(e,this._fin,(i,n)=>{if(i)return s(i);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",false,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");s(o);return}this._fragments.push(n);}this.dataMessage(s),this._state===w&&this.startLoop(s);});}dataMessage(e){if(!this._fin){this._state=w;return}let s=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=ke(r,s):this._binaryType==="arraybuffer"?i=us(ke(r,s)):this._binaryType==="blob"?i=new Blob(r):i=r,this._allowSynchronousEvents?(this.emit("message",i,true),this._state=w):(this._state=he,setImmediate(()=>{this.emit("message",i,true),this._state=w,this.startLoop(e);}));}else {let i=ke(r,s);if(!this._skipUTF8Validation&&!ot(i)){let n=this.createError(Error,"invalid UTF-8 sequence",true,1007,"WS_ERR_INVALID_UTF8");e(n);return}this._state===Le||this._allowSynchronousEvents?(this.emit("message",i,false),this._state=w):(this._state=he,setImmediate(()=>{this.emit("message",i,false),this._state=w,this.startLoop(e);}));}}controlMessage(e,s){if(this._opcode===8){if(e.length===0)this._loop=false,this.emit("conclude",1005,nt),this.end();else {let r=e.readUInt16BE(0);if(!_s(r)){let n=this.createError(RangeError,`invalid status code ${r}`,true,1002,"WS_ERR_INVALID_CLOSE_CODE");s(n);return}let i=new le(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!ot(i)){let n=this.createError(Error,"invalid UTF-8 sequence",true,1007,"WS_ERR_INVALID_UTF8");s(n);return}this._loop=false,this.emit("conclude",r,i),this.end();}this._state=w;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=w):(this._state=he,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=w,this.startLoop(s);}));}createError(e,s,r,i,n){this._loop=false,this._errored=true;let o=new e(r?`Invalid WebSocket frame: ${s}`:s);return Error.captureStackTrace(o,this.createError),o.code=n,o[hs]=i,o}};ht.exports=Ne;});var Ue=chunkBUNLC3II_cjs.c((Dr,dt)=>{chunkBUNLC3II_cjs.h();var{Duplex:Ir}=chunkBUNLC3II_cjs.a("stream"),{randomFillSync:ms}=chunkBUNLC3II_cjs.a("crypto"),{types:{isUint8Array:ps}}=chunkBUNLC3II_cjs.a("util"),ct=j(),{EMPTY_BUFFER:gs,kWebSocket:ys,NOOP:xs}=C(),{isBlob:z,isValidStatusCode:Ss}=V(),{mask:ut,toBuffer:I}=Q(),O=Symbol("kByteLength"),Es=Buffer.alloc(4),ce=8*1024,D,H=ce,T=0,vs=1,bs=2,Be=class t{constructor(e,s,r){this._extensions=s||{},r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=true,this._compress=false,this._bufferedBytes=0,this._queue=[],this._state=T,this.onerror=xs,this[ys]=void 0;}static frame(e,s){let r,i=false,n=2,o=false;s.mask&&(r=s.maskBuffer||Es,s.generateMask?s.generateMask(r):(H===ce&&(D===void 0&&(D=Buffer.alloc(ce)),ms(D,0,ce),H=0),r[0]=D[H++],r[1]=D[H++],r[2]=D[H++],r[3]=D[H++]),o=(r[0]|r[1]|r[2]|r[3])===0,n=6);let f;typeof e=="string"?(!s.mask||o)&&s[O]!==void 0?f=s[O]:(e=Buffer.from(e),f=e.length):(f=e.length,i=s.mask&&s.readOnly&&!o);let l=f;f>=65536?(n+=8,l=127):f>125&&(n+=2,l=126);let a=Buffer.allocUnsafe(i?f+n:n);return a[0]=s.fin?s.opcode|128:s.opcode,s.rsv1&&(a[0]|=64),a[1]=l,l===126?a.writeUInt16BE(f,2):l===127&&(a[2]=a[3]=0,a.writeUIntBE(f,4,6)),s.mask?(a[1]|=128,a[n-4]=r[0],a[n-3]=r[1],a[n-2]=r[2],a[n-1]=r[3],o?[a,e]:i?(ut(e,r,a,n,f),[a]):(ut(e,r,e,0,f),[a,e])):[a,e]}close(e,s,r,i){let n;if(e===void 0)n=gs;else {if(typeof e!="number"||!Ss(e))throw new TypeError("First argument must be a valid error code number");if(s===void 0||!s.length)n=Buffer.allocUnsafe(2),n.writeUInt16BE(e,0);else {let f=Buffer.byteLength(s);if(f>123)throw new RangeError("The message must not be greater than 123 bytes");if(n=Buffer.allocUnsafe(2+f),n.writeUInt16BE(e,0),typeof s=="string")n.write(s,2);else if(ps(s))n.set(s,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let o={[O]:n.length,fin:true,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:false,rsv1:false};this._state!==T?this.enqueue([this.dispatch,n,false,o,i]):this.sendFrame(t.frame(n,o),i);}ping(e,s,r){let i,n;if(typeof e=="string"?(i=Buffer.byteLength(e),n=false):z(e)?(i=e.size,n=false):(e=I(e),i=e.length,n=I.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[O]:i,fin:true,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:9,readOnly:n,rsv1:false};z(e)?this._state!==T?this.enqueue([this.getBlobData,e,false,o,r]):this.getBlobData(e,false,o,r):this._state!==T?this.enqueue([this.dispatch,e,false,o,r]):this.sendFrame(t.frame(e,o),r);}pong(e,s,r){let i,n;if(typeof e=="string"?(i=Buffer.byteLength(e),n=false):z(e)?(i=e.size,n=false):(e=I(e),i=e.length,n=I.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[O]:i,fin:true,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:10,readOnly:n,rsv1:false};z(e)?this._state!==T?this.enqueue([this.getBlobData,e,false,o,r]):this.getBlobData(e,false,o,r):this._state!==T?this.enqueue([this.dispatch,e,false,o,r]):this.sendFrame(t.frame(e,o),r);}send(e,s,r){let i=this._extensions[ct.extensionName],n=s.binary?2:1,o=s.compress,f,l;typeof e=="string"?(f=Buffer.byteLength(e),l=false):z(e)?(f=e.size,l=false):(e=I(e),f=e.length,l=I.readOnly),this._firstFragment?(this._firstFragment=false,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=f>=i._threshold),this._compress=o):(o=false,n=0),s.fin&&(this._firstFragment=true);let a={[O]:f,fin:s.fin,generateMask:this._generateMask,mask:s.mask,maskBuffer:this._maskBuffer,opcode:n,readOnly:l,rsv1:o};z(e)?this._state!==T?this.enqueue([this.getBlobData,e,this._compress,a,r]):this.getBlobData(e,this._compress,a,r):this._state!==T?this.enqueue([this.dispatch,e,this._compress,a,r]):this.dispatch(e,this._compress,a,r);}getBlobData(e,s,r,i){this._bufferedBytes+=r[O],this._state=bs,e.arrayBuffer().then(n=>{if(this._socket.destroyed){let f=new Error("The socket was closed while the blob was being read");process.nextTick(Re,this,f,i);return}this._bufferedBytes-=r[O];let o=I(n);s?this.dispatch(o,s,r,i):(this._state=T,this.sendFrame(t.frame(o,r),i),this.dequeue());}).catch(n=>{process.nextTick(ws,this,n,i);});}dispatch(e,s,r,i){if(!s){this.sendFrame(t.frame(e,r),i);return}let n=this._extensions[ct.extensionName];this._bufferedBytes+=r[O],this._state=vs,n.compress(e,r.fin,(o,f)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");Re(this,l,i);return}this._bufferedBytes-=r[O],this._state=T,r.readOnly=false,this.sendFrame(t.frame(f,r),i),this.dequeue();});}dequeue(){for(;this._state===T&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][O],Reflect.apply(e[0],this,e.slice(1));}}enqueue(e){this._bufferedBytes+=e[3][O],this._queue.push(e);}sendFrame(e,s){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],s),this._socket.uncork()):this._socket.write(e[0],s);}};dt.exports=Be;function Re(t,e,s){typeof s=="function"&&s(e);for(let r=0;r<t._queue.length;r++){let i=t._queue[r],n=i[i.length-1];typeof n=="function"&&n(e);}}function ws(t,e,s){Re(t,e,s),t.onerror(e);}});var vt=chunkBUNLC3II_cjs.c((Fr,Et)=>{chunkBUNLC3II_cjs.h();var{kForOnEventAttribute:ee,kListener:Ie}=C(),_t=Symbol("kCode"),mt=Symbol("kData"),pt=Symbol("kError"),gt=Symbol("kMessage"),yt=Symbol("kReason"),Y=Symbol("kTarget"),xt=Symbol("kType"),St=Symbol("kWasClean"),N=class{constructor(e){this[Y]=null,this[xt]=e;}get target(){return this[Y]}get type(){return this[xt]}};Object.defineProperty(N.prototype,"target",{enumerable:true});Object.defineProperty(N.prototype,"type",{enumerable:true});var M=class extends N{constructor(e,s={}){super(e),this[_t]=s.code===void 0?0:s.code,this[yt]=s.reason===void 0?"":s.reason,this[St]=s.wasClean===void 0?false:s.wasClean;}get code(){return this[_t]}get reason(){return this[yt]}get wasClean(){return this[St]}};Object.defineProperty(M.prototype,"code",{enumerable:true});Object.defineProperty(M.prototype,"reason",{enumerable:true});Object.defineProperty(M.prototype,"wasClean",{enumerable:true});var K=class extends N{constructor(e,s={}){super(e),this[pt]=s.error===void 0?null:s.error,this[gt]=s.message===void 0?"":s.message;}get error(){return this[pt]}get message(){return this[gt]}};Object.defineProperty(K.prototype,"error",{enumerable:true});Object.defineProperty(K.prototype,"message",{enumerable:true});var te=class extends N{constructor(e,s={}){super(e),this[mt]=s.data===void 0?null:s.data;}get data(){return this[mt]}};Object.defineProperty(te.prototype,"data",{enumerable:true});var Os={addEventListener(t,e,s={}){for(let i of this.listeners(t))if(!s[ee]&&i[Ie]===e&&!i[ee])return;let r;if(t==="message")r=function(n,o){let f=new te("message",{data:o?n:n.toString()});f[Y]=this,ue(e,this,f);};else if(t==="close")r=function(n,o){let f=new M("close",{code:n,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});f[Y]=this,ue(e,this,f);};else if(t==="error")r=function(n){let o=new K("error",{error:n,message:n.message});o[Y]=this,ue(e,this,o);};else if(t==="open")r=function(){let n=new N("open");n[Y]=this,ue(e,this,n);};else return;r[ee]=!!s[ee],r[Ie]=e,s.once?this.once(t,r):this.on(t,r);},removeEventListener(t,e){for(let s of this.listeners(t))if(s[Ie]===e&&!s[ee]){this.removeListener(t,s);break}}};Et.exports={CloseEvent:M,ErrorEvent:K,Event:N,EventTarget:Os,MessageEvent:te};function ue(t,e,s){typeof t=="object"&&t.handleEvent?t.handleEvent.call(t,s):t.call(e,s);}});var de=chunkBUNLC3II_cjs.c((Wr,bt)=>{chunkBUNLC3II_cjs.h();var{tokenChars:se}=V();function k(t,e,s){t[e]===void 0?t[e]=[s]:t[e].push(s);}function Ts(t){let e=Object.create(null),s=Object.create(null),r=false,i=false,n=false,o,f,l=-1,a=-1,h=-1,c=0;for(;c<t.length;c++)if(a=t.charCodeAt(c),o===void 0)if(h===-1&&se[a]===1)l===-1&&(l=c);else if(c!==0&&(a===32||a===9))h===-1&&l!==-1&&(h=c);else if(a===59||a===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${c}`);h===-1&&(h=c);let y=t.slice(l,h);a===44?(k(e,y,s),s=Object.create(null)):o=y,l=h=-1;}else throw new SyntaxError(`Unexpected character at index ${c}`);else if(f===void 0)if(h===-1&&se[a]===1)l===-1&&(l=c);else if(a===32||a===9)h===-1&&l!==-1&&(h=c);else if(a===59||a===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${c}`);h===-1&&(h=c),k(s,t.slice(l,h),true),a===44&&(k(e,o,s),s=Object.create(null),o=void 0),l=h=-1;}else if(a===61&&l!==-1&&h===-1)f=t.slice(l,c),l=h=-1;else throw new SyntaxError(`Unexpected character at index ${c}`);else if(i){if(se[a]!==1)throw new SyntaxError(`Unexpected character at index ${c}`);l===-1?l=c:r||(r=true),i=false;}else if(n)if(se[a]===1)l===-1&&(l=c);else if(a===34&&l!==-1)n=false,h=c;else if(a===92)i=true;else throw new SyntaxError(`Unexpected character at index ${c}`);else if(a===34&&t.charCodeAt(c-1)===61)n=true;else if(h===-1&&se[a]===1)l===-1&&(l=c);else if(l!==-1&&(a===32||a===9))h===-1&&(h=c);else if(a===59||a===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${c}`);h===-1&&(h=c);let y=t.slice(l,h);r&&(y=y.replace(/\\/g,""),r=false),k(s,f,y),a===44&&(k(e,o,s),s=Object.create(null),o=void 0),f=void 0,l=h=-1;}else throw new SyntaxError(`Unexpected character at index ${c}`);if(l===-1||n||a===32||a===9)throw new SyntaxError("Unexpected end of input");h===-1&&(h=c);let m=t.slice(l,h);return o===void 0?k(e,m,s):(f===void 0?k(s,m,true):r?k(s,f,m.replace(/\\/g,"")):k(s,f,m),k(e,o,s)),e}function ks(t){return Object.keys(t).map(e=>{let s=t[e];return Array.isArray(s)||(s=[s]),s.map(r=>[e].concat(Object.keys(r).map(i=>{let n=r[i];return Array.isArray(n)||(n=[n]),n.map(o=>o===true?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}bt.exports={format:ks,parse:Ts};});var ge=chunkBUNLC3II_cjs.c((jr,It)=>{chunkBUNLC3II_cjs.h();var Cs=chunkBUNLC3II_cjs.a("events"),Ls=chunkBUNLC3II_cjs.a("https"),Ns=chunkBUNLC3II_cjs.a("http"),Tt=chunkBUNLC3II_cjs.a("net"),Ps=chunkBUNLC3II_cjs.a("tls"),{randomBytes:Bs,createHash:Rs}=chunkBUNLC3II_cjs.a("crypto"),{Duplex:Gr,Readable:$r}=chunkBUNLC3II_cjs.a("stream"),{URL:De}=chunkBUNLC3II_cjs.a("url"),U=j(),Us=Pe(),Is=Ue(),{isBlob:Ds}=V(),{BINARY_TYPES:wt,CLOSE_TIMEOUT:Ms,EMPTY_BUFFER:_e,GUID:Fs,kForOnEventAttribute:Me,kListener:As,kStatusCode:Ws,kWebSocket:x,NOOP:kt}=C(),{EventTarget:{addEventListener:qs,removeEventListener:Gs}}=vt(),{format:$s,parse:js}=de(),{toBuffer:Vs}=Q(),Ct=Symbol("kAborted"),Fe=[8,13],P=["CONNECTING","OPEN","CLOSING","CLOSED"],zs=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,_=class t extends Cs{constructor(e,s,r){super(),this._binaryType=wt[0],this._closeCode=1006,this._closeFrameReceived=false,this._closeFrameSent=false,this._closeMessage=_e,this._closeTimer=null,this._errorEmitted=false,this._extensions={},this._paused=false,this._protocol="",this._readyState=t.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=false,this._redirects=0,s===void 0?s=[]:Array.isArray(s)||(typeof s=="object"&&s!==null?(r=s,s=[]):s=[s]),Lt(this,e,s,r)):(this._autoPong=r.autoPong,this._closeTimeout=r.closeTimeout,this._isServer=true);}get binaryType(){return this._binaryType}set binaryType(e){wt.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e));}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,s,r){let i=new Us({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:r.maxBufferedChunks,maxFragments:r.maxFragments,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation}),n=new Is(e,this._extensions,r.generateMask);this._receiver=i,this._sender=n,this._socket=e,i[x]=this,n[x]=this,e[x]=this,i.on("conclude",Ks),i.on("drain",Xs),i.on("error",Zs),i.on("message",Qs),i.on("ping",Js),i.on("pong",er),n.onerror=tr,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),s.length>0&&e.unshift(s),e.on("close",Bt),e.on("data",pe),e.on("end",Rt),e.on("error",Ut),this._readyState=t.OPEN,this.emit("open");}emitClose(){if(!this._socket){this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[U.extensionName]&&this._extensions[U.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage);}close(e,s){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){b(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===t.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=t.CLOSING,this._sender.close(e,s,!this._isServer,r=>{r||(this._closeFrameSent=true,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end());}),Pt(this);}}pause(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=true,this._socket.pause());}ping(e,s,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=s=void 0):typeof s=="function"&&(r=s,s=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Ae(this,e,r);return}s===void 0&&(s=!this._isServer),this._sender.ping(e||_e,s,r);}pong(e,s,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=s=void 0):typeof s=="function"&&(r=s,s=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Ae(this,e,r);return}s===void 0&&(s=!this._isServer),this._sender.pong(e||_e,s,r);}resume(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=false,this._receiver._writableState.needDrain||this._socket.resume());}send(e,s,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof s=="function"&&(r=s,s={}),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Ae(this,e,r);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:true,fin:true,...s};this._extensions[U.extensionName]||(i.compress=false),this._sender.send(e||_e,i,r);}terminate(){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){b(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=t.CLOSING,this._socket.destroy());}}};Object.defineProperty(_,"CONNECTING",{enumerable:true,value:P.indexOf("CONNECTING")});Object.defineProperty(_.prototype,"CONNECTING",{enumerable:true,value:P.indexOf("CONNECTING")});Object.defineProperty(_,"OPEN",{enumerable:true,value:P.indexOf("OPEN")});Object.defineProperty(_.prototype,"OPEN",{enumerable:true,value:P.indexOf("OPEN")});Object.defineProperty(_,"CLOSING",{enumerable:true,value:P.indexOf("CLOSING")});Object.defineProperty(_.prototype,"CLOSING",{enumerable:true,value:P.indexOf("CLOSING")});Object.defineProperty(_,"CLOSED",{enumerable:true,value:P.indexOf("CLOSED")});Object.defineProperty(_.prototype,"CLOSED",{enumerable:true,value:P.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(t=>{Object.defineProperty(_.prototype,t,{enumerable:true});});["open","error","close","message"].forEach(t=>{Object.defineProperty(_.prototype,`on${t}`,{enumerable:true,get(){for(let e of this.listeners(t))if(e[Me])return e[As];return null},set(e){for(let s of this.listeners(t))if(s[Me]){this.removeListener(t,s);break}typeof e=="function"&&this.addEventListener(t,e,{[Me]:true});}});});_.prototype.addEventListener=qs;_.prototype.removeEventListener=Gs;It.exports=_;function Lt(t,e,s,r){let i={allowSynchronousEvents:true,autoPong:true,closeTimeout:Ms,protocolVersion:Fe[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:false,perMessageDeflate:true,followRedirects:false,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(t._autoPong=i.autoPong,t._closeTimeout=i.closeTimeout,!Fe.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Fe.join(", ")})`);let n;if(e instanceof De)n=e;else try{n=new De(e);}catch{throw new SyntaxError(`Invalid URL: ${e}`)}n.protocol==="http:"?n.protocol="ws:":n.protocol==="https:"&&(n.protocol="wss:"),t._url=n.href;let o=n.protocol==="wss:",f=n.protocol==="ws+unix:",l;if(n.protocol!=="ws:"&&!o&&!f?l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:f&&!n.pathname?l="The URL's pathname is empty":n.hash&&(l="The URL contains a fragment identifier"),l){let u=new SyntaxError(l);if(t._redirects===0)throw u;me(t,u);return}let a=o?443:80,h=Bs(16).toString("base64"),c=o?Ls.request:Ns.request,m=new Set,y;if(i.createConnection=i.createConnection||(o?Ys:Hs),i.defaultPort=i.defaultPort||a,i.port=n.port||a,i.host=n.hostname.startsWith("[")?n.hostname.slice(1,-1):n.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":h,Connection:"Upgrade",Upgrade:"websocket"},i.path=n.pathname+n.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(y=new U({...i.perMessageDeflate,isServer:false,maxPayload:i.maxPayload}),i.headers["Sec-WebSocket-Extensions"]=$s({[U.extensionName]:y.offer()})),s.length){for(let u of s){if(typeof u!="string"||!zs.test(u)||m.has(u))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(u);}i.headers["Sec-WebSocket-Protocol"]=s.join(",");}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(n.username||n.password)&&(i.auth=`${n.username}:${n.password}`),f){let u=i.path.split(":");i.socketPath=u[0],i.path=u[1];}let p;if(i.followRedirects){if(t._redirects===0){t._originalIpc=f,t._originalSecure=o,t._originalHostOrSocketPath=f?i.socketPath:n.host;let u=r&&r.headers;if(r={...r,headers:{}},u)for(let[S,W]of Object.entries(u))r.headers[S.toLowerCase()]=W;}else if(t.listenerCount("redirect")===0){let u=f?t._originalIpc?i.socketPath===t._originalHostOrSocketPath:false:t._originalIpc?false:n.host===t._originalHostOrSocketPath;(!u||t._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,u||delete i.headers.host,i.auth=void 0);}i.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),p=t._req=c(i),t._redirects&&t.emit("redirect",t.url,p);}else p=t._req=c(i);i.timeout&&p.on("timeout",()=>{b(t,p,"Opening handshake has timed out");}),p.on("error",u=>{p===null||p[Ct]||(p=t._req=null,me(t,u));}),p.on("response",u=>{let S=u.headers.location,W=u.statusCode;if(S&&i.followRedirects&&W>=300&&W<400){if(++t._redirects>i.maxRedirects){b(t,p,"Maximum redirects exceeded");return}p.abort();let X;try{X=new De(S,e);}catch{let q=new SyntaxError(`Invalid URL: ${S}`);me(t,q);return}Lt(t,X,s,r);}else t.emit("unexpected-response",p,u)||b(t,p,`Unexpected server response: ${u.statusCode}`);}),p.on("upgrade",(u,S,W)=>{if(t.emit("upgrade",u),t.readyState!==_.CONNECTING)return;p=t._req=null;let X=u.headers.upgrade;if(X===void 0||X.toLowerCase()!=="websocket"){b(t,S,"Invalid Upgrade header");return}let Ge=Rs("sha1").update(h+Fs).digest("base64");if(u.headers["sec-websocket-accept"]!==Ge){b(t,S,"Invalid Sec-WebSocket-Accept header");return}let q=u.headers["sec-websocket-protocol"],Z;if(q!==void 0?m.size?m.has(q)||(Z="Server sent an invalid subprotocol"):Z="Server sent a subprotocol but none was requested":m.size&&(Z="Server sent no subprotocol"),Z){b(t,S,Z);return}q&&(t._protocol=q);let $e=u.headers["sec-websocket-extensions"];if($e!==void 0){if(!y){b(t,S,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let xe;try{xe=js($e);}catch{b(t,S,"Invalid Sec-WebSocket-Extensions header");return}let je=Object.keys(xe);if(je.length!==1||je[0]!==U.extensionName){b(t,S,"Server indicated an extension that was not requested");return}try{y.accept(xe[U.extensionName]);}catch{b(t,S,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[U.extensionName]=y;}t.setSocket(S,W,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxBufferedChunks:i.maxBufferedChunks,maxFragments:i.maxFragments,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation});}),i.finishRequest?i.finishRequest(p,t):p.end();}function me(t,e){t._readyState=_.CLOSING,t._errorEmitted=true,t.emit("error",e),t.emitClose();}function Hs(t){return t.path=t.socketPath,Tt.connect(t)}function Ys(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=Tt.isIP(t.host)?"":t.host),Ps.connect(t)}function b(t,e,s){t._readyState=_.CLOSING;let r=new Error(s);Error.captureStackTrace(r,b),e.setHeader?(e[Ct]=true,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(me,t,r)):(e.destroy(r),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)));}function Ae(t,e,s){if(e){let r=Ds(e)?e.size:Vs(e).length;t._socket?t._sender._bufferedBytes+=r:t._bufferedAmount+=r;}if(s){let r=new Error(`WebSocket is not open: readyState ${t.readyState} (${P[t.readyState]})`);process.nextTick(s,r);}}function Ks(t,e){let s=this[x];s._closeFrameReceived=true,s._closeMessage=e,s._closeCode=t,s._socket[x]!==void 0&&(s._socket.removeListener("data",pe),process.nextTick(Nt,s._socket),t===1005?s.close():s.close(t,e));}function Xs(){let t=this[x];t.isPaused||t._socket.resume();}function Zs(t){let e=this[x];e._socket[x]!==void 0&&(e._socket.removeListener("data",pe),process.nextTick(Nt,e._socket),e.close(t[Ws])),e._errorEmitted||(e._errorEmitted=true,e.emit("error",t));}function Ot(){this[x].emitClose();}function Qs(t,e){this[x].emit("message",t,e);}function Js(t){let e=this[x];e._autoPong&&e.pong(t,!this._isServer,kt),e.emit("ping",t);}function er(t){this[x].emit("pong",t);}function Nt(t){t.resume();}function tr(t){let e=this[x];e.readyState!==_.CLOSED&&(e.readyState===_.OPEN&&(e._readyState=_.CLOSING,Pt(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=true,e.emit("error",t)));}function Pt(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),t._closeTimeout);}function Bt(){let t=this[x];if(this.removeListener("close",Bt),this.removeListener("data",pe),this.removeListener("end",Rt),t._readyState=_.CLOSING,!this._readableState.endEmitted&&!t._closeFrameReceived&&!t._receiver._writableState.errorEmitted&&this._readableState.length!==0){let e=this.read(this._readableState.length);t._receiver.write(e);}t._receiver.end(),this[x]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",Ot),t._receiver.on("finish",Ot));}function pe(t){this[x]._receiver.write(t)||this.pause();}function Rt(){let t=this[x];t._readyState=_.CLOSING,t._receiver.end(),this.end();}function Ut(){let t=this[x];this.removeListener("error",Ut),this.on("error",kt),t&&(t._readyState=_.CLOSING,this.destroy());}});var At=chunkBUNLC3II_cjs.c((Hr,Ft)=>{chunkBUNLC3II_cjs.h();ge();var {Duplex:sr}=chunkBUNLC3II_cjs.a("stream");function Dt(t){t.emit("close");}function rr(){!this.destroyed&&this._writableState.finished&&this.destroy();}function Mt(t){this.removeListener("error",Mt),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t);}function ir(t,e){let s=true,r=new sr({...e,autoDestroy:false,emitClose:false,objectMode:false,writableObjectMode:false});return t.on("message",function(n,o){let f=!o&&r._readableState.objectMode?n.toString():n;r.push(f)||t.pause();}),t.once("error",function(n){r.destroyed||(s=false,r.destroy(n));}),t.once("close",function(){r.destroyed||r.push(null);}),r._destroy=function(i,n){if(t.readyState===t.CLOSED){n(i),process.nextTick(Dt,r);return}let o=false;t.once("error",function(l){o=true,n(l);}),t.once("close",function(){o||n(i),process.nextTick(Dt,r);}),s&&t.terminate();},r._final=function(i){if(t.readyState===t.CONNECTING){t.once("open",function(){r._final(i);});return}t._socket!==null&&(t._socket._writableState.finished?(i(),r._readableState.endEmitted&&r.destroy()):(t._socket.once("finish",function(){i();}),t.close()));},r._read=function(){t.isPaused&&t.resume();},r._write=function(i,n,o){if(t.readyState===t.CONNECTING){t.once("open",function(){r._write(i,n,o);});return}t.send(i,o);},r.on("end",rr),r.on("error",Mt),r}Ft.exports=ir;});var We=chunkBUNLC3II_cjs.c((Kr,Wt)=>{chunkBUNLC3II_cjs.h();var{tokenChars:nr}=V();function or(t){let e=new Set,s=-1,r=-1,i=0;for(i;i<t.length;i++){let o=t.charCodeAt(i);if(r===-1&&nr[o]===1)s===-1&&(s=i);else if(i!==0&&(o===32||o===9))r===-1&&s!==-1&&(r=i);else if(o===44){if(s===-1)throw new SyntaxError(`Unexpected character at index ${i}`);r===-1&&(r=i);let f=t.slice(s,r);if(e.has(f))throw new SyntaxError(`The "${f}" subprotocol is duplicated`);e.add(f),s=r=-1;}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(s===-1||r!==-1)throw new SyntaxError("Unexpected end of input");let n=t.slice(s,i);if(e.has(n))throw new SyntaxError(`The "${n}" subprotocol is duplicated`);return e.add(n),e}Wt.exports={parse:or};});var Ht=chunkBUNLC3II_cjs.c((Qr,zt)=>{chunkBUNLC3II_cjs.h();var ar=chunkBUNLC3II_cjs.a("events"),ye=chunkBUNLC3II_cjs.a("http"),{Duplex:Zr}=chunkBUNLC3II_cjs.a("stream"),{createHash:fr}=chunkBUNLC3II_cjs.a("crypto"),qt=de(),F=j(),lr=We(),hr=ge(),{CLOSE_TIMEOUT:cr,GUID:ur,kWebSocket:dr}=C(),_r=/^[+/0-9A-Za-z]{22}==$/,Gt=0,$t=1,Vt=2,qe=class extends ar{constructor(e,s){if(super(),e={allowSynchronousEvents:true,autoPong:true,maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*1024,skipUTF8Validation:false,perMessageDeflate:false,handleProtocols:null,clientTracking:true,closeTimeout:cr,verifyClient:null,noServer:false,backlog:null,server:null,host:null,path:null,port:null,WebSocket:hr,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=ye.createServer((r,i)=>{let n=ye.STATUS_CODES[426];i.writeHead(426,{"Content-Length":n.length,"Content-Type":"text/plain"}),i.end(n);}),this._server.listen(e.port,e.host,e.backlog,s)):e.server&&(this._server=e.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=mr(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,n,o)=>{this.handleUpgrade(i,n,o,r);}});}e.perMessageDeflate===true&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=false),this.options=e,this._state=Gt;}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===Vt){e&&this.once("close",()=>{e(new Error("The server is not running"));}),process.nextTick(re,this);return}if(e&&this.once("close",e),this._state!==$t)if(this._state=$t,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=true:process.nextTick(re,this):process.nextTick(re,this);else {let s=this._server;this._removeListeners(),this._removeListeners=this._server=null,s.close(()=>{re(this);});}}shouldHandle(e){if(this.options.path){let s=e.url.indexOf("?");if((s!==-1?e.url.slice(0,s):e.url)!==this.options.path)return false}return true}handleUpgrade(e,s,r,i){s.on("error",jt);let n=e.headers["sec-websocket-key"],o=e.headers.upgrade,f=+e.headers["sec-websocket-version"];if(e.method!=="GET"){A(this,e,s,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){A(this,e,s,400,"Invalid Upgrade header");return}if(n===void 0||!_r.test(n)){A(this,e,s,400,"Missing or invalid Sec-WebSocket-Key header");return}if(f!==13&&f!==8){A(this,e,s,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){ie(s,400);return}let l=e.headers["sec-websocket-protocol"],a=new Set;if(l!==void 0)try{a=lr.parse(l);}catch{A(this,e,s,400,"Invalid Sec-WebSocket-Protocol header");return}let h=e.headers["sec-websocket-extensions"],c={};if(this.options.perMessageDeflate&&h!==void 0){let m=new F({...this.options.perMessageDeflate,isServer:true,maxPayload:this.options.maxPayload});try{let y=qt.parse(h);y[F.extensionName]&&(m.accept(y[F.extensionName]),c[F.extensionName]=m);}catch{A(this,e,s,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:e.headers[`${f===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(y,p,u,S)=>{if(!y)return ie(s,p||401,u,S);this.completeUpgrade(c,n,a,e,s,r,i);});return}if(!this.options.verifyClient(m))return ie(s,401)}this.completeUpgrade(c,n,a,e,s,r,i);}completeUpgrade(e,s,r,i,n,o,f){if(!n.readable||!n.writable)return n.destroy();if(n[dr])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Gt)return ie(n,503);let a=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${fr("sha1").update(s+ur).digest("base64")}`],h=new this.options.WebSocket(null,void 0,this.options);if(r.size){let c=this.options.handleProtocols?this.options.handleProtocols(r,i):r.values().next().value;c&&(a.push(`Sec-WebSocket-Protocol: ${c}`),h._protocol=c);}if(e[F.extensionName]){let c=e[F.extensionName].params,m=qt.format({[F.extensionName]:[c]});a.push(`Sec-WebSocket-Extensions: ${m}`),h._extensions=e;}this.emit("headers",a,i),n.write(a.concat(`\r
|
|
2
|
+
`).join(`\r
|
|
3
|
+
`)),n.removeListener("error",jt),h.setSocket(n,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(h),h.on("close",()=>{this.clients.delete(h),this._shouldEmitClose&&!this.clients.size&&process.nextTick(re,this);})),f(h,i);}};zt.exports=qe;function mr(t,e){for(let s of Object.keys(e))t.on(s,e[s]);return function(){for(let r of Object.keys(e))t.removeListener(r,e[r]);}}function re(t){t._state=Vt,t.emit("close");}function jt(){this.destroy();}function ie(t,e,s,r){s=s||ye.STATUS_CODES[e],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(s),...r},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${e} ${ye.STATUS_CODES[e]}\r
|
|
4
|
+
`+Object.keys(r).map(i=>`${i}: ${r[i]}`).join(`\r
|
|
5
|
+
`)+`\r
|
|
6
|
+
\r
|
|
7
|
+
`+s);}function A(t,e,s,r,i,n){if(t.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,A),t.emit("wsClientError",o,s,e);}else ie(s,r,i,n);}});chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.e(At(),1);chunkBUNLC3II_cjs.e(de(),1);chunkBUNLC3II_cjs.e(j(),1);chunkBUNLC3II_cjs.e(Pe(),1);chunkBUNLC3II_cjs.e(Ue(),1);chunkBUNLC3II_cjs.e(We(),1);var Yt=chunkBUNLC3II_cjs.e(ge(),1),vr=chunkBUNLC3II_cjs.e(Ht(),1);var ei=Yt.default;exports.a=Yt;exports.b=vr;exports.c=ei;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';var chunkGNOSG3PK_cjs=require('./chunk-GNOSG3PK.cjs'),chunkBCEE4NBZ_cjs=require('./chunk-BCEE4NBZ.cjs'),chunkVRZC4TTF_cjs=require('./chunk-VRZC4TTF.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var W=class{static[chunkVRZC4TTF_cjs.a]="SQLiteForeignKeyBuilder";reference;_onUpdate;_onDelete;constructor(e,t){this.reference=()=>{let{name:n,columns:s,foreignColumns:o}=e();return {name:n,columns:s,foreignTable:o[0].table,foreignColumns:o}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete);}onUpdate(e){return this._onUpdate=e,this}onDelete(e){return this._onDelete=e,this}build(e){return new ne(e,this)}},ne=class{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete;}static[chunkVRZC4TTF_cjs.a]="SQLiteForeignKey";reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:n}=this.reference(),s=t.map(r=>r.name),o=n.map(r=>r.name),u=[this.table[chunkVRZC4TTF_cjs.f],...s,n[0].table[chunkVRZC4TTF_cjs.f],...o];return e??`${u.join("_")}_fk`}};chunkBUNLC3II_cjs.h();function se(a,e){return `${a[chunkVRZC4TTF_cjs.f]}_${e.join("_")}_unique`}var q=class extends chunkVRZC4TTF_cjs.e{static[chunkVRZC4TTF_cjs.a]="SQLiteColumnBuilder";foreignKeyConfigs=[];references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e){return this.config.isUnique=true,this.config.uniqueName=e,this}generatedAlwaysAs(e,t){return this.config.generated={as:e,type:"always",mode:t?.mode??"virtual"},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:n,actions:s})=>((o,u)=>{let r=new W(()=>{let c=o();return {columns:[e],foreignColumns:[c]}});return u.onUpdate&&r.onUpdate(u.onUpdate),u.onDelete&&r.onDelete(u.onDelete),r.build(t)})(n,s))}},S=class extends chunkVRZC4TTF_cjs.d{constructor(e,t){t.uniqueName||(t.uniqueName=se(e,[t.name])),super(e,t),this.table=e;}static[chunkVRZC4TTF_cjs.a]="SQLiteColumn"};var z=class extends q{static[chunkVRZC4TTF_cjs.a]="SQLiteBaseIntegerBuilder";constructor(e,t,n){super(e,t,n),this.config.autoIncrement=false;}primaryKey(e){return e?.autoIncrement&&(this.config.autoIncrement=true),this.config.hasDefault=true,super.primaryKey()}},k=class extends S{static[chunkVRZC4TTF_cjs.a]="SQLiteBaseInteger";autoIncrement=this.config.autoIncrement;getSQLType(){return "integer"}},ue=class extends z{static[chunkVRZC4TTF_cjs.a]="SQLiteIntegerBuilder";constructor(e){super(e,"number","SQLiteInteger");}build(e){return new ae(e,this.config)}},ae=class extends k{static[chunkVRZC4TTF_cjs.a]="SQLiteInteger"},le=class extends z{static[chunkVRZC4TTF_cjs.a]="SQLiteTimestampBuilder";constructor(e,t){super(e,"date","SQLiteTimestamp"),this.config.mode=t;}defaultNow(){return this.default(chunkVRZC4TTF_cjs.J`(cast((julianday('now') - 2440587.5)*86400000 as integer))`)}build(e){return new me(e,this.config)}},me=class extends k{static[chunkVRZC4TTF_cjs.a]="SQLiteTimestamp";mode=this.config.mode;mapFromDriverValue(e){return this.config.mode==="timestamp"?new Date(e*1e3):new Date(e)}mapToDriverValue(e){let t=e.getTime();return this.config.mode==="timestamp"?Math.floor(t/1e3):t}},ce=class extends z{static[chunkVRZC4TTF_cjs.a]="SQLiteBooleanBuilder";constructor(e,t){super(e,"boolean","SQLiteBoolean"),this.config.mode=t;}build(e){return new fe(e,this.config)}},fe=class extends k{static[chunkVRZC4TTF_cjs.a]="SQLiteBoolean";mode=this.config.mode;mapFromDriverValue(e){return Number(e)===1}mapToDriverValue(e){return e?1:0}};function Xe(a,e){let{name:t,config:n}=chunkVRZC4TTF_cjs.Y(a,e);return n?.mode==="timestamp"||n?.mode==="timestamp_ms"?new le(t,n.mode):n?.mode==="boolean"?new ce(t,n.mode):new ue(t)}chunkBUNLC3II_cjs.h();var de=class extends q{static[chunkVRZC4TTF_cjs.a]="SQLiteNumericBuilder";constructor(e){super(e,"string","SQLiteNumeric");}build(e){return new pe(e,this.config)}},pe=class extends S{static[chunkVRZC4TTF_cjs.a]="SQLiteNumeric";mapFromDriverValue(e){return typeof e=="string"?e:String(e)}getSQLType(){return "numeric"}},he=class extends q{static[chunkVRZC4TTF_cjs.a]="SQLiteNumericNumberBuilder";constructor(e){super(e,"number","SQLiteNumericNumber");}build(e){return new ge(e,this.config)}},ge=class extends S{static[chunkVRZC4TTF_cjs.a]="SQLiteNumericNumber";mapFromDriverValue(e){return typeof e=="number"?e:Number(e)}mapToDriverValue=String;getSQLType(){return "numeric"}},ye=class extends q{static[chunkVRZC4TTF_cjs.a]="SQLiteNumericBigIntBuilder";constructor(e){super(e,"bigint","SQLiteNumericBigInt");}build(e){return new be(e,this.config)}},be=class extends S{static[chunkVRZC4TTF_cjs.a]="SQLiteNumericBigInt";mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return "numeric"}};function Ge(a,e){let{name:t,config:n}=chunkVRZC4TTF_cjs.Y(a,e),s=n?.mode;return s==="number"?new he(t):s==="bigint"?new ye(t):new de(t)}chunkBUNLC3II_cjs.h();var Se=class extends q{static[chunkVRZC4TTF_cjs.a]="SQLiteTextBuilder";constructor(e,t){super(e,"string","SQLiteText"),this.config.enumValues=t.enum,this.config.length=t.length;}build(e){return new $e(e,this.config)}},$e=class extends S{static[chunkVRZC4TTF_cjs.a]="SQLiteText";enumValues=this.config.enumValues;length=this.config.length;constructor(e,t){super(e,t);}getSQLType(){return `text${this.config.length?`(${this.config.length})`:""}`}},Te=class extends q{static[chunkVRZC4TTF_cjs.a]="SQLiteTextJsonBuilder";constructor(e){super(e,"json","SQLiteTextJson");}build(e){return new Ce(e,this.config)}},Ce=class extends S{static[chunkVRZC4TTF_cjs.a]="SQLiteTextJson";getSQLType(){return "text"}mapFromDriverValue(e){return JSON.parse(e)}mapToDriverValue(e){return JSON.stringify(e)}};function He(a,e={}){let{name:t,config:n}=chunkVRZC4TTF_cjs.Y(a,e);return n.mode==="json"?new Te(t):new Se(t,n)}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var we=class extends q{static[chunkVRZC4TTF_cjs.a]="SQLiteBigIntBuilder";constructor(e){super(e,"bigint","SQLiteBigInt");}build(e){return new Le(e,this.config)}},Le=class extends S{static[chunkVRZC4TTF_cjs.a]="SQLiteBigInt";getSQLType(){return "blob"}mapFromDriverValue(e){if(typeof Buffer<"u"&&Buffer.from){let t=Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e);return BigInt(t.toString("utf8"))}return BigInt(chunkVRZC4TTF_cjs._.decode(e))}mapToDriverValue(e){return Buffer.from(e.toString())}},qe=class extends q{static[chunkVRZC4TTF_cjs.a]="SQLiteBlobJsonBuilder";constructor(e){super(e,"json","SQLiteBlobJson");}build(e){return new xe(e,this.config)}},xe=class extends S{static[chunkVRZC4TTF_cjs.a]="SQLiteBlobJson";getSQLType(){return "blob"}mapFromDriverValue(e){if(typeof Buffer<"u"&&Buffer.from){let t=Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e);return JSON.parse(t.toString("utf8"))}return JSON.parse(chunkVRZC4TTF_cjs._.decode(e))}mapToDriverValue(e){return Buffer.from(JSON.stringify(e))}},Qe=class extends q{static[chunkVRZC4TTF_cjs.a]="SQLiteBlobBufferBuilder";constructor(e){super(e,"buffer","SQLiteBlobBuffer");}build(e){return new Be(e,this.config)}},Be=class extends S{static[chunkVRZC4TTF_cjs.a]="SQLiteBlobBuffer";mapFromDriverValue(e){return Buffer.isBuffer(e)?e:Buffer.from(e)}getSQLType(){return "blob"}};function Ze(a,e){let{name:t,config:n}=chunkVRZC4TTF_cjs.Y(a,e);return n?.mode==="json"?new qe(t):n?.mode==="bigint"?new we(t):new Qe(t)}chunkBUNLC3II_cjs.h();var Ne=class extends q{static[chunkVRZC4TTF_cjs.a]="SQLiteCustomColumnBuilder";constructor(e,t,n){super(e,"custom","SQLiteCustomColumn"),this.config.fieldConfig=t,this.config.customTypeParams=n;}build(e){return new Oe(e,this.config)}},Oe=class extends S{static[chunkVRZC4TTF_cjs.a]="SQLiteCustomColumn";sqlName;mapTo;mapFrom;constructor(e,t){super(e,t),this.sqlName=t.customTypeParams.dataType(t.fieldConfig),this.mapTo=t.customTypeParams.toDriver,this.mapFrom=t.customTypeParams.fromDriver;}getSQLType(){return this.sqlName}mapFromDriverValue(e){return typeof this.mapFrom=="function"?this.mapFrom(e):e}mapToDriverValue(e){return typeof this.mapTo=="function"?this.mapTo(e):e}};function et(a){return (e,t)=>{let{name:n,config:s}=chunkVRZC4TTF_cjs.Y(e,t);return new Ne(n,s,a)}}chunkBUNLC3II_cjs.h();var ve=class extends q{static[chunkVRZC4TTF_cjs.a]="SQLiteRealBuilder";constructor(e){super(e,"number","SQLiteReal");}build(e){return new _e(e,this.config)}},_e=class extends S{static[chunkVRZC4TTF_cjs.a]="SQLiteReal";getSQLType(){return "real"}};function tt(a){return new ve(a??"")}function it(){return {blob:Ze,customType:et,integer:Xe,numeric:Ge,real:tt,text:He}}var De=Symbol.for("drizzle:SQLiteInlineForeignKeys"),I=class extends chunkVRZC4TTF_cjs.t{static[chunkVRZC4TTF_cjs.a]="SQLiteTable";static Symbol=Object.assign({},chunkVRZC4TTF_cjs.t.Symbol,{InlineForeignKeys:De});[chunkVRZC4TTF_cjs.t.Symbol.Columns];[De]=[];[chunkVRZC4TTF_cjs.t.Symbol.ExtraConfigBuilder]=void 0};function at(a,e,t,n,s=a){let o=new I(a,n,s),u=typeof e=="function"?e(it()):e,r=Object.fromEntries(Object.entries(u).map(([f,p])=>{let $=p;$.setName(f);let x=$.build(o);return o[De].push(...$.buildForeignKeys(x,o)),[f,x]})),c=Object.assign(o,r);return c[chunkVRZC4TTF_cjs.t.Symbol.Columns]=r,c[chunkVRZC4TTF_cjs.t.Symbol.ExtraConfigColumns]=r,t&&(c[I.Symbol.ExtraConfigBuilder]=t),c}var ci=(a,e,t)=>at(a,e,t);chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var X=class extends chunkVRZC4TTF_cjs.N{static[chunkVRZC4TTF_cjs.a]="SQLiteViewBase"};var G=class{static[chunkVRZC4TTF_cjs.a]="SQLiteDialect";casing;constructor(e){this.casing=new chunkGNOSG3PK_cjs.b(e?.casing);}escapeName(e){return `"${e}"`}escapeParam(e){return "?"}escapeString(e){return `'${e.replace(/'/g,"''")}'`}buildWithCTE(e){if(!e?.length)return;let t=[chunkVRZC4TTF_cjs.J`with `];for(let[n,s]of e.entries())t.push(chunkVRZC4TTF_cjs.J`${chunkVRZC4TTF_cjs.J.identifier(s._.alias)} as (${s._.sql})`),n<e.length-1&&t.push(chunkVRZC4TTF_cjs.J`, `);return t.push(chunkVRZC4TTF_cjs.J` `),chunkVRZC4TTF_cjs.J.join(t)}buildDeleteQuery({table:e,where:t,returning:n,withList:s,limit:o,orderBy:u}){let r=this.buildWithCTE(s),c=n?chunkVRZC4TTF_cjs.J` returning ${this.buildSelection(n,{isSingleTable:true})}`:void 0,f=t?chunkVRZC4TTF_cjs.J` where ${t}`:void 0,p=this.buildOrderBy(u),$=this.buildLimit(o);return chunkVRZC4TTF_cjs.J`${r}delete from ${e}${f}${c}${p}${$}`}buildUpdateSet(e,t){let n=e[chunkVRZC4TTF_cjs.t.Symbol.Columns],s=Object.keys(n).filter(u=>t[u]!==void 0||n[u]?.onUpdateFn!==void 0),o=s.length;return chunkVRZC4TTF_cjs.J.join(s.flatMap((u,r)=>{let c=n[u],f=t[u]??chunkVRZC4TTF_cjs.J.param(c.onUpdateFn(),c),p=chunkVRZC4TTF_cjs.J`${chunkVRZC4TTF_cjs.J.identifier(this.casing.getColumnCasing(c))} = ${f}`;return r<o-1?[p,chunkVRZC4TTF_cjs.J.raw(", ")]:[p]}))}buildUpdateQuery({table:e,set:t,where:n,returning:s,withList:o,joins:u,from:r,limit:c,orderBy:f}){let p=this.buildWithCTE(o),$=this.buildUpdateSet(e,t),x=r&&chunkVRZC4TTF_cjs.J.join([chunkVRZC4TTF_cjs.J.raw(" from "),this.buildFromTable(r)]),Q=this.buildJoins(u),w=s?chunkVRZC4TTF_cjs.J` returning ${this.buildSelection(s,{isSingleTable:true})}`:void 0,b=n?chunkVRZC4TTF_cjs.J` where ${n}`:void 0,T=this.buildOrderBy(f),C=this.buildLimit(c);return chunkVRZC4TTF_cjs.J`${p}update ${e} set ${$}${x}${Q}${b}${w}${T}${C}`}buildSelection(e,{isSingleTable:t=false}={}){let n=e.length,s=e.flatMap(({field:o},u)=>{let r=[];if(chunkVRZC4TTF_cjs.c(o,chunkVRZC4TTF_cjs.A.Aliased)&&o.isSelectionField)r.push(chunkVRZC4TTF_cjs.J.identifier(o.fieldAlias));else if(chunkVRZC4TTF_cjs.c(o,chunkVRZC4TTF_cjs.A.Aliased)||chunkVRZC4TTF_cjs.c(o,chunkVRZC4TTF_cjs.A)){let c=chunkVRZC4TTF_cjs.c(o,chunkVRZC4TTF_cjs.A.Aliased)?o.sql:o;t?r.push(new chunkVRZC4TTF_cjs.A(c.queryChunks.map(f=>chunkVRZC4TTF_cjs.c(f,chunkVRZC4TTF_cjs.d)?chunkVRZC4TTF_cjs.J.identifier(this.casing.getColumnCasing(f)):f))):r.push(c),chunkVRZC4TTF_cjs.c(o,chunkVRZC4TTF_cjs.A.Aliased)&&r.push(chunkVRZC4TTF_cjs.J` as ${chunkVRZC4TTF_cjs.J.identifier(o.fieldAlias)}`);}else if(chunkVRZC4TTF_cjs.c(o,chunkVRZC4TTF_cjs.d)){let c=o.table[chunkVRZC4TTF_cjs.t.Symbol.Name];o.columnType==="SQLiteNumericBigInt"?t?r.push(chunkVRZC4TTF_cjs.J`cast(${chunkVRZC4TTF_cjs.J.identifier(this.casing.getColumnCasing(o))} as text)`):r.push(chunkVRZC4TTF_cjs.J`cast(${chunkVRZC4TTF_cjs.J.identifier(c)}.${chunkVRZC4TTF_cjs.J.identifier(this.casing.getColumnCasing(o))} as text)`):t?r.push(chunkVRZC4TTF_cjs.J.identifier(this.casing.getColumnCasing(o))):r.push(chunkVRZC4TTF_cjs.J`${chunkVRZC4TTF_cjs.J.identifier(c)}.${chunkVRZC4TTF_cjs.J.identifier(this.casing.getColumnCasing(o))}`);}return u<n-1&&r.push(chunkVRZC4TTF_cjs.J`, `),r});return chunkVRZC4TTF_cjs.J.join(s)}buildJoins(e){if(!e||e.length===0)return;let t=[];if(e)for(let[n,s]of e.entries()){n===0&&t.push(chunkVRZC4TTF_cjs.J` `);let o=s.table,u=s.on?chunkVRZC4TTF_cjs.J` on ${s.on}`:void 0;if(chunkVRZC4TTF_cjs.c(o,I)){let r=o[I.Symbol.Name],c=o[I.Symbol.Schema],f=o[I.Symbol.OriginalName],p=r===f?void 0:s.alias;t.push(chunkVRZC4TTF_cjs.J`${chunkVRZC4TTF_cjs.J.raw(s.joinType)} join ${c?chunkVRZC4TTF_cjs.J`${chunkVRZC4TTF_cjs.J.identifier(c)}.`:void 0}${chunkVRZC4TTF_cjs.J.identifier(f)}${p&&chunkVRZC4TTF_cjs.J` ${chunkVRZC4TTF_cjs.J.identifier(p)}`}${u}`);}else t.push(chunkVRZC4TTF_cjs.J`${chunkVRZC4TTF_cjs.J.raw(s.joinType)} join ${o}${u}`);n<e.length-1&&t.push(chunkVRZC4TTF_cjs.J` `);}return chunkVRZC4TTF_cjs.J.join(t)}buildLimit(e){return typeof e=="object"||typeof e=="number"&&e>=0?chunkVRZC4TTF_cjs.J` limit ${e}`:void 0}buildOrderBy(e){let t=[];if(e)for(let[n,s]of e.entries())t.push(s),n<e.length-1&&t.push(chunkVRZC4TTF_cjs.J`, `);return t.length>0?chunkVRZC4TTF_cjs.J` order by ${chunkVRZC4TTF_cjs.J.join(t)}`:void 0}buildFromTable(e){return chunkVRZC4TTF_cjs.c(e,chunkVRZC4TTF_cjs.t)&&e[chunkVRZC4TTF_cjs.t.Symbol.IsAlias]?chunkVRZC4TTF_cjs.J`${chunkVRZC4TTF_cjs.J`${chunkVRZC4TTF_cjs.J.identifier(e[chunkVRZC4TTF_cjs.t.Symbol.Schema]??"")}.`.if(e[chunkVRZC4TTF_cjs.t.Symbol.Schema])}${chunkVRZC4TTF_cjs.J.identifier(e[chunkVRZC4TTF_cjs.t.Symbol.OriginalName])} ${chunkVRZC4TTF_cjs.J.identifier(e[chunkVRZC4TTF_cjs.t.Symbol.Name])}`:e}buildSelectQuery({withList:e,fields:t,fieldsFlat:n,where:s,having:o,table:u,joins:r,orderBy:c,groupBy:f,limit:p,offset:$,distinct:x,setOperators:Q}){let w=n??chunkVRZC4TTF_cjs.R(t);for(let D of w)if(chunkVRZC4TTF_cjs.c(D.field,chunkVRZC4TTF_cjs.d)&&chunkVRZC4TTF_cjs.v(D.field.table)!==(chunkVRZC4TTF_cjs.c(u,chunkVRZC4TTF_cjs.i)?u._.alias:chunkVRZC4TTF_cjs.c(u,X)?u[chunkVRZC4TTF_cjs.l].name:chunkVRZC4TTF_cjs.c(u,chunkVRZC4TTF_cjs.A)?void 0:chunkVRZC4TTF_cjs.v(u))&&!(K=>r?.some(({alias:P})=>P===(K[chunkVRZC4TTF_cjs.t.Symbol.IsAlias]?chunkVRZC4TTF_cjs.v(K):K[chunkVRZC4TTF_cjs.t.Symbol.BaseName])))(D.field.table)){let K=chunkVRZC4TTF_cjs.v(D.field.table);throw new Error(`Your "${D.path.join("->")}" field references a column "${K}"."${D.field.name}", but the table "${K}" is not part of the query! Did you forget to join it?`)}let b=!r||r.length===0,T=this.buildWithCTE(e),C=x?chunkVRZC4TTF_cjs.J` distinct`:void 0,O=this.buildSelection(w,{isSingleTable:b}),B=this.buildFromTable(u),h=this.buildJoins(r),F=s?chunkVRZC4TTF_cjs.J` where ${s}`:void 0,v=o?chunkVRZC4TTF_cjs.J` having ${o}`:void 0,m=[];if(f)for(let[D,K]of f.entries())m.push(K),D<f.length-1&&m.push(chunkVRZC4TTF_cjs.J`, `);let g=m.length>0?chunkVRZC4TTF_cjs.J` group by ${chunkVRZC4TTF_cjs.J.join(m)}`:void 0,V=this.buildOrderBy(c),J=this.buildLimit(p),H=$?chunkVRZC4TTF_cjs.J` offset ${$}`:void 0,U=chunkVRZC4TTF_cjs.J`${T}select${C} ${O} from ${B}${h}${F}${g}${v}${V}${J}${H}`;return Q.length>0?this.buildSetOperations(U,Q):U}buildSetOperations(e,t){let[n,...s]=t;if(!n)throw new Error("Cannot pass undefined values to any set operator");return s.length===0?this.buildSetOperationQuery({leftSelect:e,setOperator:n}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:e,setOperator:n}),s)}buildSetOperationQuery({leftSelect:e,setOperator:{type:t,isAll:n,rightSelect:s,limit:o,orderBy:u,offset:r}}){let c=chunkVRZC4TTF_cjs.J`${e.getSQL()} `,f=chunkVRZC4TTF_cjs.J`${s.getSQL()}`,p;if(u&&u.length>0){let w=[];for(let b of u)if(chunkVRZC4TTF_cjs.c(b,S))w.push(chunkVRZC4TTF_cjs.J.identifier(b.name));else if(chunkVRZC4TTF_cjs.c(b,chunkVRZC4TTF_cjs.A)){for(let T=0;T<b.queryChunks.length;T++){let C=b.queryChunks[T];chunkVRZC4TTF_cjs.c(C,S)&&(b.queryChunks[T]=chunkVRZC4TTF_cjs.J.identifier(this.casing.getColumnCasing(C)));}w.push(chunkVRZC4TTF_cjs.J`${b}`);}else w.push(chunkVRZC4TTF_cjs.J`${b}`);p=chunkVRZC4TTF_cjs.J` order by ${chunkVRZC4TTF_cjs.J.join(w,chunkVRZC4TTF_cjs.J`, `)}`;}let $=typeof o=="object"||typeof o=="number"&&o>=0?chunkVRZC4TTF_cjs.J` limit ${o}`:void 0,x=chunkVRZC4TTF_cjs.J.raw(`${t} ${n?"all ":""}`),Q=r?chunkVRZC4TTF_cjs.J` offset ${r}`:void 0;return chunkVRZC4TTF_cjs.J`${c}${x}${f}${p}${$}${Q}`}buildInsertQuery({table:e,values:t,onConflict:n,returning:s,withList:o,select:u}){let r=[],c=e[chunkVRZC4TTF_cjs.t.Symbol.Columns],f=Object.entries(c).filter(([b,T])=>!T.shouldDisableInsert()),p=f.map(([,b])=>chunkVRZC4TTF_cjs.J.identifier(this.casing.getColumnCasing(b)));if(u){let b=t;chunkVRZC4TTF_cjs.c(b,chunkVRZC4TTF_cjs.A)?r.push(b):r.push(b.getSQL());}else {let b=t;r.push(chunkVRZC4TTF_cjs.J.raw("values "));for(let[T,C]of b.entries()){let O=[];for(let[B,h]of f){let F=C[B];if(F===void 0||chunkVRZC4TTF_cjs.c(F,chunkVRZC4TTF_cjs.H)&&F.value===void 0){let v;if(h.default!==null&&h.default!==void 0)v=chunkVRZC4TTF_cjs.c(h.default,chunkVRZC4TTF_cjs.A)?h.default:chunkVRZC4TTF_cjs.J.param(h.default,h);else if(h.defaultFn!==void 0){let m=h.defaultFn();v=chunkVRZC4TTF_cjs.c(m,chunkVRZC4TTF_cjs.A)?m:chunkVRZC4TTF_cjs.J.param(m,h);}else if(!h.default&&h.onUpdateFn!==void 0){let m=h.onUpdateFn();v=chunkVRZC4TTF_cjs.c(m,chunkVRZC4TTF_cjs.A)?m:chunkVRZC4TTF_cjs.J.param(m,h);}else v=chunkVRZC4TTF_cjs.J`null`;O.push(v);}else O.push(F);}r.push(O),T<b.length-1&&r.push(chunkVRZC4TTF_cjs.J`, `);}}let $=this.buildWithCTE(o),x=chunkVRZC4TTF_cjs.J.join(r),Q=s?chunkVRZC4TTF_cjs.J` returning ${this.buildSelection(s,{isSingleTable:true})}`:void 0,w=n?.length?chunkVRZC4TTF_cjs.J.join(n):void 0;return chunkVRZC4TTF_cjs.J`${$}insert into ${e} ${p} ${x}${w}${Q}`}sqlToQuery(e,t){return e.toQuery({casing:this.casing,escapeName:this.escapeName,escapeParam:this.escapeParam,escapeString:this.escapeString,invokeSource:t})}buildRelationalQuery({fullSchema:e,schema:t,tableNamesMap:n,table:s,tableConfig:o,queryConfig:u,tableAlias:r,nestedQueryRelation:c,joinOn:f}){let p=[],$,x,Q=[],w,b=[];if(u===true)p=Object.entries(o.columns).map(([O,B])=>({dbKey:B.name,tsKey:O,field:chunkBCEE4NBZ_cjs.f(B,r),relationTableTsKey:void 0,isJson:false,selection:[]}));else {let C=Object.fromEntries(Object.entries(o.columns).map(([m,g])=>[m,chunkBCEE4NBZ_cjs.f(g,r)]));if(u.where){let m=typeof u.where=="function"?u.where(C,chunkBCEE4NBZ_cjs.R()):u.where;w=m&&chunkBCEE4NBZ_cjs.h(m,r);}let O=[],B=[];if(u.columns){let m=false;for(let[g,V]of Object.entries(u.columns))V!==void 0&&g in o.columns&&(!m&&V===true&&(m=true),B.push(g));B.length>0&&(B=m?B.filter(g=>u.columns?.[g]===true):Object.keys(o.columns).filter(g=>!B.includes(g)));}else B=Object.keys(o.columns);for(let m of B){let g=o.columns[m];O.push({tsKey:m,value:g});}let h=[];u.with&&(h=Object.entries(u.with).filter(m=>!!m[1]).map(([m,g])=>({tsKey:m,queryConfig:g,relation:o.relations[m]})));let F;if(u.extras){F=typeof u.extras=="function"?u.extras(C,{sql:chunkVRZC4TTF_cjs.J}):u.extras;for(let[m,g]of Object.entries(F))O.push({tsKey:m,value:chunkBCEE4NBZ_cjs.g(g,r)});}for(let{tsKey:m,value:g}of O)p.push({dbKey:chunkVRZC4TTF_cjs.c(g,chunkVRZC4TTF_cjs.A.Aliased)?g.fieldAlias:o.columns[m].name,tsKey:m,field:chunkVRZC4TTF_cjs.c(g,chunkVRZC4TTF_cjs.d)?chunkBCEE4NBZ_cjs.f(g,r):g,relationTableTsKey:void 0,isJson:false,selection:[]});let v=typeof u.orderBy=="function"?u.orderBy(C,chunkBCEE4NBZ_cjs.S()):u.orderBy??[];Array.isArray(v)||(v=[v]),Q=v.map(m=>chunkVRZC4TTF_cjs.c(m,chunkVRZC4TTF_cjs.d)?chunkBCEE4NBZ_cjs.f(m,r):chunkBCEE4NBZ_cjs.h(m,r)),$=u.limit,x=u.offset;for(let{tsKey:m,queryConfig:g,relation:V}of h){let J=chunkBCEE4NBZ_cjs.X(t,n,V),H=chunkVRZC4TTF_cjs.w(V.referencedTable),U=n[H],D=`${r}_${m}`,K=chunkBCEE4NBZ_cjs.p(...J.fields.map((st,ut)=>chunkBCEE4NBZ_cjs.n(chunkBCEE4NBZ_cjs.f(J.references[ut],D),chunkBCEE4NBZ_cjs.f(st,r)))),P=this.buildRelationalQuery({fullSchema:e,schema:t,tableNamesMap:n,table:e[U],tableConfig:t[U],queryConfig:chunkVRZC4TTF_cjs.c(V,chunkBCEE4NBZ_cjs.P)?g===true?{limit:1}:{...g,limit:1}:g,tableAlias:D,joinOn:K,nestedQueryRelation:V}),ot=chunkVRZC4TTF_cjs.J`(${P.sql})`.as(m);p.push({dbKey:m,tsKey:m,field:ot,relationTableTsKey:U,isJson:true,selection:P.selection});}}if(p.length===0)throw new chunkBCEE4NBZ_cjs.j({message:`No fields selected for table "${o.tsName}" ("${r}"). You need to have at least one item in "columns", "with" or "extras". If you need to select all columns, omit the "columns" key or set it to undefined.`});let T;if(w=chunkBCEE4NBZ_cjs.p(f,w),c){let C=chunkVRZC4TTF_cjs.J`json_array(${chunkVRZC4TTF_cjs.J.join(p.map(({field:h})=>chunkVRZC4TTF_cjs.c(h,S)?chunkVRZC4TTF_cjs.J.identifier(this.casing.getColumnCasing(h)):chunkVRZC4TTF_cjs.c(h,chunkVRZC4TTF_cjs.A.Aliased)?h.sql:h),chunkVRZC4TTF_cjs.J`, `)})`;chunkVRZC4TTF_cjs.c(c,chunkBCEE4NBZ_cjs.Q)&&(C=chunkVRZC4TTF_cjs.J`coalesce(json_group_array(${C}), json_array())`);let O=[{dbKey:"data",tsKey:"data",field:C.as("data"),isJson:true,relationTableTsKey:o.tsName,selection:p}];$!==void 0||x!==void 0||Q.length>0?(T=this.buildSelectQuery({table:chunkBCEE4NBZ_cjs.d(s,r),fields:{},fieldsFlat:[{path:[],field:chunkVRZC4TTF_cjs.J.raw("*")}],where:w,limit:$,offset:x,orderBy:Q,setOperators:[]}),w=void 0,$=void 0,x=void 0,Q=void 0):T=chunkBCEE4NBZ_cjs.d(s,r),T=this.buildSelectQuery({table:chunkVRZC4TTF_cjs.c(T,I)?T:new chunkVRZC4TTF_cjs.i(T,{},r),fields:{},fieldsFlat:O.map(({field:h})=>({path:[],field:chunkVRZC4TTF_cjs.c(h,chunkVRZC4TTF_cjs.d)?chunkBCEE4NBZ_cjs.f(h,r):h})),joins:b,where:w,limit:$,offset:x,orderBy:Q,setOperators:[]});}else T=this.buildSelectQuery({table:chunkBCEE4NBZ_cjs.d(s,r),fields:{},fieldsFlat:p.map(({field:C})=>({path:[],field:chunkVRZC4TTF_cjs.c(C,chunkVRZC4TTF_cjs.d)?chunkBCEE4NBZ_cjs.f(C,r):C})),joins:b,where:w,limit:$,offset:x,orderBy:Q,setOperators:[]});return {tableTsKey:o.tsName,sql:T,selection:p}}},nt=class extends G{static[chunkVRZC4TTF_cjs.a]="SQLiteSyncDialect";migrate(e,t,n){let s=n===void 0||typeof n=="string"?"__drizzle_migrations":n.migrationsTable??"__drizzle_migrations",o=chunkVRZC4TTF_cjs.J`
|
|
2
|
+
CREATE TABLE IF NOT EXISTS ${chunkVRZC4TTF_cjs.J.identifier(s)} (
|
|
3
|
+
id SERIAL PRIMARY KEY,
|
|
4
|
+
hash text NOT NULL,
|
|
5
|
+
created_at numeric
|
|
6
|
+
)
|
|
7
|
+
`;t.run(o);let r=t.values(chunkVRZC4TTF_cjs.J`SELECT id, hash, created_at FROM ${chunkVRZC4TTF_cjs.J.identifier(s)} ORDER BY created_at DESC LIMIT 1`)[0]??void 0;t.run(chunkVRZC4TTF_cjs.J`BEGIN`);try{for(let c of e)if(!r||Number(r[2])<c.folderMillis){for(let f of c.sql)t.run(chunkVRZC4TTF_cjs.J.raw(f));t.run(chunkVRZC4TTF_cjs.J`INSERT INTO ${chunkVRZC4TTF_cjs.J.identifier(s)} ("hash", "created_at") VALUES(${c.hash}, ${c.folderMillis})`);}t.run(chunkVRZC4TTF_cjs.J`COMMIT`);}catch(c){throw t.run(chunkVRZC4TTF_cjs.J`ROLLBACK`),c}}},rt=class extends G{static[chunkVRZC4TTF_cjs.a]="SQLiteAsyncDialect";async migrate(e,t,n){let s=n===void 0||typeof n=="string"?"__drizzle_migrations":n.migrationsTable??"__drizzle_migrations",o=chunkVRZC4TTF_cjs.J`
|
|
8
|
+
CREATE TABLE IF NOT EXISTS ${chunkVRZC4TTF_cjs.J.identifier(s)} (
|
|
9
|
+
id SERIAL PRIMARY KEY,
|
|
10
|
+
hash text NOT NULL,
|
|
11
|
+
created_at numeric
|
|
12
|
+
)
|
|
13
|
+
`;await t.run(o);let r=(await t.values(chunkVRZC4TTF_cjs.J`SELECT id, hash, created_at FROM ${chunkVRZC4TTF_cjs.J.identifier(s)} ORDER BY created_at DESC LIMIT 1`))[0]??void 0;await t.transaction(async c=>{for(let f of e)if(!r||Number(r[2])<f.folderMillis){for(let p of f.sql)await c.run(chunkVRZC4TTF_cjs.J.raw(p));await c.run(chunkVRZC4TTF_cjs.J`INSERT INTO ${chunkVRZC4TTF_cjs.J.identifier(s)} ("hash", "created_at") VALUES(${f.hash}, ${f.folderMillis})`);}});}};exports.a=Xe;exports.b=Ge;exports.c=He;exports.d=I;exports.e=ci;exports.f=X;exports.g=G;exports.h=nt;exports.i=rt;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {createRequire}from'module';import {g as g$1}from'./chunk-C2PXMVR5.js';createRequire(import.meta.url);
|
|
2
|
+
g$1();var i=Symbol.for("drizzle:entityKind"),Er=Symbol.for("drizzle:hasOwnEntityKind");function g(t,e){if(!t||typeof t!="object")return false;if(t instanceof e)return true;if(!Object.prototype.hasOwnProperty.call(e,i))throw new Error(`Class "${e.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let r=Object.getPrototypeOf(t).constructor;if(r)for(;r;){if(i in r&&r[i]===e[i])return true;r=Object.getPrototypeOf(r);}return false}g$1();var T=class{constructor(e,r){this.table=e,this.config=r,this.name=r.name,this.keyAsName=r.keyAsName,this.notNull=r.notNull,this.default=r.default,this.defaultFn=r.defaultFn,this.onUpdateFn=r.onUpdateFn,this.hasDefault=r.hasDefault,this.primary=r.primaryKey,this.isUnique=r.isUnique,this.uniqueName=r.uniqueName,this.uniqueType=r.uniqueType,this.dataType=r.dataType,this.columnType=r.columnType,this.generated=r.generated,this.generatedIdentity=r.generatedIdentity;}static[i]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}};g$1();var O=class{static[i]="ColumnBuilder";config;constructor(e,r,n){this.config={name:e,keyAsName:e==="",notNull:false,default:void 0,hasDefault:false,primaryKey:false,isUnique:false,uniqueName:void 0,uniqueType:void 0,dataType:r,columnType:n,generated:void 0};}$type(){return this}notNull(){return this.config.notNull=true,this}default(e){return this.config.default=e,this.config.hasDefault=true,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=true,this}$default=this.$defaultFn;$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=true,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=true,this.config.notNull=true,this}setName(e){this.config.name===""&&(this.config.name=e);}};g$1();var z=class{static[i]="Subquery";constructor(e,r,n,u=false,c=[]){this._={brand:"Subquery",sql:e,selectedFields:r,alias:n,isWith:u,usedTables:c};}},Kt=class extends z{static[i]="WithSubquery"};g$1();var D=Symbol.for("drizzle:ViewBaseConfig");g$1();g$1();var N=Symbol.for("drizzle:Name");var I=Symbol.for("drizzle:Schema"),qt=Symbol.for("drizzle:Columns"),$t=Symbol.for("drizzle:ExtraConfigColumns"),_=Symbol.for("drizzle:OriginalName"),R=Symbol.for("drizzle:BaseName"),q=Symbol.for("drizzle:IsAlias"),jt=Symbol.for("drizzle:ExtraConfigBuilder"),Ot=Symbol.for("drizzle:IsDrizzleTable"),d=class{static[i]="Table";static Symbol={Name:N,Schema:I,OriginalName:_,Columns:qt,ExtraConfigColumns:$t,BaseName:R,IsAlias:q,ExtraConfigBuilder:jt};[N];[_];[I];[qt];[$t];[R];[q]=false;[Ot]=true;[jt]=void 0;constructor(e,r,n){this[N]=this[_]=e,this[I]=r,this[R]=n;}};function on(t){return typeof t=="object"&&t!==null&&Ot in t}function J(t){return t[N]}function un(t){return `${t[I]??"public"}.${t[N]}`}g$1();g$1();g$1();g$1();var E=class{static[i]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(e,r){this.reference=()=>{let{name:n,columns:u,foreignColumns:c}=e();return {name:n,columns:u,foreignTable:c[0].table,foreignColumns:c}},r&&(this._onUpdate=r.onUpdate,this._onDelete=r.onDelete);}onUpdate(e){return this._onUpdate=e===void 0?"no action":e,this}onDelete(e){return this._onDelete=e===void 0?"no action":e,this}build(e){return new W(e,this)}},W=class{constructor(e,r){this.table=e,this.reference=r.reference,this.onUpdate=r._onUpdate,this.onDelete=r._onDelete;}static[i]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:e,columns:r,foreignColumns:n}=this.reference(),u=r.map(y=>y.name),c=n.map(y=>y.name),h=[this.table[N],...u,n[0].table[N],...c];return e??`${h.join("_")}_fk`}};g$1();function U(t,...e){return t(...e)}g$1();function H(t,e){return `${t[N]}_${e.join("_")}_unique`}g$1();function Et(t,e,r){for(let n=e;n<t.length;n++){let u=t[n];if(u==="\\"){n++;continue}if(u==='"')return [t.slice(e,n).replace(/\\/g,""),n+1];if(!r&&(u===","||u==="}"))return [t.slice(e,n).replace(/\\/g,""),n]}return [t.slice(e).replace(/\\/g,""),t.length]}function Ut(t,e=0){let r=[],n=e,u=false;for(;n<t.length;){let c=t[n];if(c===","){(u||n===e)&&r.push(""),u=true,n++;continue}if(u=false,c==="\\"){n+=2;continue}if(c==='"'){let[w,x]=Et(t,n+1,true);r.push(w),n=x;continue}if(c==="}")return [r,n+1];if(c==="{"){let[w,x]=Ut(t,n+1);r.push(w),n=x;continue}let[h,y]=Et(t,n,false);r.push(h),n=y;}return [r,n]}function _t(t){let[e]=Ut(t,1);return e}function X(t){return `{${t.map(e=>Array.isArray(e)?X(e):typeof e=="string"?`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:`${e}`).join(",")}}`}var m=class extends O{foreignKeyConfigs=[];static[i]="PgColumnBuilder";array(e){return new Z(this.config.name,this,e)}references(e,r={}){return this.foreignKeyConfigs.push({ref:e,actions:r}),this}unique(e,r){return this.config.isUnique=true,this.config.uniqueName=e,this.config.uniqueType=r?.nulls,this}generatedAlwaysAs(e){return this.config.generated={as:e,type:"always",mode:"stored"},this}buildForeignKeys(e,r){return this.foreignKeyConfigs.map(({ref:n,actions:u})=>U((c,h)=>{let y=new E(()=>{let w=c();return {columns:[e],foreignColumns:[w]}});return h.onUpdate&&y.onUpdate(h.onUpdate),h.onDelete&&y.onDelete(h.onDelete),y.build(r)},n,u))}buildExtraConfigColumn(e){return new Y(e,this.config)}},o=class extends T{constructor(e,r){r.uniqueName||(r.uniqueName=H(e,[r.name])),super(e,r),this.table=e;}static[i]="PgColumn"},Y=class extends o{static[i]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(e){return this.indexConfig.opClass=e,this}},Rt=class{static[i]="IndexedColumn";constructor(e,r,n,u){this.name=e,this.keyAsName=r,this.type=n,this.indexConfig=u;}name;keyAsName;type;indexConfig},Z=class extends m{static[i]="PgArrayBuilder";constructor(e,r,n){super(e,"array","PgArray"),this.config.baseBuilder=r,this.config.size=n;}build(e){let r=this.config.baseBuilder.build(e);return new k(e,this.config,r)}},k=class t extends o{constructor(e,r,n,u){super(e,r),this.baseColumn=n,this.range=u,this.size=r.size;}size;static[i]="PgArray";getSQLType(){return `${this.baseColumn.getSQLType()}[${typeof this.size=="number"?this.size:""}]`}mapFromDriverValue(e){return typeof e=="string"&&(e=_t(e)),e.map(r=>this.baseColumn.mapFromDriverValue(r))}mapToDriverValue(e,r=false){let n=e.map(u=>u===null?null:g(this.baseColumn,t)?this.baseColumn.mapToDriverValue(u,true):this.baseColumn.mapToDriverValue(u));return r?n:X(n)}};var Wt=Symbol.for("drizzle:isPgEnum");function Gt(t){return !!t&&typeof t=="function"&&Wt in t&&t[Wt]===true}g$1();g$1();var Xt={startActiveSpan(t,e){return e()}};var Yt=class{static[i]="FakePrimitiveParam"};function $r(t){return t!=null&&typeof t.getSQL=="function"}function jr(t){let e={sql:"",params:[]};for(let r of t)e.sql+=r.sql,e.params.push(...r.params),r.typings?.length&&(e.typings||(e.typings=[]),e.typings.push(...r.typings));return e}var S=class{static[i]="StringChunk";value;constructor(e){this.value=Array.isArray(e)?e:[e];}getSQL(){return new P([this])}},P=class t{constructor(e){this.queryChunks=e;for(let r of e)if(g(r,d)){let n=r[d.Symbol.Schema];this.usedTables.push(n===void 0?r[d.Symbol.Name]:n+"."+r[d.Symbol.Name]);}}static[i]="SQL";decoder=Zt;shouldInlineParams=false;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return Xt.startActiveSpan("drizzle.buildSQL",r=>{let n=this.buildQueryFromSourceParams(this.queryChunks,e);return r?.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(e,r){let n=Object.assign({},r,{inlineParams:r.inlineParams||this.shouldInlineParams,paramStartIndex:r.paramStartIndex||{value:0}}),{casing:u,escapeName:c,escapeParam:h,prepareTyping:y,inlineParams:w,paramStartIndex:x}=n;return jr(e.map(a=>{if(g(a,S))return {sql:a.value.join(""),params:[]};if(g(a,L))return {sql:c(a.value),params:[]};if(a===void 0)return {sql:"",params:[]};if(Array.isArray(a)){let b=[new S("(")];for(let[C,V]of a.entries())b.push(V),C<a.length-1&&b.push(new S(", "));return b.push(new S(")")),this.buildQueryFromSourceParams(b,n)}if(g(a,t))return this.buildQueryFromSourceParams(a.queryChunks,{...n,inlineParams:w||a.shouldInlineParams});if(g(a,d)){let b=a[d.Symbol.Schema],C=a[d.Symbol.Name];return {sql:b===void 0||a[q]?c(C):c(b)+"."+c(C),params:[]}}if(g(a,T)){let b=u.getColumnCasing(a);if(r.invokeSource==="indexes")return {sql:c(b),params:[]};let C=a.table[d.Symbol.Schema];return {sql:a.table[q]||C===void 0?c(a.table[d.Symbol.Name])+"."+c(b):c(C)+"."+c(a.table[d.Symbol.Name])+"."+c(b),params:[]}}if(g(a,$)){let b=a[D].schema,C=a[D].name;return {sql:b===void 0||a[D].isAlias?c(C):c(b)+"."+c(C),params:[]}}if(g(a,B)){if(g(a.value,Q))return {sql:h(x.value++,a),params:[a],typings:["none"]};let b=a.value===null?null:a.encoder.mapToDriverValue(a.value);if(g(b,t))return this.buildQueryFromSourceParams([b],n);if(w)return {sql:this.mapInlineParam(b,n),params:[]};let C=["none"];return y&&(C=[y(a.encoder)]),{sql:h(x.value++,b),params:[b],typings:C}}return g(a,Q)?{sql:h(x.value++,a),params:[a],typings:["none"]}:g(a,t.Aliased)&&a.fieldAlias!==void 0?{sql:c(a.fieldAlias),params:[]}:g(a,z)?a._.isWith?{sql:c(a._.alias),params:[]}:this.buildQueryFromSourceParams([new S("("),a._.sql,new S(") "),new L(a._.alias)],n):Gt(a)?a.schema?{sql:c(a.schema)+"."+c(a.enumName),params:[]}:{sql:c(a.enumName),params:[]}:$r(a)?a.shouldOmitSQLParens?.()?this.buildQueryFromSourceParams([a.getSQL()],n):this.buildQueryFromSourceParams([new S("("),a.getSQL(),new S(")")],n):w?{sql:this.mapInlineParam(a,n),params:[]}:{sql:h(x.value++,a),params:[a],typings:["none"]}}))}mapInlineParam(e,{escapeString:r}){if(e===null)return "null";if(typeof e=="number"||typeof e=="boolean")return e.toString();if(typeof e=="string")return r(e);if(typeof e=="object"){let n=e.toString();return r(n==="[object Object]"?JSON.stringify(e):n)}throw new Error("Unexpected param value: "+e)}getSQL(){return this}as(e){return e===void 0?this:new t.Aliased(this,e)}mapWith(e){return this.decoder=typeof e=="function"?{mapFromDriverValue:e}:e,this}inlineParams(){return this.shouldInlineParams=true,this}if(e){return e?this:void 0}},L=class{constructor(e){this.value=e;}static[i]="Name";brand;getSQL(){return new P([this])}};function Gn(t){return new L(t)}function Hn(t){return typeof t=="object"&&t!==null&&"mapToDriverValue"in t&&typeof t.mapToDriverValue=="function"}var Zt={mapFromDriverValue:t=>t},kt={mapToDriverValue:t=>t},Xn={...Zt,...kt},B=class{constructor(e,r=kt){this.value=e,this.encoder=r;}static[i]="Param";brand;getSQL(){return new P([this])}};function Yn(t,e){return new B(t,e)}function A(t,...e){let r=[];(e.length>0||t.length>0&&t[0]!=="")&&r.push(new S(t[0]));for(let[n,u]of e.entries())r.push(u,new S(t[n+1]));return new P(r)}(t=>{function e(){return new P([])}t.empty=e;function r(w){return new P(w)}t.fromList=r;function n(w){return new P([new S(w)])}t.raw=n;function u(w,x){let a=[];for(let[b,C]of w.entries())b>0&&x!==void 0&&a.push(x),a.push(C);return new P(a)}t.join=u;function c(w){return new L(w)}t.identifier=c;function h(w){return new Q(w)}t.placeholder=h;function y(w,x){return new B(w,x)}t.param=y;})(A||(A={}));(t=>{class e{constructor(n,u){this.sql=n,this.fieldAlias=u;}static[i]="SQL.Aliased";isSelectionField=false;getSQL(){return this.sql}clone(){return new e(this.sql,this.fieldAlias)}}t.Aliased=e;})(P||(P={}));var Q=class{constructor(e){this.name=e;}static[i]="Placeholder";getSQL(){return new P([this])}};function Zn(t){return new Q(t)}function kn(t,e){return t.map(r=>{if(g(r,Q)){if(!(r.name in e))throw new Error(`No value for placeholder "${r.name}" was provided`);return e[r.name]}if(g(r,B)&&g(r.value,Q)){if(!(r.value.name in e))throw new Error(`No value for placeholder "${r.value.name}" was provided`);return r.encoder.mapToDriverValue(e[r.value.name])}return r})}var er=Symbol.for("drizzle:IsDrizzleView"),$=class{static[i]="View";[D];[er]=true;constructor({name:e,schema:r,selectedFields:n,query:u}){this[D]={name:e,originalName:e,schema:r,selectedFields:n,query:u,isExisting:!u,isAlias:false};}getSQL(){return new P([this])}};function ei(t){return typeof t=="object"&&t!==null&&er in t}function ti(t){return t[D].name}T.prototype.getSQL=function(){return new P([this])};d.prototype.getSQL=function(){return new P([this])};z.prototype.getSQL=function(){return new P([this])};g$1();function ci(t,e,r){let n={},u=t.reduce((c,{path:h,field:y},w)=>{let x;g(y,T)?x=y:g(y,P)?x=y.decoder:x=y.sql.decoder;let a=c;for(let[b,C]of h.entries())if(b<h.length-1)C in a||(a[C]={}),a=a[C];else {let V=e[w],qr=a[C]=V===null?null:x.mapFromDriverValue(V);if(r&&g(y,T)&&h.length===2){let K=h[0];K in n?typeof n[K]=="string"&&n[K]!==J(y.table)&&(n[K]=false):n[K]=qr===null?J(y.table):false;}}return c},{});if(r&&Object.keys(n).length>0)for(let[c,h]of Object.entries(n))typeof h=="string"&&!r[h]&&(u[c]=null);return u}function tr(t,e){return Object.entries(t).reduce((r,[n,u])=>{if(typeof n!="string")return r;let c=e?[...e,n]:[n];return g(u,T)||g(u,P)||g(u,P.Aliased)?r.push({path:c,field:u}):g(u,d)?r.push(...tr(u[d.Symbol.Columns],c)):r.push(...tr(u,c)),r},[])}function li(t,e){let r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return false;for(let[u,c]of r.entries())if(c!==n[u])return false;return true}function fi(t,e){let r=Object.entries(e).filter(([,n])=>n!==void 0).map(([n,u])=>g(u,P)||g(u,T)?[n,u]:[n,new B(u,t[d.Symbol.Columns][n])]);if(r.length===0)throw new Error("No values to set");return Object.fromEntries(r)}function pi(t,e){for(let r of e)for(let n of Object.getOwnPropertyNames(r.prototype))n!=="constructor"&&Object.defineProperty(t.prototype,n,Object.getOwnPropertyDescriptor(r.prototype,n)||Object.create(null));}function gi(t){return t[d.Symbol.Columns]}function di(t){return t[D].selectedFields}function hi(t){return g(t,z)?t._.alias:g(t,$)?t[D].name:g(t,P)?void 0:t[d.Symbol.IsAlias]?t[d.Symbol.Name]:t[d.Symbol.BaseName]}function p(t,e){return {name:typeof t=="string"&&t.length>0?t:"",config:typeof t=="object"?t:e}}function yi(t){if(typeof t!="object"||t===null||t.constructor.name!=="Object")return false;if("logger"in t){let e=typeof t.logger;return !(e!=="boolean"&&(e!=="object"||typeof t.logger.logQuery!="function")&&e!=="undefined")}if("schema"in t){let e=typeof t.schema;return !(e!=="object"&&e!=="undefined")}if("casing"in t){let e=typeof t.casing;return !(e!=="string"&&e!=="undefined")}if("mode"in t)return !(t.mode!=="default"||t.mode!=="planetscale"||t.mode!==void 0);if("connection"in t){let e=typeof t.connection;return !(e!=="string"&&e!=="object"&&e!=="undefined")}if("client"in t){let e=typeof t.client;return !(e!=="object"&&e!=="function"&&e!=="undefined")}return Object.keys(t).length===0}var bi=typeof TextDecoder>"u"?null:new TextDecoder;g$1();g$1();var F=class extends m{static[i]="PgIntColumnBaseBuilder";generatedAlwaysAsIdentity(e){if(e){let{name:r,...n}=e;this.config.generatedIdentity={type:"always",sequenceName:r,sequenceOptions:n};}else this.config.generatedIdentity={type:"always"};return this.config.hasDefault=true,this.config.notNull=true,this}generatedByDefaultAsIdentity(e){if(e){let{name:r,...n}=e;this.config.generatedIdentity={type:"byDefault",sequenceName:r,sequenceOptions:n};}else this.config.generatedIdentity={type:"byDefault"};return this.config.hasDefault=true,this.config.notNull=true,this}};var ie=class extends F{static[i]="PgIntegerBuilder";constructor(e){super(e,"number","PgInteger");}build(e){return new se(e,this.config)}},se=class extends o{static[i]="PgInteger";getSQLType(){return "integer"}mapFromDriverValue(e){return typeof e=="string"?Number.parseInt(e):e}};function rr(t){return new ie(t??"")}g$1();var oe=class extends m{static[i]="PgJsonbBuilder";constructor(e){super(e,"json","PgJsonb");}build(e){return new ue(e,this.config)}},ue=class extends o{static[i]="PgJsonb";constructor(e,r){super(e,r);}getSQLType(){return "jsonb"}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e}};function nr(t){return new oe(t??"")}g$1();var ae=class extends m{static[i]="PgTextBuilder";constructor(e,r){super(e,"string","PgText"),this.config.enumValues=r.enum;}build(e){return new me(e,this.config)}},me=class extends o{static[i]="PgText";enumValues=this.config.enumValues;getSQLType(){return "text"}};function ir(t,e={}){let{name:r,config:n}=p(t,e);return new ae(r,n)}g$1();g$1();var v=class extends m{static[i]="PgDateColumnBaseBuilder";defaultNow(){return this.default(A`now()`)}};var ce=class extends v{static[i]="PgTimestampBuilder";constructor(e,r,n){super(e,"date","PgTimestamp"),this.config.withTimezone=r,this.config.precision=n;}build(e){return new le(e,this.config)}},le=class extends o{static[i]="PgTimestamp";withTimezone;precision;constructor(e,r){super(e,r),this.withTimezone=r.withTimezone,this.precision=r.precision;}getSQLType(){return `timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue=e=>new Date(this.withTimezone?e:e+"+0000");mapToDriverValue=e=>e.toISOString()},fe=class extends v{static[i]="PgTimestampStringBuilder";constructor(e,r,n){super(e,"string","PgTimestampString"),this.config.withTimezone=r,this.config.precision=n;}build(e){return new pe(e,this.config)}},pe=class extends o{static[i]="PgTimestampString";withTimezone;precision;constructor(e,r){super(e,r),this.withTimezone=r.withTimezone,this.precision=r.precision;}getSQLType(){return `timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}};function sr(t,e={}){let{name:r,config:n}=p(t,e);return n?.mode==="string"?new fe(r,n.withTimezone??false,n.precision):new ce(r,n?.withTimezone??false,n?.precision)}g$1();var ge=class extends m{static[i]="PgUUIDBuilder";constructor(e){super(e,"string","PgUUID");}defaultRandom(){return this.default(A`gen_random_uuid()`)}build(e){return new de(e,this.config)}},de=class extends o{static[i]="PgUUID";getSQLType(){return "uuid"}};function or(t){return new ge(t??"")}g$1();var he=class extends m{static[i]="PgVarcharBuilder";constructor(e,r){super(e,"string","PgVarchar"),this.config.length=r.length,this.config.enumValues=r.enum;}build(e){return new ye(e,this.config)}},ye=class extends o{static[i]="PgVarchar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}};function ur(t,e={}){let{name:r,config:n}=p(t,e);return new he(r,n)}g$1();g$1();g$1();var be=class extends F{static[i]="PgBigInt53Builder";constructor(e){super(e,"number","PgBigInt53");}build(e){return new we(e,this.config)}},we=class extends o{static[i]="PgBigInt53";getSQLType(){return "bigint"}mapFromDriverValue(e){return typeof e=="number"?e:Number(e)}},Ce=class extends F{static[i]="PgBigInt64Builder";constructor(e){super(e,"bigint","PgBigInt64");}build(e){return new xe(e,this.config)}},xe=class extends o{static[i]="PgBigInt64";getSQLType(){return "bigint"}mapFromDriverValue(e){return BigInt(e)}};function ar(t,e){let{name:r,config:n}=p(t,e);return n.mode==="number"?new be(r):new Ce(r)}g$1();var Pe=class extends m{static[i]="PgBigSerial53Builder";constructor(e){super(e,"number","PgBigSerial53"),this.config.hasDefault=true,this.config.notNull=true;}build(e){return new Se(e,this.config)}},Se=class extends o{static[i]="PgBigSerial53";getSQLType(){return "bigserial"}mapFromDriverValue(e){return typeof e=="number"?e:Number(e)}},Te=class extends m{static[i]="PgBigSerial64Builder";constructor(e){super(e,"bigint","PgBigSerial64"),this.config.hasDefault=true;}build(e){return new Ne(e,this.config)}},Ne=class extends o{static[i]="PgBigSerial64";getSQLType(){return "bigserial"}mapFromDriverValue(e){return BigInt(e)}};function mr(t,e){let{name:r,config:n}=p(t,e);return n.mode==="number"?new Pe(r):new Te(r)}g$1();var De=class extends m{static[i]="PgBooleanBuilder";constructor(e){super(e,"boolean","PgBoolean");}build(e){return new ve(e,this.config)}},ve=class extends o{static[i]="PgBoolean";getSQLType(){return "boolean"}};function cr(t){return new De(t??"")}g$1();var Ve=class extends m{static[i]="PgCharBuilder";constructor(e,r){super(e,"string","PgChar"),this.config.length=r.length,this.config.enumValues=r.enum;}build(e){return new Fe(e,this.config)}},Fe=class extends o{static[i]="PgChar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"char":`char(${this.length})`}};function lr(t,e={}){let{name:r,config:n}=p(t,e);return new Ve(r,n)}g$1();var ze=class extends m{static[i]="PgCidrBuilder";constructor(e){super(e,"string","PgCidr");}build(e){return new Be(e,this.config)}},Be=class extends o{static[i]="PgCidr";getSQLType(){return "cidr"}};function fr(t){return new ze(t??"")}g$1();var Qe=class extends m{static[i]="PgCustomColumnBuilder";constructor(e,r,n){super(e,"custom","PgCustomColumn"),this.config.fieldConfig=r,this.config.customTypeParams=n;}build(e){return new Le(e,this.config)}},Le=class extends o{static[i]="PgCustomColumn";sqlName;mapTo;mapFrom;constructor(e,r){super(e,r),this.sqlName=r.customTypeParams.dataType(r.fieldConfig),this.mapTo=r.customTypeParams.toDriver,this.mapFrom=r.customTypeParams.fromDriver;}getSQLType(){return this.sqlName}mapFromDriverValue(e){return typeof this.mapFrom=="function"?this.mapFrom(e):e}mapToDriverValue(e){return typeof this.mapTo=="function"?this.mapTo(e):e}};function pr(t){return (e,r)=>{let{name:n,config:u}=p(e,r);return new Qe(n,u,t)}}g$1();var Ae=class extends v{static[i]="PgDateBuilder";constructor(e){super(e,"date","PgDate");}build(e){return new Ke(e,this.config)}},Ke=class extends o{static[i]="PgDate";getSQLType(){return "date"}mapFromDriverValue(e){return new Date(e)}mapToDriverValue(e){return e.toISOString()}},qe=class extends v{static[i]="PgDateStringBuilder";constructor(e){super(e,"string","PgDateString");}build(e){return new $e(e,this.config)}},$e=class extends o{static[i]="PgDateString";getSQLType(){return "date"}};function gr(t,e){let{name:r,config:n}=p(t,e);return n?.mode==="date"?new Ae(r):new qe(r)}g$1();var je=class extends m{static[i]="PgDoublePrecisionBuilder";constructor(e){super(e,"number","PgDoublePrecision");}build(e){return new Oe(e,this.config)}},Oe=class extends o{static[i]="PgDoublePrecision";getSQLType(){return "double precision"}mapFromDriverValue(e){return typeof e=="string"?Number.parseFloat(e):e}};function dr(t){return new je(t??"")}g$1();var Ie=class extends m{static[i]="PgInetBuilder";constructor(e){super(e,"string","PgInet");}build(e){return new Ee(e,this.config)}},Ee=class extends o{static[i]="PgInet";getSQLType(){return "inet"}};function hr(t){return new Ie(t??"")}g$1();var Ue=class extends m{static[i]="PgIntervalBuilder";constructor(e,r){super(e,"string","PgInterval"),this.config.intervalConfig=r;}build(e){return new _e(e,this.config)}},_e=class extends o{static[i]="PgInterval";fields=this.config.intervalConfig.fields;precision=this.config.intervalConfig.precision;getSQLType(){let e=this.fields?` ${this.fields}`:"",r=this.precision?`(${this.precision})`:"";return `interval${e}${r}`}};function yr(t,e={}){let{name:r,config:n}=p(t,e);return new Ue(r,n)}g$1();var Re=class extends m{static[i]="PgJsonBuilder";constructor(e){super(e,"json","PgJson");}build(e){return new Je(e,this.config)}},Je=class extends o{static[i]="PgJson";constructor(e,r){super(e,r);}getSQLType(){return "json"}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e}};function br(t){return new Re(t??"")}g$1();var We=class extends m{static[i]="PgLineBuilder";constructor(e){super(e,"array","PgLine");}build(e){return new Me(e,this.config)}},Me=class extends o{static[i]="PgLine";getSQLType(){return "line"}mapFromDriverValue(e){let[r,n,u]=e.slice(1,-1).split(",");return [Number.parseFloat(r),Number.parseFloat(n),Number.parseFloat(u)]}mapToDriverValue(e){return `{${e[0]},${e[1]},${e[2]}}`}},Ge=class extends m{static[i]="PgLineABCBuilder";constructor(e){super(e,"json","PgLineABC");}build(e){return new He(e,this.config)}},He=class extends o{static[i]="PgLineABC";getSQLType(){return "line"}mapFromDriverValue(e){let[r,n,u]=e.slice(1,-1).split(",");return {a:Number.parseFloat(r),b:Number.parseFloat(n),c:Number.parseFloat(u)}}mapToDriverValue(e){return `{${e.a},${e.b},${e.c}}`}};function wr(t,e){let{name:r,config:n}=p(t,e);return !n?.mode||n.mode==="tuple"?new We(r):new Ge(r)}g$1();var Xe=class extends m{static[i]="PgMacaddrBuilder";constructor(e){super(e,"string","PgMacaddr");}build(e){return new Ye(e,this.config)}},Ye=class extends o{static[i]="PgMacaddr";getSQLType(){return "macaddr"}};function Cr(t){return new Xe(t??"")}g$1();var Ze=class extends m{static[i]="PgMacaddr8Builder";constructor(e){super(e,"string","PgMacaddr8");}build(e){return new ke(e,this.config)}},ke=class extends o{static[i]="PgMacaddr8";getSQLType(){return "macaddr8"}};function xr(t){return new Ze(t??"")}g$1();var et=class extends m{static[i]="PgNumericBuilder";constructor(e,r,n){super(e,"string","PgNumeric"),this.config.precision=r,this.config.scale=n;}build(e){return new tt(e,this.config)}},tt=class extends o{static[i]="PgNumeric";precision;scale;constructor(e,r){super(e,r),this.precision=r.precision,this.scale=r.scale;}mapFromDriverValue(e){return typeof e=="string"?e:String(e)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}},rt=class extends m{static[i]="PgNumericNumberBuilder";constructor(e,r,n){super(e,"number","PgNumericNumber"),this.config.precision=r,this.config.scale=n;}build(e){return new nt(e,this.config)}},nt=class extends o{static[i]="PgNumericNumber";precision;scale;constructor(e,r){super(e,r),this.precision=r.precision,this.scale=r.scale;}mapFromDriverValue(e){return typeof e=="number"?e:Number(e)}mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}},it=class extends m{static[i]="PgNumericBigIntBuilder";constructor(e,r,n){super(e,"bigint","PgNumericBigInt"),this.config.precision=r,this.config.scale=n;}build(e){return new st(e,this.config)}},st=class extends o{static[i]="PgNumericBigInt";precision;scale;constructor(e,r){super(e,r),this.precision=r.precision,this.scale=r.scale;}mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}};function ot(t,e){let{name:r,config:n}=p(t,e),u=n?.mode;return u==="number"?new rt(r,n?.precision,n?.scale):u==="bigint"?new it(r,n?.precision,n?.scale):new et(r,n?.precision,n?.scale)}var xo=ot;g$1();var ut=class extends m{static[i]="PgPointTupleBuilder";constructor(e){super(e,"array","PgPointTuple");}build(e){return new at(e,this.config)}},at=class extends o{static[i]="PgPointTuple";getSQLType(){return "point"}mapFromDriverValue(e){if(typeof e=="string"){let[r,n]=e.slice(1,-1).split(",");return [Number.parseFloat(r),Number.parseFloat(n)]}return [e.x,e.y]}mapToDriverValue(e){return `(${e[0]},${e[1]})`}},mt=class extends m{static[i]="PgPointObjectBuilder";constructor(e){super(e,"json","PgPointObject");}build(e){return new ct(e,this.config)}},ct=class extends o{static[i]="PgPointObject";getSQLType(){return "point"}mapFromDriverValue(e){if(typeof e=="string"){let[r,n]=e.slice(1,-1).split(",");return {x:Number.parseFloat(r),y:Number.parseFloat(n)}}return e}mapToDriverValue(e){return `(${e.x},${e.y})`}};function Pr(t,e){let{name:r,config:n}=p(t,e);return !n?.mode||n.mode==="tuple"?new ut(r):new mt(r)}g$1();g$1();function Or(t){let e=[];for(let r=0;r<t.length;r+=2)e.push(Number.parseInt(t.slice(r,r+2),16));return new Uint8Array(e)}function Sr(t,e){let r=new ArrayBuffer(8),n=new DataView(r);for(let u=0;u<8;u++)n.setUint8(u,t[e+u]);return n.getFloat64(0,true)}function lt(t){let e=Or(t),r=0,n=e[r];r+=1;let u=new DataView(e.buffer),c=u.getUint32(r,n===1);r+=4;if(c&536870912&&(u.getUint32(r,n===1),r+=4),(c&65535)===1){let y=Sr(e,r);r+=8;let w=Sr(e,r);return r+=8,[y,w]}throw new Error("Unsupported geometry type")}var ft=class extends m{static[i]="PgGeometryBuilder";constructor(e){super(e,"array","PgGeometry");}build(e){return new pt(e,this.config)}},pt=class extends o{static[i]="PgGeometry";getSQLType(){return "geometry(point)"}mapFromDriverValue(e){return lt(e)}mapToDriverValue(e){return `point(${e[0]} ${e[1]})`}},gt=class extends m{static[i]="PgGeometryObjectBuilder";constructor(e){super(e,"json","PgGeometryObject");}build(e){return new dt(e,this.config)}},dt=class extends o{static[i]="PgGeometryObject";getSQLType(){return "geometry(point)"}mapFromDriverValue(e){let r=lt(e);return {x:r[0],y:r[1]}}mapToDriverValue(e){return `point(${e.x} ${e.y})`}};function Tr(t,e){let{name:r,config:n}=p(t,e);return !n?.mode||n.mode==="tuple"?new ft(r):new gt(r)}g$1();var ht=class extends m{static[i]="PgRealBuilder";constructor(e,r){super(e,"number","PgReal"),this.config.length=r;}build(e){return new yt(e,this.config)}},yt=class extends o{static[i]="PgReal";constructor(e,r){super(e,r);}getSQLType(){return "real"}mapFromDriverValue=e=>typeof e=="string"?Number.parseFloat(e):e};function Nr(t){return new ht(t??"")}g$1();var bt=class extends m{static[i]="PgSerialBuilder";constructor(e){super(e,"number","PgSerial"),this.config.hasDefault=true,this.config.notNull=true;}build(e){return new wt(e,this.config)}},wt=class extends o{static[i]="PgSerial";getSQLType(){return "serial"}};function Dr(t){return new bt(t??"")}g$1();var Ct=class extends F{static[i]="PgSmallIntBuilder";constructor(e){super(e,"number","PgSmallInt");}build(e){return new xt(e,this.config)}},xt=class extends o{static[i]="PgSmallInt";getSQLType(){return "smallint"}mapFromDriverValue=e=>typeof e=="string"?Number(e):e};function vr(t){return new Ct(t??"")}g$1();var Pt=class extends m{static[i]="PgSmallSerialBuilder";constructor(e){super(e,"number","PgSmallSerial"),this.config.hasDefault=true,this.config.notNull=true;}build(e){return new St(e,this.config)}},St=class extends o{static[i]="PgSmallSerial";getSQLType(){return "smallserial"}};function Vr(t){return new Pt(t??"")}g$1();var Tt=class extends v{constructor(e,r,n){super(e,"string","PgTime"),this.withTimezone=r,this.precision=n,this.config.withTimezone=r,this.config.precision=n;}static[i]="PgTimeBuilder";build(e){return new Nt(e,this.config)}},Nt=class extends o{static[i]="PgTime";withTimezone;precision;constructor(e,r){super(e,r),this.withTimezone=r.withTimezone,this.precision=r.precision;}getSQLType(){return `time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}};function Fr(t,e={}){let{name:r,config:n}=p(t,e);return new Tt(r,n.withTimezone??false,n.precision)}g$1();var Dt=class extends m{static[i]="PgBinaryVectorBuilder";constructor(e,r){super(e,"string","PgBinaryVector"),this.config.dimensions=r.dimensions;}build(e){return new vt(e,this.config)}},vt=class extends o{static[i]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return `bit(${this.dimensions})`}};function zr(t,e){let{name:r,config:n}=p(t,e);return new Dt(r,n)}g$1();var Vt=class extends m{static[i]="PgHalfVectorBuilder";constructor(e,r){super(e,"array","PgHalfVector"),this.config.dimensions=r.dimensions;}build(e){return new Ft(e,this.config)}},Ft=class extends o{static[i]="PgHalfVector";dimensions=this.config.dimensions;getSQLType(){return `halfvec(${this.dimensions})`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){return e.slice(1,-1).split(",").map(r=>Number.parseFloat(r))}};function Br(t,e){let{name:r,config:n}=p(t,e);return new Vt(r,n)}g$1();var zt=class extends m{static[i]="PgSparseVectorBuilder";constructor(e,r){super(e,"string","PgSparseVector"),this.config.dimensions=r.dimensions;}build(e){return new Bt(e,this.config)}},Bt=class extends o{static[i]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return `sparsevec(${this.dimensions})`}};function Qr(t,e){let{name:r,config:n}=p(t,e);return new zt(r,n)}g$1();var Qt=class extends m{static[i]="PgVectorBuilder";constructor(e,r){super(e,"array","PgVector"),this.config.dimensions=r.dimensions;}build(e){return new Lt(e,this.config)}},Lt=class extends o{static[i]="PgVector";dimensions=this.config.dimensions;getSQLType(){return `vector(${this.dimensions})`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){return e.slice(1,-1).split(",").map(r=>Number.parseFloat(r))}};function Lr(t,e){let{name:r,config:n}=p(t,e);return new Qt(r,n)}function Ar(){return {bigint:ar,bigserial:mr,boolean:cr,char:lr,cidr:fr,customType:pr,date:gr,doublePrecision:dr,inet:hr,integer:rr,interval:yr,json:br,jsonb:nr,line:wr,macaddr:Cr,macaddr8:xr,numeric:ot,point:Pr,geometry:Tr,real:Nr,serial:Dr,smallint:vr,smallserial:Vr,text:ir,time:Fr,timestamp:sr,uuid:or,varchar:ur,bit:zr,halfvec:Br,sparsevec:Qr,vector:Lr}}var At=Symbol.for("drizzle:PgInlineForeignKeys"),Kr=Symbol.for("drizzle:EnableRLS"),j=class extends d{static[i]="PgTable";static Symbol=Object.assign({},d.Symbol,{InlineForeignKeys:At,EnableRLS:Kr});[At]=[];[Kr]=false;[d.Symbol.ExtraConfigBuilder]=void 0;[d.Symbol.ExtraConfigColumns]={}};function Ir(t,e,r,n,u=t){let c=new j(t,n,u),h=typeof e=="function"?e(Ar()):e,y=Object.fromEntries(Object.entries(h).map(([a,b])=>{let C=b;C.setName(a);let V=C.build(c);return c[At].push(...C.buildForeignKeys(V,c)),[a,V]})),w=Object.fromEntries(Object.entries(h).map(([a,b])=>{let C=b;C.setName(a);let V=C.buildExtraConfigColumn(c);return [a,V]})),x=Object.assign(c,y);return x[d.Symbol.Columns]=y,x[d.Symbol.ExtraConfigColumns]=w,r&&(x[j.Symbol.ExtraConfigBuilder]=r),Object.assign(x,{enableRLS:()=>(x[j.Symbol.EnableRLS]=true,x)})}var ma=(t,e,r)=>Ir(t,e,r,void 0);export{cr as $,P as A,L as B,Gn as C,Hn as D,Zt as E,kt as F,Xn as G,B as H,Yn as I,A as J,Q as K,Zn as L,kn as M,$ as N,ei as O,ti as P,ci as Q,tr as R,li as S,fi as T,pi as U,gi as V,di as W,hi as X,p as Y,yi as Z,bi as _,i as a,Ke as aa,Er as b,$e as ba,g as c,rr as ca,T as d,Je as da,O as e,ue as ea,N as f,nr as fa,o as g,tt as ga,Rt as h,xo as ha,z as i,ir as ia,Kt as j,Nt as ja,Xt as k,le as ka,D as l,pe as la,I as m,sr as ma,qt as n,de as na,$t as o,or as oa,_ as p,ur as pa,R as q,j as qa,q as r,ma as ra,jt as s,d as t,on as u,J as v,un as w,Yt as x,$r as y,S as z};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');chunkBUNLC3II_cjs.h();var t=[{name:"uploadDir",type:"text",label:"Upload Directory",defaultValue:"./public/uploads"},{name:"baseUrl",type:"text",label:"Base URL",defaultValue:"/uploads"}],i=[{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"region",type:"text",label:"Region",defaultValue:"us-east-1",admin:{placeholder:"us-east-1"}},{name:"accessKeyId",type:"text",label:"Access Key ID",required:true},{name:"secretAccessKey",type:"password",label:"Secret Access Key",required:true},{name:"endpoint",type:"text",label:"Endpoint URL",admin:{placeholder:"https://s3.custom.com"}},{name:"cdnUrl",type:"text",label:"CDN URL",admin:{placeholder:"https://cdn.example.com"}},{name:"prefix",type:"text",label:"Path Prefix",admin:{placeholder:"uploads"}}],r=[{name:"accountId",type:"text",label:"Account ID",required:true,admin:{placeholder:"Your Cloudflare Account ID"}},{name:"accessKeyId",type:"text",label:"Access Key ID",required:true},{name:"secretAccessKey",type:"password",label:"Secret Access Key",required:true},{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"publicDevUrl",type:"text",label:"Public Dev URL ID",admin:{placeholder:"pub-xxxxxxxxxxxxxxxx",description:"Enter ONLY the ID (e.g., pub-b8d8c4cc8bcf4d868ddd95efc1b305aa). Do NOT include https:// or the full URL. Found in R2 Dashboard \u2192 Public Dev URL."}},{name:"cdnUrl",type:"text",label:"Custom CDN URL",admin:{placeholder:"https://assets.example.com (optional)"}},{name:"prefix",type:"text",label:"Path Prefix",admin:{placeholder:"uploads (optional)",description:"Optional prefix for all object keys. Do not use '/' as prefix."}}],d=[{name:"cloudName",type:"text",label:"Cloud Name",required:true},{name:"apiKey",type:"text",label:"API Key",required:true},{name:"apiSecret",type:"password",label:"API Secret",required:true},{name:"folder",type:"text",label:"Folder",admin:{placeholder:"Optional folder path"}},{name:"uploadPreset",type:"text",label:"Upload Preset (optional)",admin:{placeholder:"Leave empty for signed uploads",description:"If not set, uploads will be signed with API Secret"}}],o=[{name:"host",type:"text",label:"Host",required:true,admin:{placeholder:"ftp.example.com"}},{name:"port",type:"number",label:"Port",defaultValue:21,admin:{placeholder:"21 for FTP"}},{name:"user",type:"text",label:"Username",required:true},{name:"password",type:"password",label:"Password",required:true},{name:"secure",type:"checkbox",label:"Use TLS/SSL",defaultValue:false,admin:{description:"Enable TLS/SSL for secure connections (FTP only)"}},{name:"baseUrl",type:"text",label:"Base URL",required:true,admin:{placeholder:"https://files.example.com"}},{name:"prefix",type:"text",label:"Path Prefix",admin:{placeholder:"uploads"}}],s=[{name:"note",type:"text",label:"Storage Status",defaultValue:"Cloudflare R2 Native Binding ('STORAGE_BUCKET') active.",admin:{readOnly:true}}],l=[{type:"local",displayName:"Local Server",configFields:t},{type:"cloudflare_r2",displayName:"Cloudflare Native Assets (R2 Binding)",configFields:s},{type:"aws",displayName:"S3 Compatible (AWS, Backblaze, Wasabi, etc.)",configFields:i},{type:"r2",displayName:"Cloudflare R2 (S3 API)",configFields:r},{type:"cloudinary",displayName:"Cloudinary",configFields:d},{type:"ftp",displayName:"FTP",configFields:o}],p=l.map(e=>({label:e.displayName,value:e.type})),n=l.map(e=>({name:e.type,type:"group",label:`${e.displayName} Settings`,admin:{condition:{field:"provider",equals:e.type}},fields:e.configFields})),u={slug:"storage-settings",label:"Storage Settings",admin:{group:"settings"},access:{read:()=>true,update:()=>true},fields:[{name:"provider",type:"select",label:"Storage Provider",defaultValue:"local",options:p},...n,{name:"limits",type:"group",label:"Upload Limits",fields:[{name:"maxFileSize",type:"number",label:"Max File Size (bytes)",defaultValue:10485760},{name:"allowedTypes",type:"json",label:"Allowed MIME Types",defaultValue:["image/*","video/*","audio/*","application/pdf"]},{name:"maxFilesPerUpload",type:"number",label:"Max Files per Upload",defaultValue:10}]}]};
|
|
2
|
+
exports.a=u;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import {createRequire}from'module';import {V as V$1,f}from'./chunk-XOACKBG7.js';import {g}from'./chunk-C2PXMVR5.js';import x from'https';import {Readable}from'stream';createRequire(import.meta.url);
|
|
2
|
+
g();g();function I(o){let e=o&&typeof o=="object"&&"reason"in o?o.reason:void 0;if(e){if(e instanceof Error){let n=new Error("Request aborted");return n.name="AbortError",n.cause=e,n}let r=new Error(String(e));return r.name="AbortError",r}let t=new Error("Request aborted");return t.name="AbortError",t}g();var B=["ECONNRESET","EPIPE","ETIMEDOUT"];g();var $=o=>{let e={};for(let t in o){let r=o[t];e[t]=Array.isArray(r)?r.join(","):r;}return e};g();g();g();var a={setTimeout:(o,e)=>setTimeout(o,e),clearTimeout:o=>clearTimeout(o)};var j=1e3,W=(o,e,t=0)=>{if(!t)return -1;let r=n=>{let c=a.setTimeout(()=>{o.destroy(),e(Object.assign(new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${t} ms.`),{name:"TimeoutError"}));},t-n),i=u=>{u?.connecting?u.on("connect",()=>{a.clearTimeout(c);}):a.clearTimeout(c);};o.socket?i(o.socket):o.on("socket",i);};return t<2e3?(r(0),0):a.setTimeout(r.bind(null,j),j)};g();var F=(o,e,t=0,r,n)=>t?a.setTimeout(()=>{let c=`@smithy/node-http-handler - [${r?"ERROR":"WARN"}] a request has exceeded the configured ${t} ms requestTimeout.`;if(r){let i=Object.assign(new Error(c),{name:"TimeoutError",code:"ETIMEDOUT"});o.destroy(i),e(i);}else c+=" Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.",n?.warn?.(c);},t):-1;g();var X=3e3,K=(o,{keepAlive:e,keepAliveMsecs:t},r=X)=>{if(e!==true)return -1;let n=()=>{o.socket?o.socket.setKeepAlive(e,t||0):o.on("socket",c=>{c.setKeepAlive(e,t||0);});};return r===0?(n(),0):a.setTimeout(n,r)};g();var M=3e3,V=(o,e,t=0)=>{let r=n=>{let c=t-n,i=()=>{o.destroy(),e(Object.assign(new Error(`@smithy/node-http-handler - the request socket timed out after ${t} ms of inactivity (configured by client requestHandler).`),{name:"TimeoutError"}));};o.socket?(o.socket.setTimeout(c,i),o.on("close",()=>o.socket?.removeListener("timeout",i))):o.setTimeout(c,i);};return 0<t&&t<6e3?(r(0),0):a.setTimeout(r.bind(null,t===0?0:M),M)};g();var Q=6e3;async function J(o,e,t=Q,r=false){let n=e.headers,c=n?n.Expect||n.expect:void 0,i=-1,u=true;!r&&c==="100-continue"&&(u=await Promise.race([new Promise(m=>{i=Number(a.setTimeout(()=>m(true),Math.max(Q,t)));}),new Promise(m=>{o.on("continue",()=>{a.clearTimeout(i),m(true);}),o.on("response",()=>{a.clearTimeout(i),m(false);}),o.on("error",()=>{a.clearTimeout(i),m(false);});})])),u&&Z(o,e.body);}function Z(o,e){if(e instanceof Readable){e.pipe(o);return}if(e){let t=Buffer.isBuffer(e);if(t||typeof e=="string"){t&&e.byteLength===0?o.end():o.end(e);return}let n=e;if(typeof n=="object"&&n.buffer&&typeof n.byteOffset=="number"&&typeof n.byteLength=="number"){o.end(Buffer.from(n.buffer,n.byteOffset,n.byteLength));return}o.end(Buffer.from(e));return}o.end();}var R,q,D=class o{config;configProvider;socketWarningTimestamp=0;externalAgent=false;metadata={handlerProtocol:"http/1.1"};static create(e){return typeof e?.handle=="function"?e:new o(e)}static checkSocketUsage(e,t,r=console){let{sockets:n,requests:c,maxSockets:i}=e;if(typeof i!="number"||i===1/0||Date.now()-15e3<t)return t;if(n&&c)for(let m in n){let T=n[m]?.length??0,h=c[m]?.length??0;if(T>=i&&h>=2*i)return r?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${T} and ${h} additional requests are enqueued.
|
|
3
|
+
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
4
|
+
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}constructor(e){this.configProvider=new Promise((t,r)=>{typeof e=="function"?e().then(n=>{t(this.resolveDefaultConfig(n));}).catch(r):t(this.resolveDefaultConfig(e));});}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy();}async handle(e,{abortSignal:t,requestTimeout:r}={}){this.config||(this.config=await this.configProvider);let n=this.config,c=e.protocol==="https:";return !c&&!this.config.httpAgent&&(this.config.httpAgent=await this.config.httpAgentProvider()),new Promise((i,u)=>{let m,T=-1,h=-1,A=-1,y=-1,v=-1,k=()=>{a.clearTimeout(T),a.clearTimeout(h),a.clearTimeout(A),a.clearTimeout(y),a.clearTimeout(v);},z=async f=>{await m,k(),i(f);},E=async f=>{await m,k(),u(f);};if(t?.aborted){let f=I(t);E(f);return}let _=e.headers,G=_?(_.Expect??_.expect)==="100-continue":false,O=c?n.httpsAgent:n.httpAgent;G&&!this.externalAgent&&(O=new(c?x.Agent:R)({keepAlive:false,maxSockets:1/0})),T=a.setTimeout(()=>{this.socketWarningTimestamp=o.checkSocketUsage(O,this.socketWarningTimestamp,n.logger);},n.socketAcquisitionWarningTimeout??(n.requestTimeout??2e3)+(n.connectionTimeout??1e3));let N=e.query?V$1(e.query):"",P;if(e.username!=null||e.password!=null){let f=e.username??"",g=e.password??"";P=`${f}:${g}`;}let S=e.path;N&&(S+=`?${N}`),e.fragment&&(S+=`#${e.fragment}`);let w=e.hostname??"";w[0]==="["&&w.endsWith("]")?w=e.hostname.slice(1,-1):w=e.hostname;let C={headers:e.headers,host:w,method:e.method,path:S,port:e.port,agent:O,auth:P},p=(c?x.request:q)(C,f$1=>{let g=new f({statusCode:f$1.statusCode||-1,reason:f$1.statusMessage,headers:$(f$1.headers),body:f$1});z({response:g});});if(p.on("error",f=>{B.includes(f.code)?E(Object.assign(f,{name:"TimeoutError"})):E(f);}),t){let f=()=>{p.destroy();let g=I(t);E(g);};if(typeof t.addEventListener=="function"){let g=t;g.addEventListener("abort",f,{once:true}),p.once("close",()=>g.removeEventListener("abort",f));}else t.onabort=f;}let L=r??n.requestTimeout;h=W(p,E,n.connectionTimeout),A=F(p,E,L,n.throwOnRequestTimeout,n.logger??console),y=V(p,E,n.socketTimeout);let b=C.agent;typeof b=="object"&&"keepAlive"in b&&(v=K(p,{keepAlive:b.keepAlive,keepAliveMsecs:b.keepAliveMsecs})),m=J(p,e,L,this.externalAgent).catch(f=>(k(),u(f)));})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(r=>({...r,[e]:t}));}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(e){let{requestTimeout:t,connectionTimeout:r,socketTimeout:n,socketAcquisitionWarningTimeout:c,httpAgent:i,httpsAgent:u,throwOnRequestTimeout:m,logger:T}=e||{},h=true,A=50;return {connectionTimeout:r,requestTimeout:t,socketTimeout:n,socketAcquisitionWarningTimeout:c,throwOnRequestTimeout:m,httpAgentProvider:async()=>{let y=await import('http'),{Agent:v,request:k}=y.default??y;return q=k,R=v,i instanceof R||typeof i?.destroy=="function"?(this.externalAgent=true,i):new R({keepAlive:h,maxSockets:A,...i})},httpsAgent:u instanceof x.Agent||typeof u?.destroy=="function"?(this.externalAgent=true,u):new x.Agent({keepAlive:h,maxSockets:A,...u}),logger:T}}};g();export{D as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkBAVN7VDR_cjs=require('./chunk-BAVN7VDR.cjs'),chunkVRZC4TTF_cjs=require('./chunk-VRZC4TTF.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');chunkBUNLC3II_cjs.h();var d=chunkVRZC4TTF_cjs.ra("users",{id:chunkVRZC4TTF_cjs.oa("id").primaryKey().defaultRandom(),name:chunkVRZC4TTF_cjs.pa("name",{length:255}),email:chunkVRZC4TTF_cjs.pa("email",{length:255}).notNull(),passwordHash:chunkVRZC4TTF_cjs.pa("password_hash",{length:255}),role:chunkVRZC4TTF_cjs.pa("role",{length:50}).notNull().default("customer"),tenantId:chunkVRZC4TTF_cjs.oa("tenant_id"),emailVerified:chunkVRZC4TTF_cjs.$("email_verified").default(false),avatar:chunkVRZC4TTF_cjs.pa("avatar",{length:255}),locked:chunkVRZC4TTF_cjs.$("locked").default(false),lastLogin:chunkVRZC4TTF_cjs.ma("last_login"),failedLoginAttempts:chunkVRZC4TTF_cjs.ca("failed_login_attempts").default(0),metadata:chunkVRZC4TTF_cjs.fa("metadata").$type(),createdAt:chunkVRZC4TTF_cjs.ma("created_at").defaultNow().notNull(),updatedAt:chunkVRZC4TTF_cjs.ma("updated_at").defaultNow().notNull()},e=>[chunkBAVN7VDR_cjs.b("users_email_idx").on(e.email),chunkBAVN7VDR_cjs.a("users_tenant_idx").on(e.tenantId),chunkBAVN7VDR_cjs.a("users_role_idx").on(e.role)]),_=chunkVRZC4TTF_cjs.ra("roles",{id:chunkVRZC4TTF_cjs.oa("id").primaryKey().defaultRandom(),name:chunkVRZC4TTF_cjs.pa("name",{length:100}).notNull().unique(),level:chunkVRZC4TTF_cjs.ca("level").notNull().default(0),inherits:chunkVRZC4TTF_cjs.ia("inherits").array(),description:chunkVRZC4TTF_cjs.ia("description"),permissions:chunkVRZC4TTF_cjs.fa("permissions").$type().default([]),isSystem:chunkVRZC4TTF_cjs.$("is_system").default(false),createdAt:chunkVRZC4TTF_cjs.ma("created_at").defaultNow().notNull(),updatedAt:chunkVRZC4TTF_cjs.ma("updated_at").defaultNow().notNull()},e=>[chunkBAVN7VDR_cjs.a("roles_level_idx").on(e.level)]),m=chunkVRZC4TTF_cjs.ra("permissions",{id:chunkVRZC4TTF_cjs.oa("id").primaryKey().defaultRandom(),roleId:chunkVRZC4TTF_cjs.oa("role_id").references(()=>_.id,{onDelete:"cascade"}),resource:chunkVRZC4TTF_cjs.pa("resource",{length:100}).notNull(),action:chunkVRZC4TTF_cjs.pa("action",{length:50}).notNull(),conditions:chunkVRZC4TTF_cjs.fa("conditions").$type(),createdAt:chunkVRZC4TTF_cjs.ma("created_at").defaultNow().notNull()},e=>[chunkBAVN7VDR_cjs.a("permissions_role_idx").on(e.roleId),chunkBAVN7VDR_cjs.a("permissions_resource_idx").on(e.resource)]),x=chunkVRZC4TTF_cjs.ra("sessions",{id:chunkVRZC4TTF_cjs.oa("id").primaryKey().defaultRandom(),userId:chunkVRZC4TTF_cjs.oa("user_id").notNull().references(()=>d.id,{onDelete:"cascade"}),token:chunkVRZC4TTF_cjs.pa("token",{length:512}).notNull().unique(),refreshToken:chunkVRZC4TTF_cjs.pa("refresh_token",{length:512}),ipAddress:chunkVRZC4TTF_cjs.pa("ip_address",{length:45}),userAgent:chunkVRZC4TTF_cjs.ia("user_agent"),expiresAt:chunkVRZC4TTF_cjs.ma("expires_at").notNull(),createdAt:chunkVRZC4TTF_cjs.ma("created_at").defaultNow().notNull()},e=>[chunkBAVN7VDR_cjs.a("sessions_user_idx").on(e.userId),chunkBAVN7VDR_cjs.a("sessions_token_idx").on(e.token),chunkBAVN7VDR_cjs.a("sessions_expires_idx").on(e.expiresAt)]),g=chunkVRZC4TTF_cjs.ra("audit_logs",{id:chunkVRZC4TTF_cjs.oa("id").primaryKey().defaultRandom(),action:chunkVRZC4TTF_cjs.pa("action",{length:100}).notNull(),userId:chunkVRZC4TTF_cjs.oa("user_id").references(()=>d.id,{onDelete:"set null"}),userEmail:chunkVRZC4TTF_cjs.pa("user_email",{length:255}),role:chunkVRZC4TTF_cjs.pa("role",{length:50}),resource:chunkVRZC4TTF_cjs.pa("resource",{length:100}).notNull(),resourceId:chunkVRZC4TTF_cjs.pa("resource_id",{length:255}),changes:chunkVRZC4TTF_cjs.fa("changes").$type(),ipAddress:chunkVRZC4TTF_cjs.pa("ip_address",{length:45}),userAgent:chunkVRZC4TTF_cjs.ia("user_agent"),success:chunkVRZC4TTF_cjs.$("success").notNull().default(true),error:chunkVRZC4TTF_cjs.ia("error"),metadata:chunkVRZC4TTF_cjs.fa("metadata").$type(),timestamp:chunkVRZC4TTF_cjs.ma("timestamp").defaultNow().notNull()},e=>[chunkBAVN7VDR_cjs.a("audit_logs_user_idx").on(e.userId),chunkBAVN7VDR_cjs.a("audit_logs_action_idx").on(e.action),chunkBAVN7VDR_cjs.a("audit_logs_resource_idx").on(e.resource),chunkBAVN7VDR_cjs.a("audit_logs_timestamp_idx").on(e.timestamp)]),N=chunkVRZC4TTF_cjs.ra("tenants",{id:chunkVRZC4TTF_cjs.oa("id").primaryKey().defaultRandom(),name:chunkVRZC4TTF_cjs.pa("name",{length:255}).notNull(),slug:chunkVRZC4TTF_cjs.pa("slug",{length:100}).notNull().unique(),settings:chunkVRZC4TTF_cjs.fa("settings").$type().default({}),isActive:chunkVRZC4TTF_cjs.$("is_active").default(true),createdAt:chunkVRZC4TTF_cjs.ma("created_at").defaultNow().notNull(),updatedAt:chunkVRZC4TTF_cjs.ma("updated_at").defaultNow().notNull()},e=>[chunkBAVN7VDR_cjs.b("tenants_slug_idx").on(e.slug)]),h=chunkVRZC4TTF_cjs.ra("api_keys",{id:chunkVRZC4TTF_cjs.oa("id").primaryKey().defaultRandom(),userId:chunkVRZC4TTF_cjs.oa("user_id").notNull().references(()=>d.id,{onDelete:"cascade"}),name:chunkVRZC4TTF_cjs.pa("name",{length:255}).notNull(),key:chunkVRZC4TTF_cjs.pa("key",{length:64}).notNull().unique(),keyPrefix:chunkVRZC4TTF_cjs.pa("key_prefix",{length:8}).notNull(),permissions:chunkVRZC4TTF_cjs.fa("permissions").$type().default([]),lastUsedAt:chunkVRZC4TTF_cjs.ma("last_used_at"),expiresAt:chunkVRZC4TTF_cjs.ma("expires_at"),createdAt:chunkVRZC4TTF_cjs.ma("created_at").defaultNow().notNull()},e=>[chunkBAVN7VDR_cjs.a("api_keys_user_idx").on(e.userId),chunkBAVN7VDR_cjs.a("api_keys_key_idx").on(e.key)]),A=chunkVRZC4TTF_cjs.ra("email_verifications",{id:chunkVRZC4TTF_cjs.oa("id").primaryKey().defaultRandom(),userId:chunkVRZC4TTF_cjs.oa("user_id").notNull().references(()=>d.id,{onDelete:"cascade"}),token:chunkVRZC4TTF_cjs.pa("token",{length:64}).notNull().unique(),expiresAt:chunkVRZC4TTF_cjs.ma("expires_at").notNull(),createdAt:chunkVRZC4TTF_cjs.ma("created_at").defaultNow().notNull()},e=>[chunkBAVN7VDR_cjs.a("email_verifications_token_idx").on(e.token),chunkBAVN7VDR_cjs.a("email_verifications_user_idx").on(e.userId)]),k=chunkVRZC4TTF_cjs.ra("password_resets",{id:chunkVRZC4TTF_cjs.oa("id").primaryKey().defaultRandom(),userId:chunkVRZC4TTF_cjs.oa("user_id").notNull().references(()=>d.id,{onDelete:"cascade"}),token:chunkVRZC4TTF_cjs.pa("token",{length:64}).notNull().unique(),expiresAt:chunkVRZC4TTF_cjs.ma("expires_at").notNull(),usedAt:chunkVRZC4TTF_cjs.ma("used_at"),createdAt:chunkVRZC4TTF_cjs.ma("created_at").defaultNow().notNull()},e=>[chunkBAVN7VDR_cjs.a("password_resets_token_idx").on(e.token),chunkBAVN7VDR_cjs.a("password_resets_user_idx").on(e.userId)]),w=chunkVRZC4TTF_cjs.ra("password_history",{id:chunkVRZC4TTF_cjs.oa("id").primaryKey().defaultRandom(),userId:chunkVRZC4TTF_cjs.oa("user_id").notNull().references(()=>d.id,{onDelete:"cascade"}),passwordHash:chunkVRZC4TTF_cjs.pa("password_hash",{length:255}).notNull(),createdAt:chunkVRZC4TTF_cjs.ma("created_at").defaultNow().notNull()},e=>[chunkBAVN7VDR_cjs.a("password_history_user_idx").on(e.userId)]),I=chunkVRZC4TTF_cjs.ra("lockouts",{id:chunkVRZC4TTF_cjs.oa("id").primaryKey().defaultRandom(),userId:chunkVRZC4TTF_cjs.oa("user_id").notNull().references(()=>d.id,{onDelete:"cascade"}),ipAddress:chunkVRZC4TTF_cjs.pa("ip_address",{length:45}),reason:chunkVRZC4TTF_cjs.pa("reason",{length:255}),lockedUntil:chunkVRZC4TTF_cjs.ma("locked_until").notNull(),releasedAt:chunkVRZC4TTF_cjs.ma("released_at"),createdAt:chunkVRZC4TTF_cjs.ma("created_at").defaultNow().notNull()},e=>[chunkBAVN7VDR_cjs.a("lockouts_user_idx").on(e.userId),chunkBAVN7VDR_cjs.a("lockouts_ip_idx").on(e.ipAddress),chunkBAVN7VDR_cjs.a("lockouts_locked_until_idx").on(e.lockedUntil)]);exports.a=d;exports.b=_;exports.c=m;exports.d=x;exports.e=g;exports.f=N;exports.g=h;exports.h=A;exports.i=k;exports.j=w;exports.k=I;
|