@lehnihon/bit-form 2.2.18 → 2.2.24
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/README.md +10 -13
- package/dist/angular/index.cjs +1 -1
- package/dist/angular/index.cjs.map +1 -1
- package/dist/angular/index.d.cts +7 -6
- package/dist/angular/index.d.ts +7 -6
- package/dist/angular/index.js +1 -1
- package/dist/angular/index.js.map +1 -1
- package/dist/{chunk-DD6XWUMR.cjs → chunk-27LJCW56.cjs} +2 -2
- package/dist/chunk-27LJCW56.cjs.map +1 -0
- package/dist/chunk-3SEB4YRQ.cjs +2 -0
- package/dist/chunk-3SEB4YRQ.cjs.map +1 -0
- package/dist/chunk-4WPLTOBT.cjs +2 -0
- package/dist/chunk-4WPLTOBT.cjs.map +1 -0
- package/dist/chunk-5ILGCBKG.cjs +2 -0
- package/dist/chunk-5ILGCBKG.cjs.map +1 -0
- package/dist/chunk-725CMNAV.cjs +2 -0
- package/dist/chunk-725CMNAV.cjs.map +1 -0
- package/dist/{chunk-GKNGJOB3.cjs → chunk-7LCFS2JM.cjs} +2 -2
- package/dist/chunk-7LCFS2JM.cjs.map +1 -0
- package/dist/{chunk-AVUK52JW.cjs → chunk-AOMXTUA4.cjs} +2 -2
- package/dist/chunk-AOMXTUA4.cjs.map +1 -0
- package/dist/chunk-BSGJ3T5S.cjs.map +1 -1
- package/dist/chunk-CATA7YEV.js +2 -0
- package/dist/chunk-CATA7YEV.js.map +1 -0
- package/dist/chunk-DGEGYNQL.js +2 -0
- package/dist/{chunk-3NUJVIAM.js.map → chunk-DGEGYNQL.js.map} +1 -1
- package/dist/chunk-DNHPYPJA.js +2 -0
- package/dist/chunk-DNHPYPJA.js.map +1 -0
- package/dist/chunk-H3RTOA6X.cjs +2 -0
- package/dist/chunk-H3RTOA6X.cjs.map +1 -0
- package/dist/chunk-H6HGYVRV.cjs +2 -0
- package/dist/chunk-H6HGYVRV.cjs.map +1 -0
- package/dist/chunk-HTMNDK6W.js +2 -0
- package/dist/chunk-HTMNDK6W.js.map +1 -0
- package/dist/chunk-JVRTPL7W.js +2 -0
- package/dist/chunk-JVRTPL7W.js.map +1 -0
- package/dist/{chunk-77PK7U73.cjs → chunk-K2JSAJAF.cjs} +2 -2
- package/dist/chunk-K2JSAJAF.cjs.map +1 -0
- package/dist/chunk-K2KCQEER.js +2 -0
- package/dist/chunk-K2KCQEER.js.map +1 -0
- package/dist/chunk-L57KMBXS.js +2 -0
- package/dist/chunk-L57KMBXS.js.map +1 -0
- package/dist/chunk-LY67POOF.js +2 -0
- package/dist/chunk-LY67POOF.js.map +1 -0
- package/dist/chunk-MBEQLBJB.js +2 -0
- package/dist/chunk-MBEQLBJB.js.map +1 -0
- package/dist/chunk-MFSDDSVG.cjs.map +1 -1
- package/dist/chunk-PDFT5E2E.cjs +2 -0
- package/dist/chunk-PDFT5E2E.cjs.map +1 -0
- package/dist/chunk-PRMNTQD5.js +2 -0
- package/dist/chunk-PRMNTQD5.js.map +1 -0
- package/dist/chunk-QKGTVKBU.cjs.map +1 -1
- package/dist/chunk-RHMJPKNV.cjs.map +1 -1
- package/dist/chunk-SFVGMVIE.js +2 -0
- package/dist/chunk-SFVGMVIE.js.map +1 -0
- package/dist/chunk-SMCFLQIA.cjs +2 -0
- package/dist/chunk-SMCFLQIA.cjs.map +1 -0
- package/dist/chunk-T36GFQHU.cjs +2 -0
- package/dist/chunk-T36GFQHU.cjs.map +1 -0
- package/dist/chunk-W5CLDRRE.cjs.map +1 -1
- package/dist/chunk-WEZ5Q6YO.js +2 -0
- package/dist/chunk-WEZ5Q6YO.js.map +1 -0
- package/dist/chunk-X3DGA5UC.cjs +2 -0
- package/dist/chunk-X3DGA5UC.cjs.map +1 -0
- package/dist/{chunk-HE6EQZTH.js → chunk-X3OFU2UH.js} +2 -2
- package/dist/chunk-XPY6TCOO.js +2 -0
- package/dist/{chunk-SYEUXL2E.js.map → chunk-XPY6TCOO.js.map} +1 -1
- package/dist/cli/index.cjs +19 -18
- package/dist/{config-types-bTt2lcw9.d.ts → config-types-DB6FaTiZ.d.ts} +3 -3
- package/dist/{config-types-Dbyt7t3D.d.cts → config-types-mZFlp2Bi.d.cts} +3 -3
- package/dist/core/bindings.cjs +1 -1
- package/dist/core/bindings.cjs.map +1 -1
- package/dist/core/bindings.d.cts +4 -4
- package/dist/core/bindings.d.ts +4 -4
- package/dist/core/bindings.js +1 -1
- package/dist/core/status.cjs.map +1 -1
- package/dist/core/status.d.cts +3 -3
- package/dist/core/status.d.ts +3 -3
- package/dist/core/store.cjs +1 -1
- package/dist/core/store.cjs.map +1 -1
- package/dist/core/store.d.cts +5 -5
- package/dist/core/store.d.ts +5 -5
- package/dist/core/store.js +1 -1
- package/dist/core/utils.cjs +1 -1
- package/dist/core/utils.cjs.map +1 -1
- package/dist/core/utils.js +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +4 -4
- package/dist/core.d.ts +4 -4
- package/dist/core.js +1 -1
- package/dist/devtools/bridge.cjs +1 -1
- package/dist/devtools/bridge.cjs.map +1 -1
- package/dist/devtools/bridge.js +1 -1
- package/dist/devtools/index.cjs +17 -17
- package/dist/devtools/index.cjs.map +1 -1
- package/dist/devtools/index.d.cts +2 -2
- package/dist/devtools/index.d.ts +2 -2
- package/dist/devtools/index.js +17 -17
- package/dist/devtools/index.js.map +1 -1
- package/dist/devtools/protocol.cjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/mask.cjs +1 -1
- package/dist/mask.cjs.map +1 -1
- package/dist/mask.d.cts +1 -1
- package/dist/mask.d.ts +1 -1
- package/dist/mask.js +1 -1
- package/dist/{meta-types-BC1VLABk.d.cts → meta-types-1Xcht8hj.d.cts} +1 -1
- package/dist/{meta-types-BC1VLABk.d.ts → meta-types-1Xcht8hj.d.ts} +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +6 -6
- package/dist/react/index.d.ts +6 -6
- package/dist/react/index.js +1 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react-native/index.cjs +1 -1
- package/dist/react-native/index.cjs.map +1 -1
- package/dist/react-native/index.d.cts +5 -5
- package/dist/react-native/index.d.ts +5 -5
- package/dist/react-native/index.js +1 -1
- package/dist/react-native/index.js.map +1 -1
- package/dist/resolvers/index.cjs +1 -1
- package/dist/resolvers/index.cjs.map +1 -1
- package/dist/resolvers/index.js +1 -1
- package/dist/resolvers/joi.cjs +1 -1
- package/dist/resolvers/joi.cjs.map +1 -1
- package/dist/resolvers/joi.js +1 -1
- package/dist/resolvers/types.cjs.map +1 -1
- package/dist/resolvers/yup.cjs +1 -1
- package/dist/resolvers/yup.cjs.map +1 -1
- package/dist/resolvers/yup.js +1 -1
- package/dist/resolvers/zod.cjs +1 -1
- package/dist/resolvers/zod.cjs.map +1 -1
- package/dist/resolvers/zod.js +1 -1
- package/dist/{runtime-types-D1SRZr-n.d.cts → runtime-types-BLCkMgcy.d.cts} +1 -1
- package/dist/{runtime-types-D1SRZr-n.d.ts → runtime-types-BLCkMgcy.d.ts} +1 -1
- package/dist/{store-api-types-i-zmM25p.d.ts → store-api-types-CgRVo2DA.d.ts} +4 -4
- package/dist/{store-api-types-BPD27biP.d.cts → store-api-types-D7i0KWbr.d.cts} +4 -4
- package/dist/{use-bit-persist-BGH2Bazx.d.ts → use-bit-persist-CFcuAzwp.d.ts} +5 -5
- package/dist/{use-bit-persist-DiwICsEm.d.cts → use-bit-persist-Dsr69hme.d.cts} +5 -5
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.d.cts +23 -22
- package/dist/vue/index.d.ts +23 -22
- package/dist/vue/index.js +1 -1
- package/dist/vue/index.js.map +1 -1
- package/package.json +70 -16
- package/dist/chunk-3774TIGK.js +0 -2
- package/dist/chunk-3774TIGK.js.map +0 -1
- package/dist/chunk-3KI3GEU3.cjs +0 -2
- package/dist/chunk-3KI3GEU3.cjs.map +0 -1
- package/dist/chunk-3NUJVIAM.js +0 -2
- package/dist/chunk-77PK7U73.cjs.map +0 -1
- package/dist/chunk-AVUK52JW.cjs.map +0 -1
- package/dist/chunk-CTURHI75.cjs +0 -2
- package/dist/chunk-CTURHI75.cjs.map +0 -1
- package/dist/chunk-DD6XWUMR.cjs.map +0 -1
- package/dist/chunk-FGJB4DHQ.js +0 -2
- package/dist/chunk-FGJB4DHQ.js.map +0 -1
- package/dist/chunk-FTXV2NZO.cjs +0 -2
- package/dist/chunk-FTXV2NZO.cjs.map +0 -1
- package/dist/chunk-G3EHXKOS.js +0 -2
- package/dist/chunk-G3EHXKOS.js.map +0 -1
- package/dist/chunk-GDRNKTHO.js +0 -2
- package/dist/chunk-GDRNKTHO.js.map +0 -1
- package/dist/chunk-GKNGJOB3.cjs.map +0 -1
- package/dist/chunk-GSZTHF7Z.js +0 -2
- package/dist/chunk-GSZTHF7Z.js.map +0 -1
- package/dist/chunk-GUU6EXFN.js +0 -2
- package/dist/chunk-GUU6EXFN.js.map +0 -1
- package/dist/chunk-ICYXODTQ.js +0 -2
- package/dist/chunk-ICYXODTQ.js.map +0 -1
- package/dist/chunk-L7EAZ6K6.cjs +0 -2
- package/dist/chunk-L7EAZ6K6.cjs.map +0 -1
- package/dist/chunk-LIHWJJIM.js +0 -2
- package/dist/chunk-LIHWJJIM.js.map +0 -1
- package/dist/chunk-M2XR4C7T.js +0 -2
- package/dist/chunk-M2XR4C7T.js.map +0 -1
- package/dist/chunk-P5YQ62YN.cjs +0 -2
- package/dist/chunk-P5YQ62YN.cjs.map +0 -1
- package/dist/chunk-PFPGASVZ.cjs +0 -2
- package/dist/chunk-PFPGASVZ.cjs.map +0 -1
- package/dist/chunk-QCKCONCU.js +0 -2
- package/dist/chunk-QCKCONCU.js.map +0 -1
- package/dist/chunk-RSH6LQVC.cjs +0 -2
- package/dist/chunk-RSH6LQVC.cjs.map +0 -1
- package/dist/chunk-SYEUXL2E.js +0 -2
- package/dist/chunk-U5TBWV74.cjs +0 -2
- package/dist/chunk-U5TBWV74.cjs.map +0 -1
- package/dist/chunk-UT63HKR6.cjs +0 -2
- package/dist/chunk-UT63HKR6.cjs.map +0 -1
- package/dist/chunk-WRNR6SXK.cjs +0 -2
- package/dist/chunk-WRNR6SXK.cjs.map +0 -1
- package/dist/chunk-YO4TZ6N6.js +0 -2
- package/dist/chunk-YO4TZ6N6.js.map +0 -1
- /package/dist/{chunk-HE6EQZTH.js.map → chunk-X3OFU2UH.js.map} +0 -0
package/dist/cli/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var Or=Object.create;var Ze=Object.defineProperty;var Cr=Object.getOwnPropertyDescriptor;var Br=Object.getOwnPropertyNames;var Pr=Object.getPrototypeOf,Rr=Object.prototype.hasOwnProperty;var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fr=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Br(e))!Rr.call(t,i)&&i!==r&&Ze(t,i,{get:()=>e[i],enumerable:!(s=Cr(e,i))||s.enumerable});return t};var w=(t,e,r)=>(r=t!=null?Or(Pr(t)):{},Fr(e||!t||!t.__esModule?Ze(r,"default",{value:t,enumerable:!0}):r,t));var N=y((Wi,xt)=>{"use strict";var _t=["nodebuffer","arraybuffer","fragments"],gt=typeof Blob<"u";gt&&_t.push("blob");xt.exports={BINARY_TYPES:_t,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:gt,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var J=y(($i,oe)=>{"use strict";var{EMPTY_BUFFER:Ar}=N(),Te=Buffer[Symbol.species];function Ur(t,e){if(t.length===0)return Ar;if(t.length===1)return t[0];let r=Buffer.allocUnsafe(e),s=0;for(let i=0;i<t.length;i++){let n=t[i];r.set(n,s),s+=n.length}return s<e?new Te(r.buffer,r.byteOffset,s):r}function yt(t,e,r,s,i){for(let n=0;n<i;n++)r[s+n]=t[n]^e[n&3]}function vt(t,e){for(let r=0;r<t.length;r++)t[r]^=e[r&3]}function Mr(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.length)}function Ne(t){if(Ne.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=new Te(t):ArrayBuffer.isView(t)?e=new Te(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),Ne.readOnly=!1),e}oe.exports={concat:Ur,mask:yt,toArrayBuffer:Mr,toBuffer:Ne,unmask:vt};if(!process.env.WS_NO_BUFFER_UTIL)try{let t=require("bufferutil");oe.exports.mask=function(e,r,s,i,n){n<48?yt(e,r,s,i,n):t.mask(e,r,s,i,n)},oe.exports.unmask=function(e,r){e.length<32?vt(e,r):t.unmask(e,r)}}catch{}});var Et=y((Vi,St)=>{"use strict";var bt=Symbol("kDone"),ke=Symbol("kRun"),Oe=class{constructor(e){this[bt]=()=>{this.pending--,this[ke]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[ke]()}[ke](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[bt])}}};St.exports=Oe});var ee=y((Gi,kt)=>{"use strict";var Q=require("zlib"),wt=J(),qr=Et(),{kStatusCode:Tt}=N(),Wr=Buffer[Symbol.species],$r=Buffer.from([0,0,255,255]),le=Symbol("permessage-deflate"),k=Symbol("total-length"),q=Symbol("callback"),P=Symbol("buffers"),W=Symbol("error"),ae,Ce=class{constructor(e,r,s){if(this._maxPayload=s|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!ae){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;ae=new qr(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),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=!0),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[q];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let r=this._options,s=e.find(i=>!(r.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>i.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!s)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(s.server_no_context_takeover=!0),r.clientNoContextTakeover&&(s.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(s.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?s.client_max_window_bits=r.clientMaxWindowBits:(s.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete s.client_max_window_bits,s}acceptAsClient(e){let r=e[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(e){return e.forEach(r=>{Object.keys(r).forEach(s=>{let i=r[s];if(i.length>1)throw new Error(`Parameter "${s}" must have only a single value`);if(i=i[0],s==="client_max_window_bits"){if(i!==!0){let n=+i;if(!Number.isInteger(n)||n<8||n>15)throw new TypeError(`Invalid value for parameter "${s}": ${i}`);i=n}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${s}": ${i}`)}else if(s==="server_max_window_bits"){let n=+i;if(!Number.isInteger(n)||n<8||n>15)throw new TypeError(`Invalid value for parameter "${s}": ${i}`);i=n}else if(s==="client_no_context_takeover"||s==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${s}": ${i}`)}else throw new Error(`Unknown parameter "${s}"`);r[s]=i})}),e}decompress(e,r,s){ae.add(i=>{this._decompress(e,r,(n,o)=>{i(),s(n,o)})})}compress(e,r,s){ae.add(i=>{this._compress(e,r,(n,o)=>{i(),s(n,o)})})}_decompress(e,r,s){let i=this._isServer?"client":"server";if(!this._inflate){let n=`${i}_max_window_bits`,o=typeof this.params[n]!="number"?Q.Z_DEFAULT_WINDOWBITS:this.params[n];this._inflate=Q.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[le]=this,this._inflate[k]=0,this._inflate[P]=[],this._inflate.on("error",Gr),this._inflate.on("data",Nt)}this._inflate[q]=s,this._inflate.write(e),r&&this._inflate.write($r),this._inflate.flush(()=>{let n=this._inflate[W];if(n){this._inflate.close(),this._inflate=null,s(n);return}let o=wt.concat(this._inflate[P],this._inflate[k]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[k]=0,this._inflate[P]=[],r&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),s(null,o)})}_compress(e,r,s){let i=this._isServer?"server":"client";if(!this._deflate){let n=`${i}_max_window_bits`,o=typeof this.params[n]!="number"?Q.Z_DEFAULT_WINDOWBITS:this.params[n];this._deflate=Q.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[k]=0,this._deflate[P]=[],this._deflate.on("data",Vr)}this._deflate[q]=s,this._deflate.write(e),this._deflate.flush(Q.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let n=wt.concat(this._deflate[P],this._deflate[k]);r&&(n=new Wr(n.buffer,n.byteOffset,n.length-4)),this._deflate[q]=null,this._deflate[k]=0,this._deflate[P]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),s(null,n)})}};kt.exports=Ce;function Vr(t){this[P].push(t),this[k]+=t.length}function Nt(t){if(this[k]+=t.length,this[le]._maxPayload<1||this[k]<=this[le]._maxPayload){this[P].push(t);return}this[W]=new RangeError("Max payload size exceeded"),this[W].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[W][Tt]=1009,this.removeListener("data",Nt),this.reset()}function Gr(t){if(this[le]._inflate=null,this[W]){this[q](this[W]);return}t[Tt]=1007,this[q](t)}});var $=y((ji,ce)=>{"use strict";var{isUtf8:Ot}=require("buffer"),{hasBlob:jr}=N(),Hr=[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 zr(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function Be(t){let e=t.length,r=0;for(;r<e;)if((t[r]&128)===0)r++;else if((t[r]&224)===192){if(r+1===e||(t[r+1]&192)!==128||(t[r]&254)===192)return!1;r+=2}else if((t[r]&240)===224){if(r+2>=e||(t[r+1]&192)!==128||(t[r+2]&192)!==128||t[r]===224&&(t[r+1]&224)===128||t[r]===237&&(t[r+1]&224)===160)return!1;r+=3}else if((t[r]&248)===240){if(r+3>=e||(t[r+1]&192)!==128||(t[r+2]&192)!==128||(t[r+3]&192)!==128||t[r]===240&&(t[r+1]&240)===128||t[r]===244&&t[r+1]>143||t[r]>244)return!1;r+=4}else return!1;return!0}function Yr(t){return jr&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]==="Blob"||t[Symbol.toStringTag]==="File")}ce.exports={isBlob:Yr,isValidStatusCode:zr,isValidUTF8:Be,tokenChars:Hr};if(Ot)ce.exports.isValidUTF8=function(t){return t.length<24?Be(t):Ot(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=require("utf-8-validate");ce.exports.isValidUTF8=function(e){return e.length<32?Be(e):t(e)}}catch{}});var Le=y((Hi,Lt)=>{"use strict";var{Writable:Kr}=require("stream"),Ct=ee(),{BINARY_TYPES:Xr,EMPTY_BUFFER:Bt,kStatusCode:Zr,kWebSocket:Jr}=N(),{concat:Pe,toArrayBuffer:Qr,unmask:es}=J(),{isValidStatusCode:ts,isValidUTF8:Pt}=$(),de=Buffer[Symbol.species],b=0,Rt=1,Ft=2,It=3,Re=4,Fe=5,fe=6,Ie=class extends Kr{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||Xr[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[Jr]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=b}_write(e,r,s){if(this._opcode===8&&this._state==b)return s();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(s)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let s=this._buffers[0];return this._buffers[0]=new de(s.buffer,s.byteOffset+e,s.length-e),new de(s.buffer,s.byteOffset,e)}let r=Buffer.allocUnsafe(e);do{let s=this._buffers[0],i=r.length-e;e>=s.length?r.set(this._buffers.shift(),i):(r.set(new Uint8Array(s.buffer,s.byteOffset,e),i),this._buffers[0]=new de(s.buffer,s.byteOffset+e,s.length-e)),e-=s.length}while(e>0);return r}startLoop(e){this._loop=!0;do switch(this._state){case b:this.getInfo(e);break;case Rt:this.getPayloadLength16(e);break;case Ft:this.getPayloadLength64(e);break;case It:this.getMask();break;case Re:this.getData(e);break;case Fe:case fe:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let s=(r[0]&64)===64;if(s&&!this._extensions[Ct.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(s){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,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}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=s}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(s){let i=this.createError(RangeError,"RSV1 must be clear",!0,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}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=Rt:this._payloadLength===127?this._state=Ft:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),s=r.readUInt32BE(0);if(s>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}this._payloadLength=s*Math.pow(2,32)+r.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 r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(r);return}this._masked?this._state=It:this._state=Re}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Re}getData(e){let r=Bt;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&es(r,this._mask)}if(this._opcode>7){this.controlMessage(r,e);return}if(this._compressed){this._state=Fe,this.decompress(r,e);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(e)}decompress(e,r){this._extensions[Ct.extensionName].decompress(e,this._fin,(i,n)=>{if(i)return r(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",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(o);return}this._fragments.push(n)}this.dataMessage(r),this._state===b&&this.startLoop(r)})}dataMessage(e){if(!this._fin){this._state=b;return}let r=this._messageLength,s=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=Pe(s,r):this._binaryType==="arraybuffer"?i=Qr(Pe(s,r)):this._binaryType==="blob"?i=new Blob(s):i=s,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=b):(this._state=fe,setImmediate(()=>{this.emit("message",i,!0),this._state=b,this.startLoop(e)}))}else{let i=Pe(s,r);if(!this._skipUTF8Validation&&!Pt(i)){let n=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(n);return}this._state===Fe||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=b):(this._state=fe,setImmediate(()=>{this.emit("message",i,!1),this._state=b,this.startLoop(e)}))}}controlMessage(e,r){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Bt),this.end();else{let s=e.readUInt16BE(0);if(!ts(s)){let n=this.createError(RangeError,`invalid status code ${s}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(n);return}let i=new de(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Pt(i)){let n=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(n);return}this._loop=!1,this.emit("conclude",s,i),this.end()}this._state=b;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=b):(this._state=fe,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=b,this.startLoop(r)}))}createError(e,r,s,i,n){this._loop=!1,this._errored=!0;let o=new e(s?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(o,this.createError),o.code=n,o[Zr]=i,o}};Lt.exports=Ie});var Ue=y((Yi,Ut)=>{"use strict";var{Duplex:zi}=require("stream"),{randomFillSync:rs}=require("crypto"),Dt=ee(),{EMPTY_BUFFER:ss,kWebSocket:is,NOOP:ns}=N(),{isBlob:V,isValidStatusCode:os}=$(),{mask:At,toBuffer:F}=J(),S=Symbol("kByteLength"),as=Buffer.alloc(4),ue=8*1024,I,G=ue,E=0,ls=1,cs=2,De=class t{constructor(e,r,s){this._extensions=r||{},s&&(this._generateMask=s,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=E,this.onerror=ns,this[is]=void 0}static frame(e,r){let s,i=!1,n=2,o=!1;r.mask&&(s=r.maskBuffer||as,r.generateMask?r.generateMask(s):(G===ue&&(I===void 0&&(I=Buffer.alloc(ue)),rs(I,0,ue),G=0),s[0]=I[G++],s[1]=I[G++],s[2]=I[G++],s[3]=I[G++]),o=(s[0]|s[1]|s[2]|s[3])===0,n=6);let l;typeof e=="string"?(!r.mask||o)&&r[S]!==void 0?l=r[S]:(e=Buffer.from(e),l=e.length):(l=e.length,i=r.mask&&r.readOnly&&!o);let c=l;l>=65536?(n+=8,c=127):l>125&&(n+=2,c=126);let a=Buffer.allocUnsafe(i?l+n:n);return a[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(a[0]|=64),a[1]=c,c===126?a.writeUInt16BE(l,2):c===127&&(a[2]=a[3]=0,a.writeUIntBE(l,4,6)),r.mask?(a[1]|=128,a[n-4]=s[0],a[n-3]=s[1],a[n-2]=s[2],a[n-1]=s[3],o?[a,e]:i?(At(e,s,a,n,l),[a]):(At(e,s,e,0,l),[a,e])):[a,e]}close(e,r,s,i){let n;if(e===void 0)n=ss;else{if(typeof e!="number"||!os(e))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)n=Buffer.allocUnsafe(2),n.writeUInt16BE(e,0);else{let l=Buffer.byteLength(r);if(l>123)throw new RangeError("The message must not be greater than 123 bytes");n=Buffer.allocUnsafe(2+l),n.writeUInt16BE(e,0),typeof r=="string"?n.write(r,2):n.set(r,2)}}let o={[S]:n.length,fin:!0,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==E?this.enqueue([this.dispatch,n,!1,o,i]):this.sendFrame(t.frame(n,o),i)}ping(e,r,s){let i,n;if(typeof e=="string"?(i=Buffer.byteLength(e),n=!1):V(e)?(i=e.size,n=!1):(e=F(e),i=e.length,n=F.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[S]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:n,rsv1:!1};V(e)?this._state!==E?this.enqueue([this.getBlobData,e,!1,o,s]):this.getBlobData(e,!1,o,s):this._state!==E?this.enqueue([this.dispatch,e,!1,o,s]):this.sendFrame(t.frame(e,o),s)}pong(e,r,s){let i,n;if(typeof e=="string"?(i=Buffer.byteLength(e),n=!1):V(e)?(i=e.size,n=!1):(e=F(e),i=e.length,n=F.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[S]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:n,rsv1:!1};V(e)?this._state!==E?this.enqueue([this.getBlobData,e,!1,o,s]):this.getBlobData(e,!1,o,s):this._state!==E?this.enqueue([this.dispatch,e,!1,o,s]):this.sendFrame(t.frame(e,o),s)}send(e,r,s){let i=this._extensions[Dt.extensionName],n=r.binary?2:1,o=r.compress,l,c;typeof e=="string"?(l=Buffer.byteLength(e),c=!1):V(e)?(l=e.size,c=!1):(e=F(e),l=e.length,c=F.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=l>=i._threshold),this._compress=o):(o=!1,n=0),r.fin&&(this._firstFragment=!0);let a={[S]:l,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:n,readOnly:c,rsv1:o};V(e)?this._state!==E?this.enqueue([this.getBlobData,e,this._compress,a,s]):this.getBlobData(e,this._compress,a,s):this._state!==E?this.enqueue([this.dispatch,e,this._compress,a,s]):this.dispatch(e,this._compress,a,s)}getBlobData(e,r,s,i){this._bufferedBytes+=s[S],this._state=cs,e.arrayBuffer().then(n=>{if(this._socket.destroyed){let l=new Error("The socket was closed while the blob was being read");process.nextTick(Ae,this,l,i);return}this._bufferedBytes-=s[S];let o=F(n);r?this.dispatch(o,r,s,i):(this._state=E,this.sendFrame(t.frame(o,s),i),this.dequeue())}).catch(n=>{process.nextTick(ds,this,n,i)})}dispatch(e,r,s,i){if(!r){this.sendFrame(t.frame(e,s),i);return}let n=this._extensions[Dt.extensionName];this._bufferedBytes+=s[S],this._state=ls,n.compress(e,s.fin,(o,l)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Ae(this,c,i);return}this._bufferedBytes-=s[S],this._state=E,s.readOnly=!1,this.sendFrame(t.frame(l,s),i),this.dequeue()})}dequeue(){for(;this._state===E&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][S],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][S],this._queue.push(e)}sendFrame(e,r){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],r),this._socket.uncork()):this._socket.write(e[0],r)}};Ut.exports=De;function Ae(t,e,r){typeof r=="function"&&r(e);for(let s=0;s<t._queue.length;s++){let i=t._queue[s],n=i[i.length-1];typeof n=="function"&&n(e)}}function ds(t,e,r){Ae(t,e,r),t.onerror(e)}});var zt=y((Ki,Ht)=>{"use strict";var{kForOnEventAttribute:te,kListener:Me}=N(),Mt=Symbol("kCode"),qt=Symbol("kData"),Wt=Symbol("kError"),$t=Symbol("kMessage"),Vt=Symbol("kReason"),j=Symbol("kTarget"),Gt=Symbol("kType"),jt=Symbol("kWasClean"),O=class{constructor(e){this[j]=null,this[Gt]=e}get target(){return this[j]}get type(){return this[Gt]}};Object.defineProperty(O.prototype,"target",{enumerable:!0});Object.defineProperty(O.prototype,"type",{enumerable:!0});var L=class extends O{constructor(e,r={}){super(e),this[Mt]=r.code===void 0?0:r.code,this[Vt]=r.reason===void 0?"":r.reason,this[jt]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[Mt]}get reason(){return this[Vt]}get wasClean(){return this[jt]}};Object.defineProperty(L.prototype,"code",{enumerable:!0});Object.defineProperty(L.prototype,"reason",{enumerable:!0});Object.defineProperty(L.prototype,"wasClean",{enumerable:!0});var H=class extends O{constructor(e,r={}){super(e),this[Wt]=r.error===void 0?null:r.error,this[$t]=r.message===void 0?"":r.message}get error(){return this[Wt]}get message(){return this[$t]}};Object.defineProperty(H.prototype,"error",{enumerable:!0});Object.defineProperty(H.prototype,"message",{enumerable:!0});var re=class extends O{constructor(e,r={}){super(e),this[qt]=r.data===void 0?null:r.data}get data(){return this[qt]}};Object.defineProperty(re.prototype,"data",{enumerable:!0});var fs={addEventListener(t,e,r={}){for(let i of this.listeners(t))if(!r[te]&&i[Me]===e&&!i[te])return;let s;if(t==="message")s=function(n,o){let l=new re("message",{data:o?n:n.toString()});l[j]=this,he(e,this,l)};else if(t==="close")s=function(n,o){let l=new L("close",{code:n,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});l[j]=this,he(e,this,l)};else if(t==="error")s=function(n){let o=new H("error",{error:n,message:n.message});o[j]=this,he(e,this,o)};else if(t==="open")s=function(){let n=new O("open");n[j]=this,he(e,this,n)};else return;s[te]=!!r[te],s[Me]=e,r.once?this.once(t,s):this.on(t,s)},removeEventListener(t,e){for(let r of this.listeners(t))if(r[Me]===e&&!r[te]){this.removeListener(t,r);break}}};Ht.exports={CloseEvent:L,ErrorEvent:H,Event:O,EventTarget:fs,MessageEvent:re};function he(t,e,r){typeof t=="object"&&t.handleEvent?t.handleEvent.call(t,r):t.call(e,r)}});var qe=y((Xi,Yt)=>{"use strict";var{tokenChars:se}=$();function T(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}function us(t){let e=Object.create(null),r=Object.create(null),s=!1,i=!1,n=!1,o,l,c=-1,a=-1,d=-1,f=0;for(;f<t.length;f++)if(a=t.charCodeAt(f),o===void 0)if(d===-1&&se[a]===1)c===-1&&(c=f);else if(f!==0&&(a===32||a===9))d===-1&&c!==-1&&(d=f);else if(a===59||a===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);d===-1&&(d=f);let _=t.slice(c,d);a===44?(T(e,_,r),r=Object.create(null)):o=_,c=d=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(l===void 0)if(d===-1&&se[a]===1)c===-1&&(c=f);else if(a===32||a===9)d===-1&&c!==-1&&(d=f);else if(a===59||a===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);d===-1&&(d=f),T(r,t.slice(c,d),!0),a===44&&(T(e,o,r),r=Object.create(null),o=void 0),c=d=-1}else if(a===61&&c!==-1&&d===-1)l=t.slice(c,f),c=d=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(se[a]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:s||(s=!0),i=!1}else if(n)if(se[a]===1)c===-1&&(c=f);else if(a===34&&c!==-1)n=!1,d=f;else if(a===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===34&&t.charCodeAt(f-1)===61)n=!0;else if(d===-1&&se[a]===1)c===-1&&(c=f);else if(c!==-1&&(a===32||a===9))d===-1&&(d=f);else if(a===59||a===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);d===-1&&(d=f);let _=t.slice(c,d);s&&(_=_.replace(/\\/g,""),s=!1),T(r,l,_),a===44&&(T(e,o,r),r=Object.create(null),o=void 0),l=void 0,c=d=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||n||a===32||a===9)throw new SyntaxError("Unexpected end of input");d===-1&&(d=f);let h=t.slice(c,d);return o===void 0?T(e,h,r):(l===void 0?T(r,h,!0):s?T(r,l,h.replace(/\\/g,"")):T(r,l,h),T(e,o,r)),e}function hs(t){return Object.keys(t).map(e=>{let r=t[e];return Array.isArray(r)||(r=[r]),r.map(s=>[e].concat(Object.keys(s).map(i=>{let n=s[i];return Array.isArray(n)||(n=[n]),n.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Yt.exports={format:hs,parse:us}});var ge=y((Qi,or)=>{"use strict";var ps=require("events"),ms=require("https"),_s=require("http"),Zt=require("net"),gs=require("tls"),{randomBytes:xs,createHash:ys}=require("crypto"),{Duplex:Zi,Readable:Ji}=require("stream"),{URL:We}=require("url"),R=ee(),vs=Le(),bs=Ue(),{isBlob:Ss}=$(),{BINARY_TYPES:Kt,CLOSE_TIMEOUT:Es,EMPTY_BUFFER:pe,GUID:ws,kForOnEventAttribute:$e,kListener:Ts,kStatusCode:Ns,kWebSocket:g,NOOP:Jt}=N(),{EventTarget:{addEventListener:ks,removeEventListener:Os}}=zt(),{format:Cs,parse:Bs}=qe(),{toBuffer:Ps}=J(),Qt=Symbol("kAborted"),Ve=[8,13],C=["CONNECTING","OPEN","CLOSING","CLOSED"],Rs=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,p=class t extends ps{constructor(e,r,s){super(),this._binaryType=Kt[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=pe,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=t.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(s=r,r=[]):r=[r]),er(this,e,r,s)):(this._autoPong=s.autoPong,this._closeTimeout=s.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Kt.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,r,s){let i=new vs({allowSynchronousEvents:s.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation}),n=new bs(e,this._extensions,s.generateMask);this._receiver=i,this._sender=n,this._socket=e,i[g]=this,n[g]=this,e[g]=this,i.on("conclude",Ls),i.on("drain",Ds),i.on("error",As),i.on("message",Us),i.on("ping",Ms),i.on("pong",qs),n.onerror=Ws,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),r.length>0&&e.unshift(r),e.on("close",sr),e.on("data",_e),e.on("end",ir),e.on("error",nr),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[R.extensionName]&&this._extensions[R.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,r){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){v(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,r,!this._isServer,s=>{s||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),rr(this)}}pause(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,r,s){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(s=e,e=r=void 0):typeof r=="function"&&(s=r,r=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Ge(this,e,s);return}r===void 0&&(r=!this._isServer),this._sender.ping(e||pe,r,s)}pong(e,r,s){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(s=e,e=r=void 0):typeof r=="function"&&(s=r,r=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Ge(this,e,s);return}r===void 0&&(r=!this._isServer),this._sender.pong(e||pe,r,s)}resume(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,r,s){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(s=r,r={}),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Ge(this,e,s);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[R.extensionName]||(i.compress=!1),this._sender.send(e||pe,i,s)}terminate(){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){v(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=t.CLOSING,this._socket.destroy())}}};Object.defineProperty(p,"CONNECTING",{enumerable:!0,value:C.indexOf("CONNECTING")});Object.defineProperty(p.prototype,"CONNECTING",{enumerable:!0,value:C.indexOf("CONNECTING")});Object.defineProperty(p,"OPEN",{enumerable:!0,value:C.indexOf("OPEN")});Object.defineProperty(p.prototype,"OPEN",{enumerable:!0,value:C.indexOf("OPEN")});Object.defineProperty(p,"CLOSING",{enumerable:!0,value:C.indexOf("CLOSING")});Object.defineProperty(p.prototype,"CLOSING",{enumerable:!0,value:C.indexOf("CLOSING")});Object.defineProperty(p,"CLOSED",{enumerable:!0,value:C.indexOf("CLOSED")});Object.defineProperty(p.prototype,"CLOSED",{enumerable:!0,value:C.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(t=>{Object.defineProperty(p.prototype,t,{enumerable:!0})});["open","error","close","message"].forEach(t=>{Object.defineProperty(p.prototype,`on${t}`,{enumerable:!0,get(){for(let e of this.listeners(t))if(e[$e])return e[Ts];return null},set(e){for(let r of this.listeners(t))if(r[$e]){this.removeListener(t,r);break}typeof e=="function"&&this.addEventListener(t,e,{[$e]:!0})}})});p.prototype.addEventListener=ks;p.prototype.removeEventListener=Os;or.exports=p;function er(t,e,r,s){let i={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:Es,protocolVersion:Ve[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...s,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,!Ve.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Ve.join(", ")})`);let n;if(e instanceof We)n=e;else try{n=new We(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:",l=n.protocol==="ws+unix:",c;if(n.protocol!=="ws:"&&!o&&!l?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:l&&!n.pathname?c="The URL's pathname is empty":n.hash&&(c="The URL contains a fragment identifier"),c){let u=new SyntaxError(c);if(t._redirects===0)throw u;me(t,u);return}let a=o?443:80,d=xs(16).toString("base64"),f=o?ms.request:_s.request,h=new Set,_;if(i.createConnection=i.createConnection||(o?Is:Fs),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":d,Connection:"Upgrade",Upgrade:"websocket"},i.path=n.pathname+n.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(_=new R(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=Cs({[R.extensionName]:_.offer()})),r.length){for(let u of r){if(typeof u!="string"||!Rs.test(u)||h.has(u))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(u)}i.headers["Sec-WebSocket-Protocol"]=r.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}`),l){let u=i.path.split(":");i.socketPath=u[0],i.path=u[1]}let m;if(i.followRedirects){if(t._redirects===0){t._originalIpc=l,t._originalSecure=o,t._originalHostOrSocketPath=l?i.socketPath:n.host;let u=s&&s.headers;if(s={...s,headers:{}},u)for(let[x,U]of Object.entries(u))s.headers[x.toLowerCase()]=U}else if(t.listenerCount("redirect")===0){let u=l?t._originalIpc?i.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1: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&&!s.headers.authorization&&(s.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),m=t._req=f(i),t._redirects&&t.emit("redirect",t.url,m)}else m=t._req=f(i);i.timeout&&m.on("timeout",()=>{v(t,m,"Opening handshake has timed out")}),m.on("error",u=>{m===null||m[Qt]||(m=t._req=null,me(t,u))}),m.on("response",u=>{let x=u.headers.location,U=u.statusCode;if(x&&i.followRedirects&&U>=300&&U<400){if(++t._redirects>i.maxRedirects){v(t,m,"Maximum redirects exceeded");return}m.abort();let K;try{K=new We(x,e)}catch{let M=new SyntaxError(`Invalid URL: ${x}`);me(t,M);return}er(t,K,r,s)}else t.emit("unexpected-response",m,u)||v(t,m,`Unexpected server response: ${u.statusCode}`)}),m.on("upgrade",(u,x,U)=>{if(t.emit("upgrade",u),t.readyState!==p.CONNECTING)return;m=t._req=null;let K=u.headers.upgrade;if(K===void 0||K.toLowerCase()!=="websocket"){v(t,x,"Invalid Upgrade header");return}let Ye=ys("sha1").update(d+ws).digest("base64");if(u.headers["sec-websocket-accept"]!==Ye){v(t,x,"Invalid Sec-WebSocket-Accept header");return}let M=u.headers["sec-websocket-protocol"],X;if(M!==void 0?h.size?h.has(M)||(X="Server sent an invalid subprotocol"):X="Server sent a subprotocol but none was requested":h.size&&(X="Server sent no subprotocol"),X){v(t,x,X);return}M&&(t._protocol=M);let Ke=u.headers["sec-websocket-extensions"];if(Ke!==void 0){if(!_){v(t,x,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let ye;try{ye=Bs(Ke)}catch{v(t,x,"Invalid Sec-WebSocket-Extensions header");return}let Xe=Object.keys(ye);if(Xe.length!==1||Xe[0]!==R.extensionName){v(t,x,"Server indicated an extension that was not requested");return}try{_.accept(ye[R.extensionName])}catch{v(t,x,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[R.extensionName]=_}t.setSocket(x,U,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(m,t):m.end()}function me(t,e){t._readyState=p.CLOSING,t._errorEmitted=!0,t.emit("error",e),t.emitClose()}function Fs(t){return t.path=t.socketPath,Zt.connect(t)}function Is(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=Zt.isIP(t.host)?"":t.host),gs.connect(t)}function v(t,e,r){t._readyState=p.CLOSING;let s=new Error(r);Error.captureStackTrace(s,v),e.setHeader?(e[Qt]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(me,t,s)):(e.destroy(s),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function Ge(t,e,r){if(e){let s=Ss(e)?e.size:Ps(e).length;t._socket?t._sender._bufferedBytes+=s:t._bufferedAmount+=s}if(r){let s=new Error(`WebSocket is not open: readyState ${t.readyState} (${C[t.readyState]})`);process.nextTick(r,s)}}function Ls(t,e){let r=this[g];r._closeFrameReceived=!0,r._closeMessage=e,r._closeCode=t,r._socket[g]!==void 0&&(r._socket.removeListener("data",_e),process.nextTick(tr,r._socket),t===1005?r.close():r.close(t,e))}function Ds(){let t=this[g];t.isPaused||t._socket.resume()}function As(t){let e=this[g];e._socket[g]!==void 0&&(e._socket.removeListener("data",_e),process.nextTick(tr,e._socket),e.close(t[Ns])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t))}function Xt(){this[g].emitClose()}function Us(t,e){this[g].emit("message",t,e)}function Ms(t){let e=this[g];e._autoPong&&e.pong(t,!this._isServer,Jt),e.emit("ping",t)}function qs(t){this[g].emit("pong",t)}function tr(t){t.resume()}function Ws(t){let e=this[g];e.readyState!==p.CLOSED&&(e.readyState===p.OPEN&&(e._readyState=p.CLOSING,rr(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t)))}function rr(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),t._closeTimeout)}function sr(){let t=this[g];if(this.removeListener("close",sr),this.removeListener("data",_e),this.removeListener("end",ir),t._readyState=p.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[g]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",Xt),t._receiver.on("finish",Xt))}function _e(t){this[g]._receiver.write(t)||this.pause()}function ir(){let t=this[g];t._readyState=p.CLOSING,t._receiver.end(),this.end()}function nr(){let t=this[g];this.removeListener("error",nr),this.on("error",Jt),t&&(t._readyState=p.CLOSING,this.destroy())}});var dr=y((tn,cr)=>{"use strict";var en=ge(),{Duplex:$s}=require("stream");function ar(t){t.emit("close")}function Vs(){!this.destroyed&&this._writableState.finished&&this.destroy()}function lr(t){this.removeListener("error",lr),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function Gs(t,e){let r=!0,s=new $s({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return t.on("message",function(n,o){let l=!o&&s._readableState.objectMode?n.toString():n;s.push(l)||t.pause()}),t.once("error",function(n){s.destroyed||(r=!1,s.destroy(n))}),t.once("close",function(){s.destroyed||s.push(null)}),s._destroy=function(i,n){if(t.readyState===t.CLOSED){n(i),process.nextTick(ar,s);return}let o=!1;t.once("error",function(c){o=!0,n(c)}),t.once("close",function(){o||n(i),process.nextTick(ar,s)}),r&&t.terminate()},s._final=function(i){if(t.readyState===t.CONNECTING){t.once("open",function(){s._final(i)});return}t._socket!==null&&(t._socket._writableState.finished?(i(),s._readableState.endEmitted&&s.destroy()):(t._socket.once("finish",function(){i()}),t.close()))},s._read=function(){t.isPaused&&t.resume()},s._write=function(i,n,o){if(t.readyState===t.CONNECTING){t.once("open",function(){s._write(i,n,o)});return}t.send(i,o)},s.on("end",Vs),s.on("error",lr),s}cr.exports=Gs});var ur=y((rn,fr)=>{"use strict";var{tokenChars:js}=$();function Hs(t){let e=new Set,r=-1,s=-1,i=0;for(i;i<t.length;i++){let o=t.charCodeAt(i);if(s===-1&&js[o]===1)r===-1&&(r=i);else if(i!==0&&(o===32||o===9))s===-1&&r!==-1&&(s=i);else if(o===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${i}`);s===-1&&(s=i);let l=t.slice(r,s);if(e.has(l))throw new SyntaxError(`The "${l}" subprotocol is duplicated`);e.add(l),r=s=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(r===-1||s!==-1)throw new SyntaxError("Unexpected end of input");let n=t.slice(r,i);if(e.has(n))throw new SyntaxError(`The "${n}" subprotocol is duplicated`);return e.add(n),e}fr.exports={parse:Hs}});var yr=y((nn,xr)=>{"use strict";var zs=require("events"),xe=require("http"),{Duplex:sn}=require("stream"),{createHash:Ys}=require("crypto"),hr=qe(),D=ee(),Ks=ur(),Xs=ge(),{CLOSE_TIMEOUT:Zs,GUID:Js,kWebSocket:Qs}=N(),ei=/^[+/0-9A-Za-z]{22}==$/,pr=0,mr=1,gr=2,je=class extends zs{constructor(e,r){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Zs,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Xs,...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((s,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,r)):e.server&&(this._server=e.server),this._server){let s=this.emit.bind(this,"connection");this._removeListeners=ti(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,n,o)=>{this.handleUpgrade(i,n,o,s)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=pr}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===gr){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!==mr)if(this._state=mr,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(ie,this):process.nextTick(ie,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{ie(this)})}}shouldHandle(e){if(this.options.path){let r=e.url.indexOf("?");if((r!==-1?e.url.slice(0,r):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,r,s,i){r.on("error",_r);let n=e.headers["sec-websocket-key"],o=e.headers.upgrade,l=+e.headers["sec-websocket-version"];if(e.method!=="GET"){A(this,e,r,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){A(this,e,r,400,"Invalid Upgrade header");return}if(n===void 0||!ei.test(n)){A(this,e,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(l!==13&&l!==8){A(this,e,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){ne(r,400);return}let c=e.headers["sec-websocket-protocol"],a=new Set;if(c!==void 0)try{a=Ks.parse(c)}catch{A(this,e,r,400,"Invalid Sec-WebSocket-Protocol header");return}let d=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&d!==void 0){let h=new D(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let _=hr.parse(d);_[D.extensionName]&&(h.accept(_[D.extensionName]),f[D.extensionName]=h)}catch{A(this,e,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let h={origin:e.headers[`${l===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(h,(_,m,u,x)=>{if(!_)return ne(r,m||401,u,x);this.completeUpgrade(f,n,a,e,r,s,i)});return}if(!this.options.verifyClient(h))return ne(r,401)}this.completeUpgrade(f,n,a,e,r,s,i)}completeUpgrade(e,r,s,i,n,o,l){if(!n.readable||!n.writable)return n.destroy();if(n[Qs])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>pr)return ne(n,503);let a=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Ys("sha1").update(r+Js).digest("base64")}`],d=new this.options.WebSocket(null,void 0,this.options);if(s.size){let f=this.options.handleProtocols?this.options.handleProtocols(s,i):s.values().next().value;f&&(a.push(`Sec-WebSocket-Protocol: ${f}`),d._protocol=f)}if(e[D.extensionName]){let f=e[D.extensionName].params,h=hr.format({[D.extensionName]:[f]});a.push(`Sec-WebSocket-Extensions: ${h}`),d._extensions=e}this.emit("headers",a,i),n.write(a.concat(`\r
|
|
2
|
+
"use strict";var Cr=Object.create;var Ze=Object.defineProperty;var Br=Object.getOwnPropertyDescriptor;var Pr=Object.getOwnPropertyNames;var Rr=Object.getPrototypeOf,Ir=Object.prototype.hasOwnProperty;var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Lr=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Pr(e))!Ir.call(t,i)&&i!==r&&Ze(t,i,{get:()=>e[i],enumerable:!(s=Br(e,i))||s.enumerable});return t};var w=(t,e,r)=>(r=t!=null?Cr(Rr(t)):{},Lr(e||!t||!t.__esModule?Ze(r,"default",{value:t,enumerable:!0}):r,t));var k=y((ji,xt)=>{"use strict";var _t=["nodebuffer","arraybuffer","fragments"],gt=typeof Blob<"u";gt&&_t.push("blob");xt.exports={BINARY_TYPES:_t,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:gt,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var J=y((Gi,oe)=>{"use strict";var{EMPTY_BUFFER:Mr}=k(),Te=Buffer[Symbol.species];function Ur(t,e){if(t.length===0)return Mr;if(t.length===1)return t[0];let r=Buffer.allocUnsafe(e),s=0;for(let i=0;i<t.length;i++){let n=t[i];r.set(n,s),s+=n.length}return s<e?new Te(r.buffer,r.byteOffset,s):r}function yt(t,e,r,s,i){for(let n=0;n<i;n++)r[s+n]=t[n]^e[n&3]}function vt(t,e){for(let r=0;r<t.length;r++)t[r]^=e[r&3]}function qr(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.length)}function Ne(t){if(Ne.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=new Te(t):ArrayBuffer.isView(t)?e=new Te(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),Ne.readOnly=!1),e}oe.exports={concat:Ur,mask:yt,toArrayBuffer:qr,toBuffer:Ne,unmask:vt};if(!process.env.WS_NO_BUFFER_UTIL)try{let t=require("bufferutil");oe.exports.mask=function(e,r,s,i,n){n<48?yt(e,r,s,i,n):t.mask(e,r,s,i,n)},oe.exports.unmask=function(e,r){e.length<32?vt(e,r):t.unmask(e,r)}}catch{}});var Et=y((Vi,St)=>{"use strict";var bt=Symbol("kDone"),ke=Symbol("kRun"),Oe=class{constructor(e){this[bt]=()=>{this.pending--,this[ke]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[ke]()}[ke](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[bt])}}};St.exports=Oe});var ee=y((Hi,kt)=>{"use strict";var Q=require("zlib"),wt=J(),Wr=Et(),{kStatusCode:Tt}=k(),$r=Buffer[Symbol.species],jr=Buffer.from([0,0,255,255]),le=Symbol("permessage-deflate"),O=Symbol("total-length"),$=Symbol("callback"),R=Symbol("buffers"),j=Symbol("error"),ae,Ce=class{constructor(e,r,s){if(this._maxPayload=s|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!ae){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;ae=new Wr(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),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=!0),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 r=this._options,s=e.find(i=>!(r.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>i.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!s)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(s.server_no_context_takeover=!0),r.clientNoContextTakeover&&(s.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(s.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?s.client_max_window_bits=r.clientMaxWindowBits:(s.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete s.client_max_window_bits,s}acceptAsClient(e){let r=e[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(e){return e.forEach(r=>{Object.keys(r).forEach(s=>{let i=r[s];if(i.length>1)throw new Error(`Parameter "${s}" must have only a single value`);if(i=i[0],s==="client_max_window_bits"){if(i!==!0){let n=+i;if(!Number.isInteger(n)||n<8||n>15)throw new TypeError(`Invalid value for parameter "${s}": ${i}`);i=n}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${s}": ${i}`)}else if(s==="server_max_window_bits"){let n=+i;if(!Number.isInteger(n)||n<8||n>15)throw new TypeError(`Invalid value for parameter "${s}": ${i}`);i=n}else if(s==="client_no_context_takeover"||s==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${s}": ${i}`)}else throw new Error(`Unknown parameter "${s}"`);r[s]=i})}),e}decompress(e,r,s){ae.add(i=>{this._decompress(e,r,(n,o)=>{i(),s(n,o)})})}compress(e,r,s){ae.add(i=>{this._compress(e,r,(n,o)=>{i(),s(n,o)})})}_decompress(e,r,s){let i=this._isServer?"client":"server";if(!this._inflate){let n=`${i}_max_window_bits`,o=typeof this.params[n]!="number"?Q.Z_DEFAULT_WINDOWBITS:this.params[n];this._inflate=Q.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[le]=this,this._inflate[O]=0,this._inflate[R]=[],this._inflate.on("error",Vr),this._inflate.on("data",Nt)}this._inflate[$]=s,this._inflate.write(e),r&&this._inflate.write(jr),this._inflate.flush(()=>{let n=this._inflate[j];if(n){this._inflate.close(),this._inflate=null,s(n);return}let o=wt.concat(this._inflate[R],this._inflate[O]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[O]=0,this._inflate[R]=[],r&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),s(null,o)})}_compress(e,r,s){let i=this._isServer?"server":"client";if(!this._deflate){let n=`${i}_max_window_bits`,o=typeof this.params[n]!="number"?Q.Z_DEFAULT_WINDOWBITS:this.params[n];this._deflate=Q.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[O]=0,this._deflate[R]=[],this._deflate.on("data",Gr)}this._deflate[$]=s,this._deflate.write(e),this._deflate.flush(Q.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let n=wt.concat(this._deflate[R],this._deflate[O]);r&&(n=new $r(n.buffer,n.byteOffset,n.length-4)),this._deflate[$]=null,this._deflate[O]=0,this._deflate[R]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),s(null,n)})}};kt.exports=Ce;function Gr(t){this[R].push(t),this[O]+=t.length}function Nt(t){if(this[O]+=t.length,this[le]._maxPayload<1||this[O]<=this[le]._maxPayload){this[R].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",Nt),this.reset()}function Vr(t){if(this[le]._inflate=null,this[j]){this[$](this[j]);return}t[Tt]=1007,this[$](t)}});var G=y((zi,ce)=>{"use strict";var{isUtf8:Ot}=require("buffer"),{hasBlob:Hr}=k(),zr=[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 Yr(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function Be(t){let e=t.length,r=0;for(;r<e;)if((t[r]&128)===0)r++;else if((t[r]&224)===192){if(r+1===e||(t[r+1]&192)!==128||(t[r]&254)===192)return!1;r+=2}else if((t[r]&240)===224){if(r+2>=e||(t[r+1]&192)!==128||(t[r+2]&192)!==128||t[r]===224&&(t[r+1]&224)===128||t[r]===237&&(t[r+1]&224)===160)return!1;r+=3}else if((t[r]&248)===240){if(r+3>=e||(t[r+1]&192)!==128||(t[r+2]&192)!==128||(t[r+3]&192)!==128||t[r]===240&&(t[r+1]&240)===128||t[r]===244&&t[r+1]>143||t[r]>244)return!1;r+=4}else return!1;return!0}function Xr(t){return Hr&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]==="Blob"||t[Symbol.toStringTag]==="File")}ce.exports={isBlob:Xr,isValidStatusCode:Yr,isValidUTF8:Be,tokenChars:zr};if(Ot)ce.exports.isValidUTF8=function(t){return t.length<24?Be(t):Ot(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=require("utf-8-validate");ce.exports.isValidUTF8=function(e){return e.length<32?Be(e):t(e)}}catch{}});var De=y((Yi,Dt)=>{"use strict";var{Writable:Kr}=require("stream"),Ct=ee(),{BINARY_TYPES:Zr,EMPTY_BUFFER:Bt,kStatusCode:Jr,kWebSocket:Qr}=k(),{concat:Pe,toArrayBuffer:es,unmask:ts}=J(),{isValidStatusCode:rs,isValidUTF8:Pt}=G(),de=Buffer[Symbol.species],b=0,Rt=1,It=2,Lt=3,Re=4,Ie=5,fe=6,Le=class extends Kr{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||Zr[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[Qr]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=b}_write(e,r,s){if(this._opcode===8&&this._state==b)return s();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(s)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let s=this._buffers[0];return this._buffers[0]=new de(s.buffer,s.byteOffset+e,s.length-e),new de(s.buffer,s.byteOffset,e)}let r=Buffer.allocUnsafe(e);do{let s=this._buffers[0],i=r.length-e;e>=s.length?r.set(this._buffers.shift(),i):(r.set(new Uint8Array(s.buffer,s.byteOffset,e),i),this._buffers[0]=new de(s.buffer,s.byteOffset+e,s.length-e)),e-=s.length}while(e>0);return r}startLoop(e){this._loop=!0;do switch(this._state){case b:this.getInfo(e);break;case Rt:this.getPayloadLength16(e);break;case It:this.getPayloadLength64(e);break;case Lt:this.getMask();break;case Re:this.getData(e);break;case Ie:case fe:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let s=(r[0]&64)===64;if(s&&!this._extensions[Ct.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(s){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,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}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=s}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(s){let i=this.createError(RangeError,"RSV1 must be clear",!0,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}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=Rt:this._payloadLength===127?this._state=It:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),s=r.readUInt32BE(0);if(s>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}this._payloadLength=s*Math.pow(2,32)+r.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 r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(r);return}this._masked?this._state=Lt:this._state=Re}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Re}getData(e){let r=Bt;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&ts(r,this._mask)}if(this._opcode>7){this.controlMessage(r,e);return}if(this._compressed){this._state=Ie,this.decompress(r,e);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(e)}decompress(e,r){this._extensions[Ct.extensionName].decompress(e,this._fin,(i,n)=>{if(i)return r(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",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(o);return}this._fragments.push(n)}this.dataMessage(r),this._state===b&&this.startLoop(r)})}dataMessage(e){if(!this._fin){this._state=b;return}let r=this._messageLength,s=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=Pe(s,r):this._binaryType==="arraybuffer"?i=es(Pe(s,r)):this._binaryType==="blob"?i=new Blob(s):i=s,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=b):(this._state=fe,setImmediate(()=>{this.emit("message",i,!0),this._state=b,this.startLoop(e)}))}else{let i=Pe(s,r);if(!this._skipUTF8Validation&&!Pt(i)){let n=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(n);return}this._state===Ie||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=b):(this._state=fe,setImmediate(()=>{this.emit("message",i,!1),this._state=b,this.startLoop(e)}))}}controlMessage(e,r){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Bt),this.end();else{let s=e.readUInt16BE(0);if(!rs(s)){let n=this.createError(RangeError,`invalid status code ${s}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(n);return}let i=new de(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Pt(i)){let n=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(n);return}this._loop=!1,this.emit("conclude",s,i),this.end()}this._state=b;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=b):(this._state=fe,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=b,this.startLoop(r)}))}createError(e,r,s,i,n){this._loop=!1,this._errored=!0;let o=new e(s?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(o,this.createError),o.code=n,o[Jr]=i,o}};Dt.exports=Le});var Me=y((Ki,Mt)=>{"use strict";var{Duplex:Xi}=require("stream"),{randomFillSync:ss}=require("crypto"),Ft=ee(),{EMPTY_BUFFER:is,kWebSocket:ns,NOOP:os}=k(),{isBlob:V,isValidStatusCode:as}=G(),{mask:At,toBuffer:L}=J(),S=Symbol("kByteLength"),ls=Buffer.alloc(4),ue=8*1024,D,H=ue,E=0,cs=1,ds=2,Fe=class t{constructor(e,r,s){this._extensions=r||{},s&&(this._generateMask=s,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=E,this.onerror=os,this[ns]=void 0}static frame(e,r){let s,i=!1,n=2,o=!1;r.mask&&(s=r.maskBuffer||ls,r.generateMask?r.generateMask(s):(H===ue&&(D===void 0&&(D=Buffer.alloc(ue)),ss(D,0,ue),H=0),s[0]=D[H++],s[1]=D[H++],s[2]=D[H++],s[3]=D[H++]),o=(s[0]|s[1]|s[2]|s[3])===0,n=6);let l;typeof e=="string"?(!r.mask||o)&&r[S]!==void 0?l=r[S]:(e=Buffer.from(e),l=e.length):(l=e.length,i=r.mask&&r.readOnly&&!o);let c=l;l>=65536?(n+=8,c=127):l>125&&(n+=2,c=126);let a=Buffer.allocUnsafe(i?l+n:n);return a[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(a[0]|=64),a[1]=c,c===126?a.writeUInt16BE(l,2):c===127&&(a[2]=a[3]=0,a.writeUIntBE(l,4,6)),r.mask?(a[1]|=128,a[n-4]=s[0],a[n-3]=s[1],a[n-2]=s[2],a[n-1]=s[3],o?[a,e]:i?(At(e,s,a,n,l),[a]):(At(e,s,e,0,l),[a,e])):[a,e]}close(e,r,s,i){let n;if(e===void 0)n=is;else{if(typeof e!="number"||!as(e))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)n=Buffer.allocUnsafe(2),n.writeUInt16BE(e,0);else{let l=Buffer.byteLength(r);if(l>123)throw new RangeError("The message must not be greater than 123 bytes");n=Buffer.allocUnsafe(2+l),n.writeUInt16BE(e,0),typeof r=="string"?n.write(r,2):n.set(r,2)}}let o={[S]:n.length,fin:!0,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==E?this.enqueue([this.dispatch,n,!1,o,i]):this.sendFrame(t.frame(n,o),i)}ping(e,r,s){let i,n;if(typeof e=="string"?(i=Buffer.byteLength(e),n=!1):V(e)?(i=e.size,n=!1):(e=L(e),i=e.length,n=L.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[S]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:n,rsv1:!1};V(e)?this._state!==E?this.enqueue([this.getBlobData,e,!1,o,s]):this.getBlobData(e,!1,o,s):this._state!==E?this.enqueue([this.dispatch,e,!1,o,s]):this.sendFrame(t.frame(e,o),s)}pong(e,r,s){let i,n;if(typeof e=="string"?(i=Buffer.byteLength(e),n=!1):V(e)?(i=e.size,n=!1):(e=L(e),i=e.length,n=L.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[S]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:n,rsv1:!1};V(e)?this._state!==E?this.enqueue([this.getBlobData,e,!1,o,s]):this.getBlobData(e,!1,o,s):this._state!==E?this.enqueue([this.dispatch,e,!1,o,s]):this.sendFrame(t.frame(e,o),s)}send(e,r,s){let i=this._extensions[Ft.extensionName],n=r.binary?2:1,o=r.compress,l,c;typeof e=="string"?(l=Buffer.byteLength(e),c=!1):V(e)?(l=e.size,c=!1):(e=L(e),l=e.length,c=L.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=l>=i._threshold),this._compress=o):(o=!1,n=0),r.fin&&(this._firstFragment=!0);let a={[S]:l,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:n,readOnly:c,rsv1:o};V(e)?this._state!==E?this.enqueue([this.getBlobData,e,this._compress,a,s]):this.getBlobData(e,this._compress,a,s):this._state!==E?this.enqueue([this.dispatch,e,this._compress,a,s]):this.dispatch(e,this._compress,a,s)}getBlobData(e,r,s,i){this._bufferedBytes+=s[S],this._state=ds,e.arrayBuffer().then(n=>{if(this._socket.destroyed){let l=new Error("The socket was closed while the blob was being read");process.nextTick(Ae,this,l,i);return}this._bufferedBytes-=s[S];let o=L(n);r?this.dispatch(o,r,s,i):(this._state=E,this.sendFrame(t.frame(o,s),i),this.dequeue())}).catch(n=>{process.nextTick(fs,this,n,i)})}dispatch(e,r,s,i){if(!r){this.sendFrame(t.frame(e,s),i);return}let n=this._extensions[Ft.extensionName];this._bufferedBytes+=s[S],this._state=cs,n.compress(e,s.fin,(o,l)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Ae(this,c,i);return}this._bufferedBytes-=s[S],this._state=E,s.readOnly=!1,this.sendFrame(t.frame(l,s),i),this.dequeue()})}dequeue(){for(;this._state===E&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][S],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][S],this._queue.push(e)}sendFrame(e,r){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],r),this._socket.uncork()):this._socket.write(e[0],r)}};Mt.exports=Fe;function Ae(t,e,r){typeof r=="function"&&r(e);for(let s=0;s<t._queue.length;s++){let i=t._queue[s],n=i[i.length-1];typeof n=="function"&&n(e)}}function fs(t,e,r){Ae(t,e,r),t.onerror(e)}});var zt=y((Zi,Ht)=>{"use strict";var{kForOnEventAttribute:te,kListener:Ue}=k(),Ut=Symbol("kCode"),qt=Symbol("kData"),Wt=Symbol("kError"),$t=Symbol("kMessage"),jt=Symbol("kReason"),z=Symbol("kTarget"),Gt=Symbol("kType"),Vt=Symbol("kWasClean"),C=class{constructor(e){this[z]=null,this[Gt]=e}get target(){return this[z]}get type(){return this[Gt]}};Object.defineProperty(C.prototype,"target",{enumerable:!0});Object.defineProperty(C.prototype,"type",{enumerable:!0});var F=class extends C{constructor(e,r={}){super(e),this[Ut]=r.code===void 0?0:r.code,this[jt]=r.reason===void 0?"":r.reason,this[Vt]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[Ut]}get reason(){return this[jt]}get wasClean(){return this[Vt]}};Object.defineProperty(F.prototype,"code",{enumerable:!0});Object.defineProperty(F.prototype,"reason",{enumerable:!0});Object.defineProperty(F.prototype,"wasClean",{enumerable:!0});var Y=class extends C{constructor(e,r={}){super(e),this[Wt]=r.error===void 0?null:r.error,this[$t]=r.message===void 0?"":r.message}get error(){return this[Wt]}get message(){return this[$t]}};Object.defineProperty(Y.prototype,"error",{enumerable:!0});Object.defineProperty(Y.prototype,"message",{enumerable:!0});var re=class extends C{constructor(e,r={}){super(e),this[qt]=r.data===void 0?null:r.data}get data(){return this[qt]}};Object.defineProperty(re.prototype,"data",{enumerable:!0});var us={addEventListener(t,e,r={}){for(let i of this.listeners(t))if(!r[te]&&i[Ue]===e&&!i[te])return;let s;if(t==="message")s=function(n,o){let l=new re("message",{data:o?n:n.toString()});l[z]=this,he(e,this,l)};else if(t==="close")s=function(n,o){let l=new F("close",{code:n,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});l[z]=this,he(e,this,l)};else if(t==="error")s=function(n){let o=new Y("error",{error:n,message:n.message});o[z]=this,he(e,this,o)};else if(t==="open")s=function(){let n=new C("open");n[z]=this,he(e,this,n)};else return;s[te]=!!r[te],s[Ue]=e,r.once?this.once(t,s):this.on(t,s)},removeEventListener(t,e){for(let r of this.listeners(t))if(r[Ue]===e&&!r[te]){this.removeListener(t,r);break}}};Ht.exports={CloseEvent:F,ErrorEvent:Y,Event:C,EventTarget:us,MessageEvent:re};function he(t,e,r){typeof t=="object"&&t.handleEvent?t.handleEvent.call(t,r):t.call(e,r)}});var qe=y((Ji,Yt)=>{"use strict";var{tokenChars:se}=G();function T(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}function hs(t){let e=Object.create(null),r=Object.create(null),s=!1,i=!1,n=!1,o,l,c=-1,a=-1,d=-1,f=0;for(;f<t.length;f++)if(a=t.charCodeAt(f),o===void 0)if(d===-1&&se[a]===1)c===-1&&(c=f);else if(f!==0&&(a===32||a===9))d===-1&&c!==-1&&(d=f);else if(a===59||a===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);d===-1&&(d=f);let p=t.slice(c,d);a===44?(T(e,p,r),r=Object.create(null)):o=p,c=d=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(l===void 0)if(d===-1&&se[a]===1)c===-1&&(c=f);else if(a===32||a===9)d===-1&&c!==-1&&(d=f);else if(a===59||a===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);d===-1&&(d=f),T(r,t.slice(c,d),!0),a===44&&(T(e,o,r),r=Object.create(null),o=void 0),c=d=-1}else if(a===61&&c!==-1&&d===-1)l=t.slice(c,f),c=d=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(se[a]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:s||(s=!0),i=!1}else if(n)if(se[a]===1)c===-1&&(c=f);else if(a===34&&c!==-1)n=!1,d=f;else if(a===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===34&&t.charCodeAt(f-1)===61)n=!0;else if(d===-1&&se[a]===1)c===-1&&(c=f);else if(c!==-1&&(a===32||a===9))d===-1&&(d=f);else if(a===59||a===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);d===-1&&(d=f);let p=t.slice(c,d);s&&(p=p.replace(/\\/g,""),s=!1),T(r,l,p),a===44&&(T(e,o,r),r=Object.create(null),o=void 0),l=void 0,c=d=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||n||a===32||a===9)throw new SyntaxError("Unexpected end of input");d===-1&&(d=f);let h=t.slice(c,d);return o===void 0?T(e,h,r):(l===void 0?T(r,h,!0):s?T(r,l,h.replace(/\\/g,"")):T(r,l,h),T(e,o,r)),e}function ps(t){return Object.keys(t).map(e=>{let r=t[e];return Array.isArray(r)||(r=[r]),r.map(s=>[e].concat(Object.keys(s).map(i=>{let n=s[i];return Array.isArray(n)||(n=[n]),n.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Yt.exports={format:ps,parse:hs}});var ge=y((tn,or)=>{"use strict";var ms=require("events"),_s=require("https"),gs=require("http"),Zt=require("net"),xs=require("tls"),{randomBytes:ys,createHash:vs}=require("crypto"),{Duplex:Qi,Readable:en}=require("stream"),{URL:We}=require("url"),I=ee(),bs=De(),Ss=Me(),{isBlob:Es}=G(),{BINARY_TYPES:Xt,CLOSE_TIMEOUT:ws,EMPTY_BUFFER:pe,GUID:Ts,kForOnEventAttribute:$e,kListener:Ns,kStatusCode:ks,kWebSocket:g,NOOP:Jt}=k(),{EventTarget:{addEventListener:Os,removeEventListener:Cs}}=zt(),{format:Bs,parse:Ps}=qe(),{toBuffer:Rs}=J(),Qt=Symbol("kAborted"),je=[8,13],B=["CONNECTING","OPEN","CLOSING","CLOSED"],Is=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,m=class t extends ms{constructor(e,r,s){super(),this._binaryType=Xt[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=pe,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=t.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(s=r,r=[]):r=[r]),er(this,e,r,s)):(this._autoPong=s.autoPong,this._closeTimeout=s.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Xt.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,r,s){let i=new bs({allowSynchronousEvents:s.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation}),n=new Ss(e,this._extensions,s.generateMask);this._receiver=i,this._sender=n,this._socket=e,i[g]=this,n[g]=this,e[g]=this,i.on("conclude",Fs),i.on("drain",As),i.on("error",Ms),i.on("message",Us),i.on("ping",qs),i.on("pong",Ws),n.onerror=$s,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),r.length>0&&e.unshift(r),e.on("close",sr),e.on("data",_e),e.on("end",ir),e.on("error",nr),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,r){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){v(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,r,!this._isServer,s=>{s||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),rr(this)}}pause(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,r,s){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(s=e,e=r=void 0):typeof r=="function"&&(s=r,r=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Ge(this,e,s);return}r===void 0&&(r=!this._isServer),this._sender.ping(e||pe,r,s)}pong(e,r,s){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(s=e,e=r=void 0):typeof r=="function"&&(s=r,r=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Ge(this,e,s);return}r===void 0&&(r=!this._isServer),this._sender.pong(e||pe,r,s)}resume(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,r,s){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(s=r,r={}),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Ge(this,e,s);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[I.extensionName]||(i.compress=!1),this._sender.send(e||pe,i,s)}terminate(){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){v(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=t.CLOSING,this._socket.destroy())}}};Object.defineProperty(m,"CONNECTING",{enumerable:!0,value:B.indexOf("CONNECTING")});Object.defineProperty(m.prototype,"CONNECTING",{enumerable:!0,value:B.indexOf("CONNECTING")});Object.defineProperty(m,"OPEN",{enumerable:!0,value:B.indexOf("OPEN")});Object.defineProperty(m.prototype,"OPEN",{enumerable:!0,value:B.indexOf("OPEN")});Object.defineProperty(m,"CLOSING",{enumerable:!0,value:B.indexOf("CLOSING")});Object.defineProperty(m.prototype,"CLOSING",{enumerable:!0,value:B.indexOf("CLOSING")});Object.defineProperty(m,"CLOSED",{enumerable:!0,value:B.indexOf("CLOSED")});Object.defineProperty(m.prototype,"CLOSED",{enumerable:!0,value:B.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(t=>{Object.defineProperty(m.prototype,t,{enumerable:!0})});["open","error","close","message"].forEach(t=>{Object.defineProperty(m.prototype,`on${t}`,{enumerable:!0,get(){for(let e of this.listeners(t))if(e[$e])return e[Ns];return null},set(e){for(let r of this.listeners(t))if(r[$e]){this.removeListener(t,r);break}typeof e=="function"&&this.addEventListener(t,e,{[$e]:!0})}})});m.prototype.addEventListener=Os;m.prototype.removeEventListener=Cs;or.exports=m;function er(t,e,r,s){let i={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:ws,protocolVersion:je[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...s,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,!je.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${je.join(", ")})`);let n;if(e instanceof We)n=e;else try{n=new We(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:",l=n.protocol==="ws+unix:",c;if(n.protocol!=="ws:"&&!o&&!l?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:l&&!n.pathname?c="The URL's pathname is empty":n.hash&&(c="The URL contains a fragment identifier"),c){let u=new SyntaxError(c);if(t._redirects===0)throw u;me(t,u);return}let a=o?443:80,d=ys(16).toString("base64"),f=o?_s.request:gs.request,h=new Set,p;if(i.createConnection=i.createConnection||(o?Ds:Ls),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":d,Connection:"Upgrade",Upgrade:"websocket"},i.path=n.pathname+n.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(p=new I(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=Bs({[I.extensionName]:p.offer()})),r.length){for(let u of r){if(typeof u!="string"||!Is.test(u)||h.has(u))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(u)}i.headers["Sec-WebSocket-Protocol"]=r.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}`),l){let u=i.path.split(":");i.socketPath=u[0],i.path=u[1]}let _;if(i.followRedirects){if(t._redirects===0){t._originalIpc=l,t._originalSecure=o,t._originalHostOrSocketPath=l?i.socketPath:n.host;let u=s&&s.headers;if(s={...s,headers:{}},u)for(let[x,q]of Object.entries(u))s.headers[x.toLowerCase()]=q}else if(t.listenerCount("redirect")===0){let u=l?t._originalIpc?i.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1: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&&!s.headers.authorization&&(s.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),_=t._req=f(i),t._redirects&&t.emit("redirect",t.url,_)}else _=t._req=f(i);i.timeout&&_.on("timeout",()=>{v(t,_,"Opening handshake has timed out")}),_.on("error",u=>{_===null||_[Qt]||(_=t._req=null,me(t,u))}),_.on("response",u=>{let x=u.headers.location,q=u.statusCode;if(x&&i.followRedirects&&q>=300&&q<400){if(++t._redirects>i.maxRedirects){v(t,_,"Maximum redirects exceeded");return}_.abort();let K;try{K=new We(x,e)}catch{let W=new SyntaxError(`Invalid URL: ${x}`);me(t,W);return}er(t,K,r,s)}else t.emit("unexpected-response",_,u)||v(t,_,`Unexpected server response: ${u.statusCode}`)}),_.on("upgrade",(u,x,q)=>{if(t.emit("upgrade",u),t.readyState!==m.CONNECTING)return;_=t._req=null;let K=u.headers.upgrade;if(K===void 0||K.toLowerCase()!=="websocket"){v(t,x,"Invalid Upgrade header");return}let Ye=vs("sha1").update(d+Ts).digest("base64");if(u.headers["sec-websocket-accept"]!==Ye){v(t,x,"Invalid Sec-WebSocket-Accept header");return}let W=u.headers["sec-websocket-protocol"],Z;if(W!==void 0?h.size?h.has(W)||(Z="Server sent an invalid subprotocol"):Z="Server sent a subprotocol but none was requested":h.size&&(Z="Server sent no subprotocol"),Z){v(t,x,Z);return}W&&(t._protocol=W);let Xe=u.headers["sec-websocket-extensions"];if(Xe!==void 0){if(!p){v(t,x,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let ye;try{ye=Ps(Xe)}catch{v(t,x,"Invalid Sec-WebSocket-Extensions header");return}let Ke=Object.keys(ye);if(Ke.length!==1||Ke[0]!==I.extensionName){v(t,x,"Server indicated an extension that was not requested");return}try{p.accept(ye[I.extensionName])}catch{v(t,x,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[I.extensionName]=p}t.setSocket(x,q,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(_,t):_.end()}function me(t,e){t._readyState=m.CLOSING,t._errorEmitted=!0,t.emit("error",e),t.emitClose()}function Ls(t){return t.path=t.socketPath,Zt.connect(t)}function Ds(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=Zt.isIP(t.host)?"":t.host),xs.connect(t)}function v(t,e,r){t._readyState=m.CLOSING;let s=new Error(r);Error.captureStackTrace(s,v),e.setHeader?(e[Qt]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(me,t,s)):(e.destroy(s),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function Ge(t,e,r){if(e){let s=Es(e)?e.size:Rs(e).length;t._socket?t._sender._bufferedBytes+=s:t._bufferedAmount+=s}if(r){let s=new Error(`WebSocket is not open: readyState ${t.readyState} (${B[t.readyState]})`);process.nextTick(r,s)}}function Fs(t,e){let r=this[g];r._closeFrameReceived=!0,r._closeMessage=e,r._closeCode=t,r._socket[g]!==void 0&&(r._socket.removeListener("data",_e),process.nextTick(tr,r._socket),t===1005?r.close():r.close(t,e))}function As(){let t=this[g];t.isPaused||t._socket.resume()}function Ms(t){let e=this[g];e._socket[g]!==void 0&&(e._socket.removeListener("data",_e),process.nextTick(tr,e._socket),e.close(t[ks])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t))}function Kt(){this[g].emitClose()}function Us(t,e){this[g].emit("message",t,e)}function qs(t){let e=this[g];e._autoPong&&e.pong(t,!this._isServer,Jt),e.emit("ping",t)}function Ws(t){this[g].emit("pong",t)}function tr(t){t.resume()}function $s(t){let e=this[g];e.readyState!==m.CLOSED&&(e.readyState===m.OPEN&&(e._readyState=m.CLOSING,rr(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t)))}function rr(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),t._closeTimeout)}function sr(){let t=this[g];if(this.removeListener("close",sr),this.removeListener("data",_e),this.removeListener("end",ir),t._readyState=m.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[g]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",Kt),t._receiver.on("finish",Kt))}function _e(t){this[g]._receiver.write(t)||this.pause()}function ir(){let t=this[g];t._readyState=m.CLOSING,t._receiver.end(),this.end()}function nr(){let t=this[g];this.removeListener("error",nr),this.on("error",Jt),t&&(t._readyState=m.CLOSING,this.destroy())}});var dr=y((sn,cr)=>{"use strict";var rn=ge(),{Duplex:js}=require("stream");function ar(t){t.emit("close")}function Gs(){!this.destroyed&&this._writableState.finished&&this.destroy()}function lr(t){this.removeListener("error",lr),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function Vs(t,e){let r=!0,s=new js({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return t.on("message",function(n,o){let l=!o&&s._readableState.objectMode?n.toString():n;s.push(l)||t.pause()}),t.once("error",function(n){s.destroyed||(r=!1,s.destroy(n))}),t.once("close",function(){s.destroyed||s.push(null)}),s._destroy=function(i,n){if(t.readyState===t.CLOSED){n(i),process.nextTick(ar,s);return}let o=!1;t.once("error",function(c){o=!0,n(c)}),t.once("close",function(){o||n(i),process.nextTick(ar,s)}),r&&t.terminate()},s._final=function(i){if(t.readyState===t.CONNECTING){t.once("open",function(){s._final(i)});return}t._socket!==null&&(t._socket._writableState.finished?(i(),s._readableState.endEmitted&&s.destroy()):(t._socket.once("finish",function(){i()}),t.close()))},s._read=function(){t.isPaused&&t.resume()},s._write=function(i,n,o){if(t.readyState===t.CONNECTING){t.once("open",function(){s._write(i,n,o)});return}t.send(i,o)},s.on("end",Gs),s.on("error",lr),s}cr.exports=Vs});var ur=y((nn,fr)=>{"use strict";var{tokenChars:Hs}=G();function zs(t){let e=new Set,r=-1,s=-1,i=0;for(i;i<t.length;i++){let o=t.charCodeAt(i);if(s===-1&&Hs[o]===1)r===-1&&(r=i);else if(i!==0&&(o===32||o===9))s===-1&&r!==-1&&(s=i);else if(o===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${i}`);s===-1&&(s=i);let l=t.slice(r,s);if(e.has(l))throw new SyntaxError(`The "${l}" subprotocol is duplicated`);e.add(l),r=s=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(r===-1||s!==-1)throw new SyntaxError("Unexpected end of input");let n=t.slice(r,i);if(e.has(n))throw new SyntaxError(`The "${n}" subprotocol is duplicated`);return e.add(n),e}fr.exports={parse:zs}});var yr=y((an,xr)=>{"use strict";var Ys=require("events"),xe=require("http"),{Duplex:on}=require("stream"),{createHash:Xs}=require("crypto"),hr=qe(),A=ee(),Ks=ur(),Zs=ge(),{CLOSE_TIMEOUT:Js,GUID:Qs,kWebSocket:ei}=k(),ti=/^[+/0-9A-Za-z]{22}==$/,pr=0,mr=1,gr=2,Ve=class extends Ys{constructor(e,r){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Js,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Zs,...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((s,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,r)):e.server&&(this._server=e.server),this._server){let s=this.emit.bind(this,"connection");this._removeListeners=ri(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,n,o)=>{this.handleUpgrade(i,n,o,s)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=pr}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===gr){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!==mr)if(this._state=mr,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(ie,this):process.nextTick(ie,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{ie(this)})}}shouldHandle(e){if(this.options.path){let r=e.url.indexOf("?");if((r!==-1?e.url.slice(0,r):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,r,s,i){r.on("error",_r);let n=e.headers["sec-websocket-key"],o=e.headers.upgrade,l=+e.headers["sec-websocket-version"];if(e.method!=="GET"){M(this,e,r,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){M(this,e,r,400,"Invalid Upgrade header");return}if(n===void 0||!ti.test(n)){M(this,e,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(l!==13&&l!==8){M(this,e,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){ne(r,400);return}let c=e.headers["sec-websocket-protocol"],a=new Set;if(c!==void 0)try{a=Ks.parse(c)}catch{M(this,e,r,400,"Invalid Sec-WebSocket-Protocol header");return}let d=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&d!==void 0){let h=new A(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let p=hr.parse(d);p[A.extensionName]&&(h.accept(p[A.extensionName]),f[A.extensionName]=h)}catch{M(this,e,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let h={origin:e.headers[`${l===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(h,(p,_,u,x)=>{if(!p)return ne(r,_||401,u,x);this.completeUpgrade(f,n,a,e,r,s,i)});return}if(!this.options.verifyClient(h))return ne(r,401)}this.completeUpgrade(f,n,a,e,r,s,i)}completeUpgrade(e,r,s,i,n,o,l){if(!n.readable||!n.writable)return n.destroy();if(n[ei])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>pr)return ne(n,503);let a=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Xs("sha1").update(r+Qs).digest("base64")}`],d=new this.options.WebSocket(null,void 0,this.options);if(s.size){let f=this.options.handleProtocols?this.options.handleProtocols(s,i):s.values().next().value;f&&(a.push(`Sec-WebSocket-Protocol: ${f}`),d._protocol=f)}if(e[A.extensionName]){let f=e[A.extensionName].params,h=hr.format({[A.extensionName]:[f]});a.push(`Sec-WebSocket-Extensions: ${h}`),d._extensions=e}this.emit("headers",a,i),n.write(a.concat(`\r
|
|
3
3
|
`).join(`\r
|
|
4
|
-
`)),n.removeListener("error",_r),d.setSocket(n,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(d),d.on("close",()=>{this.clients.delete(d),this._shouldEmitClose&&!this.clients.size&&process.nextTick(ie,this)})),l(d,i)}};xr.exports=
|
|
4
|
+
`)),n.removeListener("error",_r),d.setSocket(n,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(d),d.on("close",()=>{this.clients.delete(d),this._shouldEmitClose&&!this.clients.size&&process.nextTick(ie,this)})),l(d,i)}};xr.exports=Ve;function ri(t,e){for(let r of Object.keys(e))t.on(r,e[r]);return function(){for(let s of Object.keys(e))t.removeListener(s,e[s])}}function ie(t){t._state=gr,t.emit("close")}function _r(){this.destroy()}function ne(t,e,r,s){r=r||xe.STATUS_CODES[e],s={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...s},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${e} ${xe.STATUS_CODES[e]}\r
|
|
5
5
|
`+Object.keys(s).map(i=>`${i}: ${s[i]}`).join(`\r
|
|
6
6
|
`)+`\r
|
|
7
7
|
\r
|
|
8
|
-
`+r)}function
|
|
8
|
+
`+r)}function M(t,e,r,s,i,n){if(t.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,M),t.emit("wsClientError",o,r,e)}else ne(r,s,i,n)}});var P=w(require("fs"),1),N=w(require("path"),1);function Je(){return`"use client";
|
|
9
9
|
|
|
10
10
|
import { useBitField } from "@lehnihon/bit-form/react";
|
|
11
11
|
|
|
@@ -457,7 +457,7 @@ export function BitFormSelect({
|
|
|
457
457
|
id,
|
|
458
458
|
}: BitFormSelectProps) {
|
|
459
459
|
const field = useBitField(path);
|
|
460
|
-
const {
|
|
460
|
+
const { meta } = field;
|
|
461
461
|
|
|
462
462
|
if (meta.isHidden) return null;
|
|
463
463
|
|
|
@@ -475,8 +475,8 @@ export function BitFormSelect({
|
|
|
475
475
|
</label>
|
|
476
476
|
)}
|
|
477
477
|
<Select
|
|
478
|
-
value={
|
|
479
|
-
onValueChange={(val) =>
|
|
478
|
+
value={field.value ?? ""}
|
|
479
|
+
onValueChange={(val) => field.setValue(val)}
|
|
480
480
|
>
|
|
481
481
|
<SelectTrigger
|
|
482
482
|
id={inputId}
|
|
@@ -524,12 +524,12 @@ export function BitFormCheckbox({
|
|
|
524
524
|
id,
|
|
525
525
|
}: BitFormCheckboxProps) {
|
|
526
526
|
const field = useBitField(path);
|
|
527
|
-
const {
|
|
527
|
+
const { meta } = field;
|
|
528
528
|
|
|
529
529
|
if (meta.isHidden) return null;
|
|
530
530
|
|
|
531
531
|
const inputId = id ?? path;
|
|
532
|
-
const checked = Boolean(
|
|
532
|
+
const checked = Boolean(field.value);
|
|
533
533
|
|
|
534
534
|
return (
|
|
535
535
|
<div className="space-y-2" data-invalid={meta.invalid || undefined}>
|
|
@@ -537,8 +537,8 @@ export function BitFormCheckbox({
|
|
|
537
537
|
<Checkbox
|
|
538
538
|
id={inputId}
|
|
539
539
|
checked={checked}
|
|
540
|
-
onCheckedChange={(checked) =>
|
|
541
|
-
onBlur={
|
|
540
|
+
onCheckedChange={(checked) => field.setValue(!!checked)}
|
|
541
|
+
onBlur={field.setBlur}
|
|
542
542
|
aria-invalid={meta.invalid || undefined}
|
|
543
543
|
aria-required={meta.isRequired || undefined}
|
|
544
544
|
className={className}
|
|
@@ -583,12 +583,12 @@ export function BitFormSwitch({
|
|
|
583
583
|
id,
|
|
584
584
|
}: BitFormSwitchProps) {
|
|
585
585
|
const field = useBitField(path);
|
|
586
|
-
const {
|
|
586
|
+
const { meta } = field;
|
|
587
587
|
|
|
588
588
|
if (meta.isHidden) return null;
|
|
589
589
|
|
|
590
590
|
const inputId = id ?? path;
|
|
591
|
-
const checked = Boolean(
|
|
591
|
+
const checked = Boolean(field.value);
|
|
592
592
|
|
|
593
593
|
return (
|
|
594
594
|
<div className="space-y-2" data-invalid={meta.invalid || undefined}>
|
|
@@ -596,7 +596,7 @@ export function BitFormSwitch({
|
|
|
596
596
|
<Switch
|
|
597
597
|
id={inputId}
|
|
598
598
|
checked={checked}
|
|
599
|
-
onCheckedChange={(checked) =>
|
|
599
|
+
onCheckedChange={(checked) => field.setValue(!!checked)}
|
|
600
600
|
aria-invalid={meta.invalid || undefined}
|
|
601
601
|
aria-required={meta.isRequired || undefined}
|
|
602
602
|
className={className}
|
|
@@ -648,7 +648,7 @@ export function BitFormRadioGroup({
|
|
|
648
648
|
id,
|
|
649
649
|
}: BitFormRadioGroupProps) {
|
|
650
650
|
const field = useBitField(path);
|
|
651
|
-
const {
|
|
651
|
+
const { meta } = field;
|
|
652
652
|
|
|
653
653
|
if (meta.isHidden) return null;
|
|
654
654
|
|
|
@@ -665,8 +665,8 @@ export function BitFormRadioGroup({
|
|
|
665
665
|
</label>
|
|
666
666
|
)}
|
|
667
667
|
<RadioGroup
|
|
668
|
-
value={
|
|
669
|
-
onValueChange={(val) =>
|
|
668
|
+
value={field.value ?? ""}
|
|
669
|
+
onValueChange={(val) => field.setValue(val)}
|
|
670
670
|
className={className}
|
|
671
671
|
aria-invalid={meta.invalid || undefined}
|
|
672
672
|
aria-required={meta.isRequired || undefined}
|
|
@@ -692,7 +692,7 @@ export function BitFormRadioGroup({
|
|
|
692
692
|
</div>
|
|
693
693
|
);
|
|
694
694
|
}
|
|
695
|
-
`}var Ee={input:it,textarea:nt,select:ot,checkbox:at,switch:lt,"radio-group":ct},we=Object.keys(Ee);var dt={name:"shadcn",framework:"react",components:we,renderComponent(t,e){let r=t.toLowerCase().replace(/\s+/g,"-"),s=Ee[r];if(!s)throw new Error(`Unknown shadcn component: ${t}. Available: ${we.join(", ")}`);let i=s(e.uiPath);return{filename:r==="radio-group"?"bit-form-radio-group.tsx":`bit-form-${r}.tsx`,contents:i}}};var ft={shadcn:dt,html:st};function ut(t){return ft[t.toLowerCase()]}function ht(){return Object.keys(ft)}var
|
|
695
|
+
`}var Ee={input:it,textarea:nt,select:ot,checkbox:at,switch:lt,"radio-group":ct},we=Object.keys(Ee);var dt={name:"shadcn",framework:"react",components:we,renderComponent(t,e){let r=t.toLowerCase().replace(/\s+/g,"-"),s=Ee[r];if(!s)throw new Error(`Unknown shadcn component: ${t}. Available: ${we.join(", ")}`);let i=s(e.uiPath);return{filename:r==="radio-group"?"bit-form-radio-group.tsx":`bit-form-${r}.tsx`,contents:i}}};var ft={shadcn:dt,html:st};function ut(t){return ft[t.toLowerCase()]}function ht(){return Object.keys(ft)}var Dr="@/components/ui";function Fr(t){let e=t[0]??"",r=t.slice(1),s=".",i=Dr,n=!1,o=!1,l=[];for(let c=0;c<r.length;c++){let a=r[c];if(a==="--path"){if(!r[c+1])throw new Error("bit-form add: --path requires a value");s=r[c+1],c++}else if(a==="--ui-path"){if(!r[c+1])throw new Error("bit-form add: --ui-path requires a value");i=r[c+1],c++}else a==="--overwrite"?n=!0:a==="--yes"||a==="-y"?o=!0:a.startsWith("--")||l.push(a)}return{adapter:e,components:l,flags:{path:s,uiPath:i,overwrite:n,yes:o}}}function Ar(t){let e=N.join(t,"components.json");try{return P.accessSync(e),!0}catch{return!1}}function pt(t){let{adapter:e,components:r,flags:s}=Fr(t);if(!e)throw new Error("bit-form add: missing adapter name. Example: bit-form add shadcn input");let i=ut(e);if(!i)throw new Error(`bit-form add: unknown adapter "${e}". Available: ${ht().join(", ")}`);let n=r.length>0?r:i.components;if(n.length===0)throw new Error("bit-form add: specify at least one component or use no arguments to add all.");let o=process.cwd(),l=N.resolve(o,s.path),c=N.relative(o,l);if(c.startsWith("..")||N.isAbsolute(c))throw new Error(`bit-form add: output directory must be inside the project root (resolved: ${l})`);i.name==="shadcn"&&!Ar(o)&&console.warn("Warning: components.json not found in project root. Make sure shadcn/ui is initialized (e.g. npx shadcn@latest init) or pass --ui-path to match your setup.");try{P.mkdirSync(l,{recursive:!0})}catch(d){let f=d instanceof Error?d.message:String(d);throw new Error(`bit-form add: could not create output directory: ${f}`,{cause:d})}let a={cwd:o,path:l,uiPath:s.uiPath,overwrite:s.overwrite,yes:s.yes};for(let d of n){let{filename:f,contents:h}=i.renderComponent(d,a),p=N.join(l,f);if(!s.overwrite&&P.existsSync(p)){console.log(`Skip ${f} (exists; use --overwrite to replace)`);continue}P.writeFileSync(p,h,"utf-8"),console.log(`Created ${f}`)}}var ze=w(require("fs"),1),Tr=w(require("http"),1),U=w(require("path"),1);function mt(t){return`
|
|
696
696
|
<!DOCTYPE html>
|
|
697
697
|
<html lang="pt-BR">
|
|
698
698
|
<head>
|
|
@@ -772,13 +772,14 @@ export function BitFormRadioGroup({
|
|
|
772
772
|
if (btn && !panel) {
|
|
773
773
|
btn.click();
|
|
774
774
|
document.body.classList.add('has-panel');
|
|
775
|
+
observer.disconnect();
|
|
775
776
|
}
|
|
776
777
|
});
|
|
777
778
|
|
|
778
779
|
observer.observe(document.body, { childList: true, subtree: true });
|
|
779
780
|
</script>
|
|
780
781
|
</body>
|
|
781
|
-
</html>`}var
|
|
782
|
+
</html>`}var si=w(dr(),1),ii=w(De(),1),ni=w(Me(),1),oi=w(ge(),1),He=w(yr(),1);function vr(t){return t.protocolVersion===1}function br(t){if(!t||typeof t!="object")return!1;let e=t;return e.type==="PING"&&vr(e)}function Sr(t){if(!t||typeof t!="object")return!1;let e=t;if(e.type!=="HELLO"||!e.payload||!vr(e))return!1;let r=e.payload;return(r.role==="client"||r.role==="server")&&r.protocolVersion===1}var Er=1*1024*1024,ai=100;function wr(t){let e=new He.default({server:t,maxPayload:Er}),r=50,s=0,i=new Map;e.on("connection",o=>{if(++s>r){o.close(1013,"Too many connections"),s=r;return}i.set(o,{count:0,resetAt:Date.now()+1e3}),o.on("message",l=>{let c=i.get(o);if(!c||(Date.now()>c.resetAt&&(c.count=0,c.resetAt=Date.now()+1e3),++c.count>ai))return;let a=l.toString();if(!(a.length>Er)){try{let d=JSON.parse(a);if(br(d)||Sr(d))return}catch{return}e.clients.forEach(d=>{d!==o&&d.readyState===1&&d.send(a)})}}),o.on("pong",()=>{o.__isAlive=!0}),o.on("close",()=>{s=Math.max(0,s-1),i.delete(o)})});let n=setInterval(()=>{e.clients.forEach(o=>{if(o.__isAlive===!1){o.terminate();return}o.__isAlive=!1,o.ping()})},3e4);return e.on("close",()=>{clearInterval(n),e.clients.forEach(o=>o.terminate())}),e}function Nr(t=3e3){let e=Tr.default.createServer((r,s)=>{let i=r.url?.split("?")[0]??"";if(i==="/"||i==="/index.html"){s.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),s.end(mt(t));return}if(i.startsWith("/dist/")){let n=U.default.resolve(__dirname,"..","..","dist"),o=i.slice(6),l;try{l=decodeURIComponent(o)}catch{s.writeHead(400),s.end("Bad Request");return}let c=U.default.resolve(n,l),a=U.default.relative(n,c);if(a.startsWith("..")||U.default.isAbsolute(a)){s.writeHead(403),s.end("Forbidden");return}let d;try{d=ze.default.realpathSync(c)}catch{s.writeHead(404),s.end("Not Found");return}if(U.default.relative(n,d).startsWith("..")){s.writeHead(403),s.end("Forbidden");return}try{let f=ze.default.readFileSync(d),h=U.default.extname(d),p={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".map":"application/json",".svg":"image/svg+xml",".html":"text/html"};s.writeHead(200,{"Content-Type":p[h]||"text/plain"}),s.end(f)}catch{s.writeHead(500),s.end("Internal Error")}return}s.writeHead(404),s.end("Not Found")});wr(e),e.listen(t,()=>{console.log(`\u{1F680} BitForm DevServer rodando em http://localhost:${t}`)})}var X=process.argv.slice(2),kr=X[0];if(kr==="devtools"){let t=X.indexOf("-p")!==-1?X.indexOf("-p"):X.indexOf("--port"),e=t!==-1?X[t+1]:void 0,r=e?Number(e):3e3;e!==void 0&&(isNaN(r)||r<1||r>65535)&&(console.error(`bit-form: invalid port "${e}". Must be a number between 1 and 65535.`),process.exit(1)),Nr(r)}else if(kr==="add")try{pt(X.slice(1))}catch(t){console.error(t.message),process.exit(1)}else console.log(`
|
|
782
783
|
\u{1F6E0} Bit-Form CLI
|
|
783
784
|
|
|
784
785
|
Uso:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as BitFormGlobal } from './bus-BFOBGmd9.js';
|
|
2
2
|
import { B as BitMask, b as BitMaskName } from './types-CUXh7PqD.js';
|
|
3
3
|
import { b as BitErrors, g as BitState } from './state-types-8bUndWfg.js';
|
|
4
|
-
import {
|
|
4
|
+
import { B as BitIdFactory, D as DevToolsOptions, a as BitScheduler } from './runtime-types-BLCkMgcy.js';
|
|
5
5
|
|
|
6
6
|
type BitBivariantFn<TArgs extends unknown[], TResult> = {
|
|
7
7
|
bivarianceHack(...args: TArgs): TResult;
|
|
@@ -86,7 +86,7 @@ interface BitPersistResolvedConfig<T extends object = Record<string, unknown>> {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
type BitPluginHookSource = "beforeValidate" | "afterValidate" | "beforeSubmit" | "afterSubmit" | "onFieldChange" | "setup" | "teardown" | "submit";
|
|
89
|
-
type BitOperationalErrorSource = "submit" | "validation" | "persist" | (string & {});
|
|
89
|
+
type BitOperationalErrorSource = "submit" | "validation" | "persist" | "derivation" | "computed" | "subscription" | (string & {});
|
|
90
90
|
type BitFieldChangeOrigin = "setField" | "rebase" | "replaceValues" | "hydrate" | "array";
|
|
91
91
|
type BitArrayOperation = "push" | "prepend" | "insert" | "remove" | "move" | "swap" | "replace" | "clear";
|
|
92
92
|
interface BitFieldChangeMeta {
|
|
@@ -227,4 +227,4 @@ interface BitConfig<T extends object = Record<string, unknown>> {
|
|
|
227
227
|
onUnhandledError?: (error: unknown, source: BitOperationalErrorSource) => void;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
export type { BitAfterSubmitEvent as B, ValidatorFn as V, BitAfterValidateEvent as a, BitBeforeSubmitEvent as b, BitBeforeValidateEvent as c, BitComputedFn as d, BitConfig as e, BitFieldChangeEvent as f, BitFieldChangeMeta as g, BitFieldConditional as h, BitFieldDefinition as i, BitFieldValidation as j, BitHistoryConfig as k,
|
|
230
|
+
export type { BitAfterSubmitEvent as B, ValidatorFn as V, BitAfterValidateEvent as a, BitBeforeSubmitEvent as b, BitBeforeValidateEvent as c, BitComputedFn as d, BitConfig as e, BitFieldChangeEvent as f, BitFieldChangeMeta as g, BitFieldConditional as h, BitFieldDefinition as i, BitFieldValidation as j, BitHistoryConfig as k, BitMaybePromise as l, BitNormalizeFn as m, BitPersistConfig as n, BitPersistMode as o, BitPersistResolvedConfig as p, BitPersistStorageAdapter as q, BitPlugin as r, BitPluginContext as s, BitPluginErrorEvent as t, BitPluginHooks as u, BitTransformFn as v, BitValidationConfig as w, BitOperationalErrorSource as x };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as BitFormGlobal } from './bus-DzTqgkZ4.cjs';
|
|
2
2
|
import { B as BitMask, b as BitMaskName } from './types-CUXh7PqD.cjs';
|
|
3
3
|
import { b as BitErrors, g as BitState } from './state-types-8bUndWfg.cjs';
|
|
4
|
-
import {
|
|
4
|
+
import { B as BitIdFactory, D as DevToolsOptions, a as BitScheduler } from './runtime-types-BLCkMgcy.cjs';
|
|
5
5
|
|
|
6
6
|
type BitBivariantFn<TArgs extends unknown[], TResult> = {
|
|
7
7
|
bivarianceHack(...args: TArgs): TResult;
|
|
@@ -86,7 +86,7 @@ interface BitPersistResolvedConfig<T extends object = Record<string, unknown>> {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
type BitPluginHookSource = "beforeValidate" | "afterValidate" | "beforeSubmit" | "afterSubmit" | "onFieldChange" | "setup" | "teardown" | "submit";
|
|
89
|
-
type BitOperationalErrorSource = "submit" | "validation" | "persist" | (string & {});
|
|
89
|
+
type BitOperationalErrorSource = "submit" | "validation" | "persist" | "derivation" | "computed" | "subscription" | (string & {});
|
|
90
90
|
type BitFieldChangeOrigin = "setField" | "rebase" | "replaceValues" | "hydrate" | "array";
|
|
91
91
|
type BitArrayOperation = "push" | "prepend" | "insert" | "remove" | "move" | "swap" | "replace" | "clear";
|
|
92
92
|
interface BitFieldChangeMeta {
|
|
@@ -227,4 +227,4 @@ interface BitConfig<T extends object = Record<string, unknown>> {
|
|
|
227
227
|
onUnhandledError?: (error: unknown, source: BitOperationalErrorSource) => void;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
export type { BitAfterSubmitEvent as B, ValidatorFn as V, BitAfterValidateEvent as a, BitBeforeSubmitEvent as b, BitBeforeValidateEvent as c, BitComputedFn as d, BitConfig as e, BitFieldChangeEvent as f, BitFieldChangeMeta as g, BitFieldConditional as h, BitFieldDefinition as i, BitFieldValidation as j, BitHistoryConfig as k,
|
|
230
|
+
export type { BitAfterSubmitEvent as B, ValidatorFn as V, BitAfterValidateEvent as a, BitBeforeSubmitEvent as b, BitBeforeValidateEvent as c, BitComputedFn as d, BitConfig as e, BitFieldChangeEvent as f, BitFieldChangeMeta as g, BitFieldConditional as h, BitFieldDefinition as i, BitFieldValidation as j, BitHistoryConfig as k, BitMaybePromise as l, BitNormalizeFn as m, BitPersistConfig as n, BitPersistMode as o, BitPersistResolvedConfig as p, BitPersistStorageAdapter as q, BitPlugin as r, BitPluginContext as s, BitPluginErrorEvent as t, BitPluginHooks as u, BitTransformFn as v, BitValidationConfig as w, BitOperationalErrorSource as x };
|
package/dist/core/bindings.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkAOMXTUA4cjs = require('../chunk-AOMXTUA4.cjs');require('../chunk-3SEB4YRQ.cjs');var _chunk725CMNAVcjs = require('../chunk-725CMNAV.cjs');exports.cleanupRegisteredField = _chunkAOMXTUA4cjs.j; exports.cleanupRegisteredPrefix = _chunkAOMXTUA4cjs.k; exports.createArrayBinding = _chunkAOMXTUA4cjs.g; exports.createFrameworkFormBinding = _chunkAOMXTUA4cjs.i; exports.createFrameworkMaskedFieldBinding = _chunkAOMXTUA4cjs.h; exports.formatMaskedValue = _chunk725CMNAVcjs.b; exports.isBitFieldInputEventObject = _chunk725CMNAVcjs.a; exports.observeFormMetaSnapshot = _chunkAOMXTUA4cjs.c; exports.observePersistMetaSnapshot = _chunkAOMXTUA4cjs.f; exports.parseMaskedInput = _chunk725CMNAVcjs.c; exports.readFormMetaSnapshot = _chunkAOMXTUA4cjs.a; exports.readPersistMetaSnapshot = _chunkAOMXTUA4cjs.d; exports.subscribeFormMetaSnapshot = _chunkAOMXTUA4cjs.b; exports.subscribePersistMetaSnapshot = _chunkAOMXTUA4cjs.e;
|
|
2
2
|
//# sourceMappingURL=bindings.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/builds/kenji.ccp-group/bit-form/dist/core/bindings.cjs"],"names":[],"mappings":"AAAA,kIAA4E,iCAA8B,yDAAwD,qwBAAka","file":"/builds/kenji.ccp-group/bit-form/dist/core/bindings.cjs"}
|
package/dist/core/bindings.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { B as BitFormMeta,
|
|
2
|
-
import {
|
|
1
|
+
import { B as BitFormMeta, b as BitServerErrorOptions, c as BitValidationOptions } from '../meta-types-1Xcht8hj.cjs';
|
|
2
|
+
import { f as BitStoreApi } from '../store-api-types-D7i0KWbr.cjs';
|
|
3
3
|
import { f as BitPersistMetadata, a as BitArrayPath, d as BitPath, e as BitPathValue, D as DeepPartial } from '../state-types-8bUndWfg.cjs';
|
|
4
4
|
import { B as BitArrayBinding } from '../upload-C4JqIaU2.cjs';
|
|
5
5
|
export { a as BitArrayBindingField, b as BitDeleteUploadFn, c as BitHistoryAdapterResult, d as BitPersistAdapterResult, e as BitStepsAdapterResult, f as BitUploadAdapterResult, g as BitUploadFn, h as BitUploadInput, i as BitUploadResult, j as BitUploadValue } from '../upload-C4JqIaU2.cjs';
|
|
6
6
|
import '../bus-DzTqgkZ4.cjs';
|
|
7
7
|
export { B as BitFieldInputEvent, f as formatMaskedValue, i as isBitFieldInputEventObject, p as parseMaskedInput } from '../field-binding-X5TkvfUt.cjs';
|
|
8
8
|
import '../types-CUXh7PqD.cjs';
|
|
9
|
-
import '../config-types-
|
|
10
|
-
import '../runtime-types-
|
|
9
|
+
import '../config-types-mZFlp2Bi.cjs';
|
|
10
|
+
import '../runtime-types-BLCkMgcy.cjs';
|
|
11
11
|
|
|
12
12
|
declare function readFormMetaSnapshot<T extends object>(store: BitStoreApi<T>): BitFormMeta;
|
|
13
13
|
declare function subscribeFormMetaSnapshot<T extends object>(store: BitStoreApi<T>, listener: () => void): () => void;
|
package/dist/core/bindings.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { B as BitFormMeta,
|
|
2
|
-
import {
|
|
1
|
+
import { B as BitFormMeta, b as BitServerErrorOptions, c as BitValidationOptions } from '../meta-types-1Xcht8hj.js';
|
|
2
|
+
import { f as BitStoreApi } from '../store-api-types-CgRVo2DA.js';
|
|
3
3
|
import { f as BitPersistMetadata, a as BitArrayPath, d as BitPath, e as BitPathValue, D as DeepPartial } from '../state-types-8bUndWfg.js';
|
|
4
4
|
import { B as BitArrayBinding } from '../upload-ao6skK9K.js';
|
|
5
5
|
export { a as BitArrayBindingField, b as BitDeleteUploadFn, c as BitHistoryAdapterResult, d as BitPersistAdapterResult, e as BitStepsAdapterResult, f as BitUploadAdapterResult, g as BitUploadFn, h as BitUploadInput, i as BitUploadResult, j as BitUploadValue } from '../upload-ao6skK9K.js';
|
|
6
6
|
import '../bus-BFOBGmd9.js';
|
|
7
7
|
export { B as BitFieldInputEvent, f as formatMaskedValue, i as isBitFieldInputEventObject, p as parseMaskedInput } from '../field-binding-Bi1g-D8X.js';
|
|
8
8
|
import '../types-CUXh7PqD.js';
|
|
9
|
-
import '../config-types-
|
|
10
|
-
import '../runtime-types-
|
|
9
|
+
import '../config-types-DB6FaTiZ.js';
|
|
10
|
+
import '../runtime-types-BLCkMgcy.js';
|
|
11
11
|
|
|
12
12
|
declare function readFormMetaSnapshot<T extends object>(store: BitStoreApi<T>): BitFormMeta;
|
|
13
13
|
declare function subscribeFormMetaSnapshot<T extends object>(store: BitStoreApi<T>, listener: () => void): () => void;
|
package/dist/core/bindings.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h as k,i as l,j as m,k as n}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h as k,i as l,j as m,k as n}from"../chunk-XPY6TCOO.js";import"../chunk-JVRTPL7W.js";import{a as h,b as i,c as j}from"../chunk-DGEGYNQL.js";export{m as cleanupRegisteredField,n as cleanupRegisteredPrefix,g as createArrayBinding,l as createFrameworkFormBinding,k as createFrameworkMaskedFieldBinding,i as formatMaskedValue,h as isBitFieldInputEventObject,c as observeFormMetaSnapshot,f as observePersistMetaSnapshot,j as parseMaskedInput,a as readFormMetaSnapshot,d as readPersistMetaSnapshot,b as subscribeFormMetaSnapshot,e as subscribePersistMetaSnapshot};
|
|
2
2
|
//# sourceMappingURL=bindings.js.map
|
package/dist/core/status.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/builds/kenji.ccp-group/bit-form/dist/core/status.cjs"],"names":[],"mappings":"AAAA,kIAAyC,yDAA8D,0XAA6M","file":"/builds/kenji.ccp-group/bit-form/dist/core/status.cjs"}
|
package/dist/core/status.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as BitHistoryMetadata } from '../meta-types-
|
|
2
|
-
import { S as ScopeStatus } from '../runtime-types-
|
|
3
|
-
export { V as ValidateScopeResult } from '../runtime-types-
|
|
1
|
+
import { a as BitHistoryMetadata } from '../meta-types-1Xcht8hj.cjs';
|
|
2
|
+
import { S as ScopeStatus } from '../runtime-types-BLCkMgcy.cjs';
|
|
3
|
+
export { V as ValidateScopeResult } from '../runtime-types-BLCkMgcy.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Subconjunto relevante de BitHistoryMetadata para comparação de igualdade.
|
package/dist/core/status.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as BitHistoryMetadata } from '../meta-types-
|
|
2
|
-
import { S as ScopeStatus } from '../runtime-types-
|
|
3
|
-
export { V as ValidateScopeResult } from '../runtime-types-
|
|
1
|
+
import { a as BitHistoryMetadata } from '../meta-types-1Xcht8hj.js';
|
|
2
|
+
import { S as ScopeStatus } from '../runtime-types-BLCkMgcy.js';
|
|
3
|
+
export { V as ValidateScopeResult } from '../runtime-types-BLCkMgcy.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Subconjunto relevante de BitHistoryMetadata para comparação de igualdade.
|
package/dist/core/store.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkPDFT5E2Ecjs = require('../chunk-PDFT5E2E.cjs');require('../chunk-RHMJPKNV.cjs');require('../chunk-7LCFS2JM.cjs');require('../chunk-3SEB4YRQ.cjs');require('../chunk-X3DGA5UC.cjs');exports.bitBus = _chunkPDFT5E2Ecjs.a; exports.createBitBus = _chunkPDFT5E2Ecjs.b; exports.createBitStore = _chunkPDFT5E2Ecjs.e; exports.createFrameworkStoreAdapter = _chunkPDFT5E2Ecjs.d; exports.extractFeatureSlice = _chunkPDFT5E2Ecjs.i; exports.extractObserveSlice = _chunkPDFT5E2Ecjs.g; exports.extractReadSlice = _chunkPDFT5E2Ecjs.f; exports.extractSlices = _chunkPDFT5E2Ecjs.j; exports.extractWriteSlice = _chunkPDFT5E2Ecjs.h; exports.resolveBitStoreForHooks = _chunkPDFT5E2Ecjs.c;
|
|
2
2
|
//# sourceMappingURL=store.cjs.map
|
package/dist/core/store.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/builds/kenji.ccp-group/bit-form/dist/core/store.cjs"],"names":[],"mappings":"AAAA,kIAAsD,iCAA8B,iCAA8B,iCAA8B,iCAA8B,qeAA0O","file":"/builds/kenji.ccp-group/bit-form/dist/core/store.cjs"}
|
package/dist/core/store.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { createBitStore, createFrameworkStoreAdapter, resolveBitStoreForHooks } from '../index.cjs';
|
|
2
|
-
import {
|
|
3
|
-
export { B as BitEqualityFn, a as BitFrameworkConfig, b as BitFrameworkStoreApi, c as
|
|
4
|
-
export { B as BitFormMeta, a as BitHistoryMetadata, b as BitValidationOptions } from '../meta-types-
|
|
5
|
-
export { B as BitAfterSubmitEvent, a as BitAfterValidateEvent, b as BitBeforeSubmitEvent, c as BitBeforeValidateEvent, d as BitComputedFn, e as BitConfig, f as BitFieldChangeEvent, g as BitFieldChangeMeta, h as BitFieldConditional, i as BitFieldDefinition, j as BitFieldValidation, k as BitHistoryConfig, l as
|
|
2
|
+
import { f as BitStoreApi, i as BitStoreFeatureApi, j as BitStoreObserveSliceApi, k as BitStoreReadSliceApi, l as BitStoreWriteSliceApi } from '../store-api-types-D7i0KWbr.cjs';
|
|
3
|
+
export { B as BitEqualityFn, a as BitFrameworkConfig, b as BitFrameworkStoreApi, c as BitScopedSelectorSubscriptionOptions, d as BitSelector, e as BitSelectorSubscriptionOptions, g as BitTrackedSelectorSubscriptionOptions } from '../store-api-types-D7i0KWbr.cjs';
|
|
4
|
+
export { B as BitFormMeta, a as BitHistoryMetadata, b as BitServerErrorOptions, c as BitValidationOptions } from '../meta-types-1Xcht8hj.cjs';
|
|
5
|
+
export { B as BitAfterSubmitEvent, a as BitAfterValidateEvent, b as BitBeforeSubmitEvent, c as BitBeforeValidateEvent, d as BitComputedFn, e as BitConfig, f as BitFieldChangeEvent, g as BitFieldChangeMeta, h as BitFieldConditional, i as BitFieldDefinition, j as BitFieldValidation, k as BitHistoryConfig, l as BitMaybePromise, m as BitNormalizeFn, n as BitPersistConfig, o as BitPersistMode, p as BitPersistResolvedConfig, q as BitPersistStorageAdapter, r as BitPlugin, s as BitPluginContext, t as BitPluginErrorEvent, u as BitPluginHooks, v as BitTransformFn, w as BitValidationConfig, V as ValidatorFn } from '../config-types-mZFlp2Bi.cjs';
|
|
6
6
|
export { B as BitArrayItem, a as BitArrayPath, b as BitErrors, c as BitFieldState, d as BitPath, e as BitPathValue, f as BitPersistMetadata, g as BitState, h as BitTouched, D as DeepPartial } from '../state-types-8bUndWfg.cjs';
|
|
7
|
-
export { B as
|
|
7
|
+
export { B as BitIdFactory, a as BitScheduler, b as BitSubmitResult, D as DevToolsOptions, S as ScopeStatus, V as ValidateScopeResult } from '../runtime-types-BLCkMgcy.cjs';
|
|
8
8
|
export { B as BitBus, a as BitBusListener, b as BitBusStorePort, c as BitFormGlobal, d as bitBus, e as createBitBus } from '../bus-DzTqgkZ4.cjs';
|
|
9
9
|
import '../types-CUXh7PqD.cjs';
|
|
10
10
|
|
package/dist/core/store.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { createBitStore, createFrameworkStoreAdapter, resolveBitStoreForHooks } from '../index.js';
|
|
2
|
-
import {
|
|
3
|
-
export { B as BitEqualityFn, a as BitFrameworkConfig, b as BitFrameworkStoreApi, c as
|
|
4
|
-
export { B as BitFormMeta, a as BitHistoryMetadata, b as BitValidationOptions } from '../meta-types-
|
|
5
|
-
export { B as BitAfterSubmitEvent, a as BitAfterValidateEvent, b as BitBeforeSubmitEvent, c as BitBeforeValidateEvent, d as BitComputedFn, e as BitConfig, f as BitFieldChangeEvent, g as BitFieldChangeMeta, h as BitFieldConditional, i as BitFieldDefinition, j as BitFieldValidation, k as BitHistoryConfig, l as
|
|
2
|
+
import { f as BitStoreApi, i as BitStoreFeatureApi, j as BitStoreObserveSliceApi, k as BitStoreReadSliceApi, l as BitStoreWriteSliceApi } from '../store-api-types-CgRVo2DA.js';
|
|
3
|
+
export { B as BitEqualityFn, a as BitFrameworkConfig, b as BitFrameworkStoreApi, c as BitScopedSelectorSubscriptionOptions, d as BitSelector, e as BitSelectorSubscriptionOptions, g as BitTrackedSelectorSubscriptionOptions } from '../store-api-types-CgRVo2DA.js';
|
|
4
|
+
export { B as BitFormMeta, a as BitHistoryMetadata, b as BitServerErrorOptions, c as BitValidationOptions } from '../meta-types-1Xcht8hj.js';
|
|
5
|
+
export { B as BitAfterSubmitEvent, a as BitAfterValidateEvent, b as BitBeforeSubmitEvent, c as BitBeforeValidateEvent, d as BitComputedFn, e as BitConfig, f as BitFieldChangeEvent, g as BitFieldChangeMeta, h as BitFieldConditional, i as BitFieldDefinition, j as BitFieldValidation, k as BitHistoryConfig, l as BitMaybePromise, m as BitNormalizeFn, n as BitPersistConfig, o as BitPersistMode, p as BitPersistResolvedConfig, q as BitPersistStorageAdapter, r as BitPlugin, s as BitPluginContext, t as BitPluginErrorEvent, u as BitPluginHooks, v as BitTransformFn, w as BitValidationConfig, V as ValidatorFn } from '../config-types-DB6FaTiZ.js';
|
|
6
6
|
export { B as BitArrayItem, a as BitArrayPath, b as BitErrors, c as BitFieldState, d as BitPath, e as BitPathValue, f as BitPersistMetadata, g as BitState, h as BitTouched, D as DeepPartial } from '../state-types-8bUndWfg.js';
|
|
7
|
-
export { B as
|
|
7
|
+
export { B as BitIdFactory, a as BitScheduler, b as BitSubmitResult, D as DevToolsOptions, S as ScopeStatus, V as ValidateScopeResult } from '../runtime-types-BLCkMgcy.js';
|
|
8
8
|
export { B as BitBus, a as BitBusListener, b as BitBusStorePort, c as BitFormGlobal, d as bitBus, e as createBitBus } from '../bus-BFOBGmd9.js';
|
|
9
9
|
import '../types-CUXh7PqD.js';
|
|
10
10
|
|