@kyro-cms/core 0.13.5 → 0.13.6
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/api-handler-graphql.cjs +1 -1
- package/dist/api-handler-graphql.js +2 -2
- package/dist/api-handler-trpc.cjs +1 -1
- package/dist/api-handler-trpc.js +2 -2
- package/dist/api-handler.cjs +1 -1
- package/dist/api-handler.js +1 -1
- package/dist/auth-session-4WJUKESW.js +1 -0
- package/dist/auth-session-VHUHDBCL.cjs +1 -0
- package/dist/bootstrap-JYAUQ52D.cjs +1 -0
- package/dist/bootstrap-TTMLNQM3.js +1 -0
- package/dist/chunk-23RSKVJP.cjs +1 -0
- package/dist/chunk-24W5I6SJ.cjs +2 -0
- package/dist/{chunk-CH4TZZI5.js → chunk-2I2AXTKY.cjs} +38 -39
- package/dist/chunk-34LCWI5X.cjs +1 -0
- package/dist/chunk-3A5UO6OQ.cjs +114 -0
- package/dist/chunk-3N34WXBS.js +2 -0
- package/dist/chunk-5BUAWCU6.js +91 -0
- package/dist/{chunk-7NKNSRCB.cjs → chunk-5I3BM5TV.js} +33 -32
- package/dist/chunk-5RBGM5N5.js +3 -0
- package/dist/chunk-7EY3GXRA.js +2 -0
- package/dist/chunk-7KTPBTH5.cjs +1 -0
- package/dist/chunk-A4XM33WO.js +109 -0
- package/dist/chunk-A7763NCF.cjs +19 -0
- package/dist/chunk-AQWTJGML.cjs +1 -0
- package/dist/chunk-CIWLQXB2.js +2 -0
- package/dist/chunk-DCFOVCJX.cjs +1 -0
- package/dist/chunk-DCKJT247.cjs +1 -0
- package/dist/chunk-EG4SRTYS.cjs +2 -0
- package/dist/chunk-FAG2645P.js +2 -0
- package/dist/chunk-FIVTKI25.cjs +3 -0
- package/dist/chunk-FU76HURF.cjs +1 -0
- package/dist/chunk-GDLMPZKD.cjs +2 -0
- package/dist/chunk-GS4CMYKS.cjs +1 -0
- package/dist/chunk-GTAKGVUY.js +2 -0
- package/dist/chunk-GWUHIIPO.cjs +132 -0
- package/dist/chunk-H2IJDTA2.cjs +1 -0
- package/dist/chunk-HACW42ZZ.cjs +108 -0
- package/dist/chunk-HCM2G674.cjs +20 -0
- package/dist/chunk-I22MSXGL.js +2 -0
- package/dist/chunk-IIPSXKNV.js +115 -0
- package/dist/{chunk-WNU76M2C.js → chunk-IIVBEZC2.js} +6 -6
- package/dist/chunk-JHFD3IAU.cjs +1 -0
- package/dist/chunk-JJY2F6NL.cjs +3 -0
- package/dist/chunk-JQ4V2MGJ.cjs +2 -0
- package/dist/chunk-JXJTFBHG.js +3 -0
- package/dist/chunk-KOSR7235.cjs +1 -0
- package/dist/chunk-KUY4QDAL.js +2 -0
- package/dist/chunk-LGUHXOEW.js +3 -0
- package/dist/chunk-LXTVMP5F.cjs +6 -0
- package/dist/chunk-N25DOGLQ.js +5 -0
- package/dist/chunk-N2BMGZIX.cjs +90 -0
- package/dist/chunk-N7CDHWQH.cjs +2 -0
- package/dist/chunk-NBBAMC2X.cjs +1 -0
- package/dist/chunk-NGNXOXI5.js +2 -0
- package/dist/chunk-O4PPZOVI.cjs +1 -0
- package/dist/chunk-O4RKZQYQ.js +2 -0
- package/dist/chunk-OJBL4CXK.cjs +2 -0
- package/dist/chunk-OPKZYQV7.js +3 -0
- package/dist/chunk-OXEJCIOA.cjs +1 -0
- package/dist/chunk-OXH6CANN.js +2 -0
- package/dist/{chunk-EQN3HDES.cjs → chunk-PW6Y5MQL.cjs} +5 -5
- package/dist/chunk-RLW6AQF2.js +2 -0
- package/dist/chunk-SBFVITY2.js +7 -0
- package/dist/chunk-SEJ7LMYY.js +4 -0
- package/dist/chunk-SZY25KAE.js +21 -0
- package/dist/chunk-TG5YQ4PB.cjs +4 -0
- package/dist/chunk-TJ6N5ZPZ.js +133 -0
- package/dist/chunk-V2RMDMWN.js +2 -0
- package/dist/chunk-V4SR7DU5.js +3 -0
- package/dist/chunk-VLFM66BZ.js +4 -0
- package/dist/chunk-VPBGZW4P.cjs +1 -0
- package/dist/chunk-VQWOCGJ2.cjs +1 -0
- package/dist/chunk-VWXHW74B.js +3 -0
- package/dist/chunk-W5GDZG64.js +2 -0
- package/dist/chunk-WLSVS3NC.js +2 -0
- package/dist/chunk-YLP3EKTQ.js +2 -0
- package/dist/chunk-YNSKDTFG.js +2 -0
- package/dist/chunk-YOJOVQIH.cjs +1 -0
- package/dist/chunk-ZE2X3FBU.js +20 -0
- package/dist/chunk-ZMH35QYG.js +2 -0
- package/dist/cli/index.cjs +53 -182
- package/dist/cli/index.js +54 -183
- package/dist/drizzle/index.cjs +1 -1
- package/dist/drizzle/index.js +1 -1
- package/dist/fields/index.cjs +1 -1
- package/dist/fields/index.js +1 -1
- package/dist/graphql/index.cjs +1 -1
- package/dist/graphql/index.js +1 -1
- package/dist/index.cjs +30 -30
- package/dist/index.js +31 -31
- package/dist/integration.cjs +1 -1
- package/dist/integration.js +1 -1
- package/dist/local-DKP43BWQ.cjs +1 -0
- package/dist/local-TF5ZMHWW.js +1 -0
- package/dist/media-M3EIZ4QS.cjs +1 -0
- package/dist/media-WYEILC6K.js +1 -0
- package/dist/mongo-auth-adapter-33M5ENM7.cjs +1 -0
- package/dist/mongo-auth-adapter-4ITULS2P.js +1 -0
- package/dist/mongodb/index.cjs +1 -1
- package/dist/mongodb/index.js +1 -1
- package/dist/nodemailer-transport-7F3VLLBW.js +1 -0
- package/dist/nodemailer-transport-WAPZD3SJ.cjs +1 -0
- package/dist/postgres-auth-adapter-7BCPXNBO.js +1 -0
- package/dist/postgres-auth-adapter-HMXFUM5W.cjs +1 -0
- package/dist/redis-adapter-2E5AWMMA.cjs +1 -0
- package/dist/redis-adapter-GFH74CF4.js +1 -0
- package/dist/rest/index.cjs +1 -1
- package/dist/rest/index.js +1 -1
- package/dist/schema-FNIDQKIJ.cjs +1 -0
- package/dist/schema-KD736QFN.js +1 -0
- package/dist/sqlite-adapter-HL53RLSN.cjs +1 -0
- package/dist/sqlite-adapter-TT6ZASDG.js +1 -0
- package/dist/templates/index.cjs +1 -1
- package/dist/templates/index.js +1 -1
- package/dist/trpc/index.cjs +1 -1
- package/dist/trpc/index.js +1 -1
- package/dist/ws/index.cjs +1 -1
- package/dist/ws/index.js +1 -1
- package/package.json +2 -10
- package/dist/WebhookService-CGxHtw7E.d.cts +0 -143
- package/dist/WebhookService-CNC1lYz7.d.ts +0 -143
- package/dist/auth-session-DHVGXHOH.cjs +0 -1
- package/dist/auth-session-O7IIH7EP.js +0 -1
- package/dist/base-A9AJPCG5.d.ts +0 -219
- package/dist/base-C6wyX2nC.d.cts +0 -219
- package/dist/bcryptjs-WIQSWJGK.cjs +0 -1
- package/dist/bcryptjs-ZEEHSMAG.js +0 -2
- package/dist/better-sqlite3-5IISPX34.cjs +0 -1
- package/dist/better-sqlite3-B34RIU4C.js +0 -2
- package/dist/bootstrap-PG2LGDLB.js +0 -1
- package/dist/bootstrap-YD3GLTWX.cjs +0 -1
- package/dist/bowser-SB3ZUPO4.js +0 -11
- package/dist/bowser-VX6B6ZSE.cjs +0 -10
- package/dist/chokidar-5RVQZVHP.cjs +0 -5
- package/dist/chokidar-BOYGRT4Q.js +0 -6
- package/dist/chunk-262YP5XA.cjs +0 -1
- package/dist/chunk-2HA6EKXX.js +0 -24
- package/dist/chunk-2SPWRQ5O.js +0 -122
- package/dist/chunk-2TYITUOC.js +0 -122
- package/dist/chunk-35PGCW3S.cjs +0 -1
- package/dist/chunk-3CIMGC2F.cjs +0 -56
- package/dist/chunk-3KZXF4US.js +0 -2
- package/dist/chunk-3NSZZCOJ.js +0 -2
- package/dist/chunk-3TAUNYEM.js +0 -8
- package/dist/chunk-3VXEK5ZW.cjs +0 -1
- package/dist/chunk-47CXBWMA.js +0 -2
- package/dist/chunk-4BMWWGJN.js +0 -384
- package/dist/chunk-4NTIK6DF.cjs +0 -2
- package/dist/chunk-6E44MQQ5.js +0 -115
- package/dist/chunk-6LWF5MPL.js +0 -20
- package/dist/chunk-6NBZDW53.js +0 -133
- package/dist/chunk-6TPICJ2L.js +0 -7
- package/dist/chunk-6YS6XLOD.cjs +0 -121
- package/dist/chunk-73D2PNHD.cjs +0 -7
- package/dist/chunk-7ACHOBWY.cjs +0 -13
- package/dist/chunk-7GGZA5YU.cjs +0 -2
- package/dist/chunk-7JWQ2PZP.cjs +0 -1
- package/dist/chunk-7KLEANTO.cjs +0 -1
- package/dist/chunk-7MNDQU6K.js +0 -8
- package/dist/chunk-7NH7H3WA.js +0 -10
- package/dist/chunk-7WMMKGEO.cjs +0 -1
- package/dist/chunk-ALTU3FDG.js +0 -2
- package/dist/chunk-BAVN7VDR.cjs +0 -1
- package/dist/chunk-BCEE4NBZ.cjs +0 -2
- package/dist/chunk-BUNLC3II.cjs +0 -1
- package/dist/chunk-C7QCZX7X.js +0 -2
- package/dist/chunk-D6SDGHY6.js +0 -2
- package/dist/chunk-DVWYO3KK.cjs +0 -1
- package/dist/chunk-EHWUALGH.cjs +0 -1
- package/dist/chunk-EML5FDUU.js +0 -2
- package/dist/chunk-EN65ZEK2.cjs +0 -2
- package/dist/chunk-EW424IBO.cjs +0 -1
- package/dist/chunk-EZIDQBXI.cjs +0 -1
- package/dist/chunk-F2O4QO5N.cjs +0 -383
- package/dist/chunk-F4ITQ6XQ.cjs +0 -3
- package/dist/chunk-FK2BG4HU.js +0 -3
- package/dist/chunk-FLMUMPDE.js +0 -2
- package/dist/chunk-GIS6X43A.cjs +0 -3
- package/dist/chunk-GNEVCEJU.cjs +0 -3
- package/dist/chunk-GNOSG3PK.cjs +0 -1
- package/dist/chunk-GQGFNTDZ.js +0 -2
- package/dist/chunk-GTR7JAKP.cjs +0 -3
- package/dist/chunk-HPIJI7TM.js +0 -3
- package/dist/chunk-HPYH7GTS.cjs +0 -1
- package/dist/chunk-HRAY65XH.js +0 -3
- package/dist/chunk-HTYVI2HK.cjs +0 -9
- package/dist/chunk-IKGVPXMK.js +0 -3
- package/dist/chunk-J6V573PE.cjs +0 -1
- package/dist/chunk-JA44K75G.js +0 -2
- package/dist/chunk-JRUQ5ABB.js +0 -4
- package/dist/chunk-JV4HJBXW.js +0 -14
- package/dist/chunk-KEITOXIP.js +0 -2
- package/dist/chunk-KMFLHGD5.cjs +0 -1
- package/dist/chunk-KZHXYXSH.cjs +0 -10
- package/dist/chunk-L3Q64RUX.js +0 -3
- package/dist/chunk-LEBM6ZSZ.cjs +0 -10
- package/dist/chunk-LKRI5X2V.cjs +0 -1
- package/dist/chunk-LQ3YZTPU.cjs +0 -15
- package/dist/chunk-LVBHOZZF.js +0 -4
- package/dist/chunk-LWM4WABU.js +0 -3
- package/dist/chunk-LY7N3UHH.cjs +0 -23
- package/dist/chunk-MCIZG4A3.cjs +0 -1
- package/dist/chunk-MDLJTZLV.cjs +0 -1
- package/dist/chunk-N4FXLQE3.cjs +0 -132
- package/dist/chunk-N5POANYV.js +0 -2
- package/dist/chunk-NGNJSUGL.cjs +0 -1
- package/dist/chunk-NRE6VKL6.cjs +0 -121
- package/dist/chunk-O4YE57OS.cjs +0 -6
- package/dist/chunk-OBYAIJVU.js +0 -11
- package/dist/chunk-OLRCZ6E3.js +0 -2
- package/dist/chunk-OOVNTOZC.cjs +0 -56
- package/dist/chunk-P6JITOFF.js +0 -4
- package/dist/chunk-PITMDQYN.cjs +0 -18
- package/dist/chunk-PYUWSKKP.js +0 -57
- package/dist/chunk-Q5TFO66G.cjs +0 -1
- package/dist/chunk-QO5ZWQA3.cjs +0 -74
- package/dist/chunk-QYN6C3FZ.cjs +0 -114
- package/dist/chunk-REQ622YC.js +0 -3
- package/dist/chunk-RPRGGGIW.js +0 -11
- package/dist/chunk-RVBSJ4UQ.cjs +0 -7
- package/dist/chunk-RYHOWZLK.js +0 -2
- package/dist/chunk-RYXLEFS5.js +0 -2
- package/dist/chunk-SBNMXQNO.cjs +0 -2
- package/dist/chunk-SLMIYECU.js +0 -2
- package/dist/chunk-SRIXRJHL.js +0 -4
- package/dist/chunk-TBHNE4VV.js +0 -2
- package/dist/chunk-TCFL3UWT.cjs +0 -2
- package/dist/chunk-TYQYKKWJ.js +0 -16
- package/dist/chunk-U6KFONKM.js +0 -2
- package/dist/chunk-UNYXWPLZ.cjs +0 -2
- package/dist/chunk-UWHWSWDE.js +0 -2
- package/dist/chunk-V4FAL7AG.js +0 -2
- package/dist/chunk-VQ53TFYA.cjs +0 -1
- package/dist/chunk-VRZC4TTF.cjs +0 -1
- package/dist/chunk-W45TLOOT.js +0 -2
- package/dist/chunk-WAVGRSE6.js +0 -2
- package/dist/chunk-WPM6LFCY.js +0 -2
- package/dist/chunk-WXT2XW7T.js +0 -13
- package/dist/chunk-X473JI7Z.js +0 -75
- package/dist/chunk-X6HUA6EF.cjs +0 -20
- package/dist/chunk-XDPLVJRO.js +0 -21
- package/dist/chunk-XDQVYCIR.cjs +0 -1
- package/dist/chunk-XFYSADHV.cjs +0 -2
- package/dist/chunk-XOR64WUQ.cjs +0 -19
- package/dist/chunk-Y2YAKDEQ.js +0 -2
- package/dist/chunk-YENNL5HG.js +0 -2
- package/dist/chunk-YGI5W4RS.js +0 -2
- package/dist/chunk-YIFKTA5N.js +0 -57
- package/dist/chunk-YUUXFD73.js +0 -19
- package/dist/chunk-ZAKYTBEN.js +0 -3
- package/dist/chunk-ZHA446FA.cjs +0 -1
- package/dist/chunk-ZTLGK6R4.cjs +0 -12
- package/dist/chunk-ZUBJ6RLQ.cjs +0 -1
- package/dist/client.d.cts +0 -1291
- package/dist/client.d.ts +0 -1291
- package/dist/d1-5ZQJOFDX.cjs +0 -1
- package/dist/d1-HPB6B253.js +0 -2
- package/dist/dist-es-3SSNUZST.cjs +0 -1
- package/dist/dist-es-64F22JL2.js +0 -2
- package/dist/dist-es-A5OF2STN.cjs +0 -2
- package/dist/dist-es-BOW5V247.cjs +0 -6
- package/dist/dist-es-CRIMATLL.cjs +0 -2
- package/dist/dist-es-DL3VLVP6.cjs +0 -1
- package/dist/dist-es-F2ZR55UK.js +0 -4
- package/dist/dist-es-IPSSZNFP.js +0 -1
- package/dist/dist-es-M2F7M27Y.js +0 -2
- package/dist/dist-es-M66JKZF5.js +0 -7
- package/dist/dist-es-OKLLRYI3.js +0 -2
- package/dist/dist-es-P25IKLBI.cjs +0 -1
- package/dist/dist-es-SRPWSAF4.cjs +0 -1
- package/dist/dist-es-SVHZDVUF.js +0 -3
- package/dist/dist-es-T2H2W5BX.cjs +0 -3
- package/dist/dist-es-WFI55HKT.js +0 -3
- package/dist/drizzle-orm-47ELDEM6.cjs +0 -1
- package/dist/drizzle-orm-XRTSOQJS.js +0 -1
- package/dist/event-streams-7NAWZW2I.js +0 -1
- package/dist/event-streams-JBMWCI2O.cjs +0 -1
- package/dist/fs-KWBRQ6T6.js +0 -1
- package/dist/fs-ZQYOJOIO.cjs +0 -1
- package/dist/index-NGnJpSgf.d.ts +0 -105
- package/dist/index-Zrg3sZ6R.d.cts +0 -105
- package/dist/jsonwebtoken-DFB6ZBZA.cjs +0 -8
- package/dist/jsonwebtoken-OD67R5JS.js +0 -9
- package/dist/lib-A2D63VXD.cjs +0 -1
- package/dist/lib-JQD2JAOO.js +0 -2
- package/dist/loadSso-JY4WDQPS.cjs +0 -2
- package/dist/loadSso-UQR6545M.js +0 -3
- package/dist/local-6UUGBZ4M.js +0 -1
- package/dist/local-ZYHV3J2K.cjs +0 -1
- package/dist/media-3Z6YW5J4.cjs +0 -1
- package/dist/media-E762GEHL.js +0 -1
- package/dist/mongo-auth-adapter-2H2AXDRH.cjs +0 -1
- package/dist/mongo-auth-adapter-YWMEOC42.js +0 -1
- package/dist/nodemailer-IDML4L6W.cjs +0 -53
- package/dist/nodemailer-NITB45SS.js +0 -54
- package/dist/nodemailer-transport-3VWVUBM5.cjs +0 -1
- package/dist/nodemailer-transport-7RHATUKL.js +0 -1
- package/dist/postgres-auth-adapter-QKBNXVPT.js +0 -1
- package/dist/postgres-auth-adapter-WMLM4UUC.cjs +0 -1
- package/dist/postgres-js-7YBZKGXG.cjs +0 -1
- package/dist/postgres-js-JLFIWOBH.js +0 -1
- package/dist/redis-adapter-EVK2SMKH.cjs +0 -1
- package/dist/redis-adapter-LY2NBSAG.js +0 -1
- package/dist/schema-RT6WSUYC.cjs +0 -1
- package/dist/schema-YFMSJK2P.js +0 -2
- package/dist/signin-N3T2KF5Q.js +0 -3
- package/dist/signin-VFBLX7EL.cjs +0 -2
- package/dist/sqlite-adapter-KPSISY6E.cjs +0 -1
- package/dist/sqlite-adapter-PI6SIY7O.js +0 -1
- package/dist/src-6LAUXXDM.cjs +0 -1
- package/dist/src-QBADSZV4.js +0 -1
- package/dist/sso-oidc-54BIRYR6.cjs +0 -2
- package/dist/sso-oidc-UB7G4END.js +0 -3
- package/dist/sts-WAA6I22C.js +0 -3
- package/dist/sts-YLXXIB3X.cjs +0 -2
- package/dist/types-BCOhfwHC.d.ts +0 -839
- package/dist/types-DxaK39ix.d.cts +0 -330
- package/dist/types-DxaK39ix.d.ts +0 -330
- package/dist/types-QglJ7PwT.d.cts +0 -839
package/dist/chunk-73D2PNHD.cjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
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;
|
package/dist/chunk-7ACHOBWY.cjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
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;
|
package/dist/chunk-7GGZA5YU.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
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;
|
package/dist/chunk-7JWQ2PZP.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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;
|
package/dist/chunk-7KLEANTO.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkOOVNTOZC_cjs=require('./chunk-OOVNTOZC.cjs'),chunkEW424IBO_cjs=require('./chunk-EW424IBO.cjs'),chunkNRE6VKL6_cjs=require('./chunk-NRE6VKL6.cjs'),chunkEQN3HDES_cjs=require('./chunk-EQN3HDES.cjs'),chunkN4FXLQE3_cjs=require('./chunk-N4FXLQE3.cjs'),chunkQYN6C3FZ_cjs=require('./chunk-QYN6C3FZ.cjs'),chunkJ6V573PE_cjs=require('./chunk-J6V573PE.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs'),w=require('kyro:config');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var w__default=/*#__PURE__*/_interopDefault(w);chunkBUNLC3II_cjs.h();exports.a=null;var l=null;async function b(){if(!exports.a){if(globalThis.__KYRO_INSTANCE__)try{await globalThis.__KYRO_INSTANCE__.shutdown();}catch{}try{let e=w__default.default.default||w__default.default,t=e.adapter,o=t&&!t.dialect&&typeof t.connect=="function";if(globalThis.DB&&(!t||o)){let s=globalThis.DB;e.adapter=new chunkN4FXLQE3_cjs.c({type:"sqlite",client:s}),chunkOOVNTOZC_cjs.K.info("Hot-swapped to D1 DrizzleAdapter");}exports.a=chunkOOVNTOZC_cjs.H(e),await exports.a.init();let a=e.adapter,p=a&&a.dialect&&(a.dialect==="postgres"||a.dialect==="sqlite"),c=a&&a.dialect==="mongodb",n;if(p)a.dialect==="postgres"?n=new chunkQYN6C3FZ_cjs.a({db:a.client}):a.dialect==="sqlite"&&(n=new chunkNRE6VKL6_cjs.hb({db:a.rawClient||a.client}));else if(o&&!globalThis.DB){let s=process.env.KYRO_AUTH_DB_PATH||"./data/auth.db";n=new chunkEQN3HDES_cjs.a({path:s});}else c&&(n=new chunkJ6V573PE_cjs.a({adapter:a}));if(n?.connect)try{await n.connect();}catch(s){chunkOOVNTOZC_cjs.K.warn("Auth connect warning:",s);}try{await exports.a.loadSettings();}catch(s){chunkOOVNTOZC_cjs.K.warn("loadSettings warning:",s);}try{await chunkEW424IBO_cjs.e(n);}catch(s){chunkOOVNTOZC_cjs.K.warn("autoBootstrap warning:",s);}globalThis.__KYRO_INSTANCE__=exports.a;}catch(e){throw exports.a=null,l=null,chunkOOVNTOZC_cjs.K.error("Init failed, will retry:",e),e}}}async function E(e){let t=globalThis.DB?globalThis:null;try{let{env:o}=await import('cloudflare:workers');o&&(t=o);}catch{}if(e)try{t=e.locals?.cfContext?.env||e?.env||t;}catch{}if(!t)try{t=process.env;}catch{}t?.DB&&(globalThis.DB=t.DB),t?.STORAGE_BUCKET&&(globalThis.STORAGE_BUCKET=t.STORAGE_BUCKET),l||(l=b()),await l;}var _={graphqlEnabled:false,trpcEnabled:false,wsEnabled:false,requireAuth:false};function T(e){return exports.a?exports.a.settings?.access?.apiAccess?.[e]??_[e]??true:_[e]??true}var R=async e=>{if(!exports.a)try{await Promise.race([E(e),new Promise((t,o)=>setTimeout(()=>o(new Error("Initialization timeout")),3e4))]);}catch(t){return console.error("[Kyro API] Warm error:",t?.stack||t?.message||t),new Response(JSON.stringify({error:"Service Unavailable",message:"Kyro CMS is still starting up. Please try again in a moment."}),{status:503,headers:{"Content-Type":"application/json","Retry-After":"5"}})}try{let o=new URL(e.request.url).pathname,a=__KYRO_API_PATH__;if(o===`${a}/graphql`&&typeof exports.a.getGraphQL=="function"){if(!T("graphqlEnabled"))return new Response(JSON.stringify({error:"GraphQL is disabled"}),{status:503,headers:{"Content-Type":"application/json"}});let n=await exports.a.getGraphQL().fetch(e.request,e.locals);return new Response(n.body,n)}if(o.startsWith(`${a}/trpc/`)&&typeof exports.a.getTRPC=="function"){if(!T("trpcEnabled"))return new Response(JSON.stringify({error:"tRPC is disabled"}),{status:503,headers:{"Content-Type":"application/json"}});let n=await exports.a.getTRPC().fetch(e.request,e.locals);return new Response(n.body,n)}return await(await exports.a.getREST()).fetch(e.request,e.locals)}catch(t){return console.error("[Kyro API Execution Error]:",t?.stack||t?.message||t),new Response(JSON.stringify({error:"Internal Server Error",message:t?.message||String(t),stack:t?.stack}),{status:500,headers:{"Content-Type":"application/json"}})}},L=R;exports.b=E;exports.c=R;exports.d=L;
|
package/dist/chunk-7MNDQU6K.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import {c,g,a,e}from'./chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
|
|
2
|
-
var L=c((wr,Ye)=>{g();var ze=["nodebuffer","arraybuffer","fragments"],He=typeof Blob<"u";He&&ze.push("blob");Ye.exports={BINARY_TYPES:ze,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:He,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}};});var J=c((Tr,oe)=>{g();var{EMPTY_BUFFER:Zt}=L(),ve=Buffer[Symbol.species];function Qt(t,e){if(t.length===0)return Zt;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 ve(s.buffer,s.byteOffset,r):s}function Ke(t,e,s,r,i){for(let n=0;n<i;n++)s[r+n]=t[n]^e[n&3];}function Xe(t,e){for(let s=0;s<t.length;s++)t[s]^=e[s&3];}function Jt(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.length)}function be(t){if(be.readOnly=true,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=new ve(t):ArrayBuffer.isView(t)?e=new ve(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),be.readOnly=false),e}oe.exports={concat:Qt,mask:Ke,toArrayBuffer:Jt,toBuffer:be,unmask:Xe};if(!process.env.WS_NO_BUFFER_UTIL)try{let t=a("bufferutil");oe.exports.mask=function(e,s,r,i,n){n<48?Ke(e,s,r,i,n):t.mask(e,s,r,i,n);},oe.exports.unmask=function(e,s){e.length<32?Xe(e,s):t.unmask(e,s);};}catch{}});var Je=c((Cr,Qe)=>{g();var Ze=Symbol("kDone"),we=Symbol("kRun"),Oe=class{constructor(e){this[Ze]=()=>{this.pending--,this[we]();},this.concurrency=e||1/0,this.jobs=[],this.pending=0;}add(e){this.jobs.push(e),this[we]();}[we](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[Ze]);}}};Qe.exports=Oe;});var V=c((Nr,rt)=>{g();var ee=a("zlib"),et=J(),es=Je(),{kStatusCode:tt}=L(),ts=Buffer[Symbol.species],ss=Buffer.from([0,0,255,255]),fe=Symbol("permessage-deflate"),N=Symbol("total-length"),$=Symbol("callback"),U=Symbol("buffers"),j=Symbol("error"),ae,Te=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,!ae){let s=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;ae=new es(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[$];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){ae.add(i=>{this._decompress(e,s,(n,o)=>{i(),r(n,o);});});}compress(e,s,r){ae.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"?ee.Z_DEFAULT_WINDOWBITS:this.params[n];this._inflate=ee.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[fe]=this,this._inflate[N]=0,this._inflate[U]=[],this._inflate.on("error",is),this._inflate.on("data",st);}this._inflate[$]=r,this._inflate.write(e),s&&this._inflate.write(ss),this._inflate.flush(()=>{let n=this._inflate[j];if(n){this._inflate.close(),this._inflate=null,r(n);return}let o=et.concat(this._inflate[U],this._inflate[N]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[N]=0,this._inflate[U]=[],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"?ee.Z_DEFAULT_WINDOWBITS:this.params[n];this._deflate=ee.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[N]=0,this._deflate[U]=[],this._deflate.on("data",rs);}this._deflate[$]=r,this._deflate.write(e),this._deflate.flush(ee.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let n=et.concat(this._deflate[U],this._deflate[N]);s&&(n=new ts(n.buffer,n.byteOffset,n.length-4)),this._deflate[$]=null,this._deflate[N]=0,this._deflate[U]=[],s&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),r(null,n);});}};rt.exports=Te;function rs(t){this[U].push(t),this[N]+=t.length;}function st(t){if(this[N]+=t.length,this[fe]._maxPayload<1||this[N]<=this[fe]._maxPayload){this[U].push(t);return}this[j]=new RangeError("Max payload size exceeded"),this[j].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[j][tt]=1009,this.removeListener("data",st),this.reset();}function is(t){if(this[fe]._inflate=null,this[j]){this[$](this[j]);return}t[tt]=1007,this[$](t);}});var z=c((Br,le)=>{g();var{isUtf8:it}=a("buffer"),{hasBlob:ns}=L(),os=[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 as(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function ke(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 fs(t){return ns&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]==="Blob"||t[Symbol.toStringTag]==="File")}le.exports={isBlob:fs,isValidStatusCode:as,isValidUTF8:ke,tokenChars:os};if(it)le.exports.isValidUTF8=function(t){return t.length<24?ke(t):it(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=a("utf-8-validate");le.exports.isValidUTF8=function(e){return e.length<32?ke(e):t(e)};}catch{}});var Be=c((Ur,ct)=>{g();var{Writable:ls}=a("stream"),nt=V(),{BINARY_TYPES:hs,EMPTY_BUFFER:ot,kStatusCode:cs,kWebSocket:us}=L(),{concat:Ce,toArrayBuffer:ds,unmask:_s}=J(),{isValidStatusCode:ms,isValidUTF8:at}=z(),he=Buffer[Symbol.species],O=0,ft=1,lt=2,ht=3,Le=4,Ne=5,ce=6,Pe=class extends ls{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:true,this._binaryType=e.binaryType||hs[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[us]=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=O;}_write(e,s,r){if(this._opcode===8&&this._state==O)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 he(r.buffer,r.byteOffset+e,r.length-e),new he(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 he(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 O:this.getInfo(e);break;case ft:this.getPayloadLength16(e);break;case lt:this.getPayloadLength64(e);break;case ht:this.getMask();break;case Le:this.getData(e);break;case Ne:case ce: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[nt.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=ft:this._payloadLength===127?this._state=lt: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=ht:this._state=Le;}getMask(){if(this._bufferedBytes<4){this._loop=false;return}this._mask=this.consume(4),this._state=Le;}getData(e){let s=ot;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&&_s(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=Ne,this.decompress(s,e);return}s.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(s)),this.dataMessage(e);}decompress(e,s){this._extensions[nt.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===O&&this.startLoop(s);});}dataMessage(e){if(!this._fin){this._state=O;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=Ce(r,s):this._binaryType==="arraybuffer"?i=ds(Ce(r,s)):this._binaryType==="blob"?i=new Blob(r):i=r,this._allowSynchronousEvents?(this.emit("message",i,true),this._state=O):(this._state=ce,setImmediate(()=>{this.emit("message",i,true),this._state=O,this.startLoop(e);}));}else {let i=Ce(r,s);if(!this._skipUTF8Validation&&!at(i)){let n=this.createError(Error,"invalid UTF-8 sequence",true,1007,"WS_ERR_INVALID_UTF8");e(n);return}this._state===Ne||this._allowSynchronousEvents?(this.emit("message",i,false),this._state=O):(this._state=ce,setImmediate(()=>{this.emit("message",i,false),this._state=O,this.startLoop(e);}));}}controlMessage(e,s){if(this._opcode===8){if(e.length===0)this._loop=false,this.emit("conclude",1005,ot),this.end();else {let r=e.readUInt16BE(0);if(!ms(r)){let n=this.createError(RangeError,`invalid status code ${r}`,true,1002,"WS_ERR_INVALID_CLOSE_CODE");s(n);return}let i=new he(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!at(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=O;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=O):(this._state=ce,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=O,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[cs]=i,o}};ct.exports=Pe;});var Ie=c((Mr,_t)=>{g();var{Duplex:Dr}=a("stream"),{randomFillSync:ps}=a("crypto"),{types:{isUint8Array:gs}}=a("util"),ut=V(),{EMPTY_BUFFER:ys,kWebSocket:xs,NOOP:Ss}=L(),{isBlob:H,isValidStatusCode:Es}=z(),{mask:dt,toBuffer:D}=J(),T=Symbol("kByteLength"),vs=Buffer.alloc(4),ue=8*1024,M,Y=ue,k=0,bs=1,ws=2,Re=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=k,this.onerror=Ss,this[xs]=void 0;}static frame(e,s){let r,i=false,n=2,o=false;s.mask&&(r=s.maskBuffer||vs,s.generateMask?s.generateMask(r):(Y===ue&&(M===void 0&&(M=Buffer.alloc(ue)),ps(M,0,ue),Y=0),r[0]=M[Y++],r[1]=M[Y++],r[2]=M[Y++],r[3]=M[Y++]),o=(r[0]|r[1]|r[2]|r[3])===0,n=6);let f;typeof e=="string"?(!s.mask||o)&&s[T]!==void 0?f=s[T]:(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?(dt(e,r,a,n,f),[a]):(dt(e,r,e,0,f),[a,e])):[a,e]}close(e,s,r,i){let n;if(e===void 0)n=ys;else {if(typeof e!="number"||!Es(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(gs(s))n.set(s,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let o={[T]:n.length,fin:true,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:false,rsv1:false};this._state!==k?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):H(e)?(i=e.size,n=false):(e=D(e),i=e.length,n=D.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[T]:i,fin:true,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:9,readOnly:n,rsv1:false};H(e)?this._state!==k?this.enqueue([this.getBlobData,e,false,o,r]):this.getBlobData(e,false,o,r):this._state!==k?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):H(e)?(i=e.size,n=false):(e=D(e),i=e.length,n=D.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[T]:i,fin:true,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:10,readOnly:n,rsv1:false};H(e)?this._state!==k?this.enqueue([this.getBlobData,e,false,o,r]):this.getBlobData(e,false,o,r):this._state!==k?this.enqueue([this.dispatch,e,false,o,r]):this.sendFrame(t.frame(e,o),r);}send(e,s,r){let i=this._extensions[ut.extensionName],n=s.binary?2:1,o=s.compress,f,l;typeof e=="string"?(f=Buffer.byteLength(e),l=false):H(e)?(f=e.size,l=false):(e=D(e),f=e.length,l=D.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={[T]:f,fin:s.fin,generateMask:this._generateMask,mask:s.mask,maskBuffer:this._maskBuffer,opcode:n,readOnly:l,rsv1:o};H(e)?this._state!==k?this.enqueue([this.getBlobData,e,this._compress,a,r]):this.getBlobData(e,this._compress,a,r):this._state!==k?this.enqueue([this.dispatch,e,this._compress,a,r]):this.dispatch(e,this._compress,a,r);}getBlobData(e,s,r,i){this._bufferedBytes+=r[T],this._state=ws,e.arrayBuffer().then(n=>{if(this._socket.destroyed){let f=new Error("The socket was closed while the blob was being read");process.nextTick(Ue,this,f,i);return}this._bufferedBytes-=r[T];let o=D(n);s?this.dispatch(o,s,r,i):(this._state=k,this.sendFrame(t.frame(o,r),i),this.dequeue());}).catch(n=>{process.nextTick(Os,this,n,i);});}dispatch(e,s,r,i){if(!s){this.sendFrame(t.frame(e,r),i);return}let n=this._extensions[ut.extensionName];this._bufferedBytes+=r[T],this._state=bs,n.compress(e,r.fin,(o,f)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");Ue(this,l,i);return}this._bufferedBytes-=r[T],this._state=k,r.readOnly=false,this.sendFrame(t.frame(f,r),i),this.dequeue();});}dequeue(){for(;this._state===k&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][T],Reflect.apply(e[0],this,e.slice(1));}}enqueue(e){this._bufferedBytes+=e[3][T],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);}};_t.exports=Re;function Ue(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 Os(t,e,s){Ue(t,e,s),t.onerror(e);}});var bt=c((Ar,vt)=>{g();var{kForOnEventAttribute:te,kListener:De}=L(),mt=Symbol("kCode"),pt=Symbol("kData"),gt=Symbol("kError"),yt=Symbol("kMessage"),xt=Symbol("kReason"),K=Symbol("kTarget"),St=Symbol("kType"),Et=Symbol("kWasClean"),P=class{constructor(e){this[K]=null,this[St]=e;}get target(){return this[K]}get type(){return this[St]}};Object.defineProperty(P.prototype,"target",{enumerable:true});Object.defineProperty(P.prototype,"type",{enumerable:true});var F=class extends P{constructor(e,s={}){super(e),this[mt]=s.code===void 0?0:s.code,this[xt]=s.reason===void 0?"":s.reason,this[Et]=s.wasClean===void 0?false:s.wasClean;}get code(){return this[mt]}get reason(){return this[xt]}get wasClean(){return this[Et]}};Object.defineProperty(F.prototype,"code",{enumerable:true});Object.defineProperty(F.prototype,"reason",{enumerable:true});Object.defineProperty(F.prototype,"wasClean",{enumerable:true});var X=class extends P{constructor(e,s={}){super(e),this[gt]=s.error===void 0?null:s.error,this[yt]=s.message===void 0?"":s.message;}get error(){return this[gt]}get message(){return this[yt]}};Object.defineProperty(X.prototype,"error",{enumerable:true});Object.defineProperty(X.prototype,"message",{enumerable:true});var se=class extends P{constructor(e,s={}){super(e),this[pt]=s.data===void 0?null:s.data;}get data(){return this[pt]}};Object.defineProperty(se.prototype,"data",{enumerable:true});var Ts={addEventListener(t,e,s={}){for(let i of this.listeners(t))if(!s[te]&&i[De]===e&&!i[te])return;let r;if(t==="message")r=function(n,o){let f=new se("message",{data:o?n:n.toString()});f[K]=this,de(e,this,f);};else if(t==="close")r=function(n,o){let f=new F("close",{code:n,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});f[K]=this,de(e,this,f);};else if(t==="error")r=function(n){let o=new X("error",{error:n,message:n.message});o[K]=this,de(e,this,o);};else if(t==="open")r=function(){let n=new P("open");n[K]=this,de(e,this,n);};else return;r[te]=!!s[te],r[De]=e,s.once?this.once(t,r):this.on(t,r);},removeEventListener(t,e){for(let s of this.listeners(t))if(s[De]===e&&!s[te]){this.removeListener(t,s);break}}};vt.exports={CloseEvent:F,ErrorEvent:X,Event:P,EventTarget:Ts,MessageEvent:se};function de(t,e,s){typeof t=="object"&&t.handleEvent?t.handleEvent.call(t,s):t.call(e,s);}});var _e=c((qr,wt)=>{g();var{tokenChars:re}=z();function C(t,e,s){t[e]===void 0?t[e]=[s]:t[e].push(s);}function ks(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&&re[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?(C(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&&re[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),C(s,t.slice(l,h),true),a===44&&(C(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(re[a]!==1)throw new SyntaxError(`Unexpected character at index ${c}`);l===-1?l=c:r||(r=true),i=false;}else if(n)if(re[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&&re[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),C(s,f,y),a===44&&(C(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?C(e,m,s):(f===void 0?C(s,m,true):r?C(s,f,m.replace(/\\/g,"")):C(s,f,m),C(e,o,s)),e}function Cs(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(", ")}wt.exports={format:Cs,parse:ks};});var ye=c((Vr,Dt)=>{g();var Ls=a("events"),Ns=a("https"),Ps=a("http"),kt=a("net"),Bs=a("tls"),{randomBytes:Rs,createHash:Us}=a("crypto"),{Duplex:$r,Readable:jr}=a("stream"),{URL:Me}=a("url"),I=V(),Is=Be(),Ds=Ie(),{isBlob:Ms}=z(),{BINARY_TYPES:Ot,CLOSE_TIMEOUT:Fs,EMPTY_BUFFER:me,GUID:As,kForOnEventAttribute:Fe,kListener:Ws,kStatusCode:qs,kWebSocket:x,NOOP:Ct}=L(),{EventTarget:{addEventListener:Gs,removeEventListener:$s}}=bt(),{format:js,parse:Vs}=_e(),{toBuffer:zs}=J(),Lt=Symbol("kAborted"),Ae=[8,13],B=["CONNECTING","OPEN","CLOSING","CLOSED"],Hs=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,_=class t extends Ls{constructor(e,s,r){super(),this._binaryType=Ot[0],this._closeCode=1006,this._closeFrameReceived=false,this._closeFrameSent=false,this._closeMessage=me,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]),Nt(this,e,s,r)):(this._autoPong=r.autoPong,this._closeTimeout=r.closeTimeout,this._isServer=true);}get binaryType(){return this._binaryType}set binaryType(e){Ot.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 Is({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 Ds(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",Xs),i.on("drain",Zs),i.on("error",Qs),i.on("message",Js),i.on("ping",er),i.on("pong",tr),n.onerror=sr,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),s.length>0&&e.unshift(s),e.on("close",Rt),e.on("data",ge),e.on("end",Ut),e.on("error",It),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[I.extensionName]&&this._extensions[I.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){w(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());}),Bt(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){We(this,e,r);return}s===void 0&&(s=!this._isServer),this._sender.ping(e||me,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){We(this,e,r);return}s===void 0&&(s=!this._isServer),this._sender.pong(e||me,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){We(this,e,r);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:true,fin:true,...s};this._extensions[I.extensionName]||(i.compress=false),this._sender.send(e||me,i,r);}terminate(){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){w(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:B.indexOf("CONNECTING")});Object.defineProperty(_.prototype,"CONNECTING",{enumerable:true,value:B.indexOf("CONNECTING")});Object.defineProperty(_,"OPEN",{enumerable:true,value:B.indexOf("OPEN")});Object.defineProperty(_.prototype,"OPEN",{enumerable:true,value:B.indexOf("OPEN")});Object.defineProperty(_,"CLOSING",{enumerable:true,value:B.indexOf("CLOSING")});Object.defineProperty(_.prototype,"CLOSING",{enumerable:true,value:B.indexOf("CLOSING")});Object.defineProperty(_,"CLOSED",{enumerable:true,value:B.indexOf("CLOSED")});Object.defineProperty(_.prototype,"CLOSED",{enumerable:true,value:B.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[Fe])return e[Ws];return null},set(e){for(let s of this.listeners(t))if(s[Fe]){this.removeListener(t,s);break}typeof e=="function"&&this.addEventListener(t,e,{[Fe]:true});}});});_.prototype.addEventListener=Gs;_.prototype.removeEventListener=$s;Dt.exports=_;function Nt(t,e,s,r){let i={allowSynchronousEvents:true,autoPong:true,closeTimeout:Fs,protocolVersion:Ae[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,!Ae.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Ae.join(", ")})`);let n;if(e instanceof Me)n=e;else try{n=new Me(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;pe(t,u);return}let a=o?443:80,h=Rs(16).toString("base64"),c=o?Ns.request:Ps.request,m=new Set,y;if(i.createConnection=i.createConnection||(o?Ks:Ys),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 I({...i.perMessageDeflate,isServer:false,maxPayload:i.maxPayload}),i.headers["Sec-WebSocket-Extensions"]=js({[I.extensionName]:y.offer()})),s.length){for(let u of s){if(typeof u!="string"||!Hs.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,q]of Object.entries(u))r.headers[S.toLowerCase()]=q;}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",()=>{w(t,p,"Opening handshake has timed out");}),p.on("error",u=>{p===null||p[Lt]||(p=t._req=null,pe(t,u));}),p.on("response",u=>{let S=u.headers.location,q=u.statusCode;if(S&&i.followRedirects&&q>=300&&q<400){if(++t._redirects>i.maxRedirects){w(t,p,"Maximum redirects exceeded");return}p.abort();let Z;try{Z=new Me(S,e);}catch{let G=new SyntaxError(`Invalid URL: ${S}`);pe(t,G);return}Nt(t,Z,s,r);}else t.emit("unexpected-response",p,u)||w(t,p,`Unexpected server response: ${u.statusCode}`);}),p.on("upgrade",(u,S,q)=>{if(t.emit("upgrade",u),t.readyState!==_.CONNECTING)return;p=t._req=null;let Z=u.headers.upgrade;if(Z===void 0||Z.toLowerCase()!=="websocket"){w(t,S,"Invalid Upgrade header");return}let $e=Us("sha1").update(h+As).digest("base64");if(u.headers["sec-websocket-accept"]!==$e){w(t,S,"Invalid Sec-WebSocket-Accept header");return}let G=u.headers["sec-websocket-protocol"],Q;if(G!==void 0?m.size?m.has(G)||(Q="Server sent an invalid subprotocol"):Q="Server sent a subprotocol but none was requested":m.size&&(Q="Server sent no subprotocol"),Q){w(t,S,Q);return}G&&(t._protocol=G);let je=u.headers["sec-websocket-extensions"];if(je!==void 0){if(!y){w(t,S,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Se;try{Se=Vs(je);}catch{w(t,S,"Invalid Sec-WebSocket-Extensions header");return}let Ve=Object.keys(Se);if(Ve.length!==1||Ve[0]!==I.extensionName){w(t,S,"Server indicated an extension that was not requested");return}try{y.accept(Se[I.extensionName]);}catch{w(t,S,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[I.extensionName]=y;}t.setSocket(S,q,{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 pe(t,e){t._readyState=_.CLOSING,t._errorEmitted=true,t.emit("error",e),t.emitClose();}function Ys(t){return t.path=t.socketPath,kt.connect(t)}function Ks(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=kt.isIP(t.host)?"":t.host),Bs.connect(t)}function w(t,e,s){t._readyState=_.CLOSING;let r=new Error(s);Error.captureStackTrace(r,w),e.setHeader?(e[Lt]=true,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(pe,t,r)):(e.destroy(r),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)));}function We(t,e,s){if(e){let r=Ms(e)?e.size:zs(e).length;t._socket?t._sender._bufferedBytes+=r:t._bufferedAmount+=r;}if(s){let r=new Error(`WebSocket is not open: readyState ${t.readyState} (${B[t.readyState]})`);process.nextTick(s,r);}}function Xs(t,e){let s=this[x];s._closeFrameReceived=true,s._closeMessage=e,s._closeCode=t,s._socket[x]!==void 0&&(s._socket.removeListener("data",ge),process.nextTick(Pt,s._socket),t===1005?s.close():s.close(t,e));}function Zs(){let t=this[x];t.isPaused||t._socket.resume();}function Qs(t){let e=this[x];e._socket[x]!==void 0&&(e._socket.removeListener("data",ge),process.nextTick(Pt,e._socket),e.close(t[qs])),e._errorEmitted||(e._errorEmitted=true,e.emit("error",t));}function Tt(){this[x].emitClose();}function Js(t,e){this[x].emit("message",t,e);}function er(t){let e=this[x];e._autoPong&&e.pong(t,!this._isServer,Ct),e.emit("ping",t);}function tr(t){this[x].emit("pong",t);}function Pt(t){t.resume();}function sr(t){let e=this[x];e.readyState!==_.CLOSED&&(e.readyState===_.OPEN&&(e._readyState=_.CLOSING,Bt(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=true,e.emit("error",t)));}function Bt(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),t._closeTimeout);}function Rt(){let t=this[x];if(this.removeListener("close",Rt),this.removeListener("data",ge),this.removeListener("end",Ut),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",Tt),t._receiver.on("finish",Tt));}function ge(t){this[x]._receiver.write(t)||this.pause();}function Ut(){let t=this[x];t._readyState=_.CLOSING,t._receiver.end(),this.end();}function It(){let t=this[x];this.removeListener("error",It),this.on("error",Ct),t&&(t._readyState=_.CLOSING,this.destroy());}});var Wt=c((Yr,At)=>{g();ye();var {Duplex:rr}=a("stream");function Mt(t){t.emit("close");}function ir(){!this.destroyed&&this._writableState.finished&&this.destroy();}function Ft(t){this.removeListener("error",Ft),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t);}function nr(t,e){let s=true,r=new rr({...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(Mt,r);return}let o=false;t.once("error",function(l){o=true,n(l);}),t.once("close",function(){o||n(i),process.nextTick(Mt,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",ir),r.on("error",Ft),r}At.exports=nr;});var qe=c((Xr,qt)=>{g();var{tokenChars:or}=z();function ar(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&&or[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}qt.exports={parse:ar};});var Yt=c((Jr,Ht)=>{g();var fr=a("events"),xe=a("http"),{Duplex:Qr}=a("stream"),{createHash:lr}=a("crypto"),Gt=_e(),A=V(),hr=qe(),cr=ye(),{CLOSE_TIMEOUT:ur,GUID:dr,kWebSocket:_r}=L(),mr=/^[+/0-9A-Za-z]{22}==$/,$t=0,jt=1,zt=2,Ge=class extends fr{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:ur,verifyClient:null,noServer:false,backlog:null,server:null,host:null,path:null,port:null,WebSocket:cr,...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=xe.createServer((r,i)=>{let n=xe.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=pr(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=$t;}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===zt){e&&this.once("close",()=>{e(new Error("The server is not running"));}),process.nextTick(ie,this);return}if(e&&this.once("close",e),this._state!==jt)if(this._state=jt,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(ie,this):process.nextTick(ie,this);else {let s=this._server;this._removeListeners(),this._removeListeners=this._server=null,s.close(()=>{ie(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",Vt);let n=e.headers["sec-websocket-key"],o=e.headers.upgrade,f=+e.headers["sec-websocket-version"];if(e.method!=="GET"){W(this,e,s,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){W(this,e,s,400,"Invalid Upgrade header");return}if(n===void 0||!mr.test(n)){W(this,e,s,400,"Missing or invalid Sec-WebSocket-Key header");return}if(f!==13&&f!==8){W(this,e,s,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){ne(s,400);return}let l=e.headers["sec-websocket-protocol"],a=new Set;if(l!==void 0)try{a=hr.parse(l);}catch{W(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 A({...this.options.perMessageDeflate,isServer:true,maxPayload:this.options.maxPayload});try{let y=Gt.parse(h);y[A.extensionName]&&(m.accept(y[A.extensionName]),c[A.extensionName]=m);}catch{W(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 ne(s,p||401,u,S);this.completeUpgrade(c,n,a,e,s,r,i);});return}if(!this.options.verifyClient(m))return ne(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[_r])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>$t)return ne(n,503);let a=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${lr("sha1").update(s+dr).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[A.extensionName]){let c=e[A.extensionName].params,m=Gt.format({[A.extensionName]:[c]});a.push(`Sec-WebSocket-Extensions: ${m}`),h._extensions=e;}this.emit("headers",a,i),n.write(a.concat(`\r
|
|
3
|
-
`).join(`\r
|
|
4
|
-
`)),n.removeListener("error",Vt),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(ie,this);})),f(h,i);}};Ht.exports=Ge;function pr(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 ie(t){t._state=zt,t.emit("close");}function Vt(){this.destroy();}function ne(t,e,s,r){s=s||xe.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} ${xe.STATUS_CODES[e]}\r
|
|
5
|
-
`+Object.keys(r).map(i=>`${i}: ${r[i]}`).join(`\r
|
|
6
|
-
`)+`\r
|
|
7
|
-
\r
|
|
8
|
-
`+s);}function W(t,e,s,r,i,n){if(t.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,W),t.emit("wsClientError",o,s,e);}else ne(s,r,i,n);}});g();e(Wt(),1);e(_e(),1);e(V(),1);e(Be(),1);e(Ie(),1);e(qe(),1);var Kt=e(ye(),1),br=e(Yt(),1);var ti=Kt.default;export{Kt as a,br as b,ti as c};
|
package/dist/chunk-7NH7H3WA.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import {c,g,a}from'./chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
|
|
2
|
-
var q=c((X,g$1)=>{g();(function(i,y){typeof define=="function"&&define.amd?define([],y):typeof a=="function"&&typeof g$1=="object"&&g$1&&g$1.exports?g$1.exports=y():(i.dcodeIO=i.dcodeIO||{}).bcrypt=y();})(X,function(){var i={},y=null;function O(c){if(typeof g$1<"u"&&g$1&&g$1.exports)try{return a("crypto").randomBytes(c)}catch{}try{var a$1;return (self.crypto||self.msCrypto).getRandomValues(a$1=new Uint32Array(c)),Array.prototype.slice.call(a$1)}catch{}if(!y)throw Error("Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative");return y(c)}var H=false;try{O(1),H=!0;}catch{}y=null,i.setRandomFallback=function(c){y=c;},i.genSaltSync=function(c,a){if(c=c||C,typeof c!="number")throw Error("Illegal arguments: "+typeof c+", "+typeof a);c<4?c=4:c>31&&(c=31);var f=[];return f.push("$2a$"),c<10&&f.push("0"),f.push(c.toString()),f.push("$"),f.push(T(O(w),w)),f.join("")},i.genSalt=function(c,a,f){if(typeof a=="function"&&(f=a,a=void 0),typeof c=="function"&&(f=c,c=void 0),typeof c>"u")c=C;else if(typeof c!="number")throw Error("illegal arguments: "+typeof c);function e(x){p(function(){try{x(null,i.genSaltSync(c));}catch(d){x(d);}});}if(f){if(typeof f!="function")throw Error("Illegal callback: "+typeof f);e(f);}else return new Promise(function(x,d){e(function(b,r){if(b){d(b);return}x(r);});})},i.hashSync=function(c,a){if(typeof a>"u"&&(a=C),typeof a=="number"&&(a=i.genSaltSync(a)),typeof c!="string"||typeof a!="string")throw Error("Illegal arguments: "+typeof c+", "+typeof a);return _(c,a)},i.hash=function(c,a,f,e){function x(d){typeof c=="string"&&typeof a=="number"?i.genSalt(a,function(b,r){_(c,r,d,e);}):typeof c=="string"&&typeof a=="string"?_(c,a,d,e):p(d.bind(this,Error("Illegal arguments: "+typeof c+", "+typeof a)));}if(f){if(typeof f!="function")throw Error("Illegal callback: "+typeof f);x(f);}else return new Promise(function(d,b){x(function(r,n){if(r){b(r);return}d(n);});})};function R(c,a){for(var f=0,e=0,x=0,d=c.length;x<d;++x)c.charCodeAt(x)===a.charCodeAt(x)?++f:++e;return f<0?false:e===0}i.compareSync=function(c,a){if(typeof c!="string"||typeof a!="string")throw Error("Illegal arguments: "+typeof c+", "+typeof a);return a.length!==60?false:R(i.hashSync(c,a.substr(0,a.length-31)),a)},i.compare=function(c,a,f,e){function x(d){if(typeof c!="string"||typeof a!="string"){p(d.bind(this,Error("Illegal arguments: "+typeof c+", "+typeof a)));return}if(a.length!==60){p(d.bind(this,null,false));return}i.hash(c,a.substr(0,29),function(b,r){b?d(b):d(null,R(r,a));},e);}if(f){if(typeof f!="function")throw Error("Illegal callback: "+typeof f);x(f);}else return new Promise(function(d,b){x(function(r,n){if(r){b(r);return}d(n);});})},i.getRounds=function(c){if(typeof c!="string")throw Error("Illegal arguments: "+typeof c);return parseInt(c.split("$")[2],10)},i.getSalt=function(c){if(typeof c!="string")throw Error("Illegal arguments: "+typeof c);if(c.length!==60)throw Error("Illegal hash length: "+c.length+" != 60");return c.substring(0,29)};var p=typeof process<"u"&&process&&typeof process.nextTick=="function"?typeof setImmediate=="function"?setImmediate:process.nextTick:setTimeout;function V(c){var a=[],f=0;return Y.encodeUTF16toUTF8(function(){return f>=c.length?null:c.charCodeAt(f++)},function(e){a.push(e);}),a}var F="./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),s=[-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,54,55,56,57,58,59,60,61,62,63,-1,-1,-1,-1,-1,-1,-1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,-1,-1,-1,-1,-1,-1,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,-1,-1,-1,-1,-1],A=String.fromCharCode;function T(c,a){var f=0,e=[],x,d;if(a<=0||a>c.length)throw Error("Illegal len: "+a);for(;f<a;){if(x=c[f++]&255,e.push(F[x>>2&63]),x=(x&3)<<4,f>=a){e.push(F[x&63]);break}if(d=c[f++]&255,x|=d>>4&15,e.push(F[x&63]),x=(d&15)<<2,f>=a){e.push(F[x&63]);break}d=c[f++]&255,x|=d>>6&3,e.push(F[x&63]),e.push(F[d&63]);}return e.join("")}function N(c,a){var f=0,e=c.length,x=0,d=[],b,r,n,t,o,u;if(a<=0)throw Error("Illegal len: "+a);for(;f<e-1&&x<a&&(u=c.charCodeAt(f++),b=u<s.length?s[u]:-1,u=c.charCodeAt(f++),r=u<s.length?s[u]:-1,!(b==-1||r==-1||(o=b<<2>>>0,o|=(r&48)>>4,d.push(A(o)),++x>=a||f>=e)||(u=c.charCodeAt(f++),n=u<s.length?s[u]:-1,n==-1)||(o=(r&15)<<4>>>0,o|=(n&60)>>2,d.push(A(o)),++x>=a||f>=e)));)u=c.charCodeAt(f++),t=u<s.length?s[u]:-1,o=(n&3)<<6>>>0,o|=t,d.push(A(o)),++x;var h=[];for(f=0;f<x;f++)h.push(d[f].charCodeAt(0));return h}var Y=(function(){var c={};return c.MAX_CODEPOINT=1114111,c.encodeUTF8=function(a,f){var e=null;for(typeof a=="number"&&(e=a,a=function(){return null});e!==null||(e=a())!==null;)e<128?f(e&127):e<2048?(f(e>>6&31|192),f(e&63|128)):e<65536?(f(e>>12&15|224),f(e>>6&63|128),f(e&63|128)):(f(e>>18&7|240),f(e>>12&63|128),f(e>>6&63|128),f(e&63|128)),e=null;},c.decodeUTF8=function(a,f){for(var e,x,d,b,r=function(n){n=n.slice(0,n.indexOf(null));var t=Error(n.toString());throw t.name="TruncatedError",t.bytes=n,t};(e=a())!==null;)if((e&128)===0)f(e);else if((e&224)===192)(x=a())===null&&r([e,x]),f((e&31)<<6|x&63);else if((e&240)===224)((x=a())===null||(d=a())===null)&&r([e,x,d]),f((e&15)<<12|(x&63)<<6|d&63);else if((e&248)===240)((x=a())===null||(d=a())===null||(b=a())===null)&&r([e,x,d,b]),f((e&7)<<18|(x&63)<<12|(d&63)<<6|b&63);else throw RangeError("Illegal starting byte: "+e)},c.UTF16toUTF8=function(a,f){for(var e,x=null;(e=x!==null?x:a())!==null;){if(e>=55296&&e<=57343&&(x=a())!==null&&x>=56320&&x<=57343){f((e-55296)*1024+x-56320+65536),x=null;continue}f(e);}x!==null&&f(x);},c.UTF8toUTF16=function(a,f){var e=null;for(typeof a=="number"&&(e=a,a=function(){return null});e!==null||(e=a())!==null;)e<=65535?f(e):(e-=65536,f((e>>10)+55296),f(e%1024+56320)),e=null;},c.encodeUTF16toUTF8=function(a,f){c.UTF16toUTF8(a,function(e){c.encodeUTF8(e,f);});},c.decodeUTF8toUTF16=function(a,f){c.decodeUTF8(a,function(e){c.UTF8toUTF16(e,f);});},c.calculateCodePoint=function(a){return a<128?1:a<2048?2:a<65536?3:4},c.calculateUTF8=function(a){for(var f,e=0;(f=a())!==null;)e+=c.calculateCodePoint(f);return e},c.calculateUTF16asUTF8=function(a){var f=0,e=0;return c.UTF16toUTF8(a,function(x){++f,e+=c.calculateCodePoint(x);}),[f,e]},c})();Date.now=Date.now||function(){return +new Date};var w=16,C=10,z=16,J=100,$=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],B=[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946,1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055,3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504,976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462],L=[1332899944,1700884034,1701343084,1684370003,1668446532,1869963892];function E(c,a,f,e){var x,d=c[a],b=c[a+1];return d^=f[0],x=e[d>>>24],x+=e[256|d>>16&255],x^=e[512|d>>8&255],x+=e[768|d&255],b^=x^f[1],x=e[b>>>24],x+=e[256|b>>16&255],x^=e[512|b>>8&255],x+=e[768|b&255],d^=x^f[2],x=e[d>>>24],x+=e[256|d>>16&255],x^=e[512|d>>8&255],x+=e[768|d&255],b^=x^f[3],x=e[b>>>24],x+=e[256|b>>16&255],x^=e[512|b>>8&255],x+=e[768|b&255],d^=x^f[4],x=e[d>>>24],x+=e[256|d>>16&255],x^=e[512|d>>8&255],x+=e[768|d&255],b^=x^f[5],x=e[b>>>24],x+=e[256|b>>16&255],x^=e[512|b>>8&255],x+=e[768|b&255],d^=x^f[6],x=e[d>>>24],x+=e[256|d>>16&255],x^=e[512|d>>8&255],x+=e[768|d&255],b^=x^f[7],x=e[b>>>24],x+=e[256|b>>16&255],x^=e[512|b>>8&255],x+=e[768|b&255],d^=x^f[8],x=e[d>>>24],x+=e[256|d>>16&255],x^=e[512|d>>8&255],x+=e[768|d&255],b^=x^f[9],x=e[b>>>24],x+=e[256|b>>16&255],x^=e[512|b>>8&255],x+=e[768|b&255],d^=x^f[10],x=e[d>>>24],x+=e[256|d>>16&255],x^=e[512|d>>8&255],x+=e[768|d&255],b^=x^f[11],x=e[b>>>24],x+=e[256|b>>16&255],x^=e[512|b>>8&255],x+=e[768|b&255],d^=x^f[12],x=e[d>>>24],x+=e[256|d>>16&255],x^=e[512|d>>8&255],x+=e[768|d&255],b^=x^f[13],x=e[b>>>24],x+=e[256|b>>16&255],x^=e[512|b>>8&255],x+=e[768|b&255],d^=x^f[14],x=e[d>>>24],x+=e[256|d>>16&255],x^=e[512|d>>8&255],x+=e[768|d&255],b^=x^f[15],x=e[b>>>24],x+=e[256|b>>16&255],x^=e[512|b>>8&255],x+=e[768|b&255],d^=x^f[16],c[a]=b^f[z+1],c[a+1]=d,c}function v(c,a){for(var f=0,e=0;f<4;++f)e=e<<8|c[a]&255,a=(a+1)%c.length;return {key:e,offp:a}}function j(c,a,f){for(var e=0,x=[0,0],d=a.length,b=f.length,r,n=0;n<d;n++)r=v(c,e),e=r.offp,a[n]=a[n]^r.key;for(n=0;n<d;n+=2)x=E(x,0,a,f),a[n]=x[0],a[n+1]=x[1];for(n=0;n<b;n+=2)x=E(x,0,a,f),f[n]=x[0],f[n+1]=x[1];}function K(c,a,f,e){for(var x=0,d=[0,0],b=f.length,r=e.length,n,t=0;t<b;t++)n=v(a,x),x=n.offp,f[t]=f[t]^n.key;for(x=0,t=0;t<b;t+=2)n=v(c,x),x=n.offp,d[0]^=n.key,n=v(c,x),x=n.offp,d[1]^=n.key,d=E(d,0,f,e),f[t]=d[0],f[t+1]=d[1];for(t=0;t<r;t+=2)n=v(c,x),x=n.offp,d[0]^=n.key,n=v(c,x),x=n.offp,d[1]^=n.key,d=E(d,0,f,e),e[t]=d[0],e[t+1]=d[1];}function G(c,a,f,e,x){var d=L.slice(),b=d.length,r;if(f<4||f>31)if(r=Error("Illegal number of rounds (4-31): "+f),e){p(e.bind(this,r));return}else throw r;if(a.length!==w)if(r=Error("Illegal salt length: "+a.length+" != "+w),e){p(e.bind(this,r));return}else throw r;f=1<<f>>>0;var n,t,o=0,u;Int32Array?(n=new Int32Array($),t=new Int32Array(B)):(n=$.slice(),t=B.slice()),K(a,c,n,t);function h(){if(x&&x(o/f),o<f)for(var m=Date.now();o<f&&(o=o+1,j(c,n,t),j(a,n,t),!(Date.now()-m>J)););else {for(o=0;o<64;o++)for(u=0;u<b>>1;u++)E(d,u<<1,n,t);var l=[];for(o=0;o<b;o++)l.push((d[o]>>24&255)>>>0),l.push((d[o]>>16&255)>>>0),l.push((d[o]>>8&255)>>>0),l.push((d[o]&255)>>>0);if(e){e(null,l);return}else return l}e&&p(h);}if(typeof e<"u")h();else for(var I;;)if(typeof(I=h())<"u")return I||[]}function _(c,a,f,e){var x;if(typeof c!="string"||typeof a!="string")if(x=Error("Invalid string / salt: Not a string"),f){p(f.bind(this,x));return}else throw x;var d,b;if(a.charAt(0)!=="$"||a.charAt(1)!=="2")if(x=Error("Invalid salt version: "+a.substring(0,2)),f){p(f.bind(this,x));return}else throw x;if(a.charAt(2)==="$")d="\0",b=3;else {if(d=a.charAt(2),d!=="a"&&d!=="b"&&d!=="y"||a.charAt(3)!=="$")if(x=Error("Invalid salt revision: "+a.substring(2,4)),f){p(f.bind(this,x));return}else throw x;b=4;}if(a.charAt(b+2)>"$")if(x=Error("Missing salt rounds"),f){p(f.bind(this,x));return}else throw x;var r=parseInt(a.substring(b,b+1),10)*10,n=parseInt(a.substring(b+1,b+2),10),t=r+n,o=a.substring(b+3,b+25);c+=d>="a"?"\0":"";var u=V(c),h=N(o,w);function I(m){var l=[];return l.push("$2"),d>="a"&&l.push(d),l.push("$"),t<10&&l.push("0"),l.push(t.toString()),l.push("$"),l.push(T(h,h.length)),l.push(T(m,L.length*4-1)),l.join("")}if(typeof f>"u")return I(G(u,h,t));G(u,h,t,function(m,l){m?f(m,null):f(null,I(l));},e);}return i.encodeBase64=T,i.decodeBase64=N,i});});var k=c((x0,W)=>{g();W.exports=q();});/*! Bundled license information:
|
|
3
|
-
|
|
4
|
-
bcryptjs/dist/bcrypt.js:
|
|
5
|
-
(**
|
|
6
|
-
* @license bcrypt.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
|
|
7
|
-
* Released under the Apache License, Version 2.0
|
|
8
|
-
* see: https://github.com/dcodeIO/bcrypt.js for details
|
|
9
|
-
*)
|
|
10
|
-
*/export{k as a};
|
package/dist/chunk-7WMMKGEO.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');chunkBUNLC3II_cjs.h();var p=[{name:"super_admin",level:100,inherits:[],description:"Full system access across all tenants"},{name:"admin",level:90,inherits:["editor"],description:"Full tenant access with all content permissions"},{name:"editor",level:70,inherits:["author"],description:"Edit and publish all content"},{name:"author",level:50,inherits:["customer"],description:"Create and edit own content"},{name:"customer",level:30,inherits:[],description:"Access own data and make purchases"},{name:"guest",level:10,inherits:[],description:"Public read-only access"}];var u={super_admin:["*"],admin:["users:admin","users:read","users:update","audit_logs:read","posts:admin","posts:read","posts:create","posts:update","posts:delete","pages:admin","pages:read","pages:create","pages:update","pages:delete","media:admin","media:read","media:create","media:update","media:delete","categories:admin","categories:read","categories:create","categories:update","categories:delete","products:admin","products:read","products:create","products:update","products:delete","orders:admin","orders:read","orders:update","customers:admin","customers:read","customers:update","coupons:admin","coupons:read","coupons:create","coupons:update","coupons:delete","navigation:admin","navigation:read","navigation:create","navigation:update","navigation:delete","settings:admin","settings:read","settings:update","profile:admin","profile:read","profile:update"],editor:["posts:admin","posts:read","posts:create","posts:update","posts:delete","pages:admin","pages:read","pages:create","pages:update","pages:delete","media:read","media:create","media:update","categories:read","categories:create","categories:update","products:read","orders:read","orders:update","navigation:read","navigation:create","navigation:update","profile:read","profile:update"],author:["posts:read","posts:create","posts:update","media:read","media:create","categories:read","profile:read","profile:update"],customer:["profile:read","profile:update","orders:read","orders:create"],guest:["posts:read","pages:read","products:read"]};function d(e,s=p){let t=[e],r=new Map(s.map(o=>[o.name,o])),n=o=>{let i=r.get(o);if(i&&i.inherits)for(let c of i.inherits)t.includes(c)||(t.push(c),n(c));};return n(e),t}chunkBUNLC3II_cjs.h();function y(e,s,t=u){if(!e||!e.role)return false;let r=g(e,t);if(r.includes("*")||r.includes(s))return true;let[n,o]=s.split(":");return !!(r.includes(`${n}:*`)||r.includes(`${n}:admin`))}function R(e,s){if(!e||!e.role)return false;let t=d(e.role);return s.some(r=>t.includes(r))}function g(e,s=u){if(!e||!e.role)return [];let t=d(e.role),r=new Set;for(let n of t){let o=s[n];if(o)for(let i of o)r.add(i);}return Array.from(r)}exports.a=y;exports.b=R;
|
package/dist/chunk-ALTU3FDG.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {K,H}from'./chunk-YIFKTA5N.js';import {e}from'./chunk-RYXLEFS5.js';import {hb}from'./chunk-2TYITUOC.js';import {a as a$1}from'./chunk-WNU76M2C.js';import {c}from'./chunk-6NBZDW53.js';import {a}from'./chunk-6E44MQQ5.js';import {a as a$2}from'./chunk-YGI5W4RS.js';import {g}from'./chunk-Y2YAKDEQ.js';import w from'kyro:config';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
|
|
2
|
-
g();var r=null,l=null;async function b(){if(!r){if(globalThis.__KYRO_INSTANCE__)try{await globalThis.__KYRO_INSTANCE__.shutdown();}catch{}try{let e$1=w.default||w,t=e$1.adapter,o=t&&!t.dialect&&typeof t.connect=="function";if(globalThis.DB&&(!t||o)){let s=globalThis.DB;e$1.adapter=new c({type:"sqlite",client:s}),K.info("Hot-swapped to D1 DrizzleAdapter");}r=H(e$1),await r.init();let a$3=e$1.adapter,p=a$3&&a$3.dialect&&(a$3.dialect==="postgres"||a$3.dialect==="sqlite"),c$1=a$3&&a$3.dialect==="mongodb",n;if(p)a$3.dialect==="postgres"?n=new a({db:a$3.client}):a$3.dialect==="sqlite"&&(n=new hb({db:a$3.rawClient||a$3.client}));else if(o&&!globalThis.DB){let s=process.env.KYRO_AUTH_DB_PATH||"./data/auth.db";n=new a$1({path:s});}else c$1&&(n=new a$2({adapter:a$3}));if(n?.connect)try{await n.connect();}catch(s){K.warn("Auth connect warning:",s);}try{await r.loadSettings();}catch(s){K.warn("loadSettings warning:",s);}try{await e(n);}catch(s){K.warn("autoBootstrap warning:",s);}globalThis.__KYRO_INSTANCE__=r;}catch(e){throw r=null,l=null,K.error("Init failed, will retry:",e),e}}}async function E(e){let t=globalThis.DB?globalThis:null;try{let{env:o}=await import('cloudflare:workers');o&&(t=o);}catch{}if(e)try{t=e.locals?.cfContext?.env||e?.env||t;}catch{}if(!t)try{t=process.env;}catch{}t?.DB&&(globalThis.DB=t.DB),t?.STORAGE_BUCKET&&(globalThis.STORAGE_BUCKET=t.STORAGE_BUCKET),l||(l=b()),await l;}var _={graphqlEnabled:false,trpcEnabled:false,wsEnabled:false,requireAuth:false};function T(e){return r?r.settings?.access?.apiAccess?.[e]??_[e]??true:_[e]??true}var R=async e=>{if(!r)try{await Promise.race([E(e),new Promise((t,o)=>setTimeout(()=>o(new Error("Initialization timeout")),3e4))]);}catch(t){return console.error("[Kyro API] Warm error:",t?.stack||t?.message||t),new Response(JSON.stringify({error:"Service Unavailable",message:"Kyro CMS is still starting up. Please try again in a moment."}),{status:503,headers:{"Content-Type":"application/json","Retry-After":"5"}})}try{let o=new URL(e.request.url).pathname,a=__KYRO_API_PATH__;if(o===`${a}/graphql`&&typeof r.getGraphQL=="function"){if(!T("graphqlEnabled"))return new Response(JSON.stringify({error:"GraphQL is disabled"}),{status:503,headers:{"Content-Type":"application/json"}});let n=await r.getGraphQL().fetch(e.request,e.locals);return new Response(n.body,n)}if(o.startsWith(`${a}/trpc/`)&&typeof r.getTRPC=="function"){if(!T("trpcEnabled"))return new Response(JSON.stringify({error:"tRPC is disabled"}),{status:503,headers:{"Content-Type":"application/json"}});let n=await r.getTRPC().fetch(e.request,e.locals);return new Response(n.body,n)}return await(await r.getREST()).fetch(e.request,e.locals)}catch(t){return console.error("[Kyro API Execution Error]:",t?.stack||t?.message||t),new Response(JSON.stringify({error:"Internal Server Error",message:t?.message||String(t),stack:t?.stack}),{status:500,headers:{"Content-Type":"application/json"}})}},N=R;export{r as a,E as b,R as c,N as d};
|
package/dist/chunk-BAVN7VDR.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkVRZC4TTF_cjs=require('./chunk-VRZC4TTF.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');chunkBUNLC3II_cjs.h();var f=class{constructor(e,n){this.unique=e,this.name=n;}static[chunkVRZC4TTF_cjs.a]="PgIndexBuilderOn";on(...e){return new u(e.map(n=>{if(chunkVRZC4TTF_cjs.c(n,chunkVRZC4TTF_cjs.A))return n;n=n;let r=new chunkVRZC4TTF_cjs.h(n.name,!!n.keyAsName,n.columnType,n.indexConfig);return n.indexConfig=JSON.parse(JSON.stringify(n.defaultConfig)),r}),this.unique,false,this.name)}onOnly(...e){return new u(e.map(n=>{if(chunkVRZC4TTF_cjs.c(n,chunkVRZC4TTF_cjs.A))return n;n=n;let r=new chunkVRZC4TTF_cjs.h(n.name,!!n.keyAsName,n.columnType,n.indexConfig);return n.indexConfig=n.defaultConfig,r}),this.unique,true,this.name)}using(e,...n){return new u(n.map(r=>{if(chunkVRZC4TTF_cjs.c(r,chunkVRZC4TTF_cjs.A))return r;r=r;let a=new chunkVRZC4TTF_cjs.h(r.name,!!r.keyAsName,r.columnType,r.indexConfig);return r.indexConfig=JSON.parse(JSON.stringify(r.defaultConfig)),a}),this.unique,true,this.name,e)}},u=class{static[chunkVRZC4TTF_cjs.a]="PgIndexBuilder";config;constructor(e,n,r,a,g="btree"){this.config={name:a,columns:e,unique:n,only:r,method:g};}concurrently(){return this.config.concurrently=true,this}with(e){return this.config.with=e,this}where(e){return this.config.where=e,this}build(e){return new m(this.config,e)}},m=class{static[chunkVRZC4TTF_cjs.a]="PgIndex";config;constructor(e,n){this.config={...e,table:n};}};function C(o){return new f(false,o)}function p(o){return new f(true,o)}exports.a=C;exports.b=p;
|
package/dist/chunk-BCEE4NBZ.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkVRZC4TTF_cjs=require('./chunk-VRZC4TTF.cjs'),chunkBUNLC3II_cjs=require('./chunk-BUNLC3II.cjs');chunkBUNLC3II_cjs.h();var x=class{constructor(r){this.table=r;}static[chunkVRZC4TTF_cjs.a]="ColumnAliasProxyHandler";get(r,t){return t==="table"?this.table:r[t]}},A=class{constructor(r,t){this.alias=r,this.replaceOriginalName=t;}static[chunkVRZC4TTF_cjs.a]="TableAliasProxyHandler";get(r,t){if(t===chunkVRZC4TTF_cjs.t.Symbol.IsAlias)return true;if(t===chunkVRZC4TTF_cjs.t.Symbol.Name)return this.alias;if(this.replaceOriginalName&&t===chunkVRZC4TTF_cjs.t.Symbol.OriginalName)return this.alias;if(t===chunkVRZC4TTF_cjs.l)return {...r[chunkVRZC4TTF_cjs.l],name:this.alias,isAlias:true};if(t===chunkVRZC4TTF_cjs.t.Symbol.Columns){let o=r[chunkVRZC4TTF_cjs.t.Symbol.Columns];if(!o)return o;let a={};return Object.keys(o).map(l=>{a[l]=new Proxy(o[l],new x(new Proxy(r,this)));}),a}let i=r[t];return chunkVRZC4TTF_cjs.c(i,chunkVRZC4TTF_cjs.d)?new Proxy(i,new x(new Proxy(r,this))):i}},P=class{constructor(r){this.alias=r;}static[chunkVRZC4TTF_cjs.a]="RelationTableAliasProxyHandler";get(r,t){return t==="sourceTable"?pe(r.sourceTable,this.alias):r[t]}};function pe(e,r){return new Proxy(e,new A(r,false))}function Ke(e,r){return new Proxy(e,new P(r))}function Ne(e,r){return new Proxy(e,new x(new Proxy(e.table,new A(r,false))))}function ge(e,r){return new chunkVRZC4TTF_cjs.A.Aliased(z(e.sql,r),e.fieldAlias)}function z(e,r){return chunkVRZC4TTF_cjs.J.join(e.queryChunks.map(t=>chunkVRZC4TTF_cjs.c(t,chunkVRZC4TTF_cjs.d)?Ne(t,r):chunkVRZC4TTF_cjs.c(t,chunkVRZC4TTF_cjs.A)?z(t,r):chunkVRZC4TTF_cjs.c(t,chunkVRZC4TTF_cjs.A.Aliased)?ge(t,r):t))}chunkBUNLC3II_cjs.h();var H=class{static[chunkVRZC4TTF_cjs.a]="QueryPromise";[Symbol.toStringTag]="QueryPromise";catch(r){return this.then(void 0,r)}finally(r){return this.then(t=>(r?.(),t),t=>{throw r?.(),t})}then(r,t){return this.execute().then(r,t)}};chunkBUNLC3II_cjs.h();var j=class extends Error{static[chunkVRZC4TTF_cjs.a]="DrizzleError";constructor({message:r,cause:t}){super(r),this.name="DrizzleError",this.cause=t;}},M=class e extends Error{constructor(r,t,i){super(`Failed query: ${r}
|
|
2
|
-
params: ${t}`),this.query=r,this.params=t,this.cause=i,Error.captureStackTrace(this,e),i&&(this.cause=i);}},U=class extends j{static[chunkVRZC4TTF_cjs.a]="TransactionRollbackError";constructor(){super({message:"Rollback"});}};chunkBUNLC3II_cjs.h();function m(e,r){return chunkVRZC4TTF_cjs.D(r)&&!chunkVRZC4TTF_cjs.y(e)&&!chunkVRZC4TTF_cjs.c(e,chunkVRZC4TTF_cjs.H)&&!chunkVRZC4TTF_cjs.c(e,chunkVRZC4TTF_cjs.K)&&!chunkVRZC4TTF_cjs.c(e,chunkVRZC4TTF_cjs.d)&&!chunkVRZC4TTF_cjs.c(e,chunkVRZC4TTF_cjs.t)&&!chunkVRZC4TTF_cjs.c(e,chunkVRZC4TTF_cjs.N)?new chunkVRZC4TTF_cjs.H(e,r):e}var W=(e,r)=>chunkVRZC4TTF_cjs.J`${e} = ${m(r,e)}`,G=(e,r)=>chunkVRZC4TTF_cjs.J`${e} <> ${m(r,e)}`;function X(...e){let r=e.filter(t=>t!==void 0);if(r.length!==0)return r.length===1?new chunkVRZC4TTF_cjs.A(r):new chunkVRZC4TTF_cjs.A([new chunkVRZC4TTF_cjs.z("("),chunkVRZC4TTF_cjs.J.join(r,new chunkVRZC4TTF_cjs.z(" and ")),new chunkVRZC4TTF_cjs.z(")")])}function Y(...e){let r=e.filter(t=>t!==void 0);if(r.length!==0)return r.length===1?new chunkVRZC4TTF_cjs.A(r):new chunkVRZC4TTF_cjs.A([new chunkVRZC4TTF_cjs.z("("),chunkVRZC4TTF_cjs.J.join(r,new chunkVRZC4TTF_cjs.z(" or ")),new chunkVRZC4TTF_cjs.z(")")])}function Z(e){return chunkVRZC4TTF_cjs.J`not ${e}`}var _=(e,r)=>chunkVRZC4TTF_cjs.J`${e} > ${m(r,e)}`,v=(e,r)=>chunkVRZC4TTF_cjs.J`${e} >= ${m(r,e)}`,ee=(e,r)=>chunkVRZC4TTF_cjs.J`${e} < ${m(r,e)}`,re=(e,r)=>chunkVRZC4TTF_cjs.J`${e} <= ${m(r,e)}`;function te(e,r){return Array.isArray(r)?r.length===0?chunkVRZC4TTF_cjs.J`false`:chunkVRZC4TTF_cjs.J`${e} in ${r.map(t=>m(t,e))}`:chunkVRZC4TTF_cjs.J`${e} in ${m(r,e)}`}function ne(e,r){return Array.isArray(r)?r.length===0?chunkVRZC4TTF_cjs.J`true`:chunkVRZC4TTF_cjs.J`${e} not in ${r.map(t=>m(t,e))}`:chunkVRZC4TTF_cjs.J`${e} not in ${m(r,e)}`}function ie(e){return chunkVRZC4TTF_cjs.J`${e} is null`}function oe(e){return chunkVRZC4TTF_cjs.J`${e} is not null`}function se(e){return chunkVRZC4TTF_cjs.J`exists ${e}`}function ae(e){return chunkVRZC4TTF_cjs.J`not exists ${e}`}function le(e,r,t){return chunkVRZC4TTF_cjs.J`${e} between ${m(r,e)} and ${m(t,e)}`}function ce(e,r,t){return chunkVRZC4TTF_cjs.J`${e} not between ${m(r,e)} and ${m(t,e)}`}function ue(e,r){return chunkVRZC4TTF_cjs.J`${e} like ${r}`}function fe(e,r){return chunkVRZC4TTF_cjs.J`${e} not like ${r}`}function me(e,r){return chunkVRZC4TTF_cjs.J`${e} ilike ${r}`}function he(e,r){return chunkVRZC4TTF_cjs.J`${e} not ilike ${r}`}function Ve(e,r){if(Array.isArray(r)){if(r.length===0)throw new Error("arrayContains requires at least one value");let t=chunkVRZC4TTF_cjs.J`${m(r,e)}`;return chunkVRZC4TTF_cjs.J`${e} @> ${t}`}return chunkVRZC4TTF_cjs.J`${e} @> ${m(r,e)}`}function ze(e,r){if(Array.isArray(r)){if(r.length===0)throw new Error("arrayContained requires at least one value");let t=chunkVRZC4TTF_cjs.J`${m(r,e)}`;return chunkVRZC4TTF_cjs.J`${e} <@ ${t}`}return chunkVRZC4TTF_cjs.J`${e} <@ ${m(r,e)}`}function He(e,r){if(Array.isArray(r)){if(r.length===0)throw new Error("arrayOverlaps requires at least one value");let t=chunkVRZC4TTF_cjs.J`${m(r,e)}`;return chunkVRZC4TTF_cjs.J`${e} && ${t}`}return chunkVRZC4TTF_cjs.J`${e} && ${m(r,e)}`}chunkBUNLC3II_cjs.h();function ye(e){return chunkVRZC4TTF_cjs.J`${e} asc`}function de(e){return chunkVRZC4TTF_cjs.J`${e} desc`}chunkBUNLC3II_cjs.h();chunkBUNLC3II_cjs.h();var C=class{static[chunkVRZC4TTF_cjs.a]="PgPrimaryKeyBuilder";columns;name;constructor(r,t){this.columns=r,this.name=t;}build(r){return new q(r,this.columns,this.name)}},q=class{constructor(r,t,i){this.table=r,this.columns=t,this.name=i;}static[chunkVRZC4TTF_cjs.a]="PgPrimaryKey";columns;name;getName(){return this.name??`${this.table[chunkVRZC4TTF_cjs.qa.Symbol.Name]}_${this.columns.map(r=>r.name).join("_")}_pk`}};var O=class{constructor(r,t,i){this.sourceTable=r,this.referencedTable=t,this.relationName=i,this.referencedTableName=t[chunkVRZC4TTF_cjs.t.Symbol.Name];}static[chunkVRZC4TTF_cjs.a]="Relation";referencedTableName;fieldName},E=class{constructor(r,t){this.table=r,this.config=t;}static[chunkVRZC4TTF_cjs.a]="Relations"},g=class e extends O{constructor(r,t,i,o){super(r,t,i?.relationName),this.config=i,this.isNullable=o;}static[chunkVRZC4TTF_cjs.a]="One";withFieldName(r){let t=new e(this.sourceTable,this.referencedTable,this.config,this.isNullable);return t.fieldName=r,t}},R=class e extends O{constructor(r,t,i){super(r,t,i?.relationName),this.config=i;}static[chunkVRZC4TTF_cjs.a]="Many";withFieldName(r){let t=new e(this.sourceTable,this.referencedTable,this.config);return t.fieldName=r,t}};function sr(){return {and:X,between:le,eq:W,exists:se,gt:_,gte:v,ilike:me,inArray:te,isNull:ie,isNotNull:oe,like:ue,lt:ee,lte:re,ne:G,not:Z,notBetween:ce,notExists:ae,notLike:fe,notIlike:he,notInArray:ne,or:Y,sql:chunkVRZC4TTF_cjs.J}}function ar(){return {sql:chunkVRZC4TTF_cjs.J,asc:ye,desc:de}}function lr(e,r){Object.keys(e).length===1&&"default"in e&&!chunkVRZC4TTF_cjs.c(e.default,chunkVRZC4TTF_cjs.t)&&(e=e.default);let t={},i={},o={};for(let[a,l]of Object.entries(e))if(chunkVRZC4TTF_cjs.c(l,chunkVRZC4TTF_cjs.t)){let s=chunkVRZC4TTF_cjs.w(l),d=i[s];t[s]=a,o[a]={tsName:a,dbName:l[chunkVRZC4TTF_cjs.t.Symbol.Name],schema:l[chunkVRZC4TTF_cjs.t.Symbol.Schema],columns:l[chunkVRZC4TTF_cjs.t.Symbol.Columns],relations:d?.relations??{},primaryKey:d?.primaryKey??[]};for(let h of Object.values(l[chunkVRZC4TTF_cjs.t.Symbol.Columns]))h.primary&&o[a].primaryKey.push(h);let b=l[chunkVRZC4TTF_cjs.t.Symbol.ExtraConfigBuilder]?.(l[chunkVRZC4TTF_cjs.t.Symbol.ExtraConfigColumns]);if(b)for(let h of Object.values(b))chunkVRZC4TTF_cjs.c(h,C)&&o[a].primaryKey.push(...h.columns);}else if(chunkVRZC4TTF_cjs.c(l,E)){let s=chunkVRZC4TTF_cjs.w(l.table),d=t[s],b=l.config(r(l.table)),h;for(let[S,Q]of Object.entries(b))if(d){let L=o[d];L.relations[S]=Q;}else s in i||(i[s]={relations:{},primaryKey:h}),i[s].relations[S]=Q;}return {tables:o,tableNamesMap:t}}function cr(e,r){return new E(e,t=>Object.fromEntries(Object.entries(r(t)).map(([i,o])=>[i,o.withFieldName(i)])))}function Te(e){return function(t,i){return new g(e,t,i,i?.fields.reduce((o,a)=>o&&a.notNull,true)??false)}}function xe(e){return function(t,i){return new R(e,t,i)}}function ur(e,r,t){if(chunkVRZC4TTF_cjs.c(t,g)&&t.config)return {fields:t.config.fields,references:t.config.references};let i=r[chunkVRZC4TTF_cjs.w(t.referencedTable)];if(!i)throw new Error(`Table "${t.referencedTable[chunkVRZC4TTF_cjs.t.Symbol.Name]}" not found in schema`);let o=e[i];if(!o)throw new Error(`Table "${i}" not found in schema`);let a=t.sourceTable,l=r[chunkVRZC4TTF_cjs.w(a)];if(!l)throw new Error(`Table "${a[chunkVRZC4TTF_cjs.t.Symbol.Name]}" not found in schema`);let s=[];for(let d of Object.values(o.relations))(t.relationName&&t!==d&&d.relationName===t.relationName||!t.relationName&&d.referencedTable===t.sourceTable)&&s.push(d);if(s.length>1)throw t.relationName?new Error(`There are multiple relations with name "${t.relationName}" in table "${i}"`):new Error(`There are multiple relations between "${i}" and "${t.sourceTable[chunkVRZC4TTF_cjs.t.Symbol.Name]}". Please specify relation name`);if(s[0]&&chunkVRZC4TTF_cjs.c(s[0],g)&&s[0].config)return {fields:s[0].config.references,references:s[0].config.fields};throw new Error(`There is not enough information to infer relation "${l}.${t.fieldName}"`)}function fr(e){return {one:Te(e),many:xe(e)}}function be(e,r,t,i,o=a=>a){let a={};for(let[l,s]of i.entries())if(s.isJson){let d=r.relations[s.tsKey],b=t[l],h=typeof b=="string"?JSON.parse(b):b;a[s.tsKey]=chunkVRZC4TTF_cjs.c(d,g)?h&&be(e,e[s.relationTableTsKey],h,s.selection,o):h.map(S=>be(e,e[s.relationTableTsKey],S,s.selection,o));}else {let d=o(t[l]),b=s.field,h;chunkVRZC4TTF_cjs.c(b,chunkVRZC4TTF_cjs.d)?h=b:chunkVRZC4TTF_cjs.c(b,chunkVRZC4TTF_cjs.A)?h=b.decoder:h=b.sql.decoder,a[s.tsKey]=d===null?null:h.mapFromDriverValue(d);}return a}chunkBUNLC3II_cjs.h();var I=class{static[chunkVRZC4TTF_cjs.a]="ConsoleLogWriter";write(r){console.log(r);}},we=class{static[chunkVRZC4TTF_cjs.a]="DefaultLogger";writer;constructor(r){this.writer=r?.writer??new I;}logQuery(r,t){let i=t.map(a=>{try{return JSON.stringify(a)}catch{return String(a)}}),o=i.length?` -- params: [${i.join(", ")}]`:"";this.writer.write(`Query: ${r}${o}`);}},$e=class{static[chunkVRZC4TTF_cjs.a]="NoopLogger";logQuery(){}};exports.$=we;exports.A=se;exports.B=ae;exports.C=le;exports.D=ce;exports.E=ue;exports.F=fe;exports.G=me;exports.H=he;exports.I=Ve;exports.J=ze;exports.K=He;exports.L=ye;exports.M=de;exports.N=O;exports.O=E;exports.P=g;exports.Q=R;exports.R=sr;exports.S=ar;exports.T=lr;exports.U=cr;exports.V=Te;exports.W=xe;exports.X=ur;exports.Y=fr;exports.Z=be;exports._=I;exports.a=x;exports.aa=$e;exports.b=A;exports.c=P;exports.d=pe;exports.e=Ke;exports.f=Ne;exports.g=ge;exports.h=z;exports.i=H;exports.j=j;exports.k=M;exports.l=U;exports.m=m;exports.n=W;exports.o=G;exports.p=X;exports.q=Y;exports.r=Z;exports.s=_;exports.t=v;exports.u=ee;exports.v=re;exports.w=te;exports.x=ne;exports.y=ie;exports.z=oe;
|
package/dist/chunk-BUNLC3II.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var p=Object.create;var c=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var i=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var l=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var f=(e,t)=>()=>(e&&(t=e(e=0)),t);var R=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),S=(e,t)=>{for(var r in t)c(e,r,{get:t[r],enumerable:true});},m=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of a(t))!d.call(e,n)&&n!==r&&c(e,n,{get:()=>t[n],enumerable:!(o=u(t,n))||o.enumerable});return e};var I=(e,t,r)=>(r=e!=null?p(i(e)):{},m(t||!e||!e.__esModule?c(r,"default",{value:e,enumerable:true}):r,e)),g=e=>m(c({},"__esModule",{value:true}),e);var s;exports.g=void 0;var U=f(()=>{s=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"?document.currentScript.src:new URL("main.js",document.baseURI).href,exports.g=s();});exports.a=l;exports.b=f;exports.c=R;exports.d=S;exports.e=I;exports.f=g;exports.h=U;
|
package/dist/chunk-C7QCZX7X.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-FLMUMPDE.js';import {ra,ma,fa,pa,ia,ca,oa}from'./chunk-3NSZZCOJ.js';import {g as g$1}from'./chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
|
|
2
|
-
g$1();var f=ra("media",{id:oa("id").primaryKey().defaultRandom(),filename:pa("filename",{length:255}).notNull().unique(),title:pa("title",{length:255}),originalName:pa("original_name",{length:255}).notNull(),mimeType:pa("mime_type",{length:100}).notNull(),fileSize:ca("file_size").notNull(),width:ca("width"),height:ca("height"),url:ia("url").notNull().unique(),thumbnailUrl:ia("thumbnail_url"),folder:pa("folder",{length:255}),provider:pa("provider",{length:50}).notNull(),alt:ia("alt"),caption:ia("caption"),type:pa("type",{length:50}).notNull().default("other"),status:pa("status",{length:20}).notNull().default("active"),metadata:fa("metadata").$type(),createdAt:ma("created_at").defaultNow().notNull(),updatedAt:ma("updated_at").defaultNow().notNull()},t=>[a("media_folder_idx").on(t.folder),a("media_provider_idx").on(t.provider),a("media_filename_idx").on(t.filename)]),g=ra("media_folders",{path:pa("path",{length:500}).primaryKey(),name:pa("name",{length:255}).notNull(),parentPath:pa("parent_path",{length:500}),createdAt:ma("created_at").defaultNow().notNull()},t=>[a("media_folders_parent_idx").on(t.parentPath)]);export{f as a,g as b};
|
package/dist/chunk-D6SDGHY6.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {g}from'./chunk-Y2YAKDEQ.js';if (typeof window === "undefined") { const { createRequire } = await import(/* @vite-ignore */ 'module'); createRequire(import.meta.url); }
|
|
2
|
-
g();function i(){return {name:"seo",type:"group",label:"SEO Settings",fields:[{name:"metaTitle",type:"text",label:"Meta Title",admin:{description:"The title used for search engines (recommended < 60 chars). Leave empty for AI auto-generation."}},{name:"metaDescription",type:"textarea",label:"Meta Description",admin:{description:"A brief summary for search engines (recommended < 160 chars). Leave empty for AI auto-generation."}},{name:"keywords",type:"text",label:"Keywords",admin:{description:"Comma-separated list of keywords for this page."}},{name:"ogImage",type:"upload",label:"OpenGraph Image",relationTo:"media",admin:{description:"The image shown when the post is shared on social media (Facebook, LinkedIn)."}},{name:"twitter",type:"group",label:"Twitter Card",fields:[{name:"title",type:"text",label:"Twitter Title"},{name:"description",type:"textarea",label:"Twitter Description"},{name:"image",type:"upload",label:"Twitter Image",relationTo:"media"}]},{name:"advanced",type:"group",label:"Advanced Search Settings",fields:[{name:"noindex",type:"checkbox",label:"Hide from search engines (noindex)",defaultValue:false},{name:"nofollow",type:"checkbox",label:"Do not follow links (nofollow)",defaultValue:false},{name:"canonicalUrl",type:"text",label:"Canonical URL Override",admin:{description:"Leave empty to use the default canonical URL."}},{name:"structuredData",type:"code",label:"JSON-LD Structured Data",admin:{description:"Custom JSON-LD schema for this specific page."}}]}]}}export{i as a};
|