@apocaliss92/scrypted-reolink-native 0.1.3 → 0.1.4

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.
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see main.nodejs.js.LICENSE.txt */
2
- (()=>{var e={9038:(e,t,A)=>{"use strict";const s=A(1167),r=A(5497),n=A(8542),i=A(8055),o=A(3315),a=A(9246),c=A(4667),l=A(8712),h=A(8297),g=A(4465),d=A(2858),{InvalidArgumentError:u}=g,E=A(9713),I=A(1986),Q=A(615),{MockCallHistory:C,MockCallHistoryLog:B}=A(4969),p=A(7467),f=A(5846),m=A(1313),y=A(3123),S=A(6294),{getGlobalDispatcher:D,setGlobalDispatcher:w}=A(9879),b=A(6917),R=A(8064);Object.assign(r.prototype,E),e.exports.g6=o,A(5132),A(2936),A(532),A(3562),A(6677),A(5752),A(4951),A(9903);function N(e){return(t,A,s)=>{if("function"==typeof A&&(s=A,A=null),!t||"string"!=typeof t&&"object"!=typeof t&&!(t instanceof URL))throw new u("invalid url");if(null!=A&&"object"!=typeof A)throw new u("invalid opts");if(A&&null!=A.path){if("string"!=typeof A.path)throw new u("invalid opts.path");let e=A.path;A.path.startsWith("/")||(e=`/${e}`),t=new URL(d.parseOrigin(t).origin+e)}else A||(A="object"==typeof t?t:{}),t=d.parseURL(t);const{agent:r,dispatcher:n=D()}=A;if(r)throw new u("unsupported opts.agent. Did you mean opts.client?");return e.call(n,{...A,origin:t.origin,path:t.search?`${t.pathname}${t.search}`:t.pathname,method:A.method||(A.body?"PUT":"GET")},s)}}A(2636),d.parseHeaders,d.headerNameToString;const k=A(7388).fetch;e.exports.hd=function(e,t=void 0){return k(e,t).catch((e=>{throw e&&"object"==typeof e&&Error.captureStackTrace(e),e}))},e.exports.Headers=A(6558).Headers,e.exports.Response=A(4821).Response,e.exports.Request=A(4609).Request,e.exports.FormData=A(3944).FormData;const{setGlobalOrigin:T,getGlobalOrigin:F}=A(2837);const{CacheStorage:v}=A(6939),{kConstruct:M}=A(257);new v(M);const{deleteCookie:U,getCookies:L,getSetCookies:H,setCookie:x,parseCookie:Y}=A(9391);const{parseMIMEType:P,serializeAMimeType:V}=A(9934);const{CloseEvent:O,ErrorEvent:G,MessageEvent:J}=A(878),{WebSocket:W,ping:_}=A(2984);e.exports.kb=W,e.exports.rd=O,e.exports.NN=G,e.exports.aM=J,A(27).WebSocketStream,A(7053).WebSocketError,N(E.request),N(E.stream),N(E.pipeline),N(E.connect),N(E.upgrade);const{EventSource:q}=A(7928);e.exports.GD=q},3904:(e,t,A)=>{"use strict";const{addAbortListener:s}=A(2858),{RequestAbortedError:r}=A(4465),n=Symbol("kListener"),i=Symbol("kSignal");function o(e){e.abort?e.abort(e[i]?.reason):e.reason=e[i]?.reason??new r,a(e)}function a(e){e[i]&&("removeEventListener"in e[i]?e[i].removeEventListener("abort",e[n]):e[i].removeListener("abort",e[n]),e[i]=null,e[n]=null)}e.exports={addSignal:function(e,t){e.reason=null,e[i]=null,e[n]=null,t&&(t.aborted?o(e):(e[i]=t,e[n]=()=>{o(e)},s(e[i],e[n])))},removeSignal:a}},3102:(e,t,A)=>{"use strict";const s=A(4589),{AsyncResource:r}=A(6698),{InvalidArgumentError:n,SocketError:i}=A(4465),o=A(2858),{addSignal:a,removeSignal:c}=A(3904);class l extends r{constructor(e,t){if(!e||"object"!=typeof e)throw new n("invalid opts");if("function"!=typeof t)throw new n("invalid callback");const{signal:A,opaque:s,responseHeaders:r}=e;if(A&&"function"!=typeof A.on&&"function"!=typeof A.addEventListener)throw new n("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=s||null,this.responseHeaders=r||null,this.callback=t,this.abort=null,a(this,A)}onConnect(e,t){this.reason?e(this.reason):(s(this.callback),this.abort=e,this.context=t)}onHeaders(){throw new i("bad connect",null)}onUpgrade(e,t,A){const{callback:s,opaque:r,context:n}=this;c(this),this.callback=null;let i=t;null!=i&&(i="raw"===this.responseHeaders?o.parseRawHeaders(t):o.parseHeaders(t)),this.runInAsyncScope(s,null,null,{statusCode:e,headers:i,socket:A,opaque:r,context:n})}onError(e){const{callback:t,opaque:A}=this;c(this),t&&(this.callback=null,queueMicrotask((()=>{this.runInAsyncScope(t,null,e,{opaque:A})})))}}e.exports=function e(t,A){if(void 0===A)return new Promise(((A,s)=>{e.call(this,t,((e,t)=>e?s(e):A(t)))}));try{const e=new l(t,A),s={...t,method:"CONNECT"};this.dispatch(s,e)}catch(e){if("function"!=typeof A)throw e;const s=t?.opaque;queueMicrotask((()=>A(e,{opaque:s})))}}},8660:(e,t,A)=>{"use strict";const{Readable:s,Duplex:r,PassThrough:n}=A(7075),i=A(4589),{AsyncResource:o}=A(6698),{InvalidArgumentError:a,InvalidReturnValueError:c,RequestAbortedError:l}=A(4465),h=A(2858),{addSignal:g,removeSignal:d}=A(3904);function u(){}const E=Symbol("resume");class I extends s{constructor(){super({autoDestroy:!0}),this[E]=null}_read(){const{[E]:e}=this;e&&(this[E]=null,e())}_destroy(e,t){this._read(),t(e)}}class Q extends s{constructor(e){super({autoDestroy:!0}),this[E]=e}_read(){this[E]()}_destroy(e,t){e||this._readableState.endEmitted||(e=new l),t(e)}}class C extends o{constructor(e,t){if(!e||"object"!=typeof e)throw new a("invalid opts");if("function"!=typeof t)throw new a("invalid handler");const{signal:A,method:s,opaque:n,onInfo:i,responseHeaders:o}=e;if(A&&"function"!=typeof A.on&&"function"!=typeof A.addEventListener)throw new a("signal must be an EventEmitter or EventTarget");if("CONNECT"===s)throw new a("invalid method");if(i&&"function"!=typeof i)throw new a("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=n||null,this.responseHeaders=o||null,this.handler=t,this.abort=null,this.context=null,this.onInfo=i||null,this.req=(new I).on("error",u),this.ret=new r({readableObjectMode:e.objectMode,autoDestroy:!0,read:()=>{const{body:e}=this;e?.resume&&e.resume()},write:(e,t,A)=>{const{req:s}=this;s.push(e,t)||s._readableState.destroyed?A():s[E]=A},destroy:(e,t)=>{const{body:A,req:s,res:r,ret:n,abort:i}=this;e||n._readableState.endEmitted||(e=new l),i&&e&&i(),h.destroy(A,e),h.destroy(s,e),h.destroy(r,e),d(this),t(e)}}).on("prefinish",(()=>{const{req:e}=this;e.push(null)})),this.res=null,g(this,A)}onConnect(e,t){const{res:A}=this;this.reason?e(this.reason):(i(!A,"pipeline cannot be retried"),this.abort=e,this.context=t)}onHeaders(e,t,A){const{opaque:s,handler:r,context:n}=this;if(e<200){if(this.onInfo){const A="raw"===this.responseHeaders?h.parseRawHeaders(t):h.parseHeaders(t);this.onInfo({statusCode:e,headers:A})}return}let i;this.res=new Q(A);try{this.handler=null;const A="raw"===this.responseHeaders?h.parseRawHeaders(t):h.parseHeaders(t);i=this.runInAsyncScope(r,null,{statusCode:e,headers:A,opaque:s,body:this.res,context:n})}catch(e){throw this.res.on("error",u),e}if(!i||"function"!=typeof i.on)throw new c("expected Readable");i.on("data",(e=>{const{ret:t,body:A}=this;!t.push(e)&&A.pause&&A.pause()})).on("error",(e=>{const{ret:t}=this;h.destroy(t,e)})).on("end",(()=>{const{ret:e}=this;e.push(null)})).on("close",(()=>{const{ret:e}=this;e._readableState.ended||h.destroy(e,new l)})),this.body=i}onData(e){const{res:t}=this;return t.push(e)}onComplete(e){const{res:t}=this;t.push(null)}onError(e){const{ret:t}=this;this.handler=null,h.destroy(t,e)}}e.exports=function(e,t){try{const A=new C(e,t);return this.dispatch({...e,body:A.req},A),A.ret}catch(e){return(new n).destroy(e)}}},7745:(e,t,A)=>{"use strict";const s=A(4589),{AsyncResource:r}=A(6698),{Readable:n}=A(777),{InvalidArgumentError:i,RequestAbortedError:o}=A(4465),a=A(2858);function c(){}class l extends r{constructor(e,t){if(!e||"object"!=typeof e)throw new i("invalid opts");const{signal:A,method:s,opaque:r,body:n,onInfo:l,responseHeaders:h,highWaterMark:g}=e;try{if("function"!=typeof t)throw new i("invalid callback");if(g&&("number"!=typeof g||g<0))throw new i("invalid highWaterMark");if(A&&"function"!=typeof A.on&&"function"!=typeof A.addEventListener)throw new i("signal must be an EventEmitter or EventTarget");if("CONNECT"===s)throw new i("invalid method");if(l&&"function"!=typeof l)throw new i("invalid onInfo callback");super("UNDICI_REQUEST")}catch(e){throw a.isStream(n)&&a.destroy(n.on("error",c),e),e}this.method=s,this.responseHeaders=h||null,this.opaque=r||null,this.callback=t,this.res=null,this.abort=null,this.body=n,this.trailers={},this.context=null,this.onInfo=l||null,this.highWaterMark=g,this.reason=null,this.removeAbortListener=null,A?.aborted?this.reason=A.reason??new o:A&&(this.removeAbortListener=a.addAbortListener(A,(()=>{this.reason=A.reason??new o,this.res?a.destroy(this.res.on("error",c),this.reason):this.abort&&this.abort(this.reason)})))}onConnect(e,t){this.reason?e(this.reason):(s(this.callback),this.abort=e,this.context=t)}onHeaders(e,t,A,s){const{callback:r,opaque:i,abort:o,context:l,responseHeaders:h,highWaterMark:g}=this,d="raw"===h?a.parseRawHeaders(t):a.parseHeaders(t);if(e<200)return void(this.onInfo&&this.onInfo({statusCode:e,headers:d}));const u="raw"===h?a.parseHeaders(t):d,E=u["content-type"],I=u["content-length"],Q=new n({resume:A,abort:o,contentType:E,contentLength:"HEAD"!==this.method&&I?Number(I):null,highWaterMark:g});if(this.removeAbortListener&&(Q.on("close",this.removeAbortListener),this.removeAbortListener=null),this.callback=null,this.res=Q,null!==r)try{this.runInAsyncScope(r,null,null,{statusCode:e,headers:d,trailers:this.trailers,opaque:i,body:Q,context:l})}catch(e){this.res=null,a.destroy(Q.on("error",c),e),queueMicrotask((()=>{throw e}))}}onData(e){return this.res.push(e)}onComplete(e){a.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){const{res:t,callback:A,body:s,opaque:r}=this;A&&(this.callback=null,queueMicrotask((()=>{this.runInAsyncScope(A,null,e,{opaque:r})}))),t&&(this.res=null,queueMicrotask((()=>{a.destroy(t.on("error",c),e)}))),s&&(this.body=null,a.isStream(s)&&(s.on("error",c),a.destroy(s,e))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}}e.exports=function e(t,A){if(void 0===A)return new Promise(((A,s)=>{e.call(this,t,((e,t)=>e?s(e):A(t)))}));try{const e=new l(t,A);this.dispatch(t,e)}catch(e){if("function"!=typeof A)throw e;const s=t?.opaque;queueMicrotask((()=>A(e,{opaque:s})))}},e.exports.RequestHandler=l},322:(e,t,A)=>{"use strict";const s=A(4589),{finished:r}=A(7075),{AsyncResource:n}=A(6698),{InvalidArgumentError:i,InvalidReturnValueError:o}=A(4465),a=A(2858),{addSignal:c,removeSignal:l}=A(3904);function h(){}class g extends n{constructor(e,t,A){if(!e||"object"!=typeof e)throw new i("invalid opts");const{signal:s,method:r,opaque:n,body:o,onInfo:l,responseHeaders:g}=e;try{if("function"!=typeof A)throw new i("invalid callback");if("function"!=typeof t)throw new i("invalid factory");if(s&&"function"!=typeof s.on&&"function"!=typeof s.addEventListener)throw new i("signal must be an EventEmitter or EventTarget");if("CONNECT"===r)throw new i("invalid method");if(l&&"function"!=typeof l)throw new i("invalid onInfo callback");super("UNDICI_STREAM")}catch(e){throw a.isStream(o)&&a.destroy(o.on("error",h),e),e}this.responseHeaders=g||null,this.opaque=n||null,this.factory=t,this.callback=A,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=o,this.onInfo=l||null,a.isStream(o)&&o.on("error",(e=>{this.onError(e)})),c(this,s)}onConnect(e,t){this.reason?e(this.reason):(s(this.callback),this.abort=e,this.context=t)}onHeaders(e,t,A,s){const{factory:n,opaque:i,context:c,responseHeaders:l}=this,h="raw"===l?a.parseRawHeaders(t):a.parseHeaders(t);if(e<200)return void(this.onInfo&&this.onInfo({statusCode:e,headers:h}));if(this.factory=null,null===n)return;const g=this.runInAsyncScope(n,null,{statusCode:e,headers:h,opaque:i,context:c});if(!g||"function"!=typeof g.write||"function"!=typeof g.end||"function"!=typeof g.on)throw new o("expected Writable");r(g,{readable:!1},(e=>{const{callback:t,res:A,opaque:s,trailers:r,abort:n}=this;this.res=null,!e&&A?.readable||a.destroy(A,e),this.callback=null,this.runInAsyncScope(t,null,e||null,{opaque:s,trailers:r}),e&&n()})),g.on("drain",A),this.res=g;return!0!==(void 0!==g.writableNeedDrain?g.writableNeedDrain:g._writableState?.needDrain)}onData(e){const{res:t}=this;return!t||t.write(e)}onComplete(e){const{res:t}=this;l(this),t&&(this.trailers=a.parseHeaders(e),t.end())}onError(e){const{res:t,callback:A,opaque:s,body:r}=this;l(this),this.factory=null,t?(this.res=null,a.destroy(t,e)):A&&(this.callback=null,queueMicrotask((()=>{this.runInAsyncScope(A,null,e,{opaque:s})}))),r&&(this.body=null,a.destroy(r,e))}}e.exports=function e(t,A,s){if(void 0===s)return new Promise(((s,r)=>{e.call(this,t,A,((e,t)=>e?r(e):s(t)))}));try{const e=new g(t,A,s);this.dispatch(t,e)}catch(e){if("function"!=typeof s)throw e;const A=t?.opaque;queueMicrotask((()=>s(e,{opaque:A})))}}},3936:(e,t,A)=>{"use strict";const{InvalidArgumentError:s,SocketError:r}=A(4465),{AsyncResource:n}=A(6698),i=A(4589),o=A(2858),{addSignal:a,removeSignal:c}=A(3904);class l extends n{constructor(e,t){if(!e||"object"!=typeof e)throw new s("invalid opts");if("function"!=typeof t)throw new s("invalid callback");const{signal:A,opaque:r,responseHeaders:n}=e;if(A&&"function"!=typeof A.on&&"function"!=typeof A.addEventListener)throw new s("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=n||null,this.opaque=r||null,this.callback=t,this.abort=null,this.context=null,a(this,A)}onConnect(e,t){this.reason?e(this.reason):(i(this.callback),this.abort=e,this.context=null)}onHeaders(){throw new r("bad upgrade",null)}onUpgrade(e,t,A){i(101===e);const{callback:s,opaque:r,context:n}=this;c(this),this.callback=null;const a="raw"===this.responseHeaders?o.parseRawHeaders(t):o.parseHeaders(t);this.runInAsyncScope(s,null,null,{headers:a,socket:A,opaque:r,context:n})}onError(e){const{callback:t,opaque:A}=this;c(this),t&&(this.callback=null,queueMicrotask((()=>{this.runInAsyncScope(t,null,e,{opaque:A})})))}}e.exports=function e(t,A){if(void 0===A)return new Promise(((A,s)=>{e.call(this,t,((e,t)=>e?s(e):A(t)))}));try{const e=new l(t,A),s={...t,method:t.method||"GET",upgrade:t.protocol||"Websocket"};this.dispatch(s,e)}catch(e){if("function"!=typeof A)throw e;const s=t?.opaque;queueMicrotask((()=>A(e,{opaque:s})))}}},9713:(e,t,A)=>{"use strict";e.exports.request=A(7745),e.exports.stream=A(322),e.exports.pipeline=A(8660),e.exports.upgrade=A(3936),e.exports.connect=A(3102)},777:(e,t,A)=>{"use strict";const s=A(4589),{Readable:r}=A(7075),{RequestAbortedError:n,NotSupportedError:i,InvalidArgumentError:o,AbortError:a}=A(4465),c=A(2858),{ReadableStreamFrom:l}=A(2858),h=Symbol("kConsume"),g=Symbol("kReading"),d=Symbol("kBody"),u=Symbol("kAbort"),E=Symbol("kContentType"),I=Symbol("kContentLength"),Q=Symbol("kUsed"),C=Symbol("kBytesRead"),B=()=>{};function p(e){return c.isDisturbed(e)||function(e){return!0===e[d]?.locked||null!==e[h]}(e)}function f(e,t){return s(!e[h]),new Promise(((A,s)=>{if(p(e)){const t=e._readableState;t.destroyed&&!1===t.closeEmitted?e.on("error",s).on("close",(()=>{s(new TypeError("unusable"))})):s(t.errored??new TypeError("unusable"))}else queueMicrotask((()=>{e[h]={type:t,stream:e,resolve:A,reject:s,length:0,body:[]},e.on("error",(function(e){w(this[h],e)})).on("close",(function(){null!==this[h].body&&w(this[h],new n)})),function(e){if(null===e.body)return;const{_readableState:t}=e.stream;if(t.bufferIndex){const A=t.bufferIndex,s=t.buffer.length;for(let r=A;r<s;r++)D(e,t.buffer[r])}else for(const A of t.buffer)D(e,A);t.endEmitted?S(this[h],this._readableState.encoding):e.stream.on("end",(function(){S(this[h],this._readableState.encoding)}));e.stream.resume();for(;null!=e.stream.read(););}(e[h])}))}))}function m(e,t,A){if(0===e.length||0===t)return"";const s=1===e.length?e[0]:Buffer.concat(e,t),r=s.length,n=r>2&&239===s[0]&&187===s[1]&&191===s[2]?3:0;return A&&"utf8"!==A&&"utf-8"!==A?s.subarray(n,r).toString(A):s.utf8Slice(n,r)}function y(e,t){if(0===e.length||0===t)return new Uint8Array(0);if(1===e.length)return new Uint8Array(e[0]);const A=new Uint8Array(Buffer.allocUnsafeSlow(t).buffer);let s=0;for(let t=0;t<e.length;++t){const r=e[t];A.set(r,s),s+=r.length}return A}function S(e,t){const{type:A,body:s,resolve:r,stream:n,length:i}=e;try{"text"===A?r(m(s,i,t)):"json"===A?r(JSON.parse(m(s,i,t))):"arrayBuffer"===A?r(y(s,i).buffer):"blob"===A?r(new Blob(s,{type:n[E]})):"bytes"===A&&r(y(s,i)),w(e)}catch(e){n.destroy(e)}}function D(e,t){e.length+=t.length,e.body.push(t)}function w(e,t){null!==e.body&&(t?e.reject(t):e.resolve(),e.type=null,e.stream=null,e.resolve=null,e.reject=null,e.length=0,e.body=null)}e.exports={Readable:class extends r{constructor({resume:e,abort:t,contentType:A="",contentLength:s,highWaterMark:r=65536}){super({autoDestroy:!0,read:e,highWaterMark:r}),this._readableState.dataEmitted=!1,this[u]=t,this[h]=null,this[C]=0,this[d]=null,this[Q]=!1,this[E]=A,this[I]=Number.isFinite(s)?s:null,this[g]=!1}_destroy(e,t){e||this._readableState.endEmitted||(e=new n),e&&this[u](),this[Q]?t(e):setImmediate(t,e)}on(e,t){return"data"!==e&&"readable"!==e||(this[g]=!0,this[Q]=!0),super.on(e,t)}addListener(e,t){return this.on(e,t)}off(e,t){const A=super.off(e,t);return"data"!==e&&"readable"!==e||(this[g]=this.listenerCount("data")>0||this.listenerCount("readable")>0),A}removeListener(e,t){return this.off(e,t)}push(e){return e&&(this[C]+=e.length,this[h])?(D(this[h],e),!this[g]||super.push(e)):super.push(e)}text(){return f(this,"text")}json(){return f(this,"json")}blob(){return f(this,"blob")}bytes(){return f(this,"bytes")}arrayBuffer(){return f(this,"arrayBuffer")}async formData(){throw new i}get bodyUsed(){return c.isDisturbed(this)}get body(){return this[d]||(this[d]=l(this),this[h]&&(this[d].getReader(),s(this[d].locked))),this[d]}dump(e){const t=e?.signal;if(null!=t&&("object"!=typeof t||!("aborted"in t)))return Promise.reject(new o("signal must be an AbortSignal"));const A=e?.limit&&Number.isFinite(e.limit)?e.limit:131072;return t?.aborted?Promise.reject(t.reason??new a):this._readableState.closeEmitted?Promise.resolve(null):new Promise(((e,s)=>{if((this[I]&&this[I]>A||this[C]>A)&&this.destroy(new a),t){const A=()=>{this.destroy(t.reason??new a)};t.addEventListener("abort",A),this.on("close",(function(){t.removeEventListener("abort",A),t.aborted?s(t.reason??new a):e(null)}))}else this.on("close",e);this.on("error",B).on("data",(()=>{this[C]>A&&this.destroy()})).resume()}))}setEncoding(e){return Buffer.isEncoding(e)&&(this._readableState.encoding=e),this}},chunksDecode:m}},9903:(e,t,A)=>{"use strict";const{Writable:s}=A(7075),{EventEmitter:r}=A(8474),{assertCacheKey:n,assertCacheValue:i}=A(9453);function o(e,t,A){return t.find((t=>t.deleteAt>A&&t.method===e.method&&(null==t.vary||Object.keys(t.vary).every((A=>null===t.vary[A]?void 0===e.headers[A]:t.vary[A]===e.headers[A])))))}e.exports=class extends r{#e=1024;#t=104857600;#A=5242880;#s=0;#r=0;#n=new Map;#i=!1;constructor(e){if(super(),e){if("object"!=typeof e)throw new TypeError("MemoryCacheStore options must be an object");if(void 0!==e.maxCount){if("number"!=typeof e.maxCount||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("MemoryCacheStore options.maxCount must be a non-negative integer");this.#e=e.maxCount}if(void 0!==e.maxSize){if("number"!=typeof e.maxSize||!Number.isInteger(e.maxSize)||e.maxSize<0)throw new TypeError("MemoryCacheStore options.maxSize must be a non-negative integer");this.#t=e.maxSize}if(void 0!==e.maxEntrySize){if("number"!=typeof e.maxEntrySize||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("MemoryCacheStore options.maxEntrySize must be a non-negative integer");this.#A=e.maxEntrySize}}}get size(){return this.#s}isFull(){return this.#s>=this.#t||this.#r>=this.#e}get(e){n(e);const t=`${e.origin}:${e.path}`,A=Date.now(),s=this.#n.get(t),r=s?o(e,s,A):null;return null==r?void 0:{statusMessage:r.statusMessage,statusCode:r.statusCode,headers:r.headers,body:r.body,vary:r.vary?r.vary:void 0,etag:r.etag,cacheControlDirectives:r.cacheControlDirectives,cachedAt:r.cachedAt,staleAt:r.staleAt,deleteAt:r.deleteAt}}createWriteStream(e,t){n(e),i(t);const A=`${e.origin}:${e.path}`,r=this,a={...e,...t,body:[],size:0};return new s({write(e,t,A){"string"==typeof e&&(e=Buffer.from(e,t)),a.size+=e.byteLength,a.size>=r.#A?this.destroy():a.body.push(e),A(null)},final(t){let s=r.#n.get(A);s||(s=[],r.#n.set(A,s));const n=o(e,s,Date.now());if(n){const e=s.indexOf(n);s.splice(e,1,a),r.#s-=n.size}else s.push(a),r.#r+=1;if(r.#s+=a.size,r.#s>r.#t||r.#r>r.#e){r.#i||(r.emit("maxSizeExceeded",{size:r.#s,maxSize:r.#t,count:r.#r,maxCount:r.#e}),r.#i=!0);for(const[e,t]of r.#n){for(const e of t.splice(0,t.length/2))r.#s-=e.size,r.#r-=1;0===t.length&&r.#n.delete(e)}r.#s<r.#t&&r.#r<r.#e&&(r.#i=!1)}t(null)}})}delete(e){if("object"!=typeof e)throw new TypeError("expected key to be object, got "+typeof e);const t=`${e.origin}:${e.path}`;for(const e of this.#n.get(t)??[])this.#s-=e.size,this.#r-=1;this.#n.delete(t)}}},2636:(e,t,A)=>{"use strict";const{Writable:s}=A(7075),{assertCacheKey:r,assertCacheValue:n}=A(9453);let i;const o=2e9;function a(e,t){return null==e&&null==t||!(null==e&&null!=t||null!=e&&null==t)&&(Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every(((e,A)=>e===t[A])):e===t)}e.exports=class{#A=o;#e=1/0;#o;#a;#c;#l;#h;#g;#d;#u;constructor(e){if(e){if("object"!=typeof e)throw new TypeError("SqliteCacheStore options must be an object");if(void 0!==e.maxEntrySize){if("number"!=typeof e.maxEntrySize||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("SqliteCacheStore options.maxEntrySize must be a non-negative integer");if(e.maxEntrySize>o)throw new TypeError("SqliteCacheStore options.maxEntrySize must be less than 2gb");this.#A=e.maxEntrySize}if(void 0!==e.maxCount){if("number"!=typeof e.maxCount||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("SqliteCacheStore options.maxCount must be a non-negative integer");this.#e=e.maxCount}}i||(i=A(99).DatabaseSync),this.#o=new i(e?.location??":memory:"),this.#o.exec("\n PRAGMA journal_mode = WAL;\n PRAGMA synchronous = NORMAL;\n PRAGMA temp_store = memory;\n PRAGMA optimize;\n\n CREATE TABLE IF NOT EXISTS cacheInterceptorV3 (\n -- Data specific to us\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n url TEXT NOT NULL,\n method TEXT NOT NULL,\n\n -- Data returned to the interceptor\n body BUF NULL,\n deleteAt INTEGER NOT NULL,\n statusCode INTEGER NOT NULL,\n statusMessage TEXT NOT NULL,\n headers TEXT NULL,\n cacheControlDirectives TEXT NULL,\n etag TEXT NULL,\n vary TEXT NULL,\n cachedAt INTEGER NOT NULL,\n staleAt INTEGER NOT NULL\n );\n\n CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV3_getValuesQuery ON cacheInterceptorV3(url, method, deleteAt);\n CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV3_deleteByUrlQuery ON cacheInterceptorV3(deleteAt);\n "),this.#a=this.#o.prepare("\n SELECT\n id,\n body,\n deleteAt,\n statusCode,\n statusMessage,\n headers,\n etag,\n cacheControlDirectives,\n vary,\n cachedAt,\n staleAt\n FROM cacheInterceptorV3\n WHERE\n url = ?\n AND method = ?\n ORDER BY\n deleteAt ASC\n "),this.#c=this.#o.prepare("\n UPDATE cacheInterceptorV3 SET\n body = ?,\n deleteAt = ?,\n statusCode = ?,\n statusMessage = ?,\n headers = ?,\n etag = ?,\n cacheControlDirectives = ?,\n cachedAt = ?,\n staleAt = ?\n WHERE\n id = ?\n "),this.#l=this.#o.prepare("\n INSERT INTO cacheInterceptorV3 (\n url,\n method,\n body,\n deleteAt,\n statusCode,\n statusMessage,\n headers,\n etag,\n cacheControlDirectives,\n vary,\n cachedAt,\n staleAt\n ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\n "),this.#g=this.#o.prepare("DELETE FROM cacheInterceptorV3 WHERE url = ?"),this.#d=this.#o.prepare("SELECT COUNT(*) AS total FROM cacheInterceptorV3"),this.#h=this.#o.prepare("DELETE FROM cacheInterceptorV3 WHERE deleteAt <= ?"),this.#u=this.#e===1/0?null:this.#o.prepare("\n DELETE FROM cacheInterceptorV3\n WHERE id IN (\n SELECT\n id\n FROM cacheInterceptorV3\n ORDER BY cachedAt DESC\n LIMIT ?\n )\n ")}close(){this.#o.close()}get(e){r(e);const t=this.#E(e);return t?{body:t.body?Buffer.from(t.body.buffer,t.body.byteOffset,t.body.byteLength):void 0,statusCode:t.statusCode,statusMessage:t.statusMessage,headers:t.headers?JSON.parse(t.headers):void 0,etag:t.etag?t.etag:void 0,vary:t.vary?JSON.parse(t.vary):void 0,cacheControlDirectives:t.cacheControlDirectives?JSON.parse(t.cacheControlDirectives):void 0,cachedAt:t.cachedAt,staleAt:t.staleAt,deleteAt:t.deleteAt}:void 0}set(e,t){r(e);const A=this.#I(e),s=Array.isArray(t.body)?Buffer.concat(t.body):t.body,n=s?.byteLength;if(n&&n>this.#A)return;const i=this.#E(e,!0);i?this.#c.run(s,t.deleteAt,t.statusCode,t.statusMessage,t.headers?JSON.stringify(t.headers):null,t.etag?t.etag:null,t.cacheControlDirectives?JSON.stringify(t.cacheControlDirectives):null,t.cachedAt,t.staleAt,i.id):(this.#Q(),this.#l.run(A,e.method,s,t.deleteAt,t.statusCode,t.statusMessage,t.headers?JSON.stringify(t.headers):null,t.etag?t.etag:null,t.cacheControlDirectives?JSON.stringify(t.cacheControlDirectives):null,t.vary?JSON.stringify(t.vary):null,t.cachedAt,t.staleAt))}createWriteStream(e,t){r(e),n(t);let A=0;const i=[],o=this;return new s({decodeStrings:!0,write(e,t,s){A+=e.byteLength,A<o.#A?i.push(e):this.destroy(),s()},final(A){o.set(e,{...t,body:i}),A()}})}delete(e){if("object"!=typeof e)throw new TypeError("expected key to be object, got "+typeof e);this.#g.run(this.#I(e))}#Q(){if(Number.isFinite(this.#e)&&this.size<=this.#e)return 0;{const e=this.#h.run(Date.now()).changes;if(e)return e}{const e=this.#u?.run(Math.max(Math.floor(.1*this.#e),1)).changes;if(e)return e}return 0}get size(){const{total:e}=this.#d.get();return e}#I(e){return`${e.origin}/${e.path}`}#E(e,t=!1){const A=this.#I(e),{headers:s,method:r}=e,n=this.#a.all(A,r);if(0===n.length)return;const i=Date.now();for(const e of n){if(i>=e.deleteAt&&!t)return;let A=!0;if(e.vary){const t=JSON.parse(e.vary);for(const e in t)if(!a(s[e],t[e])){A=!1;break}}if(A)return e}}}},1986:(e,t,A)=>{"use strict";const s=A(7030),r=A(4589),n=A(2858),{InvalidArgumentError:i}=A(4465);let o;const a=class{constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new FinalizationRegistry((e=>{if(this._sessionCache.size<this._maxCachedSessions)return;const t=this._sessionCache.get(e);void 0!==t&&void 0===t.deref()&&this._sessionCache.delete(e)}))}get(e){const t=this._sessionCache.get(e);return t?t.deref():null}set(e,t){0!==this._maxCachedSessions&&(this._sessionCache.set(e,new WeakRef(t)),this._sessionRegistry.register(t,e))}};e.exports=function({allowH2:e,maxCachedSessions:t,socketPath:c,timeout:l,session:h,...g}){if(null!=t&&(!Number.isInteger(t)||t<0))throw new i("maxCachedSessions must be a positive integer or zero");const d={path:c,...g},u=new a(null==t?100:t);return l=null==l?1e4:l,e=null!=e&&e,function({hostname:t,host:i,protocol:a,port:c,servername:g,localAddress:E,httpSocket:I},Q){let C;if("https:"===a){o||(o=A(1692));const s=(g=g||d.servername||n.getServerName(i)||null)||t;r(s);const a=h||u.get(s)||null;c=c||443,C=o.connect({highWaterMark:16384,...d,servername:g,session:a,localAddress:E,ALPNProtocols:e?["http/1.1","h2"]:["http/1.1"],socket:I,port:c,host:t}),C.on("session",(function(e){u.set(s,e)}))}else r(!I,"httpSocket can only be sent on TLS update"),c=c||80,C=s.connect({highWaterMark:65536,...d,localAddress:E,port:c,host:t});if(null==d.keepAlive||d.keepAlive){const e=void 0===d.keepAliveInitialDelay?6e4:d.keepAliveInitialDelay;C.setKeepAlive(!0,e)}const B=n.setupConnectTimeout(new WeakRef(C),{timeout:l,hostname:t,port:c});return C.setNoDelay(!0).once("https:"===a?"secureConnect":"connect",(function(){if(queueMicrotask(B),Q){const e=Q;Q=null,e(null,this)}})).on("error",(function(e){if(queueMicrotask(B),Q){const t=Q;Q=null,t(e)}})),C}}},9605:e=>{"use strict";const t=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"],A={};Object.setPrototypeOf(A,null);const s={};Object.setPrototypeOf(s,null);for(let e=0;e<t.length;++e){const s=t[e],r=s.toLowerCase();A[s]=A[r]=r}e.exports={wellknownHeaderNames:t,headerNameLowerCasedRecord:A,getHeaderNameAsBuffer:function(e){let t=s[e];return void 0===t&&(t=Buffer.from(e)),t}}},772:(e,t,A)=>{"use strict";const s=A(3053),r=A(7975),n=r.debuglog("undici"),i=r.debuglog("fetch"),o=r.debuglog("websocket"),a={beforeConnect:s.channel("undici:client:beforeConnect"),connected:s.channel("undici:client:connected"),connectError:s.channel("undici:client:connectError"),sendHeaders:s.channel("undici:client:sendHeaders"),create:s.channel("undici:request:create"),bodySent:s.channel("undici:request:bodySent"),bodyChunkSent:s.channel("undici:request:bodyChunkSent"),bodyChunkReceived:s.channel("undici:request:bodyChunkReceived"),headers:s.channel("undici:request:headers"),trailers:s.channel("undici:request:trailers"),error:s.channel("undici:request:error"),open:s.channel("undici:websocket:open"),close:s.channel("undici:websocket:close"),socketError:s.channel("undici:websocket:socket_error"),ping:s.channel("undici:websocket:ping"),pong:s.channel("undici:websocket:pong")};let c=!1;function l(e=n){c||(c=!0,s.subscribe("undici:client:beforeConnect",(t=>{const{connectParams:{version:A,protocol:s,port:r,host:n}}=t;e("connecting to %s%s using %s%s",n,r?`:${r}`:"",s,A)})),s.subscribe("undici:client:connected",(t=>{const{connectParams:{version:A,protocol:s,port:r,host:n}}=t;e("connected to %s%s using %s%s",n,r?`:${r}`:"",s,A)})),s.subscribe("undici:client:connectError",(t=>{const{connectParams:{version:A,protocol:s,port:r,host:n},error:i}=t;e("connection to %s%s using %s%s errored - %s",n,r?`:${r}`:"",s,A,i.message)})),s.subscribe("undici:client:sendHeaders",(t=>{const{request:{method:A,path:s,origin:r}}=t;e("sending request to %s %s%s",A,r,s)})))}let h=!1;let g=!1;(n.enabled||i.enabled)&&(l(i.enabled?i:n),function(e=n){h||(h=!0,s.subscribe("undici:request:headers",(t=>{const{request:{method:A,path:s,origin:r},response:{statusCode:n}}=t;e("received response to %s %s%s - HTTP %d",A,r,s,n)})),s.subscribe("undici:request:trailers",(t=>{const{request:{method:A,path:s,origin:r}}=t;e("trailers received from %s %s%s",A,r,s)})),s.subscribe("undici:request:error",(t=>{const{request:{method:A,path:s,origin:r},error:n}=t;e("request to %s %s%s errored - %s",A,r,s,n.message)})))}(i.enabled?i:n)),o.enabled&&(l(n.enabled?n:o),function(e=o){g||(g=!0,s.subscribe("undici:websocket:open",(t=>{const{address:{address:A,port:s}}=t;e("connection opened %s%s",A,s?`:${s}`:"")})),s.subscribe("undici:websocket:close",(t=>{const{websocket:A,code:s,reason:r}=t;e("closed connection to %s - %s %s",A.url,s,r)})),s.subscribe("undici:websocket:socket_error",(t=>{e("connection errored - %s",t.message)})),s.subscribe("undici:websocket:ping",(t=>{e("ping received")})),s.subscribe("undici:websocket:pong",(t=>{e("pong received")})))}(o)),e.exports={channels:a}},4465:e=>{"use strict";const t=Symbol.for("undici.error.UND_ERR");class A extends Error{constructor(e,t){super(e,t),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&!0===e[t]}get[t](){return!0}}const s=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT");class r extends A{constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&!0===e[s]}get[s](){return!0}}const n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT");class i extends A{constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&!0===e[n]}get[n](){return!0}}const o=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW");class a extends A{constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&!0===e[o]}get[o](){return!0}}const c=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT");class l extends A{constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](e){return e&&!0===e[c]}get[c](){return!0}}const h=Symbol.for("undici.error.UND_ERR_INVALID_ARG");class g extends A{constructor(e){super(e),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](e){return e&&!0===e[h]}get[h](){return!0}}const d=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE");class u extends A{constructor(e){super(e),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](e){return e&&!0===e[d]}get[d](){return!0}}const E=Symbol.for("undici.error.UND_ERR_ABORT");class I extends A{constructor(e){super(e),this.name="AbortError",this.message=e||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](e){return e&&!0===e[E]}get[E](){return!0}}const Q=Symbol.for("undici.error.UND_ERR_ABORTED");class C extends I{constructor(e){super(e),this.name="AbortError",this.message=e||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](e){return e&&!0===e[Q]}get[Q](){return!0}}const B=Symbol.for("undici.error.UND_ERR_INFO");class p extends A{constructor(e){super(e),this.name="InformationalError",this.message=e||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](e){return e&&!0===e[B]}get[B](){return!0}}const f=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH");class m extends A{constructor(e){super(e),this.name="RequestContentLengthMismatchError",this.message=e||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&!0===e[f]}get[f](){return!0}}const y=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH");class S extends A{constructor(e){super(e),this.name="ResponseContentLengthMismatchError",this.message=e||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&!0===e[y]}get[y](){return!0}}const D=Symbol.for("undici.error.UND_ERR_DESTROYED");class w extends A{constructor(e){super(e),this.name="ClientDestroyedError",this.message=e||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](e){return e&&!0===e[D]}get[D](){return!0}}const b=Symbol.for("undici.error.UND_ERR_CLOSED");class R extends A{constructor(e){super(e),this.name="ClientClosedError",this.message=e||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](e){return e&&!0===e[b]}get[b](){return!0}}const N=Symbol.for("undici.error.UND_ERR_SOCKET");class k extends A{constructor(e,t){super(e),this.name="SocketError",this.message=e||"Socket error",this.code="UND_ERR_SOCKET",this.socket=t}static[Symbol.hasInstance](e){return e&&!0===e[N]}get[N](){return!0}}const T=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED");class F extends A{constructor(e){super(e),this.name="NotSupportedError",this.message=e||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](e){return e&&!0===e[T]}get[T](){return!0}}const v=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM");class M extends A{constructor(e){super(e),this.name="MissingUpstreamError",this.message=e||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](e){return e&&!0===e[v]}get[v](){return!0}}const U=Symbol.for("undici.error.UND_ERR_HTTP_PARSER");class L extends Error{constructor(e,t,A){super(e),this.name="HTTPParserError",this.code=t?`HPE_${t}`:void 0,this.data=A?A.toString():void 0}static[Symbol.hasInstance](e){return e&&!0===e[U]}get[U](){return!0}}const H=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE");class x extends A{constructor(e){super(e),this.name="ResponseExceededMaxSizeError",this.message=e||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](e){return e&&!0===e[H]}get[H](){return!0}}const Y=Symbol.for("undici.error.UND_ERR_REQ_RETRY");class P extends A{constructor(e,t,{headers:A,data:s}){super(e),this.name="RequestRetryError",this.message=e||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=t,this.data=s,this.headers=A}static[Symbol.hasInstance](e){return e&&!0===e[Y]}get[Y](){return!0}}const V=Symbol.for("undici.error.UND_ERR_RESPONSE");class O extends A{constructor(e,t,{headers:A,body:s}){super(e),this.name="ResponseError",this.message=e||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=t,this.body=s,this.headers=A}static[Symbol.hasInstance](e){return e&&!0===e[V]}get[V](){return!0}}const G=Symbol.for("undici.error.UND_ERR_PRX_TLS");class J extends A{constructor(e,t,A={}){super(t,{cause:e,...A}),this.name="SecureProxyConnectionError",this.message=t||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=e}static[Symbol.hasInstance](e){return e&&!0===e[G]}get[G](){return!0}}const W=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED");class _ extends A{constructor(e){super(e),this.name="MaxOriginsReachedError",this.message=e||"Maximum allowed origins reached",this.code="UND_ERR_MAX_ORIGINS_REACHED"}static[Symbol.hasInstance](e){return e&&!0===e[W]}get[W](){return!0}}e.exports={AbortError:I,HTTPParserError:L,UndiciError:A,HeadersTimeoutError:i,HeadersOverflowError:a,BodyTimeoutError:l,RequestContentLengthMismatchError:m,ConnectTimeoutError:r,InvalidArgumentError:g,InvalidReturnValueError:u,RequestAbortedError:C,ClientDestroyedError:w,ClientClosedError:R,InformationalError:p,SocketError:k,NotSupportedError:F,ResponseContentLengthMismatchError:S,BalancedPoolMissingUpstreamError:M,ResponseExceededMaxSizeError:x,RequestRetryError:P,ResponseError:O,SecureProxyConnectionError:J,MaxOriginsReachedError:_}},5837:(e,t,A)=>{"use strict";const{InvalidArgumentError:s,NotSupportedError:r}=A(4465),n=A(4589),{isValidHTTPToken:i,isValidHeaderValue:o,isStream:a,destroy:c,isBuffer:l,isFormDataLike:h,isIterable:g,isBlobLike:d,serializePathWithQuery:u,assertRequestHandler:E,getServerName:I,normalizedMethodRecords:Q,getProtocolFromUrlString:C}=A(2858),{channels:B}=A(772),{headerNameLowerCasedRecord:p}=A(9605),f=/[^\u0021-\u00ff]/,m=Symbol("handler");function y(e,t,A){if(A&&"object"==typeof A&&!Array.isArray(A))throw new s(`invalid ${t} header`);if(void 0===A)return;let n=p[t];if(void 0===n&&(n=t.toLowerCase(),void 0===p[n]&&!i(n)))throw new s("invalid header key");if(Array.isArray(A)){const e=[];for(let r=0;r<A.length;r++)if("string"==typeof A[r]){if(!o(A[r]))throw new s(`invalid ${t} header`);e.push(A[r])}else if(null===A[r])e.push("");else{if("object"==typeof A[r])throw new s(`invalid ${t} header`);e.push(`${A[r]}`)}A=e}else if("string"==typeof A){if(!o(A))throw new s(`invalid ${t} header`)}else A=null===A?"":`${A}`;if(null===e.host&&"host"===n){if("string"!=typeof A)throw new s("invalid host header");e.host=A}else if(null===e.contentLength&&"content-length"===n){if(e.contentLength=parseInt(A,10),!Number.isFinite(e.contentLength))throw new s("invalid content-length header")}else if(null===e.contentType&&"content-type"===n)e.contentType=A,e.headers.push(t,A);else{if("transfer-encoding"===n||"keep-alive"===n||"upgrade"===n)throw new s(`invalid ${n} header`);if("connection"===n){const t="string"==typeof A?A.toLowerCase():null;if("close"!==t&&"keep-alive"!==t)throw new s("invalid connection header");"close"===t&&(e.reset=!0)}else{if("expect"===n)throw new r("expect header not supported");e.headers.push(t,A)}}}e.exports=class{constructor(e,{path:t,method:A,body:r,headers:n,query:o,idempotent:p,blocking:S,upgrade:D,headersTimeout:w,bodyTimeout:b,reset:R,expectContinue:N,servername:k,throwOnError:T,maxRedirections:F},v){if("string"!=typeof t)throw new s("path must be a string");if("/"!==t[0]&&!t.startsWith("http://")&&!t.startsWith("https://")&&"CONNECT"!==A)throw new s("path must be an absolute URL or start with a slash");if(f.test(t))throw new s("invalid request path");if("string"!=typeof A)throw new s("method must be a string");if(void 0===Q[A]&&!i(A))throw new s("invalid request method");if(D&&"string"!=typeof D)throw new s("upgrade must be a string");if(null!=w&&(!Number.isFinite(w)||w<0))throw new s("invalid headersTimeout");if(null!=b&&(!Number.isFinite(b)||b<0))throw new s("invalid bodyTimeout");if(null!=R&&"boolean"!=typeof R)throw new s("invalid reset");if(null!=N&&"boolean"!=typeof N)throw new s("invalid expectContinue");if(null!=T)throw new s("invalid throwOnError");if(null!=F&&0!==F)throw new s("maxRedirections is not supported, use the redirect interceptor");if(this.headersTimeout=w,this.bodyTimeout=b,this.method=A,this.abort=null,null==r)this.body=null;else if(a(r)){this.body=r;const e=this.body._readableState;e&&e.autoDestroy||(this.endHandler=function(){c(this)},this.body.on("end",this.endHandler)),this.errorHandler=e=>{this.abort?this.abort(e):this.error=e},this.body.on("error",this.errorHandler)}else if(l(r))this.body=r.byteLength?r:null;else if(ArrayBuffer.isView(r))this.body=r.buffer.byteLength?Buffer.from(r.buffer,r.byteOffset,r.byteLength):null;else if(r instanceof ArrayBuffer)this.body=r.byteLength?Buffer.from(r):null;else if("string"==typeof r)this.body=r.length?Buffer.from(r):null;else{if(!(h(r)||g(r)||d(r)))throw new s("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");this.body=r}if(this.completed=!1,this.aborted=!1,this.upgrade=D||null,this.path=o?u(t,o):t,this.origin=e,this.protocol=C(e),this.idempotent=null==p?"HEAD"===A||"GET"===A:p,this.blocking=S??"HEAD"!==this.method,this.reset=null==R?null:R,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=null!=N&&N,Array.isArray(n)){if(n.length%2!=0)throw new s("headers array must be even");for(let e=0;e<n.length;e+=2)y(this,n[e],n[e+1])}else if(n&&"object"==typeof n)if(n[Symbol.iterator])for(const e of n){if(!Array.isArray(e)||2!==e.length)throw new s("headers must be in key-value pair format");y(this,e[0],e[1])}else{const e=Object.keys(n);for(let t=0;t<e.length;++t)y(this,e[t],n[e[t]])}else if(null!=n)throw new s("headers must be an object or an array");E(v,A,D),this.servername=k||I(this.host)||null,this[m]=v,B.create.hasSubscribers&&B.create.publish({request:this})}onBodySent(e){if(B.bodyChunkSent.hasSubscribers&&B.bodyChunkSent.publish({request:this,chunk:e}),this[m].onBodySent)try{return this[m].onBodySent(e)}catch(e){this.abort(e)}}onRequestSent(){if(B.bodySent.hasSubscribers&&B.bodySent.publish({request:this}),this[m].onRequestSent)try{return this[m].onRequestSent()}catch(e){this.abort(e)}}onConnect(e){if(n(!this.aborted),n(!this.completed),!this.error)return this.abort=e,this[m].onConnect(e);e(this.error)}onResponseStarted(){return this[m].onResponseStarted?.()}onHeaders(e,t,A,s){n(!this.aborted),n(!this.completed),B.headers.hasSubscribers&&B.headers.publish({request:this,response:{statusCode:e,headers:t,statusText:s}});try{return this[m].onHeaders(e,t,A,s)}catch(e){this.abort(e)}}onData(e){n(!this.aborted),n(!this.completed),B.bodyChunkReceived.hasSubscribers&&B.bodyChunkReceived.publish({request:this,chunk:e});try{return this[m].onData(e)}catch(e){return this.abort(e),!1}}onUpgrade(e,t,A){return n(!this.aborted),n(!this.completed),this[m].onUpgrade(e,t,A)}onComplete(e){this.onFinally(),n(!this.aborted),n(!this.completed),this.completed=!0,B.trailers.hasSubscribers&&B.trailers.publish({request:this,trailers:e});try{return this[m].onComplete(e)}catch(e){this.onError(e)}}onError(e){if(this.onFinally(),B.error.hasSubscribers&&B.error.publish({request:this,error:e}),!this.aborted)return this.aborted=!0,this[m].onError(e)}onFinally(){this.errorHandler&&(this.body.off("error",this.errorHandler),this.errorHandler=null),this.endHandler&&(this.body.off("end",this.endHandler),this.endHandler=null)}addHeader(e,t){return y(this,e,t),this}}},257:e=>{"use strict";e.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent")}},1310:(e,t,A)=>{"use strict";const{wellknownHeaderNames:s,headerNameLowerCasedRecord:r}=A(9605);class n{value=null;left=null;middle=null;right=null;code;constructor(e,t,A){if(void 0===A||A>=e.length)throw new TypeError("Unreachable");if((this.code=e.charCodeAt(A))>127)throw new TypeError("key must be ascii string");e.length!==++A?this.middle=new n(e,t,A):this.value=t}add(e,t){const A=e.length;if(0===A)throw new TypeError("Unreachable");let s=0,r=this;for(;;){const i=e.charCodeAt(s);if(i>127)throw new TypeError("key must be ascii string");if(r.code===i){if(A===++s){r.value=t;break}if(null===r.middle){r.middle=new n(e,t,s);break}r=r.middle}else if(r.code<i){if(null===r.left){r.left=new n(e,t,s);break}r=r.left}else{if(null===r.right){r.right=new n(e,t,s);break}r=r.right}}}search(e){const t=e.length;let A=0,s=this;for(;null!==s&&A<t;){let r=e[A];for(r<=90&&r>=65&&(r|=32);null!==s;){if(r===s.code){if(t===++A)return s;s=s.middle;break}s=s.code<r?s.left:s.right}}return null}}class i{node=null;insert(e,t){null===this.node?this.node=new n(e,t,0):this.node.add(e,t)}lookup(e){return this.node?.search(e)?.value??null}}const o=new i;for(let e=0;e<s.length;++e){const t=r[s[e]];o.insert(t,t)}e.exports={TernarySearchTree:i,tree:o}},2858:(e,t,A)=>{"use strict";const s=A(4589),{kDestroyed:r,kBodyUsed:n,kListeners:i,kBody:o}=A(257),{IncomingMessage:a}=A(7067),c=A(7075),l=A(7030),{stringify:h}=A(1792),{EventEmitter:g}=A(8474),d=A(3801),{InvalidArgumentError:u,ConnectTimeoutError:E}=A(4465),{headerNameLowerCasedRecord:I}=A(9605),{tree:Q}=A(1310),[C,B]=process.versions.node.split(".",2).map((e=>Number(e)));class p{constructor(e){this[o]=e,this[n]=!1}async*[Symbol.asyncIterator](){s(!this[n],"disturbed"),this[n]=!0,yield*this[o]}}function f(){}function m(e){return e&&"object"==typeof e&&"function"==typeof e.pipe&&"function"==typeof e.on}function y(e){if(null===e)return!1;if(e instanceof Blob)return!0;if("object"!=typeof e)return!1;{const t=e[Symbol.toStringTag];return("Blob"===t||"File"===t)&&("stream"in e&&"function"==typeof e.stream||"arrayBuffer"in e&&"function"==typeof e.arrayBuffer)}}function S(e){return e.includes("?")||e.includes("#")}function D(e){const t=parseInt(e,10);return t===Number(e)&&t>=0&&t<=65535}function w(e){return null!=e&&"h"===e[0]&&"t"===e[1]&&"t"===e[2]&&"p"===e[3]&&(":"===e[4]||"s"===e[4]&&":"===e[5])}function b(e){if("string"==typeof e){if(!w((e=new URL(e)).origin||e.protocol))throw new u("Invalid URL protocol: the URL must start with `http:` or `https:`.");return e}if(!e||"object"!=typeof e)throw new u("Invalid URL: The URL argument must be a non-null object.");if(!(e instanceof URL)){if(null!=e.port&&""!==e.port&&!1===D(e.port))throw new u("Invalid URL: port must be a valid integer or a string representation of an integer.");if(null!=e.path&&"string"!=typeof e.path)throw new u("Invalid URL path: the path must be a string or null/undefined.");if(null!=e.pathname&&"string"!=typeof e.pathname)throw new u("Invalid URL pathname: the pathname must be a string or null/undefined.");if(null!=e.hostname&&"string"!=typeof e.hostname)throw new u("Invalid URL hostname: the hostname must be a string or null/undefined.");if(null!=e.origin&&"string"!=typeof e.origin)throw new u("Invalid URL origin: the origin must be a string or null/undefined.");if(!w(e.origin||e.protocol))throw new u("Invalid URL protocol: the URL must start with `http:` or `https:`.");const t=null!=e.port?e.port:"https:"===e.protocol?443:80;let A=null!=e.origin?e.origin:`${e.protocol||""}//${e.hostname||""}:${t}`,s=null!=e.path?e.path:`${e.pathname||""}${e.search||""}`;return"/"===A[A.length-1]&&(A=A.slice(0,A.length-1)),s&&"/"!==s[0]&&(s=`/${s}`),new URL(`${A}${s}`)}if(!w(e.origin||e.protocol))throw new u("Invalid URL protocol: the URL must start with `http:` or `https:`.");return e}function R(e){return!(null==e||"function"!=typeof e[Symbol.iterator]&&"function"!=typeof e[Symbol.asyncIterator])}function N(e){if(null==e)return 0;if(m(e)){const t=e._readableState;return t&&!1===t.objectMode&&!0===t.ended&&Number.isFinite(t.length)?t.length:null}return y(e)?null!=e.size?e.size:null:M(e)?e.byteLength:null}function k(e){return e&&!!(e.destroyed||e[r]||c.isDestroyed?.(e))}function T(e,t){null!=e&&m(e)&&!k(e)&&("function"==typeof e.destroy?(Object.getPrototypeOf(e).constructor===a&&(e.socket=null),e.destroy(t)):t&&queueMicrotask((()=>{e.emit("error",t)})),!0!==e.destroyed&&(e[r]=!0))}const F=/timeout=(\d+)/;function v(e){return"string"==typeof e?I[e]??e.toLowerCase():Q.lookup(e)??e.toString("latin1").toLowerCase()}function M(e){return e instanceof Uint8Array||Buffer.isBuffer(e)}function U(e){switch(e){case 34:case 40:case 41:case 44:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 123:case 125:return!1;default:return e>=33&&e<=126}}const L=/[^\t\x20-\x7e\x80-\xff]/;const H=/^bytes (\d+)-(\d+)\/(\d+)?$/;const x="win32"===process.platform?(e,t)=>{if(!t.timeout)return f;let A=null,s=null;const r=d.setFastTimeout((()=>{A=setImmediate((()=>{s=setImmediate((()=>Y(e.deref(),t)))}))}),t.timeout);return()=>{d.clearFastTimeout(r),clearImmediate(A),clearImmediate(s)}}:(e,t)=>{if(!t.timeout)return f;let A=null;const s=d.setFastTimeout((()=>{A=setImmediate((()=>{Y(e.deref(),t)}))}),t.timeout);return()=>{d.clearFastTimeout(s),clearImmediate(A)}};function Y(e,t){if(null==e)return;let A="Connect Timeout Error";Array.isArray(e.autoSelectFamilyAttemptedAddresses)?A+=` (attempted addresses: ${e.autoSelectFamilyAttemptedAddresses.join(", ")},`:A+=` (attempted address: ${t.hostname}:${t.port},`,A+=` timeout: ${t.timeout}ms)`,T(e,new E(A))}const P=Object.create(null);P.enumerable=!0;const V={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"},O={...V,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(V,null),Object.setPrototypeOf(O,null),e.exports={kEnumerableProperty:P,isDisturbed:function(e){return!(!e||!c.isDisturbed(e)&&!e[n])},isBlobLike:y,parseOrigin:function(e){if("/"!==(e=b(e)).pathname||e.search||e.hash)throw new u("invalid url");return e},parseURL:b,getServerName:function(e){if(!e)return null;s("string"==typeof e);const t=function(e){if("["===e[0]){const t=e.indexOf("]");return s(-1!==t),e.substring(1,t)}const t=e.indexOf(":");return-1===t?e:e.substring(0,t)}(e);return l.isIP(t)?"":t},isStream:m,isIterable:R,isAsyncIterable:function(e){return!(null==e||"function"!=typeof e[Symbol.asyncIterator])},isDestroyed:k,headerNameToString:v,bufferToLowerCasedHeaderName:function(e){return Q.lookup(e)??e.toString("latin1").toLowerCase()},addListener:function(e,t,A){return(e[i]??=[]).push([t,A]),e.on(t,A),e},removeAllListeners:function(e){if(null!=e[i]){for(const[t,A]of e[i])e.removeListener(t,A);e[i]=null}return e},errorRequest:function(e,t,A){try{t.onError(A),s(t.aborted)}catch(A){e.emit("error",A)}},parseRawHeaders:function(e){const t=e.length,A=new Array(t);let s,r,n=!1,i=-1,o=0;for(let a=0;a<t;a+=2)s=e[a],r=e[a+1],"string"!=typeof s&&(s=s.toString()),"string"!=typeof r&&(r=r.toString("utf8")),o=s.length,14!==o||"-"!==s[7]||"content-length"!==s&&"content-length"!==s.toLowerCase()?19!==o||"-"!==s[7]||"content-disposition"!==s&&"content-disposition"!==s.toLowerCase()||(i=a+1):n=!0,A[a]=s,A[a+1]=r;return n&&-1!==i&&(A[i]=Buffer.from(A[i]).toString("latin1")),A},encodeRawHeaders:function(e){if(!Array.isArray(e))throw new TypeError("expected headers to be an array");return e.map((e=>Buffer.from(e)))},parseHeaders:function(e,t){void 0===t&&(t={});for(let A=0;A<e.length;A+=2){const s=v(e[A]);let r=t[s];if(r)"string"==typeof r&&(r=[r],t[s]=r),r.push(e[A+1].toString("utf8"));else{const r=e[A+1];t[s]="string"==typeof r?r:Array.isArray(r)?r.map((e=>e.toString("utf8"))):r.toString("utf8")}}return"content-length"in t&&"content-disposition"in t&&(t["content-disposition"]=Buffer.from(t["content-disposition"]).toString("latin1")),t},parseKeepAliveTimeout:function(e){const t=e.match(F);return t?1e3*parseInt(t[1],10):null},destroy:T,bodyLength:N,deepClone:function(e){return JSON.parse(JSON.stringify(e))},ReadableStreamFrom:function(e){let t;return new ReadableStream({start(){t=e[Symbol.asyncIterator]()},pull(e){return t.next().then((({done:t,value:A})=>{if(t)queueMicrotask((()=>{e.close(),e.byobRequest?.respond(0)}));else{const t=Buffer.isBuffer(A)?A:Buffer.from(A);if(!t.byteLength)return this.pull(e);e.enqueue(new Uint8Array(t))}}))},cancel:()=>t.return(),type:"bytes"})},isBuffer:M,assertRequestHandler:function(e,t,A){if(!e||"object"!=typeof e)throw new u("handler must be an object");if("function"!=typeof e.onRequestStart){if("function"!=typeof e.onConnect)throw new u("invalid onConnect method");if("function"!=typeof e.onError)throw new u("invalid onError method");if("function"!=typeof e.onBodySent&&void 0!==e.onBodySent)throw new u("invalid onBodySent method");if(A||"CONNECT"===t){if("function"!=typeof e.onUpgrade)throw new u("invalid onUpgrade method")}else{if("function"!=typeof e.onHeaders)throw new u("invalid onHeaders method");if("function"!=typeof e.onData)throw new u("invalid onData method");if("function"!=typeof e.onComplete)throw new u("invalid onComplete method")}}},getSocketInfo:function(e){return{localAddress:e.localAddress,localPort:e.localPort,remoteAddress:e.remoteAddress,remotePort:e.remotePort,remoteFamily:e.remoteFamily,timeout:e.timeout,bytesWritten:e.bytesWritten,bytesRead:e.bytesRead}},isFormDataLike:function(e){return e&&"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&"FormData"===e[Symbol.toStringTag]},pathHasQueryOrFragment:S,serializePathWithQuery:function(e,t){if(S(e))throw new Error('Query params cannot be passed when url already contains "?" or "#".');const A=h(t);return A&&(e+="?"+A),e},addAbortListener:function(e,t){return"addEventListener"in e?(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)):(e.once("abort",t),()=>e.removeListener("abort",t))},isValidHTTPToken:function(e){if(0===e.length)return!1;for(let t=0;t<e.length;++t)if(!U(e.charCodeAt(t)))return!1;return!0},isValidHeaderValue:function(e){return!L.test(e)},isTokenCharCode:U,parseRangeHeader:function(e){if(null==e||""===e)return{start:0,end:null,size:null};const t=e?e.match(H):null;return t?{start:parseInt(t[1]),end:t[2]?parseInt(t[2]):null,size:t[3]?parseInt(t[3]):null}:null},normalizedMethodRecordsBase:V,normalizedMethodRecords:O,isValidPort:D,isHttpOrHttpsPrefixed:w,nodeMajor:C,nodeMinor:B,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:function(e){return m(e)?(0===N(e)&&e.on("data",(function(){s(!1)})),"boolean"!=typeof e.readableDidRead&&(e[n]=!1,g.prototype.on.call(e,"data",(function(){this[n]=!0}))),e):e&&"function"==typeof e.pipeTo||e&&"string"!=typeof e&&!ArrayBuffer.isView(e)&&R(e)?new p(e):e},setupConnectTimeout:x,getProtocolFromUrlString:function(e){if("h"===e[0]&&"t"===e[1]&&"t"===e[2]&&"p"===e[3])switch(e[4]){case":":return"http:";case"s":if(":"===e[5])return"https:"}return e.slice(0,e.indexOf(":")+1)}}},3315:(e,t,A)=>{"use strict";const{InvalidArgumentError:s,MaxOriginsReachedError:r}=A(4465),{kClients:n,kRunning:i,kClose:o,kDestroy:a,kDispatch:c,kUrl:l}=A(257),h=A(7779),g=A(8542),d=A(1167),u=A(2858),E=Symbol("onConnect"),I=Symbol("onDisconnect"),Q=Symbol("onConnectionError"),C=Symbol("onDrain"),B=Symbol("factory"),p=Symbol("options"),f=Symbol("origins");function m(e,t){return t&&1===t.connections?new d(e,t):new g(e,t)}e.exports=class extends h{constructor({factory:e=m,maxOrigins:t=1/0,connect:A,...r}={}){if("function"!=typeof e)throw new s("factory must be a function.");if(null!=A&&"function"!=typeof A&&"object"!=typeof A)throw new s("connect must be a function or an object");if("number"!=typeof t||Number.isNaN(t)||t<=0)throw new s("maxOrigins must be a number greater than 0");super(),A&&"function"!=typeof A&&(A={...A}),this[p]={...u.deepClone(r),maxOrigins:t,connect:A},this[B]=e,this[n]=new Map,this[f]=new Set,this[C]=(e,t)=>{this.emit("drain",e,[this,...t])},this[E]=(e,t)=>{this.emit("connect",e,[this,...t])},this[I]=(e,t,A)=>{this.emit("disconnect",e,[this,...t],A)},this[Q]=(e,t,A)=>{this.emit("connectionError",e,[this,...t],A)}}get[i](){let e=0;for(const{dispatcher:t}of this[n].values())e+=t[i];return e}[c](e,t){let A;if(!e.origin||!("string"==typeof e.origin||e.origin instanceof URL))throw new s("opts.origin must be a non-empty string or URL.");if(A=String(e.origin),this[f].size>=this[p].maxOrigins&&!this[f].has(A))throw new r;const i=this[n].get(A);let o=i&&i.dispatcher;if(!o){const t=e=>{const t=this[n].get(A);t&&(e&&(t.count-=1),t.count<=0&&(this[n].delete(A),t.dispatcher.close()),this[f].delete(A))};o=this[B](e.origin,this[p]).on("drain",this[C]).on("connect",((e,t)=>{const s=this[n].get(A);s&&(s.count+=1),this[E](e,t)})).on("disconnect",((e,A,s)=>{t(!0),this[I](e,A,s)})).on("connectionError",((e,A,s)=>{t(!1),this[Q](e,A,s)})),this[n].set(A,{count:0,dispatcher:o}),this[f].add(A)}return o.dispatch(e,t)}[o](){const e=[];for(const{dispatcher:t}of this[n].values())e.push(t.close());return this[n].clear(),Promise.all(e)}[a](e){const t=[];for(const{dispatcher:A}of this[n].values())t.push(A.destroy(e));return this[n].clear(),Promise.all(t)}get stats(){const e={};for(const{dispatcher:t}of this[n].values())t.stats&&(e[t[l].origin]=t.stats);return e}}},8055:(e,t,A)=>{"use strict";const{BalancedPoolMissingUpstreamError:s,InvalidArgumentError:r}=A(4465),{PoolBase:n,kClients:i,kNeedDrain:o,kAddClient:a,kRemoveClient:c,kGetDispatcher:l}=A(1694),h=A(8542),{kUrl:g}=A(257),{parseOrigin:d}=A(2858),u=Symbol("factory"),E=Symbol("options"),I=Symbol("kGreatestCommonDivisor"),Q=Symbol("kCurrentWeight"),C=Symbol("kIndex"),B=Symbol("kWeight"),p=Symbol("kMaxWeightPerServer"),f=Symbol("kErrorPenalty");function m(e,t){if(0===e)return t;for(;0!==t;){const A=t;t=e%t,e=A}return e}function y(e,t){return new h(e,t)}e.exports=class extends n{constructor(e=[],{factory:t=y,...A}={}){if("function"!=typeof t)throw new r("factory must be a function.");super(),this[E]=A,this[C]=-1,this[Q]=0,this[p]=this[E].maxWeightPerServer||100,this[f]=this[E].errorPenalty||15,Array.isArray(e)||(e=[e]),this[u]=t;for(const t of e)this.addUpstream(t);this._updateBalancedPoolStats()}addUpstream(e){const t=d(e).origin;if(this[i].find((e=>e[g].origin===t&&!0!==e.closed&&!0!==e.destroyed)))return this;const A=this[u](t,Object.assign({},this[E]));this[a](A),A.on("connect",(()=>{A[B]=Math.min(this[p],A[B]+this[f])})),A.on("connectionError",(()=>{A[B]=Math.max(1,A[B]-this[f]),this._updateBalancedPoolStats()})),A.on("disconnect",((...e)=>{const t=e[2];t&&"UND_ERR_SOCKET"===t.code&&(A[B]=Math.max(1,A[B]-this[f]),this._updateBalancedPoolStats())}));for(const e of this[i])e[B]=this[p];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let t=0;t<this[i].length;t++)e=m(this[i][t][B],e);this[I]=e}removeUpstream(e){const t=d(e).origin,A=this[i].find((e=>e[g].origin===t&&!0!==e.closed&&!0!==e.destroyed));return A&&this[c](A),this}get upstreams(){return this[i].filter((e=>!0!==e.closed&&!0!==e.destroyed)).map((e=>e[g].origin))}[l](){if(0===this[i].length)throw new s;if(!this[i].find((e=>!e[o]&&!0!==e.closed&&!0!==e.destroyed)))return;if(this[i].map((e=>e[o])).reduce(((e,t)=>e&&t),!0))return;let e=0,t=this[i].findIndex((e=>!e[o]));for(;e++<this[i].length;){this[C]=(this[C]+1)%this[i].length;const e=this[i][this[C]];if(e[B]>this[i][t][B]&&!e[o]&&(t=this[C]),0===this[C]&&(this[Q]=this[Q]-this[I],this[Q]<=0&&(this[Q]=this[p])),e[B]>=this[Q]&&!e[o])return e}return this[Q]=this[i][t][B],this[C]=t,this[i][t]}}},9355:(e,t,A)=>{"use strict";const s=A(4589),r=A(2858),{channels:n}=A(772),i=A(3801),{RequestContentLengthMismatchError:o,ResponseContentLengthMismatchError:a,RequestAbortedError:c,HeadersTimeoutError:l,HeadersOverflowError:h,SocketError:g,InformationalError:d,BodyTimeoutError:u,HTTPParserError:E,ResponseExceededMaxSizeError:I}=A(4465),{kUrl:Q,kReset:C,kClient:B,kParser:p,kBlocking:f,kRunning:m,kPending:y,kSize:S,kWriting:D,kQueue:w,kNoRef:b,kKeepAliveDefaultTimeout:R,kHostHeader:N,kPendingIdx:k,kRunningIdx:T,kError:F,kPipelining:v,kSocket:M,kKeepAliveTimeoutValue:U,kMaxHeadersSize:L,kKeepAliveMaxTimeout:H,kKeepAliveTimeoutThreshold:x,kHeadersTimeout:Y,kBodyTimeout:P,kStrictContentLength:V,kMaxRequests:O,kCounter:G,kMaxResponseSize:J,kOnError:W,kResume:_,kHTTPContext:q,kClosed:$}=A(257),X=A(4178),z=Buffer.alloc(0),Z=Buffer[Symbol.species],j=r.removeAllListeners;let K;let ee=null,te=null,Ae=null,se=0,re=null;class ne{constructor(e,t,{exports:A}){this.llhttp=A,this.ptr=this.llhttp.llhttp_alloc(X.TYPE.RESPONSE),this.client=e,this.socket=t,this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.statusCode=0,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[L],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[J]}setTimeout(e,t){e!==this.timeoutValue||1&t^1&this.timeoutType?(this.timeout&&(i.clearTimeout(this.timeout),this.timeout=null),e&&(1&t?this.timeout=i.setFastTimeout(ie,e,new WeakRef(this)):(this.timeout=setTimeout(ie,e,new WeakRef(this)),this.timeout?.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=t}resume(){!this.socket.destroyed&&this.paused&&(s(null!=this.ptr),s(null===te),this.llhttp.llhttp_resume(this.ptr),s(5===this.timeoutType),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||z),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){const e=this.socket.read();if(null===e)break;this.execute(e)}}execute(e){s(null===te),s(null!=this.ptr),s(!this.paused);const{socket:t,llhttp:A}=this;e.length>se&&(re&&A.free(re),se=4096*Math.ceil(e.length/4096),re=A.malloc(se)),new Uint8Array(A.memory.buffer,re,se).set(e);try{let s;try{Ae=e,te=this,s=A.llhttp_execute(this.ptr,re,e.length)}finally{te=null,Ae=null}if(s!==X.ERROR.OK){const r=e.subarray(A.llhttp_get_error_pos(this.ptr)-re);if(s===X.ERROR.PAUSED_UPGRADE)this.onUpgrade(r);else{if(s!==X.ERROR.PAUSED){const e=A.llhttp_get_error_reason(this.ptr);let t="";if(e){const s=new Uint8Array(A.memory.buffer,e).indexOf(0);t="Response does not match the HTTP/1.1 protocol ("+Buffer.from(A.memory.buffer,e,s).toString()+")"}throw new E(t,X.ERROR[s],r)}this.paused=!0,t.unshift(r)}}}catch(e){r.destroy(t,e)}}destroy(){s(null===te),s(null!=this.ptr),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&i.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){return this.statusText=e.toString(),0}onMessageBegin(){const{socket:e,client:t}=this;if(e.destroyed)return-1;const A=t[w][t[T]];return A?(A.onResponseStarted(),0):-1}onHeaderField(e){const t=this.headers.length;return 1&t?this.headers[t-1]=Buffer.concat([this.headers[t-1],e]):this.headers.push(e),this.trackHeader(e.length),0}onHeaderValue(e){let t=this.headers.length;1&~t?this.headers[t-1]=Buffer.concat([this.headers[t-1],e]):(this.headers.push(e),t+=1);const A=this.headers[t-2];if(10===A.length){const t=r.bufferToLowerCasedHeaderName(A);"keep-alive"===t?this.keepAlive+=e.toString():"connection"===t&&(this.connection+=e.toString())}else 14===A.length&&"content-length"===r.bufferToLowerCasedHeaderName(A)&&(this.contentLength+=e.toString());return this.trackHeader(e.length),0}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&r.destroy(this.socket,new h)}onUpgrade(e){const{upgrade:t,client:A,socket:n,headers:i,statusCode:o}=this;s(t),s(A[M]===n),s(!n.destroyed),s(!this.paused),s(!(1&i.length));const a=A[w][A[T]];s(a),s(a.upgrade||"CONNECT"===a.method),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,n.unshift(e),n[p].destroy(),n[p]=null,n[B]=null,n[F]=null,j(n),A[M]=null,A[q]=null,A[w][A[T]++]=null,A.emit("disconnect",A[Q],[A],new d("upgrade"));try{a.onUpgrade(o,i,n)}catch(e){r.destroy(n,e)}A[_]()}onHeadersComplete(e,t,A){const{client:n,socket:i,headers:o,statusText:a}=this;if(i.destroyed)return-1;const c=n[w][n[T]];if(!c)return-1;if(s(!this.upgrade),s(this.statusCode<200),100===e)return r.destroy(i,new g("bad response",r.getSocketInfo(i))),-1;if(t&&!c.upgrade)return r.destroy(i,new g("bad upgrade",r.getSocketInfo(i))),-1;if(s(3===this.timeoutType),this.statusCode=e,this.shouldKeepAlive=A||"HEAD"===c.method&&!i[C]&&"keep-alive"===this.connection.toLowerCase(),this.statusCode>=200){const e=null!=c.bodyTimeout?c.bodyTimeout:n[P];this.setTimeout(e,5)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if("CONNECT"===c.method)return s(1===n[m]),this.upgrade=!0,2;if(t)return s(1===n[m]),this.upgrade=!0,2;if(s(!(1&this.headers.length)),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&n[v]){const e=this.keepAlive?r.parseKeepAliveTimeout(this.keepAlive):null;if(null!=e){const t=Math.min(e-n[x],n[H]);t<=0?i[C]=!0:n[U]=t}else n[U]=n[R]}else i[C]=!0;const l=!1===c.onHeaders(e,o,this.resume,a);return c.aborted?-1:"HEAD"===c.method||e<200?1:(i[f]&&(i[f]=!1,n[_]()),l?X.ERROR.PAUSED:0)}onBody(e){const{client:t,socket:A,statusCode:n,maxResponseSize:i}=this;if(A.destroyed)return-1;const o=t[w][t[T]];return s(o),s(5===this.timeoutType),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),s(n>=200),i>-1&&this.bytesRead+e.length>i?(r.destroy(A,new I),-1):(this.bytesRead+=e.length,!1===o.onData(e)?X.ERROR.PAUSED:0)}onMessageComplete(){const{client:e,socket:t,statusCode:A,upgrade:n,headers:i,contentLength:o,bytesRead:c,shouldKeepAlive:l}=this;if(t.destroyed&&(!A||l))return-1;if(n)return 0;s(A>=100),s(!(1&this.headers.length));const h=e[w][e[T]];return s(h),this.statusCode=0,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,A<200?0:"HEAD"!==h.method&&o&&c!==parseInt(o,10)?(r.destroy(t,new a),-1):(h.onComplete(i),e[w][e[T]++]=null,t[D]?(s(0===e[m]),r.destroy(t,new d("reset")),X.ERROR.PAUSED):l?t[C]&&0===e[m]?(r.destroy(t,new d("reset")),X.ERROR.PAUSED):(null==e[v]||1===e[v]?setImmediate(e[_]):e[_](),0):(r.destroy(t,new d("reset")),X.ERROR.PAUSED))}}function ie(e){const{socket:t,timeoutType:A,client:n,paused:i}=e.deref();3===A?(!t[D]||t.writableNeedDrain||n[m]>1)&&(s(!i,"cannot be paused while waiting for headers"),r.destroy(t,new l)):5===A?i||r.destroy(t,new u):8===A&&(s(0===n[m]&&n[U]),r.destroy(t,new d("socket idle timeout")))}function oe(e){s("ERR_TLS_CERT_ALTNAME_INVALID"!==e.code);const t=this[p];"ECONNRESET"!==e.code||!t.statusCode||t.shouldKeepAlive?(this[F]=e,this[B][W](e)):t.onMessageComplete()}function ae(){this[p]?.readMore()}function ce(){const e=this[p];!e.statusCode||e.shouldKeepAlive?r.destroy(this,new g("other side closed",r.getSocketInfo(this))):e.onMessageComplete()}function le(){const e=this[p];e&&(this[F]||!e.statusCode||e.shouldKeepAlive||e.onMessageComplete(),this[p].destroy(),this[p]=null);const t=this[F]||new g("closed",r.getSocketInfo(this)),A=this[B];if(A[M]=null,A[q]=null,A.destroyed){s(0===A[y]);const e=A[w].splice(A[T]);for(let s=0;s<e.length;s++){const n=e[s];r.errorRequest(A,n,t)}}else if(A[m]>0&&"UND_ERR_INFO"!==t.code){const e=A[w][A[T]];A[w][A[T]++]=null,r.errorRequest(A,e,t)}A[k]=A[T],s(0===A[m]),A.emit("disconnect",A[Q],[A],t),A[_]()}function he(){this[$]=!0}function ge(e,t,A,n,i,o,a,c){try{t?r.isBuffer(t)&&(s(o===t.byteLength,"buffer body must have content length"),i.cork(),i.write(`${a}content-length: ${o}\r\n\r\n`,"latin1"),i.write(t),i.uncork(),n.onBodySent(t),c||!1===n.reset||(i[C]=!0)):0===o?i.write(`${a}content-length: 0\r\n\r\n`,"latin1"):(s(null===o,"no body must not have content length"),i.write(`${a}\r\n`,"latin1")),n.onRequestSent(),A[_]()}catch(t){e(t)}}async function de(e,t,A,r,n,i,o,a){s(0!==i||0===A[m],"iterator body cannot be pipelined");let c=null;function l(){if(c){const e=c;c=null,e()}}n.on("close",l).on("drain",l);const h=new ue({abort:e,socket:n,request:r,contentLength:i,client:A,expectsPayload:a,header:o});try{for await(const e of t){if(n[F])throw n[F];h.write(e)||await new Promise(((e,t)=>{s(null===c),n[F]?t(n[F]):c=e}))}h.end()}catch(e){h.destroy(e)}finally{n.off("close",l).off("drain",l)}}class ue{constructor({abort:e,socket:t,request:A,contentLength:s,client:r,expectsPayload:n,header:i}){this.socket=t,this.request=A,this.contentLength=s,this.client=r,this.bytesWritten=0,this.expectsPayload=n,this.header=i,this.abort=e,t[D]=!0}write(e){const{socket:t,request:A,contentLength:s,client:r,bytesWritten:n,expectsPayload:i,header:a}=this;if(t[F])throw t[F];if(t.destroyed)return!1;const c=Buffer.byteLength(e);if(!c)return!0;if(null!==s&&n+c>s){if(r[V])throw new o;process.emitWarning(new o)}t.cork(),0===n&&(i||!1===A.reset||(t[C]=!0),null===s?t.write(`${a}transfer-encoding: chunked\r\n`,"latin1"):t.write(`${a}content-length: ${s}\r\n\r\n`,"latin1")),null===s&&t.write(`\r\n${c.toString(16)}\r\n`,"latin1"),this.bytesWritten+=c;const l=t.write(e);return t.uncork(),A.onBodySent(e),l||t[p].timeout&&3===t[p].timeoutType&&t[p].timeout.refresh&&t[p].timeout.refresh(),l}end(){const{socket:e,contentLength:t,client:A,bytesWritten:s,expectsPayload:r,header:n,request:i}=this;if(i.onRequestSent(),e[D]=!1,e[F])throw e[F];if(!e.destroyed){if(0===s?r?e.write(`${n}content-length: 0\r\n\r\n`,"latin1"):e.write(`${n}\r\n`,"latin1"):null===t&&e.write("\r\n0\r\n\r\n","latin1"),null!==t&&s!==t){if(A[V])throw new o;process.emitWarning(new o)}e[p].timeout&&3===e[p].timeoutType&&e[p].timeout.refresh&&e[p].timeout.refresh(),A[_]()}}destroy(e){const{socket:t,client:A,abort:r}=this;t[D]=!1,e&&(s(A[m]<=1,"pipeline should only contain this request"),r(e))}}e.exports=function(e,t){if(e[M]=t,ee||(ee=function(){const e=process.env.JEST_WORKER_ID?A(4744):void 0;let t,r="ppc64"!==process.arch;if("1"===process.env.UNDICI_NO_WASM_SIMD?r=!0:"0"===process.env.UNDICI_NO_WASM_SIMD&&(r=!1),r)try{t=new WebAssembly.Module(A(7136))}catch{}return t||(t=new WebAssembly.Module(e||A(4744))),new WebAssembly.Instance(t,{env:{wasm_on_url:(e,t,A)=>0,wasm_on_status:(e,t,A)=>{s(te.ptr===e);const r=t-re+Ae.byteOffset;return te.onStatus(new Z(Ae.buffer,r,A))},wasm_on_message_begin:e=>(s(te.ptr===e),te.onMessageBegin()),wasm_on_header_field:(e,t,A)=>{s(te.ptr===e);const r=t-re+Ae.byteOffset;return te.onHeaderField(new Z(Ae.buffer,r,A))},wasm_on_header_value:(e,t,A)=>{s(te.ptr===e);const r=t-re+Ae.byteOffset;return te.onHeaderValue(new Z(Ae.buffer,r,A))},wasm_on_headers_complete:(e,t,A,r)=>(s(te.ptr===e),te.onHeadersComplete(t,1===A,1===r)),wasm_on_body:(e,t,A)=>{s(te.ptr===e);const r=t-re+Ae.byteOffset;return te.onBody(new Z(Ae.buffer,r,A))},wasm_on_message_complete:e=>(s(te.ptr===e),te.onMessageComplete())}})}()),t.errored)throw t.errored;if(t.destroyed)throw new g("destroyed");return t[b]=!1,t[D]=!1,t[C]=!1,t[f]=!1,t[p]=new ne(e,t,ee),r.addListener(t,"error",oe),r.addListener(t,"readable",ae),r.addListener(t,"end",ce),r.addListener(t,"close",le),t[$]=!1,t.on("close",he),{version:"h1",defaultPipelining:1,write:t=>function(e,t){const{method:i,path:a,host:l,upgrade:h,blocking:g,reset:u}=t;let{body:E,headers:I,contentLength:Q}=t;const B="PUT"===i||"POST"===i||"PATCH"===i||"QUERY"===i||"PROPFIND"===i||"PROPPATCH"===i;if(r.isFormDataLike(E)){K||(K=A(2530).extractBody);const[e,s]=K(E);null==t.contentType&&I.push("content-type",s),E=e.stream,Q=e.length}else r.isBlobLike(E)&&null==t.contentType&&E.type&&I.push("content-type",E.type);E&&"function"==typeof E.read&&E.read(0);const p=r.bodyLength(E);Q=p??Q,null===Q&&(Q=t.contentLength);0!==Q||B||(Q=null);if(function(e){return"GET"!==e&&"HEAD"!==e&&"OPTIONS"!==e&&"TRACE"!==e&&"CONNECT"!==e}(i)&&Q>0&&null!==t.contentLength&&t.contentLength!==Q){if(e[V])return r.errorRequest(e,t,new o),!1;process.emitWarning(new o)}const y=e[M],S=A=>{t.aborted||t.completed||(r.errorRequest(e,t,A||new c),r.destroy(E),r.destroy(y,new d("aborted")))};try{t.onConnect(S)}catch(A){r.errorRequest(e,t,A)}if(t.aborted)return!1;"HEAD"===i&&(y[C]=!0);(h||"CONNECT"===i)&&(y[C]=!0);null!=u&&(y[C]=u);e[O]&&y[G]++>=e[O]&&(y[C]=!0);g&&(y[f]=!0);let w=`${i} ${a} HTTP/1.1\r\n`;w+="string"==typeof l?`host: ${l}\r\n`:e[N];h?w+=`connection: upgrade\r\nupgrade: ${h}\r\n`:e[v]&&!y[C]?w+="connection: keep-alive\r\n":w+="connection: close\r\n";if(Array.isArray(I))for(let e=0;e<I.length;e+=2){const t=I[e+0],A=I[e+1];if(Array.isArray(A))for(let e=0;e<A.length;e++)w+=`${t}: ${A[e]}\r\n`;else w+=`${t}: ${A}\r\n`}n.sendHeaders.hasSubscribers&&n.sendHeaders.publish({request:t,headers:w,socket:y});E&&0!==p?r.isBuffer(E)?ge(S,E,e,t,y,Q,w,B):r.isBlobLike(E)?"function"==typeof E.stream?de(S,E.stream(),e,t,y,Q,w,B):async function(e,t,A,r,n,i,a,c){s(i===t.size,"blob body must have content length");try{if(null!=i&&i!==t.size)throw new o;const e=Buffer.from(await t.arrayBuffer());n.cork(),n.write(`${a}content-length: ${i}\r\n\r\n`,"latin1"),n.write(e),n.uncork(),r.onBodySent(e),r.onRequestSent(),c||!1===r.reset||(n[C]=!0),A[_]()}catch(t){e(t)}}(S,E,e,t,y,Q,w,B):r.isStream(E)?function(e,t,A,n,i,o,a,l){s(0!==o||0===A[m],"stream body cannot be pipelined");let h=!1;const g=new ue({abort:e,socket:i,request:n,contentLength:o,client:A,expectsPayload:l,header:a}),d=function(e){if(!h)try{!g.write(e)&&this.pause&&this.pause()}catch(e){r.destroy(this,e)}},u=function(){h||t.resume&&t.resume()},E=function(){if(queueMicrotask((()=>{t.removeListener("error",I)})),!h){const e=new c;queueMicrotask((()=>I(e)))}},I=function(e){if(!h){if(h=!0,s(i.destroyed||i[D]&&A[m]<=1),i.off("drain",u).off("error",I),t.removeListener("data",d).removeListener("end",I).removeListener("close",E),!e)try{g.end()}catch(t){e=t}g.destroy(e),!e||"UND_ERR_INFO"===e.code&&"reset"===e.message?r.destroy(t):r.destroy(t,e)}};t.on("data",d).on("end",I).on("error",I).on("close",E),t.resume&&t.resume();i.on("drain",u).on("error",I),t.errorEmitted??t.errored?setImmediate(I,t.errored):(t.endEmitted??t.readableEnded)&&setImmediate(I,null);(t.closeEmitted??t.closed)&&setImmediate(E)}(S,E,e,t,y,Q,w,B):r.isIterable(E)?de(S,E,e,t,y,Q,w,B):s(!1):ge(S,null,e,t,y,Q,w,B);return!0}(e,t),resume(){!function(e){const t=e[M];if(t&&!t.destroyed)if(0===e[S]?!t[b]&&t.unref&&(t.unref(),t[b]=!0):t[b]&&t.ref&&(t.ref(),t[b]=!1),0===e[S])8!==t[p].timeoutType&&t[p].setTimeout(e[U],8);else if(e[m]>0&&t[p].statusCode<200&&3!==t[p].timeoutType){const A=e[w][e[T]],s=null!=A.headersTimeout?A.headersTimeout:e[Y];t[p].setTimeout(s,3)}}(e)},destroy(e,A){t[$]?queueMicrotask(A):(t.on("close",A),t.destroy(e))},get destroyed(){return t.destroyed},busy(A){if(t[D]||t[C]||t[f])return!0;if(A){if(e[m]>0&&!A.idempotent)return!0;if(e[m]>0&&(A.upgrade||"CONNECT"===A.method))return!0;if(e[m]>0&&0!==r.bodyLength(A.body)&&(r.isStream(A.body)||r.isAsyncIterable(A.body)||r.isFormDataLike(A.body)))return!0}return!1}}}},8142:(e,t,A)=>{"use strict";const s=A(4589),{pipeline:r}=A(7075),n=A(2858),{RequestContentLengthMismatchError:i,RequestAbortedError:o,SocketError:a,InformationalError:c}=A(4465),{kUrl:l,kReset:h,kClient:g,kRunning:d,kPending:u,kQueue:E,kPendingIdx:I,kRunningIdx:Q,kError:C,kSocket:B,kStrictContentLength:p,kOnError:f,kMaxConcurrentStreams:m,kHTTP2Session:y,kResume:S,kSize:D,kHTTPContext:w,kClosed:b,kBodyTimeout:R}=A(257),{channels:N}=A(772),k=Symbol("open streams");let T,F;try{F=A(2467)}catch{F={constants:{}}}const{constants:{HTTP2_HEADER_AUTHORITY:v,HTTP2_HEADER_METHOD:M,HTTP2_HEADER_PATH:U,HTTP2_HEADER_SCHEME:L,HTTP2_HEADER_CONTENT_LENGTH:H,HTTP2_HEADER_EXPECT:x,HTTP2_HEADER_STATUS:Y}}=F;function P(e){s("ERR_TLS_CERT_ALTNAME_INVALID"!==e.code),this[B][C]=e,this[g][f](e)}function V(e,t,A){if(0===A){const A=new c(`HTTP/2: "frameError" received - type ${e}, code ${t}`);this[B][C]=A,this[g][f](A)}}function O(){const e=new a("other side closed",n.getSocketInfo(this[B]));this.destroy(e),n.destroy(this[B],e)}function G(e){const t=this[C]||new a(`HTTP/2: "GOAWAY" frame received with code ${e}`,n.getSocketInfo(this[B])),A=this[g];if(A[B]=null,A[w]=null,this.close(),this[y]=null,n.destroy(this[B],t),A[Q]<A[E].length){const e=A[E][A[Q]];A[E][A[Q]++]=null,n.errorRequest(A,e,t),A[I]=A[Q]}s(0===A[d]),A.emit("disconnect",A[l],[A],t),A.emit("connectionError",A[l],[A],t),A[S]()}function J(){const{[g]:e}=this,{[B]:t}=e,A=this[B][C]||this[C]||new a("closed",n.getSocketInfo(t));if(e[B]=null,e[w]=null,e.destroyed){s(0===e[u]);const t=e[E].splice(e[Q]);for(let s=0;s<t.length;s++){const r=t[s];n.errorRequest(e,r,A)}}}function W(){const e=this[C]||new a("closed",n.getSocketInfo(this)),t=this[y][g];t[B]=null,t[w]=null,null!==this[y]&&this[y].destroy(e),t[I]=t[Q],s(0===t[d]),t.emit("disconnect",t[l],[t],e),t[S]()}function _(e){s("ERR_TLS_CERT_ALTNAME_INVALID"!==e.code),this[C]=e,this[g][f](e)}function q(){n.destroy(this,new a("other side closed",n.getSocketInfo(this)))}function $(){this[b]=!0}function X(e,t,A,r,i,o,a,c){try{null!=A&&n.isBuffer(A)&&(s(a===A.byteLength,"buffer body must have content length"),t.cork(),t.write(A),t.uncork(),t.end(),i.onBodySent(A)),c||(o[h]=!0),i.onRequestSent(),r[S]()}catch(t){e(t)}}async function z(e,t,A,r,n,i,o,a){s(0!==o||0===r[d],"iterator body cannot be pipelined");let c=null;function l(){if(c){const e=c;c=null,e()}}t.on("close",l).on("drain",l);try{for await(const e of A){if(i[C])throw i[C];const A=t.write(e);n.onBodySent(e),A||await new Promise(((e,t)=>{s(null===c),i[C]?t(i[C]):c=e}))}t.end(),n.onRequestSent(),a||(i[h]=!0),r[S]()}catch(t){e(t)}finally{t.off("close",l).off("drain",l)}}e.exports=function(e,t){e[B]=t;const a=F.connect(e[l],{createConnection:()=>t,peerMaxConcurrentStreams:e[m],settings:{enablePush:!1}});return a[k]=0,a[g]=e,a[B]=t,a[y]=null,n.addListener(a,"error",P),n.addListener(a,"frameError",V),n.addListener(a,"end",O),n.addListener(a,"goaway",G),n.addListener(a,"close",J),a.unref(),e[y]=a,t[y]=a,n.addListener(t,"error",_),n.addListener(t,"end",q),n.addListener(t,"close",W),t[b]=!1,t.on("close",$),{version:"h2",defaultPipelining:1/0,write:t=>function(e,t){const a=t.bodyTimeout??e[R],g=e[y],{method:u,path:C,host:m,upgrade:D,expectContinue:w,signal:b,protocol:F,headers:P}=t;let{body:V}=t;if(D)return n.errorRequest(e,t,new Error("Upgrade not supported for H2")),!1;const O={};for(let e=0;e<P.length;e+=2){const t=P[e+0],A=P[e+1];if("cookie"!==t)if(Array.isArray(A))for(let e=0;e<A.length;e++)O[t]?O[t]+=`, ${A[e]}`:O[t]=A[e];else O[t]?O[t]+=`, ${A}`:O[t]=A;else null!=O[t]?O[t]=Array.isArray(O[t])?(O[t].push(A),O[t]):[O[t],A]:O[t]=A}let G=null;const{hostname:J,port:W}=e[l];O[v]=m||`${J}${W?`:${W}`:""}`,O[M]=u;const _=A=>{t.aborted||t.completed||(A=A||new o,n.errorRequest(e,t,A),null!=G&&(G.removeAllListeners("data"),G.close(),e[f](A),e[S]()),n.destroy(V,A))};try{t.onConnect(_)}catch(A){n.errorRequest(e,t,A)}if(t.aborted)return!1;if("CONNECT"===u)return g.ref(),G=g.request(O,{endStream:!1,signal:b}),G.pending?G.once("ready",(()=>{t.onUpgrade(null,null,G),++g[k],e[E][e[Q]++]=null})):(t.onUpgrade(null,null,G),++g[k],e[E][e[Q]++]=null),G.once("close",(()=>{g[k]-=1,0===g[k]&&g.unref()})),G.setTimeout(a),!0;O[U]=C,O[L]="http:"===F?"http":"https";const q="PUT"===u||"POST"===u||"PATCH"===u;V&&"function"==typeof V.read&&V.read(0);let $=n.bodyLength(V);if(n.isFormDataLike(V)){T??=A(2530).extractBody;const[e,t]=T(V);O["content-type"]=t,V=e.stream,$=e.length}null==$&&($=t.contentLength);0!==$&&q||($=null);if(function(e){return"GET"!==e&&"HEAD"!==e&&"OPTIONS"!==e&&"TRACE"!==e&&"CONNECT"!==e}(u)&&$>0&&null!=t.contentLength&&t.contentLength!==$){if(e[p])return n.errorRequest(e,t,new i),!1;process.emitWarning(new i)}null!=$&&(s(V,"no body must not have content length"),O[H]=`${$}`);if(g.ref(),N.sendHeaders.hasSubscribers){let e="";for(const t in O)e+=`${t}: ${O[t]}\r\n`;N.sendHeaders.publish({request:t,headers:e,socket:g[B]})}const Z="GET"===u||"HEAD"===u||null===V;w?(O[x]="100-continue",G=g.request(O,{endStream:Z,signal:b}),G.once("continue",j)):(G=g.request(O,{endStream:Z,signal:b}),j());return++g[k],G.setTimeout(a),G.once("response",(e=>{const{[Y]:A,...s}=e;t.onResponseStarted(),t.aborted?G.removeAllListeners("data"):!1===t.onHeaders(Number(A),function(e){const t=[];for(const[A,s]of Object.entries(e))if(Array.isArray(s))for(const e of s)t.push(Buffer.from(A),Buffer.from(e));else t.push(Buffer.from(A),Buffer.from(s));return t}(s),G.resume.bind(G),"")&&G.pause()})),G.on("data",(e=>{!1===t.onData(e)&&G.pause()})),G.once("end",(A=>{G.removeAllListeners("data"),null==G.state?.state||G.state.state<6?(t.aborted||t.completed||t.onComplete({}),e[E][e[Q]++]=null,e[S]()):(--g[k],0===g[k]&&g.unref(),_(A??new c("HTTP/2: stream half-closed (remote)")),e[E][e[Q]++]=null,e[I]=e[Q],e[S]())})),G.once("close",(()=>{G.removeAllListeners("data"),g[k]-=1,0===g[k]&&g.unref()})),G.once("error",(function(e){G.removeAllListeners("data"),_(e)})),G.once("frameError",((e,t)=>{G.removeAllListeners("data"),_(new c(`HTTP/2: "frameError" received - type ${e}, code ${t}`))})),G.on("aborted",(()=>{G.removeAllListeners("data")})),G.on("timeout",(()=>{const e=new c(`HTTP/2: "stream timeout after ${a}"`);G.removeAllListeners("data"),g[k]-=1,0===g[k]&&g.unref(),_(e)})),G.once("trailers",(e=>{t.aborted||t.completed||t.onComplete(e)})),!0;function j(){V&&0!==$?n.isBuffer(V)?X(_,G,V,e,t,e[B],$,q):n.isBlobLike(V)?"function"==typeof V.stream?z(_,G,V.stream(),e,t,e[B],$,q):async function(e,t,A,r,n,o,a,c){s(a===A.size,"blob body must have content length");try{if(null!=a&&a!==A.size)throw new i;const e=Buffer.from(await A.arrayBuffer());t.cork(),t.write(e),t.uncork(),t.end(),n.onBodySent(e),n.onRequestSent(),c||(o[h]=!0),r[S]()}catch(t){e(t)}}(_,G,V,e,t,e[B],$,q):n.isStream(V)?function(e,t,A,i,o,a,c,l){s(0!==l||0===a[d],"stream body cannot be pipelined");const g=r(o,i,(s=>{s?(n.destroy(g,s),e(s)):(n.removeAllListeners(g),c.onRequestSent(),A||(t[h]=!0),a[S]())}));function u(e){c.onBodySent(e)}n.addListener(g,"data",u)}(_,e[B],q,G,V,e,t,$):n.isIterable(V)?z(_,G,V,e,t,e[B],$,q):s(!1):X(_,G,null,e,t,e[B],$,q)}}(e,t),resume(){!function(e){const t=e[B];!1===t?.destroyed&&(0===e[D]||0===e[m]?(t.unref(),e[y].unref()):(t.ref(),e[y].ref()))}(e)},destroy(e,A){t[b]?queueMicrotask(A):t.destroy(e).on("close",A)},get destroyed(){return t.destroyed},busy:()=>!1}}},1167:(e,t,A)=>{"use strict";const s=A(4589),r=A(7030),n=A(7067),i=A(2858),{ClientStats:o}=A(4304),{channels:a}=A(772),c=A(5837),l=A(7779),{InvalidArgumentError:h,InformationalError:g,ClientDestroyedError:d}=A(4465),u=A(1986),{kUrl:E,kServerName:I,kClient:Q,kBusy:C,kConnect:B,kResuming:p,kRunning:f,kPending:m,kSize:y,kQueue:S,kConnected:D,kConnecting:w,kNeedDrain:b,kKeepAliveDefaultTimeout:R,kHostHeader:N,kPendingIdx:k,kRunningIdx:T,kError:F,kPipelining:v,kKeepAliveTimeoutValue:M,kMaxHeadersSize:U,kKeepAliveMaxTimeout:L,kKeepAliveTimeoutThreshold:H,kHeadersTimeout:x,kBodyTimeout:Y,kStrictContentLength:P,kConnector:V,kMaxRequests:O,kCounter:G,kClose:J,kDestroy:W,kDispatch:_,kLocalAddress:q,kMaxResponseSize:$,kOnError:X,kHTTPContext:z,kMaxConcurrentStreams:Z,kResume:j}=A(257),K=A(9355),ee=A(8142),te=Symbol("kClosedResolve"),Ae=n&&n.maxHeaderSize&&Number.isInteger(n.maxHeaderSize)&&n.maxHeaderSize>0?()=>n.maxHeaderSize:()=>{throw new h("http module not available or http.maxHeaderSize invalid")},se=()=>{};function re(e){return e[v]??e[z]?.defaultPipelining??1}function ne(e,t){if(0===e[f]&&"UND_ERR_INFO"!==t.code&&"UND_ERR_SOCKET"!==t.code){s(e[k]===e[T]);const A=e[S].splice(e[T]);for(let s=0;s<A.length;s++){const r=A[s];i.errorRequest(e,r,t)}s(0===e[y])}}function ie(e){s(!e[w]),s(!e[z]);let{host:t,hostname:A,protocol:n,port:o}=e[E];if("["===A[0]){const e=A.indexOf("]");s(-1!==e);const t=A.substring(1,e);s(r.isIPv6(t)),A=t}e[w]=!0,a.beforeConnect.hasSubscribers&&a.beforeConnect.publish({connectParams:{host:t,hostname:A,protocol:n,port:o,version:e[z]?.version,servername:e[I],localAddress:e[q]},connector:e[V]}),e[V]({host:t,hostname:A,protocol:n,port:o,servername:e[I],localAddress:e[q]},((r,c)=>{if(r)return oe(e,r,{host:t,hostname:A,protocol:n,port:o}),void e[j]();if(e.destroyed)return i.destroy(c.on("error",se),new d),void e[j]();s(c);try{e[z]="h2"===c.alpnProtocol?ee(e,c):K(e,c)}catch(r){return c.destroy().on("error",se),oe(e,r,{host:t,hostname:A,protocol:n,port:o}),void e[j]()}e[w]=!1,c[G]=0,c[O]=e[O],c[Q]=e,c[F]=null,a.connected.hasSubscribers&&a.connected.publish({connectParams:{host:t,hostname:A,protocol:n,port:o,version:e[z]?.version,servername:e[I],localAddress:e[q]},connector:e[V],socket:c}),e.emit("connect",e[E],[e]),e[j]()}))}function oe(e,t,{host:A,hostname:r,protocol:n,port:o}){if(!e.destroyed){if(e[w]=!1,a.connectError.hasSubscribers&&a.connectError.publish({connectParams:{host:A,hostname:r,protocol:n,port:o,version:e[z]?.version,servername:e[I],localAddress:e[q]},connector:e[V],error:t}),"ERR_TLS_CERT_ALTNAME_INVALID"===t.code)for(s(0===e[f]);e[m]>0&&e[S][e[k]].servername===e[I];){const A=e[S][e[k]++];i.errorRequest(e,A,t)}else ne(e,t);e.emit("connectionError",e[E],[e],t)}}function ae(e){e[b]=0,e.emit("drain",e[E],[e])}function ce(e,t){2!==e[p]&&(e[p]=2,function(e,t){for(;;){if(e.destroyed)return void s(0===e[m]);if(e[te]&&!e[y])return e[te](),void(e[te]=null);if(e[z]&&e[z].resume(),e[C])e[b]=2;else if(2===e[b]){t?(e[b]=1,queueMicrotask((()=>ae(e)))):ae(e);continue}if(0===e[m])return;if(e[f]>=(re(e)||1))return;const A=e[S][e[k]];if("https:"===e[E].protocol&&e[I]!==A.servername){if(e[f]>0)return;e[I]=A.servername,e[z]?.destroy(new g("servername changed"),(()=>{e[z]=null,ce(e)}))}if(e[w])return;if(!e[z])return void ie(e);if(e[z].destroyed)return;if(e[z].busy(A))return;!A.aborted&&e[z].write(A)?e[k]++:e[S].splice(e[k],1)}}(e,t),e[p]=0,e[T]>256&&(e[S].splice(0,e[T]),e[k]-=e[T],e[T]=0))}e.exports=class extends l{constructor(e,{maxHeaderSize:t,headersTimeout:A,socketTimeout:s,requestTimeout:n,connectTimeout:o,bodyTimeout:a,idleTimeout:c,keepAlive:l,keepAliveTimeout:g,maxKeepAliveTimeout:d,keepAliveMaxTimeout:Q,keepAliveTimeoutThreshold:C,socketPath:B,pipelining:f,tls:m,strictContentLength:y,maxCachedSessions:D,connect:w,maxRequestsPerClient:F,localAddress:G,maxResponseSize:J,autoSelectFamily:W,autoSelectFamilyAttemptTimeout:_,maxConcurrentStreams:K,allowH2:ee}={}){if(void 0!==l)throw new h("unsupported keepAlive, use pipelining=0 instead");if(void 0!==s)throw new h("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(void 0!==n)throw new h("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(void 0!==c)throw new h("unsupported idleTimeout, use keepAliveTimeout instead");if(void 0!==d)throw new h("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(null!=t){if(!Number.isInteger(t)||t<1)throw new h("invalid maxHeaderSize")}else t=Ae();if(null!=B&&"string"!=typeof B)throw new h("invalid socketPath");if(null!=o&&(!Number.isFinite(o)||o<0))throw new h("invalid connectTimeout");if(null!=g&&(!Number.isFinite(g)||g<=0))throw new h("invalid keepAliveTimeout");if(null!=Q&&(!Number.isFinite(Q)||Q<=0))throw new h("invalid keepAliveMaxTimeout");if(null!=C&&!Number.isFinite(C))throw new h("invalid keepAliveTimeoutThreshold");if(null!=A&&(!Number.isInteger(A)||A<0))throw new h("headersTimeout must be a positive integer or zero");if(null!=a&&(!Number.isInteger(a)||a<0))throw new h("bodyTimeout must be a positive integer or zero");if(null!=w&&"function"!=typeof w&&"object"!=typeof w)throw new h("connect must be a function or an object");if(null!=F&&(!Number.isInteger(F)||F<0))throw new h("maxRequestsPerClient must be a positive number");if(null!=G&&("string"!=typeof G||0===r.isIP(G)))throw new h("localAddress must be valid string IP address");if(null!=J&&(!Number.isInteger(J)||J<-1))throw new h("maxResponseSize must be a positive number");if(null!=_&&(!Number.isInteger(_)||_<-1))throw new h("autoSelectFamilyAttemptTimeout must be a positive number");if(null!=ee&&"boolean"!=typeof ee)throw new h("allowH2 must be a valid boolean value");if(null!=K&&("number"!=typeof K||K<1))throw new h("maxConcurrentStreams must be a positive integer, greater than 0");super(),"function"!=typeof w&&(w=u({...m,maxCachedSessions:D,allowH2:ee,socketPath:B,timeout:o,..."boolean"==typeof W?{autoSelectFamily:W,autoSelectFamilyAttemptTimeout:_}:void 0,...w})),this[E]=i.parseOrigin(e),this[V]=w,this[v]=null!=f?f:1,this[U]=t,this[R]=null==g?4e3:g,this[L]=null==Q?6e5:Q,this[H]=null==C?2e3:C,this[M]=this[R],this[I]=null,this[q]=null!=G?G:null,this[p]=0,this[b]=0,this[N]=`host: ${this[E].hostname}${this[E].port?`:${this[E].port}`:""}\r\n`,this[Y]=null!=a?a:3e5,this[x]=null!=A?A:3e5,this[P]=null==y||y,this[O]=F,this[te]=null,this[$]=J>-1?J:-1,this[Z]=null!=K?K:100,this[z]=null,this[S]=[],this[T]=0,this[k]=0,this[j]=e=>ce(this,e),this[X]=e=>ne(this,e)}get pipelining(){return this[v]}set pipelining(e){this[v]=e,this[j](!0)}get stats(){return new o(this)}get[m](){return this[S].length-this[k]}get[f](){return this[k]-this[T]}get[y](){return this[S].length-this[T]}get[D](){return!!this[z]&&!this[w]&&!this[z].destroyed}get[C](){return Boolean(this[z]?.busy(null)||this[y]>=(re(this)||1)||this[m]>0)}[B](e){ie(this),this.once("connect",e)}[_](e,t){const A=new c(this[E].origin,e,t);return this[S].push(A),this[p]||(null==i.bodyLength(A.body)&&i.isIterable(A.body)?(this[p]=1,queueMicrotask((()=>ce(this)))):this[j](!0)),this[p]&&2!==this[b]&&this[C]&&(this[b]=2),this[b]<2}[J](){return new Promise((e=>{this[y]?this[te]=e:e(null)}))}[W](e){return new Promise((t=>{const A=this[S].splice(this[k]);for(let t=0;t<A.length;t++){const s=A[t];i.errorRequest(this,s,e)}const s=()=>{this[te]&&(this[te](),this[te]=null),t(null)};this[z]?(this[z].destroy(e,s),this[z]=null):queueMicrotask(s),this[j]()}))}}},7779:(e,t,A)=>{"use strict";const s=A(5497),r=A(4555),{ClientDestroyedError:n,ClientClosedError:i,InvalidArgumentError:o}=A(4465),{kDestroy:a,kClose:c,kClosed:l,kDestroyed:h,kDispatch:g}=A(257),d=Symbol("onDestroyed"),u=Symbol("onClosed");e.exports=class extends s{[h]=!1;[d]=null;[l]=!1;[u]=[];get destroyed(){return this[h]}get closed(){return this[l]}close(e){if(void 0===e)return new Promise(((e,t)=>{this.close(((A,s)=>A?t(A):e(s)))}));if("function"!=typeof e)throw new o("invalid callback");if(this[h])return void queueMicrotask((()=>e(new n,null)));if(this[l])return void(this[u]?this[u].push(e):queueMicrotask((()=>e(null,null))));this[l]=!0,this[u].push(e);const t=()=>{const e=this[u];this[u]=null;for(let t=0;t<e.length;t++)e[t](null,null)};this[c]().then((()=>this.destroy())).then((()=>{queueMicrotask(t)}))}destroy(e,t){if("function"==typeof e&&(t=e,e=null),void 0===t)return new Promise(((t,A)=>{this.destroy(e,((e,s)=>e?A(e):t(s)))}));if("function"!=typeof t)throw new o("invalid callback");if(this[h])return void(this[d]?this[d].push(t):queueMicrotask((()=>t(null,null))));e||(e=new n),this[h]=!0,this[d]=this[d]||[],this[d].push(t);const A=()=>{const e=this[d];this[d]=null;for(let t=0;t<e.length;t++)e[t](null,null)};this[a](e).then((()=>{queueMicrotask(A)}))}dispatch(e,t){if(!t||"object"!=typeof t)throw new o("handler must be an object");t=r.unwrap(t);try{if(!e||"object"!=typeof e)throw new o("opts must be an object.");if(this[h]||this[d])throw new n;if(this[l])throw new i;return this[g](e,t)}catch(e){if("function"!=typeof t.onError)throw e;return t.onError(e),!1}}}},5497:(e,t,A)=>{"use strict";const s=A(8474),r=A(832),n=e=>(t,A)=>e(t,r.wrap(A));e.exports=class extends s{dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}compose(...e){const t=Array.isArray(e[0])?e[0]:e;let A=this.dispatch.bind(this);for(const e of t)if(null!=e){if("function"!=typeof e)throw new TypeError("invalid interceptor, expected function received "+typeof e);if(A=e(A),A=n(A),null==A||"function"!=typeof A||2!==A.length)throw new TypeError("invalid interceptor")}return new Proxy(this,{get:(e,t)=>"dispatch"===t?A:e[t]})}}},4667:(e,t,A)=>{"use strict";const s=A(7779),{kClose:r,kDestroy:n,kClosed:i,kDestroyed:o,kDispatch:a,kNoProxyAgent:c,kHttpProxyAgent:l,kHttpsProxyAgent:h}=A(257),g=A(9246),d=A(3315),u={"http:":80,"https:":443};e.exports=class extends s{#C=null;#B=null;#p=null;constructor(e={}){super(),this.#p=e;const{httpProxy:t,httpsProxy:A,noProxy:s,...r}=e;this[c]=new d(r);const n=t??process.env.http_proxy??process.env.HTTP_PROXY;this[l]=n?new g({...r,uri:n}):this[c];const i=A??process.env.https_proxy??process.env.HTTPS_PROXY;this[h]=i?new g({...r,uri:i}):this[l],this.#f()}[a](e,t){const A=new URL(e.origin);return this.#m(A).dispatch(e,t)}[r](){return Promise.all([this[c].close(),!this[l][i]&&this[l].close(),!this[h][i]&&this[h].close()])}[n](e){return Promise.all([this[c].destroy(e),!this[l][o]&&this[l].destroy(e),!this[h][o]&&this[h].destroy(e)])}#m(e){let{protocol:t,host:A,port:s}=e;return A=A.replace(/:\d*$/,"").toLowerCase(),s=Number.parseInt(s,10)||u[t]||0,this.#y(A,s)?"https:"===t?this[h]:this[l]:this[c]}#y(e,t){if(this.#S&&this.#f(),0===this.#B.length)return!0;if("*"===this.#C)return!1;for(let A=0;A<this.#B.length;A++){const s=this.#B[A];if(!s.port||s.port===t)if(/^[.*]/.test(s.hostname)){if(e.endsWith(s.hostname.replace(/^\*/,"")))return!1}else if(e===s.hostname)return!1}return!0}#f(){const e=this.#p.noProxy??this.#D,t=e.split(/[,\s]/),A=[];for(let e=0;e<t.length;e++){const s=t[e];if(!s)continue;const r=s.match(/^(.+):(\d+)$/);A.push({hostname:(r?r[1]:s).toLowerCase(),port:r?Number.parseInt(r[2],10):0})}this.#C=e,this.#B=A}get#S(){return void 0===this.#p.noProxy&&this.#C!==this.#D}get#D(){return process.env.no_proxy??process.env.NO_PROXY??""}}},1726:e=>{"use strict";const t=2047;class A{bottom=0;top=0;list=new Array(2048).fill(void 0);next=null;isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&t)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&t}shift(){const e=this.list[this.bottom];return void 0===e?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&t,e)}}e.exports=class{constructor(){this.head=this.tail=new A}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new A),this.head.push(e)}shift(){const e=this.tail,t=e.shift();return e.isEmpty()&&null!==e.next&&(this.tail=e.next,e.next=null),t}}},8297:(e,t,A)=>{"use strict";const{connect:s}=A(7030),{kClose:r,kDestroy:n}=A(257),{InvalidArgumentError:i}=A(4465),o=A(2858),a=A(1167),c=A(7779);e.exports=class extends c{#w=null;constructor(e,t){if("string"==typeof e&&(e=new URL(e)),"http:"!==e.protocol)throw new i("h2c-client: Only h2c protocol is supported");const{connect:A,maxConcurrentStreams:s,pipelining:r,...n}=t??{};let o=100,c=100;if(null!=s&&Number.isInteger(s)&&s>0&&(o=s),null!=r&&Number.isInteger(r)&&r>0&&(c=r),c>o)throw new i("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(),this.#w=new a(e,{...n,connect:this.#b(A),maxConcurrentStreams:o,pipelining:c,allowH2:!0})}#b(e){return(t,A)=>{const r=e?.connectOpts??1e4,{hostname:n,port:i,pathname:a}=t,c=s({...t,host:n,port:i,pathname:a});if(null==t.keepAlive||t.keepAlive){const e=null==t.keepAliveInitialDelay?6e4:t.keepAliveInitialDelay;c.setKeepAlive(!0,e)}c.alpnProtocol="h2";const l=o.setupConnectTimeout(new WeakRef(c),{timeout:r,hostname:n,port:i});return c.setNoDelay(!0).once("connect",(function(){if(queueMicrotask(l),A){const e=A;A=null,e(null,this)}})).on("error",(function(e){if(queueMicrotask(l),A){const t=A;A=null,t(e)}})),c}}dispatch(e,t){return this.#w.dispatch(e,t)}[r](){return this.#w.close()}[n](){return this.#w.destroy()}}},1694:(e,t,A)=>{"use strict";const{PoolStats:s}=A(4304),r=A(7779),n=A(1726),{kConnected:i,kSize:o,kRunning:a,kPending:c,kQueued:l,kBusy:h,kFree:g,kUrl:d,kClose:u,kDestroy:E,kDispatch:I}=A(257),Q=Symbol("clients"),C=Symbol("needDrain"),B=Symbol("queue"),p=Symbol("closed resolve"),f=Symbol("onDrain"),m=Symbol("onConnect"),y=Symbol("onDisconnect"),S=Symbol("onConnectionError"),D=Symbol("get dispatcher"),w=Symbol("add client"),b=Symbol("remove client");e.exports={PoolBase:class extends r{[B]=new n;[l]=0;[Q]=[];[C]=!1;[f](e,t,A){const s=this[B];let r=!1;for(;!r;){const t=s.shift();if(!t)break;this[l]--,r=!e.dispatch(t.opts,t.handler)}if(e[C]=r,!r&&this[C]&&(this[C]=!1,this.emit("drain",t,[this,...A])),this[p]&&s.isEmpty()){const e=new Array(this[Q].length);for(let t=0;t<this[Q].length;t++)e[t]=this[Q][t].close();Promise.all(e).then(this[p])}}[m]=(e,t)=>{this.emit("connect",e,[this,...t])};[y]=(e,t,A)=>{this.emit("disconnect",e,[this,...t],A)};[S]=(e,t,A)=>{this.emit("connectionError",e,[this,...t],A)};get[h](){return this[C]}get[i](){let e=0;for(const{[i]:t}of this[Q])e+=t;return e}get[g](){let e=0;for(const{[i]:t,[C]:A}of this[Q])e+=t&&!A;return e}get[c](){let e=this[l];for(const{[c]:t}of this[Q])e+=t;return e}get[a](){let e=0;for(const{[a]:t}of this[Q])e+=t;return e}get[o](){let e=this[l];for(const{[o]:t}of this[Q])e+=t;return e}get stats(){return new s(this)}[u](){if(this[B].isEmpty()){const e=new Array(this[Q].length);for(let t=0;t<this[Q].length;t++)e[t]=this[Q][t].close();return Promise.all(e)}return new Promise((e=>{this[p]=e}))}[E](e){for(;;){const t=this[B].shift();if(!t)break;t.handler.onError(e)}const t=new Array(this[Q].length);for(let A=0;A<this[Q].length;A++)t[A]=this[Q][A].destroy(e);return Promise.all(t)}[I](e,t){const A=this[D]();return A?A.dispatch(e,t)||(A[C]=!0,this[C]=!this[D]()):(this[C]=!0,this[B].push({opts:e,handler:t}),this[l]++),!this[C]}[w](e){return e.on("drain",this[f].bind(this,e)).on("connect",this[m]).on("disconnect",this[y]).on("connectionError",this[S]),this[Q].push(e),this[C]&&queueMicrotask((()=>{this[C]&&this[f](e,e[d],[e,this])})),this}[b](e){e.close((()=>{const t=this[Q].indexOf(e);-1!==t&&this[Q].splice(t,1)})),this[C]=this[Q].some((e=>!e[C]&&!0!==e.closed&&!0!==e.destroyed))}},kClients:Q,kNeedDrain:C,kAddClient:w,kRemoveClient:b,kGetDispatcher:D}},8542:(e,t,A)=>{"use strict";const{PoolBase:s,kClients:r,kNeedDrain:n,kAddClient:i,kGetDispatcher:o,kRemoveClient:a}=A(1694),c=A(1167),{InvalidArgumentError:l}=A(4465),h=A(2858),{kUrl:g}=A(257),d=A(1986),u=Symbol("options"),E=Symbol("connections"),I=Symbol("factory");function Q(e,t){return new c(e,t)}e.exports=class extends s{constructor(e,{connections:t,factory:A=Q,connect:s,connectTimeout:n,tls:i,maxCachedSessions:o,socketPath:a,autoSelectFamily:c,autoSelectFamilyAttemptTimeout:C,allowH2:B,clientTtl:p,...f}={}){if(null!=t&&(!Number.isFinite(t)||t<0))throw new l("invalid connections");if("function"!=typeof A)throw new l("factory must be a function.");if(null!=s&&"function"!=typeof s&&"object"!=typeof s)throw new l("connect must be a function or an object");"function"!=typeof s&&(s=d({...i,maxCachedSessions:o,allowH2:B,socketPath:a,timeout:n,..."boolean"==typeof c?{autoSelectFamily:c,autoSelectFamilyAttemptTimeout:C}:void 0,...s})),super(),this[E]=t||null,this[g]=h.parseOrigin(e),this[u]={...h.deepClone(f),connect:s,allowH2:B,clientTtl:p},this[u].interceptors=f.interceptors?{...f.interceptors}:void 0,this[I]=A,this.on("connect",((e,t)=>{if(null!=p&&p>0)for(const e of t)Object.assign(e,{ttl:Date.now()})})),this.on("connectionError",((e,t,A)=>{for(const e of t){const t=this[r].indexOf(e);-1!==t&&this[r].splice(t,1)}}))}[o](){const e=this[u].clientTtl;for(const t of this[r])if(null!=e&&e>0&&t.ttl&&Date.now()-t.ttl>e)this[a](t);else if(!t[n])return t;if(!this[E]||this[r].length<this[E]){const e=this[I](this[g],this[u]);return this[i](e),e}}}},9246:(e,t,A)=>{"use strict";const{kProxy:s,kClose:r,kDestroy:n,kDispatch:i}=A(257),o=A(3315),a=A(8542),c=A(7779),{InvalidArgumentError:l,RequestAbortedError:h,SecureProxyConnectionError:g}=A(4465),d=A(1986),u=A(1167),E=Symbol("proxy agent"),I=Symbol("proxy client"),Q=Symbol("proxy headers"),C=Symbol("request tls settings"),B=Symbol("proxy tls settings"),p=Symbol("connect endpoint function"),f=Symbol("tunnel proxy");function m(e,t){return new a(e,t)}const y=()=>{};function S(e,t){return 1===t.connections?new u(e,t):new a(e,t)}class D extends c{#w;constructor(e,{headers:t={},connect:A,factory:s}){if(!e)throw new l("Proxy URL is mandatory");super(),this[Q]=t,this.#w=s?s(e,{connect:A}):new u(e,{connect:A})}[i](e,t){const A=t.onHeaders;t.onHeaders=function(e,s,r){407!==e?A&&A.call(this,e,s,r):"function"==typeof t.onError&&t.onError(new l("Proxy Authentication Required (407)"))};const{origin:s,path:r="/",headers:n={}}=e;if(e.path=s+r,!("host"in n)&&!("Host"in n)){const{host:e}=new URL(s);n.host=e}return e.headers={...this[Q],...n},this.#w[i](e,t)}[r](){return this.#w.close()}[n](e){return this.#w.destroy(e)}}e.exports=class extends c{constructor(e){if(!e||"object"==typeof e&&!(e instanceof URL)&&!e.uri)throw new l("Proxy uri is mandatory");const{clientFactory:t=m}=e;if("function"!=typeof t)throw new l("Proxy opts.clientFactory must be a function.");const{proxyTunnel:A=!0}=e;super();const r=this.#R(e),{href:n,origin:i,port:a,protocol:c,username:u,password:w,hostname:b}=r;if(this[s]={uri:n,protocol:c},this[C]=e.requestTls,this[B]=e.proxyTls,this[Q]=e.headers||{},this[f]=A,e.auth&&e.token)throw new l("opts.auth cannot be used in combination with opts.token");e.auth?this[Q]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[Q]["proxy-authorization"]=e.token:u&&w&&(this[Q]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(u)}:${decodeURIComponent(w)}`).toString("base64")}`);const R=d({...e.proxyTls});this[p]=d({...e.requestTls});const N=e.factory||S;this[I]=t(r,{connect:R}),this[E]=new o({...e,factory:(e,t)=>{const{protocol:A}=new URL(e);return this[f]||"http:"!==A||"http:"!==this[s].protocol?N(e,t):new D(this[s].uri,{headers:this[Q],connect:R,factory:N})},connect:async(e,t)=>{let A=e.host;e.port||(A+=`:${function(e){return"https:"===e?443:80}(e.protocol)}`);try{const{socket:s,statusCode:r}=await this[I].connect({origin:i,port:a,path:A,signal:e.signal,headers:{...this[Q],host:e.host,...null==e.connections||e.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[B]?.servername||b});if(200!==r&&(s.on("error",y).destroy(),t(new h(`Proxy response (${r}) !== 200 when HTTP Tunneling`))),"https:"!==e.protocol)return void t(null,s);let n;n=this[C]?this[C].servername:e.servername,this[p]({...e,servername:n,httpSocket:s},t)}catch(e){"ERR_TLS_CERT_ALTNAME_INVALID"===e.code?t(new g(e)):t(e)}}})}dispatch(e,t){const A=function(e){if(Array.isArray(e)){const t={};for(let A=0;A<e.length;A+=2)t[e[A]]=e[A+1];return t}return e}(e.headers);if(function(e){const t=e&&Object.keys(e).find((e=>"proxy-authorization"===e.toLowerCase()));if(t)throw new l("Proxy-Authorization should be sent in ProxyAgent constructor")}(A),A&&!("host"in A)&&!("Host"in A)){const{host:t}=new URL(e.origin);A.host=t}return this[E].dispatch({...e,headers:A},t)}#R(e){return"string"==typeof e?new URL(e):e instanceof URL?e:new URL(e.uri)}[r](){return Promise.all([this[E].close(),this[I].close()])}[n](){return Promise.all([this[E].destroy(),this[I].destroy()])}}},8712:(e,t,A)=>{"use strict";const s=A(5497),r=A(6294);e.exports=class extends s{#N=null;#k=null;constructor(e,t={}){super(t),this.#N=e,this.#k=t}dispatch(e,t){const A=new r({...e,retryOptions:this.#k},{dispatch:this.#N.dispatch.bind(this.#N),handler:t});return this.#N.dispatch(e,A)}close(){return this.#N.close()}destroy(){return this.#N.destroy()}}},9879:(e,t,A)=>{"use strict";const s=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:r}=A(4465),n=A(3315);function i(e){if(!e||"function"!=typeof e.dispatch)throw new r("Argument agent must implement Agent");Object.defineProperty(globalThis,s,{value:e,writable:!0,enumerable:!1,configurable:!1})}function o(){return globalThis[s]}void 0===o()&&i(new n);e.exports={setGlobalDispatcher:i,getGlobalDispatcher:o,installedExports:["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"]}},8358:(e,t,A)=>{"use strict";const s=A(2858),{parseCacheControlHeader:r,parseVaryHeader:n,isEtagUsable:i}=A(9453),{parseHttpDate:o}=A(8851);function a(){}const c=[200,203,204,206,300,301,308,404,405,410,414,501],l=[206,304];e.exports=class{#T;#F;#v;#M;#U;#L;constructor({store:e,type:t,cacheByDefault:A},s,r){this.#M=e,this.#F=t,this.#v=A,this.#T=s,this.#U=r}onRequestStart(e,t){this.#L?.destroy(),this.#L=void 0,this.#U.onRequestStart?.(e,t)}onRequestUpgrade(e,t,A,s){this.#U.onRequestUpgrade?.(e,t,A,s)}onResponseStart(e,t,A,h){const g=()=>this.#U.onResponseStart?.(e,t,A,h);if(!s.safeHTTPMethods.includes(this.#T.method)&&t>=200&&t<=399){try{this.#M.delete(this.#T)?.catch?.(a)}catch{}return g()}const d=A["cache-control"],u=A["last-modified"]&&c.includes(t);if(!(d||A.expires||u||this.#v))return g();const E=d?r(d):{};if(!function(e,t,A,s){if(t<200||l.includes(t))return!1;if(!(c.includes(t)||A.expires||s.public||void 0!==s["max-age"]||s.private&&"private"===e||void 0!==s["s-maxage"]&&"shared"===e))return!1;if(s["no-store"])return!1;if("shared"===e&&!0===s.private)return!1;if(A.vary?.includes("*"))return!1;if(A.authorization){if(!s.public||"string"!=typeof A.authorization)return!1;if(Array.isArray(s["no-cache"])&&s["no-cache"].includes("authorization"))return!1;if(Array.isArray(s.private)&&s.private.includes("authorization"))return!1}return!0}(this.#F,t,A,E))return g();const I=Date.now(),Q=A.age?function(e){const t=parseInt(Array.isArray(e)?e[0]:e);return isNaN(t)?void 0:1e3*t}(A.age):void 0;if(Q&&Q>=2147483647e3)return g();const C="string"==typeof A.date?o(A.date):void 0,B=function(e,t,A,s,r,n){if("shared"===e){const e=n["s-maxage"];if(void 0!==e)return e>0?1e3*e:void 0}const i=n["max-age"];if(void 0!==i)return i>0?1e3*i:void 0;if("string"==typeof s.expires){const e=o(s.expires);if(e){if(t>=e.getTime())return;if(r){if(r>=e)return;if(void 0!==A&&A>e-r)return}return e.getTime()-t}}if("string"==typeof s["last-modified"]){const e=new Date(s["last-modified"]);if((a=e)instanceof Date&&Number.isFinite(a.valueOf())){if(e.getTime()>=t)return;return.1*(t-e.getTime())}}var a;if(n.immutable)return 31536e3;return}(this.#F,I,Q,A,C,E)??this.#v;if(void 0===B||Q&&Q>B)return g();const p=C?C.getTime():I,f=B+p;if(I>=f)return g();let m;if(this.#T.headers&&A.vary&&(m=n(A.vary,this.#T.headers),!m))return g();const y=function(e,t,A){let s=-1/0,r=-1/0,n=-1/0;t["stale-while-revalidate"]&&(s=A+1e3*t["stale-while-revalidate"]);t["stale-if-error"]&&(r=A+1e3*t["stale-if-error"]);s===-1/0&&r===-1/0&&(n=e+31536e6);return Math.max(A,s,r,n)}(p,E,f),S=function(e,t){const A=["connection","proxy-authenticate","proxy-authentication-info","proxy-authorization","proxy-connection","te","transfer-encoding","upgrade","age"];e.connection&&(Array.isArray(e.connection)?A.push(...e.connection.map((e=>e.trim()))):A.push(...e.connection.split(",").map((e=>e.trim()))));Array.isArray(t["no-cache"])&&A.push(...t["no-cache"]);Array.isArray(t.private)&&A.push(...t.private);let s;for(const t of A)e[t]&&(s??={...e},delete s[t]);return s??e}(A,E),D={statusCode:t,statusMessage:h,headers:S,vary:m,cacheControlDirectives:E,cachedAt:Q?I-Q:I,staleAt:f,deleteAt:y};if("string"==typeof A.etag&&i(A.etag)&&(D.etag=A.etag),this.#L=this.#M.createWriteStream(this.#T,D),!this.#L)return g();const w=this;return this.#L.on("drain",(()=>e.resume())).on("error",(function(){w.#L=void 0,w.#M.delete(w.#T)})).on("close",(function(){w.#L===this&&(w.#L=void 0),e.resume()})),g()}onResponseData(e,t){!1===this.#L?.write(t)&&e.pause(),this.#U.onResponseData?.(e,t)}onResponseEnd(e,t){this.#L?.end(),this.#U.onResponseEnd?.(e,t)}onResponseError(e,t){this.#L?.destroy(t),this.#L=void 0,this.#U.onResponseError?.(e,t)}}},6607:(e,t,A)=>{"use strict";const s=A(4589);e.exports=class{#H=!1;#x;#U;#Y;#P;constructor(e,t,A){if("function"!=typeof e)throw new TypeError("callback must be a function");this.#x=e,this.#U=t,this.#P=A}onRequestStart(e,t){this.#H=!1,this.#Y=t}onRequestUpgrade(e,t,A,s){this.#U.onRequestUpgrade?.(e,t,A,s)}onResponseStart(e,t,A,r){if(s(null!=this.#x),this.#H=304===t||this.#P&&t>=500&&t<=504,this.#x(this.#H,this.#Y),this.#x=null,this.#H)return!0;this.#U.onRequestStart?.(e,this.#Y),this.#U.onResponseStart?.(e,t,A,r)}onResponseData(e,t){if(!this.#H)return this.#U.onResponseData?.(e,t)}onResponseEnd(e,t){this.#H||this.#U.onResponseEnd?.(e,t)}onResponseError(e,t){if(!this.#H){if(this.#x&&(this.#x(!1),this.#x=null),"function"!=typeof this.#U.onResponseError)throw t;this.#U.onResponseError(e,t)}}}},6917:(e,t,A)=>{"use strict";const s=A(4589),r=A(832);e.exports=class{#U;#V=!1;#O=!1;#G=!1;constructor(e){if("object"!=typeof e||null===e)throw new TypeError("handler must be an object");this.#U=r.wrap(e)}onRequestStart(...e){this.#U.onRequestStart?.(...e)}onRequestUpgrade(...e){return s(!this.#V),s(!this.#O),this.#U.onRequestUpgrade?.(...e)}onResponseStart(...e){return s(!this.#V),s(!this.#O),s(!this.#G),this.#G=!0,this.#U.onResponseStart?.(...e)}onResponseData(...e){return s(!this.#V),s(!this.#O),this.#U.onResponseData?.(...e)}onResponseEnd(...e){return s(!this.#V),s(!this.#O),this.#V=!0,this.#U.onResponseEnd?.(...e)}onResponseError(...e){return this.#O=!0,this.#U.onResponseError?.(...e)}onBodySent(){}}},8064:(e,t,A)=>{"use strict";const s=A(2858),{kBodyUsed:r}=A(257),n=A(4589),{InvalidArgumentError:i}=A(4465),o=A(8474),a=[300,301,302,303,307,308],c=Symbol("body"),l=()=>{};class h{constructor(e){this[c]=e,this[r]=!1}async*[Symbol.asyncIterator](){n(!this[r],"disturbed"),this[r]=!0,yield*this[c]}}class g{static buildDispatch(e,t){if(null!=t&&(!Number.isInteger(t)||t<0))throw new i("maxRedirections must be a positive number");const A=e.dispatch.bind(e);return(e,s)=>A(e,new g(A,t,e,s))}constructor(e,t,A,a){if(null!=t&&(!Number.isInteger(t)||t<0))throw new i("maxRedirections must be a positive number");this.dispatch=e,this.location=null;const{maxRedirections:c,...l}=A;this.opts=l,this.maxRedirections=t,this.handler=a,this.history=[],s.isStream(this.opts.body)?(0===s.bodyLength(this.opts.body)&&this.opts.body.on("data",(function(){n(!1)})),"boolean"!=typeof this.opts.body.readableDidRead&&(this.opts.body[r]=!1,o.prototype.on.call(this.opts.body,"data",(function(){this[r]=!0})))):(this.opts.body&&"function"==typeof this.opts.body.pipeTo||this.opts.body&&"string"!=typeof this.opts.body&&!ArrayBuffer.isView(this.opts.body)&&s.isIterable(this.opts.body)&&!s.isFormDataLike(this.opts.body))&&(this.opts.body=new h(this.opts.body))}onRequestStart(e,t){this.handler.onRequestStart?.(e,{...t,history:this.history})}onRequestUpgrade(e,t,A,s){this.handler.onRequestUpgrade?.(e,t,A,s)}onResponseStart(e,t,A,r){if(this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections)throw new Error("max redirects");if(301!==t&&302!==t||"POST"!==this.opts.method||(this.opts.method="GET",s.isStream(this.opts.body)&&s.destroy(this.opts.body.on("error",l)),this.opts.body=null),303===t&&"HEAD"!==this.opts.method&&(this.opts.method="GET",s.isStream(this.opts.body)&&s.destroy(this.opts.body.on("error",l)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||s.isDisturbed(this.opts.body)||-1===a.indexOf(t)?null:A.location,this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location)return void this.handler.onResponseStart?.(e,t,A,r);const{origin:o,pathname:c,search:h}=s.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),g=h?`${c}${h}`:c,u=`${o}${g}`;for(const e of this.history)if(e.toString()===u)throw new i(`Redirect loop detected. Cannot redirect to ${o}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);this.opts.headers=function(e,t,A){const s=[];if(Array.isArray(e))for(let r=0;r<e.length;r+=2)d(e[r],t,A)||s.push(e[r],e[r+1]);else if(e&&"object"==typeof e){const r="function"==typeof e[Symbol.iterator]?e:Object.entries(e);for(const[e,n]of r)d(e,t,A)||s.push(e,n)}else n(null==e,"headers must be an object or an array");return s}(this.opts.headers,303===t,this.opts.origin!==o),this.opts.path=g,this.opts.origin=o,this.opts.query=null}onResponseData(e,t){this.location||this.handler.onResponseData?.(e,t)}onResponseEnd(e,t){this.location?this.dispatch(this.opts,this):this.handler.onResponseEnd(e,t)}onResponseError(e,t){this.handler.onResponseError?.(e,t)}}function d(e,t,A){if(4===e.length)return"host"===s.headerNameToString(e);if(t&&s.headerNameToString(e).startsWith("content-"))return!0;if(A&&(13===e.length||6===e.length||19===e.length)){const t=s.headerNameToString(e);return"authorization"===t||"cookie"===t||"proxy-authorization"===t}return!1}e.exports=g},6294:(e,t,A)=>{"use strict";const s=A(4589),{kRetryHandlerDefaultRetry:r}=A(257),{RequestRetryError:n}=A(4465),i=A(832),{isDisturbed:o,parseRangeHeader:a,wrapRequestBody:c}=A(2858);class l{constructor(e,{dispatch:t,handler:A}){const{retryOptions:s,...n}=e,{retry:o,maxRetries:a,maxTimeout:h,minTimeout:g,timeoutFactor:d,methods:u,errorCodes:E,retryAfter:I,statusCodes:Q,throwOnError:C}=s??{};this.error=null,this.dispatch=t,this.handler=i.wrap(A),this.opts={...n,body:c(e.body)},this.retryOpts={throwOnError:C??!0,retry:o??l[r],retryAfter:I??!0,maxTimeout:h??3e4,minTimeout:g??500,timeoutFactor:d??2,maxRetries:a??5,methods:u??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:Q??[500,502,503,504,429],errorCodes:E??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.headersSent=!1,this.start=0,this.end=null,this.etag=null}onResponseStartWithRetry(e,t,A,s,r){if(this.retryOpts.throwOnError)!1===this.retryOpts.statusCodes.includes(t)?(this.headersSent=!0,this.handler.onResponseStart?.(e,t,A,s)):this.error=r;else{if(o(this.opts.body))return this.headersSent=!0,void this.handler.onResponseStart?.(e,t,A,s);e.pause(),this.retryOpts.retry(r,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},function(n){if(n)return this.headersSent=!0,this.headersSent=!0,this.handler.onResponseStart?.(e,t,A,s),void e.resume();this.error=r,e.resume()}.bind(this))}}onRequestStart(e,t){this.headersSent||this.handler.onRequestStart?.(e,t)}onRequestUpgrade(e,t,A,s){this.handler.onRequestUpgrade?.(e,t,A,s)}static[r](e,{state:t,opts:A},s){const{statusCode:r,code:n,headers:i}=e,{method:o,retryOptions:a}=A,{maxRetries:c,minTimeout:l,maxTimeout:h,timeoutFactor:g,statusCodes:d,errorCodes:u,methods:E}=a,{counter:I}=t;if(n&&"UND_ERR_REQ_RETRY"!==n&&!u.includes(n))return void s(e);if(Array.isArray(E)&&!E.includes(o))return void s(e);if(null!=r&&Array.isArray(d)&&!d.includes(r))return void s(e);if(I>c)return void s(e);let Q=i?.["retry-after"];Q&&(Q=Number(Q),Q=Number.isNaN(Q)?function(e){const t=new Date(e).getTime();return isNaN(t)?0:t-Date.now()}(i["retry-after"]):1e3*Q);const C=Q>0?Math.min(Q,h):Math.min(l*g**(I-1),h);setTimeout((()=>s(null)),C)}onResponseStart(e,t,A,r){if(this.error=null,this.retryCount+=1,t>=300){const s=new n("Request failed",t,{headers:A,data:{count:this.retryCount}});this.onResponseStartWithRetry(e,t,A,r,s)}else{if(this.headersSent){if(206!==t&&(this.start>0||200!==t))throw new n("server does not support the range header and the payload was partially consumed",t,{headers:A,data:{count:this.retryCount}});const e=a(A["content-range"]);if(!e)throw new n("Content-Range mismatch",t,{headers:A,data:{count:this.retryCount}});if(null!=this.etag&&this.etag!==A.etag)throw new n("ETag mismatch",t,{headers:A,data:{count:this.retryCount}});const{start:r,size:i,end:o=(i?i-1:null)}=e;return s(this.start===r,"content-range mismatch"),void s(null==this.end||this.end===o,"content-range mismatch")}if(null!=this.end)throw new n("Request failed",t,{headers:A,data:{count:this.retryCount}});if(206===t){const n=a(A["content-range"]);if(null==n)return this.headersSent=!0,void this.handler.onResponseStart?.(e,t,A,r);const{start:i,size:o,end:c=(o?o-1:null)}=n;s(null!=i&&Number.isFinite(i),"content-range mismatch"),s(null!=c&&Number.isFinite(c),"invalid content-length"),this.start=i,this.end=c}if(null==this.end){const e=A["content-length"];this.end=null!=e?Number(e)-1:null}s(Number.isFinite(this.start)),s(null==this.end||Number.isFinite(this.end),"invalid content-length"),this.resume=!0,this.etag=null!=A.etag?A.etag:null,null!=this.etag&&"W"===this.etag[0]&&"/"===this.etag[1]&&(this.etag=null),this.headersSent=!0,this.handler.onResponseStart?.(e,t,A,r)}}onResponseData(e,t){this.error||(this.start+=t.length,this.handler.onResponseData?.(e,t))}onResponseEnd(e,t){if(this.error&&this.retryOpts.throwOnError)throw this.error;if(!this.error)return this.retryCount=0,this.handler.onResponseEnd?.(e,t);this.retry(e)}retry(e){if(0!==this.start){const e={range:`bytes=${this.start}-${this.end??""}`};null!=this.etag&&(e["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...e}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(t){this.handler.onResponseError?.(e,t)}}onResponseError(e,t){e?.aborted||o(this.opts.body)?this.handler.onResponseError?.(e,t):(this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(t,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},function(t){t?this.handler?.onResponseError?.(e,t):this.retry(e)}.bind(this)))}}e.exports=l},4555:(e,t,A)=>{"use strict";const{parseHeaders:s}=A(2858),{InvalidArgumentError:r}=A(4465),n=Symbol("resume");class i{#J=!1;#W=null;#_=!1;#q;[n]=null;constructor(e){this.#q=e}pause(){this.#J=!0}resume(){this.#J&&(this.#J=!1,this[n]?.())}abort(e){this.#_||(this.#_=!0,this.#W=e,this.#q(e))}get aborted(){return this.#_}get reason(){return this.#W}get paused(){return this.#J}}e.exports=class e{#U;#$;constructor(e){this.#U=e}static unwrap(t){return t.onRequestStart?new e(t):t}onConnect(e,t){this.#$=new i(e),this.#U.onRequestStart?.(this.#$,t)}onUpgrade(e,t,A){this.#U.onRequestUpgrade?.(this.#$,e,s(t),A)}onHeaders(e,t,A,r){return this.#$[n]=A,this.#U.onResponseStart?.(this.#$,e,s(t),r),!this.#$.paused}onData(e){return this.#U.onResponseData?.(this.#$,e),!this.#$.paused}onComplete(e){this.#U.onResponseEnd?.(this.#$,s(e))}onError(e){if(!this.#U.onResponseError)throw new r("invalid onError method");this.#U.onResponseError?.(this.#$,e)}}},832:(e,t,A)=>{"use strict";const{InvalidArgumentError:s}=A(4465);e.exports=class e{#U;constructor(e){this.#U=e}static wrap(t){return t.onRequestStart?t:new e(t)}onConnect(e,t){return this.#U.onConnect?.(e,t)}onHeaders(e,t,A,s){return this.#U.onHeaders?.(e,t,A,s)}onUpgrade(e,t,A){return this.#U.onUpgrade?.(e,t,A)}onData(e){return this.#U.onData?.(e)}onComplete(e){return this.#U.onComplete?.(e)}onError(e){if(!this.#U.onError)throw e;return this.#U.onError?.(e)}onRequestStart(e,t){this.#U.onConnect?.((t=>e.abort(t)),t)}onRequestUpgrade(e,t,A,s){const r=[];for(const[e,t]of Object.entries(A))r.push(Buffer.from(e),Array.isArray(t)?t.map((e=>Buffer.from(e))):Buffer.from(t));this.#U.onUpgrade?.(t,r,s)}onResponseStart(e,t,A,s){const r=[];for(const[e,t]of Object.entries(A))r.push(Buffer.from(e),Array.isArray(t)?t.map((e=>Buffer.from(e))):Buffer.from(t));!1===this.#U.onHeaders?.(t,r,(()=>e.resume()),s)&&e.pause()}onResponseData(e,t){!1===this.#U.onData?.(t)&&e.pause()}onResponseEnd(e,t){const A=[];for(const[e,s]of Object.entries(t))A.push(Buffer.from(e),Array.isArray(s)?s.map((e=>Buffer.from(e))):Buffer.from(s));this.#U.onComplete?.(A)}onResponseError(e,t){if(!this.#U.onError)throw new s("invalid onError method");this.#U.onError?.(t)}}},5752:(e,t,A)=>{"use strict";const s=A(4589),{Readable:r}=A(7075),n=A(2858),i=A(8358),o=A(9903),a=A(6607),{assertCacheStore:c,assertCacheMethods:l,makeCacheKey:h,normalizeHeaders:g,parseCacheControlHeader:d}=A(9453),{AbortError:u}=A(4465);function E(e,t,A,i,o,a){const c=n.isStream(A.body)?A.body:r.from(A.body??[]);s(!c.destroyed,"stream should not be destroyed"),s(!c.readableDidRead,"stream should not be readableDidRead");const l={resume(){c.resume()},pause(){c.pause()},get paused(){return c.isPaused()},get aborted(){return c.destroyed},get reason(){return c.errored},abort(e){c.destroy(e??new u)}};if(c.on("error",(function(t){if(!this.readableEnded){if("function"!=typeof e.onResponseError)throw t;e.onResponseError(l,t)}})).on("close",(function(){this.errored||e.onResponseEnd?.(l,{})})),e.onRequestStart?.(l,o),c.destroyed)return;const h={...A.headers,age:String(i)};a&&(h.warning='110 - "response is stale"'),e.onResponseStart?.(l,A.statusCode,h,A.statusMessage),"HEAD"===t.method?c.destroy():c.on("data",(function(t){e.onResponseData?.(l,t)}))}function I(e,t,A,s,r,o,c){if(!c)return function(e,t,A,s,r,n){if(n?.["only-if-cached"]){let e=!1;try{if("function"==typeof s.onConnect&&(s.onConnect((()=>{e=!0})),e))return;if("function"==typeof s.onHeaders&&(s.onHeaders(504,[],(()=>{}),"Gateway Timeout"),e))return;"function"==typeof s.onComplete&&s.onComplete([])}catch(e){"function"==typeof s.onError&&s.onError(e)}return!0}return e(r,new i(t,A,s))}(e,t,A,s,r,o);const l=Date.now();if(l>c.deleteAt)return e(r,new i(t,A,s));const h=Math.round((l-c.cachedAt)/1e3);if(o?.["max-age"]&&h>=o["max-age"])return e(r,s);if(function(e,t){if(t?.["no-cache"])return!0;if(e.cacheControlDirectives?.["no-cache"]&&!Array.isArray(e.cacheControlDirectives["no-cache"]))return!0;const A=Date.now();if(A>e.staleAt)return!t?.["max-stale"]||A>e.staleAt+1e3*t["max-stale"];if(t?.["min-fresh"])return e.staleAt-A<=1e3*t["min-fresh"];return!1}(c,o)){if(n.isStream(r.body)&&0!==n.bodyLength(r.body))return e(r,new i(t,A,s));if(function(e){const t=e.cacheControlDirectives?.["stale-while-revalidate"];return!!t&&Date.now()<=e.staleAt+1e3*t}(c))return E(s,r,c,h,null,!0),queueMicrotask((()=>{let s={...r.headers,"if-modified-since":new Date(c.cachedAt).toUTCString()};c.etag&&(s["if-none-match"]=c.etag),c.vary&&(s={...s,...c.vary}),e({...r,headers:s},new i(t,A,{onRequestStart(){},onRequestUpgrade(){},onResponseStart(){},onResponseData(){},onResponseEnd(){},onResponseError(){}}))})),!0;let g=!1;const d=c.cacheControlDirectives["stale-if-error"]??o?.["stale-if-error"];d&&(g=l<c.staleAt+1e3*d);let u={...r.headers,"if-modified-since":new Date(c.cachedAt).toUTCString()};return c.etag&&(u["if-none-match"]=c.etag),c.vary&&(u={...u,...c.vary}),e({...r,headers:u},new a(((e,t)=>{e?E(s,r,c,h,t,!0):n.isStream(c.body)&&c.body.on("error",(()=>{})).destroy()}),new i(t,A,s),g))}n.isStream(r.body)&&r.body.on("error",(()=>{})).destroy(),E(s,r,c,h,null,!1)}e.exports=(e={})=>{const{store:t=new o,methods:A=["GET"],cacheByDefault:s,type:r="shared"}=e;if("object"!=typeof e||null===e)throw new TypeError("expected type of opts to be an Object, got "+(null===e?"null":typeof e));if(c(t,"opts.store"),l(A,"opts.methods"),"undefined"!=typeof s&&"number"!=typeof s)throw new TypeError("expected opts.cacheByDefault to be number or undefined, got "+typeof s);if("undefined"!=typeof r&&"shared"!==r&&"private"!==r)throw new TypeError("expected opts.type to be shared, private, or undefined, got "+typeof r);const i={store:t,methods:A,cacheByDefault:s,type:r},a=n.safeHTTPMethods.filter((e=>!1===A.includes(e)));return e=>(A,s)=>{if(!A.origin||a.includes(A.method))return e(A,s);A={...A,headers:g(A)};const r=A.headers?.["cache-control"]?d(A.headers["cache-control"]):void 0;if(r?.["no-store"])return e(A,s);const n=h(A),o=t.get(n);return o&&"function"==typeof o.then?o.then((t=>{I(e,i,n,s,A,r,t)})):I(e,i,n,s,A,r,o),!0}}},4951:(e,t,A)=>{"use strict";const{createInflate:s,createGunzip:r,createBrotliDecompress:n,createZstdDecompress:i}=A(8522),{pipeline:o}=A(7075),a=A(6917),c={gzip:r,"x-gzip":r,br:n,deflate:s,compress:s,"x-compress":s,...i?{zstd:i}:{}},l=[204,304];let h=!1;class g extends a{#X=[];#z;#Z;#j;constructor(e,{skipStatusCodes:t=l,skipErrorResponses:A=!0}={}){super(e),this.#Z=t,this.#j=A}#K(e,t){return!e||t<200||(!!this.#Z.includes(t)||!!(this.#j&&t>=400))}#ee(e){const t=e.split(","),A=[];for(let e=t.length-1;e>=0;e--){const s=t[e].trim();if(s){if(!c[s])return A.length=0,A;A.push(c[s]())}}return A}#te(e,t){e.on("readable",(()=>{let A;for(;null!==(A=e.read());){if(!1===super.onResponseData(t,A))break}})),e.on("error",(e=>{super.onResponseError(t,e)}))}#Ae(e){const t=this.#X[0];this.#te(t,e),t.on("end",(()=>{super.onResponseEnd(e,{})}))}#se(e){const t=this.#X[this.#X.length-1];this.#te(t,e),this.#z=o(this.#X,(t=>{t?super.onResponseError(e,t):super.onResponseEnd(e,{})}))}#re(){this.#X.length=0,this.#z=null}onResponseStart(e,t,A,s){const r=A["content-encoding"];if(this.#K(r,t))return super.onResponseStart(e,t,A,s);const n=this.#ee(r.toLowerCase());if(0===n.length)return this.#re(),super.onResponseStart(e,t,A,s);this.#X=n;const{"content-encoding":i,"content-length":o,...a}=A;1===this.#X.length?this.#Ae(e):this.#se(e),super.onResponseStart(e,t,a,s)}onResponseData(e,t){this.#X.length>0?this.#X[0].write(t):super.onResponseData(e,t)}onResponseEnd(e,t){if(this.#X.length>0)return this.#X[0].end(),void this.#re();super.onResponseEnd(e,t)}onResponseError(e,t){if(this.#X.length>0){for(const e of this.#X)e.destroy(t);this.#re()}super.onResponseError(e,t)}}e.exports=function(e={}){return h||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),h=!0),t=>(A,s)=>{const r=new g(s,e);return t(A,r)}}},6677:(e,t,A)=>{"use strict";const{isIP:s}=A(7030),{lookup:r}=A(610),n=A(6917),{InvalidArgumentError:i,InformationalError:o}=A(4465),a=Math.pow(2,31)-1;class c{#ne=0;#ie=0;#oe=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(e){this.#ne=e.maxTTL,this.#ie=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#ae,this.pick=e.pick??this.#ce}get full(){return this.#oe.size===this.#ie}runLookup(e,t,A){const s=this.#oe.get(e.hostname);if(null==s&&this.full)return void A(null,e);const r={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...t.dns,maxTTL:this.#ne,maxItems:this.#ie};if(null==s)this.lookup(e,r,((t,s)=>{if(t||null==s||0===s.length)return void A(t??new o("No DNS entries found"));this.setRecords(e,s);const n=this.#oe.get(e.hostname),i=this.pick(e,n,r.affinity);let a;a="number"==typeof i.port?`:${i.port}`:""!==e.port?`:${e.port}`:"",A(null,new URL(`${e.protocol}//${6===i.family?`[${i.address}]`:i.address}${a}`))}));else{const n=this.pick(e,s,r.affinity);if(null==n)return this.#oe.delete(e.hostname),void this.runLookup(e,t,A);let i;i="number"==typeof n.port?`:${n.port}`:""!==e.port?`:${e.port}`:"",A(null,new URL(`${e.protocol}//${6===n.family?`[${n.address}]`:n.address}${i}`))}}#ae(e,t,A){r(e.hostname,{all:!0,family:!1===this.dualStack?this.affinity:0,order:"ipv4first"},((e,t)=>{if(e)return A(e);const s=new Map;for(const e of t)s.set(`${e.address}:${e.family}`,e);A(null,s.values())}))}#ce(e,t,A){let s=null;const{records:r,offset:n}=t;let i;if(this.dualStack?(null==A&&(null==n||n===a?(t.offset=0,A=4):(t.offset++,A=1&~t.offset?4:6)),i=null!=r[A]&&r[A].ips.length>0?r[A]:r[4===A?6:4]):i=r[A],null==i||0===i.ips.length)return s;null==i.offset||i.offset===a?i.offset=0:i.offset++;const o=i.offset%i.ips.length;return s=i.ips[o]??null,null==s?s:Date.now()-s.timestamp>s.ttl?(i.ips.splice(o,1),this.pick(e,t,A)):s}pickFamily(e,t){const A=this.#oe.get(e.hostname)?.records;if(!A)return null;const s=A[t];if(!s)return null;null==s.offset||s.offset===a?s.offset=0:s.offset++;const r=s.offset%s.ips.length,n=s.ips[r]??null;return null==n||Date.now()-n.timestamp>n.ttl&&s.ips.splice(r,1),n}setRecords(e,t){const A=Date.now(),s={records:{4:null,6:null}};for(const e of t){e.timestamp=A,"number"==typeof e.ttl?e.ttl=Math.min(e.ttl,this.#ne):e.ttl=this.#ne;const t=s.records[e.family]??{ips:[]};t.ips.push(e),s.records[e.family]=t}this.#oe.set(e.hostname,s)}deleteRecords(e){this.#oe.delete(e.hostname)}getHandler(e,t){return new l(this,e,t)}}class l extends n{#le=null;#p=null;#he=null;#ge=null;#$=null;#de=null;#ue=!0;constructor(e,{origin:t,handler:A,dispatch:s,newOrigin:r},n){super(A),this.#ge=t,this.#de=r,this.#p={...n},this.#le=e,this.#he=s}onResponseError(e,t){switch(t.code){case"ETIMEDOUT":case"ECONNREFUSED":if(this.#le.dualStack){if(!this.#ue)return void super.onResponseError(e,t);this.#ue=!1;const A="["===this.#de.hostname[0]?4:6,s=this.#le.pickFamily(this.#ge,A);if(null==s)return void super.onResponseError(e,t);let r;r="number"==typeof s.port?`:${s.port}`:""!==this.#ge.port?`:${this.#ge.port}`:"";const n={...this.#p,origin:`${this.#ge.protocol}//${6===s.family?`[${s.address}]`:s.address}${r}`};return void this.#he(n,this)}super.onResponseError(e,t);break;case"ENOTFOUND":this.#le.deleteRecords(this.#ge),super.onResponseError(e,t);break;default:super.onResponseError(e,t)}}}e.exports=e=>{if(null!=e?.maxTTL&&("number"!=typeof e?.maxTTL||e?.maxTTL<0))throw new i("Invalid maxTTL. Must be a positive number");if(null!=e?.maxItems&&("number"!=typeof e?.maxItems||e?.maxItems<1))throw new i("Invalid maxItems. Must be a positive number and greater than zero");if(null!=e?.affinity&&4!==e?.affinity&&6!==e?.affinity)throw new i("Invalid affinity. Must be either 4 or 6");if(null!=e?.dualStack&&"boolean"!=typeof e?.dualStack)throw new i("Invalid dualStack. Must be a boolean");if(null!=e?.lookup&&"function"!=typeof e?.lookup)throw new i("Invalid lookup. Must be a function");if(null!=e?.pick&&"function"!=typeof e?.pick)throw new i("Invalid pick. Must be a function");const t=e?.dualStack??!0;let A;A=t?e?.affinity??null:e?.affinity??4;const r=new c({maxTTL:e?.maxTTL??1e4,lookup:e?.lookup??null,pick:e?.pick??null,dualStack:t,affinity:A,maxItems:e?.maxItems??1/0});return e=>function(t,A){const n=t.origin.constructor===URL?t.origin:new URL(t.origin);return 0!==s(n.hostname)?e(t,A):(r.runLookup(n,t,((s,i)=>{if(s)return A.onResponseError(null,s);const o={...t,servername:n.hostname,origin:i.origin,headers:{host:n.host,...t.headers}};e(o,r.getHandler({origin:n,dispatch:e,handler:A,newOrigin:i},t))})),!0)}}},3562:(e,t,A)=>{"use strict";const{InvalidArgumentError:s,RequestAbortedError:r}=A(4465),n=A(6917);class i extends n{#t=1048576;#Ee=!1;#s=0;#$=null;aborted=!1;reason=!1;constructor({maxSize:e,signal:t},A){if(null!=e&&(!Number.isFinite(e)||e<1))throw new s("maxSize must be a number greater than 0");super(A),this.#t=e??this.#t}#q(e){this.aborted=!0,this.reason=e}onRequestStart(e,t){return e.abort=this.#q.bind(this),this.#$=e,super.onRequestStart(e,t)}onResponseStart(e,t,A,s){const n=A["content-length"];if(null!=n&&n>this.#t)throw new r(`Response size (${n}) larger than maxSize (${this.#t})`);return!0===this.aborted||super.onResponseStart(e,t,A,s)}onResponseError(e,t){this.#Ee||(t=this.#$?.reason??t,super.onResponseError(e,t))}onResponseData(e,t){return this.#s=this.#s+t.length,this.#s>=this.#t&&(this.#Ee=!0,!0===this.aborted?super.onResponseError(e,this.reason):super.onResponseEnd(e,{})),!0}onResponseEnd(e,t){this.#Ee||(!0!==this.#$.aborted?super.onResponseEnd(e,t):super.onResponseError(e,this.reason))}}e.exports=function({maxSize:e}={maxSize:1048576}){return t=>function(A,s){const{dumpMaxSize:r=e}=A,n=new i({maxSize:r,signal:A.signal},s);return t(A,n)}}},5132:(e,t,A)=>{"use strict";const s=A(8064);e.exports=function({maxRedirections:e}={}){return t=>function(A,r){const{maxRedirections:n=e,...i}=A;if(null==n||0===n)return t(A,r);const o={...i},a=new s(t,n,o,r);return t(o,a)}}},2936:(e,t,A)=>{"use strict";const s=A(6917),{ResponseError:r}=A(4465);class n extends s{#Ie;#Qe;#Ce;#Be;#pe;constructor(e,{handler:t}){super(t)}#fe(e){return 0===(this.#Qe??"").indexOf(e)}onRequestStart(e,t){return this.#Ie=0,this.#Qe=null,this.#Ce=null,this.#Be=null,this.#pe="",super.onRequestStart(e,t)}onResponseStart(e,t,A,s){if(this.#Ie=t,this.#Be=A,this.#Qe=A["content-type"],this.#Ie<400)return super.onResponseStart(e,t,A,s);(this.#fe("application/json")||this.#fe("text/plain"))&&(this.#Ce=new TextDecoder("utf-8"))}onResponseData(e,t){if(this.#Ie<400)return super.onResponseData(e,t);this.#pe+=this.#Ce?.decode(t,{stream:!0})??""}onResponseEnd(e,t){if(this.#Ie>=400){if(this.#pe+=this.#Ce?.decode(void 0,{stream:!1})??"",this.#fe("application/json"))try{this.#pe=JSON.parse(this.#pe)}catch{}let t;const A=Error.stackTraceLimit;Error.stackTraceLimit=0;try{t=new r("Response Error",this.#Ie,{body:this.#pe,headers:this.#Be})}finally{Error.stackTraceLimit=A}super.onResponseError(e,t)}else super.onResponseEnd(e,t)}onResponseError(e,t){super.onResponseError(e,t)}}e.exports=()=>e=>function(t,A){return e(t,new n(t,{handler:A}))}},532:(e,t,A)=>{"use strict";const s=A(6294);e.exports=e=>t=>function(A,r){return t(A,new s({...A,retryOptions:{...e,...A.retryOptions}},{handler:r,dispatch:t}))}},4178:(e,t,A)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SPECIAL_HEADERS=t.MINOR=t.MAJOR=t.HTAB_SP_VCHAR_OBS_TEXT=t.QUOTED_STRING=t.CONNECTION_TOKEN_CHARS=t.HEADER_CHARS=t.TOKEN=t.HEX=t.URL_CHAR=t.USERINFO_CHARS=t.MARK=t.ALPHANUM=t.NUM=t.HEX_MAP=t.NUM_MAP=t.ALPHA=t.STATUSES_HTTP=t.H_METHOD_MAP=t.METHOD_MAP=t.METHODS_RTSP=t.METHODS_ICE=t.METHODS_HTTP=t.HEADER_STATE=t.FINISH=t.STATUSES=t.METHODS=t.LENIENT_FLAGS=t.FLAGS=t.TYPE=t.ERROR=void 0;const s=A(3530);t.ERROR={OK:0,INTERNAL:1,STRICT:2,CR_EXPECTED:25,LF_EXPECTED:3,UNEXPECTED_CONTENT_LENGTH:4,UNEXPECTED_SPACE:30,CLOSED_CONNECTION:5,INVALID_METHOD:6,INVALID_URL:7,INVALID_CONSTANT:8,INVALID_VERSION:9,INVALID_HEADER_TOKEN:10,INVALID_CONTENT_LENGTH:11,INVALID_CHUNK_SIZE:12,INVALID_STATUS:13,INVALID_EOF_STATE:14,INVALID_TRANSFER_ENCODING:15,CB_MESSAGE_BEGIN:16,CB_HEADERS_COMPLETE:17,CB_MESSAGE_COMPLETE:18,CB_CHUNK_HEADER:19,CB_CHUNK_COMPLETE:20,PAUSED:21,PAUSED_UPGRADE:22,PAUSED_H2_UPGRADE:23,USER:24,CB_URL_COMPLETE:26,CB_STATUS_COMPLETE:27,CB_METHOD_COMPLETE:32,CB_VERSION_COMPLETE:33,CB_HEADER_FIELD_COMPLETE:28,CB_HEADER_VALUE_COMPLETE:29,CB_CHUNK_EXTENSION_NAME_COMPLETE:34,CB_CHUNK_EXTENSION_VALUE_COMPLETE:35,CB_RESET:31,CB_PROTOCOL_COMPLETE:38},t.TYPE={BOTH:0,REQUEST:1,RESPONSE:2},t.FLAGS={CONNECTION_KEEP_ALIVE:1,CONNECTION_CLOSE:2,CONNECTION_UPGRADE:4,CHUNKED:8,UPGRADE:16,CONTENT_LENGTH:32,SKIPBODY:64,TRAILING:128,TRANSFER_ENCODING:512},t.LENIENT_FLAGS={HEADERS:1,CHUNKED_LENGTH:2,KEEP_ALIVE:4,TRANSFER_ENCODING:8,VERSION:16,DATA_AFTER_CLOSE:32,OPTIONAL_LF_AFTER_CR:64,OPTIONAL_CRLF_AFTER_CHUNK:128,OPTIONAL_CR_BEFORE_LF:256,SPACES_AFTER_CHUNK_SIZE:512},t.METHODS={DELETE:0,GET:1,HEAD:2,POST:3,PUT:4,CONNECT:5,OPTIONS:6,TRACE:7,COPY:8,LOCK:9,MKCOL:10,MOVE:11,PROPFIND:12,PROPPATCH:13,SEARCH:14,UNLOCK:15,BIND:16,REBIND:17,UNBIND:18,ACL:19,REPORT:20,MKACTIVITY:21,CHECKOUT:22,MERGE:23,"M-SEARCH":24,NOTIFY:25,SUBSCRIBE:26,UNSUBSCRIBE:27,PATCH:28,PURGE:29,MKCALENDAR:30,LINK:31,UNLINK:32,SOURCE:33,PRI:34,DESCRIBE:35,ANNOUNCE:36,SETUP:37,PLAY:38,PAUSE:39,TEARDOWN:40,GET_PARAMETER:41,SET_PARAMETER:42,REDIRECT:43,RECORD:44,FLUSH:45,QUERY:46},t.STATUSES={CONTINUE:100,SWITCHING_PROTOCOLS:101,PROCESSING:102,EARLY_HINTS:103,RESPONSE_IS_STALE:110,REVALIDATION_FAILED:111,DISCONNECTED_OPERATION:112,HEURISTIC_EXPIRATION:113,MISCELLANEOUS_WARNING:199,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTI_STATUS:207,ALREADY_REPORTED:208,TRANSFORMATION_APPLIED:214,IM_USED:226,MISCELLANEOUS_PERSISTENT_WARNING:299,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,SWITCH_PROXY:306,TEMPORARY_REDIRECT:307,PERMANENT_REDIRECT:308,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,IM_A_TEAPOT:418,PAGE_EXPIRED:419,ENHANCE_YOUR_CALM:420,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL:430,REQUEST_HEADER_FIELDS_TOO_LARGE:431,LOGIN_TIMEOUT:440,NO_RESPONSE:444,RETRY_WITH:449,BLOCKED_BY_PARENTAL_CONTROL:450,UNAVAILABLE_FOR_LEGAL_REASONS:451,CLIENT_CLOSED_LOAD_BALANCED_REQUEST:460,INVALID_X_FORWARDED_FOR:463,REQUEST_HEADER_TOO_LARGE:494,SSL_CERTIFICATE_ERROR:495,SSL_CERTIFICATE_REQUIRED:496,HTTP_REQUEST_SENT_TO_HTTPS_PORT:497,INVALID_TOKEN:498,CLIENT_CLOSED_REQUEST:499,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,BANDWIDTH_LIMIT_EXCEEDED:509,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511,WEB_SERVER_UNKNOWN_ERROR:520,WEB_SERVER_IS_DOWN:521,CONNECTION_TIMEOUT:522,ORIGIN_IS_UNREACHABLE:523,TIMEOUT_OCCURED:524,SSL_HANDSHAKE_FAILED:525,INVALID_SSL_CERTIFICATE:526,RAILGUN_ERROR:527,SITE_IS_OVERLOADED:529,SITE_IS_FROZEN:530,IDENTITY_PROVIDER_AUTHENTICATION_ERROR:561,NETWORK_READ_TIMEOUT:598,NETWORK_CONNECT_TIMEOUT:599},t.FINISH={SAFE:0,SAFE_WITH_CB:1,UNSAFE:2},t.HEADER_STATE={GENERAL:0,CONNECTION:1,CONTENT_LENGTH:2,TRANSFER_ENCODING:3,UPGRADE:4,CONNECTION_KEEP_ALIVE:5,CONNECTION_CLOSE:6,CONNECTION_UPGRADE:7,TRANSFER_ENCODING_CHUNKED:8},t.METHODS_HTTP=[t.METHODS.DELETE,t.METHODS.GET,t.METHODS.HEAD,t.METHODS.POST,t.METHODS.PUT,t.METHODS.CONNECT,t.METHODS.OPTIONS,t.METHODS.TRACE,t.METHODS.COPY,t.METHODS.LOCK,t.METHODS.MKCOL,t.METHODS.MOVE,t.METHODS.PROPFIND,t.METHODS.PROPPATCH,t.METHODS.SEARCH,t.METHODS.UNLOCK,t.METHODS.BIND,t.METHODS.REBIND,t.METHODS.UNBIND,t.METHODS.ACL,t.METHODS.REPORT,t.METHODS.MKACTIVITY,t.METHODS.CHECKOUT,t.METHODS.MERGE,t.METHODS["M-SEARCH"],t.METHODS.NOTIFY,t.METHODS.SUBSCRIBE,t.METHODS.UNSUBSCRIBE,t.METHODS.PATCH,t.METHODS.PURGE,t.METHODS.MKCALENDAR,t.METHODS.LINK,t.METHODS.UNLINK,t.METHODS.PRI,t.METHODS.SOURCE,t.METHODS.QUERY],t.METHODS_ICE=[t.METHODS.SOURCE],t.METHODS_RTSP=[t.METHODS.OPTIONS,t.METHODS.DESCRIBE,t.METHODS.ANNOUNCE,t.METHODS.SETUP,t.METHODS.PLAY,t.METHODS.PAUSE,t.METHODS.TEARDOWN,t.METHODS.GET_PARAMETER,t.METHODS.SET_PARAMETER,t.METHODS.REDIRECT,t.METHODS.RECORD,t.METHODS.FLUSH,t.METHODS.GET,t.METHODS.POST],t.METHOD_MAP=(0,s.enumToMap)(t.METHODS),t.H_METHOD_MAP=Object.fromEntries(Object.entries(t.METHODS).filter((([e])=>e.startsWith("H")))),t.STATUSES_HTTP=[t.STATUSES.CONTINUE,t.STATUSES.SWITCHING_PROTOCOLS,t.STATUSES.PROCESSING,t.STATUSES.EARLY_HINTS,t.STATUSES.RESPONSE_IS_STALE,t.STATUSES.REVALIDATION_FAILED,t.STATUSES.DISCONNECTED_OPERATION,t.STATUSES.HEURISTIC_EXPIRATION,t.STATUSES.MISCELLANEOUS_WARNING,t.STATUSES.OK,t.STATUSES.CREATED,t.STATUSES.ACCEPTED,t.STATUSES.NON_AUTHORITATIVE_INFORMATION,t.STATUSES.NO_CONTENT,t.STATUSES.RESET_CONTENT,t.STATUSES.PARTIAL_CONTENT,t.STATUSES.MULTI_STATUS,t.STATUSES.ALREADY_REPORTED,t.STATUSES.TRANSFORMATION_APPLIED,t.STATUSES.IM_USED,t.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,t.STATUSES.MULTIPLE_CHOICES,t.STATUSES.MOVED_PERMANENTLY,t.STATUSES.FOUND,t.STATUSES.SEE_OTHER,t.STATUSES.NOT_MODIFIED,t.STATUSES.USE_PROXY,t.STATUSES.SWITCH_PROXY,t.STATUSES.TEMPORARY_REDIRECT,t.STATUSES.PERMANENT_REDIRECT,t.STATUSES.BAD_REQUEST,t.STATUSES.UNAUTHORIZED,t.STATUSES.PAYMENT_REQUIRED,t.STATUSES.FORBIDDEN,t.STATUSES.NOT_FOUND,t.STATUSES.METHOD_NOT_ALLOWED,t.STATUSES.NOT_ACCEPTABLE,t.STATUSES.PROXY_AUTHENTICATION_REQUIRED,t.STATUSES.REQUEST_TIMEOUT,t.STATUSES.CONFLICT,t.STATUSES.GONE,t.STATUSES.LENGTH_REQUIRED,t.STATUSES.PRECONDITION_FAILED,t.STATUSES.PAYLOAD_TOO_LARGE,t.STATUSES.URI_TOO_LONG,t.STATUSES.UNSUPPORTED_MEDIA_TYPE,t.STATUSES.RANGE_NOT_SATISFIABLE,t.STATUSES.EXPECTATION_FAILED,t.STATUSES.IM_A_TEAPOT,t.STATUSES.PAGE_EXPIRED,t.STATUSES.ENHANCE_YOUR_CALM,t.STATUSES.MISDIRECTED_REQUEST,t.STATUSES.UNPROCESSABLE_ENTITY,t.STATUSES.LOCKED,t.STATUSES.FAILED_DEPENDENCY,t.STATUSES.TOO_EARLY,t.STATUSES.UPGRADE_REQUIRED,t.STATUSES.PRECONDITION_REQUIRED,t.STATUSES.TOO_MANY_REQUESTS,t.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,t.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,t.STATUSES.LOGIN_TIMEOUT,t.STATUSES.NO_RESPONSE,t.STATUSES.RETRY_WITH,t.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,t.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,t.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,t.STATUSES.INVALID_X_FORWARDED_FOR,t.STATUSES.REQUEST_HEADER_TOO_LARGE,t.STATUSES.SSL_CERTIFICATE_ERROR,t.STATUSES.SSL_CERTIFICATE_REQUIRED,t.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,t.STATUSES.INVALID_TOKEN,t.STATUSES.CLIENT_CLOSED_REQUEST,t.STATUSES.INTERNAL_SERVER_ERROR,t.STATUSES.NOT_IMPLEMENTED,t.STATUSES.BAD_GATEWAY,t.STATUSES.SERVICE_UNAVAILABLE,t.STATUSES.GATEWAY_TIMEOUT,t.STATUSES.HTTP_VERSION_NOT_SUPPORTED,t.STATUSES.VARIANT_ALSO_NEGOTIATES,t.STATUSES.INSUFFICIENT_STORAGE,t.STATUSES.LOOP_DETECTED,t.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,t.STATUSES.NOT_EXTENDED,t.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,t.STATUSES.WEB_SERVER_UNKNOWN_ERROR,t.STATUSES.WEB_SERVER_IS_DOWN,t.STATUSES.CONNECTION_TIMEOUT,t.STATUSES.ORIGIN_IS_UNREACHABLE,t.STATUSES.TIMEOUT_OCCURED,t.STATUSES.SSL_HANDSHAKE_FAILED,t.STATUSES.INVALID_SSL_CERTIFICATE,t.STATUSES.RAILGUN_ERROR,t.STATUSES.SITE_IS_OVERLOADED,t.STATUSES.SITE_IS_FROZEN,t.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,t.STATUSES.NETWORK_READ_TIMEOUT,t.STATUSES.NETWORK_CONNECT_TIMEOUT],t.ALPHA=[];for(let e="A".charCodeAt(0);e<="Z".charCodeAt(0);e++)t.ALPHA.push(String.fromCharCode(e)),t.ALPHA.push(String.fromCharCode(e+32));t.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9},t.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},t.NUM=["0","1","2","3","4","5","6","7","8","9"],t.ALPHANUM=t.ALPHA.concat(t.NUM),t.MARK=["-","_",".","!","~","*","'","(",")"],t.USERINFO_CHARS=t.ALPHANUM.concat(t.MARK).concat(["%",";",":","&","=","+","$",","]),t.URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(t.ALPHANUM),t.HEX=t.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]),t.TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(t.ALPHANUM),t.HEADER_CHARS=["\t"];for(let e=32;e<=255;e++)127!==e&&t.HEADER_CHARS.push(e);t.CONNECTION_TOKEN_CHARS=t.HEADER_CHARS.filter((e=>44!==e)),t.QUOTED_STRING=["\t"," "];for(let e=33;e<=255;e++)34!==e&&92!==e&&t.QUOTED_STRING.push(e);t.HTAB_SP_VCHAR_OBS_TEXT=["\t"," "];for(let e=33;e<=126;e++)t.HTAB_SP_VCHAR_OBS_TEXT.push(e);for(let e=128;e<=255;e++)t.HTAB_SP_VCHAR_OBS_TEXT.push(e);t.MAJOR=t.NUM_MAP,t.MINOR=t.MAJOR,t.SPECIAL_HEADERS={connection:t.HEADER_STATE.CONNECTION,"content-length":t.HEADER_STATE.CONTENT_LENGTH,"proxy-connection":t.HEADER_STATE.CONNECTION,"transfer-encoding":t.HEADER_STATE.TRANSFER_ENCODING,upgrade:t.HEADER_STATE.UPGRADE},t.default={ERROR:t.ERROR,TYPE:t.TYPE,FLAGS:t.FLAGS,LENIENT_FLAGS:t.LENIENT_FLAGS,METHODS:t.METHODS,STATUSES:t.STATUSES,FINISH:t.FINISH,HEADER_STATE:t.HEADER_STATE,ALPHA:t.ALPHA,NUM_MAP:t.NUM_MAP,HEX_MAP:t.HEX_MAP,NUM:t.NUM,ALPHANUM:t.ALPHANUM,MARK:t.MARK,USERINFO_CHARS:t.USERINFO_CHARS,URL_CHAR:t.URL_CHAR,HEX:t.HEX,TOKEN:t.TOKEN,HEADER_CHARS:t.HEADER_CHARS,CONNECTION_TOKEN_CHARS:t.CONNECTION_TOKEN_CHARS,QUOTED_STRING:t.QUOTED_STRING,HTAB_SP_VCHAR_OBS_TEXT:t.HTAB_SP_VCHAR_OBS_TEXT,MAJOR:t.MAJOR,MINOR:t.MINOR,SPECIAL_HEADERS:t.SPECIAL_HEADERS,METHODS_HTTP:t.METHODS_HTTP,METHODS_ICE:t.METHODS_ICE,METHODS_RTSP:t.METHODS_RTSP,METHOD_MAP:t.METHOD_MAP,H_METHOD_MAP:t.H_METHOD_MAP,STATUSES_HTTP:t.STATUSES_HTTP}},4744:(e,t,A)=>{"use strict";e=A.nmd(e);const{Buffer:s}=A(4573);let r;Object.defineProperty(e,"exports",{get:()=>r||(r=s.from("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ARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgL5YUCAgd/A34gASACaiEEAkAgACIDKAIMIgANACADKAIEBEAgAyABNgIECyMAQRBrIgkkAAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAA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AJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAg7jAQABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEjJCUnKCmeA5sDmgORA4oDgwOAA/0C+wL4AvIC8QLvAu0C6ALnAuYC5QLkAtwC2wLaAtkC2ALXAtYC1QLPAs4CzALLAsoCyQLIAscCxgLEAsMCvgK8AroCuQK4ArcCtgK1ArQCswKyArECsAKuAq0CqQKoAqcCpgKlAqQCowKiAqECoAKfApgCkAKMAosCigKBAv4B/QH8AfsB+gH5AfgB9wH1AfMB8AHrAekB6AHnAeYB5QHkAeMB4gHhAeAB3wHeAd0B3AHaAdkB2AHXAdYB1QHUAdMB0gHRAdABzwHOAc0BzAHLAcoByQHIAccBxgHFAcQBwwHCAcEBwAG/Ab4BvQG8AbsBugG5AbgBtwG2Ab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AqICogKiAqICogKiAqICogKiAqICogKiAqICogIAogILIAQgAUEBaiIBRw0AC0HJACECDOwCCyABQQFqIQEgA0Evai0AAEEBcQ2lAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgzrAgsgASAERwRAA0AgAS0AAEEgRw0VIAQgAUEBaiIBRw0AC0H4ACECDOsCC0H4ACECDOoCCyADQQI6ACgMOAtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQM6AILQQAhAgzOAgtBDSECDM0CC0ETIQIMzAILQRUhAgzLAgtBFiECDMoCC0EYIQIMyQILQRkhAgzIAgtBGiECDMcCC0EbIQIMxgILQRwhAgzFAgtBHSECDMQCC0EeIQIMwwILQR8hAgzCAgtBICECDMECC0EiIQIMwAILQSMhAgy/AgtBJSECDL4CC0HlACECDL0CCyADQT02AhwgAyABNgIUIAMgADYCDEEAIQIM1QILIANBGzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDNQCCyADQSA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzTAgsgA0ETNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0gILIANBCzYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNECCyADQRA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzQAgsgA0EgNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzwILIANBCzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM4CCyADQQw2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzNAgtBACECIANBADYCHCADIAE2AhQgA0HdDjYCECADQRI2AgwMzAILAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB/QEhAgzMAgsCQAJAIAMtADZBAUcNAEEAIQACQCADKAI4IgJFDQAgAigCYCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUcNASADQfwBNgIcIAMgATYCFCADQdwZNgIQIANBFTYCDEEAIQIMzQILQdwBIQIMswILIANBADYCHCADIAE2AhQgA0H5CzYCECADQR82AgxBACECDMsCCwJAAkAgAy0AKEEBaw4CBAEAC0HbASECDLICC0HUASECDLECCyADQQI6ADFBACEAAkAgAygCOCICRQ0AIAIoAgAiAkUNACADIAIRAAAhAAsgAEUEQEHdASECDLECCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQbQMNgIQIANBEDYCDEEAIQIMygILIANB+wE2AhwgAyABNgIUIANBgRo2AhAgA0EVNgIMQQAhAgzJAgsgASAERgRAQfoBIQIMyQILIAEtAABByABGDQEgA0EBOgAoC0HAASECDK4CC0HaASECDK0CCyABIARHBEAgA0EMNgIIIAMgATYCBEHZASECDK0CC0H5ASECDMUCCyABIARGBEBB+AEhAgzFAgsgAS0AAEHIAEcNBCABQQFqIQFB2AEhAgyrAgsgASAERgRAQfcBIQIMxAILAkACQCABLQAAQcUAaw4QAAUFBQUFBQUFBQUFBQUFAQULIAFBAWohAUHWASECDKsCCyABQQFqIQFB1wEhAgyqAgtB9gEhAiABIARGDcICIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbrVAGotAABHDQMgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMMCCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIARQRAQeMBIQIMqgILIANB9QE2AhwgAyABNgIUIAMgADYCDEEAIQIMwgILQfQBIQIgASAERg3BAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEG41QBqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzCAgsgA0GBBDsBKCADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIADQMMAgsgA0EANgIAC0EAIQIgA0EANgIcIAMgATYCFCADQeUfNgIQIANBCDYCDAy/AgtB1QEhAgylAgsgA0HzATYCHCADIAE2AhQgAyAANgIMQQAhAgy9AgtBACEAAkAgAygCOCICRQ0AIAIoAkAiAkUNACADIAIRAAAhAAsgAEUNbiAAQRVHBEAgA0EANgIcIAMgATYCFCADQYIPNgIQIANBIDYCDEEAIQIMvQILIANBjwE2AhwgAyABNgIUIANB7Bs2AhAgA0EVNgIMQQAhAgy8AgsgASAERwRAIANBDTYCCCADIAE2AgRB0wEhAgyjAgtB8gEhAgy7AgsgASAERgRAQfEBIQIMuwILAkACQAJAIAEtAABByABrDgsAAQgICAgICAgIAggLIAFBAWohAUHQASECDKMCCyABQQFqIQFB0QEhAgyiAgsgAUEBaiEBQdIBIQIMoQILQfABIQIgASAERg25AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBtdUAai0AAEcNBCAAQQJGDQMgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuQILQe8BIQIgASAERg24AiADKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABBs9UAai0AAEcNAyAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuAILQe4BIQIgASAERg23AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMtwILIAMoAgQhACADQgA3AwAgAyAAIAVBAWoiARArIgBFDQIgA0HsATYCHCADIAE2AhQgAyAANgIMQQAhAgy2AgsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNnAIgA0HtATYCHCADIAE2AhQgAyAANgIMQQAhAgy0AgtBzwEhAgyaAgtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDLQCC0HOASECDJoCCyADQesBNgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMsgILIAEgBEYEQEHrASECDLICCyABLQAAQS9GBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GyODYCECADQQg2AgxBACECDLECC0HNASECDJcCCyABIARHBEAgA0EONgIIIAMgATYCBEHMASECDJcCC0HqASECDK8CCyABIARGBEBB6QEhAgyvAgsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFBywEhAgyWAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZcCIANB6AE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAEgBEYEQEHnASECDK4CCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5gE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILQcoBIQIMlAILIAEgBEYEQEHlASECDK0CC0EAIQBBASEFQQEhB0EAIQICQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQCABLQAAQTBrDgoKCQABAgMEBQYICwtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshAkEAIQVBACEHDAILQQkhAkEBIQBBACEFQQAhBwwBC0EAIQVBASECCyADIAI6ACsgAUEBaiEBAkACQCADLQAuQRBxDQACQAJAAkAgAy0AKg4DAQACBAsgB0UNAwwCCyAADQEMAgsgBUUNAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDQIgA0HiATYCHCADIAE2AhQgAyAANgIMQQAhAgyvAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZoCIANB4wE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ2YAiADQeQBNgIcIAMgATYCFCADIAA2AgwMrQILQckBIQIMkwILQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgytAgtByAEhAgyTAgsgA0HhATYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDKsCCyABIARGBEBB4QEhAgyrAgsCQCABLQAAQSBGBEA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BCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtB2wEhAgymAgsgAygCBCEAIANBADYCBCADIAAgARAtIgBFBEAgAUEBaiEBDAQLIANB2gE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMpQILIAMoAgQhACADQQA2AgQgAyAAIAEQLSIADQEgAUEBagshAUHBASECDIoCCyADQdkBNgIcIAMgADYCDCADIAFBAWo2AhRBACECDKICC0HCASECDIgCCyADQS9qLQAAQQFxDQEgA0EANgIcIAMgATYCFCADQeQcNgIQIANBGTYCDEEAIQIMoAILIAEgBEYEQEHZASECDKACCwJAAkACQCABLQAAQQprDgQBAgIAAgsgAUEBaiEBDAILIAFBAWohAQwBCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAjwiAkUNACADIAIRAAAhAAsgAEUNoAEgAEEVRgRAIANB2QA2AhwgAyABNgIUIANBtxo2AhAgA0EVNgIMQQAhAgyfAgsgA0EANgIcIAMgATYCFCADQYANNgIQIANBGzYCDEEAIQIMngILIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDJ0CCyABIARHBEAgA0EMNgIIIAMgATYCBEG/ASECDIQCC0HYASECDJwCCyABIARGBEBB1wEhAgycAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBwQBrDhUAAQIDWgQFBlpaWgcICQoLDA0ODxBaCyABQQFqIQFB+wAhAgySAgsgAUEBaiEBQfwAIQIMkQILIAFBAWohAUGBASECDJACCyABQQFqIQFBhQEhAgyPAgsgAUEBaiEBQYYBIQIMjgILIAFBAWohAUGJASECDI0CCyABQQFqIQFBigEhAgyMAgsgAUEBaiEBQY0BIQIMiwILIAFBAWohAUGWASECDIoCCyABQQFqIQFBlwEhAgyJAgsgAUEBaiEBQZgBIQIMiAILIAFBAWohAUGlASECDIcCCyABQQFqIQFBpgEhAgyGAgsgAUEBaiEBQawBIQIMhQILIAFBAWohAUG0ASECDIQCCyABQQFqIQFBtwEhAgyDA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NgIADPoBCyADQQA2AgAgBkEBaiEBQQMMJgtBtAEhAiABIARGDfgBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQejUAGotAABHDSUgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPkBCyADQQA2AgAgBkEBaiEBQSYMJQsgASAERgRAQbMBIQIM+AELAkACQCABLQAAQdQAaw4CAAEnCyABQQFqIQFBmQEhAgzfAQsgAUEBaiEBQZoBIQIM3gELQbIBIQIgASAERg32ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHm1ABqLQAARw0jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz3AQsgA0EANgIAIAZBAWohAUEnDCMLQbEBIQIgASAERg31ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHk1ABqLQAARw0iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz2AQsgA0EANgIAIAZBAWohAUEcDCILQbABIQIgASAERg30ASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHe1ABqLQAARw0hIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz1AQsgA0EANgIAIAZBAWohAUEGDCELQa8BIQIgASAERg3zASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHZ1ABqLQAARw0gIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz0AQsgA0EANgIAIAZBAWohAUEZDCALIAEgBEYEQEGuASECDPMBCwJAAkACQAJAIAEtAABBLWsOIwAkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJAEkJCQkJAIkJCQDJAsgAUEBaiEBQY4BIQIM3AELIAFBAWohAUGPASECDNsBCyABQQFqIQFBlAEhAgzaAQsgAUEBaiEBQZUBIQIM2QELQa0BIQIgASAERg3xASADKAIAIgAgBCABa2ohBSABIAB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dUBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQaDUAGotAABHDQIgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNYBCyADQQA2AgAgBkEBaiEBQSQMAgsgA0EANgIADAILIAEgBEYEQEGRASECDNQBCyABLQAAQcwARw0BIAFBAWohAUETCzoAKSADKAIEIQAgA0EANgIEIAMgACABEC4iAA0CDAELQQAhAiADQQA2AhwgAyABNgIUIANB/h82AhAgA0EGNgIMDNEBC0H4ACECDLcBCyADQZABNgIcIAMgATYCFCADIAA2AgxBACECDM8BC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUYNASADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgzOAQtB9wAhAgy0AQsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDMwBCyABIARGBEBBjwEhAgzMAQsCQCABLQAAQSBGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GbHzYCECADQQY2AgxBACECDMwBC0ECIQIMsgELA0AgAS0AAEEgRw0CIAQgAUEBaiIBRw0AC0GOASECDMoBCyABIARGBEBBjQEhAgzKAQsCQCABLQAAQQlrDgRKAABKAAtB9QAhAgywAQsgAy0AKUEFRgRAQfYAIQIMsAELQfQAIQIMrwELIAEgBEYEQEGMASECDMgBCyADQRA2AgggAyABNgIEDAoLIAEgBEYEQEGLASECDMcBCwJAIAEtAABBCWsOBEcAAEcAC0HzACECDK0BCyABIARHBEAgA0EQNgIIIAMgATYCBEHxACECDK0BC0GKASECDMUBCwJAIAEgBEcEQANAIAEtAABBoNAAai0AACIAQQNHBEACQCAAQQFrDgJJAAQLQfAAIQIMrwELIAQgAUEBaiIBRw0AC0GIASECDMYBC0GIASECDMUBCyADQQA2AhwgAyABNgIUIANB2yA2AhAgA0EHNgIMQQAhAgzEAQsgASAERgRAQYkBIQIMxAELAkACQAJAIAEtAABBoNIAai0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hQgAyAANgIMQQAhAgy3AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMtgELQewAIQIMnAELIAEgBEYEQEGCASECDLUBCyABQQFqDAILIAEgBEYEQEGBASECDLQBCyABQQFqDAELIAEgBEYNASABQQFqCyEBQQQhAgyYAQtBgAEhAgywAQsDQCABLQAAQaDMAGotAAAiAEECRwRAIABBAUcEQEHpACECDJkBCwwxCyAEIAFBAWoiAUcNAAtB/wAhAgyvAQsgASAERgRAQf4AIQIMrwELAkAgAS0AAEEJaw43LwMGLwQGBgYGBgYGBgYGBgYGBgYGBgYFBgYCBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGAAYLIAFBAWoLIQFBBSECDJQBCyABQQFqDAYLIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIANBADYCHCADIAE2AhQgA0GNFDYCECADQQc2AgxBACECDKgBCwJAAkACQAJAA0AgAS0AAEGgygBqLQAAIgBBBUcEQAJAIABBAWsOBi4DBAUGAAYLQegAIQIMlAELIAQgAUEBaiIBRw0AC0H9ACECDKsBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQdsANgIcIAMgATYCFCADIAA2AgxBACECDKoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDKkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQfoANgIcIAMgATYCFCADIAA2AgxBACECDKgBCyADQQA2AhwgAyABNgIUIANB5Ag2AhAgA0EHNgIMQQAhAgynAQsgASAERg0BIAFBAWoLIQFBBiECDIwBC0H8ACECDKQBCwJAAkACQA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IRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJwBC0HhACECDIIBCyADQfMANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMmgELIAMtACkiAEEja0ELSQ0JAkAgAEEGSw0AQQEgAHRBygBxRQ0ADAoLQQAhAiADQQA2AhwgAyABNgIUIANB7Qk2AhAgA0EINgIMDJkBC0HyACECIAEgBEYNmAEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBs9UAai0AAEcNBSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMmQELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfEANgIcIAMgATYCFCADIAA2AgxBACECDJkBC0HfACECDH8LQQAhAAJAIAMoAjgiAkUNACACKAI0IgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANB6g02AhAgA0EmNgIMQQAhAgyZAQtB3gAhAgx/CyADQfAANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMlwELIAMtAClBIUYNBiADQQA2AhwgAyABNgIUIANBkQo2AhAgA0EINgIMQQAhAgyWAQtB7wAhAiABIARGDZUBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDVAGotAABHDQIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIARQ0CIANB7QA2AhwgAyABNgIUIAMgADYCDEEAIQIMlQELIANBADYCAAsgAygCBCEAIANBADYCBCADIAAgARArIgBFDYABIANB7gA2AhwgAyABNgIUIAMgADYCDEEAIQIMkwELQdwAIQIMeQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJMBC0HbACECDHkLIANB7AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyRAQsgAy0AKSIAQSNJDQAgAEEuRg0AIANBADYCHCADIAE2AhQgA0HJCTYCECADQQg2AgxBACECDJABC0HaACECDHYLIAEgBEYEQEHrACECDI8BCwJAIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMjwELQdkAIQIMdQsgASAERwRAIANBDjYCCCADIAE2AgRB2AAhAgx1C0HqACECDI0BCyABIARGBEBB6QAhAgyNAQsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFB1wAhAgx0CyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeiADQegANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyABIARGBEBB5wAhAgyMAQsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELQdYAIQIMcgsgASAERgRAQeUAIQIMiwELQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIANgIcIAMgATYCFCADIAA2AgxBACECDI0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNfSADQeMANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeyADQeQANgIcIAMgATYCFCADIAA2AgwMiwELQdQAIQIMcQsgAy0AKUEiRg2GAUHTACECDHALQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALIABFBEBB1QAhAgxwCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQaQNNgIQIANBITYCDEEAIQIMiQELIANB4QA2AhwgAyABNgIUIANB0Bo2AhAgA0EVNgIMQQAhAgyIAQsgASAERgRAQeAAIQIMiAELAkACQAJAAkACQCABLQAAQQprDgQBBAQABAsgAUEBaiEBDAELIAFBAWohASADQS9qLQAAQQFxRQ0BC0HSACECDHALIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIgBCyADQQA2AhwgAyABNgIUIANBthE2AhAgA0EJNgIMQQAhAgyHAQsgASAERgRAQd8AIQIMhwELIAEtAABBCkYEQCABQQFqIQEMCQsgAy0ALkHAAHENCCADQQA2AhwgAyABNgIUIANBthE2AhAgA0ECNgIMQQAhAgyGAQsgASAERgRAQd0AIQIMhgELIAEtAAAiAkENRgRAIAFBAWohAUHQACECDG0LIAEhACACQQlrDgQFAQEFAQsgBCABIgBGBEBB3AAhAgyFAQsgAC0AAEEKRw0AIABBAWoMAgtBACECIANBADYCHCADIAA2AhQgA0HKLTYCECADQQc2AgwMgwELIAEgBEYEQEHbACECDIMBCwJAIAEtAABBCWsOBAMAAAMACyABQQFqCyEBQc4AIQIMaAsgASAERgRAQdoAIQIMgQELIAEtAABBCWsOBAABAQABC0EAIQIgA0EANgIcIANBmhI2AhAgA0EHNgIMIAMgAUEBajYCFAx/CyADQYASOwEqQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2QA2AhwgAyABNgIUIANB6ho2AhAgA0EVNgIMQQAhAgx+C0HNACECDGQLIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDHwLIAEgBEYEQEHZACECDHwLIAEtAABBIEcNPSABQQFqIQEgAy0ALkEBcQ09IANBADYCHCADIAE2AhQgA0HCHDYCECADQR42AgxBACECDHsLIAEgBEYE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hAiAEIAEiAEYNViAEIAFrIAMoAgAiAWohBiAAIAFrQQNqIQcCQANAIAFBsMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQNGBEBBBiEBDD0LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFcLIANBADYCACAAIQEMAwsCQANAIAEtAAAiAEEgRwRAIABBCmsOBAcEBAcCCyAEIAFBAWoiAUcNAAtBOCECDFYLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCADLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIANBAToALCADIAMvATIgAXI7ATIgACEBDAELIAMgAy8BMkEIcjsBMiAAIQELQT4hAgw7CyADQQA6ACwLQTkhAgw5CyABIARGBEBBNiECDFILAkACQAJAAkACQCABLQAAQQprDgQAAgIBAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDQIgA0EzNgIcIAMgATYCFCADIAA2AgxBACECDFULIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQRAIAFBAWohAQwGCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMVAsgAy0ALkEBcQRAQd8BIQIMOwsgAygCBCEAIANBADYCBCADIAAgARAxIgANAQxJC0E0IQIMOQsgA0E1NgIcIAMgATYCFCADIAA2AgxBACECDFELQTUhAgw3CyADQS9qLQAAQQFxDQAgA0EANgIcIAMgATYCFCADQesWNgIQIANBGTYCDEEAIQIMTwtBMyECDDULIAEgBEYEQEEyIQIMTgsCQCABLQAAQQpGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GSFzYCECADQQM2AgxBACECDE4LQTIhAgw0CyABIARGBEBBMSECDE0LAkAgAS0AACIAQQlGDQAgAEEgRg0AQQEhAgJAIAMtACxBBWsOBAYEBQANCyADIAMvATJBCHI7ATIMDAsgAy0ALkEBcUUNASADLQAsQQhHDQAgA0EAOgAsC0E9IQIMMgsgA0EANgIcIAMgATYCFCADQcIWNgIQIANBCjYCDEEAIQIMSgtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgwGCyABIARGBEBBMCECDEcLIAEtAABBCkYEQCABQQFqIQEMAQsgAy0ALkEBcQ0AIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDEYLQTAhAgwsCyABQQFqIQFBMSECDCsLIAEgBEYEQEEvIQIMRAsgAS0AACIAQQlHIABBIEdxRQRAIAFBAWohASADLQAuQQFxDQEgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDEEAIQIMRAtBASECAkACQAJAAkACQAJAIAMtACxBAmsOBwUEBAMBAgAECyADIAMvATJBCHI7ATIMAwtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgtBLyECDCsLIANBADYCHCADIAE2AhQgA0GEEzYCECADQQs2AgxBACECDEMLQeEBIQIMKQsgASAERgRAQS4hAgxCCyADQQA2AgQgA0ESNgIIIAMgASABEDEiAA0BC0EuIQIMJwsgA0EtNgIcIAMgATYCFCADIAA2AgxBACECDD8LQQAhAAJAIAMoAjgiAkUNACACKAJMIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2AA2AhwgAyABNgIUIANBsxs2AhAgA0EVNgIMQQAhAgw+C0HMACECDCQLIANBADYCHCADIAE2AhQgA0GzDjYCECADQR02AgxBACECDDwLIAEgBEYEQEHOACECDDwLIAEtAAAiAEEgRg0CIABBOkYNAQsgA0EAOgAsQQkhAgwhCyADKAIEIQAgA0EANgIEIAMgACABEDAiAA0BDAILIAMtAC5BAXEEQEHeASECDCALIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0CIANBKjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgw4CyADQcsANgIcIAMgADYCDCADIAFBAWo2AhRBACECDDcLIAFBAWohAUHAACECDB0LIAFBAWohAQwsCyABIARGBEBBKyECDDULAkAgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQcAAcUUNBgsgAy0AMkGAAXEEQEEAIQACQC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PUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==","base64"))})},7136:(e,t,A)=>{"use strict";e=A.nmd(e);const{Buffer:s}=A(4573);let r;Object.defineProperty(e,"exports",{get:()=>r||(r=s.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsb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AhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgLhocCAwd/A34BeyABIAJqIQQCQCAAIgMoAgwiAA0AIAMoAgQEQCADIAE2AgQLIwBBEGsiCSQAAkACQAJAAkACQAJAA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QAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAn8CQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAwJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCACDuMBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISMkJScoKZ4DmwOaA5EDigODA4AD/QL7AvgC8gLxAu8C7QLoAucC5gLlAuQC3ALbAtoC2QLYAtcC1gLVAs8CzgLMAssCygLJAsgCxwLGAsQCwwK+ArwCugK5ArgCtwK2ArUCtAKzArICsQKwAq4CrQKpAqgCpwKmAqUCpAKjAqICoQKgAp8CmAKQAowCiwKKAoEC/gH9AfwB+w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f4VWDQEgAyAKIAt8NwMgIAQgAUEBaiIBRw0AC0HAACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABQQFqIgEQMSIADRcM4gILQcAAIQIM7AILIAEgBEYEQEHJACECDOwCCwJAA0ACQCABLQAAQQlrDhgAAqICogKpAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAgCiAgsgBCABQQFqIgFHDQALQckAIQIM7AILIAFBAWohASADQS9qLQAAQQFxDaUCIANBADYCHCADIAE2AhQgA0GXEDYCECADQQo2AgxBACECDOsCCyABIARHBEADQCABLQAAQSBHDRUgBCABQQFqIgFHDQALQfgAIQIM6wILQfgAIQIM6gILIANBAjoAKAw4C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAzoAgtBACECDM4CC0ENIQIMzQILQRMhAgzMAgtBFSECDMsCC0EWIQIMygILQRghAgzJAgtBGSECDMgCC0EaIQIMxwILQRshAgzGAgtBHCECDMUCC0EdIQIMxAILQR4hAgzDAgtBHyECDMICC0EgIQIMwQILQSIhAgzAAgtBIyECDL8CC0ElIQIMvgILQeUAIQIMvQILIANBPTYCHCADIAE2AhQgAyAANgIMQQAhAgzVAgsgA0EbNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIM1AILIANBIDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNMCCyADQRM2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzSAgsgA0ELNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0QILIANBEDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNACCyADQSA2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzPAgsgA0ELNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzgILIANBDDYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM0CC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAzMAgsCQANAAkAg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CyADQYEEOwEoIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgANAwwCCyADQQA2AgALQQAhAiADQQA2AhwgAyABNgIUIANB5R82AhAgA0EINgIMDL8CC0HVASECDKUCCyADQfMBNgIcIAMgATYCFCADIAA2AgxBACECDL0CC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ1uIABBFUcEQCADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgy9AgsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDLwCCyABIARHBEAgA0ENNgIIIAMgATYCBEHTASECDKMCC0HyASECDLsCCyABIARGBEBB8QEhAgy7AgsCQAJAAkAgAS0AAEHIAGsOCwABCAgICAgICAgCCAsgAUEBaiEBQdABIQIMowILIAFBAWohAUHRASECDKICCyABQQFqIQFB0gEhAgyhAgtB8AEhAiABIARGDbkCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEG11QBqLQAARw0EIABBAkYNAyAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy5AgtB7wEhAiABIARGDbgCIAMoAgAiACAEIAFraiEGIAEgAGtBAWohBQNAIAEtAAAgAEGz1QBqLQAARw0DIABBAUYNAiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy4AgtB7gEhAiABIARGDbcCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEGw1QBqLQAARw0CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy3AgsgAygCBCEAIANCADcDACADIAAgBUEBaiIBECsiAEUNAiADQewBNgIcIAMgATYCFCADIAA2AgxBACECDLYCCyADQQA2AgALIAMoAgQhACADQQA2AgQgAyAAIAEQKyIARQ2cAiADQe0BNgIcIAMgATYCFCADIAA2AgxBACECDLQCC0HPASECDJoCC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMtAILQc4BIQIMmgILIANB6wE2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyyAgsgASAERgRAQesBIQIMsgILIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMsQILQc0BIQIMlwILIAEgBEcEQCADQQ42AgggAyABNgIEQcwBIQIMlwILQeoBIQIMrwILIAEgBEYEQEHpASECDK8CCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHLASECDJYCCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNlwIgA0HoATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgASAERgRAQecBIQIMrgILAkAgAS0AAEEuRgRAIAFBAWohAQwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmAIgA0HmATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgtBygEhAgyUAgsgASAERgRAQeUBIQIMrQILQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIBNgIcIAMgATYCFCADIAA2AgxBACECDK8CCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmgIgA0HjATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5AE2AhwgAyABNgIUIAMgADYCDAytAgtByQEhAgyTAgtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GkDTYCECADQSE2AgxBACECDK0CC0HIASECDJMCCyADQeEBNgIcIAMgATYCFCADQdAaNgIQIANBFTYCDEEAIQIMqwILIAEgBEYEQEHhASECDKsCCwJAIAEtAABBIEYEQCADQQA7ATQgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GZETYCECADQQk2AgxBACECDKsCC0HHASECDJECCyABIARGBEBB4AEhAgyqAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKsCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyqAgtBxgEhAgyQAgsgASAERgRAQd8BIQIMqQILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyqAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqQILQcUBIQIMjwILIAEgBEYEQEHeASECDKgCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqQILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKgCC0HEASECDI4CCyABIARGBEBB3QEhAgynAgsCQAJAAkACQCABLQAAQQprDhcCAwMAAwMDAwMDAwMDAwMDAwMDAwMDAQMLIAFBAWoMBQsgAUEBaiEBQcMBIQIMjwILIAFBAWohASADQS9qLQAAQQFxDQggA0EANgIcIAMgATYCFCADQY0LNgIQIANBDTYCDEEAIQIMpwILIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKYCCyABIARHBEAgA0EPNgIIIAMgATYCBEEBIQIMjQILQdwBIQIMpQILAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0HbASECDKYCCyADKAIEIQAgA0EANgIEIAMgACABEC0iAEUEQCABQQFqIQEMBAsgA0HaATYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgylAgsgAygCBCEAIANBADYCBCADIAAgARAtIgANASABQQFqCyEBQcEBIQIMigILIANB2QE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMogILQcIBIQIMiAILIANBL2otAABBAXENASADQQA2AhwgAyABNgIUIANB5Bw2AhAgA0EZNgIMQQAhAgygAgsgASAERgRAQdkBIQIMoAILAkACQAJAIAEtAABBCmsOBAECAgACCyABQQFqIQEMAgsgAUEBaiEBDAELIAMtAC5BwABxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCPCICRQ0AIAMgAhEAACEACyAARQ2gASAAQRVGBEAgA0HZADYCHCADIAE2AhQgA0G3GjYCECADQRU2AgxBACECDJ8CCyADQQA2AhwgAyABNgIUIANBgA02AhAgA0EbNgIMQQAhAgyeAgsgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMnQILIAEgBEcEQCADQQw2AgggAyABNgIEQb8BIQIMhAILQdgBIQIMnAILIAEgBEYEQEHXASECDJwCCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEHBAGsOFQABAgNaBAUGWlpaBwgJCgsMDQ4PEFoLIAFBAWohAUH7ACECDJICCyABQQFqIQFB/AAhAgyRAgsgAUEBaiEBQYEBIQIMkAILIAFBAWohAUGFASECDI8CCyABQQFqIQFBhgEhAgyOAgsgAUEBaiEBQYkBIQIMjQILIAFBAWohAUGKASECDIwCCyABQQFqI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IQYCQANAIAEtAAAgAEGE1QBqLQAARw04IABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyMAgsgA0EANgIAIAZBAWohAUEqDDgLIAEgBEYEQEHGASECDIsCCyABLQAAQdAARw04IAFBAWohAUElDDcLQcUBIQIgASAERg2JAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGB1QBqLQAARw02IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyKAgsgA0EANgIAIAZBAWohAUEODDYLIAEgBEYEQEHEASECDIkCCyABLQAAQcUARw02IAFBAWohAUGrASECDO8BCyABIARGBEBBwwEhAgyIAgsCQAJAAkACQCABLQAAQcIAaw4PAAECOTk5OTk5OTk5OTkDOQsgAUEBaiEBQacBIQIM8QELIAFBAWohAUGoASECDPABCyABQQFqIQFBqQEhAgzvAQsgAUEBaiEBQaoBIQIM7gELQcIBIQIgASAERg2GAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH+1ABqLQAARw0zIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyHAgsgA0EANgIAIAZBAWohAUEUDDMLQcEBIQIgASAERg2FAiADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEH51ABqLQAARw0yIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyGAgsgA0EANgIAIAZBAWohAUErDDILQcABIQIgASAERg2EAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH21ABqLQAARw0xIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyFAgsgA0EANgIAIAZBAWohAUEsDDELQb8BIQIgASAERg2DAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0wIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyEAgsgA0EANgIAIA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aw4jACQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkASQkJCQkAiQkJAMkCyABQQFqIQFBjgEhAgzcAQsgAUEBaiEBQY8BIQIM2wELIAFBAWohAUGUASECDNoBCyABQQFqIQFBlQEhAgzZAQtBrQEhAiABIARGDfEBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQdfUAGotAABHDR4gAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPIBCyADQQA2AgAgBkEBaiEBQQsMHgsgASAERgRAQawBIQIM8QELAkACQCABLQAAQcEAaw4DACABIAsgAUEBaiEBQZABIQIM2AELIAFBAWohAUGTASECDNcBCyABIARGBEBBqwEhAgzwAQsCQAJAIAEtAABBwQBrDg8AHx8fHx8fHx8fHx8fHwEfCyABQQFqIQFBkQEhAgzXAQsgAUEBaiEBQZIBIQIM1gELIAEgBEYEQEGqASECDO8BCyABLQAAQcwARw0cIAFBAWohAUEKDBsLQakBIQIgASAERg3tASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHR1ABqLQAARw0aIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzuAQsgA0EANgIAIAZBAWohAUEeDBoLQagBIQIgASAERg3sASADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEHK1ABqLQAARw0ZIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAztAQsgA0EANgIAIAZBAWohAUEVDBkLQacBIQIgASAERg3rASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHH1ABqLQAARw0YIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzsAQsgA0EANgIAIAZBAWohAUEXDBgLQaYBIQIgASAERg3qASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHB1ABqLQAARw0XIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzrAQsgA0EANgIAIAZBAWohAUEYDBcLIAEgBEYEQEGlASECDOoBCwJAAkAgAS0AAEHJAGsOBwAZGRkZGQEZCyABQQFqIQFBiwEhAgzRAQsgAUEBaiEBQYwBIQIM0AELQaQBIQIgASAERg3oASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw0VIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzpAQsgA0EANgIAIAZBAWohAUEJDBULQaMBIQIgASAERg3nASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw0UIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzoAQsgA0EANgIAIAZBAWohAUEfDBQLQaIBIQIgASAERg3mASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEG+1ABqLQAARw0TIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAznAQsgA0EANgIAIAZBAWohAUECDBMLQaEBIQIgASAERg3lASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYDQCABLQAAIABBvNQAai0AAEcNESAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5QELIAEgBEYEQEGgASECDOUBC0EBIAEtAABB3wBHDREaIAFBAWohAUGHASECDMsBCyADQQA2AgAgBkEBaiEBQYgBIQIMygELQZ8BIQIgASAERg3iASADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw0PIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzjAQsgA0EANgIAIAZBAWohAUEpDA8LQZ4BIQIgASAERg3hASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEG41ABqLQAARw0OIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAziAQsgA0EANgIAIAZBAWohAUEtDA4LIAEgBEYEQEGdASECDOEBCyABLQAAQcUARw0OIAFBAWohAUGEASECDMcBCyABIARGBEBBnAEhAgzgAQsCQAJAIAEtAABBzABrDggADw8PDw8PAQ8LIAFBAWohAUGCASECDMcBCyABQQFqIQFBgwEhAgzGAQtBmwEhAiABIARGDd4BIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQbPUAGotAABHDQsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN8BCyADQQA2AgAgBkEBaiEBQSMMCwtBmgEhAiABIARGDd0BIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDUAGotAABHDQogAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN4BCyADQQA2AgAgBkEBaiEBQQAMCgsgASAERgRAQZkBIQIM3QELAkACQCABLQAAQcgAaw4IAAwMDAwMDAEMCyABQQFqIQFB/QAhAgzEAQsgAUEBaiEBQYABIQIMwwELIAEgBEYEQEGYASECDNwBCwJAAkAgAS0AAEHOAGsOAwALAQsLIAFBAWohAUH+ACECDMMBCyABQQFqIQFB/wAhAgzCAQsgASAERgRAQZcBIQIM2wELIAEtAABB2QBHDQggAUEBaiEBQQgMBwtBlgEhAiABIARGDdkBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQazUAGotAABHDQYgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNoBCyADQQA2AgAgBkEBaiEBQQUMBgtBlQEhAiABIARGDdgBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQabUAGotAABHDQUgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNkBCyADQQA2AgAgBkEBaiEBQRYMBQtBlAEhAiABIARGDdcBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDQQgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNgBCyADQQA2AgAgBkEBaiEBQRAMBAsgASAERgRAQZMBIQIM1wELAkACQCABLQAAQcMAaw4MAAYGBgYGBgYGBgYBBgsgAUEBaiEBQfkAIQIMvgELIAFBAWohAUH6ACECDL0BC0GSASECIAEgBEYN1QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBoNQAai0AAEcNAiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM1gELIANBADYCACAGQQFqIQFBJAwCCyADQQA2AgAMAgsgASAERgRAQZEBIQIM1AELIAEtAABBzABHDQEgAUEBaiEBQRMLOgApIAMoAgQhACADQQA2AgQgAyAAIAEQLiIADQIMAQtBACECIANBADYCHCADIAE2AhQgA0H+HzYCECADQQY2AgwM0QELQfgAIQIMtwELIANBkAE2AhwgAyABNgIUIAMgADYCDEEAIQIMzwELQQAhAAJAIAMoAjgiAkUNACACKAJAIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GCDzYCECADQSA2AgxBACECDM4BC0H3ACECDLQBCyADQY8BNgIcIAMgATYCFCADQewbNgIQIANBFTYCDEEAIQIMzAELIAEgBEYEQEGPASECDMwBCwJAIAEtAABBIEYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZsfNgIQIANBBjYCDEEAIQIMzAELQQIhAgyyAQsDQCABLQAAQSBHDQIgBCABQQFqIgFHDQALQY4BIQIMygELIAEgBEYEQEGNASECDMoBCwJAIAEtAABBCWsOBEoAAEoAC0H1ACECDLABCyADLQApQQVGBEBB9gAhAgywAQtB9AAhAgyvAQsgASAERgRAQYwBIQIMyAELIANBEDYCCCADIAE2AgQMCgsgASAERgRAQYsBIQIMxwELAkAgAS0AAEEJaw4ERwAARwALQfMAIQIMrQELIAEgBEcEQCADQRA2AgggAyABNgIEQfEAIQIMrQELQYoBIQIMxQELAkAgASAERwRAA0AgAS0AAEGg0ABqLQAAIgBBA0cEQAJAIABBAWsOAkkABAtB8AAhAgyvAQsgBCABQQFqIgFHDQALQYgBIQIMxgELQYgBIQIMxQELIANBADYCHCADIAE2AhQgA0HbIDYCECADQQc2AgxBACECDMQBCyABIARGBEBBiQEhAgzEAQsCQAJAAkAgAS0AAEGg0gBqLQAAQQFrDgNGAgABC0HyACECDKwBCyADQQA2AhwgAyABNgIUIANBtBI2AhAgA0EHNgIMQQAhAgzEAQtB6gAhAgyqAQsgASAERwRAIAFBAWohAUHvACECDKoBC0GHASECDMIBCyAEIAEiAEYEQEGGASECDMIBCyAALQAAIgFBL0YEQCAAQQFqIQFB7gAhAgypAQsgAUEJayICQRdLDQEgACEBQQEgAnRBm4CABHENQQwBCyAEIAEiAEYEQEGFASECDMEBCyAALQAAQS9HDQAgAEEBaiEBDAMLQQAhAiADQQA2AhwgAyAANgIUIANB2yA2AhAgA0EHNgIMDL8BCwJAAkACQAJAAkADQCABLQAAQaDOAGotAAAiAEEFRwRAAkACQCAAQQFrDghHBQYHCAAEAQgLQesAIQIMrQELIAFBAWohAUHtACECDKwBCyAEIAFBAWoiAUcNAAtBhAEhAgzDAQsgAUEBagwUCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDMEBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDMABCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDL8BCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy+AQsgASAERgRAQYMBIQIMvgELAkAgAS0AAEGgzgBqLQAAQQFrDgg+BAUGAAgCAwcLIAFBAWohAQtBAyECDKMBCyABQQFqDA0LQQAhAiADQQA2AhwgA0HREjYCECADQQc2AgwgAyABQQFqNgIUDLoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDLkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDLgBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDLcBCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy2AQtB7AAhAgycAQsgASAERgRAQYIBIQIMtQELIAFBAWoMAgsgASAERgRAQYEBIQIMtAELIAFBAWoMAQsgASAERg0BIAFBAWoLIQFBBCECDJgBC0GAASECDLABCwNAIAEtAABBoMwAai0AACIAQQJHBEAgAEEBRwRAQekAIQIMmQELDDELIAQgAUEBaiIBRw0AC0H/ACECDK8BCyABIARGBEBB/gAhAgyvAQsCQCABLQAAQQlrDjcvAwYvBAYGBgYGBgYGBgYGBgYGBgYGBgUGBgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYABgsgAUEBagshAUEFIQIMlAELIAFBAWoMBgsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgyrAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgyqAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgypAQsgA0EANgIcIAMgATYCFCADQY0UNgIQIANBBzYCDEEAIQIMqAELAkACQAJAAkADQCABLQAAQaDKAGotAAAiAEEFRwRAAkAgAEEBaw4GLgMEBQYABgtB6AAhAgyUAQsgBCABQQFqIgFHDQALQf0AIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqAELIANBADYCHCADIAE2AhQgA0HkCDYCECADQQc2AgxBACECDKcBCyABIARGDQEgAUEBagshAUEGIQIMjAELQfwAIQIMpAELAkACQAJAAkADQCABLQAAQaDIAGotAAAiAEEFRwRAIABBAWsOBCkCAwQFCyAEIAFBAWoiAUcNAAtB+wAhAgynAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgymAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgylAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgykAQsgA0EANgIcIAMgATYCFCADQbwKNgIQIANBBzYCDEEAIQIMowELQc8AIQIMiQELQdEAIQIMiAELQecAIQIMhwELIAEgBEYEQEH6ACECDKABCwJAIAEtAABBCWsOBCAAACAACyABQQFqIQFB5gAhAgyGAQsgASAERgRAQfkAIQIMnwELAkAgAS0AAEEJaw4EHwAAHwALQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFBEBB4gEhAgyGAQsgAEEVRwRAIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDJ8BCyADQfgANgIcIAMgATYCFCADQeoaNgIQIANBFTYCDEEAIQIMngELIAEgBEcEQCADQQ02AgggAyABNgIEQeQAIQIMhQELQfcAIQIMnQELIAEgBEYEQEH2ACECDJ0BCwJAAkACQCABLQAAQcgAaw4LAAELCwsLCwsLCwILCyABQQFqIQFB3QAhAgyFAQsgAUEBaiEBQeAAIQIMhAELIAFBAWohAUHjACECDIMBC0H1ACECIAEgBEYNmwEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBtdUAai0AAEcNCCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMnAELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfQANgIcIAMgATYCFCADIAA2AgxBACECDJwBC0HiACECDIIBC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMnAELQeEAIQIMggELIANB8wA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyaAQsgAy0AKSIAQSNrQQtJDQkCQCAAQQZLDQBBASAAdEHKAHFFDQAMCgtBACECIANBADYCHCADIAE2AhQgA0HtCTYCECADQQg2AgwMmQELQfIAIQIgASAERg2YASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGz1QBqLQAARw0FIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAQsgAygCBCEAIANCADcDACADIAAgBkEBaiIBECsiAARAIANB8QA2AhwgAyABNgIUIAMgADYCDEEAIQIMmQELQd8AIQIMfwtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJkBC0HeACECDH8LIANB8AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyXAQsgAy0AKUEhRg0GIANBADYCHCADIAE2AhQgA0GRCjYCECADQQg2AgxBACECDJYBC0HvACECIAEgBEYNlQEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMlgELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgBFDQIgA0HtADYCHCADIAE2AhQgAyAANgIMQQAhAgyVAQsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNgAEgA0HuADYCHCADIAE2AhQgAyAANgIMQQAhAgyTAQtB3A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yAAC74CAQJ/IABBADoAACAAQeQAaiIBQQFrQQA6AAAgAEEAOgACIABBADoAASABQQNrQQA6AAAgAUECa0EAOgAAIABBADoAAyABQQRrQQA6AABBACAAa0EDcSIBIABqIgBBADYCAEHkACABa0F8cSICIABqIgFBBGtBADYCAAJAIAJBCUkNACAAQQA2AgggAEEANgIEIAFBCGtBADYCACABQQxrQQA2AgAgAkEZSQ0AIABBADYCGCAAQQA2AhQgAEEANgIQIABBADYCDCABQRBrQQA2AgAgAUEUa0EANgIAIAFBGGtBADYCACABQRxrQQA2AgAgAiAAQQRxQRhyIgJrIgFBIEkNACAAIAJqIQADQCAAQgA3AxggAEIANwMQIABCADcDCCAAQgA3AwAgAEEgaiEAIAFBIGsiAUEfSw0ACwsLVgEBfwJAIAAoAgwNAAJAAkACQAJAIAAtADEOAwEAAwILIAAoAjgiAUUNACABKAIwIgFFDQAgACABEQAAIgENAwtBAA8LAAsgAEHKGTYCEEEOIQELIAELGgAgACgCDEUEQCAAQd4fNgIQIABBFTYCDAsLFAAgACgCDEEVRgRAIABBADYCDAsLFAAgACgCDEEWRgRAIABBADYCDAsLBwAgACgCDAsHACAAKAIQCwkAIAAgATYCEAsHACAAKAIUCysAAkAgAEEnTw0AQv//////CSAArYhCAYNQDQAgAEECdEHQOGooAgAPCwALFwAgAEEvTwRAAAsgAEECdEHsOWooAgALvwkBAX9B9C0hAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWF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FBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==","base64"))})},3530:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enumToMap=function(e,t=[],A=[]){const s=0===(t?.length??0),r=0===(A?.length??0);return Object.fromEntries(Object.entries(e).filter((([,e])=>"number"==typeof e&&(s||t.includes(e))&&(r||!A.includes(e)))))}},7467:(e,t,A)=>{"use strict";const{kClients:s}=A(257),r=A(3315),{kAgent:n,kMockAgentSet:i,kMockAgentGet:o,kDispatches:a,kIsMockActive:c,kNetConnect:l,kGetNetConnect:h,kOptions:g,kFactory:d,kMockAgentRegisterCallHistory:u,kMockAgentIsCallHistoryEnabled:E,kMockAgentAddCallHistoryLog:I,kMockAgentMockCallHistoryInstance:Q,kMockAgentAcceptsNonStandardSearchParameters:C,kMockCallHistoryAddLog:B,kIgnoreTrailingSlash:p}=A(3435),f=A(615),m=A(5846),{matchValue:y,normalizeSearchParams:S,buildAndValidateMockOptions:D}=A(991),{InvalidArgumentError:w,UndiciError:b}=A(4465),R=A(5497),N=A(164),{MockCallHistory:k}=A(4969);e.exports=class extends R{constructor(e={}){super(e);const t=D(e);if(this[l]=!0,this[c]=!0,this[E]=t.enableCallHistory??!1,this[C]=t.acceptNonStandardSearchParameters??!1,this[p]=t.ignoreTrailingSlash??!1,e?.agent&&"function"!=typeof e.agent.dispatch)throw new w("Argument opts.agent must implement Agent");const A=e?.agent?e.agent:new r(e);this[n]=A,this[s]=A[s],this[g]=t,this[E]&&this[u]()}get(e){const t=this[p]?e.replace(/\/$/,""):e;let A=this[o](t);return A||(A=this[d](t),this[i](t,A)),A}dispatch(e,t){this.get(e.origin),this[I](e);const A=this[C],s={...e};if(A&&s.path){const[e,t]=s.path.split("?"),r=S(t,A);s.path=`${e}?${r}`}return this[n].dispatch(s,t)}async close(){this.clearCallHistory(),await this[n].close(),this[s].clear()}deactivate(){this[c]=!1}activate(){this[c]=!0}enableNetConnect(e){if("string"==typeof e||"function"==typeof e||e instanceof RegExp)Array.isArray(this[l])?this[l].push(e):this[l]=[e];else{if("undefined"!=typeof e)throw new w("Unsupported matcher. Must be one of String|Function|RegExp.");this[l]=!0}}disableNetConnect(){this[l]=!1}enableCallHistory(){return this[E]=!0,this}disableCallHistory(){return this[E]=!1,this}getCallHistory(){return this[Q]}clearCallHistory(){void 0!==this[Q]&&this[Q].clear()}get isMockActive(){return this[c]}[u](){void 0===this[Q]&&(this[Q]=new k)}[I](e){this[E]&&(this[u](),this[Q][B](e))}[i](e,t){this[s].set(e,{count:0,dispatcher:t})}[d](e){const t=Object.assign({agent:this},this[g]);return this[g]&&1===this[g].connections?new f(e,t):new m(e,t)}[o](e){const t=this[s].get(e);if(t?.dispatcher)return t.dispatcher;if("string"!=typeof e){const t=this[d]("http://localhost:9999");return this[i](e,t),t}for(const[t,A]of Array.from(this[s]))if(A&&"string"!=typeof t&&y(t,e)){const t=this[d](e);return this[i](e,t),t[a]=A.dispatcher[a],t}}[h](){return this[l]}pendingInterceptors(){const e=this[s];return Array.from(e.entries()).flatMap((([e,t])=>t.dispatcher[a].map((t=>({...t,origin:e}))))).filter((({pending:e})=>e))}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new N}={}){const t=this.pendingInterceptors();if(0!==t.length)throw new b(1===t.length?`1 interceptor is pending:\n\n${e.format(t)}`.trim():`${t.length} interceptors are pending:\n\n${e.format(t)}`.trim())}}},4969:(e,t,A)=>{"use strict";const{kMockCallHistoryAddLog:s}=A(3435),{InvalidArgumentError:r}=A(4465);function n(e,t,A,s){switch(t.operator){case"OR":return s.push(...A(e)),s;case"AND":return A.call({logs:s},e);default:throw new r("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}function i(e={}){const t={};if("operator"in e){if("string"!=typeof e.operator||"OR"!==e.operator.toUpperCase()&&"AND"!==e.operator.toUpperCase())throw new r("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...t,operator:e.operator.toUpperCase()}}return t}function o(e){return t=>{if("string"==typeof t||null==t)return this.logs.filter((A=>A[e]===t));if(t instanceof RegExp)return this.logs.filter((A=>t.test(A[e])));throw new r(`${e} parameter should be one of string, regexp, undefined or null`)}}class a{constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;const t=function(e){try{const t=new URL(e.path,e.origin);return 0!==t.search.length||(t.search=new URLSearchParams(e.query).toString()),t}catch(e){throw new r("An error occurred when computing MockCallHistoryLog.url",{cause:e})}}(e);this.fullUrl=t.toString(),this.origin=t.origin,this.path=t.pathname,this.searchParams=Object.fromEntries(t.searchParams),this.protocol=t.protocol,this.host=t.host,this.port=t.port,this.hash=t.hash}toMap(){return new Map([["protocol",this.protocol],["host",this.host],["port",this.port],["origin",this.origin],["path",this.path],["hash",this.hash],["searchParams",this.searchParams],["fullUrl",this.fullUrl],["method",this.method],["body",this.body],["headers",this.headers]])}toString(){const e="->",t="|";let A="";return this.toMap().forEach(((s,r)=>{"string"!=typeof s&&null!=s||(A=`${A}${r}${e}${s}${t}`),("object"==typeof s&&null!==s||Array.isArray(s))&&(A=`${A}${r}${e}${JSON.stringify(s)}${t}`)})),A.slice(0,-1)}}class c{logs=[];calls(){return this.logs}firstCall(){return this.logs.at(0)}lastCall(){return this.logs.at(-1)}nthCall(e){if("number"!=typeof e)throw new r("nthCall must be called with a number");if(!Number.isInteger(e))throw new r("nthCall must be called with an integer");if(1!==Math.sign(e))throw new r("nthCall must be called with a positive value. use firstCall or lastCall instead");return this.logs.at(e-1)}filterCalls(e,t){if(0===this.logs.length)return this.logs;if("function"==typeof e)return this.logs.filter(e);if(e instanceof RegExp)return this.logs.filter((t=>e.test(t.toString())));if("object"==typeof e&&null!==e){if(0===Object.keys(e).length)return this.logs;const A={operator:"OR",...i(t)};let s=[];"protocol"in e&&(s=n(e.protocol,A,this.filterCallsByProtocol,s)),"host"in e&&(s=n(e.host,A,this.filterCallsByHost,s)),"port"in e&&(s=n(e.port,A,this.filterCallsByPort,s)),"origin"in e&&(s=n(e.origin,A,this.filterCallsByOrigin,s)),"path"in e&&(s=n(e.path,A,this.filterCallsByPath,s)),"hash"in e&&(s=n(e.hash,A,this.filterCallsByHash,s)),"fullUrl"in e&&(s=n(e.fullUrl,A,this.filterCallsByFullUrl,s)),"method"in e&&(s=n(e.method,A,this.filterCallsByMethod,s));return[...new Set(s)]}throw new r("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=o.call(this,"protocol");filterCallsByHost=o.call(this,"host");filterCallsByPort=o.call(this,"port");filterCallsByOrigin=o.call(this,"origin");filterCallsByPath=o.call(this,"path");filterCallsByHash=o.call(this,"hash");filterCallsByFullUrl=o.call(this,"fullUrl");filterCallsByMethod=o.call(this,"method");clear(){this.logs=[]}[s](e){const t=new a(e);return this.logs.push(t),t}*[Symbol.iterator](){for(const e of this.calls())yield e}}e.exports.MockCallHistory=c,e.exports.MockCallHistoryLog=a},615:(e,t,A)=>{"use strict";const{promisify:s}=A(7975),r=A(1167),{buildMockDispatch:n}=A(991),{kDispatches:i,kMockAgent:o,kClose:a,kOriginalClose:c,kOrigin:l,kOriginalDispatch:h,kConnected:g,kIgnoreTrailingSlash:d}=A(3435),{MockInterceptor:u}=A(193),E=A(257),{InvalidArgumentError:I}=A(4465);class Q extends r{constructor(e,t){if(!t||!t.agent||"function"!=typeof t.agent.dispatch)throw new I("Argument opts.agent must implement Agent");super(e,t),this[o]=t.agent,this[l]=e,this[d]=t.ignoreTrailingSlash??!1,this[i]=[],this[g]=1,this[h]=this.dispatch,this[c]=this.close.bind(this),this.dispatch=n.call(this),this.close=this[a]}get[E.kConnected](){return this[g]}intercept(e){return new u(e&&{ignoreTrailingSlash:this[d],...e},this[i])}cleanMocks(){this[i]=[]}async[a](){await s(this[c])(),this[g]=0,this[o][E.kClients].delete(this[l])}}e.exports=Q},3123:(e,t,A)=>{"use strict";const{UndiciError:s}=A(4465),r=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED");class n extends s{constructor(e){super(e),this.name="MockNotMatchedError",this.message=e||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](e){return e&&!0===e[r]}get[r](){return!0}}e.exports={MockNotMatchedError:n}},193:(e,t,A)=>{"use strict";const{getResponseData:s,buildKey:r,addMockDispatch:n}=A(991),{kDispatches:i,kDispatchKey:o,kDefaultHeaders:a,kDefaultTrailers:c,kContentLength:l,kMockDispatch:h,kIgnoreTrailingSlash:g}=A(3435),{InvalidArgumentError:d}=A(4465),{serializePathWithQuery:u}=A(2858);class E{constructor(e){this[h]=e}delay(e){if("number"!=typeof e||!Number.isInteger(e)||e<=0)throw new d("waitInMs must be a valid integer > 0");return this[h].delay=e,this}persist(){return this[h].persist=!0,this}times(e){if("number"!=typeof e||!Number.isInteger(e)||e<=0)throw new d("repeatTimes must be a valid integer > 0");return this[h].times=e,this}}e.exports.MockInterceptor=class{constructor(e,t){if("object"!=typeof e)throw new d("opts must be an object");if("undefined"==typeof e.path)throw new d("opts.path must be defined");if("undefined"==typeof e.method&&(e.method="GET"),"string"==typeof e.path)if(e.query)e.path=u(e.path,e.query);else{const t=new URL(e.path,"data://");e.path=t.pathname+t.search}"string"==typeof e.method&&(e.method=e.method.toUpperCase()),this[o]=r(e),this[i]=t,this[g]=e.ignoreTrailingSlash??!1,this[a]={},this[c]={},this[l]=!1}createMockScopeDispatchData({statusCode:e,data:t,responseOptions:A}){const r=s(t),n=this[l]?{"content-length":r.length}:{};return{statusCode:e,data:t,headers:{...this[a],...n,...A.headers},trailers:{...this[c],...A.trailers}}}validateReplyParameters(e){if("undefined"==typeof e.statusCode)throw new d("statusCode must be defined");if("object"!=typeof e.responseOptions||null===e.responseOptions)throw new d("responseOptions must be an object")}reply(e){if("function"==typeof e){const t=t=>{const A=e(t);if("object"!=typeof A||null===A)throw new d("reply options callback must return an object");const s={data:"",responseOptions:{},...A};return this.validateReplyParameters(s),{...this.createMockScopeDispatchData(s)}},A=n(this[i],this[o],t,{ignoreTrailingSlash:this[g]});return new E(A)}const t={statusCode:e,data:void 0===arguments[1]?"":arguments[1],responseOptions:void 0===arguments[2]?{}:arguments[2]};this.validateReplyParameters(t);const A=this.createMockScopeDispatchData(t),s=n(this[i],this[o],A,{ignoreTrailingSlash:this[g]});return new E(s)}replyWithError(e){if("undefined"==typeof e)throw new d("error must be defined");const t=n(this[i],this[o],{error:e},{ignoreTrailingSlash:this[g]});return new E(t)}defaultReplyHeaders(e){if("undefined"==typeof e)throw new d("headers must be defined");return this[a]=e,this}defaultReplyTrailers(e){if("undefined"==typeof e)throw new d("trailers must be defined");return this[c]=e,this}replyContentLength(){return this[l]=!0,this}},e.exports.MockScope=E},5846:(e,t,A)=>{"use strict";const{promisify:s}=A(7975),r=A(8542),{buildMockDispatch:n}=A(991),{kDispatches:i,kMockAgent:o,kClose:a,kOriginalClose:c,kOrigin:l,kOriginalDispatch:h,kConnected:g,kIgnoreTrailingSlash:d}=A(3435),{MockInterceptor:u}=A(193),E=A(257),{InvalidArgumentError:I}=A(4465);class Q extends r{constructor(e,t){if(!t||!t.agent||"function"!=typeof t.agent.dispatch)throw new I("Argument opts.agent must implement Agent");super(e,t),this[o]=t.agent,this[l]=e,this[d]=t.ignoreTrailingSlash??!1,this[i]=[],this[g]=1,this[h]=this.dispatch,this[c]=this.close.bind(this),this.dispatch=n.call(this),this.close=this[a]}get[E.kConnected](){return this[g]}intercept(e){return new u(e&&{ignoreTrailingSlash:this[d],...e},this[i])}cleanMocks(){this[i]=[]}async[a](){await s(this[c])(),this[g]=0,this[o][E.kClients].delete(this[l])}}e.exports=Q},3435:e=>{"use strict";e.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOriginalDispatch:Symbol("original dispatch"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected"),kIgnoreTrailingSlash:Symbol("ignore trailing slash"),kMockAgentMockCallHistoryInstance:Symbol("mock agent mock call history name"),kMockAgentRegisterCallHistory:Symbol("mock agent register mock call history"),kMockAgentAddCallHistoryLog:Symbol("mock agent add call history log"),kMockAgentIsCallHistoryEnabled:Symbol("mock agent is call history enabled"),kMockAgentAcceptsNonStandardSearchParameters:Symbol("mock agent accepts non standard search parameters"),kMockCallHistoryAddLog:Symbol("mock call history add log")}},991:(e,t,A)=>{"use strict";const{MockNotMatchedError:s}=A(3123),{kDispatches:r,kMockAgent:n,kOriginalDispatch:i,kOrigin:o,kGetNetConnect:a}=A(3435),{serializePathWithQuery:c}=A(2858),{STATUS_CODES:l}=A(7067),{types:{isPromise:h}}=A(7975),{InvalidArgumentError:g}=A(4465);function d(e,t){return"string"==typeof e?e===t:e instanceof RegExp?e.test(t):"function"==typeof e&&!0===e(t)}function u(e){return Object.fromEntries(Object.entries(e).map((([e,t])=>[e.toLocaleLowerCase(),t])))}function E(e,t){if(!Array.isArray(e))return"function"==typeof e.get?e.get(t):u(e)[t.toLocaleLowerCase()];for(let A=0;A<e.length;A+=2)if(e[A].toLocaleLowerCase()===t.toLocaleLowerCase())return e[A+1]}function I(e){const t=e.slice(),A=[];for(let e=0;e<t.length;e+=2)A.push([t[e],t[e+1]]);return Object.fromEntries(A)}function Q(e,t){if("function"==typeof e.headers)return Array.isArray(t)&&(t=I(t)),e.headers(t?u(t):{});if("undefined"==typeof e.headers)return!0;if("object"!=typeof t||"object"!=typeof e.headers)return!1;for(const[A,s]of Object.entries(e.headers)){if(!d(s,E(t,A)))return!1}return!0}function C(e){if("string"!=typeof e)return e;const t=e.split("?",3);if(2!==t.length)return e;const A=new URLSearchParams(t.pop());return A.sort(),[...t,A.toString()].join("?")}function B(e){return Buffer.isBuffer(e)||e instanceof Uint8Array||e instanceof ArrayBuffer?e:"object"==typeof e?JSON.stringify(e):e?e.toString():""}function p(e,t){const A=t.query?c(t.path,t.query):t.path,r="string"==typeof A?C(A):A,n=m(r);let i=e.filter((({consumed:e})=>!e)).filter((({path:e,ignoreTrailingSlash:t})=>t?d(m(C(e)),n):d(C(e),r)));if(0===i.length)throw new s(`Mock dispatch not matched for path '${r}'`);if(i=i.filter((({method:e})=>d(e,t.method))),0===i.length)throw new s(`Mock dispatch not matched for method '${t.method}' on path '${r}'`);if(i=i.filter((({body:e})=>"undefined"==typeof e||d(e,t.body))),0===i.length)throw new s(`Mock dispatch not matched for body '${t.body}' on path '${r}'`);if(i=i.filter((e=>Q(e,t.headers))),0===i.length){const e="object"==typeof t.headers?JSON.stringify(t.headers):t.headers;throw new s(`Mock dispatch not matched for headers '${e}' on path '${r}'`)}return i[0]}function f(e,t){const A=e.findIndex((e=>!!e.consumed&&function(e,{path:t,method:A,body:s,headers:r}){const n=d(e.path,t),i=d(e.method,A),o="undefined"==typeof e.body||d(e.body,s),a=Q(e,r);return n&&i&&o&&a}(e,t)));-1!==A&&e.splice(A,1)}function m(e){for(;e.endsWith("/");)e=e.slice(0,-1);return 0===e.length&&(e="/"),e}function y(e){const{path:t,method:A,body:s,headers:r,query:n}=e;return{path:t,method:A,body:s,headers:r,query:n}}function S(e){const t=Object.keys(e),A=[];for(let s=0;s<t.length;++s){const r=t[s],n=e[r],i=Buffer.from(`${r}`);if(Array.isArray(n))for(let e=0;e<n.length;++e)A.push(i,Buffer.from(`${n[e]}`));else A.push(i,Buffer.from(`${n}`))}return A}function D(e){return l[e]||"unknown"}function w(e,t){const A=y(e),s=p(this[r],A);s.timesInvoked++,s.data.callback&&(s.data={...s.data,...s.data.callback(e)});const{data:{statusCode:n,data:i,headers:o,trailers:a,error:c},delay:l,persist:g}=s,{timesInvoked:d,times:u}=s;if(s.consumed=!g&&d>=u,s.pending=d<u,null!==c)return f(this[r],A),t.onError(c),!0;function E(s,r=i){const c=Array.isArray(e.headers)?I(e.headers):e.headers,l="function"==typeof r?r({...e,headers:c}):r;if(h(l))return void l.then((e=>E(s,e)));const g=B(l),d=S(o),u=S(a);t.onConnect?.((e=>t.onError(e)),null),t.onHeaders?.(n,d,Q,D(n)),t.onData?.(Buffer.from(g)),t.onComplete?.(u),f(s,A)}function Q(){}return"number"==typeof l&&l>0?setTimeout((()=>{E(this[r])}),l):E(this[r]),!0}function b(e,t){const A=new URL(t);return!0===e||!(!Array.isArray(e)||!e.some((e=>d(e,A.host))))}e.exports={getResponseData:B,getMockDispatch:p,addMockDispatch:function(e,t,A,s){const r={...{timesInvoked:0,times:1,persist:!1,consumed:!1,...s},...t,pending:!0,data:{error:null,..."function"==typeof A?{callback:A}:{...A}}};return e.push(r),r},deleteMockDispatch:f,buildKey:y,generateKeyValues:S,matchValue:d,getResponse:async function(e){const t=[];for await(const A of e)t.push(A);return Buffer.concat(t).toString("utf8")},getStatusText:D,mockDispatch:w,buildMockDispatch:function(){const e=this[n],t=this[o],A=this[i];return function(r,n){if(e.isMockActive)try{w.call(this,r,n)}catch(i){if("UND_MOCK_ERR_MOCK_NOT_MATCHED"!==i.code)throw i;{const o=e[a]();if(!1===o)throw new s(`${i.message}: subsequent request to origin ${t} was not allowed (net.connect disabled)`);if(!b(o,t))throw new s(`${i.message}: subsequent request to origin ${t} was not allowed (net.connect is not enabled for this origin)`);A.call(this,r,n)}}else A.call(this,r,n)}},checkNetConnect:b,buildAndValidateMockOptions:function(e){const{agent:t,...A}=e;if("enableCallHistory"in A&&"boolean"!=typeof A.enableCallHistory)throw new g("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in A&&"boolean"!=typeof A.acceptNonStandardSearchParameters)throw new g("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in A&&"boolean"!=typeof A.ignoreTrailingSlash)throw new g("options.ignoreTrailingSlash must to be a boolean");return A},getHeaderByName:E,buildHeadersFromArray:I,normalizeSearchParams:function(e){if("string"!=typeof e)return e;const t=new URLSearchParams(e),A=new URLSearchParams;for(let[e,s]of t.entries()){e=e.replace("[]","");if(/^(['"]).*\1$/.test(s))A.append(e,s);else if(s.includes(",")){const t=s.split(",");for(const s of t)A.append(e,s)}else A.append(e,s)}return A}}},164:(e,t,A)=>{"use strict";const{Transform:s}=A(7075),{Console:r}=A(7540),n=process.versions.icu?"✅":"Y ",i=process.versions.icu?"❌":"N ";e.exports=class{constructor({disableColors:e}={}){this.transform=new s({transform(e,t,A){A(null,e)}}),this.logger=new r({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){const t=e.map((({method:e,path:t,data:{statusCode:A},persist:s,times:r,timesInvoked:o,origin:a})=>({Method:e,Origin:a,Path:t,"Status code":A,Persistent:s?n:i,Invocations:o,Remaining:s?1/0:r-o})));return this.logger.table(t),this.transform.read().toString()}}},1313:(e,t,A)=>{"use strict";const s=A(3315),r=A(7467),{SnapshotRecorder:n}=A(6632),i=A(832),{InvalidArgumentError:o,UndiciError:a}=A(4465),{validateSnapshotMode:c}=A(5505),l=Symbol("kSnapshotRecorder"),h=Symbol("kSnapshotMode"),g=Symbol("kSnapshotPath"),d=Symbol("kSnapshotLoaded"),u=Symbol("kRealAgent");let E=!1;e.exports=class extends r{constructor(e={}){E||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),E=!0);const{mode:t="record",snapshotPath:A=null,...r}=e;if(super(r),c(t),("playback"===t||"update"===t)&&!A)throw new o(`snapshotPath is required when mode is '${t}'`);this[h]=t,this[g]=A,this[l]=new n({snapshotPath:this[g],mode:this[h],maxSnapshots:e.maxSnapshots,autoFlush:e.autoFlush,flushInterval:e.flushInterval,matchHeaders:e.matchHeaders,ignoreHeaders:e.ignoreHeaders,excludeHeaders:e.excludeHeaders,matchBody:e.matchBody,matchQuery:e.matchQuery,caseSensitive:e.caseSensitive,shouldRecord:e.shouldRecord,shouldPlayback:e.shouldPlayback,excludeUrls:e.excludeUrls}),this[d]=!1,"record"!==this[h]&&"update"!==this[h]||(this[u]=new s(e)),"playback"!==this[h]&&"update"!==this[h]||!this[g]||this.loadSnapshots().catch((()=>{}))}dispatch(e,t){t=i.wrap(t);const A=this[h];if("playback"===A||"update"===A){if(!this[d])return this.#me(e,t);const s=this[l].findSnapshot(e);if(s)return this.#ye(s,t);if("update"===A)return this.#Se(e,t);{const A=new a(`No snapshot found for ${e.method||"GET"} ${e.path}`);if(t.onError)return void t.onError(A);throw A}}if("record"===A)return this.#Se(e,t)}async#me(e,t){return await this.loadSnapshots(),this.dispatch(e,t)}#Se(e,t){const A={statusCode:null,headers:{},trailers:{},body:[]},s=this,r={onRequestStart(e,A){return t.onRequestStart(e,{...A,history:this.history})},onRequestUpgrade:(e,A,s,r)=>t.onRequestUpgrade(e,A,s,r),onResponseStart:(e,s,r,n)=>(A.statusCode=s,A.headers=r,t.onResponseStart(e,s,r,n)),onResponseData:(e,s)=>(A.body.push(s),t.onResponseData(e,s)),onResponseEnd(r,n){A.trailers=n;const i=Buffer.concat(A.body);s[l].record(e,{statusCode:A.statusCode,headers:A.headers,body:i,trailers:A.trailers}).then((()=>{t.onResponseEnd(r,n)})).catch((e=>{t.onResponseError(r,e)}))}};return this[u].dispatch(e,r)}#ye(e,t){try{const{response:A}=e,s={pause(){},resume(){},abort(e){this.aborted=!0,this.reason=e},aborted:!1,paused:!1};t.onRequestStart(s),t.onResponseStart(s,A.statusCode,A.headers);const r=Buffer.from(A.body,"base64");t.onResponseData(s,r),t.onResponseEnd(s,A.trailers)}catch(e){t.onError?.(e)}}async loadSnapshots(e){await this[l].loadSnapshots(e||this[g]),this[d]=!0,"playback"===this[h]&&this.#De()}async saveSnapshots(e){return this[l].saveSnapshots(e||this[g])}#De(){for(const e of this[l].getSnapshots()){const{request:t,responses:A,response:s}=e,r=new URL(t.url),n=this.get(r.origin),i=A?A[0]:s;i&&n.intercept({path:r.pathname+r.search,method:t.method,headers:t.headers,body:t.body}).reply(i.statusCode,i.body,{headers:i.headers,trailers:i.trailers}).persist()}}getRecorder(){return this[l]}getMode(){return this[h]}clearSnapshots(){this[l].clear()}resetCallCounts(){this[l].resetCallCounts()}deleteSnapshot(e){return this[l].deleteSnapshot(e)}getSnapshotInfo(e){return this[l].getSnapshotInfo(e)}replaceSnapshots(e){this[l].replaceSnapshots(e)}async close(){await this[l].close(),await(this[u]?.close()),await super.close()}}},6632:(e,t,A)=>{"use strict";const{writeFile:s,readFile:r,mkdir:n}=A(1455),{dirname:i,resolve:o}=A(6760),{setTimeout:a,clearTimeout:c}=A(7997),{InvalidArgumentError:l,UndiciError:h}=A(4465),{hashId:g,isUrlExcludedFactory:d,normalizeHeaders:u,createHeaderFilters:E}=A(5505);function I(e,t,A={}){const s=new URL(e.path,e.origin),r=e._normalizedHeaders||u(e.headers);return e._normalizedHeaders||(e._normalizedHeaders=r),{method:e.method||"GET",url:!1!==A.matchQuery?s.toString():`${s.origin}${s.pathname}`,headers:Q(r,t,A),body:!1!==A.matchBody&&e.body?String(e.body):""}}function Q(e,t,A={}){if(!e||"object"!=typeof e)return{};const{caseSensitive:s=!1}=A,r={},{ignore:n,exclude:i,match:o}=t;for(const[t,A]of Object.entries(e)){const e=s?t:t.toLowerCase();i.has(e)||(n.has(e)||(0===o.size||o.has(e))&&(r[e]=A))}return r}function C(e,t,A={}){if(!e||"object"!=typeof e)return{};const{caseSensitive:s=!1}=A,r={},{exclude:n}=t;for(const[t,A]of Object.entries(e)){const e=s?t:t.toLowerCase();n.has(e)||(r[e]=A)}return r}function B(e){const t=[e.method,e.url];if(e.headers&&"object"==typeof e.headers){const A=Object.keys(e.headers).sort();for(const s of A){const A=Array.isArray(e.headers[s])?e.headers[s]:[e.headers[s]];t.push(s);for(const e of A.sort())t.push(String(e))}}t.push(e.body);const A=t.join("|");return g(A)}e.exports={SnapshotRecorder:class{#we;#be;#Re=new Map;#Ne;#ke=1/0;#Te=!1;#Fe;constructor(e={}){this.#Ne=e.snapshotPath,this.#ke=e.maxSnapshots||1/0,this.#Te=e.autoFlush||!1,this.flushInterval=e.flushInterval||3e4,this._flushTimer=null,this.matchOptions={matchHeaders:e.matchHeaders||[],ignoreHeaders:e.ignoreHeaders||[],excludeHeaders:e.excludeHeaders||[],matchBody:!1!==e.matchBody,matchQuery:!1!==e.matchQuery,caseSensitive:e.caseSensitive||!1},this.#Fe=E(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#be=d(e.excludeUrls),this.#Te&&this.#Ne&&this.#ve()}async record(e,t){if(!this.shouldRecord(e))return;const A=new URL(e.path,e.origin).toString();if(this.#be(A))return;const s=I(e,this.#Fe,this.matchOptions),r=B(s),n=u(t.headers),i={statusCode:t.statusCode,headers:C(n,this.#Fe,this.matchOptions),body:Buffer.isBuffer(t.body)?t.body.toString("base64"):Buffer.from(String(t.body||"")).toString("base64"),trailers:t.trailers};if(this.#Re.size>=this.#ke&&!this.#Re.has(r)){const e=this.#Re.keys().next().value;this.#Re.delete(e)}const o=this.#Re.get(r);o&&o.responses?(o.responses.push(i),o.timestamp=(new Date).toISOString()):this.#Re.set(r,{request:s,responses:[i],callCount:0,timestamp:(new Date).toISOString()}),this.#Te&&this.#Ne&&this.#Me()}findSnapshot(e){if(!this.shouldPlayback(e))return;const t=new URL(e.path,e.origin).toString();if(this.#be(t))return;const A=B(I(e,this.#Fe,this.matchOptions)),s=this.#Re.get(A);if(!s)return;const r=s.callCount||0,n=Math.min(r,s.responses.length-1);return s.callCount=r+1,{...s,response:s.responses[n]}}async loadSnapshots(e){const t=e||this.#Ne;if(!t)throw new l("Snapshot path is required");try{const e=await r(o(t),"utf8"),A=JSON.parse(e);if(Array.isArray(A)){this.#Re.clear();for(const{hash:e,snapshot:t}of A)this.#Re.set(e,t)}else this.#Re=new Map(Object.entries(A))}catch(e){if("ENOENT"!==e.code)throw new h(`Failed to load snapshots from ${t}`,{cause:e});this.#Re.clear()}}async saveSnapshots(e){const t=e||this.#Ne;if(!t)throw new l("Snapshot path is required");const A=o(t);await n(i(A),{recursive:!0});const r=Array.from(this.#Re.entries()).map((([e,t])=>({hash:e,snapshot:t})));await s(A,JSON.stringify(r,null,2),{flush:!0})}clear(){this.#Re.clear()}getSnapshots(){return Array.from(this.#Re.values())}size(){return this.#Re.size}resetCallCounts(){for(const e of this.#Re.values())e.callCount=0}deleteSnapshot(e){const t=B(I(e,this.#Fe,this.matchOptions));return this.#Re.delete(t)}getSnapshotInfo(e){const t=B(I(e,this.#Fe,this.matchOptions)),A=this.#Re.get(t);return A?{hash:t,request:A.request,responseCount:A.responses?A.responses.length:A.response?1:0,callCount:A.callCount||0,timestamp:A.timestamp}:null}replaceSnapshots(e){if(this.#Re.clear(),Array.isArray(e))for(const{hash:t,snapshot:A}of e)this.#Re.set(t,A);else e&&"object"==typeof e&&(this.#Re=new Map(Object.entries(e)))}#ve(){return this.#Me()}#Ue(){this.#we&&(c(this.#we),this.saveSnapshots().catch((()=>{})),this.#we=null)}#Me(){this.#we=a((()=>{this.saveSnapshots().catch((()=>{})),this.#Te?this.#we?.refresh():this.#we=null}),1e3)}destroy(){this.#Ue(),this.#we&&(c(this.#we),this.#we=null)}async close(){this.#Ne&&0!==this.#Re.size&&await this.saveSnapshots(),this.destroy()}},formatRequestKey:I,createRequestHash:B,filterHeadersForMatching:Q,filterHeadersForStorage:C,createHeaderFilters:E}},5505:(e,t,A)=>{"use strict";const{InvalidArgumentError:s}=A(4465);let r;try{r=A(7598)}catch{}const n=r?.hash?e=>r.hash("sha256",e,"base64url"):e=>Buffer.from(e).toString("base64url");function i(e){return Array.isArray(e)&&!(1&e.length)}const o=["record","playback","update"];e.exports={createHeaderFilters:function(e={}){const{ignoreHeaders:t=[],excludeHeaders:A=[],matchHeaders:s=[],caseSensitive:r=!1}=e;return{ignore:new Set(t.map((e=>r?e:e.toLowerCase()))),exclude:new Set(A.map((e=>r?e:e.toLowerCase()))),match:new Set(s.map((e=>r?e:e.toLowerCase())))}},hashId:n,isUndiciHeaders:i,normalizeHeaders:function(e){const t={};if(!e)return t;if(i(e)){for(let A=0;A<e.length;A+=2){const s=e[A],r=e[A+1];if(s&&void 0!==r){const e=Buffer.isBuffer(s)?s.toString():s,A=Buffer.isBuffer(r)?r.toString():r;t[e.toLowerCase()]=A}}return t}if(e&&"object"==typeof e)for(const[A,s]of Object.entries(e))A&&"string"==typeof A&&(t[A.toLowerCase()]=Array.isArray(s)?s.join(", "):String(s));return t},isUrlExcludedFactory:function(e=[]){return 0===e.length?()=>!1:function(t){let A;for(const s of e)if("string"==typeof s){if(A||(A=t.toLowerCase()),A.includes(s.toLowerCase()))return!0}else if(s instanceof RegExp&&s.test(t))return!0;return!1}},validateSnapshotMode:function(e){if(!o.includes(e))throw new s(`Invalid snapshot mode: ${e}. Must be one of: ${o.join(", ")}`)}}},9453:(e,t,A)=>{"use strict";const{safeHTTPMethods:s,pathHasQueryOrFragment:r}=A(2858),{serializePathWithQuery:n}=A(2858);e.exports={makeCacheKey:function(e){if(!e.origin)throw new Error("opts.origin is undefined");let t=e.path||"/";return e.query&&!r(e.path)&&(t=n(t,e.query)),{origin:e.origin.toString(),method:e.method,path:t,headers:e.headers}},normalizeHeaders:function(e){let t;if(null==e.headers)t={};else if("function"==typeof e.headers[Symbol.iterator]){t={};for(const A of e.headers){if(!Array.isArray(A))throw new Error("opts.headers is not a valid header map");const[e,s]=A;if("string"!=typeof e||"string"!=typeof s)throw new Error("opts.headers is not a valid header map");t[e.toLowerCase()]=s}}else{if("object"!=typeof e.headers)throw new Error("opts.headers is not an object");t={};for(const A of Object.keys(e.headers))t[A.toLowerCase()]=e.headers[A]}return t},assertCacheKey:function(e){if("object"!=typeof e)throw new TypeError("expected key to be object, got "+typeof e);for(const t of["origin","method","path"])if("string"!=typeof e[t])throw new TypeError(`expected key.${t} to be string, got ${typeof e[t]}`);if(void 0!==e.headers&&"object"!=typeof e.headers)throw new TypeError("expected headers to be object, got "+typeof e)},assertCacheValue:function(e){if("object"!=typeof e)throw new TypeError("expected value to be object, got "+typeof e);for(const t of["statusCode","cachedAt","staleAt","deleteAt"])if("number"!=typeof e[t])throw new TypeError(`expected value.${t} to be number, got ${typeof e[t]}`);if("string"!=typeof e.statusMessage)throw new TypeError("expected value.statusMessage to be string, got "+typeof e.statusMessage);if(null!=e.headers&&"object"!=typeof e.headers)throw new TypeError("expected value.rawHeaders to be object, got "+typeof e.headers);if(void 0!==e.vary&&"object"!=typeof e.vary)throw new TypeError("expected value.vary to be object, got "+typeof e.vary);if(void 0!==e.etag&&"string"!=typeof e.etag)throw new TypeError("expected value.etag to be string, got "+typeof e.etag)},parseCacheControlHeader:function(e){const t={};let A;if(Array.isArray(e)){A=[];for(const t of e)A.push(...t.split(","))}else A=e.split(",");for(let e=0;e<A.length;e++){const s=A[e].toLowerCase(),r=s.indexOf("=");let n,i;switch(-1!==r?(n=s.substring(0,r).trimStart(),i=s.substring(r+1)):n=s.trim(),n){case"min-fresh":case"max-stale":case"max-age":case"s-maxage":case"stale-while-revalidate":case"stale-if-error":{if(void 0===i||" "===i[0])continue;i.length>=2&&'"'===i[0]&&'"'===i[i.length-1]&&(i=i.substring(1,i.length-1));const e=parseInt(i,10);if(e!=e)continue;if("max-age"===n&&n in t&&t[n]>=e)continue;t[n]=e;break}case"private":case"no-cache":if(i){if('"'===i[0]){const s=[i.substring(1)];let r='"'===i[i.length-1];if(!r)for(let t=e+1;t<A.length;t++){const e=A[t],n=e.length;if(s.push(e.trim()),0!==n&&'"'===e[n-1]){r=!0;break}}if(r){let e=s[s.length-1];'"'===e[e.length-1]&&(e=e.substring(0,e.length-1),s[s.length-1]=e),t[n]=n in t?t[n].concat(s):s}}else t[n]=n in t?t[n].concat(i):[i];break}case"public":case"no-store":case"must-revalidate":case"proxy-revalidate":case"immutable":case"no-transform":case"must-understand":case"only-if-cached":if(i)continue;t[n]=!0;break;default:continue}}return t},parseVaryHeader:function(e,t){if("string"==typeof e&&e.includes("*"))return t;const A={},s="string"==typeof e?e.split(","):e;for(const e of s){const s=e.trim().toLowerCase();A[s]=t[s]??null}return A},isEtagUsable:function(e){return!(e.length<=2)&&('"'===e[0]&&'"'===e[e.length-1]?!('"'===e[1]||e.startsWith('"W/')):!(!e.startsWith('W/"')||'"'!==e[e.length-1])&&4!==e.length)},assertCacheMethods:function(e,t="CacheMethods"){if(!Array.isArray(e))throw new TypeError(`expected type of ${t} needs to be an array, got ${null===e?"null":typeof e}`);if(0===e.length)throw new TypeError(`${t} needs to have at least one method`);for(const A of e)if(!s.includes(A))throw new TypeError(`element of ${t}-array needs to be one of following values: ${s.join(", ")}, got ${A}`)},assertCacheStore:function(e,t="CacheStore"){if("object"!=typeof e||null===e)throw new TypeError(`expected type of ${t} to be a CacheStore, got ${null===e?"null":typeof e}`);for(const A of["get","createWriteStream","delete"])if("function"!=typeof e[A])throw new TypeError(`${t} needs to have a \`${A}()\` function`)}}},8851:e=>{"use strict";e.exports={parseHttpDate:function(e){switch(e[3]){case",":return function(e){if(29!==e.length||" "!==e[4]||" "!==e[7]||" "!==e[11]||" "!==e[16]||":"!==e[19]||":"!==e[22]||" "!==e[25]||"G"!==e[26]||"M"!==e[27]||"T"!==e[28])return;let t=-1;if("S"===e[0]&&"u"===e[1]&&"n"===e[2])t=0;else if("M"===e[0]&&"o"===e[1]&&"n"===e[2])t=1;else if("T"===e[0]&&"u"===e[1]&&"e"===e[2])t=2;else if("W"===e[0]&&"e"===e[1]&&"d"===e[2])t=3;else if("T"===e[0]&&"h"===e[1]&&"u"===e[2])t=4;else if("F"===e[0]&&"r"===e[1]&&"i"===e[2])t=5;else{if("S"!==e[0]||"a"!==e[1]||"t"!==e[2])return;t=6}let A=0;if("0"===e[5]){const t=e.charCodeAt(6);if(t<49||t>57)return;A=t-48}else{const t=e.charCodeAt(5);if(t<49||t>51)return;const s=e.charCodeAt(6);if(s<48||s>57)return;A=10*(t-48)+(s-48)}let s=-1;if("J"===e[8]&&"a"===e[9]&&"n"===e[10])s=0;else if("F"===e[8]&&"e"===e[9]&&"b"===e[10])s=1;else if("M"===e[8]&&"a"===e[9])if("r"===e[10])s=2;else{if("y"!==e[10])return;s=4}else if("J"===e[8])if("a"===e[9]&&"n"===e[10])s=0;else{if("u"!==e[9])return;if("n"===e[10])s=5;else{if("l"!==e[10])return;s=6}}else if("A"===e[8])if("p"===e[9]&&"r"===e[10])s=3;else{if("u"!==e[9]||"g"!==e[10])return;s=7}else if("S"===e[8]&&"e"===e[9]&&"p"===e[10])s=8;else if("O"===e[8]&&"c"===e[9]&&"t"===e[10])s=9;else if("N"===e[8]&&"o"===e[9]&&"v"===e[10])s=10;else{if("D"!==e[8]||"e"!==e[9]||"c"!==e[10])return;s=11}const r=e.charCodeAt(12);if(r<48||r>57)return;const n=e.charCodeAt(13);if(n<48||n>57)return;const i=e.charCodeAt(14);if(i<48||i>57)return;const o=e.charCodeAt(15);if(o<48||o>57)return;const a=1e3*(r-48)+100*(n-48)+10*(i-48)+(o-48);let c=0;if("0"===e[17]){const t=e.charCodeAt(18);if(t<48||t>57)return;c=t-48}else{const t=e.charCodeAt(17);if(t<48||t>50)return;const A=e.charCodeAt(18);if(A<48||A>57)return;if(50===t&&A>51)return;c=10*(t-48)+(A-48)}let l=0;if("0"===e[20]){const t=e.charCodeAt(21);if(t<48||t>57)return;l=t-48}else{const t=e.charCodeAt(20);if(t<48||t>53)return;const A=e.charCodeAt(21);if(A<48||A>57)return;l=10*(t-48)+(A-48)}let h=0;if("0"===e[23]){const t=e.charCodeAt(24);if(t<48||t>57)return;h=t-48}else{const t=e.charCodeAt(23);if(t<48||t>53)return;const A=e.charCodeAt(24);if(A<48||A>57)return;h=10*(t-48)+(A-48)}const g=new Date(Date.UTC(a,s,A,c,l,h));return g.getUTCDay()===t?g:void 0}(e);case" ":return function(e){if(24!==e.length||" "!==e[7]||" "!==e[10]||" "!==e[19])return;let t=-1;if("S"===e[0]&&"u"===e[1]&&"n"===e[2])t=0;else if("M"===e[0]&&"o"===e[1]&&"n"===e[2])t=1;else if("T"===e[0]&&"u"===e[1]&&"e"===e[2])t=2;else if("W"===e[0]&&"e"===e[1]&&"d"===e[2])t=3;else if("T"===e[0]&&"h"===e[1]&&"u"===e[2])t=4;else if("F"===e[0]&&"r"===e[1]&&"i"===e[2])t=5;else{if("S"!==e[0]||"a"!==e[1]||"t"!==e[2])return;t=6}let A=-1;if("J"===e[4]&&"a"===e[5]&&"n"===e[6])A=0;else if("F"===e[4]&&"e"===e[5]&&"b"===e[6])A=1;else if("M"===e[4]&&"a"===e[5])if("r"===e[6])A=2;else{if("y"!==e[6])return;A=4}else if("J"===e[4])if("a"===e[5]&&"n"===e[6])A=0;else{if("u"!==e[5])return;if("n"===e[6])A=5;else{if("l"!==e[6])return;A=6}}else if("A"===e[4])if("p"===e[5]&&"r"===e[6])A=3;else{if("u"!==e[5]||"g"!==e[6])return;A=7}else if("S"===e[4]&&"e"===e[5]&&"p"===e[6])A=8;else if("O"===e[4]&&"c"===e[5]&&"t"===e[6])A=9;else if("N"===e[4]&&"o"===e[5]&&"v"===e[6])A=10;else{if("D"!==e[4]||"e"!==e[5]||"c"!==e[6])return;A=11}let s=0;if(" "===e[8]){const t=e.charCodeAt(9);if(t<49||t>57)return;s=t-48}else{const t=e.charCodeAt(8);if(t<49||t>51)return;const A=e.charCodeAt(9);if(A<48||A>57)return;s=10*(t-48)+(A-48)}let r=0;if("0"===e[11]){const t=e.charCodeAt(12);if(t<48||t>57)return;r=t-48}else{const t=e.charCodeAt(11);if(t<48||t>50)return;const A=e.charCodeAt(12);if(A<48||A>57)return;if(50===t&&A>51)return;r=10*(t-48)+(A-48)}let n=0;if("0"===e[14]){const t=e.charCodeAt(15);if(t<48||t>57)return;n=t-48}else{const t=e.charCodeAt(14);if(t<48||t>53)return;const A=e.charCodeAt(15);if(A<48||A>57)return;n=10*(t-48)+(A-48)}let i=0;if("0"===e[17]){const t=e.charCodeAt(18);if(t<48||t>57)return;i=t-48}else{const t=e.charCodeAt(17);if(t<48||t>53)return;const A=e.charCodeAt(18);if(A<48||A>57)return;i=10*(t-48)+(A-48)}const o=e.charCodeAt(20);if(o<48||o>57)return;const a=e.charCodeAt(21);if(a<48||a>57)return;const c=e.charCodeAt(22);if(c<48||c>57)return;const l=e.charCodeAt(23);if(l<48||l>57)return;const h=1e3*(o-48)+100*(a-48)+10*(c-48)+(l-48),g=new Date(Date.UTC(h,A,s,r,n,i));return g.getUTCDay()===t?g:void 0}(e);default:return function(e){let t=-1,A=-1;if("S"===e[0])"u"===e[1]&&"n"===e[2]&&"d"===e[3]&&"a"===e[4]&&"y"===e[5]?(A=0,t=6):"a"===e[1]&&"t"===e[2]&&"u"===e[3]&&"r"===e[4]&&"d"===e[5]&&"a"===e[6]&&"y"===e[7]&&(A=6,t=8);else if("M"===e[0]&&"o"===e[1]&&"n"===e[2]&&"d"===e[3]&&"a"===e[4]&&"y"===e[5])A=1,t=6;else if("T"===e[0])"u"===e[1]&&"e"===e[2]&&"s"===e[3]&&"d"===e[4]&&"a"===e[5]&&"y"===e[6]?(A=2,t=7):"h"===e[1]&&"u"===e[2]&&"r"===e[3]&&"s"===e[4]&&"d"===e[5]&&"a"===e[6]&&"y"===e[7]&&(A=4,t=8);else if("W"===e[0]&&"e"===e[1]&&"d"===e[2]&&"n"===e[3]&&"e"===e[4]&&"s"===e[5]&&"d"===e[6]&&"a"===e[7]&&"y"===e[8])A=3,t=9;else{if("F"!==e[0]||"r"!==e[1]||"i"!==e[2]||"d"!==e[3]||"a"!==e[4]||"y"!==e[5])return;A=5,t=6}if(","!==e[t]||e.length-t-1!=23||" "!==e[t+1]||"-"!==e[t+4]||"-"!==e[t+8]||" "!==e[t+11]||":"!==e[t+14]||":"!==e[t+17]||" "!==e[t+20]||"G"!==e[t+21]||"M"!==e[t+22]||"T"!==e[t+23])return;let s=0;if("0"===e[t+2]){const A=e.charCodeAt(t+3);if(A<49||A>57)return;s=A-48}else{const A=e.charCodeAt(t+2);if(A<49||A>51)return;const r=e.charCodeAt(t+3);if(r<48||r>57)return;s=10*(A-48)+(r-48)}let r=-1;if("J"===e[t+5]&&"a"===e[t+6]&&"n"===e[t+7])r=0;else if("F"===e[t+5]&&"e"===e[t+6]&&"b"===e[t+7])r=1;else if("M"===e[t+5]&&"a"===e[t+6]&&"r"===e[t+7])r=2;else if("A"===e[t+5]&&"p"===e[t+6]&&"r"===e[t+7])r=3;else if("M"===e[t+5]&&"a"===e[t+6]&&"y"===e[t+7])r=4;else if("J"===e[t+5]&&"u"===e[t+6]&&"n"===e[t+7])r=5;else if("J"===e[t+5]&&"u"===e[t+6]&&"l"===e[t+7])r=6;else if("A"===e[t+5]&&"u"===e[t+6]&&"g"===e[t+7])r=7;else if("S"===e[t+5]&&"e"===e[t+6]&&"p"===e[t+7])r=8;else if("O"===e[t+5]&&"c"===e[t+6]&&"t"===e[t+7])r=9;else if("N"===e[t+5]&&"o"===e[t+6]&&"v"===e[t+7])r=10;else{if("D"!==e[t+5]||"e"!==e[t+6]||"c"!==e[t+7])return;r=11}const n=e.charCodeAt(t+9);if(n<48||n>57)return;const i=e.charCodeAt(t+10);if(i<48||i>57)return;let o=10*(n-48)+(i-48);o+=o<70?2e3:1900;let a=0;if("0"===e[t+12]){const A=e.charCodeAt(t+13);if(A<48||A>57)return;a=A-48}else{const A=e.charCodeAt(t+12);if(A<48||A>50)return;const s=e.charCodeAt(t+13);if(s<48||s>57)return;if(50===A&&s>51)return;a=10*(A-48)+(s-48)}let c=0;if("0"===e[t+15]){const A=e.charCodeAt(t+16);if(A<48||A>57)return;c=A-48}else{const A=e.charCodeAt(t+15);if(A<48||A>53)return;const s=e.charCodeAt(t+16);if(s<48||s>57)return;c=10*(A-48)+(s-48)}let l=0;if("0"===e[t+18]){const A=e.charCodeAt(t+19);if(A<48||A>57)return;l=A-48}else{const A=e.charCodeAt(t+18);if(A<48||A>53)return;const s=e.charCodeAt(t+19);if(s<48||s>57)return;l=10*(A-48)+(s-48)}const h=new Date(Date.UTC(o,r,s,a,c,l));return h.getUTCDay()===A?h:void 0}(e)}}}},9250:e=>{"use strict";e.exports={createDeferredPromise:function(){let e,t;return{promise:new Promise(((A,s)=>{e=A,t=s})),resolve:e,reject:t}}}},4304:(e,t,A)=>{"use strict";const{kConnected:s,kPending:r,kRunning:n,kSize:i,kFree:o,kQueued:a}=A(257);e.exports={ClientStats:class{constructor(e){this.connected=e[s],this.pending=e[r],this.running=e[n],this.size=e[i]}},PoolStats:class{constructor(e){this.connected=e[s],this.free=e[o],this.pending=e[r],this.queued=e[a],this.running=e[n],this.size=e[i]}}}},3801:e=>{"use strict";let t=0;const A=1e3;let s;const r=Symbol("kFastTimer"),n=[];function i(){t+=499;let e=0,A=n.length;for(;e<A;){const s=n[e];0===s._state?(s._idleStart=t-499,s._state=1):1===s._state&&t>=s._idleStart+s._idleTimeout&&(s._state=-1,s._idleStart=-1,s._onTimeout(s._timerArg)),-1===s._state?(s._state=-2,0!=--A&&(n[e]=n[A])):++e}n.length=A,0!==n.length&&o()}function o(){s?.refresh?s.refresh():(clearTimeout(s),s=setTimeout(i,499),s?.unref())}class a{[r]=!0;_state=-2;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,t,A){this._onTimeout=e,this._idleTimeout=t,this._timerArg=A,this.refresh()}refresh(){-2===this._state&&n.push(this),s&&1!==n.length||o(),this._state=0}clear(){this._state=-1,this._idleStart=-1}}e.exports={setTimeout:(e,t,s)=>t<=A?setTimeout(e,t,s):new a(e,t,s),clearTimeout(e){e[r]?e.clear():clearTimeout(e)},setFastTimeout:(e,t,A)=>new a(e,t,A),clearFastTimeout(e){e.clear()},now:()=>t,tick(e=0){t+=e-A+1,i(),i()},reset(){t=0,n.length=0,clearTimeout(s),s=null},kFastTimer:r}},4420:(e,t,A)=>{"use strict";const s=A(4589),{kConstruct:r}=A(257),{urlEquals:n,getFieldValues:i}=A(3932),{kEnumerableProperty:o,isDisturbed:a}=A(2858),{webidl:c}=A(6097),{cloneResponse:l,fromInnerResponse:h,getResponseState:g}=A(4821),{Request:d,fromInnerRequest:u,getRequestState:E}=A(4609),{fetching:I}=A(7388),{urlIsHttpHttpsScheme:Q,readAllBytes:C}=A(6686),{createDeferredPromise:B}=A(9250);class p{#Le;constructor(){arguments[0]!==r&&c.illegalConstructor(),c.util.markAsUncloneable(this),this.#Le=arguments[1]}async match(e,t={}){c.brandCheck(this,p);const A="Cache.match";c.argumentLengthCheck(arguments,1,A),e=c.converters.RequestInfo(e),t=c.converters.CacheQueryOptions(t,A,"options");const s=this.#He(e,t,1);if(0!==s.length)return s[0]}async matchAll(e=void 0,t={}){c.brandCheck(this,p);return void 0!==e&&(e=c.converters.RequestInfo(e)),t=c.converters.CacheQueryOptions(t,"Cache.matchAll","options"),this.#He(e,t)}async add(e){c.brandCheck(this,p);c.argumentLengthCheck(arguments,1,"Cache.add");const t=[e=c.converters.RequestInfo(e)],A=this.addAll(t);return await A}async addAll(e){c.brandCheck(this,p);const t="Cache.addAll";c.argumentLengthCheck(arguments,1,t);const A=[],s=[];for(let A of e){if(void 0===A)throw c.errors.conversionFailed({prefix:t,argument:"Argument 1",types:["undefined is not allowed"]});if(A=c.converters.RequestInfo(A),"string"==typeof A)continue;const e=E(A);if(!Q(e.url)||"GET"!==e.method)throw c.errors.exception({header:t,message:"Expected http/s scheme when method is not GET."})}const r=[];for(const n of e){const e=E(new d(n));if(!Q(e.url))throw c.errors.exception({header:t,message:"Expected http/s scheme."});e.initiator="fetch",e.destination="subresource",s.push(e);const o=B();r.push(I({request:e,processResponse(e){if("error"===e.type||206===e.status||e.status<200||e.status>299)o.reject(c.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(e.headersList.contains("vary")){const t=i(e.headersList.get("vary"));for(const e of t)if("*"===e){o.reject(c.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(const e of r)e.abort();return}}},processResponseEndOfBody(e){e.aborted?o.reject(new DOMException("aborted","AbortError")):o.resolve(e)}})),A.push(o.promise)}const n=Promise.all(A),o=await n,a=[];let l=0;for(const e of o){const t={type:"put",request:s[l],response:e};a.push(t),l++}const h=B();let g=null;try{this.#xe(a)}catch(e){g=e}return queueMicrotask((()=>{null===g?h.resolve(void 0):h.reject(g)})),h.promise}async put(e,t){c.brandCheck(this,p);const A="Cache.put";c.argumentLengthCheck(arguments,2,A),e=c.converters.RequestInfo(e),t=c.converters.Response(t,A,"response");let s=null;if(s=c.is.Request(e)?E(e):E(new d(e)),!Q(s.url)||"GET"!==s.method)throw c.errors.exception({header:A,message:"Expected an http/s scheme when method is not GET"});const r=g(t);if(206===r.status)throw c.errors.exception({header:A,message:"Got 206 status"});if(r.headersList.contains("vary")){const e=i(r.headersList.get("vary"));for(const t of e)if("*"===t)throw c.errors.exception({header:A,message:"Got * vary field value"})}if(r.body&&(a(r.body.stream)||r.body.stream.locked))throw c.errors.exception({header:A,message:"Response body is locked or disturbed"});const n=l(r),o=B();if(null!=r.body){const e=r.body.stream.getReader();C(e,o.resolve,o.reject)}else o.resolve(void 0);const h=[],u={type:"put",request:s,response:n};h.push(u);const I=await o.promise;null!=n.body&&(n.body.source=I);const f=B();let m=null;try{this.#xe(h)}catch(e){m=e}return queueMicrotask((()=>{null===m?f.resolve():f.reject(m)})),f.promise}async delete(e,t={}){c.brandCheck(this,p);const A="Cache.delete";c.argumentLengthCheck(arguments,1,A),e=c.converters.RequestInfo(e),t=c.converters.CacheQueryOptions(t,A,"options");let r=null;if(c.is.Request(e)){if(r=E(e),"GET"!==r.method&&!t.ignoreMethod)return!1}else s("string"==typeof e),r=E(new d(e));const n=[],i={type:"delete",request:r,options:t};n.push(i);const o=B();let a,l=null;try{a=this.#xe(n)}catch(e){l=e}return queueMicrotask((()=>{null===l?o.resolve(!!a?.length):o.reject(l)})),o.promise}async keys(e=void 0,t={}){c.brandCheck(this,p);void 0!==e&&(e=c.converters.RequestInfo(e)),t=c.converters.CacheQueryOptions(t,"Cache.keys","options");let A=null;if(void 0!==e)if(c.is.Request(e)){if(A=E(e),"GET"!==A.method&&!t.ignoreMethod)return[]}else"string"==typeof e&&(A=E(new d(e)));const s=B(),r=[];if(void 0===e)for(const e of this.#Le)r.push(e[0]);else{const e=this.#Ye(A,t);for(const t of e)r.push(t[0])}return queueMicrotask((()=>{const e=[];for(const t of r){const A=u(t,void 0,(new AbortController).signal,"immutable");e.push(A)}s.resolve(Object.freeze(e))})),s.promise}#xe(e){const t=this.#Le,A=[...t],r=[],n=[];try{for(const A of e){if("delete"!==A.type&&"put"!==A.type)throw c.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if("delete"===A.type&&null!=A.response)throw c.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#Ye(A.request,A.options,r).length)throw new DOMException("???","InvalidStateError");let e;if("delete"===A.type){if(e=this.#Ye(A.request,A.options),0===e.length)return[];for(const A of e){const e=t.indexOf(A);s(-1!==e),t.splice(e,1)}}else if("put"===A.type){if(null==A.response)throw c.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});const n=A.request;if(!Q(n.url))throw c.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if("GET"!==n.method)throw c.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(null!=A.options)throw c.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});e=this.#Ye(A.request);for(const A of e){const e=t.indexOf(A);s(-1!==e),t.splice(e,1)}t.push([A.request,A.response]),r.push([A.request,A.response])}n.push([A.request,A.response])}return n}catch(e){throw this.#Le.length=0,this.#Le=A,e}}#Ye(e,t,A){const s=[],r=A??this.#Le;for(const A of r){const[r,n]=A;this.#Pe(e,r,n,t)&&s.push(A)}return s}#Pe(e,t,A=null,s){const r=new URL(e.url),o=new URL(t.url);if(s?.ignoreSearch&&(o.search="",r.search=""),!n(r,o,!0))return!1;if(null==A||s?.ignoreVary||!A.headersList.contains("vary"))return!0;const a=i(A.headersList.get("vary"));for(const A of a){if("*"===A)return!1;if(t.headersList.get(A)!==e.headersList.get(A))return!1}return!0}#He(e,t,A=1/0){let s=null;if(void 0!==e)if(c.is.Request(e)){if(s=E(e),"GET"!==s.method&&!t.ignoreMethod)return[]}else"string"==typeof e&&(s=E(new d(e)));const r=[];if(void 0===e)for(const e of this.#Le)r.push(e[1]);else{const e=this.#Ye(s,t);for(const t of e)r.push(t[1])}const n=[];for(const e of r){const t=h(e,"immutable");if(n.push(t.clone()),n.length>=A)break}return Object.freeze(n)}}Object.defineProperties(p.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:o,matchAll:o,add:o,addAll:o,put:o,delete:o,keys:o});const f=[{key:"ignoreSearch",converter:c.converters.boolean,defaultValue:()=>!1},{key:"ignoreMethod",converter:c.converters.boolean,defaultValue:()=>!1},{key:"ignoreVary",converter:c.converters.boolean,defaultValue:()=>!1}];c.converters.CacheQueryOptions=c.dictionaryConverter(f),c.converters.MultiCacheQueryOptions=c.dictionaryConverter([...f,{key:"cacheName",converter:c.converters.DOMString}]),c.converters.Response=c.interfaceConverter(c.is.Response,"Response"),c.converters["sequence<RequestInfo>"]=c.sequenceConverter(c.converters.RequestInfo),e.exports={Cache:p}},6939:(e,t,A)=>{"use strict";const{Cache:s}=A(4420),{webidl:r}=A(6097),{kEnumerableProperty:n}=A(2858),{kConstruct:i}=A(257);class o{#Ve=new Map;constructor(){arguments[0]!==i&&r.illegalConstructor(),r.util.markAsUncloneable(this)}async match(e,t={}){if(r.brandCheck(this,o),r.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=r.converters.RequestInfo(e),null!=(t=r.converters.MultiCacheQueryOptions(t)).cacheName){if(this.#Ve.has(t.cacheName)){const A=this.#Ve.get(t.cacheName),r=new s(i,A);return await r.match(e,t)}}else for(const A of this.#Ve.values()){const r=new s(i,A),n=await r.match(e,t);if(void 0!==n)return n}}async has(e){r.brandCheck(this,o);const t="CacheStorage.has";return r.argumentLengthCheck(arguments,1,t),e=r.converters.DOMString(e,t,"cacheName"),this.#Ve.has(e)}async open(e){r.brandCheck(this,o);const t="CacheStorage.open";if(r.argumentLengthCheck(arguments,1,t),e=r.converters.DOMString(e,t,"cacheName"),this.#Ve.has(e)){const t=this.#Ve.get(e);return new s(i,t)}const A=[];return this.#Ve.set(e,A),new s(i,A)}async delete(e){r.brandCheck(this,o);const t="CacheStorage.delete";return r.argumentLengthCheck(arguments,1,t),e=r.converters.DOMString(e,t,"cacheName"),this.#Ve.delete(e)}async keys(){r.brandCheck(this,o);return[...this.#Ve.keys()]}}Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:n,has:n,open:n,delete:n,keys:n}),e.exports={CacheStorage:o}},3932:(e,t,A)=>{"use strict";const s=A(4589),{URLSerializer:r}=A(9934),{isValidHeaderName:n}=A(6686);e.exports={urlEquals:function(e,t,A=!1){return r(e,A)===r(t,A)},getFieldValues:function(e){s(null!==e);const t=[];for(let A of e.split(","))A=A.trim(),n(A)&&t.push(A);return t}}},3042:e=>{"use strict";e.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}},9391:(e,t,A)=>{"use strict";const{parseSetCookie:s}=A(6712),{stringify:r}=A(9871),{webidl:n}=A(6097),{Headers:i}=A(6558),o=n.brandCheckMultiple([i,globalThis.Headers].filter(Boolean));function a(e,t){n.argumentLengthCheck(arguments,2,"setCookie"),o(e),t=n.converters.Cookie(t);const A=r(t);A&&e.append("set-cookie",A,!0)}n.converters.DeleteCookieAttributes=n.dictionaryConverter([{converter:n.nullableConverter(n.converters.DOMString),key:"path",defaultValue:()=>null},{converter:n.nullableConverter(n.converters.DOMString),key:"domain",defaultValue:()=>null}]),n.converters.Cookie=n.dictionaryConverter([{converter:n.converters.DOMString,key:"name"},{converter:n.converters.DOMString,key:"value"},{converter:n.nullableConverter((e=>"number"==typeof e?n.converters["unsigned long long"](e):new Date(e))),key:"expires",defaultValue:()=>null},{converter:n.nullableConverter(n.converters["long long"]),key:"maxAge",defaultValue:()=>null},{converter:n.nullableConverter(n.converters.DOMString),key:"domain",defaultValue:()=>null},{converter:n.nullableConverter(n.converters.DOMString),key:"path",defaultValue:()=>null},{converter:n.nullableConverter(n.converters.boolean),key:"secure",defaultValue:()=>null},{converter:n.nullableConverter(n.converters.boolean),key:"httpOnly",defaultValue:()=>null},{converter:n.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:n.sequenceConverter(n.converters.DOMString),key:"unparsed",defaultValue:()=>[]}]),e.exports={getCookies:function(e){n.argumentLengthCheck(arguments,1,"getCookies"),o(e);const t=e.get("cookie"),A={};if(!t)return A;for(const e of t.split(";")){const[t,...s]=e.split("=");A[t.trim()]=s.join("=")}return A},deleteCookie:function(e,t,A){o(e);const s="deleteCookie";n.argumentLengthCheck(arguments,2,s),t=n.converters.DOMString(t,s,"name"),A=n.converters.DeleteCookieAttributes(A),a(e,{name:t,value:"",expires:new Date(0),...A})},getSetCookies:function(e){n.argumentLengthCheck(arguments,1,"getSetCookies"),o(e);const t=e.getSetCookie();return t?t.map((e=>s(e))):[]},setCookie:a,parseCookie:function(e){return e=n.converters.DOMString(e),s(e)}}},6712:(e,t,A)=>{"use strict";const{maxNameValuePairSize:s,maxAttributeValueSize:r}=A(3042),{isCTLExcludingHtab:n}=A(9871),{collectASequenceOfCodePointsFast:i}=A(9934),o=A(4589),{unescape:a}=A(1792);function c(e,t={}){if(0===e.length)return t;o(";"===e[0]);let A="";(e=e.slice(1)).includes(";")?(A=i(";",e,{position:0}),e=e.slice(A.length)):(A=e,e="");let s="",n="";if(A.includes("=")){const e={position:0};s=i("=",A,e),n=A.slice(e.position+1)}else s=A;if(s=s.trim(),n=n.trim(),n.length>r)return c(e,t);const a=s.toLowerCase();if("expires"===a){const e=new Date(n);t.expires=e}else if("max-age"===a){const A=n.charCodeAt(0);if((A<48||A>57)&&"-"!==n[0])return c(e,t);if(!/^\d+$/.test(n))return c(e,t);const s=Number(n);t.maxAge=s}else if("domain"===a){let e=n;"."===e[0]&&(e=e.slice(1)),e=e.toLowerCase(),t.domain=e}else if("path"===a){let e="";e=0===n.length||"/"!==n[0]?"/":n,t.path=e}else if("secure"===a)t.secure=!0;else if("httponly"===a)t.httpOnly=!0;else if("samesite"===a){let e="Default";const A=n.toLowerCase();A.includes("none")&&(e="None"),A.includes("strict")&&(e="Strict"),A.includes("lax")&&(e="Lax"),t.sameSite=e}else t.unparsed??=[],t.unparsed.push(`${s}=${n}`);return c(e,t)}e.exports={parseSetCookie:function(e){if(n(e))return null;let t="",A="",r="",o="";if(e.includes(";")){const s={position:0};t=i(";",e,s),A=e.slice(s.position)}else t=e;if(t.includes("=")){const e={position:0};r=i("=",t,e),o=t.slice(e.position+1)}else o=t;return r=r.trim(),o=o.trim(),r.length+o.length>s?null:{name:r,value:a(o),...c(A)}},parseUnparsedAttributes:c}},9871:e=>{"use strict";function t(e){for(let t=0;t<e.length;++t){const A=e.charCodeAt(t);if(A<33||A>126||34===A||40===A||41===A||60===A||62===A||64===A||44===A||59===A||58===A||92===A||47===A||91===A||93===A||63===A||61===A||123===A||125===A)throw new Error("Invalid cookie name")}}function A(e){let t=e.length,A=0;if('"'===e[0]){if(1===t||'"'!==e[t-1])throw new Error("Invalid cookie value");--t,++A}for(;A<t;){const t=e.charCodeAt(A++);if(t<33||t>126||34===t||44===t||59===t||92===t)throw new Error("Invalid cookie value")}}function s(e){for(let t=0;t<e.length;++t){const A=e.charCodeAt(t);if(A<32||127===A||59===A)throw new Error("Invalid cookie path")}}const r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i=Array(61).fill(0).map(((e,t)=>t.toString().padStart(2,"0")));function o(e){return"number"==typeof e&&(e=new Date(e)),`${r[e.getUTCDay()]}, ${i[e.getUTCDate()]} ${n[e.getUTCMonth()]} ${e.getUTCFullYear()} ${i[e.getUTCHours()]}:${i[e.getUTCMinutes()]}:${i[e.getUTCSeconds()]} GMT`}e.exports={isCTLExcludingHtab:function(e){for(let t=0;t<e.length;++t){const A=e.charCodeAt(t);if(A>=0&&A<=8||A>=10&&A<=31||127===A)return!0}return!1},validateCookieName:t,validateCookiePath:s,validateCookieValue:A,toIMFDate:o,stringify:function(e){if(0===e.name.length)return null;t(e.name),A(e.value);const r=[`${e.name}=${e.value}`];e.name.startsWith("__Secure-")&&(e.secure=!0),e.name.startsWith("__Host-")&&(e.secure=!0,e.domain=null,e.path="/"),e.secure&&r.push("Secure"),e.httpOnly&&r.push("HttpOnly"),"number"==typeof e.maxAge&&(!function(e){if(e<0)throw new Error("Invalid cookie max-age")}(e.maxAge),r.push(`Max-Age=${e.maxAge}`)),e.domain&&(!function(e){if(e.startsWith("-")||e.endsWith(".")||e.endsWith("-"))throw new Error("Invalid cookie domain")}(e.domain),r.push(`Domain=${e.domain}`)),e.path&&(s(e.path),r.push(`Path=${e.path}`)),e.expires&&"Invalid Date"!==e.expires.toString()&&r.push(`Expires=${o(e.expires)}`),e.sameSite&&r.push(`SameSite=${e.sameSite}`);for(const t of e.unparsed){if(!t.includes("="))throw new Error("Invalid unparsed");const[e,...A]=t.split("=");r.push(`${e.trim()}=${A.join("=")}`)}return r.join("; ")}}},8813:(e,t,A)=>{"use strict";const{Transform:s}=A(7075),{isASCIINumber:r,isValidLastEventId:n}=A(4689),i=[239,187,191];e.exports={EventSourceStream:class extends s{state;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,t,A){if(0!==e.length){if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:return this.buffer[0]===i[0]||(this.checkBOM=!1),void A();case 2:if(this.buffer[0]===i[0]&&this.buffer[1]===i[1])return void A();this.checkBOM=!1;break;case 3:if(this.buffer[0]===i[0]&&this.buffer[1]===i[1]&&this.buffer[2]===i[2])return this.buffer=Buffer.alloc(0),this.checkBOM=!1,void A();this.checkBOM=!1;break;default:this.buffer[0]===i[0]&&this.buffer[1]===i[1]&&this.buffer[2]===i[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1}for(;this.pos<this.buffer.length;)if(this.eventEndCheck){if(this.crlfCheck){if(10===this.buffer[this.pos]){this.buffer=this.buffer.subarray(this.pos+1),this.pos=0,this.crlfCheck=!1;continue}this.crlfCheck=!1}if(10===this.buffer[this.pos]||13===this.buffer[this.pos]){13===this.buffer[this.pos]&&(this.crlfCheck=!0),this.buffer=this.buffer.subarray(this.pos+1),this.pos=0,(void 0!==this.event.data||this.event.event||void 0!==this.event.id||this.event.retry)&&this.processEvent(this.event),this.clearEvent();continue}this.eventEndCheck=!1}else 10!==this.buffer[this.pos]&&13!==this.buffer[this.pos]?this.pos++:(13===this.buffer[this.pos]&&(this.crlfCheck=!0),this.parseLine(this.buffer.subarray(0,this.pos),this.event),this.buffer=this.buffer.subarray(this.pos+1),this.pos=0,this.eventEndCheck=!0);A()}else A()}parseLine(e,t){if(0===e.length)return;const A=e.indexOf(58);if(0===A)return;let s="",i="";if(-1!==A){s=e.subarray(0,A).toString("utf8");let t=A+1;32===e[t]&&++t,i=e.subarray(t).toString("utf8")}else s=e.toString("utf8"),i="";switch(s){case"data":void 0===t[s]?t[s]=i:t[s]+=`\n${i}`;break;case"retry":r(i)&&(t[s]=i);break;case"id":n(i)&&(t[s]=i);break;case"event":i.length>0&&(t[s]=i)}}processEvent(e){e.retry&&r(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),void 0!==e.id&&n(e.id)&&(this.state.lastEventId=e.id),void 0!==e.data&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}}}},7928:(e,t,A)=>{"use strict";const{pipeline:s}=A(7075),{fetching:r}=A(7388),{makeRequest:n}=A(4609),{webidl:i}=A(6097),{EventSourceStream:o}=A(8813),{parseMIMEType:a}=A(9934),{createFastMessageEvent:c}=A(878),{isNetworkError:l}=A(4821),{kEnumerableProperty:h}=A(2858),{environmentSettingsObject:g}=A(6686);let d=!1;class u extends EventTarget{#Oe={open:null,error:null,message:null};#Ge;#Je=!1;#We=0;#_e=null;#$=null;#qe;#le;constructor(e,t={}){super(),i.util.markAsUncloneable(this);const A="EventSource constructor";i.argumentLengthCheck(arguments,1,A),d||(d=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=i.converters.USVString(e),t=i.converters.EventSourceInitDict(t,A,"eventSourceInitDict"),this.#qe=t.node.dispatcher||t.dispatcher,this.#le={lastEventId:"",reconnectionTime:t.node.reconnectionTime};const s=g;let r;try{r=new URL(e,s.settingsObject.baseUrl),this.#le.origin=r.origin}catch(e){throw new DOMException(e,"SyntaxError")}this.#Ge=r.href;let o="anonymous";!0===t.withCredentials&&(o="use-credentials",this.#Je=!0);const a={redirect:"follow",keepalive:!0,mode:"cors",credentials:"anonymous"===o?"same-origin":"omit",referrer:"no-referrer"};a.client=g.settingsObject,a.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],a.cache="no-store",a.initiator="other",a.urlList=[new URL(this.#Ge)],this.#_e=n(a),this.#$e()}get readyState(){return this.#We}get url(){return this.#Ge}get withCredentials(){return this.#Je}#$e(){if(2===this.#We)return;this.#We=0;const e={request:this.#_e,dispatcher:this.#qe};e.processResponseEndOfBody=e=>{if(!l(e))return this.#Xe()},e.processResponse=e=>{if(l(e))return e.aborted?(this.close(),void this.dispatchEvent(new Event("error"))):void this.#Xe();const t=e.headersList.get("content-type",!0),A=null!==t?a(t):"failure",r="failure"!==A&&"text/event-stream"===A.essence;if(200!==e.status||!1===r)return this.close(),void this.dispatchEvent(new Event("error"));this.#We=1,this.dispatchEvent(new Event("open")),this.#le.origin=e.urlList[e.urlList.length-1].origin;const n=new o({eventSourceSettings:this.#le,push:e=>{this.dispatchEvent(c(e.type,e.options))}});s(e.body.stream,n,(e=>{!1===e?.aborted&&(this.close(),this.dispatchEvent(new Event("error")))}))},this.#$=r(e)}#Xe(){2!==this.#We&&(this.#We=0,this.dispatchEvent(new Event("error")),setTimeout((()=>{0===this.#We&&(this.#le.lastEventId.length&&this.#_e.headersList.set("last-event-id",this.#le.lastEventId,!0),this.#$e())}),this.#le.reconnectionTime)?.unref())}close(){i.brandCheck(this,u),2!==this.#We&&(this.#We=2,this.#$.abort(),this.#_e=null)}get onopen(){return this.#Oe.open}set onopen(e){this.#Oe.open&&this.removeEventListener("open",this.#Oe.open);const t=i.converters.EventHandlerNonNull(e);null!==t?(this.addEventListener("open",t),this.#Oe.open=e):this.#Oe.open=null}get onmessage(){return this.#Oe.message}set onmessage(e){this.#Oe.message&&this.removeEventListener("message",this.#Oe.message);const t=i.converters.EventHandlerNonNull(e);null!==t?(this.addEventListener("message",t),this.#Oe.message=e):this.#Oe.message=null}get onerror(){return this.#Oe.error}set onerror(e){this.#Oe.error&&this.removeEventListener("error",this.#Oe.error);const t=i.converters.EventHandlerNonNull(e);null!==t?(this.addEventListener("error",t),this.#Oe.error=e):this.#Oe.error=null}}const E={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:0,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:1,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:2,writable:!1}};Object.defineProperties(u,E),Object.defineProperties(u.prototype,E),Object.defineProperties(u.prototype,{close:h,onerror:h,onmessage:h,onopen:h,readyState:h,url:h,withCredentials:h}),i.converters.EventSourceInitDict=i.dictionaryConverter([{key:"withCredentials",converter:i.converters.boolean,defaultValue:()=>!1},{key:"dispatcher",converter:i.converters.any},{key:"node",converter:i.dictionaryConverter([{key:"reconnectionTime",converter:i.converters["unsigned long"],defaultValue:()=>3e3},{key:"dispatcher",converter:i.converters.any}]),defaultValue:()=>({})}]),e.exports={EventSource:u,defaultReconnectionTime:3e3}},4689:e=>{"use strict";e.exports={isValidLastEventId:function(e){return-1===e.indexOf("\0")},isASCIINumber:function(e){if(0===e.length)return!1;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)<48||e.charCodeAt(t)>57)return!1;return!0}}},2530:(e,t,A)=>{"use strict";const s=A(2858),{ReadableStreamFrom:r,readableStreamClose:n,fullyReadBody:i,extractMimeType:o,utf8DecodeBytes:a}=A(6686),{FormData:c,setFormDataState:l}=A(3944),{webidl:h}=A(6097),g=A(4589),{isErrored:d,isDisturbed:u}=A(7075),{isArrayBuffer:E}=A(3429),{serializeAMimeType:I}=A(9934),{multipartFormDataParser:Q}=A(4614),{createDeferredPromise:C}=A(9250);let B;try{const e=A(7598);B=t=>e.randomInt(0,t)}catch{B=e=>Math.floor(Math.random()*e)}const p=new TextEncoder;function f(){}const m=new FinalizationRegistry((e=>{const t=e.deref();!t||t.locked||u(t)||d(t)||t.cancel("Response object has been garbage collected").catch(f)}));function y(e,t=!1){let A=null;A=h.is.ReadableStream(e)?e:h.is.Blob(e)?e.stream():new ReadableStream({pull(e){const t="string"==typeof o?p.encode(o):o;t.byteLength&&e.enqueue(t),queueMicrotask((()=>n(e)))},start(){},type:"bytes"}),g(h.is.ReadableStream(A));let i=null,o=null,a=null,c=null;if("string"==typeof e)o=e,c="text/plain;charset=UTF-8";else if(h.is.URLSearchParams(e))o=e.toString(),c="application/x-www-form-urlencoded;charset=UTF-8";else if(h.is.BufferSource(e))o=E(e)?new Uint8Array(e.slice()):new Uint8Array(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));else if(h.is.FormData(e)){const t=`----formdata-undici-0${`${B(1e11)}`.padStart(11,"0")}`,A=`--${t}\r\nContent-Disposition: form-data`,s=e=>e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),r=e=>e.replace(/\r?\n|\r/g,"\r\n"),n=[],l=new Uint8Array([13,10]);a=0;let h=!1;for(const[t,i]of e)if("string"==typeof i){const e=p.encode(A+`; name="${s(r(t))}"`+`\r\n\r\n${r(i)}\r\n`);n.push(e),a+=e.byteLength}else{const e=p.encode(`${A}; name="${s(r(t))}"`+(i.name?`; filename="${s(i.name)}"`:"")+"\r\n"+`Content-Type: ${i.type||"application/octet-stream"}\r\n\r\n`);n.push(e,i,l),"number"==typeof i.size?a+=e.byteLength+i.size+l.byteLength:h=!0}const g=p.encode(`--${t}--\r\n`);n.push(g),a+=g.byteLength,h&&(a=null),o=e,i=async function*(){for(const e of n)e.stream?yield*e.stream():yield e},c=`multipart/form-data; boundary=${t}`}else if(h.is.Blob(e))o=e,a=e.size,e.type&&(c=e.type);else if("function"==typeof e[Symbol.asyncIterator]){if(t)throw new TypeError("keepalive");if(s.isDisturbed(e)||e.locked)throw new TypeError("Response body object should not be disturbed or locked");A=h.is.ReadableStream(e)?e:r(e)}if(("string"==typeof o||s.isBuffer(o))&&(a=Buffer.byteLength(o)),null!=i){let t;A=new ReadableStream({async start(){t=i(e)[Symbol.asyncIterator]()},async pull(e){const{value:s,done:r}=await t.next();if(r)queueMicrotask((()=>{e.close(),e.byobRequest?.respond(0)}));else if(!d(A)){const t=new Uint8Array(s);t.byteLength&&e.enqueue(t)}return e.desiredSize>0},async cancel(e){await t.return()},type:"bytes"})}return[{stream:A,source:o,length:a},c]}function S(e,t,A,s){try{h.brandCheck(e,A)}catch(e){return Promise.reject(e)}const r=s(e);if(D(r))return Promise.reject(new TypeError("Body is unusable: Body has already been read"));if(r.aborted)return Promise.reject(new DOMException("The operation was aborted.","AbortError"));const n=C(),o=n.reject,a=e=>{try{n.resolve(t(e))}catch(e){o(e)}};return null==r.body?(a(Buffer.allocUnsafe(0)),n.promise):(i(r.body,a,o),n.promise)}function D(e){const t=e.body;return null!=t&&(t.stream.locked||s.isDisturbed(t.stream))}function w(e){return JSON.parse(a(e))}function b(e){const t=e.headersList,A=o(t);return"failure"===A?null:A}e.exports={extractBody:y,safelyExtractBody:function(e,t=!1){return h.is.ReadableStream(e)&&(g(!s.isDisturbed(e),"The body has already been consumed."),g(!e.locked,"The stream is locked.")),y(e,t)},cloneBody:function(e){const{0:t,1:A}=e.stream.tee();return e.stream=t,{stream:A,length:e.length,source:e.source}},mixinBody:function(e,t){Object.assign(e.prototype,function(e,t){return{blob(){return S(this,(e=>{let A=b(t(this));return null===A?A="":A&&(A=I(A)),new Blob([e],{type:A})}),e,t)},arrayBuffer(){return S(this,(e=>new Uint8Array(e).buffer),e,t)},text(){return S(this,a,e,t)},json(){return S(this,w,e,t)},formData(){return S(this,(e=>{const A=b(t(this));if(null!==A)switch(A.essence){case"multipart/form-data":{const t=Q(e,A),s=new c;return l(s,t),s}case"application/x-www-form-urlencoded":{const t=new URLSearchParams(e.toString()),A=new c;for(const[e,s]of t)A.append(e,s);return A}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')}),e,t)},bytes(){return S(this,(e=>new Uint8Array(e)),e,t)}}}(e,t))},streamRegistry:m,bodyUnusable:D}},9441:e=>{"use strict";const t=["GET","HEAD","POST"],A=new Set(t),s=[301,302,303,307,308],r=new Set(s),n=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"],i=new Set(n),o=["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],a=["",...o],c=new Set(o),l=["GET","HEAD","OPTIONS","TRACE"],h=new Set(l),g=["CONNECT","TRACE","TRACK"],d=new Set(g),u=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],E=new Set(u);e.exports={subresource:u,forbiddenMethods:g,requestBodyHeader:["content-encoding","content-language","content-location","content-type","content-length"],referrerPolicy:a,requestRedirect:["follow","manual","error"],requestMode:["navigate","same-origin","no-cors","cors"],requestCredentials:["omit","same-origin","include"],requestCache:["default","no-store","reload","no-cache","force-cache","only-if-cached"],redirectStatus:s,corsSafeListedMethods:t,nullBodyStatus:[101,204,205,304],safeMethods:l,badPorts:n,requestDuplex:["half"],subresourceSet:E,badPortsSet:i,redirectStatusSet:r,corsSafeListedMethodsSet:A,safeMethodsSet:h,forbiddenMethodsSet:d,referrerPolicyTokens:c}},9934:(e,t,A)=>{"use strict";const s=A(4589),r=new TextEncoder,n=/^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/,i=/[\u000A\u000D\u0009\u0020]/,o=/[\u0009\u000A\u000C\u000D\u0020]/g,a=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function c(e,t=!1){if(!t)return e.href;const A=e.href,s=e.hash.length,r=0===s?A:A.substring(0,A.length-s);return!s&&A.endsWith("#")?r.slice(0,-1):r}function l(e,t,A){let s="";for(;A.position<t.length&&e(t[A.position]);)s+=t[A.position],A.position++;return s}function h(e,t,A){const s=t.indexOf(e,A.position),r=A.position;return-1===s?(A.position=t.length,t.slice(r)):(A.position=s,t.slice(r,A.position))}function g(e){return function(e){const t=e.length,A=new Uint8Array(t);let s=0;for(let r=0;r<t;++r){const t=e[r];37!==t?A[s++]=t:37!==t||d(e[r+1])&&d(e[r+2])?(A[s++]=u(e[r+1])<<4|u(e[r+2]),r+=2):A[s++]=37}return t===s?A:A.subarray(0,s)}(r.encode(e))}function d(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function u(e){return e>=48&&e<=57?e-48:(223&e)-55}function E(e){const t={position:0},A=h("/",e=C(e,!0,!0),t);if(0===A.length||!n.test(A))return"failure";if(t.position>=e.length)return"failure";t.position++;let s=h(";",e,t);if(s=C(s,!1,!0),0===s.length||!n.test(s))return"failure";const r=A.toLowerCase(),o=s.toLowerCase(),c={type:r,subtype:o,parameters:new Map,essence:`${r}/${o}`};for(;t.position<e.length;){t.position++,l((e=>i.test(e)),e,t);let A=l((e=>";"!==e&&"="!==e),e,t);if(A=A.toLowerCase(),t.position<e.length){if(";"===e[t.position])continue;t.position++}if(t.position>=e.length)break;let s=null;if('"'===e[t.position])s=I(e,t,!0),h(";",e,t);else if(s=h(";",e,t),s=C(s,!1,!0),0===s.length)continue;0===A.length||!n.test(A)||0!==s.length&&!a.test(s)||c.parameters.has(A)||c.parameters.set(A,s)}return c}function I(e,t,A=!1){const r=t.position;let n="";for(s('"'===e[t.position]),t.position++;n+=l((e=>'"'!==e&&"\\"!==e),e,t),!(t.position>=e.length);){const A=e[t.position];if(t.position++,"\\"!==A){s('"'===A);break}if(t.position>=e.length){n+="\\";break}n+=e[t.position],t.position++}return A?n:e.slice(r,t.position)}function Q(e){return 13===e||10===e||9===e||32===e}function C(e,t=!0,A=!0){return p(e,t,A,Q)}function B(e){return 13===e||10===e||9===e||12===e||32===e}function p(e,t,A,s){let r=0,n=e.length-1;if(t)for(;r<e.length&&s(e.charCodeAt(r));)r++;if(A)for(;n>0&&s(e.charCodeAt(n));)n--;return 0===r&&n===e.length-1?e:e.slice(r,n+1)}function f(e){const t=e.length;if(65535>t)return String.fromCharCode.apply(null,e);let A="",s=0,r=65535;for(;s<t;)s+r>t&&(r=t-s),A+=String.fromCharCode.apply(null,e.subarray(s,s+=r));return A}e.exports={dataURLProcessor:function(e){s("data:"===e.protocol);let t=c(e,!0);t=t.slice(5);const A={position:0};let r=h(",",t,A);const n=r.length;if(r=function(e,t=!0,A=!0){return p(e,t,A,B)}(r,!0,!0),A.position>=t.length)return"failure";A.position++;let i=g(t.slice(n+1));if(/;(\u0020){0,}base64$/i.test(r)){if(i=function(e){let t=(e=e.replace(o,"")).length;t%4==0&&61===e.charCodeAt(t-1)&&(--t,61===e.charCodeAt(t-1)&&--t);if(t%4==1)return"failure";if(/[^+/0-9A-Za-z]/.test(e.length===t?e:e.substring(0,t)))return"failure";const A=Buffer.from(e,"base64");return new Uint8Array(A.buffer,A.byteOffset,A.byteLength)}(f(i)),"failure"===i)return"failure";r=r.slice(0,-6),r=r.replace(/(\u0020)+$/,""),r=r.slice(0,-1)}r.startsWith(";")&&(r="text/plain"+r);let a=E(r);return"failure"===a&&(a=E("text/plain;charset=US-ASCII")),{mimeType:a,body:i}},URLSerializer:c,collectASequenceOfCodePoints:l,collectASequenceOfCodePointsFast:h,stringPercentDecode:g,parseMIMEType:E,collectAnHTTPQuotedString:I,serializeAMimeType:function(e){s("failure"!==e);const{parameters:t,essence:A}=e;let r=A;for(let[e,A]of t.entries())r+=";",r+=e,r+="=",n.test(A)||(A=A.replace(/(\\|")/g,"\\$1"),A='"'+A,A+='"'),r+=A;return r},removeChars:p,removeHTTPWhitespace:C,minimizeSupportedMimeType:function(e){switch(e.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return e.subtype.endsWith("+json")?"application/json":e.subtype.endsWith("+xml")?"application/xml":""},HTTP_TOKEN_CODEPOINTS:n,isomorphicDecode:f}},4614:(e,t,A)=>{"use strict";const{bufferToLowerCasedHeaderName:s}=A(2858),{utf8DecodeBytes:r}=A(6686),{HTTP_TOKEN_CODEPOINTS:n,isomorphicDecode:i}=A(9934),{makeEntry:o}=A(3944),{webidl:a}=A(6097),c=A(4589),l=Buffer.from('form-data; name="'),h=Buffer.from("filename"),g=Buffer.from("--"),d=Buffer.from("--\r\n");function u(e){for(let t=0;t<e.length;++t)if(-128&e.charCodeAt(t))return!1;return!0}function E(e,t){let A=null,r=null,o=null,a=null;for(;;){if(13===e[t.position]&&10===e[t.position+1]){if(null===A)throw p("header name is null");return{name:A,filename:r,contentType:o,encoding:a}}let c=Q((e=>10!==e&&13!==e&&58!==e),e,t);if(c=C(c,!0,!0,(e=>9===e||32===e)),!n.test(c.toString()))throw p("header name does not match the field-name token production");if(58!==e[t.position])throw p("expected :");switch(t.position++,Q((e=>32===e||9===e),e,t),s(c)){case"content-disposition":if(A=r=null,!B(e,l,t))throw p('expected form-data; name=" for content-disposition header');if(t.position+=17,A=I(e,t),59===e[t.position]&&32===e[t.position+1]){const A={position:t.position+2};if(B(e,h,A))if(42===e[A.position+8]){A.position+=10,Q((e=>32===e||9===e),e,A);const s=Q((e=>32!==e&&13!==e&&10!==e),e,A);if(117!==s[0]&&85!==s[0]||116!==s[1]&&84!==s[1]||102!==s[2]&&70!==s[2]||45!==s[3]||56!==s[4])throw p("unknown encoding, expected utf-8''");r=decodeURIComponent((new TextDecoder).decode(s.subarray(7))),t.position=A.position}else t.position+=11,Q((e=>32===e||9===e),e,t),t.position++,r=I(e,t)}break;case"content-type":{let A=Q((e=>10!==e&&13!==e),e,t);A=C(A,!1,!0,(e=>9===e||32===e)),o=i(A);break}case"content-transfer-encoding":{let A=Q((e=>10!==e&&13!==e),e,t);A=C(A,!1,!0,(e=>9===e||32===e)),a=i(A);break}default:Q((e=>10!==e&&13!==e),e,t)}if(13!==e[t.position]&&10!==e[t.position+1])throw p("expected CRLF");t.position+=2}}function I(e,t){c(34===e[t.position-1]);let A=Q((e=>10!==e&&13!==e&&34!==e),e,t);if(34!==e[t.position])throw p('expected "');return t.position++,A=(new TextDecoder).decode(A).replace(/%0A/gi,"\n").replace(/%0D/gi,"\r").replace(/%22/g,'"'),A}function Q(e,t,A){let s=A.position;for(;s<t.length&&e(t[s]);)++s;return t.subarray(A.position,A.position=s)}function C(e,t,A,s){let r=0,n=e.length-1;if(t)for(;r<e.length&&s(e[r]);)r++;if(A)for(;n>0&&s(e[n]);)n--;return 0===r&&n===e.length-1?e:e.subarray(r,n+1)}function B(e,t,A){if(e.length<t.length)return!1;for(let s=0;s<t.length;s++)if(t[s]!==e[A.position+s])return!1;return!0}function p(e){return new TypeError("Failed to parse body as FormData.",{cause:new TypeError(e)})}e.exports={multipartFormDataParser:function(e,t){c("failure"!==t&&"multipart/form-data"===t.essence);const A=t.parameters.get("boundary");if(void 0===A)throw p("missing boundary in content-type header");const s=Buffer.from(`--${A}`,"utf8"),n=[],i={position:0};for(;13===e[i.position]&&10===e[i.position+1];)i.position+=2;let l=e.length;for(;10===e[l-1]&&13===e[l-2];)l-=2;for(l!==e.length&&(e=e.subarray(0,l));;){if(!e.subarray(i.position,i.position+s.length).equals(s))throw p("expected a value starting with -- and the boundary");if(i.position+=s.length,i.position===e.length-2&&B(e,g,i)||i.position===e.length-4&&B(e,d,i))return n;if(13!==e[i.position]||10!==e[i.position+1])throw p("expected CRLF");i.position+=2;const t=E(e,i);let A,l,{name:h,filename:I,contentType:Q,encoding:C}=t;i.position+=2;{const t=e.indexOf(s.subarray(2),i.position);if(-1===t)throw p("expected boundary after body");A=e.subarray(i.position,t-4),i.position+=A.length,"base64"===C&&(A=Buffer.from(A.toString(),"base64"))}if(13!==e[i.position]||10!==e[i.position+1])throw p("expected CRLF");i.position+=2,null!==I?(Q??="text/plain",u(Q)||(Q=""),l=new File([A],I,{type:Q})):l=r(Buffer.from(A)),c(a.is.USVString(h)),c("string"==typeof l&&a.is.USVString(l)||a.is.File(l)),n.push(o(h,l,I))}},validateBoundary:function(e){const t=e.length;if(t<27||t>70)return!1;for(let A=0;A<t;++A){const t=e.charCodeAt(A);if(!(t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||39===t||45===t||95===t))return!1}return!0}}},3944:(e,t,A)=>{"use strict";const{iteratorMixin:s}=A(6686),{kEnumerableProperty:r}=A(2858),{webidl:n}=A(6097),i=A(7975);class o{#le=[];constructor(e=void 0){if(n.util.markAsUncloneable(this),void 0!==e)throw n.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(e,t,A=void 0){n.brandCheck(this,o);const s="FormData.append";n.argumentLengthCheck(arguments,2,s),e=n.converters.USVString(e),3===arguments.length||n.is.Blob(t)?(t=n.converters.Blob(t,s,"value"),void 0!==A&&(A=n.converters.USVString(A))):t=n.converters.USVString(t);const r=l(e,t,A);this.#le.push(r)}delete(e){n.brandCheck(this,o);n.argumentLengthCheck(arguments,1,"FormData.delete"),e=n.converters.USVString(e),this.#le=this.#le.filter((t=>t.name!==e))}get(e){n.brandCheck(this,o);n.argumentLengthCheck(arguments,1,"FormData.get"),e=n.converters.USVString(e);const t=this.#le.findIndex((t=>t.name===e));return-1===t?null:this.#le[t].value}getAll(e){n.brandCheck(this,o);return n.argumentLengthCheck(arguments,1,"FormData.getAll"),e=n.converters.USVString(e),this.#le.filter((t=>t.name===e)).map((e=>e.value))}has(e){n.brandCheck(this,o);return n.argumentLengthCheck(arguments,1,"FormData.has"),e=n.converters.USVString(e),-1!==this.#le.findIndex((t=>t.name===e))}set(e,t,A=void 0){n.brandCheck(this,o);const s="FormData.set";n.argumentLengthCheck(arguments,2,s),e=n.converters.USVString(e),3===arguments.length||n.is.Blob(t)?(t=n.converters.Blob(t,s,"value"),void 0!==A&&(A=n.converters.USVString(A))):t=n.converters.USVString(t);const r=l(e,t,A),i=this.#le.findIndex((t=>t.name===e));-1!==i?this.#le=[...this.#le.slice(0,i),r,...this.#le.slice(i+1).filter((t=>t.name!==e))]:this.#le.push(r)}[i.inspect.custom](e,t){const A=this.#le.reduce(((e,t)=>(e[t.name]?Array.isArray(e[t.name])?e[t.name].push(t.value):e[t.name]=[e[t.name],t.value]:e[t.name]=t.value,e)),{__proto__:null});t.depth??=e,t.colors??=!0;const s=i.formatWithOptions(t,A);return`FormData ${s.slice(s.indexOf("]")+2)}`}static getFormDataState(e){return e.#le}static setFormDataState(e,t){e.#le=t}}const{getFormDataState:a,setFormDataState:c}=o;function l(e,t,A){if("string"==typeof t);else if(n.is.File(t)||(t=new File([t],"blob",{type:t.type})),void 0!==A){const e={type:t.type,lastModified:t.lastModified};t=new File([t],A,e)}return{name:e,value:t}}Reflect.deleteProperty(o,"getFormDataState"),Reflect.deleteProperty(o,"setFormDataState"),s("FormData",o,a,"name","value"),Object.defineProperties(o.prototype,{append:r,delete:r,get:r,getAll:r,has:r,set:r,[Symbol.toStringTag]:{value:"FormData",configurable:!0}}),n.is.FormData=n.util.MakeTypeAssertion(o),e.exports={FormData:o,makeEntry:l,setFormDataState:c}},2837:e=>{"use strict";const t=Symbol.for("undici.globalOrigin.1");e.exports={getGlobalOrigin:function(){return globalThis[t]},setGlobalOrigin:function(e){if(void 0===e)return void Object.defineProperty(globalThis,t,{value:void 0,writable:!0,enumerable:!1,configurable:!1});const A=new URL(e);if("http:"!==A.protocol&&"https:"!==A.protocol)throw new TypeError(`Only http & https urls are allowed, received ${A.protocol}`);Object.defineProperty(globalThis,t,{value:A,writable:!0,enumerable:!1,configurable:!1})}}},6558:(e,t,A)=>{"use strict";const{kConstruct:s}=A(257),{kEnumerableProperty:r}=A(2858),{iteratorMixin:n,isValidHeaderName:i,isValidHeaderValue:o}=A(6686),{webidl:a}=A(6097),c=A(4589),l=A(7975);function h(e){return 10===e||13===e||9===e||32===e}function g(e){let t=0,A=e.length;for(;A>t&&h(e.charCodeAt(A-1));)--A;for(;A>t&&h(e.charCodeAt(t));)++t;return 0===t&&A===e.length?e:e.substring(t,A)}function d(e,t){if(Array.isArray(t))for(let A=0;A<t.length;++A){const s=t[A];if(2!==s.length)throw a.errors.exception({header:"Headers constructor",message:`expected name/value pair to be length 2, found ${s.length}.`});u(e,s[0],s[1])}else{if("object"!=typeof t||null===t)throw a.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]});{const A=Object.keys(t);for(let s=0;s<A.length;++s)u(e,A[s],t[A[s]])}}}function u(e,t,A){if(A=g(A),!i(t))throw a.errors.invalidArgument({prefix:"Headers.append",value:t,type:"header name"});if(!o(A))throw a.errors.invalidArgument({prefix:"Headers.append",value:A,type:"header value"});if("immutable"===C(e))throw new TypeError("immutable");return p(e).append(t,A,!1)}function E(e,t){return e[0]<t[0]?-1:1}class I{cookies=null;sortedMap;headersMap;constructor(e){e instanceof I?(this.headersMap=new Map(e.headersMap),this.sortedMap=e.sortedMap,this.cookies=null===e.cookies?null:[...e.cookies]):(this.headersMap=new Map(e),this.sortedMap=null)}contains(e,t){return this.headersMap.has(t?e:e.toLowerCase())}clear(){this.headersMap.clear(),this.sortedMap=null,this.cookies=null}append(e,t,A){this.sortedMap=null;const s=A?e:e.toLowerCase(),r=this.headersMap.get(s);if(r){const e="cookie"===s?"; ":", ";this.headersMap.set(s,{name:r.name,value:`${r.value}${e}${t}`})}else this.headersMap.set(s,{name:e,value:t});"set-cookie"===s&&(this.cookies??=[]).push(t)}set(e,t,A){this.sortedMap=null;const s=A?e:e.toLowerCase();"set-cookie"===s&&(this.cookies=[t]),this.headersMap.set(s,{name:e,value:t})}delete(e,t){this.sortedMap=null,t||(e=e.toLowerCase()),"set-cookie"===e&&(this.cookies=null),this.headersMap.delete(e)}get(e,t){return this.headersMap.get(t?e:e.toLowerCase())?.value??null}*[Symbol.iterator](){for(const{0:e,1:{value:t}}of this.headersMap)yield[e,t]}get entries(){const e={};if(0!==this.headersMap.size)for(const{name:t,value:A}of this.headersMap.values())e[t]=A;return e}rawValues(){return this.headersMap.values()}get entriesList(){const e=[];if(0!==this.headersMap.size)for(const{0:t,1:{name:A,value:s}}of this.headersMap)if("set-cookie"===t)for(const t of this.cookies)e.push([A,t]);else e.push([A,s]);return e}toSortedArray(){const e=this.headersMap.size,t=new Array(e);if(e<=32){if(0===e)return t;const A=this.headersMap[Symbol.iterator](),s=A.next().value;t[0]=[s[0],s[1].value],c(null!==s[1].value);for(let s,r,n=1,i=0,o=0,a=0,l=0;n<e;++n){for(r=A.next().value,s=t[n]=[r[0],r[1].value],c(null!==s[1]),a=0,o=n;a<o;)l=a+(o-a>>1),t[l][0]<=s[0]?a=l+1:o=l;if(n!==l){for(i=n;i>a;)t[i]=t[--i];t[a]=s}}if(!A.next().done)throw new TypeError("Unreachable");return t}{let e=0;for(const{0:A,1:{value:s}}of this.headersMap)t[e++]=[A,s],c(null!==s);return t.sort(E)}}}class Q{#ze;#Ze;constructor(e=void 0){a.util.markAsUncloneable(this),e!==s&&(this.#Ze=new I,this.#ze="none",void 0!==e&&d(this,e=a.converters.HeadersInit(e,"Headers constructor","init")))}append(e,t){a.brandCheck(this,Q),a.argumentLengthCheck(arguments,2,"Headers.append");const A="Headers.append";return u(this,e=a.converters.ByteString(e,A,"name"),t=a.converters.ByteString(t,A,"value"))}delete(e){a.brandCheck(this,Q),a.argumentLengthCheck(arguments,1,"Headers.delete");if(e=a.converters.ByteString(e,"Headers.delete","name"),!i(e))throw a.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if("immutable"===this.#ze)throw new TypeError("immutable");this.#Ze.contains(e,!1)&&this.#Ze.delete(e,!1)}get(e){a.brandCheck(this,Q),a.argumentLengthCheck(arguments,1,"Headers.get");const t="Headers.get";if(e=a.converters.ByteString(e,t,"name"),!i(e))throw a.errors.invalidArgument({prefix:t,value:e,type:"header name"});return this.#Ze.get(e,!1)}has(e){a.brandCheck(this,Q),a.argumentLengthCheck(arguments,1,"Headers.has");const t="Headers.has";if(e=a.converters.ByteString(e,t,"name"),!i(e))throw a.errors.invalidArgument({prefix:t,value:e,type:"header name"});return this.#Ze.contains(e,!1)}set(e,t){a.brandCheck(this,Q),a.argumentLengthCheck(arguments,2,"Headers.set");const A="Headers.set";if(e=a.converters.ByteString(e,A,"name"),t=g(t=a.converters.ByteString(t,A,"value")),!i(e))throw a.errors.invalidArgument({prefix:A,value:e,type:"header name"});if(!o(t))throw a.errors.invalidArgument({prefix:A,value:t,type:"header value"});if("immutable"===this.#ze)throw new TypeError("immutable");this.#Ze.set(e,t,!1)}getSetCookie(){a.brandCheck(this,Q);const e=this.#Ze.cookies;return e?[...e]:[]}[l.inspect.custom](e,t){return t.depth??=e,`Headers ${l.formatWithOptions(t,this.#Ze.entries)}`}static getHeadersGuard(e){return e.#ze}static setHeadersGuard(e,t){e.#ze=t}static getHeadersList(e){return e.#Ze}static setHeadersList(e,t){e.#Ze=t}}const{getHeadersGuard:C,setHeadersGuard:B,getHeadersList:p,setHeadersList:f}=Q;Reflect.deleteProperty(Q,"getHeadersGuard"),Reflect.deleteProperty(Q,"setHeadersGuard"),Reflect.deleteProperty(Q,"getHeadersList"),Reflect.deleteProperty(Q,"setHeadersList"),n("Headers",Q,(function(e){const t=p(e);if(!t)return[];if(t.sortedMap)return t.sortedMap;const A=[],s=t.toSortedArray(),r=t.cookies;if(null===r||1===r.length)return t.sortedMap=s;for(let e=0;e<s.length;++e){const{0:t,1:n}=s[e];if("set-cookie"===t)for(let e=0;e<r.length;++e)A.push([t,r[e]]);else A.push([t,n])}return t.sortedMap=A}),0,1),Object.defineProperties(Q.prototype,{append:r,delete:r,get:r,has:r,set:r,getSetCookie:r,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[l.inspect.custom]:{enumerable:!1}}),a.converters.HeadersInit=function(e,t,A){if(a.util.Type(e)===a.util.Types.OBJECT){const s=Reflect.get(e,Symbol.iterator);if(!l.types.isProxy(e)&&s===Q.prototype.entries)try{return p(e).entriesList}catch{}return"function"==typeof s?a.converters["sequence<sequence<ByteString>>"](e,t,A,s.bind(e)):a.converters["record<ByteString, ByteString>"](e,t,A)}throw a.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})},e.exports={fill:d,compareHeaderName:E,Headers:Q,HeadersList:I,getHeadersGuard:C,setHeadersGuard:B,setHeadersList:f,getHeadersList:p}},7388:(e,t,A)=>{"use strict";const{makeNetworkError:s,makeAppropriateNetworkError:r,filterResponse:n,makeResponse:i,fromInnerResponse:o,getResponseState:a}=A(4821),{HeadersList:c}=A(6558),{Request:l,cloneRequest:h,getRequestDispatcher:g,getRequestState:d}=A(4609),u=A(8522),{makePolicyContainer:E,clonePolicyContainer:I,requestBadPort:Q,TAOCheck:C,appendRequestOriginHeader:B,responseLocationURL:p,requestCurrentURL:f,setRequestReferrerPolicyOnRedirect:m,tryUpgradeRequestToAPotentiallyTrustworthyURL:y,createOpaqueTimingInfo:S,appendFetchMetadata:D,corsCheck:w,crossOriginResourcePolicyCheck:b,determineRequestsReferrer:R,coarsenedSharedCurrentTime:N,sameOrigin:k,isCancelled:T,isAborted:F,isErrorLike:v,fullyReadBody:M,readableStreamClose:U,isomorphicEncode:L,urlIsLocal:H,urlIsHttpHttpsScheme:x,urlHasHttpsScheme:Y,clampAndCoarsenConnectionTimingInfo:P,simpleRangeHeaderValue:V,buildContentRange:O,createInflate:G,extractMimeType:J}=A(6686),W=A(4589),{safelyExtractBody:_,extractBody:q}=A(2530),{redirectStatusSet:$,nullBodyStatus:X,safeMethodsSet:z,requestBodyHeader:Z,subresourceSet:j}=A(9441),K=A(8474),{Readable:ee,pipeline:te,finished:Ae,isErrored:se,isReadable:re}=A(7075),{addAbortListener:ne,bufferToLowerCasedHeaderName:ie}=A(2858),{dataURLProcessor:oe,serializeAMimeType:ae,minimizeSupportedMimeType:ce}=A(9934),{getGlobalDispatcher:le}=A(9879),{webidl:he}=A(6097),{STATUS_CODES:ge}=A(7067),{bytesMatch:de}=A(7420),{createDeferredPromise:ue}=A(9250),Ee="function"==typeof u.createZstdDecompress,Ie=["GET","HEAD"],Qe="undefined"!=typeof __UNDICI_IS_NODE__||"undefined"!=typeof esbuildDetection?"node":"undici";let Ce;class Be extends K{constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){"ongoing"===this.state&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){"ongoing"===this.state&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}}function pe(e){fe(e,"fetch")}function fe(e,t="other"){if("error"===e.type&&e.aborted)return;if(!e.urlList?.length)return;const A=e.urlList[0];let s=e.timingInfo,r=e.cacheState;x(A)&&null!==s&&(e.timingAllowPassed||(s=S({startTime:s.startTime}),r=""),s.endTime=N(),e.timingInfo=s,me(s,A.href,t,globalThis,r,"",e.status))}const me=performance.markResourceTiming;function ye(e,t,A,s){if(e&&e.reject(s),null!=t.body?.stream&&re(t.body.stream)&&t.body.stream.cancel(s).catch((e=>{if("ERR_INVALID_STATE"!==e.code)throw e})),null==A)return;const r=a(A);null!=r.body?.stream&&re(r.body.stream)&&r.body.stream.cancel(s).catch((e=>{if("ERR_INVALID_STATE"!==e.code)throw e}))}function Se({request:e,processRequestBodyChunkLength:t,processRequestEndOfBody:A,processResponse:s,processResponseEndOfBody:r,processResponseConsumeBody:n,useParallelQueue:i=!1,dispatcher:o=le()}){W(o);let a=null,c=!1;null!=e.client&&(a=e.client.globalObject,c=e.client.crossOriginIsolatedCapability);const l=N(c),h=S({startTime:l}),g={controller:new Be(o),request:e,timingInfo:h,processRequestBodyChunkLength:t,processRequestEndOfBody:A,processResponse:s,processResponseConsumeBody:n,processResponseEndOfBody:r,taskDestination:a,crossOriginIsolatedCapability:c};if(W(!e.body||e.body.stream),"client"===e.window&&(e.window="Window"===e.client?.globalObject?.constructor?.name?e.client:"no-window"),"client"===e.origin&&(e.origin=e.client.origin),"client"===e.policyContainer&&(null!=e.client?e.policyContainer=I(e.client.policyContainer):e.policyContainer=E()),!e.headersList.contains("accept",!0)){const t="*/*";e.headersList.append("accept",t,!0)}return e.headersList.contains("accept-language",!0)||e.headersList.append("accept-language","*",!0),e.priority,j.has(e.destination),De(g,!1),g.controller}async function De(e,t){try{const A=e.request;let r=null;if(A.localURLsOnly&&!H(f(A))&&(r=s("local URLs only")),y(A),"blocked"===Q(A)&&(r=s("bad port")),""===A.referrerPolicy&&(A.referrerPolicy=A.policyContainer.referrerPolicy),"no-referrer"!==A.referrer&&(A.referrer=R(A)),null===r){const t=f(A);k(t,A.url)&&"basic"===A.responseTainting||"data:"===t.protocol||"navigate"===A.mode||"websocket"===A.mode?(A.responseTainting="basic",r=await we(e)):"same-origin"===A.mode?r=s('request mode cannot be "same-origin"'):"no-cors"===A.mode?"follow"!==A.redirect?r=s('redirect mode cannot be "follow" for "no-cors" request'):(A.responseTainting="opaque",r=await we(e)):x(f(A))?(A.responseTainting="cors",r=await Ne(e)):r=s("URL scheme must be a HTTP(S) scheme")}if(t)return r;0===r.status||r.internalResponse||(A.responseTainting,"basic"===A.responseTainting?r=n(r,"basic"):"cors"===A.responseTainting?r=n(r,"cors"):"opaque"===A.responseTainting?r=n(r,"opaque"):W(!1));let i=0===r.status?r:r.internalResponse;if(0===i.urlList.length&&i.urlList.push(...A.urlList),A.timingAllowFailed||(r.timingAllowPassed=!0),"opaque"===r.type&&206===i.status&&i.rangeRequested&&!A.headers.contains("range",!0)&&(r=i=s()),0===r.status||"HEAD"!==A.method&&"CONNECT"!==A.method&&!X.includes(i.status)||(i.body=null,e.controller.dump=!0),A.integrity){const t=t=>Re(e,s(t));if("opaque"===A.responseTainting||null==r.body)return void t(r.error);const n=s=>{de(s,A.integrity)?(r.body=_(s)[0],Re(e,r)):t("integrity mismatch")};M(r.body,n,t)}else Re(e,r)}catch(t){e.controller.terminate(t)}}function we(e){if(T(e)&&0===e.request.redirectCount)return Promise.resolve(r(e));const{request:t}=e,{protocol:n}=f(t);switch(n){case"about:":return Promise.resolve(s("about scheme is not supported"));case"blob:":{Ce||(Ce=A(4573).resolveObjectURL);const e=f(t);if(0!==e.search.length)return Promise.resolve(s("NetworkError when attempting to fetch resource."));const r=Ce(e.toString());if("GET"!==t.method||!he.is.Blob(r))return Promise.resolve(s("invalid method"));const n=i(),o=r.size,a=L(`${o}`),c=r.type;if(t.headersList.contains("range",!0)){n.rangeRequested=!0;const e=t.headersList.get("range",!0),A=V(e,!0);if("failure"===A)return Promise.resolve(s("failed to fetch the data URL"));let{rangeStartValue:i,rangeEndValue:a}=A;if(null===i)i=o-a,a=i+a-1;else{if(i>=o)return Promise.resolve(s("Range start is greater than the blob's size."));(null===a||a>=o)&&(a=o-1)}const l=r.slice(i,a,c),h=q(l);n.body=h[0];const g=L(`${l.size}`),d=O(i,a,o);n.status=206,n.statusText="Partial Content",n.headersList.set("content-length",g,!0),n.headersList.set("content-type",c,!0),n.headersList.set("content-range",d,!0)}else{const e=q(r);n.statusText="OK",n.body=e[0],n.headersList.set("content-length",a,!0),n.headersList.set("content-type",c,!0)}return Promise.resolve(n)}case"data:":{const e=f(t),A=oe(e);if("failure"===A)return Promise.resolve(s("failed to fetch the data URL"));const r=ae(A.mimeType);return Promise.resolve(i({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:r}]],body:_(A.body)[0]}))}case"file:":return Promise.resolve(s("not implemented... yet..."));case"http:":case"https:":return Ne(e).catch((e=>s(e)));default:return Promise.resolve(s("unknown scheme"))}}function be(e,t){e.request.done=!0,null!=e.processResponseDone&&queueMicrotask((()=>e.processResponseDone(t)))}function Re(e,t){let A=e.timingInfo;const s=()=>{const s=Date.now();"document"===e.request.destination&&(e.controller.fullTimingInfo=A),e.controller.reportTimingSteps=()=>{if(!x(e.request.url))return;A.endTime=s;let r=t.cacheState;const n=t.bodyInfo;t.timingAllowPassed||(A=S(A),r="");let i=0;if("navigator"!==e.request.mode||!t.hasCrossOriginRedirects){i=t.status;const e=J(t.headersList);"failure"!==e&&(n.contentType=ce(e))}null!=e.request.initiatorType&&me(A,e.request.url.href,e.request.initiatorType,globalThis,r,n,i)};queueMicrotask((()=>(e.request.done=!0,null!=e.processResponseEndOfBody&&queueMicrotask((()=>e.processResponseEndOfBody(t))),void(null!=e.request.initiatorType&&e.controller.reportTimingSteps()))))};null!=e.processResponse&&queueMicrotask((()=>{e.processResponse(t),e.processResponse=null}));const r="error"===t.type?t:t.internalResponse??t;null==r.body?s():Ae(r.body.stream,(()=>{s()}))}async function Ne(e){const t=e.request;let A=null,r=null;const n=e.timingInfo;if(t.serviceWorkers,null===A){if("follow"===t.redirect&&(t.serviceWorkers="none"),r=A=await ke(e),"cors"===t.responseTainting&&"failure"===w(t,A))return s("cors failure");"failure"===C(t,A)&&(t.timingAllowFailed=!0)}return"opaque"!==t.responseTainting&&"opaque"!==A.type||"blocked"!==b(t.origin,t.client,t.destination,r)?($.has(r.status)&&("manual"!==t.redirect&&e.controller.connection.destroy(void 0,!1),"error"===t.redirect?A=s("unexpected redirect"):"manual"===t.redirect?A=r:"follow"===t.redirect?A=await function(e,t){const A=e.request,r=t.internalResponse?t.internalResponse:t;let n;try{if(n=p(r,f(A).hash),null==n)return t}catch(e){return Promise.resolve(s(e))}if(!x(n))return Promise.resolve(s("URL scheme must be a HTTP(S) scheme"));if(20===A.redirectCount)return Promise.resolve(s("redirect count exceeded"));if(A.redirectCount+=1,"cors"===A.mode&&(n.username||n.password)&&!k(A,n))return Promise.resolve(s('cross origin not allowed for request mode "cors"'));if("cors"===A.responseTainting&&(n.username||n.password))return Promise.resolve(s('URL cannot contain credentials for request mode "cors"'));if(303!==r.status&&null!=A.body&&null==A.body.source)return Promise.resolve(s());if([301,302].includes(r.status)&&"POST"===A.method||303===r.status&&!Ie.includes(A.method)){A.method="GET",A.body=null;for(const e of Z)A.headersList.delete(e)}k(f(A),n)||(A.headersList.delete("authorization",!0),A.headersList.delete("proxy-authorization",!0),A.headersList.delete("cookie",!0),A.headersList.delete("host",!0));null!=A.body&&(W(null!=A.body.source),A.body=_(A.body.source)[0]);const i=e.timingInfo;i.redirectEndTime=i.postRedirectStartTime=N(e.crossOriginIsolatedCapability),0===i.redirectStartTime&&(i.redirectStartTime=i.startTime);return A.urlList.push(n),m(A,r),De(e,!0)}(e,A):W(!1)),A.timingInfo=n,A):s("blocked")}async function ke(e,t=!1,A=!1){const n=e.request;let o=null,a=null,l=null;"no-window"===n.window&&"error"===n.redirect?(o=e,a=n):(a=h(n),o={...e},o.request=a);const g="include"===n.credentials||"same-origin"===n.credentials&&"basic"===n.responseTainting,d=a.body?a.body.length:null;let E=null;if(null==a.body&&["POST","PUT"].includes(a.method)&&(E="0"),null!=d&&(E=L(`${d}`)),null!=E&&a.headersList.append("content-length",E,!0),null!=d&&a.keepalive,he.is.URL(a.referrer)&&a.headersList.append("referer",L(a.referrer.href),!0),B(a),D(a),a.headersList.contains("user-agent",!0)||a.headersList.append("user-agent",Qe,!0),"default"===a.cache&&(a.headersList.contains("if-modified-since",!0)||a.headersList.contains("if-none-match",!0)||a.headersList.contains("if-unmodified-since",!0)||a.headersList.contains("if-match",!0)||a.headersList.contains("if-range",!0))&&(a.cache="no-store"),"no-cache"!==a.cache||a.preventNoCacheCacheControlHeaderModification||a.headersList.contains("cache-control",!0)||a.headersList.append("cache-control","max-age=0",!0),"no-store"!==a.cache&&"reload"!==a.cache||(a.headersList.contains("pragma",!0)||a.headersList.append("pragma","no-cache",!0),a.headersList.contains("cache-control",!0)||a.headersList.append("cache-control","no-cache",!0)),a.headersList.contains("range",!0)&&a.headersList.append("accept-encoding","identity",!0),a.headersList.contains("accept-encoding",!0)||(Y(f(a))?a.headersList.append("accept-encoding","br, gzip, deflate",!0):a.headersList.append("accept-encoding","gzip, deflate",!0)),a.headersList.delete("host",!0),a.cache="no-store","no-store"!==a.cache&&a.cache,null==l){if("only-if-cached"===a.cache)return s("only if cached");const e=await async function(e){W(!e.controller.connection||e.controller.connection.destroyed),e.controller.connection={abort:null,destroyed:!1,destroy(e,t=!0){this.destroyed||(this.destroyed=!0,t&&this.abort?.(e??new DOMException("The operation was aborted.","AbortError")))}};const t=e.request;let A=null;const n=e.timingInfo,o=null;null==o&&(t.cache="no-store");t.mode;let a=null;if(null==t.body&&e.processRequestEndOfBody)queueMicrotask((()=>e.processRequestEndOfBody()));else if(null!=t.body){const A=async function*(t){T(e)||(yield t,e.processRequestBodyChunkLength?.(t.byteLength))},s=()=>{T(e)||e.processRequestEndOfBody&&e.processRequestEndOfBody()},r=t=>{T(e)||("AbortError"===t.name?e.controller.abort():e.controller.terminate(t))};a=async function*(){try{for await(const e of t.body.stream)yield*A(e);s()}catch(e){r(e)}}()}try{const{body:t,status:s,statusText:r,headersList:n,socket:o}=await E({body:a});if(o)A=i({status:s,statusText:r,headersList:n,socket:o});else{const o=t[Symbol.asyncIterator]();e.controller.next=()=>o.next(),A=i({status:s,statusText:r,headersList:n})}}catch(t){return"AbortError"===t.name?(e.controller.connection.destroy(),r(e,t)):s(t)}const l=()=>e.controller.resume(),h=t=>{T(e)||e.controller.abort(t)},g=new ReadableStream({start(t){e.controller.controller=t},pull:l,cancel:h,type:"bytes"});A.body={stream:g,source:null,length:null},e.controller.resume||e.controller.on("terminated",d);function d(t){F(e)?(A.aborted=!0,re(g)&&e.controller.controller.error(e.controller.serializedAbortReason)):re(g)&&e.controller.controller.error(new TypeError("terminated",{cause:v(t)?t:void 0})),e.controller.connection.destroy()}return e.controller.resume=async()=>{for(;;){let t,s;try{const{done:A,value:s}=await e.controller.next();if(F(e))break;t=A?void 0:s}catch(A){e.controller.ended&&!n.encodedBodySize?t=void 0:(t=A,s=!0)}if(void 0===t)return U(e.controller.controller),void be(e,A);if(n.decodedBodySize+=t?.byteLength??0,s)return void e.controller.terminate(t);const r=new Uint8Array(t);if(r.byteLength&&e.controller.controller.enqueue(r),se(g))return void e.controller.terminate();if(e.controller.controller.desiredSize<=0)return}},A;function E({body:A}){const s=f(t),r=e.controller.dispatcher;return new Promise(((i,o)=>r.dispatch({path:s.pathname+s.search,origin:s.origin,method:t.method,body:r.isMockActive?t.body&&(t.body.source||t.body.stream):A,headers:t.headersList.entries,maxRedirections:0,upgrade:"websocket"===t.mode?"websocket":void 0},{body:null,abort:null,onConnect(t){const{connection:A}=e.controller;n.finalConnectionTimingInfo=P(void 0,n.postRedirectStartTime,e.crossOriginIsolatedCapability),A.destroyed?t(new DOMException("The operation was aborted.","AbortError")):(e.controller.on("terminated",t),this.abort=A.abort=t),n.finalNetworkRequestStartTime=N(e.crossOriginIsolatedCapability)},onResponseStarted(){n.finalNetworkResponseStartTime=N(e.crossOriginIsolatedCapability)},onHeaders(e,A,s,r){if(e<200)return!1;const n=new c;for(let e=0;e<A.length;e+=2)n.append(ie(A[e]),A[e+1].toString("latin1"),!0);const o=n.get("location",!0);this.body=new ee({read:s});const a=o&&"follow"===t.redirect&&$.has(e),l=[];if("HEAD"!==t.method&&"CONNECT"!==t.method&&!X.includes(e)&&!a){const e=n.get("content-encoding",!0),t=e?e.toLowerCase().split(","):[];for(let e=t.length-1;e>=0;--e){const A=t[e].trim();if("x-gzip"===A||"gzip"===A)l.push(u.createGunzip({flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH}));else if("deflate"===A)l.push(G({flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH}));else if("br"===A)l.push(u.createBrotliDecompress({flush:u.constants.BROTLI_OPERATION_FLUSH,finishFlush:u.constants.BROTLI_OPERATION_FLUSH}));else{if("zstd"!==A||!Ee){l.length=0;break}l.push(u.createZstdDecompress({flush:u.constants.ZSTD_e_continue,finishFlush:u.constants.ZSTD_e_end}))}}}const h=this.onError.bind(this);return i({status:e,statusText:r,headersList:n,body:l.length?te(this.body,...l,(e=>{e&&this.onError(e)})).on("error",h):this.body.on("error",h)}),!0},onData(t){if(e.controller.dump)return;const A=t;return n.encodedBodySize+=A.byteLength,this.body.push(A)},onComplete(){this.abort&&e.controller.off("terminated",this.abort),e.controller.ended=!0,this.body.push(null)},onError(t){this.abort&&e.controller.off("terminated",this.abort),this.body?.destroy(t),e.controller.terminate(t),o(t)},onUpgrade(e,t,A){if(101!==e)return;const s=new c;for(let e=0;e<t.length;e+=2)s.append(ie(t[e]),t[e+1].toString("latin1"),!0);return i({status:e,statusText:ge[e],headersList:s,socket:A}),!0}})))}}(o,g,A);!z.has(a.method)&&e.status>=200&&e.status,null==l&&(l=e)}if(l.urlList=[...a.urlList],a.headersList.contains("range",!0)&&(l.rangeRequested=!0),l.requestIncludesCredentials=g,407===l.status)return"no-window"===n.window?s():T(e)?r(e):s("proxy authentication required");if(421===l.status&&!A&&(null==n.body||null!=n.body.source)){if(T(e))return r(e);e.controller.connection.destroy(),l=await ke(e,t,!0)}return l}e.exports={fetch:function(e,t=void 0){he.argumentLengthCheck(arguments,1,"globalThis.fetch");let A,s=ue();try{A=new l(e,t)}catch(e){return s.reject(e),s.promise}const r=d(A);if(A.signal.aborted)return ye(s,r,null,A.signal.reason),s.promise;const n=r.client.globalObject;"ServiceWorkerGlobalScope"===n?.constructor?.name&&(r.serviceWorkers="none");let i=null,a=!1,c=null;return ne(A.signal,(()=>{a=!0,W(null!=c),c.abort(A.signal.reason);const e=i?.deref();ye(s,r,e,A.signal.reason)})),c=Se({request:r,processResponseEndOfBody:pe,processResponse:e=>{a||(e.aborted?ye(s,r,i,c.serializedAbortReason):"error"!==e.type?(i=new WeakRef(o(e,"immutable")),s.resolve(i.deref()),s=null):s.reject(new TypeError("fetch failed",{cause:e.error})))},dispatcher:g(A)}),s.promise},Fetch:Be,fetching:Se,finalizeAndReportTiming:fe}},4609:(e,t,A)=>{"use strict";const{extractBody:s,mixinBody:r,cloneBody:n,bodyUnusable:i}=A(2530),{Headers:o,fill:a,HeadersList:c,setHeadersGuard:l,getHeadersGuard:h,setHeadersList:g,getHeadersList:d}=A(6558),u=A(2858),E=A(7975),{isValidHTTPToken:I,sameOrigin:Q,environmentSettingsObject:C}=A(6686),{forbiddenMethodsSet:B,corsSafeListedMethodsSet:p,referrerPolicy:f,requestRedirect:m,requestMode:y,requestCredentials:S,requestCache:D,requestDuplex:w}=A(9441),{kEnumerableProperty:b,normalizedMethodRecordsBase:R,normalizedMethodRecords:N}=u,{webidl:k}=A(6097),{URLSerializer:T}=A(9934),{kConstruct:F}=A(257),v=A(4589),{getMaxListeners:M,setMaxListeners:U,defaultMaxListeners:L}=A(8474),H=Symbol("abortController"),x=new FinalizationRegistry((({signal:e,abort:t})=>{e.removeEventListener("abort",t)})),Y=new WeakMap;let P;try{P=M((new AbortController).signal)>0}catch{P=!1}function V(e){return function t(){const A=e.deref();if(void 0!==A){x.unregister(t),this.removeEventListener("abort",t),A.abort(this.reason);const e=Y.get(A.signal);if(void 0!==e){if(0!==e.size){for(const t of e){const e=t.deref();void 0!==e&&e.abort(this.reason)}e.clear()}Y.delete(A.signal)}}}}let O=!1;class G{#je;#qe;#Be;#le;constructor(e,t=void 0){if(k.util.markAsUncloneable(this),e===F)return;k.argumentLengthCheck(arguments,1,"Request constructor"),e=k.converters.RequestInfo(e),t=k.converters.RequestInit(t);let A=null,r=null;const n=C.settingsObject.baseUrl;let h=null;if("string"==typeof e){let s;this.#qe=t.dispatcher;try{s=new URL(e,n)}catch(t){throw new TypeError("Failed to parse URL from "+e,{cause:t})}if(s.username||s.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);A=z({urlList:[s]}),r="cors"}else v(k.is.Request(e)),A=e.#le,h=e.#je,this.#qe=t.dispatcher||e.#qe;const E=C.settingsObject.origin;let f="client";if("EnvironmentSettingsObject"===A.window?.constructor?.name&&Q(A.window,E)&&(f=A.window),null!=t.window)throw new TypeError(`'window' option '${f}' must be null`);"window"in t&&(f="no-window"),A=z({method:A.method,headersList:A.headersList,unsafeRequest:A.unsafeRequest,client:C.settingsObject,window:f,priority:A.priority,origin:A.origin,referrer:A.referrer,referrerPolicy:A.referrerPolicy,mode:A.mode,credentials:A.credentials,cache:A.cache,redirect:A.redirect,integrity:A.integrity,keepalive:A.keepalive,reloadNavigation:A.reloadNavigation,historyNavigation:A.historyNavigation,urlList:[...A.urlList]});const m=0!==Object.keys(t).length;if(m&&("navigate"===A.mode&&(A.mode="same-origin"),A.reloadNavigation=!1,A.historyNavigation=!1,A.origin="client",A.referrer="client",A.referrerPolicy="",A.url=A.urlList[A.urlList.length-1],A.urlList=[A.url]),void 0!==t.referrer){const e=t.referrer;if(""===e)A.referrer="no-referrer";else{let t;try{t=new URL(e,n)}catch(t){throw new TypeError(`Referrer "${e}" is not a valid URL.`,{cause:t})}"about:"===t.protocol&&"client"===t.hostname||E&&!Q(t,C.settingsObject.baseUrl)?A.referrer="client":A.referrer=t}}let y;if(void 0!==t.referrerPolicy&&(A.referrerPolicy=t.referrerPolicy),y=void 0!==t.mode?t.mode:r,"navigate"===y)throw k.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(null!=y&&(A.mode=y),void 0!==t.credentials&&(A.credentials=t.credentials),void 0!==t.cache&&(A.cache=t.cache),"only-if-cached"===A.cache&&"same-origin"!==A.mode)throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(void 0!==t.redirect&&(A.redirect=t.redirect),null!=t.integrity&&(A.integrity=String(t.integrity)),void 0!==t.keepalive&&(A.keepalive=Boolean(t.keepalive)),void 0!==t.method){let e=t.method;const s=N[e];if(void 0!==s)A.method=s;else{if(!I(e))throw new TypeError(`'${e}' is not a valid HTTP method.`);const t=e.toUpperCase();if(B.has(t))throw new TypeError(`'${e}' HTTP method is unsupported.`);e=R[t]??e,A.method=e}O||"patch"!==A.method||(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),O=!0)}void 0!==t.signal&&(h=t.signal),this.#le=A;const S=new AbortController;if(this.#je=S.signal,null!=h)if(h.aborted)S.abort(h.reason);else{this[H]=S;const e=V(new WeakRef(S));P&&M(h)===L&&U(1500,h),u.addAbortListener(h,e),x.register(S,{signal:h,abort:e},e)}if(this.#Be=new o(F),g(this.#Be,A.headersList),l(this.#Be,"request"),"no-cors"===y){if(!p.has(A.method))throw new TypeError(`'${A.method} is unsupported in no-cors mode.`);l(this.#Be,"request-no-cors")}if(m){const e=d(this.#Be),A=void 0!==t.headers?t.headers:new c(e);if(e.clear(),A instanceof c){for(const{name:t,value:s}of A.rawValues())e.append(t,s,!1);e.cookies=A.cookies}else a(this.#Be,A)}const D=k.is.Request(e)?e.#le.body:null;if(!(null==t.body&&null==D||"GET"!==A.method&&"HEAD"!==A.method))throw new TypeError("Request with GET/HEAD method cannot have body.");let w=null;if(null!=t.body){const[e,r]=s(t.body,A.keepalive);w=e,r&&!d(this.#Be).contains("content-type",!0)&&this.#Be.append("content-type",r,!0)}const b=w??D;if(null!=b&&null==b.source){if(null!=w&&null==t.duplex)throw new TypeError("RequestInit: duplex option is required when sending a body.");if("same-origin"!==A.mode&&"cors"!==A.mode)throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');A.useCORSPreflightFlag=!0}let T=b;if(null==w&&null!=D){if(i(e.#le))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");const t=new TransformStream;D.stream.pipeThrough(t),T={source:D.source,length:D.length,stream:t.readable}}this.#le.body=T}get method(){return k.brandCheck(this,G),this.#le.method}get url(){return k.brandCheck(this,G),T(this.#le.url)}get headers(){return k.brandCheck(this,G),this.#Be}get destination(){return k.brandCheck(this,G),this.#le.destination}get referrer(){return k.brandCheck(this,G),"no-referrer"===this.#le.referrer?"":"client"===this.#le.referrer?"about:client":this.#le.referrer.toString()}get referrerPolicy(){return k.brandCheck(this,G),this.#le.referrerPolicy}get mode(){return k.brandCheck(this,G),this.#le.mode}get credentials(){return k.brandCheck(this,G),this.#le.credentials}get cache(){return k.brandCheck(this,G),this.#le.cache}get redirect(){return k.brandCheck(this,G),this.#le.redirect}get integrity(){return k.brandCheck(this,G),this.#le.integrity}get keepalive(){return k.brandCheck(this,G),this.#le.keepalive}get isReloadNavigation(){return k.brandCheck(this,G),this.#le.reloadNavigation}get isHistoryNavigation(){return k.brandCheck(this,G),this.#le.historyNavigation}get signal(){return k.brandCheck(this,G),this.#je}get body(){return k.brandCheck(this,G),this.#le.body?this.#le.body.stream:null}get bodyUsed(){return k.brandCheck(this,G),!!this.#le.body&&u.isDisturbed(this.#le.body.stream)}get duplex(){return k.brandCheck(this,G),"half"}clone(){if(k.brandCheck(this,G),i(this.#le))throw new TypeError("unusable");const e=Z(this.#le),t=new AbortController;if(this.signal.aborted)t.abort(this.signal.reason);else{let e=Y.get(this.signal);void 0===e&&(e=new Set,Y.set(this.signal,e));const A=new WeakRef(t);e.add(A),u.addAbortListener(t.signal,V(A))}return j(e,this.#qe,t.signal,h(this.#Be))}[E.inspect.custom](e,t){null===t.depth&&(t.depth=2),t.colors??=!0;const A={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${E.formatWithOptions(t,A)}`}static setRequestSignal(e,t){return e.#je=t,e}static getRequestDispatcher(e){return e.#qe}static setRequestDispatcher(e,t){e.#qe=t}static setRequestHeaders(e,t){e.#Be=t}static getRequestState(e){return e.#le}static setRequestState(e,t){e.#le=t}}const{setRequestSignal:J,getRequestDispatcher:W,setRequestDispatcher:_,setRequestHeaders:q,getRequestState:$,setRequestState:X}=G;function z(e){return{method:e.method??"GET",localURLsOnly:e.localURLsOnly??!1,unsafeRequest:e.unsafeRequest??!1,body:e.body??null,client:e.client??null,reservedClient:e.reservedClient??null,replacesClientId:e.replacesClientId??"",window:e.window??"client",keepalive:e.keepalive??!1,serviceWorkers:e.serviceWorkers??"all",initiator:e.initiator??"",destination:e.destination??"",priority:e.priority??null,origin:e.origin??"client",policyContainer:e.policyContainer??"client",referrer:e.referrer??"client",referrerPolicy:e.referrerPolicy??"",mode:e.mode??"no-cors",useCORSPreflightFlag:e.useCORSPreflightFlag??!1,credentials:e.credentials??"same-origin",useCredentials:e.useCredentials??!1,cache:e.cache??"default",redirect:e.redirect??"follow",integrity:e.integrity??"",cryptoGraphicsNonceMetadata:e.cryptoGraphicsNonceMetadata??"",parserMetadata:e.parserMetadata??"",reloadNavigation:e.reloadNavigation??!1,historyNavigation:e.historyNavigation??!1,userActivation:e.userActivation??!1,taintedOrigin:e.taintedOrigin??!1,redirectCount:e.redirectCount??0,responseTainting:e.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:e.preventNoCacheCacheControlHeaderModification??!1,done:e.done??!1,timingAllowFailed:e.timingAllowFailed??!1,urlList:e.urlList,url:e.urlList[0],headersList:e.headersList?new c(e.headersList):new c}}function Z(e){const t=z({...e,body:null});return null!=e.body&&(t.body=n(e.body)),t}function j(e,t,A,s){const r=new G(F);X(r,e),_(r,t),J(r,A);const n=new o(F);return q(r,n),g(n,e.headersList),l(n,s),r}Reflect.deleteProperty(G,"setRequestSignal"),Reflect.deleteProperty(G,"getRequestDispatcher"),Reflect.deleteProperty(G,"setRequestDispatcher"),Reflect.deleteProperty(G,"setRequestHeaders"),Reflect.deleteProperty(G,"getRequestState"),Reflect.deleteProperty(G,"setRequestState"),r(G,$),Object.defineProperties(G.prototype,{method:b,url:b,headers:b,redirect:b,clone:b,signal:b,duplex:b,destination:b,body:b,bodyUsed:b,isHistoryNavigation:b,isReloadNavigation:b,keepalive:b,integrity:b,cache:b,credentials:b,attribute:b,referrerPolicy:b,referrer:b,mode:b,[Symbol.toStringTag]:{value:"Request",configurable:!0}}),k.is.Request=k.util.MakeTypeAssertion(G),k.converters.RequestInfo=function(e){return"string"==typeof e?k.converters.USVString(e):k.is.Request(e)?e:k.converters.USVString(e)},k.converters.RequestInit=k.dictionaryConverter([{key:"method",converter:k.converters.ByteString},{key:"headers",converter:k.converters.HeadersInit},{key:"body",converter:k.nullableConverter(k.converters.BodyInit)},{key:"referrer",converter:k.converters.USVString},{key:"referrerPolicy",converter:k.converters.DOMString,allowedValues:f},{key:"mode",converter:k.converters.DOMString,allowedValues:y},{key:"credentials",converter:k.converters.DOMString,allowedValues:S},{key:"cache",converter:k.converters.DOMString,allowedValues:D},{key:"redirect",converter:k.converters.DOMString,allowedValues:m},{key:"integrity",converter:k.converters.DOMString},{key:"keepalive",converter:k.converters.boolean},{key:"signal",converter:k.nullableConverter((e=>k.converters.AbortSignal(e,"RequestInit","signal")))},{key:"window",converter:k.converters.any},{key:"duplex",converter:k.converters.DOMString,allowedValues:w},{key:"dispatcher",converter:k.converters.any}]),e.exports={Request:G,makeRequest:z,fromInnerRequest:j,cloneRequest:Z,getRequestDispatcher:W,getRequestState:$}},4821:(e,t,A)=>{"use strict";const{Headers:s,HeadersList:r,fill:n,getHeadersGuard:i,setHeadersGuard:o,setHeadersList:a}=A(6558),{extractBody:c,cloneBody:l,mixinBody:h,streamRegistry:g,bodyUnusable:d}=A(2530),u=A(2858),E=A(7975),{kEnumerableProperty:I}=u,{isValidReasonPhrase:Q,isCancelled:C,isAborted:B,serializeJavascriptValueToJSONString:p,isErrorLike:f,isomorphicEncode:m,environmentSettingsObject:y}=A(6686),{redirectStatusSet:S,nullBodyStatus:D}=A(9441),{webidl:w}=A(6097),{URLSerializer:b}=A(9934),{kConstruct:R}=A(257),N=A(4589),k=new TextEncoder("utf-8");class T{#Be;#le;static error(){return O(x(),"immutable")}static json(e,t=void 0){w.argumentLengthCheck(arguments,1,"Response.json"),null!==t&&(t=w.converters.ResponseInit(t));const A=k.encode(p(e)),s=c(A),r=O(H({}),"response");return V(r,t,{body:s[0],type:"application/json"}),r}static redirect(e,t=302){let A;w.argumentLengthCheck(arguments,1,"Response.redirect"),e=w.converters.USVString(e),t=w.converters["unsigned short"](t);try{A=new URL(e,y.settingsObject.baseUrl)}catch(t){throw new TypeError(`Failed to parse URL from ${e}`,{cause:t})}if(!S.has(t))throw new RangeError(`Invalid status code ${t}`);const s=O(H({}),"immutable");s.#le.status=t;const r=m(b(A));return s.#le.headersList.append("location",r,!0),s}constructor(e=null,t=void 0){if(w.util.markAsUncloneable(this),e===R)return;null!==e&&(e=w.converters.BodyInit(e,"Response","body")),t=w.converters.ResponseInit(t),this.#le=H({}),this.#Be=new s(R),o(this.#Be,"response"),a(this.#Be,this.#le.headersList);let A=null;if(null!=e){const[t,s]=c(e);A={body:t,type:s}}V(this,t,A)}get type(){return w.brandCheck(this,T),this.#le.type}get url(){w.brandCheck(this,T);const e=this.#le.urlList,t=e[e.length-1]??null;return null===t?"":b(t,!0)}get redirected(){return w.brandCheck(this,T),this.#le.urlList.length>1}get status(){return w.brandCheck(this,T),this.#le.status}get ok(){return w.brandCheck(this,T),this.#le.status>=200&&this.#le.status<=299}get statusText(){return w.brandCheck(this,T),this.#le.statusText}get headers(){return w.brandCheck(this,T),this.#Be}get body(){return w.brandCheck(this,T),this.#le.body?this.#le.body.stream:null}get bodyUsed(){return w.brandCheck(this,T),!!this.#le.body&&u.isDisturbed(this.#le.body.stream)}clone(){if(w.brandCheck(this,T),d(this.#le))throw w.errors.exception({header:"Response.clone",message:"Body has already been consumed."});const e=L(this.#le);return this.#le.body?.stream&&g.register(this,new WeakRef(this.#le.body.stream)),O(e,i(this.#Be))}[E.inspect.custom](e,t){null===t.depth&&(t.depth=2),t.colors??=!0;const A={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${E.formatWithOptions(t,A)}`}static getResponseHeaders(e){return e.#Be}static setResponseHeaders(e,t){e.#Be=t}static getResponseState(e){return e.#le}static setResponseState(e,t){e.#le=t}}const{getResponseHeaders:F,setResponseHeaders:v,getResponseState:M,setResponseState:U}=T;function L(e){if(e.internalResponse)return P(L(e.internalResponse),e.type);const t=H({...e,body:null});return null!=e.body&&(t.body=l(e.body)),t}function H(e){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...e,headersList:e?.headersList?new r(e?.headersList):new r,urlList:e?.urlList?[...e.urlList]:[]}}function x(e){return H({type:"error",status:0,error:f(e)?e:new Error(e?String(e):e),aborted:e&&"AbortError"===e.name})}function Y(e,t){return t={internalResponse:e,...t},new Proxy(e,{get:(e,A)=>A in t?t[A]:e[A],set:(e,A,s)=>(N(!(A in t)),e[A]=s,!0)})}function P(e,t){return"basic"===t?Y(e,{type:"basic",headersList:e.headersList}):"cors"===t?Y(e,{type:"cors",headersList:e.headersList}):"opaque"===t?Y(e,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null}):"opaqueredirect"===t?Y(e,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null}):void N(!1)}function V(e,t,A){if(null!==t.status&&(t.status<200||t.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in t&&null!=t.statusText&&!Q(String(t.statusText)))throw new TypeError("Invalid statusText");if("status"in t&&null!=t.status&&(M(e).status=t.status),"statusText"in t&&null!=t.statusText&&(M(e).statusText=t.statusText),"headers"in t&&null!=t.headers&&n(F(e),t.headers),A){if(D.includes(e.status))throw w.errors.exception({header:"Response constructor",message:`Invalid response status code ${e.status}`});M(e).body=A.body,null==A.type||M(e).headersList.contains("content-type",!0)||M(e).headersList.append("content-type",A.type,!0)}}function O(e,t){const A=new T(R);U(A,e);const r=new s(R);return v(A,r),a(r,e.headersList),o(r,t),e.body?.stream&&g.register(A,new WeakRef(e.body.stream)),A}Reflect.deleteProperty(T,"getResponseHeaders"),Reflect.deleteProperty(T,"setResponseHeaders"),Reflect.deleteProperty(T,"getResponseState"),Reflect.deleteProperty(T,"setResponseState"),h(T,M),Object.defineProperties(T.prototype,{type:I,url:I,status:I,ok:I,redirected:I,statusText:I,headers:I,clone:I,body:I,bodyUsed:I,[Symbol.toStringTag]:{value:"Response",configurable:!0}}),Object.defineProperties(T,{json:I,redirect:I,error:I}),w.converters.XMLHttpRequestBodyInit=function(e,t,A){return"string"==typeof e?w.converters.USVString(e,t,A):w.is.Blob(e)||w.is.BufferSource(e)||w.is.FormData(e)||w.is.URLSearchParams(e)?e:w.converters.DOMString(e,t,A)},w.converters.BodyInit=function(e,t,A){return w.is.ReadableStream(e)||e?.[Symbol.asyncIterator]?e:w.converters.XMLHttpRequestBodyInit(e,t,A)},w.converters.ResponseInit=w.dictionaryConverter([{key:"status",converter:w.converters["unsigned short"],defaultValue:()=>200},{key:"statusText",converter:w.converters.ByteString,defaultValue:()=>""},{key:"headers",converter:w.converters.HeadersInit}]),w.is.Response=w.util.MakeTypeAssertion(T),e.exports={isNetworkError:function(e){return"error"===e.type&&0===e.status},makeNetworkError:x,makeResponse:H,makeAppropriateNetworkError:function(e,t=null){return N(C(e)),B(e)?x(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:t})):x(Object.assign(new DOMException("Request was cancelled."),{cause:t}))},filterResponse:P,Response:T,cloneResponse:L,fromInnerResponse:O,getResponseState:M}},6686:(e,t,A)=>{"use strict";const{Transform:s}=A(7075),r=A(8522),{redirectStatusSet:n,referrerPolicyTokens:i,badPortsSet:o}=A(9441),{getGlobalOrigin:a}=A(2837),{collectASequenceOfCodePoints:c,collectAnHTTPQuotedString:l,removeChars:h,parseMIMEType:g}=A(9934),{performance:d}=A(643),{ReadableStreamFrom:u,isValidHTTPToken:E,normalizedMethodRecordsBase:I}=A(2858),Q=A(4589),{isUint8Array:C}=A(3429),{webidl:B}=A(6097);function p(e){const t=e.urlList,A=t.length;return 0===A?null:t[A-1].toString()}function f(e){for(let t=0;t<e.length;++t){const A=e.charCodeAt(t);if(A>126||A<32)return!1}return!0}function m(e){return e.urlList[e.urlList.length-1]}const y=E;function S(e){return!1===("\t"===e[0]||" "===e[0]||"\t"===e[e.length-1]||" "===e[e.length-1]||e.includes("\n")||e.includes("\r")||e.includes("\0"))}function D(e,t){return e}function w(){return{referrerPolicy:"strict-origin-when-cross-origin"}}function b(e,t=!1){return Q(B.is.URL(e)),x(e=new URL(e))?"no-referrer":(e.username="",e.password="",e.hash="",!0===t&&(e.pathname="",e.search=""),e)}const R=RegExp.prototype.test.bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/),N=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function k(e){return e.includes(":")?("["===e[0]&&"]"===e[e.length-1]&&(e=e.slice(1,-1)),N(e)):R(e)}function T(e){return!!B.is.URL(e)&&("about:blank"===e.href||"about:srcdoc"===e.href||("data:"===e.protocol||("blob:"===e.protocol||!(null==(t=e.origin)||"null"===t||"https:"!==(t=new URL(t)).protocol&&"wss:"!==t.protocol&&!k(t.hostname)&&"localhost"!==t.hostname&&"localhost."!==t.hostname&&!t.hostname.endsWith(".localhost")&&!t.hostname.endsWith(".localhost.")&&"file:"!==t.protocol))));var t}function F(e,t){return e.origin===t.origin&&"null"===e.origin||e.protocol===t.protocol&&e.hostname===t.hostname&&e.port===t.port}const v=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function M(e,t,A=0,s=1){class r{#Ke;#et;#tt;constructor(e,t){this.#Ke=e,this.#et=t,this.#tt=0}next(){if("object"!=typeof this||null===this||!(#Ke in this))throw new TypeError(`'next' called on an object that does not implement interface ${e} Iterator.`);const r=this.#tt,n=t(this.#Ke);if(r>=n.length)return{value:void 0,done:!0};const{[A]:i,[s]:o}=n[r];let a;switch(this.#tt=r+1,this.#et){case"key":a=i;break;case"value":a=o;break;case"key+value":a=[i,o]}return{value:a,done:!1}}}return delete r.prototype.constructor,Object.setPrototypeOf(r.prototype,v),Object.defineProperties(r.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${e} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(e,t){return new r(e,t)}}const U=/[^\x00-\xFF]/;function L(e){return Q(!U.test(e)),e}async function H(e,t,A){try{const s=[];let r=0;for(;;){const{done:n,value:i}=await e.read();if(n)return void t(Buffer.concat(s,r));if(!C(i))return void A(new TypeError("Received non-Uint8Array chunk"));s.push(i),r+=i.length}}catch(e){A(e)}}function x(e){Q("protocol"in e);const t=e.protocol;return"about:"===t||"blob:"===t||"data:"===t}function Y(e){return"string"==typeof e&&":"===e[5]&&"h"===e[0]&&"t"===e[1]&&"t"===e[2]&&"p"===e[3]&&"s"===e[4]||"https:"===e.protocol}function P(e){Q("protocol"in e);const t=e.protocol;return"http:"===t||"https:"===t}class V extends s{#At;constructor(e){super(),this.#At=e}_transform(e,t,A){if(!this._inflateStream){if(0===e.length)return void A();this._inflateStream=8==(15&e[0])?r.createInflate(this.#At):r.createInflateRaw(this.#At),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",(()=>this.push(null))),this._inflateStream.on("error",(e=>this.destroy(e)))}this._inflateStream.write(e,t,A)}_final(e){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),e()}}function O(e,t){const A=t.get(e,!0);return null===A?null:function(e){const t=e,A={position:0},s=[];let r="";for(;A.position<t.length;){if(r+=c((e=>'"'!==e&&","!==e),t,A),A.position<t.length)if(34===t.charCodeAt(A.position)){if(r+=l(t,A),A.position<t.length)continue}else Q(44===t.charCodeAt(A.position)),A.position++;r=h(r,!0,!0,(e=>9===e||32===e)),s.push(r),r=""}return s}(A)}const G=new TextDecoder;class J{get baseUrl(){return a()}get origin(){return this.baseUrl?.origin}policyContainer={referrerPolicy:"strict-origin-when-cross-origin"}}const W=new class{settingsObject=new J};e.exports={isAborted:function(e){return"aborted"===e.controller.state},isCancelled:function(e){return"aborted"===e.controller.state||"terminated"===e.controller.state},isValidEncodedURL:f,ReadableStreamFrom:u,tryUpgradeRequestToAPotentiallyTrustworthyURL:function(e){},clampAndCoarsenConnectionTimingInfo:function(e,t,A){return!e?.startTime||e.startTime<t?{domainLookupStartTime:t,domainLookupEndTime:t,connectionStartTime:t,connectionEndTime:t,secureConnectionStartTime:t,ALPNNegotiatedProtocol:e?.ALPNNegotiatedProtocol}:{domainLookupStartTime:D(e.domainLookupStartTime),domainLookupEndTime:D(e.domainLookupEndTime),connectionStartTime:D(e.connectionStartTime),connectionEndTime:D(e.connectionEndTime),secureConnectionStartTime:D(e.secureConnectionStartTime),ALPNNegotiatedProtocol:e.ALPNNegotiatedProtocol}},coarsenedSharedCurrentTime:function(e){return D(d.now())},determineRequestsReferrer:function(e){const t=e.referrerPolicy;Q(t);let A=null;if("client"===e.referrer){const e=a();if(!e||"null"===e.origin)return"no-referrer";A=new URL(e)}else B.is.URL(e.referrer)&&(A=e.referrer);let s=b(A);const r=b(A,!0);switch(s.toString().length>4096&&(s=r),t){case"no-referrer":return"no-referrer";case"origin":return null!=r?r:b(A,!0);case"unsafe-url":return s;case"strict-origin":{const t=m(e);return T(s)&&!T(t)?"no-referrer":r}case"strict-origin-when-cross-origin":{const t=m(e);return F(s,t)?s:T(s)&&!T(t)?"no-referrer":r}case"same-origin":return F(e,s)?s:"no-referrer";case"origin-when-cross-origin":return F(e,s)?s:r;case"no-referrer-when-downgrade":{const t=m(e);return T(s)&&!T(t)?"no-referrer":s}}},makePolicyContainer:w,clonePolicyContainer:function(e){return{referrerPolicy:e.referrerPolicy}},appendFetchMetadata:function(e){let t=null;t=e.mode,e.headersList.set("sec-fetch-mode",t,!0)},appendRequestOriginHeader:function(e){let t=e.origin;if("client"!==t&&void 0!==t)if("cors"===e.responseTainting||"websocket"===e.mode)e.headersList.append("origin",t,!0);else if("GET"!==e.method&&"HEAD"!==e.method){switch(e.referrerPolicy){case"no-referrer":t=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":e.origin&&Y(e.origin)&&!Y(m(e))&&(t=null);break;case"same-origin":F(e,m(e))||(t=null)}e.headersList.append("origin",t,!0)}},TAOCheck:function(){return"success"},corsCheck:function(){return"success"},crossOriginResourcePolicyCheck:function(){return"allowed"},createOpaqueTimingInfo:function(e){return{startTime:e.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:e.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}},setRequestReferrerPolicyOnRedirect:function(e,t){const A=function(e){const t=(e.headersList.get("referrer-policy",!0)??"").split(",");let A="";if(t.length)for(let e=t.length;0!==e;e--){const s=t[e-1].trim();if(i.has(s)){A=s;break}}return A}(t);""!==A&&(e.referrerPolicy=A)},isValidHTTPToken:E,requestBadPort:function(e){const t=m(e);return P(t)&&o.has(t.port)?"blocked":"allowed"},requestCurrentURL:m,responseURL:p,responseLocationURL:function(e,t){if(!n.has(e.status))return null;let A=e.headersList.get("location",!0);var s;return null!==A&&S(A)&&(f(A)||(s=A,A=Buffer.from(s,"binary").toString("utf8")),A=new URL(A,p(e))),A&&!A.hash&&(A.hash=t),A},isURLPotentiallyTrustworthy:T,isValidReasonPhrase:function(e){for(let t=0;t<e.length;++t){const A=e.charCodeAt(t);if(!(9===A||A>=32&&A<=126||A>=128&&A<=255))return!1}return!0},sameOrigin:F,normalizeMethod:function(e){return I[e.toLowerCase()]??e},serializeJavascriptValueToJSONString:function(e){const t=JSON.stringify(e);if(void 0===t)throw new TypeError("Value is not JSON serializable");return Q("string"==typeof t),t},iteratorMixin:function(e,t,A,s=0,r=1){const n=M(e,A,s,r),i={keys:{writable:!0,enumerable:!0,configurable:!0,value:function(){return B.brandCheck(this,t),n(this,"key")}},values:{writable:!0,enumerable:!0,configurable:!0,value:function(){return B.brandCheck(this,t),n(this,"value")}},entries:{writable:!0,enumerable:!0,configurable:!0,value:function(){return B.brandCheck(this,t),n(this,"key+value")}},forEach:{writable:!0,enumerable:!0,configurable:!0,value:function(A,s=globalThis){if(B.brandCheck(this,t),B.argumentLengthCheck(arguments,1,`${e}.forEach`),"function"!=typeof A)throw new TypeError(`Failed to execute 'forEach' on '${e}': parameter 1 is not of type 'Function'.`);for(const{0:e,1:t}of n(this,"key+value"))A.call(s,t,e,this)}}};return Object.defineProperties(t.prototype,{...i,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:i.entries.value}})},createIterator:M,isValidHeaderName:y,isValidHeaderValue:S,isErrorLike:function(e){return e instanceof Error||"Error"===e?.constructor?.name||"DOMException"===e?.constructor?.name},fullyReadBody:function(e,t,A){const s=t,r=A;try{H(e.stream.getReader(),s,r)}catch(e){r(e)}},readableStreamClose:function(e){try{e.close(),e.byobRequest?.respond(0)}catch(e){if(!e.message.includes("Controller is already closed")&&!e.message.includes("ReadableStream is already closed"))throw e}},isomorphicEncode:L,urlIsLocal:x,urlHasHttpsScheme:Y,urlIsHttpHttpsScheme:P,readAllBytes:H,simpleRangeHeaderValue:function(e,t){const A=e;if(!A.startsWith("bytes"))return"failure";const s={position:5};if(t&&c((e=>"\t"===e||" "===e),A,s),61!==A.charCodeAt(s.position))return"failure";s.position++,t&&c((e=>"\t"===e||" "===e),A,s);const r=c((e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}),A,s),n=r.length?Number(r):null;if(t&&c((e=>"\t"===e||" "===e),A,s),45!==A.charCodeAt(s.position))return"failure";s.position++,t&&c((e=>"\t"===e||" "===e),A,s);const i=c((e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}),A,s),o=i.length?Number(i):null;return s.position<A.length||null===o&&null===n||n>o?"failure":{rangeStartValue:n,rangeEndValue:o}},buildContentRange:function(e,t,A){let s="bytes ";return s+=L(`${e}`),s+="-",s+=L(`${t}`),s+="/",s+=L(`${A}`),s},createInflate:function(e){return new V(e)},extractMimeType:function(e){let t=null,A=null,s=null;const r=O("content-type",e);if(null===r)return"failure";for(const e of r){const r=g(e);"failure"!==r&&"*/*"!==r.essence&&(s=r,s.essence!==A?(t=null,s.parameters.has("charset")&&(t=s.parameters.get("charset")),A=s.essence):s.parameters.has("charset")||null===t||s.parameters.set("charset",t))}return null==s?"failure":s},getDecodeSplit:O,utf8DecodeBytes:function(e){return 0===e.length?"":(239===e[0]&&187===e[1]&&191===e[2]&&(e=e.subarray(3)),G.decode(e))},environmentSettingsObject:W,isOriginIPPotentiallyTrustworthy:k}},7420:(e,t,A)=>{"use strict";const s=A(4589),r=new Map([["sha256",0],["sha384",1],["sha512",2]]);let n;try{n=A(7598);const e=n.getHashes();0===e.length&&r.clear();for(const t of r.keys())!1===e.includes(t)&&r.delete(t)}catch{r.clear()}const i=Map.prototype.get.bind(r),o=Map.prototype.has.bind(r),a=void 0===n||0===r.size?()=>!0:(e,t)=>{const A=l(t);if(0===A.length)return!0;const s=c(A);for(const t of s){const A=t.alg,s=t.val;if(g(h(A,e),s))return!0}return!1};function c(e){const t=[];let A=null;for(const r of e){if(s(o(r.alg),"Invalid SRI hash algorithm token"),0===t.length){t.push(r),A=r;continue}const e=A.alg,n=i(e),a=r.alg,c=i(a);c<n||(c>n?(A=r,t[0]=r,t.length=1):t.push(r))}return t}function l(e){const t=[];for(const A of e.split(" ")){const e=A.split("?",1)[0];let s="";const r=[e.slice(0,6),e.slice(7)],n=r[0];if(!o(n))continue;r[1]&&(s=r[1]);const i={alg:n,val:s};t.push(i)}return t}const h=(e,t)=>n.hash(e,t,"base64");function g(e,t){let A=e.length;0!==A&&"="===e[A-1]&&(A-=1),0!==A&&"="===e[A-1]&&(A-=1);let s=t.length;if(0!==s&&"="===t[s-1]&&(s-=1),0!==s&&"="===t[s-1]&&(s-=1),A!==s)return!1;for(let s=0;s<A;++s)if(!(e[s]===t[s]||"+"===e[s]&&"-"===t[s]||"/"===e[s]&&"_"===t[s]))return!1;return!0}e.exports={applyAlgorithmToBytes:h,bytesMatch:a,caseSensitiveMatch:g,isValidSRIHashAlgorithm:o,getStrongestMetadata:c,parseMetadata:l}},6097:(e,t,A)=>{"use strict";const{types:s,inspect:r}=A(7975),{markAsUncloneable:n}=A(5919),i=Function.call.bind(Function.prototype[Symbol.hasInstance]),o={converters:{},util:{},errors:{},is:{}};o.errors.exception=function(e){return new TypeError(`${e.header}: ${e.message}`)},o.errors.conversionFailed=function(e){const t=1===e.types.length?"":" one of",A=`${e.argument} could not be converted to${t}: ${e.types.join(", ")}.`;return o.errors.exception({header:e.prefix,message:A})},o.errors.invalidArgument=function(e){return o.errors.exception({header:e.prefix,message:`"${e.value}" is an invalid ${e.type}.`})},o.brandCheck=function(e,t){if(!i(t,e)){const e=new TypeError("Illegal invocation");throw e.code="ERR_INVALID_THIS",e}},o.brandCheckMultiple=function(e){const t=e.map((e=>o.util.MakeTypeAssertion(e)));return e=>{if(t.every((t=>!t(e)))){const e=new TypeError("Illegal invocation");throw e.code="ERR_INVALID_THIS",e}}},o.argumentLengthCheck=function({length:e},t,A){if(e<t)throw o.errors.exception({message:`${t} argument${1!==t?"s":""} required, but${e?" only":""} ${e} found.`,header:A})},o.illegalConstructor=function(){throw o.errors.exception({header:"TypeError",message:"Illegal constructor"})},o.util.MakeTypeAssertion=function(e){return t=>i(e,t)},o.util.Type=function(e){switch(typeof e){case"undefined":return 1;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"bigint":return 6;case"function":case"object":return null===e?7:8}},o.util.Types={UNDEFINED:1,BOOLEAN:2,STRING:3,SYMBOL:4,NUMBER:5,BIGINT:6,NULL:7,OBJECT:8},o.util.TypeValueToString=function(e){switch(o.util.Type(e)){case 1:return"Undefined";case 2:return"Boolean";case 3:return"String";case 4:return"Symbol";case 5:return"Number";case 6:return"BigInt";case 7:return"Null";case 8:return"Object"}},o.util.markAsUncloneable=n||(()=>{}),o.util.ConvertToInt=function(e,t,A,s){let r,n;64===t?(r=Math.pow(2,53)-1,n="unsigned"===A?0:Math.pow(-2,53)+1):"unsigned"===A?(n=0,r=Math.pow(2,t)-1):(n=Math.pow(-2,t)-1,r=Math.pow(2,t-1)-1);let i=Number(e);if(0===i&&(i=0),o.util.HasFlag(s,o.attributes.EnforceRange)){if(Number.isNaN(i)||i===Number.POSITIVE_INFINITY||i===Number.NEGATIVE_INFINITY)throw o.errors.exception({header:"Integer conversion",message:`Could not convert ${o.util.Stringify(e)} to an integer.`});if(i=o.util.IntegerPart(i),i<n||i>r)throw o.errors.exception({header:"Integer conversion",message:`Value must be between ${n}-${r}, got ${i}.`});return i}return!Number.isNaN(i)&&o.util.HasFlag(s,o.attributes.Clamp)?(i=Math.min(Math.max(i,n),r),i=Math.floor(i)%2==0?Math.floor(i):Math.ceil(i),i):Number.isNaN(i)||0===i&&Object.is(0,i)||i===Number.POSITIVE_INFINITY||i===Number.NEGATIVE_INFINITY?0:(i=o.util.IntegerPart(i),i%=Math.pow(2,t),"signed"===A&&i>=Math.pow(2,t)-1?i-Math.pow(2,t):i)},o.util.IntegerPart=function(e){const t=Math.floor(Math.abs(e));return e<0?-1*t:t},o.util.Stringify=function(e){switch(o.util.Type(e)){case 4:return`Symbol(${e.description})`;case 8:return r(e);case 3:return`"${e}"`;case 6:return`${e}n`;default:return`${e}`}},o.util.IsResizableArrayBuffer=function(e){if(s.isArrayBuffer(e))return e.resizable;if(s.isSharedArrayBuffer(e))return e.growable;throw o.errors.exception({header:"IsResizableArrayBuffer",message:`"${o.util.Stringify(e)}" is not an array buffer.`})},o.util.HasFlag=function(e,t){return"number"==typeof e&&(e&t)===t},o.sequenceConverter=function(e){return(t,A,s,r)=>{if(8!==o.util.Type(t))throw o.errors.exception({header:A,message:`${s} (${o.util.Stringify(t)}) is not iterable.`});const n="function"==typeof r?r():t?.[Symbol.iterator]?.(),i=[];let a=0;if(void 0===n||"function"!=typeof n.next)throw o.errors.exception({header:A,message:`${s} is not iterable.`});for(;;){const{done:t,value:r}=n.next();if(t)break;i.push(e(r,A,`${s}[${a++}]`))}return i}},o.recordConverter=function(e,t){return(A,r,n)=>{if(8!==o.util.Type(A))throw o.errors.exception({header:r,message:`${n} ("${o.util.TypeValueToString(A)}") is not an Object.`});const i={};if(!s.isProxy(A)){const s=[...Object.getOwnPropertyNames(A),...Object.getOwnPropertySymbols(A)];for(const a of s){const s=o.util.Stringify(a),c=e(a,r,`Key ${s} in ${n}`),l=t(A[a],r,`${n}[${s}]`);i[c]=l}return i}const a=Reflect.ownKeys(A);for(const s of a){const o=Reflect.getOwnPropertyDescriptor(A,s);if(o?.enumerable){const o=e(s,r,n),a=t(A[s],r,n);i[o]=a}}return i}},o.interfaceConverter=function(e,t){return(A,s,r)=>{if(!e(A))throw o.errors.exception({header:s,message:`Expected ${r} ("${o.util.Stringify(A)}") to be an instance of ${t}.`});return A}},o.dictionaryConverter=function(e){return(t,A,s)=>{const r={};if(null!=t&&8!==o.util.Type(t))throw o.errors.exception({header:A,message:`Expected ${t} to be one of: Null, Undefined, Object.`});for(const n of e){const{key:e,defaultValue:i,required:a,converter:c}=n;if(!0===a&&(null==t||!Object.hasOwn(t,e)))throw o.errors.exception({header:A,message:`Missing required key "${e}".`});let l=t?.[e];const h=void 0!==i;if(h&&void 0===l&&(l=i()),a||h||void 0!==l){if(l=c(l,A,`${s}.${e}`),n.allowedValues&&!n.allowedValues.includes(l))throw o.errors.exception({header:A,message:`${l} is not an accepted type. Expected one of ${n.allowedValues.join(", ")}.`});r[e]=l}}return r}},o.nullableConverter=function(e){return(t,A,s)=>null===t?t:e(t,A,s)},o.is.USVString=function(e){return"string"==typeof e&&e.isWellFormed()},o.is.ReadableStream=o.util.MakeTypeAssertion(ReadableStream),o.is.Blob=o.util.MakeTypeAssertion(Blob),o.is.URLSearchParams=o.util.MakeTypeAssertion(URLSearchParams),o.is.File=o.util.MakeTypeAssertion(File),o.is.URL=o.util.MakeTypeAssertion(URL),o.is.AbortSignal=o.util.MakeTypeAssertion(AbortSignal),o.is.MessagePort=o.util.MakeTypeAssertion(MessagePort),o.is.BufferSource=function(e){return s.isArrayBuffer(e)||ArrayBuffer.isView(e)&&s.isArrayBuffer(e.buffer)},o.converters.DOMString=function(e,t,A,s){if(null===e&&o.util.HasFlag(s,o.attributes.LegacyNullToEmptyString))return"";if("symbol"==typeof e)throw o.errors.exception({header:t,message:`${A} is a symbol, which cannot be converted to a DOMString.`});return String(e)},o.converters.ByteString=function(e,t,A){if("symbol"==typeof e)throw o.errors.exception({header:t,message:`${A} is a symbol, which cannot be converted to a ByteString.`});const s=String(e);for(let e=0;e<s.length;e++)if(s.charCodeAt(e)>255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${e} has a value of ${s.charCodeAt(e)} which is greater than 255.`);return s},o.converters.USVString=function(e){return"string"==typeof e?e.toWellFormed():`${e}`.toWellFormed()},o.converters.boolean=function(e){return Boolean(e)},o.converters.any=function(e){return e},o.converters["long long"]=function(e,t,A){return o.util.ConvertToInt(e,64,"signed",0,t,A)},o.converters["unsigned long long"]=function(e,t,A){return o.util.ConvertToInt(e,64,"unsigned",0,t,A)},o.converters["unsigned long"]=function(e,t,A){return o.util.ConvertToInt(e,32,"unsigned",0,t,A)},o.converters["unsigned short"]=function(e,t,A,s){return o.util.ConvertToInt(e,16,"unsigned",s,t,A)},o.converters.ArrayBuffer=function(e,t,A,r){if(8!==o.util.Type(e)||!s.isArrayBuffer(e))throw o.errors.conversionFailed({prefix:t,argument:`${A} ("${o.util.Stringify(e)}")`,types:["ArrayBuffer"]});if(!o.util.HasFlag(r,o.attributes.AllowResizable)&&o.util.IsResizableArrayBuffer(e))throw o.errors.exception({header:t,message:`${A} cannot be a resizable ArrayBuffer.`});return e},o.converters.SharedArrayBuffer=function(e,t,A,r){if(8!==o.util.Type(e)||!s.isSharedArrayBuffer(e))throw o.errors.conversionFailed({prefix:t,argument:`${A} ("${o.util.Stringify(e)}")`,types:["SharedArrayBuffer"]});if(!o.util.HasFlag(r,o.attributes.AllowResizable)&&o.util.IsResizableArrayBuffer(e))throw o.errors.exception({header:t,message:`${A} cannot be a resizable SharedArrayBuffer.`});return e},o.converters.TypedArray=function(e,t,A,r,n){if(8!==o.util.Type(e)||!s.isTypedArray(e)||e.constructor.name!==t.name)throw o.errors.conversionFailed({prefix:A,argument:`${r} ("${o.util.Stringify(e)}")`,types:[t.name]});if(!o.util.HasFlag(n,o.attributes.AllowShared)&&s.isSharedArrayBuffer(e.buffer))throw o.errors.exception({header:A,message:`${r} cannot be a view on a shared array buffer.`});if(!o.util.HasFlag(n,o.attributes.AllowResizable)&&o.util.IsResizableArrayBuffer(e.buffer))throw o.errors.exception({header:A,message:`${r} cannot be a view on a resizable array buffer.`});return e},o.converters.DataView=function(e,t,A,r){if(8!==o.util.Type(e)||!s.isDataView(e))throw o.errors.conversionFailed({prefix:t,argument:`${A} ("${o.util.Stringify(e)}")`,types:["DataView"]});if(!o.util.HasFlag(r,o.attributes.AllowShared)&&s.isSharedArrayBuffer(e.buffer))throw o.errors.exception({header:t,message:`${A} cannot be a view on a shared array buffer.`});if(!o.util.HasFlag(r,o.attributes.AllowResizable)&&o.util.IsResizableArrayBuffer(e.buffer))throw o.errors.exception({header:t,message:`${A} cannot be a view on a resizable array buffer.`});return e},o.converters.ArrayBufferView=function(e,t,A,r){if(8!==o.util.Type(e)||!s.isArrayBufferView(e))throw o.errors.conversionFailed({prefix:t,argument:`${A} ("${o.util.Stringify(e)}")`,types:["ArrayBufferView"]});if(!o.util.HasFlag(r,o.attributes.AllowShared)&&s.isSharedArrayBuffer(e.buffer))throw o.errors.exception({header:t,message:`${A} cannot be a view on a shared array buffer.`});if(!o.util.HasFlag(r,o.attributes.AllowResizable)&&o.util.IsResizableArrayBuffer(e.buffer))throw o.errors.exception({header:t,message:`${A} cannot be a view on a resizable array buffer.`});return e},o.converters.BufferSource=function(e,t,A,r){if(s.isArrayBuffer(e))return o.converters.ArrayBuffer(e,t,A,r);if(s.isArrayBufferView(e))return r&=~o.attributes.AllowShared,o.converters.ArrayBufferView(e,t,A,r);if(s.isSharedArrayBuffer(e))throw o.errors.exception({header:t,message:`${A} cannot be a SharedArrayBuffer.`});throw o.errors.conversionFailed({prefix:t,argument:`${A} ("${o.util.Stringify(e)}")`,types:["ArrayBuffer","ArrayBufferView"]})},o.converters.AllowSharedBufferSource=function(e,t,A,r){if(s.isArrayBuffer(e))return o.converters.ArrayBuffer(e,t,A,r);if(s.isSharedArrayBuffer(e))return o.converters.SharedArrayBuffer(e,t,A,r);if(s.isArrayBufferView(e))return r|=o.attributes.AllowShared,o.converters.ArrayBufferView(e,t,A,r);throw o.errors.conversionFailed({prefix:t,argument:`${A} ("${o.util.Stringify(e)}")`,types:["ArrayBuffer","SharedArrayBuffer","ArrayBufferView"]})},o.converters["sequence<ByteString>"]=o.sequenceConverter(o.converters.ByteString),o.converters["sequence<sequence<ByteString>>"]=o.sequenceConverter(o.converters["sequence<ByteString>"]),o.converters["record<ByteString, ByteString>"]=o.recordConverter(o.converters.ByteString,o.converters.ByteString),o.converters.Blob=o.interfaceConverter(o.is.Blob,"Blob"),o.converters.AbortSignal=o.interfaceConverter(o.is.AbortSignal,"AbortSignal"),o.converters.EventHandlerNonNull=function(e){return 8!==o.util.Type(e)?null:"function"==typeof e?e:()=>{}},o.attributes={Clamp:1,EnforceRange:2,AllowShared:4,AllowResizable:8,LegacyNullToEmptyString:16},e.exports={webidl:o}},8251:(e,t,A)=>{"use strict";const{uid:s,states:r,sentCloseFrameState:n,emptyBuffer:i,opcodes:o}=A(6490),{parseExtensions:a,isClosed:c,isClosing:l,isEstablished:h,validateCloseCodeAndReason:g}=A(8983),{makeRequest:d}=A(4609),{fetching:u}=A(7388),{Headers:E,getHeadersList:I}=A(6558),{getDecodeSplit:Q}=A(6686),{WebsocketFrameSend:C}=A(6834),B=A(4589);let p;try{p=A(7598)}catch{}function f(e,t,A,s=!1){if(t??=null,A??="",s&&g(t,A),c(e.readyState)||l(e.readyState));else if(h(e.readyState))if(e.closeState.has(n.SENT)||e.closeState.has(n.RECEIVED))e.readyState=r.CLOSING;else{const s=new C;0!==A.length&&null===t&&(t=1e3),B(null===t||Number.isInteger(t)),null===t&&0===A.length?s.frameData=i:null!==t&&null===A?(s.frameData=Buffer.allocUnsafe(2),s.frameData.writeUInt16BE(t,0)):null!==t&&null!==A?(s.frameData=Buffer.allocUnsafe(2+Buffer.byteLength(A)),s.frameData.writeUInt16BE(t,0),s.frameData.write(A,2,"utf-8")):s.frameData=i,e.socket.write(s.createFrame(o.CLOSE)),e.closeState.add(n.SENT),e.readyState=r.CLOSING}else m(e),e.readyState=r.CLOSING}function m(e,t,A,s){h(e.readyState)&&f(e,t,A,!1),e.controller.abort(),e.socket?!1===e.socket.destroyed&&e.socket.destroy():e.onSocketClose()}e.exports={establishWebSocketConnection:function(e,t,A,n,i){const o=e;o.protocol="ws:"===e.protocol?"http:":"https:";const c=d({urlList:[o],client:A,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(i.headers){const e=I(new E(i.headers));c.headersList=e}const l=p.randomBytes(16).toString("base64");c.headersList.append("sec-websocket-key",l,!0),c.headersList.append("sec-websocket-version","13",!0);for(const e of t)c.headersList.append("sec-websocket-protocol",e,!0);return c.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits",!0),u({request:c,useParallelQueue:!0,dispatcher:i.dispatcher,processResponse(e){if("error"===e.type&&(n.readyState=r.CLOSED),"error"===e.type||101!==e.status)return void m(n,1002,"Received network error or non-101 status code.",e.error);if(0!==t.length&&!e.headersList.get("Sec-WebSocket-Protocol"))return void m(n,1002,"Server did not respond with sent protocols.");if("websocket"!==e.headersList.get("Upgrade")?.toLowerCase())return void m(n,1002,'Server did not set Upgrade header to "websocket".');if("upgrade"!==e.headersList.get("Connection")?.toLowerCase())return void m(n,1002,'Server did not set Connection header to "upgrade".');if(e.headersList.get("Sec-WebSocket-Accept")!==p.createHash("sha1").update(l+s).digest("base64"))return void m(n,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");const A=e.headersList.get("Sec-WebSocket-Extensions");let i;if(null!==A&&(i=a(A),!i.has("permessage-deflate")))return void m(n,1002,"Sec-WebSocket-Extensions header does not match.");const o=e.headersList.get("Sec-WebSocket-Protocol");if(null!==o){if(!Q("sec-websocket-protocol",c.headersList).includes(o))return void m(n,1002,"Protocol was not set in the opening handshake.")}e.socket.on("data",n.onSocketData),e.socket.on("close",n.onSocketClose),e.socket.on("error",n.onSocketError),n.wasEverConnected=!0,n.onConnectionEstablished(e,i)}})},failWebsocketConnection:m,closeWebSocketConnection:f}},6490:e=>{"use strict";const t=Buffer.allocUnsafe(0);e.exports={uid:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",sentCloseFrameState:{SENT:1,RECEIVED:2},staticPropertyDescriptors:{enumerable:!0,writable:!1,configurable:!1},states:{CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},opcodes:{CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},maxUnsigned16Bit:65535,parserStates:{INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},emptyBuffer:t,sendHints:{text:1,typedArray:2,arrayBuffer:3,blob:4}}},878:(e,t,A)=>{"use strict";const{webidl:s}=A(6097),{kEnumerableProperty:r}=A(2858),{kConstruct:n}=A(257);class i extends Event{#st;constructor(e,t={}){if(e===n)return super(arguments[1],arguments[2]),void s.util.markAsUncloneable(this);const A="MessageEvent constructor";s.argumentLengthCheck(arguments,1,A),super(e=s.converters.DOMString(e,A,"type"),t=s.converters.MessageEventInit(t,A,"eventInitDict")),this.#st=t,s.util.markAsUncloneable(this)}get data(){return s.brandCheck(this,i),this.#st.data}get origin(){return s.brandCheck(this,i),this.#st.origin}get lastEventId(){return s.brandCheck(this,i),this.#st.lastEventId}get source(){return s.brandCheck(this,i),this.#st.source}get ports(){return s.brandCheck(this,i),Object.isFrozen(this.#st.ports)||Object.freeze(this.#st.ports),this.#st.ports}initMessageEvent(e,t=!1,A=!1,r=null,n="",o="",a=null,c=[]){return s.brandCheck(this,i),s.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new i(e,{bubbles:t,cancelable:A,data:r,origin:n,lastEventId:o,source:a,ports:c})}static createFastMessageEvent(e,t){const A=new i(n,e,t);return A.#st=t,A.#st.data??=null,A.#st.origin??="",A.#st.lastEventId??="",A.#st.source??=null,A.#st.ports??=[],A}}const{createFastMessageEvent:o}=i;delete i.createFastMessageEvent;class a extends Event{#st;constructor(e,t={}){const A="CloseEvent constructor";s.argumentLengthCheck(arguments,1,A),super(e=s.converters.DOMString(e,A,"type"),t=s.converters.CloseEventInit(t)),this.#st=t,s.util.markAsUncloneable(this)}get wasClean(){return s.brandCheck(this,a),this.#st.wasClean}get code(){return s.brandCheck(this,a),this.#st.code}get reason(){return s.brandCheck(this,a),this.#st.reason}}class c extends Event{#st;constructor(e,t){const A="ErrorEvent constructor";s.argumentLengthCheck(arguments,1,A),super(e,t),s.util.markAsUncloneable(this),e=s.converters.DOMString(e,A,"type"),t=s.converters.ErrorEventInit(t??{}),this.#st=t}get message(){return s.brandCheck(this,c),this.#st.message}get filename(){return s.brandCheck(this,c),this.#st.filename}get lineno(){return s.brandCheck(this,c),this.#st.lineno}get colno(){return s.brandCheck(this,c),this.#st.colno}get error(){return s.brandCheck(this,c),this.#st.error}}Object.defineProperties(i.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:r,origin:r,lastEventId:r,source:r,ports:r,initMessageEvent:r}),Object.defineProperties(a.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:r,code:r,wasClean:r}),Object.defineProperties(c.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:r,filename:r,lineno:r,colno:r,error:r}),s.converters.MessagePort=s.interfaceConverter(s.is.MessagePort,"MessagePort"),s.converters["sequence<MessagePort>"]=s.sequenceConverter(s.converters.MessagePort);const l=[{key:"bubbles",converter:s.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:s.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:s.converters.boolean,defaultValue:()=>!1}];s.converters.MessageEventInit=s.dictionaryConverter([...l,{key:"data",converter:s.converters.any,defaultValue:()=>null},{key:"origin",converter:s.converters.USVString,defaultValue:()=>""},{key:"lastEventId",converter:s.converters.DOMString,defaultValue:()=>""},{key:"source",converter:s.nullableConverter(s.converters.MessagePort),defaultValue:()=>null},{key:"ports",converter:s.converters["sequence<MessagePort>"],defaultValue:()=>[]}]),s.converters.CloseEventInit=s.dictionaryConverter([...l,{key:"wasClean",converter:s.converters.boolean,defaultValue:()=>!1},{key:"code",converter:s.converters["unsigned short"],defaultValue:()=>0},{key:"reason",converter:s.converters.USVString,defaultValue:()=>""}]),s.converters.ErrorEventInit=s.dictionaryConverter([...l,{key:"message",converter:s.converters.DOMString,defaultValue:()=>""},{key:"filename",converter:s.converters.USVString,defaultValue:()=>""},{key:"lineno",converter:s.converters["unsigned long"],defaultValue:()=>0},{key:"colno",converter:s.converters["unsigned long"],defaultValue:()=>0},{key:"error",converter:s.converters.any}]),e.exports={MessageEvent:i,CloseEvent:a,ErrorEvent:c,createFastMessageEvent:o}},6834:(e,t,A)=>{"use strict";const{maxUnsigned16Bit:s,opcodes:r}=A(6490),n=8192;let i,o=null,a=n;try{i=A(7598)}catch{i={randomFillSync:function(e,t,A){for(let t=0;t<e.length;++t)e[t]=255*Math.random()|0;return e}}}function c(){return a===n&&(a=0,i.randomFillSync(o??=Buffer.allocUnsafeSlow(n),0,n)),[o[a++],o[a++],o[a++],o[a++]]}e.exports={WebsocketFrameSend:class{constructor(e){this.frameData=e}createFrame(e){const t=this.frameData,A=c(),r=t?.byteLength??0;let n=r,i=6;r>s?(i+=8,n=127):r>125&&(i+=2,n=126);const o=Buffer.allocUnsafe(r+i);o[0]=o[1]=0,o[0]|=128,o[0]=(240&o[0])+e,o[i-4]=A[0],o[i-3]=A[1],o[i-2]=A[2],o[i-1]=A[3],o[1]=n,126===n?o.writeUInt16BE(r,2):127===n&&(o[2]=o[3]=0,o.writeUIntBE(r,4,6)),o[1]|=128;for(let e=0;e<r;++e)o[i+e]=t[e]^A[3&e];return o}static createFastTextFrame(e){const t=c(),A=e.length;for(let s=0;s<A;++s)e[s]^=t[3&s];let n=A,i=6;A>s?(i+=8,n=127):A>125&&(i+=2,n=126);const o=Buffer.allocUnsafeSlow(i);return o[0]=128|r.TEXT,o[1]=128|n,o[i-4]=t[0],o[i-3]=t[1],o[i-2]=t[2],o[i-1]=t[3],126===n?o.writeUInt16BE(A,2):127===n&&(o[2]=o[3]=0,o.writeUIntBE(A,4,6)),[o,e]}},generateMask:c}},8975:(e,t,A)=>{"use strict";const{createInflateRaw:s,Z_DEFAULT_WINDOWBITS:r}=A(8522),{isValidClientWindowBits:n}=A(8983),i=Buffer.from([0,0,255,255]),o=Symbol("kBuffer"),a=Symbol("kLength");e.exports={PerMessageDeflate:class{#rt;#k={};constructor(e){this.#k.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#k.serverMaxWindowBits=e.get("server_max_window_bits")}decompress(e,t,A){if(!this.#rt){let e=r;if(this.#k.serverMaxWindowBits){if(!n(this.#k.serverMaxWindowBits))return void A(new Error("Invalid server_max_window_bits"));e=Number.parseInt(this.#k.serverMaxWindowBits)}this.#rt=s({windowBits:e}),this.#rt[o]=[],this.#rt[a]=0,this.#rt.on("data",(e=>{this.#rt[o].push(e),this.#rt[a]+=e.length})),this.#rt.on("error",(e=>{this.#rt=null,A(e)}))}this.#rt.write(e),t&&this.#rt.write(i),this.#rt.flush((()=>{const e=Buffer.concat(this.#rt[o],this.#rt[a]);this.#rt[o].length=0,this.#rt[a]=0,A(null,e)}))}}}},834:(e,t,A)=>{"use strict";const{Writable:s}=A(7075),r=A(4589),{parserStates:n,opcodes:i,states:o,emptyBuffer:a,sentCloseFrameState:c}=A(6490),{isValidStatusCode:l,isValidOpcode:h,websocketMessageReceived:g,utf8Decode:d,isControlFrame:u,isTextBinaryFrame:E,isContinuationFrame:I}=A(8983),{failWebsocketConnection:Q}=A(8251),{WebsocketFrameSend:C}=A(6834),{PerMessageDeflate:B}=A(8975);e.exports={ByteParser:class extends s{#nt=[];#it=0;#ot=0;#at=!1;#le=n.INFO;#ct={};#lt=[];#ht;#U;constructor(e,t){super(),this.#U=e,this.#ht=null==t?new Map:t,this.#ht.has("permessage-deflate")&&this.#ht.set("permessage-deflate",new B(t))}_write(e,t,A){this.#nt.push(e),this.#ot+=e.length,this.#at=!0,this.run(A)}run(e){for(;this.#at;)if(this.#le===n.INFO){if(this.#ot<2)return e();const t=this.consume(2),A=!!(128&t[0]),s=15&t[0],r=!(128&~t[1]),o=!A&&s!==i.CONTINUATION,a=127&t[1],c=64&t[0],l=32&t[0],g=16&t[0];if(!h(s))return Q(this.#U,1002,"Invalid opcode received"),e();if(r)return Q(this.#U,1002,"Frame cannot be masked"),e();if(0!==c&&!this.#ht.has("permessage-deflate"))return void Q(this.#U,1002,"Expected RSV1 to be clear.");if(0!==l||0!==g)return void Q(this.#U,1002,"RSV1, RSV2, RSV3 must be clear");if(o&&!E(s))return void Q(this.#U,1002,"Invalid frame type was fragmented.");if(E(s)&&this.#lt.length>0)return void Q(this.#U,1002,"Expected continuation frame");if(this.#ct.fragmented&&o)return void Q(this.#U,1002,"Fragmented frame exceeded 125 bytes.");if((a>125||o)&&u(s))return void Q(this.#U,1002,"Control frame either too large or fragmented");if(I(s)&&0===this.#lt.length&&!this.#ct.compressed)return void Q(this.#U,1002,"Unexpected continuation frame");a<=125?(this.#ct.payloadLength=a,this.#le=n.READ_DATA):126===a?this.#le=n.PAYLOADLENGTH_16:127===a&&(this.#le=n.PAYLOADLENGTH_64),E(s)&&(this.#ct.binaryType=s,this.#ct.compressed=0!==c),this.#ct.opcode=s,this.#ct.masked=r,this.#ct.fin=A,this.#ct.fragmented=o}else if(this.#le===n.PAYLOADLENGTH_16){if(this.#ot<2)return e();const t=this.consume(2);this.#ct.payloadLength=t.readUInt16BE(0),this.#le=n.READ_DATA}else if(this.#le===n.PAYLOADLENGTH_64){if(this.#ot<8)return e();const t=this.consume(8),A=t.readUInt32BE(0);if(A>2**31-1)return void Q(this.#U,1009,"Received payload length > 2^31 bytes.");const s=t.readUInt32BE(4);this.#ct.payloadLength=(A<<8)+s,this.#le=n.READ_DATA}else if(this.#le===n.READ_DATA){if(this.#ot<this.#ct.payloadLength)return e();const t=this.consume(this.#ct.payloadLength);if(u(this.#ct.opcode))this.#at=this.parseControlFrame(t),this.#le=n.INFO;else{if(this.#ct.compressed){this.#ht.get("permessage-deflate").decompress(t,this.#ct.fin,((t,A)=>{if(t)Q(this.#U,1007,t.message);else{if(this.writeFragments(A),!this.#ct.fin)return this.#le=n.INFO,this.#at=!0,void this.run(e);g(this.#U,this.#ct.binaryType,this.consumeFragments()),this.#at=!0,this.#le=n.INFO,this.run(e)}})),this.#at=!1;break}this.writeFragments(t),!this.#ct.fragmented&&this.#ct.fin&&g(this.#U,this.#ct.binaryType,this.consumeFragments()),this.#le=n.INFO}}}consume(e){if(e>this.#ot)throw new Error("Called consume() before buffers satiated.");if(0===e)return a;this.#ot-=e;const t=this.#nt[0];if(t.length>e)return this.#nt[0]=t.subarray(e,t.length),t.subarray(0,e);if(t.length===e)return this.#nt.shift();{let t=0;const A=Buffer.allocUnsafeSlow(e);for(;t!==e;){const s=this.#nt[0],r=s.length;if(r+t===e){A.set(this.#nt.shift(),t);break}if(r+t>e){A.set(s.subarray(0,e-t),t),this.#nt[0]=s.subarray(e-t);break}A.set(this.#nt.shift(),t),t+=r}return A}}writeFragments(e){this.#it+=e.length,this.#lt.push(e)}consumeFragments(){const e=this.#lt;if(1===e.length)return this.#it=0,e.shift();let t=0;const A=Buffer.allocUnsafeSlow(this.#it);for(let s=0;s<e.length;++s){const r=e[s];A.set(r,t),t+=r.length}return this.#lt=[],this.#it=0,A}parseCloseBody(e){let t;if(r(1!==e.length),e.length>=2&&(t=e.readUInt16BE(0)),void 0!==t&&!l(t))return{code:1002,reason:"Invalid status code",error:!0};let A=e.subarray(2);239===A[0]&&187===A[1]&&191===A[2]&&(A=A.subarray(3));try{A=d(A)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:t,reason:A,error:!1}}parseControlFrame(e){const{opcode:t,payloadLength:A}=this.#ct;if(t===i.CLOSE){if(1===A)return Q(this.#U,1002,"Received close frame with a 1-byte body."),!1;if(this.#ct.closeInfo=this.parseCloseBody(e),this.#ct.closeInfo.error){const{code:e,reason:t}=this.#ct.closeInfo;return Q(this.#U,e,t),!1}if(!this.#U.closeState.has(c.SENT)&&!this.#U.closeState.has(c.RECEIVED)){let e=a;this.#ct.closeInfo.code&&(e=Buffer.allocUnsafe(2),e.writeUInt16BE(this.#ct.closeInfo.code,0));const t=new C(e);this.#U.socket.write(t.createFrame(i.CLOSE)),this.#U.closeState.add(c.SENT)}return this.#U.readyState=o.CLOSING,this.#U.closeState.add(c.RECEIVED),!1}if(t===i.PING){if(!this.#U.closeState.has(c.RECEIVED)){const t=new C(e);this.#U.socket.write(t.createFrame(i.PONG)),this.#U.onPing(e)}}else t===i.PONG&&this.#U.onPong(e);return!0}get closingInfo(){return this.#ct.closeInfo}}}},2534:(e,t,A)=>{"use strict";const{WebsocketFrameSend:s}=A(6834),{opcodes:r,sendHints:n}=A(6490),i=A(1726);function o(e,t){return new s(function(e,t){switch(t){case n.text:case n.typedArray:return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);case n.arrayBuffer:case n.blob:return new Uint8Array(e)}}(e,t)).createFrame(t===n.text?r.TEXT:r.BINARY)}e.exports={SendQueue:class{#gt=new i;#dt=!1;#ut;constructor(e){this.#ut=e}add(e,t,A){if(A!==n.blob){if(this.#dt){const s={promise:null,callback:t,frame:o(e,A)};this.#gt.push(s)}else if(A===n.text){const{0:A,1:r}=s.createFastTextFrame(e);this.#ut.cork(),this.#ut.write(A),this.#ut.write(r,t),this.#ut.uncork()}else this.#ut.write(o(e,A),t);return}const r={promise:e.arrayBuffer().then((e=>{r.promise=null,r.frame=o(e,A)})),callback:t,frame:null};this.#gt.push(r),this.#dt||this.#Et()}async#Et(){this.#dt=!0;const e=this.#gt;for(;!e.isEmpty();){const t=e.shift();null!==t.promise&&await t.promise,this.#ut.write(t.frame,t.callback),t.callback=t.frame=null}this.#dt=!1}}}},7053:(e,t,A)=>{"use strict";const{webidl:s}=A(6097),{validateCloseCodeAndReason:r}=A(8983),{kConstruct:n}=A(257),{kEnumerableProperty:i}=A(2858);class o extends(function(){class e extends DOMException{get reason(){return""}}return void 0!==(new e).reason?DOMException:new Proxy(DOMException,{construct(e,t,A){const s=Reflect.construct(e,t,e);return Object.setPrototypeOf(s,A.prototype),s}})}()){#It;#W;constructor(e="",t=void 0){if(super(e=s.converters.DOMString(e,"WebSocketError","message"),"WebSocketError"),t===n)return;null!==t&&(t=s.converters.WebSocketCloseInfo(t));let A=t.closeCode??null;const i=t.reason??"";r(A,i),0!==i.length&&null===A&&(A=1e3),this.#It=A,this.#W=i}get closeCode(){return this.#It}get reason(){return this.#W}static createUnvalidatedWebSocketError(e,t,A){const s=new o(e,n);return s.#It=t,s.#W=A,s}}const{createUnvalidatedWebSocketError:a}=o;delete o.createUnvalidatedWebSocketError,Object.defineProperties(o.prototype,{closeCode:i,reason:i,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}}),s.is.WebSocketError=s.util.MakeTypeAssertion(o),e.exports={WebSocketError:o,createUnvalidatedWebSocketError:a}},27:(e,t,A)=>{"use strict";const{createDeferredPromise:s}=A(9250),{environmentSettingsObject:r}=A(6686),{states:n,opcodes:i,sentCloseFrameState:o}=A(6490),{webidl:a}=A(6097),{getURLRecord:c,isValidSubprotocol:l,isEstablished:h,utf8Decode:g}=A(8983),{establishWebSocketConnection:d,failWebsocketConnection:u,closeWebSocketConnection:E}=A(8251),{channels:I}=A(772),{WebsocketFrameSend:Q}=A(6834),{ByteParser:C}=A(834),{WebSocketError:B,createUnvalidatedWebSocketError:p}=A(7053),{utf8DecodeBytes:f}=A(6686),{kEnumerableProperty:m}=A(2858);let y=!1;class S{#Ge;#Qt;#Ct;#Bt;#pt;#ft;#mt=!1;#U={onConnectionEstablished:(e,t)=>this.#yt(e,t),onMessage:(e,t)=>this.#St(e,t),onParserError:e=>u(this.#U,null,e.message),onParserDrain:()=>this.#U.socket.resume(),onSocketData:e=>{this.#Dt.write(e)||this.#U.socket.pause()},onSocketError:e=>{this.#U.readyState=n.CLOSING,I.socketError.hasSubscribers&&I.socketError.publish(e),this.#U.socket.destroy()},onSocketClose:()=>this.#wt(),onPing:()=>{},onPong:()=>{},readyState:n.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#Dt;constructor(e,t=void 0){y||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),y=!0),a.argumentLengthCheck(arguments,1,"WebSocket"),e=a.converters.USVString(e),null!==t&&(t=a.converters.WebSocketStreamOptions(t));const A=r.settingsObject.baseUrl,i=c(e,A),o=t.protocols;if(o.length!==new Set(o.map((e=>e.toLowerCase()))).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(o.length>0&&!o.every((e=>l(e))))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#Ge=i.toString(),this.#Qt=s(),this.#Ct=s(),null!=t.signal){const e=t.signal;if(e.aborted)return this.#Qt.reject(e.reason),void this.#Ct.reject(e.reason);e.addEventListener("abort",(()=>{h(this.#U.readyState)||(u(this.#U),this.#U.readyState=n.CLOSING,this.#Qt.reject(e.reason),this.#Ct.reject(e.reason),this.#mt=!0)}),{once:!0})}const g=r.settingsObject;this.#U.controller=d(i,o,g,this.#U,t)}get url(){return this.#Ge.toString()}get opened(){return this.#Qt.promise}get closed(){return this.#Ct.promise}close(e=void 0){null!==e&&(e=a.converters.WebSocketCloseInfo(e));const t=e.closeCode??null,A=e.reason;E(this.#U,t,A,!0)}#bt(e){e=a.converters.WebSocketStreamWrite(e);const t=s();let A=null,r=null;if(a.is.BufferSource(e))A=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),r=i.BINARY;else{let s;try{s=a.converters.DOMString(e)}catch(e){return t.reject(e),t.promise}A=(new TextEncoder).encode(s),r=i.TEXT}if(!this.#U.closeState.has(o.SENT)&&!this.#U.closeState.has(o.RECEIVED)){const e=new Q(A);this.#U.socket.write(e.createFrame(r),(()=>{t.resolve(void 0)}))}return t.promise}#yt(e,t){this.#U.socket=e.socket;const A=new C(this.#U,t);A.on("drain",(()=>this.#U.onParserDrain())),A.on("error",(e=>this.#U.onParserError(e))),this.#Dt=A,this.#U.readyState=n.OPEN;const s=t??"",r=e.headersList.get("sec-websocket-protocol")??"",i=new ReadableStream({start:e=>{this.#pt=e},pull(t){let A;for(;t.desiredSize>0&&null!==(A=e.socket.read());)t.enqueue(A)},cancel:e=>this.#Rt(e)}),o=new WritableStream({write:e=>this.#bt(e),close:()=>E(this.#U,null,null),abort:e=>this.#Nt(e)});this.#Bt=i,this.#ft=o,this.#Qt.resolve({extensions:s,protocol:r,readable:i,writable:o})}#St(e,t){if(this.#U.readyState!==n.OPEN)return;let A;if(e===i.TEXT)try{A=g(t)}catch{return void u(this.#U,"Received invalid UTF-8 in text frame.")}else e===i.BINARY&&(A=new Uint8Array(t.buffer,t.byteOffset,t.byteLength));this.#pt.enqueue(A)}#wt(){const e=this.#U.closeState.has(o.SENT)&&this.#U.closeState.has(o.RECEIVED);if(this.#U.readyState=n.CLOSED,this.#mt)return;this.#U.wasEverConnected||this.#Qt.reject(new B("Socket never opened"));const t=this.#Dt.closingInfo;let A=t?.code??1005;this.#U.closeState.has(o.SENT)||this.#U.closeState.has(o.RECEIVED)||(A=1006);const s=null==t?.reason?"":f(Buffer.from(t.reason));if(e)this.#pt.close(),this.#ft.locked||this.#ft.abort(new DOMException("A closed WebSocketStream cannot be written to","InvalidStateError")),this.#Ct.resolve({closeCode:A,reason:s});else{const e=p("unclean close",A,s);this.#pt.error(e),this.#ft.abort(e),this.#Ct.reject(e)}}#Nt(e){let t=null,A="";a.is.WebSocketError(e)&&(t=e.closeCode,A=e.reason),E(this.#U,t,A)}#Rt(e){this.#Nt(e)}}Object.defineProperties(S.prototype,{url:m,opened:m,closed:m,close:m,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}}),a.converters.WebSocketStreamOptions=a.dictionaryConverter([{key:"protocols",converter:a.sequenceConverter(a.converters.USVString),defaultValue:()=>[]},{key:"signal",converter:a.nullableConverter(a.converters.AbortSignal),defaultValue:()=>null}]),a.converters.WebSocketCloseInfo=a.dictionaryConverter([{key:"closeCode",converter:e=>a.converters["unsigned short"](e,a.attributes.EnforceRange)},{key:"reason",converter:a.converters.USVString,defaultValue:()=>""}]),a.converters.WebSocketStreamWrite=function(e){return"string"==typeof e?a.converters.USVString(e):a.converters.BufferSource(e)},e.exports={WebSocketStream:S}},8983:(e,t,A)=>{"use strict";const{states:s,opcodes:r}=A(6490),{isUtf8:n}=A(4573),{collectASequenceOfCodePointsFast:i,removeHTTPWhitespace:o}=A(9934);function a(e){return e===r.CLOSE||e===r.PING||e===r.PONG}function c(e){return e===r.CONTINUATION}function l(e){return e===r.TEXT||e===r.BINARY}const h=(()=>{if("string"==typeof process.versions.icu){const e=new TextDecoder("utf-8",{fatal:!0});return e.decode.bind(e)}return function(e){if(n(e))return e.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();e.exports={isConnecting:function(e){return e===s.CONNECTING},isEstablished:function(e){return e===s.OPEN},isClosing:function(e){return e===s.CLOSING},isClosed:function(e){return e===s.CLOSED},fireEvent:function(e,t,A=(e,t)=>new Event(e,t),s={}){const r=A(e,s);t.dispatchEvent(r)},isValidSubprotocol:function(e){if(0===e.length)return!1;for(let t=0;t<e.length;++t){const A=e.charCodeAt(t);if(A<33||A>126||34===A||40===A||41===A||44===A||47===A||58===A||59===A||60===A||61===A||62===A||63===A||64===A||91===A||92===A||93===A||123===A||125===A)return!1}return!0},isValidStatusCode:function(e){return e>=1e3&&e<1015?1004!==e&&1005!==e&&1006!==e:e>=3e3&&e<=4999},websocketMessageReceived:function(e,t,A){e.onMessage(t,A)},utf8Decode:h,isControlFrame:a,isContinuationFrame:c,isTextBinaryFrame:l,isValidOpcode:function(e){return l(e)||c(e)||a(e)},parseExtensions:function(e){const t={position:0},A=new Map;for(;t.position<e.length;){const s=i(";",e,t),[r,n=""]=s.split("=",2);A.set(o(r,!0,!1),o(n,!1,!0)),t.position++}return A},isValidClientWindowBits:function(e){for(let t=0;t<e.length;t++){const A=e.charCodeAt(t);if(A<48||A>57)return!1}return!0},toArrayBuffer:function(e){return e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer},getURLRecord:function(e,t){let A;try{A=new URL(e,t)}catch(e){throw new DOMException(e,"SyntaxError")}if("http:"===A.protocol?A.protocol="ws:":"https:"===A.protocol&&(A.protocol="wss:"),"ws:"!==A.protocol&&"wss:"!==A.protocol)throw new DOMException("expected a ws: or wss: url","SyntaxError");if(A.hash.length||A.href.endsWith("#"))throw new DOMException("hash","SyntaxError");return A},validateCloseCodeAndReason:function(e,t){if(null!==e&&1e3!==e&&(e<3e3||e>4999))throw new DOMException("invalid code","InvalidAccessError");if(null!==t){const e=Buffer.byteLength(t);if(e>123)throw new DOMException(`Reason must be less than 123 bytes; received ${e}`,"SyntaxError")}}}},2984:(e,t,A)=>{"use strict";const{isArrayBuffer:s}=A(3429),{webidl:r}=A(6097),{URLSerializer:n}=A(9934),{environmentSettingsObject:i}=A(6686),{staticPropertyDescriptors:o,states:a,sentCloseFrameState:c,sendHints:l,opcodes:h}=A(6490),{isConnecting:g,isEstablished:d,isClosing:u,isClosed:E,isValidSubprotocol:I,fireEvent:Q,utf8Decode:C,toArrayBuffer:B,getURLRecord:p}=A(8983),{establishWebSocketConnection:f,closeWebSocketConnection:m,failWebsocketConnection:y}=A(8251),{ByteParser:S}=A(834),{kEnumerableProperty:D}=A(2858),{getGlobalDispatcher:w}=A(9879),{ErrorEvent:b,CloseEvent:R,createFastMessageEvent:N}=A(878),{SendQueue:k}=A(2534),{WebsocketFrameSend:T}=A(6834),{channels:F}=A(772);class v extends EventTarget{#Oe={open:null,error:null,close:null,message:null};#kt=0;#Tt="";#ht="";#Ft;#U={onConnectionEstablished:(e,t)=>this.#yt(e,t),onMessage:(e,t)=>this.#St(e,t),onParserError:e=>y(this.#U,null,e.message),onParserDrain:()=>this.#vt(),onSocketData:e=>{this.#Dt.write(e)||this.#U.socket.pause()},onSocketError:e=>{this.#U.readyState=a.CLOSING,F.socketError.hasSubscribers&&F.socketError.publish(e),this.#U.socket.destroy()},onSocketClose:()=>this.#wt(),onPing:e=>{F.ping.hasSubscribers&&F.ping.publish({payload:e,websocket:this})},onPong:e=>{F.pong.hasSubscribers&&F.pong.publish({payload:e,websocket:this})},readyState:a.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#Ge;#Mt;#Dt;constructor(e,t=[]){super(),r.util.markAsUncloneable(this);const A="WebSocket constructor";r.argumentLengthCheck(arguments,1,A);const s=r.converters["DOMString or sequence<DOMString> or WebSocketInit"](t,A,"options");e=r.converters.USVString(e),t=s.protocols;const n=i.settingsObject.baseUrl,o=p(e,n);if("string"==typeof t&&(t=[t]),t.length!==new Set(t.map((e=>e.toLowerCase()))).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(t.length>0&&!t.every((e=>I(e))))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#Ge=new URL(o.href);const a=i.settingsObject;this.#U.controller=f(o,t,a,this.#U,s),this.#U.readyState=v.CONNECTING,this.#Mt="blob"}close(e=void 0,t=void 0){r.brandCheck(this,v);void 0!==e&&(e=r.converters["unsigned short"](e,"WebSocket.close","code",r.attributes.Clamp)),void 0!==t&&(t=r.converters.USVString(t)),e??=null,t??="",m(this.#U,e,t,!0)}send(e){r.brandCheck(this,v);const t="WebSocket.send";if(r.argumentLengthCheck(arguments,1,t),e=r.converters.WebSocketSendData(e,t,"data"),g(this.#U.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(d(this.#U.readyState)&&!u(this.#U.readyState))if("string"==typeof e){const t=Buffer.from(e);this.#kt+=t.byteLength,this.#Ft.add(t,(()=>{this.#kt-=t.byteLength}),l.text)}else s(e)?(this.#kt+=e.byteLength,this.#Ft.add(e,(()=>{this.#kt-=e.byteLength}),l.arrayBuffer)):ArrayBuffer.isView(e)?(this.#kt+=e.byteLength,this.#Ft.add(e,(()=>{this.#kt-=e.byteLength}),l.typedArray)):r.is.Blob(e)&&(this.#kt+=e.size,this.#Ft.add(e,(()=>{this.#kt-=e.size}),l.blob))}get readyState(){return r.brandCheck(this,v),this.#U.readyState}get bufferedAmount(){return r.brandCheck(this,v),this.#kt}get url(){return r.brandCheck(this,v),n(this.#Ge)}get extensions(){return r.brandCheck(this,v),this.#ht}get protocol(){return r.brandCheck(this,v),this.#Tt}get onopen(){return r.brandCheck(this,v),this.#Oe.open}set onopen(e){r.brandCheck(this,v),this.#Oe.open&&this.removeEventListener("open",this.#Oe.open);const t=r.converters.EventHandlerNonNull(e);null!==t?(this.addEventListener("open",t),this.#Oe.open=e):this.#Oe.open=null}get onerror(){return r.brandCheck(this,v),this.#Oe.error}set onerror(e){r.brandCheck(this,v),this.#Oe.error&&this.removeEventListener("error",this.#Oe.error);const t=r.converters.EventHandlerNonNull(e);null!==t?(this.addEventListener("error",t),this.#Oe.error=e):this.#Oe.error=null}get onclose(){return r.brandCheck(this,v),this.#Oe.close}set onclose(e){r.brandCheck(this,v),this.#Oe.close&&this.removeEventListener("close",this.#Oe.close);const t=r.converters.EventHandlerNonNull(e);null!==t?(this.addEventListener("close",t),this.#Oe.close=e):this.#Oe.close=null}get onmessage(){return r.brandCheck(this,v),this.#Oe.message}set onmessage(e){r.brandCheck(this,v),this.#Oe.message&&this.removeEventListener("message",this.#Oe.message);const t=r.converters.EventHandlerNonNull(e);null!==t?(this.addEventListener("message",t),this.#Oe.message=e):this.#Oe.message=null}get binaryType(){return r.brandCheck(this,v),this.#Mt}set binaryType(e){r.brandCheck(this,v),this.#Mt="blob"!==e&&"arraybuffer"!==e?"blob":e}#yt(e,t){this.#U.socket=e.socket;const A=new S(this.#U,t);A.on("drain",(()=>this.#U.onParserDrain())),A.on("error",(e=>this.#U.onParserError(e))),this.#Dt=A,this.#Ft=new k(e.socket),this.#U.readyState=a.OPEN;const s=e.headersList.get("sec-websocket-extensions");null!==s&&(this.#ht=s);const r=e.headersList.get("sec-websocket-protocol");if(null!==r&&(this.#Tt=r),Q("open",this),F.open.hasSubscribers){const t=e.headersList.entries;F.open.publish({address:e.socket.address(),protocol:this.#Tt,extensions:this.#ht,websocket:this,handshakeResponse:{status:e.status,statusText:e.statusText,headers:t}})}}#St(e,t){if(this.#U.readyState!==a.OPEN)return;let A;if(e===h.TEXT)try{A=C(t)}catch{return void y(this.#U,1007,"Received invalid UTF-8 in text frame.")}else e===h.BINARY&&(A="blob"===this.#Mt?new Blob([t]):B(t));Q("message",this,N,{origin:this.#Ge.origin,data:A})}#vt(){this.#U.socket.resume()}#wt(){const e=this.#U.closeState.has(c.SENT)&&this.#U.closeState.has(c.RECEIVED);let t=1005,A="";const s=this.#Dt?.closingInfo;s&&!s.error&&(t=s.code??1005,A=s.reason),this.#U.readyState=a.CLOSED,this.#U.closeState.has(c.RECEIVED)||(t=1006,Q("error",this,((e,t)=>new b(e,t)),{error:new TypeError(A)})),Q("close",this,((e,t)=>new R(e,t)),{wasClean:e,code:t,reason:A}),F.close.hasSubscribers&&F.close.publish({websocket:this,code:t,reason:A})}static ping(e,t){if(Buffer.isBuffer(t)){if(t.length>125)throw new TypeError("A PING frame cannot have a body larger than 125 bytes.")}else if(void 0!==t)throw new TypeError("Expected buffer payload");const A=e.#U.readyState;if(d(A)&&!u(A)&&!E(A)){const A=new T(t);e.#U.socket.write(A.createFrame(h.PING))}}}const{ping:M}=v;Reflect.deleteProperty(v,"ping"),v.CONNECTING=v.prototype.CONNECTING=a.CONNECTING,v.OPEN=v.prototype.OPEN=a.OPEN,v.CLOSING=v.prototype.CLOSING=a.CLOSING,v.CLOSED=v.prototype.CLOSED=a.CLOSED,Object.defineProperties(v.prototype,{CONNECTING:o,OPEN:o,CLOSING:o,CLOSED:o,url:D,readyState:D,bufferedAmount:D,onopen:D,onerror:D,onclose:D,close:D,onmessage:D,binaryType:D,send:D,extensions:D,protocol:D,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(v,{CONNECTING:o,OPEN:o,CLOSING:o,CLOSED:o}),r.converters["sequence<DOMString>"]=r.sequenceConverter(r.converters.DOMString),r.converters["DOMString or sequence<DOMString>"]=function(e,t,A){return r.util.Type(e)===r.util.Types.OBJECT&&Symbol.iterator in e?r.converters["sequence<DOMString>"](e):r.converters.DOMString(e,t,A)},r.converters.WebSocketInit=r.dictionaryConverter([{key:"protocols",converter:r.converters["DOMString or sequence<DOMString>"],defaultValue:()=>[]},{key:"dispatcher",converter:r.converters.any,defaultValue:()=>w()},{key:"headers",converter:r.nullableConverter(r.converters.HeadersInit)}]),r.converters["DOMString or sequence<DOMString> or WebSocketInit"]=function(e){return r.util.Type(e)!==r.util.Types.OBJECT||Symbol.iterator in e?{protocols:r.converters["DOMString or sequence<DOMString>"](e)}:r.converters.WebSocketInit(e)},r.converters.WebSocketSendData=function(e){if(r.util.Type(e)===r.util.Types.OBJECT){if(r.is.Blob(e))return e;if(r.is.BufferSource(e))return e}return r.converters.USVString(e)},e.exports={WebSocket:v,ping:M}},7562:function(e,t,A){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,A,s){void 0===s&&(s=A);var r=Object.getOwnPropertyDescriptor(t,A);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[A]}}),Object.defineProperty(e,s,r)}:function(e,t,A,s){void 0===s&&(s=A),e[s]=t[A]}),r=this&&this.__exportStar||function(e,t){for(var A in e)"default"===A||Object.prototype.hasOwnProperty.call(t,A)||s(t,e,A)};Object.defineProperty(t,"__esModule",{value:!0}),t.sdk=t.MixinDeviceBase=t.ScryptedDeviceBase=void 0,r(A(4192),t);const n=A(4192);A(3339);class i extends n.DeviceBase{constructor(e){super(),this.nativeId=e}get storage(){return this._storage||(this._storage=t.sdk.deviceManager.getDeviceStorage(this.nativeId)),this._storage}get log(){return this._log||(this._log=t.sdk.deviceManager.getDeviceLogger(this.nativeId)),this._log}get console(){return this._console||(this._console=t.sdk.deviceManager.getDeviceConsole(this.nativeId)),this._console}async createMediaObject(e,A){return t.sdk.mediaManager.createMediaObject(e,A,{sourceId:this.id})}getMediaObjectConsole(e){return"string"!=typeof e.sourceId?this.console:t.sdk.deviceManager.getMixinConsole(e.sourceId,this.nativeId)}_lazyLoadDeviceState(){this._deviceState||(this.nativeId?this._deviceState=t.sdk.deviceManager.getDeviceState(this.nativeId):this._deviceState=t.sdk.deviceManager.getDeviceState())}onDeviceEvent(e,A){return t.sdk.deviceManager.onDeviceEvent(this.nativeId,e,A)}}t.ScryptedDeviceBase=i;class o extends n.DeviceBase{constructor(e){super(),this._listeners=new Set,this.mixinDevice=e.mixinDevice,this.mixinDeviceInterfaces=e.mixinDeviceInterfaces,this.mixinStorageSuffix=e.mixinStorageSuffix,this._deviceState=e.mixinDeviceState,this.nativeId=t.sdk.systemManager.getDeviceById(this.id).nativeId,this.mixinProviderNativeId=e.mixinProviderNativeId,this._deviceState.__rpcproxy_traps_all_properties&&"string"==typeof this._deviceState.id&&(this._deviceState=t.sdk.deviceManager.createDeviceState(this._deviceState.id,this._deviceState.setState))}get storage(){if(!this._storage){const e=this.mixinStorageSuffix,A=this.id+(e?":"+e:"");this._storage=t.sdk.deviceManager.getMixinStorage(A,this.mixinProviderNativeId)}return this._storage}get console(){return this._console||(t.sdk.deviceManager.getMixinConsole?this._console=t.sdk.deviceManager.getMixinConsole(this.id,this.mixinProviderNativeId):this._console=t.sdk.deviceManager.getDeviceConsole(this.mixinProviderNativeId)),this._console}async createMediaObject(e,A){return t.sdk.mediaManager.createMediaObject(e,A,{sourceId:this.id})}getMediaObjectConsole(e){return"string"!=typeof e.sourceId?this.console:t.sdk.deviceManager.getMixinConsole(e.sourceId,this.mixinProviderNativeId)}onDeviceEvent(e,A){return t.sdk.deviceManager.onMixinEvent(this.id,this,e,A)}_lazyLoadDeviceState(){}manageListener(e){this._listeners.add(e)}release(){for(const e of this._listeners)e.removeListener()}}t.MixinDeviceBase=o,function(){function e(e){return function(){return this._lazyLoadDeviceState(),this._deviceState?.[e]}}function t(e){return function(t){this._lazyLoadDeviceState(),this._deviceState?this._deviceState[e]=t:console.warn("device state is unavailable. the device must be discovered with deviceManager.onDeviceDiscovered or deviceManager.onDevicesChanged before the state can be set.")}}for(const A of Object.values(n.ScryptedInterfaceProperty))A!==n.ScryptedInterfaceProperty.nativeId&&(Object.defineProperty(i.prototype,A,{set:t(A),get:e(A)}),Object.defineProperty(o.prototype,A,{set:t(A),get:e(A)}))}(),t.sdk={};try{let e=!1;try{process.env.SCRYPTED_SDK_ES_MODULE||process.env.SCRYPTED_SDK_MODULE;const s=process.env.SCRYPTED_SDK_CJS_MODULE||process.env.SCRYPTED_SDK_MODULE;if(s)if("undefined"!=typeof require){const A=require(process.env.SCRYPTED_SDK_MODULE);Object.assign(t.sdk,A.getScryptedStatic()),e=!0}else{const r=A(3891)(s);Object.assign(t.sdk,r.getScryptedStatic()),e=!0}}catch(e){throw console.warn("failed to load sdk module",e),e}if(!e){let e;try{e=pluginRuntimeAPI}catch(e){}Object.assign(t.sdk,{log:deviceManager.getDeviceLogger(void 0),deviceManager,endpointManager,mediaManager,systemManager,pluginHostAPI,...e})}try{t.sdk.systemManager.setScryptedInterfaceDescriptors?.(n.TYPES_VERSION,n.ScryptedInterfaceDescriptors)?.catch((()=>{}))}catch(e){}}catch(e){console.error("sdk initialization error, import @scrypted/types or use @scrypted/client instead",e)}t.default=t.sdk},6117:function(e,t,A){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,A,s){void 0===s&&(s=A);var r=Object.getOwnPropertyDescriptor(t,A);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[A]}}),Object.defineProperty(e,s,r)}:function(e,t,A,s){void 0===s&&(s=A),e[s]=t[A]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var A in e)"default"!==A&&Object.prototype.hasOwnProperty.call(e,A)&&s(t,e,A);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.StorageSettings=void 0;const i=n(A(7562)),{systemManager:o}=i.default;t.StorageSettings=class{constructor(e,t){this.device=e,this.settings=t,this.values={},this.hasValue={};for(const e of Object.keys(t)){const A=t[e],s=()=>this.getItem(e);let r;r="clippath"!==A.type?s:()=>{try{return JSON.parse(s())}catch(e){}},Object.defineProperty(this.values,e,{get:r,set:t=>this.putSetting(e,t),enumerable:!0}),Object.defineProperty(this.hasValue,e,{get:()=>null!=this.device.storage.getItem(e),enumerable:!0})}}get keys(){const e={};for(const t of Object.keys(this.settings))e[t]=t;return e}async getSettings(){const e=await(this.options?.onGet?.()),t=[];for(const[A,s]of Object.entries(this.settings)){let r=Object.assign({},s);e?.[A]&&(r=Object.assign(r,e[A])),r.onGet&&(r=Object.assign(r,await r.onGet())),r.hide||await(this.options?.hide?.[A]?.())||(r.key=A,r.value=this.getItemInternal(A,r,!0),"function"==typeof r.deviceFilter&&(r.deviceFilter=r.deviceFilter.toString()),t.push(r),delete r.onPut,delete r.onGet,delete r.mapPut,delete r.mapGet)}return t}async putSetting(e,t){const A=this.settings[e];let s;return A&&(s=this.getItemInternal(e,A)),this.putSettingInternal(A,s,e,t)}putSettingInternal(e,t,A,s){e?.noStore||(e?.mapPut&&(s=e.mapPut(t,s)),null==s?this.device.storage.removeItem(A):"object"==typeof s?this.device.storage.setItem(A,JSON.stringify(s)):this.device.storage.setItem(A,s?.toString())),e?.onPut?.(t,s),e?.hide||this.device.onDeviceEvent(i.ScryptedInterface.Settings,void 0)}getItemInternal(e,t,A){if(!t)return this.device.storage.getItem(e);const s=function(e,t,A,s){if(null==e)return A();const r=t.multiple?"array":t.type;if("boolean"===r)return"true"===e||"false"!==e&&(A()||!1);if("number"===r){const t=parseFloat(e);return isNaN(t)?A()||0:t}if("integer"===r){const t=parseInt(e);return isNaN(t)?A()||0:t}if("array"===r){if(!e)return A()||[];try{return JSON.parse(e)}catch(e){return A()||[]}}if("device"===r)return s?e:o.getDeviceById(e)||o.getDeviceById(A());if(e&&t.json)try{return JSON.parse(e)}catch(e){return A()}return e||A()}(this.device.storage.getItem(e),t,(()=>null!=t.persistedDefaultValue?(this.putSettingInternal(t,void 0,e,t.persistedDefaultValue),t.persistedDefaultValue):t.defaultValue),A);return t.mapGet?t.mapGet(s):s}getItem(e){return this.getItemInternal(e,this.settings[e])}}},3891:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=3891,e.exports=t},4192:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScryptedMimeTypes=t.ScryptedInterface=t.MediaPlayerState=t.SecuritySystemObstruction=t.SecuritySystemMode=t.AirQuality=t.AirPurifierMode=t.AirPurifierStatus=t.ChargeState=t.LockState=t.PanTiltZoomMovement=t.ThermostatMode=t.TemperatureUnit=t.FanMode=t.HumidityMode=t.ScryptedDeviceType=t.ScryptedInterfaceDescriptors=t.ScryptedInterfaceMethod=t.ScryptedInterfaceProperty=t.DeviceBase=t.TYPES_VERSION=void 0,t.TYPES_VERSION="0.3.108";var A,s,r,n,i,o,a,c,l,h,g,d,u,E,I,Q,C,B;t.DeviceBase=class{},function(e){e.id="id",e.info="info",e.interfaces="interfaces",e.mixins="mixins",e.name="name",e.nativeId="nativeId",e.pluginId="pluginId",e.providedInterfaces="providedInterfaces",e.providedName="providedName",e.providedRoom="providedRoom",e.providedType="providedType",e.providerId="providerId",e.room="room",e.type="type",e.scryptedRuntimeArguments="scryptedRuntimeArguments",e.on="on",e.brightness="brightness",e.colorTemperature="colorTemperature",e.rgb="rgb",e.hsv="hsv",e.buttons="buttons",e.sensors="sensors",e.running="running",e.paused="paused",e.docked="docked",e.temperatureSetting="temperatureSetting",e.temperature="temperature",e.temperatureUnit="temperatureUnit",e.humidity="humidity",e.audioVolumes="audioVolumes",e.recordingActive="recordingActive",e.ptzCapabilities="ptzCapabilities",e.lockState="lockState",e.entryOpen="entryOpen",e.batteryLevel="batteryLevel",e.chargeState="chargeState",e.online="online",e.fromMimeType="fromMimeType",e.toMimeType="toMimeType",e.converters="converters",e.binaryState="binaryState",e.tampered="tampered",e.sleeping="sleeping",e.powerDetected="powerDetected",e.audioDetected="audioDetected",e.motionDetected="motionDetected",e.ambientLight="ambientLight",e.occupied="occupied",e.flooded="flooded",e.ultraviolet="ultraviolet",e.luminance="luminance",e.position="position",e.securitySystemState="securitySystemState",e.pm10Density="pm10Density",e.pm25Density="pm25Density",e.vocDensity="vocDensity",e.noxDensity="noxDensity",e.co2ppm="co2ppm",e.airQuality="airQuality",e.airPurifierState="airPurifierState",e.filterChangeIndication="filterChangeIndication",e.filterLifeLevel="filterLifeLevel",e.humiditySetting="humiditySetting",e.fan="fan",e.applicationInfo="applicationInfo",e.systemDevice="systemDevice"}(A||(t.ScryptedInterfaceProperty=A={})),function(e){e.listen="listen",e.probe="probe",e.setMixins="setMixins",e.setName="setName",e.setRoom="setRoom",e.setType="setType",e.getPluginJson="getPluginJson",e.turnOff="turnOff",e.turnOn="turnOn",e.setBrightness="setBrightness",e.getTemperatureMaxK="getTemperatureMaxK",e.getTemperatureMinK="getTemperatureMinK",e.setColorTemperature="setColorTemperature",e.setRgb="setRgb",e.setHsv="setHsv",e.pressButton="pressButton",e.sendNotification="sendNotification",e.start="start",e.stop="stop",e.pause="pause",e.resume="resume",e.dock="dock",e.setTemperature="setTemperature",e.setTemperatureUnit="setTemperatureUnit",e.getPictureOptions="getPictureOptions",e.takePicture="takePicture",e.getAudioStream="getAudioStream",e.setAudioVolumes="setAudioVolumes",e.startDisplay="startDisplay",e.stopDisplay="stopDisplay",e.getVideoStream="getVideoStream",e.getVideoStreamOptions="getVideoStreamOptions",e.getPrivacyMasks="getPrivacyMasks",e.setPrivacyMasks="setPrivacyMasks",e.getVideoTextOverlays="getVideoTextOverlays",e.setVideoTextOverlay="setVideoTextOverlay",e.getRecordingStream="getRecordingStream",e.getRecordingStreamCurrentTime="getRecordingStreamCurrentTime",e.getRecordingStreamOptions="getRecordingStreamOptions",e.getRecordingStreamThumbnail="getRecordingStreamThumbnail",e.deleteRecordingStream="deleteRecordingStream",e.setRecordingActive="setRecordingActive",e.ptzCommand="ptzCommand",e.getRecordedEvents="getRecordedEvents",e.getVideoClip="getVideoClip",e.getVideoClips="getVideoClips",e.getVideoClipThumbnail="getVideoClipThumbnail",e.removeVideoClips="removeVideoClips",e.setVideoStreamOptions="setVideoStreamOptions",e.startIntercom="startIntercom",e.stopIntercom="stopIntercom",e.lock="lock",e.unlock="unlock",e.addPassword="addPassword",e.getPasswords="getPasswords",e.removePassword="removePassword",e.activate="activate",e.deactivate="deactivate",e.isReversible="isReversible",e.closeEntry="closeEntry",e.openEntry="openEntry",e.getDevice="getDevice",e.releaseDevice="releaseDevice",e.adoptDevice="adoptDevice",e.discoverDevices="discoverDevices",e.createDevice="createDevice",e.getCreateDeviceSettings="getCreateDeviceSettings",e.reboot="reboot",e.getRefreshFrequency="getRefreshFrequency",e.refresh="refresh",e.getMediaStatus="getMediaStatus",e.load="load",e.seek="seek",e.skipNext="skipNext",e.skipPrevious="skipPrevious",e.convert="convert",e.convertMedia="convertMedia",e.getSettings="getSettings",e.putSetting="putSetting",e.armSecuritySystem="armSecuritySystem",e.disarmSecuritySystem="disarmSecuritySystem",e.setAirPurifierState="setAirPurifierState",e.getReadmeMarkdown="getReadmeMarkdown",e.getOauthUrl="getOauthUrl",e.onOauthCallback="onOauthCallback",e.canMixin="canMixin",e.getMixin="getMixin",e.releaseMixin="releaseMixin",e.onRequest="onRequest",e.onConnection="onConnection",e.onPush="onPush",e.run="run",e.eval="eval",e.loadScripts="loadScripts",e.saveScript="saveScript",e.forkInterface="forkInterface",e.trackObjects="trackObjects",e.getDetectionInput="getDetectionInput",e.getObjectTypes="getObjectTypes",e.detectObjects="detectObjects",e.generateObjectDetections="generateObjectDetections",e.getDetectionModel="getDetectionModel",e.setHumidity="setHumidity",e.setFan="setFan",e.startRTCSignalingSession="startRTCSignalingSession",e.createRTCSignalingSession="createRTCSignalingSession",e.getScryptedUserAccessControl="getScryptedUserAccessControl",e.generateVideoFrames="generateVideoFrames",e.connectStream="connectStream",e.getTTYSettings="getTTYSettings"}(s||(t.ScryptedInterfaceMethod=s={})),t.ScryptedInterfaceDescriptors={ScryptedDevice:{name:"ScryptedDevice",methods:["listen","probe","setMixins","setName","setRoom","setType"],properties:["id","info","interfaces","mixins","name","nativeId","pluginId","providedInterfaces","providedName","providedRoom","providedType","providerId","room","type"]},ScryptedPlugin:{name:"ScryptedPlugin",methods:["getPluginJson"],properties:[]},ScryptedPluginRuntime:{name:"ScryptedPluginRuntime",methods:[],properties:["scryptedRuntimeArguments"]},OnOff:{name:"OnOff",methods:["turnOff","turnOn"],properties:["on"]},Brightness:{name:"Brightness",methods:["setBrightness"],properties:["brightness"]},ColorSettingTemperature:{name:"ColorSettingTemperature",methods:["getTemperatureMaxK","getTemperatureMinK","setColorTemperature"],properties:["colorTemperature"]},ColorSettingRgb:{name:"ColorSettingRgb",methods:["setRgb"],properties:["rgb"]},ColorSettingHsv:{name:"ColorSettingHsv",methods:["setHsv"],properties:["hsv"]},Buttons:{name:"Buttons",methods:[],properties:["buttons"]},PressButtons:{name:"PressButtons",methods:["pressButton"],properties:[]},Sensors:{name:"Sensors",methods:[],properties:["sensors"]},Notifier:{name:"Notifier",methods:["sendNotification"],properties:[]},StartStop:{name:"StartStop",methods:["start","stop"],properties:["running"]},Pause:{name:"Pause",methods:["pause","resume"],properties:["paused"]},Dock:{name:"Dock",methods:["dock"],properties:["docked"]},TemperatureSetting:{name:"TemperatureSetting",methods:["setTemperature"],properties:["temperatureSetting"]},Thermometer:{name:"Thermometer",methods:["setTemperatureUnit"],properties:["temperature","temperatureUnit"]},HumiditySensor:{name:"HumiditySensor",methods:[],properties:["humidity"]},Camera:{name:"Camera",methods:["getPictureOptions","takePicture"],properties:[]},Microphone:{name:"Microphone",methods:["getAudioStream"],properties:[]},AudioVolumeControl:{name:"AudioVolumeControl",methods:["setAudioVolumes"],properties:["audioVolumes"]},Display:{name:"Display",methods:["startDisplay","stopDisplay"],properties:[]},VideoCamera:{name:"VideoCamera",methods:["getVideoStream","getVideoStreamOptions"],properties:[]},VideoCameraMask:{name:"VideoCameraMask",methods:["getPrivacyMasks","setPrivacyMasks"],properties:[]},VideoTextOverlays:{name:"VideoTextOverlays",methods:["getVideoTextOverlays","setVideoTextOverlay"],properties:[]},VideoRecorder:{name:"VideoRecorder",methods:["getRecordingStream","getRecordingStreamCurrentTime","getRecordingStreamOptions","getRecordingStreamThumbnail"],properties:["recordingActive"]},VideoRecorderManagement:{name:"VideoRecorderManagement",methods:["deleteRecordingStream","setRecordingActive"],properties:[]},PanTiltZoom:{name:"PanTiltZoom",methods:["ptzCommand"],properties:["ptzCapabilities"]},EventRecorder:{name:"EventRecorder",methods:["getRecordedEvents"],properties:[]},VideoClips:{name:"VideoClips",methods:["getVideoClip","getVideoClips","getVideoClipThumbnail","removeVideoClips"],properties:[]},VideoCameraConfiguration:{name:"VideoCameraConfiguration",methods:["setVideoStreamOptions"],properties:[]},Intercom:{name:"Intercom",methods:["startIntercom","stopIntercom"],properties:[]},Lock:{name:"Lock",methods:["lock","unlock"],properties:["lockState"]},PasswordStore:{name:"PasswordStore",methods:["addPassword","getPasswords","removePassword"],properties:[]},Scene:{name:"Scene",methods:["activate","deactivate","isReversible"],properties:[]},Entry:{name:"Entry",methods:["closeEntry","openEntry"],properties:[]},EntrySensor:{name:"EntrySensor",methods:[],properties:["entryOpen"]},DeviceProvider:{name:"DeviceProvider",methods:["getDevice","releaseDevice"],properties:[]},DeviceDiscovery:{name:"DeviceDiscovery",methods:["adoptDevice","discoverDevices"],properties:[]},DeviceCreator:{name:"DeviceCreator",methods:["createDevice","getCreateDeviceSettings"],properties:[]},Battery:{name:"Battery",methods:[],properties:["batteryLevel"]},Charger:{name:"Charger",methods:[],properties:["chargeState"]},Reboot:{name:"Reboot",methods:["reboot"],properties:[]},Refresh:{name:"Refresh",methods:["getRefreshFrequency","refresh"],properties:[]},MediaPlayer:{name:"MediaPlayer",methods:["getMediaStatus","load","seek","skipNext","skipPrevious"],properties:[]},Online:{name:"Online",methods:[],properties:["online"]},BufferConverter:{name:"BufferConverter",methods:["convert"],properties:["fromMimeType","toMimeType"]},MediaConverter:{name:"MediaConverter",methods:["convertMedia"],properties:["converters"]},Settings:{name:"Settings",methods:["getSettings","putSetting"],properties:[]},BinarySensor:{name:"BinarySensor",methods:[],properties:["binaryState"]},TamperSensor:{name:"TamperSensor",methods:[],properties:["tampered"]},Sleep:{name:"Sleep",methods:[],properties:["sleeping"]},PowerSensor:{name:"PowerSensor",methods:[],properties:["powerDetected"]},AudioSensor:{name:"AudioSensor",methods:[],properties:["audioDetected"]},MotionSensor:{name:"MotionSensor",methods:[],properties:["motionDetected"]},AmbientLightSensor:{name:"AmbientLightSensor",methods:[],properties:["ambientLight"]},OccupancySensor:{name:"OccupancySensor",methods:[],properties:["occupied"]},FloodSensor:{name:"FloodSensor",methods:[],properties:["flooded"]},UltravioletSensor:{name:"UltravioletSensor",methods:[],properties:["ultraviolet"]},LuminanceSensor:{name:"LuminanceSensor",methods:[],properties:["luminance"]},PositionSensor:{name:"PositionSensor",methods:[],properties:["position"]},SecuritySystem:{name:"SecuritySystem",methods:["armSecuritySystem","disarmSecuritySystem"],properties:["securitySystemState"]},PM10Sensor:{name:"PM10Sensor",methods:[],properties:["pm10Density"]},PM25Sensor:{name:"PM25Sensor",methods:[],properties:["pm25Density"]},VOCSensor:{name:"VOCSensor",methods:[],properties:["vocDensity"]},NOXSensor:{name:"NOXSensor",methods:[],properties:["noxDensity"]},CO2Sensor:{name:"CO2Sensor",methods:[],properties:["co2ppm"]},AirQualitySensor:{name:"AirQualitySensor",methods:[],properties:["airQuality"]},AirPurifier:{name:"AirPurifier",methods:["setAirPurifierState"],properties:["airPurifierState"]},FilterMaintenance:{name:"FilterMaintenance",methods:[],properties:["filterChangeIndication","filterLifeLevel"]},Readme:{name:"Readme",methods:["getReadmeMarkdown"],properties:[]},OauthClient:{name:"OauthClient",methods:["getOauthUrl","onOauthCallback"],properties:[]},MixinProvider:{name:"MixinProvider",methods:["canMixin","getMixin","releaseMixin"],properties:[]},HttpRequestHandler:{name:"HttpRequestHandler",methods:["onRequest"],properties:[]},EngineIOHandler:{name:"EngineIOHandler",methods:["onConnection"],properties:[]},PushHandler:{name:"PushHandler",methods:["onPush"],properties:[]},Program:{name:"Program",methods:["run"],properties:[]},Scriptable:{name:"Scriptable",methods:["eval","loadScripts","saveScript"],properties:[]},ClusterForkInterface:{name:"ClusterForkInterface",methods:["forkInterface"],properties:[]},ObjectTracker:{name:"ObjectTracker",methods:["trackObjects"],properties:[]},ObjectDetector:{name:"ObjectDetector",methods:["getDetectionInput","getObjectTypes"],properties:[]},ObjectDetection:{name:"ObjectDetection",methods:["detectObjects","generateObjectDetections","getDetectionModel"],properties:[]},ObjectDetectionPreview:{name:"ObjectDetectionPreview",methods:[],properties:[]},ObjectDetectionGenerator:{name:"ObjectDetectionGenerator",methods:[],properties:[]},HumiditySetting:{name:"HumiditySetting",methods:["setHumidity"],properties:["humiditySetting"]},Fan:{name:"Fan",methods:["setFan"],properties:["fan"]},RTCSignalingChannel:{name:"RTCSignalingChannel",methods:["startRTCSignalingSession"],properties:[]},RTCSignalingClient:{name:"RTCSignalingClient",methods:["createRTCSignalingSession"],properties:[]},LauncherApplication:{name:"LauncherApplication",methods:[],properties:["applicationInfo"]},ScryptedUser:{name:"ScryptedUser",methods:["getScryptedUserAccessControl"],properties:[]},VideoFrameGenerator:{name:"VideoFrameGenerator",methods:["generateVideoFrames"],properties:[]},StreamService:{name:"StreamService",methods:["connectStream"],properties:[]},TTY:{name:"TTY",methods:[],properties:[]},TTYSettings:{name:"TTYSettings",methods:["getTTYSettings"],properties:[]},ScryptedSystemDevice:{name:"ScryptedSystemDevice",methods:[],properties:["systemDevice"]},ScryptedDeviceCreator:{name:"ScryptedDeviceCreator",methods:[],properties:[]},ScryptedSettings:{name:"ScryptedSettings",methods:[],properties:[]}},function(e){e.Builtin="Builtin",e.Camera="Camera",e.Fan="Fan",e.Light="Light",e.Switch="Switch",e.Outlet="Outlet",e.Sensor="Sensor",e.Scene="Scene",e.Program="Program",e.Automation="Automation",e.Vacuum="Vacuum",e.Notifier="Notifier",e.Thermostat="Thermostat",e.Lock="Lock",e.PasswordControl="PasswordControl",e.Display="Display",e.SmartDisplay="SmartDisplay",e.Speaker="Speaker",e.SmartSpeaker="SmartSpeaker",e.Event="Event",e.Entry="Entry",e.Garage="Garage",e.DeviceProvider="DeviceProvider",e.DataSource="DataSource",e.API="API",e.Doorbell="Doorbell",e.Irrigation="Irrigation",e.Valve="Valve",e.Person="Person",e.SecuritySystem="SecuritySystem",e.WindowCovering="WindowCovering",e.Siren="Siren",e.AirPurifier="AirPurifier",e.Unknown="Unknown"}(r||(t.ScryptedDeviceType=r={})),function(e){e.Humidify="Humidify",e.Dehumidify="Dehumidify",e.Auto="Auto",e.Off="Off"}(n||(t.HumidityMode=n={})),function(e){e.Auto="Auto",e.Manual="Manual"}(i||(t.FanMode=i={})),function(e){e.C="C",e.F="F"}(o||(t.TemperatureUnit=o={})),function(e){e.Off="Off",e.Cool="Cool",e.Heat="Heat",e.HeatCool="HeatCool",e.Auto="Auto",e.FanOnly="FanOnly",e.Purifier="Purifier",e.Eco="Eco",e.Dry="Dry",e.On="On"}(a||(t.ThermostatMode=a={})),function(e){e.Absolute="Absolute",e.Relative="Relative",e.Continuous="Continuous",e.Preset="Preset",e.Home="Home"}(c||(t.PanTiltZoomMovement=c={})),function(e){e.Locked="Locked",e.Unlocked="Unlocked",e.Jammed="Jammed"}(l||(t.LockState=l={})),function(e){e.Trickle="trickle",e.Charging="charging",e.NotCharging="not-charging"}(h||(t.ChargeState=h={})),function(e){e.Inactive="Inactive",e.Idle="Idle",e.Active="Active",e.ActiveNightMode="ActiveNightMode"}(g||(t.AirPurifierStatus=g={})),function(e){e.Manual="Manual",e.Automatic="Automatic"}(d||(t.AirPurifierMode=d={})),function(e){e.Unknown="Unknown",e.Excellent="Excellent",e.Good="Good",e.Fair="Fair",e.Inferior="Inferior",e.Poor="Poor"}(u||(t.AirQuality=u={})),function(e){e.Disarmed="Disarmed",e.HomeArmed="HomeArmed",e.AwayArmed="AwayArmed",e.NightArmed="NightArmed"}(E||(t.SecuritySystemMode=E={})),function(e){e.Sensor="Sensor",e.Occupied="Occupied",e.Time="Time",e.Error="Error"}(I||(t.SecuritySystemObstruction=I={})),function(e){e.Idle="Idle",e.Playing="Playing",e.Paused="Paused",e.Buffering="Buffering"}(Q||(t.MediaPlayerState=Q={})),function(e){e.ScryptedDevice="ScryptedDevice",e.ScryptedPlugin="ScryptedPlugin",e.ScryptedPluginRuntime="ScryptedPluginRuntime",e.OnOff="OnOff",e.Brightness="Brightness",e.ColorSettingTemperature="ColorSettingTemperature",e.ColorSettingRgb="ColorSettingRgb",e.ColorSettingHsv="ColorSettingHsv",e.Buttons="Buttons",e.PressButtons="PressButtons",e.Sensors="Sensors",e.Notifier="Notifier",e.StartStop="StartStop",e.Pause="Pause",e.Dock="Dock",e.TemperatureSetting="TemperatureSetting",e.Thermometer="Thermometer",e.HumiditySensor="HumiditySensor",e.Camera="Camera",e.Microphone="Microphone",e.AudioVolumeControl="AudioVolumeControl",e.Display="Display",e.VideoCamera="VideoCamera",e.VideoCameraMask="VideoCameraMask",e.VideoTextOverlays="VideoTextOverlays",e.VideoRecorder="VideoRecorder",e.VideoRecorderManagement="VideoRecorderManagement",e.PanTiltZoom="PanTiltZoom",e.EventRecorder="EventRecorder",e.VideoClips="VideoClips",e.VideoCameraConfiguration="VideoCameraConfiguration",e.Intercom="Intercom",e.Lock="Lock",e.PasswordStore="PasswordStore",e.Scene="Scene",e.Entry="Entry",e.EntrySensor="EntrySensor",e.DeviceProvider="DeviceProvider",e.DeviceDiscovery="DeviceDiscovery",e.DeviceCreator="DeviceCreator",e.Battery="Battery",e.Charger="Charger",e.Reboot="Reboot",e.Refresh="Refresh",e.MediaPlayer="MediaPlayer",e.Online="Online",e.BufferConverter="BufferConverter",e.MediaConverter="MediaConverter",e.Settings="Settings",e.BinarySensor="BinarySensor",e.TamperSensor="TamperSensor",e.Sleep="Sleep",e.PowerSensor="PowerSensor",e.AudioSensor="AudioSensor",e.MotionSensor="MotionSensor",e.AmbientLightSensor="AmbientLightSensor",e.OccupancySensor="OccupancySensor",e.FloodSensor="FloodSensor",e.UltravioletSensor="UltravioletSensor",e.LuminanceSensor="LuminanceSensor",e.PositionSensor="PositionSensor",e.SecuritySystem="SecuritySystem",e.PM10Sensor="PM10Sensor",e.PM25Sensor="PM25Sensor",e.VOCSensor="VOCSensor",e.NOXSensor="NOXSensor",e.CO2Sensor="CO2Sensor",e.AirQualitySensor="AirQualitySensor",e.AirPurifier="AirPurifier",e.FilterMaintenance="FilterMaintenance",e.Readme="Readme",e.OauthClient="OauthClient",e.MixinProvider="MixinProvider",e.HttpRequestHandler="HttpRequestHandler",e.EngineIOHandler="EngineIOHandler",e.PushHandler="PushHandler",e.Program="Program",e.Scriptable="Scriptable",e.ClusterForkInterface="ClusterForkInterface",e.ObjectTracker="ObjectTracker",e.ObjectDetector="ObjectDetector",e.ObjectDetection="ObjectDetection",e.ObjectDetectionPreview="ObjectDetectionPreview",e.ObjectDetectionGenerator="ObjectDetectionGenerator",e.HumiditySetting="HumiditySetting",e.Fan="Fan",e.RTCSignalingChannel="RTCSignalingChannel",e.RTCSignalingClient="RTCSignalingClient",e.LauncherApplication="LauncherApplication",e.ScryptedUser="ScryptedUser",e.VideoFrameGenerator="VideoFrameGenerator",e.StreamService="StreamService",e.TTY="TTY",e.TTYSettings="TTYSettings",e.ScryptedSystemDevice="ScryptedSystemDevice",e.ScryptedDeviceCreator="ScryptedDeviceCreator",e.ScryptedSettings="ScryptedSettings"}(C||(t.ScryptedInterface=C={})),function(e){e.Url="text/x-uri",e.InsecureLocalUrl="text/x-insecure-local-uri",e.LocalUrl="text/x-local-uri",e.ServerId="text/x-server-id",e.PushEndpoint="text/x-push-endpoint",e.SchemePrefix="x-scrypted/x-scrypted-scheme-",e.MediaStreamUrl="text/x-media-url",e.MediaObject="x-scrypted/x-scrypted-media-object",e.RequestMediaObject="x-scrypted/x-scrypted-request-media-object",e.RequestMediaStream="x-scrypted/x-scrypted-request-stream",e.MediaStreamFeedback="x-scrypted/x-media-stream-feedback",e.FFmpegInput="x-scrypted/x-ffmpeg-input",e.FFmpegTranscodeStream="x-scrypted/x-ffmpeg-transcode-stream",e.RTCSignalingChannel="x-scrypted/x-scrypted-rtc-signaling-channel",e.RTCSignalingSession="x-scrypted/x-scrypted-rtc-signaling-session",e.RTCConnectionManagement="x-scrypted/x-scrypted-rtc-connection-management",e.Image="x-scrypted/x-scrypted-image"}(B||(t.ScryptedMimeTypes=B={}))},6125:function(e,t,A){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ReolinkNativeBatteryCamera=void 0;const r=s(A(7562)),n=A(8799),i=A(9560);class o extends n.CommonCameraMixin{isBatteryInfoLoggingEnabled(){return(this.storageSettings.values.debugLogs||[]).includes(i.DebugLogOption.BatteryInfo)}constructor(e,t){super(e,t,{type:"battery"}),this.plugin=t,this.motionDetected=!1,this.periodicStarted=!1,this.forceNewSnapshot=!1,this.batteryUpdateInProgress=!1}async takePicture(e){const{snapshotCacheMinutes:t=5}=this.storageSettings.values,A=6e4*t;if(!this.forceNewSnapshot&&A>0&&this.lastPicture&&Date.now()-this.lastPicture.atMs<A)return this.console.log(`Returning cached snapshot, taken at ${new Date(this.lastPicture.atMs).toLocaleString()}`),this.lastPicture.mo;if(this.takePictureInFlight)return await this.takePictureInFlight;this.console.log(`Taking new snapshot from camera (forceNewSnapshot: ${this.forceNewSnapshot})`),this.forceNewSnapshot=!1,this.takePictureInFlight=(async()=>{const e=this.getRtspChannel(),t=await this.withBaichuanClient((async t=>await t.getSnapshot(e))),A=await r.default.mediaManager.createMediaObject(t,"image/jpeg");return this.lastPicture={mo:A,atMs:Date.now()},this.console.log(`Snapshot taken at ${new Date(this.lastPicture.atMs).toLocaleString()}`),A})();try{return await this.takePictureInFlight}finally{this.takePictureInFlight=void 0}}async getPictureOptions(){return[]}async init(){this.startPeriodicTasks(),await this.alignAuxDevicesState()}async release(){return this.stopPeriodicTasks(),this.resetBaichuanClient()}stopPeriodicTasks(){this.sleepCheckTimer&&(clearInterval(this.sleepCheckTimer),this.sleepCheckTimer=void 0),this.batteryUpdateTimer&&(clearInterval(this.batteryUpdateTimer),this.batteryUpdateTimer=void 0),this.periodicStarted=!1}startPeriodicTasks(){if(this.periodicStarted)return;this.periodicStarted=!0,this.console.log("Starting periodic tasks for battery camera"),this.sleepCheckTimer=setInterval((()=>{this.checkSleepingState().catch((()=>{}))}),5e3);const{batteryUpdateIntervalMinutes:e=10}=this.storageSettings.values,t=6e4*e;this.batteryUpdateTimer=setInterval((()=>{this.updateBatteryAndSnapshot().catch((()=>{}))}),t),this.console.log(`Periodic tasks started: sleep check every 5s, battery update every ${e} minutes`)}async checkSleepingState(){try{const e=this.baichuanApi,t=this.getRtspChannel();if(!e)return void(this.sleeping||(this.console.log("Camera is sleeping: no active Baichuan client"),this.sleeping=!0));const A=e.getSleepStatus({channel:t});if(this.isBatteryInfoLoggingEnabled()&&this.console.log("getSleepStatus result:",JSON.stringify(A)),"sleeping"===A.state)this.sleeping||(this.console.log(`Camera is sleeping: ${A.reason}`),this.sleeping=!0);else if("awake"===A.state){const e=this.sleeping;e&&(this.console.log(`Camera woke up: ${A.reason}`),this.sleeping=!1),e&&(this.alignAuxDevicesState().catch((()=>{})),this.forceNewSnapshot&&this.takePicture().catch((()=>{})))}else this.console.debug(`Sleep status unknown: ${A.reason}`)}catch(e){this.console.debug("Error in checkSleepingState:",e)}}async updateBatteryAndSnapshot(){if(this.batteryUpdateInProgress)this.console.debug("Battery update already in progress, skipping");else{this.batteryUpdateInProgress=!0;try{const e=this.getRtspChannel(),t=this.storageSettings.values.batteryUpdateIntervalMinutes??10;this.console.log(`Force battery update interval started (every ${t} minutes)`);const A=await this.ensureClient();if(!A)return void this.console.warn("Failed to ensure client connection for battery update");let s=A.getSleepStatus({channel:e});if("sleeping"===s.state){this.console.log("Camera is sleeping, waking up for periodic update...");try{await A.wakeUp(e,{waitAfterWakeMs:2e3}),this.console.log("Wake command sent, waiting for camera to wake up...")}catch(e){return void this.console.warn("Failed to wake up camera:",e)}const t=3e4,r=Date.now();let n=!1;for(;Date.now()-r<t;)if(await new Promise((e=>setTimeout(e,1e3))),s=A.getSleepStatus({channel:e}),"awake"===s.state){n=!0,this.console.log("Camera is now awake"),this.sleeping=!1;break}if(!n)return void this.console.warn("Camera did not wake up within timeout, skipping update")}else"awake"===s.state&&(this.sleeping=!1);try{const t=await A.getBatteryInfo(e);if(this.isBatteryInfoLoggingEnabled()&&this.console.log("getBatteryInfo result:",JSON.stringify(t)),void 0!==t.batteryPercent){const e=this.lastBatteryLevel;if(this.batteryLevel=t.batteryPercent,this.lastBatteryLevel=t.batteryPercent,void 0!==e&&e!==t.batteryPercent)if(void 0!==t.chargeStatus){const A="0"===t.chargeStatus||"2"===t.chargeStatus;this.console.log(`Battery level changed: ${e}% → ${t.batteryPercent}% (charging: ${A})`)}else this.console.log(`Battery level changed: ${e}% → ${t.batteryPercent}%`);else if(void 0===e)if(void 0!==t.chargeStatus){const e="0"===t.chargeStatus||"2"===t.chargeStatus;this.console.log(`Battery level set: ${t.batteryPercent}% (charging: ${e})`)}else this.console.log(`Battery level set: ${t.batteryPercent}%`)}}catch(e){this.console.warn("Failed to get battery info during periodic update:",e)}try{await this.alignAuxDevicesState()}catch(e){this.console.warn("Failed to align auxiliary devices state:",e)}try{this.forceNewSnapshot=!0,await this.takePicture(),this.console.log("Snapshot updated during periodic update")}catch(e){this.console.warn("Failed to update snapshot during periodic update:",e)}}catch(e){this.console.warn("Failed to update battery and snapshot",e)}finally{this.batteryUpdateInProgress=!1}}}async resetBaichuanClient(e){try{if(this.unsubscribedToEvents?.(),this.streamManager){const t=e?.message||e?.toString?.()||"connection reset";await this.streamManager.closeAllStreams(t)}await(this.baichuanApi?.close())}catch(e){this.getLogger().warn("Error closing Baichuan client during reset",e)}finally{this.baichuanApi=void 0,this.connectionTime=void 0,this.ensureClientPromise=void 0,this.sleepCheckTimer&&(clearInterval(this.sleepCheckTimer),this.sleepCheckTimer=void 0),this.batteryUpdateTimer&&(clearInterval(this.batteryUpdateTimer),this.batteryUpdateTimer=void 0)}if(e){const t=e?.message||e?.toString?.()||e;this.getLogger().warn(`Baichuan client reset requested: ${t}`)}}async withBaichuanRetry(e){return await e()}async withBaichuanClient(e){return e(await this.ensureClient())}async createStreamClient(){return await this.ensureClient()}}t.ReolinkNativeBatteryCamera=o},4417:function(e,t,A){"use strict";var s,r=this&&this.__createBinding||(Object.create?function(e,t,A,s){void 0===s&&(s=A);var r=Object.getOwnPropertyDescriptor(t,A);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[A]}}),Object.defineProperty(e,s,r)}:function(e,t,A,s){void 0===s&&(s=A),e[s]=t[A]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(s=function(e){return s=Object.getOwnPropertyNames||function(e){var t=[];for(var A in e)Object.prototype.hasOwnProperty.call(e,A)&&(t[t.length]=A);return t},s(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var A=s(e),i=0;i<A.length;i++)"default"!==A[i]&&r(t,e,A[i]);return n(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.ReolinkNativeCamera=t.b64ToMo=t.moToB64=void 0;const o=i(A(7562)),a=A(8799),c=A(5098);t.moToB64=async e=>{const t=await o.default.mediaManager.convertMediaObjectToBuffer(e,"image/jpeg");return t?.toString("base64")};t.b64ToMo=async e=>{const t=Buffer.from(e,"base64");return await o.default.mediaManager.createMediaObject(t,"image/jpeg")};class l extends a.CommonCameraMixin{constructor(e,t){super(e,t,{type:"regular"}),this.plugin=t,this.initComplete=!1,this.periodicStarted=!1}async resetBaichuanClient(e){try{this.unsubscribedToEvents?.(),await(this.baichuanApi?.close())}catch(e){this.getLogger().warn("Error closing Baichuan client during reset",e)}finally{this.baichuanApi=void 0,this.connectionTime=void 0,this.ensureClientPromise=void 0,this.passiveRefreshTimer&&(clearTimeout(this.passiveRefreshTimer),this.passiveRefreshTimer=void 0)}if(e){const t=e?.message||e?.toString?.()||e;this.getLogger().warn(`Baichuan client reset requested: ${t}`)}}async withBaichuanRetry(e){try{return await e()}catch(t){if(!this.isRecoverableBaichuanError(t))throw t;await this.resetBaichuanClient(t),this.cachedNetPort=void 0;try{return await e()}catch(e){if(this.isRecoverableBaichuanError(e))throw e;throw e}}}getLogger(){return this.console}async init(){this.startPeriodicTasks(),await this.alignAuxDevicesState()}async createStreamClient(){const{ipAddress:e,username:t,password:A}=this.storageSettings.values;if(!e||!t||!A)throw new Error("Missing camera credentials");const s=this.getBaichuanDebugOptions(),r=await(0,c.createBaichuanApi)({inputs:{host:e,username:t,password:A,logger:this.console,debugOptions:s},transport:"tcp",logger:this.console});return await r.login(),r}getClient(){return this.baichuanApi}async release(){return this.statusPollTimer&&clearInterval(this.statusPollTimer),this.passiveRefreshTimer&&(clearTimeout(this.passiveRefreshTimer),this.passiveRefreshTimer=void 0),this.resetBaichuanClient()}startPeriodicTasks(){this.periodicStarted||(this.periodicStarted=!0,this.console.log("Starting periodic tasks for regular camera"),this.statusPollTimer=setInterval((()=>{this.periodic10sTick().catch((()=>{}))}),1e4),this.console.log("Periodic tasks started: status poll every 10s"))}async periodic10sTick(){await this.ensureClient(),await this.alignAuxDevicesState()}async getDetectionInput(e,t){return null}async processEvents(e){const t=this.getLogger();if(this.isEventDispatchEnabled()&&(this.storageSettings.values.dispatchEvents.includes("eventLogs")&&t.debug(`Events received: ${JSON.stringify(e)}`),this.shouldDispatchMotion()&&e.motion!==this.motionDetected&&(e.motion?(this.motionDetected=!0,this.motionTimeout&&clearTimeout(this.motionTimeout),this.motionTimeout=setTimeout((()=>this.motionDetected=!1),1e3*this.storageSettings.values.motionTimeout)):(this.motionDetected=!1,this.motionTimeout&&clearTimeout(this.motionTimeout))),this.shouldDispatchObjects()&&e.objects?.length)){const t={timestamp:Date.now(),detections:[]};for(const A of e.objects)t.detections.push({className:A,score:1});o.default.deviceManager.onDeviceEvent(this.nativeId,o.ScryptedInterface.ObjectDetector,t)}}async withBaichuanClient(e){return e(await this.ensureClient())}async takePicture(e){return this.withBaichuanRetry((async()=>{try{const e=await this.ensureClient(),t=await e.getSnapshot();return await this.createMediaObject(t,"image/jpeg")}catch(e){throw this.getLogger().error("Error taking snapshot",e),e}}))}async getPictureOptions(){return[]}async getOtherSettings(){return await this.getSettings()}showRtspUrlOverride(){return!1}async startIntercom(e){await this.intercom.start(e)}stopIntercom(){return this.intercom.stop()}}t.ReolinkNativeCamera=l},8799:function(e,t,A){"use strict";var s,r=this&&this.__createBinding||(Object.create?function(e,t,A,s){void 0===s&&(s=A);var r=Object.getOwnPropertyDescriptor(t,A);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[A]}}),Object.defineProperty(e,s,r)}:function(e,t,A,s){void 0===s&&(s=A),e[s]=t[A]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(s=function(e){return s=Object.getOwnPropertyNames||function(e){var t=[];for(var A in e)Object.prototype.hasOwnProperty.call(e,A)&&(t[t.length]=A);return t},s(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var A=s(e),i=0;i<A.length;i++)"default"!==A[i]&&r(t,e,A[i]);return n(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.CommonCameraMixin=void 0;const o=i(A(7562)),a=A(6117),c=A(5098),l=A(9560),h=A(5741),g=A(840),d=A(5050),u=A(6185);class E extends o.ScryptedDeviceBase{constructor(e,t){super(t),this.camera=e}async turnOff(){this.camera.getLogger().log(`Siren toggle: turnOff (device=${this.nativeId})`),this.on=!1;try{await this.camera.setSirenEnabled(!1),this.camera.getLogger().log(`Siren toggle: turnOff ok (device=${this.nativeId})`)}catch(e){throw this.camera.getLogger().warn(`Siren toggle: turnOff failed (device=${this.nativeId})`,e),e}}async turnOn(){this.camera.getLogger().log(`Siren toggle: turnOn (device=${this.nativeId})`),this.on=!0;try{await this.camera.setSirenEnabled(!0),this.camera.getLogger().log(`Siren toggle: turnOn ok (device=${this.nativeId})`)}catch(e){throw this.camera.getLogger().warn(`Siren toggle: turnOn failed (device=${this.nativeId})`,e),e}}}class I extends o.ScryptedDeviceBase{constructor(e,t){super(t),this.camera=e}async setBrightness(e){this.camera.getLogger().log(`Floodlight toggle: setBrightness (device=${this.nativeId} brightness=${e})`),this.brightness=e;try{await this.camera.setFloodlightState(void 0,e),this.camera.getLogger().log(`Floodlight toggle: setBrightness ok (device=${this.nativeId} brightness=${e})`)}catch(t){throw this.camera.getLogger().warn(`Floodlight toggle: setBrightness failed (device=${this.nativeId} brightness=${e})`,t),t}}async turnOff(){this.camera.getLogger().log(`Floodlight toggle: turnOff (device=${this.nativeId})`),this.on=!1;try{await this.camera.setFloodlightState(!1),this.camera.getLogger().log(`Floodlight toggle: turnOff ok (device=${this.nativeId})`)}catch(e){throw this.camera.getLogger().warn(`Floodlight toggle: turnOff failed (device=${this.nativeId})`,e),e}}async turnOn(){this.camera.getLogger().log(`Floodlight toggle: turnOn (device=${this.nativeId})`),this.on=!0;try{await this.camera.setFloodlightState(!0),this.camera.getLogger().log(`Floodlight toggle: turnOn ok (device=${this.nativeId})`)}catch(e){throw this.camera.getLogger().warn(`Floodlight toggle: turnOn failed (device=${this.nativeId})`,e),e}}}class Q extends o.ScryptedDeviceBase{constructor(e,t){super(t),this.camera=e,this.storageSettings=new a.StorageSettings(this,{sensitive:{title:"PIR Sensitivity",description:"Detection sensitivity/threshold (higher = more sensitive)",type:"number",defaultValue:50,range:[0,100]},reduceAlarm:{title:"Reduce False Alarms",description:"Enable reduction of false alarm rate",type:"boolean",defaultValue:!1},interval:{title:"PIR Detection Interval",description:"Detection interval in seconds",type:"number",defaultValue:5,range:[1,60]}})}async getSettings(){return this.storageSettings.getSettings()}async putSetting(e,t){await this.storageSettings.putSetting(e,t);const A=this.camera.getRtspChannel(),s=this.on?1:0,r=this.storageSettings.values.sensitive,n=this.storageSettings.values.reduceAlarm?1:0,i=this.storageSettings.values.interval;await this.camera.withBaichuanRetry((async()=>{const e=await this.camera.ensureClient();await e.setPirInfo(A,{enable:s,sensitive:r,reduceAlarm:n,interval:i})}))}async turnOff(){this.on=!1,await this.updatePirSettings()}async turnOn(){this.on=!0,await this.updatePirSettings()}async updatePirSettings(){const e=this.camera.getRtspChannel(),t=this.on?1:0,A=this.storageSettings.values.sensitive,s=this.storageSettings.values.reduceAlarm?1:0,r=this.storageSettings.values.interval;await this.camera.withBaichuanRetry((async()=>{const n=await this.camera.ensureClient();await n.setPirInfo(e,{enable:t,sensitive:A,reduceAlarm:s,interval:r})}))}}class C extends o.ScryptedDeviceBase{constructor(e,t,A){super(e),this.plugin=t,this.options=A,this.storageSettings=new a.StorageSettings(this,{ipAddress:{title:"IP Address",type:"string",onPut:async()=>{await this.credentialsChanged()}},username:{type:"string",title:"Username",onPut:async()=>{await this.credentialsChanged()}},password:{type:"password",title:"Password",onPut:async()=>{await this.credentialsChanged()}},rtspChannel:{type:"number",hide:!0,defaultValue:0},capabilities:{json:!0,hide:!0},uid:{title:"UID",description:"Reolink UID (required for battery cameras / BCUDP).",type:"string",hide:!0,onPut:async()=>{await this.credentialsChanged()}},mixinsSetup:{type:"boolean",hide:!0},snapshotCacheMinutes:{title:"Snapshot Cache Minutes",subgroup:"Advanced",description:"Return a cached snapshot if taken within the last N minutes.",type:"number",defaultValue:5,hide:!0},batteryUpdateIntervalMinutes:{title:"Battery Update Interval (minutes)",subgroup:"Advanced",description:"How often to wake up the camera and update battery status and snapshot (default: 10 minutes).",type:"number",defaultValue:10,hide:!0},dispatchEvents:{subgroup:"Advanced",title:"Dispatch Events",description:"Select which events to emit. Empty disables event subscription entirely.",multiple:!0,combobox:!0,immediate:!0,defaultValue:["motion","objects"],choices:["motion","objects"],onPut:async()=>{await this.subscribeToEvents()}},debugLogs:{subgroup:"Advanced",title:"Debug Logs",description:"Enable specific debug logs. Baichuan client logs require reconnect; event logs are immediate.",multiple:!0,combobox:!0,immediate:!0,defaultValue:[],choices:(0,l.getDebugLogChoices)(),onPut:async(e,t)=>{const A=(0,l.getApiRelevantDebugLogs)(e||[]),s=(0,l.getApiRelevantDebugLogs)(t||[]),r=new Set(A),n=new Set(s);(r.size!==n.size||Array.from(r).some((e=>!n.has(e))))&&this.resetBaichuanClient&&(this.debugLogsResetTimeout&&(clearTimeout(this.debugLogsResetTimeout),this.debugLogsResetTimeout=void 0),this.debugLogsResetTimeout=setTimeout((async()=>{this.debugLogsResetTimeout=void 0;try{await this.resetBaichuanClient("debugLogs changed"),this.baichuanApi=void 0,this.ensureClientPromise=void 0,await this.ensureClient()}catch(e){this.getLogger().warn("Failed to reset client after debug logs change",e)}}),2e3))}},motionTimeout:{subgroup:"Advanced",title:"Motion Timeout",defaultValue:20,type:"number"},cachedOsd:{multiple:!0,hide:!0,json:!0,defaultValue:[]},intercomBlocksPerPayload:{subgroup:"Advanced",title:"Intercom Blocks Per Payload",description:"Lower reduces latency (more packets). Typical: 1-4. Requires restarting talk session to take effect.",type:"number",defaultValue:1},presets:{group:"PTZ",title:"Presets to enable",description:'PTZ Presets in the format "id=name". Where id is the PTZ Preset identifier and name is a friendly name.',multiple:!0,defaultValue:[],combobox:!0,hide:!0,onPut:async(e,t)=>{const A={...this.ptzCapabilities||{},presets:{}};for(const e of t){const[t,s]=e.split("=");A.presets[t]=s}this.ptzCapabilities=A},mapGet:()=>{const e=this.ptzCapabilities?.presets||{};return Object.entries(e).map((([e,t])=>e+"="+t))}},ptzMoveDurationMs:{title:"PTZ Move Duration (ms)",description:"How long a PTZ command moves before sending stop. Higher = more movement per click.",type:"number",defaultValue:300,group:"PTZ",hide:!0},ptzZoomStep:{group:"PTZ",title:"PTZ Zoom Step",description:"How much to change zoom per zoom command (in zoom factor units, where 1.0 is normal).",type:"number",defaultValue:.1,hide:!0},ptzCreatePreset:{group:"PTZ",title:"Create Preset",description:"Enter a name and press Save to create a new PTZ preset at the current position.",type:"string",placeholder:"e.g. Door",defaultValue:"",hide:!0,onPut:async(e,t)=>{const A=String(t??"").trim();if(!A)return void(""!==String(t??"")&&(this.storageSettings.values.ptzCreatePreset=""));const s=this.getLogger();s.log(`PTZ presets: create preset requested (name=${A})`);const r=await this.withBaichuanRetry((async()=>{if(await this.ensureClient(),!this.ptzPresets)throw new Error("PTZ presets not available");return await this.ptzPresets.createPtzPreset(A)})),n=`${r.id}=${r.name}`;this.storageSettings.values.ptzSelectedPreset=n,this.storageSettings.values.ptzCreatePreset="",s.log(`PTZ presets: created preset id=${r.id} name=${r.name}`)}},ptzSelectedPreset:{group:"PTZ",title:"Selected Preset",description:'Select the preset to update or delete. Format: "id=name".',type:"string",combobox:!1,immediate:!0,hide:!0},ptzUpdateSelectedPreset:{group:"PTZ",title:"Update Selected Preset Position",description:"Overwrite the selected preset with the current PTZ position.",type:"button",immediate:!0,hide:!0,onPut:async()=>{const e=this.getSelectedPresetId();if(void 0===e)throw new Error("No preset selected");const t=this.getLogger();t.log(`PTZ presets: update position requested (presetId=${e})`),await this.withBaichuanRetry((async()=>(await this.ensureClient(),await this.ptzPresets.updatePtzPresetToCurrentPosition(e)))),t.log(`PTZ presets: update position ok (presetId=${e})`)}},ptzDeleteSelectedPreset:{group:"PTZ",title:"Delete Selected Preset",description:"Delete the selected preset (firmware dependent).",type:"button",immediate:!0,hide:!0,onPut:async()=>{const e=this.getSelectedPresetId();if(void 0===e)throw new Error("No preset selected");const t=this.getLogger();t.log(`PTZ presets: delete requested (presetId=${e})`),await this.withBaichuanRetry((async()=>(await this.ensureClient(),await this.ptzPresets.deletePtzPreset(e)))),this.storageSettings.values.ptzSelectedPreset="",t.log(`PTZ presets: delete ok (presetId=${e})`)}}}),this.ptzPresets=new g.ReolinkPtzPresets(this),this.refreshingState=!1,this.classes=[],this.presets=[],this.fetchingStreams=!1,this.lastNetPortCacheAttempt=0,this.netPortCacheBackoffMs=5e3,this.onSimpleEvent=e=>{try{const t=this.getLogger();if(this.isEventLogsEnabled()&&t.log(`Baichuan event: ${JSON.stringify(e)}`),!this.isEventDispatchEnabled())return void(this.isEventLogsEnabled()&&t.debug("Event dispatch is disabled, ignoring event"));const A=this.getRtspChannel();if(void 0!==e?.channel&&e.channel!==A)return void(this.isEventLogsEnabled()&&t.debug(`Event channel ${e.channel} does not match camera channel ${A}, ignoring`));const s=[];let r=!1;switch(e?.type){case"motion":r=!0,this.isEventLogsEnabled()&&t.log("Motion event received (may be PIR or MD)");break;case"doorbell":this.handleDoorbellEvent(),r=!0;break;case"people":case"vehicle":case"animal":case"face":case"package":case"other":this.shouldDispatchObjects()&&s.push(e.type),r=!0;break;default:return void(this.isEventLogsEnabled()&&t.debug(`Unknown event type: ${e?.type}`))}this.processEvents({motion:r,objects:s}).catch((e=>{t.warn("Error processing events",e)}))}catch(e){this.getLogger().warn("Error in onSimpleEvent handler",e)}},this.protocol="battery"===A.type?"udp":"tcp",this.streamManager=new d.StreamManager({createStreamClient:()=>this.createStreamClient(),getLogger:()=>this.getLogger(),credentials:{username:this.storageSettings.values.username||"",password:this.storageSettings.values.password||""},sharedConnection:"battery"===A.type}),setTimeout((async()=>{await this.parentInit()}),2e3)}createStreamClient(){throw new Error("Method not implemented.")}getRtspChannel(){const e=this.storageSettings.values.rtspChannel;return void 0!==e?Number(e):0}getAbilities(){return this.storageSettings.values.capabilities}getLogger(){return this.console}getBaichuanDebugOptions(){const e=this.storageSettings.values.debugLogs||[];return(0,l.convertDebugLogsToApiOptions)(e)}isRecoverableBaichuanError(e){const t=e?.message||e?.toString?.()||"";return"string"==typeof t&&(t.includes("Baichuan socket closed")||t.includes("Baichuan UDP stream closed")||t.includes("Baichuan TCP socket is not connected")||t.includes("socket hang up")||t.includes("ECONNRESET")||t.includes("EPIPE"))}updatePtzCaps(){const{hasPan:e,hasTilt:t,hasZoom:A}=this.getAbilities();this.ptzCapabilities={...this.ptzCapabilities,pan:e,tilt:t,zoom:A}}unsubscribedToEvents(){const e=this.baichuanApi;if(e){try{e.offSimpleEvent(this.onSimpleEvent)}catch{}this.motionDetected&&(this.motionDetected=!1)}}async subscribeToEvents(){const e=this.getLogger(),t=Array.from(this.getDispatchEventsSelection?.()??new Set).sort(),A=t.length>0;e.log(`subscribeToEvents called: enabled=${A}, selection=[${t.join(", ")}], protocol=${this.protocol}`),this.unsubscribedToEvents();if(t.includes("motion")||(this.motionTimeout&&clearTimeout(this.motionTimeout),this.motionDetected=!1),!A)return e.log("Event subscription disabled, unsubscribing"),this.doorbellBinaryTimeout&&(clearTimeout(this.doorbellBinaryTimeout),this.doorbellBinaryTimeout=void 0),void(this.binaryState=!1);const s=await this.ensureClient();try{await s.onSimpleEvent(this.onSimpleEvent),e.log(`Subscribed to events (${t.join(", ")}) on ${this.protocol} connection`)}catch(t){return void e.warn("Failed to attach Baichuan event handler",t)}}async getVideoTextOverlays(){const e=await this.ensureClient(),t=this.getRtspChannel();let A=this.storageSettings.values.cachedOsd;return A?.length||(A=await e.getOsd(t),this.storageSettings.values.cachedOsd=A),{osdChannel:{text:A?.osdChannel?.enable?A.osdChannel.name:void 0},osdTime:{text:!!A?.osdTime?.enable,readonly:!0}}}async setVideoTextOverlay(e,t){const A=await this.ensureClient(),s=this.getRtspChannel(),r=await A.getOsd(s);if("osdChannel"===e){const e="string"==typeof t?.text?t.text.trim():"",A=!!e||!0===t?.text;r.osdChannel.enable=A?1:0,A&&(r.osdChannel.name=e||r.osdChannel.name||this.name||"Camera")}else{if("osdTime"!==e)throw new Error("unknown overlay: "+e);r.osdTime.enable=t?.text?1:0}await A.setOsd(s,r)}async ptzCommand(e){const t=await this.ensureClient();if(!t)return;const A=this.getRtspChannel(),s=e.preset;if(null!=s){const e=Number(s);return Number.isFinite(e)?void(this.ptzPresets?await this.ptzPresets.moveToPreset(e):this.getLogger().warn("PTZ presets not available")):void this.getLogger().warn(`Invalid PTZ preset id: ${s}`)}let r="start",n="Left";if(void 0!==e.pan)0===e.pan?(r="stop",n="Left"):(n=e.pan>0?"Right":"Left",r="start");else if(void 0!==e.tilt)0===e.tilt?(r="stop",n="Up"):(n=e.tilt>0?"Up":"Down",r="start");else if(void 0!==e.zoom){const s=Number(e.zoom);if(!Number.isFinite(s)||0===s)return;const r=Number(this.storageSettings.values.ptzZoomStep);if(!Number.isFinite(r)||r<=0)return void this.getLogger().warn("Invalid PTZ zoom step, using default 0.1");const n=await t.getZoomFocus(A);if(!n?.zoom)return void this.getLogger().warn("Zoom command requested but camera did not report zoom support.");const i=(n.zoom.curPos??1e3)/1e3,o=(n.zoom.minPos??1e3)/1e3,a=(n.zoom.maxPos??1e3)/1e3,c=r,l=s>0?1:-1,h=Math.min(a,Math.max(o,i+l*c));return void await t.zoomToFactor(A,h)}const i={action:r,command:n,speed:"number"==typeof e.speed?e.speed:32,autoStopMs:Number(this.storageSettings.values.ptzMoveDurationMs)||500};await t.ptz(A,i)}async getObjectTypes(){return{classes:this.classes}}async getDetectionInput(e,t){return null}getDispatchEventsSelection(){return new Set(this.storageSettings.values.dispatchEvents)}isEventDispatchEnabled(){return this.getDispatchEventsSelection().size>0}shouldDispatchMotion(){return this.getDispatchEventsSelection().has("motion")}shouldDispatchObjects(){return this.getDispatchEventsSelection().has("objects")}async processEvents(e){if(!(this.isEventDispatchEnabled?.()??!0))return;const t=this.getDispatchEventsSelection?.()??new Set(["motion","objects"]),A=t.has("motion"),s=t.has("objects");if(A&&void 0!==e.motion){const t=e.motion;if(t!==this.motionDetected)if(this.motionDetected=t,t){this.motionTimeout&&clearTimeout(this.motionTimeout);const e=1e3*(this.storageSettings.values.motionTimeout||30);this.motionTimeout=setTimeout((()=>{this.motionDetected=!1}),e)}else this.motionTimeout&&clearTimeout(this.motionTimeout)}if(s&&e.objects?.length){const t={timestamp:Date.now(),detections:[]};for(const A of e.objects)t.detections.push({className:A,score:1});this.nativeId&&o.default.deviceManager.onDeviceEvent(this.nativeId,o.ScryptedInterface.ObjectDetector,t)}}isEventLogsEnabled(){return(this.storageSettings.values.debugLogs||[]).includes(l.DebugLogOption.EventLogs)}handleDoorbellEvent(){this.doorbellBinaryTimeout||(this.binaryState=!0,this.doorbellBinaryTimeout=setTimeout((()=>{this.binaryState=!1,this.doorbellBinaryTimeout=void 0}),5e3))}clearDoorbellBinary(){this.doorbellBinaryTimeout&&(clearTimeout(this.doorbellBinaryTimeout),this.doorbellBinaryTimeout=void 0),this.binaryState=!1}async reportDevices(){if(!this.nativeId||!this.name)return;const{hasSiren:e,hasFloodlight:t,hasPir:A}=this.getAbilities(),s=[];if(e){const e=`${this.nativeId}-siren`;s.push({providerNativeId:this.plugin?.nativeId,name:`${this.name} Siren`,nativeId:e,info:{...this.info||{}},interfaces:[o.ScryptedInterface.OnOff,o.ScryptedInterface.Settings],type:o.ScryptedDeviceType.Siren})}if(t){const e=`${this.nativeId}-floodlight`;s.push({providerNativeId:this.plugin?.nativeId,name:`${this.name} Floodlight`,nativeId:e,info:{...this.info||{}},interfaces:[o.ScryptedInterface.OnOff,o.ScryptedInterface.Settings],type:o.ScryptedDeviceType.Light})}if(A){const e=`${this.nativeId}-pir`;s.push({providerNativeId:this.plugin?.nativeId,name:`${this.name} PIR`,nativeId:e,info:{...this.info||{}},interfaces:[o.ScryptedInterface.OnOff,o.ScryptedInterface.Settings],type:o.ScryptedDeviceType.Switch})}o.default.deviceManager.onDevicesChanged({providerNativeId:this.nativeId,devices:s})}async getSettings(){return await this.storageSettings.getSettings()}async putSetting(e,t){await this.storageSettings.putSetting(e,t)}async startIntercom(e){if(!this.intercom)throw new Error("Intercom not initialized");await this.intercom.start(e)}async stopIntercom(){if(this.intercom)return await this.intercom.stop();throw new Error("Intercom not initialized")}async updateDeviceInfo(){const e=this.storageSettings.values.ipAddress;try{const t=await this.ensureClient(),A=await t.getInfo(),s=this.info||{};s.ip=e,s.serialNumber=A?.serialNumber||A?.itemNo,s.firmware=A?.firmwareVersion||A?.firmVer,s.version=A?.hardwareVersion||A?.boardInfo,s.model=A?.type||A?.typeInfo,s.manufacturer="Reolink native",s.managementUrl=`http://${e}`,this.info=s}catch(t){const A=this.info||{};A.ip=e,A.manufacturer="Reolink native",A.managementUrl=`http://${e}`,this.info=A,this.getLogger().warn("Failed to fetch device info",t)}}async getDevice(e){return e.endsWith("-siren")?(this.siren||=new E(this,e),this.siren):e.endsWith("-floodlight")?(this.floodlight||=new I(this,e),this.floodlight):e.endsWith("-pir")?(this.pirSensor||=new Q(this,e),this.pirSensor):void 0}async releaseDevice(e,t){t.endsWith("-siren")?this.siren=void 0:t.endsWith("-floodlight")?this.floodlight=void 0:t.endsWith("-pir")&&(this.pirSensor=void 0)}async setSirenEnabled(e){const t=this.getRtspChannel();await this.withBaichuanRetry((async()=>{const A=await this.ensureClient();return await A.setSiren(t,e)}))}async setFloodlightState(e,t){const A=this.getRtspChannel();await this.withBaichuanRetry((async()=>{const s=await this.ensureClient();return await s.setWhiteLedState(A,e,t)}))}async setPirEnabled(e){const t=this.getRtspChannel();let A,s,r;this.pirSensor&&(A=this.pirSensor.storageSettings.values.sensitive,s=this.pirSensor.storageSettings.values.reduceAlarm?1:0,r=this.pirSensor.storageSettings.values.interval),await this.withBaichuanRetry((async()=>{const n=await this.ensureClient();return await n.setPirInfo(t,{enable:e?1:0,...void 0!==A?{sensitive:A}:{},...void 0!==s?{reduceAlarm:s}:{},...void 0!==r?{interval:r}:{}})}))}async alignAuxDevicesState(){const e=this.baichuanApi;if(!e)return;const t=this.getRtspChannel(),{hasSiren:A,hasFloodlight:s,hasPir:r}=this.getAbilities();try{if(A&&this.siren)try{const A=await e.getSiren(t);this.siren.on=A.enabled}catch(e){this.getLogger().debug("Failed to align siren state",e)}if(s&&this.floodlight)try{const A=await e.getWhiteLedState(t);this.floodlight.on=!!A.enabled,void 0!==A.brightness&&(this.floodlight.brightness=A.brightness)}catch(e){this.getLogger().debug("Failed to align floodlight state",e)}if(r&&this.pirSensor)try{const A=await e.getPirInfo(t);this.pirSensor.on=A.enabled,A.state&&(void 0!==A.state.sensitive&&(this.pirSensor.storageSettings.values.sensitive=A.state.sensitive),void 0!==A.state.reduceAlarm&&(this.pirSensor.storageSettings.values.reduceAlarm=!!A.state.reduceAlarm),void 0!==A.state.interval&&(this.pirSensor.storageSettings.values.interval=A.state.interval))}catch(e){this.getLogger().debug("Failed to align PIR state",e)}}catch(e){this.getLogger().debug("Failed to align auxiliary devices state",e)}}addRtspCredentials(e){const{username:t,password:A}=this.storageSettings.values;if(!t)return e;try{const s=new URL(e);if("rtmp:"===s.protocol){const e=s.searchParams;e.set("user",t),e.set("password",A||"")}else s.username=t,s.password=A||"";return s.toString()}catch(t){return this.getLogger().warn("Failed to parse URL for credentials",t),e}}getRtspAddress(){const{ipAddress:e}=this.storageSettings.values;return`${e}:${this.cachedNetPort?.rtsp?.port??554}`}getRtmpAddress(){const{ipAddress:e}=this.storageSettings.values;return`${e}:${this.cachedNetPort?.rtmp?.port??1935}`}async ensureNetPortCache(){if(this.cachedNetPort)return;const e=Date.now();if(e-this.lastNetPortCacheAttempt<this.netPortCacheBackoffMs)this.cachedNetPort={rtsp:{port:554,enable:1},rtmp:{port:1935,enable:1}};else{this.lastNetPortCacheAttempt=e;try{const e=await this.ensureClient();this.cachedNetPort=await e.getNetPort()}catch(e){this.isRecoverableBaichuanError?.(e)||this.getLogger().warn("Failed to get net port, using defaults",e),this.cachedNetPort={rtsp:{port:554,enable:1},rtmp:{port:1935,enable:1}}}}}async getVideoStreamOptions(){const e=this.getLogger();if(this.cachedVideoStreamOptions?.length)return this.cachedVideoStreamOptions;if(this.fetchingStreams)return[];this.fetchingStreams=!0;let t=[];const A=await this.ensureClient(),{ipAddress:s,username:r,password:n,rtspChannel:i}=this.storageSettings.values;try{await this.ensureNetPortCache()}catch(t){this.isRecoverableBaichuanError?.(t)||e.warn("Failed to ensure net port cache, falling back to Native",t)}try{t=await(0,d.buildVideoStreamOptionsFromRtspRtmp)(A,i,s,r,n,this.cachedNetPort)}catch(t){this.isRecoverableBaichuanError?.(t)||e.warn("Failed to build RTSP/RTMP stream options, falling back to Native",t),this.cachedNetPort=void 0}const o=await(0,d.fetchVideoStreamOptionsFromApi)(A,i,this.getLogger());if(t=[...t,...o],t.length)return e.log("Fetched video stream options",t),this.cachedVideoStreamOptions=t,t;this.fetchingStreams=!1}async getVideoStream(e){if(!e)throw new Error("video streams not set up or no longer exists.");const t=await this.getVideoStreamOptions(),A=(0,d.selectStreamOption)(t,e);if(!(0,d.isNativeStreamId)(A.id)&&A.url&&("rtsp"===A.container||"rtmp"===A.container)){const e=this.addRtspCredentials(A.url),t={container:A.container,url:e,mediaStreamOptions:A};return await this.createMediaObject(t,o.ScryptedMimeTypes.MediaStreamUrl)}if(!this.streamManager)throw new Error("StreamManager not initialized");const s=(0,d.parseStreamProfileFromId)(A.id)||"main",r=this.getRtspChannel(),n=`${r}_${s}`,i=(0,d.expectedVideoTypeFromUrlMediaStreamOptions)(A);return await this.withBaichuanRetry((async()=>await(0,d.createRfc4571MediaObjectFromStreamManager)({streamManager:this.streamManager,channel:r,profile:s,streamKey:n,expectedVideoType:i,selected:A,sourceId:this.id,onDetectedCodec:e=>{const t=`native_${s}`,A=`Native ${s}`,r=(this.cachedVideoStreamOptions??[]).filter((e=>e.id!==t));r.push({name:A,id:t,container:"rtp",video:{codec:e},url:""}),this.cachedVideoStreamOptions=r}})))}async ensureClient(){if(this.baichuanApi&&this.baichuanApi.client.isSocketConnected()&&this.baichuanApi.client.loggedIn)return this.baichuanApi;if(this.ensureClientPromise)return await this.ensureClientPromise;this.ensureClientPromise=(async()=>{const{ipAddress:e,username:t,password:A,uid:s}=this.storageSettings.values;if(!e||!t||!A)throw new Error("Missing camera credentials");if(this.baichuanApi){if(this.baichuanApi.client.isSocketConnected()){if(this.isEventDispatchEnabled?.()&&this.onSimpleEvent)try{this.baichuanApi.offSimpleEvent(this.onSimpleEvent),this.baichuanApi.onSimpleEvent(this.onSimpleEvent)}catch{}return this.connectionTime=Date.now(),this.baichuanApi}try{this.onSimpleEvent&&this.baichuanApi.offSimpleEvent(this.onSimpleEvent)}catch{}try{await this.baichuanApi.close()}catch{}}const r=this.getBaichuanDebugOptions(),n="udp"===this.protocol?(0,c.normalizeUid)(s):void 0;if("udp"===this.protocol&&!n)throw new Error("UID is required for battery cameras (BCUDP)");const i=await(0,c.createBaichuanApi)({inputs:{host:e,username:t,password:A,uid:n,logger:this.console,debugOptions:r},transport:this.protocol,logger:this.console});if(await i.login(),!i.client.isSocketConnected())throw new Error("Socket not connected after login");if(this.baichuanApi=i,this.connectionTime=Date.now(),this.isEventDispatchEnabled?.()&&this.onSimpleEvent)try{i.onSimpleEvent(this.onSimpleEvent)}catch{}return i})();try{return await this.ensureClientPromise}finally{this.ensureClientPromise=void 0}}async credentialsChanged(){this.cachedVideoStreamOptions=void 0,this.cachedNetPort=void 0}getSelectedPresetId(){const e=this.storageSettings.values.ptzSelectedPreset;if(!e)return;const t=e.includes("=")?e.split("=")[0]:e,A=Number(t);return Number.isFinite(A)?A:void 0}async refreshDeviceState(){if(this.refreshingState)return;this.refreshingState=!0;const e=this.getLogger(),t=this.getRtspChannel();try{const{capabilities:A,abilities:s,support:r,presets:n,objects:i}=await this.withBaichuanRetry((async()=>{const e=await this.ensureClient();return await e.getDeviceCapabilities(t)}));this.classes=i,this.presets=n,this.storageSettings.values.capabilities=A,this.ptzPresets.setCachedPtzPresets(n);try{const{interfaces:t,type:s}=(0,u.getDeviceInterfaces)({capabilities:A,logger:this.console}),r={nativeId:this.nativeId,providerNativeId:this.plugin?.nativeId,name:this.name,interfaces:t,type:s,info:this.info};e.log(`Updating device interfaces: ${JSON.stringify(r)}`),await o.default.deviceManager.onDeviceDiscovered(r)}catch(t){e.error("Failed to update device interfaces",t)}this.console.log(`Refreshed device capabilities: ${JSON.stringify({capabilities:A,abilities:s,support:r,presets:n})}`)}catch(t){e.error("Failed to refresh abilities",t)}this.refreshingState=!1}async parentInit(){const e=this.getLogger();try{await this.ensureClient(),await this.updateDeviceInfo()}catch(t){e.warn("Failed to update device info during init",t)}try{await this.refreshDeviceState()}catch(t){e.warn("Failed to connect/refresh during init",t)}try{await this.reportDevices()}catch(t){e.warn("Failed to report devices during init",t)}const{hasIntercom:t,hasPtz:A}=this.getAbilities();if(t&&(this.intercom=new h.ReolinkBaichuanIntercom(this)),A){const e=(this.presets||[]).map((e=>e.id+"="+e.name));this.storageSettings.settings.presets.choices=e,this.storageSettings.settings.ptzSelectedPreset.choices=e,this.storageSettings.settings.presets.hide=!1,this.storageSettings.settings.ptzMoveDurationMs.hide=!1,this.storageSettings.settings.ptzZoomStep.hide=!1,this.storageSettings.settings.ptzCreatePreset.hide=!1,this.storageSettings.settings.ptzSelectedPreset.hide=!1,this.storageSettings.settings.ptzUpdateSelectedPreset.hide=!1,this.storageSettings.settings.ptzDeleteSelectedPreset.hide=!1,this.updatePtzCaps()}const s="battery"===this.options.type;if(this.storageSettings.settings.snapshotCacheMinutes.hide=!s,this.storageSettings.settings.uid.hide=!s,this.storageSettings.settings.batteryUpdateIntervalMinutes.hide=!s,s&&!this.storageSettings.values.mixinsSetup)try{const t=o.default.systemManager.getDeviceById(this.id);t&&(e.log("Disabling prebuffer and snapshots from prebuffer"),await t.putSetting("prebuffer:enabledStreams","[]"),await t.putSetting("snapshot:snapshotsFromPrebuffer","Disabled"),this.storageSettings.values.mixinsSetup=!0)}catch(t){e.warn("Failed to setup mixins during init",t)}try{await this.subscribeToEvents()}catch(t){e.warn("Failed to subscribe to Baichuan events",t)}await this.init(),this.initComplete=!0}}t.CommonCameraMixin=C},5098:(e,t,A)=>{"use strict";function s(e){const t=e?.trim();return t||void 0}Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeUid=s,t.maskUid=function(e){const t=e.trim();return t.length<=8?t:`${t.slice(0,4)}…${t.slice(-4)}`},t.isTcpFailureThatShouldFallbackToUdp=function(e){const t=e?.message||e?.toString?.()||"";return"string"==typeof t&&(t.includes("ECONNREFUSED")||t.includes("ETIMEDOUT")||t.includes("EHOSTUNREACH")||t.includes("ENETUNREACH")||t.includes("socket hang up")||t.includes("TCP connection timeout")||t.includes("Baichuan socket closed"))},t.createBaichuanApi=async function(e){const{inputs:t,transport:r,logger:n}=e,{ReolinkBaichuanApi:i}=await Promise.resolve().then(A.bind(A,5181)),o={host:t.host,username:t.username,password:t.password,logger:t.logger,debugOptions:t.debugOptions??{}},a=e=>{try{e.client.on("error",(e=>{const A=t.logger;if(!A)return;const s=e?.message||e?.toString?.()||String(e);"string"==typeof s&&(s.includes("Baichuan socket closed")||s.includes("Baichuan UDP stream closed")||s.includes("Not running"))||A.error(`[BaichuanClient] error (${r}) ${t.host}: ${s}`)})),e.client.on("close",(()=>{}))}catch{}};if("tcp"===r){const e=new i({...o,transport:"tcp"});return a(e),e}const c=s(t.uid);if(!c)throw new Error("UID is required for battery cameras (BCUDP)");const l=new i({...o,transport:"udp",uid:c,idleDisconnect:!0});return a(l),l}},9560:(e,t)=>{"use strict";var A;function s(e){return{[A.General]:"general",[A.DebugRtsp]:"debugRtsp",[A.TraceStream]:"traceStream",[A.TraceTalk]:"traceTalk",[A.TraceEvents]:"traceEvents",[A.DebugH264]:"debugH264",[A.DebugParamSets]:"debugParamSets",[A.EventLogs]:null,[A.BatteryInfo]:null}[e]}Object.defineProperty(t,"__esModule",{value:!0}),t.DebugLogDisplayNames=t.DebugLogOption=void 0,t.mapDebugLogToApiOption=s,t.convertDebugLogsToApiOptions=function(e){const A={},r=new Set(e);for(const[e,n]of Object.entries(t.DebugLogDisplayNames))if(r.has(n)){const t=s(e);t&&(A[t]=!0)}return console.log(e,A),Object.keys(A).length>0?A:void 0},t.getApiRelevantDebugLogs=function(e){return e.filter((e=>null!==s(e)))},t.getDebugLogChoices=function(){return Object.values(A).map((e=>`${t.DebugLogDisplayNames[e]}`))},function(e){e.General="general",e.DebugRtsp="debugRtsp",e.TraceStream="traceStream",e.TraceTalk="traceTalk",e.TraceEvents="traceEvents",e.DebugH264="debugH264",e.DebugParamSets="debugParamSets",e.EventLogs="eventLogs",e.BatteryInfo="batteryInfo"}(A||(t.DebugLogOption=A={})),t.DebugLogDisplayNames={[A.General]:"General",[A.DebugRtsp]:"RTSP",[A.TraceStream]:"Trace stream",[A.TraceTalk]:"Trace talk",[A.TraceEvents]:"Trace events XML",[A.DebugH264]:"H264",[A.DebugParamSets]:"Video param sets",[A.EventLogs]:"Object detection events",[A.BatteryInfo]:"Battery info update"}},5741:function(e,t,A){"use strict";var s,r=this&&this.__createBinding||(Object.create?function(e,t,A,s){void 0===s&&(s=A);var r=Object.getOwnPropertyDescriptor(t,A);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[A]}}),Object.defineProperty(e,s,r)}:function(e,t,A,s){void 0===s&&(s=A),e[s]=t[A]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(s=function(e){return s=Object.getOwnPropertyNames||function(e){var t=[];for(var A in e)Object.prototype.hasOwnProperty.call(e,A)&&(t[t.length]=A);return t},s(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var A=s(e),i=0;i<A.length;i++)"default"!==A[i]&&r(t,e,A[i]);return n(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.ReolinkBaichuanIntercom=void 0;const o=i(A(7562)),a=A(1421);t.ReolinkBaichuanIntercom=class{constructor(e){this.camera=e,this.loggedCodecInfo=!1,this.maxBacklogMs=40,this.sendChain=Promise.resolve(),this.pcmBuffer=Buffer.alloc(0)}get blocksPerPayload(){return Math.max(1,Math.min(8,this.camera.storageSettings.values.intercomBlocksPerPayload??1))}async start(e){const t=this.camera.getLogger(),A=await o.default.mediaManager.convertMediaObjectToJSON(e,o.ScryptedMimeTypes.FFmpegInput);await this.stop();const s=this.camera.getRtspChannel();if(!this.loggedCodecInfo){this.loggedCodecInfo=!0;try{const e=await this.camera.ensureClient(),A=await e.getTalkAbility(s),r=A.audioConfigList?.map((e=>({audioType:e.audioType,sampleRate:e.sampleRate,samplePrecision:e.samplePrecision,lengthPerEncoder:e.lengthPerEncoder,soundTrack:e.soundTrack})));t.log("Intercom TalkAbility",{channel:s,duplexList:A.duplexList,audioStreamModeList:A.audioStreamModeList,audioConfigList:r})}catch(e){t.warn("Intercom: unable to fetch TalkAbility",e)}}const r=await this.camera.withBaichuanRetry((async()=>{const e=await this.camera.ensureClient();if("battery"===this.camera.options?.type)try{"sleeping"===e.getSleepStatus({channel:s}).state&&(t.log("Camera is sleeping, waking up for intercom..."),await e.wakeUp(s,{waitAfterWakeMs:2e3}),await new Promise((e=>setTimeout(e,1e3))))}catch(e){t.debug("Failed to check/wake camera for intercom, proceeding anyway",e)}return await e.createTalkSession(s,{blocksPerPayload:this.blocksPerPayload})}));this.session=r,this.pcmBuffer=Buffer.alloc(0),this.sendChain=Promise.resolve();const{audioConfig:n,blockSize:i,fullBlockSize:c}=r.info,l=n.sampleRate,h=2*i+1,g=2*h;if(this.maxBacklogBytes=Math.max(g,Math.floor(this.maxBacklogMs/1e3*l*1*2)),!Number.isFinite(l)||l<=0)throw await this.stop(),new Error(`Invalid talk sampleRate: ${l}`);if(!Number.isFinite(i)||i<=0||!Number.isFinite(c)||c!==i+4)throw await this.stop(),new Error(`Invalid talk block sizes: blockSize=${i} fullBlockSize=${c}`);t.log("Starting intercom (baichuan/native-api flow)",{channel:s,audioType:n.audioType,sampleRate:n.sampleRate,samplePrecision:n.samplePrecision,lengthPerEncoder:n.lengthPerEncoder,soundTrack:n.soundTrack,blockSize:i,fullBlockSize:c,samplesPerBlock:h,bytesNeeded:g,maxBacklogMs:this.maxBacklogMs,maxBacklogBytes:this.maxBacklogBytes,blocksPerPayload:this.blocksPerPayload});const d=this.buildFfmpegPcmArgs(A,{sampleRate:l,channels:1});t.log("Intercom ffmpeg decode args",d);const u=(0,a.spawn)("ffmpeg",d,{stdio:["ignore","pipe","pipe"]});if(this.session!==r){try{u.kill("SIGKILL")}catch{}return}this.ffmpeg=u,u.stdout.on("data",(e=>{this.session===r&&e?.length&&this.enqueuePcm(r,e,g,i)}));let E=0;u.stderr.on("data",(e=>{E++<12&&t.warn("Intercom ffmpeg",e.toString().trim())})),u.on("exit",((e,A)=>{t.warn(`Intercom ffmpeg exited code=${e} signal=${A}`),this.stop().catch((()=>{}))})),t.log("Intercom started (ffmpeg decode -> PCM -> IMA ADPCM)")}stop(){return this.stopping||(this.stopping=(async()=>{const e=this.camera.getLogger(),t=this.ffmpeg;this.ffmpeg=void 0;const A=this.session;this.session=void 0,this.pcmBuffer=Buffer.alloc(0);const s=async e=>new Promise((t=>setTimeout(t,e)));if(t&&null==t.exitCode){try{t.kill("SIGKILL")}catch{}try{await Promise.race([new Promise((e=>t.once("exit",(()=>e())))),s(1e3)])}catch{}}try{await Promise.race([this.sendChain,s(250)])}catch{}if(this.sendChain=Promise.resolve(),A)try{await Promise.race([A.stop(),s(2e3)])}catch(t){e.warn("Intercom session stop error",t)}})().finally((()=>{this.stopping=void 0}))),this.stopping}clamp16(e){return e>32767?32767:e<-32768?-32768:0|e}enqueuePcm(e,t,A,s){const r=this.camera.getLogger();this.sendChain=this.sendChain.then((async()=>{if(this.session!==e)return;this.pcmBuffer=this.pcmBuffer.length?Buffer.concat([this.pcmBuffer,t]):t;const r=this.maxBacklogBytes??A;if(this.pcmBuffer.length>r){const e=r-r%2;this.pcmBuffer=this.pcmBuffer.subarray(this.pcmBuffer.length-e)}for(;this.pcmBuffer.length>=A;){const t=this.pcmBuffer.subarray(0,A);this.pcmBuffer=this.pcmBuffer.subarray(A);const r=new Int16Array(t.buffer,t.byteOffset,t.length/2),n=this.encodeImaAdpcm(r,s);await e.sendAudio(n)}})).catch((e=>{r.warn("Intercom PCM->ADPCM pipeline error",e)}))}buildFfmpegPcmArgs(e,t){const A=e.inputArguments??[],s=[];let r;for(let e=0;e<A.length;e++){const t=A[e];if("-i"===t){const t=A[e+1];if("string"==typeof t){r||(r=t),e++;continue}}s.push(t)}const n=r??e.url;if(!n)throw new Error("FFmpegInput missing url/input");return[...s,"-i",n,"-map","0:a:0?","-fflags","nobuffer","-flags","low_delay","-flush_packets","1","-vn","-sn","-dn","-acodec","pcm_s16le","-ar",t.sampleRate.toString(),"-ac",t.channels.toString(),"-f","s16le","pipe:1"]}encodeImaAdpcm(e,t){const A=2*t+1,s=Math.ceil(e.length/A),r=[],n=Int8Array.from([-1,-1,-1,-1,2,4,6,8,-1,-1,-1,-1,2,4,6,8]),i=Int16Array.from([7,8,9,10,11,12,13,14,16,17,19,21,23,25,28,31,34,37,41,45,50,55,60,66,73,80,88,97,107,118,130,143,157,173,190,209,230,253,279,307,337,371,408,449,494,544,598,658,724,796,876,963,1060,1166,1282,1411,1552,1707,1878,2066,2272,2499,2749,3024,3327,3660,4026,4428,4871,5358,5894,6484,7132,7845,8630,9493,10442,11487,12635,13899,15289,16818,18500,20350,22385,24623,27086,29794,32767]);let o=0;for(let A=0;A<s;A++){const A=Buffer.alloc(4+t);let s=e[o]??0,a=0;A.writeInt16LE(s,0),A.writeUInt8(a,2),A.writeUInt8(0,3),o++;const c=new Uint8Array(2*t);for(let t=0;t<c.length;t++){const A=e[o]??s;o++;let r=A-s,l=0;r<0&&(l=8,r=-r);let h=i[a]??7,g=0,d=h>>3;r>=h&&(g|=4,r-=h,d+=h),h>>=1,r>=h&&(g|=2,r-=h,d+=h),h>>=1,r>=h&&(g|=1,d+=h),l?s-=d:s+=d,s=this.clamp16(s),a+=n[g]??0,a<0&&(a=0),a>88&&(a=88),c[t]=15&(g|l)}for(let e=0;e<t;e++){const t=c[2*e]??0,s=c[2*e+1]??0;A[4+e]=15&t|(15&s)<<4}r.push(A)}return Buffer.concat(r)}}},7927:function(e,t,A){"use strict";var s,r=this&&this.__createBinding||(Object.create?function(e,t,A,s){void 0===s&&(s=A);var r=Object.getOwnPropertyDescriptor(t,A);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[A]}}),Object.defineProperty(e,s,r)}:function(e,t,A,s){void 0===s&&(s=A),e[s]=t[A]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(s=function(e){return s=Object.getOwnPropertyNames||function(e){var t=[];for(var A in e)Object.prototype.hasOwnProperty.call(e,A)&&(t[t.length]=A);return t},s(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var A=s(e),i=0;i<A.length;i++)"default"!==A[i]&&r(t,e,A[i]);return n(t,e),t});Object.defineProperty(t,"__esModule",{value:!0});const o=i(A(7562)),a=A(4417),c=A(6125),l=A(5098),h=A(6185);class g extends o.ScryptedDeviceBase{constructor(){super(...arguments),this.devices=new Map}getScryptedDeviceCreator(){return"Reolink Native camera"}async getDevice(e){if(this.devices.has(e))return this.devices.get(e);const t=this.createCamera(e);return this.devices.set(e,t),t}async createDevice(e,t){const A=e.ip?.toString();let s={};const r=e.username?.toString(),n=e.password?.toString(),i=e.uid?.toString(),a=!0===e.isBatteryCam||"true"===e.isBatteryCam?.toString();if(a&&!i)throw new Error("UID is required for battery cameras (BCUDP)");if(A&&r&&n){const c=await(0,l.createBaichuanApi)({transport:a?"udp":"tcp",logger:this.console,inputs:{host:A,username:r,password:n,uid:i,logger:this.console}});await c.login();try{const l=await c.getInfo(),g=l?.name,d=0,{abilities:u,capabilities:E,objects:I,presets:Q}=await c.getDeviceCapabilities(d);this.console.log(JSON.stringify({abilities:u,capabilities:E,deviceInfo:l})),t=`${l.serialNumber}${a?"-battery-cam":"-cam"}`,e.newCamera||=g;const{interfaces:C,type:B}=(0,h.getDeviceInterfaces)({capabilities:E,logger:this.console});await o.default.deviceManager.onDeviceDiscovered({nativeId:t,name:g,interfaces:C,type:B,providerNativeId:this.nativeId});const p=await this.getDevice(t);return p.info=s,p.classes=I,p.presets=Q,p.storageSettings.values.username=r,p.storageSettings.values.password=n,p.storageSettings.values.rtspChannel=d,p.storageSettings.values.ipAddress=A,a&&i&&(p.storageSettings.values.uid=i),p.storageSettings.values.capabilities=E,p.updateDeviceInfo(),t}catch(e){throw this.console.error("Error adding Reolink camera",e),await c.close(),e}finally{await c.close()}}}async releaseDevice(e,t){if(this.devices.has(t)){const e=this.devices.get(t);await e.release(),this.devices.delete(t)}}async getCreateDeviceSettings(){return[{key:"ip",title:"IP Address",placeholder:"192.168.2.222"},{key:"isBatteryCam",title:"Is Battery Camera",description:"Enable for Reolink battery cameras. Uses UDP/BCUDP for discovery and streaming. Requires UID.",type:"boolean"},{key:"username",title:"Username"},{key:"password",title:"Password",type:"password"},{key:"uid",title:"UID",description:"Reolink UID (required for battery cameras)"}]}createCamera(e){return e.endsWith("-battery-cam")?new c.ReolinkNativeBatteryCamera(e,this):new a.ReolinkNativeCamera(e,this)}}t.default=g},840:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReolinkPtzPresets=void 0;t.ReolinkPtzPresets=class{constructor(e){this.camera=e}get storageSettings(){return this.camera.storageSettings}getPtzCapabilitiesStore(){return this.camera.ptzCapabilities}setPtzCapabilitiesStore(e){this.camera.ptzCapabilities=e}parsePresetIdFromSettingValue(e){const t=String(e??"").trim();if(!t)return;const A=t.includes("=")?t.split("=")[0]:t,s=Number(A);return Number.isFinite(s)?s:void 0}syncEnabledPresetsSettingAndCaps(e){const t=this.storageSettings.values.presets??[];if(!t.length)return;const A=new Map(e.map((e=>[e.id,e.name]))),s={};for(const e of t){const t=this.parsePresetIdFromSettingValue(e);if(void 0===t)continue;const r=(e.includes("=")?e.substring(e.indexOf("=")+1).trim():"")||A.get(t);r&&(s[String(t)]=r)}this.setPtzCapabilitiesStore({...this.getPtzCapabilitiesStore()??{},presets:s})}setCachedPtzPresets(e){const t=Array.isArray(e)?e:[];this.camera.presets=t;const A={};for(const e of t)A[String(e.id)]=e.name;this.setPtzCapabilitiesStore({...this.getPtzCapabilitiesStore()??{},presets:A})}getCachedPtzPresets(){const e=this.camera.presets;return Array.isArray(e)?e:[]}nextFreePresetId(e){const t=new Set(e.map((e=>e.id)));for(let e=1;e<=255;e++)if(!t.has(e))return e;throw new Error("No free PTZ preset id available (1..255)")}async refreshPtzPresets(){const e=await this.camera.ensureClient(),t=this.camera.getRtspChannel(),A=await e.getPtzPresets(t);return this.setCachedPtzPresets(A),this.syncEnabledPresetsSettingAndCaps(A),A}async moveToPreset(e){const t=await this.camera.ensureClient(),A=this.camera.getRtspChannel();await t.moveToPtzPreset(A,e)}async createPtzPreset(e,t){const A=await this.camera.ensureClient(),s=this.camera.getRtspChannel(),r=String(e??"").trim();if(!r)throw new Error("Preset name is required");const n=await A.getPtzPresets(s),i=new Set(n.map((e=>e.id))),o=t??this.nextFreePresetId(n);if(void 0===t&&i.has(o))throw new Error(`PTZ preset id already in use: ${o}`);await A.setPtzPreset(s,o,r);const a=await A.getPtzPresets(s),c=a.some((e=>e.id===o));if(this.setCachedPtzPresets(a),!c)throw this.syncEnabledPresetsSettingAndCaps(a),new Error("PTZ preset save did not persist (camera returned an empty/unchanged preset list). Try again.");const l=this.storageSettings.values.presets??[];if(l.length){l.some((e=>this.parsePresetIdFromSettingValue(e)===o))||(l.push(`${o}=${r}`),this.storageSettings.values.presets=l)}return this.syncEnabledPresetsSettingAndCaps(a),{id:o,name:r}}async updatePtzPresetToCurrentPosition(e){const t=await this.camera.ensureClient(),A=this.camera.getRtspChannel(),s=this.getCachedPtzPresets().find((t=>t.id===e)),r=s?.name??`Preset ${e}`;await t.setPtzPreset(A,e,r),await this.refreshPtzPresets()}async deletePtzPreset(e){const t=await this.camera.ensureClient(),A=this.camera.getRtspChannel();await t.deletePtzPreset(A,e);const s=this.storageSettings.values.presets;if(Array.isArray(s)&&s.length){const t=s.filter((e=>"string"==typeof e)).filter((t=>this.parsePresetIdFromSettingValue(t)!==e));this.storageSettings.values.presets=t}await this.refreshPtzPresets()}async renamePtzPreset(e,t){const A=await this.camera.ensureClient(),s=this.camera.getRtspChannel(),r=String(t??"").trim();if(!r)throw new Error("Preset name is required");await A.moveToPtzPreset(s,e),await A.setPtzPreset(s,e,r),await this.refreshPtzPresets()}}},5050:function(e,t,A){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.StreamManager=void 0,t.parseStreamProfileFromId=function(e){if(!e)return;if(e.startsWith("native_")){return e.replace("native_","")}if(e.endsWith(".bcs")){return e.replace(".bcs","")}if(e.startsWith("h264Preview_")){if(e.endsWith("_main"))return"main";if(e.endsWith("_sub"))return"sub"}return},t.isNativeStreamId=function(e){return e?.startsWith("native_")??!1},t.fetchVideoStreamOptionsFromApi=async function(e,t,A){const s=await e.getStreamMetadata(t),r=[],n=s?.streams||[];for(const e of n){const t=e.profile,A=String(e.videoEncType||"").includes("264")?"h264":String(e.videoEncType||"").includes("265")?"h265":String(e.videoEncType||"").toLowerCase();r.push({name:`Native ${t}`,id:`native_${t}`,container:"rtp",video:{codec:A,width:e.width,height:e.height},url:""})}return r},t.buildVideoStreamOptionsFromRtspRtmp=async function(e,t,A,s,r,n){const i=[],o=n||await e.getNetPort(),a=1===o.rtsp?.enable,c=1===o.rtmp?.enable,l=o.rtsp?.port??554,h=o.rtmp?.port??1935;if(!a&&!c)return i;const g=await e.getStreamMetadata(t),d=g?.streams||[];for(const e of d){const s=e.profile,r=String(e.videoEncType||"").includes("264")?"h264":String(e.videoEncType||"").includes("265")?"h265":String(e.videoEncType||"").toLowerCase();if(a&&"ext"!==s){const n=String(t+1).padStart(2,"0"),o="main"===s?"main":"sub",a=`/h264Preview_${n}_${o}`,c=`h264Preview_${n}_${o}`;i.push({name:`RTSP ${c}`,id:c,container:"rtsp",video:{codec:r,width:e.width,height:e.height},url:`rtsp://${A}:${l}${a}`})}if(c){const n="main"===s?"main":"sub"===s?"sub":"ext",o="sub"===s?1:0,a=`${n}.bcs`,c=new URL(`rtmp://${A}:${h}${`/bcs/channel${t}_${n}.bcs`}`),l=c.searchParams;l.set("channel",t.toString()),l.set("stream",o.toString()),i.push({name:`RTMP ${a}`,id:a,container:"rtmp",video:{codec:r,width:e.width,height:e.height},url:c.toString()})}}return i.sort(((e,t)=>"rtmp"===e.container&&"rtmp"!==t.container?-1:"rtmp"!==e.container&&"rtmp"===t.container?1:0)),i},t.selectStreamOption=function(e,t){if(!t)throw new Error("video streams not set up or no longer exists.");const A=e?.find((e=>e.id===t.id))||e?.[0];if(!A)throw new Error("No stream options available");return A},t.expectedVideoTypeFromUrlMediaStreamOptions=function(e){const t=e?.video?.codec;return"string"!=typeof t?void 0:t.includes("265")?"H265":t.includes("264")?"H264":void 0},t.createRfc4571MediaObjectFromStreamManager=async function(e){const{streamManager:t,channel:A,profile:s,streamKey:n,expectedVideoType:i,selected:o,sourceId:a,onDetectedCodec:c}=e,{host:l,port:h,sdp:g,audio:d,username:u,password:E}=await t.getRfcStream(A,s,n,i);try{const e=/a=rtpmap:\d+\s+(H26[45])\//.exec(g)?.[1];if(e){const t="H265"===e?"h265":"h264";c?.(t)}}catch{}const{url:I,...Q}=o;Q.container="rtp",d&&(Q.audio||={},Q.audio.codec=d.codec,Q.audio.sampleRate=d.sampleRate,Q.audio.channels=d.channels);const C=encodeURIComponent(u||""),B=encodeURIComponent(E||""),p={url:`tcp://${C}:${B}@${l}:${h}`,sdp:g,mediaStreamOptions:Q};return await r.default.mediaManager.createMediaObject(Buffer.from(JSON.stringify(p)),"x-scrypted/x-rfc4571",{sourceId:a})};const r=s(A(7562));t.StreamManager=class{constructor(e){this.opts=e,this.nativeRfcServers=new Map,this.nativeRfcServerCreatePromises=new Map}getLogger(){return this.opts.getLogger()}async ensureNativeRfcServer(e,t,s,r){const n=this.nativeRfcServerCreatePromises.get(e);if(n)return await n;const i=(async()=>{const n=this.nativeRfcServers.get(e);if(n?.server?.listening){if(!r||n.videoType===r)return{host:n.host,port:n.port,sdp:n.sdp,audio:n.audio,username:n.username||this.opts.credentials.username,password:n.password||this.opts.credentials.password};this.getLogger().warn(`Native RFC cache codec mismatch for ${e}: cached=${n.videoType} expected=${r}; recreating server.`)}if(n){try{await n.close("recreate")}catch{}this.nativeRfcServers.delete(e)}const i=await this.opts.createStreamClient(),{createScryptedRfc4571TcpServer:o}=await Promise.resolve().then(A.bind(A,5181)),{username:a,password:c}=this.opts.credentials,l=!this.opts.sharedConnection,h=await o({api:i,channel:t,profile:s,logger:this.getLogger(),expectedVideoType:r,closeApiOnTeardown:l,username:a,password:c});return this.nativeRfcServers.set(e,h),h.server.once("close",(()=>{const t=this.nativeRfcServers.get(e);t?.server===h.server&&this.nativeRfcServers.delete(e)})),{host:h.host,port:h.port,sdp:h.sdp,audio:h.audio,username:h.username||this.opts.credentials.username,password:h.password||this.opts.credentials.password}})();this.nativeRfcServerCreatePromises.set(e,i);try{return await i}finally{this.nativeRfcServerCreatePromises.delete(e)}}async getRfcStream(e,t,A,s){return await this.ensureNativeRfcServer(A,e,t,s)}async closeAllStreams(e){const t=Array.from(this.nativeRfcServers.values());this.nativeRfcServers.clear(),await Promise.allSettled(t.map((async t=>{try{await t.close(e||"connection reset")}catch(e){this.getLogger().debug("Error closing stream server",e)}})))}}},6185:(e,t,A)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDeviceInterfaces=void 0;const s=A(7562);t.getDeviceInterfaces=e=>{const{capabilities:t,logger:A}=e,r=[s.ScryptedInterface.VideoCamera,s.ScryptedInterface.Settings,s.ScryptedInterface.Reboot,s.ScryptedInterface.VideoCameraConfiguration,s.ScryptedInterface.Camera,s.ScryptedInterface.AudioSensor,s.ScryptedInterface.MotionSensor,s.ScryptedInterface.VideoTextOverlays];try{const{hasPtz:e,hasSiren:A,hasFloodlight:n,hasPir:i,hasBattery:o,hasIntercom:a,isDoorbell:c}=t;e&&r.push(s.ScryptedInterface.PanTiltZoom),r.push(s.ScryptedInterface.ObjectDetector),(A||n||i)&&r.push(s.ScryptedInterface.DeviceProvider),o&&r.push(s.ScryptedInterface.Battery,s.ScryptedInterface.Sleep),a&&r.push(s.ScryptedInterface.Intercom),c&&r.push(s.ScryptedInterface.BinarySensor)}catch(e){A.error("Error getting device interfaces",e)}return{interfaces:r,type:t.isDoorbell?s.ScryptedDeviceType.Doorbell:s.ScryptedDeviceType.Camera}}},3339:e=>{"use strict";e.exports=require("module")},4589:e=>{"use strict";e.exports=require("node:assert")},6698:e=>{"use strict";e.exports=require("node:async_hooks")},4573:e=>{"use strict";e.exports=require("node:buffer")},1421:e=>{"use strict";e.exports=require("node:child_process")},7540:e=>{"use strict";e.exports=require("node:console")},7598:e=>{"use strict";e.exports=require("node:crypto")},3053:e=>{"use strict";e.exports=require("node:diagnostics_channel")},610:e=>{"use strict";e.exports=require("node:dns")},8474:e=>{"use strict";e.exports=require("node:events")},1455:e=>{"use strict";e.exports=require("node:fs/promises")},7067:e=>{"use strict";e.exports=require("node:http")},2467:e=>{"use strict";e.exports=require("node:http2")},7030:e=>{"use strict";e.exports=require("node:net")},6760:e=>{"use strict";e.exports=require("node:path")},643:e=>{"use strict";e.exports=require("node:perf_hooks")},1792:e=>{"use strict";e.exports=require("node:querystring")},99:e=>{"use strict";e.exports=require("node:sqlite")},7075:e=>{"use strict";e.exports=require("node:stream")},7997:e=>{"use strict";e.exports=require("node:timers")},1692:e=>{"use strict";e.exports=require("node:tls")},7975:e=>{"use strict";e.exports=require("node:util")},3429:e=>{"use strict";e.exports=require("node:util/types")},5919:e=>{"use strict";e.exports=require("node:worker_threads")},8522:e=>{"use strict";e.exports=require("node:zlib")},5181:(e,t,A)=>{"use strict";A.d(t,{ReolinkBaichuanApi:()=>Dt,createScryptedRfc4571TcpServer:()=>Ht});const s=require("crypto"),r=require("events"),n=require("net"),i=require("dgram"),o=require("timers"),a=require("fs"),c=require("path");var l=A(9038);const h=require("child_process"),g=require("fs/promises"),d=require("http");var u=9e3,E=Buffer.from([240,222,188,10]),I=Buffer.from([160,203,237,15]),Q=Uint8Array.from([31,45,60,75,90,105,120,255]),C=Buffer.from("0123456789abcdef","utf8"),B=25620,p=25730;function f(e){return e===B||0===e||e===p}var m=253,y=234,S=289;function D(e){return function(e){return(0,s.createHash)("md5").update(e,"utf8").digest("hex").toUpperCase()}(e).slice(0,31)}function w(e,t){const A=D(`${e}-${t}`).slice(0,16);return Buffer.from(A,"utf8")}function b(e,t){const A=255&t,s=Buffer.allocUnsafe(e.length);for(let t=0;t<e.length;t++){const r=Q[(A+t)%Q.length];s[t]=e[t]^r^A}return s}function R(e,t){return b(e,t)}function N(e,t){if(0===e.length)return Buffer.alloc(0);const A=(0,s.createCipheriv)("aes-128-cfb",t,C);return A.setAutoPadding(!1),Buffer.concat([A.update(e),A.final()])}function k(e,t){if(0===e.length)return Buffer.alloc(0);const A=(0,s.createDecipheriv)("aes-128-cfb",t,C);return A.setAutoPadding(!1),Buffer.concat([A.update(e),A.final()])}function T(e){const t=f(e.messageClass),A=t?24:20,s=Buffer.alloc(A),r=e.magic??E;if(4!==r.length)throw new Error("magic must be 4 bytes");return r.copy(s,0),s.writeUInt32LE(e.cmdId>>>0,4),s.writeUInt32LE(e.bodyLen>>>0,8),s.writeUInt8(255&e.channelId,12),s.writeUInt8(255&e.streamType,13),s.writeUInt16LE(65535&e.msgNum,14),s.writeUInt16LE(65535&e.responseCode,16),s.writeUInt16LE(65535&e.messageClass,18),t&&s.writeUInt32LE((e.payloadOffset??0)>>>0,20),s}function F(e){if(e.length<20)throw new Error("not enough data for Baichuan header");const t=e.subarray(0,4);if(!t.equals(E)&&!t.equals(I))throw new Error(`invalid Baichuan magic: ${t.toString("hex")}`);const A=e.readUInt32LE(4),s=e.readUInt32LE(8),r=e.readUInt8(12),n=e.readUInt8(13),i=e.readUInt16LE(14),o=e.readUInt16LE(16),a=e.readUInt16LE(18),c=f(a)?24:20;if(e.length<c)throw new Error("not enough data for Baichuan header (needs 24 bytes)");const l=e.readUInt32LE(12),h={magic:Buffer.from(t),cmdId:A,bodyLen:s,channelId:r,streamType:n,msgNum:i,responseCode:o,messageClass:a};return 24===c&&(h.payloadOffset=e.readUInt32LE(20)),{header:h,headerLen:c,messageKey:l}}var v=class{buffer=Buffer.alloc(0);push(e){if(0===e.length)return[];const t=e;this.buffer=0===this.buffer.length?t:Buffer.concat([this.buffer,t]);const A=[];for(;!(this.buffer.length<4);){if(!this.buffer.subarray(0,4).equals(E)&&!this.buffer.subarray(0,4).equals(I)){const e=this.buffer.indexOf(E),t=this.buffer.indexOf(I),A=-1===e?t:-1===t?e:Math.min(e,t);if(-1===A){this.buffer=this.buffer.subarray(Math.max(0,this.buffer.length-3));break}if(this.buffer=this.buffer.subarray(A),this.buffer.length<20)break}if(this.buffer.length<20)break;let e;try{e=F(this.buffer)}catch{break}const{header:t,headerLen:s,messageKey:r}=e,n=s+t.bodyLen;if(this.buffer.length<n)break;const i=this.buffer.subarray(0,n),o=i.subarray(s);let a=0;if(24===s){const e=t.payloadOffset??0;a=e>0?Math.min(e,t.bodyLen):0}const c=o.subarray(0,a),l=o.subarray(a);A.push({header:t,body:o,extension:c,payload:l,messageKey:r,raw:i}),this.buffer=this.buffer.subarray(n)}return A}};function M(e){if(null==e||"string"!=typeof e){throw new Error(`xmlEscape: expected string but got ${typeof e}: ${e}`)}return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function U(e){return null==e?'<?xml version="1.0" encoding="UTF-8" ?><Extension version="1.1"></Extension>':`<?xml version="1.0" encoding="UTF-8" ?>\n<Extension version="1.1">\n<channelId>${e}</channelId>\n</Extension>`}function L(e){return null==e?'<?xml version="1.0" encoding="UTF-8" ?><Extension version="1.1"><binaryData>1</binaryData></Extension>':`<?xml version="1.0" encoding="UTF-8" ?>\n<Extension version="1.1">\n<binaryData>1</binaryData>\n<channelId>${e}</channelId>\n</Extension>`}function H(e,t){const A=new RegExp(`<${t}>([^<]*)</${t}>`).exec(e);return A?.[1]}function x(e,t,A,s){let r="";const n=s?.name;"setPos"===A&&void 0!==n&&(r=`<name>${M(n)}</name>`);let i="";return void 0!==s?.enable&&(i=`<enable>${s.enable}</enable>`),`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<PtzPreset version="1.1">\n<channelId>${e}</channelId>\n<presetList>\n<preset>\n<id>${t}</id>\n<command>${A}</command>\n${r}\n${i}\n</preset>\n</presetList>\n</PtzPreset>\n</body>`}function Y(e,t){return`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<audioPlayInfo version="1.1">\n${void 0!==e?`<channelId>${e}</channelId>`:""}\n<playMode>2</playMode>\n<playDuration>10</playDuration>\n<playTimes>1</playTimes>\n<onOff>${t}</onOff>\n</audioPlayInfo>\n</body>`}function P(e,t){return`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<audioPlayInfo version="1.1">\n${void 0!==e?`<channelId>${e}</channelId>`:""}\n<playMode>0</playMode>\n<playDuration>10</playDuration>\n<playTimes>${t}</playTimes>\n<onOff>1</onOff>\n</audioPlayInfo>\n</body>`}function V(e,t,A=180){return`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<FloodlightManual version="1.1">\n<channelId>${e}</channelId>\n<status>${t}</status>\n<duration>${A}</duration>\n</FloodlightManual>\n</body>`}var O,G=713543482,J=713543456,W=713543440;function _(e){const t=function(){if(O)return O;const e=new Uint32Array(256);for(let t=0;t<256;t++){let A=t;for(let e=0;e<8;e++)A=1&A?3988292384^A>>>1:A>>>1;e[t]=A>>>0}return O=e,e}();let A=0;for(let s=0;s<e.length;s++){A=(t[255&(A^e[s])]^A>>>8)>>>0}return A>>>0}var q=Uint32Array.from([523058251,1517059981,941043275,2188469082,2252282411,2781280216,2205278644,401789861]);function $(e,t){const A=Buffer.allocUnsafe(t.length),s=function*(e){let t=0;for(;;){const A=q[t%q.length]+(e>>>0)>>>0;yield 255&A,yield A>>>8&255,yield A>>>16&255,yield A>>>24&255,t++}}(e>>>0);for(let e=0;e<t.length;e++)A[e]=t[e]^s.next().value;return A}function X(e,t){return e.readInt32LE(t)}function z(e,t){const A=$(e,Buffer.from(t,"utf8")),s=_(A),r=Buffer.alloc(20);return r.writeUInt32LE(G,0),r.writeUInt32LE(A.length>>>0,4),r.writeUInt32LE(1,8),r.writeUInt32LE(e>>>0,12),r.writeUInt32LE(s>>>0,16),Buffer.concat([r,A])}function Z(e){const t=Buffer.alloc(20);return t.writeUInt32LE(W,0),t.writeInt32LE(0|e.connectionId,4),t.writeUInt32LE(0,8),t.writeUInt32LE(e.packetId>>>0,12),t.writeUInt32LE(e.payload.length>>>0,16),Buffer.concat([t,e.payload])}function j(e){if(e.length<4)throw new Error("BCUDP packet too short");const t=e.readUInt32LE(0);if(t===G){if(e.length<20)throw new Error("BCUDP discovery header too short");const t=e.readUInt32LE(4),A=e.readUInt32LE(8);if(1!==A)throw new Error(`BCUDP discovery unknownA expected 1, got ${A}`);const s=e.readUInt32LE(12),r=e.readUInt32LE(16),n=e.subarray(20);if(n.length<t)throw new Error("BCUDP discovery payload truncated");const i=n.subarray(0,t);if(r>>>0!=_(i)>>>0)throw new Error("BCUDP discovery CRC mismatch");const o=function(e,t){return $(e,t)}(s,i);return{kind:"discovery",tid:s,xml:o.toString("utf8")}}if(t===J){if(e.length<28)throw new Error("BCUDP ack header too short");const t=X(e,4),A=e.readUInt32LE(8);if(0!==A)throw new Error(`BCUDP ack unknownA expected 0, got ${A}`);const s=e.readUInt32LE(12),r=e.readUInt32LE(16),n=e.readUInt32LE(20),i=e.readUInt32LE(24),o=e.subarray(28);if(o.length<i)throw new Error("BCUDP ack payload truncated");return{kind:"ack",connectionId:t,groupId:s,packetId:r,maybeLatency:n,payload:o.subarray(0,i)}}if(t===W){if(e.length<20)throw new Error("BCUDP data header too short");const t=X(e,4),A=e.readUInt32LE(8);if(0!==A)throw new Error(`BCUDP data unknownA expected 0, got ${A}`);const s=e.readUInt32LE(12),r=e.readUInt32LE(16),n=e.subarray(20);if(n.length<r)throw new Error("BCUDP data payload truncated");return{kind:"data",connectionId:t,packetId:s,payload:n.subarray(0,r)}}throw new Error(`Unknown BCUDP magic 0x${t.toString(16)}`)}function K(e){return`<P2P>${e}</P2P>`}function ee(e){const t=e.conn??"local";return K(`<C2D_A><sid>${e.sid}</sid><conn>${M(t)}</conn><cid>${e.cid}</cid><did>${e.did}</did><mtu>${e.mtu}</mtu></C2D_A>`)}function te(e){const t=/<D2C_CFM>([\s\S]*?)<\/D2C_CFM>/.exec(e);if(!t)return;const A=t[1]??"",s=/<sid>(-?\d+)<\/sid>/.exec(A)?.[1];if(null==s)return;const r=/<conn>([^<]+)<\/conn>/.exec(A)?.[1],n=/<rsp>(-?\d+)<\/rsp>/.exec(A)?.[1],i=/<cid>(-?\d+)<\/cid>/.exec(A)?.[1],o=/<did>(-?\d+)<\/did>/.exec(A)?.[1];return{sid:Number(s),...null!=r?{conn:r}:{},...null!=n?{rsp:Number(n)}:{},...null!=i?{cid:Number(i)}:{},...null!=o?{did:Number(o)}:{}}}function Ae(e){const t=/<D2C_T>([\s\S]*?)<\/D2C_T>/.exec(e);if(!t)return;const A=t[1]??"",s=/<sid>(-?\d+)<\/sid>/.exec(A)?.[1],r=/<cid>(-?\d+)<\/cid>/.exec(A)?.[1],n=/<did>(-?\d+)<\/did>/.exec(A)?.[1];if(null==s||null==r||null==n)return;const i=/<conn>([^<]+)<\/conn>/.exec(A)?.[1];return{sid:Number(s),cid:Number(r),did:Number(n),...null!=i?{conn:i}:{}}}var se=class{currentValues=[];lastReceiveTime=null;displayValue=0;lastDisplayTime=null;getValue(){return this.displayValue}feed(){const e=performance.now();if(null!==this.lastReceiveTime){const t=1e3*(e-this.lastReceiveTime);this.currentValues.push(t)}if(this.lastReceiveTime=e,null!==this.lastDisplayTime){if(e-this.lastDisplayTime>1e3){this.lastDisplayTime=e;const t=this.currentValues.length;if(t>0){const e=this.currentValues.reduce(((e,t)=>e+t),0);this.displayValue=Math.floor(e/t)}else this.displayValue=0;this.currentValues=[]}}else this.lastDisplayTime=e,this.displayValue=0}},re=class extends r.EventEmitter{opts;sock;remote;mtu;clientId;cameraId;sid;sendPacketId=0;packetsWant=0;received=new Map;sent=new Map;ackTimer;resendTimer;hbTimer;discoveryTid;acceptSent=!1;lastAcceptAtMs;ackScheduled=!1;ackLatency=new se;lastAckPacket=Buffer.alloc(0);ackSentCount=0;pendingData=[];pendingDataOffset=0;drainScheduled=!1;getKeepAliveTid(){return null!=this.discoveryTid?this.discoveryTid:(0|Math.floor(255*Math.random()))>>>0}constructor(e){super(),this.opts=e,this.mtu=1350}isConnected(){return!!this.sock&&!!this.remote&&null!=this.cameraId}async connect(){if(this.sock)return;const e=i.createSocket("udp4");this.sock=e;try{e.setRecvBufferSize(4194304),e.setSendBufferSize(4194304)}catch(e){}e.on("message",((e,t)=>{try{const A=j(e);this.handlePacket(A,t.address,t.port)}catch(e){this.emit("error",e instanceof Error?e:new Error(String(e)))}})),e.on("error",(e=>this.emit("error",e))),e.on("close",(()=>this.emit("close"))),await new Promise((t=>e.bind(0,"0.0.0.0",(()=>t())))),"direct"===this.opts.mode?(this.remote={host:this.opts.host,port:this.opts.port},this.clientId=this.opts.clientId,this.cameraId=this.opts.cameraId):await this.discoveryUid(e),this.startTimers()}async discoveryUid(e){if("uid"!==this.opts.mode)throw new Error("Internal: discoveryUid called for non-uid mode");const t=[2015,2018],A="255.255.255.255";e.setBroadcast(!0);const s=e.address(),r="string"==typeof s?0:s.port,n=0|Math.floor(2147483647*Math.random())||82e3,i=function(e){const t=e.os??"MAC";return K(`<C2D_C><uid>${M(e.uid)}</uid><cli><port>${e.clientPort}</port></cli><cid>${e.cid}</cid><mtu>${e.mtu}</mtu><debug>false</debug><p>${M(t)}</p></C2D_C>`)}({uid:this.opts.uid,clientPort:r,cid:n,mtu:this.mtu}),a=await new Promise(((s,r)=>{const n=setTimeout((()=>{a&&clearInterval(a),e.off("message",p),r(new Error("BCUDP discovery timeout after 30000ms (camera may be sleeping or unreachable)"))}),3e4);let a,c,l,h,g,d=0,u=!1,E=!1,I=!1;const Q=t=>{h&&(g||(g=setTimeout((()=>{const A=h,r=c,i=l;A&&(e.off("message",p),clearTimeout(n),a&&clearInterval(a),this.emit("debug","discovery_finalize",{reason:t,...null!=r?{sid:r}:{},...A}),s({...A,...null!=r?{sid:r}:{},...null!=i?{tid:i}:{}}))}),250)))},C=(t,A)=>{if(!u&&h&&null!=c)try{const s=(0|Math.floor(2147483647*Math.random()))>>>0,r=z(s,function(e){const t=e.conn??"local";return K("<C2D_T>"+(null!=e.sid?`<sid>${e.sid}</sid>`:"")+`<conn>${M(t)}</conn><cid>${e.cid}</cid><mtu>${e.mtu}</mtu></C2D_T>`)}({...null!=c?{sid:c}:{},cid:h.cid,mtu:this.mtu,conn:"local"}));e.send(r,A,t),u=!0,this.emit("debug","discovery_t_send",{sid:c,cid:h.cid,did:h.did,rhost:t,rport:A})}catch(e){this.emit("debug","discovery_t_send_error",e)}},B=(t,A,s,r)=>{if(!I)try{const n=z(t,ee({sid:r.sid,conn:r.conn??"local",cid:r.cid,did:r.did,mtu:this.mtu}));e.send(n,s,A),I=!0,this.emit("debug","discovery_a_send",{sid:r.sid,cid:r.cid,did:r.did,rhost:A,rport:s})}catch(e){this.emit("debug","discovery_a_send_error",e)}},p=(e,t)=>{try{const A=j(e);if("discovery"!==A.kind)return;this.emit("debug","discovery_rx",{tid:A.tid,rhost:t.address,rport:t.port,xmlPreview:A.xml.slice(0,120)});const s=te(A.xml);s&&(c=s.sid,h||null==s.cid||null==s.did||(h={cid:s.cid,did:s.did,rhost:t.address,rport:t.port}),h&&(C(t.address,t.port),Q("cfm")));const r=Ae(A.xml);if(r)return E=!0,c=r.sid,h||(h={cid:r.cid,did:r.did,rhost:t.address,rport:t.port}),this.emit("debug","discovery_t_rx",{sid:r.sid,cid:r.cid,did:r.did,rhost:t.address,rport:t.port}),B(A.tid,t.address,t.port,r),void Q("t_a");const n=function(e){const t=/<D2C_C_R>([\s\S]*?)<\/D2C_C_R>/.exec(e);if(!t)return;const A=t[1]??"",s=/<rsp>(-?\d+)<\/rsp>/.exec(A)?.[1],r=/<cid>(-?\d+)<\/cid>/.exec(A)?.[1],n=/<did>(-?\d+)<\/did>/.exec(A)?.[1];if(null==s||null==r||null==n)return;const i=/<sid>(-?\d+)<\/sid>/.exec(A)?.[1],o=/<timer>([\s\S]*?)<\/timer>/.exec(A)?.[1],a=o?/<def>(-?\d+)<\/def>/.exec(o)?.[1]:void 0,c=o?/<hb>(-?\d+)<\/hb>/.exec(o)?.[1]:void 0,l=o?/<hbt>(-?\d+)<\/hbt>/.exec(o)?.[1]:void 0,h=null!=a||null!=c||null!=l?{...null!=a?{def:Number(a)}:{},...null!=c?{hb:Number(c)}:{},...null!=l?{hbt:Number(l)}:{}}:void 0;return{rsp:Number(s),cid:Number(r),did:Number(n),...null!=i?{sid:Number(i)}:{},...h?{timer:h}:{}}}(A.xml);if(!n)return;if(0!==n.rsp)return;return this.emit("debug","discovery_success",{retryCount:d,rhost:t.address,rport:t.port,sid:n.sid??c,timer:n.timer}),l=A.tid,h={cid:n.cid,did:n.did,rhost:t.address,rport:t.port},null!=n.sid&&(c=n.sid),C(t.address,t.port),void(E||I?Q("cr_t"):null!=c?(g&&clearTimeout(g),g=setTimeout((()=>{Q("cr_timeout")}),1500)):Q("cr_no_sid"))}catch{}};e.on("message",p);const f=()=>{const s=z((0|Math.floor(255*Math.random()))>>>0,i);for(const r of t)try{e.send(s,r,A),d++,this.emit("debug","discovery_send",{retryCount:d,host:A,port:r})}catch(e){this.emit("error",e instanceof Error?e:new Error(String(e)))}};f(),a=(0,o.setInterval)((()=>{f()}),500)}));this.clientId=a.cid,this.cameraId=a.did,this.sid=a.sid,this.discoveryTid=a.tid,this.remote={host:a.rhost,port:a.rport}}startTimers(){if(!this.sock||!this.remote||null==this.clientId||null==this.cameraId)throw new Error("BCUDP not ready");this.updateAckPacket(),this.sendHeartbeat(),this.ackTimer=(0,o.setInterval)((()=>{try{this.sendAckFast()}catch(e){this.emit("error",e instanceof Error?e:new Error(String(e)))}}),10),this.resendTimer=(0,o.setInterval)((()=>{try{this.resendOutstanding()}catch(e){this.emit("error",e instanceof Error?e:new Error(String(e)))}}),500),this.hbTimer=(0,o.setInterval)((()=>{try{this.sendHeartbeat()}catch(e){this.emit("error",e instanceof Error?e:new Error(String(e)))}}),1e3)}sendHeartbeat(){if(!this.sock||!this.remote||null==this.clientId||null==this.cameraId)return;const e=this.getKeepAliveTid();let t;var A;t=K(`<C2D_HB><cid>${(A={cid:this.clientId,did:this.cameraId}).cid}</cid><did>${A.did}</did></C2D_HB>`);const s=z(e,t);this.emit("debug","udp_hb_send",{tid:e,xml:t,host:this.remote.host,port:this.remote.port}),this.sock.send(s,this.remote.port,this.remote.host)}buildAckPayload(){if(0===this.packetsWant)return{packetId:4294967295,payload:Buffer.alloc(0)};let e=this.packetsWant;for(;this.received.has(e);)e++;let t=e-1;for(const e of this.received.keys())e>t&&(t=e);const A=e+200-1;if(t>A&&(t=A),t<e)return{packetId:e-1>>>0,payload:Buffer.alloc(0)};const s=t-e+1,r=Buffer.allocUnsafe(s);for(let t=0;t<s;t++)r[t]=this.received.has(e+t)?1:0;return{packetId:e-1>>>0,payload:r}}updateAckPacket(){if(null==this.cameraId)return;const{packetId:e,payload:t}=this.buildAckPayload();this.lastAckPacket=function(e){const t=e.payload??Buffer.alloc(0),A=Buffer.alloc(28);return A.writeUInt32LE(J,0),A.writeInt32LE(0|e.connectionId,4),A.writeUInt32LE(0,8),A.writeUInt32LE(e.groupId>>>0,12),A.writeUInt32LE(e.packetId>>>0,16),A.writeUInt32LE((e.maybeLatency??0)>>>0,20),A.writeUInt32LE(t.length>>>0,24),Buffer.concat([A,t])}({connectionId:this.cameraId,groupId:4294967295===e&&0===t.length?4294967295:0,packetId:e,maybeLatency:this.ackLatency.getValue(),payload:t})}sendAckFast(){this.sock&&this.remote&&0!==this.lastAckPacket.length&&(this.sock.send(this.lastAckPacket,this.remote.port,this.remote.host),this.ackSentCount++,this.ackSentCount%100==0&&this.emit("debug","ack_sent_100",{latency:this.ackLatency.getValue()}))}scheduleAck(e="data"){if("manual"===e){if(this.ackScheduled)return;this.ackScheduled=!0,setImmediate((()=>{this.ackScheduled=!1;try{this.sendAckFast()}catch(e){this.emit("error",e instanceof Error?e:new Error(String(e)))}})),this.emit("debug","ack_scheduled",{reason:e})}}resendOutstanding(){if(this.sock&&this.remote)for(const[,e]of this.sent)this.sock.send(e.buf,this.remote.port,this.remote.host)}handleAckFromCamera(e,t){if(4294967295!==e){for(const t of this.sent.keys())t<=e&&this.sent.delete(t);for(let A=0;A<t.length;A++){if((t[A]??0)>0){const t=e+1+A>>>0;this.sent.delete(t)}}}this.ackLatency.feed()}scheduleDrain(){this.drainScheduled||(this.drainScheduled=!0,setImmediate((()=>{this.drainScheduled=!1;try{for(;this.pendingDataOffset<this.pendingData.length;this.pendingDataOffset++)this.emit("data",this.pendingData[this.pendingDataOffset])}catch(e){this.emit("error",e instanceof Error?e:new Error(String(e)))}finally{this.pendingDataOffset>=this.pendingData.length&&(this.pendingData=[],this.pendingDataOffset=0)}})))}flushReceived(){for(;this.received.has(this.packetsWant);){const e=this.received.get(this.packetsWant);this.received.delete(this.packetsWant),this.packetsWant++,this.pendingData.push(e)}this.pendingData.length>this.pendingDataOffset&&this.scheduleDrain()}handlePacket(e,t,A){const s=e=>{this.remote&&this.remote.host===t&&this.remote.port===A||(this.remote={host:t,port:A},this.emit("debug","remote_update",{reason:e,host:t,port:A}))};if(this.remote||s("first_packet"),"ack"!==e.kind)if("data"!==e.kind){if("discovery"===e.kind){this.emit("debug","discovery_rx_connected",{tid:e.tid,xml:e.xml});const r=function(e){const t=/<D2C_HB>([\s\S]*?)<\/D2C_HB>/.exec(e);if(!t)return;const A=t[1]??"",s=/<cid>(-?\d+)<\/cid>/.exec(A)?.[1],r=/<did>(-?\d+)<\/did>/.exec(A)?.[1];return null!=s&&null!=r?{cid:Number(s),did:Number(r)}:void 0}(e.xml);if(r&&null!=this.clientId&&null!=this.cameraId&&r.cid===this.clientId&&r.did===this.cameraId){this.emit("debug","discovery_hb_rx_connected",{...r,rhost:t,rport:A});try{s("d2c_hb"),this.sendHeartbeat()}catch(e){this.emit("debug","discovery_hb_reply_error",e)}return}const n=Ae(e.xml);if(n&&null!=this.clientId&&null!=this.cameraId&&n.cid===this.clientId&&n.did===this.cameraId){try{s("d2c_t"),this.sid=n.sid,this.emit("debug","discovery_t_rx_connected",{sid:n.sid,cid:n.cid,did:n.did,rhost:t,rport:A});const r=Date.now(),i=750;if(null==this.lastAcceptAtMs||r-this.lastAcceptAtMs>=i){const s=ee({sid:n.sid,conn:n.conn??"local",cid:n.cid,did:n.did,mtu:this.mtu}),i=z(e.tid,s);this.sock?.send(i,A,t),this.acceptSent=!0,this.lastAcceptAtMs=r,this.emit("debug","discovery_a_send_connected",{sid:n.sid,cid:n.cid,did:n.did,rhost:t,rport:A})}else this.emit("debug","discovery_a_skip_throttle",{sinceMs:r-this.lastAcceptAtMs,throttleMs:i,sid:n.sid,cid:n.cid,did:n.did,rhost:t,rport:A})}catch(e){this.emit("debug","discovery_a_send_connected_error",e)}return}const i=te(e.xml);if(i&&null!=this.clientId&&null!=this.cameraId&&i.cid===this.clientId&&i.did===this.cameraId)return this.sid=i.sid,void this.emit("debug","discovery_cfm_rx_connected",i);const o=function(e){const t=/<D2C_DISC>([\s\S]*?)<\/D2C_DISC>/.exec(e);if(!t)return;const A=t[1]??"",s=/<cid>(-?\d+)<\/cid>/.exec(A)?.[1],r=/<did>(-?\d+)<\/did>/.exec(A)?.[1];return null!=s&&null!=r?{cid:Number(s),did:Number(r)}:void 0}(e.xml);if(o&&null!=this.clientId&&null!=this.cameraId&&o.cid===this.clientId&&o.did===this.cameraId)return this.emit("debug","discovery_disc_rx_connected",{...o,rhost:t,rport:A}),this.emit("error",new Error("BCUDP disconnected by camera (D2C_DISC)")),void this.close()}}else null!=this.clientId&&e.connectionId===this.clientId&&(s("data"),e.packetId>=this.packetsWant&&(this.received.set(e.packetId,e.payload),this.flushReceived(),this.updateAckPacket(),this.packetsWant%100==0&&this.emit("debug","udp_progress",{packetsWant:this.packetsWant})));else null!=this.clientId&&e.connectionId===this.clientId&&(s("ack"),this.handleAckFromCamera(e.packetId,e.payload))}write(e){if(!this.sock||!this.remote||null==this.cameraId)throw new Error("BCUDP stream is not connected");const t=this.mtu-20;for(let A=0;A<e.length;A+=t){const s=e.subarray(A,Math.min(e.length,A+t)),r=this.sendPacketId>>>0;this.sendPacketId=this.sendPacketId+1>>>0;const n=Z({connectionId:this.cameraId,packetId:r,payload:Buffer.from(s)});this.sent.set(r,{packetId:r,buf:n,ts:Date.now()}),this.sock.send(n,this.remote.port,this.remote.host)}}async close(){this.ackTimer&&clearInterval(this.ackTimer),this.resendTimer&&clearInterval(this.resendTimer),this.hbTimer&&clearInterval(this.hbTimer),this.ackTimer=void 0,this.resendTimer=void 0,this.hbTimer=void 0;const e=this.sock;this.sock=void 0,e&&await new Promise((t=>e.close((()=>t()))))}};function ne(e){e.dumpEnabled&&a.mkdirSync(e.dumpDir,{recursive:!0})}function ie(e,t,A,s){e.general&&t.debug(`[${A}] ${s}`)}function oe(e,t,A,s){e.traceStream&&t.debug(`[${A}] ${s}`)}function ae(e,t,A,s){e.traceTalk&&t.debug(`[${A}] ${s}`)}function ce(e,t,A,s){e.traceEvents&&t.debug(`[${A}] ${s}`)}function le(e){return 10===e||11===e||201===e||202===e}var he=class e extends r.EventEmitter{static streamingRegistry=new Map;opts;debugCfg;logger;tcpSocket;udpSocket;transport="tcp";parser=new v;pending=new Map;socketClosed=!1;msgNum=0;loggedIn=!1;subscribed=!1;keepAliveTimer;keepAlivePingInFlight=!1;idleDisconnectTimer;lastUserActivityAtMs;permitSeq=1;permits=new Map;lastRxAtMs;lastTxAtMs;lastRxInfo;lastTxInfo;rxHistory=[];txHistory=[];enc={kind:"none"};nonce;videoSubscriptions=new Map;contributesToGlobalStreamingRegistry=!1;streamTraceStats=new Map;rxCmdTraceStats=new Map;constructor(e){super(),this.opts=e,this.logger=e.logger??console,this.debugCfg=function(e){const t=!0===e?.general,A=!0===e?.debugRtsp,s=!0===e?.traceStream,r=!0===e?.traceTalk,n=!0===e?.traceEvents,i=!0===e?.debugH264,o=!0===e?.debugParamSets,a=!0===e?.dump?.enabled;return{general:t,debugRtsp:A,traceStream:s,traceTalk:r,traceEvents:n,debugH264:i,debugParamSets:o,dumpEnabled:a,dumpDir:e?.dump?.dir&&e.dump.dir.trim()||c.join(process.cwd(),"test","frames-debug"),dumpBcMedia:e?.dump?.bcmedia??a,dumpNals:e?.dump?.nals??a}}(e.debugOptions)}logFixed(e,t){const A=`[BaichuanClient] ${e}`,s=this.logger;"function"!=typeof s.info?"function"!=typeof s.log?"function"==typeof s.warn&&s.warn(A,t):s.log(A,t):s.info(A,t)}getIdleDisconnectTimeoutMs(){const e=this.opts.idleDisconnectTimeoutMs;return"number"==typeof e&&Number.isFinite(e)&&e>0?e:3e4}isIdleDisconnectEnabled(){return!0===this.opts.idleDisconnect}clearIdleDisconnectTimer(){this.idleDisconnectTimer&&(clearTimeout(this.idleDisconnectTimer),this.idleDisconnectTimer=void 0)}touchUserActivity(e){this.lastUserActivityAtMs=Date.now(),this.logDebug("user_activity",{reason:e,atMs:this.lastUserActivityAtMs})}isIdleDisconnectEligibleNow(){return!!this.isIdleDisconnectEnabled()&&(!!this.isSocketConnected()&&(!(this.pending.size>0)&&(!this.hasActiveVideoSubscriptionsInternal()&&!(this.permits.size>0))))}kickIdleDisconnectTimer(){if(!this.isIdleDisconnectEnabled())return;if(this.clearIdleDisconnectTimer(),!this.isIdleDisconnectEligibleNow())return;if(null==this.lastUserActivityAtMs)return;const e=this.getIdleDisconnectTimeoutMs(),t=Date.now()-this.lastUserActivityAtMs,A=Math.max(0,e-t);this.idleDisconnectTimer=setTimeout((()=>{try{if(!this.isIdleDisconnectEligibleNow())return;if(null==this.lastUserActivityAtMs)return;const t=Date.now()-this.lastUserActivityAtMs;if(t<e)return void this.kickIdleDisconnectTimer();this.logDebug("idle_disconnect",{elapsedMs:t,timeoutMs:e,transport:this.transport}),this.logFixed("idle_disconnect",{elapsedMs:t,timeoutMs:e,transport:this.transport,host:this.opts.host}),this.close()}catch(e){this.logDebug("idle_disconnect_error",e)}}),A),this.idleDisconnectTimer.unref?.()}acquirePermit(e=this.getIdleDisconnectTimeoutMs(),t){const A=Math.max(0,Math.floor(e)),s=this.permitSeq++,r=Date.now()+A;let n;return A>0&&(n=setTimeout((()=>this.releasePermit(s,"timeout")),A),n.unref?.()),this.permits.set(s,{timer:n,untilMs:r,reason:t}),this.logDebug("permit_acquired",{id:s,holdMs:A,untilMs:r,reason:t,permits:this.permits.size}),this.clearIdleDisconnectTimer(),()=>this.releasePermit(s,"manual")}releasePermit(e,t){const A=this.permits.get(e);A&&(A.timer&&clearTimeout(A.timer),this.permits.delete(e),this.logDebug("permit_released",{id:e,how:t,permits:this.permits.size}),this.kickIdleDisconnectTimer())}getDeviceRegistryKey(){const e=(this.opts.uid??"").trim().toUpperCase();return`${(this.opts.host??"").trim()}|${e}|${this.opts.channel??0}`}recomputeGlobalStreamingContribution(){const t=this.hasActiveVideoSubscriptionsInternal();if(t===this.contributesToGlobalStreamingRegistry)return;const A=this.getDeviceRegistryKey(),s=e.streamingRegistry.get(A)??{activeStreamClients:0},r=Math.max(0,s.activeStreamClients+(t?1:-1));0===r?e.streamingRegistry.delete(A):e.streamingRegistry.set(A,{activeStreamClients:r}),this.contributesToGlobalStreamingRegistry=t}isDeviceStreamingActive(){if(this.hasActiveVideoSubscriptionsInternal())return!0;const t=this.getDeviceRegistryKey(),A=e.streamingRegistry.get(t);return(A?.activeStreamClients??0)>0}logDebug(e,t){this.debugCfg.general&&(this.logger.debug(`[BaichuanClient] ${e}`,t),this.emit("debug",e,t))}getTransport(){return this.transport}getConfiguredChannel(){return this.opts.channel??0}refreshKeepAlive(){this.stopKeepAlive(),this.isSocketConnected()&&this.startKeepAlive()}getLastRxAtMs(){return this.lastRxAtMs}getLastRxInfo(){return this.lastRxInfo}getRxHistory(){return this.rxHistory}getLastTxAtMs(){return this.lastTxAtMs}getLastTxInfo(){return this.lastTxInfo}getTxHistory(){return this.txHistory}recordTx(e){const t=Date.now();this.lastTxAtMs=t,this.lastTxInfo={atMs:t,...e},this.txHistory.push(this.lastTxInfo),this.txHistory.length>32&&this.txHistory.shift()}isProbablySleeping(e=15e3){return"udp"===this.transport&&(this.isIdleDisconnectEnabled()?!this.isSocketConnected():!this.isSocketConnected()||!this.isDeviceStreamingActive()&&(null!=this.lastRxAtMs&&Date.now()-this.lastRxAtMs>=e))}getDebugConfig(){return this.debugCfg}isSocketConnected(){return"tcp"===this.transport?void 0!==this.tcpSocket&&!this.tcpSocket.destroyed:"udp"===this.transport&&(void 0!==this.udpSocket&&(this.udpSocket.isConnected?.()??!0))}get username(){return this.opts.username}startKeepAlive(){if(this.keepAliveTimer)return;let e=3e4;if("udp"===this.transport){if(!this.shouldSendUdpKeepAlive())return;e=2500}e<=0||(this.keepAliveTimer=setInterval((()=>{if("udp"!==this.transport)this.keepAlivePingInFlight||(this.keepAlivePingInFlight=!0,(async()=>{try{await this.sendPing()}catch(e){this.logDebug("keepalive_ping_error",e)}finally{this.keepAlivePingInFlight=!1}})());else try{this.sendUdpKeepAlive()}catch(e){this.logDebug("udp_keepalive_ping_error",e)}}),e),this.keepAliveTimer.unref?.())}hasActiveVideoSubscriptionsInternal(){for(const e of this.videoSubscriptions.values())if(e.size>0)return!0;return!1}hasActiveVideoSubscriptions(){return this.hasActiveVideoSubscriptionsInternal()}shouldSendUdpKeepAlive(){return"udp"===this.transport&&(!!this.udpSocket&&(!!this.loggedIn&&!!this.hasActiveVideoSubscriptionsInternal()))}sendUdpKeepAlive(){if("udp"!==this.transport)return;if(!this.udpSocket)return;if(!this.loggedIn)return;const e=this.nextMsgNum(),t=T({cmdId:y,bodyLen:0,channelId:0,streamType:0,msgNum:e,responseCode:0,messageClass:B,payloadOffset:0});this.logDebug("udp_keepalive_ping_tx",{msgNum:e,channelId:0,streamType:0}),this.recordTx({cmdId:y,responseCode:0,msgNum:e,channelId:0,streamType:0}),this.writeWire(t)}stopKeepAlive(){this.keepAliveTimer&&(clearInterval(this.keepAliveTimer),this.keepAliveTimer=void 0),this.keepAlivePingInFlight=!1}async sendPing(){if((this.tcpSocket||this.udpSocket)&&this.loggedIn)try{await this.sendFrame({cmdId:93,channel:this.opts.channel??0,channelIdOverride:0,messageClass:B,streamType:0,extensionXml:"",internal:!0})}catch(e){this.logDebug("keepalive_ping_failed",e)}}async connect(){const e=this.opts.transport??"tcp";if("tcp"!==e)if("udp"!==e)try{await Promise.race([this.connectTcp(),new Promise(((e,t)=>setTimeout((()=>t(new Error("TCP connection timeout (falling back to UDP)"))),4e3)))])}catch(e){if(this.logDebug("auto:tcp_failed",e),!this.opts.uid)throw new Error("TCP connection failed and UDP fallback requires `options.uid` (BCUDP discovery UID).");await this.connectUdp()}else await this.connectUdp();else await this.connectTcp()}async connectTcp(){if(this.tcpSocket&&!this.tcpSocket.destroyed)return void(this.transport="tcp");const e=this.opts.port??u,t=n.createConnection({host:this.opts.host,port:e});this.tcpSocket=t,this.transport="tcp",this.socketClosed=!1;try{t.setKeepAlive(!0,3e4)}catch(e){this.logDebug("tcp_setKeepAlive_failed",e)}t.on("data",(e=>{const t=this.parser.push(e);for(const e of t)this.handleFrame(e)})),t.on("close",(()=>{this.stopKeepAlive(),this.socketClosed=!0,this.logFixed("disconnected",{transport:"tcp",host:this.opts.host,port:this.opts.port??u,lastRx:this.lastRxInfo,lastTx:this.lastTxInfo}),this.emit("close");const e=Array.from(this.pending.entries());this.pending.clear();for(const[,t]of e)setImmediate((()=>{try{t.reject(new Error("Baichuan socket closed"))}catch(e){}}))})),t.on("error",(e=>this.emit("error",e))),await new Promise(((e,A)=>{t.once("connect",(()=>e())),t.once("error",(e=>A(e)))})),this.logFixed("connected",{transport:"tcp",host:this.opts.host,port:this.opts.port??u}),this.startKeepAlive(),this.kickIdleDisconnectTimer()}async connectUdp(){if(this.udpSocket){if(this.udpSocket.isConnected?.())return void(this.transport="udp");try{await this.udpSocket.close()}catch{}this.udpSocket=void 0}if(!this.opts.uid)throw new Error("Baichuan UDP requested but `options.uid` is not set (required for BCUDP discovery).");const e=new re({mode:"uid",uid:this.opts.uid});this.udpSocket=e,this.transport="udp",this.socketClosed=!1,e.on("data",(e=>{const t=this.parser.push(e);for(const e of t)this.handleFrame(e)})),e.on("close",(()=>{this.stopKeepAlive(),this.socketClosed=!0,this.logFixed("disconnected",{transport:"udp",host:this.opts.host,uid:this.opts.uid,lastRx:this.lastRxInfo,lastTx:this.lastTxInfo}),this.loggedIn=!1,this.subscribed=!1,this.contributesToGlobalStreamingRegistry&&(this.videoSubscriptions.clear(),this.recomputeGlobalStreamingContribution()),this.udpSocket===e&&(this.udpSocket=void 0),this.emit("close");const t=Array.from(this.pending.entries());this.pending.clear();for(const[,e]of t)setImmediate((()=>{try{e.reject(new Error("Baichuan UDP stream closed"))}catch(e){}}))})),e.on("error",(e=>{e?.message?.includes("D2C_DISC")&&(this.stopKeepAlive(),this.loggedIn=!1,this.subscribed=!1,this.contributesToGlobalStreamingRegistry&&(this.videoSubscriptions.clear(),this.recomputeGlobalStreamingContribution())),this.emit("error",e)})),e.on("debug",((e,t)=>{this.logDebug(`udp_${e}`,t)})),await e.connect(),this.logFixed("connected",{transport:"udp",host:this.opts.host,uid:this.opts.uid}),this.startKeepAlive(),this.kickIdleDisconnectTimer()}async close(){this.stopKeepAlive(),this.clearIdleDisconnectTimer();for(const e of Array.from(this.permits.keys()))this.releasePermit(e,"close");this.contributesToGlobalStreamingRegistry&&(this.videoSubscriptions.clear(),this.recomputeGlobalStreamingContribution());const e=this.tcpSocket;this.tcpSocket=void 0,e&&await new Promise((t=>{e.once("close",(()=>t())),e.destroy()}));const t=this.udpSocket;this.udpSocket=void 0,t&&await t.close()}handleFrame(e){const t=Date.now();if(this.lastRxAtMs=t,this.lastRxInfo={atMs:t,cmdId:e.header.cmdId,responseCode:e.header.responseCode,msgNum:e.header.msgNum,channelId:e.header.channelId,streamType:e.header.streamType},this.rxHistory.push(this.lastRxInfo),this.rxHistory.length>32&&this.rxHistory.shift(),this.debugCfg.general)if(3===e.header.cmdId){const A=this.rxCmdTraceStats.get(3)??{lastLogMs:t,frames:0};A.frames++,t-A.lastLogMs>=1e3&&(ie(this.debugCfg,this.logger,"BaichuanRx",`rx cmdId=3 frames=${A.frames} lastMsgNum=${e.header.msgNum} lastResponseCode=${e.header.responseCode} lastChannelId=${e.header.channelId} lastStreamType=${e.header.streamType} lastBodyLen=${e.body.length} lastPayloadLen=${e.payload.length}`),A.lastLogMs=t,A.frames=0),this.rxCmdTraceStats.set(3,A)}else ie(this.debugCfg,this.logger,"BaichuanRx",`rx cmdId=${e.header.cmdId} msgNum=${e.header.msgNum} responseCode=${e.header.responseCode} channelId=${e.header.channelId} streamType=${e.header.streamType} bodyLen=${e.body.length} payloadLen=${e.payload.length} payloadOffset=${e.header.payloadOffset??0}`);if("udp"===this.transport&&e.header.cmdId===y){try{const t=T({cmdId:e.header.cmdId,bodyLen:0,channelId:e.header.channelId,streamType:e.header.streamType,msgNum:e.header.msgNum,responseCode:200,messageClass:e.header.messageClass,payloadOffset:0});this.logDebug("udp_keepalive_rx",{msgNum:e.header.msgNum,channelId:e.header.channelId,streamType:e.header.streamType,responseCode:e.header.responseCode}),this.recordTx({cmdId:e.header.cmdId,responseCode:200,msgNum:e.header.msgNum,channelId:e.header.channelId,streamType:e.header.streamType}),this.writeWire(t),this.logDebug("udp_keepalive_tx",{msgNum:e.header.msgNum,channelId:e.header.channelId,streamType:e.header.streamType})}catch(e){this.logDebug("udp_keepalive_error",e)}return}this.debugCfg.traceTalk&&le(e.header.cmdId)&&ae(this.debugCfg,this.logger,"BaichuanTalk",`rx cmdId=${e.header.cmdId} msgNum=${e.header.msgNum} responseCode=${e.header.responseCode} channelId=${e.header.channelId} bodyLen=${e.body.length} payloadLen=${e.payload.length} payloadOffset=${e.header.payloadOffset??0}`),this.emit("frame",e);const A=`${e.header.cmdId}:${e.header.msgNum}`,s=this.pending.get(A);if(s)return this.pending.delete(A),void s.resolve(e);const r=this.videoSubscriptions.get(e.header.cmdId);if(r&&r.size>0){if(r.has(e.header.msgNum)){if(this.debugCfg.traceStream&&3===e.header.cmdId){const t=Date.now(),A=e.header.msgNum,s=this.streamTraceStats.get(A)??{lastLogMs:t,frames:0};s.frames++,t-s.lastLogMs>=500&&(oe(this.debugCfg,this.logger,"BaichuanTrace",`rx stream frames cmdId=3 msgNum=${e.header.msgNum} frames=${s.frames} lastChannelId=${e.header.channelId} lastBodyLen=${e.body.length} lastPayloadLen=${e.payload.length} lastPayloadOffset=${e.header.payloadOffset??0}`),s.lastLogMs=t,s.frames=0),this.streamTraceStats.set(A,s)}this.emit("push",e)}}else if(this.emit("push",e),33===e.header.cmdId)try{const t=this.parseEvents(e);for(const A of t)ce(this.debugCfg,this.logger,"BaichuanEvent",`dispatch cmdId=33 msgNum=${e.header.msgNum} channelId=${e.header.channelId} type=${A.type} eventChannel=${A.channel}`+("ai"===A.type?` aiType=${A.ai?.type??"unknown"} detected=${A.ai?.detected??""}`:"")+("motion"===A.type?` source=${A.motion?.source??""}`:"")),this.emit("event",A)}catch(e){this.logDebug("event_parse_error",e)}}subscribeVideoStream(e,t){this.videoSubscriptions.has(e)||this.videoSubscriptions.set(e,new Set),this.videoSubscriptions.get(e).add(t),3!==e||this.streamTraceStats.has(t)||this.streamTraceStats.set(t,{lastLogMs:Date.now(),frames:0}),"udp"===this.transport&&this.refreshKeepAlive(),this.recomputeGlobalStreamingContribution(),this.kickIdleDisconnectTimer()}unsubscribeVideoStream(e,t){const A=this.videoSubscriptions.get(e);A&&(void 0!==t?(A.delete(t),0===A.size&&this.videoSubscriptions.delete(e),3===e&&this.streamTraceStats.delete(t)):(this.videoSubscriptions.delete(e),3===e&&this.streamTraceStats.clear()),"udp"===this.transport&&this.refreshKeepAlive(),this.recomputeGlobalStreamingContribution(),this.kickIdleDisconnectTimer())}parseEvents(e){const t=e.body;if(0===t.length)return[];const A=this.tryDecryptXml(t,e.header.channelId,this.enc);if(!A||!A.startsWith("<?xml"))return[];if(this.debugCfg.traceEvents){const t=A.length>500?`${A.slice(0,500)}...`:A;ce(this.debugCfg,this.logger,"BaichuanEventRaw",`rx cmdId=${e.header.cmdId} msgNum=${e.header.msgNum} responseCode=${e.header.responseCode} channelId=${e.header.channelId} xml=${JSON.stringify(t)}`)}const s=e.header.channelId,r=250===s?0:Math.max(0,s-1),n=Date.now();if(A.includes("<AlarmEventList")){const e=[],t=A.matchAll(/<AlarmEvent\b[^>]*>([\s\S]*?)<\/AlarmEvent>/g);for(const A of t){const t=A[1]??"",s=H(t,"channelId"),i=void 0!==s?Number(s):r,o=(H(t,"status")??"").trim(),a=o.toUpperCase(),c=(H(t,"AItype")??H(t,"aiType")??H(t,"aitype")??"").trim();this.debugCfg.traceEvents&&ce(this.debugCfg,this.logger,"BaichuanEventRaw",`AlarmEvent channel=${i} status=${JSON.stringify(o)} aiType=${JSON.stringify(c)}`);const l=o.toLowerCase(),h=l.length>0&&"none"!==l,g=c.trim().length>0&&"none"!==c.trim().toLowerCase();if(h||g){const t=a.includes("MD")?"md":a.includes("PIR")||a.includes("OTHER")?"pir":"unknown";e.push({channel:i,type:"motion",motion:{channel:i,state:!0,timestamp:n,source:t},timestamp:n})}const d=c?c.split(",").map((e=>e.trim())).find((e=>e.length>0&&"none"!==e.toLowerCase())):void 0;if(d){const t=d.toLowerCase(),A={people:"people",person:"people",human:"people",vehicle:"vehicle",car:"vehicle",dog_cat:"dog_cat",dog:"dog_cat",cat:"dog_cat",pet:"dog_cat",face:"face",package:"package"};e.push({channel:i,type:"ai",ai:{channel:i,type:A[t]??"other",detected:!0,timestamp:n},timestamp:n})}else a.includes("AI")&&e.push({channel:i,type:"ai",ai:{channel:i,type:"other",detected:!0,timestamp:n},timestamp:n});a.includes("VIS")&&e.push({channel:i,type:"visitor",timestamp:n}),a.includes("DN")&&e.push({channel:i,type:"daynight",timestamp:n})}return e}const i=A.match(/<Event\b[^>]*>([\s\S]*?)<\/Event>/);if(!i)return[];const o=i[1]??"",a=(H(o,"status")??"").trim(),c=a.toUpperCase(),l=(H(o,"AItype")??H(o,"aiType")??H(o,"aitype")??"").trim(),h=[],g=a.toLowerCase(),d=g.length>0&&"none"!==g,u=l.trim().length>0&&"none"!==l.trim().toLowerCase();if(d||u){const e=c.includes("MD")?"md":c.includes("PIR")||c.includes("OTHER")?"pir":"unknown";h.push({channel:r,type:"motion",motion:{channel:r,state:!0,timestamp:n,source:e},timestamp:n})}const E=l?l.split(",").map((e=>e.trim())).find((e=>e.length>0&&"none"!==e.toLowerCase())):void 0;if(E){const e=E.toLowerCase(),t={people:"people",person:"people",human:"people",vehicle:"vehicle",car:"vehicle",dog_cat:"dog_cat",dog:"dog_cat",cat:"dog_cat",pet:"dog_cat",face:"face",package:"package"};h.push({channel:r,type:"ai",ai:{channel:r,type:t[e]??"other",detected:!0,timestamp:n},timestamp:n})}else c.includes("AI")&&h.push({channel:r,type:"ai",ai:{channel:r,type:"other",detected:!0,timestamp:n},timestamp:n});return c.includes("VIS")&&h.push({channel:r,type:"visitor",timestamp:n}),c.includes("DN")&&h.push({channel:r,type:"daynight",timestamp:n}),h}nextMsgNum(){return this.msgNum=this.msgNum+1&65535,this.msgNum}peekNextMsgNum(){return this.msgNum+1&65535}requireSocket(){if("tcp"!==this.transport)throw new Error("Internal: requireSocket called while not using TCP");if(!this.tcpSocket||this.tcpSocket.destroyed)throw new Error("Baichuan TCP socket is not connected");return this.tcpSocket}writeWire(e){if(this.lastTxAtMs=Date.now(),"tcp"!==this.transport){if(!this.udpSocket)throw new Error("Baichuan UDP stream is not connected");this.udpSocket.write(e)}else this.requireSocket().write(e)}encodeBodyXml(e,t,A,s){const r=Buffer.from(e,"utf8"),n=Buffer.from(t,"utf8");return"none"===s.kind?Buffer.concat([r,n]):"bc"===s.kind?Buffer.concat([b(r,A),b(n,A)]):"aes"===s.kind||"full_aes"===s.kind?Buffer.concat([N(r,s.key),N(n,s.key)]):Buffer.concat([r,n])}encodeBodyBinary(e,t,A,s){const r=Buffer.from(e,"utf8");return"none"===s.kind?Buffer.concat([r,t]):"bc"===s.kind?Buffer.concat([b(r,A),t]):"aes"===s.kind||"full_aes"===s.kind?Buffer.concat([N(r,s.key),t]):Buffer.concat([r,t])}async sendBinaryPayloadNoReply(e){const t=!0===e.internal;t||this.touchUserActivity(`sendBinaryPayloadNoReply cmdId=${e.cmdId}`),await this.connect(),t||this.kickIdleDisconnectTimer();const A=e.channel??this.opts.channel??0,s=e.channelIdOverride??(null==e.channel?250:A+1),r=this.nextMsgNum(),n=e.cmdId,i=e.extensionXml??L(A),o=Buffer.byteLength(i,"utf8"),a=o+e.payload.length,c=e.messageClass??B,l=T({cmdId:n,bodyLen:a,channelId:s,streamType:e.streamType??0,msgNum:r,responseCode:0,messageClass:c,payloadOffset:o}),h=e.encryption??this.enc,g=this.encodeBodyBinary(i,e.payload,s,h),d=Buffer.concat([l,g]);this.logDebug("tx",{cmdId:n,msgNum:r,channelId:s,messageClass:c,bodyLen:a,binaryPayload:!0}),this.debugCfg.traceTalk&&le(n)&&ae(this.debugCfg,this.logger,"BaichuanTalk",`tx cmdId=${n} msgNum=${r} channelId=${s} streamType=${e.streamType??0} class=0x${c.toString(16)} bodyLen=${a} payloadOffset=${o} binaryPayloadLen=${e.payload.length}`),this.recordTx({cmdId:n,responseCode:0,msgNum:r,channelId:s,streamType:e.streamType??0}),this.writeWire(d),t||this.kickIdleDisconnectTimer()}tryDecryptXml(e,t,A){const s=e=>e.toString("utf8"),r=A=>{let r;try{r="none"===A.kind?e:"bc"===A.kind?R(e,t):k(e,A.key)}catch{return}const n=s(r);return n.startsWith("<?xml")?n:void 0};return r(A)??("bc"!==A.kind?r({kind:"bc"}):void 0)??r({kind:"none"})??s(e)}async sendXml(e){const t=!0===e.internal;t||this.touchUserActivity(`sendXml cmdId=${e.cmdId}`),await this.connect(),t||this.kickIdleDisconnectTimer();const A=e.channel??this.opts.channel??0,s=e.channelIdOverride??(null==e.channel?250:A+1),r=this.nextMsgNum(),n=e.cmdId,i=e.extensionXml??(null!=e.channel?U(A):""),o=e.payloadXml??"",a=e.messageClass??B,c=Buffer.byteLength(i,"utf8"),l=c+Buffer.byteLength(o,"utf8"),h=T({cmdId:n,bodyLen:l,channelId:s,streamType:e.streamType??0,msgNum:r,responseCode:0,messageClass:a,payloadOffset:c}),g=`${n}:${r}`,d=e.encryption??this.enc,u=this.encodeBodyXml(i,o,s,d),E=Buffer.concat([h,u]),I=e.timeoutMs??1e4;let Q;const C=new Promise(((e,t)=>{Q=t;const A=setTimeout((()=>{this.pending.delete(g),t(new Error(`Baichuan timeout cmdId=${n} msgNum=${r}`))}),I);this.pending.set(g,{resolve:t=>{clearTimeout(A),e(t)},reject:e=>{clearTimeout(A),t(e)}})}));C.catch((()=>{})),this.logDebug("tx",{cmdId:n,msgNum:r,channelId:s,messageClass:a,bodyLen:l}),!this.debugCfg.traceStream||3!==n&&4!==n||oe(this.debugCfg,this.logger,"BaichuanTrace",`tx cmdId=${n} msgNum=${r} channelId=${s} streamType=${e.streamType??0} class=0x${a.toString(16)} bodyLen=${l} payloadOffset=${c}`),this.debugCfg.traceTalk&&le(n)&&ae(this.debugCfg,this.logger,"BaichuanTalk",`tx cmdId=${n} msgNum=${r} channelId=${s} streamType=${e.streamType??0} class=0x${a.toString(16)} bodyLen=${l} payloadOffset=${c}`),this.recordTx({cmdId:n,responseCode:0,msgNum:r,channelId:s,streamType:e.streamType??0}),this.writeWire(E);const p=await C;if(this.logDebug("rx",{cmdId:p.header.cmdId,responseCode:p.header.responseCode,msgNum:p.header.msgNum}),!this.debugCfg.traceStream||3!==n&&4!==n||oe(this.debugCfg,this.logger,"BaichuanTrace",`rx cmdId=${p.header.cmdId} msgNum=${p.header.msgNum} responseCode=${p.header.responseCode} channelId=${p.header.channelId} bodyLen=${p.body.length} payloadLen=${p.payload.length} payloadOffset=${p.header.payloadOffset??0}`),this.debugCfg.traceTalk&&le(n)&&ae(this.debugCfg,this.logger,"BaichuanTalk",`rx cmdId=${p.header.cmdId} msgNum=${p.header.msgNum} responseCode=${p.header.responseCode} channelId=${p.header.channelId} bodyLen=${p.body.length} payloadLen=${p.payload.length} payloadOffset=${p.header.payloadOffset??0}`),400===p.header.responseCode){if(0===p.body.length)throw new Error("Baichuan authentication failed (responseCode 400, empty body) - check username/password")}const f=p.body;if(0===f.length)return t||this.kickIdleDisconnectTimer(),"";const m=this.tryDecryptXml(f,p.header.channelId,d);return t||this.kickIdleDisconnectTimer(),m}async sendFrame(e){const t=!0===e.internal;t||this.touchUserActivity(`sendFrame cmdId=${e.cmdId}`),await this.connect(),t||this.kickIdleDisconnectTimer();const A=e.channel??this.opts.channel??0,s=e.channelIdOverride??(null==e.channel?250:A+1),r=e.msgNumOverride??this.nextMsgNum(),n=e.cmdId,i=e.extensionXml??(null!=e.channel?U(A):""),o=e.payloadXml??"",a=e.messageClass??B,c=Buffer.byteLength(i,"utf8"),l=c+Buffer.byteLength(o,"utf8"),h=T({cmdId:n,bodyLen:l,channelId:s,streamType:e.streamType??0,msgNum:r,responseCode:0,messageClass:a,payloadOffset:c}),g=`${n}:${r}`,d=e.encryption??this.enc,u=this.encodeBodyXml(i,o,s,d),E=Buffer.concat([h,u]),I=e.timeoutMs??1e4;let Q;const C=new Promise(((e,t)=>{Q=t;const A=setTimeout((()=>{this.pending.delete(g),t(new Error(`Baichuan timeout cmdId=${n} msgNum=${r}`))}),I);this.pending.set(g,{resolve:t=>{clearTimeout(A),e(t)},reject:e=>{clearTimeout(A),t(e)}})}));C.catch((()=>{})),this.logDebug("tx",{cmdId:n,msgNum:r,channelId:s,messageClass:a,bodyLen:l}),!this.debugCfg.traceStream||3!==n&&4!==n||oe(this.debugCfg,this.logger,"BaichuanTrace",`tx cmdId=${n} msgNum=${r} channelId=${s} streamType=${e.streamType??0} class=0x${a.toString(16)} bodyLen=${l} payloadOffset=${c}`),this.debugCfg.traceTalk&&le(n)&&ae(this.debugCfg,this.logger,"BaichuanTalk",`tx cmdId=${n} msgNum=${r} channelId=${s} streamType=${e.streamType??0} class=0x${a.toString(16)} bodyLen=${l} payloadOffset=${c}`),this.recordTx({cmdId:n,responseCode:0,msgNum:r,channelId:s,streamType:e.streamType??0}),this.writeWire(E);const p=await C;return this.logDebug("rx",{cmdId:p.header.cmdId,responseCode:p.header.responseCode,msgNum:p.header.msgNum}),!this.debugCfg.traceStream||3!==n&&4!==n||oe(this.debugCfg,this.logger,"BaichuanTrace",`rx cmdId=${p.header.cmdId} msgNum=${p.header.msgNum} responseCode=${p.header.responseCode} channelId=${p.header.channelId} bodyLen=${p.body.length} payloadLen=${p.payload.length} payloadOffset=${p.header.payloadOffset??0}`),this.debugCfg.traceTalk&&le(n)&&ae(this.debugCfg,this.logger,"BaichuanTalk",`rx cmdId=${p.header.cmdId} msgNum=${p.header.msgNum} responseCode=${p.header.responseCode} channelId=${p.header.channelId} bodyLen=${p.body.length} payloadLen=${p.payload.length} payloadOffset=${p.header.payloadOffset??0}`),t||this.kickIdleDisconnectTimer(),p}async sendBinary(e){const t=!0===e.internal;if(t||this.touchUserActivity(`sendBinary cmdId=${e.cmdId}`),109===e.cmdId){const A=await this.sendBinarySnapshot109(e);return t||this.kickIdleDisconnectTimer(),A}if((e.messageClass??B)===p){const A=await this.sendBinaryFileDownload6482(e);return t||this.kickIdleDisconnectTimer(),A}await this.connect(),t||this.kickIdleDisconnectTimer();const A=e.channel??this.opts.channel??0,s=e.channelIdOverride??(null==e.channel?250:A+1),r=this.nextMsgNum(),n=e.cmdId,i=e.extensionXml??(null!=e.channel?L(A):L(void 0)),o=e.payloadXml??"",a=e.messageClass??B,c=Buffer.byteLength(i,"utf8"),l=c+Buffer.byteLength(o,"utf8"),h=T({cmdId:n,bodyLen:l,channelId:s,streamType:0,msgNum:r,responseCode:0,messageClass:a,payloadOffset:c}),g=`${n}:${r}`,d=e.encryption??this.enc,u=this.encodeBodyXml(i,o,s,d),E=Buffer.concat([h,u]),I=e.timeoutMs??1e4;let Q;const C=new Promise(((e,t)=>{Q=t;const A=setTimeout((()=>{this.pending.delete(g),t(new Error(`Baichuan timeout cmdId=${n} msgNum=${r}`))}),I);this.pending.set(g,{resolve:t=>{clearTimeout(A),e(t)},reject:e=>{clearTimeout(A),t(e)}})}));C.catch((()=>{})),this.logDebug("tx",{cmdId:n,msgNum:r,channelId:s,messageClass:a,bodyLen:l,binary:!0}),this.recordTx({cmdId:n,responseCode:0,msgNum:r,channelId:s,streamType:0}),this.writeWire(E);const f=await C;if(this.logDebug("rx",{cmdId:f.header.cmdId,responseCode:f.header.responseCode,msgNum:f.header.msgNum,binary:!0}),400===f.header.responseCode){if(0===f.body.length)throw new Error("Baichuan binary request failed (responseCode 400, empty body)")}const m=f.payload;if(0===m.length)return Buffer.alloc(0);const y=this.tryDecryptBinary(m,f.header.channelId,d);return t||this.kickIdleDisconnectTimer(),y}async sendBinaryFileDownload6482(e){await this.connect();const t=e.channel??this.opts.channel??0,A=e.channelIdOverride??(null==e.channel?250:t+1),s=this.nextMsgNum(),r=e.cmdId,n=e.extensionXml??L(t),i=e.payloadXml??"",o=e.messageClass??p,a=Buffer.byteLength(n,"utf8"),c=a+Buffer.byteLength(i,"utf8"),l=T({cmdId:r,bodyLen:c,channelId:A,streamType:e.streamType??0,msgNum:s,responseCode:0,messageClass:o,payloadOffset:a}),h=e.encryption??this.enc,g=this.encodeBodyXml(n,i,A,h),d=Buffer.concat([l,g]),u=e.timeoutMs??6e4,E=[];let I=0,Q=0;return await new Promise(((t,n)=>{let i,a=!1;const l=()=>{this.off("frame",C),i&&clearTimeout(i)},g=e=>{a||(a=!0,l(),n(e instanceof Error?e:new Error(String(e))))},C=e=>{var A;if(e.header.cmdId===r)if(e.header.msgNum===s&&e.header.responseCode>=400)g(new Error(`Baichuan file download request rejected (cmdId=${r} msgNum=${s} responseCode=${e.header.responseCode})`));else try{let n=!1;if(e.extension.length>0)try{this.tryDecryptXml(e.extension,e.header.channelId,h).includes("<binaryData>1</binaryData>")&&(n=!0)}catch{}const i=this.tryDecryptBinary(e.payload,e.header.channelId,h);if(0===i.length)return;if(!n&&(e=>{let t=0;for(;t<e.length&&(0===e[t]||9===e[t]||10===e[t]||13===e[t]||32===e[t]);)t++;return!(t>=e.length)&&60===e[t]})(i))return;E.push(i),I+=i.length;const o=Date.now();this.debugCfg.general&&o-Q>=2e3&&(Q=o,this.logDebug("file_download_progress",{cmdId:r,msgNum:s,bytes:I})),201===e.header.responseCode&&(A=Buffer.concat(E),a||(a=!0,l(),t(A)))}catch(e){g(e)}};i=setTimeout((()=>{g(new Error(`Baichuan timeout waiting file download chunks cmdId=${r} msgNum=${s}`))}),u),this.on("frame",C);try{this.logDebug("tx",{cmdId:r,msgNum:s,channelId:A,messageClass:o,bodyLen:c,binary:!0,fileDownload:!0}),this.recordTx({cmdId:r,responseCode:0,msgNum:s,channelId:A,streamType:e.streamType??0}),this.writeWire(d)}catch(e){g(e)}}))}async sendBinarySnapshot109(e){await this.connect();const t=e.channel??this.opts.channel??0,A=e.channelIdOverride??(null==e.channel?250:t+1),s=this.nextMsgNum(),r=e.cmdId,n=e.extensionXml??(null!=e.channel?U(t):""),i=e.payloadXml??"",o=e.messageClass??B,a=Buffer.byteLength(n,"utf8"),c=a+Buffer.byteLength(i,"utf8"),l=T({cmdId:r,bodyLen:c,channelId:A,streamType:e.streamType??0,msgNum:s,responseCode:0,messageClass:o,payloadOffset:a}),h=e.encryption??this.enc,g=this.encodeBodyXml(n,i,A,h),d=Buffer.concat([l,g]),u=e.timeoutMs??15e3,E=[];let I=!1;return await new Promise(((t,n)=>{let i,a=!1;const l=()=>{this.off("frame",C),i&&clearTimeout(i)},g=e=>{a||(a=!0,l(),t(e))},Q=e=>{a||(a=!0,l(),n(e instanceof Error?e:new Error(String(e))))},C=e=>{if(e.header.cmdId===r)if(e.header.msgNum===s&&e.header.responseCode>=400)Q(new Error(`Baichuan snapshot request rejected (cmdId=${r} msgNum=${s} responseCode=${e.header.responseCode})`));else try{let t=!1;if(e.extension.length>0){this.tryDecryptXml(e.extension,e.header.channelId,h).includes("<binaryData>1</binaryData>")&&(t=!0)}const A=this.tryDecryptBinary(e.payload,e.header.channelId,h);if(0===A.length)return;const s=A.subarray(0,Math.min(16,A.length)).toString("utf8"),r=s.startsWith("<?xml")||s.trimStart().startsWith("<");if(!t&&r)return;let n=A;if(!I){const s=(e=>{for(let t=0;t+1<e.length;t++)if(255===e[t]&&216===e[t+1])return t;return-1})(A);if(-1===s){if(!t)return;n=A,E.push(n);const s=Buffer.concat(E);return void(201===e.header.responseCode&&g(s))}I=!0,n=A.subarray(s)}E.push(n);const i=Buffer.concat(E);if((e=>{for(let t=0;t+1<e.length;t++)if(255===e[t]&&217===e[t+1])return!0;return!1})(i)||201===e.header.responseCode){const e=i.indexOf(Buffer.from([255,217]));if(-1!==e)return void g(i.subarray(0,e+2));g(i)}}catch(e){Q(e)}};i=setTimeout((()=>{Q(new Error(`Baichuan timeout waiting snapshot push cmdId=${r} msgNum=${s}`))}),u),this.on("frame",C);try{this.logDebug("tx",{cmdId:r,msgNum:s,channelId:A,messageClass:o,bodyLen:c,binary:!0,snapshot:!0}),this.recordTx({cmdId:r,responseCode:0,msgNum:s,channelId:A,streamType:e.streamType??0}),this.writeWire(d)}catch(e){Q(e)}}))}tryDecryptBinary(e,t,A){if(0===e.length)return e;const s=A=>{try{return"none"===A.kind?e:"bc"===A.kind?R(e,t):"aes"===A.kind||"full_aes"===A.kind?k(e,A.key):null}catch{return null}};return s(A)??("bc"===A.kind||"none"===this.enc.kind||"aes"!==this.enc.kind&&"full_aes"!==this.enc.kind?null:s(this.enc))??("bc"!==A.kind?s({kind:"bc"}):null)??s({kind:"none"})??e}async login(e="full_aes"){if(this.loggedIn)return;let t;const A=e=>new Promise((t=>setTimeout(t,e)));for(let r=1;r<=3;r++)try{const t="none"===e?56320:"bc"===e?56321:56338;await this.connect();const A=this.nextMsgNum(),r=1,n=T({cmdId:r,bodyLen:0,channelId:250,streamType:0,msgNum:A,responseCode:t,messageClass:25876}),i=`${r}:${A}`,o=new Promise(((e,t)=>{const A=setTimeout((()=>{this.pending.delete(i),t(new Error("Baichuan timeout waiting for nonce"))}),1e4);this.pending.set(i,{resolve:t=>{clearTimeout(A),e(t)},reject:e=>{clearTimeout(A),t(e)}})}));o.catch((()=>{})),this.writeWire(n);const a=await o,c=a.header.responseCode;if(c>>>8!=221)throw new Error(`Baichuan login: expected encryption info (0xDDxx), got 0x${c.toString(16)}`);const l=255&c,h=H(this.tryDecryptXml(a.body,a.header.channelId,0===l?{kind:"none"}:{kind:"bc"}),"nonce");if(!h)throw new Error("Baichuan login: nonce not found in XML");if(this.nonce=h,0===l)this.enc={kind:"none"};else if(1===l)this.enc={kind:"bc"};else if(2===l)this.enc={kind:"aes",key:w(h,this.opts.password)};else{if(18!==l)throw new Error(`Baichuan login: unknown encType=0x${l.toString(16)}`);this.enc={kind:"full_aes",key:w(h,this.opts.password)}}const g=D(`${this.opts.username}${h}`),d=D(`${this.opts.password}${h}`),u=(s=d,`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<LoginUser version="1.1">\n<userName>${M(g)}</userName>\n<password>${M(s)}</password>\n<userVer>1</userVer>\n</LoginUser>\n<LoginNet version="1.1">\n<type>LAN</type>\n<udpPort>0</udpPort>\n</LoginNet>\n</body>`);this.logDebug("login_hash",{username:this.opts.username,nonce:h,userHash:g,passHashLength:d.length,loginXmlLength:u.length,loginXmlPreview:u.substring(0,200)});const E=await this.sendFrame({cmdId:1,payloadXml:u,extensionXml:"",messageClass:B,encryption:{kind:"bc"},timeoutMs:1e4}),I=this.tryDecryptXml(E.body,E.header.channelId,{kind:"bc"});if(this.logDebug("login_reply",{replyLength:I.length,replyPreview:I.substring(0,200),startsWithXml:I.startsWith("<?xml")}),0===I.length)throw new Error("Baichuan login failed: empty reply (camera may be sleeping/waking, session may be stale, or username/password may be invalid)");if(!I.startsWith("<?xml")){const e=I.length>0?I.substring(0,100):"(empty)";throw new Error(`Baichuan login: unexpected non-XML reply (length: ${I.length}, preview: ${e})`)}return void(this.loggedIn=!0)}catch(e){t=e,this.loggedIn=!1;try{await this.close()}catch{}if(r<3){await A(1500);continue}throw e}var s;throw t instanceof Error?t:new Error(String(t))}},ge=class{host;username;password;port;useHttps;insecureTLS;timeoutMs;token;tokenExpiresAt;httpsAgent;constructor(e){this.host=e.host,this.username=e.username,this.password=e.password,this.port=e.port,this.useHttps=e.useHttps,this.insecureTLS=e.insecureTLS??!0,this.timeoutMs=e.timeoutMs??3e4,this.insecureTLS&&(this.httpsAgent=new l.g6({connect:{rejectUnauthorized:!1}}))}getUsername(){return this.username}getToken(){return this.token}clearToken(){this.token=void 0,this.tokenExpiresAt=void 0}baseUrl(){const e=this.useHttps?"https":"http",t=this.port??(this.useHttps?443:80);return`${e}://${this.host}:${t}`}apiUrl(e){const t=new URLSearchParams;for(const[A,s]of Object.entries(e))null!=s&&t.set(A,String(s));return`${this.baseUrl()}/cgi-bin/api.cgi?${t.toString()}`}isTokenValid(){return!(!this.token||!this.tokenExpiresAt)&&Date.now()+1e4<this.tokenExpiresAt}async login(){if(this.isTokenValid())return;const e=[{cmd:"Login",action:0,param:{User:{userName:this.username,password:this.password}}}],t=await this.sendJson(e,{cmd:"Login"},{includeToken:!1}),A=t[0];if(!A||0!==A.code||!A.value?.Token?.name)throw new Error(`Login failed: ${JSON.stringify(t)}`);const s=Number(A.value.Token.leaseTime),r=A.value.Token.name;this.token=r,this.tokenExpiresAt=Date.now()+(Number.isFinite(s)?1e3*s:0)}async logout(){if(this.token)try{await this.call("Logout",{action:0,param:{}})}finally{this.clearToken()}}async call(e,t){await this.login();const A=[{cmd:e,action:t?.action??0,...t&&"param"in t&&void 0!==t.param?{param:t.param}:{}}];return await this.sendJson(A,{cmd:e,token:this.token},{includeToken:!0})}async callMany(e){return await this.login(),await this.sendJson(e,{token:this.token},{includeToken:!0})}async sendJson(e,t,A){const s=this.apiUrl(t),r=new AbortController,n=setTimeout((()=>r.abort()),this.timeoutMs);try{const t={method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"},signal:r.signal};this.useHttps&&this.httpsAgent&&(t.dispatcher=this.httpsAgent);const A=await fetch(s,t),n=await A.text();if(!A.ok)throw new Error(`HTTP ${A.status}: ${n}`);return JSON.parse(n)}finally{clearTimeout(n)}}async downloadVod(e,t,A){if(await this.login(),!this.token)throw new Error("Missing token after login");const s=this.useHttps?"https":"http",r=this.port??(this.useHttps?443:80),n=e.replaceAll(" ","%20"),i=t?encodeURIComponent(t):void 0,o=A?encodeURIComponent(A):void 0,a=encodeURIComponent(this.token),c=`${s}://${this.host}:${r}/cgi-bin/api.cgi?cmd=Download&source=${n}${i?`&output=${i}`:""}${o?`&start=${o}`:""}&token=${a}`,l=new AbortController,h=setTimeout((()=>l.abort()),this.timeoutMs);try{const e={method:"POST",body:"[{}]",headers:{"Content-Type":"application/json"},signal:l.signal};this.useHttps&&this.httpsAgent&&(e.dispatcher=this.httpsAgent);const t=await fetch(c,e);if(!t.ok){const e=await t.text().catch((()=>""));throw new Error(`HTTP ${t.status}: ${e}`)}const A=await t.arrayBuffer();return Buffer.from(A)}finally{clearTimeout(h)}}};function de(e){if(e.length<4)return null;const t=e.readUInt32LE(0);return 825241649===t?function(e){if(e.length<32)return null;const t=e.readUInt32LE(4);if(32!==t)return null;const A={type:"InfoV1",videoWidth:e.readUInt32LE(8),videoHeight:e.readUInt32LE(12),fps:e.readUInt8(17),startYear:e.readUInt8(18),startMonth:e.readUInt8(19),startDay:e.readUInt8(20),startHour:e.readUInt8(21),startMin:e.readUInt8(22),startSeconds:e.readUInt8(23),endYear:e.readUInt8(24),endMonth:e.readUInt8(25),endDay:e.readUInt8(26),endHour:e.readUInt8(27),endMin:e.readUInt8(28),endSeconds:e.readUInt8(29)};return{media:A,consumed:32}}(e):842018865===t?function(e){if(e.length<32)return null;const t=e.readUInt32LE(4);if(32!==t)return null;const A={type:"InfoV2",videoWidth:e.readUInt32LE(8),videoHeight:e.readUInt32LE(12),fps:e.readUInt8(17),startYear:e.readUInt8(18),startMonth:e.readUInt8(19),startDay:e.readUInt8(20),startHour:e.readUInt8(21),startMin:e.readUInt8(22),startSeconds:e.readUInt8(23),endYear:e.readUInt8(24),endMonth:e.readUInt8(25),endDay:e.readUInt8(26),endHour:e.readUInt8(27),endMin:e.readUInt8(28),endSeconds:e.readUInt8(29)};return{media:A,consumed:32}}(e):t>=1667510320&&t<=1667510329?function(e){if(e.length<20)return null;const t=e.toString("utf8",4,8);if("H264"!==t&&"H265"!==t)return null;const A=t,s=e.readUInt32LE(8),r=e.readUInt32LE(12),n=e.readUInt32LE(16);let i=20;const o=e.readUInt32LE(i);let a;if(i+=4,e.length<i+r)return null;const c=e.subarray(i,i+r);r>=4&&(a=c.readUInt32LE(0));if(i+=r,e.length<i+s)return null;const l=e.subarray(i,i+s);i+=s;const h=s%8==0?0:8-s%8;if(e.length<i+h)return null;i+=h;return{media:{type:"Iframe",videoType:A,microseconds:n,...void 0!==a?{time:a}:{},additionalHeader:c,additionalHeaderSize:r,unknown:o,data:l},consumed:i}}(e):t>=1667510576&&t<=1667510585?function(e){if(e.length<20)return null;const t=e.toString("utf8",4,8);if("H264"!==t&&"H265"!==t)return null;const A=t,s=e.readUInt32LE(8),r=e.readUInt32LE(12),n=e.readUInt32LE(16);let i=20;const o=e.readUInt32LE(i);if(i+=4,e.length<i+r)return null;const a=e.subarray(i,i+r);if(i+=r,e.length<i+s)return null;const c=e.subarray(i,i+s);i+=s;const l=s%8==0?0:8-s%8;if(e.length<i+l)return null;i+=l;return{media:{type:"Pframe",videoType:A,microseconds:n,additionalHeader:a,additionalHeaderSize:r,unknown:o,data:c},consumed:i}}(e):1651979568===t?function(e){if(e.length<12)return null;const t=e.readUInt16LE(4),A=e.readUInt16LE(6);if(t!==A)return null;const s=8,r=s+t+(t%8==0?0:8-t%8);if(e.length<r)return null;const n=e.subarray(s,s+t);return{media:{type:"Aac",data:n},consumed:r}}(e):1651978544===t?function(e){if(e.length<12)return null;const t=e.readUInt16LE(4),A=e.readUInt16LE(6);if(t!==A)return null;const s=e.readUInt16LE(8);if(256!==s)return null;e.readUInt16LE(10);const r=4;if(t<r)return null;const n=t-r,i=12,o=i+n+(t%8==0?0:8-t%8);if(e.length<o)return null;const a=e.subarray(i,i+n);return{media:{type:"Adpcm",data:a},consumed:o}}(e):null}var ue=class{buffer=Buffer.alloc(0);strict;amountSkipped=0;logger;constructor(e=!1,t){this.strict=e,this.logger=t}decode(e){this.buffer=0===this.buffer.length?e:Buffer.concat([this.buffer,e]);const t=[];for(;this.buffer.length>=4;){const e=de(this.buffer);if(!e){const e=this.buffer.readUInt32LE(0);if(825241649===e||842018865===e||e>=1667510320&&e<=1667510329||e>=1667510576&&e<=1667510585||1651979568===e||1651978544===e)break;if(this.strict)throw new Error(`[BcMediaCodec] Invalid data in stream (no valid magic at buffer start, len=${this.buffer.length})`);0===this.amountSkipped&&this.logger?.warn("[BcMediaCodec] Error in stream, attempting to recover..."),this.amountSkipped+=this.buffer.length,this.buffer=Buffer.alloc(0);break}this.amountSkipped>0&&(this.strict,this.logger?.warn(`[BcMediaCodec] Recovered stream after skipping ${this.amountSkipped} bytes`),this.amountSkipped=0),t.push(e.media),this.buffer=this.buffer.subarray(e.consumed)}return t}getRemainingBuffer(){return this.buffer}clear(){this.buffer=Buffer.alloc(0),this.amountSkipped=0}},Ee=Buffer.from([0,0,0,1]),Ie=Buffer.from([0,0,1]);function Qe(e){return!(e.length<4)&&(!!e.subarray(0,4).equals(Ee)||!!e.subarray(0,3).equals(Ie))}function Ce(e,t){const A=[];let s=0,r=0;for(;s<e.length;){if(s+4>e.length)return null;const n=t(e,s);if(s+=4,n<=0)return null;if(n>e.length-s)return null;A.push(Ee),A.push(e.subarray(s,s+n)),s+=n,r++}return 0===r?null:Buffer.concat(A)}function Be(e,t){const A=[];let s=0,r=0;for(;s<e.length;){if(s+2>e.length)return null;const n=t(e,s);if(s+=2,n<=0)return null;if(n>e.length-s)return null;A.push(Ee),A.push(e.subarray(s,s+n)),s+=n,r++}return 0===r?null:Buffer.concat(A)}function pe(e,t){const A=[];let s=0,r=0;const n=(e,A)=>{if(A+3>e.length)return 0;const s=e[A],r=e[A+1],n=e[A+2];return"be"===t?(s<<16|r<<8|n)>>>0:(n<<16|r<<8|s)>>>0};for(;s<e.length;){if(s+3>e.length)return null;const t=n(e,s);if(s+=3,t<=0)return null;if(t>e.length-s)return null;A.push(Ee),A.push(e.subarray(s,s+t)),s+=t,r++}return 0===r?null:Buffer.concat(A)}function fe(e){if(Qe(e))return e;const t=Buffer.from([0,0,0,1]),A=Buffer.from([0,0,1]),s=Math.min(64,e.length),r=e.subarray(0,s).indexOf(t);if(r>0)return e.subarray(r);const n=e.subarray(0,s).indexOf(A);if(n>0)return e.subarray(n);const i=Ce(e,((e,t)=>e.readUInt32BE(t)));if(i)return i;const o=Ce(e,((e,t)=>e.readUInt32LE(t)));if(o)return o;const a=pe(e,"be");if(a)return a;const c=pe(e,"le");if(c)return c;const l=Be(e,((e,t)=>e.readUInt16BE(t)));if(l)return l;const h=Be(e,((e,t)=>e.readUInt16LE(t)));if(h)return h;const g=function(e){if(e.length<1)return null;const t=31&e[0],A=[],s=e=>{0!==e.length&&A.push(Ee,e)};if(24===t){let t=1;for(;t+2<=e.length;){const A=e.readUInt16BE(t);if(t+=2,A<=0||t+A>e.length)return null;s(e.subarray(t,t+A)),t+=A}return A.length?Buffer.concat(A):null}if(25===t){let t=3;if(t>e.length)return null;for(;t+2<=e.length;){const A=e.readUInt16BE(t);if(t+=2,A<=0||t+A>e.length)return null;s(e.subarray(t,t+A)),t+=A}return A.length?Buffer.concat(A):null}if(26===t){let t=3;if(t>e.length)return null;for(;t+2<=e.length;){const A=e.readUInt16BE(t);if(t+=2,t+1+2>e.length)return null;if(t+=1,t+=2,A<=0||t+A>e.length)return null;s(e.subarray(t,t+A)),t+=A}return A.length?Buffer.concat(A):null}if(27===t){let t=3;if(t>e.length)return null;for(;t+2<=e.length;){const A=e.readUInt16BE(t);if(t+=2,t+1+3>e.length)return null;if(t+=1,t+=3,A<=0||t+A>e.length)return null;s(e.subarray(t,t+A)),t+=A}return A.length?Buffer.concat(A):null}return null}(e);return g||(function(e){if(e.length<1)return!1;const t=e[0];if(void 0===t)return!1;if(128&t)return!1;const A=31&t;return A>=1&&A<=23}(e)?Buffer.concat([Ee,e]):e)}function me(e){const t=[];for(let A=0;A<e.length-3;A++)0===e[A]&&0===e[A+1]&&(1===e[A+2]?(t.push({idx:A,len:3}),A+=2):0===e[A+2]&&1===e[A+3]&&(t.push({idx:A,len:4}),A+=3));if(0===t.length)return[];const A=[];for(let s=0;s<t.length;s++){const r=t[s],n=r.idx+r.len,i=t[s+1]?t[s+1].idx:e.length;i>n&&A.push(e.subarray(n,i))}return A}function ye(e){if(!Qe(e))return!1;const t=me(e);if(0===t.length)return!1;for(const e of t){if(e.length<1)return!1;const t=e[0];if(void 0===t)return!1;if(128&t)return!1;const A=31&t;if(0===A||A>=24)return!1}return!0}function Se(e){const t=me(e);let A=!1,s=!1,r=!1;for(const e of t){const t=31&(e[0]??0);7===t&&(A=!0),8===t&&(s=!0),5===t&&(r=!0)}return r&&A&&s}var De=class e{fuNalHeader=null;fuParts=[];static parseRtpPayload(e){if(!e||e.length<12)return null;if(2!==(e[0]>>6&3))return null;const t=!!(32&e[0]),A=!!(16&e[0]);let s=12+4*(15&e[0]);if(s>e.length)return null;if(A){if(s+4>e.length)return null;if(s+=4+4*e.readUInt16BE(s+2),s>e.length)return null}let r=e.length;if(t){const t=e[e.length-1];if(t<=0||t>e.length)return null;if(r=e.length-t,r<s)return null}return r<=s?null:e.subarray(s,r)}reset(){this.fuNalHeader=null,this.fuParts=[]}push(t){if(0===t.length)return[];const A=e.parseRtpPayload(t);if(A&&(t=A),Qe(t))return[t];const s=t[0];if(128&s)return[];const r=31&s;if(r>=1&&r<=23)return[Buffer.concat([Ee,t])];if(24===r){if(t.length<3)return[];let e=1;const A=[];for(;e+2<=t.length;){const s=t.readUInt16BE(e);if(e+=2,s<=0||e+s>t.length)return[];const r=t.subarray(e,e+s);if(e+=s,r.length<1)return[];if(128&r[0])return[];const n=31&r[0];if(0===n||n>=24)return[];A.push(Buffer.concat([Ee,r]))}return A}if(28===r||29===r){if(t.length<2)return[];const e=t[0],A=t[1],s=!!(128&A),n=!!(64&A),i=224&e|31&A;let o=2;if(29===r){if(t.length<o+2)return[];o+=2}const a=t.subarray(o);if(s)this.fuNalHeader=i,this.fuParts=[a];else{if(null==this.fuNalHeader)return[];this.fuParts.push(a)}if(n&&null!=this.fuNalHeader){const e=Buffer.concat([Buffer.from([this.fuNalHeader]),...this.fuParts]);return this.reset(),[Buffer.concat([Ee,e])]}return[]}return[]}};var we=Buffer.from([0,0,0,1]),be=Buffer.from([0,0,1]);function Re(e){return!(e.length<4)&&(!!e.subarray(0,4).equals(we)||!!e.subarray(0,3).equals(be))}function Ne(e,t){const A=[];let s=0,r=0;for(;s<e.length;){if(s+4>e.length)return null;const n=t(e,s);if(s+=4,n<=0)return null;if(n>e.length-s)return null;A.push(we),A.push(e.subarray(s,s+n)),s+=n,r++}return 0===r?null:Buffer.concat(A)}function ke(e,t){const A=[];let s=0,r=0;for(;s<e.length;){if(s+2>e.length)return null;const n=t(e,s);if(s+=2,n<=0)return null;if(n>e.length-s)return null;A.push(we),A.push(e.subarray(s,s+n)),s+=n,r++}return 0===r?null:Buffer.concat(A)}function Te(e,t){const A=[];let s=0,r=0;const n=(e,A)=>{if(A+3>e.length)return 0;const s=e[A],r=e[A+1],n=e[A+2];return"be"===t?(s<<16|r<<8|n)>>>0:(n<<16|r<<8|s)>>>0};for(;s<e.length;){if(s+3>e.length)return null;const t=n(e,s);if(s+=3,t<=0)return null;if(t>e.length-s)return null;A.push(we),A.push(e.subarray(s,s+t)),s+=t,r++}return 0===r?null:Buffer.concat(A)}function Fe(e){if(Re(e))return e;const t=Buffer.from([0,0,0,1]),A=Buffer.from([0,0,1]),s=Math.min(64,e.length),r=e.subarray(0,s).indexOf(t);if(r>0)return e.subarray(r);const n=e.subarray(0,s).indexOf(A);if(n>0)return e.subarray(n);const i=Ne(e,((e,t)=>e.readUInt32BE(t)));if(i)return i;const o=Ne(e,((e,t)=>e.readUInt32LE(t)));if(o)return o;const a=Te(e,"be");if(a)return a;const c=Te(e,"le");if(c)return c;const l=ke(e,((e,t)=>e.readUInt16BE(t)));if(l)return l;const h=ke(e,((e,t)=>e.readUInt16LE(t)));return h||(function(e){if(e.length<2)return!1;const t=e[0],A=e[1];return void 0!==t&&void 0!==A&&(!(128&t)&&(t>>1&63)<=40)}(e)?Buffer.concat([we,e]):e)}var ve=class e{fuParts=null;reset(){this.fuParts=null}static parseRtpPayload(e){if(!e||e.length<12)return null;if(2!==(e[0]>>6&3))return null;const t=!!(32&e[0]),A=!!(16&e[0]);let s=12+4*(15&e[0]);if(s>e.length)return null;if(A){if(s+4>e.length)return null;if(s+=4+4*e.readUInt16BE(s+2),s>e.length)return null}let r=e.length;if(t){const t=e[e.length-1];if(t<=0||t>e.length)return null;if(r=e.length-t,r<s)return null}return r<=s?null:e.subarray(s,r)}push(t){if(!t||t.length<2)return[];const A=e.parseRtpPayload(t);A&&(t=A);const s=t[0],r=t[1];if(128&s)return[];const n=s>>1&63;if(48===n){let e=2;const A=[];for(;e+2<=t.length;){const s=t.readUInt16BE(e);if(e+=2,s<=0||e+s>t.length)return[];const r=t.subarray(e,e+s);e+=s,r.length&&A.push(we,r)}return A.length?[Buffer.concat(A)]:[]}if(49===n){if(t.length<3)return[];const e=t[2],A=!!(128&e),n=!!(64&e),i=129&s|(63&(63&e))<<1,o=r,a=t.subarray(3);if(A)this.fuParts=[we,Buffer.from([i,o]),a];else{if(!this.fuParts)return[];this.fuParts.push(a)}if(n){if(!this.fuParts)return[];const e=Buffer.concat(this.fuParts);return this.fuParts=null,[e]}return[]}return[Buffer.concat([we,t])]}};function Me(e){const t=[];for(let A=0;A<e.length-3;A++)0===e[A]&&0===e[A+1]&&(1===e[A+2]?(t.push({idx:A,len:3}),A+=2):0===e[A+2]&&1===e[A+3]&&(t.push({idx:A,len:4}),A+=3));if(0===t.length)return[];const A=[];for(let s=0;s<t.length;s++){const r=t[s],n=r.idx+r.len,i=t[s+1]?t[s+1].idx:e.length;i>n&&A.push(e.subarray(n,i))}return A}function Ue(e){if(e.length<1)return null;const t=e[0];return void 0===t||128&t?null:t>>1&63}function Le(e){return e>=16&&e<=23}function He(e){if(!Re(e))return!1;const t=Me(e);if(0===t.length)return!1;for(const e of t){if(e.length<2)return!1;const t=e[0];if(void 0===t)return!1;if(128&t)return!1;const A=Ue(e);if(null===A)return!1;if(A>40)return!1}return!0}function xe(e){const t=Me(e);let A=!1,s=!1,r=!1,n=!1;for(const e of t){const t=Ue(e);null!==t&&(32===t&&(A=!0),33===t&&(s=!0),34===t&&(r=!0),Le(t)&&(n=!0))}return n&&A&&s&&r}function Ye(e){const t=Me(e);for(const e of t){if(32===Ue(e))return e}return null}function Pe(e){const t=Me(e);for(const e of t){if(33===Ue(e))return e}return null}function Ve(e){const t=Me(e);for(const e of t){if(34===Ue(e))return e}return null}var Oe=Buffer.from([0,0,0,1]),Ge=class{running=!1;queue=[];maxQueueSize;constructor(e){this.maxQueueSize=e}enqueue(e){this.queue.length>=this.maxQueueSize||(this.queue.push(e),this.pump())}pump(){this.running||(this.running=!0,this.run())}async run(){try{for(;this.queue.length>0;){const e=this.queue.shift();if(e)try{await e()}catch{}}}finally{this.running=!1}}};function Je(e){const t=[];for(let A=0;A<e.length;A++)A>=2&&3===e[A]&&0===e[A-1]&&0===e[A-2]||t.push(e[A]);return Buffer.from(t)}var We=class{b;bitPos=0;constructor(e){this.b=e}readBits(e){if(e<=0)return 0;let t=0;for(let A=0;A<e;A++){const e=this.bitPos>>3;if(e>=this.b.length)return null;const A=7-(7&this.bitPos);t=t<<1|this.b[e]>>A&1,this.bitPos++}return t>>>0}readUE(){let e=0;for(;;){const t=this.readBits(1);if(null==t)return null;if(0!==t)break;if(e++,e>31)return null}const t=e?this.readBits(e):0;return null==t?null:(1<<e)-1+t>>>0}};function _e(e){if(7!=(31&(e[0]??0)))return null;const t=Je(e.subarray(1)),A=new We(t);return null==A.readBits(8)||null==A.readBits(8)||null==A.readBits(8)?null:A.readUE()}function qe(e){if(8!=(31&(e[0]??0)))return null;const t=Je(e.subarray(1)),A=new We(t),s=A.readUE(),r=A.readUE();return null==s||null==r?null:{ppsId:s,spsId:r}}function $e(e){const t=31&(e[0]??0);if(1!==t&&5!==t)return null;const A=Je(e.subarray(1)),s=new We(A);return null==s.readUE()||null==s.readUE()?null:s.readUE()}var Xe=class e extends r.EventEmitter{client;api;channel;profile;logger;active=!1;videoFrameHandler;expectedStreamType;activeMsgNum;bcMediaCodec;debugH264LogsLeft;debugSavedSamples;warnedNonAnnexBOnce=!1;depacketizer=new De;depacketizerH265=new ve;dumpChunkIdx=0;dumpNalLines=0;dumpIo=new Ge(200);spsById=new Map;ppsById=new Map;lastSps=null;lastPps=null;lastPrependedPpsId=null;lastVps=null;lastSpsH265=null;lastPpsH265=null;lastPrependedParamSetsH265=!1;lastMediaAtMs=0;watchdogTimer;restarting=!1;restartWindowStartMs=0;restartCountInWindow=0;idleRestartMs;static scoreBcMediaLike(e){if(e.length<4)return{score:-1,first:-1};const t=Math.min(65536,e.length-4);let A=0,s=-1;for(let r=0;r<=t;r++){const t=e.readUInt32LE(r);if((825241649===t||842018865===t||t>=1667510320&&t<=1667510329||t>=1667510576&&t<=1667510585||1651979568===t||1651978544===t)&&(A++,s<0&&(s=r),A>32&&0===s))break}return{score:1e3*A-(s<0?5e4:s),first:s}}chooseDecryptedOrRawCandidate(t){const{raw:A,enc:s,channelId:r,allowResync:n}=t,i=e.scoreBcMediaLike(A),o="aes"===this.client.enc.kind||"full_aes"===this.client.enc.kind||"bc"===this.client.enc.kind?this.client.tryDecryptBinary(A,r,s):A,a=e.scoreBcMediaLike(o).score>i.score?o:A;if(!n)return a;const c=e.scoreBcMediaLike(a);return c.first>0?a.subarray(c.first):a}constructor(e){super(),this.client=e.client,this.api=e.api,this.channel=e.channel,this.profile=e.profile,this.logger=e.logger,this.expectedStreamType="sub"===this.profile?1:0,this.bcMediaCodec=new ue(!1,this.logger);const t=this.client.getDebugConfig();this.debugH264LogsLeft=t.debugH264?200:0,this.debugSavedSamples=!1,this.dumpChunkIdx=0,this.spsById=new Map,this.ppsById=new Map,this.lastSps=null,this.lastPps=null,this.lastPrependedPpsId=null,this.lastVps=null,this.lastSpsH265=null,this.lastPpsH265=null,this.lastPrependedParamSetsH265=!1;const A=this.client.getTransport?.();this.idleRestartMs="udp"===A?6e3:15e3}noteMediaActivity(){this.lastMediaAtMs=Date.now()}startWatchdog(){this.api&&(this.watchdogTimer||(this.restartWindowStartMs=Date.now(),this.restartCountInWindow=0,this.watchdogTimer=setInterval((()=>{this.watchdogTick()}),1e3)))}stopWatchdog(){this.watchdogTimer&&clearInterval(this.watchdogTimer),this.watchdogTimer=void 0}async watchdogTick(){if(!this.active)return;if(!this.api)return;if(this.restarting)return;if(this.lastMediaAtMs<=0)return;const e=Date.now(),t=e-this.lastMediaAtMs;t<this.idleRestartMs||(e-this.restartWindowStartMs>6e4&&(this.restartWindowStartMs=e,this.restartCountInWindow=0),this.restartCountInWindow>=3?this.logger?.warn(`[BaichuanVideoStream] Watchdog: idle for ${t}ms, but restart budget exceeded; leaving stream as-is`):(this.restartCountInWindow++,this.restartNativeStream({reason:`idle ${t}ms`})))}async restartNativeStream(e){if(this.api&&this.active&&!this.restarting){this.restarting=!0;try{this.logger?.warn(`[BaichuanVideoStream] Watchdog restarting native stream (${e.reason})`),this.depacketizer.reset(),this.depacketizerH265.reset(),this.bcMediaCodec.clear(),this.activeMsgNum=void 0,this.lastPrependedPpsId=null,this.lastPrependedParamSetsH265=!1;try{await this.api.stopVideoStream(this.channel,this.profile)}catch{}await this.api.startVideoStream(this.channel,this.profile);try{const e=this.api.getActiveVideoMsgNum;this.activeMsgNum="function"==typeof e?e(this.channel,this.profile):void 0}catch{this.activeMsgNum=void 0}this.lastMediaAtMs=Date.now()}catch(e){const t=e instanceof Error?e:new Error(String(e));this.emit("error",t)}finally{this.restarting=!1}}}async start(){if(this.active)throw new Error("Video stream already active");if(this.depacketizer.reset(),this.depacketizerH265.reset(),this.api)try{await this.api.startVideoStream(this.channel,this.profile);try{const e=this.api.getActiveVideoMsgNum;this.activeMsgNum="function"==typeof e?e(this.channel,this.profile):void 0}catch{this.activeMsgNum=void 0}}catch(e){const t=e instanceof Error?e:new Error(String(e));if("udp"===this.client.getTransport?.())throw t;this.emit("error",t)}let e=0,t=0;this.videoFrameHandler=A=>{if(3!==A.header.cmdId)return;if(A.header.streamType!==this.expectedStreamType)return;if(void 0!==this.activeMsgNum&&A.header.msgNum!==this.activeMsgNum)return;e++;const s=this.client.getDebugConfig(),r=s.debugRtsp;1===e&&r&&this.logger?.log(`[BaichuanVideoStream] First cmd_id=3 frame received (bodyLen: ${A.body.length}, channelId: ${A.header.channelId})`),(e%10==0||e<=5)&&r&&this.logger?.log(`[BaichuanVideoStream] Received ${e} Baichuan frames (cmd_id=3)`);const n=this.client.enc,i=A.payload.length>0?A.payload:A.body;let o=i;if(0===A.payload.length){let e=0;const t=i.indexOf(Buffer.from("</Extension>")),A=i.indexOf(Buffer.from("</body>"));-1!==t?e=t+Buffer.from("</Extension>").length:-1!==A&&(e=A+Buffer.from("</body>").length),o=i.subarray(e)}const l=this.chooseDecryptedOrRawCandidate({raw:o,enc:n,channelId:A.header.channelId,allowResync:0===A.payload.length});if(1===e&&r&&this.logger?.log(`[BaichuanVideoStream] Data after XML: ${l.length} bytes, first 32 bytes: ${l.subarray(0,Math.min(32,l.length)).toString("hex")}`),s.dumpEnabled&&ne(s),s.dumpBcMedia&&this.dumpChunkIdx<200){const e=s.dumpDir,t=String(this.dumpChunkIdx).padStart(4,"0"),A=c.join(e,`bcmedia_chunk_${t}.bin`),r=c.join(e,"bcmedia_info.json"),n=Buffer.from(l),i=0===this.dumpChunkIdx,o=i?JSON.stringify({note:"Chunks fed into the BcMedia decoder (after XML stripping/alignment).",profile:this.profile,channel:this.channel,encKind:this.client.enc.kind},null,2):"";this.dumpIo.enqueue((async()=>{await a.promises.writeFile(A,n),i&&await a.promises.writeFile(r,o)})),this.dumpChunkIdx++}const h=this.bcMediaCodec.decode(l);t+=h.length;const g=new Map;for(const e of h)g.set(e.type,(g.get(e.type)||0)+1);if(e<=10||e%20==0){const A=this.bcMediaCodec.getRemainingBuffer(),s=Array.from(g.entries()).map((([e,t])=>`${e}:${t}`)).join(", ");r&&this.logger?.log(`[BaichuanVideoStream] Frame #${e}: dataToParse=${l.length} bytes, parsed ${h.length} BcMedia packets (${s||"none"}), total: ${t}, remaining buffer: ${A.length} bytes`)}let d=0,u=0;for(const t of h){const A=(e,t,A)=>{if("H264"===A){const t=me(e);for(const e of t){const t=31&(e[0]??0);if(7===t){const t=_e(e);if(null!=t){if(!o(e))continue;this.spsById.set(t,e),s.debugParamSets&&this.logger?.warn(`[BaichuanVideoStream] Cached H.264 SPS id=${t} len=${e.length}`)}o(e)&&(this.lastSps=e)}if(8===t){const t=qe(e);if(t){const A=this.spsById.get(t.spsId);if(A&&!o(A))continue;this.ppsById.set(t.ppsId,{nal:e,spsId:t.spsId}),s.debugParamSets&&this.logger?.warn(`[BaichuanVideoStream] Cached H.264 PPS id=${t.ppsId} (spsId=${t.spsId}) len=${e.length}`)}this.lastPps=e}}}else if("H265"===A){const t=Ye(e);t&&(this.lastVps=t,s.debugParamSets&&this.logger?.warn(`[BaichuanVideoStream] Cached H.265 VPS len=${t.length}`));const A=Pe(e);A&&(this.lastSpsH265=A,s.debugParamSets&&this.logger?.warn(`[BaichuanVideoStream] Cached H.265 SPS len=${A.length}`));const r=Ve(e);r&&(this.lastPpsH265=r,s.debugParamSets&&this.logger?.warn(`[BaichuanVideoStream] Cached H.265 PPS len=${r.length}`))}},n=(e,t)=>{if("H264"===t){const t=me(e);if(0===t.length)return e;const A=t.map((e=>31&(e[0]??0)));if(A.includes(7)&&A.includes(8))return e;if(!A.some((e=>1===e||5===e||19===e||20===e)))return e;let r=null;for(const e of t){const t=31&(e[0]??0);if(1===t||5===t){r=$e(e);break}}if(s.debugParamSets&&this.logger?.warn(`[BaichuanVideoStream] Slice references ppsId=${r??"?"} lastPrepended=${this.lastPrependedPpsId??"?"}`),null==r||r>255)return null!=this.lastPrependedPpsId?e:this.lastSps&&this.lastPps?(this.lastPrependedPpsId=-1,Buffer.concat([Oe,this.lastSps,Oe,this.lastPps,e])):e;if(this.lastPrependedPpsId===r)return e;const n=this.ppsById.get(r);if(n){const t=this.spsById.get(n.spsId);if(t)return this.lastPrependedPpsId=r,Buffer.concat([Oe,t,Oe,n.nal,e])}return Buffer.alloc(0)}if("H265"===t){const t=Me(e);if(0===t.length)return e;const A=t.map((e=>Ue(e))).filter((e=>null!==e));if(A.includes(32)&&A.includes(33)&&A.includes(34))return e;return A.some((e=>e>=0&&e<=9||e>=16&&e<=23))?this.lastPrependedParamSetsH265?e:this.lastVps&&this.lastSpsH265&&this.lastPpsH265?(this.lastPrependedParamSetsH265=!0,s.debugParamSets&&this.logger?.warn("[BaichuanVideoStream] Prepending H.265 VPS/SPS/PPS to frame"),Buffer.concat([Oe,this.lastVps,Oe,this.lastSpsH265,Oe,this.lastPpsH265,e])):e:e}return e},i=(e,t,A)=>{if(s.dumpNals)try{s.dumpEnabled&&ne(s);const r=s.dumpDir,n=me(e),i=n.map((e=>31&(e[0]??0)));let o=null;const l=[],h=[];for(const e of n){const t=31&(e[0]??0);if(1!==t&&5!==t||null!=o||(o=$e(e)),7===t){const t=_e(e);null!=t&&l.push(t)}if(8===t){const t=qe(e);t&&h.push(t.ppsId)}}if(this.dumpNalLines>=2e4)return;const g=JSON.stringify({label:t,microseconds:A,len:e.length,nalTypes:i,slicePpsId:o,auSpsIds:l,auPpsIds:h,cachedSps:this.spsById.size,cachedPps:this.ppsById.size,lastPrependedPpsId:this.lastPrependedPpsId})+"\n";this.dumpNalLines++;const d=c.join(r,"nal_dump.ndjson");this.dumpIo.enqueue((async()=>{await a.promises.appendFile(d,g)}))}catch{}},o=e=>{if(e.length<4)return!1;if(7!=(31&(e[0]??0)))return!1;const t=e[1]??0,A=e[3]??0;return!!new Set([66,77,88,100,110,122,244]).has(t)&&!(0===A||A>255)};if("Iframe"===t.type){const o="H265"===t.videoType?Fe(t.data):fe(t.data),l=!0;A(o,"Iframe",t.videoType);const h=n(o,t.videoType);if(0===h.length)continue;if(i(h,"Iframe",t.microseconds),"H264"===t.videoType){if(!ye(h)||!Se(h)){s.debugH264&&this.logger?.warn(`[BaichuanVideoStream] Dropping invalid H.264 Iframe (Annex-B) len=${h.length}`);continue}}else if("H265"===t.videoType){if(!He(h)){s.debugH264&&this.logger?.warn(`[BaichuanVideoStream] Dropping invalid H.265 Iframe (Annex-B) len=${h.length}`);continue}xe(h)||s.debugH264&&this.logger?.warn(`[BaichuanVideoStream] H.265 Iframe missing VPS/SPS/PPS or IRAP, but continuing len=${h.length}`)}if(s.debugH264&&!this.debugSavedSamples)try{const e=s.dumpDir;a.mkdirSync(e,{recursive:!0}),"Iframe"===t.type&&Qe(o)&&a.writeFileSync(c.join(e,"iframe_annexb.bin"),o)}catch{}if(!this.warnedNonAnnexBOnce&&!Qe(o)){this.warnedNonAnnexBOnce=!0;const e=t.data,A=e.subarray(0,Math.min(24,e.length)).toString("hex"),s=o.subarray(0,Math.min(24,o.length)).toString("hex");this.logger?.warn(`[BaichuanVideoStream] WARNING: non-AnnexB frame after conversion (${t.type} ${t.videoType}) len=${e.length} head=${A} convertedLen=${o.length} convertedHead=${s}`)}if(this.emit("videoFrame",h),this.emit("videoAccessUnit",{data:h,isKeyframe:l,videoType:t.videoType,microseconds:t.microseconds,..."Iframe"===t.type&&"time"in t&&void 0!==t.time?{time:t.time}:{}}),d++,e<=5||d<=5){const e=Qe(o)?"yes":"no";r&&this.logger?.log(`[BaichuanVideoStream] Emitted ${t.type} (${t.videoType}) ${t.data.length} bytes -> ${o.length} bytes (Annex-B, startCode:${e})`)}}else if("Pframe"===t.type){const e=t.data,r=Qe(e)?e:"H265"===t.videoType?Fe(e):fe(e),o=Qe(r)?[r]:"H265"===t.videoType?this.depacketizerH265.push(e):this.depacketizer.push(e);if(0===o.length)continue;for(const e of o){A(e,"Pframe",t.videoType);const r=n(e,t.videoType);if(0===r.length)continue;const o=r;i(o,"Pframe",t.microseconds);if("H265"===t.videoType?He(o):ye(o))this.emit("videoFrame",o),this.emit("videoAccessUnit",{data:o,isKeyframe:!1,videoType:t.videoType,microseconds:t.microseconds}),d++;else if(s.debugH264&&this.debugH264LogsLeft>0){this.debugH264LogsLeft--;const e=o.subarray(0,Math.min(24,o.length)).toString("hex");this.logger?.warn(`[BaichuanVideoStream] Dropping invalid Pframe (${t.videoType}): len=${o.length} head=${e}`)}}}"Aac"!==t.type&&"Adpcm"!==t.type||(u++,this.emit("audioFrame",t.data)),"InfoV1"===t.type||t.type}if((e<=10||e%20==0&&(d>0||u>0))&&r&&this.logger?.log(`[BaichuanVideoStream] Frame #${e}: emitted ${d} video frames, ${u} audio frames`),(d>0||u>0)&&this.noteMediaActivity(),d>0&&(e<=10||e%50==0)){}},this.client.on("push",this.videoFrameHandler),this.active=!0,this.lastMediaAtMs=Date.now(),this.startWatchdog()}async stop(){if(this.active){if(this.stopWatchdog(),this.depacketizer.reset(),this.depacketizerH265.reset(),this.videoFrameHandler&&this.client.removeListener("push",this.videoFrameHandler),this.videoFrameHandler=void 0,this.bcMediaCodec.clear(),this.activeMsgNum=void 0,this.api)try{await this.api.stopVideoStream(this.channel,this.profile)}catch(e){this.emit("error",e instanceof Error?e:new Error(String(e)))}this.active=!1,this.emit("close")}}isActive(){return this.active}};async function*ze(e,t,A){const s=new Xe({client:e.client,api:e,channel:t,profile:A,logger:e.logger});let r=null,n=null,i=null,o=!1,a=!1;const c=e=>{a=!0},l=()=>{a=!0};try{await s.start(),s.on("error",c),s.on("close",l);const e=new Promise((e=>{const t=A=>{A.isKeyframe&&!r&&(r={sps:null,pps:null},s.removeListener("videoAccessUnit",t),e(r))};s.on("videoAccessUnit",t),setTimeout((()=>{r||(r={sps:null,pps:null},s.removeListener("videoAccessUnit",t),e(r))}),5e3)}));await Promise.race([e,new Promise((e=>setTimeout(e,5e3)))]);const t=[],A=200;let h=null;for(s.on("videoAccessUnit",(e=>{a||(t.push({audio:!1,data:e.data,codec:null,sampleRate:null,microseconds:e.microseconds,videoType:e.videoType}),t.length>A&&t.splice(0,t.length-A),h&&(h(),h=null))})),s.on("audioFrame",(e=>{a||(n||(n="aac",i=8e3),t.push({audio:!0,data:e,codec:n,sampleRate:i,microseconds:null}),t.length>A&&t.splice(0,t.length-A),h&&(h(),h=null))})),o=!0;!a;)if(t.length>0){const e=t.shift();yield e}else await new Promise((e=>{h=e,setTimeout((()=>{h===e&&(h=null,e())}),1e3)}))}finally{a=!0;try{await s.stop()}catch{}s.removeListener("error",c),s.removeListener("close",l)}}var Ze=class{key;transport;videoType;keepAliveTimer;constructor(e,t){this.transport=e,this.videoType=t,this.key=function(e,t){return`${e}-${"H264"===t?"h264":"h265"}`}(e,t)}async startKeepAlive(e){this.stopKeepAlive(),e.client.getTransport()}stopKeepAlive(){this.keepAliveTimer&&(clearInterval(this.keepAliveTimer),this.keepAliveTimer=void 0)}},je=Buffer.from([0,0,0,1]);function Ke(...e){const t=e.filter((e=>!!e&&e.length>0));if(0===t.length)return null;const A=[];for(const e of t)A.push(je,e);return Buffer.concat(A)}var et=class extends Ze{ffmpegFormat="h264";sdpCodec="H264";sps=null;pps=null;constructor(e){super(e,"H264")}extractParameterSets(e){const t=me(e);for(const e of t){if(e.length<1)continue;const t=31&(e[0]??0);if(7!==t||this.sps||(this.sps=e),8!==t||this.pps||(this.pps=e),this.sps&&this.pps)break}}getFmtp(){let e="packetization-mode=1";if(this.sps&&this.sps.length>=4){e+=`;profile-level-id=${Buffer.from([this.sps[1],this.sps[2],this.sps[3]]).toString("hex")}`}return this.sps&&this.pps?(e+=`;sprop-parameter-sets=${this.sps.toString("base64")},${this.pps.toString("base64")}`,{fmtp:e,hasParamSets:!0}):{fmtp:e,hasParamSets:!1}}getParameterSetsAnnexB(){return Ke(this.sps,this.pps)}},tt=class extends Ze{ffmpegFormat="hevc";sdpCodec="H265";vps=null;sps=null;pps=null;constructor(e){super(e,"H265")}extractParameterSets(e){const t=Ye(e),A=Pe(e),s=Ve(e);t&&!this.vps&&(this.vps=t),A&&!this.sps&&(this.sps=A),s&&!this.pps&&(this.pps=s)}getFmtp(){let e="";return this.vps&&this.sps&&this.pps?(e=`sprop-vps=${this.vps.toString("base64")};sprop-sps=${this.sps.toString("base64")};sprop-pps=${this.pps.toString("base64")}`,{fmtp:e,hasParamSets:!0}):{fmtp:e,hasParamSets:!1}}getParameterSetsAnnexB(){return Ke(this.vps,this.sps,this.pps)}};function At(e,t){return"H264"===t?new et(e):new tt(e)}var st=class{maxItems;queue=[];waiting;closed=!1;constructor(e){this.maxItems=Math.max(1,0|e)}push(e){if(!this.closed){if(this.waiting){const{resolve:t}=this.waiting;return this.waiting=void 0,void t({value:e,done:!1})}this.queue.push(e),this.queue.length>this.maxItems&&this.queue.splice(0,this.queue.length-this.maxItems)}}close(){if(!this.closed&&(this.closed=!0,this.waiting)){const{resolve:e}=this.waiting;this.waiting=void 0,e({value:void 0,done:!0})}}async next(){if(this.closed)return{value:void 0,done:!0};const e=this.queue.shift();return void 0!==e?{value:e,done:!1}:await new Promise((e=>{this.waiting={resolve:e}}))}},rt=class{opts;queues=new Map;source=null;running=!1;pumpPromise=null;constructor(e){this.opts=e}start(){this.running||(this.running=!0,this.source=this.opts.createSource(),this.pumpPromise=(async()=>{try{for await(const e of this.source){try{this.opts.onFrame?.(e)}catch{}for(const t of this.queues.values())t.push(e)}}catch(e){this.opts.onError?.(e)}finally{for(const e of this.queues.values())e.close();this.queues.clear()}})())}subscribe(e){const t=new st(this.opts.maxQueueItems);this.queues.set(e,t);const A=this;return async function*(){try{for(;;){const e=await t.next();if(e.done)return;yield e.value}}finally{t.close(),A.queues.delete(e)}}()}async stop(){if(!this.running)return;this.running=!1;const e=this.source;this.source=null;for(const e of this.queues.values())e.close();this.queues.clear();try{await(e?.return(void 0))}catch{}try{await this.pumpPromise}catch{}this.pumpPromise=null}};var nt=class e extends r.EventEmitter{api;channel;profile;listenHost;listenPort;path;logger;tcpRtpFraming;active=!1;flow;connectedClients=new Set;nativeStreamActive=!1;clientConnectionServer;streamMetadata=null;clientResources=new Map;isRtspDebugEnabled(){return this.api.client.getDebugConfig().debugRtsp||function(e,t){if(null==e)return t;const A=e.trim().toLowerCase();return"1"===A||"true"===A||"yes"===A||"on"===A||"0"!==A&&"false"!==A&&"no"!==A&&"off"!==A&&t}(process.env.BAICHUAN_DEBUG_RTSP,!1)}rtspDebugLog(e){this.isRtspDebugEnabled()&&this.logger.debug(`[BaichuanRtspServer] ${e}`)}firstFramePromise=null;firstFrameResolve=null;firstFrameReceived=!1;firstAudioPromise=null;firstAudioResolve=null;firstAudioDetected=!1;hasAudio=!1;audioInfo=null;audioPrimingFrame=null;tempStreamGenerator=null;nativeFanout=null;noClientAutoStopTimer;static isAdtsAacFrame(e){return e.length>=2&&255===e[0]&&!(240&~e[1])}static parseAdtsSamplingInfo(t){if(t.length<7)return null;if(!e.isAdtsAacFrame(t))return null;const A=t[2]>>2&15,s=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350][A]??null;if(!s)return null;const r=(1&t[2])<<2|t[3]>>6&3,n=0===r?1:r,i=(t[2]>>6&3)+1<<11|A<<7|r<<3;return{sampleRate:s,channels:n,configHex:Buffer.from([i>>8&255,255&i]).toString("hex")}}static parseInterleavedChannels(e){const t=e.match(/interleaved\s*=\s*(\d+)\s*-\s*(\d+)/i);if(!t)return null;const A=Number.parseInt(t[1],10),s=Number.parseInt(t[2],10);return Number.isFinite(A)&&Number.isFinite(s)?{rtp:A,rtcp:s}:null}static splitAnnexBNals(e){const t=[],A=e.length,s=t=>{if(t+3<=A&&0===e[t]&&0===e[t+1]){if(1===e[t+2])return 3;if(t+4<=A&&0===e[t+2]&&1===e[t+3])return 4}return 0};let r=0;for(;r<A;){if(s(r))break;r++}for(;r<A;){const n=s(r);if(!n){r++;continue}const i=r+n;let o=i;for(;o<A;){if(s(o))break;o++}if(i<o){const A=e.subarray(i,o);A.length>0&&t.push(A)}r=o}return t}static stripAdtsHeader(t){if(!e.isAdtsAacFrame(t))return null;if(t.length<7)return null;const A=!(1&~t[1])?7:9;return t.length<=A?null:t.subarray(A)}constructor(e){super(),this.api=e.api,this.channel=e.channel,this.profile=e.profile,this.listenHost=e.listenHost??"127.0.0.1",this.listenPort=e.listenPort??8554,this.path=e.path??`/stream/${this.profile}`,this.logger=e.logger??console,this.tcpRtpFraming=e.tcpRtpFraming??"rfc4571";const t=this.api.client.getTransport();this.flow=At(t,"H264")}clearNoClientAutoStopTimer(){this.noClientAutoStopTimer&&(clearTimeout(this.noClientAutoStopTimer),this.noClientAutoStopTimer=void 0)}setFlowVideoType(e,t){if(this.flow.videoType===e)return;const A=this.api.client.getTransport();this.flow.stopKeepAlive(),this.flow=At(A,e),this.rtspDebugLog(`Using RTSP flow ${this.flow.key} (${t})`)}async start(){if(this.active)throw new Error("RTSP server is already active");try{const e=(await this.api.getStreamMetadata(this.channel)).streams.find((e=>e.profile===this.profile));if(e){this.streamMetadata={frameRate:e.frameRate||25,width:e.width,height:e.height};const t=String(e.videoEncType??"").trim().toLowerCase(),A=t.includes("265")||t.includes("hevc")?"H265":"H264";this.setFlowVideoType(A,"metadata")}}catch(e){this.logger.warn(`[BaichuanRtspServer] Could not get stream metadata: ${e}`),this.streamMetadata={frameRate:25,width:1920,height:1080},this.setFlowVideoType("H264","metadata unavailable")}this.clientConnectionServer=n.createServer((e=>{this.handleRtspConnection(e)})),await new Promise(((e,t)=>{this.clientConnectionServer.listen(this.listenPort,this.listenHost,(()=>{const t=this.clientConnectionServer.address();t&&"object"==typeof t&&"port"in t&&(this.listenPort=t.port),e()})),this.clientConnectionServer.on("error",(e=>{t(e)}))})),this.active=!0,this.logger.info(`[BaichuanRtspServer] RTSP server started on ${this.listenHost}:${this.listenPort}, path: ${this.path}`)}handleRtspConnection(t){const A=`${t.remoteAddress}:${t.remotePort}`;this.logger.info(`[BaichuanRtspServer] RTSP client connected: ${A}`);let s,r="",n=Buffer.alloc(0),i=!1,o=null,a=null;const c=()=>{this.removeClient(A);const e=this.clientResources.get(A);if(e){if(e.ffmpeg)try{e.ffmpeg.stdin?.end(),e.ffmpeg.kill("SIGTERM"),setTimeout((()=>{try{e.ffmpeg?.kill("SIGKILL")}catch{}}),1e3)}catch{}if(e.udpSocket)try{e.udpSocket.close()}catch{}if(e.udpSocketAudio)try{e.udpSocketAudio.close()}catch{}if(e.rtspSocket&&!e.rtspSocket.destroyed)try{e.rtspSocket.destroy()}catch{}this.clientResources.delete(A)}if(s){try{s.stdin?.end(),s.kill("SIGTERM"),setTimeout((()=>{try{s?.kill("SIGKILL")}catch{}}),1e3)}catch{}s=void 0}if(o){try{o.close()}catch{}o=null}if(a){try{a.close()}catch{}a=null}};t.on("close",c),t.on("error",(e=>{e&&"object"==typeof e&&"code"in e&&"EPIPE"!==e.code&&this.logger.error("[BaichuanRtspServer] RTSP client error:",e),c()})),t.on("data",(async l=>{for(n=Buffer.concat([n,l]);n.includes("\r\n\r\n");){const l=n.indexOf("\r\n\r\n"),h=n.subarray(0,l).toString();if(n=n.subarray(l+4),!h.trim())continue;const g=h.split("\r\n"),d=g[0]?.split(" ");if(!d||d.length<3)continue;const u=d[0],E=d[1],I=d[2],Q=h.match(/CSeq:\s*(\d+)/i),C=Q?parseInt(Q[1]??"0",10):0,B=(e,A,s={},r)=>{let n=`${I} ${e} ${A}\r\n`;n+=`CSeq: ${C}\r\n`;for(const[e,t]of Object.entries(s))n+=`${e}: ${t}\r\n`;r&&(n+=`Content-Length: ${Buffer.byteLength(r,"utf8")}\r\n`),n+="\r\n",r&&(n+=r),t.write(n)};if(this.rtspDebugLog(`RTSP ${u} ${E}`),"OPTIONS"===u)B(200,"OK",{Public:"DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, OPTIONS"});else if("DESCRIBE"===u){if(!this.firstFrameReceived&&0===this.connectedClients.size){try{this.nativeStreamActive||await this.startNativeStream()}catch(e){this.logger.warn(`[BaichuanRtspServer] Failed to start native stream for SDP priming: ${e}`)}const{hasParamSets:e}=this.flow.getFmtp();if(!e){const e="udp"===this.api.client.getTransport()?4e3:1500;try{await Promise.race([this.firstFramePromise||Promise.resolve(),new Promise((t=>setTimeout(t,e)))])}catch{}}}{const{fmtp:e,hasParamSets:t}=this.flow.getFmtp(),s=e.length>160?`${e.slice(0,160)}...`:e;this.logger.info(`[BaichuanRtspServer] DESCRIBE SDP for ${A} path=${this.path} codec=${this.flow.sdpCodec} hasParamSets=${t} fmtp=${s}`),t||this.rtspDebugLog(`DESCRIBE responding without parameter sets yet (client=${A}, path=${this.path}, flow=${this.flow.key})`)}const e=this.generateSdp();B(200,"OK",{"Content-Type":"application/sdp","Content-Base":`rtsp://${this.listenHost}:${this.listenPort}${this.path}/`},e)}else if("SETUP"===u){const n=E?.includes("track0"),c=E?.includes("track1");if(!n&&!c){B(404,"Not Found",{Session:r||`session_${Date.now()}_${Math.random().toString(36).substring(7)}`});continue}if(c&&!this.hasAudio){B(404,"Not Found",{Session:r||`session_${Date.now()}_${Math.random().toString(36).substring(7)}`});continue}this.connectedClients.add(A),this.emit("client",A),this.clearNoClientAutoStopTimer(),1!==this.connectedClients.size||this.nativeStreamActive||await this.startNativeStream();const l=h.match(/Transport:\s*([^\r\n]+)/i),g=(l?.[1]??"").trim();i=!g||(g.includes("TCP")||g.includes("tcp")),r||(r=`session_${Date.now()}_${Math.random().toString(36).substring(7)}`);const d=this.clientResources.get(A);if(d?d.rtspSocket=t:this.clientResources.set(A,{ffmpeg:void 0,udpSocket:null,udpSocketAudio:null,rtspSocket:t,pipelineStarted:!1,seenFirstVideoKeyframe:!1,setupTrack0:!1,setupTrack1:!1,isPlaying:!1}),i){const t=this.clientResources.get(A),s=e.parseInterleavedChannels(g);if(t)if(c){const e=s??{rtp:2,rtcp:3};t.track1RtpChannel=e.rtp,t.track1RtcpChannel=e.rtcp}else{const e=s??{rtp:0,rtcp:1};t.track0RtpChannel=e.rtp,t.track0RtcpChannel=e.rtcp}}{const e=this.clientResources.get(A);e&&!e.pipelineStarted&&(e.pipelineStarted=!0,await this.startClientFfmpeg(A,t,i,((e,t,r)=>{s=e,o=t,a=r;const n=this.clientResources.get(A);n&&(n.ffmpeg=e,n.udpSocket=t,n.udpSocketAudio=r)})))}{const e=this.clientResources.get(A);e&&(c?e.setupTrack1=!0:e.setupTrack0=!0,this.rtspDebugLog(`SETUP done for ${A}: track0=${!!e.setupTrack0} track1=${!!e.setupTrack1} playing=${!!e.isPlaying}`))}if(i){const e=this.clientResources.get(A),t=c?{rtp:2,rtcp:3}:{rtp:0,rtcp:1};B(200,"OK",{Transport:`RTP/AVP/TCP;unicast;interleaved=${`${c?e?.track1RtpChannel??t.rtp:e?.track0RtpChannel??t.rtp}-${c?e?.track1RtcpChannel??t.rtcp:e?.track0RtcpChannel??t.rtcp}`}`,Session:r})}else B(200,"OK",{Transport:"RTP/AVP/UDP;unicast;client_port=5004-5005;server_port=5004-5005",Session:r})}else if("PLAY"===u){{const e=this.clientResources.get(A);e&&(e.isPlaying=!0,this.rtspDebugLog(`PLAY for ${A}: track0=${!!e.setupTrack0} track1=${!!e.setupTrack1} playing=${!!e.isPlaying}`))}B(200,"OK",{Session:r,Range:"npt=0.000-"})}else"TEARDOWN"===u?(c(),B(200,"OK",{Session:r}),t.end()):B(501,"Not Implemented")}}))}generateSdp(){const e=this.flow.sdpCodec;let t="v=0\r\n";t+=`o=- ${Date.now()} ${Date.now()} IN IP4 ${this.listenHost}\r\n`,t+="s=Baichuan Stream\r\n",t+=`c=IN IP4 ${this.listenHost}\r\n`,t+="t=0 0\r\n",t+="m=video 0 RTP/AVP 96\r\n",t+=`a=rtpmap:96 ${e}/90000\r\n`,this.streamMetadata?.frameRate&&(t+=`a=framerate:${this.streamMetadata.frameRate}\r\n`),this.streamMetadata?.width&&this.streamMetadata?.height&&(t+=`a=framesize:96 ${this.streamMetadata.width}-${this.streamMetadata.height}\r\n`),t+="a=control:track0\r\n";const{fmtp:A,hasParamSets:s}=this.flow.getFmtp();if(s||this.logger.warn(`[BaichuanRtspServer] SDP missing parameter sets for flow ${this.flow.key}`),A&&(t+=`a=fmtp:96 ${A}\r\n`),this.hasAudio){t+="m=audio 0 RTP/AVP 97\r\n";const e=this.audioInfo,A=e?.sampleRate??8e3,s=e?.channels??1,r=e?.configHex??"";t+=`a=rtpmap:97 mpeg4-generic/${A}/${s}\r\n`,r&&(t+=`a=fmtp:97 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=${r}; SizeLength=13; IndexLength=3; IndexDeltaLength=3;\r\n`),t+="a=control:track1\r\n"}return t+="a=setup:passive\r\n",t+="a=connection:new\r\n",t}async startClientFfmpeg(t,A,s,r){let n=this.streamMetadata;if(!n||!n.frameRate)try{const e=(await this.api.getStreamMetadata(this.channel)).streams.find((e=>e.profile===this.profile));e&&(n={frameRate:e.frameRate||25,width:e.width,height:e.height},this.rtspDebugLog(`Fetched metadata for profile ${this.profile}: ${n.frameRate} fps`))}catch(e){this.logger.warn(`[BaichuanRtspServer] Could not fetch stream metadata: ${e}`),n={frameRate:25,width:1920,height:1080}}const o=this.flow.ffmpegFormat;let a=0,c=0,l=null,g=null;const d=s,u=(e,t)=>{if("rfc4571"===(s?"rtsp-interleaved":this.tcpRtpFraming)){const e=Buffer.alloc(2);return e.writeUInt16BE(65535&t.length,0),Buffer.concat([e,t])}const A=Buffer.alloc(4);return A[0]=36,A[1]=255&e,A[2]=t.length>>8&255,A[3]=255&t.length,Buffer.concat([A,t])};if(s&&!d){a=5e4+Math.floor(1e4*Math.random()),l=i.createSocket("udp4"),await new Promise(((e,t)=>{l.once("listening",(()=>e())),l.once("error",t),l.bind(a,"127.0.0.1")}));const e=(e,s)=>{if(!A||A.destroyed||!A.writable)return!1;if(s.length<12)return!1;if(2!==(s[0]>>6&3))return!1;const r=this.clientResources.get(t);if(!r?.isPlaying)return!1;const n=r?.track0RtpChannel??0,i=r?.track1RtpChannel??2;if(e===n&&!r?.setupTrack0)return!1;if(e===i&&!r?.setupTrack1)return!1;try{return A.write(u(e,s))}catch(e){if(e&&"object"==typeof e&&"code"in e&&"EPIPE"===e.code)return!1}return!1};if(l){const A=this.clientResources.get(t),s=A?.track0RtpChannel??0;let r=0,n=!1,i=!1;l.on("message",(A=>{n||(n=!0,this.rtspDebugLog(`First video RTP packet received from ffmpeg for client ${t} (len=${A.length})`));e(s,A)&&!i&&(i=!0,this.rtspDebugLog(`First video RTP packet forwarded via TCP interleaved for client ${t}`)),r++,r%1e3==0&&this.rtspDebugLog(`Forwarded ${r} RTP packets to client ${t} via TCP interleaved`)}))}if(this.hasAudio){c=a+2+2*Math.floor(1e3*Math.random()),g=i.createSocket("udp4"),await new Promise(((e,t)=>{g.once("listening",(()=>e())),g.once("error",t),g.bind(c,"127.0.0.1")}));let A=0,s=!1,r=!1;g.on("message",(n=>{const i=this.clientResources.get(t),o=i?.track1RtpChannel??2;A++,s||(s=!0,this.rtspDebugLog(`First audio RTP packet received from ffmpeg for client ${t} (len=${n.length})`));e(o,n)&&!r&&(r=!0,this.rtspDebugLog(`First audio RTP packet forwarded via TCP interleaved for client ${t}`)),A%1e3==0&&this.rtspDebugLog(`Forwarded ${A} audio RTP packets to client ${t} via TCP interleaved`)}))}}const E=this.clientResources.get(t),I=this.isRtspDebugEnabled(),Q=e=>this.rtspDebugLog(e),C=(e,t)=>{if(!A||A.destroyed||!A.writable)return!1;try{return A.write(u(e,t))}catch(e){if(e&&"object"==typeof e&&"code"in e&&"EPIPE"===e.code)return!1}return!1},B=(e,t,A,s,r)=>{const n=Buffer.alloc(12);return n[0]=128,n[1]=(t?128:0)|127&e,n.writeUInt16BE(65535&A,2),n.writeUInt32BE(s>>>0,4),n.writeUInt32BE(r>>>0,8),n},p=(e,t,A)=>{const s=e?97:96;if(E?.isPlaying&&(!e||E?.setupTrack1)&&(e||E?.setupTrack0))if(e){void 0===E.rtpAudioSeq&&(E.rtpAudioSeq=Math.floor(65536*Math.random())),void 0===E.rtpAudioTimestamp&&(E.rtpAudioTimestamp=0),void 0===E.rtpAudioSsrc&&(E.rtpAudioSsrc=4294967295*Math.random()>>>0);const e=B(s,A,E.rtpAudioSeq,E.rtpAudioTimestamp,E.rtpAudioSsrc);E.rtpAudioSeq=E.rtpAudioSeq+1&65535,C(E?.track1RtpChannel??2,Buffer.concat([e,t]))}else{void 0===E.rtpVideoSeq&&(E.rtpVideoSeq=Math.floor(65536*Math.random())),void 0===E.rtpVideoTimestamp&&(E.rtpVideoTimestamp=0),void 0===E.rtpVideoSsrc&&(E.rtpVideoSsrc=4294967295*Math.random()>>>0);const e=B(s,A,E.rtpVideoSeq,E.rtpVideoTimestamp,E.rtpVideoSsrc);E.rtpVideoSeq=E.rtpVideoSeq+1&65535,C(E?.track0RtpChannel??0,Buffer.concat([e,t]))}},f=1200,m=t=>{const A=e.splitAnnexBNals(t);for(const e of A){if(e.length<1)continue;if(5===(31&(e[0]??0)))return!0}return!1},y=(e,t)=>{if(e.length<=f)return void p(!1,e,t);const A=e[0],s=31&A,r=224&A|28,n=e.subarray(1);let i=0;for(;i<n.length;){const e=n.length-i,A=Math.min(e,1198),o=0===i,a=i+A>=n.length,c=(o?128:0)|(a?64:0)|s,l=n.subarray(i,i+A),h=Buffer.concat([Buffer.from([r,c]),l]);p(!1,h,t&&a),i+=A}},S=(e,t)=>{if(e.length<=f)return void p(!1,e,t);if(e.length<3)return;const A=e[0],s=A>>1&63,r=129&A|98,n=e[1],i=e.subarray(2);let o=0;for(;o<i.length;){const e=i.length-o,A=Math.min(e,1197),a=0===o,c=o+A>=i.length,l=(a?128:0)|(c?64:0)|63&s,h=i.subarray(o,o+A),g=Buffer.concat([Buffer.from([r,n,l]),h]);p(!1,g,t&&c),o+=A}},D=n?.frameRate&&n.frameRate>0?n.frameRate:25,w=Math.max(1,Math.round(9e4/D)),b=e=>{if(!E)return;if(null==e)return;if(!Number.isFinite(e))return;if(void 0===E.rtpVideoTimestamp&&(E.rtpVideoTimestamp=0),void 0===E.rtpVideoBaseTimestamp&&(E.rtpVideoBaseTimestamp=E.rtpVideoTimestamp),void 0===E.rtpVideoBaseMicroseconds)return E.rtpVideoBaseMicroseconds=e>>>0,void(E.rtpVideoLastTimestamp=E.rtpVideoTimestamp);const t=(e>>>0)-(E.rtpVideoBaseMicroseconds>>>0)>>>0;let A=((E.rtpVideoBaseTimestamp??0)>>>0)+Math.round(9e4*t/1e6)>>>0;const s=E.rtpVideoLastTimestamp;void 0!==s&&A<=s>>>0&&(A=1+(s>>>0)>>>0),E.rtpVideoTimestamp=A,E.rtpVideoLastTimestamp=A},R=(t,A,s=!0)=>{const r=e.splitAnnexBNals(A);if(0!==r.length){for(let e=0;e<r.length;e++){const A=r[e],s=e===r.length-1;"H265"===t?S(A,s):y(A,s)}s&&void 0!==E?.rtpVideoTimestamp&&void 0===E?.rtpVideoBaseMicroseconds&&(E.rtpVideoTimestamp=E.rtpVideoTimestamp+w>>>0)}},N=t=>{const A=e.stripAdtsHeader(t);if(!A)return;const s=Buffer.from([0,16]),r=8191&A.length,n=Buffer.alloc(2);n[0]=r>>5&255,n[1]=(31&r)<<3;const i=Buffer.concat([s,n,A]);p(!0,i,!0),void 0!==E?.rtpAudioTimestamp&&(E.rtpAudioTimestamp=E.rtpAudioTimestamp+1024>>>0)},k=e=>{const t=Me(e);for(const e of t){if(e.length<2)continue;const t=e[0];if(void 0===t)continue;if(128&t)continue;if(Le(t>>1&63))return!0}return!1};let T,F;if(d&&r(void 0,null,null),!d){const e=["-hide_banner","-loglevel","error","-fflags","+genpts+igndts"],A=n?.frameRate||25;if(A>0&&(e.push("-r",A.toString()),this.rtspDebugLog(`Using frame rate ${A} fps for client ${t}`)),e.push("-f",o,"-i","pipe:0"),this.hasAudio&&e.push("-f","aac","-i","pipe:3"),s){if(e.push("-map","0:v:0","-c:v","copy","-vsync","cfr","-avoid_negative_ts","make_zero","-f","rtp","-payload_type","96",`rtp://127.0.0.1:${a}?pkt_size=1300`),this.hasAudio&&g&&c){const t=this.audioInfo,A=t?.sampleRate??8e3,s=t?.channels??1;e.push("-map","1:a:0","-c:a","aac","-profile:a","aac_low","-ar",String(A),"-ac",String(s),"-flags:a","+global_header","-f","rtp","-payload_type","97",`rtp://127.0.0.1:${c}?pkt_size=1300`)}}else e.push("-map","0:v:0","-c:v","copy","-vsync","cfr","-avoid_negative_ts","make_zero","-f","rtp","-payload_type","96","rtp://127.0.0.1:5004?pkt_size=1300");const i=["pipe","ignore","pipe"];this.hasAudio&&i.push("pipe"),this.rtspDebugLog(`Spawning ffmpeg for client ${t}: ffmpeg ${e.join(" ")}`),T=(0,h.spawn)("ffmpeg",e,{stdio:i});try{const e=this.flow.getParameterSetsAnnexB();e&&e.length>0&&T?.stdin&&(T.stdin.write(e),this.rtspDebugLog(`Wrote video parameter sets to ffmpeg stdin for client ${t} (len=${e.length})`))}catch(e){this.logger.warn(`[BaichuanRtspServer] Failed to write video parameter sets to ffmpeg for client ${t}: ${e}`)}if(T.on("error",(e=>{this.logger.error(`[BaichuanRtspServer] Failed to spawn ffmpeg for client ${t}:`,e)})),T.on("close",((e,A)=>{this.rtspDebugLog(`ffmpeg exited for client ${t} (code=${e}, signal=${A})`)})),r(T,l,g),T.stdin?.on("error",(e=>{const A=e?.code;"EPIPE"!==A&&"ERR_STREAM_WRITE_AFTER_END"!==A?this.logger.error(`[BaichuanRtspServer] FFmpeg stdin error for client ${t}:`,e):this.rtspDebugLog(`FFmpeg stdin error (${A}) for client ${t}`)})),F=this.hasAudio?T.stdio?.[3]:void 0,F?.on?.("error",(e=>{const A=e?.code;"EPIPE"!==A&&"ERR_STREAM_WRITE_AFTER_END"!==A?this.logger.error(`[BaichuanRtspServer] FFmpeg audio pipe error for client ${t}:`,e):this.rtspDebugLog(`FFmpeg audio pipe error (${A}) for client ${t}`)})),F&&this.audioPrimingFrame)try{F.write(this.audioPrimingFrame)}catch{}}this.rtspDebugLog(`Creating native stream iterator for client ${t}`);const v=this.nativeFanout?this.nativeFanout.subscribe(t):ze(this.api,this.channel,this.profile);this.tempStreamGenerator=null;let M=0,U=Date.now();const L=n&&n.frameRate>0?1e3/n.frameRate:40;(async()=>{try{this.rtspDebugLog(`Starting to feed frames to client ${t} (target FPS: ${n?.frameRate||25}, interval: ${L}ms)`);let A=0,s=!1,r=!1,i=!1,o=!1,a=!1;for await(const n of v){if(!this.connectedClients.has(t)){this.rtspDebugLog(`Client ${t} disconnected, stopping frame feed`);break}const c=T?.stdin;if(!d&&(!c||c.destroyed||c.writableEnded||c.writableFinished)){this.rtspDebugLog(`FFmpeg stdin closed for client ${t}`);break}if(0===n.data.length)continue;if(!n.audio&&!i&&(i=!0,I)){const e=n.data.subarray(0,16).toString("hex");Q(`First video frame received from generator for client ${t} (len=${n.data.length}, videoType=${String(n.videoType??this.flow.videoType)}, head=${e})`)}if(n.audio){if(A++,1===A&&this.rtspDebugLog(`Audio frames detected (codec: ${n.codec||"unknown"}, sampleRate: ${n.sampleRate||"unknown"})`),A%100==0&&this.rtspDebugLog(`Received ${A} audio frames (not sent to RTSP yet)`),d){if(!E?.seenFirstVideoKeyframe)continue;if(this.hasAudio&&e.isAdtsAacFrame(n.data)){if(I&&!r){r=!0;const e=n.data.subarray(0,16).toString("hex");Q(`First audio ADTS frame packetized to RTP for client ${t} (len=${n.data.length}, head=${e})`)}N(n.data)}continue}if(this.hasAudio&&F&&!F.writableEnded&&!F.writableFinished){const A=F;if(!A)continue;if(e.isAdtsAacFrame(n.data))try{if(!r){r=!0;const e=n.data.subarray(0,16).toString("hex");this.rtspDebugLog(`First audio frame written to ffmpeg pipe for client ${t} (len=${n.data.length}, head=${e})`)}A.write(n.data)||await new Promise((e=>A.once("drain",(()=>e()))))}catch{}}continue}if("H264"===n.videoType||"H265"===n.videoType){const e="H264"===n.videoType?fe(n.data):Fe(n.data);0===M&&this.setFlowVideoType(n.videoType,"first video frame");if(this.flow.getFmtp().hasParamSets)this.firstFrameReceived||this.markFirstFrameReceived();else{this.flow.extractParameterSets(e);this.flow.getFmtp().hasParamSets&&this.markFirstFrameReceived()}}M++,M%100==0&&this.rtspDebugLog(`Sent ${M} frames to client ${t} (frame size: ${n.data.length} bytes)`);const l=Date.now(),h=L-(l-U);if(h>0&&await new Promise((e=>setTimeout(e,Math.min(h,2*L)))),U=Date.now(),d){const e=n.videoType??this.flow.videoType,A="H264"===e?fe(n.data):Fe(n.data);if(!E?.seenFirstVideoKeyframe)if("H265"===e){const{hasParamSets:s}=this.flow.getFmtp();if(!s){I&&!o&&(o=!0,Q(`H265 gating: waiting for VPS/SPS/PPS before sending RTP to client ${t}`));continue}if(!E?.rtpSentVideoConfig){const t=this.flow.getParameterSetsAnnexB();t&&t.length>0&&(R(e,t,!1),E.rtpSentVideoConfig=!0)}E.h265WaitStartMs||(E.h265WaitStartMs=Date.now());const r=k(A),n=Date.now()-E.h265WaitStartMs;if(!r&&n<2e3){I&&!a&&(a=!0,Q(`H265 gating: waiting for IRAP (or timeout) for client ${t}`));continue}E.seenFirstVideoKeyframe=!0}else{const{hasParamSets:s}=this.flow.getFmtp();if(!s){I&&!o&&(o=!0,Q(`H264 gating: waiting for SPS/PPS before sending RTP to client ${t}`));continue}if(!E?.rtpSentVideoConfig){const t=this.flow.getParameterSetsAnnexB();t&&t.length>0&&(R(e,t,!1),E.rtpSentVideoConfig=!0)}if(!m(A))continue;E.seenFirstVideoKeyframe=!0}const r=n.microseconds;if(b(r),!E?.rtpSentVideoConfig){const t=this.flow.getParameterSetsAnnexB();t&&t.length>0&&(R(e,t,!1),E.rtpSentVideoConfig=!0)}if(!s&&(s=!0,I)){const e=n.data.subarray(0,16).toString("hex");Q(`First video access unit packetized to RTP for client ${t} (len=${n.data.length}, head=${e})`)}R(e,A,!0)}else try{if(c&&!c.destroyed&&!c.writableEnded&&!c.writableFinished){if(!s){s=!0;const e=n.data.subarray(0,16).toString("hex");this.rtspDebugLog(`First video frame written to ffmpeg stdin for client ${t} (len=${n.data.length}, head=${e})`)}c.write("H264"===n.videoType?fe(n.data):n.data)||await new Promise((e=>{c?c.once("drain",(()=>e())):e()}))}}catch(e){const A=e?.code;if("EPIPE"===A||"ERR_STREAM_WRITE_AFTER_END"===A){this.rtspDebugLog(`EPIPE writing to ffmpeg for client ${t}`);break}this.logger.error(`[BaichuanRtspServer] Error writing frame to ffmpeg for client ${t}:`,e)}}this.rtspDebugLog(`Finished feeding frames to client ${t} (total: ${M} frames)`)}catch(e){this.logger.error(`[BaichuanRtspServer] Error in feedFrames for client ${t}:`,e)}})().catch((e=>{this.logger.error(`[BaichuanRtspServer] Error feeding frames to client ${t}:`,e)})),T?.stderr?.on("data",(e=>{const A=e.toString();(A.includes("error")||A.includes("Error"))&&this.logger.error(`[BaichuanRtspServer] FFmpeg error for client ${t}: ${A}`)}))}async startNativeStream(){this.nativeStreamActive||(this.nativeStreamActive=!0,this.firstFrameReceived=!1,this.firstAudioDetected=!1,this.hasAudio=!1,this.audioInfo=null,this.audioPrimingFrame=null,this.firstFramePromise=new Promise((e=>{this.firstFrameResolve=e})),this.firstAudioPromise=new Promise((e=>{this.firstAudioResolve=e})),this.rtspDebugLog(`Starting native stream for profile ${this.profile} (waiting for camera to start transmitting...)`),await this.flow.startKeepAlive(this.api),this.nativeFanout=new rt({maxQueueItems:200,createSource:()=>ze(this.api,this.channel,this.profile),onFrame:t=>{if(t.audio){if(!this.hasAudio&&"tcp"===this.api.client.getTransport()&&e.isAdtsAacFrame(t.data)){const A=e.parseAdtsSamplingInfo(t.data);A&&(this.hasAudio=!0,this.audioInfo={codec:"aac-adts",sampleRate:A.sampleRate,channels:A.channels,configHex:A.configHex},this.audioPrimingFrame=Buffer.from(t.data),this.markFirstAudioDetected(),this.rtspDebugLog(`Audio detected (AAC/ADTS ${A.sampleRate}Hz ch=${A.channels}); advertising RTSP track1 as mpeg4-generic`))}return}if(0===t.data.length)return;"H264"!==t.videoType&&"H265"!==t.videoType||this.setFlowVideoType(t.videoType,"native stream"),this.flow.extractParameterSets(t.data);const{hasParamSets:A}=this.flow.getFmtp();A&&this.markFirstFrameReceived()},onError:e=>{this.logger.warn(`[BaichuanRtspServer] Shared native stream error: ${e}`)}}),this.nativeFanout.start(),this.clearNoClientAutoStopTimer(),this.noClientAutoStopTimer=setTimeout((()=>{0===this.connectedClients.size&&(this.rtspDebugLog("Auto-stopping primed native stream (no clients connected)"),this.stopNativeStream())}),15e3),this.noClientAutoStopTimer?.unref?.())}markFirstFrameReceived(){!this.firstFrameReceived&&this.firstFrameResolve&&(this.firstFrameReceived=!0,this.rtspDebugLog(`First frame received from camera for profile ${this.profile}`),this.firstFrameResolve(),this.firstFrameResolve=null)}markFirstAudioDetected(){!this.firstAudioDetected&&this.firstAudioResolve&&(this.firstAudioDetected=!0,this.firstAudioResolve(),this.firstAudioResolve=null)}async stopNativeStream(){if(this.nativeStreamActive){if(this.rtspDebugLog("Stopping native stream"),this.flow.stopKeepAlive(),this.clearNoClientAutoStopTimer(),this.nativeStreamActive=!1,this.firstFrameReceived=!1,this.firstFramePromise=null,this.firstFrameResolve&&(this.firstFrameResolve=null),this.firstAudioDetected=!1,this.firstAudioPromise=null,this.firstAudioResolve&&(this.firstAudioResolve=null),this.nativeFanout){const e=this.nativeFanout;this.nativeFanout=null,await e.stop()}if(this.tempStreamGenerator){try{await this.tempStreamGenerator.return(void 0)}catch{}this.tempStreamGenerator=null}}}removeClient(e){this.connectedClients.has(e)&&(this.connectedClients.delete(e),this.emit("clientDisconnected",e),this.logger.info(`[BaichuanRtspServer] RTSP client disconnected: ${e}`),0===this.connectedClients.size&&this.stopNativeStream())}async waitUntilReady(e=3e4){return new Promise(((t,A)=>{if(!this.clientConnectionServer)return void A(new Error("RTSP server not started"));const s=setTimeout((()=>{A(new Error(`Timeout waiting for RTSP server to be ready (${e}ms). Camera may be sleeping or not responding.`))}),e),r=()=>{const e=new n.Socket;e.setTimeout(1e3),e.on("connect",(()=>{e.destroy(),this.nativeStreamActive&&this.firstFramePromise?(this.rtspDebugLog("Port is listening, waiting for camera to start transmitting frames..."),this.firstFramePromise.then((()=>{clearTimeout(s),t()})).catch((e=>{clearTimeout(s),A(e)}))):(clearTimeout(s),t())})),e.on("timeout",(()=>{e.destroy(),setTimeout(r,500)})),e.on("error",(()=>{e.destroy(),setTimeout(r,500)})),e.connect(this.listenPort,this.listenHost)};r()}))}async stop(){if(!this.active)return;this.logger.info(`[BaichuanRtspServer] Stopping RTSP server on ${this.listenHost}:${this.listenPort}...`),await this.stopNativeStream();const e=Array.from(this.connectedClients);for(const t of e){const e=this.clientResources.get(t);if(e){if(e.ffmpeg)try{e.ffmpeg.stdin?.end(),e.ffmpeg.kill("SIGTERM"),setTimeout((()=>{try{e.ffmpeg?.kill("SIGKILL")}catch{}}),1e3)}catch{}if(e.udpSocket)try{e.udpSocket.close()}catch{}if(e.rtspSocket&&!e.rtspSocket.destroyed)try{e.rtspSocket.destroy()}catch{}}}this.clientResources.clear(),this.clientConnectionServer&&(await new Promise((e=>{this.clientConnectionServer?.close((()=>{e()}))})),this.clientConnectionServer=void 0),this.active=!1,this.connectedClients.clear(),this.emit("close"),this.logger.info("[BaichuanRtspServer] RTSP server stopped")}getRtspUrl(){return`rtsp://${this.listenHost}:${this.listenPort}${this.path}`}isActive(){return this.active}getClientCount(){return this.connectedClients.size}},it={resolution_index:[0,7],tv_system:[7,1],framerate:[8,7],audio_index:[15,2],ai_pd:[17,1],ai_fd:[18,1],ai_vd:[19,1],ai_ad:[20,1],encoder_type_index:[21,2],is_schedule_record:[23,1],is_motion_record:[24,1],is_rf_record:[25,1],is_doorbell_record:[26,1],ai_other:[27,1]},ot={resolution_index:[0,7],tv_system:[7,1],framerate:[8,7],audio_index:[15,2],ai_pd:[17,1],ai_fd:[18,1],ai_vd:[19,1],ai_ad:[20,1],encoder_type_index:[21,2],is_schedule_record:[23,1],is_motion_record:[24,1],is_rf_record:[25,1],is_doorbell_record:[26,1],is_ai_other_record:[27,1],picture_layout_index:[28,7],package_delivered:[35,1],package_takenaway:[36,1]},at={cam:{2:it,3:it,4:it,7:it,9:it,10:it},hub:{0:ot,1:{...ot,package_event:[37,1]},2:{resolution_index:[0,7],tv_system:[7,1],framerate:[8,7],audio_index:[15,2],ai_pd:[17,1],ai_fd:[18,1],ai_vd:[19,1],ai_ad:[20,1],ai_other:[21,2],encoder_type_index:[23,1],is_schedule_record:[24,1],is_motion_record:[25,1],is_rf_record:[26,1],is_doorbell_record:[27,1],picture_layout_index:[28,7],package_delivered:[35,1],package_takenaway:[36,1],package_event:[37,1],upload_flag:[38,1]}}};function ct(e,t,A){const s=at[e],r=s[t]??s[Math.max(...Object.keys(s).map((e=>Number(e))))];if(!r)return;const n=function(e,t){if(!e)return;if(!/^[0-9a-fA-F]+$/.test(e))return;const A=4*e.length,s=BigInt(`0x${e}`).toString(2).padStart(A,"0").split("").reverse().join(""),r=BigInt(`0b${s}`),n={};for(const[e,[A,s]]of Object.entries(t)){const t=BigInt(A),i=((r&(1n<<BigInt(s))-1n<<t)>>t).toString(2).padStart(s,"0").split("").reverse().join("");n[e]=Number.parseInt(i,2)}return n}(A,r);if(!n)return;return{raw:n,flags:{aiPerson:1===n.ai_pd,aiVehicle:1===n.ai_vd,aiAnimal:1===n.ai_ad,aiFace:1===n.ai_fd,aiOther:1===n.is_ai_other_record||1===n.ai_other||(n.ai_other??0)>0,schedule:1===n.is_schedule_record,motion:1===n.is_motion_record,rf:1===n.is_rf_record,doorbell:1===n.is_doorbell_record,package:1===n.package_event||1===n.package_delivered||1===n.package_takenaway}}}function lt(e,t){if(!/^\d{8}$/.test(e))return;if(!/^\d{6}$/.test(t))return;const A=Number.parseInt(e.slice(0,4),10),s=Number.parseInt(e.slice(4,6),10),r=Number.parseInt(e.slice(6,8),10),n=Number.parseInt(t.slice(0,2),10),i=Number.parseInt(t.slice(2,4),10),o=Number.parseInt(t.slice(4,6),10);return[A,s,r,n,i,o].every(Number.isFinite)?new Date(A,s-1,r,n,i,o):void 0}function ht(e){const t=e.lastIndexOf(".");if(t<=0||t===e.length-1)return;const A=e.slice(t+1),s=e.slice(0,t).split("/").filter(Boolean).at(-1);if(!s)return;const r=s.split("_"),n=r[0]??"";if(!n.startsWith("Rec")||6!==n.length)return;const i=n[3],o="M"===i?"main":"S"===i?"sub":"unknown",a=Number.parseInt(n.slice(4,6),16);if(!Number.isFinite(a))return;let c,l,h,g="cam",d="",u="",E="",I="";if(6===r.length)d=r[1]??"",u=r[2]??"",E=r[3]??"",I=r[4]??"";else if(7===r.length)d=r[1]??"",u=r[2]??"",E=r[3]??"",c=r[4],I=r[5]??"";else{if(9!==r.length)return;g="hub",d=r[1]??"",u=r[2]??"",E=r[3]??"",c=r[4],l=r[5],h=r[6],I=r[7]??""}d=d.toLowerCase().replace("dst","");const Q=lt(d,u);if(!Q)return;const C="000000"===E?Q:lt(d,E);if(!C)return;const B=Math.max(0,C.getTime()-Q.getTime()),p={baseName:s,ext:A,streamHint:o,version:a,devType:g,start:Q,end:C,durationMs:B},f=ct(g,a,I);return f&&(p.flags=f.flags,p.rawFlags=f.raw),null!=c&&(p.animalTypeRaw=c),null!=l&&(p.widthRaw=l),null!=h&&(p.heightRaw=h),p}function gt(e){if(null==e)return;const t=Number(e);return Number.isFinite(t)?t:void 0}function dt(e){if("number"==typeof e)return e>0;if("string"==typeof e){const t=Number(e);return Number.isFinite(t)?t>0:e.length>0&&"0"!==e}return Boolean(e)}function ut(e,t){if(!e||"object"!=typeof e)return;const A=e[t],s=e[t+1],r=e.Host,n={...r&&"object"==typeof r?r:{},...A&&"object"==typeof A?A:{},...s&&"object"==typeof s?s:{}};return Object.keys(n).length?n:void 0}function Et(e,t){if(!e)return!1;for(const[A,s]of Object.entries(e))if(t.test(A)&&dt(s))return!0;return!1}function It(e){if(!e)return;const t=e.match(/<Support[^>]*>([\s\S]*?)<\/Support>/i);if(!t)return;const A=t[1]??"",s=A.match(/<ptzMode>([^<]*)<\/ptzMode>/i)?.[1],r=[];for(const e of A.matchAll(/<item[^>]*>([\s\S]*?)<\/item>/gi)){const t=e[1]??"",A={chnID:gt(t.match(/<chnID>([^<]*)<\/chnID>/i)?.[1])??0};for(const e of t.matchAll(/<([A-Za-z0-9_]+)>([^<]*)<\/\1>/g)){const t=e[1],s=e[2];if(!t)continue;if("chnID"===t)continue;const r=gt(s);A[t]=r??s}r.push(A)}const n={items:r};void 0!==s&&(n.ptzMode=s);const i=(e,t)=>{const s=(e=>{const t=A.match(new RegExp(`<${e}>([^<]*)<\\/${e}>`,"i"));return gt(t?.[1])})(t);void 0!==s&&(n[e]=s)};i("IOInputPortNum","IOInputPortNum"),i("IOOutputPortNum","IOOutputPortNum"),i("diskNum","diskNum"),i("channelNum","channelNum"),i("audioNum","audioNum"),i("ptzCfg","ptzCfg"),i("B485","B485"),i("autoUpdate","autoUpdate"),i("pushAlarm","pushAlarm"),i("ftp","ftp"),i("ftpTest","ftpTest"),i("email","email"),i("wifi","wifi"),i("record","record"),i("wifiTest","wifiTest"),i("rtsp","rtsp"),i("onvif","onvif"),i("audioTalk","audioTalk");const o=(e=>{const t=A.match(new RegExp(`<${e}>([^<]*)<\\/${e}>`,"i"));return t?.[1]})("subVersion");return void 0!==o&&(n.subVersion=o),n}function Qt(e){const{channel:t}=e,A=ut(e.abilities,t),s=function(e,t){if(!e?.items?.length)return;const A=e=>{const t=e;let A=0;null==t.name&&(A+=2);const s=["ptzType","ptzControl","ptzPreset","ledCtrl","lightType","battery","audioVersion","motion","encCtrl","newIspCfg","remoteAbility"];for(const e of s)void 0!==t[e]&&(A+=3);return A+=Math.min(10,Math.max(0,Object.keys(t).length-1)),A},s=t=>{const s=e.items.filter((e=>e.chnID===t));if(s.length)return s.slice().sort(((e,t)=>A(t)-A(e)))[0]};return s(t)??s(t+1)}(e.support,t),r=e.support?.ptzMode,n="string"==typeof r?r.toLowerCase():void 0,i="none"===n||"0"===n,o=!!s&&dt(s.battery),a=!!s&&dt(s.ptzPreset),c=s?s.doorbellVersion:void 0,l=Number.isFinite(Number(c))?Number(c)>0:dt(c),h=s?s.lightType:void 0,g="number"==typeof h?h:"string"==typeof h?Number(h):void 0,d=!!n&&("none"!==n&&"0"!==n),u=!!n&&(n.includes("pt")||"pt"===n||"ptz"===n),E=!!n&&n.includes("z"),I=Et(A,/battery/i),Q=Et(A,/white\s*led|whiteLed|flood\s*light|floodlight/i),C=Et(A,/audio\s*alarm|audioAlarm|siren|pushAlarn|audioPlay/i),B=dt(e.support?.audioTalk),p=Et(A,/ptz/i),f=Et(A,/zoom|zoomFocus|StartZoomFocus/i),m=Et(A,/preset/i),y=Et(A,/(^|_)pir/i)||Et(A,/rfAlarm/i)||Et(A,/mdWithPir/i),S=!!s&&dt(s.rfCfg),D=!i&&(u||p),w=!i&&(u||p),b=!i&&(E||f),R=!i&&(a||m),N={channel:t,hasPan:D,hasTilt:w,hasZoom:b,hasPresets:R,hasPtz:!i&&(d||D||w||b||R),hasBattery:o||I,hasIntercom:B,hasSiren:C,hasFloodlight:Number.isFinite(g)?g>0:Q,hasPir:y||S,isDoorbell:l};return void 0!==n&&(N.ptzMode=n),N}function Ct(e){return new Promise((t=>setTimeout(t,e)))}function Bt(e,t){const A=new RegExp(`<${t}\\b[^>]*>([\\s\\S]*?)<\\/${t}>`,"g"),s=[];let r;for(;r=A.exec(e);)s.push(r[1]??"");return s}function pt(e){const t=Number.parseInt(H(e,"year")??"",10),A=Number.parseInt(H(e,"month")??"",10),s=Number.parseInt(H(e,"day")??"",10),r=Number.parseInt(H(e,"hour")??"",10),n=Number.parseInt(H(e,"minute")??"",10),i=Number.parseInt(H(e,"second")??"",10);if([t,A,s,r,n,i].every(Number.isFinite))return new Date(t,A-1,s,r,n,i)}function ft(e,t){return`<${e}><year>${t.getFullYear()}</year><month>${t.getMonth()+1}</month><day>${t.getDate()}</day><hour>${t.getHours()}</hour><minute>${t.getMinutes()}</minute><second>${t.getSeconds()}</second></${e}>`}function mt(e){const t=[],A=Bt(e,"FileInfo");for(const e of A){const A=H(e,"Id")??H(e,"ID")??H(e,"id"),s=H(e,"name")??H(e,"fileName"),r=(A??s)?.trim();if(!r)continue;const n={fileName:r};null!=s&&s.trim()&&(n.name=s.trim()),null!=A&&A.trim()&&(n.id=A.trim());const i=H(e,"type")??H(e,"recordType")??H(e,"alarmType");null!=i&&(n.recordType=i);const o=H(e,"size")??H(e,"fileSize"),a=o?Number.parseInt(o,10):void 0;null!=a&&Number.isFinite(a)&&(n.sizeBytes=a);const c=Bt(e,"startTime")[0],l=Bt(e,"endTime")[0],h=c?pt(c):void 0,g=l?pt(l):void 0;h&&(n.startTime=h),g&&(n.endTime=g);const d=ht(n.name??n.fileName);d&&(n.parsedFileName=d,n.startTime||(n.startTime=d.start),n.endTime||(n.endTime=d.end)),t.push(n)}const s=Bt(e,"File");for(const e of s){const A=H(e,"fileName")??H(e,"name");if(!A)continue;const s=H(e,"size")??H(e,"fileSize"),r=s?Number.parseInt(s,10):void 0,n=H(e,"type")??H(e,"recordType")??H(e,"alarmType"),i=Bt(e,"startTime")[0],o=Bt(e,"endTime")[0],a={fileName:A};null!=r&&Number.isFinite(r)&&(a.sizeBytes=r),null!=n&&(a.recordType=n);const c=i?pt(i):void 0,l=o?pt(o):void 0;c&&(a.startTime=c),l&&(a.endTime=l);const h=ht(a.fileName);h&&(a.parsedFileName=h,a.startTime||(a.startTime=h.start),a.endTime||(a.endTime=h.end)),t.push(a)}if(0===t.length){const A=/<fileName>([\s\S]*?)<\/fileName>/g;let s;for(;s=A.exec(e);){const e=(s[1]??"").trim();if(!e)continue;const A={fileName:e},r=ht(e);r&&(A.parsedFileName=r,A.startTime=r.start,A.endTime=r.end),t.push(A)}}if(0===t.length){const A=Bt(e,"alarmVideo");for(const e of A){const A=H(e,"fileName")??H(e,"name");if(!A)continue;const s={fileName:A},r=H(e,"alarmType");null!=r&&(s.recordType=r);const n=Bt(e,"startTime")[0],i=Bt(e,"endTime")[0],o=n?pt(n):void 0,a=i?pt(i):void 0;o&&(s.startTime=o),a&&(s.endTime=a);const c=ht(s.fileName);c&&(s.parsedFileName=c,s.startTime||(s.startTime=c.start),s.endTime||(s.endTime=c.end)),t.push(s)}}const r=new Set;return t.filter((e=>!r.has(e.fileName)&&(r.add(e.fileName),!0)))}function yt(e){const t=H(e,"audioType"),A=Number.parseInt(H(e,"sampleRate")??"",10),s=Number.parseInt(H(e,"samplePrecision")??"",10),r=Number.parseInt(H(e,"lengthPerEncoder")??"",10),n=H(e,"soundTrack"),i=H(e,"priority");if(!(t&&Number.isFinite(A)&&Number.isFinite(s)&&Number.isFinite(r)&&n))return null;const o={audioType:t,sampleRate:A,samplePrecision:s,lengthPerEncoder:r,soundTrack:n};if(void 0!==i){const e=Number.parseInt(i,10);Number.isFinite(e)&&(o.priority=e)}return o}function St(e,t){const A=4+e.length,s=A%8==0?0:8-A%8,r=12+e.length+s,n=Buffer.alloc(r);return n.writeUInt32LE(1651978544,0),n.writeUInt16LE(A,4),n.writeUInt16LE(A,6),n.writeUInt16LE(256,8),n.writeUInt16LE(t,10),e.copy(n,12),n}var Dt=class{client;logger;httpClient;host;username;password;simpleEventListeners=new Set;simpleEventSubscribed=!1;simpleEventSubscribeInFlight;simpleEventUnsubscribeInFlight;statePollingInterval;lastMotionState;lastAiState;rtspServers=new Set;activeVideoMsgNums=new Map;lastSleepProbe;constructor(e){this.logger=e.logger??console,this.client=new he(e),this.host=e.host,this.username=e.username,this.password=e.password,this.httpClient=new ge({host:e.host,username:e.username,password:e.password,timeoutMs:6e5}),this.client.on("event",(e=>{const t=function(e){const t=e.timestamp??Date.now();if("motion"===e.type)return{type:"motion",channel:e.channel,timestamp:t};if("visitor"===e.type)return{type:"doorbell",channel:e.channel,timestamp:t};if("daynight"===e.type)return{type:"daynight",channel:e.channel,timestamp:t};if("ai"===e.type){const A=e.ai,s=A?.type;return{type:s?{people:"people",vehicle:"vehicle",dog_cat:"animal",face:"face",package:"package",other:"other"}[s]:"other",channel:e.channel,timestamp:t}}return null}(e);if(t)for(const e of this.simpleEventListeners)try{e(t)}catch(e){(this.logger.warn??this.logger.error).call(this.logger,"[ReolinkBaichuanApi] onSimpleEvent handler error",e)}}))}async onSimpleEvent(e){this.simpleEventListeners.add(e),await this.ensureSimpleEventSubscribed()}async offSimpleEvent(e){if(e?this.simpleEventListeners.delete(e):this.simpleEventListeners.clear(),0===this.simpleEventListeners.size)await this.ensureSimpleEventUnsubscribed();else{"udp"===this.client.getTransport?.()||this.startStatePolling()}}async ensureSimpleEventSubscribed(){if(0!==this.simpleEventListeners.size&&!this.simpleEventSubscribed)return this.simpleEventSubscribeInFlight||(this.simpleEventSubscribeInFlight=(async()=>{await this.subscribeEvents(),this.simpleEventSubscribed=!0;"udp"===this.client.getTransport?.()||(await this.checkAndDispatchCurrentState(),this.startStatePolling())})().finally((()=>{this.simpleEventSubscribeInFlight=void 0}))),await this.simpleEventSubscribeInFlight}async ensureSimpleEventUnsubscribed(){if(this.simpleEventSubscribed||this.client.subscribed){if(this.simpleEventUnsubscribeInFlight)return await this.simpleEventUnsubscribeInFlight;if(this.simpleEventSubscribeInFlight)try{await this.simpleEventSubscribeInFlight}catch{}return this.simpleEventUnsubscribeInFlight=(async()=>{await this.unsubscribeEvents(),this.simpleEventSubscribed=!1,this.stopStatePolling()})().finally((()=>{this.simpleEventUnsubscribeInFlight=void 0})),await this.simpleEventUnsubscribeInFlight}}normalizeChannel(e){return null==e?0:e}async login(e){await this.client.login(e)}async close(){this.stopStatePolling(),await this.cleanup(),await this.client.close()}async cleanup(){const e=Array.from(this.rtspServers);this.rtspServers.clear(),await Promise.allSettled(e.map((async e=>{try{await e.stop()}catch(e){this.logger.error("[ReolinkBaichuanApi] Error stopping RTSP server during cleanup:",e)}}))),e.length>0&&this.logger.info(`[ReolinkBaichuanApi] Cleaned up ${e.length} RTSP server(s)`)}async sendXml(e,t=3){this.client.loggedIn||await this.client.login();try{const A=await this.client.sendFrame(e);if(400===A.header.responseCode){if(t>0){if(0===A.body.length)try{this.client.loggedIn=!1,await this.client.login()}catch{}const s=1500;return await new Promise((e=>setTimeout(e,s))),await this.sendXml(e,t-1)}if(0===A.body.length)throw new Error("Baichuan request failed (responseCode 400, empty body). Possible causes: camera sleeping/waking (battery), expired session, or invalid username/password.")}if(0===A.body.length)return"";return this.client.tryDecryptXml(A.body,A.header.channelId,this.client.enc)}catch(e){throw e}}async getTalkAbility(e){return function(e){const t=Bt(e,"TalkAbility")[0];if(!t)throw new Error("TalkAbility XML not found in response");return{duplexList:Bt(t,"duplexList").map((e=>H(e,"duplex"))).filter((e=>!!e)),audioStreamModeList:Bt(t,"audioStreamModeList").map((e=>H(e,"audioStreamMode"))).filter((e=>!!e)),audioConfigList:Bt(t,"audioConfig").map(yt).filter((e=>!!e))}}(await this.sendXml({cmdId:10,...void 0!==e?{channel:e}:{}}))}async createTalkSession(e=0,t){this.client.loggedIn||await this.client.login();const A=await this.getTalkAbility(e),s=A.audioConfigList.find((e=>"adpcm"===e.audioType.toLowerCase()))??A.audioConfigList[0];if(!s)throw new Error(`Talk not supported on channel ${e} (no audioConfig in TalkAbility)`);const r=A.duplexList[0]??"FDX",n=A.audioStreamModeList[0]??"followVideoStream",i={channel:e,duplex:r,audioStreamMode:n,audioConfig:s},o=Math.floor(s.lengthPerEncoder/2),a=o+4;if(o<=0||a<=4)throw new Error(`Invalid talk audio config: lengthPerEncoder=${s.lengthPerEncoder}`);const c=function(e){const t=e.audioConfig;return`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<TalkConfig version="1.1">\n<channelId>${e.channel}</channelId>\n<duplex>${M(e.duplex)}</duplex>\n<audioStreamMode>${M(e.audioStreamMode)}</audioStreamMode>\n<audioConfig>\n<audioType>${M(t.audioType)}</audioType>\n<sampleRate>${t.sampleRate}</sampleRate>\n<samplePrecision>${t.samplePrecision}</samplePrecision>\n<lengthPerEncoder>${t.lengthPerEncoder}</lengthPerEncoder>\n<soundTrack>${M(t.soundTrack)}</soundTrack>\n</audioConfig>\n</TalkConfig>\n</body>`}(i);await(async()=>{const t=await this.client.sendFrame({cmdId:201,channel:e,payloadXml:c,messageClass:B});if(422!==t.header.responseCode){if(200!==t.header.responseCode)throw new Error(`TalkConfig rejected (responseCode ${t.header.responseCode})`)}else{await this.client.sendFrame({cmdId:11,channel:e,payloadXml:"",messageClass:B});const t=await this.client.sendFrame({cmdId:201,channel:e,payloadXml:c,messageClass:B});if(200!==t.header.responseCode)throw new Error(`TalkConfig rejected after reset (responseCode ${t.header.responseCode})`)}})();const l={channel:e,audioConfig:s,blockSize:o,fullBlockSize:a};let h=Buffer.alloc(0),g=!1,d=!1,u=Date.now();const E=Math.max(1,Math.min(8,Math.floor(t?.blocksPerPayload??1))),I=async t=>{if(0===t.length)return;if(t.length>E)throw new Error(`Internal error: too many blocks in payload (${t.length})`);const A=[];let r=0;for(const e of t)A.push(St(e,o)),r+=Math.max(0,2*(e.length-4)+1);await this.client.sendBinaryPayloadNoReply({cmdId:202,channel:e,extensionXml:L(e),payload:Buffer.concat(A),messageClass:B});const n=r/s.sampleRate*1e3,i=Date.now();i>u?u=i+n:u+=n;const a=u-Date.now();a>0&&await Ct(a)},Q=async()=>{if(!d){d=!0;try{for(;;){if(!(h.length>=a)){if(g){if(h.length>0){const e=Buffer.alloc(a,255);h.copy(e,0),h=Buffer.alloc(0),await I([e])}break}break}{const e=[];for(;e.length<E&&h.length>=a;)e.push(h.subarray(0,a)),h=h.subarray(a);await I(e)}}}finally{d=!1}}};return{info:l,sendAudio:async e=>{if(g)throw new Error("Talk session is closed");0!==e.length&&(h=0===h.length?e:Buffer.concat([h,e]),await Q())},stop:async()=>{if(g)return;g=!0,await Q();const t=u-Date.now();t>0?await Ct(t+100):await Ct(100);const A=await this.client.sendFrame({cmdId:11,channel:e,payloadXml:"",messageClass:B});if(200!==A.header.responseCode)throw new Error(`TalkReset rejected (responseCode ${A.header.responseCode})`)}}}async sendBinary(e){return await this.client.login(),await this.client.sendBinary(e)}async getNetPort(){const e={},t=(await this.sendXml({cmdId:37})).matchAll(/<([A-Za-z]+)Port[^>]*>([\s\S]*?)<\/\1Port>/g);for(const A of t){const t=(A[1]??"").toLowerCase(),s=A[2]??"",r={};for(const e of s.matchAll(/<([A-Za-z]+)>(-?\d+)<\/\1>/g)){const t=(e[1]??"").toLowerCase(),A=Number(e[2]);Number.isFinite(A)&&(r[t]=A)}Object.keys(r).length&&(e[t]=r)}return e}async getPorts(){return this.getNetPort()}async setPortEnabled(e){const t=`${e.port[0].toUpperCase()}${e.port.slice(1)}Port`,A=`<?xml version="1.0" encoding="UTF-8" ?><body><${t} version="1.1"><enable>${e.enable?1:0}</enable></${t}></body>`;await this.sendXml({cmdId:36,payloadXml:A})}async getInfo(e){const t={cmdId:null==e?80:318};void 0!==e&&(t.channel=e);return function(e,t){const A={};for(const s of t){const t=H(e,s);void 0!==t&&(A[s]=t)}return A}(await this.sendXml(t),["type","hardwareVersion","firmwareVersion","itemNo","serialNumber","name"])}async getEncXml(e,t){const A=this.normalizeChannel(e);return await this.sendXml({cmdId:56,channel:A,...null!=t?.timeoutMs?{timeoutMs:t.timeoutMs}:{}})}async getStreamMetadata(e){const t=this.normalizeChannel(e),A=await this.getEncXml(t),s=[];let r=!0;const n=e=>e.width>0&&e.height>0&&(e.frameRate>0||e.bitRate>0),i={0:"H.264",1:"H.265",2:"MJPEG",3:"MPEG4"},o=A.match(/<mainStream[^>]*>([\s\S]*?)<\/mainStream>/);if(o){const e=o[1]??"",t=Number(H(e,"width")??"0"),A=Number(H(e,"height")??"0"),a=Number(H(e,"videoEncType")??"0"),c=Number(H(e,"frame")??"0"),l=Number(H(e,"bitRate")??"0"),h=Number(H(e,"audio")??"0"),g=H(e,"enable");(void 0===g||"1"===g||"true"===g)&&n({width:t,height:A,frameRate:c,bitRate:l})&&(s.push({profile:"main",audio:h,width:t,height:A,videoEncType:i[a]??`Unknown(${a})`,videoEncTypeInt:a,frameRate:c,bitRate:l}),r=r&&1===h)}const a=A.match(/<subStream[^>]*>([\s\S]*?)<\/subStream>/);if(a){const e=a[1]??"",t=Number(H(e,"width")??"0"),A=Number(H(e,"height")??"0"),o=Number(H(e,"videoEncType")??"0"),c=Number(H(e,"frame")??"0"),l=Number(H(e,"bitRate")??"0"),h=Number(H(e,"audio")??"0"),g=H(e,"enable");(void 0===g||"1"===g||"true"===g)&&n({width:t,height:A,frameRate:c,bitRate:l})&&(s.push({profile:"sub",audio:h,width:t,height:A,videoEncType:i[o]??`Unknown(${o})`,videoEncTypeInt:o,frameRate:c,bitRate:l}),r=r&&1===h)}const c=["extStream","thirdStream","externStream","extraStream"];for(const e of c){const t=A.match(new RegExp(`<${e}[^>]*>([\\s\\S]*?)<\\/${e}>`));if(!t)continue;const o=t[1]??"",a=Number(H(o,"width")??"0"),c=Number(H(o,"height")??"0"),l=Number(H(o,"videoEncType")??"0"),h=Number(H(o,"frame")??"0"),g=Number(H(o,"bitRate")??"0"),d=Number(H(o,"audio")??"0"),u=H(o,"enable");(void 0===u||"1"===u||"true"===u)&&n({width:a,height:c,frameRate:h,bitRate:g})&&(s.push({profile:"ext",audio:d,width:a,height:c,videoEncType:i[l]??`Unknown(${l})`,videoEncTypeInt:l,frameRate:h,bitRate:g}),r=r&&1===d);break}return{channel:t,streams:s,audioEnabled:r}}async setEncXml(e,t){const A="number"==typeof e?this.normalizeChannel(e):0,s="number"==typeof e?t:e;await this.sendXml({cmdId:57,channel:A,payloadXml:s})}async setStreamVideoCodec(e,t,A){const s="number"==typeof e?this.normalizeChannel(e):this.normalizeChannel(A),r="number"==typeof e?t:e,n="H.265"===("number"==typeof e?A:t)?1:0,i="main"===r?["mainStream"]:"sub"===r?["subStream"]:["extStream","thirdStream","externStream","extraStream"],o=await this.getEncXml(s);let a=null;for(const e of i){const t=new RegExp(`(<${e}[^>]*>[\\s\\S]*?<videoEncType>)(\\d+)(</videoEncType>)`);if(!t.test(o))continue;const A=o.replace(t,`$1${n}$3`);if(A!==o){a=A;break}}if(!a)throw new Error(`Could not find <videoEncType> for profile=${r} (tags=${i.join(",")}) in GetEnc XML (channel=${s}).`);await this.setEncXml(s,a)}async setNetPort(e){null!=e.onvifEnable&&await this.setPortEnabled({port:"onvif",enable:1===e.onvifEnable}),null!=e.rtmpEnable&&await this.setPortEnabled({port:"rtmp",enable:1===e.rtmpEnable}),null!=e.rtspEnable&&await this.setPortEnabled({port:"rtsp",enable:1===e.rtspEnable})}async reboot(e){const t={cmdId:23};void 0!==e&&(t.channel=e),await this.sendXml(t)}async ping(){await this.sendXml({cmdId:93})}async getGeneralXml(e){const t={cmdId:104};return void 0!==e&&(t.channel=e),await this.sendXml(t)}async setGeneralXml(e,t){const A="number"==typeof e||void 0===e?e:void 0,s="string"==typeof e?e:t;await this.sendXml({cmdId:105,...void 0===A?{}:{channel:A},payloadXml:s})}static buildChannelExtensionXml(e){return`<?xml version="1.0" encoding="UTF-8" ?><Extension version="1.1"><channelId>${M(String(e))}</channelId></Extension>`}async getMotionState(e){const t=H(await this.sendXml({cmdId:46,...void 0!==e?{channel:e}:{}}),"enable");return"1"===t||"true"===t}async getOsd(e){const t=this.normalizeChannel(e),A=await this.sendXml({cmdId:26,channel:t});return{channel:t,osdChannel:{enable:Number(H(A,"enable")??"0"),name:H(A,"name")??"",pos:H(A,"pos")??""},osdTime:{enable:Number(H(A,"timeEnable")??"0"),pos:H(A,"timePos")??""},watermark:Number(H(A,"watermark")??"0")}}async setOsd(e,t){const A="number"==typeof e?this.normalizeChannel(e):this.normalizeChannel(t),s="number"==typeof e?t:e,r=`<?xml version="1.0" encoding="UTF-8" ?><body><Osd version="1.1"><channel>${A}</channel><osdChannel><enable>${s.osdChannel.enable}</enable><name>${M(s.osdChannel.name)}</name><pos>${M(s.osdChannel.pos)}</pos></osdChannel><osdTime><enable>${s.osdTime.enable}</enable><pos>${M(s.osdTime.pos)}</pos></osdTime><watermark>${s.watermark}</watermark></Osd></body>`;await this.sendXml({cmdId:25,channel:A,payloadXml:r})}async getAiState(e){const t=await this.sendXml({cmdId:342,...void 0!==e?{channel:e}:{}});return{channel:e??0,alarm_state:Number(H(t,"alarm_state")??"0"),support:Number(H(t,"support")??"0")}}async getSnapshot(e=0){const t=`<body><Snap version="1.1"><channelId>${e}</channelId><logicChannel>${e}</logicChannel><time>0</time><fullFrame>0</fullFrame><streamType>main</streamType></Snap></body>`;return await this.client.login(),await this.client.sendBinary({cmdId:109,channel:e,payloadXml:t,extensionXml:U(e),timeoutMs:15e3})}async listRecordings(e){await this.client.login();const t=this.normalizeChannel(e.channel),A=e.uid,s=e.streamType??"mainStream",r=e.recordType??"manual, sched, io, md, people, face, vehicle, dog_cat, visitor, other, package",n=e.maxIterations??50,i=e.fallbackToAlarmVideo??!0,o=`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<FileInfoList version="1.1">\n<FileInfo>\n<uid>${M(A)}</uid>\n<searchAITrack>1</searchAITrack>\n<channelId>${t}</channelId>\n<logicChnBitmap>255</logicChnBitmap>\n<streamType>${M(s)}</streamType>\n<recordType>${M(r)}</recordType>\n${ft("startTime",e.start)}\n${ft("endTime",e.end)}\n</FileInfo>\n</FileInfoList>\n</body>`,a=H(await this.sendXml({cmdId:14,channel:t,payloadXml:o}),"handle");if(!a)throw new Error("FileInfoList open did not return <handle>");const c=Number.parseInt(a,10);if(!Number.isFinite(c))throw new Error(`FileInfoList open returned invalid handle: ${a}`);const l=`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<FileInfoList version="1.1">\n<FileInfo>\n<channelId>${t}</channelId>\n<uid>${M(A)}</uid>\n<searchAITrack>1</searchAITrack>\n<handle>${c}</handle>\n</FileInfo>\n</FileInfoList>\n</body>`,h=[];try{let e=!1;for(let A=0;A<n&&!e;A++){const A=await this.sendXml({cmdId:15,channel:t,payloadXml:l});h.push(...mt(A));const s=H(A,"bFinished")??H(A,"finished");e=null==s||"1"===s.trim()}}finally{try{await this.sendXml({cmdId:16,channel:t,payloadXml:l})}catch{}}const g=new Set,d=h.filter((e=>!g.has(e.fileName)&&(g.add(e.fileName),!0)));if(d.length>0||!i)return d;const u=A.split("_")[0]??A,E="subStream"===s?1:0,I=e=>`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<findAlarmVideo version="1.1">\n<channelId>${t}</channelId>\n<fileHandle>${M(e)}</fileHandle>\n</findAlarmVideo>\n</body>`,Q=[];let C=e.start;for(let A=0;A<n;A++){const A=await this.sendXml({cmdId:272,channel:t,payloadXml:(B=C,p=e.end,`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<findAlarmVideo version="1.1">\n<channelId>${t}</channelId>\n<uid>${M(u)}</uid>\n<logicChnBitmap>255</logicChnBitmap>\n<streamType>${E}</streamType>\n<notSearchVideo>0</notSearchVideo>\n${ft("startTime",B)}\n${ft("endTime",p)}\n<alarmType>md, pir, io, people, face, vehicle, dog_cat, visitor, other, package, cry, crossline, intrusion, loitering, legacy, loss</alarmType>\n</findAlarmVideo>\n</body>`)}),s=H(A,"fileHandle")?.trim();if(!s)break;const r=I(s);try{const e=await this.sendXml({cmdId:273,channel:t,payloadXml:r}),A=mt(e);Q.push(...A);const s=H(e,"bFinished")?.trim();if("1"===s)break;const n=[...A].reverse().find((e=>null!=e.startTime));if(!n?.startTime)break;C=n.startTime}finally{try{await this.sendXml({cmdId:274,channel:t,payloadXml:r})}catch{}}}var B,p;const f=new Set;return Q.filter((e=>!f.has(e.fileName)&&(f.add(e.fileName),!0)))}async listRecordingFileNames(e){return(await this.listRecordings(e)).map((e=>e.fileName))}async getVodRtmpUrl(e){await this.client.login();const t=this.normalizeChannel(e.channel),A=e.streamType??"mainStream",s=e.ensureEnabled??!0;let r=e.rtmpPort;try{const e=(await this.getNetPort()).rtmp,t="number"==typeof e?.enable?e.enable:void 0,A="number"==typeof e?.port?e.port:void 0;null==r&&null!=A&&Number.isFinite(A)&&A>0&&(r=A),s&&0===t&&await this.setPortEnabled({port:"rtmp",enable:!0})}catch{}null==r&&(r=1935);const n="subStream"===A?1:0;let i=e.fileName.trim();const o=i.indexOf("Mp4Record/");o>=0&&(i=i.slice(o)),i=i.replace(/^\/+/,"");const a=i.replace(/\//g,"%20").replace(/ /g,"%20"),c=encodeURIComponent(this.username),l=encodeURIComponent(this.password);return`rtmp://${this.host}:${r}/vod/${a}?channel=${t}&stream=${n}&user=${c}&password=${l}`}async predownloadRecordingMp4(e){await this.client.login();const t=this.normalizeChannel(e.channel),A=e.streamType??"mainStream",s=e.ensureAwake??!1,r=e.ffmpegPath??"ffmpeg",n=e.overwrite??!0;await(0,g.mkdir)((0,c.dirname)(e.outputPath),{recursive:!0});const i=async()=>{s&&await this.wakeUp(t,{waitAfterWakeMs:1500,attempts:3});const i=await this.getVodRtmpUrl({channel:t,fileName:e.fileName,streamType:A,ensureEnabled:!0});await new Promise(((t,A)=>{const s=(0,h.spawn)(r,["-hide_banner","-loglevel","error",...n?["-y"]:[],"-rtmp_live","live","-i",i,"-c","copy","-movflags","frag_keyframe+empty_moov","-f","mp4",e.outputPath]);let o="";s.stderr.on("data",(e=>{o+=String(e)})),s.on("close",(e=>{if(0===e)return t();A(new Error(`ffmpeg exited with code ${e}\n${o}`))})),s.on("error",A)}))};try{await i()}catch(e){if(s)try{await this.wakeUp(t,{waitAfterWakeMs:3e3,attempts:3,reconnect:!0})}catch{}await i()}}async generateMp4Screenshot(e){const t=e.ffmpegPath??"ffmpeg",A=Number.isFinite(e.atSeconds)&&e.atSeconds>=0?e.atSeconds:0;await(0,g.mkdir)((0,c.dirname)(e.outputPath),{recursive:!0}),await new Promise(((s,r)=>{const n=(0,h.spawn)(t,["-hide_banner","-loglevel","error","-y","-ss",String(A),"-i",e.inputPath,"-frames:v","1","-q:v","2",e.outputPath]);let i="";n.stderr.on("data",(e=>{i+=String(e)})),n.on("close",(e=>{if(0===e)return s();r(new Error(`ffmpeg screenshot exited with code ${e}\n${i}`))})),n.on("error",r)}))}async downloadRecording(e){await this.client.login();const t=this.normalizeChannel(e.channel),A=e.uid,s=e.fileName,r=s.includes("/")?s.split("/").filter(Boolean).at(-1)??s:s,n=`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<FileInfoList version="1.1">\n<FileInfo>\n<channelId>${t}</channelId>\n<uid>${M(A)}</uid>\n<fileName>${M(s)}</fileName>\n<name>${M(r)}</name>\n<Id>${M(s)}</Id>\n</FileInfo>\n</FileInfoList>\n</body>`,i=e.fallbackToHttp??!1;try{return await this.client.sendBinary({cmdId:13,channel:t,messageClass:p,extensionXml:L(t),payloadXml:n,timeoutMs:e.timeoutMs??12e4})}catch(e){if(!i)throw e;const t=s.replaceAll("/","_").replaceAll("\\","_");try{const e=/Rec(\w{3})(?:_|_DST)(\d{8})_(\d{6})_.*/.exec(s),A=e?`${e[2]}${e[3]}`:void 0,r=[],n=e=>{const t=e?.trim();t&&(r.includes(t)||r.push(t))};let i;n(s),n(s.replace(/^\/mnt\/[a-zA-Z0-9]+\//,"")),n(s.replace(/^\//,""));for(const e of r)try{return await this.httpClient.downloadVod(e,t,A)}catch(e){i=e;if((e instanceof Error?e.message:String(e)).startsWith("HTTP 404"))continue;throw e}throw i instanceof Error?i:new Error(String(i))}catch(t){const A=e instanceof Error?e.message:String(e),s=t instanceof Error?t.message:String(t);throw new Error(`downloadRecording failed (baichuan then http). baichuanErr=${A}; httpErr=${s}`)}}}async subscribeEvents(){await this.client.login();const e=this.client.getConfiguredChannel?.()??0,t=e+1,A=[{label:`neolink-style channelId=${e} bodyLen=0`,params:{cmdId:31,channelIdOverride:e,messageClass:B}},{label:`reolink_aio-style channelId=${t} bodyLen=0`,params:{cmdId:31,channelIdOverride:t,messageClass:B}},{label:"host channelId=250 bodyLen=0",params:{cmdId:31,channelIdOverride:250,messageClass:B}},{label:"legacy Extension channelId=251",params:{cmdId:31,channelIdOverride:250,messageClass:B,extensionXml:'<?xml version="1.0" encoding="UTF-8" ?><Extension version="1.1"><channelId>251</channelId></Extension>'}}];let s;for(const e of A){const t=await this.client.sendFrame({...e.params,timeoutMs:1e4});if(s=t.header.responseCode,200===t.header.responseCode)return this.client.subscribed=!0,void this.client.refreshKeepAlive?.();(this.logger.debug??this.logger.log).call(this.logger,`[ReolinkBaichuanApi] subscribeEvents rejected (${e.label}) responseCode=${t.header.responseCode}`)}throw this.client.subscribed=!1,this.client.refreshKeepAlive?.(),new Error(`subscribeEvents failed: camera rejected cmdId=31 (last responseCode=${s??"unknown"})`)}async unsubscribeEvents(){this.client.subscribed=!1,this.client.refreshKeepAlive?.()}async checkAndDispatchCurrentState(e=0){try{const t=await this.getMotionState(e);if(t!==this.lastMotionState&&(this.lastMotionState=t,t)){const t={type:"motion",channel:e,timestamp:Date.now()};this.dispatchSimpleEvent(t)}try{const t=await this.getAiState(e);if(t&&void 0!==t.alarm_state){if((!this.lastAiState||this.lastAiState.alarm_state!==t.alarm_state||this.lastAiState.support!==t.support)&&(this.lastAiState=t,1===t.alarm_state)){const t={type:"other",channel:e,timestamp:Date.now()};this.dispatchSimpleEvent(t)}}}catch(e){if(e&&"object"==typeof e&&"message"in e){const t=String(e.message);t.includes("not supported")||t.includes("unsupported")||(this.logger.debug??this.logger.log)?.call(this.logger,"[ReolinkBaichuanApi] getAiState failed (may not be supported)",e)}}}catch(e){(this.logger.warn??this.logger.error)?.call(this.logger,"[ReolinkBaichuanApi] Error checking current state",e)}}dispatchSimpleEvent(e){for(const t of this.simpleEventListeners)try{t(e)}catch(e){(this.logger.warn??this.logger.error)?.call(this.logger,"[ReolinkBaichuanApi] onSimpleEvent handler error",e)}}startStatePolling(){if(0===this.simpleEventListeners.size)return;"udp"===this.client.getTransport?.()||this.statePollingInterval||(this.statePollingInterval=setInterval((async()=>{0!==this.simpleEventListeners.size?await this.checkAndDispatchCurrentState(0):this.stopStatePolling()}),5e3))}stopStatePolling(){this.statePollingInterval&&(clearInterval(this.statePollingInterval),this.statePollingInterval=void 0)}async getEvents(e){const t=await this.sendXml({cmdId:33,...void 0!==e?{channel:e}:{}}),A=this.normalizeChannel(e),s=Date.now(),r={channel:A};if(t.includes("<AlarmEventList")){const e=t.matchAll(/<AlarmEvent\b[^>]*>([\s\S]*?)<\/AlarmEvent>/g);for(const t of e){const e=t[1]??"",n=H(e,"channelId");if((void 0!==n?Number(n):A)!==A)continue;const i=(H(e,"status")??"").trim().toUpperCase(),o=(H(e,"AItype")??H(e,"aiType")??H(e,"aitype")??"").trim();i.includes("MD")&&(r.motion={state:1,timestamp:s,source:"md"}),i.includes("PIR")&&(r.motion={state:1,timestamp:s,source:"pir"});const a=o?o.split(",").map((e=>e.trim())).find((e=>e.length>0&&"none"!==e.toLowerCase())):void 0;(a||i.includes("AI"))&&(r.ai={channel:A,alarm_state:1,type:a}),i.includes("VIS")&&(r.visitor={detected:!0,timestamp:s})}return r}const n=(H(t,"status")??"").trim().toUpperCase(),i=(H(t,"AItype")??H(t,"aiType")??H(t,"aitype")??"").trim();return n.includes("MD")&&(r.motion={state:1,timestamp:s,source:"md"}),n.includes("PIR")&&(r.motion={state:1,timestamp:s,source:"pir"}),(i||n.includes("AI"))&&(r.ai={channel:A,alarm_state:1,type:i||void 0}),n.includes("VIS")&&(r.visitor={detected:!0,timestamp:s}),r}async getTwoWayAudioConfig(e){const t=H(await this.sendXml({cmdId:10,...void 0!==e?{channel:e}:{}}),"audioStreamMode"),A={channel:e??0,enabled:"mixAudioStream"===t||"followVideoStream"===t};return t&&(A.mode=t),A}async startTwoWayAudio(e){await this.sendXml({cmdId:10,...void 0!==e?{channel:e}:{}})}async sendAudioData(e,t){const A={cmdId:10,payloadXml:""};void 0!==t&&(A.channel=t),await this.client.sendBinary(A)}async stopTwoWayAudio(e){}async startVideoStream(e,t="sub"){const A=this.normalizeChannel(e),s=A,r={main:{handle:0,streamType:0,streamName:"mainStream"},sub:{handle:256,streamType:1,streamName:"subStream"},ext:{handle:1024,streamType:0,streamName:"externStream"}}[t];if(!r)throw new Error(`Invalid stream profile: ${t}`);if(!r.streamName)throw new Error(`Stream name not found for profile: ${t}, config: ${JSON.stringify(r)}`);const n=r.streamName;if("string"!=typeof n)throw new Error(`streamName is not a string: ${typeof n}, value: ${n}, config: ${JSON.stringify(r)}`);const i=function(e,t,A){if(!t||"string"!=typeof t)throw new Error(`buildPreviewXml: streamType is required (string) but got: ${typeof t} = ${t}`);return`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<Preview version="1.0">\n${void 0!==A?`<channelId>${A}</channelId>\n`:""}<handle>${e}</handle>\n<streamType>${M(t)}</streamType>\n</Preview>\n</body>`}(r.handle,n,s),o="udp"===this.client.getTransport?.()?3:1;let a;for(let e=1;e<=o;e++){const n=this.client.peekNextMsgNum();this.client.subscribeVideoStream(3,n);try{const e={cmdId:3,channel:A,channelIdOverride:s,extensionXml:U(s),payloadXml:i,messageClass:B,streamType:r.streamType},n=await this.client.sendFrame(e);if(200!==n.header.responseCode)throw new Error(`Video stream request rejected (response_code ${n.header.responseCode}). Neolink expects response_code 200, camera returned ${n.header.responseCode}`);return void this.activeVideoMsgNums.set(`${A}:${t}`,n.header.msgNum)}catch(t){a=t;try{this.client.unsubscribeVideoStream(3,n)}catch{}if(e<o){await new Promise((e=>setTimeout(e,250)));continue}}}throw a instanceof Error?a:new Error(String(a))}getActiveVideoMsgNum(e,t="sub"){const A=this.normalizeChannel(e);return this.activeVideoMsgNums.get(`${A}:${t}`)}async stopVideoStream(e,t="sub"){const A=this.normalizeChannel(e),s=A,r={main:{handle:0,streamType:0},sub:{handle:256,streamType:1},ext:{handle:1024,streamType:0}}[t],n=function(e,t){return`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<Preview version="1.0">\n${void 0!==t?`<channelId>${t}</channelId>\n`:""}<handle>${e}</handle>\n</Preview>\n</body>`}(r.handle,s),i=`${A}:${t}`,o=this.activeVideoMsgNums.get(i);this.activeVideoMsgNums.delete(i);try{await this.client.sendFrame({cmdId:4,channel:A,channelIdOverride:s,extensionXml:U(s),payloadXml:n,messageClass:B,streamType:r.streamType,...void 0!==o?{msgNumOverride:o}:{},timeoutMs:2e3})}catch{}finally{try{void 0!==o&&this.client.unsubscribeVideoStream(3,o)}catch{}}}async getPtzPresets(e){const t=this.normalizeChannel(e),A=t,s=await this.sendXml({cmdId:190,channel:t,channelIdOverride:A,extensionXml:U(A),messageClass:B,streamType:0});return this.parsePtzPresetList(s).filter((e=>void 0===e.enable||"1"===e.enable)).filter((e=>void 0===e.name||""!==String(e.name).trim())).map((e=>({id:e.id,name:e.name??`Preset ${e.id}`})))}parsePtzPresetList(e){const t=[],A=e.matchAll(/<preset\b[^>]*>([\s\S]*?)<\/preset>/gi);for(const e of A){const A=e[1]??"",s=/<id>([^<]*)<\/id>/i.exec(A)?.[1];if(!s)continue;const r=Number(s);if(!Number.isFinite(r))continue;const n=/<name>([^<]*)<\/name>/i.exec(A),i=/<enable>([^<]*)<\/enable>/i.exec(A),o={id:r},a=n?.[1],c=i?.[1];void 0!==a&&(o.name=a),void 0!==c&&(o.enable=c),t.push(o)}return t}async getPtzPresetsRaw(e){const t=this.normalizeChannel(e),A=t,s=await this.sendXml({cmdId:190,channel:t,channelIdOverride:A,extensionXml:U(A),messageClass:B,streamType:0});return this.parsePtzPresetList(s)}async ptz(e,t){const A="number"==typeof e?this.normalizeChannel(e):0,s="number"==typeof e?t:e,r=A;let n,i;if("stop"===s.action)n="stop";else{const e={Left:"left",Right:"right",Up:"up",Down:"down"}[s.command];if(!e)throw new Error(`Unsupported PTZ command for MSG_ID_PTZ_CONTROL: ${s.command}`);n=e}if("stop"===n)i=0;else{const e=s.speed;i=void 0===e?32:e>0&&e<=1?Math.max(1,64*e):e}const o=function(e,t,A){return`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<PtzControl version="1.1">\n<channelId>${e}</channelId>\n<command>${M(t)}</command>\n<speed>${A}</speed>\n</PtzControl>\n</body>`}(r,n,i),a=U(r),c=await this.client.sendFrame({cmdId:18,channel:A,channelIdOverride:r,extensionXml:a,payloadXml:o,messageClass:B,streamType:0});if(200!==c.header.responseCode){let e="";if(c.body.length>0)try{const t=this.client.tryDecryptXml;if(t){const A=t.call(this.client,c.body,c.header.channelId,this.client.enc);A&&(e=` - Error details: ${A.substring(0,200)}`)}}catch{}throw new Error(`PTZ control rejected (response_code ${c.header.responseCode})${e}`)}if("start"===s.action&&"stop"!==n){const e=s.autoStopMs??500;e>0&&setTimeout((()=>{this.ptz(A,{action:"stop",command:s.command}).catch((()=>{}))}),e)}}async moveToPtzPreset(e,t){const A=void 0===t?this.normalizeChannel(void 0):this.normalizeChannel(e),s=A,r=function(e,t,A,s){return x(e,t,A,void 0===s?void 0:{name:s})}(s,void 0===t?e:t,"toPos"),n=U(s),i=await this.client.sendFrame({cmdId:19,channel:A,channelIdOverride:s,extensionXml:n,payloadXml:r,messageClass:B,streamType:0});if(200!==i.header.responseCode)throw new Error(`PTZ preset move rejected (response_code ${i.header.responseCode})`)}async setPtzPreset(e,t,A){const s="string"==typeof t?this.normalizeChannel(A):this.normalizeChannel(e),r=s,n=x(r,"string"==typeof t?e:t,"setPos",{name:"string"==typeof t?t:A,enable:1}),i=U(r),o=await this.client.sendFrame({cmdId:19,channel:s,channelIdOverride:r,extensionXml:i,payloadXml:n,messageClass:B,streamType:0});if(200!==o.header.responseCode)throw new Error(`PTZ preset save rejected (response_code ${o.header.responseCode})`)}async deletePtzPreset(e,t){const A=void 0===t?this.normalizeChannel(void 0):this.normalizeChannel(e),s=void 0===t?e:t,r=A,n=U(r);let i;try{const e=await this.getPtzPresetsRaw(A);i=e.find((e=>e.id===s))?.name}catch{}const o=[{label:"command=delPos",payloadXml:x(r,s,"delPos")},{label:"enable=0 (no name)",payloadXml:x(r,s,"setPos",{enable:0})},{label:"name='' (no enable)",payloadXml:x(r,s,"setPos",{name:""})},{label:"enable=0 name=''",payloadXml:x(r,s,"setPos",{name:"",enable:0})},...i?[{label:"enable=0 name=current",payloadXml:x(r,s,"setPos",{name:i,enable:0})}]:[],{label:"enable=0 name='Preset N'",payloadXml:x(r,s,"setPos",{name:`Preset ${s}`,enable:0})}];let a,c=!1;for(const e of o)try{const t=await this.client.sendFrame({cmdId:19,channel:A,channelIdOverride:r,extensionXml:n,payloadXml:e.payloadXml,messageClass:B,streamType:0});if(200!==t.header.responseCode)throw new Error(`PTZ preset delete rejected (response_code ${t.header.responseCode})`);c=!0;try{const e=(await this.getPtzPresetsRaw(A)).find((e=>e.id===s));if(!e)return;const t=void 0!==e.name&&""===String(e.name).trim(),r=void 0!==e.enable&&"0"===String(e.enable).trim();if(t||r)return}catch(e){a=e}}catch(e){a=e}if(!c)throw a instanceof Error?a:new Error("PTZ preset delete failed");this.logger.warn("PTZ presets (baichuan): deletePtzPreset did not take effect (firmware ignored request)",{channel:A,channelId:r,presetId:s})}async getPtzPosition(e){const t=this.normalizeChannel(e),A=await this.sendXml({cmdId:433,channel:t}),s=H(A,"pPos"),r=H(A,"tPos"),n={};return void 0!==s&&(n.pan=Number(s)),void 0!==r&&(n.tilt=Number(r)),n}async getZoomFocus(e){const t=this.normalizeChannel(e),A=t,s=await this.sendXml({cmdId:294,channel:t,channelIdOverride:A,extensionXml:U(A),messageClass:B,streamType:0}),r=e=>{const t=new RegExp(`<${e}>([\\s\\S]*?)</${e}>`).exec(s),A=t?.[1];if(!A)return;const r=H(A,"maxPos"),n=H(A,"minPos"),i=H(A,"curPos");return void 0!==r&&void 0!==n&&void 0!==i?{maxPos:Number(r),minPos:Number(n),curPos:Number(i)}:void 0},n={},i=r("zoom"),o=r("focus");return i&&(n.zoom=i),o&&(n.focus=o),n}async zoomToFactor(e,t){const A=void 0===t?0:this.normalizeChannel(e),s=void 0===t?e:t,r=A,n=(await this.getZoomFocus(A)).zoom;if(!n)throw new Error("Camera did not return <zoom> info (zoom may be unsupported)");const i=Math.round(1e3*s),o=function(e,t){return`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<StartZoomFocus version="1.1">\n<channelId>${e}</channelId>\n<command>zoomPos</command>\n<movePos>${Math.trunc(t)}</movePos>\n</StartZoomFocus>\n</body>`}(r,Math.min(n.maxPos,Math.max(n.minPos,i))),a=U(r),c=await this.client.sendFrame({cmdId:295,channel:A,channelIdOverride:r,extensionXml:a,payloadXml:o,messageClass:B,streamType:0});if(200!==c.header.responseCode)throw new Error(`Zoom rejected (response_code ${c.header.responseCode})`)}parseBatteryInfoXml(e,t){const A=e=>{if(void 0===e)return;const t=Number(e);return Number.isFinite(t)?t:void 0},s=Bt(e,"BatteryInfo"),r=s.find((e=>H(e,"channelId")===String(t)))??s[0]??e,n={},i=A(H(r,"batteryPercent"));void 0!==i&&(n.batteryPercent=i);const o=H(r,"chargeStatus");void 0!==o&&(n.chargeStatus=o);const a=H(r,"adapterStatus");void 0!==a&&(n.adapterStatus=a);const c=A(H(r,"voltage"));void 0!==c&&(n.voltage=c);const l=A(H(r,"current"));void 0!==l&&(n.current=l);const h=A(H(r,"temperature"));void 0!==h&&(n.temperature=h);const g=A(H(r,"lowPower"));void 0!==g&&(n.lowPower=g);const d=A(H(r,"batteryVersion"));return void 0!==d&&(n.batteryVersion=d),n}getSleepStatus(e){const t=e?.windowMs??e?.idleMs??1e4,A=new Set(e?.nonWakingCmdIds??e?.ignoreCmdIds??[y,252,m,291]),s=this.client.getTransport?.();if("udp"!==s)return{state:"unknown",reason:"sleep inference supported only for UDP/battery"};if(this.activeVideoMsgNums.size>0||this.rtspServers.size>0||this.client.isDeviceStreamingActive?.())return{state:"awake",reason:"active streaming"};const r=this.client.isSocketConnected?.()??!1,n=Date.now(),i=n-t,o=(this.client.getRxHistory?.()??[]).filter((e=>e.atMs>=i)),a=(this.client.getTxHistory?.()??[]).filter((e=>e.atMs>=i));if(0===o.length&&0===a.length)return{state:"sleeping",reason:`no rx/tx activity in last ${t}ms${r?"":" (socket disconnected)"}`,idleMs:t};const c=o.find((e=>!A.has(e.cmdId)));if(c)return{state:"awake",reason:`waking rx cmdId=${c.cmdId} responseCode=${c.responseCode} seen ${n-c.atMs}ms ago`,lastRxAtMs:c.atMs,idleMs:n-c.atMs};const l=a.find((e=>!A.has(e.cmdId)));return l?{state:"awake",reason:`waking tx cmdId=${l.cmdId} seen ${n-l.atMs}ms ago`,idleMs:n-l.atMs}:{state:"sleeping",reason:`only non-waking cmdIds observed in last ${t}ms (non-waking: ${Array.from(A).join(",")})`,idleMs:t}}async probeSleepStatus(e){const t=this.client.getTransport?.();if("udp"!==t)return{state:"unknown",reason:"sleep probe supported only for UDP/battery"};if(this.activeVideoMsgNums.size>0||this.rtspServers.size>0||this.client.isDeviceStreamingActive?.())return{state:"awake",reason:"active streaming"};const A=Date.now(),s=e?.minIntervalMs??5e3;if(this.lastSleepProbe&&A-this.lastSleepProbe.atMs<s)return{...this.lastSleepProbe.status,reason:`${this.lastSleepProbe.status.reason} (cached)`};if(!this.client.isSocketConnected()){const e={state:"unknown",reason:"udp socket not connected"};return this.lastSleepProbe={atMs:A,status:e},e}if(!this.client.loggedIn){const e={state:"unknown",reason:"not logged in"};return this.lastSleepProbe={atMs:A,status:e},e}const r=this.normalizeChannel(e?.channel),n=e?.timeoutMs??700,i=Math.max(1,e?.attempts??1),o=e?.cmdId??m;for(let e=0;e<i;e++)try{const e=await this.client.sendFrame({cmdId:o,channel:r,timeoutMs:n}),t={state:200===e.header.responseCode?"awake":"unknown",reason:`probe cmdId=${o} responseCode=${e.header.responseCode}`};return this.lastSleepProbe={atMs:Date.now(),status:t},t}catch(t){const A=t instanceof Error?t.message:String(t);if(A.includes("Baichuan timeout")||A.toLowerCase().includes("timeout")){const e={state:"sleeping",reason:`probe timeout cmdId=${o} timeoutMs=${n}`};return this.lastSleepProbe={atMs:Date.now(),status:e},e}if(e===i-1){const e={state:"unknown",reason:`probe error cmdId=${o}: ${A}`};return this.lastSleepProbe={atMs:Date.now(),status:e},e}}const a={state:"unknown",reason:"probe exhausted"};return this.lastSleepProbe={atMs:Date.now(),status:a},a}async getBatteryStatus(e){const t=this.normalizeChannel(e);if("sleeping"===this.getSleepStatus({channel:t}).state)return{channel:t,sleeping:!0};try{const e=await Promise.race([this.sendXml({cmdId:m,channel:t}),new Promise(((e,t)=>setTimeout((()=>t(new Error("Timeout"))),5e3)))]),A={channel:t,sleeping:!1};return Object.assign(A,this.parseBatteryInfoXml(e,t)),A}catch(e){const A={channel:t};return"sleeping"===this.getSleepStatus({channel:t}).state&&(A.sleeping=!0),e instanceof Error&&"Timeout"===e.message&&null==A.sleeping&&(A.sleeping=!0),A}}async getBatteryInfo(e){const t=this.normalizeChannel(e),A=this.client.getTransport?.();if(!("udp"!==A||this.client.isSocketConnected?.()&&this.client.loggedIn))return{channel:t,sleeping:!0};const s=await this.client.sendXml({cmdId:m,channel:t}),r={channel:t};return Object.assign(r,this.parseBatteryInfoXml(s,t)),r}async wakeUp(e,t){const A=this.normalizeChannel(e),s="number"==typeof t?{waitAfterWakeMs:t}:t??{},r=s.timeoutMs??2e4,n=s.attempts??3,i=s.waitAfterWakeMs??1500,o=s.backoffMs??1500,a="udp"===this.client.getTransport?.(),c=s.reconnect??a;let l;for(let e=1;e<=n;e++)try{return await this.getEncXml(A,{timeoutMs:r}),void(i>0&&await new Promise((e=>setTimeout(e,i))))}catch(t){l=t;const A=t instanceof Error?t.message:String(t),s=A.includes("Baichuan timeout"),r=A.toLowerCase().includes("socket closed")||A.toLowerCase().includes("stream closed");if(e<n){if(c&&(s||r))try{this.client.loggedIn=!1,await this.client.close()}catch{}o>0&&await new Promise((e=>setTimeout(e,o)));continue}}throw l instanceof Error?l:new Error(String(l))}async isSleeping(e){const t=this.normalizeChannel(e);try{return await Promise.race([this.getBatteryInfo(t),new Promise(((e,t)=>setTimeout((()=>t(new Error("Timeout"))),5e3)))]),!1}catch(e){return!0}}async getPirInfo(e){const t=this.normalizeChannel(e),A=await this.sendXml({cmdId:212,channel:t}),s=e=>{if(void 0===e)return;const t=e.trim().toLowerCase();if("true"===t)return 1;if("false"===t)return 0;const A=Number(t);return Number.isFinite(A)?A:void 0},r=H(A,"enable"),n=H(A,"sensiValue"),i=H(A,"reduceFalseAlarm"),o=H(A,"interval"),a=H(A,"intervalSecMax"),c={channel:t};if(void 0!==r){const e=s(r);void 0!==e&&(c.enable=e)}if(void 0!==n&&(c.sensitive=Number(n)),void 0!==i){const e=s(i);void 0!==e&&(c.reduceAlarm=e)}if(void 0!==o){const e=s(o);void 0!==e&&(c.interval=e)}if(void 0!==a){const e=s(a);void 0!==e&&(c.intervalMax=e)}return{enabled:(e=>{if(void 0===e)return!1;const t=e.trim().toLowerCase();return"1"===t||"true"===t})(r),state:c}}async setPirInfo(e,t){const A="number"==typeof e?e:t,s="number"==typeof e?t:e,r=this.normalizeChannel(A);let n=await this.sendXml({cmdId:212,channel:r});if(void 0!==s.enable&&(n=n.replace(/<enable>[^<]*<\/enable>/,`<enable>${s.enable}</enable>`)),void 0!==s.sensitive){const e=(i=s.sensitive,Math.trunc(101-i));n=n.replace(/<sensiValue>[^<]*<\/sensiValue>/,`<sensiValue>${e}</sensiValue>`)}var i;if(void 0!==s.reduceAlarm){const e=(e=>{if(null==e)return;if("boolean"==typeof e)return e?1:0;const t=Number(e);return Number.isFinite(t)?t:void 0})(s.reduceAlarm);void 0!==e&&(n=n.replace(/<reduceFalseAlarm>[^<]*<\/reduceFalseAlarm>/,`<reduceFalseAlarm>${e}</reduceFalseAlarm>`))}void 0!==s.interval&&(n=n.replace(/<interval>[^<]*<\/interval>/,`<interval>${s.interval}</interval>`)),await this.sendXml({cmdId:213,channel:r,payloadXml:n})}async setMotionDetection(e,t,A){const s="number"==typeof e?e:A,r="number"==typeof e?t:e,n="number"==typeof e?A:t,i=this.normalizeChannel(s);let o=await this.sendXml({cmdId:46,channel:i});void 0!==r&&(o=o.replace(/<enable>[^<]*<\/enable>/,`<enable>${r?"1":"0"}</enable>`)),void 0!==n&&(o=o.replace(/<sensitivityDefault>[^<]*<\/sensitivityDefault>/,`<sensitivityDefault>${n}</sensitivityDefault>`)),await this.sendXml({cmdId:47,channel:i,payloadXml:o})}async setAiDetection(e,t,A,s){const r="number"==typeof e?e:s,n="number"==typeof e?t:e,i="number"==typeof e?A:t,o="number"==typeof e?s:A,a=this.normalizeChannel(r),c=`<?xml version="1.0" encoding="UTF-8" ?>\n <body>\n <AiDetectCfg version="1.1">\n <chn>${a}</chn>\n <type>${M(n)}</type>\n </AiDetectCfg>\n </body>`;let l=await this.sendXml({cmdId:342,channel:a,payloadXml:c});void 0!==i&&(l=l.replace(/<sensitivity>[^<]*<\/sensitivity>/,`<sensitivity>${i}</sensitivity>`)),void 0!==o&&(l=l.replace(/<stayTime>[^<]*<\/stayTime>/,`<stayTime>${o}</stayTime>`)),await this.sendXml({cmdId:343,channel:a,payloadXml:l})}async getSiren(e){try{const t=await this.sendXml({cmdId:547,...void 0!==e?{channel:e}:{}});return{enabled:"1"===H(t,"status")}}catch{return{enabled:!1}}}async setSiren(e,t,A){const s="boolean"==typeof e?A??0:e,r="boolean"==typeof e?e:t,n="boolean"==typeof e?t:A,i=void 0!==s?s+1:void 0;let o;if(void 0!==n)o=P(i,n);else{o=Y(i,r?1:0)}try{await this.sendXml({cmdId:263,...void 0!==s?{channel:s}:{},payloadXml:o})}catch(e){if(!0!==r||void 0!==n)throw e;o=P(i,2),await this.sendXml({cmdId:263,...void 0!==s?{channel:s}:{},payloadXml:o})}}async getWhiteLedState(e){const t=this.normalizeChannel(e),A=await this.sendXml({cmdId:S,channel:t}),s=H(A,"enable"),r=H(A,"state"),n=H(A,"status"),i=H(A,"brightness_cur"),o={enabled:"1"===s||"1"===r||"1"===n};return void 0!==i&&(o.brightness=Number(i)),o}async setWhiteLedState(e,t,A){const s="number"==typeof e?e:A??0,r="number"==typeof e?t:e,n="number"==typeof e?A:t,i=this.normalizeChannel(s);if(void 0!==r)try{const e=V(i,r?1:0,r?180:0);await this.sendXml({cmdId:288,channel:i,payloadXml:e})}catch(e){let t=await this.sendXml({cmdId:S,channel:i});/<enable>[^<]*<\/enable>/i.test(t)&&(t=t.replace(/<enable>[^<]*<\/enable>/i,`<enable>${r?1:0}</enable>`)),/<state>[^<]*<\/state>/i.test(t)&&(t=t.replace(/<state>[^<]*<\/state>/i,`<state>${r?1:0}</state>`)),/<status>[^<]*<\/status>/i.test(t)&&(t=t.replace(/<status>[^<]*<\/status>/i,`<status>${r?1:0}</status>`)),await this.sendXml({cmdId:290,channel:i,payloadXml:t})}if(void 0!==n){let e=await this.sendXml({cmdId:S,channel:i});/<brightness_cur>[^<]*<\/brightness_cur>/i.test(e)&&(e=e.replace(/<brightness_cur>[^<]*<\/brightness_cur>/i,`<brightness_cur>${n}</brightness_cur>`)),/<enable>[^<]*<\/enable>/i.test(e)&&(e=e.replace(/<enable>[^<]*<\/enable>/i,"<enable>1</enable>")),await this.sendXml({cmdId:290,channel:i,payloadXml:e})}}async getAbilityInfo(){const e=this.client.username,t=`<?xml version="1.0" encoding="UTF-8" ?>\n<Extension version="1.1">\n<userName>${M(e)}</userName>\n<token>system, streaming, PTZ, IO, security, replay, disk, network, alarm, record, video, image</token>\n</Extension>`;const A=await this.sendXml({cmdId:151,extensionXml:t}),s={},r=["system","streaming","PTZ","IO","security","replay","disk","network","alarm","record","video","image"];for(const e of r){const t=new RegExp(`<${e}[^>]*>([\\s\\S]*?)<\\/${e}>`,"i"),r=A.match(t);if(r){const e=(r[1]??"").matchAll(/<subModule[^>]*>([\s\S]*?)<\/subModule>/g);for(const t of e){const e=t[1]??"",A=H(e,"channelId")||H(e,"chnID"),r=H(e,"abilityValue");if(r){const e=A?Number(A):"Host";s[e]||(s[e]={});const t=r.split(",").map((e=>e.trim())).filter(Boolean);for(const A of t)s[e][A]=1}}}}const n=A.match(/<AbilityInfo[^>]*>([\s\S]*?)<\/AbilityInfo>/);if(n){const e=(n[1]??"").matchAll(/<([A-Za-z]+)[^>]*>([^<]*)<\/\1>/g);s.Host||(s.Host={});for(const t of e){const e=t[1],A=t[2];if(e&&void 0!==A&&!["image","video","subModule"].includes(e)&&"channelId"!==e&&"abilityValue"!==e){const t=Number(A);s.Host[e]=Number.isNaN(t)?A:t}}}return s.Host&&0===Object.keys(s.Host).length&&delete s.Host,s}async getAbilityVersion(e,t){const A=(await this.getAbilityInfo())[null!=t?t:"Host"];if(!A)return 0;const s=A[e];if("number"==typeof s)return s;if("string"==typeof s){const e=Number(s);return Number.isNaN(e)?0:e}return 0}async getSupportInfo(){return It(await this.sendXml({cmdId:199}))}async getDeviceCapabilities(e,t){const A=this.normalizeChannel(e),s=t?.probe??!0,r=t?.probeSiren??!0,n=t?.probeFloodlight??!0,[i,o]=await Promise.allSettled([this.getAbilityInfo(),this.getSupportInfo()]),a="fulfilled"===i.status?i.value:void 0,c="fulfilled"===o.status?o.value:void 0,l={channel:A};a&&(l.abilities=a),c&&(l.support=c);const h=Qt(l),g=ut(a,A),d=e=>{if("number"==typeof e)return e>0;if("string"==typeof e){const t=Number(e);return Number.isFinite(t)?t>0:e.length>0&&"0"!==e}return Boolean(e)},u=c?{rtsp:d(c.rtsp),onvif:d(c.onvif),wifi:d(c.wifi),record:d(c.record),ftp:d(c.ftp),email:d(c.email),pushAlarm:d(c.pushAlarm),audioTalk:d(c.audioTalk)}:void 0;if(s&&r&&!h.hasSiren){const e=async()=>{try{return await this.sendXml({cmdId:547,channel:A,timeoutMs:1e3}),!0}catch{return!1}},t=async()=>{try{const e=Y(A+1,0);return await this.sendXml({cmdId:263,channel:A,payloadXml:e,timeoutMs:1e3}),!0}catch{return!1}};(await e()||await t())&&(h.hasSiren=!0)}if(s&&n&&!h.hasFloodlight){const e=(c?.items??[]).filter((e=>e.chnID===A||e.chnID===A+1)),t=e=>{const t=e?.lightType;if("number"==typeof t)return t;if("string"==typeof t){const e=Number(t);return Number.isFinite(e)?e:void 0}},s=e.map((e=>t(e))).filter((e=>Number.isFinite(e)));if(s.some((e=>0===e)));else if(s.some((e=>e>0)))h.hasFloodlight=!0;else try{const e=await this.sendXml({cmdId:S,channel:A,timeoutMs:1e3});/(<FloodlightTask\b|<FloodlightManual\b|<FloodlightStatusList\b|<WhiteLed\b)/i.test(e)&&(h.hasFloodlight=!0)}catch{}}let E,I;try{const e=(H(await this.sendXml({cmdId:299,channel:A,timeoutMs:1500}),"detectType")??"").trim();if(e){const t=e.split(",").map((e=>e.trim())).filter(Boolean);t.length>0&&(E=t)}}catch{}if(h.hasPresets){const e=(await Promise.allSettled([this.getPtzPresets(A)]))[0];"fulfilled"===e?.status&&(I=e.value,h.hasPresets=I.length>0)}const Q={channel:A,channelId1Based:A+1,transport:this.client.getTransport(),encryptionKind:this.client.enc.kind,loggedIn:this.client.loggedIn,subscribed:this.client.subscribed,abilitiesAvailable:Boolean(a),supportAvailable:Boolean(c)};g&&(Q.abilityMergedKeyCount=Object.keys(g).length),c?.items&&(Q.supportItemCount=c.items.length);const C={capabilities:h,debug:Q};return a&&(C.abilities=a),c&&(C.support=c),I&&(C.presets=I),E&&(C.objects=E),u&&(C.features=u),C}async createRtspStream(e,t,A){const s="number"==typeof e?this.normalizeChannel(e):0,r="number"==typeof e?t:e,n="number"==typeof e?A:t;let i;try{const e=await this.getStreamMetadata(s);if(Array.isArray(e)){const t=e.find((e=>e.profile===r));t?.videoEncType&&(i=t.videoEncType)}else if(e&&"object"==typeof e&&"streams"in e){const t=e.streams;if(Array.isArray(t)){const e=t.find((e=>e?.profile===r));e?.videoEncType&&(i=e.videoEncType)}}}catch(e){this.logger.warn(`[ReolinkBaichuanApi] Could not fetch stream metadata, will auto-detect codec: ${e instanceof Error?e.message:e}`)}const o={api:this,channel:s,profile:r,...void 0!==n?.listenHost?{listenHost:n.listenHost}:{},...void 0!==n?.listenPort?{listenPort:n.listenPort}:{},...void 0!==n?.path?{path:n.path}:{},logger:this.logger},a=new nt(o);return await a.start(),this.rtspServers.add(a),a.once("close",(()=>{this.rtspServers.delete(a)})),a}};function wt(e,t,A){const s=[];let r=0;const n=(e,s)=>{if(4===t)return"be"===A?e.readUInt32BE(s):e.readUInt32LE(s);if(2===t)return"be"===A?e.readUInt16BE(s):e.readUInt16LE(s);if(3===t){const t=e[s],r=e[s+1],n=e[s+2];return"be"===A?(t<<16|r<<8|n)>>>0:(n<<16|r<<8|t)>>>0}return e.readUInt8(s)};for(;r+t<=e.length;){const A=n(e,r);if(r+=t,!A)return[];if(r+A>e.length)return[];const i=e.subarray(r,r+A);r+=A,i.length&&s.push(i)}return r!==e.length?[]:s}function bt(e,t){if(!t.length)return Number.POSITIVE_INFINITY;let A=0;for(const s of t)if(s.length){if(128&s[0])A+=10;else if("H264"===e){const e=31&s[0];(e<1||e>23)&&A++}else if("H265"===e){if(s.length<2){A++;continue}const e=s[0]>>1&63;e>=0&&e<=29||e>=32&&e<=40||e>=48&&e<=50||A++}}else A++;return A}function Rt(e,t){if(!e?.length)return[];const A=[],s=function(e,t=64){if(!e?.length)return-1;const A=Math.min(e.length,Math.max(0,t));for(let t=0;t+3<A;t++)if(0===e[t]&&0===e[t+1]){if(1===e[t+2])return t;if(0===e[t+2]&&1===e[t+3])return t}return-1}(e,64);if(s>=0){const t=function(e){const t=[],A=e.length,s=t=>{if(t+3<=A&&0===e[t]&&0===e[t+1]){if(1===e[t+2])return 3;if(t+4<=A&&0===e[t+2]&&1===e[t+3])return 4}return 0};let r=0;for(;r<A&&!s(r);)r++;for(;r<A;){const n=s(r);if(!n){r++;continue}const i=r+n;let o=i;for(;o<A&&!s(o);)o++;if(i<o){const A=e.subarray(i,o);A.length>0&&t.push(A)}r=o}return t}(0===s?e:e.subarray(s));t.length&&A.push(t)}A.push(wt(e,4,"be")),A.push(wt(e,4,"le")),A.push(wt(e,3,"be")),A.push(wt(e,3,"le")),A.push(wt(e,2,"be")),A.push(wt(e,2,"le")),A.push(wt(e,1,"be"));const r=function(e){if(e.length>=4&&0===e[0]&&0===e[1]){if(1===e[2])return e.subarray(3);if(0===e[2]&&1===e[3])return e.subarray(4)}return e}(e);r.length&&A.push([r]);let n=[],i=Number.POSITIVE_INFINITY;for(const e of A){if(!e.length)continue;const A=bt(t,e);if(A<i&&(i=A,n=e,0===i))break}return n}function Nt(e){const t=Rt(e,"H264");let A,s,r;for(const e of t){if(e.length<1)continue;const t=31&e[0];if(7===t){if(A=e,e.length>=4){r=Buffer.from([e[1],e[2],e[3]]).toString("hex")}}else 8===t&&(s=e)}const n={};return A&&(n.sps=A),s&&(n.pps=s),r&&(n.profileLevelId=r),n}function kt(e){const t=Rt(e,"H265");let A,s,r;for(const e of t){if(e.length<2)continue;const t=e[0]>>1&63;32===t?A=e:33===t?s=e:34===t&&(r=e)}const n={};return A&&(n.vps=A),s&&(n.sps=s),r&&(n.pps=r),n}var Tt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];function Ft(e){if(e.length<7)return null;if(255!==e[0]||240&~e[1])return null;const t=!(1&~e[1]),A=((192&e[2])>>6)+1,s=(60&e[2])>>2,r=Tt[s]??0,n=(1&e[2])<<2|(192&e[3])>>6;if(!r||!n)return null;const i=t?7:9;if(e.length<i)return null;return{headerLength:i,sampleRate:r,channels:n,configHex:((31&A)<<11|(15&s)<<7|(15&n)<<3).toString(16).padStart(4,"0")}}var vt=class{constructor(e){this.payloadType=e,this.seq=s.randomBytes(2).readUInt16BE(0)}seq=0;timestamp=0;ssrc=s.randomBytes(4).readUInt32BE(0);setTimestamp(e){this.timestamp=e>>>0}getTimestamp(){return this.timestamp>>>0}advanceTimestamp(e){this.timestamp=this.timestamp+(e>>>0)>>>0}writePacket(e,t){const A=Buffer.alloc(12);return A[0]=128,A[1]=(t?128:0)|127&this.payloadType,A.writeUInt16BE(65535&this.seq,2),A.writeUInt32BE(this.timestamp>>>0,4),A.writeUInt32BE(this.ssrc>>>0,8),this.seq=this.seq+1&65535,Buffer.concat([A,e])}};function Mt(e,t,A,s,r){const n=A.maxRtpPayload,i=[];if(e.length<=n)return i.push(t.writePacket(e,s&&r)),i;const o=e[0],a=31&o,c=128&o|96&o|28,l=e.subarray(1);let h=0;for(;h<l.length;){const e=l.length-h,A=Math.min(e,n-2),o=0===h,g=h+A>=l.length,d=(o?128:0)|(g?64:0)|31&a,u=Buffer.concat([Buffer.from([c,d]),l.subarray(h,h+A)]);i.push(t.writePacket(u,s&&r&&g)),h+=A}return i}function Ut(e,t,A,s,r){const n=A.maxRtpPayload,i=[];if(e.length<=n)return i.push(t.writePacket(e,s&&r)),i;if(e.length<3)return i;const o=e[0],a=o>>1&63,c=129&o|98,l=e[1],h=e.subarray(2);let g=0;for(;g<h.length;){const e=h.length-g,A=Math.min(e,n-3),o=0===g,d=g+A>=h.length,u=(o?128:0)|(d?64:0)|63&a,E=Buffer.concat([Buffer.from([c,l,u]),h.subarray(g,g+A)]);i.push(t.writePacket(E,s&&r&&d)),g+=A}return i}var Lt=class e{constructor(e,t,A,s=25,r=1200){this.logger=e,this.videoPayloadType=t,this.maxRtpPayload=r,this.videoRtp=new vt(t),void 0!==A&&(this.audioRtp=new vt(A)),this.fallbackVideoIncrement=Math.max(1,Math.round(this.videoClockRate/Math.max(1,s)))}clients=new Set;closed=!1;videoRtp;audioRtp;videoBaseUs;videoBaseTs;videoLastTs;videoClockRate=9e4;fallbackVideoIncrement;cachedH264ParamSetsAnnexB;cachedH265ParamSetsAnnexB;addClient(e){if(this.closed)return void e.destroy();const t={socket:e,needsKeyframe:!0,sentVideoConfig:!1};this.clients.add(t);const A=()=>{this.clients.delete(t);try{e.destroy()}catch{}};e.on("error",A),e.on("close",A)}static ANNEXB_START_CODE=Buffer.from([0,0,0,1]);static joinAnnexBNals(...t){const A=t.filter((e=>!!e&&e.length>0));if(!A.length)return;const s=[];for(const t of A)s.push(e.ANNEXB_START_CODE,t);return Buffer.concat(s)}updateVideoParamSetsFromAccessUnit(t,A){if(!A?.length)return;if("H264"===t){const{sps:t,pps:s}=Nt(A);return void(t&&s&&(this.cachedH264ParamSetsAnnexB=e.joinAnnexBNals(t,s)))}const{vps:s,sps:r,pps:n}=kt(A);s&&r&&n&&(this.cachedH265ParamSetsAnnexB=e.joinAnnexBNals(s,r,n))}sendCachedVideoConfigToClient(e,t){if(this.closed)return;if(t.sentVideoConfig)return;const A="H265"===e?this.cachedH265ParamSetsAnnexB:this.cachedH264ParamSetsAnnexB;if(!A?.length)return;const s=Rt(A,e);if(!s.length)return;const r={maxRtpPayload:this.maxRtpPayload};for(let A=0;A<s.length;A++){const n=s[A],i=A===s.length-1,o="H265"===e?Ut(n,this.videoRtp,r,!1,i):Mt(n,this.videoRtp,r,!1,i);for(const e of o)this.writeRtpPacketToClient(t,e)}t.sentVideoConfig=!0}close(){if(!this.closed){this.closed=!0;for(const e of Array.from(this.clients))try{e.socket.destroy()}catch{}this.clients.clear()}}writeRtpPacketToClient(e,t){if(e.socket.destroyed||!e.socket.writable)return;const A=Buffer.alloc(2);A.writeUInt16BE(65535&t.length,0);const s=Buffer.concat([A,t]);try{e.socket.write(s)}catch{try{e.socket.destroy()}catch{}}}writeRtpPacketToClients(e,t){for(const A of this.clients)t(A)&&this.writeRtpPacketToClient(A,e)}setVideoTimestampFromMicroseconds(e){if(null==e)return;if(!Number.isFinite(e))return;if(void 0===this.videoBaseUs)return this.videoBaseUs=e>>>0,void 0===this.videoBaseTs&&(this.videoBaseTs=this.videoRtp.getTimestamp()),void(this.videoLastTs=this.videoRtp.getTimestamp());const t=(e>>>0)-(this.videoBaseUs>>>0)>>>0;let A=((this.videoBaseTs??0)>>>0)+Math.round(t*this.videoClockRate/1e6)>>>0;void 0!==this.videoLastTs&&A<=this.videoLastTs>>>0&&(A=1+(this.videoLastTs>>>0)>>>0),this.videoRtp.setTimestamp(A),this.videoLastTs=A}sendVideoAccessUnit(e,t,A,s){if(this.closed)return;this.updateVideoParamSetsFromAccessUnit(e,t);const r=Rt(t,e);if(!r.length)return;let n=!1;if("H264"===e)for(const e of r){if(5===(31&e[0])){n=!0;break}}else for(const e of r){if(e.length<2)continue;const t=e[0]>>1&63;if(t>=16&&t<=23){n=!0;break}}const i=A||n,o=e=>!!i||!e.needsKeyframe;let a=!1;for(const e of this.clients)if(o(e)){a=!0;break}if(!a){for(const t of this.clients)t.needsKeyframe&&this.sendCachedVideoConfigToClient(e,t);return}this.setVideoTimestampFromMicroseconds(s);for(const t of this.clients)t.needsKeyframe&&this.sendCachedVideoConfigToClient(e,t);const c={maxRtpPayload:this.maxRtpPayload};for(let t=0;t<r.length;t++){const A=r[t],s=t===r.length-1,n="H265"===e?Ut(A,this.videoRtp,c,!0,s):Mt(A,this.videoRtp,c,!0,s);for(const e of n)this.writeRtpPacketToClients(e,o)}if(void 0===this.videoBaseUs&&this.videoRtp.advanceTimestamp(this.fallbackVideoIncrement),i)for(const e of this.clients)e.needsKeyframe=!1}sendAudioAdtsFrame(e){if(this.closed)return{};if(!this.audioRtp)return{};const{packets:t,config:A}=function(e,t){const A=Ft(e);if(!A)return{packets:[]};const s=e.subarray(A.headerLength);if(!s.length)return{packets:[]};const r=Buffer.from([0,16]),n=8191&s.length,i=Buffer.alloc(2);i[0]=n>>5&255,i[1]=(31&n)<<3;const o=Buffer.concat([r,i,s]);return{packets:[t.writePacket(o,!0)],config:{sampleRate:A.sampleRate,channels:A.channels,configHex:A.configHex}}}(e,this.audioRtp);for(const e of t)this.writeRtpPacketToClients(e,(e=>!e.needsKeyframe));return t.length&&this.audioRtp.advanceTimestamp(1024),A?{parsed:A}:{}}sendAudioRtpPacket(e){if(this.closed)return;if(!e||e.length<12)return;2===(e[0]>>6&3)&&this.writeRtpPacketToClients(e,(e=>!e.needsKeyframe))}static parseRtpPayload(e){if(!e||e.length<12)return;if(2!==(e[0]>>6&3))return;const t=!!(32&e[0]),A=!!(16&e[0]);let s=12+4*(15&e[0]);if(s>e.length)return;if(A){if(s+4>e.length)return;if(s+=4+4*e.readUInt16BE(s+2),s>e.length)return}let r=e.length;if(t){const t=e[e.length-1];if(t<=0||t>e.length)return;if(r=e.length-t,r<s)return}return r<=s?void 0:e.subarray(s,r)}static isH264KeyframeLikeRtpPacket(t){const A=e.parseRtpPayload(t);if(!A||A.length<1)return!1;const s=31&A[0];if(s>=1&&s<=23)return 5===s||7===s||8===s;if(24===s){let e=1;for(;e+2<=A.length;){const t=A.readUInt16BE(e);if(e+=2,!t||e+t>A.length)break;const s=31&A[e];if(5===s||7===s||8===s)return!0;e+=t}return!1}if(28===s&&A.length>=2){const e=A[1],t=31&e;return!!!!(128&e)&&(5===t||7===t||8===t)}return!1}static isH265KeyframeLikeRtpPacket(t){const A=e.parseRtpPayload(t);if(!A||A.length<2)return!1;const s=A[0]>>1&63,r=e=>e>=16&&e<=21||(32===e||33===e||34===e);if(49===s&&A.length>=3){const e=A[2];return!!!!(128&e)&&r(63&e)}return r(s)}sendVideoRtpPacket(t,A){if(this.closed)return;if(!A||A.length<12)return;if(2!==(A[0]>>6&3))return;const s="H265"===t?e.isH265KeyframeLikeRtpPacket(A):e.isH264KeyframeLikeRtpPacket(A);if(this.writeRtpPacketToClients(A,(e=>!!s||!e.needsKeyframe)),s)for(const e of this.clients)e.needsKeyframe=!1}};async function Ht(e){const{api:t,channel:A,profile:s,logger:r,expectedVideoType:i,host:o="127.0.0.1",videoPayloadType:a=96,audioPayloadType:c=97,keyframeTimeoutMs:l=5e3,uptimeRestartMs:h=1e4,idleTeardownMs:g=2500,closeApiOnTeardown:d=!0,username:u,password:E,requireAuth:I=!1}=e,Q=`[native-rfc4571 ch=${A} profile=${s}]`,C=e=>r.warn(`${Q} ${e}`);C(`starting (host=${o} videoPT=${a} audioPT=${c} expectedVideoType=${i??"n/a"} keyframeTimeoutMs=${l} uptimeRestartMs=${h} idleTeardownMs=${g})`);const B=new Xe({client:t.client,api:t,channel:A,profile:s,logger:r});await B.start(),C("baichuan stream started; waiting for keyframe to extract parameter sets");const p=await(async()=>await new Promise(((e,t)=>{const r=setTimeout((()=>{o(),t(new Error(`Timeout waiting for keyframe on native stream channel=${A} profile=${s}`))}),l),n=e=>{o(),t(e instanceof Error?e:new Error(String(e)))},i=t=>{if(!t?.isKeyframe)return;const A=t.videoType,s=t.data;if("H264"===A){const{sps:t,pps:r,profileLevelId:n}=Nt(s);if(!t||!r)return;return o(),void e({videoType:A,accessUnit:s,...n?{profileLevelId:n}:{},h264:{sps:t,pps:r}})}const{vps:r,sps:n,pps:i}=kt(s);r&&n&&i&&(o(),e({videoType:A,accessUnit:s,h265:{vps:r,sps:n,pps:i}}))},o=()=>{clearTimeout(r),B.removeListener("error",n),B.removeListener("videoAccessUnit",i)};B.on("error",n),B.on("videoAccessUnit",i)})))();i&&p.videoType!==i&&C(`expectedVideoType mismatch (expected=${i} actual=${p.videoType})`),C(`video detected: codec=${p.videoType} (primed via keyframe)`);let f,m=25;try{const e=await t.getStreamMetadata(A),r=(Array.isArray(e)?e:Array.isArray(e?.streams)?e.streams:[]).find((e=>e?.profile===s)),n=Number(r?.frameRate);Number.isFinite(n)&&n>0&&(m=n)}catch{}C(`video framerate hint: ${m} fps`);f=await(async()=>await new Promise((e=>{let t=!1,A=3;const s=setTimeout((()=>{i(),t&&r.warn("Native audio frames seen but not ADTS AAC; cannot advertise audio track."),e(void 0)}),5e3),n=s=>{t=!0;const n=Ft(s);if(n)i(),e({sampleRate:n.sampleRate,channels:n.channels,configHex:n.configHex});else if(A-- >0){const e=s.subarray(0,Math.min(16,s.length)).toString("hex");r.warn(`Native audioFrame not ADTS: len=${s.length} head=${e}`)}},i=()=>{clearTimeout(s),B.removeListener("audioFrame",n)};B.on("audioFrame",n)})))(),C(f?`audio detected: codec=aac sampleRate=${f.sampleRate} channels=${f.channels}`:"audio not detected/advertised (no ADTS AAC config within timeout)");const y={videoType:p.videoType,payloadType:a,..."H264"===p.videoType?{h264:{sps:p.h264.sps,pps:p.h264.pps,...p.profileLevelId?{profileLevelId:p.profileLevelId}:{}}}:{h265:{vps:p.h265.vps,sps:p.h265.sps,pps:p.h265.pps}}},S=f?{codec:"aac",payloadType:c,sampleRate:f.sampleRate,channels:f.channels,configHex:f.configHex}:void 0,D=function(e,t){let A="v=0\r\n";if(A+="o=- 0 0 IN IP4 0.0.0.0\r\n",A+="s=No Name\r\n",A+="t=0 0\r\n",A+=`m=video 0 RTP/AVP ${e.payloadType}\r\n`,A+="c=IN IP4 0.0.0.0\r\n",A+=`a=rtpmap:${e.payloadType} ${e.videoType}/90000\r\n`,"H264"===e.videoType&&e.h264){const t=e.h264.sps.toString("base64"),s=e.h264.pps.toString("base64"),r=e.h264.profileLevelId?`profile-level-id=${e.h264.profileLevelId};`:"";A+=`a=fmtp:${e.payloadType} packetization-mode=1;${r}sprop-parameter-sets=${t},${s}\r\n`}if("H265"===e.videoType&&e.h265){const t=e.h265.vps.toString("base64"),s=e.h265.sps.toString("base64"),r=e.h265.pps.toString("base64");A+=`a=fmtp:${e.payloadType} sprop-vps=${t};sprop-sps=${s};sprop-pps=${r}\r\n`}return"aac"===t?.codec&&(A+=`m=audio 0 RTP/AVP ${t.payloadType}\r\n`,A+="c=IN IP4 0.0.0.0\r\n",A+="b=AS:128\r\n",A+=`a=rtpmap:${t.payloadType} MPEG4-GENERIC/${t.sampleRate}/${t.channels}\r\n`,A+=`a=fmtp:${t.payloadType} profile-level-id=1; mode=AAC-hbr; sizelength=13; indexlength=3; indexdeltalength=3; config=${t.configHex}\r\n`),"opus"===t?.codec&&(A+=`m=audio 0 RTP/AVP ${t.payloadType}\r\n`,A+="c=IN IP4 0.0.0.0\r\n",A+="b=AS:128\r\n",A+=`a=rtpmap:${t.payloadType} opus/${t.sampleRate}/${t.channels}\r\n`),A}(y,S),w=()=>new Lt(r,a,S?c:void 0,m);let b=w();C(`SDP ready (video=${p.videoType}/90000 pt=${a}${S?`, audio=aac/${S.sampleRate}/${S.channels} pt=${c}`:", audio=none"})`);let R=0;const N=new Set;let k,T=!1,F=!1,v=Date.now();const M=()=>{v=Date.now()},U=()=>{k&&(clearTimeout(k),k=void 0)};let L;const H=e=>{g&&(k||(k=setTimeout((()=>{k=void 0,0===R&&e(new Error("No RFC4571 clients (idle)")).catch((()=>{}))}),g)))},x=n.createServer(),Y=async e=>{if(T)return;if(F)return;F=!0,M(),U();const t=e?.message||e?.toString?.()||e,A=x.address(),s=A&&"string"!=typeof A?`${A.address}:${A.port}`:"unbound";C(t?`uptime watchdog: restarting (addr=${s} clients=${R} reason=${t})`:`uptime watchdog: restarting (addr=${s} clients=${R})`);for(const e of Array.from(N))try{e.destroy()}catch{}N.clear();try{b.close()}catch{}b=w();try{await B.stop()}catch{}try{await B.start()}catch(e){return F=!1,void P(e).catch((()=>{}))}F=!1,M(),C("uptime watchdog: restart complete"),0===R&&H(P)},P=async e=>{if(T)return;T=!0,L&&(clearInterval(L),L=void 0),U();const A=e?.message||e?.toString?.()||e,s=x.address(),r=s&&"string"!=typeof s?`${s.address}:${s.port}`:"unbound";C(A?`teardown requested (addr=${r} clients=${R} reason=${A})`:`teardown requested (addr=${r} clients=${R})`),b.close();try{await B.stop()}catch{}if(d)try{await t.close()}catch{}try{x.close()}catch{}C("teardown complete")};x.on("connection",(e=>{M();const t=`${e.remoteAddress??"unknown"}:${e.remotePort??"unknown"}`;C(`client connecting (remote=${t} requireAuth=${I})`);const A=()=>{R++,U(),N.add(e),e.on("data",(()=>M()));try{const t=e.write.bind(e);e.write=(...e)=>(M(),t(...e))}catch{}b.addClient(e),C(`client connected (remote=${t} clients=${R})`)};if(I){let s=!1,r=Buffer.alloc(0);const n=setTimeout((()=>{s||(C(`client authentication timeout (remote=${t})`),e.destroy())}),5e3),i=o=>{if(M(),!s){r=Buffer.concat([r,o]);const a=r.toString("utf8").match(/^([^:]+):([^\n]+)\n/);if(a){const[,o,c]=a;if(o!==u||c!==E)return C(`client authentication failed (remote=${t})`),void e.destroy();{s=!0,clearTimeout(n),A();const t=a[0].length,o=r.subarray(t);e.removeListener("data",i),e.on("data",(()=>M())),o.length>0&&e.emit("data",o)}}else if(r.length>1024)return C(`client authentication buffer overflow (remote=${t})`),void e.destroy()}};e.on("data",i)}else A();let s=!0;const r=()=>{s&&(s=!1,R=Math.max(0,R-1),N.delete(e),C(`client disconnected (remote=${t} clients=${R})`),0===R&&H(P))};e.once("close",r),e.once("error",r)})),B.on("videoAccessUnit",(e=>{M();try{b.sendVideoAccessUnit(e.videoType,e.data,e.isKeyframe,e.microseconds)}catch(e){P(e).catch((()=>{}))}})),S&&B.on("audioFrame",(e=>{M();try{b.sendAudioAdtsFrame(e)}catch(e){P(e).catch((()=>{}))}})),B.on("error",(e=>{F||P(e).catch((()=>{}))})),B.on("close",(e=>{F||P(e).catch((()=>{}))})),await new Promise(((e,t)=>{x.once("error",t),x.listen(0,o,(()=>e()))}));const V=x.address();if(!V||"string"==typeof V)throw new Error("Failed to bind RFC TCP server");const O=V.port;if(!O)throw new Error("Failed to bind RFC TCP server");C(`listening (addr=${o}:${O})`);const G=S?{codec:"aac",sampleRate:S.sampleRate,channels:S.channels}:void 0;return H(P),(()=>{if(!h||h<=0)return;if(L)return;const e=Math.max(250,Math.min(1e3,Math.floor(h/2)));L=setInterval((()=>{if(T||F)return;const e=Date.now()-v;e<h||Y(new Error(`No stream activity for ${e}ms (threshold=${h}ms)`)).catch((()=>{}))}),e)})(),{host:o,port:O,sdp:D,videoType:p.videoType,...G?{audio:G}:{},username:u,password:E,server:x,videoStream:B,close:P}}var xt=Buffer.from([0,0,0,1]),Yt=Buffer.from([0,0,1]);function Pt(e){const t=[];for(let A=0;A<e.length-3;A++)0===e[A]&&0===e[A+1]&&(1===e[A+2]?(t.push({idx:A,len:3}),A+=2):0===e[A+2]&&1===e[A+3]&&(t.push({idx:A,len:4}),A+=3));if(0===t.length)return[];const A=[];for(let s=0;s<t.length;s++){const r=t[s],n=r.idx+r.len,i=t[s+1],o=i?i.idx:e.length;o>n&&A.push(e.subarray(n,o))}return A}function Vt(e){if(e.length<1)return null;const t=e[0];return void 0===t?null:31&t}r.EventEmitter}},t={};function A(s){var r=t[s];if(void 0!==r)return r.exports;var n=t[s]={id:s,loaded:!1,exports:{}};return e[s].call(n.exports,n,n.exports,A),n.loaded=!0,n.exports}A.d=(e,t)=>{for(var s in t)A.o(t,s)&&!A.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},A.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),A.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var s=A(7927),r=exports="undefined"==typeof exports?{}:exports;for(var n in s)r[n]=s[n];s.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
2
+ (()=>{var e={9038:(e,t,A)=>{"use strict";const s=A(1167),r=A(5497),n=A(8542),i=A(8055),o=A(3315),a=A(9246),c=A(4667),l=A(8712),h=A(8297),g=A(4465),d=A(2858),{InvalidArgumentError:u}=g,E=A(9713),I=A(1986),Q=A(615),{MockCallHistory:C,MockCallHistoryLog:B}=A(4969),p=A(7467),f=A(5846),m=A(1313),y=A(3123),S=A(6294),{getGlobalDispatcher:w,setGlobalDispatcher:D}=A(9879),b=A(6917),N=A(8064);Object.assign(r.prototype,E),e.exports.g6=o,A(5132),A(2936),A(532),A(3562),A(6677),A(5752),A(4951),A(9903);function R(e){return(t,A,s)=>{if("function"==typeof A&&(s=A,A=null),!t||"string"!=typeof t&&"object"!=typeof t&&!(t instanceof URL))throw new u("invalid url");if(null!=A&&"object"!=typeof A)throw new u("invalid opts");if(A&&null!=A.path){if("string"!=typeof A.path)throw new u("invalid opts.path");let e=A.path;A.path.startsWith("/")||(e=`/${e}`),t=new URL(d.parseOrigin(t).origin+e)}else A||(A="object"==typeof t?t:{}),t=d.parseURL(t);const{agent:r,dispatcher:n=w()}=A;if(r)throw new u("unsupported opts.agent. Did you mean opts.client?");return e.call(n,{...A,origin:t.origin,path:t.search?`${t.pathname}${t.search}`:t.pathname,method:A.method||(A.body?"PUT":"GET")},s)}}A(2636),d.parseHeaders,d.headerNameToString;const v=A(7388).fetch;e.exports.hd=function(e,t=void 0){return v(e,t).catch((e=>{throw e&&"object"==typeof e&&Error.captureStackTrace(e),e}))},e.exports.Headers=A(6558).Headers,e.exports.Response=A(4821).Response,e.exports.Request=A(4609).Request,e.exports.FormData=A(3944).FormData;const{setGlobalOrigin:k,getGlobalOrigin:T}=A(2837);const{CacheStorage:F}=A(6939),{kConstruct:M}=A(257);new F(M);const{deleteCookie:U,getCookies:L,getSetCookies:H,setCookie:P,parseCookie:x}=A(9391);const{parseMIMEType:Y,serializeAMimeType:V}=A(9934);const{CloseEvent:G,ErrorEvent:O,MessageEvent:J}=A(878),{WebSocket:W,ping:_}=A(2984);e.exports.kb=W,e.exports.rd=G,e.exports.NN=O,e.exports.aM=J,A(27).WebSocketStream,A(7053).WebSocketError,R(E.request),R(E.stream),R(E.pipeline),R(E.connect),R(E.upgrade);const{EventSource:q}=A(7928);e.exports.GD=q},3904:(e,t,A)=>{"use strict";const{addAbortListener:s}=A(2858),{RequestAbortedError:r}=A(4465),n=Symbol("kListener"),i=Symbol("kSignal");function o(e){e.abort?e.abort(e[i]?.reason):e.reason=e[i]?.reason??new r,a(e)}function a(e){e[i]&&("removeEventListener"in e[i]?e[i].removeEventListener("abort",e[n]):e[i].removeListener("abort",e[n]),e[i]=null,e[n]=null)}e.exports={addSignal:function(e,t){e.reason=null,e[i]=null,e[n]=null,t&&(t.aborted?o(e):(e[i]=t,e[n]=()=>{o(e)},s(e[i],e[n])))},removeSignal:a}},3102:(e,t,A)=>{"use strict";const s=A(4589),{AsyncResource:r}=A(6698),{InvalidArgumentError:n,SocketError:i}=A(4465),o=A(2858),{addSignal:a,removeSignal:c}=A(3904);class l extends r{constructor(e,t){if(!e||"object"!=typeof e)throw new n("invalid opts");if("function"!=typeof t)throw new n("invalid callback");const{signal:A,opaque:s,responseHeaders:r}=e;if(A&&"function"!=typeof A.on&&"function"!=typeof A.addEventListener)throw new n("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=s||null,this.responseHeaders=r||null,this.callback=t,this.abort=null,a(this,A)}onConnect(e,t){this.reason?e(this.reason):(s(this.callback),this.abort=e,this.context=t)}onHeaders(){throw new i("bad connect",null)}onUpgrade(e,t,A){const{callback:s,opaque:r,context:n}=this;c(this),this.callback=null;let i=t;null!=i&&(i="raw"===this.responseHeaders?o.parseRawHeaders(t):o.parseHeaders(t)),this.runInAsyncScope(s,null,null,{statusCode:e,headers:i,socket:A,opaque:r,context:n})}onError(e){const{callback:t,opaque:A}=this;c(this),t&&(this.callback=null,queueMicrotask((()=>{this.runInAsyncScope(t,null,e,{opaque:A})})))}}e.exports=function e(t,A){if(void 0===A)return new Promise(((A,s)=>{e.call(this,t,((e,t)=>e?s(e):A(t)))}));try{const e=new l(t,A),s={...t,method:"CONNECT"};this.dispatch(s,e)}catch(e){if("function"!=typeof A)throw e;const s=t?.opaque;queueMicrotask((()=>A(e,{opaque:s})))}}},8660:(e,t,A)=>{"use strict";const{Readable:s,Duplex:r,PassThrough:n}=A(7075),i=A(4589),{AsyncResource:o}=A(6698),{InvalidArgumentError:a,InvalidReturnValueError:c,RequestAbortedError:l}=A(4465),h=A(2858),{addSignal:g,removeSignal:d}=A(3904);function u(){}const E=Symbol("resume");class I extends s{constructor(){super({autoDestroy:!0}),this[E]=null}_read(){const{[E]:e}=this;e&&(this[E]=null,e())}_destroy(e,t){this._read(),t(e)}}class Q extends s{constructor(e){super({autoDestroy:!0}),this[E]=e}_read(){this[E]()}_destroy(e,t){e||this._readableState.endEmitted||(e=new l),t(e)}}class C extends o{constructor(e,t){if(!e||"object"!=typeof e)throw new a("invalid opts");if("function"!=typeof t)throw new a("invalid handler");const{signal:A,method:s,opaque:n,onInfo:i,responseHeaders:o}=e;if(A&&"function"!=typeof A.on&&"function"!=typeof A.addEventListener)throw new a("signal must be an EventEmitter or EventTarget");if("CONNECT"===s)throw new a("invalid method");if(i&&"function"!=typeof i)throw new a("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=n||null,this.responseHeaders=o||null,this.handler=t,this.abort=null,this.context=null,this.onInfo=i||null,this.req=(new I).on("error",u),this.ret=new r({readableObjectMode:e.objectMode,autoDestroy:!0,read:()=>{const{body:e}=this;e?.resume&&e.resume()},write:(e,t,A)=>{const{req:s}=this;s.push(e,t)||s._readableState.destroyed?A():s[E]=A},destroy:(e,t)=>{const{body:A,req:s,res:r,ret:n,abort:i}=this;e||n._readableState.endEmitted||(e=new l),i&&e&&i(),h.destroy(A,e),h.destroy(s,e),h.destroy(r,e),d(this),t(e)}}).on("prefinish",(()=>{const{req:e}=this;e.push(null)})),this.res=null,g(this,A)}onConnect(e,t){const{res:A}=this;this.reason?e(this.reason):(i(!A,"pipeline cannot be retried"),this.abort=e,this.context=t)}onHeaders(e,t,A){const{opaque:s,handler:r,context:n}=this;if(e<200){if(this.onInfo){const A="raw"===this.responseHeaders?h.parseRawHeaders(t):h.parseHeaders(t);this.onInfo({statusCode:e,headers:A})}return}let i;this.res=new Q(A);try{this.handler=null;const A="raw"===this.responseHeaders?h.parseRawHeaders(t):h.parseHeaders(t);i=this.runInAsyncScope(r,null,{statusCode:e,headers:A,opaque:s,body:this.res,context:n})}catch(e){throw this.res.on("error",u),e}if(!i||"function"!=typeof i.on)throw new c("expected Readable");i.on("data",(e=>{const{ret:t,body:A}=this;!t.push(e)&&A.pause&&A.pause()})).on("error",(e=>{const{ret:t}=this;h.destroy(t,e)})).on("end",(()=>{const{ret:e}=this;e.push(null)})).on("close",(()=>{const{ret:e}=this;e._readableState.ended||h.destroy(e,new l)})),this.body=i}onData(e){const{res:t}=this;return t.push(e)}onComplete(e){const{res:t}=this;t.push(null)}onError(e){const{ret:t}=this;this.handler=null,h.destroy(t,e)}}e.exports=function(e,t){try{const A=new C(e,t);return this.dispatch({...e,body:A.req},A),A.ret}catch(e){return(new n).destroy(e)}}},7745:(e,t,A)=>{"use strict";const s=A(4589),{AsyncResource:r}=A(6698),{Readable:n}=A(777),{InvalidArgumentError:i,RequestAbortedError:o}=A(4465),a=A(2858);function c(){}class l extends r{constructor(e,t){if(!e||"object"!=typeof e)throw new i("invalid opts");const{signal:A,method:s,opaque:r,body:n,onInfo:l,responseHeaders:h,highWaterMark:g}=e;try{if("function"!=typeof t)throw new i("invalid callback");if(g&&("number"!=typeof g||g<0))throw new i("invalid highWaterMark");if(A&&"function"!=typeof A.on&&"function"!=typeof A.addEventListener)throw new i("signal must be an EventEmitter or EventTarget");if("CONNECT"===s)throw new i("invalid method");if(l&&"function"!=typeof l)throw new i("invalid onInfo callback");super("UNDICI_REQUEST")}catch(e){throw a.isStream(n)&&a.destroy(n.on("error",c),e),e}this.method=s,this.responseHeaders=h||null,this.opaque=r||null,this.callback=t,this.res=null,this.abort=null,this.body=n,this.trailers={},this.context=null,this.onInfo=l||null,this.highWaterMark=g,this.reason=null,this.removeAbortListener=null,A?.aborted?this.reason=A.reason??new o:A&&(this.removeAbortListener=a.addAbortListener(A,(()=>{this.reason=A.reason??new o,this.res?a.destroy(this.res.on("error",c),this.reason):this.abort&&this.abort(this.reason)})))}onConnect(e,t){this.reason?e(this.reason):(s(this.callback),this.abort=e,this.context=t)}onHeaders(e,t,A,s){const{callback:r,opaque:i,abort:o,context:l,responseHeaders:h,highWaterMark:g}=this,d="raw"===h?a.parseRawHeaders(t):a.parseHeaders(t);if(e<200)return void(this.onInfo&&this.onInfo({statusCode:e,headers:d}));const u="raw"===h?a.parseHeaders(t):d,E=u["content-type"],I=u["content-length"],Q=new n({resume:A,abort:o,contentType:E,contentLength:"HEAD"!==this.method&&I?Number(I):null,highWaterMark:g});if(this.removeAbortListener&&(Q.on("close",this.removeAbortListener),this.removeAbortListener=null),this.callback=null,this.res=Q,null!==r)try{this.runInAsyncScope(r,null,null,{statusCode:e,headers:d,trailers:this.trailers,opaque:i,body:Q,context:l})}catch(e){this.res=null,a.destroy(Q.on("error",c),e),queueMicrotask((()=>{throw e}))}}onData(e){return this.res.push(e)}onComplete(e){a.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){const{res:t,callback:A,body:s,opaque:r}=this;A&&(this.callback=null,queueMicrotask((()=>{this.runInAsyncScope(A,null,e,{opaque:r})}))),t&&(this.res=null,queueMicrotask((()=>{a.destroy(t.on("error",c),e)}))),s&&(this.body=null,a.isStream(s)&&(s.on("error",c),a.destroy(s,e))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}}e.exports=function e(t,A){if(void 0===A)return new Promise(((A,s)=>{e.call(this,t,((e,t)=>e?s(e):A(t)))}));try{const e=new l(t,A);this.dispatch(t,e)}catch(e){if("function"!=typeof A)throw e;const s=t?.opaque;queueMicrotask((()=>A(e,{opaque:s})))}},e.exports.RequestHandler=l},322:(e,t,A)=>{"use strict";const s=A(4589),{finished:r}=A(7075),{AsyncResource:n}=A(6698),{InvalidArgumentError:i,InvalidReturnValueError:o}=A(4465),a=A(2858),{addSignal:c,removeSignal:l}=A(3904);function h(){}class g extends n{constructor(e,t,A){if(!e||"object"!=typeof e)throw new i("invalid opts");const{signal:s,method:r,opaque:n,body:o,onInfo:l,responseHeaders:g}=e;try{if("function"!=typeof A)throw new i("invalid callback");if("function"!=typeof t)throw new i("invalid factory");if(s&&"function"!=typeof s.on&&"function"!=typeof s.addEventListener)throw new i("signal must be an EventEmitter or EventTarget");if("CONNECT"===r)throw new i("invalid method");if(l&&"function"!=typeof l)throw new i("invalid onInfo callback");super("UNDICI_STREAM")}catch(e){throw a.isStream(o)&&a.destroy(o.on("error",h),e),e}this.responseHeaders=g||null,this.opaque=n||null,this.factory=t,this.callback=A,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=o,this.onInfo=l||null,a.isStream(o)&&o.on("error",(e=>{this.onError(e)})),c(this,s)}onConnect(e,t){this.reason?e(this.reason):(s(this.callback),this.abort=e,this.context=t)}onHeaders(e,t,A,s){const{factory:n,opaque:i,context:c,responseHeaders:l}=this,h="raw"===l?a.parseRawHeaders(t):a.parseHeaders(t);if(e<200)return void(this.onInfo&&this.onInfo({statusCode:e,headers:h}));if(this.factory=null,null===n)return;const g=this.runInAsyncScope(n,null,{statusCode:e,headers:h,opaque:i,context:c});if(!g||"function"!=typeof g.write||"function"!=typeof g.end||"function"!=typeof g.on)throw new o("expected Writable");r(g,{readable:!1},(e=>{const{callback:t,res:A,opaque:s,trailers:r,abort:n}=this;this.res=null,!e&&A?.readable||a.destroy(A,e),this.callback=null,this.runInAsyncScope(t,null,e||null,{opaque:s,trailers:r}),e&&n()})),g.on("drain",A),this.res=g;return!0!==(void 0!==g.writableNeedDrain?g.writableNeedDrain:g._writableState?.needDrain)}onData(e){const{res:t}=this;return!t||t.write(e)}onComplete(e){const{res:t}=this;l(this),t&&(this.trailers=a.parseHeaders(e),t.end())}onError(e){const{res:t,callback:A,opaque:s,body:r}=this;l(this),this.factory=null,t?(this.res=null,a.destroy(t,e)):A&&(this.callback=null,queueMicrotask((()=>{this.runInAsyncScope(A,null,e,{opaque:s})}))),r&&(this.body=null,a.destroy(r,e))}}e.exports=function e(t,A,s){if(void 0===s)return new Promise(((s,r)=>{e.call(this,t,A,((e,t)=>e?r(e):s(t)))}));try{const e=new g(t,A,s);this.dispatch(t,e)}catch(e){if("function"!=typeof s)throw e;const A=t?.opaque;queueMicrotask((()=>s(e,{opaque:A})))}}},3936:(e,t,A)=>{"use strict";const{InvalidArgumentError:s,SocketError:r}=A(4465),{AsyncResource:n}=A(6698),i=A(4589),o=A(2858),{addSignal:a,removeSignal:c}=A(3904);class l extends n{constructor(e,t){if(!e||"object"!=typeof e)throw new s("invalid opts");if("function"!=typeof t)throw new s("invalid callback");const{signal:A,opaque:r,responseHeaders:n}=e;if(A&&"function"!=typeof A.on&&"function"!=typeof A.addEventListener)throw new s("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=n||null,this.opaque=r||null,this.callback=t,this.abort=null,this.context=null,a(this,A)}onConnect(e,t){this.reason?e(this.reason):(i(this.callback),this.abort=e,this.context=null)}onHeaders(){throw new r("bad upgrade",null)}onUpgrade(e,t,A){i(101===e);const{callback:s,opaque:r,context:n}=this;c(this),this.callback=null;const a="raw"===this.responseHeaders?o.parseRawHeaders(t):o.parseHeaders(t);this.runInAsyncScope(s,null,null,{headers:a,socket:A,opaque:r,context:n})}onError(e){const{callback:t,opaque:A}=this;c(this),t&&(this.callback=null,queueMicrotask((()=>{this.runInAsyncScope(t,null,e,{opaque:A})})))}}e.exports=function e(t,A){if(void 0===A)return new Promise(((A,s)=>{e.call(this,t,((e,t)=>e?s(e):A(t)))}));try{const e=new l(t,A),s={...t,method:t.method||"GET",upgrade:t.protocol||"Websocket"};this.dispatch(s,e)}catch(e){if("function"!=typeof A)throw e;const s=t?.opaque;queueMicrotask((()=>A(e,{opaque:s})))}}},9713:(e,t,A)=>{"use strict";e.exports.request=A(7745),e.exports.stream=A(322),e.exports.pipeline=A(8660),e.exports.upgrade=A(3936),e.exports.connect=A(3102)},777:(e,t,A)=>{"use strict";const s=A(4589),{Readable:r}=A(7075),{RequestAbortedError:n,NotSupportedError:i,InvalidArgumentError:o,AbortError:a}=A(4465),c=A(2858),{ReadableStreamFrom:l}=A(2858),h=Symbol("kConsume"),g=Symbol("kReading"),d=Symbol("kBody"),u=Symbol("kAbort"),E=Symbol("kContentType"),I=Symbol("kContentLength"),Q=Symbol("kUsed"),C=Symbol("kBytesRead"),B=()=>{};function p(e){return c.isDisturbed(e)||function(e){return!0===e[d]?.locked||null!==e[h]}(e)}function f(e,t){return s(!e[h]),new Promise(((A,s)=>{if(p(e)){const t=e._readableState;t.destroyed&&!1===t.closeEmitted?e.on("error",s).on("close",(()=>{s(new TypeError("unusable"))})):s(t.errored??new TypeError("unusable"))}else queueMicrotask((()=>{e[h]={type:t,stream:e,resolve:A,reject:s,length:0,body:[]},e.on("error",(function(e){D(this[h],e)})).on("close",(function(){null!==this[h].body&&D(this[h],new n)})),function(e){if(null===e.body)return;const{_readableState:t}=e.stream;if(t.bufferIndex){const A=t.bufferIndex,s=t.buffer.length;for(let r=A;r<s;r++)w(e,t.buffer[r])}else for(const A of t.buffer)w(e,A);t.endEmitted?S(this[h],this._readableState.encoding):e.stream.on("end",(function(){S(this[h],this._readableState.encoding)}));e.stream.resume();for(;null!=e.stream.read(););}(e[h])}))}))}function m(e,t,A){if(0===e.length||0===t)return"";const s=1===e.length?e[0]:Buffer.concat(e,t),r=s.length,n=r>2&&239===s[0]&&187===s[1]&&191===s[2]?3:0;return A&&"utf8"!==A&&"utf-8"!==A?s.subarray(n,r).toString(A):s.utf8Slice(n,r)}function y(e,t){if(0===e.length||0===t)return new Uint8Array(0);if(1===e.length)return new Uint8Array(e[0]);const A=new Uint8Array(Buffer.allocUnsafeSlow(t).buffer);let s=0;for(let t=0;t<e.length;++t){const r=e[t];A.set(r,s),s+=r.length}return A}function S(e,t){const{type:A,body:s,resolve:r,stream:n,length:i}=e;try{"text"===A?r(m(s,i,t)):"json"===A?r(JSON.parse(m(s,i,t))):"arrayBuffer"===A?r(y(s,i).buffer):"blob"===A?r(new Blob(s,{type:n[E]})):"bytes"===A&&r(y(s,i)),D(e)}catch(e){n.destroy(e)}}function w(e,t){e.length+=t.length,e.body.push(t)}function D(e,t){null!==e.body&&(t?e.reject(t):e.resolve(),e.type=null,e.stream=null,e.resolve=null,e.reject=null,e.length=0,e.body=null)}e.exports={Readable:class extends r{constructor({resume:e,abort:t,contentType:A="",contentLength:s,highWaterMark:r=65536}){super({autoDestroy:!0,read:e,highWaterMark:r}),this._readableState.dataEmitted=!1,this[u]=t,this[h]=null,this[C]=0,this[d]=null,this[Q]=!1,this[E]=A,this[I]=Number.isFinite(s)?s:null,this[g]=!1}_destroy(e,t){e||this._readableState.endEmitted||(e=new n),e&&this[u](),this[Q]?t(e):setImmediate(t,e)}on(e,t){return"data"!==e&&"readable"!==e||(this[g]=!0,this[Q]=!0),super.on(e,t)}addListener(e,t){return this.on(e,t)}off(e,t){const A=super.off(e,t);return"data"!==e&&"readable"!==e||(this[g]=this.listenerCount("data")>0||this.listenerCount("readable")>0),A}removeListener(e,t){return this.off(e,t)}push(e){return e&&(this[C]+=e.length,this[h])?(w(this[h],e),!this[g]||super.push(e)):super.push(e)}text(){return f(this,"text")}json(){return f(this,"json")}blob(){return f(this,"blob")}bytes(){return f(this,"bytes")}arrayBuffer(){return f(this,"arrayBuffer")}async formData(){throw new i}get bodyUsed(){return c.isDisturbed(this)}get body(){return this[d]||(this[d]=l(this),this[h]&&(this[d].getReader(),s(this[d].locked))),this[d]}dump(e){const t=e?.signal;if(null!=t&&("object"!=typeof t||!("aborted"in t)))return Promise.reject(new o("signal must be an AbortSignal"));const A=e?.limit&&Number.isFinite(e.limit)?e.limit:131072;return t?.aborted?Promise.reject(t.reason??new a):this._readableState.closeEmitted?Promise.resolve(null):new Promise(((e,s)=>{if((this[I]&&this[I]>A||this[C]>A)&&this.destroy(new a),t){const A=()=>{this.destroy(t.reason??new a)};t.addEventListener("abort",A),this.on("close",(function(){t.removeEventListener("abort",A),t.aborted?s(t.reason??new a):e(null)}))}else this.on("close",e);this.on("error",B).on("data",(()=>{this[C]>A&&this.destroy()})).resume()}))}setEncoding(e){return Buffer.isEncoding(e)&&(this._readableState.encoding=e),this}},chunksDecode:m}},9903:(e,t,A)=>{"use strict";const{Writable:s}=A(7075),{EventEmitter:r}=A(8474),{assertCacheKey:n,assertCacheValue:i}=A(9453);function o(e,t,A){return t.find((t=>t.deleteAt>A&&t.method===e.method&&(null==t.vary||Object.keys(t.vary).every((A=>null===t.vary[A]?void 0===e.headers[A]:t.vary[A]===e.headers[A])))))}e.exports=class extends r{#e=1024;#t=104857600;#A=5242880;#s=0;#r=0;#n=new Map;#i=!1;constructor(e){if(super(),e){if("object"!=typeof e)throw new TypeError("MemoryCacheStore options must be an object");if(void 0!==e.maxCount){if("number"!=typeof e.maxCount||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("MemoryCacheStore options.maxCount must be a non-negative integer");this.#e=e.maxCount}if(void 0!==e.maxSize){if("number"!=typeof e.maxSize||!Number.isInteger(e.maxSize)||e.maxSize<0)throw new TypeError("MemoryCacheStore options.maxSize must be a non-negative integer");this.#t=e.maxSize}if(void 0!==e.maxEntrySize){if("number"!=typeof e.maxEntrySize||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("MemoryCacheStore options.maxEntrySize must be a non-negative integer");this.#A=e.maxEntrySize}}}get size(){return this.#s}isFull(){return this.#s>=this.#t||this.#r>=this.#e}get(e){n(e);const t=`${e.origin}:${e.path}`,A=Date.now(),s=this.#n.get(t),r=s?o(e,s,A):null;return null==r?void 0:{statusMessage:r.statusMessage,statusCode:r.statusCode,headers:r.headers,body:r.body,vary:r.vary?r.vary:void 0,etag:r.etag,cacheControlDirectives:r.cacheControlDirectives,cachedAt:r.cachedAt,staleAt:r.staleAt,deleteAt:r.deleteAt}}createWriteStream(e,t){n(e),i(t);const A=`${e.origin}:${e.path}`,r=this,a={...e,...t,body:[],size:0};return new s({write(e,t,A){"string"==typeof e&&(e=Buffer.from(e,t)),a.size+=e.byteLength,a.size>=r.#A?this.destroy():a.body.push(e),A(null)},final(t){let s=r.#n.get(A);s||(s=[],r.#n.set(A,s));const n=o(e,s,Date.now());if(n){const e=s.indexOf(n);s.splice(e,1,a),r.#s-=n.size}else s.push(a),r.#r+=1;if(r.#s+=a.size,r.#s>r.#t||r.#r>r.#e){r.#i||(r.emit("maxSizeExceeded",{size:r.#s,maxSize:r.#t,count:r.#r,maxCount:r.#e}),r.#i=!0);for(const[e,t]of r.#n){for(const e of t.splice(0,t.length/2))r.#s-=e.size,r.#r-=1;0===t.length&&r.#n.delete(e)}r.#s<r.#t&&r.#r<r.#e&&(r.#i=!1)}t(null)}})}delete(e){if("object"!=typeof e)throw new TypeError("expected key to be object, got "+typeof e);const t=`${e.origin}:${e.path}`;for(const e of this.#n.get(t)??[])this.#s-=e.size,this.#r-=1;this.#n.delete(t)}}},2636:(e,t,A)=>{"use strict";const{Writable:s}=A(7075),{assertCacheKey:r,assertCacheValue:n}=A(9453);let i;const o=2e9;function a(e,t){return null==e&&null==t||!(null==e&&null!=t||null!=e&&null==t)&&(Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every(((e,A)=>e===t[A])):e===t)}e.exports=class{#A=o;#e=1/0;#o;#a;#c;#l;#h;#g;#d;#u;constructor(e){if(e){if("object"!=typeof e)throw new TypeError("SqliteCacheStore options must be an object");if(void 0!==e.maxEntrySize){if("number"!=typeof e.maxEntrySize||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("SqliteCacheStore options.maxEntrySize must be a non-negative integer");if(e.maxEntrySize>o)throw new TypeError("SqliteCacheStore options.maxEntrySize must be less than 2gb");this.#A=e.maxEntrySize}if(void 0!==e.maxCount){if("number"!=typeof e.maxCount||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("SqliteCacheStore options.maxCount must be a non-negative integer");this.#e=e.maxCount}}i||(i=A(99).DatabaseSync),this.#o=new i(e?.location??":memory:"),this.#o.exec("\n PRAGMA journal_mode = WAL;\n PRAGMA synchronous = NORMAL;\n PRAGMA temp_store = memory;\n PRAGMA optimize;\n\n CREATE TABLE IF NOT EXISTS cacheInterceptorV3 (\n -- Data specific to us\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n url TEXT NOT NULL,\n method TEXT NOT NULL,\n\n -- Data returned to the interceptor\n body BUF NULL,\n deleteAt INTEGER NOT NULL,\n statusCode INTEGER NOT NULL,\n statusMessage TEXT NOT NULL,\n headers TEXT NULL,\n cacheControlDirectives TEXT NULL,\n etag TEXT NULL,\n vary TEXT NULL,\n cachedAt INTEGER NOT NULL,\n staleAt INTEGER NOT NULL\n );\n\n CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV3_getValuesQuery ON cacheInterceptorV3(url, method, deleteAt);\n CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV3_deleteByUrlQuery ON cacheInterceptorV3(deleteAt);\n "),this.#a=this.#o.prepare("\n SELECT\n id,\n body,\n deleteAt,\n statusCode,\n statusMessage,\n headers,\n etag,\n cacheControlDirectives,\n vary,\n cachedAt,\n staleAt\n FROM cacheInterceptorV3\n WHERE\n url = ?\n AND method = ?\n ORDER BY\n deleteAt ASC\n "),this.#c=this.#o.prepare("\n UPDATE cacheInterceptorV3 SET\n body = ?,\n deleteAt = ?,\n statusCode = ?,\n statusMessage = ?,\n headers = ?,\n etag = ?,\n cacheControlDirectives = ?,\n cachedAt = ?,\n staleAt = ?\n WHERE\n id = ?\n "),this.#l=this.#o.prepare("\n INSERT INTO cacheInterceptorV3 (\n url,\n method,\n body,\n deleteAt,\n statusCode,\n statusMessage,\n headers,\n etag,\n cacheControlDirectives,\n vary,\n cachedAt,\n staleAt\n ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\n "),this.#g=this.#o.prepare("DELETE FROM cacheInterceptorV3 WHERE url = ?"),this.#d=this.#o.prepare("SELECT COUNT(*) AS total FROM cacheInterceptorV3"),this.#h=this.#o.prepare("DELETE FROM cacheInterceptorV3 WHERE deleteAt <= ?"),this.#u=this.#e===1/0?null:this.#o.prepare("\n DELETE FROM cacheInterceptorV3\n WHERE id IN (\n SELECT\n id\n FROM cacheInterceptorV3\n ORDER BY cachedAt DESC\n LIMIT ?\n )\n ")}close(){this.#o.close()}get(e){r(e);const t=this.#E(e);return t?{body:t.body?Buffer.from(t.body.buffer,t.body.byteOffset,t.body.byteLength):void 0,statusCode:t.statusCode,statusMessage:t.statusMessage,headers:t.headers?JSON.parse(t.headers):void 0,etag:t.etag?t.etag:void 0,vary:t.vary?JSON.parse(t.vary):void 0,cacheControlDirectives:t.cacheControlDirectives?JSON.parse(t.cacheControlDirectives):void 0,cachedAt:t.cachedAt,staleAt:t.staleAt,deleteAt:t.deleteAt}:void 0}set(e,t){r(e);const A=this.#I(e),s=Array.isArray(t.body)?Buffer.concat(t.body):t.body,n=s?.byteLength;if(n&&n>this.#A)return;const i=this.#E(e,!0);i?this.#c.run(s,t.deleteAt,t.statusCode,t.statusMessage,t.headers?JSON.stringify(t.headers):null,t.etag?t.etag:null,t.cacheControlDirectives?JSON.stringify(t.cacheControlDirectives):null,t.cachedAt,t.staleAt,i.id):(this.#Q(),this.#l.run(A,e.method,s,t.deleteAt,t.statusCode,t.statusMessage,t.headers?JSON.stringify(t.headers):null,t.etag?t.etag:null,t.cacheControlDirectives?JSON.stringify(t.cacheControlDirectives):null,t.vary?JSON.stringify(t.vary):null,t.cachedAt,t.staleAt))}createWriteStream(e,t){r(e),n(t);let A=0;const i=[],o=this;return new s({decodeStrings:!0,write(e,t,s){A+=e.byteLength,A<o.#A?i.push(e):this.destroy(),s()},final(A){o.set(e,{...t,body:i}),A()}})}delete(e){if("object"!=typeof e)throw new TypeError("expected key to be object, got "+typeof e);this.#g.run(this.#I(e))}#Q(){if(Number.isFinite(this.#e)&&this.size<=this.#e)return 0;{const e=this.#h.run(Date.now()).changes;if(e)return e}{const e=this.#u?.run(Math.max(Math.floor(.1*this.#e),1)).changes;if(e)return e}return 0}get size(){const{total:e}=this.#d.get();return e}#I(e){return`${e.origin}/${e.path}`}#E(e,t=!1){const A=this.#I(e),{headers:s,method:r}=e,n=this.#a.all(A,r);if(0===n.length)return;const i=Date.now();for(const e of n){if(i>=e.deleteAt&&!t)return;let A=!0;if(e.vary){const t=JSON.parse(e.vary);for(const e in t)if(!a(s[e],t[e])){A=!1;break}}if(A)return e}}}},1986:(e,t,A)=>{"use strict";const s=A(7030),r=A(4589),n=A(2858),{InvalidArgumentError:i}=A(4465);let o;const a=class{constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new FinalizationRegistry((e=>{if(this._sessionCache.size<this._maxCachedSessions)return;const t=this._sessionCache.get(e);void 0!==t&&void 0===t.deref()&&this._sessionCache.delete(e)}))}get(e){const t=this._sessionCache.get(e);return t?t.deref():null}set(e,t){0!==this._maxCachedSessions&&(this._sessionCache.set(e,new WeakRef(t)),this._sessionRegistry.register(t,e))}};e.exports=function({allowH2:e,maxCachedSessions:t,socketPath:c,timeout:l,session:h,...g}){if(null!=t&&(!Number.isInteger(t)||t<0))throw new i("maxCachedSessions must be a positive integer or zero");const d={path:c,...g},u=new a(null==t?100:t);return l=null==l?1e4:l,e=null!=e&&e,function({hostname:t,host:i,protocol:a,port:c,servername:g,localAddress:E,httpSocket:I},Q){let C;if("https:"===a){o||(o=A(1692));const s=(g=g||d.servername||n.getServerName(i)||null)||t;r(s);const a=h||u.get(s)||null;c=c||443,C=o.connect({highWaterMark:16384,...d,servername:g,session:a,localAddress:E,ALPNProtocols:e?["http/1.1","h2"]:["http/1.1"],socket:I,port:c,host:t}),C.on("session",(function(e){u.set(s,e)}))}else r(!I,"httpSocket can only be sent on TLS update"),c=c||80,C=s.connect({highWaterMark:65536,...d,localAddress:E,port:c,host:t});if(null==d.keepAlive||d.keepAlive){const e=void 0===d.keepAliveInitialDelay?6e4:d.keepAliveInitialDelay;C.setKeepAlive(!0,e)}const B=n.setupConnectTimeout(new WeakRef(C),{timeout:l,hostname:t,port:c});return C.setNoDelay(!0).once("https:"===a?"secureConnect":"connect",(function(){if(queueMicrotask(B),Q){const e=Q;Q=null,e(null,this)}})).on("error",(function(e){if(queueMicrotask(B),Q){const t=Q;Q=null,t(e)}})),C}}},9605:e=>{"use strict";const t=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"],A={};Object.setPrototypeOf(A,null);const s={};Object.setPrototypeOf(s,null);for(let e=0;e<t.length;++e){const s=t[e],r=s.toLowerCase();A[s]=A[r]=r}e.exports={wellknownHeaderNames:t,headerNameLowerCasedRecord:A,getHeaderNameAsBuffer:function(e){let t=s[e];return void 0===t&&(t=Buffer.from(e)),t}}},772:(e,t,A)=>{"use strict";const s=A(3053),r=A(7975),n=r.debuglog("undici"),i=r.debuglog("fetch"),o=r.debuglog("websocket"),a={beforeConnect:s.channel("undici:client:beforeConnect"),connected:s.channel("undici:client:connected"),connectError:s.channel("undici:client:connectError"),sendHeaders:s.channel("undici:client:sendHeaders"),create:s.channel("undici:request:create"),bodySent:s.channel("undici:request:bodySent"),bodyChunkSent:s.channel("undici:request:bodyChunkSent"),bodyChunkReceived:s.channel("undici:request:bodyChunkReceived"),headers:s.channel("undici:request:headers"),trailers:s.channel("undici:request:trailers"),error:s.channel("undici:request:error"),open:s.channel("undici:websocket:open"),close:s.channel("undici:websocket:close"),socketError:s.channel("undici:websocket:socket_error"),ping:s.channel("undici:websocket:ping"),pong:s.channel("undici:websocket:pong")};let c=!1;function l(e=n){c||(c=!0,s.subscribe("undici:client:beforeConnect",(t=>{const{connectParams:{version:A,protocol:s,port:r,host:n}}=t;e("connecting to %s%s using %s%s",n,r?`:${r}`:"",s,A)})),s.subscribe("undici:client:connected",(t=>{const{connectParams:{version:A,protocol:s,port:r,host:n}}=t;e("connected to %s%s using %s%s",n,r?`:${r}`:"",s,A)})),s.subscribe("undici:client:connectError",(t=>{const{connectParams:{version:A,protocol:s,port:r,host:n},error:i}=t;e("connection to %s%s using %s%s errored - %s",n,r?`:${r}`:"",s,A,i.message)})),s.subscribe("undici:client:sendHeaders",(t=>{const{request:{method:A,path:s,origin:r}}=t;e("sending request to %s %s%s",A,r,s)})))}let h=!1;let g=!1;(n.enabled||i.enabled)&&(l(i.enabled?i:n),function(e=n){h||(h=!0,s.subscribe("undici:request:headers",(t=>{const{request:{method:A,path:s,origin:r},response:{statusCode:n}}=t;e("received response to %s %s%s - HTTP %d",A,r,s,n)})),s.subscribe("undici:request:trailers",(t=>{const{request:{method:A,path:s,origin:r}}=t;e("trailers received from %s %s%s",A,r,s)})),s.subscribe("undici:request:error",(t=>{const{request:{method:A,path:s,origin:r},error:n}=t;e("request to %s %s%s errored - %s",A,r,s,n.message)})))}(i.enabled?i:n)),o.enabled&&(l(n.enabled?n:o),function(e=o){g||(g=!0,s.subscribe("undici:websocket:open",(t=>{const{address:{address:A,port:s}}=t;e("connection opened %s%s",A,s?`:${s}`:"")})),s.subscribe("undici:websocket:close",(t=>{const{websocket:A,code:s,reason:r}=t;e("closed connection to %s - %s %s",A.url,s,r)})),s.subscribe("undici:websocket:socket_error",(t=>{e("connection errored - %s",t.message)})),s.subscribe("undici:websocket:ping",(t=>{e("ping received")})),s.subscribe("undici:websocket:pong",(t=>{e("pong received")})))}(o)),e.exports={channels:a}},4465:e=>{"use strict";const t=Symbol.for("undici.error.UND_ERR");class A extends Error{constructor(e,t){super(e,t),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&!0===e[t]}get[t](){return!0}}const s=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT");class r extends A{constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&!0===e[s]}get[s](){return!0}}const n=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT");class i extends A{constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&!0===e[n]}get[n](){return!0}}const o=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW");class a extends A{constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&!0===e[o]}get[o](){return!0}}const c=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT");class l extends A{constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](e){return e&&!0===e[c]}get[c](){return!0}}const h=Symbol.for("undici.error.UND_ERR_INVALID_ARG");class g extends A{constructor(e){super(e),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](e){return e&&!0===e[h]}get[h](){return!0}}const d=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE");class u extends A{constructor(e){super(e),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](e){return e&&!0===e[d]}get[d](){return!0}}const E=Symbol.for("undici.error.UND_ERR_ABORT");class I extends A{constructor(e){super(e),this.name="AbortError",this.message=e||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](e){return e&&!0===e[E]}get[E](){return!0}}const Q=Symbol.for("undici.error.UND_ERR_ABORTED");class C extends I{constructor(e){super(e),this.name="AbortError",this.message=e||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](e){return e&&!0===e[Q]}get[Q](){return!0}}const B=Symbol.for("undici.error.UND_ERR_INFO");class p extends A{constructor(e){super(e),this.name="InformationalError",this.message=e||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](e){return e&&!0===e[B]}get[B](){return!0}}const f=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH");class m extends A{constructor(e){super(e),this.name="RequestContentLengthMismatchError",this.message=e||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&!0===e[f]}get[f](){return!0}}const y=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH");class S extends A{constructor(e){super(e),this.name="ResponseContentLengthMismatchError",this.message=e||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&!0===e[y]}get[y](){return!0}}const w=Symbol.for("undici.error.UND_ERR_DESTROYED");class D extends A{constructor(e){super(e),this.name="ClientDestroyedError",this.message=e||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](e){return e&&!0===e[w]}get[w](){return!0}}const b=Symbol.for("undici.error.UND_ERR_CLOSED");class N extends A{constructor(e){super(e),this.name="ClientClosedError",this.message=e||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](e){return e&&!0===e[b]}get[b](){return!0}}const R=Symbol.for("undici.error.UND_ERR_SOCKET");class v extends A{constructor(e,t){super(e),this.name="SocketError",this.message=e||"Socket error",this.code="UND_ERR_SOCKET",this.socket=t}static[Symbol.hasInstance](e){return e&&!0===e[R]}get[R](){return!0}}const k=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED");class T extends A{constructor(e){super(e),this.name="NotSupportedError",this.message=e||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](e){return e&&!0===e[k]}get[k](){return!0}}const F=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM");class M extends A{constructor(e){super(e),this.name="MissingUpstreamError",this.message=e||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](e){return e&&!0===e[F]}get[F](){return!0}}const U=Symbol.for("undici.error.UND_ERR_HTTP_PARSER");class L extends Error{constructor(e,t,A){super(e),this.name="HTTPParserError",this.code=t?`HPE_${t}`:void 0,this.data=A?A.toString():void 0}static[Symbol.hasInstance](e){return e&&!0===e[U]}get[U](){return!0}}const H=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE");class P extends A{constructor(e){super(e),this.name="ResponseExceededMaxSizeError",this.message=e||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](e){return e&&!0===e[H]}get[H](){return!0}}const x=Symbol.for("undici.error.UND_ERR_REQ_RETRY");class Y extends A{constructor(e,t,{headers:A,data:s}){super(e),this.name="RequestRetryError",this.message=e||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=t,this.data=s,this.headers=A}static[Symbol.hasInstance](e){return e&&!0===e[x]}get[x](){return!0}}const V=Symbol.for("undici.error.UND_ERR_RESPONSE");class G extends A{constructor(e,t,{headers:A,body:s}){super(e),this.name="ResponseError",this.message=e||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=t,this.body=s,this.headers=A}static[Symbol.hasInstance](e){return e&&!0===e[V]}get[V](){return!0}}const O=Symbol.for("undici.error.UND_ERR_PRX_TLS");class J extends A{constructor(e,t,A={}){super(t,{cause:e,...A}),this.name="SecureProxyConnectionError",this.message=t||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=e}static[Symbol.hasInstance](e){return e&&!0===e[O]}get[O](){return!0}}const W=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED");class _ extends A{constructor(e){super(e),this.name="MaxOriginsReachedError",this.message=e||"Maximum allowed origins reached",this.code="UND_ERR_MAX_ORIGINS_REACHED"}static[Symbol.hasInstance](e){return e&&!0===e[W]}get[W](){return!0}}e.exports={AbortError:I,HTTPParserError:L,UndiciError:A,HeadersTimeoutError:i,HeadersOverflowError:a,BodyTimeoutError:l,RequestContentLengthMismatchError:m,ConnectTimeoutError:r,InvalidArgumentError:g,InvalidReturnValueError:u,RequestAbortedError:C,ClientDestroyedError:D,ClientClosedError:N,InformationalError:p,SocketError:v,NotSupportedError:T,ResponseContentLengthMismatchError:S,BalancedPoolMissingUpstreamError:M,ResponseExceededMaxSizeError:P,RequestRetryError:Y,ResponseError:G,SecureProxyConnectionError:J,MaxOriginsReachedError:_}},5837:(e,t,A)=>{"use strict";const{InvalidArgumentError:s,NotSupportedError:r}=A(4465),n=A(4589),{isValidHTTPToken:i,isValidHeaderValue:o,isStream:a,destroy:c,isBuffer:l,isFormDataLike:h,isIterable:g,isBlobLike:d,serializePathWithQuery:u,assertRequestHandler:E,getServerName:I,normalizedMethodRecords:Q,getProtocolFromUrlString:C}=A(2858),{channels:B}=A(772),{headerNameLowerCasedRecord:p}=A(9605),f=/[^\u0021-\u00ff]/,m=Symbol("handler");function y(e,t,A){if(A&&"object"==typeof A&&!Array.isArray(A))throw new s(`invalid ${t} header`);if(void 0===A)return;let n=p[t];if(void 0===n&&(n=t.toLowerCase(),void 0===p[n]&&!i(n)))throw new s("invalid header key");if(Array.isArray(A)){const e=[];for(let r=0;r<A.length;r++)if("string"==typeof A[r]){if(!o(A[r]))throw new s(`invalid ${t} header`);e.push(A[r])}else if(null===A[r])e.push("");else{if("object"==typeof A[r])throw new s(`invalid ${t} header`);e.push(`${A[r]}`)}A=e}else if("string"==typeof A){if(!o(A))throw new s(`invalid ${t} header`)}else A=null===A?"":`${A}`;if(null===e.host&&"host"===n){if("string"!=typeof A)throw new s("invalid host header");e.host=A}else if(null===e.contentLength&&"content-length"===n){if(e.contentLength=parseInt(A,10),!Number.isFinite(e.contentLength))throw new s("invalid content-length header")}else if(null===e.contentType&&"content-type"===n)e.contentType=A,e.headers.push(t,A);else{if("transfer-encoding"===n||"keep-alive"===n||"upgrade"===n)throw new s(`invalid ${n} header`);if("connection"===n){const t="string"==typeof A?A.toLowerCase():null;if("close"!==t&&"keep-alive"!==t)throw new s("invalid connection header");"close"===t&&(e.reset=!0)}else{if("expect"===n)throw new r("expect header not supported");e.headers.push(t,A)}}}e.exports=class{constructor(e,{path:t,method:A,body:r,headers:n,query:o,idempotent:p,blocking:S,upgrade:w,headersTimeout:D,bodyTimeout:b,reset:N,expectContinue:R,servername:v,throwOnError:k,maxRedirections:T},F){if("string"!=typeof t)throw new s("path must be a string");if("/"!==t[0]&&!t.startsWith("http://")&&!t.startsWith("https://")&&"CONNECT"!==A)throw new s("path must be an absolute URL or start with a slash");if(f.test(t))throw new s("invalid request path");if("string"!=typeof A)throw new s("method must be a string");if(void 0===Q[A]&&!i(A))throw new s("invalid request method");if(w&&"string"!=typeof w)throw new s("upgrade must be a string");if(null!=D&&(!Number.isFinite(D)||D<0))throw new s("invalid headersTimeout");if(null!=b&&(!Number.isFinite(b)||b<0))throw new s("invalid bodyTimeout");if(null!=N&&"boolean"!=typeof N)throw new s("invalid reset");if(null!=R&&"boolean"!=typeof R)throw new s("invalid expectContinue");if(null!=k)throw new s("invalid throwOnError");if(null!=T&&0!==T)throw new s("maxRedirections is not supported, use the redirect interceptor");if(this.headersTimeout=D,this.bodyTimeout=b,this.method=A,this.abort=null,null==r)this.body=null;else if(a(r)){this.body=r;const e=this.body._readableState;e&&e.autoDestroy||(this.endHandler=function(){c(this)},this.body.on("end",this.endHandler)),this.errorHandler=e=>{this.abort?this.abort(e):this.error=e},this.body.on("error",this.errorHandler)}else if(l(r))this.body=r.byteLength?r:null;else if(ArrayBuffer.isView(r))this.body=r.buffer.byteLength?Buffer.from(r.buffer,r.byteOffset,r.byteLength):null;else if(r instanceof ArrayBuffer)this.body=r.byteLength?Buffer.from(r):null;else if("string"==typeof r)this.body=r.length?Buffer.from(r):null;else{if(!(h(r)||g(r)||d(r)))throw new s("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");this.body=r}if(this.completed=!1,this.aborted=!1,this.upgrade=w||null,this.path=o?u(t,o):t,this.origin=e,this.protocol=C(e),this.idempotent=null==p?"HEAD"===A||"GET"===A:p,this.blocking=S??"HEAD"!==this.method,this.reset=null==N?null:N,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=null!=R&&R,Array.isArray(n)){if(n.length%2!=0)throw new s("headers array must be even");for(let e=0;e<n.length;e+=2)y(this,n[e],n[e+1])}else if(n&&"object"==typeof n)if(n[Symbol.iterator])for(const e of n){if(!Array.isArray(e)||2!==e.length)throw new s("headers must be in key-value pair format");y(this,e[0],e[1])}else{const e=Object.keys(n);for(let t=0;t<e.length;++t)y(this,e[t],n[e[t]])}else if(null!=n)throw new s("headers must be an object or an array");E(F,A,w),this.servername=v||I(this.host)||null,this[m]=F,B.create.hasSubscribers&&B.create.publish({request:this})}onBodySent(e){if(B.bodyChunkSent.hasSubscribers&&B.bodyChunkSent.publish({request:this,chunk:e}),this[m].onBodySent)try{return this[m].onBodySent(e)}catch(e){this.abort(e)}}onRequestSent(){if(B.bodySent.hasSubscribers&&B.bodySent.publish({request:this}),this[m].onRequestSent)try{return this[m].onRequestSent()}catch(e){this.abort(e)}}onConnect(e){if(n(!this.aborted),n(!this.completed),!this.error)return this.abort=e,this[m].onConnect(e);e(this.error)}onResponseStarted(){return this[m].onResponseStarted?.()}onHeaders(e,t,A,s){n(!this.aborted),n(!this.completed),B.headers.hasSubscribers&&B.headers.publish({request:this,response:{statusCode:e,headers:t,statusText:s}});try{return this[m].onHeaders(e,t,A,s)}catch(e){this.abort(e)}}onData(e){n(!this.aborted),n(!this.completed),B.bodyChunkReceived.hasSubscribers&&B.bodyChunkReceived.publish({request:this,chunk:e});try{return this[m].onData(e)}catch(e){return this.abort(e),!1}}onUpgrade(e,t,A){return n(!this.aborted),n(!this.completed),this[m].onUpgrade(e,t,A)}onComplete(e){this.onFinally(),n(!this.aborted),n(!this.completed),this.completed=!0,B.trailers.hasSubscribers&&B.trailers.publish({request:this,trailers:e});try{return this[m].onComplete(e)}catch(e){this.onError(e)}}onError(e){if(this.onFinally(),B.error.hasSubscribers&&B.error.publish({request:this,error:e}),!this.aborted)return this.aborted=!0,this[m].onError(e)}onFinally(){this.errorHandler&&(this.body.off("error",this.errorHandler),this.errorHandler=null),this.endHandler&&(this.body.off("end",this.endHandler),this.endHandler=null)}addHeader(e,t){return y(this,e,t),this}}},257:e=>{"use strict";e.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent")}},1310:(e,t,A)=>{"use strict";const{wellknownHeaderNames:s,headerNameLowerCasedRecord:r}=A(9605);class n{value=null;left=null;middle=null;right=null;code;constructor(e,t,A){if(void 0===A||A>=e.length)throw new TypeError("Unreachable");if((this.code=e.charCodeAt(A))>127)throw new TypeError("key must be ascii string");e.length!==++A?this.middle=new n(e,t,A):this.value=t}add(e,t){const A=e.length;if(0===A)throw new TypeError("Unreachable");let s=0,r=this;for(;;){const i=e.charCodeAt(s);if(i>127)throw new TypeError("key must be ascii string");if(r.code===i){if(A===++s){r.value=t;break}if(null===r.middle){r.middle=new n(e,t,s);break}r=r.middle}else if(r.code<i){if(null===r.left){r.left=new n(e,t,s);break}r=r.left}else{if(null===r.right){r.right=new n(e,t,s);break}r=r.right}}}search(e){const t=e.length;let A=0,s=this;for(;null!==s&&A<t;){let r=e[A];for(r<=90&&r>=65&&(r|=32);null!==s;){if(r===s.code){if(t===++A)return s;s=s.middle;break}s=s.code<r?s.left:s.right}}return null}}class i{node=null;insert(e,t){null===this.node?this.node=new n(e,t,0):this.node.add(e,t)}lookup(e){return this.node?.search(e)?.value??null}}const o=new i;for(let e=0;e<s.length;++e){const t=r[s[e]];o.insert(t,t)}e.exports={TernarySearchTree:i,tree:o}},2858:(e,t,A)=>{"use strict";const s=A(4589),{kDestroyed:r,kBodyUsed:n,kListeners:i,kBody:o}=A(257),{IncomingMessage:a}=A(7067),c=A(7075),l=A(7030),{stringify:h}=A(1792),{EventEmitter:g}=A(8474),d=A(3801),{InvalidArgumentError:u,ConnectTimeoutError:E}=A(4465),{headerNameLowerCasedRecord:I}=A(9605),{tree:Q}=A(1310),[C,B]=process.versions.node.split(".",2).map((e=>Number(e)));class p{constructor(e){this[o]=e,this[n]=!1}async*[Symbol.asyncIterator](){s(!this[n],"disturbed"),this[n]=!0,yield*this[o]}}function f(){}function m(e){return e&&"object"==typeof e&&"function"==typeof e.pipe&&"function"==typeof e.on}function y(e){if(null===e)return!1;if(e instanceof Blob)return!0;if("object"!=typeof e)return!1;{const t=e[Symbol.toStringTag];return("Blob"===t||"File"===t)&&("stream"in e&&"function"==typeof e.stream||"arrayBuffer"in e&&"function"==typeof e.arrayBuffer)}}function S(e){return e.includes("?")||e.includes("#")}function w(e){const t=parseInt(e,10);return t===Number(e)&&t>=0&&t<=65535}function D(e){return null!=e&&"h"===e[0]&&"t"===e[1]&&"t"===e[2]&&"p"===e[3]&&(":"===e[4]||"s"===e[4]&&":"===e[5])}function b(e){if("string"==typeof e){if(!D((e=new URL(e)).origin||e.protocol))throw new u("Invalid URL protocol: the URL must start with `http:` or `https:`.");return e}if(!e||"object"!=typeof e)throw new u("Invalid URL: The URL argument must be a non-null object.");if(!(e instanceof URL)){if(null!=e.port&&""!==e.port&&!1===w(e.port))throw new u("Invalid URL: port must be a valid integer or a string representation of an integer.");if(null!=e.path&&"string"!=typeof e.path)throw new u("Invalid URL path: the path must be a string or null/undefined.");if(null!=e.pathname&&"string"!=typeof e.pathname)throw new u("Invalid URL pathname: the pathname must be a string or null/undefined.");if(null!=e.hostname&&"string"!=typeof e.hostname)throw new u("Invalid URL hostname: the hostname must be a string or null/undefined.");if(null!=e.origin&&"string"!=typeof e.origin)throw new u("Invalid URL origin: the origin must be a string or null/undefined.");if(!D(e.origin||e.protocol))throw new u("Invalid URL protocol: the URL must start with `http:` or `https:`.");const t=null!=e.port?e.port:"https:"===e.protocol?443:80;let A=null!=e.origin?e.origin:`${e.protocol||""}//${e.hostname||""}:${t}`,s=null!=e.path?e.path:`${e.pathname||""}${e.search||""}`;return"/"===A[A.length-1]&&(A=A.slice(0,A.length-1)),s&&"/"!==s[0]&&(s=`/${s}`),new URL(`${A}${s}`)}if(!D(e.origin||e.protocol))throw new u("Invalid URL protocol: the URL must start with `http:` or `https:`.");return e}function N(e){return!(null==e||"function"!=typeof e[Symbol.iterator]&&"function"!=typeof e[Symbol.asyncIterator])}function R(e){if(null==e)return 0;if(m(e)){const t=e._readableState;return t&&!1===t.objectMode&&!0===t.ended&&Number.isFinite(t.length)?t.length:null}return y(e)?null!=e.size?e.size:null:M(e)?e.byteLength:null}function v(e){return e&&!!(e.destroyed||e[r]||c.isDestroyed?.(e))}function k(e,t){null!=e&&m(e)&&!v(e)&&("function"==typeof e.destroy?(Object.getPrototypeOf(e).constructor===a&&(e.socket=null),e.destroy(t)):t&&queueMicrotask((()=>{e.emit("error",t)})),!0!==e.destroyed&&(e[r]=!0))}const T=/timeout=(\d+)/;function F(e){return"string"==typeof e?I[e]??e.toLowerCase():Q.lookup(e)??e.toString("latin1").toLowerCase()}function M(e){return e instanceof Uint8Array||Buffer.isBuffer(e)}function U(e){switch(e){case 34:case 40:case 41:case 44:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 123:case 125:return!1;default:return e>=33&&e<=126}}const L=/[^\t\x20-\x7e\x80-\xff]/;const H=/^bytes (\d+)-(\d+)\/(\d+)?$/;const P="win32"===process.platform?(e,t)=>{if(!t.timeout)return f;let A=null,s=null;const r=d.setFastTimeout((()=>{A=setImmediate((()=>{s=setImmediate((()=>x(e.deref(),t)))}))}),t.timeout);return()=>{d.clearFastTimeout(r),clearImmediate(A),clearImmediate(s)}}:(e,t)=>{if(!t.timeout)return f;let A=null;const s=d.setFastTimeout((()=>{A=setImmediate((()=>{x(e.deref(),t)}))}),t.timeout);return()=>{d.clearFastTimeout(s),clearImmediate(A)}};function x(e,t){if(null==e)return;let A="Connect Timeout Error";Array.isArray(e.autoSelectFamilyAttemptedAddresses)?A+=` (attempted addresses: ${e.autoSelectFamilyAttemptedAddresses.join(", ")},`:A+=` (attempted address: ${t.hostname}:${t.port},`,A+=` timeout: ${t.timeout}ms)`,k(e,new E(A))}const Y=Object.create(null);Y.enumerable=!0;const V={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"},G={...V,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(V,null),Object.setPrototypeOf(G,null),e.exports={kEnumerableProperty:Y,isDisturbed:function(e){return!(!e||!c.isDisturbed(e)&&!e[n])},isBlobLike:y,parseOrigin:function(e){if("/"!==(e=b(e)).pathname||e.search||e.hash)throw new u("invalid url");return e},parseURL:b,getServerName:function(e){if(!e)return null;s("string"==typeof e);const t=function(e){if("["===e[0]){const t=e.indexOf("]");return s(-1!==t),e.substring(1,t)}const t=e.indexOf(":");return-1===t?e:e.substring(0,t)}(e);return l.isIP(t)?"":t},isStream:m,isIterable:N,isAsyncIterable:function(e){return!(null==e||"function"!=typeof e[Symbol.asyncIterator])},isDestroyed:v,headerNameToString:F,bufferToLowerCasedHeaderName:function(e){return Q.lookup(e)??e.toString("latin1").toLowerCase()},addListener:function(e,t,A){return(e[i]??=[]).push([t,A]),e.on(t,A),e},removeAllListeners:function(e){if(null!=e[i]){for(const[t,A]of e[i])e.removeListener(t,A);e[i]=null}return e},errorRequest:function(e,t,A){try{t.onError(A),s(t.aborted)}catch(A){e.emit("error",A)}},parseRawHeaders:function(e){const t=e.length,A=new Array(t);let s,r,n=!1,i=-1,o=0;for(let a=0;a<t;a+=2)s=e[a],r=e[a+1],"string"!=typeof s&&(s=s.toString()),"string"!=typeof r&&(r=r.toString("utf8")),o=s.length,14!==o||"-"!==s[7]||"content-length"!==s&&"content-length"!==s.toLowerCase()?19!==o||"-"!==s[7]||"content-disposition"!==s&&"content-disposition"!==s.toLowerCase()||(i=a+1):n=!0,A[a]=s,A[a+1]=r;return n&&-1!==i&&(A[i]=Buffer.from(A[i]).toString("latin1")),A},encodeRawHeaders:function(e){if(!Array.isArray(e))throw new TypeError("expected headers to be an array");return e.map((e=>Buffer.from(e)))},parseHeaders:function(e,t){void 0===t&&(t={});for(let A=0;A<e.length;A+=2){const s=F(e[A]);let r=t[s];if(r)"string"==typeof r&&(r=[r],t[s]=r),r.push(e[A+1].toString("utf8"));else{const r=e[A+1];t[s]="string"==typeof r?r:Array.isArray(r)?r.map((e=>e.toString("utf8"))):r.toString("utf8")}}return"content-length"in t&&"content-disposition"in t&&(t["content-disposition"]=Buffer.from(t["content-disposition"]).toString("latin1")),t},parseKeepAliveTimeout:function(e){const t=e.match(T);return t?1e3*parseInt(t[1],10):null},destroy:k,bodyLength:R,deepClone:function(e){return JSON.parse(JSON.stringify(e))},ReadableStreamFrom:function(e){let t;return new ReadableStream({start(){t=e[Symbol.asyncIterator]()},pull(e){return t.next().then((({done:t,value:A})=>{if(t)queueMicrotask((()=>{e.close(),e.byobRequest?.respond(0)}));else{const t=Buffer.isBuffer(A)?A:Buffer.from(A);if(!t.byteLength)return this.pull(e);e.enqueue(new Uint8Array(t))}}))},cancel:()=>t.return(),type:"bytes"})},isBuffer:M,assertRequestHandler:function(e,t,A){if(!e||"object"!=typeof e)throw new u("handler must be an object");if("function"!=typeof e.onRequestStart){if("function"!=typeof e.onConnect)throw new u("invalid onConnect method");if("function"!=typeof e.onError)throw new u("invalid onError method");if("function"!=typeof e.onBodySent&&void 0!==e.onBodySent)throw new u("invalid onBodySent method");if(A||"CONNECT"===t){if("function"!=typeof e.onUpgrade)throw new u("invalid onUpgrade method")}else{if("function"!=typeof e.onHeaders)throw new u("invalid onHeaders method");if("function"!=typeof e.onData)throw new u("invalid onData method");if("function"!=typeof e.onComplete)throw new u("invalid onComplete method")}}},getSocketInfo:function(e){return{localAddress:e.localAddress,localPort:e.localPort,remoteAddress:e.remoteAddress,remotePort:e.remotePort,remoteFamily:e.remoteFamily,timeout:e.timeout,bytesWritten:e.bytesWritten,bytesRead:e.bytesRead}},isFormDataLike:function(e){return e&&"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&"FormData"===e[Symbol.toStringTag]},pathHasQueryOrFragment:S,serializePathWithQuery:function(e,t){if(S(e))throw new Error('Query params cannot be passed when url already contains "?" or "#".');const A=h(t);return A&&(e+="?"+A),e},addAbortListener:function(e,t){return"addEventListener"in e?(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)):(e.once("abort",t),()=>e.removeListener("abort",t))},isValidHTTPToken:function(e){if(0===e.length)return!1;for(let t=0;t<e.length;++t)if(!U(e.charCodeAt(t)))return!1;return!0},isValidHeaderValue:function(e){return!L.test(e)},isTokenCharCode:U,parseRangeHeader:function(e){if(null==e||""===e)return{start:0,end:null,size:null};const t=e?e.match(H):null;return t?{start:parseInt(t[1]),end:t[2]?parseInt(t[2]):null,size:t[3]?parseInt(t[3]):null}:null},normalizedMethodRecordsBase:V,normalizedMethodRecords:G,isValidPort:w,isHttpOrHttpsPrefixed:D,nodeMajor:C,nodeMinor:B,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:function(e){return m(e)?(0===R(e)&&e.on("data",(function(){s(!1)})),"boolean"!=typeof e.readableDidRead&&(e[n]=!1,g.prototype.on.call(e,"data",(function(){this[n]=!0}))),e):e&&"function"==typeof e.pipeTo||e&&"string"!=typeof e&&!ArrayBuffer.isView(e)&&N(e)?new p(e):e},setupConnectTimeout:P,getProtocolFromUrlString:function(e){if("h"===e[0]&&"t"===e[1]&&"t"===e[2]&&"p"===e[3])switch(e[4]){case":":return"http:";case"s":if(":"===e[5])return"https:"}return e.slice(0,e.indexOf(":")+1)}}},3315:(e,t,A)=>{"use strict";const{InvalidArgumentError:s,MaxOriginsReachedError:r}=A(4465),{kClients:n,kRunning:i,kClose:o,kDestroy:a,kDispatch:c,kUrl:l}=A(257),h=A(7779),g=A(8542),d=A(1167),u=A(2858),E=Symbol("onConnect"),I=Symbol("onDisconnect"),Q=Symbol("onConnectionError"),C=Symbol("onDrain"),B=Symbol("factory"),p=Symbol("options"),f=Symbol("origins");function m(e,t){return t&&1===t.connections?new d(e,t):new g(e,t)}e.exports=class extends h{constructor({factory:e=m,maxOrigins:t=1/0,connect:A,...r}={}){if("function"!=typeof e)throw new s("factory must be a function.");if(null!=A&&"function"!=typeof A&&"object"!=typeof A)throw new s("connect must be a function or an object");if("number"!=typeof t||Number.isNaN(t)||t<=0)throw new s("maxOrigins must be a number greater than 0");super(),A&&"function"!=typeof A&&(A={...A}),this[p]={...u.deepClone(r),maxOrigins:t,connect:A},this[B]=e,this[n]=new Map,this[f]=new Set,this[C]=(e,t)=>{this.emit("drain",e,[this,...t])},this[E]=(e,t)=>{this.emit("connect",e,[this,...t])},this[I]=(e,t,A)=>{this.emit("disconnect",e,[this,...t],A)},this[Q]=(e,t,A)=>{this.emit("connectionError",e,[this,...t],A)}}get[i](){let e=0;for(const{dispatcher:t}of this[n].values())e+=t[i];return e}[c](e,t){let A;if(!e.origin||!("string"==typeof e.origin||e.origin instanceof URL))throw new s("opts.origin must be a non-empty string or URL.");if(A=String(e.origin),this[f].size>=this[p].maxOrigins&&!this[f].has(A))throw new r;const i=this[n].get(A);let o=i&&i.dispatcher;if(!o){const t=e=>{const t=this[n].get(A);t&&(e&&(t.count-=1),t.count<=0&&(this[n].delete(A),t.dispatcher.close()),this[f].delete(A))};o=this[B](e.origin,this[p]).on("drain",this[C]).on("connect",((e,t)=>{const s=this[n].get(A);s&&(s.count+=1),this[E](e,t)})).on("disconnect",((e,A,s)=>{t(!0),this[I](e,A,s)})).on("connectionError",((e,A,s)=>{t(!1),this[Q](e,A,s)})),this[n].set(A,{count:0,dispatcher:o}),this[f].add(A)}return o.dispatch(e,t)}[o](){const e=[];for(const{dispatcher:t}of this[n].values())e.push(t.close());return this[n].clear(),Promise.all(e)}[a](e){const t=[];for(const{dispatcher:A}of this[n].values())t.push(A.destroy(e));return this[n].clear(),Promise.all(t)}get stats(){const e={};for(const{dispatcher:t}of this[n].values())t.stats&&(e[t[l].origin]=t.stats);return e}}},8055:(e,t,A)=>{"use strict";const{BalancedPoolMissingUpstreamError:s,InvalidArgumentError:r}=A(4465),{PoolBase:n,kClients:i,kNeedDrain:o,kAddClient:a,kRemoveClient:c,kGetDispatcher:l}=A(1694),h=A(8542),{kUrl:g}=A(257),{parseOrigin:d}=A(2858),u=Symbol("factory"),E=Symbol("options"),I=Symbol("kGreatestCommonDivisor"),Q=Symbol("kCurrentWeight"),C=Symbol("kIndex"),B=Symbol("kWeight"),p=Symbol("kMaxWeightPerServer"),f=Symbol("kErrorPenalty");function m(e,t){if(0===e)return t;for(;0!==t;){const A=t;t=e%t,e=A}return e}function y(e,t){return new h(e,t)}e.exports=class extends n{constructor(e=[],{factory:t=y,...A}={}){if("function"!=typeof t)throw new r("factory must be a function.");super(),this[E]=A,this[C]=-1,this[Q]=0,this[p]=this[E].maxWeightPerServer||100,this[f]=this[E].errorPenalty||15,Array.isArray(e)||(e=[e]),this[u]=t;for(const t of e)this.addUpstream(t);this._updateBalancedPoolStats()}addUpstream(e){const t=d(e).origin;if(this[i].find((e=>e[g].origin===t&&!0!==e.closed&&!0!==e.destroyed)))return this;const A=this[u](t,Object.assign({},this[E]));this[a](A),A.on("connect",(()=>{A[B]=Math.min(this[p],A[B]+this[f])})),A.on("connectionError",(()=>{A[B]=Math.max(1,A[B]-this[f]),this._updateBalancedPoolStats()})),A.on("disconnect",((...e)=>{const t=e[2];t&&"UND_ERR_SOCKET"===t.code&&(A[B]=Math.max(1,A[B]-this[f]),this._updateBalancedPoolStats())}));for(const e of this[i])e[B]=this[p];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let t=0;t<this[i].length;t++)e=m(this[i][t][B],e);this[I]=e}removeUpstream(e){const t=d(e).origin,A=this[i].find((e=>e[g].origin===t&&!0!==e.closed&&!0!==e.destroyed));return A&&this[c](A),this}get upstreams(){return this[i].filter((e=>!0!==e.closed&&!0!==e.destroyed)).map((e=>e[g].origin))}[l](){if(0===this[i].length)throw new s;if(!this[i].find((e=>!e[o]&&!0!==e.closed&&!0!==e.destroyed)))return;if(this[i].map((e=>e[o])).reduce(((e,t)=>e&&t),!0))return;let e=0,t=this[i].findIndex((e=>!e[o]));for(;e++<this[i].length;){this[C]=(this[C]+1)%this[i].length;const e=this[i][this[C]];if(e[B]>this[i][t][B]&&!e[o]&&(t=this[C]),0===this[C]&&(this[Q]=this[Q]-this[I],this[Q]<=0&&(this[Q]=this[p])),e[B]>=this[Q]&&!e[o])return e}return this[Q]=this[i][t][B],this[C]=t,this[i][t]}}},9355:(e,t,A)=>{"use strict";const s=A(4589),r=A(2858),{channels:n}=A(772),i=A(3801),{RequestContentLengthMismatchError:o,ResponseContentLengthMismatchError:a,RequestAbortedError:c,HeadersTimeoutError:l,HeadersOverflowError:h,SocketError:g,InformationalError:d,BodyTimeoutError:u,HTTPParserError:E,ResponseExceededMaxSizeError:I}=A(4465),{kUrl:Q,kReset:C,kClient:B,kParser:p,kBlocking:f,kRunning:m,kPending:y,kSize:S,kWriting:w,kQueue:D,kNoRef:b,kKeepAliveDefaultTimeout:N,kHostHeader:R,kPendingIdx:v,kRunningIdx:k,kError:T,kPipelining:F,kSocket:M,kKeepAliveTimeoutValue:U,kMaxHeadersSize:L,kKeepAliveMaxTimeout:H,kKeepAliveTimeoutThreshold:P,kHeadersTimeout:x,kBodyTimeout:Y,kStrictContentLength:V,kMaxRequests:G,kCounter:O,kMaxResponseSize:J,kOnError:W,kResume:_,kHTTPContext:q,kClosed:$}=A(257),X=A(4178),z=Buffer.alloc(0),Z=Buffer[Symbol.species],j=r.removeAllListeners;let K;let ee=null,te=null,Ae=null,se=0,re=null;class ne{constructor(e,t,{exports:A}){this.llhttp=A,this.ptr=this.llhttp.llhttp_alloc(X.TYPE.RESPONSE),this.client=e,this.socket=t,this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.statusCode=0,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[L],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[J]}setTimeout(e,t){e!==this.timeoutValue||1&t^1&this.timeoutType?(this.timeout&&(i.clearTimeout(this.timeout),this.timeout=null),e&&(1&t?this.timeout=i.setFastTimeout(ie,e,new WeakRef(this)):(this.timeout=setTimeout(ie,e,new WeakRef(this)),this.timeout?.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=t}resume(){!this.socket.destroyed&&this.paused&&(s(null!=this.ptr),s(null===te),this.llhttp.llhttp_resume(this.ptr),s(5===this.timeoutType),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||z),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){const e=this.socket.read();if(null===e)break;this.execute(e)}}execute(e){s(null===te),s(null!=this.ptr),s(!this.paused);const{socket:t,llhttp:A}=this;e.length>se&&(re&&A.free(re),se=4096*Math.ceil(e.length/4096),re=A.malloc(se)),new Uint8Array(A.memory.buffer,re,se).set(e);try{let s;try{Ae=e,te=this,s=A.llhttp_execute(this.ptr,re,e.length)}finally{te=null,Ae=null}if(s!==X.ERROR.OK){const r=e.subarray(A.llhttp_get_error_pos(this.ptr)-re);if(s===X.ERROR.PAUSED_UPGRADE)this.onUpgrade(r);else{if(s!==X.ERROR.PAUSED){const e=A.llhttp_get_error_reason(this.ptr);let t="";if(e){const s=new Uint8Array(A.memory.buffer,e).indexOf(0);t="Response does not match the HTTP/1.1 protocol ("+Buffer.from(A.memory.buffer,e,s).toString()+")"}throw new E(t,X.ERROR[s],r)}this.paused=!0,t.unshift(r)}}}catch(e){r.destroy(t,e)}}destroy(){s(null===te),s(null!=this.ptr),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&i.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){return this.statusText=e.toString(),0}onMessageBegin(){const{socket:e,client:t}=this;if(e.destroyed)return-1;const A=t[D][t[k]];return A?(A.onResponseStarted(),0):-1}onHeaderField(e){const t=this.headers.length;return 1&t?this.headers[t-1]=Buffer.concat([this.headers[t-1],e]):this.headers.push(e),this.trackHeader(e.length),0}onHeaderValue(e){let t=this.headers.length;1&~t?this.headers[t-1]=Buffer.concat([this.headers[t-1],e]):(this.headers.push(e),t+=1);const A=this.headers[t-2];if(10===A.length){const t=r.bufferToLowerCasedHeaderName(A);"keep-alive"===t?this.keepAlive+=e.toString():"connection"===t&&(this.connection+=e.toString())}else 14===A.length&&"content-length"===r.bufferToLowerCasedHeaderName(A)&&(this.contentLength+=e.toString());return this.trackHeader(e.length),0}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&r.destroy(this.socket,new h)}onUpgrade(e){const{upgrade:t,client:A,socket:n,headers:i,statusCode:o}=this;s(t),s(A[M]===n),s(!n.destroyed),s(!this.paused),s(!(1&i.length));const a=A[D][A[k]];s(a),s(a.upgrade||"CONNECT"===a.method),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,n.unshift(e),n[p].destroy(),n[p]=null,n[B]=null,n[T]=null,j(n),A[M]=null,A[q]=null,A[D][A[k]++]=null,A.emit("disconnect",A[Q],[A],new d("upgrade"));try{a.onUpgrade(o,i,n)}catch(e){r.destroy(n,e)}A[_]()}onHeadersComplete(e,t,A){const{client:n,socket:i,headers:o,statusText:a}=this;if(i.destroyed)return-1;const c=n[D][n[k]];if(!c)return-1;if(s(!this.upgrade),s(this.statusCode<200),100===e)return r.destroy(i,new g("bad response",r.getSocketInfo(i))),-1;if(t&&!c.upgrade)return r.destroy(i,new g("bad upgrade",r.getSocketInfo(i))),-1;if(s(3===this.timeoutType),this.statusCode=e,this.shouldKeepAlive=A||"HEAD"===c.method&&!i[C]&&"keep-alive"===this.connection.toLowerCase(),this.statusCode>=200){const e=null!=c.bodyTimeout?c.bodyTimeout:n[Y];this.setTimeout(e,5)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if("CONNECT"===c.method)return s(1===n[m]),this.upgrade=!0,2;if(t)return s(1===n[m]),this.upgrade=!0,2;if(s(!(1&this.headers.length)),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&n[F]){const e=this.keepAlive?r.parseKeepAliveTimeout(this.keepAlive):null;if(null!=e){const t=Math.min(e-n[P],n[H]);t<=0?i[C]=!0:n[U]=t}else n[U]=n[N]}else i[C]=!0;const l=!1===c.onHeaders(e,o,this.resume,a);return c.aborted?-1:"HEAD"===c.method||e<200?1:(i[f]&&(i[f]=!1,n[_]()),l?X.ERROR.PAUSED:0)}onBody(e){const{client:t,socket:A,statusCode:n,maxResponseSize:i}=this;if(A.destroyed)return-1;const o=t[D][t[k]];return s(o),s(5===this.timeoutType),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),s(n>=200),i>-1&&this.bytesRead+e.length>i?(r.destroy(A,new I),-1):(this.bytesRead+=e.length,!1===o.onData(e)?X.ERROR.PAUSED:0)}onMessageComplete(){const{client:e,socket:t,statusCode:A,upgrade:n,headers:i,contentLength:o,bytesRead:c,shouldKeepAlive:l}=this;if(t.destroyed&&(!A||l))return-1;if(n)return 0;s(A>=100),s(!(1&this.headers.length));const h=e[D][e[k]];return s(h),this.statusCode=0,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,A<200?0:"HEAD"!==h.method&&o&&c!==parseInt(o,10)?(r.destroy(t,new a),-1):(h.onComplete(i),e[D][e[k]++]=null,t[w]?(s(0===e[m]),r.destroy(t,new d("reset")),X.ERROR.PAUSED):l?t[C]&&0===e[m]?(r.destroy(t,new d("reset")),X.ERROR.PAUSED):(null==e[F]||1===e[F]?setImmediate(e[_]):e[_](),0):(r.destroy(t,new d("reset")),X.ERROR.PAUSED))}}function ie(e){const{socket:t,timeoutType:A,client:n,paused:i}=e.deref();3===A?(!t[w]||t.writableNeedDrain||n[m]>1)&&(s(!i,"cannot be paused while waiting for headers"),r.destroy(t,new l)):5===A?i||r.destroy(t,new u):8===A&&(s(0===n[m]&&n[U]),r.destroy(t,new d("socket idle timeout")))}function oe(e){s("ERR_TLS_CERT_ALTNAME_INVALID"!==e.code);const t=this[p];"ECONNRESET"!==e.code||!t.statusCode||t.shouldKeepAlive?(this[T]=e,this[B][W](e)):t.onMessageComplete()}function ae(){this[p]?.readMore()}function ce(){const e=this[p];!e.statusCode||e.shouldKeepAlive?r.destroy(this,new g("other side closed",r.getSocketInfo(this))):e.onMessageComplete()}function le(){const e=this[p];e&&(this[T]||!e.statusCode||e.shouldKeepAlive||e.onMessageComplete(),this[p].destroy(),this[p]=null);const t=this[T]||new g("closed",r.getSocketInfo(this)),A=this[B];if(A[M]=null,A[q]=null,A.destroyed){s(0===A[y]);const e=A[D].splice(A[k]);for(let s=0;s<e.length;s++){const n=e[s];r.errorRequest(A,n,t)}}else if(A[m]>0&&"UND_ERR_INFO"!==t.code){const e=A[D][A[k]];A[D][A[k]++]=null,r.errorRequest(A,e,t)}A[v]=A[k],s(0===A[m]),A.emit("disconnect",A[Q],[A],t),A[_]()}function he(){this[$]=!0}function ge(e,t,A,n,i,o,a,c){try{t?r.isBuffer(t)&&(s(o===t.byteLength,"buffer body must have content length"),i.cork(),i.write(`${a}content-length: ${o}\r\n\r\n`,"latin1"),i.write(t),i.uncork(),n.onBodySent(t),c||!1===n.reset||(i[C]=!0)):0===o?i.write(`${a}content-length: 0\r\n\r\n`,"latin1"):(s(null===o,"no body must not have content length"),i.write(`${a}\r\n`,"latin1")),n.onRequestSent(),A[_]()}catch(t){e(t)}}async function de(e,t,A,r,n,i,o,a){s(0!==i||0===A[m],"iterator body cannot be pipelined");let c=null;function l(){if(c){const e=c;c=null,e()}}n.on("close",l).on("drain",l);const h=new ue({abort:e,socket:n,request:r,contentLength:i,client:A,expectsPayload:a,header:o});try{for await(const e of t){if(n[T])throw n[T];h.write(e)||await new Promise(((e,t)=>{s(null===c),n[T]?t(n[T]):c=e}))}h.end()}catch(e){h.destroy(e)}finally{n.off("close",l).off("drain",l)}}class ue{constructor({abort:e,socket:t,request:A,contentLength:s,client:r,expectsPayload:n,header:i}){this.socket=t,this.request=A,this.contentLength=s,this.client=r,this.bytesWritten=0,this.expectsPayload=n,this.header=i,this.abort=e,t[w]=!0}write(e){const{socket:t,request:A,contentLength:s,client:r,bytesWritten:n,expectsPayload:i,header:a}=this;if(t[T])throw t[T];if(t.destroyed)return!1;const c=Buffer.byteLength(e);if(!c)return!0;if(null!==s&&n+c>s){if(r[V])throw new o;process.emitWarning(new o)}t.cork(),0===n&&(i||!1===A.reset||(t[C]=!0),null===s?t.write(`${a}transfer-encoding: chunked\r\n`,"latin1"):t.write(`${a}content-length: ${s}\r\n\r\n`,"latin1")),null===s&&t.write(`\r\n${c.toString(16)}\r\n`,"latin1"),this.bytesWritten+=c;const l=t.write(e);return t.uncork(),A.onBodySent(e),l||t[p].timeout&&3===t[p].timeoutType&&t[p].timeout.refresh&&t[p].timeout.refresh(),l}end(){const{socket:e,contentLength:t,client:A,bytesWritten:s,expectsPayload:r,header:n,request:i}=this;if(i.onRequestSent(),e[w]=!1,e[T])throw e[T];if(!e.destroyed){if(0===s?r?e.write(`${n}content-length: 0\r\n\r\n`,"latin1"):e.write(`${n}\r\n`,"latin1"):null===t&&e.write("\r\n0\r\n\r\n","latin1"),null!==t&&s!==t){if(A[V])throw new o;process.emitWarning(new o)}e[p].timeout&&3===e[p].timeoutType&&e[p].timeout.refresh&&e[p].timeout.refresh(),A[_]()}}destroy(e){const{socket:t,client:A,abort:r}=this;t[w]=!1,e&&(s(A[m]<=1,"pipeline should only contain this request"),r(e))}}e.exports=function(e,t){if(e[M]=t,ee||(ee=function(){const e=process.env.JEST_WORKER_ID?A(4744):void 0;let t,r="ppc64"!==process.arch;if("1"===process.env.UNDICI_NO_WASM_SIMD?r=!0:"0"===process.env.UNDICI_NO_WASM_SIMD&&(r=!1),r)try{t=new WebAssembly.Module(A(7136))}catch{}return t||(t=new WebAssembly.Module(e||A(4744))),new WebAssembly.Instance(t,{env:{wasm_on_url:(e,t,A)=>0,wasm_on_status:(e,t,A)=>{s(te.ptr===e);const r=t-re+Ae.byteOffset;return te.onStatus(new Z(Ae.buffer,r,A))},wasm_on_message_begin:e=>(s(te.ptr===e),te.onMessageBegin()),wasm_on_header_field:(e,t,A)=>{s(te.ptr===e);const r=t-re+Ae.byteOffset;return te.onHeaderField(new Z(Ae.buffer,r,A))},wasm_on_header_value:(e,t,A)=>{s(te.ptr===e);const r=t-re+Ae.byteOffset;return te.onHeaderValue(new Z(Ae.buffer,r,A))},wasm_on_headers_complete:(e,t,A,r)=>(s(te.ptr===e),te.onHeadersComplete(t,1===A,1===r)),wasm_on_body:(e,t,A)=>{s(te.ptr===e);const r=t-re+Ae.byteOffset;return te.onBody(new Z(Ae.buffer,r,A))},wasm_on_message_complete:e=>(s(te.ptr===e),te.onMessageComplete())}})}()),t.errored)throw t.errored;if(t.destroyed)throw new g("destroyed");return t[b]=!1,t[w]=!1,t[C]=!1,t[f]=!1,t[p]=new ne(e,t,ee),r.addListener(t,"error",oe),r.addListener(t,"readable",ae),r.addListener(t,"end",ce),r.addListener(t,"close",le),t[$]=!1,t.on("close",he),{version:"h1",defaultPipelining:1,write:t=>function(e,t){const{method:i,path:a,host:l,upgrade:h,blocking:g,reset:u}=t;let{body:E,headers:I,contentLength:Q}=t;const B="PUT"===i||"POST"===i||"PATCH"===i||"QUERY"===i||"PROPFIND"===i||"PROPPATCH"===i;if(r.isFormDataLike(E)){K||(K=A(2530).extractBody);const[e,s]=K(E);null==t.contentType&&I.push("content-type",s),E=e.stream,Q=e.length}else r.isBlobLike(E)&&null==t.contentType&&E.type&&I.push("content-type",E.type);E&&"function"==typeof E.read&&E.read(0);const p=r.bodyLength(E);Q=p??Q,null===Q&&(Q=t.contentLength);0!==Q||B||(Q=null);if(function(e){return"GET"!==e&&"HEAD"!==e&&"OPTIONS"!==e&&"TRACE"!==e&&"CONNECT"!==e}(i)&&Q>0&&null!==t.contentLength&&t.contentLength!==Q){if(e[V])return r.errorRequest(e,t,new o),!1;process.emitWarning(new o)}const y=e[M],S=A=>{t.aborted||t.completed||(r.errorRequest(e,t,A||new c),r.destroy(E),r.destroy(y,new d("aborted")))};try{t.onConnect(S)}catch(A){r.errorRequest(e,t,A)}if(t.aborted)return!1;"HEAD"===i&&(y[C]=!0);(h||"CONNECT"===i)&&(y[C]=!0);null!=u&&(y[C]=u);e[G]&&y[O]++>=e[G]&&(y[C]=!0);g&&(y[f]=!0);let D=`${i} ${a} HTTP/1.1\r\n`;D+="string"==typeof l?`host: ${l}\r\n`:e[R];h?D+=`connection: upgrade\r\nupgrade: ${h}\r\n`:e[F]&&!y[C]?D+="connection: keep-alive\r\n":D+="connection: close\r\n";if(Array.isArray(I))for(let e=0;e<I.length;e+=2){const t=I[e+0],A=I[e+1];if(Array.isArray(A))for(let e=0;e<A.length;e++)D+=`${t}: ${A[e]}\r\n`;else D+=`${t}: ${A}\r\n`}n.sendHeaders.hasSubscribers&&n.sendHeaders.publish({request:t,headers:D,socket:y});E&&0!==p?r.isBuffer(E)?ge(S,E,e,t,y,Q,D,B):r.isBlobLike(E)?"function"==typeof E.stream?de(S,E.stream(),e,t,y,Q,D,B):async function(e,t,A,r,n,i,a,c){s(i===t.size,"blob body must have content length");try{if(null!=i&&i!==t.size)throw new o;const e=Buffer.from(await t.arrayBuffer());n.cork(),n.write(`${a}content-length: ${i}\r\n\r\n`,"latin1"),n.write(e),n.uncork(),r.onBodySent(e),r.onRequestSent(),c||!1===r.reset||(n[C]=!0),A[_]()}catch(t){e(t)}}(S,E,e,t,y,Q,D,B):r.isStream(E)?function(e,t,A,n,i,o,a,l){s(0!==o||0===A[m],"stream body cannot be pipelined");let h=!1;const g=new ue({abort:e,socket:i,request:n,contentLength:o,client:A,expectsPayload:l,header:a}),d=function(e){if(!h)try{!g.write(e)&&this.pause&&this.pause()}catch(e){r.destroy(this,e)}},u=function(){h||t.resume&&t.resume()},E=function(){if(queueMicrotask((()=>{t.removeListener("error",I)})),!h){const e=new c;queueMicrotask((()=>I(e)))}},I=function(e){if(!h){if(h=!0,s(i.destroyed||i[w]&&A[m]<=1),i.off("drain",u).off("error",I),t.removeListener("data",d).removeListener("end",I).removeListener("close",E),!e)try{g.end()}catch(t){e=t}g.destroy(e),!e||"UND_ERR_INFO"===e.code&&"reset"===e.message?r.destroy(t):r.destroy(t,e)}};t.on("data",d).on("end",I).on("error",I).on("close",E),t.resume&&t.resume();i.on("drain",u).on("error",I),t.errorEmitted??t.errored?setImmediate(I,t.errored):(t.endEmitted??t.readableEnded)&&setImmediate(I,null);(t.closeEmitted??t.closed)&&setImmediate(E)}(S,E,e,t,y,Q,D,B):r.isIterable(E)?de(S,E,e,t,y,Q,D,B):s(!1):ge(S,null,e,t,y,Q,D,B);return!0}(e,t),resume(){!function(e){const t=e[M];if(t&&!t.destroyed)if(0===e[S]?!t[b]&&t.unref&&(t.unref(),t[b]=!0):t[b]&&t.ref&&(t.ref(),t[b]=!1),0===e[S])8!==t[p].timeoutType&&t[p].setTimeout(e[U],8);else if(e[m]>0&&t[p].statusCode<200&&3!==t[p].timeoutType){const A=e[D][e[k]],s=null!=A.headersTimeout?A.headersTimeout:e[x];t[p].setTimeout(s,3)}}(e)},destroy(e,A){t[$]?queueMicrotask(A):(t.on("close",A),t.destroy(e))},get destroyed(){return t.destroyed},busy(A){if(t[w]||t[C]||t[f])return!0;if(A){if(e[m]>0&&!A.idempotent)return!0;if(e[m]>0&&(A.upgrade||"CONNECT"===A.method))return!0;if(e[m]>0&&0!==r.bodyLength(A.body)&&(r.isStream(A.body)||r.isAsyncIterable(A.body)||r.isFormDataLike(A.body)))return!0}return!1}}}},8142:(e,t,A)=>{"use strict";const s=A(4589),{pipeline:r}=A(7075),n=A(2858),{RequestContentLengthMismatchError:i,RequestAbortedError:o,SocketError:a,InformationalError:c}=A(4465),{kUrl:l,kReset:h,kClient:g,kRunning:d,kPending:u,kQueue:E,kPendingIdx:I,kRunningIdx:Q,kError:C,kSocket:B,kStrictContentLength:p,kOnError:f,kMaxConcurrentStreams:m,kHTTP2Session:y,kResume:S,kSize:w,kHTTPContext:D,kClosed:b,kBodyTimeout:N}=A(257),{channels:R}=A(772),v=Symbol("open streams");let k,T;try{T=A(2467)}catch{T={constants:{}}}const{constants:{HTTP2_HEADER_AUTHORITY:F,HTTP2_HEADER_METHOD:M,HTTP2_HEADER_PATH:U,HTTP2_HEADER_SCHEME:L,HTTP2_HEADER_CONTENT_LENGTH:H,HTTP2_HEADER_EXPECT:P,HTTP2_HEADER_STATUS:x}}=T;function Y(e){s("ERR_TLS_CERT_ALTNAME_INVALID"!==e.code),this[B][C]=e,this[g][f](e)}function V(e,t,A){if(0===A){const A=new c(`HTTP/2: "frameError" received - type ${e}, code ${t}`);this[B][C]=A,this[g][f](A)}}function G(){const e=new a("other side closed",n.getSocketInfo(this[B]));this.destroy(e),n.destroy(this[B],e)}function O(e){const t=this[C]||new a(`HTTP/2: "GOAWAY" frame received with code ${e}`,n.getSocketInfo(this[B])),A=this[g];if(A[B]=null,A[D]=null,this.close(),this[y]=null,n.destroy(this[B],t),A[Q]<A[E].length){const e=A[E][A[Q]];A[E][A[Q]++]=null,n.errorRequest(A,e,t),A[I]=A[Q]}s(0===A[d]),A.emit("disconnect",A[l],[A],t),A.emit("connectionError",A[l],[A],t),A[S]()}function J(){const{[g]:e}=this,{[B]:t}=e,A=this[B][C]||this[C]||new a("closed",n.getSocketInfo(t));if(e[B]=null,e[D]=null,e.destroyed){s(0===e[u]);const t=e[E].splice(e[Q]);for(let s=0;s<t.length;s++){const r=t[s];n.errorRequest(e,r,A)}}}function W(){const e=this[C]||new a("closed",n.getSocketInfo(this)),t=this[y][g];t[B]=null,t[D]=null,null!==this[y]&&this[y].destroy(e),t[I]=t[Q],s(0===t[d]),t.emit("disconnect",t[l],[t],e),t[S]()}function _(e){s("ERR_TLS_CERT_ALTNAME_INVALID"!==e.code),this[C]=e,this[g][f](e)}function q(){n.destroy(this,new a("other side closed",n.getSocketInfo(this)))}function $(){this[b]=!0}function X(e,t,A,r,i,o,a,c){try{null!=A&&n.isBuffer(A)&&(s(a===A.byteLength,"buffer body must have content length"),t.cork(),t.write(A),t.uncork(),t.end(),i.onBodySent(A)),c||(o[h]=!0),i.onRequestSent(),r[S]()}catch(t){e(t)}}async function z(e,t,A,r,n,i,o,a){s(0!==o||0===r[d],"iterator body cannot be pipelined");let c=null;function l(){if(c){const e=c;c=null,e()}}t.on("close",l).on("drain",l);try{for await(const e of A){if(i[C])throw i[C];const A=t.write(e);n.onBodySent(e),A||await new Promise(((e,t)=>{s(null===c),i[C]?t(i[C]):c=e}))}t.end(),n.onRequestSent(),a||(i[h]=!0),r[S]()}catch(t){e(t)}finally{t.off("close",l).off("drain",l)}}e.exports=function(e,t){e[B]=t;const a=T.connect(e[l],{createConnection:()=>t,peerMaxConcurrentStreams:e[m],settings:{enablePush:!1}});return a[v]=0,a[g]=e,a[B]=t,a[y]=null,n.addListener(a,"error",Y),n.addListener(a,"frameError",V),n.addListener(a,"end",G),n.addListener(a,"goaway",O),n.addListener(a,"close",J),a.unref(),e[y]=a,t[y]=a,n.addListener(t,"error",_),n.addListener(t,"end",q),n.addListener(t,"close",W),t[b]=!1,t.on("close",$),{version:"h2",defaultPipelining:1/0,write:t=>function(e,t){const a=t.bodyTimeout??e[N],g=e[y],{method:u,path:C,host:m,upgrade:w,expectContinue:D,signal:b,protocol:T,headers:Y}=t;let{body:V}=t;if(w)return n.errorRequest(e,t,new Error("Upgrade not supported for H2")),!1;const G={};for(let e=0;e<Y.length;e+=2){const t=Y[e+0],A=Y[e+1];if("cookie"!==t)if(Array.isArray(A))for(let e=0;e<A.length;e++)G[t]?G[t]+=`, ${A[e]}`:G[t]=A[e];else G[t]?G[t]+=`, ${A}`:G[t]=A;else null!=G[t]?G[t]=Array.isArray(G[t])?(G[t].push(A),G[t]):[G[t],A]:G[t]=A}let O=null;const{hostname:J,port:W}=e[l];G[F]=m||`${J}${W?`:${W}`:""}`,G[M]=u;const _=A=>{t.aborted||t.completed||(A=A||new o,n.errorRequest(e,t,A),null!=O&&(O.removeAllListeners("data"),O.close(),e[f](A),e[S]()),n.destroy(V,A))};try{t.onConnect(_)}catch(A){n.errorRequest(e,t,A)}if(t.aborted)return!1;if("CONNECT"===u)return g.ref(),O=g.request(G,{endStream:!1,signal:b}),O.pending?O.once("ready",(()=>{t.onUpgrade(null,null,O),++g[v],e[E][e[Q]++]=null})):(t.onUpgrade(null,null,O),++g[v],e[E][e[Q]++]=null),O.once("close",(()=>{g[v]-=1,0===g[v]&&g.unref()})),O.setTimeout(a),!0;G[U]=C,G[L]="http:"===T?"http":"https";const q="PUT"===u||"POST"===u||"PATCH"===u;V&&"function"==typeof V.read&&V.read(0);let $=n.bodyLength(V);if(n.isFormDataLike(V)){k??=A(2530).extractBody;const[e,t]=k(V);G["content-type"]=t,V=e.stream,$=e.length}null==$&&($=t.contentLength);0!==$&&q||($=null);if(function(e){return"GET"!==e&&"HEAD"!==e&&"OPTIONS"!==e&&"TRACE"!==e&&"CONNECT"!==e}(u)&&$>0&&null!=t.contentLength&&t.contentLength!==$){if(e[p])return n.errorRequest(e,t,new i),!1;process.emitWarning(new i)}null!=$&&(s(V,"no body must not have content length"),G[H]=`${$}`);if(g.ref(),R.sendHeaders.hasSubscribers){let e="";for(const t in G)e+=`${t}: ${G[t]}\r\n`;R.sendHeaders.publish({request:t,headers:e,socket:g[B]})}const Z="GET"===u||"HEAD"===u||null===V;D?(G[P]="100-continue",O=g.request(G,{endStream:Z,signal:b}),O.once("continue",j)):(O=g.request(G,{endStream:Z,signal:b}),j());return++g[v],O.setTimeout(a),O.once("response",(e=>{const{[x]:A,...s}=e;t.onResponseStarted(),t.aborted?O.removeAllListeners("data"):!1===t.onHeaders(Number(A),function(e){const t=[];for(const[A,s]of Object.entries(e))if(Array.isArray(s))for(const e of s)t.push(Buffer.from(A),Buffer.from(e));else t.push(Buffer.from(A),Buffer.from(s));return t}(s),O.resume.bind(O),"")&&O.pause()})),O.on("data",(e=>{!1===t.onData(e)&&O.pause()})),O.once("end",(A=>{O.removeAllListeners("data"),null==O.state?.state||O.state.state<6?(t.aborted||t.completed||t.onComplete({}),e[E][e[Q]++]=null,e[S]()):(--g[v],0===g[v]&&g.unref(),_(A??new c("HTTP/2: stream half-closed (remote)")),e[E][e[Q]++]=null,e[I]=e[Q],e[S]())})),O.once("close",(()=>{O.removeAllListeners("data"),g[v]-=1,0===g[v]&&g.unref()})),O.once("error",(function(e){O.removeAllListeners("data"),_(e)})),O.once("frameError",((e,t)=>{O.removeAllListeners("data"),_(new c(`HTTP/2: "frameError" received - type ${e}, code ${t}`))})),O.on("aborted",(()=>{O.removeAllListeners("data")})),O.on("timeout",(()=>{const e=new c(`HTTP/2: "stream timeout after ${a}"`);O.removeAllListeners("data"),g[v]-=1,0===g[v]&&g.unref(),_(e)})),O.once("trailers",(e=>{t.aborted||t.completed||t.onComplete(e)})),!0;function j(){V&&0!==$?n.isBuffer(V)?X(_,O,V,e,t,e[B],$,q):n.isBlobLike(V)?"function"==typeof V.stream?z(_,O,V.stream(),e,t,e[B],$,q):async function(e,t,A,r,n,o,a,c){s(a===A.size,"blob body must have content length");try{if(null!=a&&a!==A.size)throw new i;const e=Buffer.from(await A.arrayBuffer());t.cork(),t.write(e),t.uncork(),t.end(),n.onBodySent(e),n.onRequestSent(),c||(o[h]=!0),r[S]()}catch(t){e(t)}}(_,O,V,e,t,e[B],$,q):n.isStream(V)?function(e,t,A,i,o,a,c,l){s(0!==l||0===a[d],"stream body cannot be pipelined");const g=r(o,i,(s=>{s?(n.destroy(g,s),e(s)):(n.removeAllListeners(g),c.onRequestSent(),A||(t[h]=!0),a[S]())}));function u(e){c.onBodySent(e)}n.addListener(g,"data",u)}(_,e[B],q,O,V,e,t,$):n.isIterable(V)?z(_,O,V,e,t,e[B],$,q):s(!1):X(_,O,null,e,t,e[B],$,q)}}(e,t),resume(){!function(e){const t=e[B];!1===t?.destroyed&&(0===e[w]||0===e[m]?(t.unref(),e[y].unref()):(t.ref(),e[y].ref()))}(e)},destroy(e,A){t[b]?queueMicrotask(A):t.destroy(e).on("close",A)},get destroyed(){return t.destroyed},busy:()=>!1}}},1167:(e,t,A)=>{"use strict";const s=A(4589),r=A(7030),n=A(7067),i=A(2858),{ClientStats:o}=A(4304),{channels:a}=A(772),c=A(5837),l=A(7779),{InvalidArgumentError:h,InformationalError:g,ClientDestroyedError:d}=A(4465),u=A(1986),{kUrl:E,kServerName:I,kClient:Q,kBusy:C,kConnect:B,kResuming:p,kRunning:f,kPending:m,kSize:y,kQueue:S,kConnected:w,kConnecting:D,kNeedDrain:b,kKeepAliveDefaultTimeout:N,kHostHeader:R,kPendingIdx:v,kRunningIdx:k,kError:T,kPipelining:F,kKeepAliveTimeoutValue:M,kMaxHeadersSize:U,kKeepAliveMaxTimeout:L,kKeepAliveTimeoutThreshold:H,kHeadersTimeout:P,kBodyTimeout:x,kStrictContentLength:Y,kConnector:V,kMaxRequests:G,kCounter:O,kClose:J,kDestroy:W,kDispatch:_,kLocalAddress:q,kMaxResponseSize:$,kOnError:X,kHTTPContext:z,kMaxConcurrentStreams:Z,kResume:j}=A(257),K=A(9355),ee=A(8142),te=Symbol("kClosedResolve"),Ae=n&&n.maxHeaderSize&&Number.isInteger(n.maxHeaderSize)&&n.maxHeaderSize>0?()=>n.maxHeaderSize:()=>{throw new h("http module not available or http.maxHeaderSize invalid")},se=()=>{};function re(e){return e[F]??e[z]?.defaultPipelining??1}function ne(e,t){if(0===e[f]&&"UND_ERR_INFO"!==t.code&&"UND_ERR_SOCKET"!==t.code){s(e[v]===e[k]);const A=e[S].splice(e[k]);for(let s=0;s<A.length;s++){const r=A[s];i.errorRequest(e,r,t)}s(0===e[y])}}function ie(e){s(!e[D]),s(!e[z]);let{host:t,hostname:A,protocol:n,port:o}=e[E];if("["===A[0]){const e=A.indexOf("]");s(-1!==e);const t=A.substring(1,e);s(r.isIPv6(t)),A=t}e[D]=!0,a.beforeConnect.hasSubscribers&&a.beforeConnect.publish({connectParams:{host:t,hostname:A,protocol:n,port:o,version:e[z]?.version,servername:e[I],localAddress:e[q]},connector:e[V]}),e[V]({host:t,hostname:A,protocol:n,port:o,servername:e[I],localAddress:e[q]},((r,c)=>{if(r)return oe(e,r,{host:t,hostname:A,protocol:n,port:o}),void e[j]();if(e.destroyed)return i.destroy(c.on("error",se),new d),void e[j]();s(c);try{e[z]="h2"===c.alpnProtocol?ee(e,c):K(e,c)}catch(r){return c.destroy().on("error",se),oe(e,r,{host:t,hostname:A,protocol:n,port:o}),void e[j]()}e[D]=!1,c[O]=0,c[G]=e[G],c[Q]=e,c[T]=null,a.connected.hasSubscribers&&a.connected.publish({connectParams:{host:t,hostname:A,protocol:n,port:o,version:e[z]?.version,servername:e[I],localAddress:e[q]},connector:e[V],socket:c}),e.emit("connect",e[E],[e]),e[j]()}))}function oe(e,t,{host:A,hostname:r,protocol:n,port:o}){if(!e.destroyed){if(e[D]=!1,a.connectError.hasSubscribers&&a.connectError.publish({connectParams:{host:A,hostname:r,protocol:n,port:o,version:e[z]?.version,servername:e[I],localAddress:e[q]},connector:e[V],error:t}),"ERR_TLS_CERT_ALTNAME_INVALID"===t.code)for(s(0===e[f]);e[m]>0&&e[S][e[v]].servername===e[I];){const A=e[S][e[v]++];i.errorRequest(e,A,t)}else ne(e,t);e.emit("connectionError",e[E],[e],t)}}function ae(e){e[b]=0,e.emit("drain",e[E],[e])}function ce(e,t){2!==e[p]&&(e[p]=2,function(e,t){for(;;){if(e.destroyed)return void s(0===e[m]);if(e[te]&&!e[y])return e[te](),void(e[te]=null);if(e[z]&&e[z].resume(),e[C])e[b]=2;else if(2===e[b]){t?(e[b]=1,queueMicrotask((()=>ae(e)))):ae(e);continue}if(0===e[m])return;if(e[f]>=(re(e)||1))return;const A=e[S][e[v]];if("https:"===e[E].protocol&&e[I]!==A.servername){if(e[f]>0)return;e[I]=A.servername,e[z]?.destroy(new g("servername changed"),(()=>{e[z]=null,ce(e)}))}if(e[D])return;if(!e[z])return void ie(e);if(e[z].destroyed)return;if(e[z].busy(A))return;!A.aborted&&e[z].write(A)?e[v]++:e[S].splice(e[v],1)}}(e,t),e[p]=0,e[k]>256&&(e[S].splice(0,e[k]),e[v]-=e[k],e[k]=0))}e.exports=class extends l{constructor(e,{maxHeaderSize:t,headersTimeout:A,socketTimeout:s,requestTimeout:n,connectTimeout:o,bodyTimeout:a,idleTimeout:c,keepAlive:l,keepAliveTimeout:g,maxKeepAliveTimeout:d,keepAliveMaxTimeout:Q,keepAliveTimeoutThreshold:C,socketPath:B,pipelining:f,tls:m,strictContentLength:y,maxCachedSessions:w,connect:D,maxRequestsPerClient:T,localAddress:O,maxResponseSize:J,autoSelectFamily:W,autoSelectFamilyAttemptTimeout:_,maxConcurrentStreams:K,allowH2:ee}={}){if(void 0!==l)throw new h("unsupported keepAlive, use pipelining=0 instead");if(void 0!==s)throw new h("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(void 0!==n)throw new h("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(void 0!==c)throw new h("unsupported idleTimeout, use keepAliveTimeout instead");if(void 0!==d)throw new h("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(null!=t){if(!Number.isInteger(t)||t<1)throw new h("invalid maxHeaderSize")}else t=Ae();if(null!=B&&"string"!=typeof B)throw new h("invalid socketPath");if(null!=o&&(!Number.isFinite(o)||o<0))throw new h("invalid connectTimeout");if(null!=g&&(!Number.isFinite(g)||g<=0))throw new h("invalid keepAliveTimeout");if(null!=Q&&(!Number.isFinite(Q)||Q<=0))throw new h("invalid keepAliveMaxTimeout");if(null!=C&&!Number.isFinite(C))throw new h("invalid keepAliveTimeoutThreshold");if(null!=A&&(!Number.isInteger(A)||A<0))throw new h("headersTimeout must be a positive integer or zero");if(null!=a&&(!Number.isInteger(a)||a<0))throw new h("bodyTimeout must be a positive integer or zero");if(null!=D&&"function"!=typeof D&&"object"!=typeof D)throw new h("connect must be a function or an object");if(null!=T&&(!Number.isInteger(T)||T<0))throw new h("maxRequestsPerClient must be a positive number");if(null!=O&&("string"!=typeof O||0===r.isIP(O)))throw new h("localAddress must be valid string IP address");if(null!=J&&(!Number.isInteger(J)||J<-1))throw new h("maxResponseSize must be a positive number");if(null!=_&&(!Number.isInteger(_)||_<-1))throw new h("autoSelectFamilyAttemptTimeout must be a positive number");if(null!=ee&&"boolean"!=typeof ee)throw new h("allowH2 must be a valid boolean value");if(null!=K&&("number"!=typeof K||K<1))throw new h("maxConcurrentStreams must be a positive integer, greater than 0");super(),"function"!=typeof D&&(D=u({...m,maxCachedSessions:w,allowH2:ee,socketPath:B,timeout:o,..."boolean"==typeof W?{autoSelectFamily:W,autoSelectFamilyAttemptTimeout:_}:void 0,...D})),this[E]=i.parseOrigin(e),this[V]=D,this[F]=null!=f?f:1,this[U]=t,this[N]=null==g?4e3:g,this[L]=null==Q?6e5:Q,this[H]=null==C?2e3:C,this[M]=this[N],this[I]=null,this[q]=null!=O?O:null,this[p]=0,this[b]=0,this[R]=`host: ${this[E].hostname}${this[E].port?`:${this[E].port}`:""}\r\n`,this[x]=null!=a?a:3e5,this[P]=null!=A?A:3e5,this[Y]=null==y||y,this[G]=T,this[te]=null,this[$]=J>-1?J:-1,this[Z]=null!=K?K:100,this[z]=null,this[S]=[],this[k]=0,this[v]=0,this[j]=e=>ce(this,e),this[X]=e=>ne(this,e)}get pipelining(){return this[F]}set pipelining(e){this[F]=e,this[j](!0)}get stats(){return new o(this)}get[m](){return this[S].length-this[v]}get[f](){return this[v]-this[k]}get[y](){return this[S].length-this[k]}get[w](){return!!this[z]&&!this[D]&&!this[z].destroyed}get[C](){return Boolean(this[z]?.busy(null)||this[y]>=(re(this)||1)||this[m]>0)}[B](e){ie(this),this.once("connect",e)}[_](e,t){const A=new c(this[E].origin,e,t);return this[S].push(A),this[p]||(null==i.bodyLength(A.body)&&i.isIterable(A.body)?(this[p]=1,queueMicrotask((()=>ce(this)))):this[j](!0)),this[p]&&2!==this[b]&&this[C]&&(this[b]=2),this[b]<2}[J](){return new Promise((e=>{this[y]?this[te]=e:e(null)}))}[W](e){return new Promise((t=>{const A=this[S].splice(this[v]);for(let t=0;t<A.length;t++){const s=A[t];i.errorRequest(this,s,e)}const s=()=>{this[te]&&(this[te](),this[te]=null),t(null)};this[z]?(this[z].destroy(e,s),this[z]=null):queueMicrotask(s),this[j]()}))}}},7779:(e,t,A)=>{"use strict";const s=A(5497),r=A(4555),{ClientDestroyedError:n,ClientClosedError:i,InvalidArgumentError:o}=A(4465),{kDestroy:a,kClose:c,kClosed:l,kDestroyed:h,kDispatch:g}=A(257),d=Symbol("onDestroyed"),u=Symbol("onClosed");e.exports=class extends s{[h]=!1;[d]=null;[l]=!1;[u]=[];get destroyed(){return this[h]}get closed(){return this[l]}close(e){if(void 0===e)return new Promise(((e,t)=>{this.close(((A,s)=>A?t(A):e(s)))}));if("function"!=typeof e)throw new o("invalid callback");if(this[h])return void queueMicrotask((()=>e(new n,null)));if(this[l])return void(this[u]?this[u].push(e):queueMicrotask((()=>e(null,null))));this[l]=!0,this[u].push(e);const t=()=>{const e=this[u];this[u]=null;for(let t=0;t<e.length;t++)e[t](null,null)};this[c]().then((()=>this.destroy())).then((()=>{queueMicrotask(t)}))}destroy(e,t){if("function"==typeof e&&(t=e,e=null),void 0===t)return new Promise(((t,A)=>{this.destroy(e,((e,s)=>e?A(e):t(s)))}));if("function"!=typeof t)throw new o("invalid callback");if(this[h])return void(this[d]?this[d].push(t):queueMicrotask((()=>t(null,null))));e||(e=new n),this[h]=!0,this[d]=this[d]||[],this[d].push(t);const A=()=>{const e=this[d];this[d]=null;for(let t=0;t<e.length;t++)e[t](null,null)};this[a](e).then((()=>{queueMicrotask(A)}))}dispatch(e,t){if(!t||"object"!=typeof t)throw new o("handler must be an object");t=r.unwrap(t);try{if(!e||"object"!=typeof e)throw new o("opts must be an object.");if(this[h]||this[d])throw new n;if(this[l])throw new i;return this[g](e,t)}catch(e){if("function"!=typeof t.onError)throw e;return t.onError(e),!1}}}},5497:(e,t,A)=>{"use strict";const s=A(8474),r=A(832),n=e=>(t,A)=>e(t,r.wrap(A));e.exports=class extends s{dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}compose(...e){const t=Array.isArray(e[0])?e[0]:e;let A=this.dispatch.bind(this);for(const e of t)if(null!=e){if("function"!=typeof e)throw new TypeError("invalid interceptor, expected function received "+typeof e);if(A=e(A),A=n(A),null==A||"function"!=typeof A||2!==A.length)throw new TypeError("invalid interceptor")}return new Proxy(this,{get:(e,t)=>"dispatch"===t?A:e[t]})}}},4667:(e,t,A)=>{"use strict";const s=A(7779),{kClose:r,kDestroy:n,kClosed:i,kDestroyed:o,kDispatch:a,kNoProxyAgent:c,kHttpProxyAgent:l,kHttpsProxyAgent:h}=A(257),g=A(9246),d=A(3315),u={"http:":80,"https:":443};e.exports=class extends s{#C=null;#B=null;#p=null;constructor(e={}){super(),this.#p=e;const{httpProxy:t,httpsProxy:A,noProxy:s,...r}=e;this[c]=new d(r);const n=t??process.env.http_proxy??process.env.HTTP_PROXY;this[l]=n?new g({...r,uri:n}):this[c];const i=A??process.env.https_proxy??process.env.HTTPS_PROXY;this[h]=i?new g({...r,uri:i}):this[l],this.#f()}[a](e,t){const A=new URL(e.origin);return this.#m(A).dispatch(e,t)}[r](){return Promise.all([this[c].close(),!this[l][i]&&this[l].close(),!this[h][i]&&this[h].close()])}[n](e){return Promise.all([this[c].destroy(e),!this[l][o]&&this[l].destroy(e),!this[h][o]&&this[h].destroy(e)])}#m(e){let{protocol:t,host:A,port:s}=e;return A=A.replace(/:\d*$/,"").toLowerCase(),s=Number.parseInt(s,10)||u[t]||0,this.#y(A,s)?"https:"===t?this[h]:this[l]:this[c]}#y(e,t){if(this.#S&&this.#f(),0===this.#B.length)return!0;if("*"===this.#C)return!1;for(let A=0;A<this.#B.length;A++){const s=this.#B[A];if(!s.port||s.port===t)if(/^[.*]/.test(s.hostname)){if(e.endsWith(s.hostname.replace(/^\*/,"")))return!1}else if(e===s.hostname)return!1}return!0}#f(){const e=this.#p.noProxy??this.#w,t=e.split(/[,\s]/),A=[];for(let e=0;e<t.length;e++){const s=t[e];if(!s)continue;const r=s.match(/^(.+):(\d+)$/);A.push({hostname:(r?r[1]:s).toLowerCase(),port:r?Number.parseInt(r[2],10):0})}this.#C=e,this.#B=A}get#S(){return void 0===this.#p.noProxy&&this.#C!==this.#w}get#w(){return process.env.no_proxy??process.env.NO_PROXY??""}}},1726:e=>{"use strict";const t=2047;class A{bottom=0;top=0;list=new Array(2048).fill(void 0);next=null;isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&t)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&t}shift(){const e=this.list[this.bottom];return void 0===e?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&t,e)}}e.exports=class{constructor(){this.head=this.tail=new A}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new A),this.head.push(e)}shift(){const e=this.tail,t=e.shift();return e.isEmpty()&&null!==e.next&&(this.tail=e.next,e.next=null),t}}},8297:(e,t,A)=>{"use strict";const{connect:s}=A(7030),{kClose:r,kDestroy:n}=A(257),{InvalidArgumentError:i}=A(4465),o=A(2858),a=A(1167),c=A(7779);e.exports=class extends c{#D=null;constructor(e,t){if("string"==typeof e&&(e=new URL(e)),"http:"!==e.protocol)throw new i("h2c-client: Only h2c protocol is supported");const{connect:A,maxConcurrentStreams:s,pipelining:r,...n}=t??{};let o=100,c=100;if(null!=s&&Number.isInteger(s)&&s>0&&(o=s),null!=r&&Number.isInteger(r)&&r>0&&(c=r),c>o)throw new i("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(),this.#D=new a(e,{...n,connect:this.#b(A),maxConcurrentStreams:o,pipelining:c,allowH2:!0})}#b(e){return(t,A)=>{const r=e?.connectOpts??1e4,{hostname:n,port:i,pathname:a}=t,c=s({...t,host:n,port:i,pathname:a});if(null==t.keepAlive||t.keepAlive){const e=null==t.keepAliveInitialDelay?6e4:t.keepAliveInitialDelay;c.setKeepAlive(!0,e)}c.alpnProtocol="h2";const l=o.setupConnectTimeout(new WeakRef(c),{timeout:r,hostname:n,port:i});return c.setNoDelay(!0).once("connect",(function(){if(queueMicrotask(l),A){const e=A;A=null,e(null,this)}})).on("error",(function(e){if(queueMicrotask(l),A){const t=A;A=null,t(e)}})),c}}dispatch(e,t){return this.#D.dispatch(e,t)}[r](){return this.#D.close()}[n](){return this.#D.destroy()}}},1694:(e,t,A)=>{"use strict";const{PoolStats:s}=A(4304),r=A(7779),n=A(1726),{kConnected:i,kSize:o,kRunning:a,kPending:c,kQueued:l,kBusy:h,kFree:g,kUrl:d,kClose:u,kDestroy:E,kDispatch:I}=A(257),Q=Symbol("clients"),C=Symbol("needDrain"),B=Symbol("queue"),p=Symbol("closed resolve"),f=Symbol("onDrain"),m=Symbol("onConnect"),y=Symbol("onDisconnect"),S=Symbol("onConnectionError"),w=Symbol("get dispatcher"),D=Symbol("add client"),b=Symbol("remove client");e.exports={PoolBase:class extends r{[B]=new n;[l]=0;[Q]=[];[C]=!1;[f](e,t,A){const s=this[B];let r=!1;for(;!r;){const t=s.shift();if(!t)break;this[l]--,r=!e.dispatch(t.opts,t.handler)}if(e[C]=r,!r&&this[C]&&(this[C]=!1,this.emit("drain",t,[this,...A])),this[p]&&s.isEmpty()){const e=new Array(this[Q].length);for(let t=0;t<this[Q].length;t++)e[t]=this[Q][t].close();Promise.all(e).then(this[p])}}[m]=(e,t)=>{this.emit("connect",e,[this,...t])};[y]=(e,t,A)=>{this.emit("disconnect",e,[this,...t],A)};[S]=(e,t,A)=>{this.emit("connectionError",e,[this,...t],A)};get[h](){return this[C]}get[i](){let e=0;for(const{[i]:t}of this[Q])e+=t;return e}get[g](){let e=0;for(const{[i]:t,[C]:A}of this[Q])e+=t&&!A;return e}get[c](){let e=this[l];for(const{[c]:t}of this[Q])e+=t;return e}get[a](){let e=0;for(const{[a]:t}of this[Q])e+=t;return e}get[o](){let e=this[l];for(const{[o]:t}of this[Q])e+=t;return e}get stats(){return new s(this)}[u](){if(this[B].isEmpty()){const e=new Array(this[Q].length);for(let t=0;t<this[Q].length;t++)e[t]=this[Q][t].close();return Promise.all(e)}return new Promise((e=>{this[p]=e}))}[E](e){for(;;){const t=this[B].shift();if(!t)break;t.handler.onError(e)}const t=new Array(this[Q].length);for(let A=0;A<this[Q].length;A++)t[A]=this[Q][A].destroy(e);return Promise.all(t)}[I](e,t){const A=this[w]();return A?A.dispatch(e,t)||(A[C]=!0,this[C]=!this[w]()):(this[C]=!0,this[B].push({opts:e,handler:t}),this[l]++),!this[C]}[D](e){return e.on("drain",this[f].bind(this,e)).on("connect",this[m]).on("disconnect",this[y]).on("connectionError",this[S]),this[Q].push(e),this[C]&&queueMicrotask((()=>{this[C]&&this[f](e,e[d],[e,this])})),this}[b](e){e.close((()=>{const t=this[Q].indexOf(e);-1!==t&&this[Q].splice(t,1)})),this[C]=this[Q].some((e=>!e[C]&&!0!==e.closed&&!0!==e.destroyed))}},kClients:Q,kNeedDrain:C,kAddClient:D,kRemoveClient:b,kGetDispatcher:w}},8542:(e,t,A)=>{"use strict";const{PoolBase:s,kClients:r,kNeedDrain:n,kAddClient:i,kGetDispatcher:o,kRemoveClient:a}=A(1694),c=A(1167),{InvalidArgumentError:l}=A(4465),h=A(2858),{kUrl:g}=A(257),d=A(1986),u=Symbol("options"),E=Symbol("connections"),I=Symbol("factory");function Q(e,t){return new c(e,t)}e.exports=class extends s{constructor(e,{connections:t,factory:A=Q,connect:s,connectTimeout:n,tls:i,maxCachedSessions:o,socketPath:a,autoSelectFamily:c,autoSelectFamilyAttemptTimeout:C,allowH2:B,clientTtl:p,...f}={}){if(null!=t&&(!Number.isFinite(t)||t<0))throw new l("invalid connections");if("function"!=typeof A)throw new l("factory must be a function.");if(null!=s&&"function"!=typeof s&&"object"!=typeof s)throw new l("connect must be a function or an object");"function"!=typeof s&&(s=d({...i,maxCachedSessions:o,allowH2:B,socketPath:a,timeout:n,..."boolean"==typeof c?{autoSelectFamily:c,autoSelectFamilyAttemptTimeout:C}:void 0,...s})),super(),this[E]=t||null,this[g]=h.parseOrigin(e),this[u]={...h.deepClone(f),connect:s,allowH2:B,clientTtl:p},this[u].interceptors=f.interceptors?{...f.interceptors}:void 0,this[I]=A,this.on("connect",((e,t)=>{if(null!=p&&p>0)for(const e of t)Object.assign(e,{ttl:Date.now()})})),this.on("connectionError",((e,t,A)=>{for(const e of t){const t=this[r].indexOf(e);-1!==t&&this[r].splice(t,1)}}))}[o](){const e=this[u].clientTtl;for(const t of this[r])if(null!=e&&e>0&&t.ttl&&Date.now()-t.ttl>e)this[a](t);else if(!t[n])return t;if(!this[E]||this[r].length<this[E]){const e=this[I](this[g],this[u]);return this[i](e),e}}}},9246:(e,t,A)=>{"use strict";const{kProxy:s,kClose:r,kDestroy:n,kDispatch:i}=A(257),o=A(3315),a=A(8542),c=A(7779),{InvalidArgumentError:l,RequestAbortedError:h,SecureProxyConnectionError:g}=A(4465),d=A(1986),u=A(1167),E=Symbol("proxy agent"),I=Symbol("proxy client"),Q=Symbol("proxy headers"),C=Symbol("request tls settings"),B=Symbol("proxy tls settings"),p=Symbol("connect endpoint function"),f=Symbol("tunnel proxy");function m(e,t){return new a(e,t)}const y=()=>{};function S(e,t){return 1===t.connections?new u(e,t):new a(e,t)}class w extends c{#D;constructor(e,{headers:t={},connect:A,factory:s}){if(!e)throw new l("Proxy URL is mandatory");super(),this[Q]=t,this.#D=s?s(e,{connect:A}):new u(e,{connect:A})}[i](e,t){const A=t.onHeaders;t.onHeaders=function(e,s,r){407!==e?A&&A.call(this,e,s,r):"function"==typeof t.onError&&t.onError(new l("Proxy Authentication Required (407)"))};const{origin:s,path:r="/",headers:n={}}=e;if(e.path=s+r,!("host"in n)&&!("Host"in n)){const{host:e}=new URL(s);n.host=e}return e.headers={...this[Q],...n},this.#D[i](e,t)}[r](){return this.#D.close()}[n](e){return this.#D.destroy(e)}}e.exports=class extends c{constructor(e){if(!e||"object"==typeof e&&!(e instanceof URL)&&!e.uri)throw new l("Proxy uri is mandatory");const{clientFactory:t=m}=e;if("function"!=typeof t)throw new l("Proxy opts.clientFactory must be a function.");const{proxyTunnel:A=!0}=e;super();const r=this.#N(e),{href:n,origin:i,port:a,protocol:c,username:u,password:D,hostname:b}=r;if(this[s]={uri:n,protocol:c},this[C]=e.requestTls,this[B]=e.proxyTls,this[Q]=e.headers||{},this[f]=A,e.auth&&e.token)throw new l("opts.auth cannot be used in combination with opts.token");e.auth?this[Q]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[Q]["proxy-authorization"]=e.token:u&&D&&(this[Q]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(u)}:${decodeURIComponent(D)}`).toString("base64")}`);const N=d({...e.proxyTls});this[p]=d({...e.requestTls});const R=e.factory||S;this[I]=t(r,{connect:N}),this[E]=new o({...e,factory:(e,t)=>{const{protocol:A}=new URL(e);return this[f]||"http:"!==A||"http:"!==this[s].protocol?R(e,t):new w(this[s].uri,{headers:this[Q],connect:N,factory:R})},connect:async(e,t)=>{let A=e.host;e.port||(A+=`:${function(e){return"https:"===e?443:80}(e.protocol)}`);try{const{socket:s,statusCode:r}=await this[I].connect({origin:i,port:a,path:A,signal:e.signal,headers:{...this[Q],host:e.host,...null==e.connections||e.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[B]?.servername||b});if(200!==r&&(s.on("error",y).destroy(),t(new h(`Proxy response (${r}) !== 200 when HTTP Tunneling`))),"https:"!==e.protocol)return void t(null,s);let n;n=this[C]?this[C].servername:e.servername,this[p]({...e,servername:n,httpSocket:s},t)}catch(e){"ERR_TLS_CERT_ALTNAME_INVALID"===e.code?t(new g(e)):t(e)}}})}dispatch(e,t){const A=function(e){if(Array.isArray(e)){const t={};for(let A=0;A<e.length;A+=2)t[e[A]]=e[A+1];return t}return e}(e.headers);if(function(e){const t=e&&Object.keys(e).find((e=>"proxy-authorization"===e.toLowerCase()));if(t)throw new l("Proxy-Authorization should be sent in ProxyAgent constructor")}(A),A&&!("host"in A)&&!("Host"in A)){const{host:t}=new URL(e.origin);A.host=t}return this[E].dispatch({...e,headers:A},t)}#N(e){return"string"==typeof e?new URL(e):e instanceof URL?e:new URL(e.uri)}[r](){return Promise.all([this[E].close(),this[I].close()])}[n](){return Promise.all([this[E].destroy(),this[I].destroy()])}}},8712:(e,t,A)=>{"use strict";const s=A(5497),r=A(6294);e.exports=class extends s{#R=null;#v=null;constructor(e,t={}){super(t),this.#R=e,this.#v=t}dispatch(e,t){const A=new r({...e,retryOptions:this.#v},{dispatch:this.#R.dispatch.bind(this.#R),handler:t});return this.#R.dispatch(e,A)}close(){return this.#R.close()}destroy(){return this.#R.destroy()}}},9879:(e,t,A)=>{"use strict";const s=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:r}=A(4465),n=A(3315);function i(e){if(!e||"function"!=typeof e.dispatch)throw new r("Argument agent must implement Agent");Object.defineProperty(globalThis,s,{value:e,writable:!0,enumerable:!1,configurable:!1})}function o(){return globalThis[s]}void 0===o()&&i(new n);e.exports={setGlobalDispatcher:i,getGlobalDispatcher:o,installedExports:["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"]}},8358:(e,t,A)=>{"use strict";const s=A(2858),{parseCacheControlHeader:r,parseVaryHeader:n,isEtagUsable:i}=A(9453),{parseHttpDate:o}=A(8851);function a(){}const c=[200,203,204,206,300,301,308,404,405,410,414,501],l=[206,304];e.exports=class{#k;#T;#F;#M;#U;#L;constructor({store:e,type:t,cacheByDefault:A},s,r){this.#M=e,this.#T=t,this.#F=A,this.#k=s,this.#U=r}onRequestStart(e,t){this.#L?.destroy(),this.#L=void 0,this.#U.onRequestStart?.(e,t)}onRequestUpgrade(e,t,A,s){this.#U.onRequestUpgrade?.(e,t,A,s)}onResponseStart(e,t,A,h){const g=()=>this.#U.onResponseStart?.(e,t,A,h);if(!s.safeHTTPMethods.includes(this.#k.method)&&t>=200&&t<=399){try{this.#M.delete(this.#k)?.catch?.(a)}catch{}return g()}const d=A["cache-control"],u=A["last-modified"]&&c.includes(t);if(!(d||A.expires||u||this.#F))return g();const E=d?r(d):{};if(!function(e,t,A,s){if(t<200||l.includes(t))return!1;if(!(c.includes(t)||A.expires||s.public||void 0!==s["max-age"]||s.private&&"private"===e||void 0!==s["s-maxage"]&&"shared"===e))return!1;if(s["no-store"])return!1;if("shared"===e&&!0===s.private)return!1;if(A.vary?.includes("*"))return!1;if(A.authorization){if(!s.public||"string"!=typeof A.authorization)return!1;if(Array.isArray(s["no-cache"])&&s["no-cache"].includes("authorization"))return!1;if(Array.isArray(s.private)&&s.private.includes("authorization"))return!1}return!0}(this.#T,t,A,E))return g();const I=Date.now(),Q=A.age?function(e){const t=parseInt(Array.isArray(e)?e[0]:e);return isNaN(t)?void 0:1e3*t}(A.age):void 0;if(Q&&Q>=2147483647e3)return g();const C="string"==typeof A.date?o(A.date):void 0,B=function(e,t,A,s,r,n){if("shared"===e){const e=n["s-maxage"];if(void 0!==e)return e>0?1e3*e:void 0}const i=n["max-age"];if(void 0!==i)return i>0?1e3*i:void 0;if("string"==typeof s.expires){const e=o(s.expires);if(e){if(t>=e.getTime())return;if(r){if(r>=e)return;if(void 0!==A&&A>e-r)return}return e.getTime()-t}}if("string"==typeof s["last-modified"]){const e=new Date(s["last-modified"]);if((a=e)instanceof Date&&Number.isFinite(a.valueOf())){if(e.getTime()>=t)return;return.1*(t-e.getTime())}}var a;if(n.immutable)return 31536e3;return}(this.#T,I,Q,A,C,E)??this.#F;if(void 0===B||Q&&Q>B)return g();const p=C?C.getTime():I,f=B+p;if(I>=f)return g();let m;if(this.#k.headers&&A.vary&&(m=n(A.vary,this.#k.headers),!m))return g();const y=function(e,t,A){let s=-1/0,r=-1/0,n=-1/0;t["stale-while-revalidate"]&&(s=A+1e3*t["stale-while-revalidate"]);t["stale-if-error"]&&(r=A+1e3*t["stale-if-error"]);s===-1/0&&r===-1/0&&(n=e+31536e6);return Math.max(A,s,r,n)}(p,E,f),S=function(e,t){const A=["connection","proxy-authenticate","proxy-authentication-info","proxy-authorization","proxy-connection","te","transfer-encoding","upgrade","age"];e.connection&&(Array.isArray(e.connection)?A.push(...e.connection.map((e=>e.trim()))):A.push(...e.connection.split(",").map((e=>e.trim()))));Array.isArray(t["no-cache"])&&A.push(...t["no-cache"]);Array.isArray(t.private)&&A.push(...t.private);let s;for(const t of A)e[t]&&(s??={...e},delete s[t]);return s??e}(A,E),w={statusCode:t,statusMessage:h,headers:S,vary:m,cacheControlDirectives:E,cachedAt:Q?I-Q:I,staleAt:f,deleteAt:y};if("string"==typeof A.etag&&i(A.etag)&&(w.etag=A.etag),this.#L=this.#M.createWriteStream(this.#k,w),!this.#L)return g();const D=this;return this.#L.on("drain",(()=>e.resume())).on("error",(function(){D.#L=void 0,D.#M.delete(D.#k)})).on("close",(function(){D.#L===this&&(D.#L=void 0),e.resume()})),g()}onResponseData(e,t){!1===this.#L?.write(t)&&e.pause(),this.#U.onResponseData?.(e,t)}onResponseEnd(e,t){this.#L?.end(),this.#U.onResponseEnd?.(e,t)}onResponseError(e,t){this.#L?.destroy(t),this.#L=void 0,this.#U.onResponseError?.(e,t)}}},6607:(e,t,A)=>{"use strict";const s=A(4589);e.exports=class{#H=!1;#P;#U;#x;#Y;constructor(e,t,A){if("function"!=typeof e)throw new TypeError("callback must be a function");this.#P=e,this.#U=t,this.#Y=A}onRequestStart(e,t){this.#H=!1,this.#x=t}onRequestUpgrade(e,t,A,s){this.#U.onRequestUpgrade?.(e,t,A,s)}onResponseStart(e,t,A,r){if(s(null!=this.#P),this.#H=304===t||this.#Y&&t>=500&&t<=504,this.#P(this.#H,this.#x),this.#P=null,this.#H)return!0;this.#U.onRequestStart?.(e,this.#x),this.#U.onResponseStart?.(e,t,A,r)}onResponseData(e,t){if(!this.#H)return this.#U.onResponseData?.(e,t)}onResponseEnd(e,t){this.#H||this.#U.onResponseEnd?.(e,t)}onResponseError(e,t){if(!this.#H){if(this.#P&&(this.#P(!1),this.#P=null),"function"!=typeof this.#U.onResponseError)throw t;this.#U.onResponseError(e,t)}}}},6917:(e,t,A)=>{"use strict";const s=A(4589),r=A(832);e.exports=class{#U;#V=!1;#G=!1;#O=!1;constructor(e){if("object"!=typeof e||null===e)throw new TypeError("handler must be an object");this.#U=r.wrap(e)}onRequestStart(...e){this.#U.onRequestStart?.(...e)}onRequestUpgrade(...e){return s(!this.#V),s(!this.#G),this.#U.onRequestUpgrade?.(...e)}onResponseStart(...e){return s(!this.#V),s(!this.#G),s(!this.#O),this.#O=!0,this.#U.onResponseStart?.(...e)}onResponseData(...e){return s(!this.#V),s(!this.#G),this.#U.onResponseData?.(...e)}onResponseEnd(...e){return s(!this.#V),s(!this.#G),this.#V=!0,this.#U.onResponseEnd?.(...e)}onResponseError(...e){return this.#G=!0,this.#U.onResponseError?.(...e)}onBodySent(){}}},8064:(e,t,A)=>{"use strict";const s=A(2858),{kBodyUsed:r}=A(257),n=A(4589),{InvalidArgumentError:i}=A(4465),o=A(8474),a=[300,301,302,303,307,308],c=Symbol("body"),l=()=>{};class h{constructor(e){this[c]=e,this[r]=!1}async*[Symbol.asyncIterator](){n(!this[r],"disturbed"),this[r]=!0,yield*this[c]}}class g{static buildDispatch(e,t){if(null!=t&&(!Number.isInteger(t)||t<0))throw new i("maxRedirections must be a positive number");const A=e.dispatch.bind(e);return(e,s)=>A(e,new g(A,t,e,s))}constructor(e,t,A,a){if(null!=t&&(!Number.isInteger(t)||t<0))throw new i("maxRedirections must be a positive number");this.dispatch=e,this.location=null;const{maxRedirections:c,...l}=A;this.opts=l,this.maxRedirections=t,this.handler=a,this.history=[],s.isStream(this.opts.body)?(0===s.bodyLength(this.opts.body)&&this.opts.body.on("data",(function(){n(!1)})),"boolean"!=typeof this.opts.body.readableDidRead&&(this.opts.body[r]=!1,o.prototype.on.call(this.opts.body,"data",(function(){this[r]=!0})))):(this.opts.body&&"function"==typeof this.opts.body.pipeTo||this.opts.body&&"string"!=typeof this.opts.body&&!ArrayBuffer.isView(this.opts.body)&&s.isIterable(this.opts.body)&&!s.isFormDataLike(this.opts.body))&&(this.opts.body=new h(this.opts.body))}onRequestStart(e,t){this.handler.onRequestStart?.(e,{...t,history:this.history})}onRequestUpgrade(e,t,A,s){this.handler.onRequestUpgrade?.(e,t,A,s)}onResponseStart(e,t,A,r){if(this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections)throw new Error("max redirects");if(301!==t&&302!==t||"POST"!==this.opts.method||(this.opts.method="GET",s.isStream(this.opts.body)&&s.destroy(this.opts.body.on("error",l)),this.opts.body=null),303===t&&"HEAD"!==this.opts.method&&(this.opts.method="GET",s.isStream(this.opts.body)&&s.destroy(this.opts.body.on("error",l)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||s.isDisturbed(this.opts.body)||-1===a.indexOf(t)?null:A.location,this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location)return void this.handler.onResponseStart?.(e,t,A,r);const{origin:o,pathname:c,search:h}=s.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),g=h?`${c}${h}`:c,u=`${o}${g}`;for(const e of this.history)if(e.toString()===u)throw new i(`Redirect loop detected. Cannot redirect to ${o}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);this.opts.headers=function(e,t,A){const s=[];if(Array.isArray(e))for(let r=0;r<e.length;r+=2)d(e[r],t,A)||s.push(e[r],e[r+1]);else if(e&&"object"==typeof e){const r="function"==typeof e[Symbol.iterator]?e:Object.entries(e);for(const[e,n]of r)d(e,t,A)||s.push(e,n)}else n(null==e,"headers must be an object or an array");return s}(this.opts.headers,303===t,this.opts.origin!==o),this.opts.path=g,this.opts.origin=o,this.opts.query=null}onResponseData(e,t){this.location||this.handler.onResponseData?.(e,t)}onResponseEnd(e,t){this.location?this.dispatch(this.opts,this):this.handler.onResponseEnd(e,t)}onResponseError(e,t){this.handler.onResponseError?.(e,t)}}function d(e,t,A){if(4===e.length)return"host"===s.headerNameToString(e);if(t&&s.headerNameToString(e).startsWith("content-"))return!0;if(A&&(13===e.length||6===e.length||19===e.length)){const t=s.headerNameToString(e);return"authorization"===t||"cookie"===t||"proxy-authorization"===t}return!1}e.exports=g},6294:(e,t,A)=>{"use strict";const s=A(4589),{kRetryHandlerDefaultRetry:r}=A(257),{RequestRetryError:n}=A(4465),i=A(832),{isDisturbed:o,parseRangeHeader:a,wrapRequestBody:c}=A(2858);class l{constructor(e,{dispatch:t,handler:A}){const{retryOptions:s,...n}=e,{retry:o,maxRetries:a,maxTimeout:h,minTimeout:g,timeoutFactor:d,methods:u,errorCodes:E,retryAfter:I,statusCodes:Q,throwOnError:C}=s??{};this.error=null,this.dispatch=t,this.handler=i.wrap(A),this.opts={...n,body:c(e.body)},this.retryOpts={throwOnError:C??!0,retry:o??l[r],retryAfter:I??!0,maxTimeout:h??3e4,minTimeout:g??500,timeoutFactor:d??2,maxRetries:a??5,methods:u??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:Q??[500,502,503,504,429],errorCodes:E??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.headersSent=!1,this.start=0,this.end=null,this.etag=null}onResponseStartWithRetry(e,t,A,s,r){if(this.retryOpts.throwOnError)!1===this.retryOpts.statusCodes.includes(t)?(this.headersSent=!0,this.handler.onResponseStart?.(e,t,A,s)):this.error=r;else{if(o(this.opts.body))return this.headersSent=!0,void this.handler.onResponseStart?.(e,t,A,s);e.pause(),this.retryOpts.retry(r,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},function(n){if(n)return this.headersSent=!0,this.headersSent=!0,this.handler.onResponseStart?.(e,t,A,s),void e.resume();this.error=r,e.resume()}.bind(this))}}onRequestStart(e,t){this.headersSent||this.handler.onRequestStart?.(e,t)}onRequestUpgrade(e,t,A,s){this.handler.onRequestUpgrade?.(e,t,A,s)}static[r](e,{state:t,opts:A},s){const{statusCode:r,code:n,headers:i}=e,{method:o,retryOptions:a}=A,{maxRetries:c,minTimeout:l,maxTimeout:h,timeoutFactor:g,statusCodes:d,errorCodes:u,methods:E}=a,{counter:I}=t;if(n&&"UND_ERR_REQ_RETRY"!==n&&!u.includes(n))return void s(e);if(Array.isArray(E)&&!E.includes(o))return void s(e);if(null!=r&&Array.isArray(d)&&!d.includes(r))return void s(e);if(I>c)return void s(e);let Q=i?.["retry-after"];Q&&(Q=Number(Q),Q=Number.isNaN(Q)?function(e){const t=new Date(e).getTime();return isNaN(t)?0:t-Date.now()}(i["retry-after"]):1e3*Q);const C=Q>0?Math.min(Q,h):Math.min(l*g**(I-1),h);setTimeout((()=>s(null)),C)}onResponseStart(e,t,A,r){if(this.error=null,this.retryCount+=1,t>=300){const s=new n("Request failed",t,{headers:A,data:{count:this.retryCount}});this.onResponseStartWithRetry(e,t,A,r,s)}else{if(this.headersSent){if(206!==t&&(this.start>0||200!==t))throw new n("server does not support the range header and the payload was partially consumed",t,{headers:A,data:{count:this.retryCount}});const e=a(A["content-range"]);if(!e)throw new n("Content-Range mismatch",t,{headers:A,data:{count:this.retryCount}});if(null!=this.etag&&this.etag!==A.etag)throw new n("ETag mismatch",t,{headers:A,data:{count:this.retryCount}});const{start:r,size:i,end:o=(i?i-1:null)}=e;return s(this.start===r,"content-range mismatch"),void s(null==this.end||this.end===o,"content-range mismatch")}if(null!=this.end)throw new n("Request failed",t,{headers:A,data:{count:this.retryCount}});if(206===t){const n=a(A["content-range"]);if(null==n)return this.headersSent=!0,void this.handler.onResponseStart?.(e,t,A,r);const{start:i,size:o,end:c=(o?o-1:null)}=n;s(null!=i&&Number.isFinite(i),"content-range mismatch"),s(null!=c&&Number.isFinite(c),"invalid content-length"),this.start=i,this.end=c}if(null==this.end){const e=A["content-length"];this.end=null!=e?Number(e)-1:null}s(Number.isFinite(this.start)),s(null==this.end||Number.isFinite(this.end),"invalid content-length"),this.resume=!0,this.etag=null!=A.etag?A.etag:null,null!=this.etag&&"W"===this.etag[0]&&"/"===this.etag[1]&&(this.etag=null),this.headersSent=!0,this.handler.onResponseStart?.(e,t,A,r)}}onResponseData(e,t){this.error||(this.start+=t.length,this.handler.onResponseData?.(e,t))}onResponseEnd(e,t){if(this.error&&this.retryOpts.throwOnError)throw this.error;if(!this.error)return this.retryCount=0,this.handler.onResponseEnd?.(e,t);this.retry(e)}retry(e){if(0!==this.start){const e={range:`bytes=${this.start}-${this.end??""}`};null!=this.etag&&(e["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...e}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(t){this.handler.onResponseError?.(e,t)}}onResponseError(e,t){e?.aborted||o(this.opts.body)?this.handler.onResponseError?.(e,t):(this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(t,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},function(t){t?this.handler?.onResponseError?.(e,t):this.retry(e)}.bind(this)))}}e.exports=l},4555:(e,t,A)=>{"use strict";const{parseHeaders:s}=A(2858),{InvalidArgumentError:r}=A(4465),n=Symbol("resume");class i{#J=!1;#W=null;#_=!1;#q;[n]=null;constructor(e){this.#q=e}pause(){this.#J=!0}resume(){this.#J&&(this.#J=!1,this[n]?.())}abort(e){this.#_||(this.#_=!0,this.#W=e,this.#q(e))}get aborted(){return this.#_}get reason(){return this.#W}get paused(){return this.#J}}e.exports=class e{#U;#$;constructor(e){this.#U=e}static unwrap(t){return t.onRequestStart?new e(t):t}onConnect(e,t){this.#$=new i(e),this.#U.onRequestStart?.(this.#$,t)}onUpgrade(e,t,A){this.#U.onRequestUpgrade?.(this.#$,e,s(t),A)}onHeaders(e,t,A,r){return this.#$[n]=A,this.#U.onResponseStart?.(this.#$,e,s(t),r),!this.#$.paused}onData(e){return this.#U.onResponseData?.(this.#$,e),!this.#$.paused}onComplete(e){this.#U.onResponseEnd?.(this.#$,s(e))}onError(e){if(!this.#U.onResponseError)throw new r("invalid onError method");this.#U.onResponseError?.(this.#$,e)}}},832:(e,t,A)=>{"use strict";const{InvalidArgumentError:s}=A(4465);e.exports=class e{#U;constructor(e){this.#U=e}static wrap(t){return t.onRequestStart?t:new e(t)}onConnect(e,t){return this.#U.onConnect?.(e,t)}onHeaders(e,t,A,s){return this.#U.onHeaders?.(e,t,A,s)}onUpgrade(e,t,A){return this.#U.onUpgrade?.(e,t,A)}onData(e){return this.#U.onData?.(e)}onComplete(e){return this.#U.onComplete?.(e)}onError(e){if(!this.#U.onError)throw e;return this.#U.onError?.(e)}onRequestStart(e,t){this.#U.onConnect?.((t=>e.abort(t)),t)}onRequestUpgrade(e,t,A,s){const r=[];for(const[e,t]of Object.entries(A))r.push(Buffer.from(e),Array.isArray(t)?t.map((e=>Buffer.from(e))):Buffer.from(t));this.#U.onUpgrade?.(t,r,s)}onResponseStart(e,t,A,s){const r=[];for(const[e,t]of Object.entries(A))r.push(Buffer.from(e),Array.isArray(t)?t.map((e=>Buffer.from(e))):Buffer.from(t));!1===this.#U.onHeaders?.(t,r,(()=>e.resume()),s)&&e.pause()}onResponseData(e,t){!1===this.#U.onData?.(t)&&e.pause()}onResponseEnd(e,t){const A=[];for(const[e,s]of Object.entries(t))A.push(Buffer.from(e),Array.isArray(s)?s.map((e=>Buffer.from(e))):Buffer.from(s));this.#U.onComplete?.(A)}onResponseError(e,t){if(!this.#U.onError)throw new s("invalid onError method");this.#U.onError?.(t)}}},5752:(e,t,A)=>{"use strict";const s=A(4589),{Readable:r}=A(7075),n=A(2858),i=A(8358),o=A(9903),a=A(6607),{assertCacheStore:c,assertCacheMethods:l,makeCacheKey:h,normalizeHeaders:g,parseCacheControlHeader:d}=A(9453),{AbortError:u}=A(4465);function E(e,t,A,i,o,a){const c=n.isStream(A.body)?A.body:r.from(A.body??[]);s(!c.destroyed,"stream should not be destroyed"),s(!c.readableDidRead,"stream should not be readableDidRead");const l={resume(){c.resume()},pause(){c.pause()},get paused(){return c.isPaused()},get aborted(){return c.destroyed},get reason(){return c.errored},abort(e){c.destroy(e??new u)}};if(c.on("error",(function(t){if(!this.readableEnded){if("function"!=typeof e.onResponseError)throw t;e.onResponseError(l,t)}})).on("close",(function(){this.errored||e.onResponseEnd?.(l,{})})),e.onRequestStart?.(l,o),c.destroyed)return;const h={...A.headers,age:String(i)};a&&(h.warning='110 - "response is stale"'),e.onResponseStart?.(l,A.statusCode,h,A.statusMessage),"HEAD"===t.method?c.destroy():c.on("data",(function(t){e.onResponseData?.(l,t)}))}function I(e,t,A,s,r,o,c){if(!c)return function(e,t,A,s,r,n){if(n?.["only-if-cached"]){let e=!1;try{if("function"==typeof s.onConnect&&(s.onConnect((()=>{e=!0})),e))return;if("function"==typeof s.onHeaders&&(s.onHeaders(504,[],(()=>{}),"Gateway Timeout"),e))return;"function"==typeof s.onComplete&&s.onComplete([])}catch(e){"function"==typeof s.onError&&s.onError(e)}return!0}return e(r,new i(t,A,s))}(e,t,A,s,r,o);const l=Date.now();if(l>c.deleteAt)return e(r,new i(t,A,s));const h=Math.round((l-c.cachedAt)/1e3);if(o?.["max-age"]&&h>=o["max-age"])return e(r,s);if(function(e,t){if(t?.["no-cache"])return!0;if(e.cacheControlDirectives?.["no-cache"]&&!Array.isArray(e.cacheControlDirectives["no-cache"]))return!0;const A=Date.now();if(A>e.staleAt)return!t?.["max-stale"]||A>e.staleAt+1e3*t["max-stale"];if(t?.["min-fresh"])return e.staleAt-A<=1e3*t["min-fresh"];return!1}(c,o)){if(n.isStream(r.body)&&0!==n.bodyLength(r.body))return e(r,new i(t,A,s));if(function(e){const t=e.cacheControlDirectives?.["stale-while-revalidate"];return!!t&&Date.now()<=e.staleAt+1e3*t}(c))return E(s,r,c,h,null,!0),queueMicrotask((()=>{let s={...r.headers,"if-modified-since":new Date(c.cachedAt).toUTCString()};c.etag&&(s["if-none-match"]=c.etag),c.vary&&(s={...s,...c.vary}),e({...r,headers:s},new i(t,A,{onRequestStart(){},onRequestUpgrade(){},onResponseStart(){},onResponseData(){},onResponseEnd(){},onResponseError(){}}))})),!0;let g=!1;const d=c.cacheControlDirectives["stale-if-error"]??o?.["stale-if-error"];d&&(g=l<c.staleAt+1e3*d);let u={...r.headers,"if-modified-since":new Date(c.cachedAt).toUTCString()};return c.etag&&(u["if-none-match"]=c.etag),c.vary&&(u={...u,...c.vary}),e({...r,headers:u},new a(((e,t)=>{e?E(s,r,c,h,t,!0):n.isStream(c.body)&&c.body.on("error",(()=>{})).destroy()}),new i(t,A,s),g))}n.isStream(r.body)&&r.body.on("error",(()=>{})).destroy(),E(s,r,c,h,null,!1)}e.exports=(e={})=>{const{store:t=new o,methods:A=["GET"],cacheByDefault:s,type:r="shared"}=e;if("object"!=typeof e||null===e)throw new TypeError("expected type of opts to be an Object, got "+(null===e?"null":typeof e));if(c(t,"opts.store"),l(A,"opts.methods"),"undefined"!=typeof s&&"number"!=typeof s)throw new TypeError("expected opts.cacheByDefault to be number or undefined, got "+typeof s);if("undefined"!=typeof r&&"shared"!==r&&"private"!==r)throw new TypeError("expected opts.type to be shared, private, or undefined, got "+typeof r);const i={store:t,methods:A,cacheByDefault:s,type:r},a=n.safeHTTPMethods.filter((e=>!1===A.includes(e)));return e=>(A,s)=>{if(!A.origin||a.includes(A.method))return e(A,s);A={...A,headers:g(A)};const r=A.headers?.["cache-control"]?d(A.headers["cache-control"]):void 0;if(r?.["no-store"])return e(A,s);const n=h(A),o=t.get(n);return o&&"function"==typeof o.then?o.then((t=>{I(e,i,n,s,A,r,t)})):I(e,i,n,s,A,r,o),!0}}},4951:(e,t,A)=>{"use strict";const{createInflate:s,createGunzip:r,createBrotliDecompress:n,createZstdDecompress:i}=A(8522),{pipeline:o}=A(7075),a=A(6917),c={gzip:r,"x-gzip":r,br:n,deflate:s,compress:s,"x-compress":s,...i?{zstd:i}:{}},l=[204,304];let h=!1;class g extends a{#X=[];#z;#Z;#j;constructor(e,{skipStatusCodes:t=l,skipErrorResponses:A=!0}={}){super(e),this.#Z=t,this.#j=A}#K(e,t){return!e||t<200||(!!this.#Z.includes(t)||!!(this.#j&&t>=400))}#ee(e){const t=e.split(","),A=[];for(let e=t.length-1;e>=0;e--){const s=t[e].trim();if(s){if(!c[s])return A.length=0,A;A.push(c[s]())}}return A}#te(e,t){e.on("readable",(()=>{let A;for(;null!==(A=e.read());){if(!1===super.onResponseData(t,A))break}})),e.on("error",(e=>{super.onResponseError(t,e)}))}#Ae(e){const t=this.#X[0];this.#te(t,e),t.on("end",(()=>{super.onResponseEnd(e,{})}))}#se(e){const t=this.#X[this.#X.length-1];this.#te(t,e),this.#z=o(this.#X,(t=>{t?super.onResponseError(e,t):super.onResponseEnd(e,{})}))}#re(){this.#X.length=0,this.#z=null}onResponseStart(e,t,A,s){const r=A["content-encoding"];if(this.#K(r,t))return super.onResponseStart(e,t,A,s);const n=this.#ee(r.toLowerCase());if(0===n.length)return this.#re(),super.onResponseStart(e,t,A,s);this.#X=n;const{"content-encoding":i,"content-length":o,...a}=A;1===this.#X.length?this.#Ae(e):this.#se(e),super.onResponseStart(e,t,a,s)}onResponseData(e,t){this.#X.length>0?this.#X[0].write(t):super.onResponseData(e,t)}onResponseEnd(e,t){if(this.#X.length>0)return this.#X[0].end(),void this.#re();super.onResponseEnd(e,t)}onResponseError(e,t){if(this.#X.length>0){for(const e of this.#X)e.destroy(t);this.#re()}super.onResponseError(e,t)}}e.exports=function(e={}){return h||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),h=!0),t=>(A,s)=>{const r=new g(s,e);return t(A,r)}}},6677:(e,t,A)=>{"use strict";const{isIP:s}=A(7030),{lookup:r}=A(610),n=A(6917),{InvalidArgumentError:i,InformationalError:o}=A(4465),a=Math.pow(2,31)-1;class c{#ne=0;#ie=0;#oe=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(e){this.#ne=e.maxTTL,this.#ie=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#ae,this.pick=e.pick??this.#ce}get full(){return this.#oe.size===this.#ie}runLookup(e,t,A){const s=this.#oe.get(e.hostname);if(null==s&&this.full)return void A(null,e);const r={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...t.dns,maxTTL:this.#ne,maxItems:this.#ie};if(null==s)this.lookup(e,r,((t,s)=>{if(t||null==s||0===s.length)return void A(t??new o("No DNS entries found"));this.setRecords(e,s);const n=this.#oe.get(e.hostname),i=this.pick(e,n,r.affinity);let a;a="number"==typeof i.port?`:${i.port}`:""!==e.port?`:${e.port}`:"",A(null,new URL(`${e.protocol}//${6===i.family?`[${i.address}]`:i.address}${a}`))}));else{const n=this.pick(e,s,r.affinity);if(null==n)return this.#oe.delete(e.hostname),void this.runLookup(e,t,A);let i;i="number"==typeof n.port?`:${n.port}`:""!==e.port?`:${e.port}`:"",A(null,new URL(`${e.protocol}//${6===n.family?`[${n.address}]`:n.address}${i}`))}}#ae(e,t,A){r(e.hostname,{all:!0,family:!1===this.dualStack?this.affinity:0,order:"ipv4first"},((e,t)=>{if(e)return A(e);const s=new Map;for(const e of t)s.set(`${e.address}:${e.family}`,e);A(null,s.values())}))}#ce(e,t,A){let s=null;const{records:r,offset:n}=t;let i;if(this.dualStack?(null==A&&(null==n||n===a?(t.offset=0,A=4):(t.offset++,A=1&~t.offset?4:6)),i=null!=r[A]&&r[A].ips.length>0?r[A]:r[4===A?6:4]):i=r[A],null==i||0===i.ips.length)return s;null==i.offset||i.offset===a?i.offset=0:i.offset++;const o=i.offset%i.ips.length;return s=i.ips[o]??null,null==s?s:Date.now()-s.timestamp>s.ttl?(i.ips.splice(o,1),this.pick(e,t,A)):s}pickFamily(e,t){const A=this.#oe.get(e.hostname)?.records;if(!A)return null;const s=A[t];if(!s)return null;null==s.offset||s.offset===a?s.offset=0:s.offset++;const r=s.offset%s.ips.length,n=s.ips[r]??null;return null==n||Date.now()-n.timestamp>n.ttl&&s.ips.splice(r,1),n}setRecords(e,t){const A=Date.now(),s={records:{4:null,6:null}};for(const e of t){e.timestamp=A,"number"==typeof e.ttl?e.ttl=Math.min(e.ttl,this.#ne):e.ttl=this.#ne;const t=s.records[e.family]??{ips:[]};t.ips.push(e),s.records[e.family]=t}this.#oe.set(e.hostname,s)}deleteRecords(e){this.#oe.delete(e.hostname)}getHandler(e,t){return new l(this,e,t)}}class l extends n{#le=null;#p=null;#he=null;#ge=null;#$=null;#de=null;#ue=!0;constructor(e,{origin:t,handler:A,dispatch:s,newOrigin:r},n){super(A),this.#ge=t,this.#de=r,this.#p={...n},this.#le=e,this.#he=s}onResponseError(e,t){switch(t.code){case"ETIMEDOUT":case"ECONNREFUSED":if(this.#le.dualStack){if(!this.#ue)return void super.onResponseError(e,t);this.#ue=!1;const A="["===this.#de.hostname[0]?4:6,s=this.#le.pickFamily(this.#ge,A);if(null==s)return void super.onResponseError(e,t);let r;r="number"==typeof s.port?`:${s.port}`:""!==this.#ge.port?`:${this.#ge.port}`:"";const n={...this.#p,origin:`${this.#ge.protocol}//${6===s.family?`[${s.address}]`:s.address}${r}`};return void this.#he(n,this)}super.onResponseError(e,t);break;case"ENOTFOUND":this.#le.deleteRecords(this.#ge),super.onResponseError(e,t);break;default:super.onResponseError(e,t)}}}e.exports=e=>{if(null!=e?.maxTTL&&("number"!=typeof e?.maxTTL||e?.maxTTL<0))throw new i("Invalid maxTTL. Must be a positive number");if(null!=e?.maxItems&&("number"!=typeof e?.maxItems||e?.maxItems<1))throw new i("Invalid maxItems. Must be a positive number and greater than zero");if(null!=e?.affinity&&4!==e?.affinity&&6!==e?.affinity)throw new i("Invalid affinity. Must be either 4 or 6");if(null!=e?.dualStack&&"boolean"!=typeof e?.dualStack)throw new i("Invalid dualStack. Must be a boolean");if(null!=e?.lookup&&"function"!=typeof e?.lookup)throw new i("Invalid lookup. Must be a function");if(null!=e?.pick&&"function"!=typeof e?.pick)throw new i("Invalid pick. Must be a function");const t=e?.dualStack??!0;let A;A=t?e?.affinity??null:e?.affinity??4;const r=new c({maxTTL:e?.maxTTL??1e4,lookup:e?.lookup??null,pick:e?.pick??null,dualStack:t,affinity:A,maxItems:e?.maxItems??1/0});return e=>function(t,A){const n=t.origin.constructor===URL?t.origin:new URL(t.origin);return 0!==s(n.hostname)?e(t,A):(r.runLookup(n,t,((s,i)=>{if(s)return A.onResponseError(null,s);const o={...t,servername:n.hostname,origin:i.origin,headers:{host:n.host,...t.headers}};e(o,r.getHandler({origin:n,dispatch:e,handler:A,newOrigin:i},t))})),!0)}}},3562:(e,t,A)=>{"use strict";const{InvalidArgumentError:s,RequestAbortedError:r}=A(4465),n=A(6917);class i extends n{#t=1048576;#Ee=!1;#s=0;#$=null;aborted=!1;reason=!1;constructor({maxSize:e,signal:t},A){if(null!=e&&(!Number.isFinite(e)||e<1))throw new s("maxSize must be a number greater than 0");super(A),this.#t=e??this.#t}#q(e){this.aborted=!0,this.reason=e}onRequestStart(e,t){return e.abort=this.#q.bind(this),this.#$=e,super.onRequestStart(e,t)}onResponseStart(e,t,A,s){const n=A["content-length"];if(null!=n&&n>this.#t)throw new r(`Response size (${n}) larger than maxSize (${this.#t})`);return!0===this.aborted||super.onResponseStart(e,t,A,s)}onResponseError(e,t){this.#Ee||(t=this.#$?.reason??t,super.onResponseError(e,t))}onResponseData(e,t){return this.#s=this.#s+t.length,this.#s>=this.#t&&(this.#Ee=!0,!0===this.aborted?super.onResponseError(e,this.reason):super.onResponseEnd(e,{})),!0}onResponseEnd(e,t){this.#Ee||(!0!==this.#$.aborted?super.onResponseEnd(e,t):super.onResponseError(e,this.reason))}}e.exports=function({maxSize:e}={maxSize:1048576}){return t=>function(A,s){const{dumpMaxSize:r=e}=A,n=new i({maxSize:r,signal:A.signal},s);return t(A,n)}}},5132:(e,t,A)=>{"use strict";const s=A(8064);e.exports=function({maxRedirections:e}={}){return t=>function(A,r){const{maxRedirections:n=e,...i}=A;if(null==n||0===n)return t(A,r);const o={...i},a=new s(t,n,o,r);return t(o,a)}}},2936:(e,t,A)=>{"use strict";const s=A(6917),{ResponseError:r}=A(4465);class n extends s{#Ie;#Qe;#Ce;#Be;#pe;constructor(e,{handler:t}){super(t)}#fe(e){return 0===(this.#Qe??"").indexOf(e)}onRequestStart(e,t){return this.#Ie=0,this.#Qe=null,this.#Ce=null,this.#Be=null,this.#pe="",super.onRequestStart(e,t)}onResponseStart(e,t,A,s){if(this.#Ie=t,this.#Be=A,this.#Qe=A["content-type"],this.#Ie<400)return super.onResponseStart(e,t,A,s);(this.#fe("application/json")||this.#fe("text/plain"))&&(this.#Ce=new TextDecoder("utf-8"))}onResponseData(e,t){if(this.#Ie<400)return super.onResponseData(e,t);this.#pe+=this.#Ce?.decode(t,{stream:!0})??""}onResponseEnd(e,t){if(this.#Ie>=400){if(this.#pe+=this.#Ce?.decode(void 0,{stream:!1})??"",this.#fe("application/json"))try{this.#pe=JSON.parse(this.#pe)}catch{}let t;const A=Error.stackTraceLimit;Error.stackTraceLimit=0;try{t=new r("Response Error",this.#Ie,{body:this.#pe,headers:this.#Be})}finally{Error.stackTraceLimit=A}super.onResponseError(e,t)}else super.onResponseEnd(e,t)}onResponseError(e,t){super.onResponseError(e,t)}}e.exports=()=>e=>function(t,A){return e(t,new n(t,{handler:A}))}},532:(e,t,A)=>{"use strict";const s=A(6294);e.exports=e=>t=>function(A,r){return t(A,new s({...A,retryOptions:{...e,...A.retryOptions}},{handler:r,dispatch:t}))}},4178:(e,t,A)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SPECIAL_HEADERS=t.MINOR=t.MAJOR=t.HTAB_SP_VCHAR_OBS_TEXT=t.QUOTED_STRING=t.CONNECTION_TOKEN_CHARS=t.HEADER_CHARS=t.TOKEN=t.HEX=t.URL_CHAR=t.USERINFO_CHARS=t.MARK=t.ALPHANUM=t.NUM=t.HEX_MAP=t.NUM_MAP=t.ALPHA=t.STATUSES_HTTP=t.H_METHOD_MAP=t.METHOD_MAP=t.METHODS_RTSP=t.METHODS_ICE=t.METHODS_HTTP=t.HEADER_STATE=t.FINISH=t.STATUSES=t.METHODS=t.LENIENT_FLAGS=t.FLAGS=t.TYPE=t.ERROR=void 0;const s=A(3530);t.ERROR={OK:0,INTERNAL:1,STRICT:2,CR_EXPECTED:25,LF_EXPECTED:3,UNEXPECTED_CONTENT_LENGTH:4,UNEXPECTED_SPACE:30,CLOSED_CONNECTION:5,INVALID_METHOD:6,INVALID_URL:7,INVALID_CONSTANT:8,INVALID_VERSION:9,INVALID_HEADER_TOKEN:10,INVALID_CONTENT_LENGTH:11,INVALID_CHUNK_SIZE:12,INVALID_STATUS:13,INVALID_EOF_STATE:14,INVALID_TRANSFER_ENCODING:15,CB_MESSAGE_BEGIN:16,CB_HEADERS_COMPLETE:17,CB_MESSAGE_COMPLETE:18,CB_CHUNK_HEADER:19,CB_CHUNK_COMPLETE:20,PAUSED:21,PAUSED_UPGRADE:22,PAUSED_H2_UPGRADE:23,USER:24,CB_URL_COMPLETE:26,CB_STATUS_COMPLETE:27,CB_METHOD_COMPLETE:32,CB_VERSION_COMPLETE:33,CB_HEADER_FIELD_COMPLETE:28,CB_HEADER_VALUE_COMPLETE:29,CB_CHUNK_EXTENSION_NAME_COMPLETE:34,CB_CHUNK_EXTENSION_VALUE_COMPLETE:35,CB_RESET:31,CB_PROTOCOL_COMPLETE:38},t.TYPE={BOTH:0,REQUEST:1,RESPONSE:2},t.FLAGS={CONNECTION_KEEP_ALIVE:1,CONNECTION_CLOSE:2,CONNECTION_UPGRADE:4,CHUNKED:8,UPGRADE:16,CONTENT_LENGTH:32,SKIPBODY:64,TRAILING:128,TRANSFER_ENCODING:512},t.LENIENT_FLAGS={HEADERS:1,CHUNKED_LENGTH:2,KEEP_ALIVE:4,TRANSFER_ENCODING:8,VERSION:16,DATA_AFTER_CLOSE:32,OPTIONAL_LF_AFTER_CR:64,OPTIONAL_CRLF_AFTER_CHUNK:128,OPTIONAL_CR_BEFORE_LF:256,SPACES_AFTER_CHUNK_SIZE:512},t.METHODS={DELETE:0,GET:1,HEAD:2,POST:3,PUT:4,CONNECT:5,OPTIONS:6,TRACE:7,COPY:8,LOCK:9,MKCOL:10,MOVE:11,PROPFIND:12,PROPPATCH:13,SEARCH:14,UNLOCK:15,BIND:16,REBIND:17,UNBIND:18,ACL:19,REPORT:20,MKACTIVITY:21,CHECKOUT:22,MERGE:23,"M-SEARCH":24,NOTIFY:25,SUBSCRIBE:26,UNSUBSCRIBE:27,PATCH:28,PURGE:29,MKCALENDAR:30,LINK:31,UNLINK:32,SOURCE:33,PRI:34,DESCRIBE:35,ANNOUNCE:36,SETUP:37,PLAY:38,PAUSE:39,TEARDOWN:40,GET_PARAMETER:41,SET_PARAMETER:42,REDIRECT:43,RECORD:44,FLUSH:45,QUERY:46},t.STATUSES={CONTINUE:100,SWITCHING_PROTOCOLS:101,PROCESSING:102,EARLY_HINTS:103,RESPONSE_IS_STALE:110,REVALIDATION_FAILED:111,DISCONNECTED_OPERATION:112,HEURISTIC_EXPIRATION:113,MISCELLANEOUS_WARNING:199,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTI_STATUS:207,ALREADY_REPORTED:208,TRANSFORMATION_APPLIED:214,IM_USED:226,MISCELLANEOUS_PERSISTENT_WARNING:299,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,SWITCH_PROXY:306,TEMPORARY_REDIRECT:307,PERMANENT_REDIRECT:308,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,IM_A_TEAPOT:418,PAGE_EXPIRED:419,ENHANCE_YOUR_CALM:420,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL:430,REQUEST_HEADER_FIELDS_TOO_LARGE:431,LOGIN_TIMEOUT:440,NO_RESPONSE:444,RETRY_WITH:449,BLOCKED_BY_PARENTAL_CONTROL:450,UNAVAILABLE_FOR_LEGAL_REASONS:451,CLIENT_CLOSED_LOAD_BALANCED_REQUEST:460,INVALID_X_FORWARDED_FOR:463,REQUEST_HEADER_TOO_LARGE:494,SSL_CERTIFICATE_ERROR:495,SSL_CERTIFICATE_REQUIRED:496,HTTP_REQUEST_SENT_TO_HTTPS_PORT:497,INVALID_TOKEN:498,CLIENT_CLOSED_REQUEST:499,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,BANDWIDTH_LIMIT_EXCEEDED:509,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511,WEB_SERVER_UNKNOWN_ERROR:520,WEB_SERVER_IS_DOWN:521,CONNECTION_TIMEOUT:522,ORIGIN_IS_UNREACHABLE:523,TIMEOUT_OCCURED:524,SSL_HANDSHAKE_FAILED:525,INVALID_SSL_CERTIFICATE:526,RAILGUN_ERROR:527,SITE_IS_OVERLOADED:529,SITE_IS_FROZEN:530,IDENTITY_PROVIDER_AUTHENTICATION_ERROR:561,NETWORK_READ_TIMEOUT:598,NETWORK_CONNECT_TIMEOUT:599},t.FINISH={SAFE:0,SAFE_WITH_CB:1,UNSAFE:2},t.HEADER_STATE={GENERAL:0,CONNECTION:1,CONTENT_LENGTH:2,TRANSFER_ENCODING:3,UPGRADE:4,CONNECTION_KEEP_ALIVE:5,CONNECTION_CLOSE:6,CONNECTION_UPGRADE:7,TRANSFER_ENCODING_CHUNKED:8},t.METHODS_HTTP=[t.METHODS.DELETE,t.METHODS.GET,t.METHODS.HEAD,t.METHODS.POST,t.METHODS.PUT,t.METHODS.CONNECT,t.METHODS.OPTIONS,t.METHODS.TRACE,t.METHODS.COPY,t.METHODS.LOCK,t.METHODS.MKCOL,t.METHODS.MOVE,t.METHODS.PROPFIND,t.METHODS.PROPPATCH,t.METHODS.SEARCH,t.METHODS.UNLOCK,t.METHODS.BIND,t.METHODS.REBIND,t.METHODS.UNBIND,t.METHODS.ACL,t.METHODS.REPORT,t.METHODS.MKACTIVITY,t.METHODS.CHECKOUT,t.METHODS.MERGE,t.METHODS["M-SEARCH"],t.METHODS.NOTIFY,t.METHODS.SUBSCRIBE,t.METHODS.UNSUBSCRIBE,t.METHODS.PATCH,t.METHODS.PURGE,t.METHODS.MKCALENDAR,t.METHODS.LINK,t.METHODS.UNLINK,t.METHODS.PRI,t.METHODS.SOURCE,t.METHODS.QUERY],t.METHODS_ICE=[t.METHODS.SOURCE],t.METHODS_RTSP=[t.METHODS.OPTIONS,t.METHODS.DESCRIBE,t.METHODS.ANNOUNCE,t.METHODS.SETUP,t.METHODS.PLAY,t.METHODS.PAUSE,t.METHODS.TEARDOWN,t.METHODS.GET_PARAMETER,t.METHODS.SET_PARAMETER,t.METHODS.REDIRECT,t.METHODS.RECORD,t.METHODS.FLUSH,t.METHODS.GET,t.METHODS.POST],t.METHOD_MAP=(0,s.enumToMap)(t.METHODS),t.H_METHOD_MAP=Object.fromEntries(Object.entries(t.METHODS).filter((([e])=>e.startsWith("H")))),t.STATUSES_HTTP=[t.STATUSES.CONTINUE,t.STATUSES.SWITCHING_PROTOCOLS,t.STATUSES.PROCESSING,t.STATUSES.EARLY_HINTS,t.STATUSES.RESPONSE_IS_STALE,t.STATUSES.REVALIDATION_FAILED,t.STATUSES.DISCONNECTED_OPERATION,t.STATUSES.HEURISTIC_EXPIRATION,t.STATUSES.MISCELLANEOUS_WARNING,t.STATUSES.OK,t.STATUSES.CREATED,t.STATUSES.ACCEPTED,t.STATUSES.NON_AUTHORITATIVE_INFORMATION,t.STATUSES.NO_CONTENT,t.STATUSES.RESET_CONTENT,t.STATUSES.PARTIAL_CONTENT,t.STATUSES.MULTI_STATUS,t.STATUSES.ALREADY_REPORTED,t.STATUSES.TRANSFORMATION_APPLIED,t.STATUSES.IM_USED,t.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,t.STATUSES.MULTIPLE_CHOICES,t.STATUSES.MOVED_PERMANENTLY,t.STATUSES.FOUND,t.STATUSES.SEE_OTHER,t.STATUSES.NOT_MODIFIED,t.STATUSES.USE_PROXY,t.STATUSES.SWITCH_PROXY,t.STATUSES.TEMPORARY_REDIRECT,t.STATUSES.PERMANENT_REDIRECT,t.STATUSES.BAD_REQUEST,t.STATUSES.UNAUTHORIZED,t.STATUSES.PAYMENT_REQUIRED,t.STATUSES.FORBIDDEN,t.STATUSES.NOT_FOUND,t.STATUSES.METHOD_NOT_ALLOWED,t.STATUSES.NOT_ACCEPTABLE,t.STATUSES.PROXY_AUTHENTICATION_REQUIRED,t.STATUSES.REQUEST_TIMEOUT,t.STATUSES.CONFLICT,t.STATUSES.GONE,t.STATUSES.LENGTH_REQUIRED,t.STATUSES.PRECONDITION_FAILED,t.STATUSES.PAYLOAD_TOO_LARGE,t.STATUSES.URI_TOO_LONG,t.STATUSES.UNSUPPORTED_MEDIA_TYPE,t.STATUSES.RANGE_NOT_SATISFIABLE,t.STATUSES.EXPECTATION_FAILED,t.STATUSES.IM_A_TEAPOT,t.STATUSES.PAGE_EXPIRED,t.STATUSES.ENHANCE_YOUR_CALM,t.STATUSES.MISDIRECTED_REQUEST,t.STATUSES.UNPROCESSABLE_ENTITY,t.STATUSES.LOCKED,t.STATUSES.FAILED_DEPENDENCY,t.STATUSES.TOO_EARLY,t.STATUSES.UPGRADE_REQUIRED,t.STATUSES.PRECONDITION_REQUIRED,t.STATUSES.TOO_MANY_REQUESTS,t.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,t.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,t.STATUSES.LOGIN_TIMEOUT,t.STATUSES.NO_RESPONSE,t.STATUSES.RETRY_WITH,t.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,t.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,t.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,t.STATUSES.INVALID_X_FORWARDED_FOR,t.STATUSES.REQUEST_HEADER_TOO_LARGE,t.STATUSES.SSL_CERTIFICATE_ERROR,t.STATUSES.SSL_CERTIFICATE_REQUIRED,t.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,t.STATUSES.INVALID_TOKEN,t.STATUSES.CLIENT_CLOSED_REQUEST,t.STATUSES.INTERNAL_SERVER_ERROR,t.STATUSES.NOT_IMPLEMENTED,t.STATUSES.BAD_GATEWAY,t.STATUSES.SERVICE_UNAVAILABLE,t.STATUSES.GATEWAY_TIMEOUT,t.STATUSES.HTTP_VERSION_NOT_SUPPORTED,t.STATUSES.VARIANT_ALSO_NEGOTIATES,t.STATUSES.INSUFFICIENT_STORAGE,t.STATUSES.LOOP_DETECTED,t.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,t.STATUSES.NOT_EXTENDED,t.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,t.STATUSES.WEB_SERVER_UNKNOWN_ERROR,t.STATUSES.WEB_SERVER_IS_DOWN,t.STATUSES.CONNECTION_TIMEOUT,t.STATUSES.ORIGIN_IS_UNREACHABLE,t.STATUSES.TIMEOUT_OCCURED,t.STATUSES.SSL_HANDSHAKE_FAILED,t.STATUSES.INVALID_SSL_CERTIFICATE,t.STATUSES.RAILGUN_ERROR,t.STATUSES.SITE_IS_OVERLOADED,t.STATUSES.SITE_IS_FROZEN,t.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,t.STATUSES.NETWORK_READ_TIMEOUT,t.STATUSES.NETWORK_CONNECT_TIMEOUT],t.ALPHA=[];for(let e="A".charCodeAt(0);e<="Z".charCodeAt(0);e++)t.ALPHA.push(String.fromCharCode(e)),t.ALPHA.push(String.fromCharCode(e+32));t.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9},t.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},t.NUM=["0","1","2","3","4","5","6","7","8","9"],t.ALPHANUM=t.ALPHA.concat(t.NUM),t.MARK=["-","_",".","!","~","*","'","(",")"],t.USERINFO_CHARS=t.ALPHANUM.concat(t.MARK).concat(["%",";",":","&","=","+","$",","]),t.URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(t.ALPHANUM),t.HEX=t.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]),t.TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(t.ALPHANUM),t.HEADER_CHARS=["\t"];for(let e=32;e<=255;e++)127!==e&&t.HEADER_CHARS.push(e);t.CONNECTION_TOKEN_CHARS=t.HEADER_CHARS.filter((e=>44!==e)),t.QUOTED_STRING=["\t"," "];for(let e=33;e<=255;e++)34!==e&&92!==e&&t.QUOTED_STRING.push(e);t.HTAB_SP_VCHAR_OBS_TEXT=["\t"," "];for(let e=33;e<=126;e++)t.HTAB_SP_VCHAR_OBS_TEXT.push(e);for(let e=128;e<=255;e++)t.HTAB_SP_VCHAR_OBS_TEXT.push(e);t.MAJOR=t.NUM_MAP,t.MINOR=t.MAJOR,t.SPECIAL_HEADERS={connection:t.HEADER_STATE.CONNECTION,"content-length":t.HEADER_STATE.CONTENT_LENGTH,"proxy-connection":t.HEADER_STATE.CONNECTION,"transfer-encoding":t.HEADER_STATE.TRANSFER_ENCODING,upgrade:t.HEADER_STATE.UPGRADE},t.default={ERROR:t.ERROR,TYPE:t.TYPE,FLAGS:t.FLAGS,LENIENT_FLAGS:t.LENIENT_FLAGS,METHODS:t.METHODS,STATUSES:t.STATUSES,FINISH:t.FINISH,HEADER_STATE:t.HEADER_STATE,ALPHA:t.ALPHA,NUM_MAP:t.NUM_MAP,HEX_MAP:t.HEX_MAP,NUM:t.NUM,ALPHANUM:t.ALPHANUM,MARK:t.MARK,USERINFO_CHARS:t.USERINFO_CHARS,URL_CHAR:t.URL_CHAR,HEX:t.HEX,TOKEN:t.TOKEN,HEADER_CHARS:t.HEADER_CHARS,CONNECTION_TOKEN_CHARS:t.CONNECTION_TOKEN_CHARS,QUOTED_STRING:t.QUOTED_STRING,HTAB_SP_VCHAR_OBS_TEXT:t.HTAB_SP_VCHAR_OBS_TEXT,MAJOR:t.MAJOR,MINOR:t.MINOR,SPECIAL_HEADERS:t.SPECIAL_HEADERS,METHODS_HTTP:t.METHODS_HTTP,METHODS_ICE:t.METHODS_ICE,METHODS_RTSP:t.METHODS_RTSP,METHOD_MAP:t.METHOD_MAP,H_METHOD_MAP:t.H_METHOD_MAP,STATUSES_HTTP:t.STATUSES_HTTP}},4744:(e,t,A)=>{"use strict";e=A.nmd(e);const{Buffer:s}=A(4573);let r;Object.defineProperty(e,"exports",{get:()=>r||(r=s.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaH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CACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgL5YUCAgd/A34gASACaiEEAkAgACIDKAIMIgANACADKAIEBEAgAyABNgIECyMAQRBrIgkkAAJAA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AkACQAJAAkACQAJAAkACQAJAAkACQCADAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJ/AkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAg7jAQABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEjJCUnKCmeA5sDmgORA4oDgwOAA/0C+wL4AvIC8QLvAu0C6ALnAuYC5QLkAtwC2wLaAtkC2ALXAtYC1QLPAs4CzALLAsoCyQLIAscCxgLEAsMCvgK8AroCuQK4ArcCtgK1ArQCswKyArECsAKuAq0CqQKoAqcC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pmz5syZs+bMGVYNASADIAtCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAMgCiALfDcDICAEIAFBAWoiAUcNAAtBwAAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgAUEBaiIBEDEiAA0XDOICC0HAACECDOwCCyABIARGBEBByQAhAgzsAgsCQANAAkAgAS0AAEEJaw4YAAKiAqICqQKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogIAogILIAQgAUEBaiIBRw0AC0HJACECDOwCCyABQQFqIQEgA0Evai0AAEEBcQ2lAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgzrAgsgASAERwRAA0AgAS0AAEEgRw0VIAQgAUEBaiIBRw0AC0H4ACECDOsCC0H4ACECDOoCCyADQQI6ACgMOAtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQM6AILQQAhAgzOAgtBDSECDM0CC0ETIQIMzAILQRUhAgzLAgtBFiECDMoCC0EYIQIMyQILQRkhAgzIAgtBGiECDMcCC0EbIQIMxgILQRwhAgzFAgtBHSECDMQCC0EeIQIMwwILQR8hAgzCAgtBICECDMECC0EiIQIMwAILQSMhAgy/AgtBJSECDL4CC0HlACECDL0CCyADQT02AhwgAyABNgIUIAMgADYCDEEAIQIM1QILIANBGzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDNQCCyADQSA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzTAgsgA0ETNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0gILIANBCzYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNECCyADQRA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzQAgsgA0EgNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzwILIANBCzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM4CCyADQQw2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzNAgtBACECIANBADYCHCADIAE2AhQgA0HdDjYCECADQRI2AgwMzAILAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB/QEhAgzMAgsCQAJAIAMtADZBAUcNAEEAIQACQCADKAI4IgJFDQAgAigCYCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUcNASADQfwBNgIcIAMgATYCFCADQdwZNgIQIANBFTYCDEEAIQIMzQILQdwBIQIMswILIANBADYCHCADIAE2AhQgA0H5CzYCECADQR82AgxBACECDMsCCwJAAkAgAy0AKEEBaw4CBAEAC0HbASECDLICC0HUASECDLECCyADQQI6ADFBACEAAkAgAygCOCICRQ0AIAIoAgAiAkUNACADIAIRAAAhAAsgAEUEQEHdASECDLECCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQbQMNgIQIANBEDYCDEEAIQIMygILIANB+wE2AhwgAyABNgIUIANBgRo2AhAgA0EVNgIMQQAhAgzJAgsgASAERgRAQfoBIQIMyQILIAEtAABByABGDQEgA0EBOgAoC0HAASECDK4CC0HaASECDK0CCyABIARHBEAgA0EMNgIIIAMgATYCBEHZASECDK0CC0H5ASECDMUCCyABIARGBEBB+AEhAgzFAgsgAS0AAEHIAEcNBCABQQFqIQFB2AEhAgyrAgsgASAERgRAQfcBIQIMxAILAkACQCABLQAAQcUAaw4QAAUFBQUFBQUFBQUFBQUFAQULIAFBAWohAUHWASECDKsCCyABQQFqIQFB1wEhAgyqAgtB9gEhAiABIARGDcICIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbrVAGotAABHDQMgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMMCCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIARQRAQeMBIQIMqgILIANB9QE2AhwgAyABNgIUIAMgADYCDEEAIQIMwgILQfQBIQIgASAERg3BAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEG41QBqLQAARw0CIABBAUYNASAAQQFqIQA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Q0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDLQCC0HOASECDJoCCyADQesBNgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMsgILIAEgBEYEQEHrASECDLICCyABLQAAQS9GBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GyODYCECADQQg2AgxBACECDLECC0HNASECDJcCCyABIARHBEAgA0EONgIIIAMgATYCBEHMASECDJcCC0HqASECDK8CCyABIARGBEBB6QEhAgyvAgsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFBywEhAgyWAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZcCIANB6AE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAEgBEYEQEHnASECDK4CCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5gE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILQcoBIQIMlAILIAEgBEYEQEHlASECDK0CC0EAIQBBASEFQQEhB0EAIQICQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQCABLQAAQTBrDgoKCQABAgMEBQYICwtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshAkEAIQVBACEHDAILQQkhAkEBIQBBACEFQQAhBwwBC0EAIQVBASECCyADIAI6ACsgAUEBaiEBAkACQCADLQAuQRBxDQACQAJAAkAgAy0AKg4DAQACBAsgB0UNAwwCCyAADQEMAgsgBUUNAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDQIgA0HiATYCHCADIAE2AhQgAyAANgIMQQAhAgyvAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZoCIANB4wE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ2YAiADQeQBNgIcIAMgATYCFCADIAA2AgwMrQILQckBIQI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QQFqDAULIAFBAWohAUHDASECDI8CCyABQQFqIQEgA0Evai0AAEEBcQ0IIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKcCCyADQQA2AhwgAyABNgIUIANBjQs2AhAgA0ENNgIMQQAhAgymAgsgASAERwRAIANBDzYCCCADIAE2AgRBASECDI0CC0HcASECDKUCCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtB2wEhAgymAgsgAygCBCEAIANBADYCBCADIAAgARAtIgBFBEAgAUEBaiEBDAQLIANB2gE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMpQILIAMoAgQhACADQQA2AgQgAyAAIAEQLSIADQEgAUEBagshAUHBASECDIoCCyADQdkBNgIcIAMgADYCDCADIAFBAWo2AhRBACECDKICC0HCASECDIgCCyADQS9qLQAAQQFxDQEgA0EANgIcIAMgATYCFCADQeQcNgIQIANBGTYCDEEAIQIMoAILIAEgBEYEQEHZASECDKACCwJAAkACQCABLQAAQQprDgQBAgIAAgsgAUEBaiEBDAILIAFBAWohAQwBCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAjwiAkUNACADIAIRAAAhAAsgAEUNoAEgAEEVRgRAIANB2QA2AhwgAyABNgIUIANBtxo2AhAgA0EVNgIMQQAhAgyfAgsgA0EANgIcIAMgATYCFCADQYANNgIQIANBGzYCDEEAIQIMngILIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDJ0CCyABIARHBEAgA0EMNgIIIAMgATYCBEG/ASECDIQCC0HYASECDJwCCyABIARGBEBB1wEhAgycAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBwQBrDhUAAQIDWgQFBlpaWgcICQoLDA0ODxBaCyABQQFqIQFB+wAhAgySAgsgAUEBaiEBQfwAIQIMkQILIAFBAWohAUGBASECDJACCyABQQFqIQFBhQEhAgyPAgsgAUEBaiEBQYYBIQIMjgILIAFBAWohAUGJASECDI0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S0AACAAQaHVAGotAABHDScgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPsBCyADQQA2AgAgBkEBaiEBQQwMJwtBtQEhAiABIARGDfkBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQerUAGotAABHDSYgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPoBCyADQQA2AgAgBkEBaiEBQQMMJgtBtAEhAiABIARGDfgBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQejUAGotAABHDSUgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPkBCyADQQA2AgAgBkEBaiEBQSYMJQsgASAERgRAQbMBIQIM+AELAkACQCABLQAAQdQAaw4CAAEnCyABQQFqIQFBmQEhAgzfAQsgAUEBaiEBQZoBIQIM3gELQbIBIQIgASAERg32ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHm1ABqLQAARw0jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz3AQsgA0EANgIAIAZBAWohAUEnDCMLQbEBIQIgASAERg31ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHk1ABqLQAARw0iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz2AQsgA0EANgIAIAZBAWohAUEcDCILQbABIQIgASAERg30ASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHe1ABqLQAARw0hIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz1AQsgA0EANgIAIAZBAWohAUEGDCELQa8BIQIgASAERg3zASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHZ1ABqLQAARw0gIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz0AQsgA0EANgIAIAZBAWohAUEZDCALIAEgBEYEQ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IBRw0ACyADIAU2AgAM4gELIANBADYCACAGQQFqIQFBLQwOCyABIARGBEBBnQEhAgzhAQsgAS0AAEHFAEcNDiABQQFqIQFBhAEhAgzHAQsgASAERgRAQZwBIQIM4AELAkACQCABLQAAQcwAaw4IAA8PDw8PDwEPCyABQQFqIQFBggEhAgzHAQsgAUEBaiEBQYMBIQIMxgELQZsBIQIgASAERg3eASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEGz1ABqLQAARw0LIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzfAQsgA0EANgIAIAZBAWohAUEjDAsLQZoBIQIgASAERg3dASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGw1ABqLQAARw0KIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzeAQsgA0EANgIAIAZBAWohAUEADAoLIAEgBEYEQEGZASECDN0BCwJAAkAgAS0AAEHIAGsOCAAMDAwMDAwBDAsgAUEBaiEBQf0AIQIMxAELIAFBAWohAUGAASECDMMBCyABIARGBEBBmAEhAgzcAQsCQAJAIAEtAABBzgBrDgMACwELCyABQQFqIQFB/gAhAgzDAQsgAUEBaiEBQf8AIQIMwgELIAEgBEYEQEGXASECDNsBCyABLQAAQdkARw0IIAFBAWohAUEIDAcLQZYBIQIgASAERg3ZASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEGs1ABqLQAARw0GIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzaAQsgA0EANgIAIAZBAWohAUEFDAYLQZUBIQIgASAERg3YASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGm1ABqLQAARw0FIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzZAQsgA0EANgIAIAZBAWohAUEWDAULQZQBIQIgASAERg3XASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0EIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzYAQsgA0EANgIAIAZBAWohAUEQDAQLIAEgBEYEQEGTASECDNcBCwJAAkAgAS0AAEHDAGsODAAGBgYGBgYGBgYGAQYLIAFBAWohAUH5ACECDL4BCyABQQFqIQFB+gAhAgy9AQtBkgEhAiABIARGDdUBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQaDUAGotAABHDQIgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNYBCyADQQA2AgAgBkEBaiEBQSQMAgsgA0EANgIADAILIAEgBEYEQEGRASECDNQBCyABLQAAQcwARw0BIAFBAWohAUETCzoAKSADKAIEIQAgA0EANgIEIAMgACABEC4iAA0CDAELQQAhAiADQQA2AhwgAyABNgIUIANB/h82AhAgA0EGNgIMDNEBC0H4ACECDLcBCyADQZABNgIcIAMgATYCFCADIAA2AgxBACECDM8BC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUYNASADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgzOAQtB9wAhAgy0AQsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDMwBCyABIARGBEBBjwEhAgzMAQsCQCABLQAAQSBGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GbHzYCECADQQY2AgxBACECDMwBC0ECIQIMsgELA0AgAS0AAEEgRw0CIAQgAUEBaiIBRw0AC0GOASECDMoBCyABIARGBEBBjQEhAgzKAQsCQCABLQAAQQlrDgRKAABKAAtB9QAhAgywAQsgAy0AKUEFRgRAQfYAIQIMsAELQfQAIQIMrwELIAEgBEYEQEGMASECDMgBCyADQRA2AgggAyABNgIEDAoLIAEgBEYEQEGLASECDMcBCwJAIAEtAABBCWsOBEcAAEcAC0HzACECDK0BCyABIARHBEAgA0EQNgIIIAMgATYCBEHxACECDK0BC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AmohBgJAA0AgAS0AACAAQbXVAGotAABHDQggAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJwBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIABEAgA0H0ADYCHCADIAE2AhQgAyAANgIMQQAhAgycAQtB4gAhAgyCAQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJwBC0HhACECDIIBCyADQfMANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMmgELIAMtACkiAEEja0ELSQ0JAkAgAEEGSw0AQQEgAHRBygBxRQ0ADAoLQQAhAiADQQA2AhwgAyABNgIUIANB7Qk2AhAgA0EINgIMDJkBC0HyACECIAEgBEYNmAEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBs9UAai0AAEcNBSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMmQELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfEANgIcIAMgATYCFCADIAA2AgxBACECDJkBC0HfACECDH8LQQAhAAJAIAMoAjgiAkUNACACKAI0IgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANB6g02AhAgA0EmNgIMQQAhAgyZAQtB3gAhAgx/CyADQfAANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMlwELIAMtAClBIUYNBiADQQA2AhwgAyABNgIUIANBkQo2AhAgA0EINgIMQQAhAgyWAQtB7wAhAiABIARGDZUBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDVAGotAABHDQIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIARQ0CIANB7QA2AhwgAyABNgIUIAMgADYCDEEAIQIMlQELIANBADYCAAsgAygCBCEAIANBADYCBCADIAAgARArIgBFDYABIANB7gA2AhwgAyABNgIUIAMgADYCDEEAIQIMkwELQdwAIQIMeQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJMBC0HbACECDHkLIANB7AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyRAQsgAy0AKSIAQSNJDQAgAEEuRg0AIANBADYCHCADIAE2AhQgA0HJCTYCECADQQg2AgxBACECDJABC0HaACECDHYLIAEgBEYEQEHrACECDI8BCwJAIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMjwELQdkAIQIMdQsgASAERwRAIANBDjYCCCADIAE2AgRB2AAhAgx1C0HqACECDI0BCyABIARGBEBB6QAhAgyNAQsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFB1wAhAgx0CyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeiADQegANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyABIARGBEBB5wAhAgyMAQsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELQdYAIQIMcgsgASAERgRAQeUAIQIMiwELQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIANgIcIAMgATYCFCADIAA2AgxBACECDI0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNfSADQeMANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeyADQeQANgIcIAMgATYCFCADIAA2AgwMiwELQdQAIQIMcQsgAy0AKUEiRg2GAUHTACECDHALQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALIABFBEBB1QAhAgxwCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQaQNNgIQIANBITYCDEEAIQIMiQELIANB4QA2AhwgAyABNgIUIANB0Bo2AhAgA0EVNgIMQQAhAgyIAQsgASAERgRAQeAAIQIMiAELAkACQAJAAkACQCABLQAAQQprDgQBBAQABAsgAUEBaiEBDAELIAFBAWohASADQS9qLQAAQQFxRQ0BC0HSACECDHALIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIgBCyADQQA2AhwgAyABNgIUIANBthE2AhAgA0EJNgIMQQAhAgyHAQsgASAERgRAQd8AIQIMhwELIAEtAABBCkYEQCABQQFqIQEMCQsgAy0ALkHAAHENCCADQQA2AhwgAyABNgIUIANBthE2AhAgA0ECNgIMQQAhAgyGAQsgASAERgRAQd0AIQIMhgELIAEtAAAiAkENRgRAIAFBAWohAUHQACECDG0LIAEhACACQQlrDgQFAQEFAQsgBCABIgBGBEBB3AAhAgyFAQsgAC0AAEEKRw0AIABBAWoMAgtBACECIANBADYCHCADIAA2AhQgA0HKLTYCECADQQc2AgwMgwELIAEgBEYEQEHbACECDIMBCwJAIAEtAABBCWsOBAMAAAMACyABQQFqCyEBQc4AIQIMaAsgASAERgRAQdoAIQIMgQELIAEtAABBCWsOBAABAQABC0EAIQIgA0EANgIcIANBmhI2AhAgA0EHNgIMIAMgAUEBajYCFAx/CyADQYASOwEqQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2QA2AhwgAyABNgIUIANB6ho2AhAgA0EVNgIMQQAhAgx+C0HNACECDGQLIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDHwLIAEgBEYEQEHZACECDHwLIAEtAABBIEcNPSABQQFqIQEgAy0ALkEBcQ09IANBADYCHCADIAE2AhQgA0HCHDYCECADQR42AgxBACECDHsLIAEgBEYEQEHYACECDHsLAkACQAJAAkACQCABLQAAIgBBCmsOBAIDAwABCyABQQFqIQFBLCECDGULIABBOkcNASADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgx9CyABQQFqIQEgA0Evai0AAEEBcUUNcyADLQAyQYABcUUEQCADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALAkACQCAADhZNTEsBAQEBAQEBAQEBAQEBAQEBAQEAAQsgA0EpNgIcIAMgATYCFCADQawZNgIQIANBFTYCDEEAIQIMfgsgA0EANgIcIAMgATYCFCADQeULNgIQIANBETYCDEEAIQIMfQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUNWSAAQRVHDQEgA0EFNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMfAtBywAhAgxiC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAx6CyADIAMvATJBgAFyOwEyDDsLIAEgBEcEQCADQRE2AgggAyABNgIEQcoAIQIMYAtB1wAhAgx4CyABIARGBEBB1gAhAgx4CwJAAkACQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQeMAaw4TAEBAQEBAQEBAQEBAQAFAQEACA0ALIAFBAWohAUHGACECDGELIAFBAWohAUHHACECDGALIAFBAWohAUHIACECDF8LIAFBAWohAUHJACECDF4LQdUAIQIgBCABIgBGDXYgBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/w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AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==","base64"))})},7136:(e,t,A)=>{"use strict";e=A.nmd(e);const{Buffer:s}=A(4573);let r;Object.defineProperty(e,"exports",{get:()=>r||(r=s.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodH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JGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgLhocCAwd/A34BeyABIAJqIQQCQCAAIgMoAgwiAA0AIAMoAgQEQCADIAE2AgQLIwBBEGsiCSQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADKAIcIgJBAmsO/AEB+QECAwQFBgcICQoLDA0ODxAREvgBE/cBFBX2ARYX9QEYGRobHB0eHyD9AfsBIfQBIiMkJSYnKCkqK/MBLC0uLzAxMvIB8QEzNPAB7wE1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk/6AVBRUlPuAe0BVOwBVesBVldYWVrqAVtcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBi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QAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAn8CQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAwJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCACDuMBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh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CCyAAQTtHDQAgAUEBaiEBDAwLQQAhAiADQQA2AhwgAyABNgIUIANBkhg2AhAgA0ECNgIMDPwCCyAAQRVGDShBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM+wILIANBFDYCHCADIAE2AhQgAyAANgIMDPoCCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDPUCCyADQRU2AhwgAyAANgIMIAMgAUEBajYCFAz5AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzzAgsgA0EXNgIcIAMgADYCDCADIAFBAWo2AhQM+AILIABBFUYNI0EAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAz3AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwdCyADQRk2AhwgAyAANgIMIAMgAUEBajYCFAz2AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzvAgsgA0EaNgIcIAMgADYCDCADIAFBAWo2AhQM9QILIABBFUYNH0EAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAz0AgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDBsLIANBHDYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgzzAgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDOsCCyADQR02AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8gILIABBO0cNASABQQFqIQELQSYhAgzXAgtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwM7wILIAEgBEcEQANAIAEtAABBIEcNhAIgBCABQQFqIgFHDQALQSwhAgzvAgtBLCECDO4CCyABIARGBEBBNCECDO4CCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtBNCECDO8CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNnwIgA0EyNgIcIAMgATYCFCADIAA2AgxBACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUEQCABQQFqIQEMnwILIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgztAgsgASAERwRAAkADQCABLQAAQTBrIgBB/wFxQQpPBEBBOiECDNcCCyADKQMgIgtCmbPmzJmz5swZVg0BIAMgC0IKfiIKNwMgIAogAK1C/wGDIgtCf4VWDQEgAyAKIAt8NwMgIAQgAUEBaiIBRw0AC0HAACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABQQFqIgEQMSIADRcM4gILQcAAIQIM7AILIAEgBEYEQEHJACECDOwCCwJAA0ACQCABLQAAQQlrDhgAAqICogKpAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAgCiAgsgBCABQQFqIgFHDQALQckAIQIM7AILIAFBAWohASADQS9qLQAAQQFxDaUCIANBADYCHCADIAE2AhQgA0GXEDYCECADQQo2AgxBACECDOsCCyABIARHBEADQCABLQAAQSBHDRUgBCABQQFqIgFHDQALQfgAIQIM6wILQfgAIQIM6gILIANBAjoAKAw4C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAzoAgtBACECDM4CC0ENIQIMzQILQRMhAgzMAgtBFSECDMsCC0EWIQIMygILQRghAgzJAgtBGSECDMgCC0EaIQIMxwILQRshAgzGAgtBHCECDMUCC0EdIQIMxAILQR4hAgzDAgtBHyECDMICC0EgIQIMwQILQSIhAgzAAgtBIyECDL8CC0ElIQIMvgILQeUAIQIMvQILIANBPTYCHCADIAE2AhQgAyAANgIMQQAhAgzVAgsgA0EbNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIM1AILIANBIDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNMCCyADQRM2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzSAgsgA0ELNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0QILIANBEDYCHCADIAE2AhQgA0GYGjYCECADQRU2Ag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ACADQgA3AwAgAyAAIAZBAWoiARAuIgBFBEBB4wEhAgyqAgsgA0H1ATYCHCADIAE2AhQgAyAANgIMQQAhAgzCAgtB9AEhAiABIARGDcECIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjVAGotAABHDQIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMICCyADQYEEOwEoIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgANAwwCCyADQQA2AgALQQAhAiADQQA2AhwgAyABNgIUIANB5R82AhAgA0EINgIMDL8CC0HVASECDKUCCyADQfMBNgIcIAMgATYCFCADIAA2AgxBACECDL0CC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ1uIABBFUcEQCADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgy9AgsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDLwCCyABIARHBEAgA0ENNgIIIAMgATYCBEHTASECDKMCC0HyASECDLsCCyABIARGBEBB8QEhAgy7AgsCQAJAAkAgAS0AAEHIAGsOCwABCAgICAgICAgCCAsgAUEBaiEBQdABIQIMowILIAFBAWohAUHRASECDKICCyABQQFqIQFB0gEhAgyhAgtB8AEhAiABIARGDbkCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEG11QBqLQAARw0EIABBAkYNAyAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy5AgtB7wEhAiABIARGDbgCIAMoAgAiACAEIAFraiEGIAEgAGtBAWohBQNAIAEtAAAgAEGz1QBqLQAARw0DIABBAUYNAiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy4AgtB7gEhAiABIARGDbcCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEGw1QBqLQAARw0CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy3AgsgAygCBCEAIANCADcDACAD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ADQeIBNgIcIAMgATYCFCADIAA2AgxBACECDK8CCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmgIgA0HjATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5AE2AhwgAyABNgIUIAMgADYCDAytAgtByQEhAgyTAgtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GkDTYCECADQSE2AgxBACECDK0CC0HIASECDJMCCyADQeEBNgIcIAMgATYCFCADQdAaNgIQIANBFTYCDEEAIQIMqwILIAEgBEYEQEHhASECDKsCCwJAIAEtAABBIEYEQCADQQA7ATQgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GZETYCECADQQk2AgxBACECDKsCC0HHASECDJECCyABIARGBEBB4AEhAgyqAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKsCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyqAgtBxgEhAgyQAgsgASAERgRAQd8BIQIMqQILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyqAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqQILQcUBIQIMjwILIAEgBEYEQEHeASECDKgCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqQILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKgCC0HEASECDI4CCyABIARGBEBB3QEhAgynAgsCQAJAAkACQCABLQAAQQprDhcCAwMAAwMDAwMDAwMDAwMDAwMDAwMDAQMLIAFBAWoMBQsgAUEBaiEBQcMBIQIMjwILIAFBAWohASADQS9qLQAAQQFxDQggA0EANgIcIAMgATYCFCADQY0LNgIQIANBDTYCDEEAIQIMpwILIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKYCCyABIARHBEAgA0EPNgIIIAMgATYCBEEBIQIMjQILQdwBIQIMpQILAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0HbASECDKYCCyADKAIEIQAgA0EANgIEIAMgACABEC0iAEUEQCABQQFqIQEMBAsgA0HaATYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgylAgsgAygCBCEAIANBADYCBCADIAAgARAtIgANASABQQFqCyEBQcEBIQIMigILIANB2QE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMogILQcIBIQIMiAILIANBL2otAABBAXENASADQQA2AhwgAyABNgIUIANB5Bw2AhAgA0EZNgIMQQAhAgygAgsgASAERgRAQdkBIQIMoAILAkACQAJAIAEtAABBCmsOBAECAgACCyABQQFqIQEMAgsgAUEBaiEBDAELIAMtAC5BwABxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCPCICRQ0AIAMgAhEAACEACyAARQ2gASAAQRVGBEAgA0HZADYCHCADIAE2AhQgA0G3GjYCECADQRU2AgxBACECDJ8CCyADQQA2AhwgAyABNgIUIANBgA02AhAgA0EbNgIMQQAhAgyeAgsgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMnQILIAEgBEcEQCADQQw2AgggAyABNgIEQb8BIQIMhAILQdgBIQIMnAILIAEgBEYEQEHXASECDJwCCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAA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QAPT09PT09PT09PT09PT09PT09AT0LIAFBAWohAUGtASECDPUBCyABQQFqIQFBsAEhAgz0AQsgASAERgRAQcgBIQIMjQILAkACQCABLQAAQdUAaw4LADw8PDw8PDw8PAE8CyABQQFqIQFBrgEhAgz0AQsgAUEBaiEBQa8BIQIM8wELQccBIQIgASAERg2LAiADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw04IABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyMAgsgA0EANgIAIAZBAWohAUEqDDgLIAEgBEYEQEHGASECDIsCCyABLQAAQdAARw04IAFBAWohAUElDDcLQcUBIQIgASAERg2JAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGB1QBqLQAARw02IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyKAgsgA0EANgIAIAZBAWohAUEODDYLIAEgBEYEQEHEASECDIkCCyABLQAAQcUARw02IAFBAWohAUGrASECDO8BCyABIARGBEBBwwEhAgyIAgsCQAJAAkACQCABLQAAQcIAaw4PAAECOTk5OTk5OTk5OTkDOQsgAUEBaiEBQacBIQIM8QELIAFBAWohAUGoASECDPABCyABQQFqIQFBqQEhAgzvAQsgAUEBaiEBQaoBIQIM7gELQcIBIQIgASAERg2GAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH+1ABqLQAARw0zIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyHAgsgA0EANgIAIAZBAWohAUEUDDMLQcEBIQIgASAERg2FAiADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEH51ABqLQAARw0yIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyGAgsgA0EANgIAIAZBAWohAUErDDILQcABIQIgASAERg2EAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH21ABqLQAARw0xI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gAgBkEBaiEBQQYMIQtBrwEhAiABIARGDfMBIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQdnUAGotAABHDSAgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPQBCyADQQA2AgAgBkEBaiEBQRkMIAsgASAERgRAQa4BIQIM8wELAkACQAJAAkAgAS0AAEEtaw4jACQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkASQkJCQkAiQkJAMkCyABQQFqIQFBjgEhAgzcAQsgAUEBaiEBQY8BIQIM2wELIAFBAWohAUGUASECDNoBCyABQQFqIQFBlQEhAgzZAQtBrQEhAiABIARGDfEBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQdfUAGotAABHDR4gAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPIBCyADQQA2AgAgBkEBaiEBQQsMHgsgASAERgRAQawBIQIM8QELAkACQCABLQAAQcEAaw4DACABIAsgAUEBaiEBQZABIQIM2AELIAFBAWohAUGTASECDNcBCyABIARGBEBBqwEhAgzwAQsCQAJAIAEtAABBwQBrDg8AHx8fHx8fHx8fHx8fHwEfCyABQQFqIQFBkQEhAgzXAQsgAUEBaiEBQZIBIQIM1gELIAEgBEYEQEGqASECDO8BCyABLQAAQcwARw0cIAFBAWohAUEKDBsLQakBIQIgASAERg3tASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHR1ABqLQAARw0aIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzuAQsgA0EANgIAIAZBAWohAUEeDBoLQagBIQIgASAERg3sASADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEHK1ABqLQAARw0ZIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAztAQsgA0EANgIAIAZBAWohAUEVDBkLQacBIQIgASAERg3rASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHH1ABqLQAARw0YIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzsAQsgA0EANgIAIAZBAWohAUEXDBgLQaYBIQIgASAERg3qASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHB1ABqLQAARw0XIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzrAQsgA0EANgIAIAZBAWohAUEYDBcLIAEgBEYEQEGlASECDOoBCwJAAkAgAS0AAEHJAGsOBwAZGRkZGQEZCyABQQFqIQFBiwEhAgzRAQsgAUEBaiEBQYwBIQIM0AELQaQBIQIgASAERg3oASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw0VIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzpAQsgA0EANgIAIAZBAWohAUEJDBULQaMBIQIgASAERg3nASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw0UIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzoAQsgA0EANgIAIAZBAWohAUEfDBQLQaIBIQIgASAERg3mASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEG+1ABqLQAARw0TIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAznAQsgA0EANgIAIAZBAWohAUECDBMLQaEBIQIgASAERg3lASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYDQCABLQAAIABBvNQAai0AAEcNESAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5QELIAEgBEYEQEGgASECDOUBC0EBIAEtAABB3wBHDREaIAFBAWohAUGHASECDMsBCyADQQA2AgAgBkEBaiEBQYgBIQIMygELQZ8BIQIgASAERg3iASADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw0PIABBCEYNASA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AGtBBWohBgJAA0AgAS0AACAAQabUAGotAABHDQUgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNkBCyADQQA2AgAgBkEBaiEBQRYMBQtBlAEhAiABIARGDdcBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDQQgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNgBCyADQQA2AgAgBkEBaiEBQRAMBAsgASAERgRAQZMBIQIM1wELAkACQCABLQAAQcMAaw4MAAYGBgYGBgYGBgYBBgsgAUEBaiEBQfkAIQIMvgELIAFBAWohAUH6ACECDL0BC0GSASECIAEgBEYN1QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBoNQAai0AAEcNAiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM1gELIANBADYCACAGQQFqIQFBJAwCCyADQQA2AgAMAgsgASAERgRAQZEBIQIM1AELIAEtAABBzABHDQEgAUEBaiEBQRMLOgApIAMoAgQhACADQQA2AgQgAyAAIAEQLiIADQIMAQtBACECIANBADYCHCADIAE2AhQgA0H+HzYCECADQQY2AgwM0QELQfgAIQIMtwELIANBkAE2AhwgAyABNgIUIAMgADYCDEEAIQIMzwELQQAhAAJAIAMoAjgiAkUNACACKAJAIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GCDzYCECADQSA2AgxBACECDM4BC0H3ACECDLQBCyADQY8BNgIcIAMgATYCFCADQewbNgIQIANBFTYCDEEAIQIMzAELIAEgBEYEQEGPASECDMwBCwJAIAEtAABBIEYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZsfNgIQIANBBjYCDEEAIQIMzAELQQIhAgyyAQsDQCABLQAAQSBHDQIgBCABQQFqIgFHDQALQY4BIQIMygELIAEgBEYEQEGNASECDMoBCwJAIAEtAABBCWsOBEoAAEoAC0H1ACECDLABCyADLQApQQVGBEBB9gAhAgywAQtB9AAhAgyvAQsgASAERgRAQYwBIQIMyAELIANBEDYCCCADIAE2AgQMCgsgASAERgRAQYsBIQIMxwELAkAgAS0AAEEJaw4ERwAARwALQfMAIQIMrQELIAEgBEcEQCADQRA2AgggAyABNgIEQfEAIQIMrQELQYoBIQIMxQELAkAgASAERwRAA0AgAS0AAEGg0ABqLQAAIgBBA0cEQAJAIABBAWsOAkkABAtB8AAhAgyvAQsgBCABQQFqIgFHDQALQYgBIQIMxgELQYgBIQIMxQELIANBADYCHCADIAE2AhQgA0HbIDYCECADQQc2AgxBACECDMQBCyABIARGBEBBiQEhAgzEAQsCQAJAAkAgAS0AAEGg0gBqLQAAQQFrDgNGAgABC0HyACECDKwBCyADQQA2AhwgAyABNgIUIANBtBI2AhAgA0EHNgIMQQAhAgzEAQtB6gAhAgyqAQsgASAERwRAIAFBAWohAUHvACECDKoBC0GHASECDMIBCyAEIAEiAEYEQEGGASECDMIBCyAALQAAIgFBL0YEQCAAQQFqIQFB7gAhAgypAQsgAUEJayICQRdLDQEgACEBQQEgAnRBm4CABHENQQwBCyAEIAEiAEYEQEGFASECDMEBCyAALQAAQS9HDQAgAEEBaiEBDAMLQQAhAiADQQA2AhwgAyAANgIUIANB2yA2AhAgA0EHNgIMDL8BCwJAAkACQAJAAkADQCABLQAAQaDOAGotAAAiAEEFRwRAAkACQCAAQQFrDghHBQYHCAAEAQgLQesAIQIMrQELIAFBAWohAUHtACECDKwBCyAEIAFBAWoiAUcNAAtBhAEhAgzDAQsgAUEBagwUCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDMEBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDMABCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDL8BCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy+AQsgASAERgRAQYMBIQIMvgELAkAgAS0AAEGgzgBqLQAAQQFrDgg+BAUGAAgCAwcLIAFBAWohAQtBAyECDKMBCyABQQFqDA0LQQAhAiADQQA2AhwgA0HREjYCECADQQc2AgwgAyABQQFqNgIUDLoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDLkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDLgBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDLcBCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy2AQtB7AAhAgycAQsgASAERgRAQYIBIQIMtQELIAFBAWoMAgsgASAERgRAQYEBIQIMtAELIAFBAWoMAQsgASAERg0BIAFBAWoLIQFBBCECDJgBC0GAASECDLABCwNAIAEtAABBoMwAai0AACIAQQJHBEAgAEEBRwRAQekAIQIMmQELDDELIAQgAUEBaiIBRw0AC0H/ACECDK8BCyABIARGBEBB/gAhAgyvAQsCQCABLQAAQQlrDjcvAwYvBAYGBgYGBgYGBgYGBgYGBgYGBgUGBgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYABgsgAUEBagshAUEFIQIMlAELIAFBAWoMBgsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgyrAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgyqAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgypAQsgA0EANgIcIAMgATYCFCADQY0UNgIQIANBBzYCDEEAIQIMqAELAkACQAJAAkADQCABLQAAQaDKAGotAAAiAEEFRwRAAkAgAEEBaw4GLgMEBQYABgtB6AAhAgyUAQsgBCABQQFqIgFHDQALQf0AIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqAELIANBADYCHCADIAE2AhQgA0HkCDYCECADQQc2AgxBACECDKcBCyABIARGDQEgAUEBagshAUEGIQIMjAELQfwAIQIMpAELAkACQAJAAkADQCABLQAAQaDIAGotAAAiAEEFRwRAIABBAWsOBCkCAwQFCyAEIAFBAWoiAUcNAAtB+wAhAgynAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgymAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgylAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgykAQsgA0EANgIcIAMgATYCFCADQbwKNgIQIANBBzYCDEEAIQIMowELQc8AIQIMiQELQdEAIQIMiAELQecAIQIMhwELIAEgBEYEQEH6ACECDKABCwJAIAEtAABBCWsOBCAAACAACyABQQFqIQFB5gAhAgyGAQsgASAERgRAQfkAIQIMnwELAkAgAS0AAEEJaw4EHwAAHwALQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFBEBB4gEhAgyGAQsgAEEVRwRAIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDJ8BCyADQfgANgIcIAMgATYCFCADQeoaNgIQIANBFTYCDEEAIQIMngELIAEgBEcEQCADQQ02AgggAyABNgIEQeQAIQIMhQELQfcAIQIMnQELIAEgBEYEQEH2ACECDJ0BCwJAAkACQCABLQAAQcgAaw4LAAELCwsLCwsLCwILCyABQQFqIQFB3QAhAgyFAQsgAUEBaiEBQeAAIQIMhAELIAFBAWohAUHjACECDIMBC0H1ACECIAEgBEYNmwEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBtdUAai0AAEcNCCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMnAELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfQANgIcIAMgATYCFCADIAA2AgxBACECDJwBC0HiACECDIIBC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMnAELQeEAIQIMggELIANB8wA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyaAQsgAy0AKSIAQSNrQQtJDQkCQCAAQQZLDQBBASAAdEHKAHFFDQAMCgtBACECIANBADYCHCADIAE2AhQgA0HtCTYCECADQQg2AgwMmQELQfIAIQIgASAERg2YASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGz1QBqLQAARw0FIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAQsgAygCBCEAIANCADcDACADIAAgBkEBaiIBECsiAARAIANB8QA2AhwgAyABNgIUIAMgADYCDEEAIQIMmQELQd8AIQIMfwtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJkBC0HeACECDH8LIANB8AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyXAQsgAy0AKUEhRg0GIANBADYCHCADIAE2AhQgA0GRCjYCECADQQg2AgxBACECDJYBC0HvACECIAEgBEYNlQEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQ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CBCADQRI2AgggAyABIAEQMSIADQELQS4hAgwnCyADQS02AhwgAyABNgIUIAMgADYCDEEAIQIMPwtBACEAAkAgAygCOCICRQ0AIAIoAkwiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HYADYCHCADIAE2AhQgA0GzGzYCECADQRU2AgxBACECDD4LQcwAIQIMJAsgA0EANgIcIAMgATYCFCADQbMONgIQIANBHTYCDEEAIQIMPAsgASAERgRAQc4AIQIMPAsgAS0AACIAQSBGDQIgAEE6Rg0BCyADQQA6ACxBCSECDCELIAMoAgQhACADQQA2AgQgAyAAIAEQMCIADQEMAgsgAy0ALkEBcQRAQd4BIQIMIAsgAygCBCEAIANBADYCBCADIAAgARAwIgBFDQIgA0EqNgIcIAMgADYCDCADIAFBAWo2AhRBACECDDgLIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMNwsgAUEBaiEBQcAAIQIMHQsgAUEBaiEBDCwLIAEgBEYEQEErIQIMNQsCQCABLQAAQQpGBEAgAUEBaiEBDAELIAMtAC5BwABxRQ0GCyADLQAyQYABcQRAQQAhAAJAIAMoAjgiAkUNACACKAJcIgJFDQAgAyACEQAAIQALIABFDRIgAEEVRgRAIANBBTYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDDYLIANBADYCHCADIAE2AhQgA0GQDjYCECADQRQ2AgxBACECDDULIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsgAA4WAgEABAQEBAQEBAQEBAQEBAQEBAQEAwQLIANBAToAMAsgAiACLwEAQcAAcjsBAAtBKyECDBgLIANBKTYCHCADIAE2AhQgA0GsGTYCECADQRU2AgxBACECDDALIANBADYCHCADIAE2AhQgA0HlCzYCECADQRE2AgxBACECDC8LIANBADYCHCADIAE2AhQgA0GlCzYCECADQQI2AgxBACECDC4LQQEhByADLwEyIgVBCHFFBEAgAykDIEIAUiEHCwJAIAMtADAEQEEBIQAgAy0AKUEFRg0BIAVBwABxRS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EBAAELIAFBAWohAQwBCyABQQFqIQEgAy0ALkEgcQ0AQQAhAiADQQA2AhwgAyABNgIUIANBoSE2AhAgA0EFNgIMDAILQQEhAiABIARHDQALCyAJQRBqJAAgAkUEQCADKAIMIQAMAQsgAyACNgIcQQAhACADKAIEIgFFDQAgAyABIAQgAygCCBEBACIBRQ0AIAMgBDYCFCADIAE2AgwgASEACyAAC74CAQJ/IABBADoAACAAQeQAaiIBQQFrQQA6AAAgAEEAOgACIABBADoAASABQQNrQQA6AAAgAUECa0EAOgAAIABBADoAAyABQQRrQQA6AABBACAAa0EDcSIBIABqIgBBADYCAEHkACABa0F8cSICIABqIgFBBGtBADYCAAJAIAJBCUkNACAAQQA2AgggAEEANgIEIAFBCGtBADYCACABQQxrQQA2AgAgAkEZSQ0AIABBADYCGCAAQQA2AhQgAEEANgIQIABBADYCDCABQRBrQQA2AgAgAUEUa0EANgIAIAFBGGtBADYCACABQRxrQQA2AgAgAiAAQQRxQRhyIgJrIgFBIEkNACAAIAJqIQADQCAAQgA3AxggAEIANwMQIABCADcDCCAAQgA3AwAgAEEgaiEAIAFBIGsiAUEfSw0ACwsLVgEBfwJAIAAoAgwNAAJAAkACQAJAIAAtADEOAwEAAwILIAAoAjgiAUUNACABKAIwIgFFDQAgACABEQAAIgENAwtBAA8LAAsgAEHKGTYCEEEOIQELIAELGgAgACgCDEUEQCAAQd4fNgIQIABBFTYCDAsLFAAgACgCDEEVRgRAIABBADYCDAsLFAAgACgCDEEWRgRAIABBADYCDAsLBwAgACgCDAsHACAAKAIQCwkAIAAgATYCEAsHACAAKAIUCysAAkAgAEEnTw0AQv//////CSAArYhCAYNQDQAgAEECdEHQOGooAgAPCwALFwAgAEEvTwRAAAsgAEECdEHsOWooAgALvwkBAX9B9C0hAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJA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BwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==","base64"))})},3530:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enumToMap=function(e,t=[],A=[]){const s=0===(t?.length??0),r=0===(A?.length??0);return Object.fromEntries(Object.entries(e).filter((([,e])=>"number"==typeof e&&(s||t.includes(e))&&(r||!A.includes(e)))))}},7467:(e,t,A)=>{"use strict";const{kClients:s}=A(257),r=A(3315),{kAgent:n,kMockAgentSet:i,kMockAgentGet:o,kDispatches:a,kIsMockActive:c,kNetConnect:l,kGetNetConnect:h,kOptions:g,kFactory:d,kMockAgentRegisterCallHistory:u,kMockAgentIsCallHistoryEnabled:E,kMockAgentAddCallHistoryLog:I,kMockAgentMockCallHistoryInstance:Q,kMockAgentAcceptsNonStandardSearchParameters:C,kMockCallHistoryAddLog:B,kIgnoreTrailingSlash:p}=A(3435),f=A(615),m=A(5846),{matchValue:y,normalizeSearchParams:S,buildAndValidateMockOptions:w}=A(991),{InvalidArgumentError:D,UndiciError:b}=A(4465),N=A(5497),R=A(164),{MockCallHistory:v}=A(4969);e.exports=class extends N{constructor(e={}){super(e);const t=w(e);if(this[l]=!0,this[c]=!0,this[E]=t.enableCallHistory??!1,this[C]=t.acceptNonStandardSearchParameters??!1,this[p]=t.ignoreTrailingSlash??!1,e?.agent&&"function"!=typeof e.agent.dispatch)throw new D("Argument opts.agent must implement Agent");const A=e?.agent?e.agent:new r(e);this[n]=A,this[s]=A[s],this[g]=t,this[E]&&this[u]()}get(e){const t=this[p]?e.replace(/\/$/,""):e;let A=this[o](t);return A||(A=this[d](t),this[i](t,A)),A}dispatch(e,t){this.get(e.origin),this[I](e);const A=this[C],s={...e};if(A&&s.path){const[e,t]=s.path.split("?"),r=S(t,A);s.path=`${e}?${r}`}return this[n].dispatch(s,t)}async close(){this.clearCallHistory(),await this[n].close(),this[s].clear()}deactivate(){this[c]=!1}activate(){this[c]=!0}enableNetConnect(e){if("string"==typeof e||"function"==typeof e||e instanceof RegExp)Array.isArray(this[l])?this[l].push(e):this[l]=[e];else{if("undefined"!=typeof e)throw new D("Unsupported matcher. Must be one of String|Function|RegExp.");this[l]=!0}}disableNetConnect(){this[l]=!1}enableCallHistory(){return this[E]=!0,this}disableCallHistory(){return this[E]=!1,this}getCallHistory(){return this[Q]}clearCallHistory(){void 0!==this[Q]&&this[Q].clear()}get isMockActive(){return this[c]}[u](){void 0===this[Q]&&(this[Q]=new v)}[I](e){this[E]&&(this[u](),this[Q][B](e))}[i](e,t){this[s].set(e,{count:0,dispatcher:t})}[d](e){const t=Object.assign({agent:this},this[g]);return this[g]&&1===this[g].connections?new f(e,t):new m(e,t)}[o](e){const t=this[s].get(e);if(t?.dispatcher)return t.dispatcher;if("string"!=typeof e){const t=this[d]("http://localhost:9999");return this[i](e,t),t}for(const[t,A]of Array.from(this[s]))if(A&&"string"!=typeof t&&y(t,e)){const t=this[d](e);return this[i](e,t),t[a]=A.dispatcher[a],t}}[h](){return this[l]}pendingInterceptors(){const e=this[s];return Array.from(e.entries()).flatMap((([e,t])=>t.dispatcher[a].map((t=>({...t,origin:e}))))).filter((({pending:e})=>e))}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new R}={}){const t=this.pendingInterceptors();if(0!==t.length)throw new b(1===t.length?`1 interceptor is pending:\n\n${e.format(t)}`.trim():`${t.length} interceptors are pending:\n\n${e.format(t)}`.trim())}}},4969:(e,t,A)=>{"use strict";const{kMockCallHistoryAddLog:s}=A(3435),{InvalidArgumentError:r}=A(4465);function n(e,t,A,s){switch(t.operator){case"OR":return s.push(...A(e)),s;case"AND":return A.call({logs:s},e);default:throw new r("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}function i(e={}){const t={};if("operator"in e){if("string"!=typeof e.operator||"OR"!==e.operator.toUpperCase()&&"AND"!==e.operator.toUpperCase())throw new r("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...t,operator:e.operator.toUpperCase()}}return t}function o(e){return t=>{if("string"==typeof t||null==t)return this.logs.filter((A=>A[e]===t));if(t instanceof RegExp)return this.logs.filter((A=>t.test(A[e])));throw new r(`${e} parameter should be one of string, regexp, undefined or null`)}}class a{constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;const t=function(e){try{const t=new URL(e.path,e.origin);return 0!==t.search.length||(t.search=new URLSearchParams(e.query).toString()),t}catch(e){throw new r("An error occurred when computing MockCallHistoryLog.url",{cause:e})}}(e);this.fullUrl=t.toString(),this.origin=t.origin,this.path=t.pathname,this.searchParams=Object.fromEntries(t.searchParams),this.protocol=t.protocol,this.host=t.host,this.port=t.port,this.hash=t.hash}toMap(){return new Map([["protocol",this.protocol],["host",this.host],["port",this.port],["origin",this.origin],["path",this.path],["hash",this.hash],["searchParams",this.searchParams],["fullUrl",this.fullUrl],["method",this.method],["body",this.body],["headers",this.headers]])}toString(){const e="->",t="|";let A="";return this.toMap().forEach(((s,r)=>{"string"!=typeof s&&null!=s||(A=`${A}${r}${e}${s}${t}`),("object"==typeof s&&null!==s||Array.isArray(s))&&(A=`${A}${r}${e}${JSON.stringify(s)}${t}`)})),A.slice(0,-1)}}class c{logs=[];calls(){return this.logs}firstCall(){return this.logs.at(0)}lastCall(){return this.logs.at(-1)}nthCall(e){if("number"!=typeof e)throw new r("nthCall must be called with a number");if(!Number.isInteger(e))throw new r("nthCall must be called with an integer");if(1!==Math.sign(e))throw new r("nthCall must be called with a positive value. use firstCall or lastCall instead");return this.logs.at(e-1)}filterCalls(e,t){if(0===this.logs.length)return this.logs;if("function"==typeof e)return this.logs.filter(e);if(e instanceof RegExp)return this.logs.filter((t=>e.test(t.toString())));if("object"==typeof e&&null!==e){if(0===Object.keys(e).length)return this.logs;const A={operator:"OR",...i(t)};let s=[];"protocol"in e&&(s=n(e.protocol,A,this.filterCallsByProtocol,s)),"host"in e&&(s=n(e.host,A,this.filterCallsByHost,s)),"port"in e&&(s=n(e.port,A,this.filterCallsByPort,s)),"origin"in e&&(s=n(e.origin,A,this.filterCallsByOrigin,s)),"path"in e&&(s=n(e.path,A,this.filterCallsByPath,s)),"hash"in e&&(s=n(e.hash,A,this.filterCallsByHash,s)),"fullUrl"in e&&(s=n(e.fullUrl,A,this.filterCallsByFullUrl,s)),"method"in e&&(s=n(e.method,A,this.filterCallsByMethod,s));return[...new Set(s)]}throw new r("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=o.call(this,"protocol");filterCallsByHost=o.call(this,"host");filterCallsByPort=o.call(this,"port");filterCallsByOrigin=o.call(this,"origin");filterCallsByPath=o.call(this,"path");filterCallsByHash=o.call(this,"hash");filterCallsByFullUrl=o.call(this,"fullUrl");filterCallsByMethod=o.call(this,"method");clear(){this.logs=[]}[s](e){const t=new a(e);return this.logs.push(t),t}*[Symbol.iterator](){for(const e of this.calls())yield e}}e.exports.MockCallHistory=c,e.exports.MockCallHistoryLog=a},615:(e,t,A)=>{"use strict";const{promisify:s}=A(7975),r=A(1167),{buildMockDispatch:n}=A(991),{kDispatches:i,kMockAgent:o,kClose:a,kOriginalClose:c,kOrigin:l,kOriginalDispatch:h,kConnected:g,kIgnoreTrailingSlash:d}=A(3435),{MockInterceptor:u}=A(193),E=A(257),{InvalidArgumentError:I}=A(4465);class Q extends r{constructor(e,t){if(!t||!t.agent||"function"!=typeof t.agent.dispatch)throw new I("Argument opts.agent must implement Agent");super(e,t),this[o]=t.agent,this[l]=e,this[d]=t.ignoreTrailingSlash??!1,this[i]=[],this[g]=1,this[h]=this.dispatch,this[c]=this.close.bind(this),this.dispatch=n.call(this),this.close=this[a]}get[E.kConnected](){return this[g]}intercept(e){return new u(e&&{ignoreTrailingSlash:this[d],...e},this[i])}cleanMocks(){this[i]=[]}async[a](){await s(this[c])(),this[g]=0,this[o][E.kClients].delete(this[l])}}e.exports=Q},3123:(e,t,A)=>{"use strict";const{UndiciError:s}=A(4465),r=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED");class n extends s{constructor(e){super(e),this.name="MockNotMatchedError",this.message=e||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](e){return e&&!0===e[r]}get[r](){return!0}}e.exports={MockNotMatchedError:n}},193:(e,t,A)=>{"use strict";const{getResponseData:s,buildKey:r,addMockDispatch:n}=A(991),{kDispatches:i,kDispatchKey:o,kDefaultHeaders:a,kDefaultTrailers:c,kContentLength:l,kMockDispatch:h,kIgnoreTrailingSlash:g}=A(3435),{InvalidArgumentError:d}=A(4465),{serializePathWithQuery:u}=A(2858);class E{constructor(e){this[h]=e}delay(e){if("number"!=typeof e||!Number.isInteger(e)||e<=0)throw new d("waitInMs must be a valid integer > 0");return this[h].delay=e,this}persist(){return this[h].persist=!0,this}times(e){if("number"!=typeof e||!Number.isInteger(e)||e<=0)throw new d("repeatTimes must be a valid integer > 0");return this[h].times=e,this}}e.exports.MockInterceptor=class{constructor(e,t){if("object"!=typeof e)throw new d("opts must be an object");if("undefined"==typeof e.path)throw new d("opts.path must be defined");if("undefined"==typeof e.method&&(e.method="GET"),"string"==typeof e.path)if(e.query)e.path=u(e.path,e.query);else{const t=new URL(e.path,"data://");e.path=t.pathname+t.search}"string"==typeof e.method&&(e.method=e.method.toUpperCase()),this[o]=r(e),this[i]=t,this[g]=e.ignoreTrailingSlash??!1,this[a]={},this[c]={},this[l]=!1}createMockScopeDispatchData({statusCode:e,data:t,responseOptions:A}){const r=s(t),n=this[l]?{"content-length":r.length}:{};return{statusCode:e,data:t,headers:{...this[a],...n,...A.headers},trailers:{...this[c],...A.trailers}}}validateReplyParameters(e){if("undefined"==typeof e.statusCode)throw new d("statusCode must be defined");if("object"!=typeof e.responseOptions||null===e.responseOptions)throw new d("responseOptions must be an object")}reply(e){if("function"==typeof e){const t=t=>{const A=e(t);if("object"!=typeof A||null===A)throw new d("reply options callback must return an object");const s={data:"",responseOptions:{},...A};return this.validateReplyParameters(s),{...this.createMockScopeDispatchData(s)}},A=n(this[i],this[o],t,{ignoreTrailingSlash:this[g]});return new E(A)}const t={statusCode:e,data:void 0===arguments[1]?"":arguments[1],responseOptions:void 0===arguments[2]?{}:arguments[2]};this.validateReplyParameters(t);const A=this.createMockScopeDispatchData(t),s=n(this[i],this[o],A,{ignoreTrailingSlash:this[g]});return new E(s)}replyWithError(e){if("undefined"==typeof e)throw new d("error must be defined");const t=n(this[i],this[o],{error:e},{ignoreTrailingSlash:this[g]});return new E(t)}defaultReplyHeaders(e){if("undefined"==typeof e)throw new d("headers must be defined");return this[a]=e,this}defaultReplyTrailers(e){if("undefined"==typeof e)throw new d("trailers must be defined");return this[c]=e,this}replyContentLength(){return this[l]=!0,this}},e.exports.MockScope=E},5846:(e,t,A)=>{"use strict";const{promisify:s}=A(7975),r=A(8542),{buildMockDispatch:n}=A(991),{kDispatches:i,kMockAgent:o,kClose:a,kOriginalClose:c,kOrigin:l,kOriginalDispatch:h,kConnected:g,kIgnoreTrailingSlash:d}=A(3435),{MockInterceptor:u}=A(193),E=A(257),{InvalidArgumentError:I}=A(4465);class Q extends r{constructor(e,t){if(!t||!t.agent||"function"!=typeof t.agent.dispatch)throw new I("Argument opts.agent must implement Agent");super(e,t),this[o]=t.agent,this[l]=e,this[d]=t.ignoreTrailingSlash??!1,this[i]=[],this[g]=1,this[h]=this.dispatch,this[c]=this.close.bind(this),this.dispatch=n.call(this),this.close=this[a]}get[E.kConnected](){return this[g]}intercept(e){return new u(e&&{ignoreTrailingSlash:this[d],...e},this[i])}cleanMocks(){this[i]=[]}async[a](){await s(this[c])(),this[g]=0,this[o][E.kClients].delete(this[l])}}e.exports=Q},3435:e=>{"use strict";e.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOriginalDispatch:Symbol("original dispatch"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected"),kIgnoreTrailingSlash:Symbol("ignore trailing slash"),kMockAgentMockCallHistoryInstance:Symbol("mock agent mock call history name"),kMockAgentRegisterCallHistory:Symbol("mock agent register mock call history"),kMockAgentAddCallHistoryLog:Symbol("mock agent add call history log"),kMockAgentIsCallHistoryEnabled:Symbol("mock agent is call history enabled"),kMockAgentAcceptsNonStandardSearchParameters:Symbol("mock agent accepts non standard search parameters"),kMockCallHistoryAddLog:Symbol("mock call history add log")}},991:(e,t,A)=>{"use strict";const{MockNotMatchedError:s}=A(3123),{kDispatches:r,kMockAgent:n,kOriginalDispatch:i,kOrigin:o,kGetNetConnect:a}=A(3435),{serializePathWithQuery:c}=A(2858),{STATUS_CODES:l}=A(7067),{types:{isPromise:h}}=A(7975),{InvalidArgumentError:g}=A(4465);function d(e,t){return"string"==typeof e?e===t:e instanceof RegExp?e.test(t):"function"==typeof e&&!0===e(t)}function u(e){return Object.fromEntries(Object.entries(e).map((([e,t])=>[e.toLocaleLowerCase(),t])))}function E(e,t){if(!Array.isArray(e))return"function"==typeof e.get?e.get(t):u(e)[t.toLocaleLowerCase()];for(let A=0;A<e.length;A+=2)if(e[A].toLocaleLowerCase()===t.toLocaleLowerCase())return e[A+1]}function I(e){const t=e.slice(),A=[];for(let e=0;e<t.length;e+=2)A.push([t[e],t[e+1]]);return Object.fromEntries(A)}function Q(e,t){if("function"==typeof e.headers)return Array.isArray(t)&&(t=I(t)),e.headers(t?u(t):{});if("undefined"==typeof e.headers)return!0;if("object"!=typeof t||"object"!=typeof e.headers)return!1;for(const[A,s]of Object.entries(e.headers)){if(!d(s,E(t,A)))return!1}return!0}function C(e){if("string"!=typeof e)return e;const t=e.split("?",3);if(2!==t.length)return e;const A=new URLSearchParams(t.pop());return A.sort(),[...t,A.toString()].join("?")}function B(e){return Buffer.isBuffer(e)||e instanceof Uint8Array||e instanceof ArrayBuffer?e:"object"==typeof e?JSON.stringify(e):e?e.toString():""}function p(e,t){const A=t.query?c(t.path,t.query):t.path,r="string"==typeof A?C(A):A,n=m(r);let i=e.filter((({consumed:e})=>!e)).filter((({path:e,ignoreTrailingSlash:t})=>t?d(m(C(e)),n):d(C(e),r)));if(0===i.length)throw new s(`Mock dispatch not matched for path '${r}'`);if(i=i.filter((({method:e})=>d(e,t.method))),0===i.length)throw new s(`Mock dispatch not matched for method '${t.method}' on path '${r}'`);if(i=i.filter((({body:e})=>"undefined"==typeof e||d(e,t.body))),0===i.length)throw new s(`Mock dispatch not matched for body '${t.body}' on path '${r}'`);if(i=i.filter((e=>Q(e,t.headers))),0===i.length){const e="object"==typeof t.headers?JSON.stringify(t.headers):t.headers;throw new s(`Mock dispatch not matched for headers '${e}' on path '${r}'`)}return i[0]}function f(e,t){const A=e.findIndex((e=>!!e.consumed&&function(e,{path:t,method:A,body:s,headers:r}){const n=d(e.path,t),i=d(e.method,A),o="undefined"==typeof e.body||d(e.body,s),a=Q(e,r);return n&&i&&o&&a}(e,t)));-1!==A&&e.splice(A,1)}function m(e){for(;e.endsWith("/");)e=e.slice(0,-1);return 0===e.length&&(e="/"),e}function y(e){const{path:t,method:A,body:s,headers:r,query:n}=e;return{path:t,method:A,body:s,headers:r,query:n}}function S(e){const t=Object.keys(e),A=[];for(let s=0;s<t.length;++s){const r=t[s],n=e[r],i=Buffer.from(`${r}`);if(Array.isArray(n))for(let e=0;e<n.length;++e)A.push(i,Buffer.from(`${n[e]}`));else A.push(i,Buffer.from(`${n}`))}return A}function w(e){return l[e]||"unknown"}function D(e,t){const A=y(e),s=p(this[r],A);s.timesInvoked++,s.data.callback&&(s.data={...s.data,...s.data.callback(e)});const{data:{statusCode:n,data:i,headers:o,trailers:a,error:c},delay:l,persist:g}=s,{timesInvoked:d,times:u}=s;if(s.consumed=!g&&d>=u,s.pending=d<u,null!==c)return f(this[r],A),t.onError(c),!0;function E(s,r=i){const c=Array.isArray(e.headers)?I(e.headers):e.headers,l="function"==typeof r?r({...e,headers:c}):r;if(h(l))return void l.then((e=>E(s,e)));const g=B(l),d=S(o),u=S(a);t.onConnect?.((e=>t.onError(e)),null),t.onHeaders?.(n,d,Q,w(n)),t.onData?.(Buffer.from(g)),t.onComplete?.(u),f(s,A)}function Q(){}return"number"==typeof l&&l>0?setTimeout((()=>{E(this[r])}),l):E(this[r]),!0}function b(e,t){const A=new URL(t);return!0===e||!(!Array.isArray(e)||!e.some((e=>d(e,A.host))))}e.exports={getResponseData:B,getMockDispatch:p,addMockDispatch:function(e,t,A,s){const r={...{timesInvoked:0,times:1,persist:!1,consumed:!1,...s},...t,pending:!0,data:{error:null,..."function"==typeof A?{callback:A}:{...A}}};return e.push(r),r},deleteMockDispatch:f,buildKey:y,generateKeyValues:S,matchValue:d,getResponse:async function(e){const t=[];for await(const A of e)t.push(A);return Buffer.concat(t).toString("utf8")},getStatusText:w,mockDispatch:D,buildMockDispatch:function(){const e=this[n],t=this[o],A=this[i];return function(r,n){if(e.isMockActive)try{D.call(this,r,n)}catch(i){if("UND_MOCK_ERR_MOCK_NOT_MATCHED"!==i.code)throw i;{const o=e[a]();if(!1===o)throw new s(`${i.message}: subsequent request to origin ${t} was not allowed (net.connect disabled)`);if(!b(o,t))throw new s(`${i.message}: subsequent request to origin ${t} was not allowed (net.connect is not enabled for this origin)`);A.call(this,r,n)}}else A.call(this,r,n)}},checkNetConnect:b,buildAndValidateMockOptions:function(e){const{agent:t,...A}=e;if("enableCallHistory"in A&&"boolean"!=typeof A.enableCallHistory)throw new g("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in A&&"boolean"!=typeof A.acceptNonStandardSearchParameters)throw new g("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in A&&"boolean"!=typeof A.ignoreTrailingSlash)throw new g("options.ignoreTrailingSlash must to be a boolean");return A},getHeaderByName:E,buildHeadersFromArray:I,normalizeSearchParams:function(e){if("string"!=typeof e)return e;const t=new URLSearchParams(e),A=new URLSearchParams;for(let[e,s]of t.entries()){e=e.replace("[]","");if(/^(['"]).*\1$/.test(s))A.append(e,s);else if(s.includes(",")){const t=s.split(",");for(const s of t)A.append(e,s)}else A.append(e,s)}return A}}},164:(e,t,A)=>{"use strict";const{Transform:s}=A(7075),{Console:r}=A(7540),n=process.versions.icu?"✅":"Y ",i=process.versions.icu?"❌":"N ";e.exports=class{constructor({disableColors:e}={}){this.transform=new s({transform(e,t,A){A(null,e)}}),this.logger=new r({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){const t=e.map((({method:e,path:t,data:{statusCode:A},persist:s,times:r,timesInvoked:o,origin:a})=>({Method:e,Origin:a,Path:t,"Status code":A,Persistent:s?n:i,Invocations:o,Remaining:s?1/0:r-o})));return this.logger.table(t),this.transform.read().toString()}}},1313:(e,t,A)=>{"use strict";const s=A(3315),r=A(7467),{SnapshotRecorder:n}=A(6632),i=A(832),{InvalidArgumentError:o,UndiciError:a}=A(4465),{validateSnapshotMode:c}=A(5505),l=Symbol("kSnapshotRecorder"),h=Symbol("kSnapshotMode"),g=Symbol("kSnapshotPath"),d=Symbol("kSnapshotLoaded"),u=Symbol("kRealAgent");let E=!1;e.exports=class extends r{constructor(e={}){E||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),E=!0);const{mode:t="record",snapshotPath:A=null,...r}=e;if(super(r),c(t),("playback"===t||"update"===t)&&!A)throw new o(`snapshotPath is required when mode is '${t}'`);this[h]=t,this[g]=A,this[l]=new n({snapshotPath:this[g],mode:this[h],maxSnapshots:e.maxSnapshots,autoFlush:e.autoFlush,flushInterval:e.flushInterval,matchHeaders:e.matchHeaders,ignoreHeaders:e.ignoreHeaders,excludeHeaders:e.excludeHeaders,matchBody:e.matchBody,matchQuery:e.matchQuery,caseSensitive:e.caseSensitive,shouldRecord:e.shouldRecord,shouldPlayback:e.shouldPlayback,excludeUrls:e.excludeUrls}),this[d]=!1,"record"!==this[h]&&"update"!==this[h]||(this[u]=new s(e)),"playback"!==this[h]&&"update"!==this[h]||!this[g]||this.loadSnapshots().catch((()=>{}))}dispatch(e,t){t=i.wrap(t);const A=this[h];if("playback"===A||"update"===A){if(!this[d])return this.#me(e,t);const s=this[l].findSnapshot(e);if(s)return this.#ye(s,t);if("update"===A)return this.#Se(e,t);{const A=new a(`No snapshot found for ${e.method||"GET"} ${e.path}`);if(t.onError)return void t.onError(A);throw A}}if("record"===A)return this.#Se(e,t)}async#me(e,t){return await this.loadSnapshots(),this.dispatch(e,t)}#Se(e,t){const A={statusCode:null,headers:{},trailers:{},body:[]},s=this,r={onRequestStart(e,A){return t.onRequestStart(e,{...A,history:this.history})},onRequestUpgrade:(e,A,s,r)=>t.onRequestUpgrade(e,A,s,r),onResponseStart:(e,s,r,n)=>(A.statusCode=s,A.headers=r,t.onResponseStart(e,s,r,n)),onResponseData:(e,s)=>(A.body.push(s),t.onResponseData(e,s)),onResponseEnd(r,n){A.trailers=n;const i=Buffer.concat(A.body);s[l].record(e,{statusCode:A.statusCode,headers:A.headers,body:i,trailers:A.trailers}).then((()=>{t.onResponseEnd(r,n)})).catch((e=>{t.onResponseError(r,e)}))}};return this[u].dispatch(e,r)}#ye(e,t){try{const{response:A}=e,s={pause(){},resume(){},abort(e){this.aborted=!0,this.reason=e},aborted:!1,paused:!1};t.onRequestStart(s),t.onResponseStart(s,A.statusCode,A.headers);const r=Buffer.from(A.body,"base64");t.onResponseData(s,r),t.onResponseEnd(s,A.trailers)}catch(e){t.onError?.(e)}}async loadSnapshots(e){await this[l].loadSnapshots(e||this[g]),this[d]=!0,"playback"===this[h]&&this.#we()}async saveSnapshots(e){return this[l].saveSnapshots(e||this[g])}#we(){for(const e of this[l].getSnapshots()){const{request:t,responses:A,response:s}=e,r=new URL(t.url),n=this.get(r.origin),i=A?A[0]:s;i&&n.intercept({path:r.pathname+r.search,method:t.method,headers:t.headers,body:t.body}).reply(i.statusCode,i.body,{headers:i.headers,trailers:i.trailers}).persist()}}getRecorder(){return this[l]}getMode(){return this[h]}clearSnapshots(){this[l].clear()}resetCallCounts(){this[l].resetCallCounts()}deleteSnapshot(e){return this[l].deleteSnapshot(e)}getSnapshotInfo(e){return this[l].getSnapshotInfo(e)}replaceSnapshots(e){this[l].replaceSnapshots(e)}async close(){await this[l].close(),await(this[u]?.close()),await super.close()}}},6632:(e,t,A)=>{"use strict";const{writeFile:s,readFile:r,mkdir:n}=A(1455),{dirname:i,resolve:o}=A(6760),{setTimeout:a,clearTimeout:c}=A(7997),{InvalidArgumentError:l,UndiciError:h}=A(4465),{hashId:g,isUrlExcludedFactory:d,normalizeHeaders:u,createHeaderFilters:E}=A(5505);function I(e,t,A={}){const s=new URL(e.path,e.origin),r=e._normalizedHeaders||u(e.headers);return e._normalizedHeaders||(e._normalizedHeaders=r),{method:e.method||"GET",url:!1!==A.matchQuery?s.toString():`${s.origin}${s.pathname}`,headers:Q(r,t,A),body:!1!==A.matchBody&&e.body?String(e.body):""}}function Q(e,t,A={}){if(!e||"object"!=typeof e)return{};const{caseSensitive:s=!1}=A,r={},{ignore:n,exclude:i,match:o}=t;for(const[t,A]of Object.entries(e)){const e=s?t:t.toLowerCase();i.has(e)||(n.has(e)||(0===o.size||o.has(e))&&(r[e]=A))}return r}function C(e,t,A={}){if(!e||"object"!=typeof e)return{};const{caseSensitive:s=!1}=A,r={},{exclude:n}=t;for(const[t,A]of Object.entries(e)){const e=s?t:t.toLowerCase();n.has(e)||(r[e]=A)}return r}function B(e){const t=[e.method,e.url];if(e.headers&&"object"==typeof e.headers){const A=Object.keys(e.headers).sort();for(const s of A){const A=Array.isArray(e.headers[s])?e.headers[s]:[e.headers[s]];t.push(s);for(const e of A.sort())t.push(String(e))}}t.push(e.body);const A=t.join("|");return g(A)}e.exports={SnapshotRecorder:class{#De;#be;#Ne=new Map;#Re;#ve=1/0;#ke=!1;#Te;constructor(e={}){this.#Re=e.snapshotPath,this.#ve=e.maxSnapshots||1/0,this.#ke=e.autoFlush||!1,this.flushInterval=e.flushInterval||3e4,this._flushTimer=null,this.matchOptions={matchHeaders:e.matchHeaders||[],ignoreHeaders:e.ignoreHeaders||[],excludeHeaders:e.excludeHeaders||[],matchBody:!1!==e.matchBody,matchQuery:!1!==e.matchQuery,caseSensitive:e.caseSensitive||!1},this.#Te=E(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#be=d(e.excludeUrls),this.#ke&&this.#Re&&this.#Fe()}async record(e,t){if(!this.shouldRecord(e))return;const A=new URL(e.path,e.origin).toString();if(this.#be(A))return;const s=I(e,this.#Te,this.matchOptions),r=B(s),n=u(t.headers),i={statusCode:t.statusCode,headers:C(n,this.#Te,this.matchOptions),body:Buffer.isBuffer(t.body)?t.body.toString("base64"):Buffer.from(String(t.body||"")).toString("base64"),trailers:t.trailers};if(this.#Ne.size>=this.#ve&&!this.#Ne.has(r)){const e=this.#Ne.keys().next().value;this.#Ne.delete(e)}const o=this.#Ne.get(r);o&&o.responses?(o.responses.push(i),o.timestamp=(new Date).toISOString()):this.#Ne.set(r,{request:s,responses:[i],callCount:0,timestamp:(new Date).toISOString()}),this.#ke&&this.#Re&&this.#Me()}findSnapshot(e){if(!this.shouldPlayback(e))return;const t=new URL(e.path,e.origin).toString();if(this.#be(t))return;const A=B(I(e,this.#Te,this.matchOptions)),s=this.#Ne.get(A);if(!s)return;const r=s.callCount||0,n=Math.min(r,s.responses.length-1);return s.callCount=r+1,{...s,response:s.responses[n]}}async loadSnapshots(e){const t=e||this.#Re;if(!t)throw new l("Snapshot path is required");try{const e=await r(o(t),"utf8"),A=JSON.parse(e);if(Array.isArray(A)){this.#Ne.clear();for(const{hash:e,snapshot:t}of A)this.#Ne.set(e,t)}else this.#Ne=new Map(Object.entries(A))}catch(e){if("ENOENT"!==e.code)throw new h(`Failed to load snapshots from ${t}`,{cause:e});this.#Ne.clear()}}async saveSnapshots(e){const t=e||this.#Re;if(!t)throw new l("Snapshot path is required");const A=o(t);await n(i(A),{recursive:!0});const r=Array.from(this.#Ne.entries()).map((([e,t])=>({hash:e,snapshot:t})));await s(A,JSON.stringify(r,null,2),{flush:!0})}clear(){this.#Ne.clear()}getSnapshots(){return Array.from(this.#Ne.values())}size(){return this.#Ne.size}resetCallCounts(){for(const e of this.#Ne.values())e.callCount=0}deleteSnapshot(e){const t=B(I(e,this.#Te,this.matchOptions));return this.#Ne.delete(t)}getSnapshotInfo(e){const t=B(I(e,this.#Te,this.matchOptions)),A=this.#Ne.get(t);return A?{hash:t,request:A.request,responseCount:A.responses?A.responses.length:A.response?1:0,callCount:A.callCount||0,timestamp:A.timestamp}:null}replaceSnapshots(e){if(this.#Ne.clear(),Array.isArray(e))for(const{hash:t,snapshot:A}of e)this.#Ne.set(t,A);else e&&"object"==typeof e&&(this.#Ne=new Map(Object.entries(e)))}#Fe(){return this.#Me()}#Ue(){this.#De&&(c(this.#De),this.saveSnapshots().catch((()=>{})),this.#De=null)}#Me(){this.#De=a((()=>{this.saveSnapshots().catch((()=>{})),this.#ke?this.#De?.refresh():this.#De=null}),1e3)}destroy(){this.#Ue(),this.#De&&(c(this.#De),this.#De=null)}async close(){this.#Re&&0!==this.#Ne.size&&await this.saveSnapshots(),this.destroy()}},formatRequestKey:I,createRequestHash:B,filterHeadersForMatching:Q,filterHeadersForStorage:C,createHeaderFilters:E}},5505:(e,t,A)=>{"use strict";const{InvalidArgumentError:s}=A(4465);let r;try{r=A(7598)}catch{}const n=r?.hash?e=>r.hash("sha256",e,"base64url"):e=>Buffer.from(e).toString("base64url");function i(e){return Array.isArray(e)&&!(1&e.length)}const o=["record","playback","update"];e.exports={createHeaderFilters:function(e={}){const{ignoreHeaders:t=[],excludeHeaders:A=[],matchHeaders:s=[],caseSensitive:r=!1}=e;return{ignore:new Set(t.map((e=>r?e:e.toLowerCase()))),exclude:new Set(A.map((e=>r?e:e.toLowerCase()))),match:new Set(s.map((e=>r?e:e.toLowerCase())))}},hashId:n,isUndiciHeaders:i,normalizeHeaders:function(e){const t={};if(!e)return t;if(i(e)){for(let A=0;A<e.length;A+=2){const s=e[A],r=e[A+1];if(s&&void 0!==r){const e=Buffer.isBuffer(s)?s.toString():s,A=Buffer.isBuffer(r)?r.toString():r;t[e.toLowerCase()]=A}}return t}if(e&&"object"==typeof e)for(const[A,s]of Object.entries(e))A&&"string"==typeof A&&(t[A.toLowerCase()]=Array.isArray(s)?s.join(", "):String(s));return t},isUrlExcludedFactory:function(e=[]){return 0===e.length?()=>!1:function(t){let A;for(const s of e)if("string"==typeof s){if(A||(A=t.toLowerCase()),A.includes(s.toLowerCase()))return!0}else if(s instanceof RegExp&&s.test(t))return!0;return!1}},validateSnapshotMode:function(e){if(!o.includes(e))throw new s(`Invalid snapshot mode: ${e}. Must be one of: ${o.join(", ")}`)}}},9453:(e,t,A)=>{"use strict";const{safeHTTPMethods:s,pathHasQueryOrFragment:r}=A(2858),{serializePathWithQuery:n}=A(2858);e.exports={makeCacheKey:function(e){if(!e.origin)throw new Error("opts.origin is undefined");let t=e.path||"/";return e.query&&!r(e.path)&&(t=n(t,e.query)),{origin:e.origin.toString(),method:e.method,path:t,headers:e.headers}},normalizeHeaders:function(e){let t;if(null==e.headers)t={};else if("function"==typeof e.headers[Symbol.iterator]){t={};for(const A of e.headers){if(!Array.isArray(A))throw new Error("opts.headers is not a valid header map");const[e,s]=A;if("string"!=typeof e||"string"!=typeof s)throw new Error("opts.headers is not a valid header map");t[e.toLowerCase()]=s}}else{if("object"!=typeof e.headers)throw new Error("opts.headers is not an object");t={};for(const A of Object.keys(e.headers))t[A.toLowerCase()]=e.headers[A]}return t},assertCacheKey:function(e){if("object"!=typeof e)throw new TypeError("expected key to be object, got "+typeof e);for(const t of["origin","method","path"])if("string"!=typeof e[t])throw new TypeError(`expected key.${t} to be string, got ${typeof e[t]}`);if(void 0!==e.headers&&"object"!=typeof e.headers)throw new TypeError("expected headers to be object, got "+typeof e)},assertCacheValue:function(e){if("object"!=typeof e)throw new TypeError("expected value to be object, got "+typeof e);for(const t of["statusCode","cachedAt","staleAt","deleteAt"])if("number"!=typeof e[t])throw new TypeError(`expected value.${t} to be number, got ${typeof e[t]}`);if("string"!=typeof e.statusMessage)throw new TypeError("expected value.statusMessage to be string, got "+typeof e.statusMessage);if(null!=e.headers&&"object"!=typeof e.headers)throw new TypeError("expected value.rawHeaders to be object, got "+typeof e.headers);if(void 0!==e.vary&&"object"!=typeof e.vary)throw new TypeError("expected value.vary to be object, got "+typeof e.vary);if(void 0!==e.etag&&"string"!=typeof e.etag)throw new TypeError("expected value.etag to be string, got "+typeof e.etag)},parseCacheControlHeader:function(e){const t={};let A;if(Array.isArray(e)){A=[];for(const t of e)A.push(...t.split(","))}else A=e.split(",");for(let e=0;e<A.length;e++){const s=A[e].toLowerCase(),r=s.indexOf("=");let n,i;switch(-1!==r?(n=s.substring(0,r).trimStart(),i=s.substring(r+1)):n=s.trim(),n){case"min-fresh":case"max-stale":case"max-age":case"s-maxage":case"stale-while-revalidate":case"stale-if-error":{if(void 0===i||" "===i[0])continue;i.length>=2&&'"'===i[0]&&'"'===i[i.length-1]&&(i=i.substring(1,i.length-1));const e=parseInt(i,10);if(e!=e)continue;if("max-age"===n&&n in t&&t[n]>=e)continue;t[n]=e;break}case"private":case"no-cache":if(i){if('"'===i[0]){const s=[i.substring(1)];let r='"'===i[i.length-1];if(!r)for(let t=e+1;t<A.length;t++){const e=A[t],n=e.length;if(s.push(e.trim()),0!==n&&'"'===e[n-1]){r=!0;break}}if(r){let e=s[s.length-1];'"'===e[e.length-1]&&(e=e.substring(0,e.length-1),s[s.length-1]=e),t[n]=n in t?t[n].concat(s):s}}else t[n]=n in t?t[n].concat(i):[i];break}case"public":case"no-store":case"must-revalidate":case"proxy-revalidate":case"immutable":case"no-transform":case"must-understand":case"only-if-cached":if(i)continue;t[n]=!0;break;default:continue}}return t},parseVaryHeader:function(e,t){if("string"==typeof e&&e.includes("*"))return t;const A={},s="string"==typeof e?e.split(","):e;for(const e of s){const s=e.trim().toLowerCase();A[s]=t[s]??null}return A},isEtagUsable:function(e){return!(e.length<=2)&&('"'===e[0]&&'"'===e[e.length-1]?!('"'===e[1]||e.startsWith('"W/')):!(!e.startsWith('W/"')||'"'!==e[e.length-1])&&4!==e.length)},assertCacheMethods:function(e,t="CacheMethods"){if(!Array.isArray(e))throw new TypeError(`expected type of ${t} needs to be an array, got ${null===e?"null":typeof e}`);if(0===e.length)throw new TypeError(`${t} needs to have at least one method`);for(const A of e)if(!s.includes(A))throw new TypeError(`element of ${t}-array needs to be one of following values: ${s.join(", ")}, got ${A}`)},assertCacheStore:function(e,t="CacheStore"){if("object"!=typeof e||null===e)throw new TypeError(`expected type of ${t} to be a CacheStore, got ${null===e?"null":typeof e}`);for(const A of["get","createWriteStream","delete"])if("function"!=typeof e[A])throw new TypeError(`${t} needs to have a \`${A}()\` function`)}}},8851:e=>{"use strict";e.exports={parseHttpDate:function(e){switch(e[3]){case",":return function(e){if(29!==e.length||" "!==e[4]||" "!==e[7]||" "!==e[11]||" "!==e[16]||":"!==e[19]||":"!==e[22]||" "!==e[25]||"G"!==e[26]||"M"!==e[27]||"T"!==e[28])return;let t=-1;if("S"===e[0]&&"u"===e[1]&&"n"===e[2])t=0;else if("M"===e[0]&&"o"===e[1]&&"n"===e[2])t=1;else if("T"===e[0]&&"u"===e[1]&&"e"===e[2])t=2;else if("W"===e[0]&&"e"===e[1]&&"d"===e[2])t=3;else if("T"===e[0]&&"h"===e[1]&&"u"===e[2])t=4;else if("F"===e[0]&&"r"===e[1]&&"i"===e[2])t=5;else{if("S"!==e[0]||"a"!==e[1]||"t"!==e[2])return;t=6}let A=0;if("0"===e[5]){const t=e.charCodeAt(6);if(t<49||t>57)return;A=t-48}else{const t=e.charCodeAt(5);if(t<49||t>51)return;const s=e.charCodeAt(6);if(s<48||s>57)return;A=10*(t-48)+(s-48)}let s=-1;if("J"===e[8]&&"a"===e[9]&&"n"===e[10])s=0;else if("F"===e[8]&&"e"===e[9]&&"b"===e[10])s=1;else if("M"===e[8]&&"a"===e[9])if("r"===e[10])s=2;else{if("y"!==e[10])return;s=4}else if("J"===e[8])if("a"===e[9]&&"n"===e[10])s=0;else{if("u"!==e[9])return;if("n"===e[10])s=5;else{if("l"!==e[10])return;s=6}}else if("A"===e[8])if("p"===e[9]&&"r"===e[10])s=3;else{if("u"!==e[9]||"g"!==e[10])return;s=7}else if("S"===e[8]&&"e"===e[9]&&"p"===e[10])s=8;else if("O"===e[8]&&"c"===e[9]&&"t"===e[10])s=9;else if("N"===e[8]&&"o"===e[9]&&"v"===e[10])s=10;else{if("D"!==e[8]||"e"!==e[9]||"c"!==e[10])return;s=11}const r=e.charCodeAt(12);if(r<48||r>57)return;const n=e.charCodeAt(13);if(n<48||n>57)return;const i=e.charCodeAt(14);if(i<48||i>57)return;const o=e.charCodeAt(15);if(o<48||o>57)return;const a=1e3*(r-48)+100*(n-48)+10*(i-48)+(o-48);let c=0;if("0"===e[17]){const t=e.charCodeAt(18);if(t<48||t>57)return;c=t-48}else{const t=e.charCodeAt(17);if(t<48||t>50)return;const A=e.charCodeAt(18);if(A<48||A>57)return;if(50===t&&A>51)return;c=10*(t-48)+(A-48)}let l=0;if("0"===e[20]){const t=e.charCodeAt(21);if(t<48||t>57)return;l=t-48}else{const t=e.charCodeAt(20);if(t<48||t>53)return;const A=e.charCodeAt(21);if(A<48||A>57)return;l=10*(t-48)+(A-48)}let h=0;if("0"===e[23]){const t=e.charCodeAt(24);if(t<48||t>57)return;h=t-48}else{const t=e.charCodeAt(23);if(t<48||t>53)return;const A=e.charCodeAt(24);if(A<48||A>57)return;h=10*(t-48)+(A-48)}const g=new Date(Date.UTC(a,s,A,c,l,h));return g.getUTCDay()===t?g:void 0}(e);case" ":return function(e){if(24!==e.length||" "!==e[7]||" "!==e[10]||" "!==e[19])return;let t=-1;if("S"===e[0]&&"u"===e[1]&&"n"===e[2])t=0;else if("M"===e[0]&&"o"===e[1]&&"n"===e[2])t=1;else if("T"===e[0]&&"u"===e[1]&&"e"===e[2])t=2;else if("W"===e[0]&&"e"===e[1]&&"d"===e[2])t=3;else if("T"===e[0]&&"h"===e[1]&&"u"===e[2])t=4;else if("F"===e[0]&&"r"===e[1]&&"i"===e[2])t=5;else{if("S"!==e[0]||"a"!==e[1]||"t"!==e[2])return;t=6}let A=-1;if("J"===e[4]&&"a"===e[5]&&"n"===e[6])A=0;else if("F"===e[4]&&"e"===e[5]&&"b"===e[6])A=1;else if("M"===e[4]&&"a"===e[5])if("r"===e[6])A=2;else{if("y"!==e[6])return;A=4}else if("J"===e[4])if("a"===e[5]&&"n"===e[6])A=0;else{if("u"!==e[5])return;if("n"===e[6])A=5;else{if("l"!==e[6])return;A=6}}else if("A"===e[4])if("p"===e[5]&&"r"===e[6])A=3;else{if("u"!==e[5]||"g"!==e[6])return;A=7}else if("S"===e[4]&&"e"===e[5]&&"p"===e[6])A=8;else if("O"===e[4]&&"c"===e[5]&&"t"===e[6])A=9;else if("N"===e[4]&&"o"===e[5]&&"v"===e[6])A=10;else{if("D"!==e[4]||"e"!==e[5]||"c"!==e[6])return;A=11}let s=0;if(" "===e[8]){const t=e.charCodeAt(9);if(t<49||t>57)return;s=t-48}else{const t=e.charCodeAt(8);if(t<49||t>51)return;const A=e.charCodeAt(9);if(A<48||A>57)return;s=10*(t-48)+(A-48)}let r=0;if("0"===e[11]){const t=e.charCodeAt(12);if(t<48||t>57)return;r=t-48}else{const t=e.charCodeAt(11);if(t<48||t>50)return;const A=e.charCodeAt(12);if(A<48||A>57)return;if(50===t&&A>51)return;r=10*(t-48)+(A-48)}let n=0;if("0"===e[14]){const t=e.charCodeAt(15);if(t<48||t>57)return;n=t-48}else{const t=e.charCodeAt(14);if(t<48||t>53)return;const A=e.charCodeAt(15);if(A<48||A>57)return;n=10*(t-48)+(A-48)}let i=0;if("0"===e[17]){const t=e.charCodeAt(18);if(t<48||t>57)return;i=t-48}else{const t=e.charCodeAt(17);if(t<48||t>53)return;const A=e.charCodeAt(18);if(A<48||A>57)return;i=10*(t-48)+(A-48)}const o=e.charCodeAt(20);if(o<48||o>57)return;const a=e.charCodeAt(21);if(a<48||a>57)return;const c=e.charCodeAt(22);if(c<48||c>57)return;const l=e.charCodeAt(23);if(l<48||l>57)return;const h=1e3*(o-48)+100*(a-48)+10*(c-48)+(l-48),g=new Date(Date.UTC(h,A,s,r,n,i));return g.getUTCDay()===t?g:void 0}(e);default:return function(e){let t=-1,A=-1;if("S"===e[0])"u"===e[1]&&"n"===e[2]&&"d"===e[3]&&"a"===e[4]&&"y"===e[5]?(A=0,t=6):"a"===e[1]&&"t"===e[2]&&"u"===e[3]&&"r"===e[4]&&"d"===e[5]&&"a"===e[6]&&"y"===e[7]&&(A=6,t=8);else if("M"===e[0]&&"o"===e[1]&&"n"===e[2]&&"d"===e[3]&&"a"===e[4]&&"y"===e[5])A=1,t=6;else if("T"===e[0])"u"===e[1]&&"e"===e[2]&&"s"===e[3]&&"d"===e[4]&&"a"===e[5]&&"y"===e[6]?(A=2,t=7):"h"===e[1]&&"u"===e[2]&&"r"===e[3]&&"s"===e[4]&&"d"===e[5]&&"a"===e[6]&&"y"===e[7]&&(A=4,t=8);else if("W"===e[0]&&"e"===e[1]&&"d"===e[2]&&"n"===e[3]&&"e"===e[4]&&"s"===e[5]&&"d"===e[6]&&"a"===e[7]&&"y"===e[8])A=3,t=9;else{if("F"!==e[0]||"r"!==e[1]||"i"!==e[2]||"d"!==e[3]||"a"!==e[4]||"y"!==e[5])return;A=5,t=6}if(","!==e[t]||e.length-t-1!=23||" "!==e[t+1]||"-"!==e[t+4]||"-"!==e[t+8]||" "!==e[t+11]||":"!==e[t+14]||":"!==e[t+17]||" "!==e[t+20]||"G"!==e[t+21]||"M"!==e[t+22]||"T"!==e[t+23])return;let s=0;if("0"===e[t+2]){const A=e.charCodeAt(t+3);if(A<49||A>57)return;s=A-48}else{const A=e.charCodeAt(t+2);if(A<49||A>51)return;const r=e.charCodeAt(t+3);if(r<48||r>57)return;s=10*(A-48)+(r-48)}let r=-1;if("J"===e[t+5]&&"a"===e[t+6]&&"n"===e[t+7])r=0;else if("F"===e[t+5]&&"e"===e[t+6]&&"b"===e[t+7])r=1;else if("M"===e[t+5]&&"a"===e[t+6]&&"r"===e[t+7])r=2;else if("A"===e[t+5]&&"p"===e[t+6]&&"r"===e[t+7])r=3;else if("M"===e[t+5]&&"a"===e[t+6]&&"y"===e[t+7])r=4;else if("J"===e[t+5]&&"u"===e[t+6]&&"n"===e[t+7])r=5;else if("J"===e[t+5]&&"u"===e[t+6]&&"l"===e[t+7])r=6;else if("A"===e[t+5]&&"u"===e[t+6]&&"g"===e[t+7])r=7;else if("S"===e[t+5]&&"e"===e[t+6]&&"p"===e[t+7])r=8;else if("O"===e[t+5]&&"c"===e[t+6]&&"t"===e[t+7])r=9;else if("N"===e[t+5]&&"o"===e[t+6]&&"v"===e[t+7])r=10;else{if("D"!==e[t+5]||"e"!==e[t+6]||"c"!==e[t+7])return;r=11}const n=e.charCodeAt(t+9);if(n<48||n>57)return;const i=e.charCodeAt(t+10);if(i<48||i>57)return;let o=10*(n-48)+(i-48);o+=o<70?2e3:1900;let a=0;if("0"===e[t+12]){const A=e.charCodeAt(t+13);if(A<48||A>57)return;a=A-48}else{const A=e.charCodeAt(t+12);if(A<48||A>50)return;const s=e.charCodeAt(t+13);if(s<48||s>57)return;if(50===A&&s>51)return;a=10*(A-48)+(s-48)}let c=0;if("0"===e[t+15]){const A=e.charCodeAt(t+16);if(A<48||A>57)return;c=A-48}else{const A=e.charCodeAt(t+15);if(A<48||A>53)return;const s=e.charCodeAt(t+16);if(s<48||s>57)return;c=10*(A-48)+(s-48)}let l=0;if("0"===e[t+18]){const A=e.charCodeAt(t+19);if(A<48||A>57)return;l=A-48}else{const A=e.charCodeAt(t+18);if(A<48||A>53)return;const s=e.charCodeAt(t+19);if(s<48||s>57)return;l=10*(A-48)+(s-48)}const h=new Date(Date.UTC(o,r,s,a,c,l));return h.getUTCDay()===A?h:void 0}(e)}}}},9250:e=>{"use strict";e.exports={createDeferredPromise:function(){let e,t;return{promise:new Promise(((A,s)=>{e=A,t=s})),resolve:e,reject:t}}}},4304:(e,t,A)=>{"use strict";const{kConnected:s,kPending:r,kRunning:n,kSize:i,kFree:o,kQueued:a}=A(257);e.exports={ClientStats:class{constructor(e){this.connected=e[s],this.pending=e[r],this.running=e[n],this.size=e[i]}},PoolStats:class{constructor(e){this.connected=e[s],this.free=e[o],this.pending=e[r],this.queued=e[a],this.running=e[n],this.size=e[i]}}}},3801:e=>{"use strict";let t=0;const A=1e3;let s;const r=Symbol("kFastTimer"),n=[];function i(){t+=499;let e=0,A=n.length;for(;e<A;){const s=n[e];0===s._state?(s._idleStart=t-499,s._state=1):1===s._state&&t>=s._idleStart+s._idleTimeout&&(s._state=-1,s._idleStart=-1,s._onTimeout(s._timerArg)),-1===s._state?(s._state=-2,0!=--A&&(n[e]=n[A])):++e}n.length=A,0!==n.length&&o()}function o(){s?.refresh?s.refresh():(clearTimeout(s),s=setTimeout(i,499),s?.unref())}class a{[r]=!0;_state=-2;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,t,A){this._onTimeout=e,this._idleTimeout=t,this._timerArg=A,this.refresh()}refresh(){-2===this._state&&n.push(this),s&&1!==n.length||o(),this._state=0}clear(){this._state=-1,this._idleStart=-1}}e.exports={setTimeout:(e,t,s)=>t<=A?setTimeout(e,t,s):new a(e,t,s),clearTimeout(e){e[r]?e.clear():clearTimeout(e)},setFastTimeout:(e,t,A)=>new a(e,t,A),clearFastTimeout(e){e.clear()},now:()=>t,tick(e=0){t+=e-A+1,i(),i()},reset(){t=0,n.length=0,clearTimeout(s),s=null},kFastTimer:r}},4420:(e,t,A)=>{"use strict";const s=A(4589),{kConstruct:r}=A(257),{urlEquals:n,getFieldValues:i}=A(3932),{kEnumerableProperty:o,isDisturbed:a}=A(2858),{webidl:c}=A(6097),{cloneResponse:l,fromInnerResponse:h,getResponseState:g}=A(4821),{Request:d,fromInnerRequest:u,getRequestState:E}=A(4609),{fetching:I}=A(7388),{urlIsHttpHttpsScheme:Q,readAllBytes:C}=A(6686),{createDeferredPromise:B}=A(9250);class p{#Le;constructor(){arguments[0]!==r&&c.illegalConstructor(),c.util.markAsUncloneable(this),this.#Le=arguments[1]}async match(e,t={}){c.brandCheck(this,p);const A="Cache.match";c.argumentLengthCheck(arguments,1,A),e=c.converters.RequestInfo(e),t=c.converters.CacheQueryOptions(t,A,"options");const s=this.#He(e,t,1);if(0!==s.length)return s[0]}async matchAll(e=void 0,t={}){c.brandCheck(this,p);return void 0!==e&&(e=c.converters.RequestInfo(e)),t=c.converters.CacheQueryOptions(t,"Cache.matchAll","options"),this.#He(e,t)}async add(e){c.brandCheck(this,p);c.argumentLengthCheck(arguments,1,"Cache.add");const t=[e=c.converters.RequestInfo(e)],A=this.addAll(t);return await A}async addAll(e){c.brandCheck(this,p);const t="Cache.addAll";c.argumentLengthCheck(arguments,1,t);const A=[],s=[];for(let A of e){if(void 0===A)throw c.errors.conversionFailed({prefix:t,argument:"Argument 1",types:["undefined is not allowed"]});if(A=c.converters.RequestInfo(A),"string"==typeof A)continue;const e=E(A);if(!Q(e.url)||"GET"!==e.method)throw c.errors.exception({header:t,message:"Expected http/s scheme when method is not GET."})}const r=[];for(const n of e){const e=E(new d(n));if(!Q(e.url))throw c.errors.exception({header:t,message:"Expected http/s scheme."});e.initiator="fetch",e.destination="subresource",s.push(e);const o=B();r.push(I({request:e,processResponse(e){if("error"===e.type||206===e.status||e.status<200||e.status>299)o.reject(c.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(e.headersList.contains("vary")){const t=i(e.headersList.get("vary"));for(const e of t)if("*"===e){o.reject(c.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(const e of r)e.abort();return}}},processResponseEndOfBody(e){e.aborted?o.reject(new DOMException("aborted","AbortError")):o.resolve(e)}})),A.push(o.promise)}const n=Promise.all(A),o=await n,a=[];let l=0;for(const e of o){const t={type:"put",request:s[l],response:e};a.push(t),l++}const h=B();let g=null;try{this.#Pe(a)}catch(e){g=e}return queueMicrotask((()=>{null===g?h.resolve(void 0):h.reject(g)})),h.promise}async put(e,t){c.brandCheck(this,p);const A="Cache.put";c.argumentLengthCheck(arguments,2,A),e=c.converters.RequestInfo(e),t=c.converters.Response(t,A,"response");let s=null;if(s=c.is.Request(e)?E(e):E(new d(e)),!Q(s.url)||"GET"!==s.method)throw c.errors.exception({header:A,message:"Expected an http/s scheme when method is not GET"});const r=g(t);if(206===r.status)throw c.errors.exception({header:A,message:"Got 206 status"});if(r.headersList.contains("vary")){const e=i(r.headersList.get("vary"));for(const t of e)if("*"===t)throw c.errors.exception({header:A,message:"Got * vary field value"})}if(r.body&&(a(r.body.stream)||r.body.stream.locked))throw c.errors.exception({header:A,message:"Response body is locked or disturbed"});const n=l(r),o=B();if(null!=r.body){const e=r.body.stream.getReader();C(e,o.resolve,o.reject)}else o.resolve(void 0);const h=[],u={type:"put",request:s,response:n};h.push(u);const I=await o.promise;null!=n.body&&(n.body.source=I);const f=B();let m=null;try{this.#Pe(h)}catch(e){m=e}return queueMicrotask((()=>{null===m?f.resolve():f.reject(m)})),f.promise}async delete(e,t={}){c.brandCheck(this,p);const A="Cache.delete";c.argumentLengthCheck(arguments,1,A),e=c.converters.RequestInfo(e),t=c.converters.CacheQueryOptions(t,A,"options");let r=null;if(c.is.Request(e)){if(r=E(e),"GET"!==r.method&&!t.ignoreMethod)return!1}else s("string"==typeof e),r=E(new d(e));const n=[],i={type:"delete",request:r,options:t};n.push(i);const o=B();let a,l=null;try{a=this.#Pe(n)}catch(e){l=e}return queueMicrotask((()=>{null===l?o.resolve(!!a?.length):o.reject(l)})),o.promise}async keys(e=void 0,t={}){c.brandCheck(this,p);void 0!==e&&(e=c.converters.RequestInfo(e)),t=c.converters.CacheQueryOptions(t,"Cache.keys","options");let A=null;if(void 0!==e)if(c.is.Request(e)){if(A=E(e),"GET"!==A.method&&!t.ignoreMethod)return[]}else"string"==typeof e&&(A=E(new d(e)));const s=B(),r=[];if(void 0===e)for(const e of this.#Le)r.push(e[0]);else{const e=this.#xe(A,t);for(const t of e)r.push(t[0])}return queueMicrotask((()=>{const e=[];for(const t of r){const A=u(t,void 0,(new AbortController).signal,"immutable");e.push(A)}s.resolve(Object.freeze(e))})),s.promise}#Pe(e){const t=this.#Le,A=[...t],r=[],n=[];try{for(const A of e){if("delete"!==A.type&&"put"!==A.type)throw c.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if("delete"===A.type&&null!=A.response)throw c.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#xe(A.request,A.options,r).length)throw new DOMException("???","InvalidStateError");let e;if("delete"===A.type){if(e=this.#xe(A.request,A.options),0===e.length)return[];for(const A of e){const e=t.indexOf(A);s(-1!==e),t.splice(e,1)}}else if("put"===A.type){if(null==A.response)throw c.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});const n=A.request;if(!Q(n.url))throw c.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if("GET"!==n.method)throw c.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(null!=A.options)throw c.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});e=this.#xe(A.request);for(const A of e){const e=t.indexOf(A);s(-1!==e),t.splice(e,1)}t.push([A.request,A.response]),r.push([A.request,A.response])}n.push([A.request,A.response])}return n}catch(e){throw this.#Le.length=0,this.#Le=A,e}}#xe(e,t,A){const s=[],r=A??this.#Le;for(const A of r){const[r,n]=A;this.#Ye(e,r,n,t)&&s.push(A)}return s}#Ye(e,t,A=null,s){const r=new URL(e.url),o=new URL(t.url);if(s?.ignoreSearch&&(o.search="",r.search=""),!n(r,o,!0))return!1;if(null==A||s?.ignoreVary||!A.headersList.contains("vary"))return!0;const a=i(A.headersList.get("vary"));for(const A of a){if("*"===A)return!1;if(t.headersList.get(A)!==e.headersList.get(A))return!1}return!0}#He(e,t,A=1/0){let s=null;if(void 0!==e)if(c.is.Request(e)){if(s=E(e),"GET"!==s.method&&!t.ignoreMethod)return[]}else"string"==typeof e&&(s=E(new d(e)));const r=[];if(void 0===e)for(const e of this.#Le)r.push(e[1]);else{const e=this.#xe(s,t);for(const t of e)r.push(t[1])}const n=[];for(const e of r){const t=h(e,"immutable");if(n.push(t.clone()),n.length>=A)break}return Object.freeze(n)}}Object.defineProperties(p.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:o,matchAll:o,add:o,addAll:o,put:o,delete:o,keys:o});const f=[{key:"ignoreSearch",converter:c.converters.boolean,defaultValue:()=>!1},{key:"ignoreMethod",converter:c.converters.boolean,defaultValue:()=>!1},{key:"ignoreVary",converter:c.converters.boolean,defaultValue:()=>!1}];c.converters.CacheQueryOptions=c.dictionaryConverter(f),c.converters.MultiCacheQueryOptions=c.dictionaryConverter([...f,{key:"cacheName",converter:c.converters.DOMString}]),c.converters.Response=c.interfaceConverter(c.is.Response,"Response"),c.converters["sequence<RequestInfo>"]=c.sequenceConverter(c.converters.RequestInfo),e.exports={Cache:p}},6939:(e,t,A)=>{"use strict";const{Cache:s}=A(4420),{webidl:r}=A(6097),{kEnumerableProperty:n}=A(2858),{kConstruct:i}=A(257);class o{#Ve=new Map;constructor(){arguments[0]!==i&&r.illegalConstructor(),r.util.markAsUncloneable(this)}async match(e,t={}){if(r.brandCheck(this,o),r.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=r.converters.RequestInfo(e),null!=(t=r.converters.MultiCacheQueryOptions(t)).cacheName){if(this.#Ve.has(t.cacheName)){const A=this.#Ve.get(t.cacheName),r=new s(i,A);return await r.match(e,t)}}else for(const A of this.#Ve.values()){const r=new s(i,A),n=await r.match(e,t);if(void 0!==n)return n}}async has(e){r.brandCheck(this,o);const t="CacheStorage.has";return r.argumentLengthCheck(arguments,1,t),e=r.converters.DOMString(e,t,"cacheName"),this.#Ve.has(e)}async open(e){r.brandCheck(this,o);const t="CacheStorage.open";if(r.argumentLengthCheck(arguments,1,t),e=r.converters.DOMString(e,t,"cacheName"),this.#Ve.has(e)){const t=this.#Ve.get(e);return new s(i,t)}const A=[];return this.#Ve.set(e,A),new s(i,A)}async delete(e){r.brandCheck(this,o);const t="CacheStorage.delete";return r.argumentLengthCheck(arguments,1,t),e=r.converters.DOMString(e,t,"cacheName"),this.#Ve.delete(e)}async keys(){r.brandCheck(this,o);return[...this.#Ve.keys()]}}Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:n,has:n,open:n,delete:n,keys:n}),e.exports={CacheStorage:o}},3932:(e,t,A)=>{"use strict";const s=A(4589),{URLSerializer:r}=A(9934),{isValidHeaderName:n}=A(6686);e.exports={urlEquals:function(e,t,A=!1){return r(e,A)===r(t,A)},getFieldValues:function(e){s(null!==e);const t=[];for(let A of e.split(","))A=A.trim(),n(A)&&t.push(A);return t}}},3042:e=>{"use strict";e.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}},9391:(e,t,A)=>{"use strict";const{parseSetCookie:s}=A(6712),{stringify:r}=A(9871),{webidl:n}=A(6097),{Headers:i}=A(6558),o=n.brandCheckMultiple([i,globalThis.Headers].filter(Boolean));function a(e,t){n.argumentLengthCheck(arguments,2,"setCookie"),o(e),t=n.converters.Cookie(t);const A=r(t);A&&e.append("set-cookie",A,!0)}n.converters.DeleteCookieAttributes=n.dictionaryConverter([{converter:n.nullableConverter(n.converters.DOMString),key:"path",defaultValue:()=>null},{converter:n.nullableConverter(n.converters.DOMString),key:"domain",defaultValue:()=>null}]),n.converters.Cookie=n.dictionaryConverter([{converter:n.converters.DOMString,key:"name"},{converter:n.converters.DOMString,key:"value"},{converter:n.nullableConverter((e=>"number"==typeof e?n.converters["unsigned long long"](e):new Date(e))),key:"expires",defaultValue:()=>null},{converter:n.nullableConverter(n.converters["long long"]),key:"maxAge",defaultValue:()=>null},{converter:n.nullableConverter(n.converters.DOMString),key:"domain",defaultValue:()=>null},{converter:n.nullableConverter(n.converters.DOMString),key:"path",defaultValue:()=>null},{converter:n.nullableConverter(n.converters.boolean),key:"secure",defaultValue:()=>null},{converter:n.nullableConverter(n.converters.boolean),key:"httpOnly",defaultValue:()=>null},{converter:n.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:n.sequenceConverter(n.converters.DOMString),key:"unparsed",defaultValue:()=>[]}]),e.exports={getCookies:function(e){n.argumentLengthCheck(arguments,1,"getCookies"),o(e);const t=e.get("cookie"),A={};if(!t)return A;for(const e of t.split(";")){const[t,...s]=e.split("=");A[t.trim()]=s.join("=")}return A},deleteCookie:function(e,t,A){o(e);const s="deleteCookie";n.argumentLengthCheck(arguments,2,s),t=n.converters.DOMString(t,s,"name"),A=n.converters.DeleteCookieAttributes(A),a(e,{name:t,value:"",expires:new Date(0),...A})},getSetCookies:function(e){n.argumentLengthCheck(arguments,1,"getSetCookies"),o(e);const t=e.getSetCookie();return t?t.map((e=>s(e))):[]},setCookie:a,parseCookie:function(e){return e=n.converters.DOMString(e),s(e)}}},6712:(e,t,A)=>{"use strict";const{maxNameValuePairSize:s,maxAttributeValueSize:r}=A(3042),{isCTLExcludingHtab:n}=A(9871),{collectASequenceOfCodePointsFast:i}=A(9934),o=A(4589),{unescape:a}=A(1792);function c(e,t={}){if(0===e.length)return t;o(";"===e[0]);let A="";(e=e.slice(1)).includes(";")?(A=i(";",e,{position:0}),e=e.slice(A.length)):(A=e,e="");let s="",n="";if(A.includes("=")){const e={position:0};s=i("=",A,e),n=A.slice(e.position+1)}else s=A;if(s=s.trim(),n=n.trim(),n.length>r)return c(e,t);const a=s.toLowerCase();if("expires"===a){const e=new Date(n);t.expires=e}else if("max-age"===a){const A=n.charCodeAt(0);if((A<48||A>57)&&"-"!==n[0])return c(e,t);if(!/^\d+$/.test(n))return c(e,t);const s=Number(n);t.maxAge=s}else if("domain"===a){let e=n;"."===e[0]&&(e=e.slice(1)),e=e.toLowerCase(),t.domain=e}else if("path"===a){let e="";e=0===n.length||"/"!==n[0]?"/":n,t.path=e}else if("secure"===a)t.secure=!0;else if("httponly"===a)t.httpOnly=!0;else if("samesite"===a){let e="Default";const A=n.toLowerCase();A.includes("none")&&(e="None"),A.includes("strict")&&(e="Strict"),A.includes("lax")&&(e="Lax"),t.sameSite=e}else t.unparsed??=[],t.unparsed.push(`${s}=${n}`);return c(e,t)}e.exports={parseSetCookie:function(e){if(n(e))return null;let t="",A="",r="",o="";if(e.includes(";")){const s={position:0};t=i(";",e,s),A=e.slice(s.position)}else t=e;if(t.includes("=")){const e={position:0};r=i("=",t,e),o=t.slice(e.position+1)}else o=t;return r=r.trim(),o=o.trim(),r.length+o.length>s?null:{name:r,value:a(o),...c(A)}},parseUnparsedAttributes:c}},9871:e=>{"use strict";function t(e){for(let t=0;t<e.length;++t){const A=e.charCodeAt(t);if(A<33||A>126||34===A||40===A||41===A||60===A||62===A||64===A||44===A||59===A||58===A||92===A||47===A||91===A||93===A||63===A||61===A||123===A||125===A)throw new Error("Invalid cookie name")}}function A(e){let t=e.length,A=0;if('"'===e[0]){if(1===t||'"'!==e[t-1])throw new Error("Invalid cookie value");--t,++A}for(;A<t;){const t=e.charCodeAt(A++);if(t<33||t>126||34===t||44===t||59===t||92===t)throw new Error("Invalid cookie value")}}function s(e){for(let t=0;t<e.length;++t){const A=e.charCodeAt(t);if(A<32||127===A||59===A)throw new Error("Invalid cookie path")}}const r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i=Array(61).fill(0).map(((e,t)=>t.toString().padStart(2,"0")));function o(e){return"number"==typeof e&&(e=new Date(e)),`${r[e.getUTCDay()]}, ${i[e.getUTCDate()]} ${n[e.getUTCMonth()]} ${e.getUTCFullYear()} ${i[e.getUTCHours()]}:${i[e.getUTCMinutes()]}:${i[e.getUTCSeconds()]} GMT`}e.exports={isCTLExcludingHtab:function(e){for(let t=0;t<e.length;++t){const A=e.charCodeAt(t);if(A>=0&&A<=8||A>=10&&A<=31||127===A)return!0}return!1},validateCookieName:t,validateCookiePath:s,validateCookieValue:A,toIMFDate:o,stringify:function(e){if(0===e.name.length)return null;t(e.name),A(e.value);const r=[`${e.name}=${e.value}`];e.name.startsWith("__Secure-")&&(e.secure=!0),e.name.startsWith("__Host-")&&(e.secure=!0,e.domain=null,e.path="/"),e.secure&&r.push("Secure"),e.httpOnly&&r.push("HttpOnly"),"number"==typeof e.maxAge&&(!function(e){if(e<0)throw new Error("Invalid cookie max-age")}(e.maxAge),r.push(`Max-Age=${e.maxAge}`)),e.domain&&(!function(e){if(e.startsWith("-")||e.endsWith(".")||e.endsWith("-"))throw new Error("Invalid cookie domain")}(e.domain),r.push(`Domain=${e.domain}`)),e.path&&(s(e.path),r.push(`Path=${e.path}`)),e.expires&&"Invalid Date"!==e.expires.toString()&&r.push(`Expires=${o(e.expires)}`),e.sameSite&&r.push(`SameSite=${e.sameSite}`);for(const t of e.unparsed){if(!t.includes("="))throw new Error("Invalid unparsed");const[e,...A]=t.split("=");r.push(`${e.trim()}=${A.join("=")}`)}return r.join("; ")}}},8813:(e,t,A)=>{"use strict";const{Transform:s}=A(7075),{isASCIINumber:r,isValidLastEventId:n}=A(4689),i=[239,187,191];e.exports={EventSourceStream:class extends s{state;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,t,A){if(0!==e.length){if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:return this.buffer[0]===i[0]||(this.checkBOM=!1),void A();case 2:if(this.buffer[0]===i[0]&&this.buffer[1]===i[1])return void A();this.checkBOM=!1;break;case 3:if(this.buffer[0]===i[0]&&this.buffer[1]===i[1]&&this.buffer[2]===i[2])return this.buffer=Buffer.alloc(0),this.checkBOM=!1,void A();this.checkBOM=!1;break;default:this.buffer[0]===i[0]&&this.buffer[1]===i[1]&&this.buffer[2]===i[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1}for(;this.pos<this.buffer.length;)if(this.eventEndCheck){if(this.crlfCheck){if(10===this.buffer[this.pos]){this.buffer=this.buffer.subarray(this.pos+1),this.pos=0,this.crlfCheck=!1;continue}this.crlfCheck=!1}if(10===this.buffer[this.pos]||13===this.buffer[this.pos]){13===this.buffer[this.pos]&&(this.crlfCheck=!0),this.buffer=this.buffer.subarray(this.pos+1),this.pos=0,(void 0!==this.event.data||this.event.event||void 0!==this.event.id||this.event.retry)&&this.processEvent(this.event),this.clearEvent();continue}this.eventEndCheck=!1}else 10!==this.buffer[this.pos]&&13!==this.buffer[this.pos]?this.pos++:(13===this.buffer[this.pos]&&(this.crlfCheck=!0),this.parseLine(this.buffer.subarray(0,this.pos),this.event),this.buffer=this.buffer.subarray(this.pos+1),this.pos=0,this.eventEndCheck=!0);A()}else A()}parseLine(e,t){if(0===e.length)return;const A=e.indexOf(58);if(0===A)return;let s="",i="";if(-1!==A){s=e.subarray(0,A).toString("utf8");let t=A+1;32===e[t]&&++t,i=e.subarray(t).toString("utf8")}else s=e.toString("utf8"),i="";switch(s){case"data":void 0===t[s]?t[s]=i:t[s]+=`\n${i}`;break;case"retry":r(i)&&(t[s]=i);break;case"id":n(i)&&(t[s]=i);break;case"event":i.length>0&&(t[s]=i)}}processEvent(e){e.retry&&r(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),void 0!==e.id&&n(e.id)&&(this.state.lastEventId=e.id),void 0!==e.data&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}}}},7928:(e,t,A)=>{"use strict";const{pipeline:s}=A(7075),{fetching:r}=A(7388),{makeRequest:n}=A(4609),{webidl:i}=A(6097),{EventSourceStream:o}=A(8813),{parseMIMEType:a}=A(9934),{createFastMessageEvent:c}=A(878),{isNetworkError:l}=A(4821),{kEnumerableProperty:h}=A(2858),{environmentSettingsObject:g}=A(6686);let d=!1;class u extends EventTarget{#Ge={open:null,error:null,message:null};#Oe;#Je=!1;#We=0;#_e=null;#$=null;#qe;#le;constructor(e,t={}){super(),i.util.markAsUncloneable(this);const A="EventSource constructor";i.argumentLengthCheck(arguments,1,A),d||(d=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=i.converters.USVString(e),t=i.converters.EventSourceInitDict(t,A,"eventSourceInitDict"),this.#qe=t.node.dispatcher||t.dispatcher,this.#le={lastEventId:"",reconnectionTime:t.node.reconnectionTime};const s=g;let r;try{r=new URL(e,s.settingsObject.baseUrl),this.#le.origin=r.origin}catch(e){throw new DOMException(e,"SyntaxError")}this.#Oe=r.href;let o="anonymous";!0===t.withCredentials&&(o="use-credentials",this.#Je=!0);const a={redirect:"follow",keepalive:!0,mode:"cors",credentials:"anonymous"===o?"same-origin":"omit",referrer:"no-referrer"};a.client=g.settingsObject,a.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],a.cache="no-store",a.initiator="other",a.urlList=[new URL(this.#Oe)],this.#_e=n(a),this.#$e()}get readyState(){return this.#We}get url(){return this.#Oe}get withCredentials(){return this.#Je}#$e(){if(2===this.#We)return;this.#We=0;const e={request:this.#_e,dispatcher:this.#qe};e.processResponseEndOfBody=e=>{if(!l(e))return this.#Xe()},e.processResponse=e=>{if(l(e))return e.aborted?(this.close(),void this.dispatchEvent(new Event("error"))):void this.#Xe();const t=e.headersList.get("content-type",!0),A=null!==t?a(t):"failure",r="failure"!==A&&"text/event-stream"===A.essence;if(200!==e.status||!1===r)return this.close(),void this.dispatchEvent(new Event("error"));this.#We=1,this.dispatchEvent(new Event("open")),this.#le.origin=e.urlList[e.urlList.length-1].origin;const n=new o({eventSourceSettings:this.#le,push:e=>{this.dispatchEvent(c(e.type,e.options))}});s(e.body.stream,n,(e=>{!1===e?.aborted&&(this.close(),this.dispatchEvent(new Event("error")))}))},this.#$=r(e)}#Xe(){2!==this.#We&&(this.#We=0,this.dispatchEvent(new Event("error")),setTimeout((()=>{0===this.#We&&(this.#le.lastEventId.length&&this.#_e.headersList.set("last-event-id",this.#le.lastEventId,!0),this.#$e())}),this.#le.reconnectionTime)?.unref())}close(){i.brandCheck(this,u),2!==this.#We&&(this.#We=2,this.#$.abort(),this.#_e=null)}get onopen(){return this.#Ge.open}set onopen(e){this.#Ge.open&&this.removeEventListener("open",this.#Ge.open);const t=i.converters.EventHandlerNonNull(e);null!==t?(this.addEventListener("open",t),this.#Ge.open=e):this.#Ge.open=null}get onmessage(){return this.#Ge.message}set onmessage(e){this.#Ge.message&&this.removeEventListener("message",this.#Ge.message);const t=i.converters.EventHandlerNonNull(e);null!==t?(this.addEventListener("message",t),this.#Ge.message=e):this.#Ge.message=null}get onerror(){return this.#Ge.error}set onerror(e){this.#Ge.error&&this.removeEventListener("error",this.#Ge.error);const t=i.converters.EventHandlerNonNull(e);null!==t?(this.addEventListener("error",t),this.#Ge.error=e):this.#Ge.error=null}}const E={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:0,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:1,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:2,writable:!1}};Object.defineProperties(u,E),Object.defineProperties(u.prototype,E),Object.defineProperties(u.prototype,{close:h,onerror:h,onmessage:h,onopen:h,readyState:h,url:h,withCredentials:h}),i.converters.EventSourceInitDict=i.dictionaryConverter([{key:"withCredentials",converter:i.converters.boolean,defaultValue:()=>!1},{key:"dispatcher",converter:i.converters.any},{key:"node",converter:i.dictionaryConverter([{key:"reconnectionTime",converter:i.converters["unsigned long"],defaultValue:()=>3e3},{key:"dispatcher",converter:i.converters.any}]),defaultValue:()=>({})}]),e.exports={EventSource:u,defaultReconnectionTime:3e3}},4689:e=>{"use strict";e.exports={isValidLastEventId:function(e){return-1===e.indexOf("\0")},isASCIINumber:function(e){if(0===e.length)return!1;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)<48||e.charCodeAt(t)>57)return!1;return!0}}},2530:(e,t,A)=>{"use strict";const s=A(2858),{ReadableStreamFrom:r,readableStreamClose:n,fullyReadBody:i,extractMimeType:o,utf8DecodeBytes:a}=A(6686),{FormData:c,setFormDataState:l}=A(3944),{webidl:h}=A(6097),g=A(4589),{isErrored:d,isDisturbed:u}=A(7075),{isArrayBuffer:E}=A(3429),{serializeAMimeType:I}=A(9934),{multipartFormDataParser:Q}=A(4614),{createDeferredPromise:C}=A(9250);let B;try{const e=A(7598);B=t=>e.randomInt(0,t)}catch{B=e=>Math.floor(Math.random()*e)}const p=new TextEncoder;function f(){}const m=new FinalizationRegistry((e=>{const t=e.deref();!t||t.locked||u(t)||d(t)||t.cancel("Response object has been garbage collected").catch(f)}));function y(e,t=!1){let A=null;A=h.is.ReadableStream(e)?e:h.is.Blob(e)?e.stream():new ReadableStream({pull(e){const t="string"==typeof o?p.encode(o):o;t.byteLength&&e.enqueue(t),queueMicrotask((()=>n(e)))},start(){},type:"bytes"}),g(h.is.ReadableStream(A));let i=null,o=null,a=null,c=null;if("string"==typeof e)o=e,c="text/plain;charset=UTF-8";else if(h.is.URLSearchParams(e))o=e.toString(),c="application/x-www-form-urlencoded;charset=UTF-8";else if(h.is.BufferSource(e))o=E(e)?new Uint8Array(e.slice()):new Uint8Array(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));else if(h.is.FormData(e)){const t=`----formdata-undici-0${`${B(1e11)}`.padStart(11,"0")}`,A=`--${t}\r\nContent-Disposition: form-data`,s=e=>e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),r=e=>e.replace(/\r?\n|\r/g,"\r\n"),n=[],l=new Uint8Array([13,10]);a=0;let h=!1;for(const[t,i]of e)if("string"==typeof i){const e=p.encode(A+`; name="${s(r(t))}"`+`\r\n\r\n${r(i)}\r\n`);n.push(e),a+=e.byteLength}else{const e=p.encode(`${A}; name="${s(r(t))}"`+(i.name?`; filename="${s(i.name)}"`:"")+"\r\n"+`Content-Type: ${i.type||"application/octet-stream"}\r\n\r\n`);n.push(e,i,l),"number"==typeof i.size?a+=e.byteLength+i.size+l.byteLength:h=!0}const g=p.encode(`--${t}--\r\n`);n.push(g),a+=g.byteLength,h&&(a=null),o=e,i=async function*(){for(const e of n)e.stream?yield*e.stream():yield e},c=`multipart/form-data; boundary=${t}`}else if(h.is.Blob(e))o=e,a=e.size,e.type&&(c=e.type);else if("function"==typeof e[Symbol.asyncIterator]){if(t)throw new TypeError("keepalive");if(s.isDisturbed(e)||e.locked)throw new TypeError("Response body object should not be disturbed or locked");A=h.is.ReadableStream(e)?e:r(e)}if(("string"==typeof o||s.isBuffer(o))&&(a=Buffer.byteLength(o)),null!=i){let t;A=new ReadableStream({async start(){t=i(e)[Symbol.asyncIterator]()},async pull(e){const{value:s,done:r}=await t.next();if(r)queueMicrotask((()=>{e.close(),e.byobRequest?.respond(0)}));else if(!d(A)){const t=new Uint8Array(s);t.byteLength&&e.enqueue(t)}return e.desiredSize>0},async cancel(e){await t.return()},type:"bytes"})}return[{stream:A,source:o,length:a},c]}function S(e,t,A,s){try{h.brandCheck(e,A)}catch(e){return Promise.reject(e)}const r=s(e);if(w(r))return Promise.reject(new TypeError("Body is unusable: Body has already been read"));if(r.aborted)return Promise.reject(new DOMException("The operation was aborted.","AbortError"));const n=C(),o=n.reject,a=e=>{try{n.resolve(t(e))}catch(e){o(e)}};return null==r.body?(a(Buffer.allocUnsafe(0)),n.promise):(i(r.body,a,o),n.promise)}function w(e){const t=e.body;return null!=t&&(t.stream.locked||s.isDisturbed(t.stream))}function D(e){return JSON.parse(a(e))}function b(e){const t=e.headersList,A=o(t);return"failure"===A?null:A}e.exports={extractBody:y,safelyExtractBody:function(e,t=!1){return h.is.ReadableStream(e)&&(g(!s.isDisturbed(e),"The body has already been consumed."),g(!e.locked,"The stream is locked.")),y(e,t)},cloneBody:function(e){const{0:t,1:A}=e.stream.tee();return e.stream=t,{stream:A,length:e.length,source:e.source}},mixinBody:function(e,t){Object.assign(e.prototype,function(e,t){return{blob(){return S(this,(e=>{let A=b(t(this));return null===A?A="":A&&(A=I(A)),new Blob([e],{type:A})}),e,t)},arrayBuffer(){return S(this,(e=>new Uint8Array(e).buffer),e,t)},text(){return S(this,a,e,t)},json(){return S(this,D,e,t)},formData(){return S(this,(e=>{const A=b(t(this));if(null!==A)switch(A.essence){case"multipart/form-data":{const t=Q(e,A),s=new c;return l(s,t),s}case"application/x-www-form-urlencoded":{const t=new URLSearchParams(e.toString()),A=new c;for(const[e,s]of t)A.append(e,s);return A}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')}),e,t)},bytes(){return S(this,(e=>new Uint8Array(e)),e,t)}}}(e,t))},streamRegistry:m,bodyUnusable:w}},9441:e=>{"use strict";const t=["GET","HEAD","POST"],A=new Set(t),s=[301,302,303,307,308],r=new Set(s),n=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"],i=new Set(n),o=["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],a=["",...o],c=new Set(o),l=["GET","HEAD","OPTIONS","TRACE"],h=new Set(l),g=["CONNECT","TRACE","TRACK"],d=new Set(g),u=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],E=new Set(u);e.exports={subresource:u,forbiddenMethods:g,requestBodyHeader:["content-encoding","content-language","content-location","content-type","content-length"],referrerPolicy:a,requestRedirect:["follow","manual","error"],requestMode:["navigate","same-origin","no-cors","cors"],requestCredentials:["omit","same-origin","include"],requestCache:["default","no-store","reload","no-cache","force-cache","only-if-cached"],redirectStatus:s,corsSafeListedMethods:t,nullBodyStatus:[101,204,205,304],safeMethods:l,badPorts:n,requestDuplex:["half"],subresourceSet:E,badPortsSet:i,redirectStatusSet:r,corsSafeListedMethodsSet:A,safeMethodsSet:h,forbiddenMethodsSet:d,referrerPolicyTokens:c}},9934:(e,t,A)=>{"use strict";const s=A(4589),r=new TextEncoder,n=/^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/,i=/[\u000A\u000D\u0009\u0020]/,o=/[\u0009\u000A\u000C\u000D\u0020]/g,a=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function c(e,t=!1){if(!t)return e.href;const A=e.href,s=e.hash.length,r=0===s?A:A.substring(0,A.length-s);return!s&&A.endsWith("#")?r.slice(0,-1):r}function l(e,t,A){let s="";for(;A.position<t.length&&e(t[A.position]);)s+=t[A.position],A.position++;return s}function h(e,t,A){const s=t.indexOf(e,A.position),r=A.position;return-1===s?(A.position=t.length,t.slice(r)):(A.position=s,t.slice(r,A.position))}function g(e){return function(e){const t=e.length,A=new Uint8Array(t);let s=0;for(let r=0;r<t;++r){const t=e[r];37!==t?A[s++]=t:37!==t||d(e[r+1])&&d(e[r+2])?(A[s++]=u(e[r+1])<<4|u(e[r+2]),r+=2):A[s++]=37}return t===s?A:A.subarray(0,s)}(r.encode(e))}function d(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function u(e){return e>=48&&e<=57?e-48:(223&e)-55}function E(e){const t={position:0},A=h("/",e=C(e,!0,!0),t);if(0===A.length||!n.test(A))return"failure";if(t.position>=e.length)return"failure";t.position++;let s=h(";",e,t);if(s=C(s,!1,!0),0===s.length||!n.test(s))return"failure";const r=A.toLowerCase(),o=s.toLowerCase(),c={type:r,subtype:o,parameters:new Map,essence:`${r}/${o}`};for(;t.position<e.length;){t.position++,l((e=>i.test(e)),e,t);let A=l((e=>";"!==e&&"="!==e),e,t);if(A=A.toLowerCase(),t.position<e.length){if(";"===e[t.position])continue;t.position++}if(t.position>=e.length)break;let s=null;if('"'===e[t.position])s=I(e,t,!0),h(";",e,t);else if(s=h(";",e,t),s=C(s,!1,!0),0===s.length)continue;0===A.length||!n.test(A)||0!==s.length&&!a.test(s)||c.parameters.has(A)||c.parameters.set(A,s)}return c}function I(e,t,A=!1){const r=t.position;let n="";for(s('"'===e[t.position]),t.position++;n+=l((e=>'"'!==e&&"\\"!==e),e,t),!(t.position>=e.length);){const A=e[t.position];if(t.position++,"\\"!==A){s('"'===A);break}if(t.position>=e.length){n+="\\";break}n+=e[t.position],t.position++}return A?n:e.slice(r,t.position)}function Q(e){return 13===e||10===e||9===e||32===e}function C(e,t=!0,A=!0){return p(e,t,A,Q)}function B(e){return 13===e||10===e||9===e||12===e||32===e}function p(e,t,A,s){let r=0,n=e.length-1;if(t)for(;r<e.length&&s(e.charCodeAt(r));)r++;if(A)for(;n>0&&s(e.charCodeAt(n));)n--;return 0===r&&n===e.length-1?e:e.slice(r,n+1)}function f(e){const t=e.length;if(65535>t)return String.fromCharCode.apply(null,e);let A="",s=0,r=65535;for(;s<t;)s+r>t&&(r=t-s),A+=String.fromCharCode.apply(null,e.subarray(s,s+=r));return A}e.exports={dataURLProcessor:function(e){s("data:"===e.protocol);let t=c(e,!0);t=t.slice(5);const A={position:0};let r=h(",",t,A);const n=r.length;if(r=function(e,t=!0,A=!0){return p(e,t,A,B)}(r,!0,!0),A.position>=t.length)return"failure";A.position++;let i=g(t.slice(n+1));if(/;(\u0020){0,}base64$/i.test(r)){if(i=function(e){let t=(e=e.replace(o,"")).length;t%4==0&&61===e.charCodeAt(t-1)&&(--t,61===e.charCodeAt(t-1)&&--t);if(t%4==1)return"failure";if(/[^+/0-9A-Za-z]/.test(e.length===t?e:e.substring(0,t)))return"failure";const A=Buffer.from(e,"base64");return new Uint8Array(A.buffer,A.byteOffset,A.byteLength)}(f(i)),"failure"===i)return"failure";r=r.slice(0,-6),r=r.replace(/(\u0020)+$/,""),r=r.slice(0,-1)}r.startsWith(";")&&(r="text/plain"+r);let a=E(r);return"failure"===a&&(a=E("text/plain;charset=US-ASCII")),{mimeType:a,body:i}},URLSerializer:c,collectASequenceOfCodePoints:l,collectASequenceOfCodePointsFast:h,stringPercentDecode:g,parseMIMEType:E,collectAnHTTPQuotedString:I,serializeAMimeType:function(e){s("failure"!==e);const{parameters:t,essence:A}=e;let r=A;for(let[e,A]of t.entries())r+=";",r+=e,r+="=",n.test(A)||(A=A.replace(/(\\|")/g,"\\$1"),A='"'+A,A+='"'),r+=A;return r},removeChars:p,removeHTTPWhitespace:C,minimizeSupportedMimeType:function(e){switch(e.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return e.subtype.endsWith("+json")?"application/json":e.subtype.endsWith("+xml")?"application/xml":""},HTTP_TOKEN_CODEPOINTS:n,isomorphicDecode:f}},4614:(e,t,A)=>{"use strict";const{bufferToLowerCasedHeaderName:s}=A(2858),{utf8DecodeBytes:r}=A(6686),{HTTP_TOKEN_CODEPOINTS:n,isomorphicDecode:i}=A(9934),{makeEntry:o}=A(3944),{webidl:a}=A(6097),c=A(4589),l=Buffer.from('form-data; name="'),h=Buffer.from("filename"),g=Buffer.from("--"),d=Buffer.from("--\r\n");function u(e){for(let t=0;t<e.length;++t)if(-128&e.charCodeAt(t))return!1;return!0}function E(e,t){let A=null,r=null,o=null,a=null;for(;;){if(13===e[t.position]&&10===e[t.position+1]){if(null===A)throw p("header name is null");return{name:A,filename:r,contentType:o,encoding:a}}let c=Q((e=>10!==e&&13!==e&&58!==e),e,t);if(c=C(c,!0,!0,(e=>9===e||32===e)),!n.test(c.toString()))throw p("header name does not match the field-name token production");if(58!==e[t.position])throw p("expected :");switch(t.position++,Q((e=>32===e||9===e),e,t),s(c)){case"content-disposition":if(A=r=null,!B(e,l,t))throw p('expected form-data; name=" for content-disposition header');if(t.position+=17,A=I(e,t),59===e[t.position]&&32===e[t.position+1]){const A={position:t.position+2};if(B(e,h,A))if(42===e[A.position+8]){A.position+=10,Q((e=>32===e||9===e),e,A);const s=Q((e=>32!==e&&13!==e&&10!==e),e,A);if(117!==s[0]&&85!==s[0]||116!==s[1]&&84!==s[1]||102!==s[2]&&70!==s[2]||45!==s[3]||56!==s[4])throw p("unknown encoding, expected utf-8''");r=decodeURIComponent((new TextDecoder).decode(s.subarray(7))),t.position=A.position}else t.position+=11,Q((e=>32===e||9===e),e,t),t.position++,r=I(e,t)}break;case"content-type":{let A=Q((e=>10!==e&&13!==e),e,t);A=C(A,!1,!0,(e=>9===e||32===e)),o=i(A);break}case"content-transfer-encoding":{let A=Q((e=>10!==e&&13!==e),e,t);A=C(A,!1,!0,(e=>9===e||32===e)),a=i(A);break}default:Q((e=>10!==e&&13!==e),e,t)}if(13!==e[t.position]&&10!==e[t.position+1])throw p("expected CRLF");t.position+=2}}function I(e,t){c(34===e[t.position-1]);let A=Q((e=>10!==e&&13!==e&&34!==e),e,t);if(34!==e[t.position])throw p('expected "');return t.position++,A=(new TextDecoder).decode(A).replace(/%0A/gi,"\n").replace(/%0D/gi,"\r").replace(/%22/g,'"'),A}function Q(e,t,A){let s=A.position;for(;s<t.length&&e(t[s]);)++s;return t.subarray(A.position,A.position=s)}function C(e,t,A,s){let r=0,n=e.length-1;if(t)for(;r<e.length&&s(e[r]);)r++;if(A)for(;n>0&&s(e[n]);)n--;return 0===r&&n===e.length-1?e:e.subarray(r,n+1)}function B(e,t,A){if(e.length<t.length)return!1;for(let s=0;s<t.length;s++)if(t[s]!==e[A.position+s])return!1;return!0}function p(e){return new TypeError("Failed to parse body as FormData.",{cause:new TypeError(e)})}e.exports={multipartFormDataParser:function(e,t){c("failure"!==t&&"multipart/form-data"===t.essence);const A=t.parameters.get("boundary");if(void 0===A)throw p("missing boundary in content-type header");const s=Buffer.from(`--${A}`,"utf8"),n=[],i={position:0};for(;13===e[i.position]&&10===e[i.position+1];)i.position+=2;let l=e.length;for(;10===e[l-1]&&13===e[l-2];)l-=2;for(l!==e.length&&(e=e.subarray(0,l));;){if(!e.subarray(i.position,i.position+s.length).equals(s))throw p("expected a value starting with -- and the boundary");if(i.position+=s.length,i.position===e.length-2&&B(e,g,i)||i.position===e.length-4&&B(e,d,i))return n;if(13!==e[i.position]||10!==e[i.position+1])throw p("expected CRLF");i.position+=2;const t=E(e,i);let A,l,{name:h,filename:I,contentType:Q,encoding:C}=t;i.position+=2;{const t=e.indexOf(s.subarray(2),i.position);if(-1===t)throw p("expected boundary after body");A=e.subarray(i.position,t-4),i.position+=A.length,"base64"===C&&(A=Buffer.from(A.toString(),"base64"))}if(13!==e[i.position]||10!==e[i.position+1])throw p("expected CRLF");i.position+=2,null!==I?(Q??="text/plain",u(Q)||(Q=""),l=new File([A],I,{type:Q})):l=r(Buffer.from(A)),c(a.is.USVString(h)),c("string"==typeof l&&a.is.USVString(l)||a.is.File(l)),n.push(o(h,l,I))}},validateBoundary:function(e){const t=e.length;if(t<27||t>70)return!1;for(let A=0;A<t;++A){const t=e.charCodeAt(A);if(!(t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||39===t||45===t||95===t))return!1}return!0}}},3944:(e,t,A)=>{"use strict";const{iteratorMixin:s}=A(6686),{kEnumerableProperty:r}=A(2858),{webidl:n}=A(6097),i=A(7975);class o{#le=[];constructor(e=void 0){if(n.util.markAsUncloneable(this),void 0!==e)throw n.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(e,t,A=void 0){n.brandCheck(this,o);const s="FormData.append";n.argumentLengthCheck(arguments,2,s),e=n.converters.USVString(e),3===arguments.length||n.is.Blob(t)?(t=n.converters.Blob(t,s,"value"),void 0!==A&&(A=n.converters.USVString(A))):t=n.converters.USVString(t);const r=l(e,t,A);this.#le.push(r)}delete(e){n.brandCheck(this,o);n.argumentLengthCheck(arguments,1,"FormData.delete"),e=n.converters.USVString(e),this.#le=this.#le.filter((t=>t.name!==e))}get(e){n.brandCheck(this,o);n.argumentLengthCheck(arguments,1,"FormData.get"),e=n.converters.USVString(e);const t=this.#le.findIndex((t=>t.name===e));return-1===t?null:this.#le[t].value}getAll(e){n.brandCheck(this,o);return n.argumentLengthCheck(arguments,1,"FormData.getAll"),e=n.converters.USVString(e),this.#le.filter((t=>t.name===e)).map((e=>e.value))}has(e){n.brandCheck(this,o);return n.argumentLengthCheck(arguments,1,"FormData.has"),e=n.converters.USVString(e),-1!==this.#le.findIndex((t=>t.name===e))}set(e,t,A=void 0){n.brandCheck(this,o);const s="FormData.set";n.argumentLengthCheck(arguments,2,s),e=n.converters.USVString(e),3===arguments.length||n.is.Blob(t)?(t=n.converters.Blob(t,s,"value"),void 0!==A&&(A=n.converters.USVString(A))):t=n.converters.USVString(t);const r=l(e,t,A),i=this.#le.findIndex((t=>t.name===e));-1!==i?this.#le=[...this.#le.slice(0,i),r,...this.#le.slice(i+1).filter((t=>t.name!==e))]:this.#le.push(r)}[i.inspect.custom](e,t){const A=this.#le.reduce(((e,t)=>(e[t.name]?Array.isArray(e[t.name])?e[t.name].push(t.value):e[t.name]=[e[t.name],t.value]:e[t.name]=t.value,e)),{__proto__:null});t.depth??=e,t.colors??=!0;const s=i.formatWithOptions(t,A);return`FormData ${s.slice(s.indexOf("]")+2)}`}static getFormDataState(e){return e.#le}static setFormDataState(e,t){e.#le=t}}const{getFormDataState:a,setFormDataState:c}=o;function l(e,t,A){if("string"==typeof t);else if(n.is.File(t)||(t=new File([t],"blob",{type:t.type})),void 0!==A){const e={type:t.type,lastModified:t.lastModified};t=new File([t],A,e)}return{name:e,value:t}}Reflect.deleteProperty(o,"getFormDataState"),Reflect.deleteProperty(o,"setFormDataState"),s("FormData",o,a,"name","value"),Object.defineProperties(o.prototype,{append:r,delete:r,get:r,getAll:r,has:r,set:r,[Symbol.toStringTag]:{value:"FormData",configurable:!0}}),n.is.FormData=n.util.MakeTypeAssertion(o),e.exports={FormData:o,makeEntry:l,setFormDataState:c}},2837:e=>{"use strict";const t=Symbol.for("undici.globalOrigin.1");e.exports={getGlobalOrigin:function(){return globalThis[t]},setGlobalOrigin:function(e){if(void 0===e)return void Object.defineProperty(globalThis,t,{value:void 0,writable:!0,enumerable:!1,configurable:!1});const A=new URL(e);if("http:"!==A.protocol&&"https:"!==A.protocol)throw new TypeError(`Only http & https urls are allowed, received ${A.protocol}`);Object.defineProperty(globalThis,t,{value:A,writable:!0,enumerable:!1,configurable:!1})}}},6558:(e,t,A)=>{"use strict";const{kConstruct:s}=A(257),{kEnumerableProperty:r}=A(2858),{iteratorMixin:n,isValidHeaderName:i,isValidHeaderValue:o}=A(6686),{webidl:a}=A(6097),c=A(4589),l=A(7975);function h(e){return 10===e||13===e||9===e||32===e}function g(e){let t=0,A=e.length;for(;A>t&&h(e.charCodeAt(A-1));)--A;for(;A>t&&h(e.charCodeAt(t));)++t;return 0===t&&A===e.length?e:e.substring(t,A)}function d(e,t){if(Array.isArray(t))for(let A=0;A<t.length;++A){const s=t[A];if(2!==s.length)throw a.errors.exception({header:"Headers constructor",message:`expected name/value pair to be length 2, found ${s.length}.`});u(e,s[0],s[1])}else{if("object"!=typeof t||null===t)throw a.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]});{const A=Object.keys(t);for(let s=0;s<A.length;++s)u(e,A[s],t[A[s]])}}}function u(e,t,A){if(A=g(A),!i(t))throw a.errors.invalidArgument({prefix:"Headers.append",value:t,type:"header name"});if(!o(A))throw a.errors.invalidArgument({prefix:"Headers.append",value:A,type:"header value"});if("immutable"===C(e))throw new TypeError("immutable");return p(e).append(t,A,!1)}function E(e,t){return e[0]<t[0]?-1:1}class I{cookies=null;sortedMap;headersMap;constructor(e){e instanceof I?(this.headersMap=new Map(e.headersMap),this.sortedMap=e.sortedMap,this.cookies=null===e.cookies?null:[...e.cookies]):(this.headersMap=new Map(e),this.sortedMap=null)}contains(e,t){return this.headersMap.has(t?e:e.toLowerCase())}clear(){this.headersMap.clear(),this.sortedMap=null,this.cookies=null}append(e,t,A){this.sortedMap=null;const s=A?e:e.toLowerCase(),r=this.headersMap.get(s);if(r){const e="cookie"===s?"; ":", ";this.headersMap.set(s,{name:r.name,value:`${r.value}${e}${t}`})}else this.headersMap.set(s,{name:e,value:t});"set-cookie"===s&&(this.cookies??=[]).push(t)}set(e,t,A){this.sortedMap=null;const s=A?e:e.toLowerCase();"set-cookie"===s&&(this.cookies=[t]),this.headersMap.set(s,{name:e,value:t})}delete(e,t){this.sortedMap=null,t||(e=e.toLowerCase()),"set-cookie"===e&&(this.cookies=null),this.headersMap.delete(e)}get(e,t){return this.headersMap.get(t?e:e.toLowerCase())?.value??null}*[Symbol.iterator](){for(const{0:e,1:{value:t}}of this.headersMap)yield[e,t]}get entries(){const e={};if(0!==this.headersMap.size)for(const{name:t,value:A}of this.headersMap.values())e[t]=A;return e}rawValues(){return this.headersMap.values()}get entriesList(){const e=[];if(0!==this.headersMap.size)for(const{0:t,1:{name:A,value:s}}of this.headersMap)if("set-cookie"===t)for(const t of this.cookies)e.push([A,t]);else e.push([A,s]);return e}toSortedArray(){const e=this.headersMap.size,t=new Array(e);if(e<=32){if(0===e)return t;const A=this.headersMap[Symbol.iterator](),s=A.next().value;t[0]=[s[0],s[1].value],c(null!==s[1].value);for(let s,r,n=1,i=0,o=0,a=0,l=0;n<e;++n){for(r=A.next().value,s=t[n]=[r[0],r[1].value],c(null!==s[1]),a=0,o=n;a<o;)l=a+(o-a>>1),t[l][0]<=s[0]?a=l+1:o=l;if(n!==l){for(i=n;i>a;)t[i]=t[--i];t[a]=s}}if(!A.next().done)throw new TypeError("Unreachable");return t}{let e=0;for(const{0:A,1:{value:s}}of this.headersMap)t[e++]=[A,s],c(null!==s);return t.sort(E)}}}class Q{#ze;#Ze;constructor(e=void 0){a.util.markAsUncloneable(this),e!==s&&(this.#Ze=new I,this.#ze="none",void 0!==e&&d(this,e=a.converters.HeadersInit(e,"Headers constructor","init")))}append(e,t){a.brandCheck(this,Q),a.argumentLengthCheck(arguments,2,"Headers.append");const A="Headers.append";return u(this,e=a.converters.ByteString(e,A,"name"),t=a.converters.ByteString(t,A,"value"))}delete(e){a.brandCheck(this,Q),a.argumentLengthCheck(arguments,1,"Headers.delete");if(e=a.converters.ByteString(e,"Headers.delete","name"),!i(e))throw a.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if("immutable"===this.#ze)throw new TypeError("immutable");this.#Ze.contains(e,!1)&&this.#Ze.delete(e,!1)}get(e){a.brandCheck(this,Q),a.argumentLengthCheck(arguments,1,"Headers.get");const t="Headers.get";if(e=a.converters.ByteString(e,t,"name"),!i(e))throw a.errors.invalidArgument({prefix:t,value:e,type:"header name"});return this.#Ze.get(e,!1)}has(e){a.brandCheck(this,Q),a.argumentLengthCheck(arguments,1,"Headers.has");const t="Headers.has";if(e=a.converters.ByteString(e,t,"name"),!i(e))throw a.errors.invalidArgument({prefix:t,value:e,type:"header name"});return this.#Ze.contains(e,!1)}set(e,t){a.brandCheck(this,Q),a.argumentLengthCheck(arguments,2,"Headers.set");const A="Headers.set";if(e=a.converters.ByteString(e,A,"name"),t=g(t=a.converters.ByteString(t,A,"value")),!i(e))throw a.errors.invalidArgument({prefix:A,value:e,type:"header name"});if(!o(t))throw a.errors.invalidArgument({prefix:A,value:t,type:"header value"});if("immutable"===this.#ze)throw new TypeError("immutable");this.#Ze.set(e,t,!1)}getSetCookie(){a.brandCheck(this,Q);const e=this.#Ze.cookies;return e?[...e]:[]}[l.inspect.custom](e,t){return t.depth??=e,`Headers ${l.formatWithOptions(t,this.#Ze.entries)}`}static getHeadersGuard(e){return e.#ze}static setHeadersGuard(e,t){e.#ze=t}static getHeadersList(e){return e.#Ze}static setHeadersList(e,t){e.#Ze=t}}const{getHeadersGuard:C,setHeadersGuard:B,getHeadersList:p,setHeadersList:f}=Q;Reflect.deleteProperty(Q,"getHeadersGuard"),Reflect.deleteProperty(Q,"setHeadersGuard"),Reflect.deleteProperty(Q,"getHeadersList"),Reflect.deleteProperty(Q,"setHeadersList"),n("Headers",Q,(function(e){const t=p(e);if(!t)return[];if(t.sortedMap)return t.sortedMap;const A=[],s=t.toSortedArray(),r=t.cookies;if(null===r||1===r.length)return t.sortedMap=s;for(let e=0;e<s.length;++e){const{0:t,1:n}=s[e];if("set-cookie"===t)for(let e=0;e<r.length;++e)A.push([t,r[e]]);else A.push([t,n])}return t.sortedMap=A}),0,1),Object.defineProperties(Q.prototype,{append:r,delete:r,get:r,has:r,set:r,getSetCookie:r,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[l.inspect.custom]:{enumerable:!1}}),a.converters.HeadersInit=function(e,t,A){if(a.util.Type(e)===a.util.Types.OBJECT){const s=Reflect.get(e,Symbol.iterator);if(!l.types.isProxy(e)&&s===Q.prototype.entries)try{return p(e).entriesList}catch{}return"function"==typeof s?a.converters["sequence<sequence<ByteString>>"](e,t,A,s.bind(e)):a.converters["record<ByteString, ByteString>"](e,t,A)}throw a.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})},e.exports={fill:d,compareHeaderName:E,Headers:Q,HeadersList:I,getHeadersGuard:C,setHeadersGuard:B,setHeadersList:f,getHeadersList:p}},7388:(e,t,A)=>{"use strict";const{makeNetworkError:s,makeAppropriateNetworkError:r,filterResponse:n,makeResponse:i,fromInnerResponse:o,getResponseState:a}=A(4821),{HeadersList:c}=A(6558),{Request:l,cloneRequest:h,getRequestDispatcher:g,getRequestState:d}=A(4609),u=A(8522),{makePolicyContainer:E,clonePolicyContainer:I,requestBadPort:Q,TAOCheck:C,appendRequestOriginHeader:B,responseLocationURL:p,requestCurrentURL:f,setRequestReferrerPolicyOnRedirect:m,tryUpgradeRequestToAPotentiallyTrustworthyURL:y,createOpaqueTimingInfo:S,appendFetchMetadata:w,corsCheck:D,crossOriginResourcePolicyCheck:b,determineRequestsReferrer:N,coarsenedSharedCurrentTime:R,sameOrigin:v,isCancelled:k,isAborted:T,isErrorLike:F,fullyReadBody:M,readableStreamClose:U,isomorphicEncode:L,urlIsLocal:H,urlIsHttpHttpsScheme:P,urlHasHttpsScheme:x,clampAndCoarsenConnectionTimingInfo:Y,simpleRangeHeaderValue:V,buildContentRange:G,createInflate:O,extractMimeType:J}=A(6686),W=A(4589),{safelyExtractBody:_,extractBody:q}=A(2530),{redirectStatusSet:$,nullBodyStatus:X,safeMethodsSet:z,requestBodyHeader:Z,subresourceSet:j}=A(9441),K=A(8474),{Readable:ee,pipeline:te,finished:Ae,isErrored:se,isReadable:re}=A(7075),{addAbortListener:ne,bufferToLowerCasedHeaderName:ie}=A(2858),{dataURLProcessor:oe,serializeAMimeType:ae,minimizeSupportedMimeType:ce}=A(9934),{getGlobalDispatcher:le}=A(9879),{webidl:he}=A(6097),{STATUS_CODES:ge}=A(7067),{bytesMatch:de}=A(7420),{createDeferredPromise:ue}=A(9250),Ee="function"==typeof u.createZstdDecompress,Ie=["GET","HEAD"],Qe="undefined"!=typeof __UNDICI_IS_NODE__||"undefined"!=typeof esbuildDetection?"node":"undici";let Ce;class Be extends K{constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){"ongoing"===this.state&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){"ongoing"===this.state&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}}function pe(e){fe(e,"fetch")}function fe(e,t="other"){if("error"===e.type&&e.aborted)return;if(!e.urlList?.length)return;const A=e.urlList[0];let s=e.timingInfo,r=e.cacheState;P(A)&&null!==s&&(e.timingAllowPassed||(s=S({startTime:s.startTime}),r=""),s.endTime=R(),e.timingInfo=s,me(s,A.href,t,globalThis,r,"",e.status))}const me=performance.markResourceTiming;function ye(e,t,A,s){if(e&&e.reject(s),null!=t.body?.stream&&re(t.body.stream)&&t.body.stream.cancel(s).catch((e=>{if("ERR_INVALID_STATE"!==e.code)throw e})),null==A)return;const r=a(A);null!=r.body?.stream&&re(r.body.stream)&&r.body.stream.cancel(s).catch((e=>{if("ERR_INVALID_STATE"!==e.code)throw e}))}function Se({request:e,processRequestBodyChunkLength:t,processRequestEndOfBody:A,processResponse:s,processResponseEndOfBody:r,processResponseConsumeBody:n,useParallelQueue:i=!1,dispatcher:o=le()}){W(o);let a=null,c=!1;null!=e.client&&(a=e.client.globalObject,c=e.client.crossOriginIsolatedCapability);const l=R(c),h=S({startTime:l}),g={controller:new Be(o),request:e,timingInfo:h,processRequestBodyChunkLength:t,processRequestEndOfBody:A,processResponse:s,processResponseConsumeBody:n,processResponseEndOfBody:r,taskDestination:a,crossOriginIsolatedCapability:c};if(W(!e.body||e.body.stream),"client"===e.window&&(e.window="Window"===e.client?.globalObject?.constructor?.name?e.client:"no-window"),"client"===e.origin&&(e.origin=e.client.origin),"client"===e.policyContainer&&(null!=e.client?e.policyContainer=I(e.client.policyContainer):e.policyContainer=E()),!e.headersList.contains("accept",!0)){const t="*/*";e.headersList.append("accept",t,!0)}return e.headersList.contains("accept-language",!0)||e.headersList.append("accept-language","*",!0),e.priority,j.has(e.destination),we(g,!1),g.controller}async function we(e,t){try{const A=e.request;let r=null;if(A.localURLsOnly&&!H(f(A))&&(r=s("local URLs only")),y(A),"blocked"===Q(A)&&(r=s("bad port")),""===A.referrerPolicy&&(A.referrerPolicy=A.policyContainer.referrerPolicy),"no-referrer"!==A.referrer&&(A.referrer=N(A)),null===r){const t=f(A);v(t,A.url)&&"basic"===A.responseTainting||"data:"===t.protocol||"navigate"===A.mode||"websocket"===A.mode?(A.responseTainting="basic",r=await De(e)):"same-origin"===A.mode?r=s('request mode cannot be "same-origin"'):"no-cors"===A.mode?"follow"!==A.redirect?r=s('redirect mode cannot be "follow" for "no-cors" request'):(A.responseTainting="opaque",r=await De(e)):P(f(A))?(A.responseTainting="cors",r=await Re(e)):r=s("URL scheme must be a HTTP(S) scheme")}if(t)return r;0===r.status||r.internalResponse||(A.responseTainting,"basic"===A.responseTainting?r=n(r,"basic"):"cors"===A.responseTainting?r=n(r,"cors"):"opaque"===A.responseTainting?r=n(r,"opaque"):W(!1));let i=0===r.status?r:r.internalResponse;if(0===i.urlList.length&&i.urlList.push(...A.urlList),A.timingAllowFailed||(r.timingAllowPassed=!0),"opaque"===r.type&&206===i.status&&i.rangeRequested&&!A.headers.contains("range",!0)&&(r=i=s()),0===r.status||"HEAD"!==A.method&&"CONNECT"!==A.method&&!X.includes(i.status)||(i.body=null,e.controller.dump=!0),A.integrity){const t=t=>Ne(e,s(t));if("opaque"===A.responseTainting||null==r.body)return void t(r.error);const n=s=>{de(s,A.integrity)?(r.body=_(s)[0],Ne(e,r)):t("integrity mismatch")};M(r.body,n,t)}else Ne(e,r)}catch(t){e.controller.terminate(t)}}function De(e){if(k(e)&&0===e.request.redirectCount)return Promise.resolve(r(e));const{request:t}=e,{protocol:n}=f(t);switch(n){case"about:":return Promise.resolve(s("about scheme is not supported"));case"blob:":{Ce||(Ce=A(4573).resolveObjectURL);const e=f(t);if(0!==e.search.length)return Promise.resolve(s("NetworkError when attempting to fetch resource."));const r=Ce(e.toString());if("GET"!==t.method||!he.is.Blob(r))return Promise.resolve(s("invalid method"));const n=i(),o=r.size,a=L(`${o}`),c=r.type;if(t.headersList.contains("range",!0)){n.rangeRequested=!0;const e=t.headersList.get("range",!0),A=V(e,!0);if("failure"===A)return Promise.resolve(s("failed to fetch the data URL"));let{rangeStartValue:i,rangeEndValue:a}=A;if(null===i)i=o-a,a=i+a-1;else{if(i>=o)return Promise.resolve(s("Range start is greater than the blob's size."));(null===a||a>=o)&&(a=o-1)}const l=r.slice(i,a,c),h=q(l);n.body=h[0];const g=L(`${l.size}`),d=G(i,a,o);n.status=206,n.statusText="Partial Content",n.headersList.set("content-length",g,!0),n.headersList.set("content-type",c,!0),n.headersList.set("content-range",d,!0)}else{const e=q(r);n.statusText="OK",n.body=e[0],n.headersList.set("content-length",a,!0),n.headersList.set("content-type",c,!0)}return Promise.resolve(n)}case"data:":{const e=f(t),A=oe(e);if("failure"===A)return Promise.resolve(s("failed to fetch the data URL"));const r=ae(A.mimeType);return Promise.resolve(i({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:r}]],body:_(A.body)[0]}))}case"file:":return Promise.resolve(s("not implemented... yet..."));case"http:":case"https:":return Re(e).catch((e=>s(e)));default:return Promise.resolve(s("unknown scheme"))}}function be(e,t){e.request.done=!0,null!=e.processResponseDone&&queueMicrotask((()=>e.processResponseDone(t)))}function Ne(e,t){let A=e.timingInfo;const s=()=>{const s=Date.now();"document"===e.request.destination&&(e.controller.fullTimingInfo=A),e.controller.reportTimingSteps=()=>{if(!P(e.request.url))return;A.endTime=s;let r=t.cacheState;const n=t.bodyInfo;t.timingAllowPassed||(A=S(A),r="");let i=0;if("navigator"!==e.request.mode||!t.hasCrossOriginRedirects){i=t.status;const e=J(t.headersList);"failure"!==e&&(n.contentType=ce(e))}null!=e.request.initiatorType&&me(A,e.request.url.href,e.request.initiatorType,globalThis,r,n,i)};queueMicrotask((()=>(e.request.done=!0,null!=e.processResponseEndOfBody&&queueMicrotask((()=>e.processResponseEndOfBody(t))),void(null!=e.request.initiatorType&&e.controller.reportTimingSteps()))))};null!=e.processResponse&&queueMicrotask((()=>{e.processResponse(t),e.processResponse=null}));const r="error"===t.type?t:t.internalResponse??t;null==r.body?s():Ae(r.body.stream,(()=>{s()}))}async function Re(e){const t=e.request;let A=null,r=null;const n=e.timingInfo;if(t.serviceWorkers,null===A){if("follow"===t.redirect&&(t.serviceWorkers="none"),r=A=await ve(e),"cors"===t.responseTainting&&"failure"===D(t,A))return s("cors failure");"failure"===C(t,A)&&(t.timingAllowFailed=!0)}return"opaque"!==t.responseTainting&&"opaque"!==A.type||"blocked"!==b(t.origin,t.client,t.destination,r)?($.has(r.status)&&("manual"!==t.redirect&&e.controller.connection.destroy(void 0,!1),"error"===t.redirect?A=s("unexpected redirect"):"manual"===t.redirect?A=r:"follow"===t.redirect?A=await function(e,t){const A=e.request,r=t.internalResponse?t.internalResponse:t;let n;try{if(n=p(r,f(A).hash),null==n)return t}catch(e){return Promise.resolve(s(e))}if(!P(n))return Promise.resolve(s("URL scheme must be a HTTP(S) scheme"));if(20===A.redirectCount)return Promise.resolve(s("redirect count exceeded"));if(A.redirectCount+=1,"cors"===A.mode&&(n.username||n.password)&&!v(A,n))return Promise.resolve(s('cross origin not allowed for request mode "cors"'));if("cors"===A.responseTainting&&(n.username||n.password))return Promise.resolve(s('URL cannot contain credentials for request mode "cors"'));if(303!==r.status&&null!=A.body&&null==A.body.source)return Promise.resolve(s());if([301,302].includes(r.status)&&"POST"===A.method||303===r.status&&!Ie.includes(A.method)){A.method="GET",A.body=null;for(const e of Z)A.headersList.delete(e)}v(f(A),n)||(A.headersList.delete("authorization",!0),A.headersList.delete("proxy-authorization",!0),A.headersList.delete("cookie",!0),A.headersList.delete("host",!0));null!=A.body&&(W(null!=A.body.source),A.body=_(A.body.source)[0]);const i=e.timingInfo;i.redirectEndTime=i.postRedirectStartTime=R(e.crossOriginIsolatedCapability),0===i.redirectStartTime&&(i.redirectStartTime=i.startTime);return A.urlList.push(n),m(A,r),we(e,!0)}(e,A):W(!1)),A.timingInfo=n,A):s("blocked")}async function ve(e,t=!1,A=!1){const n=e.request;let o=null,a=null,l=null;"no-window"===n.window&&"error"===n.redirect?(o=e,a=n):(a=h(n),o={...e},o.request=a);const g="include"===n.credentials||"same-origin"===n.credentials&&"basic"===n.responseTainting,d=a.body?a.body.length:null;let E=null;if(null==a.body&&["POST","PUT"].includes(a.method)&&(E="0"),null!=d&&(E=L(`${d}`)),null!=E&&a.headersList.append("content-length",E,!0),null!=d&&a.keepalive,he.is.URL(a.referrer)&&a.headersList.append("referer",L(a.referrer.href),!0),B(a),w(a),a.headersList.contains("user-agent",!0)||a.headersList.append("user-agent",Qe,!0),"default"===a.cache&&(a.headersList.contains("if-modified-since",!0)||a.headersList.contains("if-none-match",!0)||a.headersList.contains("if-unmodified-since",!0)||a.headersList.contains("if-match",!0)||a.headersList.contains("if-range",!0))&&(a.cache="no-store"),"no-cache"!==a.cache||a.preventNoCacheCacheControlHeaderModification||a.headersList.contains("cache-control",!0)||a.headersList.append("cache-control","max-age=0",!0),"no-store"!==a.cache&&"reload"!==a.cache||(a.headersList.contains("pragma",!0)||a.headersList.append("pragma","no-cache",!0),a.headersList.contains("cache-control",!0)||a.headersList.append("cache-control","no-cache",!0)),a.headersList.contains("range",!0)&&a.headersList.append("accept-encoding","identity",!0),a.headersList.contains("accept-encoding",!0)||(x(f(a))?a.headersList.append("accept-encoding","br, gzip, deflate",!0):a.headersList.append("accept-encoding","gzip, deflate",!0)),a.headersList.delete("host",!0),a.cache="no-store","no-store"!==a.cache&&a.cache,null==l){if("only-if-cached"===a.cache)return s("only if cached");const e=await async function(e){W(!e.controller.connection||e.controller.connection.destroyed),e.controller.connection={abort:null,destroyed:!1,destroy(e,t=!0){this.destroyed||(this.destroyed=!0,t&&this.abort?.(e??new DOMException("The operation was aborted.","AbortError")))}};const t=e.request;let A=null;const n=e.timingInfo,o=null;null==o&&(t.cache="no-store");t.mode;let a=null;if(null==t.body&&e.processRequestEndOfBody)queueMicrotask((()=>e.processRequestEndOfBody()));else if(null!=t.body){const A=async function*(t){k(e)||(yield t,e.processRequestBodyChunkLength?.(t.byteLength))},s=()=>{k(e)||e.processRequestEndOfBody&&e.processRequestEndOfBody()},r=t=>{k(e)||("AbortError"===t.name?e.controller.abort():e.controller.terminate(t))};a=async function*(){try{for await(const e of t.body.stream)yield*A(e);s()}catch(e){r(e)}}()}try{const{body:t,status:s,statusText:r,headersList:n,socket:o}=await E({body:a});if(o)A=i({status:s,statusText:r,headersList:n,socket:o});else{const o=t[Symbol.asyncIterator]();e.controller.next=()=>o.next(),A=i({status:s,statusText:r,headersList:n})}}catch(t){return"AbortError"===t.name?(e.controller.connection.destroy(),r(e,t)):s(t)}const l=()=>e.controller.resume(),h=t=>{k(e)||e.controller.abort(t)},g=new ReadableStream({start(t){e.controller.controller=t},pull:l,cancel:h,type:"bytes"});A.body={stream:g,source:null,length:null},e.controller.resume||e.controller.on("terminated",d);function d(t){T(e)?(A.aborted=!0,re(g)&&e.controller.controller.error(e.controller.serializedAbortReason)):re(g)&&e.controller.controller.error(new TypeError("terminated",{cause:F(t)?t:void 0})),e.controller.connection.destroy()}return e.controller.resume=async()=>{for(;;){let t,s;try{const{done:A,value:s}=await e.controller.next();if(T(e))break;t=A?void 0:s}catch(A){e.controller.ended&&!n.encodedBodySize?t=void 0:(t=A,s=!0)}if(void 0===t)return U(e.controller.controller),void be(e,A);if(n.decodedBodySize+=t?.byteLength??0,s)return void e.controller.terminate(t);const r=new Uint8Array(t);if(r.byteLength&&e.controller.controller.enqueue(r),se(g))return void e.controller.terminate();if(e.controller.controller.desiredSize<=0)return}},A;function E({body:A}){const s=f(t),r=e.controller.dispatcher;return new Promise(((i,o)=>r.dispatch({path:s.pathname+s.search,origin:s.origin,method:t.method,body:r.isMockActive?t.body&&(t.body.source||t.body.stream):A,headers:t.headersList.entries,maxRedirections:0,upgrade:"websocket"===t.mode?"websocket":void 0},{body:null,abort:null,onConnect(t){const{connection:A}=e.controller;n.finalConnectionTimingInfo=Y(void 0,n.postRedirectStartTime,e.crossOriginIsolatedCapability),A.destroyed?t(new DOMException("The operation was aborted.","AbortError")):(e.controller.on("terminated",t),this.abort=A.abort=t),n.finalNetworkRequestStartTime=R(e.crossOriginIsolatedCapability)},onResponseStarted(){n.finalNetworkResponseStartTime=R(e.crossOriginIsolatedCapability)},onHeaders(e,A,s,r){if(e<200)return!1;const n=new c;for(let e=0;e<A.length;e+=2)n.append(ie(A[e]),A[e+1].toString("latin1"),!0);const o=n.get("location",!0);this.body=new ee({read:s});const a=o&&"follow"===t.redirect&&$.has(e),l=[];if("HEAD"!==t.method&&"CONNECT"!==t.method&&!X.includes(e)&&!a){const e=n.get("content-encoding",!0),t=e?e.toLowerCase().split(","):[];for(let e=t.length-1;e>=0;--e){const A=t[e].trim();if("x-gzip"===A||"gzip"===A)l.push(u.createGunzip({flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH}));else if("deflate"===A)l.push(O({flush:u.constants.Z_SYNC_FLUSH,finishFlush:u.constants.Z_SYNC_FLUSH}));else if("br"===A)l.push(u.createBrotliDecompress({flush:u.constants.BROTLI_OPERATION_FLUSH,finishFlush:u.constants.BROTLI_OPERATION_FLUSH}));else{if("zstd"!==A||!Ee){l.length=0;break}l.push(u.createZstdDecompress({flush:u.constants.ZSTD_e_continue,finishFlush:u.constants.ZSTD_e_end}))}}}const h=this.onError.bind(this);return i({status:e,statusText:r,headersList:n,body:l.length?te(this.body,...l,(e=>{e&&this.onError(e)})).on("error",h):this.body.on("error",h)}),!0},onData(t){if(e.controller.dump)return;const A=t;return n.encodedBodySize+=A.byteLength,this.body.push(A)},onComplete(){this.abort&&e.controller.off("terminated",this.abort),e.controller.ended=!0,this.body.push(null)},onError(t){this.abort&&e.controller.off("terminated",this.abort),this.body?.destroy(t),e.controller.terminate(t),o(t)},onUpgrade(e,t,A){if(101!==e)return;const s=new c;for(let e=0;e<t.length;e+=2)s.append(ie(t[e]),t[e+1].toString("latin1"),!0);return i({status:e,statusText:ge[e],headersList:s,socket:A}),!0}})))}}(o,g,A);!z.has(a.method)&&e.status>=200&&e.status,null==l&&(l=e)}if(l.urlList=[...a.urlList],a.headersList.contains("range",!0)&&(l.rangeRequested=!0),l.requestIncludesCredentials=g,407===l.status)return"no-window"===n.window?s():k(e)?r(e):s("proxy authentication required");if(421===l.status&&!A&&(null==n.body||null!=n.body.source)){if(k(e))return r(e);e.controller.connection.destroy(),l=await ve(e,t,!0)}return l}e.exports={fetch:function(e,t=void 0){he.argumentLengthCheck(arguments,1,"globalThis.fetch");let A,s=ue();try{A=new l(e,t)}catch(e){return s.reject(e),s.promise}const r=d(A);if(A.signal.aborted)return ye(s,r,null,A.signal.reason),s.promise;const n=r.client.globalObject;"ServiceWorkerGlobalScope"===n?.constructor?.name&&(r.serviceWorkers="none");let i=null,a=!1,c=null;return ne(A.signal,(()=>{a=!0,W(null!=c),c.abort(A.signal.reason);const e=i?.deref();ye(s,r,e,A.signal.reason)})),c=Se({request:r,processResponseEndOfBody:pe,processResponse:e=>{a||(e.aborted?ye(s,r,i,c.serializedAbortReason):"error"!==e.type?(i=new WeakRef(o(e,"immutable")),s.resolve(i.deref()),s=null):s.reject(new TypeError("fetch failed",{cause:e.error})))},dispatcher:g(A)}),s.promise},Fetch:Be,fetching:Se,finalizeAndReportTiming:fe}},4609:(e,t,A)=>{"use strict";const{extractBody:s,mixinBody:r,cloneBody:n,bodyUnusable:i}=A(2530),{Headers:o,fill:a,HeadersList:c,setHeadersGuard:l,getHeadersGuard:h,setHeadersList:g,getHeadersList:d}=A(6558),u=A(2858),E=A(7975),{isValidHTTPToken:I,sameOrigin:Q,environmentSettingsObject:C}=A(6686),{forbiddenMethodsSet:B,corsSafeListedMethodsSet:p,referrerPolicy:f,requestRedirect:m,requestMode:y,requestCredentials:S,requestCache:w,requestDuplex:D}=A(9441),{kEnumerableProperty:b,normalizedMethodRecordsBase:N,normalizedMethodRecords:R}=u,{webidl:v}=A(6097),{URLSerializer:k}=A(9934),{kConstruct:T}=A(257),F=A(4589),{getMaxListeners:M,setMaxListeners:U,defaultMaxListeners:L}=A(8474),H=Symbol("abortController"),P=new FinalizationRegistry((({signal:e,abort:t})=>{e.removeEventListener("abort",t)})),x=new WeakMap;let Y;try{Y=M((new AbortController).signal)>0}catch{Y=!1}function V(e){return function t(){const A=e.deref();if(void 0!==A){P.unregister(t),this.removeEventListener("abort",t),A.abort(this.reason);const e=x.get(A.signal);if(void 0!==e){if(0!==e.size){for(const t of e){const e=t.deref();void 0!==e&&e.abort(this.reason)}e.clear()}x.delete(A.signal)}}}}let G=!1;class O{#je;#qe;#Be;#le;constructor(e,t=void 0){if(v.util.markAsUncloneable(this),e===T)return;v.argumentLengthCheck(arguments,1,"Request constructor"),e=v.converters.RequestInfo(e),t=v.converters.RequestInit(t);let A=null,r=null;const n=C.settingsObject.baseUrl;let h=null;if("string"==typeof e){let s;this.#qe=t.dispatcher;try{s=new URL(e,n)}catch(t){throw new TypeError("Failed to parse URL from "+e,{cause:t})}if(s.username||s.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);A=z({urlList:[s]}),r="cors"}else F(v.is.Request(e)),A=e.#le,h=e.#je,this.#qe=t.dispatcher||e.#qe;const E=C.settingsObject.origin;let f="client";if("EnvironmentSettingsObject"===A.window?.constructor?.name&&Q(A.window,E)&&(f=A.window),null!=t.window)throw new TypeError(`'window' option '${f}' must be null`);"window"in t&&(f="no-window"),A=z({method:A.method,headersList:A.headersList,unsafeRequest:A.unsafeRequest,client:C.settingsObject,window:f,priority:A.priority,origin:A.origin,referrer:A.referrer,referrerPolicy:A.referrerPolicy,mode:A.mode,credentials:A.credentials,cache:A.cache,redirect:A.redirect,integrity:A.integrity,keepalive:A.keepalive,reloadNavigation:A.reloadNavigation,historyNavigation:A.historyNavigation,urlList:[...A.urlList]});const m=0!==Object.keys(t).length;if(m&&("navigate"===A.mode&&(A.mode="same-origin"),A.reloadNavigation=!1,A.historyNavigation=!1,A.origin="client",A.referrer="client",A.referrerPolicy="",A.url=A.urlList[A.urlList.length-1],A.urlList=[A.url]),void 0!==t.referrer){const e=t.referrer;if(""===e)A.referrer="no-referrer";else{let t;try{t=new URL(e,n)}catch(t){throw new TypeError(`Referrer "${e}" is not a valid URL.`,{cause:t})}"about:"===t.protocol&&"client"===t.hostname||E&&!Q(t,C.settingsObject.baseUrl)?A.referrer="client":A.referrer=t}}let y;if(void 0!==t.referrerPolicy&&(A.referrerPolicy=t.referrerPolicy),y=void 0!==t.mode?t.mode:r,"navigate"===y)throw v.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(null!=y&&(A.mode=y),void 0!==t.credentials&&(A.credentials=t.credentials),void 0!==t.cache&&(A.cache=t.cache),"only-if-cached"===A.cache&&"same-origin"!==A.mode)throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(void 0!==t.redirect&&(A.redirect=t.redirect),null!=t.integrity&&(A.integrity=String(t.integrity)),void 0!==t.keepalive&&(A.keepalive=Boolean(t.keepalive)),void 0!==t.method){let e=t.method;const s=R[e];if(void 0!==s)A.method=s;else{if(!I(e))throw new TypeError(`'${e}' is not a valid HTTP method.`);const t=e.toUpperCase();if(B.has(t))throw new TypeError(`'${e}' HTTP method is unsupported.`);e=N[t]??e,A.method=e}G||"patch"!==A.method||(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),G=!0)}void 0!==t.signal&&(h=t.signal),this.#le=A;const S=new AbortController;if(this.#je=S.signal,null!=h)if(h.aborted)S.abort(h.reason);else{this[H]=S;const e=V(new WeakRef(S));Y&&M(h)===L&&U(1500,h),u.addAbortListener(h,e),P.register(S,{signal:h,abort:e},e)}if(this.#Be=new o(T),g(this.#Be,A.headersList),l(this.#Be,"request"),"no-cors"===y){if(!p.has(A.method))throw new TypeError(`'${A.method} is unsupported in no-cors mode.`);l(this.#Be,"request-no-cors")}if(m){const e=d(this.#Be),A=void 0!==t.headers?t.headers:new c(e);if(e.clear(),A instanceof c){for(const{name:t,value:s}of A.rawValues())e.append(t,s,!1);e.cookies=A.cookies}else a(this.#Be,A)}const w=v.is.Request(e)?e.#le.body:null;if(!(null==t.body&&null==w||"GET"!==A.method&&"HEAD"!==A.method))throw new TypeError("Request with GET/HEAD method cannot have body.");let D=null;if(null!=t.body){const[e,r]=s(t.body,A.keepalive);D=e,r&&!d(this.#Be).contains("content-type",!0)&&this.#Be.append("content-type",r,!0)}const b=D??w;if(null!=b&&null==b.source){if(null!=D&&null==t.duplex)throw new TypeError("RequestInit: duplex option is required when sending a body.");if("same-origin"!==A.mode&&"cors"!==A.mode)throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');A.useCORSPreflightFlag=!0}let k=b;if(null==D&&null!=w){if(i(e.#le))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");const t=new TransformStream;w.stream.pipeThrough(t),k={source:w.source,length:w.length,stream:t.readable}}this.#le.body=k}get method(){return v.brandCheck(this,O),this.#le.method}get url(){return v.brandCheck(this,O),k(this.#le.url)}get headers(){return v.brandCheck(this,O),this.#Be}get destination(){return v.brandCheck(this,O),this.#le.destination}get referrer(){return v.brandCheck(this,O),"no-referrer"===this.#le.referrer?"":"client"===this.#le.referrer?"about:client":this.#le.referrer.toString()}get referrerPolicy(){return v.brandCheck(this,O),this.#le.referrerPolicy}get mode(){return v.brandCheck(this,O),this.#le.mode}get credentials(){return v.brandCheck(this,O),this.#le.credentials}get cache(){return v.brandCheck(this,O),this.#le.cache}get redirect(){return v.brandCheck(this,O),this.#le.redirect}get integrity(){return v.brandCheck(this,O),this.#le.integrity}get keepalive(){return v.brandCheck(this,O),this.#le.keepalive}get isReloadNavigation(){return v.brandCheck(this,O),this.#le.reloadNavigation}get isHistoryNavigation(){return v.brandCheck(this,O),this.#le.historyNavigation}get signal(){return v.brandCheck(this,O),this.#je}get body(){return v.brandCheck(this,O),this.#le.body?this.#le.body.stream:null}get bodyUsed(){return v.brandCheck(this,O),!!this.#le.body&&u.isDisturbed(this.#le.body.stream)}get duplex(){return v.brandCheck(this,O),"half"}clone(){if(v.brandCheck(this,O),i(this.#le))throw new TypeError("unusable");const e=Z(this.#le),t=new AbortController;if(this.signal.aborted)t.abort(this.signal.reason);else{let e=x.get(this.signal);void 0===e&&(e=new Set,x.set(this.signal,e));const A=new WeakRef(t);e.add(A),u.addAbortListener(t.signal,V(A))}return j(e,this.#qe,t.signal,h(this.#Be))}[E.inspect.custom](e,t){null===t.depth&&(t.depth=2),t.colors??=!0;const A={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${E.formatWithOptions(t,A)}`}static setRequestSignal(e,t){return e.#je=t,e}static getRequestDispatcher(e){return e.#qe}static setRequestDispatcher(e,t){e.#qe=t}static setRequestHeaders(e,t){e.#Be=t}static getRequestState(e){return e.#le}static setRequestState(e,t){e.#le=t}}const{setRequestSignal:J,getRequestDispatcher:W,setRequestDispatcher:_,setRequestHeaders:q,getRequestState:$,setRequestState:X}=O;function z(e){return{method:e.method??"GET",localURLsOnly:e.localURLsOnly??!1,unsafeRequest:e.unsafeRequest??!1,body:e.body??null,client:e.client??null,reservedClient:e.reservedClient??null,replacesClientId:e.replacesClientId??"",window:e.window??"client",keepalive:e.keepalive??!1,serviceWorkers:e.serviceWorkers??"all",initiator:e.initiator??"",destination:e.destination??"",priority:e.priority??null,origin:e.origin??"client",policyContainer:e.policyContainer??"client",referrer:e.referrer??"client",referrerPolicy:e.referrerPolicy??"",mode:e.mode??"no-cors",useCORSPreflightFlag:e.useCORSPreflightFlag??!1,credentials:e.credentials??"same-origin",useCredentials:e.useCredentials??!1,cache:e.cache??"default",redirect:e.redirect??"follow",integrity:e.integrity??"",cryptoGraphicsNonceMetadata:e.cryptoGraphicsNonceMetadata??"",parserMetadata:e.parserMetadata??"",reloadNavigation:e.reloadNavigation??!1,historyNavigation:e.historyNavigation??!1,userActivation:e.userActivation??!1,taintedOrigin:e.taintedOrigin??!1,redirectCount:e.redirectCount??0,responseTainting:e.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:e.preventNoCacheCacheControlHeaderModification??!1,done:e.done??!1,timingAllowFailed:e.timingAllowFailed??!1,urlList:e.urlList,url:e.urlList[0],headersList:e.headersList?new c(e.headersList):new c}}function Z(e){const t=z({...e,body:null});return null!=e.body&&(t.body=n(e.body)),t}function j(e,t,A,s){const r=new O(T);X(r,e),_(r,t),J(r,A);const n=new o(T);return q(r,n),g(n,e.headersList),l(n,s),r}Reflect.deleteProperty(O,"setRequestSignal"),Reflect.deleteProperty(O,"getRequestDispatcher"),Reflect.deleteProperty(O,"setRequestDispatcher"),Reflect.deleteProperty(O,"setRequestHeaders"),Reflect.deleteProperty(O,"getRequestState"),Reflect.deleteProperty(O,"setRequestState"),r(O,$),Object.defineProperties(O.prototype,{method:b,url:b,headers:b,redirect:b,clone:b,signal:b,duplex:b,destination:b,body:b,bodyUsed:b,isHistoryNavigation:b,isReloadNavigation:b,keepalive:b,integrity:b,cache:b,credentials:b,attribute:b,referrerPolicy:b,referrer:b,mode:b,[Symbol.toStringTag]:{value:"Request",configurable:!0}}),v.is.Request=v.util.MakeTypeAssertion(O),v.converters.RequestInfo=function(e){return"string"==typeof e?v.converters.USVString(e):v.is.Request(e)?e:v.converters.USVString(e)},v.converters.RequestInit=v.dictionaryConverter([{key:"method",converter:v.converters.ByteString},{key:"headers",converter:v.converters.HeadersInit},{key:"body",converter:v.nullableConverter(v.converters.BodyInit)},{key:"referrer",converter:v.converters.USVString},{key:"referrerPolicy",converter:v.converters.DOMString,allowedValues:f},{key:"mode",converter:v.converters.DOMString,allowedValues:y},{key:"credentials",converter:v.converters.DOMString,allowedValues:S},{key:"cache",converter:v.converters.DOMString,allowedValues:w},{key:"redirect",converter:v.converters.DOMString,allowedValues:m},{key:"integrity",converter:v.converters.DOMString},{key:"keepalive",converter:v.converters.boolean},{key:"signal",converter:v.nullableConverter((e=>v.converters.AbortSignal(e,"RequestInit","signal")))},{key:"window",converter:v.converters.any},{key:"duplex",converter:v.converters.DOMString,allowedValues:D},{key:"dispatcher",converter:v.converters.any}]),e.exports={Request:O,makeRequest:z,fromInnerRequest:j,cloneRequest:Z,getRequestDispatcher:W,getRequestState:$}},4821:(e,t,A)=>{"use strict";const{Headers:s,HeadersList:r,fill:n,getHeadersGuard:i,setHeadersGuard:o,setHeadersList:a}=A(6558),{extractBody:c,cloneBody:l,mixinBody:h,streamRegistry:g,bodyUnusable:d}=A(2530),u=A(2858),E=A(7975),{kEnumerableProperty:I}=u,{isValidReasonPhrase:Q,isCancelled:C,isAborted:B,serializeJavascriptValueToJSONString:p,isErrorLike:f,isomorphicEncode:m,environmentSettingsObject:y}=A(6686),{redirectStatusSet:S,nullBodyStatus:w}=A(9441),{webidl:D}=A(6097),{URLSerializer:b}=A(9934),{kConstruct:N}=A(257),R=A(4589),v=new TextEncoder("utf-8");class k{#Be;#le;static error(){return G(P(),"immutable")}static json(e,t=void 0){D.argumentLengthCheck(arguments,1,"Response.json"),null!==t&&(t=D.converters.ResponseInit(t));const A=v.encode(p(e)),s=c(A),r=G(H({}),"response");return V(r,t,{body:s[0],type:"application/json"}),r}static redirect(e,t=302){let A;D.argumentLengthCheck(arguments,1,"Response.redirect"),e=D.converters.USVString(e),t=D.converters["unsigned short"](t);try{A=new URL(e,y.settingsObject.baseUrl)}catch(t){throw new TypeError(`Failed to parse URL from ${e}`,{cause:t})}if(!S.has(t))throw new RangeError(`Invalid status code ${t}`);const s=G(H({}),"immutable");s.#le.status=t;const r=m(b(A));return s.#le.headersList.append("location",r,!0),s}constructor(e=null,t=void 0){if(D.util.markAsUncloneable(this),e===N)return;null!==e&&(e=D.converters.BodyInit(e,"Response","body")),t=D.converters.ResponseInit(t),this.#le=H({}),this.#Be=new s(N),o(this.#Be,"response"),a(this.#Be,this.#le.headersList);let A=null;if(null!=e){const[t,s]=c(e);A={body:t,type:s}}V(this,t,A)}get type(){return D.brandCheck(this,k),this.#le.type}get url(){D.brandCheck(this,k);const e=this.#le.urlList,t=e[e.length-1]??null;return null===t?"":b(t,!0)}get redirected(){return D.brandCheck(this,k),this.#le.urlList.length>1}get status(){return D.brandCheck(this,k),this.#le.status}get ok(){return D.brandCheck(this,k),this.#le.status>=200&&this.#le.status<=299}get statusText(){return D.brandCheck(this,k),this.#le.statusText}get headers(){return D.brandCheck(this,k),this.#Be}get body(){return D.brandCheck(this,k),this.#le.body?this.#le.body.stream:null}get bodyUsed(){return D.brandCheck(this,k),!!this.#le.body&&u.isDisturbed(this.#le.body.stream)}clone(){if(D.brandCheck(this,k),d(this.#le))throw D.errors.exception({header:"Response.clone",message:"Body has already been consumed."});const e=L(this.#le);return this.#le.body?.stream&&g.register(this,new WeakRef(this.#le.body.stream)),G(e,i(this.#Be))}[E.inspect.custom](e,t){null===t.depth&&(t.depth=2),t.colors??=!0;const A={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${E.formatWithOptions(t,A)}`}static getResponseHeaders(e){return e.#Be}static setResponseHeaders(e,t){e.#Be=t}static getResponseState(e){return e.#le}static setResponseState(e,t){e.#le=t}}const{getResponseHeaders:T,setResponseHeaders:F,getResponseState:M,setResponseState:U}=k;function L(e){if(e.internalResponse)return Y(L(e.internalResponse),e.type);const t=H({...e,body:null});return null!=e.body&&(t.body=l(e.body)),t}function H(e){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...e,headersList:e?.headersList?new r(e?.headersList):new r,urlList:e?.urlList?[...e.urlList]:[]}}function P(e){return H({type:"error",status:0,error:f(e)?e:new Error(e?String(e):e),aborted:e&&"AbortError"===e.name})}function x(e,t){return t={internalResponse:e,...t},new Proxy(e,{get:(e,A)=>A in t?t[A]:e[A],set:(e,A,s)=>(R(!(A in t)),e[A]=s,!0)})}function Y(e,t){return"basic"===t?x(e,{type:"basic",headersList:e.headersList}):"cors"===t?x(e,{type:"cors",headersList:e.headersList}):"opaque"===t?x(e,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null}):"opaqueredirect"===t?x(e,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null}):void R(!1)}function V(e,t,A){if(null!==t.status&&(t.status<200||t.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in t&&null!=t.statusText&&!Q(String(t.statusText)))throw new TypeError("Invalid statusText");if("status"in t&&null!=t.status&&(M(e).status=t.status),"statusText"in t&&null!=t.statusText&&(M(e).statusText=t.statusText),"headers"in t&&null!=t.headers&&n(T(e),t.headers),A){if(w.includes(e.status))throw D.errors.exception({header:"Response constructor",message:`Invalid response status code ${e.status}`});M(e).body=A.body,null==A.type||M(e).headersList.contains("content-type",!0)||M(e).headersList.append("content-type",A.type,!0)}}function G(e,t){const A=new k(N);U(A,e);const r=new s(N);return F(A,r),a(r,e.headersList),o(r,t),e.body?.stream&&g.register(A,new WeakRef(e.body.stream)),A}Reflect.deleteProperty(k,"getResponseHeaders"),Reflect.deleteProperty(k,"setResponseHeaders"),Reflect.deleteProperty(k,"getResponseState"),Reflect.deleteProperty(k,"setResponseState"),h(k,M),Object.defineProperties(k.prototype,{type:I,url:I,status:I,ok:I,redirected:I,statusText:I,headers:I,clone:I,body:I,bodyUsed:I,[Symbol.toStringTag]:{value:"Response",configurable:!0}}),Object.defineProperties(k,{json:I,redirect:I,error:I}),D.converters.XMLHttpRequestBodyInit=function(e,t,A){return"string"==typeof e?D.converters.USVString(e,t,A):D.is.Blob(e)||D.is.BufferSource(e)||D.is.FormData(e)||D.is.URLSearchParams(e)?e:D.converters.DOMString(e,t,A)},D.converters.BodyInit=function(e,t,A){return D.is.ReadableStream(e)||e?.[Symbol.asyncIterator]?e:D.converters.XMLHttpRequestBodyInit(e,t,A)},D.converters.ResponseInit=D.dictionaryConverter([{key:"status",converter:D.converters["unsigned short"],defaultValue:()=>200},{key:"statusText",converter:D.converters.ByteString,defaultValue:()=>""},{key:"headers",converter:D.converters.HeadersInit}]),D.is.Response=D.util.MakeTypeAssertion(k),e.exports={isNetworkError:function(e){return"error"===e.type&&0===e.status},makeNetworkError:P,makeResponse:H,makeAppropriateNetworkError:function(e,t=null){return R(C(e)),B(e)?P(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:t})):P(Object.assign(new DOMException("Request was cancelled."),{cause:t}))},filterResponse:Y,Response:k,cloneResponse:L,fromInnerResponse:G,getResponseState:M}},6686:(e,t,A)=>{"use strict";const{Transform:s}=A(7075),r=A(8522),{redirectStatusSet:n,referrerPolicyTokens:i,badPortsSet:o}=A(9441),{getGlobalOrigin:a}=A(2837),{collectASequenceOfCodePoints:c,collectAnHTTPQuotedString:l,removeChars:h,parseMIMEType:g}=A(9934),{performance:d}=A(643),{ReadableStreamFrom:u,isValidHTTPToken:E,normalizedMethodRecordsBase:I}=A(2858),Q=A(4589),{isUint8Array:C}=A(3429),{webidl:B}=A(6097);function p(e){const t=e.urlList,A=t.length;return 0===A?null:t[A-1].toString()}function f(e){for(let t=0;t<e.length;++t){const A=e.charCodeAt(t);if(A>126||A<32)return!1}return!0}function m(e){return e.urlList[e.urlList.length-1]}const y=E;function S(e){return!1===("\t"===e[0]||" "===e[0]||"\t"===e[e.length-1]||" "===e[e.length-1]||e.includes("\n")||e.includes("\r")||e.includes("\0"))}function w(e,t){return e}function D(){return{referrerPolicy:"strict-origin-when-cross-origin"}}function b(e,t=!1){return Q(B.is.URL(e)),P(e=new URL(e))?"no-referrer":(e.username="",e.password="",e.hash="",!0===t&&(e.pathname="",e.search=""),e)}const N=RegExp.prototype.test.bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/),R=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function v(e){return e.includes(":")?("["===e[0]&&"]"===e[e.length-1]&&(e=e.slice(1,-1)),R(e)):N(e)}function k(e){return!!B.is.URL(e)&&("about:blank"===e.href||"about:srcdoc"===e.href||("data:"===e.protocol||("blob:"===e.protocol||!(null==(t=e.origin)||"null"===t||"https:"!==(t=new URL(t)).protocol&&"wss:"!==t.protocol&&!v(t.hostname)&&"localhost"!==t.hostname&&"localhost."!==t.hostname&&!t.hostname.endsWith(".localhost")&&!t.hostname.endsWith(".localhost.")&&"file:"!==t.protocol))));var t}function T(e,t){return e.origin===t.origin&&"null"===e.origin||e.protocol===t.protocol&&e.hostname===t.hostname&&e.port===t.port}const F=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function M(e,t,A=0,s=1){class r{#Ke;#et;#tt;constructor(e,t){this.#Ke=e,this.#et=t,this.#tt=0}next(){if("object"!=typeof this||null===this||!(#Ke in this))throw new TypeError(`'next' called on an object that does not implement interface ${e} Iterator.`);const r=this.#tt,n=t(this.#Ke);if(r>=n.length)return{value:void 0,done:!0};const{[A]:i,[s]:o}=n[r];let a;switch(this.#tt=r+1,this.#et){case"key":a=i;break;case"value":a=o;break;case"key+value":a=[i,o]}return{value:a,done:!1}}}return delete r.prototype.constructor,Object.setPrototypeOf(r.prototype,F),Object.defineProperties(r.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${e} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(e,t){return new r(e,t)}}const U=/[^\x00-\xFF]/;function L(e){return Q(!U.test(e)),e}async function H(e,t,A){try{const s=[];let r=0;for(;;){const{done:n,value:i}=await e.read();if(n)return void t(Buffer.concat(s,r));if(!C(i))return void A(new TypeError("Received non-Uint8Array chunk"));s.push(i),r+=i.length}}catch(e){A(e)}}function P(e){Q("protocol"in e);const t=e.protocol;return"about:"===t||"blob:"===t||"data:"===t}function x(e){return"string"==typeof e&&":"===e[5]&&"h"===e[0]&&"t"===e[1]&&"t"===e[2]&&"p"===e[3]&&"s"===e[4]||"https:"===e.protocol}function Y(e){Q("protocol"in e);const t=e.protocol;return"http:"===t||"https:"===t}class V extends s{#At;constructor(e){super(),this.#At=e}_transform(e,t,A){if(!this._inflateStream){if(0===e.length)return void A();this._inflateStream=8==(15&e[0])?r.createInflate(this.#At):r.createInflateRaw(this.#At),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",(()=>this.push(null))),this._inflateStream.on("error",(e=>this.destroy(e)))}this._inflateStream.write(e,t,A)}_final(e){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),e()}}function G(e,t){const A=t.get(e,!0);return null===A?null:function(e){const t=e,A={position:0},s=[];let r="";for(;A.position<t.length;){if(r+=c((e=>'"'!==e&&","!==e),t,A),A.position<t.length)if(34===t.charCodeAt(A.position)){if(r+=l(t,A),A.position<t.length)continue}else Q(44===t.charCodeAt(A.position)),A.position++;r=h(r,!0,!0,(e=>9===e||32===e)),s.push(r),r=""}return s}(A)}const O=new TextDecoder;class J{get baseUrl(){return a()}get origin(){return this.baseUrl?.origin}policyContainer={referrerPolicy:"strict-origin-when-cross-origin"}}const W=new class{settingsObject=new J};e.exports={isAborted:function(e){return"aborted"===e.controller.state},isCancelled:function(e){return"aborted"===e.controller.state||"terminated"===e.controller.state},isValidEncodedURL:f,ReadableStreamFrom:u,tryUpgradeRequestToAPotentiallyTrustworthyURL:function(e){},clampAndCoarsenConnectionTimingInfo:function(e,t,A){return!e?.startTime||e.startTime<t?{domainLookupStartTime:t,domainLookupEndTime:t,connectionStartTime:t,connectionEndTime:t,secureConnectionStartTime:t,ALPNNegotiatedProtocol:e?.ALPNNegotiatedProtocol}:{domainLookupStartTime:w(e.domainLookupStartTime),domainLookupEndTime:w(e.domainLookupEndTime),connectionStartTime:w(e.connectionStartTime),connectionEndTime:w(e.connectionEndTime),secureConnectionStartTime:w(e.secureConnectionStartTime),ALPNNegotiatedProtocol:e.ALPNNegotiatedProtocol}},coarsenedSharedCurrentTime:function(e){return w(d.now())},determineRequestsReferrer:function(e){const t=e.referrerPolicy;Q(t);let A=null;if("client"===e.referrer){const e=a();if(!e||"null"===e.origin)return"no-referrer";A=new URL(e)}else B.is.URL(e.referrer)&&(A=e.referrer);let s=b(A);const r=b(A,!0);switch(s.toString().length>4096&&(s=r),t){case"no-referrer":return"no-referrer";case"origin":return null!=r?r:b(A,!0);case"unsafe-url":return s;case"strict-origin":{const t=m(e);return k(s)&&!k(t)?"no-referrer":r}case"strict-origin-when-cross-origin":{const t=m(e);return T(s,t)?s:k(s)&&!k(t)?"no-referrer":r}case"same-origin":return T(e,s)?s:"no-referrer";case"origin-when-cross-origin":return T(e,s)?s:r;case"no-referrer-when-downgrade":{const t=m(e);return k(s)&&!k(t)?"no-referrer":s}}},makePolicyContainer:D,clonePolicyContainer:function(e){return{referrerPolicy:e.referrerPolicy}},appendFetchMetadata:function(e){let t=null;t=e.mode,e.headersList.set("sec-fetch-mode",t,!0)},appendRequestOriginHeader:function(e){let t=e.origin;if("client"!==t&&void 0!==t)if("cors"===e.responseTainting||"websocket"===e.mode)e.headersList.append("origin",t,!0);else if("GET"!==e.method&&"HEAD"!==e.method){switch(e.referrerPolicy){case"no-referrer":t=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":e.origin&&x(e.origin)&&!x(m(e))&&(t=null);break;case"same-origin":T(e,m(e))||(t=null)}e.headersList.append("origin",t,!0)}},TAOCheck:function(){return"success"},corsCheck:function(){return"success"},crossOriginResourcePolicyCheck:function(){return"allowed"},createOpaqueTimingInfo:function(e){return{startTime:e.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:e.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}},setRequestReferrerPolicyOnRedirect:function(e,t){const A=function(e){const t=(e.headersList.get("referrer-policy",!0)??"").split(",");let A="";if(t.length)for(let e=t.length;0!==e;e--){const s=t[e-1].trim();if(i.has(s)){A=s;break}}return A}(t);""!==A&&(e.referrerPolicy=A)},isValidHTTPToken:E,requestBadPort:function(e){const t=m(e);return Y(t)&&o.has(t.port)?"blocked":"allowed"},requestCurrentURL:m,responseURL:p,responseLocationURL:function(e,t){if(!n.has(e.status))return null;let A=e.headersList.get("location",!0);var s;return null!==A&&S(A)&&(f(A)||(s=A,A=Buffer.from(s,"binary").toString("utf8")),A=new URL(A,p(e))),A&&!A.hash&&(A.hash=t),A},isURLPotentiallyTrustworthy:k,isValidReasonPhrase:function(e){for(let t=0;t<e.length;++t){const A=e.charCodeAt(t);if(!(9===A||A>=32&&A<=126||A>=128&&A<=255))return!1}return!0},sameOrigin:T,normalizeMethod:function(e){return I[e.toLowerCase()]??e},serializeJavascriptValueToJSONString:function(e){const t=JSON.stringify(e);if(void 0===t)throw new TypeError("Value is not JSON serializable");return Q("string"==typeof t),t},iteratorMixin:function(e,t,A,s=0,r=1){const n=M(e,A,s,r),i={keys:{writable:!0,enumerable:!0,configurable:!0,value:function(){return B.brandCheck(this,t),n(this,"key")}},values:{writable:!0,enumerable:!0,configurable:!0,value:function(){return B.brandCheck(this,t),n(this,"value")}},entries:{writable:!0,enumerable:!0,configurable:!0,value:function(){return B.brandCheck(this,t),n(this,"key+value")}},forEach:{writable:!0,enumerable:!0,configurable:!0,value:function(A,s=globalThis){if(B.brandCheck(this,t),B.argumentLengthCheck(arguments,1,`${e}.forEach`),"function"!=typeof A)throw new TypeError(`Failed to execute 'forEach' on '${e}': parameter 1 is not of type 'Function'.`);for(const{0:e,1:t}of n(this,"key+value"))A.call(s,t,e,this)}}};return Object.defineProperties(t.prototype,{...i,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:i.entries.value}})},createIterator:M,isValidHeaderName:y,isValidHeaderValue:S,isErrorLike:function(e){return e instanceof Error||"Error"===e?.constructor?.name||"DOMException"===e?.constructor?.name},fullyReadBody:function(e,t,A){const s=t,r=A;try{H(e.stream.getReader(),s,r)}catch(e){r(e)}},readableStreamClose:function(e){try{e.close(),e.byobRequest?.respond(0)}catch(e){if(!e.message.includes("Controller is already closed")&&!e.message.includes("ReadableStream is already closed"))throw e}},isomorphicEncode:L,urlIsLocal:P,urlHasHttpsScheme:x,urlIsHttpHttpsScheme:Y,readAllBytes:H,simpleRangeHeaderValue:function(e,t){const A=e;if(!A.startsWith("bytes"))return"failure";const s={position:5};if(t&&c((e=>"\t"===e||" "===e),A,s),61!==A.charCodeAt(s.position))return"failure";s.position++,t&&c((e=>"\t"===e||" "===e),A,s);const r=c((e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}),A,s),n=r.length?Number(r):null;if(t&&c((e=>"\t"===e||" "===e),A,s),45!==A.charCodeAt(s.position))return"failure";s.position++,t&&c((e=>"\t"===e||" "===e),A,s);const i=c((e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}),A,s),o=i.length?Number(i):null;return s.position<A.length||null===o&&null===n||n>o?"failure":{rangeStartValue:n,rangeEndValue:o}},buildContentRange:function(e,t,A){let s="bytes ";return s+=L(`${e}`),s+="-",s+=L(`${t}`),s+="/",s+=L(`${A}`),s},createInflate:function(e){return new V(e)},extractMimeType:function(e){let t=null,A=null,s=null;const r=G("content-type",e);if(null===r)return"failure";for(const e of r){const r=g(e);"failure"!==r&&"*/*"!==r.essence&&(s=r,s.essence!==A?(t=null,s.parameters.has("charset")&&(t=s.parameters.get("charset")),A=s.essence):s.parameters.has("charset")||null===t||s.parameters.set("charset",t))}return null==s?"failure":s},getDecodeSplit:G,utf8DecodeBytes:function(e){return 0===e.length?"":(239===e[0]&&187===e[1]&&191===e[2]&&(e=e.subarray(3)),O.decode(e))},environmentSettingsObject:W,isOriginIPPotentiallyTrustworthy:v}},7420:(e,t,A)=>{"use strict";const s=A(4589),r=new Map([["sha256",0],["sha384",1],["sha512",2]]);let n;try{n=A(7598);const e=n.getHashes();0===e.length&&r.clear();for(const t of r.keys())!1===e.includes(t)&&r.delete(t)}catch{r.clear()}const i=Map.prototype.get.bind(r),o=Map.prototype.has.bind(r),a=void 0===n||0===r.size?()=>!0:(e,t)=>{const A=l(t);if(0===A.length)return!0;const s=c(A);for(const t of s){const A=t.alg,s=t.val;if(g(h(A,e),s))return!0}return!1};function c(e){const t=[];let A=null;for(const r of e){if(s(o(r.alg),"Invalid SRI hash algorithm token"),0===t.length){t.push(r),A=r;continue}const e=A.alg,n=i(e),a=r.alg,c=i(a);c<n||(c>n?(A=r,t[0]=r,t.length=1):t.push(r))}return t}function l(e){const t=[];for(const A of e.split(" ")){const e=A.split("?",1)[0];let s="";const r=[e.slice(0,6),e.slice(7)],n=r[0];if(!o(n))continue;r[1]&&(s=r[1]);const i={alg:n,val:s};t.push(i)}return t}const h=(e,t)=>n.hash(e,t,"base64");function g(e,t){let A=e.length;0!==A&&"="===e[A-1]&&(A-=1),0!==A&&"="===e[A-1]&&(A-=1);let s=t.length;if(0!==s&&"="===t[s-1]&&(s-=1),0!==s&&"="===t[s-1]&&(s-=1),A!==s)return!1;for(let s=0;s<A;++s)if(!(e[s]===t[s]||"+"===e[s]&&"-"===t[s]||"/"===e[s]&&"_"===t[s]))return!1;return!0}e.exports={applyAlgorithmToBytes:h,bytesMatch:a,caseSensitiveMatch:g,isValidSRIHashAlgorithm:o,getStrongestMetadata:c,parseMetadata:l}},6097:(e,t,A)=>{"use strict";const{types:s,inspect:r}=A(7975),{markAsUncloneable:n}=A(5919),i=Function.call.bind(Function.prototype[Symbol.hasInstance]),o={converters:{},util:{},errors:{},is:{}};o.errors.exception=function(e){return new TypeError(`${e.header}: ${e.message}`)},o.errors.conversionFailed=function(e){const t=1===e.types.length?"":" one of",A=`${e.argument} could not be converted to${t}: ${e.types.join(", ")}.`;return o.errors.exception({header:e.prefix,message:A})},o.errors.invalidArgument=function(e){return o.errors.exception({header:e.prefix,message:`"${e.value}" is an invalid ${e.type}.`})},o.brandCheck=function(e,t){if(!i(t,e)){const e=new TypeError("Illegal invocation");throw e.code="ERR_INVALID_THIS",e}},o.brandCheckMultiple=function(e){const t=e.map((e=>o.util.MakeTypeAssertion(e)));return e=>{if(t.every((t=>!t(e)))){const e=new TypeError("Illegal invocation");throw e.code="ERR_INVALID_THIS",e}}},o.argumentLengthCheck=function({length:e},t,A){if(e<t)throw o.errors.exception({message:`${t} argument${1!==t?"s":""} required, but${e?" only":""} ${e} found.`,header:A})},o.illegalConstructor=function(){throw o.errors.exception({header:"TypeError",message:"Illegal constructor"})},o.util.MakeTypeAssertion=function(e){return t=>i(e,t)},o.util.Type=function(e){switch(typeof e){case"undefined":return 1;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"bigint":return 6;case"function":case"object":return null===e?7:8}},o.util.Types={UNDEFINED:1,BOOLEAN:2,STRING:3,SYMBOL:4,NUMBER:5,BIGINT:6,NULL:7,OBJECT:8},o.util.TypeValueToString=function(e){switch(o.util.Type(e)){case 1:return"Undefined";case 2:return"Boolean";case 3:return"String";case 4:return"Symbol";case 5:return"Number";case 6:return"BigInt";case 7:return"Null";case 8:return"Object"}},o.util.markAsUncloneable=n||(()=>{}),o.util.ConvertToInt=function(e,t,A,s){let r,n;64===t?(r=Math.pow(2,53)-1,n="unsigned"===A?0:Math.pow(-2,53)+1):"unsigned"===A?(n=0,r=Math.pow(2,t)-1):(n=Math.pow(-2,t)-1,r=Math.pow(2,t-1)-1);let i=Number(e);if(0===i&&(i=0),o.util.HasFlag(s,o.attributes.EnforceRange)){if(Number.isNaN(i)||i===Number.POSITIVE_INFINITY||i===Number.NEGATIVE_INFINITY)throw o.errors.exception({header:"Integer conversion",message:`Could not convert ${o.util.Stringify(e)} to an integer.`});if(i=o.util.IntegerPart(i),i<n||i>r)throw o.errors.exception({header:"Integer conversion",message:`Value must be between ${n}-${r}, got ${i}.`});return i}return!Number.isNaN(i)&&o.util.HasFlag(s,o.attributes.Clamp)?(i=Math.min(Math.max(i,n),r),i=Math.floor(i)%2==0?Math.floor(i):Math.ceil(i),i):Number.isNaN(i)||0===i&&Object.is(0,i)||i===Number.POSITIVE_INFINITY||i===Number.NEGATIVE_INFINITY?0:(i=o.util.IntegerPart(i),i%=Math.pow(2,t),"signed"===A&&i>=Math.pow(2,t)-1?i-Math.pow(2,t):i)},o.util.IntegerPart=function(e){const t=Math.floor(Math.abs(e));return e<0?-1*t:t},o.util.Stringify=function(e){switch(o.util.Type(e)){case 4:return`Symbol(${e.description})`;case 8:return r(e);case 3:return`"${e}"`;case 6:return`${e}n`;default:return`${e}`}},o.util.IsResizableArrayBuffer=function(e){if(s.isArrayBuffer(e))return e.resizable;if(s.isSharedArrayBuffer(e))return e.growable;throw o.errors.exception({header:"IsResizableArrayBuffer",message:`"${o.util.Stringify(e)}" is not an array buffer.`})},o.util.HasFlag=function(e,t){return"number"==typeof e&&(e&t)===t},o.sequenceConverter=function(e){return(t,A,s,r)=>{if(8!==o.util.Type(t))throw o.errors.exception({header:A,message:`${s} (${o.util.Stringify(t)}) is not iterable.`});const n="function"==typeof r?r():t?.[Symbol.iterator]?.(),i=[];let a=0;if(void 0===n||"function"!=typeof n.next)throw o.errors.exception({header:A,message:`${s} is not iterable.`});for(;;){const{done:t,value:r}=n.next();if(t)break;i.push(e(r,A,`${s}[${a++}]`))}return i}},o.recordConverter=function(e,t){return(A,r,n)=>{if(8!==o.util.Type(A))throw o.errors.exception({header:r,message:`${n} ("${o.util.TypeValueToString(A)}") is not an Object.`});const i={};if(!s.isProxy(A)){const s=[...Object.getOwnPropertyNames(A),...Object.getOwnPropertySymbols(A)];for(const a of s){const s=o.util.Stringify(a),c=e(a,r,`Key ${s} in ${n}`),l=t(A[a],r,`${n}[${s}]`);i[c]=l}return i}const a=Reflect.ownKeys(A);for(const s of a){const o=Reflect.getOwnPropertyDescriptor(A,s);if(o?.enumerable){const o=e(s,r,n),a=t(A[s],r,n);i[o]=a}}return i}},o.interfaceConverter=function(e,t){return(A,s,r)=>{if(!e(A))throw o.errors.exception({header:s,message:`Expected ${r} ("${o.util.Stringify(A)}") to be an instance of ${t}.`});return A}},o.dictionaryConverter=function(e){return(t,A,s)=>{const r={};if(null!=t&&8!==o.util.Type(t))throw o.errors.exception({header:A,message:`Expected ${t} to be one of: Null, Undefined, Object.`});for(const n of e){const{key:e,defaultValue:i,required:a,converter:c}=n;if(!0===a&&(null==t||!Object.hasOwn(t,e)))throw o.errors.exception({header:A,message:`Missing required key "${e}".`});let l=t?.[e];const h=void 0!==i;if(h&&void 0===l&&(l=i()),a||h||void 0!==l){if(l=c(l,A,`${s}.${e}`),n.allowedValues&&!n.allowedValues.includes(l))throw o.errors.exception({header:A,message:`${l} is not an accepted type. Expected one of ${n.allowedValues.join(", ")}.`});r[e]=l}}return r}},o.nullableConverter=function(e){return(t,A,s)=>null===t?t:e(t,A,s)},o.is.USVString=function(e){return"string"==typeof e&&e.isWellFormed()},o.is.ReadableStream=o.util.MakeTypeAssertion(ReadableStream),o.is.Blob=o.util.MakeTypeAssertion(Blob),o.is.URLSearchParams=o.util.MakeTypeAssertion(URLSearchParams),o.is.File=o.util.MakeTypeAssertion(File),o.is.URL=o.util.MakeTypeAssertion(URL),o.is.AbortSignal=o.util.MakeTypeAssertion(AbortSignal),o.is.MessagePort=o.util.MakeTypeAssertion(MessagePort),o.is.BufferSource=function(e){return s.isArrayBuffer(e)||ArrayBuffer.isView(e)&&s.isArrayBuffer(e.buffer)},o.converters.DOMString=function(e,t,A,s){if(null===e&&o.util.HasFlag(s,o.attributes.LegacyNullToEmptyString))return"";if("symbol"==typeof e)throw o.errors.exception({header:t,message:`${A} is a symbol, which cannot be converted to a DOMString.`});return String(e)},o.converters.ByteString=function(e,t,A){if("symbol"==typeof e)throw o.errors.exception({header:t,message:`${A} is a symbol, which cannot be converted to a ByteString.`});const s=String(e);for(let e=0;e<s.length;e++)if(s.charCodeAt(e)>255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${e} has a value of ${s.charCodeAt(e)} which is greater than 255.`);return s},o.converters.USVString=function(e){return"string"==typeof e?e.toWellFormed():`${e}`.toWellFormed()},o.converters.boolean=function(e){return Boolean(e)},o.converters.any=function(e){return e},o.converters["long long"]=function(e,t,A){return o.util.ConvertToInt(e,64,"signed",0,t,A)},o.converters["unsigned long long"]=function(e,t,A){return o.util.ConvertToInt(e,64,"unsigned",0,t,A)},o.converters["unsigned long"]=function(e,t,A){return o.util.ConvertToInt(e,32,"unsigned",0,t,A)},o.converters["unsigned short"]=function(e,t,A,s){return o.util.ConvertToInt(e,16,"unsigned",s,t,A)},o.converters.ArrayBuffer=function(e,t,A,r){if(8!==o.util.Type(e)||!s.isArrayBuffer(e))throw o.errors.conversionFailed({prefix:t,argument:`${A} ("${o.util.Stringify(e)}")`,types:["ArrayBuffer"]});if(!o.util.HasFlag(r,o.attributes.AllowResizable)&&o.util.IsResizableArrayBuffer(e))throw o.errors.exception({header:t,message:`${A} cannot be a resizable ArrayBuffer.`});return e},o.converters.SharedArrayBuffer=function(e,t,A,r){if(8!==o.util.Type(e)||!s.isSharedArrayBuffer(e))throw o.errors.conversionFailed({prefix:t,argument:`${A} ("${o.util.Stringify(e)}")`,types:["SharedArrayBuffer"]});if(!o.util.HasFlag(r,o.attributes.AllowResizable)&&o.util.IsResizableArrayBuffer(e))throw o.errors.exception({header:t,message:`${A} cannot be a resizable SharedArrayBuffer.`});return e},o.converters.TypedArray=function(e,t,A,r,n){if(8!==o.util.Type(e)||!s.isTypedArray(e)||e.constructor.name!==t.name)throw o.errors.conversionFailed({prefix:A,argument:`${r} ("${o.util.Stringify(e)}")`,types:[t.name]});if(!o.util.HasFlag(n,o.attributes.AllowShared)&&s.isSharedArrayBuffer(e.buffer))throw o.errors.exception({header:A,message:`${r} cannot be a view on a shared array buffer.`});if(!o.util.HasFlag(n,o.attributes.AllowResizable)&&o.util.IsResizableArrayBuffer(e.buffer))throw o.errors.exception({header:A,message:`${r} cannot be a view on a resizable array buffer.`});return e},o.converters.DataView=function(e,t,A,r){if(8!==o.util.Type(e)||!s.isDataView(e))throw o.errors.conversionFailed({prefix:t,argument:`${A} ("${o.util.Stringify(e)}")`,types:["DataView"]});if(!o.util.HasFlag(r,o.attributes.AllowShared)&&s.isSharedArrayBuffer(e.buffer))throw o.errors.exception({header:t,message:`${A} cannot be a view on a shared array buffer.`});if(!o.util.HasFlag(r,o.attributes.AllowResizable)&&o.util.IsResizableArrayBuffer(e.buffer))throw o.errors.exception({header:t,message:`${A} cannot be a view on a resizable array buffer.`});return e},o.converters.ArrayBufferView=function(e,t,A,r){if(8!==o.util.Type(e)||!s.isArrayBufferView(e))throw o.errors.conversionFailed({prefix:t,argument:`${A} ("${o.util.Stringify(e)}")`,types:["ArrayBufferView"]});if(!o.util.HasFlag(r,o.attributes.AllowShared)&&s.isSharedArrayBuffer(e.buffer))throw o.errors.exception({header:t,message:`${A} cannot be a view on a shared array buffer.`});if(!o.util.HasFlag(r,o.attributes.AllowResizable)&&o.util.IsResizableArrayBuffer(e.buffer))throw o.errors.exception({header:t,message:`${A} cannot be a view on a resizable array buffer.`});return e},o.converters.BufferSource=function(e,t,A,r){if(s.isArrayBuffer(e))return o.converters.ArrayBuffer(e,t,A,r);if(s.isArrayBufferView(e))return r&=~o.attributes.AllowShared,o.converters.ArrayBufferView(e,t,A,r);if(s.isSharedArrayBuffer(e))throw o.errors.exception({header:t,message:`${A} cannot be a SharedArrayBuffer.`});throw o.errors.conversionFailed({prefix:t,argument:`${A} ("${o.util.Stringify(e)}")`,types:["ArrayBuffer","ArrayBufferView"]})},o.converters.AllowSharedBufferSource=function(e,t,A,r){if(s.isArrayBuffer(e))return o.converters.ArrayBuffer(e,t,A,r);if(s.isSharedArrayBuffer(e))return o.converters.SharedArrayBuffer(e,t,A,r);if(s.isArrayBufferView(e))return r|=o.attributes.AllowShared,o.converters.ArrayBufferView(e,t,A,r);throw o.errors.conversionFailed({prefix:t,argument:`${A} ("${o.util.Stringify(e)}")`,types:["ArrayBuffer","SharedArrayBuffer","ArrayBufferView"]})},o.converters["sequence<ByteString>"]=o.sequenceConverter(o.converters.ByteString),o.converters["sequence<sequence<ByteString>>"]=o.sequenceConverter(o.converters["sequence<ByteString>"]),o.converters["record<ByteString, ByteString>"]=o.recordConverter(o.converters.ByteString,o.converters.ByteString),o.converters.Blob=o.interfaceConverter(o.is.Blob,"Blob"),o.converters.AbortSignal=o.interfaceConverter(o.is.AbortSignal,"AbortSignal"),o.converters.EventHandlerNonNull=function(e){return 8!==o.util.Type(e)?null:"function"==typeof e?e:()=>{}},o.attributes={Clamp:1,EnforceRange:2,AllowShared:4,AllowResizable:8,LegacyNullToEmptyString:16},e.exports={webidl:o}},8251:(e,t,A)=>{"use strict";const{uid:s,states:r,sentCloseFrameState:n,emptyBuffer:i,opcodes:o}=A(6490),{parseExtensions:a,isClosed:c,isClosing:l,isEstablished:h,validateCloseCodeAndReason:g}=A(8983),{makeRequest:d}=A(4609),{fetching:u}=A(7388),{Headers:E,getHeadersList:I}=A(6558),{getDecodeSplit:Q}=A(6686),{WebsocketFrameSend:C}=A(6834),B=A(4589);let p;try{p=A(7598)}catch{}function f(e,t,A,s=!1){if(t??=null,A??="",s&&g(t,A),c(e.readyState)||l(e.readyState));else if(h(e.readyState))if(e.closeState.has(n.SENT)||e.closeState.has(n.RECEIVED))e.readyState=r.CLOSING;else{const s=new C;0!==A.length&&null===t&&(t=1e3),B(null===t||Number.isInteger(t)),null===t&&0===A.length?s.frameData=i:null!==t&&null===A?(s.frameData=Buffer.allocUnsafe(2),s.frameData.writeUInt16BE(t,0)):null!==t&&null!==A?(s.frameData=Buffer.allocUnsafe(2+Buffer.byteLength(A)),s.frameData.writeUInt16BE(t,0),s.frameData.write(A,2,"utf-8")):s.frameData=i,e.socket.write(s.createFrame(o.CLOSE)),e.closeState.add(n.SENT),e.readyState=r.CLOSING}else m(e),e.readyState=r.CLOSING}function m(e,t,A,s){h(e.readyState)&&f(e,t,A,!1),e.controller.abort(),e.socket?!1===e.socket.destroyed&&e.socket.destroy():e.onSocketClose()}e.exports={establishWebSocketConnection:function(e,t,A,n,i){const o=e;o.protocol="ws:"===e.protocol?"http:":"https:";const c=d({urlList:[o],client:A,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(i.headers){const e=I(new E(i.headers));c.headersList=e}const l=p.randomBytes(16).toString("base64");c.headersList.append("sec-websocket-key",l,!0),c.headersList.append("sec-websocket-version","13",!0);for(const e of t)c.headersList.append("sec-websocket-protocol",e,!0);return c.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits",!0),u({request:c,useParallelQueue:!0,dispatcher:i.dispatcher,processResponse(e){if("error"===e.type&&(n.readyState=r.CLOSED),"error"===e.type||101!==e.status)return void m(n,1002,"Received network error or non-101 status code.",e.error);if(0!==t.length&&!e.headersList.get("Sec-WebSocket-Protocol"))return void m(n,1002,"Server did not respond with sent protocols.");if("websocket"!==e.headersList.get("Upgrade")?.toLowerCase())return void m(n,1002,'Server did not set Upgrade header to "websocket".');if("upgrade"!==e.headersList.get("Connection")?.toLowerCase())return void m(n,1002,'Server did not set Connection header to "upgrade".');if(e.headersList.get("Sec-WebSocket-Accept")!==p.createHash("sha1").update(l+s).digest("base64"))return void m(n,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");const A=e.headersList.get("Sec-WebSocket-Extensions");let i;if(null!==A&&(i=a(A),!i.has("permessage-deflate")))return void m(n,1002,"Sec-WebSocket-Extensions header does not match.");const o=e.headersList.get("Sec-WebSocket-Protocol");if(null!==o){if(!Q("sec-websocket-protocol",c.headersList).includes(o))return void m(n,1002,"Protocol was not set in the opening handshake.")}e.socket.on("data",n.onSocketData),e.socket.on("close",n.onSocketClose),e.socket.on("error",n.onSocketError),n.wasEverConnected=!0,n.onConnectionEstablished(e,i)}})},failWebsocketConnection:m,closeWebSocketConnection:f}},6490:e=>{"use strict";const t=Buffer.allocUnsafe(0);e.exports={uid:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",sentCloseFrameState:{SENT:1,RECEIVED:2},staticPropertyDescriptors:{enumerable:!0,writable:!1,configurable:!1},states:{CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},opcodes:{CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},maxUnsigned16Bit:65535,parserStates:{INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},emptyBuffer:t,sendHints:{text:1,typedArray:2,arrayBuffer:3,blob:4}}},878:(e,t,A)=>{"use strict";const{webidl:s}=A(6097),{kEnumerableProperty:r}=A(2858),{kConstruct:n}=A(257);class i extends Event{#st;constructor(e,t={}){if(e===n)return super(arguments[1],arguments[2]),void s.util.markAsUncloneable(this);const A="MessageEvent constructor";s.argumentLengthCheck(arguments,1,A),super(e=s.converters.DOMString(e,A,"type"),t=s.converters.MessageEventInit(t,A,"eventInitDict")),this.#st=t,s.util.markAsUncloneable(this)}get data(){return s.brandCheck(this,i),this.#st.data}get origin(){return s.brandCheck(this,i),this.#st.origin}get lastEventId(){return s.brandCheck(this,i),this.#st.lastEventId}get source(){return s.brandCheck(this,i),this.#st.source}get ports(){return s.brandCheck(this,i),Object.isFrozen(this.#st.ports)||Object.freeze(this.#st.ports),this.#st.ports}initMessageEvent(e,t=!1,A=!1,r=null,n="",o="",a=null,c=[]){return s.brandCheck(this,i),s.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new i(e,{bubbles:t,cancelable:A,data:r,origin:n,lastEventId:o,source:a,ports:c})}static createFastMessageEvent(e,t){const A=new i(n,e,t);return A.#st=t,A.#st.data??=null,A.#st.origin??="",A.#st.lastEventId??="",A.#st.source??=null,A.#st.ports??=[],A}}const{createFastMessageEvent:o}=i;delete i.createFastMessageEvent;class a extends Event{#st;constructor(e,t={}){const A="CloseEvent constructor";s.argumentLengthCheck(arguments,1,A),super(e=s.converters.DOMString(e,A,"type"),t=s.converters.CloseEventInit(t)),this.#st=t,s.util.markAsUncloneable(this)}get wasClean(){return s.brandCheck(this,a),this.#st.wasClean}get code(){return s.brandCheck(this,a),this.#st.code}get reason(){return s.brandCheck(this,a),this.#st.reason}}class c extends Event{#st;constructor(e,t){const A="ErrorEvent constructor";s.argumentLengthCheck(arguments,1,A),super(e,t),s.util.markAsUncloneable(this),e=s.converters.DOMString(e,A,"type"),t=s.converters.ErrorEventInit(t??{}),this.#st=t}get message(){return s.brandCheck(this,c),this.#st.message}get filename(){return s.brandCheck(this,c),this.#st.filename}get lineno(){return s.brandCheck(this,c),this.#st.lineno}get colno(){return s.brandCheck(this,c),this.#st.colno}get error(){return s.brandCheck(this,c),this.#st.error}}Object.defineProperties(i.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:r,origin:r,lastEventId:r,source:r,ports:r,initMessageEvent:r}),Object.defineProperties(a.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:r,code:r,wasClean:r}),Object.defineProperties(c.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:r,filename:r,lineno:r,colno:r,error:r}),s.converters.MessagePort=s.interfaceConverter(s.is.MessagePort,"MessagePort"),s.converters["sequence<MessagePort>"]=s.sequenceConverter(s.converters.MessagePort);const l=[{key:"bubbles",converter:s.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:s.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:s.converters.boolean,defaultValue:()=>!1}];s.converters.MessageEventInit=s.dictionaryConverter([...l,{key:"data",converter:s.converters.any,defaultValue:()=>null},{key:"origin",converter:s.converters.USVString,defaultValue:()=>""},{key:"lastEventId",converter:s.converters.DOMString,defaultValue:()=>""},{key:"source",converter:s.nullableConverter(s.converters.MessagePort),defaultValue:()=>null},{key:"ports",converter:s.converters["sequence<MessagePort>"],defaultValue:()=>[]}]),s.converters.CloseEventInit=s.dictionaryConverter([...l,{key:"wasClean",converter:s.converters.boolean,defaultValue:()=>!1},{key:"code",converter:s.converters["unsigned short"],defaultValue:()=>0},{key:"reason",converter:s.converters.USVString,defaultValue:()=>""}]),s.converters.ErrorEventInit=s.dictionaryConverter([...l,{key:"message",converter:s.converters.DOMString,defaultValue:()=>""},{key:"filename",converter:s.converters.USVString,defaultValue:()=>""},{key:"lineno",converter:s.converters["unsigned long"],defaultValue:()=>0},{key:"colno",converter:s.converters["unsigned long"],defaultValue:()=>0},{key:"error",converter:s.converters.any}]),e.exports={MessageEvent:i,CloseEvent:a,ErrorEvent:c,createFastMessageEvent:o}},6834:(e,t,A)=>{"use strict";const{maxUnsigned16Bit:s,opcodes:r}=A(6490),n=8192;let i,o=null,a=n;try{i=A(7598)}catch{i={randomFillSync:function(e,t,A){for(let t=0;t<e.length;++t)e[t]=255*Math.random()|0;return e}}}function c(){return a===n&&(a=0,i.randomFillSync(o??=Buffer.allocUnsafeSlow(n),0,n)),[o[a++],o[a++],o[a++],o[a++]]}e.exports={WebsocketFrameSend:class{constructor(e){this.frameData=e}createFrame(e){const t=this.frameData,A=c(),r=t?.byteLength??0;let n=r,i=6;r>s?(i+=8,n=127):r>125&&(i+=2,n=126);const o=Buffer.allocUnsafe(r+i);o[0]=o[1]=0,o[0]|=128,o[0]=(240&o[0])+e,o[i-4]=A[0],o[i-3]=A[1],o[i-2]=A[2],o[i-1]=A[3],o[1]=n,126===n?o.writeUInt16BE(r,2):127===n&&(o[2]=o[3]=0,o.writeUIntBE(r,4,6)),o[1]|=128;for(let e=0;e<r;++e)o[i+e]=t[e]^A[3&e];return o}static createFastTextFrame(e){const t=c(),A=e.length;for(let s=0;s<A;++s)e[s]^=t[3&s];let n=A,i=6;A>s?(i+=8,n=127):A>125&&(i+=2,n=126);const o=Buffer.allocUnsafeSlow(i);return o[0]=128|r.TEXT,o[1]=128|n,o[i-4]=t[0],o[i-3]=t[1],o[i-2]=t[2],o[i-1]=t[3],126===n?o.writeUInt16BE(A,2):127===n&&(o[2]=o[3]=0,o.writeUIntBE(A,4,6)),[o,e]}},generateMask:c}},8975:(e,t,A)=>{"use strict";const{createInflateRaw:s,Z_DEFAULT_WINDOWBITS:r}=A(8522),{isValidClientWindowBits:n}=A(8983),i=Buffer.from([0,0,255,255]),o=Symbol("kBuffer"),a=Symbol("kLength");e.exports={PerMessageDeflate:class{#rt;#v={};constructor(e){this.#v.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#v.serverMaxWindowBits=e.get("server_max_window_bits")}decompress(e,t,A){if(!this.#rt){let e=r;if(this.#v.serverMaxWindowBits){if(!n(this.#v.serverMaxWindowBits))return void A(new Error("Invalid server_max_window_bits"));e=Number.parseInt(this.#v.serverMaxWindowBits)}this.#rt=s({windowBits:e}),this.#rt[o]=[],this.#rt[a]=0,this.#rt.on("data",(e=>{this.#rt[o].push(e),this.#rt[a]+=e.length})),this.#rt.on("error",(e=>{this.#rt=null,A(e)}))}this.#rt.write(e),t&&this.#rt.write(i),this.#rt.flush((()=>{const e=Buffer.concat(this.#rt[o],this.#rt[a]);this.#rt[o].length=0,this.#rt[a]=0,A(null,e)}))}}}},834:(e,t,A)=>{"use strict";const{Writable:s}=A(7075),r=A(4589),{parserStates:n,opcodes:i,states:o,emptyBuffer:a,sentCloseFrameState:c}=A(6490),{isValidStatusCode:l,isValidOpcode:h,websocketMessageReceived:g,utf8Decode:d,isControlFrame:u,isTextBinaryFrame:E,isContinuationFrame:I}=A(8983),{failWebsocketConnection:Q}=A(8251),{WebsocketFrameSend:C}=A(6834),{PerMessageDeflate:B}=A(8975);e.exports={ByteParser:class extends s{#nt=[];#it=0;#ot=0;#at=!1;#le=n.INFO;#ct={};#lt=[];#ht;#U;constructor(e,t){super(),this.#U=e,this.#ht=null==t?new Map:t,this.#ht.has("permessage-deflate")&&this.#ht.set("permessage-deflate",new B(t))}_write(e,t,A){this.#nt.push(e),this.#ot+=e.length,this.#at=!0,this.run(A)}run(e){for(;this.#at;)if(this.#le===n.INFO){if(this.#ot<2)return e();const t=this.consume(2),A=!!(128&t[0]),s=15&t[0],r=!(128&~t[1]),o=!A&&s!==i.CONTINUATION,a=127&t[1],c=64&t[0],l=32&t[0],g=16&t[0];if(!h(s))return Q(this.#U,1002,"Invalid opcode received"),e();if(r)return Q(this.#U,1002,"Frame cannot be masked"),e();if(0!==c&&!this.#ht.has("permessage-deflate"))return void Q(this.#U,1002,"Expected RSV1 to be clear.");if(0!==l||0!==g)return void Q(this.#U,1002,"RSV1, RSV2, RSV3 must be clear");if(o&&!E(s))return void Q(this.#U,1002,"Invalid frame type was fragmented.");if(E(s)&&this.#lt.length>0)return void Q(this.#U,1002,"Expected continuation frame");if(this.#ct.fragmented&&o)return void Q(this.#U,1002,"Fragmented frame exceeded 125 bytes.");if((a>125||o)&&u(s))return void Q(this.#U,1002,"Control frame either too large or fragmented");if(I(s)&&0===this.#lt.length&&!this.#ct.compressed)return void Q(this.#U,1002,"Unexpected continuation frame");a<=125?(this.#ct.payloadLength=a,this.#le=n.READ_DATA):126===a?this.#le=n.PAYLOADLENGTH_16:127===a&&(this.#le=n.PAYLOADLENGTH_64),E(s)&&(this.#ct.binaryType=s,this.#ct.compressed=0!==c),this.#ct.opcode=s,this.#ct.masked=r,this.#ct.fin=A,this.#ct.fragmented=o}else if(this.#le===n.PAYLOADLENGTH_16){if(this.#ot<2)return e();const t=this.consume(2);this.#ct.payloadLength=t.readUInt16BE(0),this.#le=n.READ_DATA}else if(this.#le===n.PAYLOADLENGTH_64){if(this.#ot<8)return e();const t=this.consume(8),A=t.readUInt32BE(0);if(A>2**31-1)return void Q(this.#U,1009,"Received payload length > 2^31 bytes.");const s=t.readUInt32BE(4);this.#ct.payloadLength=(A<<8)+s,this.#le=n.READ_DATA}else if(this.#le===n.READ_DATA){if(this.#ot<this.#ct.payloadLength)return e();const t=this.consume(this.#ct.payloadLength);if(u(this.#ct.opcode))this.#at=this.parseControlFrame(t),this.#le=n.INFO;else{if(this.#ct.compressed){this.#ht.get("permessage-deflate").decompress(t,this.#ct.fin,((t,A)=>{if(t)Q(this.#U,1007,t.message);else{if(this.writeFragments(A),!this.#ct.fin)return this.#le=n.INFO,this.#at=!0,void this.run(e);g(this.#U,this.#ct.binaryType,this.consumeFragments()),this.#at=!0,this.#le=n.INFO,this.run(e)}})),this.#at=!1;break}this.writeFragments(t),!this.#ct.fragmented&&this.#ct.fin&&g(this.#U,this.#ct.binaryType,this.consumeFragments()),this.#le=n.INFO}}}consume(e){if(e>this.#ot)throw new Error("Called consume() before buffers satiated.");if(0===e)return a;this.#ot-=e;const t=this.#nt[0];if(t.length>e)return this.#nt[0]=t.subarray(e,t.length),t.subarray(0,e);if(t.length===e)return this.#nt.shift();{let t=0;const A=Buffer.allocUnsafeSlow(e);for(;t!==e;){const s=this.#nt[0],r=s.length;if(r+t===e){A.set(this.#nt.shift(),t);break}if(r+t>e){A.set(s.subarray(0,e-t),t),this.#nt[0]=s.subarray(e-t);break}A.set(this.#nt.shift(),t),t+=r}return A}}writeFragments(e){this.#it+=e.length,this.#lt.push(e)}consumeFragments(){const e=this.#lt;if(1===e.length)return this.#it=0,e.shift();let t=0;const A=Buffer.allocUnsafeSlow(this.#it);for(let s=0;s<e.length;++s){const r=e[s];A.set(r,t),t+=r.length}return this.#lt=[],this.#it=0,A}parseCloseBody(e){let t;if(r(1!==e.length),e.length>=2&&(t=e.readUInt16BE(0)),void 0!==t&&!l(t))return{code:1002,reason:"Invalid status code",error:!0};let A=e.subarray(2);239===A[0]&&187===A[1]&&191===A[2]&&(A=A.subarray(3));try{A=d(A)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:t,reason:A,error:!1}}parseControlFrame(e){const{opcode:t,payloadLength:A}=this.#ct;if(t===i.CLOSE){if(1===A)return Q(this.#U,1002,"Received close frame with a 1-byte body."),!1;if(this.#ct.closeInfo=this.parseCloseBody(e),this.#ct.closeInfo.error){const{code:e,reason:t}=this.#ct.closeInfo;return Q(this.#U,e,t),!1}if(!this.#U.closeState.has(c.SENT)&&!this.#U.closeState.has(c.RECEIVED)){let e=a;this.#ct.closeInfo.code&&(e=Buffer.allocUnsafe(2),e.writeUInt16BE(this.#ct.closeInfo.code,0));const t=new C(e);this.#U.socket.write(t.createFrame(i.CLOSE)),this.#U.closeState.add(c.SENT)}return this.#U.readyState=o.CLOSING,this.#U.closeState.add(c.RECEIVED),!1}if(t===i.PING){if(!this.#U.closeState.has(c.RECEIVED)){const t=new C(e);this.#U.socket.write(t.createFrame(i.PONG)),this.#U.onPing(e)}}else t===i.PONG&&this.#U.onPong(e);return!0}get closingInfo(){return this.#ct.closeInfo}}}},2534:(e,t,A)=>{"use strict";const{WebsocketFrameSend:s}=A(6834),{opcodes:r,sendHints:n}=A(6490),i=A(1726);function o(e,t){return new s(function(e,t){switch(t){case n.text:case n.typedArray:return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);case n.arrayBuffer:case n.blob:return new Uint8Array(e)}}(e,t)).createFrame(t===n.text?r.TEXT:r.BINARY)}e.exports={SendQueue:class{#gt=new i;#dt=!1;#ut;constructor(e){this.#ut=e}add(e,t,A){if(A!==n.blob){if(this.#dt){const s={promise:null,callback:t,frame:o(e,A)};this.#gt.push(s)}else if(A===n.text){const{0:A,1:r}=s.createFastTextFrame(e);this.#ut.cork(),this.#ut.write(A),this.#ut.write(r,t),this.#ut.uncork()}else this.#ut.write(o(e,A),t);return}const r={promise:e.arrayBuffer().then((e=>{r.promise=null,r.frame=o(e,A)})),callback:t,frame:null};this.#gt.push(r),this.#dt||this.#Et()}async#Et(){this.#dt=!0;const e=this.#gt;for(;!e.isEmpty();){const t=e.shift();null!==t.promise&&await t.promise,this.#ut.write(t.frame,t.callback),t.callback=t.frame=null}this.#dt=!1}}}},7053:(e,t,A)=>{"use strict";const{webidl:s}=A(6097),{validateCloseCodeAndReason:r}=A(8983),{kConstruct:n}=A(257),{kEnumerableProperty:i}=A(2858);class o extends(function(){class e extends DOMException{get reason(){return""}}return void 0!==(new e).reason?DOMException:new Proxy(DOMException,{construct(e,t,A){const s=Reflect.construct(e,t,e);return Object.setPrototypeOf(s,A.prototype),s}})}()){#It;#W;constructor(e="",t=void 0){if(super(e=s.converters.DOMString(e,"WebSocketError","message"),"WebSocketError"),t===n)return;null!==t&&(t=s.converters.WebSocketCloseInfo(t));let A=t.closeCode??null;const i=t.reason??"";r(A,i),0!==i.length&&null===A&&(A=1e3),this.#It=A,this.#W=i}get closeCode(){return this.#It}get reason(){return this.#W}static createUnvalidatedWebSocketError(e,t,A){const s=new o(e,n);return s.#It=t,s.#W=A,s}}const{createUnvalidatedWebSocketError:a}=o;delete o.createUnvalidatedWebSocketError,Object.defineProperties(o.prototype,{closeCode:i,reason:i,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}}),s.is.WebSocketError=s.util.MakeTypeAssertion(o),e.exports={WebSocketError:o,createUnvalidatedWebSocketError:a}},27:(e,t,A)=>{"use strict";const{createDeferredPromise:s}=A(9250),{environmentSettingsObject:r}=A(6686),{states:n,opcodes:i,sentCloseFrameState:o}=A(6490),{webidl:a}=A(6097),{getURLRecord:c,isValidSubprotocol:l,isEstablished:h,utf8Decode:g}=A(8983),{establishWebSocketConnection:d,failWebsocketConnection:u,closeWebSocketConnection:E}=A(8251),{channels:I}=A(772),{WebsocketFrameSend:Q}=A(6834),{ByteParser:C}=A(834),{WebSocketError:B,createUnvalidatedWebSocketError:p}=A(7053),{utf8DecodeBytes:f}=A(6686),{kEnumerableProperty:m}=A(2858);let y=!1;class S{#Oe;#Qt;#Ct;#Bt;#pt;#ft;#mt=!1;#U={onConnectionEstablished:(e,t)=>this.#yt(e,t),onMessage:(e,t)=>this.#St(e,t),onParserError:e=>u(this.#U,null,e.message),onParserDrain:()=>this.#U.socket.resume(),onSocketData:e=>{this.#wt.write(e)||this.#U.socket.pause()},onSocketError:e=>{this.#U.readyState=n.CLOSING,I.socketError.hasSubscribers&&I.socketError.publish(e),this.#U.socket.destroy()},onSocketClose:()=>this.#Dt(),onPing:()=>{},onPong:()=>{},readyState:n.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#wt;constructor(e,t=void 0){y||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),y=!0),a.argumentLengthCheck(arguments,1,"WebSocket"),e=a.converters.USVString(e),null!==t&&(t=a.converters.WebSocketStreamOptions(t));const A=r.settingsObject.baseUrl,i=c(e,A),o=t.protocols;if(o.length!==new Set(o.map((e=>e.toLowerCase()))).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(o.length>0&&!o.every((e=>l(e))))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#Oe=i.toString(),this.#Qt=s(),this.#Ct=s(),null!=t.signal){const e=t.signal;if(e.aborted)return this.#Qt.reject(e.reason),void this.#Ct.reject(e.reason);e.addEventListener("abort",(()=>{h(this.#U.readyState)||(u(this.#U),this.#U.readyState=n.CLOSING,this.#Qt.reject(e.reason),this.#Ct.reject(e.reason),this.#mt=!0)}),{once:!0})}const g=r.settingsObject;this.#U.controller=d(i,o,g,this.#U,t)}get url(){return this.#Oe.toString()}get opened(){return this.#Qt.promise}get closed(){return this.#Ct.promise}close(e=void 0){null!==e&&(e=a.converters.WebSocketCloseInfo(e));const t=e.closeCode??null,A=e.reason;E(this.#U,t,A,!0)}#bt(e){e=a.converters.WebSocketStreamWrite(e);const t=s();let A=null,r=null;if(a.is.BufferSource(e))A=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),r=i.BINARY;else{let s;try{s=a.converters.DOMString(e)}catch(e){return t.reject(e),t.promise}A=(new TextEncoder).encode(s),r=i.TEXT}if(!this.#U.closeState.has(o.SENT)&&!this.#U.closeState.has(o.RECEIVED)){const e=new Q(A);this.#U.socket.write(e.createFrame(r),(()=>{t.resolve(void 0)}))}return t.promise}#yt(e,t){this.#U.socket=e.socket;const A=new C(this.#U,t);A.on("drain",(()=>this.#U.onParserDrain())),A.on("error",(e=>this.#U.onParserError(e))),this.#wt=A,this.#U.readyState=n.OPEN;const s=t??"",r=e.headersList.get("sec-websocket-protocol")??"",i=new ReadableStream({start:e=>{this.#pt=e},pull(t){let A;for(;t.desiredSize>0&&null!==(A=e.socket.read());)t.enqueue(A)},cancel:e=>this.#Nt(e)}),o=new WritableStream({write:e=>this.#bt(e),close:()=>E(this.#U,null,null),abort:e=>this.#Rt(e)});this.#Bt=i,this.#ft=o,this.#Qt.resolve({extensions:s,protocol:r,readable:i,writable:o})}#St(e,t){if(this.#U.readyState!==n.OPEN)return;let A;if(e===i.TEXT)try{A=g(t)}catch{return void u(this.#U,"Received invalid UTF-8 in text frame.")}else e===i.BINARY&&(A=new Uint8Array(t.buffer,t.byteOffset,t.byteLength));this.#pt.enqueue(A)}#Dt(){const e=this.#U.closeState.has(o.SENT)&&this.#U.closeState.has(o.RECEIVED);if(this.#U.readyState=n.CLOSED,this.#mt)return;this.#U.wasEverConnected||this.#Qt.reject(new B("Socket never opened"));const t=this.#wt.closingInfo;let A=t?.code??1005;this.#U.closeState.has(o.SENT)||this.#U.closeState.has(o.RECEIVED)||(A=1006);const s=null==t?.reason?"":f(Buffer.from(t.reason));if(e)this.#pt.close(),this.#ft.locked||this.#ft.abort(new DOMException("A closed WebSocketStream cannot be written to","InvalidStateError")),this.#Ct.resolve({closeCode:A,reason:s});else{const e=p("unclean close",A,s);this.#pt.error(e),this.#ft.abort(e),this.#Ct.reject(e)}}#Rt(e){let t=null,A="";a.is.WebSocketError(e)&&(t=e.closeCode,A=e.reason),E(this.#U,t,A)}#Nt(e){this.#Rt(e)}}Object.defineProperties(S.prototype,{url:m,opened:m,closed:m,close:m,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}}),a.converters.WebSocketStreamOptions=a.dictionaryConverter([{key:"protocols",converter:a.sequenceConverter(a.converters.USVString),defaultValue:()=>[]},{key:"signal",converter:a.nullableConverter(a.converters.AbortSignal),defaultValue:()=>null}]),a.converters.WebSocketCloseInfo=a.dictionaryConverter([{key:"closeCode",converter:e=>a.converters["unsigned short"](e,a.attributes.EnforceRange)},{key:"reason",converter:a.converters.USVString,defaultValue:()=>""}]),a.converters.WebSocketStreamWrite=function(e){return"string"==typeof e?a.converters.USVString(e):a.converters.BufferSource(e)},e.exports={WebSocketStream:S}},8983:(e,t,A)=>{"use strict";const{states:s,opcodes:r}=A(6490),{isUtf8:n}=A(4573),{collectASequenceOfCodePointsFast:i,removeHTTPWhitespace:o}=A(9934);function a(e){return e===r.CLOSE||e===r.PING||e===r.PONG}function c(e){return e===r.CONTINUATION}function l(e){return e===r.TEXT||e===r.BINARY}const h=(()=>{if("string"==typeof process.versions.icu){const e=new TextDecoder("utf-8",{fatal:!0});return e.decode.bind(e)}return function(e){if(n(e))return e.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();e.exports={isConnecting:function(e){return e===s.CONNECTING},isEstablished:function(e){return e===s.OPEN},isClosing:function(e){return e===s.CLOSING},isClosed:function(e){return e===s.CLOSED},fireEvent:function(e,t,A=(e,t)=>new Event(e,t),s={}){const r=A(e,s);t.dispatchEvent(r)},isValidSubprotocol:function(e){if(0===e.length)return!1;for(let t=0;t<e.length;++t){const A=e.charCodeAt(t);if(A<33||A>126||34===A||40===A||41===A||44===A||47===A||58===A||59===A||60===A||61===A||62===A||63===A||64===A||91===A||92===A||93===A||123===A||125===A)return!1}return!0},isValidStatusCode:function(e){return e>=1e3&&e<1015?1004!==e&&1005!==e&&1006!==e:e>=3e3&&e<=4999},websocketMessageReceived:function(e,t,A){e.onMessage(t,A)},utf8Decode:h,isControlFrame:a,isContinuationFrame:c,isTextBinaryFrame:l,isValidOpcode:function(e){return l(e)||c(e)||a(e)},parseExtensions:function(e){const t={position:0},A=new Map;for(;t.position<e.length;){const s=i(";",e,t),[r,n=""]=s.split("=",2);A.set(o(r,!0,!1),o(n,!1,!0)),t.position++}return A},isValidClientWindowBits:function(e){for(let t=0;t<e.length;t++){const A=e.charCodeAt(t);if(A<48||A>57)return!1}return!0},toArrayBuffer:function(e){return e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer},getURLRecord:function(e,t){let A;try{A=new URL(e,t)}catch(e){throw new DOMException(e,"SyntaxError")}if("http:"===A.protocol?A.protocol="ws:":"https:"===A.protocol&&(A.protocol="wss:"),"ws:"!==A.protocol&&"wss:"!==A.protocol)throw new DOMException("expected a ws: or wss: url","SyntaxError");if(A.hash.length||A.href.endsWith("#"))throw new DOMException("hash","SyntaxError");return A},validateCloseCodeAndReason:function(e,t){if(null!==e&&1e3!==e&&(e<3e3||e>4999))throw new DOMException("invalid code","InvalidAccessError");if(null!==t){const e=Buffer.byteLength(t);if(e>123)throw new DOMException(`Reason must be less than 123 bytes; received ${e}`,"SyntaxError")}}}},2984:(e,t,A)=>{"use strict";const{isArrayBuffer:s}=A(3429),{webidl:r}=A(6097),{URLSerializer:n}=A(9934),{environmentSettingsObject:i}=A(6686),{staticPropertyDescriptors:o,states:a,sentCloseFrameState:c,sendHints:l,opcodes:h}=A(6490),{isConnecting:g,isEstablished:d,isClosing:u,isClosed:E,isValidSubprotocol:I,fireEvent:Q,utf8Decode:C,toArrayBuffer:B,getURLRecord:p}=A(8983),{establishWebSocketConnection:f,closeWebSocketConnection:m,failWebsocketConnection:y}=A(8251),{ByteParser:S}=A(834),{kEnumerableProperty:w}=A(2858),{getGlobalDispatcher:D}=A(9879),{ErrorEvent:b,CloseEvent:N,createFastMessageEvent:R}=A(878),{SendQueue:v}=A(2534),{WebsocketFrameSend:k}=A(6834),{channels:T}=A(772);class F extends EventTarget{#Ge={open:null,error:null,close:null,message:null};#vt=0;#kt="";#ht="";#Tt;#U={onConnectionEstablished:(e,t)=>this.#yt(e,t),onMessage:(e,t)=>this.#St(e,t),onParserError:e=>y(this.#U,null,e.message),onParserDrain:()=>this.#Ft(),onSocketData:e=>{this.#wt.write(e)||this.#U.socket.pause()},onSocketError:e=>{this.#U.readyState=a.CLOSING,T.socketError.hasSubscribers&&T.socketError.publish(e),this.#U.socket.destroy()},onSocketClose:()=>this.#Dt(),onPing:e=>{T.ping.hasSubscribers&&T.ping.publish({payload:e,websocket:this})},onPong:e=>{T.pong.hasSubscribers&&T.pong.publish({payload:e,websocket:this})},readyState:a.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#Oe;#Mt;#wt;constructor(e,t=[]){super(),r.util.markAsUncloneable(this);const A="WebSocket constructor";r.argumentLengthCheck(arguments,1,A);const s=r.converters["DOMString or sequence<DOMString> or WebSocketInit"](t,A,"options");e=r.converters.USVString(e),t=s.protocols;const n=i.settingsObject.baseUrl,o=p(e,n);if("string"==typeof t&&(t=[t]),t.length!==new Set(t.map((e=>e.toLowerCase()))).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(t.length>0&&!t.every((e=>I(e))))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#Oe=new URL(o.href);const a=i.settingsObject;this.#U.controller=f(o,t,a,this.#U,s),this.#U.readyState=F.CONNECTING,this.#Mt="blob"}close(e=void 0,t=void 0){r.brandCheck(this,F);void 0!==e&&(e=r.converters["unsigned short"](e,"WebSocket.close","code",r.attributes.Clamp)),void 0!==t&&(t=r.converters.USVString(t)),e??=null,t??="",m(this.#U,e,t,!0)}send(e){r.brandCheck(this,F);const t="WebSocket.send";if(r.argumentLengthCheck(arguments,1,t),e=r.converters.WebSocketSendData(e,t,"data"),g(this.#U.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(d(this.#U.readyState)&&!u(this.#U.readyState))if("string"==typeof e){const t=Buffer.from(e);this.#vt+=t.byteLength,this.#Tt.add(t,(()=>{this.#vt-=t.byteLength}),l.text)}else s(e)?(this.#vt+=e.byteLength,this.#Tt.add(e,(()=>{this.#vt-=e.byteLength}),l.arrayBuffer)):ArrayBuffer.isView(e)?(this.#vt+=e.byteLength,this.#Tt.add(e,(()=>{this.#vt-=e.byteLength}),l.typedArray)):r.is.Blob(e)&&(this.#vt+=e.size,this.#Tt.add(e,(()=>{this.#vt-=e.size}),l.blob))}get readyState(){return r.brandCheck(this,F),this.#U.readyState}get bufferedAmount(){return r.brandCheck(this,F),this.#vt}get url(){return r.brandCheck(this,F),n(this.#Oe)}get extensions(){return r.brandCheck(this,F),this.#ht}get protocol(){return r.brandCheck(this,F),this.#kt}get onopen(){return r.brandCheck(this,F),this.#Ge.open}set onopen(e){r.brandCheck(this,F),this.#Ge.open&&this.removeEventListener("open",this.#Ge.open);const t=r.converters.EventHandlerNonNull(e);null!==t?(this.addEventListener("open",t),this.#Ge.open=e):this.#Ge.open=null}get onerror(){return r.brandCheck(this,F),this.#Ge.error}set onerror(e){r.brandCheck(this,F),this.#Ge.error&&this.removeEventListener("error",this.#Ge.error);const t=r.converters.EventHandlerNonNull(e);null!==t?(this.addEventListener("error",t),this.#Ge.error=e):this.#Ge.error=null}get onclose(){return r.brandCheck(this,F),this.#Ge.close}set onclose(e){r.brandCheck(this,F),this.#Ge.close&&this.removeEventListener("close",this.#Ge.close);const t=r.converters.EventHandlerNonNull(e);null!==t?(this.addEventListener("close",t),this.#Ge.close=e):this.#Ge.close=null}get onmessage(){return r.brandCheck(this,F),this.#Ge.message}set onmessage(e){r.brandCheck(this,F),this.#Ge.message&&this.removeEventListener("message",this.#Ge.message);const t=r.converters.EventHandlerNonNull(e);null!==t?(this.addEventListener("message",t),this.#Ge.message=e):this.#Ge.message=null}get binaryType(){return r.brandCheck(this,F),this.#Mt}set binaryType(e){r.brandCheck(this,F),this.#Mt="blob"!==e&&"arraybuffer"!==e?"blob":e}#yt(e,t){this.#U.socket=e.socket;const A=new S(this.#U,t);A.on("drain",(()=>this.#U.onParserDrain())),A.on("error",(e=>this.#U.onParserError(e))),this.#wt=A,this.#Tt=new v(e.socket),this.#U.readyState=a.OPEN;const s=e.headersList.get("sec-websocket-extensions");null!==s&&(this.#ht=s);const r=e.headersList.get("sec-websocket-protocol");if(null!==r&&(this.#kt=r),Q("open",this),T.open.hasSubscribers){const t=e.headersList.entries;T.open.publish({address:e.socket.address(),protocol:this.#kt,extensions:this.#ht,websocket:this,handshakeResponse:{status:e.status,statusText:e.statusText,headers:t}})}}#St(e,t){if(this.#U.readyState!==a.OPEN)return;let A;if(e===h.TEXT)try{A=C(t)}catch{return void y(this.#U,1007,"Received invalid UTF-8 in text frame.")}else e===h.BINARY&&(A="blob"===this.#Mt?new Blob([t]):B(t));Q("message",this,R,{origin:this.#Oe.origin,data:A})}#Ft(){this.#U.socket.resume()}#Dt(){const e=this.#U.closeState.has(c.SENT)&&this.#U.closeState.has(c.RECEIVED);let t=1005,A="";const s=this.#wt?.closingInfo;s&&!s.error&&(t=s.code??1005,A=s.reason),this.#U.readyState=a.CLOSED,this.#U.closeState.has(c.RECEIVED)||(t=1006,Q("error",this,((e,t)=>new b(e,t)),{error:new TypeError(A)})),Q("close",this,((e,t)=>new N(e,t)),{wasClean:e,code:t,reason:A}),T.close.hasSubscribers&&T.close.publish({websocket:this,code:t,reason:A})}static ping(e,t){if(Buffer.isBuffer(t)){if(t.length>125)throw new TypeError("A PING frame cannot have a body larger than 125 bytes.")}else if(void 0!==t)throw new TypeError("Expected buffer payload");const A=e.#U.readyState;if(d(A)&&!u(A)&&!E(A)){const A=new k(t);e.#U.socket.write(A.createFrame(h.PING))}}}const{ping:M}=F;Reflect.deleteProperty(F,"ping"),F.CONNECTING=F.prototype.CONNECTING=a.CONNECTING,F.OPEN=F.prototype.OPEN=a.OPEN,F.CLOSING=F.prototype.CLOSING=a.CLOSING,F.CLOSED=F.prototype.CLOSED=a.CLOSED,Object.defineProperties(F.prototype,{CONNECTING:o,OPEN:o,CLOSING:o,CLOSED:o,url:w,readyState:w,bufferedAmount:w,onopen:w,onerror:w,onclose:w,close:w,onmessage:w,binaryType:w,send:w,extensions:w,protocol:w,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(F,{CONNECTING:o,OPEN:o,CLOSING:o,CLOSED:o}),r.converters["sequence<DOMString>"]=r.sequenceConverter(r.converters.DOMString),r.converters["DOMString or sequence<DOMString>"]=function(e,t,A){return r.util.Type(e)===r.util.Types.OBJECT&&Symbol.iterator in e?r.converters["sequence<DOMString>"](e):r.converters.DOMString(e,t,A)},r.converters.WebSocketInit=r.dictionaryConverter([{key:"protocols",converter:r.converters["DOMString or sequence<DOMString>"],defaultValue:()=>[]},{key:"dispatcher",converter:r.converters.any,defaultValue:()=>D()},{key:"headers",converter:r.nullableConverter(r.converters.HeadersInit)}]),r.converters["DOMString or sequence<DOMString> or WebSocketInit"]=function(e){return r.util.Type(e)!==r.util.Types.OBJECT||Symbol.iterator in e?{protocols:r.converters["DOMString or sequence<DOMString>"](e)}:r.converters.WebSocketInit(e)},r.converters.WebSocketSendData=function(e){if(r.util.Type(e)===r.util.Types.OBJECT){if(r.is.Blob(e))return e;if(r.is.BufferSource(e))return e}return r.converters.USVString(e)},e.exports={WebSocket:F,ping:M}},7562:function(e,t,A){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,A,s){void 0===s&&(s=A);var r=Object.getOwnPropertyDescriptor(t,A);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[A]}}),Object.defineProperty(e,s,r)}:function(e,t,A,s){void 0===s&&(s=A),e[s]=t[A]}),r=this&&this.__exportStar||function(e,t){for(var A in e)"default"===A||Object.prototype.hasOwnProperty.call(t,A)||s(t,e,A)};Object.defineProperty(t,"__esModule",{value:!0}),t.sdk=t.MixinDeviceBase=t.ScryptedDeviceBase=void 0,r(A(4192),t);const n=A(4192);A(3339);class i extends n.DeviceBase{constructor(e){super(),this.nativeId=e}get storage(){return this._storage||(this._storage=t.sdk.deviceManager.getDeviceStorage(this.nativeId)),this._storage}get log(){return this._log||(this._log=t.sdk.deviceManager.getDeviceLogger(this.nativeId)),this._log}get console(){return this._console||(this._console=t.sdk.deviceManager.getDeviceConsole(this.nativeId)),this._console}async createMediaObject(e,A){return t.sdk.mediaManager.createMediaObject(e,A,{sourceId:this.id})}getMediaObjectConsole(e){return"string"!=typeof e.sourceId?this.console:t.sdk.deviceManager.getMixinConsole(e.sourceId,this.nativeId)}_lazyLoadDeviceState(){this._deviceState||(this.nativeId?this._deviceState=t.sdk.deviceManager.getDeviceState(this.nativeId):this._deviceState=t.sdk.deviceManager.getDeviceState())}onDeviceEvent(e,A){return t.sdk.deviceManager.onDeviceEvent(this.nativeId,e,A)}}t.ScryptedDeviceBase=i;class o extends n.DeviceBase{constructor(e){super(),this._listeners=new Set,this.mixinDevice=e.mixinDevice,this.mixinDeviceInterfaces=e.mixinDeviceInterfaces,this.mixinStorageSuffix=e.mixinStorageSuffix,this._deviceState=e.mixinDeviceState,this.nativeId=t.sdk.systemManager.getDeviceById(this.id).nativeId,this.mixinProviderNativeId=e.mixinProviderNativeId,this._deviceState.__rpcproxy_traps_all_properties&&"string"==typeof this._deviceState.id&&(this._deviceState=t.sdk.deviceManager.createDeviceState(this._deviceState.id,this._deviceState.setState))}get storage(){if(!this._storage){const e=this.mixinStorageSuffix,A=this.id+(e?":"+e:"");this._storage=t.sdk.deviceManager.getMixinStorage(A,this.mixinProviderNativeId)}return this._storage}get console(){return this._console||(t.sdk.deviceManager.getMixinConsole?this._console=t.sdk.deviceManager.getMixinConsole(this.id,this.mixinProviderNativeId):this._console=t.sdk.deviceManager.getDeviceConsole(this.mixinProviderNativeId)),this._console}async createMediaObject(e,A){return t.sdk.mediaManager.createMediaObject(e,A,{sourceId:this.id})}getMediaObjectConsole(e){return"string"!=typeof e.sourceId?this.console:t.sdk.deviceManager.getMixinConsole(e.sourceId,this.mixinProviderNativeId)}onDeviceEvent(e,A){return t.sdk.deviceManager.onMixinEvent(this.id,this,e,A)}_lazyLoadDeviceState(){}manageListener(e){this._listeners.add(e)}release(){for(const e of this._listeners)e.removeListener()}}t.MixinDeviceBase=o,function(){function e(e){return function(){return this._lazyLoadDeviceState(),this._deviceState?.[e]}}function t(e){return function(t){this._lazyLoadDeviceState(),this._deviceState?this._deviceState[e]=t:console.warn("device state is unavailable. the device must be discovered with deviceManager.onDeviceDiscovered or deviceManager.onDevicesChanged before the state can be set.")}}for(const A of Object.values(n.ScryptedInterfaceProperty))A!==n.ScryptedInterfaceProperty.nativeId&&(Object.defineProperty(i.prototype,A,{set:t(A),get:e(A)}),Object.defineProperty(o.prototype,A,{set:t(A),get:e(A)}))}(),t.sdk={};try{let e=!1;try{process.env.SCRYPTED_SDK_ES_MODULE||process.env.SCRYPTED_SDK_MODULE;const s=process.env.SCRYPTED_SDK_CJS_MODULE||process.env.SCRYPTED_SDK_MODULE;if(s)if("undefined"!=typeof require){const A=require(process.env.SCRYPTED_SDK_MODULE);Object.assign(t.sdk,A.getScryptedStatic()),e=!0}else{const r=A(3891)(s);Object.assign(t.sdk,r.getScryptedStatic()),e=!0}}catch(e){throw console.warn("failed to load sdk module",e),e}if(!e){let e;try{e=pluginRuntimeAPI}catch(e){}Object.assign(t.sdk,{log:deviceManager.getDeviceLogger(void 0),deviceManager,endpointManager,mediaManager,systemManager,pluginHostAPI,...e})}try{t.sdk.systemManager.setScryptedInterfaceDescriptors?.(n.TYPES_VERSION,n.ScryptedInterfaceDescriptors)?.catch((()=>{}))}catch(e){}}catch(e){console.error("sdk initialization error, import @scrypted/types or use @scrypted/client instead",e)}t.default=t.sdk},6117:function(e,t,A){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,A,s){void 0===s&&(s=A);var r=Object.getOwnPropertyDescriptor(t,A);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[A]}}),Object.defineProperty(e,s,r)}:function(e,t,A,s){void 0===s&&(s=A),e[s]=t[A]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var A in e)"default"!==A&&Object.prototype.hasOwnProperty.call(e,A)&&s(t,e,A);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.StorageSettings=void 0;const i=n(A(7562)),{systemManager:o}=i.default;t.StorageSettings=class{constructor(e,t){this.device=e,this.settings=t,this.values={},this.hasValue={};for(const e of Object.keys(t)){const A=t[e],s=()=>this.getItem(e);let r;r="clippath"!==A.type?s:()=>{try{return JSON.parse(s())}catch(e){}},Object.defineProperty(this.values,e,{get:r,set:t=>this.putSetting(e,t),enumerable:!0}),Object.defineProperty(this.hasValue,e,{get:()=>null!=this.device.storage.getItem(e),enumerable:!0})}}get keys(){const e={};for(const t of Object.keys(this.settings))e[t]=t;return e}async getSettings(){const e=await(this.options?.onGet?.()),t=[];for(const[A,s]of Object.entries(this.settings)){let r=Object.assign({},s);e?.[A]&&(r=Object.assign(r,e[A])),r.onGet&&(r=Object.assign(r,await r.onGet())),r.hide||await(this.options?.hide?.[A]?.())||(r.key=A,r.value=this.getItemInternal(A,r,!0),"function"==typeof r.deviceFilter&&(r.deviceFilter=r.deviceFilter.toString()),t.push(r),delete r.onPut,delete r.onGet,delete r.mapPut,delete r.mapGet)}return t}async putSetting(e,t){const A=this.settings[e];let s;return A&&(s=this.getItemInternal(e,A)),this.putSettingInternal(A,s,e,t)}putSettingInternal(e,t,A,s){e?.noStore||(e?.mapPut&&(s=e.mapPut(t,s)),null==s?this.device.storage.removeItem(A):"object"==typeof s?this.device.storage.setItem(A,JSON.stringify(s)):this.device.storage.setItem(A,s?.toString())),e?.onPut?.(t,s),e?.hide||this.device.onDeviceEvent(i.ScryptedInterface.Settings,void 0)}getItemInternal(e,t,A){if(!t)return this.device.storage.getItem(e);const s=function(e,t,A,s){if(null==e)return A();const r=t.multiple?"array":t.type;if("boolean"===r)return"true"===e||"false"!==e&&(A()||!1);if("number"===r){const t=parseFloat(e);return isNaN(t)?A()||0:t}if("integer"===r){const t=parseInt(e);return isNaN(t)?A()||0:t}if("array"===r){if(!e)return A()||[];try{return JSON.parse(e)}catch(e){return A()||[]}}if("device"===r)return s?e:o.getDeviceById(e)||o.getDeviceById(A());if(e&&t.json)try{return JSON.parse(e)}catch(e){return A()}return e||A()}(this.device.storage.getItem(e),t,(()=>null!=t.persistedDefaultValue?(this.putSettingInternal(t,void 0,e,t.persistedDefaultValue),t.persistedDefaultValue):t.defaultValue),A);return t.mapGet?t.mapGet(s):s}getItem(e){return this.getItemInternal(e,this.settings[e])}}},3891:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=3891,e.exports=t},4192:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScryptedMimeTypes=t.ScryptedInterface=t.MediaPlayerState=t.SecuritySystemObstruction=t.SecuritySystemMode=t.AirQuality=t.AirPurifierMode=t.AirPurifierStatus=t.ChargeState=t.LockState=t.PanTiltZoomMovement=t.ThermostatMode=t.TemperatureUnit=t.FanMode=t.HumidityMode=t.ScryptedDeviceType=t.ScryptedInterfaceDescriptors=t.ScryptedInterfaceMethod=t.ScryptedInterfaceProperty=t.DeviceBase=t.TYPES_VERSION=void 0,t.TYPES_VERSION="0.3.108";var A,s,r,n,i,o,a,c,l,h,g,d,u,E,I,Q,C,B;t.DeviceBase=class{},function(e){e.id="id",e.info="info",e.interfaces="interfaces",e.mixins="mixins",e.name="name",e.nativeId="nativeId",e.pluginId="pluginId",e.providedInterfaces="providedInterfaces",e.providedName="providedName",e.providedRoom="providedRoom",e.providedType="providedType",e.providerId="providerId",e.room="room",e.type="type",e.scryptedRuntimeArguments="scryptedRuntimeArguments",e.on="on",e.brightness="brightness",e.colorTemperature="colorTemperature",e.rgb="rgb",e.hsv="hsv",e.buttons="buttons",e.sensors="sensors",e.running="running",e.paused="paused",e.docked="docked",e.temperatureSetting="temperatureSetting",e.temperature="temperature",e.temperatureUnit="temperatureUnit",e.humidity="humidity",e.audioVolumes="audioVolumes",e.recordingActive="recordingActive",e.ptzCapabilities="ptzCapabilities",e.lockState="lockState",e.entryOpen="entryOpen",e.batteryLevel="batteryLevel",e.chargeState="chargeState",e.online="online",e.fromMimeType="fromMimeType",e.toMimeType="toMimeType",e.converters="converters",e.binaryState="binaryState",e.tampered="tampered",e.sleeping="sleeping",e.powerDetected="powerDetected",e.audioDetected="audioDetected",e.motionDetected="motionDetected",e.ambientLight="ambientLight",e.occupied="occupied",e.flooded="flooded",e.ultraviolet="ultraviolet",e.luminance="luminance",e.position="position",e.securitySystemState="securitySystemState",e.pm10Density="pm10Density",e.pm25Density="pm25Density",e.vocDensity="vocDensity",e.noxDensity="noxDensity",e.co2ppm="co2ppm",e.airQuality="airQuality",e.airPurifierState="airPurifierState",e.filterChangeIndication="filterChangeIndication",e.filterLifeLevel="filterLifeLevel",e.humiditySetting="humiditySetting",e.fan="fan",e.applicationInfo="applicationInfo",e.systemDevice="systemDevice"}(A||(t.ScryptedInterfaceProperty=A={})),function(e){e.listen="listen",e.probe="probe",e.setMixins="setMixins",e.setName="setName",e.setRoom="setRoom",e.setType="setType",e.getPluginJson="getPluginJson",e.turnOff="turnOff",e.turnOn="turnOn",e.setBrightness="setBrightness",e.getTemperatureMaxK="getTemperatureMaxK",e.getTemperatureMinK="getTemperatureMinK",e.setColorTemperature="setColorTemperature",e.setRgb="setRgb",e.setHsv="setHsv",e.pressButton="pressButton",e.sendNotification="sendNotification",e.start="start",e.stop="stop",e.pause="pause",e.resume="resume",e.dock="dock",e.setTemperature="setTemperature",e.setTemperatureUnit="setTemperatureUnit",e.getPictureOptions="getPictureOptions",e.takePicture="takePicture",e.getAudioStream="getAudioStream",e.setAudioVolumes="setAudioVolumes",e.startDisplay="startDisplay",e.stopDisplay="stopDisplay",e.getVideoStream="getVideoStream",e.getVideoStreamOptions="getVideoStreamOptions",e.getPrivacyMasks="getPrivacyMasks",e.setPrivacyMasks="setPrivacyMasks",e.getVideoTextOverlays="getVideoTextOverlays",e.setVideoTextOverlay="setVideoTextOverlay",e.getRecordingStream="getRecordingStream",e.getRecordingStreamCurrentTime="getRecordingStreamCurrentTime",e.getRecordingStreamOptions="getRecordingStreamOptions",e.getRecordingStreamThumbnail="getRecordingStreamThumbnail",e.deleteRecordingStream="deleteRecordingStream",e.setRecordingActive="setRecordingActive",e.ptzCommand="ptzCommand",e.getRecordedEvents="getRecordedEvents",e.getVideoClip="getVideoClip",e.getVideoClips="getVideoClips",e.getVideoClipThumbnail="getVideoClipThumbnail",e.removeVideoClips="removeVideoClips",e.setVideoStreamOptions="setVideoStreamOptions",e.startIntercom="startIntercom",e.stopIntercom="stopIntercom",e.lock="lock",e.unlock="unlock",e.addPassword="addPassword",e.getPasswords="getPasswords",e.removePassword="removePassword",e.activate="activate",e.deactivate="deactivate",e.isReversible="isReversible",e.closeEntry="closeEntry",e.openEntry="openEntry",e.getDevice="getDevice",e.releaseDevice="releaseDevice",e.adoptDevice="adoptDevice",e.discoverDevices="discoverDevices",e.createDevice="createDevice",e.getCreateDeviceSettings="getCreateDeviceSettings",e.reboot="reboot",e.getRefreshFrequency="getRefreshFrequency",e.refresh="refresh",e.getMediaStatus="getMediaStatus",e.load="load",e.seek="seek",e.skipNext="skipNext",e.skipPrevious="skipPrevious",e.convert="convert",e.convertMedia="convertMedia",e.getSettings="getSettings",e.putSetting="putSetting",e.armSecuritySystem="armSecuritySystem",e.disarmSecuritySystem="disarmSecuritySystem",e.setAirPurifierState="setAirPurifierState",e.getReadmeMarkdown="getReadmeMarkdown",e.getOauthUrl="getOauthUrl",e.onOauthCallback="onOauthCallback",e.canMixin="canMixin",e.getMixin="getMixin",e.releaseMixin="releaseMixin",e.onRequest="onRequest",e.onConnection="onConnection",e.onPush="onPush",e.run="run",e.eval="eval",e.loadScripts="loadScripts",e.saveScript="saveScript",e.forkInterface="forkInterface",e.trackObjects="trackObjects",e.getDetectionInput="getDetectionInput",e.getObjectTypes="getObjectTypes",e.detectObjects="detectObjects",e.generateObjectDetections="generateObjectDetections",e.getDetectionModel="getDetectionModel",e.setHumidity="setHumidity",e.setFan="setFan",e.startRTCSignalingSession="startRTCSignalingSession",e.createRTCSignalingSession="createRTCSignalingSession",e.getScryptedUserAccessControl="getScryptedUserAccessControl",e.generateVideoFrames="generateVideoFrames",e.connectStream="connectStream",e.getTTYSettings="getTTYSettings"}(s||(t.ScryptedInterfaceMethod=s={})),t.ScryptedInterfaceDescriptors={ScryptedDevice:{name:"ScryptedDevice",methods:["listen","probe","setMixins","setName","setRoom","setType"],properties:["id","info","interfaces","mixins","name","nativeId","pluginId","providedInterfaces","providedName","providedRoom","providedType","providerId","room","type"]},ScryptedPlugin:{name:"ScryptedPlugin",methods:["getPluginJson"],properties:[]},ScryptedPluginRuntime:{name:"ScryptedPluginRuntime",methods:[],properties:["scryptedRuntimeArguments"]},OnOff:{name:"OnOff",methods:["turnOff","turnOn"],properties:["on"]},Brightness:{name:"Brightness",methods:["setBrightness"],properties:["brightness"]},ColorSettingTemperature:{name:"ColorSettingTemperature",methods:["getTemperatureMaxK","getTemperatureMinK","setColorTemperature"],properties:["colorTemperature"]},ColorSettingRgb:{name:"ColorSettingRgb",methods:["setRgb"],properties:["rgb"]},ColorSettingHsv:{name:"ColorSettingHsv",methods:["setHsv"],properties:["hsv"]},Buttons:{name:"Buttons",methods:[],properties:["buttons"]},PressButtons:{name:"PressButtons",methods:["pressButton"],properties:[]},Sensors:{name:"Sensors",methods:[],properties:["sensors"]},Notifier:{name:"Notifier",methods:["sendNotification"],properties:[]},StartStop:{name:"StartStop",methods:["start","stop"],properties:["running"]},Pause:{name:"Pause",methods:["pause","resume"],properties:["paused"]},Dock:{name:"Dock",methods:["dock"],properties:["docked"]},TemperatureSetting:{name:"TemperatureSetting",methods:["setTemperature"],properties:["temperatureSetting"]},Thermometer:{name:"Thermometer",methods:["setTemperatureUnit"],properties:["temperature","temperatureUnit"]},HumiditySensor:{name:"HumiditySensor",methods:[],properties:["humidity"]},Camera:{name:"Camera",methods:["getPictureOptions","takePicture"],properties:[]},Microphone:{name:"Microphone",methods:["getAudioStream"],properties:[]},AudioVolumeControl:{name:"AudioVolumeControl",methods:["setAudioVolumes"],properties:["audioVolumes"]},Display:{name:"Display",methods:["startDisplay","stopDisplay"],properties:[]},VideoCamera:{name:"VideoCamera",methods:["getVideoStream","getVideoStreamOptions"],properties:[]},VideoCameraMask:{name:"VideoCameraMask",methods:["getPrivacyMasks","setPrivacyMasks"],properties:[]},VideoTextOverlays:{name:"VideoTextOverlays",methods:["getVideoTextOverlays","setVideoTextOverlay"],properties:[]},VideoRecorder:{name:"VideoRecorder",methods:["getRecordingStream","getRecordingStreamCurrentTime","getRecordingStreamOptions","getRecordingStreamThumbnail"],properties:["recordingActive"]},VideoRecorderManagement:{name:"VideoRecorderManagement",methods:["deleteRecordingStream","setRecordingActive"],properties:[]},PanTiltZoom:{name:"PanTiltZoom",methods:["ptzCommand"],properties:["ptzCapabilities"]},EventRecorder:{name:"EventRecorder",methods:["getRecordedEvents"],properties:[]},VideoClips:{name:"VideoClips",methods:["getVideoClip","getVideoClips","getVideoClipThumbnail","removeVideoClips"],properties:[]},VideoCameraConfiguration:{name:"VideoCameraConfiguration",methods:["setVideoStreamOptions"],properties:[]},Intercom:{name:"Intercom",methods:["startIntercom","stopIntercom"],properties:[]},Lock:{name:"Lock",methods:["lock","unlock"],properties:["lockState"]},PasswordStore:{name:"PasswordStore",methods:["addPassword","getPasswords","removePassword"],properties:[]},Scene:{name:"Scene",methods:["activate","deactivate","isReversible"],properties:[]},Entry:{name:"Entry",methods:["closeEntry","openEntry"],properties:[]},EntrySensor:{name:"EntrySensor",methods:[],properties:["entryOpen"]},DeviceProvider:{name:"DeviceProvider",methods:["getDevice","releaseDevice"],properties:[]},DeviceDiscovery:{name:"DeviceDiscovery",methods:["adoptDevice","discoverDevices"],properties:[]},DeviceCreator:{name:"DeviceCreator",methods:["createDevice","getCreateDeviceSettings"],properties:[]},Battery:{name:"Battery",methods:[],properties:["batteryLevel"]},Charger:{name:"Charger",methods:[],properties:["chargeState"]},Reboot:{name:"Reboot",methods:["reboot"],properties:[]},Refresh:{name:"Refresh",methods:["getRefreshFrequency","refresh"],properties:[]},MediaPlayer:{name:"MediaPlayer",methods:["getMediaStatus","load","seek","skipNext","skipPrevious"],properties:[]},Online:{name:"Online",methods:[],properties:["online"]},BufferConverter:{name:"BufferConverter",methods:["convert"],properties:["fromMimeType","toMimeType"]},MediaConverter:{name:"MediaConverter",methods:["convertMedia"],properties:["converters"]},Settings:{name:"Settings",methods:["getSettings","putSetting"],properties:[]},BinarySensor:{name:"BinarySensor",methods:[],properties:["binaryState"]},TamperSensor:{name:"TamperSensor",methods:[],properties:["tampered"]},Sleep:{name:"Sleep",methods:[],properties:["sleeping"]},PowerSensor:{name:"PowerSensor",methods:[],properties:["powerDetected"]},AudioSensor:{name:"AudioSensor",methods:[],properties:["audioDetected"]},MotionSensor:{name:"MotionSensor",methods:[],properties:["motionDetected"]},AmbientLightSensor:{name:"AmbientLightSensor",methods:[],properties:["ambientLight"]},OccupancySensor:{name:"OccupancySensor",methods:[],properties:["occupied"]},FloodSensor:{name:"FloodSensor",methods:[],properties:["flooded"]},UltravioletSensor:{name:"UltravioletSensor",methods:[],properties:["ultraviolet"]},LuminanceSensor:{name:"LuminanceSensor",methods:[],properties:["luminance"]},PositionSensor:{name:"PositionSensor",methods:[],properties:["position"]},SecuritySystem:{name:"SecuritySystem",methods:["armSecuritySystem","disarmSecuritySystem"],properties:["securitySystemState"]},PM10Sensor:{name:"PM10Sensor",methods:[],properties:["pm10Density"]},PM25Sensor:{name:"PM25Sensor",methods:[],properties:["pm25Density"]},VOCSensor:{name:"VOCSensor",methods:[],properties:["vocDensity"]},NOXSensor:{name:"NOXSensor",methods:[],properties:["noxDensity"]},CO2Sensor:{name:"CO2Sensor",methods:[],properties:["co2ppm"]},AirQualitySensor:{name:"AirQualitySensor",methods:[],properties:["airQuality"]},AirPurifier:{name:"AirPurifier",methods:["setAirPurifierState"],properties:["airPurifierState"]},FilterMaintenance:{name:"FilterMaintenance",methods:[],properties:["filterChangeIndication","filterLifeLevel"]},Readme:{name:"Readme",methods:["getReadmeMarkdown"],properties:[]},OauthClient:{name:"OauthClient",methods:["getOauthUrl","onOauthCallback"],properties:[]},MixinProvider:{name:"MixinProvider",methods:["canMixin","getMixin","releaseMixin"],properties:[]},HttpRequestHandler:{name:"HttpRequestHandler",methods:["onRequest"],properties:[]},EngineIOHandler:{name:"EngineIOHandler",methods:["onConnection"],properties:[]},PushHandler:{name:"PushHandler",methods:["onPush"],properties:[]},Program:{name:"Program",methods:["run"],properties:[]},Scriptable:{name:"Scriptable",methods:["eval","loadScripts","saveScript"],properties:[]},ClusterForkInterface:{name:"ClusterForkInterface",methods:["forkInterface"],properties:[]},ObjectTracker:{name:"ObjectTracker",methods:["trackObjects"],properties:[]},ObjectDetector:{name:"ObjectDetector",methods:["getDetectionInput","getObjectTypes"],properties:[]},ObjectDetection:{name:"ObjectDetection",methods:["detectObjects","generateObjectDetections","getDetectionModel"],properties:[]},ObjectDetectionPreview:{name:"ObjectDetectionPreview",methods:[],properties:[]},ObjectDetectionGenerator:{name:"ObjectDetectionGenerator",methods:[],properties:[]},HumiditySetting:{name:"HumiditySetting",methods:["setHumidity"],properties:["humiditySetting"]},Fan:{name:"Fan",methods:["setFan"],properties:["fan"]},RTCSignalingChannel:{name:"RTCSignalingChannel",methods:["startRTCSignalingSession"],properties:[]},RTCSignalingClient:{name:"RTCSignalingClient",methods:["createRTCSignalingSession"],properties:[]},LauncherApplication:{name:"LauncherApplication",methods:[],properties:["applicationInfo"]},ScryptedUser:{name:"ScryptedUser",methods:["getScryptedUserAccessControl"],properties:[]},VideoFrameGenerator:{name:"VideoFrameGenerator",methods:["generateVideoFrames"],properties:[]},StreamService:{name:"StreamService",methods:["connectStream"],properties:[]},TTY:{name:"TTY",methods:[],properties:[]},TTYSettings:{name:"TTYSettings",methods:["getTTYSettings"],properties:[]},ScryptedSystemDevice:{name:"ScryptedSystemDevice",methods:[],properties:["systemDevice"]},ScryptedDeviceCreator:{name:"ScryptedDeviceCreator",methods:[],properties:[]},ScryptedSettings:{name:"ScryptedSettings",methods:[],properties:[]}},function(e){e.Builtin="Builtin",e.Camera="Camera",e.Fan="Fan",e.Light="Light",e.Switch="Switch",e.Outlet="Outlet",e.Sensor="Sensor",e.Scene="Scene",e.Program="Program",e.Automation="Automation",e.Vacuum="Vacuum",e.Notifier="Notifier",e.Thermostat="Thermostat",e.Lock="Lock",e.PasswordControl="PasswordControl",e.Display="Display",e.SmartDisplay="SmartDisplay",e.Speaker="Speaker",e.SmartSpeaker="SmartSpeaker",e.Event="Event",e.Entry="Entry",e.Garage="Garage",e.DeviceProvider="DeviceProvider",e.DataSource="DataSource",e.API="API",e.Doorbell="Doorbell",e.Irrigation="Irrigation",e.Valve="Valve",e.Person="Person",e.SecuritySystem="SecuritySystem",e.WindowCovering="WindowCovering",e.Siren="Siren",e.AirPurifier="AirPurifier",e.Unknown="Unknown"}(r||(t.ScryptedDeviceType=r={})),function(e){e.Humidify="Humidify",e.Dehumidify="Dehumidify",e.Auto="Auto",e.Off="Off"}(n||(t.HumidityMode=n={})),function(e){e.Auto="Auto",e.Manual="Manual"}(i||(t.FanMode=i={})),function(e){e.C="C",e.F="F"}(o||(t.TemperatureUnit=o={})),function(e){e.Off="Off",e.Cool="Cool",e.Heat="Heat",e.HeatCool="HeatCool",e.Auto="Auto",e.FanOnly="FanOnly",e.Purifier="Purifier",e.Eco="Eco",e.Dry="Dry",e.On="On"}(a||(t.ThermostatMode=a={})),function(e){e.Absolute="Absolute",e.Relative="Relative",e.Continuous="Continuous",e.Preset="Preset",e.Home="Home"}(c||(t.PanTiltZoomMovement=c={})),function(e){e.Locked="Locked",e.Unlocked="Unlocked",e.Jammed="Jammed"}(l||(t.LockState=l={})),function(e){e.Trickle="trickle",e.Charging="charging",e.NotCharging="not-charging"}(h||(t.ChargeState=h={})),function(e){e.Inactive="Inactive",e.Idle="Idle",e.Active="Active",e.ActiveNightMode="ActiveNightMode"}(g||(t.AirPurifierStatus=g={})),function(e){e.Manual="Manual",e.Automatic="Automatic"}(d||(t.AirPurifierMode=d={})),function(e){e.Unknown="Unknown",e.Excellent="Excellent",e.Good="Good",e.Fair="Fair",e.Inferior="Inferior",e.Poor="Poor"}(u||(t.AirQuality=u={})),function(e){e.Disarmed="Disarmed",e.HomeArmed="HomeArmed",e.AwayArmed="AwayArmed",e.NightArmed="NightArmed"}(E||(t.SecuritySystemMode=E={})),function(e){e.Sensor="Sensor",e.Occupied="Occupied",e.Time="Time",e.Error="Error"}(I||(t.SecuritySystemObstruction=I={})),function(e){e.Idle="Idle",e.Playing="Playing",e.Paused="Paused",e.Buffering="Buffering"}(Q||(t.MediaPlayerState=Q={})),function(e){e.ScryptedDevice="ScryptedDevice",e.ScryptedPlugin="ScryptedPlugin",e.ScryptedPluginRuntime="ScryptedPluginRuntime",e.OnOff="OnOff",e.Brightness="Brightness",e.ColorSettingTemperature="ColorSettingTemperature",e.ColorSettingRgb="ColorSettingRgb",e.ColorSettingHsv="ColorSettingHsv",e.Buttons="Buttons",e.PressButtons="PressButtons",e.Sensors="Sensors",e.Notifier="Notifier",e.StartStop="StartStop",e.Pause="Pause",e.Dock="Dock",e.TemperatureSetting="TemperatureSetting",e.Thermometer="Thermometer",e.HumiditySensor="HumiditySensor",e.Camera="Camera",e.Microphone="Microphone",e.AudioVolumeControl="AudioVolumeControl",e.Display="Display",e.VideoCamera="VideoCamera",e.VideoCameraMask="VideoCameraMask",e.VideoTextOverlays="VideoTextOverlays",e.VideoRecorder="VideoRecorder",e.VideoRecorderManagement="VideoRecorderManagement",e.PanTiltZoom="PanTiltZoom",e.EventRecorder="EventRecorder",e.VideoClips="VideoClips",e.VideoCameraConfiguration="VideoCameraConfiguration",e.Intercom="Intercom",e.Lock="Lock",e.PasswordStore="PasswordStore",e.Scene="Scene",e.Entry="Entry",e.EntrySensor="EntrySensor",e.DeviceProvider="DeviceProvider",e.DeviceDiscovery="DeviceDiscovery",e.DeviceCreator="DeviceCreator",e.Battery="Battery",e.Charger="Charger",e.Reboot="Reboot",e.Refresh="Refresh",e.MediaPlayer="MediaPlayer",e.Online="Online",e.BufferConverter="BufferConverter",e.MediaConverter="MediaConverter",e.Settings="Settings",e.BinarySensor="BinarySensor",e.TamperSensor="TamperSensor",e.Sleep="Sleep",e.PowerSensor="PowerSensor",e.AudioSensor="AudioSensor",e.MotionSensor="MotionSensor",e.AmbientLightSensor="AmbientLightSensor",e.OccupancySensor="OccupancySensor",e.FloodSensor="FloodSensor",e.UltravioletSensor="UltravioletSensor",e.LuminanceSensor="LuminanceSensor",e.PositionSensor="PositionSensor",e.SecuritySystem="SecuritySystem",e.PM10Sensor="PM10Sensor",e.PM25Sensor="PM25Sensor",e.VOCSensor="VOCSensor",e.NOXSensor="NOXSensor",e.CO2Sensor="CO2Sensor",e.AirQualitySensor="AirQualitySensor",e.AirPurifier="AirPurifier",e.FilterMaintenance="FilterMaintenance",e.Readme="Readme",e.OauthClient="OauthClient",e.MixinProvider="MixinProvider",e.HttpRequestHandler="HttpRequestHandler",e.EngineIOHandler="EngineIOHandler",e.PushHandler="PushHandler",e.Program="Program",e.Scriptable="Scriptable",e.ClusterForkInterface="ClusterForkInterface",e.ObjectTracker="ObjectTracker",e.ObjectDetector="ObjectDetector",e.ObjectDetection="ObjectDetection",e.ObjectDetectionPreview="ObjectDetectionPreview",e.ObjectDetectionGenerator="ObjectDetectionGenerator",e.HumiditySetting="HumiditySetting",e.Fan="Fan",e.RTCSignalingChannel="RTCSignalingChannel",e.RTCSignalingClient="RTCSignalingClient",e.LauncherApplication="LauncherApplication",e.ScryptedUser="ScryptedUser",e.VideoFrameGenerator="VideoFrameGenerator",e.StreamService="StreamService",e.TTY="TTY",e.TTYSettings="TTYSettings",e.ScryptedSystemDevice="ScryptedSystemDevice",e.ScryptedDeviceCreator="ScryptedDeviceCreator",e.ScryptedSettings="ScryptedSettings"}(C||(t.ScryptedInterface=C={})),function(e){e.Url="text/x-uri",e.InsecureLocalUrl="text/x-insecure-local-uri",e.LocalUrl="text/x-local-uri",e.ServerId="text/x-server-id",e.PushEndpoint="text/x-push-endpoint",e.SchemePrefix="x-scrypted/x-scrypted-scheme-",e.MediaStreamUrl="text/x-media-url",e.MediaObject="x-scrypted/x-scrypted-media-object",e.RequestMediaObject="x-scrypted/x-scrypted-request-media-object",e.RequestMediaStream="x-scrypted/x-scrypted-request-stream",e.MediaStreamFeedback="x-scrypted/x-media-stream-feedback",e.FFmpegInput="x-scrypted/x-ffmpeg-input",e.FFmpegTranscodeStream="x-scrypted/x-ffmpeg-transcode-stream",e.RTCSignalingChannel="x-scrypted/x-scrypted-rtc-signaling-channel",e.RTCSignalingSession="x-scrypted/x-scrypted-rtc-signaling-session",e.RTCConnectionManagement="x-scrypted/x-scrypted-rtc-connection-management",e.Image="x-scrypted/x-scrypted-image"}(B||(t.ScryptedMimeTypes=B={}))},6125:function(e,t,A){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ReolinkNativeBatteryCamera=void 0;const r=s(A(7562)),n=A(8799),i=A(9560);class o extends n.CommonCameraMixin{isBatteryInfoLoggingEnabled(){return(this.storageSettings.values.debugLogs||[]).includes(i.DebugLogOption.BatteryInfo)}constructor(e,t,A){super(e,t,{type:"battery",nvrDevice:A}),this.plugin=t,this.motionDetected=!1,this.periodicStarted=!1,this.forceNewSnapshot=!1,this.batteryUpdateInProgress=!1}async takePicture(e){if(!this.forceNewSnapshot&&this.lastPicture)return this.console.log(`Returning cached snapshot, taken at ${new Date(this.lastPicture.atMs).toLocaleString()}`),this.lastPicture.mo;if(this.takePictureInFlight)return await this.takePictureInFlight;this.console.log(`Taking new snapshot from camera (forceNewSnapshot: ${this.forceNewSnapshot})`),this.forceNewSnapshot=!1,this.takePictureInFlight=(async()=>{const e=this.storageSettings.values.rtspChannel,t=await this.withBaichuanClient((async t=>await t.getSnapshot(e))),A=await r.default.mediaManager.createMediaObject(t,"image/jpeg");return this.lastPicture={mo:A,atMs:Date.now()},this.console.log(`Snapshot taken at ${new Date(this.lastPicture.atMs).toLocaleString()}`),A})();try{return await this.takePictureInFlight}finally{this.takePictureInFlight=void 0}}async getPictureOptions(){return[]}async init(){this.startPeriodicTasks(),await this.alignAuxDevicesState(),await this.updateBatteryInfo()}async release(){return this.stopPeriodicTasks(),this.resetBaichuanClient()}stopPeriodicTasks(){this.sleepCheckTimer&&(clearInterval(this.sleepCheckTimer),this.sleepCheckTimer=void 0),this.batteryUpdateTimer&&(clearInterval(this.batteryUpdateTimer),this.batteryUpdateTimer=void 0),this.periodicStarted=!1}startPeriodicTasks(){if(this.periodicStarted)return;this.periodicStarted=!0,this.console.log("Starting periodic tasks for battery camera"),this.nvrDevice||(this.sleepCheckTimer=setInterval((async()=>{try{const e=this.baichuanApi,t=this.storageSettings.values.rtspChannel;if(!e)return void(this.sleeping||(this.console.log("Camera is sleeping: no active Baichuan client"),this.sleeping=!0));const A=e.getSleepStatus({channel:t});await this.updateSleepingState(A)}catch(e){this.console.warn("Error checking sleeping state:",e)}}),5e3));const{batteryUpdateIntervalMinutes:e=10}=this.storageSettings.values,t=6e4*e;this.batteryUpdateTimer=setInterval((()=>{this.updateBatteryAndSnapshot().catch((()=>{}))}),t),this.console.log(`Periodic tasks started: sleep check every 5s, battery update every ${e} minutes`)}async updateSleepingState(e){try{if(this.isBatteryInfoLoggingEnabled()&&this.console.log("getSleepStatus result:",JSON.stringify(e)),"sleeping"===e.state)this.sleeping||(this.console.log(`Camera is sleeping: ${e.reason}`),this.sleeping=!0);else if("awake"===e.state){const t=this.sleeping;t&&(this.console.log(`Camera woke up: ${e.reason}`),this.sleeping=!1),t&&(this.alignAuxDevicesState().catch((()=>{})),this.forceNewSnapshot&&this.takePicture().catch((()=>{})))}else this.console.debug(`Sleep status unknown: ${e.reason}`)}catch(e){this.console.debug("Error in checkSleepingState:",e)}}async updateBatteryInfo(){const e=await this.ensureClient(),t=this.storageSettings.values.rtspChannel,A=await e.getBatteryInfo(t);if(this.isBatteryInfoLoggingEnabled()&&this.console.log("getBatteryInfo result:",JSON.stringify(A)),void 0!==A.batteryPercent){const e=this.lastBatteryLevel;if(this.batteryLevel=A.batteryPercent,this.lastBatteryLevel=A.batteryPercent,void 0!==e&&e!==A.batteryPercent)if(void 0!==A.chargeStatus){const t="0"===A.chargeStatus||"2"===A.chargeStatus;this.console.log(`Battery level changed: ${e}% → ${A.batteryPercent}% (charging: ${t})`)}else this.console.log(`Battery level changed: ${e}% → ${A.batteryPercent}%`);else if(void 0===e)if(void 0!==A.chargeStatus){const e="0"===A.chargeStatus||"2"===A.chargeStatus;this.console.log(`Battery level set: ${A.batteryPercent}% (charging: ${e})`)}else this.console.log(`Battery level set: ${A.batteryPercent}%`)}}async updateBatteryAndSnapshot(){if(this.batteryUpdateInProgress)this.console.debug("Battery update already in progress, skipping");else{this.batteryUpdateInProgress=!0;try{const e=this.storageSettings.values.rtspChannel,t=this.storageSettings.values.batteryUpdateIntervalMinutes??10;this.console.log(`Force battery update interval started (every ${t} minutes)`);const A=await this.ensureClient();if(!A)return void this.console.warn("Failed to ensure client connection for battery update");let s=A.getSleepStatus({channel:e});if("sleeping"===s.state){this.console.log("Camera is sleeping, waking up for periodic update...");try{await A.wakeUp(e,{waitAfterWakeMs:2e3}),this.console.log("Wake command sent, waiting for camera to wake up...")}catch(e){return void this.console.warn("Failed to wake up camera:",e)}const t=3e4,r=Date.now();let n=!1;for(;Date.now()-r<t;)if(await new Promise((e=>setTimeout(e,1e3))),s=A.getSleepStatus({channel:e}),"awake"===s.state){n=!0,this.console.log("Camera is now awake"),this.sleeping=!1;break}if(!n)return void this.console.warn("Camera did not wake up within timeout, skipping update")}else"awake"===s.state&&(this.sleeping=!1);try{await this.updateBatteryInfo()}catch(e){this.console.warn("Failed to get battery info during periodic update:",e)}try{await this.alignAuxDevicesState()}catch(e){this.console.warn("Failed to align auxiliary devices state:",e)}try{this.forceNewSnapshot=!0,await this.takePicture(),this.console.log("Snapshot updated during periodic update")}catch(e){this.console.warn("Failed to update snapshot during periodic update:",e)}}catch(e){this.console.warn("Failed to update battery and snapshot",e)}finally{this.batteryUpdateInProgress=!1}}}async resetBaichuanClient(e){try{if(this.unsubscribedToEvents?.(),this.streamManager){const t=e?.message||e?.toString?.()||"connection reset";await this.streamManager.closeAllStreams(t)}await(this.baichuanApi?.close())}catch(e){this.getLogger().warn("Error closing Baichuan client during reset",e)}finally{this.baichuanApi=void 0,this.connectionTime=void 0,this.ensureClientPromise=void 0,this.sleepCheckTimer&&(clearInterval(this.sleepCheckTimer),this.sleepCheckTimer=void 0),this.batteryUpdateTimer&&(clearInterval(this.batteryUpdateTimer),this.batteryUpdateTimer=void 0)}if(e){const t=e?.message||e?.toString?.()||e;this.getLogger().warn(`Baichuan client reset requested: ${t}`)}}async withBaichuanRetry(e){return await e()}async withBaichuanClient(e){return e(await this.ensureClient())}async createStreamClient(){return await this.ensureClient()}}t.ReolinkNativeBatteryCamera=o},4417:function(e,t,A){"use strict";var s,r=this&&this.__createBinding||(Object.create?function(e,t,A,s){void 0===s&&(s=A);var r=Object.getOwnPropertyDescriptor(t,A);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[A]}}),Object.defineProperty(e,s,r)}:function(e,t,A,s){void 0===s&&(s=A),e[s]=t[A]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(s=function(e){return s=Object.getOwnPropertyNames||function(e){var t=[];for(var A in e)Object.prototype.hasOwnProperty.call(e,A)&&(t[t.length]=A);return t},s(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var A=s(e),i=0;i<A.length;i++)"default"!==A[i]&&r(t,e,A[i]);return n(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.ReolinkNativeCamera=t.b64ToMo=t.moToB64=void 0;const o=i(A(7562)),a=A(8799),c=A(5098);t.moToB64=async e=>{const t=await o.default.mediaManager.convertMediaObjectToBuffer(e,"image/jpeg");return t?.toString("base64")};t.b64ToMo=async e=>{const t=Buffer.from(e,"base64");return await o.default.mediaManager.createMediaObject(t,"image/jpeg")};class l extends a.CommonCameraMixin{constructor(e,t,A){super(e,t,{type:"regular",nvrDevice:A}),this.plugin=t,this.initComplete=!1,this.periodicStarted=!1}async resetBaichuanClient(e){try{this.unsubscribedToEvents?.(),await(this.baichuanApi?.close())}catch(e){this.getLogger().warn("Error closing Baichuan client during reset",e)}finally{this.baichuanApi=void 0,this.connectionTime=void 0,this.ensureClientPromise=void 0,this.passiveRefreshTimer&&(clearTimeout(this.passiveRefreshTimer),this.passiveRefreshTimer=void 0)}if(e){const t=e?.message||e?.toString?.()||e;this.getLogger().warn(`Baichuan client reset requested: ${t}`)}}async withBaichuanRetry(e){try{return await e()}catch(t){if(!this.isRecoverableBaichuanError(t))throw t;await this.resetBaichuanClient(t),this.cachedNetPort=void 0;try{return await e()}catch(e){if(this.isRecoverableBaichuanError(e))throw e;throw e}}}getLogger(){return this.console}async init(){this.startPeriodicTasks(),await this.alignAuxDevicesState()}async createStreamClient(){const{ipAddress:e,username:t,password:A}=this.storageSettings.values,s=this.getBaichuanDebugOptions(),r=await(0,c.createBaichuanApi)({inputs:{host:e,username:t,password:A,logger:this.console,debugOptions:s},transport:"tcp",logger:this.console});return await r.login(),r}getClient(){return this.baichuanApi}async release(){return this.statusPollTimer&&clearInterval(this.statusPollTimer),this.passiveRefreshTimer&&(clearTimeout(this.passiveRefreshTimer),this.passiveRefreshTimer=void 0),this.resetBaichuanClient()}startPeriodicTasks(){this.periodicStarted||(this.periodicStarted=!0,this.console.log("Starting periodic tasks for regular camera"),this.statusPollTimer=setInterval((()=>{this.periodic10sTick().catch((()=>{}))}),1e4),this.console.log("Periodic tasks started: status poll every 10s"))}async periodic10sTick(){await this.ensureClient(),await this.alignAuxDevicesState()}async getDetectionInput(e,t){return null}async processEvents(e){const t=this.getLogger();if(this.isEventDispatchEnabled()&&(this.storageSettings.values.dispatchEvents.includes("eventLogs")&&t.debug(`Events received: ${JSON.stringify(e)}`),this.shouldDispatchMotion()&&e.motion!==this.motionDetected&&(e.motion?(this.motionDetected=!0,this.motionTimeout&&clearTimeout(this.motionTimeout),this.motionTimeout=setTimeout((()=>this.motionDetected=!1),1e3*this.storageSettings.values.motionTimeout)):(this.motionDetected=!1,this.motionTimeout&&clearTimeout(this.motionTimeout))),this.shouldDispatchObjects()&&e.objects?.length)){const t={timestamp:Date.now(),detections:[]};for(const A of e.objects)t.detections.push({className:A,score:1});o.default.deviceManager.onDeviceEvent(this.nativeId,o.ScryptedInterface.ObjectDetector,t)}}async withBaichuanClient(e){return e(await this.ensureClient())}async takePicture(e){try{return this.withBaichuanRetry((async()=>{const e=await this.ensureClient(),t=await e.getSnapshot();return await this.createMediaObject(t,"image/jpeg")}))}catch(e){throw this.getLogger().error("Error taking snapshot",e),e}}async getPictureOptions(){return[]}async getOtherSettings(){return await this.getSettings()}showRtspUrlOverride(){return!1}async startIntercom(e){await this.intercom.start(e)}stopIntercom(){return this.intercom.stop()}}t.ReolinkNativeCamera=l},8799:function(e,t,A){"use strict";var s,r=this&&this.__createBinding||(Object.create?function(e,t,A,s){void 0===s&&(s=A);var r=Object.getOwnPropertyDescriptor(t,A);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[A]}}),Object.defineProperty(e,s,r)}:function(e,t,A,s){void 0===s&&(s=A),e[s]=t[A]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(s=function(e){return s=Object.getOwnPropertyNames||function(e){var t=[];for(var A in e)Object.prototype.hasOwnProperty.call(e,A)&&(t[t.length]=A);return t},s(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var A=s(e),i=0;i<A.length;i++)"default"!==A[i]&&r(t,e,A[i]);return n(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.CommonCameraMixin=void 0;const o=i(A(7562)),a=A(6117),c=A(5098),l=A(9560),h=A(5741),g=A(840),d=A(5050),u=A(6185);class E extends o.ScryptedDeviceBase{constructor(e,t){super(t),this.camera=e}async turnOff(){this.camera.getLogger().log(`Siren toggle: turnOff (device=${this.nativeId})`),this.on=!1;try{await this.camera.setSirenEnabled(!1),this.camera.getLogger().log(`Siren toggle: turnOff ok (device=${this.nativeId})`)}catch(e){throw this.camera.getLogger().warn(`Siren toggle: turnOff failed (device=${this.nativeId})`,e),e}}async turnOn(){this.camera.getLogger().log(`Siren toggle: turnOn (device=${this.nativeId})`),this.on=!0;try{await this.camera.setSirenEnabled(!0),this.camera.getLogger().log(`Siren toggle: turnOn ok (device=${this.nativeId})`)}catch(e){throw this.camera.getLogger().warn(`Siren toggle: turnOn failed (device=${this.nativeId})`,e),e}}}class I extends o.ScryptedDeviceBase{constructor(e,t){super(t),this.camera=e}async setBrightness(e){this.camera.getLogger().log(`Floodlight toggle: setBrightness (device=${this.nativeId} brightness=${e})`),this.brightness=e;try{await this.camera.setFloodlightState(void 0,e),this.camera.getLogger().log(`Floodlight toggle: setBrightness ok (device=${this.nativeId} brightness=${e})`)}catch(t){throw this.camera.getLogger().warn(`Floodlight toggle: setBrightness failed (device=${this.nativeId} brightness=${e})`,t),t}}async turnOff(){this.camera.getLogger().log(`Floodlight toggle: turnOff (device=${this.nativeId})`),this.on=!1;try{await this.camera.setFloodlightState(!1),this.camera.getLogger().log(`Floodlight toggle: turnOff ok (device=${this.nativeId})`)}catch(e){throw this.camera.getLogger().warn(`Floodlight toggle: turnOff failed (device=${this.nativeId})`,e),e}}async turnOn(){this.camera.getLogger().log(`Floodlight toggle: turnOn (device=${this.nativeId})`),this.on=!0;try{await this.camera.setFloodlightState(!0),this.camera.getLogger().log(`Floodlight toggle: turnOn ok (device=${this.nativeId})`)}catch(e){throw this.camera.getLogger().warn(`Floodlight toggle: turnOn failed (device=${this.nativeId})`,e),e}}}class Q extends o.ScryptedDeviceBase{constructor(e,t){super(t),this.camera=e,this.storageSettings=new a.StorageSettings(this,{sensitive:{title:"PIR Sensitivity",description:"Detection sensitivity/threshold (higher = more sensitive)",type:"number",defaultValue:50,range:[0,100]},reduceAlarm:{title:"Reduce False Alarms",description:"Enable reduction of false alarm rate",type:"boolean",defaultValue:!1},interval:{title:"PIR Detection Interval",description:"Detection interval in seconds",type:"number",defaultValue:5,range:[1,60]}})}async getSettings(){return this.storageSettings.getSettings()}async putSetting(e,t){await this.storageSettings.putSetting(e,t);const A=this.camera.storageSettings.values.rtspChannel,s=this.on?1:0,r=this.storageSettings.values.sensitive,n=this.storageSettings.values.reduceAlarm?1:0,i=this.storageSettings.values.interval;await this.camera.withBaichuanRetry((async()=>{const e=await this.camera.ensureClient();await e.setPirInfo(A,{enable:s,sensitive:r,reduceAlarm:n,interval:i})}))}async turnOff(){this.on=!1,await this.updatePirSettings()}async turnOn(){this.on=!0,await this.updatePirSettings()}async updatePirSettings(){const e=this.camera.storageSettings.values.rtspChannel,t=this.on?1:0,A=this.storageSettings.values.sensitive,s=this.storageSettings.values.reduceAlarm?1:0,r=this.storageSettings.values.interval;await this.camera.withBaichuanRetry((async()=>{const n=await this.camera.ensureClient();await n.setPirInfo(e,{enable:t,sensitive:A,reduceAlarm:s,interval:r})}))}}class C extends o.ScryptedDeviceBase{constructor(e,t,A){super(e),this.plugin=t,this.options=A,this.storageSettings=new a.StorageSettings(this,{ipAddress:{title:"IP Address",type:"string",onPut:async()=>{await this.credentialsChanged()}},username:{type:"string",title:"Username",onPut:async()=>{await this.credentialsChanged()}},password:{type:"password",title:"Password",onPut:async()=>{await this.credentialsChanged()}},rtspChannel:{type:"number",hide:!0,defaultValue:0},capabilities:{json:!0,hide:!0},uid:{title:"UID",description:"Reolink UID (required for battery cameras / BCUDP).",type:"string",hide:!0,onPut:async()=>{await this.credentialsChanged()}},isFromNvr:{type:"boolean",hide:!0,defaultValue:!1},mixinsSetup:{type:"boolean",hide:!0},batteryUpdateIntervalMinutes:{title:"Battery Update Interval (minutes)",subgroup:"Advanced",description:"How often to wake up the camera and update battery status and snapshot (default: 60 minutes).",type:"number",defaultValue:60,hide:!0},dispatchEvents:{subgroup:"Advanced",title:"Dispatch Events",description:"Select which events to emit. Empty disables event subscription entirely.",multiple:!0,combobox:!0,immediate:!0,defaultValue:["motion","objects"],choices:["motion","objects"],onPut:async()=>{await this.subscribeToEvents()}},debugLogs:{subgroup:"Advanced",title:"Debug Logs",description:"Enable specific debug logs. Baichuan client logs require reconnect; event logs are immediate.",multiple:!0,combobox:!0,immediate:!0,defaultValue:[],choices:(0,l.getDebugLogChoices)(),onPut:async(e,t)=>{const A=(0,l.getApiRelevantDebugLogs)(e||[]),s=(0,l.getApiRelevantDebugLogs)(t||[]),r=new Set(A),n=new Set(s);(r.size!==n.size||Array.from(r).some((e=>!n.has(e))))&&this.resetBaichuanClient&&(this.debugLogsResetTimeout&&(clearTimeout(this.debugLogsResetTimeout),this.debugLogsResetTimeout=void 0),this.debugLogsResetTimeout=setTimeout((async()=>{this.debugLogsResetTimeout=void 0;try{await this.resetBaichuanClient("debugLogs changed"),this.baichuanApi=void 0,this.ensureClientPromise=void 0,await this.ensureClient()}catch(e){this.getLogger().warn("Failed to reset client after debug logs change",e)}}),2e3))}},motionTimeout:{subgroup:"Advanced",title:"Motion Timeout",defaultValue:20,type:"number"},cachedOsd:{multiple:!0,hide:!0,json:!0,defaultValue:[]},intercomBlocksPerPayload:{subgroup:"Advanced",title:"Intercom Blocks Per Payload",description:"Lower reduces latency (more packets). Typical: 1-4. Requires restarting talk session to take effect.",type:"number",defaultValue:1},presets:{group:"PTZ",title:"Presets to enable",description:'PTZ Presets in the format "id=name". Where id is the PTZ Preset identifier and name is a friendly name.',multiple:!0,defaultValue:[],combobox:!0,hide:!0,onPut:async(e,t)=>{const A={...this.ptzCapabilities||{},presets:{}};for(const e of t){const[t,s]=e.split("=");A.presets[t]=s}this.ptzCapabilities=A},mapGet:()=>{const e=this.ptzCapabilities?.presets||{};return Object.entries(e).map((([e,t])=>e+"="+t))}},ptzMoveDurationMs:{title:"PTZ Move Duration (ms)",description:"How long a PTZ command moves before sending stop. Higher = more movement per click.",type:"number",defaultValue:300,group:"PTZ",hide:!0},ptzZoomStep:{group:"PTZ",title:"PTZ Zoom Step",description:"How much to change zoom per zoom command (in zoom factor units, where 1.0 is normal).",type:"number",defaultValue:.1,hide:!0},ptzCreatePreset:{group:"PTZ",title:"Create Preset",description:"Enter a name and press Save to create a new PTZ preset at the current position.",type:"string",placeholder:"e.g. Door",defaultValue:"",hide:!0,onPut:async(e,t)=>{const A=String(t??"").trim();if(!A)return void(""!==String(t??"")&&(this.storageSettings.values.ptzCreatePreset=""));const s=this.getLogger();s.log(`PTZ presets: create preset requested (name=${A})`);const r=await this.withBaichuanRetry((async()=>{if(await this.ensureClient(),!this.ptzPresets)throw new Error("PTZ presets not available");return await this.ptzPresets.createPtzPreset(A)})),n=`${r.id}=${r.name}`;this.storageSettings.values.ptzSelectedPreset=n,this.storageSettings.values.ptzCreatePreset="",s.log(`PTZ presets: created preset id=${r.id} name=${r.name}`)}},ptzSelectedPreset:{group:"PTZ",title:"Selected Preset",description:'Select the preset to update or delete. Format: "id=name".',type:"string",combobox:!1,immediate:!0,hide:!0},ptzUpdateSelectedPreset:{group:"PTZ",title:"Update Selected Preset Position",description:"Overwrite the selected preset with the current PTZ position.",type:"button",immediate:!0,hide:!0,onPut:async()=>{const e=this.getSelectedPresetId();if(void 0===e)throw new Error("No preset selected");const t=this.getLogger();t.log(`PTZ presets: update position requested (presetId=${e})`),await this.withBaichuanRetry((async()=>(await this.ensureClient(),await this.ptzPresets.updatePtzPresetToCurrentPosition(e)))),t.log(`PTZ presets: update position ok (presetId=${e})`)}},ptzDeleteSelectedPreset:{group:"PTZ",title:"Delete Selected Preset",description:"Delete the selected preset (firmware dependent).",type:"button",immediate:!0,hide:!0,onPut:async()=>{const e=this.getSelectedPresetId();if(void 0===e)throw new Error("No preset selected");const t=this.getLogger();t.log(`PTZ presets: delete requested (presetId=${e})`),await this.withBaichuanRetry((async()=>(await this.ensureClient(),await this.ptzPresets.deletePtzPreset(e)))),this.storageSettings.values.ptzSelectedPreset="",t.log(`PTZ presets: delete ok (presetId=${e})`)}}}),this.ptzPresets=new g.ReolinkPtzPresets(this),this.refreshingState=!1,this.classes=[],this.presets=[],this.fetchingStreams=!1,this.lastNetPortCacheAttempt=0,this.netPortCacheBackoffMs=5e3,this.onSimpleEvent=e=>{try{const t=this.getLogger();if(this.isEventLogsEnabled()&&t.log(`Baichuan event: ${JSON.stringify(e)}`),!this.isEventDispatchEnabled())return void(this.isEventLogsEnabled()&&t.debug("Event dispatch is disabled, ignoring event"));const A=this.storageSettings.values.rtspChannel;if(void 0!==e?.channel&&e.channel!==A)return void(this.isEventLogsEnabled()&&t.debug(`Event channel ${e.channel} does not match camera channel ${A}, ignoring`));const s=[];let r=!1;switch(e?.type){case"motion":r=!0,this.isEventLogsEnabled()&&t.log("Motion event received (may be PIR or MD)");break;case"doorbell":this.handleDoorbellEvent(),r=!0;break;case"people":case"vehicle":case"animal":case"face":case"package":case"other":this.shouldDispatchObjects()&&s.push(e.type),r=!0;break;default:return void(this.isEventLogsEnabled()&&t.debug(`Unknown event type: ${e?.type}`))}this.processEvents({motion:r,objects:s}).catch((e=>{t.warn("Error processing events",e)}))}catch(e){this.getLogger().warn("Error in onSimpleEvent handler",e)}},this.protocol=A.nvrDevice||"battery"!==A.type?"tcp":"udp",this.nvrDevice=A.nvrDevice,setTimeout((async()=>{await this.parentInit()}),2e3)}createStreamClient(){throw new Error("Method not implemented.")}getAbilities(){return this.storageSettings.values.capabilities}getLogger(){return this.console}getBaichuanDebugOptions(){const e=this.storageSettings.values.debugLogs||[];return(0,l.convertDebugLogsToApiOptions)(e)}isRecoverableBaichuanError(e){const t=e?.message||e?.toString?.()||"";return"string"==typeof t&&(t.includes("Baichuan socket closed")||t.includes("Baichuan UDP stream closed")||t.includes("Baichuan TCP socket is not connected")||t.includes("socket hang up")||t.includes("ECONNRESET")||t.includes("EPIPE"))}updatePtzCaps(){const{hasPan:e,hasTilt:t,hasZoom:A}=this.getAbilities();this.ptzCapabilities={...this.ptzCapabilities,pan:e,tilt:t,zoom:A}}unsubscribedToEvents(){const e=this.baichuanApi;if(e){try{e.offSimpleEvent(this.onSimpleEvent)}catch{}this.motionDetected&&(this.motionDetected=!1)}}async subscribeToEvents(){if(this.nvrDevice)return;const e=this.getLogger(),t=Array.from(this.getDispatchEventsSelection?.()??new Set).sort(),A=t.length>0;e.log(`subscribeToEvents called: enabled=${A}, selection=[${t.join(", ")}], protocol=${this.protocol}`),this.unsubscribedToEvents();if(t.includes("motion")||(this.motionTimeout&&clearTimeout(this.motionTimeout),this.motionDetected=!1),!A)return e.log("Event subscription disabled, unsubscribing"),this.doorbellBinaryTimeout&&(clearTimeout(this.doorbellBinaryTimeout),this.doorbellBinaryTimeout=void 0),void(this.binaryState=!1);const s=await this.ensureClient();try{await s.onSimpleEvent(this.onSimpleEvent),e.log(`Subscribed to events (${t.join(", ")}) on ${this.protocol} connection`)}catch(t){return void e.warn("Failed to attach Baichuan event handler",t)}}async getVideoTextOverlays(){const e=await this.ensureClient(),t=this.storageSettings.values.rtspChannel;let A=this.storageSettings.values.cachedOsd;return A?.length||(A=await e.getOsd(t),this.storageSettings.values.cachedOsd=A),{osdChannel:{text:A?.osdChannel?.enable?A.osdChannel.name:void 0},osdTime:{text:!!A?.osdTime?.enable,readonly:!0}}}async setVideoTextOverlay(e,t){const A=await this.ensureClient(),s=this.storageSettings.values.rtspChannel,r=await A.getOsd(s);if("osdChannel"===e){const e="string"==typeof t?.text?t.text.trim():"",A=!!e||!0===t?.text;r.osdChannel.enable=A?1:0,A&&(r.osdChannel.name=e||r.osdChannel.name||this.name||"Camera")}else{if("osdTime"!==e)throw new Error("unknown overlay: "+e);r.osdTime.enable=t?.text?1:0}await A.setOsd(s,r)}async ptzCommand(e){const t=await this.ensureClient();if(!t)return;const A=this.storageSettings.values.rtspChannel,s=e.preset;if(null!=s){const e=Number(s);return Number.isFinite(e)?void(this.ptzPresets?await this.ptzPresets.moveToPreset(e):this.getLogger().warn("PTZ presets not available")):void this.getLogger().warn(`Invalid PTZ preset id: ${s}`)}let r="start",n="Left";if(void 0!==e.pan)0===e.pan?(r="stop",n="Left"):(n=e.pan>0?"Right":"Left",r="start");else if(void 0!==e.tilt)0===e.tilt?(r="stop",n="Up"):(n=e.tilt>0?"Up":"Down",r="start");else if(void 0!==e.zoom){const s=Number(e.zoom);if(!Number.isFinite(s)||0===s)return;const r=Number(this.storageSettings.values.ptzZoomStep);if(!Number.isFinite(r)||r<=0)return void this.getLogger().warn("Invalid PTZ zoom step, using default 0.1");const n=await t.getZoomFocus(A);if(!n?.zoom)return void this.getLogger().warn("Zoom command requested but camera did not report zoom support.");const i=(n.zoom.curPos??1e3)/1e3,o=(n.zoom.minPos??1e3)/1e3,a=(n.zoom.maxPos??1e3)/1e3,c=r,l=s>0?1:-1,h=Math.min(a,Math.max(o,i+l*c));return void await t.zoomToFactor(A,h)}const i={action:r,command:n,speed:"number"==typeof e.speed?e.speed:32,autoStopMs:Number(this.storageSettings.values.ptzMoveDurationMs)||500};await t.ptz(A,i)}async getObjectTypes(){return{classes:this.classes}}async getDetectionInput(e,t){return null}getDispatchEventsSelection(){return new Set(this.storageSettings.values.dispatchEvents)}isEventDispatchEnabled(){return this.getDispatchEventsSelection().size>0}shouldDispatchMotion(){return this.getDispatchEventsSelection().has("motion")}shouldDispatchObjects(){return this.getDispatchEventsSelection().has("objects")}async processEvents(e){if(!(this.isEventDispatchEnabled?.()??!0))return;const t=this.getDispatchEventsSelection?.()??new Set(["motion","objects"]),A=t.has("motion"),s=t.has("objects");if(A&&void 0!==e.motion){const t=e.motion;if(t!==this.motionDetected)if(this.motionDetected=t,t){this.motionTimeout&&clearTimeout(this.motionTimeout);const e=1e3*(this.storageSettings.values.motionTimeout||30);this.motionTimeout=setTimeout((()=>{this.motionDetected=!1}),e)}else this.motionTimeout&&clearTimeout(this.motionTimeout)}if(s&&e.objects?.length){const t={timestamp:Date.now(),detections:[]};for(const A of e.objects)t.detections.push({className:A,score:1});this.nativeId&&o.default.deviceManager.onDeviceEvent(this.nativeId,o.ScryptedInterface.ObjectDetector,t)}}isEventLogsEnabled(){return(this.storageSettings.values.debugLogs||[]).includes(l.DebugLogOption.EventLogs)}handleDoorbellEvent(){this.doorbellBinaryTimeout||(this.binaryState=!0,this.doorbellBinaryTimeout=setTimeout((()=>{this.binaryState=!1,this.doorbellBinaryTimeout=void 0}),5e3))}clearDoorbellBinary(){this.doorbellBinaryTimeout&&(clearTimeout(this.doorbellBinaryTimeout),this.doorbellBinaryTimeout=void 0),this.binaryState=!1}async reportDevices(){if(!this.nativeId||!this.name)return;const{hasSiren:e,hasFloodlight:t,hasPir:A}=this.getAbilities(),s=[];if(e){const e=`${this.nativeId}-siren`;s.push({providerNativeId:this.plugin?.nativeId,name:`${this.name} Siren`,nativeId:e,info:{...this.info||{}},interfaces:[o.ScryptedInterface.OnOff,o.ScryptedInterface.Settings],type:o.ScryptedDeviceType.Siren})}if(t){const e=`${this.nativeId}-floodlight`;s.push({providerNativeId:this.plugin?.nativeId,name:`${this.name} Floodlight`,nativeId:e,info:{...this.info||{}},interfaces:[o.ScryptedInterface.OnOff,o.ScryptedInterface.Settings],type:o.ScryptedDeviceType.Light})}if(A){const e=`${this.nativeId}-pir`;s.push({providerNativeId:this.plugin?.nativeId,name:`${this.name} PIR`,nativeId:e,info:{...this.info||{}},interfaces:[o.ScryptedInterface.OnOff,o.ScryptedInterface.Settings],type:o.ScryptedDeviceType.Switch})}o.default.deviceManager.onDevicesChanged({providerNativeId:this.nativeId,devices:s})}async getSettings(){return await this.storageSettings.getSettings()}async putSetting(e,t){await this.storageSettings.putSetting(e,t)}async startIntercom(e){if(!this.intercom)throw new Error("Intercom not initialized");await this.intercom.start(e)}async stopIntercom(){if(this.intercom)return await this.intercom.stop();throw new Error("Intercom not initialized")}async updateDeviceInfo(){const e=this.storageSettings.values.ipAddress;try{const t=await this.ensureClient(),A=await t.getInfo(this.storageSettings.values.rtspChannel),s=this.info||{};s.ip=e,s.serialNumber=A?.serialNumber||A?.itemNo,s.firmware=A?.firmwareVersion||A?.firmVer,s.version=A?.hardwareVersion||A?.boardInfo,s.model=A?.type||A?.typeInfo,s.manufacturer="Reolink",s.managementUrl=`http://${e}`,this.info=s}catch(t){const A=this.info||{};A.ip=e,A.manufacturer="Reolink native",A.managementUrl=`http://${e}`,this.info=A,this.getLogger().warn("Failed to fetch device info",t)}}async getDevice(e){return e.endsWith("-siren")?(this.siren||=new E(this,e),this.siren):e.endsWith("-floodlight")?(this.floodlight||=new I(this,e),this.floodlight):e.endsWith("-pir")?(this.pirSensor||=new Q(this,e),this.pirSensor):void 0}async releaseDevice(e,t){t.endsWith("-siren")?this.siren=void 0:t.endsWith("-floodlight")?this.floodlight=void 0:t.endsWith("-pir")&&(this.pirSensor=void 0)}async setSirenEnabled(e){const t=this.storageSettings.values.rtspChannel;await this.withBaichuanRetry((async()=>{const A=await this.ensureClient();return await A.setSiren(t,e)}))}async setFloodlightState(e,t){const A=this.storageSettings.values.rtspChannel;await this.withBaichuanRetry((async()=>{const s=await this.ensureClient();return await s.setWhiteLedState(A,e,t)}))}async setPirEnabled(e){const t=this.storageSettings.values.rtspChannel;let A,s,r;this.pirSensor&&(A=this.pirSensor.storageSettings.values.sensitive,s=this.pirSensor.storageSettings.values.reduceAlarm?1:0,r=this.pirSensor.storageSettings.values.interval),await this.withBaichuanRetry((async()=>{const n=await this.ensureClient();return await n.setPirInfo(t,{enable:e?1:0,...void 0!==A?{sensitive:A}:{},...void 0!==s?{reduceAlarm:s}:{},...void 0!==r?{interval:r}:{}})}))}async alignAuxDevicesState(){const e=this.baichuanApi;if(!e)return;const t=this.storageSettings.values.rtspChannel,{hasSiren:A,hasFloodlight:s,hasPir:r}=this.getAbilities();try{if(A&&this.siren)try{const A=await e.getSiren(t);this.siren.on=A.enabled}catch(e){this.getLogger().debug("Failed to align siren state",e)}if(s&&this.floodlight)try{const A=await e.getWhiteLedState(t);this.floodlight.on=!!A.enabled,void 0!==A.brightness&&(this.floodlight.brightness=A.brightness)}catch(e){this.getLogger().debug("Failed to align floodlight state",e)}if(r&&this.pirSensor)try{const A=await e.getPirInfo(t);this.pirSensor.on=A.enabled,A.state&&(void 0!==A.state.sensitive&&(this.pirSensor.storageSettings.values.sensitive=A.state.sensitive),void 0!==A.state.reduceAlarm&&(this.pirSensor.storageSettings.values.reduceAlarm=!!A.state.reduceAlarm),void 0!==A.state.interval&&(this.pirSensor.storageSettings.values.interval=A.state.interval))}catch(e){this.getLogger().debug("Failed to align PIR state",e)}}catch(e){this.getLogger().debug("Failed to align auxiliary devices state",e)}}addRtspCredentials(e){const{username:t,password:A}=this.storageSettings.values;if(!t)return e;try{const s=new URL(e);if("rtmp:"===s.protocol){const e=s.searchParams;e.set("user",t),e.set("password",A||"")}else s.username=t,s.password=A||"";return s.toString()}catch(t){return this.getLogger().warn("Failed to parse URL for credentials",t),e}}getRtspAddress(){const{ipAddress:e}=this.storageSettings.values;return`${e}:${this.cachedNetPort?.rtsp?.port??554}`}getRtmpAddress(){const{ipAddress:e}=this.storageSettings.values;return`${e}:${this.cachedNetPort?.rtmp?.port??1935}`}async ensureNetPortCache(){if(this.cachedNetPort)return;const e=Date.now();if(e-this.lastNetPortCacheAttempt<this.netPortCacheBackoffMs)this.cachedNetPort={rtsp:{port:554,enable:1},rtmp:{port:1935,enable:1}};else{this.lastNetPortCacheAttempt=e;try{const e=await this.ensureClient();this.cachedNetPort=await e.getNetPort()}catch(e){this.isRecoverableBaichuanError?.(e)||this.getLogger().warn("Failed to get net port, using defaults",e),this.cachedNetPort={rtsp:{port:554,enable:1},rtmp:{port:1935,enable:1}}}}}async getVideoStreamOptions(){const e=this.getLogger();if(this.cachedVideoStreamOptions?.length)return this.cachedVideoStreamOptions;if(this.fetchingStreams)return[];this.fetchingStreams=!0;let t=[];const A=await this.ensureClient(),{ipAddress:s,rtspChannel:r,isFromNvr:n}=this.storageSettings.values;try{await this.ensureNetPortCache()}catch(t){this.isRecoverableBaichuanError?.(t)||e.warn("Failed to ensure net port cache, falling back to Native",t)}try{t=await(0,d.buildVideoStreamOptionsFromRtspRtmp)({client:A,ipAddress:s,cachedNetPort:this.cachedNetPort,isFromNvr:n,rtspChannel:r,logger:e})}catch(t){this.isRecoverableBaichuanError?.(t)||e.warn("Failed to build RTSP/RTMP stream options, falling back to Native",t),this.cachedNetPort=void 0}if(t.length)return e.log("Fetched video stream options",{streams:t,netPort:this.cachedNetPort}),this.cachedVideoStreamOptions=t,t;this.fetchingStreams=!1}async getVideoStream(e){if(!e)throw new Error("video streams not set up or no longer exists.");const t=await this.getVideoStreamOptions(),A=(0,d.selectStreamOption)(t,e);if(!(0,d.isNativeStreamId)(A.id)&&A.url&&("rtsp"===A.container||"rtmp"===A.container)){const e=this.addRtspCredentials(A.url),t={container:A.container,url:e,mediaStreamOptions:A};return await this.createMediaObject(t,o.ScryptedMimeTypes.MediaStreamUrl)}if(!this.streamManager)throw new Error("StreamManager not initialized");const s=(0,d.parseStreamProfileFromId)(A.id)||"main",r=this.storageSettings.values.rtspChannel,n=`${r}_${s}`,i=(0,d.expectedVideoTypeFromUrlMediaStreamOptions)(A);return await this.withBaichuanRetry((async()=>await(0,d.createRfc4571MediaObjectFromStreamManager)({streamManager:this.streamManager,channel:r,profile:s,streamKey:n,expectedVideoType:i,selected:A,sourceId:this.id,onDetectedCodec:e=>{const t=`native_${s}`,A=`Native ${s}`,r=(this.cachedVideoStreamOptions??[]).filter((e=>e.id!==t));r.push({name:A,id:t,container:"rtp",video:{codec:e},url:""}),this.cachedVideoStreamOptions=r}})))}async ensureClient(){if(this.baichuanApi&&this.baichuanApi.client.isSocketConnected()&&this.baichuanApi.client.loggedIn)return this.baichuanApi;if(this.ensureClientPromise)return await this.ensureClientPromise;this.ensureClientPromise=(async()=>{const{ipAddress:e,username:t,password:A,uid:s}=this.storageSettings.values;if(this.baichuanApi){if(this.baichuanApi.client.isSocketConnected()){if(this.isEventDispatchEnabled?.()&&this.onSimpleEvent)try{this.baichuanApi.offSimpleEvent(this.onSimpleEvent),this.baichuanApi.onSimpleEvent(this.onSimpleEvent)}catch{}return this.connectionTime=Date.now(),this.baichuanApi}try{this.onSimpleEvent&&this.baichuanApi.offSimpleEvent(this.onSimpleEvent)}catch{}try{await this.baichuanApi.close()}catch{}}const r=this.getBaichuanDebugOptions(),n="udp"===this.protocol?(0,c.normalizeUid)(s):void 0;if("udp"===this.protocol&&!n)throw new Error("UID is required for battery cameras (BCUDP)");const i=await(0,c.createBaichuanApi)({inputs:{host:e,username:t,password:A,uid:n,logger:this.console,debugOptions:r},transport:this.protocol,logger:this.console});if(await i.login(),!i.client.isSocketConnected())throw new Error("Socket not connected after login");if(this.baichuanApi=i,this.connectionTime=Date.now(),this.isEventDispatchEnabled?.()&&this.onSimpleEvent)try{i.onSimpleEvent(this.onSimpleEvent)}catch{}return i})();try{return await this.ensureClientPromise}finally{this.ensureClientPromise=void 0}}async credentialsChanged(){this.cachedVideoStreamOptions=void 0,this.cachedNetPort=void 0}getSelectedPresetId(){const e=this.storageSettings.values.ptzSelectedPreset;if(!e)return;const t=e.includes("=")?e.split("=")[0]:e,A=Number(t);return Number.isFinite(A)?A:void 0}async refreshDeviceState(){if(this.refreshingState)return;this.refreshingState=!0;const e=this.getLogger(),t=this.storageSettings.values.rtspChannel;try{const{capabilities:A,abilities:s,support:r,presets:n,objects:i}=await this.withBaichuanRetry((async()=>{const e=await this.ensureClient();return await e.getDeviceCapabilities(t)}));this.classes=i,this.presets=n,this.storageSettings.values.capabilities=A,this.ptzPresets.setCachedPtzPresets(n);try{const{interfaces:t,type:s}=(0,u.getDeviceInterfaces)({capabilities:A,logger:this.console}),r={nativeId:this.nativeId,providerNativeId:this.nvrDevice?.nativeId??this.plugin?.nativeId,name:this.name,interfaces:t,type:s,info:this.info};e.log(`Updating device interfaces: ${JSON.stringify(r)}`),await o.default.deviceManager.onDeviceDiscovered(r)}catch(t){e.error("Failed to update device interfaces",t)}this.console.log(`Refreshed device capabilities: ${JSON.stringify({capabilities:A,abilities:s,support:r,presets:n})}`)}catch(t){e.error("Failed to refresh abilities",t)}this.refreshingState=!1}async parentInit(){const e=this.getLogger();try{await this.ensureClient(),await this.updateDeviceInfo()}catch(t){e.warn("Failed to update device info during init",t)}try{await this.refreshDeviceState()}catch(t){e.warn("Failed to connect/refresh during init",t)}try{await this.reportDevices()}catch(t){e.warn("Failed to report devices during init",t)}const{hasIntercom:t,hasPtz:A}=this.getAbilities();if(t&&(this.intercom=new h.ReolinkBaichuanIntercom(this)),A){const e=(this.presets||[]).map((e=>e.id+"="+e.name));this.storageSettings.settings.presets.choices=e,this.storageSettings.settings.ptzSelectedPreset.choices=e,this.storageSettings.settings.presets.hide=!1,this.storageSettings.settings.ptzMoveDurationMs.hide=!1,this.storageSettings.settings.ptzZoomStep.hide=!1,this.storageSettings.settings.ptzCreatePreset.hide=!1,this.storageSettings.settings.ptzSelectedPreset.hide=!1,this.storageSettings.settings.ptzUpdateSelectedPreset.hide=!1,this.storageSettings.settings.ptzDeleteSelectedPreset.hide=!1,this.updatePtzCaps()}const s="battery"===this.options.type,{username:r,password:n}=this.storageSettings.values;if(this.streamManager=new d.StreamManager({createStreamClient:()=>this.createStreamClient(),getLogger:()=>this.getLogger(),credentials:{username:r,password:n},sharedConnection:s}),this.storageSettings.settings.uid.hide=!s,this.storageSettings.settings.batteryUpdateIntervalMinutes.hide=!s,s&&!this.storageSettings.values.mixinsSetup)try{const t=o.default.systemManager.getDeviceById(this.id);t&&(e.log("Disabling prebuffer and snapshots from prebuffer"),await t.putSetting("prebuffer:enabledStreams","[]"),await t.putSetting("snapshot:snapshotsFromPrebuffer","Disabled"),this.storageSettings.values.mixinsSetup=!0)}catch(t){e.warn("Failed to setup mixins during init",t)}try{await this.subscribeToEvents()}catch(t){e.warn("Failed to subscribe to Baichuan events",t)}const{isFromNvr:i}=this.storageSettings.values;i&&this.nvrDevice&&(this.storageSettings.settings.username.hide=!0,this.storageSettings.settings.password.hide=!0,this.storageSettings.settings.ipAddress.hide=!0,this.storageSettings.settings.uid.hide=!0,this.storageSettings.settings.username.defaultValue=this.nvrDevice.storageSettings.values.username,this.storageSettings.settings.password.defaultValue=this.nvrDevice.storageSettings.values.password,this.storageSettings.settings.ipAddress.defaultValue=this.nvrDevice.storageSettings.values.ipAddress),await this.init(),this.initComplete=!0}}t.CommonCameraMixin=C},5098:(e,t,A)=>{"use strict";function s(e){const t=e?.trim();return t||void 0}function r(e){const t=e?.message||e?.toString?.()||"";return"string"==typeof t&&(t.includes("ECONNREFUSED")||t.includes("ETIMEDOUT")||t.includes("EHOSTUNREACH")||t.includes("ENETUNREACH")||t.includes("socket hang up")||t.includes("TCP connection timeout")||t.includes("Baichuan socket closed"))}async function n(e){const{inputs:t,transport:r,logger:n}=e,{ReolinkBaichuanApi:i}=await Promise.resolve().then(A.bind(A,5024)),o={host:t.host,username:t.username,password:t.password,logger:t.logger,debugOptions:t.debugOptions??{}},a=e=>{try{e.client.on("error",(e=>{const A=t.logger;if(!A)return;const s=e?.message||e?.toString?.()||String(e);"string"==typeof s&&(s.includes("Baichuan socket closed")||s.includes("Baichuan UDP stream closed")||s.includes("Not running"))||A.error(`[BaichuanClient] error (${r}) ${t.host}: ${s}`)})),e.client.on("close",(()=>{}))}catch{}};if("tcp"===r){const e=new i({...o,transport:"tcp"});return a(e),e}const c=s(t.uid);if(!c)throw new Error("UID is required for battery cameras (BCUDP)");const l=new i({...o,transport:"udp",uid:c,idleDisconnect:!0});return a(l),l}Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeUid=s,t.maskUid=function(e){const t=e.trim();return t.length<=8?t:`${t.slice(0,4)}…${t.slice(-4)}`},t.isTcpFailureThatShouldFallbackToUdp=r,t.createBaichuanApi=n,t.autoDetectDeviceType=async function(e,t){const{host:i,username:o,password:a,uid:c}=e;t.log(`[AutoDetect] Pinging ${i}...`);await async function(e,t=3e3){return new Promise((s=>{const{exec:r}=A(5317);r("win32"===process.platform?`ping -n 1 -w ${t} ${e}`:`ping -c 1 -W ${Math.floor(t/1e3)} ${e}`,(e=>{s(!e)}))}))}(i)?t.log(`[AutoDetect] Host ${i} is reachable`):t.warn(`[AutoDetect] Host ${i} is not reachable via ping, but continuing with connection attempt...`);let l;try{t.log(`[AutoDetect] Trying TCP connection to ${i}...`),l=await n({inputs:{host:i,username:o,password:a,logger:t},transport:"tcp",logger:t}),await l.login();const e=await l.getInfo(),{support:A}=await l.getDeviceCapabilities(0),s=A?.channelNum??1;return t.log(`[AutoDetect] TCP connection successful. channelNum=${s}`),s>1?(t.log(`[AutoDetect] Detected NVR (${s} channels)`),await l.close(),{type:"nvr",transport:"tcp",deviceInfo:e,channelNum:s}):(t.log("[AutoDetect] Detected regular camera (single channel)"),await l.close(),{type:"camera",transport:"tcp",deviceInfo:e,channelNum:1})}catch(e){if(l)try{await l.close()}catch{}if(!r(e))throw e;t.log("[AutoDetect] TCP failed, trying UDP (battery camera)...");const A=s(c);if(!A)throw new Error(`TCP connection failed and device likely requires UDP/BCUDP. UID is required for battery cameras (ip=${i}).`);try{const e=await n({inputs:{host:i,username:o,password:a,uid:A,logger:t},transport:"udp",logger:t});await e.login();const s=await e.getInfo();return t.log("[AutoDetect] UDP connection successful. Detected battery camera."),await e.close(),{type:"battery-cam",transport:"udp",uid:A,deviceInfo:s,channelNum:1}}catch(A){throw t.error(`[AutoDetect] Both TCP and UDP failed. TCP error: ${e}, UDP error: ${A}`),new Error(`Failed to connect via both TCP and UDP. TCP: ${e?.message||e}, UDP: ${A?.message||A}`)}}}},9560:(e,t)=>{"use strict";var A;function s(e){return{[A.General]:"general",[A.DebugRtsp]:"debugRtsp",[A.TraceStream]:"traceStream",[A.TraceTalk]:"traceTalk",[A.TraceEvents]:"traceEvents",[A.DebugH264]:"debugH264",[A.DebugParamSets]:"debugParamSets",[A.EventLogs]:null,[A.BatteryInfo]:null}[e]}Object.defineProperty(t,"__esModule",{value:!0}),t.DebugLogDisplayNames=t.DebugLogOption=void 0,t.mapDebugLogToApiOption=s,t.convertDebugLogsToApiOptions=function(e){const A={},r=new Set(e);for(const[e,n]of Object.entries(t.DebugLogDisplayNames))if(r.has(n)){const t=s(e);t&&(A[t]=!0)}return console.log(e,A),Object.keys(A).length>0?A:void 0},t.getApiRelevantDebugLogs=function(e){return e.filter((e=>null!==s(e)))},t.getDebugLogChoices=function(){return Object.values(A).map((e=>`${t.DebugLogDisplayNames[e]}`))},function(e){e.General="general",e.DebugRtsp="debugRtsp",e.TraceStream="traceStream",e.TraceTalk="traceTalk",e.TraceEvents="traceEvents",e.DebugH264="debugH264",e.DebugParamSets="debugParamSets",e.EventLogs="eventLogs",e.BatteryInfo="batteryInfo"}(A||(t.DebugLogOption=A={})),t.DebugLogDisplayNames={[A.General]:"General",[A.DebugRtsp]:"RTSP",[A.TraceStream]:"Trace stream",[A.TraceTalk]:"Trace talk",[A.TraceEvents]:"Trace events XML",[A.DebugH264]:"H264",[A.DebugParamSets]:"Video param sets",[A.EventLogs]:"Object detection events",[A.BatteryInfo]:"Battery info update"}},5741:function(e,t,A){"use strict";var s,r=this&&this.__createBinding||(Object.create?function(e,t,A,s){void 0===s&&(s=A);var r=Object.getOwnPropertyDescriptor(t,A);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[A]}}),Object.defineProperty(e,s,r)}:function(e,t,A,s){void 0===s&&(s=A),e[s]=t[A]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(s=function(e){return s=Object.getOwnPropertyNames||function(e){var t=[];for(var A in e)Object.prototype.hasOwnProperty.call(e,A)&&(t[t.length]=A);return t},s(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var A=s(e),i=0;i<A.length;i++)"default"!==A[i]&&r(t,e,A[i]);return n(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.ReolinkBaichuanIntercom=void 0;const o=i(A(7562)),a=A(1421);t.ReolinkBaichuanIntercom=class{constructor(e){this.camera=e,this.loggedCodecInfo=!1,this.maxBacklogMs=40,this.sendChain=Promise.resolve(),this.pcmBuffer=Buffer.alloc(0)}get blocksPerPayload(){return Math.max(1,Math.min(8,this.camera.storageSettings.values.intercomBlocksPerPayload??1))}async start(e){const t=this.camera.getLogger(),A=await o.default.mediaManager.convertMediaObjectToJSON(e,o.ScryptedMimeTypes.FFmpegInput);await this.stop();const s=this.camera.storageSettings.values.rtspChannel;if(!this.loggedCodecInfo){this.loggedCodecInfo=!0;try{const e=await this.camera.ensureClient(),A=await e.getTalkAbility(s),r=A.audioConfigList?.map((e=>({audioType:e.audioType,sampleRate:e.sampleRate,samplePrecision:e.samplePrecision,lengthPerEncoder:e.lengthPerEncoder,soundTrack:e.soundTrack})));t.log("Intercom TalkAbility",{channel:s,duplexList:A.duplexList,audioStreamModeList:A.audioStreamModeList,audioConfigList:r})}catch(e){t.warn("Intercom: unable to fetch TalkAbility",e)}}const r=await this.camera.withBaichuanRetry((async()=>{const e=await this.camera.ensureClient();if("battery"===this.camera.options?.type)try{"sleeping"===e.getSleepStatus({channel:s}).state&&(t.log("Camera is sleeping, waking up for intercom..."),await e.wakeUp(s,{waitAfterWakeMs:2e3}),await new Promise((e=>setTimeout(e,1e3))))}catch(e){t.debug("Failed to check/wake camera for intercom, proceeding anyway",e)}return await e.createTalkSession(s,{blocksPerPayload:this.blocksPerPayload})}));this.session=r,this.pcmBuffer=Buffer.alloc(0),this.sendChain=Promise.resolve();const{audioConfig:n,blockSize:i,fullBlockSize:c}=r.info,l=n.sampleRate,h=2*i+1,g=2*h;if(this.maxBacklogBytes=Math.max(g,Math.floor(this.maxBacklogMs/1e3*l*1*2)),!Number.isFinite(l)||l<=0)throw await this.stop(),new Error(`Invalid talk sampleRate: ${l}`);if(!Number.isFinite(i)||i<=0||!Number.isFinite(c)||c!==i+4)throw await this.stop(),new Error(`Invalid talk block sizes: blockSize=${i} fullBlockSize=${c}`);t.log("Starting intercom (baichuan/native-api flow)",{channel:s,audioType:n.audioType,sampleRate:n.sampleRate,samplePrecision:n.samplePrecision,lengthPerEncoder:n.lengthPerEncoder,soundTrack:n.soundTrack,blockSize:i,fullBlockSize:c,samplesPerBlock:h,bytesNeeded:g,maxBacklogMs:this.maxBacklogMs,maxBacklogBytes:this.maxBacklogBytes,blocksPerPayload:this.blocksPerPayload});const d=this.buildFfmpegPcmArgs(A,{sampleRate:l,channels:1});t.log("Intercom ffmpeg decode args",d);const u=(0,a.spawn)("ffmpeg",d,{stdio:["ignore","pipe","pipe"]});if(this.session!==r){try{u.kill("SIGKILL")}catch{}return}this.ffmpeg=u,u.stdout.on("data",(e=>{this.session===r&&e?.length&&this.enqueuePcm(r,e,g,i)}));let E=0;u.stderr.on("data",(e=>{E++<12&&t.warn("Intercom ffmpeg",e.toString().trim())})),u.on("exit",((e,A)=>{t.warn(`Intercom ffmpeg exited code=${e} signal=${A}`),this.stop().catch((()=>{}))})),t.log("Intercom started (ffmpeg decode -> PCM -> IMA ADPCM)")}stop(){return this.stopping||(this.stopping=(async()=>{const e=this.camera.getLogger(),t=this.ffmpeg;this.ffmpeg=void 0;const A=this.session;this.session=void 0,this.pcmBuffer=Buffer.alloc(0);const s=async e=>new Promise((t=>setTimeout(t,e)));if(t&&null==t.exitCode){try{t.kill("SIGKILL")}catch{}try{await Promise.race([new Promise((e=>t.once("exit",(()=>e())))),s(1e3)])}catch{}}try{await Promise.race([this.sendChain,s(250)])}catch{}if(this.sendChain=Promise.resolve(),A)try{await Promise.race([A.stop(),s(2e3)])}catch(t){e.warn("Intercom session stop error",t)}})().finally((()=>{this.stopping=void 0}))),this.stopping}clamp16(e){return e>32767?32767:e<-32768?-32768:0|e}enqueuePcm(e,t,A,s){const r=this.camera.getLogger();this.sendChain=this.sendChain.then((async()=>{if(this.session!==e)return;this.pcmBuffer=this.pcmBuffer.length?Buffer.concat([this.pcmBuffer,t]):t;const r=this.maxBacklogBytes??A;if(this.pcmBuffer.length>r){const e=r-r%2;this.pcmBuffer=this.pcmBuffer.subarray(this.pcmBuffer.length-e)}for(;this.pcmBuffer.length>=A;){const t=this.pcmBuffer.subarray(0,A);this.pcmBuffer=this.pcmBuffer.subarray(A);const r=new Int16Array(t.buffer,t.byteOffset,t.length/2),n=this.encodeImaAdpcm(r,s);await e.sendAudio(n)}})).catch((e=>{r.warn("Intercom PCM->ADPCM pipeline error",e)}))}buildFfmpegPcmArgs(e,t){const A=e.inputArguments??[],s=[];let r;for(let e=0;e<A.length;e++){const t=A[e];if("-i"===t){const t=A[e+1];if("string"==typeof t){r||(r=t),e++;continue}}s.push(t)}const n=r??e.url;if(!n)throw new Error("FFmpegInput missing url/input");return[...s,"-i",n,"-map","0:a:0?","-fflags","nobuffer","-flags","low_delay","-flush_packets","1","-vn","-sn","-dn","-acodec","pcm_s16le","-ar",t.sampleRate.toString(),"-ac",t.channels.toString(),"-f","s16le","pipe:1"]}encodeImaAdpcm(e,t){const A=2*t+1,s=Math.ceil(e.length/A),r=[],n=Int8Array.from([-1,-1,-1,-1,2,4,6,8,-1,-1,-1,-1,2,4,6,8]),i=Int16Array.from([7,8,9,10,11,12,13,14,16,17,19,21,23,25,28,31,34,37,41,45,50,55,60,66,73,80,88,97,107,118,130,143,157,173,190,209,230,253,279,307,337,371,408,449,494,544,598,658,724,796,876,963,1060,1166,1282,1411,1552,1707,1878,2066,2272,2499,2749,3024,3327,3660,4026,4428,4871,5358,5894,6484,7132,7845,8630,9493,10442,11487,12635,13899,15289,16818,18500,20350,22385,24623,27086,29794,32767]);let o=0;for(let A=0;A<s;A++){const A=Buffer.alloc(4+t);let s=e[o]??0,a=0;A.writeInt16LE(s,0),A.writeUInt8(a,2),A.writeUInt8(0,3),o++;const c=new Uint8Array(2*t);for(let t=0;t<c.length;t++){const A=e[o]??s;o++;let r=A-s,l=0;r<0&&(l=8,r=-r);let h=i[a]??7,g=0,d=h>>3;r>=h&&(g|=4,r-=h,d+=h),h>>=1,r>=h&&(g|=2,r-=h,d+=h),h>>=1,r>=h&&(g|=1,d+=h),l?s-=d:s+=d,s=this.clamp16(s),a+=n[g]??0,a<0&&(a=0),a>88&&(a=88),c[t]=15&(g|l)}for(let e=0;e<t;e++){const t=c[2*e]??0,s=c[2*e+1]??0;A[4+e]=15&t|(15&s)<<4}r.push(A)}return Buffer.concat(r)}}},7927:function(e,t,A){"use strict";var s,r=this&&this.__createBinding||(Object.create?function(e,t,A,s){void 0===s&&(s=A);var r=Object.getOwnPropertyDescriptor(t,A);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[A]}}),Object.defineProperty(e,s,r)}:function(e,t,A,s){void 0===s&&(s=A),e[s]=t[A]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(s=function(e){return s=Object.getOwnPropertyNames||function(e){var t=[];for(var A in e)Object.prototype.hasOwnProperty.call(e,A)&&(t[t.length]=A);return t},s(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var A=s(e),i=0;i<A.length;i++)"default"!==A[i]&&r(t,e,A[i]);return n(t,e),t});Object.defineProperty(t,"__esModule",{value:!0});const o=i(A(7562)),a=A(4417),c=A(6125),l=A(5582),h=A(5098),g=A(6185);class d extends o.ScryptedDeviceBase{constructor(){super(...arguments),this.devices=new Map}getScryptedDeviceCreator(){return"Reolink Native camera"}async getDevice(e){if(this.devices.has(e))return this.devices.get(e);const t=this.createCamera(e);return this.devices.set(e,t),t}async createDevice(e,t){const A=e.ip?.toString(),s=e.username?.toString(),r=e.password?.toString(),n=e.uid?.toString();if(!A||!s||!r)throw new Error("IP address, username, and password are required");this.console.log(`[AutoDetect] Starting device type detection for ${A}...`);const i=await(0,h.autoDetectDeviceType)({host:A,username:s,password:r,uid:n,logger:this.console},this.console);if(this.console.log(`[AutoDetect] Detected device type: ${i.type} (transport: ${i.transport})`),"nvr"===i.type){const n=i.deviceInfo||{},a=n?.name||"Reolink NVR";t=`${n?.serialNumber||n?.itemNo||`nvr-${Date.now()}`}-nvr`,e.newCamera||=a,await o.default.deviceManager.onDeviceDiscovered({nativeId:t,name:a,interfaces:[o.ScryptedInterface.Settings,o.ScryptedInterface.DeviceDiscovery,o.ScryptedInterface.DeviceProvider,o.ScryptedInterface.Reboot],type:o.ScryptedDeviceType.Builtin,providerNativeId:this.nativeId});const c=await this.getDevice(t);if(!(c instanceof l.ReolinkNativeNvrDevice))throw new Error("Expected NVR device but got different type");return c.storageSettings.values.ipAddress=A,c.storageSettings.values.username=s,c.storageSettings.values.password=r,c.updateDeviceInfo(n),t}const a=i.deviceInfo||{},c=a?.name||"Reolink Camera",d=a?.serialNumber||a?.itemNo||`unknown-${Date.now()}`;t="battery-cam"===i.type?`${d}-battery-cam`:`${d}-cam`,e.newCamera||=c;const u=await(0,h.createBaichuanApi)({inputs:{host:A,username:s,password:r,uid:i.uid,logger:this.console},transport:i.transport,logger:this.console});try{await u.login();const e=0,{abilities:n,capabilities:h,objects:d,presets:E}=await u.getDeviceCapabilities(e);this.console.log(JSON.stringify({abilities:n,capabilities:h,deviceInfo:a}));const{interfaces:I,type:Q}=(0,g.getDeviceInterfaces)({capabilities:h,logger:this.console});await o.default.deviceManager.onDeviceDiscovered({nativeId:t,name:c,interfaces:I,type:Q,providerNativeId:this.nativeId});const C=await this.getDevice(t);if(C instanceof l.ReolinkNativeNvrDevice)throw new Error("NVR device should not reach this code path");return C.info=a,C.classes=d,C.presets=E,C.storageSettings.values.username=s,C.storageSettings.values.password=r,C.storageSettings.values.rtspChannel=e,C.storageSettings.values.ipAddress=A,C.storageSettings.values.capabilities=h,C.storageSettings.values.uid=i.uid,C.updateDeviceInfo(),t}catch(e){throw this.console.error("Error adding Reolink device",e),e}finally{await u.close()}}async releaseDevice(e,t){if(this.devices.has(t)){const e=this.devices.get(t);e&&"release"in e&&"function"==typeof e.release&&await e.release(),this.devices.delete(t)}}async getCreateDeviceSettings(){return[{key:"ip",title:"IP Address",placeholder:"192.168.2.222"},{key:"username",title:"Username"},{key:"password",title:"Password",type:"password"},{key:"uid",title:"UID",description:"Reolink UID (optional, required for battery cameras if TCP connection fails)"}]}createCamera(e){return e.endsWith("-battery-cam")?new c.ReolinkNativeBatteryCamera(e,this):e.endsWith("-nvr")?new l.ReolinkNativeNvrDevice(e,this):new a.ReolinkNativeCamera(e,this)}}t.default=d},5582:function(e,t,A){"use strict";var s,r=this&&this.__createBinding||(Object.create?function(e,t,A,s){void 0===s&&(s=A);var r=Object.getOwnPropertyDescriptor(t,A);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[A]}}),Object.defineProperty(e,s,r)}:function(e,t,A,s){void 0===s&&(s=A),e[s]=t[A]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(s=function(e){return s=Object.getOwnPropertyNames||function(e){var t=[];for(var A in e)Object.prototype.hasOwnProperty.call(e,A)&&(t[t.length]=A);return t},s(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var A=s(e),i=0;i<A.length;i++)"default"!==A[i]&&r(t,e,A[i]);return n(t,e),t});Object.defineProperty(t,"__esModule",{value:!0}),t.ReolinkNativeNvrDevice=void 0;const o=i(A(7562)),a=A(6117),c=A(4417),l=A(6125),h=A(5098),g=A(6185);class d extends o.ScryptedDeviceBase{constructor(e,t){super(e),this.storageSettings=new a.StorageSettings(this,{debugEvents:{title:"Debug Events",type:"boolean",immediate:!0},ipAddress:{title:"IP address",type:"string",onPut:async()=>await this.reinit()},username:{title:"Username",placeholder:"admin",defaultValue:"admin",type:"string",onPut:async()=>await this.reinit()},password:{title:"Password",type:"password",onPut:async()=>await this.reinit()}}),this.discoveredDevices=new Map,this.cameraNativeMap=new Map,this.processing=!1,this.plugin=t,setTimeout((async()=>{await this.init()}),5e3)}async reboot(){const e=await this.ensureClient();await e.Reboot()}getLogger(){return this.console}async reinit(){if(this.nvrApi)try{await this.nvrApi.logout()}catch{}this.nvrApi=void 0}async ensureClient(){if(this.nvrApi)return this.nvrApi;const{ipAddress:e,username:t,password:s}=this.storageSettings.values;if(!e||!t||!s)throw new Error("Missing NVR credentials");const{ReolinkCgiApi:r}=await Promise.resolve().then(A.bind(A,5024));return this.nvrApi=new r({host:e,username:t,password:s}),await this.nvrApi.login(),this.nvrApi}async init(){const e=await this.ensureClient(),t=this.getLogger();setInterval((async()=>{if(!this.processing&&e){this.processing=!0;try{const A=Date.now();if((!this.lastErrorsCheck||A-this.lastErrorsCheck>6e4)&&(this.lastErrorsCheck=A),!this.lastHubInfoCheck||A-this.lastHubInfoCheck>3e5){t.log("Starting Hub info data fetch"),this.lastHubInfoCheck=A;const{hubData:s}=await e.getHubInfo(),{devicesData:r,channelsResponse:n,response:i}=await e.getDevicesInfo();t.log("Hub info data fetched"),this.storageSettings.values.debugEvents&&t.log(`${JSON.stringify({hubData:s,devicesData:r,channelsResponse:n,response:i})}`),await this.discoverDevices(!0)}const s=await e.getAllChannelsEvents();this.storageSettings.values.debugEvents&&t.debug(`Events call result: ${JSON.stringify(s)}`),this.cameraNativeMap.forEach((e=>{if(e){const t=e.storageSettings.values.rtspChannel,A=s?.parsed[t];A&&e.processEvents(A)}}));const{batteryInfoData:r,response:n}=await e.getAllChannelsBatteryInfo();this.storageSettings.values.debugEvents&&t.debug(`Battery info call result: ${JSON.stringify({batteryInfoData:r,response:n})}`),this.cameraNativeMap.forEach((e=>{if(e){const t=e.storageSettings.values.rtspChannel,A=r[t];A&&e.updateSleepingState({reason:"NVR",state:A.sleeping?"sleeping":"awake",idleMs:0,lastRxAtMs:0}).catch((()=>{}))}}))}catch(e){this.console.error("Error on events flow",e)}finally{this.processing=!1}}}),1e3)}updateDeviceInfo(e){const t=this.info||{};t.ip=this.storageSettings.values.ipAddress,t.serialNumber=e?.serialNumber||e?.itemNo,t.firmware=e?.firmwareVersion||e?.firmVer,t.version=e?.hardwareVersion||e?.boardInfo,t.model=e?.type||e?.typeInfo,t.manufacturer="Reolink native",t.managementUrl=`http://${t.ip}`,this.info=t}async getSettings(){return await this.storageSettings.getSettings()}async putSetting(e,t){return this.storageSettings.putSetting(e,t)}async releaseDevice(e,t){this.cameraNativeMap.delete(t)}async getDevice(e){let t=this.cameraNativeMap.get(e);return t||(t=e.endsWith("-battery-cam")?new l.ReolinkNativeBatteryCamera(e,this.plugin,this):new c.ReolinkNativeCamera(e,this.plugin,this),this.cameraNativeMap.set(e,t)),t}buildNativeId(e,t,A){const s=A?"-battery-cam":"-cam";return t?`${this.nativeId}-ch${e}-${t}${s}`:`${this.nativeId}-ch${e}${s}`}getCameraInterfaces(){return[o.ScryptedInterface.VideoCameraConfiguration,o.ScryptedInterface.Camera,o.ScryptedInterface.MotionSensor,o.ScryptedInterface.VideoTextOverlays,o.ScryptedInterface.VideoCamera,o.ScryptedInterface.Settings,o.ScryptedInterface.ObjectDetector]}async syncEntitiesFromRemote(){const e=await this.ensureClient(),t=this.getLogger();t.log("Starting channels discovery using getDevicesInfo...");const{devicesData:A,channels:s}=await e.getDevicesInfo();t.log(`getDevicesInfo completed. Found ${s.length} channels.`);for(const e of s)try{const{channelStatus:s,channelInfo:r,abilities:n}=A[e],i=s?.name,a=s?.uid,c=!!n?.battery?.ver,l=this.buildNativeId(e,a,c),h=[o.ScryptedInterface.VideoCamera];c&&h.push(o.ScryptedInterface.Battery);const g=n.supportDoorbellLight?o.ScryptedDeviceType.Doorbell:o.ScryptedDeviceType.Camera,d={nativeId:l,name:i,providerNativeId:this.nativeId,interfaces:h,type:g,info:{manufacturer:"Reolink",model:r?.typeInfo,serialNumber:a}};if(o.default.deviceManager.getNativeIds().includes(l))continue;if(this.discoveredDevices.has(l))continue;this.discoveredDevices.set(l,{device:d,description:`${i} (Channel ${e})`,rtspChannel:e,deviceData:A[e]}),t.debug(`Discovered channel ${e}: ${i}`)}catch(A){t.debug(`Error processing channel ${e}: ${A?.message||String(A)}`)}t.log(`Channel discovery completed. Found ${this.discoveredDevices.size} devices.`)}async discoverDevices(e){return e&&await this.syncEntitiesFromRemote(),[...this.discoveredDevices.values()].map((e=>({...e.device,description:e.description})))}async adoptDevice(e){const t=this.discoveredDevices.get(e.nativeId);if(!t)throw new Error("device not found");await this.onDeviceEvent(o.ScryptedInterface.DeviceDiscovery,await this.discoverDevices());const s=t.device.interfaces.includes(o.ScryptedInterface.Battery),{channelStatus:r}=t.deviceData,{ReolinkBaichuanApi:n}=await Promise.resolve().then(A.bind(A,5024)),i=r?.uid,a=s&&i?(0,h.normalizeUid)(i):void 0,c=new n({host:this.storageSettings.values.ipAddress,username:this.storageSettings.values.username,password:this.storageSettings.values.password,transport:"tcp",channel:t.rtspChannel,...a?{uid:a}:{}});await c.login();const{capabilities:l,objects:d,presets:u}=await c.getDeviceCapabilities(t.rtspChannel),{interfaces:E,type:I}=(0,g.getDeviceInterfaces)({capabilities:l,logger:this.console}),Q={...t.device,interfaces:E,type:I};await o.default.deviceManager.onDeviceDiscovered(Q);const C=await this.getDevice(e.nativeId);this.console.log("Adopted device",t,C?.name);const{username:B,password:p,ipAddress:f}=this.storageSettings.values;return C.storageSettings.values.rtspChannel=t.rtspChannel,C.classes=d,C.presets=u,C.storageSettings.values.username=B,C.storageSettings.values.password=p,C.storageSettings.values.rtspChannel=t.rtspChannel,C.storageSettings.values.ipAddress=f,C.storageSettings.values.capabilities=l,C.storageSettings.values.uid=t.deviceData.channelStatus.uid,C.storageSettings.values.isFromNvr=!0,C.updateDeviceInfo(),this.discoveredDevices.delete(e.nativeId),C?.id}}t.ReolinkNativeNvrDevice=d},840:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReolinkPtzPresets=void 0;t.ReolinkPtzPresets=class{constructor(e){this.camera=e}get storageSettings(){return this.camera.storageSettings}getPtzCapabilitiesStore(){return this.camera.ptzCapabilities}setPtzCapabilitiesStore(e){this.camera.ptzCapabilities=e}parsePresetIdFromSettingValue(e){const t=String(e??"").trim();if(!t)return;const A=t.includes("=")?t.split("=")[0]:t,s=Number(A);return Number.isFinite(s)?s:void 0}syncEnabledPresetsSettingAndCaps(e){const t=this.storageSettings.values.presets??[];if(!t.length)return;const A=new Map(e.map((e=>[e.id,e.name]))),s={};for(const e of t){const t=this.parsePresetIdFromSettingValue(e);if(void 0===t)continue;const r=(e.includes("=")?e.substring(e.indexOf("=")+1).trim():"")||A.get(t);r&&(s[String(t)]=r)}this.setPtzCapabilitiesStore({...this.getPtzCapabilitiesStore()??{},presets:s})}setCachedPtzPresets(e){const t=Array.isArray(e)?e:[];this.camera.presets=t;const A={};for(const e of t)A[String(e.id)]=e.name;this.setPtzCapabilitiesStore({...this.getPtzCapabilitiesStore()??{},presets:A})}getCachedPtzPresets(){const e=this.camera.presets;return Array.isArray(e)?e:[]}nextFreePresetId(e){const t=new Set(e.map((e=>e.id)));for(let e=1;e<=255;e++)if(!t.has(e))return e;throw new Error("No free PTZ preset id available (1..255)")}async refreshPtzPresets(){const e=await this.camera.ensureClient(),t=this.camera.storageSettings.values.rtspChannel,A=await e.getPtzPresets(t);return this.setCachedPtzPresets(A),this.syncEnabledPresetsSettingAndCaps(A),A}async moveToPreset(e){const t=await this.camera.ensureClient(),A=this.camera.storageSettings.values.rtspChannel;await t.moveToPtzPreset(A,e)}async createPtzPreset(e,t){const A=await this.camera.ensureClient(),s=this.camera.storageSettings.values.rtspChannel,r=String(e??"").trim();if(!r)throw new Error("Preset name is required");const n=await A.getPtzPresets(s),i=new Set(n.map((e=>e.id))),o=t??this.nextFreePresetId(n);if(void 0===t&&i.has(o))throw new Error(`PTZ preset id already in use: ${o}`);await A.setPtzPreset(s,o,r);const a=await A.getPtzPresets(s),c=a.some((e=>e.id===o));if(this.setCachedPtzPresets(a),!c)throw this.syncEnabledPresetsSettingAndCaps(a),new Error("PTZ preset save did not persist (camera returned an empty/unchanged preset list). Try again.");const l=this.storageSettings.values.presets??[];if(l.length){l.some((e=>this.parsePresetIdFromSettingValue(e)===o))||(l.push(`${o}=${r}`),this.storageSettings.values.presets=l)}return this.syncEnabledPresetsSettingAndCaps(a),{id:o,name:r}}async updatePtzPresetToCurrentPosition(e){const t=await this.camera.ensureClient(),A=this.camera.storageSettings.values.rtspChannel,s=this.getCachedPtzPresets().find((t=>t.id===e)),r=s?.name??`Preset ${e}`;await t.setPtzPreset(A,e,r),await this.refreshPtzPresets()}async deletePtzPreset(e){const t=await this.camera.ensureClient(),A=this.camera.storageSettings.values.rtspChannel;await t.deletePtzPreset(A,e);const s=this.storageSettings.values.presets;if(Array.isArray(s)&&s.length){const t=s.filter((e=>"string"==typeof e)).filter((t=>this.parsePresetIdFromSettingValue(t)!==e));this.storageSettings.values.presets=t}await this.refreshPtzPresets()}async renamePtzPreset(e,t){const A=await this.camera.ensureClient(),s=this.camera.storageSettings.values.rtspChannel,r=String(t??"").trim();if(!r)throw new Error("Preset name is required");await A.moveToPtzPreset(s,e),await A.setPtzPreset(s,e,r),await this.refreshPtzPresets()}}},5050:function(e,t,A){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.StreamManager=void 0,t.parseStreamProfileFromId=function(e){if(!e)return;if(e.startsWith("native_")){return e.replace("native_","")}if(e.endsWith(".bcs")){return e.replace(".bcs","")}if(e.startsWith("h264Preview_")){if(e.endsWith("_main"))return"main";if(e.endsWith("_sub"))return"sub"}return},t.isNativeStreamId=function(e){return e?.startsWith("native_")??!1},t.fetchVideoStreamOptionsFromApi=n,t.buildVideoStreamOptionsFromRtspRtmp=async function(e){const{client:t,ipAddress:A,cachedNetPort:s,rtspChannel:r,logger:i}=e,o=[],a=[],c=s||await t.getNetPort(),l=1===c.rtsp?.enable,h=1===c.rtmp?.enable,g=c.rtsp?.port??554,d=c.rtmp?.port??1935,u=await t.getStreamMetadata(r),E=u?.streams||[];for(const e of E){const t=e.profile,s=String(e.videoEncType||"").includes("264")?"h264":String(e.videoEncType||"").includes("265")?"h265":String(e.videoEncType||"").toLowerCase();if(l&&"ext"!==t){const n=String(r+1).padStart(2,"0"),i="main"===t?"main":"sub",a=`/h264Preview_${n}_${i}`,c=`h264Preview_${n}_${i}`;o.push({name:`RTSP ${c}`,id:c,container:"rtsp",video:{codec:s,width:e.width,height:e.height},url:`rtsp://${A}:${g}${a}`})}if(h){const n="main"===t?"main":"sub"===t?"sub":"ext",i="sub"===t?1:0,o=`${n}.bcs`,c=new URL(`rtmp://${A}:${d}${`/bcs/channel${r}_${n}.bcs`}`),l=c.searchParams;l.set("channel",r.toString()),l.set("stream",i.toString()),a.push({name:`RTMP ${o}`,id:o,container:"rtmp",video:{codec:s,width:e.width,height:e.height},url:c.toString()})}}const I=await n(t,r,i);return[...o,...a,...I]},t.selectStreamOption=function(e,t){if(!t)throw new Error("video streams not set up or no longer exists.");const A=e?.find((e=>e.id===t.id))||e?.[0];if(!A)throw new Error("No stream options available");return A},t.expectedVideoTypeFromUrlMediaStreamOptions=function(e){const t=e?.video?.codec;return"string"!=typeof t?void 0:t.includes("265")?"H265":t.includes("264")?"H264":void 0},t.createRfc4571MediaObjectFromStreamManager=async function(e){const{streamManager:t,channel:A,profile:s,streamKey:n,expectedVideoType:i,selected:o,sourceId:a,onDetectedCodec:c}=e,{host:l,port:h,sdp:g,audio:d,username:u,password:E}=await t.getRfcStream(A,s,n,i);try{const e=/a=rtpmap:\d+\s+(H26[45])\//.exec(g)?.[1];if(e){const t="H265"===e?"h265":"h264";c?.(t)}}catch{}const{url:I,...Q}=o;Q.container="rtp",d&&(Q.audio||={},Q.audio.codec=d.codec,Q.audio.sampleRate=d.sampleRate,Q.audio.channels=d.channels);const C=encodeURIComponent(u||""),B=encodeURIComponent(E||""),p={url:`tcp://${C}:${B}@${l}:${h}`,sdp:g,mediaStreamOptions:Q};return await r.default.mediaManager.createMediaObject(Buffer.from(JSON.stringify(p)),"x-scrypted/x-rfc4571",{sourceId:a})};const r=s(A(7562));async function n(e,t,A){const s=await e.getStreamMetadata(t),r=[],n=s?.streams||[];for(const e of n){const t=e.profile,A=String(e.videoEncType||"").includes("264")?"h264":String(e.videoEncType||"").includes("265")?"h265":String(e.videoEncType||"").toLowerCase();r.push({name:`Native ${t}`,id:`native_${t}`,container:"rtp",video:{codec:A,width:e.width,height:e.height},url:""})}return r}t.StreamManager=class{constructor(e){this.opts=e,this.nativeRfcServers=new Map,this.nativeRfcServerCreatePromises=new Map}getLogger(){return this.opts.getLogger()}async ensureNativeRfcServer(e,t,s,r){const n=this.nativeRfcServerCreatePromises.get(e);if(n)return await n;const i=(async()=>{const n=this.nativeRfcServers.get(e);if(n?.server?.listening){if(!r||n.videoType===r)return{host:n.host,port:n.port,sdp:n.sdp,audio:n.audio,username:n.username||this.opts.credentials.username,password:n.password||this.opts.credentials.password};this.getLogger().warn(`Native RFC cache codec mismatch for ${e}: cached=${n.videoType} expected=${r}; recreating server.`)}if(n){try{await n.close("recreate")}catch{}this.nativeRfcServers.delete(e)}const i=await this.opts.createStreamClient(),{createScryptedRfc4571TcpServer:o}=await Promise.resolve().then(A.bind(A,5024)),{username:a,password:c}=this.opts.credentials,l=!this.opts.sharedConnection,h=await o({api:i,channel:t,profile:s,logger:this.getLogger(),expectedVideoType:r,closeApiOnTeardown:l,username:a,password:c});return this.nativeRfcServers.set(e,h),h.server.once("close",(()=>{const t=this.nativeRfcServers.get(e);t?.server===h.server&&this.nativeRfcServers.delete(e)})),{host:h.host,port:h.port,sdp:h.sdp,audio:h.audio,username:h.username||this.opts.credentials.username,password:h.password||this.opts.credentials.password}})();this.nativeRfcServerCreatePromises.set(e,i);try{return await i}finally{this.nativeRfcServerCreatePromises.delete(e)}}async getRfcStream(e,t,A,s){return await this.ensureNativeRfcServer(A,e,t,s)}async closeAllStreams(e){const t=Array.from(this.nativeRfcServers.values());this.nativeRfcServers.clear(),await Promise.allSettled(t.map((async t=>{try{await t.close(e||"connection reset")}catch(e){this.getLogger().debug("Error closing stream server",e)}})))}}},6185:(e,t,A)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDeviceInterfaces=void 0;const s=A(7562);t.getDeviceInterfaces=e=>{const{capabilities:t,logger:A}=e,r=[s.ScryptedInterface.VideoCamera,s.ScryptedInterface.Settings,s.ScryptedInterface.Reboot,s.ScryptedInterface.VideoCameraConfiguration,s.ScryptedInterface.Camera,s.ScryptedInterface.AudioSensor,s.ScryptedInterface.MotionSensor,s.ScryptedInterface.VideoTextOverlays];try{const{hasPtz:e,hasSiren:A,hasFloodlight:n,hasPir:i,hasBattery:o,hasIntercom:a,isDoorbell:c}=t;e&&r.push(s.ScryptedInterface.PanTiltZoom),r.push(s.ScryptedInterface.ObjectDetector),(A||n||i)&&r.push(s.ScryptedInterface.DeviceProvider),o&&r.push(s.ScryptedInterface.Battery,s.ScryptedInterface.Sleep),a&&r.push(s.ScryptedInterface.Intercom),c&&r.push(s.ScryptedInterface.BinarySensor)}catch(e){A.error("Error getting device interfaces",e)}return{interfaces:r,type:t.isDoorbell?s.ScryptedDeviceType.Doorbell:s.ScryptedDeviceType.Camera}}},5317:e=>{"use strict";e.exports=require("child_process")},3339:e=>{"use strict";e.exports=require("module")},4589:e=>{"use strict";e.exports=require("node:assert")},6698:e=>{"use strict";e.exports=require("node:async_hooks")},4573:e=>{"use strict";e.exports=require("node:buffer")},1421:e=>{"use strict";e.exports=require("node:child_process")},7540:e=>{"use strict";e.exports=require("node:console")},7598:e=>{"use strict";e.exports=require("node:crypto")},3053:e=>{"use strict";e.exports=require("node:diagnostics_channel")},610:e=>{"use strict";e.exports=require("node:dns")},8474:e=>{"use strict";e.exports=require("node:events")},1455:e=>{"use strict";e.exports=require("node:fs/promises")},7067:e=>{"use strict";e.exports=require("node:http")},2467:e=>{"use strict";e.exports=require("node:http2")},7030:e=>{"use strict";e.exports=require("node:net")},6760:e=>{"use strict";e.exports=require("node:path")},643:e=>{"use strict";e.exports=require("node:perf_hooks")},1792:e=>{"use strict";e.exports=require("node:querystring")},99:e=>{"use strict";e.exports=require("node:sqlite")},7075:e=>{"use strict";e.exports=require("node:stream")},7997:e=>{"use strict";e.exports=require("node:timers")},1692:e=>{"use strict";e.exports=require("node:tls")},7975:e=>{"use strict";e.exports=require("node:util")},3429:e=>{"use strict";e.exports=require("node:util/types")},5919:e=>{"use strict";e.exports=require("node:worker_threads")},8522:e=>{"use strict";e.exports=require("node:zlib")},5024:(e,t,A)=>{"use strict";A.d(t,{ReolinkBaichuanApi:()=>Nt,ReolinkCgiApi:()=>de,createScryptedRfc4571TcpServer:()=>Yt});const s=require("crypto"),r=require("events"),n=require("net"),i=require("dgram"),o=require("timers"),a=require("fs"),c=require("path");var l=A(9038),h=A(5317);const g=require("fs/promises"),d=require("http");var u=9e3,E=Buffer.from([240,222,188,10]),I=Buffer.from([160,203,237,15]),Q=Uint8Array.from([31,45,60,75,90,105,120,255]),C=Buffer.from("0123456789abcdef","utf8"),B=25620,p=25730;function f(e){return e===B||0===e||e===p}var m=253,y=234,S=289;function w(e){return function(e){return(0,s.createHash)("md5").update(e,"utf8").digest("hex").toUpperCase()}(e).slice(0,31)}function D(e,t){const A=w(`${e}-${t}`).slice(0,16);return Buffer.from(A,"utf8")}function b(e,t){const A=255&t,s=Buffer.allocUnsafe(e.length);for(let t=0;t<e.length;t++){const r=Q[(A+t)%Q.length];s[t]=e[t]^r^A}return s}function N(e,t){return b(e,t)}function R(e,t){if(0===e.length)return Buffer.alloc(0);const A=(0,s.createCipheriv)("aes-128-cfb",t,C);return A.setAutoPadding(!1),Buffer.concat([A.update(e),A.final()])}function v(e,t){if(0===e.length)return Buffer.alloc(0);const A=(0,s.createDecipheriv)("aes-128-cfb",t,C);return A.setAutoPadding(!1),Buffer.concat([A.update(e),A.final()])}function k(e){const t=f(e.messageClass),A=t?24:20,s=Buffer.alloc(A),r=e.magic??E;if(4!==r.length)throw new Error("magic must be 4 bytes");return r.copy(s,0),s.writeUInt32LE(e.cmdId>>>0,4),s.writeUInt32LE(e.bodyLen>>>0,8),s.writeUInt8(255&e.channelId,12),s.writeUInt8(255&e.streamType,13),s.writeUInt16LE(65535&e.msgNum,14),s.writeUInt16LE(65535&e.responseCode,16),s.writeUInt16LE(65535&e.messageClass,18),t&&s.writeUInt32LE((e.payloadOffset??0)>>>0,20),s}function T(e){if(e.length<20)throw new Error("not enough data for Baichuan header");const t=e.subarray(0,4);if(!t.equals(E)&&!t.equals(I))throw new Error(`invalid Baichuan magic: ${t.toString("hex")}`);const A=e.readUInt32LE(4),s=e.readUInt32LE(8),r=e.readUInt8(12),n=e.readUInt8(13),i=e.readUInt16LE(14),o=e.readUInt16LE(16),a=e.readUInt16LE(18),c=f(a)?24:20;if(e.length<c)throw new Error("not enough data for Baichuan header (needs 24 bytes)");const l=e.readUInt32LE(12),h={magic:Buffer.from(t),cmdId:A,bodyLen:s,channelId:r,streamType:n,msgNum:i,responseCode:o,messageClass:a};return 24===c&&(h.payloadOffset=e.readUInt32LE(20)),{header:h,headerLen:c,messageKey:l}}var F=class{buffer=Buffer.alloc(0);push(e){if(0===e.length)return[];const t=e;this.buffer=0===this.buffer.length?t:Buffer.concat([this.buffer,t]);const A=[];for(;!(this.buffer.length<4);){if(!this.buffer.subarray(0,4).equals(E)&&!this.buffer.subarray(0,4).equals(I)){const e=this.buffer.indexOf(E),t=this.buffer.indexOf(I),A=-1===e?t:-1===t?e:Math.min(e,t);if(-1===A){this.buffer=this.buffer.subarray(Math.max(0,this.buffer.length-3));break}if(this.buffer=this.buffer.subarray(A),this.buffer.length<20)break}if(this.buffer.length<20)break;let e;try{e=T(this.buffer)}catch{break}const{header:t,headerLen:s,messageKey:r}=e,n=s+t.bodyLen;if(this.buffer.length<n)break;const i=this.buffer.subarray(0,n),o=i.subarray(s);let a=0;if(24===s){const e=t.payloadOffset??0;a=e>0?Math.min(e,t.bodyLen):0}const c=o.subarray(0,a),l=o.subarray(a);A.push({header:t,body:o,extension:c,payload:l,messageKey:r,raw:i}),this.buffer=this.buffer.subarray(n)}return A}};function M(e){if(null==e||"string"!=typeof e){throw new Error(`xmlEscape: expected string but got ${typeof e}: ${e}`)}return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function U(e){return null==e?'<?xml version="1.0" encoding="UTF-8" ?><Extension version="1.1"></Extension>':`<?xml version="1.0" encoding="UTF-8" ?>\n<Extension version="1.1">\n<channelId>${e}</channelId>\n</Extension>`}function L(e){return null==e?'<?xml version="1.0" encoding="UTF-8" ?><Extension version="1.1"><binaryData>1</binaryData></Extension>':`<?xml version="1.0" encoding="UTF-8" ?>\n<Extension version="1.1">\n<binaryData>1</binaryData>\n<channelId>${e}</channelId>\n</Extension>`}function H(e,t){const A=new RegExp(`<${t}>([^<]*)</${t}>`).exec(e);return A?.[1]}function P(e,t,A,s){let r="";const n=s?.name;"setPos"===A&&void 0!==n&&(r=`<name>${M(n)}</name>`);let i="";return void 0!==s?.enable&&(i=`<enable>${s.enable}</enable>`),`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<PtzPreset version="1.1">\n<channelId>${e}</channelId>\n<presetList>\n<preset>\n<id>${t}</id>\n<command>${A}</command>\n${r}\n${i}\n</preset>\n</presetList>\n</PtzPreset>\n</body>`}function x(e,t){return`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<audioPlayInfo version="1.1">\n${void 0!==e?`<channelId>${e}</channelId>`:""}\n<playMode>2</playMode>\n<playDuration>10</playDuration>\n<playTimes>1</playTimes>\n<onOff>${t}</onOff>\n</audioPlayInfo>\n</body>`}function Y(e,t){return`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<audioPlayInfo version="1.1">\n${void 0!==e?`<channelId>${e}</channelId>`:""}\n<playMode>0</playMode>\n<playDuration>10</playDuration>\n<playTimes>${t}</playTimes>\n<onOff>1</onOff>\n</audioPlayInfo>\n</body>`}function V(e,t,A=180){return`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<FloodlightManual version="1.1">\n<channelId>${e}</channelId>\n<status>${t}</status>\n<duration>${A}</duration>\n</FloodlightManual>\n</body>`}var G,O=713543482,J=713543456,W=713543440;function _(e){const t=function(){if(G)return G;const e=new Uint32Array(256);for(let t=0;t<256;t++){let A=t;for(let e=0;e<8;e++)A=1&A?3988292384^A>>>1:A>>>1;e[t]=A>>>0}return G=e,e}();let A=0;for(let s=0;s<e.length;s++){A=(t[255&(A^e[s])]^A>>>8)>>>0}return A>>>0}var q=Uint32Array.from([523058251,1517059981,941043275,2188469082,2252282411,2781280216,2205278644,401789861]);function $(e,t){const A=Buffer.allocUnsafe(t.length),s=function*(e){let t=0;for(;;){const A=q[t%q.length]+(e>>>0)>>>0;yield 255&A,yield A>>>8&255,yield A>>>16&255,yield A>>>24&255,t++}}(e>>>0);for(let e=0;e<t.length;e++)A[e]=t[e]^s.next().value;return A}function X(e,t){return e.readInt32LE(t)}function z(e,t){const A=$(e,Buffer.from(t,"utf8")),s=_(A),r=Buffer.alloc(20);return r.writeUInt32LE(O,0),r.writeUInt32LE(A.length>>>0,4),r.writeUInt32LE(1,8),r.writeUInt32LE(e>>>0,12),r.writeUInt32LE(s>>>0,16),Buffer.concat([r,A])}function Z(e){const t=Buffer.alloc(20);return t.writeUInt32LE(W,0),t.writeInt32LE(0|e.connectionId,4),t.writeUInt32LE(0,8),t.writeUInt32LE(e.packetId>>>0,12),t.writeUInt32LE(e.payload.length>>>0,16),Buffer.concat([t,e.payload])}function j(e){if(e.length<4)throw new Error("BCUDP packet too short");const t=e.readUInt32LE(0);if(t===O){if(e.length<20)throw new Error("BCUDP discovery header too short");const t=e.readUInt32LE(4),A=e.readUInt32LE(8);if(1!==A)throw new Error(`BCUDP discovery unknownA expected 1, got ${A}`);const s=e.readUInt32LE(12),r=e.readUInt32LE(16),n=e.subarray(20);if(n.length<t)throw new Error("BCUDP discovery payload truncated");const i=n.subarray(0,t);if(r>>>0!=_(i)>>>0)throw new Error("BCUDP discovery CRC mismatch");const o=function(e,t){return $(e,t)}(s,i);return{kind:"discovery",tid:s,xml:o.toString("utf8")}}if(t===J){if(e.length<28)throw new Error("BCUDP ack header too short");const t=X(e,4),A=e.readUInt32LE(8);if(0!==A)throw new Error(`BCUDP ack unknownA expected 0, got ${A}`);const s=e.readUInt32LE(12),r=e.readUInt32LE(16),n=e.readUInt32LE(20),i=e.readUInt32LE(24),o=e.subarray(28);if(o.length<i)throw new Error("BCUDP ack payload truncated");return{kind:"ack",connectionId:t,groupId:s,packetId:r,maybeLatency:n,payload:o.subarray(0,i)}}if(t===W){if(e.length<20)throw new Error("BCUDP data header too short");const t=X(e,4),A=e.readUInt32LE(8);if(0!==A)throw new Error(`BCUDP data unknownA expected 0, got ${A}`);const s=e.readUInt32LE(12),r=e.readUInt32LE(16),n=e.subarray(20);if(n.length<r)throw new Error("BCUDP data payload truncated");return{kind:"data",connectionId:t,packetId:s,payload:n.subarray(0,r)}}throw new Error(`Unknown BCUDP magic 0x${t.toString(16)}`)}function K(e){return`<P2P>${e}</P2P>`}function ee(e){const t=e.conn??"local";return K(`<C2D_A><sid>${e.sid}</sid><conn>${M(t)}</conn><cid>${e.cid}</cid><did>${e.did}</did><mtu>${e.mtu}</mtu></C2D_A>`)}function te(e){const t=/<D2C_CFM>([\s\S]*?)<\/D2C_CFM>/.exec(e);if(!t)return;const A=t[1]??"",s=/<sid>(-?\d+)<\/sid>/.exec(A)?.[1];if(null==s)return;const r=/<conn>([^<]+)<\/conn>/.exec(A)?.[1],n=/<rsp>(-?\d+)<\/rsp>/.exec(A)?.[1],i=/<cid>(-?\d+)<\/cid>/.exec(A)?.[1],o=/<did>(-?\d+)<\/did>/.exec(A)?.[1];return{sid:Number(s),...null!=r?{conn:r}:{},...null!=n?{rsp:Number(n)}:{},...null!=i?{cid:Number(i)}:{},...null!=o?{did:Number(o)}:{}}}function Ae(e){const t=/<D2C_T>([\s\S]*?)<\/D2C_T>/.exec(e);if(!t)return;const A=t[1]??"",s=/<sid>(-?\d+)<\/sid>/.exec(A)?.[1],r=/<cid>(-?\d+)<\/cid>/.exec(A)?.[1],n=/<did>(-?\d+)<\/did>/.exec(A)?.[1];if(null==s||null==r||null==n)return;const i=/<conn>([^<]+)<\/conn>/.exec(A)?.[1];return{sid:Number(s),cid:Number(r),did:Number(n),...null!=i?{conn:i}:{}}}var se=class{currentValues=[];lastReceiveTime=null;displayValue=0;lastDisplayTime=null;getValue(){return this.displayValue}feed(){const e=performance.now();if(null!==this.lastReceiveTime){const t=1e3*(e-this.lastReceiveTime);this.currentValues.push(t)}if(this.lastReceiveTime=e,null!==this.lastDisplayTime){if(e-this.lastDisplayTime>1e3){this.lastDisplayTime=e;const t=this.currentValues.length;if(t>0){const e=this.currentValues.reduce(((e,t)=>e+t),0);this.displayValue=Math.floor(e/t)}else this.displayValue=0;this.currentValues=[]}}else this.lastDisplayTime=e,this.displayValue=0}},re=class extends r.EventEmitter{opts;sock;remote;mtu;clientId;cameraId;sid;sendPacketId=0;packetsWant=0;received=new Map;sent=new Map;ackTimer;resendTimer;hbTimer;discoveryTid;acceptSent=!1;lastAcceptAtMs;ackScheduled=!1;ackLatency=new se;lastAckPacket=Buffer.alloc(0);ackSentCount=0;pendingData=[];pendingDataOffset=0;drainScheduled=!1;getKeepAliveTid(){return null!=this.discoveryTid?this.discoveryTid:(0|Math.floor(255*Math.random()))>>>0}constructor(e){super(),this.opts=e,this.mtu=1350}isConnected(){return!!this.sock&&!!this.remote&&null!=this.cameraId}async connect(){if(this.sock)return;const e=i.createSocket("udp4");this.sock=e;try{e.setRecvBufferSize(4194304),e.setSendBufferSize(4194304)}catch(e){}e.on("message",((e,t)=>{try{const A=j(e);this.handlePacket(A,t.address,t.port)}catch(e){this.emit("error",e instanceof Error?e:new Error(String(e)))}})),e.on("error",(e=>this.emit("error",e))),e.on("close",(()=>this.emit("close"))),await new Promise((t=>e.bind(0,"0.0.0.0",(()=>t())))),"direct"===this.opts.mode?(this.remote={host:this.opts.host,port:this.opts.port},this.clientId=this.opts.clientId,this.cameraId=this.opts.cameraId):await this.discoveryUid(e),this.startTimers()}async discoveryUid(e){if("uid"!==this.opts.mode)throw new Error("Internal: discoveryUid called for non-uid mode");const t=[2015,2018],A="255.255.255.255";e.setBroadcast(!0);const s=e.address(),r="string"==typeof s?0:s.port,n=0|Math.floor(2147483647*Math.random())||82e3,i=function(e){const t=e.os??"MAC";return K(`<C2D_C><uid>${M(e.uid)}</uid><cli><port>${e.clientPort}</port></cli><cid>${e.cid}</cid><mtu>${e.mtu}</mtu><debug>false</debug><p>${M(t)}</p></C2D_C>`)}({uid:this.opts.uid,clientPort:r,cid:n,mtu:this.mtu}),a=await new Promise(((s,r)=>{const n=setTimeout((()=>{a&&clearInterval(a),e.off("message",p),r(new Error("BCUDP discovery timeout after 30000ms (camera may be sleeping or unreachable)"))}),3e4);let a,c,l,h,g,d=0,u=!1,E=!1,I=!1;const Q=t=>{h&&(g||(g=setTimeout((()=>{const A=h,r=c,i=l;A&&(e.off("message",p),clearTimeout(n),a&&clearInterval(a),this.emit("debug","discovery_finalize",{reason:t,...null!=r?{sid:r}:{},...A}),s({...A,...null!=r?{sid:r}:{},...null!=i?{tid:i}:{}}))}),250)))},C=(t,A)=>{if(!u&&h&&null!=c)try{const s=(0|Math.floor(2147483647*Math.random()))>>>0,r=z(s,function(e){const t=e.conn??"local";return K("<C2D_T>"+(null!=e.sid?`<sid>${e.sid}</sid>`:"")+`<conn>${M(t)}</conn><cid>${e.cid}</cid><mtu>${e.mtu}</mtu></C2D_T>`)}({...null!=c?{sid:c}:{},cid:h.cid,mtu:this.mtu,conn:"local"}));e.send(r,A,t),u=!0,this.emit("debug","discovery_t_send",{sid:c,cid:h.cid,did:h.did,rhost:t,rport:A})}catch(e){this.emit("debug","discovery_t_send_error",e)}},B=(t,A,s,r)=>{if(!I)try{const n=z(t,ee({sid:r.sid,conn:r.conn??"local",cid:r.cid,did:r.did,mtu:this.mtu}));e.send(n,s,A),I=!0,this.emit("debug","discovery_a_send",{sid:r.sid,cid:r.cid,did:r.did,rhost:A,rport:s})}catch(e){this.emit("debug","discovery_a_send_error",e)}},p=(e,t)=>{try{const A=j(e);if("discovery"!==A.kind)return;this.emit("debug","discovery_rx",{tid:A.tid,rhost:t.address,rport:t.port,xmlPreview:A.xml.slice(0,120)});const s=te(A.xml);s&&(c=s.sid,h||null==s.cid||null==s.did||(h={cid:s.cid,did:s.did,rhost:t.address,rport:t.port}),h&&(C(t.address,t.port),Q("cfm")));const r=Ae(A.xml);if(r)return E=!0,c=r.sid,h||(h={cid:r.cid,did:r.did,rhost:t.address,rport:t.port}),this.emit("debug","discovery_t_rx",{sid:r.sid,cid:r.cid,did:r.did,rhost:t.address,rport:t.port}),B(A.tid,t.address,t.port,r),void Q("t_a");const n=function(e){const t=/<D2C_C_R>([\s\S]*?)<\/D2C_C_R>/.exec(e);if(!t)return;const A=t[1]??"",s=/<rsp>(-?\d+)<\/rsp>/.exec(A)?.[1],r=/<cid>(-?\d+)<\/cid>/.exec(A)?.[1],n=/<did>(-?\d+)<\/did>/.exec(A)?.[1];if(null==s||null==r||null==n)return;const i=/<sid>(-?\d+)<\/sid>/.exec(A)?.[1],o=/<timer>([\s\S]*?)<\/timer>/.exec(A)?.[1],a=o?/<def>(-?\d+)<\/def>/.exec(o)?.[1]:void 0,c=o?/<hb>(-?\d+)<\/hb>/.exec(o)?.[1]:void 0,l=o?/<hbt>(-?\d+)<\/hbt>/.exec(o)?.[1]:void 0,h=null!=a||null!=c||null!=l?{...null!=a?{def:Number(a)}:{},...null!=c?{hb:Number(c)}:{},...null!=l?{hbt:Number(l)}:{}}:void 0;return{rsp:Number(s),cid:Number(r),did:Number(n),...null!=i?{sid:Number(i)}:{},...h?{timer:h}:{}}}(A.xml);if(!n)return;if(0!==n.rsp)return;return this.emit("debug","discovery_success",{retryCount:d,rhost:t.address,rport:t.port,sid:n.sid??c,timer:n.timer}),l=A.tid,h={cid:n.cid,did:n.did,rhost:t.address,rport:t.port},null!=n.sid&&(c=n.sid),C(t.address,t.port),void(E||I?Q("cr_t"):null!=c?(g&&clearTimeout(g),g=setTimeout((()=>{Q("cr_timeout")}),1500)):Q("cr_no_sid"))}catch{}};e.on("message",p);const f=()=>{const s=z((0|Math.floor(255*Math.random()))>>>0,i);for(const r of t)try{e.send(s,r,A),d++,this.emit("debug","discovery_send",{retryCount:d,host:A,port:r})}catch(e){this.emit("error",e instanceof Error?e:new Error(String(e)))}};f(),a=(0,o.setInterval)((()=>{f()}),500)}));this.clientId=a.cid,this.cameraId=a.did,this.sid=a.sid,this.discoveryTid=a.tid,this.remote={host:a.rhost,port:a.rport}}startTimers(){if(!this.sock||!this.remote||null==this.clientId||null==this.cameraId)throw new Error("BCUDP not ready");this.updateAckPacket(),this.sendHeartbeat(),this.ackTimer=(0,o.setInterval)((()=>{try{this.sendAckFast()}catch(e){this.emit("error",e instanceof Error?e:new Error(String(e)))}}),10),this.resendTimer=(0,o.setInterval)((()=>{try{this.resendOutstanding()}catch(e){this.emit("error",e instanceof Error?e:new Error(String(e)))}}),500),this.hbTimer=(0,o.setInterval)((()=>{try{this.sendHeartbeat()}catch(e){this.emit("error",e instanceof Error?e:new Error(String(e)))}}),1e3)}sendHeartbeat(){if(!this.sock||!this.remote||null==this.clientId||null==this.cameraId)return;const e=this.getKeepAliveTid();let t;var A;t=K(`<C2D_HB><cid>${(A={cid:this.clientId,did:this.cameraId}).cid}</cid><did>${A.did}</did></C2D_HB>`);const s=z(e,t);this.emit("debug","udp_hb_send",{tid:e,xml:t,host:this.remote.host,port:this.remote.port}),this.sock.send(s,this.remote.port,this.remote.host)}buildAckPayload(){if(0===this.packetsWant)return{packetId:4294967295,payload:Buffer.alloc(0)};let e=this.packetsWant;for(;this.received.has(e);)e++;let t=e-1;for(const e of this.received.keys())e>t&&(t=e);const A=e+200-1;if(t>A&&(t=A),t<e)return{packetId:e-1>>>0,payload:Buffer.alloc(0)};const s=t-e+1,r=Buffer.allocUnsafe(s);for(let t=0;t<s;t++)r[t]=this.received.has(e+t)?1:0;return{packetId:e-1>>>0,payload:r}}updateAckPacket(){if(null==this.cameraId)return;const{packetId:e,payload:t}=this.buildAckPayload();this.lastAckPacket=function(e){const t=e.payload??Buffer.alloc(0),A=Buffer.alloc(28);return A.writeUInt32LE(J,0),A.writeInt32LE(0|e.connectionId,4),A.writeUInt32LE(0,8),A.writeUInt32LE(e.groupId>>>0,12),A.writeUInt32LE(e.packetId>>>0,16),A.writeUInt32LE((e.maybeLatency??0)>>>0,20),A.writeUInt32LE(t.length>>>0,24),Buffer.concat([A,t])}({connectionId:this.cameraId,groupId:4294967295===e&&0===t.length?4294967295:0,packetId:e,maybeLatency:this.ackLatency.getValue(),payload:t})}sendAckFast(){this.sock&&this.remote&&0!==this.lastAckPacket.length&&(this.sock.send(this.lastAckPacket,this.remote.port,this.remote.host),this.ackSentCount++,this.ackSentCount%100==0&&this.emit("debug","ack_sent_100",{latency:this.ackLatency.getValue()}))}scheduleAck(e="data"){if("manual"===e){if(this.ackScheduled)return;this.ackScheduled=!0,setImmediate((()=>{this.ackScheduled=!1;try{this.sendAckFast()}catch(e){this.emit("error",e instanceof Error?e:new Error(String(e)))}})),this.emit("debug","ack_scheduled",{reason:e})}}resendOutstanding(){if(this.sock&&this.remote)for(const[,e]of this.sent)this.sock.send(e.buf,this.remote.port,this.remote.host)}handleAckFromCamera(e,t){if(4294967295!==e){for(const t of this.sent.keys())t<=e&&this.sent.delete(t);for(let A=0;A<t.length;A++){if((t[A]??0)>0){const t=e+1+A>>>0;this.sent.delete(t)}}}this.ackLatency.feed()}scheduleDrain(){this.drainScheduled||(this.drainScheduled=!0,setImmediate((()=>{this.drainScheduled=!1;try{for(;this.pendingDataOffset<this.pendingData.length;this.pendingDataOffset++)this.emit("data",this.pendingData[this.pendingDataOffset])}catch(e){this.emit("error",e instanceof Error?e:new Error(String(e)))}finally{this.pendingDataOffset>=this.pendingData.length&&(this.pendingData=[],this.pendingDataOffset=0)}})))}flushReceived(){for(;this.received.has(this.packetsWant);){const e=this.received.get(this.packetsWant);this.received.delete(this.packetsWant),this.packetsWant++,this.pendingData.push(e)}this.pendingData.length>this.pendingDataOffset&&this.scheduleDrain()}handlePacket(e,t,A){const s=e=>{this.remote&&this.remote.host===t&&this.remote.port===A||(this.remote={host:t,port:A},this.emit("debug","remote_update",{reason:e,host:t,port:A}))};if(this.remote||s("first_packet"),"ack"!==e.kind)if("data"!==e.kind){if("discovery"===e.kind){this.emit("debug","discovery_rx_connected",{tid:e.tid,xml:e.xml});const r=function(e){const t=/<D2C_HB>([\s\S]*?)<\/D2C_HB>/.exec(e);if(!t)return;const A=t[1]??"",s=/<cid>(-?\d+)<\/cid>/.exec(A)?.[1],r=/<did>(-?\d+)<\/did>/.exec(A)?.[1];return null!=s&&null!=r?{cid:Number(s),did:Number(r)}:void 0}(e.xml);if(r&&null!=this.clientId&&null!=this.cameraId&&r.cid===this.clientId&&r.did===this.cameraId){this.emit("debug","discovery_hb_rx_connected",{...r,rhost:t,rport:A});try{s("d2c_hb"),this.sendHeartbeat()}catch(e){this.emit("debug","discovery_hb_reply_error",e)}return}const n=Ae(e.xml);if(n&&null!=this.clientId&&null!=this.cameraId&&n.cid===this.clientId&&n.did===this.cameraId){try{s("d2c_t"),this.sid=n.sid,this.emit("debug","discovery_t_rx_connected",{sid:n.sid,cid:n.cid,did:n.did,rhost:t,rport:A});const r=Date.now(),i=750;if(null==this.lastAcceptAtMs||r-this.lastAcceptAtMs>=i){const s=ee({sid:n.sid,conn:n.conn??"local",cid:n.cid,did:n.did,mtu:this.mtu}),i=z(e.tid,s);this.sock?.send(i,A,t),this.acceptSent=!0,this.lastAcceptAtMs=r,this.emit("debug","discovery_a_send_connected",{sid:n.sid,cid:n.cid,did:n.did,rhost:t,rport:A})}else this.emit("debug","discovery_a_skip_throttle",{sinceMs:r-this.lastAcceptAtMs,throttleMs:i,sid:n.sid,cid:n.cid,did:n.did,rhost:t,rport:A})}catch(e){this.emit("debug","discovery_a_send_connected_error",e)}return}const i=te(e.xml);if(i&&null!=this.clientId&&null!=this.cameraId&&i.cid===this.clientId&&i.did===this.cameraId)return this.sid=i.sid,void this.emit("debug","discovery_cfm_rx_connected",i);const o=function(e){const t=/<D2C_DISC>([\s\S]*?)<\/D2C_DISC>/.exec(e);if(!t)return;const A=t[1]??"",s=/<cid>(-?\d+)<\/cid>/.exec(A)?.[1],r=/<did>(-?\d+)<\/did>/.exec(A)?.[1];return null!=s&&null!=r?{cid:Number(s),did:Number(r)}:void 0}(e.xml);if(o&&null!=this.clientId&&null!=this.cameraId&&o.cid===this.clientId&&o.did===this.cameraId)return this.emit("debug","discovery_disc_rx_connected",{...o,rhost:t,rport:A}),this.emit("error",new Error("BCUDP disconnected by camera (D2C_DISC)")),void this.close()}}else null!=this.clientId&&e.connectionId===this.clientId&&(s("data"),e.packetId>=this.packetsWant&&(this.received.set(e.packetId,e.payload),this.flushReceived(),this.updateAckPacket(),this.packetsWant%100==0&&this.emit("debug","udp_progress",{packetsWant:this.packetsWant})));else null!=this.clientId&&e.connectionId===this.clientId&&(s("ack"),this.handleAckFromCamera(e.packetId,e.payload))}write(e){if(!this.sock||!this.remote||null==this.cameraId)throw new Error("BCUDP stream is not connected");const t=this.mtu-20;for(let A=0;A<e.length;A+=t){const s=e.subarray(A,Math.min(e.length,A+t)),r=this.sendPacketId>>>0;this.sendPacketId=this.sendPacketId+1>>>0;const n=Z({connectionId:this.cameraId,packetId:r,payload:Buffer.from(s)});this.sent.set(r,{packetId:r,buf:n,ts:Date.now()}),this.sock.send(n,this.remote.port,this.remote.host)}}async close(){this.ackTimer&&clearInterval(this.ackTimer),this.resendTimer&&clearInterval(this.resendTimer),this.hbTimer&&clearInterval(this.hbTimer),this.ackTimer=void 0,this.resendTimer=void 0,this.hbTimer=void 0;const e=this.sock;this.sock=void 0,e&&await new Promise((t=>e.close((()=>t()))))}};function ne(e){e.dumpEnabled&&a.mkdirSync(e.dumpDir,{recursive:!0})}function ie(e,t,A,s){e.general&&t.debug(`[${A}] ${s}`)}function oe(e,t,A,s){e.traceStream&&t.debug(`[${A}] ${s}`)}function ae(e,t,A,s){e.traceTalk&&t.debug(`[${A}] ${s}`)}function ce(e,t,A,s){e.traceEvents&&t.debug(`[${A}] ${s}`)}function le(e){return 10===e||11===e||201===e||202===e}var he=class e extends r.EventEmitter{static streamingRegistry=new Map;opts;debugCfg;logger;tcpSocket;udpSocket;transport="tcp";parser=new F;pending=new Map;socketClosed=!1;msgNum=0;loggedIn=!1;subscribed=!1;keepAliveTimer;keepAlivePingInFlight=!1;idleDisconnectTimer;lastUserActivityAtMs;permitSeq=1;permits=new Map;lastRxAtMs;lastTxAtMs;lastRxInfo;lastTxInfo;rxHistory=[];txHistory=[];enc={kind:"none"};nonce;videoSubscriptions=new Map;contributesToGlobalStreamingRegistry=!1;streamTraceStats=new Map;rxCmdTraceStats=new Map;constructor(e){super(),this.opts=e,this.logger=e.logger??console,this.debugCfg=function(e){const t=!0===e?.general,A=!0===e?.debugRtsp,s=!0===e?.traceStream,r=!0===e?.traceTalk,n=!0===e?.traceEvents,i=!0===e?.debugH264,o=!0===e?.debugParamSets,a=!0===e?.dump?.enabled;return{general:t,debugRtsp:A,traceStream:s,traceTalk:r,traceEvents:n,debugH264:i,debugParamSets:o,dumpEnabled:a,dumpDir:e?.dump?.dir&&e.dump.dir.trim()||c.join(process.cwd(),"test","frames-debug"),dumpBcMedia:e?.dump?.bcmedia??a,dumpNals:e?.dump?.nals??a}}(e.debugOptions)}logFixed(e,t){const A=`[BaichuanClient] ${e}`,s=this.logger;"function"!=typeof s.info?"function"!=typeof s.log?"function"==typeof s.warn&&s.warn(A,t):s.log(A,t):s.info(A,t)}getIdleDisconnectTimeoutMs(){const e=this.opts.idleDisconnectTimeoutMs;return"number"==typeof e&&Number.isFinite(e)&&e>0?e:3e4}isIdleDisconnectEnabled(){return!0===this.opts.idleDisconnect}clearIdleDisconnectTimer(){this.idleDisconnectTimer&&(clearTimeout(this.idleDisconnectTimer),this.idleDisconnectTimer=void 0)}touchUserActivity(e){this.lastUserActivityAtMs=Date.now(),this.logDebug("user_activity",{reason:e,atMs:this.lastUserActivityAtMs})}isIdleDisconnectEligibleNow(){return!!this.isIdleDisconnectEnabled()&&(!!this.isSocketConnected()&&(!(this.pending.size>0)&&(!this.hasActiveVideoSubscriptionsInternal()&&!(this.permits.size>0))))}kickIdleDisconnectTimer(){if(!this.isIdleDisconnectEnabled())return;if(this.clearIdleDisconnectTimer(),!this.isIdleDisconnectEligibleNow())return;if(null==this.lastUserActivityAtMs)return;const e=this.getIdleDisconnectTimeoutMs(),t=Date.now()-this.lastUserActivityAtMs,A=Math.max(0,e-t);this.idleDisconnectTimer=setTimeout((()=>{try{if(!this.isIdleDisconnectEligibleNow())return;if(null==this.lastUserActivityAtMs)return;const t=Date.now()-this.lastUserActivityAtMs;if(t<e)return void this.kickIdleDisconnectTimer();this.logDebug("idle_disconnect",{elapsedMs:t,timeoutMs:e,transport:this.transport}),this.logFixed("idle_disconnect",{elapsedMs:t,timeoutMs:e,transport:this.transport,host:this.opts.host}),this.close()}catch(e){this.logDebug("idle_disconnect_error",e)}}),A),this.idleDisconnectTimer.unref?.()}acquirePermit(e=this.getIdleDisconnectTimeoutMs(),t){const A=Math.max(0,Math.floor(e)),s=this.permitSeq++,r=Date.now()+A;let n;return A>0&&(n=setTimeout((()=>this.releasePermit(s,"timeout")),A),n.unref?.()),this.permits.set(s,{timer:n,untilMs:r,reason:t}),this.logDebug("permit_acquired",{id:s,holdMs:A,untilMs:r,reason:t,permits:this.permits.size}),this.clearIdleDisconnectTimer(),()=>this.releasePermit(s,"manual")}releasePermit(e,t){const A=this.permits.get(e);A&&(A.timer&&clearTimeout(A.timer),this.permits.delete(e),this.logDebug("permit_released",{id:e,how:t,permits:this.permits.size}),this.kickIdleDisconnectTimer())}getDeviceRegistryKey(){const e=(this.opts.uid??"").trim().toUpperCase();return`${(this.opts.host??"").trim()}|${e}|${this.opts.channel??0}`}recomputeGlobalStreamingContribution(){const t=this.hasActiveVideoSubscriptionsInternal();if(t===this.contributesToGlobalStreamingRegistry)return;const A=this.getDeviceRegistryKey(),s=e.streamingRegistry.get(A)??{activeStreamClients:0},r=Math.max(0,s.activeStreamClients+(t?1:-1));0===r?e.streamingRegistry.delete(A):e.streamingRegistry.set(A,{activeStreamClients:r}),this.contributesToGlobalStreamingRegistry=t}isDeviceStreamingActive(){if(this.hasActiveVideoSubscriptionsInternal())return!0;const t=this.getDeviceRegistryKey(),A=e.streamingRegistry.get(t);return(A?.activeStreamClients??0)>0}logDebug(e,t){this.debugCfg.general&&(this.logger.debug(`[BaichuanClient] ${e}`,t),this.emit("debug",e,t))}getTransport(){return this.transport}getConfiguredChannel(){return this.opts.channel??0}refreshKeepAlive(){this.stopKeepAlive(),this.isSocketConnected()&&this.startKeepAlive()}getLastRxAtMs(){return this.lastRxAtMs}getLastRxInfo(){return this.lastRxInfo}getRxHistory(){return this.rxHistory}getLastTxAtMs(){return this.lastTxAtMs}getLastTxInfo(){return this.lastTxInfo}getTxHistory(){return this.txHistory}recordTx(e){const t=Date.now();this.lastTxAtMs=t,this.lastTxInfo={atMs:t,...e},this.txHistory.push(this.lastTxInfo),this.txHistory.length>32&&this.txHistory.shift()}isProbablySleeping(e=15e3){return"udp"===this.transport&&(this.isIdleDisconnectEnabled()?!this.isSocketConnected():!this.isSocketConnected()||!this.isDeviceStreamingActive()&&(null!=this.lastRxAtMs&&Date.now()-this.lastRxAtMs>=e))}getDebugConfig(){return this.debugCfg}isSocketConnected(){return"tcp"===this.transport?void 0!==this.tcpSocket&&!this.tcpSocket.destroyed:"udp"===this.transport&&(void 0!==this.udpSocket&&(this.udpSocket.isConnected?.()??!0))}get username(){return this.opts.username}startKeepAlive(){if(this.keepAliveTimer)return;let e=3e4;if("udp"===this.transport){if(!this.shouldSendUdpKeepAlive())return;e=2500}e<=0||(this.keepAliveTimer=setInterval((()=>{if("udp"!==this.transport)this.keepAlivePingInFlight||(this.keepAlivePingInFlight=!0,(async()=>{try{await this.sendPing()}catch(e){this.logDebug("keepalive_ping_error",e)}finally{this.keepAlivePingInFlight=!1}})());else try{this.sendUdpKeepAlive()}catch(e){this.logDebug("udp_keepalive_ping_error",e)}}),e),this.keepAliveTimer.unref?.())}hasActiveVideoSubscriptionsInternal(){for(const e of this.videoSubscriptions.values())if(e.size>0)return!0;return!1}hasActiveVideoSubscriptions(){return this.hasActiveVideoSubscriptionsInternal()}shouldSendUdpKeepAlive(){return"udp"===this.transport&&(!!this.udpSocket&&(!!this.loggedIn&&!!this.hasActiveVideoSubscriptionsInternal()))}sendUdpKeepAlive(){if("udp"!==this.transport)return;if(!this.udpSocket)return;if(!this.loggedIn)return;const e=this.nextMsgNum(),t=k({cmdId:y,bodyLen:0,channelId:0,streamType:0,msgNum:e,responseCode:0,messageClass:B,payloadOffset:0});this.logDebug("udp_keepalive_ping_tx",{msgNum:e,channelId:0,streamType:0}),this.recordTx({cmdId:y,responseCode:0,msgNum:e,channelId:0,streamType:0}),this.writeWire(t)}stopKeepAlive(){this.keepAliveTimer&&(clearInterval(this.keepAliveTimer),this.keepAliveTimer=void 0),this.keepAlivePingInFlight=!1}async sendPing(){if((this.tcpSocket||this.udpSocket)&&this.loggedIn)try{await this.sendFrame({cmdId:93,channel:this.opts.channel??0,channelIdOverride:0,messageClass:B,streamType:0,extensionXml:"",internal:!0})}catch(e){this.logDebug("keepalive_ping_failed",e)}}async connect(){const e=this.opts.transport??"tcp";if("tcp"!==e)if("udp"!==e)try{await Promise.race([this.connectTcp(),new Promise(((e,t)=>setTimeout((()=>t(new Error("TCP connection timeout (falling back to UDP)"))),4e3)))])}catch(e){if(this.logDebug("auto:tcp_failed",e),!this.opts.uid)throw new Error("TCP connection failed and UDP fallback requires `options.uid` (BCUDP discovery UID).");await this.connectUdp()}else await this.connectUdp();else await this.connectTcp()}async connectTcp(){if(this.tcpSocket&&!this.tcpSocket.destroyed)return void(this.transport="tcp");const e=this.opts.port??u,t=n.createConnection({host:this.opts.host,port:e});this.tcpSocket=t,this.transport="tcp",this.socketClosed=!1;try{t.setKeepAlive(!0,3e4)}catch(e){this.logDebug("tcp_setKeepAlive_failed",e)}t.on("data",(e=>{const t=this.parser.push(e);for(const e of t)this.handleFrame(e)})),t.on("close",(()=>{this.stopKeepAlive(),this.socketClosed=!0,this.logFixed("disconnected",{transport:"tcp",host:this.opts.host,port:this.opts.port??u,lastRx:this.lastRxInfo,lastTx:this.lastTxInfo}),this.emit("close");const e=Array.from(this.pending.entries());this.pending.clear();for(const[,t]of e)setImmediate((()=>{try{t.reject(new Error("Baichuan socket closed"))}catch(e){}}))})),t.on("error",(e=>this.emit("error",e))),await new Promise(((e,A)=>{t.once("connect",(()=>e())),t.once("error",(e=>A(e)))})),this.logFixed("connected",{transport:"tcp",host:this.opts.host,port:this.opts.port??u}),this.startKeepAlive(),this.kickIdleDisconnectTimer()}async connectUdp(){if(this.udpSocket){if(this.udpSocket.isConnected?.())return void(this.transport="udp");try{await this.udpSocket.close()}catch{}this.udpSocket=void 0}if(!this.opts.uid)throw new Error("Baichuan UDP requested but `options.uid` is not set (required for BCUDP discovery).");const e=new re({mode:"uid",uid:this.opts.uid});this.udpSocket=e,this.transport="udp",this.socketClosed=!1,e.on("data",(e=>{const t=this.parser.push(e);for(const e of t)this.handleFrame(e)})),e.on("close",(()=>{this.stopKeepAlive(),this.socketClosed=!0,this.logFixed("disconnected",{transport:"udp",host:this.opts.host,uid:this.opts.uid,lastRx:this.lastRxInfo,lastTx:this.lastTxInfo}),this.loggedIn=!1,this.subscribed=!1,this.contributesToGlobalStreamingRegistry&&(this.videoSubscriptions.clear(),this.recomputeGlobalStreamingContribution()),this.udpSocket===e&&(this.udpSocket=void 0),this.emit("close");const t=Array.from(this.pending.entries());this.pending.clear();for(const[,e]of t)setImmediate((()=>{try{e.reject(new Error("Baichuan UDP stream closed"))}catch(e){}}))})),e.on("error",(e=>{e?.message?.includes("D2C_DISC")&&(this.stopKeepAlive(),this.loggedIn=!1,this.subscribed=!1,this.contributesToGlobalStreamingRegistry&&(this.videoSubscriptions.clear(),this.recomputeGlobalStreamingContribution())),this.emit("error",e)})),e.on("debug",((e,t)=>{this.logDebug(`udp_${e}`,t)})),await e.connect(),this.logFixed("connected",{transport:"udp",host:this.opts.host,uid:this.opts.uid}),this.startKeepAlive(),this.kickIdleDisconnectTimer()}async close(){this.stopKeepAlive(),this.clearIdleDisconnectTimer();for(const e of Array.from(this.permits.keys()))this.releasePermit(e,"close");this.contributesToGlobalStreamingRegistry&&(this.videoSubscriptions.clear(),this.recomputeGlobalStreamingContribution());const e=this.tcpSocket;this.tcpSocket=void 0,e&&await new Promise((t=>{e.once("close",(()=>t())),e.destroy()}));const t=this.udpSocket;this.udpSocket=void 0,t&&await t.close()}handleFrame(e){const t=Date.now();if(this.lastRxAtMs=t,this.lastRxInfo={atMs:t,cmdId:e.header.cmdId,responseCode:e.header.responseCode,msgNum:e.header.msgNum,channelId:e.header.channelId,streamType:e.header.streamType},this.rxHistory.push(this.lastRxInfo),this.rxHistory.length>32&&this.rxHistory.shift(),this.debugCfg.general)if(3===e.header.cmdId){const A=this.rxCmdTraceStats.get(3)??{lastLogMs:t,frames:0};A.frames++,t-A.lastLogMs>=1e3&&(ie(this.debugCfg,this.logger,"BaichuanRx",`rx cmdId=3 frames=${A.frames} lastMsgNum=${e.header.msgNum} lastResponseCode=${e.header.responseCode} lastChannelId=${e.header.channelId} lastStreamType=${e.header.streamType} lastBodyLen=${e.body.length} lastPayloadLen=${e.payload.length}`),A.lastLogMs=t,A.frames=0),this.rxCmdTraceStats.set(3,A)}else ie(this.debugCfg,this.logger,"BaichuanRx",`rx cmdId=${e.header.cmdId} msgNum=${e.header.msgNum} responseCode=${e.header.responseCode} channelId=${e.header.channelId} streamType=${e.header.streamType} bodyLen=${e.body.length} payloadLen=${e.payload.length} payloadOffset=${e.header.payloadOffset??0}`);if("udp"===this.transport&&e.header.cmdId===y){try{const t=k({cmdId:e.header.cmdId,bodyLen:0,channelId:e.header.channelId,streamType:e.header.streamType,msgNum:e.header.msgNum,responseCode:200,messageClass:e.header.messageClass,payloadOffset:0});this.logDebug("udp_keepalive_rx",{msgNum:e.header.msgNum,channelId:e.header.channelId,streamType:e.header.streamType,responseCode:e.header.responseCode}),this.recordTx({cmdId:e.header.cmdId,responseCode:200,msgNum:e.header.msgNum,channelId:e.header.channelId,streamType:e.header.streamType}),this.writeWire(t),this.logDebug("udp_keepalive_tx",{msgNum:e.header.msgNum,channelId:e.header.channelId,streamType:e.header.streamType})}catch(e){this.logDebug("udp_keepalive_error",e)}return}this.debugCfg.traceTalk&&le(e.header.cmdId)&&ae(this.debugCfg,this.logger,"BaichuanTalk",`rx cmdId=${e.header.cmdId} msgNum=${e.header.msgNum} responseCode=${e.header.responseCode} channelId=${e.header.channelId} bodyLen=${e.body.length} payloadLen=${e.payload.length} payloadOffset=${e.header.payloadOffset??0}`),this.emit("frame",e);const A=`${e.header.cmdId}:${e.header.msgNum}`,s=this.pending.get(A);if(s)return this.pending.delete(A),void s.resolve(e);const r=this.videoSubscriptions.get(e.header.cmdId);if(r&&r.size>0){if(r.has(e.header.msgNum)){if(this.debugCfg.traceStream&&3===e.header.cmdId){const t=Date.now(),A=e.header.msgNum,s=this.streamTraceStats.get(A)??{lastLogMs:t,frames:0};s.frames++,t-s.lastLogMs>=500&&(oe(this.debugCfg,this.logger,"BaichuanTrace",`rx stream frames cmdId=3 msgNum=${e.header.msgNum} frames=${s.frames} lastChannelId=${e.header.channelId} lastBodyLen=${e.body.length} lastPayloadLen=${e.payload.length} lastPayloadOffset=${e.header.payloadOffset??0}`),s.lastLogMs=t,s.frames=0),this.streamTraceStats.set(A,s)}this.emit("push",e)}}else if(this.emit("push",e),33===e.header.cmdId)try{const t=this.parseEvents(e);for(const A of t)ce(this.debugCfg,this.logger,"BaichuanEvent",`dispatch cmdId=33 msgNum=${e.header.msgNum} channelId=${e.header.channelId} type=${A.type} eventChannel=${A.channel}`+("ai"===A.type?` aiType=${A.ai?.type??"unknown"} detected=${A.ai?.detected??""}`:"")+("motion"===A.type?` source=${A.motion?.source??""}`:"")),this.emit("event",A)}catch(e){this.logDebug("event_parse_error",e)}}subscribeVideoStream(e,t){this.videoSubscriptions.has(e)||this.videoSubscriptions.set(e,new Set),this.videoSubscriptions.get(e).add(t),3!==e||this.streamTraceStats.has(t)||this.streamTraceStats.set(t,{lastLogMs:Date.now(),frames:0}),"udp"===this.transport&&this.refreshKeepAlive(),this.recomputeGlobalStreamingContribution(),this.kickIdleDisconnectTimer()}unsubscribeVideoStream(e,t){const A=this.videoSubscriptions.get(e);A&&(void 0!==t?(A.delete(t),0===A.size&&this.videoSubscriptions.delete(e),3===e&&this.streamTraceStats.delete(t)):(this.videoSubscriptions.delete(e),3===e&&this.streamTraceStats.clear()),"udp"===this.transport&&this.refreshKeepAlive(),this.recomputeGlobalStreamingContribution(),this.kickIdleDisconnectTimer())}parseEvents(e){const t=e.body;if(0===t.length)return[];const A=this.tryDecryptXml(t,e.header.channelId,this.enc);if(!A||!A.startsWith("<?xml"))return[];if(this.debugCfg.traceEvents){const t=A.length>500?`${A.slice(0,500)}...`:A;ce(this.debugCfg,this.logger,"BaichuanEventRaw",`rx cmdId=${e.header.cmdId} msgNum=${e.header.msgNum} responseCode=${e.header.responseCode} channelId=${e.header.channelId} xml=${JSON.stringify(t)}`)}const s=e.header.channelId,r=250===s?0:Math.max(0,s-1),n=Date.now();if(A.includes("<AlarmEventList")){const e=[],t=A.matchAll(/<AlarmEvent\b[^>]*>([\s\S]*?)<\/AlarmEvent>/g);for(const A of t){const t=A[1]??"",s=H(t,"channelId"),i=void 0!==s?Number(s):r,o=(H(t,"status")??"").trim(),a=o.toUpperCase(),c=(H(t,"AItype")??H(t,"aiType")??H(t,"aitype")??"").trim();this.debugCfg.traceEvents&&ce(this.debugCfg,this.logger,"BaichuanEventRaw",`AlarmEvent channel=${i} status=${JSON.stringify(o)} aiType=${JSON.stringify(c)}`);const l=o.toLowerCase(),h=l.length>0&&"none"!==l,g=c.trim().length>0&&"none"!==c.trim().toLowerCase();if(h||g){const t=a.includes("MD")?"md":a.includes("PIR")||a.includes("OTHER")?"pir":"unknown";e.push({channel:i,type:"motion",motion:{channel:i,state:!0,timestamp:n,source:t},timestamp:n})}const d=c?c.split(",").map((e=>e.trim())).find((e=>e.length>0&&"none"!==e.toLowerCase())):void 0;if(d){const t=d.toLowerCase(),A={people:"people",person:"people",human:"people",vehicle:"vehicle",car:"vehicle",dog_cat:"dog_cat",dog:"dog_cat",cat:"dog_cat",pet:"dog_cat",face:"face",package:"package"};e.push({channel:i,type:"ai",ai:{channel:i,type:A[t]??"other",detected:!0,timestamp:n},timestamp:n})}else a.includes("AI")&&e.push({channel:i,type:"ai",ai:{channel:i,type:"other",detected:!0,timestamp:n},timestamp:n});a.includes("VIS")&&e.push({channel:i,type:"visitor",timestamp:n}),a.includes("DN")&&e.push({channel:i,type:"daynight",timestamp:n})}return e}const i=A.match(/<Event\b[^>]*>([\s\S]*?)<\/Event>/);if(!i)return[];const o=i[1]??"",a=(H(o,"status")??"").trim(),c=a.toUpperCase(),l=(H(o,"AItype")??H(o,"aiType")??H(o,"aitype")??"").trim(),h=[],g=a.toLowerCase(),d=g.length>0&&"none"!==g,u=l.trim().length>0&&"none"!==l.trim().toLowerCase();if(d||u){const e=c.includes("MD")?"md":c.includes("PIR")||c.includes("OTHER")?"pir":"unknown";h.push({channel:r,type:"motion",motion:{channel:r,state:!0,timestamp:n,source:e},timestamp:n})}const E=l?l.split(",").map((e=>e.trim())).find((e=>e.length>0&&"none"!==e.toLowerCase())):void 0;if(E){const e=E.toLowerCase(),t={people:"people",person:"people",human:"people",vehicle:"vehicle",car:"vehicle",dog_cat:"dog_cat",dog:"dog_cat",cat:"dog_cat",pet:"dog_cat",face:"face",package:"package"};h.push({channel:r,type:"ai",ai:{channel:r,type:t[e]??"other",detected:!0,timestamp:n},timestamp:n})}else c.includes("AI")&&h.push({channel:r,type:"ai",ai:{channel:r,type:"other",detected:!0,timestamp:n},timestamp:n});return c.includes("VIS")&&h.push({channel:r,type:"visitor",timestamp:n}),c.includes("DN")&&h.push({channel:r,type:"daynight",timestamp:n}),h}nextMsgNum(){return this.msgNum=this.msgNum+1&65535,this.msgNum}peekNextMsgNum(){return this.msgNum+1&65535}requireSocket(){if("tcp"!==this.transport)throw new Error("Internal: requireSocket called while not using TCP");if(!this.tcpSocket||this.tcpSocket.destroyed)throw new Error("Baichuan TCP socket is not connected");return this.tcpSocket}writeWire(e){if(this.lastTxAtMs=Date.now(),"tcp"!==this.transport){if(!this.udpSocket)throw new Error("Baichuan UDP stream is not connected");this.udpSocket.write(e)}else this.requireSocket().write(e)}encodeBodyXml(e,t,A,s){const r=Buffer.from(e,"utf8"),n=Buffer.from(t,"utf8");return"none"===s.kind?Buffer.concat([r,n]):"bc"===s.kind?Buffer.concat([b(r,A),b(n,A)]):"aes"===s.kind||"full_aes"===s.kind?Buffer.concat([R(r,s.key),R(n,s.key)]):Buffer.concat([r,n])}encodeBodyBinary(e,t,A,s){const r=Buffer.from(e,"utf8");return"none"===s.kind?Buffer.concat([r,t]):"bc"===s.kind?Buffer.concat([b(r,A),t]):"aes"===s.kind||"full_aes"===s.kind?Buffer.concat([R(r,s.key),t]):Buffer.concat([r,t])}async sendBinaryPayloadNoReply(e){const t=!0===e.internal;t||this.touchUserActivity(`sendBinaryPayloadNoReply cmdId=${e.cmdId}`),await this.connect(),t||this.kickIdleDisconnectTimer();const A=e.channel??this.opts.channel??0,s=e.channelIdOverride??(null==e.channel?250:A+1),r=this.nextMsgNum(),n=e.cmdId,i=e.extensionXml??L(A),o=Buffer.byteLength(i,"utf8"),a=o+e.payload.length,c=e.messageClass??B,l=k({cmdId:n,bodyLen:a,channelId:s,streamType:e.streamType??0,msgNum:r,responseCode:0,messageClass:c,payloadOffset:o}),h=e.encryption??this.enc,g=this.encodeBodyBinary(i,e.payload,s,h),d=Buffer.concat([l,g]);this.logDebug("tx",{cmdId:n,msgNum:r,channelId:s,messageClass:c,bodyLen:a,binaryPayload:!0}),this.debugCfg.traceTalk&&le(n)&&ae(this.debugCfg,this.logger,"BaichuanTalk",`tx cmdId=${n} msgNum=${r} channelId=${s} streamType=${e.streamType??0} class=0x${c.toString(16)} bodyLen=${a} payloadOffset=${o} binaryPayloadLen=${e.payload.length}`),this.recordTx({cmdId:n,responseCode:0,msgNum:r,channelId:s,streamType:e.streamType??0}),this.writeWire(d),t||this.kickIdleDisconnectTimer()}tryDecryptXml(e,t,A){const s=e=>e.toString("utf8"),r=A=>{let r;try{r="none"===A.kind?e:"bc"===A.kind?N(e,t):v(e,A.key)}catch{return}const n=s(r);return n.startsWith("<?xml")?n:void 0};return r(A)??("bc"!==A.kind?r({kind:"bc"}):void 0)??r({kind:"none"})??s(e)}async sendXml(e){const t=!0===e.internal;t||this.touchUserActivity(`sendXml cmdId=${e.cmdId}`),await this.connect(),t||this.kickIdleDisconnectTimer();const A=e.channel??this.opts.channel??0,s=e.channelIdOverride??(null==e.channel?250:A+1),r=this.nextMsgNum(),n=e.cmdId,i=e.extensionXml??(null!=e.channel?U(A):""),o=e.payloadXml??"",a=e.messageClass??B,c=Buffer.byteLength(i,"utf8"),l=c+Buffer.byteLength(o,"utf8"),h=k({cmdId:n,bodyLen:l,channelId:s,streamType:e.streamType??0,msgNum:r,responseCode:0,messageClass:a,payloadOffset:c}),g=`${n}:${r}`,d=e.encryption??this.enc,u=this.encodeBodyXml(i,o,s,d),E=Buffer.concat([h,u]),I=e.timeoutMs??1e4;let Q;const C=new Promise(((e,t)=>{Q=t;const A=setTimeout((()=>{this.pending.delete(g),t(new Error(`Baichuan timeout cmdId=${n} msgNum=${r}`))}),I);this.pending.set(g,{resolve:t=>{clearTimeout(A),e(t)},reject:e=>{clearTimeout(A),t(e)}})}));C.catch((()=>{})),this.logDebug("tx",{cmdId:n,msgNum:r,channelId:s,messageClass:a,bodyLen:l}),!this.debugCfg.traceStream||3!==n&&4!==n||oe(this.debugCfg,this.logger,"BaichuanTrace",`tx cmdId=${n} msgNum=${r} channelId=${s} streamType=${e.streamType??0} class=0x${a.toString(16)} bodyLen=${l} payloadOffset=${c}`),this.debugCfg.traceTalk&&le(n)&&ae(this.debugCfg,this.logger,"BaichuanTalk",`tx cmdId=${n} msgNum=${r} channelId=${s} streamType=${e.streamType??0} class=0x${a.toString(16)} bodyLen=${l} payloadOffset=${c}`),this.recordTx({cmdId:n,responseCode:0,msgNum:r,channelId:s,streamType:e.streamType??0}),this.writeWire(E);const p=await C;if(this.logDebug("rx",{cmdId:p.header.cmdId,responseCode:p.header.responseCode,msgNum:p.header.msgNum}),!this.debugCfg.traceStream||3!==n&&4!==n||oe(this.debugCfg,this.logger,"BaichuanTrace",`rx cmdId=${p.header.cmdId} msgNum=${p.header.msgNum} responseCode=${p.header.responseCode} channelId=${p.header.channelId} bodyLen=${p.body.length} payloadLen=${p.payload.length} payloadOffset=${p.header.payloadOffset??0}`),this.debugCfg.traceTalk&&le(n)&&ae(this.debugCfg,this.logger,"BaichuanTalk",`rx cmdId=${p.header.cmdId} msgNum=${p.header.msgNum} responseCode=${p.header.responseCode} channelId=${p.header.channelId} bodyLen=${p.body.length} payloadLen=${p.payload.length} payloadOffset=${p.header.payloadOffset??0}`),400===p.header.responseCode){if(0===p.body.length)throw new Error("Baichuan authentication failed (responseCode 400, empty body) - check username/password")}const f=p.body;if(0===f.length)return t||this.kickIdleDisconnectTimer(),"";const m=this.tryDecryptXml(f,p.header.channelId,d);return t||this.kickIdleDisconnectTimer(),m}async sendFrame(e){const t=!0===e.internal;t||this.touchUserActivity(`sendFrame cmdId=${e.cmdId}`),await this.connect(),t||this.kickIdleDisconnectTimer();const A=e.channel??this.opts.channel??0,s=e.channelIdOverride??(null==e.channel?250:A+1),r=e.msgNumOverride??this.nextMsgNum(),n=e.cmdId,i=e.extensionXml??(null!=e.channel?U(A):""),o=e.payloadXml??"",a=e.messageClass??B,c=Buffer.byteLength(i,"utf8"),l=c+Buffer.byteLength(o,"utf8"),h=k({cmdId:n,bodyLen:l,channelId:s,streamType:e.streamType??0,msgNum:r,responseCode:0,messageClass:a,payloadOffset:c}),g=`${n}:${r}`,d=e.encryption??this.enc,u=this.encodeBodyXml(i,o,s,d),E=Buffer.concat([h,u]),I=e.timeoutMs??1e4;let Q;const C=new Promise(((e,t)=>{Q=t;const A=setTimeout((()=>{this.pending.delete(g),t(new Error(`Baichuan timeout cmdId=${n} msgNum=${r}`))}),I);this.pending.set(g,{resolve:t=>{clearTimeout(A),e(t)},reject:e=>{clearTimeout(A),t(e)}})}));C.catch((()=>{})),this.logDebug("tx",{cmdId:n,msgNum:r,channelId:s,messageClass:a,bodyLen:l}),!this.debugCfg.traceStream||3!==n&&4!==n||oe(this.debugCfg,this.logger,"BaichuanTrace",`tx cmdId=${n} msgNum=${r} channelId=${s} streamType=${e.streamType??0} class=0x${a.toString(16)} bodyLen=${l} payloadOffset=${c}`),this.debugCfg.traceTalk&&le(n)&&ae(this.debugCfg,this.logger,"BaichuanTalk",`tx cmdId=${n} msgNum=${r} channelId=${s} streamType=${e.streamType??0} class=0x${a.toString(16)} bodyLen=${l} payloadOffset=${c}`),this.recordTx({cmdId:n,responseCode:0,msgNum:r,channelId:s,streamType:e.streamType??0}),this.writeWire(E);const p=await C;return this.logDebug("rx",{cmdId:p.header.cmdId,responseCode:p.header.responseCode,msgNum:p.header.msgNum}),!this.debugCfg.traceStream||3!==n&&4!==n||oe(this.debugCfg,this.logger,"BaichuanTrace",`rx cmdId=${p.header.cmdId} msgNum=${p.header.msgNum} responseCode=${p.header.responseCode} channelId=${p.header.channelId} bodyLen=${p.body.length} payloadLen=${p.payload.length} payloadOffset=${p.header.payloadOffset??0}`),this.debugCfg.traceTalk&&le(n)&&ae(this.debugCfg,this.logger,"BaichuanTalk",`rx cmdId=${p.header.cmdId} msgNum=${p.header.msgNum} responseCode=${p.header.responseCode} channelId=${p.header.channelId} bodyLen=${p.body.length} payloadLen=${p.payload.length} payloadOffset=${p.header.payloadOffset??0}`),t||this.kickIdleDisconnectTimer(),p}async sendBinary(e){const t=!0===e.internal;if(t||this.touchUserActivity(`sendBinary cmdId=${e.cmdId}`),109===e.cmdId){const A=await this.sendBinarySnapshot109(e);return t||this.kickIdleDisconnectTimer(),A}if((e.messageClass??B)===p){const A=await this.sendBinaryFileDownload6482(e);return t||this.kickIdleDisconnectTimer(),A}await this.connect(),t||this.kickIdleDisconnectTimer();const A=e.channel??this.opts.channel??0,s=e.channelIdOverride??(null==e.channel?250:A+1),r=this.nextMsgNum(),n=e.cmdId,i=e.extensionXml??(null!=e.channel?L(A):L(void 0)),o=e.payloadXml??"",a=e.messageClass??B,c=Buffer.byteLength(i,"utf8"),l=c+Buffer.byteLength(o,"utf8"),h=k({cmdId:n,bodyLen:l,channelId:s,streamType:0,msgNum:r,responseCode:0,messageClass:a,payloadOffset:c}),g=`${n}:${r}`,d=e.encryption??this.enc,u=this.encodeBodyXml(i,o,s,d),E=Buffer.concat([h,u]),I=e.timeoutMs??1e4;let Q;const C=new Promise(((e,t)=>{Q=t;const A=setTimeout((()=>{this.pending.delete(g),t(new Error(`Baichuan timeout cmdId=${n} msgNum=${r}`))}),I);this.pending.set(g,{resolve:t=>{clearTimeout(A),e(t)},reject:e=>{clearTimeout(A),t(e)}})}));C.catch((()=>{})),this.logDebug("tx",{cmdId:n,msgNum:r,channelId:s,messageClass:a,bodyLen:l,binary:!0}),this.recordTx({cmdId:n,responseCode:0,msgNum:r,channelId:s,streamType:0}),this.writeWire(E);const f=await C;if(this.logDebug("rx",{cmdId:f.header.cmdId,responseCode:f.header.responseCode,msgNum:f.header.msgNum,binary:!0}),400===f.header.responseCode){if(0===f.body.length)throw new Error("Baichuan binary request failed (responseCode 400, empty body)")}const m=f.payload;if(0===m.length)return Buffer.alloc(0);const y=this.tryDecryptBinary(m,f.header.channelId,d);return t||this.kickIdleDisconnectTimer(),y}async sendBinaryFileDownload6482(e){await this.connect();const t=e.channel??this.opts.channel??0,A=e.channelIdOverride??(null==e.channel?250:t+1),s=this.nextMsgNum(),r=e.cmdId,n=e.extensionXml??L(t),i=e.payloadXml??"",o=e.messageClass??p,a=Buffer.byteLength(n,"utf8"),c=a+Buffer.byteLength(i,"utf8"),l=k({cmdId:r,bodyLen:c,channelId:A,streamType:e.streamType??0,msgNum:s,responseCode:0,messageClass:o,payloadOffset:a}),h=e.encryption??this.enc,g=this.encodeBodyXml(n,i,A,h),d=Buffer.concat([l,g]),u=e.timeoutMs??6e4,E=[];let I=0,Q=0;return await new Promise(((t,n)=>{let i,a=!1;const l=()=>{this.off("frame",C),i&&clearTimeout(i)},g=e=>{a||(a=!0,l(),n(e instanceof Error?e:new Error(String(e))))},C=e=>{var A;if(e.header.cmdId===r)if(e.header.msgNum===s&&e.header.responseCode>=400)g(new Error(`Baichuan file download request rejected (cmdId=${r} msgNum=${s} responseCode=${e.header.responseCode})`));else try{let n=!1;if(e.extension.length>0)try{this.tryDecryptXml(e.extension,e.header.channelId,h).includes("<binaryData>1</binaryData>")&&(n=!0)}catch{}const i=this.tryDecryptBinary(e.payload,e.header.channelId,h);if(0===i.length)return;if(!n&&(e=>{let t=0;for(;t<e.length&&(0===e[t]||9===e[t]||10===e[t]||13===e[t]||32===e[t]);)t++;return!(t>=e.length)&&60===e[t]})(i))return;E.push(i),I+=i.length;const o=Date.now();this.debugCfg.general&&o-Q>=2e3&&(Q=o,this.logDebug("file_download_progress",{cmdId:r,msgNum:s,bytes:I})),201===e.header.responseCode&&(A=Buffer.concat(E),a||(a=!0,l(),t(A)))}catch(e){g(e)}};i=setTimeout((()=>{g(new Error(`Baichuan timeout waiting file download chunks cmdId=${r} msgNum=${s}`))}),u),this.on("frame",C);try{this.logDebug("tx",{cmdId:r,msgNum:s,channelId:A,messageClass:o,bodyLen:c,binary:!0,fileDownload:!0}),this.recordTx({cmdId:r,responseCode:0,msgNum:s,channelId:A,streamType:e.streamType??0}),this.writeWire(d)}catch(e){g(e)}}))}async sendBinarySnapshot109(e){await this.connect();const t=e.channel??this.opts.channel??0,A=e.channelIdOverride??(null==e.channel?250:t+1),s=this.nextMsgNum(),r=e.cmdId,n=e.extensionXml??(null!=e.channel?U(t):""),i=e.payloadXml??"",o=e.messageClass??B,a=Buffer.byteLength(n,"utf8"),c=a+Buffer.byteLength(i,"utf8"),l=k({cmdId:r,bodyLen:c,channelId:A,streamType:e.streamType??0,msgNum:s,responseCode:0,messageClass:o,payloadOffset:a}),h=e.encryption??this.enc,g=this.encodeBodyXml(n,i,A,h),d=Buffer.concat([l,g]),u=e.timeoutMs??15e3,E=[];let I=!1;return await new Promise(((t,n)=>{let i,a=!1;const l=()=>{this.off("frame",C),i&&clearTimeout(i)},g=e=>{a||(a=!0,l(),t(e))},Q=e=>{a||(a=!0,l(),n(e instanceof Error?e:new Error(String(e))))},C=e=>{if(e.header.cmdId===r)if(e.header.msgNum===s&&e.header.responseCode>=400)Q(new Error(`Baichuan snapshot request rejected (cmdId=${r} msgNum=${s} responseCode=${e.header.responseCode})`));else try{let t=!1;if(e.extension.length>0){this.tryDecryptXml(e.extension,e.header.channelId,h).includes("<binaryData>1</binaryData>")&&(t=!0)}const A=this.tryDecryptBinary(e.payload,e.header.channelId,h);if(0===A.length)return;const s=A.subarray(0,Math.min(16,A.length)).toString("utf8"),r=s.startsWith("<?xml")||s.trimStart().startsWith("<");if(!t&&r)return;let n=A;if(!I){const s=(e=>{for(let t=0;t+1<e.length;t++)if(255===e[t]&&216===e[t+1])return t;return-1})(A);if(-1===s){if(!t)return;n=A,E.push(n);const s=Buffer.concat(E);return void(201===e.header.responseCode&&g(s))}I=!0,n=A.subarray(s)}E.push(n);const i=Buffer.concat(E);if((e=>{for(let t=0;t+1<e.length;t++)if(255===e[t]&&217===e[t+1])return!0;return!1})(i)||201===e.header.responseCode){const e=i.indexOf(Buffer.from([255,217]));if(-1!==e)return void g(i.subarray(0,e+2));g(i)}}catch(e){Q(e)}};i=setTimeout((()=>{Q(new Error(`Baichuan timeout waiting snapshot push cmdId=${r} msgNum=${s}`))}),u),this.on("frame",C);try{this.logDebug("tx",{cmdId:r,msgNum:s,channelId:A,messageClass:o,bodyLen:c,binary:!0,snapshot:!0}),this.recordTx({cmdId:r,responseCode:0,msgNum:s,channelId:A,streamType:e.streamType??0}),this.writeWire(d)}catch(e){Q(e)}}))}tryDecryptBinary(e,t,A){if(0===e.length)return e;const s=A=>{try{return"none"===A.kind?e:"bc"===A.kind?N(e,t):"aes"===A.kind||"full_aes"===A.kind?v(e,A.key):null}catch{return null}};return s(A)??("bc"===A.kind||"none"===this.enc.kind||"aes"!==this.enc.kind&&"full_aes"!==this.enc.kind?null:s(this.enc))??("bc"!==A.kind?s({kind:"bc"}):null)??s({kind:"none"})??e}async login(e="full_aes"){if(this.loggedIn)return;let t;const A=e=>new Promise((t=>setTimeout(t,e)));for(let r=1;r<=3;r++)try{const t="none"===e?56320:"bc"===e?56321:56338;await this.connect();const A=this.nextMsgNum(),r=1,n=k({cmdId:r,bodyLen:0,channelId:250,streamType:0,msgNum:A,responseCode:t,messageClass:25876}),i=`${r}:${A}`,o=new Promise(((e,t)=>{const A=setTimeout((()=>{this.pending.delete(i),t(new Error("Baichuan timeout waiting for nonce"))}),1e4);this.pending.set(i,{resolve:t=>{clearTimeout(A),e(t)},reject:e=>{clearTimeout(A),t(e)}})}));o.catch((()=>{})),this.writeWire(n);const a=await o,c=a.header.responseCode;if(c>>>8!=221)throw new Error(`Baichuan login: expected encryption info (0xDDxx), got 0x${c.toString(16)}`);const l=255&c,h=H(this.tryDecryptXml(a.body,a.header.channelId,0===l?{kind:"none"}:{kind:"bc"}),"nonce");if(!h)throw new Error("Baichuan login: nonce not found in XML");if(this.nonce=h,0===l)this.enc={kind:"none"};else if(1===l)this.enc={kind:"bc"};else if(2===l)this.enc={kind:"aes",key:D(h,this.opts.password)};else{if(18!==l)throw new Error(`Baichuan login: unknown encType=0x${l.toString(16)}`);this.enc={kind:"full_aes",key:D(h,this.opts.password)}}const g=w(`${this.opts.username}${h}`),d=w(`${this.opts.password}${h}`),u=(s=d,`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<LoginUser version="1.1">\n<userName>${M(g)}</userName>\n<password>${M(s)}</password>\n<userVer>1</userVer>\n</LoginUser>\n<LoginNet version="1.1">\n<type>LAN</type>\n<udpPort>0</udpPort>\n</LoginNet>\n</body>`);this.logDebug("login_hash",{username:this.opts.username,nonce:h,userHash:g,passHashLength:d.length,loginXmlLength:u.length,loginXmlPreview:u.substring(0,200)});const E=await this.sendFrame({cmdId:1,payloadXml:u,extensionXml:"",messageClass:B,encryption:{kind:"bc"},timeoutMs:1e4}),I=this.tryDecryptXml(E.body,E.header.channelId,{kind:"bc"});if(this.logDebug("login_reply",{replyLength:I.length,replyPreview:I.substring(0,200),startsWithXml:I.startsWith("<?xml")}),0===I.length)throw new Error("Baichuan login failed: empty reply (camera may be sleeping/waking, session may be stale, or username/password may be invalid)");if(!I.startsWith("<?xml")){const e=I.length>0?I.substring(0,100):"(empty)";throw new Error(`Baichuan login: unexpected non-XML reply (length: ${I.length}, preview: ${e})`)}return void(this.loggedIn=!0)}catch(e){t=e,this.loggedIn=!1;try{await this.close()}catch{}if(r<3){await A(1500);continue}throw e}var s;throw t instanceof Error?t:new Error(String(t))}},ge=class e{static sessionPool=new Map;host;username;password;port;useHttps;insecureTLS;timeoutMs;token;tokenExpiresAt;httpsAgent;constructor(e){this.host=e.host,this.username=e.username,this.password=e.password,this.port=e.port,this.useHttps=e.useHttps,this.insecureTLS=e.insecureTLS??!0,this.timeoutMs=e.timeoutMs??3e4,this.insecureTLS&&(this.httpsAgent=new l.g6({connect:{rejectUnauthorized:!1}}))}getUsername(){return this.username}getToken(){return this.token}clearToken(){this.token=void 0,this.tokenExpiresAt=void 0}sessionKey(){const e=this.useHttps?"https":"http",t=this.port??(this.useHttps?443:80);return`${e}://${this.host}:${t}|${this.username}`}getSharedSession(){const t=this.sessionKey(),A=e.sessionPool.get(t);if(A)return A;const s={};return e.sessionPool.set(t,s),s}baseUrl(){const e=this.useHttps?"https":"http",t=this.port??(this.useHttps?443:80);return`${e}://${this.host}:${t}`}apiUrl(e){const t=new URLSearchParams;for(const[A,s]of Object.entries(e))null!=s&&t.set(A,String(s));return`${this.baseUrl()}/cgi-bin/api.cgi?${t.toString()}`}isTokenValid(){return!(!this.token||!this.tokenExpiresAt)&&Date.now()+1e4<this.tokenExpiresAt}isSharedTokenValid(e){return!(!e.token||!e.tokenExpiresAt)&&Date.now()+1e4<e.tokenExpiresAt}async performLogin(){const e=[{cmd:"Login",action:0,param:{User:{userName:this.username,password:this.password}}}],t=await this.sendJson(e,{cmd:"Login"},{includeToken:!1}),A=t[0];if(!A||0!==A.code||!A.value?.Token?.name)throw new Error(`Login failed: ${JSON.stringify(t)}`);const s=Number(A.value.Token.leaseTime),r=A.value.Token.name,n=Date.now()+(Number.isFinite(s)?1e3*s:0);this.token=r,this.tokenExpiresAt=n;const i=this.getSharedSession();i.token=r,i.tokenExpiresAt=n}async login(){if(this.isTokenValid())return;const e=this.getSharedSession();return this.isSharedTokenValid(e)?(this.token=e.token,void(this.tokenExpiresAt=e.tokenExpiresAt)):e.loginInFlight?(await e.loginInFlight,void(this.isSharedTokenValid(e)&&(this.token=e.token,this.tokenExpiresAt=e.tokenExpiresAt))):(e.loginInFlight=(async()=>{try{await this.performLogin()}finally{delete e.loginInFlight}})(),void await e.loginInFlight)}async logout(){if(this.token)try{await this.call("Logout",{action:0,param:{}})}finally{this.clearToken();const e=this.getSharedSession();delete e.token,delete e.tokenExpiresAt}}async call(e,t){await this.login();const A=[{cmd:e,action:t?.action??0,...t&&"param"in t&&void 0!==t.param?{param:t.param}:{}}];return await this.sendJson(A,{cmd:e,token:this.token},{includeToken:!0})}async callMany(e){return await this.login(),await this.sendJson(e,{token:this.token},{includeToken:!0})}async sendJson(e,t,A){const s=this.apiUrl(t),r=new AbortController,n=setTimeout((()=>r.abort()),this.timeoutMs);try{const t={method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"},signal:r.signal};this.useHttps&&this.httpsAgent&&(t.dispatcher=this.httpsAgent);const A=await fetch(s,t),n=await A.text();if(!A.ok)throw new Error(`HTTP ${A.status}: ${n}`);return JSON.parse(n)}finally{clearTimeout(n)}}async snap(e,t){if(await this.login(),!this.token)throw new Error("Missing token after login");const A=t?.rs??Date.now().toString(),s=this.apiUrl({cmd:"Snap",channel:e,rs:A,token:this.token}),r=new AbortController,n=setTimeout((()=>r.abort()),t?.timeoutMs??this.timeoutMs);try{const e={method:"GET",signal:r.signal};this.useHttps&&this.httpsAgent&&(e.dispatcher=this.httpsAgent);const t=await fetch(s,e);if(!t.ok){const e=await t.text().catch((()=>""));throw new Error(`HTTP ${t.status}: ${e}`)}const A=await t.arrayBuffer();return Buffer.from(A)}finally{clearTimeout(n)}}async downloadVod(e,t,A){if(await this.login(),!this.token)throw new Error("Missing token after login");const s=this.useHttps?"https":"http",r=this.port??(this.useHttps?443:80),n=e.replaceAll(" ","%20"),i=t?encodeURIComponent(t):void 0,o=A?encodeURIComponent(A):void 0,a=encodeURIComponent(this.token),c=`${s}://${this.host}:${r}/cgi-bin/api.cgi?cmd=Download&source=${n}${i?`&output=${i}`:""}${o?`&start=${o}`:""}&token=${a}`,l=new AbortController,h=setTimeout((()=>l.abort()),this.timeoutMs);try{const e={method:"POST",body:"[{}]",headers:{"Content-Type":"application/json"},signal:l.signal};this.useHttps&&this.httpsAgent&&(e.dispatcher=this.httpsAgent);const t=await fetch(c,e);if(!t.ok){const e=await t.text().catch((()=>""));throw new Error(`HTTP ${t.status}: ${e}`)}const A=await t.arrayBuffer();return Buffer.from(A)}finally{clearTimeout(h)}}},de=class{client;constructor(e){this.client=new ge(e)}async login(){await this.client.login()}async logout(){await this.client.logout()}async call(e,t,A=0){return void 0===t?await this.client.call(e,{action:A}):await this.client.call(e,{action:A,param:t})}async callMany(e){return await this.client.callMany(e)}async GetDevInfo(e){const t=null==e?{}:{channel:e};return await this.call("GetDevInfo",t)}async GetChnTypeInfo(e){const t=null==e?{}:{channel:e};return await this.call("GetChnTypeInfo",t)}async GetChannelstatus(){return await this.call("GetChannelstatus",void 0,0)}async GetLocalLink(e){const t=null==e?{}:{channel:e};return await this.call("GetLocalLink",t)}async GetWifiSignal(e){const t=null==e?{}:{channel:e};return await this.call("GetWifiSignal",t)}async GetOsd(e){const t=null==e?{}:{channel:e};return await this.call("GetOsd",t,1)}async SetOsd(e){return await this.call("SetOsd",e,0)}async GetEnc(e){const t=null==e?{}:{channel:e};return await this.call("GetEnc",t,1)}async GetAiState(e){const t=null==e?{}:{channel:e};return await this.call("GetAiState",t,0)}async GetMdState(e){const t=null==e?{}:{channel:e};return await this.call("GetMdState",t,0)}async GetEvents(e){const t=null==e?{}:{channel:e};return await this.call("GetEvents",t,0)}async GetBatteryInfo(e){const t=null==e?{}:{channel:e};return await this.call("GetBatteryInfo",t,0)}async GetWhiteLed(e){const t=null==e?{}:{channel:e};return await this.call("GetWhiteLed",t,0)}async SetWhiteLed(e){return await this.call("SetWhiteLed",e,0)}async GetPirInfo(e){const t=null==e?{}:{channel:e};return await this.call("GetPirInfo",t,0)}async SetPirInfo(e){return await this.call("SetPirInfo",e,0)}async GetPtzPreset(e){const t=null==e?{}:{channel:e};return await this.call("GetPtzPreset",t,1)}async GetAudioAlarmV20(e){const t=null==e?{}:{channel:e};return await this.call("GetAudioAlarmV20",t,0)}async AudioAlarmPlay(e){return await this.call("AudioAlarmPlay",e,0)}async GetNetPort(){return await this.call("GetNetPort",{})}async SetNetPort(e){return await this.call("SetNetPort",{NetPort:e})}async Reboot(e){const t=null==e?{}:{channel:e};return await this.call("Reboot",t)}async GetAbility(){const e=this.client.getUsername();return await this.call("GetAbility",{User:{userName:e}})}async getChannels(){const e=await this.GetChannelstatus(),t=e?.[0]?.value?.status;return{channels:(t??[]).filter((e=>!!e?.uid)).map((e=>Number(e?.channel))).filter((e=>Number.isFinite(e))),channelsResponse:e}}async getHubInfo(){const e=[{cmd:"GetAbility",action:0,param:{User:{userName:this.client.getUsername()}}},{cmd:"GetDevInfo",action:0,param:{}}],t=await this.callMany(e),A=t.find((e=>"GetAbility"===e?.cmd))?.value,s=t.find((e=>"GetDevInfo"===e?.cmd))?.value,r=s?.DevInfo;return{abilities:A,hubData:s,devInfo:r,response:t}}async getDevicesInfo(){const{channels:e,channelsResponse:t}=await this.getChannels(),A=this.client.getUsername(),s=[];s.push({cmd:"GetAbility",action:0,param:{User:{userName:A}}});for(const t of e)s.push({cmd:"GetChnTypeInfo",action:0,param:{channel:t}},{cmd:"GetAiState",action:0,param:{channel:t}},{cmd:"GetEnc",action:1,param:{channel:t}});const r=await this.callMany(s),n=r[0]?.value,i=n?.Ability?.abilityChn,o={};for(let A=0;A<e.length;A++){const s=e[A],n=1+3*A,a=r[n],c=r[n+1],l=r[n+2],h=t?.[0]?.value?.status?.find((e=>e?.channel===s)),g={entries:[a,c,l]};h&&(g.channelStatus=h);const d=i?.[s];d&&(g.abilities=d),a?.error||(g.channelInfo=a?.value),c?.error||(g.ai=c?.value),l?.error||(g.enc=l?.value),o[s]=g}return{devicesData:o,response:r,channels:e,channelsResponse:t,requestBody:s}}async getAllChannelsEvents(){const{channels:e,channelsResponse:t}=await this.getChannels(),A=[],s={};for(const t of e)s[t]={},A.push({cmd:"GetEvents",action:0,param:{channel:t}}),s[t].events=A.length-1,A.push({cmd:"GetMdState",action:0,param:{channel:t}}),s[t].motion=A.length-1,A.push({cmd:"GetAiState",action:0,param:{channel:t}}),s[t].ai=A.length-1;const r=await this.callMany(A),n=e=>{const t=[];for(const A of Object.keys(e??{})){if("channel"===A)continue;const s=e?.[A]?.alarm_state;s&&t.push(A)}return t},i={};for(const t of e){const{events:e,motion:A,ai:o}=s[t]??{},a=null!=e?r[e]:void 0,c=null!=A?r[A]:void 0,l=null!=o?r[o]:void 0,h=new Set;for(const e of n(l?.value))h.add(e);for(const e of n(a?.value?.ai??a?.value))h.add(e);const g=Array.from(h),d=g.filter((e=>"other"!==e)),u=!!c?.value?.state||g.length>0;i[t]={motion:u,objects:d,entries:[a,c,l]}}return{parsed:i,response:r,channels:e,channelsResponse:t,requestBody:A}}async getAllChannelsBatteryInfo(){const{channels:e,channelsResponse:t}=await this.getChannels(),A=[{cmd:"GetChannelstatus"}],s={};for(const t of e)A.push({cmd:"GetBatteryInfo",action:0,param:{channel:t}}),s[t]=A.length-1;const r=await this.callMany(A),n=r[0],i={};for(const t of e){const e=r[s[t]]?.value?.Battery??void 0,A=n?.value?.status?.find((e=>e?.channel===t));i[t]={entries:[e,A],batteryLevel:Number(e?.batteryPercent??0),sleeping:1===A?.sleep}}return{batteryInfoData:i,response:r,channels:e,channelsResponse:t,requestBody:A}}async getStatusInfo(e){const t=[],A={};for(const[s,r]of e.entries())A[s]={},r.sleeping||(t.push({cmd:"GetOsd",action:1,param:{channel:s}}),A[s].osd=t.length-1,r.hasFloodlight&&(t.push({cmd:"GetWhiteLed",action:0,param:{channel:s}}),A[s].floodlight=t.length-1),r.hasPirEvents&&(t.push({cmd:"GetPirInfo",action:0,param:{channel:s}}),A[s].pir=t.length-1),r.hasPtz&&(t.push({cmd:"GetPtzPreset",action:1,param:{channel:s}}),A[s].presets=t.length-1));const s=await this.callMany(t),r={};for(const[t,n]of e.entries()){const{osd:e,floodlight:i,pir:o,presets:a}=A[t]??{};if(r[t]={entries:[]},null!=e){const A=s[e];r[t].osd=A,r[t].entries.push(A)}if(n.hasFloodlight&&null!=i){const e=s[i];r[t].floodlightEnabled=1===e?.value?.WhiteLed?.state,r[t].entries.push(e)}if(n.hasPirEvents&&null!=o){const e=s[o];r[t].pirEnabled=1===e?.value?.pirInfo?.enable,r[t].entries.push(e)}if(n.hasPtz&&null!=a){const e=s[a],A=e?.value?.PtzPreset;r[t].ptzPresets=Array.isArray(A)?A.filter((e=>1===e?.enable)):[],r[t].entries.push(e)}}return{deviceStatusData:r,response:s}}async getOsd(e){const t=await this.GetOsd(e);return t?.[0]}async setOsd(e,t){const A=t?.value?.Osd??t?.Osd,s={Osd:{channel:e,osdChannel:A?.osdChannel??t?.osdChannel,osdTime:A?.osdTime??t?.osdTime}};await this.call("SetOsd",s,0)}async getEncoderConfiguration(e){const t=await this.GetEnc(e);return t?.[0]?.value?.Enc}async jpegSnapshot(e,t=1e4){return await this.client.snap(e,{timeoutMs:t})}async getSiren(e){const t=await this.GetAudioAlarmV20(e);return{enabled:1===t?.[0]?.value?.Audio?.enable}}async setSiren(e,t,A){const s=A?{channel:e,alarm_mode:"times",times:A}:{channel:e,alarm_mode:"manul",manual_switch:t?1:0},r=await this.AudioAlarmPlay(s);return{value:r?.[0]?.value??r?.value,data:r}}async setWhiteLedState(e,t,A){const s={channel:e};void 0!==t&&(s.state=t?1:0),void 0!==A&&(s.bright=A),await this.SetWhiteLed({WhiteLed:s})}async getPirState(e){const t=await this.GetPirInfo(e),A=t?.[0]?.value?.pirInfo;return{enabled:1===A?.enable,state:A}}async setPirState(e,t){const A=await this.getPirState(e),s=t?1:0,r=A?.state?.enable;if(r===s)return;const n={...A?.state&&"object"==typeof A.state?A.state:{},channel:e,enable:s};await this.SetPirInfo({pirInfo:n})}async getLocalLink(e){const t=[{cmd:"GetLocalLink",action:0,param:{}},{cmd:"GetWifiSignal",action:0,param:{channel:e}}],A=await this.callMany(t),s=A.find((e=>"GetLocalLink"===e?.cmd))?.value?.LocalLink?.activeLink,r=A.find((e=>"GetWifiSignal"===e?.cmd))?.value?.wifiSignal;let n=!1;return void 0!==r&&(n=r>=0&&r<=4),!n&&s&&(n="LAN"!==s),{activeLink:s,wifiSignal:r,isWifi:n}}};function ue(e){if(e.length<4)return null;const t=e.readUInt32LE(0);return 825241649===t?function(e){if(e.length<32)return null;const t=e.readUInt32LE(4);if(32!==t)return null;const A={type:"InfoV1",videoWidth:e.readUInt32LE(8),videoHeight:e.readUInt32LE(12),fps:e.readUInt8(17),startYear:e.readUInt8(18),startMonth:e.readUInt8(19),startDay:e.readUInt8(20),startHour:e.readUInt8(21),startMin:e.readUInt8(22),startSeconds:e.readUInt8(23),endYear:e.readUInt8(24),endMonth:e.readUInt8(25),endDay:e.readUInt8(26),endHour:e.readUInt8(27),endMin:e.readUInt8(28),endSeconds:e.readUInt8(29)};return{media:A,consumed:32}}(e):842018865===t?function(e){if(e.length<32)return null;const t=e.readUInt32LE(4);if(32!==t)return null;const A={type:"InfoV2",videoWidth:e.readUInt32LE(8),videoHeight:e.readUInt32LE(12),fps:e.readUInt8(17),startYear:e.readUInt8(18),startMonth:e.readUInt8(19),startDay:e.readUInt8(20),startHour:e.readUInt8(21),startMin:e.readUInt8(22),startSeconds:e.readUInt8(23),endYear:e.readUInt8(24),endMonth:e.readUInt8(25),endDay:e.readUInt8(26),endHour:e.readUInt8(27),endMin:e.readUInt8(28),endSeconds:e.readUInt8(29)};return{media:A,consumed:32}}(e):t>=1667510320&&t<=1667510329?function(e){if(e.length<20)return null;const t=e.toString("utf8",4,8);if("H264"!==t&&"H265"!==t)return null;const A=t,s=e.readUInt32LE(8),r=e.readUInt32LE(12),n=e.readUInt32LE(16);let i=20;const o=e.readUInt32LE(i);let a;if(i+=4,e.length<i+r)return null;const c=e.subarray(i,i+r);r>=4&&(a=c.readUInt32LE(0));if(i+=r,e.length<i+s)return null;const l=e.subarray(i,i+s);i+=s;const h=s%8==0?0:8-s%8;if(e.length<i+h)return null;i+=h;return{media:{type:"Iframe",videoType:A,microseconds:n,...void 0!==a?{time:a}:{},additionalHeader:c,additionalHeaderSize:r,unknown:o,data:l},consumed:i}}(e):t>=1667510576&&t<=1667510585?function(e){if(e.length<20)return null;const t=e.toString("utf8",4,8);if("H264"!==t&&"H265"!==t)return null;const A=t,s=e.readUInt32LE(8),r=e.readUInt32LE(12),n=e.readUInt32LE(16);let i=20;const o=e.readUInt32LE(i);if(i+=4,e.length<i+r)return null;const a=e.subarray(i,i+r);if(i+=r,e.length<i+s)return null;const c=e.subarray(i,i+s);i+=s;const l=s%8==0?0:8-s%8;if(e.length<i+l)return null;i+=l;return{media:{type:"Pframe",videoType:A,microseconds:n,additionalHeader:a,additionalHeaderSize:r,unknown:o,data:c},consumed:i}}(e):1651979568===t?function(e){if(e.length<12)return null;const t=e.readUInt16LE(4),A=e.readUInt16LE(6);if(t!==A)return null;const s=8,r=s+t+(t%8==0?0:8-t%8);if(e.length<r)return null;const n=e.subarray(s,s+t);return{media:{type:"Aac",data:n},consumed:r}}(e):1651978544===t?function(e){if(e.length<12)return null;const t=e.readUInt16LE(4),A=e.readUInt16LE(6);if(t!==A)return null;const s=e.readUInt16LE(8);if(256!==s)return null;e.readUInt16LE(10);const r=4;if(t<r)return null;const n=t-r,i=12,o=i+n+(t%8==0?0:8-t%8);if(e.length<o)return null;const a=e.subarray(i,i+n);return{media:{type:"Adpcm",data:a},consumed:o}}(e):null}var Ee=class{buffer=Buffer.alloc(0);strict;amountSkipped=0;logger;constructor(e=!1,t){this.strict=e,this.logger=t}decode(e){this.buffer=0===this.buffer.length?e:Buffer.concat([this.buffer,e]);const t=[];for(;this.buffer.length>=4;){const e=ue(this.buffer);if(!e){const e=this.buffer.readUInt32LE(0);if(825241649===e||842018865===e||e>=1667510320&&e<=1667510329||e>=1667510576&&e<=1667510585||1651979568===e||1651978544===e)break;if(this.strict)throw new Error(`[BcMediaCodec] Invalid data in stream (no valid magic at buffer start, len=${this.buffer.length})`);0===this.amountSkipped&&this.logger?.warn("[BcMediaCodec] Error in stream, attempting to recover..."),this.amountSkipped+=this.buffer.length,this.buffer=Buffer.alloc(0);break}this.amountSkipped>0&&(this.strict,this.logger?.warn(`[BcMediaCodec] Recovered stream after skipping ${this.amountSkipped} bytes`),this.amountSkipped=0),t.push(e.media),this.buffer=this.buffer.subarray(e.consumed)}return t}getRemainingBuffer(){return this.buffer}clear(){this.buffer=Buffer.alloc(0),this.amountSkipped=0}},Ie=Buffer.from([0,0,0,1]),Qe=Buffer.from([0,0,1]);function Ce(e){return!(e.length<4)&&(!!e.subarray(0,4).equals(Ie)||!!e.subarray(0,3).equals(Qe))}function Be(e,t){const A=[];let s=0,r=0;for(;s<e.length;){if(s+4>e.length)return null;const n=t(e,s);if(s+=4,n<=0)return null;if(n>e.length-s)return null;A.push(Ie),A.push(e.subarray(s,s+n)),s+=n,r++}return 0===r?null:Buffer.concat(A)}function pe(e,t){const A=[];let s=0,r=0;for(;s<e.length;){if(s+2>e.length)return null;const n=t(e,s);if(s+=2,n<=0)return null;if(n>e.length-s)return null;A.push(Ie),A.push(e.subarray(s,s+n)),s+=n,r++}return 0===r?null:Buffer.concat(A)}function fe(e,t){const A=[];let s=0,r=0;const n=(e,A)=>{if(A+3>e.length)return 0;const s=e[A],r=e[A+1],n=e[A+2];return"be"===t?(s<<16|r<<8|n)>>>0:(n<<16|r<<8|s)>>>0};for(;s<e.length;){if(s+3>e.length)return null;const t=n(e,s);if(s+=3,t<=0)return null;if(t>e.length-s)return null;A.push(Ie),A.push(e.subarray(s,s+t)),s+=t,r++}return 0===r?null:Buffer.concat(A)}function me(e){if(Ce(e))return e;const t=Buffer.from([0,0,0,1]),A=Buffer.from([0,0,1]),s=Math.min(64,e.length),r=e.subarray(0,s).indexOf(t);if(r>0)return e.subarray(r);const n=e.subarray(0,s).indexOf(A);if(n>0)return e.subarray(n);const i=Be(e,((e,t)=>e.readUInt32BE(t)));if(i)return i;const o=Be(e,((e,t)=>e.readUInt32LE(t)));if(o)return o;const a=fe(e,"be");if(a)return a;const c=fe(e,"le");if(c)return c;const l=pe(e,((e,t)=>e.readUInt16BE(t)));if(l)return l;const h=pe(e,((e,t)=>e.readUInt16LE(t)));if(h)return h;const g=function(e){if(e.length<1)return null;const t=31&e[0],A=[],s=e=>{0!==e.length&&A.push(Ie,e)};if(24===t){let t=1;for(;t+2<=e.length;){const A=e.readUInt16BE(t);if(t+=2,A<=0||t+A>e.length)return null;s(e.subarray(t,t+A)),t+=A}return A.length?Buffer.concat(A):null}if(25===t){let t=3;if(t>e.length)return null;for(;t+2<=e.length;){const A=e.readUInt16BE(t);if(t+=2,A<=0||t+A>e.length)return null;s(e.subarray(t,t+A)),t+=A}return A.length?Buffer.concat(A):null}if(26===t){let t=3;if(t>e.length)return null;for(;t+2<=e.length;){const A=e.readUInt16BE(t);if(t+=2,t+1+2>e.length)return null;if(t+=1,t+=2,A<=0||t+A>e.length)return null;s(e.subarray(t,t+A)),t+=A}return A.length?Buffer.concat(A):null}if(27===t){let t=3;if(t>e.length)return null;for(;t+2<=e.length;){const A=e.readUInt16BE(t);if(t+=2,t+1+3>e.length)return null;if(t+=1,t+=3,A<=0||t+A>e.length)return null;s(e.subarray(t,t+A)),t+=A}return A.length?Buffer.concat(A):null}return null}(e);return g||(function(e){if(e.length<1)return!1;const t=e[0];if(void 0===t)return!1;if(128&t)return!1;const A=31&t;return A>=1&&A<=23}(e)?Buffer.concat([Ie,e]):e)}function ye(e){const t=[];for(let A=0;A<e.length-3;A++)0===e[A]&&0===e[A+1]&&(1===e[A+2]?(t.push({idx:A,len:3}),A+=2):0===e[A+2]&&1===e[A+3]&&(t.push({idx:A,len:4}),A+=3));if(0===t.length)return[];const A=[];for(let s=0;s<t.length;s++){const r=t[s],n=r.idx+r.len,i=t[s+1]?t[s+1].idx:e.length;i>n&&A.push(e.subarray(n,i))}return A}function Se(e){if(!Ce(e))return!1;const t=ye(e);if(0===t.length)return!1;for(const e of t){if(e.length<1)return!1;const t=e[0];if(void 0===t)return!1;if(128&t)return!1;const A=31&t;if(0===A||A>=24)return!1}return!0}function we(e){const t=ye(e);let A=!1,s=!1,r=!1;for(const e of t){const t=31&(e[0]??0);7===t&&(A=!0),8===t&&(s=!0),5===t&&(r=!0)}return r&&A&&s}var De=class e{fuNalHeader=null;fuParts=[];static parseRtpPayload(e){if(!e||e.length<12)return null;if(2!==(e[0]>>6&3))return null;const t=!!(32&e[0]),A=!!(16&e[0]);let s=12+4*(15&e[0]);if(s>e.length)return null;if(A){if(s+4>e.length)return null;if(s+=4+4*e.readUInt16BE(s+2),s>e.length)return null}let r=e.length;if(t){const t=e[e.length-1];if(t<=0||t>e.length)return null;if(r=e.length-t,r<s)return null}return r<=s?null:e.subarray(s,r)}reset(){this.fuNalHeader=null,this.fuParts=[]}push(t){if(0===t.length)return[];const A=e.parseRtpPayload(t);if(A&&(t=A),Ce(t))return[t];const s=t[0];if(128&s)return[];const r=31&s;if(r>=1&&r<=23)return[Buffer.concat([Ie,t])];if(24===r){if(t.length<3)return[];let e=1;const A=[];for(;e+2<=t.length;){const s=t.readUInt16BE(e);if(e+=2,s<=0||e+s>t.length)return[];const r=t.subarray(e,e+s);if(e+=s,r.length<1)return[];if(128&r[0])return[];const n=31&r[0];if(0===n||n>=24)return[];A.push(Buffer.concat([Ie,r]))}return A}if(28===r||29===r){if(t.length<2)return[];const e=t[0],A=t[1],s=!!(128&A),n=!!(64&A),i=224&e|31&A;let o=2;if(29===r){if(t.length<o+2)return[];o+=2}const a=t.subarray(o);if(s)this.fuNalHeader=i,this.fuParts=[a];else{if(null==this.fuNalHeader)return[];this.fuParts.push(a)}if(n&&null!=this.fuNalHeader){const e=Buffer.concat([Buffer.from([this.fuNalHeader]),...this.fuParts]);return this.reset(),[Buffer.concat([Ie,e])]}return[]}return[]}};var be=Buffer.from([0,0,0,1]),Ne=Buffer.from([0,0,1]);function Re(e){return!(e.length<4)&&(!!e.subarray(0,4).equals(be)||!!e.subarray(0,3).equals(Ne))}function ve(e,t){const A=[];let s=0,r=0;for(;s<e.length;){if(s+4>e.length)return null;const n=t(e,s);if(s+=4,n<=0)return null;if(n>e.length-s)return null;A.push(be),A.push(e.subarray(s,s+n)),s+=n,r++}return 0===r?null:Buffer.concat(A)}function ke(e,t){const A=[];let s=0,r=0;for(;s<e.length;){if(s+2>e.length)return null;const n=t(e,s);if(s+=2,n<=0)return null;if(n>e.length-s)return null;A.push(be),A.push(e.subarray(s,s+n)),s+=n,r++}return 0===r?null:Buffer.concat(A)}function Te(e,t){const A=[];let s=0,r=0;const n=(e,A)=>{if(A+3>e.length)return 0;const s=e[A],r=e[A+1],n=e[A+2];return"be"===t?(s<<16|r<<8|n)>>>0:(n<<16|r<<8|s)>>>0};for(;s<e.length;){if(s+3>e.length)return null;const t=n(e,s);if(s+=3,t<=0)return null;if(t>e.length-s)return null;A.push(be),A.push(e.subarray(s,s+t)),s+=t,r++}return 0===r?null:Buffer.concat(A)}function Fe(e){if(Re(e))return e;const t=Buffer.from([0,0,0,1]),A=Buffer.from([0,0,1]),s=Math.min(64,e.length),r=e.subarray(0,s).indexOf(t);if(r>0)return e.subarray(r);const n=e.subarray(0,s).indexOf(A);if(n>0)return e.subarray(n);const i=ve(e,((e,t)=>e.readUInt32BE(t)));if(i)return i;const o=ve(e,((e,t)=>e.readUInt32LE(t)));if(o)return o;const a=Te(e,"be");if(a)return a;const c=Te(e,"le");if(c)return c;const l=ke(e,((e,t)=>e.readUInt16BE(t)));if(l)return l;const h=ke(e,((e,t)=>e.readUInt16LE(t)));return h||(function(e){if(e.length<2)return!1;const t=e[0],A=e[1];return void 0!==t&&void 0!==A&&(!(128&t)&&(t>>1&63)<=40)}(e)?Buffer.concat([be,e]):e)}var Me=class e{fuParts=null;reset(){this.fuParts=null}static parseRtpPayload(e){if(!e||e.length<12)return null;if(2!==(e[0]>>6&3))return null;const t=!!(32&e[0]),A=!!(16&e[0]);let s=12+4*(15&e[0]);if(s>e.length)return null;if(A){if(s+4>e.length)return null;if(s+=4+4*e.readUInt16BE(s+2),s>e.length)return null}let r=e.length;if(t){const t=e[e.length-1];if(t<=0||t>e.length)return null;if(r=e.length-t,r<s)return null}return r<=s?null:e.subarray(s,r)}push(t){if(!t||t.length<2)return[];const A=e.parseRtpPayload(t);A&&(t=A);const s=t[0],r=t[1];if(128&s)return[];const n=s>>1&63;if(48===n){let e=2;const A=[];for(;e+2<=t.length;){const s=t.readUInt16BE(e);if(e+=2,s<=0||e+s>t.length)return[];const r=t.subarray(e,e+s);e+=s,r.length&&A.push(be,r)}return A.length?[Buffer.concat(A)]:[]}if(49===n){if(t.length<3)return[];const e=t[2],A=!!(128&e),n=!!(64&e),i=129&s|(63&(63&e))<<1,o=r,a=t.subarray(3);if(A)this.fuParts=[be,Buffer.from([i,o]),a];else{if(!this.fuParts)return[];this.fuParts.push(a)}if(n){if(!this.fuParts)return[];const e=Buffer.concat(this.fuParts);return this.fuParts=null,[e]}return[]}return[Buffer.concat([be,t])]}};function Ue(e){const t=[];for(let A=0;A<e.length-3;A++)0===e[A]&&0===e[A+1]&&(1===e[A+2]?(t.push({idx:A,len:3}),A+=2):0===e[A+2]&&1===e[A+3]&&(t.push({idx:A,len:4}),A+=3));if(0===t.length)return[];const A=[];for(let s=0;s<t.length;s++){const r=t[s],n=r.idx+r.len,i=t[s+1]?t[s+1].idx:e.length;i>n&&A.push(e.subarray(n,i))}return A}function Le(e){if(e.length<1)return null;const t=e[0];return void 0===t||128&t?null:t>>1&63}function He(e){return e>=16&&e<=23}function Pe(e){if(!Re(e))return!1;const t=Ue(e);if(0===t.length)return!1;for(const e of t){if(e.length<2)return!1;const t=e[0];if(void 0===t)return!1;if(128&t)return!1;const A=Le(e);if(null===A)return!1;if(A>40)return!1}return!0}function xe(e){const t=Ue(e);let A=!1,s=!1,r=!1,n=!1;for(const e of t){const t=Le(e);null!==t&&(32===t&&(A=!0),33===t&&(s=!0),34===t&&(r=!0),He(t)&&(n=!0))}return n&&A&&s&&r}function Ye(e){const t=Ue(e);for(const e of t){if(32===Le(e))return e}return null}function Ve(e){const t=Ue(e);for(const e of t){if(33===Le(e))return e}return null}function Ge(e){const t=Ue(e);for(const e of t){if(34===Le(e))return e}return null}var Oe=Buffer.from([0,0,0,1]),Je=class{running=!1;queue=[];maxQueueSize;constructor(e){this.maxQueueSize=e}enqueue(e){this.queue.length>=this.maxQueueSize||(this.queue.push(e),this.pump())}pump(){this.running||(this.running=!0,this.run())}async run(){try{for(;this.queue.length>0;){const e=this.queue.shift();if(e)try{await e()}catch{}}}finally{this.running=!1}}};function We(e){const t=[];for(let A=0;A<e.length;A++)A>=2&&3===e[A]&&0===e[A-1]&&0===e[A-2]||t.push(e[A]);return Buffer.from(t)}var _e=class{b;bitPos=0;constructor(e){this.b=e}readBits(e){if(e<=0)return 0;let t=0;for(let A=0;A<e;A++){const e=this.bitPos>>3;if(e>=this.b.length)return null;const A=7-(7&this.bitPos);t=t<<1|this.b[e]>>A&1,this.bitPos++}return t>>>0}readUE(){let e=0;for(;;){const t=this.readBits(1);if(null==t)return null;if(0!==t)break;if(e++,e>31)return null}const t=e?this.readBits(e):0;return null==t?null:(1<<e)-1+t>>>0}};function qe(e){if(7!=(31&(e[0]??0)))return null;const t=We(e.subarray(1)),A=new _e(t);return null==A.readBits(8)||null==A.readBits(8)||null==A.readBits(8)?null:A.readUE()}function $e(e){if(8!=(31&(e[0]??0)))return null;const t=We(e.subarray(1)),A=new _e(t),s=A.readUE(),r=A.readUE();return null==s||null==r?null:{ppsId:s,spsId:r}}function Xe(e){const t=31&(e[0]??0);if(1!==t&&5!==t)return null;const A=We(e.subarray(1)),s=new _e(A);return null==s.readUE()||null==s.readUE()?null:s.readUE()}var ze=class e extends r.EventEmitter{client;api;channel;profile;logger;active=!1;videoFrameHandler;expectedStreamType;activeMsgNum;bcMediaCodec;debugH264LogsLeft;debugSavedSamples;warnedNonAnnexBOnce=!1;depacketizer=new De;depacketizerH265=new Me;dumpChunkIdx=0;dumpNalLines=0;dumpIo=new Je(200);spsById=new Map;ppsById=new Map;lastSps=null;lastPps=null;lastPrependedPpsId=null;lastVps=null;lastSpsH265=null;lastPpsH265=null;lastPrependedParamSetsH265=!1;lastMediaAtMs=0;watchdogTimer;restarting=!1;restartWindowStartMs=0;restartCountInWindow=0;idleRestartMs;static scoreBcMediaLike(e){if(e.length<4)return{score:-1,first:-1};const t=Math.min(65536,e.length-4);let A=0,s=-1;for(let r=0;r<=t;r++){const t=e.readUInt32LE(r);if((825241649===t||842018865===t||t>=1667510320&&t<=1667510329||t>=1667510576&&t<=1667510585||1651979568===t||1651978544===t)&&(A++,s<0&&(s=r),A>32&&0===s))break}return{score:1e3*A-(s<0?5e4:s),first:s}}chooseDecryptedOrRawCandidate(t){const{raw:A,enc:s,channelId:r,allowResync:n}=t,i=e.scoreBcMediaLike(A),o="aes"===this.client.enc.kind||"full_aes"===this.client.enc.kind||"bc"===this.client.enc.kind?this.client.tryDecryptBinary(A,r,s):A,a=e.scoreBcMediaLike(o).score>i.score?o:A;if(!n)return a;const c=e.scoreBcMediaLike(a);return c.first>0?a.subarray(c.first):a}constructor(e){super(),this.client=e.client,this.api=e.api,this.channel=e.channel,this.profile=e.profile,this.logger=e.logger,this.expectedStreamType="sub"===this.profile?1:0,this.bcMediaCodec=new Ee(!1,this.logger);const t=this.client.getDebugConfig();this.debugH264LogsLeft=t.debugH264?200:0,this.debugSavedSamples=!1,this.dumpChunkIdx=0,this.spsById=new Map,this.ppsById=new Map,this.lastSps=null,this.lastPps=null,this.lastPrependedPpsId=null,this.lastVps=null,this.lastSpsH265=null,this.lastPpsH265=null,this.lastPrependedParamSetsH265=!1;const A=this.client.getTransport?.();this.idleRestartMs="udp"===A?6e3:15e3}noteMediaActivity(){this.lastMediaAtMs=Date.now()}startWatchdog(){this.api&&(this.watchdogTimer||(this.restartWindowStartMs=Date.now(),this.restartCountInWindow=0,this.watchdogTimer=setInterval((()=>{this.watchdogTick()}),1e3)))}stopWatchdog(){this.watchdogTimer&&clearInterval(this.watchdogTimer),this.watchdogTimer=void 0}async watchdogTick(){if(!this.active)return;if(!this.api)return;if(this.restarting)return;if(this.lastMediaAtMs<=0)return;const e=Date.now(),t=e-this.lastMediaAtMs;t<this.idleRestartMs||(e-this.restartWindowStartMs>6e4&&(this.restartWindowStartMs=e,this.restartCountInWindow=0),this.restartCountInWindow++,this.restartNativeStream({reason:`idle ${t}ms`}))}async restartNativeStream(e){if(this.api&&this.active&&!this.restarting){this.restarting=!0;try{this.logger?.warn(`[BaichuanVideoStream] Watchdog restarting native stream (${e.reason})`),this.depacketizer.reset(),this.depacketizerH265.reset(),this.bcMediaCodec.clear(),this.activeMsgNum=void 0,this.lastPrependedPpsId=null,this.lastPrependedParamSetsH265=!1;try{await this.api.stopVideoStream(this.channel,this.profile)}catch{}await this.api.startVideoStream(this.channel,this.profile);try{const e=this.api.getActiveVideoMsgNum;this.activeMsgNum="function"==typeof e?e(this.channel,this.profile):void 0}catch{this.activeMsgNum=void 0}this.lastMediaAtMs=Date.now()}catch(e){const t=e instanceof Error?e:new Error(String(e));this.emit("error",t)}finally{this.restarting=!1}}}async start(){if(this.active)throw new Error("Video stream already active");if(this.depacketizer.reset(),this.depacketizerH265.reset(),this.api)try{await this.api.startVideoStream(this.channel,this.profile);try{const e=this.api.getActiveVideoMsgNum;this.activeMsgNum="function"==typeof e?e(this.channel,this.profile):void 0}catch{this.activeMsgNum=void 0}}catch(e){const t=e instanceof Error?e:new Error(String(e));if("udp"===this.client.getTransport?.())throw t;this.emit("error",t)}let e=0,t=0;this.videoFrameHandler=A=>{if(3!==A.header.cmdId)return;if(A.header.streamType!==this.expectedStreamType)return;if(void 0!==this.activeMsgNum&&A.header.msgNum!==this.activeMsgNum)return;e++;const s=this.client.getDebugConfig(),r=s.debugRtsp;1===e&&r&&this.logger?.log(`[BaichuanVideoStream] First cmd_id=3 frame received (bodyLen: ${A.body.length}, channelId: ${A.header.channelId})`),(e%10==0||e<=5)&&r&&this.logger?.log(`[BaichuanVideoStream] Received ${e} Baichuan frames (cmd_id=3)`);const n=this.client.enc,i=A.payload.length>0?A.payload:A.body;let o=i;if(0===A.payload.length){let e=0;const t=i.indexOf(Buffer.from("</Extension>")),A=i.indexOf(Buffer.from("</body>"));-1!==t?e=t+Buffer.from("</Extension>").length:-1!==A&&(e=A+Buffer.from("</body>").length),o=i.subarray(e)}const l=this.chooseDecryptedOrRawCandidate({raw:o,enc:n,channelId:A.header.channelId,allowResync:0===A.payload.length});if(1===e&&r&&this.logger?.log(`[BaichuanVideoStream] Data after XML: ${l.length} bytes, first 32 bytes: ${l.subarray(0,Math.min(32,l.length)).toString("hex")}`),s.dumpEnabled&&ne(s),s.dumpBcMedia&&this.dumpChunkIdx<200){const e=s.dumpDir,t=String(this.dumpChunkIdx).padStart(4,"0"),A=c.join(e,`bcmedia_chunk_${t}.bin`),r=c.join(e,"bcmedia_info.json"),n=Buffer.from(l),i=0===this.dumpChunkIdx,o=i?JSON.stringify({note:"Chunks fed into the BcMedia decoder (after XML stripping/alignment).",profile:this.profile,channel:this.channel,encKind:this.client.enc.kind},null,2):"";this.dumpIo.enqueue((async()=>{await a.promises.writeFile(A,n),i&&await a.promises.writeFile(r,o)})),this.dumpChunkIdx++}const h=this.bcMediaCodec.decode(l);t+=h.length;const g=new Map;for(const e of h)g.set(e.type,(g.get(e.type)||0)+1);if(e<=10||e%20==0){const A=this.bcMediaCodec.getRemainingBuffer(),s=Array.from(g.entries()).map((([e,t])=>`${e}:${t}`)).join(", ");r&&this.logger?.log(`[BaichuanVideoStream] Frame #${e}: dataToParse=${l.length} bytes, parsed ${h.length} BcMedia packets (${s||"none"}), total: ${t}, remaining buffer: ${A.length} bytes`)}let d=0,u=0;for(const t of h){const A=(e,t,A)=>{if("H264"===A){const t=ye(e);for(const e of t){const t=31&(e[0]??0);if(7===t){const t=qe(e);if(null!=t){if(!o(e))continue;this.spsById.set(t,e),s.debugParamSets&&this.logger?.warn(`[BaichuanVideoStream] Cached H.264 SPS id=${t} len=${e.length}`)}o(e)&&(this.lastSps=e)}if(8===t){const t=$e(e);if(t){const A=this.spsById.get(t.spsId);if(A&&!o(A))continue;this.ppsById.set(t.ppsId,{nal:e,spsId:t.spsId}),s.debugParamSets&&this.logger?.warn(`[BaichuanVideoStream] Cached H.264 PPS id=${t.ppsId} (spsId=${t.spsId}) len=${e.length}`)}this.lastPps=e}}}else if("H265"===A){const t=Ye(e);t&&(this.lastVps=t,s.debugParamSets&&this.logger?.warn(`[BaichuanVideoStream] Cached H.265 VPS len=${t.length}`));const A=Ve(e);A&&(this.lastSpsH265=A,s.debugParamSets&&this.logger?.warn(`[BaichuanVideoStream] Cached H.265 SPS len=${A.length}`));const r=Ge(e);r&&(this.lastPpsH265=r,s.debugParamSets&&this.logger?.warn(`[BaichuanVideoStream] Cached H.265 PPS len=${r.length}`))}},n=(e,t)=>{if("H264"===t){const t=ye(e);if(0===t.length)return e;const A=t.map((e=>31&(e[0]??0)));if(A.includes(7)&&A.includes(8))return e;if(!A.some((e=>1===e||5===e||19===e||20===e)))return e;let r=null;for(const e of t){const t=31&(e[0]??0);if(1===t||5===t){r=Xe(e);break}}if(s.debugParamSets&&this.logger?.warn(`[BaichuanVideoStream] Slice references ppsId=${r??"?"} lastPrepended=${this.lastPrependedPpsId??"?"}`),null==r||r>255)return null!=this.lastPrependedPpsId?e:this.lastSps&&this.lastPps?(this.lastPrependedPpsId=-1,Buffer.concat([Oe,this.lastSps,Oe,this.lastPps,e])):e;if(this.lastPrependedPpsId===r)return e;const n=this.ppsById.get(r);if(n){const t=this.spsById.get(n.spsId);if(t)return this.lastPrependedPpsId=r,Buffer.concat([Oe,t,Oe,n.nal,e])}return Buffer.alloc(0)}if("H265"===t){const t=Ue(e);if(0===t.length)return e;const A=t.map((e=>Le(e))).filter((e=>null!==e));if(A.includes(32)&&A.includes(33)&&A.includes(34))return e;return A.some((e=>e>=0&&e<=9||e>=16&&e<=23))?this.lastPrependedParamSetsH265?e:this.lastVps&&this.lastSpsH265&&this.lastPpsH265?(this.lastPrependedParamSetsH265=!0,s.debugParamSets&&this.logger?.warn("[BaichuanVideoStream] Prepending H.265 VPS/SPS/PPS to frame"),Buffer.concat([Oe,this.lastVps,Oe,this.lastSpsH265,Oe,this.lastPpsH265,e])):e:e}return e},i=(e,t,A)=>{if(s.dumpNals)try{s.dumpEnabled&&ne(s);const r=s.dumpDir,n=ye(e),i=n.map((e=>31&(e[0]??0)));let o=null;const l=[],h=[];for(const e of n){const t=31&(e[0]??0);if(1!==t&&5!==t||null!=o||(o=Xe(e)),7===t){const t=qe(e);null!=t&&l.push(t)}if(8===t){const t=$e(e);t&&h.push(t.ppsId)}}if(this.dumpNalLines>=2e4)return;const g=JSON.stringify({label:t,microseconds:A,len:e.length,nalTypes:i,slicePpsId:o,auSpsIds:l,auPpsIds:h,cachedSps:this.spsById.size,cachedPps:this.ppsById.size,lastPrependedPpsId:this.lastPrependedPpsId})+"\n";this.dumpNalLines++;const d=c.join(r,"nal_dump.ndjson");this.dumpIo.enqueue((async()=>{await a.promises.appendFile(d,g)}))}catch{}},o=e=>{if(e.length<4)return!1;if(7!=(31&(e[0]??0)))return!1;const t=e[1]??0,A=e[3]??0;return!!new Set([66,77,88,100,110,122,244]).has(t)&&!(0===A||A>255)};if("Iframe"===t.type){const o="H265"===t.videoType?Fe(t.data):me(t.data),l=!0;A(o,"Iframe",t.videoType);const h=n(o,t.videoType);if(0===h.length)continue;if(i(h,"Iframe",t.microseconds),"H264"===t.videoType){if(!Se(h)||!we(h)){s.debugH264&&this.logger?.warn(`[BaichuanVideoStream] Dropping invalid H.264 Iframe (Annex-B) len=${h.length}`);continue}}else if("H265"===t.videoType){if(!Pe(h)){s.debugH264&&this.logger?.warn(`[BaichuanVideoStream] Dropping invalid H.265 Iframe (Annex-B) len=${h.length}`);continue}xe(h)||s.debugH264&&this.logger?.warn(`[BaichuanVideoStream] H.265 Iframe missing VPS/SPS/PPS or IRAP, but continuing len=${h.length}`)}if(s.debugH264&&!this.debugSavedSamples)try{const e=s.dumpDir;a.mkdirSync(e,{recursive:!0}),"Iframe"===t.type&&Ce(o)&&a.writeFileSync(c.join(e,"iframe_annexb.bin"),o)}catch{}if(!this.warnedNonAnnexBOnce&&!Ce(o)){this.warnedNonAnnexBOnce=!0;const e=t.data,A=e.subarray(0,Math.min(24,e.length)).toString("hex"),s=o.subarray(0,Math.min(24,o.length)).toString("hex");this.logger?.warn(`[BaichuanVideoStream] WARNING: non-AnnexB frame after conversion (${t.type} ${t.videoType}) len=${e.length} head=${A} convertedLen=${o.length} convertedHead=${s}`)}if(this.emit("videoFrame",h),this.emit("videoAccessUnit",{data:h,isKeyframe:l,videoType:t.videoType,microseconds:t.microseconds,..."Iframe"===t.type&&"time"in t&&void 0!==t.time?{time:t.time}:{}}),d++,e<=5||d<=5){const e=Ce(o)?"yes":"no";r&&this.logger?.log(`[BaichuanVideoStream] Emitted ${t.type} (${t.videoType}) ${t.data.length} bytes -> ${o.length} bytes (Annex-B, startCode:${e})`)}}else if("Pframe"===t.type){const e=t.data,r=Ce(e)?e:"H265"===t.videoType?Fe(e):me(e),o=Ce(r)?[r]:"H265"===t.videoType?this.depacketizerH265.push(e):this.depacketizer.push(e);if(0===o.length)continue;for(const e of o){A(e,"Pframe",t.videoType);const r=n(e,t.videoType);if(0===r.length)continue;const o=r;i(o,"Pframe",t.microseconds);if("H265"===t.videoType?Pe(o):Se(o))this.emit("videoFrame",o),this.emit("videoAccessUnit",{data:o,isKeyframe:!1,videoType:t.videoType,microseconds:t.microseconds}),d++;else if(s.debugH264&&this.debugH264LogsLeft>0){this.debugH264LogsLeft--;const e=o.subarray(0,Math.min(24,o.length)).toString("hex");this.logger?.warn(`[BaichuanVideoStream] Dropping invalid Pframe (${t.videoType}): len=${o.length} head=${e}`)}}}"Aac"!==t.type&&"Adpcm"!==t.type||(u++,this.emit("audioFrame",t.data)),"InfoV1"===t.type||t.type}if((e<=10||e%20==0&&(d>0||u>0))&&r&&this.logger?.log(`[BaichuanVideoStream] Frame #${e}: emitted ${d} video frames, ${u} audio frames`),(d>0||u>0)&&this.noteMediaActivity(),d>0&&(e<=10||e%50==0)){}},this.client.on("push",this.videoFrameHandler),this.active=!0,this.lastMediaAtMs=Date.now(),this.startWatchdog()}async stop(){if(this.active){if(this.stopWatchdog(),this.depacketizer.reset(),this.depacketizerH265.reset(),this.videoFrameHandler&&this.client.removeListener("push",this.videoFrameHandler),this.videoFrameHandler=void 0,this.bcMediaCodec.clear(),this.activeMsgNum=void 0,this.api)try{await this.api.stopVideoStream(this.channel,this.profile)}catch(e){this.emit("error",e instanceof Error?e:new Error(String(e)))}this.active=!1,this.emit("close")}}isActive(){return this.active}};async function*Ze(e,t,A){const s=new ze({client:e.client,api:e,channel:t,profile:A,logger:e.logger});let r=null,n=null,i=null,o=!1,a=!1;const c=e=>{a=!0},l=()=>{a=!0};try{await s.start(),s.on("error",c),s.on("close",l);const e=new Promise((e=>{const t=A=>{A.isKeyframe&&!r&&(r={sps:null,pps:null},s.removeListener("videoAccessUnit",t),e(r))};s.on("videoAccessUnit",t),setTimeout((()=>{r||(r={sps:null,pps:null},s.removeListener("videoAccessUnit",t),e(r))}),5e3)}));await Promise.race([e,new Promise((e=>setTimeout(e,5e3)))]);const t=[],A=200;let h=null;for(s.on("videoAccessUnit",(e=>{a||(t.push({audio:!1,data:e.data,codec:null,sampleRate:null,microseconds:e.microseconds,videoType:e.videoType}),t.length>A&&t.splice(0,t.length-A),h&&(h(),h=null))})),s.on("audioFrame",(e=>{a||(n||(n="aac",i=8e3),t.push({audio:!0,data:e,codec:n,sampleRate:i,microseconds:null}),t.length>A&&t.splice(0,t.length-A),h&&(h(),h=null))})),o=!0;!a;)if(t.length>0){const e=t.shift();yield e}else await new Promise((e=>{h=e,setTimeout((()=>{h===e&&(h=null,e())}),1e3)}))}finally{a=!0;try{await s.stop()}catch{}s.removeListener("error",c),s.removeListener("close",l)}}var je=class{key;transport;videoType;keepAliveTimer;constructor(e,t){this.transport=e,this.videoType=t,this.key=function(e,t){return`${e}-${"H264"===t?"h264":"h265"}`}(e,t)}async startKeepAlive(e){this.stopKeepAlive(),e.client.getTransport()}stopKeepAlive(){this.keepAliveTimer&&(clearInterval(this.keepAliveTimer),this.keepAliveTimer=void 0)}},Ke=Buffer.from([0,0,0,1]);function et(...e){const t=e.filter((e=>!!e&&e.length>0));if(0===t.length)return null;const A=[];for(const e of t)A.push(Ke,e);return Buffer.concat(A)}var tt=class extends je{ffmpegFormat="h264";sdpCodec="H264";sps=null;pps=null;constructor(e){super(e,"H264")}extractParameterSets(e){const t=ye(e);for(const e of t){if(e.length<1)continue;const t=31&(e[0]??0);if(7!==t||this.sps||(this.sps=e),8!==t||this.pps||(this.pps=e),this.sps&&this.pps)break}}getFmtp(){let e="packetization-mode=1";if(this.sps&&this.sps.length>=4){e+=`;profile-level-id=${Buffer.from([this.sps[1],this.sps[2],this.sps[3]]).toString("hex")}`}return this.sps&&this.pps?(e+=`;sprop-parameter-sets=${this.sps.toString("base64")},${this.pps.toString("base64")}`,{fmtp:e,hasParamSets:!0}):{fmtp:e,hasParamSets:!1}}getParameterSetsAnnexB(){return et(this.sps,this.pps)}},At=class extends je{ffmpegFormat="hevc";sdpCodec="H265";vps=null;sps=null;pps=null;constructor(e){super(e,"H265")}extractParameterSets(e){const t=Ye(e),A=Ve(e),s=Ge(e);t&&!this.vps&&(this.vps=t),A&&!this.sps&&(this.sps=A),s&&!this.pps&&(this.pps=s)}getFmtp(){let e="";return this.vps&&this.sps&&this.pps?(e=`sprop-vps=${this.vps.toString("base64")};sprop-sps=${this.sps.toString("base64")};sprop-pps=${this.pps.toString("base64")}`,{fmtp:e,hasParamSets:!0}):{fmtp:e,hasParamSets:!1}}getParameterSetsAnnexB(){return et(this.vps,this.sps,this.pps)}};function st(e,t){return"H264"===t?new tt(e):new At(e)}var rt=class{maxItems;queue=[];waiting;closed=!1;constructor(e){this.maxItems=Math.max(1,0|e)}push(e){if(!this.closed){if(this.waiting){const{resolve:t}=this.waiting;return this.waiting=void 0,void t({value:e,done:!1})}this.queue.push(e),this.queue.length>this.maxItems&&this.queue.splice(0,this.queue.length-this.maxItems)}}close(){if(!this.closed&&(this.closed=!0,this.waiting)){const{resolve:e}=this.waiting;this.waiting=void 0,e({value:void 0,done:!0})}}async next(){if(this.closed)return{value:void 0,done:!0};const e=this.queue.shift();return void 0!==e?{value:e,done:!1}:await new Promise((e=>{this.waiting={resolve:e}}))}},nt=class{opts;queues=new Map;source=null;running=!1;pumpPromise=null;constructor(e){this.opts=e}start(){this.running||(this.running=!0,this.source=this.opts.createSource(),this.pumpPromise=(async()=>{try{for await(const e of this.source){try{this.opts.onFrame?.(e)}catch{}for(const t of this.queues.values())t.push(e)}}catch(e){this.opts.onError?.(e)}finally{for(const e of this.queues.values())e.close();this.queues.clear()}})())}subscribe(e){const t=new rt(this.opts.maxQueueItems);this.queues.set(e,t);const A=this;return async function*(){try{for(;;){const e=await t.next();if(e.done)return;yield e.value}}finally{t.close(),A.queues.delete(e)}}()}async stop(){if(!this.running)return;this.running=!1;const e=this.source;this.source=null;for(const e of this.queues.values())e.close();this.queues.clear();try{await(e?.return(void 0))}catch{}try{await this.pumpPromise}catch{}this.pumpPromise=null}};var it=class e extends r.EventEmitter{api;channel;profile;listenHost;listenPort;path;logger;tcpRtpFraming;active=!1;flow;connectedClients=new Set;nativeStreamActive=!1;clientConnectionServer;streamMetadata=null;clientResources=new Map;isRtspDebugEnabled(){return this.api.client.getDebugConfig().debugRtsp||function(e,t){if(null==e)return t;const A=e.trim().toLowerCase();return"1"===A||"true"===A||"yes"===A||"on"===A||"0"!==A&&"false"!==A&&"no"!==A&&"off"!==A&&t}(process.env.BAICHUAN_DEBUG_RTSP,!1)}rtspDebugLog(e){this.isRtspDebugEnabled()&&this.logger.debug(`[BaichuanRtspServer] ${e}`)}firstFramePromise=null;firstFrameResolve=null;firstFrameReceived=!1;firstAudioPromise=null;firstAudioResolve=null;firstAudioDetected=!1;hasAudio=!1;audioInfo=null;audioPrimingFrame=null;tempStreamGenerator=null;nativeFanout=null;noClientAutoStopTimer;static isAdtsAacFrame(e){return e.length>=2&&255===e[0]&&!(240&~e[1])}static parseAdtsSamplingInfo(t){if(t.length<7)return null;if(!e.isAdtsAacFrame(t))return null;const A=t[2]>>2&15,s=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350][A]??null;if(!s)return null;const r=(1&t[2])<<2|t[3]>>6&3,n=0===r?1:r,i=(t[2]>>6&3)+1<<11|A<<7|r<<3;return{sampleRate:s,channels:n,configHex:Buffer.from([i>>8&255,255&i]).toString("hex")}}static parseInterleavedChannels(e){const t=e.match(/interleaved\s*=\s*(\d+)\s*-\s*(\d+)/i);if(!t)return null;const A=Number.parseInt(t[1],10),s=Number.parseInt(t[2],10);return Number.isFinite(A)&&Number.isFinite(s)?{rtp:A,rtcp:s}:null}static splitAnnexBNals(e){const t=[],A=e.length,s=t=>{if(t+3<=A&&0===e[t]&&0===e[t+1]){if(1===e[t+2])return 3;if(t+4<=A&&0===e[t+2]&&1===e[t+3])return 4}return 0};let r=0;for(;r<A;){if(s(r))break;r++}for(;r<A;){const n=s(r);if(!n){r++;continue}const i=r+n;let o=i;for(;o<A;){if(s(o))break;o++}if(i<o){const A=e.subarray(i,o);A.length>0&&t.push(A)}r=o}return t}static stripAdtsHeader(t){if(!e.isAdtsAacFrame(t))return null;if(t.length<7)return null;const A=!(1&~t[1])?7:9;return t.length<=A?null:t.subarray(A)}constructor(e){super(),this.api=e.api,this.channel=e.channel,this.profile=e.profile,this.listenHost=e.listenHost??"127.0.0.1",this.listenPort=e.listenPort??8554,this.path=e.path??`/stream/${this.profile}`,this.logger=e.logger??console,this.tcpRtpFraming=e.tcpRtpFraming??"rfc4571";const t=this.api.client.getTransport();this.flow=st(t,"H264")}clearNoClientAutoStopTimer(){this.noClientAutoStopTimer&&(clearTimeout(this.noClientAutoStopTimer),this.noClientAutoStopTimer=void 0)}setFlowVideoType(e,t){if(this.flow.videoType===e)return;const A=this.api.client.getTransport();this.flow.stopKeepAlive(),this.flow=st(A,e),this.rtspDebugLog(`Using RTSP flow ${this.flow.key} (${t})`)}async start(){if(this.active)throw new Error("RTSP server is already active");try{const e=(await this.api.getStreamMetadata(this.channel)).streams.find((e=>e.profile===this.profile));if(e){this.streamMetadata={frameRate:e.frameRate||25,width:e.width,height:e.height};const t=String(e.videoEncType??"").trim().toLowerCase(),A=t.includes("265")||t.includes("hevc")?"H265":"H264";this.setFlowVideoType(A,"metadata")}}catch(e){this.logger.warn(`[BaichuanRtspServer] Could not get stream metadata: ${e}`),this.streamMetadata={frameRate:25,width:1920,height:1080},this.setFlowVideoType("H264","metadata unavailable")}this.clientConnectionServer=n.createServer((e=>{this.handleRtspConnection(e)})),await new Promise(((e,t)=>{this.clientConnectionServer.listen(this.listenPort,this.listenHost,(()=>{const t=this.clientConnectionServer.address();t&&"object"==typeof t&&"port"in t&&(this.listenPort=t.port),e()})),this.clientConnectionServer.on("error",(e=>{t(e)}))})),this.active=!0,this.logger.info(`[BaichuanRtspServer] RTSP server started on ${this.listenHost}:${this.listenPort}, path: ${this.path}`)}handleRtspConnection(t){const A=`${t.remoteAddress}:${t.remotePort}`;this.logger.info(`[BaichuanRtspServer] RTSP client connected: ${A}`);let s,r="",n=Buffer.alloc(0),i=!1,o=null,a=null;const c=()=>{this.removeClient(A);const e=this.clientResources.get(A);if(e){if(e.ffmpeg)try{e.ffmpeg.stdin?.end(),e.ffmpeg.kill("SIGTERM"),setTimeout((()=>{try{e.ffmpeg?.kill("SIGKILL")}catch{}}),1e3)}catch{}if(e.udpSocket)try{e.udpSocket.close()}catch{}if(e.udpSocketAudio)try{e.udpSocketAudio.close()}catch{}if(e.rtspSocket&&!e.rtspSocket.destroyed)try{e.rtspSocket.destroy()}catch{}this.clientResources.delete(A)}if(s){try{s.stdin?.end(),s.kill("SIGTERM"),setTimeout((()=>{try{s?.kill("SIGKILL")}catch{}}),1e3)}catch{}s=void 0}if(o){try{o.close()}catch{}o=null}if(a){try{a.close()}catch{}a=null}};t.on("close",c),t.on("error",(e=>{e&&"object"==typeof e&&"code"in e&&"EPIPE"!==e.code&&this.logger.error("[BaichuanRtspServer] RTSP client error:",e),c()})),t.on("data",(async l=>{for(n=Buffer.concat([n,l]);n.includes("\r\n\r\n");){const l=n.indexOf("\r\n\r\n"),h=n.subarray(0,l).toString();if(n=n.subarray(l+4),!h.trim())continue;const g=h.split("\r\n"),d=g[0]?.split(" ");if(!d||d.length<3)continue;const u=d[0],E=d[1],I=d[2],Q=h.match(/CSeq:\s*(\d+)/i),C=Q?parseInt(Q[1]??"0",10):0,B=(e,A,s={},r)=>{let n=`${I} ${e} ${A}\r\n`;n+=`CSeq: ${C}\r\n`;for(const[e,t]of Object.entries(s))n+=`${e}: ${t}\r\n`;r&&(n+=`Content-Length: ${Buffer.byteLength(r,"utf8")}\r\n`),n+="\r\n",r&&(n+=r),t.write(n)};if(this.rtspDebugLog(`RTSP ${u} ${E}`),"OPTIONS"===u)B(200,"OK",{Public:"DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, OPTIONS"});else if("DESCRIBE"===u){if(!this.firstFrameReceived&&0===this.connectedClients.size){try{this.nativeStreamActive||await this.startNativeStream()}catch(e){this.logger.warn(`[BaichuanRtspServer] Failed to start native stream for SDP priming: ${e}`)}const{hasParamSets:e}=this.flow.getFmtp();if(!e){const e="udp"===this.api.client.getTransport()?4e3:1500;try{await Promise.race([this.firstFramePromise||Promise.resolve(),new Promise((t=>setTimeout(t,e)))])}catch{}}}{const{fmtp:e,hasParamSets:t}=this.flow.getFmtp(),s=e.length>160?`${e.slice(0,160)}...`:e;this.logger.info(`[BaichuanRtspServer] DESCRIBE SDP for ${A} path=${this.path} codec=${this.flow.sdpCodec} hasParamSets=${t} fmtp=${s}`),t||this.rtspDebugLog(`DESCRIBE responding without parameter sets yet (client=${A}, path=${this.path}, flow=${this.flow.key})`)}const e=this.generateSdp();B(200,"OK",{"Content-Type":"application/sdp","Content-Base":`rtsp://${this.listenHost}:${this.listenPort}${this.path}/`},e)}else if("SETUP"===u){const n=E?.includes("track0"),c=E?.includes("track1");if(!n&&!c){B(404,"Not Found",{Session:r||`session_${Date.now()}_${Math.random().toString(36).substring(7)}`});continue}if(c&&!this.hasAudio){B(404,"Not Found",{Session:r||`session_${Date.now()}_${Math.random().toString(36).substring(7)}`});continue}this.connectedClients.add(A),this.emit("client",A),this.clearNoClientAutoStopTimer(),1!==this.connectedClients.size||this.nativeStreamActive||await this.startNativeStream();const l=h.match(/Transport:\s*([^\r\n]+)/i),g=(l?.[1]??"").trim();i=!g||(g.includes("TCP")||g.includes("tcp")),r||(r=`session_${Date.now()}_${Math.random().toString(36).substring(7)}`);const d=this.clientResources.get(A);if(d?d.rtspSocket=t:this.clientResources.set(A,{ffmpeg:void 0,udpSocket:null,udpSocketAudio:null,rtspSocket:t,pipelineStarted:!1,seenFirstVideoKeyframe:!1,setupTrack0:!1,setupTrack1:!1,isPlaying:!1}),i){const t=this.clientResources.get(A),s=e.parseInterleavedChannels(g);if(t)if(c){const e=s??{rtp:2,rtcp:3};t.track1RtpChannel=e.rtp,t.track1RtcpChannel=e.rtcp}else{const e=s??{rtp:0,rtcp:1};t.track0RtpChannel=e.rtp,t.track0RtcpChannel=e.rtcp}}{const e=this.clientResources.get(A);e&&!e.pipelineStarted&&(e.pipelineStarted=!0,await this.startClientFfmpeg(A,t,i,((e,t,r)=>{s=e,o=t,a=r;const n=this.clientResources.get(A);n&&(n.ffmpeg=e,n.udpSocket=t,n.udpSocketAudio=r)})))}{const e=this.clientResources.get(A);e&&(c?e.setupTrack1=!0:e.setupTrack0=!0,this.rtspDebugLog(`SETUP done for ${A}: track0=${!!e.setupTrack0} track1=${!!e.setupTrack1} playing=${!!e.isPlaying}`))}if(i){const e=this.clientResources.get(A),t=c?{rtp:2,rtcp:3}:{rtp:0,rtcp:1};B(200,"OK",{Transport:`RTP/AVP/TCP;unicast;interleaved=${`${c?e?.track1RtpChannel??t.rtp:e?.track0RtpChannel??t.rtp}-${c?e?.track1RtcpChannel??t.rtcp:e?.track0RtcpChannel??t.rtcp}`}`,Session:r})}else B(200,"OK",{Transport:"RTP/AVP/UDP;unicast;client_port=5004-5005;server_port=5004-5005",Session:r})}else if("PLAY"===u){{const e=this.clientResources.get(A);e&&(e.isPlaying=!0,this.rtspDebugLog(`PLAY for ${A}: track0=${!!e.setupTrack0} track1=${!!e.setupTrack1} playing=${!!e.isPlaying}`))}B(200,"OK",{Session:r,Range:"npt=0.000-"})}else"TEARDOWN"===u?(c(),B(200,"OK",{Session:r}),t.end()):B(501,"Not Implemented")}}))}generateSdp(){const e=this.flow.sdpCodec;let t="v=0\r\n";t+=`o=- ${Date.now()} ${Date.now()} IN IP4 ${this.listenHost}\r\n`,t+="s=Baichuan Stream\r\n",t+=`c=IN IP4 ${this.listenHost}\r\n`,t+="t=0 0\r\n",t+="m=video 0 RTP/AVP 96\r\n",t+=`a=rtpmap:96 ${e}/90000\r\n`,this.streamMetadata?.frameRate&&(t+=`a=framerate:${this.streamMetadata.frameRate}\r\n`),this.streamMetadata?.width&&this.streamMetadata?.height&&(t+=`a=framesize:96 ${this.streamMetadata.width}-${this.streamMetadata.height}\r\n`),t+="a=control:track0\r\n";const{fmtp:A,hasParamSets:s}=this.flow.getFmtp();if(s||this.logger.warn(`[BaichuanRtspServer] SDP missing parameter sets for flow ${this.flow.key}`),A&&(t+=`a=fmtp:96 ${A}\r\n`),this.hasAudio){t+="m=audio 0 RTP/AVP 97\r\n";const e=this.audioInfo,A=e?.sampleRate??8e3,s=e?.channels??1,r=e?.configHex??"";t+=`a=rtpmap:97 mpeg4-generic/${A}/${s}\r\n`,r&&(t+=`a=fmtp:97 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=${r}; SizeLength=13; IndexLength=3; IndexDeltaLength=3;\r\n`),t+="a=control:track1\r\n"}return t+="a=setup:passive\r\n",t+="a=connection:new\r\n",t}async startClientFfmpeg(t,A,s,r){let n=this.streamMetadata;if(!n||!n.frameRate)try{const e=(await this.api.getStreamMetadata(this.channel)).streams.find((e=>e.profile===this.profile));e&&(n={frameRate:e.frameRate||25,width:e.width,height:e.height},this.rtspDebugLog(`Fetched metadata for profile ${this.profile}: ${n.frameRate} fps`))}catch(e){this.logger.warn(`[BaichuanRtspServer] Could not fetch stream metadata: ${e}`),n={frameRate:25,width:1920,height:1080}}const o=this.flow.ffmpegFormat;let a=0,c=0,l=null,g=null;const d=s,u=(e,t)=>{if("rfc4571"===(s?"rtsp-interleaved":this.tcpRtpFraming)){const e=Buffer.alloc(2);return e.writeUInt16BE(65535&t.length,0),Buffer.concat([e,t])}const A=Buffer.alloc(4);return A[0]=36,A[1]=255&e,A[2]=t.length>>8&255,A[3]=255&t.length,Buffer.concat([A,t])};if(s&&!d){a=5e4+Math.floor(1e4*Math.random()),l=i.createSocket("udp4"),await new Promise(((e,t)=>{l.once("listening",(()=>e())),l.once("error",t),l.bind(a,"127.0.0.1")}));const e=(e,s)=>{if(!A||A.destroyed||!A.writable)return!1;if(s.length<12)return!1;if(2!==(s[0]>>6&3))return!1;const r=this.clientResources.get(t);if(!r?.isPlaying)return!1;const n=r?.track0RtpChannel??0,i=r?.track1RtpChannel??2;if(e===n&&!r?.setupTrack0)return!1;if(e===i&&!r?.setupTrack1)return!1;try{return A.write(u(e,s))}catch(e){if(e&&"object"==typeof e&&"code"in e&&"EPIPE"===e.code)return!1}return!1};if(l){const A=this.clientResources.get(t),s=A?.track0RtpChannel??0;let r=0,n=!1,i=!1;l.on("message",(A=>{n||(n=!0,this.rtspDebugLog(`First video RTP packet received from ffmpeg for client ${t} (len=${A.length})`));e(s,A)&&!i&&(i=!0,this.rtspDebugLog(`First video RTP packet forwarded via TCP interleaved for client ${t}`)),r++,r%1e3==0&&this.rtspDebugLog(`Forwarded ${r} RTP packets to client ${t} via TCP interleaved`)}))}if(this.hasAudio){c=a+2+2*Math.floor(1e3*Math.random()),g=i.createSocket("udp4"),await new Promise(((e,t)=>{g.once("listening",(()=>e())),g.once("error",t),g.bind(c,"127.0.0.1")}));let A=0,s=!1,r=!1;g.on("message",(n=>{const i=this.clientResources.get(t),o=i?.track1RtpChannel??2;A++,s||(s=!0,this.rtspDebugLog(`First audio RTP packet received from ffmpeg for client ${t} (len=${n.length})`));e(o,n)&&!r&&(r=!0,this.rtspDebugLog(`First audio RTP packet forwarded via TCP interleaved for client ${t}`)),A%1e3==0&&this.rtspDebugLog(`Forwarded ${A} audio RTP packets to client ${t} via TCP interleaved`)}))}}const E=this.clientResources.get(t),I=this.isRtspDebugEnabled(),Q=e=>this.rtspDebugLog(e),C=(e,t)=>{if(!A||A.destroyed||!A.writable)return!1;try{return A.write(u(e,t))}catch(e){if(e&&"object"==typeof e&&"code"in e&&"EPIPE"===e.code)return!1}return!1},B=(e,t,A,s,r)=>{const n=Buffer.alloc(12);return n[0]=128,n[1]=(t?128:0)|127&e,n.writeUInt16BE(65535&A,2),n.writeUInt32BE(s>>>0,4),n.writeUInt32BE(r>>>0,8),n},p=(e,t,A)=>{const s=e?97:96;if(E?.isPlaying&&(!e||E?.setupTrack1)&&(e||E?.setupTrack0))if(e){void 0===E.rtpAudioSeq&&(E.rtpAudioSeq=Math.floor(65536*Math.random())),void 0===E.rtpAudioTimestamp&&(E.rtpAudioTimestamp=0),void 0===E.rtpAudioSsrc&&(E.rtpAudioSsrc=4294967295*Math.random()>>>0);const e=B(s,A,E.rtpAudioSeq,E.rtpAudioTimestamp,E.rtpAudioSsrc);E.rtpAudioSeq=E.rtpAudioSeq+1&65535,C(E?.track1RtpChannel??2,Buffer.concat([e,t]))}else{void 0===E.rtpVideoSeq&&(E.rtpVideoSeq=Math.floor(65536*Math.random())),void 0===E.rtpVideoTimestamp&&(E.rtpVideoTimestamp=0),void 0===E.rtpVideoSsrc&&(E.rtpVideoSsrc=4294967295*Math.random()>>>0);const e=B(s,A,E.rtpVideoSeq,E.rtpVideoTimestamp,E.rtpVideoSsrc);E.rtpVideoSeq=E.rtpVideoSeq+1&65535,C(E?.track0RtpChannel??0,Buffer.concat([e,t]))}},f=1200,m=t=>{const A=e.splitAnnexBNals(t);for(const e of A){if(e.length<1)continue;if(5===(31&(e[0]??0)))return!0}return!1},y=(e,t)=>{if(e.length<=f)return void p(!1,e,t);const A=e[0],s=31&A,r=224&A|28,n=e.subarray(1);let i=0;for(;i<n.length;){const e=n.length-i,A=Math.min(e,1198),o=0===i,a=i+A>=n.length,c=(o?128:0)|(a?64:0)|s,l=n.subarray(i,i+A),h=Buffer.concat([Buffer.from([r,c]),l]);p(!1,h,t&&a),i+=A}},S=(e,t)=>{if(e.length<=f)return void p(!1,e,t);if(e.length<3)return;const A=e[0],s=A>>1&63,r=129&A|98,n=e[1],i=e.subarray(2);let o=0;for(;o<i.length;){const e=i.length-o,A=Math.min(e,1197),a=0===o,c=o+A>=i.length,l=(a?128:0)|(c?64:0)|63&s,h=i.subarray(o,o+A),g=Buffer.concat([Buffer.from([r,n,l]),h]);p(!1,g,t&&c),o+=A}},w=n?.frameRate&&n.frameRate>0?n.frameRate:25,D=Math.max(1,Math.round(9e4/w)),b=e=>{if(!E)return;if(null==e)return;if(!Number.isFinite(e))return;if(void 0===E.rtpVideoTimestamp&&(E.rtpVideoTimestamp=0),void 0===E.rtpVideoBaseTimestamp&&(E.rtpVideoBaseTimestamp=E.rtpVideoTimestamp),void 0===E.rtpVideoBaseMicroseconds)return E.rtpVideoBaseMicroseconds=e>>>0,void(E.rtpVideoLastTimestamp=E.rtpVideoTimestamp);const t=(e>>>0)-(E.rtpVideoBaseMicroseconds>>>0)>>>0;let A=((E.rtpVideoBaseTimestamp??0)>>>0)+Math.round(9e4*t/1e6)>>>0;const s=E.rtpVideoLastTimestamp;void 0!==s&&A<=s>>>0&&(A=1+(s>>>0)>>>0),E.rtpVideoTimestamp=A,E.rtpVideoLastTimestamp=A},N=(t,A,s=!0)=>{const r=e.splitAnnexBNals(A);if(0!==r.length){for(let e=0;e<r.length;e++){const A=r[e],s=e===r.length-1;"H265"===t?S(A,s):y(A,s)}s&&void 0!==E?.rtpVideoTimestamp&&void 0===E?.rtpVideoBaseMicroseconds&&(E.rtpVideoTimestamp=E.rtpVideoTimestamp+D>>>0)}},R=t=>{const A=e.stripAdtsHeader(t);if(!A)return;const s=Buffer.from([0,16]),r=8191&A.length,n=Buffer.alloc(2);n[0]=r>>5&255,n[1]=(31&r)<<3;const i=Buffer.concat([s,n,A]);p(!0,i,!0),void 0!==E?.rtpAudioTimestamp&&(E.rtpAudioTimestamp=E.rtpAudioTimestamp+1024>>>0)},v=e=>{const t=Ue(e);for(const e of t){if(e.length<2)continue;const t=e[0];if(void 0===t)continue;if(128&t)continue;if(He(t>>1&63))return!0}return!1};let k,T;if(d&&r(void 0,null,null),!d){const e=["-hide_banner","-loglevel","error","-fflags","+genpts+igndts"],A=n?.frameRate||25;if(A>0&&(e.push("-r",A.toString()),this.rtspDebugLog(`Using frame rate ${A} fps for client ${t}`)),e.push("-f",o,"-i","pipe:0"),this.hasAudio&&e.push("-f","aac","-i","pipe:3"),s){if(e.push("-map","0:v:0","-c:v","copy","-vsync","cfr","-avoid_negative_ts","make_zero","-f","rtp","-payload_type","96",`rtp://127.0.0.1:${a}?pkt_size=1300`),this.hasAudio&&g&&c){const t=this.audioInfo,A=t?.sampleRate??8e3,s=t?.channels??1;e.push("-map","1:a:0","-c:a","aac","-profile:a","aac_low","-ar",String(A),"-ac",String(s),"-flags:a","+global_header","-f","rtp","-payload_type","97",`rtp://127.0.0.1:${c}?pkt_size=1300`)}}else e.push("-map","0:v:0","-c:v","copy","-vsync","cfr","-avoid_negative_ts","make_zero","-f","rtp","-payload_type","96","rtp://127.0.0.1:5004?pkt_size=1300");const i=["pipe","ignore","pipe"];this.hasAudio&&i.push("pipe"),this.rtspDebugLog(`Spawning ffmpeg for client ${t}: ffmpeg ${e.join(" ")}`),k=(0,h.spawn)("ffmpeg",e,{stdio:i});try{const e=this.flow.getParameterSetsAnnexB();e&&e.length>0&&k?.stdin&&(k.stdin.write(e),this.rtspDebugLog(`Wrote video parameter sets to ffmpeg stdin for client ${t} (len=${e.length})`))}catch(e){this.logger.warn(`[BaichuanRtspServer] Failed to write video parameter sets to ffmpeg for client ${t}: ${e}`)}if(k.on("error",(e=>{this.logger.error(`[BaichuanRtspServer] Failed to spawn ffmpeg for client ${t}:`,e)})),k.on("close",((e,A)=>{this.rtspDebugLog(`ffmpeg exited for client ${t} (code=${e}, signal=${A})`)})),r(k,l,g),k.stdin?.on("error",(e=>{const A=e?.code;"EPIPE"!==A&&"ERR_STREAM_WRITE_AFTER_END"!==A?this.logger.error(`[BaichuanRtspServer] FFmpeg stdin error for client ${t}:`,e):this.rtspDebugLog(`FFmpeg stdin error (${A}) for client ${t}`)})),T=this.hasAudio?k.stdio?.[3]:void 0,T?.on?.("error",(e=>{const A=e?.code;"EPIPE"!==A&&"ERR_STREAM_WRITE_AFTER_END"!==A?this.logger.error(`[BaichuanRtspServer] FFmpeg audio pipe error for client ${t}:`,e):this.rtspDebugLog(`FFmpeg audio pipe error (${A}) for client ${t}`)})),T&&this.audioPrimingFrame)try{T.write(this.audioPrimingFrame)}catch{}}this.rtspDebugLog(`Creating native stream iterator for client ${t}`);const F=this.nativeFanout?this.nativeFanout.subscribe(t):Ze(this.api,this.channel,this.profile);this.tempStreamGenerator=null;let M=0,U=Date.now();const L=n&&n.frameRate>0?1e3/n.frameRate:40;(async()=>{try{this.rtspDebugLog(`Starting to feed frames to client ${t} (target FPS: ${n?.frameRate||25}, interval: ${L}ms)`);let A=0,s=!1,r=!1,i=!1,o=!1,a=!1;for await(const n of F){if(!this.connectedClients.has(t)){this.rtspDebugLog(`Client ${t} disconnected, stopping frame feed`);break}const c=k?.stdin;if(!d&&(!c||c.destroyed||c.writableEnded||c.writableFinished)){this.rtspDebugLog(`FFmpeg stdin closed for client ${t}`);break}if(0===n.data.length)continue;if(!n.audio&&!i&&(i=!0,I)){const e=n.data.subarray(0,16).toString("hex");Q(`First video frame received from generator for client ${t} (len=${n.data.length}, videoType=${String(n.videoType??this.flow.videoType)}, head=${e})`)}if(n.audio){if(A++,1===A&&this.rtspDebugLog(`Audio frames detected (codec: ${n.codec||"unknown"}, sampleRate: ${n.sampleRate||"unknown"})`),A%100==0&&this.rtspDebugLog(`Received ${A} audio frames (not sent to RTSP yet)`),d){if(!E?.seenFirstVideoKeyframe)continue;if(this.hasAudio&&e.isAdtsAacFrame(n.data)){if(I&&!r){r=!0;const e=n.data.subarray(0,16).toString("hex");Q(`First audio ADTS frame packetized to RTP for client ${t} (len=${n.data.length}, head=${e})`)}R(n.data)}continue}if(this.hasAudio&&T&&!T.writableEnded&&!T.writableFinished){const A=T;if(!A)continue;if(e.isAdtsAacFrame(n.data))try{if(!r){r=!0;const e=n.data.subarray(0,16).toString("hex");this.rtspDebugLog(`First audio frame written to ffmpeg pipe for client ${t} (len=${n.data.length}, head=${e})`)}A.write(n.data)||await new Promise((e=>A.once("drain",(()=>e()))))}catch{}}continue}if("H264"===n.videoType||"H265"===n.videoType){const e="H264"===n.videoType?me(n.data):Fe(n.data);0===M&&this.setFlowVideoType(n.videoType,"first video frame");if(this.flow.getFmtp().hasParamSets)this.firstFrameReceived||this.markFirstFrameReceived();else{this.flow.extractParameterSets(e);this.flow.getFmtp().hasParamSets&&this.markFirstFrameReceived()}}M++,M%100==0&&this.rtspDebugLog(`Sent ${M} frames to client ${t} (frame size: ${n.data.length} bytes)`);const l=Date.now(),h=L-(l-U);if(h>0&&await new Promise((e=>setTimeout(e,Math.min(h,2*L)))),U=Date.now(),d){const e=n.videoType??this.flow.videoType,A="H264"===e?me(n.data):Fe(n.data);if(!E?.seenFirstVideoKeyframe)if("H265"===e){const{hasParamSets:s}=this.flow.getFmtp();if(!s){I&&!o&&(o=!0,Q(`H265 gating: waiting for VPS/SPS/PPS before sending RTP to client ${t}`));continue}if(!E?.rtpSentVideoConfig){const t=this.flow.getParameterSetsAnnexB();t&&t.length>0&&(N(e,t,!1),E.rtpSentVideoConfig=!0)}E.h265WaitStartMs||(E.h265WaitStartMs=Date.now());const r=v(A),n=Date.now()-E.h265WaitStartMs;if(!r&&n<2e3){I&&!a&&(a=!0,Q(`H265 gating: waiting for IRAP (or timeout) for client ${t}`));continue}E.seenFirstVideoKeyframe=!0}else{const{hasParamSets:s}=this.flow.getFmtp();if(!s){I&&!o&&(o=!0,Q(`H264 gating: waiting for SPS/PPS before sending RTP to client ${t}`));continue}if(!E?.rtpSentVideoConfig){const t=this.flow.getParameterSetsAnnexB();t&&t.length>0&&(N(e,t,!1),E.rtpSentVideoConfig=!0)}if(!m(A))continue;E.seenFirstVideoKeyframe=!0}const r=n.microseconds;if(b(r),!E?.rtpSentVideoConfig){const t=this.flow.getParameterSetsAnnexB();t&&t.length>0&&(N(e,t,!1),E.rtpSentVideoConfig=!0)}if(!s&&(s=!0,I)){const e=n.data.subarray(0,16).toString("hex");Q(`First video access unit packetized to RTP for client ${t} (len=${n.data.length}, head=${e})`)}N(e,A,!0)}else try{if(c&&!c.destroyed&&!c.writableEnded&&!c.writableFinished){if(!s){s=!0;const e=n.data.subarray(0,16).toString("hex");this.rtspDebugLog(`First video frame written to ffmpeg stdin for client ${t} (len=${n.data.length}, head=${e})`)}c.write("H264"===n.videoType?me(n.data):n.data)||await new Promise((e=>{c?c.once("drain",(()=>e())):e()}))}}catch(e){const A=e?.code;if("EPIPE"===A||"ERR_STREAM_WRITE_AFTER_END"===A){this.rtspDebugLog(`EPIPE writing to ffmpeg for client ${t}`);break}this.logger.error(`[BaichuanRtspServer] Error writing frame to ffmpeg for client ${t}:`,e)}}this.rtspDebugLog(`Finished feeding frames to client ${t} (total: ${M} frames)`)}catch(e){this.logger.error(`[BaichuanRtspServer] Error in feedFrames for client ${t}:`,e)}})().catch((e=>{this.logger.error(`[BaichuanRtspServer] Error feeding frames to client ${t}:`,e)})),k?.stderr?.on("data",(e=>{const A=e.toString();(A.includes("error")||A.includes("Error"))&&this.logger.error(`[BaichuanRtspServer] FFmpeg error for client ${t}: ${A}`)}))}async startNativeStream(){this.nativeStreamActive||(this.nativeStreamActive=!0,this.firstFrameReceived=!1,this.firstAudioDetected=!1,this.hasAudio=!1,this.audioInfo=null,this.audioPrimingFrame=null,this.firstFramePromise=new Promise((e=>{this.firstFrameResolve=e})),this.firstAudioPromise=new Promise((e=>{this.firstAudioResolve=e})),this.rtspDebugLog(`Starting native stream for profile ${this.profile} (waiting for camera to start transmitting...)`),await this.flow.startKeepAlive(this.api),this.nativeFanout=new nt({maxQueueItems:200,createSource:()=>Ze(this.api,this.channel,this.profile),onFrame:t=>{if(t.audio){if(!this.hasAudio&&"tcp"===this.api.client.getTransport()&&e.isAdtsAacFrame(t.data)){const A=e.parseAdtsSamplingInfo(t.data);A&&(this.hasAudio=!0,this.audioInfo={codec:"aac-adts",sampleRate:A.sampleRate,channels:A.channels,configHex:A.configHex},this.audioPrimingFrame=Buffer.from(t.data),this.markFirstAudioDetected(),this.rtspDebugLog(`Audio detected (AAC/ADTS ${A.sampleRate}Hz ch=${A.channels}); advertising RTSP track1 as mpeg4-generic`))}return}if(0===t.data.length)return;"H264"!==t.videoType&&"H265"!==t.videoType||this.setFlowVideoType(t.videoType,"native stream"),this.flow.extractParameterSets(t.data);const{hasParamSets:A}=this.flow.getFmtp();A&&this.markFirstFrameReceived()},onError:e=>{this.logger.warn(`[BaichuanRtspServer] Shared native stream error: ${e}`)}}),this.nativeFanout.start(),this.clearNoClientAutoStopTimer(),this.noClientAutoStopTimer=setTimeout((()=>{0===this.connectedClients.size&&(this.rtspDebugLog("Auto-stopping primed native stream (no clients connected)"),this.stopNativeStream())}),15e3),this.noClientAutoStopTimer?.unref?.())}markFirstFrameReceived(){!this.firstFrameReceived&&this.firstFrameResolve&&(this.firstFrameReceived=!0,this.rtspDebugLog(`First frame received from camera for profile ${this.profile}`),this.firstFrameResolve(),this.firstFrameResolve=null)}markFirstAudioDetected(){!this.firstAudioDetected&&this.firstAudioResolve&&(this.firstAudioDetected=!0,this.firstAudioResolve(),this.firstAudioResolve=null)}async stopNativeStream(){if(this.nativeStreamActive){if(this.rtspDebugLog("Stopping native stream"),this.flow.stopKeepAlive(),this.clearNoClientAutoStopTimer(),this.nativeStreamActive=!1,this.firstFrameReceived=!1,this.firstFramePromise=null,this.firstFrameResolve&&(this.firstFrameResolve=null),this.firstAudioDetected=!1,this.firstAudioPromise=null,this.firstAudioResolve&&(this.firstAudioResolve=null),this.nativeFanout){const e=this.nativeFanout;this.nativeFanout=null,await e.stop()}if(this.tempStreamGenerator){try{await this.tempStreamGenerator.return(void 0)}catch{}this.tempStreamGenerator=null}}}removeClient(e){this.connectedClients.has(e)&&(this.connectedClients.delete(e),this.emit("clientDisconnected",e),this.logger.info(`[BaichuanRtspServer] RTSP client disconnected: ${e}`),0===this.connectedClients.size&&this.stopNativeStream())}async waitUntilReady(e=3e4){return new Promise(((t,A)=>{if(!this.clientConnectionServer)return void A(new Error("RTSP server not started"));const s=setTimeout((()=>{A(new Error(`Timeout waiting for RTSP server to be ready (${e}ms). Camera may be sleeping or not responding.`))}),e),r=()=>{const e=new n.Socket;e.setTimeout(1e3),e.on("connect",(()=>{e.destroy(),this.nativeStreamActive&&this.firstFramePromise?(this.rtspDebugLog("Port is listening, waiting for camera to start transmitting frames..."),this.firstFramePromise.then((()=>{clearTimeout(s),t()})).catch((e=>{clearTimeout(s),A(e)}))):(clearTimeout(s),t())})),e.on("timeout",(()=>{e.destroy(),setTimeout(r,500)})),e.on("error",(()=>{e.destroy(),setTimeout(r,500)})),e.connect(this.listenPort,this.listenHost)};r()}))}async stop(){if(!this.active)return;this.logger.info(`[BaichuanRtspServer] Stopping RTSP server on ${this.listenHost}:${this.listenPort}...`),await this.stopNativeStream();const e=Array.from(this.connectedClients);for(const t of e){const e=this.clientResources.get(t);if(e){if(e.ffmpeg)try{e.ffmpeg.stdin?.end(),e.ffmpeg.kill("SIGTERM"),setTimeout((()=>{try{e.ffmpeg?.kill("SIGKILL")}catch{}}),1e3)}catch{}if(e.udpSocket)try{e.udpSocket.close()}catch{}if(e.rtspSocket&&!e.rtspSocket.destroyed)try{e.rtspSocket.destroy()}catch{}}}this.clientResources.clear(),this.clientConnectionServer&&(await new Promise((e=>{this.clientConnectionServer?.close((()=>{e()}))})),this.clientConnectionServer=void 0),this.active=!1,this.connectedClients.clear(),this.emit("close"),this.logger.info("[BaichuanRtspServer] RTSP server stopped")}getRtspUrl(){return`rtsp://${this.listenHost}:${this.listenPort}${this.path}`}isActive(){return this.active}getClientCount(){return this.connectedClients.size}},ot={resolution_index:[0,7],tv_system:[7,1],framerate:[8,7],audio_index:[15,2],ai_pd:[17,1],ai_fd:[18,1],ai_vd:[19,1],ai_ad:[20,1],encoder_type_index:[21,2],is_schedule_record:[23,1],is_motion_record:[24,1],is_rf_record:[25,1],is_doorbell_record:[26,1],ai_other:[27,1]},at={resolution_index:[0,7],tv_system:[7,1],framerate:[8,7],audio_index:[15,2],ai_pd:[17,1],ai_fd:[18,1],ai_vd:[19,1],ai_ad:[20,1],encoder_type_index:[21,2],is_schedule_record:[23,1],is_motion_record:[24,1],is_rf_record:[25,1],is_doorbell_record:[26,1],is_ai_other_record:[27,1],picture_layout_index:[28,7],package_delivered:[35,1],package_takenaway:[36,1]},ct={cam:{2:ot,3:ot,4:ot,7:ot,9:ot,10:ot},hub:{0:at,1:{...at,package_event:[37,1]},2:{resolution_index:[0,7],tv_system:[7,1],framerate:[8,7],audio_index:[15,2],ai_pd:[17,1],ai_fd:[18,1],ai_vd:[19,1],ai_ad:[20,1],ai_other:[21,2],encoder_type_index:[23,1],is_schedule_record:[24,1],is_motion_record:[25,1],is_rf_record:[26,1],is_doorbell_record:[27,1],picture_layout_index:[28,7],package_delivered:[35,1],package_takenaway:[36,1],package_event:[37,1],upload_flag:[38,1]}}};function lt(e,t,A){const s=ct[e],r=s[t]??s[Math.max(...Object.keys(s).map((e=>Number(e))))];if(!r)return;const n=function(e,t){if(!e)return;if(!/^[0-9a-fA-F]+$/.test(e))return;const A=4*e.length,s=BigInt(`0x${e}`).toString(2).padStart(A,"0").split("").reverse().join(""),r=BigInt(`0b${s}`),n={};for(const[e,[A,s]]of Object.entries(t)){const t=BigInt(A),i=((r&(1n<<BigInt(s))-1n<<t)>>t).toString(2).padStart(s,"0").split("").reverse().join("");n[e]=Number.parseInt(i,2)}return n}(A,r);if(!n)return;return{raw:n,flags:{aiPerson:1===n.ai_pd,aiVehicle:1===n.ai_vd,aiAnimal:1===n.ai_ad,aiFace:1===n.ai_fd,aiOther:1===n.is_ai_other_record||1===n.ai_other||(n.ai_other??0)>0,schedule:1===n.is_schedule_record,motion:1===n.is_motion_record,rf:1===n.is_rf_record,doorbell:1===n.is_doorbell_record,package:1===n.package_event||1===n.package_delivered||1===n.package_takenaway}}}function ht(e,t){if(!/^\d{8}$/.test(e))return;if(!/^\d{6}$/.test(t))return;const A=Number.parseInt(e.slice(0,4),10),s=Number.parseInt(e.slice(4,6),10),r=Number.parseInt(e.slice(6,8),10),n=Number.parseInt(t.slice(0,2),10),i=Number.parseInt(t.slice(2,4),10),o=Number.parseInt(t.slice(4,6),10);return[A,s,r,n,i,o].every(Number.isFinite)?new Date(A,s-1,r,n,i,o):void 0}function gt(e){const t=e.lastIndexOf(".");if(t<=0||t===e.length-1)return;const A=e.slice(t+1),s=e.slice(0,t).split("/").filter(Boolean).at(-1);if(!s)return;const r=s.split("_"),n=r[0]??"";if(!n.startsWith("Rec")||6!==n.length)return;const i=n[3],o="M"===i?"main":"S"===i?"sub":"unknown",a=Number.parseInt(n.slice(4,6),16);if(!Number.isFinite(a))return;let c,l,h,g="cam",d="",u="",E="",I="";if(6===r.length)d=r[1]??"",u=r[2]??"",E=r[3]??"",I=r[4]??"";else if(7===r.length)d=r[1]??"",u=r[2]??"",E=r[3]??"",c=r[4],I=r[5]??"";else{if(9!==r.length)return;g="hub",d=r[1]??"",u=r[2]??"",E=r[3]??"",c=r[4],l=r[5],h=r[6],I=r[7]??""}d=d.toLowerCase().replace("dst","");const Q=ht(d,u);if(!Q)return;const C="000000"===E?Q:ht(d,E);if(!C)return;const B=Math.max(0,C.getTime()-Q.getTime()),p={baseName:s,ext:A,streamHint:o,version:a,devType:g,start:Q,end:C,durationMs:B},f=lt(g,a,I);return f&&(p.flags=f.flags,p.rawFlags=f.raw),null!=c&&(p.animalTypeRaw=c),null!=l&&(p.widthRaw=l),null!=h&&(p.heightRaw=h),p}function dt(e){if(null==e)return;const t=Number(e);return Number.isFinite(t)?t:void 0}function ut(e){if("number"==typeof e)return e>0;if("string"==typeof e){const t=Number(e);return Number.isFinite(t)?t>0:e.length>0&&"0"!==e}return Boolean(e)}function Et(e,t){if(!e||"object"!=typeof e)return;const A=e,s=A[t],r=A.Host,n={...r&&"object"==typeof r?r:{},...s&&"object"==typeof s?s:{}};return Object.keys(n).length?n:void 0}function It(e,t){if(!e)return!1;for(const[A,s]of Object.entries(e))if(t.test(A)&&ut(s))return!0;return!1}function Qt(e){if(!e)return;const t=e.match(/<Support[^>]*>([\s\S]*?)<\/Support>/i);if(!t)return;const A=t[1]??"",s=A.match(/<ptzMode>([^<]*)<\/ptzMode>/i)?.[1],r=[];for(const e of A.matchAll(/<item[^>]*>([\s\S]*?)<\/item>/gi)){const t=e[1]??"",A={chnID:dt(t.match(/<chnID>([^<]*)<\/chnID>/i)?.[1])??0};for(const e of t.matchAll(/<([A-Za-z0-9_]+)>([^<]*)<\/\1>/g)){const t=e[1],s=e[2];if(!t)continue;if("chnID"===t)continue;const r=dt(s);A[t]=r??s}r.push(A)}const n={items:r};void 0!==s&&(n.ptzMode=s);const i=(e,t)=>{const s=(e=>{const t=A.match(new RegExp(`<${e}>([^<]*)<\\/${e}>`,"i"));return dt(t?.[1])})(t);void 0!==s&&(n[e]=s)};i("IOInputPortNum","IOInputPortNum"),i("IOOutputPortNum","IOOutputPortNum"),i("diskNum","diskNum"),i("channelNum","channelNum"),i("audioNum","audioNum"),i("ptzCfg","ptzCfg"),i("B485","B485"),i("autoUpdate","autoUpdate"),i("pushAlarm","pushAlarm"),i("ftp","ftp"),i("ftpTest","ftpTest"),i("email","email"),i("wifi","wifi"),i("record","record"),i("wifiTest","wifiTest"),i("rtsp","rtsp"),i("onvif","onvif"),i("audioTalk","audioTalk");const o=(e=>{const t=A.match(new RegExp(`<${e}>([^<]*)<\\/${e}>`,"i"));return t?.[1]})("subVersion");return void 0!==o&&(n.subVersion=o),n}function Ct(e){const{channel:t}=e,A=Et(e.abilities,t),s=function(e,t){if(!e?.items?.length)return;const A=e=>{const t=e;let A=0;null==t.name&&(A+=2);const s=["ptzType","ptzControl","ptzPreset","ledCtrl","lightType","battery","audioVersion","motion","encCtrl","newIspCfg","remoteAbility"];for(const e of s)void 0!==t[e]&&(A+=3);return A+=Math.min(10,Math.max(0,Object.keys(t).length-1)),A};return(t=>{const s=e.items.filter((e=>e.chnID===t));if(s.length)return s.slice().sort(((e,t)=>A(t)-A(e)))[0]})(t)}(e.support,t),r=e.support?.ptzMode,n="string"==typeof r?r.toLowerCase():void 0,i=s?s.ptzType:void 0,o=s?s.ptzControl:void 0,a=ut(i)||ut(o)||ut(s?.ptzPreset),c=("none"===n||"0"===n)&&!a,l=!!s&&ut(s.battery),h=!!s&&ut(s.ptzPreset),g=s?s.doorbellVersion:void 0,d=Number.isFinite(Number(g))?Number(g)>0:ut(g),u=s?s.lightType:void 0,E="number"==typeof u?u:"string"==typeof u?Number(u):void 0,I=a||!!n&&("none"!==n&&"0"!==n),Q=!!n&&(n.includes("pt")||"pt"===n||"ptz"===n),C=!!n&&n.includes("z"),B=It(A,/battery/i),p=It(A,/white\s*led|whiteLed|flood\s*light|floodlight/i),f=It(A,/audio\s*alarm|audioAlarm|siren|pushAlarn|audioPlay/i),m=ut(e.support?.audioTalk),y=It(A,/ptz/i),S=It(A,/zoom|zoomFocus|StartZoomFocus/i),w=It(A,/preset/i),D=It(A,/(^|_)pir/i)||It(A,/rfAlarm/i)||It(A,/mdWithPir/i),b=!!s&&(ut(s.rfCfg)||ut(s.newRfCfg)||ut(s.rfVersion)||ut(s.battery)),N=!c&&(Q||y),R=!c&&(Q||y),v=!c&&(C||S),k=!c&&(h||w),T={channel:t,hasPan:N,hasTilt:R,hasZoom:v,hasPresets:k,hasPtz:!c&&(I||N||R||v||k),hasBattery:l||B,hasIntercom:m,hasSiren:f,hasFloodlight:Number.isFinite(E)?E>0:p,hasPir:D||b,isDoorbell:d};return void 0!==n&&(T.ptzMode=n),T}function Bt(e){if(null!=e){if("boolean"==typeof e)return e;if("number"==typeof e)return 1===e;if("string"==typeof e){const t=e.trim().toLowerCase();if("1"===t||"true"===t||"yes"===t||"on"===t)return!0;if("0"===t||"false"===t||"no"===t||"off"===t)return!1}}}function pt(e){const t=function(e){if(!e||0===e.length)return[];const t=e[0]?.value;if(!t)return[];let A=t?.status??t?.Channelstatus??t?.ChannelStatus??t?.channelStatus??t?.channelstatus;if(!Array.isArray(A))if(Array.isArray(t))A=t;else if(A=t?.channels??t?.Channels??t?.channel??t?.Channel,!Array.isArray(A)){const e=Object.keys(t).filter((e=>/^channel\d+$/i.test(e)||/^ch\d+$/i.test(e)));e.length>0&&(A=e.map((e=>{const A=t[e];return"object"==typeof A&&null!==A?A:{channel:parseInt(e.replace(/\D/g,""),10)}})))}return Array.isArray(A)?A:[]}(e);if(!t.length)return[];const A=[];for(const e of t){if("object"!=typeof e||null===e)continue;const t=e?.channel??e?.id??e?.channelId??e?.Channel??e?.ID??e?.ChannelId;if("number"!=typeof t||!Number.isFinite(t))continue;const s="string"==typeof e?.name?e.name:void 0,r="string"==typeof e?.uid?e.uid:void 0,n="string"==typeof e?.typeInfo?e.typeInfo:void 0,i=Bt(e?.online),o=Bt(e?.sleep);A.push({channel:t,...void 0!==i?{online:i}:{},...void 0!==o?{sleep:o}:{},...s?{name:s}:{},...r?{uid:r}:{},...n?{typeInfo:n}:{}})}return A.sort(((e,t)=>e.channel-t.channel)),A}function ft(e){return new Promise((t=>setTimeout(t,e)))}function mt(e,t){const A=new RegExp(`<${t}\\b[^>]*>([\\s\\S]*?)<\\/${t}>`,"g"),s=[];let r;for(;r=A.exec(e);)s.push(r[1]??"");return s}function yt(e){const t=Number.parseInt(H(e,"year")??"",10),A=Number.parseInt(H(e,"month")??"",10),s=Number.parseInt(H(e,"day")??"",10),r=Number.parseInt(H(e,"hour")??"",10),n=Number.parseInt(H(e,"minute")??"",10),i=Number.parseInt(H(e,"second")??"",10);if([t,A,s,r,n,i].every(Number.isFinite))return new Date(t,A-1,s,r,n,i)}function St(e,t){return`<${e}><year>${t.getFullYear()}</year><month>${t.getMonth()+1}</month><day>${t.getDate()}</day><hour>${t.getHours()}</hour><minute>${t.getMinutes()}</minute><second>${t.getSeconds()}</second></${e}>`}function wt(e){const t=[],A=mt(e,"FileInfo");for(const e of A){const A=H(e,"Id")??H(e,"ID")??H(e,"id"),s=H(e,"name")??H(e,"fileName"),r=(A??s)?.trim();if(!r)continue;const n={fileName:r};null!=s&&s.trim()&&(n.name=s.trim()),null!=A&&A.trim()&&(n.id=A.trim());const i=H(e,"type")??H(e,"recordType")??H(e,"alarmType");null!=i&&(n.recordType=i);const o=H(e,"size")??H(e,"fileSize"),a=o?Number.parseInt(o,10):void 0;null!=a&&Number.isFinite(a)&&(n.sizeBytes=a);const c=mt(e,"startTime")[0],l=mt(e,"endTime")[0],h=c?yt(c):void 0,g=l?yt(l):void 0;h&&(n.startTime=h),g&&(n.endTime=g);const d=gt(n.name??n.fileName);d&&(n.parsedFileName=d,n.startTime||(n.startTime=d.start),n.endTime||(n.endTime=d.end)),t.push(n)}const s=mt(e,"File");for(const e of s){const A=H(e,"fileName")??H(e,"name");if(!A)continue;const s=H(e,"size")??H(e,"fileSize"),r=s?Number.parseInt(s,10):void 0,n=H(e,"type")??H(e,"recordType")??H(e,"alarmType"),i=mt(e,"startTime")[0],o=mt(e,"endTime")[0],a={fileName:A};null!=r&&Number.isFinite(r)&&(a.sizeBytes=r),null!=n&&(a.recordType=n);const c=i?yt(i):void 0,l=o?yt(o):void 0;c&&(a.startTime=c),l&&(a.endTime=l);const h=gt(a.fileName);h&&(a.parsedFileName=h,a.startTime||(a.startTime=h.start),a.endTime||(a.endTime=h.end)),t.push(a)}if(0===t.length){const A=/<fileName>([\s\S]*?)<\/fileName>/g;let s;for(;s=A.exec(e);){const e=(s[1]??"").trim();if(!e)continue;const A={fileName:e},r=gt(e);r&&(A.parsedFileName=r,A.startTime=r.start,A.endTime=r.end),t.push(A)}}if(0===t.length){const A=mt(e,"alarmVideo");for(const e of A){const A=H(e,"fileName")??H(e,"name");if(!A)continue;const s={fileName:A},r=H(e,"alarmType");null!=r&&(s.recordType=r);const n=mt(e,"startTime")[0],i=mt(e,"endTime")[0],o=n?yt(n):void 0,a=i?yt(i):void 0;o&&(s.startTime=o),a&&(s.endTime=a);const c=gt(s.fileName);c&&(s.parsedFileName=c,s.startTime||(s.startTime=c.start),s.endTime||(s.endTime=c.end)),t.push(s)}}const r=new Set;return t.filter((e=>!r.has(e.fileName)&&(r.add(e.fileName),!0)))}function Dt(e){const t=H(e,"audioType"),A=Number.parseInt(H(e,"sampleRate")??"",10),s=Number.parseInt(H(e,"samplePrecision")??"",10),r=Number.parseInt(H(e,"lengthPerEncoder")??"",10),n=H(e,"soundTrack"),i=H(e,"priority");if(!(t&&Number.isFinite(A)&&Number.isFinite(s)&&Number.isFinite(r)&&n))return null;const o={audioType:t,sampleRate:A,samplePrecision:s,lengthPerEncoder:r,soundTrack:n};if(void 0!==i){const e=Number.parseInt(i,10);Number.isFinite(e)&&(o.priority=e)}return o}function bt(e,t){const A=4+e.length,s=A%8==0?0:8-A%8,r=12+e.length+s,n=Buffer.alloc(r);return n.writeUInt32LE(1651978544,0),n.writeUInt16LE(A,4),n.writeUInt16LE(A,6),n.writeUInt16LE(256,8),n.writeUInt16LE(t,10),e.copy(n,12),n}var Nt=class{client;logger;httpClient;host;username;password;simpleEventListeners=new Set;simpleEventSubscribed=!1;simpleEventSubscribeInFlight;simpleEventUnsubscribeInFlight;statePollingInterval;lastMotionState;lastAiState;rtspServers=new Set;activeVideoMsgNums=new Map;lastSleepProbe;constructor(e){this.logger=e.logger??console,this.client=new he(e),this.host=e.host,this.username=e.username,this.password=e.password,this.httpClient=new ge({host:e.host,username:e.username,password:e.password,timeoutMs:6e5}),this.client.on("event",(e=>{const t=function(e){const t=e.timestamp??Date.now();if("motion"===e.type)return{type:"motion",channel:e.channel,timestamp:t};if("visitor"===e.type)return{type:"doorbell",channel:e.channel,timestamp:t};if("daynight"===e.type)return{type:"daynight",channel:e.channel,timestamp:t};if("ai"===e.type){const A=e.ai,s=A?.type;return{type:s?{people:"people",vehicle:"vehicle",dog_cat:"animal",face:"face",package:"package",other:"other"}[s]:"other",channel:e.channel,timestamp:t}}return null}(e);if(t)for(const e of this.simpleEventListeners)try{e(t)}catch(e){(this.logger.warn??this.logger.error).call(this.logger,"[ReolinkBaichuanApi] onSimpleEvent handler error",e)}}))}async onSimpleEvent(e){this.simpleEventListeners.add(e),await this.ensureSimpleEventSubscribed()}async offSimpleEvent(e){if(e?this.simpleEventListeners.delete(e):this.simpleEventListeners.clear(),0===this.simpleEventListeners.size)await this.ensureSimpleEventUnsubscribed();else{"udp"===this.client.getTransport?.()||this.startStatePolling()}}async ensureSimpleEventSubscribed(){if(0!==this.simpleEventListeners.size&&!this.simpleEventSubscribed)return this.simpleEventSubscribeInFlight||(this.simpleEventSubscribeInFlight=(async()=>{await this.subscribeEvents(),this.simpleEventSubscribed=!0;"udp"===this.client.getTransport?.()||(await this.checkAndDispatchCurrentState(),this.startStatePolling())})().finally((()=>{this.simpleEventSubscribeInFlight=void 0}))),await this.simpleEventSubscribeInFlight}async ensureSimpleEventUnsubscribed(){if(this.simpleEventSubscribed||this.client.subscribed){if(this.simpleEventUnsubscribeInFlight)return await this.simpleEventUnsubscribeInFlight;if(this.simpleEventSubscribeInFlight)try{await this.simpleEventSubscribeInFlight}catch{}return this.simpleEventUnsubscribeInFlight=(async()=>{await this.unsubscribeEvents(),this.simpleEventSubscribed=!1,this.stopStatePolling()})().finally((()=>{this.simpleEventUnsubscribeInFlight=void 0})),await this.simpleEventUnsubscribeInFlight}}normalizeChannel(e){return null==e?0:e}async login(e){await this.client.login(e)}async close(){this.stopStatePolling(),await this.cleanup(),await this.client.close()}async cleanup(){const e=Array.from(this.rtspServers);this.rtspServers.clear(),await Promise.allSettled(e.map((async e=>{try{await e.stop()}catch(e){this.logger.error("[ReolinkBaichuanApi] Error stopping RTSP server during cleanup:",e)}}))),e.length>0&&this.logger.info(`[ReolinkBaichuanApi] Cleaned up ${e.length} RTSP server(s)`)}async sendXml(e,t=3){this.client.loggedIn||await this.client.login();try{const A=await this.client.sendFrame(e);if(400===A.header.responseCode){if(t>0){if(0===A.body.length)try{this.client.loggedIn=!1,await this.client.login()}catch{}const s=1500;return await new Promise((e=>setTimeout(e,s))),await this.sendXml(e,t-1)}if(0===A.body.length)throw new Error("Baichuan request failed (responseCode 400, empty body). Possible causes: camera sleeping/waking (battery), expired session, or invalid username/password.")}if(0===A.body.length)return"";return this.client.tryDecryptXml(A.body,A.header.channelId,this.client.enc)}catch(e){throw e}}async getTalkAbility(e){return function(e){const t=mt(e,"TalkAbility")[0];if(!t)throw new Error("TalkAbility XML not found in response");return{duplexList:mt(t,"duplexList").map((e=>H(e,"duplex"))).filter((e=>!!e)),audioStreamModeList:mt(t,"audioStreamModeList").map((e=>H(e,"audioStreamMode"))).filter((e=>!!e)),audioConfigList:mt(t,"audioConfig").map(Dt).filter((e=>!!e))}}(await this.sendXml({cmdId:10,...void 0!==e?{channel:e}:{}}))}async createTalkSession(e=0,t){this.client.loggedIn||await this.client.login();const A=await this.getTalkAbility(e),s=A.audioConfigList.find((e=>"adpcm"===e.audioType.toLowerCase()))??A.audioConfigList[0];if(!s)throw new Error(`Talk not supported on channel ${e} (no audioConfig in TalkAbility)`);const r=A.duplexList[0]??"FDX",n=A.audioStreamModeList[0]??"followVideoStream",i={channel:e,duplex:r,audioStreamMode:n,audioConfig:s},o=Math.floor(s.lengthPerEncoder/2),a=o+4;if(o<=0||a<=4)throw new Error(`Invalid talk audio config: lengthPerEncoder=${s.lengthPerEncoder}`);const c=function(e){const t=e.audioConfig;return`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<TalkConfig version="1.1">\n<channelId>${e.channel}</channelId>\n<duplex>${M(e.duplex)}</duplex>\n<audioStreamMode>${M(e.audioStreamMode)}</audioStreamMode>\n<audioConfig>\n<audioType>${M(t.audioType)}</audioType>\n<sampleRate>${t.sampleRate}</sampleRate>\n<samplePrecision>${t.samplePrecision}</samplePrecision>\n<lengthPerEncoder>${t.lengthPerEncoder}</lengthPerEncoder>\n<soundTrack>${M(t.soundTrack)}</soundTrack>\n</audioConfig>\n</TalkConfig>\n</body>`}(i);await(async()=>{const t=await this.client.sendFrame({cmdId:201,channel:e,payloadXml:c,messageClass:B});if(422!==t.header.responseCode){if(200!==t.header.responseCode)throw new Error(`TalkConfig rejected (responseCode ${t.header.responseCode})`)}else{await this.client.sendFrame({cmdId:11,channel:e,payloadXml:"",messageClass:B});const t=await this.client.sendFrame({cmdId:201,channel:e,payloadXml:c,messageClass:B});if(200!==t.header.responseCode)throw new Error(`TalkConfig rejected after reset (responseCode ${t.header.responseCode})`)}})();const l={channel:e,audioConfig:s,blockSize:o,fullBlockSize:a};let h=Buffer.alloc(0),g=!1,d=!1,u=Date.now();const E=Math.max(1,Math.min(8,Math.floor(t?.blocksPerPayload??1))),I=async t=>{if(0===t.length)return;if(t.length>E)throw new Error(`Internal error: too many blocks in payload (${t.length})`);const A=[];let r=0;for(const e of t)A.push(bt(e,o)),r+=Math.max(0,2*(e.length-4)+1);await this.client.sendBinaryPayloadNoReply({cmdId:202,channel:e,extensionXml:L(e),payload:Buffer.concat(A),messageClass:B});const n=r/s.sampleRate*1e3,i=Date.now();i>u?u=i+n:u+=n;const a=u-Date.now();a>0&&await ft(a)},Q=async()=>{if(!d){d=!0;try{for(;;){if(!(h.length>=a)){if(g){if(h.length>0){const e=Buffer.alloc(a,255);h.copy(e,0),h=Buffer.alloc(0),await I([e])}break}break}{const e=[];for(;e.length<E&&h.length>=a;)e.push(h.subarray(0,a)),h=h.subarray(a);await I(e)}}}finally{d=!1}}};return{info:l,sendAudio:async e=>{if(g)throw new Error("Talk session is closed");0!==e.length&&(h=0===h.length?e:Buffer.concat([h,e]),await Q())},stop:async()=>{if(g)return;g=!0,await Q();const t=u-Date.now();t>0?await ft(t+100):await ft(100);const A=await this.client.sendFrame({cmdId:11,channel:e,payloadXml:"",messageClass:B});if(200!==A.header.responseCode)throw new Error(`TalkReset rejected (responseCode ${A.header.responseCode})`)}}}async sendBinary(e){return await this.client.login(),await this.client.sendBinary(e)}async getNetPort(){const e={},t=(await this.sendXml({cmdId:37})).matchAll(/<([A-Za-z]+)Port[^>]*>([\s\S]*?)<\/\1Port>/g);for(const A of t){const t=(A[1]??"").toLowerCase(),s=A[2]??"",r={};for(const e of s.matchAll(/<([A-Za-z]+)>(-?\d+)<\/\1>/g)){const t=(e[1]??"").toLowerCase(),A=Number(e[2]);Number.isFinite(A)&&(r[t]=A)}Object.keys(r).length&&(e[t]=r)}return e}async getPorts(){return this.getNetPort()}async setPortEnabled(e){const t=`${e.port[0].toUpperCase()}${e.port.slice(1)}Port`,A=`<?xml version="1.0" encoding="UTF-8" ?><body><${t} version="1.1"><enable>${e.enable?1:0}</enable></${t}></body>`;await this.sendXml({cmdId:36,payloadXml:A})}async getInfo(e,t){const A={cmdId:null==e?80:318};void 0!==e&&(A.channel=e),null!=t?.timeoutMs&&(A.timeoutMs=t.timeoutMs);return function(e,t){const A={};for(const s of t){const t=H(e,s);void 0!==t&&(A[s]=t)}return A}(await this.sendXml(A),t?.tags?.length?t.tags:["type","hardwareVersion","firmwareVersion","itemNo","serialNumber","name"])}async getChannelIdentity(e,t){const A=await this.getInfo(e,{...null!=t?.timeoutMs?{timeoutMs:t.timeoutMs}:{},tags:["type","name"]});return{channel:e,model:(A.type??"").trim(),name:(A.name??"").trim()}}async getNvrChannelsInfo(e){const t=e?.source??"cgi",A=e?.timeoutMs??3500,s=e?.maxChannels??16,r=e?.cgiTimeoutMs??3e4;if("cgi"===t){const e=new de({host:this.host,username:this.username,password:this.password,timeoutMs:r});try{await e.login();const t=Number.isFinite(s)&&s>0?s:16,A=[{cmd:"GetChannelstatus",action:0},...Array.from({length:t},((e,t)=>({cmd:"GetChnTypeInfo",action:0,param:{channel:t}})))],r=await e.callMany(A),n=pt(r.length?[r[0]]:[]),i=new Map;for(const e of n)i.set(e.channel,e);const o=n.map((e=>e.channel)),a=o.length?[...new Set(o)].sort(((e,t)=>e-t)):Array.from({length:t},((e,t)=>t)),c=[];for(const e of a){const A=i.get(e);let s,n,o;if(e>=0&&e<t){const t=r[1+e],A=t?.value;A&&"object"==typeof A&&("string"==typeof A.typeInfo&&A.typeInfo.trim()&&(s=A.typeInfo.trim()),"string"==typeof A.firmVer&&A.firmVer.trim()&&(n=A.firmVer.trim()),"string"==typeof A.boardInfo&&A.boardInfo.trim()&&(o=A.boardInfo.trim()))}const a=A?.name?.trim(),l=(s??A?.typeInfo)?.trim(),h=A?.uid?.trim();c.push({channel:e,...l?{model:l}:{},...a?{name:a}:{},...h?{uid:h}:{},...void 0!==A?.online?{online:A.online}:{},...void 0!==A?.sleep?{sleep:A.sleep}:{},...n?{firmwareVersion:n}:{},...o?{boardInfo:o}:{},source:"cgi"})}return c}finally{}}let n=[];try{const e=await this.getAbilityInfo();n=Object.keys(e??{}).filter((e=>"Host"!==e)).map((e=>Number(e))).filter((e=>Number.isFinite(e))).sort(((e,t)=>e-t))}catch{}if(0===n.length){const e=Number.isFinite(s)&&s>0?s:16;n=Array.from({length:e},((e,t)=>t))}const i=[];for(const e of n)try{const t=await this.getInfo(e,{timeoutMs:A,tags:["type","name","firmwareVersion"]}),s=(t.type??"").trim(),r=(t.name??"").trim(),n=(t.firmwareVersion??"").trim();if(!!!(s||r||n))continue;i.push({channel:e,...s?{model:s}:{},...r?{name:r}:{},...n?{firmwareVersion:n}:{},source:"baichuan"})}catch{}return i.sort(((e,t)=>e.channel-t.channel))}async getEncXml(e,t){const A=this.normalizeChannel(e);return await this.sendXml({cmdId:56,channel:A,...null!=t?.timeoutMs?{timeoutMs:t.timeoutMs}:{}})}async getStreamMetadata(e){const t=this.normalizeChannel(e),A=await this.getEncXml(t),s=[];let r=!0;const n=e=>e.width>0&&e.height>0&&(e.frameRate>0||e.bitRate>0),i={0:"H.264",1:"H.265",2:"MJPEG",3:"MPEG4"},o=A.match(/<mainStream[^>]*>([\s\S]*?)<\/mainStream>/);if(o){const e=o[1]??"",t=Number(H(e,"width")??"0"),A=Number(H(e,"height")??"0"),a=Number(H(e,"videoEncType")??"0"),c=Number(H(e,"frame")??"0"),l=Number(H(e,"bitRate")??"0"),h=Number(H(e,"audio")??"0"),g=H(e,"enable");(void 0===g||"1"===g||"true"===g)&&n({width:t,height:A,frameRate:c,bitRate:l})&&(s.push({profile:"main",audio:h,width:t,height:A,videoEncType:i[a]??`Unknown(${a})`,videoEncTypeInt:a,frameRate:c,bitRate:l}),r=r&&1===h)}const a=A.match(/<subStream[^>]*>([\s\S]*?)<\/subStream>/);if(a){const e=a[1]??"",t=Number(H(e,"width")??"0"),A=Number(H(e,"height")??"0"),o=Number(H(e,"videoEncType")??"0"),c=Number(H(e,"frame")??"0"),l=Number(H(e,"bitRate")??"0"),h=Number(H(e,"audio")??"0"),g=H(e,"enable");(void 0===g||"1"===g||"true"===g)&&n({width:t,height:A,frameRate:c,bitRate:l})&&(s.push({profile:"sub",audio:h,width:t,height:A,videoEncType:i[o]??`Unknown(${o})`,videoEncTypeInt:o,frameRate:c,bitRate:l}),r=r&&1===h)}const c=["extStream","thirdStream","externStream","extraStream"];for(const e of c){const t=A.match(new RegExp(`<${e}[^>]*>([\\s\\S]*?)<\\/${e}>`));if(!t)continue;const o=t[1]??"",a=Number(H(o,"width")??"0"),c=Number(H(o,"height")??"0"),l=Number(H(o,"videoEncType")??"0"),h=Number(H(o,"frame")??"0"),g=Number(H(o,"bitRate")??"0"),d=Number(H(o,"audio")??"0"),u=H(o,"enable");(void 0===u||"1"===u||"true"===u)&&n({width:a,height:c,frameRate:h,bitRate:g})&&(s.push({profile:"ext",audio:d,width:a,height:c,videoEncType:i[l]??`Unknown(${l})`,videoEncTypeInt:l,frameRate:h,bitRate:g}),r=r&&1===d);break}return{channel:t,streams:s,audioEnabled:r}}async setEncXml(e,t){const A="number"==typeof e?this.normalizeChannel(e):0,s="number"==typeof e?t:e;await this.sendXml({cmdId:57,channel:A,payloadXml:s})}async setStreamVideoCodec(e,t,A){const s="number"==typeof e?this.normalizeChannel(e):this.normalizeChannel(A),r="number"==typeof e?t:e,n="H.265"===("number"==typeof e?A:t)?1:0,i="main"===r?["mainStream"]:"sub"===r?["subStream"]:["extStream","thirdStream","externStream","extraStream"],o=await this.getEncXml(s);let a=null;for(const e of i){const t=new RegExp(`(<${e}[^>]*>[\\s\\S]*?<videoEncType>)(\\d+)(</videoEncType>)`);if(!t.test(o))continue;const A=o.replace(t,`$1${n}$3`);if(A!==o){a=A;break}}if(!a)throw new Error(`Could not find <videoEncType> for profile=${r} (tags=${i.join(",")}) in GetEnc XML (channel=${s}).`);await this.setEncXml(s,a)}async setNetPort(e){null!=e.onvifEnable&&await this.setPortEnabled({port:"onvif",enable:1===e.onvifEnable}),null!=e.rtmpEnable&&await this.setPortEnabled({port:"rtmp",enable:1===e.rtmpEnable}),null!=e.rtspEnable&&await this.setPortEnabled({port:"rtsp",enable:1===e.rtspEnable})}async reboot(e){const t={cmdId:23};void 0!==e&&(t.channel=e),await this.sendXml(t)}async ping(){await this.sendXml({cmdId:93})}async getGeneralXml(e){const t={cmdId:104};return void 0!==e&&(t.channel=e),await this.sendXml(t)}async setGeneralXml(e,t){const A="number"==typeof e||void 0===e?e:void 0,s="string"==typeof e?e:t;await this.sendXml({cmdId:105,...void 0===A?{}:{channel:A},payloadXml:s})}static buildChannelExtensionXml(e){return`<?xml version="1.0" encoding="UTF-8" ?><Extension version="1.1"><channelId>${M(String(e))}</channelId></Extension>`}async getMotionState(e){const t=H(await this.sendXml({cmdId:46,...void 0!==e?{channel:e}:{}}),"enable");return"1"===t||"true"===t}async getOsd(e){const t=this.normalizeChannel(e),A=await this.sendXml({cmdId:26,channel:t});return{channel:t,osdChannel:{enable:Number(H(A,"enable")??"0"),name:H(A,"name")??"",pos:H(A,"pos")??""},osdTime:{enable:Number(H(A,"timeEnable")??"0"),pos:H(A,"timePos")??""},watermark:Number(H(A,"watermark")??"0")}}async setOsd(e,t){const A="number"==typeof e?this.normalizeChannel(e):this.normalizeChannel(t),s="number"==typeof e?t:e,r=`<?xml version="1.0" encoding="UTF-8" ?><body><Osd version="1.1"><channel>${A}</channel><osdChannel><enable>${s.osdChannel.enable}</enable><name>${M(s.osdChannel.name)}</name><pos>${M(s.osdChannel.pos)}</pos></osdChannel><osdTime><enable>${s.osdTime.enable}</enable><pos>${M(s.osdTime.pos)}</pos></osdTime><watermark>${s.watermark}</watermark></Osd></body>`;await this.sendXml({cmdId:25,channel:A,payloadXml:r})}async getAiState(e){const t=await this.sendXml({cmdId:342,...void 0!==e?{channel:e}:{}});return{channel:e??0,alarm_state:Number(H(t,"alarm_state")??"0"),support:Number(H(t,"support")??"0")}}async getSnapshot(e=0){const t=`<body><Snap version="1.1"><channelId>${e}</channelId><logicChannel>${e}</logicChannel><time>0</time><fullFrame>0</fullFrame><streamType>main</streamType></Snap></body>`;return await this.client.login(),await this.client.sendBinary({cmdId:109,channel:e,payloadXml:t,extensionXml:U(e),timeoutMs:15e3})}async listRecordings(e){await this.client.login();const t=this.normalizeChannel(e.channel),A=e.uid,s=e.streamType??"mainStream",r=e.recordType??"manual, sched, io, md, people, face, vehicle, dog_cat, visitor, other, package",n=e.maxIterations??50,i=e.fallbackToAlarmVideo??!0,o=`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<FileInfoList version="1.1">\n<FileInfo>\n<uid>${M(A)}</uid>\n<searchAITrack>1</searchAITrack>\n<channelId>${t}</channelId>\n<logicChnBitmap>255</logicChnBitmap>\n<streamType>${M(s)}</streamType>\n<recordType>${M(r)}</recordType>\n${St("startTime",e.start)}\n${St("endTime",e.end)}\n</FileInfo>\n</FileInfoList>\n</body>`,a=H(await this.sendXml({cmdId:14,channel:t,payloadXml:o}),"handle");if(!a)throw new Error("FileInfoList open did not return <handle>");const c=Number.parseInt(a,10);if(!Number.isFinite(c))throw new Error(`FileInfoList open returned invalid handle: ${a}`);const l=`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<FileInfoList version="1.1">\n<FileInfo>\n<channelId>${t}</channelId>\n<uid>${M(A)}</uid>\n<searchAITrack>1</searchAITrack>\n<handle>${c}</handle>\n</FileInfo>\n</FileInfoList>\n</body>`,h=[];try{let e=!1;for(let A=0;A<n&&!e;A++){const A=await this.sendXml({cmdId:15,channel:t,payloadXml:l});h.push(...wt(A));const s=H(A,"bFinished")??H(A,"finished");e=null==s||"1"===s.trim()}}finally{try{await this.sendXml({cmdId:16,channel:t,payloadXml:l})}catch{}}const g=new Set,d=h.filter((e=>!g.has(e.fileName)&&(g.add(e.fileName),!0)));if(d.length>0||!i)return d;const u=A.split("_")[0]??A,E="subStream"===s?1:0,I=e=>`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<findAlarmVideo version="1.1">\n<channelId>${t}</channelId>\n<fileHandle>${M(e)}</fileHandle>\n</findAlarmVideo>\n</body>`,Q=[];let C=e.start;for(let A=0;A<n;A++){const A=await this.sendXml({cmdId:272,channel:t,payloadXml:(B=C,p=e.end,`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<findAlarmVideo version="1.1">\n<channelId>${t}</channelId>\n<uid>${M(u)}</uid>\n<logicChnBitmap>255</logicChnBitmap>\n<streamType>${E}</streamType>\n<notSearchVideo>0</notSearchVideo>\n${St("startTime",B)}\n${St("endTime",p)}\n<alarmType>md, pir, io, people, face, vehicle, dog_cat, visitor, other, package, cry, crossline, intrusion, loitering, legacy, loss</alarmType>\n</findAlarmVideo>\n</body>`)}),s=H(A,"fileHandle")?.trim();if(!s)break;const r=I(s);try{const e=await this.sendXml({cmdId:273,channel:t,payloadXml:r}),A=wt(e);Q.push(...A);const s=H(e,"bFinished")?.trim();if("1"===s)break;const n=[...A].reverse().find((e=>null!=e.startTime));if(!n?.startTime)break;C=n.startTime}finally{try{await this.sendXml({cmdId:274,channel:t,payloadXml:r})}catch{}}}var B,p;const f=new Set;return Q.filter((e=>!f.has(e.fileName)&&(f.add(e.fileName),!0)))}async listRecordingFileNames(e){return(await this.listRecordings(e)).map((e=>e.fileName))}async getVodRtmpUrl(e){await this.client.login();const t=this.normalizeChannel(e.channel),A=e.streamType??"mainStream",s=e.ensureEnabled??!0;let r=e.rtmpPort;try{const e=(await this.getNetPort()).rtmp,t="number"==typeof e?.enable?e.enable:void 0,A="number"==typeof e?.port?e.port:void 0;null==r&&null!=A&&Number.isFinite(A)&&A>0&&(r=A),s&&0===t&&await this.setPortEnabled({port:"rtmp",enable:!0})}catch{}null==r&&(r=1935);const n="subStream"===A?1:0;let i=e.fileName.trim();const o=i.indexOf("Mp4Record/");o>=0&&(i=i.slice(o)),i=i.replace(/^\/+/,"");const a=i.replace(/\//g,"%20").replace(/ /g,"%20"),c=encodeURIComponent(this.username),l=encodeURIComponent(this.password);return`rtmp://${this.host}:${r}/vod/${a}?channel=${t}&stream=${n}&user=${c}&password=${l}`}async predownloadRecordingMp4(e){await this.client.login();const t=this.normalizeChannel(e.channel),A=e.streamType??"mainStream",s=e.ensureAwake??!1,r=e.ffmpegPath??"ffmpeg",n=e.overwrite??!0;await(0,g.mkdir)((0,c.dirname)(e.outputPath),{recursive:!0});const i=async()=>{s&&await this.wakeUp(t,{waitAfterWakeMs:1500,attempts:3});const i=await this.getVodRtmpUrl({channel:t,fileName:e.fileName,streamType:A,ensureEnabled:!0});await new Promise(((t,A)=>{const s=(0,h.spawn)(r,["-hide_banner","-loglevel","error",...n?["-y"]:[],"-rtmp_live","live","-i",i,"-c","copy","-movflags","frag_keyframe+empty_moov","-f","mp4",e.outputPath]);let o="";s.stderr.on("data",(e=>{o+=String(e)})),s.on("close",(e=>{if(0===e)return t();A(new Error(`ffmpeg exited with code ${e}\n${o}`))})),s.on("error",A)}))};try{await i()}catch(e){if(s)try{await this.wakeUp(t,{waitAfterWakeMs:3e3,attempts:3,reconnect:!0})}catch{}await i()}}async generateMp4Screenshot(e){const t=e.ffmpegPath??"ffmpeg",A=Number.isFinite(e.atSeconds)&&e.atSeconds>=0?e.atSeconds:0;await(0,g.mkdir)((0,c.dirname)(e.outputPath),{recursive:!0}),await new Promise(((s,r)=>{const n=(0,h.spawn)(t,["-hide_banner","-loglevel","error","-y","-ss",String(A),"-i",e.inputPath,"-frames:v","1","-q:v","2",e.outputPath]);let i="";n.stderr.on("data",(e=>{i+=String(e)})),n.on("close",(e=>{if(0===e)return s();r(new Error(`ffmpeg screenshot exited with code ${e}\n${i}`))})),n.on("error",r)}))}async downloadRecording(e){await this.client.login();const t=this.normalizeChannel(e.channel),A=e.uid,s=e.fileName,r=s.includes("/")?s.split("/").filter(Boolean).at(-1)??s:s,n=`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<FileInfoList version="1.1">\n<FileInfo>\n<channelId>${t}</channelId>\n<uid>${M(A)}</uid>\n<fileName>${M(s)}</fileName>\n<name>${M(r)}</name>\n<Id>${M(s)}</Id>\n</FileInfo>\n</FileInfoList>\n</body>`,i=e.fallbackToHttp??!1;try{return await this.client.sendBinary({cmdId:13,channel:t,messageClass:p,extensionXml:L(t),payloadXml:n,timeoutMs:e.timeoutMs??12e4})}catch(e){if(!i)throw e;const t=s.replaceAll("/","_").replaceAll("\\","_");try{const e=/Rec(\w{3})(?:_|_DST)(\d{8})_(\d{6})_.*/.exec(s),A=e?`${e[2]}${e[3]}`:void 0,r=[],n=e=>{const t=e?.trim();t&&(r.includes(t)||r.push(t))};let i;n(s),n(s.replace(/^\/mnt\/[a-zA-Z0-9]+\//,"")),n(s.replace(/^\//,""));for(const e of r)try{return await this.httpClient.downloadVod(e,t,A)}catch(e){i=e;if((e instanceof Error?e.message:String(e)).startsWith("HTTP 404"))continue;throw e}throw i instanceof Error?i:new Error(String(i))}catch(t){const A=e instanceof Error?e.message:String(e),s=t instanceof Error?t.message:String(t);throw new Error(`downloadRecording failed (baichuan then http). baichuanErr=${A}; httpErr=${s}`)}}}async subscribeEvents(){await this.client.login();const e=this.client.getConfiguredChannel?.()??0,t=e+1,A=[{label:`neolink-style channelId=${e} bodyLen=0`,params:{cmdId:31,channelIdOverride:e,messageClass:B}},{label:`reolink_aio-style channelId=${t} bodyLen=0`,params:{cmdId:31,channelIdOverride:t,messageClass:B}},{label:"host channelId=250 bodyLen=0",params:{cmdId:31,channelIdOverride:250,messageClass:B}},{label:"legacy Extension channelId=251",params:{cmdId:31,channelIdOverride:250,messageClass:B,extensionXml:'<?xml version="1.0" encoding="UTF-8" ?><Extension version="1.1"><channelId>251</channelId></Extension>'}}];let s;for(const e of A){const t=await this.client.sendFrame({...e.params,timeoutMs:1e4});if(s=t.header.responseCode,200===t.header.responseCode)return this.client.subscribed=!0,void this.client.refreshKeepAlive?.();(this.logger.debug??this.logger.log).call(this.logger,`[ReolinkBaichuanApi] subscribeEvents rejected (${e.label}) responseCode=${t.header.responseCode}`)}throw this.client.subscribed=!1,this.client.refreshKeepAlive?.(),new Error(`subscribeEvents failed: camera rejected cmdId=31 (last responseCode=${s??"unknown"})`)}async unsubscribeEvents(){this.client.subscribed=!1,this.client.refreshKeepAlive?.()}async checkAndDispatchCurrentState(e=0){try{const t=await this.getMotionState(e);if(t!==this.lastMotionState&&(this.lastMotionState=t,t)){const t={type:"motion",channel:e,timestamp:Date.now()};this.dispatchSimpleEvent(t)}try{const t=await this.getAiState(e);if(t&&void 0!==t.alarm_state){if((!this.lastAiState||this.lastAiState.alarm_state!==t.alarm_state||this.lastAiState.support!==t.support)&&(this.lastAiState=t,1===t.alarm_state)){const t={type:"other",channel:e,timestamp:Date.now()};this.dispatchSimpleEvent(t)}}}catch(e){if(e&&"object"==typeof e&&"message"in e){const t=String(e.message);t.includes("not supported")||t.includes("unsupported")||(this.logger.debug??this.logger.log)?.call(this.logger,"[ReolinkBaichuanApi] getAiState failed (may not be supported)",e)}}}catch(e){(this.logger.warn??this.logger.error)?.call(this.logger,"[ReolinkBaichuanApi] Error checking current state",e)}}dispatchSimpleEvent(e){for(const t of this.simpleEventListeners)try{t(e)}catch(e){(this.logger.warn??this.logger.error)?.call(this.logger,"[ReolinkBaichuanApi] onSimpleEvent handler error",e)}}startStatePolling(){if(0===this.simpleEventListeners.size)return;"udp"===this.client.getTransport?.()||this.statePollingInterval||(this.statePollingInterval=setInterval((async()=>{0!==this.simpleEventListeners.size?await this.checkAndDispatchCurrentState(0):this.stopStatePolling()}),5e3))}stopStatePolling(){this.statePollingInterval&&(clearInterval(this.statePollingInterval),this.statePollingInterval=void 0)}async getEvents(e){const t=await this.sendXml({cmdId:33,...void 0!==e?{channel:e}:{}}),A=this.normalizeChannel(e),s=Date.now(),r={channel:A};if(t.includes("<AlarmEventList")){const e=t.matchAll(/<AlarmEvent\b[^>]*>([\s\S]*?)<\/AlarmEvent>/g);for(const t of e){const e=t[1]??"",n=H(e,"channelId");if((void 0!==n?Number(n):A)!==A)continue;const i=(H(e,"status")??"").trim().toUpperCase(),o=(H(e,"AItype")??H(e,"aiType")??H(e,"aitype")??"").trim();i.includes("MD")&&(r.motion={state:1,timestamp:s,source:"md"}),i.includes("PIR")&&(r.motion={state:1,timestamp:s,source:"pir"});const a=o?o.split(",").map((e=>e.trim())).find((e=>e.length>0&&"none"!==e.toLowerCase())):void 0;(a||i.includes("AI"))&&(r.ai={channel:A,alarm_state:1,type:a}),i.includes("VIS")&&(r.visitor={detected:!0,timestamp:s})}return r}const n=(H(t,"status")??"").trim().toUpperCase(),i=(H(t,"AItype")??H(t,"aiType")??H(t,"aitype")??"").trim();return n.includes("MD")&&(r.motion={state:1,timestamp:s,source:"md"}),n.includes("PIR")&&(r.motion={state:1,timestamp:s,source:"pir"}),(i||n.includes("AI"))&&(r.ai={channel:A,alarm_state:1,type:i||void 0}),n.includes("VIS")&&(r.visitor={detected:!0,timestamp:s}),r}async getTwoWayAudioConfig(e){const t=H(await this.sendXml({cmdId:10,...void 0!==e?{channel:e}:{}}),"audioStreamMode"),A={channel:e??0,enabled:"mixAudioStream"===t||"followVideoStream"===t};return t&&(A.mode=t),A}async startTwoWayAudio(e){await this.sendXml({cmdId:10,...void 0!==e?{channel:e}:{}})}async sendAudioData(e,t){const A={cmdId:10,payloadXml:""};void 0!==t&&(A.channel=t),await this.client.sendBinary(A)}async stopTwoWayAudio(e){}async startVideoStream(e,t="sub"){const A=this.normalizeChannel(e),s=A,r={main:{handle:0,streamType:0,streamName:"mainStream"},sub:{handle:256,streamType:1,streamName:"subStream"},ext:{handle:1024,streamType:0,streamName:"externStream"}}[t];if(!r)throw new Error(`Invalid stream profile: ${t}`);if(!r.streamName)throw new Error(`Stream name not found for profile: ${t}, config: ${JSON.stringify(r)}`);const n=r.streamName;if("string"!=typeof n)throw new Error(`streamName is not a string: ${typeof n}, value: ${n}, config: ${JSON.stringify(r)}`);const i=function(e,t,A){if(!t||"string"!=typeof t)throw new Error(`buildPreviewXml: streamType is required (string) but got: ${typeof t} = ${t}`);return`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<Preview version="1.0">\n${void 0!==A?`<channelId>${A}</channelId>\n`:""}<handle>${e}</handle>\n<streamType>${M(t)}</streamType>\n</Preview>\n</body>`}(r.handle,n,s),o="udp"===this.client.getTransport?.()?3:1;let a;for(let e=1;e<=o;e++){const n=this.client.peekNextMsgNum();this.client.subscribeVideoStream(3,n);try{const e={cmdId:3,channel:A,channelIdOverride:s,extensionXml:U(s),payloadXml:i,messageClass:B,streamType:r.streamType},n=await this.client.sendFrame(e);if(200!==n.header.responseCode)throw new Error(`Video stream request rejected (response_code ${n.header.responseCode}). Neolink expects response_code 200, camera returned ${n.header.responseCode}`);return void this.activeVideoMsgNums.set(`${A}:${t}`,n.header.msgNum)}catch(t){a=t;try{this.client.unsubscribeVideoStream(3,n)}catch{}if(e<o){await new Promise((e=>setTimeout(e,250)));continue}}}throw a instanceof Error?a:new Error(String(a))}getActiveVideoMsgNum(e,t="sub"){const A=this.normalizeChannel(e);return this.activeVideoMsgNums.get(`${A}:${t}`)}async stopVideoStream(e,t="sub"){const A=this.normalizeChannel(e),s=A,r={main:{handle:0,streamType:0},sub:{handle:256,streamType:1},ext:{handle:1024,streamType:0}}[t],n=function(e,t){return`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<Preview version="1.0">\n${void 0!==t?`<channelId>${t}</channelId>\n`:""}<handle>${e}</handle>\n</Preview>\n</body>`}(r.handle,s),i=`${A}:${t}`,o=this.activeVideoMsgNums.get(i);this.activeVideoMsgNums.delete(i);try{await this.client.sendFrame({cmdId:4,channel:A,channelIdOverride:s,extensionXml:U(s),payloadXml:n,messageClass:B,streamType:r.streamType,...void 0!==o?{msgNumOverride:o}:{},timeoutMs:2e3})}catch{}finally{try{void 0!==o&&this.client.unsubscribeVideoStream(3,o)}catch{}}}async getPtzPresets(e){const t=this.normalizeChannel(e),A=t,s=await this.sendXml({cmdId:190,channel:t,channelIdOverride:A,extensionXml:U(A),messageClass:B,streamType:0});return this.parsePtzPresetList(s).filter((e=>void 0===e.enable||"1"===e.enable)).filter((e=>void 0===e.name||""!==String(e.name).trim())).map((e=>({id:e.id,name:e.name??`Preset ${e.id}`})))}parsePtzPresetList(e){const t=[],A=e.matchAll(/<preset\b[^>]*>([\s\S]*?)<\/preset>/gi);for(const e of A){const A=e[1]??"",s=/<id>([^<]*)<\/id>/i.exec(A)?.[1];if(!s)continue;const r=Number(s);if(!Number.isFinite(r))continue;const n=/<name>([^<]*)<\/name>/i.exec(A),i=/<enable>([^<]*)<\/enable>/i.exec(A),o={id:r},a=n?.[1],c=i?.[1];void 0!==a&&(o.name=a),void 0!==c&&(o.enable=c),t.push(o)}return t}async getPtzPresetsRaw(e){const t=this.normalizeChannel(e),A=t,s=await this.sendXml({cmdId:190,channel:t,channelIdOverride:A,extensionXml:U(A),messageClass:B,streamType:0});return this.parsePtzPresetList(s)}async ptz(e,t){const A="number"==typeof e?this.normalizeChannel(e):0,s="number"==typeof e?t:e,r=A;let n,i;if("stop"===s.action)n="stop";else{const e={Left:"left",Right:"right",Up:"up",Down:"down"}[s.command];if(!e)throw new Error(`Unsupported PTZ command for MSG_ID_PTZ_CONTROL: ${s.command}`);n=e}if("stop"===n)i=0;else{const e=s.speed;i=void 0===e?32:e>0&&e<=1?Math.max(1,64*e):e}const o=function(e,t,A){return`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<PtzControl version="1.1">\n<channelId>${e}</channelId>\n<command>${M(t)}</command>\n<speed>${A}</speed>\n</PtzControl>\n</body>`}(r,n,i),a=U(r),c=await this.client.sendFrame({cmdId:18,channel:A,channelIdOverride:r,extensionXml:a,payloadXml:o,messageClass:B,streamType:0});if(200!==c.header.responseCode){let e="";if(c.body.length>0)try{const t=this.client.tryDecryptXml;if(t){const A=t.call(this.client,c.body,c.header.channelId,this.client.enc);A&&(e=` - Error details: ${A.substring(0,200)}`)}}catch{}throw new Error(`PTZ control rejected (response_code ${c.header.responseCode})${e}`)}if("start"===s.action&&"stop"!==n){const e=s.autoStopMs??500;e>0&&setTimeout((()=>{this.ptz(A,{action:"stop",command:s.command}).catch((()=>{}))}),e)}}async moveToPtzPreset(e,t){const A=void 0===t?this.normalizeChannel(void 0):this.normalizeChannel(e),s=A,r=function(e,t,A,s){return P(e,t,A,void 0===s?void 0:{name:s})}(s,void 0===t?e:t,"toPos"),n=U(s),i=await this.client.sendFrame({cmdId:19,channel:A,channelIdOverride:s,extensionXml:n,payloadXml:r,messageClass:B,streamType:0});if(200!==i.header.responseCode)throw new Error(`PTZ preset move rejected (response_code ${i.header.responseCode})`)}async setPtzPreset(e,t,A){const s="string"==typeof t?this.normalizeChannel(A):this.normalizeChannel(e),r=s,n=P(r,"string"==typeof t?e:t,"setPos",{name:"string"==typeof t?t:A,enable:1}),i=U(r),o=await this.client.sendFrame({cmdId:19,channel:s,channelIdOverride:r,extensionXml:i,payloadXml:n,messageClass:B,streamType:0});if(200!==o.header.responseCode)throw new Error(`PTZ preset save rejected (response_code ${o.header.responseCode})`)}async deletePtzPreset(e,t){const A=void 0===t?this.normalizeChannel(void 0):this.normalizeChannel(e),s=void 0===t?e:t,r=A,n=U(r);let i;try{const e=await this.getPtzPresetsRaw(A);i=e.find((e=>e.id===s))?.name}catch{}const o=[{label:"command=delPos",payloadXml:P(r,s,"delPos")},{label:"enable=0 (no name)",payloadXml:P(r,s,"setPos",{enable:0})},{label:"name='' (no enable)",payloadXml:P(r,s,"setPos",{name:""})},{label:"enable=0 name=''",payloadXml:P(r,s,"setPos",{name:"",enable:0})},...i?[{label:"enable=0 name=current",payloadXml:P(r,s,"setPos",{name:i,enable:0})}]:[],{label:"enable=0 name='Preset N'",payloadXml:P(r,s,"setPos",{name:`Preset ${s}`,enable:0})}];let a,c=!1;for(const e of o)try{const t=await this.client.sendFrame({cmdId:19,channel:A,channelIdOverride:r,extensionXml:n,payloadXml:e.payloadXml,messageClass:B,streamType:0});if(200!==t.header.responseCode)throw new Error(`PTZ preset delete rejected (response_code ${t.header.responseCode})`);c=!0;try{const e=(await this.getPtzPresetsRaw(A)).find((e=>e.id===s));if(!e)return;const t=void 0!==e.name&&""===String(e.name).trim(),r=void 0!==e.enable&&"0"===String(e.enable).trim();if(t||r)return}catch(e){a=e}}catch(e){a=e}if(!c)throw a instanceof Error?a:new Error("PTZ preset delete failed");this.logger.warn("PTZ presets (baichuan): deletePtzPreset did not take effect (firmware ignored request)",{channel:A,channelId:r,presetId:s})}async getPtzPosition(e){const t=this.normalizeChannel(e),A=await this.sendXml({cmdId:433,channel:t}),s=H(A,"pPos"),r=H(A,"tPos"),n={};return void 0!==s&&(n.pan=Number(s)),void 0!==r&&(n.tilt=Number(r)),n}async getZoomFocus(e){const t=this.normalizeChannel(e),A=t,s=await this.sendXml({cmdId:294,channel:t,channelIdOverride:A,extensionXml:U(A),messageClass:B,streamType:0}),r=e=>{const t=new RegExp(`<${e}>([\\s\\S]*?)</${e}>`).exec(s),A=t?.[1];if(!A)return;const r=H(A,"maxPos"),n=H(A,"minPos"),i=H(A,"curPos");return void 0!==r&&void 0!==n&&void 0!==i?{maxPos:Number(r),minPos:Number(n),curPos:Number(i)}:void 0},n={},i=r("zoom"),o=r("focus");return i&&(n.zoom=i),o&&(n.focus=o),n}async zoomToFactor(e,t){const A=void 0===t?0:this.normalizeChannel(e),s=void 0===t?e:t,r=A,n=(await this.getZoomFocus(A)).zoom;if(!n)throw new Error("Camera did not return <zoom> info (zoom may be unsupported)");const i=Math.round(1e3*s),o=function(e,t){return`<?xml version="1.0" encoding="UTF-8" ?>\n<body>\n<StartZoomFocus version="1.1">\n<channelId>${e}</channelId>\n<command>zoomPos</command>\n<movePos>${Math.trunc(t)}</movePos>\n</StartZoomFocus>\n</body>`}(r,Math.min(n.maxPos,Math.max(n.minPos,i))),a=U(r),c=await this.client.sendFrame({cmdId:295,channel:A,channelIdOverride:r,extensionXml:a,payloadXml:o,messageClass:B,streamType:0});if(200!==c.header.responseCode)throw new Error(`Zoom rejected (response_code ${c.header.responseCode})`)}parseBatteryInfoXml(e,t){const A=e=>{if(void 0===e)return;const t=Number(e);return Number.isFinite(t)?t:void 0},s=mt(e,"BatteryInfo"),r=s.find((e=>H(e,"channelId")===String(t)))??s[0]??e,n={},i=A(H(r,"batteryPercent"));void 0!==i&&(n.batteryPercent=i);const o=H(r,"chargeStatus");void 0!==o&&(n.chargeStatus=o);const a=H(r,"adapterStatus");void 0!==a&&(n.adapterStatus=a);const c=A(H(r,"voltage"));void 0!==c&&(n.voltage=c);const l=A(H(r,"current"));void 0!==l&&(n.current=l);const h=A(H(r,"temperature"));void 0!==h&&(n.temperature=h);const g=A(H(r,"lowPower"));void 0!==g&&(n.lowPower=g);const d=A(H(r,"batteryVersion"));return void 0!==d&&(n.batteryVersion=d),n}getSleepStatus(e){const t=e?.windowMs??e?.idleMs??1e4,A=new Set(e?.nonWakingCmdIds??e?.ignoreCmdIds??[y,252,m,291]),s=this.client.getTransport?.();if("udp"!==s)return{state:"unknown",reason:"sleep inference supported only for UDP/battery"};if(this.activeVideoMsgNums.size>0||this.rtspServers.size>0||this.client.isDeviceStreamingActive?.())return{state:"awake",reason:"active streaming"};const r=this.client.isSocketConnected?.()??!1,n=Date.now(),i=n-t,o=(this.client.getRxHistory?.()??[]).filter((e=>e.atMs>=i)),a=(this.client.getTxHistory?.()??[]).filter((e=>e.atMs>=i));if(0===o.length&&0===a.length)return{state:"sleeping",reason:`no rx/tx activity in last ${t}ms${r?"":" (socket disconnected)"}`,idleMs:t};const c=o.find((e=>!A.has(e.cmdId)));if(c)return{state:"awake",reason:`waking rx cmdId=${c.cmdId} responseCode=${c.responseCode} seen ${n-c.atMs}ms ago`,lastRxAtMs:c.atMs,idleMs:n-c.atMs};const l=a.find((e=>!A.has(e.cmdId)));return l?{state:"awake",reason:`waking tx cmdId=${l.cmdId} seen ${n-l.atMs}ms ago`,idleMs:n-l.atMs}:{state:"sleeping",reason:`only non-waking cmdIds observed in last ${t}ms (non-waking: ${Array.from(A).join(",")})`,idleMs:t}}async probeSleepStatus(e){const t=this.client.getTransport?.();if("udp"!==t)return{state:"unknown",reason:"sleep probe supported only for UDP/battery"};if(this.activeVideoMsgNums.size>0||this.rtspServers.size>0||this.client.isDeviceStreamingActive?.())return{state:"awake",reason:"active streaming"};const A=Date.now(),s=e?.minIntervalMs??5e3;if(this.lastSleepProbe&&A-this.lastSleepProbe.atMs<s)return{...this.lastSleepProbe.status,reason:`${this.lastSleepProbe.status.reason} (cached)`};if(!this.client.isSocketConnected()){const e={state:"unknown",reason:"udp socket not connected"};return this.lastSleepProbe={atMs:A,status:e},e}if(!this.client.loggedIn){const e={state:"unknown",reason:"not logged in"};return this.lastSleepProbe={atMs:A,status:e},e}const r=this.normalizeChannel(e?.channel),n=e?.timeoutMs??700,i=Math.max(1,e?.attempts??1),o=e?.cmdId??m;for(let e=0;e<i;e++)try{const e=await this.client.sendFrame({cmdId:o,channel:r,timeoutMs:n}),t={state:200===e.header.responseCode?"awake":"unknown",reason:`probe cmdId=${o} responseCode=${e.header.responseCode}`};return this.lastSleepProbe={atMs:Date.now(),status:t},t}catch(t){const A=t instanceof Error?t.message:String(t);if(A.includes("Baichuan timeout")||A.toLowerCase().includes("timeout")){const e={state:"sleeping",reason:`probe timeout cmdId=${o} timeoutMs=${n}`};return this.lastSleepProbe={atMs:Date.now(),status:e},e}if(e===i-1){const e={state:"unknown",reason:`probe error cmdId=${o}: ${A}`};return this.lastSleepProbe={atMs:Date.now(),status:e},e}}const a={state:"unknown",reason:"probe exhausted"};return this.lastSleepProbe={atMs:Date.now(),status:a},a}async getBatteryStatus(e){const t=this.normalizeChannel(e);if("sleeping"===this.getSleepStatus({channel:t}).state)return{channel:t,sleeping:!0};try{const e=await Promise.race([this.sendXml({cmdId:m,channel:t}),new Promise(((e,t)=>setTimeout((()=>t(new Error("Timeout"))),5e3)))]),A={channel:t,sleeping:!1};return Object.assign(A,this.parseBatteryInfoXml(e,t)),A}catch(e){const A={channel:t};return"sleeping"===this.getSleepStatus({channel:t}).state&&(A.sleeping=!0),e instanceof Error&&"Timeout"===e.message&&null==A.sleeping&&(A.sleeping=!0),A}}async getBatteryInfo(e){const t=this.normalizeChannel(e),A=this.client.getTransport?.();if(!("udp"!==A||this.client.isSocketConnected?.()&&this.client.loggedIn))return{channel:t,sleeping:!0};const s=await this.client.sendXml({cmdId:m,channel:t}),r={channel:t};return Object.assign(r,this.parseBatteryInfoXml(s,t)),r}async wakeUp(e,t){const A=this.normalizeChannel(e),s="number"==typeof t?{waitAfterWakeMs:t}:t??{},r=s.timeoutMs??2e4,n=s.attempts??3,i=s.waitAfterWakeMs??1500,o=s.backoffMs??1500,a="udp"===this.client.getTransport?.(),c=s.reconnect??a;let l;for(let e=1;e<=n;e++)try{return await this.getEncXml(A,{timeoutMs:r}),void(i>0&&await new Promise((e=>setTimeout(e,i))))}catch(t){l=t;const A=t instanceof Error?t.message:String(t),s=A.includes("Baichuan timeout"),r=A.toLowerCase().includes("socket closed")||A.toLowerCase().includes("stream closed");if(e<n){if(c&&(s||r))try{this.client.loggedIn=!1,await this.client.close()}catch{}o>0&&await new Promise((e=>setTimeout(e,o)));continue}}throw l instanceof Error?l:new Error(String(l))}async isSleeping(e){const t=this.normalizeChannel(e);try{return await Promise.race([this.getBatteryInfo(t),new Promise(((e,t)=>setTimeout((()=>t(new Error("Timeout"))),5e3)))]),!1}catch(e){return!0}}async getPirInfo(e){const t=this.normalizeChannel(e),A=await this.sendXml({cmdId:212,channel:t}),s=e=>{if(void 0===e)return;const t=e.trim().toLowerCase();if("true"===t)return 1;if("false"===t)return 0;const A=Number(t);return Number.isFinite(A)?A:void 0},r=H(A,"enable"),n=H(A,"sensiValue"),i=H(A,"reduceFalseAlarm"),o=H(A,"interval"),a=H(A,"intervalSecMax"),c={channel:t};if(void 0!==r){const e=s(r);void 0!==e&&(c.enable=e)}if(void 0!==n&&(c.sensitive=Number(n)),void 0!==i){const e=s(i);void 0!==e&&(c.reduceAlarm=e)}if(void 0!==o){const e=s(o);void 0!==e&&(c.interval=e)}if(void 0!==a){const e=s(a);void 0!==e&&(c.intervalMax=e)}return{enabled:(e=>{if(void 0===e)return!1;const t=e.trim().toLowerCase();return"1"===t||"true"===t})(r),state:c}}async setPirInfo(e,t){const A="number"==typeof e?e:t,s="number"==typeof e?t:e,r=this.normalizeChannel(A);let n=await this.sendXml({cmdId:212,channel:r});if(void 0!==s.enable&&(n=n.replace(/<enable>[^<]*<\/enable>/,`<enable>${s.enable}</enable>`)),void 0!==s.sensitive){const e=(i=s.sensitive,Math.trunc(101-i));n=n.replace(/<sensiValue>[^<]*<\/sensiValue>/,`<sensiValue>${e}</sensiValue>`)}var i;if(void 0!==s.reduceAlarm){const e=(e=>{if(null==e)return;if("boolean"==typeof e)return e?1:0;const t=Number(e);return Number.isFinite(t)?t:void 0})(s.reduceAlarm);void 0!==e&&(n=n.replace(/<reduceFalseAlarm>[^<]*<\/reduceFalseAlarm>/,`<reduceFalseAlarm>${e}</reduceFalseAlarm>`))}void 0!==s.interval&&(n=n.replace(/<interval>[^<]*<\/interval>/,`<interval>${s.interval}</interval>`)),await this.sendXml({cmdId:213,channel:r,payloadXml:n})}async setMotionDetection(e,t,A){const s="number"==typeof e?e:A,r="number"==typeof e?t:e,n="number"==typeof e?A:t,i=this.normalizeChannel(s);let o=await this.sendXml({cmdId:46,channel:i});void 0!==r&&(o=o.replace(/<enable>[^<]*<\/enable>/,`<enable>${r?"1":"0"}</enable>`)),void 0!==n&&(o=o.replace(/<sensitivityDefault>[^<]*<\/sensitivityDefault>/,`<sensitivityDefault>${n}</sensitivityDefault>`)),await this.sendXml({cmdId:47,channel:i,payloadXml:o})}async setAiDetection(e,t,A,s){const r="number"==typeof e?e:s,n="number"==typeof e?t:e,i="number"==typeof e?A:t,o="number"==typeof e?s:A,a=this.normalizeChannel(r),c=`<?xml version="1.0" encoding="UTF-8" ?>\n <body>\n <AiDetectCfg version="1.1">\n <chn>${a}</chn>\n <type>${M(n)}</type>\n </AiDetectCfg>\n </body>`;let l=await this.sendXml({cmdId:342,channel:a,payloadXml:c});void 0!==i&&(l=l.replace(/<sensitivity>[^<]*<\/sensitivity>/,`<sensitivity>${i}</sensitivity>`)),void 0!==o&&(l=l.replace(/<stayTime>[^<]*<\/stayTime>/,`<stayTime>${o}</stayTime>`)),await this.sendXml({cmdId:343,channel:a,payloadXml:l})}async getSiren(e){try{const t=await this.sendXml({cmdId:547,...void 0!==e?{channel:e}:{}});return{enabled:"1"===H(t,"status")}}catch{return{enabled:!1}}}async setSiren(e,t,A){const s="boolean"==typeof e?A??0:e,r="boolean"==typeof e?e:t,n="boolean"==typeof e?t:A,i=void 0!==s?s+1:void 0;let o;if(void 0!==n)o=Y(i,n);else{o=x(i,r?1:0)}try{await this.sendXml({cmdId:263,...void 0!==s?{channel:s}:{},payloadXml:o})}catch(e){if(!0!==r||void 0!==n)throw e;o=Y(i,2),await this.sendXml({cmdId:263,...void 0!==s?{channel:s}:{},payloadXml:o})}}async getWhiteLedState(e){const t=this.normalizeChannel(e),A=await this.sendXml({cmdId:S,channel:t}),s=H(A,"enable"),r=H(A,"state"),n=H(A,"status"),i=H(A,"brightness_cur"),o={enabled:"1"===s||"1"===r||"1"===n};return void 0!==i&&(o.brightness=Number(i)),o}async setWhiteLedState(e,t,A){const s="number"==typeof e?e:A??0,r="number"==typeof e?t:e,n="number"==typeof e?A:t,i=this.normalizeChannel(s);if(void 0!==r)try{const e=V(i,r?1:0,r?180:0);await this.sendXml({cmdId:288,channel:i,payloadXml:e})}catch(e){let t=await this.sendXml({cmdId:S,channel:i});/<enable>[^<]*<\/enable>/i.test(t)&&(t=t.replace(/<enable>[^<]*<\/enable>/i,`<enable>${r?1:0}</enable>`)),/<state>[^<]*<\/state>/i.test(t)&&(t=t.replace(/<state>[^<]*<\/state>/i,`<state>${r?1:0}</state>`)),/<status>[^<]*<\/status>/i.test(t)&&(t=t.replace(/<status>[^<]*<\/status>/i,`<status>${r?1:0}</status>`)),await this.sendXml({cmdId:290,channel:i,payloadXml:t})}if(void 0!==n){let e=await this.sendXml({cmdId:S,channel:i});/<brightness_cur>[^<]*<\/brightness_cur>/i.test(e)&&(e=e.replace(/<brightness_cur>[^<]*<\/brightness_cur>/i,`<brightness_cur>${n}</brightness_cur>`)),/<enable>[^<]*<\/enable>/i.test(e)&&(e=e.replace(/<enable>[^<]*<\/enable>/i,"<enable>1</enable>")),await this.sendXml({cmdId:290,channel:i,payloadXml:e})}}async getAbilityInfo(){const e=this.client.username,t=`<?xml version="1.0" encoding="UTF-8" ?>\n<Extension version="1.1">\n<userName>${M(e)}</userName>\n<token>system, streaming, PTZ, IO, security, replay, disk, network, alarm, record, video, image</token>\n</Extension>`;const A=await this.sendXml({cmdId:151,extensionXml:t}),s={},r=["system","streaming","PTZ","IO","security","replay","disk","network","alarm","record","video","image"];for(const e of r){const t=new RegExp(`<${e}[^>]*>([\\s\\S]*?)<\\/${e}>`,"i"),r=A.match(t);if(r){const e=(r[1]??"").matchAll(/<subModule[^>]*>([\s\S]*?)<\/subModule>/g);for(const t of e){const e=t[1]??"",A=H(e,"channelId")||H(e,"chnID"),r=H(e,"abilityValue");if(r){const e=A?Number(A):"Host";s[e]||(s[e]={});const t=r.split(",").map((e=>e.trim())).filter(Boolean);for(const A of t)s[e][A]=1}}}}const n=A.match(/<AbilityInfo[^>]*>([\s\S]*?)<\/AbilityInfo>/);if(n){const e=(n[1]??"").matchAll(/<([A-Za-z]+)[^>]*>([^<]*)<\/\1>/g);s.Host||(s.Host={});for(const t of e){const e=t[1],A=t[2];if(e&&void 0!==A&&!["image","video","subModule"].includes(e)&&"channelId"!==e&&"abilityValue"!==e){const t=Number(A);s.Host[e]=Number.isNaN(t)?A:t}}}return s.Host&&0===Object.keys(s.Host).length&&delete s.Host,s}async getAbilityVersion(e,t){const A=(await this.getAbilityInfo())[null!=t?t:"Host"];if(!A)return 0;const s=A[e];if("number"==typeof s)return s;if("string"==typeof s){const e=Number(s);return Number.isNaN(e)?0:e}return 0}async getSupportInfo(){return Qt(await this.sendXml({cmdId:199}))}async getDeviceCapabilities(e,t){const A=null!=e,s=this.normalizeChannel(e),r=t?.probe??!0,n=t?.probeSiren??!0,i=t?.probeFloodlight??!0,[o,a]=await Promise.allSettled([this.getAbilityInfo(),this.getSupportInfo()]),c="fulfilled"===o.status?o.value:void 0,l="fulfilled"===a.status?a.value:void 0,h=c?A?{..."object"==typeof c.Host?{Host:c.Host}:{},..."object"==typeof c[s]?{[s]:c[s]}:{}}:c:void 0,g=l?A?{...l,items:(l.items??[]).filter((e=>e.chnID===s))}:l:void 0,d={channel:s};h&&(d.abilities=h),g&&(d.support=g);const u=Ct(d),E=Et(h,s),I=e=>{if("number"==typeof e)return e>0;if("string"==typeof e){const t=Number(e);return Number.isFinite(t)?t>0:e.length>0&&"0"!==e}return Boolean(e)},Q=g?{rtsp:I(g.rtsp),onvif:I(g.onvif),wifi:I(g.wifi),record:I(g.record),ftp:I(g.ftp),email:I(g.email),pushAlarm:I(g.pushAlarm),audioTalk:I(g.audioTalk)}:void 0;if(r&&n&&!u.hasSiren){const e=async()=>{try{return await this.sendXml({cmdId:547,channel:s,timeoutMs:1e3}),!0}catch{return!1}},t=async()=>{try{const e=x(s+1,0);return await this.sendXml({cmdId:263,channel:s,payloadXml:e,timeoutMs:1e3}),!0}catch{return!1}};(await e()||await t())&&(u.hasSiren=!0)}if(r&&i&&!u.hasFloodlight){const e=(g?.items??[]).filter((e=>e.chnID===s||e.chnID===s+1)),t=e=>{const t=e?.lightType;if("number"==typeof t)return t;if("string"==typeof t){const e=Number(t);return Number.isFinite(e)?e:void 0}},A=e.map((e=>t(e))).filter((e=>Number.isFinite(e)));if(A.some((e=>0===e)));else if(A.some((e=>e>0)))u.hasFloodlight=!0;else try{const e=await this.sendXml({cmdId:S,channel:s,timeoutMs:1e3});/(<FloodlightTask\b|<FloodlightManual\b|<FloodlightStatusList\b|<WhiteLed\b)/i.test(e)&&(u.hasFloodlight=!0)}catch{}}let C,B;try{const e=(H(await this.sendXml({cmdId:299,channel:s,timeoutMs:1500}),"detectType")??"").trim();if(e){const t=e.split(",").map((e=>e.trim())).filter(Boolean);t.length>0&&(C=t)}}catch{}if(u.hasPresets){const e=(await Promise.allSettled([this.getPtzPresets(s)]))[0];"fulfilled"===e?.status&&(B=e.value,u.hasPresets=B.length>0)}const p={channel:s,channelId1Based:s+1,transport:this.client.getTransport(),encryptionKind:this.client.enc.kind,loggedIn:this.client.loggedIn,subscribed:this.client.subscribed,abilitiesAvailable:Boolean(h),supportAvailable:Boolean(g)};E&&(p.abilityMergedKeyCount=Object.keys(E).length),g?.items&&(p.supportItemCount=g.items.length);const f={capabilities:u,debug:p};return h&&(f.abilities=h),g&&(f.support=g),B&&(f.presets=B),C&&(f.objects=C),Q&&(f.features=Q),f}async createRtspStream(e,t,A){const s="number"==typeof e?this.normalizeChannel(e):0,r="number"==typeof e?t:e,n="number"==typeof e?A:t;let i;try{const e=await this.getStreamMetadata(s);if(Array.isArray(e)){const t=e.find((e=>e.profile===r));t?.videoEncType&&(i=t.videoEncType)}else if(e&&"object"==typeof e&&"streams"in e){const t=e.streams;if(Array.isArray(t)){const e=t.find((e=>e?.profile===r));e?.videoEncType&&(i=e.videoEncType)}}}catch(e){this.logger.warn(`[ReolinkBaichuanApi] Could not fetch stream metadata, will auto-detect codec: ${e instanceof Error?e.message:e}`)}const o={api:this,channel:s,profile:r,...void 0!==n?.listenHost?{listenHost:n.listenHost}:{},...void 0!==n?.listenPort?{listenPort:n.listenPort}:{},...void 0!==n?.path?{path:n.path}:{},logger:this.logger},a=new it(o);return await a.start(),this.rtspServers.add(a),a.once("close",(()=>{this.rtspServers.delete(a)})),a}};function Rt(e,t,A){const s=[];let r=0;const n=(e,s)=>{if(4===t)return"be"===A?e.readUInt32BE(s):e.readUInt32LE(s);if(2===t)return"be"===A?e.readUInt16BE(s):e.readUInt16LE(s);if(3===t){const t=e[s],r=e[s+1],n=e[s+2];return"be"===A?(t<<16|r<<8|n)>>>0:(n<<16|r<<8|t)>>>0}return e.readUInt8(s)};for(;r+t<=e.length;){const A=n(e,r);if(r+=t,!A)return[];if(r+A>e.length)return[];const i=e.subarray(r,r+A);r+=A,i.length&&s.push(i)}return r!==e.length?[]:s}function vt(e,t){if(!t.length)return Number.POSITIVE_INFINITY;let A=0;for(const s of t)if(s.length){if(128&s[0])A+=10;else if("H264"===e){const e=31&s[0];(e<1||e>23)&&A++}else if("H265"===e){if(s.length<2){A++;continue}const e=s[0]>>1&63;e>=0&&e<=29||e>=32&&e<=40||e>=48&&e<=50||A++}}else A++;return A}function kt(e,t){if(!e?.length)return[];const A=[],s=function(e,t=64){if(!e?.length)return-1;const A=Math.min(e.length,Math.max(0,t));for(let t=0;t+3<A;t++)if(0===e[t]&&0===e[t+1]){if(1===e[t+2])return t;if(0===e[t+2]&&1===e[t+3])return t}return-1}(e,64);if(s>=0){const t=function(e){const t=[],A=e.length,s=t=>{if(t+3<=A&&0===e[t]&&0===e[t+1]){if(1===e[t+2])return 3;if(t+4<=A&&0===e[t+2]&&1===e[t+3])return 4}return 0};let r=0;for(;r<A&&!s(r);)r++;for(;r<A;){const n=s(r);if(!n){r++;continue}const i=r+n;let o=i;for(;o<A&&!s(o);)o++;if(i<o){const A=e.subarray(i,o);A.length>0&&t.push(A)}r=o}return t}(0===s?e:e.subarray(s));t.length&&A.push(t)}A.push(Rt(e,4,"be")),A.push(Rt(e,4,"le")),A.push(Rt(e,3,"be")),A.push(Rt(e,3,"le")),A.push(Rt(e,2,"be")),A.push(Rt(e,2,"le")),A.push(Rt(e,1,"be"));const r=function(e){if(e.length>=4&&0===e[0]&&0===e[1]){if(1===e[2])return e.subarray(3);if(0===e[2]&&1===e[3])return e.subarray(4)}return e}(e);r.length&&A.push([r]);let n=[],i=Number.POSITIVE_INFINITY;for(const e of A){if(!e.length)continue;const A=vt(t,e);if(A<i&&(i=A,n=e,0===i))break}return n}function Tt(e){const t=kt(e,"H264");let A,s,r;for(const e of t){if(e.length<1)continue;const t=31&e[0];if(7===t){if(A=e,e.length>=4){r=Buffer.from([e[1],e[2],e[3]]).toString("hex")}}else 8===t&&(s=e)}const n={};return A&&(n.sps=A),s&&(n.pps=s),r&&(n.profileLevelId=r),n}function Ft(e){const t=kt(e,"H265");let A,s,r;for(const e of t){if(e.length<2)continue;const t=e[0]>>1&63;32===t?A=e:33===t?s=e:34===t&&(r=e)}const n={};return A&&(n.vps=A),s&&(n.sps=s),r&&(n.pps=r),n}var Mt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];function Ut(e){if(e.length<7)return null;if(255!==e[0]||240&~e[1])return null;const t=!(1&~e[1]),A=((192&e[2])>>6)+1,s=(60&e[2])>>2,r=Mt[s]??0,n=(1&e[2])<<2|(192&e[3])>>6;if(!r||!n)return null;const i=t?7:9;if(e.length<i)return null;return{headerLength:i,sampleRate:r,channels:n,configHex:((31&A)<<11|(15&s)<<7|(15&n)<<3).toString(16).padStart(4,"0")}}var Lt=class{constructor(e){this.payloadType=e,this.seq=s.randomBytes(2).readUInt16BE(0)}seq=0;timestamp=0;ssrc=s.randomBytes(4).readUInt32BE(0);setTimestamp(e){this.timestamp=e>>>0}getTimestamp(){return this.timestamp>>>0}advanceTimestamp(e){this.timestamp=this.timestamp+(e>>>0)>>>0}writePacket(e,t){const A=Buffer.alloc(12);return A[0]=128,A[1]=(t?128:0)|127&this.payloadType,A.writeUInt16BE(65535&this.seq,2),A.writeUInt32BE(this.timestamp>>>0,4),A.writeUInt32BE(this.ssrc>>>0,8),this.seq=this.seq+1&65535,Buffer.concat([A,e])}};function Ht(e,t,A,s,r){const n=A.maxRtpPayload,i=[];if(e.length<=n)return i.push(t.writePacket(e,s&&r)),i;const o=e[0],a=31&o,c=128&o|96&o|28,l=e.subarray(1);let h=0;for(;h<l.length;){const e=l.length-h,A=Math.min(e,n-2),o=0===h,g=h+A>=l.length,d=(o?128:0)|(g?64:0)|31&a,u=Buffer.concat([Buffer.from([c,d]),l.subarray(h,h+A)]);i.push(t.writePacket(u,s&&r&&g)),h+=A}return i}function Pt(e,t,A,s,r){const n=A.maxRtpPayload,i=[];if(e.length<=n)return i.push(t.writePacket(e,s&&r)),i;if(e.length<3)return i;const o=e[0],a=o>>1&63,c=129&o|98,l=e[1],h=e.subarray(2);let g=0;for(;g<h.length;){const e=h.length-g,A=Math.min(e,n-3),o=0===g,d=g+A>=h.length,u=(o?128:0)|(d?64:0)|63&a,E=Buffer.concat([Buffer.from([c,l,u]),h.subarray(g,g+A)]);i.push(t.writePacket(E,s&&r&&d)),g+=A}return i}var xt=class e{constructor(e,t,A,s=25,r=1200){this.logger=e,this.videoPayloadType=t,this.maxRtpPayload=r,this.videoRtp=new Lt(t),void 0!==A&&(this.audioRtp=new Lt(A)),this.fallbackVideoIncrement=Math.max(1,Math.round(this.videoClockRate/Math.max(1,s))),this.fallbackVideoDeltaUs=Math.max(1,Math.round(1e6*this.fallbackVideoIncrement/this.videoClockRate))}clients=new Set;closed=!1;videoRtp;audioRtp;videoLastUsRaw;videoUsWrapOffset=0;videoLastAbsUs;videoAvgDeltaUs;videoClockRate=9e4;fallbackVideoIncrement;fallbackVideoDeltaUs;maxTrustedDeltaUs=5e5;emaAlpha=.1;videoTimingLogState={lastUntrustedDeltaLogMs:0,lastWrapLogMs:0,lastResetLogMs:0,untrustedDeltaCount:0,wrapCount:0,resetCount:0};cachedH264ParamSetsAnnexB;cachedH265ParamSetsAnnexB;addClient(e){if(this.closed)return void e.destroy();const t={socket:e,needsKeyframe:!0,sentVideoConfig:!1};this.clients.add(t);const A=()=>{this.clients.delete(t);try{e.destroy()}catch{}};e.on("error",A),e.on("close",A)}static ANNEXB_START_CODE=Buffer.from([0,0,0,1]);static joinAnnexBNals(...t){const A=t.filter((e=>!!e&&e.length>0));if(!A.length)return;const s=[];for(const t of A)s.push(e.ANNEXB_START_CODE,t);return Buffer.concat(s)}updateVideoParamSetsFromAccessUnit(t,A){if(!A?.length)return;if("H264"===t){const{sps:t,pps:s}=Tt(A);return void(t&&s&&(this.cachedH264ParamSetsAnnexB=e.joinAnnexBNals(t,s)))}const{vps:s,sps:r,pps:n}=Ft(A);s&&r&&n&&(this.cachedH265ParamSetsAnnexB=e.joinAnnexBNals(s,r,n))}sendCachedVideoConfigToClient(e,t){if(this.closed)return;if(t.sentVideoConfig)return;const A="H265"===e?this.cachedH265ParamSetsAnnexB:this.cachedH264ParamSetsAnnexB;if(!A?.length)return;const s=kt(A,e);if(!s.length)return;const r={maxRtpPayload:this.maxRtpPayload};for(let A=0;A<s.length;A++){const n=s[A],i=A===s.length-1,o="H265"===e?Pt(n,this.videoRtp,r,!1,i):Ht(n,this.videoRtp,r,!1,i);for(const e of o)this.writeRtpPacketToClient(t,e)}t.sentVideoConfig=!0}close(){if(!this.closed){this.closed=!0;for(const e of Array.from(this.clients))try{e.socket.destroy()}catch{}this.clients.clear()}}writeRtpPacketToClient(e,t){if(e.socket.destroyed||!e.socket.writable)return;const A=Buffer.alloc(2);A.writeUInt16BE(65535&t.length,0);const s=Buffer.concat([A,t]);try{e.socket.write(s)}catch{try{e.socket.destroy()}catch{}}}writeRtpPacketToClients(e,t){for(const A of this.clients)t(A)&&this.writeRtpPacketToClient(A,e)}resetVideoTimestampMapping(){this.videoLastUsRaw=void 0,this.videoUsWrapOffset=0,this.videoLastAbsUs=void 0,this.videoAvgDeltaUs=void 0}logVideoTiming(e,t){const A=Date.now(),s=5e3,r=this.videoTimingLogState;if("untrusted-delta"===e){if(r.untrustedDeltaCount++,A-r.lastUntrustedDeltaLogMs<s)return;return r.lastUntrustedDeltaLogMs=A,void this.logger.warn(`[rfc4571] video timing: ${t} (untrustedDeltaCount=${r.untrustedDeltaCount})`)}if("wrap"===e){if(r.wrapCount++,A-r.lastWrapLogMs<s)return;return r.lastWrapLogMs=A,void this.logger.warn(`[rfc4571] video timing: ${t} (wrapCount=${r.wrapCount})`)}r.resetCount++,A-r.lastResetLogMs<s||(r.lastResetLogMs=A,this.logger.warn(`[rfc4571] video timing: ${t} (resetCount=${r.resetCount})`))}advanceVideoTimestampFallback(){this.videoRtp.advanceTimestamp(this.fallbackVideoIncrement)}setVideoTimestampFromMicroseconds(e){if(null==e)return void this.advanceVideoTimestampFallback();if(!Number.isFinite(e))return void this.advanceVideoTimestampFallback();const t=e>>>0;if(void 0!==this.videoLastUsRaw){const e=this.videoLastUsRaw;if(t<e){e>4026531840&&t<268435455?(this.videoUsWrapOffset+=4294967296,this.logVideoTiming("wrap",`detected u32 wrap (lastUsRaw=${e} curUsRaw=${t} wrapOffset=${this.videoUsWrapOffset})`)):(this.logVideoTiming("reset",`detected backwards jump; resetting mapping (lastUsRaw=${e} curUsRaw=${t})`),this.resetVideoTimestampMapping())}}this.videoLastUsRaw=t;const A=this.videoUsWrapOffset+t;if(void 0===this.videoLastAbsUs)return this.videoLastAbsUs=A,void(void 0===this.videoAvgDeltaUs&&(this.videoAvgDeltaUs=this.fallbackVideoDeltaUs));const s=A-this.videoLastAbsUs;this.videoLastAbsUs=A;let r;if(Number.isFinite(s)&&s>0&&s<=this.maxTrustedDeltaUs){const e=this.videoAvgDeltaUs??s;this.videoAvgDeltaUs=e+(s-e)*this.emaAlpha,r=s}else this.logVideoTiming("untrusted-delta",`discarded deltaUs=${s} (absUs=${A} lastAbsUs=${this.videoLastAbsUs} avgDeltaUs=${this.videoAvgDeltaUs??"n/a"}); using fallback`),r=this.videoAvgDeltaUs??this.fallbackVideoDeltaUs;const n=Math.max(1,Math.round(r*this.videoClockRate/1e6));this.videoRtp.advanceTimestamp(n)}sendVideoAccessUnit(e,t,A,s){if(this.closed)return;this.updateVideoParamSetsFromAccessUnit(e,t);const r=kt(t,e);if(!r.length)return;let n=!1;if("H264"===e)for(const e of r){if(5===(31&e[0])){n=!0;break}}else for(const e of r){if(e.length<2)continue;const t=e[0]>>1&63;if(t>=16&&t<=23){n=!0;break}}const i=A||n,o=e=>!!i||!e.needsKeyframe;let a=!1;for(const e of this.clients)if(o(e)){a=!0;break}if(!a){for(const t of this.clients)t.needsKeyframe&&this.sendCachedVideoConfigToClient(e,t);return}this.setVideoTimestampFromMicroseconds(s);for(const t of this.clients)t.needsKeyframe&&this.sendCachedVideoConfigToClient(e,t);const c={maxRtpPayload:this.maxRtpPayload};for(let t=0;t<r.length;t++){const A=r[t],s=t===r.length-1,n="H265"===e?Pt(A,this.videoRtp,c,!0,s):Ht(A,this.videoRtp,c,!0,s);for(const e of n)this.writeRtpPacketToClients(e,o)}if(i)for(const e of this.clients)e.needsKeyframe=!1}sendAudioAdtsFrame(e){if(this.closed)return{};if(!this.audioRtp)return{};const{packets:t,config:A}=function(e,t){const A=Ut(e);if(!A)return{packets:[]};const s=e.subarray(A.headerLength);if(!s.length)return{packets:[]};const r=Buffer.from([0,16]),n=8191&s.length,i=Buffer.alloc(2);i[0]=n>>5&255,i[1]=(31&n)<<3;const o=Buffer.concat([r,i,s]);return{packets:[t.writePacket(o,!0)],config:{sampleRate:A.sampleRate,channels:A.channels,configHex:A.configHex}}}(e,this.audioRtp);for(const e of t)this.writeRtpPacketToClients(e,(e=>!e.needsKeyframe));return t.length&&this.audioRtp.advanceTimestamp(1024),A?{parsed:A}:{}}sendAudioRtpPacket(e){if(this.closed)return;if(!e||e.length<12)return;2===(e[0]>>6&3)&&this.writeRtpPacketToClients(e,(e=>!e.needsKeyframe))}static parseRtpPayload(e){if(!e||e.length<12)return;if(2!==(e[0]>>6&3))return;const t=!!(32&e[0]),A=!!(16&e[0]);let s=12+4*(15&e[0]);if(s>e.length)return;if(A){if(s+4>e.length)return;if(s+=4+4*e.readUInt16BE(s+2),s>e.length)return}let r=e.length;if(t){const t=e[e.length-1];if(t<=0||t>e.length)return;if(r=e.length-t,r<s)return}return r<=s?void 0:e.subarray(s,r)}static isH264KeyframeLikeRtpPacket(t){const A=e.parseRtpPayload(t);if(!A||A.length<1)return!1;const s=31&A[0];if(s>=1&&s<=23)return 5===s||7===s||8===s;if(24===s){let e=1;for(;e+2<=A.length;){const t=A.readUInt16BE(e);if(e+=2,!t||e+t>A.length)break;const s=31&A[e];if(5===s||7===s||8===s)return!0;e+=t}return!1}if(28===s&&A.length>=2){const e=A[1],t=31&e;return!!!!(128&e)&&(5===t||7===t||8===t)}return!1}static isH265KeyframeLikeRtpPacket(t){const A=e.parseRtpPayload(t);if(!A||A.length<2)return!1;const s=A[0]>>1&63,r=e=>e>=16&&e<=21||(32===e||33===e||34===e);if(49===s&&A.length>=3){const e=A[2];return!!!!(128&e)&&r(63&e)}return r(s)}sendVideoRtpPacket(t,A){if(this.closed)return;if(!A||A.length<12)return;if(2!==(A[0]>>6&3))return;const s="H265"===t?e.isH265KeyframeLikeRtpPacket(A):e.isH264KeyframeLikeRtpPacket(A);if(this.writeRtpPacketToClients(A,(e=>!!s||!e.needsKeyframe)),s)for(const e of this.clients)e.needsKeyframe=!1}};async function Yt(e){const{api:t,channel:A,profile:s,logger:r,expectedVideoType:i,host:o="127.0.0.1",videoPayloadType:a=96,audioPayloadType:c=97,keyframeTimeoutMs:l=5e3,uptimeRestartMs:h=1e4,idleTeardownMs:g=2500,closeApiOnTeardown:d=!0,username:u,password:E,requireAuth:I=!1}=e,Q=`[native-rfc4571 ch=${A} profile=${s}]`,C=e=>r.warn(`${Q} ${e}`);C(`starting (host=${o} videoPT=${a} audioPT=${c} expectedVideoType=${i??"n/a"} keyframeTimeoutMs=${l} uptimeRestartMs=${h} idleTeardownMs=${g})`);const B=new ze({client:t.client,api:t,channel:A,profile:s,logger:r});await B.start(),C("baichuan stream started; waiting for keyframe to extract parameter sets");const p=await(async()=>await new Promise(((e,t)=>{const r=setTimeout((()=>{o(),t(new Error(`Timeout waiting for keyframe on native stream channel=${A} profile=${s}`))}),l),n=e=>{o(),t(e instanceof Error?e:new Error(String(e)))},i=t=>{if(!t?.isKeyframe)return;const A=t.videoType,s=t.data;if("H264"===A){const{sps:t,pps:r,profileLevelId:n}=Tt(s);if(!t||!r)return;return o(),void e({videoType:A,accessUnit:s,...n?{profileLevelId:n}:{},h264:{sps:t,pps:r}})}const{vps:r,sps:n,pps:i}=Ft(s);r&&n&&i&&(o(),e({videoType:A,accessUnit:s,h265:{vps:r,sps:n,pps:i}}))},o=()=>{clearTimeout(r),B.removeListener("error",n),B.removeListener("videoAccessUnit",i)};B.on("error",n),B.on("videoAccessUnit",i)})))();i&&p.videoType!==i&&C(`expectedVideoType mismatch (expected=${i} actual=${p.videoType})`),C(`video detected: codec=${p.videoType} (primed via keyframe)`);let f,m=25;try{const e=await t.getStreamMetadata(A),r=(Array.isArray(e)?e:Array.isArray(e?.streams)?e.streams:[]).find((e=>e?.profile===s)),n=Number(r?.frameRate);Number.isFinite(n)&&n>0&&(m=n)}catch{}C(`video framerate hint: ${m} fps`);f=await(async()=>await new Promise((e=>{let t=!1,A=3;const s=setTimeout((()=>{i(),t&&r.warn("Native audio frames seen but not ADTS AAC; cannot advertise audio track."),e(void 0)}),5e3),n=s=>{t=!0;const n=Ut(s);if(n)i(),e({sampleRate:n.sampleRate,channels:n.channels,configHex:n.configHex});else if(A-- >0){const e=s.subarray(0,Math.min(16,s.length)).toString("hex");r.warn(`Native audioFrame not ADTS: len=${s.length} head=${e}`)}},i=()=>{clearTimeout(s),B.removeListener("audioFrame",n)};B.on("audioFrame",n)})))(),C(f?`audio detected: codec=aac sampleRate=${f.sampleRate} channels=${f.channels}`:"audio not detected/advertised (no ADTS AAC config within timeout)");const y={videoType:p.videoType,payloadType:a,..."H264"===p.videoType?{h264:{sps:p.h264.sps,pps:p.h264.pps,...p.profileLevelId?{profileLevelId:p.profileLevelId}:{}}}:{h265:{vps:p.h265.vps,sps:p.h265.sps,pps:p.h265.pps}}},S=f?{codec:"aac",payloadType:c,sampleRate:f.sampleRate,channels:f.channels,configHex:f.configHex}:void 0,w=function(e,t){let A="v=0\r\n";if(A+="o=- 0 0 IN IP4 0.0.0.0\r\n",A+="s=No Name\r\n",A+="t=0 0\r\n",A+=`m=video 0 RTP/AVP ${e.payloadType}\r\n`,A+="c=IN IP4 0.0.0.0\r\n",A+=`a=rtpmap:${e.payloadType} ${e.videoType}/90000\r\n`,"H264"===e.videoType&&e.h264){const t=e.h264.sps.toString("base64"),s=e.h264.pps.toString("base64"),r=e.h264.profileLevelId?`profile-level-id=${e.h264.profileLevelId};`:"";A+=`a=fmtp:${e.payloadType} packetization-mode=1;${r}sprop-parameter-sets=${t},${s}\r\n`}if("H265"===e.videoType&&e.h265){const t=e.h265.vps.toString("base64"),s=e.h265.sps.toString("base64"),r=e.h265.pps.toString("base64");A+=`a=fmtp:${e.payloadType} sprop-vps=${t};sprop-sps=${s};sprop-pps=${r}\r\n`}return"aac"===t?.codec&&(A+=`m=audio 0 RTP/AVP ${t.payloadType}\r\n`,A+="c=IN IP4 0.0.0.0\r\n",A+="b=AS:128\r\n",A+=`a=rtpmap:${t.payloadType} MPEG4-GENERIC/${t.sampleRate}/${t.channels}\r\n`,A+=`a=fmtp:${t.payloadType} profile-level-id=1; mode=AAC-hbr; sizelength=13; indexlength=3; indexdeltalength=3; config=${t.configHex}\r\n`),"opus"===t?.codec&&(A+=`m=audio 0 RTP/AVP ${t.payloadType}\r\n`,A+="c=IN IP4 0.0.0.0\r\n",A+="b=AS:128\r\n",A+=`a=rtpmap:${t.payloadType} opus/${t.sampleRate}/${t.channels}\r\n`),A}(y,S),D=()=>new xt(r,a,S?c:void 0,m);let b=D();C(`SDP ready (video=${p.videoType}/90000 pt=${a}${S?`, audio=aac/${S.sampleRate}/${S.channels} pt=${c}`:", audio=none"})`);let N=0;const R=new Set;let v,k=!1,T=!1,F=Date.now();const M=()=>{F=Date.now()},U=()=>{v&&(clearTimeout(v),v=void 0)};let L;const H=e=>{g&&(v||(v=setTimeout((()=>{v=void 0,0===N&&e(new Error("No RFC4571 clients (idle)")).catch((()=>{}))}),g)))},P=n.createServer(),x=async e=>{if(k)return;if(T)return;T=!0,M(),U();const t=e?.message||e?.toString?.()||e,A=P.address(),s=A&&"string"!=typeof A?`${A.address}:${A.port}`:"unbound";C(t?`uptime watchdog: restarting (addr=${s} clients=${N} reason=${t})`:`uptime watchdog: restarting (addr=${s} clients=${N})`);for(const e of Array.from(R))try{e.destroy()}catch{}R.clear();try{b.close()}catch{}b=D();try{await B.stop()}catch{}try{await B.start()}catch(e){return T=!1,void Y(e).catch((()=>{}))}T=!1,M(),C("uptime watchdog: restart complete"),0===N&&H(Y)},Y=async e=>{if(k)return;k=!0,L&&(clearInterval(L),L=void 0),U();const A=e?.message||e?.toString?.()||e,s=P.address(),r=s&&"string"!=typeof s?`${s.address}:${s.port}`:"unbound";C(A?`teardown requested (addr=${r} clients=${N} reason=${A})`:`teardown requested (addr=${r} clients=${N})`),b.close();try{await B.stop()}catch{}if(d)try{await t.close()}catch{}try{P.close()}catch{}C("teardown complete")};P.on("connection",(e=>{M();const t=`${e.remoteAddress??"unknown"}:${e.remotePort??"unknown"}`;C(`client connecting (remote=${t} requireAuth=${I})`);const A=()=>{N++,U(),R.add(e),e.on("data",(()=>M()));try{const t=e.write.bind(e);e.write=(...e)=>(M(),t(...e))}catch{}b.addClient(e),C(`client connected (remote=${t} clients=${N})`)};if(I){let s=!1,r=Buffer.alloc(0);const n=setTimeout((()=>{s||(C(`client authentication timeout (remote=${t})`),e.destroy())}),5e3),i=o=>{if(M(),!s){r=Buffer.concat([r,o]);const a=r.toString("utf8").match(/^([^:]+):([^\n]+)\n/);if(a){const[,o,c]=a;if(o!==u||c!==E)return C(`client authentication failed (remote=${t})`),void e.destroy();{s=!0,clearTimeout(n),A();const t=a[0].length,o=r.subarray(t);e.removeListener("data",i),e.on("data",(()=>M())),o.length>0&&e.emit("data",o)}}else if(r.length>1024)return C(`client authentication buffer overflow (remote=${t})`),void e.destroy()}};e.on("data",i)}else A();let s=!0;const r=()=>{s&&(s=!1,N=Math.max(0,N-1),R.delete(e),C(`client disconnected (remote=${t} clients=${N})`),0===N&&H(Y))};e.once("close",r),e.once("error",r)})),B.on("videoAccessUnit",(e=>{M();try{b.sendVideoAccessUnit(e.videoType,e.data,e.isKeyframe,e.microseconds)}catch(e){Y(e).catch((()=>{}))}})),S&&B.on("audioFrame",(e=>{M();try{b.sendAudioAdtsFrame(e)}catch(e){Y(e).catch((()=>{}))}})),B.on("error",(e=>{T||Y(e).catch((()=>{}))})),B.on("close",(e=>{T||Y(e).catch((()=>{}))})),await new Promise(((e,t)=>{P.once("error",t),P.listen(0,o,(()=>e()))}));const V=P.address();if(!V||"string"==typeof V)throw new Error("Failed to bind RFC TCP server");const G=V.port;if(!G)throw new Error("Failed to bind RFC TCP server");C(`listening (addr=${o}:${G})`);const O=S?{codec:"aac",sampleRate:S.sampleRate,channels:S.channels}:void 0;return H(Y),(()=>{if(!h||h<=0)return;if(L)return;const e=Math.max(250,Math.min(1e3,Math.floor(h/2)));L=setInterval((()=>{if(k||T)return;const e=Date.now()-F;e<h||x(new Error(`No stream activity for ${e}ms (threshold=${h}ms)`)).catch((()=>{}))}),e)})(),{host:o,port:G,sdp:w,videoType:p.videoType,...O?{audio:O}:{},username:u,password:E,server:P,videoStream:B,close:Y}}var Vt=Buffer.from([0,0,0,1]),Gt=Buffer.from([0,0,1]);function Ot(e){const t=[];for(let A=0;A<e.length-3;A++)0===e[A]&&0===e[A+1]&&(1===e[A+2]?(t.push({idx:A,len:3}),A+=2):0===e[A+2]&&1===e[A+3]&&(t.push({idx:A,len:4}),A+=3));if(0===t.length)return[];const A=[];for(let s=0;s<t.length;s++){const r=t[s],n=r.idx+r.len,i=t[s+1],o=i?i.idx:e.length;o>n&&A.push(e.subarray(n,o))}return A}function Jt(e){if(e.length<1)return null;const t=e[0];return void 0===t?null:31&t}r.EventEmitter}},t={};function A(s){var r=t[s];if(void 0!==r)return r.exports;var n=t[s]={id:s,loaded:!1,exports:{}};return e[s].call(n.exports,n,n.exports,A),n.loaded=!0,n.exports}A.d=(e,t)=>{for(var s in t)A.o(t,s)&&!A.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},A.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),A.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var s=A(7927),r=exports="undefined"==typeof exports?{}:exports;for(var n in s)r[n]=s[n];s.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
3
3
  //# sourceMappingURL=main.nodejs.js.map